@wardic/dom 1.3.1 → 1.4.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 (143) hide show
  1. package/dist/MeasuredPair.d.ts +14 -1
  2. package/dist/MeasuredPair.d.ts.map +1 -1
  3. package/dist/MeasuredPair.js +11 -13
  4. package/dist/MeasuredPair.js.map +1 -1
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +5 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/internal/appear.d.ts +6 -0
  10. package/dist/internal/appear.d.ts.map +1 -1
  11. package/dist/internal/appear.js +20 -2
  12. package/dist/internal/appear.js.map +1 -1
  13. package/dist/internal/batch-handoff.d.ts.map +1 -1
  14. package/dist/internal/batch-handoff.js +25 -15
  15. package/dist/internal/batch-handoff.js.map +1 -1
  16. package/dist/internal/batch-writer.d.ts +1 -1
  17. package/dist/internal/batch-writer.d.ts.map +1 -1
  18. package/dist/internal/batch-writer.js +32 -16
  19. package/dist/internal/batch-writer.js.map +1 -1
  20. package/dist/internal/clock.d.ts +6 -0
  21. package/dist/internal/clock.d.ts.map +1 -1
  22. package/dist/internal/clock.js +27 -0
  23. package/dist/internal/clock.js.map +1 -1
  24. package/dist/internal/default-transition.d.ts +3 -2
  25. package/dist/internal/default-transition.d.ts.map +1 -1
  26. package/dist/internal/default-transition.js +28 -3
  27. package/dist/internal/default-transition.js.map +1 -1
  28. package/dist/internal/failing.d.ts +9 -0
  29. package/dist/internal/failing.d.ts.map +1 -0
  30. package/dist/internal/failing.js +33 -0
  31. package/dist/internal/failing.js.map +1 -0
  32. package/dist/internal/length-keys.d.ts +19 -0
  33. package/dist/internal/length-keys.d.ts.map +1 -0
  34. package/dist/internal/length-keys.js +77 -0
  35. package/dist/internal/length-keys.js.map +1 -0
  36. package/dist/internal/measured-pairs.d.ts +3 -2
  37. package/dist/internal/measured-pairs.d.ts.map +1 -1
  38. package/dist/internal/measured-pairs.js +60 -23
  39. package/dist/internal/measured-pairs.js.map +1 -1
  40. package/dist/internal/own-values.d.ts.map +1 -1
  41. package/dist/internal/own-values.js +2 -2
  42. package/dist/internal/own-values.js.map +1 -1
  43. package/dist/internal/positional-keys.d.ts +1 -1
  44. package/dist/internal/positional-keys.d.ts.map +1 -1
  45. package/dist/internal/positional-keys.js +4 -2
  46. package/dist/internal/positional-keys.js.map +1 -1
  47. package/dist/internal/projection.d.ts.map +1 -1
  48. package/dist/internal/projection.js +180 -46
  49. package/dist/internal/projection.js.map +1 -1
  50. package/dist/internal/renderer.d.ts +59 -27
  51. package/dist/internal/renderer.d.ts.map +1 -1
  52. package/dist/internal/renderer.js +241 -207
  53. package/dist/internal/renderer.js.map +1 -1
  54. package/dist/internal/scroll.d.ts.map +1 -1
  55. package/dist/internal/scroll.js +26 -2
  56. package/dist/internal/scroll.js.map +1 -1
  57. package/dist/internal/starting-style.js +5 -5
  58. package/dist/internal/transform-keys.d.ts +23 -0
  59. package/dist/internal/transform-keys.d.ts.map +1 -0
  60. package/dist/internal/transform-keys.js +55 -0
  61. package/dist/internal/transform-keys.js.map +1 -0
  62. package/dist/unstable/AppearAnimations.d.ts +2 -1
  63. package/dist/unstable/AppearAnimations.d.ts.map +1 -1
  64. package/dist/unstable/AppearAnimations.js +73 -22
  65. package/dist/unstable/AppearAnimations.js.map +1 -1
  66. package/dist/unstable/BatchMembers.d.ts +2 -2
  67. package/dist/unstable/BatchMembers.d.ts.map +1 -1
  68. package/dist/unstable/BatchMembers.js +30 -7
  69. package/dist/unstable/BatchMembers.js.map +1 -1
  70. package/dist/unstable/DomValues.js +1 -1
  71. package/dist/unstable/DomValues.js.map +1 -1
  72. package/dist/unstable/DragTrack.d.ts +2 -2
  73. package/dist/unstable/DragTrack.d.ts.map +1 -1
  74. package/dist/unstable/DragTrack.js +37 -10
  75. package/dist/unstable/DragTrack.js.map +1 -1
  76. package/dist/unstable/ElementSetup.d.ts.map +1 -1
  77. package/dist/unstable/ElementSetup.js +3 -2
  78. package/dist/unstable/ElementSetup.js.map +1 -1
  79. package/dist/unstable/GestureFeatures.d.ts +8 -2
  80. package/dist/unstable/GestureFeatures.d.ts.map +1 -1
  81. package/dist/unstable/GestureFeatures.js +26 -40
  82. package/dist/unstable/GestureFeatures.js.map +1 -1
  83. package/dist/unstable/GestureInfo.d.ts +11 -0
  84. package/dist/unstable/GestureInfo.d.ts.map +1 -1
  85. package/dist/unstable/GestureInfo.js +8 -0
  86. package/dist/unstable/GestureInfo.js.map +1 -1
  87. package/dist/unstable/Imperative.d.ts +1 -1
  88. package/dist/unstable/Imperative.d.ts.map +1 -1
  89. package/dist/unstable/Imperative.js.map +1 -1
  90. package/dist/unstable/LiveStyle.d.ts +28 -2
  91. package/dist/unstable/LiveStyle.d.ts.map +1 -1
  92. package/dist/unstable/LiveStyle.js +8 -32
  93. package/dist/unstable/LiveStyle.js.map +1 -1
  94. package/dist/unstable/MemberHold.js +3 -3
  95. package/dist/unstable/MemberHold.js.map +1 -1
  96. package/dist/unstable/PointerValues.d.ts.map +1 -1
  97. package/dist/unstable/PointerValues.js +82 -8
  98. package/dist/unstable/PointerValues.js.map +1 -1
  99. package/dist/unstable/PresenceController.d.ts +5 -2
  100. package/dist/unstable/PresenceController.d.ts.map +1 -1
  101. package/dist/unstable/PresenceController.js +82 -55
  102. package/dist/unstable/PresenceController.js.map +1 -1
  103. package/dist/unstable/ReorderInput.d.ts +2 -2
  104. package/dist/unstable/ReorderInput.js +2 -2
  105. package/dist/unstable/WardConfig.d.ts +18 -9
  106. package/dist/unstable/WardConfig.d.ts.map +1 -1
  107. package/dist/unstable/WardConfig.js.map +1 -1
  108. package/dist/unstable/features/TimelineKeys.d.ts.map +1 -1
  109. package/dist/unstable/features/TimelineKeys.js +19 -3
  110. package/dist/unstable/features/TimelineKeys.js.map +1 -1
  111. package/package.json +3 -3
  112. package/src/MeasuredPair.ts +21 -1
  113. package/src/index.ts +4 -1
  114. package/src/internal/appear.ts +20 -2
  115. package/src/internal/batch-handoff.ts +19 -11
  116. package/src/internal/batch-writer.ts +32 -16
  117. package/src/internal/clock.ts +28 -0
  118. package/src/internal/default-transition.ts +28 -4
  119. package/src/internal/failing.ts +37 -0
  120. package/src/internal/length-keys.ts +80 -0
  121. package/src/internal/measured-pairs.ts +58 -22
  122. package/src/internal/own-values.ts +2 -2
  123. package/src/internal/positional-keys.ts +4 -2
  124. package/src/internal/projection.ts +190 -44
  125. package/src/internal/renderer.ts +272 -198
  126. package/src/internal/scroll.ts +24 -2
  127. package/src/internal/starting-style.ts +5 -5
  128. package/src/internal/transform-keys.ts +59 -0
  129. package/src/unstable/AppearAnimations.ts +73 -24
  130. package/src/unstable/BatchMembers.ts +33 -9
  131. package/src/unstable/DomValues.ts +1 -1
  132. package/src/unstable/DragTrack.ts +49 -14
  133. package/src/unstable/ElementSetup.ts +3 -2
  134. package/src/unstable/GestureFeatures.ts +38 -47
  135. package/src/unstable/GestureInfo.ts +24 -0
  136. package/src/unstable/Imperative.ts +1 -0
  137. package/src/unstable/LiveStyle.ts +12 -8
  138. package/src/unstable/MemberHold.ts +3 -3
  139. package/src/unstable/PointerValues.ts +73 -8
  140. package/src/unstable/PresenceController.ts +80 -54
  141. package/src/unstable/ReorderInput.ts +2 -2
  142. package/src/unstable/WardConfig.ts +22 -10
  143. package/src/unstable/features/TimelineKeys.ts +20 -3
@@ -3,35 +3,47 @@ import * as Bool from "effect/Boolean";
3
3
  import * as Option from "effect/Option";
4
4
  import * as Predicate from "effect/Predicate";
5
5
  import * as Result from "effect/Result";
6
- import { TRANSFORM_FUNCS, unitOf } from "./renderer.js";
7
- /** The transform functions a member draws: the renderer's, less a path's turn, which an arc's element draws (#438). */
6
+ import { DEPTH_FUNC, TRANSFORM_FUNCS } from "./renderer.js";
7
+ import * as TransformKeys from "./transform-keys.js";
8
+ /**
9
+ * The transform functions a member draws, each with what goes either side of its value and its identity: the
10
+ * renderer's, less a path's turn, which an arc's element draws (#438). What `forKeys` and `styleOf` draw.
11
+ */
8
12
  const FUNCS = Arr.filter(TRANSFORM_FUNCS, (func) => func.key !== "pathRotation");
9
13
  /** The keys the DOM's writer draws: those transform keys and `opacity`. */
10
14
  const DRAWS = new Set([...Arr.map(FUNCS, (func) => func.key), "opacity"]);
11
- /** Each transform function's key, what goes either side of its value, and its identity, in the renderer's order: what `forKeys` and `styleOf` draw. */
12
- const FUNC_PARTS = Arr.map(FUNCS, (func) => ({
13
- key: func.key,
14
- open: `${func.fn}(`,
15
- close: `${unitOf(func.key)})`,
16
- identity: func.identity,
17
- }));
15
+ /** What a member's write walks: every part but the element's own depth, which it writes ahead of them. */
16
+ // #887 (ADR-0073, *Amendment (#887)*, Q8), as the renderer's walk.
17
+ const WALKED_PARTS = Arr.filter(FUNCS, (part) => part.key !== TransformKeys.PERSPECTIVE);
18
+ /** What goes either side of a member's own depth in its write. */
19
+ const DEPTH_OPEN = DEPTH_FUNC.open;
20
+ const DEPTH_CLOSE = DEPTH_FUNC.close;
18
21
  /** A Batch's write, for its keys in their order: built once, when the Batch is made. */
19
22
  const forKeys = (keys) => {
20
- const parts = Arr.filterMap(FUNC_PARTS, (part) => Option.match(Arr.findFirstIndex(keys, (key) => key === part.key), {
23
+ const parts = Arr.filterMap(WALKED_PARTS, (part) => Option.match(Arr.findFirstIndex(keys, (key) => key === part.key), {
21
24
  onNone: () => Result.failVoid,
22
25
  onSome: (k) => Result.succeed({ k, open: part.open, close: part.close, identity: part.identity }),
23
26
  }));
24
27
  const count = parts.length;
25
28
  // Its index for the per-frame write, or -1 for none: a plain read there (ADR-0025, the per-frame path).
26
29
  const opacityAt = Option.getOrElse(Arr.findFirstIndex(keys, (key) => key === "opacity"), () => -1);
27
- // Per frame, per moving member (ADR-0025, *Amendment (#69)*): a counted loop over its transform
28
- // functions in the renderer's order, each left out at its identity, the string built by concatenation
29
- // as the renderer's is (ADR-0034); `none` when every one is at its identity (ADR-0023).
30
+ const depthAt = Option.getOrElse(Arr.findFirstIndex(keys, (key) => key === TransformKeys.PERSPECTIVE), () => -1);
31
+ const writesTransform = Bool.or(count > 0, depthAt !== -1);
32
+ // Per frame, per moving member (ADR-0025, *Amendment (#69)*): its own depth first, then a counted loop
33
+ // over its transform functions in the renderer's order, each left out at its identity, the string built
34
+ // by concatenation as the renderer's is (ADR-0034); `none` when every one is left out (ADR-0023).
30
35
  return (el, positions, base) => {
31
36
  const style = el.style;
32
- if (count > 0) {
37
+ if (writesTransform) {
33
38
  let transform = "";
34
39
  let separator = "";
40
+ if (depthAt !== -1) {
41
+ const depth = positions[base + depthAt];
42
+ if (TransformKeys.drawsDepth(depth)) {
43
+ transform = DEPTH_OPEN + depth + DEPTH_CLOSE;
44
+ separator = " ";
45
+ }
46
+ }
35
47
  for (let p = 0; p < count; p++) {
36
48
  const part = parts[p];
37
49
  const value = positions[base + part.k];
@@ -50,16 +62,20 @@ const forKeys = (keys) => {
50
62
  };
51
63
  /**
52
64
  * A member's style as a server writes it (#665's PR 6, Q63): `values`' `transform` and `opacity`, the
53
- * strings `forKeys`' write draws them with, each left out at its identity. What the client then writes
65
+ * strings `forKeys`' write draws them with, each left out as there. What the client then writes
54
66
  * at the member's arrival is the same, so its element doesn't move at hydration.
55
67
  */
56
68
  export const styleOf = (values) => {
57
69
  const style = {};
58
70
  // Once a member on a server: in the renderer's order, as `forKeys`' write.
59
- const functions = Arr.filterMap(FUNC_PARTS, (part) => {
71
+ const functions = Arr.filterMap(FUNCS, (part) => {
60
72
  const value = values[part.key];
61
73
  if (Bool.or(Predicate.isUndefined(value), value === part.identity))
62
74
  return Result.failVoid;
75
+ if (part.key === TransformKeys.PERSPECTIVE) {
76
+ if (Bool.not(TransformKeys.drawsDepth(value)))
77
+ return Result.failVoid;
78
+ }
63
79
  return Result.succeed(part.open + value + part.close);
64
80
  });
65
81
  if (functions.length > 0)
@@ -1 +1 @@
1
- {"version":3,"file":"batch-writer.js","sourceRoot":"","sources":["../../src/internal/batch-writer.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK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Layer";
19
19
  * it on a server fails, with an error that says it's client-only.
20
20
  */
21
21
  export declare const ClockDomLive: Layer.Layer<Clock.Clock | RefreshFrameSource.RefreshFrameSource>;
22
+ /**
23
+ * The DOM's late frames, for its Frame loop (`Clock.LateFrames`): `requestAnimationFrame`'s timestamps are on
24
+ * `performance.now()`'s timebase, the Clock's `now()`, so a frame whose callback ran more than 25 ms after its
25
+ * timestamp was delayed by a long task.
26
+ */
27
+ export declare const LateFramesDomLive: Layer.Layer<never, never, never>;
22
28
  //# sourceMappingURL=clock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../../src/internal/clock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,kBAAkB,MAAM,iCAAiC,CAAA;AAErE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAwBrC;;;;;GAKG;AAEH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,kBAAkB,CAAC,kBAAkB,CAEzF,CAAA"}
1
+ {"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../../src/internal/clock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,kBAAkB,MAAM,iCAAiC,CAAA;AAErE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAwBrC;;;;;GAKG;AAEH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,kBAAkB,CAAC,kBAAkB,CAEzF,CAAA;AAED;;;;GAIG;AAsBH,eAAO,MAAM,iBAAiB,kCAAoD,CAAA"}
@@ -39,4 +39,31 @@ const frames = Layer.effect(RefreshFrameSource.RefreshFrameSource)(requireGlobal
39
39
  */
40
40
  // ADR-0021, decision 7: the client-only error.
41
41
  export const ClockDomLive = Clock.layer.pipe(Layer.provideMerge(frames));
42
+ /**
43
+ * The DOM's late frames, for its Frame loop (`Clock.LateFrames`): `requestAnimationFrame`'s timestamps are on
44
+ * `performance.now()`'s timebase, the Clock's `now()`, so a frame whose callback ran more than 25 ms after its
45
+ * timestamp was delayed by a long task.
46
+ */
47
+ // #1026; 25 ms since #1028 (Q11), 40 before, Motion's line for "main thread work" (`MAX_START_DELAY`,
48
+ // motion-dom 14.6 `resolve-start-time.mjs`). ADR-0027 *Amendment (#1028)* has the sources (Chromium's
49
+ // `time_clamper.cc` and `page_animator.cc`, Firefox's `Performance.cpp` and `nsRFPService.cpp`, Brave's
50
+ // `time_clamper.cc`, Tor Browser's base profile).
51
+ // - On time, a frame's callback reads less than 3 ms after its timestamp in Chrome, Safari and Brave, and in
52
+ // Firefox at its defaults or with its fingerprinting protection. With `privacy.resistFingerprinting` (Tor
53
+ // Browser's), both clocks sit on a 16.7 ms grid with jitter: 16.7 ms often, 33.3 rarely (late, at 25), never
54
+ // 50. Only a 100 ms clamp misreads past 40 (resistFingerprinting before Firefox 102, or a raised
55
+ // `privacy.reduceTimerPrecision.microseconds`), which 40 didn't guard against either.
56
+ // - Why 25: past resistFingerprinting's common 16.7 ms reading, and short of two 60 Hz frames (33.3 ms) by
57
+ // more than a frame's jitter.
58
+ // - What 25 catches (measured in Chromium at 60 Hz): the frame after a held one is stamped at the last vsync
59
+ // the held one ran past. A frame held 33.3–40 ms, past two frames, is followed by one whose dt holds a frame
60
+ // of the task's time, which a new row's fade took at its second frame at 40, 0.06 → 0.17 (Solid's HL3). One
61
+ // held 25–33 ms is followed by one stamped a frame after it, whose dt holds none. Faster displays' two frames
62
+ // are shorter, so there a 25–33 ms hold hitches too, and 25 catches it.
63
+ // - What 25 costs: nothing at 60 Hz or faster, since the rule leaves a step of a 60 Hz frame or less alone.
64
+ // Slower, a misread trims one step of a new run to 1/60 s: no jump, it lands half a frame later. Telling a
65
+ // frame late is the line's one use: since #1050 a frame a long task delayed is told by its gap too (core's
66
+ // `FirstSteps.lateByGap`), which WebKit and Gecko need, stamping a late frame near when it ran, so that it
67
+ // never reads late. Before, the line also trimmed a run that waited past it for its first frame (#1048).
68
+ export const LateFramesDomLive = Layer.succeed(Clock.LateFrames, { ranAfter: 25 });
42
69
  //# sourceMappingURL=clock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clock.js","sourceRoot":"","sources":["../../src/internal/clock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,kBAAkB,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,GAAuD,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CACpH,aAAa,CAAC,gBAAgB,EAAE,uBAAuB,CAAC,CAAC,IAAI,CAC3D,MAAM,CAAC,GAAG,CAAC,GAA6B,EAAE;IACxC,MAAM,MAAM,GAAG,oBAAoB,CAAA;IACnC,OAAO;QACL,YAAY,EAAE,qBAAqB;QACnC,WAAW,EAAE,CAAC,MAAe,EAAE,EAAE;YAC/B,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAAE,MAAM,CAAC,MAAM,CAAC,CAAA;QAChD,CAAC;KACF,CAAA;AACH,CAAC,CAAC,CACH,CACF,CAAA;AAED;;;;;GAKG;AACH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAqE,KAAK,CAAC,KAAK,CAAC,IAAI,CAC5G,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAC3B,CAAA"}
1
+ {"version":3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G;AAC5G,6GAA6G;AAC7G,6GAA6G;AAC7G,6GAA6G;AAC7G,2GAA2G;AAC3G,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAA"}
@@ -2,7 +2,8 @@
2
2
  * The DOM Environment's Default transition (CONTEXT.md; ADR-0051, #357): Motion's, by value
3
3
  * (`.reference/motion` at 16c6122, `motion-dom/src/animation/utils/default-transitions.ts`,
4
4
  * `getDefaultTransition`):
5
- * - a transform but a scale: a spring, 500 / 25, at rest under 10 px/s;
5
+ * - a transform but a scale, the DOM's own among them (`translateX`, `rotate`, `skewX`, the element's
6
+ * own depth `transformPerspective`…): a spring, 500 / 25, at rest under 10 px/s;
6
7
  * - `scale`, `scaleX`, `scaleY`: a spring, 550, critically damped toward 0 (2·√550), else 30;
7
8
  * - anything else (opacity, colours, a box's size, a filter): a 0.3 s tween on
8
9
  * `cubic-bezier(0.25, 0.1, 0.35, 1)`, "a slightly shallower version of the browser's default ease".
@@ -15,7 +16,7 @@
15
16
  * @module
16
17
  */
17
18
  import * as DefaultTransition from "@wardic/core/DefaultTransition";
18
- import type * as Layer from "effect/Layer";
19
+ import * as Layer from "effect/Layer";
19
20
  /** The transition through more than two keyframes, as Motion's `keyframesTransition`: a 0.8 s tween, eased out. */
20
21
  export declare const keyframes: DefaultTransition.KeyframesTransition;
21
22
  /** The transition `key` runs on toward `target` when its own isn't defined, in the DOM: Motion's. */
@@ -1 +1 @@
1
- {"version":3,"file":"default-transition.d.ts","sourceRoot":"","sources":["../../src/internal/default-transition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,iBAAiB,MAAM,gCAAgC,CAAA;AACnE,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAE1C,mHAAmH;AACnH,eAAO,MAAM,SAAS,EAAE,iBAAiB,CAAC,mBAAuD,CAAA;AAEjG,qGAAqG;AACrG,eAAO,MAAM,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,KAAK,iBAAiB,CAAC,UAAoC,CAAA;AAE5H,mEAAmE;AACnE,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAgC,CAAA"}
1
+ {"version":3,"file":"default-transition.d.ts","sourceRoot":"","sources":["../../src/internal/default-transition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,iBAAiB,MAAM,gCAAgC,CAAA;AACnE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAIrC,mHAAmH;AACnH,eAAO,MAAM,SAAS,EAAE,iBAAiB,CAAC,mBAAuD,CAAA;AAkBjG,qGAAqG;AAErG,eAAO,MAAM,aAAa,QAAS,MAAM,UAAU,MAAM,GAAG,MAAM,KAAG,iBAAiB,CAAC,UAItF,CAAA;AAED,mEAAmE;AACnE,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAkG,CAAA"}
@@ -2,7 +2,8 @@
2
2
  * The DOM Environment's Default transition (CONTEXT.md; ADR-0051, #357): Motion's, by value
3
3
  * (`.reference/motion` at 16c6122, `motion-dom/src/animation/utils/default-transitions.ts`,
4
4
  * `getDefaultTransition`):
5
- * - a transform but a scale: a spring, 500 / 25, at rest under 10 px/s;
5
+ * - a transform but a scale, the DOM's own among them (`translateX`, `rotate`, `skewX`, the element's
6
+ * own depth `transformPerspective`…): a spring, 500 / 25, at rest under 10 px/s;
6
7
  * - `scale`, `scaleX`, `scaleY`: a spring, 550, critically damped toward 0 (2·√550), else 30;
7
8
  * - anything else (opacity, colours, a box's size, a filter): a 0.3 s tween on
8
9
  * `cubic-bezier(0.25, 0.1, 0.35, 1)`, "a slightly shallower version of the browser's default ease".
@@ -16,10 +17,34 @@
16
17
  */
17
18
  // #882 (ADR-0073, *Amendment (#882)*, Q2): core's table, `DefaultTransition.byKey`, the same objects.
18
19
  import * as DefaultTransition from "@wardic/core/DefaultTransition";
20
+ import * as Layer from "effect/Layer";
21
+ import * as Predicate from "effect/Predicate";
22
+ import * as TransformKeys from "./transform-keys.js";
19
23
  /** The transition through more than two keyframes, as Motion's `keyframesTransition`: a 0.8 s tween, eased out. */
20
24
  export const keyframes = DefaultTransition.KEYFRAMES_TWEEN;
25
+ /**
26
+ * The key of core's each of the DOM's own transform keys runs as: its twin, a translation's or a turn's.
27
+ * The element's own depth runs as a turn's, so a depth and a turn leaving together decay in step.
28
+ */
29
+ // #887 (ADR-0073, *Amendment (#887)*, Q10): core's `byKey` knows core's transforms; the DOM's own take a
30
+ // twin's, the same object. #1002 (*Amendment (#1002)*, Q3): the six core named until then.
31
+ const RUNS_AS = new Map([
32
+ ["translateX", "x"],
33
+ ["translateY", "y"],
34
+ ["translateZ", "z"],
35
+ ["rotate", "rotateZ"],
36
+ ["skewX", "rotateZ"],
37
+ ["skewY", "rotateZ"],
38
+ [TransformKeys.PERSPECTIVE, "rotateY"],
39
+ ]);
21
40
  /** The transition `key` runs on toward `target` when its own isn't defined, in the DOM: Motion's. */
22
- export const transitionFor = DefaultTransition.byKey;
41
+ // Per key per Retarget: statements (docs/agents/effect-first.md, the hot path).
42
+ export const transitionFor = (key, target) => {
43
+ const twin = RUNS_AS.get(key);
44
+ if (Predicate.isUndefined(twin))
45
+ return DefaultTransition.byKey(key, target);
46
+ return DefaultTransition.byKey(twin, target);
47
+ };
23
48
  /** The DOM Environment's `DefaultTransition.DefaultTransition`. */
24
- export const DefaultTransitionDomLive = DefaultTransition.layerByKey;
49
+ export const DefaultTransitionDomLive = /*#__PURE__*/ Layer.succeed(DefaultTransition.DefaultTransition, { transitionFor, keyframes });
25
50
  //# sourceMappingURL=default-transition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"default-transition.js","sourceRoot":"","sources":["../../src/internal/default-transition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,sGAAsG;AACtG,OAAO,KAAK,iBAAiB,MAAM,gCAAgC,CAAA;AAGnE,mHAAmH;AACnH,MAAM,CAAC,MAAM,SAAS,GAA0C,iBAAiB,CAAC,eAAe,CAAA;AAEjG,qGAAqG;AACrG,MAAM,CAAC,MAAM,aAAa,GAA2E,iBAAiB,CAAC,KAAK,CAAA;AAE5H,mEAAmE;AACnE,MAAM,CAAC,MAAM,wBAAwB,GAAqD,iBAAiB,CAAC,UAAU,CAAA"}
1
+ {"version":3,"file":"default-transition.js","sourceRoot":"","sources":["../../src/internal/default-transition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,sGAAsG;AACtG,OAAO,KAAK,iBAAiB,MAAM,gCAAgC,CAAA;AACnE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAA;AAEpD,mHAAmH;AACnH,MAAM,CAAC,MAAM,SAAS,GAA0C,iBAAiB,CAAC,eAAe,CAAA;AAEjG;;;GAGG;AACH,yGAAyG;AACzG,2FAA2F;AAC3F,MAAM,OAAO,GAAgC,IAAI,GAAG,CAAC;IACnD,CAAC,YAAY,EAAE,GAAG,CAAC;IACnB,CAAC,YAAY,EAAE,GAAG,CAAC;IACnB,CAAC,YAAY,EAAE,GAAG,CAAC;IACnB,CAAC,QAAQ,EAAE,SAAS,CAAC;IACrB,CAAC,OAAO,EAAE,SAAS,CAAC;IACpB,CAAC,OAAO,EAAE,SAAS,CAAC;IACpB,CAAC,aAAa,CAAC,WAAW,EAAE,SAAS,CAAC;CACvC,CAAC,CAAA;AAEF,qGAAqG;AACrG,gFAAgF;AAChF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAW,EAAE,MAAuB,EAAgC,EAAE;IAClG,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC7B,IAAI,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC;QAAE,OAAO,iBAAiB,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IAC5E,OAAO,iBAAiB,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;AAC9C,CAAC,CAAA;AAED,mEAAmE;AACnE,MAAM,CAAC,MAAM,wBAAwB,GAAqD,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAA"}
@@ -0,0 +1,9 @@
1
+ /** What holds a Subject's failing names: `undefined` until its first throw. */
2
+ export interface Failing<N extends string> {
3
+ failing: Set<N> | undefined;
4
+ }
5
+ /** Whether a throw of `name`'s is its run's first: the run is on from now. */
6
+ export declare const firstThrowOf: <N extends string>(holder: Failing<N>, name: N) => boolean;
7
+ /** A clean call of `name`'s: its run, if one is on, ended. */
8
+ export declare const endRunOf: <N extends string>(holder: Failing<N>, name: N) => void;
9
+ //# sourceMappingURL=failing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"failing.d.ts","sourceRoot":"","sources":["../../src/internal/failing.ts"],"names":[],"mappings":"AAaA,+EAA+E;AAC/E,MAAM,WAAW,OAAO,CAAC,CAAC,SAAS,MAAM;IACvC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;CAC5B;AAED,8EAA8E;AAC9E,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,MAAM,UAAU,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAG,OAY5E,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,UAAU,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAG,IAExE,CAAA"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Which of a Subject's callbacks are in a run of throws, by name: a callback's run starts at its first
3
+ * throw and ends at its next call that returns. The set of names is made at the first throw, as most
4
+ * Subjects never see one.
5
+ *
6
+ * @module
7
+ */
8
+ // #979 group I (ADR-0074 decision 3): an element's gesture callbacks, a layout node's callbacks and a drag
9
+ // track's failures, each reported at its run's first throw.
10
+ import { identity } from "effect/Function";
11
+ import * as Predicate from "effect/Predicate";
12
+ import * as UndefinedOr from "effect/UndefinedOr";
13
+ /** Whether a throw of `name`'s is its run's first: the run is on from now. */
14
+ export const firstThrowOf = (holder, name) => {
15
+ const failing = UndefinedOr.match(holder.failing, {
16
+ onUndefined: () => {
17
+ const made = new Set();
18
+ holder.failing = made;
19
+ return made;
20
+ },
21
+ onDefined: identity,
22
+ });
23
+ if (failing.has(name))
24
+ return false;
25
+ failing.add(name);
26
+ return true;
27
+ };
28
+ /** A clean call of `name`'s: its run, if one is on, ended. */
29
+ export const endRunOf = (holder, name) => {
30
+ if (Predicate.isNotUndefined(holder.failing))
31
+ holder.failing.delete(name);
32
+ };
33
+ //# sourceMappingURL=failing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"failing.js","sourceRoot":"","sources":["../../src/internal/failing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,2GAA2G;AAC3G,4DAA4D;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAA;AAOjD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAmB,MAAkB,EAAE,IAAO,EAAW,EAAE;IACrF,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE;QAChD,WAAW,EAAE,GAAG,EAAE;YAChB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAK,CAAA;YACzB,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA;YACrB,OAAO,IAAI,CAAA;QACb,CAAC;QACD,SAAS,EAAE,QAAQ;KACpB,CAAC,CAAA;IACF,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAA;IACnC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IACjB,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,8DAA8D;AAC9D,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAmB,MAAkB,EAAE,IAAO,EAAQ,EAAE;IAC9E,IAAI,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC;QAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAC3E,CAAC,CAAA"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The CSS lengths a bare number on is drawn in `px`, spelled as Wardic's keys are (`margin-top`). The DOM
3
+ * renderer draws them, and `LiveStyle` hands such a number in an element's `style` to it.
4
+ *
5
+ * @module
6
+ */
7
+ /**
8
+ * The CSS properties a bare number on is a length, drawn in `px`, spelled as Wardic's keys are
9
+ * (`margin-top`): Motion's, and `min-width`, `min-height`, the gaps and `letter-spacing`. The Solid
10
+ * bindings' value types take a number on these and on no other length, so a number never draws CSS a
11
+ * browser drops. `line-height` isn't one: CSS reads its bare number as a multiple. A number on any other
12
+ * key, `opacity`, `z-index`, a custom property, is drawn as it is; a string always is.
13
+ */
14
+ export declare const LENGTH_KEYS: readonly ["border-width", "border-top-width", "border-right-width", "border-bottom-width", "border-left-width", "border-radius", "border-top-left-radius", "border-top-right-radius", "border-bottom-right-radius", "border-bottom-left-radius", "width", "min-width", "max-width", "height", "min-height", "max-height", "top", "right", "bottom", "left", "inset", "inset-block", "inset-block-start", "inset-block-end", "inset-inline", "inset-inline-start", "inset-inline-end", "padding", "padding-top", "padding-right", "padding-bottom", "padding-left", "padding-block", "padding-block-start", "padding-block-end", "padding-inline", "padding-inline-start", "padding-inline-end", "margin", "margin-top", "margin-right", "margin-bottom", "margin-left", "margin-block", "margin-block-start", "margin-block-end", "margin-inline", "margin-inline-start", "margin-inline-end", "gap", "row-gap", "column-gap", "font-size", "letter-spacing", "background-position-x", "background-position-y", "perspective"];
15
+ /** One of `LENGTH_KEYS`: a CSS property a bare number on is drawn in `px`. */
16
+ export type LengthKey = (typeof LENGTH_KEYS)[number];
17
+ /** {@link LENGTH_KEYS}, for a membership test a frame can make. */
18
+ export declare const LENGTH_KEY_SET: ReadonlySet<string>;
19
+ //# sourceMappingURL=length-keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"length-keys.d.ts","sourceRoot":"","sources":["../../src/internal/length-keys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH;;;;;;GAMG;AAEH,eAAO,MAAM,WAAW,YACtB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,EAC5B,2BAA2B,EAC3B,OAAO,EACP,WAAW,EACX,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,EACL,SAAS,EACT,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EAEvB,aAAa,CACL,CAAA;AAEV,8EAA8E;AAC9E,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpD,mEAAmE;AACnE,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAAwB,CAAA"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * The CSS lengths a bare number on is drawn in `px`, spelled as Wardic's keys are (`margin-top`). The DOM
3
+ * renderer draws them, and `LiveStyle` hands such a number in an element's `style` to it.
4
+ *
5
+ * @module
6
+ */
7
+ /**
8
+ * The CSS properties a bare number on is a length, drawn in `px`, spelled as Wardic's keys are
9
+ * (`margin-top`): Motion's, and `min-width`, `min-height`, the gaps and `letter-spacing`. The Solid
10
+ * bindings' value types take a number on these and on no other length, so a number never draws CSS a
11
+ * browser drops. `line-height` isn't one: CSS reads its bare number as a multiple. A number on any other
12
+ * key, `opacity`, `z-index`, a custom property, is drawn as it is; a string always is.
13
+ */
14
+ // #522: Motion's `numberValueTypes`' `px` keys; the bindings' `WardicValues`.
15
+ export const LENGTH_KEYS = [
16
+ "border-width",
17
+ "border-top-width",
18
+ "border-right-width",
19
+ "border-bottom-width",
20
+ "border-left-width",
21
+ "border-radius",
22
+ "border-top-left-radius",
23
+ "border-top-right-radius",
24
+ "border-bottom-right-radius",
25
+ "border-bottom-left-radius",
26
+ "width",
27
+ "min-width",
28
+ "max-width",
29
+ "height",
30
+ "min-height",
31
+ "max-height",
32
+ "top",
33
+ "right",
34
+ "bottom",
35
+ "left",
36
+ "inset",
37
+ "inset-block",
38
+ "inset-block-start",
39
+ "inset-block-end",
40
+ "inset-inline",
41
+ "inset-inline-start",
42
+ "inset-inline-end",
43
+ "padding",
44
+ "padding-top",
45
+ "padding-right",
46
+ "padding-bottom",
47
+ "padding-left",
48
+ "padding-block",
49
+ "padding-block-start",
50
+ "padding-block-end",
51
+ "padding-inline",
52
+ "padding-inline-start",
53
+ "padding-inline-end",
54
+ "margin",
55
+ "margin-top",
56
+ "margin-right",
57
+ "margin-bottom",
58
+ "margin-left",
59
+ "margin-block",
60
+ "margin-block-start",
61
+ "margin-block-end",
62
+ "margin-inline",
63
+ "margin-inline-start",
64
+ "margin-inline-end",
65
+ "gap",
66
+ "row-gap",
67
+ "column-gap",
68
+ "font-size",
69
+ "letter-spacing",
70
+ "background-position-x",
71
+ "background-position-y",
72
+ // An element's children's depth (#887), Motion's: the property beside the element's own `transformPerspective`.
73
+ "perspective",
74
+ ];
75
+ /** {@link LENGTH_KEYS}, for a membership test a frame can make. */
76
+ export const LENGTH_KEY_SET = new Set(LENGTH_KEYS);
77
+ //# sourceMappingURL=length-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"length-keys.js","sourceRoot":"","sources":["../../src/internal/length-keys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH;;;;;;GAMG;AACH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,cAAc;IACd,kBAAkB;IAClB,oBAAoB;IACpB,qBAAqB;IACrB,mBAAmB;IACnB,eAAe;IACf,wBAAwB;IACxB,yBAAyB;IACzB,4BAA4B;IAC5B,2BAA2B;IAC3B,OAAO;IACP,WAAW;IACX,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,YAAY;IACZ,KAAK;IACL,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,aAAa;IACb,mBAAmB;IACnB,iBAAiB;IACjB,cAAc;IACd,oBAAoB;IACpB,kBAAkB;IAClB,SAAS;IACT,aAAa;IACb,eAAe;IACf,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,qBAAqB;IACrB,mBAAmB;IACnB,gBAAgB;IAChB,sBAAsB;IACtB,oBAAoB;IACpB,QAAQ;IACR,YAAY;IACZ,cAAc;IACd,eAAe;IACf,aAAa;IACb,cAAc;IACd,oBAAoB;IACpB,kBAAkB;IAClB,eAAe;IACf,qBAAqB;IACrB,mBAAmB;IACnB,KAAK;IACL,SAAS;IACT,YAAY;IACZ,WAAW;IACX,gBAAgB;IAChB,uBAAuB;IACvB,uBAAuB;IACvB,gHAAgH;IAChH,aAAa;CACL,CAAA;AAKV,mEAAmE;AACnE,MAAM,CAAC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC,WAAW,CAAC,CAAA"}
@@ -29,10 +29,11 @@ export declare const measured: (pair: Requested) => Option.Option<Measured>;
29
29
  /**
30
30
  * Measures `pairs` on `element` at the end of this task, with every other element's in the same batch:
31
31
  * each pair, as asked, {@link measured} before the next tick. `values` are what the element draws now,
32
- * its other transforms among them.
32
+ * its other transforms among them. Writing them can throw (a Transform template among `values`): then
33
+ * its pairs are never measured, `failed` is told, and the rest of the batch goes on.
33
34
  */
34
35
  export declare const measure: (element: HTMLElement, pairs: Readonly<Record<string, {
35
36
  readonly from: number | string;
36
37
  readonly to: number | string;
37
- }>>, values: Values.Values) => Readonly<Record<string, Requested>>;
38
+ }>>, values: Values.Values, failed: (defect: unknown) => void) => Readonly<Record<string, Requested>>;
38
39
  //# sourceMappingURL=measured-pairs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"measured-pairs.d.ts","sourceRoot":"","sources":["../../src/internal/measured-pairs.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,KAAK,MAAM,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AA8BvC;;;GAGG;AAEH,eAAO,MAAM,KAAK,QAAS,MAAM,QAAQ,MAAM,GAAG,MAAM,MAAM,MAAM,GAAG,MAAM,KAAG,OAO/E,CAAA;AAED,sEAAsE;AAEtE,MAAM,WAAW,SAAS;IACxB,eAAe;IACf,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,2BAA2B;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IAC9B,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CAC7B;AAED,2EAA2E;AAC3E,MAAM,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B;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAwBD;;;GAGG;AAEH,eAAO,MAAM,QAAQ,SAAU,SAAS,KAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAA2C,CAAA;AAQ5G;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,YACT,WAAW,SACb,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC,CAAC,UACzF,MAAM,CAAC,MAAM,UACb,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KAChC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAQpC,CAAA"}
@@ -85,12 +85,13 @@ let scheduled = false;
85
85
  /**
86
86
  * Measures `pairs` on `element` at the end of this task, with every other element's in the same batch:
87
87
  * each pair, as asked, {@link measured} before the next tick. `values` are what the element draws now,
88
- * its other transforms among them.
88
+ * its other transforms among them. Writing them can throw (a Transform template among `values`): then
89
+ * its pairs are never measured, `failed` is told, and the rest of the batch goes on.
89
90
  */
90
- // #430's Q2.
91
- export const measure = (element, pairs, values) => {
91
+ // #430's Q2. #979, row 8 (ADR-0074): `failed`, its asker's, which reports through its own runtime.
92
+ export const measure = (element, pairs, values, failed) => {
92
93
  const made = Rec.map(pairs, ({ from, to }, key) => ({ key, from, to }));
93
- queued.push({ element, slots: Arr.map(Rec.values(made), (pair) => ({ pair, fromPx: undefined, toPx: undefined })), values });
94
+ queued.push({ element, slots: Arr.map(Rec.values(made), (pair) => ({ pair, fromPx: undefined, toPx: undefined })), values, failed, threw: false });
94
95
  if (Bool.not(scheduled)) {
95
96
  scheduled = true;
96
97
  queueMicrotask(flush);
@@ -156,34 +157,40 @@ const readPx = (element, style, key) => {
156
157
  const savedOf = (element, property) => ({ element, property, value: element.style.getPropertyValue(property), priority: element.style.getPropertyPriority(property) });
157
158
  /**
158
159
  * Write `pairs`' translates at their `end` through the element's whole transform, keeping what was
159
- * there: the browser lays out any unit, `-100%` included (#594).
160
+ * there in `saved` before it's written: the browser lays out any unit, `-100%` included (#594).
160
161
  */
161
- const writeTranslates = (request, slots, end) => {
162
+ const writeTranslates = (request, slots, end, saved) => {
162
163
  if (slots.length === 0)
163
- return [];
164
+ return;
164
165
  const { element, values } = request;
165
- const saved = savedOf(element, "transform");
166
166
  const transform = project({ ...values, ...Rec.fromEntries(Arr.map(slots, ({ pair }) => [pair.key, pair[end]])) })["transform"];
167
+ saved.push(savedOf(element, "transform"));
167
168
  element.style.setProperty("transform", UndefinedOr.match(transform, { onUndefined: () => "none", onDefined: String }));
168
- return [saved];
169
169
  };
170
- /** Write each pair's target inline on its element, keeping what was there; a translate through the element's whole transform. */
171
- const writeTargets = (request) => {
170
+ /**
171
+ * Write each pair's target inline on its element, keeping what was there in `saved` before each is
172
+ * written; a translate through the element's whole transform.
173
+ */
174
+ const writeTargets = (request, saved) => {
172
175
  const unread = Arr.filter(request.slots, (slot) => Predicate.isUndefined(slot.toPx));
173
- const saved = [...writeTranslates(request, Arr.filter(unread, (slot) => TRANSLATES.has(slot.pair.key)), "to")];
176
+ writeTranslates(request, Arr.filter(unread, (slot) => TRANSLATES.has(slot.pair.key)), "to", saved);
174
177
  Arr.forEach(unread, ({ pair }) => {
175
178
  if (TRANSLATES.has(pair.key))
176
179
  return;
177
180
  saved.push(savedOf(request.element, pair.key));
178
181
  request.element.style.setProperty(pair.key, cssOf(pair.to));
179
182
  });
180
- return saved;
181
183
  };
182
184
  /**
183
185
  * Write each translate pair's start not in px, as a target is (#594): a layout element's transform at
184
186
  * this moment is its projection's, or held off for its Measure pass, so reading it as it is gave 0.
185
187
  */
186
- const writeTranslateStarts = (request) => writeTranslates(request, Arr.filter(request.slots, (slot) => Bool.and(TRANSLATES.has(slot.pair.key), Predicate.isUndefined(slot.fromPx))), "from");
188
+ const writeTranslateStarts = (request, saved) => writeTranslates(request, Arr.filter(request.slots, (slot) => Bool.and(TRANSLATES.has(slot.pair.key), Predicate.isUndefined(slot.fromPx))), "from", saved);
189
+ /** `request`'s write threw: its pairs are left unread, so its animation switches, and its asker is told. */
190
+ const requestThrew = (request, defect) => {
191
+ request.threw = true;
192
+ request.failed(defect);
193
+ };
187
194
  /** Put back what {@link writeTargets} replaced. */
188
195
  const restore = (saved) => Arr.forEach(saved, ({ element, property, value, priority }) => Bool.match(value === "", {
189
196
  onTrue: () => void element.style.removeProperty(property),
@@ -204,30 +211,58 @@ const flush = () => {
204
211
  slot.toPx = givenPx(slot.pair.to);
205
212
  slot.fromPx = givenPx(slot.pair.from);
206
213
  }));
214
+ // #979, row 8 (ADR-0074): each request's write is its own, in a `try` of its own in each write's loop.
215
+ // One that throws (an exit's Transform template, say) is left unread, its asker told, and the rest of
216
+ // the batch goes on, every style written so far put back: before, its throw ended the batch
217
+ // uncaught, every pair in it voided and the targets written before it left inline.
207
218
  // WRITE, READ, WRITE: each translate's start not in px, written alone and read (#594).
208
- const starts = Arr.flatMap(batch, writeTranslateStarts);
209
- if (Arr.isArrayNonEmpty(starts)) {
210
- try {
219
+ const starts = [];
220
+ try {
221
+ Arr.forEach(batch, (request) => {
222
+ try {
223
+ writeTranslateStarts(request, starts);
224
+ }
225
+ catch (defect) {
226
+ requestThrew(request, defect);
227
+ }
228
+ });
229
+ if (Arr.isArrayNonEmpty(starts)) {
211
230
  Arr.forEach(batch, (request, i) => Arr.forEach(request.slots, (slot) => {
231
+ if (request.threw)
232
+ return;
212
233
  if (Bool.and(TRANSLATES.has(slot.pair.key), Predicate.isUndefined(slot.fromPx)))
213
234
  slot.fromPx = readPx(request.element, UndefinedOr.getOrThrow(styles[i]), slot.pair.key);
214
235
  }));
215
236
  }
216
- finally {
217
- restore(starts);
218
- }
237
+ }
238
+ finally {
239
+ restore(starts);
219
240
  }
220
241
  // READ: each other start not already in px, as the element lays out now.
221
242
  Arr.forEach(batch, (request, i) => Arr.forEach(request.slots, (slot) => {
243
+ if (request.threw)
244
+ return;
222
245
  if (Predicate.isUndefined(slot.fromPx))
223
246
  slot.fromPx = readPx(request.element, UndefinedOr.getOrThrow(styles[i]), slot.pair.key);
224
247
  }));
225
248
  const scrollY = globalThis.scrollY;
226
- // WRITE: each target, inline.
227
- const saved = Arr.flatMap(batch, writeTargets);
249
+ const saved = [];
228
250
  try {
251
+ // WRITE: each target, inline.
252
+ Arr.forEach(batch, (request) => {
253
+ if (request.threw)
254
+ return;
255
+ try {
256
+ writeTargets(request, saved);
257
+ }
258
+ catch (defect) {
259
+ requestThrew(request, defect);
260
+ }
261
+ });
229
262
  // READ: each target not already in px, laid out once.
230
263
  Arr.forEach(batch, (request, i) => Arr.forEach(request.slots, (slot) => {
264
+ if (request.threw)
265
+ return;
231
266
  if (Predicate.isUndefined(slot.toPx))
232
267
  slot.toPx = readPx(request.element, UndefinedOr.getOrThrow(styles[i]), slot.pair.key);
233
268
  }));
@@ -238,8 +273,10 @@ const flush = () => {
238
273
  if (globalThis.scrollY !== scrollY)
239
274
  globalThis.scrollTo(globalThis.scrollX, scrollY);
240
275
  }
241
- // Each pair read at both ends, as a record of its own.
276
+ // Each pair read at both ends, as a record of its own: none of a request whose write threw.
242
277
  Arr.forEach(batch, (request) => Arr.forEach(request.slots, ({ pair, fromPx, toPx }) => {
278
+ if (request.threw)
279
+ return;
243
280
  if (Predicate.isUndefined(fromPx))
244
281
  return;
245
282
  if (Predicate.isUndefined(toPx))