@usertour/helpers 0.0.5 → 0.0.7
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-7IK5Q5N2.js +591 -0
- package/dist/chunk-DEG6MTU7.js +318 -0
- package/dist/chunk-Y6FPPOKF.js +28 -0
- package/dist/conditions.cjs +1001 -0
- package/dist/conditions.d.cts +23 -0
- package/dist/conditions.d.ts +23 -0
- package/dist/conditions.js +45 -0
- package/dist/finderx.cjs +346 -0
- package/dist/finderx.d.cts +47 -0
- package/dist/finderx.d.ts +47 -0
- package/dist/finderx.js +15 -0
- package/dist/index.cjs +913 -2
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +68 -17
- 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 +14 -9
package/dist/index.d.cts
CHANGED
|
@@ -13,6 +13,8 @@ export { generateAutoStateColors, hexToHSLString, hexToRGBStr } from './color.cj
|
|
|
13
13
|
export { absoluteUrl, cn, cuid, evalCode, formatDate, getRandomColor, hexToRgb, isDark, uuidV4 } from './helper.cjs';
|
|
14
14
|
export { GenerateLicenseOptions, JWTLicenseSigner, JWTLicenseSignerOptions } from './jwt-license-signer.cjs';
|
|
15
15
|
export { JWTLicenseValidator } from './jwt-license-validator.cjs';
|
|
16
|
+
export { PRIORITIES, activedContentCondition, activedContentRulesConditions, activedRulesConditions, checklistIsDimissed, checklistIsSeen, filterAutoStartContent, findLatestEvent, flowIsDismissed, flowIsSeen, isActive, isActiveContent, isHasActivedContents, isSameContents, isValidContent, isVisible, parseUrlParams, wait } from './conditions.cjs';
|
|
17
|
+
export { Options, Target, TargetResult, XData, XNode, XResult, finder, finderV2, finderX, parserV2, parserX } from './finderx.cjs';
|
|
16
18
|
export { default as isEqual } from 'fast-deep-equal';
|
|
17
19
|
import '@usertour/types';
|
|
18
20
|
import './storage.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export { generateAutoStateColors, hexToHSLString, hexToRGBStr } from './color.js
|
|
|
13
13
|
export { absoluteUrl, cn, cuid, evalCode, formatDate, getRandomColor, hexToRgb, isDark, uuidV4 } from './helper.js';
|
|
14
14
|
export { GenerateLicenseOptions, JWTLicenseSigner, JWTLicenseSignerOptions } from './jwt-license-signer.js';
|
|
15
15
|
export { JWTLicenseValidator } from './jwt-license-validator.js';
|
|
16
|
+
export { PRIORITIES, activedContentCondition, activedContentRulesConditions, activedRulesConditions, checklistIsDimissed, checklistIsSeen, filterAutoStartContent, findLatestEvent, flowIsDismissed, flowIsSeen, isActive, isActiveContent, isHasActivedContents, isSameContents, isValidContent, isVisible, parseUrlParams, wait } from './conditions.js';
|
|
17
|
+
export { Options, Target, TargetResult, XData, XNode, XResult, finder, finderV2, finderX, parserV2, parserX } from './finderx.js';
|
|
16
18
|
export { default as isEqual } from 'fast-deep-equal';
|
|
17
19
|
import '@usertour/types';
|
|
18
20
|
import './storage.js';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defaultStep
|
|
3
|
+
} from "./chunk-FW54TSA3.js";
|
|
1
4
|
import {
|
|
2
5
|
deepClone
|
|
3
6
|
} from "./chunk-2AEGAICC.js";
|
|
@@ -21,9 +24,6 @@ import {
|
|
|
21
24
|
import {
|
|
22
25
|
JWTLicenseValidator
|
|
23
26
|
} from "./chunk-Y5PCSFVZ.js";
|
|
24
|
-
import {
|
|
25
|
-
defaultStep
|
|
26
|
-
} from "./chunk-FW54TSA3.js";
|
|
27
27
|
import {
|
|
28
28
|
getAuthToken,
|
|
29
29
|
removeAuthToken,
|
|
@@ -31,6 +31,48 @@ import {
|
|
|
31
31
|
storage
|
|
32
32
|
} from "./chunk-FGFMTWFT.js";
|
|
33
33
|
import "./chunk-3ZGH3NRU.js";
|
|
34
|
+
import {
|
|
35
|
+
PRIORITIES,
|
|
36
|
+
activedContentCondition,
|
|
37
|
+
activedContentRulesConditions,
|
|
38
|
+
activedRulesConditions,
|
|
39
|
+
checklistIsDimissed,
|
|
40
|
+
checklistIsSeen,
|
|
41
|
+
filterAutoStartContent,
|
|
42
|
+
findLatestEvent,
|
|
43
|
+
flowIsDismissed,
|
|
44
|
+
flowIsSeen,
|
|
45
|
+
isActive,
|
|
46
|
+
isActiveContent,
|
|
47
|
+
isHasActivedContents,
|
|
48
|
+
isSameContents,
|
|
49
|
+
isValidContent,
|
|
50
|
+
isVisible,
|
|
51
|
+
parseUrlParams,
|
|
52
|
+
wait
|
|
53
|
+
} from "./chunk-7IK5Q5N2.js";
|
|
54
|
+
import {
|
|
55
|
+
finder,
|
|
56
|
+
finderV2,
|
|
57
|
+
finderX,
|
|
58
|
+
parserV2,
|
|
59
|
+
parserX
|
|
60
|
+
} from "./chunk-DEG6MTU7.js";
|
|
61
|
+
import "./chunk-Y6FPPOKF.js";
|
|
62
|
+
import {
|
|
63
|
+
AbortController,
|
|
64
|
+
ArrayProto,
|
|
65
|
+
XMLHttpRequest,
|
|
66
|
+
assignableWindow,
|
|
67
|
+
document,
|
|
68
|
+
fetch,
|
|
69
|
+
location,
|
|
70
|
+
nativeForEach,
|
|
71
|
+
nativeIndexOf,
|
|
72
|
+
navigator,
|
|
73
|
+
userAgent,
|
|
74
|
+
win
|
|
75
|
+
} from "./chunk-H7VA3ML2.js";
|
|
34
76
|
import {
|
|
35
77
|
conditionsIsSame,
|
|
36
78
|
isEqual,
|
|
@@ -91,31 +133,23 @@ import {
|
|
|
91
133
|
hasError,
|
|
92
134
|
isValidSelector
|
|
93
135
|
} from "./chunk-G5P7KULU.js";
|
|
94
|
-
import {
|
|
95
|
-
AbortController,
|
|
96
|
-
ArrayProto,
|
|
97
|
-
XMLHttpRequest,
|
|
98
|
-
assignableWindow,
|
|
99
|
-
document,
|
|
100
|
-
fetch,
|
|
101
|
-
location,
|
|
102
|
-
nativeForEach,
|
|
103
|
-
nativeIndexOf,
|
|
104
|
-
navigator,
|
|
105
|
-
userAgent,
|
|
106
|
-
win
|
|
107
|
-
} from "./chunk-H7VA3ML2.js";
|
|
108
136
|
import "./chunk-XEO3YXBM.js";
|
|
109
137
|
export {
|
|
110
138
|
AbortController,
|
|
111
139
|
ArrayProto,
|
|
112
140
|
JWTLicenseSigner,
|
|
113
141
|
JWTLicenseValidator,
|
|
142
|
+
PRIORITIES,
|
|
114
143
|
XMLHttpRequest,
|
|
115
144
|
absoluteUrl,
|
|
145
|
+
activedContentCondition,
|
|
146
|
+
activedContentRulesConditions,
|
|
147
|
+
activedRulesConditions,
|
|
116
148
|
assignableWindow,
|
|
117
149
|
autoStartConditions,
|
|
118
150
|
buildConfig,
|
|
151
|
+
checklistIsDimissed,
|
|
152
|
+
checklistIsSeen,
|
|
119
153
|
cn,
|
|
120
154
|
conditionsIsSame,
|
|
121
155
|
convertSettings,
|
|
@@ -127,6 +161,13 @@ export {
|
|
|
127
161
|
document,
|
|
128
162
|
evalCode,
|
|
129
163
|
fetch,
|
|
164
|
+
filterAutoStartContent,
|
|
165
|
+
findLatestEvent,
|
|
166
|
+
finder,
|
|
167
|
+
finderV2,
|
|
168
|
+
finderX,
|
|
169
|
+
flowIsDismissed,
|
|
170
|
+
flowIsSeen,
|
|
130
171
|
formatDate,
|
|
131
172
|
generateAutoStateColors,
|
|
132
173
|
getAuthToken,
|
|
@@ -149,6 +190,8 @@ export {
|
|
|
149
190
|
hexToHSLString,
|
|
150
191
|
hexToRGBStr,
|
|
151
192
|
hexToRgb,
|
|
193
|
+
isActive,
|
|
194
|
+
isActiveContent,
|
|
152
195
|
isArray,
|
|
153
196
|
isBoolean,
|
|
154
197
|
isDark,
|
|
@@ -160,6 +203,7 @@ export {
|
|
|
160
203
|
isFile,
|
|
161
204
|
isFormData,
|
|
162
205
|
isFunction,
|
|
206
|
+
isHasActivedContents,
|
|
163
207
|
isMatchUrlPattern,
|
|
164
208
|
isNull,
|
|
165
209
|
isNullish,
|
|
@@ -167,20 +211,27 @@ export {
|
|
|
167
211
|
isObject,
|
|
168
212
|
isPublishedAtLeastOneEnvironment,
|
|
169
213
|
isPublishedInAllEnvironments,
|
|
214
|
+
isSameContents,
|
|
170
215
|
isString,
|
|
171
216
|
isUint8Array,
|
|
172
217
|
isUndefined,
|
|
173
218
|
isUrl,
|
|
219
|
+
isValidContent,
|
|
174
220
|
isValidSelector,
|
|
221
|
+
isVisible,
|
|
175
222
|
location,
|
|
176
223
|
mergeThemeDefaultSettings,
|
|
177
224
|
nativeForEach,
|
|
178
225
|
nativeIndexOf,
|
|
179
226
|
navigator,
|
|
227
|
+
parseUrlParams,
|
|
228
|
+
parserV2,
|
|
229
|
+
parserX,
|
|
180
230
|
removeAuthToken,
|
|
181
231
|
setAuthToken,
|
|
182
232
|
storage,
|
|
183
233
|
userAgent,
|
|
184
234
|
uuidV4,
|
|
235
|
+
wait,
|
|
185
236
|
win as window
|
|
186
237
|
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/listener.ts
|
|
21
|
+
var listener_exports = {};
|
|
22
|
+
__export(listener_exports, {
|
|
23
|
+
isBrowser: () => isBrowser,
|
|
24
|
+
isNavigator: () => isNavigator,
|
|
25
|
+
noop: () => noop,
|
|
26
|
+
off: () => off,
|
|
27
|
+
on: () => on
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(listener_exports);
|
|
30
|
+
|
|
31
|
+
// src/globals.ts
|
|
32
|
+
var win = typeof window !== "undefined" ? window : void 0;
|
|
33
|
+
var global = typeof globalThis !== "undefined" ? globalThis : win;
|
|
34
|
+
var ArrayProto = Array.prototype;
|
|
35
|
+
var nativeForEach = ArrayProto.forEach;
|
|
36
|
+
var nativeIndexOf = ArrayProto.indexOf;
|
|
37
|
+
var navigator = global == null ? void 0 : global.navigator;
|
|
38
|
+
var document = global == null ? void 0 : global.document;
|
|
39
|
+
var location = global == null ? void 0 : global.location;
|
|
40
|
+
var fetch = global == null ? void 0 : global.fetch;
|
|
41
|
+
var XMLHttpRequest = (global == null ? void 0 : global.XMLHttpRequest) && "withCredentials" in new global.XMLHttpRequest() ? global.XMLHttpRequest : void 0;
|
|
42
|
+
var AbortController = global == null ? void 0 : global.AbortController;
|
|
43
|
+
var userAgent = navigator == null ? void 0 : navigator.userAgent;
|
|
44
|
+
var assignableWindow = win != null ? win : {};
|
|
45
|
+
|
|
46
|
+
// src/listener.ts
|
|
47
|
+
var noop = () => {
|
|
48
|
+
};
|
|
49
|
+
function on(obj, ...args) {
|
|
50
|
+
if (obj == null ? void 0 : obj.addEventListener) {
|
|
51
|
+
obj.addEventListener(...args);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function off(obj, ...args) {
|
|
55
|
+
if (obj == null ? void 0 : obj.removeEventListener) {
|
|
56
|
+
obj.removeEventListener(...args);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
var isBrowser = typeof win !== "undefined";
|
|
60
|
+
var isNavigator = typeof navigator !== "undefined";
|
|
61
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
+
0 && (module.exports = {
|
|
63
|
+
isBrowser,
|
|
64
|
+
isNavigator,
|
|
65
|
+
noop,
|
|
66
|
+
off,
|
|
67
|
+
on
|
|
68
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const noop: () => void;
|
|
2
|
+
declare function on<T extends Window | Document | HTMLElement | EventTarget>(obj: T | null, ...args: Parameters<T['addEventListener']> | [string, (...args: any[]) => void, ...any]): void;
|
|
3
|
+
declare function off<T extends Window | Document | HTMLElement | EventTarget>(obj: T | null, ...args: Parameters<T['removeEventListener']> | [string, (...args: any[]) => void, ...any]): void;
|
|
4
|
+
declare const isBrowser: boolean;
|
|
5
|
+
declare const isNavigator: boolean;
|
|
6
|
+
|
|
7
|
+
export { isBrowser, isNavigator, noop, off, on };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const noop: () => void;
|
|
2
|
+
declare function on<T extends Window | Document | HTMLElement | EventTarget>(obj: T | null, ...args: Parameters<T['addEventListener']> | [string, (...args: any[]) => void, ...any]): void;
|
|
3
|
+
declare function off<T extends Window | Document | HTMLElement | EventTarget>(obj: T | null, ...args: Parameters<T['removeEventListener']> | [string, (...args: any[]) => void, ...any]): void;
|
|
4
|
+
declare const isBrowser: boolean;
|
|
5
|
+
declare const isNavigator: boolean;
|
|
6
|
+
|
|
7
|
+
export { isBrowser, isNavigator, noop, off, on };
|
package/dist/listener.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usertour/helpers",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Utility functions and helpers shared across the UserTour project",
|
|
6
6
|
"homepage": "https://www.usertour.io",
|
|
@@ -26,23 +26,28 @@
|
|
|
26
26
|
"prepublishOnly": "pnpm build"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"
|
|
31
|
-
"chroma-js": "^3.1.2",
|
|
32
|
-
"deepmerge-ts": "^7.1.3",
|
|
29
|
+
"@floating-ui/dom": "^1.4.4",
|
|
30
|
+
"@medv/finder": "^3.1.0",
|
|
33
31
|
"@paralleldrive/cuid2": "^2.2.2",
|
|
32
|
+
"@types/jsonwebtoken": "^9.0.10",
|
|
33
|
+
"@usertour-packages/finder": "workspace:^",
|
|
34
|
+
"@usertour/helpers": "link:",
|
|
35
|
+
"@usertour/types": "^0.0.5",
|
|
36
|
+
"chroma-js": "^3.1.2",
|
|
34
37
|
"class-variance-authority": "^0.4.0",
|
|
35
38
|
"clsx": "^1.2.1",
|
|
36
|
-
"
|
|
39
|
+
"date-fns": "^2.30.0",
|
|
40
|
+
"deepmerge-ts": "^7.1.3",
|
|
41
|
+
"fast-deep-equal": "^3.1.3",
|
|
37
42
|
"jsonwebtoken": "^9.0.2",
|
|
38
|
-
"
|
|
43
|
+
"tailwind-merge": "^1.13.2",
|
|
39
44
|
"uuid": "^9.0.1"
|
|
40
45
|
},
|
|
41
46
|
"devDependencies": {
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^5.59.0",
|
|
43
|
-
"@typescript-eslint/parser": "^5.59.0",
|
|
44
47
|
"@types/chroma-js": "^3.1.1",
|
|
45
48
|
"@types/uuid": "^9.0.6",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^5.59.0",
|
|
50
|
+
"@typescript-eslint/parser": "^5.59.0",
|
|
46
51
|
"eslint": "^8.38.0",
|
|
47
52
|
"typescript": "^5.0.2"
|
|
48
53
|
},
|