@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.
Files changed (67) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +144 -0
  3. package/README.md +23 -9
  4. package/dist/analytics/index.d.mts +5 -5
  5. package/dist/analytics/index.d.ts +5 -5
  6. package/dist/analytics/index.js.map +1 -1
  7. package/dist/analytics/index.mjs.map +1 -1
  8. package/dist/coachmarks/index.d.mts +13 -5
  9. package/dist/coachmarks/index.d.ts +13 -5
  10. package/dist/coachmarks/index.js +252 -58
  11. package/dist/coachmarks/index.js.map +1 -1
  12. package/dist/coachmarks/index.mjs +204 -9
  13. package/dist/coachmarks/index.mjs.map +1 -1
  14. package/dist/{currentSession-CW_5Mq4O.d.ts → currentSession-CFSRZ2wg.d.ts} +10 -4
  15. package/dist/{currentSession-CUvTOchb.d.mts → currentSession-orZy5p1e.d.mts} +10 -4
  16. package/dist/{decision-Bgo17oH7.d.mts → decision-3vWLuBlO.d.ts} +11 -2
  17. package/dist/{decision-Bkh_LigV.d.ts → decision-yBj2AyPW.d.mts} +11 -2
  18. package/dist/index.d.mts +2 -2
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/questionnaire/index.d.mts +3 -3
  23. package/dist/questionnaire/index.d.ts +3 -3
  24. package/dist/questionnaire/index.js +48 -3
  25. package/dist/questionnaire/index.js.map +1 -1
  26. package/dist/questionnaire/index.mjs +48 -3
  27. package/dist/questionnaire/index.mjs.map +1 -1
  28. package/dist/reviews/index.d.mts +10 -6
  29. package/dist/reviews/index.d.ts +10 -6
  30. package/dist/reviews/index.js +167 -18
  31. package/dist/reviews/index.js.map +1 -1
  32. package/dist/reviews/index.mjs +167 -18
  33. package/dist/reviews/index.mjs.map +1 -1
  34. package/dist/showcase/index.d.mts +1 -1
  35. package/dist/showcase/index.d.ts +1 -1
  36. package/dist/showcase/index.js +282 -48
  37. package/dist/showcase/index.js.map +1 -1
  38. package/dist/showcase/index.mjs +248 -12
  39. package/dist/showcase/index.mjs.map +1 -1
  40. package/dist/{transport-j5gFfJhK.d.mts → transport-s5QxA-ci.d.mts} +18 -13
  41. package/dist/{transport-B_0SgCBe.d.ts → transport-xqqSFqxs.d.ts} +18 -13
  42. package/dist/{types-Cju-1_jT.d.mts → types-Byx306Kv.d.mts} +25 -10
  43. package/dist/{types-BcmagF6K.d.mts → types-D_0B0yay.d.mts} +7 -2
  44. package/dist/{types-BcmagF6K.d.ts → types-D_0B0yay.d.ts} +7 -2
  45. package/dist/{types-h2BZvl1t.d.ts → types-tdATL5z0.d.ts} +25 -10
  46. package/metro/index.js +16 -5
  47. package/package.json +1 -1
  48. package/src/WireOnboarding.tsx +4 -1
  49. package/src/coachmarks/GestureHint.tsx +16 -7
  50. package/src/coachmarks/SpotlightOverlay.tsx +19 -13
  51. package/src/coachmarks/index.ts +7 -2
  52. package/src/coachmarks/reanimated.ts +342 -0
  53. package/src/coachmarks/runtime.ts +103 -2
  54. package/src/coachmarks/types.ts +7 -2
  55. package/src/context/deviceId.ts +32 -0
  56. package/src/reviews/ReviewGate.tsx +86 -37
  57. package/src/reviews/decision.ts +11 -1
  58. package/src/reviews/idempotency.ts +71 -0
  59. package/src/reviews/index.ts +4 -2
  60. package/src/reviews/runtime.ts +5 -3
  61. package/src/reviews/transport.ts +17 -12
  62. package/src/reviews/types.ts +7 -0
  63. package/src/showcase/FeatureShowcase.tsx +25 -9
  64. package/src/showcase/blazejOnboarding.ts +136 -0
  65. package/src/showcase/index.ts +8 -4
  66. package/src/types.ts +10 -4
  67. package/src/utils/submitResult.ts +17 -9
@@ -685,8 +685,11 @@ type WireOnboardingProps = {
685
685
  *
686
686
  * SINCE 0.12.2, leaving it out no longer silently empties the funnel: when you pass `storage` and
687
687
  * this prop carries no `device_key`, the kit injects its OWN per-install key — the same one the
688
- * analytics surfaces mint and persist — so the default wiring joins. Anything you DO pass wins
689
- * verbatim and is never touched. See `autoJoinKey` for the opt-out and the two cases where the kit
688
+ * analytics surfaces mint and persist — so the default wiring joins. A `device_key` you DO pass
689
+ * wins verbatim and is never touched, provided it is a string with at least one non-whitespace
690
+ * character (`resolveIdentity`) — this map also accepts numbers and booleans, and a non-string or
691
+ * all-whitespace value is not a usable join key, so it is read as absent and the auto key is
692
+ * merged over it. See `autoJoinKey` for the opt-out and the two cases where the kit
690
693
  * still cannot fill the gap (no `storage`, or you opted out), which keep warning in dev.
691
694
  *
692
695
  * Never hand-write `userContext={{ deviceKey }}`: the server's device lookup reads `device_key`,
@@ -713,8 +716,11 @@ type WireOnboardingProps = {
713
716
  * `autoJoinKey={false}` if you genuinely want an UNLINKED onboarding session; that restores the
714
717
  * pre-0.12.2 behavior exactly (nothing injected) and the dev warning fires again.
715
718
  *
716
- * Two things this flag does NOT do. It never overrides a `device_key` you passed — a host-supplied
717
- * key always wins, whatever this is set to. And it cannot conjure a key without `storage`: with no
719
+ * Two things this flag does NOT do. It never overrides a `device_key` you actually supplied — a
720
+ * host-supplied key always wins, whatever this is set to, where "supplied" means a string with at
721
+ * least one non-whitespace character (`resolveIdentity`); a non-string or an all-whitespace value
722
+ * is read as absent and the auto key is merged over it. And it cannot conjure a key without
723
+ * `storage`: with no
718
724
  * persistence the kit's id is minted fresh every launch, and a per-launch key corrupts
719
725
  * `min_sessions` instead of merely leaving the join empty, so the kit declines to inject and warns
720
726
  * in dev instead.
@@ -685,8 +685,11 @@ type WireOnboardingProps = {
685
685
  *
686
686
  * SINCE 0.12.2, leaving it out no longer silently empties the funnel: when you pass `storage` and
687
687
  * this prop carries no `device_key`, the kit injects its OWN per-install key — the same one the
688
- * analytics surfaces mint and persist — so the default wiring joins. Anything you DO pass wins
689
- * verbatim and is never touched. See `autoJoinKey` for the opt-out and the two cases where the kit
688
+ * analytics surfaces mint and persist — so the default wiring joins. A `device_key` you DO pass
689
+ * wins verbatim and is never touched, provided it is a string with at least one non-whitespace
690
+ * character (`resolveIdentity`) — this map also accepts numbers and booleans, and a non-string or
691
+ * all-whitespace value is not a usable join key, so it is read as absent and the auto key is
692
+ * merged over it. See `autoJoinKey` for the opt-out and the two cases where the kit
690
693
  * still cannot fill the gap (no `storage`, or you opted out), which keep warning in dev.
691
694
  *
692
695
  * Never hand-write `userContext={{ deviceKey }}`: the server's device lookup reads `device_key`,
@@ -713,8 +716,11 @@ type WireOnboardingProps = {
713
716
  * `autoJoinKey={false}` if you genuinely want an UNLINKED onboarding session; that restores the
714
717
  * pre-0.12.2 behavior exactly (nothing injected) and the dev warning fires again.
715
718
  *
716
- * Two things this flag does NOT do. It never overrides a `device_key` you passed — a host-supplied
717
- * key always wins, whatever this is set to. And it cannot conjure a key without `storage`: with no
719
+ * Two things this flag does NOT do. It never overrides a `device_key` you actually supplied — a
720
+ * host-supplied key always wins, whatever this is set to, where "supplied" means a string with at
721
+ * least one non-whitespace character (`resolveIdentity`); a non-string or an all-whitespace value
722
+ * is read as absent and the auto key is merged over it. And it cannot conjure a key without
723
+ * `storage`: with no
718
724
  * persistence the kit's id is minted fresh every launch, and a per-launch key corrupts
719
725
  * `min_sessions` instead of merely leaving the join empty, so the kit declines to inject and warns
720
726
  * in dev instead.
@@ -1,4 +1,4 @@
1
- import { c as ReviewDecision, j as ReviewSubmission, e as RatingRoute } from './types-Cju-1_jT.mjs';
1
+ import { c as ReviewDecision, j as ReviewSubmission, e as RatingRoute } from './types-tdATL5z0.js';
2
2
 
3
3
  /**
4
4
  * decision.ts — the pure decision logic for the review gate.
@@ -65,7 +65,14 @@ declare const evaluateGate: (rules: GateRules, s: GateSignals) => ReviewDecision
65
65
  * never a button labeled "rate us 5 stars" (see the store-policy notes in the README).
66
66
  */
67
67
  declare const routeRating: (stars: number) => RatingRoute;
68
- /** Build the `POST /v1/reviews` body. Feedback text/contact belong ONLY here, never in events. */
68
+ /**
69
+ * Build the `POST /v1/reviews` body. Feedback text/contact belong ONLY here, never in events.
70
+ *
71
+ * STILL PURE, deliberately: `idempotencyKey` and the `meta.device_key` the server scopes it to are
72
+ * both passed IN rather than resolved here. Reaching into the device-key registry from this function
73
+ * would make the gate logic untestable in isolation, and both values are scoped to an impression
74
+ * this function cannot see — see `reviews/idempotency.ts`.
75
+ */
69
76
  declare const buildReviewSubmission: (input: {
70
77
  stars: number;
71
78
  feedbackText?: string;
@@ -73,6 +80,8 @@ declare const buildReviewSubmission: (input: {
73
80
  contact?: string;
74
81
  sessionId?: string;
75
82
  source?: string;
83
+ /** The impression's idempotency key. Omitted → the server mints a row id and inserts, as before. */
84
+ idempotencyKey?: string;
76
85
  meta?: Record<string, unknown>;
77
86
  }) => ReviewSubmission;
78
87
 
@@ -1,4 +1,4 @@
1
- import { c as ReviewDecision, j as ReviewSubmission, e as RatingRoute } from './types-h2BZvl1t.js';
1
+ import { c as ReviewDecision, j as ReviewSubmission, e as RatingRoute } from './types-Byx306Kv.mjs';
2
2
 
3
3
  /**
4
4
  * decision.ts — the pure decision logic for the review gate.
@@ -65,7 +65,14 @@ declare const evaluateGate: (rules: GateRules, s: GateSignals) => ReviewDecision
65
65
  * never a button labeled "rate us 5 stars" (see the store-policy notes in the README).
66
66
  */
67
67
  declare const routeRating: (stars: number) => RatingRoute;
68
- /** Build the `POST /v1/reviews` body. Feedback text/contact belong ONLY here, never in events. */
68
+ /**
69
+ * Build the `POST /v1/reviews` body. Feedback text/contact belong ONLY here, never in events.
70
+ *
71
+ * STILL PURE, deliberately: `idempotencyKey` and the `meta.device_key` the server scopes it to are
72
+ * both passed IN rather than resolved here. Reaching into the device-key registry from this function
73
+ * would make the gate logic untestable in isolation, and both values are scoped to an impression
74
+ * this function cannot see — see `reviews/idempotency.ts`.
75
+ */
69
76
  declare const buildReviewSubmission: (input: {
70
77
  stars: number;
71
78
  feedbackText?: string;
@@ -73,6 +80,8 @@ declare const buildReviewSubmission: (input: {
73
80
  contact?: string;
74
81
  sessionId?: string;
75
82
  source?: string;
83
+ /** The impression's idempotency key. Omitted → the server mints a row id and inserts, as before. */
84
+ idempotencyKey?: string;
76
85
  meta?: Record<string, unknown>;
77
86
  }) => ReviewSubmission;
78
87
 
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { ReactNode } from 'react';
3
- import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, C as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, c as ClientEvent, U as PermissionPlacement, g as EnvelopeSource } from './currentSession-CUvTOchb.mjs';
4
- export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-CUvTOchb.mjs';
3
+ import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, C as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, c as ClientEvent, U as PermissionPlacement, g as EnvelopeSource } from './currentSession-orZy5p1e.mjs';
4
+ export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-orZy5p1e.mjs';
5
5
  import { O as OnboardingTheme } from './types-BKfpdZzX.mjs';
6
6
  export { a as OnboardingButtonStyle, b as OnboardingColors, c as OnboardingFonts, d as OnboardingRadius, e as OnboardingSpacing } from './types-BKfpdZzX.mjs';
7
7
  export { C as CenteredModal, a as CenteredModalHandle, b as CenteredModalProps } from './CenteredModal-C3qQBHsA.mjs';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { ReactNode } from 'react';
3
- import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, C as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, c as ClientEvent, U as PermissionPlacement, g as EnvelopeSource } from './currentSession-CW_5Mq4O.js';
4
- export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-CW_5Mq4O.js';
3
+ import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, C as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, c as ClientEvent, U as PermissionPlacement, g as EnvelopeSource } from './currentSession-CFSRZ2wg.js';
4
+ export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-CFSRZ2wg.js';
5
5
  import { O as OnboardingTheme } from './types-BKfpdZzX.js';
6
6
  export { a as OnboardingButtonStyle, b as OnboardingColors, c as OnboardingFonts, d as OnboardingRadius, e as OnboardingSpacing } from './types-BKfpdZzX.js';
7
7
  export { C as CenteredModal, a as CenteredModalHandle, b as CenteredModalProps } from './CenteredModal-Cdgns6--.js';