@vectoriox/iox-ui 5.155.0 → 5.157.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/fesm2022/vectoriox-iox-ui-generation-core.mjs +2306 -714
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/generation-core/index.d.ts +5348 -4739
- package/package.json +1 -1
- package/src/generation-core/check-free.ts +375 -0
- package/src/generation-core/compose-site.ts +89 -22
- package/src/generation-core/fallback-memory.ts +2 -2
- package/src/generation-core/free-fallback.ts +139 -0
- package/src/generation-core/free-wire.ts +432 -0
- package/src/generation-core/layout-fingerprint.ts +15 -1
- package/src/generation-core/opening-mix.ts +162 -5
- package/src/generation-core/plan-wire.ts +2 -2
- package/src/generation-core/plan-words.ts +50 -3
- package/src/generation-core/prompt-limits.ts +96 -0
- package/src/generation-core/public-api.ts +5 -0
- package/src/generation-core/site-spec.generated.ts +47 -1
- package/src/generation-core/type-led.ts +435 -0
|
@@ -8978,7 +8978,8 @@ const SPEC_SITE_LAYOUT = {
|
|
|
8978
8978
|
"object",
|
|
8979
8979
|
"diptych",
|
|
8980
8980
|
"material",
|
|
8981
|
-
"live"
|
|
8981
|
+
"live",
|
|
8982
|
+
"none"
|
|
8982
8983
|
],
|
|
8983
8984
|
"words": [
|
|
8984
8985
|
"headline",
|
|
@@ -9015,6 +9016,7 @@ const SPEC_SITE_LAYOUT = {
|
|
|
9015
9016
|
"media.diptych": "two full-height pictures side by side; a phone keeps the first",
|
|
9016
9017
|
"media.material": "an ambient ground drawn from the look's tokens (a glow behind ribs, a dotted grid, a slow light)",
|
|
9017
9018
|
"media.live": "a working form of the site's own in the first screen (a lead form, a booking)",
|
|
9019
|
+
"media.none": "no picture: the look's own ground, and the words carry the first screen",
|
|
9018
9020
|
"words.headline": "a heading, a line and one action",
|
|
9019
9021
|
"words.on-edge": "one display line at screen size sitting on the bottom edge, cropped by it",
|
|
9020
9022
|
"words.apart": "two or three giant words placed apart across the screen",
|
|
@@ -9040,6 +9042,7 @@ const SPEC_SITE_LAYOUT = {
|
|
|
9040
9042
|
"media.diptych": "שתי תמונות בגובה מלא זו לצד זו; בטלפון נשארת הראשונה",
|
|
9041
9043
|
"media.material": "רקע מהמראה של האתר (זוהר מאחורי פסים, רשת נקודות, אור איטי)",
|
|
9042
9044
|
"media.live": "טופס אמיתי של האתר במסך הראשון (פנייה, הזמנה)",
|
|
9045
|
+
"media.none": "בלי תמונה: הרקע של המראה, והמילים נושאות את המסך הראשון",
|
|
9043
9046
|
"words.headline": "כותרת, שורה ופעולה אחת",
|
|
9044
9047
|
"words.on-edge": "שורה אחת בגודל המסך שיושבת על הקצה התחתון, חתוכה בו",
|
|
9045
9048
|
"words.apart": "שתיים או שלוש מילים ענקיות, מפוזרות על המסך",
|
|
@@ -9074,6 +9077,48 @@ const SPEC_SITE_LAYOUT = {
|
|
|
9074
9077
|
"extras": [],
|
|
9075
9078
|
"motion": []
|
|
9076
9079
|
},
|
|
9080
|
+
"harness": [
|
|
9081
|
+
"media.none"
|
|
9082
|
+
],
|
|
9083
|
+
"typeLed": [
|
|
9084
|
+
{
|
|
9085
|
+
"frame": "full",
|
|
9086
|
+
"words": "wordmark"
|
|
9087
|
+
},
|
|
9088
|
+
{
|
|
9089
|
+
"frame": "inset",
|
|
9090
|
+
"words": "headline"
|
|
9091
|
+
},
|
|
9092
|
+
{
|
|
9093
|
+
"frame": "full",
|
|
9094
|
+
"words": "on-edge"
|
|
9095
|
+
},
|
|
9096
|
+
{
|
|
9097
|
+
"frame": "shrinks",
|
|
9098
|
+
"words": "headline"
|
|
9099
|
+
},
|
|
9100
|
+
{
|
|
9101
|
+
"frame": "inset",
|
|
9102
|
+
"words": "wordmark"
|
|
9103
|
+
},
|
|
9104
|
+
{
|
|
9105
|
+
"frame": "full",
|
|
9106
|
+
"words": "apart"
|
|
9107
|
+
},
|
|
9108
|
+
{
|
|
9109
|
+
"frame": "inset",
|
|
9110
|
+
"words": "on-edge"
|
|
9111
|
+
},
|
|
9112
|
+
{
|
|
9113
|
+
"frame": "shrinks",
|
|
9114
|
+
"words": "wordmark"
|
|
9115
|
+
},
|
|
9116
|
+
{
|
|
9117
|
+
"frame": "full",
|
|
9118
|
+
"words": "headline"
|
|
9119
|
+
}
|
|
9120
|
+
],
|
|
9121
|
+
"typeLedEveryTier": true,
|
|
9077
9122
|
"named": {
|
|
9078
9123
|
"hero.split": {},
|
|
9079
9124
|
"hero.full-bleed-media": {
|
|
@@ -9209,6 +9254,7 @@ const SPEC_SITE_LAYOUT = {
|
|
|
9209
9254
|
"media.film": "all",
|
|
9210
9255
|
"media.slideshow": "all",
|
|
9211
9256
|
"media.object": "all",
|
|
9257
|
+
"media.none": "all",
|
|
9212
9258
|
"words.headline": "all",
|
|
9213
9259
|
"rules.wordsNeverCut": "all",
|
|
9214
9260
|
"rules.badgeOwnersOnly": "all",
|
|
@@ -18439,7 +18485,7 @@ function phoneGapBefore(prev, next) {
|
|
|
18439
18485
|
* columns (`LAYOUT_COLUMN_GAP`), and 12 columns. */
|
|
18440
18486
|
const GRID_VW = 92;
|
|
18441
18487
|
const COLUMN_GAP_VW = 1.2;
|
|
18442
|
-
const GRID_COLUMNS$
|
|
18488
|
+
const GRID_COLUMNS$2 = 12;
|
|
18443
18489
|
/** A `screen` word's smallest and largest size (px), and the share of its room it fills (the renderer's margin). */
|
|
18444
18490
|
const LAYOUT_SCREEN_PX = [36, 560];
|
|
18445
18491
|
const SCREEN_FILL = 0.98;
|
|
@@ -18447,7 +18493,7 @@ const round2 = (n) => Math.round(n * 100) / 100;
|
|
|
18447
18493
|
const round4 = (n) => Math.round(n * 10000) / 10000;
|
|
18448
18494
|
/** How wide `cols` columns of the laptop grid stand, in vw (12 columns: 92vw). */
|
|
18449
18495
|
function layoutColumnsVw(cols) {
|
|
18450
|
-
const column = (GRID_VW - (GRID_COLUMNS$
|
|
18496
|
+
const column = (GRID_VW - (GRID_COLUMNS$2 - 1) * COLUMN_GAP_VW) / GRID_COLUMNS$2;
|
|
18451
18497
|
return cols * column + Math.max(0, cols - 1) * COLUMN_GAP_VW;
|
|
18452
18498
|
}
|
|
18453
18499
|
const LEGACY_GUTTER_PX = 16;
|
|
@@ -18465,7 +18511,7 @@ function layoutRoomPx(cols, width, phone, page = {}) {
|
|
|
18465
18511
|
return vw;
|
|
18466
18512
|
const gap = (COLUMN_GAP_VW / 100) * width;
|
|
18467
18513
|
const grid = Math.min(width - 2 * Math.max(0.04 * width, gutter), page.columnPx);
|
|
18468
|
-
return Math.min(vw, (cols * (grid - (GRID_COLUMNS$
|
|
18514
|
+
return Math.min(vw, (cols * (grid - (GRID_COLUMNS$2 - 1) * gap)) / GRID_COLUMNS$2 + Math.max(0, cols - 1) * gap);
|
|
18469
18515
|
}
|
|
18470
18516
|
/** A `screen` word's width term at a column `columnPx` wide: the px its `cols` columns stand where the column binds
|
|
18471
18517
|
* (12 columns of the column, 11 gaps of 1.2vw), at `fill / em` — `A px − B vw`. */
|
|
@@ -18473,8 +18519,8 @@ function layoutRoomPx(cols, width, phone, page = {}) {
|
|
|
18473
18519
|
* read — re-declared by the page's word, iox-ui#117), the stamped column (`fallback`) where a studio's rows lack it. */
|
|
18474
18520
|
function columnCapCss(cols, widthEm, fallback) {
|
|
18475
18521
|
const k = SCREEN_FILL / Math.max(widthEm, 0.01);
|
|
18476
|
-
const share = round4((cols / GRID_COLUMNS$
|
|
18477
|
-
const vw = round2(COLUMN_GAP_VW * (1 - cols / GRID_COLUMNS$
|
|
18522
|
+
const share = round4((cols / GRID_COLUMNS$2) * k);
|
|
18523
|
+
const vw = round2(COLUMN_GAP_VW * (1 - cols / GRID_COLUMNS$2) * k);
|
|
18478
18524
|
const cap = `var(--iox-content-cap, ${fallback})`;
|
|
18479
18525
|
return vw > 0 ? `calc(${cap} * ${share} - ${vw}vw)` : `calc(${cap} * ${share})`;
|
|
18480
18526
|
}
|
|
@@ -18492,7 +18538,7 @@ function screenFontSize(widthEm, cols, rows, sectionRows, screens, columnPx = nu
|
|
|
18492
18538
|
// in wide, so a page set narrower than the site never sees it run past its column.
|
|
18493
18539
|
// CW2: a word across all twelve columns also keeps inside the one gutter (`space-gutter` is a px token, so font-size
|
|
18494
18540
|
// may read it): on a phone and wherever the gutter is wider than 4% of the window, 92vw is more than the room.
|
|
18495
|
-
const room = cols >= GRID_COLUMNS$
|
|
18541
|
+
const room = cols >= GRID_COLUMNS$2 ? [`calc((100vw - 2 * var(--iox-space-gutter, ${LEGACY_GUTTER_PX}px)) * ${round4(SCREEN_FILL / Math.max(widthEm, 0.01))})`] : [];
|
|
18496
18542
|
const capFallback = columnPx ? `${columnPx}px` : capAlways ? WIDE_CAP : null;
|
|
18497
18543
|
const width = [`${widthVw}vw`, ...(capFallback ? [columnCapCss(cols, widthEm, capFallback)] : []), ...room];
|
|
18498
18544
|
if (!rows || !sectionRows)
|
|
@@ -19097,6 +19143,20 @@ const FACT_SHAPES = [
|
|
|
19097
19143
|
PRICE_SHAPE,
|
|
19098
19144
|
{ kind: 'time', pattern: /(?<!\d)\d{1,2}[:.]\d{2}(?!\d)/g, key: m => m.replace(/\D/g, '') },
|
|
19099
19145
|
];
|
|
19146
|
+
/** A bare number of three digits or more (`numbers` only); a phone, a price or a time is judged as one first. */
|
|
19147
|
+
const NUMBER_SHAPE = { kind: 'number', pattern: /(?<![\p{L}\p{N}])\d[\d,.]*\d(?![\p{L}\p{N}])/gu, key: (m) => m.replace(/\D/g, '') };
|
|
19148
|
+
const MIN_NUMBER_DIGITS = 3;
|
|
19149
|
+
/** A quotation: three words or more between quotation marks that stand outside a word (a Hebrew gershayim inside one —
|
|
19150
|
+
* ש״ח, צה״ל — is not a quote mark). */
|
|
19151
|
+
const QUOTE = /(?<![\p{L}\p{N}])["“„«״]([^"“”„«»״\n]+?)["”»״](?![\p{L}\p{N}])/gu;
|
|
19152
|
+
const MIN_QUOTE_WORDS = 3;
|
|
19153
|
+
const QUOTE_WORDS = /[\p{L}\p{N}]+/gu;
|
|
19154
|
+
/** A text's words, lower case, one space apart — what a quote is found in. */
|
|
19155
|
+
const plainWords = (text) => ` ${(normalise(text).match(QUOTE_WORDS) ?? []).join(' ')} `;
|
|
19156
|
+
/** Every quotation in `text` of three words or more, as written between its marks. */
|
|
19157
|
+
function quotesIn(text) {
|
|
19158
|
+
return [...String(text ?? '').matchAll(QUOTE)].map(m => m[1].trim()).filter(q => (q.match(QUOTE_WORDS) ?? []).length >= MIN_QUOTE_WORDS);
|
|
19159
|
+
}
|
|
19100
19160
|
/** Every price written in `text` (commerce C-D21: what a business sells never carries one — the owner sets prices). */
|
|
19101
19161
|
function pricesIn(text) {
|
|
19102
19162
|
return (text.match(PRICE_SHAPE.pattern) ?? []).map(m => m.trim());
|
|
@@ -19104,17 +19164,22 @@ function pricesIn(text) {
|
|
|
19104
19164
|
const MIN_PHONE_DIGITS = 8;
|
|
19105
19165
|
/** "2019 – 2024" is two years, not a phone number. */
|
|
19106
19166
|
const YEAR_RANGE = /^\s*\d{4}\s*[-–]\s*\d{4}\s*$/;
|
|
19107
|
-
function ownedKeys(facts, known = []) {
|
|
19167
|
+
function ownedKeys(facts, known = [], numbers = false) {
|
|
19108
19168
|
const keys = new Set();
|
|
19169
|
+
const shapes = numbers ? [...FACT_SHAPES, NUMBER_SHAPE] : FACT_SHAPES;
|
|
19109
19170
|
for (const value of [...Object.values(facts), ...known]) {
|
|
19110
19171
|
if (typeof value !== 'string')
|
|
19111
19172
|
continue;
|
|
19112
|
-
for (const shape of
|
|
19173
|
+
for (const shape of shapes)
|
|
19113
19174
|
for (const m of value.match(shape.pattern) ?? [])
|
|
19114
19175
|
keys.add(`${shape.kind}:${shape.key(m)}`);
|
|
19115
19176
|
}
|
|
19116
19177
|
return keys;
|
|
19117
19178
|
}
|
|
19179
|
+
/** `text` with every email, real phone, price and time blanked — what is left for the bare-number shape. */
|
|
19180
|
+
function withoutFactShapes(text) {
|
|
19181
|
+
return FACT_SHAPES.reduce((rest, shape) => rest.replace(shape.pattern, m => (shape.kind === 'phone' && (shape.key(m).length < MIN_PHONE_DIGITS || YEAR_RANGE.test(m)) ? m : ' ')), text);
|
|
19182
|
+
}
|
|
19118
19183
|
/**
|
|
19119
19184
|
* The words to avoid and the facts never given, in any texts a model wrote — the plan's (`planWordIssues`) and an AI
|
|
19120
19185
|
* Assist turn's field values (assist-core, R-H2): ONE judge of what a model may write.
|
|
@@ -19122,7 +19187,7 @@ function ownedKeys(facts, known = []) {
|
|
|
19122
19187
|
function factIssues(texts, ctx) {
|
|
19123
19188
|
const issues = [];
|
|
19124
19189
|
const avoid = [...new Set(ctx.avoidWords.map(w => w.trim()).filter(Boolean))].map(w => ({ word: w, pattern: wordPattern(w) }));
|
|
19125
|
-
const owned = ownedKeys(ctx.facts, ctx.known);
|
|
19190
|
+
const owned = ownedKeys(ctx.facts, ctx.known, ctx.numbers);
|
|
19126
19191
|
for (const { path, text } of texts) {
|
|
19127
19192
|
const words = normalise(text);
|
|
19128
19193
|
for (const a of avoid)
|
|
@@ -19137,6 +19202,20 @@ function factIssues(texts, ctx) {
|
|
|
19137
19202
|
issues.push({ code: PlanWordIssueCode.InventedFact, path, message: `"${m.trim()}" looks like a ${shape.kind} the owner never gave — leave it out` });
|
|
19138
19203
|
}
|
|
19139
19204
|
}
|
|
19205
|
+
if (ctx.quotes) {
|
|
19206
|
+
const owners = [...Object.values(ctx.facts), ...(ctx.known ?? [])].filter((v) => typeof v === 'string').map(plainWords);
|
|
19207
|
+
for (const q of quotesIn(text)) {
|
|
19208
|
+
if (!owners.some(o => o.includes(plainWords(q))))
|
|
19209
|
+
issues.push({ code: PlanWordIssueCode.InventedFact, path, message: `"${q}" reads as a quote the owner never gave — a quote is a fact: leave it out` });
|
|
19210
|
+
}
|
|
19211
|
+
}
|
|
19212
|
+
if (ctx.numbers) {
|
|
19213
|
+
for (const m of withoutFactShapes(text).match(NUMBER_SHAPE.pattern) ?? []) {
|
|
19214
|
+
const key = NUMBER_SHAPE.key(m);
|
|
19215
|
+
if (key.length >= MIN_NUMBER_DIGITS && !owned.has(`number:${key}`))
|
|
19216
|
+
issues.push({ code: PlanWordIssueCode.InventedFact, path, message: `"${m.trim()}" looks like a number the owner never gave — leave it out` });
|
|
19217
|
+
}
|
|
19218
|
+
}
|
|
19140
19219
|
}
|
|
19141
19220
|
return issues;
|
|
19142
19221
|
}
|
|
@@ -19689,7 +19768,7 @@ const V$1 = SPEC_SITE_LAYOUT.vocab;
|
|
|
19689
19768
|
const GALLERY_EFFECTS = V$1.galleryEffects;
|
|
19690
19769
|
const FORM_PRESETS = V$1.formPresets;
|
|
19691
19770
|
const BUTTON_VARIANTS = V$1.buttonVariants;
|
|
19692
|
-
const NONE$
|
|
19771
|
+
const NONE$3 = 'none';
|
|
19693
19772
|
const CLIP = 'clipReveal';
|
|
19694
19773
|
const CLIP_SIDE = `${CLIP}-`;
|
|
19695
19774
|
/** A gallery the wire marks `autoplay` turns every 5 s — what the proof sites' autoplaying galleries do. */
|
|
@@ -19697,7 +19776,7 @@ const LAYOUT_WIRE_AUTOPLAY_MS = 5000;
|
|
|
19697
19776
|
const CHIP_SLOTS = Array.from(new Set(Object.values(V$1.formChips).flat()));
|
|
19698
19777
|
const SLOT_NAMES = [...V$1.formSlots, ...CHIP_SLOTS];
|
|
19699
19778
|
const ENTER_ON_WIRE = V$1.enters.flatMap((e) => (e === CLIP ? V$1.sides.map((s) => `${CLIP_SIDE}${s}`) : [e]));
|
|
19700
|
-
const VARIANT_ON_WIRE = [NONE$
|
|
19779
|
+
const VARIANT_ON_WIRE = [NONE$3, ...V$1.buttonVariants, ...V$1.galleryEffects, ...V$1.formPresets];
|
|
19701
19780
|
/**
|
|
19702
19781
|
* List ingredients (list-ingredients-plan.md §2, LI1): a list section's mix travels as ONE list of `<ingredient>:<word>`
|
|
19703
19782
|
* words (`arrange:strips`, `hover:dim`) and its parts as `<list>.<role>` (`stories.quote`) — two properties, so the
|
|
@@ -19716,14 +19795,14 @@ var LayoutMixIngredient;
|
|
|
19716
19795
|
LayoutMixIngredient["Phone"] = "phone";
|
|
19717
19796
|
})(LayoutMixIngredient || (LayoutMixIngredient = {}));
|
|
19718
19797
|
const MIX_SEPARATOR = ':';
|
|
19719
|
-
const BASIC = 'basic';
|
|
19798
|
+
const BASIC$1 = 'basic';
|
|
19720
19799
|
const AWARD$1 = 'award';
|
|
19721
19800
|
const PART_SEPARATOR = '.';
|
|
19722
19801
|
/** Every word a stored mix may hold, ingredient by ingredient (a waiting word too: a stored answer still reads). */
|
|
19723
19802
|
const LAYOUT_MIX_WORDS = LIST_INGREDIENTS.flatMap(k => listIngredientWords(k).map(w => `${k}${MIX_SEPARATOR}${w}`));
|
|
19724
19803
|
/** The words the wire OFFERS a site below the award tier — the built ones only (ingredients.md §3.3: a waiting word would
|
|
19725
19804
|
* put its stand-in on every site that asked for it), less the award tier's (AW-D23, AW11). */
|
|
19726
|
-
const LAYOUT_MIX_OFFERED = LIST_INGREDIENTS.flatMap(k => listBuiltWords(k).filter(w => listWordOffered(k, w, BASIC)).map(w => `${k}${MIX_SEPARATOR}${w}`));
|
|
19805
|
+
const LAYOUT_MIX_OFFERED = LIST_INGREDIENTS.flatMap(k => listBuiltWords(k).filter(w => listWordOffered(k, w, BASIC$1)).map(w => `${k}${MIX_SEPARATOR}${w}`));
|
|
19727
19806
|
/** AW11: every built word, the award tier's included — what the wire offers an award site before the lists are read. */
|
|
19728
19807
|
const LAYOUT_MIX_OFFERED_AWARD = LIST_INGREDIENTS.flatMap(k => listBuiltWords(k).map(w => `${k}${MIX_SEPARATOR}${w}`));
|
|
19729
19808
|
/** The column words a page of a type is offered (award §0c, AW-D34): the axis's words less what the type never wears. */
|
|
@@ -19777,11 +19856,11 @@ const mixHint = (offered) => LIST_INGREDIENTS.map(k => {
|
|
|
19777
19856
|
function layoutWirePartWords(lists) {
|
|
19778
19857
|
return lists.flatMap(l => l.roles.map(r => `${l.alias}${PART_SEPARATOR}${r}`));
|
|
19779
19858
|
}
|
|
19780
|
-
const text$
|
|
19859
|
+
const text$2 = (d) => ({ ...jsonText(), description: d });
|
|
19781
19860
|
const integer = (d) => ({ ...jsonInteger(), description: d });
|
|
19782
|
-
const oneOf$
|
|
19861
|
+
const oneOf$2 = (values, d) => ({ ...jsonOneOf(values), description: d });
|
|
19783
19862
|
const listOf$2 = (items, d) => ({ ...jsonListOf(items), description: d });
|
|
19784
|
-
const closed = (properties, d) => jsonClosedObject(properties, Object.keys(properties), d);
|
|
19863
|
+
const closed$1 = (properties, d) => jsonClosedObject(properties, Object.keys(properties), d);
|
|
19785
19864
|
/** The strict format for one composed page — with the list ingredients when `options.lists` is given. */
|
|
19786
19865
|
function layoutWireJsonSchema(options = {}) {
|
|
19787
19866
|
const partWords = options.lists ? layoutWirePartWords(options.lists) : [];
|
|
@@ -19790,66 +19869,66 @@ function layoutWireJsonSchema(options = {}) {
|
|
|
19790
19869
|
const lists = options.lists
|
|
19791
19870
|
? {
|
|
19792
19871
|
mix: listOf$2(jsonOneOf(mixOffered), `gallery showing a list (source): how its items are shown, one word per choice — ${mixHint(mixOffered)}; [] for none`),
|
|
19793
|
-
parts: listOf$2(jsonOneOf(partWords.length ? partWords : [NONE$
|
|
19872
|
+
parts: listOf$2(jsonOneOf(partWords.length ? partWords : [NONE$3]), "gallery showing a list as cards: the list's fields each card shows, <list>.<role>, the source's own; [] for none"),
|
|
19794
19873
|
}
|
|
19795
19874
|
: {};
|
|
19796
19875
|
const carried = options.carry
|
|
19797
19876
|
? {
|
|
19798
|
-
carry: oneOf$
|
|
19877
|
+
carry: oneOf$2([NONE$3, ...options.carry], "a redesign: the owner's part this layer shows, by handle — its words, photo or form as they are (write no text of your own then); a section's ONLY layer naming a bind:/block:/keep: handle makes the whole section that part; 'none' for a layer of your own"),
|
|
19799
19878
|
}
|
|
19800
19879
|
: {};
|
|
19801
|
-
const layer = closed({
|
|
19802
|
-
kind: oneOf$
|
|
19803
|
-
role: oneOf$
|
|
19804
|
-
text: text$
|
|
19880
|
+
const layer = closed$1({
|
|
19881
|
+
kind: oneOf$2(V$1.kinds, 'what the layer is'),
|
|
19882
|
+
role: oneOf$2(V$1.roles, 'lead: the ONE thing the eye finds first in its section · support: follows it · decoration: only fades · static: never moves'),
|
|
19883
|
+
text: text$2("the words (word, heading, text, label, number, button); '' for none; a fact you were not given is {fact:<key>}"),
|
|
19805
19884
|
items: listOf$2(jsonText(), 'list items · marquee phrases · one caption per gallery photo; [] for none'),
|
|
19806
19885
|
photos: listOf$2(jsonText(), 'photo: one photo id · gallery: its slides, in order; ids from the photos you are given; [] for none'),
|
|
19807
|
-
source: text$
|
|
19886
|
+
source: text$2("gallery: the alias of a list data source whose items it shows instead of photos; '' for none"),
|
|
19808
19887
|
box: listOf$2(jsonInteger(), '[colStart, colEnd, rowStart, rowEnd]: grid lines 1..13 (1..12×hold+1 sideways) and 1..rows+1'),
|
|
19809
|
-
size: oneOf$
|
|
19810
|
-
color: oneOf$
|
|
19811
|
-
align: oneOf$
|
|
19888
|
+
size: oneOf$2([NONE$3, ...V$1.sizes], "type size; 'screen' = as wide as its columns, a word, never a sentence"),
|
|
19889
|
+
color: oneOf$2(V$1.colours, "the look's colour by name"),
|
|
19890
|
+
align: oneOf$2(V$1.aligns, 'text alignment'),
|
|
19812
19891
|
z: integer('0..9 stacking'),
|
|
19813
|
-
bleed: oneOf$
|
|
19892
|
+
bleed: oneOf$2(V$1.bleeds, 'runs off the screen at that edge'),
|
|
19814
19893
|
rotate: integer("degrees, within the look's limit"),
|
|
19815
|
-
to: text$
|
|
19816
|
-
variant: oneOf$
|
|
19817
|
-
enter: oneOf$
|
|
19894
|
+
to: text$2("button: a section id of this page or a page route ('/contact'); '' for none"),
|
|
19895
|
+
variant: oneOf$2(VARIANT_ON_WIRE, 'button: primary | secondary | ghost · gallery: its effect · form: its preset · none'),
|
|
19896
|
+
enter: oneOf$2(layoutEntersOffered(options.scrub), scrubOffered(options.scrub)
|
|
19818
19897
|
? 'plays once as it arrives (time); clipReveal opens from that side; letters: a line of words rises letter by letter (a display line)'
|
|
19819
19898
|
: 'plays once as it arrives (time); clipReveal opens from that side'),
|
|
19820
|
-
depth: oneOf$
|
|
19899
|
+
depth: oneOf$2([NONE$3, ...V$1.depths], 'the parallax trio (not in held sections)'),
|
|
19821
19900
|
inner: integer('0..3: how far a photo drifts inside its frame'),
|
|
19822
19901
|
flags: listOf$2(jsonOneOf(layoutFlagsOffered(options.scrub)), `switches: scrim (a shadow under words on a photo) · kinetic (lit word by word, held only) · contain · gallery: centered, freeMode, loop, drift, scroll (held only: the scroll turns it), autoplay${scrubOffered(options.scrub) ? ` · scrub (its entrance follows the scroll instead of playing once — ${options.scrub === ScrubId.Words ? 'a mask rise or letters only' : 'any entrance'}; never in the first section)` : ''}; [] for none`),
|
|
19823
19902
|
perView: { type: 'number', description: 'gallery slides per view; 0 for none' },
|
|
19824
|
-
slots: listOf$2(closed({ slot: oneOf$
|
|
19825
|
-
motion: listOf$2(closed({
|
|
19826
|
-
prop: oneOf$
|
|
19827
|
-
ease: oneOf$
|
|
19903
|
+
slots: listOf$2(closed$1({ slot: oneOf$2(SLOT_NAMES, 'which words'), text: text$2('the words, in the business\'s language') }), "form: its title, intro, submit, successTitle, successText, channel, and one entry per chip (needs · budget · guests); [] for none"),
|
|
19904
|
+
motion: listOf$2(closed$1({
|
|
19905
|
+
prop: oneOf$2(V$1.trackProps, 'what moves'),
|
|
19906
|
+
ease: oneOf$2(V$1.eases, 'how'),
|
|
19828
19907
|
values: listOf$2({ type: 'number' }, '[from, to, at0, at1]: values and the part of the hold it plays over (0..1)'),
|
|
19829
19908
|
}), 'held sections only: tracks the scroll plays; [] for none'),
|
|
19830
19909
|
...lists,
|
|
19831
19910
|
...carried,
|
|
19832
19911
|
});
|
|
19833
|
-
const section = closed({
|
|
19834
|
-
id: text$
|
|
19835
|
-
kind: oneOf$
|
|
19912
|
+
const section = closed$1({
|
|
19913
|
+
id: text$2('a short slug, unique on the page'),
|
|
19914
|
+
kind: oneOf$2(V$1.sectionKinds, 'content · inhale (a breath: ≤ 2 small layers, no photo) · signature (exactly ONE)'),
|
|
19836
19915
|
screens: integer('1..5 screen heights'),
|
|
19837
19916
|
hold: integer('0 flows · 1 held (the page stops while its layers move) · 2..4 held and carried sideways that many screens'),
|
|
19838
|
-
ground: text$
|
|
19917
|
+
ground: text$2("a colour name, or photo:<id>"),
|
|
19839
19918
|
rows: integer('4..16 grid rows'),
|
|
19840
|
-
transition: oneOf$
|
|
19919
|
+
transition: oneOf$2(V$1.transitions, 'how it arrives over the section before'),
|
|
19841
19920
|
phone: listOf$2(jsonInteger(), "every layer's index exactly once, in a phone's reading order"),
|
|
19842
19921
|
layers: listOf$2(layer, 'the layers'),
|
|
19843
19922
|
});
|
|
19844
19923
|
const columns = columnsOnWire(options);
|
|
19845
19924
|
const page = columns
|
|
19846
|
-
? { column: oneOf$
|
|
19925
|
+
? { column: oneOf$2(columns, "the page's content column: wide = the window less the one gutter (a gallery, a bold page) · contained = one centred column · narrow = a reading column (a story, a case study); grounds and bleeds keep the window") }
|
|
19847
19926
|
: {};
|
|
19848
|
-
return closed({ ...page, sections: listOf$2(section, '4..8 sections') }, 'one composed page in the layout language');
|
|
19927
|
+
return closed$1({ ...page, sections: listOf$2(section, '4..8 sections') }, 'one composed page in the layout language');
|
|
19849
19928
|
}
|
|
19850
19929
|
const nonEmpty$2 = (v) => typeof v === 'string' && v.trim() !== '';
|
|
19851
19930
|
const num = (v, fallback = 0) => (typeof v === 'number' && Number.isFinite(v) ? v : fallback);
|
|
19852
|
-
const strings = (v) => (Array.isArray(v) ? v.filter((x) => typeof x === 'string') : []);
|
|
19931
|
+
const strings$1 = (v) => (Array.isArray(v) ? v.filter((x) => typeof x === 'string') : []);
|
|
19853
19932
|
function expandForm(l, preset) {
|
|
19854
19933
|
const form = { preset: preset };
|
|
19855
19934
|
const options = {};
|
|
@@ -19870,9 +19949,9 @@ function expandForm(l, preset) {
|
|
|
19870
19949
|
return form;
|
|
19871
19950
|
}
|
|
19872
19951
|
function expandGallery(l, flags, variant) {
|
|
19873
|
-
const captions = strings(l['items']);
|
|
19952
|
+
const captions = strings$1(l['items']);
|
|
19874
19953
|
const gallery = {
|
|
19875
|
-
slides: strings(l['photos']).map((id, i) => ({ photo: { id }, ...(nonEmpty$2(captions[i]) ? { caption: captions[i] } : {}) })),
|
|
19954
|
+
slides: strings$1(l['photos']).map((id, i) => ({ photo: { id }, ...(nonEmpty$2(captions[i]) ? { caption: captions[i] } : {}) })),
|
|
19876
19955
|
};
|
|
19877
19956
|
if (GALLERY_EFFECTS.includes(variant))
|
|
19878
19957
|
gallery.effect = variant;
|
|
@@ -19894,10 +19973,10 @@ function expandGallery(l, flags, variant) {
|
|
|
19894
19973
|
/** `mix` + `parts` → a list mix, or null when the wire names no mix. Words are kept as written (`checkList` judges them);
|
|
19895
19974
|
* parts of another list than the gallery's are left out, and the first part names the list when `source` is empty. */
|
|
19896
19975
|
function expandListMix(l, gallery) {
|
|
19897
|
-
const words = strings(l['mix']);
|
|
19976
|
+
const words = strings$1(l['mix']);
|
|
19898
19977
|
if (!words.length)
|
|
19899
19978
|
return null;
|
|
19900
|
-
const parts = strings(l['parts']).filter(p => p !== NONE$
|
|
19979
|
+
const parts = strings$1(l['parts']).filter(p => p !== NONE$3).map(p => {
|
|
19901
19980
|
const at = p.lastIndexOf(PART_SEPARATOR);
|
|
19902
19981
|
return at > 0 ? { list: p.slice(0, at), role: p.slice(at + 1) } : null;
|
|
19903
19982
|
}).filter((p) => !!p);
|
|
@@ -19957,8 +20036,8 @@ function expandTrack(t) {
|
|
|
19957
20036
|
function expandLayer(l, beat) {
|
|
19958
20037
|
const kind = String(l['kind']);
|
|
19959
20038
|
const box = Array.isArray(l['box']) ? l['box'].map(x => num(x)) : [];
|
|
19960
|
-
const flags = new Set(strings(l['flags']));
|
|
19961
|
-
const variant = String(l['variant'] ?? NONE$
|
|
20039
|
+
const flags = new Set(strings$1(l['flags']));
|
|
20040
|
+
const variant = String(l['variant'] ?? NONE$3);
|
|
19962
20041
|
const out = {
|
|
19963
20042
|
kind: kind,
|
|
19964
20043
|
role: String(l['role']),
|
|
@@ -19967,18 +20046,18 @@ function expandLayer(l, beat) {
|
|
|
19967
20046
|
};
|
|
19968
20047
|
if (nonEmpty$2(l['text']))
|
|
19969
20048
|
out.text = String(l['text']);
|
|
19970
|
-
const items = strings(l['items']);
|
|
20049
|
+
const items = strings$1(l['items']);
|
|
19971
20050
|
if (items.length && kind !== 'gallery')
|
|
19972
20051
|
out.items = items;
|
|
19973
|
-
if (kind === 'photo' && strings(l['photos'])[0])
|
|
19974
|
-
out.photo = { id: strings(l['photos'])[0] };
|
|
20052
|
+
if (kind === 'photo' && strings$1(l['photos'])[0])
|
|
20053
|
+
out.photo = { id: strings$1(l['photos'])[0] };
|
|
19975
20054
|
if (kind === 'gallery')
|
|
19976
20055
|
out.gallery = expandGallery(l, flags, variant);
|
|
19977
20056
|
if (kind === 'form')
|
|
19978
20057
|
out.form = expandForm(l, FORM_PRESETS.includes(variant) ? variant : 'contact');
|
|
19979
20058
|
if (kind === 'button' && BUTTON_VARIANTS.includes(variant))
|
|
19980
20059
|
out.variant = variant;
|
|
19981
|
-
if (nonEmpty$2(l['size']) && l['size'] !== NONE$
|
|
20060
|
+
if (nonEmpty$2(l['size']) && l['size'] !== NONE$3)
|
|
19982
20061
|
out.size = String(l['size']);
|
|
19983
20062
|
if (nonEmpty$2(l['color']))
|
|
19984
20063
|
out.color = String(l['color']);
|
|
@@ -19986,7 +20065,7 @@ function expandLayer(l, beat) {
|
|
|
19986
20065
|
out.align = String(l['align']);
|
|
19987
20066
|
if (num(l['z']))
|
|
19988
20067
|
out.z = num(l['z']);
|
|
19989
|
-
if (nonEmpty$2(l['bleed']) && l['bleed'] !== NONE$
|
|
20068
|
+
if (nonEmpty$2(l['bleed']) && l['bleed'] !== NONE$3)
|
|
19990
20069
|
out.bleed = String(l['bleed']);
|
|
19991
20070
|
if (num(l['rotate']))
|
|
19992
20071
|
out.rotate = num(l['rotate']);
|
|
@@ -20000,23 +20079,23 @@ function expandLayer(l, beat) {
|
|
|
20000
20079
|
out.fit = 'contain';
|
|
20001
20080
|
if (flags.has(SCRUB_FLAG))
|
|
20002
20081
|
out.scrub = true;
|
|
20003
|
-
const enter = String(l['enter'] ?? NONE$
|
|
20082
|
+
const enter = String(l['enter'] ?? NONE$3);
|
|
20004
20083
|
if (enter.startsWith(CLIP_SIDE)) {
|
|
20005
20084
|
out.enter = CLIP;
|
|
20006
20085
|
out.from = enter.slice(CLIP_SIDE.length);
|
|
20007
20086
|
}
|
|
20008
|
-
else if (enter !== NONE$
|
|
20087
|
+
else if (enter !== NONE$3)
|
|
20009
20088
|
out.enter = enter;
|
|
20010
20089
|
if (out.enter)
|
|
20011
20090
|
out.beat = beat;
|
|
20012
|
-
if (nonEmpty$2(l['depth']) && l['depth'] !== NONE$
|
|
20091
|
+
if (nonEmpty$2(l['depth']) && l['depth'] !== NONE$3)
|
|
20013
20092
|
out.depth = String(l['depth']);
|
|
20014
20093
|
if (num(l['inner']))
|
|
20015
20094
|
out.inner = num(l['inner']);
|
|
20016
20095
|
const motion = (Array.isArray(l['motion']) ? l['motion'] : []).filter(isPlainObject).map(expandTrack);
|
|
20017
20096
|
if (motion.length)
|
|
20018
20097
|
out.motion = motion;
|
|
20019
|
-
if (nonEmpty$2(l['carry']) && l['carry'] !== NONE$
|
|
20098
|
+
if (nonEmpty$2(l['carry']) && l['carry'] !== NONE$3)
|
|
20020
20099
|
out.carry = String(l['carry']).trim();
|
|
20021
20100
|
return out;
|
|
20022
20101
|
}
|
|
@@ -20029,7 +20108,7 @@ function expandLayer(l, beat) {
|
|
|
20029
20108
|
function derivedBeats(layers) {
|
|
20030
20109
|
const last = LAYOUT_BEAT_DELAY.length - 1;
|
|
20031
20110
|
let beat = 0;
|
|
20032
|
-
return layers.map(l => (l.role === 'lead' ? 0 : String(l.enter ?? NONE$
|
|
20111
|
+
return layers.map(l => (l.role === 'lead' ? 0 : String(l.enter ?? NONE$3) !== NONE$3 ? Math.min(++beat, last) : 0));
|
|
20033
20112
|
}
|
|
20034
20113
|
function expandSection(s) {
|
|
20035
20114
|
const kind = String(s['kind']);
|
|
@@ -20110,16 +20189,16 @@ function layerToWire(l) {
|
|
|
20110
20189
|
photos: g ? g.slides.map(s => s.photo?.id ?? '') : l.photo ? [l.photo.id] : [],
|
|
20111
20190
|
source: g?.source ?? '',
|
|
20112
20191
|
box: [...(l.col ?? [1, 2]), ...(l.row ?? [1, 2])],
|
|
20113
|
-
size: l.size ?? NONE$
|
|
20192
|
+
size: l.size ?? NONE$3,
|
|
20114
20193
|
color: l.color ?? 'ink',
|
|
20115
20194
|
align: l.align ?? 'start',
|
|
20116
20195
|
z: l.z ?? 0,
|
|
20117
|
-
bleed: l.bleed ?? NONE$
|
|
20196
|
+
bleed: l.bleed ?? NONE$3,
|
|
20118
20197
|
rotate: l.rotate ?? 0,
|
|
20119
20198
|
to: l.to ?? '',
|
|
20120
|
-
variant: l.variant ?? g?.effect ?? f?.preset ?? NONE$
|
|
20121
|
-
enter: l.enter === CLIP ? `${CLIP_SIDE}${l.from ?? 'bottom'}` : l.enter ?? NONE$
|
|
20122
|
-
depth: l.depth ?? NONE$
|
|
20199
|
+
variant: l.variant ?? g?.effect ?? f?.preset ?? NONE$3,
|
|
20200
|
+
enter: l.enter === CLIP ? `${CLIP_SIDE}${l.from ?? 'bottom'}` : l.enter ?? NONE$3,
|
|
20201
|
+
depth: l.depth ?? NONE$3,
|
|
20123
20202
|
inner: l.inner ?? 0,
|
|
20124
20203
|
flags,
|
|
20125
20204
|
perView: typeof g?.perView === 'number' ? g.perView : 0,
|
|
@@ -20132,8 +20211,8 @@ function layerToWire(l) {
|
|
|
20132
20211
|
/** A section place (RD-D20) on the wire: ONE layer naming its handle — what `expandSection` reads back as the place. */
|
|
20133
20212
|
function carryPlaceToWire(s) {
|
|
20134
20213
|
const layer = {
|
|
20135
|
-
kind: 'text', role: 'lead', text: '', items: [], photos: [], source: '', box: [1, 13, 1, 2], size: NONE$
|
|
20136
|
-
z: 0, bleed: NONE$
|
|
20214
|
+
kind: 'text', role: 'lead', text: '', items: [], photos: [], source: '', box: [1, 13, 1, 2], size: NONE$3, color: 'ink', align: 'start',
|
|
20215
|
+
z: 0, bleed: NONE$3, rotate: 0, to: '', variant: NONE$3, enter: NONE$3, depth: NONE$3, inner: 0, flags: [], perView: 0, slots: [], motion: [],
|
|
20137
20216
|
carry: s.carry,
|
|
20138
20217
|
};
|
|
20139
20218
|
return { id: s.id, kind: 'content', screens: 1, hold: 0, ground: 'ground', rows: 4, transition: 'cut', phone: [0], layers: [layer] };
|
|
@@ -21400,7 +21479,7 @@ const filled$1 = (s) => !!s.pin || (s.track ?? 1) > 1 || !!s.readyMade || !!s.ca
|
|
|
21400
21479
|
|| s.kind === LayoutSectionKind.Inhale;
|
|
21401
21480
|
/** Where a layer's ink is in its section (px from the section's top): its cell for what stretches, its words' lines in the
|
|
21402
21481
|
* cell's middle for the rest, the line of a rule. */
|
|
21403
|
-
function inkOf(s, li, rowPx) {
|
|
21482
|
+
function inkOf$1(s, li, rowPx) {
|
|
21404
21483
|
const l = s.layers[li];
|
|
21405
21484
|
const t = (l.row[0] - 1) * rowPx;
|
|
21406
21485
|
const b = (l.row[1] - 1) * rowPx;
|
|
@@ -21443,7 +21522,7 @@ function layoutVoids(sections) {
|
|
|
21443
21522
|
(s.layers ?? []).forEach((l, li) => {
|
|
21444
21523
|
if (!Array.isArray(l.row) || !Array.isArray(l.col))
|
|
21445
21524
|
return;
|
|
21446
|
-
const [a, b] = inkOf(s, li, rowPx);
|
|
21525
|
+
const [a, b] = inkOf$1(s, li, rowPx);
|
|
21447
21526
|
ink.push([top + a, top + b]);
|
|
21448
21527
|
});
|
|
21449
21528
|
}
|
|
@@ -23679,7 +23758,7 @@ const brandPart = (ctx) => {
|
|
|
23679
23758
|
return ctx.tagline?.trim() ? node : { ...node, c: (node.c ?? []).filter(n => n.fromBusiness !== 'tagline') };
|
|
23680
23759
|
};
|
|
23681
23760
|
/** The columns of a footer's grid: the name's block wider, one column per block it holds. */
|
|
23682
|
-
function columnsOf(count) {
|
|
23761
|
+
function columnsOf$1(count) {
|
|
23683
23762
|
const lay = { display: 'grid', gridTemplateColumns: ['2fr', ...Array.from({ length: count }, () => '1fr')].join(' '), gap: GAP$1 };
|
|
23684
23763
|
const resp = count >= 3
|
|
23685
23764
|
? { tablet: { gridTemplateColumns: 'repeat(2, minmax(0, 1fr))' }, mobile: { gridTemplateColumns: 'minmax(0, 1fr)' } }
|
|
@@ -23722,7 +23801,7 @@ function bodyOf$2(mix, ctx) {
|
|
|
23722
23801
|
];
|
|
23723
23802
|
}
|
|
23724
23803
|
default:
|
|
23725
|
-
return [{ t: 'Container', es: 'box', ...columnsOf(holds.length), c: [brandPart(ctx), ...holds] }, part$3('rule'), part$3('copyright')];
|
|
23804
|
+
return [{ t: 'Container', es: 'box', ...columnsOf$1(holds.length), c: [brandPart(ctx), ...holds] }, part$3('rule'), part$3('copyright')];
|
|
23726
23805
|
}
|
|
23727
23806
|
}
|
|
23728
23807
|
/** A footer mix as a pattern: what the composer stamps as the site's footer (global, after the page). Check it first. */
|
|
@@ -23866,7 +23945,7 @@ const TEXT$1 = 'Text';
|
|
|
23866
23945
|
const HEADING$1 = 'Heading';
|
|
23867
23946
|
const NAV_STYLE = 'nav';
|
|
23868
23947
|
const DISPLAY = 'display';
|
|
23869
|
-
const NONE$
|
|
23948
|
+
const NONE$2 = 'none';
|
|
23870
23949
|
const CLICK = 'click';
|
|
23871
23950
|
const HOME_ROUTE = '/';
|
|
23872
23951
|
const COMPOSED$2 = { releaseLayoutDefaults: true };
|
|
@@ -23954,7 +24033,7 @@ function navShapeOf(globals) {
|
|
|
23954
24033
|
return NavShape.Bar;
|
|
23955
24034
|
return drawer ? NavShape.Drawer : null;
|
|
23956
24035
|
}
|
|
23957
|
-
const hiddenAt = (n) => Object.entries(n.responsive ?? {}).find(([, layer]) => layer?.styleProps?.[DISPLAY] === NONE$
|
|
24036
|
+
const hiddenAt = (n) => Object.entries(n.responsive ?? {}).find(([, layer]) => layer?.styleProps?.[DISPLAY] === NONE$2)?.[0] ?? null;
|
|
23958
24037
|
/** The breakpoint the phone shape takes over at, read off the header's links row (default Mobile). */
|
|
23959
24038
|
function navShapeBreakpoint(globals) {
|
|
23960
24039
|
const links = find(globals, NavRole.Links);
|
|
@@ -24068,7 +24147,7 @@ const MENU_DISPLAY = 'inline-flex';
|
|
|
24068
24147
|
/** What a header part hidden at every width shows again when the menu goes back to phone widths only. */
|
|
24069
24148
|
const BUILT_DISPLAY = { [NavRole.Links]: 'flex' };
|
|
24070
24149
|
function phoneOnly(node, at, display) {
|
|
24071
|
-
node.styleProps[DISPLAY] = NONE$
|
|
24150
|
+
node.styleProps[DISPLAY] = NONE$2;
|
|
24072
24151
|
node.responsive = { ...(node.responsive ?? {}), [at]: { ...(node.responsive?.[at] ?? {}), styleProps: { ...(node.responsive?.[at]?.styleProps ?? {}), [DISPLAY]: display } } };
|
|
24073
24152
|
}
|
|
24074
24153
|
/** At every width (HI-D8): `display` lives in the base styles and no breakpoint overrides it. */
|
|
@@ -24088,11 +24167,11 @@ function displayEverywhere(node, display) {
|
|
|
24088
24167
|
function menuAtEveryWidth(globals, navId) {
|
|
24089
24168
|
const root = findNavRoot(globals, navId);
|
|
24090
24169
|
const menu = root ? find([root], NavRole.MenuButton) : null;
|
|
24091
|
-
return !!menu && menu.styleProps?.[DISPLAY] !== NONE$
|
|
24170
|
+
return !!menu && menu.styleProps?.[DISPLAY] !== NONE$2;
|
|
24092
24171
|
}
|
|
24093
24172
|
/** Hidden at the phone width: the header's links row. */
|
|
24094
24173
|
function hideAt(node, at) {
|
|
24095
|
-
node.responsive = { ...(node.responsive ?? {}), [at]: { ...(node.responsive?.[at] ?? {}), styleProps: { ...(node.responsive?.[at]?.styleProps ?? {}), [DISPLAY]: NONE$
|
|
24174
|
+
node.responsive = { ...(node.responsive ?? {}), [at]: { ...(node.responsive?.[at] ?? {}), styleProps: { ...(node.responsive?.[at]?.styleProps ?? {}), [DISPLAY]: NONE$2 } } };
|
|
24096
24175
|
}
|
|
24097
24176
|
/** Move every `display` override the shape owns to the new breakpoint. */
|
|
24098
24177
|
function moveDisplayOverride(node, to) {
|
|
@@ -24403,12 +24482,12 @@ function planNavShape(globals, shape, options = {}, navId) {
|
|
|
24403
24482
|
const menu = wantMenuButton ? (existingMenu ? asToggle(existingMenu) : menuButton(kit, dr.id, at, words)) : null;
|
|
24404
24483
|
for (const p of phoneHiddenParts(root)) {
|
|
24405
24484
|
if (everyWidth && !KEPT_AT_EVERY_WIDTH.has(roleOf(p))) {
|
|
24406
|
-
displayEverywhere(p, NONE$
|
|
24485
|
+
displayEverywhere(p, NONE$2);
|
|
24407
24486
|
continue;
|
|
24408
24487
|
}
|
|
24409
24488
|
// Back from every width: the base `none` was this function's, not the author's. Base styles hold ONE display, so
|
|
24410
24489
|
// the part takes back what its role is built with (the links row is a row), else its type's own.
|
|
24411
|
-
if (wasEveryWidth && p.styleProps?.[DISPLAY] === NONE$
|
|
24490
|
+
if (wasEveryWidth && p.styleProps?.[DISPLAY] === NONE$2) {
|
|
24412
24491
|
const back = BUILT_DISPLAY[roleOf(p) ?? ''];
|
|
24413
24492
|
if (back)
|
|
24414
24493
|
p.styleProps[DISPLAY] = back;
|
|
@@ -25066,6 +25145,7 @@ var OpeningMedia;
|
|
|
25066
25145
|
OpeningMedia["Diptych"] = "diptych";
|
|
25067
25146
|
OpeningMedia["Material"] = "material";
|
|
25068
25147
|
OpeningMedia["Live"] = "live";
|
|
25148
|
+
OpeningMedia["None"] = "none";
|
|
25069
25149
|
})(OpeningMedia || (OpeningMedia = {}));
|
|
25070
25150
|
var OpeningWords;
|
|
25071
25151
|
(function (OpeningWords) {
|
|
@@ -25110,6 +25190,12 @@ var OpeningRole;
|
|
|
25110
25190
|
OpeningRole["Title"] = "opening.title";
|
|
25111
25191
|
OpeningRole["Lead"] = "opening.lead";
|
|
25112
25192
|
OpeningRole["Action"] = "opening.action";
|
|
25193
|
+
/** #129, a type-led first screen only: the line above the title, the hero's headline beside a display-size name, the
|
|
25194
|
+
* second action and the row that holds the actions — every part the hero it replaces says, so no word is lost. */
|
|
25195
|
+
OpeningRole["Eyebrow"] = "opening.eyebrow";
|
|
25196
|
+
OpeningRole["Line"] = "opening.line";
|
|
25197
|
+
OpeningRole["SecondAction"] = "opening.action-2";
|
|
25198
|
+
OpeningRole["Actions"] = "opening.actions";
|
|
25113
25199
|
OpeningRole["Apart"] = "opening.apart";
|
|
25114
25200
|
/** The second and third of the words placed apart. */
|
|
25115
25201
|
OpeningRole["ApartWord"] = "opening.apart-word";
|
|
@@ -25323,6 +25409,22 @@ function openingTokenOf(mix) {
|
|
|
25323
25409
|
function openingWireWords(tier = GenerationTier.Basic) {
|
|
25324
25410
|
return ORDER.flatMap(k => openingWords$1(k).filter(w => openingWordDrawn(k, w) && openingWordOffered(k, w, tier)).map(w => `${k}:${w}`));
|
|
25325
25411
|
}
|
|
25412
|
+
/** #129: a word the harness alone chooses (`media:none` — no picture fills the first screen), never offered to a model. */
|
|
25413
|
+
function openingHarnessWord(ingredient, word) {
|
|
25414
|
+
return (O.harness ?? []).includes(`${ingredient}.${word}`);
|
|
25415
|
+
}
|
|
25416
|
+
/** #129: the ways a type-led first screen may open, best first, each a whole mix on no picture (the contract's
|
|
25417
|
+
* `opening.typeLed`). */
|
|
25418
|
+
function typeLedOpeningWays() {
|
|
25419
|
+
return (O.typeLed ?? []).map(w => openingMix({ frame: w.frame, words: w.words, media: OpeningMedia.None }));
|
|
25420
|
+
}
|
|
25421
|
+
/** 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
|
|
25422
|
+
* the contract's type-led ways — with no picture they are all the screen has. */
|
|
25423
|
+
function typeLedWayEveryTier(mix) {
|
|
25424
|
+
return !!O.typeLedEveryTier && mix.media === OpeningMedia.None && (O.typeLed ?? []).some(w => w.frame === mix.frame && w.words === mix.words);
|
|
25425
|
+
}
|
|
25426
|
+
/** #129: is the mix a type-led first screen (nothing to show but its words)? */
|
|
25427
|
+
const openingIsTypeLed = (mix) => mix.media === OpeningMedia.None;
|
|
25326
25428
|
// ── The check: a mix judged against the site, mended where the site cannot carry it, each mend said ──────────────────
|
|
25327
25429
|
var OpeningRepairCode;
|
|
25328
25430
|
(function (OpeningRepairCode) {
|
|
@@ -25383,7 +25485,10 @@ function checkOpening(mix, ctx) {
|
|
|
25383
25485
|
const repairs = [];
|
|
25384
25486
|
const say = (code, said) => repairs.push({ code, said });
|
|
25385
25487
|
if (ctx.tier && ctx.tier !== GenerationTier.Award) {
|
|
25488
|
+
const everyTier = typeLedWayEveryTier(m);
|
|
25386
25489
|
for (const k of ORDER) {
|
|
25490
|
+
if (everyTier && (k === OpeningIngredient.Frame || k === OpeningIngredient.Words))
|
|
25491
|
+
continue;
|
|
25387
25492
|
if (isMany(k)) {
|
|
25388
25493
|
const kept = m[k].filter(w => openingWordTier(k, w) === 'all');
|
|
25389
25494
|
for (const w of m[k].filter(x => !kept.includes(x)))
|
|
@@ -25434,7 +25539,8 @@ function checkOpening(mix, ctx) {
|
|
|
25434
25539
|
const still = m.media === OpeningMedia.Photo || m.media === OpeningMedia.Diptych || m.media === OpeningMedia.Live;
|
|
25435
25540
|
if (m.motion.includes(OpeningMotion.SlowZoom) && !still) {
|
|
25436
25541
|
m.motion = m.motion.filter(w => w !== OpeningMotion.SlowZoom);
|
|
25437
|
-
say(OpeningRepairCode.ZoomOnAPicture, 'a slow zoom moves a
|
|
25542
|
+
say(OpeningRepairCode.ZoomOnAPicture, m.media === OpeningMedia.None ? 'a slow zoom moves a picture, and this first screen has none: left out'
|
|
25543
|
+
: 'a slow zoom moves a still picture: left out on moving pictures');
|
|
25438
25544
|
}
|
|
25439
25545
|
return { mix: m, repairs };
|
|
25440
25546
|
}
|
|
@@ -25445,6 +25551,11 @@ function checkOpening(mix, ctx) {
|
|
|
25445
25551
|
// so a Hebrew site mirrors them.
|
|
25446
25552
|
/** How tall the first screen stands: a little less than the window, so the next section's edge says "there is more". */
|
|
25447
25553
|
const OPENING_HEIGHT = '88svh';
|
|
25554
|
+
/** #129: a type-led first screen holds only words, so it is as tall as they need — a picture's 88svh left a dark field
|
|
25555
|
+
* above them (the proof's shots: law, ceramics, the salon's phone). Words apart keep the full height: they spread over it.
|
|
25556
|
+
* On a phone the frame hugs its words; the name on the edge then follows them in flow. */
|
|
25557
|
+
const TYPE_LED_HEIGHT = 'min(64svh, 600px)';
|
|
25558
|
+
const typeLedHeights = (mix) => mix.words === OpeningWords.Apart ? { laptop: OPENING_HEIGHT } : { laptop: TYPE_LED_HEIGHT, phone: '0px' };
|
|
25448
25559
|
const INSET_LAPTOP = '24px';
|
|
25449
25560
|
const ABS_FILL = { position: 'absolute', top: '0px', left: '0px', width: '100%', height: '100%', zIndex: '0' };
|
|
25450
25561
|
const MEDIA_FILL = { ...ABS_FILL, aspectRatio: 'auto', borderRadius: '0px', objectFit: 'cover' };
|
|
@@ -25459,18 +25570,27 @@ function openingPhoneInset() {
|
|
|
25459
25570
|
}
|
|
25460
25571
|
const insetClip = (inset) => `inset(${inset} round var(--iox-card-radius))`;
|
|
25461
25572
|
/** A display size that keeps `em` of text within the width (`side` px kept per side), never above `cap`. */
|
|
25573
|
+
/** The frame's padding on a phone: an inset frame adds its inset. */
|
|
25574
|
+
const phoneFramePad = (mix) => (mix.frame === OpeningFrame.Inset || mix.frame === OpeningFrame.Shrinks ? `calc(${openingPhoneInset()} + 20px)` : FRAME_PAD);
|
|
25462
25575
|
const sizedPx = (em, side, cap) => `min(calc((100vw - ${2 * side}px) * ${FIT} / ${Math.max(em, 1).toFixed(3)}), ${cap})`;
|
|
25463
25576
|
function frameNode(mix, children) {
|
|
25464
25577
|
const inset = mix.frame === OpeningFrame.Inset || mix.frame === OpeningFrame.Shrinks;
|
|
25578
|
+
const height = mix.media === OpeningMedia.None ? typeLedHeights(mix) : { laptop: OPENING_HEIGHT };
|
|
25579
|
+
const phone = {
|
|
25580
|
+
...(inset ? { clipPath: insetClip(openingPhoneInset()), padding: phoneFramePad(mix) } : {}),
|
|
25581
|
+
...(height.phone ? { minHeight: height.phone } : {}),
|
|
25582
|
+
};
|
|
25465
25583
|
return {
|
|
25466
|
-
|
|
25584
|
+
// A pictured frame is a box its picture fills; a type-led one (no picture) paints its scheme's own ground — a
|
|
25585
|
+
// box paints nothing, and the scheme's light words stood on the page's light ground (the #129 proof's shots).
|
|
25586
|
+
t: 'Container', es: mix.media === OpeningMedia.None ? 'section' : 'box', scheme: 'inverse',
|
|
25467
25587
|
role: mix.frame === OpeningFrame.Shrinks ? OpeningRole.FrameSettles : OpeningRole.Frame,
|
|
25468
25588
|
lay: {
|
|
25469
25589
|
position: 'relative', overflow: 'hidden', display: 'flex', flexDirection: 'column', justifyContent: 'flex-end', gap: 'var(--iox-space-gap)',
|
|
25470
|
-
minHeight:
|
|
25590
|
+
minHeight: height.laptop, padding: inset ? `calc(${INSET_LAPTOP} + ${FRAME_PAD})` : FRAME_PAD, borderRadius: '0px',
|
|
25471
25591
|
...(inset ? { clipPath: insetClip(INSET_LAPTOP) } : {}),
|
|
25472
25592
|
},
|
|
25473
|
-
...(
|
|
25593
|
+
...(Object.keys(phone).length ? { resp: { mobile: phone } } : {}),
|
|
25474
25594
|
c: children,
|
|
25475
25595
|
};
|
|
25476
25596
|
}
|
|
@@ -25495,6 +25615,8 @@ function mediaNodes(mix) {
|
|
|
25495
25615
|
{ ...picture(OpeningRole.Second, CELL_PICTURE), resp: { mobile: { display: 'none' } } },
|
|
25496
25616
|
],
|
|
25497
25617
|
}];
|
|
25618
|
+
case OpeningMedia.None:
|
|
25619
|
+
return [];
|
|
25498
25620
|
default:
|
|
25499
25621
|
return [picture(zooms ? OpeningRole.MediaZooms : OpeningRole.Media)];
|
|
25500
25622
|
}
|
|
@@ -25515,9 +25637,109 @@ const aside = (at = 'top') => ({
|
|
|
25515
25637
|
lay: { ...OVER(1), display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: '14px', maxWidth: '420px', margin: at === 'top' ? '0px 0px auto 0px' : 'auto 0px 0px 0px' },
|
|
25516
25638
|
c: [lead(), action()],
|
|
25517
25639
|
});
|
|
25640
|
+
// ── #129: a type-led first screen — no picture, the words carry it. It holds every part a hero says (the line above,
|
|
25641
|
+
// the headline, the lead, two actions), each optional but the title, so the hero it replaces gives it its words slot by
|
|
25642
|
+
// slot (`TYPE_LED_OPENING_SLOTS`) and nothing it said is lost; a part the hero did not say is left out (`without`).
|
|
25643
|
+
/** The type-led parts a page may leave out, and what a composition with no hero to carry leaves out (the builder). */
|
|
25644
|
+
const TYPE_LED_OPTIONAL_PARTS = ['eyebrow', 'line', 'cta2'];
|
|
25645
|
+
const eyebrowPart = (lay = {}) => ({
|
|
25646
|
+
t: 'Text', es: 'eyebrow', slot: 'eyebrow', optional: 'eyebrow', max: 32, ph: PatternPlaceholder.Copy, text: 'What you do · where', textHe: 'מה אתם עושים · איפה',
|
|
25647
|
+
role: OpeningRole.Eyebrow, lay,
|
|
25648
|
+
});
|
|
25649
|
+
/** The hero's headline beside a display-size name (an h2: the name is the page's h1). */
|
|
25650
|
+
const linePart = (lay = {}) => ({
|
|
25651
|
+
t: 'Heading', es: 'h2', level: 'h2', slot: 'line', optional: 'line', max: 56, ph: PatternPlaceholder.Copy, text: 'What you do, in a few words',
|
|
25652
|
+
textHe: 'מה אתם עושים, בכמה מילים', role: OpeningRole.Line, lay: { margin: '0px', ...lay },
|
|
25653
|
+
});
|
|
25654
|
+
const actionsPart = (centred = false) => ({
|
|
25655
|
+
t: 'Container', es: 'box', role: OpeningRole.Actions,
|
|
25656
|
+
lay: { display: 'flex', flexWrap: 'wrap', gap: '12px', alignItems: 'center', ...(centred ? { justifyContent: 'center' } : {}) },
|
|
25657
|
+
c: [action(), { t: 'ButtonBlock', es: 'button-secondary', href: '/contact', slot: 'cta2', optional: 'cta2', max: 24, text: 'Learn more', textHe: 'למידע נוסף', role: OpeningRole.SecondAction }],
|
|
25658
|
+
});
|
|
25659
|
+
/** A hero's lead, as long as the hero's own (hero.centered: 180). */
|
|
25660
|
+
const TYPE_LED_LEAD_MAX = 180;
|
|
25661
|
+
const typeLedLead = (lay = {}) => ({ ...lead(lay), max: TYPE_LED_LEAD_MAX });
|
|
25662
|
+
/** What sits beside a display-size name: the line above, the headline, the lead and the actions. */
|
|
25663
|
+
const typeLedAside = (at) => ({
|
|
25664
|
+
t: 'Container', es: 'box', role: OpeningRole.Aside,
|
|
25665
|
+
lay: { ...OVER(1), display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: '14px', maxWidth: '560px', margin: at === 'top' ? '0px 0px auto 0px' : 'auto 0px 0px 0px' },
|
|
25666
|
+
c: [eyebrowPart(), linePart(), typeLedLead(), actionsPart()],
|
|
25667
|
+
});
|
|
25668
|
+
/** Where each slot of a type-led hero goes in a type-led first screen; `headline` is the title, or the line beside a
|
|
25669
|
+
* display-size name (the name is then the title). Only patterns every one of whose slots has a place. */
|
|
25670
|
+
const TYPE_LED_OPENING_FROM = {
|
|
25671
|
+
'hero.centered': { eyebrow: 'eyebrow', headline: 'headline', lead: 'lead', primary: 'cta', secondary: 'cta2' },
|
|
25672
|
+
};
|
|
25673
|
+
const DISPLAY_WORDS = new Set([OpeningWords.OnEdge, OpeningWords.Wordmark, OpeningWords.Behind, OpeningWords.Apart]);
|
|
25674
|
+
/** What a type-led first screen is composed from, given the hero section it takes the place of: the hero's words and
|
|
25675
|
+
* links slot by slot, and every optional part the hero did not say left out — or null when the hero is not one whose
|
|
25676
|
+
* every slot has a place (it is then carried part by part, as any opening). Pure. */
|
|
25677
|
+
function typeLedOpeningSection(mix, hero) {
|
|
25678
|
+
const from = TYPE_LED_OPENING_FROM[hero.pattern];
|
|
25679
|
+
if (!from || mix.media !== OpeningMedia.None)
|
|
25680
|
+
return null;
|
|
25681
|
+
const display = DISPLAY_WORDS.has(mix.words);
|
|
25682
|
+
const to = (slot) => (from[slot] === 'headline' ? (display ? 'line' : 'title') : from[slot]);
|
|
25683
|
+
const slots = {};
|
|
25684
|
+
const links = {};
|
|
25685
|
+
for (const [slot, value] of Object.entries(hero.slots ?? {})) {
|
|
25686
|
+
const at = to(slot);
|
|
25687
|
+
if (!at)
|
|
25688
|
+
return null;
|
|
25689
|
+
if (value.trim())
|
|
25690
|
+
slots[at] = value;
|
|
25691
|
+
}
|
|
25692
|
+
for (const [slot, route] of Object.entries(hero.links ?? {})) {
|
|
25693
|
+
const at = to(slot);
|
|
25694
|
+
if (at)
|
|
25695
|
+
links[at] = route;
|
|
25696
|
+
}
|
|
25697
|
+
return { slots, links, without: TYPE_LED_OPTIONAL_PARTS.filter(part => !slots[part]) };
|
|
25698
|
+
}
|
|
25699
|
+
/** The words of a type-led first screen, as the mix places them — the same measured display sizes as a pictured one
|
|
25700
|
+
* (R-H6), no scrim (nothing is under the words). */
|
|
25701
|
+
function typeLedWordsNodes(mix, ctx) {
|
|
25702
|
+
const { line, longest } = nameEm(ctx);
|
|
25703
|
+
const phoneSize = sizedPx(longest, PHONE_SIDE_PX, '22vw');
|
|
25704
|
+
switch (mix.words) {
|
|
25705
|
+
case OpeningWords.OnEdge:
|
|
25706
|
+
// On a phone the frame hugs its words, so the name follows them in flow and sits on the edge by a margin as
|
|
25707
|
+
// deep as the frame's padding (an absolute name would overlap them).
|
|
25708
|
+
return [typeLedAside('top'), {
|
|
25709
|
+
t: 'Container', es: 'box', role: OpeningRole.Words,
|
|
25710
|
+
lay: { position: 'absolute', left: '0px', bottom: '0px', width: '100%', zIndex: '1', padding: `0px ${LAPTOP_SIDE_PX}px`, overflow: 'visible' },
|
|
25711
|
+
resp: { mobile: { position: 'relative', left: 'auto', bottom: 'auto', padding: '0px', margin: `auto 0px calc(-1 * ${phoneFramePad(mix)}) 0px` } },
|
|
25712
|
+
c: [title({ fontSize: sizedPx(line, LAPTOP_SIDE_PX, '50svh'), lineHeight: '0.82', margin: '0px', translateY: '0.16em' }, { resp: { mobile: { fontSize: phoneSize } } })],
|
|
25713
|
+
}];
|
|
25714
|
+
case OpeningWords.Wordmark:
|
|
25715
|
+
case OpeningWords.Behind:
|
|
25716
|
+
return [{
|
|
25717
|
+
t: 'Container', es: 'box', role: OpeningRole.Words,
|
|
25718
|
+
lay: { ...OVER(1), display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '18px', textAlign: 'center', margin: 'auto 0px auto 0px', width: '100%' },
|
|
25719
|
+
c: [
|
|
25720
|
+
eyebrowPart({ textAlign: 'center' }),
|
|
25721
|
+
title({ fontSize: sizedPx(line, LAPTOP_SIDE_PX + 24, '40svh'), lineHeight: '0.9', margin: '0px', textAlign: 'center' }, { resp: { mobile: { fontSize: phoneSize } } }),
|
|
25722
|
+
linePart({ textAlign: 'center' }), typeLedLead({ textAlign: 'center' }), actionsPart(true),
|
|
25723
|
+
],
|
|
25724
|
+
}];
|
|
25725
|
+
case OpeningWords.Apart: {
|
|
25726
|
+
const [apart] = wordsNodes({ ...mix, media: OpeningMedia.Photo }, ctx).filter(n => n.role === OpeningRole.Apart);
|
|
25727
|
+
return [apart, typeLedAside('bottom')];
|
|
25728
|
+
}
|
|
25729
|
+
default:
|
|
25730
|
+
return [{
|
|
25731
|
+
t: 'Container', es: 'box', role: OpeningRole.Words,
|
|
25732
|
+
lay: { ...OVER(1), display: 'flex', flexDirection: 'column', gap: '14px', maxWidth: '760px' },
|
|
25733
|
+
enter: 'heroText',
|
|
25734
|
+
c: [eyebrowPart(), title({}), typeLedLead(), actionsPart()],
|
|
25735
|
+
}];
|
|
25736
|
+
}
|
|
25737
|
+
}
|
|
25518
25738
|
/** The words, as the mix places them. Display sizes are measured on the look's own face (never a guess — R-H6): a laptop
|
|
25519
25739
|
* line by the whole name, a phone by its longest word, so a word is never cut by the screen. */
|
|
25520
25740
|
function wordsNodes(mix, ctx) {
|
|
25741
|
+
if (mix.media === OpeningMedia.None)
|
|
25742
|
+
return typeLedWordsNodes(mix, ctx);
|
|
25521
25743
|
const { line, longest } = nameEm(ctx);
|
|
25522
25744
|
const phoneSize = sizedPx(longest, PHONE_SIDE_PX, '22vw');
|
|
25523
25745
|
switch (mix.words) {
|
|
@@ -26854,136 +27076,929 @@ function legalFormLine(lang, withTerms) {
|
|
|
26854
27076
|
}
|
|
26855
27077
|
|
|
26856
27078
|
/**
|
|
26857
|
-
* THE
|
|
26858
|
-
*
|
|
26859
|
-
*
|
|
26860
|
-
*
|
|
26861
|
-
*
|
|
26862
|
-
* - What is the owner's is told by the composer itself: the frame as the composer would draw it with the mix it wears
|
|
26863
|
-
* now (`baseline`) against the frame on the page (`previous`). A value that differs is the owner's; one that does not
|
|
26864
|
-
* is the composer's and follows the new mix.
|
|
26865
|
-
* - A part is found by its ROLE (`card.title`, `card.eyebrow`…), else by its place in the frame (the composer's ids are
|
|
26866
|
-
* the frame id + a fixed suffix: `-item-image`). An edited part whose role survives in the new card takes the edits
|
|
26867
|
-
* there (kept); one whose role is gone is redrawn — and listed.
|
|
26868
|
-
* - A node the owner added goes into the same parent part in the new card (at the same place among its children);
|
|
26869
|
-
* a part the owner deleted stays deleted. Either is listed as redrawn when its parent part is gone.
|
|
26870
|
-
*
|
|
26871
|
-
* Pure: `composed` is not changed; the result's `children` are the new card with the owner's edits.
|
|
27079
|
+
* THE CROSS-SITE FINGERPRINT (premium components M8 gate 2, M8-G2-D7; the prototype's `fingerprint` + `sameness`,
|
|
27080
|
+
* `code/cl2.mjs`): what makes two composed pages read as the same — how the page opens, the sequence of its sections, the
|
|
27081
|
+
* mechanism of its signature, whether it opens light or dark, and the preset it wears. Structure only: no words, no
|
|
27082
|
+
* business data. Round three found that pages composed alone converge on one skeleton, and that telling the model what
|
|
27083
|
+
* already exists is what broke it. Pure.
|
|
26872
27084
|
*/
|
|
26873
|
-
/**
|
|
26874
|
-
var
|
|
26875
|
-
(function (
|
|
26876
|
-
|
|
26877
|
-
|
|
26878
|
-
|
|
26879
|
-
|
|
26880
|
-
|
|
26881
|
-
|
|
26882
|
-
|
|
26883
|
-
|
|
26884
|
-
|
|
26885
|
-
|
|
26886
|
-
|
|
26887
|
-
|
|
26888
|
-
|
|
26889
|
-
|
|
26890
|
-
|
|
26891
|
-
|
|
26892
|
-
|
|
26893
|
-
|
|
26894
|
-
|
|
26895
|
-
|
|
26896
|
-
|
|
26897
|
-
|
|
26898
|
-
|
|
26899
|
-
|
|
26900
|
-
|
|
26901
|
-
|
|
26902
|
-
|
|
26903
|
-
|
|
26904
|
-
|
|
26905
|
-
|
|
26906
|
-
|
|
26907
|
-
|
|
26908
|
-
|
|
26909
|
-
|
|
26910
|
-
|
|
26911
|
-
}
|
|
26912
|
-
/** What differs on a part between the composer's drawing and the page. */
|
|
26913
|
-
function editsOn(baseline, page) {
|
|
26914
|
-
const edits = [];
|
|
26915
|
-
const fields = new Set([...Object.keys(baseline), ...Object.keys(page)].filter(f => !SKIP_FIELDS.has(f)));
|
|
26916
|
-
for (const field of fields) {
|
|
26917
|
-
const was = baseline[field];
|
|
26918
|
-
const now = page[field];
|
|
26919
|
-
if (same$1(was, now))
|
|
26920
|
-
continue;
|
|
26921
|
-
if (MAP_FIELDS.includes(field) && (was === undefined || isMap(was)) && (now === undefined || isMap(now))) {
|
|
26922
|
-
const a = (was ?? {});
|
|
26923
|
-
const b = (now ?? {});
|
|
26924
|
-
for (const key of new Set([...Object.keys(a), ...Object.keys(b)]))
|
|
26925
|
-
if (!same$1(a[key], b[key]))
|
|
26926
|
-
edits.push({ field, key, value: b[key] });
|
|
26927
|
-
}
|
|
26928
|
-
else {
|
|
26929
|
-
edits.push({ field, value: now });
|
|
26930
|
-
}
|
|
26931
|
-
}
|
|
26932
|
-
return edits;
|
|
26933
|
-
}
|
|
26934
|
-
const isMap = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
|
|
26935
|
-
function applyEdits(node, edits) {
|
|
26936
|
-
const target = node;
|
|
26937
|
-
for (const e of edits) {
|
|
26938
|
-
if (e.key === undefined) {
|
|
26939
|
-
if (e.value === undefined)
|
|
26940
|
-
delete target[e.field];
|
|
26941
|
-
else
|
|
26942
|
-
target[e.field] = structuredClone(e.value);
|
|
26943
|
-
continue;
|
|
26944
|
-
}
|
|
26945
|
-
const map = { ...(target[e.field] ?? {}) };
|
|
26946
|
-
if (e.value === undefined)
|
|
26947
|
-
delete map[e.key];
|
|
26948
|
-
else
|
|
26949
|
-
map[e.key] = structuredClone(e.value);
|
|
26950
|
-
target[e.field] = map;
|
|
27085
|
+
/** How a section reads in the page's sequence (the contract's `sequenceTokens`). */
|
|
27086
|
+
var LayoutSequenceToken;
|
|
27087
|
+
(function (LayoutSequenceToken) {
|
|
27088
|
+
LayoutSequenceToken["Inhale"] = "inhale";
|
|
27089
|
+
LayoutSequenceToken["Sideways"] = "sideways";
|
|
27090
|
+
LayoutSequenceToken["HeldWords"] = "held-words";
|
|
27091
|
+
LayoutSequenceToken["HeldReel"] = "held-reel";
|
|
27092
|
+
LayoutSequenceToken["Held"] = "held";
|
|
27093
|
+
LayoutSequenceToken["PhotoGround"] = "photo-ground";
|
|
27094
|
+
LayoutSequenceToken["Gallery"] = "gallery";
|
|
27095
|
+
LayoutSequenceToken["Split"] = "split";
|
|
27096
|
+
LayoutSequenceToken["Composition"] = "composition";
|
|
27097
|
+
})(LayoutSequenceToken || (LayoutSequenceToken = {}));
|
|
27098
|
+
/** The signature mechanisms (the contract's `signatures`); `held-screen` is the fallback, never the aim. */
|
|
27099
|
+
var LayoutSignatureId;
|
|
27100
|
+
(function (LayoutSignatureId) {
|
|
27101
|
+
LayoutSignatureId["WordsLit"] = "words-lit";
|
|
27102
|
+
LayoutSignatureId["PhotoUnveiled"] = "photo-unveiled";
|
|
27103
|
+
LayoutSignatureId["ZoomThrough"] = "zoom-through";
|
|
27104
|
+
LayoutSignatureId["ScrollReel"] = "scroll-reel";
|
|
27105
|
+
LayoutSignatureId["PicturesStacking"] = "pictures-stacking";
|
|
27106
|
+
LayoutSignatureId["HalvesApart"] = "halves-apart";
|
|
27107
|
+
LayoutSignatureId["SidewaysWalk"] = "sideways-walk";
|
|
27108
|
+
LayoutSignatureId["ObjectTurning"] = "object-turning";
|
|
27109
|
+
LayoutSignatureId["HeldScreen"] = "held-screen";
|
|
27110
|
+
})(LayoutSignatureId || (LayoutSignatureId = {}));
|
|
27111
|
+
const OPENING_SCREEN_WORD = 'screen-word';
|
|
27112
|
+
/** A section's token in the page's sequence. */
|
|
27113
|
+
function sequenceTokenOf(s) {
|
|
27114
|
+
if (s.kind === LayoutSectionKind.Inhale)
|
|
27115
|
+
return LayoutSequenceToken.Inhale;
|
|
27116
|
+
if ((s.track ?? 1) > 1)
|
|
27117
|
+
return LayoutSequenceToken.Sideways;
|
|
27118
|
+
const layers = s.layers ?? [];
|
|
27119
|
+
if (s.pin) {
|
|
27120
|
+
if (layers.some(l => l.kinetic))
|
|
27121
|
+
return LayoutSequenceToken.HeldWords;
|
|
27122
|
+
return layers.some(l => l.gallery?.scroll) ? LayoutSequenceToken.HeldReel : LayoutSequenceToken.Held;
|
|
26951
27123
|
}
|
|
27124
|
+
if (String(s.ground ?? '').startsWith('photo:'))
|
|
27125
|
+
return LayoutSequenceToken.PhotoGround;
|
|
27126
|
+
if (layers.some(l => l.kind === LayoutLayerKind.Gallery))
|
|
27127
|
+
return LayoutSequenceToken.Gallery;
|
|
27128
|
+
return splitSide(s) ? LayoutSequenceToken.Split : LayoutSequenceToken.Composition;
|
|
26952
27129
|
}
|
|
27130
|
+
/** A list section's prefix in the sequence (list-ingredients §7). */
|
|
27131
|
+
const LAYOUT_LIST_TOKEN = 'list';
|
|
26953
27132
|
/**
|
|
26954
|
-
*
|
|
26955
|
-
*
|
|
26956
|
-
*
|
|
27133
|
+
* A list mix as the fingerprint sees it (list-ingredients §7, LI2): `list:<arrange>/<who-how>/<moves>` — how the items
|
|
27134
|
+
* sit, which stands out and how, how the visitor moves through them. What a mouse does and how they arrive are too fine
|
|
27135
|
+
* to count. Two pages with `list:row/middle-raised/arrows` show the same list.
|
|
26957
27136
|
*/
|
|
26958
|
-
function
|
|
26959
|
-
const
|
|
26960
|
-
|
|
26961
|
-
|
|
26962
|
-
|
|
26963
|
-
|
|
26964
|
-
|
|
26965
|
-
|
|
26966
|
-
|
|
26967
|
-
|
|
26968
|
-
const
|
|
26969
|
-
|
|
26970
|
-
|
|
26971
|
-
|
|
26972
|
-
|
|
26973
|
-
|
|
26974
|
-
|
|
26975
|
-
|
|
26976
|
-
|
|
26977
|
-
|
|
26978
|
-
|
|
26979
|
-
|
|
26980
|
-
|
|
26981
|
-
|
|
26982
|
-
|
|
26983
|
-
|
|
26984
|
-
|
|
26985
|
-
|
|
26986
|
-
|
|
27137
|
+
function listTokenOf(mix) {
|
|
27138
|
+
const who = mix.standout && mix.standout.who !== LayoutListWho.None ? `${mix.standout.who}${mix.standout.how ? `-${mix.standout.how}` : ''}` : 'none';
|
|
27139
|
+
const moves = Array.isArray(mix.move) && mix.move.length ? [...new Set(mix.move)].sort().join('+') : 'still';
|
|
27140
|
+
// AW11-D18: a round-two item (a name on its picture, a packshot, a colour block, a numeral) is seen at once too — it
|
|
27141
|
+
// joins the token; a round-one item adds nothing, so every fingerprint stored before AW11 reads as it did.
|
|
27142
|
+
const item = typeof mix.item === 'string' && listWordTier('item', mix.item) === 'pro' ? `/${mix.item}` : '';
|
|
27143
|
+
return `${LAYOUT_LIST_TOKEN}:${mix.arrange}/${who}/${moves}${item}`;
|
|
27144
|
+
}
|
|
27145
|
+
/** A section's token in the sequence: a list section's mix, else its kind (`sequenceTokenOf`). */
|
|
27146
|
+
function sectionTokenOf(s) {
|
|
27147
|
+
const list = s.pin || (s.track ?? 1) > 1 ? undefined : (s.layers ?? []).find(l => l.kind === LayoutLayerKind.Gallery && l.gallery?.list)?.gallery?.list;
|
|
27148
|
+
return list && !String(s.ground ?? '').startsWith('photo:') ? listTokenOf(list) : sequenceTokenOf(s);
|
|
27149
|
+
}
|
|
27150
|
+
/** Every list mix a page shows, in order. */
|
|
27151
|
+
function listTokensOf(page) {
|
|
27152
|
+
return (page.sections ?? []).flatMap(s => (s.layers ?? []).filter(l => l.kind === LayoutLayerKind.Gallery && l.gallery?.list).map(l => listTokenOf(l.gallery.list)));
|
|
27153
|
+
}
|
|
27154
|
+
/** The mechanism of the signature section, by what moves in it (first match wins, as the prototype's). */
|
|
27155
|
+
const SIGNATURE_BY_TRACK = [
|
|
27156
|
+
[LayoutTrackProp.Clip, LayoutSignatureId.PhotoUnveiled],
|
|
27157
|
+
[LayoutTrackProp.Rotate, LayoutSignatureId.ObjectTurning],
|
|
27158
|
+
[LayoutTrackProp.X, LayoutSignatureId.HalvesApart],
|
|
27159
|
+
[LayoutTrackProp.Y, LayoutSignatureId.PicturesStacking],
|
|
27160
|
+
[LayoutTrackProp.Scale, LayoutSignatureId.ZoomThrough],
|
|
27161
|
+
];
|
|
27162
|
+
function signatureOf(s) {
|
|
27163
|
+
if (!s)
|
|
27164
|
+
return LayoutSignatureId.HeldScreen;
|
|
27165
|
+
const layers = s.layers ?? [];
|
|
27166
|
+
if (layers.some(l => l.kinetic))
|
|
27167
|
+
return LayoutSignatureId.WordsLit;
|
|
27168
|
+
if (layers.some(l => l.gallery?.scroll))
|
|
27169
|
+
return LayoutSignatureId.ScrollReel;
|
|
27170
|
+
if ((s.track ?? 1) > 1)
|
|
27171
|
+
return LayoutSignatureId.SidewaysWalk;
|
|
27172
|
+
const props = new Set(layers.flatMap(l => (l.motion ?? []).map(m => m.prop)));
|
|
27173
|
+
return SIGNATURE_BY_TRACK.find(([prop]) => props.has(prop))?.[1] ?? LayoutSignatureId.HeldScreen;
|
|
27174
|
+
}
|
|
27175
|
+
/** A place given to the plan's ready-made section (silent section fallback): its token in the sequence and the opening. */
|
|
27176
|
+
const LAYOUT_READY_MADE_TOKEN = 'ready-made';
|
|
27177
|
+
const READY_MADE_OPENING = `${LAYOUT_READY_MADE_TOKEN}:`;
|
|
27178
|
+
/** A redesign's section place (RD-D20) opens on the owner's part — never a composition of the model's. */
|
|
27179
|
+
const CARRIED_OPENING = `${READY_MADE_OPENING}carried`;
|
|
27180
|
+
function openingOf(s) {
|
|
27181
|
+
if (s?.readyMade)
|
|
27182
|
+
return `${READY_MADE_OPENING}${s.readyMade.pattern}`;
|
|
27183
|
+
if (s?.carry)
|
|
27184
|
+
return CARRIED_OPENING;
|
|
27185
|
+
const layers = s?.layers ?? [];
|
|
27186
|
+
const lead = layers.find(l => l.role === LayoutRole.Lead) ?? layers[0];
|
|
27187
|
+
if (!lead)
|
|
27188
|
+
return 'none';
|
|
27189
|
+
if (lead.size === LayoutSize.Screen)
|
|
27190
|
+
return OPENING_SCREEN_WORD;
|
|
27191
|
+
if (lead.kind === LayoutLayerKind.Photo || lead.kind === LayoutLayerKind.Gallery)
|
|
27192
|
+
return lead.kind;
|
|
27193
|
+
return lead.size ? `${lead.size}-${lead.kind}` : lead.kind;
|
|
27194
|
+
}
|
|
27195
|
+
const SCRUB_TOKEN = 'scrub';
|
|
27196
|
+
/** What of AW10 a page wears (`LayoutFingerprint.scrub`): letters rising, entrances following the scroll, both — or
|
|
27197
|
+
* null for neither. */
|
|
27198
|
+
function scrubTokenOf(page) {
|
|
27199
|
+
const layers = (page.sections ?? []).flatMap(s => s.layers ?? []);
|
|
27200
|
+
const parts = [
|
|
27201
|
+
layers.some(l => l.enter === LayoutEnter.Letters) && LayoutEnter.Letters,
|
|
27202
|
+
layers.some(l => l.scrub) && SCRUB_TOKEN,
|
|
27203
|
+
].filter((x) => !!x);
|
|
27204
|
+
return parts.length ? parts.join('+') : null;
|
|
27205
|
+
}
|
|
27206
|
+
/** A page's fingerprint, worn in `preset` and `mode`, under the site's `header` and `footer` when they are known. A photo ground opens on
|
|
27207
|
+
* the page's own ground colour. */
|
|
27208
|
+
function fingerprintOf(page, preset, mode, header, footer) {
|
|
27209
|
+
const sections = page.sections ?? [];
|
|
27210
|
+
const lists = listTokensOf(page);
|
|
27211
|
+
const scrub = scrubTokenOf(page);
|
|
27212
|
+
const first = sections[0];
|
|
27213
|
+
const ground = String(first?.ground ?? LayoutColour.Ground);
|
|
27214
|
+
const name = Object.values(LayoutColour).includes(ground) ? ground : LayoutColour.Ground;
|
|
27215
|
+
const colour = parseCssColour(layoutPresetColours(preset, mode)?.[name]);
|
|
27216
|
+
const light = colour ? relativeLuminance(colour) > PHOTO_LIGHT_LUMINANCE : mode === 'light';
|
|
27217
|
+
return {
|
|
27218
|
+
opening: openingOf(first),
|
|
27219
|
+
sequence: sections.map(s => (s.readyMade || s.carry ? LAYOUT_READY_MADE_TOKEN : sectionTokenOf(s))),
|
|
27220
|
+
signature: signatureOf(sections.find(s => s.signature)),
|
|
27221
|
+
ground: light ? PhotoTone.Light : PhotoTone.Dark,
|
|
27222
|
+
preset,
|
|
27223
|
+
...(lists.length ? { lists } : {}),
|
|
27224
|
+
...(header ? { header: headerTokenOf(header) } : {}),
|
|
27225
|
+
...(footer ? { footer: footerTokenOf(footer) } : {}),
|
|
27226
|
+
...(scrub ? { scrub } : {}),
|
|
27227
|
+
};
|
|
27228
|
+
}
|
|
27229
|
+
/** A composed page's fingerprint under its site plan's header and footer — the ONE call every reader of a plan makes. */
|
|
27230
|
+
function fingerprintOfPlanPage(page, preset, mode, plan) {
|
|
27231
|
+
return fingerprintOf(page, preset, mode, wornHeaderOfPlan(plan).mix, footerMixOfPlan(plan));
|
|
27232
|
+
}
|
|
27233
|
+
/** The longest common subsequence of two sequences. */
|
|
27234
|
+
function lcs(a, b) {
|
|
27235
|
+
const d = Array.from({ length: a.length + 1 }, () => new Array(b.length + 1).fill(0));
|
|
27236
|
+
for (let i = 1; i <= a.length; i++)
|
|
27237
|
+
for (let j = 1; j <= b.length; j++)
|
|
27238
|
+
d[i][j] = a[i - 1] === b[j - 1] ? d[i - 1][j - 1] + 1 : Math.max(d[i - 1][j], d[i][j - 1]);
|
|
27239
|
+
return d[a.length][b.length];
|
|
27240
|
+
}
|
|
27241
|
+
/** The share of the longer sequence two pages have in common. */
|
|
27242
|
+
function sequenceShare(a, b) {
|
|
27243
|
+
return lcs(a, b) / Math.max(1, a.length, b.length);
|
|
27244
|
+
}
|
|
27245
|
+
/** #129: an opening mix's token (`opening:<frame>/<media>/<words>`, opening-mix `openingTokenOf`) — a type-led first
|
|
27246
|
+
* screen's. Literal here: importing opening-mix from this module reorders the generation-core load (a cycle). */
|
|
27247
|
+
const MIX_OPENING = 'opening:';
|
|
27248
|
+
const openingWords = (opening) => opening.startsWith(MIX_OPENING) ? `an opening of ${opening.slice(MIX_OPENING.length).split('/').join(' · ')}`
|
|
27249
|
+
: opening.startsWith(READY_MADE_OPENING) ? `the ready-made ${opening.slice(READY_MADE_OPENING.length)}` : opening === OPENING_SCREEN_WORD ? 'a screen-size word' : opening === 'photo' || opening === 'gallery' ? `a ${opening}` : `a ${opening.replace('-', ' ')}`;
|
|
27250
|
+
/** A list token in words: `list:row/middle-raised/arrows` → "row · middle raised · arrows". */
|
|
27251
|
+
const listWords = (token) => token.replace(`${LAYOUT_LIST_TOKEN}:`, '').split('/').map(p => p.replace(/[-+]/g, ' ')).join(' · ');
|
|
27252
|
+
const signatureWords = (id) => SPEC_SITE_LAYOUT.signatures.find(s => s.id === id)?.label ?? id;
|
|
27253
|
+
/**
|
|
27254
|
+
* Refuses a page that repeats one already made (M8-G2-D7): most of the same sequence (`SPEC_SITE_LAYOUT.sameness.sequence`,
|
|
27255
|
+
* 6 of 7), or the same opening AND signature; against a page of the same business type, the same opening or the same
|
|
27256
|
+
* signature alone — never a page of THIS site (`sameSite`), which is always the same kind. The sequence is compared with real pages only — this studio's, other studios', this site's — never a
|
|
27257
|
+
* demo's (Doron, 2026-11-09: the proof sites' order is the product's grammar, not someone's site). The look is the
|
|
27258
|
+
* owner's pick and is never a reason.
|
|
27259
|
+
*/
|
|
27260
|
+
function samenessIssues(me, others, businessType) {
|
|
27261
|
+
const issues = [];
|
|
27262
|
+
const add = (path, message) => {
|
|
27263
|
+
issues.push({ code: LayoutIssueCode.Sameness, path, message });
|
|
27264
|
+
};
|
|
27265
|
+
for (const o of others) {
|
|
27266
|
+
const them = o.fingerprint;
|
|
27267
|
+
const sameType = !o.sameSite && !!businessType && o.businessType === businessType;
|
|
27268
|
+
const opening = me.opening === them.opening;
|
|
27269
|
+
const signature = me.signature === them.signature;
|
|
27270
|
+
if (opening && (signature || sameType))
|
|
27271
|
+
add('sections[0]', `"${o.name}" already opens on ${openingWords(them.opening)}${sameType ? ', and it is the same kind of business' : ` with ${signatureWords(them.signature)}`} — open another way`);
|
|
27272
|
+
if (signature && (opening || sameType))
|
|
27273
|
+
add('sections', `"${o.name}"'s signature is already ${signatureWords(them.signature)} — find another mechanism`);
|
|
27274
|
+
// A list mix: refused against the same kind of business (list-ingredients §7); the brief names every other one.
|
|
27275
|
+
if (sameType)
|
|
27276
|
+
for (const token of (me.lists ?? []).filter(t => (them.lists ?? []).includes(t))) {
|
|
27277
|
+
add('sections', `"${o.name}" already shows a list as ${listWords(token)}, and it is the same kind of business — mix this list another way`);
|
|
27278
|
+
}
|
|
27279
|
+
if (!o.demo && sequenceShare(me.sequence, them.sequence) >= SPEC_SITE_LAYOUT.sameness.sequence) {
|
|
27280
|
+
add('sections', `your sequence (${me.sequence.join(' → ')}) repeats "${o.name}"'s (${them.sequence.join(' → ')}) — change the order and the kinds of sections`);
|
|
27281
|
+
}
|
|
27282
|
+
}
|
|
27283
|
+
return issues;
|
|
27284
|
+
}
|
|
27285
|
+
/**
|
|
27286
|
+
* The openings the studio's OTHER sites already wear, as the memory holds them (`LayoutFingerprint.opening`). This site's
|
|
27287
|
+
* own pages (`sameSite`) and the demos are never a reason: every page of a site may open alike, and a demo is not a site.
|
|
27288
|
+
* The ONE reading of the memory for an opening — a fallen page's (`distinctFallbackSections`) and a type-led first
|
|
27289
|
+
* screen's (#129, `typeLedRound`).
|
|
27290
|
+
*/
|
|
27291
|
+
function wornOpenings(others) {
|
|
27292
|
+
return new Set(others.filter(o => !o.sameSite && !o.demo).map(o => o.fingerprint.opening));
|
|
27293
|
+
}
|
|
27294
|
+
/** The three proof sites' fingerprints (premium M8): every new page's opening and signature are compared with them, never
|
|
27295
|
+
* its order of sections (`demo`). layout-fingerprint.spec holds them equal to `fingerprintOf` of the proof layouts. */
|
|
27296
|
+
const PROOF_FINGERPRINTS = [
|
|
27297
|
+
{
|
|
27298
|
+
name: 'bar-daring',
|
|
27299
|
+
demo: true,
|
|
27300
|
+
fingerprint: {
|
|
27301
|
+
opening: OPENING_SCREEN_WORD,
|
|
27302
|
+
sequence: [LayoutSequenceToken.Composition, LayoutSequenceToken.Gallery, LayoutSequenceToken.Inhale, LayoutSequenceToken.HeldWords, LayoutSequenceToken.Sideways, LayoutSequenceToken.Gallery, LayoutSequenceToken.Composition],
|
|
27303
|
+
signature: LayoutSignatureId.WordsLit,
|
|
27304
|
+
ground: PhotoTone.Dark,
|
|
27305
|
+
preset: 'after-dark',
|
|
27306
|
+
},
|
|
27307
|
+
},
|
|
27308
|
+
{
|
|
27309
|
+
name: 'makers-daring',
|
|
27310
|
+
demo: true,
|
|
27311
|
+
fingerprint: {
|
|
27312
|
+
opening: OPENING_SCREEN_WORD,
|
|
27313
|
+
sequence: [LayoutSequenceToken.Composition, LayoutSequenceToken.Sideways, LayoutSequenceToken.Gallery, LayoutSequenceToken.Gallery, LayoutSequenceToken.Inhale, LayoutSequenceToken.HeldWords, LayoutSequenceToken.PhotoGround],
|
|
27314
|
+
signature: LayoutSignatureId.WordsLit,
|
|
27315
|
+
ground: PhotoTone.Light,
|
|
27316
|
+
preset: 'warm-editorial',
|
|
27317
|
+
},
|
|
27318
|
+
},
|
|
27319
|
+
{
|
|
27320
|
+
name: 'cafe-he-daring',
|
|
27321
|
+
demo: true,
|
|
27322
|
+
fingerprint: {
|
|
27323
|
+
opening: 'xxl-heading',
|
|
27324
|
+
sequence: [LayoutSequenceToken.Composition, LayoutSequenceToken.Composition, LayoutSequenceToken.Inhale, LayoutSequenceToken.Held, LayoutSequenceToken.HeldReel, LayoutSequenceToken.Gallery, LayoutSequenceToken.Composition],
|
|
27325
|
+
signature: LayoutSignatureId.PhotoUnveiled,
|
|
27326
|
+
ground: PhotoTone.Light,
|
|
27327
|
+
preset: 'warm-editorial',
|
|
27328
|
+
},
|
|
27329
|
+
},
|
|
27330
|
+
];
|
|
27331
|
+
|
|
27332
|
+
/**
|
|
27333
|
+
* The words that carry no subject in the languages a site is written in (English, Hebrew): "the", "with", "our", "כמו",
|
|
27334
|
+
* "שלנו"… Shared by every comparison of meaning by words — a stock photo against a slot (`stockWords`), a model's section
|
|
27335
|
+
* against a ready-made one (silent section fallback). Lower case; only words of three letters or more (shorter ones never
|
|
27336
|
+
* count anywhere).
|
|
27337
|
+
*/
|
|
27338
|
+
const FUNCTION_WORDS = new Set([
|
|
27339
|
+
'the', 'and', 'with', 'for', 'your', 'our', 'you', 'from', 'into', 'this', 'that', 'here', 'there', 'about', 'how', 'what',
|
|
27340
|
+
'who', 'are', 'all', 'but', 'not', 'was', 'were', 'has', 'have', 'had', 'its', 'they', 'them', 'their', 'then', 'than',
|
|
27341
|
+
'when', 'where', 'which', 'will', 'can', 'just', 'out', 'over', 'under', 'onto', 'each', 'every', 'some', 'any', 'one', 'also',
|
|
27342
|
+
'too', 'very', 'more', 'most', 'less', 'only', 'own', 'yours', 'ours', 'these', 'those',
|
|
27343
|
+
'אנחנו', 'אני', 'הוא', 'היא', 'אתם', 'אתן', 'שלנו', 'שלכם', 'שלך', 'שלו', 'שלה', 'אצלנו', 'כמו', 'אבל', 'זאת', 'כאן', 'יותר',
|
|
27344
|
+
'מאוד', 'כבר', 'עוד', 'אחרי', 'לפני', 'בין', 'כדי', 'איך',
|
|
27345
|
+
]);
|
|
27346
|
+
|
|
27347
|
+
/**
|
|
27348
|
+
* SILENT SECTION FALLBACK (Doron, 2026-11-09: "for now we need to do silent section fallback and not fallback whole page").
|
|
27349
|
+
* A composed page that still fails after the mends and its one repair — or after the browser's check — no longer falls
|
|
27350
|
+
* back whole: each section an issue names is given to the plan's READY-MADE section for the same place (the pattern the
|
|
27351
|
+
* whole-page fallback would have stamped there, worn in the same look), or dropped where none fits and the page keeps its
|
|
27352
|
+
* opening and its close. Then the page is judged again, once, exactly like any composed page — its MINIMUMS on the model's
|
|
27353
|
+
* own remaining sections (the given-away ones ride on `page.givenAway`; iox-ui#67, Doron 2026-11-09), its maximums on the
|
|
27354
|
+
* whole page. A ready-made section that would say again what a section the model kept already says (its title, its text —
|
|
27355
|
+
* iox-ui#68) is never given a place: a page that repeats a paragraph is worse than the last resort. Only a page that still
|
|
27356
|
+
* fails — an issue that names no section, a place with nothing to give it, a swap that
|
|
27357
|
+
* breaks a section kept or a maximum of the page — falls back whole: the last resort, counted. A swap never leads to another swap. The owner sees a composed page; the swaps are recorded for us, the model's sections kept.
|
|
27358
|
+
* Pure: the service and `ai:replay` run this one function.
|
|
27359
|
+
*/
|
|
27360
|
+
/** What became of one place of the model's page. */
|
|
27361
|
+
var SectionSwapAction;
|
|
27362
|
+
(function (SectionSwapAction) {
|
|
27363
|
+
/** The plan's ready-made section stands there. */
|
|
27364
|
+
SectionSwapAction["Replaced"] = "replaced";
|
|
27365
|
+
/** Nothing fitted the place: the page goes on without it. */
|
|
27366
|
+
SectionSwapAction["Dropped"] = "dropped";
|
|
27367
|
+
})(SectionSwapAction || (SectionSwapAction = {}));
|
|
27368
|
+
/** Why a place was given away (and which ready-made section took it). */
|
|
27369
|
+
var SectionSwapRule;
|
|
27370
|
+
(function (SectionSwapRule) {
|
|
27371
|
+
/** The page's first section: always the plan's opening, never dropped. */
|
|
27372
|
+
SectionSwapRule["Opening"] = "opening";
|
|
27373
|
+
/** The page's last section: always the plan's close, never dropped. */
|
|
27374
|
+
SectionSwapRule["Close"] = "close";
|
|
27375
|
+
/** A middle section: the ready-made section that shows the same list, holds the form, or says most of its words. */
|
|
27376
|
+
SectionSwapRule["Fit"] = "fit";
|
|
27377
|
+
/** A middle section no ready-made section fits (or every one that does would repeat a kept section, iox-ui#68): dropped. */
|
|
27378
|
+
SectionSwapRule["NoFit"] = "no-fit";
|
|
27379
|
+
})(SectionSwapRule || (SectionSwapRule = {}));
|
|
27380
|
+
/** Why a page fell back whole after all (the last resort). */
|
|
27381
|
+
var SectionFallbackLastResort;
|
|
27382
|
+
(function (SectionFallbackLastResort) {
|
|
27383
|
+
/** Nothing left names a section (a count, a share, the order of sections), or after the swaps only such an issue is. */
|
|
27384
|
+
SectionFallbackLastResort["PageWide"] = "page-wide";
|
|
27385
|
+
/** The place named is the opening or the close, and the plan has no ready-made section left for it — or only one that
|
|
27386
|
+
* would repeat what a kept section says (iox-ui#68). */
|
|
27387
|
+
SectionFallbackLastResort["NoReadyMade"] = "no-ready-made";
|
|
27388
|
+
/** It names a section already given to a ready-made one. */
|
|
27389
|
+
SectionFallbackLastResort["ReadyMadeNamed"] = "ready-made-named";
|
|
27390
|
+
/** After the swaps, the check names a section the model composed and kept (a neighbour the swap broke). */
|
|
27391
|
+
SectionFallbackLastResort["Neighbour"] = "neighbour";
|
|
27392
|
+
})(SectionFallbackLastResort || (SectionFallbackLastResort = {}));
|
|
27393
|
+
const NAMED = /sections\[(\d+)\]/g;
|
|
27394
|
+
/** The sections an issue names: its path's, and any its words name. */
|
|
27395
|
+
function sectionsNamed(issue) {
|
|
27396
|
+
const at = new Set();
|
|
27397
|
+
for (const text of [issue.path, issue.message])
|
|
27398
|
+
for (const m of String(text ?? '').matchAll(NAMED))
|
|
27399
|
+
at.add(Number(m[1]));
|
|
27400
|
+
return [...at].sort((a, b) => a - b);
|
|
27401
|
+
}
|
|
27402
|
+
const WORD = /[\p{L}\p{N}]{3,}/gu;
|
|
27403
|
+
/** The words that can make a fit: three letters or more, never a function word (iox-ui#68: "the" made one). */
|
|
27404
|
+
const wordsOf$2 = (text) => (String(text ?? '').toLowerCase().match(WORD) ?? []).filter(w => !FUNCTION_WORDS.has(w));
|
|
27405
|
+
const layerTexts = (l) => [l.text ?? '', ...(l.items ?? []), ...(l.gallery?.slides ?? []).map(s => s.caption ?? ''), l.form?.title ?? '', l.form?.intro ?? ''];
|
|
27406
|
+
const layerWords = (l) => layerTexts(l).flatMap(wordsOf$2);
|
|
27407
|
+
/** Every word of a text, in order, as a phrase that can be found inside another (` a small room kept slow `). */
|
|
27408
|
+
const PHRASE_WORD = /[\p{L}\p{N}]+/gu;
|
|
27409
|
+
const phraseOf = (text) => {
|
|
27410
|
+
const words = String(text ?? '').toLowerCase().match(PHRASE_WORD) ?? [];
|
|
27411
|
+
return { phrase: ` ${words.join(' ')} `, words: words.length };
|
|
27412
|
+
};
|
|
27413
|
+
/** The fewest words a text needs to count as said twice — a two-word label ("The room") may well appear twice. */
|
|
27414
|
+
const REPEAT_MIN_WORDS = 3;
|
|
27415
|
+
/** The share of the shorter text's words the longer one holds for the two to be the same sentence said twice: one word
|
|
27416
|
+
* changed is still a repeat (the café's quote, "…וחברים צריכים שולחן" and "…וחברים טובים צריכים שולחן"). */
|
|
27417
|
+
const REPEAT_SHARED = 0.8;
|
|
27418
|
+
/** Whether two texts say the same thing: one inside the other, or the shorter's words (function words aside) nearly all
|
|
27419
|
+
* in the longer. */
|
|
27420
|
+
function sameSaying(a, b) {
|
|
27421
|
+
if (a.phrase.includes(b.phrase) || b.phrase.includes(a.phrase))
|
|
27422
|
+
return true;
|
|
27423
|
+
const [short, long] = [new Set(wordsOf$2(a.text)), new Set(wordsOf$2(b.text))].sort((x, y) => x.size - y.size);
|
|
27424
|
+
if (short.size < REPEAT_MIN_WORDS)
|
|
27425
|
+
return false;
|
|
27426
|
+
return [...short].filter(w => long.has(w)).length / short.size >= REPEAT_SHARED;
|
|
27427
|
+
}
|
|
27428
|
+
/**
|
|
27429
|
+
* Whether the plan section would say again what the sections the model kept already say (iox-ui#68): a title or a text of
|
|
27430
|
+
* its slots found inside a kept layer's words, or a kept layer's words found inside it, or the two the same sentence
|
|
27431
|
+
* with a word changed — each of three words or more.
|
|
27432
|
+
*/
|
|
27433
|
+
function repeatsKept(plan, kept) {
|
|
27434
|
+
const long = (text) => ({ ...phraseOf(text), text });
|
|
27435
|
+
const said = kept.flatMap(s => (s.layers ?? []).flatMap(layerTexts)).map(long).filter(p => p.words >= REPEAT_MIN_WORDS);
|
|
27436
|
+
return Object.values(plan.slots ?? {}).map(long).filter(p => p.words >= REPEAT_MIN_WORDS)
|
|
27437
|
+
.some(slot => said.some(k => sameSaying(slot, k)));
|
|
27438
|
+
}
|
|
27439
|
+
/** How well a ready-made section stands for a model's section: the same list, the form, the words they share. */
|
|
27440
|
+
function fitScore(section, plan) {
|
|
27441
|
+
const layers = section.layers ?? [];
|
|
27442
|
+
let score = 0;
|
|
27443
|
+
if (plan.binding && layers.some(l => l.gallery?.source === plan.binding))
|
|
27444
|
+
score += 10;
|
|
27445
|
+
if ((plan.form || /^(contact|cta)\./.test(plan.pattern)) && layers.some(l => l.kind === 'form'))
|
|
27446
|
+
score += 5;
|
|
27447
|
+
const said = new Set(layers.flatMap(layerWords));
|
|
27448
|
+
score += new Set(Object.values(plan.slots ?? {}).flatMap(wordsOf$2).filter(w => said.has(w))).size;
|
|
27449
|
+
return score;
|
|
27450
|
+
}
|
|
27451
|
+
/** The least a middle section's fit scores to be given a ready-made section (two shared words, a form or a list). */
|
|
27452
|
+
const FIT_MIN = 2;
|
|
27453
|
+
/** A ready-made stub at a place: no layers of its own — the composer stamps the plan section's pattern there. */
|
|
27454
|
+
function readyMadeSection(original, at, plan) {
|
|
27455
|
+
return { id: original.id, kind: 'content', screens: 1, rows: 1, layers: [], phone: [], readyMade: { at, pattern: plan.pattern } };
|
|
27456
|
+
}
|
|
27457
|
+
/**
|
|
27458
|
+
* Give every section the issues name to the plan's ready-made section for its place, or drop it, then judge the page once
|
|
27459
|
+
* more (a page-wide issue beside them may be cured by the swap — the judge says). `plan` is the page's ready-made
|
|
27460
|
+
* sections (`PagePlan.sections`), in order; `issues` what is left after the mends and the one repair.
|
|
27461
|
+
*/
|
|
27462
|
+
function fallBackBySection(page, plan, issues, judge) {
|
|
27463
|
+
const current = structuredClone(page);
|
|
27464
|
+
const swaps = [];
|
|
27465
|
+
const last = (lastResort, left, at = current) => ({ page: at, swaps, left, lastResort });
|
|
27466
|
+
if (!issues.length)
|
|
27467
|
+
return { page: current, swaps, left: [] };
|
|
27468
|
+
const named = new Map();
|
|
27469
|
+
for (const issue of issues)
|
|
27470
|
+
for (const i of sectionsNamed(issue))
|
|
27471
|
+
if (i < current.sections.length)
|
|
27472
|
+
named.set(i, [...(named.get(i) ?? []), issue.message]);
|
|
27473
|
+
if (!named.size)
|
|
27474
|
+
return last(SectionFallbackLastResort.PageWide, [...issues]);
|
|
27475
|
+
if ([...named.keys()].some(i => current.sections[i].readyMade))
|
|
27476
|
+
return last(SectionFallbackLastResort.ReadyMadeNamed, [...issues]);
|
|
27477
|
+
const used = new Set(current.sections.map(s => s.readyMade?.at).filter((n) => n !== undefined));
|
|
27478
|
+
// The sections the model composed and keeps: a ready-made section must not say again what they say.
|
|
27479
|
+
const keptSections = current.sections.filter((s, i) => !s.readyMade && !named.has(i));
|
|
27480
|
+
const lastAt = current.sections.length - 1;
|
|
27481
|
+
const next = [...current.sections];
|
|
27482
|
+
const drop = new Set();
|
|
27483
|
+
for (const [i, why] of [...named.entries()].sort((a, b) => a[0] - b[0])) {
|
|
27484
|
+
const s = current.sections[i];
|
|
27485
|
+
const record = (action, rule, readyMade) => swaps.push({ id: s.id, at: i, action, rule, ...(readyMade ? { readyMade } : {}), why, original: structuredClone(s) });
|
|
27486
|
+
if (i === 0 || i === lastAt) {
|
|
27487
|
+
const at = i === 0 ? 0 : plan.length - 1;
|
|
27488
|
+
if (!plan[at] || used.has(at) || repeatsKept(plan[at], keptSections))
|
|
27489
|
+
return last(SectionFallbackLastResort.NoReadyMade, [...issues]);
|
|
27490
|
+
used.add(at);
|
|
27491
|
+
next[i] = readyMadeSection(s, at, plan[at]);
|
|
27492
|
+
record(SectionSwapAction.Replaced, i === 0 ? SectionSwapRule.Opening : SectionSwapRule.Close, { at, pattern: plan[at].pattern });
|
|
27493
|
+
continue;
|
|
27494
|
+
}
|
|
27495
|
+
const best = plan
|
|
27496
|
+
.map((p, at) => ({ at, score: at > 0 && at < plan.length - 1 && !used.has(at) && !repeatsKept(p, keptSections) ? fitScore(s, p) : -1 }))
|
|
27497
|
+
.filter(c => c.score >= FIT_MIN)
|
|
27498
|
+
.sort((a, b) => b.score - a.score || a.at - b.at)[0];
|
|
27499
|
+
if (best) {
|
|
27500
|
+
used.add(best.at);
|
|
27501
|
+
next[i] = readyMadeSection(s, best.at, plan[best.at]);
|
|
27502
|
+
record(SectionSwapAction.Replaced, SectionSwapRule.Fit, { at: best.at, pattern: plan[best.at].pattern });
|
|
27503
|
+
}
|
|
27504
|
+
else {
|
|
27505
|
+
drop.add(i);
|
|
27506
|
+
record(SectionSwapAction.Dropped, SectionSwapRule.NoFit);
|
|
27507
|
+
}
|
|
27508
|
+
}
|
|
27509
|
+
// What the given-away sections carried toward the page's minimums goes with the page (checkLayout forgives exactly
|
|
27510
|
+
// that, iox-ui#67); its maximums stay the whole page's.
|
|
27511
|
+
const givenAway = [...(current.givenAway ?? []), ...swaps.map(w => ({ at: w.at, section: w.original }))];
|
|
27512
|
+
const judged = judge({ ...current, sections: next.filter((_, i) => !drop.has(i)), givenAway });
|
|
27513
|
+
if (!judged.issues.length)
|
|
27514
|
+
return { page: judged.page, swaps, left: [] };
|
|
27515
|
+
const kept = judged.issues.flatMap(sectionsNamed).filter(i => !judged.page.sections[i]?.readyMade);
|
|
27516
|
+
const reason = kept.length ? SectionFallbackLastResort.Neighbour
|
|
27517
|
+
: judged.issues.some(i => sectionsNamed(i).length) ? SectionFallbackLastResort.ReadyMadeNamed : SectionFallbackLastResort.PageWide;
|
|
27518
|
+
return last(reason, judged.issues, judged.page);
|
|
27519
|
+
}
|
|
27520
|
+
|
|
27521
|
+
/** The type-led patterns a picture-led one becomes, best first: the first whose budgets hold every carried word wins. */
|
|
27522
|
+
const TYPE_LED_SWAPS = {
|
|
27523
|
+
'hero.split': [{ pattern: 'hero.centered', slots: { eyebrow: 'eyebrow', headline: 'headline', lead: 'lead', primary: 'primary', secondary: 'secondary' } }],
|
|
27524
|
+
'hero.stacked-editorial': [{ pattern: 'hero.centered', slots: { eyebrow: 'eyebrow', headline: 'headline', lead: 'lead', primary: 'primary' } }],
|
|
27525
|
+
'hero.full-bleed-media': [{ pattern: 'hero.centered', slots: { title: 'headline', lead: 'lead', cta: 'primary' } }],
|
|
27526
|
+
'hero.scene-depth': [{ pattern: 'hero.centered', slots: { headline: 'headline', lead: 'lead', cta: 'primary' } }],
|
|
27527
|
+
'hero.scene-object': [{ pattern: 'hero.centered', slots: { headline: 'headline', lead: 'lead', cta: 'primary' } }],
|
|
27528
|
+
'about.story': [{ pattern: 'story.long-form', slots: { title: 'title', story: 'body1' } }],
|
|
27529
|
+
'feature.alternating-rows': [{
|
|
27530
|
+
pattern: 'feature.triad',
|
|
27531
|
+
slots: { title: 'title', row1: 'item1', row1Text: 'item1Text', row2: 'item2', row2Text: 'item2Text', row3: 'item3', row3Text: 'item3Text' },
|
|
27532
|
+
}],
|
|
27533
|
+
'story.scene-chapters': [{
|
|
27534
|
+
pattern: 'feature.triad',
|
|
27535
|
+
slots: { eyebrow: 'title', title: 'item1', text: 'item1Text', title2: 'item2', text2: 'item2Text', title3: 'item3', text3: 'item3Text' },
|
|
27536
|
+
}],
|
|
27537
|
+
};
|
|
27538
|
+
/** Picture-led patterns kept as they are with an empty picture: their pictures are the owner's by nature (a row of the
|
|
27539
|
+
* studio's own client logos) — no type-led section says what they say. A spec holds every static-picture pattern to
|
|
27540
|
+
* one of the two lists. */
|
|
27541
|
+
const TYPE_LED_KEPT = new Set(['proof.logo-strip']);
|
|
27542
|
+
var TypeLedChangeKind;
|
|
27543
|
+
(function (TypeLedChangeKind) {
|
|
27544
|
+
/** A pattern section became its type-led pattern. */
|
|
27545
|
+
TypeLedChangeKind["Section"] = "section";
|
|
27546
|
+
/** The home page's first screen had no picture to show: it opens type-led (`media:none`), a way no other site of the
|
|
27547
|
+
* studio opens — or, when its first section cannot give its words slot by slot, on that section (the mix left out). */
|
|
27548
|
+
TypeLedChangeKind["Opening"] = "opening";
|
|
27549
|
+
/** A model-laid section holding an empty photo was given to the plan's ready-made section. */
|
|
27550
|
+
TypeLedChangeKind["LayoutSection"] = "layout-section";
|
|
27551
|
+
/** A model-laid section holding an empty photo that no ready-made section fits keeps its words, its photos left out
|
|
27552
|
+
* (it is never dropped: the owner's or the model's copy is content). */
|
|
27553
|
+
TypeLedChangeKind["LayoutWords"] = "layout-words";
|
|
27554
|
+
/** A model-laid page that could not give its empty photos away section by section is made from its plan sections. */
|
|
27555
|
+
TypeLedChangeKind["Layout"] = "layout";
|
|
27556
|
+
/** A list's items have no picture at all: its cards show no picture part. */
|
|
27557
|
+
TypeLedChangeKind["List"] = "list";
|
|
27558
|
+
})(TypeLedChangeKind || (TypeLedChangeKind = {}));
|
|
27559
|
+
/** A picture placeholder (read at call time: the composer imports this module, so its enum is not ready at load). */
|
|
27560
|
+
const isPictureKind = (kind) => kind === PlaceholderKind.Image || kind === PlaceholderKind.Video;
|
|
27561
|
+
/** A picture slot's key as `pictureSlotKey` makes it (kept here: pictures.ts imports the composer). */
|
|
27562
|
+
const pageSlotKey = (owner, nodeId) => `page:${owner}:${nodeId}`;
|
|
27563
|
+
const itemSlotKey = (type, index, field) => `item:${type}:${index}:${field}`;
|
|
27564
|
+
/** The empty pictures nothing fills: an image placeholder no filled slot names, every video placeholder (a clip is the
|
|
27565
|
+
* studio's own, never stock). Only a page's — a global's are its own concern. */
|
|
27566
|
+
function emptyPictures(composed, filled) {
|
|
27567
|
+
const pages = new Set(composed.pages.map(p => p.key));
|
|
27568
|
+
return composed.placeholders.filter(p => isPictureKind(p.kind) && pages.has(p.owner)
|
|
27569
|
+
&& !(p.kind === PlaceholderKind.Image && filled.has(pageSlotKey(p.owner, p.nodeId))));
|
|
27570
|
+
}
|
|
27571
|
+
/** The content types whose items would show no picture: every item's picture empty and none filled (a type with no items
|
|
27572
|
+
* yet keeps its picture — the owner's first items bring theirs). The shop's products read as their resource's name. */
|
|
27573
|
+
function picturelessTypes(plan, composed, filled) {
|
|
27574
|
+
const out = [];
|
|
27575
|
+
const judge = (type, field, items) => {
|
|
27576
|
+
if (!field || !items.length)
|
|
27577
|
+
return;
|
|
27578
|
+
if (items.every((item, i) => !item[field] && !filled.has(itemSlotKey(type, i, field))))
|
|
27579
|
+
out.push(type);
|
|
27580
|
+
};
|
|
27581
|
+
judge(ShopResource.Products, SHOP_ROLES[ShopResource.Products].image, (composed.shop?.products ?? []));
|
|
27582
|
+
for (const type of plan.contentTypes)
|
|
27583
|
+
judge(type.name, roleField(type, ContentRole.Image), (composed.items[type.name] ?? []));
|
|
27584
|
+
return out;
|
|
27585
|
+
}
|
|
27586
|
+
/** The type-led place for a section, or null: no swap names its pattern, or no target's budgets hold its words. */
|
|
27587
|
+
function typeLedSection(section, density) {
|
|
27588
|
+
for (const target of TYPE_LED_SWAPS[section.pattern] ?? []) {
|
|
27589
|
+
const pattern = patternById(target.pattern);
|
|
27590
|
+
if (!pattern)
|
|
27591
|
+
continue;
|
|
27592
|
+
const declared = new Set(patternSlots(pattern));
|
|
27593
|
+
const slots = {};
|
|
27594
|
+
let fits = true;
|
|
27595
|
+
for (const [slot, value] of Object.entries(section.slots ?? {})) {
|
|
27596
|
+
const to = target.slots[slot];
|
|
27597
|
+
const budget = to ? slotBudget(pattern, to, density) : null;
|
|
27598
|
+
if (!to || !declared.has(to) || (budget !== null && value.length > budget)) {
|
|
27599
|
+
fits = false;
|
|
27600
|
+
break;
|
|
27601
|
+
}
|
|
27602
|
+
slots[to] = value;
|
|
27603
|
+
}
|
|
27604
|
+
if (!fits)
|
|
27605
|
+
continue;
|
|
27606
|
+
const linkSlots = new Set(patternLinkSlots(pattern));
|
|
27607
|
+
const links = Object.fromEntries(Object.entries(section.links ?? {}).map(([slot, route]) => [target.slots[slot], route]).filter(([slot]) => !!slot && linkSlots.has(slot)));
|
|
27608
|
+
const parts = new Set(patternOptionalParts(pattern));
|
|
27609
|
+
const without = (section.without ?? []).filter(w => parts.has(w));
|
|
27610
|
+
const next = {
|
|
27611
|
+
pattern: target.pattern,
|
|
27612
|
+
...(Object.keys(slots).length ? { slots } : {}),
|
|
27613
|
+
...(Object.keys(links).length ? { links } : {}),
|
|
27614
|
+
...(without.length ? { without } : {}),
|
|
27615
|
+
...(section.enter ? { enter: section.enter } : {}),
|
|
27616
|
+
};
|
|
27617
|
+
return { section: next, to: target.pattern };
|
|
27618
|
+
}
|
|
27619
|
+
return null;
|
|
27620
|
+
}
|
|
27621
|
+
function rootsOf(page, layout) {
|
|
27622
|
+
const out = new Map();
|
|
27623
|
+
const sections = page.layout?.sections ?? [];
|
|
27624
|
+
// A model-laid page keeps one root per layout section, in order (an opening it could not replace stands first).
|
|
27625
|
+
const offset = page.layout ? Math.max(0, layout.length - sections.length) : 0;
|
|
27626
|
+
const whereOf = (root, pos) => {
|
|
27627
|
+
const opening = typeof root.props?.[OPENING_MIX_PROP] === 'string';
|
|
27628
|
+
if (!page.layout) {
|
|
27629
|
+
const m = /-(\d+)$/.exec(root.id);
|
|
27630
|
+
return { pos, opening, laid: -1, planAt: m && root.id === `${page.key}-${m[1]}` ? Number(m[1]) : -1 };
|
|
27631
|
+
}
|
|
27632
|
+
// Its stamp names its layout section (M2-1); a ready-made place is stamped with its plan section's pattern.
|
|
27633
|
+
if (root.composed?.layout)
|
|
27634
|
+
return { pos, opening, laid: sections.findIndex(s => s.id === root.composed.layout), planAt: -1 };
|
|
27635
|
+
const readyMade = sections[pos - offset]?.readyMade;
|
|
27636
|
+
return { pos, opening, laid: -1, planAt: readyMade ? readyMade.at : -1 };
|
|
27637
|
+
};
|
|
27638
|
+
layout.forEach((root, pos) => {
|
|
27639
|
+
const where = whereOf(root, pos);
|
|
27640
|
+
walkSerialized([root], n => { out.set(n.id, where); });
|
|
27641
|
+
});
|
|
27642
|
+
return out;
|
|
27643
|
+
}
|
|
27644
|
+
/** The layer a composed layout node belongs to (`<page>-s<section>-l<layer>…`), or null. */
|
|
27645
|
+
function layerOf$1(nodeId) {
|
|
27646
|
+
const m = /-s(\d+)-l(\d+)(?:-|$)/.exec(nodeId);
|
|
27647
|
+
return m ? { section: Number(m[1]), layer: Number(m[2]) } : null;
|
|
27648
|
+
}
|
|
27649
|
+
/** The layers that hold words (what a section must keep when its photos go). */
|
|
27650
|
+
const WORD_LAYERS = new Set([
|
|
27651
|
+
LayoutLayerKind.Word, LayoutLayerKind.Heading, LayoutLayerKind.Text, LayoutLayerKind.Label, LayoutLayerKind.Number,
|
|
27652
|
+
LayoutLayerKind.Button, LayoutLayerKind.List, LayoutLayerKind.Form, LayoutLayerKind.Marquee,
|
|
27653
|
+
]);
|
|
27654
|
+
const GRID_COLUMNS$1 = 12;
|
|
27655
|
+
/** The widest the words of a section whose photos went may grow to (columns): a reading measure, never the full grid. */
|
|
27656
|
+
const WORDS_MEASURE = 10;
|
|
27657
|
+
const BOX_PHOTO = 'photo:box:';
|
|
27658
|
+
const PLAIN_GROUND = 'ground';
|
|
27659
|
+
/**
|
|
27660
|
+
* A model-laid section with its empty photos left out — its words kept where the model put them, given the width the
|
|
27661
|
+
* photos held beside them (centred, at most a reading measure) and the rows they held under them (empty rows close up,
|
|
27662
|
+
* the section's height following unless it is pinned). Null when it says nothing without its photos. Pure.
|
|
27663
|
+
*/
|
|
27664
|
+
function typeLedLayoutSection(section, gone) {
|
|
27665
|
+
const kept = section.layers.map((layer, i) => ({ layer, i })).filter(x => !gone.has(x.i));
|
|
27666
|
+
if (!kept.some(x => WORD_LAYERS.has(x.layer.kind)))
|
|
27667
|
+
return null;
|
|
27668
|
+
const index = new Map(kept.map((x, n) => [x.i, n]));
|
|
27669
|
+
const photos = [...gone].map(i => section.layers[i]).filter(Boolean);
|
|
27670
|
+
const words = kept.filter(x => x.layer.kind !== LayoutLayerKind.Shape).map(x => x.layer);
|
|
27671
|
+
const from = Math.min(...words.map(l => l.col[0]));
|
|
27672
|
+
const to = Math.max(...words.map(l => l.col[1]));
|
|
27673
|
+
const beside = photos.length > 0 && photos.every(p => p.col[0] >= to || p.col[1] <= from);
|
|
27674
|
+
const width = Math.max(1, to - from);
|
|
27675
|
+
const grown = beside ? Math.min(WORDS_MEASURE, GRID_COLUMNS$1, width + Math.max(...photos.map(p => p.col[1] - p.col[0]))) : width;
|
|
27676
|
+
const start = beside ? 1 + Math.floor((GRID_COLUMNS$1 - grown) / 2) : from;
|
|
27677
|
+
const col = (c) => (beside ? start + Math.round(((c - from) * grown) / width) : c);
|
|
27678
|
+
const used = new Set();
|
|
27679
|
+
for (const { layer } of kept)
|
|
27680
|
+
for (let r = layer.row[0]; r < layer.row[1]; r++)
|
|
27681
|
+
used.add(r);
|
|
27682
|
+
const line = (r) => 1 + [...used].filter(u => u < r).length;
|
|
27683
|
+
const rows = used.size;
|
|
27684
|
+
const layers = kept.map(({ layer }) => {
|
|
27685
|
+
const c0 = col(layer.col[0]);
|
|
27686
|
+
return { ...layer, col: [c0, Math.max(c0 + 1, col(layer.col[1]))], row: [line(layer.row[0]), line(layer.row[1])] };
|
|
27687
|
+
});
|
|
27688
|
+
const screens = section.pin ? section.screens : Math.max(1, Math.round((section.screens * rows) / Math.max(1, section.rows)));
|
|
27689
|
+
const ground = section.ground?.startsWith(BOX_PHOTO) ? PLAIN_GROUND : section.ground;
|
|
27690
|
+
const { phone, ...rest } = section;
|
|
27691
|
+
const order = phone?.filter(i => index.has(i)).map(i => index.get(i));
|
|
27692
|
+
return { ...rest, ...(ground !== undefined ? { ground } : {}), screens, rows, layers, ...(order?.length ? { phone: order } : {}) };
|
|
27693
|
+
}
|
|
27694
|
+
const SAID_LAYOUT = 'holds a photo nothing fills';
|
|
27695
|
+
/** A model-laid page that would lose more than a third of its sections to empty photos is made from its plan sections
|
|
27696
|
+
* instead: a page of three survivors is thinner than the plan's own page (its type-led sections). Only a section that
|
|
27697
|
+
* says nothing without its photos is lost now. */
|
|
27698
|
+
const THIN_SHARE = 3;
|
|
27699
|
+
const keepAsLaid = (page) => ({ page, issues: [] });
|
|
27700
|
+
/** The tier a build is at when none is said (GenerationTier.Basic — a value import of site-plan.model here reorders the
|
|
27701
|
+
* generation-core load). */
|
|
27702
|
+
const BASIC = 'basic';
|
|
27703
|
+
const isHome = (page) => page.isHome === true || page.route === '/';
|
|
27704
|
+
/**
|
|
27705
|
+
* The type-led first screen for a home page: the plan's own frame and words first, then the contract's ways
|
|
27706
|
+
* (`typeLedOpeningWays`), the first the site carries unmended (its tier, the business name's fit) that no OTHER site of
|
|
27707
|
+
* the studio opens on — else the first it carries, said as worn. Pure.
|
|
27708
|
+
*/
|
|
27709
|
+
function chooseTypeLedOpening(plan, context = {}) {
|
|
27710
|
+
const own = openingMixOfPlan(plan);
|
|
27711
|
+
// The plan's own frame and words, on no picture (a slow zoom has nothing to move: it goes with the picture).
|
|
27712
|
+
const mine = own ? [{ ...own, media: OpeningMedia.None, extras: [...own.extras], motion: own.motion.filter(m => m !== OpeningMotion.SlowZoom) }] : [];
|
|
27713
|
+
const ways = [...mine, ...typeLedOpeningWays()];
|
|
27714
|
+
const site = openingContextOf({ business: plan.business, design: plan.design, tier: context.tier ?? BASIC, badge: null, cutOut: false });
|
|
27715
|
+
const carried = ways.map(m => drawnOpeningMix(m).drawn).filter(m => !checkOpening(m, site).repairs.length);
|
|
27716
|
+
const worn = wornOpenings(context.studio ?? []);
|
|
27717
|
+
const free = carried.find(m => !worn.has(openingTokenOf(m)));
|
|
27718
|
+
// The contract's last way is every tier's and fits any name (a heading): there is always one.
|
|
27719
|
+
const mix = free ?? carried[0] ?? checkOpening(ways[ways.length - 1], site).mix;
|
|
27720
|
+
return { mix, token: openingTokenOf(mix), worn: !free };
|
|
27721
|
+
}
|
|
27722
|
+
/**
|
|
27723
|
+
* One round: the plan a composition should have been composed from, given what fills its pictures — or no changes. The
|
|
27724
|
+
* caller composes again and asks once more (an opening left out shows the first section's own picture, judged next).
|
|
27725
|
+
*/
|
|
27726
|
+
function typeLedRound(plan, composed, filled, context = {}) {
|
|
27727
|
+
const changes = [];
|
|
27728
|
+
const empty = emptyPictures(composed, filled);
|
|
27729
|
+
const density = typeof plan.design?.density === 'string' ? plan.design.density : null;
|
|
27730
|
+
let firstScreen = null;
|
|
27731
|
+
let homeAt = -1;
|
|
27732
|
+
const swapSection = (page, sections, i) => {
|
|
27733
|
+
const section = sections[i];
|
|
27734
|
+
if (!section || TYPE_LED_KEPT.has(section.pattern))
|
|
27735
|
+
return false;
|
|
27736
|
+
const led = typeLedSection(section, density);
|
|
27737
|
+
if (!led)
|
|
27738
|
+
return false;
|
|
27739
|
+
sections[i] = led.section;
|
|
27740
|
+
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` });
|
|
27741
|
+
return true;
|
|
27742
|
+
};
|
|
27743
|
+
const pages = plan.pages.map((page, p) => {
|
|
27744
|
+
const made = composed.pages.find(c => c.key === page.key) ?? composed.pages[p];
|
|
27745
|
+
const mine = empty.filter(e => e.owner === page.key);
|
|
27746
|
+
if (!made || !mine.length)
|
|
27747
|
+
return page;
|
|
27748
|
+
const roots = rootsOf(page, made.layout);
|
|
27749
|
+
const laid = new Map();
|
|
27750
|
+
const planAt = new Set();
|
|
27751
|
+
let first = false;
|
|
27752
|
+
for (const e of mine) {
|
|
27753
|
+
const where = roots.get(e.nodeId);
|
|
27754
|
+
if (!where)
|
|
27755
|
+
continue;
|
|
27756
|
+
if (where.pos === 0 && isHome(page))
|
|
27757
|
+
first = true;
|
|
27758
|
+
if (where.opening)
|
|
27759
|
+
continue;
|
|
27760
|
+
if (where.laid >= 0) {
|
|
27761
|
+
const at = layerOf$1(e.nodeId);
|
|
27762
|
+
const layers = laid.get(where.laid) ?? new Set();
|
|
27763
|
+
if (at && at.section === where.laid)
|
|
27764
|
+
layers.add(at.layer);
|
|
27765
|
+
laid.set(where.laid, layers);
|
|
27766
|
+
}
|
|
27767
|
+
else if (where.planAt >= 0)
|
|
27768
|
+
planAt.add(where.planAt);
|
|
27769
|
+
}
|
|
27770
|
+
let next = page;
|
|
27771
|
+
// A plan section's pattern (a pattern page's, a ready-made place's) whose picture nothing fills: its type-led pattern.
|
|
27772
|
+
let sections = null;
|
|
27773
|
+
for (const i of [...planAt].sort((a, b) => a - b)) {
|
|
27774
|
+
const copy = sections ?? [...page.sections];
|
|
27775
|
+
if (swapSection(page, copy, i))
|
|
27776
|
+
sections = copy;
|
|
27777
|
+
}
|
|
27778
|
+
if (sections)
|
|
27779
|
+
next = { ...next, sections };
|
|
27780
|
+
// A section the model laid with a photo nothing fills: the plan's ready-made section for its place (the ONE
|
|
27781
|
+
// fallback picker); one no ready-made section fits keeps its words with its photos left out (never dropped); the
|
|
27782
|
+
// whole page from its sections when no place can be given away.
|
|
27783
|
+
if (page.layout && laid.size) {
|
|
27784
|
+
const issues = [...laid.keys()].map(i => ({ code: LayoutIssueCode.Content, path: `sections[${i}]`, message: `sections[${i}] ${SAID_LAYOUT}` }));
|
|
27785
|
+
const fallback = fallBackBySection(page.layout, next.sections, issues, keepAsLaid);
|
|
27786
|
+
const words = new Map();
|
|
27787
|
+
for (const w of fallback.swaps) {
|
|
27788
|
+
if (w.action !== SectionSwapAction.Dropped)
|
|
27789
|
+
continue;
|
|
27790
|
+
const kept = typeLedLayoutSection(page.layout.sections[w.at], laid.get(w.at) ?? new Set());
|
|
27791
|
+
if (kept)
|
|
27792
|
+
words.set(w.at, kept);
|
|
27793
|
+
}
|
|
27794
|
+
const dropped = fallback.swaps.filter(w => w.action === SectionSwapAction.Dropped && !words.has(w.at)).length;
|
|
27795
|
+
const thin = dropped * THIN_SHARE > page.layout.sections.length;
|
|
27796
|
+
if (fallback.lastResort || thin) {
|
|
27797
|
+
const why = thin ? `${dropped} of its ${page.layout.sections.length} sections would be left out`
|
|
27798
|
+
: fallback.lastResort === SectionFallbackLastResort.NoReadyMade ? 'no ready-made section left for a place' : 'its empty photos could not be given away';
|
|
27799
|
+
changes.push({ kind: TypeLedChangeKind.Layout, page: page.key, said: `${page.name}: made from its sections — ${why}` });
|
|
27800
|
+
const { layout: _laid, ...rest } = next;
|
|
27801
|
+
next = rest;
|
|
27802
|
+
}
|
|
27803
|
+
else {
|
|
27804
|
+
for (const swap of fallback.swaps) {
|
|
27805
|
+
const kept = words.get(swap.at);
|
|
27806
|
+
changes.push({
|
|
27807
|
+
kind: kept ? TypeLedChangeKind.LayoutWords : TypeLedChangeKind.LayoutSection, page: page.key, at: swap.at, ...(swap.readyMade ? { to: swap.readyMade.pattern } : {}),
|
|
27808
|
+
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)'}`,
|
|
27809
|
+
});
|
|
27810
|
+
}
|
|
27811
|
+
// The dropped places that keep their words go back where the model laid them.
|
|
27812
|
+
const swapped = new Set(fallback.swaps.filter(w => w.action === SectionSwapAction.Dropped).map(w => w.at));
|
|
27813
|
+
const left = [...fallback.page.sections];
|
|
27814
|
+
const sectionsBack = [];
|
|
27815
|
+
page.layout.sections.forEach((_, i) => {
|
|
27816
|
+
if (words.has(i))
|
|
27817
|
+
sectionsBack.push(words.get(i));
|
|
27818
|
+
else if (!swapped.has(i))
|
|
27819
|
+
sectionsBack.push(left.shift());
|
|
27820
|
+
});
|
|
27821
|
+
const givenAway = (fallback.page.givenAway ?? []).filter(g => !words.has(g.at));
|
|
27822
|
+
next = { ...next, layout: { ...fallback.page, sections: sectionsBack, ...(givenAway.length ? { givenAway } : {}) } };
|
|
27823
|
+
if (!givenAway.length)
|
|
27824
|
+
delete next.layout.givenAway;
|
|
27825
|
+
}
|
|
27826
|
+
}
|
|
27827
|
+
if (first) {
|
|
27828
|
+
firstScreen = next;
|
|
27829
|
+
homeAt = p;
|
|
27830
|
+
}
|
|
27831
|
+
return next;
|
|
27832
|
+
});
|
|
27833
|
+
let next = changes.length ? { ...plan, pages } : plan;
|
|
27834
|
+
let opening;
|
|
27835
|
+
if (firstScreen) {
|
|
27836
|
+
// The home page's first screen shows no picture: it opens type-led, its hero's words slot by slot — when the hero
|
|
27837
|
+
// that stands first (after this round's swaps) can give them so; else as v1: the page opens on that section.
|
|
27838
|
+
const home = firstScreen;
|
|
27839
|
+
const sections = [...home.sections];
|
|
27840
|
+
const at = home.layout ? home.layout.sections[0]?.readyMade?.at ?? -1 : 0;
|
|
27841
|
+
const chosen = chooseTypeLedOpening(plan, context);
|
|
27842
|
+
const plain = at >= 0 ? sections[at] : undefined;
|
|
27843
|
+
if (plain && !typeLedOpeningSection(chosen.mix, plain))
|
|
27844
|
+
swapSection(home, sections, at);
|
|
27845
|
+
const hero = at >= 0 ? sections[at] : undefined;
|
|
27846
|
+
const takes = !!hero && !!typeLedOpeningSection(chosen.mix, hero);
|
|
27847
|
+
const nextPages = [...pages];
|
|
27848
|
+
nextPages[homeAt] = { ...home, sections };
|
|
27849
|
+
next = { ...next, pages: nextPages };
|
|
27850
|
+
if (takes) {
|
|
27851
|
+
const words = openingMixWords(chosen.mix);
|
|
27852
|
+
next = { ...next, mixes: { ...next.mixes, opening: words } };
|
|
27853
|
+
opening = { words, token: chosen.token, ...(chosen.worn ? { worn: true } : {}) };
|
|
27854
|
+
const was = plan.mixes?.opening?.join(' ');
|
|
27855
|
+
if (was !== words.join(' ')) {
|
|
27856
|
+
changes.push({
|
|
27857
|
+
kind: TypeLedChangeKind.Opening, page: home.key, to: chosen.token,
|
|
27858
|
+
said: `${home.name}: the first screen has no picture — it opens on its words (${words.join(' ')})${chosen.worn ? ', a way another site of the studio already opens' : ''}`,
|
|
27859
|
+
});
|
|
27860
|
+
}
|
|
27861
|
+
}
|
|
27862
|
+
else if (plan.mixes?.opening?.length) {
|
|
27863
|
+
const { opening: _left, ...mixes } = plan.mixes;
|
|
27864
|
+
next = { ...next, mixes };
|
|
27865
|
+
changes.push({ kind: TypeLedChangeKind.Opening, page: home.key, said: `the opening (${plan.mixes.opening.join(' ')}) has no picture — the home page opens on its first section` });
|
|
27866
|
+
}
|
|
27867
|
+
}
|
|
27868
|
+
return { plan: next, changes, pictureless: picturelessTypes(plan, composed, filled), ...(opening ? { opening } : {}) };
|
|
27869
|
+
}
|
|
27870
|
+
|
|
27871
|
+
/**
|
|
27872
|
+
* THE OWNER'S EDITS INSIDE A LIST CARD (vectoriox/iox-ui#122, board bindings-list BL-D8). Recomposing a list (Bindings ▸
|
|
27873
|
+
* List, Ask) draws its card again from the new mix; before #122 the card template was replaced and whatever the owner had
|
|
27874
|
+
* changed inside it was lost silently. `keepListParts` keeps it, part by part — the carry's rule (site-redesign RD1:
|
|
27875
|
+
* the owner's is placed, never retyped, and what finds no place is SAID, never dropped silently):
|
|
27876
|
+
*
|
|
27877
|
+
* - What is the owner's is told by the composer itself: the frame as the composer would draw it with the mix it wears
|
|
27878
|
+
* now (`baseline`) against the frame on the page (`previous`). A value that differs is the owner's; one that does not
|
|
27879
|
+
* is the composer's and follows the new mix.
|
|
27880
|
+
* - A part is found by its ROLE (`card.title`, `card.eyebrow`…), else by its place in the frame (the composer's ids are
|
|
27881
|
+
* the frame id + a fixed suffix: `-item-image`). An edited part whose role survives in the new card takes the edits
|
|
27882
|
+
* there (kept); one whose role is gone is redrawn — and listed.
|
|
27883
|
+
* - A node the owner added goes into the same parent part in the new card (at the same place among its children);
|
|
27884
|
+
* a part the owner deleted stays deleted. Either is listed as redrawn when its parent part is gone.
|
|
27885
|
+
*
|
|
27886
|
+
* Pure: `composed` is not changed; the result's `children` are the new card with the owner's edits.
|
|
27887
|
+
*/
|
|
27888
|
+
/** What became of one part the owner changed. */
|
|
27889
|
+
var ListPartOutcome;
|
|
27890
|
+
(function (ListPartOutcome) {
|
|
27891
|
+
/** The part's role is in the new card: the owner's edits are on it there. */
|
|
27892
|
+
ListPartOutcome["Kept"] = "kept";
|
|
27893
|
+
/** The new card has no such part: the edits are lost — said before Apply (the kept notice, BL-D8). */
|
|
27894
|
+
ListPartOutcome["Redrawn"] = "redrawn";
|
|
27895
|
+
})(ListPartOutcome || (ListPartOutcome = {}));
|
|
27896
|
+
/** How the owner changed a part. */
|
|
27897
|
+
var ListPartChange;
|
|
27898
|
+
(function (ListPartChange) {
|
|
27899
|
+
/** Values on a composed part (a style, its words, an element style, a binding…). */
|
|
27900
|
+
ListPartChange["Edited"] = "edited";
|
|
27901
|
+
/** A node the owner put in the card. */
|
|
27902
|
+
ListPartChange["Added"] = "added";
|
|
27903
|
+
/** A composed part the owner deleted. */
|
|
27904
|
+
ListPartChange["Removed"] = "removed";
|
|
27905
|
+
})(ListPartChange || (ListPartChange = {}));
|
|
27906
|
+
/** Node fields whose values are maps — compared and carried value by value (`styleProps.color`, `props.content`…). */
|
|
27907
|
+
const MAP_FIELDS = ['props', 'styleProps', 'stateStyles', 'responsive', 'stateTriggers'];
|
|
27908
|
+
/** Fields that are the node's identity or its subtree, never an edit. */
|
|
27909
|
+
const SKIP_FIELDS = new Set(['id', 'children']);
|
|
27910
|
+
const same$1 = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
27911
|
+
/** Every node under the frame by its part key (the first of a key wins; a repeat is keyed by its place). */
|
|
27912
|
+
function partsOf$1(frame) {
|
|
27913
|
+
const out = new Map();
|
|
27914
|
+
const prefix = `${frame.id}-`;
|
|
27915
|
+
const keyOf = (n) => n.role ?? (n.id.startsWith(prefix) ? n.id.slice(prefix.length) : `node:${n.id}`);
|
|
27916
|
+
const visit = (n, parent, index) => {
|
|
27917
|
+
let key = keyOf(n);
|
|
27918
|
+
if (out.has(key))
|
|
27919
|
+
key = n.id.startsWith(prefix) ? n.id.slice(prefix.length) : `node:${n.id}`;
|
|
27920
|
+
if (!out.has(key))
|
|
27921
|
+
out.set(key, { node: n, parent, index });
|
|
27922
|
+
(n.children ?? []).forEach((c, i) => visit(c, key, i));
|
|
27923
|
+
};
|
|
27924
|
+
(frame.children ?? []).forEach((c, i) => visit(c, null, i));
|
|
27925
|
+
return out;
|
|
27926
|
+
}
|
|
27927
|
+
/** What differs on a part between the composer's drawing and the page. */
|
|
27928
|
+
function editsOn(baseline, page) {
|
|
27929
|
+
const edits = [];
|
|
27930
|
+
const fields = new Set([...Object.keys(baseline), ...Object.keys(page)].filter(f => !SKIP_FIELDS.has(f)));
|
|
27931
|
+
for (const field of fields) {
|
|
27932
|
+
const was = baseline[field];
|
|
27933
|
+
const now = page[field];
|
|
27934
|
+
if (same$1(was, now))
|
|
27935
|
+
continue;
|
|
27936
|
+
if (MAP_FIELDS.includes(field) && (was === undefined || isMap(was)) && (now === undefined || isMap(now))) {
|
|
27937
|
+
const a = (was ?? {});
|
|
27938
|
+
const b = (now ?? {});
|
|
27939
|
+
for (const key of new Set([...Object.keys(a), ...Object.keys(b)]))
|
|
27940
|
+
if (!same$1(a[key], b[key]))
|
|
27941
|
+
edits.push({ field, key, value: b[key] });
|
|
27942
|
+
}
|
|
27943
|
+
else {
|
|
27944
|
+
edits.push({ field, value: now });
|
|
27945
|
+
}
|
|
27946
|
+
}
|
|
27947
|
+
return edits;
|
|
27948
|
+
}
|
|
27949
|
+
const isMap = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
|
|
27950
|
+
function applyEdits(node, edits) {
|
|
27951
|
+
const target = node;
|
|
27952
|
+
for (const e of edits) {
|
|
27953
|
+
if (e.key === undefined) {
|
|
27954
|
+
if (e.value === undefined)
|
|
27955
|
+
delete target[e.field];
|
|
27956
|
+
else
|
|
27957
|
+
target[e.field] = structuredClone(e.value);
|
|
27958
|
+
continue;
|
|
27959
|
+
}
|
|
27960
|
+
const map = { ...(target[e.field] ?? {}) };
|
|
27961
|
+
if (e.value === undefined)
|
|
27962
|
+
delete map[e.key];
|
|
27963
|
+
else
|
|
27964
|
+
map[e.key] = structuredClone(e.value);
|
|
27965
|
+
target[e.field] = map;
|
|
27966
|
+
}
|
|
27967
|
+
}
|
|
27968
|
+
/**
|
|
27969
|
+
* The new card (`composed`'s children) with the owner's edits from the frame on the page (`previous`), told from what the
|
|
27970
|
+
* composer would draw for the mix the frame wears now (`baseline`). With no baseline nothing is known to be the owner's:
|
|
27971
|
+
* the new card as composed, nothing listed.
|
|
27972
|
+
*/
|
|
27973
|
+
function keepListParts(previous, baseline, composed) {
|
|
27974
|
+
const out = structuredClone(composed);
|
|
27975
|
+
out.id = previous.id;
|
|
27976
|
+
if (!baseline)
|
|
27977
|
+
return { children: out.children ?? [], edits: [] };
|
|
27978
|
+
// The composer draws every frame from its id: a baseline drawn under another id is read under the page's.
|
|
27979
|
+
const was = partsOf$1({ ...baseline, id: previous.id });
|
|
27980
|
+
const page = partsOf$1(previous);
|
|
27981
|
+
const now = partsOf$1(out);
|
|
27982
|
+
const edits = [];
|
|
27983
|
+
const say = (part, n, change, count, kept) => edits.push({ part, ...(n.role ? { role: n.role } : {}), type: n.type, change, edits: count, outcome: kept ? ListPartOutcome.Kept : ListPartOutcome.Redrawn });
|
|
27984
|
+
for (const [key, placed] of page) {
|
|
27985
|
+
const drawn = was.get(key);
|
|
27986
|
+
if (!drawn) {
|
|
27987
|
+
// The owner added it — unless its parent is itself the owner's (it travels inside it).
|
|
27988
|
+
if (placed.parent !== null && !was.has(placed.parent))
|
|
27989
|
+
continue;
|
|
27990
|
+
const into = placed.parent === null ? out : now.get(placed.parent)?.node;
|
|
27991
|
+
if (into) {
|
|
27992
|
+
const children = [...(into.children ?? [])];
|
|
27993
|
+
children.splice(Math.min(placed.index, children.length), 0, structuredClone(placed.node));
|
|
27994
|
+
into.children = children;
|
|
27995
|
+
}
|
|
27996
|
+
say(key, placed.node, ListPartChange.Added, 1, !!into);
|
|
27997
|
+
continue;
|
|
27998
|
+
}
|
|
27999
|
+
const changes = editsOn(drawn.node, placed.node);
|
|
28000
|
+
if (!changes.length)
|
|
28001
|
+
continue;
|
|
26987
28002
|
const target = now.get(key)?.node;
|
|
26988
28003
|
if (target)
|
|
26989
28004
|
applyEdits(target, changes);
|
|
@@ -28971,7 +29986,11 @@ function resolveScopedPath(path, repeater, ctx, nodeId) {
|
|
|
28971
29986
|
const { source, typeSource } = scopeOf(parsed.scope, path, repeater, ctx, nodeId);
|
|
28972
29987
|
if (!parsed.role)
|
|
28973
29988
|
return { source, path: parsed.field || ITEM_VALUE_PATH };
|
|
28974
|
-
const
|
|
29989
|
+
const type = typeSource ? contentTypeOfSource(typeSource, ctx.plan) : undefined;
|
|
29990
|
+
// #129: a list whose items have no picture shows its cards without one, never an empty box per card.
|
|
29991
|
+
if (parsed.optional && parsed.role === ContentRole.Image && type && ctx.pictureless?.has(type.name))
|
|
29992
|
+
return null;
|
|
29993
|
+
const field = roleField(type, parsed.role);
|
|
28975
29994
|
if (field)
|
|
28976
29995
|
return { source, path: field };
|
|
28977
29996
|
if (parsed.optional)
|
|
@@ -30172,7 +31191,7 @@ const LAYOUT_TEXT_PROPS = ['content', 'caption', 'alt', 'label', 'ariaLabel'];
|
|
|
30172
31191
|
* one they did not becomes the fact's label and a contact placeholder (never invented; a reminder, left out of the live site). A photo with no
|
|
30173
31192
|
* address is the empty image box, a placeholder like a pattern's. The site's header and footer are the plan's globals.
|
|
30174
31193
|
*/
|
|
30175
|
-
function composeLayoutPage(page, layout, plan, context, design, placeholders, readyMade) {
|
|
31194
|
+
function composeLayoutPage(page, layout, plan, context, design, placeholders, readyMade, pictureless) {
|
|
30176
31195
|
const preset = layoutPresetOf(plan.design);
|
|
30177
31196
|
const site = {
|
|
30178
31197
|
name: plan.business.name,
|
|
@@ -30202,10 +31221,18 @@ function composeLayoutPage(page, layout, plan, context, design, placeholders, re
|
|
|
30202
31221
|
photoShape: id => boxShape(id) ?? context.photoShape?.(id),
|
|
30203
31222
|
sourceFields: alias => {
|
|
30204
31223
|
const type = contentTypeOfSource(alias, plan);
|
|
30205
|
-
const image = roleField(type, 'image');
|
|
31224
|
+
const image = type && pictureless.has(type.name) ? undefined : roleField(type, 'image');
|
|
30206
31225
|
return image ? { image, ...(roleField(type, 'title') ? { title: roleField(type, 'title') } : {}) } : null;
|
|
30207
31226
|
},
|
|
30208
|
-
listOf: alias =>
|
|
31227
|
+
listOf: alias => {
|
|
31228
|
+
const binding = layoutListBinding(alias, plan);
|
|
31229
|
+
const type = contentTypeOfSource(alias, plan);
|
|
31230
|
+
// #129: a list whose items have no picture is read as a list without one (its cards draw no picture part).
|
|
31231
|
+
if (!binding || !type || !pictureless.has(type.name) || !binding.roles[ContentRole.Image])
|
|
31232
|
+
return binding;
|
|
31233
|
+
const { [ContentRole.Image]: _none, ...roles } = binding.roles;
|
|
31234
|
+
return { ...binding, roles };
|
|
31235
|
+
},
|
|
30209
31236
|
...(context.carry?.[page.key] ? { carry: context.carry[page.key] } : {}),
|
|
30210
31237
|
});
|
|
30211
31238
|
const facts = plan.business.facts ?? {};
|
|
@@ -30249,6 +31276,38 @@ function stampLayoutSections(page, layout, nodes) {
|
|
|
30249
31276
|
* composer never repairs a plan. `context` carries what the composer may not read for itself (the year).
|
|
30250
31277
|
*/
|
|
30251
31278
|
function composeSite(plan, context) {
|
|
31279
|
+
if (!context?.pictures)
|
|
31280
|
+
return composeSiteOnce(plan, context, NO_TYPES);
|
|
31281
|
+
// #129: compose, find the pictures nothing fills, compose again type-led — until a round changes nothing (an opening
|
|
31282
|
+
// left out shows its first section's own picture, judged in the next round). Monotone: a type-led section has no
|
|
31283
|
+
// picture to lose, so it ends.
|
|
31284
|
+
const filled = new Set(context.pictures.filled);
|
|
31285
|
+
const changes = [];
|
|
31286
|
+
let current = plan;
|
|
31287
|
+
let pictureless = NO_TYPES;
|
|
31288
|
+
let site = composeSiteOnce(current, context, pictureless);
|
|
31289
|
+
let opening;
|
|
31290
|
+
const roundContext = { tier: context.tier, studio: context.pictures.studio };
|
|
31291
|
+
for (let round = 0; round < TYPE_LED_ROUNDS; round++) {
|
|
31292
|
+
const next = typeLedRound(current, site, filled, roundContext);
|
|
31293
|
+
if (next.opening)
|
|
31294
|
+
opening = next.opening;
|
|
31295
|
+
const newly = next.pictureless.filter(t => !pictureless.has(t));
|
|
31296
|
+
if (!next.changes.length && !newly.length)
|
|
31297
|
+
break;
|
|
31298
|
+
changes.push(...next.changes);
|
|
31299
|
+
for (const type of newly)
|
|
31300
|
+
changes.push({ kind: TypeLedChangeKind.List, contentType: type, said: `the ${type} have no pictures yet — their cards show their words` });
|
|
31301
|
+
current = next.plan;
|
|
31302
|
+
pictureless = new Set([...pictureless, ...newly]);
|
|
31303
|
+
site = composeSiteOnce(current, context, pictureless);
|
|
31304
|
+
}
|
|
31305
|
+
return { ...site, typeLed: { plan: current, changes, pictureless: [...pictureless], ...(opening ? { opening } : {}) } };
|
|
31306
|
+
}
|
|
31307
|
+
const NO_TYPES = new Set();
|
|
31308
|
+
/** The most rounds a composition takes to wear no empty picture: the opening, then its first section, then a margin. */
|
|
31309
|
+
const TYPE_LED_ROUNDS = 4;
|
|
31310
|
+
function composeSiteOnce(plan, context, pictureless) {
|
|
30252
31311
|
assertValidSitePlan(plan, context?.tier ? { tier: context.tier } : {});
|
|
30253
31312
|
if (!Number.isInteger(context?.year))
|
|
30254
31313
|
throw new ComposeError('composeSite needs the year (ComposeContext.year) — the composer reads no clock');
|
|
@@ -30257,7 +31316,7 @@ function composeSite(plan, context) {
|
|
|
30257
31316
|
const routes = new Set(plan.pages.map(p => p.route));
|
|
30258
31317
|
const relatives = new Map(plan.dataSources.map(d => [d.alias, d.type === PlanDataSourceType.Relative ? { type: d.type, of: d.of, op: d.op } : { type: d.type }]));
|
|
30259
31318
|
const email = nonEmpty$1(plan.business.facts?.email) ? plan.business.facts.email.trim() : null;
|
|
30260
|
-
const base = { plan, placeholders, issues, routes, year: context.year, email, navPage: null };
|
|
31319
|
+
const base = { plan, placeholders, issues, routes, year: context.year, email, navPage: null, pictureless };
|
|
30261
31320
|
// AW-D23 / MB-D6: a lower plan wears its own words of the look's motion language (a Pro Feel arrives on today's
|
|
30262
31321
|
// curve, a Pro move fades) — in the tokens the build applies AND the entrances it stamps.
|
|
30263
31322
|
const design = motionLanguageForPlan(resolveDesignChoices(clone$2(plan.design)), context?.tier === GenerationTier.Award);
|
|
@@ -30274,10 +31333,10 @@ function composeSite(plan, context) {
|
|
|
30274
31333
|
if (page.layout) {
|
|
30275
31334
|
// vectoriox/iox-ui#99: a composed page that is where the site lists the shop lists it (a stored layout too).
|
|
30276
31335
|
const layout = withShownList(page.layout, layoutListsContext(page, plan)) ?? page.layout;
|
|
30277
|
-
const stamped = stampLayoutSections(page, layout, composeLayoutPage(page, layout, plan, context, design, placeholders, (section, id) => composePattern(patternById(section.pattern), id, { ...base, owner: page.key, page, section, nextAlias }, { level: section.enter ?? design.animate ?? null, rtl, move: design.headings ?? null })));
|
|
31336
|
+
const stamped = stampLayoutSections(page, layout, composeLayoutPage(page, layout, plan, context, design, placeholders, (section, id) => composePattern(patternById(section.pattern), id, { ...base, owner: page.key, page, section, nextAlias }, { level: section.enter ?? design.animate ?? null, rtl, move: design.headings ?? null }), pictureless));
|
|
30278
31337
|
// AW8: the plan's opening is the home page's first screen; a pinned or kept first place is never replaced.
|
|
30279
31338
|
const first = layout.sections[0];
|
|
30280
|
-
const worn = wearPlanOpening(page, stamped, plan, context, design, placeholders, issues, !!(first?.pin || first?.carry));
|
|
31339
|
+
const worn = wearPlanOpening(page, stamped, plan, context, design, placeholders, issues, !!(first?.pin || first?.carry), first?.readyMade ? page.sections[first.readyMade.at] : undefined);
|
|
30281
31340
|
const opening = worn === stamped ? layoutBandScheme(first?.ground) : schemeOfFirst(worn);
|
|
30282
31341
|
// Award §0c CW2 (AW-D34): the column the model chose for this page is the page's own word (absent: the site's).
|
|
30283
31342
|
const column = columnWordOf(layout.column);
|
|
@@ -30291,7 +31350,7 @@ function composeSite(plan, context) {
|
|
|
30291
31350
|
const pattern = patternById(section.pattern);
|
|
30292
31351
|
const motion = { level: section.enter ?? design.animate ?? null, rtl, move: design.headings ?? null, scrub: design.scrub ?? null, opening: i === 0 };
|
|
30293
31352
|
return stampSection(composePattern(pattern, `${page.key}-${i}`, { ...base, owner: page.key, page, section, nextAlias }, motion), { pattern: section.pattern });
|
|
30294
|
-
}), plan, context, design, placeholders, issues, false);
|
|
31353
|
+
}), plan, context, design, placeholders, issues, false, page.sections[0]);
|
|
30295
31354
|
const opening = schemeOfFirst(layout);
|
|
30296
31355
|
return {
|
|
30297
31356
|
key: page.key,
|
|
@@ -30755,20 +31814,22 @@ function shownWords(root) {
|
|
|
30755
31814
|
* first. Every mend, and every part that found no place, is said (`opening-mended`). Any other page, or a plan with no
|
|
30756
31815
|
* opening mix, is returned as it was. Mutates `placeholders` / `issues` like the composer; pure otherwise.
|
|
30757
31816
|
*/
|
|
30758
|
-
function wearPlanOpening(page, layout, plan, context, design, placeholders, issues, keep) {
|
|
31817
|
+
function wearPlanOpening(page, layout, plan, context, design, placeholders, issues, keep, source) {
|
|
30759
31818
|
const mix = openingMixOfPlan(plan);
|
|
30760
31819
|
if (!mix || !(page.isHome === true || page.route === HOME_PATH))
|
|
30761
31820
|
return layout;
|
|
30762
31821
|
const first = layout[0];
|
|
30763
31822
|
const replace = !!first && !keep && openingMayReplace(first);
|
|
30764
31823
|
const id = replace ? first.id : `${page.key}-opening`;
|
|
30765
|
-
const
|
|
31824
|
+
const tier = context.tier ?? GenerationTier.Basic;
|
|
31825
|
+
const site = { pages: plan.pages.map(p => ({ name: p.name, route: p.route, isHome: p.isHome === true })), locale: plan.locale, design, badge: null, cutOut: false, tier };
|
|
31826
|
+
// #129: a type-led first screen takes the type-led hero's words slot by slot (nothing it said is lost); the name is
|
|
31827
|
+
// the business's, as every display-size opening's is.
|
|
31828
|
+
const checked = replace && source ? checkOpening(drawnOpeningMix(mix).drawn, openingContextOf({ ...site, business: plan.business })).mix : null;
|
|
31829
|
+
const parts = checked && source ? typeLedOpeningSection(checked, source) : null;
|
|
31830
|
+
const heading = replace && !parts ? swapParts(first)['heading'][0] : undefined;
|
|
30766
31831
|
const title = shownWords(heading);
|
|
30767
|
-
const composed = composeOpening({
|
|
30768
|
-
business: { ...plan.business, name: title || plan.business.name },
|
|
30769
|
-
pages: plan.pages.map(p => ({ name: p.name, route: p.route, isHome: p.isHome === true })),
|
|
30770
|
-
mix, locale: plan.locale, design, badge: null, cutOut: false, tier: context.tier ?? GenerationTier.Basic,
|
|
30771
|
-
}, { id });
|
|
31832
|
+
const composed = composeOpening({ ...site, business: { ...plan.business, name: title || plan.business.name }, mix, ...(parts ? { parts } : {}) }, { id });
|
|
30772
31833
|
const section = composed.section;
|
|
30773
31834
|
const said = composed.issues.map(i => i.detail);
|
|
30774
31835
|
let own = composed.placeholders.map(p => ({ ...p, owner: page.key }));
|
|
@@ -30779,6 +31840,14 @@ function wearPlanOpening(page, layout, plan, context, design, placeholders, issu
|
|
|
30779
31840
|
for (let i = placeholders.length - 1; i >= 0; i--)
|
|
30780
31841
|
if (gone.has(placeholders[i].nodeId))
|
|
30781
31842
|
placeholders.splice(i, 1);
|
|
31843
|
+
if (parts) {
|
|
31844
|
+
// The words came slot by slot: nothing to carry, the composer's placeholders stand.
|
|
31845
|
+
placeholders.push(...own);
|
|
31846
|
+
for (const detail of said)
|
|
31847
|
+
issues.push({ code: ComposeIssueCode.OpeningMended, nodeId: id, owner: page.key, detail });
|
|
31848
|
+
stampSection(section, first.composed?.pattern ? { pattern: first.composed.pattern } : { layout: first.composed?.layout ?? OPENING_ORIGIN });
|
|
31849
|
+
return [section, ...layout.slice(1)];
|
|
31850
|
+
}
|
|
30782
31851
|
// The hero's title is already the opening's display words (composed above — split apart, set as a wordmark); the
|
|
30783
31852
|
// carry places everything else, never over those words.
|
|
30784
31853
|
const fromRest = withoutNodes(first, n => n === heading);
|
|
@@ -30857,17 +31926,19 @@ function composeOpening(input, options) {
|
|
|
30857
31926
|
for (const said of [...gaps.map(g => `the opening's ${g.ingredient} "${g.word}" is drawn as ${g.drawnAs ? `"${g.drawnAs}"` : 'nothing'} until ${g.phase}`), ...checked.repairs.map(r => r.said)]) {
|
|
30858
31927
|
issues.push({ code: ComposeIssueCode.OpeningMended, nodeId: options.id, owner: options.id, detail: said });
|
|
30859
31928
|
}
|
|
31929
|
+
const parts = input.parts ?? (openingIsTypeLed(checked.mix) ? { slots: {}, links: {}, without: TYPE_LED_OPTIONAL_PARTS } : null);
|
|
31930
|
+
const section = parts ? { pattern: OPENING_ORIGIN, slots: parts.slots, links: parts.links, without: [...parts.without] } : null;
|
|
30860
31931
|
const ctx = {
|
|
30861
|
-
owner: options.id, page: null, section
|
|
31932
|
+
owner: options.id, page: null, section, plan, year: 0, email, navPage: null, nextAlias: null,
|
|
30862
31933
|
placeholders, issues, routes: new Set(pages.map(p => p.route)), keepButtons: true,
|
|
30863
31934
|
};
|
|
30864
31935
|
const recipe = openingRecipe(checked.mix, context);
|
|
30865
|
-
const
|
|
30866
|
-
stampOpeningMix(
|
|
30867
|
-
stampOpeningMotion(
|
|
31936
|
+
const root = composePattern(recipe.pattern, options.id, ctx);
|
|
31937
|
+
stampOpeningMix(root, recipe.mix);
|
|
31938
|
+
stampOpeningMotion(root, recipe.mix);
|
|
30868
31939
|
const badge = typeof input.badge === 'string' && input.badge.trim() ? input.badge.trim() : null;
|
|
30869
31940
|
if (badge) {
|
|
30870
|
-
walkSerialized([
|
|
31941
|
+
walkSerialized([root], n => {
|
|
30871
31942
|
const holder = n.role === OpeningRole.Badge ? n : null;
|
|
30872
31943
|
for (const words of holder?.children ?? []) {
|
|
30873
31944
|
words.props = { ...words.props, content: badge };
|
|
@@ -30877,7 +31948,7 @@ function composeOpening(input, options) {
|
|
|
30877
31948
|
}
|
|
30878
31949
|
});
|
|
30879
31950
|
}
|
|
30880
|
-
return { section, placeholders, issues, mix: recipe.mix };
|
|
31951
|
+
return { section: root, placeholders, issues, mix: recipe.mix };
|
|
30881
31952
|
}
|
|
30882
31953
|
|
|
30883
31954
|
/**
|
|
@@ -31640,7 +32711,7 @@ const OPENING_WIRE_TEXT = "string[] — the home page's opening (its first scree
|
|
|
31640
32711
|
+ "section as written. The opening takes the place of the home page's first section when that is a hero (its words and pictures carried in); "
|
|
31641
32712
|
+ 'a word marked (award) is worn by an award build only — elsewhere it is mended. '
|
|
31642
32713
|
+ Object.values(OpeningIngredient).map(k => `${k}: ${openingWireWords(GenerationTier.Award).filter(w => w.startsWith(`${k}:`)).map(w => w.slice(k.length + 1))
|
|
31643
|
-
.map(w => `${w} (${openingMeaning(k, w)}${openingWordTier(k, w) === 'pro' ? ', award' : ''})`).join(' | ')}`).join('; ');
|
|
32714
|
+
.map(w => `${w} (${openingMeaning(k, w)}${openingWordTier(k, w) === 'pro' ? ', award' : ''}${openingHarnessWord(k, w) ? ', the build\'s own — keep it where the plan has it, never choose it' : ''})`).join(' | ')}`).join('; ');
|
|
31644
32715
|
/** The header's words as the model reads them (HI1): each ingredient, the words the product draws and their meanings,
|
|
31645
32716
|
* from the contract's header table. */
|
|
31646
32717
|
const HEADER_WIRE_TEXT = 'string[] — the header as ONE list of <ingredient>:<word> words, one word per ingredient; an ingredient left out is the '
|
|
@@ -31848,8 +32919,8 @@ class PlanWireShapeError extends Error {
|
|
|
31848
32919
|
}
|
|
31849
32920
|
// ── The format ─────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
31850
32921
|
const unique = (values) => [...new Set(values)];
|
|
31851
|
-
const NONE = '';
|
|
31852
|
-
const orNone = (values) => jsonOneOf([NONE, ...values]);
|
|
32922
|
+
const NONE$1 = '';
|
|
32923
|
+
const orNone = (values) => jsonOneOf([NONE$1, ...values]);
|
|
31853
32924
|
const closedOrText = (values) => (values.length ? jsonOneOf(values) : jsonText());
|
|
31854
32925
|
const shaped = (entry, properties) => jsonShapedObject(PLAN_WIRE_SHAPE[entry], properties, `wire ${entry}`);
|
|
31855
32926
|
/** The patterns a page section may use (every non-global one but a film's, which `placeFilm` places), in library order. */
|
|
@@ -31962,7 +33033,7 @@ function planWirePartJsonSchema(part, options = {}) {
|
|
|
31962
33033
|
return jsonShapedObject(planWirePartShape(part, options), Object.fromEntries(PLAN_PART_KEYS[part].map(k => [k, PLAN_TOP_SCHEMAS[k](options)])), `wire plan ${part}`);
|
|
31963
33034
|
}
|
|
31964
33035
|
/** A value standing for "absent": `''` (or nothing at all). */
|
|
31965
|
-
const isNone = (v) => v === undefined || v === NONE;
|
|
33036
|
+
const isNone = (v) => v === undefined || v === NONE$1;
|
|
31966
33037
|
const optional = (name, v, none = isNone) => (none(v) ? {} : { [name]: v });
|
|
31967
33038
|
const emptyList = (v) => v === undefined || (Array.isArray(v) && v.length === 0);
|
|
31968
33039
|
/** `[{ <keyName>, <valueName> }]` → `{ key: value }`; anything else is left for the gate to refuse. */
|
|
@@ -32091,7 +33162,7 @@ function expandPlanWire(parts, context) {
|
|
|
32091
33162
|
...rest,
|
|
32092
33163
|
...expandWireGlobals(globals),
|
|
32093
33164
|
...(sells === undefined ? {} : { shop: sells }),
|
|
32094
|
-
...(isPlainObject(direction) && direction['idea'] === NONE ? {} : direction === undefined ? {} : { direction }),
|
|
33165
|
+
...(isPlainObject(direction) && direction['idea'] === NONE$1 ? {} : direction === undefined ? {} : { direction }),
|
|
32095
33166
|
version: SITE_PLAN_VERSION,
|
|
32096
33167
|
source: { ...context.source },
|
|
32097
33168
|
business: expandWireBusiness(business, context.facts),
|
|
@@ -32139,7 +33210,7 @@ function expandWireGlobals(globals) {
|
|
|
32139
33210
|
}
|
|
32140
33211
|
// ── The plan → the wire ────────────────────────────────────────────────────────────────────────────────────────────
|
|
32141
33212
|
function fieldToWire(field) {
|
|
32142
|
-
return { name: field.name, controller: field.controller, required: field.required ?? false, note: field.note ?? NONE };
|
|
33213
|
+
return { name: field.name, controller: field.controller, required: field.required ?? false, note: field.note ?? NONE$1 };
|
|
32143
33214
|
}
|
|
32144
33215
|
function contentTypeToWire(type, options = {}) {
|
|
32145
33216
|
const played = type.roles;
|
|
@@ -32151,37 +33222,37 @@ function contentTypeToWire(type, options = {}) {
|
|
|
32151
33222
|
};
|
|
32152
33223
|
}
|
|
32153
33224
|
function dataSourceToWire(source) {
|
|
32154
|
-
const blank = { alias: source.alias, type: source.type, mode: NONE, contentType: NONE, limit: 0, filterField: NONE, routeParam: NONE, of: NONE, op: NONE, within: NONE };
|
|
33225
|
+
const blank = { alias: source.alias, type: source.type, mode: NONE$1, contentType: NONE$1, limit: 0, filterField: NONE$1, routeParam: NONE$1, of: NONE$1, op: NONE$1, within: NONE$1 };
|
|
32155
33226
|
if (source.type === PlanDataSourceType.Relative)
|
|
32156
33227
|
return { ...blank, of: source.of, op: source.op, within: source.within };
|
|
32157
33228
|
if (source.type === PlanDataSourceType.Shop) {
|
|
32158
33229
|
return {
|
|
32159
33230
|
...blank, mode: source.mode, contentType: source.resource, limit: source.limit ?? 0,
|
|
32160
|
-
filterField: source.filterByRouteParam?.field ?? NONE, routeParam: source.filterByRouteParam?.routeParam ?? NONE,
|
|
33231
|
+
filterField: source.filterByRouteParam?.field ?? NONE$1, routeParam: source.filterByRouteParam?.routeParam ?? NONE$1,
|
|
32161
33232
|
};
|
|
32162
33233
|
}
|
|
32163
33234
|
return {
|
|
32164
33235
|
...blank, mode: source.mode, contentType: source.contentType, limit: source.limit ?? 0,
|
|
32165
|
-
filterField: source.filterByRouteParam?.field ?? NONE, routeParam: source.filterByRouteParam?.routeParam ?? NONE,
|
|
33236
|
+
filterField: source.filterByRouteParam?.field ?? NONE$1, routeParam: source.filterByRouteParam?.routeParam ?? NONE$1,
|
|
32166
33237
|
};
|
|
32167
33238
|
}
|
|
32168
33239
|
function sectionToWire(section) {
|
|
32169
33240
|
return {
|
|
32170
33241
|
pattern: section.pattern, slots: mapToList(section.slots, 'slot', 'text'), links: mapToList(section.links, 'slot', 'route'),
|
|
32171
|
-
binding: section.binding ?? NONE, without: [...(section.without ?? [])], form: section.form ?? NONE, enter: section.enter ?? NONE,
|
|
33242
|
+
binding: section.binding ?? NONE$1, without: [...(section.without ?? [])], form: section.form ?? NONE$1, enter: section.enter ?? NONE$1,
|
|
32172
33243
|
};
|
|
32173
33244
|
}
|
|
32174
33245
|
function pageToWire(page, options = {}) {
|
|
32175
33246
|
return {
|
|
32176
|
-
key: page.key, name: page.name, route: page.route, inNav: page.inNav ?? false, archetype: page.archetype ?? NONE, need: page.need ?? NONE,
|
|
32177
|
-
template: page.template ?? NONE, routeSource: page.routeSource ?? NONE,
|
|
32178
|
-
seo: { title: page.seo?.title ?? NONE, description: page.seo?.description ?? NONE },
|
|
33247
|
+
key: page.key, name: page.name, route: page.route, inNav: page.inNav ?? false, archetype: page.archetype ?? NONE$1, need: page.need ?? NONE$1,
|
|
33248
|
+
template: page.template ?? NONE$1, routeSource: page.routeSource ?? NONE$1,
|
|
33249
|
+
seo: { title: page.seo?.title ?? NONE$1, description: page.seo?.description ?? NONE$1 },
|
|
32179
33250
|
...(options.children === false ? {} : { sections: page.sections.map(sectionToWire) }),
|
|
32180
33251
|
compose: page.compose ?? false,
|
|
32181
33252
|
};
|
|
32182
33253
|
}
|
|
32183
33254
|
const PLAN_TO_WIRE = {
|
|
32184
|
-
business: plan => ({ name: plan.business.name, tagline: plan.business.tagline ?? NONE }),
|
|
33255
|
+
business: plan => ({ name: plan.business.name, tagline: plan.business.tagline ?? NONE$1 }),
|
|
32185
33256
|
contentTypes: plan => plan.contentTypes.map(type => contentTypeToWire(type)),
|
|
32186
33257
|
dataSources: plan => plan.dataSources.map(dataSourceToWire),
|
|
32187
33258
|
pages: plan => plan.pages.map(page => pageToWire(page)),
|
|
@@ -32191,7 +33262,7 @@ const PLAN_TO_WIRE = {
|
|
|
32191
33262
|
// AW6: the award tier's wire writes the body ([] = none); every other tier's has no such key (its plan wears none).
|
|
32192
33263
|
...(isAward(options) ? { [BODY_WIRE_KEY]: [...(plan.mixes?.body ?? [])] } : {}),
|
|
32193
33264
|
}),
|
|
32194
|
-
direction: plan => ({ idea: plan.direction?.idea ?? NONE, cliche: plan.direction?.cliche ?? NONE, flip: plan.direction?.flip ?? NONE, rules: [...(plan.direction?.rules ?? [])] }),
|
|
33265
|
+
direction: plan => ({ idea: plan.direction?.idea ?? NONE$1, cliche: plan.direction?.cliche ?? NONE$1, flip: plan.direction?.flip ?? NONE$1, rules: [...(plan.direction?.rules ?? [])] }),
|
|
32195
33266
|
shop: plan => (plan.shop?.products ?? []).map(p => ({ name: p.name, category: p.category, description: p.description, options: p.options.map(o => ({ name: o.name, values: [...o.values] })) })),
|
|
32196
33267
|
};
|
|
32197
33268
|
/** One part of the plan on the wire: what that part's request (asked at `options`' tier) would have answered. */
|
|
@@ -32288,11 +33359,11 @@ function additionSourcesOf(typeName) {
|
|
|
32288
33359
|
{ alias: `${typeName}${ADDITION_ITEM_SOURCE_SUFFIX}`, type: PlanDataSourceType.Cms, mode: PlanDataSourceMode.Single, contentType: typeName, filterByRouteParam: { field: ADDITION_SLUG, routeParam: ADDITION_SLUG } },
|
|
32289
33360
|
];
|
|
32290
33361
|
}
|
|
32291
|
-
const list = (value) => (Array.isArray(value) ? value : []);
|
|
32292
|
-
const text = (value) => (typeof value === 'string' ? value : '');
|
|
33362
|
+
const list$1 = (value) => (Array.isArray(value) ? value : []);
|
|
33363
|
+
const text$1 = (value) => (typeof value === 'string' ? value : '');
|
|
32293
33364
|
/** Does the Pages answer ask for content (so the Content request is asked). */
|
|
32294
33365
|
function additionsNeedContent(pagesAnswer) {
|
|
32295
|
-
return isPlainObject(pagesAnswer) && (list(pagesAnswer['newTypes']).length > 0 || list(pagesAnswer['newItems']).length > 0);
|
|
33366
|
+
return isPlainObject(pagesAnswer) && (list$1(pagesAnswer['newTypes']).length > 0 || list$1(pagesAnswer['newItems']).length > 0);
|
|
32296
33367
|
}
|
|
32297
33368
|
/**
|
|
32298
33369
|
* The answers → what the redesign adds. Translates, never repairs (as `expandPlanWire`): a wrong value stays wrong, for
|
|
@@ -32301,21 +33372,21 @@ function additionsNeedContent(pagesAnswer) {
|
|
|
32301
33372
|
function expandAdditions(pagesAnswer, contentAnswer) {
|
|
32302
33373
|
const pages = isPlainObject(pagesAnswer) ? pagesAnswer : {};
|
|
32303
33374
|
const content = isPlainObject(contentAnswer) ? contentAnswer : {};
|
|
32304
|
-
const newTypes = list(pages['newTypes']).filter(isPlainObject).map(t => ({ name: text(t['name']), label: text(t['label']) }));
|
|
33375
|
+
const newTypes = list$1(pages['newTypes']).filter(isPlainObject).map(t => ({ name: text$1(t['name']), label: text$1(t['label']) }));
|
|
32305
33376
|
return {
|
|
32306
|
-
pages: list(pages['pages']).filter(isPlainObject).map(wire => {
|
|
33377
|
+
pages: list$1(pages['pages']).filter(isPlainObject).map(wire => {
|
|
32307
33378
|
const { origin, reason, ...page } = wire;
|
|
32308
|
-
return { page: expandWirePage(page), origin: origin, reason: text(reason) };
|
|
33379
|
+
return { page: expandWirePage(page), origin: origin, reason: text$1(reason) };
|
|
32309
33380
|
}),
|
|
32310
|
-
contentTypes: list(content['contentTypes']).map(t => expandWireContentType(t)),
|
|
33381
|
+
contentTypes: list$1(content['contentTypes']).map(t => expandWireContentType(t)),
|
|
32311
33382
|
dataSources: newTypes.filter(t => t.name).flatMap(t => additionSourcesOf(t.name)),
|
|
32312
|
-
items: list(content['items']).filter(isPlainObject).map(item => ({
|
|
32313
|
-
contentType: text(item['contentType']),
|
|
32314
|
-
values: Object.fromEntries(list(item['values']).filter(isPlainObject).map(v => [text(v['field']), v['value']])),
|
|
33383
|
+
items: list$1(content['items']).filter(isPlainObject).map(item => ({
|
|
33384
|
+
contentType: text$1(item['contentType']),
|
|
33385
|
+
values: Object.fromEntries(list$1(item['values']).filter(isPlainObject).map(v => [text$1(v['field']), v['value']])),
|
|
32315
33386
|
})),
|
|
32316
33387
|
asks: {
|
|
32317
33388
|
newTypes,
|
|
32318
|
-
newItems: list(pages['newItems']).filter(isPlainObject).map(n => ({ contentType: text(n['contentType']), count: Number(n['count']) || 0 })),
|
|
33389
|
+
newItems: list$1(pages['newItems']).filter(isPlainObject).map(n => ({ contentType: text$1(n['contentType']), count: Number(n['count']) || 0 })),
|
|
32319
33390
|
},
|
|
32320
33391
|
};
|
|
32321
33392
|
}
|
|
@@ -33445,7 +34516,7 @@ const NO_INDEX = -1;
|
|
|
33445
34516
|
/** A new page or content type on the wire: its children are edits of their own. */
|
|
33446
34517
|
const CHILDLESS = { children: false };
|
|
33447
34518
|
/** A list holding exactly one object: none → absent, one → it (expanded), more → the list (the gate refuses it). */
|
|
33448
|
-
const oneOf = (schema, expand, toWire, what) => ({
|
|
34519
|
+
const oneOf$1 = (schema, expand, toWire, what) => ({
|
|
33449
34520
|
text: `${what}[] — exactly one when the op takes it`,
|
|
33450
34521
|
none: [],
|
|
33451
34522
|
schema: () => jsonListOf(schema()),
|
|
@@ -33469,12 +34540,12 @@ const EDIT_WIRE = {
|
|
|
33469
34540
|
binding: textKey('setSectionData: the list source the section repeats'),
|
|
33470
34541
|
contentType: textKey('addField: a content type of the plan'),
|
|
33471
34542
|
newPage: {
|
|
33472
|
-
...oneOf(() => wirePageJsonSchema(CHILDLESS), v => expandWirePage(v, CHILDLESS), p => pageToWire(p, CHILDLESS), 'page'),
|
|
34543
|
+
...oneOf$1(() => wirePageJsonSchema(CHILDLESS), v => expandWirePage(v, CHILDLESS), p => pageToWire(p, CHILDLESS), 'page'),
|
|
33473
34544
|
text: 'page[] — exactly one when the op takes it, WITHOUT sections: each is an addSection after it',
|
|
33474
34545
|
},
|
|
33475
|
-
newSection: oneOf(wireSectionJsonSchema, expandWireSection, sectionToWire, 'section'),
|
|
34546
|
+
newSection: oneOf$1(wireSectionJsonSchema, expandWireSection, sectionToWire, 'section'),
|
|
33476
34547
|
newContentType: {
|
|
33477
|
-
...oneOf(() => wireContentTypeJsonSchema(CHILDLESS), v => expandWireContentType(v, CHILDLESS), t => contentTypeToWire(t, CHILDLESS), 'contentType'),
|
|
34548
|
+
...oneOf$1(() => wireContentTypeJsonSchema(CHILDLESS), v => expandWireContentType(v, CHILDLESS), t => contentTypeToWire(t, CHILDLESS), 'contentType'),
|
|
33478
34549
|
text: "contentType[] — exactly one when the op takes it, WITHOUT fields: each is an addField after it (the samples' values stay in its seed)",
|
|
33479
34550
|
},
|
|
33480
34551
|
dataSources: {
|
|
@@ -33483,7 +34554,7 @@ const EDIT_WIRE = {
|
|
|
33483
34554
|
expand: v => (Array.isArray(v) ? v.map(expandWireDataSource) : v),
|
|
33484
34555
|
toWire: (v) => v.map(dataSourceToWire),
|
|
33485
34556
|
},
|
|
33486
|
-
newField: oneOf(wireFieldJsonSchema, expandWireField, fieldToWire, 'field'),
|
|
34557
|
+
newField: oneOf$1(wireFieldJsonSchema, expandWireField, fieldToWire, 'field'),
|
|
33487
34558
|
sample: { text: "string | string[] — addField: the samples' value for it", none: '', schema: () => jsonAnyOf([jsonText(), jsonListOf(jsonText())]) },
|
|
33488
34559
|
};
|
|
33489
34560
|
/** Each op's keys (`PLAN_EDIT_SHAPE`) → the wire key that carries it. */
|
|
@@ -34038,7 +35109,7 @@ const HAND_BUILT_LEGAL = {
|
|
|
34038
35109
|
const HEBREW = 'he';
|
|
34039
35110
|
const MAILER = 'mailer';
|
|
34040
35111
|
const EMAIL_DELIVERY = 'email';
|
|
34041
|
-
const LITERAL_COLOUR = /#[0-9a-f]{3,8}\b|rgba?\(|hsla?\(/i;
|
|
35112
|
+
const LITERAL_COLOUR$1 = /#[0-9a-f]{3,8}\b|rgba?\(|hsla?\(/i;
|
|
34042
35113
|
const COLOUR_TRAITS = /color|Color|^background$|boxShadow|textShadow/;
|
|
34043
35114
|
const HEADING_LEVEL = /^h([1-6])$/;
|
|
34044
35115
|
const DIALOG_TYPE = 'Dialog';
|
|
@@ -34354,7 +35425,7 @@ function checkTokens(ctx, snapshot, pages) {
|
|
|
34354
35425
|
if (!n.elementStyle)
|
|
34355
35426
|
return;
|
|
34356
35427
|
const maps = [n.styleProps, ...Object.values(n.stateStyles ?? {}), ...Object.values(n.responsive ?? {}).map(l => l?.styleProps)];
|
|
34357
|
-
const literal = maps.some(map => Object.entries(map ?? {}).some(([k, v]) => COLOUR_TRAITS.test(k) && LITERAL_COLOUR.test(String(v)) && !(k === 'borderColor' && n.styleProps['borderWidth'] === '0px')));
|
|
35428
|
+
const literal = maps.some(map => Object.entries(map ?? {}).some(([k, v]) => COLOUR_TRAITS.test(k) && LITERAL_COLOUR$1.test(String(v)) && !(k === 'borderColor' && n.styleProps['borderWidth'] === '0px')));
|
|
34358
35429
|
if (literal)
|
|
34359
35430
|
add(ctx, SiteFindingCode.LiteralColour, null, { ...where, nodeId: n.id });
|
|
34360
35431
|
});
|
|
@@ -34459,21 +35530,6 @@ function publishVerdict(audit, acknowledged = []) {
|
|
|
34459
35530
|
return { ok: !blocked && missing.length === 0, blocked, missing };
|
|
34460
35531
|
}
|
|
34461
35532
|
|
|
34462
|
-
/**
|
|
34463
|
-
* The words that carry no subject in the languages a site is written in (English, Hebrew): "the", "with", "our", "כמו",
|
|
34464
|
-
* "שלנו"… Shared by every comparison of meaning by words — a stock photo against a slot (`stockWords`), a model's section
|
|
34465
|
-
* against a ready-made one (silent section fallback). Lower case; only words of three letters or more (shorter ones never
|
|
34466
|
-
* count anywhere).
|
|
34467
|
-
*/
|
|
34468
|
-
const FUNCTION_WORDS = new Set([
|
|
34469
|
-
'the', 'and', 'with', 'for', 'your', 'our', 'you', 'from', 'into', 'this', 'that', 'here', 'there', 'about', 'how', 'what',
|
|
34470
|
-
'who', 'are', 'all', 'but', 'not', 'was', 'were', 'has', 'have', 'had', 'its', 'they', 'them', 'their', 'then', 'than',
|
|
34471
|
-
'when', 'where', 'which', 'will', 'can', 'just', 'out', 'over', 'under', 'onto', 'each', 'every', 'some', 'any', 'one', 'also',
|
|
34472
|
-
'too', 'very', 'more', 'most', 'less', 'only', 'own', 'yours', 'ours', 'these', 'those',
|
|
34473
|
-
'אנחנו', 'אני', 'הוא', 'היא', 'אתם', 'אתן', 'שלנו', 'שלכם', 'שלך', 'שלו', 'שלה', 'אצלנו', 'כמו', 'אבל', 'זאת', 'כאן', 'יותר',
|
|
34474
|
-
'מאוד', 'כבר', 'עוד', 'אחרי', 'לפני', 'בין', 'כדי', 'איך',
|
|
34475
|
-
]);
|
|
34476
|
-
|
|
34477
35533
|
/**
|
|
34478
35534
|
* How a stock photo is judged against a picture slot (AI plan §3g, I2.1) — pure and deterministic, so the same plan and
|
|
34479
35535
|
* the same library always place the same photos. A photo is described by what the library's manifest carries (the
|
|
@@ -35565,220 +36621,997 @@ function judgeLayoutRender(measured, pixels = []) {
|
|
|
35565
36621
|
say(`drift:${A.path}:${B.path}:${on}`, A.depth ? A.path : B.path, `${A.path} (${how(A)}) and ${B.path} (${how(B)}): their words ${what} as the page scrolls on the ${on} (${Math.round(met.overlap.r - met.overlap.l)}×${Math.round(met.overlap.b - met.overlap.t)}px, ${Math.round(met.scroll)}px down) — give them the same depth, or more rows apart`);
|
|
35566
36622
|
}
|
|
35567
36623
|
}
|
|
35568
|
-
for (const l of seen) {
|
|
35569
|
-
const w = ink(l);
|
|
35570
|
-
if (on === LayoutViewport.Desktop && l.kind !== 'button') {
|
|
35571
|
-
const down = Math.max(w.b - l.box.b, l.box.t - w.t);
|
|
35572
|
-
const side = Math.max(l.words.r - l.box.r, l.box.l - l.words.l);
|
|
35573
|
-
if (down > RENDER_CHECK.spillDown)
|
|
35574
|
-
say(`spill:${l.path}`, l.path, `${l.path}: its words are ${Math.round(down)}px taller than its rows — more rows, fewer words or a smaller size`);
|
|
35575
|
-
else if (side > RENDER_CHECK.spillSide && !l.bleed)
|
|
35576
|
-
say(`spillx:${l.path}`, l.path, `${l.path}: its words are ${Math.round(side)}px wider than its columns — more columns or a smaller size`);
|
|
36624
|
+
for (const l of seen) {
|
|
36625
|
+
const w = ink(l);
|
|
36626
|
+
if (on === LayoutViewport.Desktop && l.kind !== 'button') {
|
|
36627
|
+
const down = Math.max(w.b - l.box.b, l.box.t - w.t);
|
|
36628
|
+
const side = Math.max(l.words.r - l.box.r, l.box.l - l.words.l);
|
|
36629
|
+
if (down > RENDER_CHECK.spillDown)
|
|
36630
|
+
say(`spill:${l.path}`, l.path, `${l.path}: its words are ${Math.round(down)}px taller than its rows — more rows, fewer words or a smaller size`);
|
|
36631
|
+
else if (side > RENDER_CHECK.spillSide && !l.bleed)
|
|
36632
|
+
say(`spillx:${l.path}`, l.path, `${l.path}: its words are ${Math.round(side)}px wider than its columns — more columns or a smaller size`);
|
|
36633
|
+
}
|
|
36634
|
+
if (!l.bleed && (l.words.l < -2 || l.words.r > m.width + 2))
|
|
36635
|
+
say(`off:${l.path}:${on}`, l.path, `${l.path}: its words run off the ${on} screen`);
|
|
36636
|
+
}
|
|
36637
|
+
if (on === LayoutViewport.Desktop) {
|
|
36638
|
+
for (const lead of m.layers.filter(l => l.section === 0 && l.role === 'lead')) {
|
|
36639
|
+
const h = Math.max(1, lead.box.b - lead.box.t);
|
|
36640
|
+
const shown = Math.max(0, Math.min(lead.box.b, m.height) - Math.max(lead.box.t, 0)) / h;
|
|
36641
|
+
if (shown < RENDER_CHECK.firstScreen)
|
|
36642
|
+
say('first', lead.path, `${lead.path}: the first screen shows ${Math.round(shown * 100)}% of the lead before anyone scrolls — move it up into the first screen`);
|
|
36643
|
+
}
|
|
36644
|
+
}
|
|
36645
|
+
if (on === LayoutViewport.Phone && m.scrollWidth > m.width + 1)
|
|
36646
|
+
say('sideways', 'sections', `the page scrolls sideways on a phone (${m.scrollWidth - m.width}px too wide)`);
|
|
36647
|
+
}
|
|
36648
|
+
const layerAt = new Map(measured.flatMap(m => m.layers.map(l => [`${m.viewport}:${l.path}`, l])));
|
|
36649
|
+
for (const px of pixels) {
|
|
36650
|
+
const l = layerAt.get(`${px.viewport}:${px.path}`);
|
|
36651
|
+
const colour = l ? parseCssColour(l.color) : null;
|
|
36652
|
+
// Under a scrim the build chooses the scrim's strength from these same pixels (M7 `chooseScrim`).
|
|
36653
|
+
if (!l || !colour || l.scrim)
|
|
36654
|
+
continue;
|
|
36655
|
+
const big = l.size >= 24 || (l.size >= 18.6 && l.weight >= 700);
|
|
36656
|
+
const need = big ? RENDER_CHECK.contrastLarge : RENDER_CHECK.contrastBody;
|
|
36657
|
+
const r = ratio(relativeLuminance(colour), px.luminance);
|
|
36658
|
+
if (r < need)
|
|
36659
|
+
say(`contrast:${px.path}`, px.path, `${px.path}: ${r.toFixed(1)}:1 against the photo behind it on the ${px.viewport} (needs ${need}) — another colour, a calm part, or off the photo`);
|
|
36660
|
+
else if (px.spread > RENDER_CHECK.busy)
|
|
36661
|
+
say(`busy:${px.path}`, px.path, `${px.path}: sits on a busy part of a photo on the ${px.viewport} (light varies ${px.spread.toFixed(2)}) — move it to a calm part or onto the ground`);
|
|
36662
|
+
}
|
|
36663
|
+
return [...issues.values()];
|
|
36664
|
+
}
|
|
36665
|
+
|
|
36666
|
+
/**
|
|
36667
|
+
* THE FREE SECTION (award-ingredients plan §11.4, FS3; FS-D15…FS-D18). A free page is ordinary builder-shaped nodes the
|
|
36668
|
+
* model writes itself — Section, Container, Heading, Text, Button, Image, Video — each with styles, a phone layer, a hover
|
|
36669
|
+
* and ONE move, plus SLOTS where a recipe stands (a list bound to content, a form): the model places a slot and never
|
|
36670
|
+
* writes a Repeater or a Form (FS-T1). The look's values stay the look's (tokens only, `checkFree`); layout, overlap,
|
|
36671
|
+
* turn, clip and size are free.
|
|
36672
|
+
*
|
|
36673
|
+
* It is ASKED as the strict FLAT wire (FS-D17): one list of nodes, every key required, no optional key, no union, no
|
|
36674
|
+
* recursion, styles as `"<property>:<value>"` strings — 23 properties, held by `strictSchemaComplexity` — so a parse
|
|
36675
|
+
* failure cannot happen. `expandFreeWire` turns it into the free tree (`FreePage`) the judge reads; `freeToWire` writes a
|
|
36676
|
+
* tree back (fixtures, a repair's starting point); `freeWireIssue` says a judge's tree path in the wire's own words.
|
|
36677
|
+
* The page is written in ONE language: the site's. Every enum is generated from THIS request (R-H2): the material ids,
|
|
36678
|
+
* the slots, the pages. Pure. The prototype's copy is `prototypes/breaking-limits/code/flat5.mjs` (FS-D48 measured it).
|
|
36679
|
+
*/
|
|
36680
|
+
/** What a free node is. `Button` is stamped as the builder's ButtonBlock; a `Slot` is a recipe placed by name. */
|
|
36681
|
+
var FreeNodeType;
|
|
36682
|
+
(function (FreeNodeType) {
|
|
36683
|
+
FreeNodeType["Section"] = "Section";
|
|
36684
|
+
FreeNodeType["Container"] = "Container";
|
|
36685
|
+
FreeNodeType["Heading"] = "Heading";
|
|
36686
|
+
FreeNodeType["Text"] = "Text";
|
|
36687
|
+
FreeNodeType["Button"] = "Button";
|
|
36688
|
+
FreeNodeType["Image"] = "Image";
|
|
36689
|
+
FreeNodeType["Video"] = "Video";
|
|
36690
|
+
FreeNodeType["Slot"] = "Slot";
|
|
36691
|
+
})(FreeNodeType || (FreeNodeType = {}));
|
|
36692
|
+
/** The node types that carry words. */
|
|
36693
|
+
const FREE_WORD_TYPES = [FreeNodeType.Heading, FreeNodeType.Text, FreeNodeType.Button];
|
|
36694
|
+
/** The node types that hold children. */
|
|
36695
|
+
const FREE_HOLDERS = [FreeNodeType.Section, FreeNodeType.Container];
|
|
36696
|
+
/** What a free section is for — the fall back picks the ready-made section of the same place by it. */
|
|
36697
|
+
var FreePurpose;
|
|
36698
|
+
(function (FreePurpose) {
|
|
36699
|
+
FreePurpose["Opening"] = "opening";
|
|
36700
|
+
FreePurpose["Videos"] = "videos";
|
|
36701
|
+
FreePurpose["Products"] = "products";
|
|
36702
|
+
FreePurpose["Work"] = "work";
|
|
36703
|
+
FreePurpose["About"] = "about";
|
|
36704
|
+
FreePurpose["Offer"] = "offer";
|
|
36705
|
+
FreePurpose["Proof"] = "proof";
|
|
36706
|
+
FreePurpose["Process"] = "process";
|
|
36707
|
+
FreePurpose["Contact"] = "contact";
|
|
36708
|
+
FreePurpose["Closing"] = "closing";
|
|
36709
|
+
})(FreePurpose || (FreePurpose = {}));
|
|
36710
|
+
/**
|
|
36711
|
+
* The look's element styles a free node may wear, by type — a closed list (the contract has more, e.g. accordion parts,
|
|
36712
|
+
* which belong to their recipes). A word node wears one and changes what it needs on top. The spec holds each id to the
|
|
36713
|
+
* contract's `appliesTo` (`elementStylesFor`).
|
|
36714
|
+
*/
|
|
36715
|
+
const FREE_ELEMENT_STYLES = {
|
|
36716
|
+
[FreeNodeType.Section]: ['section'],
|
|
36717
|
+
[FreeNodeType.Container]: ['box', 'card', 'panel'],
|
|
36718
|
+
[FreeNodeType.Heading]: ['display', 'h1', 'h2', 'h3', 'eyebrow'],
|
|
36719
|
+
[FreeNodeType.Text]: ['lead', 'body', 'small', 'eyebrow'],
|
|
36720
|
+
[FreeNodeType.Button]: ['button-primary', 'button-secondary', 'button-ghost'],
|
|
36721
|
+
[FreeNodeType.Image]: ['media'],
|
|
36722
|
+
[FreeNodeType.Video]: ['media'],
|
|
36723
|
+
};
|
|
36724
|
+
/** The builder type each free type is stamped as (and whose element styles it may wear). */
|
|
36725
|
+
const FREE_BUILDER_TYPE = {
|
|
36726
|
+
[FreeNodeType.Section]: 'Section',
|
|
36727
|
+
[FreeNodeType.Container]: 'Container',
|
|
36728
|
+
[FreeNodeType.Heading]: 'Heading',
|
|
36729
|
+
[FreeNodeType.Text]: 'Text',
|
|
36730
|
+
[FreeNodeType.Button]: 'ButtonBlock',
|
|
36731
|
+
[FreeNodeType.Image]: 'Image',
|
|
36732
|
+
[FreeNodeType.Video]: 'Video',
|
|
36733
|
+
[FreeNodeType.Slot]: 'Container',
|
|
36734
|
+
};
|
|
36735
|
+
/** The one role a free node may carry: the heading a visitor reads first. */
|
|
36736
|
+
const FREE_LEAD_ROLE = 'lead';
|
|
36737
|
+
/** How a page treats its pictures — ONE word, recorded and shown (R-H8: information, never a gate). */
|
|
36738
|
+
var FreePictures;
|
|
36739
|
+
(function (FreePictures) {
|
|
36740
|
+
FreePictures["UniformGrid"] = "uniform-grid";
|
|
36741
|
+
FreePictures["EqualSquares"] = "equal-squares";
|
|
36742
|
+
FreePictures["OneFormat"] = "one-format";
|
|
36743
|
+
FreePictures["SingleLarge"] = "single-large";
|
|
36744
|
+
FreePictures["FullBleed"] = "full-bleed";
|
|
36745
|
+
FreePictures["Mixed"] = "mixed";
|
|
36746
|
+
FreePictures["None"] = "none";
|
|
36747
|
+
})(FreePictures || (FreePictures = {}));
|
|
36748
|
+
/** The product's breakpoints a free style layer is written at (`style-compiler/responsive.ts`): the wire asks two. */
|
|
36749
|
+
var FreeLayer;
|
|
36750
|
+
(function (FreeLayer) {
|
|
36751
|
+
FreeLayer["Phone"] = "mobile";
|
|
36752
|
+
FreeLayer["Tablet"] = "tablet";
|
|
36753
|
+
})(FreeLayer || (FreeLayer = {}));
|
|
36754
|
+
/** Layers a phone in portrait reaches (a `mobile` layer reaches `small` by the cascade). */
|
|
36755
|
+
const FREE_PHONE_LAYERS = ['mobile', 'small'];
|
|
36756
|
+
/** What triggers a free node's ONE move. */
|
|
36757
|
+
var FreeTrigger;
|
|
36758
|
+
(function (FreeTrigger) {
|
|
36759
|
+
FreeTrigger["Enter"] = "viewportEnter";
|
|
36760
|
+
FreeTrigger["Scroll"] = "scrollProgress";
|
|
36761
|
+
})(FreeTrigger || (FreeTrigger = {}));
|
|
36762
|
+
/**
|
|
36763
|
+
* The moves a free node may make — the product's own action words (actions-core `ELEMENT_ACTION_DESCRIPTORS`), each with
|
|
36764
|
+
* the one parameter the wire may set. A hover is a style state, never a move.
|
|
36765
|
+
*/
|
|
36766
|
+
const FREE_MOVES = {
|
|
36767
|
+
[FreeTrigger.Enter]: {
|
|
36768
|
+
fadeIn: {},
|
|
36769
|
+
moveUp: {},
|
|
36770
|
+
blurIn: {},
|
|
36771
|
+
zoomOut: {},
|
|
36772
|
+
clipReveal: { param: 'from', values: ['start', 'end', 'top', 'bottom', 'centre'] },
|
|
36773
|
+
revealText: { param: 'by', values: ['line', 'word'] },
|
|
36774
|
+
countUp: {},
|
|
36775
|
+
},
|
|
36776
|
+
[FreeTrigger.Scroll]: {
|
|
36777
|
+
parallax: { param: 'depth', values: ['back', 'front'] },
|
|
36778
|
+
},
|
|
36779
|
+
};
|
|
36780
|
+
/** The wire's node keys, in the order a model writes them. Every one is required. */
|
|
36781
|
+
const FREE_WIRE_NODE_KEYS = [
|
|
36782
|
+
'id', 'parent', 'type', 'purpose', 'style', 'level', 'role', 'text', 'src', 'href', 'slot', 'opts', 'base', 'phone', 'tablet', 'hover', 'motion',
|
|
36783
|
+
];
|
|
36784
|
+
const SEP = ':';
|
|
36785
|
+
const NONE = 'none';
|
|
36786
|
+
const ENTER = 'enter';
|
|
36787
|
+
const SCROLL = 'scroll';
|
|
36788
|
+
const TRIGGER_WORD = { [FreeTrigger.Enter]: ENTER, [FreeTrigger.Scroll]: SCROLL };
|
|
36789
|
+
/** Every move word the wire offers: `none`, `enter:<action>[:<value>]`, `scroll:parallax:<depth>`. */
|
|
36790
|
+
function freeMoveWords() {
|
|
36791
|
+
const out = [NONE];
|
|
36792
|
+
for (const trigger of Object.values(FreeTrigger)) {
|
|
36793
|
+
for (const [action, spec] of Object.entries(FREE_MOVES[trigger])) {
|
|
36794
|
+
if (spec.values?.length)
|
|
36795
|
+
for (const v of spec.values)
|
|
36796
|
+
out.push([TRIGGER_WORD[trigger], action, v].join(SEP));
|
|
36797
|
+
else
|
|
36798
|
+
out.push([TRIGGER_WORD[trigger], action].join(SEP));
|
|
36799
|
+
}
|
|
36800
|
+
}
|
|
36801
|
+
return out;
|
|
36802
|
+
}
|
|
36803
|
+
const FREE_STYLE_WORDS = [...new Set(Object.values(FREE_ELEMENT_STYLES).flat())];
|
|
36804
|
+
const text = (d) => ({ ...jsonText(), description: d });
|
|
36805
|
+
const oneOf = (values, d) => ({ ...jsonOneOf(values), description: d });
|
|
36806
|
+
const strings = (d) => ({ ...jsonListOf(jsonText()), description: d });
|
|
36807
|
+
const closed = (properties, d) => jsonClosedObject(properties, Object.keys(properties), d);
|
|
36808
|
+
/** The strict format of ONE free page (FS-D17): 23 properties, 0 optional, 0 unions. */
|
|
36809
|
+
function freeWireJsonSchema(options = {}) {
|
|
36810
|
+
const lang = options.language ?? 'the site\'s language';
|
|
36811
|
+
const node = closed({
|
|
36812
|
+
id: text('unique kebab-case id'),
|
|
36813
|
+
parent: text("the id of the Section or Container it sits in; '' for a Section (the top of the page). A parent is written before its children; siblings in reading order"),
|
|
36814
|
+
type: oneOf(Object.values(FreeNodeType), 'what the node is'),
|
|
36815
|
+
purpose: oneOf(['', ...Object.values(FreePurpose)], "a Section: what it is for; '' for every other node"),
|
|
36816
|
+
style: oneOf(['', ...FREE_STYLE_WORDS], "the look's element style it wears (a Heading, Text and Button always wear one); '' for none"),
|
|
36817
|
+
level: { ...jsonInteger(), description: 'a Heading: 1–4 (exactly one 1 on the page); 0 for other nodes' },
|
|
36818
|
+
role: oneOf(['', FREE_LEAD_ROLE], "'lead' on the heading a visitor reads first (in the first section); '' otherwise"),
|
|
36819
|
+
text: text(`the words (Heading, Text, Button), in ${lang}; '' for none`),
|
|
36820
|
+
src: oneOf(['', ...(options.material ?? [])], "an Image / Video: an id from the material; '' for none"),
|
|
36821
|
+
href: text("a Button: a page route of the site or '#<section id>'; '' for none"),
|
|
36822
|
+
slot: oneOf(['', ...(options.slots ?? [])], "a Slot: the part that stands here, placed and never built; '' for none"),
|
|
36823
|
+
opts: strings("a list Slot: how its items are shown, '<ingredient>:<word>'; [] for none"),
|
|
36824
|
+
base: strings("styles at every width, each '<property>:<value>' (camelCase, one plain value; a size relative to the width is cqi, never vw); [] for none"),
|
|
36825
|
+
phone: strings("the phone layer (≤ 767px), '<property>:<value>'; [] for none"),
|
|
36826
|
+
tablet: strings("the tablet layer (≤ 991px), '<property>:<value>'; [] for none"),
|
|
36827
|
+
hover: strings("on hover, '<property>:<value>' — transform, opacity or a colour token only; [] for none"),
|
|
36828
|
+
motion: oneOf(freeMoveWords(), 'its ONE entrance or scroll move, or none'),
|
|
36829
|
+
});
|
|
36830
|
+
return closed({
|
|
36831
|
+
read: closed({
|
|
36832
|
+
idea: text("one line: the page's idea"),
|
|
36833
|
+
why: text('one line: why it suits this owner'),
|
|
36834
|
+
followed: text(`ONE line the owner can read, in ${lang}: which of THEIR words this page followed, quoting them as written`),
|
|
36835
|
+
}),
|
|
36836
|
+
pictures: oneOf(Object.values(FreePictures), 'how the page treats its pictures, one word'),
|
|
36837
|
+
nodes: jsonListOf(node),
|
|
36838
|
+
}, 'one free page, flat');
|
|
36839
|
+
}
|
|
36840
|
+
const str = (v) => (typeof v === 'string' ? v : '');
|
|
36841
|
+
const list = (v) => (Array.isArray(v) ? v.filter((x) => typeof x === 'string') : []);
|
|
36842
|
+
const nodeAt = (i, id) => `nodes[${i}]${id ? ` ("${id}")` : ''}`;
|
|
36843
|
+
/** `["fontSize:4rem", …]` → a style map, split at each line's FIRST colon; a line with none is a fault. */
|
|
36844
|
+
function styleOf(lines, at, faults) {
|
|
36845
|
+
const out = {};
|
|
36846
|
+
list(lines).forEach((line, k) => {
|
|
36847
|
+
const i = line.indexOf(SEP);
|
|
36848
|
+
if (i <= 0)
|
|
36849
|
+
faults.push({ path: `${at}[${k}]`, message: `"${line}" — write each style as <property>:<value>` });
|
|
36850
|
+
else
|
|
36851
|
+
out[line.slice(0, i).trim()] = line.slice(i + 1).trim();
|
|
36852
|
+
});
|
|
36853
|
+
return out;
|
|
36854
|
+
}
|
|
36855
|
+
/** `enter:clipReveal:start` → a move; `none`, or a word the format does not hold, → none. */
|
|
36856
|
+
function freeMoveOf(word) {
|
|
36857
|
+
const [where, action, value] = String(word ?? '').split(SEP);
|
|
36858
|
+
const trigger = Object.keys(TRIGGER_WORD).find(t => TRIGGER_WORD[t] === where);
|
|
36859
|
+
const spec = trigger ? FREE_MOVES[trigger][action] : undefined;
|
|
36860
|
+
if (!trigger || !spec)
|
|
36861
|
+
return null;
|
|
36862
|
+
return { trigger, action, ...(spec.param && value ? { params: { [spec.param]: value } } : {}) };
|
|
36863
|
+
}
|
|
36864
|
+
/** A move → its wire word. */
|
|
36865
|
+
function freeMoveWord(move) {
|
|
36866
|
+
if (!move)
|
|
36867
|
+
return NONE;
|
|
36868
|
+
const value = Object.values(move.params ?? {})[0];
|
|
36869
|
+
return [TRIGGER_WORD[move.trigger], move.action, ...(value ? [value] : [])].join(SEP);
|
|
36870
|
+
}
|
|
36871
|
+
/**
|
|
36872
|
+
* The wire → the free tree. A node whose parent is not written before it, a top node that is not a Section, a child of a
|
|
36873
|
+
* node that holds none, a repeated id — each is a FAULT and the node is left out: never guessed, never repaired here.
|
|
36874
|
+
*/
|
|
36875
|
+
function expandFreeWire(wire) {
|
|
36876
|
+
const faults = [];
|
|
36877
|
+
const w = isPlainObject(wire) ? wire : {};
|
|
36878
|
+
const read = isPlainObject(w['read']) ? w['read'] : {};
|
|
36879
|
+
const sections = [];
|
|
36880
|
+
const made = new Map();
|
|
36881
|
+
const pathOf = new Map();
|
|
36882
|
+
const paths = {};
|
|
36883
|
+
(Array.isArray(w['nodes']) ? w['nodes'] : []).forEach((raw, i) => {
|
|
36884
|
+
if (!isPlainObject(raw)) {
|
|
36885
|
+
faults.push({ path: `nodes[${i}]`, message: 'not a node' });
|
|
36886
|
+
return;
|
|
36887
|
+
}
|
|
36888
|
+
const id = str(raw['id']);
|
|
36889
|
+
const at = nodeAt(i, id);
|
|
36890
|
+
const type = str(raw['type']);
|
|
36891
|
+
if (!Object.values(FreeNodeType).includes(type)) {
|
|
36892
|
+
faults.push({ path: at, message: `"${type}" is not a node type — ${Object.values(FreeNodeType).join(', ')}` });
|
|
36893
|
+
return;
|
|
36894
|
+
}
|
|
36895
|
+
if (!id || made.has(id)) {
|
|
36896
|
+
faults.push({ path: at, message: id ? `the id "${id}" is used twice` : 'every node needs its own id' });
|
|
36897
|
+
return;
|
|
36898
|
+
}
|
|
36899
|
+
const node = { id, type, styleProps: styleOf(raw['base'], `${at}.base`, faults) };
|
|
36900
|
+
if (type === FreeNodeType.Section)
|
|
36901
|
+
node.purpose = str(raw['purpose']);
|
|
36902
|
+
if (str(raw['style']))
|
|
36903
|
+
node.elementStyle = str(raw['style']);
|
|
36904
|
+
if (type === FreeNodeType.Heading)
|
|
36905
|
+
node.level = typeof raw['level'] === 'number' ? raw['level'] : 0;
|
|
36906
|
+
if (str(raw['role']))
|
|
36907
|
+
node.role = str(raw['role']);
|
|
36908
|
+
if (FREE_WORD_TYPES.includes(type))
|
|
36909
|
+
node.text = str(raw['text']);
|
|
36910
|
+
if (str(raw['src']))
|
|
36911
|
+
node.src = str(raw['src']);
|
|
36912
|
+
if (type === FreeNodeType.Button)
|
|
36913
|
+
node.href = str(raw['href']);
|
|
36914
|
+
if (type === FreeNodeType.Slot) {
|
|
36915
|
+
node.slot = str(raw['slot']);
|
|
36916
|
+
node.opts = list(raw['opts']);
|
|
36917
|
+
}
|
|
36918
|
+
const responsive = {};
|
|
36919
|
+
for (const [key, layer] of [['phone', FreeLayer.Phone], ['tablet', FreeLayer.Tablet]]) {
|
|
36920
|
+
const style = styleOf(raw[key], `${at}.${key}`, faults);
|
|
36921
|
+
if (Object.keys(style).length)
|
|
36922
|
+
responsive[layer] = style;
|
|
36923
|
+
}
|
|
36924
|
+
if (Object.keys(responsive).length)
|
|
36925
|
+
node.responsive = responsive;
|
|
36926
|
+
const hover = styleOf(raw['hover'], `${at}.hover`, faults);
|
|
36927
|
+
if (Object.keys(hover).length)
|
|
36928
|
+
node.hover = hover;
|
|
36929
|
+
const motion = str(raw['motion']);
|
|
36930
|
+
const move = freeMoveOf(motion);
|
|
36931
|
+
if (move)
|
|
36932
|
+
node.move = move;
|
|
36933
|
+
else if (motion && motion !== NONE)
|
|
36934
|
+
faults.push({ path: `${at}.motion`, message: `"${motion}" is not a move — ${freeMoveWords().join(', ')}` });
|
|
36935
|
+
const parentId = str(raw['parent']);
|
|
36936
|
+
if (!parentId) {
|
|
36937
|
+
if (type !== FreeNodeType.Section) {
|
|
36938
|
+
faults.push({ path: at, message: 'only a Section sits at the top of the page — give it a parent' });
|
|
36939
|
+
return;
|
|
36940
|
+
}
|
|
36941
|
+
pathOf.set(node, `sections[${sections.length}]`);
|
|
36942
|
+
sections.push(node);
|
|
36943
|
+
}
|
|
36944
|
+
else {
|
|
36945
|
+
const parent = made.get(parentId);
|
|
36946
|
+
if (!parent) {
|
|
36947
|
+
faults.push({ path: at, message: `its parent "${parentId}" is not written before it` });
|
|
36948
|
+
return;
|
|
36949
|
+
}
|
|
36950
|
+
if (!FREE_HOLDERS.includes(parent.type)) {
|
|
36951
|
+
faults.push({ path: at, message: `a ${parent.type} holds no children` });
|
|
36952
|
+
return;
|
|
36953
|
+
}
|
|
36954
|
+
if (type === FreeNodeType.Section) {
|
|
36955
|
+
faults.push({ path: at, message: 'a Section sits at the top of the page only — use a Container inside' });
|
|
36956
|
+
return;
|
|
36957
|
+
}
|
|
36958
|
+
(parent.children ??= []).push(node);
|
|
36959
|
+
pathOf.set(node, `${pathOf.get(parent)}.children[${parent.children.length - 1}]`);
|
|
36960
|
+
}
|
|
36961
|
+
made.set(id, node);
|
|
36962
|
+
paths[pathOf.get(node)] = i;
|
|
36963
|
+
});
|
|
36964
|
+
const page = {
|
|
36965
|
+
read: { idea: str(read['idea']), why: str(read['why']), followed: str(read['followed']) },
|
|
36966
|
+
pictures: str(w['pictures']),
|
|
36967
|
+
sections,
|
|
36968
|
+
};
|
|
36969
|
+
return { page, paths, faults };
|
|
36970
|
+
}
|
|
36971
|
+
function walkFree(sections) {
|
|
36972
|
+
const out = [];
|
|
36973
|
+
const visit = (node, path, section, up) => {
|
|
36974
|
+
out.push({ node, path, section, up });
|
|
36975
|
+
(node.children ?? []).forEach((c, i) => visit(c, `${path}.children[${i}]`, section, [...up, node]));
|
|
36976
|
+
};
|
|
36977
|
+
sections.forEach((s, i) => visit(s, `sections[${i}]`, i, []));
|
|
36978
|
+
return out;
|
|
36979
|
+
}
|
|
36980
|
+
const lines = (style) => Object.entries(style ?? {}).map(([k, v]) => `${k}${SEP}${v}`);
|
|
36981
|
+
/** The free tree → the wire (a ready-made place is left out: it is not the model's). */
|
|
36982
|
+
function freeToWire(page) {
|
|
36983
|
+
const nodes = walkFree(page.sections.filter(s => !s.readyMade)).map(({ node: n, up }) => ({
|
|
36984
|
+
id: n.id, parent: up.length ? up[up.length - 1].id : '', type: n.type, purpose: n.purpose ?? '', style: n.elementStyle ?? '',
|
|
36985
|
+
level: n.type === FreeNodeType.Heading ? n.level ?? 0 : 0, role: n.role ?? '', text: n.text ?? '', src: n.src ?? '', href: n.href ?? '',
|
|
36986
|
+
slot: n.slot ?? '', opts: [...(n.opts ?? [])], base: lines(n.styleProps), phone: lines(n.responsive?.[FreeLayer.Phone]),
|
|
36987
|
+
tablet: lines(n.responsive?.[FreeLayer.Tablet]), hover: lines(n.hover), motion: freeMoveWord(n.move),
|
|
36988
|
+
}));
|
|
36989
|
+
return { read: { ...page.read }, pictures: page.pictures, nodes };
|
|
36990
|
+
}
|
|
36991
|
+
/** A tree key → the wire key it came from. */
|
|
36992
|
+
const WIRE_KEY = [
|
|
36993
|
+
[`responsive.${FreeLayer.Phone}`, 'phone'],
|
|
36994
|
+
[`responsive.${FreeLayer.Tablet}`, 'tablet'],
|
|
36995
|
+
['responsive', 'phone'],
|
|
36996
|
+
['styleProps', 'base'],
|
|
36997
|
+
['hover', 'hover'],
|
|
36998
|
+
['move', 'motion'],
|
|
36999
|
+
['elementStyle', 'style'],
|
|
37000
|
+
['text', 'text'],
|
|
37001
|
+
['opts', 'opts'],
|
|
37002
|
+
];
|
|
37003
|
+
/**
|
|
37004
|
+
* A judge's path into the tree (`sections[0].children[1].styleProps.fontSize`) said against the wire
|
|
37005
|
+
* (`nodes[2] ("shop-title").base.fontSize`) — a repair names wire paths. A path that names no node stays as written.
|
|
37006
|
+
*/
|
|
37007
|
+
function freeWirePath(path, paths, wire) {
|
|
37008
|
+
const m = /^(sections\[\d+\](?:\.children\[\d+\])*)(?:\.(.*))?$/.exec(path);
|
|
37009
|
+
if (!m || paths[m[1]] === undefined)
|
|
37010
|
+
return path;
|
|
37011
|
+
const i = paths[m[1]];
|
|
37012
|
+
const rest = m[2] ?? '';
|
|
37013
|
+
const hit = WIRE_KEY.find(([k]) => rest === k || rest.startsWith(`${k}.`));
|
|
37014
|
+
const where = hit ? `.${hit[1]}${rest.length > hit[0].length ? rest.slice(hit[0].length) : ''}` : rest ? `.${rest}` : '';
|
|
37015
|
+
return `${nodeAt(i, wire.nodes?.[i]?.id ?? '')}${where}`;
|
|
37016
|
+
}
|
|
37017
|
+
/** A repair's edits remove a node: what sat inside it goes too, so no orphan is left. */
|
|
37018
|
+
function withoutFreeOrphans(wire) {
|
|
37019
|
+
const ids = new Set();
|
|
37020
|
+
const nodes = (wire.nodes ?? []).filter(n => {
|
|
37021
|
+
if (n?.parent && !ids.has(n.parent))
|
|
37022
|
+
return false;
|
|
37023
|
+
if (n?.id)
|
|
37024
|
+
ids.add(n.id);
|
|
37025
|
+
return true;
|
|
37026
|
+
});
|
|
37027
|
+
return { ...wire, nodes };
|
|
37028
|
+
}
|
|
37029
|
+
|
|
37030
|
+
/**
|
|
37031
|
+
* THE FREE PAGE'S JUDGE (award plan §11.4 gates 1 + 2, FS3): every reason a free page may not be stamped, path first,
|
|
37032
|
+
* in words the model can act on in its one repair. It judges SAFETY, LAW and TRUTH — never taste (R-H18): what is the
|
|
37033
|
+
* look's stays a token (R-H1), a phone layer exists where a phone needs one (R-H4), no fact is invented (R-H6, the ONE
|
|
37034
|
+
* `factIssues`), only what exists is named (R-H2), the words read on their ground (R-H12), and the answer says which of
|
|
37035
|
+
* the owner's words it followed (R-H17). A place the fall back gave to a ready-made section (`readyMade`) is the plan's,
|
|
37036
|
+
* not the model's: it is skipped, and the page rules that section would answer are relaxed. Pure.
|
|
37037
|
+
*/
|
|
37038
|
+
var FreeIssueCode;
|
|
37039
|
+
(function (FreeIssueCode) {
|
|
37040
|
+
/** The page's structure: section count, ids, nesting, h1, lead, a closing action, a phone layout. */
|
|
37041
|
+
FreeIssueCode["Structure"] = "structure";
|
|
37042
|
+
/** A word node's words or element style. */
|
|
37043
|
+
FreeIssueCode["Words"] = "words";
|
|
37044
|
+
/** A style: a property outside the list, a value that is not one plain value, a side that is not start / end. */
|
|
37045
|
+
FreeIssueCode["Style"] = "style";
|
|
37046
|
+
/** A value the look owns written as something other than its token. */
|
|
37047
|
+
FreeIssueCode["Token"] = "token";
|
|
37048
|
+
/** A node a phone cannot hold as written, with no phone layer. */
|
|
37049
|
+
FreeIssueCode["Phone"] = "phone";
|
|
37050
|
+
/** A move: not the product's, two on a node, on the wrong node. */
|
|
37051
|
+
FreeIssueCode["Motion"] = "motion";
|
|
37052
|
+
/** A fact the owner never gave, a material id, a slot or a link that does not exist. */
|
|
37053
|
+
FreeIssueCode["Content"] = "content";
|
|
37054
|
+
/** Words that do not read on their ground (AA). */
|
|
37055
|
+
FreeIssueCode["Contrast"] = "contrast";
|
|
37056
|
+
/** The followed line is missing or quotes none of the owner's words. */
|
|
37057
|
+
FreeIssueCode["Prompt"] = "prompt";
|
|
37058
|
+
})(FreeIssueCode || (FreeIssueCode = {}));
|
|
37059
|
+
/** A free page is this many sections. */
|
|
37060
|
+
const FREE_SECTIONS = { min: 4, max: 9 };
|
|
37061
|
+
/** Above this, a node needs its own phone layer. */
|
|
37062
|
+
const FREE_PHONE_LIMITS = { width: 340, fontSize: 44, turn: 8 };
|
|
37063
|
+
/** WCAG AA: words, and large words (display, h1, h2). */
|
|
37064
|
+
const FREE_CONTRAST = { text: 4.5, large: 3 };
|
|
37065
|
+
const LARGE_STYLES = ['display', 'h1', 'h2'];
|
|
37066
|
+
/** The style properties whose value is the LOOK's: a token of this type, or one of the listed plain words. */
|
|
37067
|
+
const FREE_TOKEN_PROPS = {
|
|
37068
|
+
color: 'color', backgroundColor: 'color', borderColor: 'color', outlineColor: 'color', textDecorationColor: 'color',
|
|
37069
|
+
fontFamily: 'font', borderRadius: 'radius', boxShadow: 'shadow', transitionDuration: 'duration', transitionTimingFunction: 'easing',
|
|
37070
|
+
};
|
|
37071
|
+
const TOKEN_PLAIN = {
|
|
37072
|
+
color: ['transparent', 'currentColor', 'inherit'], font: ['inherit'], radius: ['0', '0px', '50%'], shadow: ['none'], duration: [], easing: [],
|
|
37073
|
+
};
|
|
37074
|
+
/** A colour token may be either of these token types. */
|
|
37075
|
+
const COLOUR_TYPES = ['color', 'paint'];
|
|
37076
|
+
/** The free properties: geometry, arrangement, type scale and rhythm, clipping, blending. */
|
|
37077
|
+
const FREE_STYLE_PROPS = [
|
|
37078
|
+
'display', 'position', 'top', 'bottom', 'insetInlineStart', 'insetInlineEnd', 'zIndex', 'order',
|
|
37079
|
+
'width', 'minWidth', 'maxWidth', 'height', 'minHeight', 'maxHeight', 'aspectRatio', 'overflow',
|
|
37080
|
+
'margin', 'marginTop', 'marginBottom', 'marginInlineStart', 'marginInlineEnd', 'marginInline', 'marginBlock',
|
|
37081
|
+
'padding', 'paddingTop', 'paddingBottom', 'paddingInlineStart', 'paddingInlineEnd', 'paddingInline', 'paddingBlock',
|
|
37082
|
+
'gridTemplateColumns', 'gridTemplateRows', 'gridColumn', 'gridRow', 'gap', 'rowGap', 'columnGap',
|
|
37083
|
+
'flexDirection', 'flexWrap', 'flex', 'alignItems', 'alignContent', 'justifyContent', 'alignSelf', 'justifySelf', 'placeItems', 'placeSelf',
|
|
37084
|
+
'fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'textTransform', 'textAlign', 'fontStyle', 'textWrap', 'whiteSpace',
|
|
37085
|
+
'translateX', 'translateY', 'rotate', 'scaleX', 'scaleY', 'transformOrigin',
|
|
37086
|
+
'clipPath', 'opacity', 'mixBlendMode', 'objectFit', 'objectPosition', 'borderWidth', 'borderStyle', 'filter', 'backdropFilter',
|
|
37087
|
+
];
|
|
37088
|
+
/** A hover changes position, scale, turn, opacity or a colour token — never layout (Emil: transform / opacity only). */
|
|
37089
|
+
const FREE_HOVER_PROPS = ['translateX', 'translateY', 'scaleX', 'scaleY', 'rotate', 'opacity', 'color', 'backgroundColor', 'borderColor', 'boxShadow'];
|
|
37090
|
+
const PHYSICAL = /^(left|right|marginLeft|marginRight|paddingLeft|paddingRight|borderLeft.*|borderRight.*|insetLeft|insetRight)$/;
|
|
37091
|
+
const UNSAFE = /[;{}<>\\]|!important|url\s*\(|expression|@import|javascript:/i;
|
|
37092
|
+
const LITERAL_COLOUR = /#[0-9a-f]{3,8}\b|\b(rgb|rgba|hsl|hsla|oklch|oklab|lab|lch|hwb)\s*\(/i;
|
|
37093
|
+
const NAMED_COLOUR = /\b(white|black|red|blue|green|yellow|orange|purple|pink|gray|grey|gold|navy|teal|beige|ivory|cream)\b/i;
|
|
37094
|
+
const TOKEN_REF = /var\(\s*--iox-([a-z0-9-]+)\s*(?:,[^)]*)?\)/g;
|
|
37095
|
+
const ONE_TOKEN = /^var\(--iox-([a-z0-9-]+)\)$/;
|
|
37096
|
+
const COLOUR_MIX = /^color-mix\(in (oklab|srgb), var\(--iox-[a-z0-9-]+\) \d{1,3}%, transparent\)$/;
|
|
37097
|
+
const ANCHOR = /^#[a-z][\w-]*$/;
|
|
37098
|
+
/** FS-T5: a size relative to the WINDOW's width (vw and its kin) — on the canvas, a transformed frame, the window is not
|
|
37099
|
+
* the page. A size relative to the width is `cqi` (the page's / section's inline size), and only `cqi`. */
|
|
37100
|
+
const WINDOW_WIDTH_UNIT = /(-?\d*\.?\d+)(?:[dsl]?vw|[dsl]?vi|[dsl]?vmin|[dsl]?vmax)(?![a-z])/i;
|
|
37101
|
+
const OTHER_CQ_UNIT = /(-?\d*\.?\d+)(?:cqw|cqh|cqb|cqmin|cqmax)(?![a-z])/i;
|
|
37102
|
+
const A_NUMBER = /^\D{0,3}\d[\d,.]*\D{0,3}$/;
|
|
37103
|
+
/** The ground a page paints when no node does. */
|
|
37104
|
+
const PAGE_GROUND = 'page-bg';
|
|
37105
|
+
const tokensIn = (v) => [...v.matchAll(TOKEN_REF)].map(m => m[1]);
|
|
37106
|
+
const oneToken = (v) => ONE_TOKEN.exec(String(v ?? '').trim())?.[1];
|
|
37107
|
+
const px = (v) => { const m = /^(-?[\d.]+)px$/.exec(String(v ?? '').trim()); return m ? Number(m[1]) : null; };
|
|
37108
|
+
const columnsOf = (v) => {
|
|
37109
|
+
const s = String(v ?? '').trim();
|
|
37110
|
+
const rep = /repeat\(\s*(\d+)/.exec(s);
|
|
37111
|
+
return rep ? Number(rep[1]) : s.split(/\s+(?![^(]*\))/).filter(Boolean).length;
|
|
37112
|
+
};
|
|
37113
|
+
const hasPhoneLayer = (n) => FREE_PHONE_LAYERS.some(bp => Object.keys(n.responsive?.[bp] ?? {}).length > 0);
|
|
37114
|
+
/** One style map against the rules: a known property, one clean value, the look's token where the look owns it. */
|
|
37115
|
+
function freeStyleIssues(style, path, ctx) {
|
|
37116
|
+
const out = [];
|
|
37117
|
+
const types = new Map(ctx.tokens.map(t => [t.name, t.type]));
|
|
37118
|
+
const say = (code, prop, message) => out.push({ code, path: `${path}.${prop}`, message });
|
|
37119
|
+
for (const [prop, raw] of Object.entries(style ?? {})) {
|
|
37120
|
+
const v = String(raw).trim();
|
|
37121
|
+
const kind = FREE_TOKEN_PROPS[prop];
|
|
37122
|
+
if (PHYSICAL.test(prop)) {
|
|
37123
|
+
say(FreeIssueCode.Style, prop, 'write sides as start / end (insetInlineStart, marginInlineEnd …) — the site also runs right to left');
|
|
37124
|
+
continue;
|
|
37125
|
+
}
|
|
37126
|
+
if (!kind && !FREE_STYLE_PROPS.includes(prop)) {
|
|
37127
|
+
say(FreeIssueCode.Style, prop, 'not a style property this language has');
|
|
37128
|
+
continue;
|
|
37129
|
+
}
|
|
37130
|
+
if (!v || UNSAFE.test(v)) {
|
|
37131
|
+
say(FreeIssueCode.Style, prop, 'a value is one plain value — no url(), no ; { } !important');
|
|
37132
|
+
continue;
|
|
37133
|
+
}
|
|
37134
|
+
if (prop === 'textAlign' && /^(left|right)$/.test(v)) {
|
|
37135
|
+
say(FreeIssueCode.Style, prop, 'start | end | center');
|
|
37136
|
+
continue;
|
|
37137
|
+
}
|
|
37138
|
+
const win = WINDOW_WIDTH_UNIT.exec(v);
|
|
37139
|
+
if (win) {
|
|
37140
|
+
say(FreeIssueCode.Style, prop, `"${win[0]}" follows the window, not the page — a size relative to the width is cqi: ${win[1]}cqi`);
|
|
37141
|
+
continue;
|
|
37142
|
+
}
|
|
37143
|
+
const cq = OTHER_CQ_UNIT.exec(v);
|
|
37144
|
+
if (cq) {
|
|
37145
|
+
say(FreeIssueCode.Style, prop, `"${cq[0]}" — a size relative to the width is cqi only: ${cq[1]}cqi`);
|
|
37146
|
+
continue;
|
|
37147
|
+
}
|
|
37148
|
+
if (LITERAL_COLOUR.test(v) || (kind === 'color' && NAMED_COLOUR.test(v))) {
|
|
37149
|
+
say(FreeIssueCode.Token, prop, 'a literal colour — colours are the look\'s tokens: var(--iox-<colour token>)');
|
|
37150
|
+
continue;
|
|
37151
|
+
}
|
|
37152
|
+
if (!kind)
|
|
37153
|
+
continue;
|
|
37154
|
+
const named = tokensIn(v);
|
|
37155
|
+
const plain = TOKEN_PLAIN[kind].includes(v);
|
|
37156
|
+
const mixed = kind === 'color' && COLOUR_MIX.test(v);
|
|
37157
|
+
if (!plain && !mixed && !(named.length === 1 && v === `var(--iox-${named[0]})`)) {
|
|
37158
|
+
const words = TOKEN_PLAIN[kind].length ? ` or ${TOKEN_PLAIN[kind].join(' / ')}` : '';
|
|
37159
|
+
say(FreeIssueCode.Token, prop, `the look owns this — var(--iox-<${kind} token>)${words}${kind === 'color' ? ', or color-mix(in oklab, var(--iox-…) N%, transparent)' : ''}`);
|
|
37160
|
+
continue;
|
|
37161
|
+
}
|
|
37162
|
+
for (const name of named) {
|
|
37163
|
+
const type = types.get(name);
|
|
37164
|
+
const fits = kind === 'color' ? COLOUR_TYPES.includes(type ?? '') : type === kind;
|
|
37165
|
+
if (!fits)
|
|
37166
|
+
say(FreeIssueCode.Token, prop, `--iox-${name} is ${type ? `a ${type} token` : 'not a token of this look'} — a ${kind} token belongs here`);
|
|
37167
|
+
}
|
|
37168
|
+
}
|
|
37169
|
+
return out;
|
|
37170
|
+
}
|
|
37171
|
+
/** Every reason a free page may not be stamped (gate 1), contrast included (gate 2's tree half). */
|
|
37172
|
+
function checkFree(page, ctx) {
|
|
37173
|
+
return judgeFree(page, ctx, false);
|
|
37174
|
+
}
|
|
37175
|
+
/**
|
|
37176
|
+
* FS-D19 Basic: ONE free signature section on a page otherwise made of the plan's ready-made sections. The answer is a
|
|
37177
|
+
* free page holding one Section; it is judged in its place (`at`) among the plan's sections — so the page rules hold
|
|
37178
|
+
* for the page as the visitor sees it (a ready-made opening carries the h1 and the lead, a ready-made close the action;
|
|
37179
|
+
* the section count is the plan's) — and every issue is said against the answer (`sections[0]…`), for its one repair.
|
|
37180
|
+
*/
|
|
37181
|
+
function checkFreeSection(answer, ctx, place) {
|
|
37182
|
+
const sections = Array.isArray(answer?.sections) ? answer.sections : [];
|
|
37183
|
+
if (sections.length !== 1 || place.at < 0 || place.at >= place.plan.length) {
|
|
37184
|
+
return [{ code: FreeIssueCode.Structure, path: 'sections', message: `a signature section is ONE Section (this answer has ${sections.length})` }];
|
|
37185
|
+
}
|
|
37186
|
+
const page = freeSignaturePage(answer, place.plan, place.at);
|
|
37187
|
+
const here = `sections[${place.at}]`;
|
|
37188
|
+
return judgeFree(page, ctx, true).map(i => ({ ...i, path: i.path === here || i.path.startsWith(`${here}.`) ? `sections[0]${i.path.slice(here.length)}` : i.path }));
|
|
37189
|
+
}
|
|
37190
|
+
/** The page a signature section stands in: the plan's ready-made sections, the free one at `at` in place of that one. */
|
|
37191
|
+
function freeSignaturePage(answer, plan, at) {
|
|
37192
|
+
return {
|
|
37193
|
+
...answer,
|
|
37194
|
+
sections: plan.map((p, i) => (i === at ? answer.sections[0] : { id: `ready-${i}`, type: FreeNodeType.Section, styleProps: {}, readyMade: { at: i, pattern: p.pattern } })),
|
|
37195
|
+
};
|
|
37196
|
+
}
|
|
37197
|
+
function judgeFree(page, ctx, signature) {
|
|
37198
|
+
const issues = [];
|
|
37199
|
+
const say = (code, path, message) => issues.push({ code, path, message });
|
|
37200
|
+
const sections = Array.isArray(page?.sections) ? page.sections : [];
|
|
37201
|
+
if (!signature && (sections.length < FREE_SECTIONS.min || sections.length > FREE_SECTIONS.max))
|
|
37202
|
+
say(FreeIssueCode.Structure, 'sections', `a page is ${FREE_SECTIONS.min} to ${FREE_SECTIONS.max} sections (this one has ${sections.length})`);
|
|
37203
|
+
const ready = (i) => !!sections[i]?.readyMade;
|
|
37204
|
+
const walked = walkFree(sections).filter(w => !ready(w.section));
|
|
37205
|
+
const ids = new Set(walkFree(sections).map(w => w.node.id));
|
|
37206
|
+
const seen = new Set();
|
|
37207
|
+
const texts = [];
|
|
37208
|
+
let h1 = 0;
|
|
37209
|
+
for (const { node, path, up } of walked) {
|
|
37210
|
+
if (!Object.values(FreeNodeType).includes(node.type)) {
|
|
37211
|
+
say(FreeIssueCode.Structure, path, `"${node.type}" is not a node type — ${Object.values(FreeNodeType).join(', ')}`);
|
|
37212
|
+
continue;
|
|
37213
|
+
}
|
|
37214
|
+
if (!node.id || seen.has(node.id))
|
|
37215
|
+
say(FreeIssueCode.Structure, path, node.id ? `the id "${node.id}" is used twice` : 'every node needs its own id');
|
|
37216
|
+
seen.add(node.id);
|
|
37217
|
+
if ((node.type === FreeNodeType.Section) !== (up.length === 0))
|
|
37218
|
+
say(FreeIssueCode.Structure, path, up.length ? 'a Section sits at the top of the page only — use a Container inside' : 'the top of the page holds Sections only');
|
|
37219
|
+
if (node.type === FreeNodeType.Section && !Object.values(FreePurpose).includes(node.purpose))
|
|
37220
|
+
say(FreeIssueCode.Structure, path, `a section says what it is for — purpose: ${Object.values(FreePurpose).join(' | ')}`);
|
|
37221
|
+
if (node.children?.length && !FREE_HOLDERS.includes(node.type))
|
|
37222
|
+
say(FreeIssueCode.Structure, path, `a ${node.type} holds no children`);
|
|
37223
|
+
const styles = FREE_ELEMENT_STYLES[node.type] ?? [];
|
|
37224
|
+
if (node.elementStyle && !styles.includes(node.elementStyle))
|
|
37225
|
+
say(FreeIssueCode.Words, `${path}.elementStyle`, styles.length ? `"${node.elementStyle}" is not a style a ${node.type} wears — ${styles.join(', ')}` : `a ${node.type} wears no element style`);
|
|
37226
|
+
if (FREE_WORD_TYPES.includes(node.type)) {
|
|
37227
|
+
if (!String(node.text ?? '').trim())
|
|
37228
|
+
say(FreeIssueCode.Words, `${path}.text`, 'its words are missing');
|
|
37229
|
+
else
|
|
37230
|
+
texts.push({ path: `${path}.text`, text: String(node.text) });
|
|
37231
|
+
if (!node.elementStyle)
|
|
37232
|
+
say(FreeIssueCode.Words, `${path}.elementStyle`, `a ${node.type} wears one of the look's element styles (${styles.join(', ')}) and changes what it needs on top`);
|
|
37233
|
+
if (node.type === FreeNodeType.Heading) {
|
|
37234
|
+
if (!Number.isInteger(node.level) || node.level < 1 || node.level > 4)
|
|
37235
|
+
say(FreeIssueCode.Words, `${path}.level`, 'a Heading is level 1 to 4');
|
|
37236
|
+
if (node.level === 1)
|
|
37237
|
+
h1++;
|
|
37238
|
+
}
|
|
37239
|
+
if (node.type === FreeNodeType.Button && !ctx.pages.includes(node.href ?? '') && !(ANCHOR.test(node.href ?? '') && ids.has(node.href.slice(1)))) {
|
|
37240
|
+
say(FreeIssueCode.Content, `${path}.href`, `a button goes to a page of this site (${ctx.pages.join(', ')}) or to a section of this page (#id)`);
|
|
35577
37241
|
}
|
|
35578
|
-
if (!l.bleed && (l.words.l < -2 || l.words.r > m.width + 2))
|
|
35579
|
-
say(`off:${l.path}:${on}`, l.path, `${l.path}: its words run off the ${on} screen`);
|
|
35580
37242
|
}
|
|
35581
|
-
if (
|
|
35582
|
-
|
|
35583
|
-
|
|
35584
|
-
|
|
35585
|
-
|
|
35586
|
-
|
|
37243
|
+
if (node.role && (node.role !== FREE_LEAD_ROLE || node.type !== FreeNodeType.Heading))
|
|
37244
|
+
say(FreeIssueCode.Structure, `${path}.role`, 'role "lead" is for the heading a visitor reads first');
|
|
37245
|
+
if (node.type === FreeNodeType.Image || node.type === FreeNodeType.Video) {
|
|
37246
|
+
const m = ctx.material[node.src ?? ''];
|
|
37247
|
+
if (!m)
|
|
37248
|
+
say(FreeIssueCode.Content, `${path}.src`, `"${node.src ?? ''}" is not in the material — use an id from the list`);
|
|
37249
|
+
else if ((node.type === FreeNodeType.Video) !== (m.kind === 'video'))
|
|
37250
|
+
say(FreeIssueCode.Content, `${path}.src`, `"${node.src}" is a${m.kind === 'image' ? 'n image' : ' video'} — ${node.type === FreeNodeType.Video ? 'a Video plays a video' : 'an Image shows a picture'}`);
|
|
37251
|
+
}
|
|
37252
|
+
if (node.type === FreeNodeType.Slot) {
|
|
37253
|
+
const offer = ctx.slots?.[node.slot ?? ''];
|
|
37254
|
+
if (!offer)
|
|
37255
|
+
say(FreeIssueCode.Content, `${path}.slot`, `"${node.slot ?? ''}" is not a part this page may place — ${Object.keys(ctx.slots ?? {}).join(', ') || 'none'}`);
|
|
37256
|
+
else
|
|
37257
|
+
for (const [k, o] of (node.opts ?? []).entries())
|
|
37258
|
+
if (!(offer.opts ?? []).includes(o))
|
|
37259
|
+
say(FreeIssueCode.Content, `${path}.opts[${k}]`, `"${o}" is not how this part may show — ${(offer.opts ?? []).join(', ') || 'no options'}`);
|
|
37260
|
+
}
|
|
37261
|
+
else if (node.slot || node.opts?.length)
|
|
37262
|
+
say(FreeIssueCode.Structure, path, 'only a Slot places a part');
|
|
37263
|
+
// styles, layer by layer
|
|
37264
|
+
issues.push(...freeStyleIssues(node.styleProps, `${path}.styleProps`, ctx));
|
|
37265
|
+
for (const [bp, style] of Object.entries(node.responsive ?? {})) {
|
|
37266
|
+
if (!Object.values(FreeLayer).includes(bp)) {
|
|
37267
|
+
say(FreeIssueCode.Style, `${path}.responsive.${bp}`, `not a width — ${Object.values(FreeLayer).join(', ')}`);
|
|
37268
|
+
continue;
|
|
37269
|
+
}
|
|
37270
|
+
issues.push(...freeStyleIssues(style, `${path}.responsive.${bp}`, ctx));
|
|
37271
|
+
}
|
|
37272
|
+
for (const prop of Object.keys(node.hover ?? {}))
|
|
37273
|
+
if (!FREE_HOVER_PROPS.includes(prop))
|
|
37274
|
+
say(FreeIssueCode.Style, `${path}.hover.${prop}`, `a hover changes position, scale, turn, opacity or a colour token only (${FREE_HOVER_PROPS.join(', ')}) — never layout`);
|
|
37275
|
+
issues.push(...freeStyleIssues(Object.fromEntries(Object.entries(node.hover ?? {}).filter(([p]) => FREE_HOVER_PROPS.includes(p))), `${path}.hover`, ctx));
|
|
37276
|
+
// the one move
|
|
37277
|
+
if (node.move) {
|
|
37278
|
+
const spec = FREE_MOVES[node.move.trigger]?.[node.move.action];
|
|
37279
|
+
if (!spec)
|
|
37280
|
+
say(FreeIssueCode.Motion, `${path}.move`, `under ${node.move.trigger} one of: ${Object.keys(FREE_MOVES[node.move.trigger] ?? {}).join(', ')}`);
|
|
37281
|
+
else {
|
|
37282
|
+
const value = spec.param ? node.move.params?.[spec.param] : undefined;
|
|
37283
|
+
if (spec.param && value !== undefined && !spec.values?.includes(value))
|
|
37284
|
+
say(FreeIssueCode.Motion, `${path}.move`, `${spec.param} is one of ${spec.values?.join(', ')}`);
|
|
37285
|
+
if (node.move.action === 'revealText' && node.type !== FreeNodeType.Heading && node.type !== FreeNodeType.Text)
|
|
37286
|
+
say(FreeIssueCode.Motion, `${path}.move`, 'revealText lights words — on a Heading or a Text');
|
|
37287
|
+
if (node.move.action === 'countUp' && !A_NUMBER.test(String(node.text ?? '').trim()))
|
|
37288
|
+
say(FreeIssueCode.Motion, `${path}.move`, 'countUp counts a number — on a Heading or Text whose words ARE a number the owner gave');
|
|
37289
|
+
if (node.move.trigger === FreeTrigger.Scroll && up.length === 0)
|
|
37290
|
+
say(FreeIssueCode.Motion, `${path}.move`, 'a whole section never travels with the scroll — move a layer inside it');
|
|
35587
37291
|
}
|
|
35588
37292
|
}
|
|
35589
|
-
|
|
35590
|
-
|
|
37293
|
+
// the phone: anything a 390px screen cannot hold as written needs its own layer
|
|
37294
|
+
const base = node.styleProps ?? {};
|
|
37295
|
+
const needs = [];
|
|
37296
|
+
if (base['gridTemplateColumns'] && columnsOf(base['gridTemplateColumns']) >= 2)
|
|
37297
|
+
needs.push('its columns');
|
|
37298
|
+
if (base['position'] === 'absolute')
|
|
37299
|
+
needs.push('its absolute place');
|
|
37300
|
+
if ((px(base['width']) ?? 0) > FREE_PHONE_LIMITS.width || (px(base['minWidth']) ?? 0) > FREE_PHONE_LIMITS.width)
|
|
37301
|
+
needs.push('its fixed width');
|
|
37302
|
+
if ((px(base['fontSize']) ?? 0) > FREE_PHONE_LIMITS.fontSize)
|
|
37303
|
+
needs.push('its type size (or write it as clamp(min, cqi, max))');
|
|
37304
|
+
if (base['rotate'] && FREE_WORD_TYPES.includes(node.type) && Math.abs(parseFloat(base['rotate'])) > FREE_PHONE_LIMITS.turn)
|
|
37305
|
+
needs.push('its turn');
|
|
37306
|
+
if (needs.length && !hasPhoneLayer(node))
|
|
37307
|
+
say(FreeIssueCode.Phone, `${path}.responsive`, `needs a phone layer for ${needs.join(', ')}`);
|
|
37308
|
+
}
|
|
37309
|
+
// facts: the ONE judge, numbers included (R-H6)
|
|
37310
|
+
for (const i of factIssues(texts, { avoidWords: ctx.avoidWords ?? [], facts: ctx.facts, known: ctx.known, numbers: true, quotes: true }))
|
|
37311
|
+
say(FreeIssueCode.Content, i.path, i.message);
|
|
37312
|
+
// the page
|
|
37313
|
+
const openingReady = ready(0);
|
|
37314
|
+
if (openingReady ? h1 !== 0 : h1 !== 1)
|
|
37315
|
+
say(FreeIssueCode.Structure, 'sections', openingReady ? 'the opening carries the page\'s level-1 heading — use level 2 or lower' : `a page has exactly one Heading of level 1 (this one has ${h1})`);
|
|
37316
|
+
if (sections[0] && !openingReady && !walkFree([sections[0]]).some(w => w.node.role === FREE_LEAD_ROLE))
|
|
37317
|
+
say(FreeIssueCode.Structure, 'sections[0]', 'the first section names its lead — role "lead" on the heading a visitor reads first');
|
|
37318
|
+
sections.forEach((s, i) => {
|
|
37319
|
+
if (!ready(i) && !walkFree([s]).some(w => hasPhoneLayer(w.node)))
|
|
37320
|
+
say(FreeIssueCode.Phone, `sections[${i}]`, 'a phone layout is required — at least one node of every section carries a phone layer');
|
|
37321
|
+
});
|
|
37322
|
+
const last = sections.length - 1;
|
|
37323
|
+
if (last >= 0 && !ready(last) && !walkFree([sections[last]]).some(w => w.node.type === FreeNodeType.Button))
|
|
37324
|
+
say(FreeIssueCode.Structure, `sections[${last}]`, 'the page ends on something to do — a Button in the last section');
|
|
37325
|
+
const hasVideos = Object.values(ctx.material).some(m => m.kind === 'video');
|
|
37326
|
+
if (ctx.home && hasVideos && !sections.some(s => s.readyMade) && !walked.some(w => w.node.type === FreeNodeType.Video))
|
|
37327
|
+
say(FreeIssueCode.Content, 'sections', 'this business has videos — the home page plays at least one (a Video node)');
|
|
37328
|
+
if (!Object.values(FreePictures).includes(page?.pictures))
|
|
37329
|
+
say(FreeIssueCode.Structure, 'pictures', `one word: ${Object.values(FreePictures).join(', ')}`);
|
|
37330
|
+
issues.push(...followedIssues(page, ctx));
|
|
37331
|
+
issues.push(...freeContrastIssues(page, ctx));
|
|
37332
|
+
return issues;
|
|
37333
|
+
}
|
|
37334
|
+
/**
|
|
37335
|
+
* THE OWNER'S PROMPT LEADS (§11.4a, R-H17): the followed line is there, and — when the reading took words from the prompt
|
|
37336
|
+
* — it quotes at least one AS WRITTEN. Never a judgement of taste.
|
|
37337
|
+
*/
|
|
37338
|
+
function followedIssues(page, ctx) {
|
|
37339
|
+
const line = String(page?.read?.followed ?? '').trim();
|
|
37340
|
+
if (!line)
|
|
37341
|
+
return [{ code: FreeIssueCode.Prompt, path: 'read.followed', message: 'say in one line the owner can read which of their words this page followed' }];
|
|
37342
|
+
const said = (ctx.said ?? []).map(w => String(w).trim()).filter(Boolean);
|
|
37343
|
+
const lower = line.toLowerCase();
|
|
37344
|
+
if (said.length && !said.some(w => lower.includes(w.toLowerCase()))) {
|
|
37345
|
+
return [{ code: FreeIssueCode.Prompt, path: 'read.followed', message: `the line names none of the owner's own words — quote at least one as they wrote it (${said.slice(0, 6).join(', ')})` }];
|
|
35591
37346
|
}
|
|
35592
|
-
|
|
35593
|
-
|
|
35594
|
-
|
|
35595
|
-
|
|
35596
|
-
|
|
35597
|
-
|
|
37347
|
+
return [];
|
|
37348
|
+
}
|
|
37349
|
+
/** The token a node's words are painted in: its own colour, else its element style's; `inherit` reads up the tree. */
|
|
37350
|
+
function inkOf(node, up) {
|
|
37351
|
+
for (const n of [node, ...[...up].reverse()]) {
|
|
37352
|
+
const v = n.styleProps?.['color'] ?? elementStyleById(n.elementStyle)?.base['color'];
|
|
37353
|
+
if (v === undefined || v === 'inherit' || v === 'currentColor')
|
|
35598
37354
|
continue;
|
|
35599
|
-
|
|
35600
|
-
const need = big ? RENDER_CHECK.contrastLarge : RENDER_CHECK.contrastBody;
|
|
35601
|
-
const r = ratio(relativeLuminance(colour), px.luminance);
|
|
35602
|
-
if (r < need)
|
|
35603
|
-
say(`contrast:${px.path}`, px.path, `${px.path}: ${r.toFixed(1)}:1 against the photo behind it on the ${px.viewport} (needs ${need}) — another colour, a calm part, or off the photo`);
|
|
35604
|
-
else if (px.spread > RENDER_CHECK.busy)
|
|
35605
|
-
say(`busy:${px.path}`, px.path, `${px.path}: sits on a busy part of a photo on the ${px.viewport} (light varies ${px.spread.toFixed(2)}) — move it to a calm part or onto the ground`);
|
|
37355
|
+
return oneToken(v);
|
|
35606
37356
|
}
|
|
35607
|
-
return
|
|
37357
|
+
return 'text';
|
|
35608
37358
|
}
|
|
35609
|
-
|
|
35610
37359
|
/**
|
|
35611
|
-
*
|
|
35612
|
-
*
|
|
35613
|
-
* back whole: each section an issue names is given to the plan's READY-MADE section for the same place (the pattern the
|
|
35614
|
-
* whole-page fallback would have stamped there, worn in the same look), or dropped where none fits and the page keeps its
|
|
35615
|
-
* opening and its close. Then the page is judged again, once, exactly like any composed page — its MINIMUMS on the model's
|
|
35616
|
-
* own remaining sections (the given-away ones ride on `page.givenAway`; iox-ui#67, Doron 2026-11-09), its maximums on the
|
|
35617
|
-
* whole page. A ready-made section that would say again what a section the model kept already says (its title, its text —
|
|
35618
|
-
* iox-ui#68) is never given a place: a page that repeats a paragraph is worse than the last resort. Only a page that still
|
|
35619
|
-
* fails — an issue that names no section, a place with nothing to give it, a swap that
|
|
35620
|
-
* breaks a section kept or a maximum of the page — falls back whole: the last resort, counted. A swap never leads to another swap. The owner sees a composed page; the swaps are recorded for us, the model's sections kept.
|
|
35621
|
-
* Pure: the service and `ai:replay` run this one function.
|
|
37360
|
+
* The tokens a node's words may sit on, nearest first: its own ground, then each ancestor's, then the page's. `null` in
|
|
37361
|
+
* the list is a ground that is no single token (a colour-mix): nothing past it can be judged from tokens.
|
|
35622
37362
|
*/
|
|
35623
|
-
|
|
35624
|
-
|
|
35625
|
-
(
|
|
35626
|
-
|
|
35627
|
-
|
|
35628
|
-
|
|
35629
|
-
|
|
35630
|
-
}
|
|
35631
|
-
|
|
35632
|
-
var SectionSwapRule;
|
|
35633
|
-
(function (SectionSwapRule) {
|
|
35634
|
-
/** The page's first section: always the plan's opening, never dropped. */
|
|
35635
|
-
SectionSwapRule["Opening"] = "opening";
|
|
35636
|
-
/** The page's last section: always the plan's close, never dropped. */
|
|
35637
|
-
SectionSwapRule["Close"] = "close";
|
|
35638
|
-
/** A middle section: the ready-made section that shows the same list, holds the form, or says most of its words. */
|
|
35639
|
-
SectionSwapRule["Fit"] = "fit";
|
|
35640
|
-
/** A middle section no ready-made section fits (or every one that does would repeat a kept section, iox-ui#68): dropped. */
|
|
35641
|
-
SectionSwapRule["NoFit"] = "no-fit";
|
|
35642
|
-
})(SectionSwapRule || (SectionSwapRule = {}));
|
|
35643
|
-
/** Why a page fell back whole after all (the last resort). */
|
|
35644
|
-
var SectionFallbackLastResort;
|
|
35645
|
-
(function (SectionFallbackLastResort) {
|
|
35646
|
-
/** Nothing left names a section (a count, a share, the order of sections), or after the swaps only such an issue is. */
|
|
35647
|
-
SectionFallbackLastResort["PageWide"] = "page-wide";
|
|
35648
|
-
/** The place named is the opening or the close, and the plan has no ready-made section left for it — or only one that
|
|
35649
|
-
* would repeat what a kept section says (iox-ui#68). */
|
|
35650
|
-
SectionFallbackLastResort["NoReadyMade"] = "no-ready-made";
|
|
35651
|
-
/** It names a section already given to a ready-made one. */
|
|
35652
|
-
SectionFallbackLastResort["ReadyMadeNamed"] = "ready-made-named";
|
|
35653
|
-
/** After the swaps, the check names a section the model composed and kept (a neighbour the swap broke). */
|
|
35654
|
-
SectionFallbackLastResort["Neighbour"] = "neighbour";
|
|
35655
|
-
})(SectionFallbackLastResort || (SectionFallbackLastResort = {}));
|
|
35656
|
-
const NAMED = /sections\[(\d+)\]/g;
|
|
35657
|
-
/** The sections an issue names: its path's, and any its words name. */
|
|
35658
|
-
function sectionsNamed(issue) {
|
|
35659
|
-
const at = new Set();
|
|
35660
|
-
for (const text of [issue.path, issue.message])
|
|
35661
|
-
for (const m of String(text ?? '').matchAll(NAMED))
|
|
35662
|
-
at.add(Number(m[1]));
|
|
35663
|
-
return [...at].sort((a, b) => a - b);
|
|
37363
|
+
function groundsOf(node, up) {
|
|
37364
|
+
const out = [];
|
|
37365
|
+
for (const n of [node, ...[...up].reverse()]) {
|
|
37366
|
+
const v = n.styleProps?.['backgroundColor'] ?? elementStyleById(n.elementStyle)?.base['backgroundColor'];
|
|
37367
|
+
if (v === undefined || v === 'transparent')
|
|
37368
|
+
continue;
|
|
37369
|
+
out.push(oneToken(v) ?? null);
|
|
37370
|
+
}
|
|
37371
|
+
return [...out, PAGE_GROUND];
|
|
35664
37372
|
}
|
|
35665
|
-
|
|
35666
|
-
|
|
35667
|
-
|
|
35668
|
-
|
|
35669
|
-
const
|
|
35670
|
-
|
|
35671
|
-
|
|
35672
|
-
const
|
|
35673
|
-
|
|
35674
|
-
|
|
35675
|
-
};
|
|
35676
|
-
|
|
35677
|
-
|
|
35678
|
-
/** The share of the shorter text's words the longer one holds for the two to be the same sentence said twice: one word
|
|
35679
|
-
* changed is still a repeat (the café's quote, "…וחברים צריכים שולחן" and "…וחברים טובים צריכים שולחן"). */
|
|
35680
|
-
const REPEAT_SHARED = 0.8;
|
|
35681
|
-
/** Whether two texts say the same thing: one inside the other, or the shorter's words (function words aside) nearly all
|
|
35682
|
-
* in the longer. */
|
|
35683
|
-
function sameSaying(a, b) {
|
|
35684
|
-
if (a.phrase.includes(b.phrase) || b.phrase.includes(a.phrase))
|
|
35685
|
-
return true;
|
|
35686
|
-
const [short, long] = [new Set(wordsOf$2(a.text)), new Set(wordsOf$2(b.text))].sort((x, y) => x.size - y.size);
|
|
35687
|
-
if (short.size < REPEAT_MIN_WORDS)
|
|
35688
|
-
return false;
|
|
35689
|
-
return [...short].filter(w => long.has(w)).length / short.size >= REPEAT_SHARED;
|
|
37373
|
+
/** A resolved ground that paints nothing (`transparent`, an alpha of 0) lets the one behind it show. */
|
|
37374
|
+
const CLEAR = /^(transparent|rgba?\([^)]*,\s*0(\.0+)?\s*\)|#[0-9a-f]{6}00)$/i;
|
|
37375
|
+
/** The hex the words sit on in one mode, or null when it cannot be told from tokens (left to the real pixels). */
|
|
37376
|
+
function groundHex(grounds, values) {
|
|
37377
|
+
for (const token of grounds) {
|
|
37378
|
+
if (token === null)
|
|
37379
|
+
return null;
|
|
37380
|
+
const value = String(values[token] ?? '').trim();
|
|
37381
|
+
if (CLEAR.test(value))
|
|
37382
|
+
continue;
|
|
37383
|
+
return parseHexColor(value) ? { token, hex: value } : null;
|
|
37384
|
+
}
|
|
37385
|
+
return null;
|
|
35690
37386
|
}
|
|
35691
37387
|
/**
|
|
35692
|
-
*
|
|
35693
|
-
*
|
|
35694
|
-
*
|
|
37388
|
+
* THE TREE PAIR CHECK (R-H12, gate 2's tree half — `auditDesignContrast` judges the look, not a tree): each Heading's and
|
|
37389
|
+
* Text's ink token against the ground token of the nearest painted node, resolved in every mode the site shows, AA
|
|
37390
|
+
* (4.5, 3 for display / h1 / h2). A pair that is not two hex tokens (a colour-mix, a picture behind) is left to the
|
|
37391
|
+
* real-pixel check. A Button paints its own pair through its element style, which the look's audit already covers.
|
|
35695
37392
|
*/
|
|
35696
|
-
function
|
|
35697
|
-
const
|
|
35698
|
-
const
|
|
35699
|
-
|
|
35700
|
-
|
|
37393
|
+
function freeContrastIssues(page, ctx) {
|
|
37394
|
+
const out = [];
|
|
37395
|
+
const resolved = (ctx.modes?.length ? ctx.modes : ['light']).map(mode => ({ mode, values: resolveTokenValues(ctx.tokens, mode) }));
|
|
37396
|
+
for (const { node, path, up, section } of walkFree(page?.sections ?? [])) {
|
|
37397
|
+
if (page.sections[section]?.readyMade)
|
|
37398
|
+
continue;
|
|
37399
|
+
if (node.type !== FreeNodeType.Heading && node.type !== FreeNodeType.Text)
|
|
37400
|
+
continue;
|
|
37401
|
+
const ink = inkOf(node, up);
|
|
37402
|
+
if (!ink)
|
|
37403
|
+
continue;
|
|
37404
|
+
const grounds = groundsOf(node, up);
|
|
37405
|
+
const need = LARGE_STYLES.includes(node.elementStyle ?? '') ? FREE_CONTRAST.large : FREE_CONTRAST.text;
|
|
37406
|
+
for (const { mode, values } of resolved) {
|
|
37407
|
+
const a = values[ink];
|
|
37408
|
+
const ground = groundHex(grounds, values);
|
|
37409
|
+
if (!a || !ground || !parseHexColor(a))
|
|
37410
|
+
continue;
|
|
37411
|
+
const ratio = wcagContrastRatio(a, ground.hex);
|
|
37412
|
+
if (ratio < need) {
|
|
37413
|
+
out.push({ code: FreeIssueCode.Contrast, path: `${path}.styleProps.color`, message: `--iox-${ink} on --iox-${ground.token} is ${ratio.toFixed(1)}:1 in ${mode} (needs ${need}) — another colour token for the words or the ground` });
|
|
37414
|
+
break;
|
|
37415
|
+
}
|
|
37416
|
+
}
|
|
37417
|
+
}
|
|
37418
|
+
return out;
|
|
35701
37419
|
}
|
|
35702
|
-
|
|
35703
|
-
|
|
35704
|
-
|
|
35705
|
-
|
|
35706
|
-
|
|
35707
|
-
|
|
35708
|
-
|
|
35709
|
-
|
|
35710
|
-
|
|
35711
|
-
|
|
35712
|
-
|
|
37420
|
+
|
|
37421
|
+
/**
|
|
37422
|
+
* WHAT THE OWNER'S PROMPT RULED OUT, AS A READY-MADE SECTION CAN BREAK IT (award plan FS-D47, R-H20). The reading keeps
|
|
37423
|
+
* the owner's refused and asked words as they wrote them (§11.4a); a ready-made section can only break the few of them
|
|
37424
|
+
* that a pattern decides by its parts — pictures, a video, motion. Those are read here, in English and Hebrew, from the
|
|
37425
|
+
* reading's own lists (never guessed from taste words), and judged against a plan section's pattern as it would be
|
|
37426
|
+
* stamped (its `without` parts left out). The fall back picks only among sections that honour them; when it cannot, the
|
|
37427
|
+
* followed line SAYS which of the owner's words the page no longer follows. Pure.
|
|
37428
|
+
*/
|
|
37429
|
+
var PromptLimit;
|
|
37430
|
+
(function (PromptLimit) {
|
|
37431
|
+
/** "no pictures", "only the names", "mostly words". */
|
|
37432
|
+
PromptLimit["NoPictures"] = "no-pictures";
|
|
37433
|
+
PromptLimit["NoVideo"] = "no-video";
|
|
37434
|
+
/** "nothing moving", "no animation". */
|
|
37435
|
+
PromptLimit["NoMotion"] = "no-motion";
|
|
37436
|
+
})(PromptLimit || (PromptLimit = {}));
|
|
37437
|
+
/** A refused entry that IS one of these words rules the thing out ("pictures"; never "stock photos", which refuses stock). */
|
|
37438
|
+
const REFUSED_WORDS = {
|
|
37439
|
+
[PromptLimit.NoPictures]: ['pictures', 'photos', 'photographs', 'images', 'תמונות', 'צילומים'],
|
|
37440
|
+
[PromptLimit.NoVideo]: ['video', 'videos', 'film', 'films', 'וידאו', 'סרטון', 'סרטונים'],
|
|
37441
|
+
[PromptLimit.NoMotion]: ['motion', 'animation', 'animations', 'movement', 'תנועה', 'אנימציה', 'אנימציות'],
|
|
37442
|
+
};
|
|
37443
|
+
/** A phrase that rules the thing out wherever the reading kept it (asked, said or refused). */
|
|
37444
|
+
const RULING_PHRASES = {
|
|
37445
|
+
[PromptLimit.NoPictures]: ['no pictures', 'no photos', 'no images', 'without pictures', 'without photos', 'mostly words', 'only words', 'just words', 'בלי תמונות', 'ללא תמונות', 'רק מילים', 'בלי צילומים'],
|
|
37446
|
+
[PromptLimit.NoVideo]: ['no video', 'no videos', 'without video', 'בלי וידאו', 'בלי סרטונים', 'ללא וידאו', 'ללא סרטונים'],
|
|
37447
|
+
[PromptLimit.NoMotion]: ['no motion', 'no animation', 'no animations', 'nothing moving', 'without motion', 'בלי תנועה', 'בלי אנימציה', 'בלי אנימציות', 'ללא תנועה'],
|
|
37448
|
+
};
|
|
37449
|
+
const plain = (s) => String(s ?? '').normalize('NFKC').toLowerCase().replace(/^(any|no|בלי|ללא)\s+/, '').trim();
|
|
37450
|
+
/** What the owner's words rule out that a ready-made section could break. */
|
|
37451
|
+
function promptLimitsOf(reading) {
|
|
37452
|
+
const refused = (reading?.refused ?? []).map(plain);
|
|
37453
|
+
const all = [...(reading?.refused ?? []), ...(reading?.asked ?? []), ...(reading?.said ?? [])].map(s => String(s ?? ''));
|
|
37454
|
+
return Object.values(PromptLimit).filter(limit => refused.some(r => REFUSED_WORDS[limit].includes(r))
|
|
37455
|
+
|| RULING_PHRASES[limit].some(phrase => all.some(text => wordPattern(phrase).test(text.normalize('NFKC').toLowerCase()))));
|
|
37456
|
+
}
|
|
37457
|
+
const PICTURE_TYPES = ['Image', 'Gallery'];
|
|
37458
|
+
const CARD_RECIPE = 'card';
|
|
37459
|
+
const CARD_MEDIA = 'media';
|
|
37460
|
+
const IMAGE_BIND = 'image';
|
|
37461
|
+
function shows(node, without, out) {
|
|
37462
|
+
if (node.optional && without.has(node.optional))
|
|
37463
|
+
return;
|
|
37464
|
+
// a picture node, or a recipe that draws one: a card keeps its media part unless switched off, a bound image
|
|
37465
|
+
if (PICTURE_TYPES.includes(node.t) || (node.recipe === CARD_RECIPE && node.parts?.[CARD_MEDIA] !== false) || node.binds?.[IMAGE_BIND])
|
|
37466
|
+
out.add(PromptLimit.NoPictures);
|
|
37467
|
+
if (node.t === 'Video')
|
|
37468
|
+
out.add(PromptLimit.NoVideo);
|
|
37469
|
+
if (node.tracks?.length)
|
|
37470
|
+
out.add(PromptLimit.NoMotion);
|
|
37471
|
+
for (const child of node.c ?? [])
|
|
37472
|
+
shows(child, without, out);
|
|
35713
37473
|
}
|
|
35714
|
-
/** The
|
|
35715
|
-
|
|
35716
|
-
|
|
35717
|
-
|
|
35718
|
-
|
|
37474
|
+
/** The owner's limits a plan section would break, stamped as planned (an unknown pattern breaks none it can be judged on). */
|
|
37475
|
+
function sectionBreaks(section, limits) {
|
|
37476
|
+
const pattern = patternById(section.pattern);
|
|
37477
|
+
if (!pattern || !limits.length)
|
|
37478
|
+
return [];
|
|
37479
|
+
const found = new Set();
|
|
37480
|
+
if (pattern.scene || pattern.film)
|
|
37481
|
+
found.add(PromptLimit.NoMotion);
|
|
37482
|
+
shows(pattern.node, new Set(section.without ?? []), found);
|
|
37483
|
+
return limits.filter(l => found.has(l));
|
|
37484
|
+
}
|
|
37485
|
+
/** One sentence per limit broken, in the site's language: n sections are ready-made and do what the owner ruled out. */
|
|
37486
|
+
const UNFOLLOWED = {
|
|
37487
|
+
en: {
|
|
37488
|
+
[PromptLimit.NoPictures]: n => `${n === 1 ? 'One section is' : `${n} sections are`} ready-made and ${n === 1 ? 'shows' : 'show'} pictures, which you asked to leave out.`,
|
|
37489
|
+
[PromptLimit.NoVideo]: n => `${n === 1 ? 'One section is' : `${n} sections are`} ready-made and ${n === 1 ? 'plays a video' : 'play videos'}, which you asked to leave out.`,
|
|
37490
|
+
[PromptLimit.NoMotion]: n => `${n === 1 ? 'One section is' : `${n} sections are`} ready-made and ${n === 1 ? 'moves' : 'move'} as the page scrolls, which you asked to leave out.`,
|
|
37491
|
+
},
|
|
37492
|
+
he: {
|
|
37493
|
+
[PromptLimit.NoPictures]: n => `${n === 1 ? 'חלק אחד מוכן מראש ומציג' : `${n} חלקים מוכנים מראש ומציגים`} תמונות, אף שביקשת בלי תמונות.`,
|
|
37494
|
+
[PromptLimit.NoVideo]: n => `${n === 1 ? 'חלק אחד מוכן מראש ומציג סרטון' : `${n} חלקים מוכנים מראש ומציגים סרטונים`}, אף שביקשת בלי סרטונים.`,
|
|
37495
|
+
[PromptLimit.NoMotion]: n => `${n === 1 ? 'חלק אחד מוכן מראש וזז' : `${n} חלקים מוכנים מראש וזזים`} עם הגלילה, אף שביקשת בלי תנועה.`,
|
|
37496
|
+
},
|
|
37497
|
+
};
|
|
37498
|
+
/** The followed line after a fall back: the model's line, then what the page no longer follows (never a claim kept). */
|
|
37499
|
+
function followedAfter(line, broken, language) {
|
|
37500
|
+
const words = UNFOLLOWED[language === 'he' ? 'he' : 'en'];
|
|
37501
|
+
const said = Object.values(PromptLimit).filter(l => (broken.get(l) ?? 0) > 0).map(l => words[l](broken.get(l)));
|
|
37502
|
+
return [String(line ?? '').trim(), ...said].filter(Boolean).join(' ');
|
|
35719
37503
|
}
|
|
37504
|
+
|
|
35720
37505
|
/**
|
|
35721
|
-
*
|
|
35722
|
-
*
|
|
35723
|
-
*
|
|
37506
|
+
* THE FREE PAGE'S SILENT FALL BACK (award plan §11.4 gate 6, R-H7): a free section that still breaks a rule after the
|
|
37507
|
+
* one repair is given to the plan's ready-made section for its place — through the ONE `fallBackBySection` (never a copy
|
|
37508
|
+
* of its rules: the opening and the close always swap, a middle section takes the best fit by list, form and words or is
|
|
37509
|
+
* dropped, a ready-made section that repeats a kept one is never a fit, and a page that still fails falls back whole).
|
|
37510
|
+
* This file only ADAPTS: a free section is read as the layout language's section (its words as layers, a list slot as
|
|
37511
|
+
* its gallery source, a form slot as a form) so the fit is scored the same way, and the judge it hands over re-runs
|
|
37512
|
+
* `checkFree` on the free page the swaps leave. Pure.
|
|
37513
|
+
*
|
|
37514
|
+
* FS-D47 / R-H20: given the owner's limits (`promptLimitsOf` the reading), the ready-made section is chosen against them
|
|
37515
|
+
* and the followed line is rewritten when one had to be used anyway.
|
|
35724
37516
|
*/
|
|
35725
|
-
|
|
35726
|
-
|
|
35727
|
-
|
|
35728
|
-
|
|
35729
|
-
|
|
35730
|
-
|
|
35731
|
-
|
|
35732
|
-
|
|
35733
|
-
|
|
35734
|
-
|
|
35735
|
-
|
|
35736
|
-
|
|
35737
|
-
|
|
35738
|
-
|
|
35739
|
-
|
|
35740
|
-
|
|
35741
|
-
|
|
35742
|
-
|
|
35743
|
-
|
|
35744
|
-
|
|
35745
|
-
|
|
35746
|
-
|
|
35747
|
-
|
|
35748
|
-
|
|
35749
|
-
|
|
35750
|
-
|
|
35751
|
-
|
|
35752
|
-
|
|
35753
|
-
|
|
35754
|
-
|
|
35755
|
-
|
|
35756
|
-
|
|
35757
|
-
}
|
|
35758
|
-
|
|
35759
|
-
|
|
35760
|
-
|
|
35761
|
-
|
|
35762
|
-
|
|
35763
|
-
|
|
35764
|
-
|
|
35765
|
-
|
|
35766
|
-
|
|
35767
|
-
|
|
35768
|
-
|
|
35769
|
-
|
|
35770
|
-
|
|
35771
|
-
|
|
35772
|
-
|
|
35773
|
-
|
|
35774
|
-
const
|
|
35775
|
-
const
|
|
35776
|
-
|
|
35777
|
-
|
|
35778
|
-
|
|
35779
|
-
|
|
35780
|
-
|
|
35781
|
-
|
|
37517
|
+
/** A free judge's issue code, in the layout language's codes (the fall back reads only paths and messages). */
|
|
37518
|
+
const FREE_TO_LAYOUT_CODE = {
|
|
37519
|
+
[FreeIssueCode.Structure]: LayoutIssueCode.Structure,
|
|
37520
|
+
[FreeIssueCode.Words]: LayoutIssueCode.Content,
|
|
37521
|
+
[FreeIssueCode.Style]: LayoutIssueCode.Look,
|
|
37522
|
+
[FreeIssueCode.Token]: LayoutIssueCode.Look,
|
|
37523
|
+
[FreeIssueCode.Phone]: LayoutIssueCode.Structure,
|
|
37524
|
+
[FreeIssueCode.Motion]: LayoutIssueCode.Motion,
|
|
37525
|
+
[FreeIssueCode.Content]: LayoutIssueCode.Content,
|
|
37526
|
+
[FreeIssueCode.Contrast]: LayoutIssueCode.Reading,
|
|
37527
|
+
[FreeIssueCode.Prompt]: LayoutIssueCode.Content,
|
|
37528
|
+
};
|
|
37529
|
+
const asLayoutIssue = (i) => ({ code: FREE_TO_LAYOUT_CODE[i.code], path: i.path, message: i.message });
|
|
37530
|
+
const WORD_LAYER = {
|
|
37531
|
+
[FreeNodeType.Heading]: LayoutLayerKind.Heading,
|
|
37532
|
+
[FreeNodeType.Text]: LayoutLayerKind.Text,
|
|
37533
|
+
[FreeNodeType.Button]: LayoutLayerKind.Button,
|
|
37534
|
+
};
|
|
37535
|
+
const AT = { col: [1, 1], row: [1, 1] };
|
|
37536
|
+
/** One free node as the layer the fall back's fit reads (words, a list's source, a form), or none. */
|
|
37537
|
+
function layerOf(node) {
|
|
37538
|
+
const word = WORD_LAYER[node.type];
|
|
37539
|
+
if (word)
|
|
37540
|
+
return { kind: word, text: node.text ?? '', ...AT };
|
|
37541
|
+
if (node.type === FreeNodeType.Image)
|
|
37542
|
+
return { kind: LayoutLayerKind.Photo, photo: { id: node.src ?? '' }, ...AT };
|
|
37543
|
+
if (node.type !== FreeNodeType.Slot)
|
|
37544
|
+
return null;
|
|
37545
|
+
const [kind, ref] = String(node.slot ?? '').split(':');
|
|
37546
|
+
if (kind === 'list')
|
|
37547
|
+
return { kind: LayoutLayerKind.Gallery, gallery: { slides: [], source: ref }, ...AT };
|
|
37548
|
+
if (kind === 'form')
|
|
37549
|
+
return { kind: LayoutLayerKind.Form, form: { preset: ref }, ...AT };
|
|
37550
|
+
return null;
|
|
37551
|
+
}
|
|
37552
|
+
/** A free section read as a layout section (for the fit only — never stamped). */
|
|
37553
|
+
function freeSectionAsLayout(section) {
|
|
37554
|
+
const layers = walkFree([section]).map(w => layerOf(w.node)).filter((l) => !!l);
|
|
37555
|
+
return { id: section.id, screens: 1, rows: 1, layers, ...(section.readyMade ? { readyMade: section.readyMade } : {}) };
|
|
37556
|
+
}
|
|
37557
|
+
/**
|
|
37558
|
+
* Give each free section the issues name to the plan's ready-made section, then judge once more. `plan` is the page's
|
|
37559
|
+
* ready-made sections (`PagePlan.sections`), in order; `issues` what `checkFree` still finds after the one repair.
|
|
37560
|
+
* With the owner's limits (FS-D47), the fall back first chooses only among sections that honour them — a middle place
|
|
37561
|
+
* nothing honest fits is dropped where the page's minimums allow; only when that fails is the closest section used, and
|
|
37562
|
+
* the followed line then says which of the owner's words the page no longer follows.
|
|
37563
|
+
*/
|
|
37564
|
+
function fallBackFree(page, plan, issues, ctx, prompt) {
|
|
37565
|
+
const limits = prompt?.limits ?? [];
|
|
37566
|
+
const lastAt = plan.length - 1;
|
|
37567
|
+
const honest = plan.map((_, i) => i).filter(i => i === 0 || i === lastAt || !sectionBreaks(plan[i], limits).length);
|
|
37568
|
+
const first = limits.length && honest.length < plan.length ? fallBackOn(page, plan, honest, issues, ctx) : null;
|
|
37569
|
+
const done = first && !first.lastResort ? first : fallBackOn(page, plan, plan.map((_, i) => i), issues, ctx);
|
|
37570
|
+
if (done.lastResort || !limits.length)
|
|
37571
|
+
return done;
|
|
37572
|
+
const broken = new Map();
|
|
37573
|
+
for (const s of done.page.sections) {
|
|
37574
|
+
if (s.readyMade)
|
|
37575
|
+
for (const l of sectionBreaks(plan[s.readyMade.at], limits))
|
|
37576
|
+
broken.set(l, (broken.get(l) ?? 0) + 1);
|
|
37577
|
+
}
|
|
37578
|
+
if (!broken.size)
|
|
37579
|
+
return done;
|
|
37580
|
+
return {
|
|
37581
|
+
...done,
|
|
37582
|
+
page: { ...done.page, read: { ...done.page.read, followed: followedAfter(done.page.read.followed, broken, prompt?.language) } },
|
|
37583
|
+
unfollowed: Object.fromEntries(broken),
|
|
37584
|
+
};
|
|
37585
|
+
}
|
|
37586
|
+
/** The ONE fall back over the plan sections `use` (by their index in `plan`); ready-made places name the FULL plan. */
|
|
37587
|
+
function fallBackOn(page, plan, use, issues, ctx) {
|
|
37588
|
+
const byId = new Map(page.sections.map(s => [s.id, s]));
|
|
37589
|
+
const real = (at) => use[at] ?? at;
|
|
37590
|
+
const toFree = (layout) => ({
|
|
37591
|
+
...page,
|
|
37592
|
+
sections: layout.sections.map(s => {
|
|
37593
|
+
const was = byId.get(s.id);
|
|
37594
|
+
return s.readyMade && !was.readyMade
|
|
37595
|
+
? { id: s.id, type: FreeNodeType.Section, styleProps: {}, readyMade: { at: real(s.readyMade.at), pattern: s.readyMade.pattern } }
|
|
37596
|
+
: was;
|
|
37597
|
+
}),
|
|
37598
|
+
});
|
|
37599
|
+
// A place already ready-made names the FULL plan; the fall back reads it against the plan it is given.
|
|
37600
|
+
const asGiven = (section) => {
|
|
37601
|
+
const layout = freeSectionAsLayout(section);
|
|
37602
|
+
return layout.readyMade ? { ...layout, readyMade: { ...layout.readyMade, at: use.indexOf(layout.readyMade.at) } } : layout;
|
|
37603
|
+
};
|
|
37604
|
+
let last = [...issues];
|
|
37605
|
+
const judged = fallBackBySection({ dial: 'distinct', sections: page.sections.map(asGiven) }, use.map(i => plan[i]), issues.map(asLayoutIssue), layout => {
|
|
37606
|
+
last = checkFree(toFree(layout), ctx);
|
|
37607
|
+
return { page: layout, issues: last.map(asLayoutIssue) };
|
|
37608
|
+
});
|
|
37609
|
+
return {
|
|
37610
|
+
page: toFree(judged.page),
|
|
37611
|
+
swaps: judged.swaps.map(w => (w.readyMade ? { ...w, readyMade: { ...w.readyMade, at: real(w.readyMade.at) } } : w)),
|
|
37612
|
+
left: judged.left.length ? last : [],
|
|
37613
|
+
...(judged.lastResort ? { lastResort: judged.lastResort } : {}),
|
|
37614
|
+
};
|
|
35782
37615
|
}
|
|
35783
37616
|
|
|
35784
37617
|
/**
|
|
@@ -35871,247 +37704,6 @@ function pickListWord(mix, k, word, ctx) {
|
|
|
35871
37704
|
};
|
|
35872
37705
|
}
|
|
35873
37706
|
|
|
35874
|
-
/**
|
|
35875
|
-
* THE CROSS-SITE FINGERPRINT (premium components M8 gate 2, M8-G2-D7; the prototype's `fingerprint` + `sameness`,
|
|
35876
|
-
* `code/cl2.mjs`): what makes two composed pages read as the same — how the page opens, the sequence of its sections, the
|
|
35877
|
-
* mechanism of its signature, whether it opens light or dark, and the preset it wears. Structure only: no words, no
|
|
35878
|
-
* business data. Round three found that pages composed alone converge on one skeleton, and that telling the model what
|
|
35879
|
-
* already exists is what broke it. Pure.
|
|
35880
|
-
*/
|
|
35881
|
-
/** How a section reads in the page's sequence (the contract's `sequenceTokens`). */
|
|
35882
|
-
var LayoutSequenceToken;
|
|
35883
|
-
(function (LayoutSequenceToken) {
|
|
35884
|
-
LayoutSequenceToken["Inhale"] = "inhale";
|
|
35885
|
-
LayoutSequenceToken["Sideways"] = "sideways";
|
|
35886
|
-
LayoutSequenceToken["HeldWords"] = "held-words";
|
|
35887
|
-
LayoutSequenceToken["HeldReel"] = "held-reel";
|
|
35888
|
-
LayoutSequenceToken["Held"] = "held";
|
|
35889
|
-
LayoutSequenceToken["PhotoGround"] = "photo-ground";
|
|
35890
|
-
LayoutSequenceToken["Gallery"] = "gallery";
|
|
35891
|
-
LayoutSequenceToken["Split"] = "split";
|
|
35892
|
-
LayoutSequenceToken["Composition"] = "composition";
|
|
35893
|
-
})(LayoutSequenceToken || (LayoutSequenceToken = {}));
|
|
35894
|
-
/** The signature mechanisms (the contract's `signatures`); `held-screen` is the fallback, never the aim. */
|
|
35895
|
-
var LayoutSignatureId;
|
|
35896
|
-
(function (LayoutSignatureId) {
|
|
35897
|
-
LayoutSignatureId["WordsLit"] = "words-lit";
|
|
35898
|
-
LayoutSignatureId["PhotoUnveiled"] = "photo-unveiled";
|
|
35899
|
-
LayoutSignatureId["ZoomThrough"] = "zoom-through";
|
|
35900
|
-
LayoutSignatureId["ScrollReel"] = "scroll-reel";
|
|
35901
|
-
LayoutSignatureId["PicturesStacking"] = "pictures-stacking";
|
|
35902
|
-
LayoutSignatureId["HalvesApart"] = "halves-apart";
|
|
35903
|
-
LayoutSignatureId["SidewaysWalk"] = "sideways-walk";
|
|
35904
|
-
LayoutSignatureId["ObjectTurning"] = "object-turning";
|
|
35905
|
-
LayoutSignatureId["HeldScreen"] = "held-screen";
|
|
35906
|
-
})(LayoutSignatureId || (LayoutSignatureId = {}));
|
|
35907
|
-
const OPENING_SCREEN_WORD = 'screen-word';
|
|
35908
|
-
/** A section's token in the page's sequence. */
|
|
35909
|
-
function sequenceTokenOf(s) {
|
|
35910
|
-
if (s.kind === LayoutSectionKind.Inhale)
|
|
35911
|
-
return LayoutSequenceToken.Inhale;
|
|
35912
|
-
if ((s.track ?? 1) > 1)
|
|
35913
|
-
return LayoutSequenceToken.Sideways;
|
|
35914
|
-
const layers = s.layers ?? [];
|
|
35915
|
-
if (s.pin) {
|
|
35916
|
-
if (layers.some(l => l.kinetic))
|
|
35917
|
-
return LayoutSequenceToken.HeldWords;
|
|
35918
|
-
return layers.some(l => l.gallery?.scroll) ? LayoutSequenceToken.HeldReel : LayoutSequenceToken.Held;
|
|
35919
|
-
}
|
|
35920
|
-
if (String(s.ground ?? '').startsWith('photo:'))
|
|
35921
|
-
return LayoutSequenceToken.PhotoGround;
|
|
35922
|
-
if (layers.some(l => l.kind === LayoutLayerKind.Gallery))
|
|
35923
|
-
return LayoutSequenceToken.Gallery;
|
|
35924
|
-
return splitSide(s) ? LayoutSequenceToken.Split : LayoutSequenceToken.Composition;
|
|
35925
|
-
}
|
|
35926
|
-
/** A list section's prefix in the sequence (list-ingredients §7). */
|
|
35927
|
-
const LAYOUT_LIST_TOKEN = 'list';
|
|
35928
|
-
/**
|
|
35929
|
-
* A list mix as the fingerprint sees it (list-ingredients §7, LI2): `list:<arrange>/<who-how>/<moves>` — how the items
|
|
35930
|
-
* sit, which stands out and how, how the visitor moves through them. What a mouse does and how they arrive are too fine
|
|
35931
|
-
* to count. Two pages with `list:row/middle-raised/arrows` show the same list.
|
|
35932
|
-
*/
|
|
35933
|
-
function listTokenOf(mix) {
|
|
35934
|
-
const who = mix.standout && mix.standout.who !== LayoutListWho.None ? `${mix.standout.who}${mix.standout.how ? `-${mix.standout.how}` : ''}` : 'none';
|
|
35935
|
-
const moves = Array.isArray(mix.move) && mix.move.length ? [...new Set(mix.move)].sort().join('+') : 'still';
|
|
35936
|
-
// AW11-D18: a round-two item (a name on its picture, a packshot, a colour block, a numeral) is seen at once too — it
|
|
35937
|
-
// joins the token; a round-one item adds nothing, so every fingerprint stored before AW11 reads as it did.
|
|
35938
|
-
const item = typeof mix.item === 'string' && listWordTier('item', mix.item) === 'pro' ? `/${mix.item}` : '';
|
|
35939
|
-
return `${LAYOUT_LIST_TOKEN}:${mix.arrange}/${who}/${moves}${item}`;
|
|
35940
|
-
}
|
|
35941
|
-
/** A section's token in the sequence: a list section's mix, else its kind (`sequenceTokenOf`). */
|
|
35942
|
-
function sectionTokenOf(s) {
|
|
35943
|
-
const list = s.pin || (s.track ?? 1) > 1 ? undefined : (s.layers ?? []).find(l => l.kind === LayoutLayerKind.Gallery && l.gallery?.list)?.gallery?.list;
|
|
35944
|
-
return list && !String(s.ground ?? '').startsWith('photo:') ? listTokenOf(list) : sequenceTokenOf(s);
|
|
35945
|
-
}
|
|
35946
|
-
/** Every list mix a page shows, in order. */
|
|
35947
|
-
function listTokensOf(page) {
|
|
35948
|
-
return (page.sections ?? []).flatMap(s => (s.layers ?? []).filter(l => l.kind === LayoutLayerKind.Gallery && l.gallery?.list).map(l => listTokenOf(l.gallery.list)));
|
|
35949
|
-
}
|
|
35950
|
-
/** The mechanism of the signature section, by what moves in it (first match wins, as the prototype's). */
|
|
35951
|
-
const SIGNATURE_BY_TRACK = [
|
|
35952
|
-
[LayoutTrackProp.Clip, LayoutSignatureId.PhotoUnveiled],
|
|
35953
|
-
[LayoutTrackProp.Rotate, LayoutSignatureId.ObjectTurning],
|
|
35954
|
-
[LayoutTrackProp.X, LayoutSignatureId.HalvesApart],
|
|
35955
|
-
[LayoutTrackProp.Y, LayoutSignatureId.PicturesStacking],
|
|
35956
|
-
[LayoutTrackProp.Scale, LayoutSignatureId.ZoomThrough],
|
|
35957
|
-
];
|
|
35958
|
-
function signatureOf(s) {
|
|
35959
|
-
if (!s)
|
|
35960
|
-
return LayoutSignatureId.HeldScreen;
|
|
35961
|
-
const layers = s.layers ?? [];
|
|
35962
|
-
if (layers.some(l => l.kinetic))
|
|
35963
|
-
return LayoutSignatureId.WordsLit;
|
|
35964
|
-
if (layers.some(l => l.gallery?.scroll))
|
|
35965
|
-
return LayoutSignatureId.ScrollReel;
|
|
35966
|
-
if ((s.track ?? 1) > 1)
|
|
35967
|
-
return LayoutSignatureId.SidewaysWalk;
|
|
35968
|
-
const props = new Set(layers.flatMap(l => (l.motion ?? []).map(m => m.prop)));
|
|
35969
|
-
return SIGNATURE_BY_TRACK.find(([prop]) => props.has(prop))?.[1] ?? LayoutSignatureId.HeldScreen;
|
|
35970
|
-
}
|
|
35971
|
-
/** A place given to the plan's ready-made section (silent section fallback): its token in the sequence and the opening. */
|
|
35972
|
-
const LAYOUT_READY_MADE_TOKEN = 'ready-made';
|
|
35973
|
-
const READY_MADE_OPENING = `${LAYOUT_READY_MADE_TOKEN}:`;
|
|
35974
|
-
/** A redesign's section place (RD-D20) opens on the owner's part — never a composition of the model's. */
|
|
35975
|
-
const CARRIED_OPENING = `${READY_MADE_OPENING}carried`;
|
|
35976
|
-
function openingOf(s) {
|
|
35977
|
-
if (s?.readyMade)
|
|
35978
|
-
return `${READY_MADE_OPENING}${s.readyMade.pattern}`;
|
|
35979
|
-
if (s?.carry)
|
|
35980
|
-
return CARRIED_OPENING;
|
|
35981
|
-
const layers = s?.layers ?? [];
|
|
35982
|
-
const lead = layers.find(l => l.role === LayoutRole.Lead) ?? layers[0];
|
|
35983
|
-
if (!lead)
|
|
35984
|
-
return 'none';
|
|
35985
|
-
if (lead.size === LayoutSize.Screen)
|
|
35986
|
-
return OPENING_SCREEN_WORD;
|
|
35987
|
-
if (lead.kind === LayoutLayerKind.Photo || lead.kind === LayoutLayerKind.Gallery)
|
|
35988
|
-
return lead.kind;
|
|
35989
|
-
return lead.size ? `${lead.size}-${lead.kind}` : lead.kind;
|
|
35990
|
-
}
|
|
35991
|
-
const SCRUB_TOKEN = 'scrub';
|
|
35992
|
-
/** What of AW10 a page wears (`LayoutFingerprint.scrub`): letters rising, entrances following the scroll, both — or
|
|
35993
|
-
* null for neither. */
|
|
35994
|
-
function scrubTokenOf(page) {
|
|
35995
|
-
const layers = (page.sections ?? []).flatMap(s => s.layers ?? []);
|
|
35996
|
-
const parts = [
|
|
35997
|
-
layers.some(l => l.enter === LayoutEnter.Letters) && LayoutEnter.Letters,
|
|
35998
|
-
layers.some(l => l.scrub) && SCRUB_TOKEN,
|
|
35999
|
-
].filter((x) => !!x);
|
|
36000
|
-
return parts.length ? parts.join('+') : null;
|
|
36001
|
-
}
|
|
36002
|
-
/** A page's fingerprint, worn in `preset` and `mode`, under the site's `header` and `footer` when they are known. A photo ground opens on
|
|
36003
|
-
* the page's own ground colour. */
|
|
36004
|
-
function fingerprintOf(page, preset, mode, header, footer) {
|
|
36005
|
-
const sections = page.sections ?? [];
|
|
36006
|
-
const lists = listTokensOf(page);
|
|
36007
|
-
const scrub = scrubTokenOf(page);
|
|
36008
|
-
const first = sections[0];
|
|
36009
|
-
const ground = String(first?.ground ?? LayoutColour.Ground);
|
|
36010
|
-
const name = Object.values(LayoutColour).includes(ground) ? ground : LayoutColour.Ground;
|
|
36011
|
-
const colour = parseCssColour(layoutPresetColours(preset, mode)?.[name]);
|
|
36012
|
-
const light = colour ? relativeLuminance(colour) > PHOTO_LIGHT_LUMINANCE : mode === 'light';
|
|
36013
|
-
return {
|
|
36014
|
-
opening: openingOf(first),
|
|
36015
|
-
sequence: sections.map(s => (s.readyMade || s.carry ? LAYOUT_READY_MADE_TOKEN : sectionTokenOf(s))),
|
|
36016
|
-
signature: signatureOf(sections.find(s => s.signature)),
|
|
36017
|
-
ground: light ? PhotoTone.Light : PhotoTone.Dark,
|
|
36018
|
-
preset,
|
|
36019
|
-
...(lists.length ? { lists } : {}),
|
|
36020
|
-
...(header ? { header: headerTokenOf(header) } : {}),
|
|
36021
|
-
...(footer ? { footer: footerTokenOf(footer) } : {}),
|
|
36022
|
-
...(scrub ? { scrub } : {}),
|
|
36023
|
-
};
|
|
36024
|
-
}
|
|
36025
|
-
/** A composed page's fingerprint under its site plan's header and footer — the ONE call every reader of a plan makes. */
|
|
36026
|
-
function fingerprintOfPlanPage(page, preset, mode, plan) {
|
|
36027
|
-
return fingerprintOf(page, preset, mode, wornHeaderOfPlan(plan).mix, footerMixOfPlan(plan));
|
|
36028
|
-
}
|
|
36029
|
-
/** The longest common subsequence of two sequences. */
|
|
36030
|
-
function lcs(a, b) {
|
|
36031
|
-
const d = Array.from({ length: a.length + 1 }, () => new Array(b.length + 1).fill(0));
|
|
36032
|
-
for (let i = 1; i <= a.length; i++)
|
|
36033
|
-
for (let j = 1; j <= b.length; j++)
|
|
36034
|
-
d[i][j] = a[i - 1] === b[j - 1] ? d[i - 1][j - 1] + 1 : Math.max(d[i - 1][j], d[i][j - 1]);
|
|
36035
|
-
return d[a.length][b.length];
|
|
36036
|
-
}
|
|
36037
|
-
/** The share of the longer sequence two pages have in common. */
|
|
36038
|
-
function sequenceShare(a, b) {
|
|
36039
|
-
return lcs(a, b) / Math.max(1, a.length, b.length);
|
|
36040
|
-
}
|
|
36041
|
-
const openingWords = (opening) => opening.startsWith(READY_MADE_OPENING) ? `the ready-made ${opening.slice(READY_MADE_OPENING.length)}` : opening === OPENING_SCREEN_WORD ? 'a screen-size word' : opening === 'photo' || opening === 'gallery' ? `a ${opening}` : `a ${opening.replace('-', ' ')}`;
|
|
36042
|
-
/** A list token in words: `list:row/middle-raised/arrows` → "row · middle raised · arrows". */
|
|
36043
|
-
const listWords = (token) => token.replace(`${LAYOUT_LIST_TOKEN}:`, '').split('/').map(p => p.replace(/[-+]/g, ' ')).join(' · ');
|
|
36044
|
-
const signatureWords = (id) => SPEC_SITE_LAYOUT.signatures.find(s => s.id === id)?.label ?? id;
|
|
36045
|
-
/**
|
|
36046
|
-
* Refuses a page that repeats one already made (M8-G2-D7): most of the same sequence (`SPEC_SITE_LAYOUT.sameness.sequence`,
|
|
36047
|
-
* 6 of 7), or the same opening AND signature; against a page of the same business type, the same opening or the same
|
|
36048
|
-
* signature alone — never a page of THIS site (`sameSite`), which is always the same kind. The sequence is compared with real pages only — this studio's, other studios', this site's — never a
|
|
36049
|
-
* demo's (Doron, 2026-11-09: the proof sites' order is the product's grammar, not someone's site). The look is the
|
|
36050
|
-
* owner's pick and is never a reason.
|
|
36051
|
-
*/
|
|
36052
|
-
function samenessIssues(me, others, businessType) {
|
|
36053
|
-
const issues = [];
|
|
36054
|
-
const add = (path, message) => {
|
|
36055
|
-
issues.push({ code: LayoutIssueCode.Sameness, path, message });
|
|
36056
|
-
};
|
|
36057
|
-
for (const o of others) {
|
|
36058
|
-
const them = o.fingerprint;
|
|
36059
|
-
const sameType = !o.sameSite && !!businessType && o.businessType === businessType;
|
|
36060
|
-
const opening = me.opening === them.opening;
|
|
36061
|
-
const signature = me.signature === them.signature;
|
|
36062
|
-
if (opening && (signature || sameType))
|
|
36063
|
-
add('sections[0]', `"${o.name}" already opens on ${openingWords(them.opening)}${sameType ? ', and it is the same kind of business' : ` with ${signatureWords(them.signature)}`} — open another way`);
|
|
36064
|
-
if (signature && (opening || sameType))
|
|
36065
|
-
add('sections', `"${o.name}"'s signature is already ${signatureWords(them.signature)} — find another mechanism`);
|
|
36066
|
-
// A list mix: refused against the same kind of business (list-ingredients §7); the brief names every other one.
|
|
36067
|
-
if (sameType)
|
|
36068
|
-
for (const token of (me.lists ?? []).filter(t => (them.lists ?? []).includes(t))) {
|
|
36069
|
-
add('sections', `"${o.name}" already shows a list as ${listWords(token)}, and it is the same kind of business — mix this list another way`);
|
|
36070
|
-
}
|
|
36071
|
-
if (!o.demo && sequenceShare(me.sequence, them.sequence) >= SPEC_SITE_LAYOUT.sameness.sequence) {
|
|
36072
|
-
add('sections', `your sequence (${me.sequence.join(' → ')}) repeats "${o.name}"'s (${them.sequence.join(' → ')}) — change the order and the kinds of sections`);
|
|
36073
|
-
}
|
|
36074
|
-
}
|
|
36075
|
-
return issues;
|
|
36076
|
-
}
|
|
36077
|
-
/** The three proof sites' fingerprints (premium M8): every new page's opening and signature are compared with them, never
|
|
36078
|
-
* its order of sections (`demo`). layout-fingerprint.spec holds them equal to `fingerprintOf` of the proof layouts. */
|
|
36079
|
-
const PROOF_FINGERPRINTS = [
|
|
36080
|
-
{
|
|
36081
|
-
name: 'bar-daring',
|
|
36082
|
-
demo: true,
|
|
36083
|
-
fingerprint: {
|
|
36084
|
-
opening: OPENING_SCREEN_WORD,
|
|
36085
|
-
sequence: [LayoutSequenceToken.Composition, LayoutSequenceToken.Gallery, LayoutSequenceToken.Inhale, LayoutSequenceToken.HeldWords, LayoutSequenceToken.Sideways, LayoutSequenceToken.Gallery, LayoutSequenceToken.Composition],
|
|
36086
|
-
signature: LayoutSignatureId.WordsLit,
|
|
36087
|
-
ground: PhotoTone.Dark,
|
|
36088
|
-
preset: 'after-dark',
|
|
36089
|
-
},
|
|
36090
|
-
},
|
|
36091
|
-
{
|
|
36092
|
-
name: 'makers-daring',
|
|
36093
|
-
demo: true,
|
|
36094
|
-
fingerprint: {
|
|
36095
|
-
opening: OPENING_SCREEN_WORD,
|
|
36096
|
-
sequence: [LayoutSequenceToken.Composition, LayoutSequenceToken.Sideways, LayoutSequenceToken.Gallery, LayoutSequenceToken.Gallery, LayoutSequenceToken.Inhale, LayoutSequenceToken.HeldWords, LayoutSequenceToken.PhotoGround],
|
|
36097
|
-
signature: LayoutSignatureId.WordsLit,
|
|
36098
|
-
ground: PhotoTone.Light,
|
|
36099
|
-
preset: 'warm-editorial',
|
|
36100
|
-
},
|
|
36101
|
-
},
|
|
36102
|
-
{
|
|
36103
|
-
name: 'cafe-he-daring',
|
|
36104
|
-
demo: true,
|
|
36105
|
-
fingerprint: {
|
|
36106
|
-
opening: 'xxl-heading',
|
|
36107
|
-
sequence: [LayoutSequenceToken.Composition, LayoutSequenceToken.Composition, LayoutSequenceToken.Inhale, LayoutSequenceToken.Held, LayoutSequenceToken.HeldReel, LayoutSequenceToken.Gallery, LayoutSequenceToken.Composition],
|
|
36108
|
-
signature: LayoutSignatureId.PhotoUnveiled,
|
|
36109
|
-
ground: PhotoTone.Light,
|
|
36110
|
-
preset: 'warm-editorial',
|
|
36111
|
-
},
|
|
36112
|
-
},
|
|
36113
|
-
];
|
|
36114
|
-
|
|
36115
37707
|
/**
|
|
36116
37708
|
* A PAGE BUILT FROM ITS SECTIONS IN THE STUDIO'S MEMORY (vectoriox/iox-ui#119, option C — Doron, 2026-11-23). A composed
|
|
36117
37709
|
* page that falls back whole is stamped from the plan's ready-made sections, and four of six J10 Homes did — two hero
|
|
@@ -36216,7 +37808,7 @@ var FallbackOpeningKept;
|
|
|
36216
37808
|
function distinctFallbackSections(sections, others) {
|
|
36217
37809
|
const all = [...sections];
|
|
36218
37810
|
const first = all[0];
|
|
36219
|
-
const worn =
|
|
37811
|
+
const worn = wornOpenings(others);
|
|
36220
37812
|
if (!first || !worn.has(readyMadeToken(first.pattern)))
|
|
36221
37813
|
return { sections: all, kept: FallbackOpeningKept.Free };
|
|
36222
37814
|
const family = patternById(first.pattern)?.family;
|
|
@@ -37234,5 +38826,5 @@ function siteGlobalsOf(globals) {
|
|
|
37234
38826
|
* Generated bundle index. Do not edit.
|
|
37235
38827
|
*/
|
|
37236
38828
|
|
|
37237
|
-
export { ACCOUNT_ENTRY_ID, ACTION_START_SCALE, ACTIVE_BUILD_STATUSES, ADDITION_CAPS, ADDITION_ITEMS_KEY, ADDITION_ITEM_SOURCE_SUFFIX, ADDITION_KEY_PREFIX, ADDITION_SLUG, ADJUSTMENTS, ADJUST_AXIS_LABELS, ADJUST_LOOK, ADJUST_OWN, ADJUST_STEPS, ADJUST_STEP_IDS, AI_COMPOSED_PAGES_BY_TIER, AI_COMPOSED_PAGES_ESTIMATED, AI_COMPOSED_PAGE_LEAN_TOKENS, AI_MODEL_STEPS, AI_PLAN_REASKED_PART, AI_REFUSAL_NEXT, AI_REFUSAL_STATUS, AI_STEPS, AI_STEP_FEATURE, AI_STEP_LABELS, AI_STEP_NEEDS, AI_STEP_PART_TOKENS, AI_STEP_RUNS_AS, AI_STEP_TYPICAL_TOKENS, ART_DIRECTION_PARTS, AWARD_COMPOSED_PAGES_ESTIMATED, AdditionHeldBack, AdditionIssueCode, AdditionOrigin, AdditionsPart, AdditionsSkipped, AdjustAxis, AdjustKind, AiCallStatus, AiCapability, AiFeature, AiGenerationStage, AiKeyMode, AiLimit, AiNextKind, AiProviderId, AiRefusalCode, AiStep, BAR_ITEMS_MAX, BAR_ITEMS_MIN, BASELINE_ROLES, BASELINE_WORDS_HE, BODY_TOKEN, BUILD_STEPS, BUTTON_LINK_PROPS, BaselineRole, BindScope, BodyIngredient, BodyMixError, BodyRepairCode, BodyRhythm, BodySeam, BodySectionWord, BodyTexture, BuildNoticeCode, BuildStep, CARRIED_BUTTON_STYLES, CARRY_LAYER_KINDS, CARRY_PHOTO_KINDS, CARRY_PROMPT_QUOTE, CARRY_WHOLE_LAYER_KINDS, CONTENT_ROLE_MEANINGS, COPY_OUT, CREDITS_PER_USD, CardBindTarget, CarryBlockKind, CarryKeptReason, CarryKind, CarryReferenceVia, CheckSeverity, ComposeError, ComposeIssueCode, ContentFieldControl, ContentFieldType, ContentRole, ContentTypeAction, CreatedKind, DANGLING_LINK_CODES, DEFAULT_FOOTER_PATTERN, DEFAULT_GENERATION_TIER, DEFAULT_HEADER_PATTERN, DEFAULT_PHONE_MENU_BREAKPOINT, DEFAULT_SITE_LOCALE, ENTRANCE_EASING, ENTRANCE_ORIGIN_LOOK, ENTRANCE_TRIGGER, EntrancePart, EntranceSide, FACT_KEYS, FIELD_TYPE_OF_CONTROL, FILL_ASPECT, FILM_PATTERN, FINAL_GENERATION_STAGES, FINDING_SEVERITY, FOOTER_LEGAL_ROLE, FOOTER_TOKEN, FORM_LEGAL_ROLE, FallbackOpeningKept, FilmUnplaced, FindingGrouping, FooterArrange, FooterClosing, FooterGround, FooterHold, FooterIngredient, FooterMixError, FooterRepairCode, FooterRole, GRAMMAR_TOO_LARGE_MESSAGE, GenerationTier, GlobalSlot, GroundTone, HAND_PAGE_KEY_PREFIX, HEADER_TOKEN, HEBREW_PREFIXES, HeaderAction, HeaderArrange, HeaderIngredient, HeaderMixError, HeaderPages, HeaderRepairCode, HeaderReplacedKind, IMPRINT_COUNTRIES, ISRAEL, JSON_SCHEMA_BANNED_KEYWORDS, JsonSchemaShapeError, KeptPagesChoice, KeptReason, LAYOUT_ACCENT_TEXT, LAYOUT_BEAT_DELAY, LAYOUT_CHECK_VIEWPORT, LAYOUT_COLOUR_TOKEN, LAYOUT_COLUMN_GAP, LAYOUT_COLUMN_MENDED, LAYOUT_DEPTH_ON_PHONE, LAYOUT_DRIFT, LAYOUT_EASING, LAYOUT_ENTRANCE_MAX_MS, LAYOUT_FONT_SIZE, LAYOUT_HIDDEN_OPACITY, LAYOUT_KINETIC_KINDS, LAYOUT_LINE_HEIGHT, LAYOUT_LIST_TOKEN, LAYOUT_MIX_OFFERED, LAYOUT_MIX_OFFERED_AWARD, LAYOUT_MIX_WORDS, LAYOUT_OPERATED, LAYOUT_OWNED_PROPS, LAYOUT_PACE, LAYOUT_PHONE_BREAKPOINT, LAYOUT_PHONE_PADDING, LAYOUT_PHOTO_ASPECT, LAYOUT_READY_MADE_TOKEN, LAYOUT_RISE, LAYOUT_SCREEN_PX, LAYOUT_TEXT_KINDS, LAYOUT_TOOLTIP_TRAIT, LAYOUT_VIEWPORTS, LAYOUT_WIRE_AUTOPLAY_MS, LEGAL_KINDS, LEGAL_PAGE_SETTING, LIST_CARD_PART, LIST_DECK_MAX_PX, LIST_DECK_SHARE, LIST_FRAME_STYLE_KEYS, LIST_INGREDIENTS, LIST_ITEM_MIN_PX, LIST_LONG_WORDS, LIST_RHYTHMS, LIST_ROLE_WORDS, LIST_RULES, LIST_SAY_WORDS, LIST_TABLE, LIST_WORDS_BESIDE_RULE, LayoutAlign, LayoutBleed, LayoutButtonVariant, LayoutColour, LayoutColourMode, LayoutDepth, LayoutDial, LayoutEase, LayoutEditOp, LayoutEnter, LayoutGalleryEffect, LayoutGapCode, LayoutIssueCode, LayoutLayerKind, LayoutListArrange, LayoutListArrive, LayoutListHover, LayoutListHow, LayoutListItem, LayoutListMove, LayoutListPhone, LayoutListRole, LayoutListSide, LayoutListWho, LayoutMendKind, LayoutMixIngredient, LayoutNavKind, LayoutPace, LayoutPhotoShape, LayoutPhotoSource, LayoutRole, LayoutScrubRefusal, LayoutSectionKind, LayoutSequenceToken, LayoutSide, LayoutSignatureId, LayoutSize, LayoutSourceChoice, LayoutTrackProp, LayoutTransition, LayoutViewport, LegalBlocks, LegalFact, LegalKind, ListPartChange, ListPartOutcome, ListSayCode, ListWordRefusal, MAX_SITE_PICTURES, MOTION_TRIGGERS, MOVING_OPENING_MEDIA, MenuSide, NAV_PART_LABELS, NAV_SHAPE_COPY, NEUTRAL_STYLE_PROPS, NODE_BASELINES, NO_TOKENS, NavPagesSource, NavRole, NavShape, NavShapeError, ONCE_ENTRANCE_MS, OPENING_HEIGHT, OPENING_MIX_PROP, OPENING_TOKEN, OpeningExtra, OpeningFrame, OpeningIngredient, OpeningMedia, OpeningMixError, OpeningMotion, OpeningRepairCode, OpeningRole, OpeningWords, PAGE_ARCHETYPES, PERSONAL_CONTROLS, PHOTO_ANALYSIS_WIDTH, PHOTO_CALM_DETAIL, PHOTO_GRID, PHOTO_LIGHT_LUMINANCE, PICTURE_ASPECTS, PICTURE_NEVER, PICTURE_REAL_PLACE_FAMILIES, PICTURE_REROLL_EVERY, PICTURE_REVIEW_FORMAT, PICTURE_REVIEW_SHAPE, PICTURE_TEXT_CONTRAST, PICTURE_WORLDS, PICTURE_WORLD_IDS, PLAN_EDITS_ANSWER_SHAPES, PLAN_EDITS_PART_SCHEMA_NAMES, PLAN_EDIT_OP_PART, PLAN_EDIT_SHAPE, PLAN_EDIT_WIRE_KEYS, PLAN_PARTS, PLAN_PART_KEYS, PLAN_WIRE_DERIVED, PLAN_WIRE_PART_SCHEMA_NAMES, PLAN_WIRE_SHAPE, PREVIOUS_ROUTE_SUFFIX, PRICING_PATTERN, PROOF_FINGERPRINTS, PUBLISH_BLOCKING_PLACEHOLDERS, PageDataKind, PathIssueCollector, PatternDirective, PatternGlobalPosition, PatternOpens, PatternPlaceholder, PatternRecipe, PhoneMenuBreakpoint, PhotoTone, PictureRefusal, PictureWorld, PlaceholderKind, PlanChangeAction, PlanChangeKind, PlanDataSourceMode, PlanDataSourceType, PlanEditIssueCode, PlanEditOp, PlanEditsOutcome, PlanPart, PlanWireEntry, PlanWireShapeError, PlanWordIssueCode, PreflightRefusalCode, PriceBindTarget, PublishRefusalCode, PublishScope, REDESIGN_ADDITIONS_SCHEMA_NAMES, REDESIGN_BACK_DAYS, REDESIGN_PARTS, REDESIGN_STEPS, RENDER_CHECK, REQUIRED_CONTENT_ROLES, RedesignPageResult, RedesignPart, RedesignRefusalCode, RedesignStep, RelativeOp, SAMPLE_IMAGE_REF, SCENE_LEVEL, SCENE_OTHER_PAGES, SCRIM_BACKGROUND, SCRIM_COVER, SCRIM_LEVELS, SCRUBBED_ENTRANCE, SCRUB_UNTIL, SHOP_CART_BUTTON_ID, SHOP_CART_DRAWER_ID, SHOP_FIELDS, SHOP_LATEST_LIMIT, SHOP_LIST_LIMIT, SHOP_NEED, SHOP_ONLY_CONTENT_ROLES, SHOP_PRODUCTS_MAX, SHOP_ROLES, SHOP_SLUG_FIELD, SHOWCASE_FILM, SHOWCASE_SHOP, SIGN_IN_DIALOG_ID, SITE_CHECKS, SITE_FACT_LABELS, SITE_FINDING_WORDS, SITE_HEADER_PATTERN, SITE_LIBRARY, SITE_LOCALES, SITE_NEED_IDS, SITE_PAGE_MOVED_ASIDE, SITE_PATTERNS, SITE_PLAN_VERSION, SITE_TEMPLATES, SPEC_SITE_ARCHETYPES, SPEC_SITE_COPY_LENGTHS, SPEC_SITE_DENSITY_COPY, SPEC_SITE_FACTS, SPEC_SITE_FOOTER_PARTS, SPEC_SITE_HEADER_PARTS, SPEC_SITE_LAYOUT, SPEC_SITE_LIBRARY, SPEC_SITE_LOCALES, SPEC_SITE_NEED_IDS, SPEC_SITE_PATTERNS, SPEC_SITE_PICTURE_NEVER, SPEC_SITE_PICTURE_WORLDS, SPEC_SITE_PLAN_SHAPE, SPEC_SITE_REQUIRED_ROLES, SPEC_SITE_ROLES, SPEC_SITE_TEMPLATES, STAMPED_PAGE_ARCHETYPES, START_QUOTE_STEPS, START_QUOTE_TOKENS, STOCK_FAMILIES, STOCK_FAMILY_INTENTS, STOCK_INTENT_ORDER, STOCK_INTENT_SUBJECTS, STOCK_ITEM_ASPECT, STOCK_MIN_KEPT, STOCK_PROVIDER_TERMS, STOCK_SEED_MARGIN, STOCK_SUBJECT_WORDS, STORE_CONTACT_CODES, STRICT_SCHEMA_BUDGET, STRICT_SCHEMA_LIMITS, STUDIO_TEMPLATE, SWAP_CARRY_KINDS, ScrimLevel, ScrubUntil, SectionFallbackLastResort, SectionMaker, SectionSwapAction, SectionSwapRule, ShopResource, ShopSourceRole, SiteBuildKind, SiteBuildStatus, SiteCheckId, SiteFindingCode, SiteLocale, SitePageMaker, SitePageStatus, SitePlanError, SitePlanIssueCode, SitePlanSourceKind, SiteTemplateError, SiteTemplateId, StagedPageReason, StagedPageWay, StepState, StockIntent, StockOrientation, StockProviderId, StockReviewFlag, StockReviewVerdict, StockSlotKind, StockSubject, WORDS_AREA_DEFAULT_SHARE, WordsEdge, addBarItem, addStockCredits, additionKey, additionSourcesOf, additionsNeedContent, adjustStepLabel, adjustStepOf, adjustStyleProps, aiModelStep, aiRefusalNext, aiStepParts, applyHeaderMix, applyLayoutEdits, applyOpeningMix, applyOwnPhotoGalleries, applyPictureScrims, applyPlanEdits, applyStockItemPhotos, applyStockPhotos, archetypeIssues, areaLuminance, artDirectionFor, artDirectionIssues, artDirectionPreamble, aspectRatioOf, assertStyleSlots, assertValidSitePlan, auditLayoutMotion, auditSite, barIconForRoute, bentoFill, bentoFillsParams, blocksPublish, bodyMeaning, bodyMix, bodyMixFromWords, bodyMixOfPlan, bodyMixWords, bodySeamClass, bodySeamShape, bodyTokenOf, bodyWireWords, bodyWordDrawn, bodyWordOffered, bodyWordTier, bodyWordWaits, bodyWords, brandHueWord, buildKeys, buildStepFacts, buildStepsOf, builtHomePageId, calmParts, calmUnder, canonicalNodeJson, canonicalValue, carryBlockOf, carryButtonLink, carryHandles, carryInto, carryKindOf, carryNotPlaced, carrySection, checkAdditions, checkBody, checkCarry, checkFooter, checkHeader, checkLayout, checkList, checkOpening, chooseScrim, columnIssues, composablePage, composeContextOf, composeLayout, composeListFrame, composeNavHeader, composeOpening, composePresetForm, composeSection, composeSite, composedPagesMax, composedPagesShare, composerLeftovers, composingShare, contentTypeOfSource, contentTypePreviewFields, contentTypeToWire, copyLengthOf, copyOutInteraction, costUsd, countryLegalFacts, coverCrop, createSerializedNode, creditsOfUsd, dataSourceToWire, derivedBeats, derivedDataSources, derivedShopSources, describeCarryForPrompt, describeInventoryForPrompt, describeListShape, describePlanData, describeShapeKey, distinctFallbackSections, distinctFooter, distinctHeader, drawnBodyMix, drawnFooterMix, drawnHeaderMix, drawnOpeningMix, driftAt, driftOverlap, duplicateNodeIds, editedPageIds, emptyAreaPhrase, entranceAction, entranceInteraction, estimatePictures, estimateStepCredits, expandAdditions, expandLayoutWire, expandPlanWire, expandWireContentType, expandWireDataSource, expandWireEdit, expandWireField, expandWirePage, expandWireSection, expandWireShop, factIssues, failedBuildStep, fallBackBySection, fallbackFingerprintOf, fallbackFingerprintOfPlanPage, fieldToWire, filmOfPlan, filmPlacement, findNavRoot, findOpening, findingMessageOf, findingSentence, fingerprintOf, fingerprintOfPlanPage, footerMeaning, footerMix, footerMixFromWords, footerMixOfPlan, footerMixWords, footerPattern, footerPatternIdOf, footerReferences, footerTableWords, footerTokenOf, footerTokenWords, footerWait, footerWireWords, footerWords, formAsksPersonalData, formLegalFacts, frameWords, generationTierOf, groundToneOf, groupSentence, groupSiteFindings, handPageKey, handPlanPage, harvestPage, hash53, headerAdvice, headerCompanions, headerContextOfPlan, headerGallery, headerGalleryIdOf, headerMeaning, headerMix, headerMixFromWords, headerMixOfNavKind, headerMixOfPlan, headerMixValue, headerMixWords, headerPatternIdOf, headerRecipe, headerReferences, headerShape, headerSiteFor, headerTokenOf, headerTokenWords, headerWireWords, headerWordDrawn, headerWords, isActiveBuild, isAdditionKey, isHandPageKey, isLayoutRule, isLegalKind, isNonEmptyString, isPerItemPage, isPictureWorld, isPlainObject, isRedesignRun, isRtlLocale, isScrubbedEntrance, isSectionCarryHandle, isSectionStamp, isShopResource, isTemplateRoute, jsonAnyOf, jsonBoolean, jsonClosedObject, jsonInteger, jsonListOf, jsonOneOf, jsonSchemaKeywords, jsonSchemaObjects, jsonShapedObject, jsonText, judgeLayoutRender, keepListParts, layerShownSpans, layoutBandScheme, layoutBoxPx, layoutColumnsOffered, layoutColumnsVw, layoutDesignOf, layoutDialOf, layoutDriftPhoto, layoutElementStyle, layoutEntersOffered, layoutFlagsOffered, layoutGalleryLists, layoutGallerySources, layoutGlideDepth, layoutHeldStill, layoutListBare, layoutListBinding, layoutListDrawnCols, layoutListPair, layoutListShapes, layoutListsContext, layoutLookChanges, layoutLookOf, layoutMixOffered, layoutMotionOf, layoutNodeClass, layoutOpeningDisplayMend, layoutOpeningDisplays, layoutPathSteps, layoutPhotoIds, layoutPresetColours, layoutPresetOf, layoutRepairJsonSchema, layoutRoomPx, layoutRuleEdge, layoutScrubTakes, layoutShapeHasPurpose, layoutStillLine, layoutTextFits, layoutTextWidthEm, layoutToWire, layoutVoidScreens, layoutVoids, layoutWireJsonSchema, layoutWirePartWords, legalFactsOf, legalFormLine, legalKindBlocks, legalKindOfPage, legalKindRow, legalKindsFor, legalLabel, legalPageOf, legalRoute, legalTitle, listBelowPro, listBindingOfType, listBuiltWords, listColumns, listDetailOf, listIngredientWords, listMeaning, listMixFromWords, listMixOfFrame, listMixValue, listMixWords, listNeverIsEmpty, listOverhang, listPanelRows, listSaidSentence, listSentence, listShapeOfType, listTokenOf, listTokensOf, listWait, listWordOffered, listWordRef, listWordRefs, listWordRefusal, listWordTier, listWords, luminanceOf, measureLayout, mendCarry, mendLayout, mendNotices, menuAtEveryWidth, menuLookOf, menuWords, modelCanDo, moveBarItem, moveEntrance, namedFooterMix, namedHeaderMix, namedOpeningMix, navHeaderContext, navPages, navShapeBreakpoint, navShapeOf, nearestHeaderMix, nestSitePages, nextSourceOf, nodeBindPaths, offeredForTier, onceEntrance, openingAdvice, openingAdviceMix, openingContextOf, openingFromSection, openingGallery, openingGalleryIdOf, openingMeaning, openingMix, openingMixFromWords, openingMixOfPlan, openingMixValue, openingMixWords, openingPatternIdOf, openingPhoneInset, openingRecipe, openingReferences, openingTokenOf, openingWireWords, openingWordDrawn, openingWordOffered, openingWordTier, openingWordWaits, openingWords$1 as openingWords, orientationOfRatio, outwardCredits, ownPhotoFit, ownerContentInto, paddingKeepingClear, pageBuildSource, pageListIssues, pageShowsShop, pageToWire, parseLayoutPhotoId, parsePatternPath, parseSampleImageRef, pathAt, patternById, patternHasForm, patternLinkSlots, patternListGap, patternManifest, patternNeedsBinding, patternNodes, patternOptionalParts, patternRoleNeeds, patternScopes, patternSlotBudgets, patternSlots, patternTakesBinding, phoneGapBefore, phoneMenuPages, phoneWordsColour, photoInventory, photoShapeOf, pickListWord, pictureAspect, pictureItemsOf, picturePrompt, pictureRefusalOf, pictureRerolls, pictureReviewIssues, pictureReviewJsonSchema, pictureReviewPasses, pictureSlotKey, pictureTargets, pictureTryFits, pinnedPagesOf, pixelsUnder, placeFilm, plainCarryText, planEditOps, planEditToWire, planEditWireGaps, planEditWireKeys, planEditWireOps, planEditWireShape, planEditsFromWire, planEditsJsonSchema, planEditsToWire, planEntrances, planFromTemplate, planHasShopSource, planHeader, planLayoutPhotos, planNavShape, planOwnPhotos, planPartOfPath, planPartToWire, planPictures, planSells, planStockPhotos, planToWire, planWireGaps, planWirePartJsonSchema, planWirePartShape, planWireShape, planWordIssues, previousRoute, pricesIn, publishRefusal, publishVerdict, quietMoveEntrance, readHeader, readOpening, readyMadeColumn, readyMadeToken, recipeListBinds, recomposeAsks, redesignAdditionsJsonSchema, redesignBackOpen, redesignBackUntil, redesignDiscardable, redesignPreviousChoices, refitBuiltPage, refitPage, refreshSectionStamps, releasedLayoutDefaults, removeBarItem, requiredAcknowledgements, requiredShapeKeys, rewordStoreGlobal, rhythmIssues, roleField, routeMatches, routeParams, samenessIssues, sampleImageRef, scoreStockPhoto, screenFontSize, screenWordColumns, screenWordMisfit, screenWordOverflowPx, scrubEntranceStamps, scrubTokenOf, scrubUntilChoice, scrubbedEntrance, scrubsEntrance, sectionBuildKey, sectionEntrances, sectionFingerprint, sectionOrigin, sectionPatternIds, sectionToWire, sectionTokenOf, sectionUnchanged, sectionsNamed, sequenceShare, sequenceTokenOf, setStyleProps, shapeKeys, shopCategoriesOf, shopContentType, shopListAliases, shopListsShownOn, shopPageOfPlan, shopSourceAliases, showcaseGlobals, showcasePages, showcasePlans, showcaseScenes, showcaseStorePages, shownTogether, signatureOf, siteBuiltWithLaw, siteFactLabel, siteGlobalsOf, siteNavPages, sitePages, sitePagesOf, siteParentRoute, siteSells, siteTreeOf, siteTreeOfPlan, slotBudget, splitCssValue, splitSide, stampHeaderMix, stampOpeningMix, stampOpeningMotion, stampSection, startComposingShare, startQuote, stockCopyKey, stockCreditLine, stockCreditLines, stockCreditNode, stockCreditNodeId, stockFits, stockGroupOf, stockItemSlots, stockKept, stockPhotoRatio, stockPhotoSubject, stockPhotoUsable, stockPhotoWords, stockSlots, stockWord, stockWords, storedHeaderMix, storedOpeningMix, strictSchemaComplexity, strictSchemaRefusal, swapParts, tierOf, tierOffers, toneOf, typesOfAddition, typicalStepTokens, validatePlanEdits, validateSitePlan, variantNamesOf, walkSerialized, wearBodyMix, wireContentTypeJsonSchema, wireDataSourceJsonSchema, wireFieldJsonSchema, wirePageJsonSchema, wireSectionJsonSchema, wireShopProductJsonSchema, withAdditions, withCarriedText, withComposedPages, withDerivedSources, withDistinctFooter, withDistinctHeader, withHeaderWord, withListWord, withOpeningWord, withShownList, wordPattern, wordsOverPhotos, wordsOverPicture, wornHeaderOfPlan, writtenTexts };
|
|
38829
|
+
export { ACCOUNT_ENTRY_ID, ACTION_START_SCALE, ACTIVE_BUILD_STATUSES, ADDITION_CAPS, ADDITION_ITEMS_KEY, ADDITION_ITEM_SOURCE_SUFFIX, ADDITION_KEY_PREFIX, ADDITION_SLUG, ADJUSTMENTS, ADJUST_AXIS_LABELS, ADJUST_LOOK, ADJUST_OWN, ADJUST_STEPS, ADJUST_STEP_IDS, AI_COMPOSED_PAGES_BY_TIER, AI_COMPOSED_PAGES_ESTIMATED, AI_COMPOSED_PAGE_LEAN_TOKENS, AI_MODEL_STEPS, AI_PLAN_REASKED_PART, AI_REFUSAL_NEXT, AI_REFUSAL_STATUS, AI_STEPS, AI_STEP_FEATURE, AI_STEP_LABELS, AI_STEP_NEEDS, AI_STEP_PART_TOKENS, AI_STEP_RUNS_AS, AI_STEP_TYPICAL_TOKENS, ART_DIRECTION_PARTS, AWARD_COMPOSED_PAGES_ESTIMATED, AdditionHeldBack, AdditionIssueCode, AdditionOrigin, AdditionsPart, AdditionsSkipped, AdjustAxis, AdjustKind, AiCallStatus, AiCapability, AiFeature, AiGenerationStage, AiKeyMode, AiLimit, AiNextKind, AiProviderId, AiRefusalCode, AiStep, BAR_ITEMS_MAX, BAR_ITEMS_MIN, BASELINE_ROLES, BASELINE_WORDS_HE, BODY_TOKEN, BUILD_STEPS, BUTTON_LINK_PROPS, BaselineRole, BindScope, BodyIngredient, BodyMixError, BodyRepairCode, BodyRhythm, BodySeam, BodySectionWord, BodyTexture, BuildNoticeCode, BuildStep, CARRIED_BUTTON_STYLES, CARRY_LAYER_KINDS, CARRY_PHOTO_KINDS, CARRY_PROMPT_QUOTE, CARRY_WHOLE_LAYER_KINDS, CONTENT_ROLE_MEANINGS, COPY_OUT, CREDITS_PER_USD, CardBindTarget, CarryBlockKind, CarryKeptReason, CarryKind, CarryReferenceVia, CheckSeverity, ComposeError, ComposeIssueCode, ContentFieldControl, ContentFieldType, ContentRole, ContentTypeAction, CreatedKind, DANGLING_LINK_CODES, DEFAULT_FOOTER_PATTERN, DEFAULT_GENERATION_TIER, DEFAULT_HEADER_PATTERN, DEFAULT_PHONE_MENU_BREAKPOINT, DEFAULT_SITE_LOCALE, ENTRANCE_EASING, ENTRANCE_ORIGIN_LOOK, ENTRANCE_TRIGGER, EntrancePart, EntranceSide, FACT_KEYS, FIELD_TYPE_OF_CONTROL, FILL_ASPECT, FILM_PATTERN, FINAL_GENERATION_STAGES, FINDING_SEVERITY, FOOTER_LEGAL_ROLE, FOOTER_TOKEN, FORM_LEGAL_ROLE, FREE_BUILDER_TYPE, FREE_CONTRAST, FREE_ELEMENT_STYLES, FREE_HOLDERS, FREE_HOVER_PROPS, FREE_LEAD_ROLE, FREE_MOVES, FREE_PHONE_LAYERS, FREE_PHONE_LIMITS, FREE_SECTIONS, FREE_STYLE_PROPS, FREE_TOKEN_PROPS, FREE_TO_LAYOUT_CODE, FREE_WIRE_NODE_KEYS, FREE_WORD_TYPES, FallbackOpeningKept, FilmUnplaced, FindingGrouping, FooterArrange, FooterClosing, FooterGround, FooterHold, FooterIngredient, FooterMixError, FooterRepairCode, FooterRole, FreeIssueCode, FreeLayer, FreeNodeType, FreePictures, FreePurpose, FreeTrigger, GRAMMAR_TOO_LARGE_MESSAGE, GenerationTier, GlobalSlot, GroundTone, HAND_PAGE_KEY_PREFIX, HEADER_TOKEN, HEBREW_PREFIXES, HeaderAction, HeaderArrange, HeaderIngredient, HeaderMixError, HeaderPages, HeaderRepairCode, HeaderReplacedKind, IMPRINT_COUNTRIES, ISRAEL, JSON_SCHEMA_BANNED_KEYWORDS, JsonSchemaShapeError, KeptPagesChoice, KeptReason, LAYOUT_ACCENT_TEXT, LAYOUT_BEAT_DELAY, LAYOUT_CHECK_VIEWPORT, LAYOUT_COLOUR_TOKEN, LAYOUT_COLUMN_GAP, LAYOUT_COLUMN_MENDED, LAYOUT_DEPTH_ON_PHONE, LAYOUT_DRIFT, LAYOUT_EASING, LAYOUT_ENTRANCE_MAX_MS, LAYOUT_FONT_SIZE, LAYOUT_HIDDEN_OPACITY, LAYOUT_KINETIC_KINDS, LAYOUT_LINE_HEIGHT, LAYOUT_LIST_TOKEN, LAYOUT_MIX_OFFERED, LAYOUT_MIX_OFFERED_AWARD, LAYOUT_MIX_WORDS, LAYOUT_OPERATED, LAYOUT_OWNED_PROPS, LAYOUT_PACE, LAYOUT_PHONE_BREAKPOINT, LAYOUT_PHONE_PADDING, LAYOUT_PHOTO_ASPECT, LAYOUT_READY_MADE_TOKEN, LAYOUT_RISE, LAYOUT_SCREEN_PX, LAYOUT_TEXT_KINDS, LAYOUT_TOOLTIP_TRAIT, LAYOUT_VIEWPORTS, LAYOUT_WIRE_AUTOPLAY_MS, LEGAL_KINDS, LEGAL_PAGE_SETTING, LIST_CARD_PART, LIST_DECK_MAX_PX, LIST_DECK_SHARE, LIST_FRAME_STYLE_KEYS, LIST_INGREDIENTS, LIST_ITEM_MIN_PX, LIST_LONG_WORDS, LIST_RHYTHMS, LIST_ROLE_WORDS, LIST_RULES, LIST_SAY_WORDS, LIST_TABLE, LIST_WORDS_BESIDE_RULE, LayoutAlign, LayoutBleed, LayoutButtonVariant, LayoutColour, LayoutColourMode, LayoutDepth, LayoutDial, LayoutEase, LayoutEditOp, LayoutEnter, LayoutGalleryEffect, LayoutGapCode, LayoutIssueCode, LayoutLayerKind, LayoutListArrange, LayoutListArrive, LayoutListHover, LayoutListHow, LayoutListItem, LayoutListMove, LayoutListPhone, LayoutListRole, LayoutListSide, LayoutListWho, LayoutMendKind, LayoutMixIngredient, LayoutNavKind, LayoutPace, LayoutPhotoShape, LayoutPhotoSource, LayoutRole, LayoutScrubRefusal, LayoutSectionKind, LayoutSequenceToken, LayoutSide, LayoutSignatureId, LayoutSize, LayoutSourceChoice, LayoutTrackProp, LayoutTransition, LayoutViewport, LegalBlocks, LegalFact, LegalKind, ListPartChange, ListPartOutcome, ListSayCode, ListWordRefusal, MAX_SITE_PICTURES, MOTION_TRIGGERS, MOVING_OPENING_MEDIA, MenuSide, NAV_PART_LABELS, NAV_SHAPE_COPY, NEUTRAL_STYLE_PROPS, NODE_BASELINES, NO_TOKENS, NavPagesSource, NavRole, NavShape, NavShapeError, ONCE_ENTRANCE_MS, OPENING_HEIGHT, OPENING_MIX_PROP, OPENING_TOKEN, OpeningExtra, OpeningFrame, OpeningIngredient, OpeningMedia, OpeningMixError, OpeningMotion, OpeningRepairCode, OpeningRole, OpeningWords, PAGE_ARCHETYPES, PERSONAL_CONTROLS, PHOTO_ANALYSIS_WIDTH, PHOTO_CALM_DETAIL, PHOTO_GRID, PHOTO_LIGHT_LUMINANCE, PICTURE_ASPECTS, PICTURE_NEVER, PICTURE_REAL_PLACE_FAMILIES, PICTURE_REROLL_EVERY, PICTURE_REVIEW_FORMAT, PICTURE_REVIEW_SHAPE, PICTURE_TEXT_CONTRAST, PICTURE_WORLDS, PICTURE_WORLD_IDS, PLAN_EDITS_ANSWER_SHAPES, PLAN_EDITS_PART_SCHEMA_NAMES, PLAN_EDIT_OP_PART, PLAN_EDIT_SHAPE, PLAN_EDIT_WIRE_KEYS, PLAN_PARTS, PLAN_PART_KEYS, PLAN_WIRE_DERIVED, PLAN_WIRE_PART_SCHEMA_NAMES, PLAN_WIRE_SHAPE, PREVIOUS_ROUTE_SUFFIX, PRICING_PATTERN, PROOF_FINGERPRINTS, PUBLISH_BLOCKING_PLACEHOLDERS, PageDataKind, PathIssueCollector, PatternDirective, PatternGlobalPosition, PatternOpens, PatternPlaceholder, PatternRecipe, PhoneMenuBreakpoint, PhotoTone, PictureRefusal, PictureWorld, PlaceholderKind, PlanChangeAction, PlanChangeKind, PlanDataSourceMode, PlanDataSourceType, PlanEditIssueCode, PlanEditOp, PlanEditsOutcome, PlanPart, PlanWireEntry, PlanWireShapeError, PlanWordIssueCode, PreflightRefusalCode, PriceBindTarget, PromptLimit, PublishRefusalCode, PublishScope, REDESIGN_ADDITIONS_SCHEMA_NAMES, REDESIGN_BACK_DAYS, REDESIGN_PARTS, REDESIGN_STEPS, RENDER_CHECK, REQUIRED_CONTENT_ROLES, RedesignPageResult, RedesignPart, RedesignRefusalCode, RedesignStep, RelativeOp, SAMPLE_IMAGE_REF, SCENE_LEVEL, SCENE_OTHER_PAGES, SCRIM_BACKGROUND, SCRIM_COVER, SCRIM_LEVELS, SCRUBBED_ENTRANCE, SCRUB_UNTIL, SHOP_CART_BUTTON_ID, SHOP_CART_DRAWER_ID, SHOP_FIELDS, SHOP_LATEST_LIMIT, SHOP_LIST_LIMIT, SHOP_NEED, SHOP_ONLY_CONTENT_ROLES, SHOP_PRODUCTS_MAX, SHOP_ROLES, SHOP_SLUG_FIELD, SHOWCASE_FILM, SHOWCASE_SHOP, SIGN_IN_DIALOG_ID, SITE_CHECKS, SITE_FACT_LABELS, SITE_FINDING_WORDS, SITE_HEADER_PATTERN, SITE_LIBRARY, SITE_LOCALES, SITE_NEED_IDS, SITE_PAGE_MOVED_ASIDE, SITE_PATTERNS, SITE_PLAN_VERSION, SITE_TEMPLATES, SPEC_SITE_ARCHETYPES, SPEC_SITE_COPY_LENGTHS, SPEC_SITE_DENSITY_COPY, SPEC_SITE_FACTS, SPEC_SITE_FOOTER_PARTS, SPEC_SITE_HEADER_PARTS, SPEC_SITE_LAYOUT, SPEC_SITE_LIBRARY, SPEC_SITE_LOCALES, SPEC_SITE_NEED_IDS, SPEC_SITE_PATTERNS, SPEC_SITE_PICTURE_NEVER, SPEC_SITE_PICTURE_WORLDS, SPEC_SITE_PLAN_SHAPE, SPEC_SITE_REQUIRED_ROLES, SPEC_SITE_ROLES, SPEC_SITE_TEMPLATES, STAMPED_PAGE_ARCHETYPES, START_QUOTE_STEPS, START_QUOTE_TOKENS, STOCK_FAMILIES, STOCK_FAMILY_INTENTS, STOCK_INTENT_ORDER, STOCK_INTENT_SUBJECTS, STOCK_ITEM_ASPECT, STOCK_MIN_KEPT, STOCK_PROVIDER_TERMS, STOCK_SEED_MARGIN, STOCK_SUBJECT_WORDS, STORE_CONTACT_CODES, STRICT_SCHEMA_BUDGET, STRICT_SCHEMA_LIMITS, STUDIO_TEMPLATE, SWAP_CARRY_KINDS, ScrimLevel, ScrubUntil, SectionFallbackLastResort, SectionMaker, SectionSwapAction, SectionSwapRule, ShopResource, ShopSourceRole, SiteBuildKind, SiteBuildStatus, SiteCheckId, SiteFindingCode, SiteLocale, SitePageMaker, SitePageStatus, SitePlanError, SitePlanIssueCode, SitePlanSourceKind, SiteTemplateError, SiteTemplateId, StagedPageReason, StagedPageWay, StepState, StockIntent, StockOrientation, StockProviderId, StockReviewFlag, StockReviewVerdict, StockSlotKind, StockSubject, TYPE_LED_KEPT, TYPE_LED_OPTIONAL_PARTS, TYPE_LED_SWAPS, TypeLedChangeKind, WORDS_AREA_DEFAULT_SHARE, WordsEdge, addBarItem, addStockCredits, additionKey, additionSourcesOf, additionsNeedContent, adjustStepLabel, adjustStepOf, adjustStyleProps, aiModelStep, aiRefusalNext, aiStepParts, applyHeaderMix, applyLayoutEdits, applyOpeningMix, applyOwnPhotoGalleries, applyPictureScrims, applyPlanEdits, applyStockItemPhotos, applyStockPhotos, archetypeIssues, areaLuminance, artDirectionFor, artDirectionIssues, artDirectionPreamble, aspectRatioOf, assertStyleSlots, assertValidSitePlan, auditLayoutMotion, auditSite, barIconForRoute, bentoFill, bentoFillsParams, blocksPublish, bodyMeaning, bodyMix, bodyMixFromWords, bodyMixOfPlan, bodyMixWords, bodySeamClass, bodySeamShape, bodyTokenOf, bodyWireWords, bodyWordDrawn, bodyWordOffered, bodyWordTier, bodyWordWaits, bodyWords, brandHueWord, buildKeys, buildStepFacts, buildStepsOf, builtHomePageId, calmParts, calmUnder, canonicalNodeJson, canonicalValue, carryBlockOf, carryButtonLink, carryHandles, carryInto, carryKindOf, carryNotPlaced, carrySection, checkAdditions, checkBody, checkCarry, checkFooter, checkFree, checkFreeSection, checkHeader, checkLayout, checkList, checkOpening, chooseScrim, chooseTypeLedOpening, columnIssues, composablePage, composeContextOf, composeLayout, composeListFrame, composeNavHeader, composeOpening, composePresetForm, composeSection, composeSite, composedPagesMax, composedPagesShare, composerLeftovers, composingShare, contentTypeOfSource, contentTypePreviewFields, contentTypeToWire, copyLengthOf, copyOutInteraction, costUsd, countryLegalFacts, coverCrop, createSerializedNode, creditsOfUsd, dataSourceToWire, derivedBeats, derivedDataSources, derivedShopSources, describeCarryForPrompt, describeInventoryForPrompt, describeListShape, describePlanData, describeShapeKey, distinctFallbackSections, distinctFooter, distinctHeader, drawnBodyMix, drawnFooterMix, drawnHeaderMix, drawnOpeningMix, driftAt, driftOverlap, duplicateNodeIds, editedPageIds, emptyAreaPhrase, emptyPictures, entranceAction, entranceInteraction, estimatePictures, estimateStepCredits, expandAdditions, expandFreeWire, expandLayoutWire, expandPlanWire, expandWireContentType, expandWireDataSource, expandWireEdit, expandWireField, expandWirePage, expandWireSection, expandWireShop, factIssues, failedBuildStep, fallBackBySection, fallBackFree, fallbackFingerprintOf, fallbackFingerprintOfPlanPage, fieldToWire, filmOfPlan, filmPlacement, findNavRoot, findOpening, findingMessageOf, findingSentence, fingerprintOf, fingerprintOfPlanPage, followedAfter, followedIssues, footerMeaning, footerMix, footerMixFromWords, footerMixOfPlan, footerMixWords, footerPattern, footerPatternIdOf, footerReferences, footerTableWords, footerTokenOf, footerTokenWords, footerWait, footerWireWords, footerWords, formAsksPersonalData, formLegalFacts, frameWords, freeContrastIssues, freeMoveOf, freeMoveWord, freeMoveWords, freeSectionAsLayout, freeSignaturePage, freeStyleIssues, freeToWire, freeWireJsonSchema, freeWirePath, generationTierOf, groundToneOf, groupSentence, groupSiteFindings, handPageKey, handPlanPage, harvestPage, hash53, headerAdvice, headerCompanions, headerContextOfPlan, headerGallery, headerGalleryIdOf, headerMeaning, headerMix, headerMixFromWords, headerMixOfNavKind, headerMixOfPlan, headerMixValue, headerMixWords, headerPatternIdOf, headerRecipe, headerReferences, headerShape, headerSiteFor, headerTokenOf, headerTokenWords, headerWireWords, headerWordDrawn, headerWords, isActiveBuild, isAdditionKey, isHandPageKey, isLayoutRule, isLegalKind, isNonEmptyString, isPerItemPage, isPictureWorld, isPlainObject, isRedesignRun, isRtlLocale, isScrubbedEntrance, isSectionCarryHandle, isSectionStamp, isShopResource, isTemplateRoute, jsonAnyOf, jsonBoolean, jsonClosedObject, jsonInteger, jsonListOf, jsonOneOf, jsonSchemaKeywords, jsonSchemaObjects, jsonShapedObject, jsonText, judgeLayoutRender, keepListParts, layerShownSpans, layoutBandScheme, layoutBoxPx, layoutColumnsOffered, layoutColumnsVw, layoutDesignOf, layoutDialOf, layoutDriftPhoto, layoutElementStyle, layoutEntersOffered, layoutFlagsOffered, layoutGalleryLists, layoutGallerySources, layoutGlideDepth, layoutHeldStill, layoutListBare, layoutListBinding, layoutListDrawnCols, layoutListPair, layoutListShapes, layoutListsContext, layoutLookChanges, layoutLookOf, layoutMixOffered, layoutMotionOf, layoutNodeClass, layoutOpeningDisplayMend, layoutOpeningDisplays, layoutPathSteps, layoutPhotoIds, layoutPresetColours, layoutPresetOf, layoutRepairJsonSchema, layoutRoomPx, layoutRuleEdge, layoutScrubTakes, layoutShapeHasPurpose, layoutStillLine, layoutTextFits, layoutTextWidthEm, layoutToWire, layoutVoidScreens, layoutVoids, layoutWireJsonSchema, layoutWirePartWords, legalFactsOf, legalFormLine, legalKindBlocks, legalKindOfPage, legalKindRow, legalKindsFor, legalLabel, legalPageOf, legalRoute, legalTitle, listBelowPro, listBindingOfType, listBuiltWords, listColumns, listDetailOf, listIngredientWords, listMeaning, listMixFromWords, listMixOfFrame, listMixValue, listMixWords, listNeverIsEmpty, listOverhang, listPanelRows, listSaidSentence, listSentence, listShapeOfType, listTokenOf, listTokensOf, listWait, listWordOffered, listWordRef, listWordRefs, listWordRefusal, listWordTier, listWords, luminanceOf, measureLayout, mendCarry, mendLayout, mendNotices, menuAtEveryWidth, menuLookOf, menuWords, modelCanDo, moveBarItem, moveEntrance, namedFooterMix, namedHeaderMix, namedOpeningMix, navHeaderContext, navPages, navShapeBreakpoint, navShapeOf, nearestHeaderMix, nestSitePages, nextSourceOf, nodeBindPaths, offeredForTier, onceEntrance, openingAdvice, openingAdviceMix, openingContextOf, openingFromSection, openingGallery, openingGalleryIdOf, openingHarnessWord, openingIsTypeLed, openingMeaning, openingMix, openingMixFromWords, openingMixOfPlan, openingMixValue, openingMixWords, openingPatternIdOf, openingPhoneInset, openingRecipe, openingReferences, openingTokenOf, openingWireWords, openingWordDrawn, openingWordOffered, openingWordTier, openingWordWaits, openingWords$1 as openingWords, orientationOfRatio, outwardCredits, ownPhotoFit, ownerContentInto, paddingKeepingClear, pageBuildSource, pageListIssues, pageShowsShop, pageToWire, parseLayoutPhotoId, parsePatternPath, parseSampleImageRef, pathAt, patternById, patternHasForm, patternLinkSlots, patternListGap, patternManifest, patternNeedsBinding, patternNodes, patternOptionalParts, patternRoleNeeds, patternScopes, patternSlotBudgets, patternSlots, patternTakesBinding, phoneGapBefore, phoneMenuPages, phoneWordsColour, photoInventory, photoShapeOf, pickListWord, pictureAspect, pictureItemsOf, picturePrompt, pictureRefusalOf, pictureRerolls, pictureReviewIssues, pictureReviewJsonSchema, pictureReviewPasses, pictureSlotKey, pictureTargets, pictureTryFits, picturelessTypes, pinnedPagesOf, pixelsUnder, placeFilm, plainCarryText, planEditOps, planEditToWire, planEditWireGaps, planEditWireKeys, planEditWireOps, planEditWireShape, planEditsFromWire, planEditsJsonSchema, planEditsToWire, planEntrances, planFromTemplate, planHasShopSource, planHeader, planLayoutPhotos, planNavShape, planOwnPhotos, planPartOfPath, planPartToWire, planPictures, planSells, planStockPhotos, planToWire, planWireGaps, planWirePartJsonSchema, planWirePartShape, planWireShape, planWordIssues, previousRoute, pricesIn, promptLimitsOf, publishRefusal, publishVerdict, quietMoveEntrance, quotesIn, readHeader, readOpening, readyMadeColumn, readyMadeToken, recipeListBinds, recomposeAsks, redesignAdditionsJsonSchema, redesignBackOpen, redesignBackUntil, redesignDiscardable, redesignPreviousChoices, refitBuiltPage, refitPage, refreshSectionStamps, releasedLayoutDefaults, removeBarItem, requiredAcknowledgements, requiredShapeKeys, rewordStoreGlobal, rhythmIssues, roleField, routeMatches, routeParams, samenessIssues, sampleImageRef, scoreStockPhoto, screenFontSize, screenWordColumns, screenWordMisfit, screenWordOverflowPx, scrubEntranceStamps, scrubTokenOf, scrubUntilChoice, scrubbedEntrance, scrubsEntrance, sectionBreaks, sectionBuildKey, sectionEntrances, sectionFingerprint, sectionOrigin, sectionPatternIds, sectionToWire, sectionTokenOf, sectionUnchanged, sectionsNamed, sequenceShare, sequenceTokenOf, setStyleProps, shapeKeys, shopCategoriesOf, shopContentType, shopListAliases, shopListsShownOn, shopPageOfPlan, shopSourceAliases, showcaseGlobals, showcasePages, showcasePlans, showcaseScenes, showcaseStorePages, shownTogether, signatureOf, siteBuiltWithLaw, siteFactLabel, siteGlobalsOf, siteNavPages, sitePages, sitePagesOf, siteParentRoute, siteSells, siteTreeOf, siteTreeOfPlan, slotBudget, splitCssValue, splitSide, stampHeaderMix, stampOpeningMix, stampOpeningMotion, stampSection, startComposingShare, startQuote, stockCopyKey, stockCreditLine, stockCreditLines, stockCreditNode, stockCreditNodeId, stockFits, stockGroupOf, stockItemSlots, stockKept, stockPhotoRatio, stockPhotoSubject, stockPhotoUsable, stockPhotoWords, stockSlots, stockWord, stockWords, storedHeaderMix, storedOpeningMix, strictSchemaComplexity, strictSchemaRefusal, swapParts, tierOf, tierOffers, toneOf, typeLedLayoutSection, typeLedOpeningSection, typeLedOpeningWays, typeLedRound, typeLedSection, typesOfAddition, typicalStepTokens, validatePlanEdits, validateSitePlan, variantNamesOf, walkFree, walkSerialized, wearBodyMix, wireContentTypeJsonSchema, wireDataSourceJsonSchema, wireFieldJsonSchema, wirePageJsonSchema, wireSectionJsonSchema, wireShopProductJsonSchema, withAdditions, withCarriedText, withComposedPages, withDerivedSources, withDistinctFooter, withDistinctHeader, withHeaderWord, withListWord, withOpeningWord, withShownList, withoutFreeOrphans, wordPattern, wordsOverPhotos, wordsOverPicture, wornHeaderOfPlan, wornOpenings, writtenTexts };
|
|
37238
38830
|
//# sourceMappingURL=vectoriox-iox-ui-generation-core.mjs.map
|