@wardic/dom 0.0.0-stage → 1.0.0-rc.10

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 (315) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +8 -2
  3. package/THIRD_PARTY_NOTICES.md +145 -0
  4. package/dist/Appear.d.ts +30 -0
  5. package/dist/Appear.d.ts.map +1 -0
  6. package/dist/Appear.js +31 -0
  7. package/dist/Appear.js.map +1 -0
  8. package/dist/Color.d.ts +14 -0
  9. package/dist/Color.d.ts.map +1 -0
  10. package/dist/Color.js +16 -0
  11. package/dist/Color.js.map +1 -0
  12. package/dist/DomAnnouncer.d.ts +13 -0
  13. package/dist/DomAnnouncer.d.ts.map +1 -0
  14. package/dist/DomAnnouncer.js +14 -0
  15. package/dist/DomAnnouncer.js.map +1 -0
  16. package/dist/DomBatch.d.ts +20 -0
  17. package/dist/DomBatch.d.ts.map +1 -0
  18. package/dist/DomBatch.js +23 -0
  19. package/dist/DomBatch.js.map +1 -0
  20. package/dist/DomClock.d.ts +11 -0
  21. package/dist/DomClock.d.ts.map +1 -0
  22. package/dist/DomClock.js +12 -0
  23. package/dist/DomClock.js.map +1 -0
  24. package/dist/DomDefaultTransition.d.ts +12 -0
  25. package/dist/DomDefaultTransition.d.ts.map +1 -0
  26. package/dist/DomDefaultTransition.js +13 -0
  27. package/dist/DomDefaultTransition.js.map +1 -0
  28. package/dist/DomInput.d.ts +14 -0
  29. package/dist/DomInput.d.ts.map +1 -0
  30. package/dist/DomInput.js +17 -0
  31. package/dist/DomInput.js.map +1 -0
  32. package/dist/DomInterpolators.d.ts +13 -0
  33. package/dist/DomInterpolators.d.ts.map +1 -0
  34. package/dist/DomInterpolators.js +14 -0
  35. package/dist/DomInterpolators.js.map +1 -0
  36. package/dist/DomKeyRules.d.ts +13 -0
  37. package/dist/DomKeyRules.d.ts.map +1 -0
  38. package/dist/DomKeyRules.js +14 -0
  39. package/dist/DomKeyRules.js.map +1 -0
  40. package/dist/DomPositionalKeys.d.ts +13 -0
  41. package/dist/DomPositionalKeys.d.ts.map +1 -0
  42. package/dist/DomPositionalKeys.js +14 -0
  43. package/dist/DomPositionalKeys.js.map +1 -0
  44. package/dist/DomProbe.d.ts +13 -0
  45. package/dist/DomProbe.d.ts.map +1 -0
  46. package/dist/DomProbe.js +14 -0
  47. package/dist/DomProbe.js.map +1 -0
  48. package/dist/DomProjectionSystem.d.ts +28 -0
  49. package/dist/DomProjectionSystem.d.ts.map +1 -0
  50. package/dist/DomProjectionSystem.js +41 -0
  51. package/dist/DomProjectionSystem.js.map +1 -0
  52. package/dist/DomRenderer.d.ts +13 -0
  53. package/dist/DomRenderer.d.ts.map +1 -0
  54. package/dist/DomRenderer.js +15 -0
  55. package/dist/DomRenderer.js.map +1 -0
  56. package/dist/DomScrollSource.d.ts +14 -0
  57. package/dist/DomScrollSource.d.ts.map +1 -0
  58. package/dist/DomScrollSource.js +15 -0
  59. package/dist/DomScrollSource.js.map +1 -0
  60. package/dist/FlushGate.d.ts +48 -0
  61. package/dist/FlushGate.d.ts.map +1 -0
  62. package/dist/FlushGate.js +62 -0
  63. package/dist/FlushGate.js.map +1 -0
  64. package/dist/KeyboardPress.d.ts +16 -0
  65. package/dist/KeyboardPress.d.ts.map +1 -0
  66. package/dist/KeyboardPress.js +17 -0
  67. package/dist/KeyboardPress.js.map +1 -0
  68. package/dist/MeasuredPair.d.ts +14 -0
  69. package/dist/MeasuredPair.d.ts.map +1 -0
  70. package/dist/MeasuredPair.js +16 -0
  71. package/dist/MeasuredPair.js.map +1 -0
  72. package/dist/OwnValues.d.ts +14 -0
  73. package/dist/OwnValues.d.ts.map +1 -0
  74. package/dist/OwnValues.js +15 -0
  75. package/dist/OwnValues.js.map +1 -0
  76. package/dist/ProjectionSystem.d.ts +34 -0
  77. package/dist/ProjectionSystem.d.ts.map +1 -0
  78. package/dist/ProjectionSystem.js +29 -0
  79. package/dist/ProjectionSystem.js.map +1 -0
  80. package/dist/ReorderController.d.ts +61 -0
  81. package/dist/ReorderController.d.ts.map +1 -0
  82. package/dist/ReorderController.js +78 -0
  83. package/dist/ReorderController.js.map +1 -0
  84. package/dist/Report.d.ts +12 -0
  85. package/dist/Report.d.ts.map +1 -0
  86. package/dist/Report.js +13 -0
  87. package/dist/Report.js.map +1 -0
  88. package/dist/ScrollOffset.d.ts +34 -0
  89. package/dist/ScrollOffset.d.ts.map +1 -0
  90. package/dist/ScrollOffset.js +42 -0
  91. package/dist/ScrollOffset.js.map +1 -0
  92. package/dist/Style.d.ts +15 -0
  93. package/dist/Style.d.ts.map +1 -0
  94. package/dist/Style.js +17 -0
  95. package/dist/Style.js.map +1 -0
  96. package/dist/Svg.d.ts +13 -0
  97. package/dist/Svg.d.ts.map +1 -0
  98. package/dist/Svg.js +14 -0
  99. package/dist/Svg.js.map +1 -0
  100. package/dist/Variables.d.ts +13 -0
  101. package/dist/Variables.d.ts.map +1 -0
  102. package/dist/Variables.js +14 -0
  103. package/dist/Variables.js.map +1 -0
  104. package/dist/index.d.ts +83 -0
  105. package/dist/index.d.ts.map +1 -0
  106. package/dist/index.js +71 -0
  107. package/dist/index.js.map +1 -0
  108. package/dist/internal/announcer.d.ts +50 -0
  109. package/dist/internal/announcer.d.ts.map +1 -0
  110. package/dist/internal/announcer.js +115 -0
  111. package/dist/internal/announcer.js.map +1 -0
  112. package/dist/internal/appear-slot.d.ts +23 -0
  113. package/dist/internal/appear-slot.d.ts.map +1 -0
  114. package/dist/internal/appear-slot.js +29 -0
  115. package/dist/internal/appear-slot.js.map +1 -0
  116. package/dist/internal/appear.d.ts +237 -0
  117. package/dist/internal/appear.d.ts.map +1 -0
  118. package/dist/internal/appear.js +740 -0
  119. package/dist/internal/appear.js.map +1 -0
  120. package/dist/internal/auto-scroll.d.ts +24 -0
  121. package/dist/internal/auto-scroll.d.ts.map +1 -0
  122. package/dist/internal/auto-scroll.js +124 -0
  123. package/dist/internal/auto-scroll.js.map +1 -0
  124. package/dist/internal/batch-writer.d.ts +16 -0
  125. package/dist/internal/batch-writer.d.ts.map +1 -0
  126. package/dist/internal/batch-writer.js +77 -0
  127. package/dist/internal/batch-writer.js.map +1 -0
  128. package/dist/internal/clock.d.ts +19 -0
  129. package/dist/internal/clock.d.ts.map +1 -0
  130. package/dist/internal/clock.js +39 -0
  131. package/dist/internal/clock.js.map +1 -0
  132. package/dist/internal/colors.d.ts +45 -0
  133. package/dist/internal/colors.d.ts.map +1 -0
  134. package/dist/internal/colors.js +193 -0
  135. package/dist/internal/colors.js.map +1 -0
  136. package/dist/internal/complex.d.ts +24 -0
  137. package/dist/internal/complex.d.ts.map +1 -0
  138. package/dist/internal/complex.js +28 -0
  139. package/dist/internal/complex.js.map +1 -0
  140. package/dist/internal/content-watch.d.ts +20 -0
  141. package/dist/internal/content-watch.d.ts.map +1 -0
  142. package/dist/internal/content-watch.js +76 -0
  143. package/dist/internal/content-watch.js.map +1 -0
  144. package/dist/internal/default-transition.d.ts +25 -0
  145. package/dist/internal/default-transition.d.ts.map +1 -0
  146. package/dist/internal/default-transition.js +41 -0
  147. package/dist/internal/default-transition.js.map +1 -0
  148. package/dist/internal/drag-defaults.d.ts +18 -0
  149. package/dist/internal/drag-defaults.d.ts.map +1 -0
  150. package/dist/internal/drag-defaults.js +38 -0
  151. package/dist/internal/drag-defaults.js.map +1 -0
  152. package/dist/internal/gate.d.ts +188 -0
  153. package/dist/internal/gate.d.ts.map +1 -0
  154. package/dist/internal/gate.js +458 -0
  155. package/dist/internal/gate.js.map +1 -0
  156. package/dist/internal/input.d.ts +35 -0
  157. package/dist/internal/input.d.ts.map +1 -0
  158. package/dist/internal/input.js +658 -0
  159. package/dist/internal/input.js.map +1 -0
  160. package/dist/internal/interpolators.d.ts +19 -0
  161. package/dist/internal/interpolators.d.ts.map +1 -0
  162. package/dist/internal/interpolators.js +30 -0
  163. package/dist/internal/interpolators.js.map +1 -0
  164. package/dist/internal/key-rules.d.ts +11 -0
  165. package/dist/internal/key-rules.d.ts.map +1 -0
  166. package/dist/internal/key-rules.js +244 -0
  167. package/dist/internal/key-rules.js.map +1 -0
  168. package/dist/internal/keyboard-press.d.ts +7 -0
  169. package/dist/internal/keyboard-press.d.ts.map +1 -0
  170. package/dist/internal/keyboard-press.js +45 -0
  171. package/dist/internal/keyboard-press.js.map +1 -0
  172. package/dist/internal/measure.d.ts +157 -0
  173. package/dist/internal/measure.d.ts.map +1 -0
  174. package/dist/internal/measure.js +296 -0
  175. package/dist/internal/measure.js.map +1 -0
  176. package/dist/internal/measured-pairs.d.ts +38 -0
  177. package/dist/internal/measured-pairs.d.ts.map +1 -0
  178. package/dist/internal/measured-pairs.js +251 -0
  179. package/dist/internal/measured-pairs.js.map +1 -0
  180. package/dist/internal/own-values.d.ts +35 -0
  181. package/dist/internal/own-values.d.ts.map +1 -0
  182. package/dist/internal/own-values.js +117 -0
  183. package/dist/internal/own-values.js.map +1 -0
  184. package/dist/internal/pass-ends.d.ts +21 -0
  185. package/dist/internal/pass-ends.d.ts.map +1 -0
  186. package/dist/internal/pass-ends.js +14 -0
  187. package/dist/internal/pass-ends.js.map +1 -0
  188. package/dist/internal/positional-keys.d.ts +16 -0
  189. package/dist/internal/positional-keys.d.ts.map +1 -0
  190. package/dist/internal/positional-keys.js +21 -0
  191. package/dist/internal/positional-keys.js.map +1 -0
  192. package/dist/internal/probe.d.ts +10 -0
  193. package/dist/internal/probe.d.ts.map +1 -0
  194. package/dist/internal/probe.js +116 -0
  195. package/dist/internal/probe.js.map +1 -0
  196. package/dist/internal/projection-defaults.d.ts +34 -0
  197. package/dist/internal/projection-defaults.d.ts.map +1 -0
  198. package/dist/internal/projection-defaults.js +21 -0
  199. package/dist/internal/projection-defaults.js.map +1 -0
  200. package/dist/internal/projection.d.ts +537 -0
  201. package/dist/internal/projection.d.ts.map +1 -0
  202. package/dist/internal/projection.js +5228 -0
  203. package/dist/internal/projection.js.map +1 -0
  204. package/dist/internal/renderer.d.ts +104 -0
  205. package/dist/internal/renderer.d.ts.map +1 -0
  206. package/dist/internal/renderer.js +618 -0
  207. package/dist/internal/renderer.js.map +1 -0
  208. package/dist/internal/reorder.d.ts +174 -0
  209. package/dist/internal/reorder.d.ts.map +1 -0
  210. package/dist/internal/reorder.js +466 -0
  211. package/dist/internal/reorder.js.map +1 -0
  212. package/dist/internal/report.d.ts +30 -0
  213. package/dist/internal/report.d.ts.map +1 -0
  214. package/dist/internal/report.js +60 -0
  215. package/dist/internal/report.js.map +1 -0
  216. package/dist/internal/require-global.d.ts +11 -0
  217. package/dist/internal/require-global.d.ts.map +1 -0
  218. package/dist/internal/require-global.js +31 -0
  219. package/dist/internal/require-global.js.map +1 -0
  220. package/dist/internal/reveal.d.ts +20 -0
  221. package/dist/internal/reveal.d.ts.map +1 -0
  222. package/dist/internal/reveal.js +71 -0
  223. package/dist/internal/reveal.js.map +1 -0
  224. package/dist/internal/runner.d.ts +21 -0
  225. package/dist/internal/runner.d.ts.map +1 -0
  226. package/dist/internal/runner.js +48 -0
  227. package/dist/internal/runner.js.map +1 -0
  228. package/dist/internal/scale-correction.d.ts +80 -0
  229. package/dist/internal/scale-correction.d.ts.map +1 -0
  230. package/dist/internal/scale-correction.js +227 -0
  231. package/dist/internal/scale-correction.js.map +1 -0
  232. package/dist/internal/scroll.d.ts +37 -0
  233. package/dist/internal/scroll.d.ts.map +1 -0
  234. package/dist/internal/scroll.js +279 -0
  235. package/dist/internal/scroll.js.map +1 -0
  236. package/dist/internal/scrollers.d.ts +35 -0
  237. package/dist/internal/scrollers.d.ts.map +1 -0
  238. package/dist/internal/scrollers.js +38 -0
  239. package/dist/internal/scrollers.js.map +1 -0
  240. package/dist/internal/starting-style.d.ts +141 -0
  241. package/dist/internal/starting-style.d.ts.map +1 -0
  242. package/dist/internal/starting-style.js +300 -0
  243. package/dist/internal/starting-style.js.map +1 -0
  244. package/dist/internal/svg.d.ts +60 -0
  245. package/dist/internal/svg.d.ts.map +1 -0
  246. package/dist/internal/svg.js +257 -0
  247. package/dist/internal/svg.js.map +1 -0
  248. package/dist/internal/variables.d.ts +45 -0
  249. package/dist/internal/variables.d.ts.map +1 -0
  250. package/dist/internal/variables.js +92 -0
  251. package/dist/internal/variables.js.map +1 -0
  252. package/package.json +65 -4
  253. package/src/Appear.ts +54 -0
  254. package/src/Color.ts +24 -0
  255. package/src/DomAnnouncer.ts +22 -0
  256. package/src/DomBatch.ts +22 -0
  257. package/src/DomClock.ts +13 -0
  258. package/src/DomDefaultTransition.ts +16 -0
  259. package/src/DomInput.ts +23 -0
  260. package/src/DomInterpolators.ts +16 -0
  261. package/src/DomKeyRules.ts +17 -0
  262. package/src/DomPositionalKeys.ts +16 -0
  263. package/src/DomProbe.ts +15 -0
  264. package/src/DomProjectionSystem.ts +44 -0
  265. package/src/DomRenderer.ts +26 -0
  266. package/src/DomScrollSource.ts +14 -0
  267. package/src/FlushGate.ts +81 -0
  268. package/src/KeyboardPress.ts +16 -0
  269. package/src/MeasuredPair.ts +15 -0
  270. package/src/OwnValues.ts +19 -0
  271. package/src/ProjectionSystem.ts +51 -0
  272. package/src/ReorderController.ts +122 -0
  273. package/src/Report.ts +17 -0
  274. package/src/ScrollOffset.ts +54 -0
  275. package/src/Style.ts +37 -0
  276. package/src/Svg.ts +21 -0
  277. package/src/Variables.ts +17 -0
  278. package/src/index.ts +120 -0
  279. package/src/internal/announcer.ts +132 -0
  280. package/src/internal/appear-slot.ts +32 -0
  281. package/src/internal/appear.ts +1134 -0
  282. package/src/internal/auto-scroll.ts +176 -0
  283. package/src/internal/batch-writer.ts +95 -0
  284. package/src/internal/clock.ts +45 -0
  285. package/src/internal/colors.ts +258 -0
  286. package/src/internal/complex.ts +29 -0
  287. package/src/internal/content-watch.ts +84 -0
  288. package/src/internal/culori.d.ts +58 -0
  289. package/src/internal/default-transition.ts +50 -0
  290. package/src/internal/drag-defaults.ts +54 -0
  291. package/src/internal/gate.ts +598 -0
  292. package/src/internal/input.ts +763 -0
  293. package/src/internal/interpolators.ts +33 -0
  294. package/src/internal/key-rules.ts +357 -0
  295. package/src/internal/keyboard-press.ts +45 -0
  296. package/src/internal/measure.ts +373 -0
  297. package/src/internal/measured-pairs.ts +297 -0
  298. package/src/internal/own-values.ts +166 -0
  299. package/src/internal/pass-ends.ts +23 -0
  300. package/src/internal/positional-keys.ts +24 -0
  301. package/src/internal/probe.ts +175 -0
  302. package/src/internal/projection-defaults.ts +45 -0
  303. package/src/internal/projection.ts +6233 -0
  304. package/src/internal/renderer.ts +648 -0
  305. package/src/internal/reorder.ts +650 -0
  306. package/src/internal/report.ts +69 -0
  307. package/src/internal/require-global.ts +46 -0
  308. package/src/internal/reveal.ts +75 -0
  309. package/src/internal/runner.ts +64 -0
  310. package/src/internal/scale-correction.ts +310 -0
  311. package/src/internal/scroll.ts +358 -0
  312. package/src/internal/scrollers.ts +51 -0
  313. package/src/internal/starting-style.ts +396 -0
  314. package/src/internal/svg.ts +300 -0
  315. package/src/internal/variables.ts +145 -0
@@ -0,0 +1,78 @@
1
+ /**
2
+ * A Reorder group on the DOM: the group, its items' drags, its keyboard and its announcements, one
3
+ * controller a group. `make` builds one over the context's Projection system and `Announcer`, for items
4
+ * that are layout nodes; `makePlaced` one over the `Announcer` alone, for a Batch Reorder group's items,
5
+ * placed from their index and never measured. A binding attaches its group element, gets a driver for
6
+ * each item, and closing the Scope ends the controller. A server render gets `inert`.
7
+ *
8
+ * @example
9
+ * import * as ReorderController from "@wardic/dom/ReorderController"
10
+ *
11
+ * const controller = yield* ReorderController.make({ values: () => items, onReorder: (next) => (items = next) })
12
+ * controller.attach(list)
13
+ * const driver = controller.item(item, () => Option.some(element))
14
+ *
15
+ * // Items placed from their index: placed() once they're laid out in a new order.
16
+ * const placedGroup = yield* ReorderController.makePlaced({ values: () => items, onReorder: (next) => (items = next) })
17
+ * placedGroup.placed()
18
+ */
19
+ // A **Reorder group**'s controller (ADR-0019 *Amendment (Reorder)*, ADR-0037); a server render's `inert`
20
+ // (ADR-0021). `@wardic/dom/ReorderController` (#132, ADR-0041). A scoped constructor, one per group (#132's
21
+ // PR 3): `make` logs its `wardic.reorder:` events through the context's Logger, and ends with its Scope,
22
+ // which stops its listening to Measure passes, resets its Auto-scroll and clears a pending announcement.
23
+ // `makePlaced` (#712, ADR-0072) is the same controller wired to its binding's placing: no projection system,
24
+ // and `placed` where `make`'s hears a Measure pass's end.
25
+ // Its items' drivers stay plain, each with its own `dispose`, since one is made per element.
26
+ import * as Announcer from "@wardic/core/Announcer";
27
+ import * as Effect from "effect/Effect";
28
+ import { constVoid } from "effect/Function";
29
+ import { PassEnds } from "./internal/pass-ends.js";
30
+ import * as internal from "./internal/reorder.js";
31
+ import { makeRunner } from "./internal/runner.js";
32
+ import * as ProjectionSystem from "./ProjectionSystem.js";
33
+ export { DEFAULT_REORDER_INSTRUCTIONS as DEFAULT_INSTRUCTIONS, REORDER_GROUP_STYLE as GROUP_STYLE, } from "./internal/reorder.js";
34
+ /**
35
+ * Build a group's controller over the context's projection system, announcing through its
36
+ * `Announcer`, in the current Scope: closing it ends the controller.
37
+ */
38
+ export const make = Effect.fnUntraced(function* (options) {
39
+ const projection = yield* ProjectionSystem.ProjectionSystem;
40
+ const passEnds = yield* PassEnds;
41
+ const announcer = yield* Announcer.Announcer;
42
+ const controller = internal.makeReorderController({ runtime: yield* makeRunner(), layOut: () => projection.notify(), announce: announcer.announce, onLaidOut: passEnds.onPassEnd }, options);
43
+ yield* Effect.addFinalizer(() => Effect.sync(controller.dispose));
44
+ return controller;
45
+ });
46
+ /**
47
+ * Build a group's controller for items placed rather than measured, a Batch Reorder group's, announcing
48
+ * through the context's `Announcer`, in the current Scope: closing it ends the controller. It needs no
49
+ * projection system: each item registers a handle whose box is its place, raising its box's version as
50
+ * it's placed, and the binding calls `placed` once it has placed a new order.
51
+ */
52
+ // #712, ADR-0072 decision 6: the same controller, wired to its binding's placing.
53
+ export const makePlaced = Effect.fnUntraced(function* (options) {
54
+ const announcer = yield* Announcer.Announcer;
55
+ // What hears the binding's placing: the controller's own, once, until it's disposed.
56
+ let laidOut = constVoid;
57
+ const controller = internal.makeReorderController({
58
+ runtime: yield* makeRunner(),
59
+ // The binding places its items on a change of `values` itself.
60
+ layOut: constVoid,
61
+ announce: announcer.announce,
62
+ onLaidOut: (listener) => {
63
+ laidOut = listener;
64
+ return () => {
65
+ laidOut = constVoid;
66
+ };
67
+ },
68
+ }, options);
69
+ yield* Effect.addFinalizer(() => Effect.sync(controller.dispose));
70
+ return { ...controller, placed: () => laidOut() };
71
+ });
72
+ /**
73
+ * The controller a server render gets: its group has no values, so every operation on it does nothing,
74
+ * its axis is `"y"`, and an item's driver does nothing too.
75
+ */
76
+ // ADR-0021.
77
+ export const inert = internal.INERT_REORDER_CONTROLLER;
78
+ //# sourceMappingURL=ReorderController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReorderController.js","sourceRoot":"","sources":["../src/ReorderController.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,yGAAyG;AACzG,4GAA4G;AAC5G,yGAAyG;AACzG,yGAAyG;AACzG,6GAA6G;AAC7G,0DAA0D;AAC1D,6FAA6F;AAC7F,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD,OAAO,EAOL,4BAA4B,IAAI,oBAAoB,EACpD,mBAAmB,IAAI,WAAW,GACnC,MAAM,uBAAuB,CAAA;AAe9B;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAmG,MAAM,CAAC,UAAU,CACnI,QAAQ,CAAC,EAAK,OAAmB;IAC/B,MAAM,UAA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CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAA;IACjE,OAAO,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CAAA;AACnD,CAAC,CAAC,CAAA;AAEJ;;;GAGG;AACH,YAAY;AACZ,MAAM,CAAC,MAAM,KAAK,GAA6B,QAAQ,CAAC,wBAAwB,CAAA"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Reporting a failure where a fiber stops: logged at Error and handed to the Environment's
3
+ * `ErrorReporter`s, so an app's error tracking sees it. An interruption is neither: it's how a run is
4
+ * removed.
5
+ *
6
+ * @example
7
+ * import * as Report from "@wardic/dom/Report"
8
+ *
9
+ * yield* Report.failure("wardic: an animation failed", cause)
10
+ */
11
+ export { reportFailure as failure, debugKept, debugOf, type DebugLog, } from "./internal/report.ts";
12
+ //# sourceMappingURL=Report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Report.d.ts","sourceRoot":"","sources":["../src/Report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,aAAa,IAAI,OAAO,EACxB,SAAS,EACT,OAAO,EACP,KAAK,QAAQ,GACd,MAAM,sBAAsB,CAAA"}
package/dist/Report.js ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Reporting a failure where a fiber stops: logged at Error and handed to the Environment's
3
+ * `ErrorReporter`s, so an app's error tracking sees it. An interruption is neither: it's how a run is
4
+ * removed.
5
+ *
6
+ * @example
7
+ * import * as Report from "@wardic/dom/Report"
8
+ *
9
+ * yield* Report.failure("wardic: an animation failed", cause)
10
+ */
11
+ // `@wardic/dom/Report` (#132, ADR-0041): ADR-0030, decision 4.
12
+ export { reportFailure as failure, debugKept, debugOf, } from "./internal/report.js";
13
+ //# sourceMappingURL=Report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Report.js","sourceRoot":"","sources":["../src/Report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,+DAA+D;AAC/D,OAAO,EACL,aAAa,IAAI,OAAO,EACxB,SAAS,EACT,OAAO,GAER,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Scroll offsets, the DOM's: Motion's syntax for where a target's progress through its scroll container
3
+ * runs, from 0 to 1, which the DOM's `ScrollSource` resolves. Core takes an offset as its Environment's
4
+ * own and passes it through, so its syntax, its names and its units are the DOM's.
5
+ *
6
+ * - **An edge** is a name (`start`, `center`, `end`), a fraction of a length (`0.5`), or a CSS length:
7
+ * `"100px"` a distance, `"50%"` a fraction, `"10vw"` or `"10vh"` a share of the viewport.
8
+ * - **A stop** is a pair of edges, `[target, container]`: the scroll position where the target's edge
9
+ * meets the container's. A string holds both (`"start end"`); one edge alone is both for a name or a
10
+ * number (`"end"`, `0.5`), else the target's against the container's start (`"100px"`).
11
+ * - **An offset** is two stops or more: progress runs from 0 at the first to 1 at the last, evenly
12
+ * between them, and holds past them.
13
+ *
14
+ * @example
15
+ * import * as ScrollOffset from "@wardic/dom/ScrollOffset"
16
+ *
17
+ * // From the target's top meeting the container's bottom, to its bottom meeting the container's top:
18
+ * const across: ScrollOffset.ScrollOffset = ["start end", "end start"]
19
+ */
20
+ /** One edge of a stop: a name, a fraction, or a CSS length (see the module's doc). */
21
+ export type Edge = string | number;
22
+ /** One stop: `[target edge, container edge]`, a string of both, or one edge. */
23
+ export type Stop = Edge | readonly [Edge, Edge];
24
+ /** Where a target's progress runs: two stops or more. */
25
+ export type ScrollOffset = ReadonlyArray<Stop>;
26
+ /** Motion's presets: while the target comes into the container. */
27
+ export declare const Enter: ScrollOffset;
28
+ /** While the target leaves the container. */
29
+ export declare const Exit: ScrollOffset;
30
+ /** While any of the target is in the container. */
31
+ export declare const Any: ScrollOffset;
32
+ /** While all of the target is in the container: the offset with a target and none given. */
33
+ export declare const All: ScrollOffset;
34
+ //# sourceMappingURL=ScrollOffset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScrollOffset.d.ts","sourceRoot":"","sources":["../src/ScrollOffset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,sFAAsF;AACtF,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;AAElC,gFAAgF;AAChF,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAE/C,yDAAyD;AACzD,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC,IAAI,CAAC,CAAA;AAE9C,mEAAmE;AACnE,eAAO,MAAM,KAAK,EAAE,YAGnB,CAAA;AAED,6CAA6C;AAC7C,eAAO,MAAM,IAAI,EAAE,YAGlB,CAAA;AAED,mDAAmD;AACnD,eAAO,MAAM,GAAG,EAAE,YAGjB,CAAA;AAED,4FAA4F;AAC5F,eAAO,MAAM,GAAG,EAAE,YAGjB,CAAA"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Scroll offsets, the DOM's: Motion's syntax for where a target's progress through its scroll container
3
+ * runs, from 0 to 1, which the DOM's `ScrollSource` resolves. Core takes an offset as its Environment's
4
+ * own and passes it through, so its syntax, its names and its units are the DOM's.
5
+ *
6
+ * - **An edge** is a name (`start`, `center`, `end`), a fraction of a length (`0.5`), or a CSS length:
7
+ * `"100px"` a distance, `"50%"` a fraction, `"10vw"` or `"10vh"` a share of the viewport.
8
+ * - **A stop** is a pair of edges, `[target, container]`: the scroll position where the target's edge
9
+ * meets the container's. A string holds both (`"start end"`); one edge alone is both for a name or a
10
+ * number (`"end"`, `0.5`), else the target's against the container's start (`"100px"`).
11
+ * - **An offset** is two stops or more: progress runs from 0 at the first to 1 at the last, evenly
12
+ * between them, and holds past them.
13
+ *
14
+ * @example
15
+ * import * as ScrollOffset from "@wardic/dom/ScrollOffset"
16
+ *
17
+ * // From the target's top meeting the container's bottom, to its bottom meeting the container's top:
18
+ * const across: ScrollOffset.ScrollOffset = ["start end", "end start"]
19
+ */
20
+ // #234, ADR-0043 *Amendment (#233, #234)*; resolved in `internal/scroll.ts`. `@wardic/dom/ScrollOffset`
21
+ // (ADR-0041): the type a binding gives its `scroll` helper's `offset`.
22
+ /** Motion's presets: while the target comes into the container. */
23
+ export const Enter = [
24
+ [0, 1],
25
+ [1, 1],
26
+ ];
27
+ /** While the target leaves the container. */
28
+ export const Exit = [
29
+ [0, 0],
30
+ [1, 0],
31
+ ];
32
+ /** While any of the target is in the container. */
33
+ export const Any = [
34
+ [1, 0],
35
+ [0, 1],
36
+ ];
37
+ /** While all of the target is in the container: the offset with a target and none given. */
38
+ export const All = [
39
+ [0, 0],
40
+ [1, 1],
41
+ ];
42
+ //# sourceMappingURL=ScrollOffset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScrollOffset.js","sourceRoot":"","sources":["../src/ScrollOffset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wGAAwG;AACxG,uEAAuE;AAWvE,mEAAmE;AACnE,MAAM,CAAC,MAAM,KAAK,GAAiB;IACjC,CAAC,CAAC,EAAE,CAAC,CAAC;IACN,CAAC,CAAC,EAAE,CAAC,CAAC;CACP,CAAA;AAED,6CAA6C;AAC7C,MAAM,CAAC,MAAM,IAAI,GAAiB;IAChC,CAAC,CAAC,EAAE,CAAC,CAAC;IACN,CAAC,CAAC,EAAE,CAAC,CAAC;CACP,CAAA;AAED,mDAAmD;AACnD,MAAM,CAAC,MAAM,GAAG,GAAiB;IAC/B,CAAC,CAAC,EAAE,CAAC,CAAC;IACN,CAAC,CAAC,EAAE,CAAC,CAAC;CACP,CAAA;AAED,4FAA4F;AAC5F,MAAM,CAAC,MAAM,GAAG,GAAiB;IAC/B,CAAC,CAAC,EAAE,CAAC,CAAC;IACN,CAAC,CAAC,EAAE,CAAC,CAAC;CACP,CAAA"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * An element's style as a binding builds it: its starting style, what it's drawn with before any
3
+ * animation runs, from its `initial` (or its `animate`, with `initial: false`); how an app's own style and
4
+ * Wardic's are layered (`over`, `without`); and a drag element's default style. A server render draws the
5
+ * starting style, so an element is drawn where it starts before any code runs.
6
+ *
7
+ * @example
8
+ * import * as Style from "@wardic/dom/Style"
9
+ *
10
+ * const start = Style.resolveInitial({ initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 } })
11
+ * Style.starting(undefined, start) // { style: { transform: "translateY(8px)", opacity: 0 }, attrs: {} }
12
+ */
13
+ export { startingStyle as starting, resolveInitial, type InitialConfig, keyframesOf, splitValues, type SplitValues, type StopAt, type Stops, toValues, valuesAt, type StyleInput as Input, type StyleRecord as Style, over, without, heldTouches, } from "./internal/starting-style.ts";
14
+ export { dragDefaultStyle as dragDefaults, type DragDefaultStyle as DragDefaults, DRAG_DEFAULT_ATTRIBUTES, reorderTouchAction, } from "./internal/drag-defaults.ts";
15
+ //# sourceMappingURL=Style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Style.d.ts","sourceRoot":"","sources":["../src/Style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EACL,aAAa,IAAI,QAAQ,EACzB,cAAc,EACd,KAAK,aAAa,EAClB,WAAW,EACX,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,KAAK,UAAU,IAAI,KAAK,EACxB,KAAK,WAAW,IAAI,KAAK,EACzB,IAAI,EACJ,OAAO,EACP,WAAW,GACZ,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,gBAAgB,IAAI,YAAY,EAChC,KAAK,gBAAgB,IAAI,YAAY,EACrC,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,6BAA6B,CAAA"}
package/dist/Style.js ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * An element's style as a binding builds it: its starting style, what it's drawn with before any
3
+ * animation runs, from its `initial` (or its `animate`, with `initial: false`); how an app's own style and
4
+ * Wardic's are layered (`over`, `without`); and a drag element's default style. A server render draws the
5
+ * starting style, so an element is drawn where it starts before any code runs.
6
+ *
7
+ * @example
8
+ * import * as Style from "@wardic/dom/Style"
9
+ *
10
+ * const start = Style.resolveInitial({ initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 } })
11
+ * Style.starting(undefined, start) // { style: { transform: "translateY(8px)", opacity: 0 }, attrs: {} }
12
+ */
13
+ // `@wardic/dom/Style` (#132, ADR-0041): the **Starting style**, the merges of an app's style with
14
+ // Wardic's, and a drag element's defaults (ADR-0019, ADR-0021, ADR-0034).
15
+ export { startingStyle as starting, resolveInitial, keyframesOf, splitValues, toValues, valuesAt, over, without, heldTouches, } from "./internal/starting-style.js";
16
+ export { dragDefaultStyle as dragDefaults, DRAG_DEFAULT_ATTRIBUTES, reorderTouchAction, } from "./internal/drag-defaults.js";
17
+ //# sourceMappingURL=Style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Style.js","sourceRoot":"","sources":["../src/Style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,kGAAkG;AAClG,0EAA0E;AAC1E,OAAO,EACL,aAAa,IAAI,QAAQ,EACzB,cAAc,EAEd,WAAW,EACX,WAAW,EAIX,QAAQ,EACR,QAAQ,EAGR,IAAI,EACJ,OAAO,EACP,WAAW,GACZ,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,gBAAgB,IAAI,YAAY,EAEhC,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,6BAA6B,CAAA"}
package/dist/Svg.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * SVG: which elements are SVG's, and a style patch split into the CSS an SVG element takes and the
3
+ * attributes it takes instead. An `<svg>` root is styled as HTML is; an element inside it takes most keys
4
+ * as attributes, and a transform about its own centre, as an HTML element's is.
5
+ *
6
+ * @example
7
+ * import * as Svg from "@wardic/dom/Svg"
8
+ *
9
+ * Svg.splitPatchForTag("circle", { r: 10, opacity: 0.5, transform: "scale(2)" })
10
+ * // style: transform, transform-box and transform-origin; attrs: { r: "10", opacity: "0.5" }
11
+ */
12
+ export { isSvgRoot as isRoot, isSvgInner as isInner, isSvgInnerTag as isInnerTag, setSvgAttrs as setAttrs, splitPatch, splitPatchForTag, type SplitPatch, } from "./internal/svg.ts";
13
+ //# sourceMappingURL=Svg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Svg.d.ts","sourceRoot":"","sources":["../src/Svg.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,SAAS,IAAI,MAAM,EACnB,UAAU,IAAI,OAAO,EACrB,aAAa,IAAI,UAAU,EAC3B,WAAW,IAAI,QAAQ,EACvB,UAAU,EACV,gBAAgB,EAChB,KAAK,UAAU,GAChB,MAAM,mBAAmB,CAAA"}
package/dist/Svg.js ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ * SVG: which elements are SVG's, and a style patch split into the CSS an SVG element takes and the
3
+ * attributes it takes instead. An `<svg>` root is styled as HTML is; an element inside it takes most keys
4
+ * as attributes, and a transform about its own centre, as an HTML element's is.
5
+ *
6
+ * @example
7
+ * import * as Svg from "@wardic/dom/Svg"
8
+ *
9
+ * Svg.splitPatchForTag("circle", { r: 10, opacity: 0.5, transform: "scale(2)" })
10
+ * // style: transform, transform-box and transform-origin; attrs: { r: "10", opacity: "0.5" }
11
+ */
12
+ // `@wardic/dom/Svg` (#132, ADR-0041): ADR-0014.
13
+ export { isSvgRoot as isRoot, isSvgInner as isInner, isSvgInnerTag as isInnerTag, setSvgAttrs as setAttrs, splitPatch, splitPatchForTag, } from "./internal/svg.js";
14
+ //# sourceMappingURL=Svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Svg.js","sourceRoot":"","sources":["../src/Svg.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,gDAAgD;AAChD,OAAO,EACL,SAAS,IAAI,MAAM,EACnB,UAAU,IAAI,OAAO,EACrB,aAAa,IAAI,UAAU,EAC3B,WAAW,IAAI,QAAQ,EACvB,UAAU,EACV,gBAAgB,GAEjB,MAAM,mBAAmB,CAAA"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * CSS variables in animated values: a value that's wholly a `var()` is resolved against an element, so
3
+ * `var(--accent)` animates from or to the colour it stands for. `values` is the Key rule a binding adds
4
+ * for an element's own animations.
5
+ *
6
+ * @example
7
+ * import * as Variables from "@wardic/dom/Variables"
8
+ *
9
+ * Variables.isValue("var(--gap)") // true
10
+ * Variables.resolve(element, "var(--gap)") // what `--gap` computes to on `element`
11
+ */
12
+ export { isVariableValue as isValue, resolveVariable as resolve, variableValues as values, } from "./internal/variables.ts";
13
+ //# sourceMappingURL=Variables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Variables.d.ts","sourceRoot":"","sources":["../src/Variables.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,eAAe,IAAI,OAAO,EAC1B,eAAe,IAAI,OAAO,EAC1B,cAAc,IAAI,MAAM,GACzB,MAAM,yBAAyB,CAAA"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * CSS variables in animated values: a value that's wholly a `var()` is resolved against an element, so
3
+ * `var(--accent)` animates from or to the colour it stands for. `values` is the Key rule a binding adds
4
+ * for an element's own animations.
5
+ *
6
+ * @example
7
+ * import * as Variables from "@wardic/dom/Variables"
8
+ *
9
+ * Variables.isValue("var(--gap)") // true
10
+ * Variables.resolve(element, "var(--gap)") // what `--gap` computes to on `element`
11
+ */
12
+ // `@wardic/dom/Variables` (#132, ADR-0041): #55, ADR-0035.
13
+ export { isVariableValue as isValue, resolveVariable as resolve, variableValues as values, } from "./internal/variables.js";
14
+ //# sourceMappingURL=Variables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Variables.js","sourceRoot":"","sources":["../src/Variables.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,2DAA2D;AAC3D,OAAO,EACL,eAAe,IAAI,OAAO,EAC1B,eAAe,IAAI,OAAO,EAC1B,cAAc,IAAI,MAAM,GACzB,MAAM,yBAAyB,CAAA"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * `@wardic/dom`: the browser Environment, and the framework-free pieces a binding builds on. It's for
3
+ * binding authors, Wardic's own and any other, and it's Effect-typed.
4
+ *
5
+ * - **An app** imports {@link DomLive}, the composed Environment it hands its binding,
6
+ * {@link CheckFrames}, to check its Frames in development, and {@link FrameLoopMetrics}, to record the
7
+ * Frame loop's metrics.
8
+ * - **A binding** imports each module by its subpath, as a namespace
9
+ * (`import * as FlushGate from "@wardic/dom/FlushGate"`), and the root re-exports each one:
10
+ * - the DOM's implementations of core's services, each with its `layer` (Effect's platform
11
+ * convention: `DomRenderer`, `DomInput`, `DomProbe`, `DomScrollSource`, `DomClock`, `DomAnnouncer`,
12
+ * `DomInterpolators`, `DomPositionalKeys`, `DomDefaultTransition`), and `DomKeyRules`, the Key
13
+ * rules `DomInterpolators.layer` installs, which has none of its own;
14
+ * - dom's own concepts, by the glossary's names: `FlushGate`, `ProjectionSystem`,
15
+ * `ReorderController`, `Style`, `Svg`, `Color`, `Variables`, `ScrollOffset`, `Appear`, `OwnValues`,
16
+ * `KeyboardPress` and `Report`.
17
+ *
18
+ * Everything under `internal/` is dom's own and not exported.
19
+ */
20
+ import type * as Clock from "@wardic/core/Clock";
21
+ import * as FrameLoop from "@wardic/core/FrameLoop";
22
+ import type * as InterpolatorRegistry from "@wardic/core/InterpolatorRegistry";
23
+ import type * as Announcer from "@wardic/core/Announcer";
24
+ import type * as DefaultTransition from "@wardic/core/DefaultTransition";
25
+ import type * as ReducedMotion from "@wardic/core/ReducedMotion";
26
+ import type * as Probe from "@wardic/core/Probe";
27
+ import type * as RefreshFrameSource from "@wardic/core/RefreshFrameSource";
28
+ import type * as Renderer from "@wardic/core/Renderer";
29
+ import * as Layer from "effect/Layer";
30
+ import * as AtomRegistry from "effect/reactivity/AtomRegistry";
31
+ export declare const VERSION = "1.0.0-rc.10";
32
+ export * as DomBatch from "./DomBatch.ts";
33
+ export * as DomClock from "./DomClock.ts";
34
+ export * as DomInput from "./DomInput.ts";
35
+ export * as DomProbe from "./DomProbe.ts";
36
+ export * as DomScrollSource from "./DomScrollSource.ts";
37
+ export * as DomRenderer from "./DomRenderer.ts";
38
+ export * as DomAnnouncer from "./DomAnnouncer.ts";
39
+ export * as DomInterpolators from "./DomInterpolators.ts";
40
+ export * as DomPositionalKeys from "./DomPositionalKeys.ts";
41
+ export * as DomDefaultTransition from "./DomDefaultTransition.ts";
42
+ export * as DomKeyRules from "./DomKeyRules.ts";
43
+ export * as FlushGate from "./FlushGate.ts";
44
+ export * as ProjectionSystem from "./ProjectionSystem.ts";
45
+ export * as DomProjectionSystem from "./DomProjectionSystem.ts";
46
+ export * as ReorderController from "./ReorderController.ts";
47
+ export * as Style from "./Style.ts";
48
+ export * as Svg from "./Svg.ts";
49
+ export * as Color from "./Color.ts";
50
+ export * as Variables from "./Variables.ts";
51
+ export * as ScrollOffset from "./ScrollOffset.ts";
52
+ export * as Appear from "./Appear.ts";
53
+ export * as OwnValues from "./OwnValues.ts";
54
+ export * as KeyboardPress from "./KeyboardPress.ts";
55
+ export * as Report from "./Report.ts";
56
+ /**
57
+ * Core's development check for Frames that aren't finite (`FrameLoop.CheckFrames`), here for an app,
58
+ * which installs `@wardic/dom` and not `@wardic/core`. Off by default; merged beside {@link DomLive} as
59
+ * `Layer.succeed(CheckFrames, true)`, it fails an animation whose Frame holds a NaN or an Infinity,
60
+ * naming its key and value, where the page would drop it without a word. It checks every Frame, so
61
+ * it's for development: see https://wardic.dev/guides/observability.
62
+ */
63
+ export { CheckFrames } from "@wardic/core/FrameLoop";
64
+ /**
65
+ * Core's Frame loop metrics (`FrameLoop.layerMetrics`), here for an app. Merged beside {@link DomLive},
66
+ * the loop records the animations running, the runs that settled or failed, and each tick's ms, for the
67
+ * devtools or an exporter to read. Without it, it records none: see
68
+ * https://wardic.dev/guides/observability.
69
+ */
70
+ export { layerMetrics as FrameLoopMetrics } from "@wardic/core/FrameLoop";
71
+ /**
72
+ * The browser Environment, composed: the DOM's services, core's interpolators with the DOM's Key
73
+ * rules, and the Frame loop over the DOM's Clock, needing nothing else. Hand it to `WardicProvider`'s
74
+ * `env` to run the engine on the page.
75
+ *
76
+ * It has no input: a binding's gestures build `DomInput.layer` with the first one an app uses, so an
77
+ * app with none ships no input code.
78
+ *
79
+ * Client-only: a server render builds no runtime, and building DomLive on a server fails with an
80
+ * error naming the service and the missing global: see https://wardic.dev/guides/server-rendering.
81
+ */
82
+ export declare const DomLive: Layer.Layer<Clock.Clock | RefreshFrameSource.RefreshFrameSource | FrameLoop.FrameLoop | Renderer.Renderer | Probe.Probe | InterpolatorRegistry.InterpolatorRegistry | ReducedMotion.PositionalKeys | DefaultTransition.DefaultTransition | Announcer.Announcer | AtomRegistry.AtomRegistry>;
83
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,KAAK,oBAAoB,MAAM,mCAAmC,CAAA;AAC9E,OAAO,KAAK,KAAK,SAAS,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,KAAK,iBAAiB,MAAM,gCAAgC,CAAA;AACxE,OAAO,KAAK,KAAK,aAAa,MAAM,4BAA4B,CAAA;AAChE,OAAO,KAAK,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,KAAK,kBAAkB,MAAM,iCAAiC,CAAA;AAC1E,OAAO,KAAK,KAAK,QAAQ,MAAM,uBAAuB,CAAA;AACt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AAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEzE;;;;;;;;;;GAUG;AAOH,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,KAAK,CAC7B,KAAK,CAAC,KAAK,GACX,kBAAkB,CAAC,kBAAkB,GACrC,SAAS,CAAC,SAAS,GACnB,QAAQ,CAAC,QAAQ,GACjB,KAAK,CAAC,KAAK,GACX,oBAAoB,CAAC,oBAAoB,GACzC,aAAa,CAAC,cAAc,GAC5B,iBAAiB,CAAC,iBAAiB,GACnC,SAAS,CAAC,SAAS,GACnB,YAAY,CAAC,YAAY,CAM5B,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,71 @@
1
+ import * as FrameLoop from "@wardic/core/FrameLoop";
2
+ import * as Layer from "effect/Layer";
3
+ import * as AtomRegistry from "effect/reactivity/AtomRegistry";
4
+ import * as DomAnnouncer from "./DomAnnouncer.js";
5
+ import * as DomClock from "./DomClock.js";
6
+ import * as DomDefaultTransition from "./DomDefaultTransition.js";
7
+ import * as DomInterpolators from "./DomInterpolators.js";
8
+ import * as DomPositionalKeys from "./DomPositionalKeys.js";
9
+ import * as DomProbe from "./DomProbe.js";
10
+ import * as DomRenderer from "./DomRenderer.js";
11
+ export const VERSION = "1.0.0-rc.10";
12
+ export * as DomBatch from "./DomBatch.js";
13
+ export * as DomClock from "./DomClock.js";
14
+ export * as DomInput from "./DomInput.js";
15
+ export * as DomProbe from "./DomProbe.js";
16
+ export * as DomScrollSource from "./DomScrollSource.js";
17
+ export * as DomRenderer from "./DomRenderer.js";
18
+ export * as DomAnnouncer from "./DomAnnouncer.js";
19
+ export * as DomInterpolators from "./DomInterpolators.js";
20
+ export * as DomPositionalKeys from "./DomPositionalKeys.js";
21
+ export * as DomDefaultTransition from "./DomDefaultTransition.js";
22
+ export * as DomKeyRules from "./DomKeyRules.js";
23
+ export * as FlushGate from "./FlushGate.js";
24
+ export * as ProjectionSystem from "./ProjectionSystem.js";
25
+ export * as DomProjectionSystem from "./DomProjectionSystem.js";
26
+ export * as ReorderController from "./ReorderController.js";
27
+ export * as Style from "./Style.js";
28
+ export * as Svg from "./Svg.js";
29
+ export * as Color from "./Color.js";
30
+ export * as Variables from "./Variables.js";
31
+ export * as ScrollOffset from "./ScrollOffset.js";
32
+ export * as Appear from "./Appear.js";
33
+ export * as OwnValues from "./OwnValues.js";
34
+ export * as KeyboardPress from "./KeyboardPress.js";
35
+ export * as Report from "./Report.js";
36
+ /**
37
+ * Core's development check for Frames that aren't finite (`FrameLoop.CheckFrames`), here for an app,
38
+ * which installs `@wardic/dom` and not `@wardic/core`. Off by default; merged beside {@link DomLive} as
39
+ * `Layer.succeed(CheckFrames, true)`, it fails an animation whose Frame holds a NaN or an Infinity,
40
+ * naming its key and value, where the page would drop it without a word. It checks every Frame, so
41
+ * it's for development: see https://wardic.dev/guides/observability.
42
+ */
43
+ // ADR-0030 decision 7; re-exported here for an app (#586).
44
+ export { CheckFrames } from "@wardic/core/FrameLoop";
45
+ /**
46
+ * Core's Frame loop metrics (`FrameLoop.layerMetrics`), here for an app. Merged beside {@link DomLive},
47
+ * the loop records the animations running, the runs that settled or failed, and each tick's ms, for the
48
+ * devtools or an exporter to read. Without it, it records none: see
49
+ * https://wardic.dev/guides/observability.
50
+ */
51
+ // #518, ADR-0067 *Amendment (#518)*, decision 2: opt-in, re-exported here for an app, as `CheckFrames` is.
52
+ export { layerMetrics as FrameLoopMetrics } from "@wardic/core/FrameLoop";
53
+ /**
54
+ * The browser Environment, composed: the DOM's services, core's interpolators with the DOM's Key
55
+ * rules, and the Frame loop over the DOM's Clock, needing nothing else. Hand it to `WardicProvider`'s
56
+ * `env` to run the engine on the page.
57
+ *
58
+ * It has no input: a binding's gestures build `DomInput.layer` with the first one an app uses, so an
59
+ * app with none ships no input code.
60
+ *
61
+ * Client-only: a server render builds no runtime, and building DomLive on a server fails with an
62
+ * error naming the service and the missing global: see https://wardic.dev/guides/server-rendering.
63
+ */
64
+ // Key rules: ADR-0035. Frame loop: ADR-0027. `DomClock.layer` also provides the `RefreshFrameSource`
65
+ // the flush gate requests its flushes from (ADR-0031). `DomProbe.layer` writes the `viewport` and
66
+ // `prefersReducedMotion` Atoms through the Environment's `AtomRegistry`, and consumers read them
67
+ // through the same registry, so `AtomRegistry` is provided to the Layers with `Layer.provideMerge` and
68
+ // kept in the output, as the headless `testLayer` (packages/test) does: R = never. No InputSource:
69
+ // #511, ADR-0067 decision 14. Client-only: ADR-0021, decision 7.
70
+ export const DomLive = FrameLoop.layer.pipe(Layer.provideMerge(Layer.mergeAll(DomClock.layer, DomRenderer.layer, DomProbe.layer, DomInterpolators.layer, DomPositionalKeys.layer, DomDefaultTransition.layer, DomAnnouncer.layer)), Layer.provideMerge(AtomRegistry.layer));
71
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AAQnD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAA;AAC9D,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,oBAAoB,MAAM,2BAA2B,CAAA;AACjE,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAC3D,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAA;AAEpC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;A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iG;AACjG,uGAAuG;AACvG,mGAAmG;AACnG,iEAAiE;AACjE,MAAM,CAAC,MAAM,OAAO,GAWhB,SAAS,CAAC,KAAK,CAAC,IAAI,CACtB,KAAK,CAAC,YAAY,CAChB,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,EAAE,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,CACnK,EACD,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,CACvC,CAAA"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The DOM's **Announcement** channel (ADR-0037): `AnnouncerDomLive`, core's `Announcer.Announcer` as
3
+ * one visually hidden live region per document, `aria-live="assertive"` and `aria-atomic`, shared by
4
+ * every Reorder group on the page. Assertive, because each announcement answers a key just pressed;
5
+ * the caller thins a held arrow's repeats to the last. Each announcement replaces the last, and one
6
+ * that repeats the last (an arrow at an end re-announcing the position) gets a trailing no-break
7
+ * space, so a screen reader sees a change and speaks it again.
8
+ *
9
+ * A screen reader watches a live region from when it's in the page, so the region has to be there
10
+ * before the first announcement: {@link prepareAnnouncer} adds it (a Reorder group's controller calls
11
+ * it when its element attaches), and an announcement adds it too if nothing did.
12
+ *
13
+ * {@link instructionsId} gives the id of a hidden element holding a group's instructions, one per
14
+ * distinct text per document, for its items' `aria-describedby`. {@link instructionsIdOf} gives the
15
+ * id alone, and {@link showInstructions} adds its element.
16
+ *
17
+ * Client-only (ADR-0021, decision 7): building the layer on a server fails with the client-only error.
18
+ *
19
+ * Tier 2 (ADR-0008): for DOM binding authors.
20
+ */
21
+ import * as Announcer from "@wardic/core/Announcer";
22
+ import * as Layer from "effect/Layer";
23
+ /** The attribute that marks the live region, for a test or a stylesheet to find it. */
24
+ export declare const ANNOUNCER_ATTRIBUTE = "data-wardic-announcer";
25
+ /**
26
+ * The live document `node` is in: its own when that has a window, else the page's. A Solid ref
27
+ * runs while a new element still belongs to its template's inert document (no window, no body),
28
+ * before it's inserted.
29
+ */
30
+ export declare const documentOf: (node: Node) => Document;
31
+ /** Adds `doc`'s live region now, before its first announcement, so a screen reader is already watching it. */
32
+ export declare const prepareAnnouncer: (doc: Document) => void;
33
+ /**
34
+ * Speaks `message` in `doc`'s live region, replacing the last. A repeat of the last gets a trailing
35
+ * no-break space, so it's read out again.
36
+ */
37
+ export declare const announceIn: (doc: Document, message: string) => void;
38
+ /**
39
+ * The id of `doc`'s hidden element holding `text`, one per distinct text, for the `aria-describedby` of
40
+ * every item that shows it. Given here, with no element added: a binding works it out as it renders, and
41
+ * adds the element with `showInstructions` in an effect.
42
+ */
43
+ export declare const instructionsIdOf: (doc: Document, text: string) => string;
44
+ /** Adds `doc`'s hidden element holding `text`, under `instructionsIdOf`'s id, unless it's there already. */
45
+ export declare const showInstructions: (doc: Document, text: string) => void;
46
+ /** `instructionsIdOf`, with its element added now: added again if it was removed. */
47
+ export declare const instructionsId: (doc: Document, text: string) => string;
48
+ /** Core's `Announcer`, speaking in the page's `document`'s live region. */
49
+ export declare const AnnouncerDomLive: Layer.Layer<Announcer.Announcer>;
50
+ //# sourceMappingURL=announcer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"announcer.d.ts","sourceRoot":"","sources":["../../src/internal/announcer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AAGnD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAKrC,uFAAuF;AACvF,eAAO,MAAM,mBAAmB,0BAA0B,CAAA;AA6B1D;;;;GAIG;AACH,eAAO,MAAM,UAAU,SAAU,IAAI,KAAG,QAIvC,CAAA;AAED,8GAA8G;AAC9G,eAAO,MAAM,gBAAgB,QAAS,QAAQ,KAAG,IAEhD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,QAAS,QAAQ,WAAW,MAAM,KAAG,IAG3D,CAAA;AAQD;;;;GAIG;AAEH,eAAO,MAAM,gBAAgB,QAAS,QAAQ,QAAQ,MAAM,KAAG,MAW9D,CAAA;AAED,4GAA4G;AAC5G,eAAO,MAAM,gBAAgB,QAAS,QAAQ,QAAQ,MAAM,KAAG,IAQ9D,CAAA;AAED,qFAAqF;AACrF,eAAO,MAAM,cAAc,QAAS,QAAQ,QAAQ,MAAM,KAAG,MAG5D,CAAA;AAED,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAK7D,CAAA"}