@usertour/helpers 0.0.13 → 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, checklistIsDimissed, checklistIsSeen, filterAutoStartContent, flowIsDismissed, flowIsSeen, 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, checklistIsDimissed, checklistIsSeen, filterAutoStartContent, flowIsDismissed, flowIsSeen, 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,45 +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
- checklistIsDimissed,
45
- checklistIsSeen,
46
- filterAutoStartContent,
47
- flowIsDismissed,
48
- flowIsSeen,
49
- isActiveRulesByCurrentTime,
50
- isValidContent,
51
- parseUrlParams
52
- } from "./chunk-SYVTGB2A.js";
53
17
  import {
54
18
  conditionsIsSame,
55
19
  isEqual,
56
20
  isMatchUrlPattern
57
- } from "./chunk-FNQIIEWK.js";
21
+ } from "./chunk-IZFZYGPU.js";
58
22
  import {
59
23
  autoStartConditions,
60
24
  buildConfig,
61
- defaultContentConfig
62
- } from "./chunk-64BFWPHJ.js";
63
- import {
25
+ defaultContentConfig,
64
26
  isPublishedAtLeastOneEnvironment,
65
27
  isPublishedInAllEnvironments
66
- } from "./chunk-BBPZYUJR.js";
28
+ } from "./chunk-B4DTY6GN.js";
67
29
  import {
68
30
  convertSettings,
69
31
  convertToCssVars,
@@ -110,18 +72,40 @@ import {
110
72
  hasError,
111
73
  isValidSelector
112
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";
113
100
  import "./chunk-XEO3YXBM.js";
114
101
  export {
115
102
  AbortController,
116
103
  ArrayProto,
117
104
  XMLHttpRequest,
118
105
  absoluteUrl,
119
- activedContentRulesConditions,
120
106
  assignableWindow,
121
107
  autoStartConditions,
122
108
  buildConfig,
123
- checklistIsDimissed,
124
- checklistIsSeen,
125
109
  cn,
126
110
  conditionsIsSame,
127
111
  convertSettings,
@@ -133,9 +117,6 @@ export {
133
117
  document,
134
118
  evalCode,
135
119
  fetch,
136
- filterAutoStartContent,
137
- flowIsDismissed,
138
- flowIsSeen,
139
120
  formatDate,
140
121
  generateAutoStateColors,
141
122
  getAuthToken,
@@ -158,7 +139,6 @@ export {
158
139
  hexToHSLString,
159
140
  hexToRGBStr,
160
141
  hexToRgb,
161
- isActiveRulesByCurrentTime,
162
142
  isArray,
163
143
  isBoolean,
164
144
  isDark,
@@ -181,14 +161,12 @@ export {
181
161
  isUint8Array,
182
162
  isUndefined,
183
163
  isUrl,
184
- isValidContent,
185
164
  isValidSelector,
186
165
  location,
187
166
  mergeThemeDefaultSettings,
188
167
  nativeForEach,
189
168
  nativeIndexOf,
190
169
  navigator,
191
- parseUrlParams,
192
170
  removeAuthToken,
193
171
  setAuthToken,
194
172
  storage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usertour/helpers",
3
- "version": "0.0.13",
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
- };