@vectoriox/iox-ui 5.197.0 → 5.199.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/actions-core/index.d.ts +7 -1
- package/composite-core/index.d.ts +16 -2
- package/data-core/index.d.ts +11 -3
- package/design-core/index.d.ts +185 -28
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs +6 -1
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
- 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-data-core.mjs +30 -4
- package/fesm2022/vectoriox-iox-ui-data-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +323 -72
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +17351 -15175
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +243 -38
- package/fesm2022/vectoriox-iox-ui-harness-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 +1703 -264
- package/harness-core/index.d.ts +93 -6
- package/package.json +1 -1
- package/src/actions-core/element-actions.ts +6 -0
- package/src/composite-core/header.ts +34 -1
- package/src/data-core/placeholder-rows.ts +29 -4
- 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/menu-look.ts +23 -0
- package/src/design-core/motion-language.ts +5 -14
- package/src/design-core/node-classes.ts +39 -0
- package/src/design-core/preloader.ts +4 -5
- package/src/generation-core/body-mix.ts +40 -102
- package/src/generation-core/check-free.ts +22 -11
- 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 +47 -20
- package/src/generation-core/compose-site.ts +259 -59
- package/src/generation-core/footer-mix.ts +258 -64
- package/src/generation-core/free-fallback.ts +6 -4
- package/src/generation-core/free-opening.ts +13 -2
- package/src/generation-core/free-parts.ts +87 -0
- package/src/generation-core/free-slot-words.ts +30 -0
- package/src/generation-core/free-wire.ts +8 -0
- package/src/generation-core/generation-tier.ts +6 -17
- package/src/generation-core/header-mix.ts +73 -3
- package/src/generation-core/layout-drawers.ts +3 -2
- package/src/generation-core/layout-wire.ts +10 -16
- package/src/generation-core/legal.ts +24 -0
- 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/menu-shelves.ts +138 -0
- package/src/generation-core/nav-shape.ts +138 -15
- package/src/generation-core/node-baselines.generated.ts +1 -0
- package/src/generation-core/opening-mix.ts +7 -34
- package/src/generation-core/part-tier.ts +14 -0
- package/src/generation-core/patterns.ts +7 -0
- package/src/generation-core/plan-wire.ts +32 -43
- package/src/generation-core/public-api.ts +3 -0
- package/src/generation-core/site-build-run.ts +8 -0
- package/src/generation-core/site-plan.model.ts +3 -0
- package/src/generation-core/site-spec.generated.ts +1383 -189
- package/src/generation-core/validate-site-plan.ts +6 -5
- package/src/harness-core/business-types.ts +4 -0
- package/src/harness-core/harness-spec.generated.ts +189 -30
- package/src/harness-core/popup-stance.ts +56 -3
- package/src/harness-core/run-compose-context.ts +25 -5
- package/styles/iox-design.css +162 -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,3 +1,5 @@
|
|
|
1
|
+
import { COLOR_SCHEME_TYPES, schemeOfGround } from '@vectoriox/iox-ui/design-core';
|
|
2
|
+
|
|
1
3
|
import { JsonSchema, jsonClosedObject, jsonInteger, jsonListOf, jsonOneOf, jsonText } from './json-schema';
|
|
2
4
|
import { isPlainObject, PlainObject } from './shape-check';
|
|
3
5
|
|
|
@@ -73,6 +75,12 @@ export const FREE_BUILDER_TYPE: Readonly<Record<FreeNodeType, string>> = {
|
|
|
73
75
|
[FreeNodeType.Slot]: 'Container',
|
|
74
76
|
};
|
|
75
77
|
|
|
78
|
+
/** The scheme the stamp gives a free box (iox-ui#186): the scheme its painted ground is (`schemeOfGround`), on a type that
|
|
79
|
+
* offers one — the stamp and the tree check read this ONE answer. */
|
|
80
|
+
export function freeSchemeOf(n: FreeNode): string | null {
|
|
81
|
+
return COLOR_SCHEME_TYPES.includes(FREE_BUILDER_TYPE[n.type]) ? schemeOfGround(n.styleProps?.['backgroundColor']) : null;
|
|
82
|
+
}
|
|
83
|
+
|
|
76
84
|
/** The one role a free node may carry: the heading a visitor reads first. */
|
|
77
85
|
export const FREE_LEAD_ROLE = 'lead';
|
|
78
86
|
|
|
@@ -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,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
DesignChoices, designTokenRows, elementStyleFace, HeaderGround, headerGroundIsGlass, headerGroundIsOver, HeaderTrait, MenuForm, menuButtonOf, menuFormOf, menuHoverOf, MenuLook, MenuPhoneForm,
|
|
3
|
-
menuRevealOf, parseHexColor, resolveDesignChoices, resolveSchemeTokenValues, resolveTokenValues, ResolvedMode, textWidthEm, wcagContrastRatio,
|
|
2
|
+
DesignChoices, designTokenRows, elementStyleFace, HeaderBrand, HeaderGround, headerGroundIsGlass, headerGroundIsOver, HeaderShape, headerShapeFloats, HeaderTrait, MenuForm, menuButtonOf, menuFormOf, menuHoverOf, MenuLook, MenuPhoneForm,
|
|
3
|
+
menuRevealOf, MenuShows, menuShowsOf, parseHexColor, resolveDesignChoices, resolveSchemeTokenValues, resolveTokenValues, ResolvedMode, textWidthEm, wcagContrastRatio,
|
|
4
4
|
} from '@vectoriox/iox-ui/design-core';
|
|
5
5
|
|
|
6
|
+
import { menuCollectionsOfPlan, ShelfPlan } from './menu-shelves';
|
|
6
7
|
import { MenuSide, NavRole, NavShape } from './nav-shape';
|
|
7
8
|
import { OpeningMixError, openingMixOfPlan, OpeningRole } from './opening-mix';
|
|
8
9
|
import { calmUnder, PhotoInventory } from './photo-inventory';
|
|
@@ -285,6 +286,20 @@ export enum HeaderRepairCode {
|
|
|
285
286
|
GlassOwnBar = 'glass-own-bar',
|
|
286
287
|
/** HI3-D9: glass carries its own hairline and shadow: no scroll edge. */
|
|
287
288
|
GlassEdge = 'glass-edge',
|
|
289
|
+
/** HI3-D20: a floating header has no scroll edge. */
|
|
290
|
+
FloatEdge = 'float-edge',
|
|
291
|
+
/** HI3-D18: a centred name has no island side: islands become one pill. */
|
|
292
|
+
IslandsCentred = 'islands-centred',
|
|
293
|
+
/** HI3-D25: a floating header, or a name that arrives later, needs a home page that opens on a picture. */
|
|
294
|
+
FloatPlain = 'float-plain',
|
|
295
|
+
/** HI3-D21: a hanging name needs a logo picture. */
|
|
296
|
+
NoLogo = 'no-logo',
|
|
297
|
+
/** HI3-D25: a kind of business that keeps its header plain never takes islands or a late name. */
|
|
298
|
+
TypeNeverShape = 'type-never-shape',
|
|
299
|
+
/** HI2: pictured cards stand in a top panel, a full screen or a mega panel — never a drawer or a card: the page names. */
|
|
300
|
+
PicturesForm = 'pictures-form',
|
|
301
|
+
/** HI2: pictured cards need the site's main collections with pictures (`menuPicturesMin`): the page names. */
|
|
302
|
+
FewCollections = 'few-collections',
|
|
288
303
|
}
|
|
289
304
|
|
|
290
305
|
export interface HeaderRepair {
|
|
@@ -330,12 +345,18 @@ export interface HeaderContext {
|
|
|
330
345
|
readonly readableAtRest?: boolean | null;
|
|
331
346
|
/** HI3-D12: what this kind of business never stands its header on. Absent: nothing refused. */
|
|
332
347
|
readonly never?: HeaderNever | null;
|
|
348
|
+
/** HI3-D21: the brand has a logo picture (a hanging name needs one). Absent: none known — a hanging name fits. */
|
|
349
|
+
readonly logo?: boolean | null;
|
|
350
|
+
/** HI2: the site's main collections with pictures (`menuCollectionsOfPlan`), in the navigation's order — what a
|
|
351
|
+
* `pictures` menu shows a card for. Absent: not judged. */
|
|
352
|
+
readonly collections?: ReadonlyArray<HeaderPage>;
|
|
333
353
|
}
|
|
334
354
|
|
|
335
355
|
const RULES = H.rules as unknown as Readonly<{
|
|
336
356
|
menuMinLinks: number; pinnedMax: number; inlineRoomPx: number; betweenNameEm: number; betweenMinPages: number;
|
|
337
357
|
overFrames: ReadonlyArray<string>; overMedia: ReadonlyArray<string>; glassFlavors: ReadonlyArray<string>;
|
|
338
358
|
glassIsOwnBar: ReadonlyArray<string>; noEdgeGrounds: ReadonlyArray<string>;
|
|
359
|
+
menuPicturesForms: ReadonlyArray<string>; menuPicturesMin: number;
|
|
339
360
|
}>;
|
|
340
361
|
/** How a laptop's bar is measured (an estimate on the look's own faces — never a guess at a page's words): the name at
|
|
341
362
|
* the brand's size, each page at the link's, the gap between them, and a button's padding around its words. */
|
|
@@ -398,10 +419,57 @@ export function checkHeader(mix: HeaderMix, ctx: HeaderContext): { mix: HeaderMi
|
|
|
398
419
|
m.action = HeaderAction.Button;
|
|
399
420
|
say(HeaderRepairCode.OneDestination, 'two actions need two places to go (the contact page and the shop): one button');
|
|
400
421
|
}
|
|
422
|
+
mendShelf(m, ctx, say);
|
|
401
423
|
mendGround(m, ctx, say);
|
|
424
|
+
mendShape(m, ctx, say);
|
|
402
425
|
return { mix: m, repairs };
|
|
403
426
|
}
|
|
404
427
|
|
|
428
|
+
/** The outline and name rules (HI3 slice 2, HI3-D18, D20, D21, D25), in order: the kind of business, the opening, the
|
|
429
|
+
* arrangement, the logo, then the edge a floating header does not draw. */
|
|
430
|
+
function mendShape(m: HeaderMix, ctx: HeaderContext, say: (code: HeaderRepairCode, said: string) => void): void {
|
|
431
|
+
const floats = (): boolean => headerShapeFloats(m.shape);
|
|
432
|
+
if (ctx.never?.grounds.length && (m.shape === HeaderShape.Islands || m.brand === HeaderBrand.Later)) {
|
|
433
|
+
if (m.shape === HeaderShape.Islands) m.shape = HeaderShape.Pill;
|
|
434
|
+
if (m.brand === HeaderBrand.Later) m.brand = HeaderBrand.Fits;
|
|
435
|
+
say(HeaderRepairCode.TypeNeverShape, 'this kind of business keeps its header plain: one bar, the name always in it');
|
|
436
|
+
}
|
|
437
|
+
if ((floats() || m.brand === HeaderBrand.Later) && ctx.opening !== undefined && !opensOnPicture(ctx.opening)) {
|
|
438
|
+
m.shape = HeaderShape.Bar;
|
|
439
|
+
if (m.brand === HeaderBrand.Later) m.brand = HeaderBrand.Fits;
|
|
440
|
+
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');
|
|
441
|
+
}
|
|
442
|
+
if (m.shape === HeaderShape.Islands && (m.arrange === HeaderArrange.Centred || m.arrange === HeaderArrange.Between)) {
|
|
443
|
+
m.shape = HeaderShape.Pill;
|
|
444
|
+
say(HeaderRepairCode.IslandsCentred, 'a centred name has no side for an island: the header floats as one pill');
|
|
445
|
+
}
|
|
446
|
+
if (m.brand === HeaderBrand.Hangs && !ctx.logo) {
|
|
447
|
+
m.brand = HeaderBrand.Fits;
|
|
448
|
+
say(HeaderRepairCode.NoLogo, 'the site has no logo picture, so the name fits the bar');
|
|
449
|
+
}
|
|
450
|
+
if (floats() && m.edge !== 'none') {
|
|
451
|
+
m.edge = 'none';
|
|
452
|
+
say(HeaderRepairCode.FloatEdge, 'a floating header has no edge under it');
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/** HI2 (plan §6): what the menu shows, as the site can carry it — pictured cards only in a menu wide enough to hold them
|
|
457
|
+
* beside the page names (Vonder's top panel, a full screen, a mega panel) and only for the collections the site has. */
|
|
458
|
+
function mendShelf(m: HeaderMix, ctx: HeaderContext, say: (code: HeaderRepairCode, said: string) => void): void {
|
|
459
|
+
if (menuShowsOf(m.menuShows) !== MenuShows.Pictures) return;
|
|
460
|
+
const form = menuLookOf(m).form;
|
|
461
|
+
if (!(RULES.menuPicturesForms ?? []).includes(form)) {
|
|
462
|
+
m.menuShows = MenuShows.Links;
|
|
463
|
+
say(HeaderRepairCode.PicturesForm, `pictured cards need a top panel, a full screen or a mega panel — not a ${form}: the menu shows the page names`);
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
const count = ctx.collections?.length;
|
|
467
|
+
if (count !== undefined && count < RULES.menuPicturesMin) {
|
|
468
|
+
m.menuShows = MenuShows.Links;
|
|
469
|
+
say(HeaderRepairCode.FewCollections, `pictured cards need ${RULES.menuPicturesMin} collections with pictures — the site has ${count}: the menu shows the page names`);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
405
473
|
/** HI3-D12: does the home page open on a picture the header can stand over — the contract's frames and media. */
|
|
406
474
|
export function opensOnPicture(opening: HeaderOpening | null | undefined): boolean {
|
|
407
475
|
return !!opening && RULES.overFrames.includes(opening.frame) && RULES.overMedia.includes(opening.media);
|
|
@@ -667,6 +735,7 @@ export function menuLookOf(mix: HeaderMix): MenuLook {
|
|
|
667
735
|
button: menuButtonOf(mix.button),
|
|
668
736
|
hover: menuHoverOf(mix.menuHover),
|
|
669
737
|
phone: phoneFull && form !== MenuForm.Full ? MenuPhoneForm.Full : MenuPhoneForm.Drawer,
|
|
738
|
+
shows: menuShowsOf(mix.menuShows),
|
|
670
739
|
};
|
|
671
740
|
}
|
|
672
741
|
|
|
@@ -727,7 +796,7 @@ export function distinctHeader(mix: HeaderMix, taken: ReadonlyArray<string>, ctx
|
|
|
727
796
|
return { mix, repairs: [] };
|
|
728
797
|
}
|
|
729
798
|
|
|
730
|
-
type HeaderPlan = {
|
|
799
|
+
type HeaderPlan = ShelfPlan & {
|
|
731
800
|
readonly business: { readonly name: string }; readonly design?: Readonly<Partial<DesignChoices>>;
|
|
732
801
|
readonly mixes?: { readonly opening?: ReadonlyArray<string> };
|
|
733
802
|
readonly pages: ReadonlyArray<{ readonly name: string; readonly route: string; readonly inNav?: boolean; readonly isHome?: boolean; readonly sections?: ReadonlyArray<{ readonly binding?: string }> }>;
|
|
@@ -767,6 +836,7 @@ export function headerContextOfPlan(plan: HeaderPlan, shop?: string | null, fact
|
|
|
767
836
|
pages: plan.pages.filter(p => p.inNav && !p.isHome && p.route !== '/').map(p => ({ name: p.name, route: p.route })),
|
|
768
837
|
shop: shop === undefined ? shopPageOfPlan(plan) : shop,
|
|
769
838
|
opening: headerOpeningOfPlan(plan),
|
|
839
|
+
collections: menuCollectionsOfPlan(plan).map(c => ({ name: c.label, route: c.route })),
|
|
770
840
|
...(facts.never ? { never: facts.never } : {}),
|
|
771
841
|
...(facts.readableAtRest !== undefined && facts.readableAtRest !== null ? { readableAtRest: facts.readableAtRest } : {}),
|
|
772
842
|
};
|
|
@@ -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`),
|
|
@@ -173,6 +173,9 @@ export interface LegalContext {
|
|
|
173
173
|
/** ISO 3166-1 alpha-2 — the studio's country (Shop ▸ Settings; a shekel studio starts in Israel). Absent = unknown. */
|
|
174
174
|
country?: string | null;
|
|
175
175
|
trackers?: ReadonlyArray<LegalTracker>;
|
|
176
|
+
/** The site will count its visitors (the studio's or the plan's analytics intent) even before a tracker is connected:
|
|
177
|
+
* it gets its cookie banner and privacy page as a site with an analytics tracker does (`siteMeasures`). */
|
|
178
|
+
measures?: boolean | null;
|
|
176
179
|
/** The studio's own legal pages, by kind: their route. The build links them and never stamps that kind again. */
|
|
177
180
|
existing?: Readonly<Partial<Record<`${LegalKind}`, string>>>;
|
|
178
181
|
/** Every route the studio already has — a stamped legal page never takes one. */
|
|
@@ -211,3 +214,24 @@ export function legalFormLine(lang: string | null | undefined, withTerms: boolea
|
|
|
211
214
|
if (at < template.length) parts.push({ text: template.slice(at) });
|
|
212
215
|
return parts;
|
|
213
216
|
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Whether a site MEASURES its visitors (Doron 2026-11-28: "a privacy banner on every site that measures visitors") — a
|
|
220
|
+
* connected tracker, or the intent to count visitors. THE rule the build's banner, its privacy page and its categories
|
|
221
|
+
* read, so a site never measures before it asks. Pure.
|
|
222
|
+
*/
|
|
223
|
+
export function siteMeasures(context: Pick<LegalContext, 'trackers' | 'measures'> | null | undefined): boolean {
|
|
224
|
+
return (context?.trackers?.length ?? 0) > 0 || context?.measures === true;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/** The categories a measuring site's banner asks a yes for, each once (Necessary never): its trackers' — or Analytics
|
|
228
|
+
* alone when it measures with none connected yet. */
|
|
229
|
+
export function measuredCategories(context: Pick<LegalContext, 'trackers' | 'measures'> | null | undefined): ConsentCategory[] {
|
|
230
|
+
const out: ConsentCategory[] = [];
|
|
231
|
+
for (const t of context?.trackers ?? []) {
|
|
232
|
+
const c = t.category as ConsentCategory;
|
|
233
|
+
if (c !== ConsentCategory.Necessary && !out.includes(c)) out.push(c);
|
|
234
|
+
}
|
|
235
|
+
if (!out.length && siteMeasures(context)) out.push(ConsentCategory.Analytics);
|
|
236
|
+
return out;
|
|
237
|
+
}
|
|
@@ -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',
|