@vio-live/web-sdk 0.19.0 → 0.21.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.
@@ -150,14 +150,60 @@ interface Sponsor {
150
150
  secondaryColor?: string | null;
151
151
  commerce: SponsorCommerceBlock;
152
152
  }
153
+ /**
154
+ * `campaign` of `GET /v2/mobile/config`: the head of the surface's default
155
+ * campaign (the one `primarySponsor` / `secondarySponsors` belong to).
156
+ */
157
+ interface BootstrapCampaign {
158
+ id: number;
159
+ name: string;
160
+ logo?: string | null;
161
+ isActive?: boolean;
162
+ isPaused?: boolean;
163
+ startDate?: string | null;
164
+ endDate?: string | null;
165
+ }
166
+ /** Campaign status as the backend computes it (`[startsAt, endsAt)`). */
167
+ type BootstrapCampaignStatus = 'scheduled' | 'active' | 'paused' | 'ended';
168
+ /** A slot assignment of a campaign on this surface (`campaigns[].slots[]`). */
169
+ interface BootstrapSlot {
170
+ name: string;
171
+ platform?: string | null;
172
+ startDate?: string | null;
173
+ endDate?: string | null;
174
+ }
175
+ /**
176
+ * One entry of `campaigns[]`: every active campaign of the surface, with its
177
+ * own sponsors — a sponsor may live only in a non-default campaign.
178
+ */
179
+ interface BootstrapCampaignEntry extends BootstrapCampaign {
180
+ isDefault?: boolean;
181
+ status?: BootstrapCampaignStatus;
182
+ primarySponsor?: Sponsor | null;
183
+ secondarySponsors?: Sponsor[];
184
+ slots?: BootstrapSlot[];
185
+ }
153
186
  /**
154
187
  * Response shape of `GET /v2/mobile/config` (and likely future `/v2/web/config`).
155
188
  * Matches the iOS SDK's `SdkBootstrapResponse` model.
189
+ *
190
+ * `campaign` + `primarySponsor` + `secondarySponsors` describe the surface's
191
+ * default campaign; `campaigns[]` lists every active one. There is no
192
+ * top-level `campaignId` — the id lives in `campaign.id`.
156
193
  */
157
194
  interface BootstrapResponse {
158
- campaignId?: number;
195
+ endpoints?: {
196
+ webSocketBase?: string;
197
+ commerceGraphQL?: string;
198
+ };
199
+ campaign?: BootstrapCampaign;
159
200
  primarySponsor?: Sponsor;
160
201
  secondarySponsors?: Sponsor[];
202
+ features?: {
203
+ shoppable?: boolean;
204
+ lineup?: boolean;
205
+ };
206
+ campaigns?: BootstrapCampaignEntry[];
161
207
  market?: {
162
208
  countryCode: string;
163
209
  currencyCode: string;
@@ -499,7 +545,7 @@ declare const CREATE_PAYMENT_VIPPS_MUTATION = "\nmutation CreatePaymentVipps($ch
499
545
  /**
500
546
  * GraphQL query to fetch current Vipps payment status.
501
547
  */
502
- declare const GET_VIPPS_STATUS_QUERY = "\nquery GetVippsStatus($checkoutId: String!) {\n Payment {\n GetVippsStatus(checkout_id: $checkoutId) {\n state\n }\n }\n}\n";
548
+ declare const GET_VIPPS_STATUS_QUERY = "\nquery GetVippsStatus($checkoutId: String!) {\n Payment {\n GetVippsStatus(checkout_id: $checkoutId) {\n state\n duplicate_of\n }\n }\n}\n";
503
549
  interface CreatePaymentVippsVariables extends Record<string, unknown> {
504
550
  checkoutId: string;
505
551
  /** Optional since Express: Vipps hands the email back with the payment. */
@@ -526,6 +572,8 @@ interface GetVippsStatusVariables extends Record<string, unknown> {
526
572
  }
527
573
  interface VippsStatusResult {
528
574
  state: string;
575
+ /** Set when this checkout was closed as a duplicate: the checkout that paid the cart. */
576
+ duplicate_of?: string | null;
529
577
  }
530
578
  type VippsPaymentState = 'CREATED' | 'INITIATED' | 'AUTHORIZED' | 'TERMINATED' | 'EXPIRED' | string;
531
579
  /**
@@ -546,7 +594,7 @@ declare const GET_LINE_ITEMS_BY_SUPPLIER_QUERY = "\nquery GetLineItemsBySupplier
546
594
  declare const UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION = "\nmutation UpdateShippingsBySupplier($cartId: String!, $data: [DataUpdateShippingsBySupplier!]!) {\n Cart {\n UpdateShippingsBySupplier(cart_id: $cartId, data: $data) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
547
595
  declare const CREATE_CHECKOUT_MUTATION = "\nmutation CreateCheckout($cartId: String!) {\n Checkout {\n CreateCheckout(cart_id: $cartId) {\n buyer_accepts_purchase_conditions\n buyer_accepts_terms_conditions\n created_at\n updated_at\n id\n deleted_at\n success_url\n cancel_url\n payment_method\n email\n status\n checkout_url\n origin_payment_id\n billing_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n shipping_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n available_payment_methods {\n name\n }\n discount_code\n cart {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n totals {\n currency_code\n subtotal\n shipping\n total\n taxes\n tax_rate\n discounts\n }\n }\n }\n}\n";
548
596
  declare const UPDATE_CHECKOUT_MUTATION = "\nmutation UpdateCheckout($checkoutId: String!, $status: String, $successUrl: String, $email: String, $cancelUrl: String, $paymentMethod: String, $shippingAddress: AddressArgs, $billingAddress: AddressArgs, $buyerAcceptsPurchaseConditions: Boolean, $buyerAcceptsTermsConditions: Boolean) {\n Checkout {\n UpdateCheckout(checkout_id: $checkoutId, status: $status, success_url: $successUrl, email: $email, cancel_url: $cancelUrl, payment_method: $paymentMethod, shipping_address: $shippingAddress, billing_address: $billingAddress, buyer_accepts_purchase_conditions: $buyerAcceptsPurchaseConditions, buyer_accepts_terms_conditions: $buyerAcceptsTermsConditions) {\n buyer_accepts_purchase_conditions\n buyer_accepts_terms_conditions\n created_at\n updated_at\n id\n deleted_at\n success_url\n cancel_url\n payment_method\n email\n status\n checkout_url\n origin_payment_id\n billing_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n shipping_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n available_payment_methods {\n name\n }\n discount_code\n cart {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n totals {\n currency_code\n subtotal\n shipping\n total\n taxes\n tax_rate\n discounts\n }\n }\n }\n}\n";
549
- declare const GET_CHECKOUT_QUERY = "\nquery GetCheckout($checkoutId: String!) {\n Checkout {\n GetCheckout(checkout_id: $checkoutId) {\n buyer_accepts_purchase_conditions\n buyer_accepts_terms_conditions\n created_at\n updated_at\n id\n deleted_at\n success_url\n cancel_url\n payment_method\n email\n status\n checkout_url\n origin_payment_id\n billing_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n shipping_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n available_payment_methods {\n name\n }\n discount_code\n cart {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n totals {\n currency_code\n subtotal\n shipping\n total\n taxes\n tax_rate\n discounts\n }\n }\n }\n}\n";
597
+ declare const GET_CHECKOUT_QUERY = "\nquery GetCheckout($checkoutId: String!) {\n Checkout {\n GetCheckout(checkout_id: $checkoutId) {\n buyer_accepts_purchase_conditions\n buyer_accepts_terms_conditions\n created_at\n updated_at\n id\n deleted_at\n success_url\n cancel_url\n payment_method\n email\n status\n checkout_url\n origin_payment_id\n duplicate_of\n billing_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n shipping_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n available_payment_methods {\n name\n }\n discount_code\n cart {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n totals {\n currency_code\n subtotal\n shipping\n total\n taxes\n tax_rate\n discounts\n }\n }\n }\n}\n";
550
598
  declare const GET_AVAILABLE_PAYMENT_METHODS_QUERY = "\nquery Config {\n Payment {\n GetAvailablePaymentMethods {\n config {\n name\n type\n value\n }\n name\n }\n }\n}\n";
551
599
  /** Transport options for a cart/checkout GraphQL call. */
552
600
  interface CartQueryOptions {
@@ -1391,6 +1439,7 @@ declare class CheckoutManager extends EventTarget {
1391
1439
  * cart-queries.ts for why this exists instead of trusting GetCheckout. */
1392
1440
  getVippsStatus(checkoutId: string, sponsorId?: number): Promise<{
1393
1441
  state?: string;
1442
+ duplicate_of?: string | null;
1394
1443
  } | null>;
1395
1444
  /**
1396
1445
  * Kustom (former Klarna Checkout) — create the KCO order via Vio Commerce
@@ -1726,6 +1775,7 @@ declare class CheckoutManager extends EventTarget {
1726
1775
  * the publisher-facing feature; NOT part of the Vio pipeline)
1727
1776
  * 3. `vio:analytics` DOM event — always when started (inspector/bridges)
1728
1777
  */
1778
+
1729
1779
  declare const ANALYTICS_EVENT_NAMES: readonly ["view_item_list", "select_item", "view_item", "add_to_cart", "remove_from_cart", "view_cart", "begin_checkout", "purchase", "component_impression", "component_click", "ad_impression", "ad_click", "poll_impression", "contest_impression", "session_start", "session_end", "checkout_error", "sdk_error"];
1730
1780
  type AnalyticsEventName = (typeof ANALYTICS_EVENT_NAMES)[number];
1731
1781
  /** Camel-case for DX; mapped to the snake_case wire format at build time. */
@@ -1882,6 +1932,60 @@ declare class AnalyticsManager extends EventTarget {
1882
1932
  private cartCommerce;
1883
1933
  private findLine;
1884
1934
  }
1935
+ /**
1936
+ * The `campaign_id` of an event. In order: the context's explicit id; the
1937
+ * active campaign of `campaigns[]` the event's sponsor takes part in, as its
1938
+ * primary or one of its secondaries — when it is in several, the surface's
1939
+ * default campaign if it is one of them, else the first one the backend
1940
+ * lists; the default campaign (`campaign.id`). `/v2/mobile/config` has no
1941
+ * top-level `campaignId` — reading one is why every event used to leave
1942
+ * with `campaign_id: 0` and the campaigns screen stayed empty.
1943
+ *
1944
+ * A malformed `campaigns[]` (not an array, a null entry) never breaks
1945
+ * `track()`: it falls back to `campaign.id`.
1946
+ */
1947
+ declare function resolveCampaignId(ctx: Pick<AnalyticsContext, 'campaignId' | 'sponsorId'>, boot: Pick<BootstrapResponse, 'campaign' | 'campaigns'> | null | undefined): number | undefined;
1948
+ /**
1949
+ * `detail` of `vio:payment-success` as the checkout emits it. Four paths,
1950
+ * three shapes: a redirect return (`orderId` = Vio's checkout id), the
1951
+ * confirmation drawer and a provider's own receipt (`result` from the
1952
+ * provider or the backend, plus Vio's `checkoutId`), and Apple Pay express
1953
+ * from the cart (`result` with the backend's `confirmation`, no sponsor).
1954
+ */
1955
+ interface PaymentSuccessDetail {
1956
+ method?: string;
1957
+ sponsorId?: number | string;
1958
+ /** Redirect return: Vio's checkout id (the name predates `checkoutId`). */
1959
+ orderId?: string | number;
1960
+ /** Vio's checkout id — from the checkout state or the return URL. */
1961
+ checkoutId?: string | number;
1962
+ result?: PaymentSuccessResult | null;
1963
+ }
1964
+ /**
1965
+ * What the checkout attaches as `result`. Only `confirmation` carries a Vio
1966
+ * id: the order `ConfirmPaymentApplePay` created. `order.orderId` / `orderId`
1967
+ * are the PROVIDER's references (Qliro's, Walley's — the checkout itself
1968
+ * shows them as `providerRef`), and `chargedTotal` includes shipping on some
1969
+ * methods only. Analytics reads none of those.
1970
+ */
1971
+ interface PaymentSuccessResult {
1972
+ confirmation?: {
1973
+ orderId?: string | number | null;
1974
+ status?: string;
1975
+ } | null;
1976
+ [key: string]: unknown;
1977
+ }
1978
+ /**
1979
+ * The `order_id` of a `purchase`: ALWAYS a Vio id, never a provider's
1980
+ * reference. Normalized across every emitter: `orderId` (redirect return) →
1981
+ * `result.confirmation.orderId` (Apple Pay) → `checkoutId`. `value` and
1982
+ * `currency` are deliberately NOT read from the result: on every path they
1983
+ * come from the cart snapshot (sum of the items, no shipping), so revenue
1984
+ * stays comparable across payment methods — the charged total will arrive
1985
+ * through the server-side `order_paid` event. With nothing to say it
1986
+ * returns `{}`, so the cart snapshot keeps its keys.
1987
+ */
1988
+ declare function purchaseFromPaymentSuccess(d: PaymentSuccessDetail): Pick<AnalyticsCommerce, 'orderId'>;
1885
1989
 
1886
1990
  declare class VioFacade {
1887
1991
  private apiInstance;
@@ -1891,6 +1995,10 @@ declare class VioFacade {
1891
1995
  /** Last bootstrap failure — short backoff so cart mutations don't hammer a
1892
1996
  * dead endpoint on every call. */
1893
1997
  private bootstrapFailedAt;
1998
+ /** Bumped by every init(). A bootstrap started under an older configuration
1999
+ * (another key or environment) is still in flight after a re-init; its answer
2000
+ * belongs to that configuration and must not land in this one. */
2001
+ private generation;
1894
2002
  private cartManager;
1895
2003
  private checkoutManager;
1896
2004
  private analyticsManager;
@@ -1911,6 +2019,11 @@ declare class VioFacade {
1911
2019
  /**
1912
2020
  * Bootstrap — fetches client config and caches it. Dedupes in-flight
1913
2021
  * concurrent requests.
2022
+ *
2023
+ * A request that was started before the last init() (Vev starts with the key
2024
+ * the browser remembers, then the page's own key arrives) answers for a key
2025
+ * that is gone: it neither fills the cache nor arms the failure backoff, and
2026
+ * whoever awaited it gets the current configuration's bootstrap instead.
1914
2027
  */
1915
2028
  bootstrap(): Promise<BootstrapResponse>;
1916
2029
  get bootstrapCache(): BootstrapResponse | null;
@@ -1932,7 +2045,7 @@ declare const Vio: VioFacade;
1932
2045
  *
1933
2046
  * RELEASE CHECKLIST: bump together with package.json (see CONTRIBUTING).
1934
2047
  */
1935
- declare const SDK_VERSION = "0.19.0";
2048
+ declare const SDK_VERSION = "0.21.0";
1936
2049
 
1937
2050
  /**
1938
2051
  * Vipps MobilePay's own button, the way the design guidelines ask for it.
@@ -1961,4 +2074,4 @@ declare function vippsButtonAttributes(verb?: 'buy' | 'pay' | 'express' | 'conti
1961
2074
  language?: string;
1962
2075
  }): Record<string, string>;
1963
2076
 
1964
- export { ADD_ITEM_MUTATION, type AddManualOptions, type AddProductOptions, type AnalyticsCommerce, type AnalyticsContext, type AnalyticsEventName, type AnalyticsItemInput, AnalyticsManager, type AnalyticsStartOptions, type ApplePayConfig, type ApplePayResult, type BootstrapResponse, 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 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, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes };
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 };
@@ -1,4 +1,4 @@
1
1
  import '../chunk-PZUOMOLF.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, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from '../chunk-CMNTHF66.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, 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-WTVGVDZX.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, BootstrapResponse, 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, 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, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from './core/index.js';
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';
2
2
  import 'graphql-request';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import './chunk-PZUOMOLF.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, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from './chunk-CMNTHF66.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, 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-WTVGVDZX.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -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-IrVSMVcA.js';
3
- export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-IrVSMVcA.js';
2
+ import { V as VioCart$1, a as VioCheckout$1, b as VioProduct$1, c as VioProductCarousel$1, d as VioProductDetail$1 } from '../tokens-Dkbfcd1L.js';
3
+ export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-Dkbfcd1L.js';
4
4
  import 'lit-html';
5
5
  import 'lit';
6
6
 
@@ -1,6 +1,6 @@
1
- import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-NUNGU6LL.js';
2
- export { VioTokens, applyVioTheme } from '../chunk-NUNGU6LL.js';
3
- import '../chunk-CMNTHF66.js';
1
+ import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-MRJR6DG5.js';
2
+ export { VioTokens, applyVioTheme } from '../chunk-MRJR6DG5.js';
3
+ import '../chunk-WTVGVDZX.js';
4
4
  import * as React from 'react';
5
5
 
6
6
  // node_modules/@lit/react/node/create-component.js
@@ -146,10 +146,13 @@ declare class VioProductDetail extends LitElement {
146
146
  private optMapCache;
147
147
  /** Pre-prepared Apple Pay handle — show() fires synchronously on tap. */
148
148
  private applePayHandle;
149
+ /** Keyboard and focus while open: Escape closes, Tab stays inside, focus returns to the opener. */
150
+ private readonly dialogFocus;
149
151
  private boundProductClick;
150
152
  static styles: lit.CSSResult;
151
153
  connectedCallback(): void;
152
154
  disconnectedCallback(): void;
155
+ updated(changed: Map<string, unknown>): void;
153
156
  show(): void;
154
157
  close(): void;
155
158
  private fetchProduct;
@@ -279,6 +282,8 @@ declare class VioCart extends LitElement {
279
282
  private preparedTotal;
280
283
  /** In-flight guard for loadAvailablePaymentMethods. */
281
284
  private loadingPaymentMethods;
285
+ /** Keyboard and focus while open: Escape closes, Tab stays inside, focus returns to the opener. */
286
+ private readonly dialogFocus;
282
287
  private boundOnCartChange;
283
288
  static styles: lit.CSSResult;
284
289
  connectedCallback(): void;
@@ -490,6 +495,13 @@ declare class VioCheckout extends LitElement {
490
495
  private form;
491
496
  /** In-flight guard for loadAvailablePaymentMethods. */
492
497
  private loadingPaymentMethods;
498
+ /**
499
+ * Keyboard and focus while open: Escape closes — not while a payment is
500
+ * in flight — Tab stays inside, focus returns to the opener.
501
+ */
502
+ private readonly dialogFocus;
503
+ /** A payment is being started or confirmed right now: the overlay must not close under it. */
504
+ private get paymentInFlight();
493
505
  /**
494
506
  * Whether a load has COMPLETED, either way. `availableMethods === null`
495
507
  * cannot tell "not asked yet" from "asked and failed", and rendering every
@@ -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-IrVSMVcA.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-Dkbfcd1L.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-NUNGU6LL.js';
2
- export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-NUNGU6LL.js';
3
- import '../chunk-CMNTHF66.js';
1
+ import { registerVioElements } from '../chunk-MRJR6DG5.js';
2
+ export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-MRJR6DG5.js';
3
+ import '../chunk-WTVGVDZX.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.19.0",
3
+ "version": "0.21.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",