@encorekit/web-sdk 2.1.1 → 2.1.3
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/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/transport.d.ts +2 -2
- package/types/analytics/transport.d.ts.map +1 -1
- package/types/core/Encore.d.ts.map +1 -1
- package/types/core/giftVariant.d.ts +4 -3
- package/types/core/giftVariant.d.ts.map +1 -1
- package/types/core/version.d.ts +1 -1
- package/types/ui/GiftPicker.d.ts +105 -0
- package/types/ui/GiftPicker.d.ts.map +1 -0
- package/types/ui/GiftPickerHero.d.ts +31 -0
- package/types/ui/GiftPickerHero.d.ts.map +1 -0
- package/types/ui/giftCopy.d.ts +10 -1
- package/types/ui/giftCopy.d.ts.map +1 -1
- package/types/ui/styles.d.ts.map +1 -1
- package/types/ui/termsLine.d.ts +8 -3
- package/types/ui/termsLine.d.ts.map +1 -1
- package/types/utils/deviceOs.d.ts +45 -0
- package/types/utils/deviceOs.d.ts.map +1 -0
package/package.json
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
import type { AnalyticsEvent, EventEnvelope } from './models';
|
|
9
9
|
/**
|
|
10
10
|
* Wrap an event in the analytics wire envelope, injecting the shared web metadata
|
|
11
|
-
* (platform, sdk_version, app_bundle_id). `eventId` defaults to a
|
|
12
|
-
* callers needing idempotent retries pass a stable id.
|
|
11
|
+
* (platform, agent_type, device_os, sdk_version, app_bundle_id). `eventId` defaults to a
|
|
12
|
+
* fresh UUID; callers needing idempotent retries pass a stable id.
|
|
13
13
|
*/
|
|
14
14
|
export declare function buildEnvelope(event: AnalyticsEvent, eventId?: string): EventEnvelope;
|
|
15
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/analytics/transport.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/analytics/transport.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAkD9D;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,GAAE,MAAuB,GAAG,aAAa,CAqBpG;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,aAAa,EACvB,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAChC,OAAO,CAAC,QAAQ,CAAC,CAWnB"}
|
|
@@ -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":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,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C,QAAQ,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,GAAG,WAAW;IAI9E;;;;;;;;OAQG;IACH,SAAS,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,gBAAgB,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,iBAAiB;CA0wElG;AAGD,eAAO,MAAM,MAAM,WAAkB,CAAC"}
|
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
* which is the same per-app machinery `streaksCarousel` already rides
|
|
8
8
|
* (`GET /publisher/sdk/v1/config` → `ui.variantName`).
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* FOUR NAMES, EACH ITS OWN SURFACE. `giftReveal` is the name in the approved Backend
|
|
11
11
|
* Change Report (the box that opens onto a short radio group). `giftList` and
|
|
12
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).
|
|
13
|
+
* closed box that unwraps onto a "your gift is ready" screen). `giftPicker` is
|
|
14
|
+
* PayRange's original email gift picker (host bar, logo fan, brand + perk rows). The names are fixed:
|
|
14
15
|
* they are what the `variants` rows will be called and what the config endpoint will
|
|
15
16
|
* serve as `selectedVariant.name`. They sit beside the shipped variants
|
|
16
17
|
* (bundleFraming, control, customHeadlineControl, featuredOfferCarousel,
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
* this SDK, visible in review, and costs one string per surface.
|
|
37
38
|
*/
|
|
38
39
|
/** The bespoke reward surfaces a served variant can ask for. */
|
|
39
|
-
export type RewardSurfaceKind = 'giftReveal' | 'giftList' | 'giftUnwrap';
|
|
40
|
+
export type RewardSurfaceKind = 'giftReveal' | 'giftList' | 'giftUnwrap' | 'giftPicker';
|
|
40
41
|
/**
|
|
41
42
|
* Exact served variant name → the surface it asks for. The ONLY way into any gift
|
|
42
43
|
* 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,gEAAgE;AAChE,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,UAAU,GAAG,YAAY,GAAG,YAAY,CAAC;AAExF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAK3E,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"}
|
package/types/core/version.d.ts
CHANGED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gift picker — the `giftPicker` reward surface, drawn after PayRange's email gift picker.
|
|
3
|
+
*
|
|
4
|
+
* Top to bottom, inside the reward chrome: the host bar and a fan of the top gifts' logos
|
|
5
|
+
* ({@link GiftPicker.renderHero}), then this surface — up to three brand + perk radio
|
|
6
|
+
* rows and "More gifts" — then the action block Encore composes: a CTA naming the gift
|
|
7
|
+
* and "One gift per person · Offer terms".
|
|
8
|
+
*
|
|
9
|
+
* 🔴 SCOPED TO ONE VARIANT. Reached only when the backend serves `giftPicker` for a
|
|
10
|
+
* `rewardUsers` presentation (see `core/giftVariant.ts`). `giftReveal` keeps its box.
|
|
11
|
+
*
|
|
12
|
+
* The SELECTION MODEL is `GiftReveal`'s and `GiftList`'s: `#selectedIndex` indexes the
|
|
13
|
+
* FULL offer array, and a gift picked from the sheet is PROMOTED into the rows, so the
|
|
14
|
+
* screen and the CTA never disagree about what will be claimed. The sheet is `GiftSheet`.
|
|
15
|
+
*
|
|
16
|
+
* Events: `offerView` once per offer the impression gate judges shown, `offerSelect` on
|
|
17
|
+
* every selection change including the initial one inside `render()`, `offerClaim` only
|
|
18
|
+
* through {@link GiftPicker.claimSelected}. Every `index` indexes the array passed in.
|
|
19
|
+
*/
|
|
20
|
+
import type { OfferModel as Offer } from '../api/models';
|
|
21
|
+
import type { RewardSurface, RewardSurfaceEventMap } from './rewardSurface';
|
|
22
|
+
import { ImpressionGate } from './impressionGate';
|
|
23
|
+
/** How many gifts are shown as rows. The rest go behind "More gifts". */
|
|
24
|
+
export declare const GIFT_PICKER_ROW_LIMIT = 3;
|
|
25
|
+
export interface GiftPickerOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Whether claiming is switched on. `false` disables the sheet's own CTA, matching
|
|
28
|
+
* what `RewardActions` does to the main one — the gate is the SDK's, so every
|
|
29
|
+
* control that can start a claim has to honour it, not just the visible one.
|
|
30
|
+
*/
|
|
31
|
+
claimEnabled?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The trust line repeated at the foot of the sheet.
|
|
34
|
+
*
|
|
35
|
+
* Passed in by the caller so it is literally the SAME value the main surface's
|
|
36
|
+
* action block receives — the two are one decision made once, not two defaults that
|
|
37
|
+
* happen to agree. The fallback is now that same string rather than a second
|
|
38
|
+
* constant that has to be kept in step with it.
|
|
39
|
+
*
|
|
40
|
+
* 🔴 THE FALLBACK CLAIMS NOTHING, AND IT CANNOT BE DERIVED. Every other fine print
|
|
41
|
+
* in this SDK is chosen per offer from `badgeLabel` — `isKnownFreeTrial` picks
|
|
42
|
+
* `GIFT_COPY.finePrint`, everything else gets `REWARD_COPY.trustUnknown` — but this
|
|
43
|
+
* line sits at the foot of a LIST. The sheet holds every gift that did not fit, one
|
|
44
|
+
* row can be a free trial and the next a paid discount, and the sheet's own CTA is
|
|
45
|
+
* "Continue" rather than a claim, so there is no single offer whose badge could
|
|
46
|
+
* decide the sentence. The badge route is unavailable here for that reason, not
|
|
47
|
+
* because the data is missing.
|
|
48
|
+
*
|
|
49
|
+
* It used to default to `GIFT_COPY.finePrint` — "FREE trial. You can cancel
|
|
50
|
+
* anytime." — over exactly that mixed list: the same false claim `ui/offerBadge.ts`
|
|
51
|
+
* exists to remove, asserted over more offers at once. The default is now the line
|
|
52
|
+
* that holds whatever the terms turn out to be.
|
|
53
|
+
*/
|
|
54
|
+
trustText?: string;
|
|
55
|
+
/**
|
|
56
|
+
* The presentation's impression gate (see `impressionGate.ts`): rows and sheet cards
|
|
57
|
+
* report `offerView` only once it judges them shown. Without one the surface owns an
|
|
58
|
+
* unarmed gate, which never fires.
|
|
59
|
+
*/
|
|
60
|
+
impressions?: ImpressionGate;
|
|
61
|
+
/** The host app's name for the bar above the fan (`values.text.appName`). No name, no bar. */
|
|
62
|
+
hostName?: string;
|
|
63
|
+
/** The host app's icon beside that name (`values.media.appstoreIcon`). */
|
|
64
|
+
hostIconUrl?: string;
|
|
65
|
+
}
|
|
66
|
+
export declare class GiftPicker implements RewardSurface {
|
|
67
|
+
#private;
|
|
68
|
+
constructor(offers: readonly Offer[], options?: GiftPickerOptions);
|
|
69
|
+
on<E extends keyof RewardSurfaceEventMap>(event: E, handler: (payload: RewardSurfaceEventMap[E]) => void): () => void;
|
|
70
|
+
getTotalOffers(): number;
|
|
71
|
+
getCurrentIndex(): number;
|
|
72
|
+
getSelectedOffer(): Offer | undefined;
|
|
73
|
+
/** True when there is anything left to put behind "More gifts". */
|
|
74
|
+
hasMoreGifts(): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* The host bar and the logo fan, as their own element: they belong ABOVE the sheet's
|
|
77
|
+
* headline and the rows below it — see `RewardLayoutOptions.hero`.
|
|
78
|
+
*/
|
|
79
|
+
renderHero(): HTMLElement;
|
|
80
|
+
render(): HTMLElement;
|
|
81
|
+
/**
|
|
82
|
+
* Select the offer at `index` — an index into the full offer array.
|
|
83
|
+
*
|
|
84
|
+
* Out-of-range indices are IGNORED rather than clamped: a caller asking for an offer
|
|
85
|
+
* that does not exist has a bug, and silently claiming a neighbouring advertiser's
|
|
86
|
+
* offer instead would hide it behind a real transaction.
|
|
87
|
+
*/
|
|
88
|
+
selectOffer(index: number): void;
|
|
89
|
+
/** Move to the next offer, wrapping. Present for API parity with the carousel. */
|
|
90
|
+
next(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Claim the SELECTED offer — the single claim path, whichever control started it.
|
|
93
|
+
*
|
|
94
|
+
* Honours the host's claim switch here as well as on the buttons, so a programmatic
|
|
95
|
+
* call cannot claim what a disabled control could not. Otherwise mirrors
|
|
96
|
+
* `OfferCarousel.claimSelected`, including the warn-and-ignore on an empty
|
|
97
|
+
* selection: an offers array that arrived empty must not produce a transaction for
|
|
98
|
+
* `undefined`.
|
|
99
|
+
*/
|
|
100
|
+
claimSelected(): void;
|
|
101
|
+
openSheet(opener?: HTMLElement): void;
|
|
102
|
+
closeSheet(): void;
|
|
103
|
+
destroy(): void;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=GiftPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GiftPicker.d.ts","sourceRoot":"","sources":["../../src/ui/GiftPicker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;AASzD,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAmB,MAAM,kBAAkB,CAAC;AAEnE,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,IAAoB,CAAC;AAOvD,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,UAAW,YAAW,aAAa;;gBA2BlC,MAAM,EAAE,SAAS,KAAK,EAAE,EAAE,OAAO,GAAE,iBAAsB;IASrE,EAAE,CAAC,CAAC,SAAS,MAAM,qBAAqB,EACtC,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,IAAI,GACnD,MAAM,IAAI;IAIb,cAAc,IAAI,MAAM;IAIxB,eAAe,IAAI,MAAM;IAIzB,gBAAgB,IAAI,KAAK,GAAG,SAAS;IAIrC,mEAAmE;IACnE,YAAY,IAAI,OAAO;IAIvB;;;OAGG;IACH,UAAU,IAAI,WAAW;IAOzB,MAAM,IAAI,WAAW;IAkJrB;;;;;;OAMG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAchC,kFAAkF;IAClF,IAAI,IAAI,IAAI;IAmDZ;;;;;;;;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,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gift picker hero — the top of the `giftPicker` sheet: the host bar, then the top offers'
|
|
3
|
+
* logos fanned out with a scatter of confetti dots, as PayRange's email gift picker drew it.
|
|
4
|
+
*
|
|
5
|
+
* Everything drawn is either the backend's (the host's name and icon, the offers'
|
|
6
|
+
* logos) or SDK-owned CSS/SVG (the fan's frames, the dots). No raster ships here.
|
|
7
|
+
*
|
|
8
|
+
* fan 240×104 stage; centre tile 64 @ top 16, sides 56 at ±55px, ±12deg
|
|
9
|
+
* dots six circles in the same 240×104 box (CONFETTI_SVG)
|
|
10
|
+
*
|
|
11
|
+
* Motion is a one-shot CSS pop on the tiles and dots. The BASE styles are the finished
|
|
12
|
+
* state, so reduced motion, `animation: none` or a hidden tab all render the fan settled.
|
|
13
|
+
*/
|
|
14
|
+
import type { OfferModel as Offer } from '../api/models';
|
|
15
|
+
/** How many logos the fan holds. The rest of the offers live in the sheet. */
|
|
16
|
+
export declare const PICKER_TILE_LIMIT = 3;
|
|
17
|
+
export interface GiftPickerHost {
|
|
18
|
+
/** `values.text.appName`. Without it there is no host bar at all. */
|
|
19
|
+
name?: string;
|
|
20
|
+
/** `values.media.appstoreIcon`. Optional: the bar degrades to the name alone. */
|
|
21
|
+
iconUrl?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare class GiftPickerHero {
|
|
24
|
+
#private;
|
|
25
|
+
/** Build the host bar and the fan. Renders at most {@link PICKER_TILE_LIMIT} logos. */
|
|
26
|
+
render(offers: readonly Offer[], host?: GiftPickerHost): HTMLElement;
|
|
27
|
+
/** Re-point the logos after a promotion, without replaying the entrance. */
|
|
28
|
+
updateTiles(offers: readonly Offer[]): void;
|
|
29
|
+
destroy(): void;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=GiftPickerHero.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GiftPickerHero.d.ts","sourceRoot":"","sources":["../../src/ui/GiftPickerHero.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;AAOzD,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAYnC,MAAM,WAAW,cAAc;IAC7B,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,cAAc;;IAKzB,uFAAuF;IACvF,MAAM,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,EAAE,IAAI,GAAE,cAAmB,GAAG,WAAW;IA6BxE,4EAA4E;IAC5E,WAAW,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,IAAI;IAmF3C,OAAO,IAAI,IAAI;CAMhB"}
|
package/types/ui/giftCopy.d.ts
CHANGED
|
@@ -72,6 +72,13 @@ export declare const GIFT_COPY: {
|
|
|
72
72
|
readonly sheetTitle: "Other gifts";
|
|
73
73
|
/** Under the CTA. A middot separator, matching the artifact. */
|
|
74
74
|
readonly terms: "One gift per person · Offer terms";
|
|
75
|
+
/** `giftPicker`: the same sentence split into lead and link, so "Offer terms" can link. */
|
|
76
|
+
readonly pickerTermsLead: "One gift per person ·";
|
|
77
|
+
readonly pickerTermsLink: "Offer terms";
|
|
78
|
+
/** `giftPicker`: the underlined link above the CTA that opens the other-gifts sheet. */
|
|
79
|
+
readonly moreGifts: "More gifts";
|
|
80
|
+
/** `giftPicker`'s CTA fallback when nothing about the gift fits the label. */
|
|
81
|
+
readonly getFallback: "Get your gift";
|
|
75
82
|
/**
|
|
76
83
|
* The `giftList` / `giftUnwrap` terms line, in two parts because the second is the
|
|
77
84
|
* link: "By proceeding you agree to our offer terms". Rendered by `ui/termsLine.ts`,
|
|
@@ -93,6 +100,8 @@ export declare const GIFT_COPY: {
|
|
|
93
100
|
/** `giftList`: the link under the rows that opens the "Other gifts" sheet. */
|
|
94
101
|
readonly showMore: "Show more gifts";
|
|
95
102
|
};
|
|
103
|
+
/** The CTA's verb: `giftPicker` says "Get", every other gift surface "Claim". */
|
|
104
|
+
export type GiftCtaVerb = 'Claim' | 'Get';
|
|
96
105
|
/**
|
|
97
106
|
* The advertiser as a display noun — who the user is about to be handed off to.
|
|
98
107
|
*
|
|
@@ -161,7 +170,7 @@ export declare function giftBrandFirstText(offer: Offer): GiftBrandFirstText;
|
|
|
161
170
|
* the button specific without letting it wrap. The brand is `giftHost`, so an offer
|
|
162
171
|
* with a destination but no merchant name is still named rather than dropping to rung 3.
|
|
163
172
|
*/
|
|
164
|
-
export declare function giftCtaLabel(offer: Offer): string;
|
|
173
|
+
export declare function giftCtaLabel(offer: Offer, verb?: GiftCtaVerb): string;
|
|
165
174
|
/**
|
|
166
175
|
* The handoff sentence: what happens after the claim.
|
|
167
176
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"giftCopy.d.ts","sourceRoot":"","sources":["../../src/ui/giftCopy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;AAGzD;;;GAGG;AACH,eAAO,MAAM,SAAS;IACpB,uEAAuE;;IAEvE;;;;OAIG;;IAEH,uFAAuF;;IAEvF;;;;;;;OAOG;;;IASH;;;;;;;;;;;;;;;OAeG;;IAEH;qFACiF;;IAEjF;;;OAGG;;IAEH,gEAAgE;;IAEhE;;;;OAIG;;;IAGH,gFAAgF;;IAEhF,iCAAiC;;IAEjC,sFAAsF;;IAEtF;;;OAGG;;IAEH,8EAA8E;;CAEtE,CAAC;AAeX;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAUzD;AAsBD;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAItB,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,OAAO,CAAC,CAAC,GAC5D,MAAM,GAAG,SAAS,CAEpB;AAED,oFAAoF;AACpF,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,WAAW,CAKrD;AAED,mFAAmF;AACnF,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,C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;;;;;;;;;;;;;;;;;;;;;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;AAs3ID;;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"}
|
package/types/ui/termsLine.d.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* The terms line under the primary CTA on the `giftList` and `giftUnwrap` surfaces:
|
|
3
3
|
* "By proceeding you agree to our offer terms", with "offer terms" underlined.
|
|
4
4
|
*
|
|
5
|
-
* It REPLACES the per-offer fine print on those
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* It REPLACES the per-offer fine print on those surfaces, and `giftPicker` renders it
|
|
6
|
+
* in its own words ("One gift per person · Offer terms") via `lead`/`linkText`.
|
|
7
|
+
* `giftReveal` keeps `GIFT_COPY.terms` through `RewardActions.termsText`, and the
|
|
8
|
+
* carousel keeps its trust line; neither calls this.
|
|
8
9
|
*
|
|
9
10
|
* WHERE "offer terms" GOES is the selected offer's `termsUrl` (`campaign.termsUrl`, an
|
|
10
11
|
* https URL the offer mapping has already vetted; it is checked again here). With one,
|
|
@@ -25,6 +26,10 @@ export interface TermsLineOptions {
|
|
|
25
26
|
onOpen?: () => void;
|
|
26
27
|
/** The selected offer's terms URL. https only; anything else renders as text. */
|
|
27
28
|
termsUrl?: string;
|
|
29
|
+
/** The words before the link. Defaults to `GIFT_COPY.termsLead`. */
|
|
30
|
+
lead?: string;
|
|
31
|
+
/** The link's own words. Defaults to `GIFT_COPY.termsLink`. */
|
|
32
|
+
linkText?: string;
|
|
28
33
|
}
|
|
29
34
|
/** Builds `<p class="encore-gift-terms">…<a|span|button class="encore-gift-terms-link">`. */
|
|
30
35
|
export declare function renderTermsLine(options?: TermsLineOptions): HTMLElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"termsLine.d.ts","sourceRoot":"","sources":["../../src/ui/termsLine.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"termsLine.d.ts","sourceRoot":"","sources":["../../src/ui/termsLine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,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,CAUlF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Device OS Detection
|
|
3
|
+
*
|
|
4
|
+
* The end user's device OS, reported on every analytics event. Named
|
|
5
|
+
* `device_os`, never `platform`: `platform` here is always the literal `web`,
|
|
6
|
+
* the SDK's own runtime, and cannot answer iOS vs Android.
|
|
7
|
+
*
|
|
8
|
+
* Vocabulary is the backend click classifier's, plus the two values only a page
|
|
9
|
+
* can resolve, so one warehouse query reads both lanes. See
|
|
10
|
+
* `docs/architecture/platform-divergence/web.md` #5.
|
|
11
|
+
*/
|
|
12
|
+
/** What kind of thing made the request. Always stamped, mirrors the backend. */
|
|
13
|
+
export declare const AgentType: {
|
|
14
|
+
readonly Browser: "browser";
|
|
15
|
+
readonly Bot: "bot";
|
|
16
|
+
readonly HttpClient: "http_client";
|
|
17
|
+
readonly Unknown: "unknown";
|
|
18
|
+
};
|
|
19
|
+
export type AgentType = (typeof AgentType)[keyof typeof AgentType];
|
|
20
|
+
/** The end user's OS. ONLY operating systems: null when there is none to name. */
|
|
21
|
+
export declare const DeviceOs: {
|
|
22
|
+
/** iPhone or iPod touch. */
|
|
23
|
+
readonly Ios: "ios";
|
|
24
|
+
readonly Android: "android";
|
|
25
|
+
/** An iPad, separated from a Mac by touch points. Never emitted server-side. */
|
|
26
|
+
readonly IpadOs: "ipados";
|
|
27
|
+
/** A Mac, separated from an iPad by touch points. Never emitted server-side. */
|
|
28
|
+
readonly MacOs: "macos";
|
|
29
|
+
/** An Apple desktop-class UA we could NOT split, matching the backend's bucket. */
|
|
30
|
+
readonly MacOsOrIpadOs: "macos_or_ipados";
|
|
31
|
+
readonly Windows: "windows";
|
|
32
|
+
/** Parsed, none of the above (Linux desktop, ChromeOS). */
|
|
33
|
+
readonly Other: "other";
|
|
34
|
+
};
|
|
35
|
+
export type DeviceOs = (typeof DeviceOs)[keyof typeof DeviceOs];
|
|
36
|
+
export interface AgentClassification {
|
|
37
|
+
agentType: AgentType;
|
|
38
|
+
/** Non-null if and only if `agentType` is `browser`. */
|
|
39
|
+
deviceOs: DeviceOs | null;
|
|
40
|
+
}
|
|
41
|
+
/** Memoized: the user agent cannot change for the life of the page. */
|
|
42
|
+
export declare function detectAgent(): AgentClassification;
|
|
43
|
+
/** Test seam only: clears the memo so a stubbed navigator is re-read. */
|
|
44
|
+
export declare function resetDeviceOsCache(): void;
|
|
45
|
+
//# sourceMappingURL=deviceOs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceOs.d.ts","sourceRoot":"","sources":["../../src/utils/deviceOs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,gFAAgF;AAChF,eAAO,MAAM,SAAS;;;;;CAKZ,CAAC;AACX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEnE,kFAAkF;AAClF,eAAO,MAAM,QAAQ;IACnB,4BAA4B;;;IAG5B,gFAAgF;;IAEhF,gFAAgF;;IAEhF,mFAAmF;;;IAGnF,2DAA2D;;CAEnD,CAAC;AACX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAoFhE,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,SAAS,CAAC;IACrB,wDAAwD;IACxD,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC3B;AA6DD,uEAAuE;AACvE,wBAAgB,WAAW,IAAI,mBAAmB,CAGjD;AAED,yEAAyE;AACzE,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
|