@wardic/solid 1.0.0-rc.8 → 1.0.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 (482) hide show
  1. package/dist/browser/appear.js +20 -3
  2. package/dist/browser/appear.js.map +1 -1
  3. package/dist/browser/batch-appear-here.js +29 -0
  4. package/dist/browser/batch-appear-here.js.map +1 -0
  5. package/dist/browser/batch-gestures.js +174 -0
  6. package/dist/browser/batch-gestures.js.map +1 -0
  7. package/dist/browser/batch-handoff.js +72 -0
  8. package/dist/browser/batch-handoff.js.map +1 -0
  9. package/dist/browser/batch-reorder-group.js +345 -0
  10. package/dist/browser/batch-reorder-group.js.map +1 -0
  11. package/dist/browser/batch-reorder-places.js +207 -0
  12. package/dist/browser/batch-reorder-places.js.map +1 -0
  13. package/dist/browser/batch-reorder.js +641 -0
  14. package/dist/browser/batch-reorder.js.map +1 -0
  15. package/dist/browser/batch.js +2512 -0
  16. package/dist/browser/batch.js.map +1 -0
  17. package/dist/browser/bridge.js.map +1 -1
  18. package/dist/browser/complete.js.map +1 -1
  19. package/dist/browser/create-animate.js.map +1 -1
  20. package/dist/browser/create-batch.js +120 -0
  21. package/dist/browser/create-batch.js.map +1 -0
  22. package/dist/browser/create-ward.js +4 -2
  23. package/dist/browser/create-ward.js.map +1 -1
  24. package/dist/browser/directive.js.map +1 -1
  25. package/dist/browser/drag-sensor.js.map +1 -1
  26. package/dist/browser/drag-track.js +13 -3
  27. package/dist/browser/drag-track.js.map +1 -1
  28. package/dist/browser/drag.js.map +1 -1
  29. package/dist/browser/focus-sensor.js.map +1 -1
  30. package/dist/browser/hover-sensor.js.map +1 -1
  31. package/dist/browser/imperative.js +89 -5
  32. package/dist/browser/imperative.js.map +1 -1
  33. package/dist/browser/index.js +2 -1
  34. package/dist/browser/index.js.map +1 -1
  35. package/dist/browser/layout-member.js +17 -5
  36. package/dist/browser/layout-member.js.map +1 -1
  37. package/dist/browser/layout-projection.js.map +1 -1
  38. package/dist/browser/layout.js.map +1 -1
  39. package/dist/browser/lazy-batch-gestures.js +64 -0
  40. package/dist/browser/lazy-batch-gestures.js.map +1 -0
  41. package/dist/browser/live-scroll.js.map +1 -1
  42. package/dist/browser/live-value.js.map +1 -1
  43. package/dist/browser/member-hold.js +181 -0
  44. package/dist/browser/member-hold.js.map +1 -0
  45. package/dist/browser/presence-controller.js +149 -34
  46. package/dist/browser/presence-controller.js.map +1 -1
  47. package/dist/browser/presence-record.js.map +1 -1
  48. package/dist/browser/press-sensor.js.map +1 -1
  49. package/dist/browser/press.js +2 -2
  50. package/dist/browser/press.js.map +1 -1
  51. package/dist/browser/reorder-input.js +73 -2
  52. package/dist/browser/reorder-input.js.map +1 -1
  53. package/dist/browser/reorder-values.js +20 -0
  54. package/dist/browser/reorder-values.js.map +1 -0
  55. package/dist/browser/reorder.js +13 -6
  56. package/dist/browser/reorder.js.map +1 -1
  57. package/dist/browser/sensors.js.map +1 -1
  58. package/dist/browser/spine.js +89 -8
  59. package/dist/browser/spine.js.map +1 -1
  60. package/dist/browser/unstable/v2/batch-appear-here.js +28 -0
  61. package/dist/browser/unstable/v2/batch-appear-here.js.map +1 -0
  62. package/dist/browser/unstable/v2/batch-reorder-group.js +267 -0
  63. package/dist/browser/unstable/v2/batch-reorder-group.js.map +1 -0
  64. package/dist/browser/unstable/v2/bridge.js.map +1 -1
  65. package/dist/browser/unstable/v2/complete.js.map +1 -1
  66. package/dist/browser/unstable/v2/create-animate.js +11 -46
  67. package/dist/browser/unstable/v2/create-animate.js.map +1 -1
  68. package/dist/browser/unstable/v2/create-batch.js +144 -0
  69. package/dist/browser/unstable/v2/create-batch.js.map +1 -0
  70. package/dist/browser/unstable/v2/drag-sensor.js.map +1 -1
  71. package/dist/browser/unstable/v2/element.js +4 -2
  72. package/dist/browser/unstable/v2/element.js.map +1 -1
  73. package/dist/browser/unstable/v2/flights.js +57 -0
  74. package/dist/browser/unstable/v2/flights.js.map +1 -0
  75. package/dist/browser/unstable/v2/focus-sensor.js.map +1 -1
  76. package/dist/browser/unstable/v2/hover-sensor.js.map +1 -1
  77. package/dist/browser/unstable/v2/index.js +1 -0
  78. package/dist/browser/unstable/v2/index.js.map +1 -1
  79. package/dist/browser/unstable/v2/layout-projection.js.map +1 -1
  80. package/dist/browser/unstable/v2/layout.js.map +1 -1
  81. package/dist/browser/unstable/v2/live-scroll.js.map +1 -1
  82. package/dist/browser/unstable/v2/live-value.js.map +1 -1
  83. package/dist/browser/unstable/v2/presence-hooks.js.map +1 -1
  84. package/dist/browser/unstable/v2/press-sensor.js.map +1 -1
  85. package/dist/browser/unstable/v2/reorder.js +14 -6
  86. package/dist/browser/unstable/v2/reorder.js.map +1 -1
  87. package/dist/browser/unstable/v2/sensors.js.map +1 -1
  88. package/dist/browser/unstable/v2/ward.js +4 -2
  89. package/dist/browser/unstable/v2/ward.js.map +1 -1
  90. package/dist/browser/unstable/v2/wardic.js.map +1 -1
  91. package/dist/browser/w.js.map +1 -1
  92. package/dist/browser/wardic.js.map +1 -1
  93. package/dist/server/appear.js +20 -3
  94. package/dist/server/appear.js.map +1 -1
  95. package/dist/server/batch-appear-here.js +29 -0
  96. package/dist/server/batch-appear-here.js.map +1 -0
  97. package/dist/server/batch-gestures.js +174 -0
  98. package/dist/server/batch-gestures.js.map +1 -0
  99. package/dist/server/batch-handoff.js +72 -0
  100. package/dist/server/batch-handoff.js.map +1 -0
  101. package/dist/server/batch-reorder-group.js +341 -0
  102. package/dist/server/batch-reorder-group.js.map +1 -0
  103. package/dist/server/batch-reorder-places.js +207 -0
  104. package/dist/server/batch-reorder-places.js.map +1 -0
  105. package/dist/server/batch-reorder.js +641 -0
  106. package/dist/server/batch-reorder.js.map +1 -0
  107. package/dist/server/batch.js +2512 -0
  108. package/dist/server/batch.js.map +1 -0
  109. package/dist/server/bridge.js.map +1 -1
  110. package/dist/server/complete.js.map +1 -1
  111. package/dist/server/create-animate.js.map +1 -1
  112. package/dist/server/create-batch.js +120 -0
  113. package/dist/server/create-batch.js.map +1 -0
  114. package/dist/server/create-ward.js +4 -2
  115. package/dist/server/create-ward.js.map +1 -1
  116. package/dist/server/directive.js.map +1 -1
  117. package/dist/server/drag-sensor.js.map +1 -1
  118. package/dist/server/drag-track.js +13 -3
  119. package/dist/server/drag-track.js.map +1 -1
  120. package/dist/server/drag.js.map +1 -1
  121. package/dist/server/focus-sensor.js.map +1 -1
  122. package/dist/server/hover-sensor.js.map +1 -1
  123. package/dist/server/imperative.js +89 -5
  124. package/dist/server/imperative.js.map +1 -1
  125. package/dist/server/index.js +2 -1
  126. package/dist/server/index.js.map +1 -1
  127. package/dist/server/layout-member.js +17 -5
  128. package/dist/server/layout-member.js.map +1 -1
  129. package/dist/server/layout-projection.js.map +1 -1
  130. package/dist/server/layout.js.map +1 -1
  131. package/dist/server/lazy-batch-gestures.js +64 -0
  132. package/dist/server/lazy-batch-gestures.js.map +1 -0
  133. package/dist/server/live-scroll.js.map +1 -1
  134. package/dist/server/live-value.js.map +1 -1
  135. package/dist/server/member-hold.js +181 -0
  136. package/dist/server/member-hold.js.map +1 -0
  137. package/dist/server/presence-controller.js +149 -34
  138. package/dist/server/presence-controller.js.map +1 -1
  139. package/dist/server/presence-record.js.map +1 -1
  140. package/dist/server/press-sensor.js.map +1 -1
  141. package/dist/server/press.js +2 -2
  142. package/dist/server/press.js.map +1 -1
  143. package/dist/server/reorder-input.js +73 -2
  144. package/dist/server/reorder-input.js.map +1 -1
  145. package/dist/server/reorder-values.js +20 -0
  146. package/dist/server/reorder-values.js.map +1 -0
  147. package/dist/server/reorder.js +13 -6
  148. package/dist/server/reorder.js.map +1 -1
  149. package/dist/server/sensors.js.map +1 -1
  150. package/dist/server/spine.js +89 -8
  151. package/dist/server/spine.js.map +1 -1
  152. package/dist/server/unstable/v2/batch-appear-here.js +28 -0
  153. package/dist/server/unstable/v2/batch-appear-here.js.map +1 -0
  154. package/dist/server/unstable/v2/batch-reorder-group.js +378 -0
  155. package/dist/server/unstable/v2/batch-reorder-group.js.map +1 -0
  156. package/dist/server/unstable/v2/bridge.js.map +1 -1
  157. package/dist/server/unstable/v2/complete.js.map +1 -1
  158. package/dist/server/unstable/v2/create-animate.js +11 -46
  159. package/dist/server/unstable/v2/create-animate.js.map +1 -1
  160. package/dist/server/unstable/v2/create-batch.js +144 -0
  161. package/dist/server/unstable/v2/create-batch.js.map +1 -0
  162. package/dist/server/unstable/v2/drag-sensor.js.map +1 -1
  163. package/dist/server/unstable/v2/element.js +4 -2
  164. package/dist/server/unstable/v2/element.js.map +1 -1
  165. package/dist/server/unstable/v2/flights.js +57 -0
  166. package/dist/server/unstable/v2/flights.js.map +1 -0
  167. package/dist/server/unstable/v2/focus-sensor.js.map +1 -1
  168. package/dist/server/unstable/v2/hover-sensor.js.map +1 -1
  169. package/dist/server/unstable/v2/index.js +1 -0
  170. package/dist/server/unstable/v2/index.js.map +1 -1
  171. package/dist/server/unstable/v2/layout-projection.js.map +1 -1
  172. package/dist/server/unstable/v2/layout.js.map +1 -1
  173. package/dist/server/unstable/v2/live-scroll.js.map +1 -1
  174. package/dist/server/unstable/v2/live-value.js.map +1 -1
  175. package/dist/server/unstable/v2/presence-hooks.js.map +1 -1
  176. package/dist/server/unstable/v2/press-sensor.js.map +1 -1
  177. package/dist/server/unstable/v2/reorder.js +14 -6
  178. package/dist/server/unstable/v2/reorder.js.map +1 -1
  179. package/dist/server/unstable/v2/sensors.js.map +1 -1
  180. package/dist/server/unstable/v2/ward.js +4 -2
  181. package/dist/server/unstable/v2/ward.js.map +1 -1
  182. package/dist/server/unstable/v2/wardic.js.map +1 -1
  183. package/dist/server/w.js.map +1 -1
  184. package/dist/server/wardic.js.map +1 -1
  185. package/dist/solid/appear.d.ts +14 -0
  186. package/dist/solid/appear.d.ts.map +1 -1
  187. package/dist/solid/appear.js +14 -3
  188. package/dist/solid/appear.js.map +1 -1
  189. package/dist/solid/batch-appear-here.d.ts +9 -0
  190. package/dist/solid/batch-appear-here.d.ts.map +1 -0
  191. package/dist/solid/batch-appear-here.jsx +25 -0
  192. package/dist/solid/batch-appear-here.jsx.map +1 -0
  193. package/dist/solid/batch-gestures.d.ts +22 -0
  194. package/dist/solid/batch-gestures.d.ts.map +1 -0
  195. package/dist/solid/batch-gestures.js +138 -0
  196. package/dist/solid/batch-gestures.js.map +1 -0
  197. package/dist/solid/batch-handoff.d.ts +25 -0
  198. package/dist/solid/batch-handoff.d.ts.map +1 -0
  199. package/dist/solid/batch-handoff.js +75 -0
  200. package/dist/solid/batch-handoff.js.map +1 -0
  201. package/dist/solid/batch-reorder-group.d.ts +118 -0
  202. package/dist/solid/batch-reorder-group.d.ts.map +1 -0
  203. package/dist/solid/batch-reorder-group.jsx +271 -0
  204. package/dist/solid/batch-reorder-group.jsx.map +1 -0
  205. package/dist/solid/batch-reorder-places.d.ts +115 -0
  206. package/dist/solid/batch-reorder-places.d.ts.map +1 -0
  207. package/dist/solid/batch-reorder-places.js +139 -0
  208. package/dist/solid/batch-reorder-places.js.map +1 -0
  209. package/dist/solid/batch-reorder.d.ts +115 -0
  210. package/dist/solid/batch-reorder.d.ts.map +1 -0
  211. package/dist/solid/batch-reorder.js +579 -0
  212. package/dist/solid/batch-reorder.js.map +1 -0
  213. package/dist/solid/batch.d.ts +512 -0
  214. package/dist/solid/batch.d.ts.map +1 -0
  215. package/dist/solid/batch.js +2485 -0
  216. package/dist/solid/batch.js.map +1 -0
  217. package/dist/solid/bridge.d.ts.map +1 -1
  218. package/dist/solid/{bridge.js → bridge.jsx} +1 -1
  219. package/dist/solid/bridge.jsx.map +1 -0
  220. package/dist/solid/complete.d.ts.map +1 -1
  221. package/dist/solid/{complete.js → complete.jsx} +1 -1
  222. package/dist/solid/complete.jsx.map +1 -0
  223. package/dist/solid/config.d.ts +6 -2
  224. package/dist/solid/config.d.ts.map +1 -1
  225. package/dist/solid/create-animate.d.ts.map +1 -1
  226. package/dist/solid/{create-animate.js → create-animate.jsx} +1 -1
  227. package/dist/solid/create-animate.jsx.map +1 -0
  228. package/dist/solid/create-batch.d.ts +94 -0
  229. package/dist/solid/create-batch.d.ts.map +1 -0
  230. package/dist/solid/create-batch.jsx +109 -0
  231. package/dist/solid/create-batch.jsx.map +1 -0
  232. package/dist/solid/create-ward.d.ts.map +1 -1
  233. package/dist/solid/create-ward.jsx +7 -5
  234. package/dist/solid/create-ward.jsx.map +1 -1
  235. package/dist/solid/directive.d.ts.map +1 -1
  236. package/dist/solid/{directive.js → directive.jsx} +1 -1
  237. package/dist/solid/directive.jsx.map +1 -0
  238. package/dist/solid/drag-sensor.d.ts.map +1 -1
  239. package/dist/solid/{drag-sensor.js → drag-sensor.jsx} +2 -2
  240. package/dist/solid/drag-sensor.jsx.map +1 -0
  241. package/dist/solid/drag-track.d.ts +6 -0
  242. package/dist/solid/drag-track.d.ts.map +1 -1
  243. package/dist/solid/drag-track.js +14 -3
  244. package/dist/solid/drag-track.js.map +1 -1
  245. package/dist/solid/drag.d.ts.map +1 -1
  246. package/dist/solid/{drag.js → drag.jsx} +1 -1
  247. package/dist/solid/drag.jsx.map +1 -0
  248. package/dist/solid/focus-sensor.d.ts.map +1 -1
  249. package/dist/solid/{focus-sensor.js → focus-sensor.jsx} +2 -2
  250. package/dist/solid/focus-sensor.jsx.map +1 -0
  251. package/dist/solid/hover-sensor.d.ts.map +1 -1
  252. package/dist/solid/{hover-sensor.js → hover-sensor.jsx} +2 -2
  253. package/dist/solid/hover-sensor.jsx.map +1 -0
  254. package/dist/solid/imperative.d.ts +10 -2
  255. package/dist/solid/imperative.d.ts.map +1 -1
  256. package/dist/solid/imperative.js +79 -4
  257. package/dist/solid/imperative.js.map +1 -1
  258. package/dist/solid/index.d.ts +15 -14
  259. package/dist/solid/index.d.ts.map +1 -1
  260. package/dist/solid/{index.js → index.jsx} +14 -13
  261. package/dist/solid/index.jsx.map +1 -0
  262. package/dist/solid/layout-member.d.ts +15 -5
  263. package/dist/solid/layout-member.d.ts.map +1 -1
  264. package/dist/solid/layout-member.js +19 -5
  265. package/dist/solid/layout-member.js.map +1 -1
  266. package/dist/solid/layout-projection.d.ts.map +1 -1
  267. package/dist/solid/{layout-projection.js → layout-projection.jsx} +1 -1
  268. package/dist/solid/layout-projection.jsx.map +1 -0
  269. package/dist/solid/layout.jsx +1 -1
  270. package/dist/solid/layout.jsx.map +1 -1
  271. package/dist/solid/lazy-batch-gestures.d.ts +13 -0
  272. package/dist/solid/lazy-batch-gestures.d.ts.map +1 -0
  273. package/dist/solid/lazy-batch-gestures.js +70 -0
  274. package/dist/solid/lazy-batch-gestures.js.map +1 -0
  275. package/dist/solid/live-scroll.d.ts.map +1 -1
  276. package/dist/solid/{live-scroll.js → live-scroll.jsx} +2 -2
  277. package/dist/solid/live-scroll.jsx.map +1 -0
  278. package/dist/solid/live-value.d.ts.map +1 -1
  279. package/dist/solid/{live-value.js → live-value.jsx} +2 -2
  280. package/dist/solid/live-value.jsx.map +1 -0
  281. package/dist/solid/member-hold.d.ts +47 -0
  282. package/dist/solid/member-hold.d.ts.map +1 -0
  283. package/dist/solid/member-hold.js +189 -0
  284. package/dist/solid/member-hold.js.map +1 -0
  285. package/dist/solid/presence-controller.d.ts.map +1 -1
  286. package/dist/solid/presence-controller.js +144 -26
  287. package/dist/solid/presence-controller.js.map +1 -1
  288. package/dist/solid/presence-record.d.ts +8 -2
  289. package/dist/solid/presence-record.d.ts.map +1 -1
  290. package/dist/solid/presence-record.js.map +1 -1
  291. package/dist/solid/press-sensor.d.ts.map +1 -1
  292. package/dist/solid/{press-sensor.js → press-sensor.jsx} +2 -2
  293. package/dist/solid/press-sensor.jsx.map +1 -0
  294. package/dist/solid/press.js +2 -2
  295. package/dist/solid/press.js.map +1 -1
  296. package/dist/solid/reorder-input.d.ts +22 -1
  297. package/dist/solid/reorder-input.d.ts.map +1 -1
  298. package/dist/solid/reorder-input.js +70 -2
  299. package/dist/solid/reorder-input.js.map +1 -1
  300. package/dist/solid/reorder-values.d.ts +6 -0
  301. package/dist/solid/reorder-values.d.ts.map +1 -0
  302. package/dist/solid/reorder-values.js +21 -0
  303. package/dist/solid/reorder-values.js.map +1 -0
  304. package/dist/solid/reorder.d.ts +8 -4
  305. package/dist/solid/reorder.d.ts.map +1 -1
  306. package/dist/solid/reorder.jsx +12 -7
  307. package/dist/solid/reorder.jsx.map +1 -1
  308. package/dist/solid/sensors.d.ts.map +1 -1
  309. package/dist/solid/{sensors.js → sensors.jsx} +2 -2
  310. package/dist/solid/sensors.jsx.map +1 -0
  311. package/dist/solid/spine.d.ts +8 -2
  312. package/dist/solid/spine.d.ts.map +1 -1
  313. package/dist/solid/spine.js +104 -10
  314. package/dist/solid/spine.js.map +1 -1
  315. package/dist/solid/unstable/v2/batch-appear-here.d.ts +9 -0
  316. package/dist/solid/unstable/v2/batch-appear-here.d.ts.map +1 -0
  317. package/dist/solid/unstable/v2/batch-appear-here.jsx +24 -0
  318. package/dist/solid/unstable/v2/batch-appear-here.jsx.map +1 -0
  319. package/dist/solid/unstable/v2/batch-reorder-group.d.ts +119 -0
  320. package/dist/solid/unstable/v2/batch-reorder-group.d.ts.map +1 -0
  321. package/dist/solid/unstable/v2/batch-reorder-group.jsx +211 -0
  322. package/dist/solid/unstable/v2/batch-reorder-group.jsx.map +1 -0
  323. package/dist/solid/unstable/v2/bridge.d.ts.map +1 -1
  324. package/dist/solid/unstable/v2/{bridge.js → bridge.jsx} +1 -1
  325. package/dist/solid/unstable/v2/bridge.jsx.map +1 -0
  326. package/dist/solid/unstable/v2/complete.d.ts.map +1 -1
  327. package/dist/solid/unstable/v2/{complete.js → complete.jsx} +1 -1
  328. package/dist/solid/unstable/v2/complete.jsx.map +1 -0
  329. package/dist/solid/unstable/v2/create-animate.d.ts.map +1 -1
  330. package/dist/solid/unstable/v2/{create-animate.js → create-animate.jsx} +8 -52
  331. package/dist/solid/unstable/v2/create-animate.jsx.map +1 -0
  332. package/dist/solid/unstable/v2/create-batch.d.ts +106 -0
  333. package/dist/solid/unstable/v2/create-batch.d.ts.map +1 -0
  334. package/dist/solid/unstable/v2/create-batch.jsx +135 -0
  335. package/dist/solid/unstable/v2/create-batch.jsx.map +1 -0
  336. package/dist/solid/unstable/v2/drag-sensor.d.ts +1 -1
  337. package/dist/solid/unstable/v2/drag-sensor.d.ts.map +1 -1
  338. package/dist/solid/unstable/v2/{drag-sensor.js → drag-sensor.jsx} +2 -2
  339. package/dist/solid/unstable/v2/drag-sensor.jsx.map +1 -0
  340. package/dist/solid/unstable/v2/element.d.ts.map +1 -1
  341. package/dist/solid/unstable/v2/element.jsx +4 -2
  342. package/dist/solid/unstable/v2/element.jsx.map +1 -1
  343. package/dist/solid/unstable/v2/flights.d.ts +10 -0
  344. package/dist/solid/unstable/v2/flights.d.ts.map +1 -0
  345. package/dist/solid/unstable/v2/flights.js +63 -0
  346. package/dist/solid/unstable/v2/flights.js.map +1 -0
  347. package/dist/solid/unstable/v2/focus-sensor.d.ts +1 -1
  348. package/dist/solid/unstable/v2/focus-sensor.d.ts.map +1 -1
  349. package/dist/solid/unstable/v2/{focus-sensor.js → focus-sensor.jsx} +2 -2
  350. package/dist/solid/unstable/v2/focus-sensor.jsx.map +1 -0
  351. package/dist/solid/unstable/v2/hover-sensor.d.ts +1 -1
  352. package/dist/solid/unstable/v2/hover-sensor.d.ts.map +1 -1
  353. package/dist/solid/unstable/v2/{hover-sensor.js → hover-sensor.jsx} +2 -2
  354. package/dist/solid/unstable/v2/hover-sensor.jsx.map +1 -0
  355. package/dist/solid/unstable/v2/index.d.ts +14 -13
  356. package/dist/solid/unstable/v2/index.d.ts.map +1 -1
  357. package/dist/solid/unstable/v2/{index.js → index.jsx} +13 -12
  358. package/dist/solid/unstable/v2/index.jsx.map +1 -0
  359. package/dist/solid/unstable/v2/layout-projection.d.ts.map +1 -1
  360. package/dist/solid/unstable/v2/{layout-projection.js → layout-projection.jsx} +1 -1
  361. package/dist/solid/unstable/v2/layout-projection.jsx.map +1 -0
  362. package/dist/solid/unstable/v2/layout.jsx +1 -1
  363. package/dist/solid/unstable/v2/layout.jsx.map +1 -1
  364. package/dist/solid/unstable/v2/live-scroll.d.ts.map +1 -1
  365. package/dist/solid/unstable/v2/{live-scroll.js → live-scroll.jsx} +3 -3
  366. package/dist/solid/unstable/v2/live-scroll.jsx.map +1 -0
  367. package/dist/solid/unstable/v2/live-value.d.ts.map +1 -1
  368. package/dist/solid/unstable/v2/{live-value.js → live-value.jsx} +2 -2
  369. package/dist/solid/unstable/v2/live-value.jsx.map +1 -0
  370. package/dist/solid/unstable/v2/presence-hooks.d.ts.map +1 -1
  371. package/dist/solid/unstable/v2/{presence-hooks.js → presence-hooks.jsx} +1 -1
  372. package/dist/solid/unstable/v2/presence-hooks.jsx.map +1 -0
  373. package/dist/solid/unstable/v2/press-sensor.d.ts +1 -1
  374. package/dist/solid/unstable/v2/press-sensor.d.ts.map +1 -1
  375. package/dist/solid/unstable/v2/{press-sensor.js → press-sensor.jsx} +2 -2
  376. package/dist/solid/unstable/v2/press-sensor.jsx.map +1 -0
  377. package/dist/solid/unstable/v2/reorder.d.ts +7 -3
  378. package/dist/solid/unstable/v2/reorder.d.ts.map +1 -1
  379. package/dist/solid/unstable/v2/reorder.jsx +13 -7
  380. package/dist/solid/unstable/v2/reorder.jsx.map +1 -1
  381. package/dist/solid/unstable/v2/sensors.d.ts.map +1 -1
  382. package/dist/solid/unstable/v2/{sensors.js → sensors.jsx} +2 -2
  383. package/dist/solid/unstable/v2/sensors.jsx.map +1 -0
  384. package/dist/solid/unstable/v2/ward.d.ts.map +1 -1
  385. package/dist/solid/unstable/v2/ward.jsx +5 -3
  386. package/dist/solid/unstable/v2/ward.jsx.map +1 -1
  387. package/dist/solid/unstable/v2/wardic.jsx +1 -1
  388. package/dist/solid/unstable/v2/wardic.jsx.map +1 -1
  389. package/dist/solid/w.jsx +1 -1
  390. package/dist/solid/w.jsx.map +1 -1
  391. package/dist/solid/wardic.jsx +2 -2
  392. package/dist/solid/wardic.jsx.map +1 -1
  393. package/package.json +17 -17
  394. package/src/appear.ts +23 -3
  395. package/src/batch-appear-here.tsx +25 -0
  396. package/src/batch-gestures.ts +159 -0
  397. package/src/batch-handoff.ts +87 -0
  398. package/src/batch-reorder-group.tsx +497 -0
  399. package/src/batch-reorder-places.ts +257 -0
  400. package/src/batch-reorder.ts +764 -0
  401. package/src/batch.ts +3078 -0
  402. package/src/{bridge.ts → bridge.tsx} +3 -3
  403. package/src/config.ts +8 -3
  404. package/src/create-batch.tsx +219 -0
  405. package/src/create-ward.tsx +7 -4
  406. package/src/{drag-sensor.ts → drag-sensor.tsx} +1 -1
  407. package/src/drag-track.ts +21 -3
  408. package/src/{focus-sensor.ts → focus-sensor.tsx} +1 -1
  409. package/src/{hover-sensor.ts → hover-sensor.tsx} +1 -1
  410. package/src/imperative.ts +112 -11
  411. package/src/{index.ts → index.tsx} +37 -12
  412. package/src/layout-member.ts +28 -9
  413. package/src/layout.tsx +1 -1
  414. package/src/lazy-batch-gestures.ts +78 -0
  415. package/src/{live-scroll.ts → live-scroll.tsx} +1 -1
  416. package/src/{live-value.ts → live-value.tsx} +5 -5
  417. package/src/member-hold.ts +222 -0
  418. package/src/presence-controller.ts +147 -25
  419. package/src/presence-record.ts +9 -2
  420. package/src/{press-sensor.ts → press-sensor.tsx} +1 -1
  421. package/src/press.ts +2 -2
  422. package/src/reorder-input.ts +91 -4
  423. package/src/reorder-values.ts +20 -0
  424. package/src/reorder.tsx +16 -8
  425. package/src/{sensors.ts → sensors.tsx} +1 -1
  426. package/src/spine.ts +88 -3
  427. package/src/unstable/v2/batch-appear-here.tsx +24 -0
  428. package/src/unstable/v2/batch-reorder-group.tsx +385 -0
  429. package/src/unstable/v2/{bridge.ts → bridge.tsx} +3 -3
  430. package/src/unstable/v2/{create-animate.ts → create-animate.tsx} +7 -45
  431. package/src/unstable/v2/create-batch.tsx +265 -0
  432. package/src/unstable/v2/{drag-sensor.ts → drag-sensor.tsx} +1 -1
  433. package/src/unstable/v2/element.tsx +4 -2
  434. package/src/unstable/v2/flights.ts +65 -0
  435. package/src/unstable/v2/{focus-sensor.ts → focus-sensor.tsx} +1 -1
  436. package/src/unstable/v2/{hover-sensor.ts → hover-sensor.tsx} +1 -1
  437. package/src/unstable/v2/{index.ts → index.tsx} +40 -11
  438. package/src/unstable/v2/layout.tsx +1 -1
  439. package/src/unstable/v2/{live-scroll.ts → live-scroll.tsx} +2 -2
  440. package/src/unstable/v2/{live-value.ts → live-value.tsx} +5 -5
  441. package/src/unstable/v2/{press-sensor.ts → press-sensor.tsx} +1 -1
  442. package/src/unstable/v2/reorder.tsx +16 -8
  443. package/src/unstable/v2/{sensors.ts → sensors.tsx} +2 -2
  444. package/src/unstable/v2/ward.tsx +5 -2
  445. package/src/unstable/v2/wardic.tsx +1 -1
  446. package/src/w.tsx +1 -1
  447. package/src/wardic.tsx +2 -2
  448. package/dist/solid/bridge.js.map +0 -1
  449. package/dist/solid/complete.js.map +0 -1
  450. package/dist/solid/create-animate.js.map +0 -1
  451. package/dist/solid/directive.js.map +0 -1
  452. package/dist/solid/drag-sensor.js.map +0 -1
  453. package/dist/solid/drag.js.map +0 -1
  454. package/dist/solid/focus-sensor.js.map +0 -1
  455. package/dist/solid/hover-sensor.js.map +0 -1
  456. package/dist/solid/index.js.map +0 -1
  457. package/dist/solid/layout-projection.js.map +0 -1
  458. package/dist/solid/live-scroll.js.map +0 -1
  459. package/dist/solid/live-value.js.map +0 -1
  460. package/dist/solid/press-sensor.js.map +0 -1
  461. package/dist/solid/sensors.js.map +0 -1
  462. package/dist/solid/unstable/v2/bridge.js.map +0 -1
  463. package/dist/solid/unstable/v2/complete.js.map +0 -1
  464. package/dist/solid/unstable/v2/create-animate.js.map +0 -1
  465. package/dist/solid/unstable/v2/drag-sensor.js.map +0 -1
  466. package/dist/solid/unstable/v2/focus-sensor.js.map +0 -1
  467. package/dist/solid/unstable/v2/hover-sensor.js.map +0 -1
  468. package/dist/solid/unstable/v2/index.js.map +0 -1
  469. package/dist/solid/unstable/v2/layout-projection.js.map +0 -1
  470. package/dist/solid/unstable/v2/live-scroll.js.map +0 -1
  471. package/dist/solid/unstable/v2/live-value.js.map +0 -1
  472. package/dist/solid/unstable/v2/presence-hooks.js.map +0 -1
  473. package/dist/solid/unstable/v2/press-sensor.js.map +0 -1
  474. package/dist/solid/unstable/v2/sensors.js.map +0 -1
  475. /package/src/{complete.ts → complete.tsx} +0 -0
  476. /package/src/{create-animate.ts → create-animate.tsx} +0 -0
  477. /package/src/{directive.ts → directive.tsx} +0 -0
  478. /package/src/{drag.ts → drag.tsx} +0 -0
  479. /package/src/{layout-projection.ts → layout-projection.tsx} +0 -0
  480. /package/src/unstable/v2/{complete.ts → complete.tsx} +0 -0
  481. /package/src/unstable/v2/{layout-projection.ts → layout-projection.tsx} +0 -0
  482. /package/src/unstable/v2/{presence-hooks.ts → presence-hooks.tsx} +0 -0
@@ -44,6 +44,7 @@ import * as Effect from "effect/Effect"
44
44
  import type * as Fiber from "effect/Fiber"
45
45
  import { constFalse, constUndefined, constVoid, identity } from "effect/Function"
46
46
  import * as Option from "effect/Option"
47
+ import * as Iter from "effect/Iterable"
47
48
  import * as Predicate from "effect/Predicate"
48
49
  import * as Rec from "effect/Record"
49
50
  import * as UndefinedOr from "effect/UndefinedOr"
@@ -366,8 +367,12 @@ const parentElementOf = (placed: ReadonlyArray<Placed>): Element | undefined =>
366
367
  /**
367
368
  * The children in Motion's order for a change (#486, its `AnimatePresence`, #3746 there): `now`, with
368
369
  * each of `before`, the children as they were, leavers still exiting among them, that isn't in `now`
369
- * put back right after the staying child it followed, after the others put back there; first, when it
370
- * followed none.
370
+ * put back by Motion 14.9's arithmetic (#675). Walking `before`, each staying child sets the place to
371
+ * just after its own index in `now`, counting every leaver put back so far, and each leaver goes in
372
+ * there; first, while no staying child has set it. While the staying children keep their order, that's
373
+ * right after the staying child it followed, after the others put back there. Under a reorder it can
374
+ * be after a leaver put back after another child: `[a, b, c, d]`, b and d leaving, then `[c, a]`, is
375
+ * `[c, a, d, b]`, where "after the child it followed" would be `[c, d, a, b]`.
371
376
  */
372
377
  const orderOf = (before: ReadonlyArray<HTMLElement>, now: ReadonlyArray<HTMLElement>): ReadonlyArray<HTMLElement> => {
373
378
  const at = new Map(Arr.map(now, (el, i) => [el, i] as const))
@@ -382,20 +387,42 @@ const orderOf = (before: ReadonlyArray<HTMLElement>, now: ReadonlyArray<HTMLElem
382
387
  }
383
388
 
384
389
  /**
385
- * Where the leaver at `i` in `order` goes back (#486): right after the nearest child before it that's on
386
- * the page, or before the nearest one after it; where it was, with neither.
390
+ * Where a leaver goes back (#675), walking the order with a cursor: right after `cursor`, the element
391
+ * before it in the order, already in its place; with none before it, right before `anchor`, where the
392
+ * presence's children start; with neither, where it was. Each leaver is placed against one already in
393
+ * place, never against a leaver that isn't yet, as the nearest neighbour on the page might be (#561's
394
+ * P19).
387
395
  */
388
- const backPlaceOf = (placed: Placed, order: ReadonlyArray<HTMLElement>, i: number): Placed => {
389
- const before = Arr.findLast(Arr.take(order, i), (el) => el.isConnected)
390
- const after = Arr.findFirst(Arr.drop(order, i + 1), (el) => el.isConnected)
391
- return Option.match(before, {
392
- onSome: (el) => ({ el: placed.el, parent: Option.getOrUndefined(Option.fromNullOr(el.parentNode)), next: Option.getOrUndefined(Option.fromNullOr(el.nextSibling)) }),
393
- onNone: () =>
394
- Option.match(after, {
395
- onSome: (el) => ({ el: placed.el, parent: Option.getOrUndefined(Option.fromNullOr(el.parentNode)), next: el }),
396
- onNone: () => placed,
396
+ const backPlaceOf = (placed: Placed, cursor: HTMLElement | undefined, anchor: ChildNode | undefined): Placed =>
397
+ UndefinedOr.match(cursor, {
398
+ onDefined: (at) => ({ ...placedOf(at), el: placed.el }),
399
+ onUndefined: () =>
400
+ UndefinedOr.match(anchor, {
401
+ onDefined: (at) => ({ el: placed.el, parent: Option.getOrUndefined(Option.fromNullOr(at.parentNode)), next: at }),
402
+ onUndefined: () => placed,
397
403
  }),
398
404
  })
405
+
406
+ /**
407
+ * Whether a leaver from an earlier change is at its place already (#675), so a change that doesn't
408
+ * move it leaves it be (its focus, and anything a removal would restart): the next element after
409
+ * `cursor`, text between them left be; with none, the anchor itself, the first of the order on the
410
+ * page; with neither, on the page.
411
+ */
412
+ const isInPlace = (el: HTMLElement, cursor: HTMLElement | undefined, anchor: ChildNode | undefined): boolean =>
413
+ UndefinedOr.match(cursor, {
414
+ onDefined: (at) => at.nextElementSibling === el,
415
+ onUndefined: () =>
416
+ UndefinedOr.match(anchor, {
417
+ onDefined: (at) => at === el,
418
+ onUndefined: () => Predicate.isNotNull(el.parentNode),
419
+ }),
420
+ })
421
+
422
+ /** Whether a node is there and on the page. */
423
+ const isOnPage = (node: ChildNode | undefined): node is ChildNode => {
424
+ if (Predicate.isUndefined(node)) return false
425
+ return node.isConnected
399
426
  }
400
427
 
401
428
  /** Put a retained node back into the parent it left: before its old next sibling while that's still there, else at the end. */
@@ -602,6 +629,8 @@ export const makePresence = (options: PresenceOptions): PresenceController => {
602
629
 
603
630
  // The presence hooks registered (#277's PR 5b), each told at its child's leave.
604
631
  const watches = new Set<PresenceWatch>()
632
+ // The hooks each leaving child told it left, while its exit runs: told if it's cut short (#665, Q46).
633
+ const toldHooks = new Map<HTMLElement, ReadonlyArray<PresenceWatch>>()
605
634
 
606
635
  // The children `mode="wait"` holds off the page now (#277), and the start of each ward inside one,
607
636
  // by its element, called once the child is on the page.
@@ -611,6 +640,9 @@ export const makePresence = (options: PresenceOptions): PresenceController => {
611
640
  // and kept until it's gone. Whether this change popped one, so the projection is told.
612
641
  const pops = new Map<HTMLElement, PopBox>()
613
642
  let popped = false
643
+ // Whether this change moved a leaver from an earlier one to its place (#675), so the projection is
644
+ // told: a twin leaver crossfading in the flow is drawn on its Lead from where it now is.
645
+ let moved = false
614
646
 
615
647
  // Keys (#286, ADR-0048): each Wardic element made under this presence, told as it's made, so a
616
648
  // child's key is known before what goes on the page is decided.
@@ -682,6 +714,7 @@ export const makePresence = (options: PresenceOptions): PresenceController => {
682
714
  blocksInitial: () => options.initial() === false && firstRender,
683
715
  watch: (watch) => {
684
716
  watches.add(watch)
717
+ watchesWithin = undefined
685
718
  },
686
719
  hold: (el, start) => {
687
720
  if (Bool.not(isHeld(el))) return undefined
@@ -712,6 +745,7 @@ export const makePresence = (options: PresenceOptions): PresenceController => {
712
745
  // in-flight fiber bookkeeping. Idempotent. `completed`: its exit ended on its own (#257).
713
746
  const finishExit = (el: HTMLElement, completed = true): void => {
714
747
  exiting.delete(el)
748
+ toldHooks.delete(el)
715
749
  registry.delete(el)
716
750
  draws.delete(el)
717
751
  crossfades.delete(el)
@@ -763,6 +797,14 @@ export const makePresence = (options: PresenceOptions): PresenceController => {
763
797
  // Told first, as interrupted: the exit's fiber, interrupted below, ends at once through
764
798
  // `partDone`, which would tell it completed (#257).
765
799
  leaveEnds(el, false)
800
+ // The hooks it told it left hear it was cut short (#665, Q46).
801
+ const hooks = toldHooks.get(el)
802
+ toldHooks.delete(el)
803
+ if (Predicate.isNotUndefined(hooks)) {
804
+ Arr.forEach(hooks, (watch) => {
805
+ if (Predicate.isNotUndefined(watch.interrupted)) watch.interrupted()
806
+ })
807
+ }
766
808
  const fiber = exiting.get(el)
767
809
  if (Predicate.isNotUndefined(fiber)) {
768
810
  debug("exit: interrupt")
@@ -1107,6 +1149,51 @@ export const makePresence = (options: PresenceOptions): PresenceController => {
1107
1149
  UndefinedOr.map(placed.parent, (parent) => reinsert(placed.el, parent, placed.next))
1108
1150
  }
1109
1151
 
1152
+ /**
1153
+ * Every leaver at its place in `order` (#675), walking it with a cursor: a child that stays is where
1154
+ * its framework put it, and each leaver goes right after the element before it in the order, this
1155
+ * change's as they leave, an earlier change's moved there. A framework moves its own nodes around a
1156
+ * leaver it doesn't know of: Solid's swap of `[a, c]` puts `c` before `a`'s next sibling, the leaver
1157
+ * between them. So each change places them all again, as Motion's presence renders every exiting child
1158
+ * at its place.
1159
+ */
1160
+ const placeLeavers = (order: ReadonlyArray<HTMLElement>, kept: ReadonlySet<HTMLElement>, gone: ReadonlyMap<HTMLElement, Placed>): void => {
1161
+ const anchor = anchorOf(order, gone)
1162
+ Arr.reduce<HTMLElement, HTMLElement | undefined>(order, undefined, (cursor, el) => {
1163
+ UndefinedOr.match(gone.get(el), {
1164
+ onDefined: (placed) => left(placed, backPlaceOf(placed, cursor, anchor)),
1165
+ onUndefined: () => {
1166
+ if (Bool.not(kept.has(el))) moveBack(el, cursor, anchor)
1167
+ },
1168
+ })
1169
+ return Bool.match(el.isConnected, { onTrue: () => el, onFalse: () => cursor })
1170
+ })
1171
+ }
1172
+
1173
+ /**
1174
+ * Where the presence's children start, for the leavers no element precedes in the order (#675): the
1175
+ * first element of the order on the page as the walk starts, a child that stays or an earlier
1176
+ * change's leaver. With none, where they ended: the node after one of them at its last place, still on
1177
+ * the page. Solid empties a list beside a sibling around its leavers, its own nodes gone, and that's
1178
+ * the sibling. With neither, `undefined`: nothing of theirs is left, as when Solid clears the parent.
1179
+ */
1180
+ const anchorOf = (order: ReadonlyArray<HTMLElement>, gone: ReadonlyMap<HTMLElement, Placed>): ChildNode | undefined =>
1181
+ Option.getOrUndefined(Option.orElse(Arr.findFirst(order, isOnPage), () => Arr.findFirst(Arr.map(order, (el) => lastNextOf(el, gone)), isOnPage)))
1182
+
1183
+ /** The node after a child at its last place: as the last change left it, or, an earlier leaver, as it left. */
1184
+ const lastNextOf = (el: HTMLElement, gone: ReadonlyMap<HTMLElement, Placed>): ChildNode | undefined =>
1185
+ UndefinedOr.map(UndefinedOr.match(gone.get(el), { onDefined: identity, onUndefined: () => places.get(el) }), (placed) => placed.next)
1186
+
1187
+ /** A leaver from an earlier change, still retained, moved to its place in the walk (#675) unless it's there already. */
1188
+ const moveBack = (el: HTMLElement, cursor: HTMLElement | undefined, anchor: ChildNode | undefined): void => {
1189
+ if (isInPlace(el, cursor, anchor)) return
1190
+ UndefinedOr.map(places.get(el), (placed) => {
1191
+ const back = backPlaceOf(placed, cursor, anchor)
1192
+ UndefinedOr.map(back.parent, (parent) => reinsert(el, parent, back.next))
1193
+ moved = true
1194
+ })
1195
+ }
1196
+
1110
1197
  /** A child that left: retained at `back` (#486), and exiting, unless it's leaving already. */
1111
1198
  const left = (placed: Placed, back: Placed): void => {
1112
1199
  const el = placed.el
@@ -1189,9 +1276,33 @@ export const makePresence = (options: PresenceOptions): PresenceController => {
1189
1276
  leave(el, rec, customNow(), inside, holds)
1190
1277
  }
1191
1278
 
1192
- /** The presence hooks inside `el` (#277's PR 5b): those whose element it holds. */
1193
- const watchesIn = (el: HTMLElement): ReadonlyArray<PresenceWatch> =>
1194
- Arr.filter(Arr.fromIterable(watches), (watch) => UndefinedOr.match(watch.element(), { onUndefined: constFalse, onDefined: (at) => el.contains(at) }))
1279
+ /**
1280
+ * The presence hooks by each element they're inside, their own included: built once a change, as a
1281
+ * leaver's are first asked for, and again once a hook is added (#665, Q46). A hook dropped since is
1282
+ * left out as they're read.
1283
+ */
1284
+ // A scan of every hook for each leaver cost a change 12 ms at 1,000 Batch members, half of them leaving,
1285
+ // and 123 ms at 4,000 (against 1.1 and 2.8 with no presence).
1286
+ let watchesWithin: Map<Element, Array<PresenceWatch>> | undefined
1287
+
1288
+ /** `watch` under `at` and each element `at` is inside. */
1289
+ const indexUp = (index: Map<Element, Array<PresenceWatch>>, at: Element | null, watch: PresenceWatch): void => {
1290
+ if (Predicate.isNull(at)) return
1291
+ const known = index.get(at)
1292
+ if (Predicate.isUndefined(known)) index.set(at, [watch])
1293
+ if (Predicate.isNotUndefined(known)) known.push(watch)
1294
+ indexUp(index, at.parentElement, watch)
1295
+ }
1296
+
1297
+ /** The presence hooks inside `el` (#277's PR 5b): those whose element it holds, in the order they were added. */
1298
+ const watchesIn = (el: HTMLElement): ReadonlyArray<PresenceWatch> => {
1299
+ if (Predicate.isUndefined(watchesWithin)) {
1300
+ const index = new Map<Element, Array<PresenceWatch>>()
1301
+ Iter.forEach(watches, (watch) => UndefinedOr.map(watch.element(), (at) => indexUp(index, at, watch)))
1302
+ watchesWithin = index
1303
+ }
1304
+ return Arr.filter(UndefinedOr.match(watchesWithin.get(el), { onUndefined: (): ReadonlyArray<PresenceWatch> => [], onDefined: identity }), (watch) => watches.has(watch))
1305
+ }
1195
1306
 
1196
1307
  /**
1197
1308
  * Tell the hooks inside a leaving child it left (#277's PR 5b), with the presence's `custom`. With
@@ -1200,13 +1311,20 @@ export const makePresence = (options: PresenceOptions): PresenceController => {
1200
1311
  */
1201
1312
  const tellLeave = (el: HTMLElement, inside: ReadonlyArray<PresenceWatch>, counted: boolean): void => {
1202
1313
  const custom = customNow()
1314
+ if (Bool.and(counted, inside.length > 0)) toldHooks.set(el, inside)
1203
1315
  Arr.forEach(inside, (watch) => {
1204
1316
  watches.delete(watch)
1205
1317
  let released = false
1206
- const release = (): void => {
1318
+ // `release(false)`: its exit cut short, the child gone at once, uncompleted (#665, Q46).
1319
+ const release = (completed = true): void => {
1207
1320
  if (released) return
1208
1321
  released = true
1209
- if (Bool.and(counted, watch.holds)) partDone(el)
1322
+ if (Bool.not(Bool.and(counted, watch.holds))) return
1323
+ if (Bool.and(Bool.not(completed), pending.has(el))) {
1324
+ interruptExit(el)
1325
+ return
1326
+ }
1327
+ partDone(el)
1210
1328
  }
1211
1329
  try {
1212
1330
  watch.leave(custom, release)
@@ -1338,6 +1456,8 @@ export const makePresence = (options: PresenceOptions): PresenceController => {
1338
1456
  }
1339
1457
 
1340
1458
  const present = (current: unknown): void => {
1459
+ // Its hooks' elements may have moved since the last change: indexed again as they're asked for.
1460
+ watchesWithin = undefined
1341
1461
  const now = elementsOf(current)
1342
1462
  const kept = new Set(now)
1343
1463
  // A child entering pushes its siblings (#442): not on the page at the last change, the first one
@@ -1352,14 +1472,13 @@ export const makePresence = (options: PresenceOptions): PresenceController => {
1352
1472
  })
1353
1473
  settleTakeovers()
1354
1474
  }
1355
- // The children that left go back in Motion's order (#486): each right after the staying child it
1356
- // followed before the change, after the leavers back there already; first, when it followed none.
1357
- // Leavers from earlier changes, still exiting, keep their places in it.
1475
+ // The children that left go back in Motion's order (#486), and every leaver from an earlier change,
1476
+ // still exiting, keeps its place in it (#675), one a framework took out (a list emptied) too.
1358
1477
  const gone = new Map(Arr.map(Arr.filter(previous, (placed) => Bool.and(Bool.not(kept.has(placed.el)), Bool.not(takenOver.has(placed.el)))), (placed) => [placed.el, placed] as const))
1359
- const before = Arr.filter(rendered, (el) => Bool.or(Bool.or(kept.has(el), gone.has(el)), Bool.and(el.isConnected, Bool.not(takenOver.has(el)))))
1478
+ const before = Arr.filter(rendered, (el) => Bool.or(Bool.or(kept.has(el), gone.has(el)), Bool.and(Bool.or(el.isConnected, places.has(el)), Bool.not(takenOver.has(el)))))
1360
1479
  const listed = new Set(before)
1361
1480
  const order = orderOf(Arr.appendAll(before, Arr.filter(Arr.map(previous, (placed) => placed.el), (el) => Bool.not(listed.has(el)))), now)
1362
- Arr.forEach(order, (el, i) => UndefinedOr.map(gone.get(el), (placed) => left(placed, backPlaceOf(placed, order, i))))
1481
+ placeLeavers(order, kept, gone)
1363
1482
  rendered = Arr.filter(order, (el) => el.isConnected)
1364
1483
  // A child still exiting that the framework took out since (a list emptied) goes back too.
1365
1484
  Arr.forEach(Arr.fromIterable(places.values()), putBack)
@@ -1371,9 +1490,11 @@ export const makePresence = (options: PresenceOptions): PresenceController => {
1371
1490
  Arr.forEach(Arr.fromIterable(registry.keys()), dropDetached)
1372
1491
  Arr.forEach(Arr.fromIterable(watches), dropDetachedWatch)
1373
1492
  // A popped leaver moved its siblings (#277), and so did a child entering (#442): a `layout` one
1374
- // animates into the space, as Motion's presence re-renders its children then.
1375
- if (Bool.and(Bool.or(popped, entered), affectsLayout())) projection.notify()
1493
+ // animates into the space, as Motion's presence re-renders its children then. A leaver moved to its
1494
+ // place (#675) moved itself and them.
1495
+ if (Bool.and(Bool.or(Bool.or(popped, entered), moved), affectsLayout())) projection.notify()
1376
1496
  popped = false
1497
+ moved = false
1377
1498
  // The wards inside the children held until now start, the children on the page (#277). Held
1378
1499
  // children go on together, so none is left held then. (A ward started while its child is held
1379
1500
  // would only wait again: the check saves its re-run.)
@@ -1411,6 +1532,7 @@ export const makePresence = (options: PresenceOptions): PresenceController => {
1411
1532
  )
1412
1533
 
1413
1534
  const shown = (resolved: unknown): unknown => {
1535
+ watchesWithin = undefined
1414
1536
  const mode = modeNow()
1415
1537
  // `popLayout` (#277): each child leaving in this change is measured where it is, before the change
1416
1538
  // moves it, as Motion's `getSnapshotBeforeUpdate`.
@@ -167,11 +167,18 @@ export interface PresenceWatch {
167
167
  readonly holds: boolean
168
168
  /**
169
169
  * Its child left: called once, with the node back in place (or popped, `mode="popLayout"`), with
170
- * the presence's `custom`, and `release`, which lets the child go once it holds it.
170
+ * the presence's `custom`, and `release`, which lets the child go once it holds it. `release(false)`
171
+ * cuts the child's exit short: it goes at once, uncompleted, as a child taken over does (#286).
171
172
  */
172
- readonly leave: (custom: unknown, release: () => void) => void
173
+ readonly leave: (custom: unknown, release: (completed?: boolean) => void) => void
173
174
  /** Its child went some other way, or the presence did: it's dropped, with no leave. */
174
175
  readonly gone: () => void
176
+ /**
177
+ * Its child's exit, once it was told it left, was cut short: the child is gone, uncompleted (a
178
+ * take-over, the presence going). Optional: left out, it isn't told.
179
+ */
180
+ // #665, Q46: a keyed Batch's member mid-exit stops waiting on it.
181
+ readonly interrupted?: () => void
175
182
  }
176
183
 
177
184
  /** Whether `presence` holds an element setting up now at its `animate` ({@link PresenceContextValue.blocksInitial}). */
@@ -5,7 +5,7 @@
5
5
  * @module
6
6
  */
7
7
  import type { Accessor } from "solid-js"
8
- import { watchToSignal } from "./bridge.ts"
8
+ import { watchToSignal } from "./bridge.tsx"
9
9
  import type { Feature } from "./feature.ts"
10
10
  import { press } from "./features/press.ts"
11
11
  import { PressGesture } from "./features/keys.ts"
package/src/press.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  import type * as InputFeed from "@wardic/core/InputFeed"
9
9
  import type * as InputSource from "@wardic/core/InputSource"
10
10
  import * as Recognizer from "@wardic/core/Recognizer"
11
- import * as DomInput from "@wardic/dom/DomInput"
11
+ import * as KeyboardPress from "@wardic/dom/KeyboardPress"
12
12
  import * as Bool from "effect/Boolean"
13
13
  import * as Effect from "effect/Effect"
14
14
  import { constTrue, type LazyArg } from "effect/Function"
@@ -34,7 +34,7 @@ export const watchPressOn = (
34
34
  ): Effect.Effect<void, never, Scope.Scope | InputSource.InputSource> =>
35
35
  Effect.andThen(
36
36
  Effect.sync(() => {
37
- if (Bool.not(keysTaken)) DomInput.makeFocusable(element)
37
+ if (Bool.not(keysTaken)) KeyboardPress.makeFocusable(element)
38
38
  }),
39
39
  Recognizer.watchPress(element, handlers, { keys: Bool.not(keysTaken), propagate: propagates }),
40
40
  )
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * A Reorder item's input (ADR-0037), Solid-free (#379): its keys, blurs and presses told to its driver
3
3
  * by watches while a Scope is open, each inside its event, with no fiber at rest. Both bindings run it
4
- * in the item's watch Scope (ADR-0055, *Amendment (#379)*).
4
+ * in the item's watch Scope (ADR-0055, *Amendment (#379)*). A Batch Reorder group's items (#712) are
5
+ * heard through the feeds over them instead, with no listener per item at rest.
5
6
  *
6
7
  * @module
7
8
  */
@@ -11,7 +12,11 @@ import type * as ReorderController from "@wardic/dom/ReorderController"
11
12
  import * as Report from "@wardic/dom/Report"
12
13
  import * as Bool from "effect/Boolean"
13
14
  import * as Effect from "effect/Effect"
15
+ import * as Iter from "effect/Iterable"
16
+ import type * as Option from "effect/Option"
17
+ import * as Predicate from "effect/Predicate"
14
18
  import type * as Scope from "effect/Scope"
19
+ import * as UndefinedOr from "effect/UndefinedOr"
15
20
 
16
21
  /** A Primary pointer's down: a press the driver hears. */
17
22
  const isPress = (event: InputSource.PointerLikeEvent): boolean => Bool.and(event.type === "down", InputSource.isPrimaryPointer(event))
@@ -30,9 +35,7 @@ export const watchItemInput = (
30
35
  fork: (effect: Effect.Effect<void>) => void,
31
36
  onDefect: InputFeed.OnDefect,
32
37
  ): Effect.Effect<void, never, Scope.Scope | InputSource.InputSource> => {
33
- const judgeBlur = Effect.andThen(Effect.yieldNow, Effect.sync(() => driver.onBlur())).pipe(
34
- Effect.catchCause((cause) => Report.failure("wardic.reorder: judging an item's blur failed", cause)),
35
- )
38
+ const judgeBlur = judgedBlurOf(driver)
36
39
  return Effect.gen(function* () {
37
40
  const input = yield* InputSource.InputSource
38
41
  yield* InputFeed.watch(input.keyboard(el), { on: (event) => driver.onKey(event), onDefect })
@@ -51,3 +54,87 @@ export const watchItemInput = (
51
54
  })
52
55
  })
53
56
  }
57
+
58
+ /** A blur judged after this task's own work, one scheduler hop on (#318); a judging that fails reported. */
59
+ const judgedBlurOf = (driver: ReorderController.ItemDriver): Effect.Effect<void> =>
60
+ Effect.andThen(Effect.yieldNow, Effect.sync(() => driver.onBlur())).pipe(
61
+ Effect.catchCause((cause) => Report.failure("wardic.reorder: judging an item's blur failed", cause)),
62
+ )
63
+
64
+ /** An InputSource's feed over many targets, or a defect naming it. */
65
+ const amongOf = <A>(feed: A | undefined, name: string): Effect.Effect<A> =>
66
+ UndefinedOr.match(feed, {
67
+ onUndefined: () => Effect.die(new Error(`wardic.reorder: the Environment's InputSource has no \`${name}\`, which a Batch Reorder group's items need`)),
68
+ onDefined: Effect.succeed,
69
+ })
70
+
71
+ /** What a Batch Reorder group's items' input is told to: each item's driver, and its presses (#712). */
72
+ export interface ItemsInputHandlers {
73
+ /** The driver of the item a target is, `undefined` for an item gone. */
74
+ readonly driverOf: (target: unknown) => ReorderController.ItemDriver | undefined
75
+ /** A Primary pointer went down on an item, after its driver heard it: the group's grab. */
76
+ readonly onPress: (target: unknown) => void
77
+ /** That press ended, released or cancelled, wherever it was. */
78
+ readonly onPressEnd: (target: unknown) => void
79
+ /** Runs a blur's judging, one scheduler hop on. */
80
+ readonly fork: (effect: Effect.Effect<void>) => void
81
+ readonly onDefect: InputFeed.OnDefect
82
+ }
83
+
84
+ /** A Primary pointer's release or cancel: a press's end the group hears. */
85
+ const isPressEnd = (event: InputSource.PointerLikeEvent): boolean => Bool.and(Bool.or(event.type === "up", event.type === "cancel"), InputSource.isPrimaryPointer(event))
86
+
87
+ /**
88
+ * Watch a Batch Reorder group's items' keys, blurs and presses (#712, ADR-0072 decision 7, Q28) while the
89
+ * Scope is open, through the feeds over them: focus heard by `focusAmong`, and a focused item's own keys
90
+ * from its focus to its blur, as a Batch's press watch holds them (#460); presses by `pointerAmong`. So at
91
+ * rest no item listens. `memberOf` names the item a node is. Blurs are judged as {@link watchItemInput}'s are.
92
+ */
93
+ export const watchItemsInputAmong: (
94
+ memberOf: (node: unknown) => Option.Option<unknown>,
95
+ handlers: ItemsInputHandlers,
96
+ ) => Effect.Effect<void, never, Scope.Scope | InputSource.InputSource> = Effect.fnUntraced(function* (memberOf: (node: unknown) => Option.Option<unknown>, handlers: ItemsInputHandlers) {
97
+ const input = yield* InputSource.InputSource
98
+ const focusAmong = yield* amongOf(input.focusAmong, "focusAmong")
99
+ const pointerAmong = yield* amongOf(input.pointerAmong, "pointerAmong")
100
+ const { driverOf, onDefect } = handlers
101
+ // The focused items' keys, each open from its focus to its blur.
102
+ const focusedKeys = new Map<unknown, InputFeed.Switch>()
103
+ const closeKeys = (target: unknown): void => {
104
+ UndefinedOr.map(focusedKeys.get(target), (keysNow) => keysNow.close())
105
+ focusedKeys.delete(target)
106
+ }
107
+ const openKeys = (target: unknown): void => {
108
+ if (focusedKeys.has(target)) return
109
+ const driver = driverOf(target)
110
+ if (Predicate.isUndefined(driver)) return
111
+ const keysNow = InputFeed.switched(input.keyboard(target), (event) => driver.onKey(event), onDefect)
112
+ focusedKeys.set(target, keysNow)
113
+ keysNow.open()
114
+ }
115
+ yield* Effect.addFinalizer(() =>
116
+ Effect.sync(() => {
117
+ Iter.forEach(focusedKeys.values(), (keysNow) => keysNow.close())
118
+ focusedKeys.clear()
119
+ })
120
+ )
121
+ yield* InputFeed.watch(focusAmong(memberOf), {
122
+ on: ({ target, event }) => {
123
+ if (event.type === "focus") return openKeys(target)
124
+ closeKeys(target)
125
+ // The item's own blur: one inside it (#439) leaves it focused.
126
+ if (event.fromTarget === false) return
127
+ UndefinedOr.map(driverOf(target), (driver) => handlers.fork(judgedBlurOf(driver)))
128
+ },
129
+ onDefect,
130
+ })
131
+ yield* InputFeed.watch(pointerAmong(memberOf), {
132
+ on: ({ target, event }) => {
133
+ if (isPressEnd(event)) return handlers.onPressEnd(target)
134
+ if (Bool.not(isPress(event))) return
135
+ UndefinedOr.map(driverOf(target), (driver) => driver.onPress())
136
+ handlers.onPress(target)
137
+ },
138
+ onDefect,
139
+ })
140
+ })
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A Reorder group's `values` as its group reads them (#721, ADR-0037 *Amendment (#721)*): a plain array as
3
+ * it is, and a store's order copied into one at each read. So a store changed in place reads as a new order,
4
+ * every check of the order sees a plain array, and a tracked read tracks each item, an untracked one none.
5
+ * Read fresh each time, not in a memo: a Solid 2 memo takes a hydration id the server's group doesn't, and
6
+ * read in a flush's cleanup it can still have the order before it.
7
+ *
8
+ * @module
9
+ */
10
+ import * as Arr from "effect/Array"
11
+
12
+ /**
13
+ * `values` as a plain array: a copy when it's a store's, `proxy` the binding's Solid's store marker. Read at
14
+ * each drag sample (core's crossover), so it builds nothing to decide.
15
+ */
16
+ export const plainOrder = <V>(values: ReadonlyArray<V>, proxy: symbol): ReadonlyArray<V> => {
17
+ // Once an input event (#721): statements.
18
+ if (proxy in values) return Arr.copy(values)
19
+ return values
20
+ }
package/src/reorder.tsx CHANGED
@@ -41,6 +41,7 @@ import * as Predicate from "effect/Predicate"
41
41
  import * as Scope from "effect/Scope"
42
42
  import * as UndefinedOr from "effect/UndefinedOr"
43
43
  import {
44
+ $PROXY,
44
45
  type Accessor,
45
46
  type Component,
46
47
  createContext,
@@ -59,8 +60,9 @@ import {
59
60
  import { Dynamic } from "solid-js/web"
60
61
  import * as OwnerScope from "./owner-scope.ts"
61
62
  import { runWatch, useBrought, useWardicGate, useWardicRuntime } from "./provider.tsx"
62
- import { useLayoutServices } from "./layout-projection.ts"
63
+ import { useLayoutServices } from "./layout-projection.tsx"
63
64
  import { watchItemInput } from "./reorder-input.ts"
65
+ import { plainOrder } from "./reorder-values.ts"
64
66
  import type { Feature } from "./feature.ts"
65
67
  import { drag } from "./features/drag.ts"
66
68
  import { focus } from "./features/focus.ts"
@@ -81,6 +83,9 @@ import { useVariantContext } from "./variants.ts"
81
83
  import { configOfMotion, type WardicProps } from "./element.tsx"
82
84
  import { MOTION_PROPS, type WardicMotionProps } from "./motion-props.ts"
83
85
  import { w } from "./w.tsx"
86
+ import { BatchGroup, BatchItem } from "./batch-reorder-group.tsx"
87
+
88
+ export type { ReorderBatchGap, ReorderBatchGroupProps, ReorderBatchItemProps, ReorderBatchItemSize } from "./batch-reorder-group.tsx"
84
89
 
85
90
  /**
86
91
  * A Reorder group's config: its `values` in order, and `onReorder`, given each new order to set them
@@ -110,7 +115,7 @@ export interface ReorderGroupConfig<V> {
110
115
  */
111
116
  // A Reorder hold's end (#348).
112
117
  readonly onHoldEnd?: (end: ReorderController.HoldEnd<V>) => void
113
- /** The list's direction: `"y"`, a column, or `"x"`, a row. Left out, it's found from the items' boxes. */
118
+ /** 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. */
114
119
  readonly axis?: CoreReorder.Axis
115
120
  /** The keyboard reorder: on unless `false`. Off, the items have no keys, no tab stop and no instructions. */
116
121
  // ADR-0037.
@@ -206,6 +211,8 @@ export function createReorderGroup<V>(config: ReorderGroupConfig<V> | Accessor<R
206
211
  return serverReorderGroup(cfg)
207
212
  }
208
213
  const [detected, setDetected] = createSignal<CoreReorder.Axis>("y")
214
+ // The order as a plain array (#721): a store's copied, so a store changed in place is a new order.
215
+ const values = (): ReadonlyArray<V> => plainOrder(cfg().values, $PROXY)
209
216
  const runtime = useWardicRuntime()
210
217
  // The group's controller, over the provider's projection system and the Environment's channel to
211
218
  // assistive technology (ADR-0037), in a Scope of the group's own, closed on unmount (#132's PR 3),
@@ -214,7 +221,7 @@ export function createReorderGroup<V>(config: ReorderGroupConfig<V> | Accessor<R
214
221
  onCleanup(() => OwnerScope.close(runtime, scope, CLOSE_FAILED))
215
222
  const controller = runtime.runSync(
216
223
  ReorderController.make<V>({
217
- values: () => untrack(cfg).values,
224
+ values: () => untrack(values),
218
225
  onReorder: (values) => untrack(cfg).onReorder(values),
219
226
  onReorderEnd: (end) => UndefinedOr.map(untrack(cfg).onReorderEnd, (tell) => tell(end)),
220
227
  onHoldStart: (start) => UndefinedOr.map(untrack(cfg).onHoldStart, (tell) => tell(start)),
@@ -241,7 +248,7 @@ export function createReorderGroup<V>(config: ReorderGroupConfig<V> | Accessor<R
241
248
 
242
249
  // A `values` change re-measures, so the items animate to their new slots whoever
243
250
  // reordered them (as LayoutGroup's layoutDependency does).
244
- createEffect(on(() => cfg().values, () => controller.valuesChanged(), { defer: true }))
251
+ createEffect(on(values, () => controller.valuesChanged(), { defer: true }))
245
252
 
246
253
  const spread = (userProps: ReorderGroupUserProps = NO_GROUP_PROPS): ReorderGroupSpread => ({
247
254
  ref: mergeRefs(userProps.ref, (el: HTMLElement) => controller.attach(el)),
@@ -533,7 +540,7 @@ export type ReorderGroupProps<V, Tag extends ReorderElementTag = "ul"> = {
533
540
  readonly onHoldStart?: ((start: ReorderController.HoldStart<V>) => void) | undefined
534
541
  /** Called once as an item in hand is let go, however; after `onReorderEnd` when it moved. */
535
542
  readonly onHoldEnd?: ((end: ReorderController.HoldEnd<V>) => void) | undefined
536
- /** The list's direction: `"y"`, a column, or `"x"`, a row. Left out, it's found from the items' boxes. */
543
+ /** 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. */
537
544
  readonly axis?: CoreReorder.Axis | undefined
538
545
  /** The keyboard reorder: on unless `false`. */
539
546
  readonly keyboard?: boolean | undefined
@@ -696,7 +703,8 @@ function Item<V, Tag extends ReorderElementTag = "li">(props: ReorderItemProps<V
696
703
  /**
697
704
  * A list put in order by dragging its items, or from the keyboard: `Reorder.Group` and `Reorder.Item`.
698
705
  * Your app owns the order: the group takes it as `values`, and `onReorder` hands each new one back.
699
- * Motion's `Reorder`.
706
+ * Motion's `Reorder`. A long list of items of one size reorders as one Batch: `Reorder.BatchGroup` and
707
+ * `Reorder.BatchItem`.
700
708
  *
701
709
  * @example
702
710
  * <Reorder.Group values={items()} onReorder={setItems}>
@@ -704,5 +712,5 @@ function Item<V, Tag extends ReorderElementTag = "li">(props: ReorderItemProps<V
704
712
  * </Reorder.Group>
705
713
  * @see https://wardic.dev/reference/solid/reorder/reorder
706
714
  */
707
- // ADR-0020.
708
- export const Reorder = { Group, Item } as const
715
+ // ADR-0020; the Batch pair, ADR-0072 (#712).
716
+ export const Reorder = { Group, Item, BatchGroup, BatchItem } as const
@@ -21,7 +21,7 @@ import { constFalse } from "effect/Function"
21
21
  import * as Predicate from "effect/Predicate"
22
22
  import * as UndefinedOr from "effect/UndefinedOr"
23
23
  import { type Accessor, createComputed, createSignal, getOwner, runWithOwner, untrack } from "solid-js"
24
- import { fromAtom, watchToSignal } from "./bridge.ts"
24
+ import { fromAtom, watchToSignal } from "./bridge.tsx"
25
25
  import type { WardicViewport } from "./config.ts"
26
26
  import { inViewOptionsOf } from "./gesture-callbacks.ts"
27
27
  import { useWardicReducedMotionSetting, useWardicRuntime } from "./provider.tsx"