@vectoriox/iox-ui 5.93.0 → 5.95.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.
Files changed (46) hide show
  1. package/actions-core/index.d.ts +7 -2
  2. package/commerce-core/index.d.ts +863 -3
  3. package/composite-core/index.d.ts +290 -2
  4. package/design-core/index.d.ts +1049 -105
  5. package/fesm2022/vectoriox-iox-ui-actions-core.mjs +15 -4
  6. package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
  7. package/fesm2022/vectoriox-iox-ui-commerce-core.mjs +1509 -5
  8. package/fesm2022/vectoriox-iox-ui-commerce-core.mjs.map +1 -1
  9. package/fesm2022/vectoriox-iox-ui-composite-core.mjs +1170 -177
  10. package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
  11. package/fesm2022/vectoriox-iox-ui-design-core.mjs +1147 -43
  12. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  13. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +2 -2
  14. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  15. package/fesm2022/vectoriox-iox-ui.mjs +8 -1
  16. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  17. package/generation-core/index.d.ts +2 -2
  18. package/index.d.ts +2 -0
  19. package/package.json +1 -1
  20. package/src/actions-core/action.model.ts +1 -1
  21. package/src/actions-core/element-actions.ts +17 -3
  22. package/src/commerce-core/cart-transport.ts +211 -0
  23. package/src/commerce-core/cart.ts +305 -0
  24. package/src/commerce-core/catalog.ts +42 -0
  25. package/src/commerce-core/checkout.ts +202 -0
  26. package/src/commerce-core/decimal.ts +28 -0
  27. package/src/commerce-core/labels.ts +29 -0
  28. package/src/commerce-core/limits.ts +9 -0
  29. package/src/commerce-core/money-error.ts +1 -0
  30. package/src/commerce-core/order-snapshot.ts +151 -0
  31. package/src/commerce-core/orders.ts +172 -0
  32. package/src/commerce-core/payments.ts +196 -0
  33. package/src/commerce-core/public-api.ts +19 -4
  34. package/src/commerce-core/quantity.ts +56 -0
  35. package/src/commerce-core/shipping.ts +168 -0
  36. package/src/commerce-core/shop-display.ts +117 -0
  37. package/src/commerce-core/text.ts +13 -0
  38. package/src/commerce-core/variants.ts +296 -0
  39. package/src/commerce-core/vat.ts +38 -0
  40. package/src/composite-core/exclusive-runtime.ts +20 -7
  41. package/src/composite-core/public-api.ts +2 -0
  42. package/src/composite-core/shop-runtime.ts +626 -0
  43. package/src/composite-core/shop.ts +433 -0
  44. package/src/design-core/flavor-spec.generated.ts +1147 -43
  45. package/src/generation-core/site-spec.generated.ts +2 -2
  46. 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,286 @@ 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
- export { ACCORDION_BIND_PROP, ACCORDION_CONTENT_LIMIT, ACCORDION_DEFAULT_ONS, ACCORDION_ICONS, ACCORDION_ICON_GLYPH, ACCORDION_NEW_ITEM_WORDS, ACCORDION_WORDS, ACTIVATE_ON_ATTRIBUTE, 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, CHIP_ICON, CHIP_STYLE, 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, 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, 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, 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, attachSliderBar, badgeStyleId, badgeToneOf, buildAccordionItem, buildAccordionRecipe, buildBadge, buildCardRecipe, buildCarouselRecipe, buildChip, buildCompositeIcon, buildCounterRecipe, buildDisclosureRecipe, buildLightboxRecipe, buildMarqueeRecipe, buildReadingBarRecipe, buildSegmentedOption, buildSegmentedRecipe, buildSliderPart, buildTabPair, buildTabsRecipe, 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, isLockedPart, isMarqueeRoot, isPartOfExclusiveScope, isPillNode, isSegmentedPart, isSegmentedRoot, 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, 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, shouldScrollToItem, slideIndexForRow, sliderCaptionOf, sliderCountText, sliderLiveRegion, sliderPart, sliderPartElement, sliderPauseAttributes, sliderPauseGlyph, sliderPlacementOf, sliderSlides, sliderWords, splitSliderChildren, structureRefusal, 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, walkComposite, wantedSliderParts, writeLayerStyles, writeProp, writeStyles };
1919
- 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, SliderPartsChange, SliderWords, TabPair, TabWords, TabsAutoBinds, TabsBehaviour, TabsItemState, TabsOptions, TabsScope, ToggleCompositeKind };
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
+
2102
+ /**
2103
+ * THE SHOP RUNTIME (commerce E1c) — ONE copy, DOM only, for the builder canvas and the live site. It finds the shop parts
2104
+ * by their role classes inside a scope (the page), so it reads the markup both renderers write the same way, and it
2105
+ * never decides a price: every line, total and issue comes from the HOST's cart transport (the server's `priceCart` on
2106
+ * the live site — E1d; an in-memory simulation on the canvas), and `$variant` / `$cart` are published to the host's
2107
+ * context channel for the ordinary bindings (`$variant.price | money`, `$cart.count`).
2108
+ *
2109
+ * Templates: an option group, a value (chip or swatch) and a cart line are each ONE builder node, shown as the first
2110
+ * instance; the rest are copies stamped after it (`data-iox-shop-clone`), restamped only when the list changes.
2111
+ */
2112
+ interface ShopHost {
2113
+ /** The cart: the engine's (E1d) on a live site, `simulatedCartTransport` on the builder canvas. */
2114
+ transport: CartTransport;
2115
+ /** The product an element belongs to (its row's, else the route's, else the page's first) — `productInScope`. */
2116
+ productFor: (el: Element) => StorefrontProduct | null;
2117
+ /** The page's language (money, words). */
2118
+ locale?: () => string | null | undefined;
2119
+ /** Write a shop slot into the host's context channel (`ContextStore.set`). */
2120
+ publish?: (slot: ShopSlot, value: unknown) => void;
2121
+ /** Open the page's cart drawer (the host's own dialog path: the engine's `openDialog`, the canvas twin). */
2122
+ openDrawer?: (drawer: HTMLElement) => void;
2123
+ /** Go to the fixed checkout route (`checkoutHref(orgLabel)`); the canvas simulates it. */
2124
+ goToCheckout?: () => void;
2125
+ /** A change the cart refused (words in the page language) — the host may toast it; it is announced either way. */
2126
+ onRefused?: (words: string, error: unknown) => void;
2127
+ /** The colours a value is drawn with when it is not a colour word itself (the canvas' sample glazes). */
2128
+ swatches?: (product: StorefrontProduct) => Readonly<Record<string, string>> | null;
2129
+ /** A copy was clicked: the canvas selects its template (the copy is display-only). */
2130
+ onCloneClick?: (template: HTMLElement) => void;
2131
+ /** Restamp when the markup under the scope changes (the builder canvas re-renders parts). */
2132
+ observe?: boolean;
2133
+ }
2134
+ declare class ShopRuntime {
2135
+ readonly scope: HTMLElement;
2136
+ private readonly host;
2137
+ private readonly products;
2138
+ private cart;
2139
+ private observer;
2140
+ private stampQueued;
2141
+ private stamping;
2142
+ private addedTimers;
2143
+ private pageProduct;
2144
+ private destroyed;
2145
+ /** What each slot last carried: an unchanged value is never published again (a host's binding re-render must not
2146
+ * wake the runtime into publishing the same thing for ever). */
2147
+ private readonly published;
2148
+ constructor(scope: HTMLElement, host: ShopHost);
2149
+ private get lang();
2150
+ /** The cart the runtime shows (the transport's last answer). */
2151
+ get view(): CartView;
2152
+ /** The variant an element's product has chosen, or null (no product, no full choice). */
2153
+ variantFor(el: Element): ProductVariantView | null;
2154
+ /** The quantity an element's product would add. */
2155
+ quantityFor(el: Element): number;
2156
+ /** Re-read every product and restamp (the host's data changed). */
2157
+ refresh(): void;
2158
+ /** Add the element's product — its chosen variant, its quantity — then say "Added ✓" in place and open the bag. */
2159
+ add(el: Element): Promise<CartView | null>;
2160
+ /** Buy now: add, then go straight to checkout. */
2161
+ buyNow(el: Element): Promise<boolean>;
2162
+ /** Open the page's cart drawer. False when the page has none. */
2163
+ openCart(): boolean;
2164
+ /** The transport answered: publish `$cart` and fill the cart parts. */
2165
+ setCart(view: CartView): void;
2166
+ destroy(): void;
2167
+ private stateFor;
2168
+ private variantOf;
2169
+ private boundsOf;
2170
+ private choose;
2171
+ private publishVariant;
2172
+ private publish;
2173
+ private queueStamp;
2174
+ /** Write every part's state into its markup. Idempotent; the observer is deaf while it runs. */
2175
+ stamp(): void;
2176
+ private stampPicker;
2177
+ private stampGroup;
2178
+ private attachValues;
2179
+ /** Past four values (T26): a native select, sold-out values disabled with their words. */
2180
+ private stampSelect;
2181
+ private stampQuantity;
2182
+ private stampCart;
2183
+ private stampLine;
2184
+ private markAdded;
2185
+ private refusalWords;
2186
+ private refuse;
2187
+ private changeLine;
2188
+ private readonly onClick;
2189
+ private readonly onChange;
2190
+ /** A copy is display-only on the canvas: a click on it (or a part inside it) selects the template's part. */
2191
+ private selectTemplateOf;
2192
+ private templateOf;
2193
+ }
2194
+ /** Attach the shop runtime to a page scope, unless one runs there already. */
2195
+ declare function attachShop(scope: HTMLElement, host: ShopHost): ShopRuntime;
2196
+ /** The shop runtime an element sits under, or null. */
2197
+ declare function shopRuntimeOf(el: Element | null | undefined): ShopRuntime | null;
2198
+ /** The shop actions (actions-core `SHOP_ACTION_TYPES`). */
2199
+ declare enum ShopActionType {
2200
+ AddToCart = "addToCart",
2201
+ StartCheckout = "startCheckout"
2202
+ }
2203
+ /** Run a shop action from the element that fired it (both interaction engines call this). False when no shop runs. */
2204
+ declare function runShopAction(el: Element, type: string): Promise<boolean>;
2205
+
2206
+ 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_CHIP_MAX, SHOP_CLONE_ATTRIBUTE, 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, 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, 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 };
2207
+ 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 };