@wardic/core 1.3.2 → 1.5.0-next.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 (237) 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 +15 -5
  8. package/dist/Batch.d.ts.map +1 -1
  9. package/dist/Batch.js +218 -20
  10. package/dist/Batch.js.map +1 -1
  11. package/dist/Clock.d.ts +7 -7
  12. package/dist/Clock.d.ts.map +1 -1
  13. package/dist/Clock.js +17 -16
  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 +8 -6
  25. package/dist/DragRecognizer.d.ts.map +1 -1
  26. package/dist/DragRecognizer.js +51 -16
  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 +1 -1
  34. package/dist/InputFeed.js +2 -2
  35. package/dist/InputSource.d.ts +9 -3
  36. package/dist/InputSource.d.ts.map +1 -1
  37. package/dist/InputSource.js +2 -2
  38. package/dist/InputSource.js.map +1 -1
  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 +7 -6
  46. package/dist/LiveValue.d.ts.map +1 -1
  47. package/dist/LiveValue.js +45 -14
  48. package/dist/LiveValue.js.map +1 -1
  49. package/dist/Machine.d.ts +7 -4
  50. package/dist/Machine.d.ts.map +1 -1
  51. package/dist/Machine.js +146 -45
  52. package/dist/Machine.js.map +1 -1
  53. package/dist/Playback.d.ts.map +1 -1
  54. package/dist/Playback.js +6 -1
  55. package/dist/Playback.js.map +1 -1
  56. package/dist/Projection.d.ts +8 -19
  57. package/dist/Projection.d.ts.map +1 -1
  58. package/dist/Projection.js +3 -19
  59. package/dist/Projection.js.map +1 -1
  60. package/dist/Recognizer.d.ts +1 -1
  61. package/dist/Recognizer.d.ts.map +1 -1
  62. package/dist/Recognizer.js +22 -7
  63. package/dist/Recognizer.js.map +1 -1
  64. package/dist/ReducedMotion.d.ts +4 -4
  65. package/dist/ReducedMotion.js +6 -6
  66. package/dist/Renderer.d.ts +5 -5
  67. package/dist/Renderer.js +6 -6
  68. package/dist/Renderer.js.map +1 -1
  69. package/dist/Reorder.d.ts +12 -2
  70. package/dist/Reorder.d.ts.map +1 -1
  71. package/dist/Reorder.js +65 -37
  72. package/dist/Reorder.js.map +1 -1
  73. package/dist/ScrollSource.d.ts +1 -1
  74. package/dist/ScrollSource.d.ts.map +1 -1
  75. package/dist/Sequence.d.ts +1 -1
  76. package/dist/SharedSource.d.ts +3 -3
  77. package/dist/SharedSource.js +5 -5
  78. package/dist/SharedSource.js.map +1 -1
  79. package/dist/Spring.d.ts.map +1 -1
  80. package/dist/Spring.js +2 -1
  81. package/dist/Spring.js.map +1 -1
  82. package/dist/Values.d.ts +2 -2
  83. package/dist/Values.js +1 -1
  84. package/dist/index.d.ts +1 -1
  85. package/dist/index.js +1 -1
  86. package/dist/internal/carried.d.ts +13 -0
  87. package/dist/internal/carried.d.ts.map +1 -0
  88. package/dist/internal/carried.js +23 -0
  89. package/dist/internal/carried.js.map +1 -0
  90. package/dist/internal/firstSteps.d.ts +66 -0
  91. package/dist/internal/firstSteps.d.ts.map +1 -0
  92. package/dist/internal/firstSteps.js +107 -0
  93. package/dist/internal/firstSteps.js.map +1 -0
  94. package/dist/internal/frameLoop.d.ts +1 -1
  95. package/dist/internal/frameLoop.d.ts.map +1 -1
  96. package/dist/internal/frameLoop.js +102 -81
  97. package/dist/internal/frameLoop.js.map +1 -1
  98. package/dist/internal/lerpsNumbers.d.ts +11 -0
  99. package/dist/internal/lerpsNumbers.d.ts.map +1 -0
  100. package/dist/internal/lerpsNumbers.js +38 -0
  101. package/dist/internal/lerpsNumbers.js.map +1 -0
  102. package/dist/internal/options.d.ts +7 -7
  103. package/dist/internal/options.d.ts.map +1 -1
  104. package/dist/internal/options.js +10 -10
  105. package/dist/internal/options.js.map +1 -1
  106. package/dist/internal/projectionRest.d.ts +22 -0
  107. package/dist/internal/projectionRest.d.ts.map +1 -0
  108. package/dist/internal/projectionRest.js +20 -0
  109. package/dist/internal/projectionRest.js.map +1 -0
  110. package/dist/internal/stepper.d.ts +13 -2
  111. package/dist/internal/stepper.d.ts.map +1 -1
  112. package/dist/internal/stepper.js +16 -1
  113. package/dist/internal/stepper.js.map +1 -1
  114. package/dist/internal/tracing.d.ts +1 -1
  115. package/dist/internal/tracing.js +1 -1
  116. package/dist/unstable/AnimationControls.d.ts +37 -38
  117. package/dist/unstable/AnimationControls.d.ts.map +1 -1
  118. package/dist/unstable/AnimationControls.js +39 -36
  119. package/dist/unstable/AnimationControls.js.map +1 -1
  120. package/dist/unstable/AppearHandoff.d.ts +5 -5
  121. package/dist/unstable/AppearHandoff.d.ts.map +1 -1
  122. package/dist/unstable/BatchCalls.d.ts +2 -2
  123. package/dist/unstable/BatchCalls.js +5 -5
  124. package/dist/unstable/Config.d.ts +19 -19
  125. package/dist/unstable/Config.d.ts.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 +53 -51
  131. package/dist/unstable/FlushGate.d.ts.map +1 -1
  132. package/dist/unstable/FlushGate.js +56 -49
  133. package/dist/unstable/FlushGate.js.map +1 -1
  134. package/dist/unstable/FrameEffects.d.ts +2 -2
  135. package/dist/unstable/FrameEffects.js +2 -2
  136. package/dist/unstable/FrameTime.d.ts +1 -1
  137. package/dist/unstable/FrameTime.js +1 -1
  138. package/dist/unstable/Imperative.d.ts +29 -9
  139. package/dist/unstable/Imperative.d.ts.map +1 -1
  140. package/dist/unstable/Imperative.js +79 -47
  141. package/dist/unstable/Imperative.js.map +1 -1
  142. package/dist/unstable/OwnValues.js +1 -1
  143. package/dist/unstable/PresenceRecord.d.ts +31 -27
  144. package/dist/unstable/PresenceRecord.d.ts.map +1 -1
  145. package/dist/unstable/PresenceRecord.js +8 -8
  146. package/dist/unstable/PresenceRecord.js.map +1 -1
  147. package/dist/unstable/Projector.d.ts +34 -0
  148. package/dist/unstable/Projector.d.ts.map +1 -0
  149. package/dist/unstable/Projector.js +9 -0
  150. package/dist/unstable/Projector.js.map +1 -0
  151. package/dist/unstable/Report.d.ts +1 -1
  152. package/dist/unstable/Report.js +1 -1
  153. package/dist/unstable/RetargetLegs.d.ts +1 -1
  154. package/dist/unstable/RetargetLegs.d.ts.map +1 -1
  155. package/dist/unstable/RetargetLegs.js +9 -8
  156. package/dist/unstable/RetargetLegs.js.map +1 -1
  157. package/dist/unstable/Spine.d.ts +81 -72
  158. package/dist/unstable/Spine.d.ts.map +1 -1
  159. package/dist/unstable/Spine.js +171 -164
  160. package/dist/unstable/Spine.js.map +1 -1
  161. package/dist/unstable/Stops.d.ts +3 -3
  162. package/dist/unstable/Stops.js +4 -4
  163. package/dist/unstable/Subject.d.ts +2 -2
  164. package/dist/unstable/Subject.js +2 -2
  165. package/dist/unstable/Timelines.d.ts +11 -11
  166. package/dist/unstable/Timelines.d.ts.map +1 -1
  167. package/dist/unstable/Timelines.js +3 -3
  168. package/dist/unstable/VariantTarget.d.ts +7 -7
  169. package/dist/unstable/VariantTarget.d.ts.map +1 -1
  170. package/dist/unstable/VariantTarget.js +11 -11
  171. package/dist/unstable/VariantTarget.js.map +1 -1
  172. package/dist/unstable/VariantTree.d.ts +43 -36
  173. package/dist/unstable/VariantTree.d.ts.map +1 -1
  174. package/dist/unstable/VariantTree.js +34 -34
  175. package/dist/unstable/VariantTree.js.map +1 -1
  176. package/dist/unstable/WardicConfigValue.d.ts +13 -13
  177. package/dist/unstable/WardicConfigValue.d.ts.map +1 -1
  178. package/dist/unstable/WardicConfigValue.js +4 -4
  179. package/dist/unstable/WardicConfigValue.js.map +1 -1
  180. package/package.json +1 -1
  181. package/src/Arc.ts +3 -3
  182. package/src/BaseValue.ts +18 -21
  183. package/src/Batch.ts +236 -22
  184. package/src/Clock.ts +18 -17
  185. package/src/DefaultTransition.ts +5 -3
  186. package/src/Drag.ts +32 -14
  187. package/src/DragActivity.ts +3 -3
  188. package/src/DragRecognizer.ts +65 -23
  189. package/src/Easing.ts +1 -1
  190. package/src/Frame.ts +5 -3
  191. package/src/InputFeed.ts +2 -2
  192. package/src/InputSource.ts +12 -5
  193. package/src/Interpolator.ts +3 -3
  194. package/src/InterpolatorRegistry.ts +22 -13
  195. package/src/LiveValue.ts +47 -17
  196. package/src/Machine.ts +199 -61
  197. package/src/Playback.ts +5 -1
  198. package/src/Projection.ts +10 -28
  199. package/src/Recognizer.ts +24 -8
  200. package/src/ReducedMotion.ts +6 -6
  201. package/src/Renderer.ts +6 -6
  202. package/src/Reorder.ts +84 -38
  203. package/src/ScrollSource.ts +1 -1
  204. package/src/Sequence.ts +1 -1
  205. package/src/SharedSource.ts +5 -5
  206. package/src/Spring.ts +2 -1
  207. package/src/Values.ts +2 -2
  208. package/src/index.ts +1 -1
  209. package/src/internal/carried.ts +22 -0
  210. package/src/internal/firstSteps.ts +139 -0
  211. package/src/internal/frameLoop.ts +103 -87
  212. package/src/internal/lerpsNumbers.ts +53 -0
  213. package/src/internal/options.ts +10 -10
  214. package/src/internal/projectionRest.ts +31 -0
  215. package/src/internal/stepper.ts +20 -2
  216. package/src/internal/tracing.ts +1 -1
  217. package/src/unstable/AnimationControls.ts +59 -56
  218. package/src/unstable/AppearHandoff.ts +6 -6
  219. package/src/unstable/BatchCalls.ts +5 -5
  220. package/src/unstable/Config.ts +19 -19
  221. package/src/unstable/FirstSteps.ts +26 -0
  222. package/src/unstable/FlushGate.ts +92 -82
  223. package/src/unstable/FrameEffects.ts +2 -2
  224. package/src/unstable/FrameTime.ts +1 -1
  225. package/src/unstable/Imperative.ts +126 -56
  226. package/src/unstable/OwnValues.ts +1 -1
  227. package/src/unstable/PresenceRecord.ts +34 -30
  228. package/src/unstable/Projector.ts +45 -0
  229. package/src/unstable/Report.ts +1 -1
  230. package/src/unstable/RetargetLegs.ts +10 -9
  231. package/src/unstable/Spine.ts +210 -201
  232. package/src/unstable/Stops.ts +6 -6
  233. package/src/unstable/Subject.ts +2 -2
  234. package/src/unstable/Timelines.ts +12 -12
  235. package/src/unstable/VariantTarget.ts +13 -13
  236. package/src/unstable/VariantTree.ts +50 -43
  237. package/src/unstable/WardicConfigValue.ts +13 -13
@@ -7,7 +7,7 @@
7
7
  * Unstable, for Wardic's own packages: public, with no semver promise. `@wardic/dom/Style` re-exports
8
8
  * it for binding authors.
9
9
  *
10
- * Observability: pure and per element, so quiet (no span, no log).
10
+ * Observability: pure and per Subject, so quiet (no span, no log).
11
11
  *
12
12
  * @module
13
13
  */
@@ -87,7 +87,7 @@ const keepAnimatable = (value: unknown, key: string): boolean => {
87
87
 
88
88
  /** A values map's numbers and strings, its Keyframes set aside (#452, {@link keepAnimatable}): {@link toValues}' one pass. */
89
89
  const filtered = (v: object | undefined): Values.Values => {
90
- // Per element at mount (#540): statements and a loop.
90
+ // Per Subject at mount (#540): statements and a loop.
91
91
  setAside = undefined
92
92
  const out: Record<string, number | string> = {}
93
93
  if (Predicate.isUndefined(v)) return out
@@ -164,7 +164,7 @@ export const valuesAt = (v: object | undefined, at: StopAt): Values.Values => {
164
164
  export const keyframesOf = (v: object | undefined): Option.Option<Readonly<Record<string, Stops>>> => splitValues(v, "last").keyframes
165
165
 
166
166
  /**
167
- * What of an element's config its starting style is read from. Its values are typed `object`, so a
167
+ * What of a Subject's config its starting style is read from. Its values are typed `object`, so a
168
168
  * binding's own value types fit as they are.
169
169
  */
170
170
  export interface InitialConfig {
@@ -192,7 +192,7 @@ const isList = (entry: unknown): entry is ReadonlyArray<string> => Arr.isArray(e
192
192
 
193
193
  /**
194
194
  * A values map, or the `variants` entry a name names (an unknown name is empty), or nothing.
195
- * Built once, at module load: every element reads its own at setup (#69).
195
+ * Built once, at module load: every Subject reads its own at setup (#69).
196
196
  */
197
197
  const entryOf: (entry: Entry) => Values.Values = Match.type<Entry>().pipe(
198
198
  Match.when({ entry: Match.undefined }, (): Values.Values => ({})),
@@ -204,7 +204,7 @@ const entryOf: (entry: Entry) => Values.Values = Match.type<Entry>().pipe(
204
204
  )
205
205
 
206
206
  /**
207
- * The values an element starts from: its `initial` values, or the `variants` entries its `initial` names,
207
+ * The values a Subject starts from: its `initial` values, or the `variants` entries its `initial` names,
208
208
  * an unknown name empty, or nothing. With `initial: false`, its `animate`, resolved the same way, so it
209
209
  * starts at its target and nothing animates at mount, as Motion's. A keyframes value starts at its first
210
210
  * stop, or, with `initial: false`, at `animate`'s last, where the animation it skips would end. Read once,
@@ -215,7 +215,7 @@ const entryOf: (entry: Entry) => Values.Values = Match.type<Entry>().pipe(
215
215
  */
216
216
  // #134, Motion's `initial={false}`; **Keyframes** (#429, Motion's `use-visual-state.ts`).
217
217
  export const resolveInitial = (config: InitialConfig): Values.Values => {
218
- // Per element at mount (#540): statements.
218
+ // Per Subject at mount (#540): statements.
219
219
  if (config.initial === false) return entryOf({ entry: config.animate, variants: config.variants, at: "last" })
220
220
  return entryOf({ entry: config.initial as object | string | ReadonlyArray<string> | undefined, variants: config.variants, at: "first" })
221
221
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
- * What an Environment draws and a Ward binds (**Subject**): opaque to core. An element in `@wardic/dom`, an
3
- * object in a scene; an Environment decides what its Subjects are.
2
+ * What an Environment draws and a Ward binds (**Subject**): opaque to core. `@wardic/dom`'s are its own kind,
3
+ * a scene's its objects; an Environment decides what its Subjects are.
4
4
  *
5
5
  * Unstable, for Wardic's own packages: public, with no semver promise.
6
6
  *
@@ -1,7 +1,7 @@
1
1
  /**
2
- * **Timeline values** (#240, ADR-0043 *Amendment (#240)*): what an element's spine tells of its keys,
2
+ * **Timeline values** (#240, ADR-0043 *Amendment (#240)*): what a Subject's spine tells of its keys,
3
3
  * and the service that runs their Timeline values, which a binding's `scroll` Feature gives. Only the
4
- * type and the key are here, on every element's path: the code is the Feature's, so an app that reads
4
+ * type and the key are here, on every Subject's path: the code is the Feature's, so an app that reads
5
5
  * no scroll ships none of it.
6
6
  *
7
7
  * Unstable, for Wardic's own packages: public, with no semver promise.
@@ -9,34 +9,34 @@
9
9
  * @module
10
10
  */
11
11
  // Unstable: ADR-0071, decision 5. #672 (Q15): solid's `timelines.ts`, moved for the spine to tell its keys'
12
- // Timeline values in core; its options' element a Subject, its runtime a Runner.
12
+ // Timeline values in core; its options' `subject` a Subject, its runtime a Runner.
13
13
  import type * as FlushGate from "./FlushGate.ts"
14
14
  import * as Context from "effect/Context"
15
15
  import type * as Atom from "effect/reactivity/Atom"
16
16
  import type * as Subject from "./Subject.ts"
17
17
  import type * as WardicServices from "./WardicServices.ts"
18
18
 
19
- /** An element's keys' Timeline values, as its spine tells of them. */
19
+ /** A Subject's keys' Timeline values, as its spine tells of them. */
20
20
  export interface TimelineKeys {
21
- /** The element shows `key`'s Live value: its Timeline value runs, when it has one. */
21
+ /** The Subject shows `key`'s Live value: its Timeline value runs, when it has one. */
22
22
  readonly shown: (key: string) => void
23
23
  /** Something else draws `key` now (an entry, a drag, an Imperative animation), or it left the `style`: its Timeline value stops. */
24
24
  readonly taken: (key: string) => void
25
- /** The element's unmounted: it's no longer told of a value described. */
25
+ /** The Subject's unmounted: it's no longer told of a value described. */
26
26
  readonly dispose: () => void
27
27
  }
28
28
 
29
- /** What an element's {@link TimelineKeys} are made with. */
29
+ /** What a Subject's {@link TimelineKeys} are made with. */
30
30
  export interface TimelineKeysOptions {
31
31
  readonly runtime: WardicServices.Runner<WardicServices.WardicServices>
32
32
  readonly gate: FlushGate.Shape
33
33
  readonly id: string
34
- readonly element: Subject.Subject
34
+ readonly subject: Subject.Subject
35
35
  /** Its routed `style` keys: each key's Atom, which describes its derivation. */
36
36
  readonly live: LiveAtoms
37
37
  }
38
38
 
39
- /** What an element's Timeline values read of its Live values: a routed key's Atom, `undefined` for one not routed. */
39
+ /** What a Subject's Timeline values read of its Live values: a routed key's Atom, `undefined` for one not routed. */
40
40
  // #672: the one member the Timelines' keys call of the spine's LiveRoutes, which meets it; named here, so
41
41
  // this module, which the spine imports, imports nothing of the spine's.
42
42
  export interface LiveAtoms {
@@ -44,10 +44,10 @@ export interface LiveAtoms {
44
44
  }
45
45
 
46
46
  /**
47
- * The `scroll` Feature's Timeline values (#240), one per provider: an element's {@link TimelineKeys},
47
+ * The `scroll` Feature's Timeline values (#240), one per provider: a Subject's {@link TimelineKeys},
48
48
  * made at its first write of a Live value; and `described`, told by a `createScroll` that has described
49
- * its values (`LiveValue.derivesAs`), after the elements following them may have shown them, so each
50
- * key an element shows finds its Timeline value then, its value unchanged.
49
+ * its values (`LiveValue.derivesAs`), after the Subjects following them may have shown them, so each
50
+ * key a Subject shows finds its Timeline value then, its value unchanged.
51
51
  */
52
52
  export class Timelines extends /*#__PURE__*/ Context.Service<
53
53
  Timelines,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * A target resolved (#277, ADR-0048): a values map, or a variant name against an element's
2
+ * A target resolved (#277, ADR-0048): a values map, or a variant name against a Subject's
3
3
  * `variants`, each a target with its own transition or a dynamic variant, a function of `custom`.
4
4
  * Motion's `resolveVariantFromProps` and `resolveTransition`. Shared by every binding's spine, its
5
5
  * variant nodes and its Starting style.
@@ -22,7 +22,7 @@ import type * as Config from "./Config.ts"
22
22
 
23
23
  /**
24
24
  * What a dynamic variant reads besides `custom` (#277, Motion's `current` and `velocity`): the
25
- * element's values now and their velocities, its Snapshot's. Copied only when a resolver is called.
25
+ * Subject's values now and their velocities, its Snapshot's. Copied only when a resolver is called.
26
26
  */
27
27
  export interface VariantState {
28
28
  readonly values: Readonly<Record<string, number | string>>
@@ -140,7 +140,7 @@ const namedOf = (definition: Definition | Failed, variants: Config.WardicVariant
140
140
  /**
141
141
  * Resolve a target (#277): a values map, or a variant name, against `variants`, Motion's
142
142
  * `resolveVariantFromProps`. A name's entry is looked up, a resolver is called with `custom` and the
143
- * element's `state`, and a resolver that returns a name is followed once more. Its values go through
143
+ * Subject's `state`, and a resolver that returns a name is followed once more. Its values go through
144
144
  * `Stops.valuesAt`, so `Override.resolve` and `Values.split` never see an `undefined` value, nor an
145
145
  * array: a key's Keyframes (#429) are split off, its value their last stop; its `transition` is split
146
146
  * off too.
@@ -163,7 +163,7 @@ export const resolveTargets = (entry: Entry, variants: Config.WardicVariants | u
163
163
  }
164
164
 
165
165
  /** An entry's name: the entry itself, when it's one. */
166
- // Per Retarget, per element (#460, compose once): statements.
166
+ // Per Retarget, per Subject (#460, compose once): statements.
167
167
  const nameOfEntry = (entry: Config.WardicVariant | string | undefined): string | undefined => {
168
168
  if (Predicate.isString(entry)) return entry
169
169
  return undefined
@@ -251,16 +251,16 @@ const transitionEndOf = (given: unknown): Values.Values | undefined => {
251
251
 
252
252
  /**
253
253
  * The transition an animation to a target runs on (#277, Motion's `resolveTransition`): the target's
254
- * own in place of the element's, or laid over it with `inherit: true` (a shallow merge, its own keys
255
- * winning); the element's when it has none. An own transition with no `inherit` is handed back as it
254
+ * own in place of the Subject's, or laid over it with `inherit: true` (a shallow merge, its own keys
255
+ * winning); the Subject's when it has none. An own transition with no `inherit` is handed back as it
256
256
  * is, the same object each call, so a memo of it holds (#460: a copy per call made Solid 2's variant
257
257
  * node re-run its orchestration's readers at every gesture, `UNSTABLE_MEMO_OUTPUT`).
258
258
  */
259
- export const transitionOfTarget = (own: Config.WardicVariantTransition | undefined, element: Config.WardicTransition | undefined): Config.WardicTransition | undefined => {
260
- if (Predicate.isUndefined(own)) return element
259
+ export const transitionOfTarget = (own: Config.WardicVariantTransition | undefined, wardTransition: Config.WardicTransition | undefined): Config.WardicTransition | undefined => {
260
+ if (Predicate.isUndefined(own)) return wardTransition
261
261
  if (!("inherit" in own)) return own as Config.WardicTransition
262
262
  const { inherit, ...rest } = own
263
- if (inherit === true) return { ...element, ...rest } as Config.WardicTransition
263
+ if (inherit === true) return { ...wardTransition, ...rest } as Config.WardicTransition
264
264
  return rest as Config.WardicTransition
265
265
  }
266
266
 
@@ -280,7 +280,7 @@ export interface StartingVariants {
280
280
  readonly failure: Option.Option<VariantFailure>
281
281
  }
282
282
 
283
- /** No variants: one value, as most elements have none (#979, bench:solid's mount). */
283
+ /** No variants: one value, as most Subjects have none (#979, bench:solid's mount). */
284
284
  const NO_STARTING_VARIANTS: StartingVariants = { variants: undefined, failure: NO_FAILURE }
285
285
 
286
286
  /**
@@ -292,7 +292,7 @@ export const startingVariantsOf = (variants: object | undefined, custom: unknown
292
292
  if (Predicate.isUndefined(variants)) return NO_STARTING_VARIANTS
293
293
  const entries = variants as Config.WardicVariants
294
294
  if (Bool.not(Arr.some(Rec.values(entries), Predicate.isFunction))) return { variants, failure: NO_FAILURE }
295
- // Once an element's setup (#979): each entry resolved, a throwing resolver's left with no values.
295
+ // Once a Subject's setup (#979): each entry resolved, a throwing resolver's left with no values.
296
296
  const targets = Rec.map(entries, (_, name) => resolveTarget(name, entries, custom, NO_VARIANT_STATE))
297
297
  return { variants: Rec.map(targets, valuesOfTarget), failure: Option.firstSomeOf(Arr.map(Rec.values(targets), failureOfTarget)) }
298
298
  }
@@ -301,7 +301,7 @@ export const startingVariantsOf = (variants: object | undefined, custom: unknown
301
301
  export type Orchestrated = (entry: Config.WardicVariantLabels, failure: Option.Option<VariantFailure>) => void
302
302
 
303
303
  /**
304
- * The own transition of an element's target now (#277): its `animate` map's, else the variant it
304
+ * The own transition of a Subject's target now (#277): its `animate` map's, else the variant it
305
305
  * names or inherits (`name`), resolved with `custom` and no values. What its orchestration reads.
306
306
  * `orchestrated` is told what a name's resolution came to: a resolver that throws gives no own
307
307
  * transition.
@@ -319,7 +319,7 @@ export const ownTransitionOf = (
319
319
  }
320
320
  if (Predicate.isUndefined(name)) return undefined
321
321
  const target = resolveTarget(name, byName, custom, NO_VARIANT_STATE)
322
- // #979 (Q6): a throw here is reported through the element's own once, its resolution's apart.
322
+ // #979 (Q6): a throw here is reported through the Subject's own once, its resolution's apart.
323
323
  if (Predicate.isNotUndefined(orchestrated)) orchestrated(name, target.failure)
324
324
  return target.transition
325
325
  }
@@ -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,7 +22,7 @@
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.ts"
27
27
  import type * as Values from "../Values.ts"
28
28
  import * as Report from "./Report.ts"
@@ -98,7 +98,7 @@ export interface WardicStaggerConfig {
98
98
  * inherit).
99
99
  * - `initial` — the parent's `initial` NAME, or `false`, read once (#50, #134).
100
100
  *
101
- * Every Wardic element provides one (#50): its own if it has variants of its own, else its
101
+ * Every Ward's Subject provides one (#50): its own if it has variants of its own, else its
102
102
  * parent's, passed through (`variant-node.ts`).
103
103
  * - `transition` — the parent's transition, inherited as the DEFAULT for
104
104
  * children that supply no local `transition`.
@@ -112,10 +112,10 @@ export type GestureLayer = "inView" | "focused" | "hovered" | "pressed" | "dragg
112
112
  /** The gesture layers in Motion's priority, lowest first. */
113
113
  export const GESTURE_LAYERS: ReadonlyArray<GestureLayer> = ["inView", "focused", "hovered", "pressed", "dragged"]
114
114
 
115
- /** The variant names an element hands its Variant children for its active gestures (#291): a name or a list each (#297). */
115
+ /** The variant names a Subject hands its Variant children for its active gestures (#291): a name or a list each (#297). */
116
116
  export type GestureNames = Readonly<Partial<Record<GestureLayer, Config.WardicVariantLabels | undefined>>>
117
117
 
118
- /** No gesture on: what an element with none active hands down. */
118
+ /** No gesture on: what a Subject with none active hands down. */
119
119
  export const NO_GESTURE_NAMES: GestureNames = {}
120
120
 
121
121
  /** Two {@link GestureNames} the same: the same names for each gesture, a list name by name (#297). */
@@ -129,7 +129,7 @@ export type GestureStates = Readonly<Record<GestureLayer, boolean>>
129
129
  export const NO_GESTURE_STATES: GestureStates = { inView: false, focused: false, hovered: false, pressed: false, dragged: false }
130
130
 
131
131
  /**
132
- * What an element hands its Variant children for its gestures (#291, Motion's `setActive` and variant
132
+ * What a Subject hands its Variant children for its gestures (#291, Motion's `setActive` and variant
133
133
  * context): whether each is on (its own, or its own provider's), and each one's label (its own
134
134
  * `while*`, if a name, else the one it took). A Variant child's gesture is on while its provider's is.
135
135
  */
@@ -138,7 +138,7 @@ export interface GestureHandDown {
138
138
  readonly names: GestureNames
139
139
  }
140
140
 
141
- /** Nothing on, no labels: what an element hands down with no provider and no gesture. */
141
+ /** Nothing on, no labels: what a Subject hands down with no provider and no gesture. */
142
142
  export const NO_HAND_DOWN: GestureHandDown = { on: NO_GESTURE_STATES, names: NO_GESTURE_NAMES }
143
143
 
144
144
  /** Two hand-downs the same: each gesture on alike, with the same label. */
@@ -147,7 +147,7 @@ export const sameHandDown = (a: GestureHandDown, b: GestureHandDown): boolean =>
147
147
 
148
148
  /** What a context hands down, nothing without a context or its gestures. */
149
149
  export const handDownFrom = (context: WardicVariantContextValue | undefined): GestureHandDown => {
150
- // Per Retarget, per element: guards, nothing made (most elements have no provider).
150
+ // Per Retarget, per Subject: guards, nothing made (most Subjects have no provider).
151
151
  if (Predicate.isUndefined(context)) return NO_HAND_DOWN
152
152
  const gestures = context.gestures
153
153
  if (Predicate.isUndefined(gestures)) return NO_HAND_DOWN
@@ -178,7 +178,7 @@ const labelOf = (own: object | Config.WardicVariantLabels | undefined, inherited
178
178
  return inherited
179
179
  }
180
180
 
181
- /** What an element hands down (#291), from its config, its own states, and what it takes. */
181
+ /** What a Subject hands down (#291), from its config, its own states, and what it takes. */
182
182
  export const handDownOf = (config: GestureConfig, own: GestureStates, above: GestureHandDown): GestureHandDown => ({
183
183
  on: gesturesOn(own, above.on),
184
184
  names: {
@@ -318,7 +318,7 @@ export interface WardicVariantContextValue {
318
318
  readonly staggerFor?: (name: string | undefined) => WardicStaggerConfig
319
319
  /**
320
320
  * For a list: whether a Variant child's keys of `name` may start, that name's own
321
- * `beforeChildren`: true unless it has one and this element's keys of that name haven't settled
321
+ * `beforeChildren`: true unless it has one and this Subject's keys of that name haven't settled
322
322
  * since its list last changed. Optional: left out, always.
323
323
  */
324
324
  readonly mayStartFor?: (name: string) => boolean
@@ -346,7 +346,7 @@ export interface WardicVariantContextValue {
346
346
  readonly appearGroup?: unknown
347
347
  }
348
348
 
349
- /** The part of an element's config its place in variant orchestration reads. */
349
+ /** The part of a Subject's config its place in variant orchestration reads. */
350
350
  export interface VariantConfig extends GestureConfig {
351
351
  readonly initial?: object | Config.WardicVariantLabels | false | undefined
352
352
  readonly animate?: object | Config.WardicVariantLabels | undefined
@@ -361,9 +361,16 @@ export interface VariantConfig extends GestureConfig {
361
361
  * entry is, as Motion's `isControllingVariants`, so it hands down the names its controls set.
362
362
  */
363
363
  readonly controlled?: boolean | undefined
364
+ /**
365
+ * Whether it's a **Variant child** by its own word (probe: hooks-first, the gap grill's Q26): one
366
+ * that names gesture variants of its own is one all the same, joining its nearest ancestor with
367
+ * variants and handing its own gesture names down with the ones it takes. Left out, Motion's rule
368
+ * alone decides, as today.
369
+ */
370
+ readonly variantChild?: boolean | undefined
364
371
  }
365
372
 
366
- /** An `initial` an element hands its children: a variant name or list (#297), `false` (#134), or `undefined` for a values map or nothing. */
373
+ /** An `initial` a Subject hands its children: a variant name or list (#297), `false` (#134), or `undefined` for a values map or nothing. */
367
374
  export const initialNameOf = (entry: object | Config.WardicVariantLabels | false | undefined): Config.WardicVariantLabels | false | undefined =>
368
375
  Bool.match(entry === false, { onTrue: () => false as const, onFalse: () => nameOf(entry as object | Config.WardicVariantLabels | undefined) })
369
376
 
@@ -390,21 +397,21 @@ export const namesOwnVariants = (config: VariantConfig): boolean =>
390
397
  VariantTarget.isLabels(config.whileDrag) ||
391
398
  VariantTarget.isLabels(config.exit)
392
399
 
393
- /** Whether an element has variants of its own, so Variant children join it (Motion's `isVariantNode`). */
400
+ /** Whether a Subject has variants of its own, so Variant children join it (Motion's `isVariantNode`). */
394
401
  export const hasOwnVariants = (config: VariantConfig): boolean =>
395
402
  Predicate.isNotUndefined(config.variants) || namesOwnVariants(config)
396
403
 
397
404
  /**
398
- * Whether an element changes what its children read, so it renders its variant context's
399
- * Provider (#50): it has variants of its own, or it sets `inherit={false}`. Any other element hands
405
+ * Whether a Subject changes what its children read, so it renders its variant context's
406
+ * Provider (#50): it has variants of its own, or it sets `inherit={false}`. Any other Subject hands
400
407
  * its children its parent's context as it is, so it renders none. Decided once, at setup, from the
401
408
  * same props on a server and on the client, so the nesting never changes after mount.
402
409
  */
403
410
  export const changesContext = (config: VariantConfig): boolean => hasOwnVariants(config) || config.inherit === false
404
411
 
405
412
  /**
406
- * The **Controls change** in effect for an element (#433): its own controls', else the one the context
407
- * it inherits from is in, else none. Per mount, for every element (#460): guards, nothing built.
413
+ * The **Controls change** in effect for a Subject (#433): its own controls', else the one the context
414
+ * it inherits from is in, else none. Per mount, for every Subject (#460): guards, nothing built.
408
415
  */
409
416
  export const controlsChangeOf = (
410
417
  controls: Reactivity.Accessor<AnimationControls.ControlsChange | undefined> | undefined,
@@ -417,22 +424,22 @@ export const controlsChangeOf = (
417
424
  return change
418
425
  }
419
426
 
420
- /** Whether an element is a **Variant child** (CONTEXT.md). */
427
+ /** Whether a Subject is a **Variant child** (CONTEXT.md): by Motion's rule, or by its own word ({@link VariantConfig.variantChild}). */
421
428
  export const isVariantChild = (config: VariantConfig): boolean =>
422
- Predicate.isNotUndefined(config.variants) && !namesOwnVariants(config) && config.inherit !== false
429
+ Predicate.isNotUndefined(config.variants) && (config.variantChild === true || !namesOwnVariants(config)) && config.inherit !== false
423
430
 
424
- /** The context an element inherits names and its default transition from: its parent's, for a Variant child. */
431
+ /** The context a Subject inherits names and its default transition from: its parent's, for a Variant child. */
425
432
  export const inheritedContext = (
426
433
  config: VariantConfig,
427
434
  parent: WardicVariantContextValue | undefined,
428
435
  ): WardicVariantContextValue | undefined => {
429
- // Per element at mount (#540): statements.
436
+ // Per Subject at mount (#540): statements.
430
437
  if (isVariantChild(config)) return parent
431
438
  return undefined
432
439
  }
433
440
 
434
441
  /**
435
- * The `initial` an element's Starting style resolves: its own, else the `initial` name (or `false`) of
442
+ * The `initial` a Subject's Starting style resolves: its own, else the `initial` name (or `false`) of
436
443
  * the context it inherits from (#50, #134). Read once, as every `initial` is.
437
444
  */
438
445
  export const initialOf = (
@@ -444,7 +451,7 @@ export const initialOf = (
444
451
  onUndefined: () => UndefinedOr.match(inherited, { onUndefined: constUndefined, onDefined: (context) => context.initial }),
445
452
  })
446
453
 
447
- /** The `animate` an element starts at with `initial={false}`: its own, else the name its context hands down (#134). Read once, untracked. */
454
+ /** The `animate` a Subject starts at with `initial={false}`: its own, else the name its context hands down (#134). Read once, untracked. */
448
455
  const animateOf = (
449
456
  config: VariantConfig,
450
457
  inherited: WardicVariantContextValue | undefined,
@@ -456,7 +463,7 @@ const animateOf = (
456
463
  })
457
464
 
458
465
  /**
459
- * Whether an element starts at its `animate`, with nothing animating at mount (#134, Motion's
466
+ * Whether a Subject starts at its `animate`, with nothing animating at mount (#134, Motion's
460
467
  * `isInitialAnimationBlocked`): its `initial` (own or inherited) is `false`, or it renders with an
461
468
  * `<AnimatePresence initial={false}>`'s first render (`presenceBlocks`).
462
469
  */
@@ -467,7 +474,7 @@ export const startsAtAnimate = (
467
474
  ): boolean => presenceBlocks || initialOf(config, inherited) === false
468
475
 
469
476
  /**
470
- * Whether an element's mount tells nothing (#448, Motion's `animation-state.ts`): it
477
+ * Whether a Subject's mount tells nothing (#448, Motion's `animation-state.ts`): it
471
478
  * {@link startsAtAnimate}, or its `initial` (own, else inherited) is the same name, list or values map
472
479
  * as its `animate` (own, else inherited). Its first Retarget, landing with nothing to animate, is told
473
480
  * to no one. Read once, untracked.
@@ -485,14 +492,14 @@ export const startsQuiet = (
485
492
  return VariantTarget.sameLabels(initial as Config.WardicVariantLabels, animateOf(config, inherited, untrack) as Config.WardicVariantLabels)
486
493
  }
487
494
 
488
- /** What an element starts from, and the first of its variants whose resolver threw (#979). */
495
+ /** What a Subject starts from, and the first of its variants whose resolver threw (#979). */
489
496
  export interface Starting {
490
497
  readonly values: Values.Values
491
498
  readonly failure: Option.Option<VariantTarget.VariantFailure>
492
499
  }
493
500
 
494
501
  /**
495
- * The values an element starts from, its Starting style's input (ADR-0003): its `initial` (own, else
502
+ * The values a Subject starts from, its Starting style's input (ADR-0003): its `initial` (own, else
496
503
  * inherited, #50), or, when it {@link startsAtAnimate}, its `animate` (own, else inherited), as
497
504
  * Motion's `initial={false}` (#134). Read once: an inherited name is read through `untrack`.
498
505
  */
@@ -504,8 +511,8 @@ export const startingValuesOf = (
504
511
  ): Values.Values => startingValuesFrom(config, inherited, presenceBlocks, untrack, VariantTarget.startingVariantsOf(config.variants, config.custom).variants)
505
512
 
506
513
  /**
507
- * {@link startingValuesOf}, with what a resolver among the element's variants threw: its entry gives no
508
- * values, and the element starts at the rest (#979).
514
+ * {@link startingValuesOf}, with what a resolver among the Subject's variants threw: its entry gives no
515
+ * values, and the Subject starts at the rest (#979).
509
516
  */
510
517
  export const startingOf = (
511
518
  config: VariantConfig,
@@ -519,7 +526,7 @@ export const startingOf = (
519
526
 
520
527
  /**
521
528
  * {@link startingValuesOf} from its variants already resolved to values (`VariantTarget.startingVariantsOf`):
522
- * what an element's start reads, which reads their failure too.
529
+ * what a Subject's start reads, which reads their failure too.
523
530
  */
524
531
  export const startingValuesFrom = (
525
532
  config: VariantConfig,
@@ -531,7 +538,7 @@ export const startingValuesFrom = (
531
538
  const atAnimate = startsAtAnimate(config, inherited, presenceBlocks)
532
539
  const animate = animateOf(config, inherited, untrack)
533
540
  const initial = initialOf(config, inherited)
534
- // Per element at mount (#540): statements. Starting at `animate` resolves as `initial={false}`,
541
+ // Per Subject at mount (#540): statements. Starting at `animate` resolves as `initial={false}`,
535
542
  // and its first target is `animate`.
536
543
  let from = initial
537
544
  let first = initial
@@ -554,7 +561,7 @@ export const startingValuesFrom = (
554
561
  }
555
562
 
556
563
  /**
557
- * A name an element hands its children (Motion's `getCurrentTreeVariants`): `own` if it names its own
564
+ * A name a Subject hands its children (Motion's `getCurrentTreeVariants`): `own` if it names its own
558
565
  * variants, else `fromParent` unless it sets `inherit={false}`.
559
566
  */
560
567
  export const handedDown = <A extends Config.WardicVariantLabels | false>(config: VariantConfig, own: () => A | undefined, fromParent: () => A | undefined): A | undefined =>
@@ -563,11 +570,11 @@ export const handedDown = <A extends Config.WardicVariantLabels | false>(config:
563
570
  onFalse: () => Bool.match(config.inherit === false, { onTrue: constUndefined, onFalse: fromParent }),
564
571
  })
565
572
 
566
- /** An element's own transition, else the one it inherits. */
573
+ /** A Subject's own transition, else the one it inherits. */
567
574
  export const ownOrInherited = (own: Config.WardicTransition | undefined, inherited: WardicVariantContextValue | undefined): Config.WardicTransition | undefined =>
568
575
  UndefinedOr.match(own, { onUndefined: () => UndefinedOr.map(inherited, (context) => context.transition()), onDefined: identity })
569
576
 
570
- /** The stagger config an element's `transition` gives its Variant children. */
577
+ /** The stagger config a Subject's `transition` gives its Variant children. */
571
578
  export const staggerOf = (transition: Config.WardicTransition | undefined): WardicStaggerConfig =>
572
579
  UndefinedOr.match(transition, { onUndefined: () => staggerWith({}), onDefined: staggerWith })
573
580
 
@@ -593,7 +600,7 @@ export const directed = (index: number, total: number, direction: 1 | -1): numbe
593
600
 
594
601
  /**
595
602
  * Where a stagger reports a `delayChildren` function that throws: the runtime it's reported on, and whether
596
- * it's failing, so a run of throws is reported once. A Variant child's is its element's, for its life, its
603
+ * it's failing, so a run of throws is reported once. A Variant child's is its Subject's, for its life, its
597
604
  * run ended by its next clean call. A presence's exit and a server's Appear timing make one for the event,
598
605
  * `event`, whose first throw is reported whatever its other calls do.
599
606
  */
@@ -627,7 +634,7 @@ export const childDelayOf = (s: WardicStaggerConfig, index: number, total: numbe
627
634
  const DELAY_FAILED = "wardic.stagger: a delayChildren function failed"
628
635
 
629
636
  /** `delayChildren` called for a child, a throw its child's: no delay, reported once a run on `failures`. */
630
- // A child's run is its element's, whatever name it's staggered under: a parent's own transition staggers
637
+ // A child's run is its Subject's, whatever name it's staggered under: a parent's own transition staggers
631
638
  // every name with one function, so a run kept by name would report it again for each. (The review's: a
632
639
  // child staggered under two names at once, one function throwing and one not, is reported at each change.)
633
640
  const calledDelayOf = (delayChildren: Config.WardicStagger, index: number, total: number, failures: DelayFailures | undefined): number => {
@@ -646,7 +653,7 @@ const calledDelayOf = (delayChildren: Config.WardicStagger, index: number, total
646
653
  }
647
654
  }
648
655
 
649
- /** A name's orchestration (#297): its stagger config, and its own `when`, from its own transition, else the element's. */
656
+ /** A name's orchestration (#297): its stagger config, and its own `when`, from its own transition, else the Subject's. */
650
657
  export interface NameConfig {
651
658
  readonly stagger: WardicStaggerConfig
652
659
  readonly when: "beforeChildren" | "afterChildren" | undefined
@@ -674,7 +681,7 @@ export const staggerWith = ({ staggerChildren = 0, delayChildren = 0, from = "fi
674
681
  export const sameStagger = (a: WardicStaggerConfig, b: WardicStaggerConfig): boolean =>
675
682
  a.amount === b.amount && a.delayChildren === b.delayChildren && a.from === b.from && a.direction === b.direction
676
683
 
677
- /** What an element provides when it has no variants of its own: its parent's context, unless `inherit={false}`. */
684
+ /** What a Subject provides when it has no variants of its own: its parent's context, unless `inherit={false}`. */
678
685
  export const passedThrough = (
679
686
  config: VariantConfig,
680
687
  parent: WardicVariantContextValue | undefined,
@@ -688,7 +695,7 @@ export const INERT_REGISTRATION: WardicChildRegistration = Object.freeze({
688
695
  dispose: () => {},
689
696
  })
690
697
 
691
- /** An element's place in variant orchestration during a server render (ADR-0021). */
698
+ /** A Subject's place in variant orchestration during a server render (ADR-0021). */
692
699
  export interface ServerVariantNode {
693
700
  /** What its children read: the same context the client builds, with inert orchestration. */
694
701
  readonly provided: WardicVariantContextValue | undefined
@@ -1,14 +1,14 @@
1
1
  /**
2
- * What a `WardicConfig` gives the Wardic elements below it (#434, Motion's `MotionConfig`), on
2
+ * What a `WardicConfig` gives the Wards' Subjects below it (#434, Motion's `MotionConfig`), on
3
3
  * every binding: its **Config transition**, its reduced motion and whether its
4
4
  * animations are skipped (#468).
5
5
  *
6
- * - **The Config transition is an element's own when it gives none,** as Motion's
7
- * `{ ...config, ...props }`: whatever reads the element's `transition` reads it, a Variant child's in
6
+ * - **The Config transition is a Subject's own when it gives none,** as Motion's
7
+ * `{ ...config, ...props }`: whatever reads the Subject's `transition` reads it, a Variant child's in
8
8
  * place of its parent's (Q3).
9
- * - **Its reduced motion** (ADR-0029) is the element's, over the `WardicProvider`'s (Q2), as Motion
10
- * reads its `MotionConfig`'s per element.
11
- * - **`skipAnimations`** (#468) makes every animation of the elements below a **Skipped animation**,
9
+ * - **Its reduced motion** (ADR-0029) is the Subject's, over the `WardicProvider`'s (Q2), as Motion
10
+ * reads its `MotionConfig`'s per Subject.
11
+ * - **`skipAnimations`** (#468) makes every animation of the Subjects below a **Skipped animation**,
12
12
  * Motion's `MotionConfig` `skipAnimations`, whatever their reduced motion.
13
13
  * - **`isValidProp`** (#443) keeps the props it says aren't valid from being passed on, Motion's
14
14
  * `MotionConfig` `isValidProp`.
@@ -33,7 +33,7 @@ import * as VariantTarget from "./VariantTarget.ts"
33
33
 
34
34
  /** What a `WardicConfig` gives below it (#434): one value per config, read where a binding reads it. */
35
35
  export interface WardicConfigValue {
36
- /** Its **Config transition**: read when an element's transition is, so a change starts nothing by itself. */
36
+ /** Its **Config transition**: read when a Subject's transition is, so a change starts nothing by itself. */
37
37
  readonly transition: () => Config.WardicTransition | undefined
38
38
  /**
39
39
  * Its reduced motion (ADR-0029): its own, else an enclosing config's, else `undefined` for the
@@ -46,8 +46,8 @@ export interface WardicConfigValue {
46
46
  */
47
47
  readonly skipAnimations: () => boolean | undefined
48
48
  /**
49
- * Which of an element's own props it passes on (#443, Motion's `MotionConfig` `isValidProp`): its
50
- * own, else an enclosing config's, else `undefined`, every one. Read as each element is made.
49
+ * Which of a Ward's own props it passes on (#443, Motion's `MotionConfig` `isValidProp`): its
50
+ * own, else an enclosing config's, else `undefined`, every one. Read as each Subject is made.
51
51
  */
52
52
  readonly isValidProp: () => ((key: string) => boolean) | undefined
53
53
  /**
@@ -59,7 +59,7 @@ export interface WardicConfigValue {
59
59
 
60
60
  /**
61
61
  * A `WardicConfig`'s transition (#434): its own, laid over its parent's with `inherit: true` (as a
62
- * variant's own is over the element's), else its parent's when it gives none.
62
+ * variant's own is over the Subject's), else its parent's when it gives none.
63
63
  */
64
64
  export const configTransitionOf = (own: Config.WardicVariantTransition | undefined, parent: WardicConfigValue | undefined): Config.WardicTransition | undefined =>
65
65
  VariantTarget.transitionOfTarget(own, parentTransitionOf(parent))
@@ -120,14 +120,14 @@ export const pointMapOptionOf = (read: () => Config.WardicTransformPoint | undef
120
120
  }
121
121
  }
122
122
 
123
- /** The nearest config's `isValidProp` (#443), as an element is made: `undefined` for none. */
123
+ /** The nearest config's `isValidProp` (#443), as a Subject is made: `undefined` for none. */
124
124
  export const isValidPropOf = (config: WardicConfigValue | undefined): ((key: string) => boolean) | undefined => {
125
125
  if (Predicate.isUndefined(config)) return undefined
126
126
  return config.isValidProp()
127
127
  }
128
128
 
129
129
  /**
130
- * Whether an element's animations are skipped (#468), read when each starts: its nearest config's
130
+ * Whether a Subject's animations are skipped (#468), read when each starts: its nearest config's
131
131
  * `skipAnimations`. With no config above, never, and nothing made.
132
132
  */
133
133
  export const skipAnimationsOf = (config: WardicConfigValue | undefined): (() => boolean) => {
@@ -135,7 +135,7 @@ export const skipAnimationsOf = (config: WardicConfigValue | undefined): (() =>
135
135
  return () => config.skipAnimations() === true
136
136
  }
137
137
 
138
- /** The reduced motion an element's nearest config sets (#434), now: `undefined` for none, the provider's. */
138
+ /** The reduced motion a Subject's nearest config sets (#434), now: `undefined` for none, the provider's. */
139
139
  export const settingOf = (config: WardicConfigValue | undefined): ReducedMotion.Config | undefined => {
140
140
  if (Predicate.isUndefined(config)) return undefined
141
141
  return config.reducedMotion()