@vectoriox/iox-ui 5.197.0 → 5.198.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.
- package/composite-core/index.d.ts +16 -2
- package/design-core/index.d.ts +160 -28
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +34 -2
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +259 -72
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +1845 -396
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +2 -2
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +1286 -184
- package/package.json +1 -1
- package/src/composite-core/header.ts +34 -1
- package/src/design-core/brand.ts +58 -5
- package/src/design-core/contrast-audit.ts +49 -22
- package/src/design-core/design-apply.ts +34 -3
- package/src/design-core/flavor-fixtures.generated.ts +123 -123
- package/src/design-core/flavor-spec.generated.ts +44 -4
- package/src/design-core/flavor-tokens.ts +1 -1
- package/src/design-core/header-behaviour.ts +72 -13
- package/src/design-core/motion-language.ts +5 -14
- package/src/design-core/preloader.ts +4 -5
- package/src/generation-core/body-mix.ts +40 -102
- package/src/generation-core/check-free.ts +5 -2
- package/src/generation-core/check-layout.ts +10 -4
- package/src/generation-core/check-list.ts +3 -25
- package/src/generation-core/colour-mix.ts +296 -0
- package/src/generation-core/compose-free.ts +40 -18
- package/src/generation-core/compose-site.ts +92 -13
- package/src/generation-core/footer-mix.ts +102 -54
- package/src/generation-core/free-fallback.ts +6 -4
- package/src/generation-core/free-parts.ts +87 -0
- package/src/generation-core/free-slot-words.ts +30 -0
- package/src/generation-core/generation-tier.ts +6 -17
- package/src/generation-core/header-mix.ts +42 -1
- package/src/generation-core/layout-drawers.ts +3 -2
- package/src/generation-core/layout-wire.ts +10 -16
- package/src/generation-core/list-panel.ts +3 -3
- package/src/generation-core/list-table.ts +5 -14
- package/src/generation-core/list-words.ts +2 -1
- package/src/generation-core/opening-mix.ts +7 -34
- package/src/generation-core/part-tier.ts +14 -0
- package/src/generation-core/plan-wire.ts +31 -43
- package/src/generation-core/public-api.ts +2 -0
- package/src/generation-core/site-spec.generated.ts +1127 -93
- package/src/generation-core/validate-site-plan.ts +4 -5
- package/styles/iox-design.css +137 -3
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { FormPresetId } from '@vectoriox/iox-ui/forms-core';
|
|
2
|
+
|
|
3
|
+
import type { FreeSlotOffer } from './check-free';
|
|
4
|
+
import { fieldsOf, layoutGalleryLists, layoutListBinding, layoutListShapes, listedContentType, quoteListOf } from './compose-site';
|
|
5
|
+
import { LIST_INGREDIENTS, listBuiltWords, ListIngredient, listWordOffered, listWordRefusal } from './list-table';
|
|
6
|
+
import { PatternRecipe } from './patterns';
|
|
7
|
+
import { recipeListBinds } from './recipe-fields';
|
|
8
|
+
import { SitePlan } from './site-plan.model';
|
|
9
|
+
import { FREE_OPEN_LIGHTBOX, FREE_SLOT_SEPARATOR, FreeSlotKind, freeSlotWord } from './free-slot-words';
|
|
10
|
+
|
|
11
|
+
export * from './free-slot-words';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* THE PARTS A FREE PAGE MAY PLACE (award-ingredients-plan §11.4, FS3; R-H2; "basic parts", 2026-11-28). A free page is
|
|
15
|
+
* the main path for a new site, so a part the product has built reaches a generated site only when a free page is
|
|
16
|
+
* OFFERED it. The ONE offer, read by iox-cms's free gate (the wire's `slot` enum, the brief, the judge) and by the free
|
|
17
|
+
* stamp (`composeFreePage`, which places each by its slot word). Every part is the builder palette's own recipe, bound
|
|
18
|
+
* to the plan's content — never words the model writes, so nothing here can state a fact the owner did not give:
|
|
19
|
+
*
|
|
20
|
+
* - `list:<alias>` — a list the plan shows with pictures (`composeListFrame`); its `opts` are the built list words the
|
|
21
|
+
* list can carry (every tier's since AW-D42) and `open:lightbox` (CC3: a click on a picture opens it large, at the
|
|
22
|
+
* clicked item) when the list has pictures and no page per item.
|
|
23
|
+
* - `accordion:<alias>` — CC2's Accordion over a list whose type fills it (a question and an answer field), never a list
|
|
24
|
+
* of quotes.
|
|
25
|
+
* - `tabs:<alias>` — CC4a's Tabs over a list whose type fills them (a short label and a longer text), never a list of
|
|
26
|
+
* quotes.
|
|
27
|
+
* - `quotes:<alias>` — CC3's testimonial carousel over the plan's list of REAL quotes (`quoteListOf`, iox-ui#132):
|
|
28
|
+
* offered only when the plan holds one, so a quote is never invented.
|
|
29
|
+
* - `form:contact` — the forms-core contact preset, the one every business takes.
|
|
30
|
+
*
|
|
31
|
+
* Pure.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/** The form every free page may place. */
|
|
35
|
+
export const FREE_FORM_PRESET: string = FormPresetId.Contact;
|
|
36
|
+
|
|
37
|
+
/** The recipe a list-bound slot kind places (and whose fields `recipeListBinds` checks). */
|
|
38
|
+
const LIST_RECIPE_SLOTS: ReadonlyArray<readonly [FreeSlotKind, PatternRecipe]> = [
|
|
39
|
+
[FreeSlotKind.Accordion, PatternRecipe.Accordion],
|
|
40
|
+
[FreeSlotKind.Tabs, PatternRecipe.Tabs],
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
/** The list ingredients a free list slot's options are drawn from: how items are arranged and how a row moves (a row
|
|
44
|
+
* that turns by itself or by arrows is the carousel). */
|
|
45
|
+
const LIST_OPTION_INGREDIENTS: ReadonlyArray<ListIngredient> = LIST_INGREDIENTS.filter(k => k === 'arrange' || k === 'move');
|
|
46
|
+
|
|
47
|
+
/** Every part a free page of `plan` may place, by slot word (see the module's comment). */
|
|
48
|
+
export function freeSlotOffers(plan: SitePlan, tier?: string | null): Record<string, FreeSlotOffer> {
|
|
49
|
+
const offers: Record<string, FreeSlotOffer> = {};
|
|
50
|
+
const shapes = layoutListShapes(plan);
|
|
51
|
+
for (const list of layoutGalleryLists(plan).filter(l => l.pictures)) {
|
|
52
|
+
const shape = shapes.find(s => s.alias === list.alias) ?? null;
|
|
53
|
+
const words = LIST_OPTION_INGREDIENTS.flatMap(k => listBuiltWords(k)
|
|
54
|
+
.filter(w => listWordOffered(k, w, tier) && listWordRefusal(k, w, shape, tier) === null)
|
|
55
|
+
.map(w => `${k}${FREE_SLOT_SEPARATOR}${w}`));
|
|
56
|
+
const detail = !!layoutListBinding(list.alias, plan)?.detail;
|
|
57
|
+
offers[freeSlotWord(FreeSlotKind.List, list.alias)] = { kind: FreeSlotKind.List, ref: list.alias, opts: detail ? words : [...words, FREE_OPEN_LIGHTBOX] };
|
|
58
|
+
}
|
|
59
|
+
for (const list of layoutGalleryLists(plan)) {
|
|
60
|
+
const type = listedContentType(list.alias, plan);
|
|
61
|
+
// A list of quotes is shown as quotes only — never as questions or tabs made of someone's words.
|
|
62
|
+
if (type?.roles.quote) continue;
|
|
63
|
+
const fields = fieldsOf(type);
|
|
64
|
+
for (const [kind, recipe] of LIST_RECIPE_SLOTS) {
|
|
65
|
+
if (recipeListBinds(recipe, fields).gap === null) offers[freeSlotWord(kind, list.alias)] = { kind, ref: list.alias };
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const quotes = quoteListOf(plan);
|
|
69
|
+
if (quotes) offers[freeSlotWord(FreeSlotKind.Quotes, quotes.source)] = { kind: FreeSlotKind.Quotes, ref: quotes.source };
|
|
70
|
+
offers[freeSlotWord(FreeSlotKind.Form, FREE_FORM_PRESET)] = { kind: FreeSlotKind.Form, ref: FREE_FORM_PRESET };
|
|
71
|
+
return offers;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** What each slot kind places, in the words the model reads (the free brief's "parts it may place"). */
|
|
75
|
+
const SLOT_MEANING: Readonly<Record<FreeSlotKind, (ref: string) => string>> = {
|
|
76
|
+
[FreeSlotKind.List]: ref => `the ${ref} list`,
|
|
77
|
+
[FreeSlotKind.Form]: ref => `a ${ref} form`,
|
|
78
|
+
[FreeSlotKind.Accordion]: ref => `the ${ref} list as an accordion — each item a question that opens its answer`,
|
|
79
|
+
[FreeSlotKind.Tabs]: ref => `the ${ref} list as tabs — one item shown at a time`,
|
|
80
|
+
[FreeSlotKind.Quotes]: ref => `the ${ref} list as a testimonial carousel — the owner's real quotes, one at a time`,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/** One line of the free brief for an offered part: its slot word, what it places, and its options. */
|
|
84
|
+
export function freeSlotLine(slot: string, offer: FreeSlotOffer): string {
|
|
85
|
+
const kind = (Object.values(FreeSlotKind) as string[]).includes(offer.kind) ? offer.kind as FreeSlotKind : FreeSlotKind.List;
|
|
86
|
+
return `- "${slot}" (${SLOT_MEANING[kind](offer.ref)})${offer.opts?.length ? ` · opts: ${offer.opts.join(', ')}` : ''}`;
|
|
87
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A free page's slot words (`<kind>:<ref>`, free-parts.ts) — a leaf module (no imports): the plan validator, the judge and
|
|
3
|
+
* the stamp read them without reordering the generation-core load. Pure.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export enum FreeSlotKind {
|
|
7
|
+
List = 'list',
|
|
8
|
+
Form = 'form',
|
|
9
|
+
Accordion = 'accordion',
|
|
10
|
+
Tabs = 'tabs',
|
|
11
|
+
Quotes = 'quotes',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The separator between a slot's kind and what it names (`list:projects`). */
|
|
15
|
+
export const FREE_SLOT_SEPARATOR = ':';
|
|
16
|
+
|
|
17
|
+
/** A list slot's option that opens a clicked picture large (CC3 Lightbox) — not a list mix word. */
|
|
18
|
+
export const FREE_OPEN_LIGHTBOX = 'open:lightbox';
|
|
19
|
+
|
|
20
|
+
/** `<kind>:<ref>` — a slot word. */
|
|
21
|
+
export const freeSlotWord = (kind: FreeSlotKind, ref: string): string => `${kind}${FREE_SLOT_SEPARATOR}${ref}`;
|
|
22
|
+
|
|
23
|
+
/** A slot word read back: its kind and what it names (null for a word of no known kind). */
|
|
24
|
+
export function freeSlotOf(slot: string): { kind: FreeSlotKind; ref: string } | null {
|
|
25
|
+
const at = slot.indexOf(FREE_SLOT_SEPARATOR);
|
|
26
|
+
if (at < 0) return null;
|
|
27
|
+
const kind = slot.slice(0, at) as FreeSlotKind;
|
|
28
|
+
return (Object.values(FreeSlotKind) as string[]).includes(kind) ? { kind, ref: slot.slice(at + 1) } : null;
|
|
29
|
+
}
|
|
30
|
+
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { AI_COMPOSED_PAGES_ESTIMATED, AiFeature } from './ai-run';
|
|
2
2
|
import { GenerationTier, PagePlan, SitePlan, STAMPED_PAGE_ARCHETYPES } from './site-plan.model';
|
|
3
|
+
import { tierOffers } from './part-tier';
|
|
3
4
|
import { isPerItemPage } from './validate-site-plan';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
|
-
* The generation tier (award-ingredients-plan §0, AW-
|
|
7
|
-
* the award tier: the model composes every page that may be composed, not two
|
|
8
|
-
*
|
|
7
|
+
* The generation tier (award-ingredients-plan §0, AW-D24; AW-D42) — pure. A studio whose plan has `awardSites` builds at
|
|
8
|
+
* the award tier: the model composes every page that may be composed, not two. Since AW-D42 (2026-11-28) the tier holds
|
|
9
|
+
* back no PART — every word and recipe is every tier's (`tierOffers`); it decides only how much is composed. Read once, when a generation starts, and
|
|
9
10
|
* carried by the generation — never re-read mid-run, never written by the model.
|
|
10
11
|
*/
|
|
11
12
|
|
|
@@ -21,26 +22,14 @@ export function tierOf(stored: string | null | undefined): GenerationTier {
|
|
|
21
22
|
return stored === GenerationTier.Award ? GenerationTier.Award : GenerationTier.Basic;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
/** The order the tiers open in: a row offered at a tier is offered at every tier above it. */
|
|
25
|
-
const TIER_RANK: Readonly<Record<GenerationTier, number>> = {
|
|
26
|
-
[GenerationTier.Basic]: 0,
|
|
27
|
-
[GenerationTier.Award]: 1,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
25
|
/** A contract row that may be held for a tier (a word, a recipe, a table row) — no `tier` = every tier. */
|
|
31
26
|
export interface TieredRow {
|
|
32
27
|
readonly tier?: `${GenerationTier}` | null;
|
|
33
28
|
}
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
export function tierOffers(rowTier: `${GenerationTier}` | null | undefined, tier: `${GenerationTier}`): boolean {
|
|
37
|
-
return !rowTier || TIER_RANK[rowTier] <= TIER_RANK[tier];
|
|
38
|
-
}
|
|
30
|
+
export { tierOffers } from './part-tier';
|
|
39
31
|
|
|
40
|
-
/**
|
|
41
|
-
* The rows a build at `tier` is offered — the ONE word filter the plan wire, the layout wire and the checks apply once the
|
|
42
|
-
* contract's rows carry a `tier` (award-ingredients-plan R-H: a lower plan's site never wears an award-only word).
|
|
43
|
-
*/
|
|
32
|
+
/** The rows a build at `tier` is offered — every row since AW-D42 (`tierOffers`). */
|
|
44
33
|
export function offeredForTier<T extends TieredRow>(rows: ReadonlyArray<T>, tier: `${GenerationTier}`): T[] {
|
|
45
34
|
return rows.filter(row => tierOffers(row.tier, tier));
|
|
46
35
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
DesignChoices, designTokenRows, elementStyleFace, HeaderGround, headerGroundIsGlass, headerGroundIsOver, HeaderTrait, MenuForm, menuButtonOf, menuFormOf, menuHoverOf, MenuLook, MenuPhoneForm,
|
|
2
|
+
DesignChoices, designTokenRows, elementStyleFace, HeaderBrand, HeaderGround, headerGroundIsGlass, headerGroundIsOver, HeaderShape, headerShapeFloats, HeaderTrait, MenuForm, menuButtonOf, menuFormOf, menuHoverOf, MenuLook, MenuPhoneForm,
|
|
3
3
|
menuRevealOf, parseHexColor, resolveDesignChoices, resolveSchemeTokenValues, resolveTokenValues, ResolvedMode, textWidthEm, wcagContrastRatio,
|
|
4
4
|
} from '@vectoriox/iox-ui/design-core';
|
|
5
5
|
|
|
@@ -285,6 +285,16 @@ export enum HeaderRepairCode {
|
|
|
285
285
|
GlassOwnBar = 'glass-own-bar',
|
|
286
286
|
/** HI3-D9: glass carries its own hairline and shadow: no scroll edge. */
|
|
287
287
|
GlassEdge = 'glass-edge',
|
|
288
|
+
/** HI3-D20: a floating header has no scroll edge. */
|
|
289
|
+
FloatEdge = 'float-edge',
|
|
290
|
+
/** HI3-D18: a centred name has no island side: islands become one pill. */
|
|
291
|
+
IslandsCentred = 'islands-centred',
|
|
292
|
+
/** HI3-D25: a floating header, or a name that arrives later, needs a home page that opens on a picture. */
|
|
293
|
+
FloatPlain = 'float-plain',
|
|
294
|
+
/** HI3-D21: a hanging name needs a logo picture. */
|
|
295
|
+
NoLogo = 'no-logo',
|
|
296
|
+
/** HI3-D25: a kind of business that keeps its header plain never takes islands or a late name. */
|
|
297
|
+
TypeNeverShape = 'type-never-shape',
|
|
288
298
|
}
|
|
289
299
|
|
|
290
300
|
export interface HeaderRepair {
|
|
@@ -330,6 +340,8 @@ export interface HeaderContext {
|
|
|
330
340
|
readonly readableAtRest?: boolean | null;
|
|
331
341
|
/** HI3-D12: what this kind of business never stands its header on. Absent: nothing refused. */
|
|
332
342
|
readonly never?: HeaderNever | null;
|
|
343
|
+
/** HI3-D21: the brand has a logo picture (a hanging name needs one). Absent: none known — a hanging name fits. */
|
|
344
|
+
readonly logo?: boolean | null;
|
|
333
345
|
}
|
|
334
346
|
|
|
335
347
|
const RULES = H.rules as unknown as Readonly<{
|
|
@@ -399,9 +411,38 @@ export function checkHeader(mix: HeaderMix, ctx: HeaderContext): { mix: HeaderMi
|
|
|
399
411
|
say(HeaderRepairCode.OneDestination, 'two actions need two places to go (the contact page and the shop): one button');
|
|
400
412
|
}
|
|
401
413
|
mendGround(m, ctx, say);
|
|
414
|
+
mendShape(m, ctx, say);
|
|
402
415
|
return { mix: m, repairs };
|
|
403
416
|
}
|
|
404
417
|
|
|
418
|
+
/** The outline and name rules (HI3 slice 2, HI3-D18, D20, D21, D25), in order: the kind of business, the opening, the
|
|
419
|
+
* arrangement, the logo, then the edge a floating header does not draw. */
|
|
420
|
+
function mendShape(m: HeaderMix, ctx: HeaderContext, say: (code: HeaderRepairCode, said: string) => void): void {
|
|
421
|
+
const floats = (): boolean => headerShapeFloats(m.shape);
|
|
422
|
+
if (ctx.never?.grounds.length && (m.shape === HeaderShape.Islands || m.brand === HeaderBrand.Later)) {
|
|
423
|
+
if (m.shape === HeaderShape.Islands) m.shape = HeaderShape.Pill;
|
|
424
|
+
if (m.brand === HeaderBrand.Later) m.brand = HeaderBrand.Fits;
|
|
425
|
+
say(HeaderRepairCode.TypeNeverShape, 'this kind of business keeps its header plain: one bar, the name always in it');
|
|
426
|
+
}
|
|
427
|
+
if ((floats() || m.brand === HeaderBrand.Later) && ctx.opening !== undefined && !opensOnPicture(ctx.opening)) {
|
|
428
|
+
m.shape = HeaderShape.Bar;
|
|
429
|
+
if (m.brand === HeaderBrand.Later) m.brand = HeaderBrand.Fits;
|
|
430
|
+
say(HeaderRepairCode.FloatPlain, 'the home page does not open on a full picture: the header is a bar, its name in it from the top');
|
|
431
|
+
}
|
|
432
|
+
if (m.shape === HeaderShape.Islands && (m.arrange === HeaderArrange.Centred || m.arrange === HeaderArrange.Between)) {
|
|
433
|
+
m.shape = HeaderShape.Pill;
|
|
434
|
+
say(HeaderRepairCode.IslandsCentred, 'a centred name has no side for an island: the header floats as one pill');
|
|
435
|
+
}
|
|
436
|
+
if (m.brand === HeaderBrand.Hangs && !ctx.logo) {
|
|
437
|
+
m.brand = HeaderBrand.Fits;
|
|
438
|
+
say(HeaderRepairCode.NoLogo, 'the site has no logo picture, so the name fits the bar');
|
|
439
|
+
}
|
|
440
|
+
if (floats() && m.edge !== 'none') {
|
|
441
|
+
m.edge = 'none';
|
|
442
|
+
say(HeaderRepairCode.FloatEdge, 'a floating header has no edge under it');
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
405
446
|
/** HI3-D12: does the home page open on a picture the header can stand over — the contract's frames and media. */
|
|
406
447
|
export function opensOnPicture(opening: HeaderOpening | null | undefined): boolean {
|
|
407
448
|
return !!opening && RULES.overFrames.includes(opening.frame) && RULES.overMedia.includes(opening.media);
|
|
@@ -2,6 +2,7 @@ import { ColorScheme } from '@vectoriox/iox-ui/design-core';
|
|
|
2
2
|
|
|
3
3
|
import { LayoutLayer, LayoutLayerKind, LayoutSection, LayoutSectionKind } from './layout-language';
|
|
4
4
|
import { GenerationTier } from './site-plan.model';
|
|
5
|
+
import { tierOffers } from './part-tier';
|
|
5
6
|
import { SPEC_SITE_LAYOUT } from './site-spec.generated';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -87,10 +88,10 @@ export function drawerRamp(n: number): ColorScheme[] | null {
|
|
|
87
88
|
return ramp ? ramp.map(id => id as ColorScheme) : null;
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
/** A signature of the contract offered to a build at `tier`:
|
|
91
|
+
/** A signature of the contract offered to a build at `tier`: every row, at every tier since AW-D42 (`tierOffers`). */
|
|
91
92
|
export function layoutSignatureOffered(id: string, tier: `${GenerationTier}` | string | null | undefined): boolean {
|
|
92
93
|
const row = SPEC_SITE_LAYOUT.signatures.find(s => s.id === id);
|
|
93
|
-
return !!row && (row.tier
|
|
94
|
+
return !!row && tierOffers(row.tier, tier);
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
/** The section kinds the layout wire offers a build at `tier`: content · inhale · signature, and a signature kind
|
|
@@ -53,16 +53,12 @@ export enum LayoutMixIngredient {
|
|
|
53
53
|
Phone = 'phone',
|
|
54
54
|
}
|
|
55
55
|
const MIX_SEPARATOR = ':';
|
|
56
|
-
const BASIC = 'basic';
|
|
57
|
-
const AWARD = 'award';
|
|
58
56
|
const PART_SEPARATOR = '.';
|
|
59
57
|
/** Every word a stored mix may hold, ingredient by ingredient (a waiting word too: a stored answer still reads). */
|
|
60
58
|
export const LAYOUT_MIX_WORDS: ReadonlyArray<string> = LIST_INGREDIENTS.flatMap(k => listIngredientWords(k).map(w => `${k}${MIX_SEPARATOR}${w}`));
|
|
61
|
-
/** The words the wire OFFERS
|
|
62
|
-
*
|
|
63
|
-
export const LAYOUT_MIX_OFFERED: ReadonlyArray<string> = LIST_INGREDIENTS.flatMap(k => listBuiltWords(k).filter(w => listWordOffered(k, w
|
|
64
|
-
/** AW11: every built word, the award tier's included — what the wire offers an award site before the lists are read. */
|
|
65
|
-
export const LAYOUT_MIX_OFFERED_AWARD: ReadonlyArray<string> = LIST_INGREDIENTS.flatMap(k => listBuiltWords(k).map(w => `${k}${MIX_SEPARATOR}${w}`));
|
|
59
|
+
/** The words the wire OFFERS — the built ones only (ingredients.md §3.3: a waiting word would put its stand-in on every
|
|
60
|
+
* site that asked for it); the award tier's round-two words at every tier since AW-D42 (`listWordOffered`). */
|
|
61
|
+
export const LAYOUT_MIX_OFFERED: ReadonlyArray<string> = LIST_INGREDIENTS.flatMap(k => listBuiltWords(k).filter(w => listWordOffered(k, w)).map(w => `${k}${MIX_SEPARATOR}${w}`));
|
|
66
62
|
|
|
67
63
|
/** A list a composed page may show, as the wire's parts enum needs it (`layoutListShapes` gives these). */
|
|
68
64
|
export interface LayoutWireList { alias: string; roles: ReadonlyArray<string> }
|
|
@@ -73,8 +69,8 @@ export interface LayoutWireOptions {
|
|
|
73
69
|
lists?: ReadonlyArray<LayoutWireList>;
|
|
74
70
|
/** L-D12: what this business type's lists never do — those words are not offered (the check repairs one anyway). */
|
|
75
71
|
never?: LayoutListNever | null;
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
72
|
+
/** The tier the site is built at. Since AW-D42 every tier is offered every built list word; kept so its callers still
|
|
73
|
+
* read (no property changes either way). */
|
|
78
74
|
tier?: string | null;
|
|
79
75
|
/** A redesign (site-redesign RD2, H3): THIS page's carry handles (`carryHandles`) — given, every layer carries `carry`,
|
|
80
76
|
* closed to these handles: a model can place only the page's own parts (one property: 38, 40 with lists). */
|
|
@@ -123,8 +119,7 @@ export function isSectionCarryHandle(handle: string): boolean {
|
|
|
123
119
|
return SECTION_HANDLE.test(handle);
|
|
124
120
|
}
|
|
125
121
|
|
|
126
|
-
/** AW11: what else decides a word's offer — the
|
|
127
|
-
* judged). */
|
|
122
|
+
/** AW11: what else decides a word's offer — the plan's lists (absent: not judged). The tier holds back none since AW-D42. */
|
|
128
123
|
export interface LayoutMixOfferOptions {
|
|
129
124
|
readonly tier?: string | null;
|
|
130
125
|
readonly lists?: ReadonlyArray<LayoutWireList>;
|
|
@@ -132,12 +127,11 @@ export interface LayoutMixOfferOptions {
|
|
|
132
127
|
|
|
133
128
|
/**
|
|
134
129
|
* The mix words offered to a business whose lists never do `never` (L-D12): the built words less the forbidden ones —
|
|
135
|
-
* and since AW11
|
|
136
|
-
* picture at all) never (R-H-AW11-7: the one table, `listWordRefusal`; `checkList` judges each list).
|
|
130
|
+
* and since AW11 a word NO list of the plan can carry (a second picture, a picture at all) never (R-H-AW11-7: the one table, `listWordRefusal`; `checkList` judges each list).
|
|
137
131
|
*/
|
|
138
132
|
export function layoutMixOffered(never?: LayoutListNever | null, options: LayoutMixOfferOptions = {}): string[] {
|
|
139
133
|
const banned = new Set([...(never?.arranges ?? []).map(w => `arrange${MIX_SEPARATOR}${w}`), ...(never?.moves ?? []).map(w => `move${MIX_SEPARATOR}${w}`)]);
|
|
140
|
-
const offered =
|
|
134
|
+
const offered = LAYOUT_MIX_OFFERED;
|
|
141
135
|
const lists = options.lists;
|
|
142
136
|
return offered.filter(w => {
|
|
143
137
|
if (banned.has(w)) return false;
|
|
@@ -183,8 +177,8 @@ const closed = (properties: Record<string, JsonSchema>, d?: string) => jsonClose
|
|
|
183
177
|
/** The strict format for one composed page — with the list ingredients when `options.lists` is given. */
|
|
184
178
|
export function layoutWireJsonSchema(options: LayoutWireOptions = {}): JsonSchema {
|
|
185
179
|
const partWords = options.lists ? layoutWirePartWords(options.lists) : [];
|
|
186
|
-
//
|
|
187
|
-
const mixOffered =
|
|
180
|
+
// AW-D42: every tier is offered every built word, narrowed by what the plan's lists can carry (R-H-AW11-7).
|
|
181
|
+
const mixOffered = layoutMixOffered(options.never, { tier: options.tier, lists: options.lists });
|
|
188
182
|
const lists: Record<string, JsonSchema> = options.lists
|
|
189
183
|
? {
|
|
190
184
|
mix: listOf(jsonOneOf(mixOffered), `gallery showing a list (source): how its items are shown, one word per choice — ${mixHint(mixOffered)}; [] for none`),
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
LayoutIssue, LayoutIssueCode, LayoutListHow, LayoutListMix, LayoutListShape, LayoutListWho, LayoutMendKind,
|
|
4
4
|
} from './layout-language';
|
|
5
5
|
import {
|
|
6
|
-
LIST_INGREDIENTS, LIST_TABLE, ListIngredient, ListWordRefusal, listBuiltWords, listMeaning,
|
|
6
|
+
LIST_INGREDIENTS, LIST_TABLE, ListIngredient, ListWordRefusal, listBuiltWords, listMeaning, listWordOffered, listWordRefusal,
|
|
7
7
|
} from './list-table';
|
|
8
8
|
import { ListSaid } from './list-words';
|
|
9
9
|
|
|
@@ -21,7 +21,7 @@ export interface ListPanelWord {
|
|
|
21
21
|
readonly word: string;
|
|
22
22
|
/** The contract's meaning — the row's hint. */
|
|
23
23
|
readonly meaning: string;
|
|
24
|
-
/** A
|
|
24
|
+
/** A word held from this build's plan (the plan mark) — none since AW-D42 (`listWordOffered`). */
|
|
25
25
|
readonly pro: boolean;
|
|
26
26
|
/** A hover word: phones never show it, so its hint says "(mouse)" (P4). */
|
|
27
27
|
readonly mouse: boolean;
|
|
@@ -77,7 +77,7 @@ export function listPanelRows(mix: LayoutListMix, ctx: ListPanelContext): ListPa
|
|
|
77
77
|
words: listBuiltWords(k).map(word => ({
|
|
78
78
|
word,
|
|
79
79
|
meaning: listMeaning(k, word, ctx.locale),
|
|
80
|
-
pro:
|
|
80
|
+
pro: !listWordOffered(k, word, ctx.tier),
|
|
81
81
|
mouse: k === HOVER,
|
|
82
82
|
refusal: listWordRefusal(k, word, ctx.shape, ctx.tier, ctx.never),
|
|
83
83
|
})),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CommerceLanguage, commerceLanguage } from '@vectoriox/iox-ui/commerce-core';
|
|
2
2
|
|
|
3
|
+
import { tierOffers } from './part-tier';
|
|
3
4
|
import { SPEC_SITE_LAYOUT } from './site-spec.generated';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -46,20 +47,14 @@ export function listMeaning(k: ListIngredient, word: string, locale?: string | n
|
|
|
46
47
|
|
|
47
48
|
// ── AW11 (award-ingredients-plan.md §7.1f, board award-lists): the award tier, the rhythms, what each word needs ─────
|
|
48
49
|
|
|
49
|
-
/**
|
|
50
|
+
/** The tier a word was first drawn for (`all`, or `pro` — the award tier's, AW-D23); since AW-D42 every tier wears both. */
|
|
50
51
|
export function listWordTier(k: ListIngredient, word: string): 'all' | 'pro' {
|
|
51
52
|
return (LIST_TABLE.tiers as Readonly<Record<string, string>>)[`${k}.${word}`] === 'pro' ? 'pro' : 'all';
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
/** May a build at `tier` wear this word?
|
|
55
|
+
/** May a build at `tier` wear this word? Every tier wears every word (AW-D42, `tierOffers`). */
|
|
55
56
|
export function listWordOffered(k: ListIngredient, word: string, tier?: string | null): boolean {
|
|
56
|
-
return listWordTier(k, word)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** The word a round-two word is drawn as below the award tier (null: left out), from the contract's `belowPro`. */
|
|
60
|
-
export function listBelowPro(k: ListIngredient, word: string): string | null | undefined {
|
|
61
|
-
const stand = (LIST_TABLE.belowPro as Readonly<Record<string, string | null>>)[`${k}.${word}`];
|
|
62
|
-
return stand === undefined ? undefined : stand;
|
|
57
|
+
return tierOffers(listWordTier(k, word), tier);
|
|
63
58
|
}
|
|
64
59
|
|
|
65
60
|
/** One step of a gallery wall: its share of a 12-column row and how far it hangs below the row's line (px). */
|
|
@@ -112,8 +107,6 @@ export function bentoFill(items: number): number | null {
|
|
|
112
107
|
|
|
113
108
|
/** Why a list cannot carry a word (R-H-AW11-7 — ONE table for the wire, the judge and Bindings ▸ List). */
|
|
114
109
|
export enum ListWordRefusal {
|
|
115
|
-
/** The award tier's word, on a plan below it (AW-D23). */
|
|
116
|
-
ProOnly = 'pro-only',
|
|
117
110
|
/** The word shows a picture in every item, and the list has none. */
|
|
118
111
|
NoPictures = 'no-pictures',
|
|
119
112
|
/** The word shows a second picture (the gallery role), and the list has none (AW11-D12). */
|
|
@@ -133,11 +126,9 @@ const inRule = (rule: Readonly<Partial<Record<ListIngredient, ReadonlyArray<stri
|
|
|
133
126
|
/**
|
|
134
127
|
* Can this list carry this word — and if not, why (R-H-AW11-7)? The ONE answer the wire's offer, `checkList` and
|
|
135
128
|
* Bindings ▸ List read: a word the list's data cannot carry is never offered, never picked. `shape` null: nothing is
|
|
136
|
-
* known of the list (any word
|
|
137
|
-
* builder).
|
|
129
|
+
* known of the list (any word). `tier` holds back no word since AW-D42; kept so its callers still read.
|
|
138
130
|
*/
|
|
139
131
|
export function listWordRefusal(k: ListIngredient, word: string, shape: ListWordShape | null, tier?: string | null, never?: ListWordNever | null): ListWordRefusal | null {
|
|
140
|
-
if (tier !== undefined && tier !== null && !listWordOffered(k, word, tier)) return ListWordRefusal.ProOnly;
|
|
141
132
|
if (never && ((k === 'arrange' && never.arranges.includes(word)) || (k === 'move' && never.moves.includes(word)))) return ListWordRefusal.Never;
|
|
142
133
|
if (!shape) return null;
|
|
143
134
|
if (inRule(LIST_RULES.pictured, k, word) && !shape.roles.includes('image')) return ListWordRefusal.NoPictures;
|
|
@@ -16,7 +16,8 @@ import { ListIngredient, listMeaning } from './list-table';
|
|
|
16
16
|
export enum ListSayCode {
|
|
17
17
|
/** A word the product draws in a later phase, drawn as its stand-in meanwhile (or left out). */
|
|
18
18
|
Waits = 'list-waits',
|
|
19
|
-
/** A round-two word on a site below the award plan: its stand-in instead (or left out).
|
|
19
|
+
/** A round-two word on a site below the award plan: its stand-in instead (or left out). No longer said since AW-D42
|
|
20
|
+
* (every tier wears every word); kept so a stored run's sentence still reads. */
|
|
20
21
|
AwardOnly = 'list-award-only',
|
|
21
22
|
/** The mix shows roles the list does not hold. */
|
|
22
23
|
NoSuchParts = 'list-no-such-parts',
|
|
@@ -2,6 +2,7 @@ import { DesignChoices, elementStyleFace, resolveDesignChoices, textWidthEm } fr
|
|
|
2
2
|
|
|
3
3
|
import { LAYOUT_INSET } from './layout-column';
|
|
4
4
|
import { GenerationTier } from './site-plan.model';
|
|
5
|
+
import { tierOffers } from './part-tier';
|
|
5
6
|
import { PatternNode, PatternPlaceholder, PatternRecipe, SitePattern } from './patterns';
|
|
6
7
|
import { SerializedNode, walkSerialized } from './serialized-node';
|
|
7
8
|
import { SPEC_SITE_LAYOUT } from './site-spec.generated';
|
|
@@ -160,14 +161,14 @@ export function openingWordWaits(ingredient: `${OpeningIngredient}`, word: strin
|
|
|
160
161
|
return WAITS[`${ingredient}.${word}`]?.phase ?? null;
|
|
161
162
|
}
|
|
162
163
|
|
|
163
|
-
/**
|
|
164
|
+
/** The tier a word was first drawn for (`all`, or `pro` — the award tier's, AW-D23); since AW-D42 every tier wears both. */
|
|
164
165
|
export function openingWordTier(ingredient: `${OpeningIngredient}`, word: string): 'all' | 'pro' {
|
|
165
166
|
return O.tiers[`${ingredient}.${word}`] === 'pro' ? 'pro' : 'all';
|
|
166
167
|
}
|
|
167
168
|
|
|
168
|
-
/** May a build at `tier` wear this word? */
|
|
169
|
+
/** May a build at `tier` wear this word? Every tier wears every drawn word (AW-D42, `tierOffers`). */
|
|
169
170
|
export function openingWordOffered(ingredient: `${OpeningIngredient}`, word: string, tier: `${GenerationTier}`): boolean {
|
|
170
|
-
return openingWordTier(ingredient, word)
|
|
171
|
+
return tierOffers(openingWordTier(ingredient, word), tier);
|
|
171
172
|
}
|
|
172
173
|
|
|
173
174
|
const listOf = (v: string | ReadonlyArray<string> | undefined): string[] => (v === undefined ? [] : Array.isArray(v) ? [...v] : [v as string]);
|
|
@@ -424,7 +425,7 @@ export function typeLedGrounds(calm = false): OpeningGround[] {
|
|
|
424
425
|
}
|
|
425
426
|
|
|
426
427
|
/** Every `<ingredient>:<word>` the generator's wire may carry at `tier`: drawn words only (a waiting word is never
|
|
427
|
-
* offered)
|
|
428
|
+
* offered) — every tier's since AW-D42. */
|
|
428
429
|
export function openingWireWords(tier: `${GenerationTier}` = GenerationTier.Basic): string[] {
|
|
429
430
|
return ORDER.flatMap(k => openingWords(k).filter(w => openingWordDrawn(k, w) && openingWordOffered(k, w, tier)).map(w => `${k}:${w}`));
|
|
430
431
|
}
|
|
@@ -440,20 +441,12 @@ export function typeLedOpeningWays(): OpeningMix[] {
|
|
|
440
441
|
return (O.typeLed ?? []).map(w => openingMix({ frame: w.frame, words: w.words, media: OpeningMedia.None }));
|
|
441
442
|
}
|
|
442
443
|
|
|
443
|
-
/** AW-D23 amended (2026-11-24): a type-led first screen's frame and words are worn at every tier when they are one of
|
|
444
|
-
* the contract's type-led ways — with no picture they are all the screen has. */
|
|
445
|
-
function typeLedWayEveryTier(mix: OpeningMix): boolean {
|
|
446
|
-
return !!O.typeLedEveryTier && mix.media === OpeningMedia.None && (O.typeLed ?? []).some(w => w.frame === mix.frame && w.words === mix.words);
|
|
447
|
-
}
|
|
448
|
-
|
|
449
444
|
/** #129: is the mix a type-led first screen (nothing to show but its words)? */
|
|
450
445
|
export const openingIsTypeLed = (mix: Pick<OpeningMix, 'media'>): boolean => mix.media === OpeningMedia.None;
|
|
451
446
|
|
|
452
447
|
// ── The check: a mix judged against the site, mended where the site cannot carry it, each mend said ──────────────────
|
|
453
448
|
|
|
454
449
|
export enum OpeningRepairCode {
|
|
455
|
-
/** A word the award tier alone wears, on a site built below it. */
|
|
456
|
-
ProOnly = 'pro-only',
|
|
457
450
|
/** The name behind the subject needs a cut-out picture: the name, large. */
|
|
458
451
|
NeedsCutOut = 'needs-cut-out',
|
|
459
452
|
/** J10 lever (b): a looping film is the owner's own clip — a build with none draws a picture there, which the owner's
|
|
@@ -488,7 +481,8 @@ export interface OpeningContext {
|
|
|
488
481
|
/** The business name — the words of a display-size opening. */
|
|
489
482
|
readonly name: string;
|
|
490
483
|
readonly design?: DesignChoices | null;
|
|
491
|
-
/**
|
|
484
|
+
/** The tier the site is built at. Since AW-D42 it holds back no word (every tier wears every drawn word); kept so the
|
|
485
|
+
* callers that pass it still read. */
|
|
492
486
|
readonly tier?: `${GenerationTier}`;
|
|
493
487
|
/** The owner gives a cut-out picture (a transparent background) for the name behind the subject. */
|
|
494
488
|
readonly cutOut?: boolean;
|
|
@@ -529,11 +523,6 @@ function nameFits(ctx: OpeningContext, oneLine: boolean): boolean {
|
|
|
529
523
|
return laptopOk && (PHONE_PX - 2 * PHONE_SIDE_PX) / longest >= MIN_PHONE_DISPLAY_PX;
|
|
530
524
|
}
|
|
531
525
|
|
|
532
|
-
/** The stand-in for a word a tier may not wear: the one-word ingredients' defaults; a many-ingredient's word left out. */
|
|
533
|
-
function tierStandIn(k: OpeningIngredient): string {
|
|
534
|
-
return O.defaults[k] as string;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
526
|
/**
|
|
538
527
|
* The ONE judge of an opening mix against the site: what the site cannot carry is mended to the nearest mix it can, and
|
|
539
528
|
* each mend is said. Judges the mix as DRAWN (`drawnOpeningMix` first). Never throws on a well-formed mix. Pure.
|
|
@@ -542,22 +531,6 @@ export function checkOpening(mix: OpeningMix, ctx: OpeningContext): { mix: Openi
|
|
|
542
531
|
const m: OpeningMix = { ...mix, extras: [...mix.extras], motion: [...mix.motion] };
|
|
543
532
|
const repairs: OpeningRepair[] = [];
|
|
544
533
|
const say = (code: OpeningRepairCode, said: string) => repairs.push({ code, said });
|
|
545
|
-
if (ctx.tier && ctx.tier !== GenerationTier.Award) {
|
|
546
|
-
const everyTier = typeLedWayEveryTier(m);
|
|
547
|
-
for (const k of ORDER) {
|
|
548
|
-
if (everyTier && (k === OpeningIngredient.Frame || k === OpeningIngredient.Words)) continue;
|
|
549
|
-
if (isMany(k)) {
|
|
550
|
-
const kept = m[k].filter(w => openingWordTier(k, w) === 'all');
|
|
551
|
-
for (const w of m[k].filter(x => !kept.includes(x))) say(OpeningRepairCode.ProOnly, `"${openingMeaning(k, w)}" comes with the award plan: left out`);
|
|
552
|
-
m[k] = kept;
|
|
553
|
-
continue;
|
|
554
|
-
}
|
|
555
|
-
const word = (m as unknown as Record<string, string>)[k];
|
|
556
|
-
if (openingWordTier(k, word) === 'all') continue;
|
|
557
|
-
(m as unknown as Record<string, string>)[k] = tierStandIn(k);
|
|
558
|
-
say(OpeningRepairCode.ProOnly, `"${openingMeaning(k, word)}" comes with the award plan: ${openingMeaning(k, tierStandIn(k))} instead`);
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
534
|
if (m.media === OpeningMedia.Film && ctx.film === false) {
|
|
562
535
|
m.media = OpeningMedia.Photo;
|
|
563
536
|
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');
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AW-D42 (Doron, 2026-11-28: "we don't need the award website for Pro" — AW-D23's word gate overturned): EVERY PART IS
|
|
3
|
+
* EVERY TIER'S. A word, a recipe, a table row or a wire key the contract once held for the award tier (its `tier: 'pro'`
|
|
4
|
+
* / `'award'`) is offered to a build at any tier. The tier now decides only HOW MUCH the model composes (AW-D24: which
|
|
5
|
+
* pages, `withComposedPages`) — never what a site may wear.
|
|
6
|
+
*
|
|
7
|
+
* This is the ONE predicate every part offer reads — the body, opening, list and footer words, the layout signatures,
|
|
8
|
+
* the plan wire's keys. The contract's `tier` column stays as each row's history (the tier it was first drawn for), so a
|
|
9
|
+
* price split, should one ever come back, comes back here and nowhere else. A leaf module (no imports): the mixes read it
|
|
10
|
+
* without reordering the generation-core load. Pure.
|
|
11
|
+
*/
|
|
12
|
+
export function tierOffers(_rowTier: string | null | undefined, _tier?: string | null): boolean {
|
|
13
|
+
return true;
|
|
14
|
+
}
|