@wardic/solid 2.2.0 → 3.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (475) hide show
  1. package/README.md +22 -18
  2. package/dist/browser/config-view.js +33 -5
  3. package/dist/browser/config-view.js.map +1 -1
  4. package/dist/browser/create-batch.js +1 -1
  5. package/dist/browser/element-style.js +61 -7
  6. package/dist/browser/element-style.js.map +1 -1
  7. package/dist/browser/element.js +19 -2
  8. package/dist/browser/element.js.map +1 -1
  9. package/dist/browser/feature-section.js +5 -13
  10. package/dist/browser/feature-section.js.map +1 -1
  11. package/dist/browser/hooks/auto.js +270 -0
  12. package/dist/browser/hooks/auto.js.map +1 -0
  13. package/dist/browser/hooks/config-scope.js +120 -0
  14. package/dist/browser/hooks/config-scope.js.map +1 -0
  15. package/dist/browser/hooks/config.js +37 -0
  16. package/dist/browser/hooks/config.js.map +1 -0
  17. package/dist/browser/hooks/drag.js +632 -0
  18. package/dist/browser/hooks/drag.js.map +1 -0
  19. package/dist/browser/hooks/elements.js +183 -0
  20. package/dist/browser/hooks/elements.js.map +1 -0
  21. package/dist/browser/hooks/group.js +28 -0
  22. package/dist/browser/hooks/group.js.map +1 -0
  23. package/dist/browser/hooks/index.js +10 -0
  24. package/dist/browser/hooks/index.js.map +1 -0
  25. package/dist/browser/hooks/kept.js +32 -0
  26. package/dist/browser/hooks/kept.js.map +1 -0
  27. package/dist/browser/hooks/layout-group-of.js +39 -0
  28. package/dist/browser/hooks/layout-group-of.js.map +1 -0
  29. package/dist/browser/hooks/layout-group.js +92 -0
  30. package/dist/browser/hooks/layout-group.js.map +1 -0
  31. package/dist/browser/hooks/make-ward.js +157 -0
  32. package/dist/browser/hooks/make-ward.js.map +1 -0
  33. package/dist/browser/hooks/presence-scope.js +87 -0
  34. package/dist/browser/hooks/presence-scope.js.map +1 -0
  35. package/dist/browser/hooks/presence.js +24 -0
  36. package/dist/browser/hooks/presence.js.map +1 -0
  37. package/dist/browser/hooks/props.js +148 -0
  38. package/dist/browser/hooks/props.js.map +1 -0
  39. package/dist/browser/hooks/reads.js +241 -0
  40. package/dist/browser/hooks/reads.js.map +1 -0
  41. package/dist/browser/hooks/refs.js +87 -0
  42. package/dist/browser/hooks/refs.js.map +1 -0
  43. package/dist/browser/hooks/reorder-elements.js +268 -0
  44. package/dist/browser/hooks/reorder-elements.js.map +1 -0
  45. package/dist/browser/hooks/reorder.js +176 -0
  46. package/dist/browser/hooks/reorder.js.map +1 -0
  47. package/dist/browser/hooks/rune.js +799 -0
  48. package/dist/browser/hooks/rune.js.map +1 -0
  49. package/dist/browser/hooks/server-features.client.js +2 -0
  50. package/dist/browser/hooks/server-features.client.js.map +1 -0
  51. package/dist/browser/hooks/server-features.js +13 -0
  52. package/dist/browser/hooks/server-features.js.map +1 -0
  53. package/dist/browser/hooks/settings.js +29 -0
  54. package/dist/browser/hooks/settings.js.map +1 -0
  55. package/dist/browser/hooks/setup.js +154 -0
  56. package/dist/browser/hooks/setup.js.map +1 -0
  57. package/dist/browser/hooks/stage.js +117 -0
  58. package/dist/browser/hooks/stage.js.map +1 -0
  59. package/dist/browser/hooks/ward.js +2193 -0
  60. package/dist/browser/hooks/ward.js.map +1 -0
  61. package/dist/browser/hooks/wardic-provider.js +29 -0
  62. package/dist/browser/hooks/wardic-provider.js.map +1 -0
  63. package/dist/browser/hooks/wardic-scope.js +68 -0
  64. package/dist/browser/hooks/wardic-scope.js.map +1 -0
  65. package/dist/browser/hooks/wards.js +562 -0
  66. package/dist/browser/hooks/wards.js.map +1 -0
  67. package/dist/browser/index.js +23 -11
  68. package/dist/browser/index.js.map +1 -1
  69. package/dist/browser/layout.js +7 -58
  70. package/dist/browser/layout.js.map +1 -1
  71. package/dist/browser/lazy-batch-gestures.js +1 -1
  72. package/dist/browser/lifecycle.js +37 -0
  73. package/dist/browser/lifecycle.js.map +1 -1
  74. package/dist/browser/presence-handle.js +28 -12
  75. package/dist/browser/presence-handle.js.map +1 -1
  76. package/dist/browser/presence.js +3 -1
  77. package/dist/browser/presence.js.map +1 -1
  78. package/dist/browser/provider.js +85 -70
  79. package/dist/browser/provider.js.map +1 -1
  80. package/dist/browser/reorder-components.js +50 -0
  81. package/dist/browser/reorder-components.js.map +1 -0
  82. package/dist/browser/reorder.js +46 -274
  83. package/dist/browser/reorder.js.map +1 -1
  84. package/dist/browser/stage.js.map +1 -1
  85. package/dist/browser/unstable/v2/index.js +0 -8
  86. package/dist/browser/unstable/v2/index.js.map +1 -1
  87. package/dist/browser/v1/index.js +1 -1
  88. package/dist/browser/v1/index.js.map +1 -1
  89. package/dist/browser/variant-node.js +4 -2
  90. package/dist/browser/variant-node.js.map +1 -1
  91. package/dist/browser/w.js +33 -3
  92. package/dist/browser/w.js.map +1 -1
  93. package/dist/browser/ward.js +576 -49
  94. package/dist/browser/ward.js.map +1 -1
  95. package/dist/browser/wardic-config.js +62 -29
  96. package/dist/browser/wardic-config.js.map +1 -1
  97. package/dist/browser/wardic-context.js +23 -0
  98. package/dist/browser/wardic-context.js.map +1 -0
  99. package/dist/browser/wardic.js +3 -0
  100. package/dist/browser/wardic.js.map +1 -1
  101. package/dist/server/config-view.js +33 -5
  102. package/dist/server/config-view.js.map +1 -1
  103. package/dist/server/create-batch.js +1 -1
  104. package/dist/server/element-style.js +61 -7
  105. package/dist/server/element-style.js.map +1 -1
  106. package/dist/server/element.js +19 -2
  107. package/dist/server/element.js.map +1 -1
  108. package/dist/server/feature-section.js +5 -13
  109. package/dist/server/feature-section.js.map +1 -1
  110. package/dist/server/hooks/auto.js +270 -0
  111. package/dist/server/hooks/auto.js.map +1 -0
  112. package/dist/server/hooks/config-scope.js +120 -0
  113. package/dist/server/hooks/config-scope.js.map +1 -0
  114. package/dist/server/hooks/config.js +37 -0
  115. package/dist/server/hooks/config.js.map +1 -0
  116. package/dist/server/hooks/drag.js +632 -0
  117. package/dist/server/hooks/drag.js.map +1 -0
  118. package/dist/server/hooks/elements.js +192 -0
  119. package/dist/server/hooks/elements.js.map +1 -0
  120. package/dist/server/hooks/group.js +28 -0
  121. package/dist/server/hooks/group.js.map +1 -0
  122. package/dist/server/hooks/index.js +10 -0
  123. package/dist/server/hooks/index.js.map +1 -0
  124. package/dist/server/hooks/kept.js +32 -0
  125. package/dist/server/hooks/kept.js.map +1 -0
  126. package/dist/server/hooks/layout-group-of.js +39 -0
  127. package/dist/server/hooks/layout-group-of.js.map +1 -0
  128. package/dist/server/hooks/layout-group.js +109 -0
  129. package/dist/server/hooks/layout-group.js.map +1 -0
  130. package/dist/server/hooks/make-ward.js +157 -0
  131. package/dist/server/hooks/make-ward.js.map +1 -0
  132. package/dist/server/hooks/presence-scope.js +86 -0
  133. package/dist/server/hooks/presence-scope.js.map +1 -0
  134. package/dist/server/hooks/presence.js +24 -0
  135. package/dist/server/hooks/presence.js.map +1 -0
  136. package/dist/server/hooks/props.js +148 -0
  137. package/dist/server/hooks/props.js.map +1 -0
  138. package/dist/server/hooks/reads.js +241 -0
  139. package/dist/server/hooks/reads.js.map +1 -0
  140. package/dist/server/hooks/refs.js +87 -0
  141. package/dist/server/hooks/refs.js.map +1 -0
  142. package/dist/server/hooks/reorder-elements.js +308 -0
  143. package/dist/server/hooks/reorder-elements.js.map +1 -0
  144. package/dist/server/hooks/reorder.js +176 -0
  145. package/dist/server/hooks/reorder.js.map +1 -0
  146. package/dist/server/hooks/rune.js +799 -0
  147. package/dist/server/hooks/rune.js.map +1 -0
  148. package/dist/server/hooks/server-features.client.js +2 -0
  149. package/dist/server/hooks/server-features.client.js.map +1 -0
  150. package/dist/server/hooks/server-features.js +13 -0
  151. package/dist/server/hooks/server-features.js.map +1 -0
  152. package/dist/server/hooks/settings.js +29 -0
  153. package/dist/server/hooks/settings.js.map +1 -0
  154. package/dist/server/hooks/setup.js +154 -0
  155. package/dist/server/hooks/setup.js.map +1 -0
  156. package/dist/server/hooks/stage.js +117 -0
  157. package/dist/server/hooks/stage.js.map +1 -0
  158. package/dist/server/hooks/ward.js +2193 -0
  159. package/dist/server/hooks/ward.js.map +1 -0
  160. package/dist/server/hooks/wardic-provider.js +29 -0
  161. package/dist/server/hooks/wardic-provider.js.map +1 -0
  162. package/dist/server/hooks/wardic-scope.js +68 -0
  163. package/dist/server/hooks/wardic-scope.js.map +1 -0
  164. package/dist/server/hooks/wards.js +562 -0
  165. package/dist/server/hooks/wards.js.map +1 -0
  166. package/dist/server/index.js +23 -11
  167. package/dist/server/index.js.map +1 -1
  168. package/dist/server/layout.js +7 -75
  169. package/dist/server/layout.js.map +1 -1
  170. package/dist/server/lazy-batch-gestures.js +1 -1
  171. package/dist/server/lifecycle.js +37 -0
  172. package/dist/server/lifecycle.js.map +1 -1
  173. package/dist/server/presence-handle.js +28 -12
  174. package/dist/server/presence-handle.js.map +1 -1
  175. package/dist/server/presence.js +3 -1
  176. package/dist/server/presence.js.map +1 -1
  177. package/dist/server/provider.js +86 -80
  178. package/dist/server/provider.js.map +1 -1
  179. package/dist/server/reorder-components.js +50 -0
  180. package/dist/server/reorder-components.js.map +1 -0
  181. package/dist/server/reorder.js +46 -344
  182. package/dist/server/reorder.js.map +1 -1
  183. package/dist/server/stage.js.map +1 -1
  184. package/dist/server/unstable/v2/index.js +0 -8
  185. package/dist/server/unstable/v2/index.js.map +1 -1
  186. package/dist/server/v1/index.js +1 -1
  187. package/dist/server/v1/index.js.map +1 -1
  188. package/dist/server/variant-node.js +4 -2
  189. package/dist/server/variant-node.js.map +1 -1
  190. package/dist/server/w.js +33 -3
  191. package/dist/server/w.js.map +1 -1
  192. package/dist/server/ward.js +576 -49
  193. package/dist/server/ward.js.map +1 -1
  194. package/dist/server/wardic-config.js +63 -30
  195. package/dist/server/wardic-config.js.map +1 -1
  196. package/dist/server/wardic-context.js +23 -0
  197. package/dist/server/wardic-context.js.map +1 -0
  198. package/dist/server/wardic.js +3 -0
  199. package/dist/server/wardic.js.map +1 -1
  200. package/dist/solid/batch-reorder-group.d.ts +1 -1
  201. package/dist/solid/batch-reorder.d.ts +1 -1
  202. package/dist/solid/batch-reorder.d.ts.map +1 -1
  203. package/dist/solid/config-view.d.ts +11 -0
  204. package/dist/solid/config-view.d.ts.map +1 -1
  205. package/dist/solid/config-view.js +29 -6
  206. package/dist/solid/config-view.js.map +1 -1
  207. package/dist/solid/create-batch.jsx +1 -1
  208. package/dist/solid/element-style.d.ts +16 -2
  209. package/dist/solid/element-style.d.ts.map +1 -1
  210. package/dist/solid/element-style.js +61 -7
  211. package/dist/solid/element-style.js.map +1 -1
  212. package/dist/solid/element.d.ts +3 -1
  213. package/dist/solid/element.d.ts.map +1 -1
  214. package/dist/solid/element.jsx +21 -2
  215. package/dist/solid/element.jsx.map +1 -1
  216. package/dist/solid/feature-section.d.ts +0 -7
  217. package/dist/solid/feature-section.d.ts.map +1 -1
  218. package/dist/solid/feature-section.js +5 -13
  219. package/dist/solid/feature-section.js.map +1 -1
  220. package/dist/solid/hooks/auto.d.ts +44 -0
  221. package/dist/solid/hooks/auto.d.ts.map +1 -0
  222. package/dist/solid/hooks/auto.js +269 -0
  223. package/dist/solid/hooks/auto.js.map +1 -0
  224. package/dist/solid/hooks/config-scope.d.ts +84 -0
  225. package/dist/solid/hooks/config-scope.d.ts.map +1 -0
  226. package/dist/solid/hooks/config-scope.jsx +128 -0
  227. package/dist/solid/hooks/config-scope.jsx.map +1 -0
  228. package/dist/solid/hooks/config.d.ts +28 -0
  229. package/dist/solid/hooks/config.d.ts.map +1 -0
  230. package/dist/solid/hooks/config.jsx +37 -0
  231. package/dist/solid/hooks/config.jsx.map +1 -0
  232. package/dist/solid/hooks/drag.d.ts +220 -0
  233. package/dist/solid/hooks/drag.d.ts.map +1 -0
  234. package/dist/solid/hooks/drag.js +585 -0
  235. package/dist/solid/hooks/drag.js.map +1 -0
  236. package/dist/solid/hooks/elements.d.ts +11 -0
  237. package/dist/solid/hooks/elements.d.ts.map +1 -0
  238. package/dist/solid/hooks/elements.jsx +218 -0
  239. package/dist/solid/hooks/elements.jsx.map +1 -0
  240. package/dist/solid/hooks/group.d.ts +46 -0
  241. package/dist/solid/hooks/group.d.ts.map +1 -0
  242. package/dist/solid/hooks/group.jsx +25 -0
  243. package/dist/solid/hooks/group.jsx.map +1 -0
  244. package/dist/solid/hooks/index.d.ts +28 -0
  245. package/dist/solid/hooks/index.d.ts.map +1 -0
  246. package/dist/solid/hooks/index.js +10 -0
  247. package/dist/solid/hooks/index.js.map +1 -0
  248. package/dist/solid/hooks/kept.d.ts +60 -0
  249. package/dist/solid/hooks/kept.d.ts.map +1 -0
  250. package/dist/solid/hooks/kept.js +33 -0
  251. package/dist/solid/hooks/kept.js.map +1 -0
  252. package/dist/solid/hooks/layout-group-of.d.ts +27 -0
  253. package/dist/solid/hooks/layout-group-of.d.ts.map +1 -0
  254. package/dist/solid/hooks/layout-group-of.js +39 -0
  255. package/dist/solid/hooks/layout-group-of.js.map +1 -0
  256. package/dist/solid/hooks/layout-group.d.ts +60 -0
  257. package/dist/solid/hooks/layout-group.d.ts.map +1 -0
  258. package/dist/solid/hooks/layout-group.jsx +80 -0
  259. package/dist/solid/hooks/layout-group.jsx.map +1 -0
  260. package/dist/solid/hooks/make-ward.d.ts +123 -0
  261. package/dist/solid/hooks/make-ward.d.ts.map +1 -0
  262. package/dist/solid/hooks/make-ward.js +147 -0
  263. package/dist/solid/hooks/make-ward.js.map +1 -0
  264. package/dist/solid/hooks/presence-scope.d.ts +84 -0
  265. package/dist/solid/hooks/presence-scope.d.ts.map +1 -0
  266. package/dist/solid/hooks/presence-scope.jsx +62 -0
  267. package/dist/solid/hooks/presence-scope.jsx.map +1 -0
  268. package/dist/solid/hooks/presence.d.ts +51 -0
  269. package/dist/solid/hooks/presence.d.ts.map +1 -0
  270. package/dist/solid/hooks/presence.jsx +26 -0
  271. package/dist/solid/hooks/presence.jsx.map +1 -0
  272. package/dist/solid/hooks/props.d.ts +52 -0
  273. package/dist/solid/hooks/props.d.ts.map +1 -0
  274. package/dist/solid/hooks/props.js +140 -0
  275. package/dist/solid/hooks/props.js.map +1 -0
  276. package/dist/solid/hooks/reads.d.ts +38 -0
  277. package/dist/solid/hooks/reads.d.ts.map +1 -0
  278. package/dist/solid/hooks/reads.js +218 -0
  279. package/dist/solid/hooks/reads.js.map +1 -0
  280. package/dist/solid/hooks/refs.d.ts +25 -0
  281. package/dist/solid/hooks/refs.d.ts.map +1 -0
  282. package/dist/solid/hooks/refs.js +89 -0
  283. package/dist/solid/hooks/refs.js.map +1 -0
  284. package/dist/solid/hooks/reorder-elements.d.ts +23 -0
  285. package/dist/solid/hooks/reorder-elements.d.ts.map +1 -0
  286. package/dist/solid/hooks/reorder-elements.jsx +273 -0
  287. package/dist/solid/hooks/reorder-elements.jsx.map +1 -0
  288. package/dist/solid/hooks/reorder.d.ts +55 -0
  289. package/dist/solid/hooks/reorder.d.ts.map +1 -0
  290. package/dist/solid/hooks/reorder.js +152 -0
  291. package/dist/solid/hooks/reorder.js.map +1 -0
  292. package/dist/solid/hooks/rune.d.ts +885 -0
  293. package/dist/solid/hooks/rune.d.ts.map +1 -0
  294. package/dist/solid/hooks/rune.js +816 -0
  295. package/dist/solid/hooks/rune.js.map +1 -0
  296. package/dist/solid/hooks/server-features.client.d.ts +10 -0
  297. package/dist/solid/hooks/server-features.client.d.ts.map +1 -0
  298. package/dist/solid/hooks/server-features.client.js +2 -0
  299. package/dist/solid/hooks/server-features.client.js.map +1 -0
  300. package/dist/solid/hooks/server-features.d.ts +10 -0
  301. package/dist/solid/hooks/server-features.d.ts.map +1 -0
  302. package/dist/solid/hooks/server-features.js +13 -0
  303. package/dist/solid/hooks/server-features.js.map +1 -0
  304. package/dist/solid/hooks/settings.d.ts +11 -0
  305. package/dist/solid/hooks/settings.d.ts.map +1 -0
  306. package/dist/solid/hooks/settings.js +31 -0
  307. package/dist/solid/hooks/settings.js.map +1 -0
  308. package/dist/solid/hooks/setup.d.ts +31 -0
  309. package/dist/solid/hooks/setup.d.ts.map +1 -0
  310. package/dist/solid/hooks/setup.js +155 -0
  311. package/dist/solid/hooks/setup.js.map +1 -0
  312. package/dist/solid/hooks/stage.d.ts +187 -0
  313. package/dist/solid/hooks/stage.d.ts.map +1 -0
  314. package/dist/solid/hooks/stage.js +117 -0
  315. package/dist/solid/hooks/stage.js.map +1 -0
  316. package/dist/solid/hooks/ward.d.ts +394 -0
  317. package/dist/solid/hooks/ward.d.ts.map +1 -0
  318. package/dist/solid/hooks/ward.js +2237 -0
  319. package/dist/solid/hooks/ward.js.map +1 -0
  320. package/dist/solid/hooks/wardic-provider.d.ts +32 -0
  321. package/dist/solid/hooks/wardic-provider.d.ts.map +1 -0
  322. package/dist/solid/hooks/wardic-provider.jsx +29 -0
  323. package/dist/solid/hooks/wardic-provider.jsx.map +1 -0
  324. package/dist/solid/hooks/wardic-scope.d.ts +49 -0
  325. package/dist/solid/hooks/wardic-scope.d.ts.map +1 -0
  326. package/dist/solid/hooks/wardic-scope.jsx +63 -0
  327. package/dist/solid/hooks/wardic-scope.jsx.map +1 -0
  328. package/dist/solid/hooks/wards.d.ts +157 -0
  329. package/dist/solid/hooks/wards.d.ts.map +1 -0
  330. package/dist/solid/hooks/wards.js +522 -0
  331. package/dist/solid/hooks/wards.js.map +1 -0
  332. package/dist/solid/index.d.ts +21 -14
  333. package/dist/solid/index.d.ts.map +1 -1
  334. package/dist/solid/index.jsx +23 -11
  335. package/dist/solid/index.jsx.map +1 -1
  336. package/dist/solid/layout.d.ts +2 -44
  337. package/dist/solid/layout.d.ts.map +1 -1
  338. package/dist/solid/layout.jsx +7 -49
  339. package/dist/solid/layout.jsx.map +1 -1
  340. package/dist/solid/lazy-batch-gestures.js +1 -1
  341. package/dist/solid/lazy-batch-gestures.js.map +1 -1
  342. package/dist/solid/lifecycle.d.ts +19 -0
  343. package/dist/solid/lifecycle.d.ts.map +1 -1
  344. package/dist/solid/lifecycle.js +40 -0
  345. package/dist/solid/lifecycle.js.map +1 -1
  346. package/dist/solid/presence-handle.d.ts +13 -6
  347. package/dist/solid/presence-handle.d.ts.map +1 -1
  348. package/dist/solid/presence-handle.js +30 -12
  349. package/dist/solid/presence-handle.js.map +1 -1
  350. package/dist/solid/presence.d.ts +3 -1
  351. package/dist/solid/presence.d.ts.map +1 -1
  352. package/dist/solid/presence.jsx +3 -1
  353. package/dist/solid/presence.jsx.map +1 -1
  354. package/dist/solid/provider.d.ts +25 -32
  355. package/dist/solid/provider.d.ts.map +1 -1
  356. package/dist/solid/provider.jsx +86 -62
  357. package/dist/solid/provider.jsx.map +1 -1
  358. package/dist/solid/reorder-components.d.ts +32 -0
  359. package/dist/solid/reorder-components.d.ts.map +1 -0
  360. package/dist/solid/reorder-components.jsx +49 -0
  361. package/dist/solid/reorder-components.jsx.map +1 -0
  362. package/dist/solid/reorder.d.ts +50 -76
  363. package/dist/solid/reorder.d.ts.map +1 -1
  364. package/dist/solid/reorder.jsx +40 -202
  365. package/dist/solid/reorder.jsx.map +1 -1
  366. package/dist/solid/stage.d.ts +14 -0
  367. package/dist/solid/stage.d.ts.map +1 -1
  368. package/dist/solid/stage.js.map +1 -1
  369. package/dist/solid/unstable/v2/index.d.ts +2 -26
  370. package/dist/solid/unstable/v2/index.d.ts.map +1 -1
  371. package/dist/solid/unstable/v2/index.jsx +0 -16
  372. package/dist/solid/unstable/v2/index.jsx.map +1 -1
  373. package/dist/solid/v1/index.d.ts +1 -1
  374. package/dist/solid/v1/index.d.ts.map +1 -1
  375. package/dist/solid/v1/index.jsx +1 -1
  376. package/dist/solid/v1/index.jsx.map +1 -1
  377. package/dist/solid/variant-node.d.ts +6 -0
  378. package/dist/solid/variant-node.d.ts.map +1 -1
  379. package/dist/solid/variant-node.js +2 -0
  380. package/dist/solid/variant-node.js.map +1 -1
  381. package/dist/solid/w.d.ts +9 -3
  382. package/dist/solid/w.d.ts.map +1 -1
  383. package/dist/solid/w.jsx +36 -3
  384. package/dist/solid/w.jsx.map +1 -1
  385. package/dist/solid/ward.d.ts +134 -7
  386. package/dist/solid/ward.d.ts.map +1 -1
  387. package/dist/solid/ward.jsx +546 -48
  388. package/dist/solid/ward.jsx.map +1 -1
  389. package/dist/solid/wardic-config.d.ts +17 -12
  390. package/dist/solid/wardic-config.d.ts.map +1 -1
  391. package/dist/solid/wardic-config.jsx +68 -22
  392. package/dist/solid/wardic-config.jsx.map +1 -1
  393. package/dist/solid/wardic-context.d.ts +15 -0
  394. package/dist/solid/wardic-context.d.ts.map +1 -0
  395. package/dist/solid/wardic-context.js +23 -0
  396. package/dist/solid/wardic-context.js.map +1 -0
  397. package/dist/solid/wardic-instance.d.ts +6 -4
  398. package/dist/solid/wardic-instance.d.ts.map +1 -1
  399. package/dist/solid/wardic.d.ts +3 -0
  400. package/dist/solid/wardic.d.ts.map +1 -1
  401. package/dist/solid/wardic.jsx +3 -0
  402. package/dist/solid/wardic.jsx.map +1 -1
  403. package/package.json +26 -6
  404. package/src/batch-reorder-group.tsx +1 -1
  405. package/src/batch-reorder.ts +1 -1
  406. package/src/config-view.ts +30 -6
  407. package/src/create-batch.tsx +1 -1
  408. package/src/element-style.ts +77 -9
  409. package/src/element.tsx +25 -4
  410. package/src/feature-section.ts +5 -15
  411. package/src/hooks/auto.ts +303 -0
  412. package/src/hooks/config-scope.tsx +215 -0
  413. package/src/hooks/config.tsx +54 -0
  414. package/src/hooks/drag.ts +740 -0
  415. package/src/hooks/elements.tsx +234 -0
  416. package/src/hooks/group.tsx +55 -0
  417. package/src/hooks/index.ts +41 -0
  418. package/src/hooks/kept.ts +89 -0
  419. package/src/hooks/layout-group-of.ts +46 -0
  420. package/src/hooks/layout-group.tsx +111 -0
  421. package/src/hooks/make-ward.ts +218 -0
  422. package/src/hooks/presence-scope.tsx +155 -0
  423. package/src/hooks/presence.tsx +67 -0
  424. package/src/hooks/props.ts +190 -0
  425. package/src/hooks/reads.ts +258 -0
  426. package/src/hooks/refs.ts +114 -0
  427. package/src/hooks/reorder-elements.tsx +321 -0
  428. package/src/hooks/reorder.ts +205 -0
  429. package/src/hooks/rune.ts +1755 -0
  430. package/src/hooks/server-features.client.ts +10 -0
  431. package/src/hooks/server-features.ts +12 -0
  432. package/src/hooks/settings.ts +44 -0
  433. package/src/hooks/setup.ts +184 -0
  434. package/src/hooks/stage.ts +359 -0
  435. package/src/hooks/ward.ts +2563 -0
  436. package/src/hooks/wardic-provider.tsx +51 -0
  437. package/src/hooks/wardic-scope.tsx +112 -0
  438. package/src/hooks/wards.ts +679 -0
  439. package/src/index.tsx +27 -15
  440. package/src/layout.tsx +7 -74
  441. package/src/lazy-batch-gestures.ts +1 -1
  442. package/src/lifecycle.ts +40 -0
  443. package/src/presence-handle.ts +39 -20
  444. package/src/presence.tsx +3 -1
  445. package/src/provider.tsx +96 -71
  446. package/src/reorder-components.tsx +61 -0
  447. package/src/reorder.tsx +84 -303
  448. package/src/stage.ts +15 -0
  449. package/src/unstable/v2/index.tsx +2 -26
  450. package/src/v1/index.tsx +1 -1
  451. package/src/variant-node.ts +8 -0
  452. package/src/w.tsx +38 -5
  453. package/src/ward.tsx +674 -48
  454. package/src/wardic-config.tsx +68 -21
  455. package/src/wardic-context.ts +26 -0
  456. package/src/wardic-instance.ts +6 -4
  457. package/src/wardic.tsx +3 -0
  458. package/dist/browser/create-wardic.js +0 -36
  459. package/dist/browser/create-wardic.js.map +0 -1
  460. package/dist/browser/presence-hooks.js +0 -144
  461. package/dist/browser/presence-hooks.js.map +0 -1
  462. package/dist/server/create-wardic.js +0 -36
  463. package/dist/server/create-wardic.js.map +0 -1
  464. package/dist/server/presence-hooks.js +0 -144
  465. package/dist/server/presence-hooks.js.map +0 -1
  466. package/dist/solid/create-wardic.d.ts +0 -25
  467. package/dist/solid/create-wardic.d.ts.map +0 -1
  468. package/dist/solid/create-wardic.jsx +0 -34
  469. package/dist/solid/create-wardic.jsx.map +0 -1
  470. package/dist/solid/presence-hooks.d.ts +0 -53
  471. package/dist/solid/presence-hooks.d.ts.map +0 -1
  472. package/dist/solid/presence-hooks.jsx +0 -117
  473. package/dist/solid/presence-hooks.jsx.map +0 -1
  474. package/src/create-wardic.tsx +0 -46
  475. package/src/presence-hooks.tsx +0 -159
package/src/reorder.tsx CHANGED
@@ -49,11 +49,12 @@ import { constUndefined, identity, pipe } from "effect/Function"
49
49
  import * as Match from "effect/Match"
50
50
  import * as Option from "effect/Option"
51
51
  import * as Predicate from "effect/Predicate"
52
+ import * as Rec from "effect/Record"
52
53
  import * as Scope from "effect/Scope"
53
54
  import * as UndefinedOr from "effect/UndefinedOr"
54
55
  import { isServer, type JSX } from "@solidjs/web"
55
- import { $PROXY, type Accessor, type Component, createContext, createEffect, createMemo, createSignal, flush, omit, onCleanup, untrack, useContext } from "solid-js"
56
- import { MOTION_PROPS_V2 as MOTION_PROPS, type WardicMotionPropsV2 as WardicMotionProps } from "./motion-props.ts"
56
+ import { $PROXY, type Accessor, createEffect, createMemo, createSignal, flush, onCleanup, untrack } from "solid-js"
57
+ import type { WardicMotionPropsV2 as WardicMotionProps } from "./motion-props.ts"
57
58
  import type * as Feature from "@wardic/dom/unstable/Feature"
58
59
  import * as Drag from "@wardic/dom/unstable/features/Drag"
59
60
  import * as Focus from "@wardic/dom/unstable/features/Focus"
@@ -66,16 +67,13 @@ import * as GestureFeatures from "@wardic/dom/unstable/GestureFeatures"
66
67
  import * as OwnerScope from "@wardic/dom/unstable/OwnerScope"
67
68
  import { watchItemInput } from "@wardic/dom/unstable/ReorderInput"
68
69
  import { plainOrder } from "./reorder-values.ts"
69
- import * as VariantTree from "@wardic/core/unstable/VariantTree"
70
70
  import { configView, type PerKey } from "./config-view.ts"
71
71
  import { useBrought, useWardicRuntime } from "./provider.tsx"
72
72
  import { useLayoutServices } from "./layout-projection.tsx"
73
- import { type AnyWard, spreadPropsOf, type Ward, withSpreadProps, type WardConfig, type WardConfigValues, wardConfigView, type WardOptions, type WardShare, type WardStyle, wardWith } from "./ward.tsx"
74
- import { drivenWard, type GivenWard, givenOf, handOver, listOf, refsOf, sets, setKeysOf, staticElementOf, type WardicBeside, type WardicMotion, type WardRefCallback, type WardSetKey } from "./element.tsx"
75
- import { w } from "./w.tsx"
73
+ import { type AnyWard, spreadPropsOf, type Ward, withSpreadProps, type WardConfig, type WardInternals, type WardOptions, type WardStyle, wardWith } from "./ward.tsx"
74
+ import type { WardicMotion, WardRefCallback } from "./element.tsx"
76
75
  import { CLIENT_ONLY, CLIENT_ONLY_DEFERRED } from "./solid-reactivity.ts"
77
76
  import { eachOf, neverLands, NO_EVENTS, serverWhen, Waiters, whenOf } from "./waiters.ts"
78
- import { BatchGroup, BatchItem } from "./batch-reorder-group.tsx"
79
77
 
80
78
  export type { ReorderBatchColumnSize, ReorderBatchGap, ReorderBatchGroup, ReorderBatchGroupProps, ReorderBatchItemProps, ReorderBatchItemSize, ReorderBatchSizing } from "./batch-reorder-group.tsx"
81
79
 
@@ -85,6 +83,13 @@ export interface ReorderGroupConfigValues<V> {
85
83
  readonly values: ReadonlyArray<V>
86
84
  /** Given each new order, as an item crosses another: set `values` from it. */
87
85
  readonly onReorder: (values: Array<V>) => void
86
+ /**
87
+ * What makes two of `values` one item, where your app makes them again (a refetch, a store's copy):
88
+ * matched by it, an item made again keeps its place, its drag and its keyboard lift, and the group's
89
+ * events hand the item as `values` holds it now. Left out, values match by identity. Read once.
90
+ */
91
+ // Probe: hooks-first, the Reorder round.
92
+ readonly key?: ((value: V) => unknown) | undefined
88
93
  /** The list's direction: `"y"`, a column, `"x"`, a row, or `"xy"`, a grid that wraps. Left out, it's found from the items' boxes. */
89
94
  readonly axis?: CoreReorder.Axis | undefined
90
95
  /** The keyboard reorder: on unless `false`. Off, the items have no keys, no tab stop and no instructions. */
@@ -105,26 +110,19 @@ export interface ReorderGroupConfigValues<V> {
105
110
  /**
106
111
  * A Reorder group's config: its `values` in order, `onReorder`, given each new order to set them from,
107
112
  * and its options. Each key is a value or an accessor of it, such as a signal, a getter, a store's
108
- * property or a component's prop; `onReorder` is a function.
113
+ * property or a component's prop; `onReorder` and `key` are functions.
109
114
  */
110
115
  // Read per key (#259).
111
- export type ReorderGroupConfig<V> = PerKey<ReorderGroupConfigValues<V>, "onReorder">
116
+ export type ReorderGroupConfig<V> = PerKey<ReorderGroupConfigValues<V>, "onReorder" | "key">
112
117
 
113
118
  /** A group's config read per key (#259). */
114
- const GROUP_VIEW = configView<ReorderGroupConfigValues<unknown>>(["values", "onReorder", "axis", "keyboard", "announcements", "instructions", "style"], ["onReorder"])
115
- /** A group's config as a view of `config`. */
116
- const groupViewOf = <V,>(config: ReorderGroupConfig<V>, beside: object): ReorderGroupConfigValues<V> => GROUP_VIEW.of(config, beside) as ReorderGroupConfigValues<V>
117
-
119
+ const GROUP_VIEW = configView<ReorderGroupConfigValues<unknown>>(["values", "onReorder", "key", "axis", "keyboard", "announcements", "instructions", "style"], ["onReorder", "key"])
118
120
  /**
119
- * A group's config as made, and the layer a `Reorder.Group` it's given to lays its element's props in
120
- * (#398): empty until then, each key it fixes read through the element's prop.
121
+ * A group's config as a view of `config`, nothing beside it: a `Reorder.Group` given a group laid its
122
+ * element's props there (#398), a form gone with today's components (probe: hooks-first, the Reorder
123
+ * round's Q6).
121
124
  */
122
- interface GroupLayer {
123
- readonly config: object
124
- readonly beside: object
125
- }
126
- // Module state (#460, Q7): a cache held weakly by the object it's for, so it goes with it.
127
- const GROUP_LAYERS = new WeakMap<object, GroupLayer>()
125
+ const groupViewOf = <V,>(config: ReorderGroupConfig<V>): ReorderGroupConfigValues<V> => GROUP_VIEW.of(config, {}) as ReorderGroupConfigValues<V>
128
126
 
129
127
  /** A Reorder group's events, as a ward's: `list.next(name)`, `list.each(name)` and `list.when(name)`. */
130
128
  // #257 item 3, ADR-0046.
@@ -161,12 +159,12 @@ export interface ReorderGroupProps {
161
159
  }
162
160
 
163
161
  /**
164
- * A **Reorder group**'s mark (#349): what tells a group given to `Reorder.Group`'s `groupRef` from a
165
- * function handed the component's own. Internal.
162
+ * A **Reorder group**'s mark (#349): what tells a group from a function, so `Reorder.Group`'s `groupRef`
163
+ * refuses one in its type ({@link GroupRefCallback}). Internal.
166
164
  */
167
165
  export const REORDER_GROUP: unique symbol = Symbol("wardic.reorderGroup")
168
166
 
169
- /** A Reorder group of `V`, whatever its config: what `Reorder.Group`'s `groupRef` takes. */
167
+ /** A Reorder group of `V`, whatever its config. */
170
168
  // #349.
171
169
  export interface AnyReorderGroup<V> {
172
170
  readonly [REORDER_GROUP]: V
@@ -260,7 +258,7 @@ interface ReorderItemOwn<V> {
260
258
  * drag, and every other gesture, so `whileHover` or `whileTap` on an item works as on Motion's, for
261
259
  * about 0.5 KB gzipped beside the drag's.
262
260
  */
263
- const ITEM_BRINGS: ReadonlyArray<Feature.Feature> = [Layout.layout, Drag.drag, Hover.hover, Press.press, Focus.focus, InView.inView, Pan.pan]
261
+ export const ITEM_BRINGS: ReadonlyArray<Feature.Feature> = [Layout.layout, Drag.drag, Hover.hover, Press.press, Focus.focus, InView.inView, Pan.pan]
264
262
 
265
263
  const ITEM_VIEW = configView<ReorderItemOwn<unknown>>(["value", "layout", "tabindex", "aria-describedby"], [])
266
264
 
@@ -305,14 +303,18 @@ const refCarrying = <G,>(attach: (element: HTMLElement) => void, props: Property
305
303
  const spreadProps: PropertyDescriptorMap = { ref: { value: self, enumerable: true }, ...props }
306
304
  const spread = spreadPropsOf<object>(spreadProps)
307
305
  Object.defineProperties(self, { [REORDER_GROUP]: { value: true }, ...spreadProps })
308
- return Object.assign(self as object, reads) as G
306
+ // Its reads aren't enumerable. Solid calls a spread's function source for its props, `{...list}`; a
307
+ // group that's a member of another object, `{...made.list}`, it reads as an object, key by key, and
308
+ // each read was written to the element as an attribute: `group`, `axis`, `move`, `controller`.
309
+ const hidden = Rec.map(Object.getOwnPropertyDescriptors(reads) as Record<string, PropertyDescriptor>, (descriptor) => ({ ...descriptor, enumerable: false }))
310
+ return Object.defineProperties(self as object, hidden) as G
309
311
  }
310
312
 
311
313
  /**
312
314
  * Makes a list of your own elements reorderable, by dragging or from the keyboard: spread the group on
313
315
  * the list's element, and make each item with `reorderItem`, keyed with `<For>`. Your app owns
314
316
  * `values`, and sets them from `onReorder`; a reorder it makes itself animates too. Call it where you'd
315
- * make a signal, under a `WardicProvider`. `Reorder.Group` is built on it.
317
+ * make a signal, under a `WardicProvider`. `createReorder`, and `Reorder.Group` over it, are built on it.
316
318
  *
317
319
  * @example
318
320
  * const list = reorderGroup({ values: items, onReorder: setItems })
@@ -332,11 +334,10 @@ const refCarrying = <G,>(attach: (element: HTMLElement) => void, props: Property
332
334
  // controller, no runtime; its `group`, `move` and `controller` do nothing (ADR-0021).
333
335
  export function reorderGroup<V>(config: ReorderGroupConfig<V>): ReorderGroup<V> {
334
336
  if (Predicate.isFunction(config)) throw new Error(WHOLE_GROUP_ACCESSOR)
335
- const beside = {}
336
- const view = groupViewOf(config, beside)
337
+ const view = groupViewOf(config)
337
338
  const cfg = (): ReorderGroupConfigValues<V> => view
338
339
  const runtime = useWardicRuntime()
339
- if (isServer) return layered(serverReorderGroup(cfg), config, beside)
340
+ if (isServer) return serverReorderGroup(cfg)
340
341
  const [detected, setDetected] = createSignal<CoreReorder.Axis>("y")
341
342
  // The order as a plain array (#721): a store's copied, so a store changed in place is a new order, read
342
343
  // untracked by the controller and tracked by the effect below.
@@ -367,6 +368,7 @@ export function reorderGroup<V>(config: ReorderGroupConfig<V>): ReorderGroup<V>
367
368
  onReorderEnd: (end) => events.tell("reorderEnd", () => end),
368
369
  onHoldStart: (start) => events.tell("holdStart", () => start),
369
370
  onHoldEnd: (end) => events.tell("holdEnd", () => end),
371
+ key: untrack(() => cfg().key),
370
372
  axis: () => Option.fromUndefinedOr(untrack(() => cfg().axis)),
371
373
  onAxis: setDetected,
372
374
  keyedWith: "<For>",
@@ -377,8 +379,8 @@ export function reorderGroup<V>(config: ReorderGroupConfig<V>): ReorderGroup<V>
377
379
  // The app's axis, else the detected one. When the app's is cleared, detected here, from the boxes the
378
380
  // engine holds, so the items' touch-action follows in the same flush (#257's audit: an effect that
379
381
  // detected it wrote a signal the items read a flush late, EFFECT_RELAY_TEAR). A Measure pass's change
380
- // comes through `onAxis`. Lazy: read first by an item, so a given group's `axis` beside it, laid
381
- // over its config by the `Reorder.Group` the items render in, is the one it tracks (#398).
382
+ // comes through `onAxis`. Lazy: read first by an item, so the `axis` it tracks is the config's as the
383
+ // items read it (#398).
382
384
  const axis: Accessor<CoreReorder.Axis> = createMemo(
383
385
  () =>
384
386
  UndefinedOr.match(cfg().axis, {
@@ -405,7 +407,7 @@ export function reorderGroup<V>(config: ReorderGroupConfig<V>): ReorderGroup<V>
405
407
  if (element.style.getPropertyValue("overflow-anchor") === "") element.style.setProperty("overflow-anchor", "none")
406
408
  controller.attach(element)
407
409
  }
408
- return layered(refCarrying<ReorderGroup<V>>(
410
+ return refCarrying<ReorderGroup<V>>(
409
411
  attach,
410
412
  { style: { get: () => groupStyleOf(cfg().style), enumerable: true } },
411
413
  {
@@ -425,36 +427,12 @@ export function reorderGroup<V>(config: ReorderGroupConfig<V>): ReorderGroup<V>
425
427
  controller,
426
428
  ...keyboardOf(cfg),
427
429
  },
428
- ), config, beside)
430
+ )
429
431
  }
430
432
 
431
433
  /** The group's axis memo's options: client-only, and lazy (#398). */
432
434
  const AXIS_MEMO = { ...CLIENT_ONLY, lazy: true } as const
433
435
 
434
- /** `group`, its config and its layer kept for a `Reorder.Group` it's given to (#398). */
435
- const layered = <G extends object,>(group: G, config: object, beside: object): G => {
436
- GROUP_LAYERS.set(group, { config, beside })
437
- return group
438
- }
439
-
440
- /**
441
- * A given group's element props (#398): each config key its `Reorder.Group` sets, laid over the
442
- * group's config, read through the element's prop. A key the group's config sets too is an error.
443
- */
444
- const besideGroup = (local: object, group: object): void => {
445
- const layer = UndefinedOr.getOrThrow(GROUP_LAYERS.get(group))
446
- const given = setKeysOf(local, GROUP_CONFIG)
447
- const twice = setKeysOf(layer.config, given)
448
- if (twice.length > 0) {
449
- throw new Error(
450
- `Reorder.Group: ${listOf(twice)} set both in the group given to groupRef and on the element (#398). ` +
451
- "Set each key in one place: in reorderGroup({ … }), or on the element.",
452
- )
453
- }
454
- Arr.forEach(given, (key) =>
455
- Object.defineProperty(layer.beside, key, { enumerable: true, configurable: true, get: () => (local as Readonly<Record<string, unknown>>)[key] }))
456
- }
457
-
458
436
  /** What a group's Scope reports when one of its finalizers fails as its owner goes. */
459
437
  const CLOSE_FAILED = "wardic.reorder: a finalizer failed"
460
438
 
@@ -507,7 +485,7 @@ const keyboardAttributes = <V,>(
507
485
 
508
486
  /**
509
487
  * Makes an element an item of a Reorder group: a ward, spread on the element, `<li {...row}>`, or given
510
- * to `Reorder.Item`'s `wardRef`. `value` is its value in the group's `values`, read once; the rest is a
488
+ * to its `ref`. `value` is its value in the group's `values`, read once; the rest is a
511
489
  * ward's config, but `layout` (`true` or `"position"`), `layoutId` and `drag`, which the group sets. It's
512
490
  * a tab stop for the keyboard reorder: your own `tabindex` and `aria-describedby` go in its config.
513
491
  * Call it where you'd make a signal: in a `<For>` callback.
@@ -520,33 +498,39 @@ const keyboardAttributes = <V,>(
520
498
  // ADR-0020. Given to `ref` alone, it's client-only. The element takes the drag defaults, with the
521
499
  // group's axis's touch-action, which its `style` can override.
522
500
  export function reorderItem<V, const C extends ReorderItemConfig<V>>(list: ReorderGroup<V>, config: C, options?: WardOptions): ReorderItem<V, C> {
523
- return reorderItemWith(list, config as ReorderItemConfig<V>, UndefinedOr.map(options, (o) => o.parent), undefined) as unknown as ReorderItem<V, C>
501
+ return reorderItemWith(list, config as ReorderItemConfig<V>, { parent: UndefinedOr.map(options, (o) => o.parent) }) as unknown as ReorderItem<V, C>
524
502
  }
525
503
 
526
504
  /** A `<Reorder>` item's mark (#349): the group it's in. Internal. */
527
505
  export const REORDER_ITEM: unique symbol = Symbol("wardic.reorderItem")
528
506
 
529
- /** A `<Reorder>` item of `V`, whatever its config: what `Reorder.Item`'s `wardRef` takes. */
507
+ /** A `<Reorder>` item of `V`, whatever its config. */
530
508
  // #349.
531
509
  export interface AnyReorderItem<V> extends AnyWard {
532
510
  readonly [REORDER_ITEM]: V
533
511
  }
534
512
 
535
513
  /**
536
- * `reorderItem()`'s item: a ward in its group. Spread it on the item's element, or give it to
537
- * `Reorder.Item`'s `wardRef`.
514
+ * `reorderItem()`'s item: a ward in its group. Spread it on the item's element, or give it to its `ref`.
538
515
  */
539
516
  export type ReorderItem<V, C extends ReorderItemConfig<V> = ReorderItemConfig<V>> = Ward<C> & AnyReorderItem<V>
540
517
 
541
- /** {@link reorderItem} for `tag` (`Reorder.Item`'s `as`). Internal. */
542
- const reorderItemWith = <V,>(list: ReorderGroup<V>, config: ReorderItemConfig<V>, parent: AnyWard | undefined, tag: string | undefined): Ward => {
518
+ /**
519
+ * {@link reorderItem} over `internal`, the internals its ward was given: its parent and its tag
520
+ * (`Reorder.Item`'s `as`, a hook row's `tag`), and a hook row's own besides (what the hooks are told of a
521
+ * ward they made, a function rune's shared lifecycle, a Variant child by its own word, a ward that names
522
+ * no gesture, the keys the hooks fix over its config), each kept under what an item sets itself. Internal.
523
+ */
524
+ // The Reorder round's RF1: an item took its parent and its tag alone, so a hook row's function rune
525
+ // never heard its row, its lifecycle unshared.
526
+ export const reorderItemWith = <V,>(list: ReorderGroup<V>, config: ReorderItemConfig<V>, internal: WardInternals): Ward => {
543
527
  if (Predicate.isFunction(config)) throw new Error(WHOLE_ITEM_ACCESSOR)
544
528
  // Its own keys read per key (#259); the rest are its ward's config, read by the ward. Its `layout`
545
529
  // is its Layout mode, `true` or `"position"` whatever the config gives, read at each layout
546
530
  // animation's start as any ward's is (ADR-0009, *Amendment (#42)*).
547
531
  const own = ITEM_VIEW.of(config) as ReorderItemOwn<V>
548
532
  const cfg = (): ReorderItemOwn<V> => own
549
- const fixed = { layout: (): ReorderItemLayout => itemLayoutOf(own.layout) }
533
+ const fixed = { ...internal.fixed, layout: (): ReorderItemLayout => itemLayoutOf(own.layout) }
550
534
  const wardConfig = config as unknown as WardConfig
551
535
  // Its group's axis's `touch-action`, under its style: none when its own presses don't drag it
552
536
  // (`dragListener={false}`, #431), as with its other drag defaults, so a list dragged by handles scrolls by touch.
@@ -557,7 +541,7 @@ const reorderItemWith = <V,>(list: ReorderGroup<V>, config: ReorderItemConfig<V>
557
541
  // On a server the item renders the drag defaults with its group's touch-action, and joins no
558
542
  // controller (ADR-0021); the instructions element exists on the client only.
559
543
  if (isServer) {
560
- const row = wardWith(wardConfig, { tag, brings: ITEM_BRINGS, dragAxis: () => true, baseStyle: touchAction, fixed, group: list, parent })
544
+ const row = wardWith(wardConfig, { ...internal, brings: ITEM_BRINGS, dragAxis: () => true, baseStyle: touchAction, fixed, group: list })
561
545
  return withSpreadProps(Object.defineProperties(row, { [REORDER_ITEM]: { value: list } }), keyboardAttributes(list, cfg, constUndefined))
562
546
  }
563
547
  const runtime = useWardicRuntime()
@@ -582,11 +566,10 @@ const reorderItemWith = <V,>(list: ReorderGroup<V>, config: ReorderItemConfig<V>
582
566
  CLIENT_ONLY,
583
567
  )
584
568
  const row = wardWith(wardConfig, {
585
- tag,
569
+ ...internal,
586
570
  brings: ITEM_BRINGS,
587
571
  fixed,
588
572
  group: list,
589
- parent,
590
573
  dragAxis: () => dragAxisFor(driver.dragAxis()),
591
574
  onDragSample: driver.onSample,
592
575
  onLayoutHandle: driver.register,
@@ -608,25 +591,21 @@ const reorderItemWith = <V,>(list: ReorderGroup<V>, config: ReorderItemConfig<V>
608
591
  return withSpreadProps(Object.defineProperties(row, { [REORDER_ITEM]: { value: list } }), keyboardAttributes(list, cfg, describedBy))
609
592
  }
610
593
 
611
- // --- Components (ADR-0020: built on the factories) ---------------------------------------------
612
-
613
- /** The nearest `Reorder.Group`'s group, for its items: `null` for none (Solid 2's contexts). */
614
- const GroupContext = createContext<ReorderGroup<unknown> | null>(null)
594
+ // --- The components' props (ADR-0020). The components are the hooks' utilities over `createReorder`
595
+ // (`reorder-components.tsx`, probe: hooks-first, the Reorder round), and today's built on the factories
596
+ // here went with the swap. ---------------------------------------------------------------------------
615
597
 
616
598
  /** An element tag a `<Reorder>` group or item can render. */
617
599
  export type ReorderElementTag = keyof JSX.IntrinsicElements
618
600
 
619
- /**
620
- * `Reorder.Group`'s group: its config as props, `groupRef` handing the group out, or a group made with
621
- * `reorderGroup` given to `groupRef`, with the options its config doesn't set beside it. A key given
622
- * both ways is an error.
623
- */
624
- // #349, #398. A key set twice is caught at setup; in the types only for `values` and `onReorder`, which
625
- // every group sets: a group's type doesn't carry its config.
601
+ /** `Reorder.Group`'s group: its config as props, `groupRef` handing the group out. */
602
+ // #349, #398.
626
603
  export type ReorderGroupOf<V> =
627
- | {
604
+ {
628
605
  readonly values: ReadonlyArray<V>
629
606
  readonly onReorder: (values: Array<V>) => void
607
+ /** What makes two of `values` one item, where your app makes them again: see the group config's `key`. Read once. */
608
+ readonly key?: ((value: V) => unknown) | undefined
630
609
  readonly axis?: CoreReorder.Axis | undefined
631
610
  readonly keyboard?: boolean | undefined
632
611
  readonly announcements?: Partial<CoreReorder.Announcements<V>> | undefined
@@ -637,19 +616,9 @@ export type ReorderGroupOf<V> =
637
616
  */
638
617
  readonly groupRef?: GroupRefCallback<V> | undefined
639
618
  }
640
- | {
641
- /**
642
- * A group made with `reorderGroup`, which the component renders, with the options its config
643
- * doesn't set beside it: never `values` or `onReorder`, which a group is made with.
644
- */
645
- readonly groupRef: AnyReorderGroup<V>
646
- readonly values?: never
647
- readonly onReorder?: never
648
- readonly axis?: CoreReorder.Axis | undefined
649
- readonly keyboard?: boolean | undefined
650
- readonly announcements?: Partial<CoreReorder.Announcements<V>> | undefined
651
- readonly instructions?: string | undefined
652
- }
619
+ // A group made with `reorderGroup` given to `groupRef` to drive was a form of the component's too: no
620
+ // more since `Reorder.Group` is the hooks' utility over `createReorder` (probe: hooks-first, the Reorder
621
+ // round's Q6), which makes its own.
653
622
 
654
623
  /** A function `groupRef` gives the component's group: never a group, which it would take instead. */
655
624
  export type GroupRefCallback<V> = ((list: ReorderGroup<V>) => void) & { readonly [REORDER_GROUP]?: never }
@@ -663,231 +632,43 @@ export type ReorderGroupComponentProps<V, Tag extends ReorderElementTag = "ul">
663
632
  & { readonly as?: Tag }
664
633
  & Omit<JSX.IntrinsicElements[Tag], "style" | "onReorder">
665
634
  & { readonly style?: WardStyle | string | undefined }
666
- & WardicMotion
667
-
668
- /** A `<Reorder>` item's motion props: any but `layoutId` and `drag`, its `layout` a Layout mode. */
669
- type ItemMotionProps = Omit<WardicMotionProps, "layout" | "layoutId" | "drag">
635
+ // Not a ward's presence `key`: the group's, a function of a value (probe: hooks-first, the Reorder round).
636
+ & Omit<WardicMotion, "key">
670
637
 
671
638
  /**
672
- * `Reorder.Item`'s item: its `value`, its `layout` and its motion props, `wardRef` handing its ward out,
673
- * or an item made with `reorderItem` given to `wardRef`, with the keys its config `C` doesn't set
674
- * beside it, as beside a ward: never `value`, which an item is made with.
639
+ * A `<Reorder>` item's motion props: any but `layoutId` and `drag`, its `layout` a Layout mode. Not
640
+ * `dragControls` or `dragListener`: a `<Reorder.Grip>` inside it is their way (probe: behaviour-runes, Q29).
675
641
  */
642
+ type ItemMotionProps = Omit<WardicMotionProps, "layout" | "layoutId" | "drag" | "dragControls" | "dragListener">
643
+
644
+ /** `Reorder.Item`'s item: its `value`, its `layout` and its motion props, `wardRef` handing its ward out. */
676
645
  // #349, #398.
677
- export type ReorderItemOf<V, C = {}> =
678
- | (ItemMotionProps & {
646
+ export type ReorderItemOf<V> =
647
+ ItemMotionProps & {
679
648
  /** Its value in the group's `values`, of any type, not its element's `value` attribute. Read once. */
680
649
  readonly value: V
681
650
  readonly layout?: ReorderItemLayout
682
651
  readonly wardRef?: WardRefCallback | undefined
683
- })
684
- | (WardicBeside<C, ItemMotionProps> & {
685
- readonly wardRef: AnyReorderItem<V> & GivenWard<C>
686
- readonly value?: never
687
- readonly layout?: "layout" extends WardSetKey<C> ? never : ReorderItemLayout
688
- readonly tabindex?: "tabindex" extends WardSetKey<C> ? never : number
689
- readonly "aria-describedby"?: "aria-describedby" extends WardSetKey<C> ? never : string
690
- })
652
+ }
653
+ // An item made with `reorderItem` given to `wardRef` to drive was a form of the component's too, of its
654
+ // config's type: no more since `Reorder.Item` is the hooks' utility (probe: hooks-first, the Reorder round's Q6).
691
655
 
692
656
  /**
693
657
  * `Reorder.Item`'s props: its item ({@link ReorderItemOf}), `as`, the element it renders (`"li"` by
694
658
  * default, read once), and that element's own props, but its `value` attribute: `value` is the item's (#748).
695
659
  */
696
- export type ReorderItemComponentProps<V, Tag extends ReorderElementTag = "li", C = {}> =
697
- & ReorderItemOf<V, C>
660
+ export type ReorderItemComponentProps<V, Tag extends ReorderElementTag = "li"> =
661
+ & ReorderItemOf<V>
698
662
  & { readonly as?: Tag }
699
663
  & Omit<JSX.IntrinsicElements[Tag], "style" | "value">
700
664
  & { readonly style?: WardStyle | string | undefined }
701
665
 
702
666
  /**
703
- * The props a component body reads, as plain records: instantiating the public prop types over
704
- * every element tag makes a type checker build a union of every element's props.
667
+ * `Reorder.Grip`'s props (probe: behaviour-runes, Q29, Q33): `as`, the element it renders (a
668
+ * `<button type="button">` by default, read once), that element's own props, and its motion props.
705
669
  */
706
- interface GroupLocal<V> {
707
- readonly values: ReadonlyArray<V>
708
- readonly onReorder: (values: Array<V>) => void
709
- readonly groupRef?: unknown
710
- readonly axis?: CoreReorder.Axis | undefined
711
- readonly keyboard?: boolean | undefined
712
- readonly announcements?: Partial<CoreReorder.Announcements<V>> | undefined
713
- readonly instructions?: string | undefined
714
- readonly as?: string | undefined
715
- readonly ref?: unknown
716
- readonly style?: WardStyle | string | undefined
717
- readonly children?: JSX.Element
718
- }
719
- interface ItemLocal<V> {
720
- readonly value: V
721
- readonly as?: string | undefined
722
- readonly ref?: unknown
723
- readonly style?: WardStyle | string | undefined
724
- readonly children?: JSX.Element
725
- readonly tabindex?: number | undefined
726
- readonly "aria-describedby"?: string | undefined
727
- readonly wardRef?: unknown
728
- }
729
-
730
- const GROUP_OWN = ["values", "onReorder", "axis", "keyboard", "announcements", "instructions", "as", "ref", "style", "children", "groupRef"] as const
731
- const ITEM_OWN = [...MOTION_PROPS, "value", "as", "ref", "style", "children", "tabindex", "aria-describedby", "wardRef"] as const
732
- /** A group's config keys: beside a given group, each it doesn't set (#398). */
733
- const GROUP_CONFIG = ["values", "onReorder", "axis", "keyboard", "announcements", "instructions"] as const
734
- /** An item's config keys, its motion props and its own: beside a given item, each it doesn't set (#398). */
735
- const ITEM_CONFIG = [...MOTION_PROPS, "value", "tabindex", "aria-describedby"] as const
736
- /** A `<Reorder>` item's keyboard reorder attributes (ADR-0037), which a given item's element carries (#349). */
737
- const KEYBOARD_ATTRIBUTES = ["tabindex", "aria-describedby"] as const
738
-
739
- /**
740
- * The Wardic element for `tag`, as a plain component: a Slim element's (`w[tag]`, #511), so a Reorder
741
- * brings no Feature but its own (ADR-0067 decision 12) and renders under a `strict` section.
742
- */
743
- const wardicTag = (tag: string): Component<Record<string, unknown>> =>
744
- UndefinedOr.getOrThrow((w as unknown as Record<string, Component<Record<string, unknown>> | undefined>)[tag])
745
-
746
- /** The group given to `groupRef` (#349), or `undefined` for a function or none: read once, untracked, as `ref` is. */
747
- const givenGroupOf = <V,>(local: GroupLocal<V>): ReorderGroup<V> | undefined => {
748
- const ref = untrack(() => local.groupRef)
749
- return Bool.match(Predicate.hasProperty(ref, REORDER_GROUP), { onTrue: () => ref as ReorderGroup<V>, onFalse: constUndefined })
750
- }
751
-
752
- /**
753
- * A list put in order by dragging its items, or from the keyboard, rendered as `as`, `"ul"` by
754
- * default. Your app owns `values`, and sets them from `onReorder`; or give it a group made with
755
- * `reorderGroup` as `groupRef`. Key its `Reorder.Item`s with `<For>`.
756
- *
757
- * @see https://wardic.dev/reference/solid/reorder/reorder
758
- */
759
- // ADR-0020, #349: a `reorderGroup` on `w[as]`, the group in context for its items.
760
- function Group<V, Tag extends ReorderElementTag = "ul">(props: ReorderGroupComponentProps<V, Tag>): JSX.Element {
761
- const local = props as unknown as GroupLocal<V>
762
- const given = givenGroupOf(local)
763
- const list = UndefinedOr.match(given, {
764
- onUndefined: () => {
765
- // Its props are its config, read per key (#259).
766
- const made = reorderGroup<V>(local as unknown as ReorderGroupConfig<V>)
767
- // The group, to its `groupRef` (#257 item 3), read once, untracked, as `ref` is.
768
- const give = untrack(() => local.groupRef)
769
- if (Predicate.isFunction(give)) give(made)
770
- return made
771
- },
772
- onDefined: (group) => {
773
- besideGroup(local, group)
774
- return group
775
- },
776
- })
777
- const Tag = wardicTag(UndefinedOr.match(untrack(() => local.as), { onUndefined: () => "ul", onDefined: identity }))
778
- const rest = omit(props as unknown as Record<string, unknown>, ...GROUP_OWN)
779
- // Its element's style over the group's: `overflow-anchor: none`, under a given group's config (#349).
780
- const styleOf: () => JSX.CSSProperties = UndefinedOr.match(given, {
781
- onUndefined: () => () => pipe(local.style, Style.over(ReorderController.GROUP_STYLE)) as JSX.CSSProperties,
782
- onDefined: (group) => () => pipe(local.style, Style.over(group.style)) as JSX.CSSProperties,
783
- })
784
- return (
785
- <GroupContext value={list as ReorderGroup<unknown>}>
786
- <Tag {...rest} style={styleOf()} ref={refsOf(local, [list])}>
787
- {local.children}
788
- </Tag>
789
- </GroupContext>
790
- )
791
- }
792
-
793
- /**
794
- * A `<Reorder>` item given to `Reorder.Item`'s `wardRef` (#349): one of `list`'s, made with
795
- * {@link reorderItem}. Its element is driven by a ward of the component's, and carries the item's
796
- * keyboard reorder attributes.
797
- */
798
- const givenItem = <V,>(list: ReorderGroup<V>, local: ItemLocal<V>, share: WardShare, tag: string): { readonly row: Ward; readonly keys: object; readonly setup: WardConfigValues } => {
799
- if (Predicate.isUndefined(share.internal.group)) {
800
- throw new Error("Reorder.Item: the ward in wardRef isn't a Reorder item (#349). Make it with reorderItem(list, { value }), list the group it's in.")
801
- }
802
- if (share.internal.group !== list) {
803
- throw new Error("Reorder.Item: the item in wardRef is another group's (#349). Make it with reorderItem(list, …), list the Reorder.Group it renders in.")
804
- }
805
- const item = untrack(() => local.wardRef) as object
806
- const { ward: row, setup } = drivenWard("Reorder.Item", local, share, { tag }, ITEM_CONFIG)
807
- // Its keyboard attributes: the item's, or the element's where it sets one the item doesn't (#398).
808
- const keys = Object.defineProperties(
809
- {},
810
- Object.fromEntries(
811
- Arr.map(KEYBOARD_ATTRIBUTES, (key) => [
812
- key,
813
- Bool.match(sets(local, key), {
814
- onTrue: (): PropertyDescriptor => ({ enumerable: true, get: () => (local as unknown as Readonly<Record<string, unknown>>)[key] }),
815
- onFalse: () => UndefinedOr.getOrThrow(Object.getOwnPropertyDescriptor(item, key)),
816
- }),
817
- ]),
818
- ),
819
- )
820
- return { row, keys, setup }
821
- }
822
-
823
- /**
824
- * An item of the `Reorder.Group` around it, rendered as `as`, `"li"` by default: made from its props,
825
- * or an item made with `reorderItem` given as `wardRef`. Outside a group it throws, as Motion's does.
826
- *
827
- * @see https://wardic.dev/reference/solid/reorder/reorder
828
- */
829
- // ADR-0020, #349: a `reorderItem` on the nearest group.
830
- function Item<V, Tag extends ReorderElementTag = "li", C = {}>(props: ReorderItemComponentProps<V, Tag, C>): JSX.Element {
831
- const list = useContext(GroupContext) as ReorderGroup<V> | null
832
- if (Predicate.isNull(list)) throw new Error("Reorder.Item must be a child of Reorder.Group")
833
- const local = props as unknown as ItemLocal<V> & WardicMotionProps
834
- const tag = UndefinedOr.match(untrack(() => local.as), { onUndefined: () => "li", onDefined: identity })
835
- const given = givenOf(local)
836
- // One plain element a tag, as every Wardic element's (#618, M3).
837
- const Element = staticElementOf(tag)
838
- const rest = omit(props as unknown as Record<string, unknown>, ...ITEM_OWN)
839
- const element = UndefinedOr.match(given, {
840
- onUndefined: () => {
841
- // Its props are its config, read per key (#259); its `layout` is read as a Layout mode.
842
- const row = reorderItemWith<V>(list, local as unknown as ReorderItemConfig<V>, undefined, tag)
843
- // Its ward, to the item's `wardRef` (#257).
844
- handOver(local, row)
845
- // The ward's spread props, as an object: spread as the function it is, it's a source `merge`
846
- // calls in a computation, whose keys `spread` can't know, so it inserts children too (#525, #618 M3).
847
- const rowProps = row()
848
- return {
849
- row,
850
- setup: undefined,
851
- render: (): JSX.Element => (
852
- <Element {...rest} {...rowProps} ref={refsOf(local, [row])}>
853
- {local.children}
854
- </Element>
855
- ),
856
- }
857
- },
858
- onDefined: (share) => {
859
- const { row, keys, setup } = givenItem(list, local, share, tag)
860
- return {
861
- row,
862
- setup,
863
- render: (): JSX.Element => (
864
- <Element {...rest} {...row.with({ style: local.style })} {...keys} ref={refsOf(local, [row])}>
865
- {local.children}
866
- </Element>
867
- ),
868
- }
869
- },
870
- })
871
- // An item that changes what its children read renders its variant context's Provider around them
872
- // (#50), as every Wardic element does; any other renders none.
873
- const config = UndefinedOr.match(element.setup, { onUndefined: () => wardConfigView(local as unknown as WardConfig), onDefined: identity })
874
- return Bool.match(untrack(() => VariantTree.changesContext(config)), {
875
- onFalse: element.render,
876
- onTrue: () => <element.row.Provider>{element.render()}</element.row.Provider>,
877
- })
878
- }
879
-
880
- /**
881
- * A list put in order by dragging its items, or from the keyboard: `Reorder.Group` and `Reorder.Item`.
882
- * Your app owns the order: the group takes it as `values`, and `onReorder` hands each new one back.
883
- * Motion's `Reorder`. A long list of items of one size reorders as one Batch: `Reorder.BatchGroup` and
884
- * `Reorder.BatchItem`.
885
- *
886
- * @example
887
- * <Reorder.Group values={items()} onReorder={setItems}>
888
- * <For each={items()}>{(item) => <Reorder.Item value={item}>{item}</Reorder.Item>}</For>
889
- * </Reorder.Group>
890
- * @see https://wardic.dev/reference/solid/reorder/reorder
891
- */
892
- // ADR-0020; the Batch pair, ADR-0072 (#712).
893
- export const Reorder = { Group, Item, BatchGroup, BatchItem } as const
670
+ export type ReorderGripComponentProps<Tag extends ReorderElementTag = "button"> =
671
+ & ItemMotionProps
672
+ & { readonly as?: Tag }
673
+ & Omit<JSX.IntrinsicElements[Tag], "style">
674
+ & { readonly style?: WardStyle | string | undefined }
package/src/stage.ts CHANGED
@@ -88,6 +88,9 @@ export type StageWardChecked<C> = WardCheckedConfig<C, PerKeyApart<StageWardConf
88
88
  * Environment adds its own by declaration merging, as it adds its Subjects to {@link StageSubjects}.
89
89
  * `@wardic/three/solid` adds three.js's: a material's `roughness` and `emissive`, a light's
90
90
  * `intensity`, a camera's `fov`. A name in neither an element's values nor these is an error naming it.
91
+ * Each entry's type is what its value takes in a target (a number, a colour): `ward(subject, config)`
92
+ * reads the names alone, and the hooks read the types too, for a rune written with no Subject
93
+ * ({@link StageTargetValues} holds them by Subject).
91
94
  */
92
95
  // #934: the scene lab's keys were all an element's too (`opacity`, `color`); a material's own weren't.
93
96
  export interface StageValues {}
@@ -95,6 +98,18 @@ export interface StageValues {}
95
98
  /** The names of {@link StageValues}. */
96
99
  export type StageValueKey = keyof StageValues & string
97
100
 
101
+ /**
102
+ * What each of a Stage's Subject `S`'s values takes in a target, by name (probe: hooks-first): what
103
+ * the hooks check a rune's targets on `S` by. An Environment adds its own by declaration merging, a
104
+ * generic interface of the Subject as {@link StageReads} is: `declare module "@wardic/solid" {
105
+ * interface StageTargetValues<S> { three: SceneTargetValues<S> } }`. Each Environment's entry for a
106
+ * Subject it doesn't take is `{}`, and a Subject no Environment gives a name isn't checked.
107
+ * {@link StageValues} holds every Subject's names at once, each with what it takes, for a rune
108
+ * written with no Subject.
109
+ */
110
+ // By declaration merging, as `StageReads` is and for its reason: `@wardic/solid` names no Environment's type.
111
+ export interface StageTargetValues<S> extends Record<never, S> {}
112
+
98
113
  /**
99
114
  * What each key of a Stage's Subject `S` reads as, by the Environment that fills one: a ward's `read` takes
100
115
  * its Subject's keys at these types. `@wardic/three/solid` adds three.js's, as `declare module