@vectoriox/iox-ui 5.69.0 → 5.70.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.
@@ -0,0 +1,472 @@
1
+ import { SceneRole, makeCompositePart, NO_ELEMENT_STYLE, writeLayerStyles, writeStyles } from '@vectoriox/iox-ui/composite-core';
2
+
3
+ /**
4
+ * A Scene's data and maths (premium-sites plan §5b). A Scene is a recipe of ordinary nodes — a tall Section, a pinned
5
+ * stage inside it, ordinary nodes as layers — so every word stays real, bound and translatable, and all three render
6
+ * paths already draw it. What moves a layer is its OWN `sceneTracks`, never a list on the root naming layer ids: a clone
7
+ * copies them with the layer, a delete takes them with it, and there is no id to remap.
8
+ *
9
+ * The vocabulary is closed. Every property is one the compositor can run without layout (CLS stays 0): a saved value
10
+ * outside it is dropped when read, so a page document can never write CSS through a track.
11
+ */
12
+ var SceneProp;
13
+ (function (SceneProp) {
14
+ /** Along the inline axis, in % of the stage's width. Positive runs toward the inline END (mirrored in RTL). */
15
+ SceneProp["X"] = "x";
16
+ /** Down, in % of the stage's height. */
17
+ SceneProp["Y"] = "y";
18
+ SceneProp["Scale"] = "scale";
19
+ /** Degrees. */
20
+ SceneProp["Rotate"] = "rotate";
21
+ /** 0–1. */
22
+ SceneProp["Opacity"] = "opacity";
23
+ /** Inset from every side, in % of the layer (0 = whole, 50 = gone). */
24
+ SceneProp["Clip"] = "clip";
25
+ /** The layer's background colour. */
26
+ SceneProp["Ground"] = "ground";
27
+ /** The layer's text colour. */
28
+ SceneProp["Ink"] = "ink";
29
+ })(SceneProp || (SceneProp = {}));
30
+ var SceneAttribute;
31
+ (function (SceneAttribute) {
32
+ SceneAttribute["Root"] = "data-iox-scene";
33
+ SceneAttribute["Tracks"] = "data-iox-tracks";
34
+ SceneAttribute["PhoneTracks"] = "data-iox-tracks-phone";
35
+ })(SceneAttribute || (SceneAttribute = {}));
36
+ /** At or under this stage width a layer plays its phone tracks. The `mobile` breakpoint's width. */
37
+ const SCENE_PHONE_MAX_WIDTH = 767;
38
+ const DECIMALS = 10000;
39
+ const round = (v) => Math.round(v * DECIMALS) / DECIMALS;
40
+ const clamp01 = (v) => Math.min(1, Math.max(0, v));
41
+ const smoothstep = (t) => t * t * (3 - 2 * t);
42
+ /** A colour a track may hold: a hex, an rgb()/hsl() literal, or a design token. Anything else could break out of the
43
+ * inline style it lands in. */
44
+ const COLOUR = /^(#[0-9a-f]{3,8}|(rgb|hsl)a?\([\d\s.,%/]+\)|var\(--iox-[\w-]+\))$/i;
45
+ const COLOUR_PROPS = new Set([SceneProp.Ground, SceneProp.Ink]);
46
+ const ALL_PROPS = new Set(Object.values(SceneProp));
47
+ function validKey(key, colour) {
48
+ if (!Array.isArray(key) || key.length !== 2)
49
+ return false;
50
+ const [p, value] = key;
51
+ if (typeof p !== 'number' || !Number.isFinite(p) || p < 0 || p > 1)
52
+ return false;
53
+ return colour ? typeof value === 'string' && COLOUR.test(value) : typeof value === 'number' && Number.isFinite(value);
54
+ }
55
+ /**
56
+ * The tracks a saved value really holds: unknown properties, bad keys and colours that are not colours are dropped,
57
+ * keys sorted by progress, a track left with no key dropped. Never throws on what a page document holds.
58
+ */
59
+ function normalizeTracks(tracks) {
60
+ if (!Array.isArray(tracks))
61
+ return [];
62
+ const out = [];
63
+ for (const track of tracks) {
64
+ const prop = track?.prop;
65
+ if (!prop || !ALL_PROPS.has(prop) || !Array.isArray(track.keys))
66
+ continue;
67
+ const keys = track.keys
68
+ .filter(key => validKey(key, COLOUR_PROPS.has(prop)))
69
+ .slice()
70
+ .sort((a, b) => a[0] - b[0]);
71
+ if (keys.length)
72
+ out.push({ prop, keys });
73
+ }
74
+ return out;
75
+ }
76
+ /** The two keys around `p` and how far between them it eases. */
77
+ function span(keys, p) {
78
+ const at = clamp01(p);
79
+ if (at <= keys[0][0])
80
+ return { a: keys[0], b: keys[0], f: 0 };
81
+ for (let i = 1; i < keys.length; i++) {
82
+ if (at <= keys[i][0]) {
83
+ const a = keys[i - 1];
84
+ const b = keys[i];
85
+ const width = b[0] - a[0];
86
+ return { a, b, f: width > 0 ? smoothstep((at - a[0]) / width) : 1 };
87
+ }
88
+ }
89
+ const last = keys[keys.length - 1];
90
+ return { a: last, b: last, f: 0 };
91
+ }
92
+ /** A numeric track's value at progress `p`. */
93
+ function valueAt(keys, p) {
94
+ if (!keys.length)
95
+ return 0;
96
+ const { a, b, f } = span(keys, p);
97
+ const from = Number(a[1]);
98
+ return round(from + (Number(b[1]) - from) * f);
99
+ }
100
+ /**
101
+ * A colour track's value at progress `p`. Mixed by the browser, never computed here, so a design token stays a live
102
+ * reference (a re-theme reaches a Scene, as it reaches every saved page) and the path is perceptual.
103
+ */
104
+ function colourAt(keys, p) {
105
+ if (!keys.length)
106
+ return '';
107
+ const { a, b, f } = span(keys, p);
108
+ if (f <= 0 || a === b)
109
+ return String(a[1]);
110
+ if (f >= 1)
111
+ return String(b[1]);
112
+ return `color-mix(in oklab, ${a[1]} ${round((1 - f) * 100)}%, ${b[1]})`;
113
+ }
114
+ /** What the tracks' transform-family properties rest at when a layer has no track for one. */
115
+ const TRANSFORM_REST = { [SceneProp.X]: 0, [SceneProp.Y]: 0, [SceneProp.Scale]: 1, [SceneProp.Rotate]: 0 };
116
+ /**
117
+ * A layer's frame at progress `p`. Lengths are container-query units, so one frame is right at any width, under any
118
+ * canvas zoom, on the server and with no measuring: the stage is the size container (`iox-design.css`).
119
+ */
120
+ function sceneFrame(tracks, p, options = {}) {
121
+ const frame = {};
122
+ const moves = {};
123
+ for (const { prop, keys } of tracks) {
124
+ if (prop in TRANSFORM_REST)
125
+ moves[prop] = valueAt(keys, p);
126
+ else if (prop === SceneProp.Opacity)
127
+ frame.opacity = String(clamp01(valueAt(keys, p)));
128
+ else if (prop === SceneProp.Clip)
129
+ frame.clipPath = `inset(${Math.min(50, Math.max(0, valueAt(keys, p)))}%)`;
130
+ else if (prop === SceneProp.Ground)
131
+ frame.backgroundColor = colourAt(keys, p);
132
+ else if (prop === SceneProp.Ink)
133
+ frame.color = colourAt(keys, p);
134
+ }
135
+ if (Object.keys(moves).length) {
136
+ const value = (prop) => moves[prop] ?? TRANSFORM_REST[prop];
137
+ const x = round(value(SceneProp.X) * (options.inlineSign ?? 1));
138
+ frame.transform = `translate3d(${x}cqw, ${value(SceneProp.Y)}cqh, 0) rotate(${value(SceneProp.Rotate)}deg) scale(${value(SceneProp.Scale)})`;
139
+ }
140
+ return frame;
141
+ }
142
+ const CSS_NAME = {
143
+ transform: 'transform',
144
+ opacity: 'opacity',
145
+ clipPath: 'clip-path',
146
+ backgroundColor: 'background-color',
147
+ color: 'color',
148
+ };
149
+ /** A frame as kebab-case style declarations, for a string renderer. */
150
+ function sceneFrameDeclarations(frame) {
151
+ const out = {};
152
+ for (const [key, value] of Object.entries(frame))
153
+ if (value)
154
+ out[CSS_NAME[key]] = value;
155
+ return out;
156
+ }
157
+ /** The attributes a node's own element carries — the same decision in all three render paths. The runtime reads them,
158
+ * so it needs no node tree and is the same on every path. Empty for any node that is no part of a Scene. */
159
+ function sceneNodeAttributes(node) {
160
+ const attrs = {};
161
+ if (node?.role === SceneRole.Scene)
162
+ attrs[SceneAttribute.Root] = '';
163
+ const tracks = normalizeTracks(node?.sceneTracks);
164
+ const phone = normalizeTracks(node?.scenePhoneTracks);
165
+ if (tracks.length)
166
+ attrs[SceneAttribute.Tracks] = JSON.stringify(tracks);
167
+ if (phone.length)
168
+ attrs[SceneAttribute.PhoneTracks] = JSON.stringify(phone);
169
+ return attrs;
170
+ }
171
+ /** The frame a layer ships in from the server: where it stands before anyone has scrolled. Without it the page would
172
+ * paint every layer at once, and then jump when the script arrives. */
173
+ function sceneFirstFrame(node) {
174
+ return sceneFrame(normalizeTracks(node?.sceneTracks), 0);
175
+ }
176
+ /**
177
+ * Make an element carry its node's Scene attributes: the live sync on the canvas and the component path's stamp.
178
+ * Removes stale ones, touches nothing else.
179
+ */
180
+ function syncSceneAttributes(el, node) {
181
+ if (!el?.setAttribute)
182
+ return;
183
+ const attrs = sceneNodeAttributes(node);
184
+ for (const name of Object.values(SceneAttribute)) {
185
+ if (name in attrs)
186
+ el.setAttribute(name, attrs[name]);
187
+ else
188
+ el.removeAttribute(name);
189
+ }
190
+ }
191
+ /** Stamp a layer's first frame on its element (the component path, on the server too). */
192
+ function applySceneFirstFrame(el, node) {
193
+ if (!el?.style)
194
+ return;
195
+ for (const [name, value] of Object.entries(sceneFrameDeclarations(sceneFirstFrame(node))))
196
+ el.style.setProperty(name, value);
197
+ }
198
+ /**
199
+ * Where nothing will drive it (reduced motion, no script) a Scene is ordinary content: it flows, every layer in its
200
+ * place and in its own look, every word readable. `!important` because it must beat a node's compiled height and
201
+ * position, and the inline first frame. The engine wraps it in a reduced-motion query and in `<noscript>`.
202
+ */
203
+ const SCENE_FLOW_RULES = `.iox-role-scene{height:auto!important}`
204
+ + `.iox-role-scene-stage{position:relative!important;top:auto!important;height:auto!important;overflow:visible!important;container-type:normal!important}`
205
+ + `[${SceneAttribute.Tracks}]{transform:none!important;opacity:1!important;clip-path:none!important}`;
206
+ /** Under reduced motion the driver never starts, so the same rules hold for the whole visit. */
207
+ const SCENE_REDUCED_MOTION_CSS = `@media (prefers-reduced-motion: reduce){${SCENE_FLOW_RULES}}`;
208
+
209
+ /** Generic words a fresh Scene starts with: the author's to replace. */
210
+ const SCENE_WORDS = {
211
+ title: 'One idea, held still',
212
+ line: 'The page keeps moving. This stays until you have read it.',
213
+ };
214
+ /** How long a fresh Scene plays: 4 viewports wide, 3 on a phone (a thumb travels less). */
215
+ const SCENE_LENGTH = '400vh';
216
+ const SCENE_PHONE_LENGTH = '300vh';
217
+ /** Small viewport height: a phone's toolbar never pushes the stage's bottom out of sight. */
218
+ const SCENE_STAGE_HEIGHT = '100svh';
219
+ const PHONE_BREAKPOINT = 'mobile';
220
+ const TITLE_LEVEL = 'h2';
221
+ var Type;
222
+ (function (Type) {
223
+ Type["Section"] = "Section";
224
+ Type["Container"] = "Container";
225
+ Type["Heading"] = "Heading";
226
+ Type["Text"] = "Text";
227
+ })(Type || (Type = {}));
228
+ const ROOT_LAYOUT = {
229
+ position: 'relative',
230
+ display: 'block',
231
+ width: '100%',
232
+ height: SCENE_LENGTH,
233
+ };
234
+ const STAGE_LAYOUT = {
235
+ position: 'sticky',
236
+ top: '0px',
237
+ display: 'flex',
238
+ flexDirection: 'column',
239
+ alignItems: 'center',
240
+ justifyContent: 'center',
241
+ width: '100%',
242
+ height: SCENE_STAGE_HEIGHT,
243
+ overflow: 'hidden',
244
+ };
245
+ const TITLE_TRACKS = [
246
+ { prop: SceneProp.Opacity, keys: [[0, 0], [0.2, 1], [0.75, 1], [1, 0]] },
247
+ { prop: SceneProp.Y, keys: [[0, 8], [0.2, 0], [1, -6]] },
248
+ { prop: SceneProp.Scale, keys: [[0, 0.96], [0.6, 1], [1, 1.04]] },
249
+ ];
250
+ const LINE_TRACKS = [
251
+ { prop: SceneProp.Opacity, keys: [[0.25, 0], [0.45, 1], [0.8, 1], [1, 0]] },
252
+ { prop: SceneProp.Y, keys: [[0.25, 6], [0.45, 0], [1, -4]] },
253
+ ];
254
+ const STAGE_TRACKS = [
255
+ { prop: SceneProp.Ground, keys: [[0, 'var(--iox-surface-2)'], [0.6, 'var(--iox-page-bg)']] },
256
+ ];
257
+ const copyTracks = (tracks) => tracks.map(t => ({ prop: t.prop, keys: t.keys.map(k => [k[0], k[1]]) }));
258
+ /** A fresh Scene: it already moves, so the author sees what the thing is before touching it. */
259
+ function buildSceneRecipe(create, words = {}) {
260
+ const text = { ...SCENE_WORDS, ...words };
261
+ const root = makeCompositePart(create, { key: 'root', type: Type.Section, elementStyle: NO_ELEMENT_STYLE }, SceneRole.Scene, 'Scene', ROOT_LAYOUT);
262
+ writeLayerStyles(root, PHONE_BREAKPOINT, { height: SCENE_PHONE_LENGTH });
263
+ const stage = makeCompositePart(create, { key: 'stage', type: Type.Container, elementStyle: NO_ELEMENT_STYLE }, SceneRole.Stage, 'Stage', STAGE_LAYOUT);
264
+ stage.sceneTracks = copyTracks(STAGE_TRACKS);
265
+ const title = makeCompositePart(create, { key: 'title', type: Type.Heading, props: { content: text.title, level: TITLE_LEVEL } }, null, 'Title');
266
+ title.sceneTracks = copyTracks(TITLE_TRACKS);
267
+ writeStyles(title, { textAlign: 'center' });
268
+ const line = makeCompositePart(create, { key: 'line', type: Type.Text, props: { content: text.line, tag: 'p' } }, null, 'Line');
269
+ line.sceneTracks = copyTracks(LINE_TRACKS);
270
+ writeStyles(line, { textAlign: 'center' });
271
+ stage.children = [title, line];
272
+ root.children = [stage];
273
+ return root;
274
+ }
275
+
276
+ /**
277
+ * The ONE scroll loop (premium-sites plan §5b, SC0). Every Scene on a page reads one progress value from it, on the
278
+ * canvas and on the live site alike. It reads where the root is and nothing else, so it has one code path: under the
279
+ * canvas's zoom the same rectangle divides by the same zoom, and the answer is the same at any scale.
280
+ *
281
+ * - The value is DAMPED: the scroll stops and the page settles a moment later. This is much of the prototype's weight,
282
+ * and why this is not a CSS scroll timeline, which cannot do it.
283
+ * - The live site pins with `position: sticky`, on the compositor. The canvas cannot (its page never scrolls itself,
284
+ * its Lenis scrolls a wrapper around a zoomed frame), so `pin` holds the stage there with `translate` instead.
285
+ * `translate`, not `transform`: a Stage may carry tracks of its own.
286
+ * - It sleeps. No frame is asked for unless something moved, so a page holding a settled Scene costs nothing.
287
+ * - Reads come first in a frame and writes after, and a write only ever touches compositor properties.
288
+ */
289
+ const SCENE_DAMPING = 9;
290
+ const SETTLED = 0.0005;
291
+ const MAX_FRAME_SECONDS = 0.1;
292
+ /** The first frame after a sleep has no previous one to measure from: it counts as one frame, or a scroll would lose it. */
293
+ const WAKING_FRAME_SECONDS = 1 / 60;
294
+ const STAGE_SELECTOR = `.iox-role-${SceneRole.Stage.replace(/\./g, '-')}`;
295
+ const TRANSFORM_WILL_CHANGE = 'transform, opacity';
296
+ /** One frame of the damping: frame-rate independent, so 60 Hz and 120 Hz settle in the same time. */
297
+ function dampToward(current, target, seconds, rate = SCENE_DAMPING) {
298
+ return current + (target - current) * (1 - Math.exp(-seconds * rate));
299
+ }
300
+ /** Where a root stands: scrolled `local` page px into its `travel`. `zoom` undoes the canvas's scale. */
301
+ function sceneScrollState(rootTop, originTop, zoom, travel) {
302
+ if (travel <= 0)
303
+ return { local: 0, progress: 0 };
304
+ const local = Math.min(travel, Math.max(0, -(rootTop - originTop) / (zoom || 1)));
305
+ return { local, progress: local / travel };
306
+ }
307
+ function parseTracks(raw) {
308
+ if (!raw)
309
+ return [];
310
+ try {
311
+ return normalizeTracks(JSON.parse(raw));
312
+ }
313
+ catch {
314
+ return [];
315
+ }
316
+ }
317
+ class ScrollDriver {
318
+ constructor(options = {}) {
319
+ this.options = options;
320
+ this.scenes = new Map();
321
+ this.frame = 0;
322
+ this.lastTime = 0;
323
+ this.wakeUp = () => this.wake();
324
+ this.tick = (now) => {
325
+ this.frame = 0;
326
+ const seconds = this.lastTime ? Math.min(MAX_FRAME_SECONDS, (now - this.lastTime) / 1000) : WAKING_FRAME_SECONDS;
327
+ this.lastTime = now;
328
+ const reads = [...this.scenes.values()].map(scene => this.read(scene));
329
+ let moving = false;
330
+ for (const { scene, local, target } of reads) {
331
+ if (this.options.pin && scene.stage)
332
+ scene.stage.style.setProperty('translate', `0 ${local}px`);
333
+ const next = scene.fresh ? target : dampToward(scene.progress, target, seconds, this.options.damping);
334
+ const settled = Math.abs(next - target) < SETTLED;
335
+ scene.progress = settled ? target : next;
336
+ scene.fresh = false;
337
+ this.write(scene);
338
+ moving = moving || !settled;
339
+ }
340
+ if (moving)
341
+ this.wake();
342
+ else
343
+ this.lastTime = 0;
344
+ };
345
+ this.host = options.host ?? window;
346
+ // In capture: a scroll does not bubble, and the canvas's Lenis scrolls an element, not the window.
347
+ this.host.addEventListener('scroll', this.wakeUp, { capture: true, passive: true });
348
+ this.host.addEventListener('resize', this.wakeUp, { passive: true });
349
+ const Observer = this.host.ResizeObserver;
350
+ this.resize = Observer ? new Observer(() => this.remeasureAll()) : null;
351
+ }
352
+ /** Drive a Scene's root. Idempotent: adding a root again re-reads it. */
353
+ add(root) {
354
+ this.remove(root);
355
+ const scene = { root, stage: null, layers: [], progress: 0, height: 0, travel: 0, phone: false, inlineSign: 1, fresh: true, mutations: null };
356
+ this.scenes.set(root, scene);
357
+ this.resize?.observe(root);
358
+ if (this.options.observe) {
359
+ const Observer = this.host.MutationObserver;
360
+ if (Observer) {
361
+ scene.mutations = new Observer(() => this.reread(scene));
362
+ scene.mutations.observe(root, { childList: true, subtree: true, attributes: true, attributeFilter: [SceneAttribute.Tracks, SceneAttribute.PhoneTracks] });
363
+ }
364
+ }
365
+ this.reread(scene);
366
+ }
367
+ remove(root) {
368
+ const scene = this.scenes.get(root);
369
+ if (!scene)
370
+ return;
371
+ scene.mutations?.disconnect();
372
+ this.resize?.unobserve(root);
373
+ if (scene.stage)
374
+ scene.stage.style.removeProperty('translate');
375
+ for (const layer of scene.layers)
376
+ layer.el.style.removeProperty('will-change');
377
+ this.scenes.delete(root);
378
+ }
379
+ /** The damped progress a root's layers stand at. */
380
+ progressOf(root) {
381
+ return this.scenes.get(root)?.progress ?? null;
382
+ }
383
+ /** Something moved that no scroll or resize announces (the canvas's zoom). */
384
+ wake() {
385
+ if (this.frame)
386
+ return;
387
+ this.frame = this.host.requestAnimationFrame(this.tick);
388
+ }
389
+ destroy() {
390
+ if (this.frame)
391
+ this.host.cancelAnimationFrame(this.frame);
392
+ this.frame = 0;
393
+ this.host.removeEventListener('scroll', this.wakeUp, { capture: true });
394
+ this.host.removeEventListener('resize', this.wakeUp);
395
+ for (const root of [...this.scenes.keys()])
396
+ this.remove(root);
397
+ this.resize?.disconnect();
398
+ }
399
+ /** Read a root's stage and layers from its DOM: its own Scene's only, never a nested one's. */
400
+ reread(scene) {
401
+ scene.stage = scene.root.querySelector(STAGE_SELECTOR);
402
+ scene.layers = Array.from(scene.root.querySelectorAll(`[${SceneAttribute.Tracks}], [${SceneAttribute.PhoneTracks}]`))
403
+ .filter(el => el === scene.root || el.parentElement?.closest(`[${SceneAttribute.Root}]`) === scene.root)
404
+ .map(el => this.readLayer(el, scene));
405
+ this.measure(scene);
406
+ scene.fresh = true;
407
+ this.wake();
408
+ }
409
+ readLayer(el, scene) {
410
+ const previous = scene.layers.find(layer => layer.el === el);
411
+ el.style.setProperty('will-change', TRANSFORM_WILL_CHANGE);
412
+ return { el, tracks: parseTracks(el.getAttribute(SceneAttribute.Tracks)), phoneTracks: parseTracks(el.getAttribute(SceneAttribute.PhoneTracks)), last: previous?.last ?? {} };
413
+ }
414
+ remeasureAll() {
415
+ for (const scene of this.scenes.values())
416
+ this.measure(scene);
417
+ this.wake();
418
+ }
419
+ measure(scene) {
420
+ scene.height = scene.root.offsetHeight;
421
+ scene.travel = Math.max(0, scene.height - (scene.stage?.offsetHeight ?? scene.height));
422
+ scene.phone = (scene.stage?.offsetWidth ?? Infinity) <= SCENE_PHONE_MAX_WIDTH;
423
+ scene.inlineSign = scene.stage && this.host.getComputedStyle(scene.stage).direction === 'rtl' ? -1 : 1;
424
+ for (const layer of scene.layers)
425
+ layer.last = {};
426
+ }
427
+ read(scene) {
428
+ const rect = scene.root.getBoundingClientRect();
429
+ const origin = this.options.originOf?.(scene.root)?.getBoundingClientRect().top ?? 0;
430
+ const zoom = scene.height ? rect.height / scene.height : 1;
431
+ const { local, progress } = sceneScrollState(rect.top, origin, zoom, scene.travel);
432
+ return { scene, local, target: progress };
433
+ }
434
+ write(scene) {
435
+ for (const layer of scene.layers) {
436
+ const tracks = scene.phone && layer.phoneTracks.length ? layer.phoneTracks : layer.tracks;
437
+ const frame = sceneFrame(tracks, scene.progress, { inlineSign: scene.inlineSign });
438
+ for (const key of Object.keys(frame)) {
439
+ if (frame[key] !== layer.last[key])
440
+ layer.el.style[key] = frame[key];
441
+ }
442
+ layer.last = frame;
443
+ }
444
+ }
445
+ }
446
+ /** A page's Scenes, driven by one driver; null when it holds none, or when the visitor asked for less motion (the
447
+ * page's own CSS then lets each Scene flow). The live site's door. */
448
+ function attachScenes(container, options = {}) {
449
+ const roots = container.querySelectorAll(`[${SceneAttribute.Root}]`);
450
+ if (!roots.length)
451
+ return null;
452
+ const host = options.host ?? window;
453
+ if (host.matchMedia?.('(prefers-reduced-motion: reduce)').matches)
454
+ return null;
455
+ const driver = new ScrollDriver(options);
456
+ roots.forEach(root => driver.add(root));
457
+ return driver;
458
+ }
459
+
460
+ /**
461
+ * @vectoriox/iox-ui/scene-core — a Scene: a stage that holds still while the page scrolls past it, its layers moving on
462
+ * ONE progress value (premium-sites plan §5b). FRAMEWORK-FREE: the builder canvas, both engine paths and (from SC6) the
463
+ * composer read the same tracks, frames and recipe; the driver is DOM-only and is the ONE scroll loop.
464
+ * ⚠️ Consumers wire the usual trio — ng-package raw-ts assets, jest moduleNameMapper, tsconfig paths.
465
+ */
466
+
467
+ /**
468
+ * Generated bundle index. Do not edit.
469
+ */
470
+
471
+ export { SCENE_DAMPING, SCENE_FLOW_RULES, SCENE_LENGTH, SCENE_PHONE_LENGTH, SCENE_PHONE_MAX_WIDTH, SCENE_REDUCED_MOTION_CSS, SCENE_STAGE_HEIGHT, SCENE_WORDS, SceneAttribute, SceneProp, ScrollDriver, applySceneFirstFrame, attachScenes, buildSceneRecipe, colourAt, dampToward, normalizeTracks, sceneFirstFrame, sceneFrame, sceneFrameDeclarations, sceneNodeAttributes, sceneScrollState, syncSceneAttributes, valueAt };
472
+ //# sourceMappingURL=vectoriox-iox-ui-scene-core.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vectoriox-iox-ui-scene-core.mjs","sources":["../../../projects/iox-ui/src/scene-core/scene.ts","../../../projects/iox-ui/src/scene-core/scene-recipe.ts","../../../projects/iox-ui/src/scene-core/scroll-driver.ts","../../../projects/iox-ui/src/scene-core/public-api.ts","../../../projects/iox-ui/src/scene-core/vectoriox-iox-ui-scene-core.ts"],"sourcesContent":["import { SceneRole } from '@vectoriox/iox-ui/composite-core';\n\n/**\n * A Scene's data and maths (premium-sites plan §5b). A Scene is a recipe of ordinary nodes — a tall Section, a pinned\n * stage inside it, ordinary nodes as layers — so every word stays real, bound and translatable, and all three render\n * paths already draw it. What moves a layer is its OWN `sceneTracks`, never a list on the root naming layer ids: a clone\n * copies them with the layer, a delete takes them with it, and there is no id to remap.\n *\n * The vocabulary is closed. Every property is one the compositor can run without layout (CLS stays 0): a saved value\n * outside it is dropped when read, so a page document can never write CSS through a track.\n */\n\nexport enum SceneProp {\n /** Along the inline axis, in % of the stage's width. Positive runs toward the inline END (mirrored in RTL). */\n X = 'x',\n /** Down, in % of the stage's height. */\n Y = 'y',\n Scale = 'scale',\n /** Degrees. */\n Rotate = 'rotate',\n /** 0–1. */\n Opacity = 'opacity',\n /** Inset from every side, in % of the layer (0 = whole, 50 = gone). */\n Clip = 'clip',\n /** The layer's background colour. */\n Ground = 'ground',\n /** The layer's text colour. */\n Ink = 'ink',\n}\n\n/** One key: at progress `[0]` (0–1) the property holds `[1]`: a number, or a colour for Ground and Ink. */\nexport type SceneKey = readonly [number, number | string];\n\nexport interface SceneTrack {\n prop: SceneProp;\n /** Ascending by progress. Between two keys the value eases (smoothstep); outside them it holds the nearest. */\n keys: ReadonlyArray<SceneKey>;\n}\n\n/** What a node carries (both a builder node and a saved one). */\nexport interface SceneNodeSource {\n role?: string | null;\n /** How this layer moves, from the wide layout down to the phone's. */\n sceneTracks?: ReadonlyArray<SceneTrack> | null;\n /** How it moves at phone width instead (`SCENE_PHONE_MAX_WIDTH`). Absent = the same tracks. */\n scenePhoneTracks?: ReadonlyArray<SceneTrack> | null;\n}\n\n/** A frame as inline-style properties (camelCase, as `CSSStyleDeclaration` and `Object.assign` take them). */\nexport interface SceneFrame {\n transform?: string;\n opacity?: string;\n clipPath?: string;\n backgroundColor?: string;\n color?: string;\n}\n\nexport enum SceneAttribute {\n Root = 'data-iox-scene',\n Tracks = 'data-iox-tracks',\n PhoneTracks = 'data-iox-tracks-phone',\n}\n\n/** At or under this stage width a layer plays its phone tracks. The `mobile` breakpoint's width. */\nexport const SCENE_PHONE_MAX_WIDTH = 767;\n\nconst DECIMALS = 10000;\nconst round = (v: number): number => Math.round(v * DECIMALS) / DECIMALS;\nconst clamp01 = (v: number): number => Math.min(1, Math.max(0, v));\nconst smoothstep = (t: number): number => t * t * (3 - 2 * t);\n\n/** A colour a track may hold: a hex, an rgb()/hsl() literal, or a design token. Anything else could break out of the\n * inline style it lands in. */\nconst COLOUR = /^(#[0-9a-f]{3,8}|(rgb|hsl)a?\\([\\d\\s.,%/]+\\)|var\\(--iox-[\\w-]+\\))$/i;\nconst COLOUR_PROPS: ReadonlySet<SceneProp> = new Set([SceneProp.Ground, SceneProp.Ink]);\nconst ALL_PROPS: ReadonlySet<string> = new Set(Object.values(SceneProp));\n\nfunction validKey(key: unknown, colour: boolean): key is SceneKey {\n if (!Array.isArray(key) || key.length !== 2) return false;\n const [p, value] = key;\n if (typeof p !== 'number' || !Number.isFinite(p) || p < 0 || p > 1) return false;\n return colour ? typeof value === 'string' && COLOUR.test(value) : typeof value === 'number' && Number.isFinite(value);\n}\n\n/**\n * The tracks a saved value really holds: unknown properties, bad keys and colours that are not colours are dropped,\n * keys sorted by progress, a track left with no key dropped. Never throws on what a page document holds.\n */\nexport function normalizeTracks(tracks: unknown): SceneTrack[] {\n if (!Array.isArray(tracks)) return [];\n const out: SceneTrack[] = [];\n for (const track of tracks) {\n const prop = (track as SceneTrack | null)?.prop;\n if (!prop || !ALL_PROPS.has(prop) || !Array.isArray((track as SceneTrack).keys)) continue;\n const keys = (track as SceneTrack).keys\n .filter(key => validKey(key, COLOUR_PROPS.has(prop)))\n .slice()\n .sort((a, b) => a[0] - b[0]);\n if (keys.length) out.push({ prop, keys });\n }\n return out;\n}\n\n/** The two keys around `p` and how far between them it eases. */\nfunction span(keys: ReadonlyArray<SceneKey>, p: number): { a: SceneKey; b: SceneKey; f: number } {\n const at = clamp01(p);\n if (at <= keys[0][0]) return { a: keys[0], b: keys[0], f: 0 };\n for (let i = 1; i < keys.length; i++) {\n if (at <= keys[i][0]) {\n const a = keys[i - 1];\n const b = keys[i];\n const width = b[0] - a[0];\n return { a, b, f: width > 0 ? smoothstep((at - a[0]) / width) : 1 };\n }\n }\n const last = keys[keys.length - 1];\n return { a: last, b: last, f: 0 };\n}\n\n/** A numeric track's value at progress `p`. */\nexport function valueAt(keys: ReadonlyArray<SceneKey>, p: number): number {\n if (!keys.length) return 0;\n const { a, b, f } = span(keys, p);\n const from = Number(a[1]);\n return round(from + (Number(b[1]) - from) * f);\n}\n\n/**\n * A colour track's value at progress `p`. Mixed by the browser, never computed here, so a design token stays a live\n * reference (a re-theme reaches a Scene, as it reaches every saved page) and the path is perceptual.\n */\nexport function colourAt(keys: ReadonlyArray<SceneKey>, p: number): string {\n if (!keys.length) return '';\n const { a, b, f } = span(keys, p);\n if (f <= 0 || a === b) return String(a[1]);\n if (f >= 1) return String(b[1]);\n return `color-mix(in oklab, ${a[1]} ${round((1 - f) * 100)}%, ${b[1]})`;\n}\n\nexport interface SceneFrameOptions {\n /** -1 when the stage reads right-to-left: the inline axis mirrors. */\n inlineSign?: 1 | -1;\n}\n\n/** What the tracks' transform-family properties rest at when a layer has no track for one. */\nconst TRANSFORM_REST: Readonly<Partial<Record<SceneProp, number>>> = { [SceneProp.X]: 0, [SceneProp.Y]: 0, [SceneProp.Scale]: 1, [SceneProp.Rotate]: 0 };\n\n/**\n * A layer's frame at progress `p`. Lengths are container-query units, so one frame is right at any width, under any\n * canvas zoom, on the server and with no measuring: the stage is the size container (`iox-design.css`).\n */\nexport function sceneFrame(tracks: ReadonlyArray<SceneTrack>, p: number, options: SceneFrameOptions = {}): SceneFrame {\n const frame: SceneFrame = {};\n const moves: Partial<Record<SceneProp, number>> = {};\n for (const { prop, keys } of tracks) {\n if (prop in TRANSFORM_REST) moves[prop] = valueAt(keys, p);\n else if (prop === SceneProp.Opacity) frame.opacity = String(clamp01(valueAt(keys, p)));\n else if (prop === SceneProp.Clip) frame.clipPath = `inset(${Math.min(50, Math.max(0, valueAt(keys, p)))}%)`;\n else if (prop === SceneProp.Ground) frame.backgroundColor = colourAt(keys, p);\n else if (prop === SceneProp.Ink) frame.color = colourAt(keys, p);\n }\n if (Object.keys(moves).length) {\n const value = (prop: SceneProp): number => moves[prop] ?? TRANSFORM_REST[prop]!;\n const x = round(value(SceneProp.X) * (options.inlineSign ?? 1));\n frame.transform = `translate3d(${x}cqw, ${value(SceneProp.Y)}cqh, 0) rotate(${value(SceneProp.Rotate)}deg) scale(${value(SceneProp.Scale)})`;\n }\n return frame;\n}\n\nconst CSS_NAME: Readonly<Record<keyof SceneFrame, string>> = {\n transform: 'transform',\n opacity: 'opacity',\n clipPath: 'clip-path',\n backgroundColor: 'background-color',\n color: 'color',\n};\n\n/** A frame as kebab-case style declarations, for a string renderer. */\nexport function sceneFrameDeclarations(frame: SceneFrame): Record<string, string> {\n const out: Record<string, string> = {};\n for (const [key, value] of Object.entries(frame)) if (value) out[CSS_NAME[key as keyof SceneFrame]] = value;\n return out;\n}\n\n/** The attributes a node's own element carries — the same decision in all three render paths. The runtime reads them,\n * so it needs no node tree and is the same on every path. Empty for any node that is no part of a Scene. */\nexport function sceneNodeAttributes(node: SceneNodeSource | null | undefined): Record<string, string> {\n const attrs: Record<string, string> = {};\n if (node?.role === SceneRole.Scene) attrs[SceneAttribute.Root] = '';\n const tracks = normalizeTracks(node?.sceneTracks);\n const phone = normalizeTracks(node?.scenePhoneTracks);\n if (tracks.length) attrs[SceneAttribute.Tracks] = JSON.stringify(tracks);\n if (phone.length) attrs[SceneAttribute.PhoneTracks] = JSON.stringify(phone);\n return attrs;\n}\n\n/** The frame a layer ships in from the server: where it stands before anyone has scrolled. Without it the page would\n * paint every layer at once, and then jump when the script arrives. */\nexport function sceneFirstFrame(node: SceneNodeSource | null | undefined): SceneFrame {\n return sceneFrame(normalizeTracks(node?.sceneTracks), 0);\n}\n\n/**\n * Make an element carry its node's Scene attributes: the live sync on the canvas and the component path's stamp.\n * Removes stale ones, touches nothing else.\n */\nexport function syncSceneAttributes(el: HTMLElement | null | undefined, node: SceneNodeSource | null | undefined): void {\n if (!el?.setAttribute) return;\n const attrs = sceneNodeAttributes(node);\n for (const name of Object.values(SceneAttribute)) {\n if (name in attrs) el.setAttribute(name, attrs[name]);\n else el.removeAttribute(name);\n }\n}\n\n/** Stamp a layer's first frame on its element (the component path, on the server too). */\nexport function applySceneFirstFrame(el: HTMLElement | null | undefined, node: SceneNodeSource | null | undefined): void {\n if (!el?.style) return;\n for (const [name, value] of Object.entries(sceneFrameDeclarations(sceneFirstFrame(node)))) el.style.setProperty(name, value);\n}\n\n/**\n * Where nothing will drive it (reduced motion, no script) a Scene is ordinary content: it flows, every layer in its\n * place and in its own look, every word readable. `!important` because it must beat a node's compiled height and\n * position, and the inline first frame. The engine wraps it in a reduced-motion query and in `<noscript>`.\n */\nexport const SCENE_FLOW_RULES = `.iox-role-scene{height:auto!important}`\n + `.iox-role-scene-stage{position:relative!important;top:auto!important;height:auto!important;overflow:visible!important;container-type:normal!important}`\n + `[${SceneAttribute.Tracks}]{transform:none!important;opacity:1!important;clip-path:none!important}`;\n\n/** Under reduced motion the driver never starts, so the same rules hold for the whole visit. */\nexport const SCENE_REDUCED_MOTION_CSS = `@media (prefers-reduced-motion: reduce){${SCENE_FLOW_RULES}}`;\n","import { CompositeNode, CompositeNodeFactory, makeCompositePart, NO_ELEMENT_STYLE, SceneRole, writeLayerStyles, writeStyles } from '@vectoriox/iox-ui/composite-core';\n\nimport { SceneNodeSource, SceneProp, SceneTrack } from './scene';\n\n/**\n * The SCENE recipe: ordinary nodes, no new type, so all three render paths and every panel already know it.\n *\n * Section role scene height = how long it plays (× the viewport)\n * └─ Container role scene.stage pinned, one viewport tall, clips its layers, the size container for their lengths\n * ├─ Heading a layer with its own tracks\n * └─ Text a layer with its own tracks\n *\n * How long it plays IS the root's height, so it follows the width system the way every other size does. The stage is a\n * track-carrying layer too: its Ground is the colour the whole Scene moves through.\n */\n\nexport type SceneLayerNode = CompositeNode & SceneNodeSource;\n\nexport interface SceneWords {\n title: string;\n line: string;\n}\n\n/** Generic words a fresh Scene starts with: the author's to replace. */\nexport const SCENE_WORDS: Readonly<SceneWords> = {\n title: 'One idea, held still',\n line: 'The page keeps moving. This stays until you have read it.',\n};\n\n/** How long a fresh Scene plays: 4 viewports wide, 3 on a phone (a thumb travels less). */\nexport const SCENE_LENGTH = '400vh';\nexport const SCENE_PHONE_LENGTH = '300vh';\n/** Small viewport height: a phone's toolbar never pushes the stage's bottom out of sight. */\nexport const SCENE_STAGE_HEIGHT = '100svh';\nconst PHONE_BREAKPOINT = 'mobile';\nconst TITLE_LEVEL = 'h2';\n\nenum Type {\n Section = 'Section',\n Container = 'Container',\n Heading = 'Heading',\n Text = 'Text',\n}\n\nconst ROOT_LAYOUT: Readonly<Record<string, string>> = {\n position: 'relative',\n display: 'block',\n width: '100%',\n height: SCENE_LENGTH,\n};\n\nconst STAGE_LAYOUT: Readonly<Record<string, string>> = {\n position: 'sticky',\n top: '0px',\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n height: SCENE_STAGE_HEIGHT,\n overflow: 'hidden',\n};\n\nconst TITLE_TRACKS: ReadonlyArray<SceneTrack> = [\n { prop: SceneProp.Opacity, keys: [[0, 0], [0.2, 1], [0.75, 1], [1, 0]] },\n { prop: SceneProp.Y, keys: [[0, 8], [0.2, 0], [1, -6]] },\n { prop: SceneProp.Scale, keys: [[0, 0.96], [0.6, 1], [1, 1.04]] },\n];\n\nconst LINE_TRACKS: ReadonlyArray<SceneTrack> = [\n { prop: SceneProp.Opacity, keys: [[0.25, 0], [0.45, 1], [0.8, 1], [1, 0]] },\n { prop: SceneProp.Y, keys: [[0.25, 6], [0.45, 0], [1, -4]] },\n];\n\nconst STAGE_TRACKS: ReadonlyArray<SceneTrack> = [\n { prop: SceneProp.Ground, keys: [[0, 'var(--iox-surface-2)'], [0.6, 'var(--iox-page-bg)']] },\n];\n\nconst copyTracks = (tracks: ReadonlyArray<SceneTrack>): SceneTrack[] => tracks.map(t => ({ prop: t.prop, keys: t.keys.map(k => [k[0], k[1]] as const) }));\n\n/** A fresh Scene: it already moves, so the author sees what the thing is before touching it. */\nexport function buildSceneRecipe(create: CompositeNodeFactory, words: Partial<SceneWords> = {}): SceneLayerNode {\n const text = { ...SCENE_WORDS, ...words };\n const root = makeCompositePart(create, { key: 'root', type: Type.Section, elementStyle: NO_ELEMENT_STYLE }, SceneRole.Scene, 'Scene', ROOT_LAYOUT) as SceneLayerNode;\n writeLayerStyles(root, PHONE_BREAKPOINT, { height: SCENE_PHONE_LENGTH });\n\n const stage = makeCompositePart(create, { key: 'stage', type: Type.Container, elementStyle: NO_ELEMENT_STYLE }, SceneRole.Stage, 'Stage', STAGE_LAYOUT) as SceneLayerNode;\n stage.sceneTracks = copyTracks(STAGE_TRACKS);\n\n const title = makeCompositePart(create, { key: 'title', type: Type.Heading, props: { content: text.title, level: TITLE_LEVEL } }, null, 'Title') as SceneLayerNode;\n title.sceneTracks = copyTracks(TITLE_TRACKS);\n writeStyles(title, { textAlign: 'center' });\n\n const line = makeCompositePart(create, { key: 'line', type: Type.Text, props: { content: text.line, tag: 'p' } }, null, 'Line') as SceneLayerNode;\n line.sceneTracks = copyTracks(LINE_TRACKS);\n writeStyles(line, { textAlign: 'center' });\n\n stage.children = [title, line];\n root.children = [stage];\n return root;\n}\n","import { SceneRole } from '@vectoriox/iox-ui/composite-core';\n\nimport { normalizeTracks, SCENE_PHONE_MAX_WIDTH, SceneAttribute, sceneFrame, SceneFrame, SceneTrack } from './scene';\n\n/**\n * The ONE scroll loop (premium-sites plan §5b, SC0). Every Scene on a page reads one progress value from it, on the\n * canvas and on the live site alike. It reads where the root is and nothing else, so it has one code path: under the\n * canvas's zoom the same rectangle divides by the same zoom, and the answer is the same at any scale.\n *\n * - The value is DAMPED: the scroll stops and the page settles a moment later. This is much of the prototype's weight,\n * and why this is not a CSS scroll timeline, which cannot do it.\n * - The live site pins with `position: sticky`, on the compositor. The canvas cannot (its page never scrolls itself,\n * its Lenis scrolls a wrapper around a zoomed frame), so `pin` holds the stage there with `translate` instead.\n * `translate`, not `transform`: a Stage may carry tracks of its own.\n * - It sleeps. No frame is asked for unless something moved, so a page holding a settled Scene costs nothing.\n * - Reads come first in a frame and writes after, and a write only ever touches compositor properties.\n */\n\nexport const SCENE_DAMPING = 9;\nconst SETTLED = 0.0005;\nconst MAX_FRAME_SECONDS = 0.1;\n/** The first frame after a sleep has no previous one to measure from: it counts as one frame, or a scroll would lose it. */\nconst WAKING_FRAME_SECONDS = 1 / 60;\nconst STAGE_SELECTOR = `.iox-role-${SceneRole.Stage.replace(/\\./g, '-')}`;\nconst TRANSFORM_WILL_CHANGE = 'transform, opacity';\n\n/** One frame of the damping: frame-rate independent, so 60 Hz and 120 Hz settle in the same time. */\nexport function dampToward(current: number, target: number, seconds: number, rate: number = SCENE_DAMPING): number {\n return current + (target - current) * (1 - Math.exp(-seconds * rate));\n}\n\n/** Where a root stands: scrolled `local` page px into its `travel`. `zoom` undoes the canvas's scale. */\nexport function sceneScrollState(rootTop: number, originTop: number, zoom: number, travel: number): { local: number; progress: number } {\n if (travel <= 0) return { local: 0, progress: 0 };\n const local = Math.min(travel, Math.max(0, -(rootTop - originTop) / (zoom || 1)));\n return { local, progress: local / travel };\n}\n\nexport interface ScrollDriverOptions {\n /** Hold the stage with `translate` (the canvas). The live site's stage is sticky and needs nothing. */\n pin?: boolean;\n /** The element a root scrolls under, when that is not the window (the canvas's frame, Preview's page). */\n originOf?: (root: HTMLElement) => HTMLElement | null;\n /** Follow what changes inside a root: tracks edited, layers added (the canvas). */\n observe?: boolean;\n damping?: number;\n /** The window, for a test. */\n host?: Window;\n}\n\ninterface Layer {\n el: HTMLElement;\n tracks: SceneTrack[];\n phoneTracks: SceneTrack[];\n last: SceneFrame;\n}\n\ninterface Scene {\n root: HTMLElement;\n stage: HTMLElement | null;\n layers: Layer[];\n progress: number;\n /** Page px and the stage's own width, measured when something resizes and never per frame. */\n height: number;\n travel: number;\n phone: boolean;\n inlineSign: 1 | -1;\n /** No frame written yet: the first one lands exactly where the scroll is, with no glide. */\n fresh: boolean;\n mutations: MutationObserver | null;\n}\n\nfunction parseTracks(raw: string | null): SceneTrack[] {\n if (!raw) return [];\n try { return normalizeTracks(JSON.parse(raw)); } catch { return []; }\n}\n\nexport class ScrollDriver {\n private readonly scenes = new Map<HTMLElement, Scene>();\n private readonly host: Window;\n private readonly resize: ResizeObserver | null;\n private frame = 0;\n private lastTime = 0;\n private readonly wakeUp = (): void => this.wake();\n\n constructor(private readonly options: ScrollDriverOptions = {}) {\n this.host = options.host ?? window;\n // In capture: a scroll does not bubble, and the canvas's Lenis scrolls an element, not the window.\n this.host.addEventListener('scroll', this.wakeUp, { capture: true, passive: true });\n this.host.addEventListener('resize', this.wakeUp, { passive: true });\n const Observer = (this.host as Window & { ResizeObserver?: typeof ResizeObserver }).ResizeObserver;\n this.resize = Observer ? new Observer(() => this.remeasureAll()) : null;\n }\n\n /** Drive a Scene's root. Idempotent: adding a root again re-reads it. */\n add(root: HTMLElement): void {\n this.remove(root);\n const scene: Scene = { root, stage: null, layers: [], progress: 0, height: 0, travel: 0, phone: false, inlineSign: 1, fresh: true, mutations: null };\n this.scenes.set(root, scene);\n this.resize?.observe(root);\n if (this.options.observe) {\n const Observer = (this.host as Window & { MutationObserver?: typeof MutationObserver }).MutationObserver;\n if (Observer) {\n scene.mutations = new Observer(() => this.reread(scene));\n scene.mutations.observe(root, { childList: true, subtree: true, attributes: true, attributeFilter: [SceneAttribute.Tracks, SceneAttribute.PhoneTracks] });\n }\n }\n this.reread(scene);\n }\n\n remove(root: HTMLElement): void {\n const scene = this.scenes.get(root);\n if (!scene) return;\n scene.mutations?.disconnect();\n this.resize?.unobserve(root);\n if (scene.stage) scene.stage.style.removeProperty('translate');\n for (const layer of scene.layers) layer.el.style.removeProperty('will-change');\n this.scenes.delete(root);\n }\n\n /** The damped progress a root's layers stand at. */\n progressOf(root: HTMLElement): number | null {\n return this.scenes.get(root)?.progress ?? null;\n }\n\n /** Something moved that no scroll or resize announces (the canvas's zoom). */\n wake(): void {\n if (this.frame) return;\n this.frame = this.host.requestAnimationFrame(this.tick);\n }\n\n destroy(): void {\n if (this.frame) this.host.cancelAnimationFrame(this.frame);\n this.frame = 0;\n this.host.removeEventListener('scroll', this.wakeUp, { capture: true });\n this.host.removeEventListener('resize', this.wakeUp);\n for (const root of [...this.scenes.keys()]) this.remove(root);\n this.resize?.disconnect();\n }\n\n /** Read a root's stage and layers from its DOM: its own Scene's only, never a nested one's. */\n private reread(scene: Scene): void {\n scene.stage = scene.root.querySelector<HTMLElement>(STAGE_SELECTOR);\n scene.layers = Array.from(scene.root.querySelectorAll<HTMLElement>(`[${SceneAttribute.Tracks}], [${SceneAttribute.PhoneTracks}]`))\n .filter(el => el === scene.root || el.parentElement?.closest(`[${SceneAttribute.Root}]`) === scene.root)\n .map(el => this.readLayer(el, scene));\n this.measure(scene);\n scene.fresh = true;\n this.wake();\n }\n\n private readLayer(el: HTMLElement, scene: Scene): Layer {\n const previous = scene.layers.find(layer => layer.el === el);\n el.style.setProperty('will-change', TRANSFORM_WILL_CHANGE);\n return { el, tracks: parseTracks(el.getAttribute(SceneAttribute.Tracks)), phoneTracks: parseTracks(el.getAttribute(SceneAttribute.PhoneTracks)), last: previous?.last ?? {} };\n }\n\n private remeasureAll(): void {\n for (const scene of this.scenes.values()) this.measure(scene);\n this.wake();\n }\n\n private measure(scene: Scene): void {\n scene.height = scene.root.offsetHeight;\n scene.travel = Math.max(0, scene.height - (scene.stage?.offsetHeight ?? scene.height));\n scene.phone = (scene.stage?.offsetWidth ?? Infinity) <= SCENE_PHONE_MAX_WIDTH;\n scene.inlineSign = scene.stage && this.host.getComputedStyle(scene.stage).direction === 'rtl' ? -1 : 1;\n for (const layer of scene.layers) layer.last = {};\n }\n\n private readonly tick = (now: number): void => {\n this.frame = 0;\n const seconds = this.lastTime ? Math.min(MAX_FRAME_SECONDS, (now - this.lastTime) / 1000) : WAKING_FRAME_SECONDS;\n this.lastTime = now;\n const reads = [...this.scenes.values()].map(scene => this.read(scene));\n let moving = false;\n for (const { scene, local, target } of reads) {\n if (this.options.pin && scene.stage) scene.stage.style.setProperty('translate', `0 ${local}px`);\n const next = scene.fresh ? target : dampToward(scene.progress, target, seconds, this.options.damping);\n const settled = Math.abs(next - target) < SETTLED;\n scene.progress = settled ? target : next;\n scene.fresh = false;\n this.write(scene);\n moving = moving || !settled;\n }\n if (moving) this.wake();\n else this.lastTime = 0;\n };\n\n private read(scene: Scene): { scene: Scene; local: number; target: number } {\n const rect = scene.root.getBoundingClientRect();\n const origin = this.options.originOf?.(scene.root)?.getBoundingClientRect().top ?? 0;\n const zoom = scene.height ? rect.height / scene.height : 1;\n const { local, progress } = sceneScrollState(rect.top, origin, zoom, scene.travel);\n return { scene, local, target: progress };\n }\n\n private write(scene: Scene): void {\n for (const layer of scene.layers) {\n const tracks = scene.phone && layer.phoneTracks.length ? layer.phoneTracks : layer.tracks;\n const frame = sceneFrame(tracks, scene.progress, { inlineSign: scene.inlineSign });\n for (const key of Object.keys(frame) as (keyof SceneFrame)[]) {\n if (frame[key] !== layer.last[key]) layer.el.style[key] = frame[key]!;\n }\n layer.last = frame;\n }\n }\n}\n\n/** A page's Scenes, driven by one driver; null when it holds none, or when the visitor asked for less motion (the\n * page's own CSS then lets each Scene flow). The live site's door. */\nexport function attachScenes(container: HTMLElement, options: ScrollDriverOptions = {}): ScrollDriver | null {\n const roots = container.querySelectorAll<HTMLElement>(`[${SceneAttribute.Root}]`);\n if (!roots.length) return null;\n const host = options.host ?? window;\n if (host.matchMedia?.('(prefers-reduced-motion: reduce)').matches) return null;\n const driver = new ScrollDriver(options);\n roots.forEach(root => driver.add(root));\n return driver;\n}\n","/**\n * @vectoriox/iox-ui/scene-core — a Scene: a stage that holds still while the page scrolls past it, its layers moving on\n * ONE progress value (premium-sites plan §5b). FRAMEWORK-FREE: the builder canvas, both engine paths and (from SC6) the\n * composer read the same tracks, frames and recipe; the driver is DOM-only and is the ONE scroll loop.\n * ⚠️ Consumers wire the usual trio — ng-package raw-ts assets, jest moduleNameMapper, tsconfig paths.\n */\nexport * from './scene';\nexport * from './scene-recipe';\nexport * from './scroll-driver';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAEA;;;;;;;;AAQG;IAES;AAAZ,CAAA,UAAY,SAAS,EAAA;;AAEjB,IAAA,SAAA,CAAA,GAAA,CAAA,GAAA,GAAO;;AAEP,IAAA,SAAA,CAAA,GAAA,CAAA,GAAA,GAAO;AACP,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe;;AAEf,IAAA,SAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;;AAEjB,IAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;;AAEnB,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa;;AAEb,IAAA,SAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;;AAEjB,IAAA,SAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACf,CAAC,EAhBW,SAAS,KAAT,SAAS,GAAA,EAAA,CAAA,CAAA;IA6CT;AAAZ,CAAA,UAAY,cAAc,EAAA;AACtB,IAAA,cAAA,CAAA,MAAA,CAAA,GAAA,gBAAuB;AACvB,IAAA,cAAA,CAAA,QAAA,CAAA,GAAA,iBAA0B;AAC1B,IAAA,cAAA,CAAA,aAAA,CAAA,GAAA,uBAAqC;AACzC,CAAC,EAJW,cAAc,KAAd,cAAc,GAAA,EAAA,CAAA,CAAA;AAM1B;AACO,MAAM,qBAAqB,GAAG;AAErC,MAAM,QAAQ,GAAG,KAAK;AACtB,MAAM,KAAK,GAAG,CAAC,CAAS,KAAa,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,QAAQ;AACxE,MAAM,OAAO,GAAG,CAAC,CAAS,KAAa,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,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AC;IACjF,IAAI,CAAC,KAAK,CAAC,MAAM;AAAE,QAAA,OAAO,IAAI;AAC9B,IAAA,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,MAAM;IACnC,IAAI,IAAI,CAAC,UAAU,GAAG,kCAAkC,CAAC,CAAC,OAAO;AAAE,QAAA,OAAO,IAAI;AAC9E,IAAA,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,OAAO,CAAC;AACxC,IAAA,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACvC,IAAA,OAAO,MAAM;AACjB;;AC3NA;;;;;AAKG;;ACLH;;AAEG;;;;"}
@@ -1828,8 +1828,8 @@ const CURRENT_LINK_TYPES = ['Link', 'LinkedContainer', 'ButtonBlock'];
1828
1828
  */
1829
1829
  function rewriteViewportUnits(value) {
1830
1830
  return value
1831
- .replace(/(-?\d*\.?\d+)vh/g, 'calc($1 * var(--preview-vh, 1vh))')
1832
- .replace(/(-?\d*\.?\d+)vw/g, 'calc($1 * var(--preview-vw, 1vw))');
1831
+ .replace(/(-?\d*\.?\d+)([sdl]?)vh/g, 'calc($1 * var(--preview-vh, 1$2vh))')
1832
+ .replace(/(-?\d*\.?\d+)([sdl]?)vw/g, 'calc($1 * var(--preview-vw, 1$2vw))');
1833
1833
  }
1834
1834
  /**
1835
1835
  * kebab CSS property → the value that equals its CSS initial AND has no UA-stylesheet override for