@vio-live/web-sdk 0.21.0 → 0.23.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 +144 -0
- package/dist/chunk-25QECQDS.js +3 -0
- package/dist/{chunk-PZUOMOLF.js.map → chunk-25QECQDS.js.map} +1 -1
- package/dist/{chunk-WTVGVDZX.js → chunk-AMDI7KH3.js} +842 -75
- package/dist/chunk-AMDI7KH3.js.map +1 -0
- package/dist/{chunk-MRJR6DG5.js → chunk-COCHGJ2K.js} +376 -34
- package/dist/chunk-COCHGJ2K.js.map +1 -0
- package/dist/core/index.d.ts +358 -15
- 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/react/index.js.map +1 -1
- package/dist/{tokens-Dkbfcd1L.d.ts → tokens-DSYvrBsB.d.ts} +105 -0
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-MRJR6DG5.js.map +0 -1
- package/dist/chunk-PZUOMOLF.js +0 -3
- package/dist/chunk-WTVGVDZX.js.map +0 -1
package/dist/core/index.d.ts
CHANGED
|
@@ -11,11 +11,31 @@ import { GraphQLClient } from 'graphql-request';
|
|
|
11
11
|
* them from env vars / their config and passes them to `Vio.init`.
|
|
12
12
|
*/
|
|
13
13
|
type Environment = 'development' | 'testing' | 'production';
|
|
14
|
+
/**
|
|
15
|
+
* Platform type of the surface this page belongs to (ADR-0027). It travels
|
|
16
|
+
* with every slot declaration and as `?platform=` on the bootstrap, so the
|
|
17
|
+
* campaigns service only answers with the slot assignments of this platform.
|
|
18
|
+
*/
|
|
19
|
+
type VioPlatform = 'web' | 'custom-web' | 'vev';
|
|
14
20
|
interface VioConfig {
|
|
15
21
|
/** Vio API key for this client app (from the Vio dashboard). */
|
|
16
22
|
apiKey: string;
|
|
17
23
|
/** Target environment. Defaults to 'development'. */
|
|
18
24
|
environment?: Environment;
|
|
25
|
+
/**
|
|
26
|
+
* Platform type of this surface: `web` (the no-code snippet), `custom-web`
|
|
27
|
+
* (the SDK integrated by code) or `vev`. Defaults to `web`.
|
|
28
|
+
*/
|
|
29
|
+
platform?: VioPlatform;
|
|
30
|
+
/**
|
|
31
|
+
* The host's own id for the content (article, page) this SDK instance is
|
|
32
|
+
* rendered in — the first choice of `Vio.content()`, ahead of the URL query,
|
|
33
|
+
* the `vio:content-id` meta, the canonical URL and the pathname. Goes on
|
|
34
|
+
* every analytics event as `content_id`.
|
|
35
|
+
*/
|
|
36
|
+
contentId?: string | number;
|
|
37
|
+
/** Human-readable title of that content (`content_title`); see `contentId`. */
|
|
38
|
+
contentTitle?: string;
|
|
19
39
|
/** Override REST API base. Defaults are env-aware. */
|
|
20
40
|
apiBase?: string;
|
|
21
41
|
/** Override GraphQL base. Defaults are env-aware. */
|
|
@@ -48,6 +68,9 @@ interface VioConfig {
|
|
|
48
68
|
interface ResolvedConfig {
|
|
49
69
|
apiKey: string;
|
|
50
70
|
environment: Environment;
|
|
71
|
+
platform: VioPlatform;
|
|
72
|
+
contentId?: string | number;
|
|
73
|
+
contentTitle?: string;
|
|
51
74
|
apiBase: string;
|
|
52
75
|
graphQLBase: string;
|
|
53
76
|
eventsBase: string;
|
|
@@ -209,6 +232,56 @@ interface BootstrapResponse {
|
|
|
209
232
|
currencyCode: string;
|
|
210
233
|
};
|
|
211
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* A slot this page declares to the campaigns service (ADR-0027 / ADR-0034):
|
|
237
|
+
* `id` is the slot name (≤ 100 chars, what `vio-slot` carries and what the
|
|
238
|
+
* dashboard assigns a campaign to); `displayName` is only for the dashboard.
|
|
239
|
+
*/
|
|
240
|
+
interface ManifestLocation {
|
|
241
|
+
id: string;
|
|
242
|
+
displayName?: string;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Where something happened, as `Vio.attribution(slot)` answers it — the ONE
|
|
246
|
+
* attribution shape the SDK elements, Vev and Replit all use: the place
|
|
247
|
+
* (`slot`), the campaign that place shows right now and its primary sponsor,
|
|
248
|
+
* and the content (article) the page is. Everything optional: `{}` before the
|
|
249
|
+
* bootstrap, except the content.
|
|
250
|
+
*/
|
|
251
|
+
interface Attribution {
|
|
252
|
+
slot?: string;
|
|
253
|
+
campaignId?: number;
|
|
254
|
+
sponsorId?: number;
|
|
255
|
+
contentId?: string;
|
|
256
|
+
contentTitle?: string;
|
|
257
|
+
}
|
|
258
|
+
/** Body of `POST /v2/mobile/components/manifest`. */
|
|
259
|
+
interface ManifestRequest {
|
|
260
|
+
platform: string;
|
|
261
|
+
/**
|
|
262
|
+
* `merge` upserts the slots without deprecating those of other pages (a
|
|
263
|
+
* surface on the web has many pages, each knowing only its own blocks);
|
|
264
|
+
* `replace` (the native SDKs' mode) deprecates whatever is not listed.
|
|
265
|
+
*/
|
|
266
|
+
mode: 'merge' | 'replace';
|
|
267
|
+
locations: ManifestLocation[];
|
|
268
|
+
}
|
|
269
|
+
/** Response of `POST /v2/mobile/components/manifest`. */
|
|
270
|
+
interface ManifestResult {
|
|
271
|
+
clientAppId: number;
|
|
272
|
+
platform: string;
|
|
273
|
+
mode: 'merge' | 'replace';
|
|
274
|
+
locations: Array<{
|
|
275
|
+
id: number | string;
|
|
276
|
+
locationId: string;
|
|
277
|
+
displayName?: string | null;
|
|
278
|
+
}>;
|
|
279
|
+
deprecatedCount: number;
|
|
280
|
+
warnings: Array<{
|
|
281
|
+
kind: string;
|
|
282
|
+
detail: string;
|
|
283
|
+
}>;
|
|
284
|
+
}
|
|
212
285
|
/**
|
|
213
286
|
* A placement component returned by `/v2/mobile/campaigns/:id/components`.
|
|
214
287
|
* Used by `<vio-product-carousel campaign-id="...">` to know which products
|
|
@@ -269,14 +342,24 @@ declare class VioApi {
|
|
|
269
342
|
/**
|
|
270
343
|
* Bootstrap — fetches client app config (sponsors with commerce keys,
|
|
271
344
|
* default market, campaign id). Called once at SDK init.
|
|
345
|
+
*
|
|
346
|
+
* With `platform`, `campaigns[].slots[]` only lists the assignments of that
|
|
347
|
+
* platform (plus the ones with no platform) — see ADR-0027.
|
|
272
348
|
*/
|
|
273
|
-
bootstrap(): Promise<BootstrapResponse>;
|
|
349
|
+
bootstrap(platform?: string): Promise<BootstrapResponse>;
|
|
350
|
+
/**
|
|
351
|
+
* Declare the slots of this page to the campaigns service
|
|
352
|
+
* (`POST /v2/mobile/components/manifest`, ADR-0034). The web SDK always
|
|
353
|
+
* sends `mode: 'merge'`; see `Vio.declareSlots()` for the dedupe on top.
|
|
354
|
+
*/
|
|
355
|
+
declareManifest(body: ManifestRequest): Promise<ManifestResult>;
|
|
274
356
|
/**
|
|
275
357
|
* Get placement components for a campaign. Used by the carousel auto-fetch
|
|
276
358
|
* mode (`<vio-product-carousel campaign-id="36" location="news-favorites">`).
|
|
277
359
|
*/
|
|
278
360
|
getComponents(campaignId: number | string): Promise<PlacementComponent[]>;
|
|
279
361
|
private get;
|
|
362
|
+
private post;
|
|
280
363
|
}
|
|
281
364
|
declare class VioApiError extends Error {
|
|
282
365
|
readonly status: number;
|
|
@@ -356,6 +439,21 @@ declare function createCommerceClient(options: CommerceClientOptions): CommerceC
|
|
|
356
439
|
* Mirrors the iOS SDK's `SponsorCart` + `CartLineItem` structure so the
|
|
357
440
|
* mental model stays consistent across platforms.
|
|
358
441
|
*/
|
|
442
|
+
/**
|
|
443
|
+
* Where a unit in the cart came from (ADR-0027 / ADR-0034): the campaign
|
|
444
|
+
* the place showed when it was added, the place (`slot`) and the content
|
|
445
|
+
* (article). What `Vio.attribution(slot)` answers, minus the sponsor and the
|
|
446
|
+
* title. The purchase is split per campaign from these.
|
|
447
|
+
*/
|
|
448
|
+
interface CartOrigin {
|
|
449
|
+
campaignId?: number;
|
|
450
|
+
slot?: string;
|
|
451
|
+
contentId?: string;
|
|
452
|
+
}
|
|
453
|
+
/** One origin of a line and how many of its units came from it. */
|
|
454
|
+
interface CartLineOrigin extends CartOrigin {
|
|
455
|
+
quantity: number;
|
|
456
|
+
}
|
|
359
457
|
interface CartLineItem {
|
|
360
458
|
/** Unique local id for this line item (used for update/remove). */
|
|
361
459
|
id: string;
|
|
@@ -379,6 +477,12 @@ interface CartLineItem {
|
|
|
379
477
|
imageUrl: string;
|
|
380
478
|
/** Quantity. */
|
|
381
479
|
quantity: number;
|
|
480
|
+
/**
|
|
481
|
+
* Where the units came from, most recent last; their quantities add up to
|
|
482
|
+
* `quantity`. Absent on carts persisted before origins existed — read them
|
|
483
|
+
* through `lineOrigins()`, which fills the gap with an empty origin.
|
|
484
|
+
*/
|
|
485
|
+
origins?: CartLineOrigin[];
|
|
382
486
|
/** Selected shipping for this line (backend cart). */
|
|
383
487
|
shipping?: unknown;
|
|
384
488
|
/** Shipping options offered by the backend for this line. */
|
|
@@ -420,6 +524,8 @@ interface AddProductOptions {
|
|
|
420
524
|
sponsorName?: string;
|
|
421
525
|
quantity?: number;
|
|
422
526
|
variantId?: number;
|
|
527
|
+
/** Where these units come from (`Vio.attribution(slot)`); see `CartOrigin`. */
|
|
528
|
+
origin?: CartOrigin;
|
|
423
529
|
}
|
|
424
530
|
/** Minimal product shape — for callers who only have e.g. mock data, not a full Product. */
|
|
425
531
|
interface AddManualOptions {
|
|
@@ -433,6 +539,8 @@ interface AddManualOptions {
|
|
|
433
539
|
imageUrl: string;
|
|
434
540
|
quantity?: number;
|
|
435
541
|
variantId?: number;
|
|
542
|
+
/** Where these units come from (`Vio.attribution(slot)`); see `CartOrigin`. */
|
|
543
|
+
origin?: CartOrigin;
|
|
436
544
|
}
|
|
437
545
|
declare class CartManager extends EventTarget {
|
|
438
546
|
private cartsBySponsor;
|
|
@@ -450,13 +558,36 @@ declare class CartManager extends EventTarget {
|
|
|
450
558
|
* landed (Alan, 2026-08-18: shippings queried before AddItem settled,
|
|
451
559
|
* came back empty). */
|
|
452
560
|
private inFlightMutations;
|
|
561
|
+
/** Per-line quantity sync with the backend: at most ONE UpdateItem /
|
|
562
|
+
* DeleteItem in flight per line. Targets that arrive while one is in flight
|
|
563
|
+
* are coalesced into `pending` (only the latest survives) and sent when the
|
|
564
|
+
* current request settles. Keyed by `${sponsorId}:${cartItemId}`.
|
|
565
|
+
* (Alan, 2026-10-15: a burst of +/− clicks fired one UpdateItem per click
|
|
566
|
+
* in parallel; each response re-applied the whole backend cart, so an
|
|
567
|
+
* older one landing after a newer optimistic change rolled the line back.) */
|
|
568
|
+
private qtySyncs;
|
|
453
569
|
constructor();
|
|
454
570
|
private nextSeq;
|
|
455
|
-
/** Resolves once
|
|
456
|
-
* sponsor has settled (success or failure)
|
|
571
|
+
/** Resolves once every in-flight AddItem/UpdateItem/DeleteItem for this
|
|
572
|
+
* sponsor has settled (success or failure), including ones started while
|
|
573
|
+
* waiting (a quantity intent replayed by an AddItem reconcile). No-op if
|
|
574
|
+
* nothing is pending. */
|
|
457
575
|
waitForCartMutations(sponsorId: number): Promise<void>;
|
|
458
|
-
/**
|
|
576
|
+
/** Register a backend mutation so `waitForCartMutations` can await it. */
|
|
577
|
+
private trackMutation;
|
|
578
|
+
private qtySyncKey;
|
|
579
|
+
/** The quantity a line is heading to (pending beats in flight), or
|
|
580
|
+
* undefined when no quantity sync is active for it. */
|
|
581
|
+
private intendedQuantity;
|
|
582
|
+
/** Apply a backend response only if no newer response was applied already.
|
|
583
|
+
* Returns false when it was discarded as stale. */
|
|
459
584
|
private applyBackendCart;
|
|
585
|
+
/** The final answer of a line's sync lost the per-sponsor seq race (another
|
|
586
|
+
* line answered later): the cart as a whole is stale, but for THIS line it
|
|
587
|
+
* is the latest word. Copy its quantity (and price) so a server-side clamp
|
|
588
|
+
* — stock — doesn't leave the optimistic value behind for good, with the
|
|
589
|
+
* checkout / Apple Pay total built on it. */
|
|
590
|
+
private reconcileLineFromResponse;
|
|
460
591
|
/** Surface a cart sync problem to hosts/UI (and the console). */
|
|
461
592
|
private emitError;
|
|
462
593
|
/** Ensure the sponsor cart exists server-side; returns its backend cart id. */
|
|
@@ -501,7 +632,28 @@ declare class CartManager extends EventTarget {
|
|
|
501
632
|
* when the AddItem response reconciles (keyed by product::variant). */
|
|
502
633
|
private pendingQtyIntents;
|
|
503
634
|
private intentKey;
|
|
504
|
-
|
|
635
|
+
private findLine;
|
|
636
|
+
/** Change a line's quantity by `delta`, computed on the manager's CURRENT
|
|
637
|
+
* quantity — not on whatever a UI rendered a moment ago. A burst of +/−
|
|
638
|
+
* clicks before a re-render therefore asks for 2, 3, 4… and not for the
|
|
639
|
+
* same target several times. Reaching 0 removes the line. */
|
|
640
|
+
adjustQuantity(lineItemId: string, sponsorId: number, delta: number, opts?: {
|
|
641
|
+
origin?: CartOrigin;
|
|
642
|
+
}): void;
|
|
643
|
+
/** Set a line's quantity (0 or less removes it). Optimistic: the local
|
|
644
|
+
* state and `change` update at once; the backend is synced through
|
|
645
|
+
* `syncQuantity`, one request in flight per line, latest target wins. */
|
|
646
|
+
updateQuantity(lineItemId: string, sponsorId: number, quantity: number, opts?: {
|
|
647
|
+
origin?: CartOrigin;
|
|
648
|
+
}): void;
|
|
649
|
+
/** Send a line's target quantity to the backend — ONE request in flight per
|
|
650
|
+
* line. A target that arrives while one is in flight replaces any earlier
|
|
651
|
+
* waiting one and goes out when the current request settles, so the server
|
|
652
|
+
* ends on the last intent and never sees two updates racing each other.
|
|
653
|
+
* While the sync is active the line keeps its optimistic quantity through
|
|
654
|
+
* any backend response (see `updateFromBackendCart`); a rejection drops
|
|
655
|
+
* what was queued and reconciles the cart from the server. */
|
|
656
|
+
private syncQuantity;
|
|
505
657
|
removeItem(lineItemId: string, sponsorId: number): void;
|
|
506
658
|
clearSponsorCart(sponsorId: number): void;
|
|
507
659
|
clearAllCarts(): void;
|
|
@@ -525,6 +677,16 @@ declare class CartManager extends EventTarget {
|
|
|
525
677
|
private loadFromStorage;
|
|
526
678
|
private emit;
|
|
527
679
|
}
|
|
680
|
+
/** Only the three attribution fields, trimmed; `{}` when nothing is known. */
|
|
681
|
+
declare function normalizeOrigin(origin: CartOrigin | null | undefined): CartOrigin;
|
|
682
|
+
/** Two origins are the same place when campaign, slot and content all match. */
|
|
683
|
+
declare function sameOrigin(a: CartOrigin, b: CartOrigin): boolean;
|
|
684
|
+
/**
|
|
685
|
+
* The origins of a line for reporting: what it carries, plus an empty origin
|
|
686
|
+
* for any units it does not account for (a cart persisted before origins
|
|
687
|
+
* existed, a server-side bump). Their quantities add up to the line's.
|
|
688
|
+
*/
|
|
689
|
+
declare function lineOrigins(line: Pick<CartLineItem, 'origins' | 'quantity'>): CartLineOrigin[];
|
|
528
690
|
|
|
529
691
|
/**
|
|
530
692
|
* Vipps MobilePay Payment Adapter — GraphQL Integration & Types.
|
|
@@ -624,7 +786,8 @@ interface GraphQLEnvelope {
|
|
|
624
786
|
}
|
|
625
787
|
/** Execute a GraphQL query/mutation against the configured commerce endpoint.
|
|
626
788
|
* Callers that skip `getCartGraphQLOptions()` (or pass a bare sponsorId) get
|
|
627
|
-
* it resolved here instead of silently sending an unauthenticated request.
|
|
789
|
+
* it resolved here instead of silently sending an unauthenticated request.
|
|
790
|
+
* Rejects after `CART_GRAPHQL_TIMEOUT_MS` (and aborts the fetch). */
|
|
628
791
|
declare function executeCartGraphQL(query: string, variables: Record<string, unknown>, options?: CartQueryOptions | number | undefined): Promise<GraphQLEnvelope>;
|
|
629
792
|
declare function createCart(customerSessionId: string, currency: string, shippingCountry?: string | null, options?: CartQueryOptions): Promise<any>;
|
|
630
793
|
declare function addItem(cartId: string, lineItems: unknown[], options?: CartQueryOptions): Promise<any>;
|
|
@@ -1801,6 +1964,14 @@ interface AnalyticsContext {
|
|
|
1801
1964
|
/** Código corto del fallo (`sdk_error` / `checkout_error`). */
|
|
1802
1965
|
errorCode?: string;
|
|
1803
1966
|
variant?: string;
|
|
1967
|
+
/**
|
|
1968
|
+
* The slot (ADR-0027) the component sits in — its `vio-slot`. Attribution
|
|
1969
|
+
* follows it: the event's `campaign_id` is the campaign assigned to the slot
|
|
1970
|
+
* right now, before the sponsor rule. On the wire it fills `location_id`
|
|
1971
|
+
* when no explicit `locationId` is given (a slot IS a location id to the
|
|
1972
|
+
* campaigns service).
|
|
1973
|
+
*/
|
|
1974
|
+
slot?: string;
|
|
1804
1975
|
}
|
|
1805
1976
|
interface AnalyticsItemInput {
|
|
1806
1977
|
productId: number | string;
|
|
@@ -1928,23 +2099,38 @@ declare class AnalyticsManager extends EventTarget {
|
|
|
1928
2099
|
* writes ZERO tracking code for the commerce funnel.
|
|
1929
2100
|
*/
|
|
1930
2101
|
private installAutoListeners;
|
|
2102
|
+
/** The lines of the cart (current, else the pre-clear snapshot), optionally one sponsor's. */
|
|
2103
|
+
private cartLines;
|
|
2104
|
+
/**
|
|
2105
|
+
* The cart split per campaign (ADR-0034): every unit of every line goes to
|
|
2106
|
+
* the campaign of its origin — the one the place showed when it was added
|
|
2107
|
+
* — and units without one to the campaign the current rule resolves for
|
|
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.
|
|
2111
|
+
*/
|
|
2112
|
+
private cartSlices;
|
|
2113
|
+
/** The context of a per-campaign event: the slice's campaign, slot and content, over the event's own. */
|
|
2114
|
+
private sliceContext;
|
|
1931
2115
|
/** Current cart → commerce payload; falls back to the pre-clear snapshot. */
|
|
1932
2116
|
private cartCommerce;
|
|
1933
2117
|
private findLine;
|
|
1934
2118
|
}
|
|
1935
2119
|
/**
|
|
1936
2120
|
* The `campaign_id` of an event. In order: the context's explicit id; the
|
|
1937
|
-
*
|
|
1938
|
-
*
|
|
1939
|
-
*
|
|
1940
|
-
*
|
|
1941
|
-
*
|
|
1942
|
-
*
|
|
2121
|
+
* campaign assigned to the context's `slot` right now (ADR-0027 — only an
|
|
2122
|
+
* open assignment for the init platform counts, see `findSlotAssignment`);
|
|
2123
|
+
* the active campaign of `campaigns[]` the event's sponsor takes part in, as
|
|
2124
|
+
* its primary or one of its secondaries — when it is in several, the
|
|
2125
|
+
* surface's default campaign if it is one of them, else the first one the
|
|
2126
|
+
* backend lists; the default campaign (`campaign.id`). `/v2/mobile/config`
|
|
2127
|
+
* has no top-level `campaignId` — reading one is why every event used to
|
|
2128
|
+
* leave with `campaign_id: 0` and the campaigns screen stayed empty.
|
|
1943
2129
|
*
|
|
1944
2130
|
* A malformed `campaigns[]` (not an array, a null entry) never breaks
|
|
1945
2131
|
* `track()`: it falls back to `campaign.id`.
|
|
1946
2132
|
*/
|
|
1947
|
-
declare function resolveCampaignId(ctx: Pick<AnalyticsContext, 'campaignId' | 'sponsorId'>, boot: Pick<BootstrapResponse, 'campaign' | 'campaigns'> | null | undefined): number | undefined;
|
|
2133
|
+
declare function resolveCampaignId(ctx: Pick<AnalyticsContext, 'campaignId' | 'sponsorId' | 'slot'>, boot: Pick<BootstrapResponse, 'campaign' | 'campaigns'> | null | undefined): number | undefined;
|
|
1948
2134
|
/**
|
|
1949
2135
|
* `detail` of `vio:payment-success` as the checkout emits it. Four paths,
|
|
1950
2136
|
* three shapes: a redirect return (`orderId` = Vio's checkout id), the
|
|
@@ -1955,6 +2141,11 @@ declare function resolveCampaignId(ctx: Pick<AnalyticsContext, 'campaignId' | 's
|
|
|
1955
2141
|
interface PaymentSuccessDetail {
|
|
1956
2142
|
method?: string;
|
|
1957
2143
|
sponsorId?: number | string;
|
|
2144
|
+
/** The slot the purchase started from, when the emitter knows it. */
|
|
2145
|
+
slot?: string;
|
|
2146
|
+
/** Per-element content override (`vio-content-id` / `vio-content-title`), when the emitter carries one. */
|
|
2147
|
+
contentId?: string | number;
|
|
2148
|
+
contentTitle?: string;
|
|
1958
2149
|
/** Redirect return: Vio's checkout id (the name predates `checkoutId`). */
|
|
1959
2150
|
orderId?: string | number;
|
|
1960
2151
|
/** Vio's checkout id — from the checkout state or the return URL. */
|
|
@@ -1987,6 +2178,97 @@ interface PaymentSuccessResult {
|
|
|
1987
2178
|
*/
|
|
1988
2179
|
declare function purchaseFromPaymentSuccess(d: PaymentSuccessDetail): Pick<AnalyticsCommerce, 'orderId'>;
|
|
1989
2180
|
|
|
2181
|
+
/**
|
|
2182
|
+
* Content (article) attribution — the other half of "where did this happen".
|
|
2183
|
+
*
|
|
2184
|
+
* The SLOT says the place on the page (`carousel-1`, `hero`); the CONTENT says
|
|
2185
|
+
* the article/page the place was rendered in. One Vev design serves thousands
|
|
2186
|
+
* of article URLs, so the article must not leak into the slot id — it travels
|
|
2187
|
+
* on every analytics event as `content_id` / `content_title` instead, and this
|
|
2188
|
+
* module finds it without the editor doing anything.
|
|
2189
|
+
*
|
|
2190
|
+
* Pure: `resolveContent()` takes the document and location (defaults to the
|
|
2191
|
+
* globals) so it can be tested, never throws, and answers `{}` where there is
|
|
2192
|
+
* no DOM (SSR, node tests). `Vio.content()` caches it per page and forgets the
|
|
2193
|
+
* cache on every `Vio.init()`.
|
|
2194
|
+
*/
|
|
2195
|
+
interface ContentRef {
|
|
2196
|
+
id?: string;
|
|
2197
|
+
title?: string;
|
|
2198
|
+
}
|
|
2199
|
+
interface ContentInit {
|
|
2200
|
+
contentId?: string | number | null;
|
|
2201
|
+
contentTitle?: string | null;
|
|
2202
|
+
}
|
|
2203
|
+
/**
|
|
2204
|
+
* Id: `Vio.init({ contentId })` → `?vio_content=` → `<meta name="vio:content-id">`
|
|
2205
|
+
* → `<link rel="canonical">` href or `<meta property="og:url">` (without query
|
|
2206
|
+
* and hash) → `location.pathname`.
|
|
2207
|
+
* Title: `Vio.init({ contentTitle })` → `?vio_content_title=` →
|
|
2208
|
+
* `<meta name="vio:content-title">` → `<meta property="og:title">` → `document.title`.
|
|
2209
|
+
*/
|
|
2210
|
+
declare function resolveContent(init?: ContentInit | null, doc?: Document | null | undefined, loc?: Location | {
|
|
2211
|
+
href?: string;
|
|
2212
|
+
pathname?: string;
|
|
2213
|
+
search?: string;
|
|
2214
|
+
} | null | undefined): ContentRef;
|
|
2215
|
+
|
|
2216
|
+
/**
|
|
2217
|
+
* Slots — the pure half of ADR-0027 / ADR-0034 on the web.
|
|
2218
|
+
*
|
|
2219
|
+
* A slot is a NAME for a place on a page. The page declares its slots to the
|
|
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`).
|
|
2225
|
+
*
|
|
2226
|
+
* Everything here is side-effect free and never throws on a malformed
|
|
2227
|
+
* bootstrap: a broken `campaigns[]` must never blank a product block or break
|
|
2228
|
+
* `track()`.
|
|
2229
|
+
*/
|
|
2230
|
+
|
|
2231
|
+
/** What `Vio.declareSlots()` accepts per slot. */
|
|
2232
|
+
type SlotInput = string | {
|
|
2233
|
+
id: string;
|
|
2234
|
+
displayName?: string;
|
|
2235
|
+
};
|
|
2236
|
+
type BootLike = Pick<BootstrapResponse, 'campaign' | 'campaigns' | 'primarySponsor' | 'secondarySponsors'>;
|
|
2237
|
+
/**
|
|
2238
|
+
* The campaign a slot shows right now. Among the `status === 'active'`
|
|
2239
|
+
* entries of `campaigns[]`, the one with an assignment named `slot` for this
|
|
2240
|
+
* platform (`platform` null on the assignment, or equal to `platform`) whose
|
|
2241
|
+
* window contains `now` (`startDate <= now < endDate`, null = open). When
|
|
2242
|
+
* several qualify, the surface's default campaign wins, else the first the
|
|
2243
|
+
* backend lists.
|
|
2244
|
+
*
|
|
2245
|
+
* No slot, or no assignment → the default campaign: the `campaigns[]` entry
|
|
2246
|
+
* whose id is `campaign.id`, or a minimal entry built from `campaign` (+ the
|
|
2247
|
+
* top-level sponsors) when the list does not carry it. No bootstrap → null.
|
|
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;
|
|
2271
|
+
|
|
1990
2272
|
declare class VioFacade {
|
|
1991
2273
|
private apiInstance;
|
|
1992
2274
|
private commerceClients;
|
|
@@ -1999,10 +2281,27 @@ declare class VioFacade {
|
|
|
1999
2281
|
* (another key or environment) is still in flight after a re-init; its answer
|
|
2000
2282
|
* belongs to that configuration and must not land in this one. */
|
|
2001
2283
|
private generation;
|
|
2284
|
+
/** Slot ids present on the page (`Vio.registerSlot`): how many elements hold each + its display name. */
|
|
2285
|
+
private slotRegistry;
|
|
2286
|
+
/** Pending debounced declaration of the registry. */
|
|
2287
|
+
private slotDeclareTimer;
|
|
2288
|
+
/** A name appeared (or the key changed) since the registry was last declared. */
|
|
2289
|
+
private slotsDirty;
|
|
2290
|
+
/** `Vio.content()` resolved once per page; forgotten on every init(). */
|
|
2291
|
+
private contentCache;
|
|
2002
2292
|
private cartManager;
|
|
2003
2293
|
private checkoutManager;
|
|
2004
2294
|
private analyticsManager;
|
|
2005
2295
|
init(config: VioConfig): void;
|
|
2296
|
+
/**
|
|
2297
|
+
* The content (article, page) this SDK instance is rendered in — what every
|
|
2298
|
+
* analytics event carries as `content_id` / `content_title` when the event
|
|
2299
|
+
* has no explicit one. Resolved once per page (init option → URL query →
|
|
2300
|
+
* `vio:content-*` metas → canonical/og:url → pathname; see
|
|
2301
|
+
* `resolveContent`), forgotten on every `init()`. Never throws; `{}` without
|
|
2302
|
+
* a document.
|
|
2303
|
+
*/
|
|
2304
|
+
content(): ContentRef;
|
|
2006
2305
|
get isInitialized(): boolean;
|
|
2007
2306
|
get config(): ResolvedConfig;
|
|
2008
2307
|
/** Multi-sponsor cart manager. Reactive — listen via addEventListener('change', ...). */
|
|
@@ -2034,6 +2333,50 @@ declare class VioFacade {
|
|
|
2034
2333
|
commerceFor(sponsorId: number): CommerceClient;
|
|
2035
2334
|
/** Get a CommerceClient using an explicit commerce apiKey (skip bootstrap). */
|
|
2036
2335
|
commerceWithKey(commerceApiKey: string): CommerceClient;
|
|
2336
|
+
/**
|
|
2337
|
+
* Declare this page's slots to the campaigns service
|
|
2338
|
+
* (`POST /v2/mobile/components/manifest`, `mode: 'merge'`, the init
|
|
2339
|
+
* platform). Best-effort: it NEVER throws — a failure is logged and resolves
|
|
2340
|
+
* `null`. The same set is not re-posted from this browser for 24 h unless
|
|
2341
|
+
* `force` (then `null` also means "skipped, already declared"). Ids are
|
|
2342
|
+
* trimmed, cut at 100 chars, deduped; empties are dropped.
|
|
2343
|
+
*/
|
|
2344
|
+
declareSlots(slots: ReadonlyArray<SlotInput>, opts?: {
|
|
2345
|
+
force?: boolean;
|
|
2346
|
+
}): Promise<ManifestResult | null>;
|
|
2347
|
+
/**
|
|
2348
|
+
* Register a slot present on the page (the `<vio-*>` elements call it with
|
|
2349
|
+
* their effective id — the host's `vio-slot` or the auto-generated one —
|
|
2350
|
+
* and the optional display name). The registry is declared ONCE, debounced,
|
|
2351
|
+
* after the first successful bootstrap — and again whenever a new id or a
|
|
2352
|
+
* new display name appears. A `displayName` given later for an id already
|
|
2353
|
+
* registered replaces the one kept; `undefined` leaves it alone. The
|
|
2354
|
+
* returned function unregisters; removal never re-declares.
|
|
2355
|
+
*/
|
|
2356
|
+
registerSlot(name: string, displayName?: string): () => void;
|
|
2357
|
+
/**
|
|
2358
|
+
* The campaign a slot shows now, from the last bootstrap: its assigned and
|
|
2359
|
+
* open campaign for the init platform, else the surface's default. With no
|
|
2360
|
+
* slot, the default. `null` before the bootstrap. See `resolveSlotCampaign`.
|
|
2361
|
+
*/
|
|
2362
|
+
campaignForSlot(slot?: string | null): BootstrapCampaignEntry | null;
|
|
2363
|
+
/**
|
|
2364
|
+
* THE attribution helper — the SDK elements, Vev and Replit all use this
|
|
2365
|
+
* one. For a place (`slot`): the campaign it shows right now
|
|
2366
|
+
* (`campaignForSlot`: its assignment, else the surface's default) as
|
|
2367
|
+
* `campaignId` + that campaign's primary sponsor as `sponsorId`, plus the
|
|
2368
|
+
* page's content (`content()`). Pure, never throws; `{}` before the
|
|
2369
|
+
* bootstrap, except the content.
|
|
2370
|
+
*
|
|
2371
|
+
* `hint.sponsorId` — when the caller already knows the sponsor (a card with
|
|
2372
|
+
* `sponsor-id`) it is kept as `sponsorId`, and the campaign follows the same
|
|
2373
|
+
* cascade analytics uses (slot assignment → the sponsor's active campaign →
|
|
2374
|
+
* default), so what the cart remembers matches what the events say.
|
|
2375
|
+
*/
|
|
2376
|
+
attribution(slot?: string | null, hint?: {
|
|
2377
|
+
sponsorId?: number | string;
|
|
2378
|
+
}): Attribution;
|
|
2379
|
+
private scheduleSlotDeclaration;
|
|
2037
2380
|
private findSponsor;
|
|
2038
2381
|
}
|
|
2039
2382
|
declare const Vio: VioFacade;
|
|
@@ -2045,7 +2388,7 @@ declare const Vio: VioFacade;
|
|
|
2045
2388
|
*
|
|
2046
2389
|
* RELEASE CHECKLIST: bump together with package.json (see CONTRIBUTING).
|
|
2047
2390
|
*/
|
|
2048
|
-
declare const SDK_VERSION = "0.
|
|
2391
|
+
declare const SDK_VERSION = "0.23.0";
|
|
2049
2392
|
|
|
2050
2393
|
/**
|
|
2051
2394
|
* Vipps MobilePay's own button, the way the design guidelines ask for it.
|
|
@@ -2074,4 +2417,4 @@ declare function vippsButtonAttributes(verb?: 'buy' | 'pay' | 'express' | 'conti
|
|
|
2074
2417
|
language?: string;
|
|
2075
2418
|
}): Record<string, string>;
|
|
2076
2419
|
|
|
2077
|
-
export { ADD_ITEM_MUTATION, type AddManualOptions, type AddProductOptions, type AnalyticsCommerce, type AnalyticsContext, type AnalyticsEventName, type AnalyticsItemInput, AnalyticsManager, type AnalyticsStartOptions, type ApplePayConfig, type ApplePayResult, 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, CartManager, type CartQueryOptions, type CheckoutAddress, type CheckoutChangeDetail, CheckoutManager, type CheckoutState, CommerceClient, Configuration, 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 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 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 VippsPaymentState, type VippsStatusResult, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes };
|
|
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 };
|
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, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from '../chunk-
|
|
1
|
+
import '../chunk-25QECQDS.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, 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-AMDI7KH3.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, BootstrapCampaign, BootstrapCampaignEntry, BootstrapCampaignStatus, BootstrapResponse, BootstrapSlot, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartChangeDetail, CartLineItem, CartManager, CartQueryOptions, CheckoutAddress, CheckoutChangeDetail, CheckoutManager, CheckoutState, CommerceClient, Configuration, 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, PaymentCompleteDetail, PaymentMethod, PaymentSelectDetail, PaymentSuccessDetail, PaymentSuccessResult, PlacementComponent, Product, ProductCategory, ProductImage, ProductOption, ProductPrice, ProductVariant, ResolvedConfig, SDK_VERSION, 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, VippsPaymentState, VippsStatusResult, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, 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, 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';
|
|
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, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from './chunk-
|
|
1
|
+
import './chunk-25QECQDS.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, 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-AMDI7KH3.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-DSYvrBsB.js';
|
|
3
|
+
export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-DSYvrBsB.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-COCHGJ2K.js';
|
|
2
|
+
export { VioTokens, applyVioTheme } from '../chunk-COCHGJ2K.js';
|
|
3
|
+
import '../chunk-AMDI7KH3.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
6
6
|
// node_modules/@lit/react/node/create-component.js
|