@encorekit/web-sdk 2.0.7 → 2.1.1

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.
Files changed (68) hide show
  1. package/README.md +6 -0
  2. package/dist/cjs/index.cjs +1 -1
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/esm/index.js +1 -1
  5. package/dist/esm/index.js.map +1 -1
  6. package/dist/umd/encore.min.js +1 -1
  7. package/dist/umd/encore.min.js.map +1 -1
  8. package/package.json +1 -1
  9. package/types/api/APIClient.d.ts +18 -0
  10. package/types/api/APIClient.d.ts.map +1 -1
  11. package/types/api/generated/types.d.ts +177 -2
  12. package/types/api/generated/types.d.ts.map +1 -1
  13. package/types/api/models.d.ts +32 -0
  14. package/types/api/models.d.ts.map +1 -1
  15. package/types/core/Encore.d.ts.map +1 -1
  16. package/types/core/giftVariant.d.ts +67 -0
  17. package/types/core/giftVariant.d.ts.map +1 -0
  18. package/types/core/version.d.ts +1 -1
  19. package/types/types.d.ts +31 -3
  20. package/types/types.d.ts.map +1 -1
  21. package/types/ui/GiftHero.d.ts +75 -0
  22. package/types/ui/GiftHero.d.ts.map +1 -0
  23. package/types/ui/GiftList.d.ts +110 -0
  24. package/types/ui/GiftList.d.ts.map +1 -0
  25. package/types/ui/GiftReveal.d.ts +133 -0
  26. package/types/ui/GiftReveal.d.ts.map +1 -0
  27. package/types/ui/GiftSheet.d.ts +126 -0
  28. package/types/ui/GiftSheet.d.ts.map +1 -0
  29. package/types/ui/GiftUnwrap.d.ts +155 -0
  30. package/types/ui/GiftUnwrap.d.ts.map +1 -0
  31. package/types/ui/OfferCarousel.d.ts +10 -3
  32. package/types/ui/OfferCarousel.d.ts.map +1 -1
  33. package/types/ui/OfferModal.d.ts +7 -0
  34. package/types/ui/OfferModal.d.ts.map +1 -1
  35. package/types/ui/RewardActions.d.ts +88 -4
  36. package/types/ui/RewardActions.d.ts.map +1 -1
  37. package/types/ui/RewardCard.d.ts +16 -8
  38. package/types/ui/RewardCard.d.ts.map +1 -1
  39. package/types/ui/RewardConfetti.d.ts +23 -1
  40. package/types/ui/RewardConfetti.d.ts.map +1 -1
  41. package/types/ui/RewardLayout.d.ts +35 -0
  42. package/types/ui/RewardLayout.d.ts.map +1 -1
  43. package/types/ui/advertiserPreconnect.d.ts +90 -0
  44. package/types/ui/advertiserPreconnect.d.ts.map +1 -0
  45. package/types/ui/appearance.d.ts +27 -0
  46. package/types/ui/appearance.d.ts.map +1 -1
  47. package/types/ui/focusable.d.ts +41 -0
  48. package/types/ui/focusable.d.ts.map +1 -0
  49. package/types/ui/giftCategoryGroups.d.ts +21 -0
  50. package/types/ui/giftCategoryGroups.d.ts.map +1 -0
  51. package/types/ui/giftCopy.d.ts +215 -0
  52. package/types/ui/giftCopy.d.ts.map +1 -0
  53. package/types/ui/giftUnwrapArt.d.ts +55 -0
  54. package/types/ui/giftUnwrapArt.d.ts.map +1 -0
  55. package/types/ui/giftUnwrapCopy.d.ts +57 -0
  56. package/types/ui/giftUnwrapCopy.d.ts.map +1 -0
  57. package/types/ui/impressionGate.d.ts +63 -0
  58. package/types/ui/impressionGate.d.ts.map +1 -0
  59. package/types/ui/offerBadge.d.ts +56 -0
  60. package/types/ui/offerBadge.d.ts.map +1 -0
  61. package/types/ui/rewardSurface.d.ts +82 -0
  62. package/types/ui/rewardSurface.d.ts.map +1 -0
  63. package/types/ui/safeImageSrc.d.ts +10 -0
  64. package/types/ui/safeImageSrc.d.ts.map +1 -1
  65. package/types/ui/styles.d.ts +166 -0
  66. package/types/ui/styles.d.ts.map +1 -1
  67. package/types/ui/termsLine.d.ts +33 -0
  68. package/types/ui/termsLine.d.ts.map +1 -0
@@ -0,0 +1,67 @@
1
+ /**
2
+ * WHICH SERVED VARIANT GETS WHICH GIFT SURFACE.
3
+ *
4
+ * The gift flows are CUSTOM SURFACES FOR ONE PUBLISHER, not a platform change. Every
5
+ * other `rewardUsers` publisher keeps the paged `OfferCarousel` exactly as before, so
6
+ * the selector cannot be the use case — it has to be the variant the backend serves,
7
+ * which is the same per-app machinery `streaksCarousel` already rides
8
+ * (`GET /publisher/sdk/v1/config` → `ui.variantName`).
9
+ *
10
+ * THREE NAMES, EACH ITS OWN SURFACE. `giftReveal` is the name in the approved Backend
11
+ * Change Report (the box that opens onto a short radio group). `giftList` and
12
+ * `giftUnwrap` are the two later designs (a selectable list under a hero image, and a
13
+ * closed box that unwraps onto a "your gift is ready" screen). The names are fixed:
14
+ * they are what the `variants` rows will be called and what the config endpoint will
15
+ * serve as `selectedVariant.name`. They sit beside the shipped variants
16
+ * (bundleFraming, control, customHeadlineControl, featuredOfferCarousel,
17
+ * fullscreenVerticalLayout, fullScreenWithBundleTags, iapFirstThankYouOffers,
18
+ * offerwallWithIAPAndOffers, reasonBasedRecovery, streaksCarousel, thankyouOffers,
19
+ * tillFinancial, verticalListAsyncAdvertiser) rather than replacing any of them.
20
+ *
21
+ * A NAME CAN RESOLVE AHEAD OF ITS SURFACE. The resolver says which surface a variant
22
+ * ASKS for; `Encore` decides whether that surface exists in this build. A kind with no
23
+ * surface yet renders the carousel, so resolving a name here is never on its own a
24
+ * switch of anyone's sheet.
25
+ *
26
+ * 🔴 SAFE TO SHIP AHEAD OF THE ROWS, and that is the fail-safe direction working, not
27
+ * a gap. Until a variant with one of these names exists AND is activated for an app,
28
+ * nothing serves that name: `rewardSurfaceKind` returns null for every publisher,
29
+ * including PayRange, and every one of them keeps the existing `OfferCarousel`. The
30
+ * day a row is activated is the day its surface turns on, for exactly the apps it is
31
+ * activated for, with no SDK release in between.
32
+ *
33
+ * WHY AN ALLOWLIST RATHER THAN A FLAG ON THE VARIANT: nothing in the served payload
34
+ * says "this variant wants a bespoke web surface", and adding such a field is a
35
+ * backend contract change. Matching on the name keeps the decision in one place in
36
+ * this SDK, visible in review, and costs one string per surface.
37
+ */
38
+ /** The bespoke reward surfaces a served variant can ask for. */
39
+ export type RewardSurfaceKind = 'giftReveal' | 'giftList' | 'giftUnwrap';
40
+ /**
41
+ * Exact served variant name → the surface it asks for. The ONLY way into any gift
42
+ * surface: a name missing from this table is the carousel.
43
+ *
44
+ * Frozen as well as typed readonly, because this is a routing allowlist and a
45
+ * `Readonly` type stops a mutation in TypeScript only.
46
+ */
47
+ export declare const REWARD_VARIANT_TABLE: Readonly<Record<string, RewardSurfaceKind>>;
48
+ /**
49
+ * Which bespoke surface the served variant asks for, or null for the carousel.
50
+ *
51
+ * ABSENT, NULL, UNKNOWN AND EMPTY ALL MEAN NULL. A name only arrives in a backend
52
+ * response for the app (the eager `/config` block, or the lazy `?useCase=` fetch Encore
53
+ * awaits when the eager one is slower than `DISPLAY_CONFIG_WAIT_MS`). When neither
54
+ * resolves one, there is no name, and the publisher must get the surface they already
55
+ * had rather than one they never opted into — so the only way to reach a gift surface
56
+ * is an explicit, positive, EXACT match: no trimming, no case folding, no prefix.
57
+ */
58
+ export declare function rewardSurfaceKind(variantName: string | null | undefined,
59
+ /**
60
+ * The table to match against. Injectable so the matching rule can be exercised
61
+ * independently of what the shipped table holds: a test that only ever used the real
62
+ * one would stop distinguishing exact matching from prefix, trimmed or
63
+ * case-insensitive matching the moment the shipped table changed shape. Production
64
+ * callers pass one argument.
65
+ */
66
+ table?: Readonly<Record<string, RewardSurfaceKind>>): RewardSurfaceKind | null;
67
+ //# sourceMappingURL=giftVariant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"giftVariant.d.ts","sourceRoot":"","sources":["../../src/core/giftVariant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,gEAAgE;AAChE,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,UAAU,GAAG,YAAY,CAAC;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAI3E,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"}
@@ -1,3 +1,3 @@
1
1
  /** SDK version — single source of truth (also kept in sync with package.json via scripts/update-version.sh) */
2
- export declare const SDK_VERSION = "2.0.7";
2
+ export declare const SDK_VERSION = "2.1.1";
3
3
  //# sourceMappingURL=version.d.ts.map
package/types/types.d.ts CHANGED
@@ -145,13 +145,32 @@ export interface AppearanceConfig {
145
145
  headline?: TextSlot;
146
146
  /** The line under the heading. Same three forms. */
147
147
  subheadline?: TextSlot;
148
- /** The "Claim gift" CTA. The SDK keeps the claim action — see the interface docs. */
148
+ /**
149
+ * The claim CTA. The SDK keeps the claim action — see the interface docs.
150
+ *
151
+ * ON THE GIFT VARIANT its shipped copy NAMES the selected gift ("Claim 1 month of
152
+ * Apple Music") and re-words as the selection changes. Every other reward publisher
153
+ * is on the carousel, where it stays the generic "Claim gift" — this is scoped to
154
+ * the served variant, like the surface itself. A style config's own `text`, and any
155
+ * element or renderer you supply, still win outright on both: the SDK never rewrites
156
+ * copy a publisher wrote.
157
+ */
149
158
  claimButton?: ButtonSlot;
150
159
  /** The "No thanks" decline button. The SDK keeps the decline action. */
151
160
  declineButton?: ButtonSlot;
152
- /** The page indicator's inactive dots. */
161
+ /**
162
+ * Colours for the reward carousel's page indicator.
163
+ *
164
+ * LIVE, and not deprecated. They were briefly documented as inert while the gift
165
+ * flow replaced the reward carousel for every publisher; that flow is scoped to one
166
+ * served variant now, so the carousel — and its indicator — is what almost every
167
+ * reward publisher still renders.
168
+ *
169
+ * They have no effect on the GIFT surface alone, which puts every gift on screen at
170
+ * once and pages nothing, so it has no indicator to colour.
171
+ */
153
172
  dotColor?: string;
154
- /** The page indicator's active dot. */
173
+ /** Active-page colour for the same indicator. See {@link AppearanceConfig.dotColor}. */
155
174
  dotActiveColor?: string;
156
175
  }
157
176
  /**
@@ -399,6 +418,15 @@ export interface EncoreConfig {
399
418
  * see docs/architecture/platform-divergence/web.md.
400
419
  */
401
420
  unlockMode?: 'strict' | 'optimistic';
421
+ /**
422
+ * The user's id when it is already known at load time (a login, or the `userId` on
423
+ * a hosted offer link). Applied BEFORE the SDK's first request, so the `/config`
424
+ * that assigns experiment arms runs as this user rather than as an anonymous id it
425
+ * then abandons. An anonymous id this browser stored earlier is aliased to it,
426
+ * exactly as `identify()` does. Trimmed; blank is ignored. `identify()` still works
427
+ * for a login that happens later.
428
+ */
429
+ userId?: string;
402
430
  }
403
431
  /** Result of `show()` / `present()`. */
404
432
  export type ShowResult =
@@ -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;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,aAAa,GAAG,KAAK,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK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;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,75 @@
1
+ /**
2
+ * Gift hero — the box that opens.
3
+ *
4
+ * The lid and bow fly up and off while the chosen gifts rise out of the box behind
5
+ * them, and a confetti burst fires from the opening. It is the one moment in the
6
+ * reward sheet that is pure delight rather than information, and it is the reason the
7
+ * flow reads as a gift instead of an ad unit.
8
+ *
9
+ * NOT a renderer, the same way `RewardCard` is not: web has no SDUI engine, so every
10
+ * dimension below is read off the design by hand and tracked here.
11
+ *
12
+ * box 270×236 stage; back 138×60 @ (66,112), front 150×90 @ (60,134)
13
+ * lid 170×26 @ (50,118), flies to (+6,-170) rotate -14deg over .55s
14
+ * bow 100×36 @ (85,98), rides the lid
15
+ * tiles 64×64 (centre tile 78×78), rise to (-74,-88) / (-7,-126) / (72,-88)
16
+ * confetti bursts from the mouth of the box
17
+ *
18
+ * ALL MOTION IS CSS. The SDK ships zero runtime dependencies and this is a decorative
19
+ * flourish on a sheet that must never be the reason a publisher's page janks — so the
20
+ * whole animation is four keyframes and a class toggle, and the only JavaScript is the
21
+ * toggle itself. The single canvas is `RewardConfetti`, which the reward sheet already
22
+ * ships; this hero reuses it with a burst origin rather than introducing a second one.
23
+ *
24
+ * `prefers-reduced-motion` is handled in the stylesheet, not here: the reduced-motion
25
+ * block places the lid, bow and tiles directly in their final state, so the hero still
26
+ * shows an OPEN box with the gifts out of it rather than a closed box that never
27
+ * opens. The confetti skips itself — see `RewardConfetti.shouldSkip`.
28
+ */
29
+ import type { OfferModel as Offer } from '../api/models';
30
+ /**
31
+ * How many gifts the box can show at once.
32
+ *
33
+ * Three is the design, and it is also the honest ceiling: the tiles are hand-placed at
34
+ * three fixed positions because a generic fan-out would need layout maths for a shape
35
+ * that is never asked for. A fourth offer does not go in the box — it goes in the
36
+ * "other gifts" sheet, which is exactly what that sheet is for.
37
+ */
38
+ export declare const HERO_TILE_LIMIT = 3;
39
+ export declare class GiftHero {
40
+ #private;
41
+ /**
42
+ * Build the closed box with `offers` inside it. Renders at most
43
+ * {@link HERO_TILE_LIMIT} tiles; the rest of the offers live in the sheet.
44
+ *
45
+ * `aria-hidden` throughout: everything the hero depicts is stated in text directly
46
+ * below it, so announcing the tiles as well would make a screen reader read the
47
+ * whole gift list twice before reaching the radio group that actually selects one.
48
+ */
49
+ render(offers: readonly Offer[]): HTMLElement;
50
+ /**
51
+ * Re-point the tiles at a new set of gifts, without re-opening the box.
52
+ *
53
+ * Promotion swaps a gift out of the rows and one in from the sheet, and the hero
54
+ * depicts exactly those rows — so leaving it alone would show a brand that is no
55
+ * longer selectable while hiding the one the user just chose.
56
+ *
57
+ * Only the tile's CONTENTS change. The tile elements keep their positions, their
58
+ * finished rise transforms and the running bob, so this is a quiet swap rather than
59
+ * a second unboxing: the box has already opened and should not appear to re-open.
60
+ */
61
+ updateTiles(offers: readonly Offer[]): void;
62
+ /**
63
+ * Open the box.
64
+ *
65
+ * Deferred one frame because the sheet is still detached when the caller composes it,
66
+ * and an animation started on a node with no layout box begins mid-flight — the lid
67
+ * would already be gone by the time the sheet is visible.
68
+ *
69
+ * Guarded end to end: this is decoration on someone else's page, and a hero that
70
+ * throws would take the whole reward presentation down with it.
71
+ */
72
+ play(): void;
73
+ destroy(): void;
74
+ }
75
+ //# sourceMappingURL=GiftHero.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GiftHero.d.ts","sourceRoot":"","sources":["../../src/ui/GiftHero.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;AA6BzD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,IAAI,CAAC;AAwBjC,qBAAa,QAAQ;;IAanB;;;;;;;OAOG;IACH,MAAM,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,WAAW;IAmC7C;;;;;;;;;;OAUG;IACH,WAAW,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,IAAI;IAgF3C;;;;;;;;;OASG;IACH,IAAI,IAAI,IAAI;IA4GZ,OAAO,IAAI,IAAI;CAahB"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Gift list — the `giftList` reward surface (Figma "hypothesis 3", node 19796:48052).
3
+ *
4
+ * Top to bottom, inside the reward chrome: "{app icon} Presents" above the headline
5
+ * ({@link GiftList.renderHero}), then this surface — the SELECTED offer's artwork, up
6
+ * to three selectable rows with the selected one expanded to show its description, and
7
+ * "Show more gifts" when there are more — then the action block Encore composes: one
8
+ * CTA that names the selection, and the shared terms line under it.
9
+ *
10
+ * 🔴 SCOPED TO ONE VARIANT. Reached only when the backend serves `giftList` for a
11
+ * `rewardUsers` presentation (see `core/giftVariant.ts`); every other publisher keeps
12
+ * the carousel, and `giftReveal` keeps its box.
13
+ *
14
+ * ## What it shares with GiftReveal, and what it does not
15
+ *
16
+ * The SELECTION MODEL is the same one, deliberately: `#selectedIndex` indexes the FULL
17
+ * offer array, and a gift picked from the sheet is PROMOTED into the rows rather than
18
+ * tracked beside them, so the screen and the CTA can never disagree about what will be
19
+ * claimed. The sheet itself is literally the same code (`GiftSheet`). The rows, the
20
+ * artwork and the motion are this design's own, and share no element with the box.
21
+ *
22
+ * ## What the design shows that this does not build
23
+ *
24
+ * - The "Most claimed" pill on one row. There is no popularity, claim-count or
25
+ * ranking field anywhere in the offer contract (`api/models.ts`), so which row would
26
+ * carry it cannot be known. It waits on a real field.
27
+ * - The three-card fan behind the headline. The design draws Disney's multi-title art
28
+ * as three posters; an offer carries ONE `imageUrl`, so one image is shown, sized as
29
+ * the fan's centre card. Duplicating it into side cards would picture three titles
30
+ * the offer never named.
31
+ * - A grey ring on unselected rows. SPEC.md describes one; the frame render has none
32
+ * (sampled: white where the ring would be), and the frame is the source of truth.
33
+ *
34
+ * ## Events
35
+ *
36
+ * `offerView` once per offer the impression gate judges shown (a row, a promoted row, a
37
+ * sheet card while the sheet is open), `offerSelect` on every selection change including the
38
+ * initial auto-selection from inside `render()`, `offerClaim` only from a user gesture
39
+ * reaching {@link GiftList.claimSelected}. Nothing else — never `scroll` or `complete`.
40
+ * Every payload's `index` indexes the array Encore passed in.
41
+ */
42
+ import type { OfferModel as Offer } from '../api/models';
43
+ import type { RewardSurface, RewardSurfaceEventMap } from './rewardSurface';
44
+ import { ImpressionGate } from './impressionGate';
45
+ /** How many gifts are shown as rows. The rest go behind "Show more gifts". */
46
+ export declare const GIFT_LIST_ROW_LIMIT = 3;
47
+ /**
48
+ * The artwork cross-fade on a selection change, matching the CSS animation duration.
49
+ * The outgoing image is removed on a timer of this length rather than on
50
+ * `animationend`, which never fires when the animation does not run (reduced motion,
51
+ * a hidden tab, an environment with no layout engine) and would strand it on screen.
52
+ */
53
+ export declare const ART_FADE_MS = 200;
54
+ export interface GiftListOptions {
55
+ /**
56
+ * Whether claiming is switched on. `false` keeps the sheet's CTA inert, matching the
57
+ * main CTA — the gate is the SDK's, so every control that can start a claim honours it.
58
+ */
59
+ claimEnabled?: boolean;
60
+ /** The host app's icon (`/config` `ui.values.media.appstoreIcon`), for "Presents". */
61
+ hostIconUrl?: string;
62
+ /** The host app's name, the icon's accessible text. */
63
+ hostName?: string;
64
+ /**
65
+ * The presentation's impression gate (see `impressionGate.ts`): rows and sheet cards
66
+ * report `offerView` only once it judges them shown. Without one the surface owns an
67
+ * unarmed gate, which never fires.
68
+ */
69
+ impressions?: ImpressionGate;
70
+ }
71
+ export declare class GiftList implements RewardSurface {
72
+ #private;
73
+ constructor(offers: readonly Offer[], options?: GiftListOptions);
74
+ on<E extends keyof RewardSurfaceEventMap>(event: E, handler: (payload: RewardSurfaceEventMap[E]) => void): () => void;
75
+ getTotalOffers(): number;
76
+ getCurrentIndex(): number;
77
+ getSelectedOffer(): Offer | undefined;
78
+ /** True when there is anything left to put behind "Show more gifts". */
79
+ hasMoreGifts(): boolean;
80
+ /**
81
+ * "{host app icon} Presents", the row above the headline.
82
+ *
83
+ * Separate from {@link render} because it belongs ABOVE the chrome's headline and the
84
+ * rows belong below it — see `RewardLayoutOptions.hero`. Returns `undefined` when the
85
+ * host has no usable icon: the icon is the subject of "Presents", and the word alone
86
+ * says nothing. The icon is the HOST's, from config; it is never rotated (the design
87
+ * tilts its placeholder 9°, which would be restyling a publisher's brand mark).
88
+ */
89
+ renderHero(): HTMLElement | undefined;
90
+ render(): HTMLElement;
91
+ /**
92
+ * Select the offer at `index` — an index into the full offer array.
93
+ *
94
+ * Out-of-range indices are IGNORED rather than clamped: silently claiming a
95
+ * neighbouring advertiser's offer would hide a caller's bug behind a real transaction.
96
+ */
97
+ selectOffer(index: number): void;
98
+ /** Move to the next offer, wrapping. Present for API parity with the carousel. */
99
+ next(): void;
100
+ /**
101
+ * Claim the SELECTED offer — the single claim path, whichever control started it.
102
+ * Honours the host's claim switch here as well as on the buttons, so a programmatic
103
+ * call cannot claim what a disabled control could not.
104
+ */
105
+ claimSelected(): void;
106
+ openSheet(opener?: HTMLElement): void;
107
+ closeSheet(): void;
108
+ destroy(): void;
109
+ }
110
+ //# sourceMappingURL=GiftList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GiftList.d.ts","sourceRoot":"","sources":["../../src/ui/GiftList.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,eAAe,CA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* Gift reveal — the `rewardUsers` selection surface.
3
+ *
4
+ * Replaces the paged card carousel for the reward composition: the box opens, the
5
+ * gifts come out of it, and the user picks one from a short radio group with a CTA
6
+ * that names what they picked. Everything that did not fit in the box lives behind
7
+ * "Other gifts".
8
+ *
9
+ * 🔴 SCOPED TO `rewardUsers`. `reduceChurn` keeps `OfferCarousel` untouched — it is a
10
+ * different surface with its own per-card claim funnel and its own NCL experiment
11
+ * wiring, and nothing here is reachable from it.
12
+ *
13
+ * ## Why this is not a mode on OfferCarousel
14
+ *
15
+ * The same reason `RewardCard` is not a flag on `OfferCard`. A carousel is one card at
16
+ * a time with paging, scroll settling, impression dedup on rest, an
17
+ * IntersectionObserver for its vertical mode and a listbox for its horizontal one.
18
+ * This is a static list of three rows, all on screen, all impressed at once, with no
19
+ * scrolling of any kind. They share no element and no state machine, and expressing
20
+ * both in one class would be a component that renders two unrelated surfaces with the
21
+ * churn funnel one boolean away from the reward one.
22
+ *
23
+ * ## Selection has exactly one source
24
+ *
25
+ * `#selectedIndex`, an index into the FULL offer array — including offers currently
26
+ * behind the sheet. Picking a gift from the sheet PROMOTES it into the visible rows
27
+ * rather than tracking a second selection beside them, because two selections is
28
+ * precisely the shape that shipped a CTA claiming a different offer from the one the
29
+ * screen showed (the artifact this tracks has that bug: its sheet keeps `sheetSel`
30
+ * alongside the row selection, and the two disagree on screen).
31
+ *
32
+ * ## Events
33
+ *
34
+ * Emits the subset of `OfferCarousel`'s event map the reward path consumes —
35
+ * `offerClaim`, `offerSelect`, `offerView` — with identical payloads, so the claim
36
+ * funnel, the transaction creation and the `use_case`-stamped analytics in `Encore.ts`
37
+ * are reached through exactly one path whichever surface rendered. It never emits
38
+ * `scroll` (nothing scrolls) or `complete` (there is no last card to decline).
39
+ *
40
+ * ⚠️ IMPRESSION GRAIN DIFFERS FROM THE CAROUSEL, and that is the honest reading. The
41
+ * carousel emits one `offerView` per card it settles on; this surface shows every
42
+ * visible row at once, so each row reports once the impression gate judges it shown
43
+ * (sheet visible, tab visible, half on screen). Sheet cards report the same way, and
44
+ * only while the sheet is open.
45
+ */
46
+ import type { OfferModel as Offer } from '../api/models';
47
+ import { SHEET_CLOSE_MS } from './GiftSheet';
48
+ import type { RewardSurface, RewardSurfaceEventMap } from './rewardSurface';
49
+ import { ImpressionGate } from './impressionGate';
50
+ /** How many gifts are shown as rows. The rest go behind "Other gifts". */
51
+ export declare const GIFT_ROW_LIMIT = 3;
52
+ /** Re-exported: the sheet moved to `GiftSheet`, and this is where its tests import it from. */
53
+ export { SHEET_CLOSE_MS };
54
+ export interface GiftRevealOptions {
55
+ /**
56
+ * Whether claiming is switched on. `false` disables the sheet's own CTA, matching
57
+ * what `RewardActions` does to the main one — the gate is the SDK's, so every
58
+ * control that can start a claim has to honour it, not just the visible one.
59
+ */
60
+ claimEnabled?: boolean;
61
+ /**
62
+ * The trust line repeated at the foot of the sheet.
63
+ *
64
+ * Passed in by the caller so it is literally the SAME value the main surface's
65
+ * action block receives — the two are one decision made once, not two defaults that
66
+ * happen to agree. The fallback is now that same string rather than a second
67
+ * constant that has to be kept in step with it.
68
+ *
69
+ * 🔴 THE FALLBACK CLAIMS NOTHING, AND IT CANNOT BE DERIVED. Every other fine print
70
+ * in this SDK is chosen per offer from `badgeLabel` — `isKnownFreeTrial` picks
71
+ * `GIFT_COPY.finePrint`, everything else gets `REWARD_COPY.trustUnknown` — but this
72
+ * line sits at the foot of a LIST. The sheet holds every gift that did not fit, one
73
+ * row can be a free trial and the next a paid discount, and the sheet's own CTA is
74
+ * "Continue" rather than a claim, so there is no single offer whose badge could
75
+ * decide the sentence. The badge route is unavailable here for that reason, not
76
+ * because the data is missing.
77
+ *
78
+ * It used to default to `GIFT_COPY.finePrint` — "FREE trial. You can cancel
79
+ * anytime." — over exactly that mixed list: the same false claim `ui/offerBadge.ts`
80
+ * exists to remove, asserted over more offers at once. The default is now the line
81
+ * that holds whatever the terms turn out to be.
82
+ */
83
+ trustText?: string;
84
+ /**
85
+ * The presentation's impression gate (see `impressionGate.ts`): rows and sheet cards
86
+ * report `offerView` only once it judges them shown. Without one the surface owns an
87
+ * unarmed gate, which never fires.
88
+ */
89
+ impressions?: ImpressionGate;
90
+ }
91
+ export declare class GiftReveal implements RewardSurface {
92
+ #private;
93
+ constructor(offers: readonly Offer[], options?: GiftRevealOptions);
94
+ on<E extends keyof RewardSurfaceEventMap>(event: E, handler: (payload: RewardSurfaceEventMap[E]) => void): () => void;
95
+ getTotalOffers(): number;
96
+ getCurrentIndex(): number;
97
+ getSelectedOffer(): Offer | undefined;
98
+ /** True when there is anything left to put behind "Other gifts". */
99
+ hasMoreGifts(): boolean;
100
+ /**
101
+ * The opening box, as its own element.
102
+ *
103
+ * Separate from {@link render} because the hero belongs ABOVE the sheet's headline
104
+ * and the rows belong below it — see `RewardLayoutOptions.hero`. Call this first;
105
+ * `render()` is what starts the animation, once both halves exist.
106
+ */
107
+ renderHero(): HTMLElement;
108
+ render(): HTMLElement;
109
+ /**
110
+ * Select the offer at `index` — an index into the full offer array.
111
+ *
112
+ * Out-of-range indices are IGNORED rather than clamped: a caller asking for an offer
113
+ * that does not exist has a bug, and silently claiming a neighbouring advertiser's
114
+ * offer instead would hide it behind a real transaction.
115
+ */
116
+ selectOffer(index: number): void;
117
+ /** Move to the next offer, wrapping. Present for API parity with the carousel. */
118
+ next(): void;
119
+ /**
120
+ * Claim the SELECTED offer — the single claim path, whichever control started it.
121
+ *
122
+ * Honours the host's claim switch here as well as on the buttons, so a programmatic
123
+ * call cannot claim what a disabled control could not. Otherwise mirrors
124
+ * `OfferCarousel.claimSelected`, including the warn-and-ignore on an empty
125
+ * selection: an offers array that arrived empty must not produce a transaction for
126
+ * `undefined`.
127
+ */
128
+ claimSelected(): void;
129
+ openSheet(opener?: HTMLElement): void;
130
+ closeSheet(): void;
131
+ destroy(): void;
132
+ }
133
+ //# sourceMappingURL=GiftReveal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GiftReveal.d.ts","sourceRoot":"","sources":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;;OAQG;IACH,aAAa,IAAI,IAAI;IA8CrB,SAAS,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI;IAKrC,UAAU,IAAI,IAAI;IAIlB,OAAO,IAAI,IAAI;CAahB"}
@@ -0,0 +1,126 @@
1
+ /**
2
+ * The "other gifts" sheet, shared by the gift surfaces.
3
+ *
4
+ * Extracted from `GiftReveal` when `GiftList` needed the same sheet: a scrim, a
5
+ * bottom sheet holding every gift the surface's rows could not fit, a CTA that names
6
+ * the pick, and the focus, Escape and Tab containment that make it safe to put over a
7
+ * claim CTA. Both surfaces render the same DOM through this class, so the sheet's
8
+ * guarantees are written and tested once.
9
+ *
10
+ * WHAT STAYS WITH THE SURFACE. The sheet owns no selection. It asks the surface which
11
+ * offers it lists (`listed`), registers its cards for impressions while open, and hands the
12
+ * committed pick back (`onCommit`); the surface promotes, selects and claims. That is
13
+ * what keeps each surface's "selection has exactly one source" rule intact: the sheet
14
+ * holds a PICK only until its CTA is pressed, and a pick is not a selection.
15
+ *
16
+ * WHAT DIFFERS PER SURFACE is only the line under the sheet's CTA, so it is a builder:
17
+ * `GiftReveal` repeats its trust line, `GiftList` shows the shared terms line.
18
+ */
19
+ import type { OfferModel as Offer } from '../api/models';
20
+ import type { ImpressionGate } from './impressionGate';
21
+ import type { GiftCategoryGroup } from './giftCategoryGroups';
22
+ /**
23
+ * How long the sheet takes to slide away, matching its CSS `transition` duration.
24
+ * Exported so a test can wait exactly as long as the stylesheet does rather than
25
+ * guessing, and so the two cannot drift apart silently.
26
+ */
27
+ export declare const SHEET_CLOSE_MS = 300;
28
+ /**
29
+ * Guarded `prefers-reduced-motion`. Mirrors `RewardConfetti.shouldSkip` rather than
30
+ * importing it: this is a question about the sheet, not about confetti, and a host
31
+ * without `matchMedia` gets the animation, which is the default every other motion in
32
+ * this SDK takes.
33
+ */
34
+ export declare function prefersReducedMotion(): boolean;
35
+ /**
36
+ * The advertiser's logo, or a monogram. Mirrors `RewardCard.#createIcon`: a missing
37
+ * or broken `logoUrl` is the ordinary rendering for an offer without one. The
38
+ * monogram's letter comes from `giftHost`, the same name the row shows.
39
+ */
40
+ export declare function buildGiftIcon(offer: Offer, className: string): HTMLElement;
41
+ /**
42
+ * The tabs for these offers, in `GIFT_CATEGORY_GROUPS` order, or `[]` for no tab strip.
43
+ *
44
+ * Every offer has a group: its served category is mapped by `giftCategoryGroup`, and an
45
+ * absent or unknown one files under Everyday, so nothing is hidden and there is no
46
+ * "More" tab. Groups with no offers are dropped. The strip is drawn only when at least
47
+ * two groups each hold two or more offers: below that a tab is a label on one card, and
48
+ * a shelf with no categories at all (today's backend) must render exactly as it did
49
+ * before. There is no "All" tab: the design has none, and the first group shown is
50
+ * selected by default.
51
+ */
52
+ export declare function sheetCategories(offers: readonly (Offer | undefined)[]): GiftCategoryGroup[];
53
+ export interface GiftSheetOptions {
54
+ /** The surface's FULL offer array. Every index below indexes it. */
55
+ offers: readonly Offer[];
56
+ /** Which offers the sheet lists right now. Read on every list render. */
57
+ listed: () => readonly number[];
58
+ /** Whether claiming is switched on. `false` keeps the sheet's CTA inert. */
59
+ claimEnabled?: boolean;
60
+ /** The line under the sheet's CTA, or null for none. Built once, at render. */
61
+ footer: () => HTMLElement | null;
62
+ /** The sheet's CTA was pressed with `index` picked. The surface selects and claims. */
63
+ onCommit: (index: number) => void;
64
+ /** The pick changed: the picked offer, or null once cleared. The footer follows it. */
65
+ onPick?: (offer: Offer | null) => void;
66
+ /** The surface's impression gate. Cards are registered only while the sheet is open. */
67
+ impressions: ImpressionGate;
68
+ /** The gate judged the card for `index` shown. The surface emits the impression. */
69
+ onShown: (index: number) => void;
70
+ /** The surface's listener lifetime; aborting it detaches every sheet listener. */
71
+ signal: AbortSignal;
72
+ /** The sheet's heading and group name. Defaults to `GIFT_COPY.sheetTitle` ("Other gifts"). */
73
+ title?: string;
74
+ /** The close control's accessible name. Defaults to `GIFT_COPY.closeSheetLabel`. */
75
+ closeLabel?: string;
76
+ /**
77
+ * Fill one card's body, for a surface whose sheet rows mirror its own rows
78
+ * (`giftUnwrap`: logo, brand, perk line, radio). The sheet still owns the card
79
+ * element, its radio semantics, listeners and data attributes. Defaults to the
80
+ * icon and perk label every other surface shows.
81
+ */
82
+ cardBody?: (card: HTMLElement, offer: Offer) => void;
83
+ /**
84
+ * The card's accessible name, for a `cardBody` whose visible order differs from the
85
+ * default card's (brand first). Defaults to `giftRowAccessibleName`, which matches
86
+ * the default body. Given so the name reads in the order the card shows its text.
87
+ */
88
+ cardLabel?: (offer: Offer) => string;
89
+ /**
90
+ * The CTA's label once a gift is picked. Defaults to `giftCtaLabel` ("Claim …"), which
91
+ * is right where the CTA claims. `giftUnwrap`'s only moves to its ready screen, so it
92
+ * passes a label that does not promise a claim.
93
+ */
94
+ ctaLabel?: (offer: Offer) => string;
95
+ }
96
+ export declare class GiftSheet {
97
+ #private;
98
+ constructor(options: GiftSheetOptions);
99
+ /**
100
+ * The sheet overlay.
101
+ *
102
+ * CATEGORY TABS ARE DATA-DRIVEN, and absent by default. The designs split this sheet
103
+ * into short groups ("Watch & listen", "Money", "Everyday"). `OfferModel.category` is
104
+ * read tolerantly from `campaign.category` (see `readProposedCategory`), each name is
105
+ * mapped onto a group by `giftCategoryGroup`, and the strip is only drawn when two
106
+ * groups each hold two or more of the listed offers (`sheetCategories`). Against a
107
+ * backend that sends no category that is never, and this sheet is the one list it
108
+ * always was. Nothing here derives a category from brand names or perk text: a guessed
109
+ * taxonomy looks like data and is wrong silently for the first publisher whose
110
+ * advertisers do not fit it.
111
+ */
112
+ render(): HTMLElement;
113
+ /**
114
+ * Rebuild the card list from `listed()`. The surface calls this after a promotion.
115
+ *
116
+ * Clears the pick: it may have just been promoted out of the list, and a CTA left
117
+ * enabled and still naming it would do nothing when pressed. The tabs are recomputed
118
+ * too, because a promotion swaps one offer in and one out and can change which
119
+ * categories the sheet holds; the selected tab survives when it still exists.
120
+ */
121
+ renderList(): void;
122
+ open(opener?: HTMLElement): void;
123
+ close(): void;
124
+ destroy(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