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

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