@vectoriox/iox-ui 5.133.0 → 5.134.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 (77) hide show
  1. package/commerce-core/index.d.ts +12 -1
  2. package/composite-core/index.d.ts +27 -22
  3. package/design-core/index.d.ts +436 -35
  4. package/domain-core/index.d.ts +353 -0
  5. package/domain-core/package.json +3 -0
  6. package/fesm2022/vectoriox-iox-ui-actions-core.mjs +2 -0
  7. package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
  8. package/fesm2022/vectoriox-iox-ui-assist-core.mjs +6 -48
  9. package/fesm2022/vectoriox-iox-ui-assist-core.mjs.map +1 -1
  10. package/fesm2022/vectoriox-iox-ui-commerce-core.mjs +21 -0
  11. package/fesm2022/vectoriox-iox-ui-commerce-core.mjs.map +1 -1
  12. package/fesm2022/vectoriox-iox-ui-composite-core.mjs +68 -57
  13. package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
  14. package/fesm2022/vectoriox-iox-ui-design-core.mjs +895 -416
  15. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  16. package/fesm2022/vectoriox-iox-ui-domain-core.mjs +422 -0
  17. package/fesm2022/vectoriox-iox-ui-domain-core.mjs.map +1 -0
  18. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +13974 -12036
  19. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  20. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +9 -3
  21. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
  22. package/fesm2022/vectoriox-iox-ui-mail-core.mjs +210 -2
  23. package/fesm2022/vectoriox-iox-ui-mail-core.mjs.map +1 -1
  24. package/fesm2022/vectoriox-iox-ui.mjs +290 -16
  25. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  26. package/generation-core/index.d.ts +1419 -379
  27. package/harness-core/index.d.ts +6 -1
  28. package/index.d.ts +139 -10
  29. package/mail-core/index.d.ts +190 -2
  30. package/package.json +5 -1
  31. package/src/actions-core/element-actions.ts +2 -0
  32. package/src/assist-core/page-sections.ts +7 -37
  33. package/src/commerce-core/shop-display.ts +21 -0
  34. package/src/composite-core/shop.ts +71 -57
  35. package/src/design-core/design-settings.ts +16 -0
  36. package/src/design-core/design-token.model.ts +7 -1
  37. package/src/design-core/flavor-spec.generated.ts +374 -35
  38. package/src/design-core/flavor-tokens.ts +12 -1
  39. package/src/design-core/header-behaviour.ts +32 -0
  40. package/src/design-core/motion-language.ts +115 -0
  41. package/src/design-core/public-api.ts +1 -0
  42. package/src/design-core/style-presets.ts +3 -0
  43. package/src/domain-core/domain-vocabulary.ts +125 -0
  44. package/src/domain-core/domain-wire.ts +95 -0
  45. package/src/domain-core/org-path-redirect.ts +105 -0
  46. package/src/domain-core/public-api.ts +12 -0
  47. package/src/domain-core/web-domain.ts +251 -0
  48. package/src/generation-core/carry-fill.ts +36 -0
  49. package/src/generation-core/carry.ts +398 -0
  50. package/src/generation-core/check-carry.ts +216 -0
  51. package/src/generation-core/check-layout.ts +71 -5
  52. package/src/generation-core/compose-layout.ts +187 -28
  53. package/src/generation-core/compose-site.ts +154 -31
  54. package/src/generation-core/entrances.ts +66 -10
  55. package/src/generation-core/header-edit.ts +299 -0
  56. package/src/generation-core/header-mix.ts +64 -5
  57. package/src/generation-core/layout-fingerprint.ts +5 -1
  58. package/src/generation-core/layout-language.ts +20 -1
  59. package/src/generation-core/layout-space.ts +4 -4
  60. package/src/generation-core/layout-wire.ts +36 -1
  61. package/src/generation-core/node-baselines.generated.ts +1 -0
  62. package/src/generation-core/public-api.ts +7 -0
  63. package/src/generation-core/redesign-additions.ts +273 -0
  64. package/src/generation-core/redesign-run.ts +364 -0
  65. package/src/generation-core/refit-page.ts +151 -0
  66. package/src/generation-core/section-stamp.ts +4 -4
  67. package/src/generation-core/shop-plan.ts +15 -0
  68. package/src/generation-core/site-build-run.ts +20 -3
  69. package/src/generation-core/site-spec.generated.ts +194 -94
  70. package/src/generation-core/site-tree.ts +19 -5
  71. package/src/generation-core/validate-site-plan.ts +37 -3
  72. package/src/harness-core/motion.ts +13 -3
  73. package/src/harness-core/starting-design.ts +1 -1
  74. package/src/mail-core/mail-domain.ts +305 -0
  75. package/src/mail-core/mail-wire.ts +8 -0
  76. package/src/mail-core/public-api.ts +3 -1
  77. package/styles/iox-design.css +30 -1
@@ -1,5 +1,6 @@
1
+ import type { PageCarry } from './carry';
1
2
  import {
2
- AnimateId, COLOR_SCHEME_TRAIT, COLOR_SCHEMES, ColorScheme, colorSchemeClass, DEFAULT_MENU_LOOK, DesignChoices, LinkType, MenuLook, resolveDesignChoices, setColorScheme,
3
+ AnimateId, COLOR_SCHEME_TRAIT, COLOR_SCHEMES, ColorScheme, colorSchemeClass, DEFAULT_MENU_LOOK, DesignChoices, LinkType, MenuLook, motionLanguageForPlan, resolveDesignChoices, setColorScheme,
3
4
  } from '@vectoriox/iox-ui/design-core';
4
5
  import { SEO_DESCRIPTION_MAX, SEO_TITLE_MAX, SeoRawDoc } from '@vectoriox/iox-ui/seo-core';
5
6
  import { channelOpensNewTab, FORM_ACTIONS_ROLE, FORM_CHANNEL_ROLE, FormPresetChannel, FormPresetDef, FormPresetField, formPresetById, presetFormActions } from '@vectoriox/iox-ui/forms-core';
@@ -9,7 +10,7 @@ import {
9
10
  AccordionAutoBinds, CompositeNodeSpec, findByRole, LIGHTBOX_LABEL, SLIDE_TO_ROW, SLIDE_TYPE, buildTabsRecipe, tabLabelNodeOf,
10
11
  tabPanelImageOf, tabPanelTextOf, tabsListOf, tabsPanels, tabsPanelsOf, tabsTriggers, TABS_CONTENT_LIMIT, TABS_IMAGE_BIND_PROP, TABS_LABEL_BIND_PROP,
11
12
  TABS_TEXT_BIND_PROP, TABS_WORDS, TabsAutoBinds, BadgeTone, BADGE_TONES, buildSegmentedRecipe, CardWords, ITEM_OPEN_STATE, segmentedOptions,
12
- setHeaderBehaviour, SHOP_RECIPES, ShopRecipe, ShopRole, bindShopPart, ShopBindTarget, ACCOUNT_RECIPES, AccountRecipe,
13
+ setHeaderBehaviour, SHOP_RECIPES, ShopRecipe, ShopRole, bindShopPart, ShopBindTarget, ACCOUNT_RECIPES, AccountRecipe, AccountRole,
13
14
  buildConsentRecipe, ConsentActionType,
14
15
  } from '@vectoriox/iox-ui/composite-core';
15
16
  import { ConsentCategory } from '@vectoriox/iox-ui/consent-core';
@@ -21,13 +22,14 @@ import {
21
22
  countryLegalFacts, FOOTER_LEGAL_ROLE, FORM_LEGAL_ROLE, formAsksPersonalData, formLegalFacts, LEGAL_PAGE_SETTING, LegalContext, LegalFact, LegalFacts,
22
23
  legalFormLine, LegalKind, legalKindsFor, legalLabel, legalRoute, legalTitle,
23
24
  } from './legal';
24
- import { checkHeader, drawnHeaderMix, HeaderContext, headerContextOfPlan, headerMix, HeaderMix, headerRecipe, HeaderRecipe, wornHeaderOfPlan } from './header-mix';
25
+ import { checkHeader, drawnHeaderMix, HeaderContext, headerContextOfPlan, headerMix, HeaderMix, headerRecipe, HeaderRecipe, stampHeaderMix, wornHeaderOfPlan } from './header-mix';
25
26
  import { NODE_BASELINES } from './node-baselines.generated';
26
27
  import {
27
28
  BindScope, CardBindTarget, parsePatternPath, PatternDirective, PatternGlobalPosition, PatternNode, PatternOpens, PatternPlaceholder, PatternRecipe, PatternTrack,
28
29
  PriceBindTarget, SitePattern, patternById,
29
30
  } from './patterns';
30
- import { planSells, shopCategoriesOf, shopContentType, variantNamesOf } from './shop-plan';
31
+ import { planSells, shopCategoriesOf, shopContentType, shopListsShownOn, variantNamesOf } from './shop-plan';
32
+ import { CheckLayoutContext, withShownList } from './check-layout';
31
33
  import { recipeListBinds } from './recipe-fields';
32
34
  import { assertStyleSlots, ComposeError, createSerializedNode, SerializedBinding, SerializedNode, setStyleProps, walkSerialized } from './serialized-node';
33
35
  import { refreshSectionStamps, stampSection } from './section-stamp';
@@ -145,6 +147,9 @@ export interface ComposeContext {
145
147
  /** AW1: what the studio holds that decides its legal pages and banner (country, trackers, its own legal pages, its
146
148
  * routes, a banner it keeps). Absent = only what the plan and the composed pages say (no tracker, no country). */
147
149
  legal?: LegalContext;
150
+ /** A redesign (site-redesign RD1): each composed page's carry by page key (`harvestPage`) — its layout's layers and
151
+ * sections naming a handle show the owner's part. */
152
+ carry?: Readonly<Record<string, PageCarry>>;
148
153
  }
149
154
 
150
155
  /** Where a composed layout's photos are, as the server keeps them and the screens read them (M8 gate 2): id → address. */
@@ -490,11 +495,18 @@ export function contentTypeOfSource(alias: string, plan: SitePlan): ContentTypeP
490
495
  return plan.contentTypes.find(t => t.name === ds.contentType);
491
496
  }
492
497
 
498
+ /** A list a composed page may show: a query of the plan's content — or of the SHOP, so a composed shop page lists its
499
+ * products, each linked to the product page (vectoriox/iox-ui#99: shop lists were never offered, and a composed shop
500
+ * page drew boxes). */
501
+ function isLayoutListSource(d: DataSourcePlan): boolean {
502
+ return (d.type === PlanDataSourceType.Cms || d.type === PlanDataSourceType.Shop) && d.mode === PlanDataSourceMode.Query;
503
+ }
504
+
493
505
  /** Every list a composed gallery could name (the plan's query sources), in plan order: what it is called and whether its
494
506
  * items carry a picture (an `image` role). */
495
507
  export function layoutGalleryLists(plan: SitePlan): LayoutGalleryList[] {
496
508
  return plan.dataSources
497
- .filter(d => d.type === PlanDataSourceType.Cms && d.mode === PlanDataSourceMode.Query)
509
+ .filter(isLayoutListSource)
498
510
  .map(d => {
499
511
  const type = contentTypeOfSource(d.alias, plan);
500
512
  return { alias: d.alias, words: [d.alias, type?.name, type?.label].filter((w): w is string => !!w), pictures: !!roleField(type, 'image') };
@@ -517,7 +529,7 @@ const median = (values: number[]) => { const v = [...values].sort((a, b) => a -
517
529
  /** The shape of every list a list section could show (the plan's query sources, as `layoutGalleryLists`). */
518
530
  export function layoutListShapes(plan: SitePlan): LayoutListShape[] {
519
531
  return plan.dataSources
520
- .filter(d => d.type === PlanDataSourceType.Cms && d.mode === PlanDataSourceMode.Query)
532
+ .filter(isLayoutListSource)
521
533
  .map(d => {
522
534
  const type = contentTypeOfSource(d.alias, plan);
523
535
  const played = (Object.values(ContentRole) as `${ContentRole}`[]).filter(role => !!roleField(type, role));
@@ -527,7 +539,8 @@ export function layoutListShapes(plan: SitePlan): LayoutListShape[] {
527
539
  const samples = field ? (perItem[field] ?? []).filter(s => typeof s === 'string') : [];
528
540
  return samples.length > 0 && median(samples.map(wordCount)) > LIST_LONG_WORDS;
529
541
  });
530
- const count = type?.seed?.count;
542
+ // A shop list holds the plan's sample products (the build writes them unless the shop has its own).
543
+ const count = d.type === PlanDataSourceType.Shop ? plan.shop?.products?.length : type?.seed?.count;
531
544
  return { alias: d.alias, label: type?.label ?? d.alias, items: typeof count === 'number' && count > 0 ? count : null, roles: played, long };
532
545
  });
533
546
  }
@@ -539,7 +552,7 @@ export function layoutListShapes(plan: SitePlan): LayoutListShape[] {
539
552
  */
540
553
  export function layoutListBinding(alias: string, plan: SitePlan): LayoutListBinding | null {
541
554
  const ds = plan.dataSources.find(d => d.alias === alias);
542
- if (!ds || ds.type !== PlanDataSourceType.Cms || ds.mode !== PlanDataSourceMode.Query) return null;
555
+ if (!ds || !isLayoutListSource(ds)) return null;
543
556
  const type = contentTypeOfSource(alias, plan);
544
557
  const roles: Record<string, string> = {};
545
558
  for (const role of Object.values(ContentRole) as `${ContentRole}`[]) {
@@ -559,6 +572,13 @@ export function describeListShape(shape: LayoutListShape): string {
559
572
  return `${shape.alias} (${shape.label}): ${shape.items === null ? 'items the owner adds' : `${shape.items} item${shape.items === 1 ? '' : 's'}`} · ${roles}`;
560
573
  }
561
574
 
575
+ /** What a composed page must list (vectoriox/iox-ui#99): the shop's lists its plan sections bind (a shop page's
576
+ * products), each section's list by index (a ready-made place shows its own), and every list's shape — the context
577
+ * `checkLayout` and `withShownList` read. iox-cms spreads it into the layout check. */
578
+ export function layoutListsContext(page: Pick<PagePlan, 'sections'>, plan: SitePlan): Pick<CheckLayoutContext, 'shows' | 'sectionBindings' | 'listShapes'> {
579
+ return { shows: shopListsShownOn(page, plan), sectionBindings: (page.sections ?? []).map(s => s.binding), listShapes: layoutListShapes(plan) };
580
+ }
581
+
562
582
  /** The list sources a composed gallery may show (`gallery.source`): the plan's query sources whose items have a picture.
563
583
  * A list with none (a FAQ) would repeat no slide and draw an empty band (iox-ui#59), so it is never offered and the check
564
584
  * refuses it. */
@@ -1192,7 +1212,7 @@ export const SIGN_IN_DIALOG_ID = 'sign-in';
1192
1212
  */
1193
1213
  function composeShopRecipe(pn: PatternNode, id: string, repeater: RepeaterScope | null, ctx: Ctx): SerializedNode {
1194
1214
  const spec = SHOP_PATTERN_RECIPES.get(pn.recipe as PatternRecipe)!;
1195
- const root = SHOP_RECIPES[spec.recipe](recipeFactory(id, spec.rootKey)) as SerializedNode;
1215
+ const root = SHOP_RECIPES[spec.recipe](recipeFactory(id, spec.rootKey), ctx.plan.locale ?? DEFAULT_SITE_LOCALE) as SerializedNode;
1196
1216
  if (root.id !== id) throw new ComposeError(`${id}: the ${pn.recipe} recipe's root is not "${spec.rootKey}"`);
1197
1217
  for (const [key, path] of Object.entries(pn.binds ?? {})) {
1198
1218
  const target = PRICE_BINDS[key as PriceBindTarget];
@@ -1219,28 +1239,98 @@ function composeShopRecipe(pn: PatternNode, id: string, repeater: RepeaterScope
1219
1239
  function withStore(globals: SerializedNode[], locale: string): SerializedNode[] {
1220
1240
  const out = [...globals];
1221
1241
  const header = out.find(g => g.id === GlobalSlot.Header);
1222
- if (header) {
1242
+ if (header) withStoreSlots(header, locale);
1243
+ const drawer = SHOP_RECIPES[ShopRecipe.CartDrawer](recipeFactory(SHOP_CART_DRAWER_ID, CART_DRAWER_KEY), locale) as SerializedNode;
1244
+ drawer.isGlobal = true;
1245
+ drawer.globalPosition = PatternGlobalPosition.After;
1246
+ const signIn = ACCOUNT_RECIPES[AccountRecipe.SignInDialog](recipeFactory(SIGN_IN_DIALOG_ID, SIGN_IN_DIALOG_KEY), locale) as SerializedNode;
1247
+ signIn.isGlobal = true;
1248
+ signIn.globalPosition = PatternGlobalPosition.After;
1249
+ out.push(drawer, signIn);
1250
+ return out;
1251
+ }
1252
+
1253
+ /** Where `rewordStoreGlobal` holds a node's layer name beside its props (no prop is ever named so). */
1254
+ const LAYER_LABEL = '\u0000label';
1255
+
1256
+ /** The one-per-site store globals by role, as the composer stamps them in a language (`withStore`). */
1257
+ const STORE_GLOBAL_RECIPES: Readonly<Record<string, (locale: string) => SerializedNode>> = Object.freeze({
1258
+ [ShopRole.CartDrawer]: (locale: string) => SHOP_RECIPES[ShopRecipe.CartDrawer](recipeFactory(SHOP_CART_DRAWER_ID, CART_DRAWER_KEY), locale) as SerializedNode,
1259
+ [AccountRole.SignIn]: (locale: string) => ACCOUNT_RECIPES[AccountRecipe.SignInDialog](recipeFactory(SIGN_IN_DIALOG_ID, SIGN_IN_DIALOG_KEY), locale) as SerializedNode,
1260
+ });
1261
+
1262
+ /**
1263
+ * vectoriox/iox-ui#100: the cart drawer or sign-in dialog a studio KEEPS across builds (one per site — iox-cms#88), in
1264
+ * the language of the site being built. Every word still as a build composed it in another language takes this
1265
+ * language's; a word the owner changed stays, and a part they made by hand (not the composer's ids) is left alone.
1266
+ * Null: nothing to change (already in this language, or not a store global). Pure — a copy.
1267
+ */
1268
+ export function rewordStoreGlobal(kept: SerializedNode, locale: string): SerializedNode | null {
1269
+ const build = kept?.role ? STORE_GLOBAL_RECIPES[kept.role] : undefined;
1270
+ if (!build) return null;
1271
+ // A node's words: its props' strings and its layer name (a Field's label is a layer name the builder shows).
1272
+ const wordsById = (root: SerializedNode): Map<string, Record<string, unknown>> => {
1273
+ const out = new Map<string, Record<string, unknown>>();
1274
+ walkSerialized([root], n => { out.set(n.id, { ...(n.props ?? {}), [LAYER_LABEL]: n.label }); });
1275
+ return out;
1276
+ };
1277
+ const target = wordsById(build(locale));
1278
+ const others = (Object.values(SiteLocale) as string[]).filter(l => l !== locale).map(l => wordsById(build(l)));
1279
+ const copy = JSON.parse(JSON.stringify(kept)) as SerializedNode;
1280
+ let changed = false;
1281
+ walkSerialized([copy], n => {
1282
+ const words = target.get(n.id);
1283
+ if (!words) return;
1284
+ const now: Record<string, unknown> = { ...(n.props ?? {}), [LAYER_LABEL]: n.label };
1285
+ for (const [key, value] of Object.entries(words)) {
1286
+ if (typeof value !== 'string' || now[key] === value) continue;
1287
+ if (!others.some(o => o.get(n.id)?.[key] === now[key])) continue;
1288
+ if (key === LAYER_LABEL) n.label = value; else n.props![key] = value;
1289
+ changed = true;
1290
+ }
1291
+ });
1292
+ return changed ? copy : null;
1293
+ }
1294
+
1295
+ /** A selling site's header holds the account entry and the bag (C-D21) — the header's half of `withStore`, also what
1296
+ * the builder's Header studio composes a selling site's header with (`NavHeaderInput.storeSlots`). Mutates `header`. */
1297
+ function withStoreSlots(header: SerializedNode, locale: string): void {
1298
+ {
1223
1299
  const top = header.children ?? (header.children = []);
1224
1300
  const account = ACCOUNT_RECIPES[AccountRecipe.Entry](recipeFactory(ACCOUNT_ENTRY_ID, ACCOUNT_ENTRY_KEY), locale) as SerializedNode;
1225
- const bag = SHOP_RECIPES[ShopRecipe.CartButton](recipeFactory(SHOP_CART_BUTTON_ID, CART_BUTTON_KEY)) as SerializedNode;
1301
+ const bag = SHOP_RECIPES[ShopRecipe.CartButton](recipeFactory(SHOP_CART_BUTTON_ID, CART_BUTTON_KEY), locale) as SerializedNode;
1226
1302
  // HI1: a bar of side cells (between, a centred name, a name-and-menu) takes the slots in its END cell — the cells
1227
1303
  // share the free space, so the name stays where its arrangement puts it. Otherwise the root's, as before (R-H4).
1228
1304
  const cells = top.filter(k => k.role === NavRole.Cell);
1229
1305
  const host = cells.length ? cells[cells.length - 1] : header;
1230
1306
  const kids = host.children ?? (host.children = []);
1307
+ // A header that stacks (a centred name over its pages) takes them on its pages' row: the pages and the slots become
1308
+ // one cell, so the bag and the account sit at the row's end, beside the pages and the action — on a phone the cell
1309
+ // keeps the slots and hides the pages, as a side cell does (vectoriox/iox-ui#101; as two children of the column they
1310
+ // were two more rows, then one more row — #98).
1311
+ if (!cells.length && header.styleProps?.['flexDirection'] === 'column') {
1312
+ const at = top.findIndex(k => k.role === NavRole.Links);
1313
+ const row = storeSlotCell(at >= 0 ? top[at] : null, account, bag);
1314
+ const menuAt = top.findIndex(k => k.role === NavRole.MenuButton);
1315
+ if (at >= 0) top.splice(at, 1, row); else top.splice(menuAt >= 0 ? menuAt : top.length, 0, row);
1316
+ return;
1317
+ }
1231
1318
  const menu = kids.findIndex(k => k.role === NavRole.MenuButton);
1232
1319
  kids.splice(menu >= 0 ? menu : kids.length, 0, account, bag);
1233
1320
  const brand = top.find(k => k.role === NavRole.Brand);
1234
1321
  if (brand && !cells.length) setStyleProps(brand, { flexGrow: '1' });
1235
1322
  }
1236
- const drawer = SHOP_RECIPES[ShopRecipe.CartDrawer](recipeFactory(SHOP_CART_DRAWER_ID, CART_DRAWER_KEY)) as SerializedNode;
1237
- drawer.isGlobal = true;
1238
- drawer.globalPosition = PatternGlobalPosition.After;
1239
- const signIn = ACCOUNT_RECIPES[AccountRecipe.SignInDialog](recipeFactory(SIGN_IN_DIALOG_ID, SIGN_IN_DIALOG_KEY), locale) as SerializedNode;
1240
- signIn.isGlobal = true;
1241
- signIn.globalPosition = PatternGlobalPosition.After;
1242
- out.push(drawer, signIn);
1243
- return out;
1323
+ }
1324
+
1325
+ /** A stacking header's pages row with the store's slots at its end (a side cell — hidden on a phone but for the slots). */
1326
+ function storeSlotCell(links: SerializedNode | null, account: SerializedNode, bag: SerializedNode): SerializedNode {
1327
+ const row = create(`${SHOP_CART_BUTTON_ID}-row`, CONTAINER, {}, 'box');
1328
+ row.role = NavRole.Cell;
1329
+ // Its own width (a Container is born 100% wide — in a phone's one-row bar it would take the name's room); the pages
1330
+ // keep the room they had and wrap before the slots do.
1331
+ setStyleProps(row, { display: 'flex', flexDirection: 'row', flexWrap: 'nowrap', alignItems: 'center', justifyContent: 'center', gap: 'var(--iox-space-gap)', width: 'auto', minWidth: '0px' });
1332
+ row.children = [...(links ? [links] : []), account, bag];
1333
+ return row;
1244
1334
  }
1245
1335
 
1246
1336
  /** The plan's products as the build writes them — samples, published, each with no price (the owner's to set). */
@@ -1316,6 +1406,8 @@ const cloneTrack = (track: PatternTrack): Record<string, unknown> => ({
1316
1406
  interface SectionMotion {
1317
1407
  level: AnimateId | string | null;
1318
1408
  rtl: boolean;
1409
+ /** The look's heading move (AW3 `design.headings`). */
1410
+ move?: string | null;
1319
1411
  }
1320
1412
 
1321
1413
  function composePattern(pattern: SitePattern, id: string, ctx: Ctx, motion: SectionMotion | null = null): SerializedNode {
@@ -1351,7 +1443,7 @@ function stampEntrances(root: SerializedNode, family: string, entrances: Readonl
1351
1443
  seen.set(key, index + 1);
1352
1444
  return { ...e, index };
1353
1445
  });
1354
- const stamps = planEntrances({ family, level: motion.level, marks, contentIds: (root.children ?? []).map(c => c.id), rtl: motion.rtl });
1446
+ const stamps = planEntrances({ family, level: motion.level, marks, contentIds: (root.children ?? []).map(c => c.id), rtl: motion.rtl, move: motion.move });
1355
1447
  for (const { nodeId, interaction } of stamps) {
1356
1448
  const node = nodes.get(nodeId);
1357
1449
  if (node) node.interactions = [...node.interactions, interaction];
@@ -1452,6 +1544,7 @@ function composeItems(type: ContentTypePlan, fillEmpty: boolean): ComposedItem[]
1452
1544
  }
1453
1545
 
1454
1546
  const FACT_TOKEN = /\{fact:([a-zA-Z]+)\}/g;
1547
+ const KEPT_HANDLE = 'keep:';
1455
1548
  const LAYOUT_TEXT_PROPS: ReadonlyArray<string> = ['content', 'caption', 'alt', 'label', 'ariaLabel'];
1456
1549
 
1457
1550
  /**
@@ -1495,6 +1588,7 @@ function composeLayoutPage(
1495
1588
  return image ? { image, ...(roleField(type, 'title') ? { title: roleField(type, 'title')! } : {}) } : null;
1496
1589
  },
1497
1590
  listOf: alias => layoutListBinding(alias, plan),
1591
+ ...(context.carry?.[page.key] ? { carry: context.carry[page.key] } : {}),
1498
1592
  });
1499
1593
  const facts = plan.business.facts ?? {};
1500
1594
  walkSerialized(nodes, node => {
@@ -1516,11 +1610,13 @@ function composeLayoutPage(
1516
1610
  }
1517
1611
 
1518
1612
  /** M2-1: each section root of a model-laid page says where it came from — a ready-made place its plan section's library
1519
- * pattern, any other its layout section id (`composeLayout` keeps one root per layout section, in order). */
1613
+ * pattern, any other its layout section id (`composeLayout` keeps one root per layout section, in order). A KEPT section a
1614
+ * redesign placed (`keep:<n>`, RD-D16/D17) stays the owner's: never stamped as the build's, so the next harvest keeps it. */
1520
1615
  function stampLayoutSections(page: PagePlan, layout: LayoutPage, nodes: SerializedNode[]): SerializedNode[] {
1521
1616
  if (nodes.length !== layout.sections.length) throw new ComposeError(`${page.key}: ${nodes.length} roots for ${layout.sections.length} layout sections`);
1522
1617
  return nodes.map((root, i) => {
1523
1618
  const s = layout.sections[i];
1619
+ if (s.carry?.startsWith(KEPT_HANDLE)) return root;
1524
1620
  const readyMade = s.readyMade ? page.sections[s.readyMade.at]?.pattern : undefined;
1525
1621
  return stampSection(root, readyMade ? { pattern: readyMade } : { layout: s.id });
1526
1622
  });
@@ -1540,24 +1636,28 @@ export function composeSite(plan: SitePlan, context: ComposeContext): ComposedSi
1540
1636
  const email = nonEmpty(plan.business.facts?.email) ? plan.business.facts!.email!.trim() : null;
1541
1637
  const base = { plan, placeholders, issues, routes, year: context.year, email, navPage: null };
1542
1638
 
1543
- const design = resolveDesignChoices(clone(plan.design));
1639
+ // AW-D23 / MB-D6: a lower plan wears its own words of the look's motion language (a Pro Feel arrives on today's
1640
+ // curve, a Pro move fades) — in the tokens the build applies AND the entrances it stamps.
1641
+ const design = motionLanguageForPlan(resolveDesignChoices(clone(plan.design)), context?.tier === GenerationTier.Award);
1544
1642
  const locale = plan.locale ?? DEFAULT_SITE_LOCALE;
1545
1643
  const rtl = isRtlLocale(locale);
1546
1644
  const pages: ComposedPage[] = plan.pages.map(page => {
1547
1645
  const nextAlias = page.routeSource ? nextSourceOf(relatives, page.routeSource) : null;
1548
1646
  if (page.layout) {
1549
- const opening = layoutBandScheme(page.layout.sections[0]?.ground);
1647
+ // vectoriox/iox-ui#99: a composed page that is where the site lists the shop lists it (a stored layout too).
1648
+ const layout = withShownList(page.layout, layoutListsContext(page, plan)) ?? page.layout;
1649
+ const opening = layoutBandScheme(layout.sections[0]?.ground);
1550
1650
  return {
1551
1651
  key: page.key, name: page.name, route: { path: page.route }, isHome: page.isHome === true, status: STATUS_DRAFT, locale,
1552
1652
  pageSettings: { designSystem: true, layoutSource: { pageKey: page.key }, ...(opening ? { opening } : {}) }, seo: composePageSeo(page, plan),
1553
- layout: stampLayoutSections(page, page.layout, composeLayoutPage(page, page.layout, plan, context, design, placeholders, (section, id) =>
1653
+ layout: stampLayoutSections(page, layout, composeLayoutPage(page, layout, plan, context, design, placeholders, (section, id) =>
1554
1654
  composePattern(patternById(section.pattern) as SitePattern, id, { ...base, owner: page.key, page, section, nextAlias },
1555
- { level: section.enter ?? design.animate ?? null, rtl }))),
1655
+ { level: section.enter ?? design.animate ?? null, rtl, move: design.headings ?? null }))),
1556
1656
  };
1557
1657
  }
1558
1658
  const layout = page.sections.map((section, i) => {
1559
1659
  const pattern = patternById(section.pattern) as SitePattern;
1560
- const motion: SectionMotion = { level: section.enter ?? design.animate ?? null, rtl };
1660
+ const motion: SectionMotion = { level: section.enter ?? design.animate ?? null, rtl, move: design.headings ?? null };
1561
1661
  return stampSection(composePattern(pattern, `${page.key}-${i}`, { ...base, owner: page.key, page, section, nextAlias }, motion), { pattern: section.pattern });
1562
1662
  });
1563
1663
  const opening = colorSchemeClass(layout[0]?.props?.[COLOR_SCHEME_TRAIT]) ? (layout[0].props[COLOR_SCHEME_TRAIT] as ColorScheme) : null;
@@ -1604,6 +1704,9 @@ export function composeSite(plan: SitePlan, context: ComposeContext): ComposedSi
1604
1704
  const root = pattern.header ? globals.find(g => g.id === slot) : null;
1605
1705
  if (pattern.header && root) setHeaderBehaviour(root as unknown as CompositeNode, pattern.header.behaviour, pattern.header.edge ?? null);
1606
1706
  }
1707
+ // HI1b (HS-5): the header root says the mix it was composed as (Bindings ▸ Header and the Header studio read it).
1708
+ const headerRoot = globals.find(g => g.id === GlobalSlot.Header);
1709
+ if (headerRoot) stampHeaderMix(headerRoot, header.recipe.mix);
1607
1710
  if (planSells(plan)) globals = withStore(globals, plan.locale ?? DEFAULT_SITE_LOCALE);
1608
1711
  // AW1: the law, derived from facts and never asked — the legal pages, the banner when a tracker is connected, the
1609
1712
  // footer's legal row and the line beside every form that asks for personal details.
@@ -1840,6 +1943,8 @@ export interface NavHeaderInput {
1840
1943
  /** HI1: draw the mix as asked, never repaired — the layout language's header, whose links are its SECTIONS (a corner
1841
1944
  * header with two section links is still the name and a menu, HI0). */
1842
1945
  readonly asAsked?: boolean;
1946
+ /** HI1b: the site sells — the header holds the account entry and the bag, as `composeSite` gives a selling site's. */
1947
+ readonly storeSlots?: boolean;
1843
1948
  }
1844
1949
 
1845
1950
  export interface NavHeaderOptions {
@@ -1855,6 +1960,10 @@ export interface ComposedNavHeader {
1855
1960
  issues: ComposeIssue[];
1856
1961
  /** HI1: the mix it was composed as, after the site's check (what Bindings ▸ Header shows). */
1857
1962
  mix: HeaderMix;
1963
+ /** HI1b: the phone shape's other globals, in order after the header — the Both shape's drawer, the bottom bar. A
1964
+ * caller placing the header places these too (they were dropped before HI1b: a palette header asked for a bar had
1965
+ * none). Empty for the drawer shape. */
1966
+ companions: SerializedNode[];
1858
1967
  }
1859
1968
 
1860
1969
  const ROUTE_PARAM = ':';
@@ -1883,12 +1992,24 @@ function navPagePlans(pages: ReadonlyArray<SitePageRef>): PagePlan[] {
1883
1992
  * one plain Link per navigation page, the call to action (W1.1's one dangling-link rule when the studio has
1884
1993
  * no /contact page: an email to the business, else removed), and the pattern's phone shape. Pure.
1885
1994
  */
1886
- export function composeNavHeader(input: NavHeaderInput, options: NavHeaderOptions): ComposedNavHeader {
1887
- if (!nonEmpty(options?.id)) throw new ComposeError('composeNavHeader needs the header id');
1995
+ /** The plan a studio with no Site Plan stands for, as far as its header goes: its name, its pages (in the navigation or
1996
+ * not), its language, its look. */
1997
+ function navHeaderPlan(input: Omit<NavHeaderInput, 'mix' | 'asAsked'>): SitePlan {
1888
1998
  const all = navPagePlans(input.pages);
1889
1999
  const navRoutes = new Set(siteNavPages(input.pages).map(p => p.route));
1890
2000
  const pages = all.map(p => ({ ...p, inNav: navRoutes.has(p.route) }));
1891
- const plan = { business: input.business, pages, dataSources: [], contentTypes: [], locale: input.locale, design: input.design ?? {} } as unknown as SitePlan;
2001
+ return { business: input.business, pages, dataSources: [], contentTypes: [], locale: input.locale, design: input.design ?? {} } as unknown as SitePlan;
2002
+ }
2003
+
2004
+ /** What a studio's header is judged against (`checkHeader`) — the same context `composeNavHeader` checks with. */
2005
+ export function navHeaderContext(input: Omit<NavHeaderInput, 'mix' | 'asAsked'>): HeaderContext {
2006
+ return headerContextOfPlan(navHeaderPlan(input), input.shop ?? null);
2007
+ }
2008
+
2009
+ export function composeNavHeader(input: NavHeaderInput, options: NavHeaderOptions): ComposedNavHeader {
2010
+ if (!nonEmpty(options?.id)) throw new ComposeError('composeNavHeader needs the header id');
2011
+ const plan = navHeaderPlan(input);
2012
+ const pages = plan.pages;
1892
2013
  const email = nonEmpty(input.business.facts?.email) ? input.business.facts!.email!.trim() : null;
1893
2014
  const issues: ComposeIssue[] = [];
1894
2015
  // HI1: ONE recipe with composeSite — the mix drawn as the product draws it, checked against this studio, arranged.
@@ -1909,9 +2030,11 @@ export function composeNavHeader(input: NavHeaderInput, options: NavHeaderOption
1909
2030
  root.isGlobal = true;
1910
2031
  root.globalPosition = pattern.global;
1911
2032
  const shape = pattern.phoneMenu as NavShape | undefined;
1912
- const header = shape ? planNavShape([root], shape, { newId: options.newId, ...headerShapeOptions(recipe, input.locale) }, root.id).globals[0] : root;
2033
+ const [header, ...companions] = shape ? planNavShape([root], shape, { newId: options.newId, ...headerShapeOptions(recipe, input.locale) }, root.id).globals : [root];
1913
2034
  if (pattern.header) setHeaderBehaviour(header as unknown as CompositeNode, pattern.header.behaviour, pattern.header.edge ?? null);
1914
- return { header, issues, mix: checked.mix };
2035
+ stampHeaderMix(header, recipe.mix);
2036
+ if (input.storeSlots) withStoreSlots(header, input.locale ?? DEFAULT_SITE_LOCALE);
2037
+ return { header, issues, mix: checked.mix, companions };
1915
2038
  }
1916
2039
 
1917
2040
  // ── One pattern on its own (CC4b) ───────────────────────────────────────────────────────────────
@@ -1,4 +1,4 @@
1
- import { AnimateId, EntranceParam, SPEC_AXES, staggerDelay } from '@vectoriox/iox-ui/design-core';
1
+ import { AnimateId, EntranceParam, MoveId, QUIET_LEVELS, QUIET_MOVE, SPEC_AXES, staggerDelay } from '@vectoriox/iox-ui/design-core';
2
2
 
3
3
  /**
4
4
  * How animated (AI plan rev 3.1 §3p) — the ONE reading of the contract's `axes.animations` (what each level
@@ -25,8 +25,12 @@ export enum EntrancePart {
25
25
  export const ENTRANCE_ORIGIN_LOOK = 'look';
26
26
  /** The trigger every entrance plays on. */
27
27
  export const ENTRANCE_TRIGGER = 'viewportEnter';
28
- /** The easing every entrance plays with (only `opacity` and `transform` move). */
29
- export const ENTRANCE_EASING = 'ease-out';
28
+ /**
29
+ * The easing every entrance plays with: the look's own ARRIVAL token (AW3, MB-D5 — Design ▸ Motion ▸ Feel), resolved on
30
+ * the element by both runtimes, so a re-theme changes every stamped entrance with no restamp. Before AW3 every look
31
+ * entered on the `ease-out` keyword.
32
+ */
33
+ export const ENTRANCE_EASING = 'ease-enter';
30
34
 
31
35
  /** One entrance as the contract states it. */
32
36
  export interface EntranceSpec {
@@ -38,6 +42,10 @@ export interface EntranceSpec {
38
42
  readonly cap?: number;
39
43
  /** The type a right-to-left page plays instead (a side-by-side row slides in from ITS side). */
40
44
  readonly mirror?: string;
45
+ /** A text reveal's pieces (`revealText`): lines or words. */
46
+ readonly by?: 'line' | 'word';
47
+ /** A clip reveal's opening: % showing as it starts (a quiet clip starts at 85 — MB-D7). */
48
+ readonly start?: number;
41
49
  }
42
50
 
43
51
  /** What one section family moves at one level. `content` set = the whole content together, and no parts. */
@@ -54,7 +62,7 @@ export interface EntranceAction {
54
62
  delay: number;
55
63
  easing: typeof ENTRANCE_EASING;
56
64
  once: true;
57
- params?: { distance?: number; stagger?: number; cap?: number };
65
+ params?: { distance?: number; stagger?: number; cap?: number; by?: 'line' | 'word'; start?: number };
58
66
  }
59
67
 
60
68
  export interface EntranceInteraction {
@@ -70,18 +78,62 @@ const FAMILIES = SPEC_AXES.animationFamilies as unknown as Readonly<Record<strin
70
78
 
71
79
  const NOTHING: SectionEntrances = { content: null, parts: {} };
72
80
 
73
- /** What a section of `family` moves at `level` — nothing for an unknown level or family. */
74
- export function sectionEntrances(level: AnimateId | string | null | undefined, family: string): SectionEntrances {
81
+ /** A rise with no distance of its own (a level whose heading did not travel) rises this far. */
82
+ const MOVE_RISE_DEFAULT = 24;
83
+
84
+ /**
85
+ * The look's heading MOVE (AW3, award plan §5.2 — Design ▸ Motion ▸ Headings arrive) over a level's heading entrance:
86
+ * the level keeps its duration (the amount), the move decides the kind. Pure.
87
+ */
88
+ export function moveEntrance(move: MoveId | string, base: EntranceSpec): EntranceSpec {
89
+ const { duration } = base;
90
+ switch (move) {
91
+ case 'rise': return { type: 'moveUp', duration, distance: base.type === 'moveUp' && base.distance ? base.distance : MOVE_RISE_DEFAULT };
92
+ case 'mask-rise': return { type: 'revealText', duration, by: 'line' };
93
+ case 'words-lit': return { type: 'revealText', duration, by: 'word' };
94
+ case 'clip': return { type: 'clipReveal', duration };
95
+ case 'blur-in': return { type: 'blurIn', duration };
96
+ case 'fade': return { type: 'fadeIn', duration };
97
+ default: return base;
98
+ }
99
+ }
100
+
101
+ /**
102
+ * A travelling move's QUIET form, for a level that moves the content together (MB-D7 — Subtle never travels far):
103
+ * rise 8 px, the lines of a mask rise together, a clip opens from 85 % showing. Fade and blur in play as they are;
104
+ * words lit fades (one piece at a time is not quiet).
105
+ */
106
+ export function quietMoveEntrance(move: MoveId | string, base: EntranceSpec): EntranceSpec {
107
+ const { duration } = base;
108
+ switch (move) {
109
+ case 'rise':
110
+ case 'mask-rise': return { type: 'moveUp', duration, distance: QUIET_MOVE.riseDistance };
111
+ case 'clip': return { type: 'clipReveal', duration, start: QUIET_MOVE.clipFrom };
112
+ case 'blur-in': return { type: 'blurIn', duration };
113
+ default: return base;
114
+ }
115
+ }
116
+
117
+ /**
118
+ * What a section of `family` moves at `level` — nothing for an unknown level or family. With the look's `move`
119
+ * (AW3), Standard and up give the HEADING that move (items and media keep the level's, on the look's arrival curve);
120
+ * a quiet level's content plays the move's quiet form (MB-D7); Still moves nothing whatever the move. No move = the
121
+ * level's own heading (a design stored before AW3 — MB-D8).
122
+ */
123
+ export function sectionEntrances(level: AnimateId | string | null | undefined, family: string, move?: MoveId | string | null): SectionEntrances {
75
124
  const lv = level ? LEVELS[level] : undefined;
76
125
  const allow = FAMILIES[family] ?? [];
77
126
  if (!lv || !allow.length) return NOTHING;
78
- if (lv.parts.content && allow.includes(EntrancePart.Content)) return { content: lv.parts.content, parts: {} };
127
+ if (lv.parts.content && allow.includes(EntrancePart.Content)) {
128
+ const quiet = move && QUIET_LEVELS.includes(String(level));
129
+ return { content: quiet ? quietMoveEntrance(move, lv.parts.content) : lv.parts.content, parts: {} };
130
+ }
79
131
  const parts: Partial<Record<EntrancePart, EntranceSpec>> = {};
80
132
  for (const part of allow) {
81
133
  if (part === EntrancePart.Content) continue;
82
134
  // A level without its own side-by-side entrance gives a row's picture the plain picture one.
83
135
  const spec = lv.parts[part] ?? (part === EntrancePart.RowMedia ? lv.parts.media : undefined);
84
- if (spec) parts[part] = spec;
136
+ if (spec) parts[part] = part === EntrancePart.Heading && move ? moveEntrance(move, spec) : spec;
85
137
  }
86
138
  return { content: null, parts };
87
139
  }
@@ -108,8 +160,10 @@ export interface EntranceActionOptions {
108
160
  * together cancel out), its distance, and its delay (or, for a Repeater's rows, the stagger the runtime adds). */
109
161
  export function entranceAction(spec: EntranceSpec, opts: EntranceActionOptions = {}): EntranceAction {
110
162
  const mirrored = (opts.side === EntranceSide.Start) !== !!opts.rtl;
111
- const params: Record<string, number> = {};
163
+ const params: Record<string, number | string> = {};
112
164
  if (spec.distance) params[EntranceParam.Distance] = spec.distance;
165
+ if (spec.by) params['by'] = spec.by;
166
+ if (spec.start) params['start'] = spec.start;
113
167
  if (opts.repeated && spec.stagger) {
114
168
  params[EntranceParam.Stagger] = spec.stagger;
115
169
  params[EntranceParam.Cap] = spec.cap ?? 1;
@@ -156,6 +210,8 @@ export interface PlanEntrancesInput {
156
210
  /** The section's own children: what a level that moves the CONTENT fades when the pattern marks no content node. */
157
211
  contentIds: ReadonlyArray<string>;
158
212
  rtl?: boolean;
213
+ /** The look's heading move (`design.headings`, AW3); absent = the level's own heading entrance. */
214
+ move?: MoveId | string | null;
159
215
  }
160
216
 
161
217
  /**
@@ -165,7 +221,7 @@ export interface PlanEntrancesInput {
165
221
  * Nothing for a header or footer family, Still, or an unknown level. Pure.
166
222
  */
167
223
  export function planEntrances(input: PlanEntrancesInput): EntranceStamp[] {
168
- const plan = sectionEntrances(input.level, input.family);
224
+ const plan = sectionEntrances(input.level, input.family, input.move);
169
225
  const stamp = (nodeId: string, spec: EntranceSpec, opts: EntranceActionOptions): EntranceStamp =>
170
226
  ({ nodeId, interaction: entranceInteraction(nodeId, entranceAction(spec, { ...opts, rtl: input.rtl })) });
171
227
  if (plan.content) {