@wardic/solid 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (510) hide show
  1. package/README.md +5 -2
  2. package/dist/browser/appear.js +42 -3
  3. package/dist/browser/appear.js.map +1 -1
  4. package/dist/browser/batch-handoff.js +2 -17
  5. package/dist/browser/batch-handoff.js.map +1 -1
  6. package/dist/browser/batch-reorder-group.js +40 -11
  7. package/dist/browser/batch-reorder-group.js.map +1 -1
  8. package/dist/browser/batch-reorder-places.js +517 -50
  9. package/dist/browser/batch-reorder-places.js.map +1 -1
  10. package/dist/browser/batch-reorder.js +284 -42
  11. package/dist/browser/batch-reorder.js.map +1 -1
  12. package/dist/browser/batch.js +4 -4
  13. package/dist/browser/batch.js.map +1 -1
  14. package/dist/browser/create-ward.js +28 -10
  15. package/dist/browser/create-ward.js.map +1 -1
  16. package/dist/browser/create-wardic.js +44 -0
  17. package/dist/browser/create-wardic.js.map +1 -0
  18. package/dist/browser/element.js +12 -3
  19. package/dist/browser/element.js.map +1 -1
  20. package/dist/browser/feature.js +57 -22
  21. package/dist/browser/feature.js.map +1 -1
  22. package/dist/browser/features/all.js +8 -0
  23. package/dist/browser/features/all.js.map +1 -1
  24. package/dist/browser/features/colors.js.map +1 -1
  25. package/dist/browser/features/dom-animation.js +8 -0
  26. package/dist/browser/features/dom-animation.js.map +1 -1
  27. package/dist/browser/features/dom-max.js +6 -0
  28. package/dist/browser/features/dom-max.js.map +1 -1
  29. package/dist/browser/features/drag.js.map +1 -1
  30. package/dist/browser/features/focus.js.map +1 -1
  31. package/dist/browser/features/hover.js.map +1 -1
  32. package/dist/browser/features/in-view.js.map +1 -1
  33. package/dist/browser/features/keys.js +6 -0
  34. package/dist/browser/features/keys.js.map +1 -1
  35. package/dist/browser/features/layout.js +14 -3
  36. package/dist/browser/features/layout.js.map +1 -1
  37. package/dist/browser/features/pan.js.map +1 -1
  38. package/dist/browser/features/press.js.map +1 -1
  39. package/dist/browser/features/scroll.js +10 -3
  40. package/dist/browser/features/scroll.js.map +1 -1
  41. package/dist/browser/features/timeline-keys.js +100 -0
  42. package/dist/browser/features/timeline-keys.js.map +1 -0
  43. package/dist/browser/imperative.js +182 -4
  44. package/dist/browser/imperative.js.map +1 -1
  45. package/dist/browser/index.js +2 -1
  46. package/dist/browser/index.js.map +1 -1
  47. package/dist/browser/instance-features.js +66 -0
  48. package/dist/browser/instance-features.js.map +1 -0
  49. package/dist/browser/layout-member.js +0 -2
  50. package/dist/browser/layout-member.js.map +1 -1
  51. package/dist/browser/layout-projection.js +8 -1
  52. package/dist/browser/layout-projection.js.map +1 -1
  53. package/dist/browser/layout.js +5 -6
  54. package/dist/browser/layout.js.map +1 -1
  55. package/dist/browser/live-scroll.js +29 -21
  56. package/dist/browser/live-scroll.js.map +1 -1
  57. package/dist/browser/live-style.js +10 -0
  58. package/dist/browser/live-style.js.map +1 -1
  59. package/dist/browser/live-value.js +11 -2
  60. package/dist/browser/live-value.js.map +1 -1
  61. package/dist/browser/member-hold.js +37 -7
  62. package/dist/browser/member-hold.js.map +1 -1
  63. package/dist/browser/messages.js +20 -0
  64. package/dist/browser/messages.js.map +1 -0
  65. package/dist/browser/presence-controller.js +136 -44
  66. package/dist/browser/presence-controller.js.map +1 -1
  67. package/dist/browser/presence-record.js.map +1 -1
  68. package/dist/browser/presence.js.map +1 -1
  69. package/dist/browser/provider.js +57 -11
  70. package/dist/browser/provider.js.map +1 -1
  71. package/dist/browser/reorder.js.map +1 -1
  72. package/dist/browser/runtime.js +15 -9
  73. package/dist/browser/runtime.js.map +1 -1
  74. package/dist/browser/scroll-values.js +46 -0
  75. package/dist/browser/scroll-values.js.map +1 -0
  76. package/dist/browser/spans-check.js +25 -0
  77. package/dist/browser/spans-check.js.map +1 -0
  78. package/dist/browser/spine.js +149 -207
  79. package/dist/browser/spine.js.map +1 -1
  80. package/dist/browser/timelines.js +9 -0
  81. package/dist/browser/timelines.js.map +1 -0
  82. package/dist/browser/unstable/v2/batch-reorder-group.js +36 -6
  83. package/dist/browser/unstable/v2/batch-reorder-group.js.map +1 -1
  84. package/dist/browser/unstable/v2/create-wardic.js +45 -0
  85. package/dist/browser/unstable/v2/create-wardic.js.map +1 -0
  86. package/dist/browser/unstable/v2/element.js +12 -2
  87. package/dist/browser/unstable/v2/element.js.map +1 -1
  88. package/dist/browser/unstable/v2/index.js +1 -0
  89. package/dist/browser/unstable/v2/index.js.map +1 -1
  90. package/dist/browser/unstable/v2/lifecycle.js +2 -0
  91. package/dist/browser/unstable/v2/lifecycle.js.map +1 -1
  92. package/dist/browser/unstable/v2/live-scroll.js +22 -13
  93. package/dist/browser/unstable/v2/live-scroll.js.map +1 -1
  94. package/dist/browser/unstable/v2/live-value.js +9 -1
  95. package/dist/browser/unstable/v2/live-value.js.map +1 -1
  96. package/dist/browser/unstable/v2/presence.js.map +1 -1
  97. package/dist/browser/unstable/v2/provider.js +60 -13
  98. package/dist/browser/unstable/v2/provider.js.map +1 -1
  99. package/dist/browser/unstable/v2/reorder.js.map +1 -1
  100. package/dist/browser/unstable/v2/w.js +7 -8
  101. package/dist/browser/unstable/v2/w.js.map +1 -1
  102. package/dist/browser/unstable/v2/ward.js +27 -9
  103. package/dist/browser/unstable/v2/ward.js.map +1 -1
  104. package/dist/browser/unstable/v2/wardic-instance.js +2 -0
  105. package/dist/browser/unstable/v2/wardic-instance.js.map +1 -0
  106. package/dist/browser/w.js +8 -9
  107. package/dist/browser/w.js.map +1 -1
  108. package/dist/browser/wardic-instance.js +2 -0
  109. package/dist/browser/wardic-instance.js.map +1 -0
  110. package/dist/server/appear.js +42 -3
  111. package/dist/server/appear.js.map +1 -1
  112. package/dist/server/batch-handoff.js +2 -17
  113. package/dist/server/batch-handoff.js.map +1 -1
  114. package/dist/server/batch-reorder-group.js +40 -11
  115. package/dist/server/batch-reorder-group.js.map +1 -1
  116. package/dist/server/batch-reorder-places.js +517 -50
  117. package/dist/server/batch-reorder-places.js.map +1 -1
  118. package/dist/server/batch-reorder.js +284 -42
  119. package/dist/server/batch-reorder.js.map +1 -1
  120. package/dist/server/batch.js +4 -4
  121. package/dist/server/batch.js.map +1 -1
  122. package/dist/server/create-ward.js +28 -10
  123. package/dist/server/create-ward.js.map +1 -1
  124. package/dist/server/create-wardic.js +44 -0
  125. package/dist/server/create-wardic.js.map +1 -0
  126. package/dist/server/element.js +12 -3
  127. package/dist/server/element.js.map +1 -1
  128. package/dist/server/feature.js +57 -22
  129. package/dist/server/feature.js.map +1 -1
  130. package/dist/server/features/all.js +8 -0
  131. package/dist/server/features/all.js.map +1 -1
  132. package/dist/server/features/colors.js.map +1 -1
  133. package/dist/server/features/dom-animation.js +8 -0
  134. package/dist/server/features/dom-animation.js.map +1 -1
  135. package/dist/server/features/dom-max.js +6 -0
  136. package/dist/server/features/dom-max.js.map +1 -1
  137. package/dist/server/features/drag.js.map +1 -1
  138. package/dist/server/features/focus.js.map +1 -1
  139. package/dist/server/features/hover.js.map +1 -1
  140. package/dist/server/features/in-view.js.map +1 -1
  141. package/dist/server/features/keys.js +6 -0
  142. package/dist/server/features/keys.js.map +1 -1
  143. package/dist/server/features/layout.js +14 -3
  144. package/dist/server/features/layout.js.map +1 -1
  145. package/dist/server/features/pan.js.map +1 -1
  146. package/dist/server/features/press.js.map +1 -1
  147. package/dist/server/features/scroll.js +10 -3
  148. package/dist/server/features/scroll.js.map +1 -1
  149. package/dist/server/features/timeline-keys.js +100 -0
  150. package/dist/server/features/timeline-keys.js.map +1 -0
  151. package/dist/server/imperative.js +182 -4
  152. package/dist/server/imperative.js.map +1 -1
  153. package/dist/server/index.js +2 -1
  154. package/dist/server/index.js.map +1 -1
  155. package/dist/server/instance-features.js +66 -0
  156. package/dist/server/instance-features.js.map +1 -0
  157. package/dist/server/layout-member.js +0 -2
  158. package/dist/server/layout-member.js.map +1 -1
  159. package/dist/server/layout-projection.js +8 -1
  160. package/dist/server/layout-projection.js.map +1 -1
  161. package/dist/server/layout.js +5 -6
  162. package/dist/server/layout.js.map +1 -1
  163. package/dist/server/live-scroll.js +29 -21
  164. package/dist/server/live-scroll.js.map +1 -1
  165. package/dist/server/live-style.js +10 -0
  166. package/dist/server/live-style.js.map +1 -1
  167. package/dist/server/live-value.js +11 -2
  168. package/dist/server/live-value.js.map +1 -1
  169. package/dist/server/member-hold.js +37 -7
  170. package/dist/server/member-hold.js.map +1 -1
  171. package/dist/server/messages.js +20 -0
  172. package/dist/server/messages.js.map +1 -0
  173. package/dist/server/presence-controller.js +136 -44
  174. package/dist/server/presence-controller.js.map +1 -1
  175. package/dist/server/presence-record.js.map +1 -1
  176. package/dist/server/presence.js.map +1 -1
  177. package/dist/server/provider.js +57 -11
  178. package/dist/server/provider.js.map +1 -1
  179. package/dist/server/reorder.js.map +1 -1
  180. package/dist/server/runtime.js +15 -9
  181. package/dist/server/runtime.js.map +1 -1
  182. package/dist/server/scroll-values.js +46 -0
  183. package/dist/server/scroll-values.js.map +1 -0
  184. package/dist/server/spans-check.js +25 -0
  185. package/dist/server/spans-check.js.map +1 -0
  186. package/dist/server/spine.js +149 -207
  187. package/dist/server/spine.js.map +1 -1
  188. package/dist/server/timelines.js +9 -0
  189. package/dist/server/timelines.js.map +1 -0
  190. package/dist/server/unstable/v2/batch-reorder-group.js +36 -6
  191. package/dist/server/unstable/v2/batch-reorder-group.js.map +1 -1
  192. package/dist/server/unstable/v2/create-wardic.js +45 -0
  193. package/dist/server/unstable/v2/create-wardic.js.map +1 -0
  194. package/dist/server/unstable/v2/element.js +12 -2
  195. package/dist/server/unstable/v2/element.js.map +1 -1
  196. package/dist/server/unstable/v2/index.js +1 -0
  197. package/dist/server/unstable/v2/index.js.map +1 -1
  198. package/dist/server/unstable/v2/lifecycle.js +2 -0
  199. package/dist/server/unstable/v2/lifecycle.js.map +1 -1
  200. package/dist/server/unstable/v2/live-scroll.js +22 -13
  201. package/dist/server/unstable/v2/live-scroll.js.map +1 -1
  202. package/dist/server/unstable/v2/live-value.js +9 -1
  203. package/dist/server/unstable/v2/live-value.js.map +1 -1
  204. package/dist/server/unstable/v2/presence.js.map +1 -1
  205. package/dist/server/unstable/v2/provider.js +60 -13
  206. package/dist/server/unstable/v2/provider.js.map +1 -1
  207. package/dist/server/unstable/v2/reorder.js.map +1 -1
  208. package/dist/server/unstable/v2/w.js +7 -8
  209. package/dist/server/unstable/v2/w.js.map +1 -1
  210. package/dist/server/unstable/v2/ward.js +27 -9
  211. package/dist/server/unstable/v2/ward.js.map +1 -1
  212. package/dist/server/unstable/v2/wardic-instance.js +2 -0
  213. package/dist/server/unstable/v2/wardic-instance.js.map +1 -0
  214. package/dist/server/w.js +8 -9
  215. package/dist/server/w.js.map +1 -1
  216. package/dist/server/wardic-instance.js +2 -0
  217. package/dist/server/wardic-instance.js.map +1 -0
  218. package/dist/solid/appear.d.ts +15 -2
  219. package/dist/solid/appear.d.ts.map +1 -1
  220. package/dist/solid/appear.js +43 -2
  221. package/dist/solid/appear.js.map +1 -1
  222. package/dist/solid/batch-handoff.d.ts.map +1 -1
  223. package/dist/solid/batch-handoff.js +2 -15
  224. package/dist/solid/batch-handoff.js.map +1 -1
  225. package/dist/solid/batch-reorder-group.d.ts +17 -15
  226. package/dist/solid/batch-reorder-group.d.ts.map +1 -1
  227. package/dist/solid/batch-reorder-group.jsx +37 -7
  228. package/dist/solid/batch-reorder-group.jsx.map +1 -1
  229. package/dist/solid/batch-reorder-places.d.ts +184 -23
  230. package/dist/solid/batch-reorder-places.d.ts.map +1 -1
  231. package/dist/solid/batch-reorder-places.js +397 -41
  232. package/dist/solid/batch-reorder-places.js.map +1 -1
  233. package/dist/solid/batch-reorder.d.ts +30 -1
  234. package/dist/solid/batch-reorder.d.ts.map +1 -1
  235. package/dist/solid/batch-reorder.js +298 -37
  236. package/dist/solid/batch-reorder.js.map +1 -1
  237. package/dist/solid/batch.d.ts.map +1 -1
  238. package/dist/solid/batch.js +4 -4
  239. package/dist/solid/batch.js.map +1 -1
  240. package/dist/solid/config.d.ts +141 -103
  241. package/dist/solid/config.d.ts.map +1 -1
  242. package/dist/solid/create-ward.d.ts +3 -1
  243. package/dist/solid/create-ward.d.ts.map +1 -1
  244. package/dist/solid/create-ward.jsx +29 -9
  245. package/dist/solid/create-ward.jsx.map +1 -1
  246. package/dist/solid/create-wardic.d.ts +24 -0
  247. package/dist/solid/create-wardic.d.ts.map +1 -0
  248. package/dist/solid/create-wardic.jsx +42 -0
  249. package/dist/solid/create-wardic.jsx.map +1 -0
  250. package/dist/solid/element.d.ts +26 -8
  251. package/dist/solid/element.d.ts.map +1 -1
  252. package/dist/solid/element.jsx +13 -5
  253. package/dist/solid/element.jsx.map +1 -1
  254. package/dist/solid/feature.d.ts +91 -3
  255. package/dist/solid/feature.d.ts.map +1 -1
  256. package/dist/solid/feature.js +48 -19
  257. package/dist/solid/feature.js.map +1 -1
  258. package/dist/solid/features/all.d.ts +9 -2
  259. package/dist/solid/features/all.d.ts.map +1 -1
  260. package/dist/solid/features/all.js +18 -1
  261. package/dist/solid/features/all.js.map +1 -1
  262. package/dist/solid/features/colors.d.ts +1 -1
  263. package/dist/solid/features/colors.d.ts.map +1 -1
  264. package/dist/solid/features/colors.js.map +1 -1
  265. package/dist/solid/features/dom-animation.d.ts +5 -2
  266. package/dist/solid/features/dom-animation.d.ts.map +1 -1
  267. package/dist/solid/features/dom-animation.js +8 -0
  268. package/dist/solid/features/dom-animation.js.map +1 -1
  269. package/dist/solid/features/dom-max.d.ts +2 -2
  270. package/dist/solid/features/dom-max.d.ts.map +1 -1
  271. package/dist/solid/features/dom-max.js +6 -0
  272. package/dist/solid/features/dom-max.js.map +1 -1
  273. package/dist/solid/features/drag.d.ts +1 -1
  274. package/dist/solid/features/drag.d.ts.map +1 -1
  275. package/dist/solid/features/drag.js.map +1 -1
  276. package/dist/solid/features/focus.d.ts +1 -1
  277. package/dist/solid/features/focus.d.ts.map +1 -1
  278. package/dist/solid/features/focus.js.map +1 -1
  279. package/dist/solid/features/hover.d.ts +1 -1
  280. package/dist/solid/features/hover.d.ts.map +1 -1
  281. package/dist/solid/features/hover.js.map +1 -1
  282. package/dist/solid/features/in-view.d.ts +1 -1
  283. package/dist/solid/features/in-view.d.ts.map +1 -1
  284. package/dist/solid/features/in-view.js.map +1 -1
  285. package/dist/solid/features/keys.d.ts +16 -1
  286. package/dist/solid/features/keys.d.ts.map +1 -1
  287. package/dist/solid/features/keys.js +7 -0
  288. package/dist/solid/features/keys.js.map +1 -1
  289. package/dist/solid/features/layout.d.ts +7 -1
  290. package/dist/solid/features/layout.d.ts.map +1 -1
  291. package/dist/solid/features/layout.js +14 -4
  292. package/dist/solid/features/layout.js.map +1 -1
  293. package/dist/solid/features/pan.d.ts +1 -1
  294. package/dist/solid/features/pan.d.ts.map +1 -1
  295. package/dist/solid/features/pan.js.map +1 -1
  296. package/dist/solid/features/press.d.ts +1 -1
  297. package/dist/solid/features/press.d.ts.map +1 -1
  298. package/dist/solid/features/press.js.map +1 -1
  299. package/dist/solid/features/scroll.d.ts +5 -3
  300. package/dist/solid/features/scroll.d.ts.map +1 -1
  301. package/dist/solid/features/scroll.js +12 -3
  302. package/dist/solid/features/scroll.js.map +1 -1
  303. package/dist/solid/features/timeline-keys.d.ts +7 -0
  304. package/dist/solid/features/timeline-keys.d.ts.map +1 -0
  305. package/dist/solid/features/timeline-keys.js +97 -0
  306. package/dist/solid/features/timeline-keys.js.map +1 -0
  307. package/dist/solid/imperative.d.ts +3 -3
  308. package/dist/solid/imperative.d.ts.map +1 -1
  309. package/dist/solid/imperative.js +146 -4
  310. package/dist/solid/imperative.js.map +1 -1
  311. package/dist/solid/index.d.ts +4 -2
  312. package/dist/solid/index.d.ts.map +1 -1
  313. package/dist/solid/index.jsx +2 -1
  314. package/dist/solid/index.jsx.map +1 -1
  315. package/dist/solid/instance-features.d.ts +7 -0
  316. package/dist/solid/instance-features.d.ts.map +1 -0
  317. package/dist/solid/instance-features.js +63 -0
  318. package/dist/solid/instance-features.js.map +1 -0
  319. package/dist/solid/layout-member.d.ts +0 -2
  320. package/dist/solid/layout-member.d.ts.map +1 -1
  321. package/dist/solid/layout-member.js +0 -2
  322. package/dist/solid/layout-member.js.map +1 -1
  323. package/dist/solid/layout-projection.d.ts +6 -0
  324. package/dist/solid/layout-projection.d.ts.map +1 -1
  325. package/dist/solid/layout-projection.jsx +8 -1
  326. package/dist/solid/layout-projection.jsx.map +1 -1
  327. package/dist/solid/layout.d.ts +4 -3
  328. package/dist/solid/layout.d.ts.map +1 -1
  329. package/dist/solid/layout.jsx +5 -6
  330. package/dist/solid/layout.jsx.map +1 -1
  331. package/dist/solid/live-scroll.d.ts +4 -0
  332. package/dist/solid/live-scroll.d.ts.map +1 -1
  333. package/dist/solid/live-scroll.jsx +29 -19
  334. package/dist/solid/live-scroll.jsx.map +1 -1
  335. package/dist/solid/live-style.d.ts +11 -0
  336. package/dist/solid/live-style.d.ts.map +1 -1
  337. package/dist/solid/live-style.js +10 -0
  338. package/dist/solid/live-style.js.map +1 -1
  339. package/dist/solid/live-value.d.ts +1 -0
  340. package/dist/solid/live-value.d.ts.map +1 -1
  341. package/dist/solid/live-value.jsx +12 -3
  342. package/dist/solid/live-value.jsx.map +1 -1
  343. package/dist/solid/member-hold.d.ts +5 -19
  344. package/dist/solid/member-hold.d.ts.map +1 -1
  345. package/dist/solid/member-hold.js +42 -7
  346. package/dist/solid/member-hold.js.map +1 -1
  347. package/dist/solid/messages.d.ts +20 -0
  348. package/dist/solid/messages.d.ts.map +1 -0
  349. package/dist/solid/messages.js +22 -0
  350. package/dist/solid/messages.js.map +1 -0
  351. package/dist/solid/presence-controller.d.ts +1 -1
  352. package/dist/solid/presence-controller.d.ts.map +1 -1
  353. package/dist/solid/presence-controller.js +125 -34
  354. package/dist/solid/presence-controller.js.map +1 -1
  355. package/dist/solid/presence-record.d.ts +3 -3
  356. package/dist/solid/presence-record.d.ts.map +1 -1
  357. package/dist/solid/presence-record.js.map +1 -1
  358. package/dist/solid/presence.d.ts +3 -1
  359. package/dist/solid/presence.d.ts.map +1 -1
  360. package/dist/solid/presence.jsx.map +1 -1
  361. package/dist/solid/provider.d.ts +17 -3
  362. package/dist/solid/provider.d.ts.map +1 -1
  363. package/dist/solid/provider.jsx +55 -7
  364. package/dist/solid/provider.jsx.map +1 -1
  365. package/dist/solid/reorder.d.ts +5 -4
  366. package/dist/solid/reorder.d.ts.map +1 -1
  367. package/dist/solid/reorder.jsx.map +1 -1
  368. package/dist/solid/runtime.d.ts +10 -2
  369. package/dist/solid/runtime.d.ts.map +1 -1
  370. package/dist/solid/runtime.js +15 -9
  371. package/dist/solid/runtime.js.map +1 -1
  372. package/dist/solid/scroll-values.d.ts +30 -0
  373. package/dist/solid/scroll-values.d.ts.map +1 -0
  374. package/dist/solid/scroll-values.js +44 -0
  375. package/dist/solid/scroll-values.js.map +1 -0
  376. package/dist/solid/spans-check.d.ts +4 -0
  377. package/dist/solid/spans-check.d.ts.map +1 -0
  378. package/dist/solid/spans-check.js +23 -0
  379. package/dist/solid/spans-check.js.map +1 -0
  380. package/dist/solid/spine.d.ts +144 -13
  381. package/dist/solid/spine.d.ts.map +1 -1
  382. package/dist/solid/spine.js +131 -183
  383. package/dist/solid/spine.js.map +1 -1
  384. package/dist/solid/timelines.d.ts +44 -0
  385. package/dist/solid/timelines.d.ts.map +1 -0
  386. package/dist/solid/timelines.js +10 -0
  387. package/dist/solid/timelines.js.map +1 -0
  388. package/dist/solid/unstable/v2/batch-reorder-group.d.ts +18 -17
  389. package/dist/solid/unstable/v2/batch-reorder-group.d.ts.map +1 -1
  390. package/dist/solid/unstable/v2/batch-reorder-group.jsx +32 -5
  391. package/dist/solid/unstable/v2/batch-reorder-group.jsx.map +1 -1
  392. package/dist/solid/unstable/v2/create-wardic.d.ts +25 -0
  393. package/dist/solid/unstable/v2/create-wardic.d.ts.map +1 -0
  394. package/dist/solid/unstable/v2/create-wardic.jsx +43 -0
  395. package/dist/solid/unstable/v2/create-wardic.jsx.map +1 -0
  396. package/dist/solid/unstable/v2/element.d.ts +52 -18
  397. package/dist/solid/unstable/v2/element.d.ts.map +1 -1
  398. package/dist/solid/unstable/v2/element.jsx +13 -4
  399. package/dist/solid/unstable/v2/element.jsx.map +1 -1
  400. package/dist/solid/unstable/v2/index.d.ts +3 -1
  401. package/dist/solid/unstable/v2/index.d.ts.map +1 -1
  402. package/dist/solid/unstable/v2/index.jsx +1 -0
  403. package/dist/solid/unstable/v2/index.jsx.map +1 -1
  404. package/dist/solid/unstable/v2/lifecycle.d.ts +29 -0
  405. package/dist/solid/unstable/v2/lifecycle.d.ts.map +1 -1
  406. package/dist/solid/unstable/v2/lifecycle.js +2 -0
  407. package/dist/solid/unstable/v2/lifecycle.js.map +1 -1
  408. package/dist/solid/unstable/v2/live-scroll.d.ts +4 -0
  409. package/dist/solid/unstable/v2/live-scroll.d.ts.map +1 -1
  410. package/dist/solid/unstable/v2/live-scroll.jsx +22 -11
  411. package/dist/solid/unstable/v2/live-scroll.jsx.map +1 -1
  412. package/dist/solid/unstable/v2/live-value.d.ts +1 -0
  413. package/dist/solid/unstable/v2/live-value.d.ts.map +1 -1
  414. package/dist/solid/unstable/v2/live-value.jsx +10 -1
  415. package/dist/solid/unstable/v2/live-value.jsx.map +1 -1
  416. package/dist/solid/unstable/v2/presence.d.ts +3 -1
  417. package/dist/solid/unstable/v2/presence.d.ts.map +1 -1
  418. package/dist/solid/unstable/v2/presence.jsx.map +1 -1
  419. package/dist/solid/unstable/v2/provider.d.ts +17 -3
  420. package/dist/solid/unstable/v2/provider.d.ts.map +1 -1
  421. package/dist/solid/unstable/v2/provider.jsx +58 -10
  422. package/dist/solid/unstable/v2/provider.jsx.map +1 -1
  423. package/dist/solid/unstable/v2/reorder.d.ts +4 -3
  424. package/dist/solid/unstable/v2/reorder.d.ts.map +1 -1
  425. package/dist/solid/unstable/v2/reorder.jsx.map +1 -1
  426. package/dist/solid/unstable/v2/w.d.ts +41 -10
  427. package/dist/solid/unstable/v2/w.d.ts.map +1 -1
  428. package/dist/solid/unstable/v2/w.jsx +5 -7
  429. package/dist/solid/unstable/v2/w.jsx.map +1 -1
  430. package/dist/solid/unstable/v2/ward.d.ts +15 -8
  431. package/dist/solid/unstable/v2/ward.d.ts.map +1 -1
  432. package/dist/solid/unstable/v2/ward.jsx +28 -8
  433. package/dist/solid/unstable/v2/ward.jsx.map +1 -1
  434. package/dist/solid/unstable/v2/wardic-instance.d.ts +47 -0
  435. package/dist/solid/unstable/v2/wardic-instance.d.ts.map +1 -0
  436. package/dist/solid/unstable/v2/wardic-instance.js +2 -0
  437. package/dist/solid/unstable/v2/wardic-instance.js.map +1 -0
  438. package/dist/solid/w.d.ts +24 -10
  439. package/dist/solid/w.d.ts.map +1 -1
  440. package/dist/solid/w.jsx +8 -7
  441. package/dist/solid/w.jsx.map +1 -1
  442. package/dist/solid/ward-keys.d.ts +22 -3
  443. package/dist/solid/ward-keys.d.ts.map +1 -1
  444. package/dist/solid/wardic-instance.d.ts +46 -0
  445. package/dist/solid/wardic-instance.d.ts.map +1 -0
  446. package/dist/solid/wardic-instance.js +2 -0
  447. package/dist/solid/wardic-instance.js.map +1 -0
  448. package/package.json +4 -4
  449. package/src/appear.ts +56 -2
  450. package/src/batch-handoff.ts +2 -16
  451. package/src/batch-reorder-group.tsx +47 -21
  452. package/src/batch-reorder-places.ts +566 -54
  453. package/src/batch-reorder.ts +333 -40
  454. package/src/batch.ts +4 -4
  455. package/src/config.ts +177 -123
  456. package/src/create-ward.tsx +32 -8
  457. package/src/create-wardic.tsx +45 -0
  458. package/src/element.tsx +52 -16
  459. package/src/feature.ts +157 -25
  460. package/src/features/all.ts +11 -2
  461. package/src/features/colors.ts +1 -1
  462. package/src/features/dom-animation.ts +2 -2
  463. package/src/features/dom-max.ts +1 -2
  464. package/src/features/drag.ts +1 -1
  465. package/src/features/focus.ts +1 -1
  466. package/src/features/hover.ts +1 -1
  467. package/src/features/in-view.ts +1 -1
  468. package/src/features/keys.ts +18 -1
  469. package/src/features/layout.ts +17 -5
  470. package/src/features/pan.ts +1 -1
  471. package/src/features/press.ts +1 -1
  472. package/src/features/scroll.ts +14 -4
  473. package/src/features/timeline-keys.ts +109 -0
  474. package/src/imperative.ts +168 -10
  475. package/src/index.tsx +6 -1
  476. package/src/instance-features.ts +88 -0
  477. package/src/layout-member.ts +0 -4
  478. package/src/layout-projection.tsx +10 -1
  479. package/src/layout.tsx +7 -6
  480. package/src/live-scroll.tsx +30 -22
  481. package/src/live-style.ts +21 -0
  482. package/src/live-value.tsx +12 -2
  483. package/src/member-hold.ts +45 -26
  484. package/src/messages.ts +27 -0
  485. package/src/presence-controller.ts +222 -106
  486. package/src/presence-record.ts +3 -3
  487. package/src/presence.tsx +3 -1
  488. package/src/provider.tsx +62 -7
  489. package/src/reorder.tsx +5 -4
  490. package/src/runtime.ts +17 -10
  491. package/src/scroll-values.ts +53 -0
  492. package/src/spans-check.ts +25 -0
  493. package/src/spine.ts +219 -187
  494. package/src/timelines.ts +46 -0
  495. package/src/unstable/v2/batch-reorder-group.tsx +42 -18
  496. package/src/unstable/v2/create-wardic.tsx +46 -0
  497. package/src/unstable/v2/element.tsx +85 -24
  498. package/src/unstable/v2/index.tsx +5 -0
  499. package/src/unstable/v2/lifecycle.ts +35 -0
  500. package/src/unstable/v2/live-scroll.tsx +22 -11
  501. package/src/unstable/v2/live-value.tsx +10 -0
  502. package/src/unstable/v2/presence.tsx +3 -1
  503. package/src/unstable/v2/provider.tsx +65 -9
  504. package/src/unstable/v2/reorder.tsx +9 -4
  505. package/src/unstable/v2/w.tsx +49 -13
  506. package/src/unstable/v2/ward.tsx +48 -13
  507. package/src/unstable/v2/wardic-instance.ts +50 -0
  508. package/src/w.tsx +33 -16
  509. package/src/ward-keys.ts +38 -17
  510. package/src/wardic-instance.ts +49 -0
@@ -1,21 +1,31 @@
1
1
  /**
2
2
  * The **`scroll` Feature** (#518, ADR-0067 *Amendment (#518)*, decision 5), in a module of its own: a
3
3
  * container's scroll, which `createScroll` brings, so an app that reads no scroll ships none of the
4
- * Environment's scroll code. Its top-level calls are marked pure, as every Feature module's are.
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.
5
7
  *
6
8
  * @module
7
9
  */
8
10
  import * as ScrollSource from "@wardic/core/ScrollSource"
9
11
  import * as DomScrollSource from "@wardic/dom/DomScrollSource"
12
+ import * as Layer from "effect/Layer"
10
13
  import { type Feature, fromEnvironmentOr } from "../feature.ts"
14
+ import { Timelines } from "../timelines.ts"
15
+ import { makeTimelines } from "./timeline-keys.ts"
11
16
 
12
17
  /**
13
18
  * A container's scroll, live, for the scroll-linked values. `createScroll` brings it, so an app doesn't
14
19
  * give it. The Environment's `ScrollSource` when it gives one (`@wardic/test`'s `TestLive`), else the
15
- * DOM's, built once per provider.
20
+ * DOM's, built once per provider. Its Timeline values run where the browser has native scroll timelines.
16
21
  */
17
- export const scroll: Feature<ScrollSource.ScrollSource> = {
22
+ // #240 (ADR-0043 *Amendment (#240)*, decision 4): the `Timelines` service, which an element's spine finds
23
+ // among the provider's built Features.
24
+ export const scroll: Feature<ScrollSource.ScrollSource, ScrollSource.ScrollSource["Service"], "scroll"> = {
18
25
  name: "scroll",
19
26
  key: ScrollSource.ScrollSource,
20
- layer: /*#__PURE__*/ fromEnvironmentOr(ScrollSource.ScrollSource, DomScrollSource.layer),
27
+ layer: /*#__PURE__*/ Layer.merge(
28
+ /*#__PURE__*/ fromEnvironmentOr(ScrollSource.ScrollSource, DomScrollSource.layer),
29
+ /*#__PURE__*/ Layer.sync(Timelines)(makeTimelines),
30
+ ),
21
31
  }
@@ -0,0 +1,109 @@
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
+ * @module
9
+ */
10
+ import * as LiveValue from "@wardic/core/LiveValue"
11
+ import * as TimelineValue from "@wardic/dom/TimelineValue"
12
+ import * as Bool from "effect/Boolean"
13
+ import * as Option from "effect/Option"
14
+ import * as Predicate from "effect/Predicate"
15
+ import type * as Atom from "effect/reactivity/Atom"
16
+ import type { TimelineKeys, TimelineKeysOptions, Timelines } from "../timelines.ts"
17
+
18
+ /** A key's Timeline value as last made: the derivation it was made from, and the value, `undefined` where the gate draws the key. */
19
+ interface Made {
20
+ readonly derivation: LiveValue.ScrollDerivation
21
+ readonly timeline: TimelineValue.TimelineValue | undefined
22
+ }
23
+
24
+ /** An element's {@link TimelineKeys}, and what its provider's `described` tells it. */
25
+ interface ElementKeys extends TimelineKeys {
26
+ /** Find each key it shows its Timeline value again: what it derives from may have been described since. */
27
+ readonly recheck: () => void
28
+ }
29
+
30
+ /**
31
+ * A provider's {@link Timelines}: each mounted element's keys, told again when a `createScroll`
32
+ * describes its values.
33
+ */
34
+ export const makeTimelines = (): Timelines["Service"] => {
35
+ const mounted = new Set<ElementKeys>()
36
+ return {
37
+ keysOf: (options) => {
38
+ const keys = elementKeysOf(options, () => mounted.delete(keys))
39
+ mounted.add(keys)
40
+ return keys
41
+ },
42
+ described: () => {
43
+ mounted.forEach((keys) => keys.recheck())
44
+ },
45
+ }
46
+ }
47
+
48
+ /**
49
+ * An element's keys. `shown` runs at each write of a key's Live value, so per frame while it moves: a key
50
+ * shown already from the same source is left as it is, with nothing read but its source, statements and
51
+ * nothing made. What it derives from changes only where it's described anew, which `recheck` hears.
52
+ */
53
+ const elementKeysOf = (options: TimelineKeysOptions, unmounted: () => void): ElementKeys => {
54
+ const { runtime, gate, id, element, live } = options
55
+ const made = new Map<string, Made>()
56
+ // The keys that show their Live value, whatever runs them, each with the Atom it was shown from (none
57
+ // for a plain accessor's): the ones `recheck` looks at again.
58
+ const showing = new Map<string, Atom.Atom<unknown> | undefined>()
59
+ // The keys whose Timeline value the gate has, each with it.
60
+ const running = new Map<string, TimelineValue.TimelineValue>()
61
+
62
+ /** `key`'s Timeline value now, made again when its derivation changed; `undefined` for none. */
63
+ const timelineOf = (key: string): TimelineValue.TimelineValue | undefined => {
64
+ const atom = live.atomOf(key)
65
+ if (Predicate.isUndefined(atom)) return undefined
66
+ const derivation = Option.getOrUndefined(LiveValue.scrollDerivationOf(atom))
67
+ if (Predicate.isUndefined(derivation)) return undefined
68
+ const last = made.get(key)
69
+ if (Predicate.isNotUndefined(last)) {
70
+ if (last.derivation === derivation) return last.timeline
71
+ }
72
+ const timeline = Option.getOrUndefined(runtime.runSync(TimelineValue.make(derivation, element, key)))
73
+ made.set(key, { derivation, timeline })
74
+ return timeline
75
+ }
76
+
77
+ /** The gate runs `key`'s Timeline value now, or none. */
78
+ const run = (key: string): void => {
79
+ const timeline = timelineOf(key)
80
+ if (running.get(key) === timeline) return
81
+ gate.timeline(id, key, timeline)
82
+ if (Predicate.isUndefined(timeline)) {
83
+ running.delete(key)
84
+ return
85
+ }
86
+ running.set(key, timeline)
87
+ }
88
+
89
+ return {
90
+ shown: (key) => {
91
+ const atom = live.atomOf(key)
92
+ if (showing.has(key)) {
93
+ if (showing.get(key) === atom) return
94
+ }
95
+ showing.set(key, atom)
96
+ run(key)
97
+ },
98
+ taken: (key) => {
99
+ showing.delete(key)
100
+ if (Bool.not(running.has(key))) return
101
+ running.delete(key)
102
+ gate.timeline(id, key, undefined)
103
+ },
104
+ recheck: () => {
105
+ showing.forEach((_, key) => run(key))
106
+ },
107
+ dispose: unmounted,
108
+ }
109
+ }
package/src/imperative.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * - **A Wardic element** animates through its own spine, registered here while it's mounted: the
7
7
  * call takes the keys it animates, which stay where it leaves them until the element's own target
8
- * for them changes (the spine's `animate`, Motion's latest-wins).
8
+ * for them changes (Motion's latest-wins).
9
9
  * - **A plain element** animates through a spine of its own (#433's Q4), with no config, presence or
10
10
  * layout node: it starts from the element's Own value (ADR-0022) and keeps its values for the next
11
11
  * call, velocity included. It's in the gate only while it animates, so the gate keeps nothing of an
@@ -21,12 +21,15 @@
21
21
  * @module
22
22
  */
23
23
  import type * as DefaultTransition from "@wardic/core/DefaultTransition"
24
+ import type * as Frame from "@wardic/core/Frame"
25
+ import * as InterpolatorRegistry from "@wardic/core/InterpolatorRegistry"
24
26
  import * as Machine from "@wardic/core/Machine"
25
27
  import * as Playback from "@wardic/core/Playback"
26
28
  import * as ReducedMotion from "@wardic/core/ReducedMotion"
27
29
  import type * as Values from "@wardic/core/Values"
28
30
  import * as Sequence from "@wardic/core/Sequence"
29
31
  import type * as FlushGate from "@wardic/dom/FlushGate"
32
+ import * as MeasuredPair from "@wardic/dom/MeasuredPair"
30
33
  import * as Report from "@wardic/dom/Report"
31
34
  import {
32
35
  type BatchBinding,
@@ -53,13 +56,34 @@ import * as Predicate from "effect/Predicate"
53
56
  import * as Rec from "effect/Record"
54
57
  import * as UndefinedOr from "effect/UndefinedOr"
55
58
  import type { WardicKeyframes, WardicTargetValues, WardicTransition, WardicVariant } from "./config.ts"
56
- import { filledStops, runOf } from "./retarget-legs.ts"
57
- import type { WardicRuntime } from "./runtime.ts"
58
- import { type ElementSpine, emptySnapshotOf, type ImperativeTrack, makeElementSpine, makeReuse, type Snapshot, startLinksOf } from "./spine.ts"
59
- import { NO_VARIANT_STATE, resolveTarget } from "./variant-target.ts"
60
-
61
- /** What an Imperative animation animates an element through: its spine's `animate`. */
62
- type Animatable = Pick<ElementSpine, "animate">
59
+ import { filledStops, keyframesFrom, type Leg, legsOf, mapMachine, type MeasuredPairs, runOf, type StopsByKey } from "./retarget-legs.ts"
60
+ import type { WardicRuntime, WardicServices } from "./runtime.ts"
61
+ import {
62
+ type ElementSpine,
63
+ emptySnapshotOf,
64
+ holdsVariable,
65
+ type ImperativeHooks,
66
+ type ImperativeTrack,
67
+ type Landing,
68
+ makeElementSpine,
69
+ makeReuse,
70
+ measuredOf,
71
+ NO_RUNNING,
72
+ NO_VALUES,
73
+ restsOf,
74
+ type Resolution,
75
+ type Running,
76
+ runningOf,
77
+ type Snapshot,
78
+ type SpineHost,
79
+ startLinksOf,
80
+ turnWillChangeOn,
81
+ } from "./spine.ts"
82
+ import { NO_VARIANT_STATE, resolveTarget, type Target } from "./variant-target.ts"
83
+ import { NO_GESTURE_NAMES, NO_GESTURE_STATES } from "./variant-tree.ts"
84
+
85
+ /** What an Imperative animation animates an element through: what its spine hands over (`host`). */
86
+ type Animatable = Pick<ElementSpine, "host">
63
87
 
64
88
  /** Each mounted Wardic element's spine (Motion's `visualElementStore`). */
65
89
  // Module state (#460, Q7): each Wardic element's animatable, held weakly by the element.
@@ -162,6 +186,140 @@ const skippedIn = (env: AnimateEnv, transition: WardicTransition | undefined): W
162
186
  return { ...transition, skipAnimations: true } as WardicTransition
163
187
  }
164
188
 
189
+ /**
190
+ * The resolution an **Imperative animation**'s legs run under (#433): none of the Override stack's,
191
+ * so a Retarget that takes a key back never carries one as its own Keyframes or names.
192
+ */
193
+ const IMPERATIVE: Resolution = {
194
+ resolved: {},
195
+ base: {},
196
+ dragging: false,
197
+ variant: undefined,
198
+ active: { inView: false, focused: false, hovered: false, pressed: false, dragged: false, dragging: false },
199
+ transition: undefined,
200
+ layers: [],
201
+ names: NO_GESTURE_NAMES,
202
+ layersOn: NO_GESTURE_STATES,
203
+ ends: undefined,
204
+ keyframes: undefined,
205
+ change: undefined,
206
+ }
207
+
208
+ /**
209
+ * An **Imperative animation** of an element (#433), through its spine's `host`: it takes `target`'s
210
+ * keys from whatever runs them, each noted with the target the Override stack has for it now, so a
211
+ * Retarget leaves it where the animation leaves it until that target changes (Motion's latest-wins).
212
+ * Its legs start where the keys are drawn, with their velocity, on `given` (a key with none of its own
213
+ * on its Default transition), reduced motion as the provider says, and run through `head` once
214
+ * {@link ImperativeTrack.run} is called.
215
+ */
216
+ // #746 (ADR-0067, *Amendment (#746)*, decision 10): here, not in the spine, so an app that never animates
217
+ // imperatively ships none of it; the spine hands over what it takes (`SpineHost`).
218
+ const imperativeTrackOf = (host: SpineHost, target: Target, given: WardicTransition | undefined, head: Playback.Playhead, hooks: ImperativeHooks): ImperativeTrack => {
219
+ const { snapshot, owners, giveUp, initialValues, ownValue, startKey, keepTheRest, element, positionalKeys, defaultTransition, readVelocity, gate, forget, endLeg, live, own, legProgram, legEnded, turnBack, id, recordFrame, runtime, elementRules } = host
220
+ /** A leg of an Imperative animation, forked as a Retarget's are; it lands on its track. */
221
+ // Data-first: a pipe's curried forms are two closures more for every leg (#618, H1).
222
+ const runImperative = (running: Running, program: Effect.Effect<unknown, never, WardicServices>): void => {
223
+ running.fiber = runtime.runFork(Effect.asVoid(Effect.onExit(program, legEnded(running))))
224
+ }
225
+ const to = target.values
226
+ const before = UndefinedOr.match(host.lastResolution(), { onUndefined: () => NO_VALUES, onDefined: (last) => last.resolved })
227
+ const started: Record<string, string> = {}
228
+ let measuring: Array<string> | undefined
229
+ // Each key taken from whatever runs it, noted with its target now, and started where it's drawn.
230
+ // Its velocity read now (#464), as its legs are built.
231
+ const takenNow = host.taking()
232
+ // Where a Path's axis this target leaves out rests (#574), before its keys are taken below.
233
+ const rests = restsOf(owners, to)
234
+ Arr.forEach(Rec.keys(to), (key) => {
235
+ takenNow.set(key, before[key])
236
+ host.returning().delete(key)
237
+ // Its Timeline value stops while the animation draws the key (#240).
238
+ const timelineKeys = host.timelineKeys()
239
+ if (Predicate.isNotUndefined(timelineKeys)) timelineKeys.taken(key)
240
+ const owner = owners.get(key)
241
+ if (Predicate.isNotUndefined(owner)) giveUp(key, owner)
242
+ if (!Object.hasOwn(initialValues, key)) ownValue(key)
243
+ const like = UndefinedOr.getOrThrow(to[key])
244
+ startKey(key, like, started)
245
+ if (MeasuredPair.needs(key, UndefinedOr.getOrThrow(snapshot.values[key]), like)) {
246
+ if (Predicate.isUndefined(measuring)) measuring = []
247
+ measuring.push(key)
248
+ }
249
+ })
250
+ keepTheRest()
251
+ let from: Values.Values = Rec.map(to, (_, key) => UndefinedOr.getOrThrow(snapshot.values[key]))
252
+ let stops: StopsByKey | undefined
253
+ if (Predicate.isNotUndefined(target.keyframes)) {
254
+ const begun = keyframesFrom(from, to, target.keyframes)
255
+ from = begun.from
256
+ stops = begun.stops
257
+ }
258
+ const reduce = host.reducedMotion()
259
+ const skipped = host.skipAnimations()
260
+ let measured: MeasuredPairs | undefined
261
+ if (Bool.and(Bool.not(Bool.or(reduce, skipped)), Predicate.isNotUndefined(measuring))) measured = measuredOf(element, UndefinedOr.getOrThrow(measuring), from, to, snapshot.values, stops)
262
+ // Built once: a seek or a replay runs the same legs, from the same start, with the same velocities.
263
+ const built = legsOf(from, to, given, reduce, skipped, positionalKeys, defaultTransition, readVelocity, undefined, stops, measured, snapshot.values, rests)
264
+ const variables = holdsVariable(from, to, stops)
265
+ const legs = Arr.map(built, (leg) => mapMachine(leg, Playback.drive(head)))
266
+ let runnings: ReadonlyArray<Running> = NO_RUNNING
267
+ let left = 0
268
+ const landing: Landing = {
269
+ report: constVoid,
270
+ settled: () => {
271
+ left--
272
+ if (left === 0) gate.afterFlush(hooks.settled)
273
+ },
274
+ failed: hooks.failed,
275
+ }
276
+ // Its legs ended where they are: the keys they draw are drawn by none.
277
+ const end = (): void =>
278
+ Arr.forEach(runnings, (running) => {
279
+ forget(running)
280
+ if (Bool.not(running.done)) endLeg(running)
281
+ })
282
+ const run = (): void => {
283
+ end()
284
+ left = legs.length
285
+ turnWillChangeOn(live, legs)
286
+ runnings = Arr.map(legs, (leg) => {
287
+ const running = runningOf(leg.to, IMPERATIVE, landing, leg._tag)
288
+ own(running)
289
+ runImperative(running, legProgram(leg, running, variables))
290
+ return running
291
+ })
292
+ // A target with no key lands at once.
293
+ if (left === 0) gate.afterFlush(hooks.settled)
294
+ }
295
+ const cancel = (): void => {
296
+ end()
297
+ turnBack()
298
+ snapshot.values = { ...snapshot.values, ...from }
299
+ snapshot.velocities = { ...snapshot.velocities, ...Rec.map(from, () => 0) }
300
+ // Put back at once: at rest, newer than the legs that let them go (#464).
301
+ const now = snapshot.now()
302
+ Arr.forEach(Rec.keys(from), (key) => {
303
+ snapshot.drawnAt[key] = now
304
+ })
305
+ gate.write(id, from)
306
+ recordFrame(from)
307
+ }
308
+ // Each leg's machine, run from its start to rest, apart from the Playhead, which it would move: a
309
+ // blend's built with the element's Key rules.
310
+ const duration = (): number =>
311
+ Arr.reduce(built, 0, (longest, leg) => Math.max(longest, Machine.durationOf(machineOf(leg))))
312
+ const machineOf = (leg: Leg): Machine.Machine<Frame.Frame<unknown>> => {
313
+ if (leg._tag === "Blend") return runtime.runSync(Effect.suspend(leg.machine).pipe(InterpolatorRegistry.withKeyRules(elementRules)))
314
+ return leg.machine() as Machine.Machine<Frame.Frame<unknown>>
315
+ }
316
+ const stop = (): void => {
317
+ end()
318
+ turnBack()
319
+ }
320
+ return { run, stop, cancel, duration }
321
+ }
322
+
165
323
  /**
166
324
  * An element's animation of `target`: through its spine when it's a Wardic element's, else through its
167
325
  * plain spine, in the gate while any of its animations runs.
@@ -171,7 +329,7 @@ const trackOf = (env: AnimateEnv, element: Element, target: WardicVariant, given
171
329
  const own = wardicElements.get(element)
172
330
  const hooks = { settled, failed: constVoid }
173
331
  const transition = skippedIn(env, given)
174
- if (Predicate.isNotUndefined(own)) return own.animate(resolved, transition, head, hooks)
332
+ if (Predicate.isNotUndefined(own)) return imperativeTrackOf(own.host(), resolved, transition, head, hooks)
175
333
  const plain = plainOf(env, element)
176
334
  // In the gate while it runs; out once its last animation is done, after the flush of its last frame.
177
335
  let live = false
@@ -193,7 +351,7 @@ const trackOf = (env: AnimateEnv, element: Element, target: WardicVariant, given
193
351
  if (plain.running === 0) plain.unregister()
194
352
  })
195
353
  }
196
- const track = plain.spine.animate(resolved, transition, head, {
354
+ const track = imperativeTrackOf(plain.spine.host(), resolved, transition, head, {
197
355
  settled: () => {
198
356
  leave()
199
357
  settled()
package/src/index.tsx CHANGED
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * @see https://wardic.dev/reference/solid/utilities/version
13
13
  */
14
- export const VERSION = "1.0.0"
14
+ export const VERSION = "1.1.0"
15
15
 
16
16
  /**
17
17
  * `WardicProvider` (one Effect runtime + `AtomRegistry` per ADR-0006), the
@@ -243,8 +243,10 @@ export {
243
243
  type ReorderItemDirectiveValue,
244
244
  type ReorderBatchGroupProps,
245
245
  type ReorderBatchItemProps,
246
+ type ReorderBatchColumnSize,
246
247
  type ReorderBatchGap,
247
248
  type ReorderBatchItemSize,
249
+ type ReorderBatchSizing,
248
250
  reorderItem,
249
251
  } from "./reorder.tsx"
250
252
 
@@ -295,6 +297,9 @@ export {
295
297
  * `w.createWard` and `use:w`, each as its `wardic` form but with only the Features chosen above it.
296
298
  */
297
299
  export { type W, w } from "./w.tsx"
300
+ // #516: what `createWardic(features)` returns, its `w` typed to its Features.
301
+ export type { WardConfigOf, WardicInstance } from "./wardic-instance.ts"
302
+ export { createWardic } from "./create-wardic.tsx"
298
303
  // #443 (Motion's): `wardic.create`'s options; whether a component is a Wardic element's and what it
299
304
  // wraps; whether a prop is a motion prop.
300
305
  export { isWardicComponent, unwrapWardicComponent, type WardicCreateOptions } from "./wardic-component.ts"
@@ -0,0 +1,88 @@
1
+ /**
2
+ * A **Wardic instance**'s Features (#516, ADR-0067 *Amendment (#516)*), for both bindings: what
3
+ * `createWardic` splits its list into, and what its elements and hooks take in each provider. In a module
4
+ * that only `createWardic` imports, apart from the spine every page shares, so an app with no Wardic
5
+ * instance ships none of it (ADR-0067, *Amendment (#548)*).
6
+ *
7
+ * @module
8
+ */
9
+ import * as Arr from "effect/Array"
10
+ import * as Bool from "effect/Boolean"
11
+ import type * as Cause from "effect/Cause"
12
+ import { constVoid, identity } from "effect/Function"
13
+ import * as Predicate from "effect/Predicate"
14
+ import * as UndefinedOr from "effect/UndefinedOr"
15
+ import {
16
+ type Build,
17
+ type Feature,
18
+ type FeatureLoad,
19
+ type FeatureRegistry,
20
+ type Features,
21
+ type InstanceFeatures,
22
+ type InstanceFeaturesProp,
23
+ joinOwns,
24
+ type Own,
25
+ ownOf,
26
+ type SectionHost,
27
+ } from "./feature.ts"
28
+
29
+ /**
30
+ * `prop`'s Features (#516): those given at once, flattened, each once, and its loads, each started once,
31
+ * the first time any provider asks, so one module's Wardic instance loads each once.
32
+ */
33
+ export const instanceFeaturesOf = (prop: InstanceFeaturesProp): InstanceFeatures => {
34
+ const leaves = leavesOf(prop)
35
+ const given = Arr.dedupeWith(Arr.filter(leaves, isFeature), (a, b) => a === b)
36
+ const loads = Arr.map(Arr.filter(leaves, isLoad), once)
37
+ const owns = new WeakMap<FeatureRegistry, Own>()
38
+ return {
39
+ own: (registry, host) =>
40
+ UndefinedOr.match(owns.get(registry), {
41
+ onDefined: identity,
42
+ onUndefined: () => {
43
+ const own = ownIn(registry.build, given, loads, host.report, { reactivity: host.reactivity, server: host.server, onCleanup: registry.onEnd })
44
+ owns.set(registry, own)
45
+ return own
46
+ },
47
+ }),
48
+ }
49
+ }
50
+
51
+ /** `prop`'s Features and loads, every list flattened. */
52
+ const leavesOf = (prop: InstanceFeaturesProp): ReadonlyArray<Feature | FeatureLoad> =>
53
+ Bool.match(Array.isArray(prop), {
54
+ onTrue: () => Arr.flatMap(prop as ReadonlyArray<InstanceFeaturesProp>, leavesOf),
55
+ onFalse: () => [prop as Feature | FeatureLoad],
56
+ })
57
+
58
+ const isFeature = (leaf: Feature | FeatureLoad): leaf is Feature => Predicate.hasProperty(leaf, "layer")
59
+
60
+ const isLoad = (leaf: Feature | FeatureLoad): leaf is FeatureLoad => Predicate.isFunction(leaf)
61
+
62
+ /**
63
+ * `load`, started at its first call, its promise kept for every call after. A failed load is forgotten,
64
+ * so the next provider to ask loads again, as a new `LazyWardic` does.
65
+ */
66
+ const once = (load: FeatureLoad): FeatureLoad => {
67
+ let started: Promise<Features> | undefined
68
+ return () =>
69
+ UndefinedOr.match(started, {
70
+ onDefined: identity,
71
+ onUndefined: () => {
72
+ const loading = load()
73
+ started = loading
74
+ loading.then(constVoid, () => {
75
+ if (started === loading) started = undefined
76
+ })
77
+ return loading
78
+ },
79
+ })
80
+ }
81
+
82
+ /** A Wardic instance's Features in one provider: those given at once, and each load's, joined. */
83
+ const ownIn = (build: Build, given: ReadonlyArray<Feature>, loads: ReadonlyArray<FeatureLoad>, report: (cause: Cause.Cause<unknown>) => void, host: SectionHost): Own =>
84
+ Arr.reduce(
85
+ Arr.map(loads, (load) => ownOf(build, load, report, host)),
86
+ ownOf(build, given, report, host),
87
+ joinOwns,
88
+ )
@@ -227,10 +227,6 @@ export const layoutModeOf = (layout: WardConfig["layout"], layoutId: string | un
227
227
  /** Whether a `layout` prop names a Layout mode (a string), not `true` / `false`. */
228
228
  const isModeName = (layout: WardConfig["layout"]): layout is Exclude<WardConfig["layout"], boolean | undefined> => Predicate.isString(layout)
229
229
 
230
- /** Whether a config makes its element a projection node: `layout` (or a mode), a `layoutId`, `layoutScroll` or `layoutRoot`. */
231
- export const wantsLayoutNode = (c: WardConfig): boolean =>
232
- c.layout === true || Predicate.isString(c.layout) || Predicate.isNotUndefined(c.layoutId) || c.layoutScroll === true || c.layoutRoot === true
233
-
234
230
  /** What {@link layoutOptionsOf} reads of a ward. */
235
231
  export interface WardLayout {
236
232
  readonly id: string
@@ -6,7 +6,8 @@
6
6
  */
7
7
  import type * as ProjectionSystem from "@wardic/dom/ProjectionSystem"
8
8
  import type * as Context from "effect/Context"
9
- import { layoutBrought, type LayoutServices, projectionBrought } from "./features/layout.ts"
9
+ import type { ProjectionNodes } from "./features/keys.ts"
10
+ import { layoutBrought, type LayoutServices, projectionBrought, projectionNodesBrought } from "./features/layout.ts"
10
11
  import { fromWardicContext } from "./provider.tsx"
11
12
 
12
13
  /**
@@ -19,6 +20,14 @@ export function useWardicProjection(): ProjectionSystem.Shape {
19
20
  return fromWardicContext("useWardicProjection", projectionBrought)
20
21
  }
21
22
 
23
+ /**
24
+ * The `layout` Feature's element code beside {@link useWardicProjection}'s system (#746): what
25
+ * `createProjectionNode` registers its node through, after `useWardicProjection`. Internal.
26
+ */
27
+ export function useProjectionNodes(): ProjectionNodes["Service"] {
28
+ return fromWardicContext("useWardicProjection", projectionNodesBrought)
29
+ }
30
+
22
31
  /**
23
32
  * {@link useWardicProjection}'s services, all of them, for a Reorder controller: the projection system
24
33
  * and what it hears each Measure pass by (#618). Internal.
package/src/layout.tsx CHANGED
@@ -21,8 +21,9 @@ import type * as ProjectionSystem from "@wardic/dom/ProjectionSystem"
21
21
  import * as Bool from "effect/Boolean"
22
22
  import { createContext, createEffect, createMemo, type JSX, on, onCleanup, untrack, useContext } from "solid-js"
23
23
  import { layoutGroupIdOf, type LayoutGroupInherit } from "./layout-group.ts"
24
- import { registrationOf, type CreateProjectionNodeOptions } from "./layout-member.ts"
25
- import { useWardicProjection } from "./layout-projection.tsx"
24
+ import type { ProjectionNodes } from "./features/keys.ts"
25
+ import type { CreateProjectionNodeOptions } from "./layout-member.ts"
26
+ import { useProjectionNodes, useWardicProjection } from "./layout-projection.tsx"
26
27
  import { isServer } from "./server.ts"
27
28
 
28
29
  export type { CreateProjectionNodeOptions } from "./layout-member.ts"
@@ -44,14 +45,14 @@ export type { CreateProjectionNodeOptions } from "./layout-member.ts"
44
45
  // lead/follow stack, and seeds its first measure from a twin disposed in the same task (a Switch), in
45
46
  // either swap order (ADR-0010 *Amendment (#13)*), so there's no registry here. It brings `layout`
46
47
  // (#511), whatever its section has: a Slim element's own layout node is its section's.
47
- export const createProjectionNode = (opts: CreateProjectionNodeOptions): ProjectionSystem.NodeHandle => projectionNodeOf(useWardicProjection(), opts)
48
+ export const createProjectionNode = (opts: CreateProjectionNodeOptions): ProjectionSystem.NodeHandle => projectionNodeOf(useWardicProjection(), useProjectionNodes(), opts)
48
49
 
49
50
  /**
50
51
  * {@link createProjectionNode} on `projection`: an element's, its section's `layout` Feature's (#511), where
51
- * `createProjectionNode` brings it. Internal.
52
+ * `createProjectionNode` brings it, registered through the Feature's `nodes` (#746). Internal.
52
53
  */
53
- export const projectionNodeOf = (projection: ProjectionSystem.Shape, opts: CreateProjectionNodeOptions): ProjectionSystem.NodeHandle => {
54
- const handle = projection.register(registrationOf(opts))
54
+ export const projectionNodeOf = (projection: ProjectionSystem.Shape, nodes: ProjectionNodes["Service"], opts: CreateProjectionNodeOptions): ProjectionSystem.NodeHandle => {
55
+ const handle = projection.register(nodes.registrationOf(opts))
55
56
  onCleanup(handle.dispose)
56
57
  // Compared before it measures, as Motion's `prevProps.layoutDependency !== layoutDependency`: an
57
58
  // effect re-runs at any change of what it read, and the config is read again at any prop's (#618).
@@ -7,22 +7,26 @@
7
7
  import * as LiveValue from "@wardic/core/LiveValue"
8
8
  import * as ScrollSource from "@wardic/core/ScrollSource"
9
9
  import type * as ScrollOffset from "@wardic/dom/ScrollOffset"
10
- import * as Arr from "effect/Array"
11
10
  import * as Bool from "effect/Boolean"
12
11
  import * as Effect from "effect/Effect"
13
12
  import * as Option from "effect/Option"
14
13
  import * as Predicate from "effect/Predicate"
15
14
  import * as AtomRegistry from "effect/reactivity/AtomRegistry"
15
+ import * as Rec from "effect/Record"
16
16
  import * as Scope from "effect/Scope"
17
17
  import * as UndefinedOr from "effect/UndefinedOr"
18
- import { type Accessor, createEffect, createSignal, onCleanup } from "solid-js"
18
+ import { type Accessor, createEffect, onCleanup } from "solid-js"
19
+ import { fromAtom } from "./bridge.tsx"
19
20
  import type { Feature } from "./feature.ts"
20
21
  import { scroll } from "./features/scroll.ts"
21
22
  import { serviceOf } from "./gesture-features.ts"
23
+ import { carry } from "./live-style.ts"
22
24
  import { CLOSE_FAILED, SERVER_ZERO } from "./live-value.tsx"
23
25
  import * as OwnerScope from "./owner-scope.ts"
24
26
  import { useBrought, useWardicRuntime } from "./provider.tsx"
27
+ import { followScroll, letGoScroll, scrollAtomsOf } from "./scroll-values.ts"
25
28
  import { isServer } from "./server.ts"
29
+ import { Timelines } from "./timelines.ts"
26
30
 
27
31
  /** What it brings (ADR-0067 decision 12): the `scroll` Feature, whatever its section has (#518). */
28
32
  const SCROLL: ReadonlyArray<Feature> = [scroll]
@@ -61,6 +65,7 @@ export interface ScrollValues {
61
65
 
62
66
  const SERVER_SCROLL: ScrollValues = { scrollX: SERVER_ZERO, scrollY: SERVER_ZERO, scrollXProgress: SERVER_ZERO, scrollYProgress: SERVER_ZERO }
63
67
 
68
+
64
69
  /** An element source read now: `None` for an accessor whose ref hasn't arrived. */
65
70
  const elementOf = (source: ElementSource): Option.Option<Element> =>
66
71
  Bool.match(Predicate.isFunction(source), {
@@ -76,6 +81,10 @@ const elementOf = (source: ElementSource): Option.Option<Element> =>
76
81
  * `container` or `target` given as an accessor of a ref reads 0s until the ref is there. 0s on a
77
82
  * server. Motion's `useScroll`.
78
83
  *
84
+ * Where the browser has native scroll timelines, an element's `opacity`, `filter`, `clipPath` or
85
+ * transform key given one of these, or a `createTransform` of one through ranges, is drawn by the
86
+ * browser with the scroll itself, so it doesn't trail a fast scroll.
87
+ *
79
88
  * @example
80
89
  * let box!: HTMLDivElement
81
90
  * const { scrollYProgress } = createScroll({ container: () => box })
@@ -84,21 +93,29 @@ const elementOf = (source: ElementSource): Option.Option<Element> =>
84
93
  * @see https://wardic.dev/reference/solid/live-values/create-scroll
85
94
  */
86
95
  // #234. An accessor `container` or `target` is read in an effect, and a change of either follows the
87
- // new one.
96
+ // new one. Each value carries one Atom for its life (#240), described as deriving as the scroll's value
97
+ // it's set from (`LiveValue.derivesAs`), so a Timeline value finds it: an element's `style` follows the
98
+ // Atom.
88
99
  export const createScroll = (options: ScrollOptions = {}): ScrollValues => {
89
100
  const runtime = useWardicRuntime()
90
101
  if (isServer) return SERVER_SCROLL
91
102
  const services = useBrought(SCROLL)
92
- const [scrollX, setScrollX] = createSignal(0)
93
- const [scrollY, setScrollY] = createSignal(0)
94
- const [scrollXProgress, setScrollXProgress] = createSignal(0)
95
- const [scrollYProgress, setScrollYProgress] = createSignal(0)
103
+ // Built now, before a `style` follows its values, so the element finds its Timeline values (#240).
104
+ const timelines = serviceOf(services(), Timelines)
105
+ const registry = runtime.runSync(AtomRegistry.AtomRegistry)
106
+ // Its own four Atoms, set from the scroll of the elements there now.
107
+ const outs = scrollAtomsOf(registry, onCleanup)
108
+ // Whether they follow a scroll now: a ref gone lets it go.
109
+ let following = false
96
110
  createEffect(() => {
97
111
  const container = UndefinedOr.match(options.container, { onUndefined: () => Option.some(undefined), onDefined: elementOf })
98
112
  const target = UndefinedOr.match(options.target, { onUndefined: () => Option.some(undefined), onDefined: elementOf })
99
- // A ref not there yet: the values hold until it is.
100
- if (Bool.or(Option.isNone(container), Option.isNone(target))) return
101
- const registry = runtime.runSync(AtomRegistry.AtomRegistry)
113
+ // A ref not there yet, or gone: the values hold until it is.
114
+ if (Bool.or(Option.isNone(container), Option.isNone(target))) {
115
+ if (following) letGoScroll(outs, timelines)
116
+ following = false
117
+ return
118
+ }
102
119
  const scope = OwnerScope.open(runtime)
103
120
  onCleanup(() => OwnerScope.close(runtime, scope, CLOSE_FAILED))
104
121
  const values = runtime.runSync(
@@ -109,17 +126,8 @@ export const createScroll = (options: ScrollOptions = {}): ScrollValues => {
109
126
  ...UndefinedOr.match(options.axis, { onUndefined: () => ({}), onDefined: (axis) => ({ axis }) }),
110
127
  }).pipe(Effect.provideService(ScrollSource.ScrollSource, serviceOf(services(), ScrollSource.ScrollSource)), Scope.provide(scope)),
111
128
  )
112
- // Each derived Atom is read at once: it tracks the scroll only once it's been read.
113
- const stops = Arr.map(
114
- [
115
- [values.scrollX, setScrollX],
116
- [values.scrollY, setScrollY],
117
- [values.scrollXProgress, setScrollXProgress],
118
- [values.scrollYProgress, setScrollYProgress],
119
- ] as const,
120
- ([atom, set]) => registry.subscribe(atom, (v) => void set(v), { immediate: true }),
121
- )
122
- onCleanup(() => Arr.forEach(stops, (stop) => stop()))
129
+ following = true
130
+ onCleanup(followScroll(registry, outs, values, timelines))
123
131
  })
124
- return { scrollX, scrollY, scrollXProgress, scrollYProgress }
132
+ return Rec.map(outs, (atom) => carry(fromAtom(atom), atom)) as unknown as ScrollValues
125
133
  }