@vio-live/web-sdk 0.27.0 → 0.29.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.
@@ -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;
@@ -291,13 +297,27 @@ declare class VioProductDetail extends LitElement {
291
297
  private optMapCache;
292
298
  /** Pre-prepared Apple Pay handle — show() fires synchronously on tap. */
293
299
  private applePayHandle;
300
+ /** The amount `applePayHandle`'s sheet shows (product × quantity when it was prepared). */
301
+ private applePayAmount;
302
+ /** The amount the latest preparation was asked for — a newer one supersedes it. */
303
+ private applePayAskedFor;
294
304
  /** Keyboard and focus while open: Escape closes, Tab stays inside, focus returns to the opener. */
295
305
  private readonly dialogFocus;
306
+ /** Phones: the page behind is locked, and the sheet closes by pulling the bar or the top bar down. */
307
+ private readonly bottomSheet;
296
308
  private boundProductClick;
297
309
  static styles: lit.CSSResult;
298
310
  connectedCallback(): void;
299
311
  disconnectedCallback(): void;
300
312
  updated(changed: Map<string, unknown>): void;
313
+ private thumbRow;
314
+ /** Arrows only when the row overflows; each one off at its own end. */
315
+ private measureThumbs;
316
+ private onThumbsScroll;
317
+ /** One arrow press moves most of a visible row. */
318
+ private scrollThumbs;
319
+ /** The selected thumbnail is always visible: the row scrolls to it, the page never does. */
320
+ private revealActiveThumb;
301
321
  show(): void;
302
322
  close(): void;
303
323
  private fetchProduct;
@@ -378,26 +398,51 @@ declare class VioProductDetail extends LitElement {
378
398
  private loadVippsButton;
379
399
  private buyWithVipps;
380
400
  private startVippsExpressOrCheckout;
401
+ /** The ordinary way in, Vipps preselected: the host opens the checkout on `vio:checkout-open`. */
402
+ private openCheckoutWithVipps;
403
+ /** The ordinary way in with a method preselected: the host opens the checkout on `vio:checkout-open`. */
404
+ private openCheckoutWith;
381
405
  /** Buy with Stripe — opens the checkout with Stripe preselected. */
382
406
  private buyWithStripe;
407
+ /** Prepare the Apple Pay sheet for this product × quantity; the newest preparation wins. */
408
+ private prepareApplePaySheet;
383
409
  /**
384
410
  * Express buy with Apple Pay. Runs synchronously inside the click so the
385
411
  * Apple Pay sheet keeps the user gesture: add to cart → open checkout (sets
386
412
  * state) → launch the sheet. On authorize, `payment-complete` drives the
387
413
  * confirmation drawer (same path as the in-checkout Apple Pay button).
414
+ *
415
+ * The sheet's amount is fixed before the tap (Apple blocks a sheet opened
416
+ * after an await, so it cannot wait for the server's cart), while the
417
+ * charge is the sponsor's WHOLE cart. So the sheet opens only when it shows
418
+ * what will be charged: an empty cart, and a sheet prepared for this
419
+ * product × quantity. Otherwise — lines already in the cart (as with Vipps,
420
+ * see buyWithVipps), or a quantity whose sheet is still being prepared —
421
+ * the product is added and the checkout opens with Apple Pay preselected:
422
+ * every line and the total on screen, and its own Apple Pay button pays
423
+ * that total.
388
424
  */
389
425
  private buyWithApplePay;
390
426
  /** The seller's Company name; the brand when there is none; nothing while asking. */
391
427
  private headerName;
392
428
  private loadSeller;
393
429
  /**
394
- * Who sells the product: the brand of the sponsor it was fetched with —
395
- * its logo, with the name as `alt`. Without a logo that loads, the topbar
396
- * already names the seller (its Company name, else the brand), so the name
397
- * goes here only when the topbar names nobody once the seller is known —
398
- * never the same name twice. Nothing at all when no identity is known.
430
+ * Who sells the product, top left beside the close (Mote & Livsstil,
431
+ * 2026-10-22): the logo of the sponsor the product was fetched with — the
432
+ * product's brand, never the article's — with its name as `alt`; without a
433
+ * logo that loads, its name; without an identity, the seller's Company name
434
+ * (or the product's brand) once known. Size: --vio-detail-logo-height.
435
+ */
436
+ private renderTopbarSponsor;
437
+ /**
438
+ * Under the buy buttons: «Du handler direkte hos {brand}.» — the brand the
439
+ * product was fetched with (the sponsor; its Company name or the product's
440
+ * brand when no identity is known), never the article's. Nothing when no
441
+ * name is known.
399
442
  */
400
- private renderSponsorHeader;
443
+ private renderSellerNote;
444
+ /** Square-ish logo (4:5 to 5:4) → the top bar shows the name beside it. */
445
+ private measureLogo;
401
446
  render(): lit_html.TemplateResult<1>;
402
447
  private renderBody;
403
448
  private renderOptionPickers;
@@ -437,6 +482,8 @@ declare class VioCart extends LitElement {
437
482
  private loadingPaymentMethods;
438
483
  /** Keyboard and focus while open: Escape closes, Tab stays inside, focus returns to the opener. */
439
484
  private readonly dialogFocus;
485
+ /** Phones: the page behind is locked, and the sheet closes by pulling the bar or the header down. */
486
+ private readonly bottomSheet;
440
487
  private boundOnCartChange;
441
488
  static styles: lit.CSSResult;
442
489
  connectedCallback(): void;
@@ -502,6 +549,12 @@ declare class VioCheckout extends LitElement {
502
549
  open: boolean;
503
550
  heading: string;
504
551
  shippingLabel: string;
552
+ /**
553
+ * Vipps Express: the shopper picks the delivery inside Vipps, so with Vipps
554
+ * selected our own shipping rate is not part of the total and the summary
555
+ * says the shipping is chosen in Vipps (Angelo, 2026-10-24).
556
+ */
557
+ private vippsShipsInApp;
505
558
  /** Express mode — render only the Klarna widget (no address form / method grid). */
506
559
  express: boolean;
507
560
  private checkoutState;
@@ -665,6 +718,8 @@ declare class VioCheckout extends LitElement {
665
718
  * in flight — Tab stays inside, focus returns to the opener.
666
719
  */
667
720
  private readonly dialogFocus;
721
+ /** Phones: the page behind is locked, and the sheet closes by pulling the bar or the top bar down — not mid-payment. */
722
+ private readonly bottomSheet;
668
723
  /** A payment is being started or confirmed right now: the overlay must not close under it. */
669
724
  private get paymentInFlight();
670
725
  /**
@@ -854,7 +909,9 @@ declare class VioCheckout extends LitElement {
854
909
  * `visibilitychange`) or the element leaves, the event goes out at once
855
910
  * without the reference. Exactly one event per call. `afterwards` runs
856
911
  * right after the event, so a path keeps the order it always had (the cart
857
- * is cleared after the event).
912
+ * is cleared after the event). When that answer already has Vio's order
913
+ * number, the event carries it too (`orderNumber`): it is the purchase's
914
+ * `order_id`, and analytics need not ask again.
858
915
  */
859
916
  private emitPaymentSuccess;
860
917
  /** Whether asking the checkout for the buyer reference can still help. */
@@ -864,8 +921,9 @@ declare class VioCheckout extends LitElement {
864
921
  * failed or has neither the reference nor an order yet (the webhook has not
865
922
  * written the checkout), again at 1.2 s — all within 2.5 s. An order
866
923
  * without a reference is a settled answer: the backend has none, asking
867
- * again cannot help. `undefined` when the time is up, when the answer
868
- * stopped mattering (`stopped()`) or on failure.
924
+ * again cannot help. Whatever the answer said of the order number comes
925
+ * back with it. `{}` when the time is up, when the answer stopped mattering
926
+ * (`stopped()`) or on failure.
869
927
  */
870
928
  private askBuyerRef;
871
929
  /** Waits between asks for the Vio order number: the order is often born a
@@ -886,6 +944,8 @@ declare class VioCheckout extends LitElement {
886
944
  * express always has one; the normal flow has one once the backend
887
945
  * shippings loaded (the choice IS persisted on the cart and charged). */
888
946
  private shippingMajor;
947
+ /** Vipps is the method and it runs as Express: the delivery is chosen in Vipps. */
948
+ private vippsChoosesShipping;
889
949
  /** The rate the summary names — Qliro's own pick while Qliro is the method. */
890
950
  private summaryShippingName;
891
951
  /** Total to charge — items + shipping (express). */
@@ -1233,6 +1293,68 @@ interface VioThemeOverrides {
1233
1293
  spaceMd?: string;
1234
1294
  spaceLg?: string;
1235
1295
  spaceXl?: string;
1296
+ /** Product detail panel width on desktop (default `440px`). */
1297
+ detailWidth?: string;
1298
+ /** Side padding of the detail (default the `lg` space, `24px`). */
1299
+ detailPaddingX?: string;
1300
+ /** 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. */
1301
+ detailLogoHeight?: string;
1302
+ /** Zoom on that logo inside its box (default `1`); e.g. `1.8` crops the white around a mark in a square file. */
1303
+ detailLogoZoom?: string;
1304
+ /** Product name size in the detail. */
1305
+ detailTitleSize?: string;
1306
+ /** Price size in the detail (default `24px`). */
1307
+ detailPriceSize?: string;
1308
+ /** How the main image fits its box: `cover` (fills it, crops the overflow — default) or `contain` (whole image, bars where the shapes differ). */
1309
+ detailImageFit?: string;
1310
+ /** 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). */
1311
+ detailImageAspect?: string;
1312
+ /** Cap on the main image's height (default `85vh`). */
1313
+ detailImageMaxHeight?: string;
1314
+ /** Zoom on the main image (default `1`); e.g. `1.15` to crop a white margin baked into the file. */
1315
+ detailImageZoom?: string;
1316
+ /** Side margin of the main image (default: the panel's padding, aligned with the text); `0` = edge to edge. */
1317
+ detailImageInset?: string;
1318
+ /** Background behind the main image (default the muted surface). */
1319
+ detailImageBg?: string;
1320
+ /** Thumbnail size (default `64px`). One row, scrolls sideways. */
1321
+ detailThumbSize?: string;
1322
+ /** Space between thumbnails (default `8px`). */
1323
+ detailThumbGap?: string;
1324
+ /** Thumbnail corners (default `0`). */
1325
+ detailThumbRadius?: string;
1326
+ /** Border of the selected thumbnail (default the text colour). */
1327
+ detailThumbActiveColor?: string;
1328
+ /** Height (and min width) of a size / option button (default `36px`). */
1329
+ detailOptionHeight?: string;
1330
+ /** Space between option buttons (default `6px`). */
1331
+ detailOptionGap?: string;
1332
+ /** Option button corners (default `0`). */
1333
+ detailOptionRadius?: string;
1334
+ /** `wrap` (default, several lines) or `nowrap` (one line that scrolls). */
1335
+ detailOptionWrap?: string;
1336
+ /** Height of the quantity stepper and «Legg i handlekurv» (default `52px`). */
1337
+ detailButtonHeight?: string;
1338
+ /** Corners of «Legg i handlekurv» (default `0`). */
1339
+ detailButtonRadius?: string;
1340
+ /** `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). */
1341
+ detailBuyPosition?: string;
1342
+ /** Shadow over a sticky buy zone, e.g. `0 -8px 16px rgba(0,0,0,.06)`. */
1343
+ detailBuyShadow?: string;
1344
+ /** Cart drawer width on desktop (default `440px`). */
1345
+ cartWidth?: string;
1346
+ /** Checkout panel width on desktop (default `440px`). */
1347
+ checkoutWidth?: string;
1348
+ /** Height of the brand's logo on the confirmation (default `40px`). */
1349
+ confirmLogoHeight?: string;
1350
+ /** «Takk for bestillingen!» size (default `24px`). */
1351
+ confirmTitleSize?: string;
1352
+ /** Background of the confirmation's check mark (default green). */
1353
+ confirmCheckBg?: string;
1354
+ /** Background of the «Åpner Vipps …» overlay (default translucent white). */
1355
+ redirectBg?: string;
1356
+ /** Spinner colour of that overlay (default Vipps orange). */
1357
+ redirectSpinner?: string;
1236
1358
  }
1237
1359
  /**
1238
1360
  * Apply (or clear) theme overrides. Pass `null`/`undefined` for a key to
@@ -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-CihuCU2l.js';
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-Dok4d21V.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-GLAKUYQA.js';
2
- export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-GLAKUYQA.js';
3
- import '../chunk-HJRIPCWB.js';
1
+ import { registerVioElements } from '../chunk-L6YYYKQK.js';
2
+ export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-L6YYYKQK.js';
3
+ import '../chunk-AG4G2S2M.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.27.0",
3
+ "version": "0.29.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",