@vio-live/web-sdk 0.26.1 → 0.28.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/CHANGELOG.md +289 -0
- package/README.md +184 -0
- package/dist/chunk-67QESEV2.js +3 -0
- package/dist/{chunk-NCP76AXW.js.map → chunk-67QESEV2.js.map} +1 -1
- package/dist/{chunk-NXIYIY2D.js → chunk-AFJ5M53F.js} +492 -57
- package/dist/chunk-AFJ5M53F.js.map +1 -0
- package/dist/{chunk-6Q2M3MIK.js → chunk-Q2NALS7P.js} +1053 -165
- package/dist/chunk-Q2NALS7P.js.map +1 -0
- package/dist/core/index.d.ts +229 -19
- 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-Bn7fK9ta.d.ts → tokens-y0KzN7bP.d.ts} +153 -3
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +3 -3
- package/package.json +3 -2
- package/dist/chunk-6Q2M3MIK.js.map +0 -1
- package/dist/chunk-NCP76AXW.js +0 -3
- package/dist/chunk-NXIYIY2D.js.map +0 -1
|
@@ -277,6 +277,12 @@ declare class VioProductDetail extends LitElement {
|
|
|
277
277
|
private selectedOptions;
|
|
278
278
|
private quantity;
|
|
279
279
|
private activeImageIndex;
|
|
280
|
+
/** The thumbnail row is wider than its box (arrows shown with a mouse). */
|
|
281
|
+
private thumbsOverflow;
|
|
282
|
+
private thumbsAtStart;
|
|
283
|
+
private thumbsAtEnd;
|
|
284
|
+
/** The top bar's logo file is square-ish: a mark, so its name goes beside it. */
|
|
285
|
+
private logoSquare;
|
|
280
286
|
private adding;
|
|
281
287
|
/** Apple Pay actually usable (real Stripe + registered domain) — set on load. */
|
|
282
288
|
private applePayOk;
|
|
@@ -293,11 +299,21 @@ declare class VioProductDetail extends LitElement {
|
|
|
293
299
|
private applePayHandle;
|
|
294
300
|
/** Keyboard and focus while open: Escape closes, Tab stays inside, focus returns to the opener. */
|
|
295
301
|
private readonly dialogFocus;
|
|
302
|
+
/** Phones: the page behind is locked, and the sheet closes by pulling the bar or the top bar down. */
|
|
303
|
+
private readonly bottomSheet;
|
|
296
304
|
private boundProductClick;
|
|
297
305
|
static styles: lit.CSSResult;
|
|
298
306
|
connectedCallback(): void;
|
|
299
307
|
disconnectedCallback(): void;
|
|
300
308
|
updated(changed: Map<string, unknown>): void;
|
|
309
|
+
private thumbRow;
|
|
310
|
+
/** Arrows only when the row overflows; each one off at its own end. */
|
|
311
|
+
private measureThumbs;
|
|
312
|
+
private onThumbsScroll;
|
|
313
|
+
/** One arrow press moves most of a visible row. */
|
|
314
|
+
private scrollThumbs;
|
|
315
|
+
/** The selected thumbnail is always visible: the row scrolls to it, the page never does. */
|
|
316
|
+
private revealActiveThumb;
|
|
301
317
|
show(): void;
|
|
302
318
|
close(): void;
|
|
303
319
|
private fetchProduct;
|
|
@@ -390,6 +406,23 @@ declare class VioProductDetail extends LitElement {
|
|
|
390
406
|
/** The seller's Company name; the brand when there is none; nothing while asking. */
|
|
391
407
|
private headerName;
|
|
392
408
|
private loadSeller;
|
|
409
|
+
/**
|
|
410
|
+
* Who sells the product, top left beside the close (Mote & Livsstil,
|
|
411
|
+
* 2026-10-22): the logo of the sponsor the product was fetched with — the
|
|
412
|
+
* product's brand, never the article's — with its name as `alt`; without a
|
|
413
|
+
* logo that loads, its name; without an identity, the seller's Company name
|
|
414
|
+
* (or the product's brand) once known. Size: --vio-detail-logo-height.
|
|
415
|
+
*/
|
|
416
|
+
private renderTopbarSponsor;
|
|
417
|
+
/**
|
|
418
|
+
* Under the buy buttons: «Du handler direkte hos {brand}.» — the brand the
|
|
419
|
+
* product was fetched with (the sponsor; its Company name or the product's
|
|
420
|
+
* brand when no identity is known), never the article's. Nothing when no
|
|
421
|
+
* name is known.
|
|
422
|
+
*/
|
|
423
|
+
private renderSellerNote;
|
|
424
|
+
/** Square-ish logo (4:5 to 5:4) → the top bar shows the name beside it. */
|
|
425
|
+
private measureLogo;
|
|
393
426
|
render(): lit_html.TemplateResult<1>;
|
|
394
427
|
private renderBody;
|
|
395
428
|
private renderOptionPickers;
|
|
@@ -429,6 +462,8 @@ declare class VioCart extends LitElement {
|
|
|
429
462
|
private loadingPaymentMethods;
|
|
430
463
|
/** Keyboard and focus while open: Escape closes, Tab stays inside, focus returns to the opener. */
|
|
431
464
|
private readonly dialogFocus;
|
|
465
|
+
/** Phones: the page behind is locked, and the sheet closes by pulling the bar or the header down. */
|
|
466
|
+
private readonly bottomSheet;
|
|
432
467
|
private boundOnCartChange;
|
|
433
468
|
static styles: lit.CSSResult;
|
|
434
469
|
connectedCallback(): void;
|
|
@@ -474,6 +509,8 @@ declare class VioCart extends LitElement {
|
|
|
474
509
|
private startVippsExpressOrCheckout;
|
|
475
510
|
/** Stripe — opens the checkout with Stripe preselected. */
|
|
476
511
|
private onStripe;
|
|
512
|
+
/** The name over a sponsor's lines: the brand's display name by the one rule, else what the cart kept. */
|
|
513
|
+
private sponsorLabel;
|
|
477
514
|
private get totalAcrossSponsors();
|
|
478
515
|
private get primaryCurrency();
|
|
479
516
|
private onIncrement;
|
|
@@ -520,6 +557,16 @@ declare class VioCheckout extends LitElement {
|
|
|
520
557
|
private verifyingReturn;
|
|
521
558
|
/** The checkout whose confirmation is on screen — see fillOrderNumber. */
|
|
522
559
|
private confirmedCheckoutId;
|
|
560
|
+
/**
|
|
561
|
+
* Whose order is being confirmed (or verified, back from a payment page):
|
|
562
|
+
* the CHECKOUT's sponsor — from the return URL (`vio_sponsor`,
|
|
563
|
+
* `checkout_id`) or the state it was paid in — and how it was named before
|
|
564
|
+
* the cart was cleared. The header and the confirmation name it; never the
|
|
565
|
+
* page's attribution. See checkoutSponsorIdentity.
|
|
566
|
+
*/
|
|
567
|
+
private orderSponsor;
|
|
568
|
+
/** The bootstrap that names the checkout's sponsor was asked for (once per checkout) — see watchSponsorBootstrap. */
|
|
569
|
+
private sponsorBootstrapAsked;
|
|
523
570
|
/** Snapshot of the placed order, for the confirmation screen. */
|
|
524
571
|
private confirmedOrder;
|
|
525
572
|
/** Active Klarna Payments widget handle + the subtotal it was mounted for. */
|
|
@@ -645,6 +692,8 @@ declare class VioCheckout extends LitElement {
|
|
|
645
692
|
* in flight — Tab stays inside, focus returns to the opener.
|
|
646
693
|
*/
|
|
647
694
|
private readonly dialogFocus;
|
|
695
|
+
/** Phones: the page behind is locked, and the sheet closes by pulling the bar or the top bar down — not mid-payment. */
|
|
696
|
+
private readonly bottomSheet;
|
|
648
697
|
/** A payment is being started or confirmed right now: the overlay must not close under it. */
|
|
649
698
|
private get paymentInFlight();
|
|
650
699
|
/**
|
|
@@ -834,7 +883,9 @@ declare class VioCheckout extends LitElement {
|
|
|
834
883
|
* `visibilitychange`) or the element leaves, the event goes out at once
|
|
835
884
|
* without the reference. Exactly one event per call. `afterwards` runs
|
|
836
885
|
* right after the event, so a path keeps the order it always had (the cart
|
|
837
|
-
* is cleared after the event).
|
|
886
|
+
* is cleared after the event). When that answer already has Vio's order
|
|
887
|
+
* number, the event carries it too (`orderNumber`): it is the purchase's
|
|
888
|
+
* `order_id`, and analytics need not ask again.
|
|
838
889
|
*/
|
|
839
890
|
private emitPaymentSuccess;
|
|
840
891
|
/** Whether asking the checkout for the buyer reference can still help. */
|
|
@@ -844,8 +895,9 @@ declare class VioCheckout extends LitElement {
|
|
|
844
895
|
* failed or has neither the reference nor an order yet (the webhook has not
|
|
845
896
|
* written the checkout), again at 1.2 s — all within 2.5 s. An order
|
|
846
897
|
* without a reference is a settled answer: the backend has none, asking
|
|
847
|
-
* again cannot help.
|
|
848
|
-
*
|
|
898
|
+
* again cannot help. Whatever the answer said of the order number comes
|
|
899
|
+
* back with it. `{}` when the time is up, when the answer stopped mattering
|
|
900
|
+
* (`stopped()`) or on failure.
|
|
849
901
|
*/
|
|
850
902
|
private askBuyerRef;
|
|
851
903
|
/** Waits between asks for the Vio order number: the order is often born a
|
|
@@ -871,6 +923,42 @@ declare class VioCheckout extends LitElement {
|
|
|
871
923
|
/** Total to charge — items + shipping (express). */
|
|
872
924
|
private payTotalLabel;
|
|
873
925
|
render(): lit_html.TemplateResult<1>;
|
|
926
|
+
/**
|
|
927
|
+
* Remember whose order this is and how it is named right now, before the
|
|
928
|
+
* cart that names it is cleared. Whose: the sponsor this tab remembered for
|
|
929
|
+
* the checkout when it was created (exact for that checkout id), else the
|
|
930
|
+
* one given (the return URL's `vio_sponsor`, the state it was paid in),
|
|
931
|
+
* else the open state's — a return without `vio_sponsor` (Qliro, Walley)
|
|
932
|
+
* re-opens the state with whichever cart comes first, which is a guess.
|
|
933
|
+
*/
|
|
934
|
+
private setOrderSponsor;
|
|
935
|
+
/**
|
|
936
|
+
* Who this checkout is with, as a shopper sees it: the order being
|
|
937
|
+
* confirmed / verified (`orderSponsor`), else the open checkout's own
|
|
938
|
+
* sponsor (`checkoutState.sponsorId`) — named by `Vio.sponsorIdentity`,
|
|
939
|
+
* which falls back to this tab's memory of the checkout and the cart; the
|
|
940
|
+
* name taken before the cart was cleared last. Never the page's
|
|
941
|
+
* attribution. `null` when nothing names it.
|
|
942
|
+
*/
|
|
943
|
+
private checkoutSponsorIdentity;
|
|
944
|
+
/**
|
|
945
|
+
* `{ sponsor }` for the payment event — the same sponsor the screen names
|
|
946
|
+
* (`orderSponsor`, set by every path right before it emits): named now, else
|
|
947
|
+
* as named before the cart was cleared; `{}` when nothing names it.
|
|
948
|
+
*/
|
|
949
|
+
private sponsorOfOrder;
|
|
950
|
+
/**
|
|
951
|
+
* Ask once per checkout for the bootstrap when it is not there yet and a
|
|
952
|
+
* sponsor has to be named (a redirect return renders before it), then
|
|
953
|
+
* render again — the name and the logo appear when it lands.
|
|
954
|
+
*/
|
|
955
|
+
private watchSponsorBootstrap;
|
|
956
|
+
/**
|
|
957
|
+
* The checkout's sponsor in the header — «Du handler hos <logo|name>»
|
|
958
|
+
* («Du har handlet hos» on a provider's receipt). Not on our own
|
|
959
|
+
* confirmation, which says it in its body.
|
|
960
|
+
*/
|
|
961
|
+
private renderTopbarSponsor;
|
|
874
962
|
/**
|
|
875
963
|
* The provider's receipt on its own. It must not depend on the cart: the
|
|
876
964
|
* payment step is rendered from the cart, and clearing the cart after a
|
|
@@ -1177,6 +1265,68 @@ interface VioThemeOverrides {
|
|
|
1177
1265
|
spaceMd?: string;
|
|
1178
1266
|
spaceLg?: string;
|
|
1179
1267
|
spaceXl?: string;
|
|
1268
|
+
/** Product detail panel width on desktop (default `440px`). */
|
|
1269
|
+
detailWidth?: string;
|
|
1270
|
+
/** Side padding of the detail (default the `lg` space, `24px`). */
|
|
1271
|
+
detailPaddingX?: string;
|
|
1272
|
+
/** Height of the selling brand's logo in the detail's top bar (default `44px`; width follows its proportions). A square logo gets the brand's name beside it. */
|
|
1273
|
+
detailLogoHeight?: string;
|
|
1274
|
+
/** Zoom on that logo inside its box (default `1`); e.g. `1.8` crops the white around a mark in a square file. */
|
|
1275
|
+
detailLogoZoom?: string;
|
|
1276
|
+
/** Product name size in the detail. */
|
|
1277
|
+
detailTitleSize?: string;
|
|
1278
|
+
/** Price size in the detail (default `24px`). */
|
|
1279
|
+
detailPriceSize?: string;
|
|
1280
|
+
/** How the main image fits its box: `cover` (fills it, crops the overflow — default) or `contain` (whole image, bars where the shapes differ). */
|
|
1281
|
+
detailImageFit?: string;
|
|
1282
|
+
/** Main image box proportion, the same for every image so the panel never jumps: `4 / 5` (default), `1 / 1`, `3 / 4`, or `auto` (each image its own). */
|
|
1283
|
+
detailImageAspect?: string;
|
|
1284
|
+
/** Cap on the main image's height (default `85vh`). */
|
|
1285
|
+
detailImageMaxHeight?: string;
|
|
1286
|
+
/** Zoom on the main image (default `1`); e.g. `1.15` to crop a white margin baked into the file. */
|
|
1287
|
+
detailImageZoom?: string;
|
|
1288
|
+
/** Side margin of the main image (default: the panel's padding, aligned with the text); `0` = edge to edge. */
|
|
1289
|
+
detailImageInset?: string;
|
|
1290
|
+
/** Background behind the main image (default the muted surface). */
|
|
1291
|
+
detailImageBg?: string;
|
|
1292
|
+
/** Thumbnail size (default `64px`). One row, scrolls sideways. */
|
|
1293
|
+
detailThumbSize?: string;
|
|
1294
|
+
/** Space between thumbnails (default `8px`). */
|
|
1295
|
+
detailThumbGap?: string;
|
|
1296
|
+
/** Thumbnail corners (default `0`). */
|
|
1297
|
+
detailThumbRadius?: string;
|
|
1298
|
+
/** Border of the selected thumbnail (default the text colour). */
|
|
1299
|
+
detailThumbActiveColor?: string;
|
|
1300
|
+
/** Height (and min width) of a size / option button (default `36px`). */
|
|
1301
|
+
detailOptionHeight?: string;
|
|
1302
|
+
/** Space between option buttons (default `6px`). */
|
|
1303
|
+
detailOptionGap?: string;
|
|
1304
|
+
/** Option button corners (default `0`). */
|
|
1305
|
+
detailOptionRadius?: string;
|
|
1306
|
+
/** `wrap` (default, several lines) or `nowrap` (one line that scrolls). */
|
|
1307
|
+
detailOptionWrap?: string;
|
|
1308
|
+
/** Height of the quantity stepper and «Legg i handlekurv» (default `52px`). */
|
|
1309
|
+
detailButtonHeight?: string;
|
|
1310
|
+
/** Corners of «Legg i handlekurv» (default `0`). */
|
|
1311
|
+
detailButtonRadius?: string;
|
|
1312
|
+
/** `sticky` or `static`: whether the buy zone (Vipps, quantity, add to cart) stays at the bottom of the panel while scrolling. Default: `static` on phones, `sticky` on desktop (with the description above it). */
|
|
1313
|
+
detailBuyPosition?: string;
|
|
1314
|
+
/** Shadow over a sticky buy zone, e.g. `0 -8px 16px rgba(0,0,0,.06)`. */
|
|
1315
|
+
detailBuyShadow?: string;
|
|
1316
|
+
/** Cart drawer width on desktop (default `440px`). */
|
|
1317
|
+
cartWidth?: string;
|
|
1318
|
+
/** Checkout panel width on desktop (default `440px`). */
|
|
1319
|
+
checkoutWidth?: string;
|
|
1320
|
+
/** Height of the brand's logo on the confirmation (default `40px`). */
|
|
1321
|
+
confirmLogoHeight?: string;
|
|
1322
|
+
/** «Takk for bestillingen!» size (default `24px`). */
|
|
1323
|
+
confirmTitleSize?: string;
|
|
1324
|
+
/** Background of the confirmation's check mark (default green). */
|
|
1325
|
+
confirmCheckBg?: string;
|
|
1326
|
+
/** Background of the «Åpner Vipps …» overlay (default translucent white). */
|
|
1327
|
+
redirectBg?: string;
|
|
1328
|
+
/** Spinner colour of that overlay (default Vipps orange). */
|
|
1329
|
+
redirectSpinner?: string;
|
|
1180
1330
|
}
|
|
1181
1331
|
/**
|
|
1182
1332
|
* Apply (or clear) theme overrides. Pass `null`/`undefined` for a key to
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { V as VioCart, a as VioCheckout, b as VioProduct, c as VioProductCarousel, d as VioProductDetail, e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-
|
|
1
|
+
export { V as VioCart, a as VioCheckout, b as VioProduct, c as VioProductCarousel, d as VioProductDetail, e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-y0KzN7bP.js';
|
|
2
2
|
import 'lit-html';
|
|
3
3
|
import 'lit';
|
|
4
4
|
|
package/dist/ui/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { registerVioElements } from '../chunk-
|
|
2
|
-
export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
import { registerVioElements } from '../chunk-Q2NALS7P.js';
|
|
2
|
+
export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-Q2NALS7P.js';
|
|
3
|
+
import '../chunk-AFJ5M53F.js';
|
|
4
4
|
|
|
5
5
|
// src/ui/index.ts
|
|
6
6
|
registerVioElements();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vio-live/web-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "Vio Web SDK — in-site shoppable + native checkout, designed for editorial commerce sites",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
33
33
|
"README.md",
|
|
34
|
-
"LICENSE"
|
|
34
|
+
"LICENSE",
|
|
35
|
+
"CHANGELOG.md"
|
|
35
36
|
],
|
|
36
37
|
"scripts": {
|
|
37
38
|
"build": "tsup",
|