@vectoriox/iox-ui 5.163.0 → 5.164.1

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.
@@ -5,7 +5,7 @@ import {
5
5
  } from '@vectoriox/iox-ui/composite-core';
6
6
 
7
7
  import { ColorScheme, DesignChoices, LIST_MIX_PROP, LinkType, scrubOfChoices, setColorScheme, SPEC_AXES } from '@vectoriox/iox-ui/design-core';
8
- import { SCENE_TRACK_EASE, SceneEase, SceneProp, TextRevealBy } from '@vectoriox/iox-ui/scene-core';
8
+ import { SCENE_TRACK_EASE, SceneEase, SceneProp, SceneRange, SceneRevealFrom, TextRevealBy } from '@vectoriox/iox-ui/scene-core';
9
9
  import { FORM_AFTER_SEND_TRAIT, FormAfterSend, FormPresetId } from '@vectoriox/iox-ui/forms-core';
10
10
  import { composeNavHeader, composePresetForm } from './compose-site';
11
11
  import { drawnHeaderMix, headerMixOfNavKind } from './header-mix';
@@ -21,6 +21,8 @@ import {
21
21
  screenFontSize,
22
22
  } from './layout-language';
23
23
  import { layoutGlideDepth } from './layout-drift';
24
+ import { DRAWER_SPINE, drawerRamp, drawerRestX, drawersTiming, drawerSteps, drawerWidth, isDrawers } from './layout-drawers';
25
+ import { LayoutSignatureId, signatureOf } from './layout-fingerprint';
24
26
  import {
25
27
  LAYOUT_BLEED_END_LINE, LAYOUT_BLEED_START_LINE, LAYOUT_INSET, layoutBledBarInset, layoutColumnPx, layoutColumnStart, layoutColumnWord, layoutGapPx,
26
28
  layoutGridColumns, layoutGridLine, layoutGridPx,
@@ -82,6 +84,9 @@ export enum LayoutGapCode {
82
84
  /** AW10: a layer saying `scrub` that the look's By the scroll does not take, or in the first screen — it plays once
83
85
  * (`checkLayout` mends it before; a stored layout is composed as is and said). */
84
86
  Scrub = 'scrub',
87
+ /** AW10: a drawers step's words stand still as the step slides in — their arrival when it lands is AW10's (an entrance
88
+ * played at a key). The layout's entrance on them is dropped. */
89
+ DrawerWords = 'drawer-words',
85
90
  }
86
91
 
87
92
  export interface LayoutGap {
@@ -521,7 +526,46 @@ function depthInteraction(nodeId: string, depth: string): unknown {
521
526
 
522
527
  const TRACK_REST: Readonly<Record<string, number>> = { x: 0, y: 0, scale: 1, rotate: 0, opacity: 1, clip: 100, words: 100 };
523
528
 
524
- interface SceneTrackOut { prop: string; keys: Array<[number, number]>; from?: string; ease?: SceneEase }
529
+ interface SceneTrackOut { prop: string; keys: Array<[number, number]>; from?: string; ease?: SceneEase; range?: SceneRange }
530
+
531
+ /**
532
+ * AW9 gap 4 (award plan "Reddottours" S1, the window that opens): a held picture that opens by its clip opens from a
533
+ * FRAME — 60% showing from the centre, the section's ground around it (theirs: `inset(20%)`) — never from a slit.
534
+ */
535
+ const FRAMED_SHOWING = 60;
536
+ /** …and sinks as the Scene leaves: 30% of the stage over the root's leaving, so the next band rises over it (theirs:
537
+ * `yPercent 30`). Measured over the exit range, after the hold. */
538
+ const WINDOW_SINK: Readonly<SceneTrackOut> = { prop: SceneProp.Y, range: SceneRange.Exit, keys: [[0, 0], [1, 30]] };
539
+ /** Reddottours S3: a walk's picture is over-scaled ×1.2 inside its frame and drifts against the row while it crosses the
540
+ * screen (theirs: `xPercent 0 → 20` over its own crossing). */
541
+ const WALK_DRIFT_SCALE = 0.2;
542
+ /**
543
+ * The drift's reach, a share of the FRAME's width — the frame is the size container (`SceneRole.WalkFrame`), so `cqw` there
544
+ * is the frame's. It moves the picture inside the over-scaled box, so it shows ×(1 + scale): it must stay under the slack a
545
+ * side, `scale / 2 / (1 + scale)` = 8.3%. A share of the stage (cqw of the stage, the col span's share) is NOT a share of
546
+ * the frame — gutters and the content column make a frame narrower than its columns' share, and an edge showed
547
+ * (vectoriox/iox-ui e2e:scenesites §2, 5.164.0: 0.103 of a frame against 0.1).
548
+ */
549
+ const WALK_DRIFT_SHARE = 0.07;
550
+
551
+ /** The framed window: a held picture's opening clip, from the centre and from a frame, never from less. */
552
+ function framedWindow(track: SceneTrackOut): SceneTrackOut {
553
+ const keys = track.keys.map(([at, v], i): [number, number] => [at, i === 0 ? Math.max(FRAMED_SHOWING, v) : v]);
554
+ return { ...track, from: SceneRevealFrom.Centre, keys };
555
+ }
556
+
557
+ /** Does this held layer open the section's window (`photo-unveiled`): a picture whose clip grows to showing it whole? */
558
+ function opensWindow(l: LayoutLayer, lc: LayerCtx): boolean {
559
+ if (l.kind !== LayoutLayerKind.Photo || lc.track > 1 || signatureOf(lc.section) !== LayoutSignatureId.PhotoUnveiled) return false;
560
+ return (l.motion ?? []).some(t => t.prop === LayoutTrackProp.Clip && Number(t.to) >= 100 && Number(t.to) > Number(t.from));
561
+ }
562
+
563
+ /** A walk's picture drifting inside its frame as it crosses the screen: ± its share of the frame's width, in the frame's
564
+ * cqw (the frame is the size container — `SceneRole.WalkFrame`). */
565
+ function walkDrift(): SceneTrackOut {
566
+ const reach = Math.round(WALK_DRIFT_SHARE * 100 * 100) / 100;
567
+ return { prop: SceneProp.X, range: SceneRange.CrossInline, keys: [[0, -reach], [1, reach]] };
568
+ }
525
569
 
526
570
  /** The layout's eases the product's tracks can run (RT-D1); anything else is drawn as the property's own. */
527
571
  const TRACK_EASE: Readonly<Partial<Record<LayoutEase, SceneEase>>> = { [LayoutEase.Linear]: SceneEase.Linear, [LayoutEase.InOut]: SceneEase.Smooth };
@@ -669,7 +713,7 @@ function listLayer(id: string, l: LayoutLayer, ctx: Ctx): SerializedNode {
669
713
  return frame;
670
714
  }
671
715
 
672
- function photoLayer(id: string, l: LayoutLayer, ctx: Ctx, path: string): { frame: SerializedNode; image: SerializedNode } {
716
+ function photoLayer(id: string, l: LayoutLayer, ctx: Ctx, path: string, walking = false): { frame: SerializedNode; image: SerializedNode } {
673
717
  const photoId = l.photo?.id ?? '';
674
718
  const frame = create(id, T.Container, {}, NO_ELEMENT_STYLE);
675
719
  // Its cell gives it both sides (the shape is ignored there); where it stacks, its width and its shape give it a height.
@@ -683,7 +727,8 @@ function photoLayer(id: string, l: LayoutLayer, ctx: Ctx, path: string): { frame
683
727
  // A picture with room to drift is over-scaled inside its frame (M8-G5: the drift itself has no speed of its own). The
684
728
  // scale sits on a box between them: an Image's own size is capped at its frame (vectoriox/iox-ui#8), and its
685
729
  // transform belongs to its entrance (zoomOut).
686
- const k = INNER_SCALE * Math.max(0, Math.min(3, l.inner ?? 0));
730
+ const inner = INNER_SCALE * Math.max(0, Math.min(3, l.inner ?? 0));
731
+ const k = walking ? Math.max(inner, WALK_DRIFT_SCALE) : inner;
687
732
  if (!k) {
688
733
  frame.children = [image];
689
734
  return { frame, image };
@@ -692,7 +737,12 @@ function photoLayer(id: string, l: LayoutLayer, ctx: Ctx, path: string): { frame
692
737
  const scale = String(Math.round((1 + k) * 1000) / 1000);
693
738
  setStyleProps(drift, { width: FULL, height: FULL, scaleX: scale, scaleY: scale });
694
739
  drift.children = [image];
695
- gap(ctx, LayoutGapCode.DepthSpeed, path, `inner ${l.inner}: over-scaled ×${(1 + k).toFixed(2)}, no drift`);
740
+ if (walking) {
741
+ // On a phone the walk is a row the visitor swipes (RT-D4): the picture rests in its frame there.
742
+ frame.role = SceneRole.WalkFrame;
743
+ image.sceneTracks = [walkDrift()];
744
+ image.scenePhoneTracks = restingTracks(image.sceneTracks as SceneTrackOut[]);
745
+ } else gap(ctx, LayoutGapCode.DepthSpeed, path, `inner ${l.inner}: over-scaled ×${(1 + k).toFixed(2)}, no drift`);
696
746
  frame.children = [drift];
697
747
  return { frame, image };
698
748
  }
@@ -1473,7 +1523,7 @@ function composeLayer(l: LayoutLayer, lc: LayerCtx, ctx: Ctx): SerializedNode {
1473
1523
  ctx.keptArrangement.push(part.handle);
1474
1524
  } else switch (l.kind) {
1475
1525
  case LayoutLayerKind.Photo: {
1476
- const made = photoLayer(id, l, ctx, lc.path);
1526
+ const made = photoLayer(id, l, ctx, lc.path, lc.held && lc.track > 1 && l.role !== LayoutRole.Decoration);
1477
1527
  outer = entering = made.frame;
1478
1528
  image = made.image;
1479
1529
  break;
@@ -1500,10 +1550,12 @@ function composeLayer(l: LayoutLayer, lc: LayerCtx, ctx: Ctx): SerializedNode {
1500
1550
  // Held: the layer moves by tracks; a kinetic heading lights word by word as the section is read.
1501
1551
  const tracks: SceneTrackOut[] = [];
1502
1552
  if (lc.held) {
1553
+ const framed = opensWindow(l, lc);
1503
1554
  for (const t of l.motion ?? []) {
1504
1555
  const track = sceneTrackOf(t, l, lc.section.rows, ctx, lc.path);
1505
- if (track) tracks.push(track);
1556
+ if (track) tracks.push(framed && track.prop === SceneProp.Clip ? framedWindow(track) : track);
1506
1557
  }
1558
+ if (framed) tracks.push({ ...WINDOW_SINK, keys: WINDOW_SINK.keys.map(([at, v]): [number, number] => [at, v]) });
1507
1559
  if (l.kinetic && textual) tracks.push({ prop: 'words', keys: [[0, 0], [KINETIC_ALL_LIT, 100]] });
1508
1560
  if (tracks.length) {
1509
1561
  outer.sceneTracks = tracks;
@@ -1520,7 +1572,7 @@ function composeLayer(l: LayoutLayer, lc: LayerCtx, ctx: Ctx): SerializedNode {
1520
1572
  if (!(lc.held && l.kinetic && textual) && !itemsArrive) {
1521
1573
  const enter = enterInteraction(entering.id, l, ctx, lc.path, textual, 1, lc.si === 0);
1522
1574
  if (enter) entering.interactions = [...entering.interactions, enter];
1523
- if (image && l.enter === LayoutEnter.ClipReveal && l.role !== LayoutRole.Decoration) image.interactions = [...image.interactions, zoomInteraction(image.id, l, ctx)];
1575
+ if (image && !image.sceneTracks?.length && l.enter === LayoutEnter.ClipReveal && l.role !== LayoutRole.Decoration) image.interactions = [...image.interactions, zoomInteraction(image.id, l, ctx)];
1524
1576
  }
1525
1577
  const depth = layoutGlideDepth(lc.section, l);
1526
1578
  if (depth) {
@@ -1583,6 +1635,7 @@ function composeSection(s: LayoutSection, si: number, prevGround: string | null,
1583
1635
  const track = Math.max(1, s.track ?? 1);
1584
1636
  const ground = String(s.ground ?? LayoutColour.Ground);
1585
1637
  ctx.sections[s.id] = id;
1638
+ if (isDrawers(s)) return composeDrawers(s, si, ctx);
1586
1639
  if (track > 1 && !held) gap(ctx, LayoutGapCode.UnheldMotion, `sections[${si}]`, 'a sideways section that is not held cannot travel');
1587
1640
 
1588
1641
  const order = Array.isArray(s.phone) && s.phone.length ? s.phone : s.layers.map((_, i) => i);
@@ -1649,11 +1702,12 @@ function composeSection(s: LayoutSection, si: number, prevGround: string | null,
1649
1702
  phone(root, { height: 'auto' });
1650
1703
  const wide = create(`${id}-track`, T.Container, {}, NO_ELEMENT_STYLE);
1651
1704
  wide.label = `${s.id} · ${track} screens wide`;
1705
+ wide.role = SceneRole.Walk;
1652
1706
  setStyleProps(wide, { ...gridLayout(s.rows, track), width: `${track * 100}%`, height: FULL, minHeight: ZERO });
1653
- phone(wide, { width: FULL, ...phoneStack(si === 0) });
1707
+ phone(wide, walkSwipe(si === 0));
1654
1708
  wide.sceneTracks = [{ prop: 'x', keys: [[0, 0], [1, -(track - 1) * 100]] }];
1655
1709
  wide.scenePhoneTracks = [{ prop: 'x', keys: [[0, 0]] }];
1656
- wide.children = layers;
1710
+ wide.children = walkScreens(s, layers, track, id);
1657
1711
  stage.children = [wide];
1658
1712
  }
1659
1713
  if (transition) {
@@ -1667,6 +1721,161 @@ function composeSection(s: LayoutSection, si: number, prevGround: string | null,
1667
1721
  return root;
1668
1722
  }
1669
1723
 
1724
+ // ── The sideways walk on a phone (AW9, RT-D4) ───────────────────────────────────────────────────────────
1725
+
1726
+ /** A walk card's share of the phone's width: the next one peeks, so the row says it swipes. */
1727
+ const WALK_CARD_SHARE = '85%';
1728
+ const WALK_CARD_GAP = '16px';
1729
+
1730
+ /** The wide row on a phone: a row the visitor swipes, one screen of the walk to a card (`phoneWalk.swipe`) — never a
1731
+ * stack, which turned a walk into a long plain column (award plan "Reddottours" S3: theirs swaps to a card carousel). The
1732
+ * snapping is shared CSS (`.iox-role-scene-walk`): a node has no style for it. */
1733
+ function walkSwipe(first: boolean): Record<string, string> {
1734
+ return {
1735
+ width: FULL,
1736
+ height: 'auto',
1737
+ display: 'flex',
1738
+ flexDirection: 'row',
1739
+ alignItems: 'stretch',
1740
+ overflow: 'auto',
1741
+ gap: WALK_CARD_GAP,
1742
+ padding: `${first ? PHONE_FIRST_TOP : LAYOUT_PHONE_PADDING} ${LAYOUT_INSET} ${LAYOUT_PHONE_PADDING} ${LAYOUT_INSET}`,
1743
+ };
1744
+ }
1745
+
1746
+ /** The screen of a walk a layer stands on (from its first column). */
1747
+ const walkScreenOf = (l: LayoutLayer, track: number): number => Math.max(0, Math.min(track - 1, Math.floor((l.col[0] - 1) / GRID_COLUMNS)));
1748
+
1749
+ /**
1750
+ * A walk's layers, one holder per screen they stand on. On the wide layout a holder draws no box (`display: contents`), so
1751
+ * every layer keeps its place on the wide grid and its own crossing; on a phone it is a card of the swiped row, its
1752
+ * layers in the section's phone order. A screen with no layer gets no card.
1753
+ */
1754
+ function walkScreens(s: LayoutSection, layers: SerializedNode[], track: number, id: string): SerializedNode[] {
1755
+ const by = new Map<number, SerializedNode[]>();
1756
+ s.layers.forEach((l, li) => {
1757
+ const at = walkScreenOf(l, track);
1758
+ by.set(at, [...(by.get(at) ?? []), layers[li]]);
1759
+ });
1760
+ return [...by.keys()].sort((a, b) => a - b).map(at => {
1761
+ const card = create(`${id}-w${at}`, T.Container, {}, NO_ELEMENT_STYLE);
1762
+ card.role = SceneRole.WalkScreen;
1763
+ card.label = `${s.id} · screen ${at + 1}`;
1764
+ setStyleProps(card, { display: 'contents' });
1765
+ phone(card, { display: 'flex', flexDirection: 'column', flexGrow: '0', flexShrink: '0', flexBasis: WALK_CARD_SHARE, minWidth: ZERO, gap: ZERO });
1766
+ card.children = by.get(at) ?? [];
1767
+ return card;
1768
+ });
1769
+ }
1770
+
1771
+ // ── Drawers (AW9) ───────────────────────────────────────────────────────────────────────────────────────
1772
+
1773
+ /** The longest heading a spine stands on end whole; a longer one is cut at a word with an ellipsis. */
1774
+ const SPINE_MAX_LETTERS = 40;
1775
+ const SPINE_PADDING = '24px';
1776
+
1777
+ /** A spine's words: the step's number and its heading, cut to what stands on the stage's height. */
1778
+ function spineWords(i: number, heading: string | undefined): string {
1779
+ const number = String(i + 1).padStart(2, '0');
1780
+ const words = (heading ?? '').replace(/\s+/g, ' ').trim();
1781
+ if (!words) return number;
1782
+ if (words.length <= SPINE_MAX_LETTERS) return `${number} · ${words}`;
1783
+ const cut = words.slice(0, SPINE_MAX_LETTERS);
1784
+ const at = cut.lastIndexOf(' ');
1785
+ return `${number} · ${(at > SPINE_MAX_LETTERS / 2 ? cut.slice(0, at) : cut).trim()}…`;
1786
+ }
1787
+
1788
+ /** A drawer's ground: its scheme's section fill — the page's own ground on Default, whose section fill is transparent and
1789
+ * would show the step under it. */
1790
+ const drawerPaint = (scheme: ColorScheme): string => scheme === ColorScheme.Default ? 'var(--iox-bg)' : 'var(--iox-section-bg)';
1791
+
1792
+ /**
1793
+ * AW9 `drawers` (award plan "Reddottours" S4): a held section whose steps slide in from the inline end, one after another,
1794
+ * straight with the scroll (RT-D1), each stopping one spine after the step before — the stack builds a row of titled
1795
+ * spines — while their grounds deepen through the look's schemes to the brand (`drawerRamp`, AA-gated as schemes are).
1796
+ * A step is a panel on the stage: its spine (number and heading, decorative — the step's heading is read) and its body
1797
+ * (the step's layers on the section's grid, still). On a phone it stacks, each spine a label above its step. A step's
1798
+ * words arriving as it lands is AW10 (an entrance at a key): the layout's entrances on them are dropped and said.
1799
+ */
1800
+ function composeDrawers(s: LayoutSection, si: number, ctx: Ctx): SerializedNode {
1801
+ const id = `${ctx.p}-s${si}`;
1802
+ const steps = drawerSteps(s.layers);
1803
+ const n = steps.length;
1804
+ const timing = drawersTiming(n);
1805
+ // Outside 3–5 `checkLayout` refuses it; a stored layout is composed as is, the ramp's deepest schemes last.
1806
+ const ramp = drawerRamp(Math.max(3, Math.min(5, n))) ?? [ColorScheme.Accent];
1807
+ const schemeOf = (i: number): ColorScheme => ramp[Math.max(0, Math.min(ramp.length - 1, ramp.length - n + i))];
1808
+ const side = ctx.rtl ? 'right' : 'left';
1809
+
1810
+ const root = create(id, T.Section, {}, NO_ELEMENT_STYLE);
1811
+ root.role = SceneRole.Scene;
1812
+ root.label = `${s.id} · drawers`;
1813
+ setStyleProps(root, {
1814
+ position: 'relative', width: FULL, minHeight: ZERO, height: `${timing.screens * 100}svh`, display: 'block', padding: ZERO, margin: ZERO,
1815
+ backgroundColor: groundPaint(String(s.ground ?? LayoutColour.Ground)), color: 'var(--iox-text)', ...(ctx.rtl ? { textDirection: 'rtl' } : {}),
1816
+ });
1817
+ phone(root, { height: 'auto' });
1818
+ const stage = create(`${id}-stage`, T.Container, {}, NO_ELEMENT_STYLE);
1819
+ stage.role = SceneRole.Stage;
1820
+ stage.label = `${s.id} · stage`;
1821
+ setStyleProps(stage, { position: 'sticky', top: ZERO, width: FULL, height: '100svh', minHeight: ZERO, overflow: 'hidden', zIndex: '1', display: 'block' });
1822
+ phone(stage, { display: 'contents' });
1823
+
1824
+ stage.children = steps.map((indices, i) => {
1825
+ const scheme = schemeOf(i);
1826
+ const panel = create(`${id}-d${i}`, T.Container, {}, NO_ELEMENT_STYLE);
1827
+ panel.role = SceneRole.Drawer;
1828
+ panel.label = `${s.id} · step ${i + 1}`;
1829
+ setColorScheme(panel, scheme);
1830
+ setStyleProps(panel, {
1831
+ position: 'absolute', top: ZERO, [side]: ZERO, width: i ? `${drawerWidth(n)}%` : FULL, height: FULL, minHeight: ZERO,
1832
+ display: 'flex', flexDirection: 'row', backgroundColor: drawerPaint(scheme), color: 'var(--iox-text)', zIndex: String(i + 1), overflow: 'hidden',
1833
+ });
1834
+ phone(panel, { position: 'relative', top: 'auto', [side]: 'auto', width: FULL, height: 'auto', flexDirection: 'column' });
1835
+ const slide = timing.windows[i];
1836
+ if (slide) {
1837
+ // Waits off the stage at its inline end, slides in over its screen, rests a spine past the one before.
1838
+ panel.sceneTracks = [{ prop: SceneProp.X, keys: [[0, 100], [slide[0], 100], [slide[1], drawerRestX(i)]] }];
1839
+ panel.scenePhoneTracks = [{ prop: SceneProp.X, keys: [[0, 0]] }];
1840
+ }
1841
+
1842
+ const spine = create(`${id}-d${i}-spine`, T.Container, {}, NO_ELEMENT_STYLE);
1843
+ spine.role = SceneRole.DrawerSpine;
1844
+ setStyleProps(spine, {
1845
+ width: `${DRAWER_SPINE}cqw`, flexShrink: '0', height: FULL, minHeight: ZERO, display: 'flex', alignItems: 'center', justifyContent: 'center',
1846
+ padding: `${SPINE_PADDING} ${ZERO}`, overflow: 'hidden',
1847
+ });
1848
+ phone(spine, {
1849
+ width: FULL, height: 'auto', justifyContent: 'flex-start',
1850
+ padding: `${i === 0 && si === 0 ? PHONE_FIRST_TOP : LAYOUT_PHONE_PADDING} ${LAYOUT_INSET} ${ZERO} ${LAYOUT_INSET}`,
1851
+ });
1852
+ const head = s.layers[indices[0]];
1853
+ const title = create(`${id}-d${i}-spine-t`, T.Text, { content: spineWords(i, head?.kind === LayoutLayerKind.Heading ? head.text : undefined), tag: 'span' }, 'eyebrow');
1854
+ setStyleProps(title, { color: 'inherit', margin: ZERO });
1855
+ spine.children = [title];
1856
+
1857
+ const body = create(`${id}-d${i}-body`, T.Container, {}, NO_ELEMENT_STYLE);
1858
+ setStyleProps(body, { position: 'relative', flexGrow: '1', minWidth: ZERO, height: FULL, minHeight: ZERO, ...gridLayout(s.rows, 1) });
1859
+ phone(body, { ...phoneStack(false), padding: `${SPINE_PADDING} ${LAYOUT_INSET} ${LAYOUT_PHONE_PADDING} ${LAYOUT_INSET}` });
1860
+ const phoneAlign = indices.every(li => s.layers[li].align === 'center') ? 'center' : 'start';
1861
+ body.children = indices.map((li, at) => {
1862
+ const l = s.layers[li];
1863
+ if (l.enter && l.enter !== LayoutEnter.None) gap(ctx, LayoutGapCode.DrawerWords, `sections[${si}].layers[${li}]`, 'stands still as its step slides in (arriving on landing is AW10)');
1864
+ const still: LayoutLayer = { ...l, enter: LayoutEnter.None, motion: undefined, kinetic: undefined, depth: undefined, scrub: undefined };
1865
+ const prev = at > 0 ? s.layers[indices[at - 1]] : null;
1866
+ const lc: LayerCtx = {
1867
+ section: s, si, li, path: `sections[${si}].layers[${li}]`, held: true, track: 1,
1868
+ order: at, phoneGap: phoneGapBefore(prev, l), phoneAlign,
1869
+ };
1870
+ return composeLayer(still, lc, ctx);
1871
+ });
1872
+ panel.children = [spine, body];
1873
+ return panel;
1874
+ });
1875
+ root.children = [stage];
1876
+ return root;
1877
+ }
1878
+
1670
1879
  // ── The header ──────────────────────────────────────────────────────────────────────────────────────────
1671
1880
 
1672
1881
  const NAV_ROUTE = '/';
@@ -1501,6 +1501,8 @@ const cloneTrack = (track: PatternTrack): Record<string, unknown> => ({
1501
1501
  prop: track.prop,
1502
1502
  keys: track.keys.map(([at, value]) => [at, value]),
1503
1503
  ...(track.from ? { from: track.from } : {}),
1504
+ ...(track.ease ? { ease: track.ease } : {}),
1505
+ ...(track.range ? { range: track.range } : {}),
1504
1506
  });
1505
1507
 
1506
1508
  interface SectionMotion {
@@ -0,0 +1,106 @@
1
+ import { ColorScheme } from '@vectoriox/iox-ui/design-core';
2
+
3
+ import { LayoutLayer, LayoutLayerKind, LayoutSection, LayoutSectionKind } from './layout-language';
4
+ import { GenerationTier } from './site-plan.model';
5
+ import { SPEC_SITE_LAYOUT } from './site-spec.generated';
6
+
7
+ /**
8
+ * AW9 `drawers` (award plan "Reddottours" S4, RT-D1): a held section whose STEPS slide in from the inline end, one after
9
+ * the other, linearly with the scroll, and stop one spine after the step before — so the stack builds a row of titled
10
+ * spines — while their grounds deepen through the look's schemes to the brand. Pure: what a drawers section is, how long
11
+ * it holds and when each step moves; `composeLayout` stamps it and `checkLayout` holds it. The words arriving as a step
12
+ * lands is AW10, not here.
13
+ */
14
+
15
+ const D = SPEC_SITE_LAYOUT.drawers;
16
+ /** How many steps a drawers section holds (one heading each): fewer or more is refused. */
17
+ export const DRAWER_STEPS: readonly [number, number] = [SPEC_SITE_LAYOUT.limits.drawerSteps[0], SPEC_SITE_LAYOUT.limits.drawerSteps[1]];
18
+ /** A spine's width, in % of the stage's width (cqw). */
19
+ export const DRAWER_SPINE: number = D.spine;
20
+
21
+ /** The kinds a step may hold: words and buttons — a step is the owner's words, never a picture (the award plan: "it needs
22
+ * no photos"). */
23
+ export const DRAWER_KINDS: ReadonlySet<string> = new Set([
24
+ LayoutLayerKind.Heading, LayoutLayerKind.Word, LayoutLayerKind.Text, LayoutLayerKind.Label, LayoutLayerKind.Number,
25
+ LayoutLayerKind.List, LayoutLayerKind.Button,
26
+ ]);
27
+
28
+ /** Is this section the drawers signature? */
29
+ export const isDrawers = (s: Pick<LayoutSection, 'kind'> | null | undefined): boolean => s?.kind === LayoutSectionKind.Drawers;
30
+
31
+ /**
32
+ * A drawers section's steps, as indices into its layers: each heading starts a step and holds the layers written after it,
33
+ * up to the next heading. Layers written before the first heading belong to the first step.
34
+ */
35
+ export function drawerSteps(layers: ReadonlyArray<Pick<LayoutLayer, 'kind'>>): number[][] {
36
+ const steps: number[][] = [];
37
+ layers.forEach((l, i) => {
38
+ if (l.kind === LayoutLayerKind.Heading || !steps.length) steps.push([i]);
39
+ else steps[steps.length - 1].push(i);
40
+ });
41
+ // A first step opened by a non-heading and followed by a heading: the heading opened a step of its own above; the
42
+ // words before it are its own step only when there was no heading at all.
43
+ if (steps.length > 1 && layers[steps[0][0]]?.kind !== LayoutLayerKind.Heading) {
44
+ const [lead, next, ...rest] = steps;
45
+ return [[...lead, ...next], ...rest];
46
+ }
47
+ return steps;
48
+ }
49
+
50
+ /** How many steps a drawers section holds: its headings (at least one step when it has any layer). */
51
+ export function drawerStepCount(layers: ReadonlyArray<Pick<LayoutLayer, 'kind'>>): number {
52
+ return drawerSteps(layers).length;
53
+ }
54
+
55
+ export interface DrawersTiming {
56
+ /** Screens of scroll the stage holds. */
57
+ hold: number;
58
+ /** The root's height, in screens (the hold and the stage). */
59
+ screens: number;
60
+ /** Each step's slide, as `[start, end]` of the hold's progress (0–1); the first step's is null — it is there from the start. */
61
+ windows: Array<[number, number] | null>;
62
+ }
63
+
64
+ const round = (v: number): number => Math.round(v * 10000) / 10000;
65
+
66
+ /** How long `n` steps hold and when each slides: a rest, one slide per step after the first, a rest (theirs: ½ · 1 · ½). */
67
+ export function drawersTiming(n: number): DrawersTiming {
68
+ const count = Math.max(1, Math.round(n));
69
+ const hold = D.rest * 2 + D.slide * (count - 1);
70
+ const windows = Array.from({ length: count }, (_, i): [number, number] | null => {
71
+ if (i === 0 || hold <= 0) return null;
72
+ const start = D.rest + D.slide * (i - 1);
73
+ return [round(start / hold), round((start + D.slide) / hold)];
74
+ });
75
+ return { hold, screens: hold + 1, windows };
76
+ }
77
+
78
+ /** Where step `i` of `n` rests once landed, in % of the stage's width from the inline start: one spine per step before it. */
79
+ export const drawerRestX = (i: number): number => round(i * DRAWER_SPINE);
80
+
81
+ /** A step's width: the stage less the spines of every step after the first. */
82
+ export const drawerWidth = (n: number): number => round(100 - (Math.max(1, n) - 1) * DRAWER_SPINE);
83
+
84
+ /** The schemes `n` steps wear, first to last — the look's own, deepening to the brand. Null outside the steps allowed. */
85
+ export function drawerRamp(n: number): ColorScheme[] | null {
86
+ const ramp = (D.ramp as Readonly<Record<string, ReadonlyArray<string>>>)[String(n)];
87
+ return ramp ? ramp.map(id => id as ColorScheme) : null;
88
+ }
89
+
90
+ /** A signature of the contract offered to a build at `tier`: a `pro` row to the award tier alone (AW-D23). */
91
+ export function layoutSignatureOffered(id: string, tier: `${GenerationTier}` | string | null | undefined): boolean {
92
+ const row = SPEC_SITE_LAYOUT.signatures.find(s => s.id === id);
93
+ return !!row && (row.tier !== 'pro' || tier === GenerationTier.Award);
94
+ }
95
+
96
+ /** The section kinds the layout wire offers a build at `tier`: content · inhale · signature, and a signature kind
97
+ * (`drawers`) only where its signature is offered. */
98
+ export function layoutSectionKindsOffered(tier: `${GenerationTier}` | string | null | undefined): string[] {
99
+ return (SPEC_SITE_LAYOUT.vocab.sectionKinds as ReadonlyArray<string>)
100
+ .filter(k => !SPEC_SITE_LAYOUT.signatures.some(s => s.id === k) || layoutSignatureOffered(k, tier));
101
+ }
102
+
103
+ /** The signatures a build at `tier` may be told of (the layout prompt's list). */
104
+ export function layoutSignaturesOffered(tier: `${GenerationTier}` | string | null | undefined): Array<{ id: string; label: string; how: string }> {
105
+ return SPEC_SITE_LAYOUT.signatures.filter(s => layoutSignatureOffered(s.id, tier)).map(s => ({ id: s.id, label: s.label, how: s.how }));
106
+ }
@@ -39,6 +39,8 @@ export enum LayoutSignatureId {
39
39
  HalvesApart = 'halves-apart',
40
40
  SidewaysWalk = 'sideways-walk',
41
41
  ObjectTurning = 'object-turning',
42
+ /** AW9: steps sliding in from the end and stacking by their spines (the award tier's). */
43
+ Drawers = 'drawers',
42
44
  HeldScreen = 'held-screen',
43
45
  }
44
46
 
@@ -133,6 +135,7 @@ const SIGNATURE_BY_TRACK: ReadonlyArray<[LayoutTrackProp, LayoutSignatureId]> =
133
135
 
134
136
  export function signatureOf(s: LayoutSection | undefined): LayoutSignatureId {
135
137
  if (!s) return LayoutSignatureId.HeldScreen;
138
+ if (s.kind === LayoutSectionKind.Drawers) return LayoutSignatureId.Drawers;
136
139
  const layers = s.layers ?? [];
137
140
  if (layers.some(l => l.kinetic)) return LayoutSignatureId.WordsLit;
138
141
  if (layers.some(l => l.gallery?.scroll)) return LayoutSignatureId.ScrollReel;
@@ -143,6 +143,10 @@ export const LAYOUT_PHOTO_ASPECT: Readonly<Record<LayoutPhotoShape, string>> = {
143
143
  export enum LayoutSectionKind {
144
144
  Content = 'content',
145
145
  Inhale = 'inhale',
146
+ /** AW9 (award plan "Reddottours" S4): the drawers signature — a held section whose steps (a heading each, then its words
147
+ * and buttons) slide in from the inline end and stack, each keeping its titled spine. Award tier only; it is the page's
148
+ * signature (`signature: true`), its length is its steps' (`drawersOf`). */
149
+ Drawers = 'drawers',
146
150
  }
147
151
 
148
152
  export enum LayoutButtonVariant {
@@ -100,9 +100,10 @@ export function layoutShapeHasPurpose(s: LayoutSection, li: number): boolean {
100
100
  return !!l.motion?.length || (!!l.depth && l.depth !== LayoutDepth.Mid);
101
101
  }
102
102
 
103
- /** A held section where nothing moves by the scroll: no track, no kinetic line, no gallery the scroll turns. */
103
+ /** A held section where nothing moves by the scroll: no track, no kinetic line, no gallery the scroll turns. Drawers
104
+ * (AW9) are never still: their steps slide. */
104
105
  export function layoutHeldStill(s: LayoutSection): boolean {
105
- if (!s.pin || (s.track ?? 1) > 1 || s.readyMade || s.carry) return false;
106
+ if (!s.pin || (s.track ?? 1) > 1 || s.readyMade || s.carry || s.kind === LayoutSectionKind.Drawers) return false;
106
107
  return !(s.layers ?? []).some(l => !!l.motion?.length || !!l.kinetic || (l.kind === LayoutLayerKind.Gallery && !!l.gallery?.scroll));
107
108
  }
108
109
 
@@ -3,8 +3,9 @@ import { columnWordOf, isScrubId, ScrubId, SPEC_AXES } from '@vectoriox/iox-ui/d
3
3
  import { JsonSchema, jsonClosedObject, jsonInteger, jsonListOf, jsonOneOf, jsonText } from './json-schema';
4
4
  import {
5
5
  LAYOUT_BEAT_DELAY, LayoutDial, LayoutForm, LayoutGallery, LayoutIssue, LayoutIssueCode, LayoutLayer, LayoutListArrange, LayoutListArrive,
6
- LayoutListHow, LayoutListItem, LayoutListMix, LayoutListPhone, LayoutListWho, LayoutPage, LayoutSection, LayoutTrack,
6
+ LayoutListHow, LayoutListItem, LayoutListMix, LayoutListPhone, LayoutListWho, LayoutPage, LayoutSection, LayoutSectionKind, LayoutTrack,
7
7
  } from './layout-language';
8
+ import { DRAWER_STEPS, layoutSectionKindsOffered } from './layout-drawers';
8
9
  import { isPlainObject, PlainObject } from './shape-check';
9
10
  import { LIST_INGREDIENTS, LIST_TABLE, listBuiltWords, listIngredientWords, listWordOffered, listWordRefusal } from './list-table';
10
11
  import { SPEC_SITE_LAYOUT } from './site-spec.generated';
@@ -24,6 +25,8 @@ const GALLERY_EFFECTS: ReadonlyArray<string> = V.galleryEffects;
24
25
  const FORM_PRESETS: ReadonlyArray<string> = V.formPresets;
25
26
  const BUTTON_VARIANTS: ReadonlyArray<string> = V.buttonVariants;
26
27
  const NONE = 'none';
28
+ /** AW9: the section kind that is the drawers signature. */
29
+ const DRAWERS = LayoutSectionKind.Drawers as string;
27
30
  const CLIP = 'clipReveal';
28
31
  const CLIP_SIDE = `${CLIP}-`;
29
32
  /** A gallery the wire marks `autoplay` turns every 5 s — what the proof sites' autoplaying galleries do. */
@@ -227,7 +230,9 @@ export function layoutWireJsonSchema(options: LayoutWireOptions = {}): JsonSchem
227
230
  });
228
231
  const section = closed({
229
232
  id: text('a short slug, unique on the page'),
230
- kind: oneOf(V.sectionKinds, 'content · inhale (a breath: ≤ 2 small layers, no photo) · signature (exactly ONE)'),
233
+ kind: oneOf(layoutSectionKindsOffered(options.tier), layoutSectionKindsOffered(options.tier).includes(DRAWERS)
234
+ ? `content · inhale (a breath: ≤ 2 small layers, no photo) · signature (exactly ONE) · drawers (the signature as ${DRAWER_STEPS[0]}–${DRAWER_STEPS[1]} steps sliding in and stacking: each step a heading, then its words and buttons; held, no photos)`
235
+ : 'content · inhale (a breath: ≤ 2 small layers, no photo) · signature (exactly ONE)'),
231
236
  screens: integer('1..5 screen heights'),
232
237
  hold: integer('0 flows · 1 held (the page stops while its layers move) · 2..4 held and carried sideways that many screens'),
233
238
  ground: text("a colour name, or photo:<id>"),
@@ -420,6 +425,13 @@ function expandSection(s: PlainObject): LayoutSection {
420
425
  if (kind === 'signature') out.signature = true;
421
426
  if (hold >= 1) out.pin = true;
422
427
  if (hold >= 2) out.track = hold;
428
+ // AW9: drawers IS the page's signature, and held — its steps say how long; it never walks sideways.
429
+ if (kind === DRAWERS) {
430
+ out.kind = LayoutSectionKind.Drawers;
431
+ out.signature = true;
432
+ out.pin = true;
433
+ delete out.track;
434
+ }
423
435
  return out;
424
436
  }
425
437
 
@@ -504,7 +516,7 @@ export function layoutToWire(page: Pick<LayoutPage, 'sections'> & Partial<Pick<L
504
516
  ...(columnWordOf(page.column) ? { column: page.column } : {}),
505
517
  sections: page.sections.map(s => (s.carry ? carryPlaceToWire(s) : {
506
518
  id: s.id,
507
- kind: s.signature ? 'signature' : s.kind ?? 'content',
519
+ kind: s.kind === LayoutSectionKind.Drawers ? DRAWERS : s.signature ? 'signature' : s.kind ?? 'content',
508
520
  screens: s.screens,
509
521
  hold: s.pin ? s.track ?? 1 : 0,
510
522
  ground: s.ground ?? 'ground',
@@ -113,6 +113,10 @@ export interface PatternTrack {
113
113
  readonly prop: string;
114
114
  readonly keys: ReadonlyArray<readonly [number, number | string]>;
115
115
  readonly from?: string;
116
+ /** How it runs between keys when not its property's own (`linear` · `smooth`, AW9 RT-D1). */
117
+ readonly ease?: string;
118
+ /** What its progress is measured over when not the hold (`exit` · `cross-inline` · `cross-block`, AW9). */
119
+ readonly range?: string;
116
120
  }
117
121
 
118
122
 
@@ -606,6 +606,20 @@ export const SPEC_SITE_PATTERNS = {
606
606
  100
607
607
  ]
608
608
  ]
609
+ },
610
+ {
611
+ "prop": "y",
612
+ "range": "exit",
613
+ "keys": [
614
+ [
615
+ 0,
616
+ 0
617
+ ],
618
+ [
619
+ 1,
620
+ 30
621
+ ]
622
+ ]
609
623
  }
610
624
  ]
611
625
  },
@@ -6894,7 +6908,8 @@ export const SPEC_SITE_LAYOUT = {
6894
6908
  "sectionKinds": [
6895
6909
  "content",
6896
6910
  "inhale",
6897
- "signature"
6911
+ "signature",
6912
+ "drawers"
6898
6913
  ],
6899
6914
  "buttonVariants": [
6900
6915
  "primary",
@@ -7047,7 +7062,11 @@ export const SPEC_SITE_LAYOUT = {
7047
7062
  "voidScreen": 0.6,
7048
7063
  "bandColumns": 10,
7049
7064
  "composedPages": 2,
7050
- "repairs": 1
7065
+ "repairs": 1,
7066
+ "drawerSteps": [
7067
+ 3,
7068
+ 5
7069
+ ]
7051
7070
  },
7052
7071
  "sameness": {
7053
7072
  "sequence": 0.8,
@@ -7074,7 +7093,7 @@ export const SPEC_SITE_LAYOUT = {
7074
7093
  {
7075
7094
  "id": "photo-unveiled",
7076
7095
  "label": "a photo unveiled",
7077
- "how": "a clip track opening a photo from a slit to the full screen",
7096
+ "how": "a clip track opening a photo to the full screen — drawn from a framed 60% with the ground around it, sinking as the next band rises (AW9)",
7078
7097
  "tier": "all"
7079
7098
  },
7080
7099
  {
@@ -7113,6 +7132,12 @@ export const SPEC_SITE_LAYOUT = {
7113
7132
  "how": "rotate + opacity tracks while its words change",
7114
7133
  "tier": "all"
7115
7134
  },
7135
+ {
7136
+ "id": "drawers",
7137
+ "label": "drawers",
7138
+ "how": "a held section whose 3–5 steps (one heading each, words and buttons only) slide in from the end and stack, each keeping its titled spine, the grounds deepening to the brand",
7139
+ "tier": "pro"
7140
+ },
7116
7141
  {
7117
7142
  "id": "held-screen",
7118
7143
  "label": "a held screen",
@@ -11664,8 +11689,10 @@ export const SPEC_SITE_LAYOUT = {
11664
11689
  "where": "an entrance plays once (viewportEnter, once), or by the scroll (AW10: scrollProgress, until 0.5)"
11665
11690
  },
11666
11691
  "phoneWalk": {
11667
- "built": [],
11668
- "where": "a sideways walk on a phone plays as on a laptop, degraded by scrollPlayFor"
11692
+ "built": [
11693
+ "swipe"
11694
+ ],
11695
+ "where": "generation-core composeLayout (AW9, RT-D4): on a phone a sideways walk is a row you swipe, one screen of it per card — every tier"
11669
11696
  },
11670
11697
  "phoneBar": {
11671
11698
  "built": [
@@ -11806,5 +11833,30 @@ export const SPEC_SITE_LAYOUT = {
11806
11833
  "meaning": "an out-of-season card with notify me"
11807
11834
  }
11808
11835
  ]
11836
+ },
11837
+ "drawers": {
11838
+ "spine": 4.5,
11839
+ "slide": 1,
11840
+ "rest": 0.5,
11841
+ "ramp": {
11842
+ "3": [
11843
+ "subtle",
11844
+ "muted",
11845
+ "accent"
11846
+ ],
11847
+ "4": [
11848
+ "default",
11849
+ "subtle",
11850
+ "muted",
11851
+ "accent"
11852
+ ],
11853
+ "5": [
11854
+ "default",
11855
+ "subtle",
11856
+ "muted",
11857
+ "inverse",
11858
+ "accent"
11859
+ ]
11860
+ }
11809
11861
  }
11810
11862
  } as const;