@encorekit/web-sdk 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- 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 +1 -1
- package/types/analytics/events.d.ts +57 -5
- package/types/analytics/events.d.ts.map +1 -1
- package/types/api/APIClient.d.ts +16 -20
- package/types/api/APIClient.d.ts.map +1 -1
- package/types/api/generated/types.d.ts +643 -9
- package/types/api/generated/types.d.ts.map +1 -1
- package/types/api/models.d.ts +19 -7
- package/types/api/models.d.ts.map +1 -1
- package/types/api/offerBuilder.d.ts +45 -0
- package/types/api/offerBuilder.d.ts.map +1 -0
- package/types/core/Configuration.d.ts +11 -0
- package/types/core/Configuration.d.ts.map +1 -1
- package/types/core/Encore.d.ts.map +1 -1
- package/types/core/OfferManager.d.ts +2 -2
- package/types/core/OfferManager.d.ts.map +1 -1
- package/types/core/claimScreenVariant.d.ts +3 -0
- package/types/core/claimScreenVariant.d.ts.map +1 -0
- package/types/core/giftVariant.d.ts +11 -8
- package/types/core/giftVariant.d.ts.map +1 -1
- package/types/core/share.d.ts +58 -0
- package/types/core/share.d.ts.map +1 -0
- package/types/core/unlockCode.d.ts +4 -1
- package/types/core/unlockCode.d.ts.map +1 -1
- package/types/core/version.d.ts +1 -1
- package/types/types.d.ts +120 -3
- package/types/types.d.ts.map +1 -1
- package/types/ui/ClaimScreen.d.ts +62 -0
- package/types/ui/ClaimScreen.d.ts.map +1 -0
- package/types/ui/CodeUnlock.d.ts +14 -0
- package/types/ui/CodeUnlock.d.ts.map +1 -1
- package/types/ui/GiftSheet.d.ts +48 -4
- package/types/ui/GiftSheet.d.ts.map +1 -1
- package/types/ui/GiftUnwrap.d.ts +70 -0
- package/types/ui/GiftUnwrap.d.ts.map +1 -1
- package/types/ui/OfferCard.d.ts.map +1 -1
- package/types/ui/OfferModal.d.ts +22 -4
- package/types/ui/OfferModal.d.ts.map +1 -1
- package/types/ui/giftUnwrapArt.d.ts +6 -0
- package/types/ui/giftUnwrapArt.d.ts.map +1 -1
- package/types/ui/giftUnwrapCopy.d.ts +20 -0
- package/types/ui/giftUnwrapCopy.d.ts.map +1 -1
- package/types/ui/styles.d.ts.map +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `/offers/search` campaigns → the SDK's `OfferModel` list, ONE offer per campaign.
|
|
3
|
+
*
|
|
4
|
+
* Creative first: when a campaign arrives with a creative, every field
|
|
5
|
+
* comes from that creative exactly as before, and the offer-level fields are ignored.
|
|
6
|
+
* The switch to campaign-owned values happens on the server, which composes the
|
|
7
|
+
* served creative from the campaign, so every client flips together.
|
|
8
|
+
*
|
|
9
|
+
* Only a campaign with NO active creative reads the offer-level fields. Its claim link
|
|
10
|
+
* is `destinationUrl` + `trackingParameters` taken together, and without usable
|
|
11
|
+
* tracking the campaign is skipped: a link without it could not attribute the claim.
|
|
12
|
+
*/
|
|
13
|
+
import type { OfferModel } from './models';
|
|
14
|
+
/**
|
|
15
|
+
* The campaign's shelf category (`campaign.category`, a nullable free string in the
|
|
16
|
+
* contract), read tolerantly: only a non-blank string is kept (trimmed). Anything else,
|
|
17
|
+
* and the field's absence on an older backend, is `undefined`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function readCategory(campaign: unknown): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* A campaign-level URL (`heroImageUrl`, `termsUrl`), read tolerantly: a non-blank string,
|
|
22
|
+
* trimmed, that passes the SDK's https guard. Anything else, a `javascript:` or plain
|
|
23
|
+
* `http:` row included, is dropped, so a bad row can never inject a scheme.
|
|
24
|
+
*/
|
|
25
|
+
export declare function readCampaignUrl(campaign: unknown, key: 'heroImageUrl' | 'termsUrl'): string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The link a user can send someone for this offer (`campaign.shareUrl`, nullable in the
|
|
28
|
+
* contract), read tolerantly: a non-blank string,
|
|
29
|
+
* trimmed, that parses as an ABSOLUTE `http:` or `https:` URL. Anything else is absent,
|
|
30
|
+
* which the share action reports as `missing_share_link`.
|
|
31
|
+
*
|
|
32
|
+
* Only the field is dropped, never the offer: a bad link costs one button, not the
|
|
33
|
+
* offer list. A relative value is absent too, because `navigator.share` would resolve
|
|
34
|
+
* it against the HOST page and send the publisher's own URL.
|
|
35
|
+
*/
|
|
36
|
+
export declare function readShareUrl(campaign: unknown): string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The advertiser's hostname for the claim screen's "Finish on {domain}"
|
|
39
|
+
* (`campaign.expectedDomain`): trimmed, lowercased, a leading `www.` and a trailing root dot
|
|
40
|
+
* dropped. Only a bare hostname is kept, so a bad row can never put a URL on screen.
|
|
41
|
+
*/
|
|
42
|
+
export declare function readExpectedDomain(campaign: unknown): string | undefined;
|
|
43
|
+
/** Never throws: a malformed campaign is skipped, not allowed to fail the list. */
|
|
44
|
+
export declare function buildOffers(campaigns: readonly unknown[] | null | undefined): OfferModel[];
|
|
45
|
+
//# sourceMappingURL=offerBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offerBuilder.d.ts","sourceRoot":"","sources":["../../src/api/offerBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAMlE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,OAAO,EACjB,GAAG,EAAE,cAAc,GAAG,UAAU,GAC/B,MAAM,GAAG,SAAS,CAKpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAYlE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAYxE;AA2ID,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,EAAE,CAQ1F"}
|
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
* Validates and stores SDK configuration
|
|
4
4
|
*/
|
|
5
5
|
import type { EncoreConfig } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* @internal Not in `EncoreConfig`: scopes the offers search to the presented variant, which
|
|
8
|
+
* the server filters on links it is due to drop. Only a literal `true` turns it on.
|
|
9
|
+
*/
|
|
10
|
+
export interface InternalConfigOptions {
|
|
11
|
+
filterOffersByVariant?: boolean;
|
|
12
|
+
}
|
|
6
13
|
export declare class Configuration {
|
|
7
14
|
#private;
|
|
8
15
|
/**
|
|
@@ -39,6 +46,10 @@ export declare class Configuration {
|
|
|
39
46
|
* handoff, or `'strict'` only once the advertiser postback verifies it.
|
|
40
47
|
*/
|
|
41
48
|
getUnlockMode(): 'strict' | 'optimistic';
|
|
49
|
+
/** Whether a labelled reward placement resolves its own variant. See `EncoreConfig`. */
|
|
50
|
+
getResolveVariantsByPlacement(): boolean;
|
|
51
|
+
/** Whether the offers search sends the presented variant. See `InternalConfigOptions`. */
|
|
52
|
+
getFilterOffersByVariant(): boolean;
|
|
42
53
|
/**
|
|
43
54
|
* Reset configuration (primarily for testing)
|
|
44
55
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../../src/core/Configuration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../../src/core/Configuration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAUD,qBAAa,aAAa;;IAIxB;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO;IAmGxC;;OAEG;IACH,SAAS,IAAI,YAAY,GAAG,IAAI;IAIhC;;OAEG;IACH,YAAY,IAAI,OAAO;IAIvB;;OAEG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI;IAI1B;;OAEG;IACH,UAAU,IAAI,MAAM,GAAG,IAAI;IAI3B;;OAEG;IACH,mBAAmB,IAAI,MAAM,GAAG,IAAI;IAIpC;;OAEG;IACH,cAAc,IAAI,MAAM,GAAG,IAAI;IAI/B;;;OAGG;IACH,aAAa,IAAI,QAAQ,GAAG,YAAY;IAIxC,wFAAwF;IACxF,6BAA6B,IAAI,OAAO;IAIxC,0FAA0F;IAC1F,wBAAwB,IAAI,OAAO;IAInC;;OAEG;IACH,KAAK,IAAI,IAAI;CAKd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Encore.d.ts","sourceRoot":"","sources":["../../src/core/Encore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAEhB,kBAAkB,EAElB,gBAAgB,IAAI,iBAAiB,EACrC,aAAa,EACb,YAAY,EACZ,UAAU,EACV,WAAW,EAEZ,MAAM,UAAU,CAAC;AA2ClB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Encore.d.ts","sourceRoot":"","sources":["../../src/core/Encore.ts"],"names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K,IAAI,KAAK,WAAW,CAAC;KACnE;IAaD;;;;;;;;;;;;;;;;;;OAkBG;IACH,sBAAsB,CAAC,QAAQ,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,GAAG,WAAW;IAI9E;;;;;;;;OAQG;IACH,SAAS,CACP,WAAW,CAAC,EAAE,MAAM,GAAG,gBAAgB,EACvC,OAAO,CAAC,EAAE,gBAAgB,GACzB,iBAAiB;CAg9FrB;AAGD,eAAO,MAAM,MAAM,WAAkB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Offer Manager
|
|
3
3
|
* Handles offer fetching, caching, and analytics tracking
|
|
4
4
|
*/
|
|
5
|
-
import type { APIClient } from '../api/APIClient';
|
|
5
|
+
import type { APIClient, OffersSearchScope } from '../api/APIClient';
|
|
6
6
|
import type { OfferModel } from '../api/models';
|
|
7
7
|
import type { UserAttributes, UseCase } from '../types';
|
|
8
8
|
import type { AnalyticsClient } from '../analytics/AnalyticsClient';
|
|
@@ -19,7 +19,7 @@ export declare class OfferManager {
|
|
|
19
19
|
* strict presentation, and caching the narrowed set would starve a later
|
|
20
20
|
* optimistic one. Matches iOS.
|
|
21
21
|
*/
|
|
22
|
-
fetchOffers(userAttributes: UserAttributes, useCache?: boolean, placementId?: string, maxPostbackTimeMs?: number): Promise<{
|
|
22
|
+
fetchOffers(userAttributes: UserAttributes, useCache?: boolean, placementId?: string, maxPostbackTimeMs?: number, scope?: OffersSearchScope): Promise<{
|
|
23
23
|
offers: OfferModel[];
|
|
24
24
|
}>;
|
|
25
25
|
/**
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"OfferManager.d.ts","sourceRoot":"","sources":["../../src/core/OfferManager.ts"],"names":[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aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,OAAO,GAChB,IAAI;IAoBP;;OAEG;IACH,kBAAkB,CAChB,KAAK,EAAE,UAAU,EACjB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,aAAa,CAAC,EAAE,MAAM,EACtB,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;IAOlB;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAKhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claimScreenVariant.d.ts","sourceRoot":"","sources":["../../src/core/claimScreenVariant.ts"],"names":[],"mappings":"AAYA,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEhF"}
|
|
@@ -7,13 +7,16 @@
|
|
|
7
7
|
* which is the same per-app machinery `streaksCarousel` already rides
|
|
8
8
|
* (`GET /publisher/sdk/v1/config` → `ui.variantName`).
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
10
|
+
* SEVEN NAMES. `giftReveal` is the name in the approved Backend Change Report (the box
|
|
11
|
+
* that opens onto a short radio group). `giftList` and `giftUnwrap` are the two later
|
|
12
|
+
* designs (a selectable list under a hero image, and a closed box that unwraps onto a
|
|
13
|
+
* "your gift is ready" screen). `giftPicker` is PayRange's original email gift picker
|
|
14
|
+
* (host bar, logo fan, brand + perk rows). `codeUnlock` puts a "type your code" screen
|
|
15
|
+
* in front of that same picker, for the emails that carry a code (see
|
|
16
|
+
* `ui/CodeUnlock.ts`). `shareFromHeader` and `shareForLater` are backend#659's two
|
|
17
|
+
* "keep your gift for later" designs; both derive from the `threeLightSteps` file,
|
|
18
|
+
* whose web surface is `giftUnwrap`, so both render `GiftUnwrap` with a share design on
|
|
19
|
+
* top (see `Encore`). The names are fixed:
|
|
17
20
|
* they are what the `variants` rows will be called and what the config endpoint will
|
|
18
21
|
* serve as `selectedVariant.name`. They sit beside the shipped variants
|
|
19
22
|
* (bundleFraming, control, customHeadlineControl, featuredOfferCarousel,
|
|
@@ -39,7 +42,7 @@
|
|
|
39
42
|
* this SDK, visible in review, and costs one string per surface.
|
|
40
43
|
*/
|
|
41
44
|
/** The bespoke reward surfaces a served variant can ask for. */
|
|
42
|
-
export type RewardSurfaceKind = 'giftReveal' | 'giftList' | 'giftUnwrap' | 'giftPicker' | 'codeUnlock';
|
|
45
|
+
export type RewardSurfaceKind = 'giftReveal' | 'giftList' | 'giftUnwrap' | 'giftPicker' | 'codeUnlock' | 'shareFromHeader' | 'shareForLater';
|
|
43
46
|
/**
|
|
44
47
|
* Exact served variant name → the surface it asks for. The ONLY way into any gift
|
|
45
48
|
* surface: a name missing from this table is the carousel.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"giftVariant.d.ts","sourceRoot":"","sources":["../../src/core/giftVariant.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"giftVariant.d.ts","sourceRoot":"","sources":["../../src/core/giftVariant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,gEAAgE;AAChE,MAAM,MAAM,iBAAiB,GACzB,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,iBAAiB,GACjB,eAAe,CAAC;AAEpB;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAU3E,CAAC;AAEH;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;AACtC;;;;;;GAMG;AACH,KAAK,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAwB,GACxE,iBAAiB,GAAG,IAAI,CAO1B"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `share` action: hand the link the backend minted for an offer to the user.
|
|
3
|
+
*
|
|
4
|
+
* THE LINK IS THE SERVER'S, NEVER THIS SDK'S. It arrives as `OfferModel.shareUrl` and
|
|
5
|
+
* is shared exactly as served. An offer without one shares nothing and reports
|
|
6
|
+
* `missing_share_link`; there is no fallback to the advertiser URL or to any link this
|
|
7
|
+
* SDK could assemble, because a client-built link is forgeable and unattributed. Same
|
|
8
|
+
* rule as iOS (swift#156) and Android (android#93).
|
|
9
|
+
*
|
|
10
|
+
* TWO ROUTES, in order:
|
|
11
|
+
* 1. `navigator.share`, the system share sheet. It resolves when the user sent the
|
|
12
|
+
* link and rejects when they backed out, so web, like iOS, can tell a completed
|
|
13
|
+
* share from a cancel. A cancel is reported as `completed=false`, never as a
|
|
14
|
+
* failure, and it is not always spelled `AbortError`: `NotAllowedError` and
|
|
15
|
+
* `InvalidStateError` count too (see `CANCEL_NAMES`).
|
|
16
|
+
* 2. The clipboard, where there is no share sheet (most desktop browsers) or the
|
|
17
|
+
* sheet rejected the data itself. The caller shows a visible confirmation; the
|
|
18
|
+
* completed event says `clipboard`.
|
|
19
|
+
* When neither takes the link the tap fails with `share_unavailable`.
|
|
20
|
+
*
|
|
21
|
+
* 🔴 CALLED INSIDE THE CLICK. `navigator.share` and, on Safari, the clipboard need
|
|
22
|
+
* transient user activation, so nothing may be awaited before the first call. An
|
|
23
|
+
* `async` function runs synchronously up to its first `await`, which is what keeps
|
|
24
|
+
* the `navigator.share` call inside the gesture.
|
|
25
|
+
*
|
|
26
|
+
* NEVER THROWS. Every browser call is guarded; the worst outcome is a reported failure.
|
|
27
|
+
*/
|
|
28
|
+
import { type ShareDestinationValue, type ShareFailureReasonValue } from '../analytics/events';
|
|
29
|
+
export type ShareOutcome = {
|
|
30
|
+
status: 'shared';
|
|
31
|
+
destination: ShareDestinationValue;
|
|
32
|
+
} | {
|
|
33
|
+
status: 'cancelled';
|
|
34
|
+
} | {
|
|
35
|
+
status: 'failed';
|
|
36
|
+
reason: ShareFailureReasonValue;
|
|
37
|
+
};
|
|
38
|
+
/** Send `url` through the share sheet, else the clipboard. Resolves; never rejects. */
|
|
39
|
+
export declare function sendShareLink(url: string): Promise<ShareOutcome>;
|
|
40
|
+
/** Receives the three share events. Thrown errors are contained, never surfaced. */
|
|
41
|
+
export interface ShareReporter<C> {
|
|
42
|
+
tapped(ctx: C): void;
|
|
43
|
+
failed(ctx: C, reason: ShareFailureReasonValue): void;
|
|
44
|
+
completed(ctx: C, destination: ShareDestinationValue | undefined, completed: boolean): void;
|
|
45
|
+
}
|
|
46
|
+
export interface ShareAction<C> {
|
|
47
|
+
/**
|
|
48
|
+
* Share `link` for the offer `ctx` describes. Returns null, reporting nothing, when a
|
|
49
|
+
* share is already in flight or the action is locked: a double tap must not stack two
|
|
50
|
+
* share sheets or count one tap twice. Otherwise every call reports `tapped` and then
|
|
51
|
+
* exactly one of `completed` or `failed`, before the returned promise settles.
|
|
52
|
+
*/
|
|
53
|
+
run(link: string | undefined, ctx: C): Promise<ShareOutcome> | null;
|
|
54
|
+
/** Refuse every later call. For a presentation that is closing after a share. */
|
|
55
|
+
lock(): void;
|
|
56
|
+
}
|
|
57
|
+
export declare function createShareAction<C>(reporter: ShareReporter<C>, send?: (url: string) => Promise<ShareOutcome>): ShareAction<C>;
|
|
58
|
+
//# sourceMappingURL=share.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share.d.ts","sourceRoot":"","sources":["../../src/core/share.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC7B,MAAM,qBAAqB,CAAC;AAG7B,MAAM,MAAM,YAAY,GACpB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,WAAW,EAAE,qBAAqB,CAAA;CAAE,GACxD;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,uBAAuB,CAAA;CAAE,CAAC;AAW1D,uFAAuF;AACvF,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAgBtE;AAwDD,oFAAoF;AACpF,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC;IACrB,MAAM,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACtD,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,qBAAqB,GAAG,SAAS,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;CAC7F;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B;;;;;OAKG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IACpE,iFAAiF;IACjF,IAAI,IAAI,IAAI,CAAC;CACd;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,IAAI,GAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAiB,GAC3D,WAAW,CAAC,CAAC,CAAC,CA6ChB"}
|
|
@@ -20,6 +20,9 @@ export declare function normalizeUnlockCode(raw: unknown): string;
|
|
|
20
20
|
* an offer states a reward value. Only a short money amount is accepted, never free text.
|
|
21
21
|
*/
|
|
22
22
|
export declare function unlockValueAmount(raw: unknown): string | null;
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Does `code` unlock the offers? Placeholder: yes, for any non-empty code. A real check must
|
|
25
|
+
* always settle: with `dismissible: false` the code screen has no other way out.
|
|
26
|
+
*/
|
|
24
27
|
export declare function checkUnlockCode(code: string): Promise<UnlockCodeVerdict>;
|
|
25
28
|
//# sourceMappingURL=unlockCode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unlockCode.d.ts","sourceRoot":"","sources":["../../src/core/unlockCode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,MAAM,MAAM,iBAAiB,GACzB;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE;AACd,8EAA8E;GAC5E;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,OAAO,GAAG,UAAU,CAAA;CAAE,CAAC;AAEhD,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAGxD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAQ7D;AAED
|
|
1
|
+
{"version":3,"file":"unlockCode.d.ts","sourceRoot":"","sources":["../../src/core/unlockCode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,MAAM,MAAM,iBAAiB,GACzB;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE;AACd,8EAA8E;GAC5E;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,OAAO,GAAG,UAAU,CAAA;CAAE,CAAC;AAEhD,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAGxD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAQ7D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAExE"}
|
package/types/core/version.d.ts
CHANGED
package/types/types.d.ts
CHANGED
|
@@ -172,6 +172,73 @@ export interface AppearanceConfig {
|
|
|
172
172
|
dotColor?: string;
|
|
173
173
|
/** Active-page colour for the same indicator. See {@link AppearanceConfig.dotColor}. */
|
|
174
174
|
dotActiveColor?: string;
|
|
175
|
+
/**
|
|
176
|
+
* The `codeUnlock` landing page's look: fonts, colours, the button, the header logo
|
|
177
|
+
* and the "How it works" icons. Ignored by every other surface. See
|
|
178
|
+
* {@link CodeUnlockAppearance}.
|
|
179
|
+
*/
|
|
180
|
+
codeUnlock?: CodeUnlockAppearance;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* How the `codeUnlock` landing page looks, for a publisher whose page should wear its
|
|
184
|
+
* own brand. EVERY FIELD IS OPTIONAL, and a field left out keeps the default look.
|
|
185
|
+
*
|
|
186
|
+
* The colours and heading font carry on to the offers once the code is accepted, so the
|
|
187
|
+
* page keeps one look across the unlock.
|
|
188
|
+
*
|
|
189
|
+
* Colours and font stacks go through the same allow-list as the rest of
|
|
190
|
+
* {@link AppearanceConfig}: a value it refuses is dropped with a warning and that one
|
|
191
|
+
* field keeps its default. Images must be absolute https URLs (http only on localhost);
|
|
192
|
+
* an image that is refused or fails to load keeps what it replaced.
|
|
193
|
+
*
|
|
194
|
+
* Fonts are not loaded by the SDK. Declare them on the page (`@font-face`) and name them
|
|
195
|
+
* here.
|
|
196
|
+
*/
|
|
197
|
+
export interface CodeUnlockAppearance {
|
|
198
|
+
/** The page's body text, as a CSS font stack. */
|
|
199
|
+
fontFamily?: string;
|
|
200
|
+
/** The headings, the button and the step titles, as a CSS font stack. */
|
|
201
|
+
headingFontFamily?: string;
|
|
202
|
+
/**
|
|
203
|
+
* The weight of everything in `headingFontFamily`: the headings, the buttons and the
|
|
204
|
+
* step titles. A keyword or a number from 1 to 1000.
|
|
205
|
+
*/
|
|
206
|
+
headingFontWeight?: string | number;
|
|
207
|
+
/** The headings and the main text. */
|
|
208
|
+
textColor?: string;
|
|
209
|
+
/** The secondary text: the line under the heading, the notes and the step details. */
|
|
210
|
+
mutedTextColor?: string;
|
|
211
|
+
/** The field's focus ring, the "unlocked" badge and the selected offer. */
|
|
212
|
+
accentColor?: string;
|
|
213
|
+
/** The light tint behind the page's top corner and the badge. */
|
|
214
|
+
tintColor?: string;
|
|
215
|
+
/** A plain page background, in place of the default tinted wash. */
|
|
216
|
+
backgroundColor?: string;
|
|
217
|
+
/**
|
|
218
|
+
* The code button's fill: one colour, or two for a left-to-right gradient
|
|
219
|
+
* (`['#00BDF4', '#00CFA7']`). A refused colour drops the whole gradient. The claim
|
|
220
|
+
* button on the unlocked offers takes the same fill, text colour and font.
|
|
221
|
+
*/
|
|
222
|
+
ctaBackground?: string | readonly [string, string];
|
|
223
|
+
/** The code button's text colour. */
|
|
224
|
+
ctaTextColor?: string;
|
|
225
|
+
/** The code button's label, in place of "Unlock my rewards". Blank is absent. */
|
|
226
|
+
ctaText?: string;
|
|
227
|
+
/** `'pill'` rounds the code field and its button fully. Default `'rounded'`. */
|
|
228
|
+
shape?: 'rounded' | 'pill';
|
|
229
|
+
/**
|
|
230
|
+
* A logo image for the page's header, in place of the app's icon and name. Shown at
|
|
231
|
+
* 32px tall, at its own proportions.
|
|
232
|
+
*/
|
|
233
|
+
logoUrl?: string;
|
|
234
|
+
/** The logo's alt text. Defaults to the app's name. */
|
|
235
|
+
logoAlt?: string;
|
|
236
|
+
/**
|
|
237
|
+
* An icon for each "How it works" step, in order, in place of its number. With any
|
|
238
|
+
* icon, each step is a card: the icon beside its text below 700px, over it and centred
|
|
239
|
+
* from 700px. A missing or failed icon shows that step's number.
|
|
240
|
+
*/
|
|
241
|
+
stepIconUrls?: readonly string[];
|
|
175
242
|
}
|
|
176
243
|
/**
|
|
177
244
|
* WHY a placement presents — Encore's platform-wide use-case dimension, and the ONLY
|
|
@@ -255,9 +322,10 @@ export interface PlacementOptions {
|
|
|
255
322
|
* rather than disappearing — see `RewardActionsOptions.secondary`. A button
|
|
256
323
|
* reading "No thanks" on a sheet with no way out is a control that lies.
|
|
257
324
|
*
|
|
258
|
-
* The `codeUnlock` code screen
|
|
259
|
-
* Escape
|
|
260
|
-
*
|
|
325
|
+
* The `codeUnlock` code screen follows it too: with `false` it has no ×, and
|
|
326
|
+
* Escape and a backdrop tap do nothing, because on the hosted page it is the
|
|
327
|
+
* page the user landed on. A code that is not accepted keeps the user there
|
|
328
|
+
* with an error and the field editable, never a dead end.
|
|
261
329
|
*/
|
|
262
330
|
dismissible?: boolean;
|
|
263
331
|
/**
|
|
@@ -295,6 +363,26 @@ export interface PlacementOptions {
|
|
|
295
363
|
* every other surface.
|
|
296
364
|
*/
|
|
297
365
|
unlockValueLabel?: string;
|
|
366
|
+
/**
|
|
367
|
+
* An image shown in place of the `codeUnlock` code screen's drawn value card, such as
|
|
368
|
+
* the gift card from the publisher's own email. The heading and the "Unlock up to
|
|
369
|
+
* {amount}" line under it are unchanged. The image is shown as the publisher made it:
|
|
370
|
+
* the SDK does not tilt or animate it, and scales it to the card's width uncropped.
|
|
371
|
+
*
|
|
372
|
+
* It is read by screen readers. Its alt text is `unlockCardImageAlt` when set, else
|
|
373
|
+
* "{amount} gift card" from `unlockValueLabel`, else "Gift card".
|
|
374
|
+
*
|
|
375
|
+
* Must be an absolute https URL (http only on localhost). Any other URL, or an image
|
|
376
|
+
* that fails to load, shows the drawn card instead. Ignored by every other surface.
|
|
377
|
+
*/
|
|
378
|
+
unlockCardImageUrl?: string;
|
|
379
|
+
/**
|
|
380
|
+
* Alt text for `unlockCardImageUrl`, in place of the one derived from
|
|
381
|
+
* `unlockValueLabel`: say what the image shows, such as "$45 gift card value, on us".
|
|
382
|
+
* Trimmed; blank or whitespace-only counts as absent. Ignored without the image, and by
|
|
383
|
+
* every other surface.
|
|
384
|
+
*/
|
|
385
|
+
unlockCardImageAlt?: string;
|
|
298
386
|
}
|
|
299
387
|
/**
|
|
300
388
|
* Presentation callbacks for the bare `Encore.show()` form.
|
|
@@ -482,6 +570,35 @@ export interface EncoreConfig {
|
|
|
482
570
|
* was honoured. Absent for everyone else.
|
|
483
571
|
*/
|
|
484
572
|
demoVariant?: string;
|
|
573
|
+
/**
|
|
574
|
+
* Let a labelled reward placement resolve its own variant. Defaults to `false`.
|
|
575
|
+
*
|
|
576
|
+
* Encore can serve a different reward variant per placement label (for example
|
|
577
|
+
* one flow for `'email_code'` and another for `'email'`). The variant the SDK
|
|
578
|
+
* prefetches at `configure()` is chosen before any placement is known, so it
|
|
579
|
+
* cannot carry that choice. With this on, a `rewardUsers` presentation that has a
|
|
580
|
+
* placement label — `Encore.placement('email_code', { useCase: 'rewardUsers' })`,
|
|
581
|
+
* or `show(options, { useCase: 'rewardUsers' }, 'email_code')` — makes one
|
|
582
|
+
* `GET /config?useCase=post-action-reward&placementId=<label>` before the sheet
|
|
583
|
+
* renders and presents the variant that response names. Analytics for that
|
|
584
|
+
* presentation carry that variant's id.
|
|
585
|
+
*
|
|
586
|
+
* - The label is trimmed and capped at 64 characters, exactly as it is on the
|
|
587
|
+
* offers request and on analytics.
|
|
588
|
+
* - A settled answer is reused for every presentation of that label for the rest
|
|
589
|
+
* of the session (until `reset()`), while a failed or discarded request is
|
|
590
|
+
* retried on the next presentation.
|
|
591
|
+
* - It never blocks or breaks a presentation. If the request fails, is slow, or
|
|
592
|
+
* resolves nothing, the surface resolves exactly as it would with this off:
|
|
593
|
+
* the prefetched variant when there is one, otherwise the SDK's usual
|
|
594
|
+
* on-demand `/config?useCase=` fetch.
|
|
595
|
+
* - Paywall (`reduceChurn`) presentations and unlabelled ones are unaffected.
|
|
596
|
+
*
|
|
597
|
+
* Off, the SDK's requests are exactly what they were before the option existed.
|
|
598
|
+
* Only a literal `true` turns it on. Like the other options it is read from the
|
|
599
|
+
* first `configure()` call.
|
|
600
|
+
*/
|
|
601
|
+
resolveVariantsByPlacement?: boolean;
|
|
485
602
|
}
|
|
486
603
|
/** Result of `show()` / `present()`. */
|
|
487
604
|
export type ShowResult =
|
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,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM/C;;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,EAAE,UAAU,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;CAAE,GAClE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAEzD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M,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"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claim Screen
|
|
3
|
+
*
|
|
4
|
+
* What the user sees between tapping Claim and the advertiser's page, in the
|
|
5
|
+
* `giftPickerPreload` variant: the offer's logo, "Loading your FREE offer" with a
|
|
6
|
+
* spinner, "Finish on {domain}", and up to three of the offer's instruction titles as
|
|
7
|
+
* check rows. The design (Figma node 19575-37963) draws it over the blurred sheet,
|
|
8
|
+
* followed by the advertiser page.
|
|
9
|
+
*
|
|
10
|
+
* WHERE IT RENDERS. The web cannot preload a cross-origin page (most advertisers refuse
|
|
11
|
+
* framing, and a frame loses its cookies), so this screen is what stands in for the
|
|
12
|
+
* blank wait instead:
|
|
13
|
+
* - INTO THE TAB the claim already opened synchronously in the tap gesture. That tab
|
|
14
|
+
* is `about:blank` and same-origin with the opener, so its document is ours to
|
|
15
|
+
* draw in. The browser keeps drawing it until the advertiser page commits, so the
|
|
16
|
+
* user watches this screen, not a white tab, for the whole load.
|
|
17
|
+
* - OVER THE SHEET, when there is no such tab: the popup was blocked, or the page runs
|
|
18
|
+
* in a webview whose `window.open` returns a stand-in handle with no document (the
|
|
19
|
+
* hosted offer page's top-level handoff). Everything else in the sheet, its own x
|
|
20
|
+
* included, is inert underneath, and impressions pause. With a stand-in handle the
|
|
21
|
+
* advertiser page replaces THIS page, so at the hand-off the screen moves off the
|
|
22
|
+
* sheet and stays up until the page unloads. With a blocked popup whose fallback
|
|
23
|
+
* opened a tab after all, it leaves with the sheet.
|
|
24
|
+
*
|
|
25
|
+
* MONEY PATH. This file never requests anything. The only network access is the
|
|
26
|
+
* offer's own logo image, which is already on screen in the sheet. The claim URL is
|
|
27
|
+
* navigated exactly once, by the caller, after the transaction exists.
|
|
28
|
+
*
|
|
29
|
+
* Everything user-facing is set with `textContent` or a guarded `src`: no markup from
|
|
30
|
+
* the offer ever becomes HTML.
|
|
31
|
+
*/
|
|
32
|
+
import type { OfferModel } from '../api/models';
|
|
33
|
+
/** The design's headline. A constant so it can be localized with the rest of the copy. */
|
|
34
|
+
export declare const CLAIM_SCREEN_TITLE = "Loading your FREE offer";
|
|
35
|
+
/** The class the screen carries while it sits inside the sheet; removed when it moves off. */
|
|
36
|
+
export declare const CLAIM_SHEET_CLASS = "encore-claim-root--sheet";
|
|
37
|
+
/** The rows the screen lists: non-blank instruction titles, at most three. */
|
|
38
|
+
export declare function claimScreenRows(offer: OfferModel): string[];
|
|
39
|
+
/**
|
|
40
|
+
* Draw the claim screen into `doc` and return its root. `mode: 'tab'` is the opened
|
|
41
|
+
* `about:blank` tab (a plain white page); `'inPage'` overlays the host page's sheet.
|
|
42
|
+
*/
|
|
43
|
+
export declare function renderClaimScreen(doc: Document, offer: OfferModel, mode: 'tab' | 'inPage', container?: HTMLElement): HTMLElement;
|
|
44
|
+
/**
|
|
45
|
+
* The same-origin document of a tab the claim opened, or null when there is none to
|
|
46
|
+
* draw in: no tab, a cross-origin one, or a stand-in handle (the hosted page's
|
|
47
|
+
* top-level handoff) that has no document at all.
|
|
48
|
+
*/
|
|
49
|
+
export declare function claimTabDocument(tab: Window | null): Document | null;
|
|
50
|
+
/**
|
|
51
|
+
* Add the way out to an in-page claim screen whose transaction is taking too long. Only
|
|
52
|
+
* the in-page screen needs one: a tab has the browser's own close.
|
|
53
|
+
*/
|
|
54
|
+
export declare function addClaimScreenClose(root: HTMLElement, onClose: () => void): HTMLElement;
|
|
55
|
+
/**
|
|
56
|
+
* Whether a claim's window handle is a webview's stand-in (the hosted offer page's
|
|
57
|
+
* top-level handoff), whose navigation replaces THIS page. A stand-in has no `document`
|
|
58
|
+
* property at all. A real window always has one, even a cross-origin one whose
|
|
59
|
+
* `document` throws, so that is never mistaken for a stand-in.
|
|
60
|
+
*/
|
|
61
|
+
export declare function isStandInHandle(handle: Window | null): boolean;
|
|
62
|
+
//# sourceMappingURL=ClaimScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClaimScreen.d.ts","sourceRoot":"","sources":["../../src/ui/ClaimScreen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIhD,0FAA0F;AAC1F,eAAO,MAAM,kBAAkB,4BAA4B,CAAC;AAK5D,8FAA8F;AAC9F,eAAO,MAAM,iBAAiB,6BAAoB,CAAC;AA6BnD,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,CAK3D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,KAAK,GAAG,QAAQ,EACtB,SAAS,CAAC,EAAE,WAAW,GACtB,WAAW,CA2Eb;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,CAapE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,IAAI,GAAG,WAAW,CAWvF;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAQ9D"}
|
package/types/ui/CodeUnlock.d.ts
CHANGED
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
* offers. Every base rule is the finished state; reduced motion swaps at once.
|
|
54
54
|
*/
|
|
55
55
|
import type { OfferModel as Offer } from '../api/models';
|
|
56
|
+
import type { CodeUnlockAppearance } from '../types';
|
|
56
57
|
import { type UnlockCodeVerdict } from '../core/unlockCode';
|
|
57
58
|
/** The code screen's half of the reveal. The stylesheet carries the same number. */
|
|
58
59
|
export declare const CODE_UNLOCK_REVEAL_MS = 450;
|
|
@@ -108,6 +109,12 @@ export interface CodeUnlockOptions {
|
|
|
108
109
|
hostName?: string;
|
|
109
110
|
/** The host app's icon beside that name. */
|
|
110
111
|
hostIconUrl?: string;
|
|
112
|
+
/** An image to show in place of the drawn value card. A failed load draws the card. */
|
|
113
|
+
cardImageUrl?: string;
|
|
114
|
+
/** The image's alt text, in place of the one derived from `valueLabel`. Blank is absent. */
|
|
115
|
+
cardImageAlt?: string;
|
|
116
|
+
/** The publisher's look for the page. See {@link CodeUnlockAppearance}. */
|
|
117
|
+
appearance?: CodeUnlockAppearance;
|
|
111
118
|
/** Called once, when the offers screen is showing. */
|
|
112
119
|
onUnlock?: () => void;
|
|
113
120
|
/** The code check. Tests only: production always uses {@link checkUnlockCode}. */
|
|
@@ -134,6 +141,13 @@ export interface CodeUnlockComposeOptions {
|
|
|
134
141
|
*/
|
|
135
142
|
setLabelledBy?: (id: string) => void;
|
|
136
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* The custom properties a {@link CodeUnlockAppearance} sets on the gate's root, each
|
|
146
|
+
* value through the shared CSS allow-list. A refused value is simply absent, so that
|
|
147
|
+
* property keeps the stylesheet's default. The palette tokens are the picker's own
|
|
148
|
+
* (`--encore-gp-*`), so the offers behind the gate wear the same colours.
|
|
149
|
+
*/
|
|
150
|
+
export declare function codeUnlockStyleVars(appearance: CodeUnlockAppearance | undefined): Record<string, string>;
|
|
137
151
|
export declare class CodeUnlock {
|
|
138
152
|
#private;
|
|
139
153
|
constructor(options?: CodeUnlockOptions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeUnlock.d.ts","sourceRoot":"","sources":["../../src/ui/CodeUnlock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;
|
|
1
|
+
{"version":3,"file":"CodeUnlock.d.ts","sourceRoot":"","sources":["../../src/ui/CodeUnlock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAYH,OAAO,KAAK,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,oBAAoB,CAAC;AAE5B,oFAAoF;AACpF,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,QAA2B,CAAC;AAgB7D,iFAAiF;AACjF,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAKD,oCAAoC;AACpC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;IAiB3B,yEAAyE;;;CAGjE,CAAC;AAEX,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAI3D;AAiBD,MAAM,WAAW,iBAAiB;IAChC,oGAAoG;IACpG,WAAW,C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