@wireai/activation 0.14.0 → 0.14.2
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/CHANGELOG.md +81 -0
- package/README.md +5 -0
- package/dist/analytics/index.js.map +1 -1
- package/dist/analytics/index.mjs.map +1 -1
- package/dist/coachmarks/index.js +69 -6
- package/dist/coachmarks/index.js.map +1 -1
- package/dist/coachmarks/index.mjs +69 -6
- package/dist/coachmarks/index.mjs.map +1 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +29 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -8
- package/dist/index.mjs.map +1 -1
- package/dist/questionnaire/index.js +14 -6
- package/dist/questionnaire/index.js.map +1 -1
- package/dist/questionnaire/index.mjs +14 -6
- package/dist/questionnaire/index.mjs.map +1 -1
- package/dist/reviews/index.js +14 -6
- package/dist/reviews/index.js.map +1 -1
- package/dist/reviews/index.mjs +14 -6
- package/dist/reviews/index.mjs.map +1 -1
- package/metro/index.js +3 -1
- package/package.json +1 -1
- package/src/WireOnboarding.tsx +44 -5
- package/src/analytics/currentSession.ts +3 -2
- package/src/coachmarks/SpotlightOverlay.tsx +38 -11
- package/src/coachmarks/expoBlur.ts +135 -0
- package/src/permissions/permissionMemory.ts +39 -14
- package/src/reviews/runtime.ts +75 -23
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import React3, { createContext, useEffect, useMemo, useContext, useSyncExternalStore, useRef, useState, useCallback } from 'react';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { BlurView } from 'expo-blur';
|
|
4
3
|
import { StyleSheet, View, useWindowDimensions, Pressable, Text } from 'react-native';
|
|
5
4
|
import Animated, { useSharedValue, useReducedMotion, withRepeat, withSequence, withTiming, withDelay, useAnimatedStyle, useAnimatedProps, FadeOut, FadeIn } from 'react-native-reanimated';
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
7
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
8
|
+
}) : x)(function(x) {
|
|
9
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
10
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
11
|
+
});
|
|
8
12
|
|
|
9
13
|
// src/features/defaults.ts
|
|
10
14
|
var defaultWireFeatures = Object.freeze({
|
|
@@ -83,8 +87,8 @@ var DEFAULT_TIMEOUT_MS = 4e3;
|
|
|
83
87
|
var failOpen = async (storage, key) => {
|
|
84
88
|
var _a;
|
|
85
89
|
if (!storage) return defaultWireFeatures;
|
|
86
|
-
const
|
|
87
|
-
return (_a =
|
|
90
|
+
const cached2 = await readCachedFeatures(storage, key);
|
|
91
|
+
return (_a = cached2 == null ? void 0 : cached2.features) != null ? _a : defaultWireFeatures;
|
|
88
92
|
};
|
|
89
93
|
var fetchWithTimeout = async (url, apiKey, timeoutMs) => {
|
|
90
94
|
const controller = typeof AbortController !== "undefined" ? new AbortController() : void 0;
|
|
@@ -322,6 +326,47 @@ var useOnboardingTheme = () => {
|
|
|
322
326
|
const ctx = useContext(OnboardingThemeContext);
|
|
323
327
|
return ctx != null ? ctx : mergeTheme();
|
|
324
328
|
};
|
|
329
|
+
|
|
330
|
+
// src/coachmarks/expoBlur.ts
|
|
331
|
+
var runtimeRequire = (moduleName) => {
|
|
332
|
+
if (moduleName !== "expo-blur") return void 0;
|
|
333
|
+
if (typeof __require !== "function") return void 0;
|
|
334
|
+
try {
|
|
335
|
+
return __require("expo-blur");
|
|
336
|
+
} catch {
|
|
337
|
+
return void 0;
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
var interop = (mod) => {
|
|
341
|
+
if (!mod || typeof mod !== "object") return void 0;
|
|
342
|
+
const ns = mod;
|
|
343
|
+
if (ns.BlurView) return ns;
|
|
344
|
+
const def = mod.default;
|
|
345
|
+
if (def && typeof def === "object") return def;
|
|
346
|
+
return ns;
|
|
347
|
+
};
|
|
348
|
+
var asComponent = (value) => {
|
|
349
|
+
if (typeof value === "function") return value;
|
|
350
|
+
if (value && typeof value === "object" && "$$typeof" in value) {
|
|
351
|
+
return value;
|
|
352
|
+
}
|
|
353
|
+
return void 0;
|
|
354
|
+
};
|
|
355
|
+
var cached;
|
|
356
|
+
var resolveBlurView = (requireModule = runtimeRequire) => {
|
|
357
|
+
try {
|
|
358
|
+
if (cached === void 0 || requireModule !== runtimeRequire) {
|
|
359
|
+
const resolved = interop(requireModule("expo-blur"));
|
|
360
|
+
const component = resolved ? asComponent(resolved.BlurView) : void 0;
|
|
361
|
+
if (requireModule === runtimeRequire) cached = component != null ? component : null;
|
|
362
|
+
return component;
|
|
363
|
+
}
|
|
364
|
+
if (cached === null) return void 0;
|
|
365
|
+
return cached;
|
|
366
|
+
} catch {
|
|
367
|
+
return void 0;
|
|
368
|
+
}
|
|
369
|
+
};
|
|
325
370
|
var SWIPE_MS = 700;
|
|
326
371
|
var TAP_MS = 320;
|
|
327
372
|
var SPREAD_MS = 620;
|
|
@@ -536,7 +581,6 @@ var styles = StyleSheet.create({
|
|
|
536
581
|
});
|
|
537
582
|
var GestureHint = React3.memo(GestureHintComponent);
|
|
538
583
|
GestureHint.displayName = "GestureHint";
|
|
539
|
-
var AnimatedBlurView = Animated.createAnimatedComponent(BlurView);
|
|
540
584
|
var BLUR_INTENSITY = 26;
|
|
541
585
|
var FADE_MS = 280;
|
|
542
586
|
var RING_PADDING = 10;
|
|
@@ -558,6 +602,10 @@ var SpotlightOverlayComponent = ({
|
|
|
558
602
|
const theme = useOnboardingTheme();
|
|
559
603
|
const accent = accentColor != null ? accentColor : theme.colors.primary;
|
|
560
604
|
const accentText = accentTextColor != null ? accentTextColor : theme.colors.onPrimary;
|
|
605
|
+
const AnimatedBlurView = useMemo(() => {
|
|
606
|
+
const BlurView = resolveBlurView();
|
|
607
|
+
return BlurView ? Animated.createAnimatedComponent(BlurView) : null;
|
|
608
|
+
}, []);
|
|
561
609
|
const showGesture = gesture !== "none" && gesture !== "tap" && gesture !== "double_tap";
|
|
562
610
|
const intensity = useSharedValue(0);
|
|
563
611
|
const ringScale = useSharedValue(1);
|
|
@@ -606,13 +654,23 @@ var SpotlightOverlayComponent = ({
|
|
|
606
654
|
entering: FadeIn.duration(FADE_MS),
|
|
607
655
|
exiting: FadeOut.duration(FADE_MS),
|
|
608
656
|
children: [
|
|
609
|
-
/* @__PURE__ */ jsx(
|
|
657
|
+
AnimatedBlurView ? /* @__PURE__ */ jsx(
|
|
610
658
|
AnimatedBlurView,
|
|
611
659
|
{
|
|
612
660
|
tint: "dark",
|
|
613
661
|
animatedProps: blurAnimatedProps,
|
|
614
662
|
style: StyleSheet.absoluteFill
|
|
615
663
|
}
|
|
664
|
+
) : (
|
|
665
|
+
// `expo-blur` absent → a plain dimmed scrim stands in for the frost. Same dark backdrop
|
|
666
|
+
// the tour reads against, so the ring, tooltip and gestures behave identically.
|
|
667
|
+
/* @__PURE__ */ jsx(
|
|
668
|
+
Animated.View,
|
|
669
|
+
{
|
|
670
|
+
style: [StyleSheet.absoluteFill, styles2.scrim],
|
|
671
|
+
pointerEvents: "none"
|
|
672
|
+
}
|
|
673
|
+
)
|
|
616
674
|
),
|
|
617
675
|
/* @__PURE__ */ jsx(
|
|
618
676
|
Pressable,
|
|
@@ -679,6 +737,11 @@ var styles2 = StyleSheet.create({
|
|
|
679
737
|
zIndex: 9999,
|
|
680
738
|
elevation: 9999
|
|
681
739
|
},
|
|
740
|
+
// Fallback backdrop when `expo-blur` is absent. A structural dim (not a brand token), tuned to
|
|
741
|
+
// read like the dark blur at BLUR_INTENSITY so the ring + tooltip keep the same contrast.
|
|
742
|
+
scrim: {
|
|
743
|
+
backgroundColor: "rgba(0, 0, 0, 0.55)"
|
|
744
|
+
},
|
|
682
745
|
ring: {
|
|
683
746
|
position: "absolute",
|
|
684
747
|
borderWidth: 2.5,
|