@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/index.d.ts CHANGED
@@ -13,6 +13,7 @@ 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';
16
17
  export { default as isEqual } from 'fast-deep-equal';
17
18
  import '@usertour/types';
18
19
  import './storage.js';
package/dist/index.js CHANGED
@@ -31,6 +31,41 @@ 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-OASNBRBF.js";
54
+ import "./chunk-Y6FPPOKF.js";
55
+ import {
56
+ AbortController,
57
+ ArrayProto,
58
+ XMLHttpRequest,
59
+ assignableWindow,
60
+ document,
61
+ fetch,
62
+ location,
63
+ nativeForEach,
64
+ nativeIndexOf,
65
+ navigator,
66
+ userAgent,
67
+ win
68
+ } from "./chunk-H7VA3ML2.js";
34
69
  import {
35
70
  conditionsIsSame,
36
71
  isEqual,
@@ -91,31 +126,23 @@ import {
91
126
  hasError,
92
127
  isValidSelector
93
128
  } 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
129
  import "./chunk-XEO3YXBM.js";
109
130
  export {
110
131
  AbortController,
111
132
  ArrayProto,
112
133
  JWTLicenseSigner,
113
134
  JWTLicenseValidator,
135
+ PRIORITIES,
114
136
  XMLHttpRequest,
115
137
  absoluteUrl,
138
+ activedContentCondition,
139
+ activedContentRulesConditions,
140
+ activedRulesConditions,
116
141
  assignableWindow,
117
142
  autoStartConditions,
118
143
  buildConfig,
144
+ checklistIsDimissed,
145
+ checklistIsSeen,
119
146
  cn,
120
147
  conditionsIsSame,
121
148
  convertSettings,
@@ -127,6 +154,10 @@ export {
127
154
  document,
128
155
  evalCode,
129
156
  fetch,
157
+ filterAutoStartContent,
158
+ findLatestEvent,
159
+ flowIsDismissed,
160
+ flowIsSeen,
130
161
  formatDate,
131
162
  generateAutoStateColors,
132
163
  getAuthToken,
@@ -149,6 +180,8 @@ export {
149
180
  hexToHSLString,
150
181
  hexToRGBStr,
151
182
  hexToRgb,
183
+ isActive,
184
+ isActiveContent,
152
185
  isArray,
153
186
  isBoolean,
154
187
  isDark,
@@ -160,6 +193,7 @@ export {
160
193
  isFile,
161
194
  isFormData,
162
195
  isFunction,
196
+ isHasActivedContents,
163
197
  isMatchUrlPattern,
164
198
  isNull,
165
199
  isNullish,
@@ -167,20 +201,25 @@ export {
167
201
  isObject,
168
202
  isPublishedAtLeastOneEnvironment,
169
203
  isPublishedInAllEnvironments,
204
+ isSameContents,
170
205
  isString,
171
206
  isUint8Array,
172
207
  isUndefined,
173
208
  isUrl,
209
+ isValidContent,
174
210
  isValidSelector,
211
+ isVisible,
175
212
  location,
176
213
  mergeThemeDefaultSettings,
177
214
  nativeForEach,
178
215
  nativeIndexOf,
179
216
  navigator,
217
+ parseUrlParams,
180
218
  removeAuthToken,
181
219
  setAuthToken,
182
220
  storage,
183
221
  userAgent,
184
222
  uuidV4,
223
+ wait,
185
224
  win as window
186
225
  };
@@ -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 };
@@ -0,0 +1,16 @@
1
+ import {
2
+ isBrowser,
3
+ isNavigator,
4
+ noop,
5
+ off,
6
+ on
7
+ } from "./chunk-Y6FPPOKF.js";
8
+ import "./chunk-H7VA3ML2.js";
9
+ import "./chunk-XEO3YXBM.js";
10
+ export {
11
+ isBrowser,
12
+ isNavigator,
13
+ noop,
14
+ off,
15
+ on
16
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usertour/helpers",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
5
  "description": "Utility functions and helpers shared across the UserTour project",
6
6
  "homepage": "https://www.usertour.io",
@@ -26,7 +26,7 @@
26
26
  "prepublishOnly": "pnpm build"
27
27
  },
28
28
  "dependencies": {
29
- "@usertour/types": "^0.0.4",
29
+ "@usertour/types": "^0.0.5",
30
30
  "fast-deep-equal": "^3.1.3",
31
31
  "chroma-js": "^3.1.2",
32
32
  "deepmerge-ts": "^7.1.3",
@@ -35,7 +35,10 @@
35
35
  "clsx": "^1.2.1",
36
36
  "tailwind-merge": "^1.13.2",
37
37
  "jsonwebtoken": "^9.0.2",
38
+ "@floating-ui/dom": "^1.4.4",
38
39
  "@types/jsonwebtoken": "^9.0.10",
40
+ "@usertour-packages/finder": "workspace:^",
41
+ "date-fns": "^2.30.0",
39
42
  "uuid": "^9.0.1"
40
43
  },
41
44
  "devDependencies": {