@vectoriox/iox-ui 5.200.0 → 5.202.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 (42) hide show
  1. package/design-core/index.d.ts +162 -5
  2. package/fesm2022/vectoriox-iox-ui-design-core.mjs +216 -12
  3. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  4. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +2783 -1318
  5. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  6. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +28 -12
  7. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
  8. package/fesm2022/vectoriox-iox-ui.mjs +85 -1
  9. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  10. package/generation-core/index.d.ts +988 -245
  11. package/harness-core/index.d.ts +21 -13
  12. package/index.d.ts +50 -2
  13. package/package.json +1 -1
  14. package/src/design-core/brand-neutrals.ts +50 -7
  15. package/src/design-core/colour-words.ts +22 -5
  16. package/src/design-core/design-settings.ts +5 -0
  17. package/src/design-core/design-token.model.ts +3 -0
  18. package/src/design-core/flavor-fixtures.generated.ts +38 -2
  19. package/src/design-core/flavor-spec.generated.ts +143 -1
  20. package/src/design-core/flavor-tokens.ts +6 -2
  21. package/src/generation-core/check-free.ts +36 -16
  22. package/src/generation-core/colour-mix.ts +70 -14
  23. package/src/generation-core/compose-site.ts +145 -28
  24. package/src/generation-core/fallback-memory.ts +8 -5
  25. package/src/generation-core/footer-free.ts +439 -0
  26. package/src/generation-core/footer-mix.ts +130 -36
  27. package/src/generation-core/free-parts.ts +3 -0
  28. package/src/generation-core/free-slot-words.ts +3 -0
  29. package/src/generation-core/free-wire.ts +10 -2
  30. package/src/generation-core/header-mix.ts +128 -19
  31. package/src/generation-core/layout-fingerprint.ts +6 -4
  32. package/src/generation-core/opening-mix.ts +61 -0
  33. package/src/generation-core/plan-wire.ts +1 -0
  34. package/src/generation-core/public-api.ts +1 -0
  35. package/src/generation-core/redesign-run.ts +45 -2
  36. package/src/generation-core/site-plan.model.ts +6 -0
  37. package/src/generation-core/site-spec.generated.ts +599 -22
  38. package/src/generation-core/validate-site-plan.ts +39 -1
  39. package/src/harness-core/business-types.ts +3 -1
  40. package/src/harness-core/harness-spec.generated.ts +24 -12
  41. package/src/harness-core/run-compose-context.ts +8 -1
  42. package/styles/iox-design.css +7 -4
@@ -4,6 +4,7 @@ import { LAYOUT_INSET } from './layout-column';
4
4
  import { GenerationTier } from './site-plan.model';
5
5
  import { tierOffers } from './part-tier';
6
6
  import { PatternNode, PatternPlaceholder, PatternRecipe, SitePattern } from './patterns';
7
+ import { hash53 } from './section-stamp';
7
8
  import { SerializedNode, walkSerialized } from './serialized-node';
8
9
  import { SPEC_SITE_LAYOUT } from './site-spec.generated';
9
10
  import { ENTRANCE_ORIGIN_LOOK } from './entrances';
@@ -61,6 +62,8 @@ interface OpeningTable {
61
62
  typeLedEveryTier?: boolean;
62
63
  /** iox-ui#131: the grounds a type-led first screen may stand on, in the order tried (`inverse` first, no word). */
63
64
  typeLedGrounds?: ReadonlyArray<string>;
65
+ /** iox-ui#192: the ways a Home on one still picture may open, per the frame its kind of business opens in. */
66
+ pictured?: Readonly<Record<string, ReadonlyArray<{ frame: string; words: string; after: string }>>>;
64
67
  }
65
68
 
66
69
  /** The ingredients, by the contract's keys (held equal to it by opening-mix.spec). */
@@ -443,6 +446,54 @@ export function typeLedOpeningWays(): OpeningMix[] {
443
446
  return (O.typeLed ?? []).map(w => openingMix({ frame: w.frame, words: w.words, media: OpeningMedia.None }));
444
447
  }
445
448
 
449
+ /** iox-ui#192: the ways a Home opening on one still picture may wear in a frame class (`full` · `inset`, harness
450
+ * OPENING_PICTURE), in the contract's order (`opening.pictured`) — empty for a class the contract names none for. */
451
+ export function picturedOpeningWays(frame: string): OpeningMix[] {
452
+ return (O.pictured?.[frame] ?? []).map(w => openingMix({ frame: w.frame, words: w.words }));
453
+ }
454
+
455
+ /** Where a seed lands in a list of `n` (the same seed, the same place). */
456
+ const seededStart = (seed: string, n: number): number => (n > 1 ? parseInt(hash53(seed).slice(-7), 36) % n : 0);
457
+
458
+ /**
459
+ * iox-ui#192 — a picture Home's way to open, chosen per site: the 11-29 re-score found seven Homes on a live-searched
460
+ * photo all wearing ONE arrangement (the picture edge to edge, a dark words card at the lower start), where the
461
+ * references open as the name over the picture, a framed card, a frame that settles. The kind of business's words
462
+ * (`given`, harness OPENING_PICTURE — `frame:full` or `frame:inset`, a still photo) name the frame class; its ways
463
+ * (`picturedOpeningWays`) the site carries unmended (`checkOpening`: the name's fit for a display-size name, the frame under
464
+ * a Pro float) are the choice, and the `seed` (the organization) picks among them — so two sites of one kind of business rarely
465
+ * open alike, and the same site always opens the same way (a rebuild of a kept plan, the pictures planned before the
466
+ * build). Every way keeps the picture as the frame's first child, so the picture's slot is the same. Anything but a still
467
+ * photo, or a class with no ways, is `given` as it is. Pure.
468
+ */
469
+ export function chooseOpeningWay(given: OpeningMix, ctx: OpeningContext, seed: string): OpeningMix {
470
+ const ways = given.media === OpeningMedia.Photo ? picturedOpeningWays(given.frame) : [];
471
+ if (!ways.length) return given;
472
+ // The ways the site carries unmended, and the seed's place among THEM — so a way the site cannot wear (a long name's
473
+ // wordmark, an inset card under a Pro float) never hands its share to the way after it.
474
+ const carried = ways.map(way => ({ ...given, frame: way.frame, words: way.words }))
475
+ .filter(mix => !checkOpening(drawnOpeningMix(mix).drawn, ctx).repairs.length);
476
+ return carried.length ? carried[seededStart(seed, carried.length)] : given;
477
+ }
478
+
479
+ /**
480
+ * HI3-D27 (Doron 2026-11-29: the floating header over a full-bleed opening from y=0) — does this build's picture opening
481
+ * stand full? On the Pro tier, where the kind of business's own opening (harness OPENING_PICTURE, `typeWords`) is edge to
482
+ * edge: its floating header stands over the picture, which starts at the top of the page under it. A kind of business
483
+ * that opens on an inset card keeps its card (the header floats on the page's ground above it); Basic is unchanged.
484
+ * `checkOpening` mends an inset or settling frame to full when it holds (`OpeningContext.fullFrame`), said. Pure.
485
+ */
486
+ export function opensFullUnderFloat(tier: `${GenerationTier}` | null | undefined, typeWords: ReadonlyArray<string> | null | undefined): boolean {
487
+ if (tier !== GenerationTier.Award || !typeWords?.length) return false;
488
+ try {
489
+ const mix = openingMixFromWords(typeWords);
490
+ return mix.frame === OpeningFrame.Full && mix.media !== OpeningMedia.None;
491
+ } catch (e) {
492
+ if (e instanceof OpeningMixError) return false;
493
+ throw e;
494
+ }
495
+ }
496
+
446
497
  /** #129: is the mix a type-led first screen (nothing to show but its words)? */
447
498
  export const openingIsTypeLed = (mix: Pick<OpeningMix, 'media'>): boolean => mix.media === OpeningMedia.None;
448
499
 
@@ -470,6 +521,9 @@ export enum OpeningRepairCode {
470
521
  DissolveNeedsPicture = 'dissolve-needs-picture',
471
522
  /** AW9: a dissolve grows the picture and fades the words itself — a slow zoom or copy-out beside it is left out. */
472
523
  DissolveAlone = 'dissolve-alone',
524
+ /** HI3-D27: a Pro header floats over the first screen from the top, and this kind of business opens edge to edge — an
525
+ * inset or settling frame stands full, the header over its picture. */
526
+ FullUnderFloat = 'full-under-float',
473
527
  }
474
528
 
475
529
  export interface OpeningRepair {
@@ -493,6 +547,9 @@ export interface OpeningContext {
493
547
  readonly film?: boolean;
494
548
  /** The owner's own badge words; `null` = none given (the generator: left out), absent = a placeholder (the builder). */
495
549
  readonly badge?: string | null;
550
+ /** HI3-D27 (`opensFullUnderFloat`): a Pro site whose kind of business opens edge to edge — its floating header stands
551
+ * over the first screen's picture from y=0, so a pictured frame is full. Absent: any frame (the builder, Basic). */
552
+ readonly fullFrame?: boolean;
496
553
  }
497
554
 
498
555
  /** A display word must stand this large on a 1440 laptop, and the longest word fit a 375 phone at this size (px). */
@@ -589,6 +646,10 @@ export function checkOpening(mix: OpeningMix, ctx: OpeningContext): { mix: Openi
589
646
  const m: OpeningMix = { ...mix, extras: [...mix.extras], motion: [...mix.motion] };
590
647
  const repairs: OpeningRepair[] = [];
591
648
  const say = (code: OpeningRepairCode, said: string) => repairs.push({ code, said });
649
+ if (ctx.fullFrame && m.media !== OpeningMedia.None && (m.frame === OpeningFrame.Inset || m.frame === OpeningFrame.Shrinks)) {
650
+ m.frame = OpeningFrame.Full;
651
+ say(OpeningRepairCode.FullUnderFloat, 'a Pro header floats over the first screen from the top: the picture stands edge to edge under it, as this kind of business opens');
652
+ }
592
653
  if (m.media === OpeningMedia.Film && ctx.film === false) {
593
654
  m.media = OpeningMedia.Photo;
594
655
  say(OpeningRepairCode.FilmIsTheOwners, 'a looping film is the owner\'s own clip, and there is none yet: a picture stands in, filled by their photo or one that fits the business');
@@ -319,6 +319,7 @@ export const PLAN_WIRE_DERIVED: Readonly<Record<string, string>> = {
319
319
  freePage: 'the free step: a page the model writes free, on its own wire, set by the server (FS3)',
320
320
  freeRead: 'the free step (FS3)',
321
321
  freeNode: 'the free step (FS3)',
322
+ 'plan.freeFooter': 'the free step: the footer laid freely on the free request, set by the server once it passed checkFreeFooter (footer-v2 FV2)',
322
323
  'plan.popup': "the owner's popup lines: the reading's stated news and the Plan step's ticks (the context, popups PU3)",
323
324
  popupLines: "the owner's popup lines (the context, popups PU3)",
324
325
  statedFact: "the reading's stated fact (the context, popups PU3)",
@@ -98,6 +98,7 @@ export * from './popup-plan';
98
98
  export * from './opening-edit';
99
99
  export * from './footer-mix';
100
100
  export * from './footer-sign-up';
101
+ export * from './footer-free';
101
102
  export * from './layout-edits';
102
103
  export * from './adjustments';
103
104
  export * from './site-tree';
@@ -1,4 +1,8 @@
1
- import { DesignChoices, DesignConfigEntry, DesignRevertSnapshot, readDesignConfig } from '@vectoriox/iox-ui/design-core';
1
+ import { ColourWordKey, DesignChoices, DesignConfigEntry, DesignRevertSnapshot, readDesignConfig, resolveColourWords } from '@vectoriox/iox-ui/design-core';
2
+
3
+ import { ColourIngredient, ColourRhythm, colourDesignWords, colourMixOfPlan, colourWordDrawn, colourWords, drawnColourMix } from './colour-mix';
4
+ import { shapeKeys } from './shape-check';
5
+ import { SPEC_SITE_PLAN_SHAPE } from './site-spec.generated';
2
6
 
3
7
  import type { ComposedPlaceholder } from './compose-site';
4
8
  import type { LayoutIssue } from './layout-language';
@@ -6,7 +10,7 @@ import type { SerializedNode } from './serialized-node';
6
10
  import type { AdditionIssue, AdditionOrigin } from './redesign-additions';
7
11
  import type { AiRefusal } from './ai-run';
8
12
  import { BuildStepError, BuildStepRecord, CreatedRecord, SiteBuildKind, SiteBuildStatus, UndoKept } from './site-build-run';
9
- import type { PagePlan } from './site-plan.model';
13
+ import type { PagePlan, SitePlan } from './site-plan.model';
10
14
 
11
15
  /**
12
16
  * A REDESIGN run's wire vocabulary (site-redesign plan §3c, RD2): a new design for a built site, with everything it holds
@@ -429,3 +433,42 @@ export function redesignDiscardable(run: Pick<RedesignRun, 'status' | 'switch'>)
429
433
  export function isRedesignRun(run: { kind?: unknown } | null | undefined): boolean {
430
434
  return run?.kind === SiteBuildKind.Redesign;
431
435
  }
436
+
437
+ /** The keys a plan's design may carry (contract `site.planShape.design`). */
438
+ const PLAN_DESIGN_KEYS: ReadonlySet<string> = new Set(shapeKeys(SPEC_SITE_PLAN_SHAPE.design));
439
+ /** The colour WORDS a look carries as tokens (Colour v2 CV2 + CV3) — in a plan they live in `mixes.colour` under the same
440
+ * key. CV5's `flow` is a yes/no on the look and a RHYTHM word in the plan (`rhythm:flow`), so it is carried apart. */
441
+ type LookColourWordKey = Exclude<ColourWordKey, 'flow'>;
442
+ const LOOK_COLOUR_KEYS: ReadonlyArray<LookColourWordKey> = ['ground', 'dark', 'action', 'wash'];
443
+
444
+ /** The mix word a look's ABSENT colour word means (ground `look`, dark `ink`, button `accent`, wash `flat`): the first word
445
+ * of the contract's ingredient that is drawn and carries no token. */
446
+ function absentColourWord(key: LookColourWordKey): string {
447
+ return colourWords(key).find(w => colourWordDrawn(key, w) && resolveColourWords({ [key]: w })[key] === undefined) ?? colourWords(key)[0];
448
+ }
449
+
450
+ /**
451
+ * A look (`DesignChoices`, as a design row reads back) as a plan wears it (site-redesign onto a new look; Colour v2 CV2):
452
+ * `design` holds only the keys the plan shape names, and the look's colour words (ground · dark · button · wash) go into
453
+ * `mixes.colour`, so the plan is composed and judged by the words the live site will wear. The inverse of
454
+ * `planDesignChoices`: `planDesignChoices({ ...plan, ...designForPlan(plan, look) })` wears `look`'s colour words. A word
455
+ * the plan already wears (its own, else its new style's row) is left as it is; every other colour word of the plan is kept.
456
+ * Pure.
457
+ */
458
+ export function designForPlan(plan: Pick<SitePlan, 'mixes' | 'design'>, look: Partial<DesignChoices> | Readonly<Record<string, unknown>>): Pick<SitePlan, 'design' | 'mixes'> {
459
+ const design = Object.fromEntries(Object.entries(look ?? {}).filter(([key]) => PLAN_DESIGN_KEYS.has(key))) as unknown as SitePlan['design'];
460
+ const mix = colourMixOfPlan({ mixes: plan.mixes, design });
461
+ const wanted = resolveColourWords(look as Partial<Record<ColourWordKey, unknown>>);
462
+ // A flowing plan wears no wash (`rules.flowWearsFlat`), so its own wash is hidden, not gone: a look that holds still is
463
+ // compared with the wash the plan WILL wear once it stops flowing (else a style row's glow comes back unasked).
464
+ const worn = wanted.flow ? colourDesignWords(mix) : { ...colourDesignWords(mix), wash: resolveColourWords({ wash: drawnColourMix(mix).drawn.wash }).wash };
465
+ const changed = LOOK_COLOUR_KEYS.filter(key => wanted[key] !== worn[key]);
466
+ // CV5: the look flows or holds still — the plan's rhythm says the same (a look that holds still stands on one ground,
467
+ // the word the colour check mends a flow to, so a style whose row flows does not flow again under it).
468
+ const flowChanged = !!wanted.flow !== !!worn.flow;
469
+ if (!changed.length && !flowChanged) return { design, ...(plan.mixes ? { mixes: plan.mixes } : {}) };
470
+ const replaced: ReadonlyArray<string> = [...changed, ...(flowChanged ? [ColourIngredient.Rhythm] : [])];
471
+ const kept = (plan.mixes?.colour ?? []).filter(word => !replaced.includes(String(word).split(':')[0]));
472
+ const rhythm = flowChanged ? [`${ColourIngredient.Rhythm}:${wanted.flow ? ColourRhythm.Flow : ColourRhythm.OneGround}`] : [];
473
+ return { design, mixes: { ...plan.mixes, colour: [...kept, ...changed.map(key => `${key}:${wanted[key] ?? absentColourWord(key)}`), ...rhythm] } };
474
+ }
@@ -389,6 +389,12 @@ export interface SitePlan {
389
389
  /** Popups PU3: the owner's popup lines from the Plan step (the reading's stated news, the newsletter tick) — set by the
390
390
  * server, never a model's. A generated site gets a popup only from one of them (R-H6, `checkPopup`). */
391
391
  readonly popup?: PlanPopupLines;
392
+ /**
393
+ * FV2 (footer-v2 §4, FV-D1): the footer the model laid freely on the free request — ONE Section `purpose: footer` of
394
+ * Containers and `footer:<part>` Slots (footer-free.ts), set by the server once it passed `checkFreeFooter`, never by a
395
+ * model. When present the site's footer is stamped from it (`freeFooterOrMix`); `mixes.footer` stays its fall back.
396
+ */
397
+ readonly freeFooter?: FreeNode;
392
398
  }
393
399
 
394
400
  /** A fact the owner STATED (harness `statedFacts`): its value and the owner's own words it was read from. */