@vio-live/web-sdk 0.7.0 → 0.9.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/dist/{chunk-GPMDZSC2.js → chunk-OTL6QM3G.js} +168 -17
- package/dist/chunk-OTL6QM3G.js.map +1 -0
- package/dist/{chunk-4ZEN4J7I.js → chunk-SNIF67UB.js} +99 -3
- package/dist/chunk-SNIF67UB.js.map +1 -0
- package/dist/core/index.d.ts +50 -2
- package/dist/core/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +3 -3
- package/dist/{tokens-CCZuuTN6.d.ts → tokens-CrO2ciCS.d.ts} +35 -4
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +3 -3
- package/package.json +2 -2
- package/dist/chunk-4ZEN4J7I.js.map +0 -1
- package/dist/chunk-GPMDZSC2.js.map +0 -1
package/dist/core/index.d.ts
CHANGED
|
@@ -802,6 +802,45 @@ interface QliroOrder {
|
|
|
802
802
|
total_price?: number;
|
|
803
803
|
}
|
|
804
804
|
|
|
805
|
+
/**
|
|
806
|
+
* Walley (former Collector) — embedded checkout via Vio Commerce.
|
|
807
|
+
*
|
|
808
|
+
* Third embedded provider, same category as Kustom/Qliro: the widget
|
|
809
|
+
* collects address, shipping AND payment by itself.
|
|
810
|
+
*
|
|
811
|
+
* 1. `Payment { CreatePaymentWalley }` initializes the session (sponsor-key
|
|
812
|
+
* authed; the seller's own Walley credentials live server-side, per
|
|
813
|
+
* seller, never here) and returns a SYNTHESIZED html_snippet — Walley's
|
|
814
|
+
* real embed is a `<script data-token>` loader, so shopcart wraps it
|
|
815
|
+
* in the same shape Kustom/Qliro use, and this module reuses their
|
|
816
|
+
* exact script-executing injection.
|
|
817
|
+
* 2. Walley's own script renders the iframe. On completion it dispatches
|
|
818
|
+
* the DOM event `walleyCheckoutPurchaseCompleted` — the PRIMARY success
|
|
819
|
+
* signal, no page reload needed. `redirectPageUri` is registered too
|
|
820
|
+
* (`?checkout_id=…&payment_processor=WALLEY`, same contract as
|
|
821
|
+
* Kustom/Qliro) as a safety net in case the event is missed (tab
|
|
822
|
+
* backgrounded, page reload).
|
|
823
|
+
* 3. Either path re-reads the session (`Payment { GetWalleyOrder }`) BY
|
|
824
|
+
* OWNING CHECKOUT — same as Qliro — and re-renders Walley's own
|
|
825
|
+
* receipt.
|
|
826
|
+
*
|
|
827
|
+
* The Commerce order itself is created server-side by Walley's notification
|
|
828
|
+
* webhook (shopcart /checkout/payment/walley/ok) — the browser never
|
|
829
|
+
* confirms money.
|
|
830
|
+
*/
|
|
831
|
+
|
|
832
|
+
/** Normalized Walley session (shopcart maps privateId/publicToken/status). */
|
|
833
|
+
interface WalleyOrder {
|
|
834
|
+
order_id: string;
|
|
835
|
+
/** Walley status: Initialized | CustomerIdentified | CommittedToPurchase | PurchaseCompleted | Aborted. */
|
|
836
|
+
status: string;
|
|
837
|
+
html_snippet: string;
|
|
838
|
+
public_token?: string;
|
|
839
|
+
purchase_country?: string;
|
|
840
|
+
purchase_currency?: string;
|
|
841
|
+
total_price?: number;
|
|
842
|
+
}
|
|
843
|
+
|
|
805
844
|
/**
|
|
806
845
|
* Checkout types — multi-sponsor compatible.
|
|
807
846
|
*
|
|
@@ -809,7 +848,7 @@ interface QliroOrder {
|
|
|
809
848
|
* merchant, same as iOS multi-sponsor model). Multiple sponsors → multiple
|
|
810
849
|
* sequential checkouts.
|
|
811
850
|
*/
|
|
812
|
-
type PaymentMethod = 'apple-pay' | 'klarna' | 'vipps' | 'card' | 'stripe' | 'kustom' | 'qliro';
|
|
851
|
+
type PaymentMethod = 'apple-pay' | 'klarna' | 'vipps' | 'card' | 'stripe' | 'kustom' | 'qliro' | 'walley';
|
|
813
852
|
interface CheckoutAddress {
|
|
814
853
|
firstName: string;
|
|
815
854
|
lastName: string;
|
|
@@ -988,6 +1027,15 @@ declare class CheckoutManager extends EventTarget {
|
|
|
988
1027
|
mountQliroCheckout(container: HTMLElement, sponsorId?: number): Promise<QliroOrder>;
|
|
989
1028
|
/** Re-read the Qliro order owned by a checkout — the confirmation trip. */
|
|
990
1029
|
getQliroOrder(checkoutId: string, sponsorId?: number): Promise<QliroOrder | null>;
|
|
1030
|
+
/**
|
|
1031
|
+
* Mount the Walley embedded checkout. `onPurchaseCompleted` fires as soon
|
|
1032
|
+
* as Walley's own script dispatches its success event INSIDE the widget —
|
|
1033
|
+
* no redirect needed. `getWalleyOrder`/the confirmation-URL fallback
|
|
1034
|
+
* remain for the case the event is missed (tab backgrounded, reload).
|
|
1035
|
+
*/
|
|
1036
|
+
mountWalleyCheckout(container: HTMLElement, sponsorId?: number, onPurchaseCompleted?: (order: WalleyOrder) => void): Promise<WalleyOrder>;
|
|
1037
|
+
/** Re-read the Walley session owned by a checkout — the confirmation trip. */
|
|
1038
|
+
getWalleyOrder(checkoutId: string, sponsorId?: number): Promise<WalleyOrder | null>;
|
|
991
1039
|
setAddress(address: CheckoutAddress): void;
|
|
992
1040
|
selectPaymentMethod(method: PaymentMethod): void;
|
|
993
1041
|
/**
|
|
@@ -1336,6 +1384,6 @@ declare const Vio: VioFacade;
|
|
|
1336
1384
|
*
|
|
1337
1385
|
* RELEASE CHECKLIST: bump together with package.json (see CONTRIBUTING).
|
|
1338
1386
|
*/
|
|
1339
|
-
declare const SDK_VERSION = "0.
|
|
1387
|
+
declare const SDK_VERSION = "0.9.0";
|
|
1340
1388
|
|
|
1341
1389
|
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 };
|
package/dist/core/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
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-
|
|
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-SNIF67UB.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
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-
|
|
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-SNIF67UB.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-CrO2ciCS.js';
|
|
3
|
+
export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-CrO2ciCS.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-OTL6QM3G.js';
|
|
2
|
+
export { VioTokens, applyVioTheme } from '../chunk-OTL6QM3G.js';
|
|
3
|
+
import '../chunk-SNIF67UB.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
6
6
|
// node_modules/@lit/react/node/create-component.js
|
|
@@ -319,6 +319,8 @@ declare class VioCheckout extends LitElement {
|
|
|
319
319
|
private kustomMountedOrderId;
|
|
320
320
|
private qliroMounting;
|
|
321
321
|
private qliroMountedOrderId;
|
|
322
|
+
private walleyMounting;
|
|
323
|
+
private walleyMountedOrderId;
|
|
322
324
|
/** Redirecting to the Stripe / Vipps hosted page. */
|
|
323
325
|
private stripeLoading;
|
|
324
326
|
private vippsLoading;
|
|
@@ -434,6 +436,15 @@ declare class VioCheckout extends LitElement {
|
|
|
434
436
|
private mountQliroIfNeeded;
|
|
435
437
|
private unmountQliro;
|
|
436
438
|
private renderQliroPanel;
|
|
439
|
+
/**
|
|
440
|
+
* Mount the Walley embedded checkout once it's the chosen method. Unlike
|
|
441
|
+
* Kustom/Qliro, success is signalled INLINE by Walley's own DOM event
|
|
442
|
+
* (`walleyCheckoutPurchaseCompleted`) — no redirect round-trip needed, so
|
|
443
|
+
* we handle it here instead of only in the confirmation-return branch.
|
|
444
|
+
*/
|
|
445
|
+
private mountWalleyIfNeeded;
|
|
446
|
+
private unmountWalley;
|
|
447
|
+
private renderWalleyPanel;
|
|
437
448
|
private renderKlarnaPanel;
|
|
438
449
|
/** Express layout — only the Klarna widget + a compact order summary. */
|
|
439
450
|
private renderKlarnaExpress;
|
|
@@ -521,6 +532,8 @@ declare const VioTokens: {
|
|
|
521
532
|
readonly sm: "2px";
|
|
522
533
|
readonly md: "4px";
|
|
523
534
|
readonly lg: "8px";
|
|
535
|
+
/** Sheet/drawer corners — the largest surface radius in the checkout. */
|
|
536
|
+
readonly xl: "16px";
|
|
524
537
|
readonly full: "9999px";
|
|
525
538
|
};
|
|
526
539
|
};
|
|
@@ -535,10 +548,16 @@ declare const VioTokens: {
|
|
|
535
548
|
* `injectTokens` installs above, regardless of import/injection order — no
|
|
536
549
|
* specificity fights, no reaching for `!important`.
|
|
537
550
|
*
|
|
538
|
-
* A curated subset on purpose
|
|
539
|
-
* actually
|
|
540
|
-
*
|
|
541
|
-
*
|
|
551
|
+
* A curated subset on purpose — colors, fonts, corner radius and the spacing
|
|
552
|
+
* steps the checkout actually uses. Radius and spacing were added once the
|
|
553
|
+
* need was real (brand panels in Vev/Replit): corner shape is the strongest
|
|
554
|
+
* identity lever after colour, and the spacing steps drive comfortable-vs-
|
|
555
|
+
* compact density. The rest of the token set (sizes, tracking, line heights)
|
|
556
|
+
* stays internal — don't speculatively surface it as public API.
|
|
557
|
+
*
|
|
558
|
+
* Panels are expected to present these as a few opinionated choices (e.g.
|
|
559
|
+
* "Sharp / Default / Rounded") rather than four raw pixel inputs; the API
|
|
560
|
+
* stays per-token so a panel can compose whatever presets it wants.
|
|
542
561
|
*
|
|
543
562
|
* Host integrations (the Vio Config panel in Vev, a future Replit CMS
|
|
544
563
|
* panel, anything else) should call this ONE function — never set
|
|
@@ -558,6 +577,18 @@ interface VioThemeOverrides {
|
|
|
558
577
|
colorBorderDefault?: string;
|
|
559
578
|
fontSerif?: string;
|
|
560
579
|
fontSans?: string;
|
|
580
|
+
/** Corner radius. `sm` = drag handles, `lg` = controls (chips, notices,
|
|
581
|
+
* shipping options), `xl` = the sheet/drawer itself. Set all three to `0`
|
|
582
|
+
* for a square look, or raise `xl` for a softer one. */
|
|
583
|
+
radiusSm?: string;
|
|
584
|
+
radiusMd?: string;
|
|
585
|
+
radiusLg?: string;
|
|
586
|
+
radiusXl?: string;
|
|
587
|
+
/** Spacing steps — drive checkout density (compact vs comfortable). */
|
|
588
|
+
spaceSm?: string;
|
|
589
|
+
spaceMd?: string;
|
|
590
|
+
spaceLg?: string;
|
|
591
|
+
spaceXl?: string;
|
|
561
592
|
}
|
|
562
593
|
/**
|
|
563
594
|
* 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-CrO2ciCS.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-OTL6QM3G.js';
|
|
2
|
+
export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-OTL6QM3G.js';
|
|
3
|
+
import '../chunk-SNIF67UB.js';
|
|
4
4
|
|
|
5
5
|
// src/ui/index.ts
|
|
6
6
|
registerVioElements();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vio-live/web-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Vio Web SDK
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "Vio Web SDK \u2014 in-site shoppable + native checkout, designed for editorial commerce sites",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|