@wardic/core 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 (245) hide show
  1. package/dist/Arc.d.ts +2 -2
  2. package/dist/Arc.js +1 -1
  3. package/dist/BaseValue.d.ts +11 -10
  4. package/dist/BaseValue.d.ts.map +1 -1
  5. package/dist/BaseValue.js +12 -15
  6. package/dist/BaseValue.js.map +1 -1
  7. package/dist/Batch.d.ts +12 -6
  8. package/dist/Batch.d.ts.map +1 -1
  9. package/dist/Batch.js +374 -30
  10. package/dist/Batch.js.map +1 -1
  11. package/dist/Clock.d.ts +16 -0
  12. package/dist/Clock.d.ts.map +1 -1
  13. package/dist/Clock.js +22 -8
  14. package/dist/Clock.js.map +1 -1
  15. package/dist/DefaultTransition.d.ts +3 -2
  16. package/dist/DefaultTransition.d.ts.map +1 -1
  17. package/dist/DefaultTransition.js +5 -3
  18. package/dist/DefaultTransition.js.map +1 -1
  19. package/dist/Drag.d.ts +24 -9
  20. package/dist/Drag.d.ts.map +1 -1
  21. package/dist/Drag.js +10 -10
  22. package/dist/Drag.js.map +1 -1
  23. package/dist/DragActivity.js +3 -3
  24. package/dist/DragRecognizer.d.ts +14 -8
  25. package/dist/DragRecognizer.d.ts.map +1 -1
  26. package/dist/DragRecognizer.js +93 -34
  27. package/dist/DragRecognizer.js.map +1 -1
  28. package/dist/Easing.d.ts +1 -1
  29. package/dist/Easing.js +1 -1
  30. package/dist/Frame.d.ts.map +1 -1
  31. package/dist/Frame.js +5 -3
  32. package/dist/Frame.js.map +1 -1
  33. package/dist/InputFeed.d.ts +11 -8
  34. package/dist/InputFeed.d.ts.map +1 -1
  35. package/dist/InputFeed.js +18 -37
  36. package/dist/InputFeed.js.map +1 -1
  37. package/dist/InputSource.d.ts +3 -3
  38. package/dist/InputSource.js +2 -2
  39. package/dist/Interpolator.d.ts +2 -2
  40. package/dist/Interpolator.js +2 -2
  41. package/dist/InterpolatorRegistry.d.ts +29 -15
  42. package/dist/InterpolatorRegistry.d.ts.map +1 -1
  43. package/dist/InterpolatorRegistry.js +17 -8
  44. package/dist/InterpolatorRegistry.js.map +1 -1
  45. package/dist/LiveValue.d.ts +16 -9
  46. package/dist/LiveValue.d.ts.map +1 -1
  47. package/dist/LiveValue.js +204 -27
  48. package/dist/LiveValue.js.map +1 -1
  49. package/dist/Machine.d.ts +21 -8
  50. package/dist/Machine.d.ts.map +1 -1
  51. package/dist/Machine.js +184 -60
  52. package/dist/Machine.js.map +1 -1
  53. package/dist/Playback.d.ts.map +1 -1
  54. package/dist/Playback.js +16 -9
  55. package/dist/Playback.js.map +1 -1
  56. package/dist/Projection.d.ts +9 -9
  57. package/dist/Projection.js +2 -2
  58. package/dist/Recognizer.d.ts +2 -2
  59. package/dist/Recognizer.d.ts.map +1 -1
  60. package/dist/Recognizer.js +15 -10
  61. package/dist/Recognizer.js.map +1 -1
  62. package/dist/ReducedMotion.d.ts +4 -4
  63. package/dist/ReducedMotion.js +6 -6
  64. package/dist/Renderer.d.ts +5 -5
  65. package/dist/Renderer.js +6 -6
  66. package/dist/Renderer.js.map +1 -1
  67. package/dist/Reorder.d.ts +1 -1
  68. package/dist/Reorder.d.ts.map +1 -1
  69. package/dist/Reorder.js +2 -1
  70. package/dist/Reorder.js.map +1 -1
  71. package/dist/ScrollSource.d.ts +1 -1
  72. package/dist/ScrollSource.d.ts.map +1 -1
  73. package/dist/Sequence.d.ts +1 -1
  74. package/dist/SharedSource.d.ts +3 -3
  75. package/dist/SharedSource.js +5 -5
  76. package/dist/SharedSource.js.map +1 -1
  77. package/dist/Spring.d.ts.map +1 -1
  78. package/dist/Spring.js +2 -1
  79. package/dist/Spring.js.map +1 -1
  80. package/dist/Values.d.ts +2 -2
  81. package/dist/Values.js +1 -1
  82. package/dist/index.d.ts +1 -1
  83. package/dist/index.js +1 -1
  84. package/dist/internal/carried.d.ts +13 -0
  85. package/dist/internal/carried.d.ts.map +1 -0
  86. package/dist/internal/carried.js +23 -0
  87. package/dist/internal/carried.js.map +1 -0
  88. package/dist/internal/firstSteps.d.ts +66 -0
  89. package/dist/internal/firstSteps.d.ts.map +1 -0
  90. package/dist/internal/firstSteps.js +107 -0
  91. package/dist/internal/firstSteps.js.map +1 -0
  92. package/dist/internal/frameLoop.d.ts +11 -3
  93. package/dist/internal/frameLoop.d.ts.map +1 -1
  94. package/dist/internal/frameLoop.js +190 -39
  95. package/dist/internal/frameLoop.js.map +1 -1
  96. package/dist/internal/guarded.d.ts +16 -0
  97. package/dist/internal/guarded.d.ts.map +1 -0
  98. package/dist/internal/guarded.js +68 -0
  99. package/dist/internal/guarded.js.map +1 -0
  100. package/dist/internal/lerpsNumbers.d.ts +11 -0
  101. package/dist/internal/lerpsNumbers.d.ts.map +1 -0
  102. package/dist/internal/lerpsNumbers.js +38 -0
  103. package/dist/internal/lerpsNumbers.js.map +1 -0
  104. package/dist/internal/options.d.ts +7 -7
  105. package/dist/internal/options.d.ts.map +1 -1
  106. package/dist/internal/options.js +10 -10
  107. package/dist/internal/options.js.map +1 -1
  108. package/dist/internal/stepper.d.ts +21 -4
  109. package/dist/internal/stepper.d.ts.map +1 -1
  110. package/dist/internal/stepper.js +21 -5
  111. package/dist/internal/stepper.js.map +1 -1
  112. package/dist/internal/tracing.d.ts +1 -1
  113. package/dist/internal/tracing.js +1 -1
  114. package/dist/unstable/AnimationControls.d.ts +45 -39
  115. package/dist/unstable/AnimationControls.d.ts.map +1 -1
  116. package/dist/unstable/AnimationControls.js +59 -35
  117. package/dist/unstable/AnimationControls.js.map +1 -1
  118. package/dist/unstable/AppearHandoff.d.ts +11 -5
  119. package/dist/unstable/AppearHandoff.d.ts.map +1 -1
  120. package/dist/unstable/AppearHandoff.js.map +1 -1
  121. package/dist/unstable/BatchCalls.d.ts +2 -2
  122. package/dist/unstable/BatchCalls.js +5 -5
  123. package/dist/unstable/Config.d.ts +21 -17
  124. package/dist/unstable/Config.d.ts.map +1 -1
  125. package/dist/unstable/Config.js.map +1 -1
  126. package/dist/unstable/FirstSteps.d.ts +25 -0
  127. package/dist/unstable/FirstSteps.d.ts.map +1 -0
  128. package/dist/unstable/FirstSteps.js +2 -0
  129. package/dist/unstable/FirstSteps.js.map +1 -0
  130. package/dist/unstable/FlushGate.d.ts +54 -50
  131. package/dist/unstable/FlushGate.d.ts.map +1 -1
  132. package/dist/unstable/FlushGate.js +201 -77
  133. package/dist/unstable/FlushGate.js.map +1 -1
  134. package/dist/unstable/FrameEffects.d.ts +6 -3
  135. package/dist/unstable/FrameEffects.d.ts.map +1 -1
  136. package/dist/unstable/FrameEffects.js +14 -3
  137. package/dist/unstable/FrameEffects.js.map +1 -1
  138. package/dist/unstable/FrameTime.d.ts +1 -1
  139. package/dist/unstable/FrameTime.js +1 -1
  140. package/dist/unstable/Imperative.d.ts +42 -13
  141. package/dist/unstable/Imperative.d.ts.map +1 -1
  142. package/dist/unstable/Imperative.js +279 -88
  143. package/dist/unstable/Imperative.js.map +1 -1
  144. package/dist/unstable/MeasuredPairs.d.ts +6 -2
  145. package/dist/unstable/MeasuredPairs.d.ts.map +1 -1
  146. package/dist/unstable/MeasuredPairs.js.map +1 -1
  147. package/dist/unstable/OwnValues.js +1 -1
  148. package/dist/unstable/PresenceRecord.d.ts +30 -26
  149. package/dist/unstable/PresenceRecord.d.ts.map +1 -1
  150. package/dist/unstable/PresenceRecord.js +8 -8
  151. package/dist/unstable/PresenceRecord.js.map +1 -1
  152. package/dist/unstable/Projector.d.ts +34 -0
  153. package/dist/unstable/Projector.d.ts.map +1 -0
  154. package/dist/unstable/Projector.js +9 -0
  155. package/dist/unstable/Projector.js.map +1 -0
  156. package/dist/unstable/Report.d.ts +8 -1
  157. package/dist/unstable/Report.d.ts.map +1 -1
  158. package/dist/unstable/Report.js +18 -2
  159. package/dist/unstable/Report.js.map +1 -1
  160. package/dist/unstable/RetargetLegs.d.ts +7 -1
  161. package/dist/unstable/RetargetLegs.d.ts.map +1 -1
  162. package/dist/unstable/RetargetLegs.js +24 -8
  163. package/dist/unstable/RetargetLegs.js.map +1 -1
  164. package/dist/unstable/Spine.d.ts +123 -68
  165. package/dist/unstable/Spine.d.ts.map +1 -1
  166. package/dist/unstable/Spine.js +319 -167
  167. package/dist/unstable/Spine.js.map +1 -1
  168. package/dist/unstable/Stops.d.ts +3 -3
  169. package/dist/unstable/Stops.js +4 -4
  170. package/dist/unstable/Subject.d.ts +2 -2
  171. package/dist/unstable/Subject.js +2 -2
  172. package/dist/unstable/Timelines.d.ts +11 -11
  173. package/dist/unstable/Timelines.d.ts.map +1 -1
  174. package/dist/unstable/Timelines.js +3 -3
  175. package/dist/unstable/VariantTarget.d.ts +32 -10
  176. package/dist/unstable/VariantTarget.d.ts.map +1 -1
  177. package/dist/unstable/VariantTarget.js +73 -20
  178. package/dist/unstable/VariantTarget.js.map +1 -1
  179. package/dist/unstable/VariantTree.d.ts +68 -34
  180. package/dist/unstable/VariantTree.d.ts.map +1 -1
  181. package/dist/unstable/VariantTree.js +83 -36
  182. package/dist/unstable/VariantTree.js.map +1 -1
  183. package/dist/unstable/WardicConfigValue.d.ts +13 -13
  184. package/dist/unstable/WardicConfigValue.d.ts.map +1 -1
  185. package/dist/unstable/WardicConfigValue.js +4 -4
  186. package/dist/unstable/WardicConfigValue.js.map +1 -1
  187. package/package.json +1 -1
  188. package/src/Arc.ts +3 -3
  189. package/src/BaseValue.ts +18 -21
  190. package/src/Batch.ts +391 -27
  191. package/src/Clock.ts +29 -8
  192. package/src/DefaultTransition.ts +5 -3
  193. package/src/Drag.ts +32 -14
  194. package/src/DragActivity.ts +3 -3
  195. package/src/DragRecognizer.ts +118 -41
  196. package/src/Easing.ts +1 -1
  197. package/src/Frame.ts +5 -3
  198. package/src/InputFeed.ts +39 -42
  199. package/src/InputSource.ts +5 -5
  200. package/src/Interpolator.ts +3 -3
  201. package/src/InterpolatorRegistry.ts +22 -13
  202. package/src/LiveValue.ts +186 -30
  203. package/src/Machine.ts +252 -81
  204. package/src/Playback.ts +15 -9
  205. package/src/Projection.ts +9 -9
  206. package/src/Recognizer.ts +16 -10
  207. package/src/ReducedMotion.ts +6 -6
  208. package/src/Renderer.ts +6 -6
  209. package/src/Reorder.ts +3 -2
  210. package/src/ScrollSource.ts +1 -1
  211. package/src/Sequence.ts +1 -1
  212. package/src/SharedSource.ts +5 -5
  213. package/src/Spring.ts +2 -1
  214. package/src/Values.ts +2 -2
  215. package/src/index.ts +1 -1
  216. package/src/internal/carried.ts +22 -0
  217. package/src/internal/firstSteps.ts +139 -0
  218. package/src/internal/frameLoop.ts +203 -41
  219. package/src/internal/guarded.ts +69 -0
  220. package/src/internal/lerpsNumbers.ts +53 -0
  221. package/src/internal/options.ts +10 -10
  222. package/src/internal/stepper.ts +33 -6
  223. package/src/internal/tracing.ts +1 -1
  224. package/src/unstable/AnimationControls.ts +88 -57
  225. package/src/unstable/AppearHandoff.ts +13 -6
  226. package/src/unstable/BatchCalls.ts +5 -5
  227. package/src/unstable/Config.ts +23 -17
  228. package/src/unstable/FirstSteps.ts +26 -0
  229. package/src/unstable/FlushGate.ts +250 -108
  230. package/src/unstable/FrameEffects.ts +17 -4
  231. package/src/unstable/FrameTime.ts +1 -1
  232. package/src/unstable/Imperative.ts +342 -101
  233. package/src/unstable/MeasuredPairs.ts +7 -1
  234. package/src/unstable/OwnValues.ts +1 -1
  235. package/src/unstable/PresenceRecord.ts +33 -29
  236. package/src/unstable/Projector.ts +45 -0
  237. package/src/unstable/Report.ts +20 -2
  238. package/src/unstable/RetargetLegs.ts +24 -9
  239. package/src/unstable/Spine.ts +399 -202
  240. package/src/unstable/Stops.ts +6 -6
  241. package/src/unstable/Subject.ts +2 -2
  242. package/src/unstable/Timelines.ts +12 -12
  243. package/src/unstable/VariantTarget.ts +102 -23
  244. package/src/unstable/VariantTree.ts +123 -42
  245. package/src/unstable/WardicConfigValue.ts +13 -13
@@ -1,19 +1,19 @@
1
1
  /**
2
- * The rules of an element's place in variant orchestration (ADR-0007, #50), on every binding: the
3
- * names an element hands its children and inherits from its parent, the values it starts from, and
2
+ * The rules of a Subject's place in variant orchestration (ADR-0007, #50), on every binding: the
3
+ * names a Subject hands its children and inherits from its parent, the values it starts from, and
4
4
  * what a server render builds. Each binding's variant node runs the orchestration over them, with its
5
5
  * own reactivity.
6
6
  *
7
7
  * Motion's rule (CONTEXT.md, **Variant child**):
8
- * - An element that names its own variants, a name on any variant prop (`initial`, `animate`, the
8
+ * - A Subject that names its own variants, a name on any variant prop (`initial`, `animate`, the
9
9
  * `while*` gestures, `exit`; #618), hands its children its `initial` and `animate` names, and an
10
10
  * `initial={false}` with them (#134). Any other passes its parent's through, unless it sets
11
11
  * `inherit={false}`, which passes none.
12
12
  * - A **Variant child** (`variants`, no names of its own, `inherit` not `false`) inherits its
13
13
  * ancestor's names and default transition, takes a stagger slot among the ancestor's variant
14
14
  * children, and counts for the ancestor's `when`.
15
- * - An element with variants of its own (`variants`, or a name) is what its Variant children
16
- * join: it owns their registry, their stagger and their `when`. Any other element passes its
15
+ * - A Subject with variants of its own (`variants`, or a name) is what its Variant children
16
+ * join: it owns their registry, their stagger and their `when`. Any other Subject passes its
17
17
  * parent's context through, so a Variant child joins its nearest such ancestor; it renders no
18
18
  * Provider unless it sets `inherit={false}` ({@link changesContext}).
19
19
  *
@@ -23,9 +23,12 @@
23
23
  */
24
24
  import * as Stagger from "../Stagger.ts";
25
25
  import type * as Values from "../Values.ts";
26
+ import type * as WardicServices from "./WardicServices.ts";
27
+ import type * as Option from "effect/Option";
26
28
  import * as AnimationControls from "./AnimationControls.ts";
27
29
  import type * as Config from "./Config.ts";
28
30
  import type * as Reactivity from "./Reactivity.ts";
31
+ import * as VariantTarget from "./VariantTarget.ts";
29
32
  /**
30
33
  * The handle a child receives from {@link WardicVariantContextValue.register}
31
34
  * when it mounts under a `ward.Provider` (ADR-0007, step 21b).
@@ -80,7 +83,7 @@ export interface WardicStaggerConfig {
80
83
  * inherit).
81
84
  * - `initial` — the parent's `initial` NAME, or `false`, read once (#50, #134).
82
85
  *
83
- * Every Wardic element provides one (#50): its own if it has variants of its own, else its
86
+ * Every Ward's Subject provides one (#50): its own if it has variants of its own, else its
84
87
  * parent's, passed through (`variant-node.ts`).
85
88
  * - `transition` — the parent's transition, inherited as the DEFAULT for
86
89
  * children that supply no local `transition`.
@@ -92,9 +95,9 @@ export interface WardicStaggerConfig {
92
95
  export type GestureLayer = "inView" | "focused" | "hovered" | "pressed" | "dragged";
93
96
  /** The gesture layers in Motion's priority, lowest first. */
94
97
  export declare const GESTURE_LAYERS: ReadonlyArray<GestureLayer>;
95
- /** The variant names an element hands its Variant children for its active gestures (#291): a name or a list each (#297). */
98
+ /** The variant names a Subject hands its Variant children for its active gestures (#291): a name or a list each (#297). */
96
99
  export type GestureNames = Readonly<Partial<Record<GestureLayer, Config.WardicVariantLabels | undefined>>>;
97
- /** No gesture on: what an element with none active hands down. */
100
+ /** No gesture on: what a Subject with none active hands down. */
98
101
  export declare const NO_GESTURE_NAMES: GestureNames;
99
102
  /** Two {@link GestureNames} the same: the same names for each gesture, a list name by name (#297). */
100
103
  export declare const sameGestureNames: (a: GestureNames, b: GestureNames) => boolean;
@@ -103,7 +106,7 @@ export type GestureStates = Readonly<Record<GestureLayer, boolean>>;
103
106
  /** No gesture on. */
104
107
  export declare const NO_GESTURE_STATES: GestureStates;
105
108
  /**
106
- * What an element hands its Variant children for its gestures (#291, Motion's `setActive` and variant
109
+ * What a Subject hands its Variant children for its gestures (#291, Motion's `setActive` and variant
107
110
  * context): whether each is on (its own, or its own provider's), and each one's label (its own
108
111
  * `while*`, if a name, else the one it took). A Variant child's gesture is on while its provider's is.
109
112
  */
@@ -111,7 +114,7 @@ export interface GestureHandDown {
111
114
  readonly on: GestureStates;
112
115
  readonly names: GestureNames;
113
116
  }
114
- /** Nothing on, no labels: what an element hands down with no provider and no gesture. */
117
+ /** Nothing on, no labels: what a Subject hands down with no provider and no gesture. */
115
118
  export declare const NO_HAND_DOWN: GestureHandDown;
116
119
  /** Two hand-downs the same: each gesture on alike, with the same label. */
117
120
  export declare const sameHandDown: (a: GestureHandDown, b: GestureHandDown) => boolean;
@@ -127,7 +130,7 @@ export interface GestureConfig {
127
130
  }
128
131
  /** Each gesture on: its own, or its provider's. */
129
132
  export declare const gesturesOn: (own: GestureStates, above: GestureStates) => GestureStates;
130
- /** What an element hands down (#291), from its config, its own states, and what it takes. */
133
+ /** What a Subject hands down (#291), from its config, its own states, and what it takes. */
131
134
  export declare const handDownOf: (config: GestureConfig, own: GestureStates, above: GestureHandDown) => GestureHandDown;
132
135
  /** The name each gesture's layer resolves while it's on (#291): its label then; off, none. */
133
136
  export declare const activeNamesOf: (handDown: GestureHandDown) => GestureNames;
@@ -201,7 +204,7 @@ export interface WardicVariantContextValue {
201
204
  readonly staggerFor?: (name: string | undefined) => WardicStaggerConfig;
202
205
  /**
203
206
  * For a list: whether a Variant child's keys of `name` may start, that name's own
204
- * `beforeChildren`: true unless it has one and this element's keys of that name haven't settled
207
+ * `beforeChildren`: true unless it has one and this Subject's keys of that name haven't settled
205
208
  * since its list last changed. Optional: left out, always.
206
209
  */
207
210
  readonly mayStartFor?: (name: string) => boolean;
@@ -227,7 +230,7 @@ export interface WardicVariantContextValue {
227
230
  */
228
231
  readonly appearGroup?: unknown;
229
232
  }
230
- /** The part of an element's config its place in variant orchestration reads. */
233
+ /** The part of a Subject's config its place in variant orchestration reads. */
231
234
  export interface VariantConfig extends GestureConfig {
232
235
  readonly initial?: object | Config.WardicVariantLabels | false | undefined;
233
236
  readonly animate?: object | Config.WardicVariantLabels | undefined;
@@ -243,7 +246,7 @@ export interface VariantConfig extends GestureConfig {
243
246
  */
244
247
  readonly controlled?: boolean | undefined;
245
248
  }
246
- /** An `initial` an element hands its children: a variant name or list (#297), `false` (#134), or `undefined` for a values map or nothing. */
249
+ /** An `initial` a Subject hands its children: a variant name or list (#297), `false` (#134), or `undefined` for a values map or nothing. */
247
250
  export declare const initialNameOf: (entry: object | Config.WardicVariantLabels | false | undefined) => Config.WardicVariantLabels | false | undefined;
248
251
  /** A variant name or a list of names (#297), or `undefined` for a values map or nothing. */
249
252
  export declare const nameOf: (entry: object | Config.WardicVariantLabels | undefined) => Config.WardicVariantLabels | undefined;
@@ -253,56 +256,71 @@ export declare const nameOf: (entry: object | Config.WardicVariantLabels | undef
253
256
  * or as its binding marks the config it reads (Motion's `isControllingVariants`, `isVariantLabel`).
254
257
  */
255
258
  export declare const namesOwnVariants: (config: VariantConfig) => boolean;
256
- /** Whether an element has variants of its own, so Variant children join it (Motion's `isVariantNode`). */
259
+ /** Whether a Subject has variants of its own, so Variant children join it (Motion's `isVariantNode`). */
257
260
  export declare const hasOwnVariants: (config: VariantConfig) => boolean;
258
261
  /**
259
- * Whether an element changes what its children read, so it renders its variant context's
260
- * Provider (#50): it has variants of its own, or it sets `inherit={false}`. Any other element hands
262
+ * Whether a Subject changes what its children read, so it renders its variant context's
263
+ * Provider (#50): it has variants of its own, or it sets `inherit={false}`. Any other Subject hands
261
264
  * its children its parent's context as it is, so it renders none. Decided once, at setup, from the
262
265
  * same props on a server and on the client, so the nesting never changes after mount.
263
266
  */
264
267
  export declare const changesContext: (config: VariantConfig) => boolean;
265
268
  /**
266
- * The **Controls change** in effect for an element (#433): its own controls', else the one the context
267
- * it inherits from is in, else none. Per mount, for every element (#460): guards, nothing built.
269
+ * The **Controls change** in effect for a Subject (#433): its own controls', else the one the context
270
+ * it inherits from is in, else none. Per mount, for every Subject (#460): guards, nothing built.
268
271
  */
269
272
  export declare const controlsChangeOf: (controls: Reactivity.Accessor<AnimationControls.ControlsChange | undefined> | undefined, inherited: WardicVariantContextValue | undefined) => Reactivity.Accessor<AnimationControls.ControlsChange | undefined>;
270
- /** Whether an element is a **Variant child** (CONTEXT.md). */
273
+ /** Whether a Subject is a **Variant child** (CONTEXT.md). */
271
274
  export declare const isVariantChild: (config: VariantConfig) => boolean;
272
- /** The context an element inherits names and its default transition from: its parent's, for a Variant child. */
275
+ /** The context a Subject inherits names and its default transition from: its parent's, for a Variant child. */
273
276
  export declare const inheritedContext: (config: VariantConfig, parent: WardicVariantContextValue | undefined) => WardicVariantContextValue | undefined;
274
277
  /**
275
- * The `initial` an element's Starting style resolves: its own, else the `initial` name (or `false`) of
278
+ * The `initial` a Subject's Starting style resolves: its own, else the `initial` name (or `false`) of
276
279
  * the context it inherits from (#50, #134). Read once, as every `initial` is.
277
280
  */
278
281
  export declare const initialOf: (config: VariantConfig, inherited: WardicVariantContextValue | undefined) => object | Config.WardicVariantLabels | false | undefined;
279
282
  /**
280
- * Whether an element starts at its `animate`, with nothing animating at mount (#134, Motion's
283
+ * Whether a Subject starts at its `animate`, with nothing animating at mount (#134, Motion's
281
284
  * `isInitialAnimationBlocked`): its `initial` (own or inherited) is `false`, or it renders with an
282
285
  * `<AnimatePresence initial={false}>`'s first render (`presenceBlocks`).
283
286
  */
284
287
  export declare const startsAtAnimate: (config: VariantConfig, inherited: WardicVariantContextValue | undefined, presenceBlocks: boolean) => boolean;
285
288
  /**
286
- * Whether an element's mount tells nothing (#448, Motion's `animation-state.ts`): it
289
+ * Whether a Subject's mount tells nothing (#448, Motion's `animation-state.ts`): it
287
290
  * {@link startsAtAnimate}, or its `initial` (own, else inherited) is the same name, list or values map
288
291
  * as its `animate` (own, else inherited). Its first Retarget, landing with nothing to animate, is told
289
292
  * to no one. Read once, untracked.
290
293
  */
291
294
  export declare const startsQuiet: (config: VariantConfig, inherited: WardicVariantContextValue | undefined, presenceBlocks: boolean, untrack: Reactivity.Reactivity["untrack"]) => boolean;
295
+ /** What a Subject starts from, and the first of its variants whose resolver threw (#979). */
296
+ export interface Starting {
297
+ readonly values: Values.Values;
298
+ readonly failure: Option.Option<VariantTarget.VariantFailure>;
299
+ }
292
300
  /**
293
- * The values an element starts from, its Starting style's input (ADR-0003): its `initial` (own, else
301
+ * The values a Subject starts from, its Starting style's input (ADR-0003): its `initial` (own, else
294
302
  * inherited, #50), or, when it {@link startsAtAnimate}, its `animate` (own, else inherited), as
295
303
  * Motion's `initial={false}` (#134). Read once: an inherited name is read through `untrack`.
296
304
  */
297
305
  export declare const startingValuesOf: (config: VariantConfig, inherited: WardicVariantContextValue | undefined, presenceBlocks: boolean, untrack: Reactivity.Reactivity["untrack"]) => Values.Values;
298
306
  /**
299
- * A name an element hands its children (Motion's `getCurrentTreeVariants`): `own` if it names its own
307
+ * {@link startingValuesOf}, with what a resolver among the Subject's variants threw: its entry gives no
308
+ * values, and the Subject starts at the rest (#979).
309
+ */
310
+ export declare const startingOf: (config: VariantConfig, inherited: WardicVariantContextValue | undefined, presenceBlocks: boolean, untrack: Reactivity.Reactivity["untrack"]) => Starting;
311
+ /**
312
+ * {@link startingValuesOf} from its variants already resolved to values (`VariantTarget.startingVariantsOf`):
313
+ * what a Subject's start reads, which reads their failure too.
314
+ */
315
+ export declare const startingValuesFrom: (config: VariantConfig, inherited: WardicVariantContextValue | undefined, presenceBlocks: boolean, untrack: Reactivity.Reactivity["untrack"], variants: object | undefined) => Values.Values;
316
+ /**
317
+ * A name a Subject hands its children (Motion's `getCurrentTreeVariants`): `own` if it names its own
300
318
  * variants, else `fromParent` unless it sets `inherit={false}`.
301
319
  */
302
320
  export declare const handedDown: <A extends Config.WardicVariantLabels | false>(config: VariantConfig, own: () => A | undefined, fromParent: () => A | undefined) => A | undefined;
303
- /** An element's own transition, else the one it inherits. */
321
+ /** A Subject's own transition, else the one it inherits. */
304
322
  export declare const ownOrInherited: (own: Config.WardicTransition | undefined, inherited: WardicVariantContextValue | undefined) => Config.WardicTransition | undefined;
305
- /** The stagger config an element's `transition` gives its Variant children. */
323
+ /** The stagger config a Subject's `transition` gives its Variant children. */
306
324
  export declare const staggerOf: (transition: Config.WardicTransition | undefined) => WardicStaggerConfig;
307
325
  /** A context's stagger config for one of its names (#297): its `staggerFor`'s, else its whole orchestration's. */
308
326
  export declare const staggerOfName: (context: WardicVariantContextValue, name: string | undefined) => WardicStaggerConfig;
@@ -310,14 +328,30 @@ export declare const staggerOfName: (context: WardicVariantContextValue, name: s
310
328
  export declare const mayStartOf: (context: WardicVariantContextValue, name: string) => boolean;
311
329
  /** A child's place in a stagger, turned by its `staggerDirection`: `-1` counts from the last. */
312
330
  export declare const directed: (index: number, total: number, direction: 1 | -1) => number;
331
+ /**
332
+ * Where a stagger reports a `delayChildren` function that throws: the runtime it's reported on, and whether
333
+ * it's failing, so a run of throws is reported once. A Variant child's is its Subject's, for its life, its
334
+ * run ended by its next clean call. A presence's exit and a server's Appear timing make one for the event,
335
+ * `event`, whose first throw is reported whatever its other calls do.
336
+ */
337
+ export interface DelayFailures {
338
+ delayFailing: boolean;
339
+ readonly runtime: Pick<WardicServices.Runner<never>, "runFork">;
340
+ readonly event?: true;
341
+ }
342
+ /** The runtime a server render reports on: Effect's default, as a server holds no app reporters. */
343
+ export declare const ON_SERVER: Pick<WardicServices.Runner<never>, "runFork">;
344
+ /** One exit's or one render's {@link DelayFailures}, reported on `runtime` at its first throw. */
345
+ export declare const eventDelayFailuresOf: (runtime: Pick<WardicServices.Runner<never>, "runFork">) => DelayFailures;
313
346
  /**
314
347
  * A child's delay in a stagger (ADR-0007): its `delayChildren` plus its place from the origin, turned
315
348
  * by its `staggerDirection`. A function `delayChildren` (#436, Motion's `calcChildStagger`) decides it
316
- * whole, from the child's index and the count. Every stagger, a Variant child's, a presence's exit's
317
- * and a server's Appear timing, is placed by it.
349
+ * whole, from the child's index and the count; one that throws gives the child no delay, reported on
350
+ * `failures` (on Effect's default runtime with none) at the first throw of a run of them. Every stagger,
351
+ * a Variant child's, a presence's exit's and a server's Appear timing, is placed by it.
318
352
  */
319
- export declare const childDelayOf: (s: WardicStaggerConfig, index: number, total: number) => number;
320
- /** A name's orchestration (#297): its stagger config, and its own `when`, from its own transition, else the element's. */
353
+ export declare const childDelayOf: (s: WardicStaggerConfig, index: number, total: number, failures: DelayFailures | undefined) => number;
354
+ /** A name's orchestration (#297): its stagger config, and its own `when`, from its own transition, else the Subject's. */
321
355
  export interface NameConfig {
322
356
  readonly stagger: WardicStaggerConfig;
323
357
  readonly when: "beforeChildren" | "afterChildren" | undefined;
@@ -332,11 +366,11 @@ export declare const staggerWith: ({ staggerChildren, delayChildren, from, stagg
332
366
  * pressed, made a new, equal config at each press and release, `UNSTABLE_MEMO_OUTPUT`).
333
367
  */
334
368
  export declare const sameStagger: (a: WardicStaggerConfig, b: WardicStaggerConfig) => boolean;
335
- /** What an element provides when it has no variants of its own: its parent's context, unless `inherit={false}`. */
369
+ /** What a Subject provides when it has no variants of its own: its parent's context, unless `inherit={false}`. */
336
370
  export declare const passedThrough: (config: VariantConfig, parent: WardicVariantContextValue | undefined) => WardicVariantContextValue | undefined;
337
371
  /** A registration that does nothing: a server render has no orchestration to join. */
338
372
  export declare const INERT_REGISTRATION: WardicChildRegistration;
339
- /** An element's place in variant orchestration during a server render (ADR-0021). */
373
+ /** A Subject's place in variant orchestration during a server render (ADR-0021). */
340
374
  export interface ServerVariantNode {
341
375
  /** What its children read: the same context the client builds, with inert orchestration. */
342
376
  readonly provided: WardicVariantContextValue | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"VariantTree.d.ts","sourceRoot":"","sources":["../../src/unstable/VariantTree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,KAAK,MAAM,MAAM,cAAc,CAAA;AAO3C,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAC3D,OAAO,KAAK,KAAK,MAAM,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAGlD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IAC3C,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IAC3C,QAAQ,CAAC,UAAU,EAAE,CAAC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,SAAS,KAAG,UAG7E,CAAA;AAEF,yEAAyE;AACzE,eAAO,MAAM,WAAW,+DAAsF,MAAM,CAAC,gBAAgB,KAAG,mBAKtI,CAAA;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,MAAO,mBAAmB,KAAK,mBAAmB,KAAG,OACqC,CAAA;AAElH,kHAAkH;AAClH,eAAO,MAAM,aAAa,WAChB,aAAa,UACb,yBAAyB,GAAG,SAAS,KAC5C,yBAAyB,GAAG,SAAoG,CAAA;AAEnI,sFAAsF;AACtF,eAAO,MAAM,kBAAkB,EAAE,uBAK/B,CAAA;AAEF,oFAAoF;AACpF,MAAM,WAAW,iBAAiB;IAChC,4FAA4F;IAC5F,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,GAAG,SAAS,CAAA;IACxD,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,yBAAyB,GAAG,SAAS,CAAA;CAC1D;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,WAAY,aAAa,UAAU,yBAAyB,GAAG,SAAS,KAAG,iBAqBxG,CAAA"}
@@ -1,19 +1,19 @@
1
1
  /**
2
- * The rules of an element's place in variant orchestration (ADR-0007, #50), on every binding: the
3
- * names an element hands its children and inherits from its parent, the values it starts from, and
2
+ * The rules of a Subject's place in variant orchestration (ADR-0007, #50), on every binding: the
3
+ * names a Subject hands its children and inherits from its parent, the values it starts from, and
4
4
  * what a server render builds. Each binding's variant node runs the orchestration over them, with its
5
5
  * own reactivity.
6
6
  *
7
7
  * Motion's rule (CONTEXT.md, **Variant child**):
8
- * - An element that names its own variants, a name on any variant prop (`initial`, `animate`, the
8
+ * - A Subject that names its own variants, a name on any variant prop (`initial`, `animate`, the
9
9
  * `while*` gestures, `exit`; #618), hands its children its `initial` and `animate` names, and an
10
10
  * `initial={false}` with them (#134). Any other passes its parent's through, unless it sets
11
11
  * `inherit={false}`, which passes none.
12
12
  * - A **Variant child** (`variants`, no names of its own, `inherit` not `false`) inherits its
13
13
  * ancestor's names and default transition, takes a stagger slot among the ancestor's variant
14
14
  * children, and counts for the ancestor's `when`.
15
- * - An element with variants of its own (`variants`, or a name) is what its Variant children
16
- * join: it owns their registry, their stagger and their `when`. Any other element passes its
15
+ * - A Subject with variants of its own (`variants`, or a name) is what its Variant children
16
+ * join: it owns their registry, their stagger and their `when`. Any other Subject passes its
17
17
  * parent's context through, so a Variant child joins its nearest such ancestor; it renders no
18
18
  * Provider unless it sets `inherit={false}` ({@link changesContext}).
19
19
  *
@@ -22,11 +22,14 @@
22
22
  * @module
23
23
  */
24
24
  // Unstable: ADR-0071, decision 5. #672: solid's `variant-tree.ts`, moved for the spine to read an
25
- // element's place in variant orchestration in core.
25
+ // Subject's place in variant orchestration in core.
26
26
  import * as Stagger from "../Stagger.js";
27
+ import * as Report from "./Report.js";
27
28
  import * as Stops from "./Stops.js";
28
29
  import * as Arr from "effect/Array";
29
30
  import * as Bool from "effect/Boolean";
31
+ import * as Cause from "effect/Cause";
32
+ import * as Effect from "effect/Effect";
30
33
  import { constTrue, constUndefined, identity } from "effect/Function";
31
34
  import * as Predicate from "effect/Predicate";
32
35
  import * as UndefinedOr from "effect/UndefinedOr";
@@ -34,19 +37,19 @@ import * as AnimationControls from "./AnimationControls.js";
34
37
  import * as VariantTarget from "./VariantTarget.js";
35
38
  /** The gesture layers in Motion's priority, lowest first. */
36
39
  export const GESTURE_LAYERS = ["inView", "focused", "hovered", "pressed", "dragged"];
37
- /** No gesture on: what an element with none active hands down. */
40
+ /** No gesture on: what a Subject with none active hands down. */
38
41
  export const NO_GESTURE_NAMES = {};
39
42
  /** Two {@link GestureNames} the same: the same names for each gesture, a list name by name (#297). */
40
43
  export const sameGestureNames = (a, b) => GESTURE_LAYERS.every((layer) => VariantTarget.sameLabels(a[layer], b[layer]));
41
44
  /** No gesture on. */
42
45
  export const NO_GESTURE_STATES = { inView: false, focused: false, hovered: false, pressed: false, dragged: false };
43
- /** Nothing on, no labels: what an element hands down with no provider and no gesture. */
46
+ /** Nothing on, no labels: what a Subject hands down with no provider and no gesture. */
44
47
  export const NO_HAND_DOWN = { on: NO_GESTURE_STATES, names: NO_GESTURE_NAMES };
45
48
  /** Two hand-downs the same: each gesture on alike, with the same label. */
46
49
  export const sameHandDown = (a, b) => GESTURE_LAYERS.every((layer) => Bool.and(a.on[layer] === b.on[layer], VariantTarget.sameLabels(a.names[layer], b.names[layer])));
47
50
  /** What a context hands down, nothing without a context or its gestures. */
48
51
  export const handDownFrom = (context) => {
49
- // Per Retarget, per element: guards, nothing made (most elements have no provider).
52
+ // Per Retarget, per Subject: guards, nothing made (most Subjects have no provider).
50
53
  if (Predicate.isUndefined(context))
51
54
  return NO_HAND_DOWN;
52
55
  const gestures = context.gestures;
@@ -68,7 +71,7 @@ const labelOf = (own, inherited) => {
68
71
  return nameOf(own);
69
72
  return inherited;
70
73
  };
71
- /** What an element hands down (#291), from its config, its own states, and what it takes. */
74
+ /** What a Subject hands down (#291), from its config, its own states, and what it takes. */
72
75
  export const handDownOf = (config, own, above) => ({
73
76
  on: gesturesOn(own, above.on),
74
77
  names: {
@@ -144,7 +147,7 @@ export const topGestureName = (names) => UndefinedOr.match(names.dragged, {
144
147
  }),
145
148
  }),
146
149
  });
147
- /** An `initial` an element hands its children: a variant name or list (#297), `false` (#134), or `undefined` for a values map or nothing. */
150
+ /** An `initial` a Subject hands its children: a variant name or list (#297), `false` (#134), or `undefined` for a values map or nothing. */
148
151
  export const initialNameOf = (entry) => Bool.match(entry === false, { onTrue: () => false, onFalse: () => nameOf(entry) });
149
152
  /** A variant name or a list of names (#297), or `undefined` for a values map or nothing. */
150
153
  export const nameOf = (entry) => Bool.match(VariantTarget.isLabels(entry), { onTrue: () => entry, onFalse: constUndefined });
@@ -165,18 +168,18 @@ export const namesOwnVariants = (config) => config.controlled === true ||
165
168
  VariantTarget.isLabels(config.whileTap) ||
166
169
  VariantTarget.isLabels(config.whileDrag) ||
167
170
  VariantTarget.isLabels(config.exit);
168
- /** Whether an element has variants of its own, so Variant children join it (Motion's `isVariantNode`). */
171
+ /** Whether a Subject has variants of its own, so Variant children join it (Motion's `isVariantNode`). */
169
172
  export const hasOwnVariants = (config) => Predicate.isNotUndefined(config.variants) || namesOwnVariants(config);
170
173
  /**
171
- * Whether an element changes what its children read, so it renders its variant context's
172
- * Provider (#50): it has variants of its own, or it sets `inherit={false}`. Any other element hands
174
+ * Whether a Subject changes what its children read, so it renders its variant context's
175
+ * Provider (#50): it has variants of its own, or it sets `inherit={false}`. Any other Subject hands
173
176
  * its children its parent's context as it is, so it renders none. Decided once, at setup, from the
174
177
  * same props on a server and on the client, so the nesting never changes after mount.
175
178
  */
176
179
  export const changesContext = (config) => hasOwnVariants(config) || config.inherit === false;
177
180
  /**
178
- * The **Controls change** in effect for an element (#433): its own controls', else the one the context
179
- * it inherits from is in, else none. Per mount, for every element (#460): guards, nothing built.
181
+ * The **Controls change** in effect for a Subject (#433): its own controls', else the one the context
182
+ * it inherits from is in, else none. Per mount, for every Subject (#460): guards, nothing built.
180
183
  */
181
184
  export const controlsChangeOf = (controls, inherited) => {
182
185
  if (Predicate.isNotUndefined(controls))
@@ -188,36 +191,36 @@ export const controlsChangeOf = (controls, inherited) => {
188
191
  return constUndefined;
189
192
  return change;
190
193
  };
191
- /** Whether an element is a **Variant child** (CONTEXT.md). */
194
+ /** Whether a Subject is a **Variant child** (CONTEXT.md). */
192
195
  export const isVariantChild = (config) => Predicate.isNotUndefined(config.variants) && !namesOwnVariants(config) && config.inherit !== false;
193
- /** The context an element inherits names and its default transition from: its parent's, for a Variant child. */
196
+ /** The context a Subject inherits names and its default transition from: its parent's, for a Variant child. */
194
197
  export const inheritedContext = (config, parent) => {
195
- // Per element at mount (#540): statements.
198
+ // Per Subject at mount (#540): statements.
196
199
  if (isVariantChild(config))
197
200
  return parent;
198
201
  return undefined;
199
202
  };
200
203
  /**
201
- * The `initial` an element's Starting style resolves: its own, else the `initial` name (or `false`) of
204
+ * The `initial` a Subject's Starting style resolves: its own, else the `initial` name (or `false`) of
202
205
  * the context it inherits from (#50, #134). Read once, as every `initial` is.
203
206
  */
204
207
  export const initialOf = (config, inherited) => UndefinedOr.match(config.initial, {
205
208
  onDefined: (initial) => initial,
206
209
  onUndefined: () => UndefinedOr.match(inherited, { onUndefined: constUndefined, onDefined: (context) => context.initial }),
207
210
  });
208
- /** The `animate` an element starts at with `initial={false}`: its own, else the name its context hands down (#134). Read once, untracked. */
211
+ /** The `animate` a Subject starts at with `initial={false}`: its own, else the name its context hands down (#134). Read once, untracked. */
209
212
  const animateOf = (config, inherited, untrack) => UndefinedOr.match(config.animate, {
210
213
  onDefined: (animate) => animate,
211
214
  onUndefined: () => UndefinedOr.match(inherited, { onUndefined: constUndefined, onDefined: (context) => untrack(context.variant) }),
212
215
  });
213
216
  /**
214
- * Whether an element starts at its `animate`, with nothing animating at mount (#134, Motion's
217
+ * Whether a Subject starts at its `animate`, with nothing animating at mount (#134, Motion's
215
218
  * `isInitialAnimationBlocked`): its `initial` (own or inherited) is `false`, or it renders with an
216
219
  * `<AnimatePresence initial={false}>`'s first render (`presenceBlocks`).
217
220
  */
218
221
  export const startsAtAnimate = (config, inherited, presenceBlocks) => presenceBlocks || initialOf(config, inherited) === false;
219
222
  /**
220
- * Whether an element's mount tells nothing (#448, Motion's `animation-state.ts`): it
223
+ * Whether a Subject's mount tells nothing (#448, Motion's `animation-state.ts`): it
221
224
  * {@link startsAtAnimate}, or its `initial` (own, else inherited) is the same name, list or values map
222
225
  * as its `animate` (own, else inherited). Its first Retarget, landing with nothing to animate, is told
223
226
  * to no one. Read once, untracked.
@@ -232,15 +235,28 @@ export const startsQuiet = (config, inherited, presenceBlocks, untrack) => {
232
235
  return VariantTarget.sameLabels(initial, animateOf(config, inherited, untrack));
233
236
  };
234
237
  /**
235
- * The values an element starts from, its Starting style's input (ADR-0003): its `initial` (own, else
238
+ * The values a Subject starts from, its Starting style's input (ADR-0003): its `initial` (own, else
236
239
  * inherited, #50), or, when it {@link startsAtAnimate}, its `animate` (own, else inherited), as
237
240
  * Motion's `initial={false}` (#134). Read once: an inherited name is read through `untrack`.
238
241
  */
239
- export const startingValuesOf = (config, inherited, presenceBlocks, untrack) => {
242
+ export const startingValuesOf = (config, inherited, presenceBlocks, untrack) => startingValuesFrom(config, inherited, presenceBlocks, untrack, VariantTarget.startingVariantsOf(config.variants, config.custom).variants);
243
+ /**
244
+ * {@link startingValuesOf}, with what a resolver among the Subject's variants threw: its entry gives no
245
+ * values, and the Subject starts at the rest (#979).
246
+ */
247
+ export const startingOf = (config, inherited, presenceBlocks, untrack) => {
248
+ const variants = VariantTarget.startingVariantsOf(config.variants, config.custom);
249
+ return { values: startingValuesFrom(config, inherited, presenceBlocks, untrack, variants.variants), failure: variants.failure };
250
+ };
251
+ /**
252
+ * {@link startingValuesOf} from its variants already resolved to values (`VariantTarget.startingVariantsOf`):
253
+ * what a Subject's start reads, which reads their failure too.
254
+ */
255
+ export const startingValuesFrom = (config, inherited, presenceBlocks, untrack, variants) => {
240
256
  const atAnimate = startsAtAnimate(config, inherited, presenceBlocks);
241
257
  const animate = animateOf(config, inherited, untrack);
242
258
  const initial = initialOf(config, inherited);
243
- // Per element at mount (#540): statements. Starting at `animate` resolves as `initial={false}`,
259
+ // Per Subject at mount (#540): statements. Starting at `animate` resolves as `initial={false}`,
244
260
  // and its first target is `animate`.
245
261
  let from = initial;
246
262
  let first = initial;
@@ -248,11 +264,11 @@ export const startingValuesOf = (config, inherited, presenceBlocks, untrack) =>
248
264
  from = false;
249
265
  first = animate;
250
266
  }
267
+ // Dynamic variants resolved first (#277): `@wardic/dom`'s Starting style reads values maps only.
251
268
  const values = Stops.resolveInitial({
252
269
  initial: from,
253
270
  animate,
254
- // Dynamic variants resolved first (#277): `@wardic/dom`'s Starting style reads values maps only.
255
- variants: VariantTarget.startingVariantsOf(config.variants, config.custom),
271
+ variants: variants,
256
272
  });
257
273
  // The first target's Transition end (#428, Motion's `makeLatestValues`): set at once, so a server
258
274
  // renders it, and a hydration finds it.
@@ -264,16 +280,16 @@ export const startingValuesOf = (config, inherited, presenceBlocks, untrack) =>
264
280
  return { ...values, ...end };
265
281
  };
266
282
  /**
267
- * A name an element hands its children (Motion's `getCurrentTreeVariants`): `own` if it names its own
283
+ * A name a Subject hands its children (Motion's `getCurrentTreeVariants`): `own` if it names its own
268
284
  * variants, else `fromParent` unless it sets `inherit={false}`.
269
285
  */
270
286
  export const handedDown = (config, own, fromParent) => Bool.match(namesOwnVariants(config), {
271
287
  onTrue: own,
272
288
  onFalse: () => Bool.match(config.inherit === false, { onTrue: constUndefined, onFalse: fromParent }),
273
289
  });
274
- /** An element's own transition, else the one it inherits. */
290
+ /** A Subject's own transition, else the one it inherits. */
275
291
  export const ownOrInherited = (own, inherited) => UndefinedOr.match(own, { onUndefined: () => UndefinedOr.map(inherited, (context) => context.transition()), onDefined: identity });
276
- /** The stagger config an element's `transition` gives its Variant children. */
292
+ /** The stagger config a Subject's `transition` gives its Variant children. */
277
293
  export const staggerOf = (transition) => UndefinedOr.match(transition, { onUndefined: () => staggerWith({}), onDefined: staggerWith });
278
294
  /** A context's stagger config for one of its names (#297): its `staggerFor`'s, else its whole orchestration's. */
279
295
  export const staggerOfName = (context, name) => {
@@ -295,17 +311,48 @@ export const directed = (index, total, direction) => {
295
311
  return total - 1 - index;
296
312
  return index;
297
313
  };
314
+ /** The runtime a server render reports on: Effect's default, as a server holds no app reporters. */
315
+ export const ON_SERVER = { runFork: (effect) => Effect.runFork(effect) };
316
+ /** One exit's or one render's {@link DelayFailures}, reported on `runtime` at its first throw. */
317
+ export const eventDelayFailuresOf = (runtime) => ({ delayFailing: false, runtime, event: true });
298
318
  /**
299
319
  * A child's delay in a stagger (ADR-0007): its `delayChildren` plus its place from the origin, turned
300
320
  * by its `staggerDirection`. A function `delayChildren` (#436, Motion's `calcChildStagger`) decides it
301
- * whole, from the child's index and the count. Every stagger, a Variant child's, a presence's exit's
302
- * and a server's Appear timing, is placed by it.
321
+ * whole, from the child's index and the count; one that throws gives the child no delay, reported on
322
+ * `failures` (on Effect's default runtime with none) at the first throw of a run of them. Every stagger,
323
+ * a Variant child's, a presence's exit's and a server's Appear timing, is placed by it.
303
324
  */
304
- export const childDelayOf = (s, index, total) => {
325
+ export const childDelayOf = (s, index, total, failures) => {
305
326
  if (Predicate.isFunction(s.delayChildren))
306
- return s.delayChildren(index, total);
327
+ return calledDelayOf(s.delayChildren, index, total, failures);
307
328
  return s.delayChildren + Stagger.make(s.amount, { from: s.from })(directed(index, total, s.direction), total);
308
329
  };
330
+ // #979 (ADR-0074, row 43, found by group H's probe): a `delayChildren` function is the app's, called at each
331
+ // child's Retarget, exit and Appear timing with no try. A throw halted Solid 2, came out of Solid 1's
332
+ // setter, and skipped Foldkit's later watches at a patch.
333
+ const DELAY_FAILED = "wardic.stagger: a delayChildren function failed";
334
+ /** `delayChildren` called for a child, a throw its child's: no delay, reported once a run on `failures`. */
335
+ // A child's run is its Subject's, whatever name it's staggered under: a parent's own transition staggers
336
+ // every name with one function, so a run kept by name would report it again for each. (The review's: a
337
+ // child staggered under two names at once, one function throwing and one not, is reported at each change.)
338
+ const calledDelayOf = (delayChildren, index, total, failures) => {
339
+ try {
340
+ const delay = delayChildren(index, total);
341
+ if (Predicate.isNotUndefined(failures) && failures.delayFailing && failures.event !== true)
342
+ failures.delayFailing = false;
343
+ return delay;
344
+ }
345
+ catch (defect) {
346
+ if (Predicate.isUndefined(failures)) {
347
+ Report.failureOn(undefined, DELAY_FAILED, Cause.die(defect), { index });
348
+ return 0;
349
+ }
350
+ if (!failures.delayFailing)
351
+ failures.runtime.runFork(Report.failure(DELAY_FAILED, Cause.die(defect)).pipe(Effect.annotateLogs({ index })));
352
+ failures.delayFailing = true;
353
+ return 0;
354
+ }
355
+ };
309
356
  /** A {@link NameConfig} from the transition a name orchestrates on. */
310
357
  export const nameConfigOf = (transition) => ({
311
358
  stagger: staggerOf(transition),
@@ -324,7 +371,7 @@ export const staggerWith = ({ staggerChildren = 0, delayChildren = 0, from = "fi
324
371
  * pressed, made a new, equal config at each press and release, `UNSTABLE_MEMO_OUTPUT`).
325
372
  */
326
373
  export const sameStagger = (a, b) => a.amount === b.amount && a.delayChildren === b.delayChildren && a.from === b.from && a.direction === b.direction;
327
- /** What an element provides when it has no variants of its own: its parent's context, unless `inherit={false}`. */
374
+ /** What a Subject provides when it has no variants of its own: its parent's context, unless `inherit={false}`. */
328
375
  export const passedThrough = (config, parent) => Bool.match(config.inherit === false, { onTrue: constUndefined, onFalse: () => parent });
329
376
  /** A registration that does nothing: a server render has no orchestration to join. */
330
377
  export const INERT_REGISTRATION = Object.freeze({