@wireai/activation 0.8.0 → 0.9.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 +29 -5
- package/CHANGELOG.md +163 -6
- package/README.md +105 -10
- package/dist/analytics/index.d.mts +6 -6
- package/dist/analytics/index.d.ts +6 -6
- package/dist/analytics/index.js +447 -49
- package/dist/analytics/index.js.map +1 -1
- package/dist/analytics/index.mjs +447 -49
- package/dist/analytics/index.mjs.map +1 -1
- package/dist/coachmarks/index.d.mts +2 -2
- package/dist/coachmarks/index.d.ts +2 -2
- package/dist/coachmarks/index.js.map +1 -1
- package/dist/coachmarks/index.mjs.map +1 -1
- package/dist/{currentSession-f7LWcdWG.d.ts → currentSession-61dcm3V-.d.ts} +10 -2
- package/dist/{currentSession-d9CrBxwe.d.mts → currentSession-Bs2JfTJ8.d.mts} +10 -2
- package/dist/{decision-BzbiKwk3.d.mts → decision-Bl_M2y3r.d.mts} +1 -1
- package/dist/{decision-plDEOCkt.d.ts → decision-Cau5KmP6.d.ts} +1 -1
- package/dist/index.d.mts +558 -15
- package/dist/index.d.ts +558 -15
- package/dist/index.js +1144 -375
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +969 -207
- package/dist/index.mjs.map +1 -1
- package/dist/questionnaire/index.d.mts +69 -23
- package/dist/questionnaire/index.d.ts +69 -23
- package/dist/questionnaire/index.js +643 -172
- package/dist/questionnaire/index.js.map +1 -1
- package/dist/questionnaire/index.mjs +608 -137
- package/dist/questionnaire/index.mjs.map +1 -1
- package/dist/reviews/index.d.mts +24 -12
- package/dist/reviews/index.d.ts +24 -12
- package/dist/reviews/index.js +507 -173
- package/dist/reviews/index.js.map +1 -1
- package/dist/reviews/index.mjs +462 -129
- package/dist/reviews/index.mjs.map +1 -1
- package/dist/showcase/index.d.mts +2 -2
- package/dist/showcase/index.d.ts +2 -2
- package/dist/showcase/index.js.map +1 -1
- package/dist/showcase/index.mjs.map +1 -1
- package/dist/transport-DzU-TqZz.d.ts +86 -0
- package/dist/transport-f5VVB5hH.d.mts +86 -0
- package/dist/{types-GL_hQ0TN.d.mts → types-BcmagF6K.d.mts} +1 -1
- package/dist/{types-GL_hQ0TN.d.ts → types-BcmagF6K.d.ts} +1 -1
- package/dist/{types-BhpXJGlg.d.ts → types-Buj9Lw9t.d.ts} +15 -3
- package/dist/{types-CMuOexw0.d.mts → types-CKFhyrMu.d.mts} +1 -1
- package/dist/{types-CMuOexw0.d.ts → types-CKFhyrMu.d.ts} +1 -1
- package/dist/{types-A6pTxIZV.d.mts → types-CNUqMK0D.d.mts} +15 -3
- package/metro/index.d.ts +18 -1
- package/metro/index.js +80 -0
- package/package.json +9 -1
- package/src/WireOnboarding.tsx +4 -0
- package/src/analytics/currentSession.ts +1 -1
- package/src/cards/CardGridSelectCard.tsx +253 -0
- package/src/cards/ChipSelectCard.tsx +1 -1
- package/src/cards/SelectionCard.tsx +15 -19
- package/src/cards/index.ts +13 -1
- package/src/cards/optionSchema.ts +65 -0
- package/src/coachmarks/types.ts +1 -1
- package/src/components/CardHandoff.tsx +39 -7
- package/src/components/DoneCheck.tsx +94 -0
- package/src/components/ModalPaneHost.tsx +141 -0
- package/src/components/StepDots.tsx +112 -0
- package/src/device/appVersion.ts +29 -8
- package/src/device/deviceModel.ts +21 -8
- package/src/features/cache.ts +1 -1
- package/src/haptics/expo-haptics.d.ts +31 -0
- package/src/haptics/haptics.ts +58 -0
- package/src/icons/IconRegistry.tsx +53 -0
- package/src/icons/WireIcon.tsx +85 -0
- package/src/icons/expoIcons.ts +165 -0
- package/src/icons/index.ts +18 -0
- package/src/icons/vocabulary.ts +154 -0
- package/src/index.ts +20 -0
- package/src/questionnaire/QuestionnaireGate.tsx +315 -164
- package/src/questionnaire/decision.ts +4 -2
- package/src/questionnaire/index.ts +3 -2
- package/src/questionnaire/steps.ts +261 -0
- package/src/questionnaire/types.ts +33 -12
- package/src/reviews/ReviewGate.tsx +250 -152
- package/src/reviews/index.ts +7 -3
- package/src/reviews/transport.ts +77 -3
- package/src/reviews/types.ts +13 -0
- package/src/session/persistedSession.ts +1 -1
- package/src/session-analytics/lifecycle.ts +1 -1
- package/src/session-analytics/useSessionStart.ts +2 -2
- package/src/showcase/FeatureShowcase.tsx +1 -1
- package/src/showcase/showcaseColors.ts +1 -1
- package/src/theme/mergeThemeOver.ts +27 -0
- package/src/types.ts +8 -0
- package/dist/transport-BeO_Brcu.d.mts +0 -40
- package/dist/transport-DLpd1v5_.d.ts +0 -40
|
@@ -44,7 +44,7 @@ import { reportSessionStart, SESSION_STARTED_EVENT } from "./reportSessionStart"
|
|
|
44
44
|
* {@link SESSION_STARTED_EVENT}; a trigger keys off this exact string. */
|
|
45
45
|
export const FIRST_OPEN_EVENT = "app.first_open" as const;
|
|
46
46
|
|
|
47
|
-
/** Storage key for the once-ever first-open flag, e.g. `wireai:first_open:
|
|
47
|
+
/** Storage key for the once-ever first-open flag, e.g. `wireai:first_open:acme`. Mirrors the
|
|
48
48
|
* `wireai:<concern>:<appId>` namespacing of {@link sessionStorageKey}. */
|
|
49
49
|
export const firstOpenStorageKey = (appId: string): string => `wireai:first_open:${appId}`;
|
|
50
50
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* useSessionStart — the optional convenience hook that fires {@link reportSessionStart} for you.
|
|
3
3
|
*
|
|
4
|
-
* Two firing moments, mirroring the
|
|
4
|
+
* Two firing moments, mirroring the reference apps' session-counter semantics:
|
|
5
5
|
* • ON MOUNT — the app opened (cold start or the provider first rendered).
|
|
6
6
|
* • ON FOREGROUND after a real background — when AppState returns to `active` having been
|
|
7
7
|
* backgrounded for at least {@link BACKGROUND_SESSION_MS} (30 min), that's a NEW open, so a
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Each firing mints its OWN per-open `session_id` (held in a ref so a re-render never re-fires),
|
|
11
11
|
* so grouping over time is by `deviceKey`/`userId`, never by session_id (see reportSessionStart).
|
|
12
12
|
*
|
|
13
|
-
* The hook is OPTIONAL. A host that already owns a session counter (
|
|
13
|
+
* The hook is OPTIONAL. A host that already owns a session counter (most hosts do) can skip
|
|
14
14
|
* the hook and call `reportSessionStart(...)` directly from its own "app opened" path — BOTH
|
|
15
15
|
* paths are first-class. This hook is the batteries-included option for a host that has none.
|
|
16
16
|
*
|
|
@@ -135,7 +135,7 @@ const _FeatureShowcase: React.FC<FeatureShowcaseProps> = ({
|
|
|
135
135
|
// Calm the large image/hero panel. The package's `background.primary` is a
|
|
136
136
|
// SINGLE key that fills the primary button, the intro highlight AND this hero
|
|
137
137
|
// panel — painting it `accent` (correct for the button) also flooded the first
|
|
138
|
-
// slide with the app color (
|
|
138
|
+
// slide with the app color (0.3.1). The package exposes a
|
|
139
139
|
// `background` render prop that REPLACES that panel fill outright, so we keep
|
|
140
140
|
// the button accent (via `colors`) and paint the panel a calm surface + faint
|
|
141
141
|
// accent tint here. See showcasePanelBackground.
|
|
@@ -63,7 +63,7 @@ export const showcaseColorsFromTheme = (
|
|
|
63
63
|
* Opacity of the accent tint layered over the theme surface for the showcase's
|
|
64
64
|
* image hero panel. Kept in a calm 8–12% band so the panel reads as a subtle
|
|
65
65
|
* brand wash — a hint of the accent, never the full-bleed flood that `accent`
|
|
66
|
-
* as a solid fill produced (the 0.3.1 → 0.3.2 bug
|
|
66
|
+
* as a solid fill produced (the 0.3.1 → 0.3.2 bug seen in a host app).
|
|
67
67
|
*/
|
|
68
68
|
export const SHOWCASE_PANEL_TINT_OPACITY = 0.1;
|
|
69
69
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mergeThemeOver — merge a partial theme over an ARBITRARY base theme.
|
|
3
|
+
*
|
|
4
|
+
* Sibling of `mergeTheme` (defaultTheme.ts), which merges over the DEFAULT theme only.
|
|
5
|
+
* Gates need the other shape: a `theme` prop merged over whatever the host's active
|
|
6
|
+
* ThemeContext currently is. That helper was copy-pasted verbatim into ReviewGate and
|
|
7
|
+
* QuestionnaireGate; it lives here once instead, so a new theme section can never be
|
|
8
|
+
* added to one gate and forgotten in the other.
|
|
9
|
+
*
|
|
10
|
+
* Two levels deep, matching `mergeTheme`: the theme is intentionally shallow, so each
|
|
11
|
+
* known sub-object is merged and scalars overwrite.
|
|
12
|
+
*/
|
|
13
|
+
import type { OnboardingTheme } from "./types";
|
|
14
|
+
|
|
15
|
+
export const mergeThemeOver = (
|
|
16
|
+
base: OnboardingTheme,
|
|
17
|
+
override?: Partial<OnboardingTheme>,
|
|
18
|
+
): OnboardingTheme => {
|
|
19
|
+
if (!override) return base;
|
|
20
|
+
return {
|
|
21
|
+
colors: { ...base.colors, ...override.colors },
|
|
22
|
+
fonts: { ...base.fonts, ...override.fonts },
|
|
23
|
+
radius: { ...base.radius, ...override.radius },
|
|
24
|
+
spacing: { ...base.spacing, ...override.spacing },
|
|
25
|
+
button: { ...base.button, ...override.button },
|
|
26
|
+
};
|
|
27
|
+
};
|
package/src/types.ts
CHANGED
|
@@ -108,6 +108,14 @@ export type WireOnboardingProps = {
|
|
|
108
108
|
* via `illustration`; the kit slots the matching node (keeping itself dependency-free).
|
|
109
109
|
*/
|
|
110
110
|
illustrations?: Record<string, import("react").ReactNode>;
|
|
111
|
+
/**
|
|
112
|
+
* App-supplied ICON nodes, keyed by the semantic vocabulary name the AI emits (e.g.
|
|
113
|
+
* `{ instagram: <BrandIg/> }`). Checked FIRST, so a host can override any icon with its own
|
|
114
|
+
* brand mark, supply icons without installing `@expo/vector-icons`, or extend the vocabulary
|
|
115
|
+
* with names of its own. Anything not listed falls back to `@expo/vector-icons` when that
|
|
116
|
+
* optional peer is present, and to no icon at all when it isn't — never a crash.
|
|
117
|
+
*/
|
|
118
|
+
icons?: Record<string, import("react").ReactNode>;
|
|
111
119
|
/** Per-step validators keyed by base-question key, e.g. `{ username: checkUsername }`. */
|
|
112
120
|
validators?: Record<string, StepValidator>;
|
|
113
121
|
/** Fired once the flow reaches its terminal StatusCard. */
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { j as ReviewTarget, i as ReviewSubmission } from './types-A6pTxIZV.mjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* transport.ts — kit → Wire server requests for the review module, all fire-and-forget
|
|
5
|
-
* (analytics/reviews must never break the app). Mirrors analytics/reportClientEvent: a
|
|
6
|
-
* thin fetch wrapper, Bearer tenant key, swallow every error.
|
|
7
|
-
*
|
|
8
|
-
* • submitReview → POST {serverUrl}/v1/reviews (the 1-4 feedback body)
|
|
9
|
-
* • reportAppEvent → POST {serverUrl}/v1/events (generic app.* namespace)
|
|
10
|
-
*
|
|
11
|
-
* `reportAppEvent` is the strategic extension: it lets a host report arbitrary in-app
|
|
12
|
-
* events through the SAME transport (stored server-side as event_type='app_event',
|
|
13
|
-
* question_key=<name>), which is what the backend review-firing rules evaluate on — and
|
|
14
|
-
* it seeds the broader app-analytics stream. Keep payloads minimal + non-PII.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* POST a review (the 1-4 feedback path). Fire-and-forget: a missing target, a build error,
|
|
19
|
-
* a missing `fetch`, or a network failure is swallowed and the call returns immediately.
|
|
20
|
-
*/
|
|
21
|
-
declare const submitReview: (target: ReviewTarget | undefined, review: ReviewSubmission) => void;
|
|
22
|
-
/** Options for a reported app event. `deviceKey` groups a device's sessions server-side. */
|
|
23
|
-
interface ReportAppEventOptions {
|
|
24
|
-
/** The onboarding/session id to correlate with, when known. */
|
|
25
|
-
sessionId?: string;
|
|
26
|
-
/** A stable, non-PII device id — the review-decision endpoint reads it for min-sessions. */
|
|
27
|
-
deviceKey?: string;
|
|
28
|
-
/** Small non-PII extras. */
|
|
29
|
-
meta?: Record<string, unknown>;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Report a generic in-app event through the existing events transport. Stored server-side
|
|
33
|
-
* as `event_type='app_event'`, `question_key=<name>`. Fire-and-forget. Keep `name` a short
|
|
34
|
-
* stable identifier and `meta` small + non-PII.
|
|
35
|
-
*
|
|
36
|
-
* reportAppEvent(target, "content_share", { sessionId, deviceKey });
|
|
37
|
-
*/
|
|
38
|
-
declare const reportAppEvent: (target: ReviewTarget | undefined, name: string, options?: ReportAppEventOptions) => void;
|
|
39
|
-
|
|
40
|
-
export { type ReportAppEventOptions as R, reportAppEvent as r, submitReview as s };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { j as ReviewTarget, i as ReviewSubmission } from './types-BhpXJGlg.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* transport.ts — kit → Wire server requests for the review module, all fire-and-forget
|
|
5
|
-
* (analytics/reviews must never break the app). Mirrors analytics/reportClientEvent: a
|
|
6
|
-
* thin fetch wrapper, Bearer tenant key, swallow every error.
|
|
7
|
-
*
|
|
8
|
-
* • submitReview → POST {serverUrl}/v1/reviews (the 1-4 feedback body)
|
|
9
|
-
* • reportAppEvent → POST {serverUrl}/v1/events (generic app.* namespace)
|
|
10
|
-
*
|
|
11
|
-
* `reportAppEvent` is the strategic extension: it lets a host report arbitrary in-app
|
|
12
|
-
* events through the SAME transport (stored server-side as event_type='app_event',
|
|
13
|
-
* question_key=<name>), which is what the backend review-firing rules evaluate on — and
|
|
14
|
-
* it seeds the broader app-analytics stream. Keep payloads minimal + non-PII.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* POST a review (the 1-4 feedback path). Fire-and-forget: a missing target, a build error,
|
|
19
|
-
* a missing `fetch`, or a network failure is swallowed and the call returns immediately.
|
|
20
|
-
*/
|
|
21
|
-
declare const submitReview: (target: ReviewTarget | undefined, review: ReviewSubmission) => void;
|
|
22
|
-
/** Options for a reported app event. `deviceKey` groups a device's sessions server-side. */
|
|
23
|
-
interface ReportAppEventOptions {
|
|
24
|
-
/** The onboarding/session id to correlate with, when known. */
|
|
25
|
-
sessionId?: string;
|
|
26
|
-
/** A stable, non-PII device id — the review-decision endpoint reads it for min-sessions. */
|
|
27
|
-
deviceKey?: string;
|
|
28
|
-
/** Small non-PII extras. */
|
|
29
|
-
meta?: Record<string, unknown>;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Report a generic in-app event through the existing events transport. Stored server-side
|
|
33
|
-
* as `event_type='app_event'`, `question_key=<name>`. Fire-and-forget. Keep `name` a short
|
|
34
|
-
* stable identifier and `meta` small + non-PII.
|
|
35
|
-
*
|
|
36
|
-
* reportAppEvent(target, "content_share", { sessionId, deviceKey });
|
|
37
|
-
*/
|
|
38
|
-
declare const reportAppEvent: (target: ReviewTarget | undefined, name: string, options?: ReportAppEventOptions) => void;
|
|
39
|
-
|
|
40
|
-
export { type ReportAppEventOptions as R, reportAppEvent as r, submitReview as s };
|