@vectoriox/iox-ui 5.88.0 → 5.90.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 (49) hide show
  1. package/design-core/index.d.ts +523 -2
  2. package/fesm2022/vectoriox-iox-ui-composite-core.mjs +3 -2
  3. package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
  4. package/fesm2022/vectoriox-iox-ui-design-core.mjs +581 -1
  5. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  6. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +4692 -160
  7. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  8. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +12 -1
  9. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
  10. package/fesm2022/vectoriox-iox-ui-scene-core.mjs +46 -6
  11. package/fesm2022/vectoriox-iox-ui-scene-core.mjs.map +1 -1
  12. package/fesm2022/vectoriox-iox-ui.mjs +6 -4
  13. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  14. package/generation-core/index.d.ts +1611 -10
  15. package/harness-core/index.d.ts +52 -3
  16. package/package.json +1 -1
  17. package/scene-core/index.d.ts +28 -2
  18. package/src/composite-core/slider.ts +3 -2
  19. package/src/design-core/flavor-spec.generated.ts +500 -0
  20. package/src/design-core/font-metrics.ts +105 -0
  21. package/src/design-core/public-api.ts +1 -0
  22. package/src/generation-core/ai-run.ts +11 -0
  23. package/src/generation-core/audit-site.ts +5 -0
  24. package/src/generation-core/check-layout.ts +940 -0
  25. package/src/generation-core/compose-layout.ts +907 -0
  26. package/src/generation-core/compose-site.ts +136 -5
  27. package/src/generation-core/layout-drift.ts +78 -0
  28. package/src/generation-core/layout-edits.ts +122 -0
  29. package/src/generation-core/layout-fingerprint.ts +203 -0
  30. package/src/generation-core/layout-language.ts +537 -0
  31. package/src/generation-core/layout-look.ts +57 -0
  32. package/src/generation-core/layout-photos.ts +19 -0
  33. package/src/generation-core/layout-render-check.ts +275 -0
  34. package/src/generation-core/layout-section-fallback.ts +156 -0
  35. package/src/generation-core/layout-type.ts +48 -0
  36. package/src/generation-core/layout-wire.ts +282 -0
  37. package/src/generation-core/nav-shape.ts +23 -1
  38. package/src/generation-core/photo-inventory.ts +250 -0
  39. package/src/generation-core/plan-edits.ts +25 -2
  40. package/src/generation-core/plan-wire.ts +19 -2
  41. package/src/generation-core/public-api.ts +13 -0
  42. package/src/generation-core/site-plan.model.ts +16 -0
  43. package/src/generation-core/site-spec.generated.ts +759 -2
  44. package/src/generation-core/validate-site-plan.ts +55 -1
  45. package/src/harness-core/generation-view.ts +52 -1
  46. package/src/scene-core/scroll-driver.ts +14 -2
  47. package/src/scene-core/scroll-range.ts +37 -4
  48. package/styles/iox-design.css +17 -0
  49. package/styles/iox-forms.css +4 -0
@@ -708,6 +708,17 @@ const PARALLAX_DEPTH_DEFAULT = ParallaxDepth.Back;
708
708
  const PARALLAX_SPEED = 0.3;
709
709
  /** A phone's layers move half as far: on a narrow stack a glide reaches the next block sooner (round three's phone rule). */
710
710
  const PARALLAX_PHONE_FACTOR = 0.5;
711
+ /** What a depth does on a phone (its action's `params.phone`). */
712
+ var ParallaxPhone;
713
+ (function (ParallaxPhone) {
714
+ /** Half as far (round three's phone rule; a depth with no `phone` param). */
715
+ ParallaxPhone["Half"] = "half";
716
+ /** Still: a layer that stacks with its neighbours on a phone never glides into them (round four, CL2 layers). */
717
+ ParallaxPhone["Rest"] = "rest";
718
+ })(ParallaxPhone || (ParallaxPhone = {}));
719
+ function normalizeParallaxPhone(value) {
720
+ return value === ParallaxPhone.Rest ? ParallaxPhone.Rest : ParallaxPhone.Half;
721
+ }
711
722
  function normalizeParallaxDepth(value) {
712
723
  return value === ParallaxDepth.Front ? ParallaxDepth.Front : PARALLAX_DEPTH_DEFAULT;
713
724
  }
@@ -717,15 +728,34 @@ function normalizeParallaxDepth(value) {
717
728
  * a tall layer never slides a screen away from what it belongs to.
718
729
  */
719
730
  function parallaxShift(distance, viewHeight, options = {}) {
731
+ if (options.phone && options.onPhone === ParallaxPhone.Rest)
732
+ return 0;
720
733
  const speed = PARALLAX_SPEED * (options.phone ? PARALLAX_PHONE_FACTOR : 1);
721
734
  const shift = speed * Math.min(Math.max(0, distance) / 2, Math.max(0, viewHeight));
722
735
  return Math.round(shift * 10) / 10;
723
736
  }
737
+ /** Halfway through its range: where a depth stands in its place when the page opens with it out of sight. */
738
+ const PARALLAX_REST_DEFAULT = 0.5;
739
+ /**
740
+ * Where in its range a depth stands exactly in its place (iox-ui#65). A layer the page opens with on screen rests where it
741
+ * stands then — `opening`, its progress at the page's top — so the first screen is drawn as it was laid out and the glide
742
+ * starts with the scroll; one out of sight rests halfway. (Resting halfway, a hero paragraph at 664 of a 900px screen
743
+ * stood 74px low at the top of the page and ran under its buttons.)
744
+ */
745
+ function parallaxRest(opening) {
746
+ return opening > 0 && opening < 1 ? Math.round(opening * 1000) / 1000 : PARALLAX_REST_DEFAULT;
747
+ }
748
+ /** How far a depth stands off its place at `progress` through its range, in px (down is positive): 0 at `rest`, moving
749
+ * at the same speed as ever — `shift` each way of a half range. */
750
+ function parallaxOffset(depth, shift, progress, rest = PARALLAX_REST_DEFAULT) {
751
+ const sign = depth === ParallaxDepth.Front ? -1 : 1;
752
+ return 2 * sign * shift * (progress - rest);
753
+ }
724
754
  /** The frames of a parallax depth over its range: the individual `translate` property, so the element's own `transform`
725
755
  * (a hover lift, an entrance) is never overwritten. */
726
- function parallaxFrames(depth, shift) {
727
- const sign = depth === ParallaxDepth.Front ? -1 : 1;
728
- return [{ translate: `0 ${-sign * shift}px` }, { translate: `0 ${sign * shift}px` }];
756
+ function parallaxFrames(depth, shift, rest = PARALLAX_REST_DEFAULT) {
757
+ const px = (v) => `0 ${Math.round(v * 10) / 10 || 0}px`;
758
+ return [{ translate: px(parallaxOffset(depth, shift, 0, rest)) }, { translate: px(parallaxOffset(depth, shift, 1, rest)) }];
729
759
  }
730
760
  /** A bar that fills along the reading direction: the individual `scale` property, from its reading start (iox-design.css). */
731
761
  const PROGRESS_BAR_FRAMES = Object.freeze([{ scale: '0 1' }, { scale: '1 1' }]);
@@ -1167,7 +1197,7 @@ class ScrollDriver {
1167
1197
  * frame exactly where the scroll is, with no glide.
1168
1198
  */
1169
1199
  addLink(link) {
1170
- const state = { link, progress: 0, target: 0, fresh: true, geometry: { distance: 0, viewHeight: 0 } };
1200
+ const state = { link, progress: 0, target: 0, fresh: true, geometry: { distance: 0, viewHeight: 0, opening: 0 } };
1171
1201
  this.links.add(state);
1172
1202
  this.wake();
1173
1203
  return () => { this.links.delete(state); };
@@ -1255,9 +1285,19 @@ class ScrollDriver {
1255
1285
  const { box, zoom } = layoutBoxOnScreen(state.link.measured, state.link.within ?? null);
1256
1286
  const z = zoom || 1;
1257
1287
  const target = rangeProgress(state.link.range, box, view);
1258
- state.geometry = { distance: rangeDistance(state.link.range, box, view) / z, viewHeight: view.height / z };
1288
+ state.geometry = { distance: rangeDistance(state.link.range, box, view) / z, viewHeight: view.height / z, opening: this.openingOf(state.link, box, view) };
1259
1289
  return { state, target };
1260
1290
  }
1291
+ /** The link's progress with its page scrolled to the top: the page's top on the view's, the element where it stands in it. */
1292
+ openingOf(link, box, view) {
1293
+ if (link.range === ScrollRange.Page)
1294
+ return 0;
1295
+ const page = link.within ?? link.measured.ownerDocument?.documentElement ?? null;
1296
+ if (!page)
1297
+ return 0;
1298
+ const top = page.getBoundingClientRect().top;
1299
+ return rangeProgress(link.range, { top: view.top + (box.top - top), height: box.height }, view);
1300
+ }
1261
1301
  read(scene) {
1262
1302
  const rect = scene.root.getBoundingClientRect();
1263
1303
  const origin = this.options.originOf?.(scene.root)?.getBoundingClientRect().top ?? 0;
@@ -1393,5 +1433,5 @@ function attachSceneRoots(roots, options = {}) {
1393
1433
  * Generated bundle index. Do not edit.
1394
1434
  */
1395
1435
 
1396
- export { LIGHT_UP_PIECE_CAP, PARALLAX_DEPTH_DEFAULT, PARALLAX_PHONE_FACTOR, PARALLAX_SPEED, PROGRESS_BAR_FRAMES, ParallaxDepth, REVEAL_PIECE_CAP, SCENE_BUDGET, SCENE_DAMPING, SCENE_FILM_SMOOTH, SCENE_FLOW_RULES, SCENE_LENGTH, SCENE_MAX_SCREENS, SCENE_MIN_SCREENS, SCENE_PHONE_LENGTH, SCENE_PHONE_MAX_WIDTH, SCENE_REDUCED_MOTION_CSS, SCENE_REVEAL_DEFAULT, SCENE_STAGE_HEIGHT, SCENE_TRACK_DEFS, SCENE_WAKE_EVENT, SCENE_WORDS, SCENE_WORD_DIM, SCROLL_RANGE_DEFAULT, SLIDER_HOLD_SHARE, SLIDER_SCROLL_STEP_SCREENS, SceneAttribute, SceneProp, SceneRevealFrom, ScrollActionKind, ScrollDriver, ScrollPlay, ScrollRange, TextRevealBy, applySceneFirstFrame, attachSceneRoots, attachScenes, buildSceneRecipe, colourAt, dampToward, gentleFrames, heldProgress, layoutBoxOnScreen, lightMotionWanted, lineIndexes, movedSceneKey, normalizeParallaxDepth, normalizeScrollRange, normalizeTracks, outermostNodeOf, parallaxFrames, parallaxShift, playTextReveal, rangeDistance, rangeEnds, rangeProgress, revealClipPath, revealStagger, sceneBudget, sceneColourKeyAt, sceneDisplayValue, sceneFilmDensity, sceneFirstFrame, sceneFrame, sceneFrameDeclarations, sceneHasKeyAt, sceneHeightForScreens, sceneKeyPosition, sceneLayersOf, sceneNodeAttributes, scenePlayed, sceneRevealFromOf, sceneRootOnPath, sceneRootsIn, sceneScreensOf, sceneScrollState, sceneTrackDef, sceneTrackSpan, sceneWordOpacity, sceneWordsLit, scenesIn, scrollPlayFor, splitText, syncSceneAttributes, textPieces, valueAt, withSceneKey, withScenePlayback, withSceneRevealFrom, withoutSceneKey, withoutScenePlayback };
1436
+ export { LIGHT_UP_PIECE_CAP, PARALLAX_DEPTH_DEFAULT, PARALLAX_PHONE_FACTOR, PARALLAX_REST_DEFAULT, PARALLAX_SPEED, PROGRESS_BAR_FRAMES, ParallaxDepth, ParallaxPhone, REVEAL_PIECE_CAP, SCENE_BUDGET, SCENE_DAMPING, SCENE_FILM_SMOOTH, SCENE_FLOW_RULES, SCENE_LENGTH, SCENE_MAX_SCREENS, SCENE_MIN_SCREENS, SCENE_PHONE_LENGTH, SCENE_PHONE_MAX_WIDTH, SCENE_REDUCED_MOTION_CSS, SCENE_REVEAL_DEFAULT, SCENE_STAGE_HEIGHT, SCENE_TRACK_DEFS, SCENE_WAKE_EVENT, SCENE_WORDS, SCENE_WORD_DIM, SCROLL_RANGE_DEFAULT, SLIDER_HOLD_SHARE, SLIDER_SCROLL_STEP_SCREENS, SceneAttribute, SceneProp, SceneRevealFrom, ScrollActionKind, ScrollDriver, ScrollPlay, ScrollRange, TextRevealBy, applySceneFirstFrame, attachSceneRoots, attachScenes, buildSceneRecipe, colourAt, dampToward, gentleFrames, heldProgress, layoutBoxOnScreen, lightMotionWanted, lineIndexes, movedSceneKey, normalizeParallaxDepth, normalizeParallaxPhone, normalizeScrollRange, normalizeTracks, outermostNodeOf, parallaxFrames, parallaxOffset, parallaxRest, parallaxShift, playTextReveal, rangeDistance, rangeEnds, rangeProgress, revealClipPath, revealStagger, sceneBudget, sceneColourKeyAt, sceneDisplayValue, sceneFilmDensity, sceneFirstFrame, sceneFrame, sceneFrameDeclarations, sceneHasKeyAt, sceneHeightForScreens, sceneKeyPosition, sceneLayersOf, sceneNodeAttributes, scenePlayed, sceneRevealFromOf, sceneRootOnPath, sceneRootsIn, sceneScreensOf, sceneScrollState, sceneTrackDef, sceneTrackSpan, sceneWordOpacity, sceneWordsLit, scenesIn, scrollPlayFor, splitText, syncSceneAttributes, textPieces, valueAt, withSceneKey, withScenePlayback, withSceneRevealFrom, withoutSceneKey, withoutScenePlayback };
1397
1437
  //# sourceMappingURL=vectoriox-iox-ui-scene-core.mjs.map