@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.
Files changed (33) hide show
  1. package/actions-core/index.d.ts +7 -2
  2. package/commerce-core/index.d.ts +312 -2
  3. package/composite-core/index.d.ts +306 -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 +527 -6
  8. package/fesm2022/vectoriox-iox-ui-commerce-core.mjs.map +1 -1
  9. package/fesm2022/vectoriox-iox-ui-composite-core.mjs +1193 -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/public-api.ts +4 -0
  24. package/src/commerce-core/quantity.ts +56 -0
  25. package/src/commerce-core/shop-display.ts +117 -0
  26. package/src/commerce-core/variants.ts +296 -0
  27. package/src/composite-core/exclusive-runtime.ts +20 -7
  28. package/src/composite-core/public-api.ts +2 -0
  29. package/src/composite-core/shop-runtime.ts +626 -0
  30. package/src/composite-core/shop.ts +458 -0
  31. package/src/design-core/flavor-spec.generated.ts +1147 -43
  32. package/src/generation-core/site-spec.generated.ts +2 -2
  33. package/styles/iox-design.css +95 -0
@@ -10,7 +10,7 @@ import { CompositeItemAction } from '@vectoriox/iox-ui/composite-core';
10
10
  /** How a step executes — decides which editor fields appear (timing only for `animated`). */
11
11
  type ActionKind = 'animated' | 'instant' | 'server';
12
12
  /** Picker grouping. Flat lists die at ~10 entries; the group is data, never a second list. */
13
- type ActionGroup = 'motion' | 'visibility' | 'navigate' | 'dialog' | 'popover' | 'notice' | 'item' | 'form' | 'data' | 'consent' | 'service';
13
+ type ActionGroup = 'motion' | 'visibility' | 'navigate' | 'dialog' | 'popover' | 'notice' | 'item' | 'form' | 'data' | 'consent' | 'shop' | 'service';
14
14
  /**
15
15
  * What a step does inside the live builder canvas (the canvas RUNS interactions):
16
16
  * `run` for real (open the dialog), `simulate` announce-only (navigate), `inert` with a
@@ -112,8 +112,13 @@ declare const SCROLL_PROGRESS_TRIGGER = "scrollProgress";
112
112
  * fires on its own — when it comes into view, or with the page in the first screen behind an entrance. Under a click or a
113
113
  * hover it would stand at its start value until pressed; it is never armed there, and never offered.
114
114
  */
115
+ /** The plan feature selling sits behind (C-D18: the control plane's `features.shop`). */
116
+ declare const SHOP_ENTITLEMENT = "shop";
115
117
  declare const COUNT_UP_TRIGGERS: ReadonlyArray<string>;
116
118
  declare const ELEMENT_ACTION_DESCRIPTORS: readonly ActionDescriptor[];
119
+ /** The shop actions' dispatch set (commerce E1c) — the engines branch on it beside DIALOG / BEHAVIOUR and hand the action
120
+ * to composite-core `runShopAction`, which reads the product, the variant and the quantity around the element. */
121
+ declare const SHOP_ACTION_TYPES: ReadonlySet<string>;
117
122
  /** The A2 server executors' dispatch set — the live engine POSTs these to the public actions
118
123
  * route; the canvas simulates them (a server action never runs from the ADMIN's browser). */
119
124
  declare const SERVER_ELEMENT_ACTION_TYPES: ReadonlySet<string>;
@@ -299,5 +304,5 @@ interface FocusableSheet {
299
304
  */
300
305
  declare function focusDialogSheet(dialog: FocusableSheet | null | undefined): boolean;
301
306
 
302
- export { BEHAVIOUR_ACTION_TYPES, CONSENT_ACTION_TYPES, COUNT_UP_TRIGGERS, DIALOG_ACTION_TYPE_SET, DIALOG_CLOSING_ATTRIBUTE, DIALOG_EXIT_TIMEOUT_MS, DIALOG_OPENER_ACTION_TYPES, DIALOG_OPENER_TRIGGER, DIALOG_SELECTOR, ELEMENT_ACTION_DESCRIPTORS, ELEMENT_ACTION_GROUP_ORDER, FORM_SUBMIT_ACTION_DESCRIPTORS, ITEM_ACTION_TYPES, OpenerAttribute, POPOVER_ACTION_TYPE_SET, POPOVER_NODE_TYPE, POPOVER_OPENER_ACTION_TYPES, SCROLL_PROGRESS_TRIGGER, SERVER_ELEMENT_ACTION_TYPES, TOAST_ACTION_TYPES, actionOfferedUnder, addableActions, cancelExit, closeDialogAnimated, dialogDomId, dialogOpenerAttributes, dialogOpenersSelector, dialogTogglesClosed, focusDialogSheet, groupedElementActions, isExiting, itemActionOf, nodeIdOfDialogDomId, nodeIdOfPopoverDomId, openedDialogId, openedPopoverId, openedTargetId, opensAtClickedItem, popoverDomId, popoverOpenerAttributes, popoverOpenersSelector, resolveActionAvailability, runExitMotion };
307
+ export { BEHAVIOUR_ACTION_TYPES, CONSENT_ACTION_TYPES, COUNT_UP_TRIGGERS, DIALOG_ACTION_TYPE_SET, DIALOG_CLOSING_ATTRIBUTE, DIALOG_EXIT_TIMEOUT_MS, DIALOG_OPENER_ACTION_TYPES, DIALOG_OPENER_TRIGGER, DIALOG_SELECTOR, ELEMENT_ACTION_DESCRIPTORS, ELEMENT_ACTION_GROUP_ORDER, FORM_SUBMIT_ACTION_DESCRIPTORS, ITEM_ACTION_TYPES, OpenerAttribute, POPOVER_ACTION_TYPE_SET, POPOVER_NODE_TYPE, POPOVER_OPENER_ACTION_TYPES, SCROLL_PROGRESS_TRIGGER, SERVER_ELEMENT_ACTION_TYPES, SHOP_ACTION_TYPES, SHOP_ENTITLEMENT, TOAST_ACTION_TYPES, actionOfferedUnder, addableActions, cancelExit, closeDialogAnimated, dialogDomId, dialogOpenerAttributes, dialogOpenersSelector, dialogTogglesClosed, focusDialogSheet, groupedElementActions, isExiting, itemActionOf, nodeIdOfDialogDomId, nodeIdOfPopoverDomId, openedDialogId, openedPopoverId, openedTargetId, opensAtClickedItem, popoverDomId, popoverOpenerAttributes, popoverOpenersSelector, resolveActionAvailability, runExitMotion };
303
308
  export type { ActionAvailability, ActionAvailabilityContext, ActionAvailabilityState, ActionDescriptor, ActionGroup, ActionKind, ActionParamSpec, ActionTargetSpec, BuilderBehaviour, DialogElementLike, ExitAnimationLike, ExitMotionElement, ExitMotionOptions, FocusableSheet, OpenerActionLike, OpenerInteractionLike, OpenerNodeLike };
@@ -634,5 +634,315 @@ type OrderSnapshotResult = {
634
634
  /** Freezes what an order stores (lines, unit prices, totals, VAT, currency, delivery, payment, buyer) — or says why it cannot. */
635
635
  declare function orderSnapshot(pricedCart: PricedCart, payment: PaymentMethodConfig, buyer: OrderBuyer): OrderSnapshotResult;
636
636
 
637
- export { Availability, CART_ISSUE_LABELS, CHECKOUT_GATE_RULES, CHECKOUT_STEPS, CHECKOUT_STEP_LABELS, CURRENCY_CODES, CURRENCY_EXPONENTS, CartIssueCode, CheckoutGateArea, CheckoutGateCode, CheckoutStep, CommerceLanguage, CurrencyCode, DeliveryFit, FINAL_ORDER_STATES, LegalPage, MAX_CART_AMOUNT, MAX_CART_LINES, MAX_LINE_QUANTITY, MAX_VAT_PERCENT, MoneyError, MoneyErrorCode, ORDER_STATE_LABELS, ORDER_STOCK_HOLD, ORDER_TRANSITIONS, OrderActor, OrderEvent, OrderRefusal, OrderSnapshotRefusal, OrderState, PAYMENT_FIELD_LABELS, PAYMENT_METHODS, PaymentChannel, PaymentField, PaymentMethodKind, PaymentProvider, SHIPPING_KINDS, STOCK_EFFECTS, STOCK_RESERVATION_MINUTES, ShippingField, ShippingMethodKind, StockEffect, StockHold, VAT_PERCENT_MAX_DECIMALS, addMoney, availableShippingMethods, cartOf, catalogKey, checkoutGate, commerceLanguage, currencyExponent, formatMoney, furthestStep, includedVat, isCurrencyCode, isMoney, isPaymentMethodKind, isShippingMethodKind, isVatPercent, labelIn, majorToMinor, mergeCarts, migrateMajorPrice, minorToMajor, money, nextOrderState, openingOrderState, orderSnapshot, paymentChannelOf, paymentInstructions, paymentMethodProblems, paymentMethodReady, percentOf, priceCart, quoteShipping, reservationExpiresAt, sellableQuantity, shippingMethodProblems, shippingMethodReady, shippingNeedsAddress, stockEffect, subtractMoney, timesMoney, usablePaymentMethods };
638
- export type { BusinessIdentity, Cart, CartIssue, CartLine, CatalogEntry, CheckoutGateFacts, CheckoutGateRefusal, CheckoutGateResult, CommerceLabel, Money, OrderBuyer, OrderMove, OrderSnapshot, OrderSnapshotLine, OrderSnapshotResult, OrderTransition, PaymentMethodConfig, PostalAddress, PricedCart, PricedLine, PricingChoice, ShippingCart, ShippingGoods, ShippingMethod, ShippingQuote, StudioCommerce };
637
+ /**
638
+ * A product's OPTIONS and its VARIANTS as the storefront serves them (iox-cms `storefront-projection.ts`), read into
639
+ * what a product page needs (commerce plan §3i, trap T26): which values each option offers, which of them can still be
640
+ * bought given what is already chosen, and the variant a full choice names.
641
+ *
642
+ * A stored variant has no option map, only a flat NAME — the option values in option order joined by `-` (the admin's
643
+ * `product.component.ts` `generateCombinations`: "Red-M"). A name is matched against every combination of the options'
644
+ * values, never split on `-`, so a value that holds a `-` ("Off-white") still reads.
645
+ */
646
+ declare const VARIANT_NAME_SEPARATOR = "-";
647
+ /** The one variant row a product with no options keeps (iox-cms `DEFAULT_VARIANT_NAME`). */
648
+ declare const DEFAULT_VARIANT_NAME = "Default";
649
+ interface ProductOption {
650
+ name: string;
651
+ values: string[];
652
+ }
653
+ /** One variant row as the storefront serves it: prices in MAJOR units of the product's `currency`. */
654
+ interface StorefrontVariant {
655
+ _id?: string;
656
+ name?: string;
657
+ enable?: boolean;
658
+ image?: string | null;
659
+ price?: number | string | null;
660
+ compareat?: number | string | null;
661
+ availability?: string | null;
662
+ }
663
+ /** A product as the storefront serves it (the allowlist in iox-cms `STOREFRONT_FIELDS`). */
664
+ interface StorefrontProduct {
665
+ _id?: string;
666
+ title?: string;
667
+ slug?: string;
668
+ mainImage?: string | null;
669
+ productVariants?: boolean;
670
+ pricing?: {
671
+ price?: number | string | null;
672
+ compareat?: number | string | null;
673
+ } | null;
674
+ options?: ReadonlyArray<{
675
+ name?: string;
676
+ values?: ReadonlyArray<unknown>;
677
+ }> | null;
678
+ variants?: ReadonlyArray<StorefrontVariant> | null;
679
+ currency?: string | null;
680
+ availability?: string | null;
681
+ }
682
+ /** Option name → the value chosen. */
683
+ type VariantChoice = Readonly<Record<string, string>>;
684
+ /** One variant, read: its id (null for a product with no variant row), its choice, its money and whether it sells. */
685
+ interface ProductVariantView {
686
+ variantId: string | null;
687
+ name: string | null;
688
+ choice: VariantChoice;
689
+ price: Money | null;
690
+ /** Only when it is above the price (shown struck through). */
691
+ compareAt: Money | null;
692
+ image: string | null;
693
+ availability: Availability;
694
+ /** The variant's own switch (a product with no options: true). */
695
+ enabled: boolean;
696
+ /** Can be put in a cart: switched on, priced, not `out`. */
697
+ sellable: boolean;
698
+ }
699
+ interface OptionValueState {
700
+ value: string;
701
+ /** Some sellable variant has this value, given the choices of the options BEFORE this one. */
702
+ available: boolean;
703
+ selected: boolean;
704
+ }
705
+ interface OptionState {
706
+ name: string;
707
+ values: OptionValueState[];
708
+ }
709
+ /** True for something the storefront could have served as a product: a title and a price or variants. */
710
+ declare function isStorefrontProduct(value: unknown): value is StorefrontProduct;
711
+ /** The product's currency, or null when it names none we know (a price is then never shown — never guessed). */
712
+ declare function productCurrency(product: StorefrontProduct | null | undefined): CurrencyCode | null;
713
+ /** The options a product offers, cleaned: named, each value once, no empty value. None when it has no variants. */
714
+ declare function productOptions(product: StorefrontProduct | null | undefined): ProductOption[];
715
+ /** The choice a stored variant's flat name stands for, or null when no combination of the options writes it. */
716
+ declare function variantChoiceOf(variant: StorefrontVariant | null | undefined, options: ReadonlyArray<ProductOption>): VariantChoice | null;
717
+ /** A stored major-unit price as Money, or null (no price, a currency we do not know, a value that is no price). */
718
+ declare function storefrontMoney(value: unknown, currency: CurrencyCode | null): Money | null;
719
+ /**
720
+ * Every variant of a product, read. A product with no options is ONE view: its Default row's id (or null when it has
721
+ * no row) and the product's own price. A variant whose name matches no combination of the options is left out — the
722
+ * page cannot offer what it cannot name.
723
+ */
724
+ declare function productVariants(product: StorefrontProduct | null | undefined): ProductVariantView[];
725
+ /** The variant a FULL choice names, or null (a choice that misses an option, or names no stored variant). */
726
+ declare function findVariant(options: ReadonlyArray<ProductOption>, variants: ReadonlyArray<ProductVariantView>, choice: VariantChoice): ProductVariantView | null;
727
+ /**
728
+ * What each option offers now. Availability CASCADES in option order (the way a buyer reads the page, top to bottom):
729
+ * a value of the first option is available when ANY sellable variant has it; a value of a later option, when a
730
+ * sellable variant has it together with the values chosen for the options before it. So a buyer can always change an
731
+ * earlier option and the later ones follow (`chooseValue`) — never stuck behind a combination that is sold out.
732
+ */
733
+ declare function optionValueStates(options: ReadonlyArray<ProductOption>, variants: ReadonlyArray<ProductVariantView>, choice: VariantChoice): OptionState[];
734
+ /** The choice a page opens with: the first sellable variant's, else the first value of every option. */
735
+ declare function defaultChoice(options: ReadonlyArray<ProductOption>, variants: ReadonlyArray<ProductVariantView>): VariantChoice;
736
+ /**
737
+ * The buyer picks `value` for option `name`. The options AFTER it keep their value while it is still available after
738
+ * the change, else move to their first available value (else keep it — the page then says the combination is sold out).
739
+ * An unknown option or value changes nothing.
740
+ */
741
+ declare function chooseValue(options: ReadonlyArray<ProductOption>, variants: ReadonlyArray<ProductVariantView>, choice: VariantChoice, name: string, value: string): VariantChoice;
742
+ /** The catalog entries a storefront product sells (one per variant, or one for a product with no options) — what
743
+ * `priceCart` reads where only the storefront is known (the builder canvas's simulated cart). iox-cms builds its own
744
+ * from the stored row, with the stock COUNT. */
745
+ declare function storefrontCatalog(product: StorefrontProduct | null | undefined): CatalogEntry[];
746
+ /** The words a chosen variant is shown with in a cart line ("Sand · 32 cm"). */
747
+ declare function variantWords(choice: VariantChoice, options: ReadonlyArray<ProductOption>): string;
748
+ /**
749
+ * The product an element is about, the SAME rule on the builder canvas and the live site: the repeated row it sits in
750
+ * when that row is a product (a card in a product list), else the page's route item, else the first product the page's
751
+ * data holds (a product page bound to one product). Null when the page has none.
752
+ */
753
+ declare function productInScope(rowItem: unknown, data: Readonly<Record<string, unknown>> | null | undefined): StorefrontProduct | null;
754
+
755
+ /**
756
+ * The quantity a buyer may ask for — the stepper on a product page and on every cart line (commerce plan §3i). Whole
757
+ * numbers only, the forms-core number rule: anything that is not a whole number reads as the least. The most is the
758
+ * one-line cap (`MAX_LINE_QUANTITY`), lowered to the count when the count is known (iox-cms) — the storefront knows only
759
+ * a word, so it caps at the line cap and the server clamps (`priceCart` QuantityClamped).
760
+ */
761
+ declare const MIN_LINE_QUANTITY = 1;
762
+ interface QuantityBounds {
763
+ min: number;
764
+ /** Below `min` (0) when nothing can be bought: the stepper is off. */
765
+ max: number;
766
+ }
767
+ declare enum QuantityStep {
768
+ Down = -1,
769
+ Up = 1
770
+ }
771
+ /** What a stepper allows for a unit with this count / word. `out` (or a count of 0) allows nothing. */
772
+ declare function quantityBounds(unit?: {
773
+ stock?: number | null;
774
+ availability?: string | null;
775
+ } | null): QuantityBounds;
776
+ /** True when the bounds allow buying at all. */
777
+ declare function canBuy(bounds: QuantityBounds): boolean;
778
+ /** A quantity held within the bounds; not a whole number → the least. */
779
+ declare function clampQuantity(value: unknown, bounds: QuantityBounds): number;
780
+ /** True when a step in `direction` stays within the bounds. */
781
+ declare function canStep(value: number, direction: QuantityStep, bounds: QuantityBounds): boolean;
782
+ /** One step, held within the bounds. */
783
+ declare function stepQuantity(value: unknown, direction: QuantityStep, bounds: QuantityBounds): number;
784
+
785
+ /**
786
+ * The CART TRANSPORT CONTRACT (commerce plan §3d, C-D16) — what a host provides so the builder's shop parts can show and
787
+ * change a visitor's cart. The parts own no HTTP, exactly like a form (forms-core `transport.ts`, the §6b lesson: a
788
+ * part that emits and a host that never answers ships a dead button behind green tests):
789
+ *
790
+ * - the LIVE SITE (the engine, commerce E1d) implements it over iox-cms's hardened cart routes (`cartEndpointPath`): the
791
+ * server prices every read with `priceCart` and the transport hands back its `CartView` — a browser never computes a
792
+ * price it charges (trap T1);
793
+ * - the BUILDER CANVAS uses `simulatedCartTransport`: an in-memory cart over sample data, never written anywhere
794
+ * (trap T8: the canvas never writes a cart).
795
+ *
796
+ * Every method resolves with the WHOLE cart as it is now, or rejects with a `CartTransportError`.
797
+ */
798
+ /** One line of the cart a visitor sees: the server's priced line + the id its routes know it by + what it may hold. */
799
+ interface CartViewLine extends PricedLine {
800
+ lineId: string;
801
+ /** The most this line may hold (the stepper's top). */
802
+ maxQuantity: number;
803
+ }
804
+ interface CartView {
805
+ /** null only for a cart that has never been priced (the no-transport stub). */
806
+ currency: CurrencyCode | null;
807
+ lines: CartViewLine[];
808
+ /** How many units — the cart button's badge (`$cart.count`). */
809
+ count: number;
810
+ empty: boolean;
811
+ subtotal: Money | null;
812
+ total: Money | null;
813
+ vat: Money | null;
814
+ vatPercent: number;
815
+ issues: CartIssue[];
816
+ /** What is still missing for a free-delivery method, when the studio offers one (the drawer's note); else null. */
817
+ freeShippingRemaining: Money | null;
818
+ }
819
+ interface AddToCartRequest {
820
+ productId: string;
821
+ variantId?: string | null;
822
+ quantity: number;
823
+ }
824
+ interface CartTransport {
825
+ read(): Promise<CartView>;
826
+ add(request: AddToCartRequest): Promise<CartView>;
827
+ setQuantity(lineId: string, quantity: number): Promise<CartView>;
828
+ remove(lineId: string): Promise<CartView>;
829
+ }
830
+ declare enum CartTransportErrorCode {
831
+ /** No cart on this host (the engine before E1d, a site with no shop). */
832
+ Unavailable = "unavailable",
833
+ /** The server said no (a product no longer sold, a rate limit). */
834
+ Refused = "refused",
835
+ /** The call never reached the server. */
836
+ Network = "network"
837
+ }
838
+ declare const CART_TRANSPORT_ERROR_LABELS: Readonly<Record<CartTransportErrorCode, CommerceLabel>>;
839
+ declare class CartTransportError extends Error {
840
+ readonly code: CartTransportErrorCode;
841
+ constructor(code: CartTransportErrorCode, message?: string);
842
+ }
843
+ /** A line's id when the host has none of its own: the product and the variant, URL-safe. */
844
+ declare function cartLineId(productId: string, variantId?: string | null): string;
845
+ /** The public cart routes (§3d) — ROOT-relative, like the forms submit path (a relative path under the org's
846
+ * `<base href>` reaches the engine, never iox-cms). `lineId` addresses one line. */
847
+ declare function cartEndpointPath(orgId: string, lineId?: string | null): string;
848
+ /** The fixed checkout route (C-D3), relative to the site's `<base href="/<orgLabel>/">`. */
849
+ declare const CHECKOUT_PATH = "checkout";
850
+ /** The checkout's href: `/<orgLabel>/checkout` under a label, else `/checkout`. */
851
+ declare function checkoutHref(orgLabel?: string | null): string;
852
+ /** A cart with nothing in it. */
853
+ declare function emptyCartView(currency?: CurrencyCode | null): CartView;
854
+ /** The view of a priced cart. `lineIdOf` names each line the way the host's routes do (default `cartLineId`);
855
+ * `maxOf` says how many a line may hold (default the line cap). */
856
+ declare function cartViewOf(priced: PricedCart, options?: {
857
+ lineIdOf?: (line: PricedLine) => string;
858
+ maxOf?: (line: PricedLine) => number;
859
+ freeShippingRemaining?: Money | null;
860
+ }): CartView;
861
+ /** The cart iox-cms's public routes answer (E1b, `shop.md` "The cart"): the priced cart, each line under its own id
862
+ * (`ln_…`), and the unit count. */
863
+ interface SiteCartView extends PricedCart {
864
+ lines: Array<PricedLine & {
865
+ id: string;
866
+ }>;
867
+ itemCount?: number;
868
+ }
869
+ /** iox-cms's answer as the view the parts paint — the server's line ids, its prices untouched. */
870
+ declare function siteCartView(site: SiteCartView, freeShippingRemaining?: Money | null): CartView;
871
+ /** How a refused cart call is said: no cart service (501, 503) or a shop off the plan (403) is Unavailable, a
872
+ * status the server chose is Refused, anything that never got an answer is Network. */
873
+ declare function cartTransportErrorFor(status: number | null | undefined): CartTransportError;
874
+ /** The words a cart's issues are said with, once each. */
875
+ declare function cartIssueWords(view: Pick<CartView, 'issues'>, lang: string | null | undefined): string[];
876
+ /** The host with no cart yet (the engine until E1d binds its own): every read is an empty cart, every change refused. */
877
+ declare const NO_CART_TRANSPORT: CartTransport;
878
+ /**
879
+ * The builder canvas's cart: in memory, priced by the ONE `priceCart` over the catalog it is given (sample data, or the
880
+ * product on the canvas), written nowhere. `initial` is what it starts holding (a sample line, so the drawer has one to
881
+ * design). Every product the canvas adds must be in `catalog` — `addEntries` widens it.
882
+ */
883
+ interface SimulatedCartTransport extends CartTransport {
884
+ /** Make more units known to the simulation (the product an Add to cart on the canvas names). */
885
+ addEntries(entries: ReadonlyArray<CatalogEntry>): void;
886
+ /** The cart as it stands, priced — no promise (the canvas paints it at once). */
887
+ peek(): CartView;
888
+ }
889
+ declare function simulatedCartTransport(catalog: ReadonlyArray<CatalogEntry>, studio: StudioCommerce, initial?: Cart): SimulatedCartTransport;
890
+
891
+ /**
892
+ * How a price READS on a page — the `money` binding pipe (shop-aware plan A-D2, amended by C-D7) on the builder canvas,
893
+ * the engine's SSR and its hydration: ONE function, so the three never disagree on a digit.
894
+ *
895
+ * - a `Money` (minor units + its currency — `$variant.price`, a cart's totals) is formatted as it is;
896
+ * - a bare number or numeric string (`pricing.price` as the storefront serves it: MAJOR units) needs a currency — the
897
+ * pipe's own argument, else the studio's (`PipeContext.currency`); with none it is left as it was, never guessed;
898
+ * - nothing (null, undefined, '') reads as nothing.
899
+ * The locale is the page's language (`en` when unsaid, so the canvas and the server agree).
900
+ */
901
+ declare const DEFAULT_MONEY_LOCALE = "en";
902
+ declare function formatMoneyValue(value: unknown, currency?: string | null, locale?: string | null): unknown;
903
+ /**
904
+ * The two slots the shop parts write at runtime (the element-context channel — a slot is a `resolvedData` key written
905
+ * at runtime, element-context-state plan): the variant the buyer has chosen (`$variant.price | money`) and the cart
906
+ * (`$cart.count` on the cart button's badge). Written by the shop runtime through its host, read by ordinary bindings.
907
+ */
908
+ declare enum ShopSlot {
909
+ Variant = "$variant",
910
+ Cart = "$cart"
911
+ }
912
+ declare const SHOP_SLOTS: ReadonlyArray<string>;
913
+ declare enum ShopWord {
914
+ Added = "added",
915
+ SoldOut = "soldOut",
916
+ ValueSoldOut = "valueSoldOut",
917
+ Decrease = "decrease",
918
+ Increase = "increase",
919
+ Remove = "remove",
920
+ Cart = "cart",
921
+ CartCount = "cartCount",
922
+ Quantity = "quantity",
923
+ FreeShippingGap = "freeShippingGap",
924
+ ChooseOption = "chooseOption"
925
+ }
926
+ /** `{name}` / `{n}` / `{amount}` are filled by `shopWord`. */
927
+ declare const SHOP_WORDS: Readonly<Record<ShopWord, CommerceLabel>>;
928
+ declare function shopWord(word: ShopWord, lang: string | null | undefined, fill?: Readonly<Record<string, string | number>>): string;
929
+ /** Board 10's tall speckled vase: Glaze (Sand · Ash · Charcoal — Charcoal sold out) × Size (24 · 32 · 40 cm — 40 sold
930
+ * out), ₪240 against ₪280. Major units, as the storefront serves them. */
931
+ declare const SAMPLE_PRODUCT: StorefrontProduct;
932
+ /** The colours board 10 draws its sample glazes with (a sample value has no colour of its own). */
933
+ declare const SAMPLE_SWATCHES: Readonly<Record<string, string>>;
934
+ /** The sample studio's money (VAT 18 %, ₪). */
935
+ declare const SAMPLE_STUDIO: Readonly<{
936
+ currency: CurrencyCode.ILS;
937
+ vatPercent: 18;
938
+ shippingMethods: never[];
939
+ }>;
940
+ /** The cart the canvas starts with: one sample line, so the drawer has a line to design. */
941
+ declare const SAMPLE_CART_LINE: Readonly<{
942
+ productId: "sample-vase";
943
+ variantId: "sample-sand-32cm";
944
+ quantity: 1;
945
+ }>;
946
+
947
+ export { Availability, CART_ISSUE_LABELS, CART_TRANSPORT_ERROR_LABELS, CHECKOUT_GATE_RULES, CHECKOUT_PATH, CHECKOUT_STEPS, CHECKOUT_STEP_LABELS, CURRENCY_CODES, CURRENCY_EXPONENTS, CartIssueCode, CartTransportError, CartTransportErrorCode, CheckoutGateArea, CheckoutGateCode, CheckoutStep, CommerceLanguage, CurrencyCode, DEFAULT_MONEY_LOCALE, DEFAULT_VARIANT_NAME, DeliveryFit, FINAL_ORDER_STATES, LegalPage, MAX_CART_AMOUNT, MAX_CART_LINES, MAX_LINE_QUANTITY, MAX_VAT_PERCENT, MIN_LINE_QUANTITY, MoneyError, MoneyErrorCode, NO_CART_TRANSPORT, ORDER_STATE_LABELS, ORDER_STOCK_HOLD, ORDER_TRANSITIONS, OrderActor, OrderEvent, OrderRefusal, OrderSnapshotRefusal, OrderState, PAYMENT_FIELD_LABELS, PAYMENT_METHODS, PaymentChannel, PaymentField, PaymentMethodKind, PaymentProvider, QuantityStep, SAMPLE_CART_LINE, SAMPLE_PRODUCT, SAMPLE_STUDIO, SAMPLE_SWATCHES, SHIPPING_KINDS, SHOP_SLOTS, SHOP_WORDS, STOCK_EFFECTS, STOCK_RESERVATION_MINUTES, ShippingField, ShippingMethodKind, ShopSlot, ShopWord, StockEffect, StockHold, VARIANT_NAME_SEPARATOR, VAT_PERCENT_MAX_DECIMALS, addMoney, availableShippingMethods, canBuy, canStep, cartEndpointPath, cartIssueWords, cartLineId, cartOf, cartTransportErrorFor, cartViewOf, catalogKey, checkoutGate, checkoutHref, chooseValue, clampQuantity, commerceLanguage, currencyExponent, defaultChoice, emptyCartView, findVariant, formatMoney, formatMoneyValue, furthestStep, includedVat, isCurrencyCode, isMoney, isPaymentMethodKind, isShippingMethodKind, isStorefrontProduct, isVatPercent, labelIn, majorToMinor, mergeCarts, migrateMajorPrice, minorToMajor, money, nextOrderState, openingOrderState, optionValueStates, orderSnapshot, paymentChannelOf, paymentInstructions, paymentMethodProblems, paymentMethodReady, percentOf, priceCart, productCurrency, productInScope, productOptions, productVariants, quantityBounds, quoteShipping, reservationExpiresAt, sellableQuantity, shippingMethodProblems, shippingMethodReady, shippingNeedsAddress, shopWord, simulatedCartTransport, siteCartView, stepQuantity, stockEffect, storefrontCatalog, storefrontMoney, subtractMoney, timesMoney, usablePaymentMethods, variantChoiceOf, variantWords };
948
+ export type { AddToCartRequest, BusinessIdentity, Cart, CartIssue, CartLine, CartTransport, CartView, CartViewLine, CatalogEntry, CheckoutGateFacts, CheckoutGateRefusal, CheckoutGateResult, CommerceLabel, Money, OptionState, OptionValueState, OrderBuyer, OrderMove, OrderSnapshot, OrderSnapshotLine, OrderSnapshotResult, OrderTransition, PaymentMethodConfig, PostalAddress, PricedCart, PricedLine, PricingChoice, ProductOption, ProductVariantView, QuantityBounds, ShippingCart, ShippingGoods, ShippingMethod, ShippingQuote, SimulatedCartTransport, SiteCartView, StorefrontProduct, StorefrontVariant, StudioCommerce, VariantChoice };