@encorekit/web-sdk 2.0.2 → 2.0.4
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 +102 -4
- 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/package.json +2 -1
- package/types/analytics/DiagnosticsOutbox.d.ts +22 -0
- package/types/analytics/DiagnosticsOutbox.d.ts.map +1 -0
- package/types/analytics/ReliableOutbox.d.ts +40 -0
- package/types/analytics/ReliableOutbox.d.ts.map +1 -0
- package/types/analytics/events.d.ts +120 -3
- package/types/analytics/events.d.ts.map +1 -1
- package/types/analytics/placementResolved.d.ts +150 -0
- package/types/analytics/placementResolved.d.ts.map +1 -0
- package/types/api/APIClient.d.ts +7 -1
- package/types/api/APIClient.d.ts.map +1 -1
- package/types/api/generated/types.d.ts +6 -1
- package/types/api/generated/types.d.ts.map +1 -1
- package/types/core/Configuration.d.ts +5 -0
- package/types/core/Configuration.d.ts.map +1 -1
- package/types/core/Encore.d.ts +40 -1
- package/types/core/Encore.d.ts.map +1 -1
- package/types/core/OfferManager.d.ts +29 -3
- package/types/core/OfferManager.d.ts.map +1 -1
- package/types/core/PlacementBuilder.d.ts +12 -0
- package/types/core/PlacementBuilder.d.ts.map +1 -1
- package/types/core/StrictUnlock.d.ts +20 -0
- package/types/core/StrictUnlock.d.ts.map +1 -0
- package/types/core/StrictUnlockReconciler.d.ts +94 -0
- package/types/core/StrictUnlockReconciler.d.ts.map +1 -0
- package/types/core/useCase.d.ts +21 -0
- package/types/core/useCase.d.ts.map +1 -1
- package/types/core/version.d.ts +1 -1
- package/types/experiments/ExposureOutbox.d.ts +4 -28
- package/types/experiments/ExposureOutbox.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/types.d.ts +92 -3
- package/types/types.d.ts.map +1 -1
- package/types/ui/OfferCard.d.ts +3 -1
- package/types/ui/OfferCard.d.ts.map +1 -1
- package/types/ui/OfferCarousel.d.ts +13 -0
- package/types/ui/OfferCarousel.d.ts.map +1 -1
- package/types/ui/OfferModal.d.ts +25 -1
- package/types/ui/OfferModal.d.ts.map +1 -1
- package/types/ui/RewardActions.d.ts +24 -0
- package/types/ui/RewardActions.d.ts.map +1 -1
- package/types/ui/RewardLayout.d.ts +16 -0
- package/types/ui/RewardLayout.d.ts.map +1 -1
- package/types/ui/appearance.d.ts +168 -0
- package/types/ui/appearance.d.ts.map +1 -0
- package/types/ui/cssSafe.d.ts +34 -0
- package/types/ui/cssSafe.d.ts.map +1 -0
- package/types/ui/styles.d.ts +21 -1
- package/types/ui/styles.d.ts.map +1 -1
- package/types/utils/text.d.ts +14 -0
- package/types/utils/text.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OfferManager.d.ts","sourceRoot":"","sources":["../../src/core/OfferManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAMpE,qBAAa,YAAY;;
|
|
1
|
+
{"version":3,"file":"OfferManager.d.ts","sourceRoot":"","sources":["../../src/core/OfferManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,E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OAAO,CAAC,EAAE,OAAO,GAChB,IAAI;IAqBP;;OAEG;IACH,eAAe,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IA+FhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,qBAAqB,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAwCjE,kEAAkE;IAClE,OAAO,IAAI,IAAI;IAKf;;OAEG;IACG,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAsB9E;;OAEG;IACH,UAAU,IAAI,IAAI;IAMlB;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAKhC"}
|
|
@@ -12,6 +12,18 @@ export declare class PlacementBuilder implements IPlacementBuilder {
|
|
|
12
12
|
* the native SDKs expose, so a cross-platform integration reads the same here.
|
|
13
13
|
*/
|
|
14
14
|
useCase(useCase: UseCase): PlacementBuilder;
|
|
15
|
+
/**
|
|
16
|
+
* Override the sheet's headline for this presentation — the same
|
|
17
|
+
* `.headline(...)` step the native SDKs expose.
|
|
18
|
+
*
|
|
19
|
+
* Identical in effect to passing `headline` in {@link PlacementOptions}: the
|
|
20
|
+
* per-call override beats the backend-resolved copy, which beats the built-in
|
|
21
|
+
* fallback. A blank or whitespace-only value falls THROUGH to the resolved copy
|
|
22
|
+
* rather than blanking the sheet, so it can never erase shipped copy.
|
|
23
|
+
*/
|
|
24
|
+
headline(text: string): PlacementBuilder;
|
|
25
|
+
/** Counterpart to {@link headline}: same precedence, same blank-falls-through rule. */
|
|
26
|
+
subheadline(text: string): PlacementBuilder;
|
|
15
27
|
/**
|
|
16
28
|
* Set callback for when user declines or offer not granted
|
|
17
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlacementBuilder.d.ts","sourceRoot":"","sources":["../../src/core/PlacementBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,OAAO,EACR,MAAM,UAAU,CAAC;AAIlB,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;AAEvF,qBAAa,gBAAiB,YAAW,iBAAiB;;gBAO5C,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,gBAAgB;IAMlF;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB;IAK3C;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,GAAG,gBAAgB;IAK5E;;OAEG;IACH,oBAAoB,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,GAAG,gBAAgB;IAK9E;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;CA6ClC"}
|
|
1
|
+
{"version":3,"file":"PlacementBuilder.d.ts","sourceRoot":"","sources":["../../src/core/PlacementBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,OAAO,EACR,MAAM,UAAU,CAAC;AAIlB,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;AAEvF,qBAAa,gBAAiB,YAAW,iBAAiB;;gBAO5C,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,gBAAgB;IAMlF;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB;IAK3C;;;;;;;;OAQG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB;IAKxC,uFAAuF;IACvF,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB;IAK3C;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,GAAG,gBAAgB;IAK5E;;OAEG;IACH,oBAAoB,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,GAAG,gBAAgB;IAK9E;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;CA6ClC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strict-unlock mode constants.
|
|
3
|
+
*
|
|
4
|
+
* One source of truth so the verification poll window and the `maxPostbackTimeMs`
|
|
5
|
+
* offer filter cannot drift apart — the same reason iOS ties them together in
|
|
6
|
+
* `StrictUnlock.swift`: serving an offer whose postback SLA cannot plausibly land
|
|
7
|
+
* inside the window the poller is willing to wait guarantees a claim that never
|
|
8
|
+
* verifies in session.
|
|
9
|
+
*/
|
|
10
|
+
/** How long a verification poll waits before giving up. Mirrors iOS's 15s. */
|
|
11
|
+
export declare const POLL_TIMEOUT_MS = 15000;
|
|
12
|
+
/** Sent as `maxPostbackTimeMs` on `/offers/search` — strict mode only. */
|
|
13
|
+
export declare const MAX_POSTBACK_TIME_MS = 15000;
|
|
14
|
+
/**
|
|
15
|
+
* How long a pending claim is retried across sessions before it is dropped. Past
|
|
16
|
+
* this the campaign's postback window is long gone and the row will never verify.
|
|
17
|
+
* Mirrors iOS's `StrictUnlockReconciler.maxAge`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const RECONCILE_MAX_AGE_MS: number;
|
|
20
|
+
//# sourceMappingURL=StrictUnlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StrictUnlock.d.ts","sourceRoot":"","sources":["../../src/core/StrictUnlock.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,8EAA8E;AAC9E,eAAO,MAAM,eAAe,QAAS,CAAC;AAEtC,0EAA0E;AAC1E,eAAO,MAAM,oBAAoB,QAAkB,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,QAAuB,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strict Unlock Reconciler
|
|
3
|
+
*
|
|
4
|
+
* Owns the persistence and the poll primitive for a strict-mode claim awaiting
|
|
5
|
+
* advertiser verification. WHEN a pass runs (claim time, page load, foreground) is
|
|
6
|
+
* wired in Encore.ts — this class deliberately knows nothing about lifecycle, the
|
|
7
|
+
* same split iOS draws between `StrictUnlockReconciler` and its composition root.
|
|
8
|
+
*
|
|
9
|
+
* Persist-to-storage shape follows SignalManager's, applied to a single pending
|
|
10
|
+
* claim rather than a queue: only the MOST RECENT claim needs tracking, so a new
|
|
11
|
+
* notePending() simply overwrites — matching iOS, which keeps one pending id.
|
|
12
|
+
*/
|
|
13
|
+
import type { StorageManager } from './StorageManager';
|
|
14
|
+
import type { APIClient } from '../api/APIClient';
|
|
15
|
+
import type { UseCase, VerificationStatus } from '../types';
|
|
16
|
+
export interface PendingClaim {
|
|
17
|
+
transactionId: string;
|
|
18
|
+
/** ISO 8601. */
|
|
19
|
+
recordedAt: string;
|
|
20
|
+
/**
|
|
21
|
+
* Whether verifying this claim should send the entitlement grant signal. Stored
|
|
22
|
+
* rather than recomputed because the reconcile pass runs on a page load that has
|
|
23
|
+
* no offer, no placement and no use case in scope — the claim's own record is the
|
|
24
|
+
* only thing that still knows. Absent on a record written before this field
|
|
25
|
+
* existed, and read as false: a missing grant is recoverable, an unearned one is
|
|
26
|
+
* not.
|
|
27
|
+
*/
|
|
28
|
+
grantsEntitlement?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The placement and use case the claim was made under, persisted for the same
|
|
31
|
+
* reason `grantsEntitlement` is: the sheet that knew them is gone by the time a
|
|
32
|
+
* cross-session verification lands, and the claim's own record is the only thing
|
|
33
|
+
* that still does.
|
|
34
|
+
*
|
|
35
|
+
* Without them the reconciled `sdk_offer_verified` is the ONE conversion signal
|
|
36
|
+
* that cannot be sliced — strict-mode verifications would sit outside every
|
|
37
|
+
* per-use-case and per-placement conversion split, which is precisely the
|
|
38
|
+
* comparison strict mode exists to be measured by. Mirrors iOS, which persists
|
|
39
|
+
* both beside the transaction id (swift#123, `StrictUnlockReconciler.notePending`).
|
|
40
|
+
*
|
|
41
|
+
* Both optional and both absent on a record written before this field existed.
|
|
42
|
+
* Absent stays absent on the event rather than being reconstructed — a guessed
|
|
43
|
+
* dimension is worse than a missing one, because it looks like coverage.
|
|
44
|
+
*/
|
|
45
|
+
placementId?: string;
|
|
46
|
+
useCase?: UseCase;
|
|
47
|
+
}
|
|
48
|
+
export declare class StrictUnlockReconciler {
|
|
49
|
+
#private;
|
|
50
|
+
constructor(storage: StorageManager, apiClient: APIClient, userId: string);
|
|
51
|
+
/**
|
|
52
|
+
* Re-key onto a new identity, CARRYING the pending claim over.
|
|
53
|
+
*
|
|
54
|
+
* SignalManager, the sibling this class's persistence follows, drops its queue
|
|
55
|
+
* on the same event. This deliberately differs: identify() is an ALIAS on the
|
|
56
|
+
* backend (`identifyUser(previousUserId, userId)` — the anonymous id is merged
|
|
57
|
+
* into the real one, not replaced by a different person), so a claim made
|
|
58
|
+
* seconds earlier belongs to the very same user, and abandoning it would mean
|
|
59
|
+
* their unlock silently never lands. reset() is the destructive path, and it
|
|
60
|
+
* clears storage before this runs, so nothing carries over there.
|
|
61
|
+
*/
|
|
62
|
+
setUserId(userId: string): void;
|
|
63
|
+
/**
|
|
64
|
+
* Record a claim as awaiting verification. Called as soon as the transaction id
|
|
65
|
+
* exists and BEFORE the advertiser redirect opens, so a tab closed one moment
|
|
66
|
+
* later is still recoverable on a later page load.
|
|
67
|
+
*/
|
|
68
|
+
notePending(transactionId: string, options?: {
|
|
69
|
+
grantsEntitlement?: boolean;
|
|
70
|
+
placementId?: string;
|
|
71
|
+
useCase?: UseCase;
|
|
72
|
+
}): void;
|
|
73
|
+
/** Forget the pending claim — verified, dropped as stale, or malformed. */
|
|
74
|
+
clearPending(): void;
|
|
75
|
+
/**
|
|
76
|
+
* The pending claim, or null when there is none. A malformed record, an
|
|
77
|
+
* unusable id, or one older than {@link RECONCILE_MAX_AGE_MS} is DROPPED here
|
|
78
|
+
* rather than returned, so a bad record can never wedge the reconcile pass into
|
|
79
|
+
* re-reading it every foreground for a week.
|
|
80
|
+
*
|
|
81
|
+
* A `recordedAt` in the future is treated as unusable too: the clock it was
|
|
82
|
+
* written against is not the clock reading it (a device clock correction, a
|
|
83
|
+
* hand-edited value), and a negative age would otherwise never age out.
|
|
84
|
+
*/
|
|
85
|
+
getPending(): PendingClaim | null;
|
|
86
|
+
/**
|
|
87
|
+
* Poll for verification, bounded by `timeoutMs` — defaulting to the shared
|
|
88
|
+
* {@link POLL_TIMEOUT_MS} so a claim-time poll and a reconcile-pass poll wait the
|
|
89
|
+
* same window unless a caller has a reason to differ. Never throws: a network
|
|
90
|
+
* failure reads as 'pending', i.e. try again next foreground.
|
|
91
|
+
*/
|
|
92
|
+
verify(transactionId: string, timeoutMs?: number): Promise<VerificationStatus>;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=StrictUnlockReconciler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StrictUnlockReconciler.d.ts","sourceRoot":"","sources":["../../src/core/StrictUnlockReconciler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIlD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAa5D,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,sBAAsB;;gBAKrB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM;IAMzE;;;;;;;;;;OAUG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAQ/B;;;;OAIG;IACH,WAAW,CACT,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;QAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GACjF,IAAI;IAgBP,2EAA2E;IAC3E,YAAY,IAAI,IAAI;IAKpB;;;;;;;;;OASG;IACH,UAAU,IAAI,YAAY,GAAG,IAAI;IAsCjC;;;;;OAKG;IACG,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,GAAE,MAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAiBtG"}
|
package/types/core/useCase.d.ts
CHANGED
|
@@ -58,5 +58,26 @@ export declare function fromWireUseCase(wire: string | null | undefined): UseCas
|
|
|
58
58
|
* resolved from the config response's `useCases` map at show()-time and fails closed
|
|
59
59
|
* as `no_template`, not `INVALID_REQUEST`.
|
|
60
60
|
*/
|
|
61
|
+
/** Whether `value` is one of the recognised use cases. The allow-list, as a guard. */
|
|
62
|
+
export declare function isSupportedUseCase(value: unknown): value is UseCase;
|
|
63
|
+
/**
|
|
64
|
+
* The use case to REPORT for an attempt, given whatever the caller passed.
|
|
65
|
+
*
|
|
66
|
+
* `sdk_show_entered` is emitted at the very top of `show()`, above `checkUseCase`, so
|
|
67
|
+
* it is the one event that can see a value validation has not yet rejected. Its
|
|
68
|
+
* `use_case` feeds a closed cross-SDK enum dimension, and web must not be the SDK that
|
|
69
|
+
* widens it with a publisher's typo: a free-text value there does not error, it just
|
|
70
|
+
* creates a junk partition alongside the real ones in every per-use-case rollup.
|
|
71
|
+
*
|
|
72
|
+
* So an unrecognised value reports as the default, exactly as an omitted one does. The
|
|
73
|
+
* attempt is going to abort a few lines later either way, and the integration error is
|
|
74
|
+
* already reported through `onError`, the logger and `#reportError` — three channels
|
|
75
|
+
* that name the bad value, which the analytics dimension deliberately does not.
|
|
76
|
+
*
|
|
77
|
+
* Not a substitute for `checkUseCase`: this decides what to REPORT, that decides
|
|
78
|
+
* whether to PROCEED. Using this one to gate would silently serve the paywall for a
|
|
79
|
+
* typo, which is the exact fail-open `checkUseCase` exists to prevent.
|
|
80
|
+
*/
|
|
81
|
+
export declare function reportableUseCase(value: unknown): UseCase;
|
|
61
82
|
export declare function checkUseCase(value: unknown): EncoreError | null;
|
|
62
83
|
//# sourceMappingURL=useCase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCase.d.ts","sourceRoot":"","sources":["../../src/core/useCase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAa,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAAG,oBAAoB,CAAC;AAuBtE,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAE3D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAGpF;AAOD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAS/D"}
|
|
1
|
+
{"version":3,"file":"useCase.d.ts","sourceRoot":"","sources":["../../src/core/useCase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAa,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAAG,oBAAoB,CAAC;AAuBtE,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAE3D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAGpF;AAOD;;;;;;;;;;;;;;;;;GAiBG;AACH,sFAAsF;AACtF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAEnE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEzD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAS/D"}
|
package/types/core/version.d.ts
CHANGED
|
@@ -2,36 +2,12 @@
|
|
|
2
2
|
* Reliable delivery for the NCL exposure event — the A/B denominator.
|
|
3
3
|
*
|
|
4
4
|
* Exposure MUST survive tab-close, so unlike the fire-and-forget AnalyticsClient
|
|
5
|
-
* this path is storage-backed and retried.
|
|
6
|
-
*
|
|
7
|
-
* Delivery primitive: `fetch(url, { keepalive: true })` — NOT `navigator.sendBeacon`.
|
|
8
|
-
* The ingest endpoint authenticates on the `X-Analytics-Key` request header, and
|
|
9
|
-
* sendBeacon cannot set headers (a beacon would arrive unauthenticated). keepalive
|
|
10
|
-
* fetch survives document unload like a beacon AND carries the auth header.
|
|
11
|
-
*
|
|
12
|
-
* Reliability model:
|
|
13
|
-
* - enqueue: persist the envelope, then keepalive-POST; remove on 2xx.
|
|
14
|
-
* - flush: replay every persisted envelope (on SDK init + on pagehide /
|
|
15
|
-
* visibilitychange:hidden) so a send that died with the tab retries.
|
|
16
|
-
* - envelopes carry a STABLE event_id → retries are idempotent backend-side.
|
|
17
|
-
* - an in-memory in-flight set avoids duplicate concurrent sends.
|
|
18
|
-
* - all storage / window / document access is SSR- and failure-guarded (fail-open).
|
|
5
|
+
* this path is storage-backed and retried. See `ReliableOutbox` for the shared
|
|
6
|
+
* mechanism (keepalive fetch, persist-then-send, lifecycle-triggered flush).
|
|
19
7
|
*/
|
|
20
|
-
import
|
|
8
|
+
import { ReliableOutbox } from '../analytics/ReliableOutbox';
|
|
21
9
|
import type { StorageManager } from '../core/StorageManager';
|
|
22
|
-
export declare class ExposureOutbox {
|
|
23
|
-
#private;
|
|
10
|
+
export declare class ExposureOutbox extends ReliableOutbox {
|
|
24
11
|
constructor(apiKey: string, analyticsBaseURL: string, storage: StorageManager);
|
|
25
|
-
/**
|
|
26
|
-
* Persist an exposure event and attempt delivery. `eventId` must be stable for a
|
|
27
|
-
* given (user, epoch) so retries de-duplicate backend-side. Returns whether the
|
|
28
|
-
* envelope durably landed in the configured storage tier: a quota-driven
|
|
29
|
-
* fallback-to-memory write is invisible to a fresh read, so the caller can avoid
|
|
30
|
-
* marking the epoch logged (and re-enqueue on the next trigger) instead of
|
|
31
|
-
* silently dropping the exposure.
|
|
32
|
-
*/
|
|
33
|
-
enqueue(event: AnalyticsEvent, eventId: string): boolean;
|
|
34
|
-
/** Replay every persisted envelope (init recovery + unload flush). */
|
|
35
|
-
flush(): void;
|
|
36
12
|
}
|
|
37
13
|
//# sourceMappingURL=ExposureOutbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExposureOutbox.d.ts","sourceRoot":"","sources":["../../src/experiments/ExposureOutbox.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ExposureOutbox.d.ts","sourceRoot":"","sources":["../../src/experiments/ExposureOutbox.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAI7D,qBAAa,cAAe,SAAQ,cAAc;gBACpC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc;CAG9E"}
|
package/types/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { Encore, Encore as default } from './core/Encore';
|
|
7
7
|
export type * from './types';
|
|
8
|
+
export type { AppearanceRenderer, AppearanceSlotContext, ButtonAppearance, ButtonSlot, TextAppearance, TextSlot, } from './ui/appearance';
|
|
8
9
|
export type * from './api/models';
|
|
9
10
|
export type { EntitlementChangedEvent, EntitlementEventMap } from './core/EntitlementManager';
|
|
10
11
|
export type { Cohort, NCLExperimentState } from './experiments/types';
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,eAAe,CAAC;AAG1D,mBAAmB,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,eAAe,CAAC;AAG1D,mBAAmB,SAAS,CAAC;AAK7B,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,QAAQ,GACT,MAAM,iBAAiB,CAAC;AAGzB,mBAAmB,cAAc,CAAC;AAGlC,YAAY,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAG9F,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/types/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Core Type Definitions
|
|
3
3
|
* Shared types used across the SDK
|
|
4
4
|
*/
|
|
5
|
+
import type { TextSlot, ButtonSlot } from './ui/appearance';
|
|
5
6
|
/**
|
|
6
7
|
* Supported entitlement types with optional values
|
|
7
8
|
*/
|
|
@@ -60,9 +61,19 @@ export interface UserAttributes {
|
|
|
60
61
|
custom?: Record<string, string>;
|
|
61
62
|
}
|
|
62
63
|
/**
|
|
63
|
-
* Reasons why an entitlement was not granted
|
|
64
|
+
* Reasons why an entitlement was not granted. `notConfigured` and
|
|
65
|
+
* `alreadyPresenting` mirror the case names iOS uses for the same conditions
|
|
66
|
+
* (`NotPresentedReason`), so a cross-platform integration reads one vocabulary.
|
|
64
67
|
*/
|
|
65
|
-
export type NotGrantedReason = 'userClosedModal' | 'userClickedOutside' | 'userDeclinedLastOffer' | 'noOffersAvailable'
|
|
68
|
+
export type NotGrantedReason = 'userClosedModal' | 'userClickedOutside' | 'userDeclinedLastOffer' | 'noOffersAvailable'
|
|
69
|
+
/** A `show()` was already in flight — see the reentrancy guard in `Encore.show()`. */
|
|
70
|
+
| 'alreadyPresenting'
|
|
71
|
+
/**
|
|
72
|
+
* `show()` was called before `configure()`. A named reason rather than a generic
|
|
73
|
+
* error because it is one specific, always-the-same integration mistake with one
|
|
74
|
+
* fix, and it is what iOS reports for the identical condition.
|
|
75
|
+
*/
|
|
76
|
+
| 'notConfigured' | {
|
|
66
77
|
type: 'error';
|
|
67
78
|
error: EncoreError;
|
|
68
79
|
};
|
|
@@ -87,12 +98,60 @@ export interface PresentationResult {
|
|
|
87
98
|
reason?: NotGrantedReason;
|
|
88
99
|
}
|
|
89
100
|
/**
|
|
90
|
-
*
|
|
101
|
+
* How a placement looks.
|
|
102
|
+
*
|
|
103
|
+
* Two tiers, and they compose:
|
|
104
|
+
*
|
|
105
|
+
* - **Theme colours** (`backgroundColor` / `textColor` / `accentColor`) — the original
|
|
106
|
+
* three. They set the SDK's CSS custom properties, so one value repaints everything
|
|
107
|
+
* derived from it (muted text, surfaces, focus rings).
|
|
108
|
+
* - **Slots** — per-element overrides for the reward sheet's headline, subheadline,
|
|
109
|
+
* CTA, decline button and page dots. Each accepts either a styled-text/style config,
|
|
110
|
+
* a ready `HTMLElement`, or a `(context) => HTMLElement` renderer. See
|
|
111
|
+
* {@link TextSlot} / {@link ButtonSlot}.
|
|
112
|
+
*
|
|
113
|
+
* EVERY FIELD IS OPTIONAL AND OMITTING THE WHOLE OBJECT CHANGES NOTHING. The sheet
|
|
114
|
+
* renders exactly what it rendered before this config existed.
|
|
115
|
+
*
|
|
116
|
+
* Two guarantees worth relying on:
|
|
117
|
+
*
|
|
118
|
+
* 1. **A bad value costs you the override, never the sheet.** Renderers run inside a
|
|
119
|
+
* guard, and colours/fonts/sizes go through an allow-list — a throw, a non-element
|
|
120
|
+
* return or a malformed colour falls back to the SDK's default element.
|
|
121
|
+
* 2. **The SDK keeps the action.** On `claimButton` and `declineButton` the publisher
|
|
122
|
+
* supplies appearance only: the SDK mounts the element inside its own control and
|
|
123
|
+
* handles activation in the capture phase, so its claim/decline behaviour runs
|
|
124
|
+
* first and a publisher-attached handler cannot pre-empt or swallow it.
|
|
125
|
+
*
|
|
126
|
+
* The slot fields are read by the `'rewardUsers'` composition, which is the one with a
|
|
127
|
+
* headline block, a CTA pair and page dots. `'reduceChurn'` renders the bare carousel
|
|
128
|
+
* and uses the theme colours and `modalBackgroundColor` only.
|
|
91
129
|
*/
|
|
92
130
|
export interface AppearanceConfig {
|
|
131
|
+
/** Sets `--encore-bg-color` — the sheet's canvas, and everything derived from it. */
|
|
93
132
|
backgroundColor?: string;
|
|
133
|
+
/** Sets `--encore-text-color`, from which muted and secondary ink are derived. */
|
|
94
134
|
textColor?: string;
|
|
135
|
+
/** Sets `--encore-primary-color` — focus rings, links, the churn CTA. */
|
|
95
136
|
accentColor?: string;
|
|
137
|
+
/**
|
|
138
|
+
* The modal container's background, on the modal element only. Narrower than
|
|
139
|
+
* {@link backgroundColor}, which also moves every surface derived from it — use this
|
|
140
|
+
* when you want to repaint the sheet and nothing else.
|
|
141
|
+
*/
|
|
142
|
+
modalBackgroundColor?: string;
|
|
143
|
+
/** The reward sheet's primary heading. Styled text, an element, or a renderer. */
|
|
144
|
+
headline?: TextSlot;
|
|
145
|
+
/** The line under the heading. Same three forms. */
|
|
146
|
+
subheadline?: TextSlot;
|
|
147
|
+
/** The "Claim gift" CTA. The SDK keeps the claim action — see the interface docs. */
|
|
148
|
+
claimButton?: ButtonSlot;
|
|
149
|
+
/** The "No thanks" decline button. The SDK keeps the decline action. */
|
|
150
|
+
declineButton?: ButtonSlot;
|
|
151
|
+
/** The page indicator's inactive dots. */
|
|
152
|
+
dotColor?: string;
|
|
153
|
+
/** The page indicator's active dot. */
|
|
154
|
+
dotActiveColor?: string;
|
|
96
155
|
}
|
|
97
156
|
/**
|
|
98
157
|
* WHY a placement presents — Encore's platform-wide use-case dimension, and the ONLY
|
|
@@ -183,6 +242,15 @@ export interface PlacementBuilder {
|
|
|
183
242
|
* `.useCase(...)` step the native SDKs expose. See {@link UseCase}.
|
|
184
243
|
*/
|
|
185
244
|
useCase(useCase: UseCase): PlacementBuilder;
|
|
245
|
+
/**
|
|
246
|
+
* Override the sheet's headline for this presentation — the same `.headline(...)`
|
|
247
|
+
* step the native SDKs expose. Equivalent to the `headline` field of
|
|
248
|
+
* {@link PlacementOptions}, and subject to the same precedence and
|
|
249
|
+
* blank-falls-through rules.
|
|
250
|
+
*/
|
|
251
|
+
headline(text: string): PlacementBuilder;
|
|
252
|
+
/** Counterpart to {@link PlacementBuilder.headline}: same rules. */
|
|
253
|
+
subheadline(text: string): PlacementBuilder;
|
|
186
254
|
/** Fires when the sheet closes without a claim — carries the dismissal reason. */
|
|
187
255
|
onNotGranted(callback: (reason: NotGrantedReason) => void): PlacementBuilder;
|
|
188
256
|
onLoadingStateChange(callback: (isLoading: boolean) => void): PlacementBuilder;
|
|
@@ -254,6 +322,27 @@ export interface EncoreConfig {
|
|
|
254
322
|
apiKey: string;
|
|
255
323
|
environment?: 'production' | 'development' | 'staging' | 'localhost';
|
|
256
324
|
logLevel?: 'none' | 'debug';
|
|
325
|
+
/**
|
|
326
|
+
* When a claim is treated as confirmed — the same axis as iOS's and Android's
|
|
327
|
+
* `UnlockMode`, and global for the session (the native SDKs deliberately have no
|
|
328
|
+
* per-placement override either).
|
|
329
|
+
*
|
|
330
|
+
* - `'optimistic'` (default): a claim is confirmed the moment the advertiser
|
|
331
|
+
* handoff happens. Byte-identical to the behavior before this option existed.
|
|
332
|
+
* - `'strict'`: the claim is additionally verified against the advertiser's
|
|
333
|
+
* postback (bounded poll, ~15s) before it is reported as confirmed. Offers are
|
|
334
|
+
* pre-filtered to campaigns whose postback latency can plausibly land inside
|
|
335
|
+
* that window, and such a fetch bypasses the offer cache. A claim that has not
|
|
336
|
+
* verified by the time the user navigates away is reconciled on a later page
|
|
337
|
+
* load — see `Encore.onStrictUnlockVerified`.
|
|
338
|
+
*
|
|
339
|
+
* `show()` resolves `'claimed'` at handoff in BOTH modes: on web the advertiser
|
|
340
|
+
* opens in a separate tab and the SDK renders nothing post-claim, so there is no
|
|
341
|
+
* sheet left to hold a verification spinner in the way iOS does. Strict mode
|
|
342
|
+
* reports its verification through the callback instead — a deliberate divergence,
|
|
343
|
+
* see docs/architecture/platform-divergence/web.md.
|
|
344
|
+
*/
|
|
345
|
+
unlockMode?: 'strict' | 'optimistic';
|
|
257
346
|
}
|
|
258
347
|
/** Result of `show()` / `present()`. */
|
|
259
348
|
export type ShowResult =
|
package/types/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sour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,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AACH,wDAAwD;GACtD;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAAE;AACpD,8DAA8D;GAC5D;IAAE,MAAM,EAAE,aAAa,CAAA;CAAE,CAAC;AAE9B;;;;;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"}
|
package/types/ui/OfferCard.d.ts
CHANGED
|
@@ -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;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
|
|
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;;gBAaR,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE;IAKhD;;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;IAyKb;;OAEG;IACH,OAAO,IAAI,IAAI;CAUhB"}
|
|
@@ -45,6 +45,19 @@ export interface OfferCarouselOptions {
|
|
|
45
45
|
* Off by default, so the churn-intervention and thankYou carousels are untouched.
|
|
46
46
|
*/
|
|
47
47
|
selectable?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* When false every Claim affordance renders disabled — `Encore.isClaimEnabled`.
|
|
50
|
+
* Defaults true, which is byte-identical to before the option existed.
|
|
51
|
+
*/
|
|
52
|
+
claimEnabled?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Publisher colours for the compact page indicator: the inactive dots and the active
|
|
55
|
+
* one. Written as CSS custom properties on the indicator element, so an unset value
|
|
56
|
+
* falls back — in the stylesheet, via `var(…, <default>)` — to exactly the colour the
|
|
57
|
+
* indicator has always used. Sanitized before they are written.
|
|
58
|
+
*/
|
|
59
|
+
dotColor?: string;
|
|
60
|
+
dotActiveColor?: string;
|
|
48
61
|
}
|
|
49
62
|
interface CarouselEventMap extends Record<string, unknown> {
|
|
50
63
|
offerClaim: {
|
|
@@ -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;
|
|
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;AAQhD,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC;IAC9B;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAQD,UAAU,gBAAiB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACxD,UAAU,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,YAAY,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAChC,SAAS,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C;;;;;;;OAOG;IACH,MAAM,EAAE;QAAE,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,QAAQ,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAC/B;;;;;OAKG;IACH,WAAW,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9C;AAED,qBAAa,aAAa;;gBAuEZ,MAAM,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,oBAAoB;IAoBvF;;OAEG;IACH,MAAM,IAAI,WAAW;IA8PrB;;OAEG;IACH,EAAE,CAAC,CAAC,SAAS,MAAM,gBAAgB,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;;;;;OAKG;IACH,gBAAgB,IAAI,KAAK,GAAG,SAAS;IAIrC;;;;;;;;;;OAUG;IACH,aAAa,IAAI,IAAI;IASrB;;;;;OAKG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAiBhC;;OAEG;IACH,QAAQ,IAAI,IAAI;IA4nBhB;;OAEG;IACH,OAAO,IAAI,IAAI;CA2BhB"}
|
package/types/ui/OfferModal.d.ts
CHANGED
|
@@ -9,9 +9,33 @@ interface ModalEventMap extends Record<string, unknown> {
|
|
|
9
9
|
show: void;
|
|
10
10
|
hide: void;
|
|
11
11
|
}
|
|
12
|
+
export interface OfferModalOptions {
|
|
13
|
+
/**
|
|
14
|
+
* The floating × in the corner. Defaults to `true` — every composition that has no
|
|
15
|
+
* explicit dismissal control of its own needs it, and `reduceChurn` (per-card Claim,
|
|
16
|
+
* no decline button) is exactly that case.
|
|
17
|
+
*
|
|
18
|
+
* The reward composition passes `false`: `streaksCarousel.json` renders a "No thanks"
|
|
19
|
+
* secondary CTA as its decline affordance, and two dismissal controls on one sheet is
|
|
20
|
+
* one too many — the × sat over the sheet's top-right on mobile, competing with the
|
|
21
|
+
* headline for the same corner. Nothing about dismissal SEMANTICS changes with it:
|
|
22
|
+
* "No thanks" already took the identical `close` path (see `dismissAsClosed` in
|
|
23
|
+
* `Encore.ts`), so the same `sdk_sdui_button_tapped(close)`, the same
|
|
24
|
+
* `endPresentation('userClosedModal')` and the same `decline_reason: 'close_button'`
|
|
25
|
+
* are emitted whichever control is used. Escape and backdrop-click are untouched and
|
|
26
|
+
* remain on every composition.
|
|
27
|
+
*/
|
|
28
|
+
showCloseButton?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Publisher override for the modal container's background, applied INLINE on the
|
|
31
|
+
* modal element. Narrower than the `backgroundColor` theme variable, which also moves
|
|
32
|
+
* every surface derived from it. Sanitized — an unrecognised value is ignored.
|
|
33
|
+
*/
|
|
34
|
+
backgroundColor?: string;
|
|
35
|
+
}
|
|
12
36
|
export declare class OfferModal {
|
|
13
37
|
#private;
|
|
14
|
-
constructor(theme?: ThemeVariables);
|
|
38
|
+
constructor(theme?: ThemeVariables, options?: OfferModalOptions);
|
|
15
39
|
/**
|
|
16
40
|
* Create and show the modal
|
|
17
41
|
*/
|
|
@@ -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;
|
|
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;AAG/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,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;;;;OAcG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,qBAAa,UAAU;;gBAqBT,KAAK,GAAE,cAAmB,EAAE,OAAO,GAAE,iBAAsB;IASvE;;OAEG;IACH,IAAI,IAAI,IAAI;IAqCZ;;OAEG;IACH,IAAI,IAAI,IAAI;IA4CZ;;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;IA4BtC;;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;IA2Jb;;OAEG;IACH,OAAO,IAAI,IAAI;CAoBhB"}
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
* once per sheet, and neither has a second subscriber. The emitter would be
|
|
20
20
|
* ceremony around a pair of function calls.
|
|
21
21
|
*/
|
|
22
|
+
import type { UseCase } from '../types';
|
|
23
|
+
import { type ButtonSlot } from './appearance';
|
|
22
24
|
/** Copy the variant hard-codes. Named so the tests can assert parity by symbol. */
|
|
23
25
|
export declare const REWARD_COPY: {
|
|
24
26
|
readonly trust: "No charges until trial ends, cancel anytime.";
|
|
@@ -36,6 +38,28 @@ export interface RewardActionsOptions {
|
|
|
36
38
|
* is the variant's copy, not a universal truth.
|
|
37
39
|
*/
|
|
38
40
|
trustText?: string;
|
|
41
|
+
/**
|
|
42
|
+
* When false the primary CTA renders disabled — the host has switched claiming
|
|
43
|
+
* off via `Encore.isClaimEnabled`. "No thanks" stays live: a user must always be
|
|
44
|
+
* able to leave.
|
|
45
|
+
*
|
|
46
|
+
* Independent of `claimSlot`: the gate is the SDK's, so it holds whether the CTA is
|
|
47
|
+
* the SDK's own button or a publisher's element. See `createActionSlot`.
|
|
48
|
+
*/
|
|
49
|
+
claimEnabled?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Publisher appearance for the two buttons: styled config, a ready element, or a
|
|
52
|
+
* renderer.
|
|
53
|
+
*
|
|
54
|
+
* APPEARANCE ONLY — `onClaim` and `onDecline` above stay the behaviour, whatever the
|
|
55
|
+
* publisher supplies. A custom element is mounted inside an SDK-owned control whose
|
|
56
|
+
* listener fires in the capture phase, so the claim/decline runs first and any
|
|
57
|
+
* handler on the publisher's element never runs at all. See `createActionSlot`.
|
|
58
|
+
*/
|
|
59
|
+
claimSlot?: ButtonSlot;
|
|
60
|
+
declineSlot?: ButtonSlot;
|
|
61
|
+
/** Context handed to the slot renderers. */
|
|
62
|
+
useCase?: UseCase;
|
|
39
63
|
}
|
|
40
64
|
export declare class RewardActions {
|
|
41
65
|
#private;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RewardActions.d.ts","sourceRoot":"","sources":["../../src/ui/RewardActions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"RewardActions.d.ts","sourceRoot":"","sources":["../../src/ui/RewardActions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAqC,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAElF,mFAAmF;AACnF,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,wDAAwD;IACxD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,aAAa;;gBAwBZ,OAAO,EAAE,oBAAoB;IAIzC,MAAM,IAAI,WAAW;IAiDrB;;;;;;;;;;;;OAYG;IACH,gBAAgB,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI;IAW/C,OAAO,IAAI,IAAI;CAWhB"}
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* whole visual system — including the `--reward` parity rules that track the native
|
|
13
13
|
* SDKs' `streaksCarousel.json` type scale — for no behavioural gain.
|
|
14
14
|
*/
|
|
15
|
+
import type { UseCase } from '../types';
|
|
16
|
+
import { type TextSlot } from './appearance';
|
|
15
17
|
/**
|
|
16
18
|
* The id given to the status heading so the dialog's accessible name can point at
|
|
17
19
|
* the chrome's real primary heading (the carousel's own header is suppressed in this
|
|
@@ -40,6 +42,20 @@ export interface RewardLayoutOptions {
|
|
|
40
42
|
* listeners and its teardown; this function only positions it.
|
|
41
43
|
*/
|
|
42
44
|
actions?: HTMLElement;
|
|
45
|
+
/**
|
|
46
|
+
* Publisher overrides for the two copy slots — styled text, a ready element, or a
|
|
47
|
+
* renderer. Resolved HERE rather than by the caller so the semantic `h2`/`p` (and
|
|
48
|
+
* with them {@link REWARD_TITLE_ID}, the dialog's accessible name) stay owned by
|
|
49
|
+
* this module: a publisher styles or fills the heading, never deletes it.
|
|
50
|
+
*
|
|
51
|
+
* Taken as CONFIG while `actions` is taken as an ELEMENT, and the split is the same
|
|
52
|
+
* one as before: these slots have no listeners and no teardown, so resolving them
|
|
53
|
+
* costs this pure function nothing.
|
|
54
|
+
*/
|
|
55
|
+
headlineSlot?: TextSlot;
|
|
56
|
+
subheadlineSlot?: TextSlot;
|
|
57
|
+
/** Passed to the slot renderers as context. Defaults to the only use case that composes this chrome. */
|
|
58
|
+
useCase?: UseCase;
|
|
43
59
|
}
|
|
44
60
|
/**
|
|
45
61
|
* Compose the reward sheet: status (optional check → title → subtitle) → carousel.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RewardLayout.d.ts","sourceRoot":"","sources":["../../src/ui/RewardLayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"RewardLayout.d.ts","sourceRoot":"","sources":["../../src/ui/RewardLayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxC,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAAwB,CAAC;AAErD,MAAM,WAAW,mBAAmB;IAClC,oFAAoF;IACpF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAChC;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC;IACxB,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,wGAAwG;IACxG,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAQD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,WAAW,EAC5B,OAAO,GAAE,mBAAwB,GAChC,WAAW,CA+Db"}
|