foldkit-primitives 0.15.4 → 0.16.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 (422) hide show
  1. package/dist/device/fullscreen.d.ts +28 -0
  2. package/dist/device/fullscreen.d.ts.map +1 -0
  3. package/dist/device/fullscreen.js +69 -0
  4. package/dist/device/fullscreen.js.map +1 -0
  5. package/dist/device/geolocation.d.ts +56 -0
  6. package/dist/device/geolocation.d.ts.map +1 -0
  7. package/dist/device/geolocation.js +87 -0
  8. package/dist/device/geolocation.js.map +1 -0
  9. package/dist/device/index.d.ts +5 -0
  10. package/dist/device/index.js +6 -0
  11. package/dist/device/media-devices.d.ts +88 -0
  12. package/dist/device/media-devices.d.ts.map +1 -0
  13. package/dist/device/media-devices.js +117 -0
  14. package/dist/device/media-devices.js.map +1 -0
  15. package/dist/device/media-stream.d.ts +93 -0
  16. package/dist/device/media-stream.d.ts.map +1 -0
  17. package/dist/device/media-stream.js +106 -0
  18. package/dist/device/media-stream.js.map +1 -0
  19. package/dist/device/permissions.d.ts +106 -0
  20. package/dist/device/permissions.d.ts.map +1 -0
  21. package/dist/device/permissions.js +143 -0
  22. package/dist/device/permissions.js.map +1 -0
  23. package/dist/dom/autofocus.d.ts +15 -0
  24. package/dist/dom/autofocus.d.ts.map +1 -0
  25. package/dist/dom/autofocus.js +22 -0
  26. package/dist/dom/autofocus.js.map +1 -0
  27. package/dist/dom/clipboard.d.ts +30 -0
  28. package/dist/dom/clipboard.d.ts.map +1 -0
  29. package/dist/dom/clipboard.js +50 -0
  30. package/dist/dom/clipboard.js.map +1 -0
  31. package/dist/dom/editable-text.d.ts +72 -0
  32. package/dist/dom/editable-text.d.ts.map +1 -0
  33. package/dist/dom/editable-text.js +232 -0
  34. package/dist/dom/editable-text.js.map +1 -0
  35. package/dist/dom/fluid-hover.d.ts +93 -0
  36. package/dist/dom/fluid-hover.d.ts.map +1 -0
  37. package/dist/dom/fluid-hover.js +294 -0
  38. package/dist/dom/fluid-hover.js.map +1 -0
  39. package/dist/dom/focus-scope.d.ts +21 -0
  40. package/dist/dom/focus-scope.d.ts.map +1 -0
  41. package/dist/dom/focus-scope.js +93 -0
  42. package/dist/dom/focus-scope.js.map +1 -0
  43. package/dist/dom/follow-tab-stop.d.ts +11 -0
  44. package/dist/dom/follow-tab-stop.d.ts.map +1 -0
  45. package/dist/dom/follow-tab-stop.js +54 -0
  46. package/dist/dom/follow-tab-stop.js.map +1 -0
  47. package/dist/dom/image-decode.d.ts +27 -0
  48. package/dist/dom/image-decode.d.ts.map +1 -0
  49. package/dist/dom/image-decode.js +50 -0
  50. package/dist/dom/image-decode.js.map +1 -0
  51. package/dist/dom/index.d.ts +24 -0
  52. package/dist/dom/index.js +25 -0
  53. package/dist/dom/input-mask.d.ts +35 -0
  54. package/dist/dom/input-mask.d.ts.map +1 -0
  55. package/dist/dom/input-mask.js +90 -0
  56. package/dist/dom/input-mask.js.map +1 -0
  57. package/dist/dom/keep-in-view.d.ts +16 -0
  58. package/dist/dom/keep-in-view.d.ts.map +1 -0
  59. package/dist/dom/keep-in-view.js +38 -0
  60. package/dist/dom/keep-in-view.js.map +1 -0
  61. package/dist/dom/keyboard-inset.d.ts +29 -0
  62. package/dist/dom/keyboard-inset.d.ts.map +1 -0
  63. package/dist/dom/keyboard-inset.js +45 -0
  64. package/dist/dom/keyboard-inset.js.map +1 -0
  65. package/dist/dom/layers.d.ts +6 -0
  66. package/dist/dom/layers.d.ts.map +1 -0
  67. package/dist/dom/layers.js +35 -0
  68. package/dist/dom/layers.js.map +1 -0
  69. package/dist/dom/measure.d.ts +42 -0
  70. package/dist/dom/measure.d.ts.map +1 -0
  71. package/dist/dom/measure.js +123 -0
  72. package/dist/dom/measure.js.map +1 -0
  73. package/dist/dom/move.d.ts +45 -0
  74. package/dist/dom/move.d.ts.map +1 -0
  75. package/dist/dom/move.js +96 -0
  76. package/dist/dom/move.js.map +1 -0
  77. package/dist/dom/pointed-links.d.ts +13 -0
  78. package/dist/dom/pointed-links.d.ts.map +1 -0
  79. package/dist/dom/pointed-links.js +59 -0
  80. package/dist/dom/pointed-links.js.map +1 -0
  81. package/dist/dom/pointer-drag.d.ts +132 -0
  82. package/dist/dom/pointer-drag.d.ts.map +1 -0
  83. package/dist/dom/pointer-drag.js +307 -0
  84. package/dist/dom/pointer-drag.js.map +1 -0
  85. package/dist/dom/pointer-position.d.ts +133 -0
  86. package/dist/dom/pointer-position.d.ts.map +1 -0
  87. package/dist/dom/pointer-position.js +173 -0
  88. package/dist/dom/pointer-position.js.map +1 -0
  89. package/dist/dom/script-loader.d.ts +12 -0
  90. package/dist/dom/script-loader.d.ts.map +1 -0
  91. package/dist/dom/script-loader.js +54 -0
  92. package/dist/dom/script-loader.js.map +1 -0
  93. package/dist/dom/scroll-bars.d.ts +52 -0
  94. package/dist/dom/scroll-bars.d.ts.map +1 -0
  95. package/dist/dom/scroll-bars.js +259 -0
  96. package/dist/dom/scroll-bars.js.map +1 -0
  97. package/dist/dom/scroll-settle.d.ts +33 -0
  98. package/dist/dom/scroll-settle.d.ts.map +1 -0
  99. package/dist/dom/scroll-settle.js +84 -0
  100. package/dist/dom/scroll-settle.js.map +1 -0
  101. package/dist/dom/scroll.d.ts +21 -0
  102. package/dist/dom/scroll.d.ts.map +1 -0
  103. package/dist/dom/scroll.js +141 -0
  104. package/dist/dom/scroll.js.map +1 -0
  105. package/dist/dom/share.d.ts +19 -0
  106. package/dist/dom/share.d.ts.map +1 -0
  107. package/dist/dom/share.js +41 -0
  108. package/dist/dom/share.js.map +1 -0
  109. package/dist/dom/swipe.d.ts +121 -0
  110. package/dist/dom/swipe.d.ts.map +1 -0
  111. package/dist/dom/swipe.js +291 -0
  112. package/dist/dom/swipe.js.map +1 -0
  113. package/dist/dom/targets.d.ts +45 -0
  114. package/dist/dom/targets.d.ts.map +1 -0
  115. package/dist/dom/targets.js +70 -0
  116. package/dist/dom/targets.js.map +1 -0
  117. package/dist/dom/track-box.d.ts +61 -0
  118. package/dist/dom/track-box.d.ts.map +1 -0
  119. package/dist/dom/track-box.js +131 -0
  120. package/dist/dom/track-box.js.map +1 -0
  121. package/dist/events/active-element.d.ts +15 -0
  122. package/dist/events/active-element.d.ts.map +1 -0
  123. package/dist/events/active-element.js +33 -0
  124. package/dist/events/active-element.js.map +1 -0
  125. package/dist/events/hotkeys.d.ts +22 -0
  126. package/dist/events/hotkeys.d.ts.map +1 -0
  127. package/dist/events/hotkeys.js +56 -0
  128. package/dist/events/hotkeys.js.map +1 -0
  129. package/dist/events/idle.d.ts +29 -0
  130. package/dist/events/idle.d.ts.map +1 -0
  131. package/dist/events/idle.js +51 -0
  132. package/dist/events/idle.js.map +1 -0
  133. package/dist/events/index.d.ts +9 -0
  134. package/dist/events/index.js +10 -0
  135. package/dist/{input-modality-l7InESYh.d.mts → events/input-modality.d.ts} +9 -10
  136. package/dist/events/input-modality.d.ts.map +1 -0
  137. package/dist/{input-modality-XwQOFLip.mjs → events/input-modality.js} +2 -2
  138. package/dist/events/input-modality.js.map +1 -0
  139. package/dist/events/keyboard.d.ts +30 -0
  140. package/dist/events/keyboard.d.ts.map +1 -0
  141. package/dist/events/keyboard.js +55 -0
  142. package/dist/events/keyboard.js.map +1 -0
  143. package/dist/events/pointer.d.ts +15 -0
  144. package/dist/events/pointer.d.ts.map +1 -0
  145. package/dist/events/pointer.js +28 -0
  146. package/dist/events/pointer.js.map +1 -0
  147. package/dist/events/scroll.d.ts +16 -0
  148. package/dist/events/scroll.d.ts.map +1 -0
  149. package/dist/events/scroll.js +29 -0
  150. package/dist/events/scroll.js.map +1 -0
  151. package/dist/events/visibility.d.ts +25 -0
  152. package/dist/events/visibility.d.ts.map +1 -0
  153. package/dist/events/visibility.js +28 -0
  154. package/dist/events/visibility.js.map +1 -0
  155. package/dist/events/window-size.d.ts +30 -0
  156. package/dist/events/window-size.d.ts.map +1 -0
  157. package/dist/events/window-size.js +63 -0
  158. package/dist/events/window-size.js.map +1 -0
  159. package/dist/index.d.ts +9 -0
  160. package/dist/index.js +10 -0
  161. package/dist/interaction/bundle-behavior.d.ts +37 -0
  162. package/dist/interaction/bundle-behavior.d.ts.map +1 -0
  163. package/dist/interaction/bundle-behavior.js +34 -0
  164. package/dist/interaction/bundle-behavior.js.map +1 -0
  165. package/dist/interaction/dismiss-layer.d.ts +100 -0
  166. package/dist/interaction/dismiss-layer.d.ts.map +1 -0
  167. package/dist/interaction/dismiss-layer.js +140 -0
  168. package/dist/interaction/dismiss-layer.js.map +1 -0
  169. package/dist/interaction/editable-text.d.ts +13 -0
  170. package/dist/interaction/editable-text.d.ts.map +1 -0
  171. package/dist/interaction/editable-text.js +17 -0
  172. package/dist/interaction/editable-text.js.map +1 -0
  173. package/dist/interaction/focus-scope.d.ts +21 -0
  174. package/dist/interaction/focus-scope.d.ts.map +1 -0
  175. package/dist/interaction/focus-scope.js +25 -0
  176. package/dist/interaction/focus-scope.js.map +1 -0
  177. package/dist/interaction/focus-visible.d.ts +9 -0
  178. package/dist/interaction/focus-visible.d.ts.map +1 -0
  179. package/dist/interaction/focus-visible.js +10 -0
  180. package/dist/interaction/focus-visible.js.map +1 -0
  181. package/dist/interaction/grid-navigation.d.ts +73 -0
  182. package/dist/interaction/grid-navigation.d.ts.map +1 -0
  183. package/dist/interaction/grid-navigation.js +137 -0
  184. package/dist/interaction/grid-navigation.js.map +1 -0
  185. package/dist/interaction/index.d.ts +21 -0
  186. package/dist/interaction/index.js +21 -0
  187. package/dist/interaction/layers.d.ts +12 -0
  188. package/dist/interaction/layers.d.ts.map +1 -0
  189. package/dist/interaction/layers.js +14 -0
  190. package/dist/interaction/layers.js.map +1 -0
  191. package/dist/interaction/list-navigation.d.ts +105 -0
  192. package/dist/interaction/list-navigation.d.ts.map +1 -0
  193. package/dist/interaction/list-navigation.js +168 -0
  194. package/dist/interaction/list-navigation.js.map +1 -0
  195. package/dist/interaction/live-announce.d.ts +70 -0
  196. package/dist/interaction/live-announce.d.ts.map +1 -0
  197. package/dist/interaction/live-announce.js +115 -0
  198. package/dist/interaction/live-announce.js.map +1 -0
  199. package/dist/interaction/long-press.d.ts +102 -0
  200. package/dist/interaction/long-press.d.ts.map +1 -0
  201. package/dist/interaction/long-press.js +115 -0
  202. package/dist/interaction/long-press.js.map +1 -0
  203. package/dist/interaction/move.d.ts +10 -0
  204. package/dist/interaction/move.d.ts.map +1 -0
  205. package/dist/interaction/move.js +17 -0
  206. package/dist/interaction/move.js.map +1 -0
  207. package/dist/interaction/overlay.d.ts +45 -0
  208. package/dist/interaction/overlay.d.ts.map +1 -0
  209. package/dist/interaction/overlay.js +57 -0
  210. package/dist/interaction/overlay.js.map +1 -0
  211. package/dist/interaction/placing.d.ts +86 -0
  212. package/dist/interaction/placing.d.ts.map +1 -0
  213. package/dist/interaction/placing.js +239 -0
  214. package/dist/interaction/placing.js.map +1 -0
  215. package/dist/interaction/pointer-drag.d.ts +23 -0
  216. package/dist/interaction/pointer-drag.d.ts.map +1 -0
  217. package/dist/interaction/pointer-drag.js +21 -0
  218. package/dist/interaction/pointer-drag.js.map +1 -0
  219. package/dist/interaction/press.d.ts +152 -0
  220. package/dist/interaction/press.d.ts.map +1 -0
  221. package/dist/interaction/press.js +229 -0
  222. package/dist/interaction/press.js.map +1 -0
  223. package/dist/interaction/roving-tabindex.d.ts +85 -0
  224. package/dist/interaction/roving-tabindex.d.ts.map +1 -0
  225. package/dist/interaction/roving-tabindex.js +142 -0
  226. package/dist/interaction/roving-tabindex.js.map +1 -0
  227. package/dist/interaction/selection.d.ts +72 -0
  228. package/dist/interaction/selection.d.ts.map +1 -0
  229. package/dist/interaction/selection.js +129 -0
  230. package/dist/interaction/selection.js.map +1 -0
  231. package/dist/interaction/targets.d.ts +15 -0
  232. package/dist/interaction/targets.d.ts.map +1 -0
  233. package/dist/interaction/targets.js +20 -0
  234. package/dist/interaction/targets.js.map +1 -0
  235. package/dist/interaction/tree-navigation.d.ts +111 -0
  236. package/dist/interaction/tree-navigation.d.ts.map +1 -0
  237. package/dist/interaction/tree-navigation.js +207 -0
  238. package/dist/interaction/tree-navigation.js.map +1 -0
  239. package/dist/interaction/typeahead.d.ts +73 -0
  240. package/dist/interaction/typeahead.d.ts.map +1 -0
  241. package/dist/interaction/typeahead.js +113 -0
  242. package/dist/interaction/typeahead.js.map +1 -0
  243. package/dist/internal.d.ts +16 -0
  244. package/dist/internal.d.ts.map +1 -0
  245. package/dist/{internal-C4gHodLc.mjs → internal.js} +7 -5
  246. package/dist/internal.js.map +1 -0
  247. package/dist/media/breakpoints.d.ts +37 -0
  248. package/dist/media/breakpoints.d.ts.map +1 -0
  249. package/dist/media/breakpoints.js +64 -0
  250. package/dist/media/breakpoints.js.map +1 -0
  251. package/dist/media/index.d.ts +3 -0
  252. package/dist/media/index.js +4 -0
  253. package/dist/media/mediaquery.d.ts +40 -0
  254. package/dist/media/mediaquery.d.ts.map +1 -0
  255. package/dist/media/mediaquery.js +42 -0
  256. package/dist/media/mediaquery.js.map +1 -0
  257. package/dist/media/platform.d.ts +30 -0
  258. package/dist/media/platform.d.ts.map +1 -0
  259. package/dist/media/platform.js +50 -0
  260. package/dist/media/platform.js.map +1 -0
  261. package/dist/motion/index.d.ts +5 -0
  262. package/dist/motion/index.js +5 -0
  263. package/dist/motion/motion.d.ts +16 -0
  264. package/dist/motion/motion.d.ts.map +1 -0
  265. package/dist/motion/motion.js +25 -0
  266. package/dist/motion/motion.js.map +1 -0
  267. package/dist/motion/presence.d.ts +37 -0
  268. package/dist/motion/presence.d.ts.map +1 -0
  269. package/dist/motion/presence.js +65 -0
  270. package/dist/motion/presence.js.map +1 -0
  271. package/dist/motion/spring.d.ts +50 -0
  272. package/dist/motion/spring.d.ts.map +1 -0
  273. package/dist/motion/spring.js +92 -0
  274. package/dist/motion/spring.js.map +1 -0
  275. package/dist/motion/tween.d.ts +44 -0
  276. package/dist/motion/tween.d.ts.map +1 -0
  277. package/dist/motion/tween.js +65 -0
  278. package/dist/motion/tween.js.map +1 -0
  279. package/dist/net/broadcast.d.ts +39 -0
  280. package/dist/net/broadcast.d.ts.map +1 -0
  281. package/dist/net/broadcast.js +73 -0
  282. package/dist/net/broadcast.js.map +1 -0
  283. package/dist/net/index.d.ts +5 -0
  284. package/dist/net/index.js +6 -0
  285. package/dist/net/online.d.ts +24 -0
  286. package/dist/net/online.d.ts.map +1 -0
  287. package/dist/net/online.js +26 -0
  288. package/dist/net/online.js.map +1 -0
  289. package/dist/net/sharedHost.d.ts +64 -0
  290. package/dist/net/sharedHost.d.ts.map +1 -0
  291. package/dist/net/sharedHost.js +124 -0
  292. package/dist/net/sharedHost.js.map +1 -0
  293. package/dist/net/sse.d.ts +115 -0
  294. package/dist/net/sse.d.ts.map +1 -0
  295. package/dist/net/sse.js +138 -0
  296. package/dist/net/sse.js.map +1 -0
  297. package/dist/net/websocket.d.ts +172 -0
  298. package/dist/net/websocket.d.ts.map +1 -0
  299. package/dist/net/websocket.js +199 -0
  300. package/dist/net/websocket.js.map +1 -0
  301. package/dist/observers/bounds.d.ts +24 -0
  302. package/dist/observers/bounds.d.ts.map +1 -0
  303. package/dist/observers/bounds.js +51 -0
  304. package/dist/observers/bounds.js.map +1 -0
  305. package/dist/observers/index.d.ts +4 -0
  306. package/dist/observers/index.js +5 -0
  307. package/dist/observers/intersection.d.ts +18 -0
  308. package/dist/observers/intersection.d.ts.map +1 -0
  309. package/dist/observers/intersection.js +33 -0
  310. package/dist/observers/intersection.js.map +1 -0
  311. package/dist/observers/mutation.d.ts +25 -0
  312. package/dist/observers/mutation.d.ts.map +1 -0
  313. package/dist/observers/mutation.js +53 -0
  314. package/dist/observers/mutation.js.map +1 -0
  315. package/dist/observers/resize.d.ts +18 -0
  316. package/dist/observers/resize.d.ts.map +1 -0
  317. package/dist/observers/resize.js +33 -0
  318. package/dist/observers/resize.js.map +1 -0
  319. package/dist/state/history.d.ts +115 -0
  320. package/dist/state/history.d.ts.map +1 -0
  321. package/dist/state/history.js +167 -0
  322. package/dist/state/history.js.map +1 -0
  323. package/dist/state/index.d.ts +6 -0
  324. package/dist/state/index.js +7 -0
  325. package/dist/state/locale.d.ts +27 -0
  326. package/dist/state/locale.d.ts.map +1 -0
  327. package/dist/state/locale.js +25 -0
  328. package/dist/state/locale.js.map +1 -0
  329. package/dist/state/pagination.d.ts +53 -0
  330. package/dist/state/pagination.d.ts.map +1 -0
  331. package/dist/state/pagination.js +72 -0
  332. package/dist/state/pagination.js.map +1 -0
  333. package/dist/state/range.d.ts +9 -0
  334. package/dist/state/range.d.ts.map +1 -0
  335. package/dist/state/range.js +18 -0
  336. package/dist/state/range.js.map +1 -0
  337. package/dist/state/selection.d.ts +47 -0
  338. package/dist/state/selection.d.ts.map +1 -0
  339. package/dist/state/selection.js +39 -0
  340. package/dist/state/selection.js.map +1 -0
  341. package/dist/state/virtual.d.ts +201 -0
  342. package/dist/state/virtual.d.ts.map +1 -0
  343. package/dist/state/{index.mjs → virtual.js} +10 -306
  344. package/dist/state/virtual.js.map +1 -0
  345. package/dist/time/debounce.d.ts +43 -0
  346. package/dist/time/debounce.d.ts.map +1 -0
  347. package/dist/time/debounce.js +65 -0
  348. package/dist/time/debounce.js.map +1 -0
  349. package/dist/time/index.d.ts +6 -0
  350. package/dist/time/index.js +7 -0
  351. package/dist/time/interval.d.ts +37 -0
  352. package/dist/time/interval.d.ts.map +1 -0
  353. package/dist/time/interval.js +52 -0
  354. package/dist/time/interval.js.map +1 -0
  355. package/dist/time/relative.d.ts +8 -0
  356. package/dist/time/relative.d.ts.map +1 -0
  357. package/dist/time/relative.js +27 -0
  358. package/dist/time/relative.js.map +1 -0
  359. package/dist/time/throttle.d.ts +38 -0
  360. package/dist/time/throttle.d.ts.map +1 -0
  361. package/dist/time/throttle.js +39 -0
  362. package/dist/time/throttle.js.map +1 -0
  363. package/dist/time/ticks.d.ts +21 -0
  364. package/dist/time/ticks.d.ts.map +1 -0
  365. package/dist/time/ticks.js +30 -0
  366. package/dist/time/ticks.js.map +1 -0
  367. package/dist/time/timer.d.ts +32 -0
  368. package/dist/time/timer.d.ts.map +1 -0
  369. package/dist/time/timer.js +50 -0
  370. package/dist/time/timer.js.map +1 -0
  371. package/package.json +31 -31
  372. package/dist/device/index.d.mts +0 -335
  373. package/dist/device/index.d.mts.map +0 -1
  374. package/dist/device/index.mjs +0 -493
  375. package/dist/device/index.mjs.map +0 -1
  376. package/dist/dom/index.d.mts +0 -714
  377. package/dist/dom/index.d.mts.map +0 -1
  378. package/dist/dom/index.mjs +0 -1840
  379. package/dist/dom/index.mjs.map +0 -1
  380. package/dist/editable-text-Bg7vil7h.d.mts +0 -307
  381. package/dist/editable-text-Bg7vil7h.d.mts.map +0 -1
  382. package/dist/events/index.d.mts +0 -168
  383. package/dist/events/index.d.mts.map +0 -1
  384. package/dist/events/index.mjs +0 -307
  385. package/dist/events/index.mjs.map +0 -1
  386. package/dist/follow-tab-stop-DM5EI4Ci.mjs +0 -856
  387. package/dist/follow-tab-stop-DM5EI4Ci.mjs.map +0 -1
  388. package/dist/index-Bomdwb7e.d.mts +0 -142
  389. package/dist/index-Bomdwb7e.d.mts.map +0 -1
  390. package/dist/index.d.mts +0 -12
  391. package/dist/index.mjs +0 -12
  392. package/dist/input-modality-XwQOFLip.mjs.map +0 -1
  393. package/dist/input-modality-l7InESYh.d.mts.map +0 -1
  394. package/dist/interaction/index.d.mts +0 -1193
  395. package/dist/interaction/index.d.mts.map +0 -1
  396. package/dist/interaction/index.mjs +0 -1992
  397. package/dist/interaction/index.mjs.map +0 -1
  398. package/dist/internal-C4gHodLc.mjs.map +0 -1
  399. package/dist/media/index.d.mts +0 -103
  400. package/dist/media/index.d.mts.map +0 -1
  401. package/dist/media/index.mjs +0 -146
  402. package/dist/media/index.mjs.map +0 -1
  403. package/dist/motion/index.d.mts +0 -2
  404. package/dist/motion/index.mjs +0 -1
  405. package/dist/motion-BmlJCjn6.mjs +0 -236
  406. package/dist/motion-BmlJCjn6.mjs.map +0 -1
  407. package/dist/net/index.d.mts +0 -338
  408. package/dist/net/index.d.mts.map +0 -1
  409. package/dist/net/index.mjs +0 -530
  410. package/dist/net/index.mjs.map +0 -1
  411. package/dist/observers/index.d.mts +0 -76
  412. package/dist/observers/index.d.mts.map +0 -1
  413. package/dist/observers/index.mjs +0 -155
  414. package/dist/observers/index.mjs.map +0 -1
  415. package/dist/rolldown-runtime-D8jQpDG7.mjs +0 -12
  416. package/dist/state/index.d.mts +0 -432
  417. package/dist/state/index.d.mts.map +0 -1
  418. package/dist/state/index.mjs.map +0 -1
  419. package/dist/time/index.d.mts +0 -167
  420. package/dist/time/index.d.mts.map +0 -1
  421. package/dist/time/index.mjs +0 -236
  422. package/dist/time/index.mjs.map +0 -1
@@ -1,432 +0,0 @@
1
- import { Schema } from "effect";
2
- import * as Mount from "foldkit/mount";
3
- import { Bundle } from "foldkit-bundle";
4
- export declare const HistoryModel: <Value>(value: Schema.Codec<Value, unknown>) => Schema.Struct<{
5
- readonly past: Schema.$Array<Schema.Codec<Value, unknown, never, never>>;
6
- readonly present: Schema.Codec<Value, unknown, never, never>;
7
- readonly future: Schema.$Array<Schema.Codec<Value, unknown, never, never>>;
8
- /** The group of the last push, so the next push of the same group joins it; `null` for none. */
9
- readonly group: Schema.NullOr<Schema.String>;
10
- }>;
11
- export type HistoryModel<Value> = {
12
- readonly past: ReadonlyArray<Value>;
13
- readonly present: Value;
14
- readonly future: ReadonlyArray<Value>;
15
- readonly group: string | null;
16
- };
17
- declare const start: <Value>(present: Value) => HistoryModel<Value>;
18
- declare const push: <Value>(model: HistoryModel<Value>, value: Value, options: {
19
- readonly capacity: number;
20
- readonly group?: string | null | undefined;
21
- }) => HistoryModel<Value>;
22
- declare const undo: <Value>(model: HistoryModel<Value>) => HistoryModel<Value>;
23
- declare const redo: <Value>(model: HistoryModel<Value>) => HistoryModel<Value>;
24
- declare const goTo: <Value>(model: HistoryModel<Value>, step: number) => HistoryModel<Value>;
25
- declare const clear: <Value>(model: HistoryModel<Value>) => HistoryModel<Value>;
26
- declare const close: <Value>(model: HistoryModel<Value>) => HistoryModel<Value>;
27
- declare const revert: <Value>(model: HistoryModel<Value>, group: string) => HistoryModel<Value>;
28
- /** Whether Undo would move: the past is non-empty. */
29
- export declare const canUndo: <Value>(model: HistoryModel<Value>) => boolean;
30
- /** Whether Redo would move: the future is non-empty. */
31
- export declare const canRedo: <Value>(model: HistoryModel<Value>) => boolean;
32
- /** The steps of a history as pure functions of its Model. */
33
- export declare const History: {
34
- /** A history whose present is `value`, with nothing to undo. */
35
- start: typeof start;
36
- /** Records `value` as the present; the same `group` as the last push joins its step. */
37
- push: typeof push;
38
- /** One step back, or the Model as it was when there is none. */
39
- undo: typeof undo;
40
- /** One step forward, or the Model as it was when there is none. */
41
- redo: typeof redo;
42
- /**
43
- * The value at `step` made the present, counting every kept value from the
44
- * oldest (0), so the present is at `past.length`: what a click on a step's
45
- * thumbnail does. The Model as it was for the present or a step not kept.
46
- */
47
- goTo: typeof goTo;
48
- /** Nothing to undo or redo, the present kept. */
49
- clear: typeof clear;
50
- /** The next push starts a step of its own, whatever its group: a group ends here. */
51
- close: typeof close;
52
- /**
53
- * The step `group` is making taken back, and not redoable: what a cancelled
54
- * edit, or one that ended where it began, leaves. The Model as it was when
55
- * the last push was not of `group`. What the group's first push dropped
56
- * stays dropped: the redo future it cleared, and an entry capacity evicted;
57
- * with a capacity of 0 nothing was kept, so the present stays and only the
58
- * group ends.
59
- */
60
- revert: typeof revert;
61
- canUndo: typeof canUndo;
62
- canRedo: typeof canRedo;
63
- };
64
- /**
65
- * Undo/redo as a bundle factory: the past, present, and future of one value
66
- * live in the Model, so every step replays. Pushing records, even an unchanged
67
- * value; skipping duplicates is the application's policy, not the stack's.
68
- *
69
- * A push may name a `group`. Consecutive pushes of the same group are one step:
70
- * the present moves and nothing new is recorded, so typing a word undoes as a
71
- * whole. Grouping needs no clock; the application names what belongs together.
72
- *
73
- * The steps are also pure functions (`History.push`, `undo`, `redo`, `goTo`, `clear`),
74
- * for a parent that records an edit in the same transition that makes it
75
- * rather than dispatching a Message to a placed bundle.
76
- */
77
- export declare const history: <const Name extends string, Value>(config: {
78
- readonly name: Name;
79
- readonly value: Schema.Codec<Value, unknown>;
80
- readonly capacity?: number | undefined;
81
- }) => Bundle.Bundle<Name, {
82
- readonly initial: Value;
83
- }, HistoryModel<Value>, {
84
- readonly _tag: "Clear";
85
- } | {
86
- readonly _tag: "GoTo";
87
- readonly step: number;
88
- } | {
89
- readonly _tag: "Push";
90
- readonly value: Value;
91
- readonly group?: string | undefined;
92
- } | {
93
- readonly _tag: "Redo";
94
- } | {
95
- readonly _tag: "Undo";
96
- }, never, never, never, void, {}, {}> & {
97
- Message: import("foldkit/message").MessageUnion<{
98
- readonly Push: {
99
- value: Schema.Codec<Value, unknown, never, never>;
100
- group: Schema.optional<Schema.String>;
101
- };
102
- readonly Undo: {};
103
- readonly Redo: {};
104
- readonly GoTo: {
105
- step: Schema.Number;
106
- };
107
- readonly Clear: {};
108
- }>;
109
- };
110
- export declare const LocaleModel: Schema.Struct<{
111
- readonly locale: Schema.String;
112
- }>;
113
- export type LocaleModel = typeof LocaleModel.Type;
114
- export declare const LocaleMessage: import("foldkit/message").MessageUnion<{
115
- readonly SetLocale: {
116
- locale: Schema.String;
117
- };
118
- }>;
119
- export type LocaleMessage = typeof LocaleMessage.Type;
120
- /**
121
- * Locale as a bundle: the current locale string in the Model. Starts from
122
- * `navigator.language` where available, falling back to the configured
123
- * default; changes arrive as Messages. No subscriptions: language changes
124
- * take effect on reload.
125
- */
126
- export declare const Locale: Bundle.Bundle<"Locale", {
127
- readonly default: string;
128
- }, {
129
- readonly locale: string;
130
- }, {
131
- readonly _tag: "SetLocale";
132
- readonly locale: string;
133
- }, never, never, never, void, {}, {}>;
134
- export declare const PaginationModel: Schema.Struct<{
135
- readonly page: Schema.Number;
136
- readonly perPage: Schema.Number;
137
- readonly total: Schema.NullOr<Schema.Number>;
138
- }>;
139
- export type PaginationModel = typeof PaginationModel.Type;
140
- export declare const PaginationMessage: import("foldkit/message").MessageUnion<{
141
- readonly GoToPage: {
142
- page: Schema.Number;
143
- };
144
- readonly NextPage: {};
145
- readonly PrevPage: {};
146
- readonly SetPerPage: {
147
- perPage: Schema.Number;
148
- };
149
- readonly SetTotal: {
150
- total: Schema.NullOr<Schema.Number>;
151
- };
152
- }>;
153
- export type PaginationMessage = typeof PaginationMessage.Type;
154
- /** The number of pages, or null while the total is unknown. */
155
- export declare const pageCount: (model: PaginationModel) => number | null;
156
- /** The offset of the first item on the page, for a slice or a query. */
157
- export declare const offset: (model: PaginationModel) => number;
158
- /**
159
- * Pagination as a bundle: the page, page size, and total live in the Model,
160
- * so page changes replay and every transition clamps into range. Pure logic,
161
- * no streams: data loading stays the application's job.
162
- */
163
- export declare const Pagination: Bundle.Bundle<"Pagination", {
164
- readonly perPage: number;
165
- readonly total?: number | null | undefined;
166
- }, {
167
- readonly page: number;
168
- readonly perPage: number;
169
- readonly total: number | null;
170
- }, {
171
- readonly _tag: "GoToPage";
172
- readonly page: number;
173
- } | {
174
- readonly _tag: "NextPage";
175
- } | {
176
- readonly _tag: "PrevPage";
177
- } | {
178
- readonly _tag: "SetPerPage";
179
- readonly perPage: number;
180
- } | {
181
- readonly _tag: "SetTotal";
182
- readonly total: number | null;
183
- }, never, never, never, void, {}, {}>;
184
- /**
185
- * A numeric range as an array: `range(1, 4)` is `[1, 2, 3]`, inclusive of
186
- * the start and exclusive of the end, like `Array.from` length math. The
187
- * pagination companion: `range(1, (pageCount(model) ?? 0) + 1)` is the page
188
- * list. A zero or non-finite step would loop forever, so it throws, naming
189
- * the caller — like History's capacity check.
190
- */
191
- export declare const range: (start: number, end: number, step?: number) => ReadonlyArray<number>;
192
- export declare const SelectionSetModel: Schema.Struct<{
193
- readonly selected: Schema.$Array<Schema.String>;
194
- }>;
195
- export type SelectionSetModel = typeof SelectionSetModel.Type;
196
- export declare const SelectionSetMessage: import("foldkit/message").MessageUnion<{
197
- readonly Select: {
198
- id: Schema.String;
199
- };
200
- readonly Deselect: {
201
- id: Schema.String;
202
- };
203
- readonly Toggle: {
204
- id: Schema.String;
205
- };
206
- readonly ReplaceAll: {
207
- ids: Schema.$Array<Schema.String>;
208
- };
209
- readonly Clear: {};
210
- }>;
211
- export type SelectionSetMessage = typeof SelectionSetMessage.Type;
212
- /** Whether the id is currently selected. */
213
- export declare const isSelected: (model: SelectionSetModel, id: string) => boolean;
214
- /**
215
- * A selection set as a bundle: the selected ids in the Model, changed one at
216
- * a time or replaced whole. Order follows first selection; toggling moves a
217
- * reselected id to the end. Pure logic, no streams.
218
- */
219
- export declare const SelectionSet: Bundle.Bundle<"SelectionSet", void, {
220
- readonly selected: readonly string[];
221
- }, {
222
- readonly _tag: "Clear";
223
- } | {
224
- readonly _tag: "Deselect";
225
- readonly id: string;
226
- } | {
227
- readonly _tag: "ReplaceAll";
228
- readonly ids: readonly string[];
229
- } | {
230
- readonly _tag: "Select";
231
- readonly id: string;
232
- } | {
233
- readonly _tag: "Toggle";
234
- readonly id: string;
235
- }, never, never, never, void, {}, {}>;
236
- /** The rows to draw: a half-open range of indexes. */
237
- export interface VirtualWindow {
238
- /** First visible row index, inclusive. */
239
- readonly start: number;
240
- /** End row index, exclusive. */
241
- readonly end: number;
242
- }
243
- /** Layout constants: per-row estimate, inter-row gap, and end padding. */
244
- export interface VirtualLayout {
245
- readonly estimatedHeight: number;
246
- readonly gap: number;
247
- readonly paddingStart: number;
248
- readonly paddingEnd: number;
249
- }
250
- /** Total scrollable height: padding, measured rows, estimates, and gaps. */
251
- export declare const totalHeight: (keys: ReadonlyArray<string>, heights: Readonly<Record<string, number>>, layout: VirtualLayout) => number;
252
- /** Pixel offset of a row's top edge: padding plus the prefix before it. */
253
- export declare const offsetFor: (index: number, keys: ReadonlyArray<string>, heights: Readonly<Record<string, number>>, layout: VirtualLayout) => number;
254
- /**
255
- * Which rows to render for a scroll position: the rows intersecting
256
- * `[scrollTop, scrollTop + viewportHeight)`, widened by `overscan` on both
257
- * sides and clamped to `[0, count]`. Gaps and padding are dead space — no
258
- * row — so boxes are tested, not cumulative coverage. An overscan of zero
259
- * renders exactly the visible rows.
260
- */
261
- export declare const visibleRange: (keys: ReadonlyArray<string>, heights: Readonly<Record<string, number>>, layout: VirtualLayout, scrollTop: number, viewportHeight: number, overscan: number) => VirtualWindow;
262
- export declare const VirtualModel: Schema.Struct<{
263
- readonly scrollTop: Schema.Number;
264
- readonly heights: Schema.$Record<Schema.String, Schema.Number>;
265
- readonly scrolling: Schema.Boolean;
266
- readonly generation: Schema.Number;
267
- readonly estimatedHeight: Schema.Number;
268
- readonly overscan: Schema.Number;
269
- readonly gap: Schema.Number;
270
- readonly paddingStart: Schema.Number;
271
- readonly paddingEnd: Schema.Number;
272
- }>;
273
- export type VirtualModel = typeof VirtualModel.Type;
274
- export declare const VirtualMessage: import("foldkit/message").MessageUnion<{
275
- readonly Scrolled: {
276
- top: Schema.Number;
277
- };
278
- readonly Measured: {
279
- key: Schema.String;
280
- height: Schema.Number;
281
- };
282
- /** Drops heights for keys no longer listed: the bundle never sees the key
283
- order, so the application tells it what left. */
284
- readonly Prune: {
285
- keys: Schema.$Array<Schema.String>;
286
- };
287
- /** Fires when scrolling has been silent for `settleMs`: only the latest
288
- generation counts, so a fling's intermediate timers emit nothing. */
289
- readonly Settled: {
290
- generation: Schema.Number;
291
- };
292
- }>;
293
- export type VirtualMessage = typeof VirtualMessage.Type;
294
- /**
295
- * The rows to render plus the spacer height, from the Model, the key order,
296
- * and the viewport height. Layout and overscan come from the Model, so the
297
- * call cannot disagree with the placement. Keys stay the application's:
298
- * render each row keyed, and per-row placements keep identity.
299
- */
300
- export declare const windowFor: (model: VirtualModel, keys: ReadonlyArray<string>, viewportHeight: number) => VirtualWindow & {
301
- readonly totalHeight: number;
302
- };
303
- /**
304
- * Pixels from the viewport's bottom edge to the content's end: negative
305
- * past it, zero exactly there. Prefetch thresholds want this number ("load
306
- * when within 500px"), not just the boolean below.
307
- */
308
- export declare const distanceToEnd: (model: VirtualModel, keys: ReadonlyArray<string>, viewportHeight: number) => number;
309
- /**
310
- * Whether the viewport rests at (or past) the end, within `threshold`
311
- * pixels: the infinite-scroll check. An empty list counts as ended — there
312
- * is nothing to scroll, so more should load. Thresholds below zero clamp
313
- * to zero.
314
- */
315
- export declare const isAtEnd: (model: VirtualModel, keys: ReadonlyArray<string>, viewportHeight: number, threshold?: number) => boolean;
316
- /**
317
- * Windowing math for virtualized lists as pure functions: which rows to
318
- * render, how tall the scrollable area is, and where each row starts. Row
319
- * heights come from measured values with a per-row estimate fallback, so
320
- * unmeasured rows still occupy space and measuring later only corrects.
321
- * Keys are strings; heights are non-negative, and non-finite measurements
322
- * fall back to the estimate instead of poisoning the sums.
323
- *
324
- * The `Virtual` bundle below owns the scroll position and the measured
325
- * heights; `Viewport` reports container scrolls and `MeasureRow` reports
326
- * row heights, both as Mounts on the elements they observe. The application
327
- * renders `windowFor(...)` rows with its own views (keyed, so `each`
328
- * placements keep identity) inside a spacer of `totalHeight(...)`.
329
- */
330
- export declare const Virtual: Bundle.Bundle<"Virtual", {
331
- readonly estimatedHeight: number;
332
- readonly overscan: number;
333
- readonly gap: number;
334
- readonly paddingStart: number;
335
- readonly paddingEnd: number;
336
- readonly settleMs?: number | undefined;
337
- readonly initialScrollTop?: number | undefined;
338
- readonly initialHeights?: Readonly<Record<string, number>> | undefined;
339
- }, {
340
- readonly scrollTop: number;
341
- readonly heights: {
342
- readonly [x: string]: number;
343
- };
344
- readonly scrolling: boolean;
345
- readonly generation: number;
346
- readonly estimatedHeight: number;
347
- readonly overscan: number;
348
- readonly gap: number;
349
- readonly paddingStart: number;
350
- readonly paddingEnd: number;
351
- }, {
352
- readonly _tag: "Measured";
353
- readonly key: string;
354
- readonly height: number;
355
- } | {
356
- readonly _tag: "Prune";
357
- readonly keys: readonly string[];
358
- } | {
359
- readonly _tag: "Scrolled";
360
- readonly top: number;
361
- } | {
362
- readonly _tag: "Settled";
363
- readonly generation: number;
364
- }, never, never, never, void, {}, {}>;
365
- export declare const ViewportScrolled: Schema.TaggedStruct<"ViewportScrolled", {
366
- readonly top: Schema.Number;
367
- }>;
368
- export type ViewportScrolled = typeof ViewportScrolled.Type;
369
- /**
370
- * The scroll container's position, reported on its own scrolls starting
371
- * with the current one. Attach to the scrolling element — viewport scrolls
372
- * arrive through the window-level scroll entry instead.
373
- */
374
- export declare const Viewport: Mount.MountDefinitionNoArgs<"Viewport", {
375
- readonly _tag: "ViewportScrolled";
376
- readonly top: number;
377
- }>;
378
- export declare const RowMeasured: Schema.TaggedStruct<"RowMeasured", {
379
- readonly key: Schema.String;
380
- readonly height: Schema.Number;
381
- }>;
382
- export type RowMeasured = typeof RowMeasured.Type;
383
- /**
384
- * One row's height, reported on every resize starting with the current
385
- * one. The key is the application's row identity, echoed back so the
386
- * parent files the height without tracking which Mount sent what.
387
- */
388
- export declare const MeasureRow: Mount.MountDefinitionWithArgs<"MeasureRow", {
389
- key: Schema.String;
390
- }, {
391
- readonly _tag: "RowMeasured";
392
- readonly key: string;
393
- readonly height: number;
394
- }>;
395
- /**
396
- * Which section header sticks for a window: the last section starting at
397
- * or before the first rendered row, or null above the first section. Order
398
- * independent — the scan takes the maximum, so unsorted input still
399
- * answers. CSS `position: sticky` does the sticking; this answers *what*
400
- * sticks, for styling and callbacks.
401
- */
402
- export declare const stickyHeader: (sections: ReadonlyArray<{
403
- readonly key: string;
404
- readonly index: number;
405
- }>, startIndex: number) => string | null;
406
- /** Where `masonry` puts one item: its column and its box, in pixels. */
407
- export interface MasonryPlacement {
408
- readonly key: string;
409
- readonly column: number;
410
- readonly x: number;
411
- readonly y: number;
412
- readonly width: number;
413
- readonly height: number;
414
- }
415
- /**
416
- * Masonry layout as a pure function: fixed column count and width, each
417
- * item packed into the currently shortest column. Unmeasured items use the
418
- * estimate; poisoned heights fall back the same way. This is layout only,
419
- * not windowing — every placed item renders, so it fits hundreds of images,
420
- * not hundred-thousands. Needing a windowed grid is a different algorithm.
421
- */
422
- export declare const masonry: (keys: ReadonlyArray<string>, heights: Readonly<Record<string, number>>, options: {
423
- readonly columns: number;
424
- readonly columnWidth: number;
425
- readonly gap: number;
426
- readonly estimatedHeight: number;
427
- }) => {
428
- readonly placements: ReadonlyArray<MasonryPlacement>;
429
- readonly totalHeight: number;
430
- };
431
- export {};
432
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/state/history.ts","../../src/state/locale.ts","../../src/state/pagination.ts","../../src/state/range.ts","../../src/state/selection.ts","../../src/state/virtual.ts"],"mappings":";;;qBAIa,eAAgB,OAAK,OAAS,OAAO,MAAM,oBAAe,OAAA;;;;;;;YAQ3D,aAAa;WACd,MAAM,cAAc;WACpB,SAAS;WACT,QAAQ,cAAc;WACtB;;cAGL,QAAS,OAAK,SAAW,UAAQ,aAAa;cAe9C,OAAQ,OAAK,OACV,aAAa,QAAM,OACnB,OAAK;WACQ;WAA2B;MAC9C,aAAa;cAcV,OAAQ,OAAK,OAAS,aAAa,WAAS,aAAa;cAWzD,OAAQ,OAAK,OAAS,aAAa,WAAS,aAAa;cAWzD,OAAQ,OAAK,OAAS,aAAa,QAAM,iBAAiB,aAAa;cAYvE,QAAS,OAAK,OAAS,aAAa,WAAS,aAAa;cAK1D,QAAS,OAAK,OAAS,aAAa,WAAS,aAAa;cAG1D,SAAU,OAAK,OAAS,aAAa,QAAM,kBAAkB,aAAa;;qBAanE,UAAW,OAAK,OAAS,aAAa;;qBAGtC,UAAW,OAAK,OAAS,aAAa;;qBAGtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA6CA,gBAAiB,qBAAqB,OAAK;WAC7C,MAAM;WACN,OAAO,OAAO,MAAM;WACpB;MACV,OAAA,OAAA;;;;;;;;;;;;;;;;;;MAIW,OAAK,OAAA,MAAA;MAAgB,OAAK,OAAA,SAAA,OAAA;;;;;MAG1B,MAAI,OAAA;;;;;qBCrKH,aAAW,OAAA;;;YACZ,qBAAqB,YAAY;qBAEhC,yCAAa;;IAAqC,QAAM,OAAA;;;YAC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BACL;;;;;;;;;;;;;;;qBA2BX,SAAO,OAAA;WAKU;WACP;WACL;WACS;WACF;WACD;WACQ;WACF,iBAAA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAyG1B,kBAAgB,OAAA;;;YACjB,0BAA0B,iBAAiB;;;;;;qBAO1C,UAAQ,MAAA;;;;qBAeR,aAAW,OAAA;;;;YAIZ,qBAAqB,YAAY;;;;;;qBAShC,YAAU,MAAA;;;;;;;;;;;;;;qBAgCV,eAAY,UACb;WAAyB;WAAsB;IAAgB;;iBAe1D;WACN;WACA;WACA;WACA;WACA;WACA;;;;;;;;;qBAUE,UAAO,MACZ,uBAAqB,SAClB,SAAS,yBAAuB;WAE9B;WACA;WACA;WACA;;WAEC,YAAY,cAAc;WAA4B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/state/history.ts","../../src/state/locale.ts","../../src/state/pagination.ts","../../src/state/range.ts","../../src/state/selection.ts","../../src/state/virtual.ts"],"sourcesContent":["import { Schema } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\nimport { Bundle } from 'foldkit-bundle'\n\nexport const HistoryModel = <Value>(value: Schema.Codec<Value, unknown>) =>\n Schema.Struct({\n past: Schema.Array(value),\n present: value,\n future: Schema.Array(value),\n /** The group of the last push, so the next push of the same group joins it; `null` for none. */\n group: Schema.NullOr(Schema.String),\n })\nexport type HistoryModel<Value> = {\n readonly past: ReadonlyArray<Value>\n readonly present: Value\n readonly future: ReadonlyArray<Value>\n readonly group: string | null\n}\n\nconst start = <Value>(present: Value): HistoryModel<Value> => ({\n past: [],\n present,\n future: [],\n group: null,\n})\n\n/**\n * No redo steps, keeping an already empty future: a view that reads the\n * future compares it by identity, so a push per keystroke or stroke cell\n * must not hand it a new empty array each time.\n */\nconst noFuture = <Value>(model: HistoryModel<Value>): ReadonlyArray<Value> =>\n model.future.length === 0 ? model.future : []\n\nconst push = <Value>(\n model: HistoryModel<Value>,\n value: Value,\n options: { readonly capacity: number; readonly group?: string | null | undefined },\n): HistoryModel<Value> => {\n const group = options.group ?? null\n // The same group again joins the last step: the present moves, the past stays.\n if (group !== null && group === model.group && model.past.length > 0)\n return { ...model, present: value, future: noFuture(model) }\n return {\n // slice(-0) is slice(0): a zero capacity keeps nothing, explicitly.\n past: options.capacity === 0 ? [] : [...model.past, model.present].slice(-options.capacity),\n present: value,\n future: noFuture(model),\n group,\n }\n}\n\nconst undo = <Value>(model: HistoryModel<Value>): HistoryModel<Value> => {\n const previous = model.past[model.past.length - 1]\n if (previous === undefined) return model\n return {\n past: model.past.slice(0, -1),\n present: previous,\n future: [model.present, ...model.future],\n group: null,\n }\n}\n\nconst redo = <Value>(model: HistoryModel<Value>): HistoryModel<Value> => {\n const next = model.future[0]\n if (next === undefined) return model\n return {\n past: [...model.past, model.present],\n present: next,\n future: model.future.slice(1),\n group: null,\n }\n}\n\nconst goTo = <Value>(model: HistoryModel<Value>, step: number): HistoryModel<Value> => {\n const steps = [...model.past, model.present, ...model.future]\n if (!Number.isInteger(step) || step < 0 || step >= steps.length || step === model.past.length)\n return model\n return {\n past: steps.slice(0, step),\n present: steps[step]!,\n future: steps.slice(step + 1),\n group: null,\n }\n}\n\nconst clear = <Value>(model: HistoryModel<Value>): HistoryModel<Value> =>\n model.past.length === 0 && model.future.length === 0 && model.group === null\n ? model\n : start(model.present)\n\nconst close = <Value>(model: HistoryModel<Value>): HistoryModel<Value> =>\n model.group === null ? model : { ...model, group: null }\n\nconst revert = <Value>(model: HistoryModel<Value>, group: string): HistoryModel<Value> =>\n // The group is ended even where there is nothing to take back (capacity 0).\n model.group === group ? { ...undo(model), future: [], group: null } : model\n\nconst checkCapacity = (name: string, capacity: number): number => {\n // A negative or fractional capacity would silently keep a wrong-sized past;\n // fail where it is given, naming the caller, instead.\n if (!Number.isInteger(capacity) || capacity < 0)\n throw new Error(`History \"${name}\": capacity must be a non-negative integer`)\n return capacity\n}\n\n/** Whether Undo would move: the past is non-empty. */\nexport const canUndo = <Value>(model: HistoryModel<Value>): boolean => model.past.length > 0\n\n/** Whether Redo would move: the future is non-empty. */\nexport const canRedo = <Value>(model: HistoryModel<Value>): boolean => model.future.length > 0\n\n/** The steps of a history as pure functions of its Model. */\nexport const History = {\n /** A history whose present is `value`, with nothing to undo. */\n start,\n /** Records `value` as the present; the same `group` as the last push joins its step. */\n push,\n /** One step back, or the Model as it was when there is none. */\n undo,\n /** One step forward, or the Model as it was when there is none. */\n redo,\n /**\n * The value at `step` made the present, counting every kept value from the\n * oldest (0), so the present is at `past.length`: what a click on a step's\n * thumbnail does. The Model as it was for the present or a step not kept.\n */\n goTo,\n /** Nothing to undo or redo, the present kept. */\n clear,\n /** The next push starts a step of its own, whatever its group: a group ends here. */\n close,\n /**\n * The step `group` is making taken back, and not redoable: what a cancelled\n * edit, or one that ended where it began, leaves. The Model as it was when\n * the last push was not of `group`. What the group's first push dropped\n * stays dropped: the redo future it cleared, and an entry capacity evicted;\n * with a capacity of 0 nothing was kept, so the present stays and only the\n * group ends.\n */\n revert,\n canUndo,\n canRedo,\n}\n\n/**\n * Undo/redo as a bundle factory: the past, present, and future of one value\n * live in the Model, so every step replays. Pushing records, even an unchanged\n * value; skipping duplicates is the application's policy, not the stack's.\n *\n * A push may name a `group`. Consecutive pushes of the same group are one step:\n * the present moves and nothing new is recorded, so typing a word undoes as a\n * whole. Grouping needs no clock; the application names what belongs together.\n *\n * The steps are also pure functions (`History.push`, `undo`, `redo`, `goTo`, `clear`),\n * for a parent that records an edit in the same transition that makes it\n * rather than dispatching a Message to a placed bundle.\n */\nexport const history = <const Name extends string, Value>(config: {\n readonly name: Name\n readonly value: Schema.Codec<Value, unknown>\n readonly capacity?: number | undefined\n}) => {\n const capacity = checkCapacity(config.name, config.capacity ?? 100)\n const Model = HistoryModel(config.value)\n const Message = defineMessageUnion({\n Push: { value: config.value, group: Schema.optional(Schema.String) },\n Undo: {},\n Redo: {},\n GoTo: { step: Schema.Number },\n Clear: {},\n })\n return Object.assign(\n Bundle.make(config.name, {\n Model,\n Message,\n args: Schema.Struct({ initial: config.value }),\n init: args => ({ model: start(args.initial) }),\n update: (model, message) =>\n Message.match(message, {\n Push: ({ value, group }) => ({ model: push(model, value, { capacity, group }) }),\n Undo: () => ({ model: undo(model) }),\n Redo: () => ({ model: redo(model) }),\n GoTo: ({ step }) => ({ model: goTo(model, step) }),\n Clear: () => ({ model: clear(model) }),\n }),\n }),\n // The union object is both the Message codec and its constructors, so a\n // placement dispatches `EditHistory.Message.Push(...)` like any bundle's\n // exported Message.\n { Message },\n )\n}\n","import { Schema } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\nimport { Bundle } from 'foldkit-bundle'\n\nexport const LocaleModel = Schema.Struct({ locale: Schema.String })\nexport type LocaleModel = typeof LocaleModel.Type\n\nexport const LocaleMessage = defineMessageUnion({ SetLocale: { locale: Schema.String } })\nexport type LocaleMessage = typeof LocaleMessage.Type\n\n/**\n * Locale as a bundle: the current locale string in the Model. Starts from\n * `navigator.language` where available, falling back to the configured\n * default; changes arrive as Messages. No subscriptions: language changes\n * take effect on reload.\n */\nexport const Locale = Bundle.make('Locale', {\n Model: LocaleModel,\n Message: LocaleMessage,\n args: Schema.Struct({ default: Schema.String }),\n init: args => ({\n model: {\n locale:\n typeof navigator !== 'undefined' && typeof navigator.language === 'string'\n ? navigator.language\n : args.default,\n },\n }),\n update: (model, message) =>\n LocaleMessage.match(message, {\n SetLocale: ({ locale }) =>\n locale === model.locale ? { model } : { model: { ...model, locale } },\n }),\n})\n","import { Schema } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\nimport { Bundle } from 'foldkit-bundle'\nimport { unlessSame } from '../internal.js'\n\nexport const PaginationModel = Schema.Struct({\n page: Schema.Number,\n perPage: Schema.Number,\n total: Schema.NullOr(Schema.Number),\n})\nexport type PaginationModel = typeof PaginationModel.Type\n\nexport const PaginationMessage = defineMessageUnion({\n GoToPage: { page: Schema.Number },\n NextPage: {},\n PrevPage: {},\n SetPerPage: { perPage: Schema.Number },\n SetTotal: { total: Schema.NullOr(Schema.Number) },\n})\nexport type PaginationMessage = typeof PaginationMessage.Type\n\nconst clampPage = (page: number, perPage: number, total: number | null): number => {\n if (!Number.isInteger(page)) return 1\n if (page < 1) return 1\n if (total === null) return page\n return Math.min(page, Math.max(1, Math.ceil(total / perPage)))\n}\n\n/** The number of pages, or null while the total is unknown. */\nexport const pageCount = (model: PaginationModel): number | null =>\n model.total === null ? null : Math.max(1, Math.ceil(model.total / model.perPage))\n\n/** The offset of the first item on the page, for a slice or a query. */\nexport const offset = (model: PaginationModel): number => (model.page - 1) * model.perPage\n\n/**\n * Pagination as a bundle: the page, page size, and total live in the Model,\n * so page changes replay and every transition clamps into range. Pure logic,\n * no streams: data loading stays the application's job.\n */\nexport const Pagination = Bundle.make('Pagination', {\n Model: PaginationModel,\n Message: PaginationMessage,\n args: Schema.Struct({\n perPage: Schema.Number.pipe(\n Schema.check(Schema.isGreaterThan(0)),\n Schema.check(Schema.isFinite()),\n ),\n total: Schema.optional(Schema.NullOr(Schema.Number.pipe(Schema.check(Schema.isFinite())))),\n }),\n init: args => ({\n model: { page: 1, perPage: args.perPage, total: args.total ?? null },\n }),\n update: (model, message) =>\n PaginationMessage.match(message, {\n GoToPage: ({ page }) => ({\n model: unlessSame(model, { ...model, page: clampPage(page, model.perPage, model.total) }),\n }),\n NextPage: () => ({\n model: unlessSame(model, {\n ...model,\n page: clampPage(model.page + 1, model.perPage, model.total),\n }),\n }),\n PrevPage: () => ({\n model: unlessSame(model, {\n ...model,\n page: clampPage(model.page - 1, model.perPage, model.total),\n }),\n }),\n SetPerPage: ({ perPage }) =>\n perPage > 0\n ? {\n model: unlessSame(model, {\n ...model,\n perPage,\n page: clampPage(model.page, perPage, model.total),\n }),\n }\n : { model },\n // Sent again on every refetch, usually with the total already held.\n SetTotal: ({ total }) =>\n total === null || total >= 0\n ? {\n model: unlessSame(model, {\n ...model,\n total,\n page: clampPage(model.page, model.perPage, total),\n }),\n }\n : { model },\n }),\n})\n","/**\n * A numeric range as an array: `range(1, 4)` is `[1, 2, 3]`, inclusive of\n * the start and exclusive of the end, like `Array.from` length math. The\n * pagination companion: `range(1, (pageCount(model) ?? 0) + 1)` is the page\n * list. A zero or non-finite step would loop forever, so it throws, naming\n * the caller — like History's capacity check.\n */\nexport const range = (start: number, end: number, step = 1): ReadonlyArray<number> => {\n if (!Number.isFinite(step) || step === 0) {\n throw new Error(`range: step must be a non-zero finite number, got ${step}`)\n }\n const values: Array<number> = []\n if (step > 0) {\n for (let value = start; value < end; value += step) {\n values.push(value)\n }\n } else {\n for (let value = start; value > end; value += step) {\n values.push(value)\n }\n }\n return values\n}\n","import { Schema } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\nimport { Bundle } from 'foldkit-bundle'\nimport { sameIds } from '../internal.js'\n\nexport const SelectionSetModel = Schema.Struct({ selected: Schema.Array(Schema.String) })\nexport type SelectionSetModel = typeof SelectionSetModel.Type\n\nexport const SelectionSetMessage = defineMessageUnion({\n Select: { id: Schema.String },\n Deselect: { id: Schema.String },\n Toggle: { id: Schema.String },\n ReplaceAll: { ids: Schema.Array(Schema.String) },\n Clear: {},\n})\nexport type SelectionSetMessage = typeof SelectionSetMessage.Type\n\nconst without = (selected: ReadonlyArray<string>, id: string): ReadonlyArray<string> =>\n selected.filter(other => other !== id)\n\n/** Whether the id is currently selected. */\nexport const isSelected = (model: SelectionSetModel, id: string): boolean =>\n model.selected.includes(id)\n\n/**\n * A selection set as a bundle: the selected ids in the Model, changed one at\n * a time or replaced whole. Order follows first selection; toggling moves a\n * reselected id to the end. Pure logic, no streams.\n */\nexport const SelectionSet = Bundle.make('SelectionSet', {\n Model: SelectionSetModel,\n Message: SelectionSetMessage,\n init: () => ({ model: { selected: [] } }),\n update: (model, message) =>\n SelectionSetMessage.match(message, {\n Select: ({ id }) =>\n isSelected(model, id) ? { model } : { model: { selected: [...model.selected, id] } },\n Deselect: ({ id }) =>\n isSelected(model, id) ? { model: { selected: without(model.selected, id) } } : { model },\n Toggle: ({ id }) =>\n isSelected(model, id)\n ? { model: { selected: without(model.selected, id) } }\n : { model: { selected: [...model.selected, id] } },\n ReplaceAll: ({ ids }) => {\n const selected = [...new Set(ids)]\n return sameIds(selected, model.selected) ? { model } : { model: { selected } }\n },\n Clear: () => (model.selected.length === 0 ? { model } : { model: { selected: [] } }),\n }),\n})\n","import { Effect, Queue, Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\nimport * as Mount from 'foldkit/mount'\nimport type * as Update from 'foldkit/update'\nimport { Bundle } from 'foldkit-bundle'\n\n/** The rows to draw: a half-open range of indexes. */\nexport interface VirtualWindow {\n /** First visible row index, inclusive. */\n readonly start: number\n /** End row index, exclusive. */\n readonly end: number\n}\n\n/** Layout constants: per-row estimate, inter-row gap, and end padding. */\nexport interface VirtualLayout {\n readonly estimatedHeight: number\n readonly gap: number\n readonly paddingStart: number\n readonly paddingEnd: number\n}\n\nconst saneHeight = (height: number, estimatedHeight: number): number =>\n Number.isFinite(height) && height >= 0 ? height : estimatedHeight\n\nconst heightAt = (\n index: number,\n heights: Readonly<Record<string, number>>,\n keys: ReadonlyArray<string>,\n layout: VirtualLayout,\n): number => {\n const key = keys[index]\n if (key === undefined) return layout.estimatedHeight\n return saneHeight(heights[key] ?? layout.estimatedHeight, layout.estimatedHeight)\n}\n\ninterface Offsets {\n readonly heights: Readonly<Record<string, number>>\n readonly layout: VirtualLayout\n /** `tops[i]` is row i's top edge; `tops[count]` is past the last row's gap. */\n readonly tops: Float64Array\n}\n\n// One entry per keys array, replaced when the heights or the layout change: a\n// view that keeps its keys array between renders pays O(n) once per change of\n// heights, not once per call. Keys and heights are compared by identity, so an\n// array or record changed in place reads stale offsets; the Model never is.\nconst offsetsCache = new WeakMap<ReadonlyArray<string>, Offsets>()\n\nconst sameLayout = (a: VirtualLayout, b: VirtualLayout): boolean =>\n a.estimatedHeight === b.estimatedHeight &&\n a.gap === b.gap &&\n a.paddingStart === b.paddingStart &&\n a.paddingEnd === b.paddingEnd\n\nconst topsFor = (\n keys: ReadonlyArray<string>,\n heights: Readonly<Record<string, number>>,\n layout: VirtualLayout,\n): Float64Array => {\n const cached = offsetsCache.get(keys)\n if (cached !== undefined && cached.heights === heights && sameLayout(cached.layout, layout)) {\n return cached.tops\n }\n const tops = new Float64Array(keys.length + 1)\n tops[0] = layout.paddingStart\n for (let index = 0; index < keys.length; index++) {\n tops[index + 1] = tops[index]! + heightAt(index, heights, keys, layout) + layout.gap\n }\n offsetsCache.set(keys, { heights, layout: { ...layout }, tops })\n return tops\n}\n\n/** The first index in `[from, to)` whose value passes `test`, or `to`; `test` must be monotonic. */\nconst firstIndex = (from: number, to: number, test: (index: number) => boolean): number => {\n let low = from\n let high = to\n while (low < high) {\n const middle = (low + high) >>> 1\n if (test(middle)) high = middle\n else low = middle + 1\n }\n return low\n}\n\n/** Total scrollable height: padding, measured rows, estimates, and gaps. */\nexport const totalHeight = (\n keys: ReadonlyArray<string>,\n heights: Readonly<Record<string, number>>,\n layout: VirtualLayout,\n): number => {\n const last = keys.length - 1\n if (last === -1) return layout.paddingStart + layout.paddingEnd\n // The last row's bottom edge, not `tops[count]` less a gap: subtracting a\n // fractional gap back out need not land where the row ends.\n return (\n topsFor(keys, heights, layout)[last]! +\n heightAt(last, heights, keys, layout) +\n layout.paddingEnd\n )\n}\n\n/** Pixel offset of a row's top edge: padding plus the prefix before it. */\nexport const offsetFor = (\n index: number,\n keys: ReadonlyArray<string>,\n heights: Readonly<Record<string, number>>,\n layout: VirtualLayout,\n): number => topsFor(keys, heights, layout)[Math.max(0, Math.min(index, keys.length))]!\n\n/**\n * Which rows to render for a scroll position: the rows intersecting\n * `[scrollTop, scrollTop + viewportHeight)`, widened by `overscan` on both\n * sides and clamped to `[0, count]`. Gaps and padding are dead space — no\n * row — so boxes are tested, not cumulative coverage. An overscan of zero\n * renders exactly the visible rows.\n */\nexport const visibleRange = (\n keys: ReadonlyArray<string>,\n heights: Readonly<Record<string, number>>,\n layout: VirtualLayout,\n scrollTop: number,\n viewportHeight: number,\n overscan: number,\n): VirtualWindow => {\n const count = keys.length\n if (count === 0 || viewportHeight <= 0) return { start: 0, end: 0 }\n const tops = topsFor(keys, heights, layout)\n const top = Math.max(0, scrollTop)\n const bottom = top + viewportHeight\n // Row bottoms and tops only grow with the index, so both edges are searches.\n const start = firstIndex(\n 0,\n count,\n index => tops[index]! + heightAt(index, heights, keys, layout) > top,\n )\n const end = firstIndex(start, count, index => tops[index]! >= bottom)\n return {\n start: Math.max(0, start - Math.max(0, overscan)),\n end: Math.min(count, end + Math.max(0, overscan)),\n }\n}\n\nexport const VirtualModel = Schema.Struct({\n scrollTop: Schema.Number,\n heights: Schema.Record(Schema.String, Schema.Number),\n scrolling: Schema.Boolean,\n generation: Schema.Number,\n estimatedHeight: Schema.Number,\n overscan: Schema.Number,\n gap: Schema.Number,\n paddingStart: Schema.Number,\n paddingEnd: Schema.Number,\n})\nexport type VirtualModel = typeof VirtualModel.Type\n\nexport const VirtualMessage = defineMessageUnion({\n Scrolled: { top: Schema.Number },\n Measured: { key: Schema.String, height: Schema.Number },\n /** Drops heights for keys no longer listed: the bundle never sees the key\n order, so the application tells it what left. */\n Prune: { keys: Schema.Array(Schema.String) },\n /** Fires when scrolling has been silent for `settleMs`: only the latest\n generation counts, so a fling's intermediate timers emit nothing. */\n Settled: { generation: Schema.Number },\n})\nexport type VirtualMessage = typeof VirtualMessage.Type\n\nconst layoutOf = (model: VirtualModel): VirtualLayout => ({\n estimatedHeight: model.estimatedHeight,\n gap: model.gap,\n paddingStart: model.paddingStart,\n paddingEnd: model.paddingEnd,\n})\n\n/**\n * The rows to render plus the spacer height, from the Model, the key order,\n * and the viewport height. Layout and overscan come from the Model, so the\n * call cannot disagree with the placement. Keys stay the application's:\n * render each row keyed, and per-row placements keep identity.\n */\nexport const windowFor = (\n model: VirtualModel,\n keys: ReadonlyArray<string>,\n viewportHeight: number,\n): VirtualWindow & { readonly totalHeight: number } => {\n const layout = layoutOf(model)\n const window = visibleRange(\n keys,\n model.heights,\n layout,\n model.scrollTop,\n viewportHeight,\n model.overscan,\n )\n return { ...window, totalHeight: totalHeight(keys, model.heights, layout) }\n}\n\n/**\n * Pixels from the viewport's bottom edge to the content's end: negative\n * past it, zero exactly there. Prefetch thresholds want this number (\"load\n * when within 500px\"), not just the boolean below.\n */\nexport const distanceToEnd = (\n model: VirtualModel,\n keys: ReadonlyArray<string>,\n viewportHeight: number,\n): number => {\n const total = totalHeight(keys, model.heights, layoutOf(model))\n return total - (model.scrollTop + viewportHeight)\n}\n\n/**\n * Whether the viewport rests at (or past) the end, within `threshold`\n * pixels: the infinite-scroll check. An empty list counts as ended — there\n * is nothing to scroll, so more should load. Thresholds below zero clamp\n * to zero.\n */\nexport const isAtEnd = (\n model: VirtualModel,\n keys: ReadonlyArray<string>,\n viewportHeight: number,\n threshold = 0,\n): boolean => {\n const total = totalHeight(keys, model.heights, layoutOf(model))\n if (total <= 0) return true\n return total - (model.scrollTop + viewportHeight) <= Math.max(0, threshold)\n}\n\nconst saneTop = (top: number): number | null => (Number.isFinite(top) ? Math.max(0, top) : null)\n\nconst saneMeasured = (height: number): number | null =>\n Number.isFinite(height) && height >= 0 ? height : null\n\n/**\n * Windowing math for virtualized lists as pure functions: which rows to\n * render, how tall the scrollable area is, and where each row starts. Row\n * heights come from measured values with a per-row estimate fallback, so\n * unmeasured rows still occupy space and measuring later only corrects.\n * Keys are strings; heights are non-negative, and non-finite measurements\n * fall back to the estimate instead of poisoning the sums.\n *\n * The `Virtual` bundle below owns the scroll position and the measured\n * heights; `Viewport` reports container scrolls and `MeasureRow` reports\n * row heights, both as Mounts on the elements they observe. The application\n * renders `windowFor(...)` rows with its own views (keyed, so `each`\n * placements keep identity) inside a spacer of `totalHeight(...)`.\n */\nexport const Virtual = Bundle.make<\n 'Virtual',\n VirtualModel,\n VirtualMessage,\n {\n readonly estimatedHeight: number\n readonly overscan: number\n readonly gap: number\n readonly paddingStart: number\n readonly paddingEnd: number\n readonly settleMs?: number | undefined\n readonly initialScrollTop?: number | undefined\n readonly initialHeights?: Readonly<Record<string, number>> | undefined\n }\n>('Virtual', {\n Model: VirtualModel,\n Message: VirtualMessage,\n args: Schema.Struct({\n estimatedHeight: Schema.Number.pipe(\n Schema.check(Schema.isGreaterThan(0)),\n Schema.check(Schema.isFinite()),\n ),\n overscan: Schema.Int.pipe(Schema.check(Schema.isGreaterThanOrEqualTo(0))),\n gap: Schema.Number.pipe(\n Schema.check(Schema.isGreaterThanOrEqualTo(0)),\n Schema.check(Schema.isFinite()),\n ),\n paddingStart: Schema.Number.pipe(\n Schema.check(Schema.isGreaterThanOrEqualTo(0)),\n Schema.check(Schema.isFinite()),\n ),\n paddingEnd: Schema.Number.pipe(\n Schema.check(Schema.isGreaterThanOrEqualTo(0)),\n Schema.check(Schema.isFinite()),\n ),\n settleMs: Schema.optional(\n Schema.Number.pipe(Schema.check(Schema.isGreaterThan(0)), Schema.check(Schema.isFinite())),\n ),\n initialScrollTop: Schema.optional(\n Schema.Number.pipe(\n Schema.check(Schema.isGreaterThanOrEqualTo(0)),\n Schema.check(Schema.isFinite()),\n ),\n ),\n initialHeights: Schema.optional(Schema.Record(Schema.String, Schema.Number)),\n }),\n init: args => {\n // Restored measurements pass through the same sanitation as live ones,\n // so a poisoned cache cannot wedge the sums.\n const heights: Record<string, number> = {}\n for (const [key, height] of Object.entries(args.initialHeights ?? {})) {\n const sane = saneMeasured(height)\n if (sane !== null) heights[key] = sane\n }\n return {\n model: {\n scrollTop: args.initialScrollTop ?? 0,\n heights,\n scrolling: false,\n generation: 0,\n estimatedHeight: args.estimatedHeight,\n overscan: args.overscan,\n gap: args.gap,\n paddingStart: args.paddingStart,\n paddingEnd: args.paddingEnd,\n },\n }\n },\n update: (model, message, args) =>\n VirtualMessage.match<Update.ReturnWithOutMessage<VirtualModel, VirtualMessage, never>>(\n message,\n {\n Scrolled: ({ top }) => {\n const sane = saneTop(top)\n // The Viewport reports the position it mounts at, and a horizontal\n // scroll reports an unchanged top. The raw top is compared, so an\n // overscroll past zero still counts as scrolling.\n if (sane === null || top === model.scrollTop) return { model }\n const generation = model.generation + 1\n return {\n model: { ...model, scrollTop: sane, scrolling: true, generation },\n commands: [\n {\n name: 'Virtual.settle',\n args: { generation },\n effect: Effect.as(\n Effect.sleep(args.settleMs ?? 150),\n VirtualMessage.Settled({ generation }),\n ),\n },\n ],\n }\n },\n Measured: ({ key, height }) => {\n const sane = saneMeasured(height)\n // A remounted row, or a width-only resize, reports the height held.\n return sane === null || (Object.hasOwn(model.heights, key) && model.heights[key] === sane)\n ? { model }\n : { model: { ...model, heights: { ...model.heights, [key]: sane } } }\n },\n Prune: ({ keys }) => {\n const kept = new Set(keys)\n const heights: Record<string, number> = {}\n let dropped = false\n for (const [key, height] of Object.entries(model.heights)) {\n if (kept.has(key)) heights[key] = height\n else dropped = true\n }\n return dropped ? { model: { ...model, heights } } : { model }\n },\n // A superseded silence timer carries an old generation: ignore it.\n Settled: ({ generation }) =>\n generation === model.generation ? { model: { ...model, scrolling: false } } : { model },\n },\n ),\n})\n\nexport const ViewportScrolled = Schema.TaggedStruct('ViewportScrolled', { top: Schema.Number })\nexport type ViewportScrolled = typeof ViewportScrolled.Type\n\n/**\n * The scroll container's position, reported on its own scrolls starting\n * with the current one. Attach to the scrolling element — viewport scrolls\n * arrive through the window-level scroll entry instead.\n */\nexport const Viewport = Mount.defineStream('Viewport', {\n messages: [ViewportScrolled],\n execute: ({ element }) => {\n // The mount needs only a scroll position, not a full Element.\n const read = (): ViewportScrolled => {\n const scroller = element as unknown as { readonly scrollTop: number }\n return ViewportScrolled.make({ top: scroller.scrollTop })\n }\n return Stream.concat(\n Stream.make(read()),\n Stream.fromEventListener(element, 'scroll').pipe(Stream.map(read)),\n )\n },\n})\n\nexport const RowMeasured = Schema.TaggedStruct('RowMeasured', {\n key: Schema.String,\n height: Schema.Number,\n})\nexport type RowMeasured = typeof RowMeasured.Type\n\ntype RowObserverCtor = new (callback: ResizeObserverCallback) => ResizeObserver\n\n/**\n * One row's height, reported on every resize starting with the current\n * one. The key is the application's row identity, echoed back so the\n * parent files the height without tracking which Mount sent what.\n */\nexport const MeasureRow = Mount.defineStream('MeasureRow', {\n messages: [RowMeasured],\n args: { key: Schema.String },\n execute: ({ element, key }) =>\n Stream.callback<typeof RowMeasured.Type>(queue =>\n Effect.gen(function* () {\n const Observed = (globalThis as { ResizeObserver?: RowObserverCtor }).ResizeObserver\n if (Observed === undefined) return\n yield* Effect.acquireRelease(\n Effect.sync(() => {\n const observer = new Observed(entries => {\n const rect = entries[0]?.contentRect\n if (rect !== undefined) {\n Queue.offerUnsafe(queue, RowMeasured.make({ key, height: rect.height }))\n }\n })\n observer.observe(element)\n return observer\n }),\n observer => Effect.sync(() => observer.disconnect()),\n )\n }),\n ),\n})\n\n/**\n * Which section header sticks for a window: the last section starting at\n * or before the first rendered row, or null above the first section. Order\n * independent — the scan takes the maximum, so unsorted input still\n * answers. CSS `position: sticky` does the sticking; this answers *what*\n * sticks, for styling and callbacks.\n */\nexport const stickyHeader = (\n sections: ReadonlyArray<{ readonly key: string; readonly index: number }>,\n startIndex: number,\n): string | null => {\n let current: string | null = null\n let currentIndex = -1\n for (const section of sections) {\n if (section.index <= startIndex && section.index > currentIndex) {\n current = section.key\n currentIndex = section.index\n }\n }\n return current\n}\n\n/** Where `masonry` puts one item: its column and its box, in pixels. */\nexport interface MasonryPlacement {\n readonly key: string\n readonly column: number\n readonly x: number\n readonly y: number\n readonly width: number\n readonly height: number\n}\n\n/**\n * Masonry layout as a pure function: fixed column count and width, each\n * item packed into the currently shortest column. Unmeasured items use the\n * estimate; poisoned heights fall back the same way. This is layout only,\n * not windowing — every placed item renders, so it fits hundreds of images,\n * not hundred-thousands. Needing a windowed grid is a different algorithm.\n */\nexport const masonry = (\n keys: ReadonlyArray<string>,\n heights: Readonly<Record<string, number>>,\n options: {\n readonly columns: number\n readonly columnWidth: number\n readonly gap: number\n readonly estimatedHeight: number\n },\n): { readonly placements: ReadonlyArray<MasonryPlacement>; readonly totalHeight: number } => {\n if (!Number.isInteger(options.columns) || options.columns < 1) {\n throw new Error(`masonry: columns must be a positive integer, got ${options.columns}`)\n }\n if (!(options.columnWidth > 0) || !Number.isFinite(options.columnWidth)) {\n throw new Error(\n `masonry: columnWidth must be a positive finite number, got ${options.columnWidth}`,\n )\n }\n if (options.gap < 0 || !Number.isFinite(options.gap)) {\n throw new Error(`masonry: gap must be a non-negative finite number, got ${options.gap}`)\n }\n if (options.estimatedHeight < 0 || !Number.isFinite(options.estimatedHeight)) {\n throw new Error(\n `masonry: estimatedHeight must be a non-negative finite number, got ${options.estimatedHeight}`,\n )\n }\n const columnHeights: Array<number> = new Array(options.columns).fill(0)\n const placements: Array<MasonryPlacement> = []\n for (const key of keys) {\n const raw = heights[key] ?? options.estimatedHeight\n const height = Number.isFinite(raw) && raw >= 0 ? raw : options.estimatedHeight\n let column = 0\n for (let c = 1; c < columnHeights.length; c++) {\n if (columnHeights[c]! < columnHeights[column]!) column = c\n }\n placements.push({\n key,\n column,\n x: column * (options.columnWidth + options.gap),\n y: columnHeights[column]!,\n width: options.columnWidth,\n height,\n })\n columnHeights[column] = columnHeights[column]! + height + options.gap\n }\n return {\n placements,\n totalHeight: placements.length === 0 ? 0 : Math.max(...columnHeights) - options.gap,\n }\n}\n"],"mappings":";;;;;;AAIA,MAAa,gBAAuB,UAClC,OAAO,OAAO;CACZ,MAAM,OAAO,MAAM,KAAK;CACxB,SAAS;CACT,QAAQ,OAAO,MAAM,KAAK;;CAE1B,OAAO,OAAO,OAAO,OAAO,MAAM;AACpC,CAAC;AAQH,MAAM,SAAgB,aAAyC;CAC7D,MAAM,CAAC;CACP;CACA,QAAQ,CAAC;CACT,OAAO;AACT;;;;;;AAOA,MAAM,YAAmB,UACvB,MAAM,OAAO,WAAW,IAAI,MAAM,SAAS,CAAC;AAE9C,MAAM,QACJ,OACA,OACA,YACwB;CACxB,MAAM,QAAQ,QAAQ,SAAS;CAE/B,IAAI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