@vectoriox/iox-ui 5.136.0 → 5.138.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/assist-core/index.d.ts +22 -4
- package/composite-core/index.d.ts +10 -2
- package/design-core/index.d.ts +257 -21
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs +12 -2
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs +29 -5
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +18 -2
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +431 -61
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +999 -259
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +5 -4
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-scene-core.mjs +197 -28
- package/fesm2022/vectoriox-iox-ui-scene-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +538 -11
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +1118 -732
- package/harness-core/index.d.ts +2 -2
- package/index.d.ts +150 -4
- package/package.json +1 -1
- package/scene-core/index.d.ts +69 -13
- package/src/actions-core/element-actions.ts +14 -4
- package/src/assist-core/assist-turn.ts +3 -1
- package/src/assist-core/route-schema.ts +20 -5
- package/src/assist-core/surfaces.ts +12 -0
- package/src/composite-core/header.ts +18 -1
- package/src/design-core/design-settings.ts +14 -3
- package/src/design-core/design-token.model.ts +3 -0
- package/src/design-core/flavor-spec.generated.ts +64 -25
- package/src/design-core/graphemes.ts +16 -0
- package/src/design-core/header-behaviour.ts +20 -2
- package/src/design-core/motion-language.ts +11 -7
- package/src/design-core/node-classes.ts +10 -4
- package/src/design-core/preloader-of.ts +26 -0
- package/src/design-core/preloader.ts +49 -5
- package/src/design-core/public-api.ts +4 -0
- package/src/design-core/scrub.ts +37 -0
- package/src/design-core/section-edge.ts +223 -0
- package/src/design-core/style-presets.ts +2 -0
- package/src/generation-core/body-mix.ts +443 -0
- package/src/generation-core/check-layout.ts +42 -4
- package/src/generation-core/compose-layout.ts +28 -6
- package/src/generation-core/compose-site.ts +26 -8
- package/src/generation-core/header-mix.ts +4 -0
- package/src/generation-core/layout-fingerprint.ts +19 -1
- package/src/generation-core/layout-language.ts +21 -1
- package/src/generation-core/layout-wire.ts +27 -2
- package/src/generation-core/node-baselines.generated.ts +7 -2
- package/src/generation-core/opening-mix.ts +32 -0
- package/src/generation-core/plan-wire.ts +1 -0
- package/src/generation-core/public-api.ts +2 -0
- package/src/generation-core/redesign-run.ts +69 -2
- package/src/generation-core/site-build-run.ts +29 -7
- package/src/generation-core/site-plan.model.ts +2 -0
- package/src/generation-core/site-spec.generated.ts +120 -86
- package/src/generation-core/text-scroll.ts +179 -0
- package/src/generation-core/validate-site-plan.ts +4 -2
- package/src/harness-core/starting-design.ts +6 -5
- package/src/scene-core/scroll-range.ts +4 -0
- package/src/scene-core/split-text.ts +216 -28
- package/styles/iox-design.css +87 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { DesignChoices, designTokenRows, parseCssColour, presetChoices, relativeLuminance, resolveTokenValues, toHexColor } from '@vectoriox/iox-ui/design-core';
|
|
1
|
+
import { DesignChoices, designTokenRows, parseCssColour, presetChoices, relativeLuminance, resolveTokenValues, ScrubId, scrubOfChoices, toHexColor } from '@vectoriox/iox-ui/design-core';
|
|
2
2
|
import { ParallaxDepth } from '@vectoriox/iox-ui/scene-core';
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
LAYOUT_HIDDEN_OPACITY, LAYOUT_OPERATED, LAYOUT_TEXT_KINDS, LayoutBandMove, LayoutColour, LayoutDepth, LayoutDial, LayoutEnter, LayoutGalleryList, LayoutIssue, LayoutListShape, LayoutIssueCode, LayoutLayer, LayoutLayerKind, LayoutMend, LayoutMendKind,
|
|
6
6
|
LayoutGivenAway, LayoutListArrange, LayoutListArrive, LayoutListHover, LayoutListItem, LayoutListMix, LayoutListPhone, LayoutPage, LayoutPhotoSource,
|
|
7
|
-
LayoutRole, LayoutSection, LayoutSectionKind, LayoutSourceChoice, LayoutTrackProp, parseLayoutPhotoId,
|
|
7
|
+
LayoutRole, LayoutScrubRefusal, LayoutSection, LayoutSectionKind, LayoutSourceChoice, LayoutTrackProp, parseLayoutPhotoId,
|
|
8
8
|
} from './layout-language';
|
|
9
|
+
import { layoutScrubTakes } from './text-scroll';
|
|
9
10
|
import { DriftBox, driftOverlap, layoutGlideDepth } from './layout-drift';
|
|
10
11
|
import { layoutLookOf } from './layout-look';
|
|
11
12
|
import { patternById, SCENE_LEVEL } from './patterns';
|
|
@@ -15,6 +16,7 @@ import { calmParts, calmUnder, FrameRegion, PhotoInventory, PHOTO_LIGHT_LUMINANC
|
|
|
15
16
|
import { SerializedNode, walkSerialized } from './serialized-node';
|
|
16
17
|
import { SPEC_SITE_FACTS, SPEC_SITE_LAYOUT } from './site-spec.generated';
|
|
17
18
|
import { checkList, LayoutListNever, pageListIssues } from './check-list';
|
|
19
|
+
import { GroundTone, groundToneOf, rhythmIssues } from './body-mix';
|
|
18
20
|
import {
|
|
19
21
|
LAYOUT_CHECK_VIEWPORT, LAYOUT_DRIFT, LAYOUT_KINETIC_KINDS, LAYOUT_LINE_HEIGHT, layoutBoxPx, layoutDriftPhoto, layoutHeldStill, layoutOpeningDisplayMend, layoutOpeningDisplays, layoutShapeHasPurpose,
|
|
20
22
|
layoutStillLine, layoutTextFits, layoutVoidScreens, layoutVoids,
|
|
@@ -69,6 +71,11 @@ export interface CheckLayoutContext {
|
|
|
69
71
|
first?: boolean;
|
|
70
72
|
/** The design the page will wear: its fonts decide whether a `screen` word fits (iox-ui#46). Default: the preset's. */
|
|
71
73
|
design?: DesignChoices;
|
|
74
|
+
/** AW6: the body's rhythm as DRAWN (`drawnBodyMix(bodyMixOfPlan(plan)).rhythm`): the page's grounds are judged against
|
|
75
|
+
* it (`rhythmIssues`). Absent or `free`: each section's ground is its own. */
|
|
76
|
+
rhythm?: string | null;
|
|
77
|
+
/** AW6: how the footer's ground reads — the `tail` rhythm's last sections wear it. Absent: the tail is not judged. */
|
|
78
|
+
footerTone?: GroundTone | null;
|
|
72
79
|
}
|
|
73
80
|
|
|
74
81
|
/** The look's composition notes, read as one shape (the contract's looks differ in which limits they set). */
|
|
@@ -166,6 +173,8 @@ const overlaps = (a: LayoutLayer, b: LayoutLayer) => {
|
|
|
166
173
|
const trackOf = (s: LayoutSection) => s.track ?? 1;
|
|
167
174
|
const groundPhotoOf = (s: LayoutSection) => (String(s.ground ?? '').startsWith(PHOTO_GROUND) ? String(s.ground).slice(PHOTO_GROUND.length) : null);
|
|
168
175
|
const isText = (l: LayoutLayer) => LAYOUT_TEXT_KINDS.has(l.kind);
|
|
176
|
+
/** A line of words — what a text reveal splits (the composer's `textual`): every text kind but a list. */
|
|
177
|
+
const isLine = (l: LayoutLayer) => isText(l) && l.kind !== LayoutLayerKind.List;
|
|
169
178
|
const isPictured = (l: LayoutLayer) => l.kind === LayoutLayerKind.Photo || l.kind === LayoutLayerKind.Gallery;
|
|
170
179
|
const contrastOf = (a: number, b: number) => (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);
|
|
171
180
|
|
|
@@ -299,6 +308,8 @@ function examineLayout(page: LayoutPage, ctx: CheckLayoutContext, carried: Layou
|
|
|
299
308
|
const look: LookNotes | null = L.presetLook[ctx.presetId as keyof typeof L.presetLook] ? layoutLookOf(ctx.presetId) : null;
|
|
300
309
|
const paint = presetPaint(ctx.presetId, ctx.mode);
|
|
301
310
|
const design = ctx.design ?? layoutDesignOf(ctx.presetId, ctx.mode);
|
|
311
|
+
// AW10: the look's By the scroll — what a layer's `scrub` and `letters` may ask of it.
|
|
312
|
+
const scrub = scrubOfChoices(design);
|
|
302
313
|
if (!look) add(LayoutIssueCode.Value, 'look', `"${ctx.presetId}" is not a style preset`);
|
|
303
314
|
if (!paint) add(LayoutIssueCode.Value, 'look', `the "${ctx.presetId}" preset is not worn ${ctx.mode}`);
|
|
304
315
|
const limits = look?.limits ?? {};
|
|
@@ -472,10 +483,26 @@ function examineLayout(page: LayoutPage, ctx: CheckLayoutContext, carried: Layou
|
|
|
472
483
|
if (LAYOUT_OPERATED.has(l.kind) && deep) add(LayoutIssueCode.Motion, `${lp}.depth`, 'what a visitor operates never moves for style — give it no depth (mid)');
|
|
473
484
|
|
|
474
485
|
// the entrance
|
|
486
|
+
const letters = l.enter === LayoutEnter.Letters;
|
|
475
487
|
if (l.enter !== undefined && !inList(V.enters, l.enter)) add(LayoutIssueCode.Value, `${lp}.enter`, V.enters.join(' | '));
|
|
476
|
-
else if (look && l.enter && l.enter !== LayoutEnter.None && l.enter !== LayoutEnter.Fade && !look.enters.includes(l.enter)) {
|
|
488
|
+
else if (look && l.enter && l.enter !== LayoutEnter.None && l.enter !== LayoutEnter.Fade && !letters && !look.enters.includes(l.enter)) {
|
|
477
489
|
add(LayoutIssueCode.Look, `${lp}.enter`, `the ${look.id} look enters with ${['fade', ...look.enters].join(' | ')}`);
|
|
478
490
|
}
|
|
491
|
+
// AW10 (AW10-D2, D12): letters rise on a line of words, on a look whose By the scroll is not never.
|
|
492
|
+
if (letters && l.role !== LayoutRole.Decoration && (!isLine(l) || scrub === ScrubId.Never)) {
|
|
493
|
+
add(LayoutIssueCode.Motion, `${lp}.enter`, !isLine(l) ? `letters rise on a line of words, never a ${l.kind}: it fades` : 'letters come with a look that moves by the scroll: it fades',
|
|
494
|
+
{ kind: LayoutMendKind.Fade, layer: lp });
|
|
495
|
+
}
|
|
496
|
+
// AW10 (AW10-D8, D12): a scrubbed entrance — never in the first screen, only where the look takes it.
|
|
497
|
+
if (l.scrub && i === 0) {
|
|
498
|
+
add(LayoutIssueCode.Motion, `${lp}.scrub`, 'the first screen never follows the scroll — it is wholly in view at load; it plays on time',
|
|
499
|
+
{ kind: LayoutMendKind.Scrub, layer: lp, why: LayoutScrubRefusal.Opening });
|
|
500
|
+
} else if (l.scrub && !layoutScrubTakes(l, isLine(l), scrub)) {
|
|
501
|
+
add(LayoutIssueCode.Motion, `${lp}.scrub`, scrub === ScrubId.Never
|
|
502
|
+
? "the look's By the scroll is never: it plays once as it arrives"
|
|
503
|
+
: `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`,
|
|
504
|
+
{ kind: LayoutMendKind.Scrub, layer: lp, why: LayoutScrubRefusal.Look });
|
|
505
|
+
}
|
|
479
506
|
if (l.enter === LayoutEnter.ClipReveal && l.from && !inList(V.sides, l.from)) add(LayoutIssueCode.Value, `${lp}.from`, V.sides.join(' | '));
|
|
480
507
|
if (l.enter === LayoutEnter.Pop && isText(l) && wordsOf(l.text) > POP_WORDS) add(LayoutIssueCode.Look, `${lp}.enter`, `pop only on ${POP_WORDS} words or fewer`);
|
|
481
508
|
if (l.beat !== undefined && !(Number.isInteger(l.beat) && l.beat >= 0 && l.beat <= BEAT_MAX)) add(LayoutIssueCode.Value, `${lp}.beat`, `0..${BEAT_MAX}`);
|
|
@@ -756,6 +783,12 @@ function examineLayout(page: LayoutPage, ctx: CheckLayoutContext, carried: Layou
|
|
|
756
783
|
if (limits.lightGroundsMax !== undefined && lightGrounds > limits.lightGroundsMax) add(LayoutIssueCode.Look, 'sections', `${lightGrounds} sections on a light ground — the ${look.id} look allows ${limits.lightGroundsMax}`);
|
|
757
784
|
}
|
|
758
785
|
issues.push(...pageListIssues(page));
|
|
786
|
+
if (ctx.rhythm && paint) {
|
|
787
|
+
const toneOf = (s: LayoutSection) => (groundPhotoOf(s)
|
|
788
|
+
? GroundTone.Photo
|
|
789
|
+
: groundToneOf(lumOf(paint.colours[(inList(V.colours, s.ground) ? s.ground : LayoutColour.Ground) as LayoutColour])));
|
|
790
|
+
issues.push(...rhythmIssues(sections, ctx.rhythm, { toneOf, footerTone: ctx.footerTone }));
|
|
791
|
+
}
|
|
759
792
|
const unshown = shownListIssue(page, ctx);
|
|
760
793
|
if (unshown) issues.push(unshown);
|
|
761
794
|
return { issues: uniqueIssues(issues), tally: { signatures: signatures.length, galleries, swappable, layered, bleeds, screenWords, wordsOnPhoto, holds } };
|
|
@@ -1050,7 +1083,12 @@ export function mendLayout(page: LayoutPage, issues: ReadonlyArray<LayoutIssue>)
|
|
|
1050
1083
|
};
|
|
1051
1084
|
for (const issue of issues) {
|
|
1052
1085
|
const mend = issue.mend;
|
|
1053
|
-
if (mend?.kind === LayoutMendKind.
|
|
1086
|
+
if (mend?.kind === LayoutMendKind.Scrub) {
|
|
1087
|
+
const layer = layerAt(mend.layer);
|
|
1088
|
+
if (!layer) continue;
|
|
1089
|
+
delete layer.scrub;
|
|
1090
|
+
mended.push(issue);
|
|
1091
|
+
} else if (mend?.kind === LayoutMendKind.Scrim || mend?.kind === LayoutMendKind.Ink || mend?.kind === LayoutMendKind.Fade) {
|
|
1054
1092
|
const layer = layerAt(mend.layer);
|
|
1055
1093
|
if (!layer) continue;
|
|
1056
1094
|
if (mend.kind === LayoutMendKind.Scrim) layer.scrim = true;
|
|
@@ -3,7 +3,8 @@ import {
|
|
|
3
3
|
SLIDER_PLACEMENT_TRAIT, SliderPlacement, SliderRole, syncSliderParts, SHOP_RECIPES, ShopRecipe, ShopRole, bindShopPart, ShopBindTarget,
|
|
4
4
|
} from '@vectoriox/iox-ui/composite-core';
|
|
5
5
|
|
|
6
|
-
import { ColorScheme, DesignChoices, LinkType, setColorScheme } from '@vectoriox/iox-ui/design-core';
|
|
6
|
+
import { ColorScheme, DesignChoices, LinkType, scrubOfChoices, setColorScheme } from '@vectoriox/iox-ui/design-core';
|
|
7
|
+
import { TextRevealBy } from '@vectoriox/iox-ui/scene-core';
|
|
7
8
|
import { FORM_AFTER_SEND_TRAIT, FormAfterSend, FormPresetId } from '@vectoriox/iox-ui/forms-core';
|
|
8
9
|
import { composeNavHeader, composePresetForm } from './compose-site';
|
|
9
10
|
import { drawnHeaderMix, headerMixOfNavKind } from './header-mix';
|
|
@@ -21,6 +22,7 @@ import { layoutDesignOf, layoutElementStyle, layoutTextWidthEm, screenWordColumn
|
|
|
21
22
|
import { ComposeError, createSerializedNode, SerializedNode, setStyleProps, assertStyleSlots, walkSerialized } from './serialized-node';
|
|
22
23
|
import { BUTTON_LINK_PROPS, CarryKind, PageCarry } from './carry';
|
|
23
24
|
import { MOTION_TRIGGERS, ownerContentInto } from './carry-fill';
|
|
25
|
+
import { layoutScrubTakes, scrubbedEntrance, StampedInteraction } from './text-scroll';
|
|
24
26
|
|
|
25
27
|
/**
|
|
26
28
|
* THE layout composer (premium components M8, gate 1): a page written in the layout language (`layout-language.ts`) in,
|
|
@@ -67,6 +69,9 @@ export enum LayoutGapCode {
|
|
|
67
69
|
ListUnlinked = 'list-unlinked',
|
|
68
70
|
/** A list section naming a list the composer was not told how to read (no `listOf`): today's gallery instead. */
|
|
69
71
|
ListUnbound = 'list-unbound',
|
|
72
|
+
/** AW10: a layer saying `scrub` that the look's By the scroll does not take, or in the first screen — it plays once
|
|
73
|
+
* (`checkLayout` mends it before; a stored layout is composed as is and said). */
|
|
74
|
+
Scrub = 'scrub',
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
export interface LayoutGap {
|
|
@@ -407,12 +412,29 @@ const ENTER_TYPE: Readonly<Record<string, string>> = {
|
|
|
407
412
|
[LayoutEnter.Pop]: 'scaleIn',
|
|
408
413
|
[LayoutEnter.ClipReveal]: 'clipReveal',
|
|
409
414
|
[LayoutEnter.MaskRise]: 'revealText',
|
|
415
|
+
// AW10: a line of words rises letter by letter (split in the browser only; a long or joined-script line falls to words).
|
|
416
|
+
[LayoutEnter.Letters]: 'revealText',
|
|
410
417
|
// AW3: the keyframe map draws blurIn (a small blur into focus) — it no longer rises without its blur.
|
|
411
418
|
[LayoutEnter.BlurIn]: 'blurIn',
|
|
412
419
|
};
|
|
413
420
|
|
|
414
|
-
/**
|
|
415
|
-
|
|
421
|
+
/**
|
|
422
|
+
* A time entrance: the round-four renderer's `playEnter` as a `viewportEnter` interaction on the node — or, for a layer
|
|
423
|
+
* that says `scrub` where the look's By the scroll takes it (AW10, `layoutScrubTakes`; never the first screen), the same
|
|
424
|
+
* action played by the scroll (`scrubbedEntrance`).
|
|
425
|
+
*/
|
|
426
|
+
function enterInteraction(nodeId: string, l: LayoutLayer, ctx: Ctx, path: string, textual: boolean, scale = 1, opening = false): unknown | null {
|
|
427
|
+
const once = onceEnterInteraction(nodeId, l, ctx, path, textual, scale);
|
|
428
|
+
if (!once || !l.scrub) return once;
|
|
429
|
+
const scrub = scrubOfChoices(ctx.design);
|
|
430
|
+
if (!layoutScrubTakes(l, textual, scrub, { opening })) {
|
|
431
|
+
gap(ctx, LayoutGapCode.Scrub, path, opening ? 'the first screen plays on time' : `the look's By the scroll (${scrub}) does not take this entrance: it plays once`);
|
|
432
|
+
return once;
|
|
433
|
+
}
|
|
434
|
+
return scrubbedEntrance(once as StampedInteraction, scrub, { opening });
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
function onceEnterInteraction(nodeId: string, l: LayoutLayer, ctx: Ctx, path: string, textual: boolean, scale = 1): unknown | null {
|
|
416
438
|
const enter = l.enter ?? LayoutEnter.None;
|
|
417
439
|
if (enter === LayoutEnter.None) return null;
|
|
418
440
|
const role = (l.role ?? LayoutRole.Support) as LayoutRole;
|
|
@@ -425,8 +447,8 @@ function enterInteraction(nodeId: string, l: LayoutLayer, ctx: Ctx, path: string
|
|
|
425
447
|
if (recipe === LayoutEnter.FadeRise) params['distance'] = rise;
|
|
426
448
|
if (recipe === LayoutEnter.ScaleIn || recipe === LayoutEnter.Pop) gap(ctx, LayoutGapCode.ScaleIn, path, `${recipe} starts at 0.8`);
|
|
427
449
|
if (recipe === LayoutEnter.ClipReveal) params['from'] = l.from ?? LayoutSide.Bottom;
|
|
428
|
-
if (recipe === LayoutEnter.MaskRise) {
|
|
429
|
-
if (textual) params['by'] =
|
|
450
|
+
if (recipe === LayoutEnter.MaskRise || recipe === LayoutEnter.Letters) {
|
|
451
|
+
if (textual) params['by'] = recipe === LayoutEnter.Letters ? TextRevealBy.Letter : TextRevealBy.Word;
|
|
430
452
|
else {
|
|
431
453
|
type = 'moveUp';
|
|
432
454
|
params['distance'] = rise;
|
|
@@ -1145,7 +1167,7 @@ function composeLayer(l: LayoutLayer, lc: LayerCtx, ctx: Ctx): SerializedNode {
|
|
|
1145
1167
|
// A list's items arrive on their own (its mix's `arrive`): the frame never enters on top of them.
|
|
1146
1168
|
const itemsArrive = l.kind === LayoutLayerKind.Gallery && !!listOfLayer(l, ctx);
|
|
1147
1169
|
if (!(lc.held && l.kinetic && textual) && !itemsArrive) {
|
|
1148
|
-
const enter = enterInteraction(entering.id, l, ctx, lc.path, textual);
|
|
1170
|
+
const enter = enterInteraction(entering.id, l, ctx, lc.path, textual, 1, lc.si === 0);
|
|
1149
1171
|
if (enter) entering.interactions = [...entering.interactions, enter];
|
|
1150
1172
|
if (image && l.enter === LayoutEnter.ClipReveal && l.role !== LayoutRole.Decoration) image.interactions = [...image.interactions, zoomInteraction(image.id, l, ctx)];
|
|
1151
1173
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { carryInto, swapParts, type PageCarry } from './carry';
|
|
2
2
|
import {
|
|
3
|
-
AnimateId, COLOR_SCHEME_TRAIT, COLOR_SCHEMES, ColorScheme, colorSchemeClass, DEFAULT_MENU_LOOK, DesignChoices, LinkType, MenuLook, motionLanguageForPlan, resolveDesignChoices, setColorScheme,
|
|
3
|
+
AnimateId, COLOR_SCHEME_TRAIT, COLOR_SCHEMES, ColorScheme, colorSchemeClass, DEFAULT_MENU_LOOK, DesignChoices, LinkType, MenuLook, motionLanguageForPlan, resolveDesignChoices, setColorScheme, headerInkOf,
|
|
4
4
|
} from '@vectoriox/iox-ui/design-core';
|
|
5
5
|
import { SEO_DESCRIPTION_MAX, SEO_TITLE_MAX, SeoRawDoc } from '@vectoriox/iox-ui/seo-core';
|
|
6
6
|
import { channelOpensNewTab, FORM_ACTIONS_ROLE, FORM_CHANNEL_ROLE, FormPresetChannel, FormPresetDef, FormPresetField, formPresetById, presetFormActions } from '@vectoriox/iox-ui/forms-core';
|
|
@@ -10,20 +10,22 @@ import {
|
|
|
10
10
|
AccordionAutoBinds, CompositeNodeSpec, findByRole, LIGHTBOX_LABEL, SLIDE_TO_ROW, SLIDE_TYPE, buildTabsRecipe, tabLabelNodeOf,
|
|
11
11
|
tabPanelImageOf, tabPanelTextOf, tabsListOf, tabsPanels, tabsPanelsOf, tabsTriggers, TABS_CONTENT_LIMIT, TABS_IMAGE_BIND_PROP, TABS_LABEL_BIND_PROP,
|
|
12
12
|
TABS_TEXT_BIND_PROP, TABS_WORDS, TabsAutoBinds, BadgeTone, BADGE_TONES, buildSegmentedRecipe, CardWords, ITEM_OPEN_STATE, segmentedOptions,
|
|
13
|
-
setHeaderBehaviour, SHOP_RECIPES, ShopRecipe, ShopRole, bindShopPart, ShopBindTarget, ACCOUNT_RECIPES, AccountRecipe, AccountRole,
|
|
13
|
+
setHeaderBehaviour, setHeaderInk, SHOP_RECIPES, ShopRecipe, ShopRole, bindShopPart, ShopBindTarget, ACCOUNT_RECIPES, AccountRecipe, AccountRole,
|
|
14
14
|
buildConsentRecipe, ConsentActionType,
|
|
15
15
|
} from '@vectoriox/iox-ui/composite-core';
|
|
16
16
|
import { ConsentCategory } from '@vectoriox/iox-ui/consent-core';
|
|
17
17
|
|
|
18
18
|
import { EntranceMark, EntrancePart, planEntrances } from './entrances';
|
|
19
|
+
import { scrubEntranceStamps } from './text-scroll';
|
|
19
20
|
import { filmOfPlan } from './film';
|
|
20
21
|
import { checkFooter, FooterArrange, footerMixOfPlan, footerPattern } from './footer-mix';
|
|
21
22
|
import {
|
|
22
23
|
countryLegalFacts, FOOTER_LEGAL_ROLE, FORM_LEGAL_ROLE, formAsksPersonalData, formLegalFacts, LEGAL_PAGE_SETTING, LegalContext, LegalFact, LegalFacts,
|
|
23
24
|
legalFormLine, LegalKind, legalKindsFor, legalLabel, legalRoute, legalTitle,
|
|
24
25
|
} from './legal';
|
|
25
|
-
import { checkOpening, drawnOpeningMix, OpeningContext, openingMix, OpeningMix, openingMixOfPlan, openingRecipe, OpeningRole, stampOpeningMix } from './opening-mix';
|
|
26
|
-
import { checkHeader, drawnHeaderMix, HeaderContext, headerContextOfPlan, headerMix, HeaderMix, headerRecipe, HeaderRecipe, stampHeaderMix, wornHeaderOfPlan } from './header-mix';
|
|
26
|
+
import { checkOpening, drawnOpeningMix, OpeningContext, openingMix, OpeningMix, openingMixOfPlan, openingRecipe, OpeningRole, stampOpeningMix, stampOpeningMotion } from './opening-mix';
|
|
27
|
+
import { checkHeader, drawnHeaderMix, HeaderContext, headerContextOfPlan, HeaderIngredient, headerMix, HeaderMix, headerRecipe, HeaderRecipe, stampHeaderMix, wornHeaderOfPlan } from './header-mix';
|
|
28
|
+
import { bodyMixOfPlan, checkBody, drawnBodyMix, wearBodyMix } from './body-mix';
|
|
27
29
|
import { NODE_BASELINES } from './node-baselines.generated';
|
|
28
30
|
import {
|
|
29
31
|
BindScope, CardBindTarget, parsePatternPath, PatternDirective, PatternGlobalPosition, PatternNode, PatternOpens, PatternPlaceholder, PatternRecipe, PatternTrack,
|
|
@@ -118,6 +120,9 @@ export enum ComposeIssueCode {
|
|
|
118
120
|
/** AW8: the opening's mix asked for what the site cannot carry (`checkOpening`), or for a word the product does not
|
|
119
121
|
* draw yet (drawn as its stand-in): the detail says how. */
|
|
120
122
|
OpeningMended = 'opening-mended',
|
|
123
|
+
/** AW6: the body's mix asked for what the build cannot carry (`checkBody`: an award edge on a basic build): the
|
|
124
|
+
* detail says how. */
|
|
125
|
+
BodyMended = 'body-mended',
|
|
121
126
|
}
|
|
122
127
|
|
|
123
128
|
/** The issues that are a dangling link (a route the plan has no page for) and what was done about it. */
|
|
@@ -1428,6 +1433,9 @@ interface SectionMotion {
|
|
|
1428
1433
|
rtl: boolean;
|
|
1429
1434
|
/** The look's heading move (AW3 `design.headings`). */
|
|
1430
1435
|
move?: string | null;
|
|
1436
|
+
/** The look's By the scroll (AW10 `design.scrub`); the page's first section (`opening`) never scrubs (AW10-D8). */
|
|
1437
|
+
scrub?: string | null;
|
|
1438
|
+
opening?: boolean;
|
|
1431
1439
|
}
|
|
1432
1440
|
|
|
1433
1441
|
function composePattern(pattern: SitePattern, id: string, ctx: Ctx, motion: SectionMotion | null = null): SerializedNode {
|
|
@@ -1463,7 +1471,8 @@ function stampEntrances(root: SerializedNode, family: string, entrances: Readonl
|
|
|
1463
1471
|
seen.set(key, index + 1);
|
|
1464
1472
|
return { ...e, index };
|
|
1465
1473
|
});
|
|
1466
|
-
const stamps = planEntrances({ family, level: motion.level, marks, contentIds: (root.children ?? []).map(c => c.id), rtl: motion.rtl, move: motion.move })
|
|
1474
|
+
const stamps = scrubEntranceStamps(planEntrances({ family, level: motion.level, marks, contentIds: (root.children ?? []).map(c => c.id), rtl: motion.rtl, move: motion.move }),
|
|
1475
|
+
motion.scrub, { opening: motion.opening });
|
|
1467
1476
|
for (const { nodeId, interaction } of stamps) {
|
|
1468
1477
|
const node = nodes.get(nodeId);
|
|
1469
1478
|
if (node) node.interactions = [...node.interactions, interaction];
|
|
@@ -1661,6 +1670,11 @@ export function composeSite(plan: SitePlan, context: ComposeContext): ComposedSi
|
|
|
1661
1670
|
const design = motionLanguageForPlan(resolveDesignChoices(clone(plan.design)), context?.tier === GenerationTier.Award);
|
|
1662
1671
|
const locale = plan.locale ?? DEFAULT_SITE_LOCALE;
|
|
1663
1672
|
const rtl = isRtlLocale(locale);
|
|
1673
|
+
// AW6: the plan's body (seams, inset cards) as the build's tier may carry it — every mend said (`body-mended`).
|
|
1674
|
+
const bodyMixAsked = bodyMixOfPlan(plan);
|
|
1675
|
+
const bodyChecked = bodyMixAsked ? checkBody(drawnBodyMix(bodyMixAsked).drawn, { tier: context?.tier ?? GenerationTier.Basic }) : null;
|
|
1676
|
+
for (const r of bodyChecked?.repairs ?? []) issues.push({ code: ComposeIssueCode.BodyMended, nodeId: 'body', owner: 'body', detail: r.said });
|
|
1677
|
+
const body = bodyChecked?.mix ?? null;
|
|
1664
1678
|
const pages: ComposedPage[] = plan.pages.map(page => {
|
|
1665
1679
|
const nextAlias = page.routeSource ? nextSourceOf(relatives, page.routeSource) : null;
|
|
1666
1680
|
if (page.layout) {
|
|
@@ -1676,12 +1690,12 @@ export function composeSite(plan: SitePlan, context: ComposeContext): ComposedSi
|
|
|
1676
1690
|
return {
|
|
1677
1691
|
key: page.key, name: page.name, route: { path: page.route }, isHome: page.isHome === true, status: STATUS_DRAFT, locale,
|
|
1678
1692
|
pageSettings: { designSystem: true, layoutSource: { pageKey: page.key }, ...(opening ? { opening } : {}) }, seo: composePageSeo(page, plan),
|
|
1679
|
-
layout: worn,
|
|
1693
|
+
layout: wearBodyMix(worn, body),
|
|
1680
1694
|
};
|
|
1681
1695
|
}
|
|
1682
1696
|
const layout = wearPlanOpening(page, page.sections.map((section, i) => {
|
|
1683
1697
|
const pattern = patternById(section.pattern) as SitePattern;
|
|
1684
|
-
const motion: SectionMotion = { level: section.enter ?? design.animate ?? null, rtl, move: design.headings ?? null };
|
|
1698
|
+
const motion: SectionMotion = { level: section.enter ?? design.animate ?? null, rtl, move: design.headings ?? null, scrub: design.scrub ?? null, opening: i === 0 };
|
|
1685
1699
|
return stampSection(composePattern(pattern, `${page.key}-${i}`, { ...base, owner: page.key, page, section, nextAlias }, motion), { pattern: section.pattern });
|
|
1686
1700
|
}), plan, context, design, placeholders, issues, false);
|
|
1687
1701
|
const opening = schemeOfFirst(layout);
|
|
@@ -1694,7 +1708,7 @@ export function composeSite(plan: SitePlan, context: ComposeContext): ComposedSi
|
|
|
1694
1708
|
locale,
|
|
1695
1709
|
pageSettings: { designSystem: true, ...(opening ? { opening } : {}) },
|
|
1696
1710
|
seo: composePageSeo(page, plan),
|
|
1697
|
-
layout,
|
|
1711
|
+
layout: wearBodyMix(layout, body),
|
|
1698
1712
|
};
|
|
1699
1713
|
});
|
|
1700
1714
|
|
|
@@ -1731,6 +1745,8 @@ export function composeSite(plan: SitePlan, context: ComposeContext): ComposedSi
|
|
|
1731
1745
|
// HI1b (HS-5): the header root says the mix it was composed as (Bindings ▸ Header and the Header studio read it).
|
|
1732
1746
|
const headerRoot = globals.find(g => g.id === GlobalSlot.Header);
|
|
1733
1747
|
if (headerRoot) stampHeaderMix(headerRoot, header.recipe.mix);
|
|
1748
|
+
// AW6 (AW6-D10): a header whose ink follows the sections says so (the renderers' header ink runtime reads it).
|
|
1749
|
+
if (headerRoot) setHeaderInk(headerRoot as unknown as CompositeNode, headerInkOf(header.recipe.mix[HeaderIngredient.Ink]));
|
|
1734
1750
|
if (planSells(plan)) globals = withStore(globals, plan.locale ?? DEFAULT_SITE_LOCALE);
|
|
1735
1751
|
// AW1: the law, derived from facts and never asked — the legal pages, the banner when a tracker is connected, the
|
|
1736
1752
|
// footer's legal row and the line beside every form that asks for personal details.
|
|
@@ -2057,6 +2073,7 @@ export function composeNavHeader(input: NavHeaderInput, options: NavHeaderOption
|
|
|
2057
2073
|
const [header, ...companions] = shape ? planNavShape([root], shape, { newId: options.newId, ...headerShapeOptions(recipe, input.locale) }, root.id).globals : [root];
|
|
2058
2074
|
if (pattern.header) setHeaderBehaviour(header as unknown as CompositeNode, pattern.header.behaviour, pattern.header.edge ?? null);
|
|
2059
2075
|
stampHeaderMix(header, recipe.mix);
|
|
2076
|
+
setHeaderInk(header as unknown as CompositeNode, headerInkOf(recipe.mix[HeaderIngredient.Ink]));
|
|
2060
2077
|
if (input.storeSlots) withStoreSlots(header, input.locale ?? DEFAULT_SITE_LOCALE);
|
|
2061
2078
|
return { header, issues, mix: checked.mix, companions };
|
|
2062
2079
|
}
|
|
@@ -2284,6 +2301,7 @@ export function composeOpening(input: OpeningInput, options: SectionOptions): Co
|
|
|
2284
2301
|
const recipe = openingRecipe(checked.mix, context);
|
|
2285
2302
|
const section = composePattern(recipe.pattern, options.id, ctx);
|
|
2286
2303
|
stampOpeningMix(section, recipe.mix);
|
|
2304
|
+
stampOpeningMotion(section, recipe.mix);
|
|
2287
2305
|
const badge = typeof input.badge === 'string' && input.badge.trim() ? input.badge.trim() : null;
|
|
2288
2306
|
if (badge) {
|
|
2289
2307
|
walkSerialized([section], n => {
|
|
@@ -42,8 +42,12 @@ export enum HeaderIngredient {
|
|
|
42
42
|
Above = 'above',
|
|
43
43
|
/** HB-D1 (HI3 / HI6): what more sits in the bar. */
|
|
44
44
|
InBar = 'inBar',
|
|
45
|
+
/** AW6: whose ground the header's ink follows — the opening's, or every section's as it passes under the bar. */
|
|
46
|
+
Ink = 'ink',
|
|
45
47
|
}
|
|
46
48
|
|
|
49
|
+
export { HeaderInk } from '@vectoriox/iox-ui/design-core';
|
|
50
|
+
|
|
47
51
|
export enum HeaderArrange {
|
|
48
52
|
Split = 'split',
|
|
49
53
|
Centred = 'centred',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseCssColour, relativeLuminance } from '@vectoriox/iox-ui/design-core';
|
|
2
2
|
|
|
3
3
|
import { layoutPresetColours, splitSide } from './check-layout';
|
|
4
|
-
import { LayoutColour, LayoutIssue, LayoutIssueCode, LayoutLayerKind, LayoutListMix, LayoutListWho, LayoutPage, LayoutRole, LayoutSection, LayoutSectionKind, LayoutSize, LayoutTrackProp } from './layout-language';
|
|
4
|
+
import { LayoutColour, LayoutEnter, LayoutIssue, LayoutIssueCode, LayoutLayerKind, LayoutListMix, LayoutListWho, LayoutPage, LayoutRole, LayoutSection, LayoutSectionKind, LayoutSize, LayoutTrackProp } from './layout-language';
|
|
5
5
|
import { FooterMix, footerMixOfPlan, footerTokenOf } from './footer-mix';
|
|
6
6
|
import { HeaderMix, headerTokenOf, wornHeaderOfPlan } from './header-mix';
|
|
7
7
|
import { PHOTO_LIGHT_LUMINANCE, PhotoTone } from './photo-inventory';
|
|
@@ -57,6 +57,9 @@ export interface LayoutFingerprint {
|
|
|
57
57
|
/** The site's footer (`footerTokenOf`, list ingredients LI5); absent on a fingerprint stored before it. Another site's
|
|
58
58
|
* footer is never worn again: the plan's is mended to the nearest free one (`distinctFooter`). */
|
|
59
59
|
footer?: string;
|
|
60
|
+
/** How the page's text moves by the scroll (AW10, `scrubTokenOf`): `letters`, `scrub` or `letters+scrub`; absent when
|
|
61
|
+
* neither (and on a fingerprint stored before AW10). Recorded and named in the brief, never a refusal yet (T8). */
|
|
62
|
+
scrub?: string;
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
export interface FingerprintedPage {
|
|
@@ -149,11 +152,25 @@ function openingOf(s: LayoutSection | undefined): string {
|
|
|
149
152
|
return lead.size ? `${lead.size}-${lead.kind}` : lead.kind;
|
|
150
153
|
}
|
|
151
154
|
|
|
155
|
+
const SCRUB_TOKEN = 'scrub';
|
|
156
|
+
|
|
157
|
+
/** What of AW10 a page wears (`LayoutFingerprint.scrub`): letters rising, entrances following the scroll, both — or
|
|
158
|
+
* null for neither. */
|
|
159
|
+
export function scrubTokenOf(page: LayoutPage): string | null {
|
|
160
|
+
const layers = (page.sections ?? []).flatMap(s => s.layers ?? []);
|
|
161
|
+
const parts = [
|
|
162
|
+
layers.some(l => l.enter === LayoutEnter.Letters) && LayoutEnter.Letters,
|
|
163
|
+
layers.some(l => l.scrub) && SCRUB_TOKEN,
|
|
164
|
+
].filter((x): x is string => !!x);
|
|
165
|
+
return parts.length ? parts.join('+') : null;
|
|
166
|
+
}
|
|
167
|
+
|
|
152
168
|
/** A page's fingerprint, worn in `preset` and `mode`, under the site's `header` and `footer` when they are known. A photo ground opens on
|
|
153
169
|
* the page's own ground colour. */
|
|
154
170
|
export function fingerprintOf(page: LayoutPage, preset: string, mode: 'light' | 'dark', header?: HeaderMix, footer?: FooterMix): LayoutFingerprint {
|
|
155
171
|
const sections = page.sections ?? [];
|
|
156
172
|
const lists = listTokensOf(page);
|
|
173
|
+
const scrub = scrubTokenOf(page);
|
|
157
174
|
const first = sections[0];
|
|
158
175
|
const ground = String(first?.ground ?? LayoutColour.Ground);
|
|
159
176
|
const name = (Object.values(LayoutColour) as string[]).includes(ground) ? (ground as LayoutColour) : LayoutColour.Ground;
|
|
@@ -168,6 +185,7 @@ export function fingerprintOf(page: LayoutPage, preset: string, mode: 'light' |
|
|
|
168
185
|
...(lists.length ? { lists } : {}),
|
|
169
186
|
...(header ? { header: headerTokenOf(header) } : {}),
|
|
170
187
|
...(footer ? { footer: footerTokenOf(footer) } : {}),
|
|
188
|
+
...(scrub ? { scrub } : {}),
|
|
171
189
|
};
|
|
172
190
|
}
|
|
173
191
|
|
|
@@ -60,6 +60,9 @@ export enum LayoutEnter {
|
|
|
60
60
|
MaskRise = 'maskRise',
|
|
61
61
|
BlurIn = 'blurIn',
|
|
62
62
|
Pop = 'pop',
|
|
63
|
+
/** AW10 (AW10-D1, D12): a line of words rises letter by letter (a text reveal `by: letter`, split in the browser only,
|
|
64
|
+
* put back whole). Offered only when the look's `scrub` is not never; a non-text layer fades instead. */
|
|
65
|
+
Letters = 'letters',
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
export enum LayoutDepth {
|
|
@@ -321,6 +324,10 @@ export interface LayoutLayer {
|
|
|
321
324
|
depth?: `${LayoutDepth}`;
|
|
322
325
|
inner?: number;
|
|
323
326
|
kinetic?: boolean;
|
|
327
|
+
/** AW10 (AW10-D5, D12): its entrance follows the scroll (`scrollProgress`, wholly in at the middle of the screen)
|
|
328
|
+
* instead of playing once — taken by the look's `scrub` (words: a text reveal only; entrances: every entrance), never
|
|
329
|
+
* in the first screen (`checkLayout` mends both). */
|
|
330
|
+
scrub?: boolean;
|
|
324
331
|
motion?: LayoutTrack[];
|
|
325
332
|
/** A redesign (site-redesign RD1): the owner's part this layer places, by its carry handle (`w3`, `p1`,
|
|
326
333
|
* `form:<formId>` — generation-core `harvestPage`) — instead of literal copy. The words, the photo or the form come
|
|
@@ -429,8 +436,12 @@ export enum LayoutMendKind {
|
|
|
429
436
|
Accent = 'accent',
|
|
430
437
|
/** Words too faint on their ground, where the ink holds there: they go back to the ink. */
|
|
431
438
|
Ink = 'ink',
|
|
432
|
-
/** Decoration that enters with a move: it fades instead.
|
|
439
|
+
/** Decoration that enters with a move: it fades instead. Also (AW10) letters on a layer that is no line of words, or on
|
|
440
|
+
* a look that never scrubs. */
|
|
433
441
|
Fade = 'fade',
|
|
442
|
+
/** AW10 (AW10-D8, D12): a layer that follows the scroll where it may not — in the first screen (`scrub-opening`) or on a
|
|
443
|
+
* look whose By the scroll is never or does not take its entrance (`scrub-look`): it plays once instead. */
|
|
444
|
+
Scrub = 'scrub',
|
|
434
445
|
/** Fewer layers glide than the look asks (iox-ui#63): the layers that may glide and do not get a depth, most important
|
|
435
446
|
* first — exactly as many as are missing. */
|
|
436
447
|
Depth = 'depth',
|
|
@@ -464,6 +475,14 @@ export enum LayoutMendKind {
|
|
|
464
475
|
Link = 'link',
|
|
465
476
|
}
|
|
466
477
|
|
|
478
|
+
/** Why a layer's `scrub` is mended (AW10-D12) — the words the build says. */
|
|
479
|
+
export enum LayoutScrubRefusal {
|
|
480
|
+
/** The first screen never scrubs: it is wholly in view at load (AW10-D8); its scroll motion is copy-out. */
|
|
481
|
+
Opening = 'scrub-opening',
|
|
482
|
+
/** The look's By the scroll is never, or takes no entrance of this kind (words: a text reveal only). */
|
|
483
|
+
Look = 'scrub-look',
|
|
484
|
+
}
|
|
485
|
+
|
|
467
486
|
/** Which rule chose a mended gallery's list. */
|
|
468
487
|
export enum LayoutSourceChoice {
|
|
469
488
|
/** The plan has exactly one list with pictures. */
|
|
@@ -503,6 +522,7 @@ export interface LayoutBandMove {
|
|
|
503
522
|
|
|
504
523
|
export type LayoutMend =
|
|
505
524
|
| { kind: LayoutMendKind.Scrim | LayoutMendKind.Ink | LayoutMendKind.Fade; layer: string }
|
|
525
|
+
| { kind: LayoutMendKind.Scrub; layer: string; why: `${LayoutScrubRefusal}` }
|
|
506
526
|
| { kind: LayoutMendKind.Accent; over: number; bands?: ReadonlyArray<LayoutBandMove> }
|
|
507
527
|
| { kind: LayoutMendKind.Depth; layers: ReadonlyArray<string> }
|
|
508
528
|
| { kind: LayoutMendKind.Source; layer: string; source: string; by: `${LayoutSourceChoice}` }
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isScrubId, ScrubId } from '@vectoriox/iox-ui/design-core';
|
|
2
|
+
|
|
1
3
|
import { JsonSchema, jsonClosedObject, jsonInteger, jsonListOf, jsonOneOf, jsonText } from './json-schema';
|
|
2
4
|
import {
|
|
3
5
|
LAYOUT_BEAT_DELAY, LayoutDial, LayoutForm, LayoutGallery, LayoutIssue, LayoutIssueCode, LayoutLayer, LayoutListArrange, LayoutListArrive,
|
|
@@ -67,8 +69,27 @@ export interface LayoutWireOptions {
|
|
|
67
69
|
/** A redesign (site-redesign RD2, H3): THIS page's carry handles (`carryHandles`) — given, every layer carries `carry`,
|
|
68
70
|
* closed to these handles: a model can place only the page's own parts (one property: 38, 40 with lists). */
|
|
69
71
|
carry?: ReadonlyArray<string>;
|
|
72
|
+
/** AW10 (H3): the look's By the scroll (`design.scrub`). Not never, the wire offers `letters` and a layer's `scrub`
|
|
73
|
+
* switch; never or absent, neither (no property is added either way). */
|
|
74
|
+
scrub?: ScrubId | string | null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** AW10: the entrance and the switch a look that never scrubs is not offered. */
|
|
78
|
+
const LETTERS = 'letters';
|
|
79
|
+
const SCRUB_FLAG = 'scrub';
|
|
80
|
+
|
|
81
|
+
/** The entrances the wire offers under the look's scrub (AW10 H3). */
|
|
82
|
+
export function layoutEntersOffered(scrub?: ScrubId | string | null): string[] {
|
|
83
|
+
return ENTER_ON_WIRE.filter(e => e !== LETTERS || scrubOffered(scrub));
|
|
70
84
|
}
|
|
71
85
|
|
|
86
|
+
/** The switches the wire offers under the look's scrub (AW10 H3). */
|
|
87
|
+
export function layoutFlagsOffered(scrub?: ScrubId | string | null): string[] {
|
|
88
|
+
return (V.flags as ReadonlyArray<string>).filter(f => f !== SCRUB_FLAG || scrubOffered(scrub));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const scrubOffered = (scrub?: ScrubId | string | null): boolean => !!scrub && scrub !== ScrubId.Never && isScrubId(scrub);
|
|
92
|
+
|
|
72
93
|
/** A handle the wire places as a whole SECTION (RD-D20): a bound part, a block or a kept section. */
|
|
73
94
|
const SECTION_HANDLE = /^(?:bind|block|keep):/;
|
|
74
95
|
|
|
@@ -146,10 +167,12 @@ export function layoutWireJsonSchema(options: LayoutWireOptions = {}): JsonSchem
|
|
|
146
167
|
rotate: integer("degrees, within the look's limit"),
|
|
147
168
|
to: text("button: a section id of this page or a page route ('/contact'); '' for none"),
|
|
148
169
|
variant: oneOf(VARIANT_ON_WIRE, 'button: primary | secondary | ghost · gallery: its effect · form: its preset · none'),
|
|
149
|
-
enter: oneOf(
|
|
170
|
+
enter: oneOf(layoutEntersOffered(options.scrub), scrubOffered(options.scrub)
|
|
171
|
+
? 'plays once as it arrives (time); clipReveal opens from that side; letters: a line of words rises letter by letter (a display line)'
|
|
172
|
+
: 'plays once as it arrives (time); clipReveal opens from that side'),
|
|
150
173
|
depth: oneOf([NONE, ...V.depths], 'the parallax trio (not in held sections)'),
|
|
151
174
|
inner: integer('0..3: how far a photo drifts inside its frame'),
|
|
152
|
-
flags: listOf(jsonOneOf(
|
|
175
|
+
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`),
|
|
153
176
|
perView: { type: 'number', description: 'gallery slides per view; 0 for none' },
|
|
154
177
|
slots: listOf(closed({ slot: oneOf(SLOT_NAMES, 'which words'), text: text('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"),
|
|
155
178
|
motion: listOf(closed({
|
|
@@ -288,6 +311,7 @@ function expandLayer(l: PlainObject, beat: number): LayoutLayer {
|
|
|
288
311
|
if (flags.has('scrim')) out.scrim = true;
|
|
289
312
|
if (flags.has('kinetic')) out.kinetic = true;
|
|
290
313
|
if (flags.has('contain')) out.fit = 'contain';
|
|
314
|
+
if (flags.has(SCRUB_FLAG)) out.scrub = true;
|
|
291
315
|
const enter = String(l['enter'] ?? NONE);
|
|
292
316
|
if (enter.startsWith(CLIP_SIDE)) {
|
|
293
317
|
out.enter = CLIP;
|
|
@@ -366,6 +390,7 @@ function layerToWire(l: LayoutLayer): LayoutWireLayer {
|
|
|
366
390
|
const flags = [
|
|
367
391
|
l.scrim && 'scrim', l.kinetic && 'kinetic', l.fit === 'contain' && 'contain',
|
|
368
392
|
g?.centered && 'centered', g?.freeMode && 'freeMode', g?.loop && 'loop', g?.drift && 'drift', g?.scroll && 'scroll', g?.autoplay ? 'autoplay' : null,
|
|
393
|
+
l.scrub && SCRUB_FLAG,
|
|
369
394
|
].filter((x): x is string => !!x);
|
|
370
395
|
const slots: LayoutWireSlot[] = f
|
|
371
396
|
? [
|
|
@@ -700,10 +700,13 @@ export const NODE_BASELINES: Readonly<Record<string, NodeBaseline>> = {
|
|
|
700
700
|
"headerBehaviour",
|
|
701
701
|
"headerEdge",
|
|
702
702
|
"headerMix",
|
|
703
|
+
"headerInk",
|
|
703
704
|
"marqueeSpeed",
|
|
704
705
|
"marqueeDirection",
|
|
705
706
|
"marqueeFade",
|
|
706
|
-
"marqueePauseOnHover"
|
|
707
|
+
"marqueePauseOnHover",
|
|
708
|
+
"seam",
|
|
709
|
+
"sectionShape"
|
|
707
710
|
],
|
|
708
711
|
"styleTraits": [
|
|
709
712
|
"position",
|
|
@@ -1886,7 +1889,9 @@ export const NODE_BASELINES: Readonly<Record<string, NodeBaseline>> = {
|
|
|
1886
1889
|
},
|
|
1887
1890
|
"traits": [
|
|
1888
1891
|
"colorScheme",
|
|
1889
|
-
"openingMix"
|
|
1892
|
+
"openingMix",
|
|
1893
|
+
"seam",
|
|
1894
|
+
"sectionShape"
|
|
1890
1895
|
],
|
|
1891
1896
|
"styleTraits": [
|
|
1892
1897
|
"position",
|
|
@@ -2,7 +2,9 @@ import { DesignChoices, elementStyleFace, resolveDesignChoices, textWidthEm } fr
|
|
|
2
2
|
|
|
3
3
|
import { GenerationTier } from './site-plan.model';
|
|
4
4
|
import { PatternNode, PatternPlaceholder, PatternRecipe, SitePattern } from './patterns';
|
|
5
|
+
import { SerializedNode, walkSerialized } from './serialized-node';
|
|
5
6
|
import { SPEC_SITE_LAYOUT } from './site-spec.generated';
|
|
7
|
+
import { copyOutInteraction } from './text-scroll';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* THE OPENING (award-ingredients-plan §3.3, AW8; board award-opening, OB-1…OB-7): a page's first screen is a MIX — its
|
|
@@ -206,6 +208,36 @@ export function stampOpeningMix(root: { props: Record<string, unknown> }, mix: O
|
|
|
206
208
|
root.props = { ...root.props, [OPENING_MIX_PROP]: openingMixValue(mix) };
|
|
207
209
|
}
|
|
208
210
|
|
|
211
|
+
/** The opening parts that hold its words — what copy-out fades (a part that holds a form is never faded: it is used). */
|
|
212
|
+
const WORDS_ROLES: ReadonlySet<string> = new Set([OpeningRole.Words, OpeningRole.Apart, OpeningRole.Aside]);
|
|
213
|
+
const FORM_TYPE = 'Form';
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The opening's own motion as interactions (AW10, AW10-D9): `copy-out` — its words fade as the page leaves it, by the
|
|
217
|
+
* scroll, gone at 0.6 of its exit (`copyOutInteraction`, stamped on the root, opacity only). A re-mix recomposes the root,
|
|
218
|
+
* so a mix without it carries none. Slow zoom and the frame's settle are the shared stylesheet's (by role). Pure on the
|
|
219
|
+
* composed section.
|
|
220
|
+
*/
|
|
221
|
+
export function stampOpeningMotion(root: SerializedNode, mix: OpeningMix): void {
|
|
222
|
+
if (!mix.motion.includes(OpeningMotion.CopyOut)) return;
|
|
223
|
+
const words: string[] = [];
|
|
224
|
+
const holdsForm = (n: SerializedNode): boolean => {
|
|
225
|
+
let found = false;
|
|
226
|
+
walkSerialized(n.children ?? [], c => { if (c.role === OpeningRole.Form || c.type === FORM_TYPE) found = true; });
|
|
227
|
+
return found;
|
|
228
|
+
};
|
|
229
|
+
// The outermost words part that holds no form: a live opening's aside (words + form) gives its words part.
|
|
230
|
+
const visit = (n: SerializedNode): void => {
|
|
231
|
+
if (n.role && WORDS_ROLES.has(n.role) && !holdsForm(n)) {
|
|
232
|
+
words.push(n.id);
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
for (const c of n.children ?? []) visit(c);
|
|
236
|
+
};
|
|
237
|
+
visit(root);
|
|
238
|
+
if (words.length) root.interactions = [...(root.interactions ?? []), copyOutInteraction(root.id, words)];
|
|
239
|
+
}
|
|
240
|
+
|
|
209
241
|
/** The mix an opening root stores, or null — none stored, or words the table no longer knows. */
|
|
210
242
|
export function storedOpeningMix(root: { props?: Record<string, unknown> } | null | undefined): OpeningMix | null {
|
|
211
243
|
const value = root?.props?.[OPENING_MIX_PROP];
|
|
@@ -262,6 +262,7 @@ export const PLAN_WIRE_DERIVED: Readonly<Record<string, string>> = {
|
|
|
262
262
|
'page.layout': 'the layout step: one request per composed page, after the pages (M8 gate 2)',
|
|
263
263
|
'shop.categories': "the products' own categories, in order (shopCategoriesOf)",
|
|
264
264
|
layoutPage: 'the layout step: one request per composed page, after the pages (M8 gate 2)',
|
|
265
|
+
'mixes.body': 'not asked yet: every body word but the defaults waits for AW6 (bodyWireWords); absent = straight edges, free grounds',
|
|
265
266
|
};
|
|
266
267
|
|
|
267
268
|
const wireText = (spec: WireKey): string => {
|
|
@@ -28,6 +28,7 @@ export * from './validate-site-plan';
|
|
|
28
28
|
export * from './compose-site';
|
|
29
29
|
export * from './nav-shape';
|
|
30
30
|
export * from './entrances';
|
|
31
|
+
export * from './text-scroll';
|
|
31
32
|
export * from './plan-data';
|
|
32
33
|
export * from './showcase';
|
|
33
34
|
export * from './site-build-run';
|
|
@@ -66,6 +67,7 @@ export * from './layout-fingerprint';
|
|
|
66
67
|
export * from './header-mix';
|
|
67
68
|
export * from './header-edit';
|
|
68
69
|
export * from './opening-mix';
|
|
70
|
+
export * from './body-mix';
|
|
69
71
|
export * from './opening-edit';
|
|
70
72
|
export * from './footer-mix';
|
|
71
73
|
export * from './layout-edits';
|