|
@@ -1,4 +1,5 @@
|
|
import { nanoid } from 'nanoid';
|
|
import { nanoid } from 'nanoid';
|
|
|
|
+import { visibleInViewport } from '@/utils/helper';
|
|
import FindElement from '@/utils/FindElement';
|
|
import FindElement from '@/utils/FindElement';
|
|
import { automaRefDataStr } from './utils';
|
|
import { automaRefDataStr } from './utils';
|
|
|
|
|
|
@@ -11,6 +12,8 @@ function handleConditionElement({ data, type }) {
|
|
const elementActions = {
|
|
const elementActions = {
|
|
exists: () => Boolean(element),
|
|
exists: () => Boolean(element),
|
|
text: () => element?.innerText ?? null,
|
|
text: () => element?.innerText ?? null,
|
|
|
|
+ visibleInViewport: () => visibleInViewport(element),
|
|
|
|
+ hiddenInViewport: () => !elementActions.visibleInViewport(),
|
|
visible: () => {
|
|
visible: () => {
|
|
if (!element) return false;
|
|
if (!element) return false;
|
|
|
|
|