@wireai/activation 0.14.2 → 0.15.0
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/AGENTS.md +1 -1
- package/CHANGELOG.md +144 -0
- package/README.md +23 -9
- package/dist/analytics/index.d.mts +5 -5
- package/dist/analytics/index.d.ts +5 -5
- package/dist/analytics/index.js.map +1 -1
- package/dist/analytics/index.mjs.map +1 -1
- package/dist/coachmarks/index.d.mts +13 -5
- package/dist/coachmarks/index.d.ts +13 -5
- package/dist/coachmarks/index.js +252 -58
- package/dist/coachmarks/index.js.map +1 -1
- package/dist/coachmarks/index.mjs +204 -9
- package/dist/coachmarks/index.mjs.map +1 -1
- package/dist/{currentSession-CW_5Mq4O.d.ts → currentSession-CFSRZ2wg.d.ts} +10 -4
- package/dist/{currentSession-CUvTOchb.d.mts → currentSession-orZy5p1e.d.mts} +10 -4
- package/dist/{decision-Bgo17oH7.d.mts → decision-3vWLuBlO.d.ts} +11 -2
- package/dist/{decision-Bkh_LigV.d.ts → decision-yBj2AyPW.d.mts} +11 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/questionnaire/index.d.mts +3 -3
- package/dist/questionnaire/index.d.ts +3 -3
- package/dist/questionnaire/index.js +48 -3
- package/dist/questionnaire/index.js.map +1 -1
- package/dist/questionnaire/index.mjs +48 -3
- package/dist/questionnaire/index.mjs.map +1 -1
- package/dist/reviews/index.d.mts +10 -6
- package/dist/reviews/index.d.ts +10 -6
- package/dist/reviews/index.js +167 -18
- package/dist/reviews/index.js.map +1 -1
- package/dist/reviews/index.mjs +167 -18
- package/dist/reviews/index.mjs.map +1 -1
- package/dist/showcase/index.d.mts +1 -1
- package/dist/showcase/index.d.ts +1 -1
- package/dist/showcase/index.js +282 -48
- package/dist/showcase/index.js.map +1 -1
- package/dist/showcase/index.mjs +248 -12
- package/dist/showcase/index.mjs.map +1 -1
- package/dist/{transport-j5gFfJhK.d.mts → transport-s5QxA-ci.d.mts} +18 -13
- package/dist/{transport-B_0SgCBe.d.ts → transport-xqqSFqxs.d.ts} +18 -13
- package/dist/{types-Cju-1_jT.d.mts → types-Byx306Kv.d.mts} +25 -10
- package/dist/{types-BcmagF6K.d.mts → types-D_0B0yay.d.mts} +7 -2
- package/dist/{types-BcmagF6K.d.ts → types-D_0B0yay.d.ts} +7 -2
- package/dist/{types-h2BZvl1t.d.ts → types-tdATL5z0.d.ts} +25 -10
- package/metro/index.js +16 -5
- package/package.json +1 -1
- package/src/WireOnboarding.tsx +4 -1
- package/src/coachmarks/GestureHint.tsx +16 -7
- package/src/coachmarks/SpotlightOverlay.tsx +19 -13
- package/src/coachmarks/index.ts +7 -2
- package/src/coachmarks/reanimated.ts +342 -0
- package/src/coachmarks/runtime.ts +103 -2
- package/src/coachmarks/types.ts +7 -2
- package/src/context/deviceId.ts +32 -0
- package/src/reviews/ReviewGate.tsx +86 -37
- package/src/reviews/decision.ts +11 -1
- package/src/reviews/idempotency.ts +71 -0
- package/src/reviews/index.ts +4 -2
- package/src/reviews/runtime.ts +5 -3
- package/src/reviews/transport.ts +17 -12
- package/src/reviews/types.ts +7 -0
- package/src/showcase/FeatureShowcase.tsx +25 -9
- package/src/showcase/blazejOnboarding.ts +136 -0
- package/src/showcase/index.ts +8 -4
- package/src/types.ts +10 -4
- package/src/utils/submitResult.ts +17 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { ImageSourcePropType } from 'react-native';
|
|
3
|
-
import { G as GestureKind, C as CoachmarkStorage } from '../types-
|
|
3
|
+
import { G as GestureKind, C as CoachmarkStorage } from '../types-D_0B0yay.mjs';
|
|
4
4
|
import { O as OnboardingTheme } from '../types-BKfpdZzX.mjs';
|
|
5
5
|
import { a as WireFeatures, b as WireFeaturesConfig } from '../types-BpwiRpA8.mjs';
|
|
6
6
|
|
package/dist/showcase/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { ImageSourcePropType } from 'react-native';
|
|
3
|
-
import { G as GestureKind, C as CoachmarkStorage } from '../types-
|
|
3
|
+
import { G as GestureKind, C as CoachmarkStorage } from '../types-D_0B0yay.js';
|
|
4
4
|
import { O as OnboardingTheme } from '../types-BKfpdZzX.js';
|
|
5
5
|
import { a as WireFeatures, b as WireFeaturesConfig } from '../types-BpwiRpA8.js';
|
|
6
6
|
|
package/dist/showcase/index.js
CHANGED
|
@@ -1,18 +1,165 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var Onboarding = require('@blazejkustra/react-native-onboarding');
|
|
4
3
|
var React = require('react');
|
|
5
4
|
var reactNative = require('react-native');
|
|
6
|
-
var Animated = require('react-native-reanimated');
|
|
7
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
6
|
|
|
9
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
8
|
|
|
11
|
-
var Onboarding__default = /*#__PURE__*/_interopDefault(Onboarding);
|
|
12
9
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
13
|
-
var Animated__default = /*#__PURE__*/_interopDefault(Animated);
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
12
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
13
|
+
}) : x)(function(x) {
|
|
14
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
15
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
16
|
+
});
|
|
17
|
+
var lastKnown = false;
|
|
18
|
+
var useReducedMotion = () => {
|
|
19
|
+
const [reduced, setReduced] = React.useState(lastKnown);
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
let mounted = true;
|
|
22
|
+
reactNative.AccessibilityInfo.isReduceMotionEnabled().then((value) => {
|
|
23
|
+
lastKnown = value;
|
|
24
|
+
if (mounted) setReduced(value);
|
|
25
|
+
}).catch(() => {
|
|
26
|
+
});
|
|
27
|
+
const sub = reactNative.AccessibilityInfo.addEventListener("reduceMotionChanged", (value) => {
|
|
28
|
+
lastKnown = value;
|
|
29
|
+
setReduced(value);
|
|
30
|
+
});
|
|
31
|
+
return () => {
|
|
32
|
+
mounted = false;
|
|
33
|
+
sub == null ? void 0 : sub.remove();
|
|
34
|
+
};
|
|
35
|
+
}, []);
|
|
36
|
+
return reduced;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/coachmarks/reanimated.ts
|
|
40
|
+
var runtimeRequire = (moduleName) => {
|
|
41
|
+
if (moduleName !== "react-native-reanimated") return void 0;
|
|
42
|
+
if (typeof __require !== "function") return void 0;
|
|
43
|
+
try {
|
|
44
|
+
return require("react-native-reanimated");
|
|
45
|
+
} catch {
|
|
46
|
+
return void 0;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var useStaticSharedValue = (initial) => {
|
|
50
|
+
const [, bump] = React.useReducer((n) => n + 1, 0);
|
|
51
|
+
const box = React.useRef(null);
|
|
52
|
+
if (box.current === null) {
|
|
53
|
+
let current = initial;
|
|
54
|
+
box.current = {
|
|
55
|
+
get value() {
|
|
56
|
+
return current;
|
|
57
|
+
},
|
|
58
|
+
set value(next) {
|
|
59
|
+
if (Object.is(next, current)) return;
|
|
60
|
+
current = next;
|
|
61
|
+
bump();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
return box.current;
|
|
66
|
+
};
|
|
67
|
+
var runWorklet = (factory, fallback) => {
|
|
68
|
+
var _a;
|
|
69
|
+
try {
|
|
70
|
+
return (_a = factory()) != null ? _a : fallback;
|
|
71
|
+
} catch {
|
|
72
|
+
return fallback;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
var StaticAnimatedView = React.forwardRef(function StaticAnimatedView2({ entering: _entering, exiting: _exiting, children, ...rest }, ref) {
|
|
76
|
+
return React.createElement(reactNative.View, { ...rest, ref }, children);
|
|
77
|
+
});
|
|
78
|
+
var staticCreateAnimatedComponent = (component) => function StaticAnimatedComponent({ animatedProps, ...rest }) {
|
|
79
|
+
return React.createElement(component, { ...rest, ...animatedProps });
|
|
80
|
+
};
|
|
81
|
+
var staticApi = {
|
|
82
|
+
present: false,
|
|
83
|
+
View: StaticAnimatedView,
|
|
84
|
+
createAnimatedComponent: staticCreateAnimatedComponent,
|
|
85
|
+
useSharedValue: useStaticSharedValue,
|
|
86
|
+
useAnimatedStyle: (factory) => runWorklet(factory, {}),
|
|
87
|
+
useAnimatedProps: (factory) => runWorklet(factory, {}),
|
|
88
|
+
useReducedMotion,
|
|
89
|
+
withTiming: (toValue) => toValue,
|
|
90
|
+
withRepeat: (animation) => animation,
|
|
91
|
+
withSequence: (...animations) => {
|
|
92
|
+
var _a;
|
|
93
|
+
return (_a = animations[animations.length - 1]) != null ? _a : 0;
|
|
94
|
+
},
|
|
95
|
+
withDelay: (_ms, animation) => animation,
|
|
96
|
+
fadeIn: () => void 0,
|
|
97
|
+
fadeOut: () => void 0
|
|
98
|
+
};
|
|
99
|
+
var isFunction = (value) => typeof value === "function";
|
|
100
|
+
var isComponent = (value) => typeof value === "function" || !!value && typeof value === "object" && "$$typeof" in value;
|
|
101
|
+
var fromModule = (mod) => {
|
|
102
|
+
var _a, _b;
|
|
103
|
+
if (!mod || typeof mod !== "object") return void 0;
|
|
104
|
+
const ns = mod;
|
|
105
|
+
const def = ns.default && typeof ns.default === "object" ? ns.default : void 0;
|
|
106
|
+
const pick = (name) => {
|
|
107
|
+
var _a2;
|
|
108
|
+
return (_a2 = ns[name]) != null ? _a2 : def == null ? void 0 : def[name];
|
|
109
|
+
};
|
|
110
|
+
const view = (_a = def == null ? void 0 : def.View) != null ? _a : ns.View;
|
|
111
|
+
const createAnimated = (_b = def == null ? void 0 : def.createAnimatedComponent) != null ? _b : ns.createAnimatedComponent;
|
|
112
|
+
const hooks = {
|
|
113
|
+
useSharedValue: pick("useSharedValue"),
|
|
114
|
+
useAnimatedStyle: pick("useAnimatedStyle"),
|
|
115
|
+
useAnimatedProps: pick("useAnimatedProps"),
|
|
116
|
+
useReducedMotion: pick("useReducedMotion"),
|
|
117
|
+
withTiming: pick("withTiming"),
|
|
118
|
+
withRepeat: pick("withRepeat"),
|
|
119
|
+
withSequence: pick("withSequence"),
|
|
120
|
+
withDelay: pick("withDelay")
|
|
121
|
+
};
|
|
122
|
+
const fadeIn = pick("FadeIn");
|
|
123
|
+
const fadeOut = pick("FadeOut");
|
|
124
|
+
if (!isComponent(view) || !isFunction(createAnimated)) return void 0;
|
|
125
|
+
if (Object.values(hooks).some((member) => !isFunction(member))) return void 0;
|
|
126
|
+
if (!fadeIn || !fadeOut) return void 0;
|
|
127
|
+
const api2 = {
|
|
128
|
+
present: true,
|
|
129
|
+
View: view,
|
|
130
|
+
createAnimatedComponent: createAnimated,
|
|
131
|
+
...hooks,
|
|
132
|
+
fadeIn: (durationMs) => fadeIn.duration(durationMs),
|
|
133
|
+
fadeOut: (durationMs) => fadeOut.duration(durationMs)
|
|
134
|
+
};
|
|
135
|
+
return api2;
|
|
136
|
+
};
|
|
137
|
+
var cached;
|
|
138
|
+
var resolveReanimated = (requireModule = runtimeRequire) => {
|
|
139
|
+
var _a;
|
|
140
|
+
try {
|
|
141
|
+
if (cached === void 0 || requireModule !== runtimeRequire) {
|
|
142
|
+
const resolved = (_a = fromModule(requireModule("react-native-reanimated"))) != null ? _a : staticApi;
|
|
143
|
+
if (requireModule === runtimeRequire) cached = resolved;
|
|
144
|
+
return resolved;
|
|
145
|
+
}
|
|
146
|
+
return cached;
|
|
147
|
+
} catch {
|
|
148
|
+
return staticApi;
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
var api = () => resolveReanimated();
|
|
152
|
+
var Animated = {
|
|
153
|
+
get View() {
|
|
154
|
+
return api().View;
|
|
155
|
+
}};
|
|
156
|
+
var useSharedValue = (initial) => api().useSharedValue(initial);
|
|
157
|
+
var useAnimatedStyle = (factory) => api().useAnimatedStyle(factory);
|
|
158
|
+
var useReducedMotion2 = () => api().useReducedMotion();
|
|
159
|
+
var withTiming = (toValue, config) => api().withTiming(toValue, config);
|
|
160
|
+
var withRepeat = (animation, count, reverse) => api().withRepeat(animation, count, reverse);
|
|
161
|
+
var withSequence = (...animations) => api().withSequence(...animations);
|
|
162
|
+
var withDelay = (ms, animation) => api().withDelay(ms, animation);
|
|
16
163
|
var SWIPE_MS = 700;
|
|
17
164
|
var TAP_MS = 320;
|
|
18
165
|
var SPREAD_MS = 620;
|
|
@@ -70,29 +217,29 @@ var GestureHintComponent = ({
|
|
|
70
217
|
renderHand
|
|
71
218
|
}) => {
|
|
72
219
|
var _a;
|
|
73
|
-
const translate =
|
|
74
|
-
const opacity =
|
|
75
|
-
const pulse =
|
|
76
|
-
const spread =
|
|
77
|
-
const reduced =
|
|
220
|
+
const translate = useSharedValue(0);
|
|
221
|
+
const opacity = useSharedValue(1);
|
|
222
|
+
const pulse = useSharedValue(1);
|
|
223
|
+
const spread = useSharedValue(0);
|
|
224
|
+
const reduced = useReducedMotion2();
|
|
78
225
|
const isSwipe = type === "swipe_up" || type === "swipe_down" || type === "swipe_left" || type === "swipe_right";
|
|
79
226
|
const isSpread = type === "pinch" || type === "zoom";
|
|
80
227
|
const isTap = type === "tap" || type === "double_tap";
|
|
81
228
|
React.useEffect(() => {
|
|
82
229
|
if (type === "none" || reduced) return void 0;
|
|
83
230
|
if (isTap) {
|
|
84
|
-
pulse.value =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
231
|
+
pulse.value = withRepeat(
|
|
232
|
+
withSequence(
|
|
233
|
+
withTiming(0.82, { duration: TAP_MS }),
|
|
234
|
+
withTiming(1, { duration: TAP_MS })
|
|
88
235
|
),
|
|
89
236
|
-1,
|
|
90
237
|
false
|
|
91
238
|
);
|
|
92
|
-
opacity.value =
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
239
|
+
opacity.value = withRepeat(
|
|
240
|
+
withSequence(
|
|
241
|
+
withTiming(0.55, { duration: TAP_MS }),
|
|
242
|
+
withTiming(1, { duration: TAP_MS })
|
|
96
243
|
),
|
|
97
244
|
-1,
|
|
98
245
|
false
|
|
@@ -100,48 +247,48 @@ var GestureHintComponent = ({
|
|
|
100
247
|
return void 0;
|
|
101
248
|
}
|
|
102
249
|
if (isSpread) {
|
|
103
|
-
spread.value =
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
250
|
+
spread.value = withRepeat(
|
|
251
|
+
withSequence(
|
|
252
|
+
withTiming(size * 0.26, { duration: SPREAD_MS }),
|
|
253
|
+
withTiming(0, { duration: SPREAD_MS })
|
|
107
254
|
),
|
|
108
255
|
-1,
|
|
109
256
|
false
|
|
110
257
|
);
|
|
111
258
|
return void 0;
|
|
112
259
|
}
|
|
113
|
-
translate.value =
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
260
|
+
translate.value = withRepeat(
|
|
261
|
+
withSequence(
|
|
262
|
+
withTiming(0, { duration: 0 }),
|
|
263
|
+
withTiming(-26, { duration: SWIPE_MS }),
|
|
264
|
+
withDelay(140, withTiming(0, { duration: 0 }))
|
|
118
265
|
),
|
|
119
266
|
-1,
|
|
120
267
|
false
|
|
121
268
|
);
|
|
122
|
-
opacity.value =
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
269
|
+
opacity.value = withRepeat(
|
|
270
|
+
withSequence(
|
|
271
|
+
withTiming(1, { duration: SWIPE_MS / 2 }),
|
|
272
|
+
withTiming(0, { duration: SWIPE_MS / 2 }),
|
|
273
|
+
withDelay(140, withTiming(1, { duration: 0 }))
|
|
127
274
|
),
|
|
128
275
|
-1,
|
|
129
276
|
false
|
|
130
277
|
);
|
|
131
278
|
return void 0;
|
|
132
279
|
}, [type, reduced, isTap, isSpread, translate, opacity, pulse, spread, size]);
|
|
133
|
-
const swipeAnimatedStyle =
|
|
280
|
+
const swipeAnimatedStyle = useAnimatedStyle(() => ({
|
|
134
281
|
opacity: opacity.value,
|
|
135
282
|
transform: [{ translateY: translate.value }]
|
|
136
283
|
}));
|
|
137
|
-
const tapAnimatedStyle =
|
|
284
|
+
const tapAnimatedStyle = useAnimatedStyle(() => ({
|
|
138
285
|
opacity: opacity.value,
|
|
139
286
|
transform: [{ scale: pulse.value }]
|
|
140
287
|
}));
|
|
141
|
-
const spreadLeftStyle =
|
|
288
|
+
const spreadLeftStyle = useAnimatedStyle(() => ({
|
|
142
289
|
transform: [{ translateX: -spread.value }]
|
|
143
290
|
}));
|
|
144
|
-
const spreadRightStyle =
|
|
291
|
+
const spreadRightStyle = useAnimatedStyle(() => ({
|
|
145
292
|
transform: [{ translateX: spread.value }]
|
|
146
293
|
}));
|
|
147
294
|
if (type === "none") return null;
|
|
@@ -153,7 +300,7 @@ var GestureHintComponent = ({
|
|
|
153
300
|
style: { transform: [{ rotate: (_a = GLYPH_ROTATION[type]) != null ? _a : "0deg" }] },
|
|
154
301
|
pointerEvents: "none",
|
|
155
302
|
children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles.swipeStack, children: [
|
|
156
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
303
|
+
/* @__PURE__ */ jsxRuntime.jsx(Animated.View, { style: swipeAnimatedStyle, pointerEvents: "none", children: customGlyph != null ? customGlyph : /* @__PURE__ */ jsxRuntime.jsx(FingerPair, { size, color }) }),
|
|
157
304
|
/* @__PURE__ */ jsxRuntime.jsx(MotionTrack, { size, color })
|
|
158
305
|
] })
|
|
159
306
|
}
|
|
@@ -168,16 +315,16 @@ var GestureHintComponent = ({
|
|
|
168
315
|
backgroundColor: color
|
|
169
316
|
};
|
|
170
317
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles.spreadRow, { gap: size * 0.12 }], pointerEvents: "none", children: [
|
|
171
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
172
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
318
|
+
/* @__PURE__ */ jsxRuntime.jsx(Animated.View, { style: spreadLeftStyle, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: capsule }) }),
|
|
319
|
+
/* @__PURE__ */ jsxRuntime.jsx(Animated.View, { style: spreadRightStyle, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: capsule }) })
|
|
173
320
|
] });
|
|
174
321
|
}
|
|
175
322
|
const ringSize = size * 0.86;
|
|
176
323
|
const ringBorder = Math.max(2, size * 0.08);
|
|
177
324
|
const dotSize = size * 0.32;
|
|
178
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles.tapWrap, { width: size, height: size }], pointerEvents: "none", children: customGlyph ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
325
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles.tapWrap, { width: size, height: size }], pointerEvents: "none", children: customGlyph ? /* @__PURE__ */ jsxRuntime.jsx(Animated.View, { style: tapAnimatedStyle, pointerEvents: "none", children: customGlyph }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
179
326
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
180
|
-
|
|
327
|
+
Animated.View,
|
|
181
328
|
{
|
|
182
329
|
style: [
|
|
183
330
|
styles.tapRing,
|
|
@@ -242,9 +389,54 @@ var getCoachmarkStorage = () => coachmarkRuntime().storage;
|
|
|
242
389
|
var isCoachmarkTesting = () => coachmarkRuntime().testing;
|
|
243
390
|
var showcaseGateKey = (showcaseId) => `wire_showcase_${showcaseId}_seen`;
|
|
244
391
|
var SEEN_VALUE = "1";
|
|
392
|
+
var GATE_PROBE_KEY = "wire_gate_probe";
|
|
393
|
+
var ASYNC_GATE_STORAGE_WARNED_SLOT = /* @__PURE__ */ Symbol.for(
|
|
394
|
+
"@wireai/activation:asyncGateStorageWarned"
|
|
395
|
+
);
|
|
396
|
+
var asyncGateWarnGlobal = globalThis;
|
|
397
|
+
var closedGateStorage = Object.freeze({
|
|
398
|
+
getItem: () => SEEN_VALUE,
|
|
399
|
+
setItem: () => {
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
var syncGateAdapters = /* @__PURE__ */ new WeakSet();
|
|
403
|
+
var asyncGateAdapters = /* @__PURE__ */ new WeakSet();
|
|
404
|
+
var warnAsyncGateStorage = () => {
|
|
405
|
+
if (asyncGateWarnGlobal[ASYNC_GATE_STORAGE_WARNED_SLOT]) return;
|
|
406
|
+
if (typeof __DEV__ === "undefined" || !__DEV__) return;
|
|
407
|
+
if (typeof console === "undefined" || !console.warn) return;
|
|
408
|
+
asyncGateWarnGlobal[ASYNC_GATE_STORAGE_WARNED_SLOT] = true;
|
|
409
|
+
console.warn(
|
|
410
|
+
"[wireai] the gate storage's getItem returned a Promise \u2014 an async adapter (e.g. AsyncStorage) cannot drive the once-per-user gates, so coachmark tours, showcases and the review/questionnaire gates are all DISABLED (fail closed: nothing shows, nothing fires) until a synchronous adapter is provided. Pass a sync adapter (e.g. MMKV: `{ getItem: (k) => mmkv.getString(k) ?? null, setItem: (k, v) => mmkv.set(k, v) }`) to CoachmarkProvider or the gate's `storage` prop."
|
|
411
|
+
);
|
|
412
|
+
};
|
|
413
|
+
var validateGateStorage = (storage) => {
|
|
414
|
+
if (!storage) return null;
|
|
415
|
+
if (syncGateAdapters.has(storage)) return storage;
|
|
416
|
+
if (asyncGateAdapters.has(storage)) return closedGateStorage;
|
|
417
|
+
let probed;
|
|
418
|
+
try {
|
|
419
|
+
probed = storage.getItem(GATE_PROBE_KEY);
|
|
420
|
+
} catch {
|
|
421
|
+
syncGateAdapters.add(storage);
|
|
422
|
+
return storage;
|
|
423
|
+
}
|
|
424
|
+
if (probed != null && typeof probed.then === "function") {
|
|
425
|
+
asyncGateAdapters.add(storage);
|
|
426
|
+
try {
|
|
427
|
+
probed.then(void 0, () => {
|
|
428
|
+
});
|
|
429
|
+
} catch {
|
|
430
|
+
}
|
|
431
|
+
warnAsyncGateStorage();
|
|
432
|
+
return closedGateStorage;
|
|
433
|
+
}
|
|
434
|
+
syncGateAdapters.add(storage);
|
|
435
|
+
return storage;
|
|
436
|
+
};
|
|
245
437
|
var hasSeenGate = (key, storageOverride, testingOverride) => {
|
|
246
438
|
if (testingOverride != null ? testingOverride : isCoachmarkTesting()) return false;
|
|
247
|
-
const storage = storageOverride != null ? storageOverride : getCoachmarkStorage();
|
|
439
|
+
const storage = validateGateStorage(storageOverride != null ? storageOverride : getCoachmarkStorage());
|
|
248
440
|
if (!storage) return false;
|
|
249
441
|
try {
|
|
250
442
|
return storage.getItem(key) === SEEN_VALUE;
|
|
@@ -254,7 +446,7 @@ var hasSeenGate = (key, storageOverride, testingOverride) => {
|
|
|
254
446
|
};
|
|
255
447
|
var markSeenGate = (key, storageOverride, testingOverride) => {
|
|
256
448
|
if (testingOverride != null ? testingOverride : isCoachmarkTesting()) return;
|
|
257
|
-
const storage = storageOverride != null ? storageOverride : getCoachmarkStorage();
|
|
449
|
+
const storage = validateGateStorage(storageOverride != null ? storageOverride : getCoachmarkStorage());
|
|
258
450
|
if (!storage) return;
|
|
259
451
|
try {
|
|
260
452
|
storage.setItem(key, SEEN_VALUE);
|
|
@@ -339,8 +531,8 @@ var DEFAULT_TIMEOUT_MS = 4e3;
|
|
|
339
531
|
var failOpen = async (storage, key) => {
|
|
340
532
|
var _a;
|
|
341
533
|
if (!storage) return defaultWireFeatures;
|
|
342
|
-
const
|
|
343
|
-
return (_a =
|
|
534
|
+
const cached3 = await readCachedFeatures(storage, key);
|
|
535
|
+
return (_a = cached3 == null ? void 0 : cached3.features) != null ? _a : defaultWireFeatures;
|
|
344
536
|
};
|
|
345
537
|
var fetchWithTimeout = async (url, apiKey, timeoutMs) => {
|
|
346
538
|
const controller = typeof AbortController !== "undefined" ? new AbortController() : void 0;
|
|
@@ -475,6 +667,47 @@ var useOnboardingTheme = () => {
|
|
|
475
667
|
return ctx != null ? ctx : mergeTheme();
|
|
476
668
|
};
|
|
477
669
|
|
|
670
|
+
// src/showcase/blazejOnboarding.ts
|
|
671
|
+
var MODULE_NAME = "@blazejkustra/react-native-onboarding";
|
|
672
|
+
var runtimeRequire2 = (moduleName) => {
|
|
673
|
+
if (moduleName !== MODULE_NAME) return void 0;
|
|
674
|
+
if (typeof __require !== "function") return void 0;
|
|
675
|
+
try {
|
|
676
|
+
return require("@blazejkustra/react-native-onboarding");
|
|
677
|
+
} catch {
|
|
678
|
+
return void 0;
|
|
679
|
+
}
|
|
680
|
+
};
|
|
681
|
+
var interop = (mod) => {
|
|
682
|
+
if (typeof mod === "function") return mod;
|
|
683
|
+
if (!mod || typeof mod !== "object") return void 0;
|
|
684
|
+
const ns = mod;
|
|
685
|
+
if (ns.default) return ns.default;
|
|
686
|
+
if ("$$typeof" in ns) return ns;
|
|
687
|
+
return void 0;
|
|
688
|
+
};
|
|
689
|
+
var asComponent = (value) => {
|
|
690
|
+
if (typeof value === "function") return value;
|
|
691
|
+
if (value && typeof value === "object" && "$$typeof" in value) {
|
|
692
|
+
return value;
|
|
693
|
+
}
|
|
694
|
+
return void 0;
|
|
695
|
+
};
|
|
696
|
+
var cached2;
|
|
697
|
+
var resolveShowcaseOnboarding = (requireModule = runtimeRequire2) => {
|
|
698
|
+
try {
|
|
699
|
+
if (cached2 === void 0 || requireModule !== runtimeRequire2) {
|
|
700
|
+
const component = asComponent(interop(requireModule(MODULE_NAME)));
|
|
701
|
+
if (requireModule === runtimeRequire2) cached2 = component != null ? component : null;
|
|
702
|
+
return component;
|
|
703
|
+
}
|
|
704
|
+
if (cached2 === null) return void 0;
|
|
705
|
+
return cached2;
|
|
706
|
+
} catch {
|
|
707
|
+
return void 0;
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
|
|
478
711
|
// src/showcase/showcaseColors.ts
|
|
479
712
|
var showcaseColorsFromTheme = (t, accent) => ({
|
|
480
713
|
background: {
|
|
@@ -535,12 +768,13 @@ var _FeatureShowcase = ({
|
|
|
535
768
|
const accent = accentColor != null ? accentColor : t.colors.primary;
|
|
536
769
|
const flags = useResolvedFeatures({ flags: features, config: featuresConfig });
|
|
537
770
|
const disabled = !flags.showcase.enabled;
|
|
771
|
+
const Onboarding = React.useMemo(() => resolveShowcaseOnboarding(), []);
|
|
538
772
|
const gateKey = showcaseGateKey(config.id);
|
|
539
773
|
const seen = React.useMemo(
|
|
540
774
|
() => hasSeenGate(gateKey, storage, isTesting),
|
|
541
775
|
[gateKey, storage, isTesting]
|
|
542
776
|
);
|
|
543
|
-
const skip = seen || disabled;
|
|
777
|
+
const skip = seen || disabled || !Onboarding;
|
|
544
778
|
const doneRef = React.useRef(false);
|
|
545
779
|
const finish = React.useCallback(() => {
|
|
546
780
|
if (doneRef.current) return;
|
|
@@ -620,12 +854,12 @@ var _FeatureShowcase = ({
|
|
|
620
854
|
}),
|
|
621
855
|
[t]
|
|
622
856
|
);
|
|
623
|
-
if (skip) return null;
|
|
857
|
+
if (skip || !Onboarding) return null;
|
|
624
858
|
const activeGesture = (_a = config.slides[activeIndex]) == null ? void 0 : _a.gesture;
|
|
625
859
|
const showGesture = !!activeGesture && activeGesture !== "none" && activeGesture !== "tap" && activeGesture !== "double_tap";
|
|
626
860
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles2.fill, children: [
|
|
627
861
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
628
|
-
|
|
862
|
+
Onboarding,
|
|
629
863
|
{
|
|
630
864
|
introPanel,
|
|
631
865
|
steps,
|