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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) 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 +24 -0
  5. package/dist/Appear.d.ts.map +1 -0
  6. package/dist/Appear.js +25 -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/DomClock.d.ts +11 -0
  17. package/dist/DomClock.d.ts.map +1 -0
  18. package/dist/DomClock.js +12 -0
  19. package/dist/DomClock.js.map +1 -0
  20. package/dist/DomDefaultTransition.d.ts +12 -0
  21. package/dist/DomDefaultTransition.d.ts.map +1 -0
  22. package/dist/DomDefaultTransition.js +13 -0
  23. package/dist/DomDefaultTransition.js.map +1 -0
  24. package/dist/DomInput.d.ts +13 -0
  25. package/dist/DomInput.d.ts.map +1 -0
  26. package/dist/DomInput.js +15 -0
  27. package/dist/DomInput.js.map +1 -0
  28. package/dist/DomInterpolators.d.ts +13 -0
  29. package/dist/DomInterpolators.d.ts.map +1 -0
  30. package/dist/DomInterpolators.js +14 -0
  31. package/dist/DomInterpolators.js.map +1 -0
  32. package/dist/DomKeyRules.d.ts +13 -0
  33. package/dist/DomKeyRules.d.ts.map +1 -0
  34. package/dist/DomKeyRules.js +14 -0
  35. package/dist/DomKeyRules.js.map +1 -0
  36. package/dist/DomPositionalKeys.d.ts +13 -0
  37. package/dist/DomPositionalKeys.d.ts.map +1 -0
  38. package/dist/DomPositionalKeys.js +14 -0
  39. package/dist/DomPositionalKeys.js.map +1 -0
  40. package/dist/DomProbe.d.ts +13 -0
  41. package/dist/DomProbe.d.ts.map +1 -0
  42. package/dist/DomProbe.js +14 -0
  43. package/dist/DomProbe.js.map +1 -0
  44. package/dist/DomProjectionSystem.d.ts +28 -0
  45. package/dist/DomProjectionSystem.d.ts.map +1 -0
  46. package/dist/DomProjectionSystem.js +41 -0
  47. package/dist/DomProjectionSystem.js.map +1 -0
  48. package/dist/DomRenderer.d.ts +13 -0
  49. package/dist/DomRenderer.d.ts.map +1 -0
  50. package/dist/DomRenderer.js +15 -0
  51. package/dist/DomRenderer.js.map +1 -0
  52. package/dist/FlushGate.d.ts +48 -0
  53. package/dist/FlushGate.d.ts.map +1 -0
  54. package/dist/FlushGate.js +62 -0
  55. package/dist/FlushGate.js.map +1 -0
  56. package/dist/MeasuredPair.d.ts +14 -0
  57. package/dist/MeasuredPair.d.ts.map +1 -0
  58. package/dist/MeasuredPair.js +16 -0
  59. package/dist/MeasuredPair.js.map +1 -0
  60. package/dist/OwnValues.d.ts +14 -0
  61. package/dist/OwnValues.d.ts.map +1 -0
  62. package/dist/OwnValues.js +15 -0
  63. package/dist/OwnValues.js.map +1 -0
  64. package/dist/ProjectionSystem.d.ts +34 -0
  65. package/dist/ProjectionSystem.d.ts.map +1 -0
  66. package/dist/ProjectionSystem.js +29 -0
  67. package/dist/ProjectionSystem.js.map +1 -0
  68. package/dist/ReorderController.d.ts +41 -0
  69. package/dist/ReorderController.d.ts.map +1 -0
  70. package/dist/ReorderController.js +44 -0
  71. package/dist/ReorderController.js.map +1 -0
  72. package/dist/Report.d.ts +12 -0
  73. package/dist/Report.d.ts.map +1 -0
  74. package/dist/Report.js +13 -0
  75. package/dist/Report.js.map +1 -0
  76. package/dist/ScrollOffset.d.ts +34 -0
  77. package/dist/ScrollOffset.d.ts.map +1 -0
  78. package/dist/ScrollOffset.js +42 -0
  79. package/dist/ScrollOffset.js.map +1 -0
  80. package/dist/Style.d.ts +15 -0
  81. package/dist/Style.d.ts.map +1 -0
  82. package/dist/Style.js +17 -0
  83. package/dist/Style.js.map +1 -0
  84. package/dist/Svg.d.ts +13 -0
  85. package/dist/Svg.d.ts.map +1 -0
  86. package/dist/Svg.js +14 -0
  87. package/dist/Svg.js.map +1 -0
  88. package/dist/Variables.d.ts +13 -0
  89. package/dist/Variables.d.ts.map +1 -0
  90. package/dist/Variables.js +14 -0
  91. package/dist/Variables.js.map +1 -0
  92. package/dist/index.d.ts +72 -0
  93. package/dist/index.d.ts.map +1 -0
  94. package/dist/index.js +60 -0
  95. package/dist/index.js.map +1 -0
  96. package/dist/internal/announcer.d.ts +50 -0
  97. package/dist/internal/announcer.d.ts.map +1 -0
  98. package/dist/internal/announcer.js +115 -0
  99. package/dist/internal/announcer.js.map +1 -0
  100. package/dist/internal/appear.d.ts +169 -0
  101. package/dist/internal/appear.d.ts.map +1 -0
  102. package/dist/internal/appear.js +499 -0
  103. package/dist/internal/appear.js.map +1 -0
  104. package/dist/internal/auto-scroll.d.ts +24 -0
  105. package/dist/internal/auto-scroll.d.ts.map +1 -0
  106. package/dist/internal/auto-scroll.js +124 -0
  107. package/dist/internal/auto-scroll.js.map +1 -0
  108. package/dist/internal/clock.d.ts +19 -0
  109. package/dist/internal/clock.d.ts.map +1 -0
  110. package/dist/internal/clock.js +39 -0
  111. package/dist/internal/clock.js.map +1 -0
  112. package/dist/internal/colors.d.ts +45 -0
  113. package/dist/internal/colors.d.ts.map +1 -0
  114. package/dist/internal/colors.js +193 -0
  115. package/dist/internal/colors.js.map +1 -0
  116. package/dist/internal/complex.d.ts +24 -0
  117. package/dist/internal/complex.d.ts.map +1 -0
  118. package/dist/internal/complex.js +28 -0
  119. package/dist/internal/complex.js.map +1 -0
  120. package/dist/internal/content-watch.d.ts +20 -0
  121. package/dist/internal/content-watch.d.ts.map +1 -0
  122. package/dist/internal/content-watch.js +76 -0
  123. package/dist/internal/content-watch.js.map +1 -0
  124. package/dist/internal/default-transition.d.ts +25 -0
  125. package/dist/internal/default-transition.d.ts.map +1 -0
  126. package/dist/internal/default-transition.js +41 -0
  127. package/dist/internal/default-transition.js.map +1 -0
  128. package/dist/internal/drag-defaults.d.ts +18 -0
  129. package/dist/internal/drag-defaults.d.ts.map +1 -0
  130. package/dist/internal/drag-defaults.js +38 -0
  131. package/dist/internal/drag-defaults.js.map +1 -0
  132. package/dist/internal/gate.d.ts +186 -0
  133. package/dist/internal/gate.d.ts.map +1 -0
  134. package/dist/internal/gate.js +453 -0
  135. package/dist/internal/gate.js.map +1 -0
  136. package/dist/internal/input.d.ts +41 -0
  137. package/dist/internal/input.d.ts.map +1 -0
  138. package/dist/internal/input.js +476 -0
  139. package/dist/internal/input.js.map +1 -0
  140. package/dist/internal/interpolators.d.ts +19 -0
  141. package/dist/internal/interpolators.d.ts.map +1 -0
  142. package/dist/internal/interpolators.js +30 -0
  143. package/dist/internal/interpolators.js.map +1 -0
  144. package/dist/internal/key-rules.d.ts +11 -0
  145. package/dist/internal/key-rules.d.ts.map +1 -0
  146. package/dist/internal/key-rules.js +244 -0
  147. package/dist/internal/key-rules.js.map +1 -0
  148. package/dist/internal/measure.d.ts +150 -0
  149. package/dist/internal/measure.d.ts.map +1 -0
  150. package/dist/internal/measure.js +278 -0
  151. package/dist/internal/measure.js.map +1 -0
  152. package/dist/internal/measured-pairs.d.ts +38 -0
  153. package/dist/internal/measured-pairs.d.ts.map +1 -0
  154. package/dist/internal/measured-pairs.js +251 -0
  155. package/dist/internal/measured-pairs.js.map +1 -0
  156. package/dist/internal/own-values.d.ts +35 -0
  157. package/dist/internal/own-values.d.ts.map +1 -0
  158. package/dist/internal/own-values.js +117 -0
  159. package/dist/internal/own-values.js.map +1 -0
  160. package/dist/internal/pass-ends.d.ts +21 -0
  161. package/dist/internal/pass-ends.d.ts.map +1 -0
  162. package/dist/internal/pass-ends.js +14 -0
  163. package/dist/internal/pass-ends.js.map +1 -0
  164. package/dist/internal/positional-keys.d.ts +16 -0
  165. package/dist/internal/positional-keys.d.ts.map +1 -0
  166. package/dist/internal/positional-keys.js +21 -0
  167. package/dist/internal/positional-keys.js.map +1 -0
  168. package/dist/internal/probe.d.ts +10 -0
  169. package/dist/internal/probe.d.ts.map +1 -0
  170. package/dist/internal/probe.js +117 -0
  171. package/dist/internal/probe.js.map +1 -0
  172. package/dist/internal/projection-defaults.d.ts +34 -0
  173. package/dist/internal/projection-defaults.d.ts.map +1 -0
  174. package/dist/internal/projection-defaults.js +21 -0
  175. package/dist/internal/projection-defaults.js.map +1 -0
  176. package/dist/internal/projection.d.ts +529 -0
  177. package/dist/internal/projection.d.ts.map +1 -0
  178. package/dist/internal/projection.js +4990 -0
  179. package/dist/internal/projection.js.map +1 -0
  180. package/dist/internal/renderer.d.ts +86 -0
  181. package/dist/internal/renderer.d.ts.map +1 -0
  182. package/dist/internal/renderer.js +616 -0
  183. package/dist/internal/renderer.js.map +1 -0
  184. package/dist/internal/reorder.d.ts +159 -0
  185. package/dist/internal/reorder.d.ts.map +1 -0
  186. package/dist/internal/reorder.js +437 -0
  187. package/dist/internal/reorder.js.map +1 -0
  188. package/dist/internal/report.d.ts +30 -0
  189. package/dist/internal/report.d.ts.map +1 -0
  190. package/dist/internal/report.js +60 -0
  191. package/dist/internal/report.js.map +1 -0
  192. package/dist/internal/require-global.d.ts +11 -0
  193. package/dist/internal/require-global.d.ts.map +1 -0
  194. package/dist/internal/require-global.js +31 -0
  195. package/dist/internal/require-global.js.map +1 -0
  196. package/dist/internal/reveal.d.ts +16 -0
  197. package/dist/internal/reveal.d.ts.map +1 -0
  198. package/dist/internal/reveal.js +66 -0
  199. package/dist/internal/reveal.js.map +1 -0
  200. package/dist/internal/runner.d.ts +21 -0
  201. package/dist/internal/runner.d.ts.map +1 -0
  202. package/dist/internal/runner.js +48 -0
  203. package/dist/internal/runner.js.map +1 -0
  204. package/dist/internal/scale-correction.d.ts +80 -0
  205. package/dist/internal/scale-correction.d.ts.map +1 -0
  206. package/dist/internal/scale-correction.js +227 -0
  207. package/dist/internal/scale-correction.js.map +1 -0
  208. package/dist/internal/scroll.d.ts +35 -0
  209. package/dist/internal/scroll.d.ts.map +1 -0
  210. package/dist/internal/scroll.js +244 -0
  211. package/dist/internal/scroll.js.map +1 -0
  212. package/dist/internal/scrollers.d.ts +35 -0
  213. package/dist/internal/scrollers.d.ts.map +1 -0
  214. package/dist/internal/scrollers.js +38 -0
  215. package/dist/internal/scrollers.js.map +1 -0
  216. package/dist/internal/starting-style.d.ts +141 -0
  217. package/dist/internal/starting-style.d.ts.map +1 -0
  218. package/dist/internal/starting-style.js +300 -0
  219. package/dist/internal/starting-style.js.map +1 -0
  220. package/dist/internal/svg.d.ts +60 -0
  221. package/dist/internal/svg.d.ts.map +1 -0
  222. package/dist/internal/svg.js +257 -0
  223. package/dist/internal/svg.js.map +1 -0
  224. package/dist/internal/variables.d.ts +45 -0
  225. package/dist/internal/variables.d.ts.map +1 -0
  226. package/dist/internal/variables.js +92 -0
  227. package/dist/internal/variables.js.map +1 -0
  228. package/package.json +65 -4
  229. package/src/Appear.ts +45 -0
  230. package/src/Color.ts +24 -0
  231. package/src/DomAnnouncer.ts +22 -0
  232. package/src/DomClock.ts +13 -0
  233. package/src/DomDefaultTransition.ts +16 -0
  234. package/src/DomInput.ts +22 -0
  235. package/src/DomInterpolators.ts +16 -0
  236. package/src/DomKeyRules.ts +17 -0
  237. package/src/DomPositionalKeys.ts +16 -0
  238. package/src/DomProbe.ts +15 -0
  239. package/src/DomProjectionSystem.ts +44 -0
  240. package/src/DomRenderer.ts +26 -0
  241. package/src/FlushGate.ts +81 -0
  242. package/src/MeasuredPair.ts +15 -0
  243. package/src/OwnValues.ts +19 -0
  244. package/src/ProjectionSystem.ts +51 -0
  245. package/src/ReorderController.ts +72 -0
  246. package/src/Report.ts +17 -0
  247. package/src/ScrollOffset.ts +54 -0
  248. package/src/Style.ts +37 -0
  249. package/src/Svg.ts +21 -0
  250. package/src/Variables.ts +17 -0
  251. package/src/index.ts +106 -0
  252. package/src/internal/announcer.ts +132 -0
  253. package/src/internal/appear.ts +739 -0
  254. package/src/internal/auto-scroll.ts +176 -0
  255. package/src/internal/clock.ts +45 -0
  256. package/src/internal/colors.ts +258 -0
  257. package/src/internal/complex.ts +29 -0
  258. package/src/internal/content-watch.ts +84 -0
  259. package/src/internal/culori.d.ts +58 -0
  260. package/src/internal/default-transition.ts +50 -0
  261. package/src/internal/drag-defaults.ts +54 -0
  262. package/src/internal/gate.ts +593 -0
  263. package/src/internal/input.ts +579 -0
  264. package/src/internal/interpolators.ts +33 -0
  265. package/src/internal/key-rules.ts +357 -0
  266. package/src/internal/measure.ts +357 -0
  267. package/src/internal/measured-pairs.ts +297 -0
  268. package/src/internal/own-values.ts +166 -0
  269. package/src/internal/pass-ends.ts +23 -0
  270. package/src/internal/positional-keys.ts +24 -0
  271. package/src/internal/probe.ts +176 -0
  272. package/src/internal/projection-defaults.ts +45 -0
  273. package/src/internal/projection.ts +5999 -0
  274. package/src/internal/renderer.ts +646 -0
  275. package/src/internal/reorder.ts +604 -0
  276. package/src/internal/report.ts +69 -0
  277. package/src/internal/require-global.ts +46 -0
  278. package/src/internal/reveal.ts +69 -0
  279. package/src/internal/runner.ts +64 -0
  280. package/src/internal/scale-correction.ts +310 -0
  281. package/src/internal/scroll.ts +356 -0
  282. package/src/internal/scrollers.ts +51 -0
  283. package/src/internal/starting-style.ts +396 -0
  284. package/src/internal/svg.ts +300 -0
  285. package/src/internal/variables.ts +145 -0
@@ -0,0 +1,476 @@
1
+ /**
2
+ * `InputDomLive` — the browser realization of `InputSource`, mapping raw DOM
3
+ * events onto the engine's environment-agnostic Like-event shapes
4
+ * (`PointerLikeEvent`/`KeyboardLikeEvent`/`FocusLikeEvent`).
5
+ *
6
+ * Every accessor is an **Input feed** (#318), shared per target by core's `InputFeed.byTarget`
7
+ * (CONTEXT.md's **Shared source** contract: one listener-set per element, ref-counted, with no
8
+ * `PubSub` or fiber). A consumer attaching `hover` + `press` + `drag` to one element therefore
9
+ * shares a single pointer listener-set, not three.
10
+ *
11
+ * `keyboard(target)` (ADR-0037) listens on the target's window, in the bubble phase, for
12
+ * the keys at the target or inside it: there it runs after the page's own handlers (the
13
+ * element's, and Solid's delegated ones on the document), so `handled` (`defaultPrevented`) says
14
+ * whether one took the key, and a consumer can still `handle()` it (`preventDefault()`). Its events
15
+ * reach their consumers inside the dispatch (ADR-0032), the targets a key passed through innermost
16
+ * first (#439): one listener per window walks its path.
17
+ * Keys are in core's names (`keyOf`), not the browser's.
18
+ *
19
+ * `pointer(target)` also carries every **Held pointer**'s events (ADR-0019): core's
20
+ * `InputSource.heldPointer` adds a page-wide set (the target's window, capture phase) inside
21
+ * the target's `pointerdown` dispatch and removes it at the pointer's release, so a
22
+ * drag or a press keeps its pointer anywhere on the page. It is part of the element's
23
+ * one shared lookup, so every subscriber to the element shares it too. No pointer
24
+ * capture: capturing at the down would retarget a click on a child `<button>` to the
25
+ * element, and it allows one capturer per pointer, which nested draggables (#29) would
26
+ * fight over.
27
+ *
28
+ * `adoptPointer(target, raw)` (#431, **Drag controls**) hands a pointer that went down elsewhere,
29
+ * a handle or a track, to `target`: its `PointerEvent` (a `pointerdown`, or any other with a button
30
+ * pressed) is delivered on `adoptablePointer(target)` as an adopted down, inside the call, and held
31
+ * from there as the target's own downs are. Only a target given Drag controls reads that feed (#507):
32
+ * its adopted feed is one more listener in a shared lookup, not a DOM listener, and `pointer(target)`,
33
+ * every other target's, subscribes none.
34
+ *
35
+ * A scroll moves a Held pointer (ADR-0019, *Amendment (Reorder)*): while one is held,
36
+ * the target's scroll feed reports the scroll of each of its scrollable ancestors and
37
+ * of its window, and `InputSource.heldPointer` turns each change into a move of the pointer
38
+ * shifted by it. Two passive `scroll` listeners on the target's window come with the
39
+ * hold and go at its release: one in the capture phase for element scrolls (they don't
40
+ * bubble), one for the window's own. Nothing listens for scroll at rest. The feed also
41
+ * keeps each held target's total shift, for the auto-scroller ({@link heldScrollShift}).
42
+ *
43
+ * Observability (CONTEXT.md observability convention): a consumer (a recognizer) carries the
44
+ * subscribe span and log; the per-event mapping path is deliberately unlogged — it is the hot
45
+ * path.
46
+ */
47
+ import * as InputFeed from "@wardic/core/InputFeed";
48
+ import * as InputSource from "@wardic/core/InputSource";
49
+ import * as Arr from "effect/Array";
50
+ import * as Bool from "effect/Boolean";
51
+ import * as Effect from "effect/Effect";
52
+ import { constTrue, constVoid, identity } from "effect/Function";
53
+ import * as Layer from "effect/Layer";
54
+ import * as Match from "effect/Match";
55
+ import * as Option from "effect/Option";
56
+ import * as Predicate from "effect/Predicate";
57
+ import * as UndefinedOr from "effect/UndefinedOr";
58
+ import { scrollersOf } from "./scrollers.js";
59
+ import { requireGlobal } from "./require-global.js";
60
+ /** DOM `pointer*` type → the engine's portable phase. */
61
+ const POINTER_TYPE = {
62
+ pointerdown: "down",
63
+ pointermove: "move",
64
+ pointerup: "up",
65
+ pointercancel: "cancel",
66
+ pointerenter: "enter",
67
+ pointerleave: "leave",
68
+ };
69
+ const POINTER_EVENTS = Object.keys(POINTER_TYPE);
70
+ /**
71
+ * The page-wide events while a pointer is held: its moves, release and cancel, and any
72
+ * down, which ends a hold whose release was lost (ADR-0019, decision 7).
73
+ */
74
+ const HELD_POINTER_EVENTS = ["pointermove", "pointerup", "pointercancel", "pointerdown"];
75
+ /** A `PointerEvent.pointerType` as core's pointer kind: the DOM's three, else `"other"`. */
76
+ // A **Pointer kind** (ADR-0036, *Amendment (#189)*). Built once, read per input event: `Match.value`
77
+ // would build its matcher again each event, 69 ns against 10 (#618, H1).
78
+ export const kindOf = /*#__PURE__*/ Match.type().pipe(Match.when("mouse", () => "mouse"), Match.when("pen", () => "pen"), Match.when("touch", () => "touch"), Match.orElse(() => "other"));
79
+ /**
80
+ * A `PointerEvent.button` in core's names: 0 the main button, 1 the middle, 2 the secondary, -1 none, as
81
+ * on a move, and the rest, back, forward, a pen's eraser, other.
82
+ */
83
+ // ADR-0036, *Amendment (#189)*. Built once, as `kindOf` (#618, H1).
84
+ export const buttonOf = /*#__PURE__*/ Match.type().pipe(Match.when(0, () => "main"), Match.when(1, () => "middle"), Match.when(2, () => "secondary"), Match.when(-1, () => "none"), Match.orElse(() => "other"));
85
+ /** A feed's answer as a {@link Where}: per input event, a statement. */
86
+ const whereOf = (onTarget) => {
87
+ if (onTarget)
88
+ return "target";
89
+ return "elsewhere";
90
+ };
91
+ /**
92
+ * A DOM `PointerEvent` as core's pointer event: at its point in the viewport, with no scroll counted
93
+ * (`InputSource.heldPointer` counts it), and where it landed as its feed says: on the feed's target, or
94
+ * elsewhere.
95
+ */
96
+ // ADR-0036, *Amendment (#189)*; #257. `where`, not a trailing boolean (#618, F7).
97
+ export const toPointer = (type, ev, where = "target") => ({
98
+ type,
99
+ pointerId: UndefinedOr.match(ev.pointerId, { onUndefined: () => 1, onDefined: identity }),
100
+ x: ev.clientX,
101
+ y: ev.clientY,
102
+ pressed: ev.buttons !== 0,
103
+ timeStamp: ev.timeStamp,
104
+ kind: kindOf(ev.pointerType),
105
+ button: buttonOf(ev.button),
106
+ primary: ev.isPrimary,
107
+ scroll: InputSource.NO_SCROLL,
108
+ onTarget: where === "target",
109
+ // The DOM's own event, for an app's gesture callback (#273).
110
+ raw: ev,
111
+ });
112
+ /**
113
+ * A {@link PointerFeed} of `types` on `target`: each DOM event emitted as its
114
+ * Like-event with the DOM event as `raw`; the returned function removes the listeners.
115
+ * `onTargetOf` says whether an event landed on the element the stream is for (#257): the
116
+ * target's own feed's always do; the page-wide feed's say.
117
+ */
118
+ const feedOf = (target, types, options, onTargetOf = constTrue) => (emit) => {
119
+ const listener = (ev) => emit(toPointer(UndefinedOr.getOrThrow(POINTER_TYPE[ev.type]), ev, whereOf(onTargetOf(ev))), ev);
120
+ Arr.forEach(types, (type) => target.addEventListener(type, listener, options));
121
+ return () => Arr.forEach(types, (type) => target.removeEventListener(type, listener, options));
122
+ };
123
+ /** Whether a page-wide event landed on `target` or inside it (#257, Motion's `isNodeOrChild`). */
124
+ const landedOn = (target) => (ev) => Bool.and(isNode(target), isNode(ev.target)) && target.contains(ev.target);
125
+ /** Whether `value` is a DOM node (by `nodeType`, so an iframe's nodes count too). */
126
+ const isNode = (value) => Predicate.isObjectOrArray(value) && Predicate.isNumber(value.nodeType);
127
+ /** The window an element's page-wide events reach: its own document's (an iframe's element has its own), else the page's. */
128
+ const windowOf = (target) => Option.getOrElse(Option.flatMap(Option.flatMap(asKey(target), (key) => Option.fromNullishOr(key.ownerDocument)), (doc) => Option.fromNullishOr(doc.defaultView)), () => window);
129
+ /** `target` as a WeakMap key: an object, not a primitive. */
130
+ const asKey = (target) => Option.liftPredicate(target, Predicate.isObjectOrArray);
131
+ /** Whether `target` is an element (by `nodeType`, so an iframe's elements count too). */
132
+ const isElement = (target) => Predicate.isObjectOrArray(target) && target.nodeType === 1;
133
+ /** The downs adopted for `target` (#431): `heldPointer`'s `adopted` feed. */
134
+ const adoptedFeedOf = (adopters, target) => (emit) => {
135
+ const key = asKey(target);
136
+ if (Option.isNone(key))
137
+ return constVoid;
138
+ const listeners = Option.getOrElse(Option.fromUndefinedOr(adopters.get(key.value)), () => new Set());
139
+ listeners.add(emit);
140
+ adopters.set(key.value, listeners);
141
+ return () => {
142
+ listeners.delete(emit);
143
+ if (listeners.size === 0)
144
+ adopters.delete(key.value);
145
+ };
146
+ };
147
+ /** Whether `raw` is a `PointerEvent` with a button pressed: one a target can adopt (#431). */
148
+ const isPressedPointer = (raw) => Bool.and(Predicate.hasProperty(raw, "pointerId"), Predicate.hasProperty(raw, "buttons")) && raw.buttons !== 0;
149
+ /**
150
+ * Hand `raw` to `target`'s pointer feed as an adopted down (#431): at its viewport point, on the target
151
+ * if it landed there. `undefined`, delivering nothing, for what isn't a pressed pointer's event.
152
+ */
153
+ const adoptPointerIn = (adopters) => (target, raw) => {
154
+ if (isPressedPointer(raw))
155
+ return Option.some(adopt(adopters, target, raw));
156
+ return Option.none();
157
+ };
158
+ /** {@link adoptPointerIn} of a pressed pointer's event. */
159
+ const adopt = (adopters, target, raw) => {
160
+ const down = toPointer("down", raw, whereOf(landedOn(target)(raw)));
161
+ Option.match(Option.flatMap(asKey(target), (key) => Option.fromUndefinedOr(adopters.get(key))), {
162
+ onNone: constVoid,
163
+ onSome: (listeners) => Arr.forEach(Arr.fromIterable(listeners), (emit) => emit(down, raw)),
164
+ });
165
+ return { ...down, adopted: true };
166
+ };
167
+ const CAPTURE_PASSIVE = { capture: true, passive: true };
168
+ const PASSIVE = { passive: true };
169
+ const ZERO = { x: 0, y: 0 };
170
+ /** Each held target's scroll since its hold began, while it's held (Q1: one per hold). */
171
+ // Module state (#460, Q7): each held target's scroll since its hold began, held weakly by the target,
172
+ // which one Environment holds at a time; the auto-scroller reads it beside the input.
173
+ const heldShifts = new WeakMap();
174
+ /**
175
+ * The scroll since `target`'s current hold began, summed over its window and its
176
+ * scrollable ancestors: a held drag's point minus this is the pointer's viewport
177
+ * position. `{ x: 0, y: 0 }` when nothing is held on it.
178
+ *
179
+ * @internal for the auto-scroller.
180
+ */
181
+ export const heldScrollShift = (target) => Option.getOrElse(Option.flatMap(asKey(target), (key) => Option.fromUndefinedOr(heldShifts.get(key))), () => ZERO);
182
+ /**
183
+ * The {@link ScrollFeed} of a pointer target: its scrollable ancestors' scroll
184
+ * (`scrollLeft`/`scrollTop`) and its window's (`scrollX`/`scrollY`), stopping at a
185
+ * `position: fixed` element (no scroll outside it moves the target). On subscribe it
186
+ * reports each one's current position, then listens on the target's window: a
187
+ * capture-phase listener for element scrolls (only the tracked ancestors report) and
188
+ * one for the window's own scroll (the document's scroll event reaches the capture
189
+ * listener too, so only this one reports it).
190
+ */
191
+ const scrollFeedOf = (target) => (emit) => {
192
+ const win = windowOf(target);
193
+ const doc = win.document;
194
+ const last = new Map();
195
+ const shift = { x: 0, y: 0 };
196
+ const key = asKey(target);
197
+ if (Option.isSome(key))
198
+ heldShifts.set(key.value, shift);
199
+ const report = (source, x, y, timeStamp) => {
200
+ Option.match(Option.fromUndefinedOr(last.get(source)), {
201
+ onNone: () => {
202
+ last.set(source, { x, y });
203
+ },
204
+ onSome: (prev) => {
205
+ shift.x += x - prev.x;
206
+ shift.y += y - prev.y;
207
+ prev.x = x;
208
+ prev.y = y;
209
+ },
210
+ });
211
+ emit(source, { x, y }, timeStamp);
212
+ };
213
+ // The positions at subscribe are the baselines (no event, so no time). Inside a
214
+ // `position: fixed` element only the scrollers up to it move the target, and the
215
+ // page doesn't.
216
+ const scrollers = Option.match(Option.liftPredicate(target, isElement), {
217
+ onNone: () => ({ ancestors: [], page: true }),
218
+ onSome: scrollersOf,
219
+ });
220
+ Arr.forEach(scrollers.ancestors, (el) => report(el, el.scrollLeft, el.scrollTop, 0));
221
+ if (scrollers.page)
222
+ report(win, win.scrollX, win.scrollY, 0);
223
+ const onElement = (ev) => {
224
+ const el = ev.target;
225
+ if (el === doc || !last.has(el))
226
+ return;
227
+ report(el, el.scrollLeft, el.scrollTop, ev.timeStamp);
228
+ };
229
+ const onWindow = (ev) => {
230
+ if ((ev.target !== doc && ev.target !== win) || !last.has(win))
231
+ return;
232
+ report(win, win.scrollX, win.scrollY, ev.timeStamp);
233
+ };
234
+ win.addEventListener("scroll", onElement, CAPTURE_PASSIVE);
235
+ win.addEventListener("scroll", onWindow, PASSIVE);
236
+ return () => {
237
+ win.removeEventListener("scroll", onElement, CAPTURE_PASSIVE);
238
+ win.removeEventListener("scroll", onWindow, PASSIVE);
239
+ if (Option.isSome(key) && heldShifts.get(key.value) === shift)
240
+ heldShifts.delete(key.value);
241
+ };
242
+ };
243
+ /**
244
+ * Whether a focus shows (#273, Motion's `whileFocus`): its target matches `:focus-visible`, which a
245
+ * keyboard's focus does and a pointer's click on most elements doesn't. A browser that doesn't know the
246
+ * selector shows every focus, as Motion reads it.
247
+ */
248
+ const focusVisible = (target) => {
249
+ if (Bool.not(Predicate.hasProperty(target, "matches")))
250
+ return true;
251
+ try {
252
+ return target.matches(":focus-visible");
253
+ }
254
+ catch {
255
+ return true;
256
+ }
257
+ };
258
+ /** A `KeyboardEvent.key` in core's names: the keys core acts on, else `"other"`. */
259
+ // ADR-0037. Built once, as `kindOf` (#618, H1).
260
+ export const keyOf = /*#__PURE__*/ Match.type().pipe(Match.when(" ", () => "space"), Match.when("Enter", () => "enter"), Match.when("Escape", () => "escape"), Match.when("ArrowLeft", () => "left"), Match.when("ArrowRight", () => "right"), Match.when("ArrowUp", () => "up"), Match.when("ArrowDown", () => "down"), Match.when("Home", () => "home"), Match.when("End", () => "end"), Match.orElse(() => "other"));
261
+ /** The `<input>` types that act on a key themselves (#427): every other type is typed into. */
262
+ const ACTING_INPUTS = new Set(["button", "submit", "reset", "image", "checkbox", "radio", "color", "file", "range"]);
263
+ /** Elements that act on Enter and Space themselves (#427): a button's click, a disclosure's toggle, a list's opening. */
264
+ const ACTING_ELEMENTS = new Set(["BUTTON", "SUMMARY", "SELECT"]);
265
+ const TYPES_BOTH = { enter: "type", space: "type" };
266
+ const ACTS_ON_BOTH = { enter: "activate", space: "activate" };
267
+ /** A text field: Space is typed, Enter submits its form. */
268
+ const TEXT_FIELD = { enter: "activate", space: "type" };
269
+ /** A link: Enter follows it, Space scrolls the page. */
270
+ const LINK = { enter: "activate", space: "none" };
271
+ const ACTS_ON_NEITHER = { enter: "none", space: "none" };
272
+ /** What `el` does with Enter and Space itself (#427), from what it is. */
273
+ const keyActionsOf = (el) => {
274
+ if (Bool.or(el.isContentEditable === true, el.tagName === "TEXTAREA"))
275
+ return TYPES_BOTH;
276
+ if (el.tagName === "INPUT")
277
+ return Bool.match(ACTING_INPUTS.has(el.type), { onTrue: () => ACTS_ON_BOTH, onFalse: () => TEXT_FIELD });
278
+ if (ACTING_ELEMENTS.has(el.tagName))
279
+ return ACTS_ON_BOTH;
280
+ if (Bool.and(el.tagName === "A", el.hasAttribute("href")))
281
+ return LINK;
282
+ return ACTS_ON_NEITHER;
283
+ };
284
+ /**
285
+ * What a key's own target does with it (#427, core's `KeyAction`): Enter's and Space's, from the
286
+ * element they came from; nothing for any other key, which no **Keyboard press** reads.
287
+ */
288
+ // Per key event: statements, no matcher or Option built each time (#618, H1).
289
+ const keyActionOf = (key, at) => {
290
+ if (Bool.and(key !== "enter", key !== "space"))
291
+ return "none";
292
+ if (isElement(at)) {
293
+ const actions = keyActionsOf(at);
294
+ if (key === "enter")
295
+ return actions.enter;
296
+ return actions.space;
297
+ }
298
+ return "none";
299
+ };
300
+ /** The HTML elements that take the keyboard's focus of themselves (#427): a link only with its `href`. */
301
+ const FOCUSABLE_ELEMENTS = new Set(["BUTTON", "INPUT", "SELECT", "TEXTAREA", "SUMMARY", "IFRAME"]);
302
+ /** Whether `el` takes focus of itself: a control, a link, an editable region, or one given a `tabindex`. */
303
+ const takesFocus = (el) => Bool.some([
304
+ FOCUSABLE_ELEMENTS.has(el.tagName),
305
+ Bool.and(Bool.or(el.tagName === "A", el.tagName === "AREA"), el.hasAttribute("href")),
306
+ el.isContentEditable,
307
+ el.hasAttribute("tabindex"),
308
+ ]);
309
+ /**
310
+ * Makes a pressable element focusable, as Motion's press does: an HTML element that doesn't take focus
311
+ * of itself, with no `tabindex`, gets `tabindex="0"`, so a key can press it. An SVG element, or one
312
+ * already focusable, is left as it is. Called at mount, on the client.
313
+ */
314
+ // #427: a **Keyboard press**.
315
+ export const makeFocusable = (target) => {
316
+ if (Bool.not(Predicate.hasProperty(target, "isContentEditable")))
317
+ return;
318
+ const el = target;
319
+ if (takesFocus(el))
320
+ return;
321
+ el.tabIndex = 0;
322
+ };
323
+ /** A key as the engine's portable event: core's key name, and the page's `preventDefault` as `handled`/`handle()`. */
324
+ const toKeyboard = (type, ev, target) => {
325
+ const key = keyOf(ev.key);
326
+ return {
327
+ type,
328
+ key,
329
+ repeat: ev.repeat,
330
+ timeStamp: ev.timeStamp,
331
+ fromTarget: ev.target === target,
332
+ handled: ev.defaultPrevented,
333
+ handle: () => ev.preventDefault(),
334
+ action: keyActionOf(key, ev.target),
335
+ raw: ev,
336
+ };
337
+ };
338
+ /** A `keydown` or `keyup` as the engine's portable phase. */
339
+ const keyTypeOf = (ev) => Bool.match(ev.type === "keydown", { onTrue: () => "down", onFalse: () => "up" });
340
+ /** Keys (#439): in the bubble phase, so after the page's own handlers, where a key's `handle()` still counts. */
341
+ const KEYS = { types: ["keydown", "keyup"], capture: false, windows: new WeakMap() };
342
+ /**
343
+ * Focus changes (#460): `focusin` and `focusout`, which a target's own focus and blur and those inside
344
+ * it both fire, in the capture phase, so no page handler stops them first. One listener a window
345
+ * where each target added four of its own.
346
+ */
347
+ const FOCUS = { types: ["focusin", "focusout"], capture: true, windows: new WeakMap() };
348
+ /**
349
+ * `win`'s targets for `kind`, its listener added with the first (#439): an event goes to the targets it
350
+ * passed through innermost first, its path's order, as a pointer's down bubbles, so a press inside
351
+ * marks a key in core's **Press claims** before its ancestors read it. A listener for each target would
352
+ * run in the order the targets came.
353
+ */
354
+ const pathWindowOf = (kind, win) => UndefinedOr.match(kind.windows.get(win), {
355
+ onDefined: identity,
356
+ onUndefined: () => {
357
+ const targets = new Map();
358
+ const listener = (ev) => Arr.forEach(ev.composedPath(), (node) => UndefinedOr.map(targets.get(node), (deliveries) => Arr.forEach(Arr.fromIterable(deliveries), (deliver) => deliver(ev))));
359
+ Arr.forEach(kind.types, (type) => win.addEventListener(type, listener, kind.capture));
360
+ const made = { targets, listener };
361
+ kind.windows.set(win, made);
362
+ return made;
363
+ },
364
+ });
365
+ /**
366
+ * `delivery` handed `kind`'s events on `target`'s window that pass through `target` (#439, #460), until
367
+ * the function returned stops it; the window's listener goes once no target there is left.
368
+ */
369
+ const deliverAlong = (kind, target, delivery) => {
370
+ const win = windowOf(target);
371
+ const path = pathWindowOf(kind, win);
372
+ const el = target;
373
+ const deliveries = UndefinedOr.match(path.targets.get(el), {
374
+ onDefined: identity,
375
+ onUndefined: () => {
376
+ const made = new Set();
377
+ path.targets.set(el, made);
378
+ return made;
379
+ },
380
+ });
381
+ deliveries.add(delivery);
382
+ return () => {
383
+ deliveries.delete(delivery);
384
+ if (deliveries.size === 0)
385
+ path.targets.delete(el);
386
+ if (path.targets.size > 0)
387
+ return;
388
+ Arr.forEach(kind.types, (type) => win.removeEventListener(type, path.listener, kind.capture));
389
+ kind.windows.delete(win);
390
+ };
391
+ };
392
+ /**
393
+ * The keys at `target` or inside it (ADR-0037): `keydown`/`keyup` on its window, in the bubble
394
+ * phase, so after the page's own handlers, handed to the targets a key passed through innermost first
395
+ * (#439). An **Input feed** (#318): each key reaches its consumer inside the dispatch (ADR-0032), where
396
+ * its `handle()` still counts.
397
+ */
398
+ const keyboardOf = (target) => (emit) => deliverAlong(KEYS, target, (ev) => emit(toKeyboard(keyTypeOf(ev), ev, target)));
399
+ /**
400
+ * `target`'s focus and blur, as an **Input feed** (#318), and since #439 those inside it, with
401
+ * `fromTarget: false`, so a **Keyboard press** that reached an ancestor from inside is cancelled when
402
+ * focus leaves the element its key came from. Since #460 `focusin` and `focusout` on its window, handed
403
+ * to the targets on their path ({@link FOCUS}): a target's own is the one whose path starts at it.
404
+ */
405
+ const focusOf = (target) => (emit) => deliverAlong(FOCUS, target, (ev) => emit(toPathFocus(ev, target)));
406
+ /**
407
+ * A `focusin` or `focusout` as `target`'s focus or blur (#460): its own when the event's path starts at
408
+ * it, which shadow roots don't hide as they do `ev.target`, and shown as the element focus moved to or
409
+ * from shows it.
410
+ */
411
+ const toPathFocus = (ev, target) => {
412
+ const origin = UndefinedOr.match(ev.composedPath()[0], { onUndefined: () => ev.target, onDefined: identity });
413
+ return {
414
+ type: Bool.match(ev.type === "focusin", { onTrue: () => "focus", onFalse: () => "blur" }),
415
+ timeStamp: ev.timeStamp,
416
+ visible: focusVisible(origin),
417
+ fromTarget: origin === target,
418
+ raw: ev,
419
+ };
420
+ };
421
+ /**
422
+ * Whether focus is on `target` or inside it (#460, core's `InputSource.focusWithin`): the active element
423
+ * of its root, its document or its shadow root, is it or inside it. A focus deeper in a shadow root
424
+ * inside it shows there as that root's host. A target that isn't a node has no focus.
425
+ */
426
+ const focusWithin = (target) => {
427
+ if (Bool.not(isNode(target)))
428
+ return false;
429
+ const active = target.getRootNode().activeElement;
430
+ if (Predicate.isNullish(active))
431
+ return false;
432
+ return target.contains(active);
433
+ };
434
+ /**
435
+ * The DOM's **Input feeds** (#318): each shared per target by core's `InputFeed.byTarget`, so a
436
+ * target's hover, press and drag start one listener-set, not three. `pointer`'s target, page-wide
437
+ * and scroll feeds go through core's `InputSource.heldPointer` (one ordered emit).
438
+ */
439
+ const make = Effect.gen(function* () {
440
+ // Client-only (ADR-0021, decision 7): every feed below is built on a live document.
441
+ yield* requireGlobal("DomInput.layer", "document");
442
+ // The Environment's adopted downs (#431): its own, not the module's, so two Environments on a page
443
+ // don't hear each other's (#618, F5).
444
+ const adopters = new WeakMap();
445
+ const pointer = InputFeed.byTarget((target) => InputSource.heldPointer({
446
+ target: feedOf(target, POINTER_EVENTS),
447
+ global: feedOf(windowOf(target), HELD_POINTER_EVENTS, CAPTURE_PASSIVE, landedOn(target)),
448
+ scroll: scrollFeedOf(target),
449
+ }));
450
+ // A target given Drag controls (#431, #507): the same Held pointer, with the downs handed to it.
451
+ const adoptablePointer = InputFeed.byTarget((target) => InputSource.heldPointer({
452
+ target: feedOf(target, POINTER_EVENTS),
453
+ adopted: adoptedFeedOf(adopters, target),
454
+ global: feedOf(windowOf(target), HELD_POINTER_EVENTS, CAPTURE_PASSIVE, landedOn(target)),
455
+ scroll: scrollFeedOf(target),
456
+ }));
457
+ const focus = InputFeed.byTarget(focusOf);
458
+ const keyboard = InputFeed.byTarget(keyboardOf);
459
+ return InputSource.InputSource.of({
460
+ pointer,
461
+ adoptablePointer,
462
+ focus,
463
+ keyboard,
464
+ focusWithin,
465
+ adoptPointer: adoptPointerIn(adopters),
466
+ });
467
+ });
468
+ /**
469
+ * Core's `InputSource` on the DOM's events: each target's pointer, keys and focus, shared by everyone
470
+ * who listens to it, for as long as the Layer lives. Building it on a server fails, with an error that
471
+ * says it's client-only.
472
+ */
473
+ // Built with `Layer.effect`, so `make` runs in the layer's scope and the shared helpers' `RcMap`/`RcRef`
474
+ // caches live for the layer's lifetime. ADR-0021, decision 7.
475
+ export const InputDomLive = Layer.effect(InputSource.InputSource)(make);
476
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/internal/input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,WAAW,MAAM,0BAA0B,CAAA;AAEvD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAA;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAChE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,yDAAyD;AACzD,MAAM,YAAY,GAAyD;IACzE,WAAW,EAAE,MAAM;IACnB,WAAW,EAAE,MAAM;IACnB,SAAS,EAAE,IAAI;IACf,aAAa,EAAE,QAAQ;IACvB,YAAY,EAAE,OAAO;IACrB,YAAY,EAAE,OAAO;CACtB,CAAA;AAED,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;AAEhD;;;GAGG;AACH,MAAM,mBAAmB,GAAG,CAAC,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,CAAC,CAAA;AAExF,4FAA4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AE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,EAAE,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QACxF,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC;KAC7B,CAAC,CACH,CAAA;IACD,iGAAiG;IACjG,MAAM,gBAAgB,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,EAAE,CACrD,WAAW,CAAC,WAAW,CAAC;QACtB,MAAM,EAAE,MAAM,CAAC,MAAqB,EAAE,cAAc,CAAC;QACrD,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC;QACxC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,EAAE,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QACxF,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC;KAC7B,CAAC,CACH,CAAA;IACD,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;IACzC,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;IAE/C,OAAO,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;QAChC,OAAO;QACP,gBAAgB;QAChB,KAAK;QACL,QAAQ;QACR,WAAW;QACX,YAAY,EAAE,cAAc,CAAC,QAAQ,CAAC;KACvC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF;;;;GAIG;AACH,yGAAyG;AACzG,8DAA8D;AAC9D,MAAM,CAAC,MAAM,YAAY,GAAyC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAA"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The DOM Environment's Interpolators and registry (ADR-0035, ADR-0036): core's built-ins, with the
3
+ * DOM's colours (`cssColor`) before `unit` and the DOM's complex tier (`cssComplex`) in core's
4
+ * place, and the DOM's Key rules. `DomLive` provides the registry. Core names no CSS syntax; this is
5
+ * where the DOM's lives.
6
+ *
7
+ * @module
8
+ */
9
+ import * as Interpolator from "@wardic/core/Interpolator";
10
+ import * as InterpolatorRegistry from "@wardic/core/InterpolatorRegistry";
11
+ import * as Layer from "effect/Layer";
12
+ /**
13
+ * The DOM's kinds of value, in the order they're tried: core's number, array and unit, the DOM's colours
14
+ * before the unit, so `"#fff"` is a colour, and the DOM's complex values last.
15
+ */
16
+ export declare const interpolators: ReadonlyArray<Interpolator.Entry<any, any>>;
17
+ /** The DOM's `InterpolatorRegistry`: its kinds (`interpolators`) and its Key rules (`keyRules`). `DomLive` provides it. */
18
+ export declare const InterpolatorRegistryDomLive: Layer.Layer<InterpolatorRegistry.InterpolatorRegistry>;
19
+ //# sourceMappingURL=interpolators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpolators.d.ts","sourceRoot":"","sources":["../../src/internal/interpolators.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,YAAY,MAAM,2BAA2B,CAAA;AACzD,OAAO,KAAK,oBAAoB,MAAM,mCAAmC,CAAA;AACzE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAKrC;;;GAGG;AAEH,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAMrE,CAAA;AAED,2HAA2H;AAE3H,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,KAAK,CAAC,oBAAoB,CAAC,oBAAoB,CAE1C,CAAA"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The DOM Environment's Interpolators and registry (ADR-0035, ADR-0036): core's built-ins, with the
3
+ * DOM's colours (`cssColor`) before `unit` and the DOM's complex tier (`cssComplex`) in core's
4
+ * place, and the DOM's Key rules. `DomLive` provides the registry. Core names no CSS syntax; this is
5
+ * where the DOM's lives.
6
+ *
7
+ * @module
8
+ */
9
+ import * as Interpolator from "@wardic/core/Interpolator";
10
+ import * as InterpolatorRegistry from "@wardic/core/InterpolatorRegistry";
11
+ import * as Layer from "effect/Layer";
12
+ import { cssColor } from "./colors.js";
13
+ import { cssComplex } from "./complex.js";
14
+ import { keyRules } from "./key-rules.js";
15
+ /**
16
+ * The DOM's kinds of value, in the order they're tried: core's number, array and unit, the DOM's colours
17
+ * before the unit, so `"#fff"` is a colour, and the DOM's complex values last.
18
+ */
19
+ // As it was in core before ADR-0036.
20
+ export const interpolators = [
21
+ Interpolator.number,
22
+ Interpolator.array,
23
+ cssColor,
24
+ Interpolator.unit,
25
+ cssComplex,
26
+ ];
27
+ /** The DOM's `InterpolatorRegistry`: its kinds (`interpolators`) and its Key rules (`keyRules`). `DomLive` provides it. */
28
+ // ADR-0035.
29
+ export const InterpolatorRegistryDomLive = Layer.effect(InterpolatorRegistry.InterpolatorRegistry)(InterpolatorRegistry.make(interpolators, keyRules));
30
+ //# sourceMappingURL=interpolators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpolators.js","sourceRoot":"","sources":["../../src/internal/interpolators.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,YAAY,MAAM,2BAA2B,CAAA;AACzD,OAAO,KAAK,oBAAoB,MAAM,mCAAmC,CAAA;AACzE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC;;;GAGG;AACH,qCAAqC;AACrC,MAAM,CAAC,MAAM,aAAa,GAAgD;IACxE,YAAY,CAAC,MAAM;IACnB,YAAY,CAAC,KAAK;IAClB,QAAQ;IACR,YAAY,CAAC,IAAI;IACjB,UAAU;CACX,CAAA;AAED,2HAA2H;AAC3H,YAAY;AACZ,MAAM,CAAC,MAAM,2BAA2B,GAA2D,KAAK,CAAC,MAAM,CAC7G,oBAAoB,CAAC,oBAAoB,CAC1C,CAAC,oBAAoB,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,11 @@
1
+ import * as InterpolatorRegistry from "@wardic/core/InterpolatorRegistry";
2
+ /** `display` and `visibility`, turning to `none` or `hidden`, show their start until the run's last Frame. */
3
+ export declare const visibility: InterpolatorRegistry.KeyRule;
4
+ /**
5
+ * An empty end facing a complex value or a colour grows from, or goes back to, its Animatable none,
6
+ * and a shadow list blends shadow by shadow; the run's last Frame writes the target as given.
7
+ */
8
+ export declare const animatableNone: InterpolatorRegistry.KeyRule;
9
+ /** The DOM's Key rules, in the order they're asked. */
10
+ export declare const keyRules: ReadonlyArray<InterpolatorRegistry.KeyRule>;
11
+ //# sourceMappingURL=key-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-rules.d.ts","sourceRoot":"","sources":["../../src/internal/key-rules.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,oBAAoB,MAAM,mCAAmC,CAAA;AA8SzE,8GAA8G;AAC9G,eAAO,MAAM,UAAU,EAAE,oBAAoB,CAAC,OAO7C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,oBAAoB,CAAC,OAYjD,CAAA;AAED,uDAAuD;AACvD,eAAO,MAAM,QAAQ,EAAE,aAAa,CAAC,oBAAoB,CAAC,OAAO,CAAgC,CAAA"}