@vio-live/web-sdk 0.35.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +99 -0
- package/dist/chunk-6HBX7GBJ.js +3 -0
- package/dist/{chunk-3YFJFDSN.js.map → chunk-6HBX7GBJ.js.map} +1 -1
- package/dist/{chunk-QA5R4VYF.js → chunk-KVI56NGO.js} +156 -13
- package/dist/chunk-KVI56NGO.js.map +1 -0
- package/dist/{chunk-F7LE5AZY.js → chunk-LDA7RI43.js} +371 -98
- package/dist/chunk-LDA7RI43.js.map +1 -0
- package/dist/core/index.d.ts +122 -5
- package/dist/core/index.js +2 -2
- package/dist/{detail-layout-BI556w8p.d.ts → detail-layout-BfR20W_X.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/react/index.d.ts +7 -3
- package/dist/react/index.js +11 -7
- package/dist/react/index.js.map +1 -1
- package/dist/{tokens-C-LsqKQH.d.ts → tokens-ChbmD8wb.d.ts} +50 -3
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-3YFJFDSN.js +0 -3
- package/dist/chunk-F7LE5AZY.js.map +0 -1
- package/dist/chunk-QA5R4VYF.js.map +0 -1
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DetailLayout, A as AppliedDetailLayout } from '../detail-layout-
|
|
2
|
-
export {
|
|
1
|
+
import { a as DetailLayoutOrigin, D as DetailLayout, A as AppliedDetailLayout } from '../detail-layout-BfR20W_X.js';
|
|
2
|
+
export { b as DETAIL_SECTION_IDS, c as DetailLayoutAdjustment, d as DetailSectionId, E as ESSENTIAL_DETAIL_SECTIONS, e as defaultDetailLayout, f as effectiveDetailSections, n as normalizeDetailLayout, r as resolveDetailLayout } from '../detail-layout-BfR20W_X.js';
|
|
3
3
|
import { GraphQLClient } from 'graphql-request';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -965,6 +965,87 @@ declare function autoSlotDisplayName(kind: SlotKind, ordinal: number, scopeName?
|
|
|
965
965
|
/** A scope value fit for an id: trimmed, inner whitespace → `-`. */
|
|
966
966
|
declare function normalizeScope(scope: string | null | undefined): string;
|
|
967
967
|
|
|
968
|
+
/**
|
|
969
|
+
* Button tracking (`cta_click`): which buttons shoppers use.
|
|
970
|
+
*
|
|
971
|
+
* One event per tap on a button of the SDK's elements (they dispatch
|
|
972
|
+
* `vio:cta-click`, which `Vio.analytics` turns into `cta_click` once started)
|
|
973
|
+
* or of a host's own UI (`Vio.trackCta()`). The wire contract is shared with
|
|
974
|
+
* the collector — everything rides in `context`:
|
|
975
|
+
*
|
|
976
|
+
* | field | what |
|
|
977
|
+
* |----------------------|-------------------------------------------------------------------|
|
|
978
|
+
* | `cta` | the button's id, `[a-z0-9_.:-]{1,64}` (README lists them) |
|
|
979
|
+
* | `cta_location` | `detail` · `cart` · `card` · `checkout` · `host` · `block` |
|
|
980
|
+
* | `cta_label` | the visible text of the button, trimmed, ≤ 64 |
|
|
981
|
+
* | `cta_variant` | the host's name of the button option it tests, `[A-Za-z0-9._:-]{1,64}` |
|
|
982
|
+
* | `option_value` | the option value chosen (`size`), ≤ 64 |
|
|
983
|
+
* | `product_id` | the product, as a string |
|
|
984
|
+
* | `product_variant_id` | the PRODUCT variant (on `cta_click`, `variant_id` is the layout's EXPERIMENT variant, as on `view_item`) |
|
|
985
|
+
* | `layout_id` · `layout_revision` · `experiment_id` · `variant_id` | the detail's layout, only a non-default one |
|
|
986
|
+
*
|
|
987
|
+
* …plus `sponsor_id`, `campaign_id`, `location_id` (the slot), `content_*`
|
|
988
|
+
* and `component_template_id` as every other event carries them.
|
|
989
|
+
*
|
|
990
|
+
* Pure module: no DOM, no side effects.
|
|
991
|
+
*/
|
|
992
|
+
|
|
993
|
+
/** Where the button is: the SDK's elements, a host's own UI, a host's article block. */
|
|
994
|
+
declare const CTA_LOCATIONS: readonly ["detail", "cart", "card", "checkout", "host", "block"];
|
|
995
|
+
type CtaLocation = (typeof CTA_LOCATIONS)[number];
|
|
996
|
+
/** A button id: lower case, digits and `_ . : -`, 1–64 chars. */
|
|
997
|
+
declare const CTA_ID_PATTERN: RegExp;
|
|
998
|
+
/** A host's button option (`cta_variant`): letters, digits and `. _ : -`, 1–64 chars. */
|
|
999
|
+
declare const CTA_VARIANT_PATTERN: RegExp;
|
|
1000
|
+
/** The cap of `cta_label` and `option_value`. */
|
|
1001
|
+
declare const CTA_TEXT_MAX_LENGTH = 64;
|
|
1002
|
+
/**
|
|
1003
|
+
* A button tap, as `Vio.trackCta()` takes it and as the SDK's elements put it
|
|
1004
|
+
* in the `detail` of `vio:cta-click`.
|
|
1005
|
+
*/
|
|
1006
|
+
interface CtaInput {
|
|
1007
|
+
/** The button's id (`add_to_cart`, `vipps`, `size`…). Invalid → the call is ignored (one `console.warn`). */
|
|
1008
|
+
cta: string;
|
|
1009
|
+
/** Where the button is. Default `host`. */
|
|
1010
|
+
location?: CtaLocation | string;
|
|
1011
|
+
/** The visible text of the button (`Legg i handlekurv`). Trimmed, cut to 64. */
|
|
1012
|
+
label?: string;
|
|
1013
|
+
/** The host's name of the button option it is testing (`bar-kjop`). Invalid → left out. */
|
|
1014
|
+
variant?: string;
|
|
1015
|
+
/** The option value chosen (`M`, `42`) — for `size`. */
|
|
1016
|
+
optionValue?: string;
|
|
1017
|
+
productId?: number | string;
|
|
1018
|
+
/** The PRODUCT variant (`product_variant_id` on the wire). */
|
|
1019
|
+
productVariantId?: number | string;
|
|
1020
|
+
sponsorId?: number | string;
|
|
1021
|
+
campaignId?: number | string;
|
|
1022
|
+
slot?: string;
|
|
1023
|
+
contentId?: string | number;
|
|
1024
|
+
contentTitle?: string;
|
|
1025
|
+
componentTemplateId?: string;
|
|
1026
|
+
/** The `<vio-product-detail>` layout shown, when the button is in one (`{ layoutId, layoutRevision, experimentId, variantId }`). */
|
|
1027
|
+
layout?: DetailLayoutOrigin | null;
|
|
1028
|
+
}
|
|
1029
|
+
/** What `vio:cta-click` carries: a `CtaInput` whose `location` is always said. */
|
|
1030
|
+
interface CtaClickDetail extends CtaInput {
|
|
1031
|
+
location: CtaLocation;
|
|
1032
|
+
}
|
|
1033
|
+
/** A valid button id? */
|
|
1034
|
+
declare function isCtaId(value: unknown): value is string;
|
|
1035
|
+
/**
|
|
1036
|
+
* Visible text as the wire takes it: control characters out, whitespace
|
|
1037
|
+
* collapsed, trimmed, cut to `max` (UTF-16 units, never inside a surrogate
|
|
1038
|
+
* pair). `undefined` when nothing is left.
|
|
1039
|
+
*/
|
|
1040
|
+
declare function ctaText(value: unknown, max?: number): string | undefined;
|
|
1041
|
+
/**
|
|
1042
|
+
* The `context` of a `cta_click`, or `null` when the button id is invalid
|
|
1043
|
+
* (warned once for the call). An unknown `location` becomes `host` and an
|
|
1044
|
+
* invalid `variant` is left out, each with a warning; everything else that
|
|
1045
|
+
* does not fit is left out quietly.
|
|
1046
|
+
*/
|
|
1047
|
+
declare function ctaContextOf(input: CtaInput | null | undefined): AnalyticsContext | null;
|
|
1048
|
+
|
|
968
1049
|
/**
|
|
969
1050
|
* Who sells — the sponsor's (brand's) display identity: its name and logo.
|
|
970
1051
|
*
|
|
@@ -1053,7 +1134,7 @@ declare function sponsorIdentityFrom(boot: BootstrapResponse | null | undefined,
|
|
|
1053
1134
|
* 3. `vio:analytics` DOM event — always when started (inspector/bridges)
|
|
1054
1135
|
*/
|
|
1055
1136
|
|
|
1056
|
-
declare const ANALYTICS_EVENT_NAMES: readonly ["view_item_list", "select_item", "view_item", "add_to_cart", "remove_from_cart", "view_cart", "begin_checkout", "add_payment_info", "purchase", "component_impression", "component_click", "ad_impression", "ad_click", "poll_impression", "contest_impression", "session_start", "session_end", "checkout_error", "sdk_error"];
|
|
1137
|
+
declare const ANALYTICS_EVENT_NAMES: readonly ["view_item_list", "select_item", "view_item", "add_to_cart", "remove_from_cart", "view_cart", "begin_checkout", "add_payment_info", "purchase", "component_impression", "component_click", "ad_impression", "ad_click", "poll_impression", "contest_impression", "cta_click", "session_start", "session_end", "checkout_error", "sdk_error"];
|
|
1057
1138
|
type AnalyticsEventName = (typeof ANALYTICS_EVENT_NAMES)[number];
|
|
1058
1139
|
/** Camel-case for DX; mapped to the snake_case wire format at build time. */
|
|
1059
1140
|
interface AnalyticsContext {
|
|
@@ -1088,6 +1169,21 @@ interface AnalyticsContext {
|
|
|
1088
1169
|
/** Código corto del fallo (`sdk_error` / `checkout_error`). */
|
|
1089
1170
|
errorCode?: string;
|
|
1090
1171
|
variant?: string;
|
|
1172
|
+
/**
|
|
1173
|
+
* `cta_click` only (see ./cta.ts): the button's id (`cta`), where it is
|
|
1174
|
+
* (`cta_location`), its visible text (`cta_label`), the host's name of the
|
|
1175
|
+
* button option it tests (`cta_variant`), the option value chosen
|
|
1176
|
+
* (`option_value`), the product (`product_id`) and the PRODUCT variant
|
|
1177
|
+
* (`product_variant_id` — `variantId` above is the layout's experiment
|
|
1178
|
+
* variant). Build them with `ctaContextOf()`, which validates them.
|
|
1179
|
+
*/
|
|
1180
|
+
cta?: string;
|
|
1181
|
+
ctaLocation?: string;
|
|
1182
|
+
ctaLabel?: string;
|
|
1183
|
+
ctaVariant?: string;
|
|
1184
|
+
optionValue?: string;
|
|
1185
|
+
productId?: string;
|
|
1186
|
+
productVariantId?: string;
|
|
1091
1187
|
/**
|
|
1092
1188
|
* The slot (ADR-0027) the component sits in — its `vio-slot`. Attribution
|
|
1093
1189
|
* follows it: the event's `campaign_id` is the campaign assigned to the slot
|
|
@@ -1276,6 +1372,15 @@ declare class AnalyticsManager extends EventTarget {
|
|
|
1276
1372
|
track(name: AnalyticsEventName, opts?: TrackOptions): void;
|
|
1277
1373
|
/** The sinks and the queue for one built event — `track`'s second half. */
|
|
1278
1374
|
private record;
|
|
1375
|
+
/**
|
|
1376
|
+
* One `cta_click` — a tap on a button (README «Button tracking»). What
|
|
1377
|
+
* `Vio.trackCta()` calls for a host's own buttons; the SDK's elements reach
|
|
1378
|
+
* it through `vio:cta-click`. Only once `start()` ran — like the funnel
|
|
1379
|
+
* events of the elements, never queued before. An invalid `cta` is ignored
|
|
1380
|
+
* with one `console.warn`; consent, `privateContent`, internal traffic,
|
|
1381
|
+
* batching and attribution are those of every event.
|
|
1382
|
+
*/
|
|
1383
|
+
trackCta(input: CtaInput): void;
|
|
1279
1384
|
/**
|
|
1280
1385
|
* Impression helper: observes an element and tracks ONE
|
|
1281
1386
|
* `component_impression` per (session, campaignComponentId) when the
|
|
@@ -3513,6 +3618,7 @@ declare class VioFacade {
|
|
|
3513
3618
|
*/
|
|
3514
3619
|
configureDetail(options?: {
|
|
3515
3620
|
layout?: DetailLayout | null;
|
|
3621
|
+
descriptionLabel?: string | null;
|
|
3516
3622
|
}): void;
|
|
3517
3623
|
/**
|
|
3518
3624
|
* The layout a `<vio-product-detail>` without its own `layout` applies now:
|
|
@@ -3520,6 +3626,17 @@ declare class VioFacade {
|
|
|
3520
3626
|
* `el.appliedLayout`. A copy; never throws.
|
|
3521
3627
|
*/
|
|
3522
3628
|
detailLayout(): AppliedDetailLayout;
|
|
3629
|
+
/**
|
|
3630
|
+
* Report a tap on one of the host's own buttons (its cards, its article
|
|
3631
|
+
* blocks) as `cta_click`, the event the SDK's own buttons send — so the
|
|
3632
|
+
* dashboard compares them on one scale. `{ cta, location?, label?,
|
|
3633
|
+
* variant?, optionValue?, productId?, productVariantId?, sponsorId?,
|
|
3634
|
+
* campaignId?, slot?, contentId?, layout? }`; `location` is `host` by
|
|
3635
|
+
* default (`card` / `block` for the host's cards and article blocks). An
|
|
3636
|
+
* invalid `cta` is ignored with one `console.warn`. Nothing is sent before
|
|
3637
|
+
* `Vio.analytics.start()`. Never throws. See README «Button tracking».
|
|
3638
|
+
*/
|
|
3639
|
+
trackCta(input: CtaInput): void;
|
|
3523
3640
|
get isInitialized(): boolean;
|
|
3524
3641
|
get config(): ResolvedConfig;
|
|
3525
3642
|
/** Multi-sponsor cart manager. Reactive — listen via addEventListener('change', ...). */
|
|
@@ -3838,7 +3955,7 @@ declare function writeInternal(internal: boolean, storage?: StorageLike | null |
|
|
|
3838
3955
|
*
|
|
3839
3956
|
* RELEASE CHECKLIST: bump together with package.json (see CONTRIBUTING).
|
|
3840
3957
|
*/
|
|
3841
|
-
declare const SDK_VERSION = "0.
|
|
3958
|
+
declare const SDK_VERSION = "0.37.0";
|
|
3842
3959
|
|
|
3843
3960
|
/**
|
|
3844
3961
|
* Vipps MobilePay's own button, the way the design guidelines ask for it.
|
|
@@ -3867,4 +3984,4 @@ declare function vippsButtonAttributes(verb?: 'buy' | 'pay' | 'express' | 'conti
|
|
|
3867
3984
|
language?: string;
|
|
3868
3985
|
}): Record<string, string>;
|
|
3869
3986
|
|
|
3870
|
-
export { ADD_ITEM_MUTATION, type AddManualOptions, type AddProductOptions, type AnalyticsCommerce, type AnalyticsContext, type AnalyticsEventName, type AnalyticsItemInput, AnalyticsManager, type AnalyticsStartOptions, type ApplePayConfig, type ApplePayResult, AppliedDetailLayout, type Attribution, BUYER_REF_MAX_LENGTH, type BootstrapCampaign, type BootstrapCampaignEntry, type BootstrapCampaignStatus, type BootstrapResponse, type BootstrapSlot, CHECKOUT_ATTRIBUTION_CAPS, CHECKOUT_SPONSOR_STORAGE_KEY, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, type CampaignHint, type CartChangeDetail, type CartLineItem, type CartLineOrigin, CartManager, type CartOrigin, type CartQueryOptions, type CartSlice, type CartUpdatedDetail, type CheckoutAddress, type CheckoutAttributionInput, type CheckoutAttributionWire, type CheckoutChangeDetail, CheckoutManager, type CheckoutManagerDeps, type CheckoutOpenDetail, type CheckoutReference, type CheckoutSponsor, type CheckoutState, type ClientContext, CommerceClient, Configuration, type ContentRef, type CreatePaymentVippsResponse, type CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, DetailLayout, type EntryContextWire, type Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, type GatewayFeature, type GetVippsStatusVariables, INTERNAL_KEY, INTERNAL_PARAM, type ImageSize, LINE_ORIGIN_CAPS, type Landing, type LineOriginWire, type LineOriginWireOptions, type ManifestLocation, type ManifestRequest, type ManifestResult, type OrderReference, type OriginPage, 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 PurchaseIds, type RegisterSlotOptions, type ResolvedConfig, SDK_VERSION, type SlotInput, type SlotKind, type Sponsor, type SponsorCartState, type SponsorCommerceBlock, type SponsorIdentity, type SurfacePrivacyMode, type SurfaceResponse, type TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, type VioConfig, type VioItem, type VioPlatform, type VippsPaymentState, type VippsStatusResult, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, dominantCampaignOf, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, purchaseIdsOf, readInternal, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveInternal, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, sponsorIdentityFrom, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature, writeInternal };
|
|
3987
|
+
export { ADD_ITEM_MUTATION, type AddManualOptions, type AddProductOptions, type AnalyticsCommerce, type AnalyticsContext, type AnalyticsEventName, type AnalyticsItemInput, AnalyticsManager, type AnalyticsStartOptions, type ApplePayConfig, type ApplePayResult, AppliedDetailLayout, type Attribution, BUYER_REF_MAX_LENGTH, type BootstrapCampaign, type BootstrapCampaignEntry, type BootstrapCampaignStatus, type BootstrapResponse, type BootstrapSlot, CHECKOUT_ATTRIBUTION_CAPS, CHECKOUT_SPONSOR_STORAGE_KEY, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CTA_ID_PATTERN, CTA_LOCATIONS, CTA_TEXT_MAX_LENGTH, CTA_VARIANT_PATTERN, type CampaignHint, type CartChangeDetail, type CartLineItem, type CartLineOrigin, CartManager, type CartOrigin, type CartQueryOptions, type CartSlice, type CartUpdatedDetail, type CheckoutAddress, type CheckoutAttributionInput, type CheckoutAttributionWire, type CheckoutChangeDetail, CheckoutManager, type CheckoutManagerDeps, type CheckoutOpenDetail, type CheckoutReference, type CheckoutSponsor, type CheckoutState, type ClientContext, CommerceClient, Configuration, type ContentRef, type CreatePaymentVippsResponse, type CreatePaymentVippsVariables, type CtaClickDetail, type CtaInput, type CtaLocation, DELETE_ITEM_MUTATION, DetailLayout, DetailLayoutOrigin, type EntryContextWire, type Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, type GatewayFeature, type GetVippsStatusVariables, INTERNAL_KEY, INTERNAL_PARAM, type ImageSize, LINE_ORIGIN_CAPS, type Landing, type LineOriginWire, type LineOriginWireOptions, type ManifestLocation, type ManifestRequest, type ManifestResult, type OrderReference, type OriginPage, 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 PurchaseIds, type RegisterSlotOptions, type ResolvedConfig, SDK_VERSION, type SlotInput, type SlotKind, type Sponsor, type SponsorCartState, type SponsorCommerceBlock, type SponsorIdentity, type SurfacePrivacyMode, type SurfaceResponse, type TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, type VioConfig, type VioItem, type VioPlatform, type VippsPaymentState, type VippsStatusResult, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, ctaContextOf, ctaText, deleteItem, displayPrice, dominantCampaignOf, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isCtaId, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, purchaseIdsOf, readInternal, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveInternal, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, sponsorIdentityFrom, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature, writeInternal };
|
package/dist/core/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../chunk-
|
|
2
|
-
export { ADD_ITEM_MUTATION, AnalyticsManager, BUYER_REF_MAX_LENGTH, CHECKOUT_ATTRIBUTION_CAPS, CHECKOUT_SPONSOR_STORAGE_KEY, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, DETAIL_SECTION_IDS, ESSENTIAL_DETAIL_SECTIONS, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, INTERNAL_KEY, INTERNAL_PARAM, LINE_ORIGIN_CAPS, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, defaultDetailLayout, deleteItem, displayPrice, dominantCampaignOf, effectiveDetailSections, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeDetailLayout, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, purchaseIdsOf, readInternal, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveDetailLayout, resolveInternal, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, sponsorIdentityFrom, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature, writeInternal } from '../chunk-
|
|
1
|
+
import '../chunk-6HBX7GBJ.js';
|
|
2
|
+
export { ADD_ITEM_MUTATION, AnalyticsManager, BUYER_REF_MAX_LENGTH, CHECKOUT_ATTRIBUTION_CAPS, CHECKOUT_SPONSOR_STORAGE_KEY, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CTA_ID_PATTERN, CTA_LOCATIONS, CTA_TEXT_MAX_LENGTH, CTA_VARIANT_PATTERN, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, DETAIL_SECTION_IDS, ESSENTIAL_DETAIL_SECTIONS, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, INTERNAL_KEY, INTERNAL_PARAM, LINE_ORIGIN_CAPS, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, ctaContextOf, ctaText, defaultDetailLayout, deleteItem, displayPrice, dominantCampaignOf, effectiveDetailSections, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isCtaId, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeDetailLayout, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, purchaseIdsOf, readInternal, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveDetailLayout, resolveInternal, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, sponsorIdentityFrom, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature, writeInternal } from '../chunk-KVI56NGO.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -73,4 +73,4 @@ declare function effectiveDetailSections(requested: ReadonlyArray<string>): {
|
|
|
73
73
|
*/
|
|
74
74
|
declare function resolveDetailLayout(elementLayout: unknown, globalLayout?: unknown): AppliedDetailLayout;
|
|
75
75
|
|
|
76
|
-
export { type AppliedDetailLayout as A, type DetailLayout as D, ESSENTIAL_DETAIL_SECTIONS as E,
|
|
76
|
+
export { type AppliedDetailLayout as A, type DetailLayout as D, ESSENTIAL_DETAIL_SECTIONS as E, type DetailLayoutOrigin as a, DETAIL_SECTION_IDS as b, type DetailLayoutAdjustment as c, type DetailSectionId as d, defaultDetailLayout as e, effectiveDetailSections as f, normalizeDetailLayout as n, resolveDetailLayout as r };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ADD_ITEM_MUTATION, AddManualOptions, AddProductOptions, AnalyticsCommerce, AnalyticsContext, AnalyticsEventName, AnalyticsItemInput, AnalyticsManager, AnalyticsStartOptions, ApplePayConfig, ApplePayResult, Attribution, BUYER_REF_MAX_LENGTH, BootstrapCampaign, BootstrapCampaignEntry, BootstrapCampaignStatus, BootstrapResponse, BootstrapSlot, CHECKOUT_ATTRIBUTION_CAPS, CHECKOUT_SPONSOR_STORAGE_KEY, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CampaignHint, CartChangeDetail, CartLineItem, CartLineOrigin, CartManager, CartOrigin, CartQueryOptions, CartSlice, CartUpdatedDetail, CheckoutAddress, CheckoutAttributionInput, CheckoutAttributionWire, CheckoutChangeDetail, CheckoutManager, CheckoutManagerDeps, CheckoutOpenDetail, CheckoutReference, CheckoutSponsor, CheckoutState, ClientContext, CommerceClient, Configuration, ContentRef, CreatePaymentVippsResponse, CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, EntryContextWire, Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, GatewayFeature, GetVippsStatusVariables, INTERNAL_KEY, INTERNAL_PARAM, ImageSize, LINE_ORIGIN_CAPS, Landing, LineOriginWire, LineOriginWireOptions, ManifestLocation, ManifestRequest, ManifestResult, OrderReference, OriginPage, PaymentCompleteDetail, PaymentMethod, PaymentSelectDetail, PaymentSuccessDetail, PaymentSuccessResult, PlacementComponent, Product, ProductCategory, ProductImage, ProductOption, ProductPrice, ProductVariant, PurchaseIds, RegisterSlotOptions, ResolvedConfig, SDK_VERSION, SlotInput, SlotKind, Sponsor, SponsorCartState, SponsorCommerceBlock, SponsorIdentity, SurfacePrivacyMode, SurfaceResponse, TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, VioConfig, VioItem, VioPlatform, VippsPaymentState, VippsStatusResult, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, dominantCampaignOf, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, purchaseIdsOf, readInternal, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveInternal, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, sponsorIdentityFrom, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature, writeInternal } from './core/index.js';
|
|
2
|
-
export { A as AppliedDetailLayout,
|
|
1
|
+
export { ADD_ITEM_MUTATION, AddManualOptions, AddProductOptions, AnalyticsCommerce, AnalyticsContext, AnalyticsEventName, AnalyticsItemInput, AnalyticsManager, AnalyticsStartOptions, ApplePayConfig, ApplePayResult, Attribution, BUYER_REF_MAX_LENGTH, BootstrapCampaign, BootstrapCampaignEntry, BootstrapCampaignStatus, BootstrapResponse, BootstrapSlot, CHECKOUT_ATTRIBUTION_CAPS, CHECKOUT_SPONSOR_STORAGE_KEY, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CTA_ID_PATTERN, CTA_LOCATIONS, CTA_TEXT_MAX_LENGTH, CTA_VARIANT_PATTERN, CampaignHint, CartChangeDetail, CartLineItem, CartLineOrigin, CartManager, CartOrigin, CartQueryOptions, CartSlice, CartUpdatedDetail, CheckoutAddress, CheckoutAttributionInput, CheckoutAttributionWire, CheckoutChangeDetail, CheckoutManager, CheckoutManagerDeps, CheckoutOpenDetail, CheckoutReference, CheckoutSponsor, CheckoutState, ClientContext, CommerceClient, Configuration, ContentRef, CreatePaymentVippsResponse, CreatePaymentVippsVariables, CtaClickDetail, CtaInput, CtaLocation, DELETE_ITEM_MUTATION, EntryContextWire, Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, GatewayFeature, GetVippsStatusVariables, INTERNAL_KEY, INTERNAL_PARAM, ImageSize, LINE_ORIGIN_CAPS, Landing, LineOriginWire, LineOriginWireOptions, ManifestLocation, ManifestRequest, ManifestResult, OrderReference, OriginPage, PaymentCompleteDetail, PaymentMethod, PaymentSelectDetail, PaymentSuccessDetail, PaymentSuccessResult, PlacementComponent, Product, ProductCategory, ProductImage, ProductOption, ProductPrice, ProductVariant, PurchaseIds, RegisterSlotOptions, ResolvedConfig, SDK_VERSION, SlotInput, SlotKind, Sponsor, SponsorCartState, SponsorCommerceBlock, SponsorIdentity, SurfacePrivacyMode, SurfaceResponse, TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, VioConfig, VioItem, VioPlatform, VippsPaymentState, VippsStatusResult, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, ctaContextOf, ctaText, deleteItem, displayPrice, dominantCampaignOf, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isCtaId, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, purchaseIdsOf, readInternal, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveInternal, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, sponsorIdentityFrom, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature, writeInternal } from './core/index.js';
|
|
2
|
+
export { A as AppliedDetailLayout, b as DETAIL_SECTION_IDS, D as DetailLayout, c as DetailLayoutAdjustment, a as DetailLayoutOrigin, d as DetailSectionId, E as ESSENTIAL_DETAIL_SECTIONS, e as defaultDetailLayout, f as effectiveDetailSections, n as normalizeDetailLayout, r as resolveDetailLayout } from './detail-layout-BfR20W_X.js';
|
|
3
3
|
import 'graphql-request';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './chunk-
|
|
2
|
-
export { ADD_ITEM_MUTATION, AnalyticsManager, BUYER_REF_MAX_LENGTH, CHECKOUT_ATTRIBUTION_CAPS, CHECKOUT_SPONSOR_STORAGE_KEY, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, DETAIL_SECTION_IDS, ESSENTIAL_DETAIL_SECTIONS, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, INTERNAL_KEY, INTERNAL_PARAM, LINE_ORIGIN_CAPS, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, defaultDetailLayout, deleteItem, displayPrice, dominantCampaignOf, effectiveDetailSections, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeDetailLayout, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, purchaseIdsOf, readInternal, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveDetailLayout, resolveInternal, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, sponsorIdentityFrom, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature, writeInternal } from './chunk-
|
|
1
|
+
import './chunk-6HBX7GBJ.js';
|
|
2
|
+
export { ADD_ITEM_MUTATION, AnalyticsManager, BUYER_REF_MAX_LENGTH, CHECKOUT_ATTRIBUTION_CAPS, CHECKOUT_SPONSOR_STORAGE_KEY, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CTA_ID_PATTERN, CTA_LOCATIONS, CTA_TEXT_MAX_LENGTH, CTA_VARIANT_PATTERN, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, DETAIL_SECTION_IDS, ESSENTIAL_DETAIL_SECTIONS, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, INTERNAL_KEY, INTERNAL_PARAM, LINE_ORIGIN_CAPS, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, ctaContextOf, ctaText, defaultDetailLayout, deleteItem, displayPrice, dominantCampaignOf, effectiveDetailSections, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isCtaId, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeDetailLayout, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, purchaseIdsOf, readInternal, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveDetailLayout, resolveInternal, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, sponsorIdentityFrom, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature, writeInternal } from './chunk-KVI56NGO.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
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-ChbmD8wb.js';
|
|
3
|
+
export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-ChbmD8wb.js';
|
|
4
4
|
import 'lit-html';
|
|
5
5
|
import 'lit';
|
|
6
|
-
import '../detail-layout-
|
|
6
|
+
import '../detail-layout-BfR20W_X.js';
|
|
7
7
|
|
|
8
8
|
declare const VioProduct: _lit_react.ReactWebComponent<VioProduct$1, {
|
|
9
9
|
onProductClick: string;
|
|
10
10
|
onProductAdd: string;
|
|
11
|
+
onCtaClick: string;
|
|
11
12
|
}>;
|
|
12
13
|
declare const VioProductCarousel: _lit_react.ReactWebComponent<VioProductCarousel$1, {}>;
|
|
13
14
|
declare const VioProductDetail: _lit_react.ReactWebComponent<VioProductDetail$1, {
|
|
14
15
|
onAddedToCart: string;
|
|
15
16
|
onCheckoutOpen: string;
|
|
16
17
|
onLayoutApplied: string;
|
|
18
|
+
onCtaClick: string;
|
|
17
19
|
}>;
|
|
18
20
|
declare const VioCart: _lit_react.ReactWebComponent<VioCart$1, {
|
|
19
21
|
onPaymentSuccess: string;
|
|
20
22
|
onCheckoutOpen: string;
|
|
23
|
+
onCtaClick: string;
|
|
21
24
|
}>;
|
|
22
25
|
declare const VioCheckout: _lit_react.ReactWebComponent<VioCheckout$1, {
|
|
23
26
|
onPaymentSuccess: string;
|
|
27
|
+
onCtaClick: string;
|
|
24
28
|
}>;
|
|
25
29
|
|
|
26
30
|
export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail };
|
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-LDA7RI43.js';
|
|
2
|
+
export { VioTokens, applyVioTheme } from '../chunk-LDA7RI43.js';
|
|
3
|
+
import '../chunk-KVI56NGO.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
6
6
|
// node_modules/@lit/react/node/create-component.js
|
|
@@ -25,7 +25,8 @@ var VioProduct2 = t({
|
|
|
25
25
|
elementClass: VioProduct,
|
|
26
26
|
events: {
|
|
27
27
|
onProductClick: "vio:product-click",
|
|
28
|
-
onProductAdd: "vio:product-add"
|
|
28
|
+
onProductAdd: "vio:product-add",
|
|
29
|
+
onCtaClick: "vio:cta-click"
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
32
|
var VioProductCarousel2 = t({
|
|
@@ -41,7 +42,8 @@ var VioProductDetail2 = t({
|
|
|
41
42
|
events: {
|
|
42
43
|
onAddedToCart: "vio:added-to-cart",
|
|
43
44
|
onCheckoutOpen: "vio:checkout-open",
|
|
44
|
-
onLayoutApplied: "vio:detail-layout-applied"
|
|
45
|
+
onLayoutApplied: "vio:detail-layout-applied",
|
|
46
|
+
onCtaClick: "vio:cta-click"
|
|
45
47
|
}
|
|
46
48
|
});
|
|
47
49
|
var VioCart2 = t({
|
|
@@ -50,7 +52,8 @@ var VioCart2 = t({
|
|
|
50
52
|
elementClass: VioCart,
|
|
51
53
|
events: {
|
|
52
54
|
onPaymentSuccess: "vio:payment-success",
|
|
53
|
-
onCheckoutOpen: "vio:checkout-open"
|
|
55
|
+
onCheckoutOpen: "vio:checkout-open",
|
|
56
|
+
onCtaClick: "vio:cta-click"
|
|
54
57
|
}
|
|
55
58
|
});
|
|
56
59
|
var VioCheckout2 = t({
|
|
@@ -58,7 +61,8 @@ var VioCheckout2 = t({
|
|
|
58
61
|
tagName: "vio-checkout",
|
|
59
62
|
elementClass: VioCheckout,
|
|
60
63
|
events: {
|
|
61
|
-
onPaymentSuccess: "vio:payment-success"
|
|
64
|
+
onPaymentSuccess: "vio:payment-success",
|
|
65
|
+
onCtaClick: "vio:cta-click"
|
|
62
66
|
}
|
|
63
67
|
});
|
|
64
68
|
/*! Bundled license information:
|
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../node_modules/@lit/react/src/create-component.ts","../../src/react/index.ts"],"names":["reservedReactProperties","Set","createComponent","react","React","tagName","elementClass","events","displayName","eventProps","Object","keys","ReactComponent","forwardRef","props","ref","useRef","Map","elementRef","reactProps","elementProps","k","v","entries","has","prototype","createElement","name","globalThis","litSsrReactEnabled","length","useCallback","node","current","VioProduct","VioProductCarousel","VioProductDetail","VioCart","VioCheckout"],"mappings":"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","file":"index.js","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport type React from 'react';\n\nconst NODE_MODE = false;\nconst DEV_MODE = true;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype DistributiveOmit<T, K extends string | number | symbol> = T extends any\n ? K extends keyof T\n ? Omit<T, K>\n : T\n : T;\ntype PropsWithoutRef<T> = DistributiveOmit<T, 'ref'>;\n\n/**\n * Creates a type to be used for the props of a web component used directly in\n * React JSX.\n *\n * Example:\n *\n * ```ts\n * declare module \"react\" {\n * namespace JSX {\n * interface IntrinsicElements {\n * 'x-foo': WebComponentProps<XFoo>;\n * }\n * }\n * }\n * ```\n */\nexport type WebComponentProps<I extends HTMLElement> = React.DetailedHTMLProps<\n React.HTMLAttributes<I>,\n I\n> &\n ElementProps<I>;\n\n/**\n * Type of the React component wrapping the web component. This is the return\n * type of `createComponent`.\n */\nexport type ReactWebComponent<\n I extends HTMLElement,\n E extends EventNames = {},\n> = React.ForwardRefExoticComponent<\n // TODO(augustjk): Remove and use `React.PropsWithoutRef` when\n // https://github.com/preactjs/preact/issues/4124 is fixed.\n PropsWithoutRef<ComponentProps<I, E>> & React.RefAttributes<I>\n>;\n\n// Props derived from custom element class. Currently has limitations of making\n// all properties optional and also surfaces life cycle methods in autocomplete.\n// TODO(augustjk) Consider omitting keyof LitElement to remove \"internal\"\n// lifecycle methods or allow user to explicitly provide props.\ntype ElementProps<I> = Partial<Omit<I, keyof HTMLElement>>;\n\n// Acceptable props to the React component.\ntype ComponentProps<I, E extends EventNames = {}> = Omit<\n React.HTMLAttributes<I>,\n // Prefer type of provided event handler props or those on element over\n // built-in HTMLAttributes\n keyof E | keyof ElementProps<I>\n> &\n EventListeners<E> &\n ElementProps<I>;\n\n/**\n * Type used to cast an event name with an event type when providing the\n * `events` option to `createComponent` for better typing of the event handler\n * prop.\n *\n * Example:\n *\n * ```ts\n * const FooComponent = createComponent({\n * ...\n * events: {\n * onfoo: 'foo' as EventName<FooEvent>,\n * }\n * });\n * ```\n *\n * `onfoo` prop will have the type `(e: FooEvent) => void`.\n */\nexport type EventName<T extends Event = Event> = string & {\n __eventType: T;\n};\n\n// A key value map matching React prop names to event names.\ntype EventNames = Record<string, EventName | string>;\n\n// A map of expected event listener types based on EventNames.\ntype EventListeners<R extends EventNames> = {\n [K in keyof R]?: R[K] extends EventName\n ? (e: R[K]['__eventType']) => void\n : (e: Event) => void;\n};\n\nexport interface Options<I extends HTMLElement, E extends EventNames = {}> {\n react: typeof React;\n tagName: string;\n elementClass: Constructor<I>;\n events?: E;\n displayName?: string;\n}\n\ntype Constructor<T> = {new (): T};\n\nconst reservedReactProperties = new Set([\n 'children',\n 'localName',\n 'ref',\n 'style',\n 'className',\n]);\n\nconst listenedEvents = new WeakMap<Element, Map<string, EventListenerObject>>();\n\n/**\n * Adds an event listener for the specified event to the given node. In the\n * React setup, there should only ever be one event listener. Thus, for\n * efficiency only one listener is added and the handler for that listener is\n * updated to point to the given listener function.\n */\nconst addOrUpdateEventListener = (\n node: Element,\n event: string,\n listener: (event?: Event) => void\n) => {\n let events = listenedEvents.get(node);\n if (events === undefined) {\n listenedEvents.set(node, (events = new Map()));\n }\n let handler = events.get(event);\n if (listener !== undefined) {\n // If necessary, add listener and track handler\n if (handler === undefined) {\n events.set(event, (handler = {handleEvent: listener}));\n node.addEventListener(event, handler);\n // Otherwise just update the listener with new value\n } else {\n handler.handleEvent = listener;\n }\n // Remove listener if one exists and value is undefined\n } else if (handler !== undefined) {\n events.delete(event);\n node.removeEventListener(event, handler);\n }\n};\n\n/**\n * Sets properties and events on custom elements. These properties and events\n * have been pre-filtered so we know they should apply to the custom element.\n */\nconst setProperty = <E extends Element>(\n node: E,\n name: string,\n value: unknown,\n old: unknown,\n events?: EventNames\n) => {\n const event = events?.[name];\n // Dirty check event value.\n if (event !== undefined) {\n if (value !== old) {\n addOrUpdateEventListener(node, event, value as (e?: Event) => void);\n }\n return;\n }\n // But don't dirty check properties; elements are assumed to do this.\n node[name as keyof E] = value as E[keyof E];\n\n // This block is to replicate React's behavior for attributes of native\n // elements where `undefined` or `null` values result in attributes being\n // removed.\n // https://github.com/facebook/react/blob/899cb95f52cc83ab5ca1eb1e268c909d3f0961e7/packages/react-dom-bindings/src/client/DOMPropertyOperations.js#L107-L141\n //\n // It's only needed here for native HTMLElement properties that reflect\n // attributes of the same name but don't have that behavior like \"id\" or\n // \"draggable\".\n if (\n (value === undefined || value === null) &&\n name in HTMLElement.prototype\n ) {\n node.removeAttribute(name);\n }\n};\n\n/**\n * Creates a React component for a custom element. Properties are distinguished\n * from attributes automatically, and events can be configured so they are added\n * to the custom element as event listeners.\n *\n * @param options An options bag containing the parameters needed to generate a\n * wrapped web component.\n *\n * @param options.react The React module, typically imported from the `react`\n * npm package.\n * @param options.tagName The custom element tag name registered via\n * `customElements.define`.\n * @param options.elementClass The custom element class registered via\n * `customElements.define`.\n * @param options.events An object listing events to which the component can\n * listen. The object keys are the event property names passed in via React\n * props and the object values are the names of the corresponding events\n * generated by the custom element. For example, given `{onactivate:\n * 'activate'}` an event function may be passed via the component's `onactivate`\n * prop and will be called when the custom element fires its `activate` event.\n * @param options.displayName A React component display name, used in debugging\n * messages. Default value is inferred from the name of custom element class\n * registered via `customElements.define`.\n */\nexport const createComponent = <\n I extends HTMLElement,\n E extends EventNames = {},\n>({\n react: React,\n tagName,\n elementClass,\n events,\n displayName,\n}: Options<I, E>): ReactWebComponent<I, E> => {\n const eventProps = new Set(Object.keys(events ?? {}));\n\n if (DEV_MODE && !NODE_MODE) {\n for (const p of reservedReactProperties) {\n if (p in elementClass.prototype && !(p in HTMLElement.prototype)) {\n // Note, this effectively warns only for `ref` since the other\n // reserved props are on HTMLElement.prototype. To address this\n // would require crawling down the prototype, which doesn't feel worth\n // it since implementing these properties on an element is extremely\n // rare.\n console.warn(\n `${tagName} contains property ${p} which is a React reserved ` +\n `property. It will be used by React and not set on the element.`\n );\n }\n }\n }\n\n type Props = ComponentProps<I, E>;\n\n const ReactComponent = React.forwardRef<I, Props>((props, ref) => {\n const prevElemPropsRef = React.useRef(new Map());\n const elementRef = React.useRef<I | null>(null);\n\n // Props to be passed to React.createElement\n const reactProps: Record<string, unknown> = {};\n // Props to be set on element with setProperty\n const elementProps: Record<string, unknown> = {};\n\n for (const [k, v] of Object.entries(props)) {\n if (reservedReactProperties.has(k)) {\n // React does *not* handle `className` for custom elements so\n // coerce it to `class` so it's handled correctly.\n reactProps[k === 'className' ? 'class' : k] = v;\n continue;\n }\n\n if (eventProps.has(k) || k in elementClass.prototype) {\n elementProps[k] = v;\n continue;\n }\n\n reactProps[k] = v;\n }\n\n // useLayoutEffect produces warnings during server rendering.\n if (!NODE_MODE) {\n // This one has no dependency array so it'll run on every re-render.\n React.useLayoutEffect(() => {\n if (elementRef.current === null) {\n return;\n }\n const newElemProps = new Map();\n for (const key in elementProps) {\n setProperty(\n elementRef.current,\n key,\n props[key],\n prevElemPropsRef.current.get(key),\n events\n );\n prevElemPropsRef.current.delete(key);\n newElemProps.set(key, props[key]);\n }\n // \"Unset\" any props from previous render that no longer exist.\n // Setting to `undefined` seems like the correct thing to \"unset\"\n // but currently React will set it as `null`.\n // See https://github.com/facebook/react/issues/28203\n for (const [key, value] of prevElemPropsRef.current) {\n setProperty(elementRef.current, key, undefined, value, events);\n }\n prevElemPropsRef.current = newElemProps;\n });\n\n // Empty dependency array so this will only run once after first render.\n React.useLayoutEffect(() => {\n elementRef.current?.removeAttribute('defer-hydration');\n }, []);\n }\n\n if (NODE_MODE) {\n // If component is to be server rendered with `@lit/ssr-react`, pass\n // element properties in a special bag to be set by the server-side\n // element renderer.\n if (\n (React.createElement.name === 'litPatchedCreateElement' ||\n globalThis.litSsrReactEnabled) &&\n Object.keys(elementProps).length\n ) {\n // This property needs to remain unminified.\n reactProps['_$litProps$'] = elementProps;\n }\n } else {\n // Suppress hydration warning for server-rendered attributes.\n // This property needs to remain unminified.\n reactProps['suppressHydrationWarning'] = true;\n }\n\n return React.createElement(tagName, {\n ...reactProps,\n ref: React.useCallback(\n (node: I) => {\n elementRef.current = node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref !== null) {\n ref.current = node;\n }\n },\n [ref]\n ),\n });\n });\n\n ReactComponent.displayName = displayName ?? elementClass.name;\n\n return ReactComponent;\n};\n","/**\n * Vio React adapter — typed React wrappers for the `<vio-*>` web components.\n *\n * Built on `@lit/react`'s `createComponent`, which gives each wrapper:\n * - typed props derived from the element's reactive properties, and\n * - typed event props (the `vio:*` CustomEvents below) as `onX` callbacks.\n *\n * Importing this entry also REGISTERS the custom elements (via the\n * `registerVioElements()` call below), so you do NOT need a separate\n * `import '@vio-live/web-sdk/ui'` when you use these.\n *\n * React 18+ is an (optional) peer dependency — only required if you import this\n * entry. `@lit/react` is bundled in, so consumers install nothing extra.\n *\n * import { Vio } from '@vio-live/web-sdk'\n * import { VioProductCarousel } from '@vio-live/web-sdk/react'\n * Vio.init({ apiKey, apiBase, graphqlBase, stripePublishableKey })\n * <VioProductCarousel onProductAdd={(e) => console.log(e.detail)} />\n *\n * Slots (ADR-0027): the element property is `vioSlot` (attribute `vio-slot`),\n * so in React it is `<VioProductCarousel vioSlot=\"hero\" />`. `@lit/react`\n * passes every reactive property of the element class through as a prop and\n * sets it on the element after mount — the elements re-register the slot from\n * `updated()`, so the late set is fine. `slot` itself is React's/HTML's own\n * attribute (shadow DOM slotting) — do not use it for this.\n * Typed in `index.props.test.ts` (compile-time, checked by `npm run typecheck`).\n */\n\nimport * as React from 'react'\nimport { createComponent } from '@lit/react'\nimport {\n registerVioElements,\n VioProduct as VioProductEl,\n VioProductCarousel as VioProductCarouselEl,\n VioProductDetail as VioProductDetailEl,\n VioCart as VioCartEl,\n VioCheckout as VioCheckoutEl,\n} from '../ui/elements.js'\n// Not just for the re-export below — the import itself injects the default\n// design tokens as CSS custom properties on `:root` (see tokens.ts). Without\n// it, `elements.js` alone never pulls tokens.ts in, so this entry (the one\n// the Vev bundle actually goes through) never ran that injection.\nimport '../ui/tokens.js'\n\n// Register the underlying custom elements when this entry is imported.\nregisterVioElements()\n\nexport const VioProduct = createComponent({\n react: React,\n tagName: 'vio-product',\n elementClass: VioProductEl,\n events: {\n onProductClick: 'vio:product-click',\n onProductAdd: 'vio:product-add',\n },\n})\n\nexport const VioProductCarousel = createComponent({\n react: React,\n tagName: 'vio-product-carousel',\n elementClass: VioProductCarouselEl,\n events: {},\n})\n\nexport const VioProductDetail = createComponent({\n react: React,\n tagName: 'vio-product-detail',\n elementClass: VioProductDetailEl,\n events: {\n onAddedToCart: 'vio:added-to-cart',\n onCheckoutOpen: 'vio:checkout-open',\n onLayoutApplied: 'vio:detail-layout-applied',\n },\n})\n\nexport const VioCart = createComponent({\n react: React,\n tagName: 'vio-cart',\n elementClass: VioCartEl,\n events: {\n onPaymentSuccess: 'vio:payment-success',\n onCheckoutOpen: 'vio:checkout-open',\n },\n})\n\nexport const VioCheckout = createComponent({\n react: React,\n tagName: 'vio-checkout',\n elementClass: VioCheckoutEl,\n events: {\n onPaymentSuccess: 'vio:payment-success',\n },\n})\n\nexport { VioTokens, applyVioTheme, type VioThemeOverrides } from '../ui/tokens.js'\n"]}
|
|
1
|
+
{"version":3,"sources":["../../node_modules/@lit/react/src/create-component.ts","../../src/react/index.ts"],"names":["reservedReactProperties","Set","createComponent","react","React","tagName","elementClass","events","displayName","eventProps","Object","keys","ReactComponent","forwardRef","props","ref","useRef","Map","elementRef","reactProps","elementProps","k","v","entries","has","prototype","createElement","name","globalThis","litSsrReactEnabled","length","useCallback","node","current","VioProduct","VioProductCarousel","VioProductDetail","VioCart","VioCheckout"],"mappings":"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","file":"index.js","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport type React from 'react';\n\nconst NODE_MODE = false;\nconst DEV_MODE = true;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype DistributiveOmit<T, K extends string | number | symbol> = T extends any\n ? K extends keyof T\n ? Omit<T, K>\n : T\n : T;\ntype PropsWithoutRef<T> = DistributiveOmit<T, 'ref'>;\n\n/**\n * Creates a type to be used for the props of a web component used directly in\n * React JSX.\n *\n * Example:\n *\n * ```ts\n * declare module \"react\" {\n * namespace JSX {\n * interface IntrinsicElements {\n * 'x-foo': WebComponentProps<XFoo>;\n * }\n * }\n * }\n * ```\n */\nexport type WebComponentProps<I extends HTMLElement> = React.DetailedHTMLProps<\n React.HTMLAttributes<I>,\n I\n> &\n ElementProps<I>;\n\n/**\n * Type of the React component wrapping the web component. This is the return\n * type of `createComponent`.\n */\nexport type ReactWebComponent<\n I extends HTMLElement,\n E extends EventNames = {},\n> = React.ForwardRefExoticComponent<\n // TODO(augustjk): Remove and use `React.PropsWithoutRef` when\n // https://github.com/preactjs/preact/issues/4124 is fixed.\n PropsWithoutRef<ComponentProps<I, E>> & React.RefAttributes<I>\n>;\n\n// Props derived from custom element class. Currently has limitations of making\n// all properties optional and also surfaces life cycle methods in autocomplete.\n// TODO(augustjk) Consider omitting keyof LitElement to remove \"internal\"\n// lifecycle methods or allow user to explicitly provide props.\ntype ElementProps<I> = Partial<Omit<I, keyof HTMLElement>>;\n\n// Acceptable props to the React component.\ntype ComponentProps<I, E extends EventNames = {}> = Omit<\n React.HTMLAttributes<I>,\n // Prefer type of provided event handler props or those on element over\n // built-in HTMLAttributes\n keyof E | keyof ElementProps<I>\n> &\n EventListeners<E> &\n ElementProps<I>;\n\n/**\n * Type used to cast an event name with an event type when providing the\n * `events` option to `createComponent` for better typing of the event handler\n * prop.\n *\n * Example:\n *\n * ```ts\n * const FooComponent = createComponent({\n * ...\n * events: {\n * onfoo: 'foo' as EventName<FooEvent>,\n * }\n * });\n * ```\n *\n * `onfoo` prop will have the type `(e: FooEvent) => void`.\n */\nexport type EventName<T extends Event = Event> = string & {\n __eventType: T;\n};\n\n// A key value map matching React prop names to event names.\ntype EventNames = Record<string, EventName | string>;\n\n// A map of expected event listener types based on EventNames.\ntype EventListeners<R extends EventNames> = {\n [K in keyof R]?: R[K] extends EventName\n ? (e: R[K]['__eventType']) => void\n : (e: Event) => void;\n};\n\nexport interface Options<I extends HTMLElement, E extends EventNames = {}> {\n react: typeof React;\n tagName: string;\n elementClass: Constructor<I>;\n events?: E;\n displayName?: string;\n}\n\ntype Constructor<T> = {new (): T};\n\nconst reservedReactProperties = new Set([\n 'children',\n 'localName',\n 'ref',\n 'style',\n 'className',\n]);\n\nconst listenedEvents = new WeakMap<Element, Map<string, EventListenerObject>>();\n\n/**\n * Adds an event listener for the specified event to the given node. In the\n * React setup, there should only ever be one event listener. Thus, for\n * efficiency only one listener is added and the handler for that listener is\n * updated to point to the given listener function.\n */\nconst addOrUpdateEventListener = (\n node: Element,\n event: string,\n listener: (event?: Event) => void\n) => {\n let events = listenedEvents.get(node);\n if (events === undefined) {\n listenedEvents.set(node, (events = new Map()));\n }\n let handler = events.get(event);\n if (listener !== undefined) {\n // If necessary, add listener and track handler\n if (handler === undefined) {\n events.set(event, (handler = {handleEvent: listener}));\n node.addEventListener(event, handler);\n // Otherwise just update the listener with new value\n } else {\n handler.handleEvent = listener;\n }\n // Remove listener if one exists and value is undefined\n } else if (handler !== undefined) {\n events.delete(event);\n node.removeEventListener(event, handler);\n }\n};\n\n/**\n * Sets properties and events on custom elements. These properties and events\n * have been pre-filtered so we know they should apply to the custom element.\n */\nconst setProperty = <E extends Element>(\n node: E,\n name: string,\n value: unknown,\n old: unknown,\n events?: EventNames\n) => {\n const event = events?.[name];\n // Dirty check event value.\n if (event !== undefined) {\n if (value !== old) {\n addOrUpdateEventListener(node, event, value as (e?: Event) => void);\n }\n return;\n }\n // But don't dirty check properties; elements are assumed to do this.\n node[name as keyof E] = value as E[keyof E];\n\n // This block is to replicate React's behavior for attributes of native\n // elements where `undefined` or `null` values result in attributes being\n // removed.\n // https://github.com/facebook/react/blob/899cb95f52cc83ab5ca1eb1e268c909d3f0961e7/packages/react-dom-bindings/src/client/DOMPropertyOperations.js#L107-L141\n //\n // It's only needed here for native HTMLElement properties that reflect\n // attributes of the same name but don't have that behavior like \"id\" or\n // \"draggable\".\n if (\n (value === undefined || value === null) &&\n name in HTMLElement.prototype\n ) {\n node.removeAttribute(name);\n }\n};\n\n/**\n * Creates a React component for a custom element. Properties are distinguished\n * from attributes automatically, and events can be configured so they are added\n * to the custom element as event listeners.\n *\n * @param options An options bag containing the parameters needed to generate a\n * wrapped web component.\n *\n * @param options.react The React module, typically imported from the `react`\n * npm package.\n * @param options.tagName The custom element tag name registered via\n * `customElements.define`.\n * @param options.elementClass The custom element class registered via\n * `customElements.define`.\n * @param options.events An object listing events to which the component can\n * listen. The object keys are the event property names passed in via React\n * props and the object values are the names of the corresponding events\n * generated by the custom element. For example, given `{onactivate:\n * 'activate'}` an event function may be passed via the component's `onactivate`\n * prop and will be called when the custom element fires its `activate` event.\n * @param options.displayName A React component display name, used in debugging\n * messages. Default value is inferred from the name of custom element class\n * registered via `customElements.define`.\n */\nexport const createComponent = <\n I extends HTMLElement,\n E extends EventNames = {},\n>({\n react: React,\n tagName,\n elementClass,\n events,\n displayName,\n}: Options<I, E>): ReactWebComponent<I, E> => {\n const eventProps = new Set(Object.keys(events ?? {}));\n\n if (DEV_MODE && !NODE_MODE) {\n for (const p of reservedReactProperties) {\n if (p in elementClass.prototype && !(p in HTMLElement.prototype)) {\n // Note, this effectively warns only for `ref` since the other\n // reserved props are on HTMLElement.prototype. To address this\n // would require crawling down the prototype, which doesn't feel worth\n // it since implementing these properties on an element is extremely\n // rare.\n console.warn(\n `${tagName} contains property ${p} which is a React reserved ` +\n `property. It will be used by React and not set on the element.`\n );\n }\n }\n }\n\n type Props = ComponentProps<I, E>;\n\n const ReactComponent = React.forwardRef<I, Props>((props, ref) => {\n const prevElemPropsRef = React.useRef(new Map());\n const elementRef = React.useRef<I | null>(null);\n\n // Props to be passed to React.createElement\n const reactProps: Record<string, unknown> = {};\n // Props to be set on element with setProperty\n const elementProps: Record<string, unknown> = {};\n\n for (const [k, v] of Object.entries(props)) {\n if (reservedReactProperties.has(k)) {\n // React does *not* handle `className` for custom elements so\n // coerce it to `class` so it's handled correctly.\n reactProps[k === 'className' ? 'class' : k] = v;\n continue;\n }\n\n if (eventProps.has(k) || k in elementClass.prototype) {\n elementProps[k] = v;\n continue;\n }\n\n reactProps[k] = v;\n }\n\n // useLayoutEffect produces warnings during server rendering.\n if (!NODE_MODE) {\n // This one has no dependency array so it'll run on every re-render.\n React.useLayoutEffect(() => {\n if (elementRef.current === null) {\n return;\n }\n const newElemProps = new Map();\n for (const key in elementProps) {\n setProperty(\n elementRef.current,\n key,\n props[key],\n prevElemPropsRef.current.get(key),\n events\n );\n prevElemPropsRef.current.delete(key);\n newElemProps.set(key, props[key]);\n }\n // \"Unset\" any props from previous render that no longer exist.\n // Setting to `undefined` seems like the correct thing to \"unset\"\n // but currently React will set it as `null`.\n // See https://github.com/facebook/react/issues/28203\n for (const [key, value] of prevElemPropsRef.current) {\n setProperty(elementRef.current, key, undefined, value, events);\n }\n prevElemPropsRef.current = newElemProps;\n });\n\n // Empty dependency array so this will only run once after first render.\n React.useLayoutEffect(() => {\n elementRef.current?.removeAttribute('defer-hydration');\n }, []);\n }\n\n if (NODE_MODE) {\n // If component is to be server rendered with `@lit/ssr-react`, pass\n // element properties in a special bag to be set by the server-side\n // element renderer.\n if (\n (React.createElement.name === 'litPatchedCreateElement' ||\n globalThis.litSsrReactEnabled) &&\n Object.keys(elementProps).length\n ) {\n // This property needs to remain unminified.\n reactProps['_$litProps$'] = elementProps;\n }\n } else {\n // Suppress hydration warning for server-rendered attributes.\n // This property needs to remain unminified.\n reactProps['suppressHydrationWarning'] = true;\n }\n\n return React.createElement(tagName, {\n ...reactProps,\n ref: React.useCallback(\n (node: I) => {\n elementRef.current = node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref !== null) {\n ref.current = node;\n }\n },\n [ref]\n ),\n });\n });\n\n ReactComponent.displayName = displayName ?? elementClass.name;\n\n return ReactComponent;\n};\n","/**\n * Vio React adapter — typed React wrappers for the `<vio-*>` web components.\n *\n * Built on `@lit/react`'s `createComponent`, which gives each wrapper:\n * - typed props derived from the element's reactive properties, and\n * - typed event props (the `vio:*` CustomEvents below) as `onX` callbacks.\n *\n * Importing this entry also REGISTERS the custom elements (via the\n * `registerVioElements()` call below), so you do NOT need a separate\n * `import '@vio-live/web-sdk/ui'` when you use these.\n *\n * React 18+ is an (optional) peer dependency — only required if you import this\n * entry. `@lit/react` is bundled in, so consumers install nothing extra.\n *\n * import { Vio } from '@vio-live/web-sdk'\n * import { VioProductCarousel } from '@vio-live/web-sdk/react'\n * Vio.init({ apiKey, apiBase, graphqlBase, stripePublishableKey })\n * <VioProductCarousel onProductAdd={(e) => console.log(e.detail)} />\n *\n * Slots (ADR-0027): the element property is `vioSlot` (attribute `vio-slot`),\n * so in React it is `<VioProductCarousel vioSlot=\"hero\" />`. `@lit/react`\n * passes every reactive property of the element class through as a prop and\n * sets it on the element after mount — the elements re-register the slot from\n * `updated()`, so the late set is fine. `slot` itself is React's/HTML's own\n * attribute (shadow DOM slotting) — do not use it for this.\n * Typed in `index.props.test.ts` (compile-time, checked by `npm run typecheck`).\n */\n\nimport * as React from 'react'\nimport { createComponent } from '@lit/react'\nimport {\n registerVioElements,\n VioProduct as VioProductEl,\n VioProductCarousel as VioProductCarouselEl,\n VioProductDetail as VioProductDetailEl,\n VioCart as VioCartEl,\n VioCheckout as VioCheckoutEl,\n} from '../ui/elements.js'\n// Not just for the re-export below — the import itself injects the default\n// design tokens as CSS custom properties on `:root` (see tokens.ts). Without\n// it, `elements.js` alone never pulls tokens.ts in, so this entry (the one\n// the Vev bundle actually goes through) never ran that injection.\nimport '../ui/tokens.js'\n\n// Register the underlying custom elements when this entry is imported.\nregisterVioElements()\n\nexport const VioProduct = createComponent({\n react: React,\n tagName: 'vio-product',\n elementClass: VioProductEl,\n events: {\n onProductClick: 'vio:product-click',\n onProductAdd: 'vio:product-add',\n onCtaClick: 'vio:cta-click',\n },\n})\n\nexport const VioProductCarousel = createComponent({\n react: React,\n tagName: 'vio-product-carousel',\n elementClass: VioProductCarouselEl,\n events: {},\n})\n\nexport const VioProductDetail = createComponent({\n react: React,\n tagName: 'vio-product-detail',\n elementClass: VioProductDetailEl,\n events: {\n onAddedToCart: 'vio:added-to-cart',\n onCheckoutOpen: 'vio:checkout-open',\n onLayoutApplied: 'vio:detail-layout-applied',\n onCtaClick: 'vio:cta-click',\n },\n})\n\nexport const VioCart = createComponent({\n react: React,\n tagName: 'vio-cart',\n elementClass: VioCartEl,\n events: {\n onPaymentSuccess: 'vio:payment-success',\n onCheckoutOpen: 'vio:checkout-open',\n onCtaClick: 'vio:cta-click',\n },\n})\n\nexport const VioCheckout = createComponent({\n react: React,\n tagName: 'vio-checkout',\n elementClass: VioCheckoutEl,\n events: {\n onPaymentSuccess: 'vio:payment-success',\n onCtaClick: 'vio:cta-click',\n },\n})\n\nexport { VioTokens, applyVioTheme, type VioThemeOverrides } from '../ui/tokens.js'\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
|
-
import { D as DetailLayout, A as AppliedDetailLayout } from './detail-layout-
|
|
4
|
+
import { D as DetailLayout, A as AppliedDetailLayout } from './detail-layout-BfR20W_X.js';
|
|
5
5
|
|
|
6
6
|
declare class VioProduct extends LitElement {
|
|
7
7
|
/** Brand label shown at the top (uppercase, gray, small). */
|
|
@@ -106,6 +106,10 @@ declare class VioProduct extends LitElement {
|
|
|
106
106
|
/** Reflect whether (and how many units of) this product sit in the cart. */
|
|
107
107
|
private updateInCart;
|
|
108
108
|
private onClick;
|
|
109
|
+
/** Stops reporting the taps on the buttons (`vio:cta-click`). */
|
|
110
|
+
private stopCtaClicks;
|
|
111
|
+
/** What a tap on the card says (`vio:cta-click`): its product, sponsor and attribution. */
|
|
112
|
+
private ctaContext;
|
|
109
113
|
private onKeydown;
|
|
110
114
|
/** Quick add-to-cart. If the product has selectable variants, open the detail
|
|
111
115
|
* to pick one instead (the host can't choose for the user). Otherwise emit
|
|
@@ -325,6 +329,11 @@ declare class VioProductDetail extends LitElement {
|
|
|
325
329
|
* Unset = the theme's `detailDescriptionMode` (`--vio-detail-description-mode`).
|
|
326
330
|
*/
|
|
327
331
|
descriptionMode: string;
|
|
332
|
+
/**
|
|
333
|
+
* Heading of the description fold (default «Beskrivelse»), e.g.
|
|
334
|
+
* «Produktbeskrivelse». Unset = the page's `Vio.configureDetail({ descriptionLabel })`.
|
|
335
|
+
*/
|
|
336
|
+
descriptionLabel: string;
|
|
328
337
|
/**
|
|
329
338
|
* The brand's promises, shown in a row under the buy zone. By default the
|
|
330
339
|
* brand's own (dashboard Settings → Brand, in the bootstrap); this list
|
|
@@ -478,7 +487,22 @@ declare class VioProductDetail extends LitElement {
|
|
|
478
487
|
/** Phones: the page behind is locked, and the sheet closes by pulling the bar or the top bar down. */
|
|
479
488
|
private readonly bottomSheet;
|
|
480
489
|
private boundProductClick;
|
|
481
|
-
static styles: lit.CSSResult;
|
|
490
|
+
static styles: lit.CSSResult[];
|
|
491
|
+
/** Stops reporting the taps on the buttons (`vio:cta-click`). */
|
|
492
|
+
private stopCtaClicks;
|
|
493
|
+
/** The product open when the shopper last changed photo: `gallery_swipe` once per open. */
|
|
494
|
+
private gallerySwipedFor;
|
|
495
|
+
/** A finger, a pen or a wheel is on the carousel: its scroll is the shopper's swipe, not the SDK's. */
|
|
496
|
+
private galleryGesture;
|
|
497
|
+
/**
|
|
498
|
+
* What a tap on a button of the detail says (`vio:cta-click`, README
|
|
499
|
+
* «Button tracking»): the open product and the variant chosen (when every
|
|
500
|
+
* option is), its sponsor and attribution, and the layout shown (only a
|
|
501
|
+
* non-default one). `gallery_swipe` only once per open product.
|
|
502
|
+
*/
|
|
503
|
+
private ctaContext;
|
|
504
|
+
/** The carousel scrolled under the shopper's finger: their first swipe of this product. */
|
|
505
|
+
private onGalleryGesture;
|
|
482
506
|
/** The cart changed (another tab, the drawer): the line under Vipps counts it again. */
|
|
483
507
|
private boundCartChange;
|
|
484
508
|
connectedCallback(): void;
|
|
@@ -691,6 +715,8 @@ declare class VioProductDetail extends LitElement {
|
|
|
691
715
|
* the heading, the text or «Les mer» opens the rest (Angelo, 2026-10-28).
|
|
692
716
|
* A description that fits in the preview has nothing to open.
|
|
693
717
|
*/
|
|
718
|
+
/** The description fold's heading: this element's, else the page's, else «Beskrivelse». */
|
|
719
|
+
private descriptionHeading;
|
|
694
720
|
private renderDescription;
|
|
695
721
|
/** Is the preview hiding part of the text? Measured with the preview applied. */
|
|
696
722
|
private measureDescription;
|
|
@@ -801,10 +827,19 @@ declare class VioCart extends LitElement {
|
|
|
801
827
|
/** Phones: the page behind is locked, and the sheet closes by pulling the bar or the header down. */
|
|
802
828
|
private readonly bottomSheet;
|
|
803
829
|
private boundOnCartChange;
|
|
804
|
-
static styles: lit.CSSResult;
|
|
830
|
+
static styles: lit.CSSResult[];
|
|
805
831
|
connectedCallback(): void;
|
|
806
832
|
disconnectedCallback(): void;
|
|
807
833
|
close(): void;
|
|
834
|
+
/** Stops reporting the taps on the buttons (`vio:cta-click`). */
|
|
835
|
+
private stopCtaClicks;
|
|
836
|
+
/**
|
|
837
|
+
* What a tap on a button of the cart says (`vio:cta-click`): a line's
|
|
838
|
+
* buttons name its product, variant and sponsor, and where its most recent
|
|
839
|
+
* units came from (campaign, slot, article); the footer's buttons name the
|
|
840
|
+
* sponsor they pay (Vipps: the one it pays; the others: the first).
|
|
841
|
+
*/
|
|
842
|
+
private ctaContext;
|
|
808
843
|
show(): void;
|
|
809
844
|
/** Which payment buttons to render — backend-configured per sponsor.
|
|
810
845
|
* Falls back to showing everything if the query fails or none is set. */
|
|
@@ -881,6 +916,12 @@ declare class VioCart extends LitElement {
|
|
|
881
916
|
private onDecrement;
|
|
882
917
|
private onRemove;
|
|
883
918
|
render(): lit_html.TemplateResult<1>;
|
|
919
|
+
/**
|
|
920
|
+
* The selling brand's promises under the ways to pay, as in the product
|
|
921
|
+
* detail (one article = one brand: the cart's brand). Hidden with the theme's
|
|
922
|
+
* `cartHighlightsDisplay: 'none'`; nothing when the brand has none.
|
|
923
|
+
*/
|
|
924
|
+
private renderBrandHighlights;
|
|
884
925
|
/** «Frakt» (the chosen or cheapest rate) and «Totalt» with it; «Beregnes i kassen» when unknown. */
|
|
885
926
|
private renderShippingRows;
|
|
886
927
|
private renderConfirmation;
|
|
@@ -1134,6 +1175,10 @@ declare class VioCheckout extends LitElement {
|
|
|
1134
1175
|
private cleanReturnQueryParams;
|
|
1135
1176
|
disconnectedCallback(): void;
|
|
1136
1177
|
updated(changed: Map<string, unknown>): void;
|
|
1178
|
+
/** Stops reporting the taps on the buttons (`vio:cta-click`). */
|
|
1179
|
+
private stopCtaClicks;
|
|
1180
|
+
/** What a tap on a button of the checkout says (`vio:cta-click`): the sponsor whose cart it pays. */
|
|
1181
|
+
private ctaContext;
|
|
1137
1182
|
close(): void;
|
|
1138
1183
|
show(): void;
|
|
1139
1184
|
/**
|
|
@@ -1693,6 +1738,8 @@ interface VioThemeOverrides {
|
|
|
1693
1738
|
detailHighlightsDisplay?: string;
|
|
1694
1739
|
/** «Frakt & retur» in the detail: `block` (default) or `none` (hidden). */
|
|
1695
1740
|
detailShippingReturnsDisplay?: string;
|
|
1741
|
+
/** The brand's promises in the cart, under the ways to pay: `grid` (default, shown when the brand has some) or `none`. */
|
|
1742
|
+
cartHighlightsDisplay?: string;
|
|
1696
1743
|
/** `<vio-product-carousel>`: `carousel` (default, one row) or `list` (cards one under the other). Its `layout` attribute wins. */
|
|
1697
1744
|
carouselLayout?: string;
|
|
1698
1745
|
/** Thumbnail size (default `64px`). One row, scrolls sideways. */
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-ChbmD8wb.js';
|
|
2
2
|
import 'lit-html';
|
|
3
3
|
import 'lit';
|
|
4
|
-
import '../detail-layout-
|
|
4
|
+
import '../detail-layout-BfR20W_X.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Vio elements — owns the `<vio-*>` custom-element classes and their registration.
|
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-LDA7RI43.js';
|
|
2
|
+
export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-LDA7RI43.js';
|
|
3
|
+
import '../chunk-KVI56NGO.js';
|
|
4
4
|
|
|
5
5
|
// src/ui/index.ts
|
|
6
6
|
registerVioElements();
|
package/package.json
CHANGED
package/dist/chunk-3YFJFDSN.js
DELETED