@vectoriox/iox-ui 5.164.1 → 5.166.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.
Files changed (34) hide show
  1. package/design-core/index.d.ts +112 -1
  2. package/fesm2022/vectoriox-iox-ui-design-core.mjs +133 -5
  3. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  4. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +516 -95
  5. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  6. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +261 -0
  7. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
  8. package/fesm2022/vectoriox-iox-ui-scene-core.mjs +137 -10
  9. package/fesm2022/vectoriox-iox-ui-scene-core.mjs.map +1 -1
  10. package/fesm2022/vectoriox-iox-ui.mjs +25 -5
  11. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  12. package/generation-core/index.d.ts +412 -225
  13. package/harness-core/index.d.ts +192 -1
  14. package/index.d.ts +5 -1
  15. package/package.json +1 -1
  16. package/scene-core/index.d.ts +42 -6
  17. package/src/design-core/flavor-spec.generated.ts +98 -0
  18. package/src/design-core/footer-classes.ts +38 -0
  19. package/src/design-core/node-classes.ts +3 -2
  20. package/src/design-core/public-api.ts +1 -0
  21. package/src/generation-core/carry-fill.ts +1 -1
  22. package/src/generation-core/check-layout.ts +1 -1
  23. package/src/generation-core/compose-layout.ts +36 -5
  24. package/src/generation-core/compose-site.ts +34 -6
  25. package/src/generation-core/footer-mix.ts +292 -34
  26. package/src/generation-core/node-baselines.generated.ts +14 -1
  27. package/src/generation-core/patterns.ts +4 -1
  28. package/src/generation-core/site-spec.generated.ts +173 -45
  29. package/src/harness-core/business-types.ts +12 -0
  30. package/src/harness-core/harness-spec.generated.ts +261 -0
  31. package/src/scene-core/scene.ts +2 -0
  32. package/src/scene-core/scroll-driver.ts +121 -5
  33. package/src/scene-core/split-text.ts +17 -4
  34. package/styles/iox-design.css +99 -0
@@ -220,6 +220,12 @@ export const SPEC_BUSINESS_TYPES = [
220
220
  "column": {
221
221
  "never": []
222
222
  },
223
+ "footer": {
224
+ "closings": [],
225
+ "grounds": [],
226
+ "say": [],
227
+ "sayHe": []
228
+ },
223
229
  "art": {
224
230
  "preloader": [],
225
231
  "cover": [],
@@ -353,6 +359,12 @@ export const SPEC_BUSINESS_TYPES = [
353
359
  "column": {
354
360
  "never": []
355
361
  },
362
+ "footer": {
363
+ "closings": [],
364
+ "grounds": [],
365
+ "say": [],
366
+ "sayHe": []
367
+ },
356
368
  "art": {
357
369
  "preloader": [],
358
370
  "cover": [],
@@ -492,6 +504,12 @@ export const SPEC_BUSINESS_TYPES = [
492
504
  "column": {
493
505
  "never": []
494
506
  },
507
+ "footer": {
508
+ "closings": [],
509
+ "grounds": [],
510
+ "say": [],
511
+ "sayHe": []
512
+ },
495
513
  "art": {
496
514
  "preloader": [],
497
515
  "cover": [],
@@ -630,6 +648,12 @@ export const SPEC_BUSINESS_TYPES = [
630
648
  "column": {
631
649
  "never": []
632
650
  },
651
+ "footer": {
652
+ "closings": [],
653
+ "grounds": [],
654
+ "say": [],
655
+ "sayHe": []
656
+ },
633
657
  "art": {
634
658
  "preloader": [],
635
659
  "cover": [],
@@ -757,6 +781,12 @@ export const SPEC_BUSINESS_TYPES = [
757
781
  "column": {
758
782
  "never": []
759
783
  },
784
+ "footer": {
785
+ "closings": [],
786
+ "grounds": [],
787
+ "say": [],
788
+ "sayHe": []
789
+ },
760
790
  "art": {
761
791
  "preloader": [],
762
792
  "cover": [],
@@ -892,6 +922,12 @@ export const SPEC_BUSINESS_TYPES = [
892
922
  "column": {
893
923
  "never": []
894
924
  },
925
+ "footer": {
926
+ "closings": [],
927
+ "grounds": [],
928
+ "say": [],
929
+ "sayHe": []
930
+ },
895
931
  "art": {
896
932
  "preloader": [],
897
933
  "cover": [],
@@ -1019,6 +1055,12 @@ export const SPEC_BUSINESS_TYPES = [
1019
1055
  "column": {
1020
1056
  "never": []
1021
1057
  },
1058
+ "footer": {
1059
+ "closings": [],
1060
+ "grounds": [],
1061
+ "say": [],
1062
+ "sayHe": []
1063
+ },
1022
1064
  "art": {
1023
1065
  "preloader": [],
1024
1066
  "cover": [],
@@ -1150,6 +1192,12 @@ export const SPEC_BUSINESS_TYPES = [
1150
1192
  "column": {
1151
1193
  "never": []
1152
1194
  },
1195
+ "footer": {
1196
+ "closings": [],
1197
+ "grounds": [],
1198
+ "say": [],
1199
+ "sayHe": []
1200
+ },
1153
1201
  "art": {
1154
1202
  "preloader": [],
1155
1203
  "cover": [],
@@ -1283,6 +1331,21 @@ export const SPEC_BUSINESS_TYPES = [
1283
1331
  "wide"
1284
1332
  ]
1285
1333
  },
1334
+ "footer": {
1335
+ "closings": [
1336
+ "word"
1337
+ ],
1338
+ "grounds": [
1339
+ "scene",
1340
+ "film"
1341
+ ],
1342
+ "say": [
1343
+ "People who come for care or advice are closed plainly: no word shouted across the page, no layers or film under the footer."
1344
+ ],
1345
+ "sayHe": [
1346
+ "מי שמגיע לטיפול או לייעוץ נפרד בשקט: בלי מילה צועקת לרוחב העמוד, בלי שכבות או סרט מתחת לפוטר."
1347
+ ]
1348
+ },
1286
1349
  "art": {
1287
1350
  "preloader": [
1288
1351
  "counter",
@@ -1445,6 +1508,12 @@ export const SPEC_BUSINESS_TYPES = [
1445
1508
  "column": {
1446
1509
  "never": []
1447
1510
  },
1511
+ "footer": {
1512
+ "closings": [],
1513
+ "grounds": [],
1514
+ "say": [],
1515
+ "sayHe": []
1516
+ },
1448
1517
  "art": {
1449
1518
  "preloader": [
1450
1519
  "counter"
@@ -1582,6 +1651,12 @@ export const SPEC_BUSINESS_TYPES = [
1582
1651
  "column": {
1583
1652
  "never": []
1584
1653
  },
1654
+ "footer": {
1655
+ "closings": [],
1656
+ "grounds": [],
1657
+ "say": [],
1658
+ "sayHe": []
1659
+ },
1585
1660
  "art": {
1586
1661
  "preloader": [
1587
1662
  "counter"
@@ -1727,6 +1802,12 @@ export const SPEC_BUSINESS_TYPES = [
1727
1802
  "column": {
1728
1803
  "never": []
1729
1804
  },
1805
+ "footer": {
1806
+ "closings": [],
1807
+ "grounds": [],
1808
+ "say": [],
1809
+ "sayHe": []
1810
+ },
1730
1811
  "art": {
1731
1812
  "preloader": [
1732
1813
  "counter"
@@ -1879,6 +1960,21 @@ export const SPEC_BUSINESS_TYPES = [
1879
1960
  "wide"
1880
1961
  ]
1881
1962
  },
1963
+ "footer": {
1964
+ "closings": [
1965
+ "word"
1966
+ ],
1967
+ "grounds": [
1968
+ "scene",
1969
+ "film"
1970
+ ],
1971
+ "say": [
1972
+ "People who come for care or advice are closed plainly: no word shouted across the page, no layers or film under the footer."
1973
+ ],
1974
+ "sayHe": [
1975
+ "מי שמגיע לטיפול או לייעוץ נפרד בשקט: בלי מילה צועקת לרוחב העמוד, בלי שכבות או סרט מתחת לפוטר."
1976
+ ]
1977
+ },
1882
1978
  "art": {
1883
1979
  "preloader": [
1884
1980
  "mark",
@@ -2057,6 +2153,21 @@ export const SPEC_BUSINESS_TYPES = [
2057
2153
  "wide"
2058
2154
  ]
2059
2155
  },
2156
+ "footer": {
2157
+ "closings": [
2158
+ "word"
2159
+ ],
2160
+ "grounds": [
2161
+ "scene",
2162
+ "film"
2163
+ ],
2164
+ "say": [
2165
+ "People who come for care or advice are closed plainly: no word shouted across the page, no layers or film under the footer."
2166
+ ],
2167
+ "sayHe": [
2168
+ "מי שמגיע לטיפול או לייעוץ נפרד בשקט: בלי מילה צועקת לרוחב העמוד, בלי שכבות או סרט מתחת לפוטר."
2169
+ ]
2170
+ },
2060
2171
  "art": {
2061
2172
  "preloader": [
2062
2173
  "mark",
@@ -2230,6 +2341,21 @@ export const SPEC_BUSINESS_TYPES = [
2230
2341
  "wide"
2231
2342
  ]
2232
2343
  },
2344
+ "footer": {
2345
+ "closings": [
2346
+ "word"
2347
+ ],
2348
+ "grounds": [
2349
+ "scene",
2350
+ "film"
2351
+ ],
2352
+ "say": [
2353
+ "People who come for care or advice are closed plainly: no word shouted across the page, no layers or film under the footer."
2354
+ ],
2355
+ "sayHe": [
2356
+ "מי שמגיע לטיפול או לייעוץ נפרד בשקט: בלי מילה צועקת לרוחב העמוד, בלי שכבות או סרט מתחת לפוטר."
2357
+ ]
2358
+ },
2233
2359
  "art": {
2234
2360
  "preloader": [
2235
2361
  "mark",
@@ -2398,6 +2524,21 @@ export const SPEC_BUSINESS_TYPES = [
2398
2524
  "wide"
2399
2525
  ]
2400
2526
  },
2527
+ "footer": {
2528
+ "closings": [
2529
+ "word"
2530
+ ],
2531
+ "grounds": [
2532
+ "scene",
2533
+ "film"
2534
+ ],
2535
+ "say": [
2536
+ "People who come for care or advice are closed plainly: no word shouted across the page, no layers or film under the footer."
2537
+ ],
2538
+ "sayHe": [
2539
+ "מי שמגיע לטיפול או לייעוץ נפרד בשקט: בלי מילה צועקת לרוחב העמוד, בלי שכבות או סרט מתחת לפוטר."
2540
+ ]
2541
+ },
2401
2542
  "art": {
2402
2543
  "preloader": [
2403
2544
  "counter",
@@ -2538,6 +2679,12 @@ export const SPEC_BUSINESS_TYPES = [
2538
2679
  "column": {
2539
2680
  "never": []
2540
2681
  },
2682
+ "footer": {
2683
+ "closings": [],
2684
+ "grounds": [],
2685
+ "say": [],
2686
+ "sayHe": []
2687
+ },
2541
2688
  "art": {
2542
2689
  "preloader": [],
2543
2690
  "cover": [],
@@ -2677,6 +2824,12 @@ export const SPEC_BUSINESS_TYPES = [
2677
2824
  "column": {
2678
2825
  "never": []
2679
2826
  },
2827
+ "footer": {
2828
+ "closings": [],
2829
+ "grounds": [],
2830
+ "say": [],
2831
+ "sayHe": []
2832
+ },
2680
2833
  "art": {
2681
2834
  "preloader": [
2682
2835
  "counter"
@@ -2816,6 +2969,12 @@ export const SPEC_BUSINESS_TYPES = [
2816
2969
  "column": {
2817
2970
  "never": []
2818
2971
  },
2972
+ "footer": {
2973
+ "closings": [],
2974
+ "grounds": [],
2975
+ "say": [],
2976
+ "sayHe": []
2977
+ },
2819
2978
  "art": {
2820
2979
  "preloader": [],
2821
2980
  "cover": [],
@@ -2949,6 +3108,12 @@ export const SPEC_BUSINESS_TYPES = [
2949
3108
  "column": {
2950
3109
  "never": []
2951
3110
  },
3111
+ "footer": {
3112
+ "closings": [],
3113
+ "grounds": [],
3114
+ "say": [],
3115
+ "sayHe": []
3116
+ },
2952
3117
  "art": {
2953
3118
  "preloader": [],
2954
3119
  "cover": [],
@@ -3073,6 +3238,12 @@ export const SPEC_BUSINESS_TYPES = [
3073
3238
  "column": {
3074
3239
  "never": []
3075
3240
  },
3241
+ "footer": {
3242
+ "closings": [],
3243
+ "grounds": [],
3244
+ "say": [],
3245
+ "sayHe": []
3246
+ },
3076
3247
  "art": {
3077
3248
  "preloader": [
3078
3249
  "counter"
@@ -3205,6 +3376,12 @@ export const SPEC_BUSINESS_TYPES = [
3205
3376
  "column": {
3206
3377
  "never": []
3207
3378
  },
3379
+ "footer": {
3380
+ "closings": [],
3381
+ "grounds": [],
3382
+ "say": [],
3383
+ "sayHe": []
3384
+ },
3208
3385
  "art": {
3209
3386
  "preloader": [],
3210
3387
  "cover": [],
@@ -3343,6 +3520,21 @@ export const SPEC_BUSINESS_TYPES = [
3343
3520
  "wide"
3344
3521
  ]
3345
3522
  },
3523
+ "footer": {
3524
+ "closings": [
3525
+ "word"
3526
+ ],
3527
+ "grounds": [
3528
+ "scene",
3529
+ "film"
3530
+ ],
3531
+ "say": [
3532
+ "People who come for care or advice are closed plainly: no word shouted across the page, no layers or film under the footer."
3533
+ ],
3534
+ "sayHe": [
3535
+ "מי שמגיע לטיפול או לייעוץ נפרד בשקט: בלי מילה צועקת לרוחב העמוד, בלי שכבות או סרט מתחת לפוטר."
3536
+ ]
3537
+ },
3346
3538
  "art": {
3347
3539
  "preloader": [
3348
3540
  "counter",
@@ -3498,6 +3690,21 @@ export const SPEC_BUSINESS_TYPES = [
3498
3690
  "wide"
3499
3691
  ]
3500
3692
  },
3693
+ "footer": {
3694
+ "closings": [
3695
+ "word"
3696
+ ],
3697
+ "grounds": [
3698
+ "scene",
3699
+ "film"
3700
+ ],
3701
+ "say": [
3702
+ "People who come for care or advice are closed plainly: no word shouted across the page, no layers or film under the footer."
3703
+ ],
3704
+ "sayHe": [
3705
+ "מי שמגיע לטיפול או לייעוץ נפרד בשקט: בלי מילה צועקת לרוחב העמוד, בלי שכבות או סרט מתחת לפוטר."
3706
+ ]
3707
+ },
3501
3708
  "art": {
3502
3709
  "preloader": [
3503
3710
  "counter",
@@ -3651,6 +3858,21 @@ export const SPEC_BUSINESS_TYPES = [
3651
3858
  "wide"
3652
3859
  ]
3653
3860
  },
3861
+ "footer": {
3862
+ "closings": [
3863
+ "word"
3864
+ ],
3865
+ "grounds": [
3866
+ "scene",
3867
+ "film"
3868
+ ],
3869
+ "say": [
3870
+ "People who come for care or advice are closed plainly: no word shouted across the page, no layers or film under the footer."
3871
+ ],
3872
+ "sayHe": [
3873
+ "מי שמגיע לטיפול או לייעוץ נפרד בשקט: בלי מילה צועקת לרוחב העמוד, בלי שכבות או סרט מתחת לפוטר."
3874
+ ]
3875
+ },
3654
3876
  "art": {
3655
3877
  "preloader": [
3656
3878
  "mark",
@@ -3814,6 +4036,12 @@ export const SPEC_BUSINESS_TYPES = [
3814
4036
  "column": {
3815
4037
  "never": []
3816
4038
  },
4039
+ "footer": {
4040
+ "closings": [],
4041
+ "grounds": [],
4042
+ "say": [],
4043
+ "sayHe": []
4044
+ },
3817
4045
  "art": {
3818
4046
  "preloader": [
3819
4047
  "counter"
@@ -3966,6 +4194,21 @@ export const SPEC_BUSINESS_TYPES = [
3966
4194
  "wide"
3967
4195
  ]
3968
4196
  },
4197
+ "footer": {
4198
+ "closings": [
4199
+ "word"
4200
+ ],
4201
+ "grounds": [
4202
+ "scene",
4203
+ "film"
4204
+ ],
4205
+ "say": [
4206
+ "People who come for care or advice are closed plainly: no word shouted across the page, no layers or film under the footer."
4207
+ ],
4208
+ "sayHe": [
4209
+ "מי שמגיע לטיפול או לייעוץ נפרד בשקט: בלי מילה צועקת לרוחב העמוד, בלי שכבות או סרט מתחת לפוטר."
4210
+ ]
4211
+ },
3969
4212
  "art": {
3970
4213
  "preloader": [
3971
4214
  "counter",
@@ -4101,6 +4344,12 @@ export const SPEC_BUSINESS_TYPES = [
4101
4344
  "column": {
4102
4345
  "never": []
4103
4346
  },
4347
+ "footer": {
4348
+ "closings": [],
4349
+ "grounds": [],
4350
+ "say": [],
4351
+ "sayHe": []
4352
+ },
4104
4353
  "art": {
4105
4354
  "preloader": [],
4106
4355
  "cover": [],
@@ -4232,6 +4481,12 @@ export const SPEC_BUSINESS_TYPES = [
4232
4481
  "column": {
4233
4482
  "never": []
4234
4483
  },
4484
+ "footer": {
4485
+ "closings": [],
4486
+ "grounds": [],
4487
+ "say": [],
4488
+ "sayHe": []
4489
+ },
4235
4490
  "art": {
4236
4491
  "preloader": [],
4237
4492
  "cover": [],
@@ -4369,6 +4624,12 @@ export const SPEC_BUSINESS_TYPES = [
4369
4624
  "column": {
4370
4625
  "never": []
4371
4626
  },
4627
+ "footer": {
4628
+ "closings": [],
4629
+ "grounds": [],
4630
+ "say": [],
4631
+ "sayHe": []
4632
+ },
4372
4633
  "art": {
4373
4634
  "preloader": [
4374
4635
  "counter"
@@ -135,6 +135,8 @@ export enum SceneAttribute {
135
135
  PhoneTracks = 'data-iox-tracks-phone',
136
136
  /** A root's stage that is not a Scene's `scene.stage` part: the slider a scroll plays (premium M4). */
137
137
  Stage = 'data-iox-scene-stage',
138
+ /** On a layer whose hold move has ended — it has LANDED (AW10, `sceneLand`). Written by the driver, read by `onSceneLand`. */
139
+ Landed = 'data-iox-landed',
138
140
  }
139
141
 
140
142
  /**
@@ -110,15 +110,32 @@ function sliderOf(stage: HTMLElement | null): PlayedSlider | null {
110
110
  return swiper && typeof swiper.setProgress === 'function' && !swiper.destroyed ? swiper : null;
111
111
  }
112
112
 
113
+ /** The hold moves a layer travels by: they say where it lands. */
114
+ const LANDING_PROPS: ReadonlySet<SceneProp> = new Set([SceneProp.X, SceneProp.Y]);
115
+
113
116
  /**
114
- * Where a step that slides onto the stage has LANDED, as hold progress: the last key of its hold-range X track. A step with
115
- * no such move (the first drawer, a phone's stacked panels) is on the stage from the start: 0.
117
+ * Where a layer that travels onto the stage has LANDED, as hold progress: the last key of its hold-range X / Y move (the
118
+ * later, when it has both). A layer with no such move (the first drawer, a phone's stacked panels) is on the stage from the
119
+ * start: 0.
116
120
  */
117
121
  export function stepLanding(tracks: ReadonlyArray<SceneTrack>): number {
118
- const move = tracks.find(track => track.prop === SceneProp.X && isHoldTrack(track) && new Set(track.keys.map(([, value]) => value)).size > 1);
119
- return move ? move.keys[move.keys.length - 1][0] : 0;
122
+ return tracks
123
+ .filter(track => LANDING_PROPS.has(track.prop) && isHoldTrack(track) && new Set(track.keys.map(([, value]) => value)).size > 1)
124
+ .reduce((at, move) => Math.max(at, move.keys[move.keys.length - 1][0]), 0);
120
125
  }
121
126
 
127
+ /**
128
+ * AW10 (award plan "drawers" row): the trigger of an entrance played when its layer LANDS — the moment the Scene's progress
129
+ * reaches the last key of the layer's travel (`stepLanding`). Both interaction runtimes run it through `onSceneLand`.
130
+ */
131
+ export const SCENE_LAND_TRIGGER = 'sceneLand';
132
+ /** Dispatched (not bubbling) on a layer as it lands. Never a DOM `scroll` (SC2). */
133
+ export const SCENE_LAND_EVENT = 'iox-scene-land';
134
+ /** Progress short of a landing that still counts as landed: the damping settles onto the scroll, never past it. */
135
+ const LANDED_SLACK = 1e-4;
136
+ /** How much of an element must show before a word with no landing to wait for arrives (the runtimes' viewport entry). */
137
+ const ARRIVE_THRESHOLD = 0.1;
138
+
122
139
  /**
123
140
  * Where a Scene of steps (each covering the one before once it lands) must stand for step `index` to be in FRONT, or null
124
141
  * when it already is — or when no step moves (nothing covers anything; a phone stacks them). Step i is in front from its
@@ -344,6 +361,9 @@ interface Layer {
344
361
  /** Where it stands in its crossing (0–1), inline and block, as last read. */
345
362
  crossInline: number;
346
363
  crossBlock: number;
364
+ /** Where it lands at the Scene's width (`stepLanding`), 0 when it never travels there; and whether it has. */
365
+ landing: number;
366
+ landed: boolean;
347
367
  }
348
368
 
349
369
  interface Scene {
@@ -442,6 +462,7 @@ export class ScrollDriver {
442
462
  if (scene.stage) scene.stage.style.removeProperty('translate');
443
463
  for (const layer of scene.layers) {
444
464
  layer.el.style.removeProperty('will-change');
465
+ layer.el.removeAttribute(SceneAttribute.Landed);
445
466
  this.restoreWords(layer);
446
467
  this.stopPlayer(layer);
447
468
  }
@@ -622,6 +643,7 @@ export class ScrollDriver {
622
643
 
623
644
  private letGo(layer: Layer): void {
624
645
  layer.el.style.removeProperty('will-change');
646
+ layer.el.removeAttribute(SceneAttribute.Landed);
625
647
  for (const key of Object.keys(layer.last) as (keyof SceneFrame)[]) layer.el.style[key] = '';
626
648
  this.restoreWords(layer);
627
649
  this.stopPlayer(layer);
@@ -647,6 +669,7 @@ export class ScrollDriver {
647
669
  el, tracks, phoneTracks, last: previous?.last ?? {}, stale: true, words: previous?.words ?? null, wordsRefused: false,
648
670
  player: previous?.player ?? null, playerKey: previous?.playerKey ?? '',
649
671
  crosses: crossesStage(tracks) || crossesStage(phoneTracks), crossInline: previous?.crossInline ?? 0, crossBlock: previous?.crossBlock ?? 0,
672
+ landing: 0, landed: previous?.landed ?? false,
650
673
  };
651
674
  }
652
675
 
@@ -664,7 +687,10 @@ export class ScrollDriver {
664
687
  scene.stick = scene.stage ? (parseFloat(this.host.getComputedStyle(scene.stage).top) || 0) : 0;
665
688
  scene.phone = (scene.stage?.offsetWidth ?? Infinity) <= SCENE_PHONE_MAX_WIDTH;
666
689
  scene.inlineSign = scene.stage && this.host.getComputedStyle(scene.stage).direction === 'rtl' ? -1 : 1;
667
- for (const layer of scene.layers) layer.stale = true;
690
+ for (const layer of scene.layers) {
691
+ layer.stale = true;
692
+ layer.landing = stepLanding(this.tracksOf(scene, layer));
693
+ }
668
694
  }
669
695
 
670
696
  private readonly tick = (now: number): void => {
@@ -812,9 +838,35 @@ export class ScrollDriver {
812
838
  }
813
839
  layer.last = frame;
814
840
  layer.stale = false;
841
+ this.writeLanded(layer, scene.progress);
815
842
  }
816
843
  }
817
844
 
845
+ /**
846
+ * A layer that travels lands when what is on screen (the damped progress) reaches the end of its travel: it is marked,
847
+ * and told once (`SCENE_LAND_EVENT`) — its words arrive then (AW10). Back before its landing it is unmarked, so a later
848
+ * listener does not run for a layer the visitor scrolled back away from.
849
+ */
850
+ private writeLanded(layer: Layer, progress: number): void {
851
+ const landed = layer.landing > 0 && progress >= layer.landing - LANDED_SLACK;
852
+ if (landed === layer.landed) return;
853
+ layer.landed = landed;
854
+ if (!landed) {
855
+ layer.el.removeAttribute(SceneAttribute.Landed);
856
+ return;
857
+ }
858
+ layer.el.setAttribute(SceneAttribute.Landed, '');
859
+ const Event = (this.host as Window & { CustomEvent?: typeof CustomEvent }).CustomEvent ?? CustomEvent;
860
+ layer.el.dispatchEvent(new Event(SCENE_LAND_EVENT));
861
+ }
862
+
863
+ /** True when this driver tells `layer` it has landed: it holds its Scene and the layer travels at this width. */
864
+ landsOnScroll(layer: HTMLElement): boolean {
865
+ const root = layer.closest<HTMLElement>(`[${SceneAttribute.Root}]`);
866
+ const scene = root ? this.scenes.get(root) : undefined;
867
+ return !!scene?.layers.find(l => l.el === layer && l.landing > 0);
868
+ }
869
+
818
870
  /**
819
871
  * The picture this moment asks for. The attribute sits on the Video's own root, which is the layer on the string path
820
872
  * and inside it on the component path. A layer with no pictures, or no Play track, holds its poster.
@@ -901,3 +953,67 @@ export function attachSceneRoots(roots: ReadonlyArray<HTMLElement>, options: Scr
901
953
  driver.destroy();
902
954
  return null;
903
955
  }
956
+
957
+ /** The layer `el` travels onto the stage with: the nearest one (itself or above it, inside its Scene) whose wide tracks
958
+ * land (`stepLanding` > 0). Null when nothing carries it in. */
959
+ export function travellingLayerOf(el: HTMLElement): HTMLElement | null {
960
+ for (let node: HTMLElement | null = el; node; node = node.parentElement) {
961
+ if (node.hasAttribute(SceneAttribute.Root)) return null;
962
+ if (node.hasAttribute(SceneAttribute.Tracks) && stepLanding(parseTracks(node.getAttribute(SceneAttribute.Tracks))) > 0) return node;
963
+ }
964
+ return null;
965
+ }
966
+
967
+ /** The driver that tells `layer` it has landed, at this width — null when none plays its travel (reduced motion, a phone). */
968
+ function landingDriverOf(layer: HTMLElement): ScrollDriver | null {
969
+ const root = layer.closest<HTMLElement>(`[${SceneAttribute.Root}]`);
970
+ const driver = root ? HELD.get(root) : undefined;
971
+ return driver?.landsOnScroll(layer) ? driver : null;
972
+ }
973
+
974
+ /**
975
+ * Run `run` ONCE when `el`'s words are to arrive (AW10, `SCENE_LAND_TRIGGER`): as the layer that carries it onto the stage
976
+ * LANDS (`SCENE_LAND_EVENT`; at once when it already has), wherever a driver plays that travel. Where none does — the layer
977
+ * does not travel at this width (a phone's stacked Scene), the visitor asked for less motion (no driver; the Scene flows),
978
+ * nothing carries it (the first drawer, a node outside a Scene) — it arrives as it comes into view, as a viewport entrance
979
+ * does. Focus reaching it first makes it arrive at once. Both interaction runtimes call this. Returns the way to let go.
980
+ */
981
+ export function onSceneLand(el: HTMLElement, run: () => void, host: Window = window): () => void {
982
+ let done = false;
983
+ const offs: Array<() => void> = [];
984
+ const letGo = (): void => { offs.splice(0).forEach(off => off()); };
985
+ const go = (): void => {
986
+ if (done) return;
987
+ done = true;
988
+ letGo();
989
+ run();
990
+ };
991
+ const layer = travellingLayerOf(el);
992
+ // A keyboard that reaches it first never focuses something still waiting to arrive (WCAG 2.4.7): it arrives now.
993
+ const focused = (): void => go();
994
+ el.addEventListener('focusin', focused);
995
+ offs.push(() => el.removeEventListener('focusin', focused));
996
+ if (layer) {
997
+ const heard = (): void => go();
998
+ layer.addEventListener(SCENE_LAND_EVENT, heard);
999
+ offs.push(() => layer.removeEventListener(SCENE_LAND_EVENT, heard));
1000
+ }
1001
+ const Observer = (host as Window & { IntersectionObserver?: typeof IntersectionObserver }).IntersectionObserver;
1002
+ if (Observer) {
1003
+ const io = new Observer(entries => {
1004
+ // Where a driver plays the travel it decides; the viewport only stands in where none does.
1005
+ if (entries.some(entry => entry.isIntersecting) && !(layer && landingDriverOf(layer))) go();
1006
+ }, { threshold: ARRIVE_THRESHOLD });
1007
+ io.observe(el);
1008
+ offs.push(() => io.disconnect());
1009
+ } else {
1010
+ // No observer to ask (an old browser): it stands in place on the next frame unless a driver will land it.
1011
+ const frame = host.requestAnimationFrame?.(() => { if (!(layer && landingDriverOf(layer))) go(); });
1012
+ if (frame) offs.push(() => host.cancelAnimationFrame?.(frame));
1013
+ }
1014
+ if (layer?.hasAttribute(SceneAttribute.Landed)) go();
1015
+ return () => {
1016
+ done = true;
1017
+ letGo();
1018
+ };
1019
+ }
@@ -262,8 +262,20 @@ const STAGGER_MS: Readonly<Record<TextRevealBy, number>> = {
262
262
  [TextRevealBy.Letter]: LETTER_STAGGER_MS,
263
263
  };
264
264
 
265
- export function revealStagger(groups: number, by: TextRevealBy): number {
266
- return groups > 1 ? Math.min(STAGGER_MS[by], STAGGER_BUDGET_MS / (groups - 1)) : 0;
265
+ /** The most a reveal may ask between two pieces (`params.stagger`): past it a heading is spelled out, not assembled. */
266
+ export const REVEAL_STAGGER_MAX_MS = 300;
267
+
268
+ /**
269
+ * A reveal's own step between pieces, in ms (`params.stagger`; AW10 — a drawer's letters ~20 ms, its lines ~150 ms), or
270
+ * undefined for the step its kind of piece takes. Clamped to 0–`REVEAL_STAGGER_MAX_MS`; anything not a number is undefined.
271
+ */
272
+ export function textRevealStaggerOf(value: unknown): number | undefined {
273
+ const ms = typeof value === 'number' ? value : typeof value === 'string' && value.trim() ? Number(value) : NaN;
274
+ return Number.isFinite(ms) ? Math.min(REVEAL_STAGGER_MAX_MS, Math.max(0, Math.round(ms))) : undefined;
275
+ }
276
+
277
+ export function revealStagger(groups: number, by: TextRevealBy, stagger?: number): number {
278
+ return groups > 1 ? Math.min(stagger ?? STAGGER_MS[by], STAGGER_BUDGET_MS / (groups - 1)) : 0;
267
279
  }
268
280
 
269
281
  /** Past the mask's negative inset, so nothing shows before a piece's turn. */
@@ -308,12 +320,13 @@ const playing = new WeakMap<HTMLElement, Animation>();
308
320
  * nothing to re-split on a resize. Null when there is nothing to split or it is being edited: the caller plays its plain
309
321
  * fade.
310
322
  */
311
- export function playTextReveal(el: HTMLElement, by: TextRevealBy, timing: KeyframeAnimationOptions, look: TextRevealLook = TextRevealLook.Rise): Animation | null {
323
+ export function playTextReveal(el: HTMLElement, by: TextRevealBy, timing: KeyframeAnimationOptions, look: TextRevealLook = TextRevealLook.Rise, stagger?: number): Animation | null {
312
324
  playing.get(el)?.cancel();
313
325
  const planned = splitForReveal(el, by, look);
314
326
  if (!planned) return null;
315
327
  const { split, order, groups } = planned;
316
- const step = revealStagger(groups, planned.by);
328
+ // An asked step is for the pieces it asked for: a letter step on a text that fell to words takes the words' own.
329
+ const step = revealStagger(groups, planned.by, planned.by === by ? stagger : undefined);
317
330
  const duration = Number(timing.duration) || DEFAULT_PIECE_MS;
318
331
  const delay = timing.delay ?? 0;
319
332
  const frames = look === TextRevealLook.Light ? LIGHT_FRAMES : PIECE_FRAMES;