@vio-live/web-sdk 0.4.2 → 0.5.1

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.
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=chunk-QYQQ5J6E.js.map
3
+ //# sourceMappingURL=chunk-QYQQ5J6E.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-PBQSHIID.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-QYQQ5J6E.js"}
@@ -20,6 +20,11 @@ interface VioConfig {
20
20
  apiBase?: string;
21
21
  /** Override GraphQL base. Defaults are env-aware. */
22
22
  graphQLBase?: string;
23
+ /**
24
+ * Override the analytics collector base (vio-analytics service).
25
+ * Defaults are env-aware (`events-dev`/`events-staging`/`events.vio.live`).
26
+ */
27
+ eventsBase?: string;
23
28
  /**
24
29
  * Stripe **publishable** key (`pk_test_xxx` or `pk_live_xxx`). Used for
25
30
  * Apple Pay (via Payment Request) and Card flows. Public-safe — fine
@@ -45,6 +50,7 @@ interface ResolvedConfig {
45
50
  environment: Environment;
46
51
  apiBase: string;
47
52
  graphQLBase: string;
53
+ eventsBase: string;
48
54
  stripePublishableKey?: string;
49
55
  klarnaClientId?: string;
50
56
  klarnaEnvironment: 'playground' | 'production';
@@ -929,6 +935,152 @@ declare class CheckoutManager extends EventTarget {
929
935
  private emit;
930
936
  }
931
937
 
938
+ /**
939
+ * Vio.analytics — the web SDK's half of the Vio Analytics pipeline.
940
+ *
941
+ * Events flow to the Vio collector (`POST <eventsBase>/v1/events`, repo
942
+ * vio-live/vio-analytics) which owns raw storage (ClickHouse) and vendor
943
+ * fan-out (Mixpanel today). THE SDK NEVER TALKS TO VENDORS — swapping or
944
+ * dropping a vendor is a server-side change, zero client releases.
945
+ * Wire contract: vio-analytics `docs/EVENTS_CONTRACT.md` (v1, snake_case).
946
+ *
947
+ * Design rules:
948
+ * - SIDE-EFFECT-FREE MODULE. Nothing runs at import time (tsup/tree-shaking
949
+ * contract, see lessons/web-sdk-tsup-singleton-and-build). Listeners are
950
+ * installed by an explicit `Vio.analytics.start()`.
951
+ * - `track()` works BEFORE `Vio.init()` — events queue and flush once the
952
+ * SDK is configured (transport resolves at flush time, not at track time).
953
+ * - SSR-safe: without `window` every call is a silent no-op.
954
+ * - Retries are safe: `event_id` is stable per event, the collector
955
+ * dedupes. Queue is bounded (drop-oldest) so a dead collector can never
956
+ * grow memory unbounded.
957
+ * - Anti-double-count: the SDK only reports what the server can't see.
958
+ * Votes/participations are server truth; `ad_activation`/`cart_intent`
959
+ * are mirrored server-side, never from here.
960
+ *
961
+ * Three sinks, matching the Vev precedent (vio-vev analytics.ts, which
962
+ * becomes an adapter over this in F3):
963
+ * 1. collector (default ON once started)
964
+ * 2. window.dataLayer — GA4/GTM (opt-in `start({ dataLayer: true })`,
965
+ * the publisher-facing feature; NOT part of the Vio pipeline)
966
+ * 3. `vio:analytics` DOM event — always when started (inspector/bridges)
967
+ */
968
+ declare const ANALYTICS_EVENT_NAMES: readonly ["view_item_list", "select_item", "view_item", "add_to_cart", "view_cart", "begin_checkout", "purchase", "component_impression", "component_click", "ad_impression", "ad_click", "poll_impression", "contest_impression", "session_start", "session_end"];
969
+ type AnalyticsEventName = (typeof ANALYTICS_EVENT_NAMES)[number];
970
+ /** Camel-case for DX; mapped to the snake_case wire format at build time. */
971
+ interface AnalyticsContext {
972
+ campaignId?: number;
973
+ broadcastId?: string;
974
+ campaignComponentId?: number;
975
+ appPlacementId?: number;
976
+ locationId?: string;
977
+ componentTemplateId?: string;
978
+ sponsorId?: number;
979
+ activationId?: number;
980
+ contentUrl?: string;
981
+ /** Human-readable content snapshot; auto-filled from document.title. */
982
+ contentTitle?: string;
983
+ variant?: string;
984
+ }
985
+ interface AnalyticsItemInput {
986
+ productId: number | string;
987
+ name?: string;
988
+ brand?: string;
989
+ variantId?: number | string;
990
+ price?: number;
991
+ quantity?: number;
992
+ }
993
+ interface AnalyticsCommerce {
994
+ items?: AnalyticsItemInput[];
995
+ value?: number;
996
+ currency?: string;
997
+ orderId?: string;
998
+ paymentMethod?: string;
999
+ }
1000
+ interface TrackOptions {
1001
+ context?: AnalyticsContext;
1002
+ commerce?: AnalyticsCommerce;
1003
+ props?: Record<string, unknown>;
1004
+ }
1005
+ interface AnalyticsStartOptions {
1006
+ /** Where the SDK is embedded: 'vev' | 'replit' | 'custom' | … Default 'custom'. */
1007
+ host?: string;
1008
+ /**
1009
+ * Install the automatic funnel listeners (vio:added-to-cart,
1010
+ * vio:checkout-open, vio:open-cart, vio:payment-success). Default true.
1011
+ * Hosts with their OWN instrumentation choke point (e.g. the Vev module,
1012
+ * which forwards every event through trackEvent()) set false so the same
1013
+ * user action is never tracked twice — they keep the session/batching/
1014
+ * transport engine and call track() themselves.
1015
+ */
1016
+ autoTrack?: boolean;
1017
+ /** Send to the Vio collector. Default true. */
1018
+ collector?: boolean;
1019
+ /** Also push GA4 e-commerce events to window.dataLayer (publisher feature). */
1020
+ dataLayer?: boolean;
1021
+ /** console.debug every event. */
1022
+ debug?: boolean;
1023
+ }
1024
+ declare class AnalyticsManager extends EventTarget {
1025
+ private started;
1026
+ private options;
1027
+ private queue;
1028
+ private flushTimer;
1029
+ private retryAttempt;
1030
+ private retryNotBefore;
1031
+ private externalUserId;
1032
+ private sessionId;
1033
+ private sessionStartedAt;
1034
+ /** Impression once-per-(session, component) guard; reset on session rotation. */
1035
+ private impressedComponents;
1036
+ /** Last NON-EMPTY cart snapshot — `purchase` uses it because several flows
1037
+ * (Apple Pay) clear the cart BEFORE `vio:payment-success` fires. */
1038
+ private lastCartSnapshot;
1039
+ private teardown;
1040
+ /**
1041
+ * Install listeners + begin flushing. Explicit on purpose (no module
1042
+ * side-effects). Safe to call twice (second call only updates options).
1043
+ */
1044
+ start(options?: AnalyticsStartOptions): void;
1045
+ /** Stop timers + listeners (tests / SPA unmount). Queue survives. */
1046
+ stop(): void;
1047
+ /** Attach the partner's user id (opaque) to all subsequent events. */
1048
+ identify(externalUserId: string | null): void;
1049
+ /** Queue one event. Works pre-init and pre-start (SSR: no-op). */
1050
+ track(name: AnalyticsEventName, opts?: TrackOptions): void;
1051
+ /**
1052
+ * Impression helper: observes an element and tracks ONE
1053
+ * `component_impression` per (session, campaignComponentId) when the
1054
+ * contract's rule is met (≥50% visible, ≥1s dwell). Returns an
1055
+ * unobserve function.
1056
+ */
1057
+ observeImpression(element: Element, context?: AnalyticsContext, opts?: {
1058
+ name?: Extract<AnalyticsEventName, 'component_impression' | 'ad_impression'>;
1059
+ /** Dedupe key override. Defaults to the strongest id available:
1060
+ * campaignComponentId → locationId → componentTemplateId. */
1061
+ key?: string;
1062
+ /** Called the one time the impression is tracked (e.g. to fire a
1063
+ * companion view_item_list). */
1064
+ onImpression?: () => void;
1065
+ }): () => void;
1066
+ /** Force a flush (mostly for tests). */
1067
+ flush(): Promise<void>;
1068
+ private buildEvent;
1069
+ private anonId;
1070
+ /** Rolling session: renewed by activity, rotated after 30 min idle. */
1071
+ private ensureSession;
1072
+ private trackSessionEnd;
1073
+ private flushWithBeacon;
1074
+ /**
1075
+ * Auto-instrumentation over the SDK's own DOM events — the host app
1076
+ * writes ZERO tracking code for the commerce funnel.
1077
+ */
1078
+ private installAutoListeners;
1079
+ /** Current cart → commerce payload; falls back to the pre-clear snapshot. */
1080
+ private cartCommerce;
1081
+ private findLine;
1082
+ }
1083
+
932
1084
  declare class VioFacade {
933
1085
  private apiInstance;
934
1086
  private commerceClients;
@@ -939,6 +1091,7 @@ declare class VioFacade {
939
1091
  private bootstrapFailedAt;
940
1092
  private cartManager;
941
1093
  private checkoutManager;
1094
+ private analyticsManager;
942
1095
  init(config: VioConfig): void;
943
1096
  get isInitialized(): boolean;
944
1097
  get config(): ResolvedConfig;
@@ -946,6 +1099,11 @@ declare class VioFacade {
946
1099
  get cart(): CartManager;
947
1100
  /** Checkout flow manager. Subscribes to cart state via the CartManager. */
948
1101
  get checkout(): CheckoutManager;
1102
+ /**
1103
+ * Analytics — track() queues even pre-init; nothing is sent (and no
1104
+ * listeners are installed) until an explicit `Vio.analytics.start()`.
1105
+ */
1106
+ get analytics(): AnalyticsManager;
949
1107
  /** Lazy VioApi for REST endpoints on `api-dev.vio.live`. */
950
1108
  get api(): VioApi;
951
1109
  /**
@@ -1064,4 +1222,13 @@ declare function getAvailablePaymentMethods(options?: CartQueryOptions): Promise
1064
1222
  declare const CREATE_PAYMENT_STRIPE_MUTATION = "\nmutation CreatePaymentStripe($checkoutId: String!, $successUrl: String!, $paymentMethod: String!, $email: String!) {\n Payment {\n CreatePaymentStripe(checkout_id: $checkoutId, success_url: $successUrl, payment_method: $paymentMethod, email: $email) {\n order_id\n checkout_url\n }\n }\n}\n";
1065
1223
  declare function createPaymentStripe(variables: Record<string, unknown>, options?: CartQueryOptions): Promise<any>;
1066
1224
 
1067
- export { ADD_ITEM_MUTATION, type AddManualOptions, type AddProductOptions, 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, type Sponsor, type SponsorCartState, type SponsorCommerceBlock, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, type VioConfig, type VippsPaymentState, type VippsStatusResult, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier };
1225
+ /**
1226
+ * SDK version reported in analytics events (`sdk_version`) and available
1227
+ * to consumers. Kept as a constant (not a package.json import) so the
1228
+ * core stays bundler-agnostic.
1229
+ *
1230
+ * RELEASE CHECKLIST: bump together with package.json (see CONTRIBUTING).
1231
+ */
1232
+ declare const SDK_VERSION = "0.5.1";
1233
+
1234
+ 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, Vio, VioApi, VioApiError, type VioConfig, type VippsPaymentState, type VippsStatusResult, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier };
@@ -1,4 +1,4 @@
1
- import '../chunk-PBQSHIID.js';
2
- export { ADD_ITEM_MUTATION, 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, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from '../chunk-KMIARP6X.js';
1
+ import '../chunk-QYQQ5J6E.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, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from '../chunk-7Q4MJ5NQ.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, 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, Sponsor, SponsorCartState, SponsorCommerceBlock, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, VioConfig, VippsPaymentState, VippsStatusResult, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from './core/index.js';
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, Vio, VioApi, VioApiError, VioConfig, VippsPaymentState, VippsStatusResult, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from './core/index.js';
2
2
  import 'graphql-request';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import './chunk-PBQSHIID.js';
2
- export { ADD_ITEM_MUTATION, 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, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from './chunk-KMIARP6X.js';
1
+ import './chunk-QYQQ5J6E.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, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from './chunk-7Q4MJ5NQ.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-DjVcB-RL.js';
3
- export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-DjVcB-RL.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-TIH4RkPl.js';
3
+ export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-TIH4RkPl.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-D6IA4ZWL.js';
2
- export { VioTokens, applyVioTheme } from '../chunk-D6IA4ZWL.js';
3
- import '../chunk-KMIARP6X.js';
1
+ import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-LRXVUOEG.js';
2
+ export { VioTokens, applyVioTheme } from '../chunk-LRXVUOEG.js';
3
+ import '../chunk-7Q4MJ5NQ.js';
4
4
  import * as React from 'react';
5
5
 
6
6
  // node_modules/@lit/react/node/create-component.js
@@ -90,8 +90,16 @@ declare class VioProductCarousel extends LitElement {
90
90
  private fetchError;
91
91
  static styles: lit.CSSResult;
92
92
  connectedCallback(): void;
93
+ disconnectedCallback(): void;
93
94
  updated(changed: Map<string, unknown>): void;
94
95
  private autoFetch;
96
+ private unobserveImpression;
97
+ private impressed;
98
+ private listTracked;
99
+ private observeForAnalytics;
100
+ /** view_item_list needs BOTH the viewport dwell and loaded products —
101
+ * whichever lands last fires it (once). */
102
+ private maybeTrackList;
95
103
  private parseRefs;
96
104
  private scrollByDirection;
97
105
  private renderScrollerContent;
@@ -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-DjVcB-RL.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-TIH4RkPl.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-D6IA4ZWL.js';
2
- export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-D6IA4ZWL.js';
3
- import '../chunk-KMIARP6X.js';
1
+ import { registerVioElements } from '../chunk-LRXVUOEG.js';
2
+ export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-LRXVUOEG.js';
3
+ import '../chunk-7Q4MJ5NQ.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.4.2",
3
+ "version": "0.5.1",
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",