@vio-live/web-sdk 0.23.0 → 0.24.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 +105 -21
- package/dist/chunk-45YKS5UG.js +3 -0
- package/dist/{chunk-25QECQDS.js.map → chunk-45YKS5UG.js.map} +1 -1
- package/dist/{chunk-AMDI7KH3.js → chunk-AXJKB2CW.js} +680 -305
- package/dist/chunk-AXJKB2CW.js.map +1 -0
- package/dist/{chunk-COCHGJ2K.js → chunk-N6U65DWG.js} +165 -67
- package/dist/chunk-N6U65DWG.js.map +1 -0
- package/dist/core/index.d.ts +255 -80
- package/dist/core/index.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +3 -3
- package/dist/{tokens-DSYvrBsB.d.ts → tokens-C3qiGvLV.d.ts} +34 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-25QECQDS.js +0 -3
- package/dist/chunk-AMDI7KH3.js.map +0 -1
- package/dist/chunk-COCHGJ2K.js.map +0 -1
package/dist/core/index.d.ts
CHANGED
|
@@ -36,6 +36,17 @@ interface VioConfig {
|
|
|
36
36
|
contentId?: string | number;
|
|
37
37
|
/** Human-readable title of that content (`content_title`); see `contentId`. */
|
|
38
38
|
contentTitle?: string;
|
|
39
|
+
/**
|
|
40
|
+
* The campaign this PAGE belongs to (ADR-0034, amendment 3) — an editorial
|
|
41
|
+
* page (a Vev article, a Replit article) that is part of one campaign. Its
|
|
42
|
+
* slots are declared with it (the micro assigns them unless the dashboard
|
|
43
|
+
* already did) and, until that round-trips, the elements already resolve to
|
|
44
|
+
* it: assignment → page campaign → default. DOM alternative, inheritable:
|
|
45
|
+
* `data-vio-campaign` on any ancestor, or `vio-campaign` on the element.
|
|
46
|
+
*/
|
|
47
|
+
campaignId?: number;
|
|
48
|
+
/** Log the SDK's slot/attribution decisions at `console.debug` (manifest assignments per slot). */
|
|
49
|
+
debug?: boolean;
|
|
39
50
|
/** Override REST API base. Defaults are env-aware. */
|
|
40
51
|
apiBase?: string;
|
|
41
52
|
/** Override GraphQL base. Defaults are env-aware. */
|
|
@@ -71,6 +82,8 @@ interface ResolvedConfig {
|
|
|
71
82
|
platform: VioPlatform;
|
|
72
83
|
contentId?: string | number;
|
|
73
84
|
contentTitle?: string;
|
|
85
|
+
campaignId?: number;
|
|
86
|
+
debug: boolean;
|
|
74
87
|
apiBase: string;
|
|
75
88
|
graphQLBase: string;
|
|
76
89
|
eventsBase: string;
|
|
@@ -194,6 +207,8 @@ interface BootstrapSlot {
|
|
|
194
207
|
platform?: string | null;
|
|
195
208
|
startDate?: string | null;
|
|
196
209
|
endDate?: string | null;
|
|
210
|
+
/** Who assigned it: the dashboard (always wins) or a page's own campaign (campaigns micro PR #16). */
|
|
211
|
+
source?: 'dashboard' | 'page' | null;
|
|
197
212
|
}
|
|
198
213
|
/**
|
|
199
214
|
* One entry of `campaigns[]`: every active campaign of the surface, with its
|
|
@@ -240,6 +255,8 @@ interface BootstrapResponse {
|
|
|
240
255
|
interface ManifestLocation {
|
|
241
256
|
id: string;
|
|
242
257
|
displayName?: string;
|
|
258
|
+
/** The campaign this location belongs to when it differs from the page's (`ManifestRequest.campaignId`). */
|
|
259
|
+
campaignId?: number;
|
|
243
260
|
}
|
|
244
261
|
/**
|
|
245
262
|
* Where something happened, as `Vio.attribution(slot)` answers it — the ONE
|
|
@@ -265,6 +282,12 @@ interface ManifestRequest {
|
|
|
265
282
|
*/
|
|
266
283
|
mode: 'merge' | 'replace';
|
|
267
284
|
locations: ManifestLocation[];
|
|
285
|
+
/**
|
|
286
|
+
* The campaign the PAGE belongs to (`Vio.init({ campaignId })`): the micro
|
|
287
|
+
* assigns every declared location to it (`source: 'page'`) unless the
|
|
288
|
+
* dashboard already assigned that slot.
|
|
289
|
+
*/
|
|
290
|
+
campaignId?: number;
|
|
268
291
|
}
|
|
269
292
|
/** Response of `POST /v2/mobile/components/manifest`. */
|
|
270
293
|
interface ManifestResult {
|
|
@@ -275,6 +298,12 @@ interface ManifestResult {
|
|
|
275
298
|
id: number | string;
|
|
276
299
|
locationId: string;
|
|
277
300
|
displayName?: string | null;
|
|
301
|
+
/**
|
|
302
|
+
* What the micro did with the page's campaign for this slot: `created` /
|
|
303
|
+
* `kept` / `replaced` a page assignment, `dashboard` (the dashboard's
|
|
304
|
+
* assignment stands — the page's campaign is ignored there), `none`.
|
|
305
|
+
*/
|
|
306
|
+
assignment?: 'created' | 'kept' | 'replaced' | 'dashboard' | 'none';
|
|
278
307
|
}>;
|
|
279
308
|
deprecatedCount: number;
|
|
280
309
|
warnings: Array<{
|
|
@@ -573,6 +602,13 @@ declare class CartManager extends EventTarget {
|
|
|
573
602
|
* waiting (a quantity intent replayed by an AddItem reconcile). No-op if
|
|
574
603
|
* nothing is pending. */
|
|
575
604
|
waitForCartMutations(sponsorId: number): Promise<void>;
|
|
605
|
+
/**
|
|
606
|
+
* True while an AddItem/UpdateItem/DeleteItem of this sponsor OTHER than
|
|
607
|
+
* `except` has not settled. A mutation applying its own answer passes
|
|
608
|
+
* itself: its response is current for what IT sent — only the others make
|
|
609
|
+
* it stale.
|
|
610
|
+
*/
|
|
611
|
+
private hasMutationsInFlight;
|
|
576
612
|
/** Register a backend mutation so `waitForCartMutations` can await it. */
|
|
577
613
|
private trackMutation;
|
|
578
614
|
private qtySyncKey;
|
|
@@ -592,7 +628,11 @@ declare class CartManager extends EventTarget {
|
|
|
592
628
|
private emitError;
|
|
593
629
|
/** Ensure the sponsor cart exists server-side; returns its backend cart id. */
|
|
594
630
|
ensureCartId(sponsorId: number, currency?: string, shippingCountry?: string): Promise<string | undefined>;
|
|
595
|
-
/**
|
|
631
|
+
/**
|
|
632
|
+
* Overwrite local cart state with the backend cart response (source of
|
|
633
|
+
* truth). `opts.settling` is the mutation whose answer this is: it does not
|
|
634
|
+
* count as "in flight" for the origins (see `hasMutationsInFlight`).
|
|
635
|
+
*/
|
|
596
636
|
updateFromBackendCart(sponsorId: number, backendCart: {
|
|
597
637
|
cart_id?: string;
|
|
598
638
|
currency?: string;
|
|
@@ -621,6 +661,8 @@ declare class CartManager extends EventTarget {
|
|
|
621
661
|
shipping?: unknown;
|
|
622
662
|
available_shippings?: unknown[];
|
|
623
663
|
}>;
|
|
664
|
+
}, opts?: {
|
|
665
|
+
settling?: Promise<unknown>;
|
|
624
666
|
}): void;
|
|
625
667
|
/** Add a Product DTO to a sponsor's cart. Bumps quantity if already present.
|
|
626
668
|
* When a variantId is given, the line uses the VARIANT's price / image / title
|
|
@@ -1908,6 +1950,96 @@ declare class CheckoutManager extends EventTarget {
|
|
|
1908
1950
|
private emit;
|
|
1909
1951
|
}
|
|
1910
1952
|
|
|
1953
|
+
/**
|
|
1954
|
+
* Slots — the pure half of ADR-0027 / ADR-0034 on the web.
|
|
1955
|
+
*
|
|
1956
|
+
* A slot is a NAME for a place on a page. The page declares its slots to the
|
|
1957
|
+
* campaigns service (`Vio.declareSlots()` / `Vio.registerSlot()` in client.ts),
|
|
1958
|
+
* the dashboard assigns a campaign to each one, optionally with a date window,
|
|
1959
|
+
* and `GET /v2/mobile/config` answers with `campaigns[].slots[]` — only the
|
|
1960
|
+
* assignments whose window is open NOW. Whatever no slot names shows the
|
|
1961
|
+
* surface's default campaign (`campaign`).
|
|
1962
|
+
*
|
|
1963
|
+
* Everything here is side-effect free and never throws on a malformed
|
|
1964
|
+
* bootstrap: a broken `campaigns[]` must never blank a product block or break
|
|
1965
|
+
* `track()`.
|
|
1966
|
+
*/
|
|
1967
|
+
|
|
1968
|
+
/** What `Vio.declareSlots()` accepts per slot. */
|
|
1969
|
+
type SlotInput = string | {
|
|
1970
|
+
id: string;
|
|
1971
|
+
displayName?: string;
|
|
1972
|
+
campaignId?: number;
|
|
1973
|
+
};
|
|
1974
|
+
type BootLike = Pick<BootstrapResponse, 'campaign' | 'campaigns' | 'primarySponsor' | 'secondarySponsors'>;
|
|
1975
|
+
/**
|
|
1976
|
+
* The campaign a slot shows right now. Among the `status === 'active'`
|
|
1977
|
+
* entries of `campaigns[]`, the one with an assignment named `slot` for this
|
|
1978
|
+
* platform (`platform` null on the assignment, or equal to `platform`) whose
|
|
1979
|
+
* window contains `now` (`startDate <= now < endDate`, null = open). When
|
|
1980
|
+
* several qualify, the surface's default campaign wins, else the first the
|
|
1981
|
+
* backend lists.
|
|
1982
|
+
*
|
|
1983
|
+
* No assignment → the PAGE's campaign (`pageCampaignId`: the element's own
|
|
1984
|
+
* `vio-campaign`, an ancestor's `data-vio-campaign`, or `Vio.init({ campaignId })`)
|
|
1985
|
+
* when `campaigns[]` lists it as active — an editorial page resolves to its
|
|
1986
|
+
* campaign before (and regardless of) the manifest round-trip. Else the
|
|
1987
|
+
* default campaign: the `campaigns[]` entry whose id is `campaign.id`, or a
|
|
1988
|
+
* minimal entry built from `campaign` (+ the top-level sponsors) when the
|
|
1989
|
+
* list does not carry it. No bootstrap → null.
|
|
1990
|
+
*/
|
|
1991
|
+
declare function resolveSlotCampaign(boot: BootLike | null | undefined, slot: string | null | undefined, now?: number, platform?: string | null, pageCampaignId?: CampaignHint, sponsorId?: number | null): BootstrapCampaignEntry | null;
|
|
1992
|
+
/**
|
|
1993
|
+
* The sponsor rule: the active campaign of `campaigns[]` the sponsor takes
|
|
1994
|
+
* part in, as its primary or one of its secondaries — when it is in several,
|
|
1995
|
+
* the surface's default campaign if it is one of them, else the first one
|
|
1996
|
+
* the backend lists. Null when none (or on a malformed list).
|
|
1997
|
+
*/
|
|
1998
|
+
declare function sponsorCampaignEntry(boot: BootLike | null | undefined, sponsorId: number | null | undefined): BootstrapCampaignEntry | null;
|
|
1999
|
+
/**
|
|
2000
|
+
* A page campaign as the callers give it: one id, or the candidates in
|
|
2001
|
+
* precedence order (the element's `vio-campaign`, an ancestor's
|
|
2002
|
+
* `data-vio-campaign`, `Vio.init`'s). An unusable level (invalid, paused,
|
|
2003
|
+
* unknown) falls through to the next one; `0`, `null`, `''` mean unset.
|
|
2004
|
+
*/
|
|
2005
|
+
type CampaignHint = number | string | null | undefined | ReadonlyArray<number | string | null | undefined>;
|
|
2006
|
+
/**
|
|
2007
|
+
* A campaign id as the SDK accepts it: a positive safe integer, given as a
|
|
2008
|
+
* number or as a string of decimal digits (an attribute). Anything else —
|
|
2009
|
+
* `true`, `'0x10'`, `'1e3'`, an array, a float — is "absent".
|
|
2010
|
+
*/
|
|
2011
|
+
declare function toCampaignId(value: unknown): number | undefined;
|
|
2012
|
+
/** The usable ids of a hint, in order, without duplicates. */
|
|
2013
|
+
declare function campaignCandidates(hint: CampaignHint): number[];
|
|
2014
|
+
/**
|
|
2015
|
+
* The first candidate of `hint` that `campaigns[]` lists as ACTIVE (and, when
|
|
2016
|
+
* `sponsorId` is given, that the sponsor takes part in — primary or
|
|
2017
|
+
* secondary); null when none — a paused, ended or unknown page campaign is
|
|
2018
|
+
* ignored and the resolution moves on.
|
|
2019
|
+
*/
|
|
2020
|
+
declare function activeCampaignEntry(boot: BootLike | null | undefined, hint: CampaignHint, sponsorId?: number): BootstrapCampaignEntry | null;
|
|
2021
|
+
/** The kinds of Vio element that register themselves. */
|
|
2022
|
+
type SlotKind = 'card' | 'carousel' | 'detail';
|
|
2023
|
+
/**
|
|
2024
|
+
* The id an element gets when the host set no `vio-slot`:
|
|
2025
|
+
* `${scope ? scope + '-' : ''}${kind}-${ordinal + 1}` (`carousel-1`, `card-3`,
|
|
2026
|
+
* `article-123-carousel-1`), `ordinal` being the element's index among the
|
|
2027
|
+
* same-kind Vio elements WITH THE SAME SCOPE, in document order at connect
|
|
2028
|
+
* time. The scope is inherited from the DOM (`vio-scope` on the element, else
|
|
2029
|
+
* the nearest `data-vio-scope` ancestor): a Vev page or a Replit article
|
|
2030
|
+
* (`<body data-vio-scope="article-123">`) gets per-page slots with one line
|
|
2031
|
+
* and no per-element naming; a template that wants slots shared across
|
|
2032
|
+
* articles simply sets no scope. On purpose there is NO page path in the id:
|
|
2033
|
+
* the article goes to analytics as `content_id`, not into the slot. Stable
|
|
2034
|
+
* across reloads while the layout is; a layout change leaves a stale entry,
|
|
2035
|
+
* which ADR-0034 accepts.
|
|
2036
|
+
*/
|
|
2037
|
+
declare function autoSlotId(kind: SlotKind, ordinal: number, scope?: string | null): string;
|
|
2038
|
+
/** `"Carousel 1"`, `"Card 3"` — with ` · ${scopeName}` when the scope has a human label. */
|
|
2039
|
+
declare function autoSlotDisplayName(kind: SlotKind, ordinal: number, scopeName?: string | null): string;
|
|
2040
|
+
/** A scope value fit for an id: trimmed, inner whitespace → `-`. */
|
|
2041
|
+
declare function normalizeScope(scope: string | null | undefined): string;
|
|
2042
|
+
|
|
1911
2043
|
/**
|
|
1912
2044
|
* Vio.analytics — the web SDK's half of the Vio Analytics pipeline.
|
|
1913
2045
|
*
|
|
@@ -2102,16 +2234,23 @@ declare class AnalyticsManager extends EventTarget {
|
|
|
2102
2234
|
/** The lines of the cart (current, else the pre-clear snapshot), optionally one sponsor's. */
|
|
2103
2235
|
private cartLines;
|
|
2104
2236
|
/**
|
|
2105
|
-
* The cart split per campaign
|
|
2106
|
-
*
|
|
2107
|
-
*
|
|
2108
|
-
* the line's sponsor. One slice per campaign: its items (quantities from
|
|
2109
|
-
* the origins), its value, and the slot / content when they are the same
|
|
2110
|
-
* for the whole slice. A cart with one campaign is one slice.
|
|
2237
|
+
* The cart split per campaign — the shared rule of cart/slices.ts over the
|
|
2238
|
+
* current cart (else the pre-clear snapshot), plus whether any unit named
|
|
2239
|
+
* its campaign itself (a cart without origins is reported as before).
|
|
2111
2240
|
*/
|
|
2112
2241
|
private cartSlices;
|
|
2113
|
-
/**
|
|
2242
|
+
/**
|
|
2243
|
+
* The context of one of several per-campaign events: the slice's campaign,
|
|
2244
|
+
* slot and content — only its own; when the slice spans several slots or
|
|
2245
|
+
* articles the event names none rather than the one the click came from.
|
|
2246
|
+
*/
|
|
2114
2247
|
private sliceContext;
|
|
2248
|
+
/**
|
|
2249
|
+
* The context of a single-campaign checkout/purchase: when the cart's origins
|
|
2250
|
+
* say which campaign they came from, the event says it too (plus the slot /
|
|
2251
|
+
* content when unique) — a cart without origins is exactly as before.
|
|
2252
|
+
*/
|
|
2253
|
+
private singleSliceContext;
|
|
2115
2254
|
/** Current cart → commerce payload; falls back to the pre-clear snapshot. */
|
|
2116
2255
|
private cartCommerce;
|
|
2117
2256
|
private findLine;
|
|
@@ -2120,6 +2259,8 @@ declare class AnalyticsManager extends EventTarget {
|
|
|
2120
2259
|
* The `campaign_id` of an event. In order: the context's explicit id; the
|
|
2121
2260
|
* campaign assigned to the context's `slot` right now (ADR-0027 — only an
|
|
2122
2261
|
* open assignment for the init platform counts, see `findSlotAssignment`);
|
|
2262
|
+
* the PAGE's campaign (`opts.pageCampaignId`, else `Vio.init({ campaignId })`)
|
|
2263
|
+
* when `campaigns[]` lists it as active (ADR-0034, amendment 3);
|
|
2123
2264
|
* the active campaign of `campaigns[]` the event's sponsor takes part in, as
|
|
2124
2265
|
* its primary or one of its secondaries — when it is in several, the
|
|
2125
2266
|
* surface's default campaign if it is one of them, else the first one the
|
|
@@ -2130,7 +2271,9 @@ declare class AnalyticsManager extends EventTarget {
|
|
|
2130
2271
|
* A malformed `campaigns[]` (not an array, a null entry) never breaks
|
|
2131
2272
|
* `track()`: it falls back to `campaign.id`.
|
|
2132
2273
|
*/
|
|
2133
|
-
declare function resolveCampaignId(ctx: Pick<AnalyticsContext, 'campaignId' | 'sponsorId' | 'slot'>, boot: Pick<BootstrapResponse, 'campaign' | 'campaigns'> | null | undefined
|
|
2274
|
+
declare function resolveCampaignId(ctx: Pick<AnalyticsContext, 'campaignId' | 'sponsorId' | 'slot'>, boot: Pick<BootstrapResponse, 'campaign' | 'campaigns'> | null | undefined, opts?: {
|
|
2275
|
+
pageCampaignId?: CampaignHint;
|
|
2276
|
+
}): number | undefined;
|
|
2134
2277
|
/**
|
|
2135
2278
|
* `detail` of `vio:payment-success` as the checkout emits it. Four paths,
|
|
2136
2279
|
* three shapes: a redirect return (`orderId` = Vio's checkout id), the
|
|
@@ -2143,6 +2286,8 @@ interface PaymentSuccessDetail {
|
|
|
2143
2286
|
sponsorId?: number | string;
|
|
2144
2287
|
/** The slot the purchase started from, when the emitter knows it. */
|
|
2145
2288
|
slot?: string;
|
|
2289
|
+
/** The campaign the emitter attributed the purchase to (its `Vio.attribution`). */
|
|
2290
|
+
campaignId?: number;
|
|
2146
2291
|
/** Per-element content override (`vio-content-id` / `vio-content-title`), when the emitter carries one. */
|
|
2147
2292
|
contentId?: string | number;
|
|
2148
2293
|
contentTitle?: string;
|
|
@@ -2189,8 +2334,8 @@ declare function purchaseFromPaymentSuccess(d: PaymentSuccessDetail): Pick<Analy
|
|
|
2189
2334
|
*
|
|
2190
2335
|
* Pure: `resolveContent()` takes the document and location (defaults to the
|
|
2191
2336
|
* globals) so it can be tested, never throws, and answers `{}` where there is
|
|
2192
|
-
* no DOM (SSR, node tests). `Vio.content()`
|
|
2193
|
-
*
|
|
2337
|
+
* no DOM (SSR, node tests). `Vio.content()` resolves it live on every call —
|
|
2338
|
+
* an SPA route change or a new title is seen on the next event.
|
|
2194
2339
|
*/
|
|
2195
2340
|
interface ContentRef {
|
|
2196
2341
|
id?: string;
|
|
@@ -2214,60 +2359,37 @@ declare function resolveContent(init?: ContentInit | null, doc?: Document | null
|
|
|
2214
2359
|
} | null | undefined): ContentRef;
|
|
2215
2360
|
|
|
2216
2361
|
/**
|
|
2217
|
-
*
|
|
2218
|
-
*
|
|
2219
|
-
*
|
|
2220
|
-
* campaigns service (`Vio.declareSlots()` / `Vio.registerSlot()` in client.ts),
|
|
2221
|
-
* the dashboard assigns a campaign to each one, optionally with a date window,
|
|
2222
|
-
* and `GET /v2/mobile/config` answers with `campaigns[].slots[]` — only the
|
|
2223
|
-
* assignments whose window is open NOW. Whatever no slot names shows the
|
|
2224
|
-
* surface's default campaign (`campaign`).
|
|
2362
|
+
* The cart split per campaign (ADR-0034) — ONE rule, shared by the SDK's own
|
|
2363
|
+
* `begin_checkout` / `purchase` events, by `Vio.cartSlices()` and so by any
|
|
2364
|
+
* host with its own analytics sink (Vev).
|
|
2225
2365
|
*
|
|
2226
|
-
*
|
|
2227
|
-
*
|
|
2228
|
-
* `
|
|
2366
|
+
* Every unit of every line goes to the campaign of its origin — the one the
|
|
2367
|
+
* place showed when it was added — and units without one to the campaign the
|
|
2368
|
+
* caller's rule resolves for the line's sponsor (`resolveCampaign`). One slice
|
|
2369
|
+
* per campaign: its items (quantities from the origins, merged per product +
|
|
2370
|
+
* variant), its value with two decimals, and `slot` / `contentId` /
|
|
2371
|
+
* `sponsorId` only when they are the same for the whole slice. A cart with
|
|
2372
|
+
* one campaign is one slice. Pure; never throws on odd lines.
|
|
2229
2373
|
*/
|
|
2230
2374
|
|
|
2231
|
-
/**
|
|
2232
|
-
type
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
declare function resolveSlotCampaign(boot: BootLike | null | undefined, slot: string | null | undefined, now?: number, platform?: string | null): BootstrapCampaignEntry | null;
|
|
2250
|
-
/** The kinds of Vio element that register themselves. */
|
|
2251
|
-
type SlotKind = 'card' | 'carousel' | 'detail';
|
|
2252
|
-
/**
|
|
2253
|
-
* The id an element gets when the host set no `vio-slot`:
|
|
2254
|
-
* `${scope ? scope + '-' : ''}${kind}-${ordinal + 1}` (`carousel-1`, `card-3`,
|
|
2255
|
-
* `article-123-carousel-1`), `ordinal` being the element's index among the
|
|
2256
|
-
* same-kind Vio elements WITH THE SAME SCOPE, in document order at connect
|
|
2257
|
-
* time. The scope is inherited from the DOM (`vio-scope` on the element, else
|
|
2258
|
-
* the nearest `data-vio-scope` ancestor): a Vev page or a Replit article
|
|
2259
|
-
* (`<body data-vio-scope="article-123">`) gets per-page slots with one line
|
|
2260
|
-
* and no per-element naming; a template that wants slots shared across
|
|
2261
|
-
* articles simply sets no scope. On purpose there is NO page path in the id:
|
|
2262
|
-
* the article goes to analytics as `content_id`, not into the slot. Stable
|
|
2263
|
-
* across reloads while the layout is; a layout change leaves a stale entry,
|
|
2264
|
-
* which ADR-0034 accepts.
|
|
2265
|
-
*/
|
|
2266
|
-
declare function autoSlotId(kind: SlotKind, ordinal: number, scope?: string | null): string;
|
|
2267
|
-
/** `"Carousel 1"`, `"Card 3"` — with ` · ${scopeName}` when the scope has a human label. */
|
|
2268
|
-
declare function autoSlotDisplayName(kind: SlotKind, ordinal: number, scopeName?: string | null): string;
|
|
2269
|
-
/** A scope value fit for an id: trimmed, inner whitespace → `-`. */
|
|
2270
|
-
declare function normalizeScope(scope: string | null | undefined): string;
|
|
2375
|
+
/** An item of a slice — the analytics item shape (ids as given, normalized on the wire). */
|
|
2376
|
+
type VioItem = AnalyticsItemInput;
|
|
2377
|
+
/** One campaign's share of the cart. */
|
|
2378
|
+
interface CartSlice {
|
|
2379
|
+
campaignId?: number;
|
|
2380
|
+
sponsorId?: number;
|
|
2381
|
+
slot?: string;
|
|
2382
|
+
contentId?: string;
|
|
2383
|
+
items: VioItem[];
|
|
2384
|
+
value: number;
|
|
2385
|
+
currency?: string;
|
|
2386
|
+
/** 1-based position of this slice and how many there are. */
|
|
2387
|
+
slice: number;
|
|
2388
|
+
slices: number;
|
|
2389
|
+
}
|
|
2390
|
+
/** The campaign of a unit without an explicit one: the caller's rule (slot assignment → sponsor → default). */
|
|
2391
|
+
type ResolveCampaign = (slot: string | undefined, sponsorId: number) => number | undefined;
|
|
2392
|
+
declare function cartSlicesFrom(lines: ReadonlyArray<CartLineItem>, resolveCampaign: ResolveCampaign, fallbackCurrency?: string): CartSlice[];
|
|
2271
2393
|
|
|
2272
2394
|
declare class VioFacade {
|
|
2273
2395
|
private apiInstance;
|
|
@@ -2281,14 +2403,20 @@ declare class VioFacade {
|
|
|
2281
2403
|
* (another key or environment) is still in flight after a re-init; its answer
|
|
2282
2404
|
* belongs to that configuration and must not land in this one. */
|
|
2283
2405
|
private generation;
|
|
2284
|
-
/** Slot ids present on the page (`Vio.registerSlot`): how many elements hold each
|
|
2406
|
+
/** Slot ids present on the page (`Vio.registerSlot`): how many elements hold each, its display name and its own campaign. */
|
|
2285
2407
|
private slotRegistry;
|
|
2408
|
+
/** Slots already warned about (`dashboard`: the dashboard's assignment stands; `replaced`: this page moved it). */
|
|
2409
|
+
private warnedDashboardSlots;
|
|
2410
|
+
private warnedReplacedSlots;
|
|
2286
2411
|
/** Pending debounced declaration of the registry. */
|
|
2287
2412
|
private slotDeclareTimer;
|
|
2288
2413
|
/** A name appeared (or the key changed) since the registry was last declared. */
|
|
2289
2414
|
private slotsDirty;
|
|
2290
|
-
/**
|
|
2291
|
-
private
|
|
2415
|
+
/** Manifests POSTed by this page load (abuse / rollout guard, see declareSlots). */
|
|
2416
|
+
private declarationsThisLoad;
|
|
2417
|
+
/** Each cap warns once per page load. */
|
|
2418
|
+
private warnedLocationCap;
|
|
2419
|
+
private warnedDeclarationCap;
|
|
2292
2420
|
private cartManager;
|
|
2293
2421
|
private checkoutManager;
|
|
2294
2422
|
private analyticsManager;
|
|
@@ -2296,10 +2424,11 @@ declare class VioFacade {
|
|
|
2296
2424
|
/**
|
|
2297
2425
|
* The content (article, page) this SDK instance is rendered in — what every
|
|
2298
2426
|
* analytics event carries as `content_id` / `content_title` when the event
|
|
2299
|
-
* has no explicit one
|
|
2300
|
-
*
|
|
2301
|
-
*
|
|
2302
|
-
* a
|
|
2427
|
+
* has no explicit one: init option → URL query → `vio:content-*` metas →
|
|
2428
|
+
* canonical/og:url → pathname (see `resolveContent`). Resolved LIVE on each
|
|
2429
|
+
* call — a few querySelectors — so an SPA route change, a new canonical or
|
|
2430
|
+
* a new title are seen without any re-init. Never throws; `{}` without a
|
|
2431
|
+
* document.
|
|
2303
2432
|
*/
|
|
2304
2433
|
content(): ContentRef;
|
|
2305
2434
|
get isInitialized(): boolean;
|
|
@@ -2347,19 +2476,32 @@ declare class VioFacade {
|
|
|
2347
2476
|
/**
|
|
2348
2477
|
* Register a slot present on the page (the `<vio-*>` elements call it with
|
|
2349
2478
|
* their effective id — the host's `vio-slot` or the auto-generated one —
|
|
2350
|
-
*
|
|
2351
|
-
*
|
|
2352
|
-
*
|
|
2353
|
-
*
|
|
2354
|
-
*
|
|
2479
|
+
* the optional display name, and the element's own campaign when it has
|
|
2480
|
+
* one: `vio-campaign` or an ancestor's `data-vio-campaign`). The registry is
|
|
2481
|
+
* declared ONCE, debounced, after the first successful bootstrap — and again
|
|
2482
|
+
* whenever a new id, display name or campaign appears. A `displayName` /
|
|
2483
|
+
* `campaignId` given later for an id already registered replaces the one
|
|
2484
|
+
* kept; `undefined` leaves it alone. The returned function unregisters;
|
|
2485
|
+
* removal never re-declares.
|
|
2355
2486
|
*/
|
|
2356
|
-
registerSlot(name: string, displayName?: string): () => void;
|
|
2487
|
+
registerSlot(name: string, displayName?: string, campaignId?: number | string | null): () => void;
|
|
2357
2488
|
/**
|
|
2358
2489
|
* The campaign a slot shows now, from the last bootstrap: its assigned and
|
|
2359
2490
|
* open campaign for the init platform, else the surface's default. With no
|
|
2360
2491
|
* slot, the default. `null` before the bootstrap. See `resolveSlotCampaign`.
|
|
2361
2492
|
*/
|
|
2362
|
-
campaignForSlot(slot?: string | null
|
|
2493
|
+
campaignForSlot(slot?: string | null, hint?: {
|
|
2494
|
+
campaignId?: CampaignHint;
|
|
2495
|
+
sponsorId?: number | string | null;
|
|
2496
|
+
}): BootstrapCampaignEntry | null;
|
|
2497
|
+
/** The page-campaign candidates in precedence order: the element's (own, ancestor), then `Vio.init`'s. */
|
|
2498
|
+
private pageCampaignCandidates;
|
|
2499
|
+
/**
|
|
2500
|
+
* The campaign the PAGE belongs to (`Vio.init({ campaignId })`, ADR-0034
|
|
2501
|
+
* amendment 3), as the last bootstrap lists it — only when it is there and
|
|
2502
|
+
* active; `null` otherwise (no page campaign, paused, unknown, no bootstrap).
|
|
2503
|
+
*/
|
|
2504
|
+
pageCampaign(): BootstrapCampaignEntry | null;
|
|
2363
2505
|
/**
|
|
2364
2506
|
* THE attribution helper — the SDK elements, Vev and Replit all use this
|
|
2365
2507
|
* one. For a place (`slot`): the campaign it shows right now
|
|
@@ -2370,12 +2512,45 @@ declare class VioFacade {
|
|
|
2370
2512
|
*
|
|
2371
2513
|
* `hint.sponsorId` — when the caller already knows the sponsor (a card with
|
|
2372
2514
|
* `sponsor-id`) it is kept as `sponsorId`, and the campaign follows the same
|
|
2373
|
-
* cascade analytics uses (slot assignment → the sponsor's
|
|
2374
|
-
* default), so what the cart remembers matches what the
|
|
2515
|
+
* cascade analytics uses (slot assignment → page campaign → the sponsor's
|
|
2516
|
+
* active campaign → default), so what the cart remembers matches what the
|
|
2517
|
+
* events say — the page campaign applies there only when that sponsor takes
|
|
2518
|
+
* part in it. `hint.campaignId` — the element's own page campaign
|
|
2519
|
+
* candidates (`vio-campaign`, an ancestor's `data-vio-campaign`), ahead of
|
|
2520
|
+
* `Vio.init`'s; an unusable one falls through to the next; `0` = unset.
|
|
2375
2521
|
*/
|
|
2376
2522
|
attribution(slot?: string | null, hint?: {
|
|
2377
2523
|
sponsorId?: number | string;
|
|
2524
|
+
campaignId?: CampaignHint;
|
|
2378
2525
|
}): Attribution;
|
|
2526
|
+
/**
|
|
2527
|
+
* The cart split per campaign — the SAME rule `begin_checkout` / `purchase`
|
|
2528
|
+
* use, for hosts with their own analytics sink (Vev). Every unit of every
|
|
2529
|
+
* line goes to the campaign of its origin; units without one to the campaign
|
|
2530
|
+
* the current rule resolves for the line's sponsor (slot assignment → the
|
|
2531
|
+
* sponsor's active campaign → default); `slot` / `contentId` / `sponsorId`
|
|
2532
|
+
* only when they are the same for the whole slice; `value` with two
|
|
2533
|
+
* decimals; `slice` / `slices` number the parts. Pure over the current cart
|
|
2534
|
+
* (or over `opts.items`); `[]` when there is nothing.
|
|
2535
|
+
*/
|
|
2536
|
+
cartSlices(sponsorId?: number, opts?: {
|
|
2537
|
+
items?: CartLineItem[];
|
|
2538
|
+
}): CartSlice[];
|
|
2539
|
+
/**
|
|
2540
|
+
* What the micro did with the page's campaign per slot (`assignment`):
|
|
2541
|
+
* `console.debug` when `Vio.init({ debug: true })`; a warning once per
|
|
2542
|
+
* slot when the dashboard's own assignment stands (only for a slot this
|
|
2543
|
+
* page actually sent a campaign for) and once per slot when this page moved
|
|
2544
|
+
* it from an earlier page assignment (`replaced`).
|
|
2545
|
+
*/
|
|
2546
|
+
private reportAssignments;
|
|
2547
|
+
/**
|
|
2548
|
+
* The memory keys of the sent locations whose campaign the micro did not
|
|
2549
|
+
* take up: every location when a campaign was sent and no answer carries
|
|
2550
|
+
* `assignment` (an older micro), or the ones answered `none` for a campaign
|
|
2551
|
+
* the bootstrap lists as active. They are remembered with the 1 h TTL.
|
|
2552
|
+
*/
|
|
2553
|
+
private campaignNotTakenUp;
|
|
2379
2554
|
private scheduleSlotDeclaration;
|
|
2380
2555
|
private findSponsor;
|
|
2381
2556
|
}
|
|
@@ -2388,7 +2563,7 @@ declare const Vio: VioFacade;
|
|
|
2388
2563
|
*
|
|
2389
2564
|
* RELEASE CHECKLIST: bump together with package.json (see CONTRIBUTING).
|
|
2390
2565
|
*/
|
|
2391
|
-
declare const SDK_VERSION = "0.
|
|
2566
|
+
declare const SDK_VERSION = "0.24.0";
|
|
2392
2567
|
|
|
2393
2568
|
/**
|
|
2394
2569
|
* Vipps MobilePay's own button, the way the design guidelines ask for it.
|
|
@@ -2417,4 +2592,4 @@ declare function vippsButtonAttributes(verb?: 'buy' | 'pay' | 'express' | 'conti
|
|
|
2417
2592
|
language?: string;
|
|
2418
2593
|
}): Record<string, string>;
|
|
2419
2594
|
|
|
2420
|
-
export { ADD_ITEM_MUTATION, type AddManualOptions, type AddProductOptions, type AnalyticsCommerce, type AnalyticsContext, type AnalyticsEventName, type AnalyticsItemInput, AnalyticsManager, type AnalyticsStartOptions, type ApplePayConfig, type ApplePayResult, type Attribution, type BootstrapCampaign, type BootstrapCampaignEntry, type BootstrapCampaignStatus, type BootstrapResponse, type BootstrapSlot, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, type CartChangeDetail, type CartLineItem, type CartLineOrigin, CartManager, type CartOrigin, type CartQueryOptions, type CheckoutAddress, type CheckoutChangeDetail, CheckoutManager, type CheckoutState, CommerceClient, Configuration, type ContentRef, type CreatePaymentVippsResponse, type CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, type Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, type GetVippsStatusVariables, type ImageSize, type ManifestLocation, type ManifestRequest, type ManifestResult, type PaymentCompleteDetail, type PaymentMethod, type PaymentSelectDetail, type PaymentSuccessDetail, type PaymentSuccessResult, type PlacementComponent, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductPrice, type ProductVariant, type ResolvedConfig, SDK_VERSION, type SlotInput, type SlotKind, type Sponsor, type SponsorCartState, type SponsorCommerceBlock, type TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, type VioConfig, type VioPlatform, type VippsPaymentState, type VippsStatusResult, addItem, autoSlotDisplayName, autoSlotId, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, lineOrigins, normalizeOrigin, normalizeScope, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, resolveContent, resolveSlotCampaign, sameOrigin, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes };
|
|
2595
|
+
export { ADD_ITEM_MUTATION, type AddManualOptions, type AddProductOptions, type AnalyticsCommerce, type AnalyticsContext, type AnalyticsEventName, type AnalyticsItemInput, AnalyticsManager, type AnalyticsStartOptions, type ApplePayConfig, type ApplePayResult, type Attribution, type BootstrapCampaign, type BootstrapCampaignEntry, type BootstrapCampaignStatus, type BootstrapResponse, type BootstrapSlot, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, type CampaignHint, type CartChangeDetail, type CartLineItem, type CartLineOrigin, CartManager, type CartOrigin, type CartQueryOptions, type CartSlice, type CheckoutAddress, type CheckoutChangeDetail, CheckoutManager, type CheckoutState, CommerceClient, Configuration, type ContentRef, type CreatePaymentVippsResponse, type CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, type Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, type GetVippsStatusVariables, type ImageSize, type ManifestLocation, type ManifestRequest, type ManifestResult, type PaymentCompleteDetail, type PaymentMethod, type PaymentSelectDetail, type PaymentSuccessDetail, type PaymentSuccessResult, type PlacementComponent, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductPrice, type ProductVariant, type ResolvedConfig, SDK_VERSION, type SlotInput, type SlotKind, type Sponsor, type SponsorCartState, type SponsorCommerceBlock, type TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, type VioConfig, type VioItem, type VioPlatform, type VippsPaymentState, type VippsStatusResult, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, campaignCandidates, cartSlicesFrom, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, lineOrigins, normalizeOrigin, normalizeScope, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, resolveContent, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes };
|
package/dist/core/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../chunk-
|
|
2
|
-
export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, addItem, autoSlotDisplayName, autoSlotId, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, lineOrigins, normalizeOrigin, normalizeScope, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, resolveContent, resolveSlotCampaign, sameOrigin, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from '../chunk-
|
|
1
|
+
import '../chunk-45YKS5UG.js';
|
|
2
|
+
export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, campaignCandidates, cartSlicesFrom, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, lineOrigins, normalizeOrigin, normalizeScope, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, resolveContent, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from '../chunk-AXJKB2CW.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ADD_ITEM_MUTATION, AddManualOptions, AddProductOptions, AnalyticsCommerce, AnalyticsContext, AnalyticsEventName, AnalyticsItemInput, AnalyticsManager, AnalyticsStartOptions, ApplePayConfig, ApplePayResult, Attribution, BootstrapCampaign, BootstrapCampaignEntry, BootstrapCampaignStatus, BootstrapResponse, BootstrapSlot, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartChangeDetail, CartLineItem, CartLineOrigin, CartManager, CartOrigin, CartQueryOptions, CheckoutAddress, CheckoutChangeDetail, CheckoutManager, CheckoutState, CommerceClient, Configuration, ContentRef, CreatePaymentVippsResponse, CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GetVippsStatusVariables, ImageSize, ManifestLocation, ManifestRequest, ManifestResult, PaymentCompleteDetail, PaymentMethod, PaymentSelectDetail, PaymentSuccessDetail, PaymentSuccessResult, PlacementComponent, Product, ProductCategory, ProductImage, ProductOption, ProductPrice, ProductVariant, ResolvedConfig, SDK_VERSION, SlotInput, SlotKind, Sponsor, SponsorCartState, SponsorCommerceBlock, TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, VioConfig, VioPlatform, VippsPaymentState, VippsStatusResult, addItem, autoSlotDisplayName, autoSlotId, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, lineOrigins, normalizeOrigin, normalizeScope, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, resolveContent, resolveSlotCampaign, sameOrigin, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from './core/index.js';
|
|
1
|
+
export { ADD_ITEM_MUTATION, AddManualOptions, AddProductOptions, AnalyticsCommerce, AnalyticsContext, AnalyticsEventName, AnalyticsItemInput, AnalyticsManager, AnalyticsStartOptions, ApplePayConfig, ApplePayResult, Attribution, BootstrapCampaign, BootstrapCampaignEntry, BootstrapCampaignStatus, BootstrapResponse, BootstrapSlot, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CampaignHint, CartChangeDetail, CartLineItem, CartLineOrigin, CartManager, CartOrigin, CartQueryOptions, CartSlice, CheckoutAddress, CheckoutChangeDetail, CheckoutManager, CheckoutState, CommerceClient, Configuration, ContentRef, CreatePaymentVippsResponse, CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GetVippsStatusVariables, ImageSize, ManifestLocation, ManifestRequest, ManifestResult, PaymentCompleteDetail, PaymentMethod, PaymentSelectDetail, PaymentSuccessDetail, PaymentSuccessResult, PlacementComponent, Product, ProductCategory, ProductImage, ProductOption, ProductPrice, ProductVariant, ResolvedConfig, SDK_VERSION, SlotInput, SlotKind, Sponsor, SponsorCartState, SponsorCommerceBlock, TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, VioConfig, VioItem, VioPlatform, VippsPaymentState, VippsStatusResult, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, campaignCandidates, cartSlicesFrom, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, lineOrigins, normalizeOrigin, normalizeScope, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, resolveContent, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from './core/index.js';
|
|
2
2
|
import 'graphql-request';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './chunk-
|
|
2
|
-
export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, addItem, autoSlotDisplayName, autoSlotId, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, lineOrigins, normalizeOrigin, normalizeScope, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, resolveContent, resolveSlotCampaign, sameOrigin, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from './chunk-
|
|
1
|
+
import './chunk-45YKS5UG.js';
|
|
2
|
+
export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, campaignCandidates, cartSlicesFrom, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, lineOrigins, normalizeOrigin, normalizeScope, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, resolveContent, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from './chunk-AXJKB2CW.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _lit_react from '@lit/react';
|
|
2
|
-
import { V as VioCart$1, a as VioCheckout$1, b as VioProduct$1, c as VioProductCarousel$1, d as VioProductDetail$1 } from '../tokens-
|
|
3
|
-
export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-
|
|
2
|
+
import { V as VioCart$1, a as VioCheckout$1, b as VioProduct$1, c as VioProductCarousel$1, d as VioProductDetail$1 } from '../tokens-C3qiGvLV.js';
|
|
3
|
+
export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-C3qiGvLV.js';
|
|
4
4
|
import 'lit-html';
|
|
5
5
|
import 'lit';
|
|
6
6
|
|
package/dist/react/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-
|
|
2
|
-
export { VioTokens, applyVioTheme } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-N6U65DWG.js';
|
|
2
|
+
export { VioTokens, applyVioTheme } from '../chunk-N6U65DWG.js';
|
|
3
|
+
import '../chunk-AXJKB2CW.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
6
6
|
// node_modules/@lit/react/node/create-component.js
|