aeon-ui-engine 1.8.0 → 1.10.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 (531) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +33 -0
  3. package/package.json +5 -2
  4. package/packages/core/dist/index.d.ts +116 -1
  5. package/packages/core/dist/index.js +202 -1
  6. package/packages/core/src/anatomy.ts +13 -1
  7. package/packages/core/src/index.ts +2 -0
  8. package/packages/core/src/list-window.ts +149 -0
  9. package/packages/core/src/sound.ts +154 -0
  10. package/packages/panda/package.json +6 -3
  11. package/packages/panda/panda.config.ts +12 -0
  12. package/packages/panda/src/recipes/clipboard.ts +40 -0
  13. package/packages/panda/src/recipes/composer.ts +4 -3
  14. package/packages/panda/src/recipes/index.ts +4 -0
  15. package/packages/panda/src/recipes/prose.ts +110 -0
  16. package/packages/panda/src/recipes/segment-group.ts +50 -0
  17. package/packages/panda/src/recipes/textarea.ts +60 -0
  18. package/packages/panda/styled-system/css/conditions.d.ts +7 -0
  19. package/packages/panda/styled-system/css/conditions.js +32 -0
  20. package/packages/panda/styled-system/css/css.d.ts +6 -6
  21. package/packages/panda/styled-system/css/css.js +63 -0
  22. package/packages/panda/styled-system/css/cva.d.ts +2 -3
  23. package/packages/panda/styled-system/css/cva.js +51 -0
  24. package/packages/panda/styled-system/css/cx.d.ts +5 -4
  25. package/packages/panda/styled-system/css/{cx.mjs → cx.js} +5 -4
  26. package/packages/panda/styled-system/css/first-that-works.d.ts +22 -0
  27. package/packages/panda/styled-system/css/first-that-works.js +1 -0
  28. package/packages/panda/styled-system/css/index.d.ts +6 -3
  29. package/packages/panda/styled-system/css/index.js +8 -0
  30. package/packages/panda/styled-system/css/keyframes.d.ts +5 -0
  31. package/packages/panda/styled-system/css/keyframes.js +8 -0
  32. package/packages/panda/styled-system/css/position-try.d.ts +5 -0
  33. package/packages/panda/styled-system/css/position-try.js +11 -0
  34. package/packages/panda/styled-system/css/sva.d.ts +1 -2
  35. package/packages/panda/styled-system/css/sva.js +49 -0
  36. package/packages/panda/styled-system/css/view-transition.d.ts +7 -0
  37. package/packages/panda/styled-system/css/view-transition.js +18 -0
  38. package/packages/panda/styled-system/helpers.d.ts +67 -0
  39. package/packages/panda/styled-system/helpers.js +624 -0
  40. package/packages/panda/styled-system/jsx/aspect-ratio.d.ts +3 -6
  41. package/packages/panda/styled-system/jsx/aspect-ratio.js +11 -0
  42. package/packages/panda/styled-system/jsx/bleed.d.ts +4 -7
  43. package/packages/panda/styled-system/jsx/bleed.js +11 -0
  44. package/packages/panda/styled-system/jsx/box.d.ts +4 -7
  45. package/packages/panda/styled-system/jsx/box.js +11 -0
  46. package/packages/panda/styled-system/jsx/center.d.ts +4 -7
  47. package/packages/panda/styled-system/jsx/center.js +11 -0
  48. package/packages/panda/styled-system/jsx/circle.d.ts +4 -7
  49. package/packages/panda/styled-system/jsx/circle.js +11 -0
  50. package/packages/panda/styled-system/jsx/container.d.ts +4 -7
  51. package/packages/panda/styled-system/jsx/container.js +11 -0
  52. package/packages/panda/styled-system/jsx/cq.d.ts +4 -7
  53. package/packages/panda/styled-system/jsx/cq.js +11 -0
  54. package/packages/panda/styled-system/jsx/create-recipe-context.d.ts +31 -0
  55. package/packages/panda/styled-system/jsx/create-recipe-context.js +38 -0
  56. package/packages/panda/styled-system/jsx/create-slot-recipe-context.d.ts +49 -0
  57. package/packages/panda/styled-system/jsx/create-slot-recipe-context.js +124 -0
  58. package/packages/panda/styled-system/jsx/divider.d.ts +4 -7
  59. package/packages/panda/styled-system/jsx/divider.js +11 -0
  60. package/packages/panda/styled-system/jsx/factory.d.ts +2 -2
  61. package/packages/panda/styled-system/jsx/factory.js +91 -0
  62. package/packages/panda/styled-system/jsx/flex.d.ts +4 -7
  63. package/packages/panda/styled-system/jsx/flex.js +11 -0
  64. package/packages/panda/styled-system/jsx/float.d.ts +4 -7
  65. package/packages/panda/styled-system/jsx/float.js +11 -0
  66. package/packages/panda/styled-system/jsx/grid-item.d.ts +4 -7
  67. package/packages/panda/styled-system/jsx/grid-item.js +11 -0
  68. package/packages/panda/styled-system/jsx/grid.d.ts +4 -7
  69. package/packages/panda/styled-system/jsx/grid.js +11 -0
  70. package/packages/panda/styled-system/jsx/helper.d.ts +34 -0
  71. package/packages/panda/styled-system/jsx/helper.js +92 -0
  72. package/packages/panda/styled-system/jsx/hstack.d.ts +4 -7
  73. package/packages/panda/styled-system/jsx/hstack.js +11 -0
  74. package/packages/panda/styled-system/jsx/index.d.ts +17 -17
  75. package/packages/panda/styled-system/jsx/index.js +24 -0
  76. package/packages/panda/styled-system/jsx/is-valid-prop.d.ts +5 -10
  77. package/packages/panda/styled-system/jsx/is-valid-prop.js +12 -0
  78. package/packages/panda/styled-system/jsx/link-overlay.d.ts +4 -7
  79. package/packages/panda/styled-system/jsx/link-overlay.js +11 -0
  80. package/packages/panda/styled-system/jsx/spacer.d.ts +4 -7
  81. package/packages/panda/styled-system/jsx/spacer.js +11 -0
  82. package/packages/panda/styled-system/jsx/square.d.ts +4 -7
  83. package/packages/panda/styled-system/jsx/square.js +11 -0
  84. package/packages/panda/styled-system/jsx/stack.d.ts +4 -7
  85. package/packages/panda/styled-system/jsx/stack.js +11 -0
  86. package/packages/panda/styled-system/jsx/visually-hidden.d.ts +4 -7
  87. package/packages/panda/styled-system/jsx/visually-hidden.js +11 -0
  88. package/packages/panda/styled-system/jsx/vstack.d.ts +4 -7
  89. package/packages/panda/styled-system/jsx/vstack.js +11 -0
  90. package/packages/panda/styled-system/jsx/wrap.d.ts +4 -7
  91. package/packages/panda/styled-system/jsx/wrap.js +11 -0
  92. package/packages/panda/styled-system/patterns/aspect-ratio.d.ts +8 -9
  93. package/packages/panda/styled-system/patterns/aspect-ratio.js +37 -0
  94. package/packages/panda/styled-system/patterns/bleed.d.ts +9 -10
  95. package/packages/panda/styled-system/patterns/bleed.js +30 -0
  96. package/packages/panda/styled-system/patterns/box.d.ts +8 -11
  97. package/packages/panda/styled-system/patterns/box.js +16 -0
  98. package/packages/panda/styled-system/patterns/center.d.ts +8 -9
  99. package/packages/panda/styled-system/patterns/center.js +22 -0
  100. package/packages/panda/styled-system/patterns/circle.d.ts +8 -9
  101. package/packages/panda/styled-system/patterns/circle.js +26 -0
  102. package/packages/panda/styled-system/patterns/container.d.ts +8 -11
  103. package/packages/panda/styled-system/patterns/container.js +26 -0
  104. package/packages/panda/styled-system/patterns/cq.d.ts +10 -10
  105. package/packages/panda/styled-system/patterns/cq.js +24 -0
  106. package/packages/panda/styled-system/patterns/divider.d.ts +11 -11
  107. package/packages/panda/styled-system/patterns/divider.js +31 -0
  108. package/packages/panda/styled-system/patterns/flex.d.ts +14 -15
  109. package/packages/panda/styled-system/patterns/flex.js +27 -0
  110. package/packages/panda/styled-system/patterns/float.d.ts +12 -12
  111. package/packages/panda/styled-system/patterns/float.js +84 -0
  112. package/packages/panda/styled-system/patterns/grid-item.d.ts +13 -14
  113. package/packages/panda/styled-system/patterns/grid-item.js +26 -0
  114. package/packages/panda/styled-system/patterns/grid.d.ts +13 -13
  115. package/packages/panda/styled-system/patterns/grid.js +30 -0
  116. package/packages/panda/styled-system/patterns/hstack.d.ts +9 -10
  117. package/packages/panda/styled-system/patterns/hstack.js +27 -0
  118. package/packages/panda/styled-system/patterns/index.d.ts +14 -15
  119. package/packages/panda/styled-system/patterns/index.js +20 -0
  120. package/packages/panda/styled-system/patterns/link-overlay.d.ts +8 -11
  121. package/packages/panda/styled-system/patterns/link-overlay.js +25 -0
  122. package/packages/panda/styled-system/patterns/runtime.js +25 -0
  123. package/packages/panda/styled-system/patterns/spacer.d.ts +9 -9
  124. package/packages/panda/styled-system/patterns/spacer.js +26 -0
  125. package/packages/panda/styled-system/patterns/square.d.ts +8 -9
  126. package/packages/panda/styled-system/patterns/square.js +25 -0
  127. package/packages/panda/styled-system/patterns/stack.d.ts +11 -12
  128. package/packages/panda/styled-system/patterns/stack.js +30 -0
  129. package/packages/panda/styled-system/patterns/visually-hidden.d.ts +8 -11
  130. package/packages/panda/styled-system/patterns/visually-hidden.js +19 -0
  131. package/packages/panda/styled-system/patterns/vstack.d.ts +9 -10
  132. package/packages/panda/styled-system/patterns/vstack.js +27 -0
  133. package/packages/panda/styled-system/patterns/wrap.d.ts +12 -13
  134. package/packages/panda/styled-system/patterns/wrap.js +26 -0
  135. package/packages/panda/styled-system/recipes/aeon-accordion.d.ts +9 -26
  136. package/packages/panda/styled-system/recipes/aeon-accordion.js +5 -0
  137. package/packages/panda/styled-system/recipes/aeon-app-shell.d.ts +10 -26
  138. package/packages/panda/styled-system/recipes/aeon-app-shell.js +5 -0
  139. package/packages/panda/styled-system/recipes/aeon-async.d.ts +9 -26
  140. package/packages/panda/styled-system/recipes/aeon-async.js +5 -0
  141. package/packages/panda/styled-system/recipes/aeon-avatar.d.ts +10 -28
  142. package/packages/panda/styled-system/recipes/aeon-avatar.js +5 -0
  143. package/packages/panda/styled-system/recipes/aeon-badge.d.ts +8 -26
  144. package/packages/panda/styled-system/recipes/aeon-badge.js +5 -0
  145. package/packages/panda/styled-system/recipes/aeon-bar.d.ts +13 -32
  146. package/packages/panda/styled-system/recipes/aeon-bar.js +5 -0
  147. package/packages/panda/styled-system/recipes/aeon-button-group.d.ts +10 -33
  148. package/packages/panda/styled-system/recipes/aeon-button-group.js +5 -0
  149. package/packages/panda/styled-system/recipes/aeon-button.d.ts +10 -33
  150. package/packages/panda/styled-system/recipes/aeon-button.js +5 -0
  151. package/packages/panda/styled-system/recipes/aeon-checkbox.d.ts +9 -24
  152. package/packages/panda/styled-system/recipes/aeon-checkbox.js +5 -0
  153. package/packages/panda/styled-system/recipes/aeon-clipboard.d.ts +16 -0
  154. package/packages/panda/styled-system/recipes/aeon-clipboard.js +5 -0
  155. package/packages/panda/styled-system/recipes/aeon-combobox.d.ts +9 -26
  156. package/packages/panda/styled-system/recipes/aeon-combobox.js +5 -0
  157. package/packages/panda/styled-system/recipes/aeon-composer.d.ts +9 -24
  158. package/packages/panda/styled-system/recipes/aeon-composer.js +5 -0
  159. package/packages/panda/styled-system/recipes/aeon-content.d.ts +10 -26
  160. package/packages/panda/styled-system/recipes/aeon-content.js +5 -0
  161. package/packages/panda/styled-system/recipes/aeon-conversation.d.ts +9 -24
  162. package/packages/panda/styled-system/recipes/aeon-conversation.js +5 -0
  163. package/packages/panda/styled-system/recipes/aeon-dialog.d.ts +9 -24
  164. package/packages/panda/styled-system/recipes/aeon-dialog.js +5 -0
  165. package/packages/panda/styled-system/recipes/aeon-entry.d.ts +11 -30
  166. package/packages/panda/styled-system/recipes/aeon-entry.js +5 -0
  167. package/packages/panda/styled-system/recipes/aeon-field.d.ts +9 -26
  168. package/packages/panda/styled-system/recipes/aeon-field.js +5 -0
  169. package/packages/panda/styled-system/recipes/aeon-file-upload.d.ts +9 -24
  170. package/packages/panda/styled-system/recipes/aeon-file-upload.js +5 -0
  171. package/packages/panda/styled-system/recipes/aeon-identity.d.ts +10 -28
  172. package/packages/panda/styled-system/recipes/aeon-identity.js +5 -0
  173. package/packages/panda/styled-system/recipes/aeon-list-row.d.ts +9 -26
  174. package/packages/panda/styled-system/recipes/aeon-list-row.js +5 -0
  175. package/packages/panda/styled-system/recipes/aeon-menu.d.ts +9 -24
  176. package/packages/panda/styled-system/recipes/aeon-menu.js +5 -0
  177. package/packages/panda/styled-system/recipes/aeon-metric-strip.d.ts +10 -28
  178. package/packages/panda/styled-system/recipes/aeon-metric-strip.js +5 -0
  179. package/packages/panda/styled-system/recipes/aeon-nav.d.ts +11 -30
  180. package/packages/panda/styled-system/recipes/aeon-nav.js +5 -0
  181. package/packages/panda/styled-system/recipes/aeon-panel.d.ts +10 -26
  182. package/packages/panda/styled-system/recipes/aeon-panel.js +5 -0
  183. package/packages/panda/styled-system/recipes/aeon-pin-input.d.ts +9 -24
  184. package/packages/panda/styled-system/recipes/aeon-pin-input.js +5 -0
  185. package/packages/panda/styled-system/recipes/aeon-popover.d.ts +9 -24
  186. package/packages/panda/styled-system/recipes/aeon-popover.js +5 -0
  187. package/packages/panda/styled-system/recipes/aeon-profile-header.d.ts +10 -28
  188. package/packages/panda/styled-system/recipes/aeon-profile-header.js +5 -0
  189. package/packages/panda/styled-system/recipes/aeon-progress.d.ts +9 -24
  190. package/packages/panda/styled-system/recipes/aeon-progress.js +5 -0
  191. package/packages/panda/styled-system/recipes/aeon-prose.d.ts +16 -0
  192. package/packages/panda/styled-system/recipes/aeon-prose.js +5 -0
  193. package/packages/panda/styled-system/recipes/aeon-radio-group.d.ts +9 -24
  194. package/packages/panda/styled-system/recipes/aeon-radio-group.js +5 -0
  195. package/packages/panda/styled-system/recipes/aeon-range-slider.d.ts +9 -24
  196. package/packages/panda/styled-system/recipes/aeon-range-slider.js +5 -0
  197. package/packages/panda/styled-system/recipes/aeon-scroll.d.ts +12 -36
  198. package/packages/panda/styled-system/recipes/aeon-scroll.js +5 -0
  199. package/packages/panda/styled-system/recipes/aeon-segment-group.d.ts +18 -0
  200. package/packages/panda/styled-system/recipes/aeon-segment-group.js +5 -0
  201. package/packages/panda/styled-system/recipes/aeon-select.d.ts +9 -26
  202. package/packages/panda/styled-system/recipes/aeon-select.js +5 -0
  203. package/packages/panda/styled-system/recipes/aeon-separator.d.ts +10 -26
  204. package/packages/panda/styled-system/recipes/aeon-separator.js +5 -0
  205. package/packages/panda/styled-system/recipes/aeon-slider.d.ts +9 -24
  206. package/packages/panda/styled-system/recipes/aeon-slider.js +5 -0
  207. package/packages/panda/styled-system/recipes/aeon-switch.d.ts +9 -24
  208. package/packages/panda/styled-system/recipes/aeon-switch.js +5 -0
  209. package/packages/panda/styled-system/recipes/aeon-tabs.d.ts +9 -24
  210. package/packages/panda/styled-system/recipes/aeon-tabs.js +5 -0
  211. package/packages/panda/styled-system/recipes/aeon-textarea.d.ts +18 -0
  212. package/packages/panda/styled-system/recipes/aeon-textarea.js +5 -0
  213. package/packages/panda/styled-system/recipes/aeon-theme-switcher.d.ts +10 -26
  214. package/packages/panda/styled-system/recipes/aeon-theme-switcher.js +5 -0
  215. package/packages/panda/styled-system/recipes/aeon-thread.d.ts +9 -24
  216. package/packages/panda/styled-system/recipes/aeon-thread.js +5 -0
  217. package/packages/panda/styled-system/recipes/aeon-toast.d.ts +9 -24
  218. package/packages/panda/styled-system/recipes/aeon-toast.js +5 -0
  219. package/packages/panda/styled-system/recipes/aeon-tooltip.d.ts +9 -24
  220. package/packages/panda/styled-system/recipes/aeon-tooltip.js +5 -0
  221. package/packages/panda/styled-system/recipes/index.d.ts +31 -28
  222. package/packages/panda/styled-system/recipes/index.js +43 -0
  223. package/packages/panda/styled-system/recipes/runtime.js +133 -0
  224. package/packages/panda/styled-system/styles.css +1899 -2106
  225. package/packages/panda/styled-system/tokens/index.d.ts +4 -5
  226. package/packages/panda/styled-system/tokens/index.js +18 -0
  227. package/packages/panda/styled-system/types/index.d.ts +3 -6
  228. package/packages/panda/styled-system/types/jsx.d.ts +36 -27
  229. package/packages/panda/styled-system/types/pattern.d.ts +18 -70
  230. package/packages/panda/styled-system/types/recipe.d.ts +50 -154
  231. package/packages/panda/styled-system/types/system.d.ts +1826 -0
  232. package/packages/panda/styled-system/types/tokens.d.ts +65 -0
  233. package/packages/panda/tsconfig.json +3 -1
  234. package/packages/primitives/dist/chunk-5BNAV4S2.js +258 -0
  235. package/packages/primitives/dist/chunk-H5XJGZHT.js +493 -0
  236. package/packages/primitives/dist/chunk-HYHCIMHC.js +45 -0
  237. package/packages/primitives/dist/index.d.ts +3 -0
  238. package/packages/primitives/dist/index.js +53 -13
  239. package/packages/primitives/dist/machines/cache.d.ts +223 -0
  240. package/packages/primitives/dist/machines/cache.js +14 -0
  241. package/packages/primitives/dist/machines/clipboard.d.ts +46 -0
  242. package/packages/primitives/dist/machines/clipboard.js +8 -0
  243. package/packages/primitives/dist/machines/store.d.ts +286 -0
  244. package/packages/primitives/dist/machines/store.js +25 -0
  245. package/packages/primitives/src/index.ts +3 -0
  246. package/packages/primitives/src/machines/cache.ts +395 -0
  247. package/packages/primitives/src/machines/clipboard.ts +56 -0
  248. package/packages/primitives/src/machines/store.ts +712 -0
  249. package/packages/react/dist/index.d.ts +116 -11
  250. package/packages/react/dist/index.js +1379 -994
  251. package/packages/react/src/clipboard/index.tsx +117 -0
  252. package/packages/react/src/composer/index.tsx +14 -5
  253. package/packages/react/src/hooks/use-aeon-store.ts +50 -0
  254. package/packages/react/src/index.ts +5 -0
  255. package/packages/react/src/prose/index.tsx +11 -0
  256. package/packages/react/src/radio-group/index.tsx +2 -1
  257. package/packages/react/src/scroll/index.tsx +1 -0
  258. package/packages/react/src/scroll/use-windowed-range.ts +118 -0
  259. package/packages/react/src/segment-group/index.tsx +171 -0
  260. package/packages/react/src/select/index.tsx +11 -2
  261. package/packages/react/src/tabs/index.tsx +19 -7
  262. package/packages/react/src/textarea/index.tsx +75 -0
  263. package/packages/react/src/utils/assign-ref.ts +7 -0
  264. package/packages/schemas/dist/index.d.ts +8 -0
  265. package/packages/schemas/dist/index.js +59 -0
  266. package/packages/schemas/json/catalog.json +493 -0
  267. package/packages/schemas/json/clipboard.json +136 -0
  268. package/packages/schemas/json/prose.json +103 -0
  269. package/packages/schemas/json/segmentGroup.json +131 -0
  270. package/packages/schemas/json/textarea.json +119 -0
  271. package/packages/schemas/registry/catalog.json +34 -0
  272. package/packages/schemas/registry/components/clipboard.json +136 -0
  273. package/packages/schemas/registry/components/prose.json +103 -0
  274. package/packages/schemas/registry/components/segmentGroup.json +131 -0
  275. package/packages/schemas/registry/components/textarea.json +119 -0
  276. package/packages/schemas/registry/machines/clipboard.json +110 -0
  277. package/packages/schemas/scripts/emit.ts +2 -0
  278. package/packages/schemas/src/components.ts +63 -0
  279. package/packages/ui/dist/index.d.ts +27 -3
  280. package/packages/ui/dist/index.js +232 -165
  281. package/packages/ui/src/clipboard.tsx +51 -0
  282. package/packages/ui/src/index.ts +4 -0
  283. package/packages/ui/src/prose.tsx +15 -0
  284. package/packages/ui/src/segment-group.tsx +28 -0
  285. package/packages/ui/src/textarea.tsx +17 -0
  286. package/scripts/vite-aliases.mjs +2 -2
  287. package/packages/cli/node_modules/.bin/esbuild +0 -21
  288. package/packages/cli/node_modules/.bin/jiti +0 -21
  289. package/packages/cli/node_modules/.bin/tsc +0 -21
  290. package/packages/cli/node_modules/.bin/tsserver +0 -21
  291. package/packages/cli/node_modules/.bin/tsup +0 -21
  292. package/packages/cli/node_modules/.bin/tsup-node +0 -21
  293. package/packages/cli/node_modules/.bin/tsx +0 -21
  294. package/packages/cli/node_modules/.bin/vite +0 -21
  295. package/packages/cli/node_modules/.bin/vitest +0 -21
  296. package/packages/core/node_modules/.bin/esbuild +0 -21
  297. package/packages/core/node_modules/.bin/jiti +0 -21
  298. package/packages/core/node_modules/.bin/tsc +0 -21
  299. package/packages/core/node_modules/.bin/tsserver +0 -21
  300. package/packages/core/node_modules/.bin/tsup +0 -21
  301. package/packages/core/node_modules/.bin/tsup-node +0 -21
  302. package/packages/core/node_modules/.bin/tsx +0 -21
  303. package/packages/core/node_modules/.bin/vite +0 -21
  304. package/packages/core/node_modules/.bin/vitest +0 -21
  305. package/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  306. package/packages/core/src/identicon.test.ts +0 -39
  307. package/packages/core/src/machine.test.ts +0 -79
  308. package/packages/core/src/theme.test.ts +0 -14
  309. package/packages/geometry/node_modules/.bin/esbuild +0 -21
  310. package/packages/geometry/node_modules/.bin/jiti +0 -21
  311. package/packages/geometry/node_modules/.bin/tsc +0 -21
  312. package/packages/geometry/node_modules/.bin/tsserver +0 -21
  313. package/packages/geometry/node_modules/.bin/tsup +0 -21
  314. package/packages/geometry/node_modules/.bin/tsup-node +0 -21
  315. package/packages/geometry/node_modules/.bin/tsx +0 -21
  316. package/packages/panda/styled-system/css/conditions.mjs +0 -36
  317. package/packages/panda/styled-system/css/css.mjs +0 -45
  318. package/packages/panda/styled-system/css/cva.mjs +0 -87
  319. package/packages/panda/styled-system/css/index.mjs +0 -4
  320. package/packages/panda/styled-system/css/sva.mjs +0 -46
  321. package/packages/panda/styled-system/helpers.mjs +0 -328
  322. package/packages/panda/styled-system/jsx/aspect-ratio.mjs +0 -14
  323. package/packages/panda/styled-system/jsx/bleed.mjs +0 -14
  324. package/packages/panda/styled-system/jsx/box.mjs +0 -14
  325. package/packages/panda/styled-system/jsx/center.mjs +0 -14
  326. package/packages/panda/styled-system/jsx/circle.mjs +0 -14
  327. package/packages/panda/styled-system/jsx/container.mjs +0 -14
  328. package/packages/panda/styled-system/jsx/cq.mjs +0 -14
  329. package/packages/panda/styled-system/jsx/create-style-context.d.ts +0 -54
  330. package/packages/panda/styled-system/jsx/create-style-context.mjs +0 -121
  331. package/packages/panda/styled-system/jsx/divider.mjs +0 -14
  332. package/packages/panda/styled-system/jsx/factory-helper.mjs +0 -22
  333. package/packages/panda/styled-system/jsx/factory.mjs +0 -89
  334. package/packages/panda/styled-system/jsx/flex.mjs +0 -14
  335. package/packages/panda/styled-system/jsx/float.mjs +0 -14
  336. package/packages/panda/styled-system/jsx/grid-item.mjs +0 -14
  337. package/packages/panda/styled-system/jsx/grid.mjs +0 -14
  338. package/packages/panda/styled-system/jsx/hstack.mjs +0 -14
  339. package/packages/panda/styled-system/jsx/index.mjs +0 -23
  340. package/packages/panda/styled-system/jsx/is-valid-prop.mjs +0 -17
  341. package/packages/panda/styled-system/jsx/link-overlay.mjs +0 -14
  342. package/packages/panda/styled-system/jsx/spacer.mjs +0 -14
  343. package/packages/panda/styled-system/jsx/square.mjs +0 -14
  344. package/packages/panda/styled-system/jsx/stack.mjs +0 -14
  345. package/packages/panda/styled-system/jsx/visually-hidden.mjs +0 -14
  346. package/packages/panda/styled-system/jsx/vstack.mjs +0 -14
  347. package/packages/panda/styled-system/jsx/wrap.mjs +0 -14
  348. package/packages/panda/styled-system/patterns/aspect-ratio.mjs +0 -38
  349. package/packages/panda/styled-system/patterns/bleed.mjs +0 -24
  350. package/packages/panda/styled-system/patterns/box.mjs +0 -15
  351. package/packages/panda/styled-system/patterns/center.mjs +0 -21
  352. package/packages/panda/styled-system/patterns/circle.mjs +0 -25
  353. package/packages/panda/styled-system/patterns/container.mjs +0 -21
  354. package/packages/panda/styled-system/patterns/cq.mjs +0 -21
  355. package/packages/panda/styled-system/patterns/divider.mjs +0 -25
  356. package/packages/panda/styled-system/patterns/flex.mjs +0 -26
  357. package/packages/panda/styled-system/patterns/float.mjs +0 -52
  358. package/packages/panda/styled-system/patterns/grid-item.mjs +0 -25
  359. package/packages/panda/styled-system/patterns/grid.mjs +0 -27
  360. package/packages/panda/styled-system/patterns/hstack.mjs +0 -24
  361. package/packages/panda/styled-system/patterns/index.mjs +0 -20
  362. package/packages/panda/styled-system/patterns/link-overlay.mjs +0 -24
  363. package/packages/panda/styled-system/patterns/spacer.mjs +0 -25
  364. package/packages/panda/styled-system/patterns/square.mjs +0 -24
  365. package/packages/panda/styled-system/patterns/stack.mjs +0 -24
  366. package/packages/panda/styled-system/patterns/visually-hidden.mjs +0 -18
  367. package/packages/panda/styled-system/patterns/vstack.mjs +0 -24
  368. package/packages/panda/styled-system/patterns/wrap.mjs +0 -25
  369. package/packages/panda/styled-system/recipes/aeon-accordion.mjs +0 -49
  370. package/packages/panda/styled-system/recipes/aeon-app-shell.mjs +0 -70
  371. package/packages/panda/styled-system/recipes/aeon-async.mjs +0 -57
  372. package/packages/panda/styled-system/recipes/aeon-avatar.mjs +0 -57
  373. package/packages/panda/styled-system/recipes/aeon-badge.mjs +0 -32
  374. package/packages/panda/styled-system/recipes/aeon-bar.mjs +0 -77
  375. package/packages/panda/styled-system/recipes/aeon-button-group.mjs +0 -37
  376. package/packages/panda/styled-system/recipes/aeon-button.mjs +0 -39
  377. package/packages/panda/styled-system/recipes/aeon-checkbox.mjs +0 -49
  378. package/packages/panda/styled-system/recipes/aeon-combobox.mjs +0 -53
  379. package/packages/panda/styled-system/recipes/aeon-composer.mjs +0 -57
  380. package/packages/panda/styled-system/recipes/aeon-content.mjs +0 -70
  381. package/packages/panda/styled-system/recipes/aeon-conversation.mjs +0 -61
  382. package/packages/panda/styled-system/recipes/aeon-dialog.mjs +0 -61
  383. package/packages/panda/styled-system/recipes/aeon-entry.mjs +0 -100
  384. package/packages/panda/styled-system/recipes/aeon-field.mjs +0 -53
  385. package/packages/panda/styled-system/recipes/aeon-file-upload.mjs +0 -61
  386. package/packages/panda/styled-system/recipes/aeon-identity.mjs +0 -63
  387. package/packages/panda/styled-system/recipes/aeon-list-row.mjs +0 -49
  388. package/packages/panda/styled-system/recipes/aeon-menu.mjs +0 -53
  389. package/packages/panda/styled-system/recipes/aeon-metric-strip.mjs +0 -54
  390. package/packages/panda/styled-system/recipes/aeon-nav.mjs +0 -69
  391. package/packages/panda/styled-system/recipes/aeon-panel.mjs +0 -58
  392. package/packages/panda/styled-system/recipes/aeon-pin-input.mjs +0 -37
  393. package/packages/panda/styled-system/recipes/aeon-popover.mjs +0 -53
  394. package/packages/panda/styled-system/recipes/aeon-profile-header.mjs +0 -62
  395. package/packages/panda/styled-system/recipes/aeon-progress.mjs +0 -45
  396. package/packages/panda/styled-system/recipes/aeon-radio-group.mjs +0 -49
  397. package/packages/panda/styled-system/recipes/aeon-range-slider.mjs +0 -49
  398. package/packages/panda/styled-system/recipes/aeon-scroll.mjs +0 -64
  399. package/packages/panda/styled-system/recipes/aeon-select.mjs +0 -57
  400. package/packages/panda/styled-system/recipes/aeon-separator.mjs +0 -42
  401. package/packages/panda/styled-system/recipes/aeon-slider.mjs +0 -49
  402. package/packages/panda/styled-system/recipes/aeon-switch.mjs +0 -49
  403. package/packages/panda/styled-system/recipes/aeon-tabs.mjs +0 -49
  404. package/packages/panda/styled-system/recipes/aeon-theme-switcher.mjs +0 -59
  405. package/packages/panda/styled-system/recipes/aeon-thread.mjs +0 -73
  406. package/packages/panda/styled-system/recipes/aeon-toast.mjs +0 -49
  407. package/packages/panda/styled-system/recipes/aeon-tooltip.mjs +0 -49
  408. package/packages/panda/styled-system/recipes/create-recipe.mjs +0 -82
  409. package/packages/panda/styled-system/recipes/index.mjs +0 -39
  410. package/packages/panda/styled-system/tokens/index.mjs +0 -2224
  411. package/packages/panda/styled-system/tokens/tokens.d.ts +0 -60
  412. package/packages/panda/styled-system/types/composition.d.ts +0 -227
  413. package/packages/panda/styled-system/types/conditions.d.ts +0 -346
  414. package/packages/panda/styled-system/types/csstype.d.ts +0 -22570
  415. package/packages/panda/styled-system/types/global.d.ts +0 -20
  416. package/packages/panda/styled-system/types/parts.d.ts +0 -8
  417. package/packages/panda/styled-system/types/prop-type.d.ts +0 -250
  418. package/packages/panda/styled-system/types/selectors.d.ts +0 -59
  419. package/packages/panda/styled-system/types/static-css.d.ts +0 -56
  420. package/packages/panda/styled-system/types/style-props.d.ts +0 -8089
  421. package/packages/panda/styled-system/types/system-types.d.ts +0 -151
  422. package/packages/primitives/node_modules/.bin/esbuild +0 -21
  423. package/packages/primitives/node_modules/.bin/jiti +0 -21
  424. package/packages/primitives/node_modules/.bin/tsc +0 -21
  425. package/packages/primitives/node_modules/.bin/tsserver +0 -21
  426. package/packages/primitives/node_modules/.bin/tsup +0 -21
  427. package/packages/primitives/node_modules/.bin/tsup-node +0 -21
  428. package/packages/primitives/node_modules/.bin/tsx +0 -21
  429. package/packages/primitives/node_modules/.bin/vite +0 -21
  430. package/packages/primitives/node_modules/.bin/vitest +0 -21
  431. package/packages/primitives/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  432. package/packages/primitives/src/__tests__/app-nav.test.ts +0 -30
  433. package/packages/primitives/src/__tests__/file-upload.test.ts +0 -25
  434. package/packages/primitives/src/__tests__/floating-surface.test.ts +0 -29
  435. package/packages/primitives/src/__tests__/range-slider.test.ts +0 -39
  436. package/packages/react/node_modules/.bin/esbuild +0 -21
  437. package/packages/react/node_modules/.bin/jiti +0 -21
  438. package/packages/react/node_modules/.bin/tsc +0 -21
  439. package/packages/react/node_modules/.bin/tsserver +0 -21
  440. package/packages/react/node_modules/.bin/tsup +0 -21
  441. package/packages/react/node_modules/.bin/tsup-node +0 -21
  442. package/packages/react/node_modules/.bin/tsx +0 -21
  443. package/packages/react/node_modules/.bin/vite +0 -21
  444. package/packages/react/node_modules/.bin/vitest +0 -21
  445. package/packages/react/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  446. package/packages/react/src/avatar/avatar.test.tsx +0 -27
  447. package/packages/react/src/dialog/dialog.test.tsx +0 -77
  448. package/packages/react/src/select/select.test.tsx +0 -81
  449. package/packages/react/src/toast/toast.test.tsx +0 -40
  450. package/packages/react/src/tooltip/tooltip.test.tsx +0 -122
  451. package/packages/react-scene/node_modules/.bin/jiti +0 -21
  452. package/packages/react-scene/node_modules/.bin/tsc +0 -21
  453. package/packages/react-scene/node_modules/.bin/tsserver +0 -21
  454. package/packages/react-scene/node_modules/.bin/tsup +0 -21
  455. package/packages/react-scene/node_modules/.bin/tsup-node +0 -21
  456. package/packages/react-scene/node_modules/.bin/tsx +0 -21
  457. package/packages/scene/node_modules/.bin/jiti +0 -21
  458. package/packages/scene/node_modules/.bin/tsc +0 -21
  459. package/packages/scene/node_modules/.bin/tsserver +0 -21
  460. package/packages/scene/node_modules/.bin/tsup +0 -21
  461. package/packages/scene/node_modules/.bin/tsup-node +0 -21
  462. package/packages/scene/node_modules/.bin/tsx +0 -21
  463. package/packages/schemas/node_modules/.bin/esbuild +0 -21
  464. package/packages/schemas/node_modules/.bin/jiti +0 -21
  465. package/packages/schemas/node_modules/.bin/tsc +0 -21
  466. package/packages/schemas/node_modules/.bin/tsserver +0 -21
  467. package/packages/schemas/node_modules/.bin/tsup +0 -21
  468. package/packages/schemas/node_modules/.bin/tsup-node +0 -21
  469. package/packages/schemas/node_modules/.bin/tsx +0 -21
  470. package/packages/schemas/node_modules/.bin/vite +0 -21
  471. package/packages/schemas/node_modules/.bin/vitest +0 -21
  472. package/packages/schemas/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  473. package/packages/schemas/src/aeon-to-schema.test.ts +0 -70
  474. package/packages/schemas/src/index.test.ts +0 -108
  475. package/packages/signal/node_modules/.bin/jiti +0 -21
  476. package/packages/signal/node_modules/.bin/tsc +0 -21
  477. package/packages/signal/node_modules/.bin/tsserver +0 -21
  478. package/packages/signal/node_modules/.bin/tsup +0 -21
  479. package/packages/signal/node_modules/.bin/tsup-node +0 -21
  480. package/packages/signal/node_modules/.bin/tsx +0 -21
  481. package/packages/site/node_modules/.bin/jiti +0 -21
  482. package/packages/site/node_modules/.bin/tsc +0 -21
  483. package/packages/site/node_modules/.bin/tsserver +0 -21
  484. package/packages/site/node_modules/.bin/tsup +0 -21
  485. package/packages/site/node_modules/.bin/tsup-node +0 -21
  486. package/packages/site/node_modules/.bin/tsx +0 -21
  487. package/packages/solid/node_modules/.bin/jiti +0 -21
  488. package/packages/solid/node_modules/.bin/tsc +0 -21
  489. package/packages/solid/node_modules/.bin/tsserver +0 -21
  490. package/packages/solid/node_modules/.bin/tsup +0 -21
  491. package/packages/solid/node_modules/.bin/tsup-node +0 -21
  492. package/packages/solid/node_modules/.bin/tsx +0 -21
  493. package/packages/surface/node_modules/.bin/jiti +0 -21
  494. package/packages/surface/node_modules/.bin/tsc +0 -21
  495. package/packages/surface/node_modules/.bin/tsserver +0 -21
  496. package/packages/surface/node_modules/.bin/tsup +0 -21
  497. package/packages/surface/node_modules/.bin/tsup-node +0 -21
  498. package/packages/surface/node_modules/.bin/tsx +0 -21
  499. package/packages/svelte/node_modules/.bin/acorn +0 -21
  500. package/packages/svelte/node_modules/.bin/esbuild +0 -21
  501. package/packages/svelte/node_modules/.bin/jiti +0 -21
  502. package/packages/svelte/node_modules/.bin/svelte-check +0 -21
  503. package/packages/svelte/node_modules/.bin/tsc +0 -21
  504. package/packages/svelte/node_modules/.bin/tsserver +0 -21
  505. package/packages/svelte/node_modules/.bin/tsup +0 -21
  506. package/packages/svelte/node_modules/.bin/tsup-node +0 -21
  507. package/packages/svelte/node_modules/.bin/tsx +0 -21
  508. package/packages/svelte/node_modules/.bin/vite +0 -21
  509. package/packages/tree/node_modules/.bin/esbuild +0 -21
  510. package/packages/tree/node_modules/.bin/jiti +0 -21
  511. package/packages/tree/node_modules/.bin/tsc +0 -21
  512. package/packages/tree/node_modules/.bin/tsserver +0 -21
  513. package/packages/tree/node_modules/.bin/tsup +0 -21
  514. package/packages/tree/node_modules/.bin/tsup-node +0 -21
  515. package/packages/tree/node_modules/.bin/tsx +0 -21
  516. package/packages/tree/node_modules/.bin/vite +0 -21
  517. package/packages/tree/node_modules/.bin/vitest +0 -21
  518. package/packages/tree/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  519. package/packages/tree/src/exclusive-action.test.ts +0 -54
  520. package/packages/ui/node_modules/.bin/jiti +0 -21
  521. package/packages/ui/node_modules/.bin/tsc +0 -21
  522. package/packages/ui/node_modules/.bin/tsserver +0 -21
  523. package/packages/ui/node_modules/.bin/tsup +0 -21
  524. package/packages/ui/node_modules/.bin/tsup-node +0 -21
  525. package/packages/ui/node_modules/.bin/tsx +0 -21
  526. package/packages/vue/node_modules/.bin/jiti +0 -21
  527. package/packages/vue/node_modules/.bin/tsc +0 -21
  528. package/packages/vue/node_modules/.bin/tsserver +0 -21
  529. package/packages/vue/node_modules/.bin/tsup +0 -21
  530. package/packages/vue/node_modules/.bin/tsup-node +0 -21
  531. package/packages/vue/node_modules/.bin/tsx +0 -21
@@ -0,0 +1,493 @@
1
+ import {
2
+ createChartCache,
3
+ isCacheableId
4
+ } from "./chunk-5BNAV4S2.js";
5
+
6
+ // src/machines/store.ts
7
+ import { stateToAttr } from "@aeon-ui/core";
8
+ import { assign, createActor, fromCallback, setup } from "xstate";
9
+ function defineSlice(options) {
10
+ return options;
11
+ }
12
+ var DEFAULT_TTL = 3e4;
13
+ var ALL_TAG = "*";
14
+ var EMPTY_IDS = Object.freeze([]);
15
+ var IDLE_QUERY = Object.freeze({ state: "idle", ids: EMPTY_IDS, error: null, loadedAt: null });
16
+ var EMPTY_SLICE = Object.freeze({ byId: {}, ids: EMPTY_IDS, queries: {}, pending: {}, failed: {} });
17
+ var defaultKeyOf = (key) => typeof key === "string" ? key : JSON.stringify(key);
18
+ function shallowEqual(a, b) {
19
+ if (Object.is(a, b)) return true;
20
+ if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) return false;
21
+ if (Array.isArray(a) !== Array.isArray(b)) return false;
22
+ const keysA = Object.keys(a);
23
+ if (keysA.length !== Object.keys(b).length) return false;
24
+ return keysA.every((key) => Object.hasOwn(b, key) && Object.is(a[key], b[key]));
25
+ }
26
+ function isStorableName(name) {
27
+ return isCacheableId(name.replace(/([a-z0-9])([A-Z])/g, "$1 $2"));
28
+ }
29
+ function unstorableField(value, depth = 0) {
30
+ if (depth > 8 || typeof value !== "object" || value === null) return null;
31
+ for (const [key, inner] of Object.entries(value)) {
32
+ if (!Array.isArray(value) && !isStorableName(key)) return key;
33
+ const nested = unstorableField(inner, depth + 1);
34
+ if (nested !== null) return nested;
35
+ }
36
+ return null;
37
+ }
38
+ function queryAttrs(result) {
39
+ return { "data-aeon-state": stateToAttr(result.state), "data-aeon-count": String(result.ids.length) };
40
+ }
41
+ function entityAttrs(slice, sliceName, id) {
42
+ const state = slice.pending[id] !== void 0 ? "pending" : slice.failed[id] !== void 0 ? "failed" : "settled";
43
+ return { "data-aeon-entity": sliceName, "data-aeon-state": state };
44
+ }
45
+ function memoryAdapter(initial = {}) {
46
+ const data = new Map(Object.entries(initial));
47
+ return {
48
+ data,
49
+ load: (key) => data.get(key) ?? null,
50
+ save: (key, value) => void data.set(key, value),
51
+ remove: (key) => void data.delete(key)
52
+ };
53
+ }
54
+ function webStorageAdapter(storage = globalThis.localStorage) {
55
+ return {
56
+ load: (key) => storage.getItem(key),
57
+ save: (key, value) => storage.setItem(key, value),
58
+ remove: (key) => storage.removeItem(key)
59
+ };
60
+ }
61
+ function omit(record, keys) {
62
+ let next = null;
63
+ for (const key of keys) {
64
+ if (!Object.hasOwn(record, key)) continue;
65
+ next ??= { ...record };
66
+ delete next[key];
67
+ }
68
+ return next ?? record;
69
+ }
70
+ function withSlice(data, name, slice) {
71
+ return slice === data.slices[name] ? data : { ...data, slices: { ...data.slices, [name]: slice } };
72
+ }
73
+ function putEntities(r, name, slice, entities) {
74
+ const def = r.defs[name];
75
+ const equals = def.equals ?? shallowEqual;
76
+ let byId = null;
77
+ let added = null;
78
+ let failed = slice.failed;
79
+ for (const entity of entities) {
80
+ const id = def.idOf(entity);
81
+ const held = (byId ?? slice.byId)[id];
82
+ failed = omit(failed, [id]);
83
+ if (held !== void 0 && (held === entity || equals(held, entity))) continue;
84
+ byId ??= { ...slice.byId };
85
+ if (held === void 0 && !Object.hasOwn(byId, id)) (added ??= []).push(id);
86
+ byId[id] = entity;
87
+ }
88
+ if (!byId && failed === slice.failed) return slice;
89
+ return { ...slice, byId: byId ?? slice.byId, ids: added ? [...slice.ids, ...added] : slice.ids, failed };
90
+ }
91
+ function removeEntities(slice, ids) {
92
+ const byId = omit(slice.byId, ids);
93
+ if (byId === slice.byId) return slice;
94
+ const gone = new Set(ids);
95
+ return { ...slice, byId, ids: slice.ids.filter((id) => !gone.has(id)) };
96
+ }
97
+ function sameIds(a, b) {
98
+ return a.length === b.length && a.every((id, i) => id === b[i]);
99
+ }
100
+ function applyQueryUpdate(r, data, name, key, view) {
101
+ const def = r.defs[name];
102
+ let slice = data.slices[name] ?? EMPTY_SLICE;
103
+ let writes = data.writes;
104
+ const previous = slice.queries[key] ?? IDLE_QUERY;
105
+ let ids = previous.ids;
106
+ if (view.data !== void 0) {
107
+ const incoming = view.data;
108
+ const settled = [];
109
+ for (const entity of incoming) {
110
+ const id = def.idOf(entity);
111
+ const write = slice.pending[id];
112
+ if (write !== void 0 && writes[write]) {
113
+ writes = { ...writes, [write]: { ...writes[write], before: { ...writes[write].before, [id]: entity } } };
114
+ } else settled.push(entity);
115
+ }
116
+ slice = putEntities(r, name, slice, settled);
117
+ const nextIds = incoming.map(def.idOf);
118
+ if (!sameIds(nextIds, ids)) ids = nextIds;
119
+ } else if (view.state === "idle") ids = EMPTY_IDS;
120
+ const query = previous.state === view.state && previous.ids === ids && previous.error === view.error && previous.loadedAt === view.loadedAt ? previous : Object.freeze({ state: view.state, ids, error: view.error, loadedAt: view.loadedAt });
121
+ if (query !== previous) slice = { ...slice, queries: { ...slice.queries, [key]: query } };
122
+ const next = withSlice(data, name, slice);
123
+ return writes === data.writes ? next : { ...next, writes };
124
+ }
125
+ function beginWrite(r, data, event) {
126
+ if (data.writes[event.write]) return data;
127
+ const def = r.defs[event.slice];
128
+ let slice = data.slices[event.slice] ?? EMPTY_SLICE;
129
+ const before = {};
130
+ const after = {};
131
+ const ids = [];
132
+ for (const entity of event.upsert ?? []) {
133
+ const id = def.idOf(entity);
134
+ before[id] = slice.byId[id];
135
+ ids.push(id);
136
+ }
137
+ for (const id of event.remove ?? []) {
138
+ before[id] = slice.byId[id];
139
+ ids.push(id);
140
+ }
141
+ slice = putEntities(r, event.slice, slice, event.upsert ?? []);
142
+ slice = removeEntities(slice, event.remove ?? []);
143
+ for (const id of ids) after[id] = slice.byId[id];
144
+ const pending = { ...slice.pending };
145
+ for (const id of ids) pending[id] = event.write;
146
+ slice = { ...slice, pending, failed: omit(slice.failed, ids) };
147
+ return { ...withSlice(data, event.slice, slice), writes: { ...data.writes, [event.write]: { slice: event.slice, before, after } } };
148
+ }
149
+ function settleWrite(data, writeId, rollback) {
150
+ const write = data.writes[writeId];
151
+ if (!write) return data;
152
+ let slice = data.slices[write.slice] ?? EMPTY_SLICE;
153
+ const ids = Object.keys(write.after);
154
+ const mine = ids.filter((id) => slice.pending[id] === writeId);
155
+ slice = { ...slice, pending: omit(slice.pending, mine) };
156
+ if (rollback !== null) {
157
+ const failed = { ...slice.failed };
158
+ for (const id of ids) {
159
+ if (slice.byId[id] !== write.after[id]) continue;
160
+ const restore = write.before[id];
161
+ if (restore === void 0) slice = removeEntities(slice, [id]);
162
+ else {
163
+ const had = Object.hasOwn(slice.byId, id);
164
+ slice = { ...slice, byId: { ...slice.byId, [id]: restore }, ids: had ? slice.ids : [...slice.ids, id] };
165
+ }
166
+ failed[id] = rollback;
167
+ }
168
+ slice = { ...slice, failed };
169
+ }
170
+ const writes = { ...data.writes };
171
+ delete writes[writeId];
172
+ return { ...withSlice(data, write.slice, slice), writes };
173
+ }
174
+ function hydrate(r, data, saved) {
175
+ let next = { ...data, status: "ready" };
176
+ if (!saved) return next;
177
+ for (const [name, stored] of Object.entries(saved)) {
178
+ const def = r.defs[name];
179
+ if (!def || def.persist === false || !stored || typeof stored.byId !== "object") continue;
180
+ const slice = next.slices[name] ?? EMPTY_SLICE;
181
+ const order = Array.isArray(stored.ids) ? stored.ids : Object.keys(stored.byId);
182
+ const missing = order.map((id) => stored.byId[id]).filter((entity) => entity !== void 0 && unstorableField(entity) === null && !Object.hasOwn(slice.byId, def.idOf(entity)));
183
+ next = withSlice(next, name, putEntities(r, name, slice, missing));
184
+ }
185
+ return next;
186
+ }
187
+ function reduce(r, data, event) {
188
+ switch (event.type) {
189
+ case "ENTITY.UPSERT":
190
+ return withSlice(data, event.slice, putEntities(r, event.slice, data.slices[event.slice] ?? EMPTY_SLICE, event.entities));
191
+ case "ENTITY.PATCH": {
192
+ const slice = data.slices[event.slice] ?? EMPTY_SLICE;
193
+ const held = slice.byId[event.id];
194
+ if (held === void 0) return data;
195
+ return withSlice(data, event.slice, putEntities(r, event.slice, slice, [{ ...held, ...event.patch }]));
196
+ }
197
+ case "ENTITY.REMOVE": {
198
+ const slice = removeEntities(data.slices[event.slice] ?? EMPTY_SLICE, event.ids);
199
+ return withSlice(data, event.slice, { ...slice, failed: omit(slice.failed, event.ids) });
200
+ }
201
+ case "WRITE.BEGIN":
202
+ return beginWrite(r, data, event);
203
+ case "WRITE.CONFIRM":
204
+ return settleWrite(data, event.write, null);
205
+ case "WRITE.ROLLBACK":
206
+ return settleWrite(data, event.write, event.error ?? "write failed");
207
+ case "QUERY.UPDATE":
208
+ return applyQueryUpdate(r, data, event.slice, event.key, event.view);
209
+ case "STORE.HYDRATED":
210
+ return hydrate(r, data, event.slices);
211
+ case "STORE.CLEAR":
212
+ return { ...data, slices: Object.fromEntries(Object.keys(r.defs).map((name) => [name, EMPTY_SLICE])), writes: {} };
213
+ default:
214
+ return data;
215
+ }
216
+ }
217
+ function createStoreMachine(defs) {
218
+ const r = { defs };
219
+ return setup({
220
+ types: {
221
+ context: {},
222
+ events: {},
223
+ input: {}
224
+ }
225
+ }).createMachine({
226
+ id: "aeonStore",
227
+ context: ({ input }) => ({
228
+ data: {
229
+ status: input.hydrate ? "hydrating" : "ready",
230
+ slices: Object.fromEntries(Object.keys(defs).map((name) => [name, EMPTY_SLICE])),
231
+ writes: {}
232
+ }
233
+ }),
234
+ initial: "boot",
235
+ states: {
236
+ boot: { always: [{ guard: ({ context }) => context.data.status === "hydrating", target: "hydrating" }, { target: "ready" }] },
237
+ hydrating: { on: { "STORE.HYDRATED": { target: "ready", actions: assign(({ context, event }) => ({ data: reduce(r, context.data, event) })) } } },
238
+ ready: {}
239
+ },
240
+ on: {
241
+ "*": { actions: assign(({ context, event }) => event.type === "STORE.HYDRATED" ? {} : { data: reduce(r, context.data, event) }) }
242
+ }
243
+ });
244
+ }
245
+ function persistable(defs, data) {
246
+ const out = {};
247
+ for (const [name, def] of Object.entries(defs)) {
248
+ if (def.persist === false) continue;
249
+ const slice = data.slices[name] ?? EMPTY_SLICE;
250
+ const byId = { ...slice.byId };
251
+ const ids = [...slice.ids];
252
+ for (const [id, writeId] of Object.entries(slice.pending)) {
253
+ const before = data.writes[writeId]?.before[id];
254
+ if (before === void 0) {
255
+ delete byId[id];
256
+ const at = ids.indexOf(id);
257
+ if (at >= 0) ids.splice(at, 1);
258
+ } else {
259
+ if (!Object.hasOwn(byId, id)) ids.push(id);
260
+ byId[id] = before;
261
+ }
262
+ }
263
+ out[name] = { byId, ids };
264
+ }
265
+ return out;
266
+ }
267
+ function parseSaved(raw, options) {
268
+ if (!raw) return null;
269
+ try {
270
+ const saved = JSON.parse(raw);
271
+ if (typeof saved !== "object" || saved === null || typeof saved.slices !== "object" || saved.slices === null) return null;
272
+ const slices = saved.slices;
273
+ if (saved.version === options.version) return slices;
274
+ if (typeof saved.version !== "number" || !options.migrate) return null;
275
+ return options.migrate(slices, saved.version) ?? null;
276
+ } catch {
277
+ return null;
278
+ }
279
+ }
280
+ function createAeonStore(options) {
281
+ if (!isStorableName(options.id)) throw new Error(`refusing store "${options.id}": secrets, keys and spend decisions are never stored`);
282
+ for (const name of Object.keys(options.slices)) {
283
+ if (!isStorableName(name)) throw new Error(`refusing slice "${name}" in store "${options.id}": secrets, keys and spend decisions are never stored`);
284
+ }
285
+ const defs = options.slices;
286
+ const persist = options.persist;
287
+ const storageKey = `aeon-store:${options.id}`;
288
+ const actor = createActor(createStoreMachine(defs), { input: { hydrate: persist !== void 0 } });
289
+ const listeners = /* @__PURE__ */ new Set();
290
+ const caches = /* @__PURE__ */ new Map();
291
+ const watched = /* @__PURE__ */ new Map();
292
+ let data = actor.getSnapshot().context.data;
293
+ let stopped = false;
294
+ for (const [name, def] of Object.entries(defs)) {
295
+ if (!def.load) continue;
296
+ const load = def.load;
297
+ const userTags = def.tags;
298
+ caches.set(
299
+ name,
300
+ createChartCache({
301
+ id: `${options.id}.${name}`,
302
+ load: (query2, context) => load(query2, context),
303
+ ttl: def.ttl ?? DEFAULT_TTL,
304
+ tags: (query2) => [ALL_TAG, ...userTags?.(query2) ?? []],
305
+ keyOf: def.queryKey ?? defaultKeyOf,
306
+ // Watched queries are pinned; this bounds the unwatched ones.
307
+ maxEntries: 200,
308
+ now: options.now
309
+ })
310
+ );
311
+ }
312
+ let saveTimer = null;
313
+ const save = async () => {
314
+ if (saveTimer !== null) clearTimeout(saveTimer);
315
+ saveTimer = null;
316
+ if (!persist || stopped || data.status !== "ready") return;
317
+ await persist.adapter.save(storageKey, JSON.stringify({ version: persist.version, slices: persistable(defs, data) }));
318
+ };
319
+ const persisted = Object.keys(defs).filter((name) => defs[name].persist !== false);
320
+ const persistChanged = (previous, next) => persisted.some((name) => previous.slices[name]?.byId !== next.slices[name]?.byId || previous.slices[name]?.pending !== next.slices[name]?.pending);
321
+ const heldBeforeHydration = (previous) => persisted.some((name) => (previous.slices[name]?.ids.length ?? 0) > 0);
322
+ actor.subscribe((snapshot) => {
323
+ const next = snapshot.context.data;
324
+ if (next === data) return;
325
+ const previous = data;
326
+ data = next;
327
+ if (persist && next.status === "ready" && (previous.status === "ready" ? persistChanged(previous, next) : heldBeforeHydration(previous))) {
328
+ if (saveTimer !== null) clearTimeout(saveTimer);
329
+ saveTimer = setTimeout(() => void save().catch(() => {
330
+ }), persist.delayMs ?? 250);
331
+ }
332
+ for (const listener of [...listeners]) listener();
333
+ });
334
+ actor.start();
335
+ const keyOf = (name, query2) => (defs[name].queryKey ?? defaultKeyOf)(query2);
336
+ const watch = (name, query2) => {
337
+ const cache = caches.get(name);
338
+ if (!cache) throw new Error(`slice "${name}" in store "${options.id}" has no load, so it has no queries`);
339
+ const key = keyOf(name, query2);
340
+ let forSlice = watched.get(name);
341
+ if (!forSlice) watched.set(name, forSlice = /* @__PURE__ */ new Map());
342
+ if (!forSlice.has(key)) {
343
+ const forward = (view) => actor.send({ type: "QUERY.UPDATE", slice: name, key, view });
344
+ forSlice.set(key, cache.subscribe(query2, forward));
345
+ forward(cache.peek(query2));
346
+ }
347
+ return cache;
348
+ };
349
+ const unwatchAll = () => {
350
+ for (const forSlice of watched.values()) for (const stop of forSlice.values()) stop();
351
+ watched.clear();
352
+ };
353
+ const checkFields = (entities) => {
354
+ for (const entity of entities) {
355
+ const field = unstorableField(entity);
356
+ if (field !== null) throw new Error(`refusing field "${field}" in store "${options.id}": secrets, keys and spend decisions are never stored`);
357
+ }
358
+ };
359
+ const send = (event) => {
360
+ if (stopped) return;
361
+ const e = event;
362
+ if ("slice" in e && !Object.hasOwn(defs, e.slice)) throw new Error(`store "${options.id}" has no slice "${e.slice}"`);
363
+ switch (e.type) {
364
+ case "ENTITY.UPSERT":
365
+ checkFields(e.entities);
366
+ break;
367
+ case "ENTITY.PATCH":
368
+ checkFields([e.patch]);
369
+ break;
370
+ case "WRITE.BEGIN":
371
+ checkFields(e.upsert ?? []);
372
+ break;
373
+ case "QUERY.FETCH":
374
+ watch(e.slice, e.query).fetch(e.query);
375
+ return;
376
+ case "QUERY.REFRESH":
377
+ watch(e.slice, e.query).refresh(e.query);
378
+ return;
379
+ case "QUERY.INVALIDATE": {
380
+ const cache = caches.get(e.slice);
381
+ if (!cache) return;
382
+ if (e.tag !== void 0) cache.invalidate({ tag: e.tag });
383
+ else if (e.query !== void 0) cache.invalidate({ key: e.query });
384
+ else cache.invalidate({ tag: ALL_TAG });
385
+ return;
386
+ }
387
+ case "STORE.INVALIDATE":
388
+ for (const cache of caches.values()) cache.invalidate({ tag: ALL_TAG });
389
+ return;
390
+ case "STORE.CLEAR":
391
+ unwatchAll();
392
+ for (const cache of caches.values()) cache.clear();
393
+ actor.send(e);
394
+ if (saveTimer !== null) clearTimeout(saveTimer);
395
+ saveTimer = null;
396
+ if (persist) void Promise.resolve(persist.adapter.remove(storageKey)).catch(() => {
397
+ });
398
+ return;
399
+ }
400
+ actor.send(e);
401
+ };
402
+ const results = /* @__PURE__ */ new Map();
403
+ const query = (name, q) => {
404
+ const key = keyOf(name, q);
405
+ const slice = data.slices[name] ?? EMPTY_SLICE;
406
+ const view = slice.queries[key] ?? IDLE_QUERY;
407
+ const memoKey = `${name}\0${key}`;
408
+ const held = results.get(memoKey);
409
+ if (held && held.view === view && held.byId === slice.byId) return held.result;
410
+ const entities = view.ids.map((id) => slice.byId[id]).filter((entity) => entity !== void 0);
411
+ const result = held && held.view === view && sameEntities(held.result.entities, entities) ? held.result : Object.freeze({ ...view, entities: Object.freeze(entities) });
412
+ results.set(memoKey, { view, byId: slice.byId, result });
413
+ return result;
414
+ };
415
+ const select = (selector, equals = Object.is) => {
416
+ let from = data;
417
+ let value = selector(data);
418
+ const get = () => {
419
+ if (from !== data) {
420
+ const next = selector(data);
421
+ from = data;
422
+ if (!equals(value, next)) value = next;
423
+ }
424
+ return value;
425
+ };
426
+ return {
427
+ get,
428
+ subscribe: (listener) => {
429
+ let last = get();
430
+ return store.subscribe(() => {
431
+ const next = get();
432
+ if (next === last) return;
433
+ last = next;
434
+ listener(next);
435
+ });
436
+ }
437
+ };
438
+ };
439
+ let stopSync = void 0;
440
+ const ready = persist ? Promise.resolve().then(() => persist.adapter.load(storageKey)).then((raw) => parseSaved(raw, persist), () => null).then((slices) => {
441
+ if (!stopped) actor.send({ type: "STORE.HYDRATED", slices });
442
+ }) : Promise.resolve();
443
+ const store = {
444
+ id: options.id,
445
+ getSnapshot: () => data,
446
+ subscribe: (listener) => {
447
+ listeners.add(listener);
448
+ return () => void listeners.delete(listener);
449
+ },
450
+ send,
451
+ select,
452
+ entity: (name, id) => (data.slices[name] ?? EMPTY_SLICE).byId[id],
453
+ query: (name, q) => query(name, q),
454
+ ready,
455
+ flush: () => ready.then(save),
456
+ stop: () => {
457
+ if (stopped) return;
458
+ stopped = true;
459
+ if (saveTimer !== null) clearTimeout(saveTimer);
460
+ if (typeof stopSync === "function") stopSync();
461
+ unwatchAll();
462
+ actor.stop();
463
+ listeners.clear();
464
+ },
465
+ actor: fromCallback(
466
+ ({ input, sendBack, receive }) => {
467
+ const selection = select(input.select, input.equals);
468
+ const report = (value) => sendBack({ type: "STORE.UPDATE", store: options.id, value });
469
+ report(selection.get());
470
+ receive((event) => send(event));
471
+ return selection.subscribe(report);
472
+ }
473
+ )
474
+ };
475
+ stopSync = options.sync?.(send);
476
+ return store;
477
+ }
478
+ function sameEntities(a, b) {
479
+ return a.length === b.length && a.every((entity, i) => entity === b[i]);
480
+ }
481
+
482
+ export {
483
+ defineSlice,
484
+ shallowEqual,
485
+ isStorableName,
486
+ unstorableField,
487
+ queryAttrs,
488
+ entityAttrs,
489
+ memoryAdapter,
490
+ webStorageAdapter,
491
+ createStoreMachine,
492
+ createAeonStore
493
+ };
@@ -0,0 +1,45 @@
1
+ // src/machines/clipboard.ts
2
+ import { playSound } from "@aeon-ui/core";
3
+ import { fromPromise, setup } from "xstate";
4
+ var CLIPBOARD_STATES = ["idle", "copying", "copied", "failed"];
5
+ var clipboardMachine = setup({
6
+ types: {
7
+ context: {},
8
+ events: {},
9
+ input: {}
10
+ },
11
+ actors: {
12
+ write: fromPromise(async ({ input }) => {
13
+ await navigator.clipboard.writeText(input.value);
14
+ })
15
+ },
16
+ actions: {
17
+ soundCopied: () => playSound("copy"),
18
+ soundFailed: () => playSound("error")
19
+ },
20
+ delays: {
21
+ timeout: ({ context }) => context.timeout
22
+ }
23
+ }).createMachine({
24
+ id: "clipboard",
25
+ context: ({ input }) => ({ timeout: input?.timeout ?? 1500 }),
26
+ initial: "idle",
27
+ states: {
28
+ idle: { on: { COPY: "copying" } },
29
+ copying: {
30
+ invoke: {
31
+ src: "write",
32
+ input: ({ event }) => ({ value: event.value }),
33
+ onDone: "copied",
34
+ onError: "failed"
35
+ }
36
+ },
37
+ copied: { entry: "soundCopied", after: { timeout: "idle" }, on: { COPY: "copying" } },
38
+ failed: { entry: "soundFailed", after: { timeout: "idle" }, on: { COPY: "copying" } }
39
+ }
40
+ });
41
+
42
+ export {
43
+ CLIPBOARD_STATES,
44
+ clipboardMachine
45
+ };
@@ -15,4 +15,7 @@ export { APP_SHELL_STATES, AppShellContext, AppShellEvent, AppShellState, appShe
15
15
  export { AppNavChild, AppNavContext, AppNavEvent, appNavChild, appNavDepth, appNavMachine, appNavStateAttr } from './machines/app-nav.js';
16
16
  export { STICKY_BAR_STATES, StickyBarContext, StickyBarEvent, StickyBarState, stickyBarMachine } from './machines/sticky-bar.js';
17
17
  export { CONTENT_REGION_STATES, ContentRegionContext, ContentRegionEvent, ContentRegionState, contentRegionMachine } from './machines/content-region.js';
18
+ export { CLIPBOARD_STATES, ClipboardContext, ClipboardEvent, ClipboardStatus, clipboardMachine } from './machines/clipboard.js';
19
+ export { CACHE_STATES, CacheCommand, CacheEntryActor, CacheEntryContext, CacheEntryEvent, CacheEntryInput, CacheState, CacheUpdate, CacheView, ChartCache, ChartCacheOptions, cacheEntryMachine, createCacheEntryMachine, createChartCache, isCacheableId } from './machines/cache.js';
20
+ export { AeonStore, AnySlices, EntityOf, PersistedSlices, QueryOf, QueryResult, QueryView, Selection, SliceDefinition, SliceOptions, SliceState, StoreAdapter, StoreEvent, StoreOptions, StorePersistOptions, StoreState, StoreStatus, StoreUpdate, createAeonStore, createStoreMachine, defineSlice, entityAttrs, isStorableName, memoryAdapter, queryAttrs, shallowEqual, unstorableField, webStorageAdapter } from './machines/store.js';
18
21
  import 'xstate';
@@ -1,9 +1,35 @@
1
+ import {
2
+ STICKY_BAR_STATES,
3
+ stickyBarMachine
4
+ } from "./chunk-YBPNI2LI.js";
5
+ import {
6
+ createAeonStore,
7
+ createStoreMachine,
8
+ defineSlice,
9
+ entityAttrs,
10
+ isStorableName,
11
+ memoryAdapter,
12
+ queryAttrs,
13
+ shallowEqual,
14
+ unstorableField,
15
+ webStorageAdapter
16
+ } from "./chunk-H5XJGZHT.js";
17
+ import {
18
+ tabsMachine
19
+ } from "./chunk-HONROWUG.js";
1
20
  import {
2
21
  toastMachine
3
22
  } from "./chunk-5S4DIRL4.js";
4
23
  import {
5
24
  toggleMachine
6
25
  } from "./chunk-H4KOEPYC.js";
26
+ import {
27
+ CONTENT_REGION_STATES,
28
+ contentRegionMachine
29
+ } from "./chunk-RO2DMFN5.js";
30
+ import {
31
+ dialogMachine
32
+ } from "./chunk-SZV6KGXN.js";
7
33
  import {
8
34
  FIELD_INTERACTION_STATES,
9
35
  FIELD_SUBMISSION_STATES,
@@ -31,13 +57,6 @@ import {
31
57
  sliderMachine,
32
58
  snap
33
59
  } from "./chunk-VUPWYBGU.js";
34
- import {
35
- STICKY_BAR_STATES,
36
- stickyBarMachine
37
- } from "./chunk-YBPNI2LI.js";
38
- import {
39
- tabsMachine
40
- } from "./chunk-HONROWUG.js";
41
60
  import {
42
61
  accordionMachine
43
62
  } from "./chunk-JBAG5E6W.js";
@@ -62,16 +81,22 @@ import {
62
81
  buttonLifecycleMachine
63
82
  } from "./chunk-WVICCOQH.js";
64
83
  import {
65
- CONTENT_REGION_STATES,
66
- contentRegionMachine
67
- } from "./chunk-RO2DMFN5.js";
84
+ CACHE_STATES,
85
+ cacheEntryMachine,
86
+ createCacheEntryMachine,
87
+ createChartCache,
88
+ isCacheableId
89
+ } from "./chunk-5BNAV4S2.js";
68
90
  import {
69
- dialogMachine
70
- } from "./chunk-SZV6KGXN.js";
91
+ CLIPBOARD_STATES,
92
+ clipboardMachine
93
+ } from "./chunk-HYHCIMHC.js";
71
94
  export {
72
95
  APP_SHELL_STATES,
73
96
  ASYNC_LIFECYCLE_STATES,
74
97
  BUTTON_LIFECYCLE_STATES,
98
+ CACHE_STATES,
99
+ CLIPBOARD_STATES,
75
100
  CONTENT_REGION_STATES,
76
101
  FIELD_INTERACTION_STATES,
77
102
  FIELD_SUBMISSION_STATES,
@@ -85,24 +110,39 @@ export {
85
110
  appShellMachine,
86
111
  asyncMachine,
87
112
  buttonLifecycleMachine,
113
+ cacheEntryMachine,
88
114
  clamp2 as clampRangeSliderValue,
89
115
  clamp as clampSliderValue,
116
+ clipboardMachine,
90
117
  contentRegionMachine,
118
+ createAeonStore,
91
119
  createAsyncMachine,
120
+ createCacheEntryMachine,
121
+ createChartCache,
122
+ createStoreMachine,
123
+ defineSlice,
92
124
  dialogMachine,
125
+ entityAttrs,
93
126
  fieldMachine,
94
127
  fileUploadMachine,
95
128
  getFileUploadPhase,
129
+ isCacheableId,
96
130
  isEmptyAsyncData,
131
+ isStorableName,
132
+ memoryAdapter,
97
133
  normalizePair as normalizeRangeSliderValues,
98
134
  panelMachine,
99
135
  popoverMachine,
136
+ queryAttrs,
100
137
  rangeSliderMachine,
138
+ shallowEqual,
101
139
  sliderMachine,
102
140
  snap2 as snapRangeSliderValue,
103
141
  snap as snapSliderValue,
104
142
  stickyBarMachine,
105
143
  tabsMachine,
106
144
  toastMachine,
107
- toggleMachine
145
+ toggleMachine,
146
+ unstorableField,
147
+ webStorageAdapter
108
148
  };