@wardic/solid 0.0.0-stage → 1.0.0-rc.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 (994) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +26 -2
  3. package/THIRD_PARTY_NOTICES.md +145 -0
  4. package/dist/browser/animation-controls.js +150 -0
  5. package/dist/browser/animation-controls.js.map +1 -0
  6. package/dist/browser/animation-frame.js +29 -0
  7. package/dist/browser/animation-frame.js.map +1 -0
  8. package/dist/browser/appear.js +727 -0
  9. package/dist/browser/appear.js.map +1 -0
  10. package/dist/browser/arc.js +21 -0
  11. package/dist/browser/arc.js.map +1 -0
  12. package/dist/browser/bridge.js +69 -0
  13. package/dist/browser/bridge.js.map +1 -0
  14. package/dist/browser/complete.js +30 -0
  15. package/dist/browser/complete.js.map +1 -0
  16. package/dist/browser/config.js +2 -0
  17. package/dist/browser/config.js.map +1 -0
  18. package/dist/browser/create-animate.js +41 -0
  19. package/dist/browser/create-animate.js.map +1 -0
  20. package/dist/browser/create-ward.js +1001 -0
  21. package/dist/browser/create-ward.js.map +1 -0
  22. package/dist/browser/cycle-index.js +17 -0
  23. package/dist/browser/cycle-index.js.map +1 -0
  24. package/dist/browser/cycle.js +31 -0
  25. package/dist/browser/cycle.js.map +1 -0
  26. package/dist/browser/directive.js +80 -0
  27. package/dist/browser/directive.js.map +1 -0
  28. package/dist/browser/drag-constraints.js +76 -0
  29. package/dist/browser/drag-constraints.js.map +1 -0
  30. package/dist/browser/drag-controls.js +51 -0
  31. package/dist/browser/drag-controls.js.map +1 -0
  32. package/dist/browser/drag-samples.js +40 -0
  33. package/dist/browser/drag-samples.js.map +1 -0
  34. package/dist/browser/drag-sensor.js +35 -0
  35. package/dist/browser/drag-sensor.js.map +1 -0
  36. package/dist/browser/drag-track.js +817 -0
  37. package/dist/browser/drag-track.js.map +1 -0
  38. package/dist/browser/drag-transition.js +56 -0
  39. package/dist/browser/drag-transition.js.map +1 -0
  40. package/dist/browser/drag.js +44 -0
  41. package/dist/browser/drag.js.map +1 -0
  42. package/dist/browser/element-style.js +67 -0
  43. package/dist/browser/element-style.js.map +1 -0
  44. package/dist/browser/element.js +353 -0
  45. package/dist/browser/element.js.map +1 -0
  46. package/dist/browser/feature-section.js +17 -0
  47. package/dist/browser/feature-section.js.map +1 -0
  48. package/dist/browser/feature.js +261 -0
  49. package/dist/browser/feature.js.map +1 -0
  50. package/dist/browser/features/all.js +10 -0
  51. package/dist/browser/features/all.js.map +1 -0
  52. package/dist/browser/features/colors.js +33 -0
  53. package/dist/browser/features/colors.js.map +1 -0
  54. package/dist/browser/features/dom-animation.js +7 -0
  55. package/dist/browser/features/dom-animation.js.map +1 -0
  56. package/dist/browser/features/dom-max.js +4 -0
  57. package/dist/browser/features/dom-max.js.map +1 -0
  58. package/dist/browser/features/drag.js +28 -0
  59. package/dist/browser/features/drag.js.map +1 -0
  60. package/dist/browser/features/focus.js +18 -0
  61. package/dist/browser/features/focus.js.map +1 -0
  62. package/dist/browser/features/hover.js +18 -0
  63. package/dist/browser/features/hover.js.map +1 -0
  64. package/dist/browser/features/in-view.js +18 -0
  65. package/dist/browser/features/in-view.js.map +1 -0
  66. package/dist/browser/features/input.js +30 -0
  67. package/dist/browser/features/input.js.map +1 -0
  68. package/dist/browser/features/keys.js +19 -0
  69. package/dist/browser/features/keys.js.map +1 -0
  70. package/dist/browser/features/layout.js +33 -0
  71. package/dist/browser/features/layout.js.map +1 -0
  72. package/dist/browser/features/pan.js +18 -0
  73. package/dist/browser/features/pan.js.map +1 -0
  74. package/dist/browser/features/press.js +12 -0
  75. package/dist/browser/features/press.js.map +1 -0
  76. package/dist/browser/focus-sensor.js +23 -0
  77. package/dist/browser/focus-sensor.js.map +1 -0
  78. package/dist/browser/frame-time.js +40 -0
  79. package/dist/browser/frame-time.js.map +1 -0
  80. package/dist/browser/gesture-callbacks.js +172 -0
  81. package/dist/browser/gesture-callbacks.js.map +1 -0
  82. package/dist/browser/gesture-features.js +29 -0
  83. package/dist/browser/gesture-features.js.map +1 -0
  84. package/dist/browser/gesture-info.js +43 -0
  85. package/dist/browser/gesture-info.js.map +1 -0
  86. package/dist/browser/hover-sensor.js +29 -0
  87. package/dist/browser/hover-sensor.js.map +1 -0
  88. package/dist/browser/imperative.js +614 -0
  89. package/dist/browser/imperative.js.map +1 -0
  90. package/dist/browser/index.js +165 -0
  91. package/dist/browser/index.js.map +1 -0
  92. package/dist/browser/instant.js +51 -0
  93. package/dist/browser/instant.js.map +1 -0
  94. package/dist/browser/layout-group.js +27 -0
  95. package/dist/browser/layout-group.js.map +1 -0
  96. package/dist/browser/layout-member.js +362 -0
  97. package/dist/browser/layout-member.js.map +1 -0
  98. package/dist/browser/layout-projection.js +19 -0
  99. package/dist/browser/layout-projection.js.map +1 -0
  100. package/dist/browser/layout.js +91 -0
  101. package/dist/browser/layout.js.map +1 -0
  102. package/dist/browser/live-style.js +313 -0
  103. package/dist/browser/live-style.js.map +1 -0
  104. package/dist/browser/live-value.js +252 -0
  105. package/dist/browser/live-value.js.map +1 -0
  106. package/dist/browser/motion-props.js +172 -0
  107. package/dist/browser/motion-props.js.map +1 -0
  108. package/dist/browser/owner-scope.js +29 -0
  109. package/dist/browser/owner-scope.js.map +1 -0
  110. package/dist/browser/page-point.js +92 -0
  111. package/dist/browser/page-point.js.map +1 -0
  112. package/dist/browser/presence-controller.js +1324 -0
  113. package/dist/browser/presence-controller.js.map +1 -0
  114. package/dist/browser/presence-record.js +27 -0
  115. package/dist/browser/presence-record.js.map +1 -0
  116. package/dist/browser/presence.js +207 -0
  117. package/dist/browser/presence.js.map +1 -0
  118. package/dist/browser/press-sensor.js +30 -0
  119. package/dist/browser/press-sensor.js.map +1 -0
  120. package/dist/browser/press.js +24 -0
  121. package/dist/browser/press.js.map +1 -0
  122. package/dist/browser/provider.js +445 -0
  123. package/dist/browser/provider.js.map +1 -0
  124. package/dist/browser/reactivity.js +9 -0
  125. package/dist/browser/reactivity.js.map +1 -0
  126. package/dist/browser/reorder-input.js +46 -0
  127. package/dist/browser/reorder-input.js.map +1 -0
  128. package/dist/browser/reorder.js +543 -0
  129. package/dist/browser/reorder.js.map +1 -0
  130. package/dist/browser/retarget-legs.js +1019 -0
  131. package/dist/browser/retarget-legs.js.map +1 -0
  132. package/dist/browser/runtime.js +249 -0
  133. package/dist/browser/runtime.js.map +1 -0
  134. package/dist/browser/sensors.js +172 -0
  135. package/dist/browser/sensors.js.map +1 -0
  136. package/dist/browser/server-interpolators.js +20 -0
  137. package/dist/browser/server-interpolators.js.map +1 -0
  138. package/dist/browser/server.js +20 -0
  139. package/dist/browser/server.js.map +1 -0
  140. package/dist/browser/solid-reactivity.js +26 -0
  141. package/dist/browser/solid-reactivity.js.map +1 -0
  142. package/dist/browser/spine.js +2939 -0
  143. package/dist/browser/spine.js.map +1 -0
  144. package/dist/browser/stagger.js +13 -0
  145. package/dist/browser/stagger.js.map +1 -0
  146. package/dist/browser/unstable/v2/bridge.js +76 -0
  147. package/dist/browser/unstable/v2/bridge.js.map +1 -0
  148. package/dist/browser/unstable/v2/complete.js +29 -0
  149. package/dist/browser/unstable/v2/complete.js.map +1 -0
  150. package/dist/browser/unstable/v2/config-view.js +111 -0
  151. package/dist/browser/unstable/v2/config-view.js.map +1 -0
  152. package/dist/browser/unstable/v2/create-animate.js +102 -0
  153. package/dist/browser/unstable/v2/create-animate.js.map +1 -0
  154. package/dist/browser/unstable/v2/cycle.js +30 -0
  155. package/dist/browser/unstable/v2/cycle.js.map +1 -0
  156. package/dist/browser/unstable/v2/drag-sensor.js +34 -0
  157. package/dist/browser/unstable/v2/drag-sensor.js.map +1 -0
  158. package/dist/browser/unstable/v2/element.js +393 -0
  159. package/dist/browser/unstable/v2/element.js.map +1 -0
  160. package/dist/browser/unstable/v2/feature-section.js +27 -0
  161. package/dist/browser/unstable/v2/feature-section.js.map +1 -0
  162. package/dist/browser/unstable/v2/focus-sensor.js +23 -0
  163. package/dist/browser/unstable/v2/focus-sensor.js.map +1 -0
  164. package/dist/browser/unstable/v2/hover-sensor.js +28 -0
  165. package/dist/browser/unstable/v2/hover-sensor.js.map +1 -0
  166. package/dist/browser/unstable/v2/index.js +114 -0
  167. package/dist/browser/unstable/v2/index.js.map +1 -0
  168. package/dist/browser/unstable/v2/layout-projection.js +18 -0
  169. package/dist/browser/unstable/v2/layout-projection.js.map +1 -0
  170. package/dist/browser/unstable/v2/layout.js +71 -0
  171. package/dist/browser/unstable/v2/layout.js.map +1 -0
  172. package/dist/browser/unstable/v2/lifecycle.js +455 -0
  173. package/dist/browser/unstable/v2/lifecycle.js.map +1 -0
  174. package/dist/browser/unstable/v2/live-value.js +264 -0
  175. package/dist/browser/unstable/v2/live-value.js.map +1 -0
  176. package/dist/browser/unstable/v2/presence-handle.js +146 -0
  177. package/dist/browser/unstable/v2/presence-handle.js.map +1 -0
  178. package/dist/browser/unstable/v2/presence-hooks.js +142 -0
  179. package/dist/browser/unstable/v2/presence-hooks.js.map +1 -0
  180. package/dist/browser/unstable/v2/presence.js +124 -0
  181. package/dist/browser/unstable/v2/presence.js.map +1 -0
  182. package/dist/browser/unstable/v2/press-sensor.js +29 -0
  183. package/dist/browser/unstable/v2/press-sensor.js.map +1 -0
  184. package/dist/browser/unstable/v2/provider.js +457 -0
  185. package/dist/browser/unstable/v2/provider.js.map +1 -0
  186. package/dist/browser/unstable/v2/reorder.js +663 -0
  187. package/dist/browser/unstable/v2/reorder.js.map +1 -0
  188. package/dist/browser/unstable/v2/sensors.js +138 -0
  189. package/dist/browser/unstable/v2/sensors.js.map +1 -0
  190. package/dist/browser/unstable/v2/solid-reactivity.js +82 -0
  191. package/dist/browser/unstable/v2/solid-reactivity.js.map +1 -0
  192. package/dist/browser/unstable/v2/variant-node.js +395 -0
  193. package/dist/browser/unstable/v2/variant-node.js.map +1 -0
  194. package/dist/browser/unstable/v2/w.js +23 -0
  195. package/dist/browser/unstable/v2/w.js.map +1 -0
  196. package/dist/browser/unstable/v2/waiters.js +185 -0
  197. package/dist/browser/unstable/v2/waiters.js.map +1 -0
  198. package/dist/browser/unstable/v2/ward.js +1620 -0
  199. package/dist/browser/unstable/v2/ward.js.map +1 -0
  200. package/dist/browser/unstable/v2/wardic-config.js +40 -0
  201. package/dist/browser/unstable/v2/wardic-config.js.map +1 -0
  202. package/dist/browser/unstable/v2/wardic.js +16 -0
  203. package/dist/browser/unstable/v2/wardic.js.map +1 -0
  204. package/dist/browser/variant-node.js +308 -0
  205. package/dist/browser/variant-node.js.map +1 -0
  206. package/dist/browser/variant-target.js +224 -0
  207. package/dist/browser/variant-target.js.map +1 -0
  208. package/dist/browser/variant-tree.js +394 -0
  209. package/dist/browser/variant-tree.js.map +1 -0
  210. package/dist/browser/variants.js +43 -0
  211. package/dist/browser/variants.js.map +1 -0
  212. package/dist/browser/w.js +25 -0
  213. package/dist/browser/w.js.map +1 -0
  214. package/dist/browser/ward-keys.js +2 -0
  215. package/dist/browser/ward-keys.js.map +1 -0
  216. package/dist/browser/wardic-component.js +74 -0
  217. package/dist/browser/wardic-component.js.map +1 -0
  218. package/dist/browser/wardic-config-value.js +91 -0
  219. package/dist/browser/wardic-config-value.js.map +1 -0
  220. package/dist/browser/wardic-config.js +42 -0
  221. package/dist/browser/wardic-config.js.map +1 -0
  222. package/dist/browser/wardic.js +31 -0
  223. package/dist/browser/wardic.js.map +1 -0
  224. package/dist/server/animation-controls.js +150 -0
  225. package/dist/server/animation-controls.js.map +1 -0
  226. package/dist/server/animation-frame.js +29 -0
  227. package/dist/server/animation-frame.js.map +1 -0
  228. package/dist/server/appear.js +727 -0
  229. package/dist/server/appear.js.map +1 -0
  230. package/dist/server/arc.js +21 -0
  231. package/dist/server/arc.js.map +1 -0
  232. package/dist/server/bridge.js +69 -0
  233. package/dist/server/bridge.js.map +1 -0
  234. package/dist/server/complete.js +30 -0
  235. package/dist/server/complete.js.map +1 -0
  236. package/dist/server/config.js +2 -0
  237. package/dist/server/config.js.map +1 -0
  238. package/dist/server/create-animate.js +41 -0
  239. package/dist/server/create-animate.js.map +1 -0
  240. package/dist/server/create-ward.js +1001 -0
  241. package/dist/server/create-ward.js.map +1 -0
  242. package/dist/server/cycle-index.js +17 -0
  243. package/dist/server/cycle-index.js.map +1 -0
  244. package/dist/server/cycle.js +31 -0
  245. package/dist/server/cycle.js.map +1 -0
  246. package/dist/server/directive.js +80 -0
  247. package/dist/server/directive.js.map +1 -0
  248. package/dist/server/drag-constraints.js +76 -0
  249. package/dist/server/drag-constraints.js.map +1 -0
  250. package/dist/server/drag-controls.js +51 -0
  251. package/dist/server/drag-controls.js.map +1 -0
  252. package/dist/server/drag-samples.js +40 -0
  253. package/dist/server/drag-samples.js.map +1 -0
  254. package/dist/server/drag-sensor.js +35 -0
  255. package/dist/server/drag-sensor.js.map +1 -0
  256. package/dist/server/drag-track.js +817 -0
  257. package/dist/server/drag-track.js.map +1 -0
  258. package/dist/server/drag-transition.js +56 -0
  259. package/dist/server/drag-transition.js.map +1 -0
  260. package/dist/server/drag.js +44 -0
  261. package/dist/server/drag.js.map +1 -0
  262. package/dist/server/element-style.js +67 -0
  263. package/dist/server/element-style.js.map +1 -0
  264. package/dist/server/element.js +353 -0
  265. package/dist/server/element.js.map +1 -0
  266. package/dist/server/feature-section.js +17 -0
  267. package/dist/server/feature-section.js.map +1 -0
  268. package/dist/server/feature.js +261 -0
  269. package/dist/server/feature.js.map +1 -0
  270. package/dist/server/features/all.js +10 -0
  271. package/dist/server/features/all.js.map +1 -0
  272. package/dist/server/features/colors.js +33 -0
  273. package/dist/server/features/colors.js.map +1 -0
  274. package/dist/server/features/dom-animation.js +7 -0
  275. package/dist/server/features/dom-animation.js.map +1 -0
  276. package/dist/server/features/dom-max.js +4 -0
  277. package/dist/server/features/dom-max.js.map +1 -0
  278. package/dist/server/features/drag.js +28 -0
  279. package/dist/server/features/drag.js.map +1 -0
  280. package/dist/server/features/focus.js +18 -0
  281. package/dist/server/features/focus.js.map +1 -0
  282. package/dist/server/features/hover.js +18 -0
  283. package/dist/server/features/hover.js.map +1 -0
  284. package/dist/server/features/in-view.js +18 -0
  285. package/dist/server/features/in-view.js.map +1 -0
  286. package/dist/server/features/input.js +30 -0
  287. package/dist/server/features/input.js.map +1 -0
  288. package/dist/server/features/keys.js +19 -0
  289. package/dist/server/features/keys.js.map +1 -0
  290. package/dist/server/features/layout.js +33 -0
  291. package/dist/server/features/layout.js.map +1 -0
  292. package/dist/server/features/pan.js +18 -0
  293. package/dist/server/features/pan.js.map +1 -0
  294. package/dist/server/features/press.js +12 -0
  295. package/dist/server/features/press.js.map +1 -0
  296. package/dist/server/focus-sensor.js +23 -0
  297. package/dist/server/focus-sensor.js.map +1 -0
  298. package/dist/server/frame-time.js +40 -0
  299. package/dist/server/frame-time.js.map +1 -0
  300. package/dist/server/gesture-callbacks.js +172 -0
  301. package/dist/server/gesture-callbacks.js.map +1 -0
  302. package/dist/server/gesture-features.js +29 -0
  303. package/dist/server/gesture-features.js.map +1 -0
  304. package/dist/server/gesture-info.js +43 -0
  305. package/dist/server/gesture-info.js.map +1 -0
  306. package/dist/server/hover-sensor.js +29 -0
  307. package/dist/server/hover-sensor.js.map +1 -0
  308. package/dist/server/imperative.js +614 -0
  309. package/dist/server/imperative.js.map +1 -0
  310. package/dist/server/index.js +165 -0
  311. package/dist/server/index.js.map +1 -0
  312. package/dist/server/instant.js +51 -0
  313. package/dist/server/instant.js.map +1 -0
  314. package/dist/server/layout-group.js +27 -0
  315. package/dist/server/layout-group.js.map +1 -0
  316. package/dist/server/layout-member.js +362 -0
  317. package/dist/server/layout-member.js.map +1 -0
  318. package/dist/server/layout-projection.js +19 -0
  319. package/dist/server/layout-projection.js.map +1 -0
  320. package/dist/server/layout.js +90 -0
  321. package/dist/server/layout.js.map +1 -0
  322. package/dist/server/live-style.js +313 -0
  323. package/dist/server/live-style.js.map +1 -0
  324. package/dist/server/live-value.js +252 -0
  325. package/dist/server/live-value.js.map +1 -0
  326. package/dist/server/motion-props.js +172 -0
  327. package/dist/server/motion-props.js.map +1 -0
  328. package/dist/server/owner-scope.js +29 -0
  329. package/dist/server/owner-scope.js.map +1 -0
  330. package/dist/server/page-point.js +92 -0
  331. package/dist/server/page-point.js.map +1 -0
  332. package/dist/server/presence-controller.js +1324 -0
  333. package/dist/server/presence-controller.js.map +1 -0
  334. package/dist/server/presence-record.js +27 -0
  335. package/dist/server/presence-record.js.map +1 -0
  336. package/dist/server/presence.js +207 -0
  337. package/dist/server/presence.js.map +1 -0
  338. package/dist/server/press-sensor.js +30 -0
  339. package/dist/server/press-sensor.js.map +1 -0
  340. package/dist/server/press.js +24 -0
  341. package/dist/server/press.js.map +1 -0
  342. package/dist/server/provider.js +439 -0
  343. package/dist/server/provider.js.map +1 -0
  344. package/dist/server/reactivity.js +9 -0
  345. package/dist/server/reactivity.js.map +1 -0
  346. package/dist/server/reorder-input.js +46 -0
  347. package/dist/server/reorder-input.js.map +1 -0
  348. package/dist/server/reorder.js +543 -0
  349. package/dist/server/reorder.js.map +1 -0
  350. package/dist/server/retarget-legs.js +1019 -0
  351. package/dist/server/retarget-legs.js.map +1 -0
  352. package/dist/server/runtime.js +249 -0
  353. package/dist/server/runtime.js.map +1 -0
  354. package/dist/server/sensors.js +172 -0
  355. package/dist/server/sensors.js.map +1 -0
  356. package/dist/server/server-interpolators.js +20 -0
  357. package/dist/server/server-interpolators.js.map +1 -0
  358. package/dist/server/server.js +20 -0
  359. package/dist/server/server.js.map +1 -0
  360. package/dist/server/solid-reactivity.js +26 -0
  361. package/dist/server/solid-reactivity.js.map +1 -0
  362. package/dist/server/spine.js +2939 -0
  363. package/dist/server/spine.js.map +1 -0
  364. package/dist/server/stagger.js +13 -0
  365. package/dist/server/stagger.js.map +1 -0
  366. package/dist/server/unstable/v2/bridge.js +76 -0
  367. package/dist/server/unstable/v2/bridge.js.map +1 -0
  368. package/dist/server/unstable/v2/complete.js +29 -0
  369. package/dist/server/unstable/v2/complete.js.map +1 -0
  370. package/dist/server/unstable/v2/config-view.js +111 -0
  371. package/dist/server/unstable/v2/config-view.js.map +1 -0
  372. package/dist/server/unstable/v2/create-animate.js +102 -0
  373. package/dist/server/unstable/v2/create-animate.js.map +1 -0
  374. package/dist/server/unstable/v2/cycle.js +30 -0
  375. package/dist/server/unstable/v2/cycle.js.map +1 -0
  376. package/dist/server/unstable/v2/drag-sensor.js +34 -0
  377. package/dist/server/unstable/v2/drag-sensor.js.map +1 -0
  378. package/dist/server/unstable/v2/element.js +402 -0
  379. package/dist/server/unstable/v2/element.js.map +1 -0
  380. package/dist/server/unstable/v2/feature-section.js +27 -0
  381. package/dist/server/unstable/v2/feature-section.js.map +1 -0
  382. package/dist/server/unstable/v2/focus-sensor.js +23 -0
  383. package/dist/server/unstable/v2/focus-sensor.js.map +1 -0
  384. package/dist/server/unstable/v2/hover-sensor.js +28 -0
  385. package/dist/server/unstable/v2/hover-sensor.js.map +1 -0
  386. package/dist/server/unstable/v2/index.js +114 -0
  387. package/dist/server/unstable/v2/index.js.map +1 -0
  388. package/dist/server/unstable/v2/layout-projection.js +18 -0
  389. package/dist/server/unstable/v2/layout-projection.js.map +1 -0
  390. package/dist/server/unstable/v2/layout.js +88 -0
  391. package/dist/server/unstable/v2/layout.js.map +1 -0
  392. package/dist/server/unstable/v2/lifecycle.js +455 -0
  393. package/dist/server/unstable/v2/lifecycle.js.map +1 -0
  394. package/dist/server/unstable/v2/live-value.js +264 -0
  395. package/dist/server/unstable/v2/live-value.js.map +1 -0
  396. package/dist/server/unstable/v2/presence-handle.js +146 -0
  397. package/dist/server/unstable/v2/presence-handle.js.map +1 -0
  398. package/dist/server/unstable/v2/presence-hooks.js +142 -0
  399. package/dist/server/unstable/v2/presence-hooks.js.map +1 -0
  400. package/dist/server/unstable/v2/presence.js +142 -0
  401. package/dist/server/unstable/v2/presence.js.map +1 -0
  402. package/dist/server/unstable/v2/press-sensor.js +29 -0
  403. package/dist/server/unstable/v2/press-sensor.js.map +1 -0
  404. package/dist/server/unstable/v2/provider.js +475 -0
  405. package/dist/server/unstable/v2/provider.js.map +1 -0
  406. package/dist/server/unstable/v2/reorder.js +733 -0
  407. package/dist/server/unstable/v2/reorder.js.map +1 -0
  408. package/dist/server/unstable/v2/sensors.js +138 -0
  409. package/dist/server/unstable/v2/sensors.js.map +1 -0
  410. package/dist/server/unstable/v2/solid-reactivity.js +82 -0
  411. package/dist/server/unstable/v2/solid-reactivity.js.map +1 -0
  412. package/dist/server/unstable/v2/variant-node.js +395 -0
  413. package/dist/server/unstable/v2/variant-node.js.map +1 -0
  414. package/dist/server/unstable/v2/w.js +23 -0
  415. package/dist/server/unstable/v2/w.js.map +1 -0
  416. package/dist/server/unstable/v2/waiters.js +185 -0
  417. package/dist/server/unstable/v2/waiters.js.map +1 -0
  418. package/dist/server/unstable/v2/ward.js +1653 -0
  419. package/dist/server/unstable/v2/ward.js.map +1 -0
  420. package/dist/server/unstable/v2/wardic-config.js +49 -0
  421. package/dist/server/unstable/v2/wardic-config.js.map +1 -0
  422. package/dist/server/unstable/v2/wardic.js +16 -0
  423. package/dist/server/unstable/v2/wardic.js.map +1 -0
  424. package/dist/server/variant-node.js +308 -0
  425. package/dist/server/variant-node.js.map +1 -0
  426. package/dist/server/variant-target.js +224 -0
  427. package/dist/server/variant-target.js.map +1 -0
  428. package/dist/server/variant-tree.js +394 -0
  429. package/dist/server/variant-tree.js.map +1 -0
  430. package/dist/server/variants.js +43 -0
  431. package/dist/server/variants.js.map +1 -0
  432. package/dist/server/w.js +25 -0
  433. package/dist/server/w.js.map +1 -0
  434. package/dist/server/ward-keys.js +2 -0
  435. package/dist/server/ward-keys.js.map +1 -0
  436. package/dist/server/wardic-component.js +74 -0
  437. package/dist/server/wardic-component.js.map +1 -0
  438. package/dist/server/wardic-config-value.js +91 -0
  439. package/dist/server/wardic-config-value.js.map +1 -0
  440. package/dist/server/wardic-config.js +42 -0
  441. package/dist/server/wardic-config.js.map +1 -0
  442. package/dist/server/wardic.js +31 -0
  443. package/dist/server/wardic.js.map +1 -0
  444. package/dist/solid/animation-controls.d.ts +104 -0
  445. package/dist/solid/animation-controls.d.ts.map +1 -0
  446. package/dist/solid/animation-controls.js +129 -0
  447. package/dist/solid/animation-controls.js.map +1 -0
  448. package/dist/solid/animation-frame.d.ts +11 -0
  449. package/dist/solid/animation-frame.d.ts.map +1 -0
  450. package/dist/solid/animation-frame.js +31 -0
  451. package/dist/solid/animation-frame.js.map +1 -0
  452. package/dist/solid/appear.d.ts +205 -0
  453. package/dist/solid/appear.d.ts.map +1 -0
  454. package/dist/solid/appear.js +519 -0
  455. package/dist/solid/appear.js.map +1 -0
  456. package/dist/solid/arc.d.ts +25 -0
  457. package/dist/solid/arc.d.ts.map +1 -0
  458. package/dist/solid/arc.js +21 -0
  459. package/dist/solid/arc.js.map +1 -0
  460. package/dist/solid/bridge.d.ts +53 -0
  461. package/dist/solid/bridge.d.ts.map +1 -0
  462. package/dist/solid/bridge.js +66 -0
  463. package/dist/solid/bridge.js.map +1 -0
  464. package/dist/solid/complete.d.ts +31 -0
  465. package/dist/solid/complete.d.ts.map +1 -0
  466. package/dist/solid/complete.js +27 -0
  467. package/dist/solid/complete.js.map +1 -0
  468. package/dist/solid/config.d.ts +693 -0
  469. package/dist/solid/config.d.ts.map +1 -0
  470. package/dist/solid/config.js +2 -0
  471. package/dist/solid/config.js.map +1 -0
  472. package/dist/solid/create-animate.d.ts +17 -0
  473. package/dist/solid/create-animate.d.ts.map +1 -0
  474. package/dist/solid/create-animate.js +42 -0
  475. package/dist/solid/create-animate.js.map +1 -0
  476. package/dist/solid/create-ward.d.ts +278 -0
  477. package/dist/solid/create-ward.d.ts.map +1 -0
  478. package/dist/solid/create-ward.jsx +874 -0
  479. package/dist/solid/create-ward.jsx.map +1 -0
  480. package/dist/solid/cycle-index.d.ts +7 -0
  481. package/dist/solid/cycle-index.d.ts.map +1 -0
  482. package/dist/solid/cycle-index.js +17 -0
  483. package/dist/solid/cycle-index.js.map +1 -0
  484. package/dist/solid/cycle.d.ts +21 -0
  485. package/dist/solid/cycle.d.ts.map +1 -0
  486. package/dist/solid/cycle.js +31 -0
  487. package/dist/solid/cycle.js.map +1 -0
  488. package/dist/solid/directive.d.ts +21 -0
  489. package/dist/solid/directive.d.ts.map +1 -0
  490. package/dist/solid/directive.js +76 -0
  491. package/dist/solid/directive.js.map +1 -0
  492. package/dist/solid/drag-constraints.d.ts +46 -0
  493. package/dist/solid/drag-constraints.d.ts.map +1 -0
  494. package/dist/solid/drag-constraints.js +49 -0
  495. package/dist/solid/drag-constraints.js.map +1 -0
  496. package/dist/solid/drag-controls.d.ts +50 -0
  497. package/dist/solid/drag-controls.d.ts.map +1 -0
  498. package/dist/solid/drag-controls.js +51 -0
  499. package/dist/solid/drag-controls.js.map +1 -0
  500. package/dist/solid/drag-samples.d.ts +34 -0
  501. package/dist/solid/drag-samples.d.ts.map +1 -0
  502. package/dist/solid/drag-samples.js +28 -0
  503. package/dist/solid/drag-samples.js.map +1 -0
  504. package/dist/solid/drag-sensor.d.ts +23 -0
  505. package/dist/solid/drag-sensor.d.ts.map +1 -0
  506. package/dist/solid/drag-sensor.js +33 -0
  507. package/dist/solid/drag-sensor.js.map +1 -0
  508. package/dist/solid/drag-track.d.ts +227 -0
  509. package/dist/solid/drag-track.d.ts.map +1 -0
  510. package/dist/solid/drag-track.js +631 -0
  511. package/dist/solid/drag-track.js.map +1 -0
  512. package/dist/solid/drag-transition.d.ts +20 -0
  513. package/dist/solid/drag-transition.d.ts.map +1 -0
  514. package/dist/solid/drag-transition.js +31 -0
  515. package/dist/solid/drag-transition.js.map +1 -0
  516. package/dist/solid/drag.d.ts +23 -0
  517. package/dist/solid/drag.d.ts.map +1 -0
  518. package/dist/solid/drag.js +44 -0
  519. package/dist/solid/drag.js.map +1 -0
  520. package/dist/solid/element-style.d.ts +60 -0
  521. package/dist/solid/element-style.d.ts.map +1 -0
  522. package/dist/solid/element-style.js +50 -0
  523. package/dist/solid/element-style.js.map +1 -0
  524. package/dist/solid/element.d.ts +73 -0
  525. package/dist/solid/element.d.ts.map +1 -0
  526. package/dist/solid/element.jsx +326 -0
  527. package/dist/solid/element.jsx.map +1 -0
  528. package/dist/solid/feature-section.d.ts +18 -0
  529. package/dist/solid/feature-section.d.ts.map +1 -0
  530. package/dist/solid/feature-section.js +13 -0
  531. package/dist/solid/feature-section.js.map +1 -0
  532. package/dist/solid/feature.d.ts +114 -0
  533. package/dist/solid/feature.d.ts.map +1 -0
  534. package/dist/solid/feature.js +248 -0
  535. package/dist/solid/feature.js.map +1 -0
  536. package/dist/solid/features/all.d.ts +10 -0
  537. package/dist/solid/features/all.d.ts.map +1 -0
  538. package/dist/solid/features/all.js +10 -0
  539. package/dist/solid/features/all.js.map +1 -0
  540. package/dist/solid/features/colors.d.ts +12 -0
  541. package/dist/solid/features/colors.d.ts.map +1 -0
  542. package/dist/solid/features/colors.js +34 -0
  543. package/dist/solid/features/colors.js.map +1 -0
  544. package/dist/solid/features/dom-animation.d.ts +11 -0
  545. package/dist/solid/features/dom-animation.d.ts.map +1 -0
  546. package/dist/solid/features/dom-animation.js +7 -0
  547. package/dist/solid/features/dom-animation.js.map +1 -0
  548. package/dist/solid/features/dom-max.d.ts +10 -0
  549. package/dist/solid/features/dom-max.d.ts.map +1 -0
  550. package/dist/solid/features/dom-max.js +4 -0
  551. package/dist/solid/features/dom-max.js.map +1 -0
  552. package/dist/solid/features/drag.d.ts +5 -0
  553. package/dist/solid/features/drag.d.ts.map +1 -0
  554. package/dist/solid/features/drag.js +28 -0
  555. package/dist/solid/features/drag.js.map +1 -0
  556. package/dist/solid/features/focus.d.ts +5 -0
  557. package/dist/solid/features/focus.d.ts.map +1 -0
  558. package/dist/solid/features/focus.js +16 -0
  559. package/dist/solid/features/focus.js.map +1 -0
  560. package/dist/solid/features/hover.d.ts +5 -0
  561. package/dist/solid/features/hover.d.ts.map +1 -0
  562. package/dist/solid/features/hover.js +16 -0
  563. package/dist/solid/features/hover.js.map +1 -0
  564. package/dist/solid/features/in-view.d.ts +5 -0
  565. package/dist/solid/features/in-view.d.ts.map +1 -0
  566. package/dist/solid/features/in-view.js +16 -0
  567. package/dist/solid/features/in-view.js.map +1 -0
  568. package/dist/solid/features/input.d.ts +26 -0
  569. package/dist/solid/features/input.d.ts.map +1 -0
  570. package/dist/solid/features/input.js +31 -0
  571. package/dist/solid/features/input.js.map +1 -0
  572. package/dist/solid/features/keys.d.ts +70 -0
  573. package/dist/solid/features/keys.d.ts.map +1 -0
  574. package/dist/solid/features/keys.js +26 -0
  575. package/dist/solid/features/keys.js.map +1 -0
  576. package/dist/solid/features/layout.d.ts +32 -0
  577. package/dist/solid/features/layout.d.ts.map +1 -0
  578. package/dist/solid/features/layout.js +34 -0
  579. package/dist/solid/features/layout.js.map +1 -0
  580. package/dist/solid/features/pan.d.ts +5 -0
  581. package/dist/solid/features/pan.d.ts.map +1 -0
  582. package/dist/solid/features/pan.js +16 -0
  583. package/dist/solid/features/pan.js.map +1 -0
  584. package/dist/solid/features/press.d.ts +11 -0
  585. package/dist/solid/features/press.d.ts.map +1 -0
  586. package/dist/solid/features/press.js +10 -0
  587. package/dist/solid/features/press.js.map +1 -0
  588. package/dist/solid/focus-sensor.d.ts +19 -0
  589. package/dist/solid/focus-sensor.d.ts.map +1 -0
  590. package/dist/solid/focus-sensor.js +23 -0
  591. package/dist/solid/focus-sensor.js.map +1 -0
  592. package/dist/solid/frame-time.d.ts +21 -0
  593. package/dist/solid/frame-time.d.ts.map +1 -0
  594. package/dist/solid/frame-time.js +41 -0
  595. package/dist/solid/frame-time.js.map +1 -0
  596. package/dist/solid/gesture-callbacks.d.ts +53 -0
  597. package/dist/solid/gesture-callbacks.d.ts.map +1 -0
  598. package/dist/solid/gesture-callbacks.js +184 -0
  599. package/dist/solid/gesture-callbacks.js.map +1 -0
  600. package/dist/solid/gesture-features.d.ts +28 -0
  601. package/dist/solid/gesture-features.d.ts.map +1 -0
  602. package/dist/solid/gesture-features.js +29 -0
  603. package/dist/solid/gesture-features.js.map +1 -0
  604. package/dist/solid/gesture-info.d.ts +59 -0
  605. package/dist/solid/gesture-info.d.ts.map +1 -0
  606. package/dist/solid/gesture-info.js +23 -0
  607. package/dist/solid/gesture-info.js.map +1 -0
  608. package/dist/solid/hover-sensor.d.ts +19 -0
  609. package/dist/solid/hover-sensor.d.ts.map +1 -0
  610. package/dist/solid/hover-sensor.js +23 -0
  611. package/dist/solid/hover-sensor.js.map +1 -0
  612. package/dist/solid/imperative.d.ts +195 -0
  613. package/dist/solid/imperative.d.ts.map +1 -0
  614. package/dist/solid/imperative.js +536 -0
  615. package/dist/solid/imperative.js.map +1 -0
  616. package/dist/solid/index.d.ts +180 -0
  617. package/dist/solid/index.d.ts.map +1 -0
  618. package/dist/solid/index.js +165 -0
  619. package/dist/solid/index.js.map +1 -0
  620. package/dist/solid/instant.d.ts +44 -0
  621. package/dist/solid/instant.d.ts.map +1 -0
  622. package/dist/solid/instant.js +49 -0
  623. package/dist/solid/instant.js.map +1 -0
  624. package/dist/solid/layout-group.d.ts +14 -0
  625. package/dist/solid/layout-group.d.ts.map +1 -0
  626. package/dist/solid/layout-group.js +27 -0
  627. package/dist/solid/layout-group.js.map +1 -0
  628. package/dist/solid/layout-member.d.ts +117 -0
  629. package/dist/solid/layout-member.d.ts.map +1 -0
  630. package/dist/solid/layout-member.js +164 -0
  631. package/dist/solid/layout-member.js.map +1 -0
  632. package/dist/solid/layout-projection.d.ts +22 -0
  633. package/dist/solid/layout-projection.d.ts.map +1 -0
  634. package/dist/solid/layout-projection.js +19 -0
  635. package/dist/solid/layout-projection.js.map +1 -0
  636. package/dist/solid/layout.d.ts +76 -0
  637. package/dist/solid/layout.d.ts.map +1 -0
  638. package/dist/solid/layout.jsx +80 -0
  639. package/dist/solid/layout.jsx.map +1 -0
  640. package/dist/solid/live-style.d.ts +147 -0
  641. package/dist/solid/live-style.d.ts.map +1 -0
  642. package/dist/solid/live-style.js +304 -0
  643. package/dist/solid/live-style.js.map +1 -0
  644. package/dist/solid/live-value.d.ts +144 -0
  645. package/dist/solid/live-value.d.ts.map +1 -0
  646. package/dist/solid/live-value.js +223 -0
  647. package/dist/solid/live-value.js.map +1 -0
  648. package/dist/solid/motion-props.d.ts +75 -0
  649. package/dist/solid/motion-props.d.ts.map +1 -0
  650. package/dist/solid/motion-props.js +314 -0
  651. package/dist/solid/motion-props.js.map +1 -0
  652. package/dist/solid/owner-scope.d.ts +16 -0
  653. package/dist/solid/owner-scope.d.ts.map +1 -0
  654. package/dist/solid/owner-scope.js +31 -0
  655. package/dist/solid/owner-scope.js.map +1 -0
  656. package/dist/solid/page-point.d.ts +35 -0
  657. package/dist/solid/page-point.d.ts.map +1 -0
  658. package/dist/solid/page-point.js +87 -0
  659. package/dist/solid/page-point.js.map +1 -0
  660. package/dist/solid/presence-controller.d.ts +122 -0
  661. package/dist/solid/presence-controller.d.ts.map +1 -0
  662. package/dist/solid/presence-controller.js +1207 -0
  663. package/dist/solid/presence-controller.js.map +1 -0
  664. package/dist/solid/presence-record.d.ts +167 -0
  665. package/dist/solid/presence-record.d.ts.map +1 -0
  666. package/dist/solid/presence-record.js +26 -0
  667. package/dist/solid/presence-record.js.map +1 -0
  668. package/dist/solid/presence.d.ts +95 -0
  669. package/dist/solid/presence.d.ts.map +1 -0
  670. package/dist/solid/presence.jsx +195 -0
  671. package/dist/solid/presence.jsx.map +1 -0
  672. package/dist/solid/press-sensor.d.ts +20 -0
  673. package/dist/solid/press-sensor.d.ts.map +1 -0
  674. package/dist/solid/press-sensor.js +24 -0
  675. package/dist/solid/press-sensor.js.map +1 -0
  676. package/dist/solid/press.d.ts +24 -0
  677. package/dist/solid/press.d.ts.map +1 -0
  678. package/dist/solid/press.js +19 -0
  679. package/dist/solid/press.js.map +1 -0
  680. package/dist/solid/provider.d.ts +263 -0
  681. package/dist/solid/provider.d.ts.map +1 -0
  682. package/dist/solid/provider.jsx +411 -0
  683. package/dist/solid/provider.jsx.map +1 -0
  684. package/dist/solid/reactivity.d.ts +27 -0
  685. package/dist/solid/reactivity.d.ts.map +1 -0
  686. package/dist/solid/reactivity.js +9 -0
  687. package/dist/solid/reactivity.js.map +1 -0
  688. package/dist/solid/reorder-input.d.ts +22 -0
  689. package/dist/solid/reorder-input.d.ts.map +1 -0
  690. package/dist/solid/reorder-input.js +45 -0
  691. package/dist/solid/reorder-input.js.map +1 -0
  692. package/dist/solid/reorder.d.ts +241 -0
  693. package/dist/solid/reorder.d.ts.map +1 -0
  694. package/dist/solid/reorder.jsx +427 -0
  695. package/dist/solid/reorder.jsx.map +1 -0
  696. package/dist/solid/retarget-legs.d.ts +189 -0
  697. package/dist/solid/retarget-legs.d.ts.map +1 -0
  698. package/dist/solid/retarget-legs.js +825 -0
  699. package/dist/solid/retarget-legs.js.map +1 -0
  700. package/dist/solid/runtime.d.ts +179 -0
  701. package/dist/solid/runtime.d.ts.map +1 -0
  702. package/dist/solid/runtime.js +237 -0
  703. package/dist/solid/runtime.js.map +1 -0
  704. package/dist/solid/sensors.d.ts +95 -0
  705. package/dist/solid/sensors.d.ts.map +1 -0
  706. package/dist/solid/sensors.js +154 -0
  707. package/dist/solid/sensors.js.map +1 -0
  708. package/dist/solid/server-interpolators.d.ts +13 -0
  709. package/dist/solid/server-interpolators.d.ts.map +1 -0
  710. package/dist/solid/server-interpolators.js +20 -0
  711. package/dist/solid/server-interpolators.js.map +1 -0
  712. package/dist/solid/server.d.ts +9 -0
  713. package/dist/solid/server.d.ts.map +1 -0
  714. package/dist/solid/server.js +20 -0
  715. package/dist/solid/server.js.map +1 -0
  716. package/dist/solid/solid-reactivity.d.ts +3 -0
  717. package/dist/solid/solid-reactivity.d.ts.map +1 -0
  718. package/dist/solid/solid-reactivity.js +19 -0
  719. package/dist/solid/solid-reactivity.js.map +1 -0
  720. package/dist/solid/spine.d.ts +597 -0
  721. package/dist/solid/spine.d.ts.map +1 -0
  722. package/dist/solid/spine.js +2761 -0
  723. package/dist/solid/spine.js.map +1 -0
  724. package/dist/solid/stagger.d.ts +29 -0
  725. package/dist/solid/stagger.d.ts.map +1 -0
  726. package/dist/solid/stagger.js +13 -0
  727. package/dist/solid/stagger.js.map +1 -0
  728. package/dist/solid/unstable/v2/bridge.d.ts +33 -0
  729. package/dist/solid/unstable/v2/bridge.d.ts.map +1 -0
  730. package/dist/solid/unstable/v2/bridge.js +76 -0
  731. package/dist/solid/unstable/v2/bridge.js.map +1 -0
  732. package/dist/solid/unstable/v2/complete.d.ts +21 -0
  733. package/dist/solid/unstable/v2/complete.d.ts.map +1 -0
  734. package/dist/solid/unstable/v2/complete.js +27 -0
  735. package/dist/solid/unstable/v2/complete.js.map +1 -0
  736. package/dist/solid/unstable/v2/config-view.d.ts +49 -0
  737. package/dist/solid/unstable/v2/config-view.d.ts.map +1 -0
  738. package/dist/solid/unstable/v2/config-view.js +114 -0
  739. package/dist/solid/unstable/v2/config-view.js.map +1 -0
  740. package/dist/solid/unstable/v2/create-animate.d.ts +31 -0
  741. package/dist/solid/unstable/v2/create-animate.d.ts.map +1 -0
  742. package/dist/solid/unstable/v2/create-animate.js +102 -0
  743. package/dist/solid/unstable/v2/create-animate.js.map +1 -0
  744. package/dist/solid/unstable/v2/cycle.d.ts +20 -0
  745. package/dist/solid/unstable/v2/cycle.d.ts.map +1 -0
  746. package/dist/solid/unstable/v2/cycle.js +30 -0
  747. package/dist/solid/unstable/v2/cycle.js.map +1 -0
  748. package/dist/solid/unstable/v2/drag-sensor.d.ts +23 -0
  749. package/dist/solid/unstable/v2/drag-sensor.d.ts.map +1 -0
  750. package/dist/solid/unstable/v2/drag-sensor.js +32 -0
  751. package/dist/solid/unstable/v2/drag-sensor.js.map +1 -0
  752. package/dist/solid/unstable/v2/element.d.ts +178 -0
  753. package/dist/solid/unstable/v2/element.d.ts.map +1 -0
  754. package/dist/solid/unstable/v2/element.jsx +325 -0
  755. package/dist/solid/unstable/v2/element.jsx.map +1 -0
  756. package/dist/solid/unstable/v2/feature-section.d.ts +12 -0
  757. package/dist/solid/unstable/v2/feature-section.d.ts.map +1 -0
  758. package/dist/solid/unstable/v2/feature-section.js +23 -0
  759. package/dist/solid/unstable/v2/feature-section.js.map +1 -0
  760. package/dist/solid/unstable/v2/focus-sensor.d.ts +13 -0
  761. package/dist/solid/unstable/v2/focus-sensor.d.ts.map +1 -0
  762. package/dist/solid/unstable/v2/focus-sensor.js +23 -0
  763. package/dist/solid/unstable/v2/focus-sensor.js.map +1 -0
  764. package/dist/solid/unstable/v2/hover-sensor.d.ts +12 -0
  765. package/dist/solid/unstable/v2/hover-sensor.d.ts.map +1 -0
  766. package/dist/solid/unstable/v2/hover-sensor.js +22 -0
  767. package/dist/solid/unstable/v2/hover-sensor.js.map +1 -0
  768. package/dist/solid/unstable/v2/index.d.ts +131 -0
  769. package/dist/solid/unstable/v2/index.d.ts.map +1 -0
  770. package/dist/solid/unstable/v2/index.js +114 -0
  771. package/dist/solid/unstable/v2/index.js.map +1 -0
  772. package/dist/solid/unstable/v2/layout-projection.d.ts +21 -0
  773. package/dist/solid/unstable/v2/layout-projection.d.ts.map +1 -0
  774. package/dist/solid/unstable/v2/layout-projection.js +18 -0
  775. package/dist/solid/unstable/v2/layout-projection.js.map +1 -0
  776. package/dist/solid/unstable/v2/layout.d.ts +47 -0
  777. package/dist/solid/unstable/v2/layout.d.ts.map +1 -0
  778. package/dist/solid/unstable/v2/layout.jsx +62 -0
  779. package/dist/solid/unstable/v2/layout.jsx.map +1 -0
  780. package/dist/solid/unstable/v2/lifecycle.d.ts +267 -0
  781. package/dist/solid/unstable/v2/lifecycle.d.ts.map +1 -0
  782. package/dist/solid/unstable/v2/lifecycle.js +457 -0
  783. package/dist/solid/unstable/v2/lifecycle.js.map +1 -0
  784. package/dist/solid/unstable/v2/live-value.d.ts +146 -0
  785. package/dist/solid/unstable/v2/live-value.d.ts.map +1 -0
  786. package/dist/solid/unstable/v2/live-value.js +235 -0
  787. package/dist/solid/unstable/v2/live-value.js.map +1 -0
  788. package/dist/solid/unstable/v2/presence-handle.d.ts +55 -0
  789. package/dist/solid/unstable/v2/presence-handle.d.ts.map +1 -0
  790. package/dist/solid/unstable/v2/presence-handle.js +119 -0
  791. package/dist/solid/unstable/v2/presence-handle.js.map +1 -0
  792. package/dist/solid/unstable/v2/presence-hooks.d.ts +51 -0
  793. package/dist/solid/unstable/v2/presence-hooks.d.ts.map +1 -0
  794. package/dist/solid/unstable/v2/presence-hooks.js +115 -0
  795. package/dist/solid/unstable/v2/presence-hooks.js.map +1 -0
  796. package/dist/solid/unstable/v2/presence.d.ts +89 -0
  797. package/dist/solid/unstable/v2/presence.d.ts.map +1 -0
  798. package/dist/solid/unstable/v2/presence.jsx +107 -0
  799. package/dist/solid/unstable/v2/presence.jsx.map +1 -0
  800. package/dist/solid/unstable/v2/press-sensor.d.ts +13 -0
  801. package/dist/solid/unstable/v2/press-sensor.d.ts.map +1 -0
  802. package/dist/solid/unstable/v2/press-sensor.js +23 -0
  803. package/dist/solid/unstable/v2/press-sensor.js.map +1 -0
  804. package/dist/solid/unstable/v2/provider.d.ts +239 -0
  805. package/dist/solid/unstable/v2/provider.d.ts.map +1 -0
  806. package/dist/solid/unstable/v2/provider.jsx +423 -0
  807. package/dist/solid/unstable/v2/provider.jsx.map +1 -0
  808. package/dist/solid/unstable/v2/reorder.d.ts +292 -0
  809. package/dist/solid/unstable/v2/reorder.d.ts.map +1 -0
  810. package/dist/solid/unstable/v2/reorder.jsx +525 -0
  811. package/dist/solid/unstable/v2/reorder.jsx.map +1 -0
  812. package/dist/solid/unstable/v2/sensors.d.ts +91 -0
  813. package/dist/solid/unstable/v2/sensors.d.ts.map +1 -0
  814. package/dist/solid/unstable/v2/sensors.js +124 -0
  815. package/dist/solid/unstable/v2/sensors.js.map +1 -0
  816. package/dist/solid/unstable/v2/solid-reactivity.d.ts +61 -0
  817. package/dist/solid/unstable/v2/solid-reactivity.d.ts.map +1 -0
  818. package/dist/solid/unstable/v2/solid-reactivity.js +62 -0
  819. package/dist/solid/unstable/v2/solid-reactivity.js.map +1 -0
  820. package/dist/solid/unstable/v2/variant-node.d.ts +51 -0
  821. package/dist/solid/unstable/v2/variant-node.d.ts.map +1 -0
  822. package/dist/solid/unstable/v2/variant-node.js +336 -0
  823. package/dist/solid/unstable/v2/variant-node.js.map +1 -0
  824. package/dist/solid/unstable/v2/w.d.ts +42 -0
  825. package/dist/solid/unstable/v2/w.d.ts.map +1 -0
  826. package/dist/solid/unstable/v2/w.jsx +22 -0
  827. package/dist/solid/unstable/v2/w.jsx.map +1 -0
  828. package/dist/solid/unstable/v2/waiters.d.ts +72 -0
  829. package/dist/solid/unstable/v2/waiters.d.ts.map +1 -0
  830. package/dist/solid/unstable/v2/waiters.js +175 -0
  831. package/dist/solid/unstable/v2/waiters.js.map +1 -0
  832. package/dist/solid/unstable/v2/ward.d.ts +393 -0
  833. package/dist/solid/unstable/v2/ward.d.ts.map +1 -0
  834. package/dist/solid/unstable/v2/ward.jsx +1475 -0
  835. package/dist/solid/unstable/v2/ward.jsx.map +1 -0
  836. package/dist/solid/unstable/v2/wardic-config.d.ts +68 -0
  837. package/dist/solid/unstable/v2/wardic-config.d.ts.map +1 -0
  838. package/dist/solid/unstable/v2/wardic-config.jsx +28 -0
  839. package/dist/solid/unstable/v2/wardic-config.jsx.map +1 -0
  840. package/dist/solid/unstable/v2/wardic.d.ts +28 -0
  841. package/dist/solid/unstable/v2/wardic.d.ts.map +1 -0
  842. package/dist/solid/unstable/v2/wardic.jsx +16 -0
  843. package/dist/solid/unstable/v2/wardic.jsx.map +1 -0
  844. package/dist/solid/variant-node.d.ts +32 -0
  845. package/dist/solid/variant-node.d.ts.map +1 -0
  846. package/dist/solid/variant-node.js +257 -0
  847. package/dist/solid/variant-node.js.map +1 -0
  848. package/dist/solid/variant-target.d.ts +102 -0
  849. package/dist/solid/variant-target.d.ts.map +1 -0
  850. package/dist/solid/variant-target.js +180 -0
  851. package/dist/solid/variant-target.js.map +1 -0
  852. package/dist/solid/variant-tree.d.ts +349 -0
  853. package/dist/solid/variant-tree.d.ts.map +1 -0
  854. package/dist/solid/variant-tree.js +358 -0
  855. package/dist/solid/variant-tree.js.map +1 -0
  856. package/dist/solid/variants.d.ts +21 -0
  857. package/dist/solid/variants.d.ts.map +1 -0
  858. package/dist/solid/variants.js +43 -0
  859. package/dist/solid/variants.js.map +1 -0
  860. package/dist/solid/w.d.ts +42 -0
  861. package/dist/solid/w.d.ts.map +1 -0
  862. package/dist/solid/w.jsx +23 -0
  863. package/dist/solid/w.jsx.map +1 -0
  864. package/dist/solid/ward-keys.d.ts +236 -0
  865. package/dist/solid/ward-keys.d.ts.map +1 -0
  866. package/dist/solid/ward-keys.js +2 -0
  867. package/dist/solid/ward-keys.js.map +1 -0
  868. package/dist/solid/wardic-component.d.ts +50 -0
  869. package/dist/solid/wardic-component.d.ts.map +1 -0
  870. package/dist/solid/wardic-component.js +74 -0
  871. package/dist/solid/wardic-component.js.map +1 -0
  872. package/dist/solid/wardic-config-value.d.ts +87 -0
  873. package/dist/solid/wardic-config-value.d.ts.map +1 -0
  874. package/dist/solid/wardic-config-value.js +106 -0
  875. package/dist/solid/wardic-config-value.js.map +1 -0
  876. package/dist/solid/wardic-config.d.ts +69 -0
  877. package/dist/solid/wardic-config.d.ts.map +1 -0
  878. package/dist/solid/wardic-config.jsx +30 -0
  879. package/dist/solid/wardic-config.jsx.map +1 -0
  880. package/dist/solid/wardic.d.ts +45 -0
  881. package/dist/solid/wardic.d.ts.map +1 -0
  882. package/dist/solid/wardic.jsx +31 -0
  883. package/dist/solid/wardic.jsx.map +1 -0
  884. package/package.json +98 -4
  885. package/src/animation-controls.ts +204 -0
  886. package/src/animation-frame.ts +32 -0
  887. package/src/appear.ts +804 -0
  888. package/src/arc.ts +34 -0
  889. package/src/bridge.ts +98 -0
  890. package/src/complete.ts +45 -0
  891. package/src/config.ts +805 -0
  892. package/src/create-animate.ts +41 -0
  893. package/src/create-ward.tsx +1271 -0
  894. package/src/cycle-index.ts +18 -0
  895. package/src/cycle.ts +34 -0
  896. package/src/directive.ts +87 -0
  897. package/src/drag-constraints.ts +103 -0
  898. package/src/drag-controls.ts +94 -0
  899. package/src/drag-samples.ts +54 -0
  900. package/src/drag-sensor.ts +46 -0
  901. package/src/drag-track.ts +937 -0
  902. package/src/drag-transition.ts +43 -0
  903. package/src/drag.ts +58 -0
  904. package/src/element-style.ts +112 -0
  905. package/src/element.tsx +400 -0
  906. package/src/feature-section.ts +33 -0
  907. package/src/feature.ts +342 -0
  908. package/src/features/all.ts +18 -0
  909. package/src/features/colors.ts +36 -0
  910. package/src/features/dom-animation.ts +15 -0
  911. package/src/features/dom-max.ts +11 -0
  912. package/src/features/drag.ts +30 -0
  913. package/src/features/focus.ts +17 -0
  914. package/src/features/hover.ts +17 -0
  915. package/src/features/in-view.ts +17 -0
  916. package/src/features/input.ts +42 -0
  917. package/src/features/keys.ts +89 -0
  918. package/src/features/layout.ts +54 -0
  919. package/src/features/pan.ts +17 -0
  920. package/src/features/press.ts +17 -0
  921. package/src/focus-sensor.ts +32 -0
  922. package/src/frame-time.ts +45 -0
  923. package/src/gesture-callbacks.ts +212 -0
  924. package/src/gesture-features.ts +35 -0
  925. package/src/gesture-info.ts +81 -0
  926. package/src/hover-sensor.ts +32 -0
  927. package/src/imperative.ts +782 -0
  928. package/src/index.ts +334 -0
  929. package/src/instant.ts +90 -0
  930. package/src/layout-group.ts +32 -0
  931. package/src/layout-member.ts +300 -0
  932. package/src/layout-projection.ts +28 -0
  933. package/src/layout.tsx +127 -0
  934. package/src/live-style.ts +449 -0
  935. package/src/live-value.ts +378 -0
  936. package/src/motion-props.ts +325 -0
  937. package/src/owner-scope.ts +31 -0
  938. package/src/page-point.ts +98 -0
  939. package/src/presence-controller.ts +1483 -0
  940. package/src/presence-record.ts +189 -0
  941. package/src/presence.tsx +269 -0
  942. package/src/press-sensor.ts +33 -0
  943. package/src/press.ts +40 -0
  944. package/src/provider.tsx +526 -0
  945. package/src/reactivity.ts +29 -0
  946. package/src/reorder-input.ts +53 -0
  947. package/src/reorder.tsx +703 -0
  948. package/src/retarget-legs.ts +1048 -0
  949. package/src/runtime.ts +388 -0
  950. package/src/sensors.ts +189 -0
  951. package/src/server-interpolators.ts +33 -0
  952. package/src/server.ts +21 -0
  953. package/src/solid-reactivity.ts +21 -0
  954. package/src/spine.ts +3385 -0
  955. package/src/stagger.ts +31 -0
  956. package/src/unstable/v2/bridge.ts +79 -0
  957. package/src/unstable/v2/complete.ts +47 -0
  958. package/src/unstable/v2/config-view.ts +156 -0
  959. package/src/unstable/v2/create-animate.ts +123 -0
  960. package/src/unstable/v2/cycle.ts +33 -0
  961. package/src/unstable/v2/drag-sensor.ts +44 -0
  962. package/src/unstable/v2/element.tsx +478 -0
  963. package/src/unstable/v2/feature-section.ts +32 -0
  964. package/src/unstable/v2/focus-sensor.ts +31 -0
  965. package/src/unstable/v2/hover-sensor.ts +30 -0
  966. package/src/unstable/v2/index.ts +270 -0
  967. package/src/unstable/v2/layout-projection.ts +27 -0
  968. package/src/unstable/v2/layout.tsx +89 -0
  969. package/src/unstable/v2/lifecycle.ts +612 -0
  970. package/src/unstable/v2/live-value.ts +414 -0
  971. package/src/unstable/v2/presence-handle.ts +159 -0
  972. package/src/unstable/v2/presence-hooks.ts +157 -0
  973. package/src/unstable/v2/presence.tsx +174 -0
  974. package/src/unstable/v2/press-sensor.ts +31 -0
  975. package/src/unstable/v2/provider.tsx +524 -0
  976. package/src/unstable/v2/reorder.tsx +880 -0
  977. package/src/unstable/v2/sensors.ts +169 -0
  978. package/src/unstable/v2/solid-reactivity.ts +69 -0
  979. package/src/unstable/v2/variant-node.ts +446 -0
  980. package/src/unstable/v2/w.tsx +49 -0
  981. package/src/unstable/v2/waiters.ts +212 -0
  982. package/src/unstable/v2/ward.tsx +2068 -0
  983. package/src/unstable/v2/wardic-config.tsx +84 -0
  984. package/src/unstable/v2/wardic.tsx +41 -0
  985. package/src/variant-node.ts +368 -0
  986. package/src/variant-target.ts +234 -0
  987. package/src/variant-tree.ts +638 -0
  988. package/src/variants.ts +47 -0
  989. package/src/w.tsx +59 -0
  990. package/src/ward-keys.ts +343 -0
  991. package/src/wardic-component.ts +96 -0
  992. package/src/wardic-config-value.ts +150 -0
  993. package/src/wardic-config.tsx +78 -0
  994. package/src/wardic.tsx +59 -0
package/src/appear.ts ADDED
@@ -0,0 +1,804 @@
1
+ /**
2
+ * Appear animations in the Solid binding (#48, ADR-0044): a server-rendered mount animation played
3
+ * in CSS from first paint, and taken over at mount (the **Handoff**).
4
+ *
5
+ * - **Both sides** describe an element's mount animation the same way ({@link MountAnimation}): its
6
+ * starting values, its targets, its own transition and whether motion is reduced. The rule's name
7
+ * is the hash of that description ({@link keyOf}), so the client tells a Handoff it can continue
8
+ * from one it can't.
9
+ * - **On a server** the provider holds one render's {@link ServerAppear}. Each element that
10
+ * qualifies takes a slot (its inline `animation: var(--wardic-aN)`); a Variant child joins its
11
+ * parent's group, in render order. Once the render is done, `css()` works out each one's timing
12
+ * (its stagger, its `when`) and writes the head's `<style>`.
13
+ * - **At mount** the spine finds the element's animation ({@link handoffOf}), starts its first legs
14
+ * that far in, and removes it in its first commit.
15
+ */
16
+ import type * as DefaultTransition from "@wardic/core/DefaultTransition"
17
+ import * as Easing from "@wardic/core/Easing"
18
+ import type * as Frame from "@wardic/core/Frame"
19
+ import * as Machine from "@wardic/core/Machine"
20
+ import type * as InterpolatorRegistry from "@wardic/core/InterpolatorRegistry"
21
+ import type * as ReducedMotion from "@wardic/core/ReducedMotion"
22
+ import type * as Values from "@wardic/core/Values"
23
+ import * as Appear from "@wardic/dom/Appear"
24
+ import type * as DomRenderer from "@wardic/dom/DomRenderer"
25
+ import * as DomDefaultTransition from "@wardic/dom/DomDefaultTransition"
26
+ import * as DomPositionalKeys from "@wardic/dom/DomPositionalKeys"
27
+ import * as OwnValues from "@wardic/dom/OwnValues"
28
+ import * as Arr from "effect/Array"
29
+ import * as Bool from "effect/Boolean"
30
+ import * as Effect from "effect/Effect"
31
+ import { identity } from "effect/Function"
32
+ import * as Match from "effect/Match"
33
+ import * as Option from "effect/Option"
34
+ import * as Order from "effect/Order"
35
+ import * as Predicate from "effect/Predicate"
36
+ import * as Rec from "effect/Record"
37
+ import * as Result from "effect/Result"
38
+ import * as UndefinedOr from "effect/UndefinedOr"
39
+ import type { WardicTransition } from "./config.ts"
40
+ import { entriesOf, type KeyframesStart, keyframesFrom, type Leg, legsOf, NO_VELOCITY, runOf, type StopsByKey, transitionForKey } from "./retarget-legs.ts"
41
+ import { withServerInterpolators } from "./server-interpolators.ts"
42
+ import type { Keyframes } from "./variant-target.ts"
43
+ import { childDelayOf, type WardicStaggerConfig } from "./variant-tree.ts"
44
+
45
+ // --- The mount animation, on both sides -------------------------------------------------------
46
+
47
+ /** An element's mount animation, described the same on the server and the client. */
48
+ export interface MountAnimation {
49
+ /** The element's tag, for SVG's routing; `undefined` for an element whose tag isn't known. */
50
+ readonly tag: string | undefined
51
+ /** Each animated key's start. */
52
+ readonly from: Values.Values
53
+ /** Each animated key's target. */
54
+ readonly to: Values.Values
55
+ /** The element's own transition: its stagger isn't in it (ADR-0007). */
56
+ readonly transition: WardicTransition | undefined
57
+ /** Whether reduced motion is on for it (ADR-0029). */
58
+ readonly reduced: boolean
59
+ /**
60
+ * Whether it's a layout node (#245): drawn through its projection at rest, as the client draws
61
+ * it, its own translate on top (#363). Part of its rule's name (`Appear.Spec.projected`).
62
+ */
63
+ readonly layout: boolean
64
+ /** Each key's Keyframes of more than two stops (#429), `from` at their first: part of its key. Left out with none. */
65
+ readonly stops?: StopsByKey | undefined
66
+ /**
67
+ * Whether it's a **Skipped animation** (#468): every key lands on its first frame, so its rule is
68
+ * 0 s, holding its end from first paint. Part of its key; left out when it isn't.
69
+ */
70
+ readonly skipped?: boolean | undefined
71
+ /** Its **Transform template** (#443): its stops drawn through it, as the client draws them. Left out with none. */
72
+ readonly template?: DomRenderer.TransformTemplate | undefined
73
+ }
74
+
75
+ /** What stands in for a function with no easing name: canonical text holding it is no key. */
76
+ const UNNAMED = "\u0000unnamed"
77
+
78
+ /**
79
+ * A value as canonical text: JSON with each object's keys in order, `undefined`s left out, and a
80
+ * function by its easing name (`Easing.nameOf`), else {@link UNNAMED}. Written directly, its cases
81
+ * built once at module load: it runs per element (#69's PR 2).
82
+ */
83
+ const textOf: (value: unknown) => string = /*#__PURE__*/ Match.type<unknown>().pipe(
84
+ Match.when(Predicate.isFunction, (fn) => Option.match(Easing.nameOf(fn as Easing.Easing), { onNone: () => UNNAMED, onSome: (easing) => `{"easing":${JSON.stringify(easing)}}` })),
85
+ Match.when(Arr.isArray, (items) => `[${Arr.map(items as ReadonlyArray<unknown>, (item) => textOf(item)).join(",")}]`),
86
+ Match.when(Predicate.isObject, (record) => {
87
+ const keys = Arr.sort(Arr.filter(Object.keys(record), (key) => Predicate.isNotUndefined((record as Record<string, unknown>)[key])), Order.String)
88
+ return `{${Arr.map(keys, (key) => `${JSON.stringify(key)}:${textOf((record as Record<string, unknown>)[key])}`).join(",")}}`
89
+ }),
90
+ Match.orElse((v) => String(JSON.stringify(v))),
91
+ )
92
+
93
+ /** Where a Path's key samples it (#438): nine points, its ends among them. */
94
+ const PATH_SAMPLES = [0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1] as const
95
+
96
+ /** An axis's number in `values`, its identity 0 when it has none (#438), as the leg reads it on a server. */
97
+ const axisIn = (values: Values.Values, key: "x" | "y"): number => UndefinedOr.match(values[key], { onUndefined: () => 0, onDefined: (v) => Number(v) })
98
+
99
+ /**
100
+ * A mount animation's transition as its key holds it: a Path (#438), a function, as its samples
101
+ * between the mount's ends, so two paths key apart and one path keys the same each time. Sampling it
102
+ * again is safe: an arc's memory of its side changes only with the way it travels.
103
+ */
104
+ const keyedTransitionOf = (m: MountAnimation): unknown =>
105
+ UndefinedOr.match(m.transition, {
106
+ onUndefined: () => null,
107
+ onDefined: (t: WardicTransition) =>
108
+ UndefinedOr.match(t.path, {
109
+ onUndefined: () => t,
110
+ onDefined: (path) => {
111
+ const from = { x: axisIn(m.from, "x"), y: axisIn(m.from, "y") }
112
+ const at = path(from, { x: UndefinedOr.match(m.to.x, { onUndefined: () => from.x, onDefined: Number }), y: UndefinedOr.match(m.to.y, { onUndefined: () => from.y, onDefined: Number }) })
113
+ return { ...t, path: Arr.map(PATH_SAMPLES, (p) => at(p)) }
114
+ },
115
+ }),
116
+ })
117
+
118
+ /** A value as canonical text; `None` when a function in it has no easing name. */
119
+ const canonical = (value: unknown): Option.Option<string> => Option.filter(Option.some(textOf(value)), (text) => Bool.not(text.includes(UNNAMED)))
120
+
121
+ /** Each mount animation's canonical starts, targets and transition, by its `from`: both its plays share one. */
122
+ // Module state (#460, Q7): a cache held weakly by the object it's for, so it goes with it.
123
+ const baseKeys = /*#__PURE__*/ new WeakMap<Values.Values, Option.Option<string>>()
124
+
125
+ /**
126
+ * The mount animation's key: its starts, targets and transition as one canonical text, and whether
127
+ * motion is reduced. `None` when the transition holds a function with no easing name
128
+ * (`Easing.nameOf`): the server can't tell it from another, so the element keeps its Starting style.
129
+ */
130
+ export const keyOf = (m: MountAnimation): Option.Option<string> => {
131
+ const base = Option.getOrElse(Option.fromUndefinedOr(baseKeys.get(m.from)), () => {
132
+ const computed = canonical({ from: m.from, to: m.to, transition: keyedTransitionOf(m), stops: m.stops })
133
+ baseKeys.set(m.from, computed)
134
+ return computed
135
+ })
136
+ // A skipped one's (#468) named apart: an unskipped one's name is as it was.
137
+ return Option.map(base, (text) => Bool.match(m.skipped === true, { onTrue: () => `${text}|skipped`, onFalse: () => `${text}|reduced:${m.reduced}` }))
138
+ }
139
+
140
+ /** Whether a mount animation plays for ever: its transition repeats for ever, and it isn't skipped (#468), which lands it. */
141
+ const playsForever = (m: MountAnimation): boolean => Bool.and(m.skipped !== true, repeatsForever(m.transition))
142
+
143
+ /** Whether a transition repeats for ever: a tween's `repeat: Infinity`, a tween as it runs (ADR-0051). */
144
+ export const repeatsForever = (transition: WardicTransition | undefined): boolean =>
145
+ UndefinedOr.match(runOf(transition), { onUndefined: () => false, onDefined: (run) => Bool.and(run.type === "tween", (run as Machine.AnimateOptions).repeat === Number.POSITIVE_INFINITY) })
146
+
147
+ /** A transition's own delay, 0 without one. */
148
+ const ownDelayOf = (transition: WardicTransition | undefined): number =>
149
+ UndefinedOr.match(transition, { onUndefined: () => 0, onDefined: ({ delay = 0 }) => delay })
150
+
151
+ /**
152
+ * The seconds a rule holds before it moves, of the delay the client counts: a transition's own
153
+ * delay is in its rule, except a forever-repeating one's, whose rule is a cycle and whose own delay
154
+ * goes in `animation-delay` with the stagger.
155
+ */
156
+ const heldInRule = (transition: WardicTransition | undefined): number =>
157
+ Bool.match(repeatsForever(transition), { onTrue: () => 0, onFalse: () => ownDelayOf(transition) })
158
+
159
+ /**
160
+ * The transition a server samples: as given, but for one that repeats for ever, two runs and the
161
+ * delay that follows them, with no delay before (one cycle of the CSS, played `infinite`). Two
162
+ * runs, so a cycle is exact for every `repeatType`, `reverse` and `mirror` included.
163
+ */
164
+ const sampledTransition = (transition: WardicTransition | undefined): WardicTransition | undefined =>
165
+ Bool.match(repeatsForever(transition), {
166
+ onTrue: () => ({ ...transition, delay: 0, repeat: 1 }) as WardicTransition,
167
+ onFalse: () => transition,
168
+ })
169
+
170
+ /**
171
+ * One machine of a Retarget's legs, run together: each step steps every leg not yet settled, and
172
+ * merges their values; it settles with the last. What a server samples. Built with the DOM's
173
+ * Interpolators (a server projects with the DOM's `project`, ADR-0021 decision 2).
174
+ */
175
+ const together = (legs: ReadonlyArray<Leg>): Machine.Machine<Frame.Frame<Values.Values>> => {
176
+ const machines = Effect.runSync(
177
+ withServerInterpolators(Effect.all(Arr.map(legs, (leg): Effect.Effect<Machine.Machine<Frame.Frame<unknown>>, never, InterpolatorRegistry.InterpolatorRegistry> => machineOfLeg(leg)))),
178
+ )
179
+ return Machine.make({
180
+ settles: true,
181
+ span: { name: "wardic.appear", attributes: { legs: legs.length } },
182
+ start: () => {
183
+ const runs = Arr.map(machines, (machine, i) => ({ step: machine.start(), key: keyOfLeg(legs[i] as Leg), last: Option.none<Frame.Frame<unknown>>() }))
184
+ return (dt) => {
185
+ const value: Record<string, number | string> = {}
186
+ const done = Arr.reduce(runs, true, (all, run) => {
187
+ const frame = Option.getOrElse(Option.filter(run.last, (last) => last.done), () => run.step(dt))
188
+ run.last = Option.some(frame)
189
+ Option.match(run.key, {
190
+ onNone: () => Object.assign(value, frame.value as Values.Values),
191
+ onSome: (key) => Object.assign(value, { [key]: frame.value as number }),
192
+ })
193
+ return Bool.and(all, frame.done)
194
+ })
195
+ return { value, done }
196
+ }
197
+ },
198
+ })
199
+ }
200
+
201
+ /** A leg's machine, built: a Blend's through the Interpolators `together` provides. */
202
+ const machineOfLeg = (leg: Leg): Effect.Effect<Machine.Machine<Frame.Frame<unknown>>, never, InterpolatorRegistry.InterpolatorRegistry> =>
203
+ Bool.match(leg._tag === "Blend", {
204
+ onTrue: () => (leg as Extract<Leg, { _tag: "Blend" }>).machine(),
205
+ onFalse: () => Effect.sync(() => (leg as Exclude<Leg, { _tag: "Blend" }>).machine() as Machine.Machine<Frame.Frame<unknown>>),
206
+ })
207
+
208
+ /** The key a Follow leg's single value is: its own. */
209
+ const keyOfLeg = (leg: Leg): Option.Option<string> =>
210
+ Bool.match(leg._tag === "Follow", { onTrue: () => Option.some((leg as Extract<Leg, { _tag: "Follow" }>).key), onFalse: () => Option.none() })
211
+
212
+ /** The DOM's Positional keys, which a server's reduced rule snaps (ADR-0029, ADR-0036). */
213
+ const DOM_POSITIONAL: ReducedMotion.PositionalKeys["Service"] = { isPositional: DomPositionalKeys.isPositional }
214
+
215
+ /** The DOM's Default transition, which a key with no transition defined samples as the client runs it (ADR-0051). */
216
+ const DOM_DEFAULTS: DefaultTransition.DefaultTransition["Service"] = { transitionFor: DomDefaultTransition.transitionFor, keyframes: DomDefaultTransition.keyframes }
217
+
218
+ /**
219
+ * Whether a value's own transition drives one of its keys while anything repeats for ever (#301): one
220
+ * CSS cycle can't hold a key that stops beside one that repeats, nor two cycles' lengths. With every
221
+ * key on the transition's own fields (a `layout` entry alone), it plays as before.
222
+ */
223
+ const foreverByValue = (m: MountAnimation): boolean => {
224
+ const entries = entriesOf(m.transition)
225
+ if (Predicate.isUndefined(entries)) return false
226
+ const runsOn = Arr.map(Rec.keys(m.to), (key) => transitionForKey(m.transition, key))
227
+ if (Arr.every(runsOn, (transition) => transition === entries.own)) return false
228
+ return Bool.or(repeatsForever(m.transition), Arr.some(runsOn, repeatsForever))
229
+ }
230
+
231
+ /** A mount animation's spec for the DOM's sampler, or why it has none. */
232
+ export const specOf = (m: MountAnimation): Result.Result<Appear.Spec, string> =>
233
+ Option.match(keyOf(m), {
234
+ onNone: () => Result.fail("its transition holds a function with no easing name"),
235
+ onSome: (key) => {
236
+ const skipped = m.skipped === true
237
+ if (Bool.and(Bool.not(skipped), foreverByValue(m))) return Result.fail("a value's own transition repeats for ever beside another")
238
+ const forever = playsForever(m)
239
+ const transition = Bool.match(skipped, { onTrue: () => m.transition, onFalse: () => sampledTransition(m.transition) })
240
+ const repeatDelay = UndefinedOr.match(m.transition, { onUndefined: () => 0, onDefined: (t) => Option.getOrElse(Option.fromUndefinedOr((t as Machine.AnimateOptions).repeatDelay), () => 0) })
241
+ return Result.succeed({
242
+ key,
243
+ tag: m.tag,
244
+ infinite: forever,
245
+ projected: m.layout,
246
+ template: m.template,
247
+ // Skipped (#468): every key's snap, landing on its first frame, a rule of 0 s.
248
+ machine: () =>
249
+ Bool.match(forever, {
250
+ onTrue: () => Machine.holdAfter(together(legsOf(m.from, m.to, transition, m.reduced, skipped, DOM_POSITIONAL, DOM_DEFAULTS, NO_VELOCITY, undefined, m.stops)), repeatDelay),
251
+ onFalse: () => together(legsOf(m.from, m.to, transition, m.reduced, skipped, DOM_POSITIONAL, DOM_DEFAULTS, NO_VELOCITY, undefined, m.stops)),
252
+ }),
253
+ })
254
+ },
255
+ })
256
+
257
+ /**
258
+ * Why a mount animation can't play before hydration, or `None` when it can (decision 4): a key
259
+ * starting from anything but `initial`, a value the DOM reads from the element (`auto`, `var()`),
260
+ * or a start that can't take its target's shape (a length pair in two units).
261
+ */
262
+ export const unplayable = (initial: Values.Values, to: Values.Values): Option.Option<string> =>
263
+ Arr.findFirst(Rec.toEntries(to), ([key, target]) =>
264
+ Option.match(Option.fromUndefinedOr(initial[key]), {
265
+ onNone: () => Option.some(`${key} starts from the element's own value (no initial)`),
266
+ onSome: (start) =>
267
+ Bool.match(Bool.or(readsElement(start), readsElement(target)), {
268
+ onTrue: () => Option.some(`${key} is a value the DOM reads from the element`),
269
+ onFalse: () =>
270
+ // A start that can't take its target's shape, a length in another unit among them (ADR-0024).
271
+ Bool.match(Option.isNone(OwnValues.valueLike(start, target)), {
272
+ onTrue: () => Option.some(`${key}'s start and target don't take one shape`),
273
+ onFalse: () => Option.none(),
274
+ }),
275
+ }),
276
+ }))
277
+
278
+ /** Whether a value is one the DOM reads from the element: `auto`, or a custom property. */
279
+ const readsElement = (value: number | string): boolean => Predicate.isString(value) && /\bauto\b|var\(/.test(value)
280
+
281
+ /** Whether an `initial` value, coerced to its target's shape, is that target: its key starts no leg (#448). */
282
+ const atTarget = (start: number | string | undefined, target: number | string): boolean =>
283
+ Option.exists(OwnValues.valueLike(start, target), (like) => like === target)
284
+
285
+ // --- The server --------------------------------------------------------------------------------
286
+
287
+ /** A variant parent's orchestration, on a server: its children in render order, its stagger and `when`. */
288
+ export interface AppearGroup {
289
+ readonly leader: Entry
290
+ readonly stagger: WardicStaggerConfig
291
+ readonly when: "beforeChildren" | "afterChildren" | undefined
292
+ readonly children: Array<Entry>
293
+ }
294
+
295
+ /** One element's place in a server render's Appear animations. */
296
+ export interface Entry {
297
+ /** Its mount animation per motion setting, or why it has none; `None` when nothing animates. */
298
+ readonly plays: { readonly normal: Option.Option<Result.Result<MountAnimation, string>>; readonly reduced: Option.Option<Result.Result<MountAnimation, string>> }
299
+ readonly slot: Option.Option<Appear.Slot>
300
+ /** The group it staggers in, as a Variant child. */
301
+ readonly group: Option.Option<AppearGroup>
302
+ /** Why it was ruled out after it rendered: its user style, read when `ward()` is called (ADR-0044, decision 4). */
303
+ readonly vetoes: Array<string>
304
+ /**
305
+ * Whether it follows the user's preference (`"user"`, #434): its reduced play goes under the head's
306
+ * media query. With `"always"` or `"never"` its plays are already that setting's.
307
+ */
308
+ readonly user: boolean
309
+ /** Whether it's skipped (#468): its rule lands on first paint, and its own stagger holds it back no more than its client does. */
310
+ readonly skipped: boolean
311
+ /** Its tag, and the keys its mount animates: what names it when the provider explains (#585). */
312
+ readonly tag: string | undefined
313
+ readonly to: Option.Option<Values.Values>
314
+ }
315
+
316
+ /** One server render's Appear animations: the provider's (ADR-0044, decisions 3 and 5). */
317
+ export interface ServerAppear {
318
+ /** The provider's reduced motion: an element's, unless its nearest `WardicConfig` sets its own (#434). */
319
+ readonly reducedMotion: ReducedMotion.Config
320
+ /**
321
+ * An element's entry, and its inline `animation` when it plays: its plays as its reduced motion has
322
+ * them, `setting` (its nearest `WardicConfig`'s, #434) else the provider's. A skipped one's (#468)
323
+ * are one play in both slots, whatever its reduced motion.
324
+ */
325
+ readonly enter: (
326
+ animation: { readonly normal: Option.Option<Result.Result<MountAnimation, string>>; readonly reduced: Option.Option<Result.Result<MountAnimation, string>> },
327
+ group: Option.Option<AppearGroup>,
328
+ setting: ReducedMotion.Config | undefined,
329
+ skipped: boolean,
330
+ /** Its tag and its targets at mount, which name it when the provider explains (#585). */
331
+ tag: string | undefined,
332
+ to: Option.Option<Values.Values>,
333
+ ) => {
334
+ readonly entry: Entry
335
+ readonly animation: Option.Option<string>
336
+ /**
337
+ * Entered after the shell was flushed, so in a chunk a stream sends later (#245), and no late
338
+ * element around it: the chunk's root, which puts the chunk's `<style>` after itself.
339
+ */
340
+ readonly chunkRoot: boolean
341
+ readonly late: boolean
342
+ }
343
+ /** A variant parent's group, its children to come. */
344
+ readonly group: (leader: Entry, transition: WardicTransition | undefined) => AppearGroup
345
+ /**
346
+ * The head's CSS, once the shell is done: every element entered so far, its timing worked out,
347
+ * and the rules. Called once, by the provider's `useAssets`: what enters after is late (#245).
348
+ */
349
+ readonly css: () => string
350
+ /** Render a late element's subtree: an element inside it isn't a chunk's root (#245). */
351
+ readonly within: <A>(late: boolean, render: () => A) => A
352
+ /**
353
+ * A late chunk's CSS (#245): the rules and timings of every element entered since the last
354
+ * write, those the head sent left out; "" for none. The Solid 2 binding hands it to `useHead`,
355
+ * which streams it with the chunk as a head patch (#209 PR 4a).
356
+ */
357
+ readonly chunkCss: () => string
358
+ /**
359
+ * A late chunk's `<style>` (#245), as server text: {@link chunkCss} in a `<style>`. The Solid 1
360
+ * binding's chunk root's thunk asks for it once the chunk has rendered.
361
+ */
362
+ readonly chunk: () => string
363
+ /** The nonce the page's Content Security Policy gives inline styles, which each `<style>` carries (#618, P1). */
364
+ readonly nonce: string | undefined
365
+ }
366
+
367
+ /** No transition: no orchestration. */
368
+ const NO_TRANSITION: WardicTransition = {}
369
+
370
+ /** An element's reduced motion (#434): its nearest config's, else the provider's. */
371
+ const settingOr = (setting: ReducedMotion.Config | undefined, provider: ReducedMotion.Config): ReducedMotion.Config => {
372
+ if (Predicate.isNotUndefined(setting)) return setting
373
+ return provider
374
+ }
375
+
376
+ /**
377
+ * An element's plays under its reduced motion (#434): `"always"` plays its reduced one in both
378
+ * settings, `"never"` its normal one, and `"user"` each in its own, the reduced under the media query.
379
+ */
380
+ const playsUnder = (plays: Entry["plays"], setting: ReducedMotion.Config): Entry["plays"] => {
381
+ if (setting === "always") return { normal: plays.reduced, reduced: plays.reduced }
382
+ if (setting === "never") return { normal: plays.normal, reduced: plays.normal }
383
+ return plays
384
+ }
385
+
386
+ /** Whether an entry follows the user's preference (#434). */
387
+ const isUser = (entry: Entry): boolean => entry.user
388
+
389
+ /**
390
+ * What a provider's `appear` explains with (#585): with `"explain"`, a Warning for each element that
391
+ * waits for the JavaScript, logged as the render finds it with Effect's own logger, since a server
392
+ * builds no runtime from the app's `env`; nothing otherwise.
393
+ */
394
+ export const explainerOf = (appear: boolean | "explain" | undefined): ((message: string) => void) | undefined => {
395
+ if (appear !== "explain") return undefined
396
+ return (message) => Effect.runSync(Effect.logWarning(message))
397
+ }
398
+
399
+ /** An element as the provider's explanation names it (#585): its tag and the keys its mount animates. */
400
+ const nameOf = (entry: Entry): string => {
401
+ const element = UndefinedOr.match(entry.tag, { onUndefined: () => "an element", onDefined: (tag) => `<${tag}>` })
402
+ return Option.match(entry.to, { onNone: () => element, onSome: (to) => `${element} (${Rec.keys(to).join(", ")})` })
403
+ }
404
+
405
+ /**
406
+ * A server render's Appear animations, for a provider whose reduced motion is `reducedMotion`. With
407
+ * `explain` (the provider's `appear="explain"`, #585), it says why each element that doesn't play
408
+ * waits for the JavaScript, as it finds out; without it, nothing is kept or said.
409
+ */
410
+ export const serverAppear = (reducedMotion: ReducedMotion.Config, explain?: (message: string) => void, nonce?: string): ServerAppear => {
411
+ const sheet = Appear.sheet()
412
+ const entries: Array<Entry> = []
413
+ /** Says why `entry` waits for the JavaScript, when the provider explains. */
414
+ const waits = (entry: Entry, reason: string): void => {
415
+ if (Predicate.isNotUndefined(explain)) explain(`wardic.appear: ${nameOf(entry)} waits for the JavaScript: ${reason}`)
416
+ }
417
+ // The shell is flushed once the head's CSS is asked for: what enters after is late (#245).
418
+ let flushed = false
419
+ // The entries written so far, and how deep the render is in late elements.
420
+ let written = 0
421
+ let lateDepth = 0
422
+ /** The entries since the last write, now written. */
423
+ const nextBatch = (): ReadonlyArray<Entry> => {
424
+ const batch = entries.slice(written)
425
+ written = entries.length
426
+ return batch
427
+ }
428
+ /** A batch's timing, each slot defined, and the sheet's CSS for them (decision 5). */
429
+ const write = (batch: ReadonlyArray<Entry>): string => {
430
+ // Each entry's plays are its own setting's (#434): the normal ones always, the reduced ones under
431
+ // the media query when an entry follows the user.
432
+ const resolve = (pick: "normal" | "reduced") => timings(batch, pick)
433
+ const normal = resolve("normal")
434
+ const reduced = Bool.match(Arr.some(batch, isUser), { onTrue: () => Option.some(resolve("reduced")), onFalse: () => Option.none<Timings>() })
435
+ const settings = Arr.prepend(Option.toArray(reduced), normal)
436
+ // Most renders write no SVG geometry: no group pass.
437
+ const supports = Bool.match(Arr.some(settings, (byEntry) => byEntry.geometry), {
438
+ onTrue: () => groupSupports(batch, settings),
439
+ onFalse: () => () => NO_SUPPORTS,
440
+ })
441
+ Arr.forEach(batch, (entry) =>
442
+ Option.map(entry.slot, (slot) => {
443
+ const play = UndefinedOr.getOrThrow(normal.get(entry))
444
+ const reducedPlay = Option.map(Option.filter(reduced, () => entry.user), (byEntry) => UndefinedOr.getOrThrow(byEntry.get(entry)))
445
+ const defined = Result.flatMap(play, (p) =>
446
+ Option.match(reducedPlay, {
447
+ onNone: () => slot.define(p, undefined, supports(entry)),
448
+ onSome: (r) => Result.flatMap(r, (rp) => slot.define(p, rp, supports(entry))),
449
+ }))
450
+ Result.match(defined, { onFailure: (reason) => waits(entry, reason), onSuccess: () => undefined })
451
+ }))
452
+ return sheet.css()
453
+ }
454
+ const plays = (animation: Entry["plays"]): boolean =>
455
+ Bool.or(Option.exists(animation.normal, Result.isSuccess), Option.exists(animation.reduced, Result.isSuccess))
456
+ const chunkCss = (): string => write(nextBatch())
457
+ return {
458
+ reducedMotion,
459
+ enter: (given, group, setting, skipped, tag, to) => {
460
+ // Skipped (#468): its one play in both slots, under no media query.
461
+ const own = Bool.match(skipped, { onTrue: (): ReducedMotion.Config => "never", onFalse: () => settingOr(setting, reducedMotion) })
462
+ const animation = playsUnder(given, own)
463
+ const slot = Option.liftPredicate(animation, plays).pipe(Option.map(() => sheet.slot()))
464
+ const entry: Entry = { plays: animation, slot, group, vetoes: [], user: own === "user", skipped, tag, to }
465
+ // Why it plays neither: its normal play's reason, its reduced one's when that differs (#585).
466
+ if (Predicate.isNotUndefined(explain)) {
467
+ const reasons = Arr.dedupe(Arr.flatMap([animation.normal, animation.reduced], (play) => Option.toArray(Option.flatMap(play, (p) => Result.getFailure(p)))))
468
+ Arr.forEach(reasons, (reason) => waits(entry, reason))
469
+ }
470
+ entries.push(entry)
471
+ Option.map(group, (g) => g.children.push(entry))
472
+ return { entry, animation: Option.map(slot, (s) => s.animation), late: flushed, chunkRoot: Bool.and(flushed, lateDepth === 0) }
473
+ },
474
+ within: (late, render) => {
475
+ // Per element on a server: a guard, no allocation.
476
+ if (Bool.not(late)) return render()
477
+ lateDepth++
478
+ try {
479
+ return render()
480
+ } finally {
481
+ lateDepth--
482
+ }
483
+ },
484
+ chunkCss,
485
+ chunk: () => Appear.chunkStyle(chunkCss(), nonce),
486
+ nonce,
487
+ group: (leader, transition) => {
488
+ const { staggerChildren = 0, delayChildren = 0, from = "first", staggerDirection = 1, when } = UndefinedOr.match(transition, {
489
+ onUndefined: () => NO_TRANSITION,
490
+ onDefined: (t: WardicTransition) => t,
491
+ })
492
+ return { leader, stagger: { amount: staggerChildren, delayChildren, from, direction: staggerDirection }, when, children: [] }
493
+ },
494
+ css: () => {
495
+ flushed = true
496
+ return write(nextBatch())
497
+ },
498
+ }
499
+ }
500
+
501
+ /**
502
+ * Each entry's play for one motion setting: its spec and its delay, or why it has none. A Variant
503
+ * child starts after its stagger (`delayChildren` plus its place, ADR-0007), and after its parent
504
+ * settles under `when: "beforeChildren"`; a parent under `"afterChildren"` starts once its last
505
+ * child settles. A start that depends on an element with no rule has none.
506
+ *
507
+ * Timed a batch at a time (#245): the shell's, then each late chunk's, whose CSS starts when the
508
+ * chunk lands. A late Variant child of a group led earlier is a fresh mount from then: its stagger
509
+ * is among that group's children in its batch, and it doesn't wait on the leader (decision 5 of
510
+ * *Amendment (#245)*). The shell's batch is every entry, so nothing changes for it.
511
+ */
512
+ const timings = (entries: ReadonlyArray<Entry>, pick: "normal" | "reduced"): Timings => {
513
+ const memo = new Map<Entry, Result.Result<{ readonly play: TimedPlay; readonly settled: number }, string>>()
514
+ let geometry = false
515
+ const inBatch = new Set(entries)
516
+ // Each group's children in this batch, once a group.
517
+ const batchChildren = new Map<AppearGroup, ReadonlyArray<Entry>>()
518
+ const childrenOf = (g: AppearGroup): ReadonlyArray<Entry> =>
519
+ Option.getOrElse(Option.fromUndefinedOr(batchChildren.get(g)), () => {
520
+ const children = Arr.filter(g.children, (child) => inBatch.has(child))
521
+ batchChildren.set(g, children)
522
+ return children
523
+ })
524
+ /** An entry's spec and rule, or why it has none; a missing play (nothing animates) is a rule of 0 s. */
525
+ const ruleOf = (entry: Entry): Result.Result<Option.Option<{ readonly spec: Appear.Spec; readonly rule: Appear.Keyframes }>, string> =>
526
+ Arr.match(entry.vetoes, {
527
+ onNonEmpty: (vetoes) => Result.fail(vetoes.join("; ")),
528
+ onEmpty: () => playOf(entry),
529
+ })
530
+ const playOf = (entry: Entry): Result.Result<Option.Option<{ readonly spec: Appear.Spec; readonly rule: Appear.Keyframes }>, string> =>
531
+ Option.match(entry.plays[pick], {
532
+ onNone: () => Result.succeed(Option.none()),
533
+ onSome: (animation) =>
534
+ Result.flatMap(Result.flatMap(animation, specOf), (spec) => Result.map(Appear.keyframes(spec), (rule) => Option.some({ spec, rule }))),
535
+ })
536
+ /** The seconds from first paint to when `entry` starts, and its play. */
537
+ const timingOf = (entry: Entry): Result.Result<{ readonly play: TimedPlay; readonly settled: number }, string> =>
538
+ Option.getOrElse(Option.fromUndefinedOr(memo.get(entry)), () => {
539
+ const computed = Result.flatMap(ruleOf(entry), (rule) =>
540
+ Result.map(startOf(entry), (start) => {
541
+ const spec = Option.match(rule, { onNone: () => undefined, onSome: (r) => r.spec })
542
+ // A forever-repeating rule is a cycle: its own delay plays before it, and it never settles.
543
+ const mount = Option.match(entry.plays[pick], { onNone: () => undefined, onSome: (p) => Result.match(p, { onFailure: () => undefined, onSuccess: identity }) })
544
+ const transition = UndefinedOr.map(mount, (m) => m.transition)
545
+ const forever = UndefinedOr.match(mount, { onUndefined: () => false, onDefined: playsForever })
546
+ const before = Bool.match(forever, { onTrue: () => ownDelayOf(transition), onFalse: () => 0 })
547
+ const settled = Option.match(rule, { onNone: () => 0, onSome: (r) => Bool.match(forever, { onTrue: () => Number.POSITIVE_INFINITY, onFalse: () => r.rule.settled }) })
548
+ const supports = Option.match(rule, { onNone: () => NO_SUPPORTS, onSome: (r) => r.rule.supports })
549
+ geometry = Bool.or(geometry, Arr.isReadonlyArrayNonEmpty(supports))
550
+ return { play: { spec: spec as Appear.Spec, delay: start + before, supports }, settled: start + before + settled }
551
+ }))
552
+ memo.set(entry, computed)
553
+ return computed
554
+ })
555
+ /** When `entry` starts: its stagger, after its parent under `beforeChildren`, after its children under `afterChildren`. */
556
+ const startOf = (entry: Entry): Result.Result<number, string> =>
557
+ Result.flatMap(afterParent(entry), (afterLeader) => Result.map(afterChildren(entry), (afterKids) => Math.max(afterLeader, afterKids) + ownStaggerOf(entry, childrenOf)))
558
+ // A leader written earlier started at first paint: a late child doesn't wait on it.
559
+ const afterParent = (entry: Entry): Result.Result<number, string> =>
560
+ Option.match(Option.filter(entry.group, (g) => Bool.and(g.when === "beforeChildren", inBatch.has(g.leader))), {
561
+ onNone: () => Result.succeed(0),
562
+ onSome: (g) =>
563
+ Result.flatMap(
564
+ Result.mapError(Result.map(timingOf(g.leader), (t) => t.settled), (reason) => `its parent has no rule (${reason})`),
565
+ (settled) => Bool.match(Number.isFinite(settled), { onTrue: () => Result.succeed(settled), onFalse: () => Result.fail("its parent never settles") }),
566
+ ),
567
+ })
568
+ const afterChildren = (entry: Entry): Result.Result<number, string> =>
569
+ Option.match(Option.fromUndefinedOr(groupsLed.get(entry)), {
570
+ onNone: () => Result.succeed(0),
571
+ onSome: (g) =>
572
+ Bool.match(g.when === "afterChildren", {
573
+ onFalse: () => Result.succeed(0),
574
+ onTrue: () =>
575
+ Result.mapError(
576
+ Result.map(Result.all(Arr.map(childrenOf(g), timingOf)), (kids) => Arr.reduce(kids, 0, (latest, t) => Math.max(latest, t.settled))),
577
+ (reason) => `a child has no rule (${reason})`,
578
+ ),
579
+ }),
580
+ })
581
+ const groupsLed = new Map<Entry, AppearGroup>()
582
+ Arr.forEach(entries, (entry) => Option.map(entry.group, (g) => groupsLed.set(g.leader, g)))
583
+ const plays = new Map(Arr.map(entries, (entry) => [entry, Result.flatMap(timingOf(entry), (t) => Bool.match(Predicate.isUndefined(t.play.spec), {
584
+ onTrue: () => Result.fail("nothing animates"),
585
+ onFalse: () => Result.succeed(t.play),
586
+ }))] as const))
587
+ return Object.assign(plays, { geometry })
588
+ }
589
+
590
+ /** Each entry's play for one motion setting, and whether any of their rules writes SVG geometry. */
591
+ type Timings = Map<Entry, Result.Result<TimedPlay, string>> & { readonly geometry: boolean }
592
+
593
+ /** An element's play, with the SVG geometry properties its rule writes (#245, `Appear.Keyframes.supports`). */
594
+ interface TimedPlay extends Appear.Play {
595
+ readonly supports: ReadonlyArray<string>
596
+ }
597
+
598
+ const NO_SUPPORTS: ReadonlyArray<string> = []
599
+
600
+ /**
601
+ * The SVG geometry properties each entry's orchestrated group writes, over every play (#245,
602
+ * `Appear.Keyframes.supports`): the whole tree a top leader orchestrates is defined under one
603
+ * `@supports`, so a browser without them keeps all of it at its Starting style, not part of it
604
+ * (decision 4: an element qualifies whole, and so does what it orchestrates). Per element on a
605
+ * server: a render whose rules write none (most) pays a look at each play.
606
+ */
607
+ const groupSupports = (
608
+ entries: ReadonlyArray<Entry>,
609
+ settings: ReadonlyArray<Map<Entry, Result.Result<TimedPlay, string>>>,
610
+ ): ((entry: Entry) => ReadonlyArray<string>) => {
611
+ /** The leader at the top of an entry's orchestration: itself, outside any group. */
612
+ const topOf = (entry: Entry): Entry => Option.match(entry.group, { onNone: () => entry, onSome: (g) => topOf(g.leader) })
613
+ /** What an entry's own rules write, over every play. */
614
+ const own = (entry: Entry): ReadonlyArray<string> =>
615
+ Arr.flatMap(settings, (byEntry) =>
616
+ Option.match(Option.fromUndefinedOr(byEntry.get(entry)), {
617
+ onNone: () => NO_SUPPORTS,
618
+ onSome: (play) => Result.match(play, { onFailure: () => NO_SUPPORTS, onSuccess: (p) => p.supports }),
619
+ }))
620
+ const byTop = new Map<Entry, ReadonlyArray<string>>()
621
+ Arr.forEach(entries, (entry) =>
622
+ Arr.match(own(entry), {
623
+ onEmpty: () => undefined,
624
+ onNonEmpty: (mine) => {
625
+ const top = topOf(entry)
626
+ byTop.set(top, Arr.appendAll(Option.getOrElse(Option.fromUndefinedOr(byTop.get(top)), () => NO_SUPPORTS), mine))
627
+ },
628
+ }))
629
+ return (entry) =>
630
+ Bool.match(byTop.size === 0, {
631
+ onTrue: () => NO_SUPPORTS,
632
+ onFalse: () => Option.getOrElse(Option.fromUndefinedOr(byTop.get(topOf(entry))), () => NO_SUPPORTS),
633
+ })
634
+ }
635
+
636
+ /** An entry's own stagger: none when it's skipped (#468), as its client's snap has no delay; its `when` waits still hold. */
637
+ const ownStaggerOf = (entry: Entry, childrenOf: (g: AppearGroup) => ReadonlyArray<Entry>): number => {
638
+ if (entry.skipped) return 0
639
+ return staggerOf(entry, childrenOf)
640
+ }
641
+
642
+ /**
643
+ * A Variant child's stagger: its parent's `delayChildren` plus its place (ADR-0007), as the client
644
+ * works it out, among the group's children in its batch (`childrenOf`, #245).
645
+ */
646
+ const staggerOf = (entry: Entry, childrenOf: (g: AppearGroup) => ReadonlyArray<Entry>): number =>
647
+ Option.match(entry.group, {
648
+ onNone: () => 0,
649
+ onSome: (g) => {
650
+ const children = childrenOf(g)
651
+ const n = children.length
652
+ const i = children.indexOf(entry)
653
+ return childDelayOf(g.stagger, i, n)
654
+ },
655
+ })
656
+
657
+ /** What the server knows of an element when it renders it. */
658
+ export interface ServerElement {
659
+ /** The element's own `appear` (the provider's is the render's {@link ServerAppear}). */
660
+ readonly appear: boolean | undefined
661
+ readonly tag: string | undefined
662
+ /** Its starting values: `initial`, an inherited `initial` name, or `animate` under `initial={false}`. */
663
+ readonly initial: Values.Values
664
+ /** Its targets at mount: `animate`, or an inherited variant name resolved against its `variants`; `None` with neither. */
665
+ readonly to: Option.Option<Values.Values>
666
+ /** Its targets' Keyframes (#429), each such key's value in `to` their last stop; `undefined` with none. */
667
+ readonly keyframes: Keyframes | undefined
668
+ /** Whether its mount starts at its `animate` (#448, `startsQuiet`): nothing plays, its Keyframes included (#429). */
669
+ readonly quiet: boolean
670
+ /** Its own transition, else the one it inherits (ADR-0007). */
671
+ readonly transition: WardicTransition | undefined
672
+ /** Whether it's a layout node (`layout` or `layoutId`): drawn through its projection at rest (#245). */
673
+ readonly layout: boolean
674
+ /** Its **Transform template** (#443), when it has one. */
675
+ readonly template?: DomRenderer.TransformTemplate | undefined
676
+ /** The group it staggers in, as a Variant child: its parent's (`node.inherited`). */
677
+ readonly group: Option.Option<AppearGroup>
678
+ /** Whether it orchestrates its Variant children: it has variants of its own (ADR-0007). */
679
+ readonly leads: boolean
680
+ /** Its own transition, whose stagger and `when` its Variant children follow. */
681
+ readonly ownTransition: WardicTransition | undefined
682
+ /** Its nearest `WardicConfig`'s reduced motion (#434), over the provider's: `undefined` for none. */
683
+ readonly reducedMotion?: ReducedMotion.Config | undefined
684
+ /** Whether its nearest `WardicConfig` skips its animations (#468). Its transition's own `skipAnimations` counts too. */
685
+ readonly skipAnimations?: boolean | undefined
686
+ }
687
+
688
+ /**
689
+ * An element's entry in a server render's Appear animations: its inline `animation` when it plays
690
+ * one, and the group its Variant children join when it leads one.
691
+ */
692
+ export const enterServer = (
693
+ appear: ServerAppear,
694
+ el: ServerElement,
695
+ ): {
696
+ readonly animation: Option.Option<string>
697
+ readonly group: Option.Option<AppearGroup>
698
+ readonly veto: (reason: string) => void
699
+ /** Rendered after the shell (#245): in a late chunk, and that chunk's root when no late element is around it. */
700
+ readonly late: boolean
701
+ readonly chunkRoot: boolean
702
+ } => {
703
+ // Its starts and targets once, both plays sharing them (and so their key's text, `keyOf`). A key
704
+ // already at its target, coerced to its shape, is left out, as the client's first Retarget starts
705
+ // it no leg (#448); a Keyframes key never is, and starts at its first stop, unless the mount starts
706
+ // at its `animate`, when nothing plays (#429, Motion's).
707
+ const mount = Option.flatMap(el.to, (to) => {
708
+ const moving = Rec.filter(to, (target, key) =>
709
+ Bool.match(hasStops(el.keyframes, key), { onTrue: () => Bool.not(el.quiet), onFalse: () => Bool.not(atTarget(el.initial[key], target)) }))
710
+ return Bool.match(Rec.isEmptyRecord(moving), {
711
+ onTrue: () => Option.none(),
712
+ onFalse: () => Option.some(Result.map(playable(el, moving), (prepared): KeyframesStart & { readonly to: Values.Values } => startedOf(prepared, el.keyframes))),
713
+ })
714
+ })
715
+ // Skipped (#468): its config's, or its whole transition's own, as the client's legs read them.
716
+ const skipped = Bool.or(el.skipAnimations === true, UndefinedOr.match(el.transition, { onUndefined: () => false, onDefined: (t) => t.skipAnimations === true }))
717
+ const play = (reduced: boolean): Option.Option<Result.Result<MountAnimation, string>> =>
718
+ Option.map(mount, (prepared) =>
719
+ Result.map(prepared, ({ from, to, stops }): MountAnimation => ({
720
+ tag: el.tag,
721
+ from,
722
+ to,
723
+ transition: el.transition,
724
+ reduced,
725
+ layout: el.layout,
726
+ stops,
727
+ ...skippedField(skipped),
728
+ ...UndefinedOr.match(el.template, { onUndefined: () => ({}), onDefined: (template) => ({ template }) }),
729
+ })))
730
+ const plays = Bool.match(skipped, {
731
+ onTrue: () => {
732
+ const one = play(false)
733
+ return { normal: one, reduced: one }
734
+ },
735
+ onFalse: () => ({ normal: play(false), reduced: play(true) }),
736
+ })
737
+ const { entry, animation: inline, late, chunkRoot } = appear.enter(plays, el.group, el.reducedMotion, skipped, el.tag, el.to)
738
+ return {
739
+ late,
740
+ chunkRoot,
741
+ animation: inline,
742
+ group: Option.liftPredicate(entry, () => el.leads).pipe(Option.map((leader) => appear.group(leader, el.ownTransition))),
743
+ veto: (reason) => {
744
+ entry.vetoes.push(reason)
745
+ },
746
+ }
747
+ }
748
+
749
+ /** A mount animation's `skipped` (#468): left out when it isn't, so its key is as before. */
750
+ export const skippedField = (skipped: boolean): { readonly skipped?: true } => Bool.match(skipped, { onTrue: () => ({ skipped: true }) as const, onFalse: () => ({}) })
751
+
752
+ /** Whether `key` has Keyframes in `keyframes` (#429). */
753
+ const hasStops = (keyframes: Keyframes | undefined, key: string): boolean => {
754
+ if (Predicate.isUndefined(keyframes)) return false
755
+ return Object.hasOwn(keyframes, key)
756
+ }
757
+
758
+ /** A mount's starts with its Keyframes resolved (#429, `keyframesFrom`), as the client's first Retarget resolves them. */
759
+ const startedOf = (prepared: { readonly from: Values.Values; readonly to: Values.Values }, keyframes: Keyframes | undefined): KeyframesStart & { readonly to: Values.Values } =>
760
+ UndefinedOr.match(keyframes, {
761
+ onUndefined: () => ({ from: prepared.from, to: prepared.to, stops: undefined }),
762
+ onDefined: (byKey) => ({ ...keyframesFrom(prepared.from, prepared.to, byKey), to: prepared.to }),
763
+ })
764
+
765
+ /** An element's starts and targets, or why its mount animation can't play before hydration (decision 4). */
766
+ const playable = (el: ServerElement, to: Values.Values): Result.Result<{ readonly from: Values.Values; readonly to: Values.Values }, string> => playableMatch({ el, to })
767
+
768
+ /** {@link playable}'s cases, built once at module load: it runs per element (#69's PR 2). */
769
+ const playableMatch: (input: { readonly el: ServerElement; readonly to: Values.Values }) => Result.Result<{ readonly from: Values.Values; readonly to: Values.Values }, string> =
770
+ /*#__PURE__*/ Match.type<{ readonly el: ServerElement; readonly to: Values.Values }>().pipe(
771
+ Match.when({ el: { appear: false } }, () => Result.fail("appear={false}")),
772
+ Match.orElse(({ el, to }) =>
773
+ Option.match(unplayable(el.initial, to), {
774
+ onSome: (reason): Result.Result<{ readonly from: Values.Values; readonly to: Values.Values }, string> => Result.fail(reason),
775
+ onNone: () => Result.succeed({ from: Rec.map(to, (target, key) => Option.getOrThrow(OwnValues.valueLike(el.initial[key] as number | string, target))), to }),
776
+ })),
777
+ )
778
+
779
+ /** Whether a user style sets an `animation` of its own: the element's one CSS animation would be taken. */
780
+ export const setsAnimation: (css: object | string | undefined) => boolean = /*#__PURE__*/ Match.type<object | string | undefined>().pipe(
781
+ Match.when(Predicate.isString, (text) => /(^|;)\s*animation(-name)?\s*:/i.test(text)),
782
+ Match.when(Predicate.isObject, (record) => Bool.or(Object.hasOwn(record, "animation"), Object.hasOwn(record, "animationName"))),
783
+ Match.orElse(() => false),
784
+ )
785
+
786
+ // --- The Handoff -------------------------------------------------------------------------------
787
+
788
+ /** An element's Appear animation, found at mount: the spine starts its first legs as far in as it has got. */
789
+ export interface Handoff {
790
+ readonly animation: Animation
791
+ }
792
+
793
+ /** The element's Appear animation, if a server started one (decision 6). */
794
+ export const handoffOf = (element: Element): Option.Option<Handoff> => Option.map(Appear.find(element), (animation) => ({ animation }))
795
+
796
+ /**
797
+ * How far into its own run the client's first legs start, in seconds, read at their first tick:
798
+ * where the CSS has got, less what the CSS waited that the client waits for itself. The CSS waited
799
+ * its `animation-delay` and its rule's hold; the client's legs hold their transition's delay
800
+ * (`clientDelay`, the stagger in it). The difference is a `when` wait, which the client has already
801
+ * waited.
802
+ */
803
+ export const startAtOf = (handoff: Handoff, ownTransition: WardicTransition | undefined, clientDelay: number) => (): number =>
804
+ Appear.elapsedOf(handoff.animation) - Appear.delayOf(handoff.animation) - heldInRule(ownTransition) + clientDelay