@usertour/helpers 0.0.14 → 0.0.15

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.cts CHANGED
@@ -1,17 +1,15 @@
1
1
  export { convertSettings, convertToCssVars, mergeThemeDefaultSettings } from './convert-settings.cjs';
2
- export { conditionsIsSame, isMatchUrlPattern } from './condition.cjs';
3
2
  export { isArray, isBoolean, isDate, isDocument, isEmptyObject, isEmptyString, isFile, isFormData, isFunction, isNull, isNullish, isNumber, isObject, isString, isUint8Array, isUndefined } from './type-utils.cjs';
4
- export { autoStartConditions, buildConfig, defaultContentConfig } from './content-settings.cjs';
5
3
  export { getCodeError, getContentError, getCurrentTimeError, getElementError, getErrorMessage, getNavitateError, getSegmentError, getStepError, getTextFillError, getTextInputError, getUrlPatternError, getUserAttrError, getWaitError, hasActionError, hasError, isValidSelector } from './error.cjs';
6
4
  export { getAuthToken, removeAuthToken, setAuthToken, storage } from './auth.cjs';
7
5
  export { defaultStep } from './settings.cjs';
8
6
  export { isUrl } from './is-url.cjs';
9
7
  export { AbortController, ArrayProto, XMLHttpRequest, assignableWindow, document, fetch, location, nativeForEach, nativeIndexOf, navigator, userAgent, window } from './globals.cjs';
10
- export { isPublishedAtLeastOneEnvironment, isPublishedInAllEnvironments } from './content.cjs';
8
+ export { autoStartConditions, buildConfig, defaultContentConfig, isPublishedAtLeastOneEnvironment, isPublishedInAllEnvironments } from './content.cjs';
11
9
  export { deepClone } from './utils.cjs';
12
10
  export { generateAutoStateColors, hexToHSLString, hexToRGBStr } from './color.cjs';
13
11
  export { absoluteUrl, cn, cuid, evalCode, formatDate, getRandomColor, hexToRgb, isDark, uuidV4 } from './helper.cjs';
14
- export { activedContentRulesConditions, activedRulesConditions, checklistIsDimissed, checklistIsSeen, filterAutoStartContent, findLatestEvent, flowIsDismissed, flowIsSeen, isActive, isActiveRulesByCurrentTime, isValidContent, parseUrlParams } from './conditions.cjs';
12
+ export { conditionsIsSame, isMatchUrlPattern } from './conditions.cjs';
15
13
  export { default as isEqual } from 'fast-deep-equal';
16
14
  import '@usertour/types';
17
15
  import './storage.cjs';
package/dist/index.d.ts CHANGED
@@ -1,17 +1,15 @@
1
1
  export { convertSettings, convertToCssVars, mergeThemeDefaultSettings } from './convert-settings.js';
2
- export { conditionsIsSame, isMatchUrlPattern } from './condition.js';
3
2
  export { isArray, isBoolean, isDate, isDocument, isEmptyObject, isEmptyString, isFile, isFormData, isFunction, isNull, isNullish, isNumber, isObject, isString, isUint8Array, isUndefined } from './type-utils.js';
4
- export { autoStartConditions, buildConfig, defaultContentConfig } from './content-settings.js';
5
3
  export { getCodeError, getContentError, getCurrentTimeError, getElementError, getErrorMessage, getNavitateError, getSegmentError, getStepError, getTextFillError, getTextInputError, getUrlPatternError, getUserAttrError, getWaitError, hasActionError, hasError, isValidSelector } from './error.js';
6
4
  export { getAuthToken, removeAuthToken, setAuthToken, storage } from './auth.js';
7
5
  export { defaultStep } from './settings.js';
8
6
  export { isUrl } from './is-url.js';
9
7
  export { AbortController, ArrayProto, XMLHttpRequest, assignableWindow, document, fetch, location, nativeForEach, nativeIndexOf, navigator, userAgent, window } from './globals.js';
10
- export { isPublishedAtLeastOneEnvironment, isPublishedInAllEnvironments } from './content.js';
8
+ export { autoStartConditions, buildConfig, defaultContentConfig, isPublishedAtLeastOneEnvironment, isPublishedInAllEnvironments } from './content.js';
11
9
  export { deepClone } from './utils.js';
12
10
  export { generateAutoStateColors, hexToHSLString, hexToRGBStr } from './color.js';
13
11
  export { absoluteUrl, cn, cuid, evalCode, formatDate, getRandomColor, hexToRgb, isDark, uuidV4 } from './helper.js';
14
- export { activedContentRulesConditions, activedRulesConditions, checklistIsDimissed, checklistIsSeen, filterAutoStartContent, findLatestEvent, flowIsDismissed, flowIsSeen, isActive, isActiveRulesByCurrentTime, isValidContent, parseUrlParams } from './conditions.js';
12
+ export { conditionsIsSame, isMatchUrlPattern } from './conditions.js';
15
13
  export { default as isEqual } from 'fast-deep-equal';
16
14
  import '@usertour/types';
17
15
  import './storage.js';
package/dist/index.js CHANGED
@@ -1,14 +1,3 @@
1
- import {
2
- absoluteUrl,
3
- cn,
4
- cuid,
5
- evalCode,
6
- formatDate,
7
- getRandomColor,
8
- hexToRgb,
9
- isDark,
10
- uuidV4
11
- } from "./chunk-3KG2HTZ3.js";
12
1
  import {
13
2
  isUrl
14
3
  } from "./chunk-ZNFXGN3M.js";
@@ -25,48 +14,18 @@ import {
25
14
  storage
26
15
  } from "./chunk-FGFMTWFT.js";
27
16
  import "./chunk-3ZGH3NRU.js";
28
- import {
29
- AbortController,
30
- ArrayProto,
31
- XMLHttpRequest,
32
- assignableWindow,
33
- document,
34
- fetch,
35
- location,
36
- nativeForEach,
37
- nativeIndexOf,
38
- navigator,
39
- userAgent,
40
- win
41
- } from "./chunk-H7VA3ML2.js";
42
- import {
43
- activedContentRulesConditions,
44
- activedRulesConditions,
45
- checklistIsDimissed,
46
- checklistIsSeen,
47
- filterAutoStartContent,
48
- findLatestEvent,
49
- flowIsDismissed,
50
- flowIsSeen,
51
- isActive,
52
- isActiveRulesByCurrentTime,
53
- isValidContent,
54
- parseUrlParams
55
- } from "./chunk-SYVTGB2A.js";
56
17
  import {
57
18
  conditionsIsSame,
58
19
  isEqual,
59
20
  isMatchUrlPattern
60
- } from "./chunk-FNQIIEWK.js";
21
+ } from "./chunk-IZFZYGPU.js";
61
22
  import {
62
23
  autoStartConditions,
63
24
  buildConfig,
64
- defaultContentConfig
65
- } from "./chunk-64BFWPHJ.js";
66
- import {
25
+ defaultContentConfig,
67
26
  isPublishedAtLeastOneEnvironment,
68
27
  isPublishedInAllEnvironments
69
- } from "./chunk-BBPZYUJR.js";
28
+ } from "./chunk-B4DTY6GN.js";
70
29
  import {
71
30
  convertSettings,
72
31
  convertToCssVars,
@@ -113,19 +72,40 @@ import {
113
72
  hasError,
114
73
  isValidSelector
115
74
  } from "./chunk-G5P7KULU.js";
75
+ import {
76
+ AbortController,
77
+ ArrayProto,
78
+ XMLHttpRequest,
79
+ assignableWindow,
80
+ document,
81
+ fetch,
82
+ location,
83
+ nativeForEach,
84
+ nativeIndexOf,
85
+ navigator,
86
+ userAgent,
87
+ win
88
+ } from "./chunk-H7VA3ML2.js";
89
+ import {
90
+ absoluteUrl,
91
+ cn,
92
+ cuid,
93
+ evalCode,
94
+ formatDate,
95
+ getRandomColor,
96
+ hexToRgb,
97
+ isDark,
98
+ uuidV4
99
+ } from "./chunk-3KG2HTZ3.js";
116
100
  import "./chunk-XEO3YXBM.js";
117
101
  export {
118
102
  AbortController,
119
103
  ArrayProto,
120
104
  XMLHttpRequest,
121
105
  absoluteUrl,
122
- activedContentRulesConditions,
123
- activedRulesConditions,
124
106
  assignableWindow,
125
107
  autoStartConditions,
126
108
  buildConfig,
127
- checklistIsDimissed,
128
- checklistIsSeen,
129
109
  cn,
130
110
  conditionsIsSame,
131
111
  convertSettings,
@@ -137,10 +117,6 @@ export {
137
117
  document,
138
118
  evalCode,
139
119
  fetch,
140
- filterAutoStartContent,
141
- findLatestEvent,
142
- flowIsDismissed,
143
- flowIsSeen,
144
120
  formatDate,
145
121
  generateAutoStateColors,
146
122
  getAuthToken,
@@ -163,8 +139,6 @@ export {
163
139
  hexToHSLString,
164
140
  hexToRGBStr,
165
141
  hexToRgb,
166
- isActive,
167
- isActiveRulesByCurrentTime,
168
142
  isArray,
169
143
  isBoolean,
170
144
  isDark,
@@ -187,14 +161,12 @@ export {
187
161
  isUint8Array,
188
162
  isUndefined,
189
163
  isUrl,
190
- isValidContent,
191
164
  isValidSelector,
192
165
  location,
193
166
  mergeThemeDefaultSettings,
194
167
  nativeForEach,
195
168
  nativeIndexOf,
196
169
  navigator,
197
- parseUrlParams,
198
170
  removeAuthToken,
199
171
  setAuthToken,
200
172
  storage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usertour/helpers",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
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.6",
29
+ "@usertour/types": "^0.0.7",
30
30
  "fast-deep-equal": "^3.1.3",
31
31
  "chroma-js": "^3.1.2",
32
32
  "deepmerge-ts": "^7.1.3",
@@ -1,50 +0,0 @@
1
- // src/content-settings.ts
2
- import { ContentPriority } from "@usertour/types";
3
- import { deepmerge } from "deepmerge-ts";
4
- var rulesSetting = {
5
- // frequency: {
6
- // frequency: Frequency.ONCE,
7
- // every: { duration: 0, times: 1, unit: FrequencyUnits.MINUTES },
8
- // atLeast: { duration: 0, unit: FrequencyUnits.MINUTES },
9
- // },
10
- startIfNotComplete: false,
11
- priority: ContentPriority.MEDIUM,
12
- wait: 0
13
- };
14
- var hideRulesSetting = {};
15
- var defaultContentConfig = {
16
- enabledAutoStartRules: false,
17
- enabledHideRules: false,
18
- autoStartRules: [],
19
- hideRules: [],
20
- autoStartRulesSetting: rulesSetting,
21
- hideRulesSetting
22
- };
23
- var autoStartConditions = {
24
- ...defaultContentConfig,
25
- enabledAutoStartRules: true,
26
- autoStartRules: [
27
- {
28
- data: { excludes: [], includes: ["/*"] },
29
- type: "current-page",
30
- operators: "and"
31
- }
32
- ]
33
- };
34
- var buildConfig = (config) => {
35
- return {
36
- ...defaultContentConfig,
37
- ...config,
38
- autoStartRulesSetting: deepmerge(
39
- defaultContentConfig.autoStartRulesSetting,
40
- (config == null ? void 0 : config.autoStartRulesSetting) || {}
41
- ),
42
- hideRulesSetting: (config == null ? void 0 : config.hideRulesSetting) || {}
43
- };
44
- };
45
-
46
- export {
47
- defaultContentConfig,
48
- autoStartConditions,
49
- buildConfig
50
- };