@wardic/dom 1.0.1 → 1.1.1

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 (289) hide show
  1. package/dist/Appear.d.ts +3 -2
  2. package/dist/Appear.d.ts.map +1 -1
  3. package/dist/Appear.js +4 -3
  4. package/dist/Appear.js.map +1 -1
  5. package/dist/DomProjectionSystem.js +3 -3
  6. package/dist/DomProjectionSystem.js.map +1 -1
  7. package/dist/FlushGate.d.ts +6 -6
  8. package/dist/FlushGate.d.ts.map +1 -1
  9. package/dist/FlushGate.js +11 -8
  10. package/dist/FlushGate.js.map +1 -1
  11. package/dist/ReorderController.js +3 -3
  12. package/dist/ReorderController.js.map +1 -1
  13. package/dist/Report.d.ts +1 -1
  14. package/dist/Report.d.ts.map +1 -1
  15. package/dist/Report.js +3 -2
  16. package/dist/Report.js.map +1 -1
  17. package/dist/Style.d.ts +2 -1
  18. package/dist/Style.d.ts.map +1 -1
  19. package/dist/Style.js +3 -1
  20. package/dist/Style.js.map +1 -1
  21. package/dist/TimelineValue.d.ts +18 -0
  22. package/dist/TimelineValue.d.ts.map +1 -0
  23. package/dist/TimelineValue.js +20 -0
  24. package/dist/TimelineValue.js.map +1 -0
  25. package/dist/index.d.ts +13 -5
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +10 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/internal/appear.d.ts +10 -4
  30. package/dist/internal/appear.d.ts.map +1 -1
  31. package/dist/internal/appear.js +18 -8
  32. package/dist/internal/appear.js.map +1 -1
  33. package/dist/internal/batch-handoff.d.ts +25 -0
  34. package/dist/internal/batch-handoff.d.ts.map +1 -0
  35. package/dist/internal/batch-handoff.js +64 -0
  36. package/dist/internal/batch-handoff.js.map +1 -0
  37. package/dist/internal/drag-defaults.js +4 -1
  38. package/dist/internal/drag-defaults.js.map +1 -1
  39. package/dist/internal/gate-environment.d.ts +4 -0
  40. package/dist/internal/gate-environment.d.ts.map +1 -0
  41. package/dist/internal/gate-environment.js +21 -0
  42. package/dist/internal/gate-environment.js.map +1 -0
  43. package/dist/internal/projection.d.ts.map +1 -1
  44. package/dist/internal/projection.js +22 -21
  45. package/dist/internal/projection.js.map +1 -1
  46. package/dist/internal/renderer.d.ts +13 -0
  47. package/dist/internal/renderer.d.ts.map +1 -1
  48. package/dist/internal/renderer.js +21 -0
  49. package/dist/internal/renderer.js.map +1 -1
  50. package/dist/internal/reorder.d.ts +2 -2
  51. package/dist/internal/reorder.d.ts.map +1 -1
  52. package/dist/internal/reorder.js +2 -2
  53. package/dist/internal/reorder.js.map +1 -1
  54. package/dist/internal/scroll.d.ts +17 -0
  55. package/dist/internal/scroll.d.ts.map +1 -1
  56. package/dist/internal/scroll.js +23 -15
  57. package/dist/internal/scroll.js.map +1 -1
  58. package/dist/internal/starting-style.d.ts +0 -83
  59. package/dist/internal/starting-style.d.ts.map +1 -1
  60. package/dist/internal/starting-style.js +16 -143
  61. package/dist/internal/starting-style.js.map +1 -1
  62. package/dist/internal/timeline.d.ts +56 -0
  63. package/dist/internal/timeline.d.ts.map +1 -0
  64. package/dist/internal/timeline.js +389 -0
  65. package/dist/internal/timeline.js.map +1 -0
  66. package/dist/unstable/AppearAnimations.d.ts +191 -0
  67. package/dist/unstable/AppearAnimations.d.ts.map +1 -0
  68. package/dist/unstable/AppearAnimations.js +561 -0
  69. package/dist/unstable/AppearAnimations.js.map +1 -0
  70. package/dist/unstable/BatchMembers.d.ts +513 -0
  71. package/dist/unstable/BatchMembers.d.ts.map +1 -0
  72. package/dist/unstable/BatchMembers.js +2490 -0
  73. package/dist/unstable/BatchMembers.js.map +1 -0
  74. package/dist/unstable/DomValues.d.ts +25 -0
  75. package/dist/unstable/DomValues.d.ts.map +1 -0
  76. package/dist/unstable/DomValues.js +45 -0
  77. package/dist/unstable/DomValues.js.map +1 -0
  78. package/dist/unstable/DragConstraints.d.ts +48 -0
  79. package/dist/unstable/DragConstraints.d.ts.map +1 -0
  80. package/dist/unstable/DragConstraints.js +49 -0
  81. package/dist/unstable/DragConstraints.js.map +1 -0
  82. package/dist/unstable/DragControls.d.ts +50 -0
  83. package/dist/unstable/DragControls.d.ts.map +1 -0
  84. package/dist/unstable/DragControls.js +55 -0
  85. package/dist/unstable/DragControls.js.map +1 -0
  86. package/dist/unstable/DragDefaults.d.ts +34 -0
  87. package/dist/unstable/DragDefaults.d.ts.map +1 -0
  88. package/dist/unstable/DragDefaults.js +47 -0
  89. package/dist/unstable/DragDefaults.js.map +1 -0
  90. package/dist/unstable/DragTrack.d.ts +236 -0
  91. package/dist/unstable/DragTrack.d.ts.map +1 -0
  92. package/dist/unstable/DragTrack.js +646 -0
  93. package/dist/unstable/DragTrack.js.map +1 -0
  94. package/dist/unstable/DragTransition.d.ts +22 -0
  95. package/dist/unstable/DragTransition.d.ts.map +1 -0
  96. package/dist/unstable/DragTransition.js +31 -0
  97. package/dist/unstable/DragTransition.js.map +1 -0
  98. package/dist/unstable/ElementSetup.d.ts +144 -0
  99. package/dist/unstable/ElementSetup.d.ts.map +1 -0
  100. package/dist/unstable/ElementSetup.js +297 -0
  101. package/dist/unstable/ElementSetup.js.map +1 -0
  102. package/dist/unstable/Feature.d.ts +221 -0
  103. package/dist/unstable/Feature.d.ts.map +1 -0
  104. package/dist/unstable/Feature.js +281 -0
  105. package/dist/unstable/Feature.js.map +1 -0
  106. package/dist/unstable/GestureFeatures.d.ts +30 -0
  107. package/dist/unstable/GestureFeatures.d.ts.map +1 -0
  108. package/dist/unstable/GestureFeatures.js +32 -0
  109. package/dist/unstable/GestureFeatures.js.map +1 -0
  110. package/dist/unstable/GestureInfo.d.ts +61 -0
  111. package/dist/unstable/GestureInfo.d.ts.map +1 -0
  112. package/dist/unstable/GestureInfo.js +23 -0
  113. package/dist/unstable/GestureInfo.js.map +1 -0
  114. package/dist/unstable/Imperative.d.ts +214 -0
  115. package/dist/unstable/Imperative.d.ts.map +1 -0
  116. package/dist/unstable/Imperative.js +768 -0
  117. package/dist/unstable/Imperative.js.map +1 -0
  118. package/dist/unstable/Instant.d.ts +46 -0
  119. package/dist/unstable/Instant.d.ts.map +1 -0
  120. package/dist/unstable/Instant.js +49 -0
  121. package/dist/unstable/Instant.js.map +1 -0
  122. package/dist/unstable/LayoutGroup.d.ts +14 -0
  123. package/dist/unstable/LayoutGroup.d.ts.map +1 -0
  124. package/dist/unstable/LayoutGroup.js +31 -0
  125. package/dist/unstable/LayoutGroup.js.map +1 -0
  126. package/dist/unstable/LayoutMember.d.ts +127 -0
  127. package/dist/unstable/LayoutMember.d.ts.map +1 -0
  128. package/dist/unstable/LayoutMember.js +176 -0
  129. package/dist/unstable/LayoutMember.js.map +1 -0
  130. package/dist/unstable/LiveStyle.d.ts +171 -0
  131. package/dist/unstable/LiveStyle.d.ts.map +1 -0
  132. package/dist/unstable/LiveStyle.js +329 -0
  133. package/dist/unstable/LiveStyle.js.map +1 -0
  134. package/dist/unstable/MemberHold.d.ts +3 -0
  135. package/dist/unstable/MemberHold.d.ts.map +1 -0
  136. package/dist/unstable/MemberHold.js +223 -0
  137. package/dist/unstable/MemberHold.js.map +1 -0
  138. package/dist/unstable/OwnerScope.d.ts +16 -0
  139. package/dist/unstable/OwnerScope.d.ts.map +1 -0
  140. package/dist/unstable/OwnerScope.js +35 -0
  141. package/dist/unstable/OwnerScope.js.map +1 -0
  142. package/dist/unstable/PresenceController.d.ts +128 -0
  143. package/dist/unstable/PresenceController.d.ts.map +1 -0
  144. package/dist/unstable/PresenceController.js +1427 -0
  145. package/dist/unstable/PresenceController.js.map +1 -0
  146. package/dist/unstable/Press.d.ts +26 -0
  147. package/dist/unstable/Press.d.ts.map +1 -0
  148. package/dist/unstable/Press.js +19 -0
  149. package/dist/unstable/Press.js.map +1 -0
  150. package/dist/unstable/ServerInterpolators.d.ts +17 -0
  151. package/dist/unstable/ServerInterpolators.d.ts.map +1 -0
  152. package/dist/unstable/ServerInterpolators.js +20 -0
  153. package/dist/unstable/ServerInterpolators.js.map +1 -0
  154. package/dist/unstable/WardConfig.d.ts +567 -0
  155. package/dist/unstable/WardConfig.d.ts.map +1 -0
  156. package/dist/unstable/WardConfig.js +2 -0
  157. package/dist/unstable/WardConfig.js.map +1 -0
  158. package/dist/unstable/features/All.d.ts +24 -0
  159. package/dist/unstable/features/All.d.ts.map +1 -0
  160. package/dist/unstable/features/All.js +20 -0
  161. package/dist/unstable/features/All.js.map +1 -0
  162. package/dist/unstable/features/Colors.d.ts +12 -0
  163. package/dist/unstable/features/Colors.d.ts.map +1 -0
  164. package/dist/unstable/features/Colors.js +38 -0
  165. package/dist/unstable/features/Colors.js.map +1 -0
  166. package/dist/unstable/features/DomAnimation.d.ts +16 -0
  167. package/dist/unstable/features/DomAnimation.d.ts.map +1 -0
  168. package/dist/unstable/features/DomAnimation.js +19 -0
  169. package/dist/unstable/features/DomAnimation.js.map +1 -0
  170. package/dist/unstable/features/DomMax.d.ts +12 -0
  171. package/dist/unstable/features/DomMax.d.ts.map +1 -0
  172. package/dist/unstable/features/DomMax.js +14 -0
  173. package/dist/unstable/features/DomMax.js.map +1 -0
  174. package/dist/unstable/features/Drag.d.ts +5 -0
  175. package/dist/unstable/features/Drag.d.ts.map +1 -0
  176. package/dist/unstable/features/Drag.js +32 -0
  177. package/dist/unstable/features/Drag.js.map +1 -0
  178. package/dist/unstable/features/Focus.d.ts +5 -0
  179. package/dist/unstable/features/Focus.d.ts.map +1 -0
  180. package/dist/unstable/features/Focus.js +20 -0
  181. package/dist/unstable/features/Focus.js.map +1 -0
  182. package/dist/unstable/features/Hover.d.ts +5 -0
  183. package/dist/unstable/features/Hover.d.ts.map +1 -0
  184. package/dist/unstable/features/Hover.js +20 -0
  185. package/dist/unstable/features/Hover.js.map +1 -0
  186. package/dist/unstable/features/InView.d.ts +5 -0
  187. package/dist/unstable/features/InView.d.ts.map +1 -0
  188. package/dist/unstable/features/InView.js +20 -0
  189. package/dist/unstable/features/InView.js.map +1 -0
  190. package/dist/unstable/features/Input.d.ts +28 -0
  191. package/dist/unstable/features/Input.d.ts.map +1 -0
  192. package/dist/unstable/features/Input.js +31 -0
  193. package/dist/unstable/features/Input.js.map +1 -0
  194. package/dist/unstable/features/Keys.d.ts +95 -0
  195. package/dist/unstable/features/Keys.d.ts.map +1 -0
  196. package/dist/unstable/features/Keys.js +44 -0
  197. package/dist/unstable/features/Keys.js.map +1 -0
  198. package/dist/unstable/features/Layout.d.ts +43 -0
  199. package/dist/unstable/features/Layout.d.ts.map +1 -0
  200. package/dist/unstable/features/Layout.js +44 -0
  201. package/dist/unstable/features/Layout.js.map +1 -0
  202. package/dist/unstable/features/Pan.d.ts +5 -0
  203. package/dist/unstable/features/Pan.d.ts.map +1 -0
  204. package/dist/unstable/features/Pan.js +20 -0
  205. package/dist/unstable/features/Pan.js.map +1 -0
  206. package/dist/unstable/features/Press.d.ts +13 -0
  207. package/dist/unstable/features/Press.d.ts.map +1 -0
  208. package/dist/unstable/features/Press.js +10 -0
  209. package/dist/unstable/features/Press.js.map +1 -0
  210. package/dist/unstable/features/Scroll.d.ts +20 -0
  211. package/dist/unstable/features/Scroll.d.ts.map +1 -0
  212. package/dist/unstable/features/Scroll.js +34 -0
  213. package/dist/unstable/features/Scroll.js.map +1 -0
  214. package/dist/unstable/features/TimelineKeys.d.ts +7 -0
  215. package/dist/unstable/features/TimelineKeys.d.ts.map +1 -0
  216. package/dist/unstable/features/TimelineKeys.js +103 -0
  217. package/dist/unstable/features/TimelineKeys.js.map +1 -0
  218. package/package.json +4 -3
  219. package/src/Appear.ts +4 -2
  220. package/src/DomProjectionSystem.ts +3 -3
  221. package/src/FlushGate.ts +15 -12
  222. package/src/ReorderController.ts +3 -3
  223. package/src/Report.ts +3 -7
  224. package/src/Style.ts +4 -1
  225. package/src/TimelineValue.ts +19 -0
  226. package/src/index.ts +15 -5
  227. package/src/internal/appear.ts +20 -8
  228. package/src/internal/batch-handoff.ts +75 -0
  229. package/src/internal/drag-defaults.ts +4 -4
  230. package/src/internal/gate-environment.ts +21 -0
  231. package/src/internal/projection.ts +22 -21
  232. package/src/internal/renderer.ts +22 -0
  233. package/src/internal/reorder.ts +4 -4
  234. package/src/internal/scroll.ts +32 -15
  235. package/src/internal/starting-style.ts +5 -204
  236. package/src/internal/timeline.ts +480 -0
  237. package/src/unstable/AppearAnimations.ts +837 -0
  238. package/src/unstable/BatchMembers.ts +3085 -0
  239. package/src/unstable/DomValues.ts +53 -0
  240. package/src/unstable/DragConstraints.ts +107 -0
  241. package/src/unstable/DragControls.ts +98 -0
  242. package/src/unstable/DragDefaults.ts +57 -0
  243. package/src/unstable/DragTrack.ts +959 -0
  244. package/src/unstable/DragTransition.ts +46 -0
  245. package/src/unstable/ElementSetup.ts +411 -0
  246. package/src/unstable/Feature.ts +494 -0
  247. package/src/unstable/GestureFeatures.ts +38 -0
  248. package/src/unstable/GestureInfo.ts +85 -0
  249. package/src/unstable/Imperative.ts +1037 -0
  250. package/src/unstable/Instant.ts +93 -0
  251. package/src/unstable/LayoutGroup.ts +36 -0
  252. package/src/unstable/LayoutMember.ts +319 -0
  253. package/src/unstable/LiveStyle.ts +497 -0
  254. package/src/unstable/MemberHold.ts +211 -0
  255. package/src/unstable/OwnerScope.ts +35 -0
  256. package/src/unstable/PresenceController.ts +1747 -0
  257. package/src/unstable/Press.ts +43 -0
  258. package/src/unstable/ServerInterpolators.ts +39 -0
  259. package/src/unstable/WardConfig.ts +704 -0
  260. package/src/unstable/features/All.ts +39 -0
  261. package/src/unstable/features/Colors.ts +40 -0
  262. package/src/unstable/features/DomAnimation.ts +19 -0
  263. package/src/unstable/features/DomMax.ts +14 -0
  264. package/src/unstable/features/Drag.ts +34 -0
  265. package/src/unstable/features/Focus.ts +21 -0
  266. package/src/unstable/features/Hover.ts +21 -0
  267. package/src/unstable/features/InView.ts +21 -0
  268. package/src/unstable/features/Input.ts +37 -0
  269. package/src/unstable/features/Keys.ts +124 -0
  270. package/src/unstable/features/Layout.ts +75 -0
  271. package/src/unstable/features/Pan.ts +21 -0
  272. package/src/unstable/features/Press.ts +21 -0
  273. package/src/unstable/features/Scroll.ts +35 -0
  274. package/src/unstable/features/TimelineKeys.ts +115 -0
  275. package/dist/internal/gate.d.ts +0 -188
  276. package/dist/internal/gate.d.ts.map +0 -1
  277. package/dist/internal/gate.js +0 -458
  278. package/dist/internal/gate.js.map +0 -1
  279. package/dist/internal/report.d.ts +0 -30
  280. package/dist/internal/report.d.ts.map +0 -1
  281. package/dist/internal/report.js +0 -60
  282. package/dist/internal/report.js.map +0 -1
  283. package/dist/internal/runner.d.ts +0 -21
  284. package/dist/internal/runner.d.ts.map +0 -1
  285. package/dist/internal/runner.js +0 -48
  286. package/dist/internal/runner.js.map +0 -1
  287. package/src/internal/gate.ts +0 -598
  288. package/src/internal/report.ts +0 -69
  289. package/src/internal/runner.ts +0 -64
@@ -0,0 +1,704 @@
1
+ /**
2
+ * The DOM's configuration types: what an element's `initial`, `animate`, `transition`, variants,
3
+ * gestures, drag and layout props take, for every binding over the DOM. CSS properties come from
4
+ * `csstype`, as Solid's own `JSX.CSSProperties` do. It fills core's `ValueKeys` with the DOM's keys,
5
+ * so core's config types (`WardicTransition`, `WardicVariant`, …) are typed by them, and re-exports
6
+ * them.
7
+ *
8
+ * Unstable, for Wardic's own packages: public, with no semver promise.
9
+ *
10
+ * @module
11
+ */
12
+ // Unstable: ADR-0071, decision 5. #672 (the build grill's Q24 A): solid's `config.ts`, its DOM half;
13
+ // its other half is core's `unstable/Config`. Solid's `config.ts` re-exports this, so its public types
14
+ // don't change.
15
+ import type * as Box from "@wardic/core/Box"
16
+ import type * as Config from "@wardic/core/unstable/Config"
17
+ import type * as CSS from "csstype"
18
+ import type * as DomRenderer from "../DomRenderer.ts"
19
+ import type * as ProjectionSystem from "../ProjectionSystem.ts"
20
+ import type { WardicDragConstraints, WardicMeasureDragConstraints } from "./DragConstraints.ts"
21
+ import type { WardicDragControls } from "./DragControls.ts"
22
+ import type * as Feature from "./Feature.ts"
23
+ import type { WardicDragInfo, WardicPointInfo, WardicPressEvent, WardicPressInfo } from "./GestureInfo.ts"
24
+
25
+ /** What "in view" means: an element's `viewport`, and `createInView`'s. Motion's `viewport` and `useInView` options. */
26
+ // #273, ADR-0047.
27
+ export interface WardicViewport {
28
+ /** Stays in view after its first entry. */
29
+ readonly once?: boolean
30
+ /** Grown around the root, as CSS `rootMargin`: `"0px 0px -100px 0px"` counts it in 100 px later at the bottom. */
31
+ readonly margin?: string
32
+ /** How much of the element must show: `"some"` (the default), `"all"`, or 0 to 1. */
33
+ readonly amount?: "some" | "all" | number
34
+ /** The scrolling container it's in view of, as an accessor; the window if none. Read as it starts watching. */
35
+ readonly root?: () => Element | undefined
36
+ }
37
+
38
+ /** CSS properties as Solid types them: `csstype`'s hyphenated set, and custom properties. */
39
+ export interface CSSProperties extends CSS.PropertiesHyphen {
40
+ [key: `-${string}`]: string | number | undefined
41
+ }
42
+
43
+ /**
44
+ * The transform-shorthand keys the `@wardic/dom` renderer's `TRANSFORM_KEYS`
45
+ * groups into a single `transform` string (see `renderer.ts`). They are NOT
46
+ * valid {@link CSSProperties} keys (`x`, `scale`, `rotate`, …), so they are added
47
+ * here as an intersection on top of {@link CSSProperties}. Each is
48
+ * `number | string` (a bare number gets the renderer's default unit; a string
49
+ * is used verbatim).
50
+ */
51
+ export interface WardicTransformShorthands {
52
+ readonly x?: number | string
53
+ readonly y?: number | string
54
+ readonly z?: number | string
55
+ readonly translateX?: number | string
56
+ readonly translateY?: number | string
57
+ readonly translateZ?: number | string
58
+ readonly scale?: number | string
59
+ readonly scaleX?: number | string
60
+ readonly scaleY?: number | string
61
+ readonly rotate?: number | string
62
+ readonly rotateX?: number | string
63
+ readonly rotateY?: number | string
64
+ readonly rotateZ?: number | string
65
+ readonly skewX?: number | string
66
+ readonly skewY?: number | string
67
+ }
68
+
69
+ /**
70
+ * Animatable SVG attributes (ADR-0014) the DOM applier routes via `setAttribute`.
71
+ * These are the SVG keys NOT already typed by {@link CSSProperties}, plus the
72
+ * geometry keys (`cx`/`cy`/`r`/`rx`/`ry`) re-typed `number | string` (csstype's
73
+ * CSS-Geometry types are narrower). `fill`/`stroke`/`stroke-*` stay as
74
+ * {@link CSSProperties} provides (color/length strings — already animatable). The
75
+ * runtime accepts any key regardless; this is purely DX typing.
76
+ */
77
+ export interface WardicSvgAttributes {
78
+ readonly cx?: number | string
79
+ readonly cy?: number | string
80
+ readonly r?: number | string
81
+ readonly rx?: number | string
82
+ readonly ry?: number | string
83
+ readonly x1?: number | string
84
+ readonly y1?: number | string
85
+ readonly x2?: number | string
86
+ readonly y2?: number | string
87
+ /** Motion's line-draw feature: portion (0–1) of the path stroked → `stroke-dasharray`. */
88
+ readonly pathLength?: number
89
+ readonly pathSpacing?: number
90
+ readonly pathOffset?: number
91
+ /** Set the SVG `x`/`y`/`scale` ATTRIBUTE explicitly (Wardic's `x`/`y` are transform shorthands). */
92
+ readonly attrX?: number | string
93
+ readonly attrY?: number | string
94
+ readonly attrScale?: number | string
95
+ }
96
+
97
+ /**
98
+ * The DOM's value type: every {@link CSSProperties} key PLUS the transform shorthands and the
99
+ * {@link WardicSvgAttributes} the renderer understands. This is the type users write at the edge
100
+ * (`animate={{ opacity: 1, x: 100, cx: 50 }}`), and the keys that fill core's `ValueKeys`. A binding
101
+ * funnels it through `Stops.toValues` before core's engine, whose values are a plain
102
+ * `Values.Values` (`Record<string, number | string>`).
103
+ *
104
+ * Some shorthand / geometry keys (`x`, `scale`, `cx`, `r`, …) ALSO exist on
105
+ * `csstype`'s property set with much narrower value types (e.g. `scale: "none" |
106
+ * string`). A plain intersection would narrow those to the (often `never`-like)
107
+ * overlap and reject `scale: 1.1`. So we `Omit` those keys off {@link CSSProperties}
108
+ * first, letting the `number | string` typing here win for them.
109
+ */
110
+ export type WardicValues =
111
+ & Omit<CSSProperties, keyof WardicTransformShorthands | keyof WardicSvgAttributes | DomRenderer.LengthKey>
112
+ & WardicLengths
113
+ & WardicTransformShorthands
114
+ & WardicSvgAttributes
115
+
116
+ /**
117
+ * The CSS lengths a value takes a bare number on, drawn in `px` (#522, Motion's `animate={{ height: 200 }}`):
118
+ * the DOM renderer's `LENGTH_KEYS`, so a number typechecks only where it's drawn as a length. Every
119
+ * other length takes `csstype`'s value, `0` or a string. `style` keeps Solid's own types: Solid writes a
120
+ * number there as it is.
121
+ */
122
+ export type WardicLengths = { readonly [K in DomRenderer.LengthKey]?: number | CSSProperties[K] }
123
+
124
+ /** The DOM's keys and their values fill core's {@link Config.ValueKeys}, typing every config type built on it. */
125
+ // #672 (Q24 A): solid's `declare module "solid-js"` for its directives is the precedent.
126
+ declare module "@wardic/core/unstable/Config" {
127
+ interface ValueKeys extends WardicValues {}
128
+ }
129
+
130
+ // Core's config types, as they are, and the controls' mark.
131
+ export type {
132
+ WardicKeyframes,
133
+ WardicStagger,
134
+ WardicPath,
135
+ WardicOrchestration,
136
+ WardicReducedMotion,
137
+ WardicInertia,
138
+ WardicSkipAnimations,
139
+ WardicTransitionPath,
140
+ WardicTransitionWith,
141
+ WardicValueTransition,
142
+ WardicInherit,
143
+ WardicTransitionEntries,
144
+ WardicValueEntries,
145
+ WardicVariantTransition,
146
+ WardicVariantLabels,
147
+ WardicVariantResolver,
148
+ WardicVariants,
149
+ WardicControlsDefinition,
150
+ WardicAnimationControls,
151
+ WardicAnimationDefinition,
152
+ SpineConfig,
153
+ } from "@wardic/core/unstable/Config"
154
+ export { CONTROLS } from "@wardic/core/unstable/Config"
155
+
156
+ /**
157
+ * A target's values: {@link WardicValues}, each a value or its {@link WardicKeyframes}. Every
158
+ * target takes them (`animate`, `exit`, each `while*`, a variant); `initial` reads one at its first
159
+ * stop. `style` and a Transition end take one value, as does CSS's own `transition` string.
160
+ */
161
+ export type WardicTargetValues = Config.WardicTargetValues
162
+
163
+ /**
164
+ * How an element gets to its target: a spring, a tween, or an inertia, with a value's own transition
165
+ * under its name. With no `type`, a spring field (`stiffness`, `damping`, `mass`, `velocity`,
166
+ * `restDelta`, `restSpeed`, `bounce`, `visualDuration`) makes it a spring, and anything else a tween, so
167
+ * `{ duration: 0.5 }` is a 0.5 s tween. A spring's missing fields are Motion's 100 / 10 / 1, or set by
168
+ * time, a `duration` or `visualDuration` with a `bounce`; a tween's easing is `easeOut`. With neither,
169
+ * each value runs on its default. It also takes `delay`, a tween's repeats, a `path`, its variant
170
+ * children's orchestration, `respectReducedMotion` and `skipAnimations`.
171
+ *
172
+ * @example
173
+ * <w.div animate={{ x: 100, opacity: 1 }} transition={{ type: "spring", bounce: 0.2, opacity: { duration: 0.2 } }} />
174
+ * @see https://wardic.dev/reference/solid/transitions/transition
175
+ */
176
+ export type WardicTransition = Config.WardicTransition
177
+
178
+ /** The name of a value a transition can have an entry for: a style, a transform shorthand, an SVG attribute. */
179
+ export type WardicValueKey = Config.WardicValueKey
180
+
181
+ /**
182
+ * A target's **Transition end** (Motion's `transitionEnd`): values set at once, with no
183
+ * animation, once the keys the target animates have landed, `{ opacity: 0, transitionEnd: { display:
184
+ * "none" } }`. Its keys are the target's, so they return to their base when it's no longer active;
185
+ * a target interrupted before it lands never sets them; the target an element renders first sets its
186
+ * own at once, on a server too.
187
+ */
188
+ export type WardicTransitionEnd = Config.WardicTransitionEnd
189
+
190
+ /**
191
+ * A target, as a variant, `animate` or `exit` gives it (Motion's `TargetAndTransition`): its
192
+ * values, each a value or its Keyframes ({@link WardicTargetValues}), optionally the transition
193
+ * the animation to it runs on, as an object, and its Transition end ({@link WardicTransitionEnd}).
194
+ * A plain {@link WardicValues} map fits too, its CSS `transition` string a value as any other.
195
+ */
196
+ export type WardicVariant = Config.WardicVariant
197
+
198
+ /**
199
+ * A point mapping (Motion's `TransformPoint`): handed a point in the viewport's coordinates, it
200
+ * gives the one a drag or a pan uses: `WardicConfig`'s `transformPagePoint`.
201
+ */
202
+ export type WardicTransformPoint = Config.WardicTransformPoint
203
+
204
+ /**
205
+ * A drag's release, Motion's `dragTransition`: the inertia every
206
+ * release runs on, a Fling, a snap back to the origin, and a layout node's Release offset. A glide
207
+ * toward `power` × the release velocity that eases out over `timeConstant`, springing back on the
208
+ * bounce at an edge it would cross. Motion's names and units: `timeConstant` in milliseconds. The
209
+ * edges are `dragConstraints`, both at the origin with `dragSnapToOrigin`, or the slot for a layout
210
+ * node. A release never borrows the element's `transition`.
211
+ */
212
+ export interface WardicDragTransition {
213
+ /** How far a release glides, as a multiple of its velocity. Default 0.8. */
214
+ readonly power?: number
215
+ /** The glide's time constant, in milliseconds. Default 750. */
216
+ readonly timeConstant?: number
217
+ /** The bounce at an edge: 200 / 40 by default, a wall (1e6 / 1e7) with `dragElastic={0}`. */
218
+ readonly bounceStiffness?: number
219
+ readonly bounceDamping?: number
220
+ /** At rest within this many px of where it's going. Default 1. */
221
+ readonly restDelta?: number
222
+ /** At an edge, at rest below this speed, px/s. Default 10. */
223
+ readonly restSpeed?: number
224
+ /** Moves where a release rests, called per axis with where it would: snapping it to a grid, say. */
225
+ readonly modifyTarget?: (ideal: number) => number
226
+ }
227
+
228
+ /**
229
+ * Config accepted by {@link createWard}.
230
+ *
231
+ * REACTIVITY LAYERING (step 21e): every field here is a STATIC value. A Ward's
232
+ * reactivity is solely via the WHOLE-CONFIG accessor: `createWard(() => ({ ... }))`
233
+ * re-reads the config when a signal it touches changes, recomputing `target()`
234
+ * and driving a Retarget. Per-field accessor unwrapping is the COMPONENT layer's
235
+ * job ({@link "./wardic.tsx"} `MotionProps`), not `createWard`'s — at its
236
+ * boundary a config field is always a plain value.
237
+ */
238
+ /**
239
+ * Which of an element's gestures reach its pressable ancestors (Motion's `PropagateOptions`): only
240
+ * `tap` so far. `false` stops it; left out or `true`, it propagates.
241
+ */
242
+ export interface WardicPropagate {
243
+ readonly tap?: boolean
244
+ }
245
+
246
+ /**
247
+ * An app's scale corrector (Motion's `addScaleCorrector` entry), given to `WardicProvider`'s
248
+ * `scaleCorrectors` by the value key it corrects: `correct(latest, { target, treeScale, projectionDelta })`
249
+ * turns the element's value into the one to write while a layout animation scales it (`target` the
250
+ * box it's drawn into, `treeScale` its ancestors' scale, `projectionDelta` its delta, Motion's
251
+ * shapes), written under `applyTo`'s keys when given, else its own. `latest` is the element's own
252
+ * value for the key (from its `style` or an animation), else its Own value at its first measure.
253
+ */
254
+ export type WardicScaleCorrector = ProjectionSystem.ScaleCorrector
255
+
256
+ /** A layout box (Motion's `Box`): each axis's `min` and `max`, in the page's pixels. */
257
+ export type WardicLayoutBox = Box.Box
258
+
259
+ /**
260
+ * A **Transform template** (Motion's `transformTemplate`): `(values, generated) => transform`.
261
+ *
262
+ * - **At rest and animating:** `values` holds the element's transform keys in their units, as
263
+ * Motion's do (`x: "10px"`, `rotate: "45deg"`, `scale: 1.5`), and `generated` is the transform
264
+ * Wardic would draw, `""` when every key is at its identity. It's called with no transform key too.
265
+ * - **While a layout animation moves it:** `values` holds every value as it is (`x: 10`), and
266
+ * `generated` is the projection's transform. Once the flight lands, it's called as at rest.
267
+ * - **Held for a Measure pass:** every value as it is, and `""`.
268
+ */
269
+ export type WardicTransformTemplate = DomRenderer.TransformTemplate
270
+
271
+ /** The motion props every element takes, whatever its Features: {@link WardConfig}'s base group (#516). */
272
+ export interface WardBaseConfig {
273
+ /**
274
+ * Where the element starts: values, a `variants` name, or `false` to start at `animate`, so nothing
275
+ * animates as it mounts. On a server-rendered page, the element arrives in the HTML at `initial`.
276
+ *
277
+ * @example <w.div initial={{ opacity: 0, y: 12 }} />
278
+ */
279
+ // Read once per mount (untracked), so a later change doesn't re-seed; read again on every mount,
280
+ // an AnimatePresence re-entry included. `false` resolves `animate` once: its map, its variants
281
+ // entry, or a Variant child's inherited name (#134). A key started at returns to its `style`
282
+ // value, else where it started (ADR-0022).
283
+ readonly initial?: WardicVariant | Config.WardicVariantLabels | false
284
+ /**
285
+ * Where the element animates to: values or a `variants` name. Change it, and the element animates
286
+ * from wherever it is to the new target. Or animation controls from `createAnimationControls()`,
287
+ * which set the target when you call `start` or `set`.
288
+ *
289
+ * @example <w.div animate={{ opacity: open() ? 1 : 0 }} />
290
+ */
291
+ // Read reactively through the whole-config accessor; its own `transition` drives it (#277). Controls
292
+ // are read once (#433).
293
+ readonly animate?: WardicVariant | Config.WardicVariantLabels | Config.WardicAnimationControls
294
+ /**
295
+ * Named targets that `initial`, `animate`, `exit` and the `while*` props can name instead of giving
296
+ * values. A variant can carry its own `transition`, or be a function of `custom`. Children with
297
+ * `variants` follow their parent's names, staggered by its `transition`.
298
+ *
299
+ * @example <w.div variants={{ hidden: { opacity: 0 }, shown: { opacity: 1 } }} />
300
+ */
301
+ // Dynamic variants: #277. Orchestration: ADR-0007.
302
+ readonly variants?: Config.WardicVariants
303
+ /**
304
+ * The value passed to this element's function variants. When it changes, they're resolved again,
305
+ * and the element animates to what they give. A leaving element uses `<AnimatePresence custom>`
306
+ * instead, if given.
307
+ */
308
+ // #277, ADR-0048: a leaver's own `custom` can't change any more.
309
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
310
+ readonly custom?: any
311
+ /**
312
+ * Which child of an `<AnimatePresence>` this is, as React's `key` tells Motion. A child that comes
313
+ * back while one with its key is still leaving takes over from it, starting where it's drawn. Only
314
+ * on the presence's child itself; never written to the page.
315
+ */
316
+ // #286, ADR-0048. Read once.
317
+ readonly key?: string | number
318
+ /**
319
+ * `false` keeps an element with `variants` out of its parent's: it doesn't follow its names or take
320
+ * part in its stagger, and passes none of them on to its own children.
321
+ */
322
+ // #50. By default a Variant child (variants, no initial/animate name of its own) joins its nearest
323
+ // ancestor with variants (CONTEXT.md).
324
+ readonly inherit?: boolean
325
+ /**
326
+ * How the element moves to a target: a spring (`stiffness`, `damping`, `mass`, or `duration` and
327
+ * `bounce`), a tween (`duration`, `ease`), keyframes' `times`, or `inertia`, with `delay`, `repeat`
328
+ * and, for variants, `staggerChildren` and `when`. A value's own (`opacity: {…}`) or `layout`'s apply
329
+ * to it alone. Without one, each value gets Motion's default.
330
+ *
331
+ * @example <w.div transition={{ type: "spring", stiffness: 300, damping: 20 }} />
332
+ * @see https://wardic.dev/guides/transitions
333
+ */
334
+ // Per-value entries: ADR-0049. Default transitions: ADR-0051.
335
+ readonly transition?: WardicTransition
336
+ /**
337
+ * Where the element animates as it leaves an `<AnimatePresence>`: values or a `variants` name. The
338
+ * element stays on the page until it has played.
339
+ *
340
+ * @example <w.div exit={{ opacity: 0, scale: 0.9 }} />
341
+ */
342
+ // ADR-0007: the child doesn't drive it (it's disposed); its spine publishes the exit into the
343
+ // presence registration, and the presence runs it on the retained node. A dynamic variant resolves
344
+ // as it leaves (#277); its own transition, else the element's.
345
+ readonly exit?: WardicVariant | Config.WardicVariantLabels
346
+ /**
347
+ * Called when an animation of the element starts, with what it animates to: the variant name, or
348
+ * the values. Not for a layout animation, which has its own. Solid 1's.
349
+ */
350
+ // #257: at each Retarget that starts one (animate, its variant, a gesture layer turning on or off).
351
+ // Not for a same-target change, a drag's momentum or return. Read at that Retarget.
352
+ readonly onAnimationStart?: (definition: Config.WardicAnimationDefinition) => void
353
+ /**
354
+ * Called when that animation lands, with the same definition, once every value it moves has
355
+ * settled. Not for one interrupted by a new target. Solid 1; on Solid 2, the element's ward gives
356
+ * `next("settled")`.
357
+ */
358
+ // #257. Read at the Retarget that started it.
359
+ readonly onAnimationComplete?: (definition: Config.WardicAnimationDefinition) => void
360
+ /**
361
+ * Called once a frame in which the element's values changed, with every value it holds (`x` as a
362
+ * number). The object is reused: read it during the call, or copy it. For one value, `ward.read(key)`
363
+ * on Solid 2, or `ward.value(key)` on Solid 1, costs less.
364
+ */
365
+ // #233. After that frame's commits, before it's drawn. Whether it reports is read once at mount; the
366
+ // function at each call. A signal it sets paints in the next frame.
367
+ readonly onUpdate?: (latest: Readonly<Record<string, number | string>>) => void
368
+ /**
369
+ * Builds the element's whole `transform` from its values and the one Wardic would draw, wherever
370
+ * it's drawn: at rest, animating, on the server and during a layout animation.
371
+ *
372
+ * @example <w.div transformTemplate={(_, generated) => `translate(-50%, -50%) ${generated}`} />
373
+ */
374
+ // #443, a Transform template. See WardicTransformTemplate for what it's handed. Whether it has one is
375
+ // read at mount; the function each frame.
376
+ readonly transformTemplate?: WardicTransformTemplate
377
+ /**
378
+ * `false`: on a server-rendered page, this element's entrance waits for the JavaScript instead of
379
+ * playing from the first paint. The provider's `appear` sets it for every element.
380
+ *
381
+ * @see https://wardic.dev/guides/server-rendering
382
+ */
383
+ // #48, ADR-0044. Read on the server, once.
384
+ readonly appear?: boolean
385
+ }
386
+
387
+ /** The motion props the `hover` Feature reads: {@link WardConfig}'s `hover` group (#516). */
388
+ export interface WardHoverConfig {
389
+ /**
390
+ * Where the element animates while the pointer is over it, and back when it leaves: values or a
391
+ * `variants` name, which children with `variants` follow too. Needs the `hover` Feature.
392
+ *
393
+ * @example <w.div whileHover={{ scale: 1.05 }} />
394
+ */
395
+ // Priority: under whileTap and whileDrag, over whileFocus and whileInView. Names reach Variant
396
+ // children (#291).
397
+ readonly whileHover?: WardicVariant | Config.WardicVariantLabels
398
+ // Motion's gesture callbacks (#273, ADR-0047): `(event, info)`, the DOM's PointerEvent first, called
399
+ // at the event, `info.point` in the viewport (not Motion's page). A hover's or a tap's starts its
400
+ // recognizer, as a while* does, set at mount or later. Solid 1's: Solid 2 hears the same through
401
+ // next(name). One that throws is reported, and the gesture goes on.
402
+ /** Called when the pointer comes over the element (a touch never hovers). Solid 1; Solid 2's ward gives `"hoverStart"`. */
403
+ readonly onHoverStart?: (event: PointerEvent, info: WardicPointInfo) => void
404
+ /** Called when the pointer leaves the element. Solid 1; Solid 2's ward gives `"hoverEnd"`. */
405
+ readonly onHoverEnd?: (event: PointerEvent, info: WardicPointInfo) => void
406
+ }
407
+
408
+ /** The motion props the `press` Feature reads: {@link WardConfig}'s `press` group (#516). */
409
+ export interface WardPressConfig {
410
+ /**
411
+ * Where the element animates while it's pressed, by a pointer or by Enter or Space while it has
412
+ * focus. Needs the `press` Feature.
413
+ *
414
+ * @example <w.div whileTap={{ scale: 0.95 }} />
415
+ */
416
+ // Highest priority with whileDrag. Keyboard presses: #427.
417
+ readonly whileTap?: WardicVariant | Config.WardicVariantLabels
418
+ /**
419
+ * Whether a press on this element also counts as a press of its ancestors. `{ tap: false }` keeps
420
+ * it to this element: a pressable parent doesn't play its `whileTap` or hear the tap.
421
+ */
422
+ // #439, ADR-0066: a Press claim on the pointer down or key. Read at each press's start. Only an
423
+ // element with a press claims; drags hold their own Drag claim.
424
+ readonly propagate?: WardicPropagate
425
+ /**
426
+ * Called when a press begins on the element: a pointer going down, or Enter or Space while it has
427
+ * focus (`info.input` says which). Solid 1; Solid 2's ward gives `"pressStart"`.
428
+ */
429
+ // Keyboard presses: #427.
430
+ readonly onTapStart?: (event: WardicPressEvent, info: WardicPressInfo) => void
431
+ /** Called when that press ends on the element: a release on it, or its key coming up. Solid 1; Solid 2's ward gives `"tap"`. */
432
+ readonly onTap?: (event: WardicPressEvent, info: WardicPressInfo) => void
433
+ /**
434
+ * Called when that press ends anywhere else, or is cancelled. A press a drag took over is neither a
435
+ * tap nor a cancel. Solid 1; Solid 2's ward gives `"tapCancel"`.
436
+ */
437
+ readonly onTapCancel?: (event: WardicPressEvent, info: WardicPressInfo) => void
438
+ }
439
+
440
+ /** The motion props the `focus` Feature reads: {@link WardConfig}'s `focus` group (#516). */
441
+ export interface WardFocusConfig {
442
+ /**
443
+ * Where the element animates while it has the keyboard's focus (as `:focus-visible` shows it, not
444
+ * a click's). Needs the `focus` Feature.
445
+ */
446
+ // #273. Under the pointer gestures, over whileInView.
447
+ readonly whileFocus?: WardicVariant | Config.WardicVariantLabels
448
+ }
449
+
450
+ /** The motion props the `inView` Feature reads: {@link WardConfig}'s `inView` group (#516). */
451
+ export interface WardInViewConfig {
452
+ /**
453
+ * Where the element animates while it's in view, as `viewport` defines it. Needs the `inView`
454
+ * Feature.
455
+ *
456
+ * @example <w.div whileInView={{ opacity: 1 }} viewport={{ once: true }} />
457
+ */
458
+ // #273, ADR-0047. Under whileFocus and the pointer gestures.
459
+ readonly whileInView?: WardicVariant | Config.WardicVariantLabels
460
+ /**
461
+ * What "in view" means for `whileInView` and the viewport callbacks: `root`, a scrolling container
462
+ * (the window if none); `margin`, grown around it, as CSS `rootMargin`; `amount` of the element that
463
+ * must show, `"some"`, `"all"` or 0 to 1; and `once`, to stay in view after the first entry.
464
+ */
465
+ // #273. Read when the recognizer starts.
466
+ readonly viewport?: WardicViewport
467
+ /** Called when the element comes into view, as `viewport` defines it, with the browser's `IntersectionObserverEntry`. Solid 1; Solid 2's ward gives `"viewportEnter"`. */
468
+ readonly onViewportEnter?: (entry: IntersectionObserverEntry) => void
469
+ /** Called when the element leaves the view. With `viewport.once`, never after the first entry. Solid 1; Solid 2's ward gives `"viewportLeave"`. */
470
+ readonly onViewportLeave?: (entry: IntersectionObserverEntry) => void
471
+ }
472
+
473
+ /** The motion props the `pan` Feature reads: {@link WardConfig}'s `pan` group (#516). */
474
+ export interface WardPanConfig {
475
+ /**
476
+ * Called when a pointer goes down on the element, ready to pan. A pan moves nothing itself: read
477
+ * its offset and velocity in `onPan`. On a touch screen, give the element a `touch-action`, such as
478
+ * `pan-y` for a sideways pan, or the page's scroll takes the gesture. Solid 1; Solid 2's ward gives
479
+ * `"panSessionStart"`.
480
+ */
481
+ // Once started, a pan counts as a drag for the element's press and hover: a press it took over is
482
+ // neither a tap nor a cancel (ADR-0047).
483
+ readonly onPanSessionStart?: (event: PointerEvent, info: WardicPointInfo) => void
484
+ /** Called when a pan starts, past its threshold. Solid 1; Solid 2's ward gives `"panStart"`. */
485
+ readonly onPanStart?: (event: PointerEvent, info: WardicDragInfo) => void
486
+ /** Called as the pan moves: at its start, and each move after. Solid 1; Solid 2's ward gives `"pan"`. */
487
+ readonly onPan?: (event: PointerEvent, info: WardicDragInfo) => void
488
+ /** Called when a pan that started ends, or is cancelled. Solid 1; Solid 2's ward gives `"panEnd"`. */
489
+ readonly onPanEnd?: (event: PointerEvent, info: WardicDragInfo) => void
490
+ }
491
+
492
+ /** The motion props the `drag` Feature reads: {@link WardConfig}'s `drag` group (#516). */
493
+ export interface WardDragConfig {
494
+ /**
495
+ * Makes the element draggable: `true` on both axes, `"x"` or `"y"` on one. On release it carries on
496
+ * at the speed it was let go, a Fling, and slows to a stop. Needs the `drag` Feature.
497
+ *
498
+ * The element gets `touch-action`, `user-select: none` and `draggable="false"`, so a touch drag
499
+ * isn't a scroll; its own `style` can override them. Of nested draggables, the innermost drags. With
500
+ * `layout`, the element moves within its layout and returns to its place on release.
501
+ *
502
+ * @example <w.div drag="x" dragConstraints={{ left: 0, right: 200 }} />
503
+ */
504
+ // ADR-0004: the pointer direct-sets x/y while the spine drives the rest and whileDrag. The drag
505
+ // config (this and dragConstraints … dragPropagation) is read once at mount; only whileDrag is
506
+ // reactive. Defaults: ADR-0019 Amendment (Reorder). Nested drags: Drag claims, ADR-0019 Amendment
507
+ // (#29). With layout/layoutId it feeds the projection (ADR-0016). Lists: <Reorder> (ADR-0020).
508
+ readonly drag?: boolean | "x" | "y"
509
+ /**
510
+ * Where the element animates while it's dragged, and back once it's let go.
511
+ *
512
+ * @example <w.div whileDrag={{ scale: 1.1 }} />
513
+ */
514
+ // Driven by the spring, not stripped; only read when `drag` is on.
515
+ readonly whileDrag?: WardicVariant | Config.WardicVariantLabels
516
+ /**
517
+ * Keeps the element within bounds: `{ top, left, right, bottom }` in pixels from where it started
518
+ * (an edge left out is unbounded), or a container element, given as an accessor, that it stays
519
+ * inside. A Fling past an edge springs back to it.
520
+ *
521
+ * @example <w.div dragConstraints={() => frame} />
522
+ */
523
+ // ADR-0016 Amendment (#140): x/y whichever gesture moved them. A container is measured at each drag's
524
+ // start and when either resizes (#273). Read once at mount; an accessor at each measure.
525
+ readonly dragConstraints?: WardicDragConstraints
526
+ /**
527
+ * How far the element can be pulled past `dragConstraints`, 0 to 1: 0 stops it at the edge.
528
+ * Default `0.35`, Motion's.
529
+ */
530
+ // Read once at mount.
531
+ readonly dragElastic?: number
532
+ /**
533
+ * With a container in `dragConstraints`: called with the bounds measured against it, at each
534
+ * measure. Return other bounds to use them instead, such as with a margin, or nothing to keep these.
535
+ */
536
+ // #273, ADR-0047.
537
+ readonly onMeasureDragConstraints?: WardicMeasureDragConstraints
538
+ /** `false` stops the element where it's let go, instead of carrying on at the speed it was let go. Default `true`. */
539
+ // Read once at mount.
540
+ readonly dragMomentum?: boolean
541
+ /** Springs the element back to where it started when it's let go. */
542
+ // On dragTransition. Read once at mount.
543
+ readonly dragSnapToOrigin?: boolean
544
+ /**
545
+ * How the element carries on after it's let go: Motion's inertia options (`power`, `timeConstant`,
546
+ * `bounceStiffness`, `bounceDamping`, `min`, `max`…), over Motion's defaults.
547
+ */
548
+ // ADR-0016 Amendment (#140). Read once at mount.
549
+ readonly dragTransition?: WardicDragTransition
550
+ /** `true` lets a draggable ancestor drag along with this element, instead of only the innermost dragging. */
551
+ // ADR-0019 Amendment (#29): takes no Drag claim and is never refused one; still keeps hovers and
552
+ // presses from starting while it runs. Read once at mount.
553
+ readonly dragPropagation?: boolean
554
+ /**
555
+ * Waits until a drag has moved 10 px, then keeps it to the axis it moved on. A sideways swipe inside
556
+ * a sheet you drag down swipes, and a downward one drags the sheet. `onDirectionLock` says which.
557
+ */
558
+ // #273, ADR-0047: y checked first; claims only the locked axis; onDragStart/whileDrag come at the
559
+ // lock, after onDirectionLock. Read once at mount.
560
+ readonly dragDirectionLock?: boolean
561
+ /**
562
+ * Drag controls from `createDragControls()`: their `start(event)` begins this element's drag from a
563
+ * press somewhere else, such as a handle.
564
+ */
565
+ // #431. Read once at mount.
566
+ readonly dragControls?: WardicDragControls
567
+ /**
568
+ * `false`: pressing the element itself doesn't drag it; only its `dragControls` do. It then gets
569
+ * none of the drag's touch and selection styles, so a list whose items drag by a handle still
570
+ * scrolls by touch. Default `true`.
571
+ */
572
+ // #431. Read once at mount.
573
+ readonly dragListener?: boolean
574
+ /** Called when a drag of the element starts. Solid 1; Solid 2's ward gives `"dragStart"`. */
575
+ readonly onDragStart?: (event: PointerEvent, info: WardicDragInfo) => void
576
+ /** Called as the drag moves: at its start, and each move after. Solid 1; Solid 2's ward gives `"drag"`. */
577
+ readonly onDrag?: (event: PointerEvent, info: WardicDragInfo) => void
578
+ /** Called when the drag is let go. Solid 1; Solid 2's ward gives `"dragEnd"`. */
579
+ readonly onDragEnd?: (event: PointerEvent, info: WardicDragInfo) => void
580
+ /** Called when the element comes to rest after it's let go. Not when a new grab stops it. Solid 1; Solid 2's ward gives `"dragTransitionEnd"`. */
581
+ readonly onDragTransitionEnd?: () => void
582
+ /** With `dragDirectionLock`: called with the axis a drag locked to, before `onDragStart`. Solid 1; Solid 2's ward gives `"directionLock"`. */
583
+ readonly onDirectionLock?: (axis: "x" | "y") => void
584
+ }
585
+
586
+ /** The motion props the `layout` Feature reads: {@link WardConfig}'s `layout` group (#516). */
587
+ export interface WardLayoutConfig {
588
+ /**
589
+ * Animates the element's layout: when its size or place on the page changes, by its own layout or
590
+ * its siblings', it moves there smoothly instead of jumping. `"position"` or `"size"` animates only
591
+ * that part, `"x"` or `"y"` one axis, and `"preserve-aspect"` its size only when the aspect ratio
592
+ * changes. Needs the `layout` Feature.
593
+ *
594
+ * @see https://wardic.dev/guides/layout
595
+ */
596
+ // ADR-0005, ADR-0009. Whether it's a layout node is read once at mount; its Layout mode (Amendment
597
+ // (#42)) at each layout animation's start. A measure re-reads the whole tree, so sibling reflow
598
+ // needs no LayoutGroup.
599
+ readonly layout?: boolean | "position" | "size" | "preserve-aspect" | "x" | "y"
600
+ /**
601
+ * A value whose change makes the element look for a layout change. In Solid nothing re-renders, so
602
+ * give it what your layout depends on, such as a signal's value; a size change is seen on its own.
603
+ *
604
+ * @example <w.div layoutDependency={open()} />
605
+ */
606
+ // Motion's prop name. Read reactively through the whole-config accessor.
607
+ readonly layoutDependency?: unknown
608
+ /**
609
+ * A shared-layout id: when an element with this id mounts as another with it leaves or hides, the
610
+ * new one animates from where the old one was, crossfading between them. Needs the `layout` Feature.
611
+ *
612
+ * @example <w.span layoutId="underline" />
613
+ */
614
+ // ADR-0005, ADR-0010. Works with no LayoutGroup (the registry is the provider's). Read once at
615
+ // mount. With drag, the drag moves the projection target (ADR-0016).
616
+ readonly layoutId?: string
617
+ /**
618
+ * Marks a scrolling element that is itself a layout element, so its descendants' layout animations
619
+ * aren't moved by its scroll. Every other scroll, `position: sticky` included, is accounted for
620
+ * without it. With no `layout` or `layoutId`, the element animates no layout of its own: it moves to a
621
+ * new place at once, as Motion's.
622
+ */
623
+ // ADR-0012 and its Amendments (Reorder, #578). Read once at mount.
624
+ readonly layoutScroll?: boolean
625
+ /**
626
+ * Makes the element a root for the layout animations inside it: it never animates its own layout,
627
+ * and its descendants' are measured against it. With `layout` too, it stays at its new place while a
628
+ * parent's layout animation runs. Alone, it moves with that animation, as Motion's.
629
+ *
630
+ * @example <w.div layout layoutRoot>...</w.div>
631
+ */
632
+ // ADR-0013: it self-snaps, bounds delta accumulation, and anchors its subtree; with no `layout` or
633
+ // `layoutId` it has Layout mode `false` and rides its ancestors (*Amendment (#691)*). Read once at mount.
634
+ readonly layoutRoot?: boolean
635
+ /**
636
+ * Where in its parent's box a layout element anchors as the parent changes size: 0 to 1 on each
637
+ * axis, top-left `{ x: 0, y: 0 }` by default. `false` measures it against the page instead.
638
+ */
639
+ // ADR-0013 relative projection. Read once at mount.
640
+ readonly layoutAnchor?: { readonly x: number; readonly y: number } | false
641
+ /**
642
+ * Whether this element crossfades with the one it takes a `layoutId` over from. Default `true`.
643
+ * `false` hides the old one as the move starts, and this one keeps its own opacity.
644
+ */
645
+ // #442, ADR-0010. Read as each handover begins; only the twin that becomes the Lead reads it.
646
+ readonly layoutCrossfade?: boolean
647
+ /**
648
+ * Called when a layout animation of the element starts moving. Not when there's nothing to move.
649
+ * Solid 1; Solid 2's ward gives `"layoutStart"`.
650
+ */
651
+ // #191, ADR-0039: at the frame of its first step, after it's painted. A restart fires it again;
652
+ // restarts in one task are one. A handover's is the new Lead's.
653
+ readonly onLayoutAnimationStart?: () => void
654
+ /**
655
+ * Called when a layout animation of the element lands. Not for one interrupted or cut short, so a
656
+ * start isn't always followed by a complete: `animateLayout`'s `onSettled` tells a change's end
657
+ * however it went. Solid 1; Solid 2's ward gives `"layoutComplete"`.
658
+ */
659
+ // #191, ADR-0039.
660
+ readonly onLayoutAnimationComplete?: () => void
661
+ /** Called as each layout measure of this layout element begins, before it's measured. */
662
+ // #443. Resize-blocked and instant measures included. A throw is reported, and the measure goes on.
663
+ readonly onBeforeLayoutMeasure?: () => void
664
+ /**
665
+ * Called with this layout element's box each time it's measured, and its box before (`undefined`
666
+ * the first time): each axis's `min` and `max` in page pixels, its transforms left out.
667
+ */
668
+ // #443: after the read, before any animation starts. A throw is reported.
669
+ readonly onLayoutMeasure?: (box: WardicLayoutBox, prev: WardicLayoutBox | undefined) => void
670
+ }
671
+
672
+ /**
673
+ * The motion props a Wardic element takes, and the config a ward is made with: what it animates,
674
+ * when, how, and what it tells you. Motion's props, by Motion's names.
675
+ *
676
+ * @see https://wardic.dev/reference/solid/elements/props
677
+ */
678
+ export interface WardConfig
679
+ extends Config.SpineConfig,
680
+ WardBaseConfig,
681
+ WardHoverConfig,
682
+ WardPressConfig,
683
+ WardFocusConfig,
684
+ WardInViewConfig,
685
+ WardPanConfig,
686
+ WardDragConfig,
687
+ WardLayoutConfig {}
688
+
689
+ /**
690
+ * Each Feature's motion props, by its name (#516, ADR-0067 *Amendment (#516)*): what a **Wardic
691
+ * instance**'s elements take for the Features it has, beside {@link WardBaseConfig}. `colors` and
692
+ * `scroll` add none. Solid 1's; Solid 2's are these without Solid 1's callbacks.
693
+ */
694
+ // #672 (the build grill's Q9): the DOM's map of each Feature that adds props, as every binding's names
695
+ // them (Feature.PropFeature).
696
+ export interface WardFeatureConfigs extends Record<Feature.PropFeature, object> {
697
+ readonly hover: WardHoverConfig
698
+ readonly press: WardPressConfig
699
+ readonly focus: WardFocusConfig
700
+ readonly inView: WardInViewConfig
701
+ readonly pan: WardPanConfig
702
+ readonly drag: WardDragConfig
703
+ readonly layout: WardLayoutConfig
704
+ }