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.
- package/CHANGELOG.md +35 -0
- package/README.md +33 -0
- package/package.json +5 -2
- package/packages/core/dist/index.d.ts +116 -1
- package/packages/core/dist/index.js +202 -1
- package/packages/core/src/anatomy.ts +13 -1
- package/packages/core/src/index.ts +2 -0
- package/packages/core/src/list-window.ts +149 -0
- package/packages/core/src/sound.ts +154 -0
- package/packages/panda/package.json +6 -3
- package/packages/panda/panda.config.ts +12 -0
- package/packages/panda/src/recipes/clipboard.ts +40 -0
- package/packages/panda/src/recipes/composer.ts +4 -3
- package/packages/panda/src/recipes/index.ts +4 -0
- package/packages/panda/src/recipes/prose.ts +110 -0
- package/packages/panda/src/recipes/segment-group.ts +50 -0
- package/packages/panda/src/recipes/textarea.ts +60 -0
- package/packages/panda/styled-system/css/conditions.d.ts +7 -0
- package/packages/panda/styled-system/css/conditions.js +32 -0
- package/packages/panda/styled-system/css/css.d.ts +6 -6
- package/packages/panda/styled-system/css/css.js +63 -0
- package/packages/panda/styled-system/css/cva.d.ts +2 -3
- package/packages/panda/styled-system/css/cva.js +51 -0
- package/packages/panda/styled-system/css/cx.d.ts +5 -4
- package/packages/panda/styled-system/css/{cx.mjs → cx.js} +5 -4
- package/packages/panda/styled-system/css/first-that-works.d.ts +22 -0
- package/packages/panda/styled-system/css/first-that-works.js +1 -0
- package/packages/panda/styled-system/css/index.d.ts +6 -3
- package/packages/panda/styled-system/css/index.js +8 -0
- package/packages/panda/styled-system/css/keyframes.d.ts +5 -0
- package/packages/panda/styled-system/css/keyframes.js +8 -0
- package/packages/panda/styled-system/css/position-try.d.ts +5 -0
- package/packages/panda/styled-system/css/position-try.js +11 -0
- package/packages/panda/styled-system/css/sva.d.ts +1 -2
- package/packages/panda/styled-system/css/sva.js +49 -0
- package/packages/panda/styled-system/css/view-transition.d.ts +7 -0
- package/packages/panda/styled-system/css/view-transition.js +18 -0
- package/packages/panda/styled-system/helpers.d.ts +67 -0
- package/packages/panda/styled-system/helpers.js +624 -0
- package/packages/panda/styled-system/jsx/aspect-ratio.d.ts +3 -6
- package/packages/panda/styled-system/jsx/aspect-ratio.js +11 -0
- package/packages/panda/styled-system/jsx/bleed.d.ts +4 -7
- package/packages/panda/styled-system/jsx/bleed.js +11 -0
- package/packages/panda/styled-system/jsx/box.d.ts +4 -7
- package/packages/panda/styled-system/jsx/box.js +11 -0
- package/packages/panda/styled-system/jsx/center.d.ts +4 -7
- package/packages/panda/styled-system/jsx/center.js +11 -0
- package/packages/panda/styled-system/jsx/circle.d.ts +4 -7
- package/packages/panda/styled-system/jsx/circle.js +11 -0
- package/packages/panda/styled-system/jsx/container.d.ts +4 -7
- package/packages/panda/styled-system/jsx/container.js +11 -0
- package/packages/panda/styled-system/jsx/cq.d.ts +4 -7
- package/packages/panda/styled-system/jsx/cq.js +11 -0
- package/packages/panda/styled-system/jsx/create-recipe-context.d.ts +31 -0
- package/packages/panda/styled-system/jsx/create-recipe-context.js +38 -0
- package/packages/panda/styled-system/jsx/create-slot-recipe-context.d.ts +49 -0
- package/packages/panda/styled-system/jsx/create-slot-recipe-context.js +124 -0
- package/packages/panda/styled-system/jsx/divider.d.ts +4 -7
- package/packages/panda/styled-system/jsx/divider.js +11 -0
- package/packages/panda/styled-system/jsx/factory.d.ts +2 -2
- package/packages/panda/styled-system/jsx/factory.js +91 -0
- package/packages/panda/styled-system/jsx/flex.d.ts +4 -7
- package/packages/panda/styled-system/jsx/flex.js +11 -0
- package/packages/panda/styled-system/jsx/float.d.ts +4 -7
- package/packages/panda/styled-system/jsx/float.js +11 -0
- package/packages/panda/styled-system/jsx/grid-item.d.ts +4 -7
- package/packages/panda/styled-system/jsx/grid-item.js +11 -0
- package/packages/panda/styled-system/jsx/grid.d.ts +4 -7
- package/packages/panda/styled-system/jsx/grid.js +11 -0
- package/packages/panda/styled-system/jsx/helper.d.ts +34 -0
- package/packages/panda/styled-system/jsx/helper.js +92 -0
- package/packages/panda/styled-system/jsx/hstack.d.ts +4 -7
- package/packages/panda/styled-system/jsx/hstack.js +11 -0
- package/packages/panda/styled-system/jsx/index.d.ts +17 -17
- package/packages/panda/styled-system/jsx/index.js +24 -0
- package/packages/panda/styled-system/jsx/is-valid-prop.d.ts +5 -10
- package/packages/panda/styled-system/jsx/is-valid-prop.js +12 -0
- package/packages/panda/styled-system/jsx/link-overlay.d.ts +4 -7
- package/packages/panda/styled-system/jsx/link-overlay.js +11 -0
- package/packages/panda/styled-system/jsx/spacer.d.ts +4 -7
- package/packages/panda/styled-system/jsx/spacer.js +11 -0
- package/packages/panda/styled-system/jsx/square.d.ts +4 -7
- package/packages/panda/styled-system/jsx/square.js +11 -0
- package/packages/panda/styled-system/jsx/stack.d.ts +4 -7
- package/packages/panda/styled-system/jsx/stack.js +11 -0
- package/packages/panda/styled-system/jsx/visually-hidden.d.ts +4 -7
- package/packages/panda/styled-system/jsx/visually-hidden.js +11 -0
- package/packages/panda/styled-system/jsx/vstack.d.ts +4 -7
- package/packages/panda/styled-system/jsx/vstack.js +11 -0
- package/packages/panda/styled-system/jsx/wrap.d.ts +4 -7
- package/packages/panda/styled-system/jsx/wrap.js +11 -0
- package/packages/panda/styled-system/patterns/aspect-ratio.d.ts +8 -9
- package/packages/panda/styled-system/patterns/aspect-ratio.js +37 -0
- package/packages/panda/styled-system/patterns/bleed.d.ts +9 -10
- package/packages/panda/styled-system/patterns/bleed.js +30 -0
- package/packages/panda/styled-system/patterns/box.d.ts +8 -11
- package/packages/panda/styled-system/patterns/box.js +16 -0
- package/packages/panda/styled-system/patterns/center.d.ts +8 -9
- package/packages/panda/styled-system/patterns/center.js +22 -0
- package/packages/panda/styled-system/patterns/circle.d.ts +8 -9
- package/packages/panda/styled-system/patterns/circle.js +26 -0
- package/packages/panda/styled-system/patterns/container.d.ts +8 -11
- package/packages/panda/styled-system/patterns/container.js +26 -0
- package/packages/panda/styled-system/patterns/cq.d.ts +10 -10
- package/packages/panda/styled-system/patterns/cq.js +24 -0
- package/packages/panda/styled-system/patterns/divider.d.ts +11 -11
- package/packages/panda/styled-system/patterns/divider.js +31 -0
- package/packages/panda/styled-system/patterns/flex.d.ts +14 -15
- package/packages/panda/styled-system/patterns/flex.js +27 -0
- package/packages/panda/styled-system/patterns/float.d.ts +12 -12
- package/packages/panda/styled-system/patterns/float.js +84 -0
- package/packages/panda/styled-system/patterns/grid-item.d.ts +13 -14
- package/packages/panda/styled-system/patterns/grid-item.js +26 -0
- package/packages/panda/styled-system/patterns/grid.d.ts +13 -13
- package/packages/panda/styled-system/patterns/grid.js +30 -0
- package/packages/panda/styled-system/patterns/hstack.d.ts +9 -10
- package/packages/panda/styled-system/patterns/hstack.js +27 -0
- package/packages/panda/styled-system/patterns/index.d.ts +14 -15
- package/packages/panda/styled-system/patterns/index.js +20 -0
- package/packages/panda/styled-system/patterns/link-overlay.d.ts +8 -11
- package/packages/panda/styled-system/patterns/link-overlay.js +25 -0
- package/packages/panda/styled-system/patterns/runtime.js +25 -0
- package/packages/panda/styled-system/patterns/spacer.d.ts +9 -9
- package/packages/panda/styled-system/patterns/spacer.js +26 -0
- package/packages/panda/styled-system/patterns/square.d.ts +8 -9
- package/packages/panda/styled-system/patterns/square.js +25 -0
- package/packages/panda/styled-system/patterns/stack.d.ts +11 -12
- package/packages/panda/styled-system/patterns/stack.js +30 -0
- package/packages/panda/styled-system/patterns/visually-hidden.d.ts +8 -11
- package/packages/panda/styled-system/patterns/visually-hidden.js +19 -0
- package/packages/panda/styled-system/patterns/vstack.d.ts +9 -10
- package/packages/panda/styled-system/patterns/vstack.js +27 -0
- package/packages/panda/styled-system/patterns/wrap.d.ts +12 -13
- package/packages/panda/styled-system/patterns/wrap.js +26 -0
- package/packages/panda/styled-system/recipes/aeon-accordion.d.ts +9 -26
- package/packages/panda/styled-system/recipes/aeon-accordion.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-app-shell.d.ts +10 -26
- package/packages/panda/styled-system/recipes/aeon-app-shell.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-async.d.ts +9 -26
- package/packages/panda/styled-system/recipes/aeon-async.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-avatar.d.ts +10 -28
- package/packages/panda/styled-system/recipes/aeon-avatar.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-badge.d.ts +8 -26
- package/packages/panda/styled-system/recipes/aeon-badge.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-bar.d.ts +13 -32
- package/packages/panda/styled-system/recipes/aeon-bar.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-button-group.d.ts +10 -33
- package/packages/panda/styled-system/recipes/aeon-button-group.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-button.d.ts +10 -33
- package/packages/panda/styled-system/recipes/aeon-button.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-checkbox.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-checkbox.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-clipboard.d.ts +16 -0
- package/packages/panda/styled-system/recipes/aeon-clipboard.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-combobox.d.ts +9 -26
- package/packages/panda/styled-system/recipes/aeon-combobox.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-composer.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-composer.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-content.d.ts +10 -26
- package/packages/panda/styled-system/recipes/aeon-content.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-conversation.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-conversation.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-dialog.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-dialog.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-entry.d.ts +11 -30
- package/packages/panda/styled-system/recipes/aeon-entry.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-field.d.ts +9 -26
- package/packages/panda/styled-system/recipes/aeon-field.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-file-upload.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-file-upload.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-identity.d.ts +10 -28
- package/packages/panda/styled-system/recipes/aeon-identity.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-list-row.d.ts +9 -26
- package/packages/panda/styled-system/recipes/aeon-list-row.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-menu.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-menu.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-metric-strip.d.ts +10 -28
- package/packages/panda/styled-system/recipes/aeon-metric-strip.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-nav.d.ts +11 -30
- package/packages/panda/styled-system/recipes/aeon-nav.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-panel.d.ts +10 -26
- package/packages/panda/styled-system/recipes/aeon-panel.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-pin-input.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-pin-input.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-popover.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-popover.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-profile-header.d.ts +10 -28
- package/packages/panda/styled-system/recipes/aeon-profile-header.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-progress.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-progress.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-prose.d.ts +16 -0
- package/packages/panda/styled-system/recipes/aeon-prose.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-radio-group.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-radio-group.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-range-slider.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-range-slider.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-scroll.d.ts +12 -36
- package/packages/panda/styled-system/recipes/aeon-scroll.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-segment-group.d.ts +18 -0
- package/packages/panda/styled-system/recipes/aeon-segment-group.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-select.d.ts +9 -26
- package/packages/panda/styled-system/recipes/aeon-select.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-separator.d.ts +10 -26
- package/packages/panda/styled-system/recipes/aeon-separator.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-slider.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-slider.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-switch.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-switch.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-tabs.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-tabs.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-textarea.d.ts +18 -0
- package/packages/panda/styled-system/recipes/aeon-textarea.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-theme-switcher.d.ts +10 -26
- package/packages/panda/styled-system/recipes/aeon-theme-switcher.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-thread.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-thread.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-toast.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-toast.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-tooltip.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-tooltip.js +5 -0
- package/packages/panda/styled-system/recipes/index.d.ts +31 -28
- package/packages/panda/styled-system/recipes/index.js +43 -0
- package/packages/panda/styled-system/recipes/runtime.js +133 -0
- package/packages/panda/styled-system/styles.css +1899 -2106
- package/packages/panda/styled-system/tokens/index.d.ts +4 -5
- package/packages/panda/styled-system/tokens/index.js +18 -0
- package/packages/panda/styled-system/types/index.d.ts +3 -6
- package/packages/panda/styled-system/types/jsx.d.ts +36 -27
- package/packages/panda/styled-system/types/pattern.d.ts +18 -70
- package/packages/panda/styled-system/types/recipe.d.ts +50 -154
- package/packages/panda/styled-system/types/system.d.ts +1826 -0
- package/packages/panda/styled-system/types/tokens.d.ts +65 -0
- package/packages/panda/tsconfig.json +3 -1
- package/packages/primitives/dist/chunk-5BNAV4S2.js +258 -0
- package/packages/primitives/dist/chunk-H5XJGZHT.js +493 -0
- package/packages/primitives/dist/chunk-HYHCIMHC.js +45 -0
- package/packages/primitives/dist/index.d.ts +3 -0
- package/packages/primitives/dist/index.js +53 -13
- package/packages/primitives/dist/machines/cache.d.ts +223 -0
- package/packages/primitives/dist/machines/cache.js +14 -0
- package/packages/primitives/dist/machines/clipboard.d.ts +46 -0
- package/packages/primitives/dist/machines/clipboard.js +8 -0
- package/packages/primitives/dist/machines/store.d.ts +286 -0
- package/packages/primitives/dist/machines/store.js +25 -0
- package/packages/primitives/src/index.ts +3 -0
- package/packages/primitives/src/machines/cache.ts +395 -0
- package/packages/primitives/src/machines/clipboard.ts +56 -0
- package/packages/primitives/src/machines/store.ts +712 -0
- package/packages/react/dist/index.d.ts +116 -11
- package/packages/react/dist/index.js +1379 -994
- package/packages/react/src/clipboard/index.tsx +117 -0
- package/packages/react/src/composer/index.tsx +14 -5
- package/packages/react/src/hooks/use-aeon-store.ts +50 -0
- package/packages/react/src/index.ts +5 -0
- package/packages/react/src/prose/index.tsx +11 -0
- package/packages/react/src/radio-group/index.tsx +2 -1
- package/packages/react/src/scroll/index.tsx +1 -0
- package/packages/react/src/scroll/use-windowed-range.ts +118 -0
- package/packages/react/src/segment-group/index.tsx +171 -0
- package/packages/react/src/select/index.tsx +11 -2
- package/packages/react/src/tabs/index.tsx +19 -7
- package/packages/react/src/textarea/index.tsx +75 -0
- package/packages/react/src/utils/assign-ref.ts +7 -0
- package/packages/schemas/dist/index.d.ts +8 -0
- package/packages/schemas/dist/index.js +59 -0
- package/packages/schemas/json/catalog.json +493 -0
- package/packages/schemas/json/clipboard.json +136 -0
- package/packages/schemas/json/prose.json +103 -0
- package/packages/schemas/json/segmentGroup.json +131 -0
- package/packages/schemas/json/textarea.json +119 -0
- package/packages/schemas/registry/catalog.json +34 -0
- package/packages/schemas/registry/components/clipboard.json +136 -0
- package/packages/schemas/registry/components/prose.json +103 -0
- package/packages/schemas/registry/components/segmentGroup.json +131 -0
- package/packages/schemas/registry/components/textarea.json +119 -0
- package/packages/schemas/registry/machines/clipboard.json +110 -0
- package/packages/schemas/scripts/emit.ts +2 -0
- package/packages/schemas/src/components.ts +63 -0
- package/packages/ui/dist/index.d.ts +27 -3
- package/packages/ui/dist/index.js +232 -165
- package/packages/ui/src/clipboard.tsx +51 -0
- package/packages/ui/src/index.ts +4 -0
- package/packages/ui/src/prose.tsx +15 -0
- package/packages/ui/src/segment-group.tsx +28 -0
- package/packages/ui/src/textarea.tsx +17 -0
- package/scripts/vite-aliases.mjs +2 -2
- package/packages/cli/node_modules/.bin/esbuild +0 -21
- package/packages/cli/node_modules/.bin/jiti +0 -21
- package/packages/cli/node_modules/.bin/tsc +0 -21
- package/packages/cli/node_modules/.bin/tsserver +0 -21
- package/packages/cli/node_modules/.bin/tsup +0 -21
- package/packages/cli/node_modules/.bin/tsup-node +0 -21
- package/packages/cli/node_modules/.bin/tsx +0 -21
- package/packages/cli/node_modules/.bin/vite +0 -21
- package/packages/cli/node_modules/.bin/vitest +0 -21
- package/packages/core/node_modules/.bin/esbuild +0 -21
- package/packages/core/node_modules/.bin/jiti +0 -21
- package/packages/core/node_modules/.bin/tsc +0 -21
- package/packages/core/node_modules/.bin/tsserver +0 -21
- package/packages/core/node_modules/.bin/tsup +0 -21
- package/packages/core/node_modules/.bin/tsup-node +0 -21
- package/packages/core/node_modules/.bin/tsx +0 -21
- package/packages/core/node_modules/.bin/vite +0 -21
- package/packages/core/node_modules/.bin/vitest +0 -21
- package/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/core/src/identicon.test.ts +0 -39
- package/packages/core/src/machine.test.ts +0 -79
- package/packages/core/src/theme.test.ts +0 -14
- package/packages/geometry/node_modules/.bin/esbuild +0 -21
- package/packages/geometry/node_modules/.bin/jiti +0 -21
- package/packages/geometry/node_modules/.bin/tsc +0 -21
- package/packages/geometry/node_modules/.bin/tsserver +0 -21
- package/packages/geometry/node_modules/.bin/tsup +0 -21
- package/packages/geometry/node_modules/.bin/tsup-node +0 -21
- package/packages/geometry/node_modules/.bin/tsx +0 -21
- package/packages/panda/styled-system/css/conditions.mjs +0 -36
- package/packages/panda/styled-system/css/css.mjs +0 -45
- package/packages/panda/styled-system/css/cva.mjs +0 -87
- package/packages/panda/styled-system/css/index.mjs +0 -4
- package/packages/panda/styled-system/css/sva.mjs +0 -46
- package/packages/panda/styled-system/helpers.mjs +0 -328
- package/packages/panda/styled-system/jsx/aspect-ratio.mjs +0 -14
- package/packages/panda/styled-system/jsx/bleed.mjs +0 -14
- package/packages/panda/styled-system/jsx/box.mjs +0 -14
- package/packages/panda/styled-system/jsx/center.mjs +0 -14
- package/packages/panda/styled-system/jsx/circle.mjs +0 -14
- package/packages/panda/styled-system/jsx/container.mjs +0 -14
- package/packages/panda/styled-system/jsx/cq.mjs +0 -14
- package/packages/panda/styled-system/jsx/create-style-context.d.ts +0 -54
- package/packages/panda/styled-system/jsx/create-style-context.mjs +0 -121
- package/packages/panda/styled-system/jsx/divider.mjs +0 -14
- package/packages/panda/styled-system/jsx/factory-helper.mjs +0 -22
- package/packages/panda/styled-system/jsx/factory.mjs +0 -89
- package/packages/panda/styled-system/jsx/flex.mjs +0 -14
- package/packages/panda/styled-system/jsx/float.mjs +0 -14
- package/packages/panda/styled-system/jsx/grid-item.mjs +0 -14
- package/packages/panda/styled-system/jsx/grid.mjs +0 -14
- package/packages/panda/styled-system/jsx/hstack.mjs +0 -14
- package/packages/panda/styled-system/jsx/index.mjs +0 -23
- package/packages/panda/styled-system/jsx/is-valid-prop.mjs +0 -17
- package/packages/panda/styled-system/jsx/link-overlay.mjs +0 -14
- package/packages/panda/styled-system/jsx/spacer.mjs +0 -14
- package/packages/panda/styled-system/jsx/square.mjs +0 -14
- package/packages/panda/styled-system/jsx/stack.mjs +0 -14
- package/packages/panda/styled-system/jsx/visually-hidden.mjs +0 -14
- package/packages/panda/styled-system/jsx/vstack.mjs +0 -14
- package/packages/panda/styled-system/jsx/wrap.mjs +0 -14
- package/packages/panda/styled-system/patterns/aspect-ratio.mjs +0 -38
- package/packages/panda/styled-system/patterns/bleed.mjs +0 -24
- package/packages/panda/styled-system/patterns/box.mjs +0 -15
- package/packages/panda/styled-system/patterns/center.mjs +0 -21
- package/packages/panda/styled-system/patterns/circle.mjs +0 -25
- package/packages/panda/styled-system/patterns/container.mjs +0 -21
- package/packages/panda/styled-system/patterns/cq.mjs +0 -21
- package/packages/panda/styled-system/patterns/divider.mjs +0 -25
- package/packages/panda/styled-system/patterns/flex.mjs +0 -26
- package/packages/panda/styled-system/patterns/float.mjs +0 -52
- package/packages/panda/styled-system/patterns/grid-item.mjs +0 -25
- package/packages/panda/styled-system/patterns/grid.mjs +0 -27
- package/packages/panda/styled-system/patterns/hstack.mjs +0 -24
- package/packages/panda/styled-system/patterns/index.mjs +0 -20
- package/packages/panda/styled-system/patterns/link-overlay.mjs +0 -24
- package/packages/panda/styled-system/patterns/spacer.mjs +0 -25
- package/packages/panda/styled-system/patterns/square.mjs +0 -24
- package/packages/panda/styled-system/patterns/stack.mjs +0 -24
- package/packages/panda/styled-system/patterns/visually-hidden.mjs +0 -18
- package/packages/panda/styled-system/patterns/vstack.mjs +0 -24
- package/packages/panda/styled-system/patterns/wrap.mjs +0 -25
- package/packages/panda/styled-system/recipes/aeon-accordion.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-app-shell.mjs +0 -70
- package/packages/panda/styled-system/recipes/aeon-async.mjs +0 -57
- package/packages/panda/styled-system/recipes/aeon-avatar.mjs +0 -57
- package/packages/panda/styled-system/recipes/aeon-badge.mjs +0 -32
- package/packages/panda/styled-system/recipes/aeon-bar.mjs +0 -77
- package/packages/panda/styled-system/recipes/aeon-button-group.mjs +0 -37
- package/packages/panda/styled-system/recipes/aeon-button.mjs +0 -39
- package/packages/panda/styled-system/recipes/aeon-checkbox.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-combobox.mjs +0 -53
- package/packages/panda/styled-system/recipes/aeon-composer.mjs +0 -57
- package/packages/panda/styled-system/recipes/aeon-content.mjs +0 -70
- package/packages/panda/styled-system/recipes/aeon-conversation.mjs +0 -61
- package/packages/panda/styled-system/recipes/aeon-dialog.mjs +0 -61
- package/packages/panda/styled-system/recipes/aeon-entry.mjs +0 -100
- package/packages/panda/styled-system/recipes/aeon-field.mjs +0 -53
- package/packages/panda/styled-system/recipes/aeon-file-upload.mjs +0 -61
- package/packages/panda/styled-system/recipes/aeon-identity.mjs +0 -63
- package/packages/panda/styled-system/recipes/aeon-list-row.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-menu.mjs +0 -53
- package/packages/panda/styled-system/recipes/aeon-metric-strip.mjs +0 -54
- package/packages/panda/styled-system/recipes/aeon-nav.mjs +0 -69
- package/packages/panda/styled-system/recipes/aeon-panel.mjs +0 -58
- package/packages/panda/styled-system/recipes/aeon-pin-input.mjs +0 -37
- package/packages/panda/styled-system/recipes/aeon-popover.mjs +0 -53
- package/packages/panda/styled-system/recipes/aeon-profile-header.mjs +0 -62
- package/packages/panda/styled-system/recipes/aeon-progress.mjs +0 -45
- package/packages/panda/styled-system/recipes/aeon-radio-group.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-range-slider.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-scroll.mjs +0 -64
- package/packages/panda/styled-system/recipes/aeon-select.mjs +0 -57
- package/packages/panda/styled-system/recipes/aeon-separator.mjs +0 -42
- package/packages/panda/styled-system/recipes/aeon-slider.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-switch.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-tabs.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-theme-switcher.mjs +0 -59
- package/packages/panda/styled-system/recipes/aeon-thread.mjs +0 -73
- package/packages/panda/styled-system/recipes/aeon-toast.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-tooltip.mjs +0 -49
- package/packages/panda/styled-system/recipes/create-recipe.mjs +0 -82
- package/packages/panda/styled-system/recipes/index.mjs +0 -39
- package/packages/panda/styled-system/tokens/index.mjs +0 -2224
- package/packages/panda/styled-system/tokens/tokens.d.ts +0 -60
- package/packages/panda/styled-system/types/composition.d.ts +0 -227
- package/packages/panda/styled-system/types/conditions.d.ts +0 -346
- package/packages/panda/styled-system/types/csstype.d.ts +0 -22570
- package/packages/panda/styled-system/types/global.d.ts +0 -20
- package/packages/panda/styled-system/types/parts.d.ts +0 -8
- package/packages/panda/styled-system/types/prop-type.d.ts +0 -250
- package/packages/panda/styled-system/types/selectors.d.ts +0 -59
- package/packages/panda/styled-system/types/static-css.d.ts +0 -56
- package/packages/panda/styled-system/types/style-props.d.ts +0 -8089
- package/packages/panda/styled-system/types/system-types.d.ts +0 -151
- package/packages/primitives/node_modules/.bin/esbuild +0 -21
- package/packages/primitives/node_modules/.bin/jiti +0 -21
- package/packages/primitives/node_modules/.bin/tsc +0 -21
- package/packages/primitives/node_modules/.bin/tsserver +0 -21
- package/packages/primitives/node_modules/.bin/tsup +0 -21
- package/packages/primitives/node_modules/.bin/tsup-node +0 -21
- package/packages/primitives/node_modules/.bin/tsx +0 -21
- package/packages/primitives/node_modules/.bin/vite +0 -21
- package/packages/primitives/node_modules/.bin/vitest +0 -21
- package/packages/primitives/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/primitives/src/__tests__/app-nav.test.ts +0 -30
- package/packages/primitives/src/__tests__/file-upload.test.ts +0 -25
- package/packages/primitives/src/__tests__/floating-surface.test.ts +0 -29
- package/packages/primitives/src/__tests__/range-slider.test.ts +0 -39
- package/packages/react/node_modules/.bin/esbuild +0 -21
- package/packages/react/node_modules/.bin/jiti +0 -21
- package/packages/react/node_modules/.bin/tsc +0 -21
- package/packages/react/node_modules/.bin/tsserver +0 -21
- package/packages/react/node_modules/.bin/tsup +0 -21
- package/packages/react/node_modules/.bin/tsup-node +0 -21
- package/packages/react/node_modules/.bin/tsx +0 -21
- package/packages/react/node_modules/.bin/vite +0 -21
- package/packages/react/node_modules/.bin/vitest +0 -21
- package/packages/react/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/react/src/avatar/avatar.test.tsx +0 -27
- package/packages/react/src/dialog/dialog.test.tsx +0 -77
- package/packages/react/src/select/select.test.tsx +0 -81
- package/packages/react/src/toast/toast.test.tsx +0 -40
- package/packages/react/src/tooltip/tooltip.test.tsx +0 -122
- package/packages/react-scene/node_modules/.bin/jiti +0 -21
- package/packages/react-scene/node_modules/.bin/tsc +0 -21
- package/packages/react-scene/node_modules/.bin/tsserver +0 -21
- package/packages/react-scene/node_modules/.bin/tsup +0 -21
- package/packages/react-scene/node_modules/.bin/tsup-node +0 -21
- package/packages/react-scene/node_modules/.bin/tsx +0 -21
- package/packages/scene/node_modules/.bin/jiti +0 -21
- package/packages/scene/node_modules/.bin/tsc +0 -21
- package/packages/scene/node_modules/.bin/tsserver +0 -21
- package/packages/scene/node_modules/.bin/tsup +0 -21
- package/packages/scene/node_modules/.bin/tsup-node +0 -21
- package/packages/scene/node_modules/.bin/tsx +0 -21
- package/packages/schemas/node_modules/.bin/esbuild +0 -21
- package/packages/schemas/node_modules/.bin/jiti +0 -21
- package/packages/schemas/node_modules/.bin/tsc +0 -21
- package/packages/schemas/node_modules/.bin/tsserver +0 -21
- package/packages/schemas/node_modules/.bin/tsup +0 -21
- package/packages/schemas/node_modules/.bin/tsup-node +0 -21
- package/packages/schemas/node_modules/.bin/tsx +0 -21
- package/packages/schemas/node_modules/.bin/vite +0 -21
- package/packages/schemas/node_modules/.bin/vitest +0 -21
- package/packages/schemas/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/schemas/src/aeon-to-schema.test.ts +0 -70
- package/packages/schemas/src/index.test.ts +0 -108
- package/packages/signal/node_modules/.bin/jiti +0 -21
- package/packages/signal/node_modules/.bin/tsc +0 -21
- package/packages/signal/node_modules/.bin/tsserver +0 -21
- package/packages/signal/node_modules/.bin/tsup +0 -21
- package/packages/signal/node_modules/.bin/tsup-node +0 -21
- package/packages/signal/node_modules/.bin/tsx +0 -21
- package/packages/site/node_modules/.bin/jiti +0 -21
- package/packages/site/node_modules/.bin/tsc +0 -21
- package/packages/site/node_modules/.bin/tsserver +0 -21
- package/packages/site/node_modules/.bin/tsup +0 -21
- package/packages/site/node_modules/.bin/tsup-node +0 -21
- package/packages/site/node_modules/.bin/tsx +0 -21
- package/packages/solid/node_modules/.bin/jiti +0 -21
- package/packages/solid/node_modules/.bin/tsc +0 -21
- package/packages/solid/node_modules/.bin/tsserver +0 -21
- package/packages/solid/node_modules/.bin/tsup +0 -21
- package/packages/solid/node_modules/.bin/tsup-node +0 -21
- package/packages/solid/node_modules/.bin/tsx +0 -21
- package/packages/surface/node_modules/.bin/jiti +0 -21
- package/packages/surface/node_modules/.bin/tsc +0 -21
- package/packages/surface/node_modules/.bin/tsserver +0 -21
- package/packages/surface/node_modules/.bin/tsup +0 -21
- package/packages/surface/node_modules/.bin/tsup-node +0 -21
- package/packages/surface/node_modules/.bin/tsx +0 -21
- package/packages/svelte/node_modules/.bin/acorn +0 -21
- package/packages/svelte/node_modules/.bin/esbuild +0 -21
- package/packages/svelte/node_modules/.bin/jiti +0 -21
- package/packages/svelte/node_modules/.bin/svelte-check +0 -21
- package/packages/svelte/node_modules/.bin/tsc +0 -21
- package/packages/svelte/node_modules/.bin/tsserver +0 -21
- package/packages/svelte/node_modules/.bin/tsup +0 -21
- package/packages/svelte/node_modules/.bin/tsup-node +0 -21
- package/packages/svelte/node_modules/.bin/tsx +0 -21
- package/packages/svelte/node_modules/.bin/vite +0 -21
- package/packages/tree/node_modules/.bin/esbuild +0 -21
- package/packages/tree/node_modules/.bin/jiti +0 -21
- package/packages/tree/node_modules/.bin/tsc +0 -21
- package/packages/tree/node_modules/.bin/tsserver +0 -21
- package/packages/tree/node_modules/.bin/tsup +0 -21
- package/packages/tree/node_modules/.bin/tsup-node +0 -21
- package/packages/tree/node_modules/.bin/tsx +0 -21
- package/packages/tree/node_modules/.bin/vite +0 -21
- package/packages/tree/node_modules/.bin/vitest +0 -21
- package/packages/tree/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/tree/src/exclusive-action.test.ts +0 -54
- package/packages/ui/node_modules/.bin/jiti +0 -21
- package/packages/ui/node_modules/.bin/tsc +0 -21
- package/packages/ui/node_modules/.bin/tsserver +0 -21
- package/packages/ui/node_modules/.bin/tsup +0 -21
- package/packages/ui/node_modules/.bin/tsup-node +0 -21
- package/packages/ui/node_modules/.bin/tsx +0 -21
- package/packages/vue/node_modules/.bin/jiti +0 -21
- package/packages/vue/node_modules/.bin/tsc +0 -21
- package/packages/vue/node_modules/.bin/tsserver +0 -21
- package/packages/vue/node_modules/.bin/tsup +0 -21
- package/packages/vue/node_modules/.bin/tsup-node +0 -21
- package/packages/vue/node_modules/.bin/tsx +0 -21
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import * as xstate from 'xstate';
|
|
2
|
+
import { ActorRefFrom, fromCallback } from 'xstate';
|
|
3
|
+
|
|
4
|
+
/** Stable lifecycle states of one cache entry (see STATES.md). */
|
|
5
|
+
declare const CACHE_STATES: readonly ["idle", "loading", "ready", "stale", "refreshing", "failed"];
|
|
6
|
+
type CacheState = (typeof CACHE_STATES)[number];
|
|
7
|
+
declare function isCacheableId(id: string): boolean;
|
|
8
|
+
interface CacheEntryContext<T, K> {
|
|
9
|
+
key: K;
|
|
10
|
+
ttl: number;
|
|
11
|
+
data: T | undefined;
|
|
12
|
+
error: string | null;
|
|
13
|
+
/** When `data` was loaded; null while there is none. */
|
|
14
|
+
loadedAt: number | null;
|
|
15
|
+
/** An invalidation landed mid-load: the result may predate the write, so load once more. */
|
|
16
|
+
dirty: boolean;
|
|
17
|
+
now: () => number;
|
|
18
|
+
}
|
|
19
|
+
type CacheEntryEvent = {
|
|
20
|
+
type: 'FETCH';
|
|
21
|
+
} | {
|
|
22
|
+
type: 'REFRESH';
|
|
23
|
+
} | {
|
|
24
|
+
type: 'INVALIDATE';
|
|
25
|
+
refetch?: boolean;
|
|
26
|
+
} | {
|
|
27
|
+
type: 'CLEAR';
|
|
28
|
+
};
|
|
29
|
+
interface CacheEntryInput<K> {
|
|
30
|
+
key: K;
|
|
31
|
+
ttl: number;
|
|
32
|
+
now?: () => number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* One keyed entry: idle until fetched, loading the first time, ready while
|
|
36
|
+
* younger than its time-to-live, then stale. FETCH on a stale or expired entry
|
|
37
|
+
* revalidates in `refreshing` while the old data stays readable; FETCH while a
|
|
38
|
+
* load runs is dropped, so one load serves every caller. INVALIDATE marks the
|
|
39
|
+
* entry stale (and reloads when `refetch`); CLEAR drops the data and cancels a
|
|
40
|
+
* running load so its result never lands.
|
|
41
|
+
*/
|
|
42
|
+
declare function createCacheEntryMachine<T, K = string>(): xstate.StateMachine<CacheEntryContext<T, K>, {
|
|
43
|
+
type: "FETCH";
|
|
44
|
+
} | {
|
|
45
|
+
type: "REFRESH";
|
|
46
|
+
} | {
|
|
47
|
+
type: "INVALIDATE";
|
|
48
|
+
refetch?: boolean;
|
|
49
|
+
} | {
|
|
50
|
+
type: "CLEAR";
|
|
51
|
+
}, {
|
|
52
|
+
[x: string]: xstate.ActorRefFromLogic<xstate.PromiseActorLogic<T, {
|
|
53
|
+
key: K;
|
|
54
|
+
}, xstate.EventObject>> | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
src: "load";
|
|
57
|
+
logic: xstate.PromiseActorLogic<T, {
|
|
58
|
+
key: K;
|
|
59
|
+
}, xstate.EventObject>;
|
|
60
|
+
id: string | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
type: "clear";
|
|
63
|
+
params: xstate.NonReducibleUnknown;
|
|
64
|
+
} | {
|
|
65
|
+
type: "markDirty";
|
|
66
|
+
params: xstate.NonReducibleUnknown;
|
|
67
|
+
}, {
|
|
68
|
+
type: "dirty";
|
|
69
|
+
params: unknown;
|
|
70
|
+
} | {
|
|
71
|
+
type: "expired";
|
|
72
|
+
params: unknown;
|
|
73
|
+
} | {
|
|
74
|
+
type: "refetch";
|
|
75
|
+
params: unknown;
|
|
76
|
+
}, "ttl", "idle" | "loading" | "stale" | "ready" | "failed" | "refreshing", string, CacheEntryInput<K>, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
|
|
77
|
+
id: "cacheEntry";
|
|
78
|
+
states: {
|
|
79
|
+
readonly idle: {};
|
|
80
|
+
readonly loading: {};
|
|
81
|
+
readonly ready: {};
|
|
82
|
+
readonly stale: {};
|
|
83
|
+
readonly refreshing: {};
|
|
84
|
+
readonly failed: {};
|
|
85
|
+
};
|
|
86
|
+
}>;
|
|
87
|
+
declare const cacheEntryMachine: xstate.StateMachine<CacheEntryContext<unknown, string>, {
|
|
88
|
+
type: "FETCH";
|
|
89
|
+
} | {
|
|
90
|
+
type: "REFRESH";
|
|
91
|
+
} | {
|
|
92
|
+
type: "INVALIDATE";
|
|
93
|
+
refetch?: boolean;
|
|
94
|
+
} | {
|
|
95
|
+
type: "CLEAR";
|
|
96
|
+
}, {
|
|
97
|
+
[x: string]: xstate.ActorRefFromLogic<xstate.PromiseActorLogic<unknown, {
|
|
98
|
+
key: string;
|
|
99
|
+
}, xstate.EventObject>> | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
src: "load";
|
|
102
|
+
logic: xstate.PromiseActorLogic<unknown, {
|
|
103
|
+
key: string;
|
|
104
|
+
}, xstate.EventObject>;
|
|
105
|
+
id: string | undefined;
|
|
106
|
+
}, {
|
|
107
|
+
type: "clear";
|
|
108
|
+
params: xstate.NonReducibleUnknown;
|
|
109
|
+
} | {
|
|
110
|
+
type: "markDirty";
|
|
111
|
+
params: xstate.NonReducibleUnknown;
|
|
112
|
+
}, {
|
|
113
|
+
type: "dirty";
|
|
114
|
+
params: unknown;
|
|
115
|
+
} | {
|
|
116
|
+
type: "expired";
|
|
117
|
+
params: unknown;
|
|
118
|
+
} | {
|
|
119
|
+
type: "refetch";
|
|
120
|
+
params: unknown;
|
|
121
|
+
}, "ttl", "idle" | "loading" | "stale" | "ready" | "failed" | "refreshing", string, CacheEntryInput<string>, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
|
|
122
|
+
id: "cacheEntry";
|
|
123
|
+
states: {
|
|
124
|
+
readonly idle: {};
|
|
125
|
+
readonly loading: {};
|
|
126
|
+
readonly ready: {};
|
|
127
|
+
readonly stale: {};
|
|
128
|
+
readonly refreshing: {};
|
|
129
|
+
readonly failed: {};
|
|
130
|
+
};
|
|
131
|
+
}>;
|
|
132
|
+
type CacheEntryActor<T, K = string> = ActorRefFrom<ReturnType<typeof createCacheEntryMachine<T, K>>>;
|
|
133
|
+
/**
|
|
134
|
+
* What a reader sees of one entry. The same object comes back until the entry
|
|
135
|
+
* changes, and `data` keeps its identity across ready, stale and refreshing,
|
|
136
|
+
* so selectors over a view never cause a re-render on their own.
|
|
137
|
+
*/
|
|
138
|
+
interface CacheView<T> {
|
|
139
|
+
readonly state: CacheState;
|
|
140
|
+
readonly data: T | undefined;
|
|
141
|
+
readonly error: string | null;
|
|
142
|
+
readonly loadedAt: number | null;
|
|
143
|
+
}
|
|
144
|
+
/** Commands a chart sends the cache, directly or through the invoked cache actor. */
|
|
145
|
+
type CacheCommand<K> = {
|
|
146
|
+
type: 'CACHE.FETCH';
|
|
147
|
+
key?: K;
|
|
148
|
+
} | {
|
|
149
|
+
type: 'CACHE.REFRESH';
|
|
150
|
+
key?: K;
|
|
151
|
+
} | {
|
|
152
|
+
type: 'CACHE.INVALIDATE';
|
|
153
|
+
key?: K;
|
|
154
|
+
tag?: string;
|
|
155
|
+
} | {
|
|
156
|
+
type: 'CACHE.KEY';
|
|
157
|
+
key: K;
|
|
158
|
+
} | {
|
|
159
|
+
type: 'CACHE.CLEAR';
|
|
160
|
+
};
|
|
161
|
+
/** What the invoked cache actor sends its parent chart whenever its entry changes. */
|
|
162
|
+
interface CacheUpdate<T, K> {
|
|
163
|
+
type: 'CACHE.UPDATE';
|
|
164
|
+
cache: string;
|
|
165
|
+
key: K;
|
|
166
|
+
view: CacheView<T>;
|
|
167
|
+
}
|
|
168
|
+
interface ChartCacheOptions<T, K> {
|
|
169
|
+
/** Names the cache in logs and errors. Names of secrets, keys or spend decisions are refused. */
|
|
170
|
+
id: string;
|
|
171
|
+
load: (key: K, context: {
|
|
172
|
+
signal: AbortSignal;
|
|
173
|
+
}) => Promise<T>;
|
|
174
|
+
/** Milliseconds an entry stays fresh, for every key or per key. */
|
|
175
|
+
ttl: number | ((key: K) => number);
|
|
176
|
+
tags?: (key: K) => readonly string[];
|
|
177
|
+
/** Turns a key into the string entries are stored under. Defaults to `String` for strings, else JSON. */
|
|
178
|
+
keyOf?: (key: K) => string;
|
|
179
|
+
/** Most entries kept; the least recently used unwatched, settled ones go first. Default 100. */
|
|
180
|
+
maxEntries?: number;
|
|
181
|
+
now?: () => number;
|
|
182
|
+
}
|
|
183
|
+
interface ChartCache<T, K = string> {
|
|
184
|
+
readonly id: string;
|
|
185
|
+
/** Entries currently held. */
|
|
186
|
+
readonly size: number;
|
|
187
|
+
/** The entry's current view, without loading it. Stable until the entry changes. */
|
|
188
|
+
peek(key: K): CacheView<T>;
|
|
189
|
+
/** Loads the entry if it is missing, failed, stale or expired; a running load is reused. */
|
|
190
|
+
fetch(key: K): void;
|
|
191
|
+
/** Reloads now, keeping the old data readable meanwhile. */
|
|
192
|
+
refresh(key: K): void;
|
|
193
|
+
/** Resolves with the entry's data, serving stale data at once while it revalidates. */
|
|
194
|
+
read(key: K): Promise<T>;
|
|
195
|
+
/** Marks entries stale; watched ones reload at once. */
|
|
196
|
+
invalidate(target: {
|
|
197
|
+
key: K;
|
|
198
|
+
} | {
|
|
199
|
+
tag: string;
|
|
200
|
+
}): void;
|
|
201
|
+
/** Drops every entry's data and cancels running loads (lock, account or network switch). */
|
|
202
|
+
clear(): void;
|
|
203
|
+
subscribe(key: K, listener: (view: CacheView<T>) => void): () => void;
|
|
204
|
+
send(command: CacheCommand<K>): void;
|
|
205
|
+
/**
|
|
206
|
+
* Invoke from a chart: `invoke: { id: 'cache', src: cache.actor, input: { key } }`.
|
|
207
|
+
* It fetches the key, sends `CACHE.UPDATE` on every change, and takes
|
|
208
|
+
* `CACHE.*` commands from the parent (`sendTo('cache', …)`); commands without
|
|
209
|
+
* a key apply to its own, and `CACHE.KEY` moves it to another key.
|
|
210
|
+
*/
|
|
211
|
+
readonly actor: ReturnType<typeof fromCallback<CacheCommand<K>, {
|
|
212
|
+
key: K;
|
|
213
|
+
fetch?: boolean;
|
|
214
|
+
}>>;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* A keyed cache shared by every chart that reads it, so a remounted chart is
|
|
218
|
+
* served from memory instead of loading again. Each entry is its own
|
|
219
|
+
* `cacheEntryMachine`; create one cache per kind of data at module scope.
|
|
220
|
+
*/
|
|
221
|
+
declare function createChartCache<T, K = string>(options: ChartCacheOptions<T, K>): ChartCache<T, K>;
|
|
222
|
+
|
|
223
|
+
export { CACHE_STATES, type CacheCommand, type CacheEntryActor, type CacheEntryContext, type CacheEntryEvent, type CacheEntryInput, type CacheState, type CacheUpdate, type CacheView, type ChartCache, type ChartCacheOptions, cacheEntryMachine, createCacheEntryMachine, createChartCache, isCacheableId };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CACHE_STATES,
|
|
3
|
+
cacheEntryMachine,
|
|
4
|
+
createCacheEntryMachine,
|
|
5
|
+
createChartCache,
|
|
6
|
+
isCacheableId
|
|
7
|
+
} from "../chunk-5BNAV4S2.js";
|
|
8
|
+
export {
|
|
9
|
+
CACHE_STATES,
|
|
10
|
+
cacheEntryMachine,
|
|
11
|
+
createCacheEntryMachine,
|
|
12
|
+
createChartCache,
|
|
13
|
+
isCacheableId
|
|
14
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as xstate from 'xstate';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Copy-to-clipboard feedback.
|
|
5
|
+
*
|
|
6
|
+
* Events: COPY { value } writes `value` to the system clipboard.
|
|
7
|
+
* States: idle → copying → copied | failed, back to idle after `timeout` ms. COPY again restarts.
|
|
8
|
+
* Entering copied / failed plays the `copy` / `error` sound (silent unless the app enabled sounds).
|
|
9
|
+
*/
|
|
10
|
+
interface ClipboardContext {
|
|
11
|
+
/** How long `copied` / `failed` show before returning to idle, in ms. */
|
|
12
|
+
timeout: number;
|
|
13
|
+
}
|
|
14
|
+
type ClipboardEvent = {
|
|
15
|
+
type: 'COPY';
|
|
16
|
+
value: string;
|
|
17
|
+
};
|
|
18
|
+
declare const CLIPBOARD_STATES: readonly ["idle", "copying", "copied", "failed"];
|
|
19
|
+
type ClipboardStatus = (typeof CLIPBOARD_STATES)[number];
|
|
20
|
+
declare const clipboardMachine: xstate.StateMachine<ClipboardContext, ClipboardEvent, {
|
|
21
|
+
[x: string]: xstate.ActorRefFromLogic<xstate.PromiseActorLogic<void, {
|
|
22
|
+
value: string;
|
|
23
|
+
}, xstate.EventObject>> | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
src: "write";
|
|
26
|
+
logic: xstate.PromiseActorLogic<void, {
|
|
27
|
+
value: string;
|
|
28
|
+
}, xstate.EventObject>;
|
|
29
|
+
id: string | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
type: "soundCopied";
|
|
32
|
+
params: unknown;
|
|
33
|
+
} | {
|
|
34
|
+
type: "soundFailed";
|
|
35
|
+
params: unknown;
|
|
36
|
+
}, never, "timeout", "idle" | "copying" | "copied" | "failed", string, Partial<ClipboardContext>, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
|
|
37
|
+
id: "clipboard";
|
|
38
|
+
states: {
|
|
39
|
+
readonly idle: {};
|
|
40
|
+
readonly copying: {};
|
|
41
|
+
readonly copied: {};
|
|
42
|
+
readonly failed: {};
|
|
43
|
+
};
|
|
44
|
+
}>;
|
|
45
|
+
|
|
46
|
+
export { CLIPBOARD_STATES, type ClipboardContext, type ClipboardEvent, type ClipboardStatus, clipboardMachine };
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import * as xstate from 'xstate';
|
|
2
|
+
import { fromCallback } from 'xstate';
|
|
3
|
+
import { CacheState, CacheView } from './cache.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* One store per app: every entity lives once, by id, in its slice. Charts and
|
|
7
|
+
* components read through selectors and project state onto `data-aeon-*`
|
|
8
|
+
* attributes; the only way to change anything is an event sent to the store.
|
|
9
|
+
*/
|
|
10
|
+
interface SliceOptions<E, Q> {
|
|
11
|
+
idOf: (entity: E) => string;
|
|
12
|
+
/** Loads the entities a query names. Slices without `load` are filled by events only. */
|
|
13
|
+
load?: (query: Q, context: {
|
|
14
|
+
signal: AbortSignal;
|
|
15
|
+
}) => Promise<readonly E[]>;
|
|
16
|
+
/** Milliseconds a query result stays fresh. Default 30 seconds. */
|
|
17
|
+
ttl?: number | ((query: Q) => number);
|
|
18
|
+
tags?: (query: Q) => readonly string[];
|
|
19
|
+
/** Turns a query into the key its result is stored under. Defaults to `String` for strings, else JSON. */
|
|
20
|
+
queryKey?: (query: Q) => string;
|
|
21
|
+
/** An incoming entity equal to the held one keeps the held object, so selectors stay quiet. Default: shallow equality. */
|
|
22
|
+
equals?: (a: E, b: E) => boolean;
|
|
23
|
+
/** Saved by the store's persistence adapter. Default true. */
|
|
24
|
+
persist?: boolean;
|
|
25
|
+
}
|
|
26
|
+
interface SliceDefinition<E, Q> extends SliceOptions<E, Q> {
|
|
27
|
+
readonly __types?: {
|
|
28
|
+
entity: E;
|
|
29
|
+
query: Q;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
declare function defineSlice<E, Q = string>(options: SliceOptions<E, Q>): SliceDefinition<E, Q>;
|
|
33
|
+
type AnySlices = Record<string, SliceDefinition<any, any>>;
|
|
34
|
+
type EntityOf<D> = D extends {
|
|
35
|
+
readonly __types?: {
|
|
36
|
+
entity: infer E;
|
|
37
|
+
};
|
|
38
|
+
} ? E : never;
|
|
39
|
+
type QueryOf<D> = D extends {
|
|
40
|
+
readonly __types?: {
|
|
41
|
+
query: infer Q;
|
|
42
|
+
};
|
|
43
|
+
} ? Q : never;
|
|
44
|
+
/** One query's result: its load state and the ids it returned, in order. */
|
|
45
|
+
interface QueryView {
|
|
46
|
+
readonly state: CacheState;
|
|
47
|
+
readonly ids: readonly string[];
|
|
48
|
+
readonly error: string | null;
|
|
49
|
+
readonly loadedAt: number | null;
|
|
50
|
+
}
|
|
51
|
+
interface SliceState<E> {
|
|
52
|
+
readonly byId: Readonly<Record<string, E>>;
|
|
53
|
+
/** Every held id, in arrival order. */
|
|
54
|
+
readonly ids: readonly string[];
|
|
55
|
+
readonly queries: Readonly<Record<string, QueryView>>;
|
|
56
|
+
/** Entity id → the optimistic write it waits on. */
|
|
57
|
+
readonly pending: Readonly<Record<string, string>>;
|
|
58
|
+
/** Entity id → why its last write was rolled back. Cleared by the next write to it. */
|
|
59
|
+
readonly failed: Readonly<Record<string, string>>;
|
|
60
|
+
}
|
|
61
|
+
type StoreStatus = 'hydrating' | 'ready';
|
|
62
|
+
interface PendingWrite {
|
|
63
|
+
slice: string;
|
|
64
|
+
/** Values before the write, restored on rollback. */
|
|
65
|
+
before: Record<string, unknown>;
|
|
66
|
+
/** Values the write put in place; rollback only restores entities still holding them. */
|
|
67
|
+
after: Record<string, unknown>;
|
|
68
|
+
}
|
|
69
|
+
interface StoreState<S extends AnySlices> {
|
|
70
|
+
readonly status: StoreStatus;
|
|
71
|
+
readonly slices: {
|
|
72
|
+
readonly [N in keyof S]: SliceState<EntityOf<S[N]>>;
|
|
73
|
+
};
|
|
74
|
+
readonly writes: Readonly<Record<string, PendingWrite>>;
|
|
75
|
+
}
|
|
76
|
+
type SliceEvent<N extends string, E, Q> = {
|
|
77
|
+
type: 'ENTITY.UPSERT';
|
|
78
|
+
slice: N;
|
|
79
|
+
entities: readonly E[];
|
|
80
|
+
} | {
|
|
81
|
+
type: 'ENTITY.PATCH';
|
|
82
|
+
slice: N;
|
|
83
|
+
id: string;
|
|
84
|
+
patch: Partial<E>;
|
|
85
|
+
} | {
|
|
86
|
+
type: 'ENTITY.REMOVE';
|
|
87
|
+
slice: N;
|
|
88
|
+
ids: readonly string[];
|
|
89
|
+
} | {
|
|
90
|
+
type: 'QUERY.FETCH';
|
|
91
|
+
slice: N;
|
|
92
|
+
query: Q;
|
|
93
|
+
} | {
|
|
94
|
+
type: 'QUERY.REFRESH';
|
|
95
|
+
slice: N;
|
|
96
|
+
query: Q;
|
|
97
|
+
} | {
|
|
98
|
+
type: 'QUERY.INVALIDATE';
|
|
99
|
+
slice: N;
|
|
100
|
+
query?: Q;
|
|
101
|
+
tag?: string;
|
|
102
|
+
}
|
|
103
|
+
/** Applies at once and marks the entities pending until WRITE.CONFIRM or WRITE.ROLLBACK. */
|
|
104
|
+
| {
|
|
105
|
+
type: 'WRITE.BEGIN';
|
|
106
|
+
slice: N;
|
|
107
|
+
write: string;
|
|
108
|
+
upsert?: readonly E[];
|
|
109
|
+
remove?: readonly string[];
|
|
110
|
+
};
|
|
111
|
+
/** Everything a store accepts. Writes, loads and invalidations all go through here. */
|
|
112
|
+
type StoreEvent<S extends AnySlices> = {
|
|
113
|
+
[N in keyof S & string]: SliceEvent<N, EntityOf<S[N]>, QueryOf<S[N]>>;
|
|
114
|
+
}[keyof S & string] | {
|
|
115
|
+
type: 'WRITE.CONFIRM';
|
|
116
|
+
write: string;
|
|
117
|
+
} | {
|
|
118
|
+
type: 'WRITE.ROLLBACK';
|
|
119
|
+
write: string;
|
|
120
|
+
error?: string;
|
|
121
|
+
}
|
|
122
|
+
/** Marks every query stale; watched ones reload (reconnect, window focus). */
|
|
123
|
+
| {
|
|
124
|
+
type: 'STORE.INVALIDATE';
|
|
125
|
+
}
|
|
126
|
+
/** Drops all data, running loads and saved data (lock, account or network switch). */
|
|
127
|
+
| {
|
|
128
|
+
type: 'STORE.CLEAR';
|
|
129
|
+
};
|
|
130
|
+
interface StoreAdapter {
|
|
131
|
+
load(key: string): string | null | undefined | Promise<string | null | undefined>;
|
|
132
|
+
save(key: string, value: string): void | Promise<void>;
|
|
133
|
+
remove(key: string): void | Promise<void>;
|
|
134
|
+
}
|
|
135
|
+
interface StorePersistOptions {
|
|
136
|
+
adapter: StoreAdapter;
|
|
137
|
+
/** Bump when the saved shape changes; older data goes through `migrate` or is dropped. */
|
|
138
|
+
version: number;
|
|
139
|
+
migrate?: (saved: PersistedSlices, fromVersion: number) => PersistedSlices | null | undefined;
|
|
140
|
+
/** Milliseconds of quiet before a save. Default 250. */
|
|
141
|
+
delayMs?: number;
|
|
142
|
+
}
|
|
143
|
+
type PersistedSlices = Record<string, {
|
|
144
|
+
byId: Record<string, unknown>;
|
|
145
|
+
ids: string[];
|
|
146
|
+
}>;
|
|
147
|
+
interface StoreOptions<S extends AnySlices> {
|
|
148
|
+
/** Names the store and its saved data. Names of secrets, keys or spend decisions are refused. */
|
|
149
|
+
id: string;
|
|
150
|
+
slices: S;
|
|
151
|
+
persist?: StorePersistOptions;
|
|
152
|
+
/** Starts a server or disk feed that sends store events; returns its stop function. */
|
|
153
|
+
sync?: (send: (event: StoreEvent<S>) => void) => (() => void) | void;
|
|
154
|
+
now?: () => number;
|
|
155
|
+
}
|
|
156
|
+
/** A query's view with its entities resolved. Stable until the view or one of its entities changes. */
|
|
157
|
+
interface QueryResult<E> extends QueryView {
|
|
158
|
+
readonly entities: readonly E[];
|
|
159
|
+
}
|
|
160
|
+
interface Selection<T> {
|
|
161
|
+
get(): T;
|
|
162
|
+
/** Calls back only when the selected value changes under `equals`. */
|
|
163
|
+
subscribe(listener: (value: T) => void): () => void;
|
|
164
|
+
}
|
|
165
|
+
/** What the invoked store actor sends its parent chart whenever its selection changes. */
|
|
166
|
+
interface StoreUpdate<T> {
|
|
167
|
+
type: 'STORE.UPDATE';
|
|
168
|
+
store: string;
|
|
169
|
+
value: T;
|
|
170
|
+
}
|
|
171
|
+
interface AeonStore<S extends AnySlices> {
|
|
172
|
+
readonly id: string;
|
|
173
|
+
getSnapshot(): StoreState<S>;
|
|
174
|
+
/** For `useSyncExternalStore`: calls back after every change. */
|
|
175
|
+
subscribe(listener: () => void): () => void;
|
|
176
|
+
send(event: StoreEvent<S>): void;
|
|
177
|
+
select<T>(selector: (state: StoreState<S>) => T, equals?: (a: T, b: T) => boolean): Selection<T>;
|
|
178
|
+
entity<N extends keyof S & string>(slice: N, id: string): EntityOf<S[N]> | undefined;
|
|
179
|
+
query<N extends keyof S & string>(slice: N, query: QueryOf<S[N]>): QueryResult<EntityOf<S[N]>>;
|
|
180
|
+
/** Resolves once saved data has loaded (at once without persistence). */
|
|
181
|
+
readonly ready: Promise<void>;
|
|
182
|
+
/** Saves now instead of after the quiet delay (app quit). */
|
|
183
|
+
flush(): Promise<void>;
|
|
184
|
+
stop(): void;
|
|
185
|
+
/**
|
|
186
|
+
* Invoke from a chart: `invoke: { id: 'store', src: store.actor, input: { select } }`.
|
|
187
|
+
* It sends `STORE.UPDATE` whenever the selection changes and forwards store
|
|
188
|
+
* events the chart sends it (`sendTo('store', …)`).
|
|
189
|
+
*/
|
|
190
|
+
readonly actor: ReturnType<typeof fromCallback<StoreEvent<S>, {
|
|
191
|
+
select: (state: StoreState<S>) => unknown;
|
|
192
|
+
equals?: (a: unknown, b: unknown) => boolean;
|
|
193
|
+
}>>;
|
|
194
|
+
}
|
|
195
|
+
declare function shallowEqual(a: unknown, b: unknown): boolean;
|
|
196
|
+
/** Field and slice names are checked word by word, so `seedPhrase` and `privateKey` are caught. */
|
|
197
|
+
declare function isStorableName(name: string): boolean;
|
|
198
|
+
/** The first field name, at any depth, that names a secret, key or spend decision. */
|
|
199
|
+
declare function unstorableField(value: unknown, depth?: number): string | null;
|
|
200
|
+
/** `data-aeon-*` projection of a query: its load state and how many entities it holds. */
|
|
201
|
+
declare function queryAttrs(result: QueryView): Record<string, string>;
|
|
202
|
+
/** `data-aeon-*` projection of one entity: pending while a write waits on the server, failed after a rollback. */
|
|
203
|
+
declare function entityAttrs<E>(slice: SliceState<E>, sliceName: string, id: string): Record<string, string>;
|
|
204
|
+
declare function memoryAdapter(initial?: Record<string, string>): StoreAdapter & {
|
|
205
|
+
readonly data: Map<string, string>;
|
|
206
|
+
};
|
|
207
|
+
declare function webStorageAdapter(storage?: Storage): StoreAdapter;
|
|
208
|
+
type AnyEntity = unknown;
|
|
209
|
+
type AnySliceState = SliceState<AnyEntity>;
|
|
210
|
+
interface Data {
|
|
211
|
+
status: StoreStatus;
|
|
212
|
+
slices: Record<string, AnySliceState>;
|
|
213
|
+
writes: Record<string, PendingWrite>;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* The store's chart: `hydrating` until saved data has loaded, then `ready`.
|
|
217
|
+
* Every event folds into one immutable snapshot (`context.data`) that keeps
|
|
218
|
+
* its identity, and that of every untouched slice and entity, when an event
|
|
219
|
+
* changes nothing.
|
|
220
|
+
*/
|
|
221
|
+
declare function createStoreMachine(defs: AnySlices): xstate.StateMachine<{
|
|
222
|
+
data: Data;
|
|
223
|
+
}, {
|
|
224
|
+
type: "ENTITY.REMOVE";
|
|
225
|
+
slice: string;
|
|
226
|
+
ids: readonly string[];
|
|
227
|
+
} | {
|
|
228
|
+
type: "WRITE.CONFIRM";
|
|
229
|
+
write: string;
|
|
230
|
+
} | {
|
|
231
|
+
type: "WRITE.ROLLBACK";
|
|
232
|
+
write: string;
|
|
233
|
+
error?: string;
|
|
234
|
+
} | {
|
|
235
|
+
type: "STORE.INVALIDATE";
|
|
236
|
+
} | {
|
|
237
|
+
type: "STORE.CLEAR";
|
|
238
|
+
} | {
|
|
239
|
+
type: "ENTITY.UPSERT";
|
|
240
|
+
slice: string;
|
|
241
|
+
entities: readonly any[];
|
|
242
|
+
} | {
|
|
243
|
+
type: "ENTITY.PATCH";
|
|
244
|
+
slice: string;
|
|
245
|
+
id: string;
|
|
246
|
+
patch: Partial<any>;
|
|
247
|
+
} | {
|
|
248
|
+
type: "QUERY.FETCH";
|
|
249
|
+
slice: string;
|
|
250
|
+
query: any;
|
|
251
|
+
} | {
|
|
252
|
+
type: "QUERY.REFRESH";
|
|
253
|
+
slice: string;
|
|
254
|
+
query: any;
|
|
255
|
+
} | {
|
|
256
|
+
type: "QUERY.INVALIDATE";
|
|
257
|
+
slice: string;
|
|
258
|
+
query?: any;
|
|
259
|
+
tag?: string;
|
|
260
|
+
} | {
|
|
261
|
+
type: "WRITE.BEGIN";
|
|
262
|
+
slice: string;
|
|
263
|
+
write: string;
|
|
264
|
+
upsert?: readonly any[] | undefined;
|
|
265
|
+
remove?: readonly string[];
|
|
266
|
+
} | {
|
|
267
|
+
type: "QUERY.UPDATE";
|
|
268
|
+
slice: string;
|
|
269
|
+
key: string;
|
|
270
|
+
view: CacheView<readonly AnyEntity[]>;
|
|
271
|
+
} | {
|
|
272
|
+
type: "STORE.HYDRATED";
|
|
273
|
+
slices: PersistedSlices | null;
|
|
274
|
+
}, {}, never, never, never, never, "ready" | "hydrating" | "boot", string, {
|
|
275
|
+
hydrate: boolean;
|
|
276
|
+
}, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
|
|
277
|
+
id: "aeonStore";
|
|
278
|
+
states: {
|
|
279
|
+
readonly boot: {};
|
|
280
|
+
readonly hydrating: {};
|
|
281
|
+
readonly ready: {};
|
|
282
|
+
};
|
|
283
|
+
}>;
|
|
284
|
+
declare function createAeonStore<S extends AnySlices>(options: StoreOptions<S>): AeonStore<S>;
|
|
285
|
+
|
|
286
|
+
export { type AeonStore, type AnySlices, type EntityOf, type PersistedSlices, type QueryOf, type QueryResult, type QueryView, type Selection, type SliceDefinition, type SliceOptions, type SliceState, type StoreAdapter, type StoreEvent, type StoreOptions, type StorePersistOptions, type StoreState, type StoreStatus, type StoreUpdate, createAeonStore, createStoreMachine, defineSlice, entityAttrs, isStorableName, memoryAdapter, queryAttrs, shallowEqual, unstorableField, webStorageAdapter };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createAeonStore,
|
|
3
|
+
createStoreMachine,
|
|
4
|
+
defineSlice,
|
|
5
|
+
entityAttrs,
|
|
6
|
+
isStorableName,
|
|
7
|
+
memoryAdapter,
|
|
8
|
+
queryAttrs,
|
|
9
|
+
shallowEqual,
|
|
10
|
+
unstorableField,
|
|
11
|
+
webStorageAdapter
|
|
12
|
+
} from "../chunk-H5XJGZHT.js";
|
|
13
|
+
import "../chunk-5BNAV4S2.js";
|
|
14
|
+
export {
|
|
15
|
+
createAeonStore,
|
|
16
|
+
createStoreMachine,
|
|
17
|
+
defineSlice,
|
|
18
|
+
entityAttrs,
|
|
19
|
+
isStorableName,
|
|
20
|
+
memoryAdapter,
|
|
21
|
+
queryAttrs,
|
|
22
|
+
shallowEqual,
|
|
23
|
+
unstorableField,
|
|
24
|
+
webStorageAdapter
|
|
25
|
+
};
|
|
@@ -15,3 +15,6 @@ export * from './machines/app-shell.js'
|
|
|
15
15
|
export * from './machines/app-nav.js'
|
|
16
16
|
export * from './machines/sticky-bar.js'
|
|
17
17
|
export * from './machines/content-region.js'
|
|
18
|
+
export * from './machines/clipboard.js'
|
|
19
|
+
export * from './machines/cache.js'
|
|
20
|
+
export * from './machines/store.js'
|