@vectoriox/iox-ui 5.95.0 → 5.96.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-ui",
3
- "version": "5.95.0",
3
+ "version": "5.96.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",
@@ -76,7 +76,8 @@ function setText(el: Element | null | undefined, words: string): void {
76
76
  function wordsOf(el: Element | null | undefined): Element | null {
77
77
  if (!el) return null;
78
78
  let cur: Element = el;
79
- while (cur.children.length === 1 && !cur.hasAttribute(CART_TITLE_COUNT_ATTRIBUTE)) cur = cur.children[0];
79
+ // Never INTO the count this runtime appended to a title — a second stamp would nest another inside it.
80
+ while (cur.children.length === 1 && !cur.children[0].hasAttribute(CART_TITLE_COUNT_ATTRIBUTE)) cur = cur.children[0];
80
81
  return cur;
81
82
  }
82
83
 
@@ -2,7 +2,7 @@ import { ShopWord, shopWord } from '@vectoriox/iox-ui/commerce-core';
2
2
  import type { ProductOption } from '@vectoriox/iox-ui/commerce-core';
3
3
  import { roleClass } from '@vectoriox/iox-ui/design-core';
4
4
 
5
- import { CompositeNode, CompositeNodeFactory, makeCompositePart, writeProp } from './composite-node';
5
+ import { CompositeNode, CompositeNodeFactory, findByRole, makeCompositePart, writeProp } from './composite-node';
6
6
 
7
7
  /**
8
8
  * THE SHOP PARTS (commerce E1c, C-D16 — commerce board 10). Not components: recipes of ordinary builder nodes, each part
@@ -431,3 +431,28 @@ export const SHOP_RECIPES: Readonly<Record<ShopRecipe, (create: CompositeNodeFac
431
431
  [ShopRecipe.CartButton]: buildCartButtonRecipe,
432
432
  [ShopRecipe.CartDrawer]: buildCartDrawerRecipe,
433
433
  });
434
+
435
+ /** The recipe a site holds ONCE, as a global element after the page (the bag every page opens) — never in a section. */
436
+ export const SHOP_GLOBAL_RECIPES: ReadonlySet<ShopRecipe> = new Set([ShopRecipe.CartDrawer]);
437
+
438
+ /** 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
439
+ * `@price` / `@compareAt` instead of the product page's chosen variant. The money pipe stays. */
440
+ export enum ShopBindTarget {
441
+ Price = 'price',
442
+ CompareAt = 'compareAt',
443
+ }
444
+
445
+ export const SHOP_BINDS: Readonly<Record<ShopBindTarget, { recipe: ShopRecipe; role: ShopRole; prop: string }>> = Object.freeze({
446
+ [ShopBindTarget.Price]: { recipe: ShopRecipe.Price, role: ShopRole.PriceAmount, prop: 'content' },
447
+ [ShopBindTarget.CompareAt]: { recipe: ShopRecipe.Price, role: ShopRole.PriceCompare, prop: 'content' },
448
+ });
449
+
450
+ /** Bind one part of a stamped recipe to `source` + `path` (the composer's resolved role), replacing its slot binding and
451
+ * keeping the money pipe. False when the recipe holds no such part. */
452
+ export function bindShopPart(root: CompositeNode, target: ShopBindTarget, source: string, path: string): boolean {
453
+ const bind = SHOP_BINDS[target];
454
+ const part = findByRole(root, bind.role);
455
+ if (!part) return false;
456
+ bindSlot(part, bind.prop, source, path, true);
457
+ return true;
458
+ }
@@ -991,6 +991,9 @@ html:has(.iox-bar-reserve) .iox-toasts[data-iox-edge='bottom'] { bottom: calc(16
991
991
  [data-iox-shop-hidden] { display: none !important; }
992
992
  /* The earlier price shows only when there is one: `$variant.compareAt | money` reads '' otherwise. */
993
993
  .iox-role-shop-price-compare:empty { display: none !important; }
994
+ /* A swatch is a word-less button named by its aria-label: the canvas's "Button" placeholder for an empty button never
995
+ covers its colour. */
996
+ .iox-role-shop-variant-swatch > [data-iox-chrome] { display: none !important; }
994
997
  /* An empty bag: no count on the bag button; the drawer shows its "empty" words and nothing else of the bag. */
995
998
  .iox-role-shop-cart-button[data-iox-cart-empty] .iox-role-shop-cart-count { display: none !important; }
996
999
  .iox-role-shop-cart-drawer[data-iox-cart-empty] :is(.iox-role-shop-cart-lines, .iox-role-shop-cart-summary, .iox-role-shop-cart-vat-note,