@vectoriox/iox-ui 5.147.0 → 5.149.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/composite-core/index.d.ts +15 -1
- package/design-core/index.d.ts +70 -6
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +31 -2
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +101 -12
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +1215 -970
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/generation-core/index.d.ts +116 -39
- package/harness-core/index.d.ts +8 -1
- package/package.json +1 -1
- package/src/composite-core/slider.ts +33 -2
- package/src/design-core/design-apply.ts +6 -0
- package/src/design-core/flavor-spec.generated.ts +48 -0
- package/src/design-core/flavor-tokens.ts +6 -2
- package/src/design-core/header-behaviour.ts +25 -8
- package/src/design-core/node-classes.ts +15 -0
- package/src/design-core/token-css.ts +6 -3
- package/src/generation-core/audit-site.ts +19 -3
- package/src/generation-core/check-layout.ts +34 -6
- package/src/generation-core/compose-layout.ts +64 -41
- package/src/generation-core/compose-site.ts +57 -11
- package/src/generation-core/footer-mix.ts +7 -2
- package/src/generation-core/layout-column.ts +120 -0
- package/src/generation-core/layout-language.ts +66 -12
- package/src/generation-core/layout-space.ts +6 -5
- package/src/generation-core/layout-type.ts +6 -3
- package/src/generation-core/layout-wire.ts +27 -5
- package/src/generation-core/site-spec.generated.ts +11 -23
- package/src/harness-core/business-types.ts +8 -0
- package/styles/iox-design.css +14 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { localeDirection, LocaleDirection, NEW_NODE_STYLE_DEFAULTS, defaultElementStyleFor, elementStyleById, ownedTraitsOf, applyElementStyle, SPEC_AXES, QUIET_MOVE, QUIET_LEVELS, EntranceParam, staggerDelay, ScrubId, stylePresetOfChoices, resolveDesignChoices, presetModes, STYLE_PRESETS, presetChoices, textWidthEm, elementStyleFace, toHexColor, relativeLuminance, sectionEdgeClass, SECTION_EDGE_TYPES, colorSchemeOf, planSectionShape, SectionShape, setSectionShape, sectionShapeOf, setSectionEdge, resolveTokenValues, designTokenRows, parseCssColour, scrubOfChoices, parseHexColor, rgbToOklab, LinkType, MenuTrait, menuDialogProps, MenuButtonKind, menuButtonOf, menuButtonProps, HeaderTrait, menuFormOf, MenuForm, MenuPhoneForm, menuHoverOf, menuRevealOf, flavorPackById, ARRIVE_IDS, MOVE_IDS, PRELOADER_IDS, SCRUB_IDS,
|
|
1
|
+
import { localeDirection, LocaleDirection, NEW_NODE_STYLE_DEFAULTS, defaultElementStyleFor, elementStyleById, ownedTraitsOf, applyElementStyle, SPEC_AXES, QUIET_MOVE, QUIET_LEVELS, EntranceParam, staggerDelay, ScrubId, isScrubId, columnWordOf, contentWidthOf, stylePresetOfChoices, resolveDesignChoices, presetModes, STYLE_PRESETS, presetChoices, textWidthEm, elementStyleFace, toHexColor, relativeLuminance, sectionEdgeClass, SECTION_EDGE_TYPES, colorSchemeOf, planSectionShape, SectionShape, setSectionShape, sectionShapeOf, setSectionEdge, resolveTokenValues, designTokenRows, parseCssColour, scrubOfChoices, parseHexColor, rgbToOklab, LinkType, MenuTrait, menuDialogProps, MenuButtonKind, menuButtonOf, menuButtonProps, HeaderTrait, menuFormOf, MenuForm, MenuPhoneForm, menuHoverOf, menuRevealOf, flavorPackById, ARRIVE_IDS, MOVE_IDS, PRELOADER_IDS, SCRUB_IDS, setColorScheme, LIST_MIX_PROP, ColorScheme, COLOR_SCHEMES, motionLanguageForPlan, headerInkOf, DEFAULT_MENU_LOOK, COLOR_SCHEME_TRAIT, colorSchemeClass, readDesignConfig, ANIMATE_IDS, auditDesignContrast, compositeOver, wcagContrastRatio, HeaderBehaviour, headerBehaviourOf, headerEdgeOf } from '@vectoriox/iox-ui/design-core';
|
|
2
2
|
export { HeaderInk } from '@vectoriox/iox-ui/design-core';
|
|
3
3
|
import { SLIDER_TYPE, badgeToneOf, isAnyCompositeRoot, MarqueeRole, NO_ELEMENT_STYLE, ShopRole, AccountRole, pickTabsAutoBinds, pickAccordionAutoBinds, CardPart, SLIDER_PLACEMENT_TRAIT, SliderPlacement, syncSliderParts, SliderRole, CardLayout, buildCardRecipe, findByRole, CardRole, SHOP_RECIPES, ShopRecipe, bindShopPart, ShopBindTarget, MarqueeDirection, MarqueeSpeed, buildMarqueeRecipe, setMarqueeSettings, SceneRole, segmentedOptions, ITEM_OPEN_STATE, CARD_LAYOUTS, CARD_PARTS, BADGE_TONES, buildSegmentedRecipe, AccordionRole, buildAccordionRecipe, accordionWords, accordionItems, accordionQuestionOf, accordionAnswerOf, ACCORDION_BIND_PROP, ACCORDION_CONTENT_LIMIT, buildTabsRecipe, tabsWords, tabsTriggers, tabLabelNodeOf, TABS_LABEL_BIND_PROP, tabsPanels, tabPanelTextOf, TABS_TEXT_BIND_PROP, tabPanelImageOf, tabsListOf, tabsPanelsOf, TABS_CONTENT_LIMIT, TABS_IMAGE_BIND_PROP, ACCOUNT_RECIPES, AccountRecipe, buildCarouselRecipe, SLIDE_TYPE, buildSlideshowRecipe, buildLightboxRecipe, LIGHTBOX_LABEL, SLIDE_TO_ROW, setHeaderBehaviour, setHeaderInk, buildConsentRecipe, ConsentActionType } from '@vectoriox/iox-ui/composite-core';
|
|
4
4
|
import { formPresetById, ControlType, FIELD_NODE_TYPE, FORM_NODE_TYPE, FormPresetId, FormAfterSend, FORM_AFTER_SEND_TRAIT, FORM_ACTIONS_ROLE, channelOpensNewTab, FORM_CHANNEL_ROLE, presetFormActions, planFormPresetIds, collectFormSpec, isChannelFilled } from '@vectoriox/iox-ui/forms-core';
|
|
@@ -45,6 +45,7 @@ const SPEC_SITE_PLAN_SHAPE = {
|
|
|
45
45
|
"layoutPage": {
|
|
46
46
|
"dial": "'distinct' | 'daring' — how far the page breaks the usual layout (site.layout.vocab.dials; follows How animated, never the model's)",
|
|
47
47
|
"sections": "layoutSection[] — the page in the layout language (site.layout): 4–8 sections of layers on a 12-column grid, checked by generation-core checkLayout, stamped by composeLayout",
|
|
48
|
+
"column?": "string — axes.columns: the content column the model chose for this page (award §0c CW2, AW-D34; offered per type — harness COLUMN_NEVER; absent = the site's word). composeSite writes it as pageSettings.column",
|
|
48
49
|
"givenAway?": "{ at, section }[] — the model's sections silent section fallback gave away (replaced by a ready-made section or dropped), at their places in the model's page; the page's minimums forgive what they carried (iox-ui#67). Set by the server, never by a model"
|
|
49
50
|
},
|
|
50
51
|
"film": {
|
|
@@ -6963,6 +6964,10 @@ const SPEC_SITE_LAYOUT = {
|
|
|
6963
6964
|
"minScale": 0.9,
|
|
6964
6965
|
"maxTextBlur": 5,
|
|
6965
6966
|
"maxRotate": 8,
|
|
6967
|
+
"listItemMinPx": {
|
|
6968
|
+
"picture": 280,
|
|
6969
|
+
"words": 240
|
|
6970
|
+
},
|
|
6966
6971
|
"longTextChars": 160,
|
|
6967
6972
|
"longTextColumns": 7,
|
|
6968
6973
|
"maxPhotos": 14,
|
|
@@ -11295,8 +11300,12 @@ const SPEC_SITE_LAYOUT = {
|
|
|
11295
11300
|
"where": "commerce track G (C-D21) — the shop's parts, handed over as words (AW-D19)"
|
|
11296
11301
|
},
|
|
11297
11302
|
"pageColumn": {
|
|
11298
|
-
"built": [
|
|
11299
|
-
|
|
11303
|
+
"built": [
|
|
11304
|
+
"wide",
|
|
11305
|
+
"contained",
|
|
11306
|
+
"narrow"
|
|
11307
|
+
],
|
|
11308
|
+
"where": "award §0c CW2: `LayoutPage.column` on the layout wire (generation-core layoutWireJsonSchema `columns`, offered per type — harness COLUMN_NEVER; `checkLayout` mends a never word, `column-mended`); composeSite writes it as `pageSettings.column`"
|
|
11300
11309
|
}
|
|
11301
11310
|
},
|
|
11302
11311
|
"rows": [
|
|
@@ -11411,27 +11420,6 @@ const SPEC_SITE_LAYOUT = {
|
|
|
11411
11420
|
"drawnAs": null,
|
|
11412
11421
|
"tier": "pro",
|
|
11413
11422
|
"meaning": "an out-of-season card with notify me"
|
|
11414
|
-
},
|
|
11415
|
-
{
|
|
11416
|
-
"key": "pageColumn.wide",
|
|
11417
|
-
"phase": "CW2",
|
|
11418
|
-
"drawnAs": null,
|
|
11419
|
-
"tier": "all",
|
|
11420
|
-
"meaning": "the page runs the window minus the one gutter (a gallery, a bold page) — never a formal type"
|
|
11421
|
-
},
|
|
11422
|
-
{
|
|
11423
|
-
"key": "pageColumn.contained",
|
|
11424
|
-
"phase": "CW2",
|
|
11425
|
-
"drawnAs": null,
|
|
11426
|
-
"tier": "all",
|
|
11427
|
-
"meaning": "the page's words sit in one centred column; grounds keep the window"
|
|
11428
|
-
},
|
|
11429
|
-
{
|
|
11430
|
-
"key": "pageColumn.narrow",
|
|
11431
|
-
"phase": "CW2",
|
|
11432
|
-
"drawnAs": null,
|
|
11433
|
-
"tier": "all",
|
|
11434
|
-
"meaning": "a reading column — a story, a case study, a long page of words"
|
|
11435
11423
|
}
|
|
11436
11424
|
]
|
|
11437
11425
|
}
|
|
@@ -18266,7 +18254,13 @@ var LayoutMendKind;
|
|
|
18266
18254
|
/** A carried part whose action points at a node the new page no longer has (RD1 — a scroll link to a section that
|
|
18267
18255
|
* left): the action is dropped from the carry and the drop is said (`mendCarry`), never refused. */
|
|
18268
18256
|
LayoutMendKind["Link"] = "link";
|
|
18257
|
+
/** Award §0c CW2 (AW-D34): a page asking a column word its business type never wears (a law firm's `wide`): it takes
|
|
18258
|
+
* the column the type is offered first (`contained`) — said to the owner as `column-mended`. A word outside the
|
|
18259
|
+
* axis is dropped (the page wears the site's). */
|
|
18260
|
+
LayoutMendKind["Column"] = "column";
|
|
18269
18261
|
})(LayoutMendKind || (LayoutMendKind = {}));
|
|
18262
|
+
/** What the build says when the column a page asked for was mended (award §0c CW2). */
|
|
18263
|
+
const LAYOUT_COLUMN_MENDED = 'column-mended';
|
|
18270
18264
|
/** Why a layer's `scrub` is mended (AW10-D12) — the words the build says. */
|
|
18271
18265
|
var LayoutScrubRefusal;
|
|
18272
18266
|
(function (LayoutScrubRefusal) {
|
|
@@ -18332,8 +18326,7 @@ const LAYOUT_OPERATED = new Set([LayoutLayerKind.Gallery, LayoutLayerKind.Button
|
|
|
18332
18326
|
const LAYOUT_TEXT_KINDS = new Set([
|
|
18333
18327
|
LayoutLayerKind.Word, LayoutLayerKind.Heading, LayoutLayerKind.Text, LayoutLayerKind.Label, LayoutLayerKind.Number, LayoutLayerKind.List,
|
|
18334
18328
|
]);
|
|
18335
|
-
/** The grid's
|
|
18336
|
-
const LAYOUT_GUTTER = 'max(4vw, 16px)';
|
|
18329
|
+
/** The grid's column gap (the prototype's `.grid`). Its inset is the page's column since CW2 — `layout-column.ts`. */
|
|
18337
18330
|
const LAYOUT_COLUMN_GAP = '1.2vw';
|
|
18338
18331
|
/** A depth's `params.phone`: scene-core `ParallaxPhone.Rest` — stacked on a phone, a layer never glides into its neighbour.
|
|
18339
18332
|
* Stamped verbatim and read where it plays (not imported, as `PatternTrack`); compose-layout.spec holds the two equal. */
|
|
@@ -18395,7 +18388,7 @@ function phoneGapBefore(prev, next) {
|
|
|
18395
18388
|
return 14;
|
|
18396
18389
|
return 20;
|
|
18397
18390
|
}
|
|
18398
|
-
/** The grid a laptop page is laid on, in vw: its width inside the gutters (
|
|
18391
|
+
/** The grid a laptop page is laid on, in vw: its width inside the gutters (4vw a side in wide), the gap between
|
|
18399
18392
|
* columns (`LAYOUT_COLUMN_GAP`), and 12 columns. */
|
|
18400
18393
|
const GRID_VW = 92;
|
|
18401
18394
|
const COLUMN_GAP_VW = 1.2;
|
|
@@ -18404,33 +18397,66 @@ const GRID_COLUMNS$1 = 12;
|
|
|
18404
18397
|
const LAYOUT_SCREEN_PX = [36, 560];
|
|
18405
18398
|
const SCREEN_FILL = 0.98;
|
|
18406
18399
|
const round2 = (n) => Math.round(n * 100) / 100;
|
|
18400
|
+
const round4 = (n) => Math.round(n * 10000) / 10000;
|
|
18407
18401
|
/** How wide `cols` columns of the laptop grid stand, in vw (12 columns: 92vw). */
|
|
18408
18402
|
function layoutColumnsVw(cols) {
|
|
18409
18403
|
const column = (GRID_VW - (GRID_COLUMNS$1 - 1) * COLUMN_GAP_VW) / GRID_COLUMNS$1;
|
|
18410
18404
|
return cols * column + Math.max(0, cols - 1) * COLUMN_GAP_VW;
|
|
18411
18405
|
}
|
|
18406
|
+
const LEGACY_GUTTER_PX = 16;
|
|
18407
|
+
/** `content-cap` in wide (design-core `WIDE_CONTENT_CAP`): the window. */
|
|
18408
|
+
const WIDE_CAP = '100vw';
|
|
18412
18409
|
/** The room a layer of `cols` columns has on a screen `width` px wide, in px — a phone stacks every layer full width
|
|
18413
|
-
* inside its gutters (`max(
|
|
18414
|
-
|
|
18415
|
-
|
|
18410
|
+
* inside its gutters (`max(4%, gutter)` a side); a laptop in a column has the column's 12 columns, never more than the
|
|
18411
|
+
* window's (wide: today's 92vw grid). */
|
|
18412
|
+
function layoutRoomPx(cols, width, phone, page = {}) {
|
|
18413
|
+
const gutter = page.gutter ?? LEGACY_GUTTER_PX;
|
|
18414
|
+
if (phone)
|
|
18415
|
+
return width - 2 * Math.max(0.04 * width, gutter);
|
|
18416
|
+
const vw = (layoutColumnsVw(cols) * width) / 100;
|
|
18417
|
+
if (page.columnPx === null || page.columnPx === undefined)
|
|
18418
|
+
return vw;
|
|
18419
|
+
const gap = (COLUMN_GAP_VW / 100) * width;
|
|
18420
|
+
const grid = Math.min(width - 2 * Math.max(0.04 * width, gutter), page.columnPx);
|
|
18421
|
+
return Math.min(vw, (cols * (grid - (GRID_COLUMNS$1 - 1) * gap)) / GRID_COLUMNS$1 + Math.max(0, cols - 1) * gap);
|
|
18422
|
+
}
|
|
18423
|
+
/** A `screen` word's width term at a column `columnPx` wide: the px its `cols` columns stand where the column binds
|
|
18424
|
+
* (12 columns of the column, 11 gaps of 1.2vw), at `fill / em` — `A px − B vw`. */
|
|
18425
|
+
/** The column cap a screen word reads: the COLUMN IN FORCE where it renders (`content-cap`, a length a font-size can
|
|
18426
|
+
* read — re-declared by the page's word, iox-ui#117), the stamped column (`fallback`) where a studio's rows lack it. */
|
|
18427
|
+
function columnCapCss(cols, widthEm, fallback) {
|
|
18428
|
+
const k = SCREEN_FILL / Math.max(widthEm, 0.01);
|
|
18429
|
+
const share = round4((cols / GRID_COLUMNS$1) * k);
|
|
18430
|
+
const vw = round2(COLUMN_GAP_VW * (1 - cols / GRID_COLUMNS$1) * k);
|
|
18431
|
+
const cap = `var(--iox-content-cap, ${fallback})`;
|
|
18432
|
+
return vw > 0 ? `calc(${cap} * ${share} - ${vw}vw)` : `calc(${cap} * ${share})`;
|
|
18416
18433
|
}
|
|
18417
18434
|
/**
|
|
18418
18435
|
* A `screen` word's size (iox-ui#46): the word fills its columns' width — `widthEm` is how wide it stands at 1em in its
|
|
18419
18436
|
* own face (design-core `textWidthEm`, from the face's measured letters) — and never stands taller than its rows; never
|
|
18420
18437
|
* under 36px or over 560px. `rows` 0 sizes by width alone (a phone's stacked word). Held sections are one screen tall.
|
|
18421
18438
|
*/
|
|
18422
|
-
function screenFontSize(widthEm, cols, rows, sectionRows, screens) {
|
|
18439
|
+
function screenFontSize(widthEm, cols, rows, sectionRows, screens, columnPx = null, capAlways = false) {
|
|
18423
18440
|
const [min, max] = LAYOUT_SCREEN_PX;
|
|
18424
18441
|
const widthVw = round2((layoutColumnsVw(cols) / Math.max(widthEm, 0.01)) * SCREEN_FILL);
|
|
18442
|
+
// T-CW3: in a column the word never runs past its columns — capped at the column in force, read as `content-cap` (a
|
|
18443
|
+
// `%` in font-size is the parent's size, so never `content-width`), the page's word stamped as px its fallback.
|
|
18444
|
+
// `capAlways` (a global's word — the footer's closing name, iox-ui#117): capped on every page, `100vw` its fallback
|
|
18445
|
+
// in wide, so a page set narrower than the site never sees it run past its column.
|
|
18446
|
+
// CW2: a word across all twelve columns also keeps inside the one gutter (`space-gutter` is a px token, so font-size
|
|
18447
|
+
// may read it): on a phone and wherever the gutter is wider than 4% of the window, 92vw is more than the room.
|
|
18448
|
+
const room = cols >= GRID_COLUMNS$1 ? [`calc((100vw - 2 * var(--iox-space-gutter, ${LEGACY_GUTTER_PX}px)) * ${round4(SCREEN_FILL / Math.max(widthEm, 0.01))})`] : [];
|
|
18449
|
+
const capFallback = columnPx ? `${columnPx}px` : capAlways ? WIDE_CAP : null;
|
|
18450
|
+
const width = [`${widthVw}vw`, ...(capFallback ? [columnCapCss(cols, widthEm, capFallback)] : []), ...room];
|
|
18425
18451
|
if (!rows || !sectionRows)
|
|
18426
|
-
return `clamp(${min}px, ${widthVw}vw, ${max}px)`;
|
|
18452
|
+
return width.length > 1 ? `clamp(${min}px, min(${width.join(', ')}), ${max}px)` : `clamp(${min}px, ${widthVw}vw, ${max}px)`;
|
|
18427
18453
|
const heightSvh = round2((((rows / sectionRows) * screens * 100) / 0.92) * SCREEN_FILL);
|
|
18428
|
-
return `clamp(${min}px, min(${
|
|
18454
|
+
return `clamp(${min}px, min(${[...width, `${heightSvh}svh`].join(', ')}), ${max}px)`;
|
|
18429
18455
|
}
|
|
18430
18456
|
/** How many px a `screen` word `widthEm` wide runs past its room at its smallest size, on a screen `width` px wide — 0
|
|
18431
18457
|
* when it fits. The one thing sizing cannot mend: the static check refuses it (a browser would show it cut). */
|
|
18432
|
-
function screenWordOverflowPx(widthEm, cols, width, phone) {
|
|
18433
|
-
return Math.max(0, Math.round(LAYOUT_SCREEN_PX[0] * widthEm - layoutRoomPx(cols, width, phone)));
|
|
18458
|
+
function screenWordOverflowPx(widthEm, cols, width, phone, page = {}) {
|
|
18459
|
+
return Math.max(0, Math.round(LAYOUT_SCREEN_PX[0] * widthEm - layoutRoomPx(cols, width, phone, page)));
|
|
18434
18460
|
}
|
|
18435
18461
|
|
|
18436
18462
|
/**
|
|
@@ -19518,353 +19544,6 @@ function layoutScrubTakes(layer, textual, scrub, context = {}) {
|
|
|
19518
19544
|
return scrubsEntrance(scrub, reveals ? TEXT_REVEAL : layer.enter, context);
|
|
19519
19545
|
}
|
|
19520
19546
|
|
|
19521
|
-
/** The scroll is replayed in steps this long (px). */
|
|
19522
|
-
const STEP_PX = 4;
|
|
19523
|
-
/** The depth a layer glides at in a section, as the composer stamps it — or null (mid, a held section, what a visitor
|
|
19524
|
-
* operates). ONE rule: `composeLayout` stamps by it, the render check and the depth mend replay by it. */
|
|
19525
|
-
function layoutGlideDepth(section, layer) {
|
|
19526
|
-
if (section.pin || !layer.depth || layer.depth === LayoutDepth.Mid || LAYOUT_OPERATED.has(layer.kind))
|
|
19527
|
-
return null;
|
|
19528
|
-
return layer.depth === LayoutDepth.Front ? ParallaxDepth.Front : ParallaxDepth.Back;
|
|
19529
|
-
}
|
|
19530
|
-
/** How far a layer at `depth` stands off its place with the page scrolled `scroll` px, on a screen `viewHeight` tall. */
|
|
19531
|
-
function driftAt(layer, scroll, viewHeight, phone = false) {
|
|
19532
|
-
if (!layer.depth)
|
|
19533
|
-
return 0;
|
|
19534
|
-
const view = { top: 0, height: viewHeight };
|
|
19535
|
-
const height = layer.box.b - layer.box.t;
|
|
19536
|
-
const shift = parallaxShift(rangeDistance(ScrollRange.Cover, { top: layer.box.t, height }, view), viewHeight, { phone, onPhone: normalizeParallaxPhone(LAYOUT_DEPTH_ON_PHONE) });
|
|
19537
|
-
if (!shift)
|
|
19538
|
-
return 0;
|
|
19539
|
-
const rest = parallaxRest(rangeProgress(ScrollRange.Cover, { top: layer.box.t, height }, view));
|
|
19540
|
-
const progress = rangeProgress(ScrollRange.Cover, { top: layer.box.t - scroll, height }, view);
|
|
19541
|
-
return parallaxOffset(layer.depth, shift, progress, rest);
|
|
19542
|
-
}
|
|
19543
|
-
const meet$1 = (a, b) => ({ l: Math.max(a.l, b.l), t: Math.max(a.t, b.t), r: Math.min(a.r, b.r), b: Math.min(a.b, b.b) });
|
|
19544
|
-
const areaOf = (r) => Math.max(0, r.r - r.l) * Math.max(0, r.b - r.t);
|
|
19545
|
-
const moved = (r, dy) => ({ l: r.l, r: r.r, t: r.t + dy, b: r.b + dy });
|
|
19546
|
-
/**
|
|
19547
|
-
* Where two layers overlap most on screen while the page scrolls past them, at least one gliding — inside `clip` (their
|
|
19548
|
-
* section, which clips a glide) — or null when they never meet more than they already do at rest. `pageHeight` bounds the
|
|
19549
|
-
* scroll. Pure: the same answer in the browser and the server.
|
|
19550
|
-
*/
|
|
19551
|
-
function driftOverlap(a, b, view, clip) {
|
|
19552
|
-
if (!a.depth && !b.depth)
|
|
19553
|
-
return null;
|
|
19554
|
-
const rest = areaOf(clip ? meet$1(meet$1(a.box, b.box), clip) : meet$1(a.box, b.box));
|
|
19555
|
-
const from = Math.max(0, Math.min(a.box.t, b.box.t) - view.height);
|
|
19556
|
-
const to = Math.min(Math.max(0, view.pageHeight - view.height), Math.max(a.box.b, b.box.b));
|
|
19557
|
-
let best = null;
|
|
19558
|
-
for (let scroll = from; scroll <= to; scroll += STEP_PX) {
|
|
19559
|
-
const screen = { l: 0, r: view.width, t: scroll, b: scroll + view.height };
|
|
19560
|
-
const ra = moved(a.box, driftAt(a, scroll, view.height, view.phone));
|
|
19561
|
-
const rb = moved(b.box, driftAt(b, scroll, view.height, view.phone));
|
|
19562
|
-
let overlap = meet$1(meet$1(ra, rb), screen);
|
|
19563
|
-
if (clip)
|
|
19564
|
-
overlap = meet$1(overlap, clip);
|
|
19565
|
-
const area = areaOf(overlap);
|
|
19566
|
-
if (area > rest && (!best || area > best.area))
|
|
19567
|
-
best = { scroll, overlap: moved(overlap, -scroll), area };
|
|
19568
|
-
}
|
|
19569
|
-
return best;
|
|
19570
|
-
}
|
|
19571
|
-
|
|
19572
|
-
const LOOKS = SPEC_SITE_LAYOUT.looks;
|
|
19573
|
-
const PRESET_LOOK = SPEC_SITE_LAYOUT.presetLook;
|
|
19574
|
-
const DARING_LEVELS = SPEC_SITE_LAYOUT.daringLevels;
|
|
19575
|
-
/** How far two brand colours are apart (RGB) — the last word between two presets that differ by their colour alone. */
|
|
19576
|
-
function seedDistance(a, b) {
|
|
19577
|
-
const rgb = (hex) => [1, 3, 5].map(i => parseInt(hex.slice(i, i + 2), 16) || 0);
|
|
19578
|
-
const [x, y] = [rgb(a), rgb(b)];
|
|
19579
|
-
return x.reduce((sum, v, i) => sum + (v - y[i]) ** 2, 0);
|
|
19580
|
-
}
|
|
19581
|
-
/**
|
|
19582
|
-
* The style preset a design wears (M8 gate 2): the preset it IS, else the closest of its flavor — same font pairing,
|
|
19583
|
-
* then the most of shape · density · pill buttons · tint · mode in common, then the nearer brand colour (six pairings
|
|
19584
|
-
* carry two presets each: Quiet luxury and Soft spa are both Linen + Cormorant; Morning glass and Coral studio differ by
|
|
19585
|
-
* their colour alone) — so an owner whose brand became a reference colour still wears THEIR preset's composition notes.
|
|
19586
|
-
* Never null: a design with no preset of its flavor reads the first preset's.
|
|
19587
|
-
*/
|
|
19588
|
-
function layoutPresetOf(choices) {
|
|
19589
|
-
const exact = stylePresetOfChoices(choices);
|
|
19590
|
-
if (exact)
|
|
19591
|
-
return exact;
|
|
19592
|
-
const c = resolveDesignChoices(choices);
|
|
19593
|
-
const kept = (p) => [p.shape === c.shape, p.density === c.density, p.pillButtons === c.pillButtons, p.tint === c.tint,
|
|
19594
|
-
presetModes(p).includes(c.mode)].filter(Boolean).length;
|
|
19595
|
-
const nearer = (a, b) => kept(a) - kept(b) || seedDistance(b.seed, c.seed) - seedDistance(a.seed, c.seed);
|
|
19596
|
-
const paired = STYLE_PRESETS.filter(p => p.flavorId === c.flavorId && p.pairId === c.pairId);
|
|
19597
|
-
if (paired.length)
|
|
19598
|
-
return paired.reduce((best, p) => (nearer(p, best) > 0 ? p : best));
|
|
19599
|
-
return STYLE_PRESETS.find(p => p.flavorId === c.flavorId) ?? STYLE_PRESETS[0];
|
|
19600
|
-
}
|
|
19601
|
-
/** A preset's look (the round-three composition notes it carries). */
|
|
19602
|
-
function layoutLookOf(presetId) {
|
|
19603
|
-
return LOOKS.find(l => l.id === PRESET_LOOK[presetId]) ?? LOOKS[0];
|
|
19604
|
-
}
|
|
19605
|
-
/** The pace and ease a composed page moves with: its look's. */
|
|
19606
|
-
function layoutMotionOf(presetId) {
|
|
19607
|
-
const look = layoutLookOf(presetId);
|
|
19608
|
-
return { pace: look.pace, ease: look.ease };
|
|
19609
|
-
}
|
|
19610
|
-
/**
|
|
19611
|
-
* How far a composed page dares (M8-G2-D5): daring when the look moves Lively or Expressive and the business type's
|
|
19612
|
-
* ceiling allows it (a trust or care type never dares), else distinct. `ceiling` is harness-core's for the type.
|
|
19613
|
-
*/
|
|
19614
|
-
function layoutDialOf(animate, ceiling) {
|
|
19615
|
-
const daring = !!animate && DARING_LEVELS.includes(animate) && (!ceiling || DARING_LEVELS.includes(ceiling));
|
|
19616
|
-
return daring ? LayoutDial.Daring : LayoutDial.Distinct;
|
|
19617
|
-
}
|
|
19618
|
-
|
|
19619
|
-
/** The design a page wears when only its look's preset is known: the preset in `mode` (else its own), else the default. */
|
|
19620
|
-
function layoutDesignOf(presetId, mode) {
|
|
19621
|
-
const id = String(presetId ?? '');
|
|
19622
|
-
return presetChoices(id, (mode ?? undefined)) ?? presetChoices(id) ?? resolveDesignChoices(null);
|
|
19623
|
-
}
|
|
19624
|
-
/** The element style a layer wears, by kind, role and size (the round-four renderer's `elementStyleOf`). */
|
|
19625
|
-
function layoutElementStyle(l) {
|
|
19626
|
-
switch (l.kind) {
|
|
19627
|
-
case LayoutLayerKind.Word: return 'display';
|
|
19628
|
-
case LayoutLayerKind.Heading: return l.role === LayoutRole.Lead ? 'h1' : 'h2';
|
|
19629
|
-
case LayoutLayerKind.Text: return l.size === 'm' || l.size === 'l' ? 'lead' : 'body';
|
|
19630
|
-
case LayoutLayerKind.List: return 'body';
|
|
19631
|
-
case LayoutLayerKind.Label: return !l.size || l.size === 'xs' || l.size === 's' ? 'eyebrow' : 'small';
|
|
19632
|
-
default: return NO_ELEMENT_STYLE;
|
|
19633
|
-
}
|
|
19634
|
-
}
|
|
19635
|
-
/** How wide a layer's words stand at 1em on one line, in the face its element style wears in `design` (iox-ui#46). */
|
|
19636
|
-
function layoutTextWidthEm(l, design) {
|
|
19637
|
-
return textWidthEm(l.text ?? '', elementStyleFace(design, layoutElementStyle(l)));
|
|
19638
|
-
}
|
|
19639
|
-
/** The columns a `screen` word fills: its span, and half a column more for each side it bleeds off. */
|
|
19640
|
-
function screenWordColumns(l) {
|
|
19641
|
-
const bleed = l.bleed && l.bleed !== LayoutBleed.None ? (l.bleed === LayoutBleed.Both ? 1 : 0.5) : 0;
|
|
19642
|
-
return l.col[1] - l.col[0] + bleed;
|
|
19643
|
-
}
|
|
19644
|
-
/** The screens a composed page is judged at (the render check's): a laptop and a phone. */
|
|
19645
|
-
const SCREENS = [{ width: 1440, phone: false }, { width: 390, phone: true }];
|
|
19646
|
-
/** Where a `screen` word cannot fit even at its smallest size: the screen and by how many px — null when it fits both. */
|
|
19647
|
-
function screenWordMisfit(l, design) {
|
|
19648
|
-
if (l.size !== LayoutSize.Screen || !l.text)
|
|
19649
|
-
return null;
|
|
19650
|
-
const em = layoutTextWidthEm(l, design);
|
|
19651
|
-
for (const s of SCREENS) {
|
|
19652
|
-
if (s.phone ? false : !!l.bleed && l.bleed !== LayoutBleed.None)
|
|
19653
|
-
continue;
|
|
19654
|
-
const px = screenWordOverflowPx(em, s.phone ? 12 : screenWordColumns(l), s.width, s.phone);
|
|
19655
|
-
if (px > 0)
|
|
19656
|
-
return { ...s, px };
|
|
19657
|
-
}
|
|
19658
|
-
return null;
|
|
19659
|
-
}
|
|
19660
|
-
|
|
19661
|
-
/**
|
|
19662
|
-
* THE PHOTO INVENTORY (premium components M8 gate 2, §5; the prototype's `code/inventory.cjs`, made pure): what a layout
|
|
19663
|
-
* may know about a photo without seeing it — its shape, five main colours, and a 12×12 grid of how light and how busy each
|
|
19664
|
-
* part is. iox-cms decodes the pixels (sharp → RGBA) and calls `photoInventory`; `checkLayout` reads the grid through
|
|
19665
|
-
* `calmUnder` to judge words set over the part of the photo a frame SHOWS; the model reads `describeInventoryForPrompt`.
|
|
19666
|
-
* No DOM, no decoder: RGBA bytes in, numbers out, deterministic.
|
|
19667
|
-
*/
|
|
19668
|
-
var PhotoTone;
|
|
19669
|
-
(function (PhotoTone) {
|
|
19670
|
-
PhotoTone["Light"] = "light";
|
|
19671
|
-
PhotoTone["Dark"] = "dark";
|
|
19672
|
-
})(PhotoTone || (PhotoTone = {}));
|
|
19673
|
-
const PHOTO_GRID = 12;
|
|
19674
|
-
/** Pixels are averaged down to this width before they are measured: the prototype measured at 96 wide, and the calm
|
|
19675
|
-
* threshold below was read off its 35 proof photos at that scale (a Laplacian grows with resolution). */
|
|
19676
|
-
const PHOTO_ANALYSIS_WIDTH = 96;
|
|
19677
|
-
/** At least this many analysed rows, so a very wide photo still has a few pixels per grid row. */
|
|
19678
|
-
const MIN_ANALYSIS_HEIGHT = 48;
|
|
19679
|
-
/** Calm: the mean detail under the words is at most this. The prototype's absolute bar (0.045 at 96 px wide: the busiest
|
|
19680
|
-
* cell it called calm across the proof photos); its relative bar (≤ 0.55 × the photo's busiest cell) is not ported —
|
|
19681
|
-
* it called nothing calm on a photo that is flat everywhere. */
|
|
19682
|
-
const PHOTO_CALM_DETAIL = 0.045;
|
|
19683
|
-
/** Light: above the luminance where black and white words have the same contrast (√(1.05 × 0.05) − 0.05). */
|
|
19684
|
-
const PHOTO_LIGHT_LUMINANCE = 0.179;
|
|
19685
|
-
const COLOURS = 5;
|
|
19686
|
-
const KMEANS_ROUNDS = 12;
|
|
19687
|
-
/** Shape by width ÷ height (the prototype's `shapeOf`). */
|
|
19688
|
-
const SHAPE_FROM_RATIO = [
|
|
19689
|
-
[1.68, LayoutPhotoShape.Wide],
|
|
19690
|
-
[1.2, LayoutPhotoShape.Landscape],
|
|
19691
|
-
[0.85, LayoutPhotoShape.Square],
|
|
19692
|
-
[0.62, LayoutPhotoShape.Portrait],
|
|
19693
|
-
];
|
|
19694
|
-
const RGBA$1 = 4;
|
|
19695
|
-
const BYTE$1 = 255;
|
|
19696
|
-
/** The 3×3 parts a prompt names, in reading order (the prototype's cells). */
|
|
19697
|
-
const PARTS$2 = ['top-start', 'top', 'top-end', 'start', 'middle', 'end', 'bottom-start', 'bottom', 'bottom-end'];
|
|
19698
|
-
/** A photo's shape from its size. */
|
|
19699
|
-
function photoShapeOf(width, height) {
|
|
19700
|
-
const r = width / Math.max(1, height);
|
|
19701
|
-
return SHAPE_FROM_RATIO.find(([min]) => r >= min)?.[1] ?? LayoutPhotoShape.Tall;
|
|
19702
|
-
}
|
|
19703
|
-
const toneOf = (luminance) => (luminance > PHOTO_LIGHT_LUMINANCE ? PhotoTone.Light : PhotoTone.Dark);
|
|
19704
|
-
/** The picture averaged down to the analysis size: sRGB 0..1 per channel. */
|
|
19705
|
-
function downsample(rgba, width, height) {
|
|
19706
|
-
const w = Math.min(width, PHOTO_ANALYSIS_WIDTH);
|
|
19707
|
-
const h = Math.min(height, Math.max(MIN_ANALYSIS_HEIGHT, Math.round((w * height) / width)));
|
|
19708
|
-
const sum = new Float64Array(w * h * 3);
|
|
19709
|
-
const count = new Float64Array(w * h);
|
|
19710
|
-
for (let y = 0; y < height; y++) {
|
|
19711
|
-
const ty = Math.min(h - 1, Math.floor((y * h) / height));
|
|
19712
|
-
for (let x = 0; x < width; x++) {
|
|
19713
|
-
const tx = Math.min(w - 1, Math.floor((x * w) / width));
|
|
19714
|
-
const i = (y * width + x) * RGBA$1;
|
|
19715
|
-
const t = ty * w + tx;
|
|
19716
|
-
sum[t * 3] += rgba[i];
|
|
19717
|
-
sum[t * 3 + 1] += rgba[i + 1];
|
|
19718
|
-
sum[t * 3 + 2] += rgba[i + 2];
|
|
19719
|
-
count[t]++;
|
|
19720
|
-
}
|
|
19721
|
-
}
|
|
19722
|
-
const px = new Float64Array(w * h * 3);
|
|
19723
|
-
for (let t = 0; t < w * h; t++)
|
|
19724
|
-
for (let c = 0; c < 3; c++)
|
|
19725
|
-
px[t * 3 + c] = sum[t * 3 + c] / Math.max(1, count[t]) / BYTE$1;
|
|
19726
|
-
return { w, h, px };
|
|
19727
|
-
}
|
|
19728
|
-
/** Up to five colours by k-means over the analysed pixels, seeded from evenly spread pixels (the prototype's), most
|
|
19729
|
-
* first; centres that land on one colour are one colour. */
|
|
19730
|
-
function mainColours(px, n) {
|
|
19731
|
-
const k = Math.min(COLOURS, n);
|
|
19732
|
-
let centres = Array.from({ length: k }, (_, i) => {
|
|
19733
|
-
const p = Math.floor(((i + 0.5) * n) / k);
|
|
19734
|
-
return [px[p * 3], px[p * 3 + 1], px[p * 3 + 2]];
|
|
19735
|
-
});
|
|
19736
|
-
let counts = new Array(k).fill(0);
|
|
19737
|
-
for (let round = 0; round < KMEANS_ROUNDS; round++) {
|
|
19738
|
-
const sums = centres.map(() => [0, 0, 0]);
|
|
19739
|
-
counts = new Array(k).fill(0);
|
|
19740
|
-
for (let p = 0; p < n; p++) {
|
|
19741
|
-
let best = 0;
|
|
19742
|
-
let bestD = Infinity;
|
|
19743
|
-
for (let c = 0; c < k; c++) {
|
|
19744
|
-
const d = (px[p * 3] - centres[c][0]) ** 2 + (px[p * 3 + 1] - centres[c][1]) ** 2 + (px[p * 3 + 2] - centres[c][2]) ** 2;
|
|
19745
|
-
if (d < bestD) {
|
|
19746
|
-
bestD = d;
|
|
19747
|
-
best = c;
|
|
19748
|
-
}
|
|
19749
|
-
}
|
|
19750
|
-
for (let ch = 0; ch < 3; ch++)
|
|
19751
|
-
sums[best][ch] += px[p * 3 + ch];
|
|
19752
|
-
counts[best]++;
|
|
19753
|
-
}
|
|
19754
|
-
centres = centres.map((c, i) => (counts[i] ? sums[i].map(v => v / counts[i]) : c));
|
|
19755
|
-
}
|
|
19756
|
-
const shares = new Map();
|
|
19757
|
-
centres.forEach((c, i) => {
|
|
19758
|
-
const hex = toHexColor({ r: c[0], g: c[1], b: c[2] });
|
|
19759
|
-
shares.set(hex, (shares.get(hex) ?? 0) + counts[i]);
|
|
19760
|
-
});
|
|
19761
|
-
return [...shares].sort((a, b) => b[1] - a[1]).map(([hex]) => hex);
|
|
19762
|
-
}
|
|
19763
|
-
/** What a photo is, measured from its pixels (RGBA bytes, row by row). */
|
|
19764
|
-
function photoInventory(rgba, width, height) {
|
|
19765
|
-
const { w, h, px } = downsample(rgba, width, height);
|
|
19766
|
-
const luma = new Float64Array(w * h);
|
|
19767
|
-
const lum = new Float64Array(w * h);
|
|
19768
|
-
for (let t = 0; t < w * h; t++) {
|
|
19769
|
-
const [r, g, b] = [px[t * 3], px[t * 3 + 1], px[t * 3 + 2]];
|
|
19770
|
-
luma[t] = 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
19771
|
-
lum[t] = relativeLuminance({ r, g, b });
|
|
19772
|
-
}
|
|
19773
|
-
const at = (x, y) => luma[Math.min(h - 1, Math.max(0, y)) * w + Math.min(w - 1, Math.max(0, x))];
|
|
19774
|
-
const cells = PHOTO_GRID * PHOTO_GRID;
|
|
19775
|
-
const detail = new Array(cells).fill(0);
|
|
19776
|
-
const luminance = new Array(cells).fill(0);
|
|
19777
|
-
const count = new Array(cells).fill(0);
|
|
19778
|
-
for (let y = 0; y < h; y++) {
|
|
19779
|
-
const cy = Math.min(PHOTO_GRID - 1, Math.floor((y * PHOTO_GRID) / h));
|
|
19780
|
-
for (let x = 0; x < w; x++) {
|
|
19781
|
-
const cx = Math.min(PHOTO_GRID - 1, Math.floor((x * PHOTO_GRID) / w));
|
|
19782
|
-
const c = cy * PHOTO_GRID + cx;
|
|
19783
|
-
detail[c] += Math.abs(4 * at(x, y) - at(x - 1, y) - at(x + 1, y) - at(x, y - 1) - at(x, y + 1));
|
|
19784
|
-
luminance[c] += lum[y * w + x];
|
|
19785
|
-
count[c]++;
|
|
19786
|
-
}
|
|
19787
|
-
}
|
|
19788
|
-
const round = (v) => Math.round(v * 10000) / 10000;
|
|
19789
|
-
const mean = (v, c) => (count[c] ? v / count[c] : 0);
|
|
19790
|
-
const luminanceGrid = luminance.map((v, c) => round(mean(v, c)));
|
|
19791
|
-
return {
|
|
19792
|
-
shape: photoShapeOf(width, height),
|
|
19793
|
-
width,
|
|
19794
|
-
height,
|
|
19795
|
-
grid: { cols: PHOTO_GRID, rows: PHOTO_GRID, luminance: luminanceGrid, detail: detail.map((v, c) => round(Math.min(1, mean(v, c)))) },
|
|
19796
|
-
colours: mainColours(px, w * h),
|
|
19797
|
-
tone: toneOf(lum.reduce((a, b) => a + b, 0) / Math.max(1, w * h)),
|
|
19798
|
-
};
|
|
19799
|
-
}
|
|
19800
|
-
/** The part of the photo a frame region shows under `object-fit: cover` (centred): the frame crops the photo's longer side. */
|
|
19801
|
-
function coverCrop(inv, frame, region) {
|
|
19802
|
-
const photo = inv.width / Math.max(1, inv.height);
|
|
19803
|
-
const box = frame.w / Math.max(1, frame.h);
|
|
19804
|
-
const clamp = (v) => Math.min(1, Math.max(0, v));
|
|
19805
|
-
if (photo > box) {
|
|
19806
|
-
const shown = box / photo;
|
|
19807
|
-
const off = (1 - shown) / 2;
|
|
19808
|
-
return { x0: off + clamp(region.x0) * shown, x1: off + clamp(region.x1) * shown, y0: clamp(region.y0), y1: clamp(region.y1) };
|
|
19809
|
-
}
|
|
19810
|
-
const shown = photo / box;
|
|
19811
|
-
const off = (1 - shown) / 2;
|
|
19812
|
-
return { x0: clamp(region.x0), x1: clamp(region.x1), y0: off + clamp(region.y0) * shown, y1: off + clamp(region.y1) * shown };
|
|
19813
|
-
}
|
|
19814
|
-
/** The grid's cells under a region of the photo, each with the share of it the region covers. */
|
|
19815
|
-
function cellsUnder(inv, r) {
|
|
19816
|
-
const { cols, rows } = inv.grid;
|
|
19817
|
-
const out = [];
|
|
19818
|
-
for (let cy = 0; cy < rows; cy++) {
|
|
19819
|
-
const h = Math.min(r.y1, (cy + 1) / rows) - Math.max(r.y0, cy / rows);
|
|
19820
|
-
if (h <= 0)
|
|
19821
|
-
continue;
|
|
19822
|
-
for (let cx = 0; cx < cols; cx++) {
|
|
19823
|
-
const w = Math.min(r.x1, (cx + 1) / cols) - Math.max(r.x0, cx / cols);
|
|
19824
|
-
if (w > 0)
|
|
19825
|
-
out.push({ cell: cy * cols + cx, weight: w * h });
|
|
19826
|
-
}
|
|
19827
|
-
}
|
|
19828
|
-
return out;
|
|
19829
|
-
}
|
|
19830
|
-
/** How a region of the photo reads (fractions of the PHOTO). */
|
|
19831
|
-
function readRegion(inv, r) {
|
|
19832
|
-
const cells = cellsUnder(inv, r);
|
|
19833
|
-
const total = cells.reduce((a, c) => a + c.weight, 0);
|
|
19834
|
-
if (!total)
|
|
19835
|
-
return { calm: true, tone: inv.tone, luminance: 0, detail: 0 };
|
|
19836
|
-
const detail = cells.reduce((a, c) => a + inv.grid.detail[c.cell] * c.weight, 0) / total;
|
|
19837
|
-
const luminance = cells.reduce((a, c) => a + inv.grid.luminance[c.cell] * c.weight, 0) / total;
|
|
19838
|
-
return { calm: detail <= PHOTO_CALM_DETAIL, tone: toneOf(luminance), luminance, detail };
|
|
19839
|
-
}
|
|
19840
|
-
/**
|
|
19841
|
-
* Whether words over `region` of a frame (fractions of the FRAME, which shows the photo as `object-fit: cover`, centred)
|
|
19842
|
-
* sit on a calm part of the photo, and how light it is there. A calm band the crop cuts away is not under the words.
|
|
19843
|
-
*/
|
|
19844
|
-
function calmUnder(inv, frame, region) {
|
|
19845
|
-
return readRegion(inv, coverCrop(inv, frame, region));
|
|
19846
|
-
}
|
|
19847
|
-
/** The photo's 3×3 named parts that are calm, each light or dark (`top-start (dark)`). */
|
|
19848
|
-
function calmParts(inv) {
|
|
19849
|
-
return PARTS$2.flatMap((name, i) => {
|
|
19850
|
-
const x = i % 3;
|
|
19851
|
-
const y = Math.floor(i / 3);
|
|
19852
|
-
const read = readRegion(inv, { x0: x / 3, x1: (x + 1) / 3, y0: y / 3, y1: (y + 1) / 3 });
|
|
19853
|
-
return read.calm ? [`${name} (${read.tone})`] : [];
|
|
19854
|
-
});
|
|
19855
|
-
}
|
|
19856
|
-
/** One line a model reads instead of the photo: its id, what it shows, shape, colours and where words may sit. */
|
|
19857
|
-
function describeInventoryForPrompt(id, inv, label) {
|
|
19858
|
-
const calm = calmParts(inv);
|
|
19859
|
-
return [
|
|
19860
|
-
id,
|
|
19861
|
-
...(label?.trim() ? [label.trim()] : []),
|
|
19862
|
-
`${inv.shape}, ${inv.tone}`,
|
|
19863
|
-
`colours ${inv.colours.join(' ')}`,
|
|
19864
|
-
`calm: ${calm.length ? calm.join(', ') : 'nowhere (busy)'}`,
|
|
19865
|
-
].join(' · ');
|
|
19866
|
-
}
|
|
19867
|
-
|
|
19868
19547
|
/**
|
|
19869
19548
|
* THE LIST TABLE (list-ingredients-plan.md; the contract's `layout.mjs` `LIST`, in the shape every mixed part shares —
|
|
19870
19549
|
* ingredients.md §2): the words of each ingredient, what each means, and which wait for a later phase and are drawn as
|
|
@@ -19947,6 +19626,942 @@ function listWordRefusal(k, word, shape, tier, never) {
|
|
|
19947
19626
|
return null;
|
|
19948
19627
|
}
|
|
19949
19628
|
|
|
19629
|
+
/**
|
|
19630
|
+
* The LAYOUT WIRE (premium M8 gate 2, M8-G2-D2): the strict format a model writes ONE composed page in. Every key is
|
|
19631
|
+
* required — "none" is `''`, `0`, `[]` or `'none'` — so the request stays at 37 properties, no optional key and no
|
|
19632
|
+
* union (`strictSchemaComplexity`, held by iox-cms strict-schemas.spec). `expandLayoutWire` turns it into the layout
|
|
19633
|
+
* language (`LayoutSection[]`, what `checkLayout` judges and `composeLayout` stamps); `layoutToWire` writes a layout back
|
|
19634
|
+
* (the three proof sites, a repair's starting point). What the wire leaves out is derived, never asked: a layer's beat
|
|
19635
|
+
* (the order it is written), the look, the pace and ease, the nav, the site's name and language.
|
|
19636
|
+
*/
|
|
19637
|
+
const V$1 = SPEC_SITE_LAYOUT.vocab;
|
|
19638
|
+
const GALLERY_EFFECTS = V$1.galleryEffects;
|
|
19639
|
+
const FORM_PRESETS = V$1.formPresets;
|
|
19640
|
+
const BUTTON_VARIANTS = V$1.buttonVariants;
|
|
19641
|
+
const NONE$2 = 'none';
|
|
19642
|
+
const CLIP = 'clipReveal';
|
|
19643
|
+
const CLIP_SIDE = `${CLIP}-`;
|
|
19644
|
+
/** A gallery the wire marks `autoplay` turns every 5 s — what the proof sites' autoplaying galleries do. */
|
|
19645
|
+
const LAYOUT_WIRE_AUTOPLAY_MS = 5000;
|
|
19646
|
+
const CHIP_SLOTS = Array.from(new Set(Object.values(V$1.formChips).flat()));
|
|
19647
|
+
const SLOT_NAMES = [...V$1.formSlots, ...CHIP_SLOTS];
|
|
19648
|
+
const ENTER_ON_WIRE = V$1.enters.flatMap((e) => (e === CLIP ? V$1.sides.map((s) => `${CLIP_SIDE}${s}`) : [e]));
|
|
19649
|
+
const VARIANT_ON_WIRE = [NONE$2, ...V$1.buttonVariants, ...V$1.galleryEffects, ...V$1.formPresets];
|
|
19650
|
+
/**
|
|
19651
|
+
* List ingredients (list-ingredients-plan.md §2, LI1): a list section's mix travels as ONE list of `<ingredient>:<word>`
|
|
19652
|
+
* words (`arrange:strips`, `hover:dim`) and its parts as `<list>.<role>` (`stories.quote`) — two properties, so the
|
|
19653
|
+
* request stays inside the 40 the budget allows, and the parts enum is generated from the plan's own lists: a model
|
|
19654
|
+
* cannot name a part its list does not have (R-H2).
|
|
19655
|
+
*/
|
|
19656
|
+
var LayoutMixIngredient;
|
|
19657
|
+
(function (LayoutMixIngredient) {
|
|
19658
|
+
LayoutMixIngredient["Item"] = "item";
|
|
19659
|
+
LayoutMixIngredient["Arrange"] = "arrange";
|
|
19660
|
+
LayoutMixIngredient["Who"] = "who";
|
|
19661
|
+
LayoutMixIngredient["How"] = "how";
|
|
19662
|
+
LayoutMixIngredient["Move"] = "move";
|
|
19663
|
+
LayoutMixIngredient["Hover"] = "hover";
|
|
19664
|
+
LayoutMixIngredient["Arrive"] = "arrive";
|
|
19665
|
+
LayoutMixIngredient["Phone"] = "phone";
|
|
19666
|
+
})(LayoutMixIngredient || (LayoutMixIngredient = {}));
|
|
19667
|
+
const MIX_SEPARATOR = ':';
|
|
19668
|
+
const BASIC = 'basic';
|
|
19669
|
+
const AWARD$1 = 'award';
|
|
19670
|
+
const PART_SEPARATOR = '.';
|
|
19671
|
+
/** Every word a stored mix may hold, ingredient by ingredient (a waiting word too: a stored answer still reads). */
|
|
19672
|
+
const LAYOUT_MIX_WORDS = LIST_INGREDIENTS.flatMap(k => listIngredientWords(k).map(w => `${k}${MIX_SEPARATOR}${w}`));
|
|
19673
|
+
/** The words the wire OFFERS a site below the award tier — the built ones only (ingredients.md §3.3: a waiting word would
|
|
19674
|
+
* put its stand-in on every site that asked for it), less the award tier's (AW-D23, AW11). */
|
|
19675
|
+
const LAYOUT_MIX_OFFERED = LIST_INGREDIENTS.flatMap(k => listBuiltWords(k).filter(w => listWordOffered(k, w, BASIC)).map(w => `${k}${MIX_SEPARATOR}${w}`));
|
|
19676
|
+
/** AW11: every built word, the award tier's included — what the wire offers an award site before the lists are read. */
|
|
19677
|
+
const LAYOUT_MIX_OFFERED_AWARD = LIST_INGREDIENTS.flatMap(k => listBuiltWords(k).map(w => `${k}${MIX_SEPARATOR}${w}`));
|
|
19678
|
+
/** The column words a page of a type is offered (award §0c, AW-D34): the axis's words less what the type never wears. */
|
|
19679
|
+
function layoutColumnsOffered(never) {
|
|
19680
|
+
const blocked = new Set(never ?? []);
|
|
19681
|
+
return Object.keys(SPEC_AXES.columns).filter(w => !blocked.has(w));
|
|
19682
|
+
}
|
|
19683
|
+
/** The column the layout wire offers, or none: given words and no carry. */
|
|
19684
|
+
const columnsOnWire = (options) => options.columns?.length && !options.carry ? options.columns : null;
|
|
19685
|
+
/** AW10: the entrance and the switch a look that never scrubs is not offered. */
|
|
19686
|
+
const LETTERS = 'letters';
|
|
19687
|
+
const SCRUB_FLAG = 'scrub';
|
|
19688
|
+
/** The entrances the wire offers under the look's scrub (AW10 H3). */
|
|
19689
|
+
function layoutEntersOffered(scrub) {
|
|
19690
|
+
return ENTER_ON_WIRE.filter(e => e !== LETTERS || scrubOffered(scrub));
|
|
19691
|
+
}
|
|
19692
|
+
/** The switches the wire offers under the look's scrub (AW10 H3). */
|
|
19693
|
+
function layoutFlagsOffered(scrub) {
|
|
19694
|
+
return V$1.flags.filter(f => f !== SCRUB_FLAG || scrubOffered(scrub));
|
|
19695
|
+
}
|
|
19696
|
+
const scrubOffered = (scrub) => !!scrub && scrub !== ScrubId.Never && isScrubId(scrub);
|
|
19697
|
+
/** A handle the wire places as a whole SECTION (RD-D20): a bound part, a block or a kept section. */
|
|
19698
|
+
const SECTION_HANDLE = /^(?:bind|block|keep):/;
|
|
19699
|
+
/** Is `handle` one a section places whole (`bind:`/`block:`/`keep:`), never a layer's words or photo? */
|
|
19700
|
+
function isSectionCarryHandle(handle) {
|
|
19701
|
+
return SECTION_HANDLE.test(handle);
|
|
19702
|
+
}
|
|
19703
|
+
/**
|
|
19704
|
+
* The mix words offered to a business whose lists never do `never` (L-D12): the built words less the forbidden ones —
|
|
19705
|
+
* and since AW11, the award tier's only to an award site, and a word NO list of the plan can carry (a second picture, a
|
|
19706
|
+
* picture at all) never (R-H-AW11-7: the one table, `listWordRefusal`; `checkList` judges each list).
|
|
19707
|
+
*/
|
|
19708
|
+
function layoutMixOffered(never, options = {}) {
|
|
19709
|
+
const banned = new Set([...(never?.arranges ?? []).map(w => `arrange${MIX_SEPARATOR}${w}`), ...(never?.moves ?? []).map(w => `move${MIX_SEPARATOR}${w}`)]);
|
|
19710
|
+
const offered = options.tier === AWARD$1 ? LAYOUT_MIX_OFFERED_AWARD : LAYOUT_MIX_OFFERED;
|
|
19711
|
+
const lists = options.lists;
|
|
19712
|
+
return offered.filter(w => {
|
|
19713
|
+
if (banned.has(w))
|
|
19714
|
+
return false;
|
|
19715
|
+
if (!lists?.length)
|
|
19716
|
+
return true;
|
|
19717
|
+
const [k, word] = w.split(MIX_SEPARATOR);
|
|
19718
|
+
return lists.some(l => listWordRefusal(k, word, l) === null);
|
|
19719
|
+
});
|
|
19720
|
+
}
|
|
19721
|
+
const mixHint = (offered) => LIST_INGREDIENTS.map(k => {
|
|
19722
|
+
const words = offered.filter(w => w.startsWith(`${k}${MIX_SEPARATOR}`)).map(w => w.slice(k.length + MIX_SEPARATOR.length));
|
|
19723
|
+
return `${k}:${words.join('|')}${LIST_TABLE.many.includes(k) ? ' (any)' : ''}`;
|
|
19724
|
+
}).join(' · ');
|
|
19725
|
+
/** `<list>.<role>` for every role of every list — what a list section's `parts` may name. */
|
|
19726
|
+
function layoutWirePartWords(lists) {
|
|
19727
|
+
return lists.flatMap(l => l.roles.map(r => `${l.alias}${PART_SEPARATOR}${r}`));
|
|
19728
|
+
}
|
|
19729
|
+
const text$1 = (d) => ({ ...jsonText(), description: d });
|
|
19730
|
+
const integer = (d) => ({ ...jsonInteger(), description: d });
|
|
19731
|
+
const oneOf$1 = (values, d) => ({ ...jsonOneOf(values), description: d });
|
|
19732
|
+
const listOf$2 = (items, d) => ({ ...jsonListOf(items), description: d });
|
|
19733
|
+
const closed = (properties, d) => jsonClosedObject(properties, Object.keys(properties), d);
|
|
19734
|
+
/** The strict format for one composed page — with the list ingredients when `options.lists` is given. */
|
|
19735
|
+
function layoutWireJsonSchema(options = {}) {
|
|
19736
|
+
const partWords = options.lists ? layoutWirePartWords(options.lists) : [];
|
|
19737
|
+
// A list (round one) keeps today's offer exactly: the plan's lists narrow only what the award tier adds.
|
|
19738
|
+
const mixOffered = options.tier === AWARD$1 ? layoutMixOffered(options.never, { tier: AWARD$1, lists: options.lists }) : layoutMixOffered(options.never);
|
|
19739
|
+
const lists = options.lists
|
|
19740
|
+
? {
|
|
19741
|
+
mix: listOf$2(jsonOneOf(mixOffered), `gallery showing a list (source): how its items are shown, one word per choice — ${mixHint(mixOffered)}; [] for none`),
|
|
19742
|
+
parts: listOf$2(jsonOneOf(partWords.length ? partWords : [NONE$2]), "gallery showing a list as cards: the list's fields each card shows, <list>.<role>, the source's own; [] for none"),
|
|
19743
|
+
}
|
|
19744
|
+
: {};
|
|
19745
|
+
const carried = options.carry
|
|
19746
|
+
? {
|
|
19747
|
+
carry: oneOf$1([NONE$2, ...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"),
|
|
19748
|
+
}
|
|
19749
|
+
: {};
|
|
19750
|
+
const layer = closed({
|
|
19751
|
+
kind: oneOf$1(V$1.kinds, 'what the layer is'),
|
|
19752
|
+
role: oneOf$1(V$1.roles, 'lead: the ONE thing the eye finds first in its section · support: follows it · decoration: only fades · static: never moves'),
|
|
19753
|
+
text: text$1("the words (word, heading, text, label, number, button); '' for none; a fact you were not given is {fact:<key>}"),
|
|
19754
|
+
items: listOf$2(jsonText(), 'list items · marquee phrases · one caption per gallery photo; [] for none'),
|
|
19755
|
+
photos: listOf$2(jsonText(), 'photo: one photo id · gallery: its slides, in order; ids from the photos you are given; [] for none'),
|
|
19756
|
+
source: text$1("gallery: the alias of a list data source whose items it shows instead of photos; '' for none"),
|
|
19757
|
+
box: listOf$2(jsonInteger(), '[colStart, colEnd, rowStart, rowEnd]: grid lines 1..13 (1..12×hold+1 sideways) and 1..rows+1'),
|
|
19758
|
+
size: oneOf$1([NONE$2, ...V$1.sizes], "type size; 'screen' = as wide as its columns, a word, never a sentence"),
|
|
19759
|
+
color: oneOf$1(V$1.colours, "the look's colour by name"),
|
|
19760
|
+
align: oneOf$1(V$1.aligns, 'text alignment'),
|
|
19761
|
+
z: integer('0..9 stacking'),
|
|
19762
|
+
bleed: oneOf$1(V$1.bleeds, 'runs off the screen at that edge'),
|
|
19763
|
+
rotate: integer("degrees, within the look's limit"),
|
|
19764
|
+
to: text$1("button: a section id of this page or a page route ('/contact'); '' for none"),
|
|
19765
|
+
variant: oneOf$1(VARIANT_ON_WIRE, 'button: primary | secondary | ghost · gallery: its effect · form: its preset · none'),
|
|
19766
|
+
enter: oneOf$1(layoutEntersOffered(options.scrub), scrubOffered(options.scrub)
|
|
19767
|
+
? 'plays once as it arrives (time); clipReveal opens from that side; letters: a line of words rises letter by letter (a display line)'
|
|
19768
|
+
: 'plays once as it arrives (time); clipReveal opens from that side'),
|
|
19769
|
+
depth: oneOf$1([NONE$2, ...V$1.depths], 'the parallax trio (not in held sections)'),
|
|
19770
|
+
inner: integer('0..3: how far a photo drifts inside its frame'),
|
|
19771
|
+
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`),
|
|
19772
|
+
perView: { type: 'number', description: 'gallery slides per view; 0 for none' },
|
|
19773
|
+
slots: listOf$2(closed({ slot: oneOf$1(SLOT_NAMES, 'which words'), text: text$1('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"),
|
|
19774
|
+
motion: listOf$2(closed({
|
|
19775
|
+
prop: oneOf$1(V$1.trackProps, 'what moves'),
|
|
19776
|
+
ease: oneOf$1(V$1.eases, 'how'),
|
|
19777
|
+
values: listOf$2({ type: 'number' }, '[from, to, at0, at1]: values and the part of the hold it plays over (0..1)'),
|
|
19778
|
+
}), 'held sections only: tracks the scroll plays; [] for none'),
|
|
19779
|
+
...lists,
|
|
19780
|
+
...carried,
|
|
19781
|
+
});
|
|
19782
|
+
const section = closed({
|
|
19783
|
+
id: text$1('a short slug, unique on the page'),
|
|
19784
|
+
kind: oneOf$1(V$1.sectionKinds, 'content · inhale (a breath: ≤ 2 small layers, no photo) · signature (exactly ONE)'),
|
|
19785
|
+
screens: integer('1..5 screen heights'),
|
|
19786
|
+
hold: integer('0 flows · 1 held (the page stops while its layers move) · 2..4 held and carried sideways that many screens'),
|
|
19787
|
+
ground: text$1("a colour name, or photo:<id>"),
|
|
19788
|
+
rows: integer('4..16 grid rows'),
|
|
19789
|
+
transition: oneOf$1(V$1.transitions, 'how it arrives over the section before'),
|
|
19790
|
+
phone: listOf$2(jsonInteger(), "every layer's index exactly once, in a phone's reading order"),
|
|
19791
|
+
layers: listOf$2(layer, 'the layers'),
|
|
19792
|
+
});
|
|
19793
|
+
const columns = columnsOnWire(options);
|
|
19794
|
+
const page = columns
|
|
19795
|
+
? { column: oneOf$1(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") }
|
|
19796
|
+
: {};
|
|
19797
|
+
return closed({ ...page, sections: listOf$2(section, '4..8 sections') }, 'one composed page in the layout language');
|
|
19798
|
+
}
|
|
19799
|
+
const nonEmpty$2 = (v) => typeof v === 'string' && v.trim() !== '';
|
|
19800
|
+
const num = (v, fallback = 0) => (typeof v === 'number' && Number.isFinite(v) ? v : fallback);
|
|
19801
|
+
const strings = (v) => (Array.isArray(v) ? v.filter((x) => typeof x === 'string') : []);
|
|
19802
|
+
function expandForm(l, preset) {
|
|
19803
|
+
const form = { preset: preset };
|
|
19804
|
+
const options = {};
|
|
19805
|
+
for (const s of Array.isArray(l['slots']) ? l['slots'] : []) {
|
|
19806
|
+
if (!isPlainObject(s) || !nonEmpty$2(s['text']))
|
|
19807
|
+
continue;
|
|
19808
|
+
const slot = String(s['slot']);
|
|
19809
|
+
const words = String(s['text']).trim();
|
|
19810
|
+
if (CHIP_SLOTS.includes(slot))
|
|
19811
|
+
(options[slot] ??= []).push(words);
|
|
19812
|
+
else if (slot === 'channel')
|
|
19813
|
+
form.channel = { label: words };
|
|
19814
|
+
else if (slot === 'title' || slot === 'intro' || slot === 'submit' || slot === 'successTitle' || slot === 'successText')
|
|
19815
|
+
form[slot] = words;
|
|
19816
|
+
}
|
|
19817
|
+
if (Object.keys(options).length)
|
|
19818
|
+
form.options = options;
|
|
19819
|
+
return form;
|
|
19820
|
+
}
|
|
19821
|
+
function expandGallery(l, flags, variant) {
|
|
19822
|
+
const captions = strings(l['items']);
|
|
19823
|
+
const gallery = {
|
|
19824
|
+
slides: strings(l['photos']).map((id, i) => ({ photo: { id }, ...(nonEmpty$2(captions[i]) ? { caption: captions[i] } : {}) })),
|
|
19825
|
+
};
|
|
19826
|
+
if (GALLERY_EFFECTS.includes(variant))
|
|
19827
|
+
gallery.effect = variant;
|
|
19828
|
+
const perView = num(l['perView']);
|
|
19829
|
+
if (perView > 0)
|
|
19830
|
+
gallery.perView = perView;
|
|
19831
|
+
for (const f of ['centered', 'freeMode', 'loop', 'drift', 'scroll'])
|
|
19832
|
+
if (flags.has(f))
|
|
19833
|
+
gallery[f] = true;
|
|
19834
|
+
if (flags.has('autoplay'))
|
|
19835
|
+
gallery.autoplay = LAYOUT_WIRE_AUTOPLAY_MS;
|
|
19836
|
+
if (nonEmpty$2(l['source']))
|
|
19837
|
+
gallery.source = String(l['source']).trim();
|
|
19838
|
+
const list = expandListMix(l, gallery);
|
|
19839
|
+
if (list)
|
|
19840
|
+
gallery.list = list;
|
|
19841
|
+
return gallery;
|
|
19842
|
+
}
|
|
19843
|
+
/** `mix` + `parts` → a list mix, or null when the wire names no mix. Words are kept as written (`checkList` judges them);
|
|
19844
|
+
* parts of another list than the gallery's are left out, and the first part names the list when `source` is empty. */
|
|
19845
|
+
function expandListMix(l, gallery) {
|
|
19846
|
+
const words = strings(l['mix']);
|
|
19847
|
+
if (!words.length)
|
|
19848
|
+
return null;
|
|
19849
|
+
const parts = strings(l['parts']).filter(p => p !== NONE$2).map(p => {
|
|
19850
|
+
const at = p.lastIndexOf(PART_SEPARATOR);
|
|
19851
|
+
return at > 0 ? { list: p.slice(0, at), role: p.slice(at + 1) } : null;
|
|
19852
|
+
}).filter((p) => !!p);
|
|
19853
|
+
if (!gallery.source && parts[0])
|
|
19854
|
+
gallery.source = parts[0].list;
|
|
19855
|
+
return listMixFromWords(words, parts.filter(p => p.list === gallery.source).map(p => p.role));
|
|
19856
|
+
}
|
|
19857
|
+
/**
|
|
19858
|
+
* `<ingredient>:<word>` words (the wire's `mix`, or what a composed list's frame stores — design-core `LIST_MIX_PROP`)
|
|
19859
|
+
* and the roles each item shows → a list mix, or null when there are no words. Words are kept as written (`checkList`
|
|
19860
|
+
* judges them); what is not named takes the wire's defaults. Bindings ▸ List reads a list back through this.
|
|
19861
|
+
*/
|
|
19862
|
+
function listMixFromWords(words, parts = []) {
|
|
19863
|
+
if (!words.length)
|
|
19864
|
+
return null;
|
|
19865
|
+
const picked = new Map();
|
|
19866
|
+
for (const w of words) {
|
|
19867
|
+
const at = w.indexOf(MIX_SEPARATOR);
|
|
19868
|
+
if (at > 0)
|
|
19869
|
+
(picked.get(w.slice(0, at)) ?? picked.set(w.slice(0, at), []).get(w.slice(0, at))).push(w.slice(at + 1));
|
|
19870
|
+
}
|
|
19871
|
+
const one = (k) => picked.get(k)?.[0];
|
|
19872
|
+
const own = [...parts];
|
|
19873
|
+
const arrange = (one(LayoutMixIngredient.Arrange) ?? LayoutListArrange.Row);
|
|
19874
|
+
const who = one(LayoutMixIngredient.Who);
|
|
19875
|
+
const how = one(LayoutMixIngredient.How);
|
|
19876
|
+
return {
|
|
19877
|
+
item: (one(LayoutMixIngredient.Item) ?? (own.length ? LayoutListItem.Card : LayoutListItem.Photo)),
|
|
19878
|
+
parts: Array.from(new Set(own)),
|
|
19879
|
+
arrange,
|
|
19880
|
+
...(who && who !== LayoutListWho.None ? { standout: { who: who, ...(how ? { how: how } : {}) } } : {}),
|
|
19881
|
+
move: Array.from(new Set(picked.get(LayoutMixIngredient.Move) ?? [])),
|
|
19882
|
+
hover: Array.from(new Set(picked.get(LayoutMixIngredient.Hover) ?? [])),
|
|
19883
|
+
arrive: (one(LayoutMixIngredient.Arrive) ?? LayoutListArrive.Together),
|
|
19884
|
+
phone: (one(LayoutMixIngredient.Phone) ?? (arrange === LayoutListArrange.Row ? LayoutListPhone.Swipe : LayoutListPhone.Stack)),
|
|
19885
|
+
};
|
|
19886
|
+
}
|
|
19887
|
+
/** A list mix's words, `<ingredient>:<word>` — the wire's `mix`, and what a composed list's frame stores (AW11,
|
|
19888
|
+
* design-core `LIST_MIX_PROP`) for Bindings ▸ List and the shared CSS. */
|
|
19889
|
+
function listMixWords(mix) {
|
|
19890
|
+
const w = (k, v) => `${k}${MIX_SEPARATOR}${v}`;
|
|
19891
|
+
return [
|
|
19892
|
+
w(LayoutMixIngredient.Item, mix.item), w(LayoutMixIngredient.Arrange, mix.arrange),
|
|
19893
|
+
...(mix.standout ? [w(LayoutMixIngredient.Who, mix.standout.who), ...(mix.standout.how ? [w(LayoutMixIngredient.How, mix.standout.how)] : [])] : []),
|
|
19894
|
+
...mix.move.map(m => w(LayoutMixIngredient.Move, m)), ...mix.hover.map(h => w(LayoutMixIngredient.Hover, h)),
|
|
19895
|
+
w(LayoutMixIngredient.Arrive, mix.arrive), w(LayoutMixIngredient.Phone, mix.phone),
|
|
19896
|
+
];
|
|
19897
|
+
}
|
|
19898
|
+
/** A list mix → the wire's `mix` words and `parts`. */
|
|
19899
|
+
function listMixToWire(mix, source) {
|
|
19900
|
+
return { mix: listMixWords(mix), parts: mix.parts.map(r => `${source}${PART_SEPARATOR}${r}`) };
|
|
19901
|
+
}
|
|
19902
|
+
function expandTrack(t) {
|
|
19903
|
+
const v = Array.isArray(t['values']) ? t['values'].map(x => num(x)) : [];
|
|
19904
|
+
return { prop: String(t['prop']), from: v[0] ?? 0, to: v[1] ?? 0, at: [v[2] ?? 0, v[3] ?? 1], ease: String(t['ease']) };
|
|
19905
|
+
}
|
|
19906
|
+
function expandLayer(l, beat) {
|
|
19907
|
+
const kind = String(l['kind']);
|
|
19908
|
+
const box = Array.isArray(l['box']) ? l['box'].map(x => num(x)) : [];
|
|
19909
|
+
const flags = new Set(strings(l['flags']));
|
|
19910
|
+
const variant = String(l['variant'] ?? NONE$2);
|
|
19911
|
+
const out = {
|
|
19912
|
+
kind: kind,
|
|
19913
|
+
role: String(l['role']),
|
|
19914
|
+
col: [box[0] ?? 1, box[1] ?? 2],
|
|
19915
|
+
row: [box[2] ?? 1, box[3] ?? 2],
|
|
19916
|
+
};
|
|
19917
|
+
if (nonEmpty$2(l['text']))
|
|
19918
|
+
out.text = String(l['text']);
|
|
19919
|
+
const items = strings(l['items']);
|
|
19920
|
+
if (items.length && kind !== 'gallery')
|
|
19921
|
+
out.items = items;
|
|
19922
|
+
if (kind === 'photo' && strings(l['photos'])[0])
|
|
19923
|
+
out.photo = { id: strings(l['photos'])[0] };
|
|
19924
|
+
if (kind === 'gallery')
|
|
19925
|
+
out.gallery = expandGallery(l, flags, variant);
|
|
19926
|
+
if (kind === 'form')
|
|
19927
|
+
out.form = expandForm(l, FORM_PRESETS.includes(variant) ? variant : 'contact');
|
|
19928
|
+
if (kind === 'button' && BUTTON_VARIANTS.includes(variant))
|
|
19929
|
+
out.variant = variant;
|
|
19930
|
+
if (nonEmpty$2(l['size']) && l['size'] !== NONE$2)
|
|
19931
|
+
out.size = String(l['size']);
|
|
19932
|
+
if (nonEmpty$2(l['color']))
|
|
19933
|
+
out.color = String(l['color']);
|
|
19934
|
+
if (nonEmpty$2(l['align']))
|
|
19935
|
+
out.align = String(l['align']);
|
|
19936
|
+
if (num(l['z']))
|
|
19937
|
+
out.z = num(l['z']);
|
|
19938
|
+
if (nonEmpty$2(l['bleed']) && l['bleed'] !== NONE$2)
|
|
19939
|
+
out.bleed = String(l['bleed']);
|
|
19940
|
+
if (num(l['rotate']))
|
|
19941
|
+
out.rotate = num(l['rotate']);
|
|
19942
|
+
if (nonEmpty$2(l['to']))
|
|
19943
|
+
out.to = String(l['to']).trim();
|
|
19944
|
+
if (flags.has('scrim'))
|
|
19945
|
+
out.scrim = true;
|
|
19946
|
+
if (flags.has('kinetic'))
|
|
19947
|
+
out.kinetic = true;
|
|
19948
|
+
if (flags.has('contain'))
|
|
19949
|
+
out.fit = 'contain';
|
|
19950
|
+
if (flags.has(SCRUB_FLAG))
|
|
19951
|
+
out.scrub = true;
|
|
19952
|
+
const enter = String(l['enter'] ?? NONE$2);
|
|
19953
|
+
if (enter.startsWith(CLIP_SIDE)) {
|
|
19954
|
+
out.enter = CLIP;
|
|
19955
|
+
out.from = enter.slice(CLIP_SIDE.length);
|
|
19956
|
+
}
|
|
19957
|
+
else if (enter !== NONE$2)
|
|
19958
|
+
out.enter = enter;
|
|
19959
|
+
if (out.enter)
|
|
19960
|
+
out.beat = beat;
|
|
19961
|
+
if (nonEmpty$2(l['depth']) && l['depth'] !== NONE$2)
|
|
19962
|
+
out.depth = String(l['depth']);
|
|
19963
|
+
if (num(l['inner']))
|
|
19964
|
+
out.inner = num(l['inner']);
|
|
19965
|
+
const motion = (Array.isArray(l['motion']) ? l['motion'] : []).filter(isPlainObject).map(expandTrack);
|
|
19966
|
+
if (motion.length)
|
|
19967
|
+
out.motion = motion;
|
|
19968
|
+
if (nonEmpty$2(l['carry']) && l['carry'] !== NONE$2)
|
|
19969
|
+
out.carry = String(l['carry']).trim();
|
|
19970
|
+
return out;
|
|
19971
|
+
}
|
|
19972
|
+
/**
|
|
19973
|
+
* A section's beats, never asked: the lead enters first; every other entering layer takes the next beat in the order it
|
|
19974
|
+
* was written, held at the stagger's last (Emil's shrinking stagger reads the beat and stops shrinking at the sixth; the
|
|
19975
|
+
* prototype wrote it on fewer than half the layers). ONE rule
|
|
19976
|
+
* for the wire's expansion and for a page a repair edited (`applyLayoutEdits`).
|
|
19977
|
+
*/
|
|
19978
|
+
function derivedBeats(layers) {
|
|
19979
|
+
const last = LAYOUT_BEAT_DELAY.length - 1;
|
|
19980
|
+
let beat = 0;
|
|
19981
|
+
return layers.map(l => (l.role === 'lead' ? 0 : String(l.enter ?? NONE$2) !== NONE$2 ? Math.min(++beat, last) : 0));
|
|
19982
|
+
}
|
|
19983
|
+
function expandSection(s) {
|
|
19984
|
+
const kind = String(s['kind']);
|
|
19985
|
+
const hold = Math.max(0, Math.round(num(s['hold'])));
|
|
19986
|
+
const wired = (Array.isArray(s['layers']) ? s['layers'] : []).filter(isPlainObject);
|
|
19987
|
+
// RD-D20: a section whose ONLY layer names a bound part, a block or a kept section IS that part — a section place.
|
|
19988
|
+
const whole = wired.length === 1 && nonEmpty$2(wired[0]['carry']) && isSectionCarryHandle(String(wired[0]['carry']).trim())
|
|
19989
|
+
? String(wired[0]['carry']).trim() : null;
|
|
19990
|
+
if (whole)
|
|
19991
|
+
return { id: String(s['id'] ?? ''), screens: 1, rows: 1, layers: [], phone: [], carry: whole };
|
|
19992
|
+
const beats = derivedBeats(wired);
|
|
19993
|
+
const layers = wired.map((l, i) => expandLayer(l, beats[i]));
|
|
19994
|
+
const out = {
|
|
19995
|
+
id: String(s['id'] ?? ''),
|
|
19996
|
+
screens: num(s['screens'], 1),
|
|
19997
|
+
rows: num(s['rows'], 8),
|
|
19998
|
+
ground: String(s['ground'] ?? 'ground'),
|
|
19999
|
+
transition: String(s['transition'] ?? 'cut'),
|
|
20000
|
+
layers,
|
|
20001
|
+
phone: Array.isArray(s['phone']) ? s['phone'].map(x => num(x, -1)) : [],
|
|
20002
|
+
};
|
|
20003
|
+
if (kind === 'inhale')
|
|
20004
|
+
out.kind = 'inhale';
|
|
20005
|
+
if (kind === 'signature')
|
|
20006
|
+
out.signature = true;
|
|
20007
|
+
if (hold >= 1)
|
|
20008
|
+
out.pin = true;
|
|
20009
|
+
if (hold >= 2)
|
|
20010
|
+
out.track = hold;
|
|
20011
|
+
return out;
|
|
20012
|
+
}
|
|
20013
|
+
/**
|
|
20014
|
+
* The wire → a layout page. Refuses (issues with a path) only what it cannot read at all — a missing `sections`, a
|
|
20015
|
+
* section or layer that is not an object; everything a model can get wrong in a well-formed answer is `checkLayout`'s.
|
|
20016
|
+
*/
|
|
20017
|
+
function expandLayoutWire(wire, dial) {
|
|
20018
|
+
const issues = [];
|
|
20019
|
+
const add = (path, message) => issues.push({ code: LayoutIssueCode.Shape, path, message });
|
|
20020
|
+
if (!isPlainObject(wire) || !Array.isArray(wire['sections'])) {
|
|
20021
|
+
add('sections', 'the answer has no sections');
|
|
20022
|
+
return { page: null, issues };
|
|
20023
|
+
}
|
|
20024
|
+
wire['sections'].forEach((s, i) => {
|
|
20025
|
+
if (!isPlainObject(s))
|
|
20026
|
+
add(`sections[${i}]`, 'not an object');
|
|
20027
|
+
else if (!Array.isArray(s['layers']))
|
|
20028
|
+
add(`sections[${i}].layers`, 'no layers');
|
|
20029
|
+
else
|
|
20030
|
+
s['layers'].forEach((l, j) => { if (!isPlainObject(l))
|
|
20031
|
+
add(`sections[${i}].layers[${j}]`, 'not an object'); });
|
|
20032
|
+
});
|
|
20033
|
+
if (issues.length)
|
|
20034
|
+
return { page: null, issues };
|
|
20035
|
+
// A word outside the axis is kept as written (`checkLayout` refuses it with a path); none is the site's.
|
|
20036
|
+
const column = typeof wire['column'] === 'string' && wire['column'].trim() ? String(wire['column']).trim() : null;
|
|
20037
|
+
return { page: { dial, sections: wire['sections'].map(expandSection), ...(column ? { column } : {}) }, issues: [] };
|
|
20038
|
+
}
|
|
20039
|
+
function layerToWire(l) {
|
|
20040
|
+
const g = l.gallery;
|
|
20041
|
+
const f = l.form;
|
|
20042
|
+
const flags = [
|
|
20043
|
+
l.scrim && 'scrim', l.kinetic && 'kinetic', l.fit === 'contain' && 'contain',
|
|
20044
|
+
g?.centered && 'centered', g?.freeMode && 'freeMode', g?.loop && 'loop', g?.drift && 'drift', g?.scroll && 'scroll', g?.autoplay ? 'autoplay' : null,
|
|
20045
|
+
l.scrub && SCRUB_FLAG,
|
|
20046
|
+
].filter((x) => !!x);
|
|
20047
|
+
const slots = f
|
|
20048
|
+
? [
|
|
20049
|
+
...['title', 'intro', 'submit', 'successTitle', 'successText'].filter(k => nonEmpty$2(f[k])).map(k => ({ slot: k, text: String(f[k]) })),
|
|
20050
|
+
...(f.channel?.label ? [{ slot: 'channel', text: f.channel.label }] : []),
|
|
20051
|
+
...Object.entries(f.options ?? {}).flatMap(([slot, words]) => (words ?? []).map(t => ({ slot, text: t }))),
|
|
20052
|
+
]
|
|
20053
|
+
: [];
|
|
20054
|
+
return {
|
|
20055
|
+
kind: l.kind,
|
|
20056
|
+
role: l.role ?? 'support',
|
|
20057
|
+
text: l.text ?? '',
|
|
20058
|
+
items: g ? g.slides.map(s => s.caption ?? '') : l.items ?? [],
|
|
20059
|
+
photos: g ? g.slides.map(s => s.photo?.id ?? '') : l.photo ? [l.photo.id] : [],
|
|
20060
|
+
source: g?.source ?? '',
|
|
20061
|
+
box: [...(l.col ?? [1, 2]), ...(l.row ?? [1, 2])],
|
|
20062
|
+
size: l.size ?? NONE$2,
|
|
20063
|
+
color: l.color ?? 'ink',
|
|
20064
|
+
align: l.align ?? 'start',
|
|
20065
|
+
z: l.z ?? 0,
|
|
20066
|
+
bleed: l.bleed ?? NONE$2,
|
|
20067
|
+
rotate: l.rotate ?? 0,
|
|
20068
|
+
to: l.to ?? '',
|
|
20069
|
+
variant: l.variant ?? g?.effect ?? f?.preset ?? NONE$2,
|
|
20070
|
+
enter: l.enter === CLIP ? `${CLIP_SIDE}${l.from ?? 'bottom'}` : l.enter ?? NONE$2,
|
|
20071
|
+
depth: l.depth ?? NONE$2,
|
|
20072
|
+
inner: l.inner ?? 0,
|
|
20073
|
+
flags,
|
|
20074
|
+
perView: typeof g?.perView === 'number' ? g.perView : 0,
|
|
20075
|
+
slots,
|
|
20076
|
+
motion: (l.motion ?? []).map(t => ({ prop: t.prop, ease: t.ease ?? 'out', values: [t.from, t.to, ...(t.at ?? [0, 1])] })),
|
|
20077
|
+
...(g?.list ? listMixToWire(g.list, g.source ?? '') : {}),
|
|
20078
|
+
...(l.carry ? { carry: l.carry } : {}),
|
|
20079
|
+
};
|
|
20080
|
+
}
|
|
20081
|
+
/** A section place (RD-D20) on the wire: ONE layer naming its handle — what `expandSection` reads back as the place. */
|
|
20082
|
+
function carryPlaceToWire(s) {
|
|
20083
|
+
const layer = {
|
|
20084
|
+
kind: 'text', role: 'lead', text: '', items: [], photos: [], source: '', box: [1, 13, 1, 2], size: NONE$2, color: 'ink', align: 'start',
|
|
20085
|
+
z: 0, bleed: NONE$2, rotate: 0, to: '', variant: NONE$2, enter: NONE$2, depth: NONE$2, inner: 0, flags: [], perView: 0, slots: [], motion: [],
|
|
20086
|
+
carry: s.carry,
|
|
20087
|
+
};
|
|
20088
|
+
return { id: s.id, kind: 'content', screens: 1, hold: 0, ground: 'ground', rows: 4, transition: 'cut', phone: [0], layers: [layer] };
|
|
20089
|
+
}
|
|
20090
|
+
/** A layout page (or a saved CL2.1 site's sections) → the wire. */
|
|
20091
|
+
function layoutToWire(page) {
|
|
20092
|
+
return {
|
|
20093
|
+
...(columnWordOf(page.column) ? { column: page.column } : {}),
|
|
20094
|
+
sections: page.sections.map(s => (s.carry ? carryPlaceToWire(s) : {
|
|
20095
|
+
id: s.id,
|
|
20096
|
+
kind: s.signature ? 'signature' : s.kind ?? 'content',
|
|
20097
|
+
screens: s.screens,
|
|
20098
|
+
hold: s.pin ? s.track ?? 1 : 0,
|
|
20099
|
+
ground: s.ground ?? 'ground',
|
|
20100
|
+
rows: s.rows,
|
|
20101
|
+
transition: s.transition ?? 'cut',
|
|
20102
|
+
phone: s.phone ?? [],
|
|
20103
|
+
layers: s.layers.map(layerToWire),
|
|
20104
|
+
})),
|
|
20105
|
+
};
|
|
20106
|
+
}
|
|
20107
|
+
|
|
20108
|
+
/**
|
|
20109
|
+
* A COMPOSED page on the content column (award plan §0c, CW2 — AW-D33…AW-D41). Every composed (CL2) section is the
|
|
20110
|
+
* 12-column grid the layout language places its layers on; since CW2 that grid sits on the SAME edge as the header, the
|
|
20111
|
+
* footer and every pattern section: `space-inline` (= max(the one gutter `space-edge`, half of what the column leaves)).
|
|
20112
|
+
*
|
|
20113
|
+
* - The grid's inset is two OUTER tracks, never padding: `[bleed] inset − gap [12 columns] inset − gap [bleed]` — so a
|
|
20114
|
+
* layer that bleeds spans into an outer track and reaches the window's edge with no negative margin (T-CW2: a `%` in a
|
|
20115
|
+
* cell's margin is the CELL's). A `%` in `grid-template-columns` is the grid's own width, which for a section is the
|
|
20116
|
+
* page's (the engine's page without its scrollbar, the canvas's simulated frame) — what `space-inline`'s `%` means.
|
|
20117
|
+
* - A grid a sideways section carries `t` screens wide resolves its `%` against `t` pages: its inset is written for it
|
|
20118
|
+
* from the same tokens (`layoutTrackInset`).
|
|
20119
|
+
* - What cannot read a token — a `screen` word's size (a `%` in `font-size` is the parent's size) and the bar of a gallery
|
|
20120
|
+
* that bleeds (a `%` there is the slider's) — is stamped from the PAGE's word at compose time (`layoutColumnPx`): the
|
|
20121
|
+
* word composeSite writes as `pageSettings.column`. Wide stamps exactly what a page was before the column.
|
|
20122
|
+
*/
|
|
20123
|
+
/** The one inset every composed grid reads — the token, with today's composed gutter where a studio's rows predate it. */
|
|
20124
|
+
const LAYOUT_INSET = 'var(--iox-space-inline, max(4vw, 16px))';
|
|
20125
|
+
/** What a composed section stamped before CW2 (`max(4vw, 16px)` a side): the old grid's gutter. */
|
|
20126
|
+
const LAYOUT_LEGACY_GUTTER = 'max(4vw, 16px)';
|
|
20127
|
+
/** The share of the window the one gutter takes (`space-edge` = max(4%, space-gutter)) — the contract's `axes.edgeShare`. */
|
|
20128
|
+
const EDGE_SHARE = String(SPEC_AXES.edgeShare);
|
|
20129
|
+
const EDGE_SHARE_NUM = parseFloat(EDGE_SHARE) / 100;
|
|
20130
|
+
const GUTTER_FALLBACK = '16px';
|
|
20131
|
+
/** The density a column is read at when the design names none (the packs' usual Spacing). */
|
|
20132
|
+
const DEFAULT_DENSITY = 'regular';
|
|
20133
|
+
const GRID$3 = 12;
|
|
20134
|
+
/** The column gap in vw (`LAYOUT_COLUMN_GAP`, `1.2vw`). */
|
|
20135
|
+
const GAP_VW = parseFloat(LAYOUT_COLUMN_GAP);
|
|
20136
|
+
/**
|
|
20137
|
+
* The inset of a grid `track` screens wide, from its own width: a section (`track` 1) reads `space-inline` itself; a
|
|
20138
|
+
* sideways section's track holds its `%` against `track` pages, so the same rule is written over `100% / track`.
|
|
20139
|
+
*/
|
|
20140
|
+
function layoutTrackInset(track = 1) {
|
|
20141
|
+
if (track <= 1)
|
|
20142
|
+
return LAYOUT_INSET;
|
|
20143
|
+
return `max(calc(${EDGE_SHARE} / ${track}), var(--iox-space-gutter, ${GUTTER_FALLBACK}), calc((100% / ${track} - var(--iox-content-width, 100%)) / 2))`;
|
|
20144
|
+
}
|
|
20145
|
+
/** A composed grid's columns: an outer track a side (the inset less the gap that follows it), then 12 per screen. */
|
|
20146
|
+
function layoutGridColumns(track = 1) {
|
|
20147
|
+
const outer = `calc(${layoutTrackInset(track)} - ${LAYOUT_COLUMN_GAP})`;
|
|
20148
|
+
return `${outer} repeat(${GRID$3 * track}, minmax(0, 1fr)) ${outer}`;
|
|
20149
|
+
}
|
|
20150
|
+
/** The grid line a layout line (1..13, 1..12×track+1) stands on, past the start's outer track. */
|
|
20151
|
+
const layoutGridLine = (line) => line + 1;
|
|
20152
|
+
/** The first and last lines of a composed grid: a bleed's ends (the window's edges — logical, so RTL mirrors them). */
|
|
20153
|
+
const LAYOUT_BLEED_START_LINE = 1;
|
|
20154
|
+
const LAYOUT_BLEED_END_LINE = -1;
|
|
20155
|
+
/** The column word a composed page wears: its own (`LayoutPage.column`), else the site's (`design.column`), else wide. */
|
|
20156
|
+
function layoutColumnWord(own, design) {
|
|
20157
|
+
return (columnWordOf(own) ?? columnWordOf(design?.column) ?? SPEC_AXES.columnChoices.pre);
|
|
20158
|
+
}
|
|
20159
|
+
/** A column word's width in px at a density (`column-contained` / `column-narrow`), or null for wide (the window). */
|
|
20160
|
+
function layoutColumnPx(word, density) {
|
|
20161
|
+
const densities = SPEC_AXES.densities;
|
|
20162
|
+
const row = densities[String(density)] ?? densities[DEFAULT_DENSITY];
|
|
20163
|
+
const value = contentWidthOf(word, name => row?.[name]);
|
|
20164
|
+
if (!value || !/px$/.test(value))
|
|
20165
|
+
return null;
|
|
20166
|
+
return parseFloat(value);
|
|
20167
|
+
}
|
|
20168
|
+
/** The page's inset at a window `width` px wide (no scrollbar), in px — `space-inline` evaluated: what the e2e and the
|
|
20169
|
+
* judges read. `gutter` is the density's `space-gutter`. */
|
|
20170
|
+
function layoutInsetPx(width, columnPx, gutter) {
|
|
20171
|
+
const edge = Math.max(EDGE_SHARE_NUM * width, gutter);
|
|
20172
|
+
return columnPx === null ? edge : Math.max(edge, (width - columnPx) / 2);
|
|
20173
|
+
}
|
|
20174
|
+
/**
|
|
20175
|
+
* The bled side's inset of a gallery's bar, in viewport units (inside the slider a `%` is the slider's): the one gutter,
|
|
20176
|
+
* and half of what the column leaves when the page wears one. A classic scrollbar shifts it by ≤ 8px — the trade the
|
|
20177
|
+
* slider bar already makes (composite-core `BAR_INLINE_PAD`).
|
|
20178
|
+
*/
|
|
20179
|
+
function layoutBledBarInset(columnPx) {
|
|
20180
|
+
const edge = `max(${EDGE_SHARE.replace('%', 'vw')}, var(--iox-space-gutter, ${GUTTER_FALLBACK}))`;
|
|
20181
|
+
return columnPx === null ? edge : `max(${EDGE_SHARE.replace('%', 'vw')}, var(--iox-space-gutter, ${GUTTER_FALLBACK}), calc((100vw - ${columnPx}px) / 2))`;
|
|
20182
|
+
}
|
|
20183
|
+
/**
|
|
20184
|
+
* Where column `n` (1-based) starts from the page's edge on a composed grid — the inset, then n − 1 columns and their
|
|
20185
|
+
* gaps. A ready-made section's padding (`%` = the page's) so its words share the composed sections' edge.
|
|
20186
|
+
*/
|
|
20187
|
+
function layoutColumnStart(n) {
|
|
20188
|
+
if (n <= 1)
|
|
20189
|
+
return LAYOUT_INSET;
|
|
20190
|
+
const column = `((100% - 2 * ${LAYOUT_INSET} - ${GRID$3 - 1} * ${LAYOUT_COLUMN_GAP}) / ${GRID$3} + ${LAYOUT_COLUMN_GAP})`;
|
|
20191
|
+
return `calc(${LAYOUT_INSET} + ${n - 1} * ${column})`;
|
|
20192
|
+
}
|
|
20193
|
+
/** The grid's room on a laptop `width` px wide, in px: inside the inset, capped at the column (12 columns and 11 gaps). */
|
|
20194
|
+
function layoutGridPx(width, columnPx, gutter) {
|
|
20195
|
+
return width - 2 * layoutInsetPx(width, columnPx, gutter);
|
|
20196
|
+
}
|
|
20197
|
+
/** The column gap at a window `width` px wide, in px. */
|
|
20198
|
+
const layoutGapPx = (width) => (GAP_VW / 100) * width;
|
|
20199
|
+
/** A density's `space-gutter` in px (the one gutter's floor). */
|
|
20200
|
+
function layoutGutterPx(density) {
|
|
20201
|
+
const densities = SPEC_AXES.densities;
|
|
20202
|
+
return parseFloat((densities[String(density)] ?? densities[DEFAULT_DENSITY])['space-gutter']) || 0;
|
|
20203
|
+
}
|
|
20204
|
+
/**
|
|
20205
|
+
* The px one grid column is judged at on the check's laptop (`LAYOUT_CHECK_VIEWPORT`, AW-D38): wide stays the window's
|
|
20206
|
+
* twelfth (the judges' model before the column — no wide page is judged differently); in a column, the column's twelfth
|
|
20207
|
+
* (never more than the window's grid). Both contained and narrow bind at 1440.
|
|
20208
|
+
*/
|
|
20209
|
+
function layoutJudgeColumnPx(word, density, width) {
|
|
20210
|
+
const columnPx = layoutColumnPx(word, density);
|
|
20211
|
+
if (columnPx === null)
|
|
20212
|
+
return width / GRID$3;
|
|
20213
|
+
return Math.min(columnPx, width - 2 * layoutGutterPx(density)) / GRID$3;
|
|
20214
|
+
}
|
|
20215
|
+
|
|
20216
|
+
/** The scroll is replayed in steps this long (px). */
|
|
20217
|
+
const STEP_PX = 4;
|
|
20218
|
+
/** The depth a layer glides at in a section, as the composer stamps it — or null (mid, a held section, what a visitor
|
|
20219
|
+
* operates). ONE rule: `composeLayout` stamps by it, the render check and the depth mend replay by it. */
|
|
20220
|
+
function layoutGlideDepth(section, layer) {
|
|
20221
|
+
if (section.pin || !layer.depth || layer.depth === LayoutDepth.Mid || LAYOUT_OPERATED.has(layer.kind))
|
|
20222
|
+
return null;
|
|
20223
|
+
return layer.depth === LayoutDepth.Front ? ParallaxDepth.Front : ParallaxDepth.Back;
|
|
20224
|
+
}
|
|
20225
|
+
/** How far a layer at `depth` stands off its place with the page scrolled `scroll` px, on a screen `viewHeight` tall. */
|
|
20226
|
+
function driftAt(layer, scroll, viewHeight, phone = false) {
|
|
20227
|
+
if (!layer.depth)
|
|
20228
|
+
return 0;
|
|
20229
|
+
const view = { top: 0, height: viewHeight };
|
|
20230
|
+
const height = layer.box.b - layer.box.t;
|
|
20231
|
+
const shift = parallaxShift(rangeDistance(ScrollRange.Cover, { top: layer.box.t, height }, view), viewHeight, { phone, onPhone: normalizeParallaxPhone(LAYOUT_DEPTH_ON_PHONE) });
|
|
20232
|
+
if (!shift)
|
|
20233
|
+
return 0;
|
|
20234
|
+
const rest = parallaxRest(rangeProgress(ScrollRange.Cover, { top: layer.box.t, height }, view));
|
|
20235
|
+
const progress = rangeProgress(ScrollRange.Cover, { top: layer.box.t - scroll, height }, view);
|
|
20236
|
+
return parallaxOffset(layer.depth, shift, progress, rest);
|
|
20237
|
+
}
|
|
20238
|
+
const meet$1 = (a, b) => ({ l: Math.max(a.l, b.l), t: Math.max(a.t, b.t), r: Math.min(a.r, b.r), b: Math.min(a.b, b.b) });
|
|
20239
|
+
const areaOf = (r) => Math.max(0, r.r - r.l) * Math.max(0, r.b - r.t);
|
|
20240
|
+
const moved = (r, dy) => ({ l: r.l, r: r.r, t: r.t + dy, b: r.b + dy });
|
|
20241
|
+
/**
|
|
20242
|
+
* Where two layers overlap most on screen while the page scrolls past them, at least one gliding — inside `clip` (their
|
|
20243
|
+
* section, which clips a glide) — or null when they never meet more than they already do at rest. `pageHeight` bounds the
|
|
20244
|
+
* scroll. Pure: the same answer in the browser and the server.
|
|
20245
|
+
*/
|
|
20246
|
+
function driftOverlap(a, b, view, clip) {
|
|
20247
|
+
if (!a.depth && !b.depth)
|
|
20248
|
+
return null;
|
|
20249
|
+
const rest = areaOf(clip ? meet$1(meet$1(a.box, b.box), clip) : meet$1(a.box, b.box));
|
|
20250
|
+
const from = Math.max(0, Math.min(a.box.t, b.box.t) - view.height);
|
|
20251
|
+
const to = Math.min(Math.max(0, view.pageHeight - view.height), Math.max(a.box.b, b.box.b));
|
|
20252
|
+
let best = null;
|
|
20253
|
+
for (let scroll = from; scroll <= to; scroll += STEP_PX) {
|
|
20254
|
+
const screen = { l: 0, r: view.width, t: scroll, b: scroll + view.height };
|
|
20255
|
+
const ra = moved(a.box, driftAt(a, scroll, view.height, view.phone));
|
|
20256
|
+
const rb = moved(b.box, driftAt(b, scroll, view.height, view.phone));
|
|
20257
|
+
let overlap = meet$1(meet$1(ra, rb), screen);
|
|
20258
|
+
if (clip)
|
|
20259
|
+
overlap = meet$1(overlap, clip);
|
|
20260
|
+
const area = areaOf(overlap);
|
|
20261
|
+
if (area > rest && (!best || area > best.area))
|
|
20262
|
+
best = { scroll, overlap: moved(overlap, -scroll), area };
|
|
20263
|
+
}
|
|
20264
|
+
return best;
|
|
20265
|
+
}
|
|
20266
|
+
|
|
20267
|
+
const LOOKS = SPEC_SITE_LAYOUT.looks;
|
|
20268
|
+
const PRESET_LOOK = SPEC_SITE_LAYOUT.presetLook;
|
|
20269
|
+
const DARING_LEVELS = SPEC_SITE_LAYOUT.daringLevels;
|
|
20270
|
+
/** How far two brand colours are apart (RGB) — the last word between two presets that differ by their colour alone. */
|
|
20271
|
+
function seedDistance(a, b) {
|
|
20272
|
+
const rgb = (hex) => [1, 3, 5].map(i => parseInt(hex.slice(i, i + 2), 16) || 0);
|
|
20273
|
+
const [x, y] = [rgb(a), rgb(b)];
|
|
20274
|
+
return x.reduce((sum, v, i) => sum + (v - y[i]) ** 2, 0);
|
|
20275
|
+
}
|
|
20276
|
+
/**
|
|
20277
|
+
* The style preset a design wears (M8 gate 2): the preset it IS, else the closest of its flavor — same font pairing,
|
|
20278
|
+
* then the most of shape · density · pill buttons · tint · mode in common, then the nearer brand colour (six pairings
|
|
20279
|
+
* carry two presets each: Quiet luxury and Soft spa are both Linen + Cormorant; Morning glass and Coral studio differ by
|
|
20280
|
+
* their colour alone) — so an owner whose brand became a reference colour still wears THEIR preset's composition notes.
|
|
20281
|
+
* Never null: a design with no preset of its flavor reads the first preset's.
|
|
20282
|
+
*/
|
|
20283
|
+
function layoutPresetOf(choices) {
|
|
20284
|
+
const exact = stylePresetOfChoices(choices);
|
|
20285
|
+
if (exact)
|
|
20286
|
+
return exact;
|
|
20287
|
+
const c = resolveDesignChoices(choices);
|
|
20288
|
+
const kept = (p) => [p.shape === c.shape, p.density === c.density, p.pillButtons === c.pillButtons, p.tint === c.tint,
|
|
20289
|
+
presetModes(p).includes(c.mode)].filter(Boolean).length;
|
|
20290
|
+
const nearer = (a, b) => kept(a) - kept(b) || seedDistance(b.seed, c.seed) - seedDistance(a.seed, c.seed);
|
|
20291
|
+
const paired = STYLE_PRESETS.filter(p => p.flavorId === c.flavorId && p.pairId === c.pairId);
|
|
20292
|
+
if (paired.length)
|
|
20293
|
+
return paired.reduce((best, p) => (nearer(p, best) > 0 ? p : best));
|
|
20294
|
+
return STYLE_PRESETS.find(p => p.flavorId === c.flavorId) ?? STYLE_PRESETS[0];
|
|
20295
|
+
}
|
|
20296
|
+
/** A preset's look (the round-three composition notes it carries). */
|
|
20297
|
+
function layoutLookOf(presetId) {
|
|
20298
|
+
return LOOKS.find(l => l.id === PRESET_LOOK[presetId]) ?? LOOKS[0];
|
|
20299
|
+
}
|
|
20300
|
+
/** The pace and ease a composed page moves with: its look's. */
|
|
20301
|
+
function layoutMotionOf(presetId) {
|
|
20302
|
+
const look = layoutLookOf(presetId);
|
|
20303
|
+
return { pace: look.pace, ease: look.ease };
|
|
20304
|
+
}
|
|
20305
|
+
/**
|
|
20306
|
+
* How far a composed page dares (M8-G2-D5): daring when the look moves Lively or Expressive and the business type's
|
|
20307
|
+
* ceiling allows it (a trust or care type never dares), else distinct. `ceiling` is harness-core's for the type.
|
|
20308
|
+
*/
|
|
20309
|
+
function layoutDialOf(animate, ceiling) {
|
|
20310
|
+
const daring = !!animate && DARING_LEVELS.includes(animate) && (!ceiling || DARING_LEVELS.includes(ceiling));
|
|
20311
|
+
return daring ? LayoutDial.Daring : LayoutDial.Distinct;
|
|
20312
|
+
}
|
|
20313
|
+
|
|
20314
|
+
/** The design a page wears when only its look's preset is known: the preset in `mode` (else its own), else the default. */
|
|
20315
|
+
function layoutDesignOf(presetId, mode) {
|
|
20316
|
+
const id = String(presetId ?? '');
|
|
20317
|
+
return presetChoices(id, (mode ?? undefined)) ?? presetChoices(id) ?? resolveDesignChoices(null);
|
|
20318
|
+
}
|
|
20319
|
+
/** The element style a layer wears, by kind, role and size (the round-four renderer's `elementStyleOf`). */
|
|
20320
|
+
function layoutElementStyle(l) {
|
|
20321
|
+
switch (l.kind) {
|
|
20322
|
+
case LayoutLayerKind.Word: return 'display';
|
|
20323
|
+
case LayoutLayerKind.Heading: return l.role === LayoutRole.Lead ? 'h1' : 'h2';
|
|
20324
|
+
case LayoutLayerKind.Text: return l.size === 'm' || l.size === 'l' ? 'lead' : 'body';
|
|
20325
|
+
case LayoutLayerKind.List: return 'body';
|
|
20326
|
+
case LayoutLayerKind.Label: return !l.size || l.size === 'xs' || l.size === 's' ? 'eyebrow' : 'small';
|
|
20327
|
+
default: return NO_ELEMENT_STYLE;
|
|
20328
|
+
}
|
|
20329
|
+
}
|
|
20330
|
+
/** How wide a layer's words stand at 1em on one line, in the face its element style wears in `design` (iox-ui#46). */
|
|
20331
|
+
function layoutTextWidthEm(l, design) {
|
|
20332
|
+
return textWidthEm(l.text ?? '', elementStyleFace(design, layoutElementStyle(l)));
|
|
20333
|
+
}
|
|
20334
|
+
/** The columns a `screen` word fills: its span, and half a column more for each side it bleeds off. */
|
|
20335
|
+
function screenWordColumns(l) {
|
|
20336
|
+
const bleed = l.bleed && l.bleed !== LayoutBleed.None ? (l.bleed === LayoutBleed.Both ? 1 : 0.5) : 0;
|
|
20337
|
+
return l.col[1] - l.col[0] + bleed;
|
|
20338
|
+
}
|
|
20339
|
+
/** The screens a composed page is judged at (the render check's): a laptop and a phone. */
|
|
20340
|
+
const SCREENS = [{ width: 1440, phone: false }, { width: 390, phone: true }];
|
|
20341
|
+
/** Where a `screen` word cannot fit even at its smallest size: the screen and by how many px — null when it fits both.
|
|
20342
|
+
* `column` is the page's word (award §0c CW2): on the laptop a column gives the word its columns of the column. */
|
|
20343
|
+
function screenWordMisfit(l, design, column) {
|
|
20344
|
+
if (l.size !== LayoutSize.Screen || !l.text)
|
|
20345
|
+
return null;
|
|
20346
|
+
const em = layoutTextWidthEm(l, design);
|
|
20347
|
+
const page = { columnPx: column ? layoutColumnPx(column, design.density) : null, gutter: layoutGutterPx(design.density) };
|
|
20348
|
+
for (const s of SCREENS) {
|
|
20349
|
+
if (s.phone ? false : !!l.bleed && l.bleed !== LayoutBleed.None)
|
|
20350
|
+
continue;
|
|
20351
|
+
const px = screenWordOverflowPx(em, s.phone ? 12 : screenWordColumns(l), s.width, s.phone, s.phone ? { gutter: page.gutter } : page);
|
|
20352
|
+
if (px > 0)
|
|
20353
|
+
return { ...s, px };
|
|
20354
|
+
}
|
|
20355
|
+
return null;
|
|
20356
|
+
}
|
|
20357
|
+
|
|
20358
|
+
/**
|
|
20359
|
+
* THE PHOTO INVENTORY (premium components M8 gate 2, §5; the prototype's `code/inventory.cjs`, made pure): what a layout
|
|
20360
|
+
* may know about a photo without seeing it — its shape, five main colours, and a 12×12 grid of how light and how busy each
|
|
20361
|
+
* part is. iox-cms decodes the pixels (sharp → RGBA) and calls `photoInventory`; `checkLayout` reads the grid through
|
|
20362
|
+
* `calmUnder` to judge words set over the part of the photo a frame SHOWS; the model reads `describeInventoryForPrompt`.
|
|
20363
|
+
* No DOM, no decoder: RGBA bytes in, numbers out, deterministic.
|
|
20364
|
+
*/
|
|
20365
|
+
var PhotoTone;
|
|
20366
|
+
(function (PhotoTone) {
|
|
20367
|
+
PhotoTone["Light"] = "light";
|
|
20368
|
+
PhotoTone["Dark"] = "dark";
|
|
20369
|
+
})(PhotoTone || (PhotoTone = {}));
|
|
20370
|
+
const PHOTO_GRID = 12;
|
|
20371
|
+
/** Pixels are averaged down to this width before they are measured: the prototype measured at 96 wide, and the calm
|
|
20372
|
+
* threshold below was read off its 35 proof photos at that scale (a Laplacian grows with resolution). */
|
|
20373
|
+
const PHOTO_ANALYSIS_WIDTH = 96;
|
|
20374
|
+
/** At least this many analysed rows, so a very wide photo still has a few pixels per grid row. */
|
|
20375
|
+
const MIN_ANALYSIS_HEIGHT = 48;
|
|
20376
|
+
/** Calm: the mean detail under the words is at most this. The prototype's absolute bar (0.045 at 96 px wide: the busiest
|
|
20377
|
+
* cell it called calm across the proof photos); its relative bar (≤ 0.55 × the photo's busiest cell) is not ported —
|
|
20378
|
+
* it called nothing calm on a photo that is flat everywhere. */
|
|
20379
|
+
const PHOTO_CALM_DETAIL = 0.045;
|
|
20380
|
+
/** Light: above the luminance where black and white words have the same contrast (√(1.05 × 0.05) − 0.05). */
|
|
20381
|
+
const PHOTO_LIGHT_LUMINANCE = 0.179;
|
|
20382
|
+
const COLOURS = 5;
|
|
20383
|
+
const KMEANS_ROUNDS = 12;
|
|
20384
|
+
/** Shape by width ÷ height (the prototype's `shapeOf`). */
|
|
20385
|
+
const SHAPE_FROM_RATIO = [
|
|
20386
|
+
[1.68, LayoutPhotoShape.Wide],
|
|
20387
|
+
[1.2, LayoutPhotoShape.Landscape],
|
|
20388
|
+
[0.85, LayoutPhotoShape.Square],
|
|
20389
|
+
[0.62, LayoutPhotoShape.Portrait],
|
|
20390
|
+
];
|
|
20391
|
+
const RGBA$1 = 4;
|
|
20392
|
+
const BYTE$1 = 255;
|
|
20393
|
+
/** The 3×3 parts a prompt names, in reading order (the prototype's cells). */
|
|
20394
|
+
const PARTS$2 = ['top-start', 'top', 'top-end', 'start', 'middle', 'end', 'bottom-start', 'bottom', 'bottom-end'];
|
|
20395
|
+
/** A photo's shape from its size. */
|
|
20396
|
+
function photoShapeOf(width, height) {
|
|
20397
|
+
const r = width / Math.max(1, height);
|
|
20398
|
+
return SHAPE_FROM_RATIO.find(([min]) => r >= min)?.[1] ?? LayoutPhotoShape.Tall;
|
|
20399
|
+
}
|
|
20400
|
+
const toneOf = (luminance) => (luminance > PHOTO_LIGHT_LUMINANCE ? PhotoTone.Light : PhotoTone.Dark);
|
|
20401
|
+
/** The picture averaged down to the analysis size: sRGB 0..1 per channel. */
|
|
20402
|
+
function downsample(rgba, width, height) {
|
|
20403
|
+
const w = Math.min(width, PHOTO_ANALYSIS_WIDTH);
|
|
20404
|
+
const h = Math.min(height, Math.max(MIN_ANALYSIS_HEIGHT, Math.round((w * height) / width)));
|
|
20405
|
+
const sum = new Float64Array(w * h * 3);
|
|
20406
|
+
const count = new Float64Array(w * h);
|
|
20407
|
+
for (let y = 0; y < height; y++) {
|
|
20408
|
+
const ty = Math.min(h - 1, Math.floor((y * h) / height));
|
|
20409
|
+
for (let x = 0; x < width; x++) {
|
|
20410
|
+
const tx = Math.min(w - 1, Math.floor((x * w) / width));
|
|
20411
|
+
const i = (y * width + x) * RGBA$1;
|
|
20412
|
+
const t = ty * w + tx;
|
|
20413
|
+
sum[t * 3] += rgba[i];
|
|
20414
|
+
sum[t * 3 + 1] += rgba[i + 1];
|
|
20415
|
+
sum[t * 3 + 2] += rgba[i + 2];
|
|
20416
|
+
count[t]++;
|
|
20417
|
+
}
|
|
20418
|
+
}
|
|
20419
|
+
const px = new Float64Array(w * h * 3);
|
|
20420
|
+
for (let t = 0; t < w * h; t++)
|
|
20421
|
+
for (let c = 0; c < 3; c++)
|
|
20422
|
+
px[t * 3 + c] = sum[t * 3 + c] / Math.max(1, count[t]) / BYTE$1;
|
|
20423
|
+
return { w, h, px };
|
|
20424
|
+
}
|
|
20425
|
+
/** Up to five colours by k-means over the analysed pixels, seeded from evenly spread pixels (the prototype's), most
|
|
20426
|
+
* first; centres that land on one colour are one colour. */
|
|
20427
|
+
function mainColours(px, n) {
|
|
20428
|
+
const k = Math.min(COLOURS, n);
|
|
20429
|
+
let centres = Array.from({ length: k }, (_, i) => {
|
|
20430
|
+
const p = Math.floor(((i + 0.5) * n) / k);
|
|
20431
|
+
return [px[p * 3], px[p * 3 + 1], px[p * 3 + 2]];
|
|
20432
|
+
});
|
|
20433
|
+
let counts = new Array(k).fill(0);
|
|
20434
|
+
for (let round = 0; round < KMEANS_ROUNDS; round++) {
|
|
20435
|
+
const sums = centres.map(() => [0, 0, 0]);
|
|
20436
|
+
counts = new Array(k).fill(0);
|
|
20437
|
+
for (let p = 0; p < n; p++) {
|
|
20438
|
+
let best = 0;
|
|
20439
|
+
let bestD = Infinity;
|
|
20440
|
+
for (let c = 0; c < k; c++) {
|
|
20441
|
+
const d = (px[p * 3] - centres[c][0]) ** 2 + (px[p * 3 + 1] - centres[c][1]) ** 2 + (px[p * 3 + 2] - centres[c][2]) ** 2;
|
|
20442
|
+
if (d < bestD) {
|
|
20443
|
+
bestD = d;
|
|
20444
|
+
best = c;
|
|
20445
|
+
}
|
|
20446
|
+
}
|
|
20447
|
+
for (let ch = 0; ch < 3; ch++)
|
|
20448
|
+
sums[best][ch] += px[p * 3 + ch];
|
|
20449
|
+
counts[best]++;
|
|
20450
|
+
}
|
|
20451
|
+
centres = centres.map((c, i) => (counts[i] ? sums[i].map(v => v / counts[i]) : c));
|
|
20452
|
+
}
|
|
20453
|
+
const shares = new Map();
|
|
20454
|
+
centres.forEach((c, i) => {
|
|
20455
|
+
const hex = toHexColor({ r: c[0], g: c[1], b: c[2] });
|
|
20456
|
+
shares.set(hex, (shares.get(hex) ?? 0) + counts[i]);
|
|
20457
|
+
});
|
|
20458
|
+
return [...shares].sort((a, b) => b[1] - a[1]).map(([hex]) => hex);
|
|
20459
|
+
}
|
|
20460
|
+
/** What a photo is, measured from its pixels (RGBA bytes, row by row). */
|
|
20461
|
+
function photoInventory(rgba, width, height) {
|
|
20462
|
+
const { w, h, px } = downsample(rgba, width, height);
|
|
20463
|
+
const luma = new Float64Array(w * h);
|
|
20464
|
+
const lum = new Float64Array(w * h);
|
|
20465
|
+
for (let t = 0; t < w * h; t++) {
|
|
20466
|
+
const [r, g, b] = [px[t * 3], px[t * 3 + 1], px[t * 3 + 2]];
|
|
20467
|
+
luma[t] = 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
20468
|
+
lum[t] = relativeLuminance({ r, g, b });
|
|
20469
|
+
}
|
|
20470
|
+
const at = (x, y) => luma[Math.min(h - 1, Math.max(0, y)) * w + Math.min(w - 1, Math.max(0, x))];
|
|
20471
|
+
const cells = PHOTO_GRID * PHOTO_GRID;
|
|
20472
|
+
const detail = new Array(cells).fill(0);
|
|
20473
|
+
const luminance = new Array(cells).fill(0);
|
|
20474
|
+
const count = new Array(cells).fill(0);
|
|
20475
|
+
for (let y = 0; y < h; y++) {
|
|
20476
|
+
const cy = Math.min(PHOTO_GRID - 1, Math.floor((y * PHOTO_GRID) / h));
|
|
20477
|
+
for (let x = 0; x < w; x++) {
|
|
20478
|
+
const cx = Math.min(PHOTO_GRID - 1, Math.floor((x * PHOTO_GRID) / w));
|
|
20479
|
+
const c = cy * PHOTO_GRID + cx;
|
|
20480
|
+
detail[c] += Math.abs(4 * at(x, y) - at(x - 1, y) - at(x + 1, y) - at(x, y - 1) - at(x, y + 1));
|
|
20481
|
+
luminance[c] += lum[y * w + x];
|
|
20482
|
+
count[c]++;
|
|
20483
|
+
}
|
|
20484
|
+
}
|
|
20485
|
+
const round = (v) => Math.round(v * 10000) / 10000;
|
|
20486
|
+
const mean = (v, c) => (count[c] ? v / count[c] : 0);
|
|
20487
|
+
const luminanceGrid = luminance.map((v, c) => round(mean(v, c)));
|
|
20488
|
+
return {
|
|
20489
|
+
shape: photoShapeOf(width, height),
|
|
20490
|
+
width,
|
|
20491
|
+
height,
|
|
20492
|
+
grid: { cols: PHOTO_GRID, rows: PHOTO_GRID, luminance: luminanceGrid, detail: detail.map((v, c) => round(Math.min(1, mean(v, c)))) },
|
|
20493
|
+
colours: mainColours(px, w * h),
|
|
20494
|
+
tone: toneOf(lum.reduce((a, b) => a + b, 0) / Math.max(1, w * h)),
|
|
20495
|
+
};
|
|
20496
|
+
}
|
|
20497
|
+
/** The part of the photo a frame region shows under `object-fit: cover` (centred): the frame crops the photo's longer side. */
|
|
20498
|
+
function coverCrop(inv, frame, region) {
|
|
20499
|
+
const photo = inv.width / Math.max(1, inv.height);
|
|
20500
|
+
const box = frame.w / Math.max(1, frame.h);
|
|
20501
|
+
const clamp = (v) => Math.min(1, Math.max(0, v));
|
|
20502
|
+
if (photo > box) {
|
|
20503
|
+
const shown = box / photo;
|
|
20504
|
+
const off = (1 - shown) / 2;
|
|
20505
|
+
return { x0: off + clamp(region.x0) * shown, x1: off + clamp(region.x1) * shown, y0: clamp(region.y0), y1: clamp(region.y1) };
|
|
20506
|
+
}
|
|
20507
|
+
const shown = photo / box;
|
|
20508
|
+
const off = (1 - shown) / 2;
|
|
20509
|
+
return { x0: clamp(region.x0), x1: clamp(region.x1), y0: off + clamp(region.y0) * shown, y1: off + clamp(region.y1) * shown };
|
|
20510
|
+
}
|
|
20511
|
+
/** The grid's cells under a region of the photo, each with the share of it the region covers. */
|
|
20512
|
+
function cellsUnder(inv, r) {
|
|
20513
|
+
const { cols, rows } = inv.grid;
|
|
20514
|
+
const out = [];
|
|
20515
|
+
for (let cy = 0; cy < rows; cy++) {
|
|
20516
|
+
const h = Math.min(r.y1, (cy + 1) / rows) - Math.max(r.y0, cy / rows);
|
|
20517
|
+
if (h <= 0)
|
|
20518
|
+
continue;
|
|
20519
|
+
for (let cx = 0; cx < cols; cx++) {
|
|
20520
|
+
const w = Math.min(r.x1, (cx + 1) / cols) - Math.max(r.x0, cx / cols);
|
|
20521
|
+
if (w > 0)
|
|
20522
|
+
out.push({ cell: cy * cols + cx, weight: w * h });
|
|
20523
|
+
}
|
|
20524
|
+
}
|
|
20525
|
+
return out;
|
|
20526
|
+
}
|
|
20527
|
+
/** How a region of the photo reads (fractions of the PHOTO). */
|
|
20528
|
+
function readRegion(inv, r) {
|
|
20529
|
+
const cells = cellsUnder(inv, r);
|
|
20530
|
+
const total = cells.reduce((a, c) => a + c.weight, 0);
|
|
20531
|
+
if (!total)
|
|
20532
|
+
return { calm: true, tone: inv.tone, luminance: 0, detail: 0 };
|
|
20533
|
+
const detail = cells.reduce((a, c) => a + inv.grid.detail[c.cell] * c.weight, 0) / total;
|
|
20534
|
+
const luminance = cells.reduce((a, c) => a + inv.grid.luminance[c.cell] * c.weight, 0) / total;
|
|
20535
|
+
return { calm: detail <= PHOTO_CALM_DETAIL, tone: toneOf(luminance), luminance, detail };
|
|
20536
|
+
}
|
|
20537
|
+
/**
|
|
20538
|
+
* Whether words over `region` of a frame (fractions of the FRAME, which shows the photo as `object-fit: cover`, centred)
|
|
20539
|
+
* sit on a calm part of the photo, and how light it is there. A calm band the crop cuts away is not under the words.
|
|
20540
|
+
*/
|
|
20541
|
+
function calmUnder(inv, frame, region) {
|
|
20542
|
+
return readRegion(inv, coverCrop(inv, frame, region));
|
|
20543
|
+
}
|
|
20544
|
+
/** The photo's 3×3 named parts that are calm, each light or dark (`top-start (dark)`). */
|
|
20545
|
+
function calmParts(inv) {
|
|
20546
|
+
return PARTS$2.flatMap((name, i) => {
|
|
20547
|
+
const x = i % 3;
|
|
20548
|
+
const y = Math.floor(i / 3);
|
|
20549
|
+
const read = readRegion(inv, { x0: x / 3, x1: (x + 1) / 3, y0: y / 3, y1: (y + 1) / 3 });
|
|
20550
|
+
return read.calm ? [`${name} (${read.tone})`] : [];
|
|
20551
|
+
});
|
|
20552
|
+
}
|
|
20553
|
+
/** One line a model reads instead of the photo: its id, what it shows, shape, colours and where words may sit. */
|
|
20554
|
+
function describeInventoryForPrompt(id, inv, label) {
|
|
20555
|
+
const calm = calmParts(inv);
|
|
20556
|
+
return [
|
|
20557
|
+
id,
|
|
20558
|
+
...(label?.trim() ? [label.trim()] : []),
|
|
20559
|
+
`${inv.shape}, ${inv.tone}`,
|
|
20560
|
+
`colours ${inv.colours.join(' ')}`,
|
|
20561
|
+
`calm: ${calm.length ? calm.join(', ') : 'nowhere (busy)'}`,
|
|
20562
|
+
].join(' · ');
|
|
20563
|
+
}
|
|
20564
|
+
|
|
19950
20565
|
/**
|
|
19951
20566
|
* THE LIST JUDGE (list-ingredients-plan.md §6, LI2; the demo's `checkMix`): one function for any mix of the seven
|
|
19952
20567
|
* ingredients. What it can settle with no word or place changed it repairs and says — every repair of one list carries
|
|
@@ -19955,7 +20570,7 @@ function listWordRefusal(k, word, shape, tier, never) {
|
|
|
19955
20570
|
*/
|
|
19956
20571
|
const R = SPEC_SITE_LAYOUT.list.rules;
|
|
19957
20572
|
const IMAGE$1 = 'image';
|
|
19958
|
-
const AWARD
|
|
20573
|
+
const AWARD = 'award';
|
|
19959
20574
|
/** What a name set on its picture may show beside the picture: the name and a short detail (AW11-D8). */
|
|
19960
20575
|
const TITLE_ON_PHOTO_PARTS$1 = new Set(['title', 'meta', 'date']);
|
|
19961
20576
|
const inList$1 = (values, v) => typeof v === 'string' && values.includes(v);
|
|
@@ -20025,7 +20640,7 @@ function checkList(mix, shape, layer, never, options = {}) {
|
|
|
20025
20640
|
next[k] = [...new Set(drawn)];
|
|
20026
20641
|
}
|
|
20027
20642
|
// AW-D23: a round-two word on a site built below the award tier is drawn as its stand-in (the contract's belowPro).
|
|
20028
|
-
if (options.tier !== undefined && options.tier !== null && options.tier !== AWARD
|
|
20643
|
+
if (options.tier !== undefined && options.tier !== null && options.tier !== AWARD) {
|
|
20029
20644
|
const below = (k, fallback) => {
|
|
20030
20645
|
const stand = listBelowPro(k, next[k]);
|
|
20031
20646
|
if (stand === undefined)
|
|
@@ -20326,17 +20941,18 @@ const meets = (a, b) => {
|
|
|
20326
20941
|
const textOf$3 = (l) => String(l.text ?? (l.items ?? []).join(' '));
|
|
20327
20942
|
const advanceOf = (text) => (HEBREW$4.test(text) ? LIM$1.advance.hebrew : LIM$1.advance.latin);
|
|
20328
20943
|
/** A grid box's size in px on the laptop. */
|
|
20329
|
-
function layoutBoxPx(col, row, s) {
|
|
20944
|
+
function layoutBoxPx(col, row, s, columnPx = COLUMN_PX$2) {
|
|
20330
20945
|
const height = (s.pin ? 1 : s.screens) * LAYOUT_CHECK_VIEWPORT.height;
|
|
20331
|
-
return { w: span$2(col) *
|
|
20946
|
+
return { w: span$2(col) * columnPx, h: (span$2(row) * height) / Math.max(1, s.rows) };
|
|
20332
20947
|
}
|
|
20333
|
-
/** Whether a sized text layer's words fit its box at its size (the check's estimate; a `screen` word is sized to fit).
|
|
20334
|
-
|
|
20948
|
+
/** Whether a sized text layer's words fit its box at its size (the check's estimate; a `screen` word is sized to fit).
|
|
20949
|
+
* `columnPx` is one grid column on the check's laptop — the page's column's twelfth (award §0c CW2, AW-D38). */
|
|
20950
|
+
function layoutTextFits(l, s, size = l.size, columnPx = COLUMN_PX$2) {
|
|
20335
20951
|
const text = textOf$3(l);
|
|
20336
20952
|
if (!isText$1(l) || !size || size === LayoutSize.Screen || !text)
|
|
20337
20953
|
return true;
|
|
20338
20954
|
const px = L$2.sizePx[size];
|
|
20339
|
-
const box = layoutBoxPx(l.col, l.row, s);
|
|
20955
|
+
const box = layoutBoxPx(l.col, l.row, s, columnPx);
|
|
20340
20956
|
const lines = Math.floor(box.h / (px * LAYOUT_LINE_HEIGHT));
|
|
20341
20957
|
const items = l.kind === LayoutLayerKind.List ? Math.max(1, l.items?.length ?? 1) : 1;
|
|
20342
20958
|
return lines >= items && (text.length * px * advanceOf(text)) / Math.max(1, lines) <= box.w * LIM$1.textFitSlack;
|
|
@@ -20784,7 +21400,7 @@ const MANY$3 = new Set(B.many);
|
|
|
20784
21400
|
const WAITS$3 = B.waits;
|
|
20785
21401
|
const ORDER$1 = Object.values(BodyIngredient);
|
|
20786
21402
|
const isMany$1 = (k) => MANY$3.has(k);
|
|
20787
|
-
const listOf$
|
|
21403
|
+
const listOf$1 = (v) => (v === undefined ? [] : Array.isArray(v) ? [...v] : [v]);
|
|
20788
21404
|
const ordered$1 = (k, words) => bodyWords(k).filter(w => words.includes(w));
|
|
20789
21405
|
/** The words an ingredient may take, in the table's order. */
|
|
20790
21406
|
function bodyWords(ingredient) {
|
|
@@ -20816,14 +21432,14 @@ function bodyWordOffered(ingredient, word, tier) {
|
|
|
20816
21432
|
function bodyMix(partial = {}) {
|
|
20817
21433
|
const mix = {
|
|
20818
21434
|
seam: B.defaults['seam'], rhythm: B.defaults['rhythm'], texture: B.defaults['texture'],
|
|
20819
|
-
sections: listOf$
|
|
21435
|
+
sections: listOf$1(B.defaults['sections']),
|
|
20820
21436
|
};
|
|
20821
21437
|
for (const [k, v] of Object.entries(partial)) {
|
|
20822
21438
|
if (v === undefined)
|
|
20823
21439
|
continue;
|
|
20824
21440
|
if (!INGREDIENTS$3[k])
|
|
20825
21441
|
throw new BodyMixError(`no body ingredient "${k}"`);
|
|
20826
|
-
const words = listOf$
|
|
21442
|
+
const words = listOf$1(v);
|
|
20827
21443
|
for (const w of words)
|
|
20828
21444
|
if (!INGREDIENTS$3[k].includes(w))
|
|
20829
21445
|
throw new BodyMixError(`a body's ${k} cannot be "${w}" (${INGREDIENTS$3[k].join(' · ')})`);
|
|
@@ -20838,7 +21454,7 @@ function bodyMix(partial = {}) {
|
|
|
20838
21454
|
}
|
|
20839
21455
|
/** A mix on the wire: one `<ingredient>:<word>` per word, in the table's order. */
|
|
20840
21456
|
function bodyMixWords(mix) {
|
|
20841
|
-
return ORDER$1.flatMap(k => listOf$
|
|
21457
|
+
return ORDER$1.flatMap(k => listOf$1(mix[k]).map(w => `${k}:${w}`));
|
|
20842
21458
|
}
|
|
20843
21459
|
/** The words back into a mix. Refuses an unknown word and two words for a one-word ingredient. */
|
|
20844
21460
|
function bodyMixFromWords(words) {
|
|
@@ -21114,7 +21730,7 @@ function rhythmIssues(sections, rhythm, ctx) {
|
|
|
21114
21730
|
const L$1 = SPEC_SITE_LAYOUT;
|
|
21115
21731
|
/** The pattern families whose ready-made section lets people reach the business. */
|
|
21116
21732
|
const READY_MADE_REACH = new Set(['cta', 'contact']);
|
|
21117
|
-
const V
|
|
21733
|
+
const V = L$1.vocab;
|
|
21118
21734
|
const LIM = L$1.limits;
|
|
21119
21735
|
const COLOUR_TOKEN = {
|
|
21120
21736
|
[LayoutColour.Ground]: 'bg',
|
|
@@ -21140,6 +21756,22 @@ function presetPaint(presetId, mode) {
|
|
|
21140
21756
|
const colours = Object.fromEntries(entries);
|
|
21141
21757
|
return { colours, accentText: hex(ACCENT_TEXT_TOKEN) ?? colours[LayoutColour.Accent] };
|
|
21142
21758
|
}
|
|
21759
|
+
/**
|
|
21760
|
+
* Award §0c CW2 (AW-D34, R-H25): the page's column word — a word outside the axis is dropped (the page wears the site's);
|
|
21761
|
+
* a word the business type never wears (a formal type's `wide`) takes the first it may (`contained`). Both mend alone.
|
|
21762
|
+
*/
|
|
21763
|
+
function columnIssues(page, ctx) {
|
|
21764
|
+
if (page?.column === undefined || page.column === null)
|
|
21765
|
+
return [];
|
|
21766
|
+
const offered = layoutColumnsOffered(ctx.columnNever);
|
|
21767
|
+
if (!columnWordOf(page.column)) {
|
|
21768
|
+
return [{ code: LayoutIssueCode.Value, path: 'column', message: `${Object.keys(SPEC_AXES.columns).join(' | ')} — "${page.column}" is no column: the page wears the site's`, mend: { kind: LayoutMendKind.Column, column: null } }];
|
|
21769
|
+
}
|
|
21770
|
+
if (offered.includes(page.column))
|
|
21771
|
+
return [];
|
|
21772
|
+
const column = offered.includes(SPEC_AXES.columnChoices.new) ? SPEC_AXES.columnChoices.new : offered[0] ?? null;
|
|
21773
|
+
return [{ code: LayoutIssueCode.Value, path: 'column', message: `${LAYOUT_COLUMN_MENDED}: this business never wears "${page.column}" — composed ${column ?? "in the site's column"}`, mend: { kind: LayoutMendKind.Column, column } }];
|
|
21774
|
+
}
|
|
21143
21775
|
/** A preset's five colours in a mode as `#rrggbb` (the prototype's `presetColours`), or null when it does not wear that mode. */
|
|
21144
21776
|
function layoutPresetColours(presetId, mode) {
|
|
21145
21777
|
return presetPaint(presetId, mode)?.colours ?? null;
|
|
@@ -21310,8 +21942,13 @@ function examineLayout(page, ctx, carried, given) {
|
|
|
21310
21942
|
add(LayoutIssueCode.Value, 'look', `the "${ctx.presetId}" preset is not worn ${ctx.mode}`);
|
|
21311
21943
|
const limits = look?.limits ?? {};
|
|
21312
21944
|
const daring = page.dial === LayoutDial.Daring;
|
|
21313
|
-
if (!inList(V
|
|
21314
|
-
add(LayoutIssueCode.Value, 'dial', V
|
|
21945
|
+
if (!inList(V.dials, page.dial))
|
|
21946
|
+
add(LayoutIssueCode.Value, 'dial', V.dials.join(' | '));
|
|
21947
|
+
for (const issue of columnIssues(page, ctx))
|
|
21948
|
+
issues.push(issue);
|
|
21949
|
+
// Award §0c CW2 (AW-D38): the px judges read the page's column — its own word, else the design's when one is given.
|
|
21950
|
+
const columnWord = layoutColumnWord(columnWordOf(page.column) ? page.column : undefined, ctx.design);
|
|
21951
|
+
const judgeColumnPx = layoutJudgeColumnPx(columnWord, design.density, LAYOUT_CHECK_VIEWPORT.width);
|
|
21315
21952
|
const facts = String(ctx.facts ?? '');
|
|
21316
21953
|
const factKeys = ctx.factKeys ?? Object.keys(SPEC_SITE_FACTS);
|
|
21317
21954
|
const routes = ctx.routes ?? [];
|
|
@@ -21323,7 +21960,7 @@ function examineLayout(page, ctx, carried, given) {
|
|
|
21323
21960
|
const colourHex = (name, text) => {
|
|
21324
21961
|
if (!paint)
|
|
21325
21962
|
return null;
|
|
21326
|
-
const colour = (inList(V
|
|
21963
|
+
const colour = (inList(V.colours, name) ? name : LayoutColour.Ink);
|
|
21327
21964
|
return text && colour === LayoutColour.Accent ? paint.accentText : paint.colours[colour];
|
|
21328
21965
|
};
|
|
21329
21966
|
// ── the sections ──
|
|
@@ -21395,11 +22032,11 @@ function examineLayout(page, ctx, carried, given) {
|
|
|
21395
22032
|
add(LayoutIssueCode.Value, `${at}.track`, `1..${LIM.hold[1]}`);
|
|
21396
22033
|
if (track > 1 && !s.pin)
|
|
21397
22034
|
add(LayoutIssueCode.Structure, `${at}.track`, 'a sideways section is held');
|
|
21398
|
-
if (s.transition && !inList(V
|
|
21399
|
-
add(LayoutIssueCode.Value, `${at}.transition`, V
|
|
22035
|
+
if (s.transition && !inList(V.transitions, s.transition))
|
|
22036
|
+
add(LayoutIssueCode.Value, `${at}.transition`, V.transitions.join(' | '));
|
|
21400
22037
|
const ground = String(s.ground ?? LayoutColour.Ground);
|
|
21401
22038
|
const groundPhoto = groundPhotoOf(s);
|
|
21402
|
-
if (!inList(V
|
|
22039
|
+
if (!inList(V.colours, ground) && !groundPhoto)
|
|
21403
22040
|
add(LayoutIssueCode.Value, `${at}.ground`, 'a colour name or photo:<id>');
|
|
21404
22041
|
if (groundPhoto) {
|
|
21405
22042
|
photos.add(groundPhoto);
|
|
@@ -21408,7 +22045,7 @@ function examineLayout(page, ctx, carried, given) {
|
|
|
21408
22045
|
else if (!(groundPhoto in ctx.photos))
|
|
21409
22046
|
add(LayoutIssueCode.Content, `${at}.ground`, `"${groundPhoto}" is not one of the photos — use only the ids you were given`);
|
|
21410
22047
|
}
|
|
21411
|
-
if (inList(V
|
|
22048
|
+
if (inList(V.colours, ground) && paint && lumOf(paint.colours[ground]) > PHOTO_LIGHT_LUMINANCE)
|
|
21412
22049
|
lightGrounds++;
|
|
21413
22050
|
if (ground === LayoutColour.Accent)
|
|
21414
22051
|
accentUses += ACCENT_GROUND_USES;
|
|
@@ -21467,12 +22104,12 @@ function examineLayout(page, ctx, carried, given) {
|
|
|
21467
22104
|
let rotated = 0;
|
|
21468
22105
|
layers.forEach((l, j) => {
|
|
21469
22106
|
const lp = `${at}.layers[${j}]`;
|
|
21470
|
-
if (!inList(V
|
|
21471
|
-
add(LayoutIssueCode.Value, `${lp}.kind`, V
|
|
22107
|
+
if (!inList(V.kinds, l.kind)) {
|
|
22108
|
+
add(LayoutIssueCode.Value, `${lp}.kind`, V.kinds.join(' | '));
|
|
21472
22109
|
return;
|
|
21473
22110
|
}
|
|
21474
|
-
if (!inList(V
|
|
21475
|
-
add(LayoutIssueCode.Value, `${lp}.role`, V
|
|
22111
|
+
if (!inList(V.roles, l.role))
|
|
22112
|
+
add(LayoutIssueCode.Value, `${lp}.role`, V.roles.join(' | '));
|
|
21476
22113
|
const lastCol = GRID * track + 1;
|
|
21477
22114
|
const [c0, c1] = l.col ?? [];
|
|
21478
22115
|
const [r0, r1] = l.row ?? [];
|
|
@@ -21481,18 +22118,18 @@ function examineLayout(page, ctx, carried, given) {
|
|
|
21481
22118
|
add(LayoutIssueCode.Value, `${lp}.col`, `[start, end] within 1..${lastCol}, start < end`);
|
|
21482
22119
|
if (!(r0 >= 1 && r1 <= s.rows + 1 && r0 < r1))
|
|
21483
22120
|
add(LayoutIssueCode.Value, `${lp}.row`, `[start, end] within 1..${s.rows + 1}, start < end`);
|
|
21484
|
-
if (l.size && !inList(V
|
|
21485
|
-
add(LayoutIssueCode.Value, `${lp}.size`, V
|
|
21486
|
-
if (l.color && !inList(V
|
|
21487
|
-
add(LayoutIssueCode.Value, `${lp}.color`, V
|
|
21488
|
-
if (l.align && !inList(V
|
|
21489
|
-
add(LayoutIssueCode.Value, `${lp}.align`, V
|
|
21490
|
-
if (l.bleed && !inList(V
|
|
21491
|
-
add(LayoutIssueCode.Value, `${lp}.bleed`, V
|
|
22121
|
+
if (l.size && !inList(V.sizes, l.size))
|
|
22122
|
+
add(LayoutIssueCode.Value, `${lp}.size`, V.sizes.join(' | '));
|
|
22123
|
+
if (l.color && !inList(V.colours, l.color))
|
|
22124
|
+
add(LayoutIssueCode.Value, `${lp}.color`, V.colours.join(' | '));
|
|
22125
|
+
if (l.align && !inList(V.aligns, l.align))
|
|
22126
|
+
add(LayoutIssueCode.Value, `${lp}.align`, V.aligns.join(' | '));
|
|
22127
|
+
if (l.bleed && !inList(V.bleeds, l.bleed))
|
|
22128
|
+
add(LayoutIssueCode.Value, `${lp}.bleed`, V.bleeds.join(' | '));
|
|
21492
22129
|
if (l.variant !== undefined && l.kind !== LayoutLayerKind.Button)
|
|
21493
22130
|
add(LayoutIssueCode.Value, `${lp}.variant`, `a ${l.kind} has no button variant`);
|
|
21494
|
-
else if (l.variant !== undefined && !inList(V
|
|
21495
|
-
add(LayoutIssueCode.Value, `${lp}.variant`, V
|
|
22131
|
+
else if (l.variant !== undefined && !inList(V.buttonVariants, l.variant))
|
|
22132
|
+
add(LayoutIssueCode.Value, `${lp}.variant`, V.buttonVariants.join(' | '));
|
|
21496
22133
|
const text = String(l.text ?? (l.items ?? []).join(' '));
|
|
21497
22134
|
const maxChars = l.size ? L$1.maxChars[l.size] : undefined;
|
|
21498
22135
|
if (maxChars !== undefined && text.length > maxChars)
|
|
@@ -21500,22 +22137,22 @@ function examineLayout(page, ctx, carried, given) {
|
|
|
21500
22137
|
if ((l.size === 'm' || l.size === 's') && text.length > LIM.longTextChars && span(l.col) > LIM.longTextColumns) {
|
|
21501
22138
|
add(LayoutIssueCode.Reading, `${lp}.col`, `long text is never wider than ${LIM.longTextColumns} columns`);
|
|
21502
22139
|
}
|
|
21503
|
-
if (placed && isText(l) && l.size && l.size !== 'screen' && text && !layoutTextFits(l, s)) {
|
|
21504
|
-
const lines = Math.floor(boxPx(l.col, l.row, s).h / (L$1.sizePx[l.size] * LAYOUT_LINE_HEIGHT));
|
|
22140
|
+
if (placed && isText(l) && l.size && l.size !== 'screen' && text && !layoutTextFits(l, s, l.size, judgeColumnPx)) {
|
|
22141
|
+
const lines = Math.floor(boxPx(l.col, l.row, s, judgeColumnPx).h / (L$1.sizePx[l.size] * LAYOUT_LINE_HEIGHT));
|
|
21505
22142
|
add(LayoutIssueCode.Reading, `${lp}.row`, `${text.length} characters at ${l.size} do not fit a box of ${span(l.col)} columns × ${span(l.row)} rows (about ${Math.max(0, lines)} line${lines === 1 ? '' : 's'}) — give it more rows or columns, or fewer words`);
|
|
21506
22143
|
}
|
|
21507
22144
|
if (l.size === 'screen' || l.size === 'xxl')
|
|
21508
22145
|
huge++;
|
|
21509
22146
|
if (l.size === 'screen') {
|
|
21510
22147
|
screenWords++;
|
|
21511
|
-
const misfit = text ? screenWordMisfit(l, design) : null;
|
|
22148
|
+
const misfit = text ? screenWordMisfit(l, design, columnWord) : null;
|
|
21512
22149
|
if (misfit)
|
|
21513
22150
|
add(LayoutIssueCode.Reading, `${lp}.text`, `"${text}" is ${misfit.px}px too wide for ${misfit.phone ? `a ${misfit.width}px phone` : 'its columns'} even at the smallest screen size — fewer letters, ${misfit.phone ? '' : 'more columns, '}or size xxl`);
|
|
21514
22151
|
}
|
|
21515
22152
|
if (l.bleed && l.bleed !== 'none')
|
|
21516
22153
|
bleeds++;
|
|
21517
|
-
if (l.depth !== undefined && !inList(V
|
|
21518
|
-
add(LayoutIssueCode.Value, `${lp}.depth`, V
|
|
22154
|
+
if (l.depth !== undefined && !inList(V.depths, l.depth))
|
|
22155
|
+
add(LayoutIssueCode.Value, `${lp}.depth`, V.depths.join(' | '));
|
|
21519
22156
|
const deep = !!l.depth && l.depth !== 'mid';
|
|
21520
22157
|
if (deep && s.pin)
|
|
21521
22158
|
add(LayoutIssueCode.Motion, `${lp}.depth`, 'no depth inside a held section — use motion');
|
|
@@ -21527,8 +22164,8 @@ function examineLayout(page, ctx, carried, given) {
|
|
|
21527
22164
|
add(LayoutIssueCode.Motion, `${lp}.depth`, 'what a visitor operates never moves for style — give it no depth (mid)');
|
|
21528
22165
|
// the entrance
|
|
21529
22166
|
const letters = l.enter === LayoutEnter.Letters;
|
|
21530
|
-
if (l.enter !== undefined && !inList(V
|
|
21531
|
-
add(LayoutIssueCode.Value, `${lp}.enter`, V
|
|
22167
|
+
if (l.enter !== undefined && !inList(V.enters, l.enter))
|
|
22168
|
+
add(LayoutIssueCode.Value, `${lp}.enter`, V.enters.join(' | '));
|
|
21532
22169
|
else if (look && l.enter && l.enter !== LayoutEnter.None && l.enter !== LayoutEnter.Fade && !letters && !look.enters.includes(l.enter)) {
|
|
21533
22170
|
add(LayoutIssueCode.Look, `${lp}.enter`, `the ${look.id} look enters with ${['fade', ...look.enters].join(' | ')}`);
|
|
21534
22171
|
}
|
|
@@ -21545,8 +22182,8 @@ function examineLayout(page, ctx, carried, given) {
|
|
|
21545
22182
|
? "the look's By the scroll is never: it plays once as it arrives"
|
|
21546
22183
|
: `the look's By the scroll (${scrub}) does not take ${l.enter && l.enter !== LayoutEnter.None ? `a ${l.enter} entrance` : 'a layer with no entrance'}: it plays once`, { kind: LayoutMendKind.Scrub, layer: lp, why: LayoutScrubRefusal.Look });
|
|
21547
22184
|
}
|
|
21548
|
-
if (l.enter === LayoutEnter.ClipReveal && l.from && !inList(V
|
|
21549
|
-
add(LayoutIssueCode.Value, `${lp}.from`, V
|
|
22185
|
+
if (l.enter === LayoutEnter.ClipReveal && l.from && !inList(V.sides, l.from))
|
|
22186
|
+
add(LayoutIssueCode.Value, `${lp}.from`, V.sides.join(' | '));
|
|
21550
22187
|
if (l.enter === LayoutEnter.Pop && isText(l) && wordsOf$3(l.text) > POP_WORDS)
|
|
21551
22188
|
add(LayoutIssueCode.Look, `${lp}.enter`, `pop only on ${POP_WORDS} words or fewer`);
|
|
21552
22189
|
if (l.beat !== undefined && !(Number.isInteger(l.beat) && l.beat >= 0 && l.beat <= BEAT_MAX))
|
|
@@ -21583,13 +22220,13 @@ function examineLayout(page, ctx, carried, given) {
|
|
|
21583
22220
|
const hides = [];
|
|
21584
22221
|
(l.motion ?? []).forEach((m, k) => {
|
|
21585
22222
|
const mp = `${lp}.motion[${k}]`;
|
|
21586
|
-
if (!inList(V
|
|
21587
|
-
add(LayoutIssueCode.Value, `${mp}.prop`, V
|
|
22223
|
+
if (!inList(V.trackProps, m.prop))
|
|
22224
|
+
add(LayoutIssueCode.Value, `${mp}.prop`, V.trackProps.join(' | '));
|
|
21588
22225
|
const okAt = Array.isArray(m.at) && m.at[0] >= 0 && m.at[1] <= 1 && m.at[0] < m.at[1];
|
|
21589
22226
|
if (!okAt)
|
|
21590
22227
|
add(LayoutIssueCode.Value, `${mp}.at`, '[from, to] within 0..1');
|
|
21591
|
-
if (m.ease !== undefined && !inList(V
|
|
21592
|
-
add(LayoutIssueCode.Value, `${mp}.ease`, V
|
|
22228
|
+
if (m.ease !== undefined && !inList(V.eases, m.ease))
|
|
22229
|
+
add(LayoutIssueCode.Value, `${mp}.ease`, V.eases.join(' | '));
|
|
21593
22230
|
if (m.prop === LayoutTrackProp.Scale && (Math.min(m.from, m.to) < LIM.minScale || Math.max(m.from, m.to) > TRACK_SCALE_MAX)) {
|
|
21594
22231
|
add(LayoutIssueCode.Motion, mp, `scale stays within ${LIM.minScale}..${TRACK_SCALE_MAX} — nothing grows from nothing`);
|
|
21595
22232
|
}
|
|
@@ -21647,8 +22284,8 @@ function examineLayout(page, ctx, carried, given) {
|
|
|
21647
22284
|
add(LayoutIssueCode.Value, `${lp}.gallery.slides`, `${minSlides}..${maxSlides} slides`);
|
|
21648
22285
|
if (g.source !== undefined && slides.length > maxSlides)
|
|
21649
22286
|
add(LayoutIssueCode.Value, `${lp}.gallery.slides`, `at most ${maxSlides} slides`);
|
|
21650
|
-
if (g.effect !== undefined && !inList(V
|
|
21651
|
-
add(LayoutIssueCode.Value, `${lp}.gallery.effect`, V
|
|
22287
|
+
if (g.effect !== undefined && !inList(V.galleryEffects, g.effect))
|
|
22288
|
+
add(LayoutIssueCode.Value, `${lp}.gallery.effect`, V.galleryEffects.join(' | '));
|
|
21652
22289
|
if (g.scroll && !s.pin)
|
|
21653
22290
|
add(LayoutIssueCode.Motion, `${lp}.gallery.scroll`, 'a scroll-turned gallery sits in a held section');
|
|
21654
22291
|
if (g.list) {
|
|
@@ -21672,10 +22309,10 @@ function examineLayout(page, ctx, carried, given) {
|
|
|
21672
22309
|
reachable = true;
|
|
21673
22310
|
const f = l.form;
|
|
21674
22311
|
const preset = f?.preset;
|
|
21675
|
-
if (!inList(V
|
|
21676
|
-
add(LayoutIssueCode.Value, `${lp}.form.preset`, V
|
|
22312
|
+
if (!inList(V.formPresets, preset))
|
|
22313
|
+
add(LayoutIssueCode.Value, `${lp}.form.preset`, V.formPresets.join(' | '));
|
|
21677
22314
|
else {
|
|
21678
|
-
const chips = V
|
|
22315
|
+
const chips = V.formChips[preset];
|
|
21679
22316
|
const [minChips, maxChips] = LIM.formChips;
|
|
21680
22317
|
for (const name of chips) {
|
|
21681
22318
|
const opts = f?.options?.[name];
|
|
@@ -21719,7 +22356,7 @@ function examineLayout(page, ctx, carried, given) {
|
|
|
21719
22356
|
if (placed && (isText(l) || l.kind === LayoutLayerKind.Button)) {
|
|
21720
22357
|
const under = layers
|
|
21721
22358
|
.filter(o => o !== l && o.kind === LayoutLayerKind.Photo && (o.z ?? 0) < (l.z ?? 0) && overlaps(o, l) && o.photo?.id)
|
|
21722
|
-
.map(o => ({ id: o.photo.id, frame: boxPx(o.col, o.row, s), region: regionInLayer(o, l) }));
|
|
22359
|
+
.map(o => ({ id: o.photo.id, frame: boxPx(o.col, o.row, s, judgeColumnPx), region: regionInLayer(o, l) }));
|
|
21723
22360
|
if (groundPhoto)
|
|
21724
22361
|
under.push({ id: groundPhoto, frame: { w: LAYOUT_CHECK_VIEWPORT.width, h: s.screens * LAYOUT_CHECK_VIEWPORT.height }, region: regionOnGround(s, l) });
|
|
21725
22362
|
const fgHex = isText(l) ? colourHex(l.color, true) : null;
|
|
@@ -21761,7 +22398,7 @@ function examineLayout(page, ctx, carried, given) {
|
|
|
21761
22398
|
}
|
|
21762
22399
|
if (!under.length && fg !== null) {
|
|
21763
22400
|
const shape = layers.filter(o => o !== l && o.kind === LayoutLayerKind.Shape && (o.z ?? 0) < (l.z ?? 0) && overlaps(o, l)).sort((a, b) => (b.z ?? 0) - (a.z ?? 0))[0];
|
|
21764
|
-
const bgHex = shape ? colourHex(shape.color ?? LayoutColour.Accent, false) : colourHex(inList(V
|
|
22401
|
+
const bgHex = shape ? colourHex(shape.color ?? LayoutColour.Accent, false) : colourHex(inList(V.colours, ground) ? ground : LayoutColour.Ground, false);
|
|
21765
22402
|
if (bgHex) {
|
|
21766
22403
|
const ratio = contrastOf(fg, lumOf(bgHex));
|
|
21767
22404
|
const ink = colourHex(LayoutColour.Ink, true);
|
|
@@ -21898,7 +22535,7 @@ function examineLayout(page, ctx, carried, given) {
|
|
|
21898
22535
|
if (ctx.rhythm && paint) {
|
|
21899
22536
|
const toneOf = (s) => (groundPhotoOf(s)
|
|
21900
22537
|
? GroundTone.Photo
|
|
21901
|
-
: groundToneOf(lumOf(paint.colours[(inList(V
|
|
22538
|
+
: groundToneOf(lumOf(paint.colours[(inList(V.colours, s.ground) ? s.ground : LayoutColour.Ground)])));
|
|
21902
22539
|
issues.push(...rhythmIssues(sections, ctx.rhythm, { toneOf, footerTone: ctx.footerTone }));
|
|
21903
22540
|
}
|
|
21904
22541
|
const unshown = shownListIssue(page, ctx);
|
|
@@ -22034,7 +22671,7 @@ function glideCandidates(sections) {
|
|
|
22034
22671
|
const layers = Array.isArray(s.layers) ? s.layers : [];
|
|
22035
22672
|
const photoGround = !!groundPhotoOf(s);
|
|
22036
22673
|
layers.forEach((l, li) => {
|
|
22037
|
-
if (!inList(V
|
|
22674
|
+
if (!inList(V.kinds, l.kind) || LAYOUT_OPERATED.has(l.kind) || l.role === LayoutRole.Static)
|
|
22038
22675
|
return;
|
|
22039
22676
|
if ((l.depth && l.depth !== LayoutDepth.Mid) || l.inner)
|
|
22040
22677
|
return;
|
|
@@ -22299,6 +22936,13 @@ function mendLayout(page, issues) {
|
|
|
22299
22936
|
next.sections[m.section].screens = m.screens;
|
|
22300
22937
|
mended.push(issue);
|
|
22301
22938
|
}
|
|
22939
|
+
else if (mend?.kind === LayoutMendKind.Column) {
|
|
22940
|
+
if (mend.column)
|
|
22941
|
+
next.column = mend.column;
|
|
22942
|
+
else
|
|
22943
|
+
delete next.column;
|
|
22944
|
+
mended.push(issue);
|
|
22945
|
+
}
|
|
22302
22946
|
else if (mend?.kind === LayoutMendKind.Drop && layerAt(mend.layer)) {
|
|
22303
22947
|
drops.push(issue);
|
|
22304
22948
|
}
|
|
@@ -22637,7 +23281,7 @@ function checkFooter(given, ctx) {
|
|
|
22637
23281
|
repairs.push({ code: FooterRepairCode.LineHolds, said: `a one-line footer holds only ${F.rules.lineHolds.join(' and ')}: ${left.join(' and ')} left out` });
|
|
22638
23282
|
holds = kept;
|
|
22639
23283
|
}
|
|
22640
|
-
if (closing === FooterClosing.Name && screenWordOverflowPx(nameWidthEm(ctx), 12, PHONE_WIDTH, true) > 0) {
|
|
23284
|
+
if (closing === FooterClosing.Name && screenWordOverflowPx(nameWidthEm(ctx), 12, PHONE_WIDTH, true, { gutter: layoutGutterPx(ctx.design.density) }) > 0) {
|
|
22641
23285
|
repairs.push({ code: FooterRepairCode.NameTooLong, said: `"${ctx.name}" is too long to stand across a phone: the footer closes with nothing` });
|
|
22642
23286
|
closing = FooterClosing.None;
|
|
22643
23287
|
}
|
|
@@ -22677,7 +23321,11 @@ function columnsOf(count) {
|
|
|
22677
23321
|
/** The closing name: the business name across the width — fitted to the name in the look's display face as a layout's
|
|
22678
23322
|
* screen word is (`screenFontSize`, the 12-column room), never under the smallest or over the largest screen word. */
|
|
22679
23323
|
function closingName(ctx) {
|
|
22680
|
-
|
|
23324
|
+
// Award §0c CW2: in a column the name never runs past it — the site's word stamped as px (a `%` in font-size is the
|
|
23325
|
+
// parent's size). A page that wears a narrower word of its own is not known here (the footer is the site's).
|
|
23326
|
+
// iox-ui#117: the name reads the column of the PAGE it is on (`content-cap`, re-declared by a page's word), the site's
|
|
23327
|
+
// word only its fallback — a global footer fits a narrow page of a contained site.
|
|
23328
|
+
return laid$1(part$3('name'), { fontSize: screenFontSize(nameWidthEm(ctx), 12, 0, 0, 0, layoutColumnPx(ctx.design.column, ctx.design.density), true) });
|
|
22681
23329
|
}
|
|
22682
23330
|
/** A block it holds: how to reach the business leaves its city to the visit block when the footer holds both. */
|
|
22683
23331
|
function holdPart(hold, mix) {
|
|
@@ -22850,7 +23498,7 @@ const TEXT$1 = 'Text';
|
|
|
22850
23498
|
const HEADING$1 = 'Heading';
|
|
22851
23499
|
const NAV_STYLE = 'nav';
|
|
22852
23500
|
const DISPLAY = 'display';
|
|
22853
|
-
const NONE$
|
|
23501
|
+
const NONE$1 = 'none';
|
|
22854
23502
|
const CLICK = 'click';
|
|
22855
23503
|
const HOME_ROUTE = '/';
|
|
22856
23504
|
const COMPOSED$2 = { releaseLayoutDefaults: true };
|
|
@@ -22940,7 +23588,7 @@ function navShapeOf(globals) {
|
|
|
22940
23588
|
return NavShape.Bar;
|
|
22941
23589
|
return drawer ? NavShape.Drawer : null;
|
|
22942
23590
|
}
|
|
22943
|
-
const hiddenAt = (n) => Object.entries(n.responsive ?? {}).find(([, layer]) => layer?.styleProps?.[DISPLAY] === NONE$
|
|
23591
|
+
const hiddenAt = (n) => Object.entries(n.responsive ?? {}).find(([, layer]) => layer?.styleProps?.[DISPLAY] === NONE$1)?.[0] ?? null;
|
|
22944
23592
|
/** The breakpoint the phone shape takes over at, read off the header's links row (default Mobile). */
|
|
22945
23593
|
function navShapeBreakpoint(globals) {
|
|
22946
23594
|
const links = find(globals, NavRole.Links);
|
|
@@ -23054,7 +23702,7 @@ const MENU_DISPLAY = 'inline-flex';
|
|
|
23054
23702
|
/** What a header part hidden at every width shows again when the menu goes back to phone widths only. */
|
|
23055
23703
|
const BUILT_DISPLAY = { [NavRole.Links]: 'flex' };
|
|
23056
23704
|
function phoneOnly(node, at, display) {
|
|
23057
|
-
node.styleProps[DISPLAY] = NONE$
|
|
23705
|
+
node.styleProps[DISPLAY] = NONE$1;
|
|
23058
23706
|
node.responsive = { ...(node.responsive ?? {}), [at]: { ...(node.responsive?.[at] ?? {}), styleProps: { ...(node.responsive?.[at]?.styleProps ?? {}), [DISPLAY]: display } } };
|
|
23059
23707
|
}
|
|
23060
23708
|
/** At every width (HI-D8): `display` lives in the base styles and no breakpoint overrides it. */
|
|
@@ -23074,11 +23722,11 @@ function displayEverywhere(node, display) {
|
|
|
23074
23722
|
function menuAtEveryWidth(globals, navId) {
|
|
23075
23723
|
const root = findNavRoot(globals, navId);
|
|
23076
23724
|
const menu = root ? find([root], NavRole.MenuButton) : null;
|
|
23077
|
-
return !!menu && menu.styleProps?.[DISPLAY] !== NONE$
|
|
23725
|
+
return !!menu && menu.styleProps?.[DISPLAY] !== NONE$1;
|
|
23078
23726
|
}
|
|
23079
23727
|
/** Hidden at the phone width: the header's links row. */
|
|
23080
23728
|
function hideAt(node, at) {
|
|
23081
|
-
node.responsive = { ...(node.responsive ?? {}), [at]: { ...(node.responsive?.[at] ?? {}), styleProps: { ...(node.responsive?.[at]?.styleProps ?? {}), [DISPLAY]: NONE$
|
|
23729
|
+
node.responsive = { ...(node.responsive ?? {}), [at]: { ...(node.responsive?.[at] ?? {}), styleProps: { ...(node.responsive?.[at]?.styleProps ?? {}), [DISPLAY]: NONE$1 } } };
|
|
23082
23730
|
}
|
|
23083
23731
|
/** Move every `display` override the shape owns to the new breakpoint. */
|
|
23084
23732
|
function moveDisplayOverride(node, to) {
|
|
@@ -23388,12 +24036,12 @@ function planNavShape(globals, shape, options = {}, navId) {
|
|
|
23388
24036
|
const menu = wantMenuButton ? (existingMenu ? asToggle(existingMenu) : menuButton(kit, dr.id, at)) : null;
|
|
23389
24037
|
for (const p of phoneHiddenParts(root)) {
|
|
23390
24038
|
if (everyWidth && !KEPT_AT_EVERY_WIDTH.has(roleOf(p))) {
|
|
23391
|
-
displayEverywhere(p, NONE$
|
|
24039
|
+
displayEverywhere(p, NONE$1);
|
|
23392
24040
|
continue;
|
|
23393
24041
|
}
|
|
23394
24042
|
// Back from every width: the base `none` was this function's, not the author's. Base styles hold ONE display, so
|
|
23395
24043
|
// the part takes back what its role is built with (the links row is a row), else its type's own.
|
|
23396
|
-
if (wasEveryWidth && p.styleProps?.[DISPLAY] === NONE$
|
|
24044
|
+
if (wasEveryWidth && p.styleProps?.[DISPLAY] === NONE$1) {
|
|
23397
24045
|
const back = BUILT_DISPLAY[roleOf(p) ?? ''];
|
|
23398
24046
|
if (back)
|
|
23399
24047
|
p.styleProps[DISPLAY] = back;
|
|
@@ -24137,7 +24785,7 @@ function openingWordTier(ingredient, word) {
|
|
|
24137
24785
|
function openingWordOffered(ingredient, word, tier) {
|
|
24138
24786
|
return openingWordTier(ingredient, word) === 'all' || tier === GenerationTier.Award;
|
|
24139
24787
|
}
|
|
24140
|
-
const listOf
|
|
24788
|
+
const listOf = (v) => (v === undefined ? [] : Array.isArray(v) ? [...v] : [v]);
|
|
24141
24789
|
/** A many-ingredient's words once each, in the table's order. */
|
|
24142
24790
|
const ordered = (k, words) => openingWords$1(k).filter(w => words.includes(w));
|
|
24143
24791
|
/** A whole mix from part of one: what is not named is the default (a picture, edge to edge, a heading). Refuses a word
|
|
@@ -24145,14 +24793,14 @@ const ordered = (k, words) => openingWords$1(k).filter(w => words.includes(w));
|
|
|
24145
24793
|
function openingMix(partial = {}) {
|
|
24146
24794
|
const mix = {
|
|
24147
24795
|
frame: O.defaults['frame'], media: O.defaults['media'], words: O.defaults['words'],
|
|
24148
|
-
extras: listOf
|
|
24796
|
+
extras: listOf(O.defaults['extras']), motion: listOf(O.defaults['motion']),
|
|
24149
24797
|
};
|
|
24150
24798
|
for (const [k, v] of Object.entries(partial)) {
|
|
24151
24799
|
if (v === undefined)
|
|
24152
24800
|
continue;
|
|
24153
24801
|
if (!INGREDIENTS[k])
|
|
24154
24802
|
throw new OpeningMixError(`no opening ingredient "${k}"`);
|
|
24155
|
-
const words = listOf
|
|
24803
|
+
const words = listOf(v);
|
|
24156
24804
|
for (const w of words)
|
|
24157
24805
|
if (!INGREDIENTS[k].includes(w))
|
|
24158
24806
|
throw new OpeningMixError(`an opening's ${k} cannot be "${w}" (${INGREDIENTS[k].join(' · ')})`);
|
|
@@ -24174,7 +24822,7 @@ function withOpeningWord(mix, ingredient, word, on = true) {
|
|
|
24174
24822
|
}
|
|
24175
24823
|
/** A mix on the wire, and as an opening root stores it: one `<ingredient>:<word>` per word, in the table's order. */
|
|
24176
24824
|
function openingMixWords(mix) {
|
|
24177
|
-
return ORDER.flatMap(k => listOf
|
|
24825
|
+
return ORDER.flatMap(k => listOf(mix[k]).map(w => `${k}:${w}`));
|
|
24178
24826
|
}
|
|
24179
24827
|
/** The words back into a mix. Refuses an unknown word and two words for a one-word ingredient. */
|
|
24180
24828
|
function openingMixFromWords(words) {
|
|
@@ -25837,471 +26485,6 @@ function legalFormLine(lang, withTerms) {
|
|
|
25837
26485
|
return parts;
|
|
25838
26486
|
}
|
|
25839
26487
|
|
|
25840
|
-
/**
|
|
25841
|
-
* The LAYOUT WIRE (premium M8 gate 2, M8-G2-D2): the strict format a model writes ONE composed page in. Every key is
|
|
25842
|
-
* required — "none" is `''`, `0`, `[]` or `'none'` — so the request stays at 37 properties, no optional key and no
|
|
25843
|
-
* union (`strictSchemaComplexity`, held by iox-cms strict-schemas.spec). `expandLayoutWire` turns it into the layout
|
|
25844
|
-
* language (`LayoutSection[]`, what `checkLayout` judges and `composeLayout` stamps); `layoutToWire` writes a layout back
|
|
25845
|
-
* (the three proof sites, a repair's starting point). What the wire leaves out is derived, never asked: a layer's beat
|
|
25846
|
-
* (the order it is written), the look, the pace and ease, the nav, the site's name and language.
|
|
25847
|
-
*/
|
|
25848
|
-
const V = SPEC_SITE_LAYOUT.vocab;
|
|
25849
|
-
const GALLERY_EFFECTS = V.galleryEffects;
|
|
25850
|
-
const FORM_PRESETS = V.formPresets;
|
|
25851
|
-
const BUTTON_VARIANTS = V.buttonVariants;
|
|
25852
|
-
const NONE$1 = 'none';
|
|
25853
|
-
const CLIP = 'clipReveal';
|
|
25854
|
-
const CLIP_SIDE = `${CLIP}-`;
|
|
25855
|
-
/** A gallery the wire marks `autoplay` turns every 5 s — what the proof sites' autoplaying galleries do. */
|
|
25856
|
-
const LAYOUT_WIRE_AUTOPLAY_MS = 5000;
|
|
25857
|
-
const CHIP_SLOTS = Array.from(new Set(Object.values(V.formChips).flat()));
|
|
25858
|
-
const SLOT_NAMES = [...V.formSlots, ...CHIP_SLOTS];
|
|
25859
|
-
const ENTER_ON_WIRE = V.enters.flatMap((e) => (e === CLIP ? V.sides.map((s) => `${CLIP_SIDE}${s}`) : [e]));
|
|
25860
|
-
const VARIANT_ON_WIRE = [NONE$1, ...V.buttonVariants, ...V.galleryEffects, ...V.formPresets];
|
|
25861
|
-
/**
|
|
25862
|
-
* List ingredients (list-ingredients-plan.md §2, LI1): a list section's mix travels as ONE list of `<ingredient>:<word>`
|
|
25863
|
-
* words (`arrange:strips`, `hover:dim`) and its parts as `<list>.<role>` (`stories.quote`) — two properties, so the
|
|
25864
|
-
* request stays inside the 40 the budget allows, and the parts enum is generated from the plan's own lists: a model
|
|
25865
|
-
* cannot name a part its list does not have (R-H2).
|
|
25866
|
-
*/
|
|
25867
|
-
var LayoutMixIngredient;
|
|
25868
|
-
(function (LayoutMixIngredient) {
|
|
25869
|
-
LayoutMixIngredient["Item"] = "item";
|
|
25870
|
-
LayoutMixIngredient["Arrange"] = "arrange";
|
|
25871
|
-
LayoutMixIngredient["Who"] = "who";
|
|
25872
|
-
LayoutMixIngredient["How"] = "how";
|
|
25873
|
-
LayoutMixIngredient["Move"] = "move";
|
|
25874
|
-
LayoutMixIngredient["Hover"] = "hover";
|
|
25875
|
-
LayoutMixIngredient["Arrive"] = "arrive";
|
|
25876
|
-
LayoutMixIngredient["Phone"] = "phone";
|
|
25877
|
-
})(LayoutMixIngredient || (LayoutMixIngredient = {}));
|
|
25878
|
-
const MIX_SEPARATOR = ':';
|
|
25879
|
-
const BASIC = 'basic';
|
|
25880
|
-
const AWARD = 'award';
|
|
25881
|
-
const PART_SEPARATOR = '.';
|
|
25882
|
-
/** Every word a stored mix may hold, ingredient by ingredient (a waiting word too: a stored answer still reads). */
|
|
25883
|
-
const LAYOUT_MIX_WORDS = LIST_INGREDIENTS.flatMap(k => listIngredientWords(k).map(w => `${k}${MIX_SEPARATOR}${w}`));
|
|
25884
|
-
/** The words the wire OFFERS a site below the award tier — the built ones only (ingredients.md §3.3: a waiting word would
|
|
25885
|
-
* put its stand-in on every site that asked for it), less the award tier's (AW-D23, AW11). */
|
|
25886
|
-
const LAYOUT_MIX_OFFERED = LIST_INGREDIENTS.flatMap(k => listBuiltWords(k).filter(w => listWordOffered(k, w, BASIC)).map(w => `${k}${MIX_SEPARATOR}${w}`));
|
|
25887
|
-
/** AW11: every built word, the award tier's included — what the wire offers an award site before the lists are read. */
|
|
25888
|
-
const LAYOUT_MIX_OFFERED_AWARD = LIST_INGREDIENTS.flatMap(k => listBuiltWords(k).map(w => `${k}${MIX_SEPARATOR}${w}`));
|
|
25889
|
-
/** AW10: the entrance and the switch a look that never scrubs is not offered. */
|
|
25890
|
-
const LETTERS = 'letters';
|
|
25891
|
-
const SCRUB_FLAG = 'scrub';
|
|
25892
|
-
/** The entrances the wire offers under the look's scrub (AW10 H3). */
|
|
25893
|
-
function layoutEntersOffered(scrub) {
|
|
25894
|
-
return ENTER_ON_WIRE.filter(e => e !== LETTERS || scrubOffered(scrub));
|
|
25895
|
-
}
|
|
25896
|
-
/** The switches the wire offers under the look's scrub (AW10 H3). */
|
|
25897
|
-
function layoutFlagsOffered(scrub) {
|
|
25898
|
-
return V.flags.filter(f => f !== SCRUB_FLAG || scrubOffered(scrub));
|
|
25899
|
-
}
|
|
25900
|
-
const scrubOffered = (scrub) => !!scrub && scrub !== ScrubId.Never && isScrubId(scrub);
|
|
25901
|
-
/** A handle the wire places as a whole SECTION (RD-D20): a bound part, a block or a kept section. */
|
|
25902
|
-
const SECTION_HANDLE = /^(?:bind|block|keep):/;
|
|
25903
|
-
/** Is `handle` one a section places whole (`bind:`/`block:`/`keep:`), never a layer's words or photo? */
|
|
25904
|
-
function isSectionCarryHandle(handle) {
|
|
25905
|
-
return SECTION_HANDLE.test(handle);
|
|
25906
|
-
}
|
|
25907
|
-
/**
|
|
25908
|
-
* The mix words offered to a business whose lists never do `never` (L-D12): the built words less the forbidden ones —
|
|
25909
|
-
* and since AW11, the award tier's only to an award site, and a word NO list of the plan can carry (a second picture, a
|
|
25910
|
-
* picture at all) never (R-H-AW11-7: the one table, `listWordRefusal`; `checkList` judges each list).
|
|
25911
|
-
*/
|
|
25912
|
-
function layoutMixOffered(never, options = {}) {
|
|
25913
|
-
const banned = new Set([...(never?.arranges ?? []).map(w => `arrange${MIX_SEPARATOR}${w}`), ...(never?.moves ?? []).map(w => `move${MIX_SEPARATOR}${w}`)]);
|
|
25914
|
-
const offered = options.tier === AWARD ? LAYOUT_MIX_OFFERED_AWARD : LAYOUT_MIX_OFFERED;
|
|
25915
|
-
const lists = options.lists;
|
|
25916
|
-
return offered.filter(w => {
|
|
25917
|
-
if (banned.has(w))
|
|
25918
|
-
return false;
|
|
25919
|
-
if (!lists?.length)
|
|
25920
|
-
return true;
|
|
25921
|
-
const [k, word] = w.split(MIX_SEPARATOR);
|
|
25922
|
-
return lists.some(l => listWordRefusal(k, word, l) === null);
|
|
25923
|
-
});
|
|
25924
|
-
}
|
|
25925
|
-
const mixHint = (offered) => LIST_INGREDIENTS.map(k => {
|
|
25926
|
-
const words = offered.filter(w => w.startsWith(`${k}${MIX_SEPARATOR}`)).map(w => w.slice(k.length + MIX_SEPARATOR.length));
|
|
25927
|
-
return `${k}:${words.join('|')}${LIST_TABLE.many.includes(k) ? ' (any)' : ''}`;
|
|
25928
|
-
}).join(' · ');
|
|
25929
|
-
/** `<list>.<role>` for every role of every list — what a list section's `parts` may name. */
|
|
25930
|
-
function layoutWirePartWords(lists) {
|
|
25931
|
-
return lists.flatMap(l => l.roles.map(r => `${l.alias}${PART_SEPARATOR}${r}`));
|
|
25932
|
-
}
|
|
25933
|
-
const text$1 = (d) => ({ ...jsonText(), description: d });
|
|
25934
|
-
const integer = (d) => ({ ...jsonInteger(), description: d });
|
|
25935
|
-
const oneOf$1 = (values, d) => ({ ...jsonOneOf(values), description: d });
|
|
25936
|
-
const listOf = (items, d) => ({ ...jsonListOf(items), description: d });
|
|
25937
|
-
const closed = (properties, d) => jsonClosedObject(properties, Object.keys(properties), d);
|
|
25938
|
-
/** The strict format for one composed page — with the list ingredients when `options.lists` is given. */
|
|
25939
|
-
function layoutWireJsonSchema(options = {}) {
|
|
25940
|
-
const partWords = options.lists ? layoutWirePartWords(options.lists) : [];
|
|
25941
|
-
// A list (round one) keeps today's offer exactly: the plan's lists narrow only what the award tier adds.
|
|
25942
|
-
const mixOffered = options.tier === AWARD ? layoutMixOffered(options.never, { tier: AWARD, lists: options.lists }) : layoutMixOffered(options.never);
|
|
25943
|
-
const lists = options.lists
|
|
25944
|
-
? {
|
|
25945
|
-
mix: listOf(jsonOneOf(mixOffered), `gallery showing a list (source): how its items are shown, one word per choice — ${mixHint(mixOffered)}; [] for none`),
|
|
25946
|
-
parts: listOf(jsonOneOf(partWords.length ? partWords : [NONE$1]), "gallery showing a list as cards: the list's fields each card shows, <list>.<role>, the source's own; [] for none"),
|
|
25947
|
-
}
|
|
25948
|
-
: {};
|
|
25949
|
-
const carried = options.carry
|
|
25950
|
-
? {
|
|
25951
|
-
carry: oneOf$1([NONE$1, ...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"),
|
|
25952
|
-
}
|
|
25953
|
-
: {};
|
|
25954
|
-
const layer = closed({
|
|
25955
|
-
kind: oneOf$1(V.kinds, 'what the layer is'),
|
|
25956
|
-
role: oneOf$1(V.roles, 'lead: the ONE thing the eye finds first in its section · support: follows it · decoration: only fades · static: never moves'),
|
|
25957
|
-
text: text$1("the words (word, heading, text, label, number, button); '' for none; a fact you were not given is {fact:<key>}"),
|
|
25958
|
-
items: listOf(jsonText(), 'list items · marquee phrases · one caption per gallery photo; [] for none'),
|
|
25959
|
-
photos: listOf(jsonText(), 'photo: one photo id · gallery: its slides, in order; ids from the photos you are given; [] for none'),
|
|
25960
|
-
source: text$1("gallery: the alias of a list data source whose items it shows instead of photos; '' for none"),
|
|
25961
|
-
box: listOf(jsonInteger(), '[colStart, colEnd, rowStart, rowEnd]: grid lines 1..13 (1..12×hold+1 sideways) and 1..rows+1'),
|
|
25962
|
-
size: oneOf$1([NONE$1, ...V.sizes], "type size; 'screen' = as wide as its columns, a word, never a sentence"),
|
|
25963
|
-
color: oneOf$1(V.colours, "the look's colour by name"),
|
|
25964
|
-
align: oneOf$1(V.aligns, 'text alignment'),
|
|
25965
|
-
z: integer('0..9 stacking'),
|
|
25966
|
-
bleed: oneOf$1(V.bleeds, 'runs off the screen at that edge'),
|
|
25967
|
-
rotate: integer("degrees, within the look's limit"),
|
|
25968
|
-
to: text$1("button: a section id of this page or a page route ('/contact'); '' for none"),
|
|
25969
|
-
variant: oneOf$1(VARIANT_ON_WIRE, 'button: primary | secondary | ghost · gallery: its effect · form: its preset · none'),
|
|
25970
|
-
enter: oneOf$1(layoutEntersOffered(options.scrub), scrubOffered(options.scrub)
|
|
25971
|
-
? 'plays once as it arrives (time); clipReveal opens from that side; letters: a line of words rises letter by letter (a display line)'
|
|
25972
|
-
: 'plays once as it arrives (time); clipReveal opens from that side'),
|
|
25973
|
-
depth: oneOf$1([NONE$1, ...V.depths], 'the parallax trio (not in held sections)'),
|
|
25974
|
-
inner: integer('0..3: how far a photo drifts inside its frame'),
|
|
25975
|
-
flags: listOf(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`),
|
|
25976
|
-
perView: { type: 'number', description: 'gallery slides per view; 0 for none' },
|
|
25977
|
-
slots: listOf(closed({ slot: oneOf$1(SLOT_NAMES, 'which words'), text: text$1('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"),
|
|
25978
|
-
motion: listOf(closed({
|
|
25979
|
-
prop: oneOf$1(V.trackProps, 'what moves'),
|
|
25980
|
-
ease: oneOf$1(V.eases, 'how'),
|
|
25981
|
-
values: listOf({ type: 'number' }, '[from, to, at0, at1]: values and the part of the hold it plays over (0..1)'),
|
|
25982
|
-
}), 'held sections only: tracks the scroll plays; [] for none'),
|
|
25983
|
-
...lists,
|
|
25984
|
-
...carried,
|
|
25985
|
-
});
|
|
25986
|
-
const section = closed({
|
|
25987
|
-
id: text$1('a short slug, unique on the page'),
|
|
25988
|
-
kind: oneOf$1(V.sectionKinds, 'content · inhale (a breath: ≤ 2 small layers, no photo) · signature (exactly ONE)'),
|
|
25989
|
-
screens: integer('1..5 screen heights'),
|
|
25990
|
-
hold: integer('0 flows · 1 held (the page stops while its layers move) · 2..4 held and carried sideways that many screens'),
|
|
25991
|
-
ground: text$1("a colour name, or photo:<id>"),
|
|
25992
|
-
rows: integer('4..16 grid rows'),
|
|
25993
|
-
transition: oneOf$1(V.transitions, 'how it arrives over the section before'),
|
|
25994
|
-
phone: listOf(jsonInteger(), "every layer's index exactly once, in a phone's reading order"),
|
|
25995
|
-
layers: listOf(layer, 'the layers'),
|
|
25996
|
-
});
|
|
25997
|
-
return closed({ sections: listOf(section, '4..8 sections') }, 'one composed page in the layout language');
|
|
25998
|
-
}
|
|
25999
|
-
const nonEmpty$2 = (v) => typeof v === 'string' && v.trim() !== '';
|
|
26000
|
-
const num = (v, fallback = 0) => (typeof v === 'number' && Number.isFinite(v) ? v : fallback);
|
|
26001
|
-
const strings = (v) => (Array.isArray(v) ? v.filter((x) => typeof x === 'string') : []);
|
|
26002
|
-
function expandForm(l, preset) {
|
|
26003
|
-
const form = { preset: preset };
|
|
26004
|
-
const options = {};
|
|
26005
|
-
for (const s of Array.isArray(l['slots']) ? l['slots'] : []) {
|
|
26006
|
-
if (!isPlainObject(s) || !nonEmpty$2(s['text']))
|
|
26007
|
-
continue;
|
|
26008
|
-
const slot = String(s['slot']);
|
|
26009
|
-
const words = String(s['text']).trim();
|
|
26010
|
-
if (CHIP_SLOTS.includes(slot))
|
|
26011
|
-
(options[slot] ??= []).push(words);
|
|
26012
|
-
else if (slot === 'channel')
|
|
26013
|
-
form.channel = { label: words };
|
|
26014
|
-
else if (slot === 'title' || slot === 'intro' || slot === 'submit' || slot === 'successTitle' || slot === 'successText')
|
|
26015
|
-
form[slot] = words;
|
|
26016
|
-
}
|
|
26017
|
-
if (Object.keys(options).length)
|
|
26018
|
-
form.options = options;
|
|
26019
|
-
return form;
|
|
26020
|
-
}
|
|
26021
|
-
function expandGallery(l, flags, variant) {
|
|
26022
|
-
const captions = strings(l['items']);
|
|
26023
|
-
const gallery = {
|
|
26024
|
-
slides: strings(l['photos']).map((id, i) => ({ photo: { id }, ...(nonEmpty$2(captions[i]) ? { caption: captions[i] } : {}) })),
|
|
26025
|
-
};
|
|
26026
|
-
if (GALLERY_EFFECTS.includes(variant))
|
|
26027
|
-
gallery.effect = variant;
|
|
26028
|
-
const perView = num(l['perView']);
|
|
26029
|
-
if (perView > 0)
|
|
26030
|
-
gallery.perView = perView;
|
|
26031
|
-
for (const f of ['centered', 'freeMode', 'loop', 'drift', 'scroll'])
|
|
26032
|
-
if (flags.has(f))
|
|
26033
|
-
gallery[f] = true;
|
|
26034
|
-
if (flags.has('autoplay'))
|
|
26035
|
-
gallery.autoplay = LAYOUT_WIRE_AUTOPLAY_MS;
|
|
26036
|
-
if (nonEmpty$2(l['source']))
|
|
26037
|
-
gallery.source = String(l['source']).trim();
|
|
26038
|
-
const list = expandListMix(l, gallery);
|
|
26039
|
-
if (list)
|
|
26040
|
-
gallery.list = list;
|
|
26041
|
-
return gallery;
|
|
26042
|
-
}
|
|
26043
|
-
/** `mix` + `parts` → a list mix, or null when the wire names no mix. Words are kept as written (`checkList` judges them);
|
|
26044
|
-
* parts of another list than the gallery's are left out, and the first part names the list when `source` is empty. */
|
|
26045
|
-
function expandListMix(l, gallery) {
|
|
26046
|
-
const words = strings(l['mix']);
|
|
26047
|
-
if (!words.length)
|
|
26048
|
-
return null;
|
|
26049
|
-
const parts = strings(l['parts']).filter(p => p !== NONE$1).map(p => {
|
|
26050
|
-
const at = p.lastIndexOf(PART_SEPARATOR);
|
|
26051
|
-
return at > 0 ? { list: p.slice(0, at), role: p.slice(at + 1) } : null;
|
|
26052
|
-
}).filter((p) => !!p);
|
|
26053
|
-
if (!gallery.source && parts[0])
|
|
26054
|
-
gallery.source = parts[0].list;
|
|
26055
|
-
return listMixFromWords(words, parts.filter(p => p.list === gallery.source).map(p => p.role));
|
|
26056
|
-
}
|
|
26057
|
-
/**
|
|
26058
|
-
* `<ingredient>:<word>` words (the wire's `mix`, or what a composed list's frame stores — design-core `LIST_MIX_PROP`)
|
|
26059
|
-
* and the roles each item shows → a list mix, or null when there are no words. Words are kept as written (`checkList`
|
|
26060
|
-
* judges them); what is not named takes the wire's defaults. Bindings ▸ List reads a list back through this.
|
|
26061
|
-
*/
|
|
26062
|
-
function listMixFromWords(words, parts = []) {
|
|
26063
|
-
if (!words.length)
|
|
26064
|
-
return null;
|
|
26065
|
-
const picked = new Map();
|
|
26066
|
-
for (const w of words) {
|
|
26067
|
-
const at = w.indexOf(MIX_SEPARATOR);
|
|
26068
|
-
if (at > 0)
|
|
26069
|
-
(picked.get(w.slice(0, at)) ?? picked.set(w.slice(0, at), []).get(w.slice(0, at))).push(w.slice(at + 1));
|
|
26070
|
-
}
|
|
26071
|
-
const one = (k) => picked.get(k)?.[0];
|
|
26072
|
-
const own = [...parts];
|
|
26073
|
-
const arrange = (one(LayoutMixIngredient.Arrange) ?? LayoutListArrange.Row);
|
|
26074
|
-
const who = one(LayoutMixIngredient.Who);
|
|
26075
|
-
const how = one(LayoutMixIngredient.How);
|
|
26076
|
-
return {
|
|
26077
|
-
item: (one(LayoutMixIngredient.Item) ?? (own.length ? LayoutListItem.Card : LayoutListItem.Photo)),
|
|
26078
|
-
parts: Array.from(new Set(own)),
|
|
26079
|
-
arrange,
|
|
26080
|
-
...(who && who !== LayoutListWho.None ? { standout: { who: who, ...(how ? { how: how } : {}) } } : {}),
|
|
26081
|
-
move: Array.from(new Set(picked.get(LayoutMixIngredient.Move) ?? [])),
|
|
26082
|
-
hover: Array.from(new Set(picked.get(LayoutMixIngredient.Hover) ?? [])),
|
|
26083
|
-
arrive: (one(LayoutMixIngredient.Arrive) ?? LayoutListArrive.Together),
|
|
26084
|
-
phone: (one(LayoutMixIngredient.Phone) ?? (arrange === LayoutListArrange.Row ? LayoutListPhone.Swipe : LayoutListPhone.Stack)),
|
|
26085
|
-
};
|
|
26086
|
-
}
|
|
26087
|
-
/** A list mix's words, `<ingredient>:<word>` — the wire's `mix`, and what a composed list's frame stores (AW11,
|
|
26088
|
-
* design-core `LIST_MIX_PROP`) for Bindings ▸ List and the shared CSS. */
|
|
26089
|
-
function listMixWords(mix) {
|
|
26090
|
-
const w = (k, v) => `${k}${MIX_SEPARATOR}${v}`;
|
|
26091
|
-
return [
|
|
26092
|
-
w(LayoutMixIngredient.Item, mix.item), w(LayoutMixIngredient.Arrange, mix.arrange),
|
|
26093
|
-
...(mix.standout ? [w(LayoutMixIngredient.Who, mix.standout.who), ...(mix.standout.how ? [w(LayoutMixIngredient.How, mix.standout.how)] : [])] : []),
|
|
26094
|
-
...mix.move.map(m => w(LayoutMixIngredient.Move, m)), ...mix.hover.map(h => w(LayoutMixIngredient.Hover, h)),
|
|
26095
|
-
w(LayoutMixIngredient.Arrive, mix.arrive), w(LayoutMixIngredient.Phone, mix.phone),
|
|
26096
|
-
];
|
|
26097
|
-
}
|
|
26098
|
-
/** A list mix → the wire's `mix` words and `parts`. */
|
|
26099
|
-
function listMixToWire(mix, source) {
|
|
26100
|
-
return { mix: listMixWords(mix), parts: mix.parts.map(r => `${source}${PART_SEPARATOR}${r}`) };
|
|
26101
|
-
}
|
|
26102
|
-
function expandTrack(t) {
|
|
26103
|
-
const v = Array.isArray(t['values']) ? t['values'].map(x => num(x)) : [];
|
|
26104
|
-
return { prop: String(t['prop']), from: v[0] ?? 0, to: v[1] ?? 0, at: [v[2] ?? 0, v[3] ?? 1], ease: String(t['ease']) };
|
|
26105
|
-
}
|
|
26106
|
-
function expandLayer(l, beat) {
|
|
26107
|
-
const kind = String(l['kind']);
|
|
26108
|
-
const box = Array.isArray(l['box']) ? l['box'].map(x => num(x)) : [];
|
|
26109
|
-
const flags = new Set(strings(l['flags']));
|
|
26110
|
-
const variant = String(l['variant'] ?? NONE$1);
|
|
26111
|
-
const out = {
|
|
26112
|
-
kind: kind,
|
|
26113
|
-
role: String(l['role']),
|
|
26114
|
-
col: [box[0] ?? 1, box[1] ?? 2],
|
|
26115
|
-
row: [box[2] ?? 1, box[3] ?? 2],
|
|
26116
|
-
};
|
|
26117
|
-
if (nonEmpty$2(l['text']))
|
|
26118
|
-
out.text = String(l['text']);
|
|
26119
|
-
const items = strings(l['items']);
|
|
26120
|
-
if (items.length && kind !== 'gallery')
|
|
26121
|
-
out.items = items;
|
|
26122
|
-
if (kind === 'photo' && strings(l['photos'])[0])
|
|
26123
|
-
out.photo = { id: strings(l['photos'])[0] };
|
|
26124
|
-
if (kind === 'gallery')
|
|
26125
|
-
out.gallery = expandGallery(l, flags, variant);
|
|
26126
|
-
if (kind === 'form')
|
|
26127
|
-
out.form = expandForm(l, FORM_PRESETS.includes(variant) ? variant : 'contact');
|
|
26128
|
-
if (kind === 'button' && BUTTON_VARIANTS.includes(variant))
|
|
26129
|
-
out.variant = variant;
|
|
26130
|
-
if (nonEmpty$2(l['size']) && l['size'] !== NONE$1)
|
|
26131
|
-
out.size = String(l['size']);
|
|
26132
|
-
if (nonEmpty$2(l['color']))
|
|
26133
|
-
out.color = String(l['color']);
|
|
26134
|
-
if (nonEmpty$2(l['align']))
|
|
26135
|
-
out.align = String(l['align']);
|
|
26136
|
-
if (num(l['z']))
|
|
26137
|
-
out.z = num(l['z']);
|
|
26138
|
-
if (nonEmpty$2(l['bleed']) && l['bleed'] !== NONE$1)
|
|
26139
|
-
out.bleed = String(l['bleed']);
|
|
26140
|
-
if (num(l['rotate']))
|
|
26141
|
-
out.rotate = num(l['rotate']);
|
|
26142
|
-
if (nonEmpty$2(l['to']))
|
|
26143
|
-
out.to = String(l['to']).trim();
|
|
26144
|
-
if (flags.has('scrim'))
|
|
26145
|
-
out.scrim = true;
|
|
26146
|
-
if (flags.has('kinetic'))
|
|
26147
|
-
out.kinetic = true;
|
|
26148
|
-
if (flags.has('contain'))
|
|
26149
|
-
out.fit = 'contain';
|
|
26150
|
-
if (flags.has(SCRUB_FLAG))
|
|
26151
|
-
out.scrub = true;
|
|
26152
|
-
const enter = String(l['enter'] ?? NONE$1);
|
|
26153
|
-
if (enter.startsWith(CLIP_SIDE)) {
|
|
26154
|
-
out.enter = CLIP;
|
|
26155
|
-
out.from = enter.slice(CLIP_SIDE.length);
|
|
26156
|
-
}
|
|
26157
|
-
else if (enter !== NONE$1)
|
|
26158
|
-
out.enter = enter;
|
|
26159
|
-
if (out.enter)
|
|
26160
|
-
out.beat = beat;
|
|
26161
|
-
if (nonEmpty$2(l['depth']) && l['depth'] !== NONE$1)
|
|
26162
|
-
out.depth = String(l['depth']);
|
|
26163
|
-
if (num(l['inner']))
|
|
26164
|
-
out.inner = num(l['inner']);
|
|
26165
|
-
const motion = (Array.isArray(l['motion']) ? l['motion'] : []).filter(isPlainObject).map(expandTrack);
|
|
26166
|
-
if (motion.length)
|
|
26167
|
-
out.motion = motion;
|
|
26168
|
-
if (nonEmpty$2(l['carry']) && l['carry'] !== NONE$1)
|
|
26169
|
-
out.carry = String(l['carry']).trim();
|
|
26170
|
-
return out;
|
|
26171
|
-
}
|
|
26172
|
-
/**
|
|
26173
|
-
* A section's beats, never asked: the lead enters first; every other entering layer takes the next beat in the order it
|
|
26174
|
-
* was written, held at the stagger's last (Emil's shrinking stagger reads the beat and stops shrinking at the sixth; the
|
|
26175
|
-
* prototype wrote it on fewer than half the layers). ONE rule
|
|
26176
|
-
* for the wire's expansion and for a page a repair edited (`applyLayoutEdits`).
|
|
26177
|
-
*/
|
|
26178
|
-
function derivedBeats(layers) {
|
|
26179
|
-
const last = LAYOUT_BEAT_DELAY.length - 1;
|
|
26180
|
-
let beat = 0;
|
|
26181
|
-
return layers.map(l => (l.role === 'lead' ? 0 : String(l.enter ?? NONE$1) !== NONE$1 ? Math.min(++beat, last) : 0));
|
|
26182
|
-
}
|
|
26183
|
-
function expandSection(s) {
|
|
26184
|
-
const kind = String(s['kind']);
|
|
26185
|
-
const hold = Math.max(0, Math.round(num(s['hold'])));
|
|
26186
|
-
const wired = (Array.isArray(s['layers']) ? s['layers'] : []).filter(isPlainObject);
|
|
26187
|
-
// RD-D20: a section whose ONLY layer names a bound part, a block or a kept section IS that part — a section place.
|
|
26188
|
-
const whole = wired.length === 1 && nonEmpty$2(wired[0]['carry']) && isSectionCarryHandle(String(wired[0]['carry']).trim())
|
|
26189
|
-
? String(wired[0]['carry']).trim() : null;
|
|
26190
|
-
if (whole)
|
|
26191
|
-
return { id: String(s['id'] ?? ''), screens: 1, rows: 1, layers: [], phone: [], carry: whole };
|
|
26192
|
-
const beats = derivedBeats(wired);
|
|
26193
|
-
const layers = wired.map((l, i) => expandLayer(l, beats[i]));
|
|
26194
|
-
const out = {
|
|
26195
|
-
id: String(s['id'] ?? ''),
|
|
26196
|
-
screens: num(s['screens'], 1),
|
|
26197
|
-
rows: num(s['rows'], 8),
|
|
26198
|
-
ground: String(s['ground'] ?? 'ground'),
|
|
26199
|
-
transition: String(s['transition'] ?? 'cut'),
|
|
26200
|
-
layers,
|
|
26201
|
-
phone: Array.isArray(s['phone']) ? s['phone'].map(x => num(x, -1)) : [],
|
|
26202
|
-
};
|
|
26203
|
-
if (kind === 'inhale')
|
|
26204
|
-
out.kind = 'inhale';
|
|
26205
|
-
if (kind === 'signature')
|
|
26206
|
-
out.signature = true;
|
|
26207
|
-
if (hold >= 1)
|
|
26208
|
-
out.pin = true;
|
|
26209
|
-
if (hold >= 2)
|
|
26210
|
-
out.track = hold;
|
|
26211
|
-
return out;
|
|
26212
|
-
}
|
|
26213
|
-
/**
|
|
26214
|
-
* The wire → a layout page. Refuses (issues with a path) only what it cannot read at all — a missing `sections`, a
|
|
26215
|
-
* section or layer that is not an object; everything a model can get wrong in a well-formed answer is `checkLayout`'s.
|
|
26216
|
-
*/
|
|
26217
|
-
function expandLayoutWire(wire, dial) {
|
|
26218
|
-
const issues = [];
|
|
26219
|
-
const add = (path, message) => issues.push({ code: LayoutIssueCode.Shape, path, message });
|
|
26220
|
-
if (!isPlainObject(wire) || !Array.isArray(wire['sections'])) {
|
|
26221
|
-
add('sections', 'the answer has no sections');
|
|
26222
|
-
return { page: null, issues };
|
|
26223
|
-
}
|
|
26224
|
-
wire['sections'].forEach((s, i) => {
|
|
26225
|
-
if (!isPlainObject(s))
|
|
26226
|
-
add(`sections[${i}]`, 'not an object');
|
|
26227
|
-
else if (!Array.isArray(s['layers']))
|
|
26228
|
-
add(`sections[${i}].layers`, 'no layers');
|
|
26229
|
-
else
|
|
26230
|
-
s['layers'].forEach((l, j) => { if (!isPlainObject(l))
|
|
26231
|
-
add(`sections[${i}].layers[${j}]`, 'not an object'); });
|
|
26232
|
-
});
|
|
26233
|
-
if (issues.length)
|
|
26234
|
-
return { page: null, issues };
|
|
26235
|
-
return { page: { dial, sections: wire['sections'].map(expandSection) }, issues: [] };
|
|
26236
|
-
}
|
|
26237
|
-
function layerToWire(l) {
|
|
26238
|
-
const g = l.gallery;
|
|
26239
|
-
const f = l.form;
|
|
26240
|
-
const flags = [
|
|
26241
|
-
l.scrim && 'scrim', l.kinetic && 'kinetic', l.fit === 'contain' && 'contain',
|
|
26242
|
-
g?.centered && 'centered', g?.freeMode && 'freeMode', g?.loop && 'loop', g?.drift && 'drift', g?.scroll && 'scroll', g?.autoplay ? 'autoplay' : null,
|
|
26243
|
-
l.scrub && SCRUB_FLAG,
|
|
26244
|
-
].filter((x) => !!x);
|
|
26245
|
-
const slots = f
|
|
26246
|
-
? [
|
|
26247
|
-
...['title', 'intro', 'submit', 'successTitle', 'successText'].filter(k => nonEmpty$2(f[k])).map(k => ({ slot: k, text: String(f[k]) })),
|
|
26248
|
-
...(f.channel?.label ? [{ slot: 'channel', text: f.channel.label }] : []),
|
|
26249
|
-
...Object.entries(f.options ?? {}).flatMap(([slot, words]) => (words ?? []).map(t => ({ slot, text: t }))),
|
|
26250
|
-
]
|
|
26251
|
-
: [];
|
|
26252
|
-
return {
|
|
26253
|
-
kind: l.kind,
|
|
26254
|
-
role: l.role ?? 'support',
|
|
26255
|
-
text: l.text ?? '',
|
|
26256
|
-
items: g ? g.slides.map(s => s.caption ?? '') : l.items ?? [],
|
|
26257
|
-
photos: g ? g.slides.map(s => s.photo?.id ?? '') : l.photo ? [l.photo.id] : [],
|
|
26258
|
-
source: g?.source ?? '',
|
|
26259
|
-
box: [...(l.col ?? [1, 2]), ...(l.row ?? [1, 2])],
|
|
26260
|
-
size: l.size ?? NONE$1,
|
|
26261
|
-
color: l.color ?? 'ink',
|
|
26262
|
-
align: l.align ?? 'start',
|
|
26263
|
-
z: l.z ?? 0,
|
|
26264
|
-
bleed: l.bleed ?? NONE$1,
|
|
26265
|
-
rotate: l.rotate ?? 0,
|
|
26266
|
-
to: l.to ?? '',
|
|
26267
|
-
variant: l.variant ?? g?.effect ?? f?.preset ?? NONE$1,
|
|
26268
|
-
enter: l.enter === CLIP ? `${CLIP_SIDE}${l.from ?? 'bottom'}` : l.enter ?? NONE$1,
|
|
26269
|
-
depth: l.depth ?? NONE$1,
|
|
26270
|
-
inner: l.inner ?? 0,
|
|
26271
|
-
flags,
|
|
26272
|
-
perView: typeof g?.perView === 'number' ? g.perView : 0,
|
|
26273
|
-
slots,
|
|
26274
|
-
motion: (l.motion ?? []).map(t => ({ prop: t.prop, ease: t.ease ?? 'out', values: [t.from, t.to, ...(t.at ?? [0, 1])] })),
|
|
26275
|
-
...(g?.list ? listMixToWire(g.list, g.source ?? '') : {}),
|
|
26276
|
-
...(l.carry ? { carry: l.carry } : {}),
|
|
26277
|
-
};
|
|
26278
|
-
}
|
|
26279
|
-
/** A section place (RD-D20) on the wire: ONE layer naming its handle — what `expandSection` reads back as the place. */
|
|
26280
|
-
function carryPlaceToWire(s) {
|
|
26281
|
-
const layer = {
|
|
26282
|
-
kind: 'text', role: 'lead', text: '', items: [], photos: [], source: '', box: [1, 13, 1, 2], size: NONE$1, color: 'ink', align: 'start',
|
|
26283
|
-
z: 0, bleed: NONE$1, rotate: 0, to: '', variant: NONE$1, enter: NONE$1, depth: NONE$1, inner: 0, flags: [], perView: 0, slots: [], motion: [],
|
|
26284
|
-
carry: s.carry,
|
|
26285
|
-
};
|
|
26286
|
-
return { id: s.id, kind: 'content', screens: 1, hold: 0, ground: 'ground', rows: 4, transition: 'cut', phone: [0], layers: [layer] };
|
|
26287
|
-
}
|
|
26288
|
-
/** A layout page (or a saved CL2.1 site's sections) → the wire. */
|
|
26289
|
-
function layoutToWire(page) {
|
|
26290
|
-
return {
|
|
26291
|
-
sections: page.sections.map(s => (s.carry ? carryPlaceToWire(s) : {
|
|
26292
|
-
id: s.id,
|
|
26293
|
-
kind: s.signature ? 'signature' : s.kind ?? 'content',
|
|
26294
|
-
screens: s.screens,
|
|
26295
|
-
hold: s.pin ? s.track ?? 1 : 0,
|
|
26296
|
-
ground: s.ground ?? 'ground',
|
|
26297
|
-
rows: s.rows,
|
|
26298
|
-
transition: s.transition ?? 'cut',
|
|
26299
|
-
phone: s.phone ?? [],
|
|
26300
|
-
layers: s.layers.map(layerToWire),
|
|
26301
|
-
})),
|
|
26302
|
-
};
|
|
26303
|
-
}
|
|
26304
|
-
|
|
26305
26488
|
/**
|
|
26306
26489
|
* THE layout composer (premium components M8, gate 1): a page written in the layout language (`layout-language.ts`) in,
|
|
26307
26490
|
* ordinary builder nodes out — the same `createSerializedNode` every composed page is made of, so the builder reloads it
|
|
@@ -26578,14 +26761,15 @@ function isLight(colour, mode) {
|
|
|
26578
26761
|
return mode === LayoutColourMode.Light ? ground : !ground;
|
|
26579
26762
|
}
|
|
26580
26763
|
const gridTemplate = (count) => `repeat(${count}, minmax(0, 1fr))`;
|
|
26581
|
-
/** The grid a section's layers are placed on: 12 columns per screen
|
|
26764
|
+
/** The grid a section's layers are placed on: 12 columns per screen between an outer track a side (the page's column,
|
|
26765
|
+
* award §0c CW2 — `layoutGridColumns`), its rows. No inline padding: a bleed spans into an outer track. */
|
|
26582
26766
|
function gridLayout(rows, track) {
|
|
26583
26767
|
return {
|
|
26584
26768
|
display: 'grid',
|
|
26585
|
-
gridTemplateColumns:
|
|
26769
|
+
gridTemplateColumns: layoutGridColumns(track),
|
|
26586
26770
|
gridTemplateRows: gridTemplate(rows),
|
|
26587
26771
|
gap: `${ZERO$1} ${LAYOUT_COLUMN_GAP}`,
|
|
26588
|
-
padding:
|
|
26772
|
+
padding: ZERO$1,
|
|
26589
26773
|
};
|
|
26590
26774
|
}
|
|
26591
26775
|
/** The same grid on a phone: one column, in the section's `phone` order, with the M1.3 padding. */
|
|
@@ -26595,15 +26779,9 @@ function phoneStack(first) {
|
|
|
26595
26779
|
flexDirection: 'column',
|
|
26596
26780
|
height: 'auto',
|
|
26597
26781
|
gap: ZERO$1,
|
|
26598
|
-
padding: `${first ? PHONE_FIRST_TOP : LAYOUT_PHONE_PADDING} ${
|
|
26782
|
+
padding: `${first ? PHONE_FIRST_TOP : LAYOUT_PHONE_PADDING} ${LAYOUT_INSET} ${LAYOUT_PHONE_PADDING} ${LAYOUT_INSET}`,
|
|
26599
26783
|
};
|
|
26600
26784
|
}
|
|
26601
|
-
/** A bleed's width: its cell and the gutters it runs into (a negative margin alone moves a box that holds its width). */
|
|
26602
|
-
function bleedWidth(bleed) {
|
|
26603
|
-
if (!bleed || bleed === LayoutBleed.None)
|
|
26604
|
-
return null;
|
|
26605
|
-
return bleed === LayoutBleed.Both ? `calc(100% + 2 * ${LAYOUT_GUTTER})` : `calc(100% + ${LAYOUT_GUTTER})`;
|
|
26606
|
-
}
|
|
26607
26785
|
/** The physical sides a bleed runs into, from the page's direction. */
|
|
26608
26786
|
function bleedSides(bleed, rtl) {
|
|
26609
26787
|
if (!bleed || bleed === LayoutBleed.None)
|
|
@@ -26612,13 +26790,16 @@ function bleedSides(bleed, rtl) {
|
|
|
26612
26790
|
const end = bleed === LayoutBleed.End || bleed === LayoutBleed.Both;
|
|
26613
26791
|
return rtl ? { left: end, right: start } : { left: start, right: end };
|
|
26614
26792
|
}
|
|
26615
|
-
/**
|
|
26616
|
-
|
|
26617
|
-
|
|
26618
|
-
|
|
26619
|
-
|
|
26620
|
-
|
|
26621
|
-
|
|
26793
|
+
/**
|
|
26794
|
+
* A layer's columns on the grid (award §0c CW2): its layout lines past the outer track — and a bleed spans into the outer
|
|
26795
|
+
* track on its side, to the window's edge (grid lines are logical, so a start bleed is the right edge in Hebrew). Never a
|
|
26796
|
+
* negative margin: inside a cell a `%` is the cell's (T-CW2).
|
|
26797
|
+
*/
|
|
26798
|
+
function gridColumnOf(l) {
|
|
26799
|
+
const bleed = l.bleed && l.bleed !== LayoutBleed.None ? l.bleed : null;
|
|
26800
|
+
const start = bleed === LayoutBleed.Start || bleed === LayoutBleed.Both ? LAYOUT_BLEED_START_LINE : layoutGridLine(l.col[0]);
|
|
26801
|
+
const end = bleed === LayoutBleed.End || bleed === LayoutBleed.Both ? LAYOUT_BLEED_END_LINE : layoutGridLine(l.col[1]);
|
|
26802
|
+
return `${start} / ${end}`;
|
|
26622
26803
|
}
|
|
26623
26804
|
// ── Motion ──────────────────────────────────────────────────────────────────────────────────────────────
|
|
26624
26805
|
const ENTER_TYPE = {
|
|
@@ -26724,19 +26905,13 @@ function restingTracks(tracks) {
|
|
|
26724
26905
|
function place(node, l, lc, ctx) {
|
|
26725
26906
|
const stretch = STRETCH_KINDS.has(l.kind);
|
|
26726
26907
|
const values = {
|
|
26727
|
-
gridColumn:
|
|
26908
|
+
gridColumn: gridColumnOf(l),
|
|
26728
26909
|
gridRow: `${l.row[0]} / ${l.row[1]}`,
|
|
26729
26910
|
alignSelf: stretch ? 'stretch' : 'center',
|
|
26730
26911
|
zIndex: String(1 + (l.z ?? 0)),
|
|
26731
26912
|
position: 'relative',
|
|
26732
26913
|
minWidth: ZERO$1,
|
|
26733
26914
|
};
|
|
26734
|
-
const margin = bleedMargin(l.bleed, ctx.rtl);
|
|
26735
|
-
if (margin)
|
|
26736
|
-
values['margin'] = margin;
|
|
26737
|
-
const width = l.kind === LayoutLayerKind.Button ? null : bleedWidth(l.bleed);
|
|
26738
|
-
if (width)
|
|
26739
|
-
values['width'] = width;
|
|
26740
26915
|
if (l.rotate)
|
|
26741
26916
|
values['rotate'] = `${l.rotate}deg`;
|
|
26742
26917
|
if (l.kind === LayoutLayerKind.Button)
|
|
@@ -26748,8 +26923,6 @@ function place(node, l, lc, ctx) {
|
|
|
26748
26923
|
gridColumn: 'auto', gridRow: 'auto', alignSelf: l.kind === LayoutLayerKind.Button ? 'flex-start' : 'stretch', order: String(lc.order),
|
|
26749
26924
|
margin: `${lc.phoneGap}px ${ZERO$1} ${ZERO$1} ${ZERO$1}`,
|
|
26750
26925
|
};
|
|
26751
|
-
if (width)
|
|
26752
|
-
onPhone['width'] = FULL;
|
|
26753
26926
|
if (l.kind === LayoutLayerKind.Button && lc.phoneAlign === 'center')
|
|
26754
26927
|
onPhone['alignSelf'] = 'center';
|
|
26755
26928
|
if (values['textAlign'])
|
|
@@ -26818,7 +26991,7 @@ function textLayer(id, l, lc, ctx) {
|
|
|
26818
26991
|
const rows = l.row[1] - l.row[0];
|
|
26819
26992
|
const em = layoutTextWidthEm(l, ctx.design);
|
|
26820
26993
|
const screens = lc.held ? 1 : lc.section.screens;
|
|
26821
|
-
setStyleProps(node, { fontSize: screenFontSize(em, screenWordColumns(l), rows, lc.section.rows, screens) });
|
|
26994
|
+
setStyleProps(node, { fontSize: screenFontSize(em, screenWordColumns(l), rows, lc.section.rows, screens, ctx.columnPx) });
|
|
26822
26995
|
phone(node, { fontSize: screenFontSize(em, GRID_COLUMNS, 0, 0, 0) });
|
|
26823
26996
|
gap(ctx, LayoutGapCode.ScreenFit, lc.path, 'sized from its face\'s measured letters (no kerning), not fitted in the browser');
|
|
26824
26997
|
}
|
|
@@ -26947,7 +27120,8 @@ function galleryLayer(id, l, lc, ctx) {
|
|
|
26947
27120
|
const sides = bleedSides(l.bleed, ctx.rtl);
|
|
26948
27121
|
const bar = (slider.children ?? []).find(c => c.role === SliderRole.Bar);
|
|
26949
27122
|
if (sides && bar) {
|
|
26950
|
-
|
|
27123
|
+
const inset = layoutBledBarInset(ctx.columnPx);
|
|
27124
|
+
setStyleProps(bar, { padding: `${GALLERY_BAR_TOP} ${sides.right ? inset : ZERO$1} ${ZERO$1} ${sides.left ? inset : ZERO$1}` });
|
|
26951
27125
|
phone(bar, { padding: `${GALLERY_BAR_TOP} ${ZERO$1} ${ZERO$1} ${ZERO$1}` });
|
|
26952
27126
|
}
|
|
26953
27127
|
if (lc.held)
|
|
@@ -26983,9 +27157,32 @@ function listOfLayer(l, ctx) {
|
|
|
26983
27157
|
const g = l.gallery;
|
|
26984
27158
|
return g?.list && g.source ? ctx.listOf(g.source) : null;
|
|
26985
27159
|
}
|
|
26986
|
-
/**
|
|
26987
|
-
|
|
26988
|
-
|
|
27160
|
+
/** Award §0c CW2 (AW-D38, amended 2026-11-23 — Doron: half the contained column holds TWO pictures, not one): the least an
|
|
27161
|
+
* item of a grid may stand at the check's laptop — a picture item, a words-only one. The ONE table: the contract's
|
|
27162
|
+
* `layout.limits.listItemMinPx` (layout.mjs LIMITS), which build-spec's column gate holds every look to. */
|
|
27163
|
+
const LIST_ITEM_MIN_PX = SPEC_SITE_LAYOUT.limits.listItemMinPx;
|
|
27164
|
+
const pxOf = (value) => parseFloat(String(value ?? '')) || 0;
|
|
27165
|
+
/**
|
|
27166
|
+
* How many columns a grid of items takes in a cell `span` columns wide: three across most of the page, fewer in less
|
|
27167
|
+
* room. On a page in a column (award §0c CW2, AW-D38) the count is also judged in px of the COLUMN at the check's laptop
|
|
27168
|
+
* (1440): the most items that each keep their least (`LIST_ITEM_MIN_PX`: 280px a picture item, 240px words only) — contained keeps three
|
|
27169
|
+
* across, narrow gives two pictures. Wide stays as it was (the span alone).
|
|
27170
|
+
*/
|
|
27171
|
+
function listColumns(span, columnPx = null, picture = true, density) {
|
|
27172
|
+
const most = span >= 9 ? 3 : span >= 5 ? 2 : 1;
|
|
27173
|
+
if (columnPx === null)
|
|
27174
|
+
return most;
|
|
27175
|
+
const width = LAYOUT_CHECK_VIEWPORT.width;
|
|
27176
|
+
const room = SPEC_AXES.densities[String(density)] ?? SPEC_AXES.densities.regular;
|
|
27177
|
+
const grid = layoutGridPx(width, columnPx, pxOf(room['space-gutter']));
|
|
27178
|
+
const g = layoutGapPx(width);
|
|
27179
|
+
const cell = (span * (grid - (GRID_COLUMNS - 1) * g)) / GRID_COLUMNS + Math.max(0, span - 1) * g;
|
|
27180
|
+
const gap = pxOf(room['space-gap']);
|
|
27181
|
+
const least = picture ? LIST_ITEM_MIN_PX.picture : LIST_ITEM_MIN_PX.words;
|
|
27182
|
+
for (let n = most; n > 1; n--)
|
|
27183
|
+
if ((cell - (n - 1) * gap) / n >= least)
|
|
27184
|
+
return n;
|
|
27185
|
+
return 1;
|
|
26989
27186
|
}
|
|
26990
27187
|
/** An item's way in, as the ONE interaction runtime plays it: together, one after another, or sliding in from the side
|
|
26991
27188
|
* the page reads from (mirrored in RTL). A Repeater's rows take their share of the stagger at runtime. */
|
|
@@ -27218,7 +27415,7 @@ function composeList(id, l, mix, source, list, lc, ctx) {
|
|
|
27218
27415
|
}
|
|
27219
27416
|
const items = create$1(`${id}-items`, 'Repeater', {}, 'box');
|
|
27220
27417
|
items.bindings.push({ prop: 'source', source, path: '' });
|
|
27221
|
-
const columns = listColumns((l.col?.[1] ?? 13) - (l.col?.[0] ?? 1));
|
|
27418
|
+
const columns = listColumns((l.col?.[1] ?? 13) - (l.col?.[0] ?? 1), ctx.columnPx, !!list.roles['image'], ctx.design?.density);
|
|
27222
27419
|
if (masonry) {
|
|
27223
27420
|
// A wall: CSS columns over the rows (iox-design.css), as many as the room holds — never a breakpoint, so the
|
|
27224
27421
|
// canvas's frame and the live page agree; `two-up` keeps two on a phone.
|
|
@@ -27255,6 +27452,7 @@ function composeListFrame(input, previous) {
|
|
|
27255
27452
|
p: id, site, rtl: layoutRtl(input.locale), mode: LayoutColourMode.Light, pace,
|
|
27256
27453
|
ease: LAYOUT_EASING[(input.motion?.ease ?? LayoutEase.Out)] ?? LAYOUT_EASING[LayoutEase.Out],
|
|
27257
27454
|
sections: {}, gaps: [], links: [], headingSeen: false, carry: new Map(), keptArrangement: [],
|
|
27455
|
+
columnPx: layoutColumnPx(input.column, input.density), design: input.density ? { density: input.density } : undefined,
|
|
27258
27456
|
listOf: () => input.list, sourceFields: () => null, photoSrc: () => '', photoAlt: () => '', photoAspect: () => LAYOUT_PHOTO_ASPECT[LayoutPhotoShape.Landscape],
|
|
27259
27457
|
};
|
|
27260
27458
|
const col = input.col ?? [1, 13];
|
|
@@ -27855,14 +28053,6 @@ function readyMadeColumn(neighbour) {
|
|
|
27855
28053
|
const starts = (neighbour?.layers ?? []).filter(l => LAYOUT_TEXT_KINDS.has(l.kind) && Array.isArray(l.col)).map(l => l.col[0]);
|
|
27856
28054
|
return Math.min(READY_MADE_MAX_COLUMN, Math.max(1, starts.length ? Math.min(...starts) : 1));
|
|
27857
28055
|
}
|
|
27858
|
-
/** Where column `n` starts from the page's edge, on the composed sections' own grid (`gridLayout`): the gutter, then
|
|
27859
|
-
* n - 1 columns and their gaps. */
|
|
27860
|
-
function columnInset(n) {
|
|
27861
|
-
if (n <= 1)
|
|
27862
|
-
return LAYOUT_GUTTER;
|
|
27863
|
-
const column = `((100% - 2 * ${LAYOUT_GUTTER} - ${GRID_COLUMNS - 1} * ${LAYOUT_COLUMN_GAP}) / ${GRID_COLUMNS} + ${LAYOUT_COLUMN_GAP})`;
|
|
27864
|
-
return `calc(${LAYOUT_GUTTER} + ${n - 1} * ${column})`;
|
|
27865
|
-
}
|
|
27866
28056
|
/** A pattern that paints its own ground — a Scene, or a picture behind its words — keeps its colours. */
|
|
27867
28057
|
function paintsItsOwnGround(root) {
|
|
27868
28058
|
return root.role === SceneRole.Scene || (root.children ?? []).some(c => c.styleProps?.['position'] === 'absolute');
|
|
@@ -27876,8 +28066,8 @@ function paintsItsOwnGround(root) {
|
|
|
27876
28066
|
*/
|
|
27877
28067
|
function dressReadyMade(root, ground, column) {
|
|
27878
28068
|
if (root.styleProps?.['padding'] === PATTERN_SECTION_PAD) {
|
|
27879
|
-
setStyleProps(root, { padding: `${PATTERN_SECTION_SPACE} ${
|
|
27880
|
-
phone(root, { padding: `${PATTERN_SECTION_SPACE} ${
|
|
28069
|
+
setStyleProps(root, { padding: `${PATTERN_SECTION_SPACE} ${layoutColumnStart(column)}` });
|
|
28070
|
+
phone(root, { padding: `${PATTERN_SECTION_SPACE} ${LAYOUT_INSET}` });
|
|
27881
28071
|
}
|
|
27882
28072
|
if (ground === null || paintsItsOwnGround(root))
|
|
27883
28073
|
return;
|
|
@@ -27948,6 +28138,8 @@ function composeLayout(site, options) {
|
|
|
27948
28138
|
sections: {},
|
|
27949
28139
|
gaps: [],
|
|
27950
28140
|
design: options.design ?? layoutDesignOf(site.look?.preset, options.mode),
|
|
28141
|
+
// The page's word, else the design's when one is given (a layout composed with no design keeps today's wide).
|
|
28142
|
+
columnPx: layoutColumnPx(layoutColumnWord(site.column, options.design), options.design?.density),
|
|
27951
28143
|
photoSrc: options.photoSrc,
|
|
27952
28144
|
photoAlt: options.photoAlt ?? (() => ''),
|
|
27953
28145
|
photoAspect: id => LAYOUT_PHOTO_ASPECT[(options.photoShape?.(id) ?? LayoutPhotoShape.Landscape)] ?? LAYOUT_PHOTO_ASPECT[LayoutPhotoShape.Landscape],
|
|
@@ -29432,6 +29624,7 @@ function composeLayoutPage(page, layout, plan, context, design, placeholders, re
|
|
|
29432
29624
|
name: plan.business.name,
|
|
29433
29625
|
locale: plan.locale ?? DEFAULT_SITE_LOCALE,
|
|
29434
29626
|
dial: layout.dial,
|
|
29627
|
+
...(layout.column ? { column: layout.column } : {}),
|
|
29435
29628
|
look: { preset: preset.id },
|
|
29436
29629
|
motion: layoutMotionOf(preset.id),
|
|
29437
29630
|
sections: layout.sections,
|
|
@@ -29532,9 +29725,11 @@ function composeSite(plan, context) {
|
|
|
29532
29725
|
const first = layout.sections[0];
|
|
29533
29726
|
const worn = wearPlanOpening(page, stamped, plan, context, design, placeholders, issues, !!(first?.pin || first?.carry));
|
|
29534
29727
|
const opening = worn === stamped ? layoutBandScheme(first?.ground) : schemeOfFirst(worn);
|
|
29728
|
+
// Award §0c CW2 (AW-D34): the column the model chose for this page is the page's own word (absent: the site's).
|
|
29729
|
+
const column = columnWordOf(layout.column);
|
|
29535
29730
|
return {
|
|
29536
29731
|
key: page.key, name: page.name, route: { path: page.route }, isHome: page.isHome === true, status: STATUS_DRAFT, locale,
|
|
29537
|
-
pageSettings: { designSystem: true, layoutSource: { pageKey: page.key }, ...(opening ? { opening } : {}) }, seo: composePageSeo(page, plan),
|
|
29732
|
+
pageSettings: { designSystem: true, layoutSource: { pageKey: page.key }, ...(opening ? { opening } : {}), ...(column ? { column } : {}) }, seo: composePageSeo(page, plan),
|
|
29538
29733
|
layout: wearBodyMix(worn, body),
|
|
29539
29734
|
};
|
|
29540
29735
|
}
|
|
@@ -29807,22 +30002,59 @@ function headerShapeOptions(recipe, locale) {
|
|
|
29807
30002
|
// ── The site header on its own (CC1.1) ──────────────────────────────────────────────────────────
|
|
29808
30003
|
/** The header pattern the Studio template stamps — and the builder palette's "Navigation bar". */
|
|
29809
30004
|
const SITE_HEADER_PATTERN = 'nav.inline-cta';
|
|
30005
|
+
/** A stored page's status, as iox-cms keeps it. */
|
|
30006
|
+
var SitePageStatus;
|
|
30007
|
+
(function (SitePageStatus) {
|
|
30008
|
+
SitePageStatus["Draft"] = "draft";
|
|
30009
|
+
SitePageStatus["Published"] = "published";
|
|
30010
|
+
SitePageStatus["Archived"] = "archived";
|
|
30011
|
+
})(SitePageStatus || (SitePageStatus = {}));
|
|
30012
|
+
/** iox-cms `HandoverState.Moved` (`src/pages/page-handover.ts`): a page a build replaced, moved aside to its `-previous`
|
|
30013
|
+
* address once the new page went live — a copy kept for the owner, never a page of the site. */
|
|
30014
|
+
const SITE_PAGE_MOVED_ASIDE = 'moved';
|
|
29810
30015
|
const ROUTE_PARAM = ':';
|
|
29811
30016
|
const HOME_PATH = '/';
|
|
29812
30017
|
const KEY_UNSAFE = /[^a-z0-9]+/gi;
|
|
29813
|
-
|
|
29814
|
-
|
|
30018
|
+
const pageIsLive = (p) => p.status === undefined || p.status === SitePageStatus.Published;
|
|
30019
|
+
/** The pages of the site: every page the studio holds but an archived one and a copy a build moved aside. What a section
|
|
30020
|
+
* may link to (a button to /contact), what a header is composed among. Pure. */
|
|
30021
|
+
function sitePages(pages) {
|
|
30022
|
+
return pages.filter(p => !!p.route && p.status !== SitePageStatus.Archived && p.handover?.state !== SITE_PAGE_MOVED_ASIDE);
|
|
30023
|
+
}
|
|
30024
|
+
/**
|
|
30025
|
+
* THE rule for which pages a navigation links to (iox-cms-client#82) — the header the builder composes, its phone menu,
|
|
30026
|
+
* "Pages in the bar", a section's `$navPages`: a page of the site (`sitePages`) that a visitor reaches on the live site —
|
|
30027
|
+
* published (a draft is a 404 there) — and is not Home (the brand links there), not a template page (a `/work/:slug`
|
|
30028
|
+
* route has no single address), not a legal page (the footer's), one per address, in the studio's order. While NOTHING
|
|
30029
|
+
* of the studio is published yet (a site just built, before Publish site) the drafts stand in: Publish site puts them
|
|
30030
|
+
* live together, so none of them is a dead link on the site it will be. Pure.
|
|
30031
|
+
*/
|
|
29815
30032
|
function siteNavPages(pages) {
|
|
29816
|
-
|
|
30033
|
+
const ofSite = sitePages(pages);
|
|
30034
|
+
const anyLive = ofSite.some(pageIsLive);
|
|
30035
|
+
const seen = new Set();
|
|
30036
|
+
return ofSite.filter(p => {
|
|
30037
|
+
if (p.isHome || p.route === HOME_PATH || p.route.includes(ROUTE_PARAM) || p.legal)
|
|
30038
|
+
return false;
|
|
30039
|
+
if (anyLive && !pageIsLive(p))
|
|
30040
|
+
return false;
|
|
30041
|
+
if (seen.has(p.route))
|
|
30042
|
+
return false;
|
|
30043
|
+
seen.add(p.route);
|
|
30044
|
+
return true;
|
|
30045
|
+
});
|
|
29817
30046
|
}
|
|
30047
|
+
/** The site's pages as a plan's: each `inNav` exactly when `siteNavPages` links it — ONE rule for every composer. */
|
|
29818
30048
|
function navPagePlans(pages) {
|
|
29819
30049
|
const used = new Set();
|
|
29820
|
-
|
|
30050
|
+
const ofSite = sitePages(pages);
|
|
30051
|
+
const nav = new Set(siteNavPages(ofSite));
|
|
30052
|
+
return ofSite.map((p, i) => {
|
|
29821
30053
|
let key = p.route.replace(KEY_UNSAFE, '-').replace(/^-+|-+$/g, '').toLowerCase() || `page-${i}`;
|
|
29822
30054
|
for (let n = 2; used.has(key); n++)
|
|
29823
30055
|
key = `${key}-${n}`;
|
|
29824
30056
|
used.add(key);
|
|
29825
|
-
return { key, name: p.name, route: p.route, inNav:
|
|
30057
|
+
return { key, name: p.name, route: p.route, inNav: nav.has(p), isHome: p.isHome === true, sections: [] };
|
|
29826
30058
|
});
|
|
29827
30059
|
}
|
|
29828
30060
|
/**
|
|
@@ -29834,9 +30066,7 @@ function navPagePlans(pages) {
|
|
|
29834
30066
|
/** The plan a studio with no Site Plan stands for, as far as its header goes: its name, its pages (in the navigation or
|
|
29835
30067
|
* not), its language, its look. */
|
|
29836
30068
|
function navHeaderPlan(input) {
|
|
29837
|
-
const
|
|
29838
|
-
const navRoutes = new Set(siteNavPages(input.pages).map(p => p.route));
|
|
29839
|
-
const pages = all.map(p => ({ ...p, inNav: navRoutes.has(p.route) }));
|
|
30069
|
+
const pages = navPagePlans(input.pages);
|
|
29840
30070
|
return { business: input.business, pages, dataSources: [], contentTypes: [], locale: input.locale, design: input.design ?? {} };
|
|
29841
30071
|
}
|
|
29842
30072
|
/** What a studio's header is judged against (`checkHeader`) — the same context `composeNavHeader` checks with. */
|
|
@@ -32994,6 +33224,19 @@ function siteSells(snapshot) {
|
|
|
32994
33224
|
walkSerialized(snapshot.globals, visit);
|
|
32995
33225
|
return sells;
|
|
32996
33226
|
}
|
|
33227
|
+
/** The parts that make a PAGE the shop's — a product's price, or what puts it in the bag or opens the checkout. The
|
|
33228
|
+
* header's bag and drawer are the site's chrome: they make a site sell (`siteSells`), never the café's Home a shop. */
|
|
33229
|
+
const PAGE_SHOP_ROLES = new Set([ShopRole.Price, ShopRole.Add, ShopRole.BuyNow, ShopRole.Checkout]);
|
|
33230
|
+
/**
|
|
33231
|
+
* iox-cms#98: the page shows the shop's products for sale — what a store fact (`store-fact`) and an unpriced or
|
|
33232
|
+
* unstocked sample product (`sample-price`, `sample-stock`) hold. Every other page goes live whatever the shop lacks.
|
|
33233
|
+
*/
|
|
33234
|
+
function pageShowsShop(page) {
|
|
33235
|
+
let shows = false;
|
|
33236
|
+
walkSerialized(page.layout, n => { if (!shows && !!n.role && PAGE_SHOP_ROLES.has(n.role))
|
|
33237
|
+
shows = true; });
|
|
33238
|
+
return shows;
|
|
33239
|
+
}
|
|
32997
33240
|
/** A route pattern (`/work/:slug`) matches a concrete path (`/work/blue-bowl`). */
|
|
32998
33241
|
function routeMatches(pattern, path) {
|
|
32999
33242
|
const a = pattern.split('/').filter(Boolean);
|
|
@@ -33148,11 +33391,13 @@ function checkFacts(ctx, snapshot, pages, personal) {
|
|
|
33148
33391
|
}
|
|
33149
33392
|
for (const s of snapshot.samples ?? [])
|
|
33150
33393
|
add(ctx, SiteFindingCode.SampleItems, `"${s.label ?? s.id}" is a sample — replace or remove it.`, { nodeId: s.id });
|
|
33151
|
-
|
|
33394
|
+
// iox-cms#98: what the shop lacks holds only the pages that show the shop — never the Home of a site that also sells.
|
|
33395
|
+
const shopShown = pages.some(pageShowsShop);
|
|
33396
|
+
for (const s of shopShown ? snapshot.unpricedSamples ?? [] : [])
|
|
33152
33397
|
add(ctx, SiteFindingCode.SamplePrice, `"${s.label ?? s.id}" has no price yet — set yours, or remove the sample.`, { nodeId: s.id });
|
|
33153
|
-
for (const s of snapshot.unstockedSamples ?? [])
|
|
33398
|
+
for (const s of shopShown ? snapshot.unstockedSamples ?? [] : [])
|
|
33154
33399
|
add(ctx, SiteFindingCode.SampleStock, `"${s.label ?? s.id}" has no stock yet — say how many you have, or remove the sample.`, { nodeId: s.id });
|
|
33155
|
-
if (snapshot.store?.refusals.length && siteSells(snapshot)) {
|
|
33400
|
+
if (snapshot.store?.refusals.length && shopShown && siteSells(snapshot)) {
|
|
33156
33401
|
for (const r of snapshot.store.refusals) {
|
|
33157
33402
|
const code = STORE_CONTACT_CODES.has(r.code) ? SiteFindingCode.StoreContact : SiteFindingCode.StoreFact;
|
|
33158
33403
|
add(ctx, code, labelIn(r.label, snapshot.store.lang), { fact: r.code });
|
|
@@ -36003,5 +36248,5 @@ function siteGlobalsOf(globals) {
|
|
|
36003
36248
|
* Generated bundle index. Do not edit.
|
|
36004
36249
|
*/
|
|
36005
36250
|
|
|
36006
|
-
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_OWN, ADJUST_STEPS, ADJUST_STEP_IDS, AI_COMPOSED_PAGES_BY_TIER, AI_COMPOSED_PAGES_ESTIMATED, AI_COMPOSED_PAGE_LEAN_TOKENS, 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_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, FilmUnplaced, 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_DEPTH_ON_PHONE, LAYOUT_DRIFT, LAYOUT_EASING, LAYOUT_ENTRANCE_MAX_MS, LAYOUT_FONT_SIZE, LAYOUT_GUTTER, 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_LONG_WORDS, LIST_RHYTHMS, LIST_ROLE_WORDS, LIST_RULES, 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, 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_HEADER_PATTERN, SITE_LIBRARY, SITE_LOCALES, SITE_NEED_IDS, 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, 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, aiRefusalNext, aiStepParts, applyHeaderMix, applyLayoutEdits, applyOpeningMix, applyOwnPhotoGalleries, applyPictureScrims, applyPlanEdits, applyStockItemPhotos, applyStockPhotos, archetypeIssues, areaLuminance, artDirectionFor, artDirectionIssues, artDirectionPreamble, aspectRatioOf, assertStyleSlots, assertValidSitePlan, auditLayoutMotion, auditSite, barIconForRoute, bentoFill, 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, checkAdditions, checkBody, checkCarry, checkFooter, checkHeader, checkLayout, checkList, checkOpening, chooseScrim, 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, 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, fieldToWire, filmOfPlan, filmPlacement, findNavRoot, findOpening, fingerprintOf, fingerprintOfPlanPage, footerMeaning, footerMix, footerMixFromWords, footerMixOfPlan, footerMixWords, footerPattern, footerPatternIdOf, footerReferences, footerTableWords, footerTokenOf, footerTokenWords, footerWait, footerWireWords, footerWords, formAsksPersonalData, formLegalFacts, frameWords, generationTierOf, groundToneOf, 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, layerShownSpans, layoutBandScheme, layoutBoxPx, 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, listDetailOf, listIngredientWords, listMeaning, listMixFromWords, listMixValue, listMixWords, listNeverIsEmpty, listOverhang, listPanelRows, listShapeOfType, listTokenOf, listTokensOf, listWait, listWordOffered, 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, 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, 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, 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 };
|
|
36251
|
+
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_OWN, ADJUST_STEPS, ADJUST_STEP_IDS, AI_COMPOSED_PAGES_BY_TIER, AI_COMPOSED_PAGES_ESTIMATED, AI_COMPOSED_PAGE_LEAN_TOKENS, 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_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, FilmUnplaced, 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_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, 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_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, aiRefusalNext, aiStepParts, applyHeaderMix, applyLayoutEdits, applyOpeningMix, applyOwnPhotoGalleries, applyPictureScrims, applyPlanEdits, applyStockItemPhotos, applyStockPhotos, archetypeIssues, areaLuminance, artDirectionFor, artDirectionIssues, artDirectionPreamble, aspectRatioOf, assertStyleSlots, assertValidSitePlan, auditLayoutMotion, auditSite, barIconForRoute, bentoFill, 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, 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, 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, fieldToWire, filmOfPlan, filmPlacement, findNavRoot, findOpening, fingerprintOf, fingerprintOfPlanPage, footerMeaning, footerMix, footerMixFromWords, footerMixOfPlan, footerMixWords, footerPattern, footerPatternIdOf, footerReferences, footerTableWords, footerTokenOf, footerTokenWords, footerWait, footerWireWords, footerWords, formAsksPersonalData, formLegalFacts, frameWords, generationTierOf, groundToneOf, 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, 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, listMixValue, listMixWords, listNeverIsEmpty, listOverhang, listPanelRows, listShapeOfType, listTokenOf, listTokensOf, listWait, listWordOffered, 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, 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 };
|
|
36007
36252
|
//# sourceMappingURL=vectoriox-iox-ui-generation-core.mjs.map
|