@wardic/solid 1.0.0 → 1.1.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 (510) hide show
  1. package/README.md +5 -2
  2. package/dist/browser/appear.js +42 -3
  3. package/dist/browser/appear.js.map +1 -1
  4. package/dist/browser/batch-handoff.js +2 -17
  5. package/dist/browser/batch-handoff.js.map +1 -1
  6. package/dist/browser/batch-reorder-group.js +40 -11
  7. package/dist/browser/batch-reorder-group.js.map +1 -1
  8. package/dist/browser/batch-reorder-places.js +517 -50
  9. package/dist/browser/batch-reorder-places.js.map +1 -1
  10. package/dist/browser/batch-reorder.js +284 -42
  11. package/dist/browser/batch-reorder.js.map +1 -1
  12. package/dist/browser/batch.js +4 -4
  13. package/dist/browser/batch.js.map +1 -1
  14. package/dist/browser/create-ward.js +28 -10
  15. package/dist/browser/create-ward.js.map +1 -1
  16. package/dist/browser/create-wardic.js +44 -0
  17. package/dist/browser/create-wardic.js.map +1 -0
  18. package/dist/browser/element.js +12 -3
  19. package/dist/browser/element.js.map +1 -1
  20. package/dist/browser/feature.js +57 -22
  21. package/dist/browser/feature.js.map +1 -1
  22. package/dist/browser/features/all.js +8 -0
  23. package/dist/browser/features/all.js.map +1 -1
  24. package/dist/browser/features/colors.js.map +1 -1
  25. package/dist/browser/features/dom-animation.js +8 -0
  26. package/dist/browser/features/dom-animation.js.map +1 -1
  27. package/dist/browser/features/dom-max.js +6 -0
  28. package/dist/browser/features/dom-max.js.map +1 -1
  29. package/dist/browser/features/drag.js.map +1 -1
  30. package/dist/browser/features/focus.js.map +1 -1
  31. package/dist/browser/features/hover.js.map +1 -1
  32. package/dist/browser/features/in-view.js.map +1 -1
  33. package/dist/browser/features/keys.js +6 -0
  34. package/dist/browser/features/keys.js.map +1 -1
  35. package/dist/browser/features/layout.js +14 -3
  36. package/dist/browser/features/layout.js.map +1 -1
  37. package/dist/browser/features/pan.js.map +1 -1
  38. package/dist/browser/features/press.js.map +1 -1
  39. package/dist/browser/features/scroll.js +10 -3
  40. package/dist/browser/features/scroll.js.map +1 -1
  41. package/dist/browser/features/timeline-keys.js +100 -0
  42. package/dist/browser/features/timeline-keys.js.map +1 -0
  43. package/dist/browser/imperative.js +182 -4
  44. package/dist/browser/imperative.js.map +1 -1
  45. package/dist/browser/index.js +2 -1
  46. package/dist/browser/index.js.map +1 -1
  47. package/dist/browser/instance-features.js +66 -0
  48. package/dist/browser/instance-features.js.map +1 -0
  49. package/dist/browser/layout-member.js +0 -2
  50. package/dist/browser/layout-member.js.map +1 -1
  51. package/dist/browser/layout-projection.js +8 -1
  52. package/dist/browser/layout-projection.js.map +1 -1
  53. package/dist/browser/layout.js +5 -6
  54. package/dist/browser/layout.js.map +1 -1
  55. package/dist/browser/live-scroll.js +29 -21
  56. package/dist/browser/live-scroll.js.map +1 -1
  57. package/dist/browser/live-style.js +10 -0
  58. package/dist/browser/live-style.js.map +1 -1
  59. package/dist/browser/live-value.js +11 -2
  60. package/dist/browser/live-value.js.map +1 -1
  61. package/dist/browser/member-hold.js +37 -7
  62. package/dist/browser/member-hold.js.map +1 -1
  63. package/dist/browser/messages.js +20 -0
  64. package/dist/browser/messages.js.map +1 -0
  65. package/dist/browser/presence-controller.js +136 -44
  66. package/dist/browser/presence-controller.js.map +1 -1
  67. package/dist/browser/presence-record.js.map +1 -1
  68. package/dist/browser/presence.js.map +1 -1
  69. package/dist/browser/provider.js +57 -11
  70. package/dist/browser/provider.js.map +1 -1
  71. package/dist/browser/reorder.js.map +1 -1
  72. package/dist/browser/runtime.js +15 -9
  73. package/dist/browser/runtime.js.map +1 -1
  74. package/dist/browser/scroll-values.js +46 -0
  75. package/dist/browser/scroll-values.js.map +1 -0
  76. package/dist/browser/spans-check.js +25 -0
  77. package/dist/browser/spans-check.js.map +1 -0
  78. package/dist/browser/spine.js +149 -207
  79. package/dist/browser/spine.js.map +1 -1
  80. package/dist/browser/timelines.js +9 -0
  81. package/dist/browser/timelines.js.map +1 -0
  82. package/dist/browser/unstable/v2/batch-reorder-group.js +36 -6
  83. package/dist/browser/unstable/v2/batch-reorder-group.js.map +1 -1
  84. package/dist/browser/unstable/v2/create-wardic.js +45 -0
  85. package/dist/browser/unstable/v2/create-wardic.js.map +1 -0
  86. package/dist/browser/unstable/v2/element.js +12 -2
  87. package/dist/browser/unstable/v2/element.js.map +1 -1
  88. package/dist/browser/unstable/v2/index.js +1 -0
  89. package/dist/browser/unstable/v2/index.js.map +1 -1
  90. package/dist/browser/unstable/v2/lifecycle.js +2 -0
  91. package/dist/browser/unstable/v2/lifecycle.js.map +1 -1
  92. package/dist/browser/unstable/v2/live-scroll.js +22 -13
  93. package/dist/browser/unstable/v2/live-scroll.js.map +1 -1
  94. package/dist/browser/unstable/v2/live-value.js +9 -1
  95. package/dist/browser/unstable/v2/live-value.js.map +1 -1
  96. package/dist/browser/unstable/v2/presence.js.map +1 -1
  97. package/dist/browser/unstable/v2/provider.js +60 -13
  98. package/dist/browser/unstable/v2/provider.js.map +1 -1
  99. package/dist/browser/unstable/v2/reorder.js.map +1 -1
  100. package/dist/browser/unstable/v2/w.js +7 -8
  101. package/dist/browser/unstable/v2/w.js.map +1 -1
  102. package/dist/browser/unstable/v2/ward.js +27 -9
  103. package/dist/browser/unstable/v2/ward.js.map +1 -1
  104. package/dist/browser/unstable/v2/wardic-instance.js +2 -0
  105. package/dist/browser/unstable/v2/wardic-instance.js.map +1 -0
  106. package/dist/browser/w.js +8 -9
  107. package/dist/browser/w.js.map +1 -1
  108. package/dist/browser/wardic-instance.js +2 -0
  109. package/dist/browser/wardic-instance.js.map +1 -0
  110. package/dist/server/appear.js +42 -3
  111. package/dist/server/appear.js.map +1 -1
  112. package/dist/server/batch-handoff.js +2 -17
  113. package/dist/server/batch-handoff.js.map +1 -1
  114. package/dist/server/batch-reorder-group.js +40 -11
  115. package/dist/server/batch-reorder-group.js.map +1 -1
  116. package/dist/server/batch-reorder-places.js +517 -50
  117. package/dist/server/batch-reorder-places.js.map +1 -1
  118. package/dist/server/batch-reorder.js +284 -42
  119. package/dist/server/batch-reorder.js.map +1 -1
  120. package/dist/server/batch.js +4 -4
  121. package/dist/server/batch.js.map +1 -1
  122. package/dist/server/create-ward.js +28 -10
  123. package/dist/server/create-ward.js.map +1 -1
  124. package/dist/server/create-wardic.js +44 -0
  125. package/dist/server/create-wardic.js.map +1 -0
  126. package/dist/server/element.js +12 -3
  127. package/dist/server/element.js.map +1 -1
  128. package/dist/server/feature.js +57 -22
  129. package/dist/server/feature.js.map +1 -1
  130. package/dist/server/features/all.js +8 -0
  131. package/dist/server/features/all.js.map +1 -1
  132. package/dist/server/features/colors.js.map +1 -1
  133. package/dist/server/features/dom-animation.js +8 -0
  134. package/dist/server/features/dom-animation.js.map +1 -1
  135. package/dist/server/features/dom-max.js +6 -0
  136. package/dist/server/features/dom-max.js.map +1 -1
  137. package/dist/server/features/drag.js.map +1 -1
  138. package/dist/server/features/focus.js.map +1 -1
  139. package/dist/server/features/hover.js.map +1 -1
  140. package/dist/server/features/in-view.js.map +1 -1
  141. package/dist/server/features/keys.js +6 -0
  142. package/dist/server/features/keys.js.map +1 -1
  143. package/dist/server/features/layout.js +14 -3
  144. package/dist/server/features/layout.js.map +1 -1
  145. package/dist/server/features/pan.js.map +1 -1
  146. package/dist/server/features/press.js.map +1 -1
  147. package/dist/server/features/scroll.js +10 -3
  148. package/dist/server/features/scroll.js.map +1 -1
  149. package/dist/server/features/timeline-keys.js +100 -0
  150. package/dist/server/features/timeline-keys.js.map +1 -0
  151. package/dist/server/imperative.js +182 -4
  152. package/dist/server/imperative.js.map +1 -1
  153. package/dist/server/index.js +2 -1
  154. package/dist/server/index.js.map +1 -1
  155. package/dist/server/instance-features.js +66 -0
  156. package/dist/server/instance-features.js.map +1 -0
  157. package/dist/server/layout-member.js +0 -2
  158. package/dist/server/layout-member.js.map +1 -1
  159. package/dist/server/layout-projection.js +8 -1
  160. package/dist/server/layout-projection.js.map +1 -1
  161. package/dist/server/layout.js +5 -6
  162. package/dist/server/layout.js.map +1 -1
  163. package/dist/server/live-scroll.js +29 -21
  164. package/dist/server/live-scroll.js.map +1 -1
  165. package/dist/server/live-style.js +10 -0
  166. package/dist/server/live-style.js.map +1 -1
  167. package/dist/server/live-value.js +11 -2
  168. package/dist/server/live-value.js.map +1 -1
  169. package/dist/server/member-hold.js +37 -7
  170. package/dist/server/member-hold.js.map +1 -1
  171. package/dist/server/messages.js +20 -0
  172. package/dist/server/messages.js.map +1 -0
  173. package/dist/server/presence-controller.js +136 -44
  174. package/dist/server/presence-controller.js.map +1 -1
  175. package/dist/server/presence-record.js.map +1 -1
  176. package/dist/server/presence.js.map +1 -1
  177. package/dist/server/provider.js +57 -11
  178. package/dist/server/provider.js.map +1 -1
  179. package/dist/server/reorder.js.map +1 -1
  180. package/dist/server/runtime.js +15 -9
  181. package/dist/server/runtime.js.map +1 -1
  182. package/dist/server/scroll-values.js +46 -0
  183. package/dist/server/scroll-values.js.map +1 -0
  184. package/dist/server/spans-check.js +25 -0
  185. package/dist/server/spans-check.js.map +1 -0
  186. package/dist/server/spine.js +149 -207
  187. package/dist/server/spine.js.map +1 -1
  188. package/dist/server/timelines.js +9 -0
  189. package/dist/server/timelines.js.map +1 -0
  190. package/dist/server/unstable/v2/batch-reorder-group.js +36 -6
  191. package/dist/server/unstable/v2/batch-reorder-group.js.map +1 -1
  192. package/dist/server/unstable/v2/create-wardic.js +45 -0
  193. package/dist/server/unstable/v2/create-wardic.js.map +1 -0
  194. package/dist/server/unstable/v2/element.js +12 -2
  195. package/dist/server/unstable/v2/element.js.map +1 -1
  196. package/dist/server/unstable/v2/index.js +1 -0
  197. package/dist/server/unstable/v2/index.js.map +1 -1
  198. package/dist/server/unstable/v2/lifecycle.js +2 -0
  199. package/dist/server/unstable/v2/lifecycle.js.map +1 -1
  200. package/dist/server/unstable/v2/live-scroll.js +22 -13
  201. package/dist/server/unstable/v2/live-scroll.js.map +1 -1
  202. package/dist/server/unstable/v2/live-value.js +9 -1
  203. package/dist/server/unstable/v2/live-value.js.map +1 -1
  204. package/dist/server/unstable/v2/presence.js.map +1 -1
  205. package/dist/server/unstable/v2/provider.js +60 -13
  206. package/dist/server/unstable/v2/provider.js.map +1 -1
  207. package/dist/server/unstable/v2/reorder.js.map +1 -1
  208. package/dist/server/unstable/v2/w.js +7 -8
  209. package/dist/server/unstable/v2/w.js.map +1 -1
  210. package/dist/server/unstable/v2/ward.js +27 -9
  211. package/dist/server/unstable/v2/ward.js.map +1 -1
  212. package/dist/server/unstable/v2/wardic-instance.js +2 -0
  213. package/dist/server/unstable/v2/wardic-instance.js.map +1 -0
  214. package/dist/server/w.js +8 -9
  215. package/dist/server/w.js.map +1 -1
  216. package/dist/server/wardic-instance.js +2 -0
  217. package/dist/server/wardic-instance.js.map +1 -0
  218. package/dist/solid/appear.d.ts +15 -2
  219. package/dist/solid/appear.d.ts.map +1 -1
  220. package/dist/solid/appear.js +43 -2
  221. package/dist/solid/appear.js.map +1 -1
  222. package/dist/solid/batch-handoff.d.ts.map +1 -1
  223. package/dist/solid/batch-handoff.js +2 -15
  224. package/dist/solid/batch-handoff.js.map +1 -1
  225. package/dist/solid/batch-reorder-group.d.ts +17 -15
  226. package/dist/solid/batch-reorder-group.d.ts.map +1 -1
  227. package/dist/solid/batch-reorder-group.jsx +37 -7
  228. package/dist/solid/batch-reorder-group.jsx.map +1 -1
  229. package/dist/solid/batch-reorder-places.d.ts +184 -23
  230. package/dist/solid/batch-reorder-places.d.ts.map +1 -1
  231. package/dist/solid/batch-reorder-places.js +397 -41
  232. package/dist/solid/batch-reorder-places.js.map +1 -1
  233. package/dist/solid/batch-reorder.d.ts +30 -1
  234. package/dist/solid/batch-reorder.d.ts.map +1 -1
  235. package/dist/solid/batch-reorder.js +298 -37
  236. package/dist/solid/batch-reorder.js.map +1 -1
  237. package/dist/solid/batch.d.ts.map +1 -1
  238. package/dist/solid/batch.js +4 -4
  239. package/dist/solid/batch.js.map +1 -1
  240. package/dist/solid/config.d.ts +141 -103
  241. package/dist/solid/config.d.ts.map +1 -1
  242. package/dist/solid/create-ward.d.ts +3 -1
  243. package/dist/solid/create-ward.d.ts.map +1 -1
  244. package/dist/solid/create-ward.jsx +29 -9
  245. package/dist/solid/create-ward.jsx.map +1 -1
  246. package/dist/solid/create-wardic.d.ts +24 -0
  247. package/dist/solid/create-wardic.d.ts.map +1 -0
  248. package/dist/solid/create-wardic.jsx +42 -0
  249. package/dist/solid/create-wardic.jsx.map +1 -0
  250. package/dist/solid/element.d.ts +26 -8
  251. package/dist/solid/element.d.ts.map +1 -1
  252. package/dist/solid/element.jsx +13 -5
  253. package/dist/solid/element.jsx.map +1 -1
  254. package/dist/solid/feature.d.ts +91 -3
  255. package/dist/solid/feature.d.ts.map +1 -1
  256. package/dist/solid/feature.js +48 -19
  257. package/dist/solid/feature.js.map +1 -1
  258. package/dist/solid/features/all.d.ts +9 -2
  259. package/dist/solid/features/all.d.ts.map +1 -1
  260. package/dist/solid/features/all.js +18 -1
  261. package/dist/solid/features/all.js.map +1 -1
  262. package/dist/solid/features/colors.d.ts +1 -1
  263. package/dist/solid/features/colors.d.ts.map +1 -1
  264. package/dist/solid/features/colors.js.map +1 -1
  265. package/dist/solid/features/dom-animation.d.ts +5 -2
  266. package/dist/solid/features/dom-animation.d.ts.map +1 -1
  267. package/dist/solid/features/dom-animation.js +8 -0
  268. package/dist/solid/features/dom-animation.js.map +1 -1
  269. package/dist/solid/features/dom-max.d.ts +2 -2
  270. package/dist/solid/features/dom-max.d.ts.map +1 -1
  271. package/dist/solid/features/dom-max.js +6 -0
  272. package/dist/solid/features/dom-max.js.map +1 -1
  273. package/dist/solid/features/drag.d.ts +1 -1
  274. package/dist/solid/features/drag.d.ts.map +1 -1
  275. package/dist/solid/features/drag.js.map +1 -1
  276. package/dist/solid/features/focus.d.ts +1 -1
  277. package/dist/solid/features/focus.d.ts.map +1 -1
  278. package/dist/solid/features/focus.js.map +1 -1
  279. package/dist/solid/features/hover.d.ts +1 -1
  280. package/dist/solid/features/hover.d.ts.map +1 -1
  281. package/dist/solid/features/hover.js.map +1 -1
  282. package/dist/solid/features/in-view.d.ts +1 -1
  283. package/dist/solid/features/in-view.d.ts.map +1 -1
  284. package/dist/solid/features/in-view.js.map +1 -1
  285. package/dist/solid/features/keys.d.ts +16 -1
  286. package/dist/solid/features/keys.d.ts.map +1 -1
  287. package/dist/solid/features/keys.js +7 -0
  288. package/dist/solid/features/keys.js.map +1 -1
  289. package/dist/solid/features/layout.d.ts +7 -1
  290. package/dist/solid/features/layout.d.ts.map +1 -1
  291. package/dist/solid/features/layout.js +14 -4
  292. package/dist/solid/features/layout.js.map +1 -1
  293. package/dist/solid/features/pan.d.ts +1 -1
  294. package/dist/solid/features/pan.d.ts.map +1 -1
  295. package/dist/solid/features/pan.js.map +1 -1
  296. package/dist/solid/features/press.d.ts +1 -1
  297. package/dist/solid/features/press.d.ts.map +1 -1
  298. package/dist/solid/features/press.js.map +1 -1
  299. package/dist/solid/features/scroll.d.ts +5 -3
  300. package/dist/solid/features/scroll.d.ts.map +1 -1
  301. package/dist/solid/features/scroll.js +12 -3
  302. package/dist/solid/features/scroll.js.map +1 -1
  303. package/dist/solid/features/timeline-keys.d.ts +7 -0
  304. package/dist/solid/features/timeline-keys.d.ts.map +1 -0
  305. package/dist/solid/features/timeline-keys.js +97 -0
  306. package/dist/solid/features/timeline-keys.js.map +1 -0
  307. package/dist/solid/imperative.d.ts +3 -3
  308. package/dist/solid/imperative.d.ts.map +1 -1
  309. package/dist/solid/imperative.js +146 -4
  310. package/dist/solid/imperative.js.map +1 -1
  311. package/dist/solid/index.d.ts +4 -2
  312. package/dist/solid/index.d.ts.map +1 -1
  313. package/dist/solid/index.jsx +2 -1
  314. package/dist/solid/index.jsx.map +1 -1
  315. package/dist/solid/instance-features.d.ts +7 -0
  316. package/dist/solid/instance-features.d.ts.map +1 -0
  317. package/dist/solid/instance-features.js +63 -0
  318. package/dist/solid/instance-features.js.map +1 -0
  319. package/dist/solid/layout-member.d.ts +0 -2
  320. package/dist/solid/layout-member.d.ts.map +1 -1
  321. package/dist/solid/layout-member.js +0 -2
  322. package/dist/solid/layout-member.js.map +1 -1
  323. package/dist/solid/layout-projection.d.ts +6 -0
  324. package/dist/solid/layout-projection.d.ts.map +1 -1
  325. package/dist/solid/layout-projection.jsx +8 -1
  326. package/dist/solid/layout-projection.jsx.map +1 -1
  327. package/dist/solid/layout.d.ts +4 -3
  328. package/dist/solid/layout.d.ts.map +1 -1
  329. package/dist/solid/layout.jsx +5 -6
  330. package/dist/solid/layout.jsx.map +1 -1
  331. package/dist/solid/live-scroll.d.ts +4 -0
  332. package/dist/solid/live-scroll.d.ts.map +1 -1
  333. package/dist/solid/live-scroll.jsx +29 -19
  334. package/dist/solid/live-scroll.jsx.map +1 -1
  335. package/dist/solid/live-style.d.ts +11 -0
  336. package/dist/solid/live-style.d.ts.map +1 -1
  337. package/dist/solid/live-style.js +10 -0
  338. package/dist/solid/live-style.js.map +1 -1
  339. package/dist/solid/live-value.d.ts +1 -0
  340. package/dist/solid/live-value.d.ts.map +1 -1
  341. package/dist/solid/live-value.jsx +12 -3
  342. package/dist/solid/live-value.jsx.map +1 -1
  343. package/dist/solid/member-hold.d.ts +5 -19
  344. package/dist/solid/member-hold.d.ts.map +1 -1
  345. package/dist/solid/member-hold.js +42 -7
  346. package/dist/solid/member-hold.js.map +1 -1
  347. package/dist/solid/messages.d.ts +20 -0
  348. package/dist/solid/messages.d.ts.map +1 -0
  349. package/dist/solid/messages.js +22 -0
  350. package/dist/solid/messages.js.map +1 -0
  351. package/dist/solid/presence-controller.d.ts +1 -1
  352. package/dist/solid/presence-controller.d.ts.map +1 -1
  353. package/dist/solid/presence-controller.js +125 -34
  354. package/dist/solid/presence-controller.js.map +1 -1
  355. package/dist/solid/presence-record.d.ts +3 -3
  356. package/dist/solid/presence-record.d.ts.map +1 -1
  357. package/dist/solid/presence-record.js.map +1 -1
  358. package/dist/solid/presence.d.ts +3 -1
  359. package/dist/solid/presence.d.ts.map +1 -1
  360. package/dist/solid/presence.jsx.map +1 -1
  361. package/dist/solid/provider.d.ts +17 -3
  362. package/dist/solid/provider.d.ts.map +1 -1
  363. package/dist/solid/provider.jsx +55 -7
  364. package/dist/solid/provider.jsx.map +1 -1
  365. package/dist/solid/reorder.d.ts +5 -4
  366. package/dist/solid/reorder.d.ts.map +1 -1
  367. package/dist/solid/reorder.jsx.map +1 -1
  368. package/dist/solid/runtime.d.ts +10 -2
  369. package/dist/solid/runtime.d.ts.map +1 -1
  370. package/dist/solid/runtime.js +15 -9
  371. package/dist/solid/runtime.js.map +1 -1
  372. package/dist/solid/scroll-values.d.ts +30 -0
  373. package/dist/solid/scroll-values.d.ts.map +1 -0
  374. package/dist/solid/scroll-values.js +44 -0
  375. package/dist/solid/scroll-values.js.map +1 -0
  376. package/dist/solid/spans-check.d.ts +4 -0
  377. package/dist/solid/spans-check.d.ts.map +1 -0
  378. package/dist/solid/spans-check.js +23 -0
  379. package/dist/solid/spans-check.js.map +1 -0
  380. package/dist/solid/spine.d.ts +144 -13
  381. package/dist/solid/spine.d.ts.map +1 -1
  382. package/dist/solid/spine.js +131 -183
  383. package/dist/solid/spine.js.map +1 -1
  384. package/dist/solid/timelines.d.ts +44 -0
  385. package/dist/solid/timelines.d.ts.map +1 -0
  386. package/dist/solid/timelines.js +10 -0
  387. package/dist/solid/timelines.js.map +1 -0
  388. package/dist/solid/unstable/v2/batch-reorder-group.d.ts +18 -17
  389. package/dist/solid/unstable/v2/batch-reorder-group.d.ts.map +1 -1
  390. package/dist/solid/unstable/v2/batch-reorder-group.jsx +32 -5
  391. package/dist/solid/unstable/v2/batch-reorder-group.jsx.map +1 -1
  392. package/dist/solid/unstable/v2/create-wardic.d.ts +25 -0
  393. package/dist/solid/unstable/v2/create-wardic.d.ts.map +1 -0
  394. package/dist/solid/unstable/v2/create-wardic.jsx +43 -0
  395. package/dist/solid/unstable/v2/create-wardic.jsx.map +1 -0
  396. package/dist/solid/unstable/v2/element.d.ts +52 -18
  397. package/dist/solid/unstable/v2/element.d.ts.map +1 -1
  398. package/dist/solid/unstable/v2/element.jsx +13 -4
  399. package/dist/solid/unstable/v2/element.jsx.map +1 -1
  400. package/dist/solid/unstable/v2/index.d.ts +3 -1
  401. package/dist/solid/unstable/v2/index.d.ts.map +1 -1
  402. package/dist/solid/unstable/v2/index.jsx +1 -0
  403. package/dist/solid/unstable/v2/index.jsx.map +1 -1
  404. package/dist/solid/unstable/v2/lifecycle.d.ts +29 -0
  405. package/dist/solid/unstable/v2/lifecycle.d.ts.map +1 -1
  406. package/dist/solid/unstable/v2/lifecycle.js +2 -0
  407. package/dist/solid/unstable/v2/lifecycle.js.map +1 -1
  408. package/dist/solid/unstable/v2/live-scroll.d.ts +4 -0
  409. package/dist/solid/unstable/v2/live-scroll.d.ts.map +1 -1
  410. package/dist/solid/unstable/v2/live-scroll.jsx +22 -11
  411. package/dist/solid/unstable/v2/live-scroll.jsx.map +1 -1
  412. package/dist/solid/unstable/v2/live-value.d.ts +1 -0
  413. package/dist/solid/unstable/v2/live-value.d.ts.map +1 -1
  414. package/dist/solid/unstable/v2/live-value.jsx +10 -1
  415. package/dist/solid/unstable/v2/live-value.jsx.map +1 -1
  416. package/dist/solid/unstable/v2/presence.d.ts +3 -1
  417. package/dist/solid/unstable/v2/presence.d.ts.map +1 -1
  418. package/dist/solid/unstable/v2/presence.jsx.map +1 -1
  419. package/dist/solid/unstable/v2/provider.d.ts +17 -3
  420. package/dist/solid/unstable/v2/provider.d.ts.map +1 -1
  421. package/dist/solid/unstable/v2/provider.jsx +58 -10
  422. package/dist/solid/unstable/v2/provider.jsx.map +1 -1
  423. package/dist/solid/unstable/v2/reorder.d.ts +4 -3
  424. package/dist/solid/unstable/v2/reorder.d.ts.map +1 -1
  425. package/dist/solid/unstable/v2/reorder.jsx.map +1 -1
  426. package/dist/solid/unstable/v2/w.d.ts +41 -10
  427. package/dist/solid/unstable/v2/w.d.ts.map +1 -1
  428. package/dist/solid/unstable/v2/w.jsx +5 -7
  429. package/dist/solid/unstable/v2/w.jsx.map +1 -1
  430. package/dist/solid/unstable/v2/ward.d.ts +15 -8
  431. package/dist/solid/unstable/v2/ward.d.ts.map +1 -1
  432. package/dist/solid/unstable/v2/ward.jsx +28 -8
  433. package/dist/solid/unstable/v2/ward.jsx.map +1 -1
  434. package/dist/solid/unstable/v2/wardic-instance.d.ts +47 -0
  435. package/dist/solid/unstable/v2/wardic-instance.d.ts.map +1 -0
  436. package/dist/solid/unstable/v2/wardic-instance.js +2 -0
  437. package/dist/solid/unstable/v2/wardic-instance.js.map +1 -0
  438. package/dist/solid/w.d.ts +24 -10
  439. package/dist/solid/w.d.ts.map +1 -1
  440. package/dist/solid/w.jsx +8 -7
  441. package/dist/solid/w.jsx.map +1 -1
  442. package/dist/solid/ward-keys.d.ts +22 -3
  443. package/dist/solid/ward-keys.d.ts.map +1 -1
  444. package/dist/solid/wardic-instance.d.ts +46 -0
  445. package/dist/solid/wardic-instance.d.ts.map +1 -0
  446. package/dist/solid/wardic-instance.js +2 -0
  447. package/dist/solid/wardic-instance.js.map +1 -0
  448. package/package.json +4 -4
  449. package/src/appear.ts +56 -2
  450. package/src/batch-handoff.ts +2 -16
  451. package/src/batch-reorder-group.tsx +47 -21
  452. package/src/batch-reorder-places.ts +566 -54
  453. package/src/batch-reorder.ts +333 -40
  454. package/src/batch.ts +4 -4
  455. package/src/config.ts +177 -123
  456. package/src/create-ward.tsx +32 -8
  457. package/src/create-wardic.tsx +45 -0
  458. package/src/element.tsx +52 -16
  459. package/src/feature.ts +157 -25
  460. package/src/features/all.ts +11 -2
  461. package/src/features/colors.ts +1 -1
  462. package/src/features/dom-animation.ts +2 -2
  463. package/src/features/dom-max.ts +1 -2
  464. package/src/features/drag.ts +1 -1
  465. package/src/features/focus.ts +1 -1
  466. package/src/features/hover.ts +1 -1
  467. package/src/features/in-view.ts +1 -1
  468. package/src/features/keys.ts +18 -1
  469. package/src/features/layout.ts +17 -5
  470. package/src/features/pan.ts +1 -1
  471. package/src/features/press.ts +1 -1
  472. package/src/features/scroll.ts +14 -4
  473. package/src/features/timeline-keys.ts +109 -0
  474. package/src/imperative.ts +168 -10
  475. package/src/index.tsx +6 -1
  476. package/src/instance-features.ts +88 -0
  477. package/src/layout-member.ts +0 -4
  478. package/src/layout-projection.tsx +10 -1
  479. package/src/layout.tsx +7 -6
  480. package/src/live-scroll.tsx +30 -22
  481. package/src/live-style.ts +21 -0
  482. package/src/live-value.tsx +12 -2
  483. package/src/member-hold.ts +45 -26
  484. package/src/messages.ts +27 -0
  485. package/src/presence-controller.ts +222 -106
  486. package/src/presence-record.ts +3 -3
  487. package/src/presence.tsx +3 -1
  488. package/src/provider.tsx +62 -7
  489. package/src/reorder.tsx +5 -4
  490. package/src/runtime.ts +17 -10
  491. package/src/scroll-values.ts +53 -0
  492. package/src/spans-check.ts +25 -0
  493. package/src/spine.ts +219 -187
  494. package/src/timelines.ts +46 -0
  495. package/src/unstable/v2/batch-reorder-group.tsx +42 -18
  496. package/src/unstable/v2/create-wardic.tsx +46 -0
  497. package/src/unstable/v2/element.tsx +85 -24
  498. package/src/unstable/v2/index.tsx +5 -0
  499. package/src/unstable/v2/lifecycle.ts +35 -0
  500. package/src/unstable/v2/live-scroll.tsx +22 -11
  501. package/src/unstable/v2/live-value.tsx +10 -0
  502. package/src/unstable/v2/presence.tsx +3 -1
  503. package/src/unstable/v2/provider.tsx +65 -9
  504. package/src/unstable/v2/reorder.tsx +9 -4
  505. package/src/unstable/v2/w.tsx +49 -13
  506. package/src/unstable/v2/ward.tsx +48 -13
  507. package/src/unstable/v2/wardic-instance.ts +50 -0
  508. package/src/w.tsx +33 -16
  509. package/src/ward-keys.ts +38 -17
  510. package/src/wardic-instance.ts +49 -0
@@ -4,17 +4,18 @@ import * as Arr from "effect/Array";
4
4
  import * as Bool from "effect/Boolean";
5
5
  import * as Equivalence from "effect/Equivalence";
6
6
  import { identity } from "effect/Function";
7
+ import * as Iter from "effect/Iterable";
7
8
  import * as Match from "effect/Match";
8
9
  import * as Predicate from "effect/Predicate";
9
10
  import * as Rec from "effect/Record";
10
11
  import * as UndefinedOr from "effect/UndefinedOr";
11
12
  import { fail } from "./batch.js";
12
- /** Whether two reads of a group's element are alike: the same direction and width. */
13
+ /** Whether two reads of a group's element are alike: the same direction, width, edges and padding. */
13
14
  export const sameRead = (a, b) => UndefinedOr.match(a, {
14
15
  onUndefined: () => Predicate.isUndefined(b),
15
16
  onDefined: x => UndefinedOr.match(b, {
16
17
  onUndefined: () => false,
17
- onDefined: y => Bool.and(x.direction === y.direction, x.width === y.width)
18
+ onDefined: y => Bool.every([x.direction === y.direction, x.width === y.width, x.edges.x === y.edges.x, x.edges.y === y.edges.y, x.padding === y.padding])
18
19
  })
19
20
  });
20
21
  /** A style's own `direction`, when it gives one: an app's on the group. */
@@ -52,8 +53,26 @@ export const geometryOf = (props, read) => ({
52
53
  width: UndefinedOr.match(read, {
53
54
  onUndefined: () => undefined,
54
55
  onDefined: r => r.width
56
+ }),
57
+ edges: UndefinedOr.match(read, {
58
+ onUndefined: () => NO_EDGES,
59
+ onDefined: r => r.edges
60
+ }),
61
+ padding: UndefinedOr.match(read, {
62
+ onUndefined: () => undefined,
63
+ onDefined: r => r.padding
55
64
  })
56
65
  });
66
+ /** No edges: a `content-box` group's, and a group's before its first read. */
67
+ const NO_EDGES = {
68
+ x: 0,
69
+ y: 0
70
+ };
71
+ /** No sizes read: a server's, and a client's before its first. */
72
+ export const NONE_READ = {
73
+ sizeOf: () => undefined,
74
+ arrived: false
75
+ };
57
76
  const ORIGIN = {
58
77
  x: 0,
59
78
  y: 0
@@ -67,6 +86,16 @@ const gapsOf = Match.type().pipe(Match.when(Predicate.isNumber, gap => ({
67
86
  x: gap,
68
87
  y: gap
69
88
  })), Match.orElse(gap => gap));
89
+ /** A geometry's gap on each axis: none when it gives none. */
90
+ const gapOf = geometry => UndefinedOr.match(geometry.gap, {
91
+ onUndefined: () => ORIGIN,
92
+ onDefined: gapsOf
93
+ });
94
+ /** The content width a group read of its element: 0 before it's read (a server's, a client's before its first read). */
95
+ const readWidthOf = geometry => UndefinedOr.match(geometry.width, {
96
+ onUndefined: () => 0,
97
+ onDefined: identity
98
+ });
70
99
  /** Whether a grid's `columns` is a whole number, 1 or more. */
71
100
  const isColumnCount = columns => Bool.and(Number.isInteger(columns), columns >= 1);
72
101
  /** A grid's given `columns`, checked. */
@@ -84,119 +113,557 @@ const columnsBy = Match.type().pipe(Match.when("y", () => () => 1), Match.when("
84
113
  onUndefined: () => columnsFitting(geometry.width, step, gap),
85
114
  onDefined: checkedColumns
86
115
  })));
87
- /** A grid whose columns come from its width: `"xy"` with no `columns`. */
116
+ /** A grid whose rows break at its width: `"xy"` with no `columns`, its items one size (Q36) or each their own (#714). */
88
117
  export const isFromWidth = geometry => Bool.and(geometry.axis === "xy", Predicate.isUndefined(geometry.columns));
89
- /** Whether a group's items are laid out in flow by CSS grid: its columns from a width it hasn't read. */
118
+ /** Whether a group's items are laid out in flow by CSS: its rows from a width it hasn't read. */
90
119
  export const inGridFlow = geometry => Bool.and(isFromWidth(geometry), Predicate.isUndefined(geometry.width));
120
+ /** Whether a group reads its items' sizes from the page: its `itemSize` left out (#714). */
121
+ export const readsSizes = geometry => Predicate.isUndefined(geometry.itemSize);
122
+ /**
123
+ * Whether a group's items are in flow, its first sizes `arrived` or not: a grid's width unread, or its items'
124
+ * sizes, read from the page (#714).
125
+ */
126
+ export const itemsInFlow = (geometry, arrived) => {
127
+ // Per element at mount, by the hot path's rules: statements.
128
+ if (inGridFlow(geometry)) return true;
129
+ return readsSizes(geometry) && !arrived;
130
+ };
131
+ /** Whether `places` are of items each their own size given by a function (#714): those written on their elements. */
132
+ export const writesSizes = places => Bool.and(Predicate.isNotUndefined(places.each), Bool.not(places.sizesRead));
91
133
  /** Each direction's way along a row: rightward, or leftward from the right edge. */
92
134
  const SIGN_X = {
93
135
  ltr: 1,
94
136
  rtl: -1
95
137
  };
96
- /** `geometry`'s places for `n` items: an error naming a grid's `columns` that isn't a whole number. */
97
- export const resolvePlaces = (geometry, n) => {
98
- const gap = UndefinedOr.match(geometry.gap, {
99
- onUndefined: () => ORIGIN,
100
- onDefined: gapsOf
101
- });
102
- const stepX = geometry.itemSize.width + gap.x;
138
+ /**
139
+ * `geometry`'s places for `values`: every item one size, each its own, a function's, or each its own as
140
+ * `read` from the page (#714). An error names a grid's `columns` that isn't a whole number.
141
+ */
142
+ export const resolvePlaces = (geometry, values, read = NONE_READ) => {
143
+ const itemSize = geometry.itemSize;
144
+ if (Predicate.isUndefined(itemSize)) return resolveRead(geometry, values, read);
145
+ if (Predicate.isFunction(itemSize)) return resolveEach(geometry, values, itemSize);
146
+ return resolveOne(geometry, values.length, itemSize);
147
+ };
148
+ /** Places for `n` items of one size, a column's width the group's when it gives none (#714, Q10): never read, 0 here. */
149
+ const resolveOne = (geometry, n, size) => {
150
+ const gap = gapOf(geometry);
151
+ const inFlow = inGridFlow(geometry);
152
+ const takesWidth = Predicate.isUndefined(size.width);
153
+ const itemSize = {
154
+ width: UndefinedOr.match(size.width, {
155
+ onUndefined: () => readWidthOf(geometry),
156
+ onDefined: identity
157
+ }),
158
+ height: size.height
159
+ };
160
+ const stepX = itemSize.width + gap.x;
103
161
  const columns = columnsBy(geometry.axis)(geometry, n, stepX, gap.x);
104
- const fromWidth = isFromWidth(geometry);
162
+ const appsWidth = Bool.or(isFromWidth(geometry), takesWidth);
105
163
  const used = Math.min(columns, Math.max(n, 1));
106
164
  const placesWidth = Bool.match(n === 0, {
107
165
  onTrue: () => 0,
108
- onFalse: () => (used - 1) * stepX + geometry.itemSize.width
166
+ onFalse: () => (used - 1) * stepX + itemSize.width
109
167
  });
110
168
  return {
111
169
  columns,
112
170
  stepX,
113
- stepY: geometry.itemSize.height + gap.y,
171
+ stepY: itemSize.height + gap.y,
114
172
  signX: SIGN_X[geometry.direction],
115
- itemSize: geometry.itemSize,
116
- width: Bool.match(fromWidth, {
173
+ itemSize,
174
+ width: Bool.match(appsWidth, {
117
175
  onTrue: () => UndefinedOr.match(geometry.width, {
118
176
  onUndefined: () => placesWidth,
119
177
  onDefined: identity
120
178
  }),
121
179
  onFalse: () => placesWidth
122
180
  }),
123
- fromWidth
181
+ appsWidth,
182
+ takesWidth,
183
+ each: undefined,
184
+ sizesRead: false,
185
+ inFlow,
186
+ groupWidth: groupWidthOf(geometry, inFlow)
124
187
  };
125
188
  };
126
- /** Whether two resolutions place every item alike. */
127
- export const samePlaces = (a, b) => Bool.every([a.columns === b.columns, a.stepX === b.stepX, a.stepY === b.stepY, a.signX === b.signX]);
128
- /** Item `i`'s place among `places`: its column and row, a step apart, from its static position. */
129
- export const placeOf = (places, i) => ({
130
- x: places.signX * (i % places.columns) * places.stepX,
131
- y: Math.floor(i / places.columns) * places.stepY
189
+ /** Places for `values`, each its own size, `sizeOf`'s (#714): laid out by the group's axis. */
190
+ const resolveEach = (geometry, values, sizeOf) => {
191
+ const inFlow = inGridFlow(geometry);
192
+ const widths = new Float64Array(values.length);
193
+ const heights = new Float64Array(values.length);
194
+ let takesWidth = false;
195
+ // Per item at a change: statements.
196
+ Arr.forEach(values, (item, i) => {
197
+ const size = sizeOf(item, i);
198
+ heights[i] = size.height;
199
+ if (Predicate.isNotUndefined(size.width)) {
200
+ widths[i] = size.width;
201
+ return;
202
+ }
203
+ widths[i] = Number.NaN;
204
+ takesWidth = true;
205
+ });
206
+ const each = layoutBy(geometry.axis)(widths, heights, gapOf(geometry), geometry.width);
207
+ const appsWidth = Bool.or(isFromWidth(geometry), takesWidth);
208
+ return {
209
+ columns: 1,
210
+ stepX: 0,
211
+ stepY: 0,
212
+ signX: SIGN_X[geometry.direction],
213
+ itemSize: NO_SIZE,
214
+ width: Bool.match(appsWidth, {
215
+ onTrue: () => readWidthOf(geometry),
216
+ onFalse: () => each.width
217
+ }),
218
+ appsWidth,
219
+ takesWidth,
220
+ each,
221
+ sizesRead: false,
222
+ inFlow,
223
+ groupWidth: groupWidthOf(geometry, inFlow)
224
+ };
225
+ };
226
+ /** A size not read yet: none, its place from the sizes before it. A column's, its width the group's. */
227
+ const UNREAD = {
228
+ width: 0,
229
+ height: 0
230
+ };
231
+ const UNREAD_IN_COLUMN = {
232
+ width: undefined,
233
+ height: 0
234
+ };
235
+ /** Each item's size as read, a column's height alone: its width is the group's (Q6). */
236
+ const readInColumn = read => item => {
237
+ // Per item at a change: statements.
238
+ const size = read.sizeOf(item);
239
+ if (Predicate.isUndefined(size)) return UNREAD_IN_COLUMN;
240
+ return {
241
+ width: undefined,
242
+ height: size.height
243
+ };
244
+ };
245
+ /** Each item's size as read: its width and height its own (Q6). */
246
+ const readOwn = read => item => {
247
+ // Per item at a change: statements.
248
+ const size = read.sizeOf(item);
249
+ if (Predicate.isUndefined(size)) return UNREAD;
250
+ return size;
251
+ };
252
+ /** Each axis's reading of an item's size. Built once, at module load. */
253
+ const readBy = Match.type().pipe(Match.when("y", () => readInColumn), Match.orElse(() => readOwn));
254
+ /**
255
+ * Places for `values`, each its own size as `read` from the page (#714): laid out as a function's sizes are.
256
+ * In flow, before its first sizes or a grid's width, every item at no place, where CSS has it.
257
+ */
258
+ const resolveRead = (geometry, values, read) => {
259
+ const places = resolveEach(geometry, values, readBy(geometry.axis)(read));
260
+ const inFlow = itemsInFlow(geometry, read.arrived);
261
+ // A column's items take its width, whether it has any or not (Q6).
262
+ const takesWidth = geometry.axis === "y";
263
+ const appsWidth = Bool.or(isFromWidth(geometry), takesWidth);
264
+ const each = UndefinedOr.getOrThrow(places.each);
265
+ return {
266
+ ...places,
267
+ sizesRead: true,
268
+ inFlow,
269
+ groupWidth: groupWidthOf(geometry, inFlow),
270
+ takesWidth,
271
+ appsWidth,
272
+ width: Bool.match(appsWidth, {
273
+ onTrue: () => readWidthOf(geometry),
274
+ onFalse: () => each.width
275
+ }),
276
+ each: Bool.match(inFlow, {
277
+ onTrue: () => atNoPlace(each),
278
+ onFalse: () => each
279
+ })
280
+ };
281
+ };
282
+ /** `each` with every item at no place: in flow, where CSS has it; the group's size its flow's. */
283
+ const atNoPlace = each => ({
284
+ ...each,
285
+ xs: new Float64Array(each.xs.length),
286
+ ys: new Float64Array(each.ys.length),
287
+ width: 0,
288
+ height: 0
132
289
  });
290
+ /** A column: each item below the one before, a gap apart; as wide as the widest, those that take the group's width aside. */
291
+ const columnLayout = (widths, heights, gap) => {
292
+ const ys = new Float64Array(heights.length);
293
+ let y = 0;
294
+ let width = 0;
295
+ // Per item at a change: statements.
296
+ Iter.forEach(heights, (height, i) => {
297
+ ys[i] = y;
298
+ y = y + height + gap.y;
299
+ if (widths[i] > width) width = widths[i];
300
+ });
301
+ return {
302
+ xs: new Float64Array(heights.length),
303
+ ys,
304
+ widths,
305
+ heights,
306
+ width,
307
+ height: Math.max(0, y - gap.y)
308
+ };
309
+ };
310
+ /** A row: each item after the one before, a gap apart, at the row's top; as tall as the tallest. */
311
+ const rowLayout = (widths, heights, gap) => {
312
+ const xs = new Float64Array(widths.length);
313
+ let x = 0;
314
+ let height = 0;
315
+ // Per item at a change: statements.
316
+ Iter.forEach(widths, (width, i) => {
317
+ xs[i] = x;
318
+ x = x + width + gap.x;
319
+ if (heights[i] > height) height = heights[i];
320
+ });
321
+ return {
322
+ xs,
323
+ ys: new Float64Array(widths.length),
324
+ widths,
325
+ heights,
326
+ width: Math.max(0, x - gap.x),
327
+ height
328
+ };
329
+ };
330
+ /** How far past the group's width an item may reach and still fit its row: a hundredth of a px, for sums that round. */
331
+ const FIT_SLACK = 0.01;
332
+ /**
333
+ * Rows, as CSS `flex-wrap` with `align-items: flex-start` (Q2): items left to right while they fit the
334
+ * group's content width, the next row below the tallest of the one before, each item at its row's top.
335
+ * Before the width is read, every item at no place: in flow, where `flex-wrap` has it (Q5).
336
+ */
337
+ const rowsLayout = (widths, heights, gap, width) => {
338
+ const n = widths.length;
339
+ const xs = new Float64Array(n);
340
+ const ys = new Float64Array(n);
341
+ if (Predicate.isUndefined(width)) return {
342
+ xs,
343
+ ys,
344
+ widths,
345
+ heights,
346
+ width: 0,
347
+ height: 0
348
+ };
349
+ let x = 0;
350
+ let rowY = 0;
351
+ let rowHeight = 0;
352
+ let widest = 0;
353
+ // Per item at a change: statements.
354
+ Iter.forEach(widths, (itemWidth, i) => {
355
+ if (x > 0 && x + itemWidth - width > FIT_SLACK) {
356
+ rowY = rowY + rowHeight + gap.y;
357
+ x = 0;
358
+ rowHeight = 0;
359
+ }
360
+ xs[i] = x;
361
+ ys[i] = rowY;
362
+ x = x + itemWidth + gap.x;
363
+ if (x - gap.x > widest) widest = x - gap.x;
364
+ if (heights[i] > rowHeight) rowHeight = heights[i];
365
+ });
366
+ return {
367
+ xs,
368
+ ys,
369
+ widths,
370
+ heights,
371
+ width: widest,
372
+ height: rowY + rowHeight
373
+ };
374
+ };
375
+ /** Each axis's layout of items each their own size. Built once, at module load. */
376
+ const layoutBy = Match.type().pipe(Match.when("y", () => columnLayout), Match.when("x", () => rowLayout), Match.orElse(() => rowsLayout));
377
+ /** Whether two arrays of numbers hold the same numbers in the same order. */
378
+ const sameNumbers = (a, b) => {
379
+ if (a.length !== b.length) return false;
380
+ return Bool.not(Iter.some(a, (x, i) => x !== b[i]));
381
+ };
382
+ /** Whether two resolutions of items each their own size place every item alike. */
383
+ const sameEach = (a, b) => {
384
+ if (Predicate.isUndefined(a)) return Predicate.isUndefined(b);
385
+ if (Predicate.isUndefined(b)) return false;
386
+ if (Bool.not(sameNumbers(a.xs, b.xs))) return false;
387
+ return sameNumbers(a.ys, b.ys);
388
+ };
389
+ /** Whether two resolutions place every item alike. */
390
+ export const samePlaces = (a, b) => {
391
+ if (Bool.not(Bool.every([a.columns === b.columns, a.stepX === b.stepX, a.stepY === b.stepY, a.signX === b.signX]))) return false;
392
+ return sameEach(a.each, b.each);
393
+ };
394
+ /** Item `i`'s place among `places`: its column and row, a step apart, or its own (#714), from its static position. */
395
+ export const placeOf = (places, i) => {
396
+ // Per item at a change: statements.
397
+ const each = places.each;
398
+ if (Predicate.isNotUndefined(each)) return {
399
+ x: places.signX * each.xs[i],
400
+ y: each.ys[i]
401
+ };
402
+ return {
403
+ x: places.signX * (i % places.columns) * places.stepX,
404
+ y: Math.floor(i / places.columns) * places.stepY
405
+ };
406
+ };
407
+ /**
408
+ * Item `i`'s width among `places`: one taking the group's content width has none, its width the group's by
409
+ * CSS and never read (#714): a column's crossover reads its places' `y` alone.
410
+ */
411
+ export const widthAt = (places, i) => {
412
+ // Per item, per drag sample: statements.
413
+ const each = places.each;
414
+ if (Predicate.isUndefined(each)) return places.itemSize.width;
415
+ const width = each.widths[i];
416
+ if (Number.isNaN(width)) return places.width;
417
+ return width;
418
+ };
419
+ /** Item `i`'s height among `places`. */
420
+ export const heightAt = (places, i) => {
421
+ // Per item, per drag sample: statements.
422
+ const each = places.each;
423
+ if (Predicate.isUndefined(each)) return places.itemSize.height;
424
+ return each.heights[i];
425
+ };
133
426
  /** The group's size for `n` items: its width, and its places' height, the last row's far edge. */
134
427
  export const extentOf = (places, n) => Bool.match(n === 0, {
135
428
  onTrue: () => NO_SIZE,
136
- onFalse: () => ({
137
- width: places.width,
138
- height: (Math.ceil(n / places.columns) - 1) * places.stepY + places.itemSize.height
429
+ onFalse: () => UndefinedOr.match(places.each, {
430
+ onUndefined: () => ({
431
+ width: places.width,
432
+ height: (Math.ceil(n / places.columns) - 1) * places.stepY + places.itemSize.height
433
+ }),
434
+ onDefined: each => ({
435
+ width: places.width,
436
+ height: each.height
437
+ })
139
438
  })
140
439
  });
141
440
  /** `px`. */
142
441
  export const px = n => `${n}px`;
442
+ /** A size container's whole inline size: its content box's. */
443
+ const CONTAINER_WIDTH = "100cqi";
444
+ /**
445
+ * The width of an item that takes the group's content width (#714, Q10), `inFlow` or not, its padding and
446
+ * border inside it (border-box). In flow, `100%`: its content box's. Placed, once the group's padding is
447
+ * read, its padding box's (an absolutely placed box's `100%`) less that padding: a resize of the group is
448
+ * then a layout alone. Before, a server's, all of a size container's inline size, the group being one
449
+ * ({@link containsWidth}): exact, at a style recalc of every item each time the group's width changes.
450
+ */
451
+ export const groupWidthOf = (geometry, inFlow) => Bool.match(inFlow, {
452
+ onTrue: () => "100%",
453
+ onFalse: () => UndefinedOr.match(geometry.padding, {
454
+ onUndefined: () => CONTAINER_WIDTH,
455
+ onDefined: padding => Bool.match(padding === 0, {
456
+ onTrue: () => "100%",
457
+ onFalse: () => `calc(100% - ${px(padding)})`
458
+ })
459
+ })
460
+ });
461
+ /** The style of an item that takes the group's content width, `width`: that width, its padding and border inside it. */
462
+ const groupWidthStyle = width => ({
463
+ width,
464
+ "box-sizing": "border-box"
465
+ });
466
+ /** Whether `places`' group is its items' size container: they take its width, out of flow, its padding not read. */
467
+ const containsWidth = (places, geometry) => Bool.every([places.takesWidth, Bool.not(places.inFlow), Predicate.isUndefined(geometry.padding)]);
468
+ /** What makes a group whose items take its content width their query container: on its inline axis alone. */
469
+ const SIZE_CONTAINER = {
470
+ "container-type": "inline-size"
471
+ };
143
472
  /**
144
473
  * The group element's style for `places`, `geometry` and `n` items, under `own`: positioned, its direction,
145
- * and sized to its places, or, a grid whose width isn't read yet, laid out by CSS grid (Q37), the same on
146
- * the server and the client, so hydrating keeps the markup.
474
+ * and sized to its places, or, a grid whose width isn't read yet, laid out by CSS (Q37; #714, Q5): CSS grid
475
+ * for items of one size, `flex-wrap` for each their own, the same on the server and the client, so
476
+ * hydrating keeps the markup. Items that take its content width have it as their query container until its
477
+ * padding is read, out of flow (#714).
147
478
  */
148
479
  export const groupStyleOf = (places, n, geometry, own) => {
149
- const base = {
480
+ const positioned = {
150
481
  ...ReorderController.GROUP_STYLE,
151
482
  position: "relative",
152
483
  direction: geometry.direction
153
484
  };
154
- const sized = Bool.match(inGridFlow(geometry), {
485
+ const base = Bool.match(containsWidth(places, geometry), {
155
486
  onTrue: () => ({
156
- ...base,
157
- display: "grid",
158
- "grid-template-columns": `repeat(auto-fill, ${px(places.itemSize.width)})`,
159
- "column-gap": px(places.stepX - places.itemSize.width),
160
- "row-gap": px(places.stepY - places.itemSize.height)
487
+ ...positioned,
488
+ ...SIZE_CONTAINER
161
489
  }),
490
+ onFalse: () => positioned
491
+ });
492
+ const sized = Bool.match(places.inFlow, {
493
+ onTrue: () => flowStyleOf(places, geometry, base),
162
494
  onFalse: () => {
163
495
  const extent = extentOf(places, n);
164
- // Its columns from its width (Q36): its width is the app's, which it reads.
165
- return Bool.match(places.fromWidth, {
496
+ // Its width the app's (Q36; #714). Its own size holds its edges too, a `border-box` group's (#714).
497
+ const height = px(extent.height + geometry.edges.y);
498
+ return Bool.match(places.appsWidth, {
166
499
  onTrue: () => ({
167
500
  ...base,
168
- height: px(extent.height)
501
+ height
169
502
  }),
170
503
  onFalse: () => ({
171
504
  ...base,
172
- width: px(extent.width),
173
- height: px(extent.height)
505
+ width: px(extent.width + geometry.edges.x),
506
+ height
174
507
  })
175
508
  });
176
509
  }
177
510
  });
178
511
  return Style.over(own, sized);
179
512
  };
513
+ /** A grid in flow's style: CSS grid's columns for items of one size, `flex-wrap`'s rows for each their own (#714, Q5). */
514
+ const flowStyleOf = (places, geometry, base) => {
515
+ const gap = gapOf(geometry);
516
+ return Bool.match(Predicate.isUndefined(places.each), {
517
+ onTrue: () => ({
518
+ ...base,
519
+ display: "grid",
520
+ "grid-template-columns": `repeat(auto-fill, ${px(places.itemSize.width)})`,
521
+ "column-gap": px(gap.x),
522
+ "row-gap": px(gap.y)
523
+ }),
524
+ onFalse: () => ({
525
+ ...base,
526
+ ...eachFlowBy(geometry.axis)(gap)
527
+ })
528
+ });
529
+ };
530
+ /**
531
+ * Each axis's flow for items each their own size (#714, decision 4), where their places would put them: a
532
+ * column, its items as wide as its content box; a row at its items' tops, as wide as they are, so it's as
533
+ * wide as its places make it; rows that wrap. Built once, at module load.
534
+ */
535
+ const eachFlowBy = Match.type().pipe(Match.when("y", () => gap => ({
536
+ display: "flex",
537
+ "flex-direction": "column",
538
+ "row-gap": px(gap.y)
539
+ })), Match.when("x", () => gap => ({
540
+ display: "flex",
541
+ "flex-direction": "row",
542
+ "align-items": "flex-start",
543
+ "column-gap": px(gap.x),
544
+ width: "max-content"
545
+ })), Match.orElse(() => gap => ({
546
+ display: "flex",
547
+ "flex-wrap": "wrap",
548
+ "align-items": "flex-start",
549
+ "column-gap": px(gap.x),
550
+ "row-gap": px(gap.y)
551
+ })));
180
552
  /** A Reorder item's drag axis for its group's: a grid's `xy` is a free drag. Built once, at module load. */
181
553
  const dragAxisFor = Match.type().pipe(Match.when("xy", () => true), Match.orElse(axis => axis));
182
554
  /**
183
- * An item's own style under its group's: sized, a drag element's defaults, and, unless its group lays it
184
- * out in flow, absolute at its static position (no `top` or `left`): the start of the group's content box.
555
+ * An item's own style under its group's, `inFlow` or not: a drag element's defaults; sized, its items one
556
+ * size; a column's items read from the page as wide as the group (#714, Q6); and, unless its group lays it out
557
+ * in flow, absolute at its static position (no `top` or `left`): the start of the group's content box. Items
558
+ * each their own size, a function's, are sized each by {@link sizeStyleOf} (#714).
185
559
  */
186
- export const itemBaseOf = geometry => {
187
- const base = {
188
- ...Style.dragDefaults(dragAxisFor(geometry.axis)),
189
- width: px(geometry.itemSize.width),
190
- height: px(geometry.itemSize.height)
191
- };
192
- return Bool.match(inGridFlow(geometry), {
193
- onTrue: () => base,
560
+ export const itemBaseOf = (geometry, inFlow) => {
561
+ const drag = Style.dragDefaults(dragAxisFor(geometry.axis));
562
+ const base = sizedBy(geometry, drag, groupWidthOf(geometry, inFlow));
563
+ return Bool.match(inFlow, {
564
+ onTrue: () => ({
565
+ ...base,
566
+ ...IN_FLOW
567
+ }),
194
568
  onFalse: () => ({
195
569
  ...base,
196
570
  position: "absolute"
197
571
  })
198
572
  });
199
573
  };
574
+ /**
575
+ * `drag` with every item's size, its group's one size; the group's width, `groupWidth`, a column's read from the
576
+ * page; or none.
577
+ */
578
+ const sizedBy = (geometry, drag, groupWidth) => {
579
+ // Per element at mount, by the hot path's rules: statements.
580
+ const itemSize = geometry.itemSize;
581
+ if (Predicate.isUndefined(itemSize)) {
582
+ if (geometry.axis !== "y") return drag;
583
+ return {
584
+ ...drag,
585
+ ...groupWidthStyle(groupWidth)
586
+ };
587
+ }
588
+ if (Predicate.isFunction(itemSize)) return drag;
589
+ return {
590
+ ...drag,
591
+ ...sizeStyle(itemSize.width, itemSize.height, groupWidth)
592
+ };
593
+ };
594
+ /** An item in flow's own: unshrunk, as wide as at its place, its row breaking where its place's does (#714). */
595
+ const IN_FLOW = {
596
+ "flex-shrink": "0"
597
+ };
598
+ /** An item's size as style: its width, or the group's content width, `groupWidth`, border-box (#714, Q10); and its height. */
599
+ const sizeStyle = (width, height, groupWidth) => UndefinedOr.match(width, {
600
+ onUndefined: () => ({
601
+ ...groupWidthStyle(groupWidth),
602
+ height: px(height)
603
+ }),
604
+ onDefined: w => ({
605
+ width: px(w),
606
+ height: px(height)
607
+ })
608
+ });
609
+ /** Item `i`'s own size as style, its items each their own size (#714): `width` and `height`, or none. */
610
+ export const sizeStyleOf = (places, i) => {
611
+ // Per element at mount, by the hot path's rules: statements.
612
+ const each = places.each;
613
+ if (Predicate.isUndefined(each) || places.sizesRead) return NO_STYLE;
614
+ const width = each.widths[i];
615
+ if (Number.isNaN(width)) return {
616
+ ...groupWidthStyle(places.groupWidth),
617
+ height: px(each.heights[i])
618
+ };
619
+ return {
620
+ width: px(width),
621
+ height: px(each.heights[i])
622
+ };
623
+ };
624
+ const NO_STYLE = {};
625
+ /** An element whose width was the group's, `was`, written no longer: its own `box-sizing` back (#714). */
626
+ export const releaseGroupWidth = (el, was) => {
627
+ // Per item at a change: statements.
628
+ if (Predicate.isNotUndefined(was) && was.tookGroupWidth) el.style.removeProperty("box-sizing");
629
+ };
630
+ /**
631
+ * `el`'s own size as `was` written, taken back where its style is still that: its items' sizes read from the
632
+ * page now (#714). A width that was the group's stays, a column's read from the page being the group's too.
633
+ */
634
+ export const unwriteSizeOn = (el, was) => {
635
+ // Per item at a change: statements.
636
+ if (Predicate.isUndefined(was)) return;
637
+ if (el.style.height === was.height) el.style.removeProperty("height");
638
+ if (!was.tookGroupWidth && el.style.width === was.width) el.style.removeProperty("width");
639
+ };
640
+ /**
641
+ * Item `i`'s own size written on `el`, its items each their own size (#714), where it isn't already: what
642
+ * `written` holds, by element, is what was last written.
643
+ */
644
+ export const writeSizeOn = (el, places, i, written) => {
645
+ // Per item at a change: statements.
646
+ const each = places.each;
647
+ if (Predicate.isUndefined(each) || places.sizesRead) return;
648
+ const tookGroupWidth = Number.isNaN(each.widths[i]);
649
+ let width = places.groupWidth;
650
+ if (!tookGroupWidth) width = px(each.widths[i]);
651
+ const height = px(each.heights[i]);
652
+ const was = written.get(el);
653
+ if (Predicate.isNotUndefined(was) && was.width === width && was.height === height) return;
654
+ written.set(el, {
655
+ width,
656
+ height,
657
+ tookGroupWidth
658
+ });
659
+ el.style.setProperty("height", height);
660
+ el.style.setProperty("width", width);
661
+ if (tookGroupWidth) {
662
+ el.style.setProperty("box-sizing", "border-box");
663
+ return;
664
+ }
665
+ releaseGroupWidth(el, was);
666
+ };
200
667
  /**
201
668
  * A style as CSS text: the one every item of a group shares, written once as each is made, where a key at
202
669
  * a time cost each item a write per key (#712, Q47).