@wardic/dom 1.0.1 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/dist/Appear.d.ts +3 -2
  2. package/dist/Appear.d.ts.map +1 -1
  3. package/dist/Appear.js +4 -3
  4. package/dist/Appear.js.map +1 -1
  5. package/dist/DomProjectionSystem.js +3 -3
  6. package/dist/DomProjectionSystem.js.map +1 -1
  7. package/dist/FlushGate.d.ts +6 -6
  8. package/dist/FlushGate.d.ts.map +1 -1
  9. package/dist/FlushGate.js +11 -8
  10. package/dist/FlushGate.js.map +1 -1
  11. package/dist/ReorderController.js +3 -3
  12. package/dist/ReorderController.js.map +1 -1
  13. package/dist/Report.d.ts +1 -1
  14. package/dist/Report.d.ts.map +1 -1
  15. package/dist/Report.js +3 -2
  16. package/dist/Report.js.map +1 -1
  17. package/dist/Style.d.ts +2 -1
  18. package/dist/Style.d.ts.map +1 -1
  19. package/dist/Style.js +3 -1
  20. package/dist/Style.js.map +1 -1
  21. package/dist/TimelineValue.d.ts +18 -0
  22. package/dist/TimelineValue.d.ts.map +1 -0
  23. package/dist/TimelineValue.js +20 -0
  24. package/dist/TimelineValue.js.map +1 -0
  25. package/dist/index.d.ts +13 -5
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +10 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/internal/appear.d.ts +10 -4
  30. package/dist/internal/appear.d.ts.map +1 -1
  31. package/dist/internal/appear.js +18 -8
  32. package/dist/internal/appear.js.map +1 -1
  33. package/dist/internal/batch-handoff.d.ts +25 -0
  34. package/dist/internal/batch-handoff.d.ts.map +1 -0
  35. package/dist/internal/batch-handoff.js +64 -0
  36. package/dist/internal/batch-handoff.js.map +1 -0
  37. package/dist/internal/drag-defaults.js +4 -1
  38. package/dist/internal/drag-defaults.js.map +1 -1
  39. package/dist/internal/gate-environment.d.ts +4 -0
  40. package/dist/internal/gate-environment.d.ts.map +1 -0
  41. package/dist/internal/gate-environment.js +21 -0
  42. package/dist/internal/gate-environment.js.map +1 -0
  43. package/dist/internal/projection.d.ts.map +1 -1
  44. package/dist/internal/projection.js +22 -21
  45. package/dist/internal/projection.js.map +1 -1
  46. package/dist/internal/renderer.d.ts +13 -0
  47. package/dist/internal/renderer.d.ts.map +1 -1
  48. package/dist/internal/renderer.js +21 -0
  49. package/dist/internal/renderer.js.map +1 -1
  50. package/dist/internal/reorder.d.ts +2 -2
  51. package/dist/internal/reorder.d.ts.map +1 -1
  52. package/dist/internal/reorder.js +2 -2
  53. package/dist/internal/reorder.js.map +1 -1
  54. package/dist/internal/scroll.d.ts +17 -0
  55. package/dist/internal/scroll.d.ts.map +1 -1
  56. package/dist/internal/scroll.js +23 -15
  57. package/dist/internal/scroll.js.map +1 -1
  58. package/dist/internal/starting-style.d.ts +0 -83
  59. package/dist/internal/starting-style.d.ts.map +1 -1
  60. package/dist/internal/starting-style.js +16 -143
  61. package/dist/internal/starting-style.js.map +1 -1
  62. package/dist/internal/timeline.d.ts +56 -0
  63. package/dist/internal/timeline.d.ts.map +1 -0
  64. package/dist/internal/timeline.js +389 -0
  65. package/dist/internal/timeline.js.map +1 -0
  66. package/dist/unstable/AppearAnimations.d.ts +191 -0
  67. package/dist/unstable/AppearAnimations.d.ts.map +1 -0
  68. package/dist/unstable/AppearAnimations.js +561 -0
  69. package/dist/unstable/AppearAnimations.js.map +1 -0
  70. package/dist/unstable/BatchMembers.d.ts +513 -0
  71. package/dist/unstable/BatchMembers.d.ts.map +1 -0
  72. package/dist/unstable/BatchMembers.js +2490 -0
  73. package/dist/unstable/BatchMembers.js.map +1 -0
  74. package/dist/unstable/DomValues.d.ts +25 -0
  75. package/dist/unstable/DomValues.d.ts.map +1 -0
  76. package/dist/unstable/DomValues.js +45 -0
  77. package/dist/unstable/DomValues.js.map +1 -0
  78. package/dist/unstable/DragConstraints.d.ts +48 -0
  79. package/dist/unstable/DragConstraints.d.ts.map +1 -0
  80. package/dist/unstable/DragConstraints.js +49 -0
  81. package/dist/unstable/DragConstraints.js.map +1 -0
  82. package/dist/unstable/DragControls.d.ts +50 -0
  83. package/dist/unstable/DragControls.d.ts.map +1 -0
  84. package/dist/unstable/DragControls.js +55 -0
  85. package/dist/unstable/DragControls.js.map +1 -0
  86. package/dist/unstable/DragDefaults.d.ts +34 -0
  87. package/dist/unstable/DragDefaults.d.ts.map +1 -0
  88. package/dist/unstable/DragDefaults.js +47 -0
  89. package/dist/unstable/DragDefaults.js.map +1 -0
  90. package/dist/unstable/DragTrack.d.ts +236 -0
  91. package/dist/unstable/DragTrack.d.ts.map +1 -0
  92. package/dist/unstable/DragTrack.js +646 -0
  93. package/dist/unstable/DragTrack.js.map +1 -0
  94. package/dist/unstable/DragTransition.d.ts +22 -0
  95. package/dist/unstable/DragTransition.d.ts.map +1 -0
  96. package/dist/unstable/DragTransition.js +31 -0
  97. package/dist/unstable/DragTransition.js.map +1 -0
  98. package/dist/unstable/ElementSetup.d.ts +144 -0
  99. package/dist/unstable/ElementSetup.d.ts.map +1 -0
  100. package/dist/unstable/ElementSetup.js +297 -0
  101. package/dist/unstable/ElementSetup.js.map +1 -0
  102. package/dist/unstable/Feature.d.ts +221 -0
  103. package/dist/unstable/Feature.d.ts.map +1 -0
  104. package/dist/unstable/Feature.js +281 -0
  105. package/dist/unstable/Feature.js.map +1 -0
  106. package/dist/unstable/GestureFeatures.d.ts +30 -0
  107. package/dist/unstable/GestureFeatures.d.ts.map +1 -0
  108. package/dist/unstable/GestureFeatures.js +32 -0
  109. package/dist/unstable/GestureFeatures.js.map +1 -0
  110. package/dist/unstable/GestureInfo.d.ts +61 -0
  111. package/dist/unstable/GestureInfo.d.ts.map +1 -0
  112. package/dist/unstable/GestureInfo.js +23 -0
  113. package/dist/unstable/GestureInfo.js.map +1 -0
  114. package/dist/unstable/Imperative.d.ts +214 -0
  115. package/dist/unstable/Imperative.d.ts.map +1 -0
  116. package/dist/unstable/Imperative.js +768 -0
  117. package/dist/unstable/Imperative.js.map +1 -0
  118. package/dist/unstable/Instant.d.ts +46 -0
  119. package/dist/unstable/Instant.d.ts.map +1 -0
  120. package/dist/unstable/Instant.js +49 -0
  121. package/dist/unstable/Instant.js.map +1 -0
  122. package/dist/unstable/LayoutGroup.d.ts +14 -0
  123. package/dist/unstable/LayoutGroup.d.ts.map +1 -0
  124. package/dist/unstable/LayoutGroup.js +31 -0
  125. package/dist/unstable/LayoutGroup.js.map +1 -0
  126. package/dist/unstable/LayoutMember.d.ts +127 -0
  127. package/dist/unstable/LayoutMember.d.ts.map +1 -0
  128. package/dist/unstable/LayoutMember.js +176 -0
  129. package/dist/unstable/LayoutMember.js.map +1 -0
  130. package/dist/unstable/LiveStyle.d.ts +171 -0
  131. package/dist/unstable/LiveStyle.d.ts.map +1 -0
  132. package/dist/unstable/LiveStyle.js +329 -0
  133. package/dist/unstable/LiveStyle.js.map +1 -0
  134. package/dist/unstable/MemberHold.d.ts +3 -0
  135. package/dist/unstable/MemberHold.d.ts.map +1 -0
  136. package/dist/unstable/MemberHold.js +223 -0
  137. package/dist/unstable/MemberHold.js.map +1 -0
  138. package/dist/unstable/OwnerScope.d.ts +16 -0
  139. package/dist/unstable/OwnerScope.d.ts.map +1 -0
  140. package/dist/unstable/OwnerScope.js +35 -0
  141. package/dist/unstable/OwnerScope.js.map +1 -0
  142. package/dist/unstable/PresenceController.d.ts +128 -0
  143. package/dist/unstable/PresenceController.d.ts.map +1 -0
  144. package/dist/unstable/PresenceController.js +1427 -0
  145. package/dist/unstable/PresenceController.js.map +1 -0
  146. package/dist/unstable/Press.d.ts +26 -0
  147. package/dist/unstable/Press.d.ts.map +1 -0
  148. package/dist/unstable/Press.js +19 -0
  149. package/dist/unstable/Press.js.map +1 -0
  150. package/dist/unstable/ServerInterpolators.d.ts +17 -0
  151. package/dist/unstable/ServerInterpolators.d.ts.map +1 -0
  152. package/dist/unstable/ServerInterpolators.js +20 -0
  153. package/dist/unstable/ServerInterpolators.js.map +1 -0
  154. package/dist/unstable/WardConfig.d.ts +567 -0
  155. package/dist/unstable/WardConfig.d.ts.map +1 -0
  156. package/dist/unstable/WardConfig.js +2 -0
  157. package/dist/unstable/WardConfig.js.map +1 -0
  158. package/dist/unstable/features/All.d.ts +24 -0
  159. package/dist/unstable/features/All.d.ts.map +1 -0
  160. package/dist/unstable/features/All.js +20 -0
  161. package/dist/unstable/features/All.js.map +1 -0
  162. package/dist/unstable/features/Colors.d.ts +12 -0
  163. package/dist/unstable/features/Colors.d.ts.map +1 -0
  164. package/dist/unstable/features/Colors.js +38 -0
  165. package/dist/unstable/features/Colors.js.map +1 -0
  166. package/dist/unstable/features/DomAnimation.d.ts +16 -0
  167. package/dist/unstable/features/DomAnimation.d.ts.map +1 -0
  168. package/dist/unstable/features/DomAnimation.js +19 -0
  169. package/dist/unstable/features/DomAnimation.js.map +1 -0
  170. package/dist/unstable/features/DomMax.d.ts +12 -0
  171. package/dist/unstable/features/DomMax.d.ts.map +1 -0
  172. package/dist/unstable/features/DomMax.js +14 -0
  173. package/dist/unstable/features/DomMax.js.map +1 -0
  174. package/dist/unstable/features/Drag.d.ts +5 -0
  175. package/dist/unstable/features/Drag.d.ts.map +1 -0
  176. package/dist/unstable/features/Drag.js +32 -0
  177. package/dist/unstable/features/Drag.js.map +1 -0
  178. package/dist/unstable/features/Focus.d.ts +5 -0
  179. package/dist/unstable/features/Focus.d.ts.map +1 -0
  180. package/dist/unstable/features/Focus.js +20 -0
  181. package/dist/unstable/features/Focus.js.map +1 -0
  182. package/dist/unstable/features/Hover.d.ts +5 -0
  183. package/dist/unstable/features/Hover.d.ts.map +1 -0
  184. package/dist/unstable/features/Hover.js +20 -0
  185. package/dist/unstable/features/Hover.js.map +1 -0
  186. package/dist/unstable/features/InView.d.ts +5 -0
  187. package/dist/unstable/features/InView.d.ts.map +1 -0
  188. package/dist/unstable/features/InView.js +20 -0
  189. package/dist/unstable/features/InView.js.map +1 -0
  190. package/dist/unstable/features/Input.d.ts +28 -0
  191. package/dist/unstable/features/Input.d.ts.map +1 -0
  192. package/dist/unstable/features/Input.js +31 -0
  193. package/dist/unstable/features/Input.js.map +1 -0
  194. package/dist/unstable/features/Keys.d.ts +95 -0
  195. package/dist/unstable/features/Keys.d.ts.map +1 -0
  196. package/dist/unstable/features/Keys.js +44 -0
  197. package/dist/unstable/features/Keys.js.map +1 -0
  198. package/dist/unstable/features/Layout.d.ts +43 -0
  199. package/dist/unstable/features/Layout.d.ts.map +1 -0
  200. package/dist/unstable/features/Layout.js +44 -0
  201. package/dist/unstable/features/Layout.js.map +1 -0
  202. package/dist/unstable/features/Pan.d.ts +5 -0
  203. package/dist/unstable/features/Pan.d.ts.map +1 -0
  204. package/dist/unstable/features/Pan.js +20 -0
  205. package/dist/unstable/features/Pan.js.map +1 -0
  206. package/dist/unstable/features/Press.d.ts +13 -0
  207. package/dist/unstable/features/Press.d.ts.map +1 -0
  208. package/dist/unstable/features/Press.js +10 -0
  209. package/dist/unstable/features/Press.js.map +1 -0
  210. package/dist/unstable/features/Scroll.d.ts +20 -0
  211. package/dist/unstable/features/Scroll.d.ts.map +1 -0
  212. package/dist/unstable/features/Scroll.js +34 -0
  213. package/dist/unstable/features/Scroll.js.map +1 -0
  214. package/dist/unstable/features/TimelineKeys.d.ts +7 -0
  215. package/dist/unstable/features/TimelineKeys.d.ts.map +1 -0
  216. package/dist/unstable/features/TimelineKeys.js +103 -0
  217. package/dist/unstable/features/TimelineKeys.js.map +1 -0
  218. package/package.json +4 -3
  219. package/src/Appear.ts +4 -2
  220. package/src/DomProjectionSystem.ts +3 -3
  221. package/src/FlushGate.ts +15 -12
  222. package/src/ReorderController.ts +3 -3
  223. package/src/Report.ts +3 -7
  224. package/src/Style.ts +4 -1
  225. package/src/TimelineValue.ts +19 -0
  226. package/src/index.ts +15 -5
  227. package/src/internal/appear.ts +20 -8
  228. package/src/internal/batch-handoff.ts +75 -0
  229. package/src/internal/drag-defaults.ts +4 -4
  230. package/src/internal/gate-environment.ts +21 -0
  231. package/src/internal/projection.ts +22 -21
  232. package/src/internal/renderer.ts +22 -0
  233. package/src/internal/reorder.ts +4 -4
  234. package/src/internal/scroll.ts +32 -15
  235. package/src/internal/starting-style.ts +5 -204
  236. package/src/internal/timeline.ts +480 -0
  237. package/src/unstable/AppearAnimations.ts +837 -0
  238. package/src/unstable/BatchMembers.ts +3085 -0
  239. package/src/unstable/DomValues.ts +53 -0
  240. package/src/unstable/DragConstraints.ts +107 -0
  241. package/src/unstable/DragControls.ts +98 -0
  242. package/src/unstable/DragDefaults.ts +57 -0
  243. package/src/unstable/DragTrack.ts +959 -0
  244. package/src/unstable/DragTransition.ts +46 -0
  245. package/src/unstable/ElementSetup.ts +411 -0
  246. package/src/unstable/Feature.ts +494 -0
  247. package/src/unstable/GestureFeatures.ts +38 -0
  248. package/src/unstable/GestureInfo.ts +85 -0
  249. package/src/unstable/Imperative.ts +1037 -0
  250. package/src/unstable/Instant.ts +93 -0
  251. package/src/unstable/LayoutGroup.ts +36 -0
  252. package/src/unstable/LayoutMember.ts +319 -0
  253. package/src/unstable/LiveStyle.ts +497 -0
  254. package/src/unstable/MemberHold.ts +211 -0
  255. package/src/unstable/OwnerScope.ts +35 -0
  256. package/src/unstable/PresenceController.ts +1747 -0
  257. package/src/unstable/Press.ts +43 -0
  258. package/src/unstable/ServerInterpolators.ts +39 -0
  259. package/src/unstable/WardConfig.ts +704 -0
  260. package/src/unstable/features/All.ts +39 -0
  261. package/src/unstable/features/Colors.ts +40 -0
  262. package/src/unstable/features/DomAnimation.ts +19 -0
  263. package/src/unstable/features/DomMax.ts +14 -0
  264. package/src/unstable/features/Drag.ts +34 -0
  265. package/src/unstable/features/Focus.ts +21 -0
  266. package/src/unstable/features/Hover.ts +21 -0
  267. package/src/unstable/features/InView.ts +21 -0
  268. package/src/unstable/features/Input.ts +37 -0
  269. package/src/unstable/features/Keys.ts +124 -0
  270. package/src/unstable/features/Layout.ts +75 -0
  271. package/src/unstable/features/Pan.ts +21 -0
  272. package/src/unstable/features/Press.ts +21 -0
  273. package/src/unstable/features/Scroll.ts +35 -0
  274. package/src/unstable/features/TimelineKeys.ts +115 -0
  275. package/dist/internal/gate.d.ts +0 -188
  276. package/dist/internal/gate.d.ts.map +0 -1
  277. package/dist/internal/gate.js +0 -458
  278. package/dist/internal/gate.js.map +0 -1
  279. package/dist/internal/report.d.ts +0 -30
  280. package/dist/internal/report.d.ts.map +0 -1
  281. package/dist/internal/report.js +0 -60
  282. package/dist/internal/report.js.map +0 -1
  283. package/dist/internal/runner.d.ts +0 -21
  284. package/dist/internal/runner.d.ts.map +0 -1
  285. package/dist/internal/runner.js +0 -48
  286. package/dist/internal/runner.js.map +0 -1
  287. package/src/internal/gate.ts +0 -598
  288. package/src/internal/report.ts +0 -69
  289. package/src/internal/runner.ts +0 -64
@@ -0,0 +1,44 @@
1
+ import * as DomProjectionSystem from "../../DomProjectionSystem.js";
2
+ import * as FlushGate from "../../FlushGate.js";
3
+ import * as ProjectionSystem from "../../ProjectionSystem.js";
4
+ import * as Effect from "effect/Effect";
5
+ import * as Layer from "effect/Layer";
6
+ import * as UndefinedOr from "effect/UndefinedOr";
7
+ import * as Feature from "../Feature.js";
8
+ import * as LayoutMember from "../LayoutMember.js";
9
+ import * as Keys from "./Keys.js";
10
+ /**
11
+ * Layout animations: a provider's projection system, built once for the provider, over its
12
+ * flush gate and with its reduced motion and scale correctors. Every section with it shares it, as the
13
+ * projection tree is the page's: a `layoutId` pair in two sections still crossfades.
14
+ */
15
+ export const layout = {
16
+ name: "layout",
17
+ key: ProjectionSystem.ProjectionSystem,
18
+ // The engine, and what its Reorder controllers hear each Measure pass by, beside it (#618); and the
19
+ // code that makes a Wardic element's node on it, here so the base ships none (#746).
20
+ layer: /*#__PURE__*/ Layer.merge(
21
+ /*#__PURE__*/ Layer.effectContext(
22
+ /*#__PURE__*/ Effect.flatMap(FlushGate.FlushGate, (gate) => Effect.flatMap(Feature.ProjectionOptions, (options) => DomProjectionSystem.make(gate, options)))),
23
+ /*#__PURE__*/ Layer.succeed(Keys.ProjectionNodes, { optionsOf: LayoutMember.layoutOptionsOf, registrationOf: LayoutMember.registrationOf })),
24
+ };
25
+ /** What a component that brings `layout` asks its provider for: one list, so the provider joins it once. */
26
+ const BRINGS = [layout];
27
+ /**
28
+ * The projection system of `value`'s provider, its `layout` Feature built now if nothing has built it
29
+ * yet (#511, decision 12): what a component that brings it works with (`LayoutGroup`, `Reorder`,
30
+ * `createProjectionNode`), whatever its section has. A clear error during a server render, which builds
31
+ * none (ADR-0021).
32
+ */
33
+ export const projectionBrought = (value) => UndefinedOr.getOrThrowWith(Keys.projectionIn(value.features.build(BRINGS)), () => new Error("useWardicProjection: there is no projection system during a server render (ADR-0021)"));
34
+ /**
35
+ * The `layout` Feature's element code (#746), brought as {@link projectionBrought} brings the projection
36
+ * system, whose call comes first and gives a server render's error: what `createProjectionNode` registers through.
37
+ */
38
+ export const projectionNodesBrought = (value) => Keys.projectionNodesIn(value.features.build(BRINGS));
39
+ /** {@link projectionBrought}'s services, all of them: what a Reorder controller is built with (#618). */
40
+ export const layoutBrought = (value) => {
41
+ projectionBrought(value);
42
+ return value.features.build(BRINGS);
43
+ };
44
+ //# sourceMappingURL=Layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../../src/unstable/features/Layout.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,mBAAmB,MAAM,8BAA8B,CAAA;AACnE,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAA;AAG7D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,IAAI,MAAM,WAAW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;IACtF,iBAAiB,CAAC,KAAK,CAAC,CAAA;IACxB,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAoC,CAAA;AACxE,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type * as Feature from "../Feature.ts";
2
+ import * as Keys from "./Keys.ts";
3
+ /** Pan gestures: the pan callbacks. */
4
+ export declare const pan: Feature.Feature<Keys.PanGesture, Keys.PanGesture["Service"], "pan">;
5
+ //# sourceMappingURL=Pan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pan.d.ts","sourceRoot":"","sources":["../../../src/unstable/features/Pan.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAGjC,uCAAuC;AACvC,eAAO,MAAM,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,KAAK,CAInF,CAAA"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The **`pan` Feature** (#511, ADR-0067 decision 3): an element's pan (`onPan`, `onPanStart`, `onPanSessionStart`, `onPanEnd`; Solid 2's `"pan"` events), in a module of its own, so an app that
3
+ * never imports it ships none of it. Its top-level calls are marked pure, as every Feature module's are.
4
+ *
5
+ * Unstable, for Wardic's own packages: public, with no semver promise.
6
+ *
7
+ * @module
8
+ */
9
+ // Unstable: ADR-0071, decision 5. #672 (PR6-Q1): solid's `features/pan.ts`, moved to dom with the Features, for
10
+ // every DOM binding.
11
+ import * as DragRecognizer from "@wardic/core/DragRecognizer";
12
+ import * as Keys from "./Keys.js";
13
+ import * as Input from "./Input.js";
14
+ /** Pan gestures: the pan callbacks. */
15
+ export const pan = {
16
+ name: "pan",
17
+ key: Keys.PanGesture,
18
+ layer: /*#__PURE__*/ Input.gestureLayer(Keys.PanGesture, (source) => ({ watch: Input.withInput(source, DragRecognizer.watchPan) })),
19
+ };
20
+ //# sourceMappingURL=Pan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pan.js","sourceRoot":"","sources":["../../../src/unstable/features/Pan.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,gHAAgH;AAChH,qBAAqB;AACrB,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAA;AAE7D,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAEnC,uCAAuC;AACvC,MAAM,CAAC,MAAM,GAAG,GAAwE;IACtF,IAAI,EAAE,KAAK;IACX,GAAG,EAAE,IAAI,CAAC,UAAU;IACpB,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;CACpI,CAAA"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The **`press` Feature** (#511, ADR-0067 decision 3): an element's press, its Keyboard presses included (`whileTap`, `onTap…`; Solid 2's `"tap"` events), in a module of its own, so an app that
3
+ * never imports it ships none of it. Its top-level calls are marked pure, as every Feature module's are.
4
+ *
5
+ * Unstable, for Wardic's own packages: public, with no semver promise.
6
+ *
7
+ * @module
8
+ */
9
+ import type * as Feature from "../Feature.ts";
10
+ import * as Keys from "./Keys.ts";
11
+ /** Press gestures, a pointer's and the keyboard's: `whileTap` and the tap callbacks. */
12
+ export declare const press: Feature.Feature<Keys.PressGesture, Keys.PressGesture["Service"], "press">;
13
+ //# sourceMappingURL=Press.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Press.d.ts","sourceRoot":"","sources":["../../../src/unstable/features/Press.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAIjC,wFAAwF;AACxF,eAAO,MAAM,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,OAAO,CAI3F,CAAA"}
@@ -0,0 +1,10 @@
1
+ import * as Keys from "./Keys.js";
2
+ import * as Press from "../Press.js";
3
+ import * as Input from "./Input.js";
4
+ /** Press gestures, a pointer's and the keyboard's: `whileTap` and the tap callbacks. */
5
+ export const press = {
6
+ name: "press",
7
+ key: Keys.PressGesture,
8
+ layer: /*#__PURE__*/ Input.gestureLayer(Keys.PressGesture, (source) => ({ watch: Input.withInput(source, Press.watchPressOn) })),
9
+ };
10
+ //# sourceMappingURL=Press.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Press.js","sourceRoot":"","sources":["../../../src/unstable/features/Press.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AACpC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAEnC,wFAAwF;AACxF,MAAM,CAAC,MAAM,KAAK,GAA8E;IAC9F,IAAI,EAAE,OAAO;IACb,GAAG,EAAE,IAAI,CAAC,YAAY;IACtB,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;CACjI,CAAA"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The **`scroll` Feature** (#518, ADR-0067 *Amendment (#518)*, decision 5), in a module of its own: a
3
+ * container's scroll, which `createScroll` brings, so an app that reads no scroll ships none of the
4
+ * Environment's scroll code. With it, the Timeline values (#240): a value derived from the scroll by
5
+ * ranges alone, drawn by the browser with the scroll. Its top-level calls are marked pure, as every
6
+ * Feature module's are.
7
+ *
8
+ * Unstable, for Wardic's own packages: public, with no semver promise.
9
+ *
10
+ * @module
11
+ */
12
+ import * as ScrollSource from "@wardic/core/ScrollSource";
13
+ import * as Feature from "../Feature.ts";
14
+ /**
15
+ * A container's scroll, live, for the scroll-linked values. `createScroll` brings it, so an app doesn't
16
+ * give it. The Environment's `ScrollSource` when it gives one (`@wardic/test`'s `TestLive`), else the
17
+ * DOM's, built once per provider. Its Timeline values run where the browser has native scroll timelines.
18
+ */
19
+ export declare const scroll: Feature.Feature<ScrollSource.ScrollSource, ScrollSource.ScrollSource["Service"], "scroll">;
20
+ //# sourceMappingURL=Scroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Scroll.d.ts","sourceRoot":"","sources":["../../../src/unstable/features/Scroll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,YAAY,MAAM,2BAA2B,CAAA;AAGzD,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AAIxC;;;;GAIG;AAGH,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,QAAQ,CAO7G,CAAA"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The **`scroll` Feature** (#518, ADR-0067 *Amendment (#518)*, decision 5), in a module of its own: a
3
+ * container's scroll, which `createScroll` brings, so an app that reads no scroll ships none of the
4
+ * Environment's scroll code. With it, the Timeline values (#240): a value derived from the scroll by
5
+ * ranges alone, drawn by the browser with the scroll. Its top-level calls are marked pure, as every
6
+ * Feature module's are.
7
+ *
8
+ * Unstable, for Wardic's own packages: public, with no semver promise.
9
+ *
10
+ * @module
11
+ */
12
+ // Unstable: ADR-0071, decision 5. #672 (PR6-Q1): solid's `features/scroll.ts`, moved to dom with the Features, for
13
+ // every DOM binding.
14
+ import * as ScrollSource from "@wardic/core/ScrollSource";
15
+ import * as DomScrollSource from "../../DomScrollSource.js";
16
+ import * as Layer from "effect/Layer";
17
+ import * as Feature from "../Feature.js";
18
+ import * as Timelines from "@wardic/core/unstable/Timelines";
19
+ import * as TimelineKeys from "./TimelineKeys.js";
20
+ /**
21
+ * A container's scroll, live, for the scroll-linked values. `createScroll` brings it, so an app doesn't
22
+ * give it. The Environment's `ScrollSource` when it gives one (`@wardic/test`'s `TestLive`), else the
23
+ * DOM's, built once per provider. Its Timeline values run where the browser has native scroll timelines.
24
+ */
25
+ // #240 (ADR-0043 *Amendment (#240)*, decision 4): the `Timelines` service, which an element's spine finds
26
+ // among the provider's built Features.
27
+ export const scroll = {
28
+ name: "scroll",
29
+ key: ScrollSource.ScrollSource,
30
+ layer: /*#__PURE__*/ Layer.merge(
31
+ /*#__PURE__*/ Feature.fromEnvironmentOr(ScrollSource.ScrollSource, DomScrollSource.layer),
32
+ /*#__PURE__*/ Layer.sync(Timelines.Timelines)(TimelineKeys.makeTimelines)),
33
+ };
34
+ //# sourceMappingURL=Scroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Scroll.js","sourceRoot":"","sources":["../../../src/unstable/features/Scroll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,mHAAmH;AACnH,qBAAqB;AACrB,OAAO,KAAK,YAAY,MAAM,2BAA2B,CAAA;AACzD,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAA;AAC3D,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,SAAS,MAAM,iCAAiC,CAAA;AAC5D,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;;;GAIG;AACH,0GAA0G;AAC1G,uCAAuC;AACvC,MAAM,CAAC,MAAM,MAAM,GAA+F;IAChH,IAAI,EAAE,QAAQ;IACd,GAAG,EAAE,YAAY,CAAC,YAAY;IAC9B,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,KAAK;IAC9B,aAAa,CAAC,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,YAAY,EAAE,eAAe,CAAC,KAAK,CAAC;IACzF,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,CAC1E;CACF,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type * as Timelines from "@wardic/core/unstable/Timelines";
2
+ /**
3
+ * A provider's {@link Timelines.Timelines}: each mounted element's keys, told again when a `createScroll`
4
+ * describes its values.
5
+ */
6
+ export declare const makeTimelines: () => Timelines.Timelines["Service"];
7
+ //# sourceMappingURL=TimelineKeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimelineKeys.d.ts","sourceRoot":"","sources":["../../../src/unstable/features/TimelineKeys.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,SAAS,MAAM,iCAAiC,CAAA;AAcjE;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAO,SAAS,CAAC,SAAS,CAAC,SAAS,CAY7D,CAAA"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * An element's **Timeline values** (#240, ADR-0043 *Amendment (#240)*), the `scroll` Feature's: a routed
3
+ * `style` key whose Live value core describes as derived from a container's scroll
4
+ * (`LiveValue.scrollDerivationOf`) gets the DOM's `TimelineValue`, handed to the gate while the key shows
5
+ * its Live value and taken back from it while anything else draws the key. Made again when what the key
6
+ * derives from changes: a new source in its `style`, or a `createScroll`'s new container.
7
+ *
8
+ * Unstable, for Wardic's own packages: public, with no semver promise.
9
+ *
10
+ * @module
11
+ */
12
+ // Unstable: ADR-0071, decision 5. #672 (PR6-Q1): solid's `features/timeline-keys.ts`, moved to dom with the Features, for
13
+ // every DOM binding.
14
+ import * as LiveValue from "@wardic/core/LiveValue";
15
+ import * as TimelineValue from "../../TimelineValue.js";
16
+ import * as Bool from "effect/Boolean";
17
+ import * as Option from "effect/Option";
18
+ import * as Predicate from "effect/Predicate";
19
+ /**
20
+ * A provider's {@link Timelines.Timelines}: each mounted element's keys, told again when a `createScroll`
21
+ * describes its values.
22
+ */
23
+ export const makeTimelines = () => {
24
+ const mounted = new Set();
25
+ return {
26
+ keysOf: (options) => {
27
+ const keys = elementKeysOf(options, () => mounted.delete(keys));
28
+ mounted.add(keys);
29
+ return keys;
30
+ },
31
+ described: () => {
32
+ mounted.forEach((keys) => keys.recheck());
33
+ },
34
+ };
35
+ };
36
+ /**
37
+ * An element's keys. `shown` runs at each write of a key's Live value, so per frame while it moves: a key
38
+ * shown already from the same source is left as it is, with nothing read but its source, statements and
39
+ * nothing made. What it derives from changes only where it's described anew, which `recheck` hears.
40
+ */
41
+ const elementKeysOf = (options, unmounted) => {
42
+ const { runtime, gate, id, live } = options;
43
+ // #672: the spine hands its Subject; a DOM binding's is its element, which a Timeline value follows.
44
+ const element = options.element;
45
+ const made = new Map();
46
+ // The keys that show their Live value, whatever runs them, each with the Atom it was shown from (none
47
+ // for a plain accessor's): the ones `recheck` looks at again.
48
+ const showing = new Map();
49
+ // The keys whose Timeline value the gate has, each with it.
50
+ const running = new Map();
51
+ /** `key`'s Timeline value now, made again when its derivation changed; `undefined` for none. */
52
+ const timelineOf = (key) => {
53
+ const atom = live.atomOf(key);
54
+ if (Predicate.isUndefined(atom))
55
+ return undefined;
56
+ const derivation = Option.getOrUndefined(LiveValue.scrollDerivationOf(atom));
57
+ if (Predicate.isUndefined(derivation))
58
+ return undefined;
59
+ const last = made.get(key);
60
+ if (Predicate.isNotUndefined(last)) {
61
+ if (last.derivation === derivation)
62
+ return last.timeline;
63
+ }
64
+ const timeline = Option.getOrUndefined(runtime.runSync(TimelineValue.make(derivation, element, key)));
65
+ made.set(key, { derivation, timeline });
66
+ return timeline;
67
+ };
68
+ /** The gate runs `key`'s Timeline value now, or none. */
69
+ const run = (key) => {
70
+ const timeline = timelineOf(key);
71
+ if (running.get(key) === timeline)
72
+ return;
73
+ gate.timeline(id, key, timeline);
74
+ if (Predicate.isUndefined(timeline)) {
75
+ running.delete(key);
76
+ return;
77
+ }
78
+ running.set(key, timeline);
79
+ };
80
+ return {
81
+ shown: (key) => {
82
+ const atom = live.atomOf(key);
83
+ if (showing.has(key)) {
84
+ if (showing.get(key) === atom)
85
+ return;
86
+ }
87
+ showing.set(key, atom);
88
+ run(key);
89
+ },
90
+ taken: (key) => {
91
+ showing.delete(key);
92
+ if (Bool.not(running.has(key)))
93
+ return;
94
+ running.delete(key);
95
+ gate.timeline(id, key, undefined);
96
+ },
97
+ recheck: () => {
98
+ showing.forEach((_, key) => run(key));
99
+ },
100
+ dispose: unmounted,
101
+ };
102
+ };
103
+ //# sourceMappingURL=TimelineKeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimelineKeys.js","sourceRoot":"","sources":["../../../src/unstable/features/TimelineKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,0HAA0H;AAC1H,qBAAqB;AACrB,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,aAAa,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAA;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAA;AAgB7C;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAmC,EAAE;IAChE,MAAM,OAAO,GAAG,IAAI,GAAG,EAAe,CAAA;IACtC,OAAO;QACL,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;YAClB,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;YAC/D,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YACjB,OAAO,IAA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C,GAAG,CAAC,GAAG,CAAC,CAAC;gBAAE,OAAM;YACtC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YACnB,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS,CAAC,CAAA;QACnC,CAAC;QACD,OAAO,EAAE,GAAG,EAAE;YACZ,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;QACvC,CAAC;QACD,OAAO,EAAE,SAAS;KACnB,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wardic/dom",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "The browser environment for Wardic: its clock, renderer, input, probe and projection system, as Effect Layers.",
5
5
  "keywords": [
6
6
  "animation",
@@ -55,13 +55,14 @@
55
55
  "typecheck:tests": "../../node_modules/typescript-7/bin/tsc -p tsconfig.test.json"
56
56
  },
57
57
  "dependencies": {
58
- "@wardic/core": "1.0.1",
58
+ "@wardic/core": "1.1.1",
59
+ "csstype": "^3.1.0",
59
60
  "culori": "^4.0.2"
60
61
  },
61
62
  "peerDependencies": {
62
63
  "effect": "^4.1.4"
63
64
  },
64
65
  "devDependencies": {
65
- "@wardic/test": "1.0.1"
66
+ "@wardic/test": "1.1.1"
66
67
  }
67
68
  }
package/src/Appear.ts CHANGED
@@ -8,7 +8,8 @@
8
8
  * timing is defined.
9
9
  * - **At mount:** `find` the element's animation, check it `matches` the client's own spec, start the run
10
10
  * `elapsedOf` it in (`Machine.startAt`), and `release` the element in the task that writes the engine's
11
- * first frame.
11
+ * first frame. Elements that hydrate together read their page once, with `findAll`, and each looks its
12
+ * own up in that read with `findIn`.
12
13
  * - **A Batch's members** (#706): `batchKeyframes` samples one rule for every member on one set of
13
14
  * transitions, each member's own values read from custom properties; a sheet's `batch` gives them one
14
15
  * slot, and each member its style. At the Handoff, `findAll` reads every member's animation in one call,
@@ -25,7 +26,7 @@
25
26
  * // At mount:
26
27
  * const elapsed = Option.map(Appear.find(element), Appear.elapsedOf)
27
28
  */
28
- // #48, ADR-0044: the **Handoff**. `@wardic/dom/Appear` (ADR-0041).
29
+ // #48, ADR-0044: the **Handoff**. `@wardic/dom/Appear` (ADR-0041). One read a page for a hydration's elements: #724.
29
30
  export {
30
31
  adoptChunks,
31
32
  animationOf,
@@ -39,6 +40,7 @@ export {
39
40
  elapsedOf,
40
41
  find,
41
42
  findAll,
43
+ findIn,
42
44
  keyframes,
43
45
  type Keyframes,
44
46
  matches,
@@ -19,7 +19,7 @@ import type * as Scope from "effect/Scope"
19
19
  import * as FlushGate from "./FlushGate.ts"
20
20
  import { PassEnds } from "./internal/pass-ends.ts"
21
21
  import * as internal from "./internal/projection.ts"
22
- import { makeRunner } from "./internal/runner.ts"
22
+ import * as WardicServices from "@wardic/core/unstable/WardicServices"
23
23
  import { ProjectionSystem, type Options, type Services, type Shape, type Sink } from "./ProjectionSystem.ts"
24
24
 
25
25
  /**
@@ -30,11 +30,11 @@ import { ProjectionSystem, type Options, type Services, type Shape, type Sink }
30
30
  // The context holds the internal `PassEnds` too (internal/pass-ends.ts, #618), the engine's own, so a
31
31
  // ProjectionSystem a binding wraps or replaces in its context still has its Reorder controller hear
32
32
  // each Measure pass. Its runner forks on Effect's default scheduler, whatever call built the Layer
33
- // (`internal/runner.ts`).
33
+ // (core's `unstable/WardicServices`).
34
34
  export const make: (sink: Sink, options?: Options) => Effect.Effect<Context.Context<ProjectionSystem | PassEnds>, never, Services | Scope.Scope> =
35
35
  /*#__PURE__*/ Effect.fnUntraced(function* (sink: Sink, options: Options = {}) {
36
36
  // Typed without `dispose` and `onPassEnd`: the Scope ends it, and `PassEnds` hands the other out.
37
- const system = internal.makeProjectionSystem(yield* makeRunner<Services>(), sink, options)
37
+ const system = internal.makeProjectionSystem(yield* WardicServices.makeRunner<Services>(), sink, options)
38
38
  yield* Effect.addFinalizer(() => Effect.sync(system.dispose))
39
39
  return Context.make(ProjectionSystem, system as Shape).pipe(Context.add(PassEnds, { onPassEnd: system.onPassEnd }))
40
40
  })
package/src/FlushGate.ts CHANGED
@@ -17,26 +17,28 @@
17
17
  // the Frame loop, cancels a pending frame and clears what it held. Its members are plain functions, called
18
18
  // per element and per frame. `make` is the scoped constructor, for a binding that wires it itself. `inert`
19
19
  // (ADR-0021, decision 9): a value for a binding whose server builds no runtime, or `layerInert` for one
20
- // whose server runs an Effect program.
20
+ // whose server runs an Effect program. #672: the gate itself is core's `unstable/FlushGate`; this module gives it
21
+ // the DOM's edges (`DOM_GATE`) and its service.
21
22
  import * as Context from "effect/Context"
22
23
  import * as Effect from "effect/Effect"
23
24
  import * as Layer from "effect/Layer"
24
25
  import * as Atom from "effect/reactivity/Atom"
25
26
  import type * as Scope from "effect/Scope"
26
- import * as internal from "./internal/gate.ts"
27
- import { makeRunner } from "./internal/runner.ts"
27
+ import * as CoreFlushGate from "@wardic/core/unstable/FlushGate"
28
+ import { DOM_GATE } from "./internal/gate-environment.ts"
29
+ import * as WardicServices from "@wardic/core/unstable/WardicServices"
28
30
 
29
31
  /** The gate: what a binding registers its elements with and writes their values into. */
30
- export type Shape = Omit<internal.FlushGate, "dispose">
32
+ export type Shape = CoreFlushGate.Shape
31
33
 
32
34
  /** An element's commit target and hooks, given to `register`. */
33
- export type Sink = internal.FlushSink
35
+ export type Sink = CoreFlushGate.Sink
34
36
 
35
37
  /** What a binding hands its gate: the `batch` a frame's Starting-style switches run in. */
36
- export type Options = internal.FlushGateOptions
38
+ export type Options = CoreFlushGate.FlushGateOptions
37
39
 
38
40
  /** The services a gate needs from its Environment. */
39
- export type Services = internal.FlushGateServices
41
+ export type Services = CoreFlushGate.FlushGateServices
40
42
 
41
43
  /** The Environment's Flush gate. */
42
44
  export class FlushGate extends Context.Service<FlushGate, Shape>()("@wardic/dom/FlushGate") {}
@@ -48,8 +50,8 @@ export class FlushGate extends Context.Service<FlushGate, Shape>()("@wardic/dom/
48
50
  export const make: (options: Options) => Effect.Effect<Shape, never, Services | Scope.Scope> = Effect.fnUntraced(
49
51
  function* (options: Options) {
50
52
  // The gate itself, typed without `dispose`: the Scope ends it. Its runner forks on Effect's
51
- // default scheduler, whatever call built the Layer (`internal/runner.ts`).
52
- const gate = internal.makeFlushGate(yield* makeRunner<Services>(), options)
53
+ // default scheduler, whatever call built the Layer (core's `unstable/WardicServices`).
54
+ const gate = CoreFlushGate.makeFlushGate(yield* WardicServices.makeRunner<Services>(), options, DOM_GATE)
53
55
  yield* Effect.addFinalizer(() => Effect.sync(gate.dispose))
54
56
  return gate
55
57
  })
@@ -60,7 +62,7 @@ export const layer = (options: Options): Layer.Layer<FlushGate, never, Services>
60
62
  const noop = (): void => {}
61
63
 
62
64
  /** What `inert`'s `valueOf` gives: an Atom that stays `undefined`, since nothing is committed on a server. */
63
- const NO_VALUE: Atom.Atom<unknown> = Atom.make<unknown>(undefined)
65
+ const NO_VALUE: Atom.Atom<unknown> = /*#__PURE__*/ Atom.make<unknown>(undefined)
64
66
 
65
67
  /**
66
68
  * The gate a server render gets: it flushes nothing, so `register` returns an unregister that does
@@ -68,14 +70,15 @@ const NO_VALUE: Atom.Atom<unknown> = Atom.make<unknown>(undefined)
68
70
  * at setup and uses it after mount keeps working on a server.
69
71
  */
70
72
  // ADR-0021, decision 9.
71
- export const inert: Shape = Object.freeze({
73
+ export const inert: Shape = /*#__PURE__*/ Object.freeze({
72
74
  register: () => noop,
73
75
  write: noop,
74
76
  flushPass: noop,
75
77
  release: noop,
76
78
  valueOf: () => NO_VALUE,
77
79
  afterFlush: noop,
80
+ timeline: noop,
78
81
  })
79
82
 
80
83
  /** `inert` as a Layer, for a binding whose server render runs an Effect program. */
81
- export const layerInert: Layer.Layer<FlushGate> = Layer.succeed(FlushGate, inert)
84
+ export const layerInert: Layer.Layer<FlushGate> = /*#__PURE__*/ Layer.succeed(FlushGate, inert)
@@ -29,7 +29,7 @@ import { constVoid } from "effect/Function"
29
29
  import type * as Scope from "effect/Scope"
30
30
  import { PassEnds } from "./internal/pass-ends.ts"
31
31
  import * as internal from "./internal/reorder.ts"
32
- import { makeRunner } from "./internal/runner.ts"
32
+ import * as WardicServices from "@wardic/core/unstable/WardicServices"
33
33
  import * as ProjectionSystem from "./ProjectionSystem.ts"
34
34
 
35
35
  export {
@@ -66,7 +66,7 @@ export const make: <V>(options: Options<V>) => Effect.Effect<ReorderController<V
66
66
  const passEnds = yield* PassEnds
67
67
  const announcer = yield* Announcer.Announcer
68
68
  const controller = internal.makeReorderController(
69
- { runtime: yield* makeRunner<never>(), layOut: () => projection.notify(), announce: announcer.announce, onLaidOut: passEnds.onPassEnd },
69
+ { runtime: yield* WardicServices.makeRunner<never>(), layOut: () => projection.notify(), announce: announcer.announce, onLaidOut: passEnds.onPassEnd },
70
70
  options,
71
71
  )
72
72
  yield* Effect.addFinalizer(() => Effect.sync(controller.dispose))
@@ -97,7 +97,7 @@ export const makePlaced: <V>(options: Options<V>) => Effect.Effect<Placed<V>, ne
97
97
  let laidOut: () => void = constVoid
98
98
  const controller = internal.makeReorderController(
99
99
  {
100
- runtime: yield* makeRunner<never>(),
100
+ runtime: yield* WardicServices.makeRunner<never>(),
101
101
  // The binding places its items on a change of `values` itself.
102
102
  layOut: constVoid,
103
103
  announce: announcer.announce,
package/src/Report.ts CHANGED
@@ -8,10 +8,6 @@
8
8
  *
9
9
  * yield* Report.failure("wardic: an animation failed", cause)
10
10
  */
11
- // `@wardic/dom/Report` (#132, ADR-0041): ADR-0030, decision 4.
12
- export {
13
- reportFailure as failure,
14
- debugKept,
15
- debugOf,
16
- type DebugLog,
17
- } from "./internal/report.ts"
11
+ // `@wardic/dom/Report` (#132, ADR-0041): ADR-0030, decision 4. Core's since #672 (ADR-0030's
12
+ // *Amendment (#672)*): the spine reports from core once it's lifted there; this stays its Tier 2 face.
13
+ export { failure, debugKept, debugOf, type DebugLog } from "@wardic/core/unstable/Report"
package/src/Style.ts CHANGED
@@ -12,8 +12,8 @@
12
12
  */
13
13
  // `@wardic/dom/Style` (#132, ADR-0041): the **Starting style**, the merges of an app's style with
14
14
  // Wardic's, and a drag element's defaults (ADR-0019, ADR-0021, ADR-0034).
15
+ // Its starting values (`toValues`, `resolveInitial`, the Keyframes' stops) are core's `unstable/Stops` since #672.
15
16
  export {
16
- startingStyle as starting,
17
17
  resolveInitial,
18
18
  type InitialConfig,
19
19
  keyframesOf,
@@ -23,6 +23,9 @@ export {
23
23
  type Stops,
24
24
  toValues,
25
25
  valuesAt,
26
+ } from "@wardic/core/unstable/Stops"
27
+ export {
28
+ startingStyle as starting,
26
29
  type StyleInput as Input,
27
30
  type StyleRecord as Style,
28
31
  over,
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Timeline values: a Live value derived from a container's scroll by ranges alone, which the
3
+ * browser draws with the scroll itself, on a native `ScrollTimeline` or `ViewTimeline`, so it doesn't
4
+ * trail a scroll the browser runs off the main thread. The gate goes on writing the key: the animation
5
+ * draws over it, and where the timeline can't (a container that doesn't overflow) the gate's value shows.
6
+ *
7
+ * A binding makes one for a key whose Live value core describes (`LiveValue.scrollDerivationOf`), and
8
+ * hands it to the gate while the key shows it (`FlushGate`'s `timeline`). It's built only where it draws
9
+ * what the gate would: `make` gives `None` for anything else, which the gate draws as ever.
10
+ *
11
+ * @example
12
+ * import * as TimelineValue from "@wardic/dom/TimelineValue"
13
+ *
14
+ * const derivation = Option.getOrThrow(LiveValue.scrollDerivationOf(opacity))
15
+ * const timeline = yield* TimelineValue.make(derivation, element, "opacity")
16
+ */
17
+ // `@wardic/dom/TimelineValue` (ADR-0041's names; CONTEXT.md's **Timeline value**), #240, ADR-0043
18
+ // *Amendment (#240)*. Only the `scroll` Feature's code imports it.
19
+ export { make, type TimelineValue } from "./internal/timeline.ts"
package/src/index.ts CHANGED
@@ -3,8 +3,8 @@
3
3
  * binding authors, Wardic's own and any other, and it's Effect-typed.
4
4
  *
5
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.
6
+ * {@link CheckFrames}, to check its Frames in development, {@link FrameLoopMetrics}, to record the
7
+ * Frame loop's metrics, and {@link WardicSpans}, to open Wardic's spans.
8
8
  * - **A binding** imports each module by its subpath, as a namespace
9
9
  * (`import * as FlushGate from "@wardic/dom/FlushGate"`), and the root re-exports each one:
10
10
  * - the DOM's implementations of core's services, each with its `layer` (Effect's platform
@@ -12,8 +12,8 @@
12
12
  * `DomInterpolators`, `DomPositionalKeys`, `DomDefaultTransition`), and `DomKeyRules`, the Key
13
13
  * rules `DomInterpolators.layer` installs, which has none of its own;
14
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`.
15
+ * `ReorderController`, `Style`, `Svg`, `Color`, `Variables`, `ScrollOffset`, `TimelineValue`,
16
+ * `Appear`, `OwnValues`, `KeyboardPress` and `Report`.
17
17
  *
18
18
  * Everything under `internal/` is dom's own and not exported.
19
19
  */
@@ -38,7 +38,7 @@ import * as DomPositionalKeys from "./DomPositionalKeys.ts"
38
38
  import * as DomProbe from "./DomProbe.ts"
39
39
  import * as DomRenderer from "./DomRenderer.ts"
40
40
 
41
- export const VERSION = "1.0.1"
41
+ export const VERSION = "1.1.1"
42
42
 
43
43
  export * as DomBatch from "./DomBatch.ts"
44
44
  export * as DomClock from "./DomClock.ts"
@@ -60,6 +60,7 @@ export * as Svg from "./Svg.ts"
60
60
  export * as Color from "./Color.ts"
61
61
  export * as Variables from "./Variables.ts"
62
62
  export * as ScrollOffset from "./ScrollOffset.ts"
63
+ export * as TimelineValue from "./TimelineValue.ts"
63
64
  export * as Appear from "./Appear.ts"
64
65
  export * as OwnValues from "./OwnValues.ts"
65
66
  export * as KeyboardPress from "./KeyboardPress.ts"
@@ -84,6 +85,15 @@ export { CheckFrames } from "@wardic/core/FrameLoop"
84
85
  // #518, ADR-0067 *Amendment (#518)*, decision 2: opt-in, re-exported here for an app, as `CheckFrames` is.
85
86
  export { layerMetrics as FrameLoopMetrics } from "@wardic/core/FrameLoop"
86
87
 
88
+ /**
89
+ * Core's spans (`Spans.layer`), here for an app. Merged beside {@link DomLive} with a tracer installed
90
+ * (the devtools', an OpenTelemetry exporter's), each animation, burst of frames, gesture and layout
91
+ * pass opens its span. Without it, Wardic opens none, and an app ships none of their code: see
92
+ * https://wardic.dev/guides/observability.
93
+ */
94
+ // #746, ADR-0067 *Amendment (#746)*, decision 8: opt-in, as `FrameLoopMetrics` is.
95
+ export { layer as WardicSpans } from "@wardic/core/Spans"
96
+
87
97
  /**
88
98
  * The browser Environment, composed: the DOM's services, core's interpolators with the DOM's Key
89
99
  * rules, and the Frame loop over the DOM's Clock, needing nothing else. Hand it to `WardicProvider`'s