@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.
- package/README.md +6 -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/api/APIClient.d.ts +18 -0
- package/types/api/APIClient.d.ts.map +1 -1
- package/types/api/generated/types.d.ts +177 -2
- package/types/api/generated/types.d.ts.map +1 -1
- package/types/api/models.d.ts +32 -0
- package/types/api/models.d.ts.map +1 -1
- package/types/core/Encore.d.ts.map +1 -1
- package/types/core/giftVariant.d.ts +67 -0
- package/types/core/giftVariant.d.ts.map +1 -0
- package/types/core/version.d.ts +1 -1
- package/types/types.d.ts +31 -3
- package/types/types.d.ts.map +1 -1
- package/types/ui/GiftHero.d.ts +75 -0
- package/types/ui/GiftHero.d.ts.map +1 -0
- package/types/ui/GiftList.d.ts +110 -0
- package/types/ui/GiftList.d.ts.map +1 -0
- package/types/ui/GiftReveal.d.ts +133 -0
- package/types/ui/GiftReveal.d.ts.map +1 -0
- package/types/ui/GiftSheet.d.ts +126 -0
- package/types/ui/GiftSheet.d.ts.map +1 -0
- package/types/ui/GiftUnwrap.d.ts +155 -0
- package/types/ui/GiftUnwrap.d.ts.map +1 -0
- package/types/ui/OfferCarousel.d.ts +10 -3
- package/types/ui/OfferCarousel.d.ts.map +1 -1
- package/types/ui/OfferModal.d.ts +7 -0
- package/types/ui/OfferModal.d.ts.map +1 -1
- package/types/ui/RewardActions.d.ts +88 -4
- package/types/ui/RewardActions.d.ts.map +1 -1
- package/types/ui/RewardCard.d.ts +16 -8
- package/types/ui/RewardCard.d.ts.map +1 -1
- package/types/ui/RewardConfetti.d.ts +23 -1
- package/types/ui/RewardConfetti.d.ts.map +1 -1
- package/types/ui/RewardLayout.d.ts +35 -0
- package/types/ui/RewardLayout.d.ts.map +1 -1
- package/types/ui/advertiserPreconnect.d.ts +90 -0
- package/types/ui/advertiserPreconnect.d.ts.map +1 -0
- package/types/ui/appearance.d.ts +27 -0
- package/types/ui/appearance.d.ts.map +1 -1
- package/types/ui/focusable.d.ts +41 -0
- package/types/ui/focusable.d.ts.map +1 -0
- package/types/ui/giftCategoryGroups.d.ts +21 -0
- package/types/ui/giftCategoryGroups.d.ts.map +1 -0
- package/types/ui/giftCopy.d.ts +215 -0
- package/types/ui/giftCopy.d.ts.map +1 -0
- package/types/ui/giftUnwrapArt.d.ts +55 -0
- package/types/ui/giftUnwrapArt.d.ts.map +1 -0
- package/types/ui/giftUnwrapCopy.d.ts +57 -0
- package/types/ui/giftUnwrapCopy.d.ts.map +1 -0
- package/types/ui/impressionGate.d.ts +63 -0
- package/types/ui/impressionGate.d.ts.map +1 -0
- package/types/ui/offerBadge.d.ts +56 -0
- package/types/ui/offerBadge.d.ts.map +1 -0
- package/types/ui/rewardSurface.d.ts +82 -0
- package/types/ui/rewardSurface.d.ts.map +1 -0
- package/types/ui/safeImageSrc.d.ts +10 -0
- package/types/ui/safeImageSrc.d.ts.map +1 -1
- package/types/ui/styles.d.ts +166 -0
- package/types/ui/styles.d.ts.map +1 -1
- package/types/ui/termsLine.d.ts +33 -0
- package/types/ui/termsLine.d.ts.map +1 -0
|
@@ -11,5 +11,15 @@
|
|
|
11
11
|
* relative and unparseable strings — is rejected. Callers fall back to their
|
|
12
12
|
* placeholder (monogram tile / placeholder banner) on rejection.
|
|
13
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* Whether `hostname` is one of those local-dev hosts.
|
|
16
|
+
*
|
|
17
|
+
* A PREDICATE rather than the set itself, which is the point: this is a security
|
|
18
|
+
* allowlist, and exporting the container would hand every consumer a live handle able
|
|
19
|
+
* to `add()` to it at runtime — a `ReadonlySet` type would stop that in TypeScript
|
|
20
|
+
* only. Callers want the decision, not the data. Shared with the advertiser preconnect
|
|
21
|
+
* so the two cannot drift on what counts as local.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isLoopbackHost(hostname: string): boolean;
|
|
14
24
|
export declare function safeImageSrc(url: string | undefined): string | undefined;
|
|
15
25
|
//# sourceMappingURL=safeImageSrc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safeImageSrc.d.ts","sourceRoot":"","sources":["../../src/ui/safeImageSrc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"safeImageSrc.d.ts","sourceRoot":"","sources":["../../src/ui/safeImageSrc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAaxE"}
|
package/types/ui/styles.d.ts
CHANGED
|
@@ -26,6 +26,61 @@ export declare const BREAKPOINTS: {
|
|
|
26
26
|
* track Figma frame 18304:2399 (393×852). Where they disagree the Figma wins — see
|
|
27
27
|
* the PR for the itemised list. Web has no SDUI engine, so every value is hand-tracked.
|
|
28
28
|
*
|
|
29
|
+
* REWARD_MOBILE_NOTES — the reward sheet below the 767px breakpoint.
|
|
30
|
+
*
|
|
31
|
+
* The composition is three bands in one flex column that fills the sheet: the status
|
|
32
|
+
* block (headline, subheadline) at the top, the carousel in the middle with
|
|
33
|
+
* `flex: 1 1 auto`, and the CTA stack pinned to the bottom with `margin-top: auto` over
|
|
34
|
+
* its own `max(31px, env(safe-area-inset-bottom))` padding. The carousel is the ONLY
|
|
35
|
+
* band that grows, and centres its cards and dots in whatever it is given, so every
|
|
36
|
+
* spare pixel on a tall phone goes to the middle rather than to a gap under the CTAs.
|
|
37
|
+
*
|
|
38
|
+
* History worth knowing before touching it. From 3.0.0 until this block was repaired,
|
|
39
|
+
* a stray `;` left behind when the `.thankyou-footer` selector was deleted turned the
|
|
40
|
+
* orphaned declarations after it into the prelude of one invalid rule whose body was
|
|
41
|
+
* this whole media block, so browsers dropped all of it (CSS Syntax, "consume a
|
|
42
|
+
* qualified rule"). The sheet's root therefore never filled the modal and the CTAs sat
|
|
43
|
+
* directly under the carousel with dead space beneath them, while the `margin-top:
|
|
44
|
+
* auto` on the action block — which is live — had no free space to claim.
|
|
45
|
+
*
|
|
46
|
+
* What the old block ALSO did, and why those parts were not revived: a `::before` on
|
|
47
|
+
* the root and an `::after` on the carousel split the slack 1:1.35 to float the whole
|
|
48
|
+
* stack optically centred. Both spacers are flex-grow items, and flex-grow resolves
|
|
49
|
+
* before auto margins, so they would have eaten the space the CTA pin needs and pushed
|
|
50
|
+
* the headline down. The `.thankyou::before` spacer would also have landed above the
|
|
51
|
+
* gift surfaces' heroes, which share this root class.
|
|
52
|
+
*
|
|
53
|
+
* `.carousel-cards` keeps `flex: 0 1 auto; min-height: 0`: on a sheet too short for
|
|
54
|
+
* the stack, the cards' padded scroll box gives up height before the CTAs are pushed
|
|
55
|
+
* off the bottom of an `overflow: hidden` sheet.
|
|
56
|
+
*
|
|
57
|
+
* GIFT_FLOW_NOTES — why the gift block in the stylesheet looks the way it does, and
|
|
58
|
+
* the reason it is a JS comment rather than a CSS one (see the paragraph above: prose
|
|
59
|
+
* inside the literal is payload every consumer downloads).
|
|
60
|
+
*
|
|
61
|
+
* The gift flow is the `rewardUsers` SELECTION surface: a box that opens, three rows,
|
|
62
|
+
* and a sheet for everything that did not fit. Its geometry is a single hand-tracked
|
|
63
|
+
* coordinate system — the numbers in the box rules are positions inside a 270×236
|
|
64
|
+
* stage and are meaningless apart from each other, so `GiftHero.ts` carries the table
|
|
65
|
+
* and this block carries the same values. Retuning one without the other detaches the
|
|
66
|
+
* lid from the box.
|
|
67
|
+
*
|
|
68
|
+
* ALL MOTION IS CSS, deliberately: four keyframes and a class toggle, no library, no
|
|
69
|
+
* per-frame JavaScript. The one canvas is the reward sheet's existing confetti, reused
|
|
70
|
+
* with a burst origin rather than reimplemented. The reduced-motion block does not
|
|
71
|
+
* merely disable the animation — it places the lid, bow and tiles in their FINAL
|
|
72
|
+
* state, because a gift box that never opens is a broken screen, not a calm one.
|
|
73
|
+
*
|
|
74
|
+
* COLOURS ARE FIXED, NOT THEMED — reversed on Junaid's call after the first build
|
|
75
|
+
* shipped a theme-tinted gift box. The palette is the design's own, pinned in the
|
|
76
|
+
* .thankyou--gift block and in the box rules as literals, because brand-derived
|
|
77
|
+
* tinting is iOS/Android behaviour and web following it here produced a saturated
|
|
78
|
+
* accent behind near-black row text that failed contrast outright. Highlights stay
|
|
79
|
+
* white at low alpha rather than a second hardcoded blue, so the box shades from one
|
|
80
|
+
* value. Publisher `appearance` overrides still win: they write inline styles, which
|
|
81
|
+
* outrank every rule here. What no longer reaches this surface is IMPLICIT theming —
|
|
82
|
+
* a `theme.primaryColor` from configure(), or the variant's brand colour.
|
|
83
|
+
*
|
|
29
84
|
* SHEET BACKGROUND IS FLAT — a deliberate divergence from both the Figma and the
|
|
30
85
|
* variant, on Junaid's call. The sheet used to layer the Figma's radial brand glow
|
|
31
86
|
* over the variant's two stacked full-bleed gradients (an accent wash and a
|
|
@@ -67,6 +122,117 @@ export declare const BREAKPOINTS: {
|
|
|
67
122
|
* the right and bottom edges (its decorative vector), derived from the same tint so
|
|
68
123
|
* any advertiser colour works. See `brandTint.ts` for where the tint comes from.
|
|
69
124
|
*
|
|
125
|
+
* THE ROWS ARRIVE WITH THE GIFTS, and each row lands on the same frame as its own
|
|
126
|
+
* tile. The hero's tiles settle at 1.08s / 1.15s / 1.22s (rise2 0.38 + 0.70, rise1
|
|
127
|
+
* 0.45 + 0.70, rise3 0.52 + 0.70), and the rows run 0.46s from 0.62 / 0.69 / 0.76 —
|
|
128
|
+
* the same three end times, carrying the tiles' own 0.07s stagger. Row 1 is the first
|
|
129
|
+
* offer, whose gift is the CENTRE tile (`SLOT_ORDER` puts it at t2, the earliest), so
|
|
130
|
+
* the pairing is real and not just a rhythm: each row finishes as its own gift does.
|
|
131
|
+
* They start at 0.62s, while the tiles are mid-flight and the lid (0.20-0.75) is still
|
|
132
|
+
* clearing, so the list reads as the consequence of the box opening rather than a
|
|
133
|
+
* second, later animation. The curve is `gift-rise`'s own — no new easing.
|
|
134
|
+
*
|
|
135
|
+
* THE ROWS ARE VISIBLE IF THE ANIMATION NEVER RUNS. This is the constraint that
|
|
136
|
+
* matters, and the reason the rule is written the way it is: the row's BASE state is
|
|
137
|
+
* the FINISHED state (opaque, untransformed, interactive), and the entrance is gated
|
|
138
|
+
* behind `.gift-hero--play`. No play class — a hidden tab, a throttled one, rAF that
|
|
139
|
+
* never fires — means the selector never matches and the rows simply sit there, usable.
|
|
140
|
+
* The hero follows the same rule. The tiles, lid and bow used to take the opposite bet
|
|
141
|
+
* (tiles at `opacity: 0` in their base rule, reaching 1 only through the animation's
|
|
142
|
+
* `forwards` fill), which is how an earlier revision shipped a closed box with three
|
|
143
|
+
* invisible gifts under a headline promising one, and how any host or extension rule
|
|
144
|
+
* forcing `animation: none` still could. Their base rules are now the OPEN box (lid and
|
|
145
|
+
* bow gone, tiles risen), the keyframes carry the closed state in an explicit `from`,
|
|
146
|
+
* and the fill is `both` so each part holds that `from` through its delay instead of
|
|
147
|
+
* showing its end state before it starts. The play class lands on the modal's first
|
|
148
|
+
* visible frame (rAF, same frame as the fade-in), so there is no flash of the open box.
|
|
149
|
+
*
|
|
150
|
+
* THE ACTION BLOCK ENTERS WITH THE ROWS, AND THAT IS A CORRECTNESS FIX, not a flourish.
|
|
151
|
+
* Staggering the rows left the CTA rendered, enabled and naming a specific gift for the
|
|
152
|
+
* whole reveal while no row was on screen. Measured: 400ms after the rows existed, with
|
|
153
|
+
* ZERO rows visible, the button reported disabled=0, opacity 1, visibility visible,
|
|
154
|
+
* pointer-events auto and a positive `elementFromPoint` hit — and tapping it resolved
|
|
155
|
+
* `show()` with `{status:"claimed"}`. A user could claim a named gift before being shown
|
|
156
|
+
* the choice, on a screen whose entire premise is picking one. The row entrance created
|
|
157
|
+
* that window (the rows used to be painted on the first frame), so it closes it.
|
|
158
|
+
*
|
|
159
|
+
* It is the FOURTH item on the same cadence — 0.62 / 0.69 / 0.76 for the rows, 0.83 for
|
|
160
|
+
* the block — landing at 1.29s, just after the last tile settles at 1.22s. The artifact
|
|
161
|
+
* is a STATIC mock and specifies no timing (its transcription in this file is values
|
|
162
|
+
* only), but it does put the rows and the CTA in one block below the hero, so the block
|
|
163
|
+
* enters as one and the cadence is the rows' own rather than something invented.
|
|
164
|
+
*
|
|
165
|
+
* `visibility: hidden` IS NOT ENOUGH ON ITS OWN HERE, and the difference nearly shipped.
|
|
166
|
+
* It suppresses hit-testing on the element it is computed on — a row animates itself,
|
|
167
|
+
* so a hidden row is genuinely unclickable (measured: hit=0 for the whole delay). The
|
|
168
|
+
* CTA is not the animated element; its BLOCK is. Measured in a WKWebView with the block
|
|
169
|
+
* at `visibility: hidden, opacity: 0`, `elementFromPoint` over the button still returned
|
|
170
|
+
* `BUTTON.encore-reward-cta-primary` — the parent's animated visibility did not stop the
|
|
171
|
+
* descendant being hit. So the keyframes also animate `pointer-events` (none -> auto),
|
|
172
|
+
* which is what actually makes a nested control unreachable. It is CSS rather than the
|
|
173
|
+
* `disabled` attribute on purpose — `disabled` would have to be removed
|
|
174
|
+
* by JS, and JS that never runs would leave a permanently dead claim button, which is
|
|
175
|
+
* the same trap in a worse place. With animations off the block is simply visible and
|
|
176
|
+
* live, because the base rule is the finished state. (A programmatic `.click()` bypasses
|
|
177
|
+
* hit-testing and still fires; that is not a user tap, and the harness measures the
|
|
178
|
+
* `elementFromPoint` hit rather than relying on it.)
|
|
179
|
+
*
|
|
180
|
+
* The block is never rebuilt — `RewardActions` is constructed once in `Encore.ts` and
|
|
181
|
+
* selection only rewrites its label — so it needs no `--intro` marker the way the rows
|
|
182
|
+
* do, and its entrance cannot replay.
|
|
183
|
+
*
|
|
184
|
+
* IT IS THE OPENING REVEAL, NOT A ROW STYLE, which is why the gate is `--intro` (set
|
|
185
|
+
* by the first `#renderRows` only) and not the row class. `#promote` rebuilds the
|
|
186
|
+
* container's children when a gift is pulled out of the sheet, and a NEW element
|
|
187
|
+
* matching an animation rule starts that animation from its hidden from-state.
|
|
188
|
+
* Measured in the webview by doing exactly what `#promote` does — clear the container,
|
|
189
|
+
* append rows — 2.5s after the box had settled: all three went `0/12/h/0` for 600ms
|
|
190
|
+
* and faded back in. Today the sheet's CTA claims immediately so a user would barely
|
|
191
|
+
* catch it, but `selectOffer`/`next()` are public and reach `#promote` without a claim.
|
|
192
|
+
*
|
|
193
|
+
* `visibility` is in the keyframes so no row is ever invisible-but-clickable: with
|
|
194
|
+
* `both` fill the backwards phase holds `hidden` through the delay, and visibility
|
|
195
|
+
* resolves to `visible` for the whole interpolation once the fade starts. Focus order
|
|
196
|
+
* is untouched — nothing is reordered, added or removed from the DOM, and the rows are
|
|
197
|
+
* built and appended exactly as before.
|
|
198
|
+
*
|
|
199
|
+
* REDUCED MOTION resets it to `animation: none`, and the reset REPEATS THE FULL
|
|
200
|
+
* SELECTOR: the block's existing `.gift-row` reset is one class, and at (0,1,0) it
|
|
201
|
+
* would lose to the gated (0,3,0) rule no matter where it sat in the file.
|
|
202
|
+
*
|
|
203
|
+
* THE TOP INSET IS A FLOOR, NOT A SUM, and it belongs to the surface, not the hero.
|
|
204
|
+
*
|
|
205
|
+
* `env(safe-area-inset-top)` is ZERO in a host app's in-app browser: the webview sits
|
|
206
|
+
* BELOW the host's header, so the host's chrome is under the notch and this page is
|
|
207
|
+
* not. Measured in a WKWebView on a 16 Pro — safeTop 0 on all four simulator sizes,
|
|
208
|
+
* 16 Pro Max included — every `calc(X + env(safe-area-inset-top))` in this file
|
|
209
|
+
* collapses to X there. A sum can only ADD to a floor it already has; it cannot supply
|
|
210
|
+
* one. Hence `max(22px, env(safe-area-inset-top))`, the same shape as the bottom inset
|
|
211
|
+
* on `.reward-actions`: 22px is the floor, and a real notch wins only where it is
|
|
212
|
+
* genuinely bigger (full-screen Safari reports 59 on the same page, which is why the
|
|
213
|
+
* bug survived every check made there).
|
|
214
|
+
*
|
|
215
|
+
* 22px is MEASURED, not chosen: it is the clearance the design's full-size hero put
|
|
216
|
+
* above the box (a 236px stage centred in a 280px hero), and it reproduces the
|
|
217
|
+
* artifact's 24px above the topmost tile once the tile's own 2px inset into the stage
|
|
218
|
+
* is added. The 16 Pro Max is the one device that stays above the 820px tier, so it
|
|
219
|
+
* alone draws the composition unshrunk — measured there, minTileTop 24.
|
|
220
|
+
*
|
|
221
|
+
* WHY THE SURFACE AND NOT THE HERO: `.thankyou--gift` owns the scrolling, so a notch
|
|
222
|
+
* taller than the floor pushes content down and the surface scrolls. The same padding
|
|
223
|
+
* on the fixed-height hero would drive the scaled box into the headline beneath it.
|
|
224
|
+
*
|
|
225
|
+
* AND EACH TIER PAYS FOR IT OUT OF ITS OWN HERO — 280→258, 216→194, 150→128 with the
|
|
226
|
+
* box scaled 0.62→0.54 so it still fits what is left. The inset therefore costs the
|
|
227
|
+
* column nothing: measured before and after, "Other gifts" sits at exactly the same
|
|
228
|
+
* offset on all four sizes (SE 592/610, 16 722/756, 16 Pro 741/775, Max 823/857),
|
|
229
|
+
* which matters because the SE has only 18px of headroom to begin with.
|
|
230
|
+
*
|
|
231
|
+
* Nothing ever placed space above the hero before this. `.thankyou-status` carries the
|
|
232
|
+
* 40px sheet inset, but this composition puts the hero ABOVE that block and zeroes the
|
|
233
|
+
* padding for exactly that reason, so the hero's only clearance was the centring slack
|
|
234
|
+
* — which the 820px tier removes when it top-aligns the stage.
|
|
235
|
+
*
|
|
70
236
|
* DESKTOP WIDTH. The design is a 393-wide phone frame; on the desktop modal
|
|
71
237
|
* (max-width 800) the content column holds 393 and centres, so the hero keeps its
|
|
72
238
|
* proportions instead of stranding a 210px card in an 800px sheet. Content sits at
|
package/types/ui/styles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/ui/styles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,eAAO,MAAM,OAAO;;;CAGV,CAAC;AAGX,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/ui/styles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,eAAO,MAAM,OAAO;;;CAGV,CAAC;AAGX,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmOG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,YAAY,CAAC;AACtC,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,6DAA6D;AAC7D,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB;;;;IAI/B,0FAA0F;;CAElF,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAi8HD;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,GAAE,cAAmB,GAAG,IAAI,CAgB7D;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAMnC;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAe1D;AAED;;GAEG;AACH,wBAAgB,EAAE,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAE/C;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE7C"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The terms line under the primary CTA on the `giftList` and `giftUnwrap` surfaces:
|
|
3
|
+
* "By proceeding you agree to our offer terms", with "offer terms" underlined.
|
|
4
|
+
*
|
|
5
|
+
* It REPLACES the per-offer fine print on those two surfaces only. `giftReveal` keeps
|
|
6
|
+
* `GIFT_COPY.terms` through `RewardActions.termsText`, and the carousel keeps its trust
|
|
7
|
+
* line; neither calls this.
|
|
8
|
+
*
|
|
9
|
+
* WHERE "offer terms" GOES is the selected offer's `termsUrl` (`campaign.termsUrl`, an
|
|
10
|
+
* https URL the offer mapping has already vetted; it is checked again here). With one,
|
|
11
|
+
* the run is a real link that opens in a new tab; without one it is underlined PLAIN
|
|
12
|
+
* TEXT, matching the design, and not focusable, because an `<a>` with no destination
|
|
13
|
+
* is a control that does nothing. `setTermsLink` swaps the run as the selection moves,
|
|
14
|
+
* so the line is never a link to some other offer's terms.
|
|
15
|
+
*
|
|
16
|
+
* `onOpen` exists for a surface that has something real to open (a sheet it owns);
|
|
17
|
+
* given it, the link renders as a `<button>` and calls it. Nothing passes it today.
|
|
18
|
+
*/
|
|
19
|
+
export interface TermsLineOptions {
|
|
20
|
+
/**
|
|
21
|
+
* Opens whatever the surface shows as the offer terms. When present the link is a
|
|
22
|
+
* real `<button type="button">`; when absent it is non-interactive text. Errors it
|
|
23
|
+
* throws are contained so a terms tap can never throw into the host page.
|
|
24
|
+
*/
|
|
25
|
+
onOpen?: () => void;
|
|
26
|
+
/** The selected offer's terms URL. https only; anything else renders as text. */
|
|
27
|
+
termsUrl?: string;
|
|
28
|
+
}
|
|
29
|
+
/** Builds `<p class="encore-gift-terms">…<a|span|button class="encore-gift-terms-link">`. */
|
|
30
|
+
export declare function renderTermsLine(options?: TermsLineOptions): HTMLElement;
|
|
31
|
+
/** Point the line's "offer terms" run at `termsUrl`, or back to plain text without one. */
|
|
32
|
+
export declare function setTermsLink(line: HTMLElement, termsUrl: string | undefined): void;
|
|
33
|
+
//# sourceMappingURL=termsLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"termsLine.d.ts","sourceRoot":"","sources":["../../src/ui/termsLine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAOH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,6FAA6F;AAC7F,wBAAgB,eAAe,CAAC,OAAO,GAAE,gBAAqB,GAAG,WAAW,CAQ3E;AAED,2FAA2F;AAC3F,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAKlF"}
|