@wardic/dom 1.3.1 → 1.3.2

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 (132) 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 +26 -6
  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 +9 -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 +14 -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 +138 -39
  49. package/dist/internal/projection.js.map +1 -1
  50. package/dist/internal/renderer.d.ts +26 -16
  51. package/dist/internal/renderer.d.ts.map +1 -1
  52. package/dist/internal/renderer.js +45 -106
  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/transform-keys.d.ts +22 -0
  58. package/dist/internal/transform-keys.d.ts.map +1 -0
  59. package/dist/internal/transform-keys.js +43 -0
  60. package/dist/internal/transform-keys.js.map +1 -0
  61. package/dist/unstable/AppearAnimations.d.ts +2 -1
  62. package/dist/unstable/AppearAnimations.d.ts.map +1 -1
  63. package/dist/unstable/AppearAnimations.js +73 -22
  64. package/dist/unstable/AppearAnimations.js.map +1 -1
  65. package/dist/unstable/BatchMembers.d.ts +2 -2
  66. package/dist/unstable/BatchMembers.d.ts.map +1 -1
  67. package/dist/unstable/BatchMembers.js +29 -6
  68. package/dist/unstable/BatchMembers.js.map +1 -1
  69. package/dist/unstable/DomValues.js +1 -1
  70. package/dist/unstable/DomValues.js.map +1 -1
  71. package/dist/unstable/DragTrack.d.ts +2 -2
  72. package/dist/unstable/DragTrack.d.ts.map +1 -1
  73. package/dist/unstable/DragTrack.js +34 -8
  74. package/dist/unstable/DragTrack.js.map +1 -1
  75. package/dist/unstable/ElementSetup.d.ts.map +1 -1
  76. package/dist/unstable/ElementSetup.js +2 -1
  77. package/dist/unstable/ElementSetup.js.map +1 -1
  78. package/dist/unstable/GestureFeatures.d.ts +2 -1
  79. package/dist/unstable/GestureFeatures.d.ts.map +1 -1
  80. package/dist/unstable/GestureFeatures.js +18 -37
  81. package/dist/unstable/GestureFeatures.js.map +1 -1
  82. package/dist/unstable/LiveStyle.d.ts +28 -2
  83. package/dist/unstable/LiveStyle.d.ts.map +1 -1
  84. package/dist/unstable/LiveStyle.js +8 -32
  85. package/dist/unstable/LiveStyle.js.map +1 -1
  86. package/dist/unstable/MemberHold.js +2 -2
  87. package/dist/unstable/MemberHold.js.map +1 -1
  88. package/dist/unstable/PointerValues.d.ts.map +1 -1
  89. package/dist/unstable/PointerValues.js +82 -8
  90. package/dist/unstable/PointerValues.js.map +1 -1
  91. package/dist/unstable/PresenceController.d.ts +5 -2
  92. package/dist/unstable/PresenceController.d.ts.map +1 -1
  93. package/dist/unstable/PresenceController.js +68 -41
  94. package/dist/unstable/PresenceController.js.map +1 -1
  95. package/dist/unstable/ReorderInput.d.ts +2 -2
  96. package/dist/unstable/ReorderInput.js +2 -2
  97. package/dist/unstable/WardConfig.d.ts +13 -4
  98. package/dist/unstable/WardConfig.d.ts.map +1 -1
  99. package/dist/unstable/WardConfig.js.map +1 -1
  100. package/dist/unstable/features/TimelineKeys.d.ts.map +1 -1
  101. package/dist/unstable/features/TimelineKeys.js +18 -2
  102. package/dist/unstable/features/TimelineKeys.js.map +1 -1
  103. package/package.json +3 -3
  104. package/src/MeasuredPair.ts +21 -1
  105. package/src/index.ts +4 -1
  106. package/src/internal/appear.ts +20 -2
  107. package/src/internal/batch-handoff.ts +19 -11
  108. package/src/internal/batch-writer.ts +27 -6
  109. package/src/internal/clock.ts +10 -0
  110. package/src/internal/default-transition.ts +14 -4
  111. package/src/internal/failing.ts +37 -0
  112. package/src/internal/length-keys.ts +80 -0
  113. package/src/internal/measured-pairs.ts +58 -22
  114. package/src/internal/own-values.ts +2 -2
  115. package/src/internal/positional-keys.ts +4 -2
  116. package/src/internal/projection.ts +141 -37
  117. package/src/internal/renderer.ts +45 -92
  118. package/src/internal/scroll.ts +24 -2
  119. package/src/internal/transform-keys.ts +47 -0
  120. package/src/unstable/AppearAnimations.ts +73 -24
  121. package/src/unstable/BatchMembers.ts +32 -8
  122. package/src/unstable/DomValues.ts +1 -1
  123. package/src/unstable/DragTrack.ts +46 -12
  124. package/src/unstable/ElementSetup.ts +2 -1
  125. package/src/unstable/GestureFeatures.ts +23 -44
  126. package/src/unstable/LiveStyle.ts +12 -8
  127. package/src/unstable/MemberHold.ts +2 -2
  128. package/src/unstable/PointerValues.ts +73 -8
  129. package/src/unstable/PresenceController.ts +66 -40
  130. package/src/unstable/ReorderInput.ts +2 -2
  131. package/src/unstable/WardConfig.ts +17 -5
  132. package/src/unstable/features/TimelineKeys.ts +19 -2
@@ -28,8 +28,10 @@
28
28
  */
29
29
  import * as ScrollSource from "@wardic/core/ScrollSource"
30
30
  import * as SharedSource from "@wardic/core/SharedSource"
31
+ import * as Report from "@wardic/core/unstable/Report"
31
32
  import * as Arr from "effect/Array"
32
33
  import * as Bool from "effect/Boolean"
34
+ import * as Cause from "effect/Cause"
33
35
  import * as Effect from "effect/Effect"
34
36
  import { identity } from "effect/Function"
35
37
  import * as Iter from "effect/Iterable"
@@ -329,9 +331,18 @@ const open = (element: Element): Container => {
329
331
  return container
330
332
  }
331
333
 
332
- /** A reader of a container's scroll: the container's listeners held from `containers` while its Scope is open. */
334
+ /** A reader's Atom whose dependent threw as it was set: an app's Atom over the scroll, say. */
335
+ const DEPENDENT_FAILED = "wardic.scroll: its dependent failed"
336
+
337
+ /**
338
+ * A reader of a container's scroll: the container's listeners held from `containers` while its Scope is
339
+ * open, a failure reported on the context it's read in.
340
+ */
333
341
  const readerOf = (registry: AtomRegistry.AtomRegistry, containers: (element: Element) => Effect.Effect<Container, never, Scope.Scope>) =>
334
342
  Effect.fnUntraced(function* (options: ScrollSource.Options = {}) {
343
+ // Where its failure is reported (#979, row 14): the reader's, a provider's runtime with the app's
344
+ // logger, which a source's own build never sees (an app's layers sit beside it).
345
+ const context = yield* Effect.context<never>()
335
346
  const element = UndefinedOr.match(options.container as Element | undefined, { onUndefined: pageOf, onDefined: (given) => given })
336
347
  const container = yield* containers(element)
337
348
  const measure = measureOf(element, options)
@@ -339,11 +350,22 @@ const readerOf = (registry: AtomRegistry.AtomRegistry, containers: (element: Ele
339
350
  // Mounted while read, not kept alive: a kept-alive Atom's node never leaves the registry.
340
351
  const atom = Atom.make(last)
341
352
  const unmount = registry.mount(atom)
353
+ // #979, row 14 (ADR-0074): a dependent of its Atom that throws, an app's Atom over the scroll, is this
354
+ // reader's own: the Atom holds the scroll, and the container's later readers still hear the event.
355
+ // Before, the throw stopped the container's listener there, uncaught, every event. Reported once a
356
+ // run of throws, its flag cleared only when it's set.
357
+ let failing = false
342
358
  const read = (): void => {
343
359
  const next = measure()
344
360
  if (sameScroll(last, next)) return
345
361
  last = next
346
- registry.set(atom, next)
362
+ try {
363
+ registry.set(atom, next)
364
+ if (failing) failing = false
365
+ } catch (defect) {
366
+ if (!failing) Report.failureOn(context, DEPENDENT_FAILED, Cause.die(defect))
367
+ failing = true
368
+ }
347
369
  }
348
370
  yield* Effect.acquireRelease(
349
371
  Effect.sync(() => container.readers.add(read)),
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The DOM's transform keys, each with its identity: core's (`BaseValue.TRANSFORM_IDENTITY`), and the DOM's
3
+ * own, `transformPerspective`, a depth no other Environment draws. Every DOM reader of a transform key
4
+ * reads this table, so the DOM's own keys are transforms to each of them: the renderer, Own values, a
5
+ * Batch's members, Appear, reduced motion and the Default transition.
6
+ *
7
+ * @module
8
+ */
9
+ // #887 (ADR-0073, *Amendment (#887)*, Q1): core names no key only the page draws. As `positional-keys.ts`
10
+ // adds the box's keys to core's transforms, this adds the DOM's own transform keys to core's. #1002 would
11
+ // move here, at a major, the six of core's that only the DOM draws. TK1 pins that no dom source reads
12
+ // core's table but this module.
13
+ import * as BaseValue from "@wardic/core/BaseValue"
14
+ import * as Option from "effect/Option"
15
+ import * as Predicate from "effect/Predicate"
16
+ import * as Rec from "effect/Record"
17
+
18
+ /** An element's own depth, Motion's key: `perspective()` at the head of its transform, in px. */
19
+ export const PERSPECTIVE = "transformPerspective"
20
+
21
+ /**
22
+ * Each of the DOM's transform keys, with its identity: core's, and {@link PERSPECTIVE}'s 0. That 0 is no
23
+ * perspective, not a depth: it's left out of the transform, as Motion's is.
24
+ */
25
+ export const TRANSFORM_IDENTITY: Readonly<Record<string, number>> = Object.freeze({ ...BaseValue.TRANSFORM_IDENTITY, [PERSPECTIVE]: 0 })
26
+
27
+ /** A DOM transform key's identity (see {@link TRANSFORM_IDENTITY}), or `None` for any other key, prototype names included. */
28
+ export const transformIdentity = (key: string): Option.Option<number> => Rec.get(TRANSFORM_IDENTITY, key)
29
+
30
+ /** The DOM's transform keys, for a membership test a frame can make. */
31
+ export const TRANSFORM_KEYS: ReadonlySet<string> = new Set(Object.keys(TRANSFORM_IDENTITY))
32
+
33
+ /** Whether `key` is one of the DOM's transform keys. */
34
+ export const isTransformKey = (key: string): boolean => TRANSFORM_KEYS.has(key)
35
+
36
+ /**
37
+ * Whether the element's own depth draws a `perspective()`: above its identity, 0, which is no
38
+ * perspective. A depth below 0 isn't drawn either: CSS refuses a negative `perspective()`, and the whole
39
+ * `transform` with it, so a spring's overshoot past 0 draws no perspective. A string is read as Motion
40
+ * reads one, by `parseFloat`, and drawn when it can't be read (`var(--d)`). Per frame: statements.
41
+ */
42
+ // #887 (ADR-0073, *Amendment (#887)*, Q3): the renderer's, a projected element's and a Batch member's.
43
+ export const drawsDepth = (value: unknown): boolean => {
44
+ if (Predicate.isNumber(value)) return value > 0
45
+ const read = Number.parseFloat(String(value))
46
+ return Number.isNaN(read) || read > 0
47
+ }
@@ -47,6 +47,8 @@ import * as AppearHandoff from "@wardic/core/unstable/AppearHandoff"
47
47
  import type * as WardConfig from "./WardConfig.ts"
48
48
  import * as RetargetLegs from "@wardic/core/unstable/RetargetLegs"
49
49
  import * as ServerInterpolators from "./ServerInterpolators.ts"
50
+ import { DEPTH_MOVES_REASON } from "../internal/appear.ts"
51
+ import * as TransformKeys from "../internal/transform-keys.ts"
50
52
  import type * as VariantTarget from "@wardic/core/unstable/VariantTarget"
51
53
  import * as VariantTree from "@wardic/core/unstable/VariantTree"
52
54
 
@@ -109,7 +111,8 @@ const baseKeys = /*#__PURE__*/ new WeakMap<Values.Values, Option.Option<string>>
109
111
  */
110
112
  export const keyOf = (m: AppearHandoff.MountAnimation): Option.Option<string> => {
111
113
  const base = Option.getOrElse(Option.fromUndefinedOr(baseKeys.get(m.from)), () => {
112
- const computed = canonical({ from: m.from, to: m.to, transition: keyedTransitionOf(m), stops: m.stops })
114
+ // Its held keys (#1004) only when it holds any, so every other key's text is as it was.
115
+ const computed = canonical({ from: m.from, to: m.to, transition: keyedTransitionOf(m), stops: m.stops, ...UndefinedOr.match(heldOf(m), { onUndefined: () => ({}), onDefined: (held) => ({ held }) }) })
113
116
  baseKeys.set(m.from, computed)
114
117
  return computed
115
118
  })
@@ -142,10 +145,11 @@ const sampledTransition = (transition: WardConfig.WardicTransition | undefined):
142
145
 
143
146
  /**
144
147
  * One machine of a Retarget's legs, run together: each step steps every leg not yet settled, and
145
- * merges their values; it settles with the last. What a server samples. Built with the DOM's
148
+ * merges their values over `held`, the keys it holds where they are; it settles with the last. What a
149
+ * server samples. Built with the DOM's
146
150
  * Interpolators (a server projects with the DOM's `project`, ADR-0021 decision 2).
147
151
  */
148
- const together = (legs: ReadonlyArray<RetargetLegs.Leg>): Machine.Machine<Frame.Frame<Values.Values>> => {
152
+ const together = (legs: ReadonlyArray<RetargetLegs.Leg>, held: Values.Values | undefined): Machine.Machine<Frame.Frame<Values.Values>> => {
149
153
  const machines = Effect.runSync(
150
154
  ServerInterpolators.withServerInterpolators(Effect.all(Arr.map(legs, (leg): Effect.Effect<Machine.Machine<Frame.Frame<unknown>>, never, InterpolatorRegistry.InterpolatorRegistry> => machineOfLeg(leg)))),
151
155
  )
@@ -155,7 +159,7 @@ const together = (legs: ReadonlyArray<RetargetLegs.Leg>): Machine.Machine<Frame.
155
159
  start: () => {
156
160
  const runs = Arr.map(machines, (machine, i) => ({ step: machine.start(), key: keyOfLeg(legs[i] as RetargetLegs.Leg), last: Option.none<Frame.Frame<unknown>>() }))
157
161
  return (dt) => {
158
- const value: Record<string, number | string> = {}
162
+ const value: Record<string, number | string> = { ...held }
159
163
  const done = Arr.reduce(runs, true, (all, run) => {
160
164
  const frame = Option.getOrElse(Option.filter(run.last, (last) => last.done), () => run.step(dt))
161
165
  run.last = Option.some(frame)
@@ -201,6 +205,25 @@ const foreverByValue = (m: AppearHandoff.MountAnimation): boolean => {
201
205
  return Bool.or(AppearHandoff.repeatsForever(m.transition), Arr.some(runsOn, AppearHandoff.repeatsForever))
202
206
  }
203
207
 
208
+ /**
209
+ * The keys a mount animation's rule holds in every stop: its transform keys left where they are, when its
210
+ * rule writes a `transform`, which replaces the element's whole: beside a moving transform key, and in
211
+ * every stop of a layout node's, drawn through its projection, and of a templated element's. `undefined`
212
+ * with none, and when the rule writes no `transform`, the element's own style holding them.
213
+ */
214
+ // #1004 (ADR-0044, *Amendment (#1004)*): one left out jumped while the CSS played, and back at the Handoff.
215
+ const heldOf = (m: AppearHandoff.MountAnimation): Values.Values | undefined => {
216
+ if (Predicate.isUndefined(m.held)) return undefined
217
+ if (Bool.not(writesTransform(m))) return undefined
218
+ const held = Rec.filter(m.held, (_, key) => TransformKeys.isTransformKey(key))
219
+ if (Rec.isEmptyRecord(held)) return undefined
220
+ return held
221
+ }
222
+
223
+ /** Whether a mount animation's rule writes a `transform` in its stops: a transform key moves, or it's a layout node's or a templated element's. */
224
+ const writesTransform = (m: AppearHandoff.MountAnimation): boolean =>
225
+ Bool.or(Bool.or(m.layout, Predicate.isNotUndefined(m.template)), Arr.some(Rec.keys(m.to), TransformKeys.isTransformKey))
226
+
204
227
  /** A mount animation's spec for the DOM's sampler, or why it has none. */
205
228
  export const specOf = (m: AppearHandoff.MountAnimation): Result.Result<Appear.Spec, string> =>
206
229
  Option.match(keyOf(m), {
@@ -218,11 +241,12 @@ export const specOf = (m: AppearHandoff.MountAnimation): Result.Result<Appear.Sp
218
241
  projected: m.layout,
219
242
  template: m.template,
220
243
  // Skipped (#468): every key's snap, landing on its first frame, a rule of 0 s.
221
- machine: () =>
222
- Bool.match(forever, {
223
- onTrue: () => Machine.holdAfter(together(RetargetLegs.legsOf(m.from, m.to, transition, m.reduced, skipped, DOM_POSITIONAL, DOM_DEFAULTS, RetargetLegs.NO_VELOCITY, undefined, m.stops)), repeatDelay),
224
- onFalse: () => together(RetargetLegs.legsOf(m.from, m.to, transition, m.reduced, skipped, DOM_POSITIONAL, DOM_DEFAULTS, RetargetLegs.NO_VELOCITY, undefined, m.stops)),
225
- }),
244
+ machine: () => {
245
+ // Its held keys as where the element is now, the client's snapshot (#1019): a Path's axis that isn't a
246
+ // number, there, takes it no path, as on the client.
247
+ const legs = together(RetargetLegs.legsOf(m.from, m.to, transition, m.reduced, skipped, DOM_POSITIONAL, DOM_DEFAULTS, RetargetLegs.NO_VELOCITY, undefined, m.stops, undefined, m.held), heldOf(m))
248
+ return Bool.match(forever, { onTrue: () => Machine.holdAfter(legs, repeatDelay), onFalse: () => legs })
249
+ },
226
250
  })
227
251
  },
228
252
  })
@@ -230,8 +254,10 @@ export const specOf = (m: AppearHandoff.MountAnimation): Result.Result<Appear.Sp
230
254
  /**
231
255
  * Why a mount animation can't play before hydration, or `None` when it can (decision 4): a key
232
256
  * starting from anything but `initial`, a value the DOM reads from the element (`auto`, `var()`),
233
- * or a start that can't take its target's shape (a length pair in two units).
257
+ * a start that can't take its target's shape (a length pair in two units), or the element's own
258
+ * depth, `transformPerspective`, which CSS blends unlike Wardic. `to` holds the keys that move.
234
259
  */
260
+ // #887 (ADR-0073, *Amendment (#887)*, Q13): the depth, as a Batch's rule leaves it (`appear.ts`'s `DEPTH_MOVES_REASON`).
235
261
  export const unplayable = (initial: Values.Values, to: Values.Values): Option.Option<string> =>
236
262
  Arr.findFirst(Rec.toEntries(to), ([key, target]) =>
237
263
  Option.match(Option.fromUndefinedOr(initial[key]), {
@@ -243,7 +269,7 @@ export const unplayable = (initial: Values.Values, to: Values.Values): Option.Op
243
269
  // A start that can't take its target's shape, a length in another unit among them (ADR-0024).
244
270
  Bool.match(Option.isNone(OwnValues.valueLike(start, target)), {
245
271
  onTrue: () => Option.some(`${key}'s start and target don't take one shape`),
246
- onFalse: () => Option.none(),
272
+ onFalse: () => Bool.match(key === TransformKeys.PERSPECTIVE, { onTrue: () => Option.some(DEPTH_MOVES_REASON), onFalse: () => Option.none() }),
247
273
  }),
248
274
  }),
249
275
  }))
@@ -427,7 +453,9 @@ export const serverAppear = (reducedMotion: ReducedMotion.Config, explain?: (mes
427
453
  const write = (batch: ReadonlyArray<Entry>): string => {
428
454
  // Each entry's plays are its own setting's (#434): the normal ones always, the reduced ones under
429
455
  // the media query when an entry follows the user.
430
- const resolve = (pick: "normal" | "reduced") => timings(batch, pick)
456
+ // A `delayChildren` function that throws, reported once a write (#979).
457
+ const delays = VariantTree.eventDelayFailuresOf(VariantTree.ON_SERVER)
458
+ const resolve = (pick: "normal" | "reduced") => timings(batch, pick, delays)
431
459
  const normal = resolve("normal")
432
460
  const reduced = Bool.match(Arr.some(batch, isUser), { onTrue: () => Option.some(resolve("reduced")), onFalse: () => Option.none<Timings>() })
433
461
  const settings = Arr.prepend(Option.toArray(reduced), normal)
@@ -509,7 +537,7 @@ export const serverAppear = (reducedMotion: ReducedMotion.Config, explain?: (mes
509
537
  * is among that group's children in its batch, and it doesn't wait on the leader (decision 5 of
510
538
  * *Amendment (#245)*). The shell's batch is every entry, so nothing changes for it.
511
539
  */
512
- const timings = (entries: ReadonlyArray<Entry>, pick: "normal" | "reduced"): Timings => {
540
+ const timings = (entries: ReadonlyArray<Entry>, pick: "normal" | "reduced", delays: VariantTree.DelayFailures): Timings => {
513
541
  const memo = new Map<Entry, Result.Result<{ readonly play: TimedPlay; readonly settled: number }, string>>()
514
542
  let geometry = false
515
543
  const inBatch = new Set(entries)
@@ -554,7 +582,7 @@ const timings = (entries: ReadonlyArray<Entry>, pick: "normal" | "reduced"): Tim
554
582
  })
555
583
  /** When `entry` starts: its stagger, after its parent under `beforeChildren`, after its children under `afterChildren`. */
556
584
  const startOf = (entry: Entry): Result.Result<number, string> =>
557
- Result.flatMap(afterParent(entry), (afterLeader) => Result.map(afterChildren(entry), (afterKids) => Math.max(afterLeader, afterKids) + ownStaggerOf(entry, childrenOf)))
585
+ Result.flatMap(afterParent(entry), (afterLeader) => Result.map(afterChildren(entry), (afterKids) => Math.max(afterLeader, afterKids) + ownStaggerOf(entry, childrenOf, delays)))
558
586
  // A leader written earlier started at first paint: a late child doesn't wait on it.
559
587
  const afterParent = (entry: Entry): Result.Result<number, string> =>
560
588
  Option.match(Option.filter(entry.group, (g) => Bool.and(g.when === "beforeChildren", inBatch.has(g.leader))), {
@@ -634,23 +662,23 @@ const groupSupports = (
634
662
  }
635
663
 
636
664
  /** An entry's own stagger: none when it's skipped (#468), as its client's snap has no delay; its `when` waits still hold. */
637
- const ownStaggerOf = (entry: Entry, childrenOf: (g: AppearGroup) => ReadonlyArray<Entry>): number => {
665
+ const ownStaggerOf = (entry: Entry, childrenOf: (g: AppearGroup) => ReadonlyArray<Entry>, delays: VariantTree.DelayFailures): number => {
638
666
  if (entry.skipped) return 0
639
- return staggerOf(entry, childrenOf)
667
+ return staggerOf(entry, childrenOf, delays)
640
668
  }
641
669
 
642
670
  /**
643
671
  * A Variant child's stagger: its parent's `delayChildren` plus its place (ADR-0007), as the client
644
672
  * works it out, among the group's children in its batch (`childrenOf`, #245).
645
673
  */
646
- const staggerOf = (entry: Entry, childrenOf: (g: AppearGroup) => ReadonlyArray<Entry>): number =>
674
+ const staggerOf = (entry: Entry, childrenOf: (g: AppearGroup) => ReadonlyArray<Entry>, delays: VariantTree.DelayFailures): number =>
647
675
  Option.match(entry.group, {
648
676
  onNone: () => 0,
649
677
  onSome: (g) => {
650
678
  const children = childrenOf(g)
651
679
  const n = children.length
652
680
  const i = children.indexOf(entry)
653
- return VariantTree.childDelayOf(g.stagger, i, n)
681
+ return VariantTree.childDelayOf(g.stagger, i, n, delays)
654
682
  },
655
683
  })
656
684
 
@@ -704,21 +732,41 @@ export const enterServer = (
704
732
  } => {
705
733
  // Its starts and targets once, both plays sharing them (and so their key's text, `keyOf`). A key
706
734
  // already at its target, coerced to its shape, is left out, as the client's first Retarget starts
707
- // it no leg (#448); a Keyframes key never is, and starts at its first stop, unless the mount starts
708
- // at its `animate`, when nothing plays (#429, Motion's).
735
+ // it no leg (#448), unless its transition kicks it (#1018); a Keyframes key never is, and starts at
736
+ // its first stop, unless the mount starts at its `animate`, when nothing plays (#429, Motion's).
737
+ // The keys left out stay still, held where they are (#1004), as the client writes them beside the moving ones.
709
738
  const mount = Option.flatMap(el.to, (to) => {
710
- const moving = Rec.filter(to, (target, key) =>
711
- Bool.match(hasStops(el.keyframes, key), { onTrue: () => Bool.not(el.quiet), onFalse: () => Bool.not(atTarget(el.initial[key], target)) }))
739
+ // One at its target moves when its transition kicks it, as the client's does (#1018), unless the mount
740
+ // starts at its `animate`, when nothing plays (#475): a quiet mount never asks. A number alone: a string,
741
+ // the element's own `auto` among them, isn't kicked, and is left out, so its element's other keys play.
742
+ const kicked = (target: number | string, key: string): boolean => {
743
+ if (el.quiet) return false
744
+ if (Bool.not(Predicate.isNumber(target))) return false
745
+ return RetargetLegs.givesVelocity(el.transition, key)
746
+ }
747
+ const moves = (target: number | string, key: string): boolean =>
748
+ Bool.match(hasStops(el.keyframes, key), {
749
+ onTrue: () => Bool.not(el.quiet),
750
+ onFalse: () => Bool.match(atTarget(el.initial[key], target), { onTrue: () => kicked(target, key), onFalse: () => true }),
751
+ })
752
+ // A Path couples `x` and `y` (#438): with either moving, the other goes along it from its own value, as the
753
+ // client's spine has it (#1019), a number alone: one that isn't takes no path on the client either. The still
754
+ // keys are `moves`'s, so one it puts back stays held, as the client keeps it among its keys already there:
755
+ // both sides' mount animations match.
756
+ const moving = RetargetLegs.withPathAxes(Rec.filter(to, moves), Rec.filter(to, (target) => Predicate.isNumber(target)), el.transition)
757
+ // With them, the keys only `initial` sets, which stay where it put them (#1022), as the client keeps them.
758
+ const still = { ...Rec.filter(el.initial, (_, key) => Bool.not(Object.hasOwn(to, key))), ...Rec.filter(to, (target, key) => Bool.not(moves(target, key))) }
712
759
  return Bool.match(Rec.isEmptyRecord(moving), {
713
760
  onTrue: () => Option.none(),
714
- onFalse: () => Option.some(Result.map(playable(el, moving), (prepared): RetargetLegs.KeyframesStart & { readonly to: Values.Values } => startedOf(prepared, el.keyframes))),
761
+ onFalse: () =>
762
+ Option.some(Result.map(playable(el, moving), (prepared): RetargetLegs.KeyframesStart & { readonly to: Values.Values; readonly still: Values.Values } => ({ ...startedOf(prepared, el.keyframes), still }))),
715
763
  })
716
764
  })
717
765
  // Skipped (#468): its config's, or its whole transition's own, as the client's legs read them.
718
766
  const skipped = Bool.or(el.skipAnimations === true, UndefinedOr.match(el.transition, { onUndefined: () => false, onDefined: (t) => t.skipAnimations === true }))
719
767
  const play = (reduced: boolean): Option.Option<Result.Result<AppearHandoff.MountAnimation, string>> =>
720
768
  Option.map(mount, (prepared) =>
721
- Result.map(prepared, ({ from, to, stops }): AppearHandoff.MountAnimation => ({
769
+ Result.map(prepared, ({ from, to, stops, still }): AppearHandoff.MountAnimation => ({
722
770
  tag: el.tag,
723
771
  from,
724
772
  to,
@@ -728,6 +776,7 @@ export const enterServer = (
728
776
  stops,
729
777
  ...AppearHandoff.skippedField(skipped),
730
778
  ...UndefinedOr.match(el.template, { onUndefined: () => ({}), onDefined: (template) => ({ template }) }),
779
+ held: still,
731
780
  })))
732
781
  const plays = Bool.match(skipped, {
733
782
  onTrue: () => {
@@ -24,7 +24,6 @@
24
24
  // ADR-0070 decisions 10–15 and *Amendment (#665)*. The DOM's writer, imported here so an app that never
25
25
  // makes a Batch ships none of it (ADR-0070, *Amendment (#665)*).
26
26
  import * as Batch from "@wardic/core/Batch"
27
- import * as BaseValue from "@wardic/core/BaseValue"
28
27
  import type * as DefaultTransition from "@wardic/core/DefaultTransition"
29
28
  import * as Playback from "@wardic/core/Playback"
30
29
  import * as ReducedMotion from "@wardic/core/ReducedMotion"
@@ -58,16 +57,19 @@ import * as BatchCalls from "@wardic/core/unstable/BatchCalls"
58
57
  import { delayedBy, INSTANT, isFirstStop, isPair, type KeyPlan, memberTransitionsOf, staggerOf, unstaggered } from "@wardic/core/unstable/BatchCalls"
59
58
  import type * as WardicServices from "@wardic/core/unstable/WardicServices"
60
59
  import * as WardicConfigValue from "@wardic/core/unstable/WardicConfigValue"
60
+ import * as TransformKeys from "../internal/transform-keys.ts"
61
61
 
62
62
  /** The keys a Batch's members animate on the DOM: the transforms and `opacity`, as numbers. */
63
+ // #887: the element's own depth, and `scaleZ`, which #883 drew but never typed.
63
64
  export type WardicBatchKey =
65
+ | "transformPerspective"
64
66
  | "x" | "y" | "z" | "translateX" | "translateY" | "translateZ"
65
- | "scale" | "scaleX" | "scaleY"
67
+ | "scale" | "scaleX" | "scaleY" | "scaleZ"
66
68
  | "rotate" | "rotateX" | "rotateY" | "rotateZ"
67
69
  | "skewX" | "skewY"
68
70
  | "opacity"
69
71
 
70
- /** A member's values: numbers on its keys, in `px` for a move, degrees for a turn, unitless for a scale and `opacity`. */
72
+ /** A member's values: numbers on its keys, in `px` for a move and a depth, degrees for a turn, unitless for a scale and `opacity`. */
71
73
  export type WardicBatchValues = { readonly [K in WardicBatchKey]?: number }
72
74
 
73
75
  /**
@@ -450,7 +452,7 @@ export type BatchGroup = "transform" | "opacity"
450
452
  /** The group `key` is drawn in on the DOM: a transform key's `transform`, `opacity`'s own, or none. */
451
453
  export const batchGroupOf = (key: string): BatchGroup | undefined => {
452
454
  if (key === "opacity") return "opacity"
453
- if (Predicate.isNotUndefined(BaseValue.TRANSFORM_IDENTITY[key])) return "transform"
455
+ if (Predicate.isNotUndefined(TransformKeys.TRANSFORM_IDENTITY[key])) return "transform"
454
456
  return undefined
455
457
  }
456
458
 
@@ -663,7 +665,7 @@ const noMember = (i: number, count: number): never => fail(`it has no member ${i
663
665
  /** Each key's identity: a transform's, and `opacity`'s 1, an element's own with no style of its own. */
664
666
  // Per member per key at mount (#540): statements.
665
667
  export const identityOf = (key: string): number => {
666
- const identity = BaseValue.TRANSFORM_IDENTITY[key]
668
+ const identity = TransformKeys.TRANSFORM_IDENTITY[key]
667
669
  if (Predicate.isUndefined(identity)) return 1
668
670
  return identity
669
671
  }
@@ -873,6 +875,10 @@ export const markLayoutElement = (element: Element): void => {
873
875
  LAYOUT_ELEMENTS.add(element)
874
876
  }
875
877
 
878
+ /** The error for a member's element with no inline style: one of a foreign namespace. */
879
+ const stylelessMember = (element: Element): string =>
880
+ `a member's element (${elementName(element)}) has no inline style for the Batch to draw its \`transform\` and \`opacity\` on: give it an HTML, SVG or MathML element`
881
+
876
882
  /** The error for a layout node on a Batch member's element. */
877
883
  const layoutOnMember = (element: Element): string =>
878
884
  `a member's element (${elementName(element)}) has \`layout\` or \`layoutId\`: the Batch draws its transform, under which the projection measures it. Give its Wardic element no layout, or leave it out of the Batch`
@@ -1815,13 +1821,19 @@ export const bindBatch = (env: BatchEnv, config: BatchConfig | KeyedBatchConfig<
1815
1821
  if (disposed) return Arr.forEach(going, cutExit)
1816
1822
  const exitTargets = new Float64Array(capacity * stride).fill(Number.NaN)
1817
1823
  const moving: Array<number> = []
1818
- // Per leaver at its exit (#665): statements. An exit that fails is reported, and lets its element go.
1824
+ // Per leaver at its exit (#665): statements. An exit that fails lets its element go, and is reported
1825
+ // once for this task's leavers: one exit function called for each (#979 group I, row 29; ADR-0074
1826
+ // decision 3, an event's run, as an exit's stagger is).
1827
+ let reported = false
1819
1828
  Arr.forEach(going, (i) => {
1820
1829
  try {
1821
1830
  targetsInto(exitTargets, i, exitValuesOf(i, UndefinedOr.getOrThrow(exits[i]).custom))
1822
1831
  moving.push(i)
1823
1832
  } catch (defect) {
1824
- env.runtime.runFork(Report.failure("createBatch: a member's exit failed", Cause.die(defect)))
1833
+ if (!reported) {
1834
+ reported = true
1835
+ env.runtime.runFork(Report.failure("createBatch: a member's exit failed", Cause.die(defect)))
1836
+ }
1825
1837
  cutExit(i)
1826
1838
  if (unlisted.has(i)) leaveBatch(i)
1827
1839
  }
@@ -2209,7 +2221,17 @@ export const bindBatch = (env: BatchEnv, config: BatchConfig | KeyedBatchConfig<
2209
2221
  * them, one a change didn't move among them, or each one the Handoff's code never came for.
2210
2222
  */
2211
2223
  const releaseAppearing = (): void => {
2212
- Iter.forEach(appearing, (slot) => UndefinedOr.map(elementOf[memberOf[slot] as number] as (Element & ElementCSSInlineStyle) | undefined, Appear.release))
2224
+ // Each member's own: one that throws leaves the others let go, reported once a release (#977).
2225
+ let failed = false
2226
+ Iter.forEach(appearing, (slot) => {
2227
+ try {
2228
+ UndefinedOr.map(elementOf[memberOf[slot] as number] as (Element & ElementCSSInlineStyle) | undefined, Appear.release)
2229
+ } catch (defect) {
2230
+ if (failed) return
2231
+ failed = true
2232
+ env.runtime.runFork(Report.failure("wardic.batch: a member's Appear release failed", Cause.die(defect)))
2233
+ }
2234
+ })
2213
2235
  appearing.clear()
2214
2236
  handoffAt = undefined
2215
2237
  }
@@ -2646,6 +2668,8 @@ export const bindBatch = (env: BatchEnv, config: BatchConfig | KeyedBatchConfig<
2646
2668
  // can't be a member: the projection measures it under the transform the Batch draws.
2647
2669
  if (drawnByAnother(el)) return fail(`an element (${elementName(el)}) is a member of two Batches: one Batch draws an element's \`transform\` and \`opacity\``)
2648
2670
  if (LAYOUT_ELEMENTS.has(el)) return fail(layoutOnMember(el))
2671
+ // Its inline style is what the Batch draws: one with none is refused before it's entered (#977, Q6).
2672
+ if (Predicate.isUndefined((el as Partial<ElementCSSInlineStyle>).style)) return fail(stylelessMember(el))
2649
2673
  const was = elementOf[i]
2650
2674
  if (Predicate.isNotUndefined(was)) forget(was, i)
2651
2675
  elementOf[i] = el
@@ -36,7 +36,7 @@ const withRead = (pair: Requested): MeasuredPairs.Requested => ({ ...pair, measu
36
36
  /** The DOM's Measured pairs: a pair whose units don't blend, measured on its element at the end of the task. */
37
37
  export const measuredPairs: MeasuredPairs.Shape = {
38
38
  needs,
39
- measure: (subject, pairs, values) => Rec.map(measure(subject as HTMLElement, pairs, values), withRead),
39
+ measure: (subject, pairs, values, failed) => Rec.map(measure(subject as HTMLElement, pairs, values, failed), withRead),
40
40
  }
41
41
 
42
42
  /** The DOM's Variable values: a `var(--x)`, resolved on its element as each leg starts. */
@@ -88,6 +88,7 @@ import type * as WardicServices from "@wardic/core/unstable/WardicServices"
88
88
  import type * as WardConfig from "./WardConfig.ts"
89
89
  import * as DragControls from "./DragControls.ts"
90
90
  import * as DragTransition from "./DragTransition.ts"
91
+ import * as Failing from "../internal/failing.ts"
91
92
  import * as WardicConfigValue from "@wardic/core/unstable/WardicConfigValue"
92
93
 
93
94
 
@@ -170,8 +171,8 @@ export type TrackServices = WardicServices.WardicServices | InputSource.InputSou
170
171
  export interface DragTrackOptions {
171
172
  /**
172
173
  * Runs the track in the element's watch Scope: its watches subscribed now, with no
173
- * fiber, until the element goes and the Scope closes, which stops a running release. A throw from a
174
- * watch's fold goes to the `onDefect` it's given (#209: each binding owns the Scope).
174
+ * fiber, until the element goes and the Scope closes, which stops a running release. A run of throws
175
+ * from a watch's fold goes to the `onDefect` it's given, at its first (#209: each binding owns the Scope).
175
176
  */
176
177
  readonly watch: (track: (onDefect: InputFeed.OnDefect) => Effect.Effect<void, never, Scope.Scope | TrackServices>) => void
177
178
  /**
@@ -292,6 +293,17 @@ interface DragTrackState {
292
293
  /** The track's one cell, written by its handlers and by its release's sink, never at once. */
293
294
  type TrackState = MutableRef.MutableRef<DragTrackState>
294
295
 
296
+ /** A track's kinds of failure, each with its own run: a response at each sample, a measure, a release. */
297
+ // #979 group I, row 28 (ADR-0074 decision 3): each was reported at every throw.
298
+ type TrackFailure = "release" | "measuring" | "response"
299
+
300
+ /** `report`, at the start of a run of `kind`'s failures on the track: nothing while one is on. */
301
+ const atRunStart = (failing: Failing.Failing<TrackFailure>, kind: TrackFailure, report: Effect.Effect<void>): Effect.Effect<void> =>
302
+ Effect.suspend(() => {
303
+ if (Failing.firstThrowOf(failing, kind)) return report
304
+ return Effect.void
305
+ })
306
+
295
307
  const ORIGIN: Point.Point = { x: 0, y: 0 }
296
308
 
297
309
  /**
@@ -559,6 +571,7 @@ const release = (
559
571
  position: Point.Point,
560
572
  velocity: Point.Point,
561
573
  taken: Deferred.Deferred<void>,
574
+ failing: Failing.Failing<TrackFailure>,
562
575
  ): Effect.Effect<void, never, FrameLoop.FrameLoop> => {
563
576
  const cfg = opts.config
564
577
 
@@ -580,6 +593,11 @@ const release = (
580
593
  opts.setDragging(false)
581
594
  UndefinedOr.map(opts.onReleaseEnd, (ended) => opts.gate.afterFlush(ended))
582
595
  })
596
+ // A release that dies is reported at the first of the track's run of them, and rests where it was
597
+ // dropped; one that lands ends the run.
598
+ const failed = (defect: unknown): Effect.Effect<void> =>
599
+ atRunStart(failing, "release", Report.failure("wardic.drag: a release failed", Cause.die(defect))).pipe(Effect.andThen(Effect.sync(() => tapFrame(position, ORIGIN))))
600
+ const landed = Effect.sync(() => Failing.endRunOf(failing, "release"))
583
601
  const { axis, bounds } = MutableRef.get(state)
584
602
  const edges = edgesOf(cfg, bounds)
585
603
  const v = releaseVelocity(cfg, velocity)
@@ -608,7 +626,8 @@ const release = (
608
626
  keepVelocity(opts, ORIGIN)
609
627
  if (MutableRef.get(state).releasing) directSet(opts, restOfRelease(position, v, axis, edges, transition))
610
628
  }).pipe(
611
- Effect.catchDefect((defect) => Report.failure("wardic.drag: a release failed", Cause.die(defect)).pipe(Effect.andThen(Effect.sync(() => tapFrame(position, ORIGIN))))),
629
+ Effect.andThen(landed),
630
+ Effect.catchDefect(failed),
612
631
  Effect.andThen(Microtask.next),
613
632
  Effect.andThen(done),
614
633
  ),
@@ -626,8 +645,8 @@ const release = (
626
645
  Machine.run((frame) => tapFrame({ x: position.x, y: frame.value }, { x: 0, y: frame.velocity })),
627
646
  )),
628
647
  Match.orElse(() => Machine.inertiaVec(position, v, { ...transition, ...edges }).pipe(Machine.run((frame) => tapFrame(frame.value, frame.velocity)))),
629
- Effect.catchDefect((defect) =>
630
- Report.failure("wardic.drag: a release failed", Cause.die(defect)).pipe(Effect.andThen(Effect.sync(() => tapFrame(position, ORIGIN))))),
648
+ Effect.andThen(landed),
649
+ Effect.catchDefect(failed),
631
650
  Effect.andThen(done),
632
651
  ),
633
652
  )
@@ -724,13 +743,18 @@ export const driveDragTrack = (opts: DragTrackOptions): DragTrack => {
724
743
  const watching = yield* FiberHandle.make<void>()
725
744
  let watched: Element | undefined = undefined
726
745
  let warned = false
746
+ const failing: Failing.Failing<TrackFailure> = { failing: undefined }
727
747
  const setBounds = (bounds: Drag.Bounds | undefined): void => {
728
748
  MutableRef.update(state, (st) => ({ ...st, bounds }))
729
749
  }
730
750
  /** The bounds measured against `container`'s `box`; none, reported, if measuring throws (an app's `onMeasureDragConstraints`). */
731
751
  const measured = (container: DragConstraints.DragContainer, box: Element): Effect.Effect<Drag.Bounds | undefined> =>
732
- Effect.sync((): Drag.Bounds | undefined => container.bounds(box)).pipe(
733
- Effect.catchDefect((defect) => Report.failure("wardic.drag: measuring dragConstraints failed", Cause.die(defect)).pipe(Effect.as(undefined))),
752
+ Effect.sync((): Drag.Bounds | undefined => {
753
+ const bounds = container.bounds(box)
754
+ Failing.endRunOf(failing, "measuring")
755
+ return bounds
756
+ }).pipe(
757
+ Effect.catchDefect((defect) => atRunStart(failing, "measuring", Report.failure("wardic.drag: measuring dragConstraints failed", Cause.die(defect))).pipe(Effect.as(undefined))),
734
758
  )
735
759
  /**
736
760
  * A resize of the element or its container: the bounds measured again. The first measure only
@@ -827,7 +851,7 @@ export const driveDragTrack = (opts: DragTrackOptions): DragTrack => {
827
851
  taken = Deferred.makeUnsafe<void>()
828
852
  return taken
829
853
  }).pipe(
830
- Effect.flatMap((ended) => FiberHandle.run(releasing, release(opts, state, position, velocity, ended))),
854
+ Effect.flatMap((ended) => FiberHandle.run(releasing, release(opts, state, position, velocity, ended, failing))),
831
855
  Effect.asVoid,
832
856
  )
833
857
 
@@ -911,11 +935,21 @@ export const driveDragTrack = (opts: DragTrackOptions): DragTrack => {
911
935
  })
912
936
 
913
937
  /**
914
- * A response, run inside its event (`opts.fork`): one that fails is reported, and the next
915
- * event's runs (ADR-0055 *Amendment (#379)*, Q4). A release reports its own (#66).
938
+ * A response, run inside its event (`opts.fork`): one that fails is reported at the first of a run
939
+ * of them, and the next event's runs (ADR-0055 *Amendment (#379)*, Q4). A release reports its own (#66).
916
940
  */
917
- const respond = (response: Effect.Effect<void, never, FrameLoop.FrameLoop>): void =>
918
- opts.fork(response.pipe(Effect.catchCause((cause) => Report.failure("wardic.drag: a response failed", cause))))
941
+ // Made once a track: a sample's response allocates nothing more than its fold. An interruption
942
+ // neither starts a run nor ends one.
943
+ const responded = Effect.sync(() => Failing.endRunOf(failing, "response"))
944
+ const responseExits = {
945
+ onSuccess: () => responded,
946
+ onFailure: (cause: Cause.Cause<never>): Effect.Effect<void> =>
947
+ Bool.match(Cause.hasInterruptsOnly(cause), {
948
+ onTrue: () => Effect.void,
949
+ onFalse: () => atRunStart(failing, "response", Report.failure("wardic.drag: a response failed", cause)),
950
+ }),
951
+ }
952
+ const respond = (response: Effect.Effect<void, never, FrameLoop.FrameLoop>): void => opts.fork(Effect.matchCauseEffect(response, responseExits))
919
953
 
920
954
  // Subscribed in this order, so the samples hear an event before the grabs. The constraints
921
955
  // bound the element's x/y, so they're applied where the gesture's offset meets its base, in
@@ -43,6 +43,7 @@ import * as LiveStyle from "./LiveStyle.ts"
43
43
  import * as Spine from "@wardic/core/unstable/Spine"
44
44
  import * as VariantTree from "@wardic/core/unstable/VariantTree"
45
45
  import * as VariantTarget from "@wardic/core/unstable/VariantTarget"
46
+ import * as TransformKeys from "../internal/transform-keys.ts"
46
47
 
47
48
  /**
48
49
  * A mounted element's Base-value links (ADR-0022): a key with no value starts from its `style`
@@ -92,7 +93,7 @@ export const restingOf = (key: string, initial: Values.Values, style: object | s
92
93
  Option.getOrUndefined(
93
94
  Option.fromUndefinedOr(initial[key]).pipe(
94
95
  Option.orElse((): Option.Option<unknown> => Option.flatMap(OwnValues.styleValueOf(style, key), (raw) => Option.fromNullishOr(read(raw)))),
95
- Option.orElse((): Option.Option<unknown> => BaseValue.transformIdentity(key)),
96
+ Option.orElse((): Option.Option<unknown> => TransformKeys.transformIdentity(key)),
96
97
  ),
97
98
  )
98
99