@vectoriox/iox-ui 5.94.0 → 5.96.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/actions-core/index.d.ts +7 -2
- package/commerce-core/index.d.ts +312 -2
- package/composite-core/index.d.ts +306 -2
- package/design-core/index.d.ts +1049 -105
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs +15 -4
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-commerce-core.mjs +527 -6
- package/fesm2022/vectoriox-iox-ui-commerce-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +1193 -177
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +1147 -43
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +2 -2
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +8 -1
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +2 -2
- package/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/actions-core/action.model.ts +1 -1
- package/src/actions-core/element-actions.ts +17 -3
- package/src/commerce-core/cart-transport.ts +211 -0
- package/src/commerce-core/public-api.ts +4 -0
- package/src/commerce-core/quantity.ts +56 -0
- package/src/commerce-core/shop-display.ts +117 -0
- package/src/commerce-core/variants.ts +296 -0
- package/src/composite-core/exclusive-runtime.ts +20 -7
- package/src/composite-core/public-api.ts +2 -0
- package/src/composite-core/shop-runtime.ts +626 -0
- package/src/composite-core/shop.ts +458 -0
- package/src/design-core/flavor-spec.generated.ts +1147 -43
- package/src/generation-core/site-spec.generated.ts +2 -2
- package/styles/iox-design.css +95 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ElementStyleTarget, HeaderBehaviour, HeaderEdge } from '@vectoriox/iox-ui/design-core';
|
|
2
2
|
export { ROW_INDEX_ATTRIBUTE } from '@vectoriox/iox-ui/design-core';
|
|
3
|
+
import { ProductOption, CartTransport, StorefrontProduct, ShopSlot, CartView, ProductVariantView } from '@vectoriox/iox-ui/commerce-core';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* The node shape composite-core reads and writes — both a builder `ComponentNode` (values in
|
|
@@ -1603,11 +1604,17 @@ interface ExclusiveRuntimeOptions {
|
|
|
1603
1604
|
/** The key on when there is no server state (the builder canvas: a Segmented control's On by default), else the
|
|
1604
1605
|
* root's `data-iox-default-on`, else the first item. */
|
|
1605
1606
|
defaultKey?: () => string | null;
|
|
1607
|
+
/** The triggers' selector, when they are not one of the kinds' role classes (commerce E1c: a variant picker's values
|
|
1608
|
+
* run as a Segmented control's options — `.iox-role-shop-variant-value`). */
|
|
1609
|
+
triggerSelector?: string;
|
|
1606
1610
|
}
|
|
1607
1611
|
/** The exclusive composite an element belongs to (the element itself when it is a root). */
|
|
1608
1612
|
declare function closestExclusive(el: Element | null | undefined): HTMLElement | null;
|
|
1609
1613
|
/** The trigger or panel an element sits in (itself when it is one) — its ITEM part — or null. */
|
|
1610
1614
|
declare function closestExclusiveItemPart(el: Element | null | undefined): HTMLElement | null;
|
|
1615
|
+
/** A trigger that cannot be turned on: `aria-disabled="true"` or a disabled button (a sold-out variant value). It stays
|
|
1616
|
+
* visible and announced, is skipped by the arrow keys and refuses a click (APG radio group). */
|
|
1617
|
+
declare function isExclusiveTriggerDisabled(el: Element | null | undefined): boolean;
|
|
1611
1618
|
declare class ExclusiveRuntime {
|
|
1612
1619
|
readonly root: HTMLElement;
|
|
1613
1620
|
private readonly options;
|
|
@@ -1915,5 +1922,302 @@ declare function buildCounterRecipe(create: CompositeNodeFactory, words?: Partia
|
|
|
1915
1922
|
* section" in the Interactions panel. */
|
|
1916
1923
|
declare function buildReadingBarRecipe(create: CompositeNodeFactory): CompositeNode;
|
|
1917
1924
|
|
|
1918
|
-
|
|
1919
|
-
|
|
1925
|
+
/**
|
|
1926
|
+
* THE SHOP PARTS (commerce E1c, C-D16 — commerce board 10). Not components: recipes of ordinary builder nodes, each part
|
|
1927
|
+
* carrying a role, so every part is selectable on the canvas, in the layer tree and the breadcrumb, and wears its own
|
|
1928
|
+
* element style (R2). ONE runtime (`shop-runtime.ts`, DOM only) fills them on the builder canvas and the live site:
|
|
1929
|
+
*
|
|
1930
|
+
* Price Container shop.price › Text shop.price-amount (`price`, $variant.price | money)
|
|
1931
|
+
* · Text shop.price-compare (`price-compare`, $variant.compareAt | money)
|
|
1932
|
+
* Options Container shop.variants › Container shop.variant-group (ONE template, stamped per option)
|
|
1933
|
+
* › Text shop.variant-label · Container shop.variant-values (the option's radio group)
|
|
1934
|
+
* › ButtonBlock shop.variant-value (`variant-chip`) › Text — the chip template
|
|
1935
|
+
* · ButtonBlock shop.variant-swatch (`variant-swatch`) — the swatch template
|
|
1936
|
+
* · Text shop.variant-note ("Charcoal is sold out")
|
|
1937
|
+
* Quantity Container shop.quantity (`quantity`) › − · Text shop.quantity-value · +
|
|
1938
|
+
* Add to cart ButtonBlock shop.add (`button-primary`, click → addToCart) › "Add to cart" · "Added ✓"
|
|
1939
|
+
* Buy now ButtonBlock shop.buy-now (`button-secondary`, click → startCheckout)
|
|
1940
|
+
* Cart button ButtonBlock shop.cart-button (`cart-button`) › Icon · Container shop.cart-count › Text $cart.count
|
|
1941
|
+
* Cart drawer Dialog shop.cart-drawer (end edge; a bottom sheet on a phone) › head · lines (ONE line template)
|
|
1942
|
+
* · issues · empty · free-delivery note · Subtotal ($cart.subtotal | money) · VAT note
|
|
1943
|
+
* · Check out · Keep shopping
|
|
1944
|
+
*
|
|
1945
|
+
* A template part (an option group, a value, a cart line) is the FIRST instance the runtime shows; the rest are its
|
|
1946
|
+
* copies (`data-iox-shop-clone`), so the template is what the author selects and styles, and every copy wears it.
|
|
1947
|
+
*/
|
|
1948
|
+
declare enum ShopRole {
|
|
1949
|
+
Price = "shop.price",
|
|
1950
|
+
PriceAmount = "shop.price-amount",
|
|
1951
|
+
PriceCompare = "shop.price-compare",
|
|
1952
|
+
Variants = "shop.variants",
|
|
1953
|
+
VariantGroup = "shop.variant-group",
|
|
1954
|
+
VariantLabel = "shop.variant-label",
|
|
1955
|
+
VariantValues = "shop.variant-values",
|
|
1956
|
+
VariantValue = "shop.variant-value",
|
|
1957
|
+
VariantSwatch = "shop.variant-swatch",
|
|
1958
|
+
VariantNote = "shop.variant-note",
|
|
1959
|
+
Quantity = "shop.quantity",
|
|
1960
|
+
QuantityDown = "shop.quantity-down",
|
|
1961
|
+
QuantityValue = "shop.quantity-value",
|
|
1962
|
+
QuantityUp = "shop.quantity-up",
|
|
1963
|
+
Add = "shop.add",
|
|
1964
|
+
AddLabel = "shop.add-label",
|
|
1965
|
+
AddedLabel = "shop.added-label",
|
|
1966
|
+
BuyNow = "shop.buy-now",
|
|
1967
|
+
CartButton = "shop.cart-button",
|
|
1968
|
+
CartCount = "shop.cart-count",
|
|
1969
|
+
CartDrawer = "shop.cart-drawer",
|
|
1970
|
+
CartTitle = "shop.cart-title",
|
|
1971
|
+
CartClose = "shop.cart-close",
|
|
1972
|
+
CartLines = "shop.cart-lines",
|
|
1973
|
+
CartLine = "shop.cart-line",
|
|
1974
|
+
CartLineImage = "shop.cart-line-image",
|
|
1975
|
+
CartLineTitle = "shop.cart-line-title",
|
|
1976
|
+
CartLineVariant = "shop.cart-line-variant",
|
|
1977
|
+
CartLineRemove = "shop.cart-line-remove",
|
|
1978
|
+
CartLineTotal = "shop.cart-line-total",
|
|
1979
|
+
CartIssues = "shop.cart-issues",
|
|
1980
|
+
CartEmpty = "shop.cart-empty",
|
|
1981
|
+
CartShippingNote = "shop.cart-shipping-note",
|
|
1982
|
+
CartSummary = "shop.cart-summary",
|
|
1983
|
+
CartSubtotal = "shop.cart-subtotal",
|
|
1984
|
+
CartVatNote = "shop.cart-vat-note",
|
|
1985
|
+
Checkout = "shop.checkout",
|
|
1986
|
+
KeepShopping = "shop.keep-shopping"
|
|
1987
|
+
}
|
|
1988
|
+
declare const SHOP_ROLES: ReadonlySet<string>;
|
|
1989
|
+
declare function isShopRole(role: string | null | undefined): boolean;
|
|
1990
|
+
/** The CSS selector of a shop role (`.iox-role-shop-price`). */
|
|
1991
|
+
declare function shopSelector(role: ShopRole): string;
|
|
1992
|
+
/** The attributes the shop runtime writes (the shared CSS in `styles/iox-design.css` reads them). */
|
|
1993
|
+
declare const SHOP_CLONE_ATTRIBUTE = "data-iox-shop-clone";
|
|
1994
|
+
/** A template the current product does not use (the swatch template of a word option) — never shown, never a trigger. */
|
|
1995
|
+
declare const SHOP_UNUSED_ATTRIBUTE = "data-iox-shop-unused";
|
|
1996
|
+
/** "Added ✓" in place, for ADDED_HOLD_MS after a successful add. */
|
|
1997
|
+
declare const SHOP_ADDED_ATTRIBUTE = "data-iox-added";
|
|
1998
|
+
/** An empty bag: on the cart button (its count hides) and the drawer (its lines, summary and Check out hide). */
|
|
1999
|
+
declare const CART_EMPTY_ATTRIBUTE = "data-iox-cart-empty";
|
|
2000
|
+
/** A cart line's id (`cartLineId`) on its line element. */
|
|
2001
|
+
declare const CART_LINE_ATTRIBUTE = "data-iox-line-id";
|
|
2002
|
+
/** The count the runtime adds to the drawer's title ("Your bag (2)"). */
|
|
2003
|
+
declare const CART_TITLE_COUNT_ATTRIBUTE = "data-iox-cart-title-count";
|
|
2004
|
+
/** A part the runtime has no words for right now (a variant note with nothing sold out, a group with no option). */
|
|
2005
|
+
declare const SHOP_HIDDEN_ATTRIBUTE = "data-iox-shop-hidden";
|
|
2006
|
+
/** The native select a long option list becomes (T26). */
|
|
2007
|
+
declare const SHOP_SELECT_CLASS = "iox-shop-select";
|
|
2008
|
+
/** The polite live region the runtime announces "Added ✓" and refusals in. */
|
|
2009
|
+
declare const SHOP_LIVE_CLASS = "iox-shop-live";
|
|
2010
|
+
/** How long "Added ✓" holds before the button reads "Add to cart" again (Emil: long enough to read, never a wait). */
|
|
2011
|
+
declare const ADDED_HOLD_MS = 1600;
|
|
2012
|
+
declare enum ShopPickerKind {
|
|
2013
|
+
/** Words in outlined chips — up to SHOP_CHIP_MAX values. */
|
|
2014
|
+
Chips = "chips",
|
|
2015
|
+
/** Round swatches of each value's colour — a colour option whose every value has a colour. */
|
|
2016
|
+
Swatches = "swatches",
|
|
2017
|
+
/** A native select — past SHOP_CHIP_MAX values a row of chips no longer fits a phone (T26). */
|
|
2018
|
+
Select = "select"
|
|
2019
|
+
}
|
|
2020
|
+
/** The Segmented control's rule (Q40): four fit a phone row, five do not. */
|
|
2021
|
+
declare const SHOP_CHIP_MAX = 4;
|
|
2022
|
+
/** The option names that ARE a colour (en, he). */
|
|
2023
|
+
declare const COLOUR_OPTION_NAMES: ReadonlyArray<string>;
|
|
2024
|
+
/** Colour words a value may be named by (en, he) — a value named "Navy" is drawn navy. Never a guess past these. */
|
|
2025
|
+
declare const NAMED_SWATCHES: Readonly<Record<string, string>>;
|
|
2026
|
+
/**
|
|
2027
|
+
* The fill a value is drawn with, or null: the host's own (the sample's glazes), else the value itself when it IS a CSS
|
|
2028
|
+
* colour (`#3A3B3D`), else a colour word. A value with no fill is never drawn as a blank swatch.
|
|
2029
|
+
*/
|
|
2030
|
+
declare function swatchFill(value: string, own?: Readonly<Record<string, string>> | null): string | null;
|
|
2031
|
+
/**
|
|
2032
|
+
* How one option is chosen (T26): swatches when every value has a fill AND the option is a colour (or every value is
|
|
2033
|
+
* one — the sample's glazes), chips up to four values, a select past four.
|
|
2034
|
+
*/
|
|
2035
|
+
declare function shopPickerKind(option: ProductOption, own?: Readonly<Record<string, string>> | null): ShopPickerKind;
|
|
2036
|
+
/** A group's label: "Glaze — Sand" when the chosen value has no words of its own on screen (a swatch), else "Size". */
|
|
2037
|
+
declare function variantGroupLabel(option: ProductOption, chosen: string | undefined, kind: ShopPickerKind): string;
|
|
2038
|
+
/** The words under a swatch group: what is sold out ("Charcoal is sold out"), '' when nothing is or the values speak. */
|
|
2039
|
+
declare function variantGroupNote(soldOut: ReadonlyArray<string>, kind: ShopPickerKind, lang: string | null | undefined): string;
|
|
2040
|
+
/** The words a fresh recipe shows (board 10's sample) — the runtime writes the product's own over them. */
|
|
2041
|
+
declare const SHOP_RECIPE_WORDS: Readonly<{
|
|
2042
|
+
price: "₪240.00";
|
|
2043
|
+
compareAt: "₪280.00";
|
|
2044
|
+
option: "Glaze — Sand";
|
|
2045
|
+
value: "32 cm";
|
|
2046
|
+
note: "Charcoal is sold out";
|
|
2047
|
+
quantity: "1";
|
|
2048
|
+
add: "Add to cart";
|
|
2049
|
+
added: "Added ✓";
|
|
2050
|
+
buyNow: "Buy now";
|
|
2051
|
+
cart: "Bag";
|
|
2052
|
+
count: "2";
|
|
2053
|
+
drawer: "Your bag";
|
|
2054
|
+
close: "Close";
|
|
2055
|
+
lineTitle: "Tall speckled vase";
|
|
2056
|
+
lineVariant: "Sand · 32 cm";
|
|
2057
|
+
lineTotal: "₪240.00";
|
|
2058
|
+
remove: "Remove";
|
|
2059
|
+
empty: "Your bag is empty.";
|
|
2060
|
+
shippingNote: "Add ₪40.00 more for free delivery";
|
|
2061
|
+
subtotalLabel: "Subtotal";
|
|
2062
|
+
subtotal: "₪360.00";
|
|
2063
|
+
vatNote: "Includes VAT. Delivery is chosen at checkout.";
|
|
2064
|
+
checkout: "Check out";
|
|
2065
|
+
keepShopping: "Keep shopping";
|
|
2066
|
+
}>;
|
|
2067
|
+
declare const SHOP_LABELS: Readonly<{
|
|
2068
|
+
price: "Price";
|
|
2069
|
+
variants: "Options";
|
|
2070
|
+
quantity: "Quantity";
|
|
2071
|
+
add: "Add to cart";
|
|
2072
|
+
buyNow: "Buy now";
|
|
2073
|
+
cartButton: "Cart button";
|
|
2074
|
+
cartDrawer: "Cart drawer";
|
|
2075
|
+
}>;
|
|
2076
|
+
/** Price: the variant's price and, when it is higher, its earlier price struck through (board 10). */
|
|
2077
|
+
declare function buildPriceRecipe(create: CompositeNodeFactory): CompositeNode;
|
|
2078
|
+
/** Options: one group per option, each a radio group of chips, swatches or a select (T26). */
|
|
2079
|
+
declare function buildVariantPickerRecipe(create: CompositeNodeFactory): CompositeNode;
|
|
2080
|
+
/** Quantity: − · the count · + (min 1, max from the variant's stock). `compact` = a cart line's. */
|
|
2081
|
+
declare function buildQuantityRecipe(create: CompositeNodeFactory, compact?: boolean, key?: string): CompositeNode;
|
|
2082
|
+
/** Add to cart: presses on pointer-down (its element style), then reads "Added ✓" in place for ADDED_HOLD_MS. */
|
|
2083
|
+
declare function buildAddToCartRecipe(create: CompositeNodeFactory): CompositeNode;
|
|
2084
|
+
/** Buy now: straight to checkout with this variant (inert on the canvas). */
|
|
2085
|
+
declare function buildBuyNowRecipe(create: CompositeNodeFactory): CompositeNode;
|
|
2086
|
+
/** The bag button with its live count ($cart.count); it opens the page's cart drawer. */
|
|
2087
|
+
declare function buildCartButtonRecipe(create: CompositeNodeFactory): CompositeNode;
|
|
2088
|
+
/** The cart drawer: a Dialog at the end edge (a bottom sheet on a phone — shared CSS), filled from the PRICED cart. */
|
|
2089
|
+
declare function buildCartDrawerRecipe(create: CompositeNodeFactory): CompositeNode;
|
|
2090
|
+
/** The recipes the palette's Shop group offers, in its order. */
|
|
2091
|
+
declare enum ShopRecipe {
|
|
2092
|
+
Price = "price",
|
|
2093
|
+
Variants = "variants",
|
|
2094
|
+
Quantity = "quantity",
|
|
2095
|
+
Add = "add",
|
|
2096
|
+
BuyNow = "buyNow",
|
|
2097
|
+
CartButton = "cartButton",
|
|
2098
|
+
CartDrawer = "cartDrawer"
|
|
2099
|
+
}
|
|
2100
|
+
declare const SHOP_RECIPES: Readonly<Record<ShopRecipe, (create: CompositeNodeFactory) => CompositeNode>>;
|
|
2101
|
+
/** The recipe a site holds ONCE, as a global element after the page (the bag every page opens) — never in a section. */
|
|
2102
|
+
declare const SHOP_GLOBAL_RECIPES: ReadonlySet<ShopRecipe>;
|
|
2103
|
+
/** What a composed part binds by ROLE (shop-aware A-D2/A-D3 as amended by C-D7): a listing's price reads its ROW's
|
|
2104
|
+
* `@price` / `@compareAt` instead of the product page's chosen variant. The money pipe stays. */
|
|
2105
|
+
declare enum ShopBindTarget {
|
|
2106
|
+
Price = "price",
|
|
2107
|
+
CompareAt = "compareAt"
|
|
2108
|
+
}
|
|
2109
|
+
declare const SHOP_BINDS: Readonly<Record<ShopBindTarget, {
|
|
2110
|
+
recipe: ShopRecipe;
|
|
2111
|
+
role: ShopRole;
|
|
2112
|
+
prop: string;
|
|
2113
|
+
}>>;
|
|
2114
|
+
/** Bind one part of a stamped recipe to `source` + `path` (the composer's resolved role), replacing its slot binding and
|
|
2115
|
+
* keeping the money pipe. False when the recipe holds no such part. */
|
|
2116
|
+
declare function bindShopPart(root: CompositeNode, target: ShopBindTarget, source: string, path: string): boolean;
|
|
2117
|
+
|
|
2118
|
+
/**
|
|
2119
|
+
* THE SHOP RUNTIME (commerce E1c) — ONE copy, DOM only, for the builder canvas and the live site. It finds the shop parts
|
|
2120
|
+
* by their role classes inside a scope (the page), so it reads the markup both renderers write the same way, and it
|
|
2121
|
+
* never decides a price: every line, total and issue comes from the HOST's cart transport (the server's `priceCart` on
|
|
2122
|
+
* the live site — E1d; an in-memory simulation on the canvas), and `$variant` / `$cart` are published to the host's
|
|
2123
|
+
* context channel for the ordinary bindings (`$variant.price | money`, `$cart.count`).
|
|
2124
|
+
*
|
|
2125
|
+
* Templates: an option group, a value (chip or swatch) and a cart line are each ONE builder node, shown as the first
|
|
2126
|
+
* instance; the rest are copies stamped after it (`data-iox-shop-clone`), restamped only when the list changes.
|
|
2127
|
+
*/
|
|
2128
|
+
interface ShopHost {
|
|
2129
|
+
/** The cart: the engine's (E1d) on a live site, `simulatedCartTransport` on the builder canvas. */
|
|
2130
|
+
transport: CartTransport;
|
|
2131
|
+
/** The product an element belongs to (its row's, else the route's, else the page's first) — `productInScope`. */
|
|
2132
|
+
productFor: (el: Element) => StorefrontProduct | null;
|
|
2133
|
+
/** The page's language (money, words). */
|
|
2134
|
+
locale?: () => string | null | undefined;
|
|
2135
|
+
/** Write a shop slot into the host's context channel (`ContextStore.set`). */
|
|
2136
|
+
publish?: (slot: ShopSlot, value: unknown) => void;
|
|
2137
|
+
/** Open the page's cart drawer (the host's own dialog path: the engine's `openDialog`, the canvas twin). */
|
|
2138
|
+
openDrawer?: (drawer: HTMLElement) => void;
|
|
2139
|
+
/** Go to the fixed checkout route (`checkoutHref(orgLabel)`); the canvas simulates it. */
|
|
2140
|
+
goToCheckout?: () => void;
|
|
2141
|
+
/** A change the cart refused (words in the page language) — the host may toast it; it is announced either way. */
|
|
2142
|
+
onRefused?: (words: string, error: unknown) => void;
|
|
2143
|
+
/** The colours a value is drawn with when it is not a colour word itself (the canvas' sample glazes). */
|
|
2144
|
+
swatches?: (product: StorefrontProduct) => Readonly<Record<string, string>> | null;
|
|
2145
|
+
/** A copy was clicked: the canvas selects its template (the copy is display-only). */
|
|
2146
|
+
onCloneClick?: (template: HTMLElement) => void;
|
|
2147
|
+
/** Restamp when the markup under the scope changes (the builder canvas re-renders parts). */
|
|
2148
|
+
observe?: boolean;
|
|
2149
|
+
}
|
|
2150
|
+
declare class ShopRuntime {
|
|
2151
|
+
readonly scope: HTMLElement;
|
|
2152
|
+
private readonly host;
|
|
2153
|
+
private readonly products;
|
|
2154
|
+
private cart;
|
|
2155
|
+
private observer;
|
|
2156
|
+
private stampQueued;
|
|
2157
|
+
private stamping;
|
|
2158
|
+
private addedTimers;
|
|
2159
|
+
private pageProduct;
|
|
2160
|
+
private destroyed;
|
|
2161
|
+
/** What each slot last carried: an unchanged value is never published again (a host's binding re-render must not
|
|
2162
|
+
* wake the runtime into publishing the same thing for ever). */
|
|
2163
|
+
private readonly published;
|
|
2164
|
+
constructor(scope: HTMLElement, host: ShopHost);
|
|
2165
|
+
private get lang();
|
|
2166
|
+
/** The cart the runtime shows (the transport's last answer). */
|
|
2167
|
+
get view(): CartView;
|
|
2168
|
+
/** The variant an element's product has chosen, or null (no product, no full choice). */
|
|
2169
|
+
variantFor(el: Element): ProductVariantView | null;
|
|
2170
|
+
/** The quantity an element's product would add. */
|
|
2171
|
+
quantityFor(el: Element): number;
|
|
2172
|
+
/** Re-read every product and restamp (the host's data changed). */
|
|
2173
|
+
refresh(): void;
|
|
2174
|
+
/** Add the element's product — its chosen variant, its quantity — then say "Added ✓" in place and open the bag. */
|
|
2175
|
+
add(el: Element): Promise<CartView | null>;
|
|
2176
|
+
/** Buy now: add, then go straight to checkout. */
|
|
2177
|
+
buyNow(el: Element): Promise<boolean>;
|
|
2178
|
+
/** Open the page's cart drawer. False when the page has none. */
|
|
2179
|
+
openCart(): boolean;
|
|
2180
|
+
/** The transport answered: publish `$cart` and fill the cart parts. */
|
|
2181
|
+
setCart(view: CartView): void;
|
|
2182
|
+
destroy(): void;
|
|
2183
|
+
private stateFor;
|
|
2184
|
+
private variantOf;
|
|
2185
|
+
private boundsOf;
|
|
2186
|
+
private choose;
|
|
2187
|
+
private publishVariant;
|
|
2188
|
+
private publish;
|
|
2189
|
+
private queueStamp;
|
|
2190
|
+
/** Write every part's state into its markup. Idempotent; the observer is deaf while it runs. */
|
|
2191
|
+
stamp(): void;
|
|
2192
|
+
private stampPicker;
|
|
2193
|
+
private stampGroup;
|
|
2194
|
+
private attachValues;
|
|
2195
|
+
/** Past four values (T26): a native select, sold-out values disabled with their words. */
|
|
2196
|
+
private stampSelect;
|
|
2197
|
+
private stampQuantity;
|
|
2198
|
+
private stampCart;
|
|
2199
|
+
private stampLine;
|
|
2200
|
+
private markAdded;
|
|
2201
|
+
private refusalWords;
|
|
2202
|
+
private refuse;
|
|
2203
|
+
private changeLine;
|
|
2204
|
+
private readonly onClick;
|
|
2205
|
+
private readonly onChange;
|
|
2206
|
+
/** A copy is display-only on the canvas: a click on it (or a part inside it) selects the template's part. */
|
|
2207
|
+
private selectTemplateOf;
|
|
2208
|
+
private templateOf;
|
|
2209
|
+
}
|
|
2210
|
+
/** Attach the shop runtime to a page scope, unless one runs there already. */
|
|
2211
|
+
declare function attachShop(scope: HTMLElement, host: ShopHost): ShopRuntime;
|
|
2212
|
+
/** The shop runtime an element sits under, or null. */
|
|
2213
|
+
declare function shopRuntimeOf(el: Element | null | undefined): ShopRuntime | null;
|
|
2214
|
+
/** The shop actions (actions-core `SHOP_ACTION_TYPES`). */
|
|
2215
|
+
declare enum ShopActionType {
|
|
2216
|
+
AddToCart = "addToCart",
|
|
2217
|
+
StartCheckout = "startCheckout"
|
|
2218
|
+
}
|
|
2219
|
+
/** Run a shop action from the element that fired it (both interaction engines call this). False when no shop runs. */
|
|
2220
|
+
declare function runShopAction(el: Element, type: string): Promise<boolean>;
|
|
2221
|
+
|
|
2222
|
+
export { ACCORDION_BIND_PROP, ACCORDION_CONTENT_LIMIT, ACCORDION_DEFAULT_ONS, ACCORDION_ICONS, ACCORDION_ICON_GLYPH, ACCORDION_NEW_ITEM_WORDS, ACCORDION_WORDS, ACTIVATE_ON_ATTRIBUTE, ADDED_HOLD_MS, AccordionClass, AccordionDefaultOn, AccordionEditRefusal, AccordionIcon, AccordionKeyAction, AccordionRole, AccordionRuntime, BADGE_TONES, BADGE_TONE_ICONS, BadgeTone, CARD_LAYOUTS, CARD_LAYOUT_CUSTOM, CARD_PARTS, CARD_PART_ROLE, CARD_STACK_BREAKPOINT, CARD_WORDS, CAROUSEL_QUOTES, CART_EMPTY_ATTRIBUTE, CART_LINE_ATTRIBUTE, CART_TITLE_COUNT_ATTRIBUTE, CHIP_ICON, CHIP_STYLE, COLOUR_OPTION_NAMES, COMPOSITE_ATTRIBUTE, COMPOSITE_KIND_ROLES, COMPOSITE_ROLE_SPECS, COUNTER_COUNT, COUNTER_ENTRANCE, COUNTER_SAMPLE_WORDS, CardLayout, CardPart, CardRole, CarouselA11y, CompositeBehaviourTrait, CompositeItemAction, CompositeKind, DEFAULT_ON_ATTRIBUTE, DISCLOSURE_ITEM_KEY, DISCLOSURE_WORDS, DisclosureRole, EXCLUSIVE_KIND_ROLES, ExclusiveRuntime, ITEM_KEY_ATTRIBUTE, ITEM_OFF_EVENT, ITEM_ON_EVENT, ITEM_OPEN_STATE, LIGHTBOX_ARROWS_HIDE_AT, LIGHTBOX_LABEL, MARQUEE_DEFAULTS, MARQUEE_DEFAULT_SPEED_PX, MARQUEE_KEYFRAMES, MARQUEE_MAX_COPIES, MARQUEE_MIN_LOOP_S, MARQUEE_NODE_ATTRIBUTES, MARQUEE_NOSCRIPT_CSS, MARQUEE_PAUSE_GLYPH, MARQUEE_PLAY_GLYPH, MARQUEE_SAMPLE_WORDS, MARQUEE_SPEED_FACTOR, MARQUEE_WORDS, MULTIPLE_ATTRIBUTE, MarqueeAttribute, MarqueeDirection, MarqueeRole, MarqueeRuntime, MarqueeSpeed, MarqueeStyle, MarqueeTrait, NAMED_SWATCHES, NO_ELEMENT_STYLE, ON_ATTRIBUTE, ON_STATE, ORIENTATION_ATTRIBUTE, PILL_LABEL_STYLE, SCOPE_ATTRIBUTE, SEGMENTED_BADGE_TONE, SEGMENTED_BADGE_WORDS, SEGMENTED_BEHAVIOUR, SEGMENTED_MAX_OPTIONS, SEGMENTED_MIN_OPTIONS, SEGMENTED_NAME, SEGMENTED_NEW_OPTION_WORDS, SEGMENTED_WORDS, SHOP_ADDED_ATTRIBUTE, SHOP_BINDS, SHOP_CHIP_MAX, SHOP_CLONE_ATTRIBUTE, SHOP_GLOBAL_RECIPES, SHOP_HIDDEN_ATTRIBUTE, SHOP_LABELS, SHOP_LIVE_CLASS, SHOP_RECIPES, SHOP_RECIPE_WORDS, SHOP_ROLES, SHOP_SELECT_CLASS, SHOP_UNUSED_ATTRIBUTE, SLIDER_BAR_ORDER, SLIDER_NAME_TRAIT, SLIDER_PART_GLYPH, SLIDER_PART_ROLES, SLIDER_PLACEMENT_TRAIT, SLIDER_PLAY_GLYPH, SLIDER_SCROLL_PLAYS_TRAIT, SLIDER_SWAPPING_ATTRIBUTE, SLIDER_TEXT_ATTRIBUTE, SLIDER_TYPE, SLIDER_WORDS, SLIDE_CAPTION_TRAIT, SLIDE_TO_ROW, SLIDE_TYPE, SWIPER_THEME_COLOR, SceneRole, SegmentedEditRefusal, SegmentedRole, SegmentedTrait, ShopActionType, ShopBindTarget, ShopPickerKind, ShopRecipe, ShopRole, ShopRuntime, SliderFlag, SliderPlacement, SliderRole, StructureEdit, StructureRefusal, TABS_ACTIVATE_ONS, TABS_CONTENT_LIMIT, TABS_IMAGE_BIND_PROP, TABS_LABEL_BIND_PROP, TABS_NEW_TAB_WORDS, TABS_ORIENTATIONS, TABS_STACK_BREAKPOINT, TABS_TEXT_BIND_PROP, TABS_WORDS, TabsActivateOn, TabsBehaviourTrait, TabsEditRefusal, TabsOrientation, TabsRole, UNTIL_FOUND, acceptsRefusal, accordionAnswerOf, accordionBehaviour, accordionDomIds, accordionFocusIndex, accordionHeadingLevel, accordionItemAttributes, accordionItemLabel, accordionItemOf, accordionItemState, accordionItems, accordionKeyAction, accordionPanelAttributes, accordionPanelOf, accordionPartStyle, accordionQuestionOf, accordionRegionAttributes, accordionRemovalRefusal, accordionRootAttributes, accordionRootOf, accordionRootOfItem, accordionRuntimeOf, accordionScope, accordionToContent, accordionToManual, accordionTrackAttributes, accordionTriggerAttributes, accordionTriggerOf, addAccordionItem, addSegmentedOption, addTabPair, applyCardLayout, attachAccordionAt, attachAccordions, attachCarouselA11y, attachCompositeAt, attachExclusiveAt, attachMarquees, attachShop, attachSliderBar, badgeStyleId, badgeToneOf, bindShopPart, buildAccordionItem, buildAccordionRecipe, buildAddToCartRecipe, buildBadge, buildBuyNowRecipe, buildCardRecipe, buildCarouselRecipe, buildCartButtonRecipe, buildCartDrawerRecipe, buildChip, buildCompositeIcon, buildCounterRecipe, buildDisclosureRecipe, buildLightboxRecipe, buildMarqueeRecipe, buildPriceRecipe, buildQuantityRecipe, buildReadingBarRecipe, buildSegmentedOption, buildSegmentedRecipe, buildSliderPart, buildTabPair, buildTabsRecipe, buildVariantPickerRecipe, canOpenAtClickedItem, cardPartsOf, cardRootOf, cardTitleOf, carouselOf, clearLayerStyles, closeAccordionItem, closestAccordion, closestAccordionItem, closestExclusive, closestExclusiveItemPart, compositeItemOf, compositeItems, compositeKindOfRole, compositeRootOf, compositeRowKeys, compositeScopeId, detachAccordion, detectAccordionIcon, detectCardLayout, disclosureOpenByDefault, domSafeKey, exclusiveBehaviourOf, exclusiveDefaultOf, exclusiveItemLabel, exclusiveItemPartOf, exclusiveKindHasPanels, exclusiveKindOf, exclusiveLabelOf, exclusivePartAttributes, exclusiveRootAttributesOf, exclusiveRootHoldsTriggers, exclusiveRootOf, exclusiveRuntimeOf, exclusiveScopeFor, findByRole, hasLabelledRegion, hasSliderParts, headerBehaviourOfNode, initialAccordionOpen, isAccordionFromContent, isAccordionItemOn, isAccordionPart, isAccordionRoot, isAnyCompositeRoot, isCardLinked, isCardRoot, isCompositeItem, isCompositeItemOn, isCompositePanel, isCompositeRoot, isCompositeTrigger, isDisclosurePart, isDisclosureRoot, isExclusiveItemOn, isExclusiveItemPart, isExclusiveKind, isExclusiveList, isExclusivePanel, isExclusivePanels, isExclusiveRoot, isExclusiveTrigger, isExclusiveTriggerDisabled, isLockedPart, isMarqueeRoot, isPartOfExclusiveScope, isPillNode, isSegmentedPart, isSegmentedRoot, isShopRole, isSlider, isSliderPart, isTabsFromContent, isTabsPart, isTabsRoot, isToggleKind, itemOpenTriggerIds, lightboxSliderOf, lookMarqueeSpeed, makeCompositePart, manualTabKeys, marqueeCopyCount, marqueeLoopSeconds, marqueePartElement, marqueePauseAttributes, marqueePauseGlyph, marqueeRootAttributes, marqueeRootOf, marqueeSettings, marqueeWords, migrateSliderControls, moveAccordionItem, moveSegmentedOption, moveTabPair, needsSliderMigration, nextAccordionState, nextItemKey, nextSegmentedKey, nextTabKey, onAccordionItemState, onCompositeItemState, onExclusiveItemState, openAccordionItem, parentInComposite, pickAccordionAutoBinds, pickTabsAutoBinds, readLayerStyle, readProp, readStyle, removeFromComposite, removeSegmentedOption, removeTabPair, renameAccordionItem, renameSegmentedOption, renameTab, repeatSourceOf, rowIndexOf, rowItemKey, rowSourceOf, runCompositeItemAction, runShopAction, sameRepeatSource, segmentedAddRefusal, segmentedBadgeOf, segmentedDefaultOn, segmentedItemTriggerIds, segmentedKeyAction, segmentedKeys, segmentedLabel, segmentedOptionAttributes, segmentedOptionKey, segmentedOptionLabel, segmentedOptionLabelNodeOf, segmentedOptions, segmentedPartAttributes, segmentedRemovalRefusal, segmentedRootAttributes, segmentedRootAttributesOf, segmentedScopeFor, serializeDomAttributes, setAccordionBehaviour, setAccordionIcon, setBadgeTone, setCardLinked, setCardPart, setHeaderBehaviour, setMarqueeSettings, setSegmentedBadge, setSegmentedBehaviour, setSliderFlag, setSliderPlacement, setTabsBehaviour, shopPickerKind, shopRuntimeOf, shopSelector, shouldScrollToItem, slideIndexForRow, sliderCaptionOf, sliderCountText, sliderLiveRegion, sliderPart, sliderPartElement, sliderPauseAttributes, sliderPauseGlyph, sliderPlacementOf, sliderSlides, sliderWords, splitSliderChildren, structureRefusal, swatchFill, syncSliderParts, tabLabel, tabLabelNodeOf, tabListAttributes, tabPanelAttributes, tabPanelImageOf, tabPanelOf, tabPanelTextOf, tabPartKey, tabTriggerAttributes, tabTriggerOf, tabsBehaviour, tabsItemState, tabsItemTriggerIds, tabsKeyAction, tabsLabel, tabsListOf, tabsPanels, tabsPanelsOf, tabsPartAttributes, tabsPartnerOf, tabsRemovalRefusal, tabsRootAttributes, tabsScope, tabsScopeFor, tabsToContent, tabsToManual, tabsTriggers, variantGroupLabel, variantGroupNote, walkComposite, wantedSliderParts, writeLayerStyles, writeProp, writeStyles };
|
|
2223
|
+
export type { AccordionAutoBinds, AccordionBehaviour, AccordionDomIds, AccordionItemState, AccordionOptions, AccordionRuntimeOptions, AccordionScope, AccordionWords, BarSwiper, BaselineStyles, CardEditOptions, CardLayoutResult, CardLayoutState, CardOptions, CardPartChange, CardWords, CarouselA11yOptions, CarouselOptions, CarouselQuote, CarouselSwiper, CompositeBinding, CompositeKindRoles, CompositeLayer, CompositeNode, CompositeNodeFactory, CompositeNodeSpec, CompositeRoleSpec, CompositeRuntime, CompositeTrait, ContentFieldLike, CounterWords, DisclosureOptions, DisclosureWords, DomAttributes, ExclusiveCompositeKind, ExclusiveKindRoles, ExclusiveRuntimeOptions, ExclusiveScope, LegacySliderLook, LightboxOptions, MarqueeRecipeOptions, MarqueeRuntimeOptions, MarqueeSettings, MarqueeWords, PillOptions, RepeatSource, SegmentedOptionWords, SegmentedOptions, ShopHost, SliderPartsChange, SliderWords, TabPair, TabWords, TabsAutoBinds, TabsBehaviour, TabsItemState, TabsOptions, TabsScope, ToggleCompositeKind };
|