@encorekit/web-sdk 1.1.19 → 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/README.md +63 -3
- 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/embed/README.md +1 -1
- package/examples/angular/src/app/app.component.ts +0 -1
- package/examples/angular/src/app/encore.service.ts +1 -2
- package/examples/ios-webview/EncoreWebViewBridge.swift +3 -10
- package/examples/ios-webview/README.md +0 -20
- package/examples/react/.env +1 -0
- package/examples/react/src/App.tsx +1 -1
- package/examples/svelte/src/App.svelte +0 -2
- package/examples/vanilla-js/index.html +0 -2
- package/examples/vue/src/App.vue +0 -2
- package/package.json +10 -8
- package/types/analytics/AnalyticsClient.d.ts +11 -3
- package/types/analytics/AnalyticsClient.d.ts.map +1 -1
- package/types/analytics/events.d.ts +30 -1
- package/types/analytics/events.d.ts.map +1 -1
- package/types/analytics/models.d.ts +11 -8
- package/types/analytics/models.d.ts.map +1 -1
- package/types/analytics/transport.d.ts +23 -0
- package/types/analytics/transport.d.ts.map +1 -0
- package/types/api/APIClient.d.ts +1 -1
- package/types/api/APIClient.d.ts.map +1 -1
- package/types/api/contract.d.ts +32 -0
- package/types/api/contract.d.ts.map +1 -0
- package/types/api/generated/types.d.ts +4519 -0
- package/types/api/generated/types.d.ts.map +1 -0
- package/types/api/models.d.ts +45 -128
- package/types/api/models.d.ts.map +1 -1
- package/types/core/Configuration.d.ts +2 -2
- package/types/core/Configuration.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 +77 -4
- package/types/core/Encore.d.ts.map +1 -1
- package/types/core/PlacementBuilder.d.ts +14 -9
- package/types/core/PlacementBuilder.d.ts.map +1 -1
- package/types/core/TransactionStore.d.ts +35 -0
- package/types/core/TransactionStore.d.ts.map +1 -0
- package/types/core/version.d.ts +1 -1
- package/types/experiments/ExperimentManager.d.ts +43 -0
- package/types/experiments/ExperimentManager.d.ts.map +1 -0
- package/types/experiments/ExposureOutbox.d.ts +37 -0
- package/types/experiments/ExposureOutbox.d.ts.map +1 -0
- package/types/experiments/bucketing.d.ts +33 -0
- package/types/experiments/bucketing.d.ts.map +1 -0
- package/types/experiments/types.d.ts +60 -0
- package/types/experiments/types.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/react.d.ts +1 -3
- package/types/react.d.ts.map +1 -1
- package/types/types.d.ts +284 -18
- package/types/types.d.ts.map +1 -1
- package/types/ui/OfferCard.d.ts.map +1 -1
- package/types/ui/OfferCarousel.d.ts +14 -3
- package/types/ui/OfferCarousel.d.ts.map +1 -1
- package/types/ui/OfferModal.d.ts +6 -0
- package/types/ui/OfferModal.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 +57 -0
- package/types/ui/RedemptionScreen.d.ts.map +1 -0
- package/types/ui/ThankYouLayout.d.ts +35 -0
- package/types/ui/ThankYouLayout.d.ts.map +1 -0
- 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
- package/examples/react/.env.local +0 -1
- package/types/__tests__/PlacementBuilder.test.d.ts +0 -2
- package/types/__tests__/PlacementBuilder.test.d.ts.map +0 -1
- package/types/__tests__/SuccessScreen.test.d.ts +0 -2
- package/types/__tests__/SuccessScreen.test.d.ts.map +0 -1
- package/types/__tests__/react.test.d.ts +0 -2
- package/types/__tests__/react.test.d.ts.map +0 -1
- package/types/__tests__/styles.test.d.ts +0 -2
- package/types/__tests__/styles.test.d.ts.map +0 -1
- package/types/ui/SuccessScreen.d.ts +0 -35
- package/types/ui/SuccessScreen.d.ts.map +0 -1
package/types/types.d.ts
CHANGED
|
@@ -71,6 +71,18 @@ export type NotGrantedReason = 'userClosedModal' | 'userClickedOutside' | 'userD
|
|
|
71
71
|
*/
|
|
72
72
|
export interface PresentationResult {
|
|
73
73
|
granted: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Human-readable reward text for display only (e.g. "3 months of Ahead free"),
|
|
76
|
+
* derived from the campaign's UI copy. NEVER use this for access control —
|
|
77
|
+
* entitlements are server-authoritative (verify on your backend).
|
|
78
|
+
*/
|
|
79
|
+
reward?: string;
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated Web entitlements are server-authoritative. Verify access on your backend via
|
|
82
|
+
* Encore's server-side entitlements API (`/entitlements/server`, HMAC-signed) — not from the
|
|
83
|
+
* client. This field is no longer populated from a trusted source and will be removed in the
|
|
84
|
+
* next major version. For display, use `reward`.
|
|
85
|
+
*/
|
|
74
86
|
entitlement?: EntitlementType;
|
|
75
87
|
reason?: NotGrantedReason;
|
|
76
88
|
}
|
|
@@ -83,29 +95,142 @@ export interface AppearanceConfig {
|
|
|
83
95
|
accentColor?: string;
|
|
84
96
|
}
|
|
85
97
|
/**
|
|
86
|
-
*
|
|
98
|
+
* `'thankYou'`-only priming copy shown ABOVE the offers — the lead-in pair between
|
|
99
|
+
* the payment status and the carousel, context for why offers are being shown (never
|
|
100
|
+
* any one offer's own copy). Ignored by the `'list'` layout, whose top heading is
|
|
101
|
+
* `header` instead: one name means one thing in every layout.
|
|
87
102
|
*/
|
|
88
|
-
export interface
|
|
103
|
+
export interface OfferContextConfig {
|
|
89
104
|
title?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Context subtitle. When the active offer's campaign carries a `perk` line (e.g.
|
|
107
|
+
* "Enjoy 30 days of Apple Music free") the perk takes this slot and follows the
|
|
108
|
+
* carousel as it pages; this value is the per-placement fallback.
|
|
109
|
+
*/
|
|
90
110
|
subtitle?: string;
|
|
91
111
|
}
|
|
92
|
-
|
|
112
|
+
/**
|
|
113
|
+
* Layout template for a placement presentation.
|
|
114
|
+
* - `'list'` (default): today's offer sheet — header copy + offer carousel.
|
|
115
|
+
* - `'thankYou'`: post-purchase success composition — status check + payment-status
|
|
116
|
+
* header + intro copy + carousel + optional trust footer.
|
|
117
|
+
*/
|
|
118
|
+
export type PlacementLayout = 'list' | 'thankYou';
|
|
119
|
+
/**
|
|
120
|
+
* The sheet's top heading block — in EVERY layout. In `'list'` it is the modal
|
|
121
|
+
* title/subtitle above the offers (local override of the remote copy); in
|
|
122
|
+
* `'thankYou'` it is the payment-status block (check + title + subtitle). The host
|
|
123
|
+
* supplies the copy — the SDK never invents payment facts.
|
|
124
|
+
*/
|
|
125
|
+
export interface PlacementHeaderConfig {
|
|
126
|
+
/**
|
|
127
|
+
* Status icon (`'thankYou'` only). `'success'` (default) renders a green-circle
|
|
128
|
+
* check; `'none'` hides it. Ignored by `'list'`.
|
|
129
|
+
*/
|
|
130
|
+
icon?: 'success' | 'none';
|
|
131
|
+
/**
|
|
132
|
+
* Heading title. In `'list'` the sheet title (falls back to remote copy when
|
|
133
|
+
* omitted); in `'thankYou'` the status title, e.g. "Payment Successful"
|
|
134
|
+
* (omitted → not rendered).
|
|
135
|
+
*/
|
|
93
136
|
title?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Heading subtitle (a plain constant string). In `'list'` the sheet subtitle; in
|
|
139
|
+
* `'thankYou'` the muted status line, where a `receipt` passed to `show()` takes
|
|
140
|
+
* precedence over this slot.
|
|
141
|
+
*/
|
|
94
142
|
subtitle?: string;
|
|
95
|
-
buttonText?: string;
|
|
96
|
-
typeText?: string;
|
|
97
|
-
amountText?: string;
|
|
98
143
|
}
|
|
99
|
-
|
|
144
|
+
/** Trust footer for the `'thankYou'` layout. Omitted → not rendered. */
|
|
145
|
+
export interface PlacementFooterConfig {
|
|
146
|
+
/** Small muted centered line, e.g. "🔒 Secured by Acme". */
|
|
147
|
+
text?: string;
|
|
148
|
+
}
|
|
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 {
|
|
100
174
|
appearance?: AppearanceConfig;
|
|
101
|
-
|
|
102
|
-
|
|
175
|
+
/** Top heading block: modal title in `'list'`, payment status in `'thankYou'`. */
|
|
176
|
+
header?: PlacementHeaderConfig;
|
|
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. */
|
|
198
|
+
footer?: PlacementFooterConfig;
|
|
199
|
+
}
|
|
200
|
+
export type PlacementOptions = ListPlacementOptions | ThankYouPlacementOptions;
|
|
201
|
+
/**
|
|
202
|
+
* Per-transaction receipt details for the `'thankYou'` layout. Rendered by the SDK as
|
|
203
|
+
* "You paid {amount} for {purpose}" (or "You paid {amount}" without a purpose) in the
|
|
204
|
+
* payment-status subtitle slot. Values are rendered verbatim as text — pre-format the
|
|
205
|
+
* currency on your side.
|
|
206
|
+
*/
|
|
207
|
+
export interface Receipt {
|
|
208
|
+
/** Pre-formatted amount, e.g. "NGN 100". */
|
|
209
|
+
amount: string;
|
|
210
|
+
/** What was paid for, e.g. "Demo". */
|
|
211
|
+
purpose?: string;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Per-call options for show().
|
|
215
|
+
*/
|
|
216
|
+
export interface ShowOptions {
|
|
217
|
+
/**
|
|
218
|
+
* Per-transaction receipt for the `'thankYou'` layout. When provided it owns the
|
|
219
|
+
* payment-status subtitle (overriding `header.subtitle`). Ignored by `'list'`.
|
|
220
|
+
*/
|
|
221
|
+
receipt?: Receipt;
|
|
103
222
|
}
|
|
104
223
|
/**
|
|
105
|
-
*
|
|
224
|
+
* Presentation callbacks and show-time options
|
|
106
225
|
*/
|
|
107
|
-
export interface PresentationOptions {
|
|
108
|
-
|
|
226
|
+
export interface PresentationOptions extends ShowOptions {
|
|
227
|
+
/**
|
|
228
|
+
* Fires when the user completes the offer flow (provisional grant). The argument is the
|
|
229
|
+
* deprecated, display-derived entitlement and may be `undefined`.
|
|
230
|
+
* @deprecated The structured `entitlement` argument is no longer trustworthy. Read
|
|
231
|
+
* `PresentationResult.reward` for display, and verify real access server-side. Removed next major.
|
|
232
|
+
*/
|
|
233
|
+
onGranted?: (entitlement?: EntitlementType) => void;
|
|
109
234
|
onNotGranted?: (reason: NotGrantedReason) => void;
|
|
110
235
|
onError?: (error: EncoreError) => void;
|
|
111
236
|
}
|
|
@@ -113,10 +238,13 @@ export interface PresentationOptions {
|
|
|
113
238
|
* Builder pattern for placement API
|
|
114
239
|
*/
|
|
115
240
|
export interface PlacementBuilder {
|
|
116
|
-
|
|
241
|
+
/** Fires when the sheet closes without a claim — carries the dismissal reason. */
|
|
117
242
|
onNotGranted(callback: (reason: NotGrantedReason) => void): PlacementBuilder;
|
|
118
243
|
onLoadingStateChange(callback: (isLoading: boolean) => void): PlacementBuilder;
|
|
119
|
-
show()
|
|
244
|
+
/** Same bare ShowResult contract as Encore.show(). Never rejects. */
|
|
245
|
+
show(options?: ShowOptions): Promise<ShowResult>;
|
|
246
|
+
/** Redeem the transaction made at this placement — phase 2 of the two-phase flow. */
|
|
247
|
+
redeem(): Promise<RedeemResult>;
|
|
120
248
|
}
|
|
121
249
|
/**
|
|
122
250
|
* Error codes used throughout the SDK
|
|
@@ -148,7 +276,9 @@ export interface EncoreError {
|
|
|
148
276
|
*/
|
|
149
277
|
export type VerificationStatus = 'pending' | 'verified' | 'failed' | 'timeout' | 'cancelled';
|
|
150
278
|
/**
|
|
151
|
-
* UI
|
|
279
|
+
* Presentation copy slots consumed by the offer UI. Populated from the remote
|
|
280
|
+
* /config payload and overridden per-call via placement options — NOT part of
|
|
281
|
+
* EncoreConfig (configure() is connection/behavior settings only).
|
|
152
282
|
*/
|
|
153
283
|
export interface UIConfiguration {
|
|
154
284
|
titleText?: string;
|
|
@@ -162,17 +292,153 @@ export interface UIConfiguration {
|
|
|
162
292
|
creditClaimedTitleText?: string;
|
|
163
293
|
creditClaimedSubtitleText?: string;
|
|
164
294
|
applyCreditsButtonText?: string;
|
|
295
|
+
/** App name for reward template substitution (e.g. "Tinder Plus"). Display only. */
|
|
296
|
+
appName?: string;
|
|
297
|
+
/** Reward value for template substitution (e.g. "3"). Display only — not an entitlement. */
|
|
298
|
+
entitlementValue?: string;
|
|
299
|
+
/** Reward unit for template substitution (e.g. "months"). Display only — not an entitlement. */
|
|
300
|
+
entitlementUnit?: string;
|
|
165
301
|
}
|
|
166
302
|
/**
|
|
167
303
|
* Main SDK configuration options
|
|
168
304
|
*/
|
|
169
305
|
export interface EncoreConfig {
|
|
170
306
|
apiKey: string;
|
|
171
|
-
userId?: string | undefined;
|
|
172
|
-
baseURL?: string;
|
|
173
307
|
environment?: 'production' | 'development' | 'staging' | 'localhost';
|
|
174
308
|
logLevel?: 'none' | 'debug';
|
|
175
|
-
|
|
309
|
+
/**
|
|
310
|
+
* Redemption flow:
|
|
311
|
+
* - 'deferred' (default): show() resolves when the user CLAIMS an offer (a transaction
|
|
312
|
+
* record is created, NO redirect). The host runs its own conversion, then calls
|
|
313
|
+
* redeem() to render the redemption screen + send the user to the advertiser.
|
|
314
|
+
* - 'immediate': the legacy one-step flow — claiming an offer redirects to the
|
|
315
|
+
* advertiser and shows the success screen inline (no separate redeem() call).
|
|
316
|
+
* This is a control-flow contract (it changes what host code must call), so it is
|
|
317
|
+
* a LOCAL config value, not remote.
|
|
318
|
+
*/
|
|
319
|
+
redemptionMode?: 'deferred' | 'immediate';
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Offer descriptor carried on a transaction — enough to render the redemption screen AND
|
|
323
|
+
* to rebuild the advertiser redirect at redeem() time (so the deferred flow never
|
|
324
|
+
* needs the live offer again). `advertiserUrl` may contain a TRANSACTION_ID
|
|
325
|
+
* placeholder, substituted with the transaction id when the redemption fires.
|
|
326
|
+
*/
|
|
327
|
+
export interface OfferRef {
|
|
328
|
+
id: string;
|
|
329
|
+
campaignId: string;
|
|
330
|
+
advertiserUrl: string;
|
|
331
|
+
trackingParameters?: Record<string, string>;
|
|
332
|
+
advertiserName?: string;
|
|
333
|
+
/** Display-only reward copy (e.g. "30 days of Apple Music"). NOT an entitlement. */
|
|
334
|
+
reward?: string;
|
|
335
|
+
imageUrl?: string;
|
|
336
|
+
logoUrl?: string;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* A claimed offer awaiting redemption. Claiming starts a transaction, and the
|
|
340
|
+
* returned `transactionId` is this transaction's durable handle (the same id used by
|
|
341
|
+
* `didGrant`, `waitForVerification`, and the backend).
|
|
342
|
+
*/
|
|
343
|
+
export interface Transaction {
|
|
344
|
+
id: string;
|
|
345
|
+
/** The persistent account identity this transaction is bound to (app_account_id). */
|
|
346
|
+
appAccountId: string;
|
|
347
|
+
/** The placement the offer was claimed at, if any (keys the local placement->transaction map). */
|
|
348
|
+
placementId?: string;
|
|
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;
|
|
358
|
+
status: 'claimed' | 'redeemed';
|
|
359
|
+
/** ISO-8601 timestamps. */
|
|
360
|
+
createdAt: string;
|
|
361
|
+
expiresAt: string;
|
|
362
|
+
redeemedAt?: string;
|
|
363
|
+
}
|
|
364
|
+
/** Result of `show()` / `present()`. */
|
|
365
|
+
export type ShowResult =
|
|
366
|
+
/**
|
|
367
|
+
* The user claimed an offer. A transaction was recorded SDK-side, and in
|
|
368
|
+
* 'immediate' mode the advertiser was also opened in a new tab; the SDK
|
|
369
|
+
* renders nothing after a claim — the host owns that moment. Deliberately
|
|
370
|
+
* NOT a conversion claim: advertiser conversion is asynchronous and
|
|
371
|
+
* server-authoritative; check it server-side by user (never from the client).
|
|
372
|
+
* In 'deferred' mode, call redeem() after your own conversion work — the SDK
|
|
373
|
+
* resolves the pending transaction internally; no handle needed.
|
|
374
|
+
*/
|
|
375
|
+
{
|
|
376
|
+
status: 'claimed';
|
|
377
|
+
}
|
|
378
|
+
/** The user dismissed the carousel without claiming. */
|
|
379
|
+
| {
|
|
380
|
+
status: 'dismissed';
|
|
381
|
+
reason?: NotGrantedReason;
|
|
382
|
+
}
|
|
383
|
+
/** No eligible offers (or a control-cohort ghost trigger). */
|
|
384
|
+
| {
|
|
385
|
+
status: 'unavailable';
|
|
386
|
+
};
|
|
387
|
+
/** Options for `redeem()`. */
|
|
388
|
+
export interface RedeemOptions {
|
|
389
|
+
/**
|
|
390
|
+
* Resolve the transaction made at this placement (the local placement->transaction map). When
|
|
391
|
+
* passed via Encore.placement(id).redeem() this is the placement id. If no transaction
|
|
392
|
+
* exists for the placement, resolves `none` — it never crosses to another placement.
|
|
393
|
+
*/
|
|
394
|
+
placement?: string;
|
|
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
|
+
*/
|
|
401
|
+
host?: {
|
|
402
|
+
name?: string;
|
|
403
|
+
status?: string;
|
|
404
|
+
logoUrl?: string;
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
/** Result of `redeem()`. */
|
|
408
|
+
export type RedeemResult =
|
|
409
|
+
/** The advertiser redirect was performed for the pending transaction. */
|
|
410
|
+
{
|
|
411
|
+
status: 'redeemed';
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* The sheet closed without redeeming. `reason` mirrors show(): user-driven
|
|
415
|
+
* closes carry no reason or a user reason; internal failures carry
|
|
416
|
+
* `{ type: 'error', error }` — redeem() never rejects. On an error the pending
|
|
417
|
+
* transaction is untouched, so calling redeem() again later is safe.
|
|
418
|
+
*/
|
|
419
|
+
| {
|
|
420
|
+
status: 'dismissed';
|
|
421
|
+
reason?: NotGrantedReason;
|
|
422
|
+
} | {
|
|
423
|
+
status: 'expired';
|
|
424
|
+
}
|
|
425
|
+
/** STRICTLY "no pending transaction to redeem" — never an error disguise. */
|
|
426
|
+
| {
|
|
427
|
+
status: 'none';
|
|
428
|
+
};
|
|
429
|
+
/**
|
|
430
|
+
* A subscription/conversion event forwarded from the host (Tier-1 client signal).
|
|
431
|
+
* NON-AUTHORITATIVE — posted via the pk-authed analytics channel, never the HMAC
|
|
432
|
+
* webhook. Use server-to-server webhooks (apple/google/revenuecat/superwall/encore)
|
|
433
|
+
* for authoritative revenue truth.
|
|
434
|
+
*/
|
|
435
|
+
export interface SubscriptionEvent {
|
|
436
|
+
type: 'did_subscribe' | 'did_renew' | 'did_cancel' | 'did_convert' | (string & {});
|
|
437
|
+
plan?: string;
|
|
438
|
+
price?: number;
|
|
439
|
+
currency?: string;
|
|
440
|
+
productId?: string;
|
|
441
|
+
[key: string]: unknown;
|
|
176
442
|
}
|
|
177
443
|
/**
|
|
178
444
|
* Event handler function type
|
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,IAAI,EA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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"}
|
|
@@ -4,6 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { OfferModel as Offer } from '../api/models';
|
|
6
6
|
import type { UIConfiguration } from '../types';
|
|
7
|
+
export interface OfferCarouselOptions {
|
|
8
|
+
/**
|
|
9
|
+
* 'responsive' (default): today's behavior — horizontal carousel on desktop, vertical
|
|
10
|
+
* full-screen list on mobile (viewport-derived).
|
|
11
|
+
* 'paged' (thankYou layout): always-horizontal, one-card-per-view, scroll-snap paged
|
|
12
|
+
* carousel at every breakpoint, with chevron nav bubbles.
|
|
13
|
+
*/
|
|
14
|
+
mode?: 'responsive' | 'paged';
|
|
15
|
+
}
|
|
7
16
|
interface CarouselEventMap extends Record<string, unknown> {
|
|
8
17
|
offerClaim: {
|
|
9
18
|
offer: Offer;
|
|
@@ -22,7 +31,7 @@ interface CarouselEventMap extends Record<string, unknown> {
|
|
|
22
31
|
}
|
|
23
32
|
export declare class OfferCarousel {
|
|
24
33
|
#private;
|
|
25
|
-
constructor(offers: Offer[], uiConfig?: UIConfiguration);
|
|
34
|
+
constructor(offers: Offer[], uiConfig?: UIConfiguration, options?: OfferCarouselOptions);
|
|
26
35
|
/**
|
|
27
36
|
* Render the carousel
|
|
28
37
|
*/
|
|
@@ -40,11 +49,13 @@ export declare class OfferCarousel {
|
|
|
40
49
|
*/
|
|
41
50
|
getTotalOffers(): number;
|
|
42
51
|
/**
|
|
43
|
-
* Navigate to next offer
|
|
52
|
+
* Navigate to next offer. A user INTENT: commits domain state immediately (so
|
|
53
|
+
* semantic UI updates once, and rapid clicks chain naturally), then runs the
|
|
54
|
+
* scroll as an effect. The highlight is not touched — it follows the motion.
|
|
44
55
|
*/
|
|
45
56
|
next(): void;
|
|
46
57
|
/**
|
|
47
|
-
* Navigate to previous offer
|
|
58
|
+
* Navigate to previous offer — see next().
|
|
48
59
|
*/
|
|
49
60
|
previous(): void;
|
|
50
61
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OfferCarousel.d.ts","sourceRoot":"","sources":["../../src/ui/OfferCarousel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAMhD,UAAU,gBAAiB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACxD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AgB,EACjC,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,IAAI,GAC9C,MAAM,IAAI;IAIb;;OAEG;IACH,eAAe,IAAI,MAAM;IAIzB;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;;;OAIG;IACH,IAAI,IAAI,IAAI;IAUZ;;OAEG;IACH,QAAQ,IAAI,IAAI;IA+YhB;;OAEG;IACH,OAAO,IAAI,IAAI;CAqBhB"}
|
package/types/ui/OfferModal.d.ts
CHANGED
|
@@ -24,6 +24,12 @@ export declare class OfferModal {
|
|
|
24
24
|
* Check if modal is currently visible
|
|
25
25
|
*/
|
|
26
26
|
isVisible(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Re-point the dialog's accessible name. Layout templates whose visually-primary
|
|
29
|
+
* heading is not the carousel title (thankYou) pass the id of their own heading so
|
|
30
|
+
* screen readers announce the dialog by what the user actually sees.
|
|
31
|
+
*/
|
|
32
|
+
setLabelledBy(id: string): void;
|
|
27
33
|
/**
|
|
28
34
|
* Set modal content
|
|
29
35
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OfferModal.d.ts","sourceRoot":"","sources":["../../src/ui/OfferModal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,UAAU,aAAc,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrD,KAAK,EAAE,IAAI,CAAC;IACZ,aAAa,EAAE,IAAI,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,qBAAa,UAAU;;gBAWT,KAAK,GAAE,cAAmB;IAOtC;;OAEG;IACH,IAAI,IAAI,IAAI;IAqCZ;;OAEG;IACH,IAAI,IAAI,IAAI;IAyBZ;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IActC;;OAEG;IACH,EAAE,CAAC,CAAC,SAAS,MAAM,aAAa,EAC9B,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,GAC3C,MAAM,IAAI;IA6Ib;;OAEG;IACH,OAAO,IAAI,IAAI;CAOhB"}
|
|
1
|
+
{"version":3,"file":"OfferModal.d.ts","sourceRoot":"","sources":["../../src/ui/OfferModal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,UAAU,aAAc,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrD,KAAK,EAAE,IAAI,CAAC;IACZ,aAAa,EAAE,IAAI,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,qBAAa,UAAU;;gBAWT,KAAK,GAAE,cAAmB;IAOtC;;OAEG;IACH,IAAI,IAAI,IAAI;IAqCZ;;OAEG;IACH,IAAI,IAAI,IAAI;IAyBZ;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAI/B;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IActC;;OAEG;IACH,EAAE,CAAC,CAAC,SAAS,MAAM,aAAa,EAC9B,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,GAC3C,MAAM,IAAI;IA6Ib;;OAEG;IACH,OAAO,IAAI,IAAI;CAOhB"}
|
|
@@ -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"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redemption Screen Component (S2 of the deferred flow)
|
|
3
|
+
*
|
|
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.
|
|
17
|
+
*/
|
|
18
|
+
type RedemptionVariant = 'activation' | 'reward';
|
|
19
|
+
interface RedemptionScreenConfig {
|
|
20
|
+
/** Which narrative to render. Defaults to 'reward' (the safe minimal story). */
|
|
21
|
+
variant?: RedemptionVariant;
|
|
22
|
+
/** Display reward copy, e.g. "30 days of free Apple Music". */
|
|
23
|
+
reward?: string;
|
|
24
|
+
/** Advertiser/partner name, e.g. "Apple Music". */
|
|
25
|
+
advertiserName?: string;
|
|
26
|
+
/** Partner logo (preferred) or a fallback image. */
|
|
27
|
+
logoUrl?: string;
|
|
28
|
+
imageUrl?: string;
|
|
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". */
|
|
43
|
+
buttonText?: string;
|
|
44
|
+
}
|
|
45
|
+
interface RedemptionScreenEventMap extends Record<string, unknown> {
|
|
46
|
+
/** The user tapped the claim CTA — caller fires the advertiser redirect. */
|
|
47
|
+
continue: undefined;
|
|
48
|
+
}
|
|
49
|
+
export declare class RedemptionScreen {
|
|
50
|
+
#private;
|
|
51
|
+
constructor(config: RedemptionScreenConfig);
|
|
52
|
+
render(): HTMLElement;
|
|
53
|
+
on<K extends keyof RedemptionScreenEventMap>(event: K, handler: (payload: RedemptionScreenEventMap[K]) => void): () => void;
|
|
54
|
+
destroy(): void;
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=RedemptionScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thank-You Layout — the 'thankYou' placement template.
|
|
3
|
+
*
|
|
4
|
+
* Pure chrome around the unchanged OfferCarousel: a payment-status block (success
|
|
5
|
+
* check + host-supplied title/subtitle) above, an optional trust footer below. A pure
|
|
6
|
+
* render function rather than a component class: the layout is static content with no
|
|
7
|
+
* events, no listeners, and no state — the carousel keeps its own lifecycle and is
|
|
8
|
+
* passed in as a ready element.
|
|
9
|
+
*/
|
|
10
|
+
import type { PlacementHeaderConfig, PlacementFooterConfig, PlacementLayout, Receipt } from '../types';
|
|
11
|
+
/**
|
|
12
|
+
* The id given to the thankYou status heading so the dialog's accessible name can
|
|
13
|
+
* point at the layout's real primary heading (the carousel title is demoted to intro
|
|
14
|
+
* copy in this layout).
|
|
15
|
+
*/
|
|
16
|
+
export declare const THANKYOU_TITLE_ID: string;
|
|
17
|
+
/**
|
|
18
|
+
* Tolerant-reader layout resolution. Never trust the TS union at runtime: plain-JS/UMD
|
|
19
|
+
* callers can pass anything, and a future server-driven selector may send a layout
|
|
20
|
+
* name this SDK version predates. Unknown values warn and fall back to 'list' so older
|
|
21
|
+
* shipped SDKs degrade gracefully.
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveLayout(value: unknown): PlacementLayout;
|
|
24
|
+
export interface ThankYouLayoutOptions {
|
|
25
|
+
header?: PlacementHeaderConfig;
|
|
26
|
+
footer?: PlacementFooterConfig;
|
|
27
|
+
/** Per-transaction receipt — owns the subtitle slot when provided. */
|
|
28
|
+
receipt?: Receipt;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Compose the thankYou sheet: status (check → title → subtitle) → carousel → footer.
|
|
32
|
+
* All host-supplied copy is set via textContent (text-only, injection-safe).
|
|
33
|
+
*/
|
|
34
|
+
export declare function renderThankYouLayout(carouselElement: HTMLElement, options?: ThankYouLayoutOptions): HTMLElement;
|
|
35
|
+
//# sourceMappingURL=ThankYouLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThankYouLayout.d.ts","sourceRoot":"","sources":["../../src/ui/ThankYouLayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,OAAO,EACR,MAAM,UAAU,CAAC;AAOlB;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAwB,CAAC;AAEvD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAO7D;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAqCD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,WAAW,EAC5B,OAAO,GAAE,qBAA0B,GAClC,WAAW,CAkDb"}
|
|
@@ -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"}
|