@vectoriox/iox-ui 5.178.0 → 5.180.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.
@@ -1,13 +1,12 @@
1
1
  import { ComposedItem, ComposedPlaceholder, ComposedSite, openingContextOf, PlaceholderKind } from './compose-site';
2
2
  import { FingerprintedPage, wornOpenings } from './layout-fingerprint';
3
- import { LayoutIssue, LayoutIssueCode, LayoutLayerKind, LayoutPage, LayoutSection } from './layout-language';
4
- import { fallBackBySection, SectionFallbackLastResort, SectionSwapAction } from './layout-section-fallback';
3
+ import { LAYOUT_TEXT_KINDS, LayoutColour, LayoutLayer, LayoutLayerKind, LayoutSection } from './layout-language';
5
4
  import {
6
5
  checkOpening, drawnOpeningMix, OPENING_MIX_PROP, OpeningGround, OpeningMedia, OpeningMix, openingMixOfPlan, openingMixWords, OpeningMotion,
7
6
  openingTokenOf, openingTokenParts, typeLedGrounds, typeLedOpeningSection, typeLedOpeningWays,
8
7
  } from './opening-mix';
9
8
  import type { GenerationTier } from './site-plan.model';
10
- import { patternById, patternLinkSlots, patternOptionalParts, patternSlots, slotBudget } from './patterns';
9
+ import { patternById, patternLinkSlots, patternOptionalParts, patternPartSlots, patternSlots, slotBudget } from './patterns';
11
10
  import { SerializedNode, walkSerialized } from './serialized-node';
12
11
  import { SHOP_ROLES } from './shop-plan';
13
12
  import { ContentRole, PagePlan, PageSectionPlan, roleField, ShopResource, SitePlan } from './site-plan.model';
@@ -21,10 +20,11 @@ import { ContentRole, PagePlan, PageSectionPlan, roleField, ShopResource, SitePl
21
20
  * So, when the caller says which picture slots a picture fills (`PictureSupply`), a section whose picture stays empty is
22
21
  * composed TYPE-LED instead: the same words in the library's type-led pattern for that place (`TYPE_LED_SWAPS` — every
23
22
  * slot carried, never cut), an opening on a photo or film with nothing to show is left out (the page opens on its
24
- * type-led hero), a model-laid section holding an empty photo is given to the plan's ready-made section for its place (the
25
- * ONE fallback picker, `fallBackBySection`), and a list whose items have no picture at all shows its cards without the
26
- * picture part. Nothing is dropped from a pattern page: plan indices, section ids and every other slot's node id stay as
27
- * they were, so the caller's filled slots and its placements still name the same nodes.
23
+ * type-led hero), a model-laid section's empty photo stands in its own place as a ground plate of the look's colour — a
24
+ * composed page KEEPS its composition (2026-11-25, iox-ui#129 × #131): it is never handed back to ready-made sections —
25
+ * and a list whose items have no picture at all shows its cards without the picture part. Nothing is dropped from a
26
+ * page: plan indices, section ids and every other slot's node id stay as they were, so the caller's filled slots and its
27
+ * placements still name the same nodes.
28
28
  *
29
29
  * Pure: `composeSite` runs it when `ComposeContext.pictures` is given — absent, the plan composes exactly as it says.
30
30
  * The plan the caller stores is never rewritten: the picture-led choice stays in it, so a later build or redesign that
@@ -77,13 +77,11 @@ export enum TypeLedChangeKind {
77
77
  /** The home page's first screen had no picture to show: it opens type-led (`media:none`), a way no other site of the
78
78
  * studio opens — or, when its first section cannot give its words slot by slot, on that section (the mix left out). */
79
79
  Opening = 'opening',
80
- /** A model-laid section holding an empty photo was given to the plan's ready-made section. */
81
- LayoutSection = 'layout-section',
82
- /** A model-laid section holding an empty photo that no ready-made section fits keeps its words, its photos left out
83
- * (it is never dropped: the owner's or the model's copy is content). */
84
- LayoutWords = 'layout-words',
85
- /** A model-laid page that could not give its empty photos away section by section is made from its plan sections. */
86
- Layout = 'layout',
80
+ /** A model-laid section's empty photos (and an empty photo ground) are filled type-led in their own place: each a
81
+ * ground plate of the look's colour at the same layer, cell and motion — the composition kept (2026-11-25). The
82
+ * retired kinds `layout-section`, `layout-words` and `layout` handed composed sections or pages back to ready-made
83
+ * sections; a stored run's words for them stay as they were said. */
84
+ Plate = 'plate',
87
85
  /** A list's items have no picture at all: its cards show no picture part. */
88
86
  List = 'list',
89
87
  }
@@ -171,7 +169,12 @@ export function typeLedSection(section: PageSectionPlan, density: string | null)
171
169
  const linkSlots = new Set(patternLinkSlots(pattern));
172
170
  const links = Object.fromEntries(Object.entries(section.links ?? {}).map(([slot, route]) => [target.slots[slot], route] as const).filter(([slot]) => !!slot && linkSlots.has(slot)));
173
171
  const parts = new Set(patternOptionalParts(pattern));
174
- const without = (section.without ?? []).filter(w => parts.has(w));
172
+ // iox-ui#149: a part of the target that holds only slots the source has no place for would show the pattern's own
173
+ // sample ("The one sentence a reader should remember.") on the live site, words the picture-led section never
174
+ // showed — the swap leaves it out. (A slot the source has but left unsaid shows its sample either way.)
175
+ const mapped = new Set(Object.values(target.slots));
176
+ const unsaid = Object.entries(patternPartSlots(pattern)).filter(([, held]) => held.length && !held.some(s => mapped.has(s))).map(([part]) => part);
177
+ const without = [...new Set([...(section.without ?? []).filter(w => parts.has(w)), ...unsaid])];
175
178
  const next: PageSectionPlan = {
176
179
  pattern: target.pattern,
177
180
  ...(Object.keys(slots).length ? { slots } : {}),
@@ -225,56 +228,81 @@ function layerOf(nodeId: string): { section: number; layer: number } | null {
225
228
  return m ? { section: Number(m[1]), layer: Number(m[2]) } : null;
226
229
  }
227
230
 
228
- /** The layers that hold words (what a section must keep when its photos go). */
229
- const WORD_LAYERS: ReadonlySet<string> = new Set([
230
- LayoutLayerKind.Word, LayoutLayerKind.Heading, LayoutLayerKind.Text, LayoutLayerKind.Label, LayoutLayerKind.Number,
231
- LayoutLayerKind.Button, LayoutLayerKind.List, LayoutLayerKind.Form, LayoutLayerKind.Marquee,
232
- ]);
233
- const GRID_COLUMNS = 12;
234
- /** The widest the words of a section whose photos went may grow to (columns): a reading measure, never the full grid. */
235
- const WORDS_MEASURE = 10;
236
- const BOX_PHOTO = 'photo:box:';
237
- const PLAIN_GROUND = 'ground';
231
+ /** A composed section's photo ground (`<page>-s<section>-ground`). */
232
+ const GROUND_NODE = /-s\d+-ground$/;
233
+ const PHOTO_GROUND = 'photo:';
234
+ /** The layer kinds whose picture a plate stands in for. */
235
+ const PICTURE_LAYERS: ReadonlySet<string> = new Set([LayoutLayerKind.Photo, LayoutLayerKind.Gallery]);
236
+ /** Word colours that read on a dark plate (the rest read on a light one). */
237
+ const LIGHT_WORDS: ReadonlySet<string> = new Set([LayoutColour.Ground, LayoutColour.Soft]);
238
+
239
+ /** The plates a section's ground takes, in order — the n-th plate of a section the n-th colour, so plates stacked in one
240
+ * cell still show their movement. Never the section's own ground. */
241
+ const PLATE_COLOURS: Readonly<Record<string, ReadonlyArray<LayoutColour>>> = {
242
+ [LayoutColour.Ground]: [LayoutColour.Soft, LayoutColour.Accent, LayoutColour.Ink],
243
+ [LayoutColour.Soft]: [LayoutColour.Ground, LayoutColour.Accent, LayoutColour.Ink],
244
+ [LayoutColour.Ink]: [LayoutColour.Accent, LayoutColour.Soft, LayoutColour.Ground],
245
+ [LayoutColour.Muted]: [LayoutColour.Soft, LayoutColour.Accent, LayoutColour.Ground],
246
+ [LayoutColour.Accent]: [LayoutColour.Ink, LayoutColour.Soft, LayoutColour.Ground],
247
+ };
248
+
249
+ const cellsMeet = (a: Pick<LayoutLayer, 'col' | 'row'>, b: Pick<LayoutLayer, 'col' | 'row'>) =>
250
+ a.col[0] < b.col[1] && b.col[0] < a.col[1] && a.row[0] < b.row[1] && b.row[0] < a.row[1];
251
+ const lightWords = (l: LayoutLayer) => LIGHT_WORDS.has(String(l.color ?? LayoutColour.Ink));
252
+
253
+ /**
254
+ * The colour a ground plate stands in, in a section on `ground`: under words laid over it, the ground those words read
255
+ * on (light words → the ink, dark words → the soft — the ground when the section is soft); else the `nth` of the
256
+ * ground's rotation. A calm look never takes the accent. Pure.
257
+ */
258
+ export function typeLedPlateColour(section: Pick<LayoutSection, 'layers'>, ground: string, plate: LayoutLayer, nth: number, calm: boolean): LayoutColour {
259
+ const over = section.layers.filter(o => o !== plate && LAYOUT_TEXT_KINDS.has(o.kind) && (o.z ?? 0) > (plate.z ?? 0) && cellsMeet(o, plate));
260
+ if (over.length) return over.some(lightWords) ? LayoutColour.Ink : ground === LayoutColour.Soft ? LayoutColour.Ground : LayoutColour.Soft;
261
+ const rotation = (PLATE_COLOURS[ground] ?? PLATE_COLOURS[LayoutColour.Ground]).filter(c => !calm || c !== LayoutColour.Accent);
262
+ return rotation[nth % rotation.length];
263
+ }
238
264
 
239
265
  /**
240
- * A model-laid section with its empty photos left out — its words kept where the model put them, given the width the
241
- * photos held beside them (centred, at most a reading measure) and the rows they held under them (empty rows close up,
242
- * the section's height following unless it is pinned). Null when it says nothing without its photos. Pure.
266
+ * A model-laid section with its empty pictures filled type-led IN PLACE (2026-11-25, a composed page keeps its
267
+ * composition): each layer in `plates` becomes a ground plate — a `shape` at the same index, cell, depth, entrance and
268
+ * scroll motion (so every node id and the signature's mechanism stay), painted `typeLedPlateColour`; an empty photo
269
+ * ground (`ground`) becomes a plain ground the section's words read on (the ink under light words, else the soft). On a
270
+ * phone a shape is hidden, as every shape is: the words stack on the section's ground. Pure.
243
271
  */
244
- export function typeLedLayoutSection(section: LayoutSection, gone: ReadonlySet<number>): LayoutSection | null {
245
- const kept = section.layers.map((layer, i) => ({ layer, i })).filter(x => !gone.has(x.i));
246
- if (!kept.some(x => WORD_LAYERS.has(x.layer.kind))) return null;
247
- const index = new Map(kept.map((x, n) => [x.i, n] as const));
248
- const photos = [...gone].map(i => section.layers[i]).filter(Boolean);
249
- const words = kept.filter(x => x.layer.kind !== LayoutLayerKind.Shape).map(x => x.layer);
250
- const from = Math.min(...words.map(l => l.col[0]));
251
- const to = Math.max(...words.map(l => l.col[1]));
252
- const beside = photos.length > 0 && photos.every(p => p.col[0] >= to || p.col[1] <= from);
253
- const width = Math.max(1, to - from);
254
- const grown = beside ? Math.min(WORDS_MEASURE, GRID_COLUMNS, width + Math.max(...photos.map(p => p.col[1] - p.col[0]))) : width;
255
- const start = beside ? 1 + Math.floor((GRID_COLUMNS - grown) / 2) : from;
256
- const col = (c: number): number => (beside ? start + Math.round(((c - from) * grown) / width) : c);
257
- const used = new Set<number>();
258
- for (const { layer } of kept) for (let r = layer.row[0]; r < layer.row[1]; r++) used.add(r);
259
- const line = (r: number): number => 1 + [...used].filter(u => u < r).length;
260
- const rows = used.size;
261
- const layers = kept.map(({ layer }) => {
262
- const c0 = col(layer.col[0]);
263
- return { ...layer, col: [c0, Math.max(c0 + 1, col(layer.col[1]))] as [number, number], row: [line(layer.row[0]), line(layer.row[1])] as [number, number] };
272
+ export function typeLedPlates(section: LayoutSection, plates: ReadonlySet<number>, ground: boolean, calm: boolean): LayoutSection {
273
+ const words = section.layers.filter(l => LAYOUT_TEXT_KINDS.has(l.kind));
274
+ const plain = words.some(lightWords) ? LayoutColour.Ink : LayoutColour.Soft;
275
+ const swapped = ground && String(section.ground ?? '').startsWith(PHOTO_GROUND);
276
+ const sectionGround = swapped ? plain : String(section.ground ?? LayoutColour.Ground);
277
+ let nth = 0;
278
+ const layers = section.layers.map((layer, i) => {
279
+ if (!plates.has(i) || !PICTURE_LAYERS.has(layer.kind)) return layer;
280
+ const { photo: _photo, gallery: _gallery, fit: _fit, inner: _inner, ...kept } = layer;
281
+ return { ...kept, kind: LayoutLayerKind.Shape, color: typeLedPlateColour(section, sectionGround, layer, nth++, calm) } as LayoutLayer;
264
282
  });
265
- const screens = section.pin ? section.screens : Math.max(1, Math.round((section.screens * rows) / Math.max(1, section.rows)));
266
- const ground = section.ground?.startsWith(BOX_PHOTO) ? PLAIN_GROUND : section.ground;
267
- const { phone, ...rest } = section;
268
- const order = phone?.filter(i => index.has(i)).map(i => index.get(i)!);
269
- return { ...rest, ...(ground !== undefined ? { ground } : {}), screens, rows, layers, ...(order?.length ? { phone: order } : {}) };
283
+ return { ...section, ...(swapped ? { ground: sectionGround } : {}), layers };
270
284
  }
271
285
 
272
- const SAID_LAYOUT = 'holds a photo nothing fills';
273
- /** A model-laid page that would lose more than a third of its sections to empty photos is made from its plan sections
274
- * instead: a page of three survivors is thinner than the plan's own page (its type-led sections). Only a section that
275
- * says nothing without its photos is lost now. */
276
- const THIN_SHARE = 3;
277
- const keepAsLaid = (page: LayoutPage) => ({ page, issues: [] as LayoutIssue[] });
286
+ /** What a section of a model-laid page holds that nothing fills: its picture layers (every picture of each empty), its
287
+ * photo ground. */
288
+ interface LaidEmpty {
289
+ layers: Set<number>;
290
+ ground: boolean;
291
+ }
292
+
293
+ /** How many picture placeholders each layer of a model-laid page holds (`<section>:<layer>`), filled or not. */
294
+ function picturesByLayer(placeholders: ReadonlyArray<ComposedPlaceholder>, owner: string, roots: ReadonlyMap<string, RootOf>): Map<string, number> {
295
+ const out = new Map<string, number>();
296
+ for (const p of placeholders) {
297
+ if (p.owner !== owner || !isPictureKind(p.kind)) continue;
298
+ const laid = roots.get(p.nodeId)?.laid ?? -1;
299
+ const at = layerOf(p.nodeId);
300
+ if (laid < 0 || !at || at.section !== laid) continue;
301
+ const key = `${laid}:${at.layer}`;
302
+ out.set(key, (out.get(key) ?? 0) + 1);
303
+ }
304
+ return out;
305
+ }
278
306
 
279
307
  /** What a type-led round needs of the build beyond the plan: its tier and the studio's memory. */
280
308
  export interface TypeLedRoundContext {
@@ -348,14 +376,16 @@ export function typeLedRound(
348
376
  changes.push({ kind: TypeLedChangeKind.Section, page: page.key, at: i, from: section.pattern, to: led.to, said: `${page.name}: ${section.pattern} has no picture — ${led.to} says its words` });
349
377
  return true;
350
378
  };
379
+ const calm = CALM_ANIMATE.has(String(plan.design?.animate ?? ''));
351
380
  const pages = plan.pages.map((page, p) => {
352
381
  const made = composed.pages.find(c => c.key === page.key) ?? composed.pages[p];
353
382
  const mine = empty.filter(e => e.owner === page.key);
354
383
  if (!made || !mine.length) return page;
355
384
  const roots = rootsOf(page, made.layout);
356
- const laid = new Map<number, Set<number>>();
385
+ const laid = new Map<number, LaidEmpty>();
357
386
  const planAt = new Set<number>();
358
387
  let first = false;
388
+ const laidOf = (i: number): LaidEmpty => laid.get(i) ?? laid.set(i, { layers: new Set(), ground: false }).get(i)!;
359
389
  for (const e of mine) {
360
390
  const where = roots.get(e.nodeId);
361
391
  if (!where) continue;
@@ -363,9 +393,8 @@ export function typeLedRound(
363
393
  if (where.opening) continue;
364
394
  if (where.laid >= 0) {
365
395
  const at = layerOf(e.nodeId);
366
- const layers = laid.get(where.laid) ?? new Set<number>();
367
- if (at && at.section === where.laid) layers.add(at.layer);
368
- laid.set(where.laid, layers);
396
+ if (at && at.section === where.laid) laidOf(where.laid).layers.add(at.layer);
397
+ else if (GROUND_NODE.test(e.nodeId)) laidOf(where.laid).ground = true;
369
398
  } else if (where.planAt >= 0) planAt.add(where.planAt);
370
399
  }
371
400
  let next: PagePlan = page;
@@ -376,46 +405,27 @@ export function typeLedRound(
376
405
  if (swapSection(page, copy, i)) sections = copy;
377
406
  }
378
407
  if (sections) next = { ...next, sections };
379
- // A section the model laid with a photo nothing fills: the plan's ready-made section for its place (the ONE
380
- // fallback picker); one no ready-made section fits keeps its words with its photos left out (never dropped); the
381
- // whole page from its sections when no place can be given away.
408
+ // A composed page KEEPS its composition (2026-11-25): a section the model laid with a picture nothing fills is
409
+ // filled type-led in its own place — never handed to a ready-made section, the page never made from its sections.
382
410
  if (page.layout && laid.size) {
383
- const issues: LayoutIssue[] = [...laid.keys()].map(i => ({ code: LayoutIssueCode.Content, path: `sections[${i}]`, message: `sections[${i}] ${SAID_LAYOUT}` }));
384
- const fallback = fallBackBySection(page.layout, next.sections, issues, keepAsLaid);
385
- const words = new Map<number, LayoutSection>();
386
- for (const w of fallback.swaps) {
387
- if (w.action !== SectionSwapAction.Dropped) continue;
388
- const kept = typeLedLayoutSection(page.layout.sections[w.at], laid.get(w.at) ?? new Set());
389
- if (kept) words.set(w.at, kept);
390
- }
391
- const dropped = fallback.swaps.filter(w => w.action === SectionSwapAction.Dropped && !words.has(w.at)).length;
392
- const thin = dropped * THIN_SHARE > page.layout.sections.length;
393
- if (fallback.lastResort || thin) {
394
- const why = thin ? `${dropped} of its ${page.layout.sections.length} sections would be left out`
395
- : fallback.lastResort === SectionFallbackLastResort.NoReadyMade ? 'no ready-made section left for a place' : 'its empty photos could not be given away';
396
- changes.push({ kind: TypeLedChangeKind.Layout, page: page.key, said: `${page.name}: made from its sections — ${why}` });
397
- const { layout: _laid, ...rest } = next;
398
- next = rest as PagePlan;
399
- } else {
400
- for (const swap of fallback.swaps) {
401
- const kept = words.get(swap.at);
402
- changes.push({
403
- kind: kept ? TypeLedChangeKind.LayoutWords : TypeLedChangeKind.LayoutSection, page: page.key, at: swap.at, ...(swap.readyMade ? { to: swap.readyMade.pattern } : {}),
404
- said: `${page.name}: section ${swap.at + 1} ${SAID_LAYOUT} — ${swap.readyMade ? `the ready-made ${swap.readyMade.pattern} stands there` : kept ? 'its words stay, its photos left out' : 'left out (it says nothing without its photos)'}`,
405
- });
406
- }
407
- // The dropped places that keep their words go back where the model laid them.
408
- const swapped = new Set(fallback.swaps.filter(w => w.action === SectionSwapAction.Dropped).map(w => w.at));
409
- const left = [...fallback.page.sections];
410
- const sectionsBack: LayoutSection[] = [];
411
- page.layout.sections.forEach((_, i) => {
412
- if (words.has(i)) sectionsBack.push(words.get(i)!);
413
- else if (!swapped.has(i)) sectionsBack.push(left.shift()!);
411
+ const pictured = picturesByLayer(composed.placeholders, page.key, roots);
412
+ const unfilled = picturesByLayer(mine, page.key, roots);
413
+ let plated = false;
414
+ const laidSections = page.layout.sections.map((section, i) => {
415
+ const at = laid.get(i);
416
+ if (!at) return section;
417
+ // A layer becomes a plate only when no picture of it is filled (a gallery with one filled slide stays).
418
+ const plates = new Set([...at.layers].filter(li => PICTURE_LAYERS.has(section.layers[li]?.kind) && pictured.get(`${i}:${li}`) === unfilled.get(`${i}:${li}`)));
419
+ if (!plates.size && !at.ground) return section;
420
+ plated = true;
421
+ const n = plates.size;
422
+ changes.push({
423
+ kind: TypeLedChangeKind.Plate, page: page.key, at: i,
424
+ said: `${page.name}: section ${i + 1} (${section.id}) ${n ? `holds ${n === 1 ? 'a photo' : `${n} photos`} nothing fills — ${n === 1 ? 'it stands' : 'each stands'} as a plate of the look's colour in its place` : 'stands on a photo nothing fills — it stands on a ground of the look'}${n && at.ground ? ', on a ground of the look' : ''}, the composition kept`,
414
425
  });
415
- const givenAway = (fallback.page.givenAway ?? []).filter(g => !words.has(g.at));
416
- next = { ...next, layout: { ...fallback.page, sections: sectionsBack, ...(givenAway.length ? { givenAway } : {}) } };
417
- if (!givenAway.length) delete (next.layout as { givenAway?: unknown }).givenAway;
418
- }
426
+ return typeLedPlates(section, plates, at.ground, calm);
427
+ });
428
+ if (plated) next = { ...next, layout: { ...page.layout, sections: laidSections } };
419
429
  }
420
430
  if (first) { firstScreen = next; homeAt = p; }
421
431
  return next;
@@ -26,3 +26,4 @@ export * from './starting-design';
26
26
  export * from './film-idea';
27
27
  export * from './popup-stance';
28
28
  export * from './site-audit-view';
29
+ export * from './run-compose-context';
@@ -0,0 +1,47 @@
1
+ import { BuildComposeDecisions, ComposeContext, composeContextOf, GenerationTier, PictureSupply } from '@vectoriox/iox-ui/generation-core';
2
+
3
+ import { businessTypeById } from './business-types';
4
+ import { isCalmBusinessType } from './motion';
5
+
6
+ /**
7
+ * What a site build's run holds that its compose context reads — the server's run and the builder's copy of it
8
+ * (`GET …/site-builds/:id`, `SiteBuildRun`) both are one.
9
+ */
10
+ export interface ComposeRun {
11
+ year: number;
12
+ tier?: `${GenerationTier}` | null;
13
+ decisions?: BuildComposeDecisions | null;
14
+ pictures?: PictureSupply | null;
15
+ }
16
+
17
+ /**
18
+ * What the composer takes from the reading's kind of business (award §7.1g, AW12):
19
+ * - `businessType` — the footer's call word follows it (AW12-D15, generation-core `footerCallWord`);
20
+ * - `footerNever` — what that kind of business's footer never wears (AW12-D10, harness FOOTER_NEVER), mended and said by
21
+ * `checkFooter` (`type-never`).
22
+ * An unknown or absent type gives nothing: the composer's defaults hold. (`calm` stays `composeContextOf`'s own argument.)
23
+ */
24
+ export function businessComposeContext(typeId: string | null | undefined): Pick<ComposeContext, 'businessType' | 'footerNever'> {
25
+ const type = typeId ? businessTypeById(typeId) : undefined;
26
+ if (!type) return {};
27
+ const never = type.footer;
28
+ const refuses = !!never && (never.closings.length > 0 || never.grounds.length > 0);
29
+ return { businessType: type.id, ...(refuses ? { footerNever: never } : {}) };
30
+ }
31
+
32
+ /**
33
+ * THE compose context of a build run (moved from iox-cms `site-builds.service`, iox-cms-client#111): its year, its
34
+ * layouts' photos, its tier, the legal context its preflight read (AW1), whether its business is calm (AW6 — the body
35
+ * takes no shaped edge), its kind of business for the footer (AW12), and — once the stock step has placed the pictures —
36
+ * what fills them (iox-ui#129: a section nothing fills is composed type-led, an empty photo on a composed page a ground
37
+ * plate). ONE reading, so every compose of a run's plan — each step, a resumed step, a redesign, the builder's Re-fit —
38
+ * composes the same site. Pure.
39
+ */
40
+ export function runComposeContext(run: ComposeRun): ComposeContext {
41
+ const decisions = run.decisions ?? undefined;
42
+ const context: ComposeContext = {
43
+ ...composeContextOf(run.year, decisions?.layoutPhotos, run.tier ?? undefined, decisions?.legal ?? null, isCalmBusinessType(decisions?.businessType)),
44
+ ...businessComposeContext(decisions?.businessType),
45
+ };
46
+ return run.pictures ? { ...context, pictures: run.pictures } : context;
47
+ }