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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
@@ -0,0 +1,1620 @@
1
+ import { createComponent as _$createComponent } from "@solidjs/web";
2
+ import { tapPropagates } from "../../press.js";
3
+ import * as Report from "@wardic/dom/Report";
4
+ import * as Renderer from "@wardic/core/Renderer";
5
+ import * as DomRenderer from "@wardic/dom/DomRenderer";
6
+ import * as Style from "@wardic/dom/Style";
7
+ import * as Svg from "@wardic/dom/Svg";
8
+ import * as Arr from "effect/Array";
9
+ import * as Bool from "effect/Boolean";
10
+ import * as Cause from "effect/Cause";
11
+ import * as Effect from "effect/Effect";
12
+ import * as Scope from "effect/Scope";
13
+ import { constFalse, constTrue, constUndefined, constVoid, identity, pipe } from "effect/Function";
14
+ import * as Option from "effect/Option";
15
+ import * as Predicate from "effect/Predicate";
16
+ import * as UndefinedOr from "effect/UndefinedOr";
17
+ import { Atom } from "effect/reactivity";
18
+ import { isServer, useHead } from "@solidjs/web";
19
+ import { createEffect, createMemo, createSignal, createUniqueId, DEV, getOwner, isHydrating, onCleanup, runWithOwner, untrack } from "solid-js";
20
+ import { MOTION_PROPS_V2 } from "../../motion-props.js";
21
+ import * as OwnerScope from "../../owner-scope.js";
22
+ import { GESTURE_WORDS, serviceIn } from "../../gesture-features.js";
23
+ import { inViewOptionsOf } from "../../gesture-callbacks.js";
24
+ import { projectionIn } from "../../runtime.js";
25
+ import { createElementStyle } from "../../element-style.js";
26
+ import { createLiveStyle, readLive, serverRegistryOf, split } from "../../live-style.js";
27
+ import { dragTransitionOf } from "../../drag-transition.js";
28
+ import { layoutOptionsOf, registrationOf, wantsLayoutNode } from "../../layout-member.js";
29
+ import { useLayoutGroupId } from "./layout.js";
30
+ import { registerAnimatable } from "../../imperative.js";
31
+ import { controlledConfigOf, controlledElement, isAnimationControls, subscribe, uncontrolledOf } from "../../animation-controls.js";
32
+ import { settingOf } from "../../wardic-config-value.js";
33
+ import { presenceBlocksInitial, presenceHold, presenceSeedOf } from "../../presence-record.js";
34
+ import { handoffOf, setsAnimation } from "../../appear.js";
35
+ import { appearEntryOf, applyDragDefaults, dragAxisOf, dragDefaultsOf, draggingWithWillChange, drawnAtRest, followTemplate, heldTransformFor, registeredValuesOf, flagStartingStyle, isLayoutNode, makeElementSpine, makeReuse, exitConfigOf, exitTargetOf, presenceTreeOf, NO_EXIT_CONFIG, madeWith, presenceRecordOf, recordFrameOf, registryOf, releasingAppear, resolutionOf, restingOf, sameResolution, serverStartingStyle, snapshotOf, startLinksOf, startOf, warnDroppedTransform, withOnUpdate } from "../../spine.js";
36
+ import { inheritedContext, serverVariantNode, startsAtAnimate, startsQuiet } from "../../variant-tree.js";
37
+ import { followAtom } from "./bridge.js";
38
+ import { appearStyle, useWardicAppear, useWardicGate, useWardicPositionalKeys, useWardicDefaultTransition, useBuiltProjection, useWardicReducedMotion, useWardicRenderer, useWardicRuntime, useWardicSkipAnimations, useElementFeatures, useFeatureRegistry } from "./provider.js";
39
+ import { LAYOUT_PROPS, missingMessage, unreadColorIn } from "../../feature.js";
40
+ import { CLIENT_ONLY, CLIENT_ONLY_DEFERRED, CLIENT_ONLY_SYNC, CLIENT_ONLY_SYNC_DEFERRED, reactivityIn } from "./solid-reactivity.js";
41
+ import { useWardicConfig } from "./wardic-config.js";
42
+ import { pointMapOptionOf, transformPagePointOf } from "../../wardic-config-value.js";
43
+ import { configView } from "./config-view.js";
44
+ import { Lifecycle } from "./lifecycle.js";
45
+ import { neverLands, NO_EVENTS, serverWhen } from "./waiters.js";
46
+ import { usePresenceContext } from "./presence.js";
47
+ import { createVariantNode, useVariantContext, WardicVariantContext } from "./variant-node.js";
48
+ import { DragGesture, FocusGesture, HoverGesture, InViewGesture, PanGesture, PressGesture } from "../../features/keys.js";
49
+ /** Every key a ward reads, its callbacks among them. */
50
+ const WARD_KEYS = ["initial", "animate", "variants", "custom", "inherit", "whileHover", "whileTap", "whileInView", "whileFocus", "viewport", "drag", "whileDrag", "dragConstraints", "dragElastic", "dragMomentum", "dragSnapToOrigin", "dragTransition", "dragPropagation", "propagate", "dragDirectionLock", "dragControls", "dragListener", "onMeasureDragConstraints", "transition", "exit", "layout", "layoutDependency", "layoutId", "layoutScroll", "layoutRoot", "layoutAnchor", "layoutCrossfade", "onUpdate", "transformTemplate", "onBeforeLayoutMeasure", "onLayoutMeasure", "appear", "style", "key"];
51
+ const everyKeyRead = true;
52
+ void everyKeyRead;
53
+ const everyPropRead = true;
54
+ void everyPropRead;
55
+ /**
56
+ * The target memo's comparison (#337): {@link sameResolution}, and a change when there's nothing to
57
+ * compare with. Solid 2 calls a memo's `equals` with no previous value when the memo was made inside
58
+ * an action's transaction, as a ward an optimistic write makes is, before anything has committed.
59
+ */
60
+ const sameTarget = (a, b) => {
61
+ if (Predicate.isUndefined(a)) return false;
62
+ if (Predicate.isUndefined(b)) return false;
63
+ return sameResolution(a, b);
64
+ };
65
+ /** A ward's config read per key (#259). */
66
+ const WARD_VIEW = configView(WARD_KEYS, ["onUpdate", "dragConstraints", "onMeasureDragConstraints", "transformTemplate", "onBeforeLayoutMeasure", "onLayoutMeasure"]);
67
+ /** `config` read per key (#259), for a read outside a ward: a `wardic.<tag>`'s props at setup. Internal. */
68
+ export const wardConfigView = config => WARD_VIEW.of(config);
69
+ /** A config given whole as an accessor, which the Solid 2 binding no longer reads (#259). */
70
+ const WHOLE_ACCESSOR = "ward(config) takes its config as an object, read per key (#259): make a key reactive with an accessor " + "(`ward({ animate: () => ({ x: x() }) })`), a getter, a store or a component's props, not the whole config " + "(`ward(() => ({ … }))`).";
71
+ /**
72
+ * A ward's mark (#349): what tells a ward given to a component's `wardRef` from a function handed the
73
+ * component's own ward. Internal: its value is the ward's {@link WardShare}.
74
+ */
75
+ export const WARD = Symbol("wardic.ward");
76
+ /** Where a ward keeps its {@link WardState}: on itself, not enumerable, so a spread never sees it. */
77
+ const WARD_STATE = Symbol("wardic.wardState");
78
+ /** A ward's {@link WardState}. */
79
+ const stateOf = ward => ward[WARD_STATE];
80
+ /**
81
+ * The members every client ward shares (#525): one prototype over `Function.prototype`, so a ward is
82
+ * still a function, Solid's ref. Each is a getter: its closure is made at its first read and kept on
83
+ * that ward, so one taken off the ward still works and one never read is never made. A ward was
84
+ * given each as its own property, a descriptor and most a closure apiece, in one `defineProperties` a
85
+ * ward: the line a Solid 2 mount spent most in. A ward keeps `ref`, `style` and its attributes as its
86
+ * own, enumerable, as a spread and `Object.keys` read them.
87
+ */
88
+ const WARD_MEMBER_KEYS = {
89
+ [WARD]: {
90
+ get() {
91
+ return stateOf(this).shared();
92
+ }
93
+ },
94
+ Provider: {
95
+ get() {
96
+ return stateOf(this).Provider;
97
+ }
98
+ },
99
+ read: {
100
+ get() {
101
+ return stateOf(this).read;
102
+ }
103
+ },
104
+ atom: {
105
+ get() {
106
+ return stateOf(this).atom;
107
+ }
108
+ },
109
+ with: {
110
+ get() {
111
+ return stateOf(this).with;
112
+ }
113
+ },
114
+ settled: {
115
+ get() {
116
+ const state = stateOf(this);
117
+ if (Predicate.isNotUndefined(state.settled)) return state.settled;
118
+ const lifecycle = state.lifecycle;
119
+ state.settled = () => lifecycle.read();
120
+ return state.settled;
121
+ }
122
+ },
123
+ tapped: {
124
+ get() {
125
+ const state = stateOf(this);
126
+ if (Predicate.isNotUndefined(state.tapped)) return state.tapped;
127
+ const lifecycle = state.lifecycle;
128
+ state.tapped = () => lifecycle.tapped();
129
+ return state.tapped;
130
+ }
131
+ },
132
+ next: {
133
+ get() {
134
+ const state = stateOf(this);
135
+ if (Predicate.isNotUndefined(state.next)) return state.next;
136
+ const lifecycle = state.lifecycle;
137
+ const next = name => lifecycle.wait(name);
138
+ state.next = next;
139
+ return next;
140
+ }
141
+ },
142
+ each: {
143
+ get() {
144
+ const state = stateOf(this);
145
+ if (Predicate.isNotUndefined(state.each)) return state.each;
146
+ const lifecycle = state.lifecycle;
147
+ const each = name => lifecycle.each(name);
148
+ state.each = each;
149
+ return each;
150
+ }
151
+ },
152
+ when: {
153
+ get() {
154
+ const state = stateOf(this);
155
+ if (Predicate.isNotUndefined(state.when)) return state.when;
156
+ const lifecycle = state.lifecycle;
157
+ const when = name => lifecycle.when(name);
158
+ state.when = when;
159
+ return when;
160
+ }
161
+ }
162
+ };
163
+ /** {@link WARD_MEMBER_KEYS} on one prototype over `Function.prototype`. */
164
+ const WARD_MEMBERS = /*#__PURE__*/Object.create(Function.prototype, WARD_MEMBER_KEYS);
165
+ /** What a `wardic.*` component or a `<Reorder>` item adds to a ward. Internal. */
166
+ /**
167
+ * The config keys that want a gesture on Solid 2 (#525), as the ward's `wants*` read them: an element
168
+ * given none, its keys fixed, is `gestureless`. Pan is wanted only through the lifecycle.
169
+ */
170
+ export const GESTURE_KEYS = ["whileHover", "whileTap", "whileInView", "whileFocus"];
171
+ /** A ward's share, or `undefined` for anything else (a function handed a component's own ward). */
172
+ export const shareOf = value => {
173
+ if (Bool.not(Predicate.hasProperty(value, WARD))) return undefined;
174
+ return value[WARD];
175
+ };
176
+ /** A ward driving an element while another is: a ward drives one element at a time (#349's Q5). */
177
+ const secondElement = name => `${name}: this ward is already on another element. A ward drives one element at a time: make one for each element, ` + "in the <For> callback or a component of its own, rather than giving or spreading the same one twice.";
178
+ /** Whether `other` is an element other than `el` still on the page (#349's Q5). */
179
+ const stillOn = (other, el) => {
180
+ if (Predicate.isUndefined(other)) return false;
181
+ return Bool.and(other !== el, other.isConnected);
182
+ };
183
+ /** What a ward's errors call it: the component it drives an element for, else `ward(config)`. */
184
+ const nameOf = internal => UndefinedOr.match(internal.name, {
185
+ onUndefined: () => "ward(config)",
186
+ onDefined: identity
187
+ });
188
+ /** What a Slim element tells its ward: it brings no Feature of its own (#511). */
189
+ export const SLIM = {};
190
+ /** A ward's internals from `ward()`'s options: its chosen parent, if any. */
191
+ export const internalsOf = (options, kind) => {
192
+ if (Predicate.isUndefined(options)) return kind;
193
+ if (Predicate.isUndefined(options.parent)) return kind;
194
+ return {
195
+ ...kind,
196
+ parent: options.parent
197
+ };
198
+ };
199
+ const NO_GESTURES = {
200
+ element: undefined,
201
+ inView: false,
202
+ focused: false,
203
+ hovered: false,
204
+ pressed: false,
205
+ dragging: false
206
+ };
207
+ /** Whether a ward's call is Solid applying it as a ref. */
208
+ const isElement = value => Predicate.hasProperty(value, "nodeType");
209
+ /** A context value as Solid 2's context takes it: `null` for none. */
210
+ const contextOf = value => Option.getOrNull(Option.fromUndefinedOr(value));
211
+ /**
212
+ * Says, once per provider, that a colour of the element's needs the `colors` Feature (#511, ADR-0067
213
+ * decision 7): a value naming a wide-gamut space, while the page reads none, outside a lazy load.
214
+ * Development only (its caller's `DEV`).
215
+ */
216
+ const warnUnreadColors = (registry, features, values) => {
217
+ createEffect(() => {
218
+ if (features.pending()) return undefined;
219
+ return unreadColorIn(values());
220
+ }, unread => {
221
+ if (Predicate.isUndefined(unread)) return;
222
+ registry.warnOnce("colors", missingMessage("colors", `The colour \`${unread}\``, "@wardic/solid/unstable/v2"));
223
+ }, CLIENT_ONLY);
224
+ };
225
+ /** Whether a config carries its variants (#398): it sets `variants` or `inherit`. */
226
+ const carriesVariants = config => Bool.or(Predicate.isNotUndefined(config.variants), Predicate.isNotUndefined(config.inherit));
227
+ /** A child made with `{ parent }` naming a Listening ward (#398's Q10). */
228
+ const LISTENING_PARENT = "ward(config, { parent }): the parent given carries no variants (no `variants` or `inherit` in its ward({ … })): it only listens, " + "and its element's props hold its variants, so a child can't join it by `{ parent }` (#398). Render the child inside that " + "ward's element, where it joins through the tree, or put the variants in the parent's ward({ … }).";
229
+ /**
230
+ * The **Layout group** a ward's `layoutId` goes in (#432): the one it's made in, as its presence and
231
+ * variant parent are; a driving ward's is its given ward's, where that was made, unless the element's
232
+ * own props set the `layoutId` (#398), which is then the element's.
233
+ */
234
+ const layoutGroupFor = (share, fixed) => {
235
+ if (Predicate.isUndefined(share)) return useLayoutGroupId();
236
+ if (Bool.and(Predicate.isNotUndefined(fixed), Predicate.hasProperty(fixed, "layoutId"))) return useLayoutGroupId();
237
+ return share.layoutGroup;
238
+ };
239
+ /**
240
+ * The variant context a ward is made under (#349): a driving ward's given ward's, else its given
241
+ * parent's, else the one around it. A driving ward for a Listening ward (#398) takes the one around
242
+ * its element instead, unless the ward's parent was chosen: its element builds its own node there.
243
+ */
244
+ const variantParentOf = internal => {
245
+ const share = internal.share;
246
+ if (Predicate.isNotUndefined(share)) {
247
+ if (Bool.or(share.carries, share.chosen)) return share.parent;
248
+ return useVariantContext();
249
+ }
250
+ const parent = shareOf(internal.parent);
251
+ if (Predicate.isNotUndefined(parent)) {
252
+ if (Bool.not(parent.carries)) throw new Error(LISTENING_PARENT);
253
+ return parent.provided;
254
+ }
255
+ return useVariantContext();
256
+ };
257
+ /**
258
+ * A ward's variant node: a driving ward's is its given ward's (#349), unless that ward listens
259
+ * (#398), when its element builds its own from its props; any other ward's is its own, made now.
260
+ */
261
+ const nodeFor = (share, cfg, config, parent, change) => {
262
+ if (Predicate.isNotUndefined(share)) {
263
+ const node = share.node;
264
+ if (Predicate.isNotUndefined(node)) {
265
+ if (share.carries) return node;
266
+ }
267
+ }
268
+ return createVariantNode(cfg, config, parent, change);
269
+ };
270
+ /** No change: a ward without Animation controls. */
271
+ const NO_CHANGE = constUndefined;
272
+ /**
273
+ * A ward's config with its `animate` read once, at setup (#433): **Animation controls** make each change
274
+ * they make its entry, over the rest of its keys as given, the view marked controlled; anything else, none.
275
+ */
276
+ const controlsOf = (given, animate) => {
277
+ if (Bool.not(isAnimationControls(animate))) return undefined;
278
+ const [change, setChange] = createSignal(undefined);
279
+ const view = Object.create(given, {
280
+ animate: {
281
+ enumerable: true,
282
+ get: () => UndefinedOr.map(change(), made => made.definition)
283
+ },
284
+ controlled: {
285
+ enumerable: true,
286
+ value: true
287
+ }
288
+ });
289
+ return {
290
+ controls: animate,
291
+ view,
292
+ change,
293
+ set: made => setChange(() => made)
294
+ };
295
+ };
296
+ /**
297
+ * `view` with its **Config transition** as its own when it gives none (#434, Motion's
298
+ * `{ ...config, ...props }`), read per read as its keys are; `view` itself with no `WardicConfig` above.
299
+ */
300
+ const configuredView = (view, config) => {
301
+ if (Predicate.isUndefined(config)) return view;
302
+ return Object.create(view, {
303
+ transition: {
304
+ enumerable: true,
305
+ get: () => UndefinedOr.match(view.transition, {
306
+ onUndefined: config.transition,
307
+ onDefined: identity
308
+ })
309
+ }
310
+ });
311
+ };
312
+ /**
313
+ * Whether a node's `when` gate lets a Retarget start (ADR-0007), as a memo, so only a flip of it
314
+ * re-runs what reads it. A plain node's gate never shuts (its `canStart` is `constTrue`), so it has
315
+ * none (#525).
316
+ */
317
+ const gateOf = node => {
318
+ if (node.canStart === constTrue) return constTrue;
319
+ return createMemo(() => node.canStart(), CLIENT_ONLY);
320
+ };
321
+ /** A ward's lifecycle: a driving ward's is its given ward's (#349), any other its own, made now. */
322
+ const lifecycleFor = (share, owner, want) => {
323
+ const shared = UndefinedOr.map(share, lifecycleOfShare);
324
+ if (Predicate.isNotUndefined(shared)) return shared;
325
+ return new Lifecycle(owner, want);
326
+ };
327
+ const lifecycleOfShare = share => share.lifecycle;
328
+ /** A mount's element. */
329
+ const elementOfMount = m => m.element;
330
+ /**
331
+ * A ward mounting an element another ward left in the same task: a spread's expression
332
+ * (`{...ward(config)}`), which Solid 2 runs again on every run of the element's props, making a new
333
+ * ward each time.
334
+ */
335
+ const REMADE = "ward(config) made a new ward for an element another ward just left: Solid 2 runs a spread's expression " + "(`<div {...ward(config)} />`) again on every run of the element's props. Make it once, in the component's body, " + "and spread that: `const card = ward(config)` then `<div {...card} />`. Or give it to `ref={ward(config)}`, client-only.";
336
+ /**
337
+ * The keys a ward reads as it goes, through its target or its style (#257 item 1): one still loading
338
+ * when the ward is made holds its region until it lands. Any other key is fixed at setup.
339
+ */
340
+ const LOADS_AS_IT_GOES = new Set(["animate", "whileHover", "whileTap", "whileFocus", "whileInView", "whileDrag", "transition", "style", "custom"]);
341
+ /** A ward's setup key still loading when it's made (#257 item 1). */
342
+ const loadingAtSetup = key => `ward(config): \`${key}\` was still loading when the ward was made. A ward reads it once, when it's made: give it a value, or make the ward once its data is in.`;
343
+ /** A ward that starts at its `animate`, still loading when it's made (#257 item 1). */
344
+ const STARTS_AT_PENDING = "ward(config): `animate` was still loading when the ward was made, and with `initial={false}` a ward starts there. Give it an `initial`, or make the ward once its data is in.";
345
+ /** A name list standing for an `animate` still loading at setup, on a ward with `variants` (#257 item 1). */
346
+ const LOADING_NAMES = [];
347
+ /**
348
+ * The config setup reads: a key still loading that setup fixes is an error (#257 item 1). A loading
349
+ * `animate` names the ward's own variants when it has `variants` (what it can name), and is a target
350
+ * of values otherwise: setup reads it only to tell which.
351
+ */
352
+ const configAtSetup = setup => {
353
+ if (setup.pending.length === 0) return setup.config;
354
+ const fixed = Arr.findFirst(setup.pending, key => Bool.not(LOADS_AS_IT_GOES.has(key)));
355
+ if (Option.isSome(fixed)) throw new Error(loadingAtSetup(fixed.value));
356
+ const config = setup.config;
357
+ if (Bool.and(Arr.contains(setup.pending, "animate"), Predicate.isNotUndefined(config.variants))) return {
358
+ ...config,
359
+ animate: LOADING_NAMES
360
+ };
361
+ return config;
362
+ };
363
+ /**
364
+ * Elements a ward has left in this task: a ward mounting one is {@link REMADE}. Cleared once, at the
365
+ * task's end, by one microtask however many leave (#259: one a ward cost 0.2 ms an unmount of 1,000).
366
+ */
367
+ // Module state (#460, Q7): the page's one end-of-task batch: cleared by one microtask at the task's end.
368
+ const justLeft = new Set();
369
+ const forgetJustLeft = () => justLeft.clear();
370
+ /** {@link ward} with a `wardic.<tag>`'s additions. Internal. */
371
+ /**
372
+ * Makes a mounted element's layout node with `arrive` if it was on its way as the element mounted and
373
+ * `services` has `layout` now (#582). A module's function, not a ward's: a ward makes none.
374
+ */
375
+ const layoutArrivedIn = (arrive, services) => {
376
+ UndefinedOr.map(arrive, make => UndefinedOr.map(projectionIn(services), make));
377
+ };
378
+ export function wardWith(config, internal) {
379
+ if (Predicate.isFunction(config)) throw new Error(WHOLE_ACCESSOR);
380
+ const runtime = useWardicRuntime();
381
+ // Its Features (#511, ADR-0067), a Complete element's every one: what they register, a server
382
+ // render's elements read too (the `colors` Feature's spaces).
383
+ const features = useElementFeatures(internal.brings, internal.complete === true);
384
+ // A server render takes the lean path: the Starting style only, no spine (ADR-0021).
385
+ if (isServer) return serverWard(config, internal);
386
+ const gate = useWardicGate();
387
+ // Its section's projection system, the `layout` Feature's (#511): `undefined` without it. Read now,
388
+ // which builds the Features given to its section at once: the first element to ask builds them.
389
+ const layoutProjection = projectionIn(untrack(features.services));
390
+ // The provider's, once any section has built it: what its values register with.
391
+ const builtProjection = useBuiltProjection();
392
+ const reducedMotion = useWardicReducedMotion();
393
+ // Whether its animations are skipped (#468): its nearest WardicConfig's, read as each starts.
394
+ const skipAnimations = useWardicSkipAnimations();
395
+ // Where its drag's and pan's points are (#443): its nearest WardicConfig's, read as each starts.
396
+ const pagePoint = transformPagePointOf(useWardicConfig());
397
+ const positionalKeys = useWardicPositionalKeys();
398
+ const defaultTransition = useWardicDefaultTransition();
399
+ const owner = getOwner();
400
+ const reactivity = reactivityIn(owner);
401
+ const registry = registryOf(runtime);
402
+ // SSR/hydration-stable: the server ward makes the same one call.
403
+ const id = createUniqueId();
404
+ // Its config, read per key where it's read (#259): a change re-runs only what reads the key. With
405
+ // Animation controls for its `animate` (#433), read once, each change they make is its entry.
406
+ // Under a `WardicConfig`, its Config transition is its own when it gives none (#434).
407
+ const asGiven = configuredView(WARD_VIEW.of(config, internal.fixed), useWardicConfig());
408
+ // The config at setup, a plain copy read untracked: what setup reads, the keys read once among it.
409
+ // A key still loading (#257 item 1) is left out of it: one the ward reads as it goes holds its
410
+ // region until it lands; one setup fixes is an error, naming it. Its `animate` there tells
411
+ // Animation controls; one still loading is none.
412
+ const givenSetup = WARD_VIEW.setupOf(asGiven);
413
+ const controls = controlsOf(asGiven, givenSetup.config.animate);
414
+ const view = UndefinedOr.match(controls, {
415
+ onUndefined: () => asGiven,
416
+ onDefined: c => c.view
417
+ });
418
+ const cfg = () => view;
419
+ const setup = UndefinedOr.match(controls, {
420
+ onUndefined: () => givenSetup,
421
+ onDefined: () => WARD_VIEW.setupOf(view)
422
+ });
423
+ const initialConfig = UndefinedOr.match(controls, {
424
+ onUndefined: () => configAtSetup(setup),
425
+ onDefined: () => controlledConfigOf(configAtSetup(setup), undefined)
426
+ });
427
+ // Its Animation controls' change (#433), read with the Override stack: none without them.
428
+ const ownChange = UndefinedOr.match(controls, {
429
+ onUndefined: () => NO_CHANGE,
430
+ onDefined: c => c.change
431
+ });
432
+ // A ward a component was given (#349), whose element this one drives: its variant node and its
433
+ // lifecycle are that ward's, so its children, stagger and `next` readers are where it was made.
434
+ const share = internal.share;
435
+ // Its place in variant orchestration (ADR-0007, #50): where it's made, its given parent's (#349),
436
+ // or its given ward's.
437
+ const parent = variantParentOf(internal);
438
+ const node = nodeFor(share, cfg, initialConfig, parent, UndefinedOr.map(controls, c => c.change));
439
+ // The nearest <AnimatePresence> (ADR-0007), or none.
440
+ const presence = usePresenceContext();
441
+ // The Layout group its `layoutId` goes in (#432): where it's made, or a given ward's.
442
+ const layoutGroup = layoutGroupFor(share, internal.fixed);
443
+ // The values it starts from, read once (ADR-0003): its `initial`, or the one it inherits, or its
444
+ // `animate` with `initial={false}` (its own, inherited, or its presence's first render, #134).
445
+ const presenceBlocks = presenceBlocksInitial(presence);
446
+ if (Bool.and(Arr.contains(setup.pending, "animate"), startsAtAnimate(initialConfig, node.inherited, presenceBlocks))) throw new Error(STARTS_AT_PENDING);
447
+ const start = startOf(initialConfig, node.inherited, presenceBlocks, untrack);
448
+ // Read once by the provider (#618, M1).
449
+ const {
450
+ project
451
+ } = useWardicRenderer();
452
+ // The Starting style: the projected `initial`, carried by `style` until the gate's first commit
453
+ // (ADR-0021 decision 6, ADR-0034); an svg-inner tag's attribute keys as attributes. While
454
+ // hydrating, what the server rendered, the DOM's project (the Hydration hold). A layout node's is
455
+ // drawn through its projection at rest, as its first commit draws it (#245).
456
+ const layoutNode = isLayoutNode(initialConfig);
457
+ const drawnStart = drawnAtRest(start.initialValues, layoutNode, initialConfig.transformTemplate);
458
+ const projected = project(drawnStart);
459
+ const hydrating = isHydrating();
460
+ const startingPatch = Bool.match(hydrating, {
461
+ onTrue: () => DomRenderer.project(drawnStart),
462
+ onFalse: () => projected
463
+ });
464
+ if (hydrating) flagStartingStyle(runtime, id, startingPatch, projected);
465
+ const seed = Svg.splitPatchForTag(internal.tag, startingPatch);
466
+ // Its drag axis and a drag element's defaults (ADR-0004, ADR-0019 *Amendment (Reorder)*), under
467
+ // the user's style: `drag` is read once, as on the Solid 1 binding.
468
+ const dragAxis = dragAxisOf(initialConfig, internal);
469
+ const dragDefaults = dragDefaultsOf(initialConfig, internal);
470
+ // Its routed `style` keys (#130, ADR-0043), and its `style`, switched by the gate's hooks.
471
+ const live = createLiveStyle({
472
+ registry: registryOf(runtime),
473
+ onDroppedTransform: () => warnDroppedTransform(runtime, id),
474
+ reactivity
475
+ });
476
+ const projectStarting = Bool.match(hydrating, {
477
+ onTrue: () => DomRenderer.project,
478
+ onFalse: () => project
479
+ });
480
+ // The element's style (#264): the config's, with the latest `.with()` style over it, key by key.
481
+ // `.with()` runs in the spread's computation, an owned scope: it tells `read(key)` through a
482
+ // signal written there (`ownedWrite`), and never `style`, whose spread would run `.with` again.
483
+ let given = NO_WITH;
484
+ // Made at the first `read(key)` or `.with()`: most elements call neither.
485
+ let withCalls;
486
+ const withCallsOf = () => {
487
+ if (Predicate.isUndefined(withCalls)) withCalls = runWithOwner(owner, () => createSignal(undefined, {
488
+ equals: false,
489
+ ownedWrite: true
490
+ }));
491
+ return withCalls;
492
+ };
493
+ const userStyle = () => withStyleOver(cfg().style, given.style);
494
+ const elementStyle = createElementStyle({
495
+ userStyle,
496
+ starting: seed.style,
497
+ startingWith: routed => Svg.splitPatchForTag(internal.tag, projectStarting(drawnAtRest({
498
+ ...routed,
499
+ ...start.initialValues
500
+ }, layoutNode, initialConfig.transformTemplate))).style,
501
+ live,
502
+ defaults: dragDefaults,
503
+ base: internal.baseStyle,
504
+ reactivity
505
+ });
506
+ const snapshot = snapshotOf(start);
507
+ const reuse = makeReuse();
508
+ // Where its element starts (#414): the ward's start, or a fresh one for an element given after the
509
+ // last one left the page, as a mount after the first render's (no presence holds its `initial`
510
+ // back). Its Snapshot goes back to it, and its Starting style comes back on until its first commit.
511
+ let begun = start;
512
+ const beginFresh = () => {
513
+ // The config now, a plain copy read untracked, as setup reads it: this runs in the mount effect.
514
+ const now = WARD_VIEW.setupOf(view).config;
515
+ begun = startOf(now, node.inherited, false, untrack);
516
+ snapshot.values = {
517
+ ...begun.initialValues
518
+ };
519
+ snapshot.velocities = {};
520
+ snapshot.drawnAt = {};
521
+ elementStyle.restart(Svg.splitPatchForTag(internal.tag, project(drawnAtRest(begun.initialValues, layoutNode, now.transformTemplate))).style);
522
+ };
523
+ const configNow = () => view;
524
+ const styleNow = () => untrack(userStyle);
525
+ // What its exit resolves from under an <AnimatePresence> (#277: its `exit`, `variants`, `custom` and
526
+ // transition), kept current while it's alive: the presence resolves it as the ward leaves (ADR-0007).
527
+ const exitConfig = {
528
+ current: NO_EXIT_CONFIG
529
+ };
530
+ if (Predicate.isNotUndefined(presence)) {
531
+ // Its inherited transition is read untracked here: the effect keeps it current.
532
+ exitConfig.current = untrack(() => exitConfigOf(initialConfig, node.inherited));
533
+ createEffect(() => exitConfigOf(cfg(), node.inherited), config => {
534
+ exitConfig.current = config;
535
+ }, CLIENT_ONLY_DEFERRED);
536
+ }
537
+ // Its layout node (ADR-0009): the projection system it registers one with, decided at setup, as
538
+ // `layout` is read once, and what a release runs on, its Release offset (ADR-0016, *Amendment
539
+ // (#140)*). Its section's `layout` makes its node (#511): without it, its layout props do nothing,
540
+ // and development says so once, unless `layout` is on its way.
541
+ const wantsNode = wantsLayoutNode(initialConfig);
542
+ if (DEV && wantsNode && Predicate.isUndefined(layoutProjection) && Bool.not(untrack(features.pending))) {
543
+ useFeatureRegistry().warnOnce("layout", missingMessage("layout", LAYOUT_PROPS, "@wardic/solid/unstable/v2"));
544
+ }
545
+ const layoutNodes = Bool.match(wantsNode, {
546
+ onTrue: () => layoutProjection,
547
+ onFalse: constUndefined
548
+ });
549
+ const dragTransition = dragTransitionOf(initialConfig.dragElastic, initialConfig.dragTransition);
550
+ // The element, set by the ref during render. Its write is the one a ward makes in an owned scope: a
551
+ // ward called with its element in a component's body (WT2), not given to `ref`.
552
+ const [element, setElement] = createSignal(undefined, {
553
+ ownedWrite: true
554
+ });
555
+ // Its gesture layers' states (ADR-0005), one signal for the three, so the target reads one (#259),
556
+ // each recorded on its element: the hover and press recognizers, each started on its element the
557
+ // first time its `while*` target is set (#87, ADR-0040), and the drag's. A write that changes
558
+ // nothing keeps the same object.
559
+ const [gestureState, setGestureState] = createSignal(NO_GESTURES);
560
+ /** Set `layer` on `el`: a state recorded on another element starts again from none. */
561
+ const setGesture = (el, layer, on) => {
562
+ setGestureState(g => {
563
+ if (g.element !== el) return Bool.match(on, {
564
+ onTrue: () => ({
565
+ ...NO_GESTURES,
566
+ element: el,
567
+ [layer]: true
568
+ }),
569
+ onFalse: () => g
570
+ });
571
+ if (g[layer] === on) return g;
572
+ return {
573
+ ...g,
574
+ [layer]: on
575
+ };
576
+ });
577
+ };
578
+ // The layers on the element mounted now: a state recorded on one the ward has left reads as none, so
579
+ // a move resets nothing by writing (#257's audit: the reset, written in the mount's effect, fed the
580
+ // target memo and re-ran the effect, EFFECT_WRITES_OWN_SOURCE). With none recorded there's nothing
581
+ // to compare, so the element isn't read: its arrival doesn't re-run the target memo (#320).
582
+ const gestures = () => {
583
+ const g = gestureState();
584
+ if (g === NO_GESTURES) return g;
585
+ if (g.element === element()) return g;
586
+ return NO_GESTURES;
587
+ };
588
+ const dragging = () => gestures().dragging;
589
+ // The keys these read are `GESTURE_KEYS` (#525).
590
+ const wantsHover = () => Predicate.isNotUndefined(cfg().whileHover);
591
+ const wantsPress = () => Predicate.isNotUndefined(cfg().whileTap);
592
+ const wantsInView = () => Predicate.isNotUndefined(cfg().whileInView);
593
+ const wantsFocus = () => Predicate.isNotUndefined(cfg().whileFocus);
594
+ // The Override stack, compared by value: a change that resolves the same target doesn't Retarget.
595
+ // A keyboard lift turns `whileDrag` on, as a drag does (ADR-0037).
596
+ const lifted = UndefinedOr.match(internal.lifted, {
597
+ onUndefined: () => constFalse,
598
+ onDefined: identity
599
+ });
600
+ const target = createMemo(() => {
601
+ const g = gestures();
602
+ return resolutionOf(cfg(), node.inherited, start.initialLink, {
603
+ inView: g.inView,
604
+ focused: g.focused,
605
+ hovered: g.hovered,
606
+ pressed: g.pressed,
607
+ dragged: Bool.or(g.dragging, lifted()),
608
+ dragging: g.dragging
609
+ }, snapshot, ownChange());
610
+ }, {
611
+ equals: sameTarget,
612
+ transparent: true
613
+ });
614
+ // A colour only the `colors` Feature reads, on a Slim element without it (#511, decision 7): said
615
+ // once per provider, in development only, and not while a lazy load is on its way.
616
+ // eslint-disable-next-line solid/reactivity -- read inside the warning's effect, where it tracks
617
+ if (DEV && internal.complete !== true) warnUnreadColors(useFeatureRegistry(), features, () => target().resolved);
618
+ // Its gesture states, for what its variant node hands down (#291): bound at setup, before its
619
+ // children read them. Read from the gestures themselves, not the target: a gesture whose layer
620
+ // resolves to nothing new leaves the target as it was (`sameResolution`), but is on all the same.
621
+ // Only a provider has one: a guard, so other wards make nothing here.
622
+ const bindGestures = node.bindGestures;
623
+ if (Predicate.isNotUndefined(bindGestures)) {
624
+ // eslint-disable-next-line solid/reactivity -- read inside the variant node's gestures memo, where it tracks
625
+ bindGestures(() => {
626
+ const g = gestures();
627
+ return {
628
+ inView: g.inView,
629
+ focused: g.focused,
630
+ hovered: g.hovered,
631
+ pressed: g.pressed,
632
+ dragged: Bool.or(g.dragging, lifted())
633
+ };
634
+ });
635
+ }
636
+ // Its Retargets' starts and landings (#257, ADR-0046): `settled()` and `next("settled")`, each with
637
+ // the gesture layers its target was resolved with.
638
+ // A gesture's event asked for starts its recognizer on the mounted element (and on later mounts).
639
+ // The ward driving an element for this one, given to a component (#349): its `read`, `atom` and
640
+ // `next` follow that element. Followed through an Atom made at the first `read`, `atom` or drive.
641
+ let driver;
642
+ let driven;
643
+ const drivenAtom = () => {
644
+ if (Predicate.isNotUndefined(driven)) return driven;
645
+ const atom = Atom.make(driver);
646
+ runWithOwner(owner, () => onCleanup(registry().mount(atom)));
647
+ driven = atom;
648
+ return atom;
649
+ };
650
+ // A driving ward's are its given ward's (#349), whose `next` starts them on the element it drives.
651
+ const lifecycle = lifecycleFor(share, owner, () => {
652
+ watchLateGestures();
653
+ UndefinedOr.map(mounted, startRecognizers);
654
+ UndefinedOr.map(driver, d => d.wanted());
655
+ });
656
+ /** A handler's throw, reported as a fiber's failure is (ADR-0030, decision 4); the watch goes on. */
657
+ const onDefect = cause => {
658
+ runtime.runFork(Report.failure("wardic.ward: a gesture handler failed", cause));
659
+ };
660
+ // The provider's Features, for development's word on a missing one (#511).
661
+ const featureRegistry = useFeatureRegistry();
662
+ /**
663
+ * A gesture's service when the element `wanted` it: its section's Feature's (#511), `undefined`
664
+ * without it, which development says once, unless it's on its way.
665
+ */
666
+ const gestureIn = (services, name, key, wanted) => {
667
+ if (Bool.not(wanted)) return undefined;
668
+ const service = serviceIn(services, key);
669
+ if (DEV && Predicate.isUndefined(service) && Bool.not(untrack(features.pending))) {
670
+ featureRegistry.warnOnce(name, missingMessage(name, GESTURE_WORDS[name], "@wardic/solid/unstable/v2"));
671
+ }
672
+ return service;
673
+ };
674
+ /**
675
+ * Start the hover, press and pan recognizers its config or a `next` now wants, each once a mount:
676
+ * each hover or press transition sets its gesture layer, and every event is told to the lifecycle
677
+ * for `next` (#257, #273).
678
+ */
679
+ const startRecognizers = m => {
680
+ // Each through its section's Feature (#511), read as it starts: one that arrives lazily starts from
681
+ // then on, as the effect below runs this again.
682
+ const services = untrack(features.services);
683
+ const hover = gestureIn(services, "hover", HoverGesture, Bool.or(untrack(wantsHover), lifecycle.wantsHover));
684
+ if (Predicate.isNotUndefined(hover) && Bool.not(m.hover)) {
685
+ m.hover = true;
686
+ m.watch(hover.watch(m.element, {
687
+ on: transition => {
688
+ setGesture(m.element, "hovered", transition.active);
689
+ lifecycle.hovered(transition, m.element);
690
+ },
691
+ // Each move while it's hovered, for `hover` (#397): told only to a `next` or `when` that asked.
692
+ onMove: event => lifecycle.hoverMoved(event, m.element),
693
+ onDefect
694
+ }));
695
+ }
696
+ const press = gestureIn(services, "press", PressGesture, Bool.or(untrack(wantsPress), lifecycle.wantsPress));
697
+ if (Predicate.isNotUndefined(press) && Bool.not(m.press)) {
698
+ m.press = true;
699
+ m.watch(press.watch(m.element, {
700
+ on: press => {
701
+ setGesture(m.element, "pressed", press.phase === "start");
702
+ lifecycle.pressed(press, m.element);
703
+ },
704
+ onDefect
705
+ }, internal.keysTaken === true, () => tapPropagates(untrack(cfg).propagate)));
706
+ }
707
+ // A pan sets no layer: only a `next` wants it (#273).
708
+ const pan = gestureIn(services, "pan", PanGesture, lifecycle.wantsPan);
709
+ if (Predicate.isNotUndefined(pan) && Bool.not(m.pan)) {
710
+ m.pan = true;
711
+ m.watch(pan.watch(m.element, {
712
+ on: sample => lifecycle.panned(sample, m.element),
713
+ onDefect
714
+ }, {
715
+ mapPoint: pointMapOptionOf(pagePoint)
716
+ }));
717
+ }
718
+ // In view as its `viewport` says, read when it starts (#273).
719
+ const inView = gestureIn(services, "inView", InViewGesture, Bool.or(untrack(wantsInView), lifecycle.wantsInView));
720
+ if (Predicate.isNotUndefined(inView) && Bool.not(m.inView)) {
721
+ m.inView = true;
722
+ m.watch(inView.watch(m.element, inViewOptionsOf(untrack(cfg).viewport), {
723
+ on: transition => {
724
+ setGesture(m.element, "inView", transition.active);
725
+ lifecycle.viewed(transition);
726
+ },
727
+ onDefect
728
+ }));
729
+ }
730
+ // Focused as the browser shows it (`:focus-visible`, #273).
731
+ const focus = gestureIn(services, "focus", FocusGesture, untrack(wantsFocus));
732
+ if (Predicate.isNotUndefined(focus) && Bool.not(m.focus)) {
733
+ m.focus = true;
734
+ m.watch(focus.watch(m.element, {
735
+ visible: true
736
+ }, {
737
+ on: focused => setGesture(m.element, "focused", focused),
738
+ onDefect
739
+ }));
740
+ }
741
+ };
742
+ let mounted;
743
+ // The last two elements given to its ref, for a second one still on the page as it mounts (#349's Q5).
744
+ let refdLast;
745
+ let refdBefore;
746
+ // One given after the last one left the page, which enters fresh (#414). Read as the ref is called,
747
+ // before Solid inserts it: one replacing the last in the same update finds it still on the page.
748
+ let fresh;
749
+ // Inside a child `mode="wait"` holds off the page (#277, ADR-0048), it mounts once the child is on
750
+ // it: `shown` ticks then, and the mount effect, which reads `ticked`, runs again. Only under a
751
+ // presence: with none, its compute calls a no-op and makes nothing. `held` cancels the wait.
752
+ let ticked = constUndefined;
753
+ let shown;
754
+ if (Predicate.isNotUndefined(presence)) {
755
+ const [read, tick] = createSignal(undefined, {
756
+ equals: false
757
+ });
758
+ ticked = read;
759
+ shown = () => tick(undefined);
760
+ }
761
+ let held;
762
+ const unhold = () => {
763
+ if (Predicate.isUndefined(held)) return;
764
+ held();
765
+ held = undefined;
766
+ };
767
+ /** Whether `el` waits off the page for its held child: its mount queued with the presence. */
768
+ const heldBack = el => {
769
+ unhold();
770
+ if (Predicate.isUndefined(shown)) return false;
771
+ held = presenceHold(presence, el, shown);
772
+ return Predicate.isNotUndefined(held);
773
+ };
774
+ const unmount = () => {
775
+ unhold();
776
+ if (Predicate.isUndefined(mounted)) return;
777
+ const left = mounted.element;
778
+ mounted.dispose();
779
+ mounted = undefined;
780
+ if (justLeft.size === 0) queueMicrotask(forgetJustLeft);
781
+ justLeft.add(left);
782
+ };
783
+ // Its element's mount goes, and its lifecycle's waits are rejected (#257): one cleanup.
784
+ // A driving ward's lifecycle is its given ward's, which outlives the element (#349).
785
+ onCleanup(() => {
786
+ unmount();
787
+ if (Predicate.isUndefined(share)) lifecycle.dispose();
788
+ });
789
+ const mount = el => {
790
+ if (justLeft.has(el)) throw new Error(REMADE);
791
+ // The ward a component was given follows this element while it's mounted (#349): one at a time.
792
+ let undrive;
793
+ if (Predicate.isNotUndefined(share)) {
794
+ undrive = share.drive({
795
+ wanted: () => {
796
+ UndefinedOr.map(mounted, startRecognizers);
797
+ },
798
+ readAtom: key => readEntry(key).atom,
799
+ atom: key => gate.valueOf(id, key)
800
+ }, nameOf(internal));
801
+ }
802
+ // The gate commits each frame onto the element (ADR-0006, ADR-0034); the hooks switch its
803
+ // `style`. An element with `onUpdate` at mount is told each committed frame (#233). While
804
+ // hydrating, its Appear animation is found here, taken over by its first Retarget that starts,
805
+ // and removed in its first commit (the Handoff, ADR-0044 decision 6).
806
+ const handoff = Bool.match(hydrating, {
807
+ onTrue: () => Option.getOrUndefined(handoffOf(el)),
808
+ onFalse: constUndefined
809
+ });
810
+ // Its Transform template (#443), drawn with its first write: the one at mount, then each other one
811
+ // its config gives.
812
+ const templateAtMount = configNow().transformTemplate;
813
+ let template = templateAtMount;
814
+ const registered = registeredValuesOf(templateAtMount);
815
+ const unregister = gate.register(id, releasingAppear(withOnUpdate({
816
+ target: el,
817
+ ...elementStyle.hooks
818
+ }, configNow().onUpdate, configNow), handoff, el), registered);
819
+ // Its values, for the projection's flights (ADR-0012 *Amendment (#137)*).
820
+ // None while no section has `layout`: there's no flight to follow them (#511).
821
+ const unregisterValues = UndefinedOr.match(builtProjection(), {
822
+ onUndefined: () => constVoid,
823
+ onDefined: projection => projection.registerValues(el, () => snapshot.values)
824
+ });
825
+ const links = startLinksOf(el, styleNow, live);
826
+ // Its exit record, under an <AnimatePresence>: the presence removes it once the exit settles.
827
+ const presenceRecord = UndefinedOr.map(presence, registrar => {
828
+ const record = presenceRecordOf(el, begun, (custom, inherited) => exitTargetOf(exitConfig.current, custom, snapshot, inherited), links, presenceTreeOf(initialConfig), snapshot, reducedMotion, skipAnimations);
829
+ registrar.register(record);
830
+ return record;
831
+ });
832
+ const recordFrame = recordFrameOf(presenceRecord);
833
+ // Its exit is drawn through its template (#443): it rides in its presence record, whose drawn values
834
+ // the projection reads as it leaves. A later one is written with the values it holds, so the commit
835
+ // that may take its Starting style off holds them.
836
+ // Nothing with none (#460): no follow.
837
+ let unfollowTemplate = constVoid;
838
+ if (Predicate.isNotUndefined(templateAtMount)) {
839
+ recordFrame(registered);
840
+ unfollowTemplate = followTemplate(templateAtMount, () => view.transformTemplate, reactivity.watch, next => {
841
+ template = next;
842
+ gate.write(id, {
843
+ ...snapshot.values,
844
+ [DomRenderer.TEMPLATE_KEY]: next
845
+ });
846
+ recordFrame({
847
+ [DomRenderer.TEMPLATE_KEY]: next
848
+ });
849
+ });
850
+ }
851
+ // Where it starts when its child takes over from a leaver (#286): asked before its layout node
852
+ // registers, which moves from the leaver's box, and before its first Retarget.
853
+ const taken = presenceSeedOf(presence, el);
854
+ // Its one projection node (ADR-0009, ADR-0010), its own `x`/`y` drawn on top of it (#363).
855
+ // Its layout animations' starts and landings, and its drag's release at rest, go to the lifecycle,
856
+ // for `next("layoutStart")`, `next("layoutComplete")` and `next("dragTransitionEnd")` (#257, #273):
857
+ // Solid 2 has no props for them.
858
+ let layout;
859
+ // A `<Reorder>` item's group registers the node, until the unmount.
860
+ let handedOver;
861
+ // `layout` on its way as it mounted (#582): its node is made as it arrives (`arriveLayout`), as
862
+ // Motion's is, and measures from then on; nothing before it is replayed.
863
+ let arriveLayout;
864
+ if (wantsNode) {
865
+ // `takenNow`: where a child that takes over from a leaver starts, at its mount only (#286).
866
+ const layoutNodeOn = (projection, takenNow) => {
867
+ const started = () => lifecycle.layoutStarted();
868
+ const completed = () => lifecycle.layoutCompleted();
869
+ const released = () => lifecycle.released();
870
+ const handle = projection.register(registrationOf({
871
+ ...layoutOptionsOf({
872
+ id,
873
+ element: el,
874
+ config: configNow,
875
+ parent: node.inherited,
876
+ snapshot,
877
+ dragTransition,
878
+ raiseWhileDragged: internal.raiseWhileDragged === true,
879
+ taken: takenNow,
880
+ layoutGroup,
881
+ reducedMotion,
882
+ skipAnimations,
883
+ heldTransform: heldTransformFor(snapshot, templateAtMount, () => template)
884
+ }),
885
+ onLayoutAnimationStart: () => started,
886
+ onLayoutAnimationComplete: () => completed,
887
+ // Its drag's Release offset at rest, for `next("dragTransitionEnd")` (#273).
888
+ onReleaseEnd: () => released
889
+ }));
890
+ layout = handle;
891
+ handedOver = UndefinedOr.map(internal.onLayoutHandle, onHandle => onHandle(handle));
892
+ };
893
+ // Its section's `layout` as it mounts: had at setup, or arrived since (#582).
894
+ const now = UndefinedOr.match(layoutNodes, {
895
+ onDefined: identity,
896
+ onUndefined: () => projectionIn(untrack(features.services))
897
+ });
898
+ if (Predicate.isNotUndefined(now)) layoutNodeOn(now, taken);
899
+ if (Predicate.isUndefined(layout)) {
900
+ arriveLayout = projection => {
901
+ if (Predicate.isNotUndefined(layout)) return;
902
+ layoutNodeOn(projection, undefined);
903
+ // A plain field, not a getter: a getter of its own on every record gave each its own shape (#582).
904
+ m.layout = layout;
905
+ };
906
+ }
907
+ }
908
+ // Its watch Scope (#318, #379, ADR-0055): its gesture watches and its drag track run in it, each
909
+ // subscribed at once with no fiber of its own, until the unmount closes it. Made at the first
910
+ // watch: a ward with no gesture makes and closes none.
911
+ let watchScope;
912
+ const watchIn = watch => {
913
+ if (Predicate.isUndefined(watchScope)) watchScope = OwnerScope.open(runtime);
914
+ runtime.runSync(watch.pipe(Scope.provide(watchScope)));
915
+ };
916
+ if (internal.defaultsOnElement === true) UndefinedOr.map(dragDefaults, defaults => applyDragDefaults(el, defaults));
917
+ // The drag track (ADR-0004): the pointer direct-sets `x`/`y` while the spring drives the rest and
918
+ // `whileDrag`; on a layout node it feeds the projection (ADR-0016).
919
+ const locked = initialConfig.dragDirectionLock === true;
920
+ // Its section's `drag` Feature drives it (#511): without it, `drag` does nothing, and development
921
+ // says so once, unless `drag` is on its way.
922
+ const dragGesture = gestureIn(untrack(features.services), "drag", DragGesture, Predicate.isNotUndefined(dragAxis));
923
+ // Whether its track drives its layout node (ADR-0016): the node it has as the track is made, at
924
+ // mount or as `drag` arrives; a node made later leaves it moving `x`/`y` (#582).
925
+ let dragProjected = false;
926
+ const driveDrag = gesture => {
927
+ const axis = UndefinedOr.getOrThrow(dragAxis);
928
+ dragProjected = Predicate.isNotUndefined(layout);
929
+ // Motion's `dragConstraints` (#273): a box of numbers, or a container measured against the element.
930
+ const constraints = gesture.constraintsOf(initialConfig.dragConstraints, el, () => untrack(cfg).onMeasureDragConstraints, pagePoint);
931
+ return gesture.drive({
932
+ watch: track => watchIn(track(onDefect)),
933
+ fork: response => void runtime.runFork(response),
934
+ gate,
935
+ id,
936
+ element: el,
937
+ snapshot,
938
+ recordFrame,
939
+ // A drag's start turns its `style`'s will-change value on (#443).
940
+ setDragging: draggingWithWillChange(live, on => setGesture(el, "dragging", on)),
941
+ mapPoint: pagePoint,
942
+ skipAnimations,
943
+ config: {
944
+ axis,
945
+ constraints: constraints.constraints,
946
+ elastic: initialConfig.dragElastic,
947
+ momentum: initialConfig.dragMomentum,
948
+ snapToOrigin: initialConfig.dragSnapToOrigin,
949
+ propagation: initialConfig.dragPropagation,
950
+ directionLock: initialConfig.dragDirectionLock,
951
+ transition: dragTransition,
952
+ listen: initialConfig.dragListener
953
+ },
954
+ container: constraints.container,
955
+ controls: initialConfig.dragControls,
956
+ ...UndefinedOr.match(layout, {
957
+ onUndefined: () => ({}),
958
+ onDefined: projectionNode => ({
959
+ projection: projectionNode
960
+ })
961
+ }),
962
+ ...UndefinedOr.match(internal.dragAxis, {
963
+ onUndefined: () => ({}),
964
+ onDefined: axisAt => ({
965
+ axisAt
966
+ })
967
+ }),
968
+ // Its samples to a `<Reorder>` item's group, and to the lifecycle for `next("dragStart")` (#257)
969
+ // and, with a direction lock, `next("directionLock")` (#273).
970
+ onSample: UndefinedOr.match(internal.onDragSample, {
971
+ onUndefined: () => sample => lifecycle.dragged(sample, locked, el),
972
+ onDefined: onSample => sample => {
973
+ onSample(sample);
974
+ lifecycle.dragged(sample, locked, el);
975
+ }
976
+ }),
977
+ // Its release at rest, for `next("dragTransitionEnd")` (#273).
978
+ onReleaseEnd: () => lifecycle.released()
979
+ });
980
+ };
981
+ let dragTrack = UndefinedOr.map(dragGesture, driveDrag);
982
+ const spineOptions = {
983
+ runtime,
984
+ gate,
985
+ id,
986
+ element: el,
987
+ tag: internal.tag,
988
+ config: configNow,
989
+ parent: node.inherited,
990
+ canStart: node.canStart,
991
+ extraDelay: node.extraDelay,
992
+ byName: node.names,
993
+ onFrame: node.onFrame,
994
+ reducedMotion,
995
+ skipAnimations,
996
+ positionalKeys,
997
+ defaultTransition,
998
+ start: begun,
999
+ snapshot,
1000
+ reuse,
1001
+ links,
1002
+ styleNow,
1003
+ live,
1004
+ presence: presenceRecord,
1005
+ projected: Predicate.isNotUndefined(layout),
1006
+ dragAxis,
1007
+ drag: dragTrack,
1008
+ handoff,
1009
+ animation: lifecycle
1010
+ };
1011
+ // A `drag` on its way as it mounted (#551): its track starts as the Feature arrives (`startDrag`),
1012
+ // and the spine reads it at each Retarget from then on. Only then is `drag` a getter, so an
1013
+ // element that has it at mount, or never wants it, pays nothing.
1014
+ let startDrag;
1015
+ if (Predicate.isNotUndefined(dragAxis) && Predicate.isUndefined(dragTrack) && untrack(features.pending)) {
1016
+ Object.defineProperty(spineOptions, "drag", {
1017
+ get: () => dragTrack
1018
+ });
1019
+ // Whether that track drives the layout node (#582): until it starts, whether the element has one.
1020
+ Object.defineProperty(spineOptions, "projected", {
1021
+ get: () => UndefinedOr.match(dragTrack, {
1022
+ onUndefined: () => Predicate.isNotUndefined(layout),
1023
+ onDefined: () => dragProjected
1024
+ })
1025
+ });
1026
+ startDrag = gesture => {
1027
+ if (Predicate.isUndefined(dragTrack)) dragTrack = driveDrag(gesture);
1028
+ };
1029
+ }
1030
+ const spine = makeElementSpine(spineOptions);
1031
+ // A child back under its key starts where its leaver is drawn (#286), before its first Retarget.
1032
+ if (Predicate.isNotUndefined(taken)) spine.seed(taken);
1033
+ // Live values in `style` (#130, ADR-0043): followed from the first routed key on.
1034
+ spine.follow({
1035
+ resolved: () => untrack(target).resolved,
1036
+ dragging: () => untrack(dragging)
1037
+ });
1038
+ // Its Imperative animations (#433) go through its spine while it's mounted, and its Animation controls reach it.
1039
+ const unregisterAnimatable = registerAnimatable(el, spine);
1040
+ const unsubscribe = UndefinedOr.match(controls, {
1041
+ onUndefined: () => constVoid,
1042
+ onDefined: c => subscribe(c.controls, controlledElement(c.set, {
1043
+ custom: () => untrack(() => view.custom),
1044
+ snapshot
1045
+ }, spine.stop))
1046
+ });
1047
+ const m = {
1048
+ element: el,
1049
+ spine,
1050
+ layout,
1051
+ arriveLayout,
1052
+ watch: watchIn,
1053
+ startDrag,
1054
+ hover: false,
1055
+ press: false,
1056
+ pan: false,
1057
+ inView: false,
1058
+ focus: false,
1059
+ dispose: () => {
1060
+ if (Predicate.isNotUndefined(undrive)) undrive();
1061
+ UndefinedOr.map(mountedHook, end => end());
1062
+ unregisterAnimatable();
1063
+ unsubscribe();
1064
+ spine.dispose();
1065
+ // Its gesture watches' and drag track's listeners go, a running release stops, and their spans end.
1066
+ UndefinedOr.map(watchScope, scope => OwnerScope.close(runtime, scope, "wardic.ward: a finalizer failed"));
1067
+ // The group lets go of the node before it's disposed.
1068
+ UndefinedOr.map(handedOver, release => release());
1069
+ UndefinedOr.map(layout, node => node.dispose());
1070
+ unfollowTemplate();
1071
+ unregisterValues();
1072
+ unregister();
1073
+ }
1074
+ };
1075
+ startRecognizers(m);
1076
+ const mountedHook = UndefinedOr.map(internal.onMount, onMount => onMount(el, make => watchIn(make(onDefect))));
1077
+ return m;
1078
+ };
1079
+ // A `while*` target set after mount starts its recognizer then (#87, ADR-0040). Its compute reads
1080
+ // the two keys, so only their changes re-run it (#259).
1081
+ // Its section's Features are read there too, so a gesture's arriving lazily starts it (#511): each
1082
+ // start checks what's wanted.
1083
+ // An element whose config can never want one (`gestureless`, #525) makes it at its first want
1084
+ // through its lifecycle instead: no computation an element until then.
1085
+ let watchingLate = false;
1086
+ const watchLateGestures = () => {
1087
+ if (watchingLate) return;
1088
+ watchingLate = true;
1089
+ runWithOwner(owner, () => createEffect(() => ({
1090
+ wanted: Bool.some([wantsHover(), wantsPress(), wantsInView(), wantsFocus()]),
1091
+ services: features.services()
1092
+ }), () => {
1093
+ UndefinedOr.map(mounted, startRecognizers);
1094
+ }, CLIENT_ONLY_SYNC_DEFERRED));
1095
+ };
1096
+ if (internal.gestureless !== true) watchLateGestures();
1097
+ // `layout` on its way (#582): an element mounted before it arrives makes its node then, as its
1098
+ // gestures and drag start theirs; a load that brings none gets development's word then.
1099
+ if (Bool.and(wantsNode, Predicate.isUndefined(layoutProjection)) && untrack(features.pending)) {
1100
+ createEffect(() => ({
1101
+ services: features.services(),
1102
+ pending: features.pending()
1103
+ }),
1104
+ // Its apply returns nothing: a function returned there would be its cleanup.
1105
+ ({
1106
+ services,
1107
+ pending
1108
+ }) => {
1109
+ UndefinedOr.map(mounted, m => layoutArrivedIn(m.arriveLayout, services));
1110
+ if (DEV && Predicate.isUndefined(projectionIn(services)) && Bool.not(pending)) {
1111
+ featureRegistry.warnOnce("layout", missingMessage("layout", LAYOUT_PROPS, "@wardic/solid/unstable/v2"));
1112
+ }
1113
+ }, CLIENT_ONLY_DEFERRED);
1114
+ }
1115
+ // A `drag` on its way (#551): an element mounted before it arrives starts its track then, as its
1116
+ // gestures' recognizers do, and nothing before it is replayed; a load that brings none gets
1117
+ // development's word then.
1118
+ if (Predicate.isNotUndefined(dragAxis) && untrack(features.pending)) {
1119
+ createEffect(() => ({
1120
+ services: features.services(),
1121
+ pending: features.pending()
1122
+ }),
1123
+ // Its apply returns nothing: a function returned there would be its cleanup.
1124
+ ({
1125
+ services,
1126
+ pending
1127
+ }) => {
1128
+ UndefinedOr.match(serviceIn(services, DragGesture), {
1129
+ // A `layout` from the same load makes its node first, so the track drives it (#582).
1130
+ onDefined: gesture => UndefinedOr.map(mounted, m => {
1131
+ layoutArrivedIn(m.arriveLayout, services);
1132
+ UndefinedOr.map(m.startDrag, start => start(gesture));
1133
+ }),
1134
+ onUndefined: () => {
1135
+ if (DEV && Bool.not(pending)) featureRegistry.warnOnce("drag", missingMessage("drag", GESTURE_WORDS.drag, "@wardic/solid/unstable/v2"));
1136
+ }
1137
+ });
1138
+ }, CLIENT_ONLY_DEFERRED);
1139
+ }
1140
+ // A `layoutDependency` change re-measures its layout node (not at mount: it measures as it registers).
1141
+ // Only a change of its value: a memo, since a Solid 2 effect applies on every re-run of its compute,
1142
+ // and `cfg()` is re-read on any of the config's changes (a `style` change re-measured, #209 PR 5's lab).
1143
+ // Its node may be made as `layout` arrives (#582), so it's read at each change.
1144
+ if (wantsNode) {
1145
+ const dependency = createMemo(() => cfg().layoutDependency, CLIENT_ONLY);
1146
+ createEffect(dependency, () => {
1147
+ UndefinedOr.map(UndefinedOr.map(mounted, m => m.layout), node => node.notify());
1148
+ }, CLIENT_ONLY_DEFERRED);
1149
+ }
1150
+ // Whether the `when` gate lets a Retarget start (ADR-0007), as a memo: an element with variants of
1151
+ // its own reads its `when` off its config, and only a flip of the gate may re-run the effect.
1152
+ const open = gateOf(node);
1153
+ // Mount, then Retarget on each change of the target or of the `when` gate: both are read here,
1154
+ // so a gate's flip re-runs it and releases a held Retarget. Only once the ref has given the
1155
+ // element (#320): until then the effect reads nothing else, so the target is first resolved with
1156
+ // its element, once, and a config that lands before the element (an async one) doesn't run it.
1157
+ createEffect(() => {
1158
+ const el = element();
1159
+ if (Predicate.isUndefined(el)) return undefined;
1160
+ return {
1161
+ el,
1162
+ resolution: target(),
1163
+ open: open(),
1164
+ shown: ticked()
1165
+ };
1166
+ }, mounting => {
1167
+ if (Predicate.isUndefined(mounting)) return;
1168
+ const {
1169
+ el,
1170
+ resolution
1171
+ } = mounting;
1172
+ if (Predicate.isUndefined(mounted) || mounted.element !== el) {
1173
+ // Another element it was spread on, or the one it's on, still on the page: a ward drives one
1174
+ // element at a time (#349's Q5). One the page has let go of is left behind.
1175
+ if (Bool.or(stillOn(refdBefore, el), stillOn(UndefinedOr.map(mounted, elementOfMount), el))) throw new Error(secondElement("ward(config)"));
1176
+ refdBefore = undefined;
1177
+ // Held off the page: nothing starts until it's on it.
1178
+ if (heldBack(el)) return;
1179
+ // A new element starts with no gesture on, read from its gesture state (#257's audit).
1180
+ unmount();
1181
+ // One that came after the last left the page enters fresh (#414).
1182
+ if (el === fresh) beginFresh();
1183
+ // Its config is read at mount (its layout node's options, its `onUpdate`, its spine's) through
1184
+ // the per-key view (#259): untracked, so said, as the Retarget below.
1185
+ mounted = untrack(() => mount(el));
1186
+ }
1187
+ // The spine reads the variant context (its gates, its stagger, what it inherits) at the
1188
+ // Retarget, once: untracked, so said (Solid 2's dev build warns of a reactive read in an
1189
+ // effect's apply, STRICT_READ_UNTRACKED). The effect's compute is what re-runs it.
1190
+ const spine = mounted.spine;
1191
+ untrack(() => spine.retarget(resolution));
1192
+ }, CLIENT_ONLY_SYNC);
1193
+ // `<card.Provider>` hands down what this element hands its children (#50).
1194
+ const Provider = props => _$createComponent(WardicVariantContext, {
1195
+ get value() {
1196
+ return contextOf(node.provided);
1197
+ },
1198
+ get children() {
1199
+ return props.children;
1200
+ }
1201
+ });
1202
+ // The element's value per key (#130, ADR-0043 decision 5): the gate's output while it holds the
1203
+ // key, else where the key rests. One accessor a key, made on first ask, under the ward's owner. It
1204
+ // carries its Atom (#209 PR 3's Q2): a `style` given it follows the Atom, set at the gate's write,
1205
+ // so a key derived from it paints in the same frame. Where the key rests is Solid's (the user's
1206
+ // style), mirrored into an Atom of its own.
1207
+ let reads;
1208
+ const readEntry = key => {
1209
+ if (Predicate.isUndefined(reads)) reads = new Map();
1210
+ const known = reads.get(key);
1211
+ if (Predicate.isNotUndefined(known)) return known;
1212
+ const output = gate.valueOf(id, key);
1213
+ const following = drivenAtom();
1214
+ const entry = runWithOwner(owner, () => {
1215
+ const resting = createMemo(() => {
1216
+ withCallsOf()[0]();
1217
+ return restingOf(key, start.initialValues, userStyle(), raw => live.read(raw));
1218
+ }, CLIENT_ONLY);
1219
+ const restingAtom = Atom.make(untrack(resting));
1220
+ onCleanup(registry().mount(restingAtom));
1221
+ createEffect(resting, value => {
1222
+ registry().set(restingAtom, value);
1223
+ }, CLIENT_ONLY_DEFERRED);
1224
+ const own = Atom.make(get => UndefinedOr.match(get(output), {
1225
+ onUndefined: () => get(restingAtom),
1226
+ onDefined: identity
1227
+ }));
1228
+ // Given to a component (#349): what the element it drives shows, while it's there.
1229
+ const atom = Atom.make(get => UndefinedOr.match(get(following), {
1230
+ onUndefined: () => get(own),
1231
+ onDefined: d => get(d.readAtom(key))
1232
+ }));
1233
+ return {
1234
+ accessor: followAtom(registry(), atom),
1235
+ atom
1236
+ };
1237
+ });
1238
+ reads.set(key, entry);
1239
+ return entry;
1240
+ };
1241
+ const read = key => readEntry(key).accessor;
1242
+ // Its `atom(key)`: the gate's output, or, given to a component (#349), the one of the element it drives.
1243
+ const atomOf = key => {
1244
+ const own = gate.valueOf(id, key);
1245
+ const following = drivenAtom();
1246
+ return Atom.make(get => UndefinedOr.match(get(following), {
1247
+ onUndefined: () => get(own),
1248
+ onDefined: d => get(d.atom(key))
1249
+ }));
1250
+ };
1251
+ // The element's style, read where it renders. The keys still loading at setup (#257 item 1) are
1252
+ // read there too, with the target, so its region holds until they land and Solid retries it: the
1253
+ // Retarget reads `transition` as it starts, untracked, which a pending one would throw out of.
1254
+ // After that a refetch keeps the last value (Solid holds the previous one), and holds nothing.
1255
+ const holdWhileLoading = Bool.match(setup.pending.length === 0, {
1256
+ onTrue: () => constVoid,
1257
+ onFalse: () => {
1258
+ const config = cfg();
1259
+ // Client-only, so transparent to hydration ids as every computation of the binding's is (#618).
1260
+ const loaded = createMemo(() => {
1261
+ Arr.forEach(setup.pending, key => void config[key]);
1262
+ target();
1263
+ return true;
1264
+ }, CLIENT_ONLY);
1265
+ return () => {
1266
+ loaded();
1267
+ };
1268
+ }
1269
+ });
1270
+ const renderedStyle = () => {
1271
+ holdWhileLoading();
1272
+ return elementStyle.style(userStyle());
1273
+ };
1274
+ // The ward: a ref, and its own props. Under a presence, its element is told to it as it's made
1275
+ // (#286): its `key`, and whether it's a twin.
1276
+ // What it shares with a component it's given to (#349), made when one asks.
1277
+ let shared;
1278
+ const sharedNow = () => {
1279
+ if (Predicate.isNotUndefined(shared)) return shared;
1280
+ /**
1281
+ * A ward driving an element for this one, given to a component (#349): followed until the release,
1282
+ * its `read` and `atom` Atoms reading the driver's. One at a time, and not while this one is on an
1283
+ * element of its own (#349's Q5).
1284
+ */
1285
+ const drive = (next, name) => {
1286
+ if (Bool.or(Predicate.isNotUndefined(driver), stillOn(UndefinedOr.map(mounted, elementOfMount), undefined))) throw new Error(secondElement(name));
1287
+ driver = next;
1288
+ UndefinedOr.map(driven, atom => registry().set(atom, next));
1289
+ return () => {
1290
+ if (driver !== next) return;
1291
+ driver = undefined;
1292
+ UndefinedOr.map(driven, atom => registry().set(atom, undefined));
1293
+ };
1294
+ };
1295
+ shared = {
1296
+ config,
1297
+ setup: initialConfig,
1298
+ internal,
1299
+ parent,
1300
+ chosen: Predicate.isNotUndefined(internal.parent),
1301
+ carries: carriesVariants(initialConfig),
1302
+ provided: node.provided,
1303
+ layoutGroup,
1304
+ node,
1305
+ lifecycle,
1306
+ drive
1307
+ };
1308
+ return shared;
1309
+ };
1310
+ const setMade = madeWith(presence, setElement, initialConfig);
1311
+ const self = value => {
1312
+ if (isElement(value)) {
1313
+ const last = refdLast;
1314
+ if (Predicate.isNotUndefined(last)) {
1315
+ if (last !== value) {
1316
+ refdBefore = last;
1317
+ if (Bool.not(last.isConnected)) fresh = value;
1318
+ }
1319
+ }
1320
+ refdLast = value;
1321
+ setMade(value);
1322
+ return undefined;
1323
+ }
1324
+ return spreadNow();
1325
+ };
1326
+ // What a spread of the ward reads (#495): its spread's props alone, made at its first spread, so a
1327
+ // ward given only to `ref` makes none, and a Reorder item's keyboard attributes are in it.
1328
+ let spread;
1329
+ // Its `style` and its attributes as descriptors, made once (#460): its own keys, its spread and each
1330
+ // `.with()` share them.
1331
+ const styleKey = {
1332
+ get: renderedStyle,
1333
+ enumerable: true
1334
+ };
1335
+ const attributes = attributeKeysOf(seed.attrs, Predicate.isNotUndefined(dragDefaults));
1336
+ const spreadNow = () => {
1337
+ if (Predicate.isUndefined(spread)) spread = spreadOfWard(self, {
1338
+ value: self,
1339
+ enumerable: true
1340
+ }, styleKey, attributes);
1341
+ return spread;
1342
+ };
1343
+ // Its members are the ones every ward shares (#525), reading this state: its own are `ref`, `style`
1344
+ // and its attributes.
1345
+ const state = {
1346
+ shared: sharedNow,
1347
+ Provider,
1348
+ read,
1349
+ atom: atomOf,
1350
+ with: own => {
1351
+ given = own;
1352
+ withCallsOf()[1](undefined);
1353
+ return spreadPropsOf({
1354
+ ref: {
1355
+ value: withRef(own.ref, self),
1356
+ enumerable: true
1357
+ },
1358
+ style: styleKey,
1359
+ ...attributes
1360
+ });
1361
+ },
1362
+ lifecycle,
1363
+ settled: undefined,
1364
+ tapped: undefined,
1365
+ next: undefined,
1366
+ each: undefined,
1367
+ when: undefined
1368
+ };
1369
+ Object.setPrototypeOf(self, WARD_MEMBERS);
1370
+ Object.defineProperties(self, {
1371
+ [WARD_STATE]: {
1372
+ value: state
1373
+ },
1374
+ ref: {
1375
+ value: self,
1376
+ enumerable: true
1377
+ },
1378
+ style: styleKey,
1379
+ ...attributes
1380
+ });
1381
+ return self;
1382
+ }
1383
+ /** No `.with()` props: the config's style alone. */
1384
+ const NO_WITH = {};
1385
+ /** The last `.with()` merge, by its two styles: `style` reads it more than once a run. */
1386
+ // Module state (#460, Q7): a cache held weakly by the object it's for, so it goes with it.
1387
+ const withMerges = new WeakMap();
1388
+ /**
1389
+ * The config's `style` with a `.with()` style over it, key by key (#264, `Style.over`): the config's
1390
+ * as it is with none. One merge for the same two styles, so the element's Live values see one object.
1391
+ */
1392
+ const withStyleOver = (own, extra) => {
1393
+ if (Predicate.isUndefined(extra)) return own;
1394
+ if (Predicate.isString(extra)) return Style.over(extra, own);
1395
+ return Option.getOrElse(Option.map(Option.filter(Option.fromUndefinedOr(withMerges.get(extra)), known => known.own === own), known => known.merged), () => {
1396
+ const merged = Style.over(extra, own);
1397
+ withMerges.set(extra, {
1398
+ own,
1399
+ merged
1400
+ });
1401
+ return merged;
1402
+ });
1403
+ };
1404
+ /** A `.with()` ref beside the ward's own: the user's first, as `refsOf` orders them. */
1405
+ const withRef = (user, self) => {
1406
+ if (Predicate.isUndefined(user)) return self;
1407
+ const refs = Arr.ensure(user);
1408
+ return element => {
1409
+ Arr.forEach(refs, ref => ref(element));
1410
+ self(element);
1411
+ };
1412
+ };
1413
+ /**
1414
+ * The Starting style's attributes, and a drag element's default ones when it `drags`, as a ward's own
1415
+ * keys: enumerable, so a spread applies them. Made once a ward (#460), into one map.
1416
+ */
1417
+ const attributeKeysOf = (attrs, drags) => {
1418
+ const keys = {};
1419
+ addAttributeKeys(keys, attrs);
1420
+ if (drags) addAttributeKeys(keys, Style.DRAG_DEFAULT_ATTRIBUTES);
1421
+ return keys;
1422
+ };
1423
+ /** Each of `attrs` as an enumerable key, into `keys`: a later one wins a key both set. */
1424
+ const addAttributeKeys = (keys, attrs) => Arr.forEach(Object.keys(attrs), key => {
1425
+ keys[key] = {
1426
+ value: attrs[key],
1427
+ enumerable: true
1428
+ };
1429
+ });
1430
+ /**
1431
+ * A spread's props, reaching no name but their own (#495): what a ward, its `.with()` or a Reorder group
1432
+ * hands an element's spread, and nothing else. Solid 2's `merge` calls a function source and reads each key off
1433
+ * what it returns with `in`, so a ward that returned itself shadowed the element's props with its own
1434
+ * names (`name`, `length`, `read`, `next`…), and an object with a prototype would with
1435
+ * `Object.prototype`'s (`constructor`, `toString`).
1436
+ */
1437
+ export const spreadPropsOf = descriptors => Object.defineProperties(new SpreadProps(), descriptors);
1438
+ /**
1439
+ * What a spread's props are made from (#495): a constructor whose prototype has no prototype and no
1440
+ * names, so its objects reach none but their own. An `Object.create(null)` would too, but V8 keeps it
1441
+ * in dictionary mode: 217 bytes each in Node 24, against 49 (`.tmp/495/spreadmem.mjs`).
1442
+ */
1443
+ const SpreadProps = function SpreadProps() {};
1444
+ SpreadProps.prototype = Object.create(null);
1445
+ /** The props a Reorder item adds to its ward's spread (#495): its keyboard attributes. Only items have them. */
1446
+ // Module state (#460, Q7): a cache held weakly by the object it's for, so it goes with it.
1447
+ const SPREAD_EXTRAS = new WeakMap();
1448
+ /**
1449
+ * `ward` with `descriptors` defined on it and added to its spread (#495), for a ward that carries props
1450
+ * of its own kind (a Reorder item's keyboard attributes). Before the ward's first spread.
1451
+ */
1452
+ export const withSpreadProps = (ward, descriptors) => {
1453
+ SPREAD_EXTRAS.set(ward, descriptors);
1454
+ return Object.defineProperties(ward, descriptors);
1455
+ };
1456
+ /** A ward's spread: its `ref`, `style` and attributes, and what {@link withSpreadProps} added, on no prototype. Made at its first spread (#460: one map). */
1457
+ const spreadOfWard = (ward, ref, style, attributes) => {
1458
+ const extras = SPREAD_EXTRAS.get(ward);
1459
+ if (Predicate.isUndefined(extras)) return spreadPropsOf({
1460
+ ref,
1461
+ style,
1462
+ ...attributes
1463
+ });
1464
+ return spreadPropsOf({
1465
+ ref,
1466
+ style,
1467
+ ...attributes,
1468
+ ...extras
1469
+ });
1470
+ };
1471
+ /** A server's output Atom: nothing is written there, so it stays `undefined`. */
1472
+ const NO_OUTPUT = Atom.make(undefined);
1473
+ /** A style value read on a server: an Atom through a server's own registry, an accessor called (#130). */
1474
+ const readServerStyle = value => readLive(value, serverRegistryOf, untrack);
1475
+ /**
1476
+ * {@link wardWith} during a server render (ADR-0021, decisions 1 and 4): the element's Starting
1477
+ * style and attributes, computed purely, and nothing else: no runtime, no spine, no signals. It
1478
+ * makes the client's one `createUniqueId` call, so later hydration keys land where the client's
1479
+ * render puts them, and its `.Provider` renders the same nesting, with the same names and inert
1480
+ * orchestration. No Appear animation yet (PR 4 of #209).
1481
+ */
1482
+ const serverWard = (config, internal) => {
1483
+ createUniqueId();
1484
+ const view = configuredView(WARD_VIEW.of(config, internal.fixed), useWardicConfig());
1485
+ // A key still loading (#257 item 1): one setup fixes is the client's error here too. One the ward
1486
+ // reads as it goes is read again, throwing Solid's `NotReadyError`: a server waits for it and
1487
+ // renders the component again, so its region streams once the data is in, Appear and all.
1488
+ // Both are checked before the read that waits.
1489
+ const setup = WARD_VIEW.setupOf(view);
1490
+ // Animation controls (#433) set nothing on a server: no entry yet, and controlled, as on the client.
1491
+ const atSetup = uncontrolledOf(configAtSetup(setup));
1492
+ // Where it's made, its given parent's, or its given ward's (#349).
1493
+ const parent = variantParentOf(internal);
1494
+ const presenceBlocks = presenceBlocksInitial(usePresenceContext());
1495
+ if (Bool.and(Arr.contains(setup.pending, "animate"), startsAtAnimate(atSetup, inheritedContext(atSetup, parent), presenceBlocks))) throw new Error(STARTS_AT_PENDING);
1496
+ const c = uncontrolledOf(WARD_VIEW.snapshotOf(view));
1497
+ const node = serverVariantNode(c, parent);
1498
+ const initialValues = startOf(c, node.inherited, presenceBlocks, untrack).initialValues;
1499
+ const layoutNode = isLayoutNode(c);
1500
+ const seed = Style.starting(internal.tag, drawnAtRest(initialValues, layoutNode, c.transformTemplate));
1501
+ // Its Appear animation (#48, ADR-0044): its slot in the render's, and the group its Variant
1502
+ // children join when it leads one.
1503
+ const appear = appearEntryOf(useWardicAppear(), c, internal.tag, initialValues, node, startsQuiet(c, node.inherited, presenceBlocks, untrack), settingOf(useWardicConfig()), useWardicSkipAnimations()());
1504
+ // A late chunk's root (#245): the chunk's Appear rules go through the head registry, read once
1505
+ // the chunk has rendered and streamed with it as a head patch. A late element under another late
1506
+ // one registers too: the first read writes the batch, and any other finds it written and adds no
1507
+ // tag, so Solid 1's `within` (which kept a chunk to one `<style>` node) isn't needed.
1508
+ if (appear.chunkRoot) UndefinedOr.map(appear.state, state => useHead(appearStyle(state.chunkCss, state.nonce)));
1509
+ const Provider = props => _$createComponent(WardicVariantContext, {
1510
+ get value() {
1511
+ return contextOf(appear.provided);
1512
+ },
1513
+ get children() {
1514
+ return props.children;
1515
+ }
1516
+ });
1517
+ // Its routed keys' values join the Starting style, under `initial`'s (#130); a `<Reorder>` item's
1518
+ // base style, a drag element's defaults, then its Appear slot go under the user's style. A user
1519
+ // style with its own `animation` keeps it, over the slot, and the slot is left undefined.
1520
+ const dragDefaults = dragDefaultsOf(c, internal);
1521
+ // The element's style for its user style: the config's, or a `.with()` style over it (#264).
1522
+ const styleFor = user => {
1523
+ const parts = split(user);
1524
+ if (setsAnimation(parts.css)) appear.veto("its own style sets an animation");
1525
+ return pipe(serverStartingStyle(internal.tag, seed.style, initialValues, parts.routed, layoutNode, untrack, c.transformTemplate), Style.over(parts.css), Style.over(UndefinedOr.match(internal.baseStyle, {
1526
+ onUndefined: constUndefined,
1527
+ onDefined: base => base()
1528
+ })), Style.over(dragDefaults), Style.over(appear.style));
1529
+ };
1530
+ const style = styleFor(c.style);
1531
+ let given = NO_WITH;
1532
+ const attributes = attributeKeysOf(seed.attrs, Predicate.isNotUndefined(dragDefaults));
1533
+ // A spread of it reads its spread's props alone, made at its first spread, as the client's (#495).
1534
+ let spread;
1535
+ const self = () => {
1536
+ if (Predicate.isUndefined(spread)) spread = spreadOfWard(self, {
1537
+ value: noRef,
1538
+ enumerable: true
1539
+ }, {
1540
+ value: style,
1541
+ enumerable: true
1542
+ }, attributes);
1543
+ return spread;
1544
+ };
1545
+ // What it shares with a component it's given to (#349): a server's component renders its own.
1546
+ const shared = {
1547
+ config,
1548
+ setup: atSetup,
1549
+ internal,
1550
+ parent,
1551
+ chosen: Predicate.isNotUndefined(internal.parent),
1552
+ carries: carriesVariants(atSetup),
1553
+ provided: appear.provided,
1554
+ layoutGroup: useLayoutGroupId(),
1555
+ node: undefined,
1556
+ lifecycle: undefined,
1557
+ drive: () => constVoid
1558
+ };
1559
+ Object.defineProperties(self, {
1560
+ [WARD]: {
1561
+ value: shared
1562
+ },
1563
+ ref: {
1564
+ value: noRef,
1565
+ enumerable: true
1566
+ },
1567
+ style: {
1568
+ value: style,
1569
+ enumerable: true
1570
+ },
1571
+ ...attributes,
1572
+ Provider: {
1573
+ value: Provider
1574
+ },
1575
+ read: {
1576
+ value: key => () => restingOf(key, initialValues, withStyleOver(c.style, given.style), readServerStyle)
1577
+ },
1578
+ atom: {
1579
+ value: () => NO_OUTPUT
1580
+ },
1581
+ // Nothing animates on a server: nothing has landed, and nothing will.
1582
+ settled: {
1583
+ value: constUndefined
1584
+ },
1585
+ // Nothing is pressed on a server either.
1586
+ tapped: {
1587
+ value: constUndefined
1588
+ },
1589
+ next: {
1590
+ value: neverLands
1591
+ },
1592
+ each: {
1593
+ value: () => NO_EVENTS
1594
+ },
1595
+ when: {
1596
+ value: serverWhen
1597
+ },
1598
+ // The element's own style over the config's, rendered in its Starting style (#264).
1599
+ with: {
1600
+ value: own => {
1601
+ given = own;
1602
+ return spreadPropsOf({
1603
+ ref: {
1604
+ value: noRef,
1605
+ enumerable: true
1606
+ },
1607
+ style: {
1608
+ value: styleFor(withStyleOver(c.style, own.style)),
1609
+ enumerable: true
1610
+ },
1611
+ ...attributes
1612
+ });
1613
+ }
1614
+ }
1615
+ });
1616
+ return self;
1617
+ };
1618
+ /** A server render's `ref`: Solid never calls it there. */
1619
+ const noRef = constUndefined;
1620
+ //# sourceMappingURL=ward.js.map