@adea-ai/ui 0.151.12 → 0.151.13
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/dist/NOTICE +3 -2
- package/dist/components/composites/about-dialog/about-dialog.d.ts.map +1 -1
- package/dist/components/composites/about-dialog/about-dialog.js +27 -48
- package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
- package/dist/components/composites/account-menu/account-menu.d.ts +2 -2
- package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +4 -22
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
- package/dist/components/composites/action-button/action-button.js +2 -4
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts +1 -10
- package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js +2 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +3 -2
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +1 -0
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +12 -50
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.js +7 -47
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/appearance-editor/index.d.ts +1 -0
- package/dist/components/composites/appearance-editor/index.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/index.js +2 -1
- package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js +8 -11
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts +5 -4
- package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js +5 -12
- package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
- package/dist/components/composites/chat/chat.d.ts +2 -2
- package/dist/components/composites/chat/chat.d.ts.map +1 -1
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint-model.js +1 -1
- package/dist/components/composites/checkpoint/checkpoint-model.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.js +3 -3
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation-model.d.ts +3 -12
- package/dist/components/composites/confirmation/confirmation-model.d.ts.map +1 -1
- package/dist/components/composites/confirmation/confirmation-model.js +5 -17
- package/dist/components/composites/confirmation/confirmation-model.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js +1 -1
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context-model.js +1 -1
- package/dist/components/composites/context/context-model.js.map +1 -1
- package/dist/components/composites/file-tree/build-file-tree.d.ts +5 -12
- package/dist/components/composites/file-tree/build-file-tree.d.ts.map +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js +26 -30
- package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.d.ts +2 -2
- package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -1
- package/dist/components/composites/file-tree/file-tree.js +4 -30
- package/dist/components/composites/file-tree/file-tree.js.map +1 -1
- package/dist/components/composites/file-tree/index.d.ts +2 -1
- package/dist/components/composites/file-tree/index.d.ts.map +1 -1
- package/dist/components/composites/file-tree/index.js +2 -1
- package/dist/components/composites/help-center/help-center.d.ts.map +1 -1
- package/dist/components/composites/help-center/help-center.js +9 -20
- package/dist/components/composites/help-center/help-center.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.d.ts.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js +7 -11
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/inline-citation/citation.d.ts.map +1 -1
- package/dist/components/composites/inline-citation/citation.js +2 -1
- package/dist/components/composites/inline-citation/citation.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.d.ts.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.js +2 -1
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.d.ts +4 -5
- package/dist/components/composites/message-scroller/message-scroller.d.ts.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js +19 -13
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/message-scroller/scroll-anchor.d.ts +4 -3
- package/dist/components/composites/message-scroller/scroll-anchor.d.ts.map +1 -1
- package/dist/components/composites/message-scroller/scroll-anchor.js +5 -3
- package/dist/components/composites/message-scroller/scroll-anchor.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.d.ts.map +1 -1
- package/dist/components/composites/model-selector/model-selector.js +1 -1
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/model-selector/models.js +1 -1
- package/dist/components/composites/model-selector/models.js.map +1 -1
- package/dist/components/composites/plan/plan.d.ts.map +1 -1
- package/dist/components/composites/plan/plan.js +2 -3
- package/dist/components/composites/plan/plan.js.map +1 -1
- package/dist/components/composites/queue/queue.d.ts +2 -2
- package/dist/components/composites/queue/queue.d.ts.map +1 -1
- package/dist/components/composites/queue/queue.js +57 -64
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/index.js +3 -1
- package/dist/components/composites/reasoning/reasoning.d.ts +2 -3
- package/dist/components/composites/reasoning/reasoning.d.ts.map +1 -1
- package/dist/components/composites/reasoning/reasoning.js +5 -20
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/settings/settings-layout.d.ts.map +1 -1
- package/dist/components/composites/settings/settings-layout.js +3 -2
- package/dist/components/composites/settings/settings-layout.js.map +1 -1
- package/dist/components/composites/settings/settings-navigation.d.ts.map +1 -1
- package/dist/components/composites/settings/settings-navigation.js +1 -1
- package/dist/components/composites/settings/settings-navigation.js.map +1 -1
- package/dist/components/composites/sources/index.js +2 -1
- package/dist/components/composites/sources/source.d.ts +3 -8
- package/dist/components/composites/sources/source.d.ts.map +1 -1
- package/dist/components/composites/sources/source.js +5 -30
- package/dist/components/composites/sources/source.js.map +1 -1
- package/dist/components/composites/sources/sources.js +2 -1
- package/dist/components/composites/sources/sources.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.d.ts.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js +3 -12
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/subagent/subagent.d.ts +3 -1
- package/dist/components/composites/subagent/subagent.d.ts.map +1 -1
- package/dist/components/composites/subagent/subagent.js +5 -17
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/suggestion/suggestion.d.ts.map +1 -1
- package/dist/components/composites/suggestion/suggestion.js +3 -2
- package/dist/components/composites/suggestion/suggestion.js.map +1 -1
- package/dist/components/composites/task/task.d.ts +2 -3
- package/dist/components/composites/task/task.d.ts.map +1 -1
- package/dist/components/composites/task/task.js +49 -109
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/terminal-model.d.ts +1 -2
- package/dist/components/composites/terminal/terminal-model.d.ts.map +1 -1
- package/dist/components/composites/terminal/terminal-model.js +7 -1
- package/dist/components/composites/terminal/terminal-model.js.map +1 -1
- package/dist/components/composites/terminal/terminal.d.ts.map +1 -1
- package/dist/components/composites/terminal/terminal.js +3 -12
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/test-results/test-results.d.ts.map +1 -1
- package/dist/components/composites/test-results/test-results.js +3 -12
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.d.ts +0 -1
- package/dist/components/composites/tool/tool.d.ts.map +1 -1
- package/dist/components/composites/tool/tool.js +47 -41
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree-navigation.d.ts +6 -2
- package/dist/components/composites/tree/tree-navigation.d.ts.map +1 -1
- package/dist/components/composites/tree/tree-navigation.js +18 -1
- package/dist/components/composites/tree/tree-navigation.js.map +1 -1
- package/dist/components/composites/tree/tree.d.ts +6 -0
- package/dist/components/composites/tree/tree.d.ts.map +1 -1
- package/dist/components/composites/tree/tree.js +30 -4
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.js +7 -8
- package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.d.ts +2 -26
- package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +47 -125
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/composites/update-dialog/update-model.d.ts +65 -0
- package/dist/components/composites/update-dialog/update-model.d.ts.map +1 -0
- package/dist/components/composites/update-dialog/update-model.js +75 -0
- package/dist/components/composites/update-dialog/update-model.js.map +1 -0
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.d.ts.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +3 -16
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.d.ts.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.js +10 -14
- package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
- package/dist/components/conversation/busy-send-button.d.ts +3 -5
- package/dist/components/conversation/busy-send-button.d.ts.map +1 -1
- package/dist/components/conversation/busy-send-button.js +4 -15
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/chat-composer.d.ts +1 -1
- package/dist/components/conversation/chat-composer.d.ts.map +1 -1
- package/dist/components/conversation/chat-composer.js +1 -1
- package/dist/components/conversation/chat-composer.js.map +1 -1
- package/dist/components/conversation/composer-core.d.ts +35 -0
- package/dist/components/conversation/composer-core.d.ts.map +1 -0
- package/dist/components/conversation/composer-core.js +68 -0
- package/dist/components/conversation/composer-core.js.map +1 -0
- package/dist/components/conversation/composer-menu.d.ts +1 -1
- package/dist/components/conversation/composer-menu.d.ts.map +1 -1
- package/dist/components/conversation/composer-menu.js.map +1 -1
- package/dist/components/conversation/conversation-pane.d.ts +4 -1
- package/dist/components/conversation/conversation-pane.d.ts.map +1 -1
- package/dist/components/conversation/conversation-pane.js +4 -0
- package/dist/components/conversation/conversation-pane.js.map +1 -1
- package/dist/components/conversation/conversation-surface.d.ts +9 -6
- package/dist/components/conversation/conversation-surface.d.ts.map +1 -1
- package/dist/components/conversation/conversation-surface.js +7 -5
- package/dist/components/conversation/conversation-surface.js.map +1 -1
- package/dist/components/conversation/ime-guard.d.ts +1 -0
- package/dist/components/conversation/ime-guard.d.ts.map +1 -1
- package/dist/components/conversation/ime-guard.js +5 -0
- package/dist/components/conversation/ime-guard.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +16 -50
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.d.ts +1 -3
- package/dist/components/conversation/message-composer.d.ts.map +1 -1
- package/dist/components/conversation/message-composer.js +15 -32
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/message-row.d.ts +10 -11
- package/dist/components/conversation/message-row.d.ts.map +1 -1
- package/dist/components/conversation/message-row.js +24 -49
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/paste-token-editor.d.ts.map +1 -1
- package/dist/components/conversation/paste-token-editor.js +7 -17
- package/dist/components/conversation/paste-token-editor.js.map +1 -1
- package/dist/components/conversation/paste-tokens.d.ts +10 -1
- package/dist/components/conversation/paste-tokens.d.ts.map +1 -1
- package/dist/components/conversation/paste-tokens.js +26 -2
- package/dist/components/conversation/paste-tokens.js.map +1 -1
- package/dist/components/conversation/scroll-follow-core.d.ts +30 -79
- package/dist/components/conversation/scroll-follow-core.d.ts.map +1 -1
- package/dist/components/conversation/scroll-follow-core.js +65 -54
- package/dist/components/conversation/scroll-follow-core.js.map +1 -1
- package/dist/components/conversation/scroll-follow.d.ts +5 -1
- package/dist/components/conversation/scroll-follow.d.ts.map +1 -1
- package/dist/components/conversation/scroll-follow.js +27 -91
- package/dist/components/conversation/scroll-follow.js.map +1 -1
- package/dist/components/conversation/thread-panel.d.ts +0 -2
- package/dist/components/conversation/thread-panel.d.ts.map +1 -1
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/conversation/transcript-composition.d.ts.map +1 -1
- package/dist/components/conversation/transcript-composition.js +4 -16
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/conversation/transcript-folding.d.ts +0 -1
- package/dist/components/conversation/transcript-folding.d.ts.map +1 -1
- package/dist/components/conversation/transcript-folding.js +1 -1
- package/dist/components/conversation/transcript-folding.js.map +1 -1
- package/dist/components/conversation/transcript-grouping.d.ts +8 -0
- package/dist/components/conversation/transcript-grouping.d.ts.map +1 -1
- package/dist/components/conversation/transcript-grouping.js +17 -3
- package/dist/components/conversation/transcript-grouping.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.d.ts.map +1 -1
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +2 -1
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js +1 -1
- package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js.map +1 -1
- package/dist/components/layout/floating-preview/index.js +2 -2
- package/dist/components/layout/floating-preview/model.d.ts +21 -55
- package/dist/components/layout/floating-preview/model.d.ts.map +1 -1
- package/dist/components/layout/floating-preview/model.js +33 -88
- package/dist/components/layout/floating-preview/model.js.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +11 -5
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/shell-top-bar/shell-top-bar.d.ts +2 -12
- package/dist/components/layout/shell-top-bar/shell-top-bar.d.ts.map +1 -1
- package/dist/components/layout/shell-top-bar/shell-top-bar.js +2 -1
- package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail-context.d.ts +0 -1
- package/dist/components/layout/side-rail/side-rail-context.d.ts.map +1 -1
- package/dist/components/layout/side-rail/side-rail-context.js +2 -8
- package/dist/components/layout/side-rail/side-rail-context.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.d.ts +0 -9
- package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js +148 -128
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/index.d.ts +2 -1
- package/dist/components/layout/sidebar-nav/index.d.ts.map +1 -1
- package/dist/components/layout/sidebar-nav/index.js +2 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-classes.d.ts +10 -0
- package/dist/components/layout/sidebar-nav/sidebar-nav-classes.d.ts.map +1 -0
- package/dist/components/layout/sidebar-nav/sidebar-nav-classes.js +18 -0
- package/dist/components/layout/sidebar-nav/sidebar-nav-classes.js.map +1 -0
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.d.ts +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.d.ts.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts +5 -9
- package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +5 -23
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/split-layout/geometry.d.ts.map +1 -1
- package/dist/components/layout/split-layout/geometry.js +2 -2
- package/dist/components/layout/split-layout/geometry.js.map +1 -1
- package/dist/components/layout/split-layout/index.js +2 -2
- package/dist/components/layout/split-layout/model.d.ts.map +1 -1
- package/dist/components/layout/split-layout/model.js +4 -4
- package/dist/components/layout/split-layout/model.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.d.ts +5 -0
- package/dist/components/layout/split-layout/resize-controller-core-retry.d.ts.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.js +17 -10
- package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.d.ts +5 -0
- package/dist/components/layout/split-layout/resize-controller-core.d.ts.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.js +17 -10
- package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
- package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +54 -47
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/split-layout/tree.d.ts +2 -0
- package/dist/components/layout/split-layout/tree.d.ts.map +1 -1
- package/dist/components/layout/split-layout/tree.js +5 -1
- package/dist/components/layout/split-layout/tree.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.d.ts +2 -9
- package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +4 -8
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/layout/top-bar/window-chrome.d.ts +13 -0
- package/dist/components/layout/top-bar/window-chrome.d.ts.map +1 -0
- package/dist/components/layout/top-bar/window-chrome.js +12 -0
- package/dist/components/layout/top-bar/window-chrome.js.map +1 -0
- package/dist/components/motion/presence.d.ts +1 -1
- package/dist/components/motion/presence.d.ts.map +1 -1
- package/dist/components/motion/presence.js +1 -4
- package/dist/components/motion/presence.js.map +1 -1
- package/dist/components/theme/appearance-panel.d.ts +3 -1
- package/dist/components/theme/appearance-panel.d.ts.map +1 -1
- package/dist/components/theme/appearance-panel.js +17 -9
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/index.d.ts +1 -1
- package/dist/components/theme/index.d.ts.map +1 -1
- package/dist/components/theme/index.js +5 -4
- package/dist/components/theme/lazy.d.ts +31 -5
- package/dist/components/theme/lazy.d.ts.map +1 -1
- package/dist/components/theme/lazy.js +39 -6
- package/dist/components/theme/lazy.js.map +1 -0
- package/dist/components/theme/script-projection.js +3 -2
- package/dist/components/theme/script-projection.js.map +1 -1
- package/dist/components/theme/script.js +3 -1
- package/dist/components/theme/theme-api.d.ts +14 -0
- package/dist/components/theme/theme-api.d.ts.map +1 -0
- package/dist/components/theme/theme-catalogue-source.d.ts.map +1 -1
- package/dist/components/theme/theme-catalogue-source.js +3 -2
- package/dist/components/theme/theme-catalogue-source.js.map +1 -1
- package/dist/components/theme/theme-document.d.ts +112 -10
- package/dist/components/theme/theme-document.d.ts.map +1 -1
- package/dist/components/theme/{theme-document-core.js → theme-document.js} +7 -7
- package/dist/components/theme/theme-document.js.map +1 -0
- package/dist/components/theme/theme-mode-toggle.d.ts +1 -1
- package/dist/components/theme/theme-mode-toggle.d.ts.map +1 -1
- package/dist/components/theme/theme-mode-toggle.js.map +1 -1
- package/dist/components/theme/theme-persistence.d.ts +6 -5
- package/dist/components/theme/theme-persistence.d.ts.map +1 -1
- package/dist/components/theme/theme-persistence.js +48 -80
- package/dist/components/theme/theme-persistence.js.map +1 -1
- package/dist/components/theme/theme-picker.d.ts +1 -1
- package/dist/components/theme/theme-picker.d.ts.map +1 -1
- package/dist/components/theme/theme-picker.js.map +1 -1
- package/dist/components/theme/theme-provider-value.d.ts +14 -15
- package/dist/components/theme/theme-provider-value.d.ts.map +1 -1
- package/dist/components/theme/theme-provider-value.js +26 -42
- package/dist/components/theme/theme-provider-value.js.map +1 -1
- package/dist/components/theme/theme-provider.d.ts +3 -9
- package/dist/components/theme/theme-provider.d.ts.map +1 -1
- package/dist/components/theme/theme-provider.js +8 -7
- package/dist/components/theme/theme-provider.js.map +1 -1
- package/dist/components/theme/theme-script.d.ts +12 -25
- package/dist/components/theme/theme-script.d.ts.map +1 -1
- package/dist/components/theme/theme-script.js +35 -38
- package/dist/components/theme/theme-script.js.map +1 -1
- package/dist/components/theme/theme-state.d.ts +241 -9
- package/dist/components/theme/theme-state.d.ts.map +1 -1
- package/dist/components/theme/{theme-state-core.js → theme-state.js} +10 -11
- package/dist/components/theme/theme-state.js.map +1 -0
- package/dist/components/theme/theme-toggle.d.ts +1 -1
- package/dist/components/theme/theme-toggle.d.ts.map +1 -1
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts +7 -5
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.js +40 -36
- package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/ui/attachment/attachment.d.ts.map +1 -1
- package/dist/components/ui/attachment/attachment.js +5 -16
- package/dist/components/ui/attachment/attachment.js.map +1 -1
- package/dist/components/ui/avatar/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar/avatar.js +5 -2
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/board/board.d.ts +0 -3
- package/dist/components/ui/board/board.d.ts.map +1 -1
- package/dist/components/ui/board/board.js +3 -6
- package/dist/components/ui/board/board.js.map +1 -1
- package/dist/components/ui/button-group/button-group.d.ts +1 -1
- package/dist/components/ui/button-group/button-group.d.ts.map +1 -1
- package/dist/components/ui/button-group/button-group.js.map +1 -1
- package/dist/components/ui/chart/chart.d.ts +0 -3
- package/dist/components/ui/chart/chart.d.ts.map +1 -1
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/code-block/code-block.d.ts +0 -2
- package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
- package/dist/components/ui/code-block/code-block.js +8 -24
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/command/command.d.ts.map +1 -1
- package/dist/components/ui/command/command.js +56 -48
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/context-menu/context-menu.d.ts +8 -30
- package/dist/components/ui/context-menu/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu/context-menu.js +13 -121
- package/dist/components/ui/context-menu/context-menu.js.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.d.ts +46 -0
- package/dist/components/ui/dialog/dialog-layer.d.ts.map +1 -0
- package/dist/components/ui/dialog/dialog-layer.js +169 -0
- package/dist/components/ui/dialog/dialog-layer.js.map +1 -0
- package/dist/components/ui/dialog/dialog.d.ts +20 -26
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.js +69 -187
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/drawer/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer/drawer.js +5 -8
- package/dist/components/ui/drawer/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +39 -53
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +135 -191
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.d.ts +46 -0
- package/dist/components/ui/dropdown-menu/menu-parts.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu/menu-parts.js +176 -0
- package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -0
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/field/number-field.js.map +1 -1
- package/dist/components/ui/hover-card/hover-card.d.ts +1 -2
- package/dist/components/ui/hover-card/hover-card.d.ts.map +1 -1
- package/dist/components/ui/hover-card/hover-card.js +4 -21
- package/dist/components/ui/hover-card/hover-card.js.map +1 -1
- package/dist/components/ui/menubar/menubar.d.ts +19 -33
- package/dist/components/ui/menubar/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar/menubar.js +21 -116
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/message/index.js +2 -1
- package/dist/components/ui/message/message.d.ts +0 -1
- package/dist/components/ui/message/message.d.ts.map +1 -1
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/message/parse-message-text.d.ts +20 -2
- package/dist/components/ui/message/parse-message-text.d.ts.map +1 -1
- package/dist/components/ui/message/parse-message-text.js +94 -28
- package/dist/components/ui/message/parse-message-text.js.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.d.ts +5 -12
- package/dist/components/ui/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.js +61 -77
- package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts +0 -1
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/popover/popover.d.ts +1 -3
- package/dist/components/ui/popover/popover.d.ts.map +1 -1
- package/dist/components/ui/popover/popover.js +1 -22
- package/dist/components/ui/popover/popover.js.map +1 -1
- package/dist/components/ui/resizable/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable/resizable.js +12 -6
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/sheet/sheet.d.ts +4 -6
- package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet/sheet.js +31 -32
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/text-link/index.d.ts.map +1 -1
- package/dist/components/ui/toggle-group/toggle-group.d.ts +1 -1
- package/dist/components/ui/toggle-group/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group/toggle-group.js +2 -7
- package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
- package/dist/components/ui/tooltip/tooltip.d.ts +17 -1
- package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip/tooltip.js +40 -20
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/components/ui/trace/index.d.ts +1 -1
- package/dist/components/ui/trace/index.d.ts.map +1 -1
- package/dist/components/ui/trace/index.js +1 -1
- package/dist/components/ui/trace/trace.d.ts +44 -3
- package/dist/components/ui/trace/trace.d.ts.map +1 -1
- package/dist/components/ui/trace/trace.js +87 -15
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/index.js +34 -28
- package/dist/lib/accent-presets.d.ts +7 -4
- package/dist/lib/accent-presets.d.ts.map +1 -1
- package/dist/lib/accent-presets.js +10 -5
- package/dist/lib/accent-presets.js.map +1 -1
- package/dist/lib/accent-roles.d.ts +20 -1
- package/dist/lib/accent-roles.d.ts.map +1 -1
- package/dist/lib/accent-roles.js +34 -26
- package/dist/lib/accent-roles.js.map +1 -1
- package/dist/lib/appearance-font-settings.d.ts.map +1 -1
- package/dist/lib/appearance-font-settings.js +4 -4
- package/dist/lib/appearance-font-settings.js.map +1 -1
- package/dist/lib/async-action.d.ts +42 -0
- package/dist/lib/async-action.d.ts.map +1 -0
- package/dist/lib/async-action.js +61 -0
- package/dist/lib/async-action.js.map +1 -0
- package/dist/lib/breakpoints.d.ts +8 -0
- package/dist/lib/breakpoints.d.ts.map +1 -0
- package/dist/lib/breakpoints.js +11 -0
- package/dist/lib/breakpoints.js.map +1 -0
- package/dist/lib/bytes.d.ts +8 -0
- package/dist/lib/bytes.d.ts.map +1 -0
- package/dist/lib/bytes.js +20 -0
- package/dist/lib/bytes.js.map +1 -0
- package/dist/lib/clipboard.d.ts +13 -0
- package/dist/lib/clipboard.d.ts.map +1 -1
- package/dist/lib/clipboard.js +32 -1
- package/dist/lib/clipboard.js.map +1 -1
- package/dist/lib/events.d.ts +14 -0
- package/dist/lib/events.d.ts.map +1 -0
- package/dist/lib/events.js +16 -0
- package/dist/lib/events.js.map +1 -0
- package/dist/lib/external-link.d.ts +19 -0
- package/dist/lib/external-link.d.ts.map +1 -0
- package/dist/lib/external-link.js +27 -0
- package/dist/lib/external-link.js.map +1 -0
- package/dist/lib/font-catalog.d.ts +3 -6
- package/dist/lib/font-catalog.d.ts.map +1 -1
- package/dist/lib/font-catalog.js +16 -12
- package/dist/lib/font-catalog.js.map +1 -1
- package/dist/lib/font-zoom.d.ts +4 -4
- package/dist/lib/font-zoom.d.ts.map +1 -1
- package/dist/lib/font-zoom.js +9 -12
- package/dist/lib/font-zoom.js.map +1 -1
- package/dist/lib/overlay.d.ts +29 -1
- package/dist/lib/overlay.d.ts.map +1 -1
- package/dist/lib/overlay.js +32 -16
- package/dist/lib/overlay.js.map +1 -1
- package/dist/lib/preference-store.d.ts +13 -3
- package/dist/lib/preference-store.d.ts.map +1 -1
- package/dist/lib/preference-store.js +27 -37
- package/dist/lib/preference-store.js.map +1 -1
- package/dist/lib/resize-separator.d.ts +15 -0
- package/dist/lib/resize-separator.d.ts.map +1 -0
- package/dist/lib/resize-separator.js +23 -0
- package/dist/lib/resize-separator.js.map +1 -0
- package/dist/lib/safe-script.d.ts +19 -1
- package/dist/lib/safe-script.d.ts.map +1 -1
- package/dist/lib/safe-script.js +19 -1
- package/dist/lib/safe-script.js.map +1 -1
- package/dist/lib/scroll-geometry.d.ts +33 -0
- package/dist/lib/scroll-geometry.d.ts.map +1 -0
- package/dist/lib/scroll-geometry.js +48 -0
- package/dist/lib/scroll-geometry.js.map +1 -0
- package/dist/lib/text.d.ts +13 -0
- package/dist/lib/text.d.ts.map +1 -0
- package/dist/lib/text.js +30 -0
- package/dist/lib/text.js.map +1 -0
- package/dist/lib/theme-accents.d.ts +2 -0
- package/dist/lib/theme-accents.d.ts.map +1 -1
- package/dist/lib/theme-accents.js +2 -2
- package/dist/lib/theme-accents.js.map +1 -1
- package/dist/lib/theme-catalogue.d.ts.map +1 -1
- package/dist/lib/theme-catalogue.js +3 -4
- package/dist/lib/theme-catalogue.js.map +1 -1
- package/dist/lib/theme-css.d.ts +14 -1
- package/dist/lib/theme-css.d.ts.map +1 -1
- package/dist/lib/theme-css.js +25 -48
- package/dist/lib/theme-css.js.map +1 -1
- package/dist/lib/theme-defaults.d.ts +33 -5
- package/dist/lib/theme-defaults.d.ts.map +1 -1
- package/dist/lib/theme-defaults.generated.d.ts +1 -1
- package/dist/lib/theme-defaults.generated.d.ts.map +1 -1
- package/dist/lib/theme-defaults.generated.js.map +1 -1
- package/dist/lib/theme-defaults.js +59 -3
- package/dist/lib/theme-defaults.js.map +1 -1
- package/dist/lib/theme-engine-light.d.ts +6 -0
- package/dist/lib/theme-engine-light.d.ts.map +1 -1
- package/dist/lib/theme-engine-light.js +71 -57
- package/dist/lib/theme-engine-light.js.map +1 -1
- package/dist/lib/theme-engine.d.ts +20 -22
- package/dist/lib/theme-engine.d.ts.map +1 -1
- package/dist/lib/theme-engine.js +19 -6
- package/dist/lib/theme-engine.js.map +1 -1
- package/dist/lib/theme-records.d.ts +3 -3
- package/dist/lib/theme-records.d.ts.map +1 -1
- package/dist/lib/theme-records.js +20 -59
- package/dist/lib/theme-records.js.map +1 -1
- package/dist/lib/theme-types.d.ts +174 -0
- package/dist/lib/theme-types.d.ts.map +1 -0
- package/dist/lib/theme-types.js +105 -0
- package/dist/lib/theme-types.js.map +1 -0
- package/dist/lib/themes.d.ts +4 -159
- package/dist/lib/themes.d.ts.map +1 -1
- package/dist/lib/themes.js +14 -33
- package/dist/lib/themes.js.map +1 -1
- package/dist/lib/tokens.d.ts.map +1 -1
- package/dist/lib/tokens.js +0 -1
- package/dist/lib/tokens.js.map +1 -1
- package/dist/lib/url.d.ts +9 -0
- package/dist/lib/url.d.ts.map +1 -0
- package/dist/lib/url.js +24 -0
- package/dist/lib/url.js.map +1 -0
- package/dist/lib/version-notes.d.ts.map +1 -1
- package/dist/lib/version-notes.js +3 -10
- package/dist/lib/version-notes.js.map +1 -1
- package/dist/r/about-dialog.json +2 -1
- package/dist/r/action-button.json +2 -1
- package/dist/r/alert-dialog.json +1 -0
- package/dist/r/checkpoint.json +0 -2
- package/dist/r/code-block.json +1 -0
- package/dist/r/confirmation.json +0 -1
- package/dist/r/context-menu.json +2 -2
- package/dist/r/context.json +0 -1
- package/dist/r/conversation.json +6 -5
- package/dist/r/dialog.json +5 -0
- package/dist/r/drawer.json +0 -1
- package/dist/r/dropdown-menu.json +5 -0
- package/dist/r/lib.json +50 -0
- package/dist/r/menubar.json +2 -2
- package/dist/r/model-selector.json +0 -1
- package/dist/r/reasoning.json +2 -1
- package/dist/r/registry.json +102 -43
- package/dist/r/shell-top-bar.json +1 -0
- package/dist/r/sidebar-nav.json +5 -0
- package/dist/r/sources.json +2 -2
- package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +22 -42
- package/dist/r/src/components/composites/account-menu/account-menu.tsx +9 -35
- package/dist/r/src/components/composites/action-button/action-button.tsx +5 -7
- package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +3 -11
- package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +8 -5
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +8 -6
- package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +14 -74
- package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +11 -77
- package/dist/r/src/components/composites/appearance-editor/index.ts +1 -0
- package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +9 -13
- package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +16 -18
- package/dist/r/src/components/composites/chat/chat.tsx +2 -2
- package/dist/r/src/components/composites/checkpoint/checkpoint-model.ts +3 -3
- package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +3 -3
- package/dist/r/src/components/composites/confirmation/confirmation-model.ts +9 -17
- package/dist/r/src/components/composites/confirmation/confirmation.tsx +2 -2
- package/dist/r/src/components/composites/context/context-model.ts +1 -1
- package/dist/r/src/components/composites/file-tree/build-file-tree.ts +21 -39
- package/dist/r/src/components/composites/file-tree/file-tree.tsx +5 -58
- package/dist/r/src/components/composites/file-tree/index.ts +1 -1
- package/dist/r/src/components/composites/help-center/help-center.tsx +8 -21
- package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +10 -11
- package/dist/r/src/components/composites/inline-citation/citation.ts +2 -1
- package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +3 -2
- package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +30 -30
- package/dist/r/src/components/composites/message-scroller/scroll-anchor.ts +5 -5
- package/dist/r/src/components/composites/model-selector/model-selector.tsx +3 -2
- package/dist/r/src/components/composites/model-selector/models.ts +1 -1
- package/dist/r/src/components/composites/plan/plan.tsx +1 -4
- package/dist/r/src/components/composites/queue/queue.tsx +8 -11
- package/dist/r/src/components/composites/reasoning/reasoning.tsx +5 -23
- package/dist/r/src/components/composites/settings/settings-layout.tsx +3 -2
- package/dist/r/src/components/composites/settings/settings-navigation.tsx +4 -1
- package/dist/r/src/components/composites/sources/source.ts +7 -53
- package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +3 -12
- package/dist/r/src/components/composites/subagent/subagent.tsx +7 -17
- package/dist/r/src/components/composites/suggestion/suggestion.tsx +4 -3
- package/dist/r/src/components/composites/task/task.tsx +21 -64
- package/dist/r/src/components/composites/terminal/terminal-model.ts +4 -4
- package/dist/r/src/components/composites/terminal/terminal.tsx +3 -12
- package/dist/r/src/components/composites/test-results/test-results.tsx +3 -12
- package/dist/r/src/components/composites/tool/tool.tsx +34 -40
- package/dist/r/src/components/composites/tree/tree-navigation.ts +22 -2
- package/dist/r/src/components/composites/tree/tree.tsx +47 -3
- package/dist/r/src/components/composites/update-dialog/channel-control.tsx +10 -14
- package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +66 -200
- package/dist/r/src/components/composites/update-dialog/update-model.ts +137 -0
- package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +1 -1
- package/dist/r/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +1 -18
- package/dist/r/src/components/composites/workspace-switcher/workspace-switcher.tsx +16 -19
- package/dist/r/src/components/conversation/busy-send-button.tsx +7 -34
- package/dist/r/src/components/conversation/chat-composer.tsx +1 -1
- package/dist/r/src/components/conversation/composer-core.ts +76 -0
- package/dist/r/src/components/conversation/composer-menu.tsx +1 -1
- package/dist/r/src/components/conversation/conversation-pane.tsx +4 -1
- package/dist/r/src/components/conversation/conversation-surface.tsx +23 -10
- package/dist/r/src/components/conversation/ime-guard.ts +6 -0
- package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +24 -65
- package/dist/r/src/components/conversation/message-composer.tsx +24 -54
- package/dist/r/src/components/conversation/message-row.tsx +33 -47
- package/dist/r/src/components/conversation/paste-token-editor.tsx +13 -16
- package/dist/r/src/components/conversation/paste-tokens.ts +36 -1
- package/dist/r/src/components/conversation/scroll-follow-core.ts +66 -137
- package/dist/r/src/components/conversation/scroll-follow.ts +26 -67
- package/dist/r/src/components/conversation/thread-panel.tsx +2 -4
- package/dist/r/src/components/conversation/transcript-composition.tsx +9 -33
- package/dist/r/src/components/conversation/transcript-folding.ts +2 -2
- package/dist/r/src/components/conversation/transcript-grouping.ts +18 -3
- package/dist/r/src/components/layout/contextual-sidebar/contextual-sidebar.tsx +4 -3
- package/dist/r/src/components/layout/contextual-sidebar/mobile-contextual-sidebar.tsx +1 -1
- package/dist/r/src/components/layout/floating-preview/model.ts +57 -195
- package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +6 -12
- package/dist/r/src/components/layout/shell-top-bar/shell-top-bar.tsx +32 -47
- package/dist/r/src/components/layout/side-rail/side-rail-context.ts +1 -11
- package/dist/r/src/components/layout/side-rail/side-rail.tsx +95 -107
- package/dist/r/src/components/layout/sidebar-nav/index.ts +1 -2
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav-classes.ts +15 -0
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx +1 -4
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +9 -27
- package/dist/r/src/components/layout/split-layout/geometry.ts +2 -9
- package/dist/r/src/components/layout/split-layout/model.ts +3 -6
- package/dist/r/src/components/layout/split-layout/resize-controller-core-retry.tsx +12 -6
- package/dist/r/src/components/layout/split-layout/resize-controller-core.tsx +12 -6
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +46 -61
- package/dist/r/src/components/layout/split-layout/tree.ts +5 -0
- package/dist/r/src/components/layout/top-bar/top-bar.tsx +16 -38
- package/dist/r/src/components/layout/top-bar/window-chrome.ts +23 -0
- package/dist/r/src/components/motion/presence.tsx +1 -3
- package/dist/r/src/components/theme/appearance-panel.tsx +28 -19
- package/dist/r/src/components/theme/index.ts +1 -22
- package/dist/r/src/components/theme/lazy.ts +36 -26
- package/dist/r/src/components/theme/theme-api.ts +30 -0
- package/dist/r/src/components/theme/theme-catalogue-source.ts +3 -2
- package/dist/r/src/components/theme/theme-document.ts +248 -23
- package/dist/r/src/components/theme/theme-mode-toggle.tsx +1 -1
- package/dist/r/src/components/theme/theme-persistence.ts +74 -130
- package/dist/r/src/components/theme/theme-picker.tsx +2 -2
- package/dist/r/src/components/theme/theme-provider-value.ts +53 -68
- package/dist/r/src/components/theme/theme-provider.tsx +5 -24
- package/dist/r/src/components/theme/theme-script.ts +48 -43
- package/dist/r/src/components/theme/theme-state.ts +350 -10
- package/dist/r/src/components/theme/theme-toggle.tsx +1 -1
- package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +43 -43
- package/dist/r/src/components/ui/attachment/attachment.tsx +4 -17
- package/dist/r/src/components/ui/avatar/avatar.tsx +3 -2
- package/dist/r/src/components/ui/board/board.tsx +4 -10
- package/dist/r/src/components/ui/button-group/button-group.tsx +1 -1
- package/dist/r/src/components/ui/chart/chart.tsx +0 -3
- package/dist/r/src/components/ui/code-block/code-block.tsx +7 -26
- package/dist/r/src/components/ui/command/command.tsx +43 -39
- package/dist/r/src/components/ui/context-menu/context-menu.tsx +18 -168
- package/dist/r/src/components/ui/dialog/dialog-layer.tsx +266 -0
- package/dist/r/src/components/ui/dialog/dialog.tsx +77 -271
- package/dist/r/src/components/ui/drawer/drawer.tsx +5 -23
- package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +204 -226
- package/dist/r/src/components/ui/dropdown-menu/menu-parts.tsx +220 -0
- package/dist/r/src/components/ui/field/field.tsx +1 -1
- package/dist/r/src/components/ui/field/number-field.tsx +1 -1
- package/dist/r/src/components/ui/hover-card/hover-card.tsx +4 -11
- package/dist/r/src/components/ui/menubar/menubar.tsx +36 -169
- package/dist/r/src/components/ui/message/message.tsx +0 -1
- package/dist/r/src/components/ui/message/parse-message-text.ts +80 -32
- package/dist/r/src/components/ui/modal-dialog/modal-dialog.tsx +9 -39
- package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +0 -1
- package/dist/r/src/components/ui/popover/popover.tsx +5 -11
- package/dist/r/src/components/ui/resizable/resizable.tsx +6 -16
- package/dist/r/src/components/ui/sheet/sheet.tsx +30 -42
- package/dist/r/src/components/ui/text-link/index.ts +0 -1
- package/dist/r/src/components/ui/toggle-group/toggle-group.tsx +3 -11
- package/dist/r/src/components/ui/tooltip/tooltip.tsx +47 -26
- package/dist/r/src/components/ui/trace/index.ts +7 -0
- package/dist/r/src/components/ui/trace/trace.tsx +100 -9
- package/dist/r/src/lib/accent-presets.ts +12 -8
- package/dist/r/src/lib/accent-roles.ts +43 -29
- package/dist/r/src/lib/appearance-font-settings.ts +5 -5
- package/dist/r/src/lib/async-action.ts +72 -0
- package/dist/r/src/lib/breakpoints.ts +7 -0
- package/dist/r/src/lib/bytes.ts +20 -0
- package/dist/r/src/lib/clipboard.ts +43 -0
- package/dist/r/src/lib/events.ts +17 -0
- package/dist/r/src/lib/external-link.ts +42 -0
- package/dist/r/src/lib/font-catalog.ts +4 -6
- package/dist/r/src/lib/font-zoom.ts +9 -14
- package/dist/r/src/lib/overlay.ts +55 -18
- package/dist/r/src/lib/preference-store.ts +36 -34
- package/dist/r/src/lib/resize-separator.ts +36 -0
- package/dist/r/src/lib/safe-script.ts +19 -1
- package/dist/r/src/lib/scroll-geometry.ts +69 -0
- package/dist/r/src/lib/text.ts +49 -0
- package/dist/r/src/lib/theme-accents.ts +1 -1
- package/dist/r/src/lib/theme-catalogue.ts +3 -4
- package/dist/r/src/lib/theme-css.ts +33 -54
- package/dist/r/src/lib/theme-defaults.generated.ts +1 -1
- package/dist/r/src/lib/theme-defaults.ts +55 -7
- package/dist/r/src/lib/theme-engine-light.ts +88 -72
- package/dist/r/src/lib/theme-engine.ts +29 -33
- package/dist/r/src/lib/theme-records.ts +33 -69
- package/dist/r/src/lib/theme-types.ts +199 -0
- package/dist/r/src/lib/themes.ts +33 -196
- package/dist/r/src/lib/tokens.ts +0 -1
- package/dist/r/src/lib/url.ts +25 -0
- package/dist/r/src/lib/version-notes.ts +3 -9
- package/dist/r/src/styles/theme-variants.css +32 -32
- package/dist/r/src/styles/theme.css +17 -13
- package/dist/r/subagent.json +0 -2
- package/dist/r/suggestion.json +0 -1
- package/dist/r/theming.json +5 -20
- package/dist/r/top-bar.json +5 -0
- package/dist/r/trace.json +1 -0
- package/dist/r/update-dialog.json +5 -0
- package/package.json +9 -7
- package/registry.json +102 -43
- package/src/components/composites/about-dialog/about-dialog.tsx +22 -42
- package/src/components/composites/account-menu/account-menu.tsx +9 -35
- package/src/components/composites/action-button/action-button.tsx +5 -7
- package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +3 -11
- package/src/components/composites/appearance-editor/appearance-choices.tsx +8 -5
- package/src/components/composites/appearance-editor/appearance-editor.tsx +8 -6
- package/src/components/composites/appearance-editor/appearance-rows.tsx +14 -74
- package/src/components/composites/appearance-editor/font-settings-group.tsx +11 -77
- package/src/components/composites/appearance-editor/index.ts +1 -0
- package/src/components/composites/catalog-browser/catalog-browser.tsx +9 -13
- package/src/components/composites/chain-of-thought/chain-of-thought.tsx +16 -18
- package/src/components/composites/chat/chat.tsx +2 -2
- package/src/components/composites/checkpoint/checkpoint-model.ts +3 -3
- package/src/components/composites/checkpoint/checkpoint.tsx +3 -3
- package/src/components/composites/confirmation/confirmation-model.ts +9 -17
- package/src/components/composites/confirmation/confirmation.tsx +2 -2
- package/src/components/composites/context/context-model.ts +1 -1
- package/src/components/composites/file-tree/build-file-tree.ts +21 -39
- package/src/components/composites/file-tree/file-tree.tsx +5 -58
- package/src/components/composites/file-tree/index.ts +1 -1
- package/src/components/composites/help-center/help-center.tsx +8 -21
- package/src/components/composites/icon-picker/icon-picker.tsx +10 -11
- package/src/components/composites/inline-citation/citation.ts +2 -1
- package/src/components/composites/inline-citation/inline-citation.tsx +3 -2
- package/src/components/composites/message-scroller/message-scroller.tsx +30 -30
- package/src/components/composites/message-scroller/scroll-anchor.ts +5 -5
- package/src/components/composites/model-selector/model-selector.tsx +3 -2
- package/src/components/composites/model-selector/models.ts +1 -1
- package/src/components/composites/plan/plan.tsx +1 -4
- package/src/components/composites/queue/queue.tsx +8 -11
- package/src/components/composites/reasoning/reasoning.tsx +5 -23
- package/src/components/composites/settings/settings-layout.tsx +3 -2
- package/src/components/composites/settings/settings-navigation.tsx +4 -1
- package/src/components/composites/sources/source.ts +7 -53
- package/src/components/composites/stack-trace/stack-trace.tsx +3 -12
- package/src/components/composites/subagent/subagent.tsx +7 -17
- package/src/components/composites/suggestion/suggestion.tsx +4 -3
- package/src/components/composites/task/task.tsx +21 -64
- package/src/components/composites/terminal/terminal-model.ts +4 -4
- package/src/components/composites/terminal/terminal.tsx +3 -12
- package/src/components/composites/test-results/test-results.tsx +3 -12
- package/src/components/composites/tool/tool.tsx +34 -40
- package/src/components/composites/tree/tree-navigation.ts +22 -2
- package/src/components/composites/tree/tree.tsx +47 -3
- package/src/components/composites/update-dialog/channel-control.tsx +10 -14
- package/src/components/composites/update-dialog/update-dialog.tsx +66 -200
- package/src/components/composites/update-dialog/update-model.ts +137 -0
- package/src/components/composites/workspace-mark/workspace-mark.tsx +1 -1
- package/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +1 -18
- package/src/components/composites/workspace-switcher/workspace-switcher.tsx +16 -19
- package/src/components/conversation/busy-send-button.tsx +7 -34
- package/src/components/conversation/chat-composer.tsx +1 -1
- package/src/components/conversation/composer-core.ts +76 -0
- package/src/components/conversation/composer-menu.tsx +1 -1
- package/src/components/conversation/conversation-pane.tsx +4 -1
- package/src/components/conversation/conversation-surface.tsx +23 -10
- package/src/components/conversation/ime-guard.ts +6 -0
- package/src/components/conversation/internal/chat-composer-shell.tsx +24 -65
- package/src/components/conversation/message-composer.tsx +24 -54
- package/src/components/conversation/message-row.tsx +33 -47
- package/src/components/conversation/paste-token-editor.tsx +13 -16
- package/src/components/conversation/paste-tokens.ts +36 -1
- package/src/components/conversation/scroll-follow-core.ts +66 -137
- package/src/components/conversation/scroll-follow.ts +26 -67
- package/src/components/conversation/thread-panel.tsx +2 -4
- package/src/components/conversation/transcript-composition.tsx +9 -33
- package/src/components/conversation/transcript-folding.ts +2 -2
- package/src/components/conversation/transcript-grouping.ts +18 -3
- package/src/components/layout/contextual-sidebar/contextual-sidebar.tsx +4 -3
- package/src/components/layout/contextual-sidebar/mobile-contextual-sidebar.tsx +1 -1
- package/src/components/layout/floating-preview/model.ts +57 -195
- package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +6 -12
- package/src/components/layout/shell-top-bar/shell-top-bar.tsx +32 -47
- package/src/components/layout/side-rail/side-rail-context.ts +1 -11
- package/src/components/layout/side-rail/side-rail.tsx +95 -107
- package/src/components/layout/sidebar-nav/index.ts +1 -2
- package/src/components/layout/sidebar-nav/sidebar-nav-classes.ts +15 -0
- package/src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx +1 -4
- package/src/components/layout/sidebar-nav/sidebar-nav.tsx +9 -27
- package/src/components/layout/split-layout/geometry.ts +2 -9
- package/src/components/layout/split-layout/model.ts +3 -6
- package/src/components/layout/split-layout/resize-controller-core-retry.tsx +12 -6
- package/src/components/layout/split-layout/resize-controller-core.tsx +12 -6
- package/src/components/layout/split-layout/split-layout.tsx +46 -61
- package/src/components/layout/split-layout/tree.ts +5 -0
- package/src/components/layout/top-bar/top-bar.tsx +16 -38
- package/src/components/layout/top-bar/window-chrome.ts +23 -0
- package/src/components/motion/presence.tsx +1 -3
- package/src/components/theme/appearance-panel.tsx +28 -19
- package/src/components/theme/index.ts +1 -22
- package/src/components/theme/lazy.ts +36 -26
- package/src/components/theme/theme-api.ts +30 -0
- package/src/components/theme/theme-catalogue-source.ts +3 -2
- package/src/components/theme/theme-document.ts +248 -23
- package/src/components/theme/theme-mode-toggle.tsx +1 -1
- package/src/components/theme/theme-persistence.ts +74 -130
- package/src/components/theme/theme-picker.tsx +2 -2
- package/src/components/theme/theme-provider-value.ts +53 -68
- package/src/components/theme/theme-provider.tsx +5 -24
- package/src/components/theme/theme-script.ts +48 -43
- package/src/components/theme/theme-state.ts +350 -10
- package/src/components/theme/theme-toggle.tsx +1 -1
- package/src/components/ui/alert-dialog/alert-dialog.tsx +43 -43
- package/src/components/ui/attachment/attachment.tsx +4 -17
- package/src/components/ui/avatar/avatar.tsx +3 -2
- package/src/components/ui/board/board.tsx +4 -10
- package/src/components/ui/button-group/button-group.tsx +1 -1
- package/src/components/ui/chart/chart.tsx +0 -3
- package/src/components/ui/code-block/code-block.tsx +7 -26
- package/src/components/ui/command/command.tsx +43 -39
- package/src/components/ui/context-menu/context-menu.tsx +18 -168
- package/src/components/ui/dialog/dialog-layer.tsx +266 -0
- package/src/components/ui/dialog/dialog.tsx +77 -271
- package/src/components/ui/drawer/drawer.tsx +5 -23
- package/src/components/ui/dropdown-menu/dropdown-menu.tsx +204 -226
- package/src/components/ui/dropdown-menu/menu-parts.tsx +220 -0
- package/src/components/ui/field/field.tsx +1 -1
- package/src/components/ui/field/number-field.tsx +1 -1
- package/src/components/ui/hover-card/hover-card.tsx +4 -11
- package/src/components/ui/menubar/menubar.tsx +36 -169
- package/src/components/ui/message/message.tsx +0 -1
- package/src/components/ui/message/parse-message-text.ts +80 -32
- package/src/components/ui/modal-dialog/modal-dialog.tsx +9 -39
- package/src/components/ui/navigation-menu/navigation-menu.tsx +0 -1
- package/src/components/ui/popover/popover.tsx +5 -11
- package/src/components/ui/resizable/resizable.tsx +6 -16
- package/src/components/ui/sheet/sheet.tsx +30 -42
- package/src/components/ui/text-link/index.ts +0 -1
- package/src/components/ui/toggle-group/toggle-group.tsx +3 -11
- package/src/components/ui/tooltip/tooltip.tsx +47 -26
- package/src/components/ui/trace/index.ts +7 -0
- package/src/components/ui/trace/trace.tsx +100 -9
- package/src/lib/accent-presets.ts +12 -8
- package/src/lib/accent-roles.ts +43 -29
- package/src/lib/appearance-font-settings.ts +5 -5
- package/src/lib/async-action.ts +72 -0
- package/src/lib/breakpoints.ts +7 -0
- package/src/lib/bytes.ts +20 -0
- package/src/lib/clipboard.ts +43 -0
- package/src/lib/events.ts +17 -0
- package/src/lib/external-link.ts +42 -0
- package/src/lib/font-catalog.ts +4 -6
- package/src/lib/font-zoom.ts +9 -14
- package/src/lib/overlay.ts +55 -18
- package/src/lib/preference-store.ts +36 -34
- package/src/lib/resize-separator.ts +36 -0
- package/src/lib/safe-script.ts +19 -1
- package/src/lib/scroll-geometry.ts +69 -0
- package/src/lib/text.ts +49 -0
- package/src/lib/theme-accents.ts +1 -1
- package/src/lib/theme-catalogue.ts +3 -4
- package/src/lib/theme-css.ts +33 -54
- package/src/lib/theme-defaults.generated.ts +1 -1
- package/src/lib/theme-defaults.ts +55 -7
- package/src/lib/theme-engine-light.ts +88 -72
- package/src/lib/theme-engine.ts +29 -33
- package/src/lib/theme-records.ts +33 -69
- package/src/lib/theme-types.ts +199 -0
- package/src/lib/themes.ts +33 -196
- package/src/lib/tokens.ts +0 -1
- package/src/lib/url.ts +25 -0
- package/src/lib/version-notes.ts +3 -9
- package/src/styles/theme-variants.css +32 -32
- package/src/styles/theme.css +17 -13
- package/dist/components/conversation/paste-preview.d.ts +0 -11
- package/dist/components/conversation/paste-preview.d.ts.map +0 -1
- package/dist/components/conversation/paste-preview.js +0 -27
- package/dist/components/conversation/paste-preview.js.map +0 -1
- package/dist/components/theme/theme-document-core.d.ts +0 -124
- package/dist/components/theme/theme-document-core.d.ts.map +0 -1
- package/dist/components/theme/theme-document-core.js.map +0 -1
- package/dist/components/theme/theme-provider-core.d.ts +0 -19
- package/dist/components/theme/theme-provider-core.d.ts.map +0 -1
- package/dist/components/theme/theme-provider-core.js +0 -27
- package/dist/components/theme/theme-provider-core.js.map +0 -1
- package/dist/components/theme/theme-provider-lazy.d.ts +0 -28
- package/dist/components/theme/theme-provider-lazy.d.ts.map +0 -1
- package/dist/components/theme/theme-provider-lazy.js +0 -35
- package/dist/components/theme/theme-provider-lazy.js.map +0 -1
- package/dist/components/theme/theme-state-core.d.ts +0 -254
- package/dist/components/theme/theme-state-core.d.ts.map +0 -1
- package/dist/components/theme/theme-state-core.js.map +0 -1
- package/dist/r/src/components/conversation/paste-preview.ts +0 -35
- package/dist/r/src/components/theme/theme-document-core.ts +0 -275
- package/dist/r/src/components/theme/theme-provider-core.tsx +0 -40
- package/dist/r/src/components/theme/theme-provider-lazy.tsx +0 -34
- package/dist/r/src/components/theme/theme-state-core.ts +0 -370
- package/src/components/conversation/paste-preview.ts +0 -35
- package/src/components/theme/theme-document-core.ts +0 -275
- package/src/components/theme/theme-provider-core.tsx +0 -40
- package/src/components/theme/theme-provider-lazy.tsx +0 -34
- package/src/components/theme/theme-state-core.ts +0 -370
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preference-store.js","names":[],"sources":["../../src/lib/preference-store.ts"],"sourcesContent":["/*\n * Copyright (c) 2026 Wing\n * Licensed under the MIT License.\n *\n * The recovery behaviour here (quarantine before any write, the envelope shape, the\n * legacy key that is read once and never deleted) is Adea's accepted port of Zeron's\n * preference store (https://github.com/zeronsh/zeron),\n * `packages/ui/src/components/appearance.ts`, moved here so the shared provider and\n * Adea run one implementation. See NOTICE.\n */\n\n/**\n * A versioned preference store: read one JSON document, refuse to guess about what\n * it cannot read, and keep what it refused.\n *\n * Nothing here knows what a preference *is*. A host hands the engine a key, a\n * version and (through `createVersionedPersistence`) a codec; the engine owns only\n * the part every versioned store gets wrong the same way, which is what happens to\n * a document that is not the one the code expects:\n *\n * - A document that is not JSON, or not a record, or carries a version the code\n * does not know (usually a newer build's) is **quarantined, byte for byte, into a\n * recovery key** before anything else happens. The store then answers as if\n * nothing were stored. Because the quarantine runs at read time, ahead of any\n * write, saving valid preferences later cannot destroy the unread original.\n * - A legacy key is consulted only when the main key is *absent*, never when it is\n * unreadable: a corrupt main document is not \"no preference\", and falling back to\n * an older, staler key would quietly restore a choice the user has since changed.\n * The legacy key is never deleted.\n * - Blocked storage (a sandboxed iframe, a privacy mode) throws on the mere access\n * of the `localStorage` global. Every path here treats that as \"nothing stored\".\n *\n * The reads and writes are against a {@link PreferenceStorage}, so the rules run in a\n * test without a DOM.\n */\n\n/** The part of `Storage` the engine uses. */\nexport type PreferenceStorage = Pick<Storage, 'getItem' | 'setItem'>\n\n/** Why an unread document was quarantined. */\nexport type RecoveryReason = 'corrupt_json' | 'unsupported_record'\n\n/**\n * What is written to the recovery key.\n *\n * The shape is a compatibility surface: Adea's stored envelopes already have it, and\n * a tool that inspects a user's storage reads it. Do not rename a field.\n */\nexport type RecoveryEnvelope = Readonly<{\n schemaVersion: 1\n reason: RecoveryReason\n /** An ISO-8601 timestamp of the capture; refreshed by each read of the same bytes. */\n capturedAt: string\n /** The document exactly as it was stored. */\n raw: string\n}>\n\n/**\n * The preference store, or nothing.\n *\n * The `typeof` guard
|
|
1
|
+
{"version":3,"file":"preference-store.js","names":[],"sources":["../../src/lib/preference-store.ts"],"sourcesContent":["/*\n * Copyright (c) 2026 Wing\n * Licensed under the MIT License.\n *\n * The recovery behaviour here (quarantine before any write, the envelope shape, the\n * legacy key that is read once and never deleted) is Adea's accepted port of Zeron's\n * preference store (https://github.com/zeronsh/zeron),\n * `packages/ui/src/components/appearance.ts`, moved here so the shared provider and\n * Adea run one implementation. See NOTICE.\n */\n\n/**\n * A versioned preference store: read one JSON document, refuse to guess about what\n * it cannot read, and keep what it refused.\n *\n * Nothing here knows what a preference *is*. A host hands the engine a key, a\n * version and (through `createVersionedPersistence`) a codec; the engine owns only\n * the part every versioned store gets wrong the same way, which is what happens to\n * a document that is not the one the code expects:\n *\n * - A document that is not JSON, or not a record, or carries a version the code\n * does not know (usually a newer build's) is **quarantined, byte for byte, into a\n * recovery key** before anything else happens. The store then answers as if\n * nothing were stored. Because the quarantine runs at read time, ahead of any\n * write, saving valid preferences later cannot destroy the unread original.\n * - A legacy key is consulted only when the main key is *absent*, never when it is\n * unreadable: a corrupt main document is not \"no preference\", and falling back to\n * an older, staler key would quietly restore a choice the user has since changed.\n * The legacy key is never deleted.\n * - Blocked storage (a sandboxed iframe, a privacy mode) throws on the mere access\n * of the `localStorage` global. Every path here treats that as \"nothing stored\".\n *\n * The reads and writes are against a {@link PreferenceStorage}, so the rules run in a\n * test without a DOM.\n */\n\n/** The part of `Storage` the engine uses. */\nexport type PreferenceStorage = Pick<Storage, 'getItem' | 'setItem'>\n\n/** Why an unread document was quarantined. */\nexport type RecoveryReason = 'corrupt_json' | 'unsupported_record'\n\n/**\n * What is written to the recovery key.\n *\n * The shape is a compatibility surface: Adea's stored envelopes already have it, and\n * a tool that inspects a user's storage reads it. Do not rename a field.\n */\nexport type RecoveryEnvelope = Readonly<{\n schemaVersion: 1\n reason: RecoveryReason\n /** An ISO-8601 timestamp of the capture; refreshed by each read of the same bytes. */\n capturedAt: string\n /** The document exactly as it was stored. */\n raw: string\n}>\n\n/**\n * Run `operation`, or answer `otherwise` if it throws.\n *\n * The one place a storage failure is swallowed. Storage throws for reasons outside\n * the code — blocked by a sandbox or a privacy mode, full, or holding bytes that are\n * not JSON — and a host's codec or persistence is code this system has not seen. In\n * every case the preference is lost for the session and the switch that read or saved\n * it still works.\n */\nexport function attemptStorage<T>(operation: () => T, otherwise: T): T {\n try {\n return operation()\n } catch {\n return otherwise\n }\n}\n\n/**\n * The preference store, or nothing.\n *\n * The `typeof` guard is inside the attempt for a reason: where storage is blocked,\n * merely *reading* the `localStorage` global throws, so a guard in front of it is\n * itself the crash.\n */\nexport function defaultPreferenceStorage(): PreferenceStorage | undefined {\n return attemptStorage(\n () => (typeof localStorage === 'undefined' ? undefined : localStorage),\n undefined\n )\n}\n\n/** The envelope for a document, stamped with `now`. */\nexport function recoveryEnvelope(\n raw: string,\n reason: RecoveryReason,\n now: Date = new Date()\n): RecoveryEnvelope {\n return { schemaVersion: 1, reason, capturedAt: now.toISOString(), raw }\n}\n\n/**\n * Quarantine an unread document into `recoveryKey`.\n *\n * Idempotent, so re-reading the same unread value refreshes the capture without\n * losing it. Best effort: a store that cannot be written leaves the caller to fail\n * closed on the defaults, which is the same outcome as not having a recovery key at\n * all. Never throws.\n *\n * Exported so a host quarantines its *other* documents (a theme library, say) with\n * the same envelope. Give each document its own `recoveryKey`: two documents that\n * share one overwrite each other's capture.\n */\nexport function quarantineRecord(\n storage: PreferenceStorage,\n recoveryKey: string,\n raw: string,\n reason: RecoveryReason,\n now: () => Date = () => new Date()\n): void {\n attemptStorage(\n () => storage.setItem(recoveryKey, JSON.stringify(recoveryEnvelope(raw, reason, now()))),\n undefined\n )\n}\n\n/** Where a versioned document lives and which version the code understands. */\nexport type VersionedRecordSchema = {\n /** The storage key of the document. */\n key: string\n /**\n * The only `version` the code reads. Absent, the document is unversioned and any\n * JSON object is accepted; present, a record whose top-level `version` is not\n * exactly this number is unsupported (newer or older), not \"close enough\".\n */\n version?: number\n /** Where an unread document is kept. Default `${key}.recovery`. */\n recoveryKey?: string\n}\n\n/**\n * What reading the document found.\n *\n * - `absent`: nothing is stored under the key.\n * - `record`: a JSON object this code can read; `raw` is the stored text.\n * - `quarantined`: something was stored and cannot be read. It has already been\n * written to the recovery key.\n * - `unavailable`: the store itself could not be read.\n */\nexport type VersionedRead =\n | { status: 'absent' }\n | { status: 'record'; record: Readonly<Record<string, unknown>>; raw: string }\n | { status: 'quarantined'; reason: RecoveryReason; raw: string }\n | { status: 'unavailable' }\n\n/** The default recovery key for a document key. */\nexport function recoveryKeyFor(schema: VersionedRecordSchema): string {\n return schema.recoveryKey ?? `${schema.key}.recovery`\n}\n\n/**\n * Read the document under `schema.key`.\n *\n * The classification is the contract: a value that is not valid JSON, or is JSON but\n * not an object (`null`, a number, a string), is `corrupt_json`; an object (or array)\n * that is not a record of the supported version is `unsupported_record`. Both are\n * quarantined before this returns. An empty string is a stored value, so it is\n * corrupt rather than absent.\n */\nexport function readVersionedRecord(\n storage: PreferenceStorage,\n schema: VersionedRecordSchema,\n now?: () => Date\n): VersionedRead {\n const raw = attemptStorage<string | null | undefined>(\n () => storage.getItem(schema.key),\n undefined\n )\n if (raw === undefined) return { status: 'unavailable' }\n if (raw === null) return { status: 'absent' }\n\n const recoveryKey = recoveryKeyFor(schema)\n const parsed = attemptStorage<unknown>(() => JSON.parse(raw), undefined)\n if (typeof parsed !== 'object' || parsed === null) {\n quarantineRecord(storage, recoveryKey, raw, 'corrupt_json', now)\n return { status: 'quarantined', reason: 'corrupt_json', raw }\n }\n if (\n Array.isArray(parsed) ||\n (schema.version !== undefined && (parsed as { version?: unknown }).version !== schema.version)\n ) {\n quarantineRecord(storage, recoveryKey, raw, 'unsupported_record', now)\n return { status: 'quarantined', reason: 'unsupported_record', raw }\n }\n return { status: 'record', record: parsed as Record<string, unknown>, raw }\n}\n\n/**\n * The legacy single-key value, or `null`.\n *\n * Only the caller decides whether to look: the engine's rule is to ask when the main\n * key is `absent`, not when it was quarantined.\n */\nexport function readLegacyValue(storage: PreferenceStorage, legacyKey: string): string | null {\n return attemptStorage(() => storage.getItem(legacyKey), null)\n}\n\n/**\n * Write `document` to `key` as JSON. Returns whether it was stored; a full or blocked\n * store returns `false` and never throws, because losing a preference must not break\n * the switch that tried to save it.\n */\nexport function writeVersionedRecord(\n storage: PreferenceStorage,\n key: string,\n document: unknown\n): boolean {\n return attemptStorage(() => {\n storage.setItem(key, JSON.stringify(document))\n return true\n }, false)\n}\n"],"mappings":";;;;;;;;;;AAkEA,SAAgB,eAAkB,WAAoB,WAAiB;CACrE,IAAI;EACF,OAAO,UAAU;CACnB,QAAQ;EACN,OAAO;CACT;AACF;;;;;;;;AASA,SAAgB,2BAA0D;CACxE,OAAO,qBACE,OAAO,iBAAiB,cAAc,KAAA,IAAY,cACzD,KAAA,CACF;AACF;;AAGA,SAAgB,iBACd,KACA,QACA,sBAAY,IAAI,KAAK,GACH;CAClB,OAAO;EAAE,eAAe;EAAG;EAAQ,YAAY,IAAI,YAAY;EAAG;CAAI;AACxE;;;;;;;;;;;;;AAcA,SAAgB,iBACd,SACA,aACA,KACA,QACA,4BAAwB,IAAI,KAAK,GAC3B;CACN,qBACQ,QAAQ,QAAQ,aAAa,KAAK,UAAU,iBAAiB,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,GACvF,KAAA,CACF;AACF;;AAgCA,SAAgB,eAAe,QAAuC;CACpE,OAAO,OAAO,eAAe,GAAG,OAAO,IAAI;AAC7C;;;;;;;;;;AAWA,SAAgB,oBACd,SACA,QACA,KACe;CACf,MAAM,MAAM,qBACJ,QAAQ,QAAQ,OAAO,GAAG,GAChC,KAAA,CACF;CACA,IAAI,QAAQ,KAAA,GAAW,OAAO,EAAE,QAAQ,cAAc;CACtD,IAAI,QAAQ,MAAM,OAAO,EAAE,QAAQ,SAAS;CAE5C,MAAM,cAAc,eAAe,MAAM;CACzC,MAAM,SAAS,qBAA8B,KAAK,MAAM,GAAG,GAAG,KAAA,CAAS;CACvE,IAAI,OAAO,WAAW,YAAY,WAAW,MAAM;EACjD,iBAAiB,SAAS,aAAa,KAAK,gBAAgB,GAAG;EAC/D,OAAO;GAAE,QAAQ;GAAe,QAAQ;GAAgB;EAAI;CAC9D;CACA,IACE,MAAM,QAAQ,MAAM,KACnB,OAAO,YAAY,KAAA,KAAc,OAAiC,YAAY,OAAO,SACtF;EACA,iBAAiB,SAAS,aAAa,KAAK,sBAAsB,GAAG;EACrE,OAAO;GAAE,QAAQ;GAAe,QAAQ;GAAsB;EAAI;CACpE;CACA,OAAO;EAAE,QAAQ;EAAU,QAAQ;EAAmC;CAAI;AAC5E;;;;;;;AAQA,SAAgB,gBAAgB,SAA4B,WAAkC;CAC5F,OAAO,qBAAqB,QAAQ,QAAQ,SAAS,GAAG,IAAI;AAC9D;;;;;;AAOA,SAAgB,qBACd,SACA,KACA,UACS;CACT,OAAO,qBAAqB;EAC1B,QAAQ,QAAQ,KAAK,KAAK,UAAU,QAAQ,CAAC;EAC7C,OAAO;CACT,GAAG,KAAK;AACV"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ResizeGripStyle = 'chip' | 'rung';
|
|
2
|
+
/**
|
|
3
|
+
* The look every resize separator shares: a hairline in `bg-border` with a
|
|
4
|
+
* 24px hit target on the drag axis (WCAG 2.5.8's minimum), widened by a
|
|
5
|
+
* pseudo-element so the visual line does not move. `data-orientation=vertical`
|
|
6
|
+
* marks a horizontal line. A `rung` grip pairs with the quieter hover.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resizeSeparatorClass(grip?: ResizeGripStyle): string;
|
|
9
|
+
/**
|
|
10
|
+
* The grip drawn on a separator: the bordered chip (which holds a `GripVertical`
|
|
11
|
+
* icon in `resizeGripIconClass`), or the quieter rung.
|
|
12
|
+
*/
|
|
13
|
+
export declare const resizeGripClass: Readonly<Record<ResizeGripStyle, string>>;
|
|
14
|
+
export declare const resizeGripIconClass = "size-2.5 text-muted-foreground";
|
|
15
|
+
//# sourceMappingURL=resize-separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize-separator.d.ts","sourceRoot":"","sources":["../../src/lib/resize-separator.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,CAAA;AAE7C;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,CAAC,EAAE,eAAe,UAQ1D;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAGrE,CAAA;AAED,eAAO,MAAM,mBAAmB,mCAAmC,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cn } from "./utils.js";
|
|
2
|
+
// src/lib/resize-separator.ts
|
|
3
|
+
/**
|
|
4
|
+
* The look every resize separator shares: a hairline in `bg-border` with a
|
|
5
|
+
* 24px hit target on the drag axis (WCAG 2.5.8's minimum), widened by a
|
|
6
|
+
* pseudo-element so the visual line does not move. `data-orientation=vertical`
|
|
7
|
+
* marks a horizontal line. A `rung` grip pairs with the quieter hover.
|
|
8
|
+
*/
|
|
9
|
+
function resizeSeparatorClass(grip) {
|
|
10
|
+
return cn("group/resize bg-border flex shrink-0 items-center justify-center", "after:absolute after:inset-y-0 after:-inset-x-3 after:w-6", "data-[orientation=vertical]:after:inset-x-0 data-[orientation=vertical]:after:-inset-y-3 data-[orientation=vertical]:after:h-6 data-[orientation=vertical]:after:w-full", "transition-colors ease-out focus-visible:bg-primary focus-visible:outline-none", grip === "rung" ? "hover:bg-primary/45" : "hover:bg-primary");
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The grip drawn on a separator: the bordered chip (which holds a `GripVertical`
|
|
14
|
+
* icon in `resizeGripIconClass`), or the quieter rung.
|
|
15
|
+
*/
|
|
16
|
+
var resizeGripClass = {
|
|
17
|
+
chip: "bg-border z-(--z-docked) flex h-4 w-2.5 items-center justify-center rounded-sm border border-border",
|
|
18
|
+
rung: "z-(--z-docked) h-11 w-1.5 flex-none rounded-full bg-border/55 group-data-[orientation=vertical]/resize:h-1.5 group-data-[orientation=vertical]/resize:w-11"
|
|
19
|
+
};
|
|
20
|
+
var resizeGripIconClass = "size-2.5 text-muted-foreground";
|
|
21
|
+
export { resizeGripClass, resizeGripIconClass, resizeSeparatorClass };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=resize-separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize-separator.js","names":[],"sources":["../../src/lib/resize-separator.ts"],"sourcesContent":["import { cn } from './utils'\n\n/*\n * Here rather than beside `Resizable` because the pixel ruler and the split layout\n * draw the same separator without corvu: a registry install of either must not pull\n * the `resizable` item, and with it `@corvu/resizable`, for a class string.\n */\n\nexport type ResizeGripStyle = 'chip' | 'rung'\n\n/**\n * The look every resize separator shares: a hairline in `bg-border` with a\n * 24px hit target on the drag axis (WCAG 2.5.8's minimum), widened by a\n * pseudo-element so the visual line does not move. `data-orientation=vertical`\n * marks a horizontal line. A `rung` grip pairs with the quieter hover.\n */\nexport function resizeSeparatorClass(grip?: ResizeGripStyle) {\n return cn(\n 'group/resize bg-border flex shrink-0 items-center justify-center',\n 'after:absolute after:inset-y-0 after:-inset-x-3 after:w-6',\n 'data-[orientation=vertical]:after:inset-x-0 data-[orientation=vertical]:after:-inset-y-3 data-[orientation=vertical]:after:h-6 data-[orientation=vertical]:after:w-full',\n 'transition-colors ease-out focus-visible:bg-primary focus-visible:outline-none',\n grip === 'rung' ? 'hover:bg-primary/45' : 'hover:bg-primary'\n )\n}\n\n/**\n * The grip drawn on a separator: the bordered chip (which holds a `GripVertical`\n * icon in `resizeGripIconClass`), or the quieter rung.\n */\nexport const resizeGripClass: Readonly<Record<ResizeGripStyle, string>> = {\n chip: 'bg-border z-(--z-docked) flex h-4 w-2.5 items-center justify-center rounded-sm border border-border',\n rung: 'z-(--z-docked) h-11 w-1.5 flex-none rounded-full bg-border/55 group-data-[orientation=vertical]/resize:h-1.5 group-data-[orientation=vertical]/resize:w-11',\n}\n\nexport const resizeGripIconClass = 'size-2.5 text-muted-foreground'\n"],"mappings":";;;;;;;;AAgBA,SAAgB,qBAAqB,MAAwB;CAC3D,OAAO,GACL,oEACA,6DACA,2KACA,kFACA,SAAS,SAAS,wBAAwB,kBAC5C;AACF;;;;;AAMA,IAAa,kBAA6D;CACxE,MAAM;CACN,MAAM;AACR;AAEA,IAAa,sBAAsB"}
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* A string as a JavaScript literal that is also safe inside an inline `<script>`.
|
|
3
|
+
* Public as `inlineScriptLiteral` from the theme entries.
|
|
4
|
+
*
|
|
5
|
+
* `JSON.stringify` produces a correct JavaScript literal, and it is **not** safe
|
|
6
|
+
* there: it leaves `<` and `>` alone, so a value containing `</script>` ends the tag
|
|
7
|
+
* early and everything after it is parsed as HTML. That is the classic inline-script
|
|
8
|
+
* injection, and it is a real one even when the value is a developer-supplied prop
|
|
9
|
+
* rather than user input — a prop can come from configuration, and a key that happens
|
|
10
|
+
* to contain a closing tag should not be able to execute.
|
|
11
|
+
*
|
|
12
|
+
* The escape is also correct JavaScript: `\u003c` is `<` to the parser, so the value
|
|
13
|
+
* is byte-identical at runtime and inert to the HTML tokenizer. `\u2028` and `\u2029`
|
|
14
|
+
* are escaped for the neighbouring reason — they are legal inside a JSON string and
|
|
15
|
+
* were, before ES2019, line terminators to a JavaScript parser.
|
|
16
|
+
*
|
|
17
|
+
* CodeQL flags the unescaped form as `js/bad-code-sanitization`, which is how this
|
|
18
|
+
* was found; `tests/theme-script.test.ts` pins it so it cannot come back.
|
|
19
|
+
*/
|
|
2
20
|
export declare function safeScriptStringLiteral(value: string): string;
|
|
3
21
|
//# sourceMappingURL=safe-script.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-script.d.ts","sourceRoot":"","sources":["../../src/lib/safe-script.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"safe-script.d.ts","sourceRoot":"","sources":["../../src/lib/safe-script.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAK7D"}
|
package/dist/lib/safe-script.js
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
// src/lib/safe-script.ts
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* A string as a JavaScript literal that is also safe inside an inline `<script>`.
|
|
4
|
+
* Public as `inlineScriptLiteral` from the theme entries.
|
|
5
|
+
*
|
|
6
|
+
* `JSON.stringify` produces a correct JavaScript literal, and it is **not** safe
|
|
7
|
+
* there: it leaves `<` and `>` alone, so a value containing `<\/script>` ends the tag
|
|
8
|
+
* early and everything after it is parsed as HTML. That is the classic inline-script
|
|
9
|
+
* injection, and it is a real one even when the value is a developer-supplied prop
|
|
10
|
+
* rather than user input — a prop can come from configuration, and a key that happens
|
|
11
|
+
* to contain a closing tag should not be able to execute.
|
|
12
|
+
*
|
|
13
|
+
* The escape is also correct JavaScript: `\u003c` is `<` to the parser, so the value
|
|
14
|
+
* is byte-identical at runtime and inert to the HTML tokenizer. `\u2028` and `\u2029`
|
|
15
|
+
* are escaped for the neighbouring reason — they are legal inside a JSON string and
|
|
16
|
+
* were, before ES2019, line terminators to a JavaScript parser.
|
|
17
|
+
*
|
|
18
|
+
* CodeQL flags the unescaped form as `js/bad-code-sanitization`, which is how this
|
|
19
|
+
* was found; `tests/theme-script.test.ts` pins it so it cannot come back.
|
|
20
|
+
*/
|
|
3
21
|
function safeScriptStringLiteral(value) {
|
|
4
22
|
return JSON.stringify(value).replace(/[<>\u2028\u2029]/g, (character) => `\\u${character.charCodeAt(0).toString(16).padStart(4, "0")}`);
|
|
5
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-script.js","names":[],"sources":["../../src/lib/safe-script.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"safe-script.js","names":[],"sources":["../../src/lib/safe-script.ts"],"sourcesContent":["/**\n * A string as a JavaScript literal that is also safe inside an inline `<script>`.\n * Public as `inlineScriptLiteral` from the theme entries.\n *\n * `JSON.stringify` produces a correct JavaScript literal, and it is **not** safe\n * there: it leaves `<` and `>` alone, so a value containing `</script>` ends the tag\n * early and everything after it is parsed as HTML. That is the classic inline-script\n * injection, and it is a real one even when the value is a developer-supplied prop\n * rather than user input — a prop can come from configuration, and a key that happens\n * to contain a closing tag should not be able to execute.\n *\n * The escape is also correct JavaScript: `\\u003c` is `<` to the parser, so the value\n * is byte-identical at runtime and inert to the HTML tokenizer. `\\u2028` and `\\u2029`\n * are escaped for the neighbouring reason — they are legal inside a JSON string and\n * were, before ES2019, line terminators to a JavaScript parser.\n *\n * CodeQL flags the unescaped form as `js/bad-code-sanitization`, which is how this\n * was found; `tests/theme-script.test.ts` pins it so it cannot come back.\n */\nexport function safeScriptStringLiteral(value: string): string {\n return JSON.stringify(value).replace(\n /[<>\\u2028\\u2029]/g,\n (character) => `\\\\u${character.charCodeAt(0).toString(16).padStart(4, '0')}`\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,wBAAwB,OAAuB;CAC7D,OAAO,KAAK,UAAU,KAAK,CAAC,CAAC,QAC3B,sBACC,cAAc,MAAM,UAAU,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG,GAC3E;AACF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a scroll container is relative to its end. Every view that follows
|
|
3
|
+
* appended content (a transcript, a reasoning trace, a terminal) asks the same
|
|
4
|
+
* question, so they share one answer here.
|
|
5
|
+
*
|
|
6
|
+
* "At the bottom" tolerance (px) for deciding whether an auto-pin still has
|
|
7
|
+
* work to do. A flat 0.5 is UNDER one device pixel at fractional device-pixel
|
|
8
|
+
* ratios (0.67 CSS px at 150% zoom, 0.8 at 125%): the scroller's resting
|
|
9
|
+
* maximum scrollTop lands on a fractional value, so `|scrollTop - target|`
|
|
10
|
+
* stays just above 0.5 even when the viewport is visually pinned to the
|
|
11
|
+
* bottom — making the pin re-fire on every ResizeObserver tick. Scaling the
|
|
12
|
+
* epsilon to the device pixel (never below 1 CSS px) absorbs that fractional
|
|
13
|
+
* resting error. `devicePixelRatio` is read defensively so a jsdom / SSR
|
|
14
|
+
* environment that leaves it undefined falls back to 1 (→ 1.5px).
|
|
15
|
+
*/
|
|
16
|
+
export declare function atBottomEpsilon(): number;
|
|
17
|
+
export interface ScrollGeom {
|
|
18
|
+
scrollTop: number;
|
|
19
|
+
scrollHeight: number;
|
|
20
|
+
clientHeight: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function bottomTarget(geom: ScrollGeom): number;
|
|
23
|
+
export declare function distanceFromBottom(geom: ScrollGeom): number;
|
|
24
|
+
export declare function computeAtBottom(geom: ScrollGeom, threshold: number): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Is the view at the very end, within one device pixel? This is the rule every
|
|
27
|
+
* bottom-following scroller shares (the transcript, a reasoning trace, a
|
|
28
|
+
* terminal): "following" means the reader is here, and an append should keep
|
|
29
|
+
* them here.
|
|
30
|
+
*/
|
|
31
|
+
export declare function isAtEnd(geom: ScrollGeom): boolean;
|
|
32
|
+
export declare function scrollGeometry(element: Element): ScrollGeom;
|
|
33
|
+
//# sourceMappingURL=scroll-geometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-geometry.d.ts","sourceRoot":"","sources":["../../src/lib/scroll-geometry.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAQxC;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAErD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAE3D;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAEjD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,CAM3D"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// src/lib/scroll-geometry.ts
|
|
2
|
+
/**
|
|
3
|
+
* Where a scroll container is relative to its end. Every view that follows
|
|
4
|
+
* appended content (a transcript, a reasoning trace, a terminal) asks the same
|
|
5
|
+
* question, so they share one answer here.
|
|
6
|
+
*
|
|
7
|
+
* "At the bottom" tolerance (px) for deciding whether an auto-pin still has
|
|
8
|
+
* work to do. A flat 0.5 is UNDER one device pixel at fractional device-pixel
|
|
9
|
+
* ratios (0.67 CSS px at 150% zoom, 0.8 at 125%): the scroller's resting
|
|
10
|
+
* maximum scrollTop lands on a fractional value, so `|scrollTop - target|`
|
|
11
|
+
* stays just above 0.5 even when the viewport is visually pinned to the
|
|
12
|
+
* bottom — making the pin re-fire on every ResizeObserver tick. Scaling the
|
|
13
|
+
* epsilon to the device pixel (never below 1 CSS px) absorbs that fractional
|
|
14
|
+
* resting error. `devicePixelRatio` is read defensively so a jsdom / SSR
|
|
15
|
+
* environment that leaves it undefined falls back to 1 (→ 1.5px).
|
|
16
|
+
*/
|
|
17
|
+
function atBottomEpsilon() {
|
|
18
|
+
const dpr = typeof window !== "undefined" && typeof window.devicePixelRatio === "number" && window.devicePixelRatio > 0 ? window.devicePixelRatio : 1;
|
|
19
|
+
return Math.max(1, 1 / dpr + .5);
|
|
20
|
+
}
|
|
21
|
+
function bottomTarget(geom) {
|
|
22
|
+
return Math.max(0, geom.scrollHeight - geom.clientHeight);
|
|
23
|
+
}
|
|
24
|
+
function distanceFromBottom(geom) {
|
|
25
|
+
return geom.scrollHeight - geom.scrollTop - geom.clientHeight;
|
|
26
|
+
}
|
|
27
|
+
function computeAtBottom(geom, threshold) {
|
|
28
|
+
return distanceFromBottom(geom) <= threshold;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Is the view at the very end, within one device pixel? This is the rule every
|
|
32
|
+
* bottom-following scroller shares (the transcript, a reasoning trace, a
|
|
33
|
+
* terminal): "following" means the reader is here, and an append should keep
|
|
34
|
+
* them here.
|
|
35
|
+
*/
|
|
36
|
+
function isAtEnd(geom) {
|
|
37
|
+
return distanceFromBottom(geom) <= atBottomEpsilon();
|
|
38
|
+
}
|
|
39
|
+
function scrollGeometry(element) {
|
|
40
|
+
return {
|
|
41
|
+
scrollTop: element.scrollTop,
|
|
42
|
+
scrollHeight: element.scrollHeight,
|
|
43
|
+
clientHeight: element.clientHeight
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export { atBottomEpsilon, bottomTarget, computeAtBottom, distanceFromBottom, isAtEnd, scrollGeometry };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=scroll-geometry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-geometry.js","names":[],"sources":["../../src/lib/scroll-geometry.ts"],"sourcesContent":["/*\n * `atBottomEpsilon` is translated from KiroCrew\n * website/src/hooks/virtualizer/FollowController.ts, pinned at\n * 283e136c0f902e965a535a7c9548c57c7504fed0.\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * This product includes software developed at Amazon.com, Inc.\n * (https://www.amazon.com/).\n * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0\n */\n/**\n * Where a scroll container is relative to its end. Every view that follows\n * appended content (a transcript, a reasoning trace, a terminal) asks the same\n * question, so they share one answer here.\n *\n * \"At the bottom\" tolerance (px) for deciding whether an auto-pin still has\n * work to do. A flat 0.5 is UNDER one device pixel at fractional device-pixel\n * ratios (0.67 CSS px at 150% zoom, 0.8 at 125%): the scroller's resting\n * maximum scrollTop lands on a fractional value, so `|scrollTop - target|`\n * stays just above 0.5 even when the viewport is visually pinned to the\n * bottom — making the pin re-fire on every ResizeObserver tick. Scaling the\n * epsilon to the device pixel (never below 1 CSS px) absorbs that fractional\n * resting error. `devicePixelRatio` is read defensively so a jsdom / SSR\n * environment that leaves it undefined falls back to 1 (→ 1.5px).\n */\nexport function atBottomEpsilon(): number {\n const dpr =\n typeof window !== 'undefined' &&\n typeof window.devicePixelRatio === 'number' &&\n window.devicePixelRatio > 0\n ? window.devicePixelRatio\n : 1\n return Math.max(1, 1 / dpr + 0.5)\n}\n\nexport interface ScrollGeom {\n scrollTop: number\n scrollHeight: number\n clientHeight: number\n}\n\nexport function bottomTarget(geom: ScrollGeom): number {\n return Math.max(0, geom.scrollHeight - geom.clientHeight)\n}\n\nexport function distanceFromBottom(geom: ScrollGeom): number {\n return geom.scrollHeight - geom.scrollTop - geom.clientHeight\n}\n\nexport function computeAtBottom(geom: ScrollGeom, threshold: number): boolean {\n return distanceFromBottom(geom) <= threshold\n}\n\n/**\n * Is the view at the very end, within one device pixel? This is the rule every\n * bottom-following scroller shares (the transcript, a reasoning trace, a\n * terminal): \"following\" means the reader is here, and an append should keep\n * them here.\n */\nexport function isAtEnd(geom: ScrollGeom): boolean {\n return distanceFromBottom(geom) <= atBottomEpsilon()\n}\n\nexport function scrollGeometry(element: Element): ScrollGeom {\n return {\n scrollTop: element.scrollTop,\n scrollHeight: element.scrollHeight,\n clientHeight: element.clientHeight,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,SAAgB,kBAA0B;CACxC,MAAM,MACJ,OAAO,WAAW,eAClB,OAAO,OAAO,qBAAqB,YACnC,OAAO,mBAAmB,IACtB,OAAO,mBACP;CACN,OAAO,KAAK,IAAI,GAAG,IAAI,MAAM,EAAG;AAClC;AAQA,SAAgB,aAAa,MAA0B;CACrD,OAAO,KAAK,IAAI,GAAG,KAAK,eAAe,KAAK,YAAY;AAC1D;AAEA,SAAgB,mBAAmB,MAA0B;CAC3D,OAAO,KAAK,eAAe,KAAK,YAAY,KAAK;AACnD;AAEA,SAAgB,gBAAgB,MAAkB,WAA4B;CAC5E,OAAO,mBAAmB,IAAI,KAAK;AACrC;;;;;;;AAQA,SAAgB,QAAQ,MAA2B;CACjD,OAAO,mBAAmB,IAAI,KAAK,gBAAgB;AACrD;AAEA,SAAgB,eAAe,SAA8B;CAC3D,OAAO;EACL,WAAW,QAAQ;EACnB,cAAc,QAAQ;EACtB,cAAc,QAAQ;CACxB;AACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The length a host-supplied reason, error or disabled explanation is clipped to
|
|
3
|
+
* when a composite shows it inline beside a control.
|
|
4
|
+
*/
|
|
5
|
+
export declare const REASON_TEXT_LIMIT = 240;
|
|
6
|
+
/**
|
|
7
|
+
* Untrusted text, made safe to lay out: hidden and direction-overriding
|
|
8
|
+
* characters removed, runs of whitespace (including newlines) collapsed to one
|
|
9
|
+
* space, and clipped to `limit` with an ellipsis. It is still only ever rendered
|
|
10
|
+
* as a text node — this is about length and spoofing, not escaping.
|
|
11
|
+
*/
|
|
12
|
+
export declare function boundText(value: string, limit: number): string;
|
|
13
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/lib/text.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAA;AA4BpC;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAU9D"}
|
package/dist/lib/text.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/lib/text.ts
|
|
2
|
+
/**
|
|
3
|
+
* The length a host-supplied reason, error or disabled explanation is clipped to
|
|
4
|
+
* when a composite shows it inline beside a control.
|
|
5
|
+
*/
|
|
6
|
+
var REASON_TEXT_LIMIT = 240;
|
|
7
|
+
function isHidden(code) {
|
|
8
|
+
return code <= 8 || code === 11 || code === 12 || code >= 14 && code <= 31 || code === 127 || code === 8206 || code === 8207 || code >= 8234 && code <= 8238 || code >= 8294 && code <= 8297;
|
|
9
|
+
}
|
|
10
|
+
function stripHidden(value) {
|
|
11
|
+
let out = "";
|
|
12
|
+
for (let index = 0; index < value.length; index += 1) if (!isHidden(value.charCodeAt(index))) out += value.charAt(index);
|
|
13
|
+
return out;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Untrusted text, made safe to lay out: hidden and direction-overriding
|
|
17
|
+
* characters removed, runs of whitespace (including newlines) collapsed to one
|
|
18
|
+
* space, and clipped to `limit` with an ellipsis. It is still only ever rendered
|
|
19
|
+
* as a text node — this is about length and spoofing, not escaping.
|
|
20
|
+
*/
|
|
21
|
+
function boundText(value, limit) {
|
|
22
|
+
const clean = stripHidden(value.length > limit * 4 ? value.slice(0, limit * 4) : value).replace(/\s+/g, " ").trim();
|
|
23
|
+
if (clean.length <= limit) return clean;
|
|
24
|
+
const clipped = clean.slice(0, limit);
|
|
25
|
+
const last = clipped.charCodeAt(clipped.length - 1);
|
|
26
|
+
return `${(last >= 55296 && last <= 56319 ? clipped.slice(0, -1) : clipped).trimEnd()}…`;
|
|
27
|
+
}
|
|
28
|
+
export { REASON_TEXT_LIMIT, boundText };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","names":[],"sources":["../../src/lib/text.ts"],"sourcesContent":["/**\n * The length a host-supplied reason, error or disabled explanation is clipped to\n * when a composite shows it inline beside a control.\n */\nexport const REASON_TEXT_LIMIT = 240\n\n// C0 controls other than tab and newline, DEL, and the bidirectional marks,\n// overrides and isolates: the last group is how a title can be made to read as a\n// different string than the one that is stored. Tested by code point rather than\n// by a regular expression so no control or invisible character appears in this file.\nfunction isHidden(code: number): boolean {\n return (\n code <= 0x08 ||\n code === 0x0b ||\n code === 0x0c ||\n (code >= 0x0e && code <= 0x1f) ||\n code === 0x7f ||\n code === 0x200e ||\n code === 0x200f ||\n (code >= 0x202a && code <= 0x202e) ||\n (code >= 0x2066 && code <= 0x2069)\n )\n}\n\nfunction stripHidden(value: string): string {\n let out = ''\n for (let index = 0; index < value.length; index += 1) {\n if (!isHidden(value.charCodeAt(index))) out += value.charAt(index)\n }\n return out\n}\n\n/**\n * Untrusted text, made safe to lay out: hidden and direction-overriding\n * characters removed, runs of whitespace (including newlines) collapsed to one\n * space, and clipped to `limit` with an ellipsis. It is still only ever rendered\n * as a text node — this is about length and spoofing, not escaping.\n */\nexport function boundText(value: string, limit: number): string {\n // Clip before the regex passes so a multi-megabyte value costs a slice, not a scan.\n const head = value.length > limit * 4 ? value.slice(0, limit * 4) : value\n const clean = stripHidden(head).replace(/\\s+/g, ' ').trim()\n if (clean.length <= limit) return clean\n const clipped = clean.slice(0, limit)\n // Never end on half of a surrogate pair: it renders as a replacement glyph.\n const last = clipped.charCodeAt(clipped.length - 1)\n const whole = last >= 0xd800 && last <= 0xdbff ? clipped.slice(0, -1) : clipped\n return `${whole.trimEnd()}…`\n}\n"],"mappings":";;;;;AAIA,IAAa,oBAAoB;AAMjC,SAAS,SAAS,MAAuB;CACvC,OACE,QAAQ,KACR,SAAS,MACT,SAAS,MACR,QAAQ,MAAQ,QAAQ,MACzB,SAAS,OACT,SAAS,QACT,SAAS,QACR,QAAQ,QAAU,QAAQ,QAC1B,QAAQ,QAAU,QAAQ;AAE/B;AAEA,SAAS,YAAY,OAAuB;CAC1C,IAAI,MAAM;CACV,KAAK,IAAI,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS,GACjD,IAAI,CAAC,SAAS,MAAM,WAAW,KAAK,CAAC,GAAG,OAAO,MAAM,OAAO,KAAK;CAEnE,OAAO;AACT;;;;;;;AAQA,SAAgB,UAAU,OAAe,OAAuB;CAG9D,MAAM,QAAQ,YADD,MAAM,SAAS,QAAQ,IAAI,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,KACtC,CAAC,CAAC,QAAQ,QAAQ,GAAG,CAAC,CAAC,KAAK;CAC1D,IAAI,MAAM,UAAU,OAAO,OAAO;CAClC,MAAM,UAAU,MAAM,MAAM,GAAG,KAAK;CAEpC,MAAM,OAAO,QAAQ,WAAW,QAAQ,SAAS,CAAC;CAElD,OAAO,IADO,QAAQ,SAAU,QAAQ,QAAS,QAAQ,MAAM,GAAG,EAAE,IAAI,QAAA,CACxD,QAAQ,EAAE;AAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-accents.d.ts","sourceRoot":"","sources":["../../src/lib/theme-accents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme-accents.d.ts","sourceRoot":"","sources":["../../src/lib/theme-accents.ts"],"names":[],"mappings":"AAyBA,oEAAoE;AACpE,eAAO,MAAM,mBAAmB,UAAU,CAAA;AAE1C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAQnD"}
|
|
@@ -33,8 +33,8 @@ var THEME_ACCENT_PREFIX = "ansi-";
|
|
|
33
33
|
* does not. Whether it resolves is `resolveAccentPreset`'s question.
|
|
34
34
|
*/
|
|
35
35
|
function isThemeAccentId(id) {
|
|
36
|
-
return id.startsWith(
|
|
36
|
+
return id.startsWith("ansi-") && ANSI_KEYS.includes(id.slice(5));
|
|
37
37
|
}
|
|
38
|
-
export { isThemeAccentId };
|
|
38
|
+
export { THEME_ACCENT_PREFIX, isThemeAccentId };
|
|
39
39
|
|
|
40
40
|
//# sourceMappingURL=theme-accents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-accents.js","names":[],"sources":["../../src/lib/theme-accents.ts"],"sourcesContent":["/**\n * The accents a theme carries, beside the six presets.\n *\n * `@adea-ai/themes` offers two kinds of accent. The presets (`ACCENTS`) are brand\n * colours, the same six on every theme. Since 0.9 the catalogue also offers the\n * accent-shaped colours a theme carries itself — its ANSI blue, magenta, cyan and\n * green, paired across a light and a dark theme and kept only when they clear the\n * catalogue's accent floors — through `themeAccentPresets`. Those read as part of\n * the palette rather than as visitors on it, which is why they are offered here.\n *\n * Their ids are role-shaped (`ansi-blue`), not value-shaped: a stored theme accent\n * survives switching themes and resolves to the *new* theme's blue. That has one\n * consequence a consumer must handle, and this module is where it is handled once:\n * a stored theme accent may name a slot the current pair does not offer, and then\n * it resolves to nothing and the theme's own primary applies — the same fallback a\n * stale preset id gets.\n *\n * This module holds only the id test, and reads only the schema entry: the\n * appearance editor uses it, and the editor's packed renderer gate forbids the\n * catalogue and normalization modules that *computing* a theme accent needs\n * (`themeAccentPresets` measures through `normalize.js`). Resolution lives in\n * `lib/themes.ts`, beside the catalogue it reads.\n */\nimport { ANSI_KEYS } from '@adea-ai/themes/schema'\n\n/** The prefix the catalogue gives every theme-derived accent id. */\
|
|
1
|
+
{"version":3,"file":"theme-accents.js","names":[],"sources":["../../src/lib/theme-accents.ts"],"sourcesContent":["/**\n * The accents a theme carries, beside the six presets.\n *\n * `@adea-ai/themes` offers two kinds of accent. The presets (`ACCENTS`) are brand\n * colours, the same six on every theme. Since 0.9 the catalogue also offers the\n * accent-shaped colours a theme carries itself — its ANSI blue, magenta, cyan and\n * green, paired across a light and a dark theme and kept only when they clear the\n * catalogue's accent floors — through `themeAccentPresets`. Those read as part of\n * the palette rather than as visitors on it, which is why they are offered here.\n *\n * Their ids are role-shaped (`ansi-blue`), not value-shaped: a stored theme accent\n * survives switching themes and resolves to the *new* theme's blue. That has one\n * consequence a consumer must handle, and this module is where it is handled once:\n * a stored theme accent may name a slot the current pair does not offer, and then\n * it resolves to nothing and the theme's own primary applies — the same fallback a\n * stale preset id gets.\n *\n * This module holds only the id test, and reads only the schema entry: the\n * appearance editor uses it, and the editor's packed renderer gate forbids the\n * catalogue and normalization modules that *computing* a theme accent needs\n * (`themeAccentPresets` measures through `normalize.js`). Resolution lives in\n * `lib/themes.ts`, beside the catalogue it reads.\n */\nimport { ANSI_KEYS } from '@adea-ai/themes/schema'\n\n/** The prefix the catalogue gives every theme-derived accent id. */\nexport const THEME_ACCENT_PREFIX = 'ansi-'\n\n/**\n * Whether an id names a theme-derived accent slot.\n *\n * Deliberately wider than what any one pair offers: the id is valid to *store*\n * whenever it names a slot, because the next theme may offer it even if this one\n * does not. Whether it resolves is `resolveAccentPreset`'s question.\n */\nexport function isThemeAccentId(id: string): boolean {\n // Computed per call rather than held in a module-level set: a top-level\n // `new Set(...)` is a statement a bundler cannot prove pure, and it would keep\n // this module in every bundle that touches the root entry.\n return (\n id.startsWith(THEME_ACCENT_PREFIX) &&\n (ANSI_KEYS as readonly string[]).includes(id.slice(THEME_ACCENT_PREFIX.length))\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAa,sBAAsB;;;;;;;;AASnC,SAAgB,gBAAgB,IAAqB;CAInD,OACE,GAAG,WAAA,OAA8B,KAChC,UAAgC,SAAS,GAAG,MAAM,CAA0B,CAAC;AAElF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-catalogue.d.ts","sourceRoot":"","sources":["../../src/lib/theme-catalogue.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme-catalogue.d.ts","sourceRoot":"","sources":["../../src/lib/theme-catalogue.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,eAAO,MAAM,oBAAoB,EAAE,WAOlC,CAAA"}
|
|
@@ -3,10 +3,9 @@ import { accentRolesForSelection, accentVariables, builtinThemes, isCatalogueVar
|
|
|
3
3
|
/**
|
|
4
4
|
* The full theme engine, backed by the whole catalogue.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* it, and the catalogue behind it, in a chunk of its own for the lazy provider.
|
|
6
|
+
* The eager `ThemeProvider` imports it statically; the lazy one reaches it only
|
|
7
|
+
* through `import()` (`components/theme/theme-catalogue-source`), so a bundler puts
|
|
8
|
+
* it, and the catalogue behind it, in a chunk of its own.
|
|
10
9
|
*/
|
|
11
10
|
var catalogueThemeEngine = {
|
|
12
11
|
builtinThemes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-catalogue.js","names":[],"sources":["../../src/lib/theme-catalogue.ts"],"sourcesContent":["/**\n * The full theme engine, backed by the whole catalogue.\n *\n *
|
|
1
|
+
{"version":3,"file":"theme-catalogue.js","names":[],"sources":["../../src/lib/theme-catalogue.ts"],"sourcesContent":["/**\n * The full theme engine, backed by the whole catalogue.\n *\n * The eager `ThemeProvider` imports it statically; the lazy one reaches it only\n * through `import()` (`components/theme/theme-catalogue-source`), so a bundler puts\n * it, and the catalogue behind it, in a chunk of its own.\n */\nimport {\n accentRolesForSelection,\n accentVariables,\n builtinThemes,\n isCatalogueVariant,\n themeAccentsFor,\n themeCssVariables,\n} from './themes'\nimport type { ThemeEngine } from './theme-engine'\n\nexport const catalogueThemeEngine: ThemeEngine = {\n builtinThemes,\n isCatalogueVariant,\n themeCssVariables,\n accentVariables,\n accentRolesForSelection,\n themeAccentsFor,\n}\n"],"mappings":";;;;;;;;;AAiBA,IAAa,uBAAoC;CAC/C;CACA;CACA;CACA;CACA;CACA;AACF"}
|
package/dist/lib/theme-css.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type EditorRolesMode, type ThemeCssVariableOptions, type ThemeEditorPalette, type ThemeVariant } from './theme-types';
|
|
2
2
|
/** What a variant's custom properties need that depends on the catalogue. */
|
|
3
3
|
export type ThemeCssHooks = {
|
|
4
4
|
/** The `--primary-subtle` expression of a variant. */
|
|
@@ -6,6 +6,19 @@ export type ThemeCssHooks = {
|
|
|
6
6
|
/** The editor ramp of a variant under a projection. */
|
|
7
7
|
editor(theme: ThemeVariant, mode: EditorRolesMode): ThemeEditorPalette;
|
|
8
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* `--surface-sunken`: one step below the canvas, a code well or an inset panel.
|
|
11
|
+
*
|
|
12
|
+
* Not a catalogue role, because the catalogue's ladder only goes *up* from the
|
|
13
|
+
* canvas. Darker in both appearances, which is the rule the ladder does not follow:
|
|
14
|
+
* a raised surface is lighter than the canvas on a dark theme and darker on a light
|
|
15
|
+
* one, but a sunken one is *always* darker, because the metaphor is a well cut into
|
|
16
|
+
* the page rather than a panel laid on it.
|
|
17
|
+
*
|
|
18
|
+
* Computed rather than a `color-mix()`, because mixing toward black also drains the
|
|
19
|
+
* hue, and these canvases are tinted.
|
|
20
|
+
*/
|
|
21
|
+
export declare function sunkenSurface(background: string): string;
|
|
9
22
|
/**
|
|
10
23
|
* The roles a variant sets, as CSS custom properties.
|
|
11
24
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-css.d.ts","sourceRoot":"","sources":["../../src/lib/theme-css.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"theme-css.d.ts","sourceRoot":"","sources":["../../src/lib/theme-css.ts"],"names":[],"mappings":"AAaA,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAA;AAEtB,6EAA6E;AAC7E,MAAM,MAAM,aAAa,GAAG;IAC1B,sDAAsD;IACtD,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,YAAY,CAAC,GAAG,MAAM,CAAA;IACrE,uDAAuD;IACvD,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,GAAG,kBAAkB,CAAA;CACvE,CAAA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,YAAY,EACnB,OAAO,GAAE,uBAA4B,GACpC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA2ExB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOhF;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAU5F"}
|
package/dist/lib/theme-css.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { THEME_EDITOR_PROPERTIES, THEME_TERMINAL_PROPERTIES, rolesAsProperties } from "./theme-types.js";
|
|
1
2
|
import { primaryHover } from "@adea-ai/themes";
|
|
2
|
-
import { oklchToHex, parseColor } from "@adea-ai/themes/oklch";
|
|
3
|
+
import { formatOklch, oklchToHex, parseColor, shiftLightness } from "@adea-ai/themes/oklch";
|
|
3
4
|
// src/lib/theme-css.ts
|
|
4
5
|
/**
|
|
5
6
|
* The mapping from a variant's roles to this system's custom properties, without the
|
|
@@ -9,10 +10,26 @@ import { oklchToHex, parseColor } from "@adea-ai/themes/oklch";
|
|
|
9
10
|
* the strength of its `--primary-subtle` tint and its floor-projected editor ramp.
|
|
10
11
|
* Those are the `hooks`, so this module imports no catalogue data and a host that
|
|
11
12
|
* never loads the catalogue can still paint a variant it already holds. `lib/themes`
|
|
12
|
-
* binds the hooks to the catalogue
|
|
13
|
-
*
|
|
13
|
+
* binds the hooks to the catalogue; `lib/theme-engine-light` binds them to the
|
|
14
|
+
* precomputed default pair.
|
|
14
15
|
*/
|
|
15
16
|
/**
|
|
17
|
+
* `--surface-sunken`: one step below the canvas, a code well or an inset panel.
|
|
18
|
+
*
|
|
19
|
+
* Not a catalogue role, because the catalogue's ladder only goes *up* from the
|
|
20
|
+
* canvas. Darker in both appearances, which is the rule the ladder does not follow:
|
|
21
|
+
* a raised surface is lighter than the canvas on a dark theme and darker on a light
|
|
22
|
+
* one, but a sunken one is *always* darker, because the metaphor is a well cut into
|
|
23
|
+
* the page rather than a panel laid on it.
|
|
24
|
+
*
|
|
25
|
+
* Computed rather than a `color-mix()`, because mixing toward black also drains the
|
|
26
|
+
* hue, and these canvases are tinted.
|
|
27
|
+
*/
|
|
28
|
+
function sunkenSurface(background) {
|
|
29
|
+
const canvas = parseColor(background);
|
|
30
|
+
return canvas ? formatOklch(shiftLightness(canvas, -.02)) : background;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
16
33
|
* The roles a variant sets, as CSS custom properties.
|
|
17
34
|
*
|
|
18
35
|
* The one place that knows the mapping from a theme's roles to this system's variable
|
|
@@ -26,7 +43,6 @@ import { oklchToHex, parseColor } from "@adea-ai/themes/oklch";
|
|
|
26
43
|
*/
|
|
27
44
|
function themeCssVariablesWith(hooks, theme, options = {}) {
|
|
28
45
|
const c = theme.colors;
|
|
29
|
-
const t = theme.terminal;
|
|
30
46
|
const e = hooks.editor(theme, options.editor ?? "syntax");
|
|
31
47
|
const derived = {
|
|
32
48
|
"--background": c.background,
|
|
@@ -70,27 +86,12 @@ function themeCssVariablesWith(hooks, theme, options = {}) {
|
|
|
70
86
|
"--sidebar-primary-foreground": c.primaryForeground,
|
|
71
87
|
"--sidebar-ring": c.ring,
|
|
72
88
|
"--sidebar-muted-foreground": c.sidebarMutedForeground,
|
|
73
|
-
"--surface-sunken": c.
|
|
89
|
+
"--surface-sunken": sunkenSurface(c.background),
|
|
74
90
|
"--surface-hover": c.accent,
|
|
75
91
|
"--surface-active": c.border,
|
|
76
92
|
"--chrome": c.background,
|
|
77
|
-
...
|
|
78
|
-
|
|
79
|
-
"--editor-string": e.string,
|
|
80
|
-
"--editor-number": e.number,
|
|
81
|
-
"--editor-comment": e.comment,
|
|
82
|
-
"--editor-function": e.function,
|
|
83
|
-
"--editor-variable": e.variable,
|
|
84
|
-
"--editor-type": e.type,
|
|
85
|
-
"--editor-tag": e.tag,
|
|
86
|
-
"--editor-attribute": e.attribute,
|
|
87
|
-
"--editor-operator": e.operator,
|
|
88
|
-
"--editor-heading": e.heading,
|
|
89
|
-
"--editor-link": e.link,
|
|
90
|
-
"--editor-diff-add": e.diffAdd,
|
|
91
|
-
"--editor-diff-delete": e.diffDelete,
|
|
92
|
-
"--editor-diff-hunk": e.diffHunk,
|
|
93
|
-
"--editor-search-match": e.searchMatch,
|
|
93
|
+
...rolesAsProperties(THEME_TERMINAL_PROPERTIES, theme.terminal),
|
|
94
|
+
...rolesAsProperties(THEME_EDITOR_PROPERTIES, e),
|
|
94
95
|
"--chart-1": theme.chart[0] ?? c.primary,
|
|
95
96
|
"--chart-2": theme.chart[1] ?? c.info,
|
|
96
97
|
"--chart-3": theme.chart[2] ?? c.success,
|
|
@@ -103,30 +104,6 @@ function themeCssVariablesWith(hooks, theme, options = {}) {
|
|
|
103
104
|
...theme.tokens
|
|
104
105
|
} : derived;
|
|
105
106
|
}
|
|
106
|
-
function terminalVariables(t) {
|
|
107
|
-
return {
|
|
108
|
-
"--terminal-background": t.background,
|
|
109
|
-
"--terminal-foreground": t.foreground,
|
|
110
|
-
"--terminal-cursor": t.cursor,
|
|
111
|
-
"--terminal-selection": t.selection,
|
|
112
|
-
"--terminal-ansi-black": t.black,
|
|
113
|
-
"--terminal-ansi-red": t.red,
|
|
114
|
-
"--terminal-ansi-green": t.green,
|
|
115
|
-
"--terminal-ansi-yellow": t.yellow,
|
|
116
|
-
"--terminal-ansi-blue": t.blue,
|
|
117
|
-
"--terminal-ansi-magenta": t.magenta,
|
|
118
|
-
"--terminal-ansi-cyan": t.cyan,
|
|
119
|
-
"--terminal-ansi-white": t.white,
|
|
120
|
-
"--terminal-ansi-bright-black": t.brightBlack,
|
|
121
|
-
"--terminal-ansi-bright-red": t.brightRed,
|
|
122
|
-
"--terminal-ansi-bright-green": t.brightGreen,
|
|
123
|
-
"--terminal-ansi-bright-yellow": t.brightYellow,
|
|
124
|
-
"--terminal-ansi-bright-blue": t.brightBlue,
|
|
125
|
-
"--terminal-ansi-bright-magenta": t.brightMagenta,
|
|
126
|
-
"--terminal-ansi-bright-cyan": t.brightCyan,
|
|
127
|
-
"--terminal-ansi-bright-white": t.brightWhite
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
107
|
/**
|
|
131
108
|
* The `--terminal-*` properties of a variant: the palette a terminal paints.
|
|
132
109
|
*
|
|
@@ -137,7 +114,7 @@ function terminalVariables(t) {
|
|
|
137
114
|
* neither the catalogue nor the rest of the variant's roles.
|
|
138
115
|
*/
|
|
139
116
|
function terminalCssVariables(theme) {
|
|
140
|
-
const properties =
|
|
117
|
+
const properties = rolesAsProperties(THEME_TERMINAL_PROPERTIES, theme.terminal);
|
|
141
118
|
if (!theme.tokens) return properties;
|
|
142
119
|
for (const [name, value] of Object.entries(theme.tokens)) if (name.startsWith("--terminal-")) properties[name] = value;
|
|
143
120
|
return properties;
|
|
@@ -161,6 +138,6 @@ function tokensAsHex(tokens) {
|
|
|
161
138
|
}
|
|
162
139
|
return converted;
|
|
163
140
|
}
|
|
164
|
-
export { terminalCssVariables, themeCssVariablesWith, tokensAsHex };
|
|
141
|
+
export { sunkenSurface, terminalCssVariables, themeCssVariablesWith, tokensAsHex };
|
|
165
142
|
|
|
166
143
|
//# sourceMappingURL=theme-css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-css.js","names":[],"sources":["../../src/lib/theme-css.ts"],"sourcesContent":["/**\n * The mapping from a variant's roles to this system's custom properties, without the\n * catalogue.\n *\n * `themeCssVariables` needs two things only the catalogue can measure for a theme:\n * the strength of its `--primary-subtle` tint and its floor-projected editor ramp.\n * Those are the `hooks`, so this module imports no catalogue data and a host that\n * never loads the catalogue can still paint a variant it already holds. `lib/themes`\n * binds the hooks to the catalogue and keeps exporting the same\n * `themeCssVariables`; `lib/theme-engine` binds them to the precomputed default pair.\n */\nimport { primaryHover } from '@adea-ai/themes'\nimport { oklchToHex, parseColor } from '@adea-ai/themes/oklch'\nimport type {\n EditorRolesMode,\n ThemeCssVariableOptions,\n ThemeEditorPalette,\n ThemeVariant,\n} from './themes'\n\n/** What a variant's custom properties need that depends on the catalogue. */\nexport type ThemeCssHooks = {\n /** The `--primary-subtle` expression of a variant. */\n primarySubtle(theme: Pick<ThemeVariant, 'id' | 'appearance'>): string\n /** The editor ramp of a variant under a projection. */\n editor(theme: ThemeVariant, mode: EditorRolesMode): ThemeEditorPalette\n}\n\n/**\n * The roles a variant sets, as CSS custom properties.\n *\n * The one place that knows the mapping from a theme's roles to this system's variable\n * names. A provider applies this; nothing else repeats it. The `--terminal-*` and\n * `--editor-*` ramps are presentations of the catalogue's ANSI and syntax data rather\n * than separate roles, which is why they are built here and not in the catalogue.\n *\n * `options.editor` picks the `--editor-*` projection ({@link EditorRolesMode}).\n * Absent it, the result is what it has always been; the generated `theme-variants.css`\n * and the design-system artifact are built without it.\n */\nexport function themeCssVariablesWith(\n hooks: ThemeCssHooks,\n theme: ThemeVariant,\n options: ThemeCssVariableOptions = {}\n): Record<string, string> {\n const c = theme.colors\n const t = theme.terminal\n const e = hooks.editor(theme, options.editor ?? 'syntax')\n const derived = {\n '--background': c.background,\n '--foreground': c.foreground,\n '--card': c.card,\n '--card-foreground': c.cardForeground,\n '--popover': c.popover,\n '--popover-foreground': c.popoverForeground,\n '--primary': c.primary,\n '--primary-foreground': c.primaryForeground,\n /*\n * The two tokens derived from the primary, and they are here rather than left to\n * `theme.css` because they must follow `--primary` — which this function writes\n * for *any* theme in the catalogue, not just the two defaults `theme.css` carries.\n *\n * `--primary-hover` is a resolved colour, not a `color-mix()`: a uniform hover\n * step cannot be expressed as a mix (see `primaryHover`). Left out, a theme switch\n * would keep the previous theme's hover on the new theme's primary.\n *\n * `--primary-subtle` is a mix over `--primary`, so it follows an accent on its\n * own, but its *strength* is per theme: `primarySubtleCss(record)` lowers the\n * appearance ceiling only as far as this theme needs for body text to clear 4.5:1\n * on the tint, over every surface, for every accent it offers. It has to be\n * written per theme for that reason — the appearance-wide value is not legible on\n * every palette.\n */\n '--primary-hover': primaryHover(c.primary, theme.appearance),\n '--primary-subtle': hooks.primarySubtle(theme),\n '--secondary': c.secondary,\n '--secondary-foreground': c.secondaryForeground,\n '--muted': c.muted,\n '--muted-foreground': c.mutedForeground,\n '--accent': c.accent,\n '--accent-foreground': c.accentForeground,\n '--destructive': c.destructive,\n '--destructive-foreground': c.destructiveForeground,\n '--destructive-subtle': c.destructiveSubtle,\n '--destructive-action': c.destructiveAction,\n '--destructive-action-foreground': c.destructiveActionForeground,\n '--success': c.success,\n '--success-foreground': c.successForeground,\n '--success-subtle': c.successSubtle,\n '--warning': c.warning,\n '--warning-foreground': c.warningForeground,\n '--warning-subtle': c.warningSubtle,\n '--info': c.info,\n '--info-foreground': c.infoForeground,\n '--info-subtle': c.infoSubtle,\n '--border': c.border,\n '--input': c.input,\n '--ring': c.ring,\n '--sidebar': c.sidebar,\n '--sidebar-foreground': c.sidebarForeground,\n '--sidebar-accent': c.sidebarAccent,\n '--sidebar-border': c.sidebarBorder,\n '--sidebar-primary': c.primary,\n '--sidebar-primary-foreground': c.primaryForeground,\n '--sidebar-ring': c.ring,\n '--sidebar-muted-foreground': c.sidebarMutedForeground,\n '--surface-sunken': c.muted,\n '--surface-hover': c.accent,\n '--surface-active': c.border,\n '--chrome': c.background,\n ...terminalVariables(t),\n '--editor-keyword': e.keyword,\n '--editor-string': e.string,\n '--editor-number': e.number,\n '--editor-comment': e.comment,\n '--editor-function': e.function,\n '--editor-variable': e.variable,\n '--editor-type': e.type,\n '--editor-tag': e.tag,\n '--editor-attribute': e.attribute,\n '--editor-operator': e.operator,\n '--editor-heading': e.heading,\n '--editor-link': e.link,\n '--editor-diff-add': e.diffAdd,\n '--editor-diff-delete': e.diffDelete,\n '--editor-diff-hunk': e.diffHunk,\n '--editor-search-match': e.searchMatch,\n '--chart-1': theme.chart[0] ?? c.primary,\n '--chart-2': theme.chart[1] ?? c.info,\n '--chart-3': theme.chart[2] ?? c.success,\n '--chart-4': theme.chart[3] ?? c.warning,\n '--chart-5': theme.chart[4] ?? c.destructive,\n '--chart-6': theme.chart[5] ?? c.mutedForeground,\n }\n return theme.tokens ? { ...derived, ...theme.tokens } : derived\n}\n\nfunction terminalVariables(t: ThemeVariant['terminal']): Record<string, string> {\n return {\n '--terminal-background': t.background,\n '--terminal-foreground': t.foreground,\n '--terminal-cursor': t.cursor,\n '--terminal-selection': t.selection,\n '--terminal-ansi-black': t.black,\n '--terminal-ansi-red': t.red,\n '--terminal-ansi-green': t.green,\n '--terminal-ansi-yellow': t.yellow,\n '--terminal-ansi-blue': t.blue,\n '--terminal-ansi-magenta': t.magenta,\n '--terminal-ansi-cyan': t.cyan,\n '--terminal-ansi-white': t.white,\n '--terminal-ansi-bright-black': t.brightBlack,\n '--terminal-ansi-bright-red': t.brightRed,\n '--terminal-ansi-bright-green': t.brightGreen,\n '--terminal-ansi-bright-yellow': t.brightYellow,\n '--terminal-ansi-bright-blue': t.brightBlue,\n '--terminal-ansi-bright-magenta': t.brightMagenta,\n '--terminal-ansi-bright-cyan': t.brightCyan,\n '--terminal-ansi-bright-white': t.brightWhite,\n }\n}\n\n/**\n * The `--terminal-*` properties of a variant: the palette a terminal paints.\n *\n * What a pinned terminal theme writes over the interface variant's own. The names\n * are the ones {@link themeCssVariablesWith} writes, and a custom variant's verbatim\n * `tokens` still win, so they can never drift from what the interface variant would\n * have written for the same palette. Built from the terminal palette alone: it needs\n * neither the catalogue nor the rest of the variant's roles.\n */\nexport function terminalCssVariables(theme: ThemeVariant): Record<string, string> {\n const properties = terminalVariables(theme.terminal)\n if (!theme.tokens) return properties\n for (const [name, value] of Object.entries(theme.tokens)) {\n if (name.startsWith('--terminal-')) properties[name] = value\n }\n return properties\n}\n\n/**\n * Token values with every `oklch()` colour written as `#rrggbb`.\n *\n * For a host whose stylesheet, tests or native shell speak hex: the catalogue's\n * roles are `oklch()` strings, and this is the one conversion, gamut-mapped by the\n * catalogue's own `oklchToHex`. A value that is already hex, carries alpha\n * (`rgba()`), or is not a plain colour (`color-mix()`, `var()`) is left byte for\n * byte, because converting would either lose the alpha or be a guess. Suitable as\n * `ThemeProvider`'s `transformTokens`.\n */\nexport function tokensAsHex(tokens: Readonly<Record<string, string>>): Record<string, string> {\n const converted: Record<string, string> = {}\n for (const [name, value] of Object.entries(tokens)) {\n const trimmed = value.trim()\n // `parseOklch` discards alpha, so a translucent oklch() stays as written.\n const opaque = trimmed.startsWith('oklch(') && !trimmed.includes('/')\n const parsed = opaque ? parseColor(trimmed) : undefined\n converted[name] = parsed ? oklchToHex(parsed) : value\n }\n return converted\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAgB,sBACd,OACA,OACA,UAAmC,CAAC,GACZ;CACxB,MAAM,IAAI,MAAM;CAChB,MAAM,IAAI,MAAM;CAChB,MAAM,IAAI,MAAM,OAAO,OAAO,QAAQ,UAAU,QAAQ;CACxD,MAAM,UAAU;EACd,gBAAgB,EAAE;EAClB,gBAAgB,EAAE;EAClB,UAAU,EAAE;EACZ,qBAAqB,EAAE;EACvB,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,aAAa,EAAE;EACf,wBAAwB,EAAE;EAiB1B,mBAAmB,aAAa,EAAE,SAAS,MAAM,UAAU;EAC3D,oBAAoB,MAAM,cAAc,KAAK;EAC7C,eAAe,EAAE;EACjB,0BAA0B,EAAE;EAC5B,WAAW,EAAE;EACb,sBAAsB,EAAE;EACxB,YAAY,EAAE;EACd,uBAAuB,EAAE;EACzB,iBAAiB,EAAE;EACnB,4BAA4B,EAAE;EAC9B,wBAAwB,EAAE;EAC1B,wBAAwB,EAAE;EAC1B,mCAAmC,EAAE;EACrC,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,oBAAoB,EAAE;EACtB,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,oBAAoB,EAAE;EACtB,UAAU,EAAE;EACZ,qBAAqB,EAAE;EACvB,iBAAiB,EAAE;EACnB,YAAY,EAAE;EACd,WAAW,EAAE;EACb,UAAU,EAAE;EACZ,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,oBAAoB,EAAE;EACtB,oBAAoB,EAAE;EACtB,qBAAqB,EAAE;EACvB,gCAAgC,EAAE;EAClC,kBAAkB,EAAE;EACpB,8BAA8B,EAAE;EAChC,oBAAoB,EAAE;EACtB,mBAAmB,EAAE;EACrB,oBAAoB,EAAE;EACtB,YAAY,EAAE;EACd,GAAG,kBAAkB,CAAC;EACtB,oBAAoB,EAAE;EACtB,mBAAmB,EAAE;EACrB,mBAAmB,EAAE;EACrB,oBAAoB,EAAE;EACtB,qBAAqB,EAAE;EACvB,qBAAqB,EAAE;EACvB,iBAAiB,EAAE;EACnB,gBAAgB,EAAE;EAClB,sBAAsB,EAAE;EACxB,qBAAqB,EAAE;EACvB,oBAAoB,EAAE;EACtB,iBAAiB,EAAE;EACnB,qBAAqB,EAAE;EACvB,wBAAwB,EAAE;EAC1B,sBAAsB,EAAE;EACxB,yBAAyB,EAAE;EAC3B,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;CACnC;CACA,OAAO,MAAM,SAAS;EAAE,GAAG;EAAS,GAAG,MAAM;CAAO,IAAI;AAC1D;AAEA,SAAS,kBAAkB,GAAqD;CAC9E,OAAO;EACL,yBAAyB,EAAE;EAC3B,yBAAyB,EAAE;EAC3B,qBAAqB,EAAE;EACvB,wBAAwB,EAAE;EAC1B,yBAAyB,EAAE;EAC3B,uBAAuB,EAAE;EACzB,yBAAyB,EAAE;EAC3B,0BAA0B,EAAE;EAC5B,wBAAwB,EAAE;EAC1B,2BAA2B,EAAE;EAC7B,wBAAwB,EAAE;EAC1B,yBAAyB,EAAE;EAC3B,gCAAgC,EAAE;EAClC,8BAA8B,EAAE;EAChC,gCAAgC,EAAE;EAClC,iCAAiC,EAAE;EACnC,+BAA+B,EAAE;EACjC,kCAAkC,EAAE;EACpC,+BAA+B,EAAE;EACjC,gCAAgC,EAAE;CACpC;AACF;;;;;;;;;;AAWA,SAAgB,qBAAqB,OAA6C;CAChF,MAAM,aAAa,kBAAkB,MAAM,QAAQ;CACnD,IAAI,CAAC,MAAM,QAAQ,OAAO;CAC1B,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,MAAM,GACrD,IAAI,KAAK,WAAW,aAAa,GAAG,WAAW,QAAQ;CAEzD,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,YAAY,QAAkE;CAC5F,MAAM,YAAoC,CAAC;CAC3C,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,GAAG;EAClD,MAAM,UAAU,MAAM,KAAK;EAG3B,MAAM,SADS,QAAQ,WAAW,QAAQ,KAAK,CAAC,QAAQ,SAAS,GAAG,IAC5C,WAAW,OAAO,IAAI,KAAA;EAC9C,UAAU,QAAQ,SAAS,WAAW,MAAM,IAAI;CAClD;CACA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"theme-css.js","names":[],"sources":["../../src/lib/theme-css.ts"],"sourcesContent":["/**\n * The mapping from a variant's roles to this system's custom properties, without the\n * catalogue.\n *\n * `themeCssVariables` needs two things only the catalogue can measure for a theme:\n * the strength of its `--primary-subtle` tint and its floor-projected editor ramp.\n * Those are the `hooks`, so this module imports no catalogue data and a host that\n * never loads the catalogue can still paint a variant it already holds. `lib/themes`\n * binds the hooks to the catalogue; `lib/theme-engine-light` binds them to the\n * precomputed default pair.\n */\nimport { primaryHover } from '@adea-ai/themes'\nimport { formatOklch, oklchToHex, parseColor, shiftLightness } from '@adea-ai/themes/oklch'\nimport {\n THEME_EDITOR_PROPERTIES,\n THEME_TERMINAL_PROPERTIES,\n rolesAsProperties,\n type EditorRolesMode,\n type ThemeCssVariableOptions,\n type ThemeEditorPalette,\n type ThemeVariant,\n} from './theme-types'\n\n/** What a variant's custom properties need that depends on the catalogue. */\nexport type ThemeCssHooks = {\n /** The `--primary-subtle` expression of a variant. */\n primarySubtle(theme: Pick<ThemeVariant, 'id' | 'appearance'>): string\n /** The editor ramp of a variant under a projection. */\n editor(theme: ThemeVariant, mode: EditorRolesMode): ThemeEditorPalette\n}\n\n/**\n * `--surface-sunken`: one step below the canvas, a code well or an inset panel.\n *\n * Not a catalogue role, because the catalogue's ladder only goes *up* from the\n * canvas. Darker in both appearances, which is the rule the ladder does not follow:\n * a raised surface is lighter than the canvas on a dark theme and darker on a light\n * one, but a sunken one is *always* darker, because the metaphor is a well cut into\n * the page rather than a panel laid on it.\n *\n * Computed rather than a `color-mix()`, because mixing toward black also drains the\n * hue, and these canvases are tinted.\n */\nexport function sunkenSurface(background: string): string {\n const canvas = parseColor(background)\n return canvas ? formatOklch(shiftLightness(canvas, -0.02)) : background\n}\n\n/**\n * The roles a variant sets, as CSS custom properties.\n *\n * The one place that knows the mapping from a theme's roles to this system's variable\n * names. A provider applies this; nothing else repeats it. The `--terminal-*` and\n * `--editor-*` ramps are presentations of the catalogue's ANSI and syntax data rather\n * than separate roles, which is why they are built here and not in the catalogue.\n *\n * `options.editor` picks the `--editor-*` projection ({@link EditorRolesMode}).\n * Absent it, the result is what it has always been; the generated `theme-variants.css`\n * and the design-system artifact are built without it.\n */\nexport function themeCssVariablesWith(\n hooks: ThemeCssHooks,\n theme: ThemeVariant,\n options: ThemeCssVariableOptions = {}\n): Record<string, string> {\n const c = theme.colors\n const e = hooks.editor(theme, options.editor ?? 'syntax')\n const derived = {\n '--background': c.background,\n '--foreground': c.foreground,\n '--card': c.card,\n '--card-foreground': c.cardForeground,\n '--popover': c.popover,\n '--popover-foreground': c.popoverForeground,\n '--primary': c.primary,\n '--primary-foreground': c.primaryForeground,\n /*\n * The two tokens derived from the primary, and they are here rather than left to\n * `theme.css` because they must follow `--primary` — which this function writes\n * for *any* theme in the catalogue, not just the two defaults `theme.css` carries.\n *\n * `--primary-hover` is a resolved colour, not a `color-mix()`: a uniform hover\n * step cannot be expressed as a mix (see `primaryHover`). Left out, a theme switch\n * would keep the previous theme's hover on the new theme's primary.\n *\n * `--primary-subtle` is a mix over `--primary`, so it follows an accent on its\n * own, but its *strength* is per theme: `primarySubtleCss(record)` lowers the\n * appearance ceiling only as far as this theme needs for body text to clear 4.5:1\n * on the tint, over every surface, for every accent it offers. It has to be\n * written per theme for that reason — the appearance-wide value is not legible on\n * every palette.\n */\n '--primary-hover': primaryHover(c.primary, theme.appearance),\n '--primary-subtle': hooks.primarySubtle(theme),\n '--secondary': c.secondary,\n '--secondary-foreground': c.secondaryForeground,\n '--muted': c.muted,\n '--muted-foreground': c.mutedForeground,\n '--accent': c.accent,\n '--accent-foreground': c.accentForeground,\n '--destructive': c.destructive,\n '--destructive-foreground': c.destructiveForeground,\n '--destructive-subtle': c.destructiveSubtle,\n '--destructive-action': c.destructiveAction,\n '--destructive-action-foreground': c.destructiveActionForeground,\n '--success': c.success,\n '--success-foreground': c.successForeground,\n '--success-subtle': c.successSubtle,\n '--warning': c.warning,\n '--warning-foreground': c.warningForeground,\n '--warning-subtle': c.warningSubtle,\n '--info': c.info,\n '--info-foreground': c.infoForeground,\n '--info-subtle': c.infoSubtle,\n '--border': c.border,\n '--input': c.input,\n '--ring': c.ring,\n '--sidebar': c.sidebar,\n '--sidebar-foreground': c.sidebarForeground,\n '--sidebar-accent': c.sidebarAccent,\n '--sidebar-border': c.sidebarBorder,\n '--sidebar-primary': c.primary,\n '--sidebar-primary-foreground': c.primaryForeground,\n '--sidebar-ring': c.ring,\n '--sidebar-muted-foreground': c.sidebarMutedForeground,\n '--surface-sunken': sunkenSurface(c.background),\n '--surface-hover': c.accent,\n '--surface-active': c.border,\n '--chrome': c.background,\n ...rolesAsProperties(THEME_TERMINAL_PROPERTIES, theme.terminal),\n ...rolesAsProperties(THEME_EDITOR_PROPERTIES, e),\n '--chart-1': theme.chart[0] ?? c.primary,\n '--chart-2': theme.chart[1] ?? c.info,\n '--chart-3': theme.chart[2] ?? c.success,\n '--chart-4': theme.chart[3] ?? c.warning,\n '--chart-5': theme.chart[4] ?? c.destructive,\n '--chart-6': theme.chart[5] ?? c.mutedForeground,\n }\n return theme.tokens ? { ...derived, ...theme.tokens } : derived\n}\n\n/**\n * The `--terminal-*` properties of a variant: the palette a terminal paints.\n *\n * What a pinned terminal theme writes over the interface variant's own. The names\n * are the ones {@link themeCssVariablesWith} writes, and a custom variant's verbatim\n * `tokens` still win, so they can never drift from what the interface variant would\n * have written for the same palette. Built from the terminal palette alone: it needs\n * neither the catalogue nor the rest of the variant's roles.\n */\nexport function terminalCssVariables(theme: ThemeVariant): Record<string, string> {\n const properties = rolesAsProperties(THEME_TERMINAL_PROPERTIES, theme.terminal)\n if (!theme.tokens) return properties\n for (const [name, value] of Object.entries(theme.tokens)) {\n if (name.startsWith('--terminal-')) properties[name] = value\n }\n return properties\n}\n\n/**\n * Token values with every `oklch()` colour written as `#rrggbb`.\n *\n * For a host whose stylesheet, tests or native shell speak hex: the catalogue's\n * roles are `oklch()` strings, and this is the one conversion, gamut-mapped by the\n * catalogue's own `oklchToHex`. A value that is already hex, carries alpha\n * (`rgba()`), or is not a plain colour (`color-mix()`, `var()`) is left byte for\n * byte, because converting would either lose the alpha or be a guess. Suitable as\n * `ThemeProvider`'s `transformTokens`.\n */\nexport function tokensAsHex(tokens: Readonly<Record<string, string>>): Record<string, string> {\n const converted: Record<string, string> = {}\n for (const [name, value] of Object.entries(tokens)) {\n const trimmed = value.trim()\n // `parseOklch` discards alpha, so a translucent oklch() stays as written.\n const opaque = trimmed.startsWith('oklch(') && !trimmed.includes('/')\n const parsed = opaque ? parseColor(trimmed) : undefined\n converted[name] = parsed ? oklchToHex(parsed) : value\n }\n return converted\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,cAAc,YAA4B;CACxD,MAAM,SAAS,WAAW,UAAU;CACpC,OAAO,SAAS,YAAY,eAAe,QAAQ,IAAK,CAAC,IAAI;AAC/D;;;;;;;;;;;;;AAcA,SAAgB,sBACd,OACA,OACA,UAAmC,CAAC,GACZ;CACxB,MAAM,IAAI,MAAM;CAChB,MAAM,IAAI,MAAM,OAAO,OAAO,QAAQ,UAAU,QAAQ;CACxD,MAAM,UAAU;EACd,gBAAgB,EAAE;EAClB,gBAAgB,EAAE;EAClB,UAAU,EAAE;EACZ,qBAAqB,EAAE;EACvB,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,aAAa,EAAE;EACf,wBAAwB,EAAE;EAiB1B,mBAAmB,aAAa,EAAE,SAAS,MAAM,UAAU;EAC3D,oBAAoB,MAAM,cAAc,KAAK;EAC7C,eAAe,EAAE;EACjB,0BAA0B,EAAE;EAC5B,WAAW,EAAE;EACb,sBAAsB,EAAE;EACxB,YAAY,EAAE;EACd,uBAAuB,EAAE;EACzB,iBAAiB,EAAE;EACnB,4BAA4B,EAAE;EAC9B,wBAAwB,EAAE;EAC1B,wBAAwB,EAAE;EAC1B,mCAAmC,EAAE;EACrC,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,oBAAoB,EAAE;EACtB,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,oBAAoB,EAAE;EACtB,UAAU,EAAE;EACZ,qBAAqB,EAAE;EACvB,iBAAiB,EAAE;EACnB,YAAY,EAAE;EACd,WAAW,EAAE;EACb,UAAU,EAAE;EACZ,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,oBAAoB,EAAE;EACtB,oBAAoB,EAAE;EACtB,qBAAqB,EAAE;EACvB,gCAAgC,EAAE;EAClC,kBAAkB,EAAE;EACpB,8BAA8B,EAAE;EAChC,oBAAoB,cAAc,EAAE,UAAU;EAC9C,mBAAmB,EAAE;EACrB,oBAAoB,EAAE;EACtB,YAAY,EAAE;EACd,GAAG,kBAAkB,2BAA2B,MAAM,QAAQ;EAC9D,GAAG,kBAAkB,yBAAyB,CAAC;EAC/C,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;CACnC;CACA,OAAO,MAAM,SAAS;EAAE,GAAG;EAAS,GAAG,MAAM;CAAO,IAAI;AAC1D;;;;;;;;;;AAWA,SAAgB,qBAAqB,OAA6C;CAChF,MAAM,aAAa,kBAAkB,2BAA2B,MAAM,QAAQ;CAC9E,IAAI,CAAC,MAAM,QAAQ,OAAO;CAC1B,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,MAAM,GACrD,IAAI,KAAK,WAAW,aAAa,GAAG,WAAW,QAAQ;CAEzD,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,YAAY,QAAkE;CAC5F,MAAM,YAAoC,CAAC;CAC3C,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,GAAG;EAClD,MAAM,UAAU,MAAM,KAAK;EAG3B,MAAM,SADS,QAAQ,WAAW,QAAQ,KAAK,CAAC,QAAQ,SAAS,GAAG,IAC5C,WAAW,OAAO,IAAI,KAAA;EAC9C,UAAU,QAAQ,SAAS,WAAW,MAAM,IAAI;CAClD;CACA,OAAO;AACT"}
|