@encorekit/web-sdk 1.1.20 → 1.1.21
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/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/umd/encore.min.js +1 -1
- package/dist/umd/encore.min.js.map +1 -1
- package/examples/react/.env +1 -0
- package/package.json +1 -1
- package/types/analytics/events.d.ts +18 -0
- package/types/analytics/events.d.ts.map +1 -1
- package/types/api/generated/types.d.ts +20 -10
- package/types/api/generated/types.d.ts.map +1 -1
- package/types/core/DisplayResolver.d.ts +121 -0
- package/types/core/DisplayResolver.d.ts.map +1 -0
- package/types/core/Encore.d.ts.map +1 -1
- package/types/core/version.d.ts +1 -1
- package/types/types.d.ts +62 -8
- package/types/types.d.ts.map +1 -1
- package/types/ui/OfferCard.d.ts.map +1 -1
- package/types/ui/PrimerScreen.d.ts +34 -0
- package/types/ui/PrimerScreen.d.ts.map +1 -0
- package/types/ui/RedemptionScreen.d.ts +31 -7
- package/types/ui/RedemptionScreen.d.ts.map +1 -1
- package/types/ui/brandComponents.d.ts +45 -0
- package/types/ui/brandComponents.d.ts.map +1 -0
- package/types/ui/safeImageSrc.d.ts +15 -0
- package/types/ui/safeImageSrc.d.ts.map +1 -0
- package/types/ui/styles.d.ts.map +1 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Display resolution contract — the single precedence authority for the
|
|
3
|
+
* display-critical copy fields across layouts and redemption modes.
|
|
4
|
+
*
|
|
5
|
+
* Why runtime, not compile time: requiredness is resolution-relative (a null local
|
|
6
|
+
* field is legal when remote config fills it) and context-relative (the same field is
|
|
7
|
+
* required in one (layout, mode) and defaultable in another) — so the TypeScript
|
|
8
|
+
* types stay optional everywhere and this contract enforces per-call.
|
|
9
|
+
*
|
|
10
|
+
* Each row: field → (layout, mode) scope → source chain (defaults included). A
|
|
11
|
+
* `required` row that resolves nothing is an integration error, surfaced by the
|
|
12
|
+
* caller as a dismissed + CONFIGURATION_ERROR result — never a throw.
|
|
13
|
+
*
|
|
14
|
+
* The contract is precedence-only: URL scheme validation for logos lives at render
|
|
15
|
+
* time (ui/safeImageSrc), not here.
|
|
16
|
+
*/
|
|
17
|
+
import type { HostDisplay, PlacementHeaderConfig, PlacementLayout } from '../types';
|
|
18
|
+
/** Redemption mode as it affects display resolution. */
|
|
19
|
+
export type DisplayMode = 'deferred' | 'immediate';
|
|
20
|
+
/**
|
|
21
|
+
* Remote /config values the contract may read. All optional — the fetch may not have
|
|
22
|
+
* resolved (the caller distinguishes "config unreachable" from "config resolved but
|
|
23
|
+
* field absent"; this module only sees values).
|
|
24
|
+
*/
|
|
25
|
+
export interface RemoteDisplaySource {
|
|
26
|
+
appName?: string;
|
|
27
|
+
entitlementValue?: string;
|
|
28
|
+
entitlementUnit?: string;
|
|
29
|
+
/** The app icon served on /config `ui.values.media.appstoreIcon`. */
|
|
30
|
+
appIconUrl?: string;
|
|
31
|
+
/** Numeric trial length (`entitlements.native.durationDays`) — the composed
|
|
32
|
+
* trial-end detail's input. Never parsed from the display trialPeriod string. */
|
|
33
|
+
trialDurationDays?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface DisplayResolutionInput {
|
|
36
|
+
layout: PlacementLayout;
|
|
37
|
+
mode: DisplayMode;
|
|
38
|
+
header?: PlacementHeaderConfig;
|
|
39
|
+
display?: HostDisplay;
|
|
40
|
+
remote: RemoteDisplaySource;
|
|
41
|
+
}
|
|
42
|
+
/** The nouns resolved by the contract. Resolved fresh per call — at show() by the
|
|
43
|
+
* guard, and again at redeem() from the then-current sources (nothing persists on
|
|
44
|
+
* the Transaction; a transaction stores transactional facts only). */
|
|
45
|
+
export type ResolvedDisplay = HostDisplay;
|
|
46
|
+
/** Fields whose contract row is `required` (in deferred mode). */
|
|
47
|
+
export type RequiredDisplayField = 'appDisplayName' | 'trialPeriod' | 'logoUrl';
|
|
48
|
+
export type DisplayResolution = {
|
|
49
|
+
status: 'ok';
|
|
50
|
+
/** Resolved host nouns (may be partially empty in immediate mode — no required rows apply). */
|
|
51
|
+
display: ResolvedDisplay;
|
|
52
|
+
/**
|
|
53
|
+
* Resolved header strings for the requested (layout, mode). `undefined` means
|
|
54
|
+
* "defer to the pre-existing generic default" (list · immediate only).
|
|
55
|
+
*/
|
|
56
|
+
header: {
|
|
57
|
+
title?: string;
|
|
58
|
+
subtitle?: string;
|
|
59
|
+
};
|
|
60
|
+
} | {
|
|
61
|
+
status: 'missing';
|
|
62
|
+
missingFields: RequiredDisplayField[];
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* One row of the display contract. `when` scopes the row to a (layout, mode)
|
|
66
|
+
* context; `resolve` is the ordered source lookup with the row's default (if any)
|
|
67
|
+
* as its last link. Noun rows run before header rows — composed header defaults
|
|
68
|
+
* read the already-resolved nouns.
|
|
69
|
+
*/
|
|
70
|
+
export interface DisplayContractRow {
|
|
71
|
+
/** Human-readable context label, mirrored in the plan's contract table. */
|
|
72
|
+
context: string;
|
|
73
|
+
field: 'appDisplayName' | 'trialPeriod' | 'logoUrl' | 'header.title' | 'header.subtitle';
|
|
74
|
+
/** Declarative (layout, mode) scope — an absent key matches every value. */
|
|
75
|
+
when: {
|
|
76
|
+
layout?: PlacementLayout;
|
|
77
|
+
mode?: DisplayMode;
|
|
78
|
+
};
|
|
79
|
+
/** Unresolvable (`resolve` → undefined) is an integration error, not a default. */
|
|
80
|
+
required?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* The row's full source chain, defaults included. On a non-required row,
|
|
83
|
+
* undefined = "no value; defer to pre-existing behavior" (a valid default).
|
|
84
|
+
*/
|
|
85
|
+
resolve: (input: DisplayResolutionInput, nouns: ResolvedDisplay) => string | undefined;
|
|
86
|
+
}
|
|
87
|
+
/** Whether a contract row applies to the given (layout, mode) input. */
|
|
88
|
+
export declare const rowApplies: (row: DisplayContractRow, input: DisplayResolutionInput) => boolean;
|
|
89
|
+
/**
|
|
90
|
+
* THE contract table. Order matters: noun rows first (composed header defaults read
|
|
91
|
+
* the resolved nouns). Tests enumerate this table mechanically — every `required` row
|
|
92
|
+
* must error when unresolvable, every defaultable row must fill.
|
|
93
|
+
*/
|
|
94
|
+
export declare const DISPLAY_CONTRACT: readonly DisplayContractRow[];
|
|
95
|
+
/**
|
|
96
|
+
* The one copy-composer: every SDK-composed sentence built from the display nouns
|
|
97
|
+
* lives here — S1 header defaults, the primer screen, the redemption screen. Screens
|
|
98
|
+
* never concatenate the nouns themselves. The no-trial variants exist only as defense
|
|
99
|
+
* for legacy transaction snapshots that predate the display field.
|
|
100
|
+
*/
|
|
101
|
+
export declare const displayCopy: {
|
|
102
|
+
readonly s1Title: (app: string, trial: string) => string;
|
|
103
|
+
readonly s1Subtitle: () => string;
|
|
104
|
+
readonly primerTitle: (app: string, trial?: string) => string;
|
|
105
|
+
readonly primerSubtitle: (app: string) => string;
|
|
106
|
+
readonly primerCta: (app: string, trial?: string) => string;
|
|
107
|
+
readonly s2Title: (app: string, trial?: string) => string;
|
|
108
|
+
readonly s2Subtitle: (app: string) => string;
|
|
109
|
+
/** Host-row detail composed from the remote numeric trial length (durationDays)
|
|
110
|
+
* and the redemption moment — e.g. "Free until August 8, 2026". The app's
|
|
111
|
+
* redeem host.detail override wins when its real trial start differs. */
|
|
112
|
+
readonly s2HostDetail: (trialEnd: Date) => string;
|
|
113
|
+
readonly s2Cta: () => string;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Resolve the display contract for one show() call. Pure: reads only its input.
|
|
117
|
+
* Returns either the resolved nouns + header strings, or the list of required fields
|
|
118
|
+
* that resolved nothing (the caller surfaces that as an integration error).
|
|
119
|
+
*/
|
|
120
|
+
export declare function resolveDisplay(input: DisplayResolutionInput): DisplayResolution;
|
|
121
|
+
//# sourceMappingURL=DisplayResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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E,gBAAgB,GACxB;QACD,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,KAAK,WAAW,CAAC;KACnE;IAaD;;;;;;;;OAQG;IACH,SAAS,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,gBAAgB,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,iBAAiB;CA88BlG;AAGD,eAAO,MAAM,MAAM,WAAkB,CAAC"}
|
package/types/core/version.d.ts
CHANGED
package/types/types.d.ts
CHANGED
|
@@ -146,17 +146,58 @@ export interface PlacementFooterConfig {
|
|
|
146
146
|
/** Small muted centered line, e.g. "🔒 Secured by Acme". */
|
|
147
147
|
text?: string;
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Host-product display nouns for the deferred flow's SDK-composed copy (the S1
|
|
151
|
+
* header default, the primer screen, the redemption screen). Every field is optional
|
|
152
|
+
* in the TYPE because each resolves through a chain — local value, else remote
|
|
153
|
+
* /config (app name, native entitlement, app icon) — and requiredness is enforced at
|
|
154
|
+
* RUNTIME by the display contract (see core/DisplayResolver.ts). Display only;
|
|
155
|
+
* nothing here gates behavior.
|
|
156
|
+
*/
|
|
157
|
+
export interface HostDisplay {
|
|
158
|
+
/** Host product name, e.g. "PlanetVPN". Falls back to the remote app name. */
|
|
159
|
+
appDisplayName?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Display-only trial length, e.g. "1 month" — never parsed. Falls back to the
|
|
162
|
+
* remote native-entitlement value + unit.
|
|
163
|
+
*/
|
|
164
|
+
trialPeriod?: string;
|
|
165
|
+
/** Host logo URL (https). Falls back to the remote app icon when available. */
|
|
166
|
+
logoUrl?: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Options shared by every layout. Layout-specific options extend this — see
|
|
170
|
+
* ListPlacementOptions / ThankYouPlacementOptions; PlacementOptions is their union,
|
|
171
|
+
* discriminated on `layout`.
|
|
172
|
+
*/
|
|
173
|
+
export interface BasePlacementOptions {
|
|
150
174
|
appearance?: AppearanceConfig;
|
|
151
|
-
/** Priming pair above the offers — `'thankYou'` only; ignored by `'list'`. */
|
|
152
|
-
offerContext?: OfferContextConfig;
|
|
153
|
-
/** Layout template. Defaults to `'list'` (today's UI, unchanged). */
|
|
154
|
-
layout?: PlacementLayout;
|
|
155
175
|
/** Top heading block: modal title in `'list'`, payment status in `'thankYou'`. */
|
|
156
176
|
header?: PlacementHeaderConfig;
|
|
157
|
-
/**
|
|
177
|
+
/** Host display nouns — local override of the remote-config defaults. */
|
|
178
|
+
display?: HostDisplay;
|
|
179
|
+
/**
|
|
180
|
+
* Per-placement override of the configure() redemptionMode. Layout and mode are
|
|
181
|
+
* ORTHOGONAL axes: layout composes the UI; redemptionMode decides whether the
|
|
182
|
+
* claim redirects now ('immediate') or is decoupled from redemption ('deferred'
|
|
183
|
+
* — the host calls redeem() after its own conversion). Unusual combinations
|
|
184
|
+
* (e.g. 'thankYou' + 'deferred') are allowed and warned, not forbidden.
|
|
185
|
+
*/
|
|
186
|
+
redemptionMode?: 'deferred' | 'immediate';
|
|
187
|
+
}
|
|
188
|
+
/** The default offer sheet. */
|
|
189
|
+
export interface ListPlacementOptions extends BasePlacementOptions {
|
|
190
|
+
layout?: 'list';
|
|
191
|
+
}
|
|
192
|
+
/** The post-purchase success composition. */
|
|
193
|
+
export interface ThankYouPlacementOptions extends BasePlacementOptions {
|
|
194
|
+
layout: 'thankYou';
|
|
195
|
+
/** Priming pair above the offers. */
|
|
196
|
+
offerContext?: OfferContextConfig;
|
|
197
|
+
/** Trust footer. Omitted → not rendered. */
|
|
158
198
|
footer?: PlacementFooterConfig;
|
|
159
199
|
}
|
|
200
|
+
export type PlacementOptions = ListPlacementOptions | ThankYouPlacementOptions;
|
|
160
201
|
/**
|
|
161
202
|
* Per-transaction receipt details for the `'thankYou'` layout. Rendered by the SDK as
|
|
162
203
|
* "You paid {amount} for {purpose}" (or "You paid {amount}" without a purpose) in the
|
|
@@ -306,6 +347,14 @@ export interface Transaction {
|
|
|
306
347
|
/** The placement the offer was claimed at, if any (keys the local placement->transaction map). */
|
|
307
348
|
placementId?: string;
|
|
308
349
|
offer: OfferRef;
|
|
350
|
+
/**
|
|
351
|
+
* The layout of the placement the claim happened on — claim provenance (a
|
|
352
|
+
* transactional fact, like placementId). Drives which redemption narrative
|
|
353
|
+
* renders: a 'list' claim earns the activation story (host trial + ledger); a
|
|
354
|
+
* 'thankYou' claim renders the minimal reward story. Absent on legacy
|
|
355
|
+
* transactions → reward (the safe minimal narrative).
|
|
356
|
+
*/
|
|
357
|
+
claimLayout?: PlacementLayout;
|
|
309
358
|
status: 'claimed' | 'redeemed';
|
|
310
359
|
/** ISO-8601 timestamps. */
|
|
311
360
|
createdAt: string;
|
|
@@ -343,9 +392,14 @@ export interface RedeemOptions {
|
|
|
343
392
|
* exists for the placement, resolves `none` — it never crosses to another placement.
|
|
344
393
|
*/
|
|
345
394
|
placement?: string;
|
|
346
|
-
/**
|
|
395
|
+
/**
|
|
396
|
+
* Host product row for the redemption screen's deal ledger. Override-only: name
|
|
397
|
+
* and logo default from the same display resolution show() uses (live remote
|
|
398
|
+
* config), so most integrations never pass this. The trial-end detail line is
|
|
399
|
+
* always DERIVED (remote durationDays + the redemption moment) — not settable.
|
|
400
|
+
*/
|
|
347
401
|
host?: {
|
|
348
|
-
name
|
|
402
|
+
name?: string;
|
|
349
403
|
status?: string;
|
|
350
404
|
logoUrl?: string;
|
|
351
405
|
};
|
package/types/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,GAC/D;IAAE,I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E;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE;AACxB;;;;;GAKG;GACD;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAAE,GAClD;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE;AACvB,6EAA6E;GAC3E;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvB;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,eAAe,GAAG,WAAW,GAAG,YAAY,GAAG,aAAa,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACnF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAMD;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OfferCard.d.ts","sourceRoot":"","sources":["../../src/ui/OfferCard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"OfferCard.d.ts","sourceRoot":"","sources":["../../src/ui/OfferCard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;AAOpD,UAAU,iBAAkB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzD,KAAK,EAAE;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC;IACxB,OAAO,EAAE,IAAI,CAAC;CACf;AAED,qBAAa,SAAS;;;IAUpB;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,WAAW;IAkBjC;;OAEG;IACH,EAAE,CAAC,CAAC,SAAS,MAAM,iBAAiB,EAClC,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,IAAI,GAC/C,MAAM,IAAI;IAgKb;;OAEG;IACH,OAAO,IAAI,IAAI;CAUhB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Primer Screen Component (S1.5 of the deferred flow)
|
|
3
|
+
*
|
|
4
|
+
* Rendered into the open OfferModal immediately after a deferred-mode claim: the
|
|
5
|
+
* handoff moment that converts claim momentum into starting the host's own trial.
|
|
6
|
+
* Dual-brand lockup (partner + host), SDK-composed copy from the resolved display
|
|
7
|
+
* nouns, and a single forward CTA. show()'s promise settles on this screen's CTA
|
|
8
|
+
* or on any modal dismissal — both resolve 'claimed' (the claim is a fact either
|
|
9
|
+
* way); dismissal is the modal's own X-chrome, not a control here.
|
|
10
|
+
*/
|
|
11
|
+
import { type ResolvedDisplay } from '../core/DisplayResolver';
|
|
12
|
+
export interface PrimerScreenConfig {
|
|
13
|
+
/** Resolved host display nouns (guard-validated before Screen 1 rendered). */
|
|
14
|
+
display: ResolvedDisplay;
|
|
15
|
+
/** Partner branding from the just-claimed offer. */
|
|
16
|
+
partner: {
|
|
17
|
+
name?: string;
|
|
18
|
+
logoUrl?: string;
|
|
19
|
+
imageUrl?: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
interface PrimerScreenEventMap extends Record<string, unknown> {
|
|
23
|
+
/** The user tapped the forward CTA — caller settles 'claimed' and closes. */
|
|
24
|
+
continue: undefined;
|
|
25
|
+
}
|
|
26
|
+
export declare class PrimerScreen {
|
|
27
|
+
#private;
|
|
28
|
+
constructor(config: PrimerScreenConfig);
|
|
29
|
+
render(): HTMLElement;
|
|
30
|
+
on<K extends keyof PrimerScreenEventMap>(event: K, handler: (payload: PrimerScreenEventMap[K]) => void): () => void;
|
|
31
|
+
destroy(): void;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=PrimerScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrimerScreen.d.ts","sourceRoot":"","sources":["../../src/ui/PrimerScreen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG5E,MAAM,WAAW,kBAAkB;IACjC,8EAA8E;IAC9E,OAAO,EAAE,eAAe,CAAC;IACzB,oDAAoD;IACpD,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE;AAED,UAAU,oBAAqB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC5D,6EAA6E;IAC7E,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,qBAAa,YAAY;;gBAKX,MAAM,EAAE,kBAAkB;IAKtC,MAAM,IAAI,WAAW;IA+CrB,EAAE,CAAC,CAAC,SAAS,MAAM,oBAAoB,EACrC,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,IAAI,GAClD,MAAM,IAAI;IAIb,OAAO,IAAI,IAAI;CAQhB"}
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Redemption Screen Component
|
|
2
|
+
* Redemption Screen Component (S2 of the deferred flow)
|
|
3
3
|
*
|
|
4
|
-
* Phase 2
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Phase 2, shown by redeem(). The NARRATIVE is a function of the claim's
|
|
5
|
+
* originating surface (Transaction.claimLayout), expressed as a variant map of
|
|
6
|
+
* separate builders — extensible by adding an entry, never by threading more
|
|
7
|
+
* conditionals through one render path:
|
|
8
|
+
*
|
|
9
|
+
* - 'activation' (claims from the 'list' handoff flow): the host conversion just
|
|
10
|
+
* completed — dual-brand lockup, "your trial is active" copy, and the deal
|
|
11
|
+
* ledger (host row Active with the derived trial-end detail, partner Pending).
|
|
12
|
+
* - 'reward' (claims from 'thankYou' or unknown/legacy provenance): there was no
|
|
13
|
+
* host-unlock moment — minimal congratulations + the pending partner row.
|
|
14
|
+
*
|
|
15
|
+
* Both variants share the same chrome: reassurance note + one CTA ("Claim your
|
|
16
|
+
* reward") that sends the user to the advertiser inside the click gesture.
|
|
9
17
|
*/
|
|
18
|
+
type RedemptionVariant = 'activation' | 'reward';
|
|
10
19
|
interface RedemptionScreenConfig {
|
|
20
|
+
/** Which narrative to render. Defaults to 'reward' (the safe minimal story). */
|
|
21
|
+
variant?: RedemptionVariant;
|
|
11
22
|
/** Display reward copy, e.g. "30 days of free Apple Music". */
|
|
12
23
|
reward?: string;
|
|
13
24
|
/** Advertiser/partner name, e.g. "Apple Music". */
|
|
@@ -15,7 +26,20 @@ interface RedemptionScreenConfig {
|
|
|
15
26
|
/** Partner logo (preferred) or a fallback image. */
|
|
16
27
|
logoUrl?: string;
|
|
17
28
|
imageUrl?: string;
|
|
18
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Host product context — consumed by the 'activation' variant only (resolved
|
|
31
|
+
* from live remote config + the redeem() host override by the caller).
|
|
32
|
+
*/
|
|
33
|
+
host?: {
|
|
34
|
+
name?: string;
|
|
35
|
+
trialPeriod?: string;
|
|
36
|
+
/** Status chip text; defaults to "Active". */
|
|
37
|
+
status?: string;
|
|
38
|
+
/** Derived trial-end line, e.g. "Free until August 8, 2026". */
|
|
39
|
+
detail?: string;
|
|
40
|
+
logoUrl?: string;
|
|
41
|
+
};
|
|
42
|
+
/** Optional CTA override; default is exactly "Claim your reward". */
|
|
19
43
|
buttonText?: string;
|
|
20
44
|
}
|
|
21
45
|
interface RedemptionScreenEventMap extends Record<string, unknown> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedemptionScreen.d.ts","sourceRoot":"","sources":["../../src/ui/RedemptionScreen.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"RedemptionScreen.d.ts","sourceRoot":"","sources":["../../src/ui/RedemptionScreen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,KAAK,iBAAiB,GAAG,YAAY,GAAG,QAAQ,CAAC;AAEjD,UAAU,sBAAsB;IAC9B,gFAAgF;IAChF,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,8CAA8C;QAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,gEAAgE;QAChE,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,wBAAyB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAChE,4EAA4E;IAC5E,QAAQ,EAAE,SAAS,CAAC;CACrB;AAmED,qBAAa,gBAAgB;;gBAKf,MAAM,EAAE,sBAAsB;IAK1C,MAAM,IAAI,WAAW;IA+BrB,EAAE,CAAC,CAAC,SAAS,MAAM,wBAAwB,EACzC,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAC,CAAC,KAAK,IAAI,GACtD,MAAM,IAAI;IAIb,OAAO,IAAI,IAAI;CAQhB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared brand components for the deferred-flow screens.
|
|
3
|
+
*
|
|
4
|
+
* The dual-brand lockup (partner + host tiles) and the deal-ledger row are the
|
|
5
|
+
* continuity thread between the primer screen (S1.5) and the redemption screen
|
|
6
|
+
* (S2) — one implementation, consumed by both. Pure render functions in the
|
|
7
|
+
* ThankYouLayout style: no state, no events.
|
|
8
|
+
*
|
|
9
|
+
* Rendering hardening lives here once for every consumer:
|
|
10
|
+
* - URL scheme guard via safeImageSrc (reject → monogram tile)
|
|
11
|
+
* - monogram rendered IMMEDIATELY and swapped to the <img> only when it has
|
|
12
|
+
* loaded — a slow remote logo never shows an empty tile mid-animation
|
|
13
|
+
* - explicit dimensions + decoding="async", alt text on every logo
|
|
14
|
+
*/
|
|
15
|
+
export interface BrandRef {
|
|
16
|
+
name?: string;
|
|
17
|
+
logoUrl?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The dual-brand lockup: partner tile and host tile, gently overlapped —
|
|
21
|
+
* "two brands, one deal". Rendered at the top of the primer and redemption
|
|
22
|
+
* screens. Motion (the settle) is pure CSS and respects prefers-reduced-motion
|
|
23
|
+
* via the stylesheet's global override.
|
|
24
|
+
*/
|
|
25
|
+
export declare function renderDualBrandLockup(partner: BrandRef, host: BrandRef): HTMLElement;
|
|
26
|
+
export interface LedgerRowConfig {
|
|
27
|
+
brand: BrandRef;
|
|
28
|
+
/** Primary line, e.g. "PlanetVPN" or "Apple Music deal". */
|
|
29
|
+
name: string;
|
|
30
|
+
/** Secondary muted line, e.g. "Free until August 3, 2026" or the reward copy. */
|
|
31
|
+
detail?: string;
|
|
32
|
+
/** Status chip text + tone. Active renders in the success color. */
|
|
33
|
+
status: {
|
|
34
|
+
text: string;
|
|
35
|
+
tone: 'active' | 'pending';
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** The ledger container: rows stacked with hairline dividers. */
|
|
39
|
+
export declare function renderLedger(rows: LedgerRowConfig[]): HTMLElement;
|
|
40
|
+
/**
|
|
41
|
+
* The screens' single forward CTA: the clean pill button (encore-button-claim)
|
|
42
|
+
* made full-width by the given per-screen modifier class.
|
|
43
|
+
*/
|
|
44
|
+
export declare function renderCtaButton(text: string, modifierClass: string, onClick: () => void): HTMLButtonElement;
|
|
45
|
+
//# sourceMappingURL=brandComponents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brandComponents.d.ts","sourceRoot":"","sources":["../../src/ui/brandComponents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA8BD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,GAAG,WAAW,CAmBpF;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,QAAQ,CAAC;IAChB,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAA;KAAE,CAAC;CACtD;AAoCD,iEAAiE;AACjE,wBAAgB,YAAY,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,WAAW,CAKjE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,IAAI,GAClB,iBAAiB,CAOnB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scheme guard for every remote image the SDK renders (offer banners, merchant
|
|
3
|
+
* logos, the dual-brand lockup tiles). Display URLs arrive from remote config,
|
|
4
|
+
* placement options, and persisted transaction snapshots — none of which guarantee
|
|
5
|
+
* a validated URL. `<img src>` cannot execute script, but an arbitrary scheme still
|
|
6
|
+
* hurts: `http:` trips mixed-content on an https publisher page (broken render or
|
|
7
|
+
* CSP violation report), and any URL turns a render into an outbound GET beacon.
|
|
8
|
+
*
|
|
9
|
+
* Contract: https URLs pass through; http is tolerated for localhost/loopback only
|
|
10
|
+
* (local dev); everything else — including data:, blob:, javascript:, protocol-
|
|
11
|
+
* relative and unparseable strings — is rejected. Callers fall back to their
|
|
12
|
+
* placeholder (monogram tile / placeholder banner) on rejection.
|
|
13
|
+
*/
|
|
14
|
+
export declare function safeImageSrc(url: string | undefined): string | undefined;
|
|
15
|
+
//# sourceMappingURL=safeImageSrc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safeImageSrc.d.ts","sourceRoot":"","sources":["../../src/ui/safeImageSrc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAaxE"}
|
package/types/ui/styles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/ui/styles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,eAAO,MAAM,OAAO;;;CAGV,CAAC;AAGX,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/ui/styles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,eAAO,MAAM,OAAO;;;CAGV,CAAC;AAGX,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAi9CD;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,GAAE,cAAmB,GAAG,IAAI,CAgB7D;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAMnC;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAUvD;AAED;;GAEG;AACH,wBAAgB,EAAE,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAE/C;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE7C"}
|