@usertour/helpers 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-OASNBRBF.js +589 -0
- package/dist/chunk-Y6FPPOKF.js +28 -0
- package/dist/conditions.cjs +757 -0
- package/dist/conditions.d.cts +23 -0
- package/dist/conditions.d.ts +23 -0
- package/dist/conditions.js +44 -0
- package/dist/index.cjs +589 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +53 -14
- package/dist/listener.cjs +68 -0
- package/dist/listener.d.cts +7 -0
- package/dist/listener.d.ts +7 -0
- package/dist/listener.js +16 -0
- package/package.json +5 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ContentPriority, RulesCondition, SDKContent, BizEvent, BizSession, RulesType } from '@usertour/types';
|
|
2
|
+
|
|
3
|
+
declare const PRIORITIES: ContentPriority[];
|
|
4
|
+
declare const isVisible: (el: HTMLElement) => Promise<boolean>;
|
|
5
|
+
type RewriteRulesCondition = Partial<Record<RulesType, boolean>>;
|
|
6
|
+
declare const activedRulesConditions: (conditions: RulesCondition[], rewrite?: RewriteRulesCondition) => Promise<RulesCondition[]>;
|
|
7
|
+
declare const activedContentRulesConditions: (conditions: RulesCondition[], contents: SDKContent[]) => Promise<RulesCondition[]>;
|
|
8
|
+
declare const activedContentCondition: (contents: SDKContent[]) => Promise<SDKContent[]>;
|
|
9
|
+
declare const isActive: (autoStartRules: RulesCondition[]) => boolean;
|
|
10
|
+
declare const isActiveContent: (content: SDKContent) => boolean;
|
|
11
|
+
declare const filterAutoStartContent: (contents: SDKContent[], type: string) => SDKContent[];
|
|
12
|
+
declare const isHasActivedContents: (source: SDKContent[], dest: SDKContent[]) => boolean;
|
|
13
|
+
declare const isSameContents: (source: SDKContent[], dest: SDKContent[]) => boolean;
|
|
14
|
+
declare const findLatestEvent: (bizEvents: BizEvent[]) => BizEvent;
|
|
15
|
+
declare const checklistIsDimissed: (latestSession?: BizSession) => BizEvent | undefined;
|
|
16
|
+
declare const flowIsDismissed: (latestSession?: BizSession) => BizEvent | undefined;
|
|
17
|
+
declare const flowIsSeen: (latestSession?: BizSession) => BizEvent | undefined;
|
|
18
|
+
declare const checklistIsSeen: (latestSession?: BizSession) => BizEvent | undefined;
|
|
19
|
+
declare const isValidContent: (content: SDKContent, contents: SDKContent[]) => boolean;
|
|
20
|
+
declare const parseUrlParams: (url: string, paramName: string) => string | null;
|
|
21
|
+
declare const wait: (seconds: number) => Promise<void>;
|
|
22
|
+
|
|
23
|
+
export { PRIORITIES, activedContentCondition, activedContentRulesConditions, activedRulesConditions, checklistIsDimissed, checklistIsSeen, filterAutoStartContent, findLatestEvent, flowIsDismissed, flowIsSeen, isActive, isActiveContent, isHasActivedContents, isSameContents, isValidContent, isVisible, parseUrlParams, wait };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ContentPriority, RulesCondition, SDKContent, BizEvent, BizSession, RulesType } from '@usertour/types';
|
|
2
|
+
|
|
3
|
+
declare const PRIORITIES: ContentPriority[];
|
|
4
|
+
declare const isVisible: (el: HTMLElement) => Promise<boolean>;
|
|
5
|
+
type RewriteRulesCondition = Partial<Record<RulesType, boolean>>;
|
|
6
|
+
declare const activedRulesConditions: (conditions: RulesCondition[], rewrite?: RewriteRulesCondition) => Promise<RulesCondition[]>;
|
|
7
|
+
declare const activedContentRulesConditions: (conditions: RulesCondition[], contents: SDKContent[]) => Promise<RulesCondition[]>;
|
|
8
|
+
declare const activedContentCondition: (contents: SDKContent[]) => Promise<SDKContent[]>;
|
|
9
|
+
declare const isActive: (autoStartRules: RulesCondition[]) => boolean;
|
|
10
|
+
declare const isActiveContent: (content: SDKContent) => boolean;
|
|
11
|
+
declare const filterAutoStartContent: (contents: SDKContent[], type: string) => SDKContent[];
|
|
12
|
+
declare const isHasActivedContents: (source: SDKContent[], dest: SDKContent[]) => boolean;
|
|
13
|
+
declare const isSameContents: (source: SDKContent[], dest: SDKContent[]) => boolean;
|
|
14
|
+
declare const findLatestEvent: (bizEvents: BizEvent[]) => BizEvent;
|
|
15
|
+
declare const checklistIsDimissed: (latestSession?: BizSession) => BizEvent | undefined;
|
|
16
|
+
declare const flowIsDismissed: (latestSession?: BizSession) => BizEvent | undefined;
|
|
17
|
+
declare const flowIsSeen: (latestSession?: BizSession) => BizEvent | undefined;
|
|
18
|
+
declare const checklistIsSeen: (latestSession?: BizSession) => BizEvent | undefined;
|
|
19
|
+
declare const isValidContent: (content: SDKContent, contents: SDKContent[]) => boolean;
|
|
20
|
+
declare const parseUrlParams: (url: string, paramName: string) => string | null;
|
|
21
|
+
declare const wait: (seconds: number) => Promise<void>;
|
|
22
|
+
|
|
23
|
+
export { PRIORITIES, activedContentCondition, activedContentRulesConditions, activedRulesConditions, checklistIsDimissed, checklistIsSeen, filterAutoStartContent, findLatestEvent, flowIsDismissed, flowIsSeen, isActive, isActiveContent, isHasActivedContents, isSameContents, isValidContent, isVisible, parseUrlParams, wait };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PRIORITIES,
|
|
3
|
+
activedContentCondition,
|
|
4
|
+
activedContentRulesConditions,
|
|
5
|
+
activedRulesConditions,
|
|
6
|
+
checklistIsDimissed,
|
|
7
|
+
checklistIsSeen,
|
|
8
|
+
filterAutoStartContent,
|
|
9
|
+
findLatestEvent,
|
|
10
|
+
flowIsDismissed,
|
|
11
|
+
flowIsSeen,
|
|
12
|
+
isActive,
|
|
13
|
+
isActiveContent,
|
|
14
|
+
isHasActivedContents,
|
|
15
|
+
isSameContents,
|
|
16
|
+
isValidContent,
|
|
17
|
+
isVisible,
|
|
18
|
+
parseUrlParams,
|
|
19
|
+
wait
|
|
20
|
+
} from "./chunk-OASNBRBF.js";
|
|
21
|
+
import "./chunk-Y6FPPOKF.js";
|
|
22
|
+
import "./chunk-H7VA3ML2.js";
|
|
23
|
+
import "./chunk-FNQIIEWK.js";
|
|
24
|
+
import "./chunk-XEO3YXBM.js";
|
|
25
|
+
export {
|
|
26
|
+
PRIORITIES,
|
|
27
|
+
activedContentCondition,
|
|
28
|
+
activedContentRulesConditions,
|
|
29
|
+
activedRulesConditions,
|
|
30
|
+
checklistIsDimissed,
|
|
31
|
+
checklistIsSeen,
|
|
32
|
+
filterAutoStartContent,
|
|
33
|
+
findLatestEvent,
|
|
34
|
+
flowIsDismissed,
|
|
35
|
+
flowIsSeen,
|
|
36
|
+
isActive,
|
|
37
|
+
isActiveContent,
|
|
38
|
+
isHasActivedContents,
|
|
39
|
+
isSameContents,
|
|
40
|
+
isValidContent,
|
|
41
|
+
isVisible,
|
|
42
|
+
parseUrlParams,
|
|
43
|
+
wait
|
|
44
|
+
};
|