@wireai/activation 0.2.0 → 0.4.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/dist/analytics/index.d.mts +69 -2
- package/dist/analytics/index.d.ts +69 -2
- package/dist/analytics/index.js +123 -2
- package/dist/analytics/index.js.map +1 -1
- package/dist/analytics/index.mjs +122 -3
- package/dist/analytics/index.mjs.map +1 -1
- package/dist/coachmarks/index.js +6 -1
- package/dist/coachmarks/index.js.map +1 -1
- package/dist/coachmarks/index.mjs +6 -1
- package/dist/coachmarks/index.mjs.map +1 -1
- package/dist/{eventQueue-CxKi7Qd5.d.mts → eventQueue-CA1d8Fmn.d.mts} +7 -3
- package/dist/{eventQueue-rV1dtJJR.d.ts → eventQueue-CrNB9gzH.d.ts} +7 -3
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +220 -151
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +221 -152
- package/dist/index.mjs.map +1 -1
- package/dist/questionnaire/index.d.mts +1 -1
- package/dist/questionnaire/index.d.ts +1 -1
- package/dist/questionnaire/index.js +29 -5
- package/dist/questionnaire/index.js.map +1 -1
- package/dist/questionnaire/index.mjs +30 -6
- package/dist/questionnaire/index.mjs.map +1 -1
- package/dist/reviews/index.d.mts +1 -1
- package/dist/reviews/index.d.ts +1 -1
- package/dist/reviews/index.js +40 -9
- package/dist/reviews/index.js.map +1 -1
- package/dist/reviews/index.mjs +42 -11
- package/dist/reviews/index.mjs.map +1 -1
- package/dist/showcase/index.d.mts +1 -14
- package/dist/showcase/index.d.ts +1 -14
- package/dist/showcase/index.js +8 -2
- package/dist/showcase/index.js.map +1 -1
- package/dist/showcase/index.mjs +8 -2
- package/dist/showcase/index.mjs.map +1 -1
- package/package.json +3 -2
- package/src/OnboardingFlow.tsx +8 -4
- package/src/WireOnboarding.tsx +8 -3
- package/src/analytics/analyticsFacade.ts +184 -0
- package/src/analytics/eventQueue.ts +5 -0
- package/src/analytics/index.ts +12 -0
- package/src/analytics/reportClientEvent.ts +11 -2
- package/src/analytics/useAnalytics.ts +42 -0
- package/src/analytics/useScreenTracking.ts +23 -1
- package/src/cards/InterstitialCard.tsx +1 -1
- package/src/cards/NumberStepperCard.tsx +12 -7
- package/src/cards/StatusCard.tsx +13 -8
- package/src/cards/TextInputCard.tsx +10 -5
- package/src/components/AnimatedSparkle.tsx +20 -3
- package/src/components/Button.tsx +10 -1
- package/src/components/CardHandoff.tsx +2 -6
- package/src/components/CardLayout.tsx +16 -10
- package/src/components/Illustration.tsx +9 -5
- package/src/components/LoadingBlock.tsx +44 -29
- package/src/components/LoadingScreen.tsx +3 -2
- package/src/components/OnboardingScaffold.tsx +21 -23
- package/src/features/WireFeaturesProvider.tsx +7 -2
- package/src/questionnaire/QuestionnaireGate.tsx +15 -3
- package/src/reviews/ReviewGate.tsx +27 -7
- package/src/reviews/ReviewModal.tsx +4 -0
- package/src/showcase/FeatureShowcase.tsx +2 -1
- package/src/components/loaderChrome.ts +0 -28
|
@@ -177,7 +177,7 @@ interface QuestionnaireGateController {
|
|
|
177
177
|
* OnboardingTheme; analytics are callback-based (no PII - answers go ONLY in the POST body).
|
|
178
178
|
*/
|
|
179
179
|
|
|
180
|
-
declare const QuestionnaireGate: React__default.
|
|
180
|
+
declare const QuestionnaireGate: React__default.NamedExoticComponent<QuestionnaireGateProps>;
|
|
181
181
|
|
|
182
182
|
declare const useQuestionnaireGate: ({ config: configProp, decision: decisionProp, events, storage, isTesting, features, featuresConfig, }: UseQuestionnaireGateOptions) => QuestionnaireGateController;
|
|
183
183
|
|
|
@@ -177,7 +177,7 @@ interface QuestionnaireGateController {
|
|
|
177
177
|
* OnboardingTheme; analytics are callback-based (no PII - answers go ONLY in the POST body).
|
|
178
178
|
*/
|
|
179
179
|
|
|
180
|
-
declare const QuestionnaireGate: React__default.
|
|
180
|
+
declare const QuestionnaireGate: React__default.NamedExoticComponent<QuestionnaireGateProps>;
|
|
181
181
|
|
|
182
182
|
declare const useQuestionnaireGate: ({ config: configProp, decision: decisionProp, events, storage, isTesting, features, featuresConfig, }: UseQuestionnaireGateOptions) => QuestionnaireGateController;
|
|
183
183
|
|
|
@@ -151,6 +151,14 @@ var _Button = ({
|
|
|
151
151
|
},
|
|
152
152
|
[pressT, reduced]
|
|
153
153
|
);
|
|
154
|
+
const lastPress = React4.useRef(0);
|
|
155
|
+
const handlePress = React4.useCallback(() => {
|
|
156
|
+
if (!onPress) return;
|
|
157
|
+
const now = Date.now();
|
|
158
|
+
if (now - lastPress.current < 500) return;
|
|
159
|
+
lastPress.current = now;
|
|
160
|
+
onPress();
|
|
161
|
+
}, [onPress]);
|
|
154
162
|
const handlePressIn = React4.useCallback(() => pressTo(1), [pressTo]);
|
|
155
163
|
const handlePressOut = React4.useCallback(() => pressTo(0), [pressTo]);
|
|
156
164
|
const scale = pressT.interpolate({
|
|
@@ -164,7 +172,7 @@ var _Button = ({
|
|
|
164
172
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
165
173
|
reactNative.Pressable,
|
|
166
174
|
{
|
|
167
|
-
onPress: disabled ? void 0 :
|
|
175
|
+
onPress: disabled ? void 0 : handlePress,
|
|
168
176
|
onPressIn: disabled ? void 0 : handlePressIn,
|
|
169
177
|
onPressOut: disabled ? void 0 : handlePressOut,
|
|
170
178
|
disabled,
|
|
@@ -446,7 +454,7 @@ var mergeThemeOver = (base, override) => {
|
|
|
446
454
|
button: { ...base.button, ...override.button }
|
|
447
455
|
};
|
|
448
456
|
};
|
|
449
|
-
var
|
|
457
|
+
var _QuestionnaireGate = ({
|
|
450
458
|
questionnaire,
|
|
451
459
|
target,
|
|
452
460
|
sessionId,
|
|
@@ -478,6 +486,12 @@ var QuestionnaireGate = ({
|
|
|
478
486
|
(_a2 = onShownRef.current) == null ? void 0 : _a2.call(onShownRef);
|
|
479
487
|
(_b2 = onEventRef.current) == null ? void 0 : _b2.call(onEventRef, { name: "questionnaire_prompt_shown", id });
|
|
480
488
|
}, []);
|
|
489
|
+
const resolveTimer = React4__default.default.useRef(null);
|
|
490
|
+
React4__default.default.useEffect(() => {
|
|
491
|
+
return () => {
|
|
492
|
+
if (resolveTimer.current) clearTimeout(resolveTimer.current);
|
|
493
|
+
};
|
|
494
|
+
}, []);
|
|
481
495
|
const resolve = React4.useCallback(() => {
|
|
482
496
|
onResolved == null ? void 0 : onResolved();
|
|
483
497
|
}, [onResolved]);
|
|
@@ -492,8 +506,12 @@ var QuestionnaireGate = ({
|
|
|
492
506
|
submitQuestionnaireResponse(target, id, submission);
|
|
493
507
|
onEvent == null ? void 0 : onEvent({ name: "questionnaire_submitted", id });
|
|
494
508
|
setPhase("thanks");
|
|
495
|
-
|
|
496
|
-
|
|
509
|
+
if (resolveTimer.current) clearTimeout(resolveTimer.current);
|
|
510
|
+
resolveTimer.current = setTimeout(() => {
|
|
511
|
+
var _a2;
|
|
512
|
+
(_a2 = modalRef.current) == null ? void 0 : _a2.close();
|
|
513
|
+
}, 1500);
|
|
514
|
+
}, [canSend, opinion, improve, suggestions, sessionId, meta, target, id, onEvent]);
|
|
497
515
|
const handleDismissTap = React4.useCallback(() => {
|
|
498
516
|
var _a2;
|
|
499
517
|
onEvent == null ? void 0 : onEvent({ name: "questionnaire_dismissed", id });
|
|
@@ -586,6 +604,7 @@ var QuestionnaireGate = ({
|
|
|
586
604
|
] });
|
|
587
605
|
return /* @__PURE__ */ jsxRuntime.jsx(CenteredModal, { ref: modalRef, theme: t, dismissible, onDismiss: resolve, children: content });
|
|
588
606
|
};
|
|
607
|
+
var QuestionnaireGate = React4__default.default.memo(_QuestionnaireGate);
|
|
589
608
|
QuestionnaireGate.displayName = "QuestionnaireGate";
|
|
590
609
|
var styles3 = reactNative.StyleSheet.create({
|
|
591
610
|
input: { borderWidth: 1 },
|
|
@@ -756,7 +775,12 @@ var useWireFeatures = (config) => {
|
|
|
756
775
|
}, [canFetch, stableConfig]);
|
|
757
776
|
return flags;
|
|
758
777
|
};
|
|
759
|
-
var
|
|
778
|
+
var CONTEXT_SYMBOL = /* @__PURE__ */ Symbol.for("wireai.features.context");
|
|
779
|
+
var globalObj = global;
|
|
780
|
+
if (!globalObj[CONTEXT_SYMBOL]) {
|
|
781
|
+
globalObj[CONTEXT_SYMBOL] = React4.createContext(null);
|
|
782
|
+
}
|
|
783
|
+
var WireFeaturesContext = globalObj[CONTEXT_SYMBOL];
|
|
760
784
|
var useWireFeaturesContext = () => React4.useContext(WireFeaturesContext);
|
|
761
785
|
var useResolvedFeatures = (options) => {
|
|
762
786
|
var _a, _b, _c;
|