@adea-ai/ui 0.151.11 → 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 +28 -53
- 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 +12 -0
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.d.ts.map +1 -1
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +53 -17
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/index.d.ts +1 -1
- package/dist/components/layout/contextual-sidebar/index.d.ts.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 +18 -22
- 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 +4 -2
- 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.d.ts +17 -0
- package/dist/components/theme/script-projection.d.ts.map +1 -0
- package/dist/components/theme/script-projection.js +17 -0
- package/dist/components/theme/script-projection.js.map +1 -0
- 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} +20 -10
- 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 +16 -16
- package/dist/components/theme/theme-provider-value.d.ts.map +1 -1
- package/dist/components/theme/theme-provider-value.js +33 -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 +24 -25
- package/dist/components/theme/theme-script.d.ts.map +1 -1
- package/dist/components/theme/theme-script.js +45 -39
- 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/theme/token-projection-options.d.ts +3 -0
- package/dist/components/theme/token-projection-options.d.ts.map +1 -0
- package/dist/components/theme/token-projection-options.js +9 -0
- package/dist/components/theme/token-projection-options.js.map +1 -0
- package/dist/components/theme/token-projection.d.ts +22 -0
- package/dist/components/theme/token-projection.d.ts.map +1 -0
- package/dist/components/theme/token-projection.js +1 -0
- 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/appearance-editor.json +1 -1
- 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 +51 -1
- 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 +120 -46
- 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 +30 -82
- 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 +80 -22
- package/dist/r/src/components/layout/contextual-sidebar/index.ts +1 -0
- 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 +47 -54
- 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/script-projection.ts +40 -0
- 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 +64 -69
- package/dist/r/src/components/theme/theme-provider.tsx +5 -24
- package/dist/r/src/components/theme/theme-script.ts +100 -47
- 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/theme/token-projection-options.ts +14 -0
- package/dist/r/src/components/theme/token-projection.ts +37 -0
- 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 +21 -21
- 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 +22 -8
- package/registry.json +120 -46
- 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 +30 -82
- 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 +80 -22
- package/src/components/layout/contextual-sidebar/index.ts +1 -0
- 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 +47 -54
- 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/script-projection.ts +40 -0
- 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 +64 -69
- package/src/components/theme/theme-provider.tsx +5 -24
- package/src/components/theme/theme-script.ts +100 -47
- package/src/components/theme/theme-state.ts +350 -10
- package/src/components/theme/theme-toggle.tsx +1 -1
- package/src/components/theme/token-projection-options.ts +14 -0
- package/src/components/theme/token-projection.ts +37 -0
- 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 -123
- 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 -248
- 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 -262
- 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 -364
- package/src/components/conversation/paste-preview.ts +0 -35
- package/src/components/theme/theme-document-core.ts +0 -262
- 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 -364
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { accentPresets } from "../../lib/accent-presets.js";
|
|
2
|
-
import { themesForAppearance } from "../../lib/themes.js";
|
|
1
|
+
import { accentPresets, isPresetAccentId } from "../../lib/accent-presets.js";
|
|
3
2
|
import { DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS } from "../../lib/appearance-font-settings.js";
|
|
3
|
+
import { THEME_DEFAULT_ID } from "../../lib/theme-defaults.js";
|
|
4
4
|
import { cn } from "../../lib/utils.js";
|
|
5
5
|
import { AccentSwatchGroups } from "../composites/appearance-editor/accent-swatch-groups.js";
|
|
6
6
|
import { AppearanceFontSettingsGroup } from "../composites/appearance-editor/font-settings-group.js";
|
|
@@ -9,17 +9,21 @@ import { ThemePicker } from "./theme-picker.js";
|
|
|
9
9
|
import { useTheme } from "./theme-context.js";
|
|
10
10
|
import { Heading } from "../ui/typography/typography.js";
|
|
11
11
|
import { createComponent, insert, mergeProps, spread, template } from "solid-js/web";
|
|
12
|
-
import { Show, splitProps } from "solid-js";
|
|
12
|
+
import { Show, onMount, splitProps } from "solid-js";
|
|
13
13
|
import { RadioGroup } from "@kobalte/core/radio-group";
|
|
14
14
|
// src/components/theme/appearance-panel.tsx
|
|
15
15
|
var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=appearance-panel><section class="flex flex-col gap-3"><header class="flex flex-col gap-0.5"><p class="max-w-prose text-sm text-muted-foreground">Follow the system, or pin one. The theme below is chosen per appearance, so switching at sunset does not make you choose again.</p></header></section><section class="flex flex-col gap-3"><header class="flex flex-col gap-0.5"><p class="max-w-prose text-sm text-muted-foreground">Colours the interactive roles — the primary button, the focus ring, a selected row — on top of the theme above — one of the presets, or a colour the theme carries itself. Every option is measured against the surface it lands on, so none of them can make a label unreadable.</p></header></section><section class="flex flex-col gap-3"><header class="flex flex-col gap-0.5"><p class="max-w-prose text-sm text-muted-foreground">Choose separate families and sizes for the interface, reading, and code. Font families come from the shared catalogue and are self-hosted.`);
|
|
16
16
|
var _tmpl$2 = /*#__PURE__*/ template(`<section class="flex flex-col gap-3"><header class="flex flex-col gap-0.5"><p class="max-w-prose text-sm text-muted-foreground">`);
|
|
17
|
-
var LIGHT_THEMES = themesForAppearance("light");
|
|
18
|
-
var DARK_THEMES = themesForAppearance("dark");
|
|
19
17
|
function AppearancePanel(props) {
|
|
20
18
|
const [local, rest] = splitProps(props, ["class"]);
|
|
21
|
-
const
|
|
22
|
-
const
|
|
19
|
+
const context = useTheme();
|
|
20
|
+
const { selection, setSelection, resolvedAppearance, themeAccents } = context;
|
|
21
|
+
onMount(() => void context.loadCatalogue?.());
|
|
22
|
+
const themesFor = (appearance) => context.themes.filter((variant) => variant.appearance === appearance);
|
|
23
|
+
const selectedAccent = () => {
|
|
24
|
+
const accent = selection().accent;
|
|
25
|
+
return accent === "theme" || isPresetAccentId(accent) || themeAccents().some((option) => option.id === accent) ? accent : THEME_DEFAULT_ID;
|
|
26
|
+
};
|
|
23
27
|
return (() => {
|
|
24
28
|
var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$5.nextSibling, _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild;
|
|
25
29
|
spread(_el$, mergeProps({ get ["class"]() {
|
|
@@ -66,7 +70,9 @@ function AppearancePanel(props) {
|
|
|
66
70
|
return createComponent(ThemeSection, {
|
|
67
71
|
title: "Light theme",
|
|
68
72
|
description: "Shown when the appearance resolves to light.",
|
|
69
|
-
themes
|
|
73
|
+
get themes() {
|
|
74
|
+
return themesFor("light");
|
|
75
|
+
},
|
|
70
76
|
get selectedId() {
|
|
71
77
|
return selection().lightThemeId;
|
|
72
78
|
},
|
|
@@ -82,7 +88,9 @@ function AppearancePanel(props) {
|
|
|
82
88
|
return createComponent(ThemeSection, {
|
|
83
89
|
title: "Dark theme",
|
|
84
90
|
description: "Shown when the appearance resolves to dark.",
|
|
85
|
-
themes
|
|
91
|
+
get themes() {
|
|
92
|
+
return themesFor("dark");
|
|
93
|
+
},
|
|
86
94
|
get selectedId() {
|
|
87
95
|
return selection().darkThemeId;
|
|
88
96
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appearance-panel.js","names":["ComponentProps","Show","splitProps","RadioGroup","Radio","accentPresets","themesForAppearance","DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS","cn","AccentSwatchGroups","AppearanceFontSettingsGroup","RadioGroupItem","ThemePicker","useTheme","Heading","AppearancePanelProps","LIGHT_THEMES","DARK_THEMES","AppearancePanel","props","local","rest","selection","setSelection","resolvedAppearance","themeAccents","selectedAccent","some","option","id","accent","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","_el$5","nextSibling","_el$6","_el$7","_el$8","_el$9","_el$0","_$spread","_$mergeProps","class","_$insert","_$createComponent","as","size","children","value","appearance","onChange","label","description","when","ThemeSection","title","themes","selectedId","lightThemeId","onThemeSelect","theme","darkThemeId","orientation","accentOptions","themeDefaultColor","settings","fonts","ReturnType","_el$1","_tmpl$2","_el$10","_el$11","_$mergeProps","_$createComponent","RadioGroup","Radio"],"sources":["../../../src/components/theme/appearance-panel.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { RadioGroup as Radio } from '@kobalte/core/radio-group'\nimport { accentPresets } from '#lib/tokens'\nimport { themesForAppearance } from '#lib/themes'\nimport { DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS } from '#lib/appearance-font-settings'\nimport { cn } from '#lib/utils'\nimport { AccentSwatchGroups } from '../composites/appearance-editor/accent-swatch-groups'\nimport { AppearanceFontSettingsGroup } from '../composites/appearance-editor/font-settings-group'\nimport { RadioGroup, RadioGroupItem } from '../ui/radio-group/radio-group'\nimport { ThemePicker } from './theme-picker'\nimport { useTheme } from './theme-provider'\nimport { Heading } from '../ui/typography'\n\n/**\n * AppearancePanel.\n *\n * The appearance page, as a component rather than as a screen each application\n * draws for itself. Two applications that both let a user choose a theme should\n * offer the *same* choices in the *same* arrangement — otherwise \"Adea\" and\n * \"Cortana\" are two products that happen to share a component library, which is\n * the opposite of what this system is for.\n *\n * Four axes, in the order a user thinks about them:\n *\n * 1. **Appearance** — light, dark, or follow the system.\n * 2. **Themes** — one for each appearance. Both are shown at once, because the\n * choice is per-appearance and hiding the other half makes it feel like one\n * setting that keeps changing.\n * 3. **Accent** — adea's presets, then the accents the selected theme pair\n * carries itself, layered on whichever theme is active.\n * 4. **Fonts** — separate families and sizes for interface, content and code.\n *\n * The panel reads and writes the provider's preference and keeps no state of its\n * own, so it cannot disagree with what is applied.\n */\nexport type AppearancePanelProps = ComponentProps<'div'>\n\nconst LIGHT_THEMES = themesForAppearance('light')\nconst DARK_THEMES = themesForAppearance('dark')\n\nexport function AppearancePanel(props: AppearancePanelProps) {\n const [local, rest] = splitProps(props, ['class'])\n const { selection, setSelection, resolvedAppearance, themeAccents } = useTheme()\n const selectedAccent = () =>\n accentPresets.some((option) => option.id === selection().accent) ||\n themeAccents().some((option) => option.id === selection().accent)\n ? selection().accent\n : 'theme'\n\n return (\n <div data-slot=\"appearance-panel\" class={cn('flex flex-col gap-8', local.class)} {...rest}>\n {/* --- 1. Appearance ------------------------------------------------- */}\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n Appearance\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">\n Follow the system, or pin one. The theme below is chosen per appearance, so switching at\n sunset does not make you choose again.\n </p>\n </header>\n <RadioGroup\n value={selection().appearance}\n onChange={(value) => setSelection({ appearance: value as 'light' | 'dark' | 'system' })}\n aria-label=\"Appearance\"\n >\n <RadioGroupItem value=\"light\" label=\"Light\" description=\"Always the light theme.\" />\n <RadioGroupItem value=\"dark\" label=\"Dark\" description=\"Always the dark theme.\" />\n <RadioGroupItem\n value=\"system\"\n label=\"Match the system\"\n description={`Currently resolving to ${resolvedAppearance()}.`}\n />\n </RadioGroup>\n </section>\n\n {/* --- 2. Themes ------------------------------------------------------ */}\n <Show when={resolvedAppearance() === 'light'}>\n <ThemeSection\n title=\"Light theme\"\n description=\"Shown when the appearance resolves to light.\"\n themes={LIGHT_THEMES}\n selectedId={selection().lightThemeId}\n onThemeSelect={(theme) => setSelection({ lightThemeId: theme.id })}\n />\n </Show>\n <Show when={resolvedAppearance() === 'dark'}>\n <ThemeSection\n title=\"Dark theme\"\n description=\"Shown when the appearance resolves to dark.\"\n themes={DARK_THEMES}\n selectedId={selection().darkThemeId}\n onThemeSelect={(theme) => setSelection({ darkThemeId: theme.id })}\n />\n </Show>\n\n {/* --- 3. Accent ------------------------------------------------------ */}\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n Accent\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">\n Colours the interactive roles — the primary button, the focus ring, a selected row — on\n top of the theme above — one of the presets, or a colour the theme carries itself. Every\n option is measured against the surface it lands on, so none of them can make a label\n unreadable.\n </p>\n </header>\n <Radio\n value={selectedAccent()}\n onChange={(accent) => setSelection({ accent })}\n orientation=\"horizontal\"\n aria-label=\"Accent\"\n class=\"flex flex-col items-start gap-3\"\n >\n <AccentSwatchGroups\n accentOptions={accentPresets}\n resolvedAppearance={resolvedAppearance()}\n themeDefaultColor=\"var(--primary)\"\n />\n </Radio>\n </section>\n\n {/* --- 4. Fonts ------------------------------------------------------- */}\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n Fonts\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">\n Choose separate families and sizes for the interface, reading, and code. Font families\n come from the shared catalogue and are self-hosted.\n </p>\n </header>\n <AppearanceFontSettingsGroup\n settings={selection().fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS}\n onChange={(fonts) => setSelection({ fonts })}\n />\n </section>\n </div>\n )\n}\n\nfunction ThemeSection(props: {\n title: string\n description: string\n themes: ReturnType<typeof themesForAppearance>\n selectedId: string\n onThemeSelect: (theme: ReturnType<typeof themesForAppearance>[number]) => void\n}) {\n return (\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n {props.title}\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">{props.description}</p>\n </header>\n <ThemePicker\n themes={props.themes}\n selectedId={props.selectedId}\n onThemeSelect={props.onThemeSelect}\n />\n </section>\n )\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"appearance-panel.js","names":["ComponentProps","Show","onMount","splitProps","RadioGroup","Radio","accentPresets","isPresetAccentId","DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS","THEME_DEFAULT_ID","ThemeAppearance","ThemeVariant","cn","AccentSwatchGroups","AppearanceFontSettingsGroup","RadioGroupItem","ThemePicker","useTheme","Heading","AppearancePanelProps","AppearancePanel","props","local","rest","context","selection","setSelection","resolvedAppearance","themeAccents","loadCatalogue","themesFor","appearance","themes","filter","variant","selectedAccent","accent","some","option","id","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","_el$5","nextSibling","_el$6","_el$7","_el$8","_el$9","_el$0","_$spread","_$mergeProps","class","_$insert","_$createComponent","as","size","children","value","onChange","label","description","when","ThemeSection","title","selectedId","lightThemeId","onThemeSelect","theme","darkThemeId","orientation","accentOptions","themeDefaultColor","settings","fonts","_el$1","_tmpl$2","_el$10","_el$11","_$mergeProps","_$createComponent","RadioGroup","Radio"],"sources":["../../../src/components/theme/appearance-panel.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { Show, onMount, splitProps } from 'solid-js'\nimport { RadioGroup as Radio } from '@kobalte/core/radio-group'\nimport { accentPresets, isPresetAccentId } from '#lib/accent-presets'\nimport { DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS } from '#lib/appearance-font-settings'\nimport { THEME_DEFAULT_ID } from '#lib/theme-defaults'\nimport type { ThemeAppearance, ThemeVariant } from '#lib/theme-types'\nimport { cn } from '#lib/utils'\n// Direct modules, not the appearance-editor barrel, which would load the whole\n// editor, its sheet and its switch into every theme import (lint allows these two).\nimport { AccentSwatchGroups } from '../composites/appearance-editor/accent-swatch-groups'\nimport { AppearanceFontSettingsGroup } from '../composites/appearance-editor/font-settings-group'\nimport { RadioGroup, RadioGroupItem } from '../ui/radio-group'\nimport { ThemePicker } from './theme-picker'\nimport { useTheme } from './theme-context'\nimport { Heading } from '../ui/typography'\n\n/**\n * AppearancePanel.\n *\n * The appearance page, as a component rather than as a screen each application\n * draws for itself. Two applications that both let a user choose a theme should\n * offer the *same* choices in the *same* arrangement — otherwise \"Adea\" and\n * \"Cortana\" are two products that happen to share a component library, which is\n * the opposite of what this system is for.\n *\n * Four axes, in the order a user thinks about them:\n *\n * 1. **Appearance** — light, dark, or follow the system.\n * 2. **Themes** — one for each appearance. Both are shown at once, because the\n * choice is per-appearance and hiding the other half makes it feel like one\n * setting that keeps changing.\n * 3. **Accent** — adea's presets, then the accents the selected theme pair\n * carries itself, layered on whichever theme is active.\n * 4. **Fonts** — separate families and sizes for interface, content and code.\n *\n * The panel reads and writes the provider's preference and keeps no state of its\n * own, so it cannot disagree with what is applied. Its themes are the provider's, so\n * under the lazy provider it asks for the catalogue when it mounts and lists the rest\n * when it arrives.\n */\nexport type AppearancePanelProps = ComponentProps<'div'>\n\nexport function AppearancePanel(props: AppearancePanelProps) {\n const [local, rest] = splitProps(props, ['class'])\n const context = useTheme()\n const { selection, setSelection, resolvedAppearance, themeAccents } = context\n onMount(() => void context.loadCatalogue?.())\n const themesFor = (appearance: ThemeAppearance) =>\n context.themes.filter((variant) => variant.appearance === appearance)\n const selectedAccent = () => {\n const accent = selection().accent\n return accent === THEME_DEFAULT_ID ||\n isPresetAccentId(accent) ||\n themeAccents().some((option) => option.id === accent)\n ? accent\n : THEME_DEFAULT_ID\n }\n\n return (\n <div data-slot=\"appearance-panel\" class={cn('flex flex-col gap-8', local.class)} {...rest}>\n {/* --- 1. Appearance ------------------------------------------------- */}\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n Appearance\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">\n Follow the system, or pin one. The theme below is chosen per appearance, so switching at\n sunset does not make you choose again.\n </p>\n </header>\n <RadioGroup\n value={selection().appearance}\n onChange={(value) => setSelection({ appearance: value as 'light' | 'dark' | 'system' })}\n aria-label=\"Appearance\"\n >\n <RadioGroupItem value=\"light\" label=\"Light\" description=\"Always the light theme.\" />\n <RadioGroupItem value=\"dark\" label=\"Dark\" description=\"Always the dark theme.\" />\n <RadioGroupItem\n value=\"system\"\n label=\"Match the system\"\n description={`Currently resolving to ${resolvedAppearance()}.`}\n />\n </RadioGroup>\n </section>\n\n {/* --- 2. Themes ------------------------------------------------------ */}\n <Show when={resolvedAppearance() === 'light'}>\n <ThemeSection\n title=\"Light theme\"\n description=\"Shown when the appearance resolves to light.\"\n themes={themesFor('light')}\n selectedId={selection().lightThemeId}\n onThemeSelect={(theme) => setSelection({ lightThemeId: theme.id })}\n />\n </Show>\n <Show when={resolvedAppearance() === 'dark'}>\n <ThemeSection\n title=\"Dark theme\"\n description=\"Shown when the appearance resolves to dark.\"\n themes={themesFor('dark')}\n selectedId={selection().darkThemeId}\n onThemeSelect={(theme) => setSelection({ darkThemeId: theme.id })}\n />\n </Show>\n\n {/* --- 3. Accent ------------------------------------------------------ */}\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n Accent\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">\n Colours the interactive roles — the primary button, the focus ring, a selected row — on\n top of the theme above — one of the presets, or a colour the theme carries itself. Every\n option is measured against the surface it lands on, so none of them can make a label\n unreadable.\n </p>\n </header>\n <Radio\n value={selectedAccent()}\n onChange={(accent) => setSelection({ accent })}\n orientation=\"horizontal\"\n aria-label=\"Accent\"\n class=\"flex flex-col items-start gap-3\"\n >\n <AccentSwatchGroups\n accentOptions={accentPresets}\n resolvedAppearance={resolvedAppearance()}\n themeDefaultColor=\"var(--primary)\"\n />\n </Radio>\n </section>\n\n {/* --- 4. Fonts ------------------------------------------------------- */}\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n Fonts\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">\n Choose separate families and sizes for the interface, reading, and code. Font families\n come from the shared catalogue and are self-hosted.\n </p>\n </header>\n <AppearanceFontSettingsGroup\n settings={selection().fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS}\n onChange={(fonts) => setSelection({ fonts })}\n />\n </section>\n </div>\n )\n}\n\nfunction ThemeSection(props: {\n title: string\n description: string\n themes: readonly ThemeVariant[]\n selectedId: string\n onThemeSelect: (theme: ThemeVariant) => void\n}) {\n return (\n <section class=\"flex flex-col gap-3\">\n <header class=\"flex flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n {props.title}\n </Heading>\n <p class=\"max-w-prose text-sm text-muted-foreground\">{props.description}</p>\n </header>\n <ThemePicker\n themes={props.themes}\n selectedId={props.selectedId}\n onThemeSelect={props.onThemeSelect}\n />\n </section>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA2CA,SAAgBoB,gBAAgBC,OAA6B;CAC3D,MAAM,CAACC,OAAOC,QAAQpB,WAAWkB,OAAO,CAAC,OAAO,CAAC;CACjD,MAAMG,UAAUP,SAAS;CACzB,MAAM,EAAEQ,WAAWC,cAAcC,oBAAoBC,iBAAiBJ;CACtEtB,cAAc,KAAKsB,QAAQK,gBAAgB,CAAC;CAC5C,MAAMC,aAAaC,eACjBP,QAAQQ,OAAOC,QAAQC,YAAYA,QAAQH,eAAeA,UAAU;CACtE,MAAMI,uBAAuB;EAC3B,MAAMC,SAASX,UAAU,CAAC,CAACW;EAC3B,OAAOA,WAAAA,WACL7B,iBAAiB6B,MAAM,KACvBR,aAAa,CAAC,CAACS,MAAMC,WAAWA,OAAOC,OAAOH,MAAM,IAClDA,SACA3B;CACN;CAEA,cAAA;EAAA,IAAA+B,OAAAC,OAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAC,YAAAE,QAAAD,MAAAD,YAAAG,QAAAJ,MAAAK,aAAAC,QAAAF,MAAAH,YAAAM,QAAAD,MAAAL,YAAAO,QAAAJ,MAAAC,aAAAI,QAAAD,MAAAP,YAAAS,QAAAD,MAAAR;EAAAU,OAAAb,MAAAc,WAAA,EAAA,KAAA,WAAA;GAAA,OAC2C1C,GAAG,uBAAuBU,MAAMiC,KAAK;EAAC,EAAA,GAAMhC,IAAI,GAAA,OAAA,IAAA;EAAAiC,OAAAZ,OAAAa,gBAIlFvC,SAAO;GAACwC,IAAE;GAAMC,MAAI;GAAAC,UAAA;EAAA,CAAA,GAAAf,KAAA;EAAAW,OAAAd,OAAAe,gBAQtBrD,cAAU;GAAA,IACTyD,QAAK;IAAA,OAAEpC,UAAU,CAAC,CAACM;GAAU;GAC7B+B,WAAWD,UAAUnC,aAAa,EAAEK,YAAY8B,MAAqC,CAAC;GAAC,cAAA;GAAA,IAAAD,WAAA;IAAA,OAAA;KAAAH,gBAGtF1C,gBAAc;MAAC8C,OAAK;MAASE,OAAK;MAASC,aAAW;KAAA,CAAA;KAAAP,gBACtD1C,gBAAc;MAAC8C,OAAK;MAAQE,OAAK;MAAQC,aAAW;KAAA,CAAA;KAAAP,gBACpD1C,gBAAc;MACb8C,OAAK;MACLE,OAAK;MAAA,IACLC,cAAW;OAAA,OAAE,0BAA0BrC,mBAAmB,EAAC;MAAG;KAAA,CAAA;IAAA;GAAA;EAAA,CAAA,GAAA,IAAA;EAAA6B,OAAAhB,MAAAiB,gBAMnExD,MAAI;GAAA,IAACgE,OAAI;IAAA,OAAEtC,mBAAmB,MAAM;GAAO;GAAA,IAAAiC,WAAA;IAAA,OAAAH,gBACzCS,cAAY;KACXC,OAAK;KACLH,aAAW;KAAA,IACXhC,SAAM;MAAA,OAAEF,UAAU,OAAO;KAAC;KAAA,IAC1BsC,aAAU;MAAA,OAAE3C,UAAU,CAAC,CAAC4C;KAAY;KACpCC,gBAAgBC,UAAU7C,aAAa,EAAE2C,cAAcE,MAAMhC,GAAG,CAAC;IAAC,CAAA;GAAA;EAAA,CAAA,GAAAO,KAAA;EAAAU,OAAAhB,MAAAiB,gBAGrExD,MAAI;GAAA,IAACgE,OAAI;IAAA,OAAEtC,mBAAmB,MAAM;GAAM;GAAA,IAAAiC,WAAA;IAAA,OAAAH,gBACxCS,cAAY;KACXC,OAAK;KACLH,aAAW;KAAA,IACXhC,SAAM;MAAA,OAAEF,UAAU,MAAM;KAAC;KAAA,IACzBsC,aAAU;MAAA,OAAE3C,UAAU,CAAC,CAAC+C;KAAW;KACnCF,gBAAgBC,UAAU7C,aAAa,EAAE8C,aAAaD,MAAMhC,GAAG,CAAC;IAAC,CAAA;GAAA;EAAA,CAAA,GAAAO,KAAA;EAAAU,OAAAR,OAAAS,gBAOhEvC,SAAO;GAACwC,IAAE;GAAMC,MAAI;GAAAC,UAAA;EAAA,CAAA,GAAAX,KAAA;EAAAO,OAAAV,OAAAW,gBAUtBpD,YAAK;GAAA,IACJwD,QAAK;IAAA,OAAE1B,eAAe;GAAC;GACvB2B,WAAW1B,WAAWV,aAAa,EAAEU,OAAO,CAAC;GAC7CqC,aAAW;GAAA,cAAA;GAAA,SAAA;GAAA,IAAAb,WAAA;IAAA,OAAAH,gBAIV5C,oBAAkB;KACjB6D,eAAepE;KAAa,IAC5BqB,qBAAkB;MAAA,OAAEA,mBAAmB;KAAC;KACxCgD,mBAAiB;IAAA,CAAA;GAAA;EAAA,CAAA,GAAA,IAAA;EAAAnB,OAAAL,OAAAM,gBAQlBvC,SAAO;GAACwC,IAAE;GAAMC,MAAI;GAAAC,UAAA;EAAA,CAAA,GAAAR,KAAA;EAAAI,OAAAN,OAAAO,gBAQtB3C,6BAA2B;GAAA,IAC1B8D,WAAQ;IAAA,OAAEnD,UAAU,CAAC,CAACoD,SAASrE;GAAuC;GACtEsD,WAAWe,UAAUnD,aAAa,EAAEmD,MAAM,CAAC;EAAC,CAAA,GAAA,IAAA;EAAA,OAAArC;CAAA,EAAA,CAAA;AAKtD;AAEA,SAAS0B,aAAa7C,OAMnB;CACD,cAAA;EAAA,IAAAyD,QAAAC,QAAA,GAAAC,SAAAF,MAAAnC,YAAAsC,SAAAD,OAAArC;EAAAa,OAAAwB,QAAAvB,gBAGOvC,SAAO;GAACwC,IAAE;GAAMC,MAAI;GAAA,IAAAC,WAAA;IAAA,OAClBvC,MAAM8C;GAAK;EAAA,CAAA,GAAAc,MAAA;EAAAzB,OAAAyB,cAEwC5D,MAAM2C,WAAW;EAAAR,OAAAsB,OAAArB,gBAExEzC,aAAW;GAAA,IACVgB,SAAM;IAAA,OAAEX,MAAMW;GAAM;GAAA,IACpBoC,aAAU;IAAA,OAAE/C,MAAM+C;GAAU;GAAA,IAC5BE,gBAAa;IAAA,OAAEjD,MAAMiD;GAAa;EAAA,CAAA,GAAA,IAAA;EAAA,OAAAQ;CAAA,EAAA,CAAA;AAI1C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { AppearancePanel, type AppearancePanelProps } from './appearance-panel';
|
|
2
2
|
export { ThemePicker, ThemePreview, ThemeSwatch, type ThemePickerProps, type ThemePreviewProps, type ThemeSwatchProps, } from './theme-picker';
|
|
3
|
-
export
|
|
3
|
+
export * from './theme-provider';
|
|
4
4
|
export { ThemeToggle, type ThemeToggleProps } from './theme-toggle';
|
|
5
5
|
export { ThemeModeToggle, type ThemeModeToggleProps } from './theme-mode-toggle';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAC/E,OAAO,EACL,WAAW,EACX,YAAY,EACZ,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA;AACvB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAC/E,OAAO,EACL,WAAW,EACX,YAAY,EACZ,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { safeScriptStringLiteral } from "../../lib/safe-script.js";
|
|
1
2
|
import { AppearancePanel } from "./appearance-panel.js";
|
|
2
3
|
import { useOptionalTheme, useTheme } from "./theme-context.js";
|
|
3
|
-
import { defaultThemeSelection, resolvedDensity } from "./theme-state-core.js";
|
|
4
|
-
import { createVersionedPersistence, localStoragePersistence } from "./theme-persistence.js";
|
|
5
|
-
import { inlineScriptLiteral, themeScript } from "./theme-script.js";
|
|
6
4
|
import { ThemePicker, ThemePreview, ThemeSwatch } from "./theme-picker.js";
|
|
5
|
+
import { defaultThemeSelection, resolvedDensity } from "./theme-state.js";
|
|
6
|
+
import { createVersionedPersistence, localStoragePersistence } from "./theme-persistence.js";
|
|
7
|
+
import { themeScript } from "./theme-script.js";
|
|
7
8
|
import { ThemeProvider } from "./theme-provider.js";
|
|
8
9
|
import { ThemeToggle } from "./theme-toggle.js";
|
|
9
10
|
import { ThemeModeToggle } from "./theme-mode-toggle.js";
|
|
10
|
-
export { AppearancePanel, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, createVersionedPersistence, defaultThemeSelection, inlineScriptLiteral, localStoragePersistence, resolvedDensity, themeScript, useOptionalTheme, useTheme };
|
|
11
|
+
export { AppearancePanel, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, createVersionedPersistence, defaultThemeSelection, safeScriptStringLiteral as inlineScriptLiteral, localStoragePersistence, resolvedDensity, themeScript, useOptionalTheme, useTheme };
|
|
@@ -1,15 +1,41 @@
|
|
|
1
|
+
import { type JSX } from 'solid-js';
|
|
2
|
+
import { type ThemeProviderProps } from './theme-provider-value';
|
|
1
3
|
/**
|
|
2
4
|
* The theme provider with the catalogue out of the start-up path.
|
|
3
5
|
*
|
|
4
6
|
* Everything here is free of the 34-theme catalogue: `import` this entry instead of
|
|
5
7
|
* `@adea-ai/ui/components/theme` in a host that paints its theme from a stylesheet.
|
|
6
|
-
*
|
|
7
|
-
* theme needs it. See {@link ThemeProvider} for the rules and `docs/consumption.md`
|
|
8
|
-
* for the setup.
|
|
8
|
+
* See {@link ThemeProvider} for the rules and `docs/consumption.md` for the setup.
|
|
9
9
|
*/
|
|
10
|
+
export * from './theme-api';
|
|
10
11
|
export { loadThemeCatalogue } from './theme-catalogue-source';
|
|
11
|
-
export {
|
|
12
|
-
export { createVersionedPersistence, defaultThemeSelection, inlineScriptLiteral, localStoragePersistence, resolvedDensity, themeScript, useOptionalTheme, useTheme, type EditorRolesMode, type ThemeCatalogueSource, type ThemeContextValue, type ThemeDensity, type ThemePersistence, type ThemeProviderProps, type ThemeScriptOptions, type ThemeSelection, type ThemeStorageSchema, type ThemeSurface, type VersionedCodec, type VersionedPersistenceOptions, } from './theme-provider-core';
|
|
12
|
+
export type { ThemeCatalogueSource } from './theme-provider-value';
|
|
13
13
|
export { ThemeToggle, type ThemeToggleProps } from './theme-toggle';
|
|
14
14
|
export { ThemeModeToggle, type ThemeModeToggleProps } from './theme-mode-toggle';
|
|
15
|
+
/**
|
|
16
|
+
* ThemeProvider, with the theme catalogue out of the start-up path.
|
|
17
|
+
*
|
|
18
|
+
* Same props, same context and same behaviour as `ThemeProvider` for everything the
|
|
19
|
+
* shipped default pair covers: the default light and dark themes, a host's own
|
|
20
|
+
* `themes`, every accent preset and custom colour, the surface axis, fonts and
|
|
21
|
+
* density. Only the 32 other catalogue themes are not in the start-up chunk. The first
|
|
22
|
+
* time the selection (or a preview) names one, or a theme-derived `ansi-*` accent over
|
|
23
|
+
* such a pair, this provider imports the catalogue in a chunk of its own:
|
|
24
|
+
*
|
|
25
|
+
* - until it arrives the document keeps what is on it (set before first paint by
|
|
26
|
+
* `themeScript`, painted by the stylesheet under `palette="stylesheet"`), and
|
|
27
|
+
* `variant()` is the default of the appearance;
|
|
28
|
+
* - when it arrives the provider re-resolves and paints the stored theme, and
|
|
29
|
+
* `useTheme().catalogueReady()` turns true;
|
|
30
|
+
* - a preview of a theme that has not loaded starts the load and shows when it ends.
|
|
31
|
+
*
|
|
32
|
+
* Pair it with `palette="stylesheet"` and `themeScript`: inline palettes of catalogue
|
|
33
|
+
* themes need the catalogue to compute, so under the default `inline` palette every
|
|
34
|
+
* stored theme but the defaults waits for the import.
|
|
35
|
+
*
|
|
36
|
+
* `useTheme().themes` and `allThemes()` list only the default pair until
|
|
37
|
+
* `catalogueReady()`; a picker calls `useTheme().loadCatalogue()` when it mounts, as
|
|
38
|
+
* `AppearancePanel` does.
|
|
39
|
+
*/
|
|
40
|
+
export declare function ThemeProvider(props: ThemeProviderProps): JSX.Element;
|
|
15
41
|
//# sourceMappingURL=lazy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../../src/components/theme/lazy.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../../src/components/theme/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAEhE,OAAO,EAAqB,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEnF;;;;;;GAMG;AACH,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAEpE"}
|
|
@@ -1,9 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ThemeProvider } from "./theme-provider-lazy.js";
|
|
3
|
-
import { createVersionedPersistence, localStoragePersistence } from "./theme-persistence.js";
|
|
4
|
-
import { defaultThemeSelection, resolvedDensity } from "./theme-state-core.js";
|
|
5
|
-
import { inlineScriptLiteral, themeScript } from "./theme-script.js";
|
|
1
|
+
import { safeScriptStringLiteral } from "../../lib/safe-script.js";
|
|
6
2
|
import { useOptionalTheme, useTheme } from "./theme-context.js";
|
|
3
|
+
import { defaultThemeSelection, resolvedDensity } from "./theme-state.js";
|
|
4
|
+
import { createVersionedPersistence, localStoragePersistence } from "./theme-persistence.js";
|
|
5
|
+
import { createLazyCatalogue, loadThemeCatalogue } from "./theme-catalogue-source.js";
|
|
6
|
+
import { themeScript } from "./theme-script.js";
|
|
7
|
+
import { ThemeProviderWith } from "./theme-provider-value.js";
|
|
7
8
|
import { ThemeToggle } from "./theme-toggle.js";
|
|
8
9
|
import { ThemeModeToggle } from "./theme-mode-toggle.js";
|
|
9
|
-
|
|
10
|
+
import { createComponent, mergeProps } from "solid-js";
|
|
11
|
+
// src/components/theme/lazy.ts
|
|
12
|
+
/**
|
|
13
|
+
* ThemeProvider, with the theme catalogue out of the start-up path.
|
|
14
|
+
*
|
|
15
|
+
* Same props, same context and same behaviour as `ThemeProvider` for everything the
|
|
16
|
+
* shipped default pair covers: the default light and dark themes, a host's own
|
|
17
|
+
* `themes`, every accent preset and custom colour, the surface axis, fonts and
|
|
18
|
+
* density. Only the 32 other catalogue themes are not in the start-up chunk. The first
|
|
19
|
+
* time the selection (or a preview) names one, or a theme-derived `ansi-*` accent over
|
|
20
|
+
* such a pair, this provider imports the catalogue in a chunk of its own:
|
|
21
|
+
*
|
|
22
|
+
* - until it arrives the document keeps what is on it (set before first paint by
|
|
23
|
+
* `themeScript`, painted by the stylesheet under `palette="stylesheet"`), and
|
|
24
|
+
* `variant()` is the default of the appearance;
|
|
25
|
+
* - when it arrives the provider re-resolves and paints the stored theme, and
|
|
26
|
+
* `useTheme().catalogueReady()` turns true;
|
|
27
|
+
* - a preview of a theme that has not loaded starts the load and shows when it ends.
|
|
28
|
+
*
|
|
29
|
+
* Pair it with `palette="stylesheet"` and `themeScript`: inline palettes of catalogue
|
|
30
|
+
* themes need the catalogue to compute, so under the default `inline` palette every
|
|
31
|
+
* stored theme but the defaults waits for the import.
|
|
32
|
+
*
|
|
33
|
+
* `useTheme().themes` and `allThemes()` list only the default pair until
|
|
34
|
+
* `catalogueReady()`; a picker calls `useTheme().loadCatalogue()` when it mounts, as
|
|
35
|
+
* `AppearancePanel` does.
|
|
36
|
+
*/
|
|
37
|
+
function ThemeProvider(props) {
|
|
38
|
+
return createComponent(ThemeProviderWith, mergeProps(props, { catalogue: createLazyCatalogue() }));
|
|
39
|
+
}
|
|
40
|
+
export { ThemeModeToggle, ThemeProvider, ThemeToggle, createVersionedPersistence, defaultThemeSelection, safeScriptStringLiteral as inlineScriptLiteral, loadThemeCatalogue, localStoragePersistence, resolvedDensity, themeScript, useOptionalTheme, useTheme };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=lazy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy.js","names":[],"sources":["../../../src/components/theme/lazy.ts"],"sourcesContent":["import { createComponent, mergeProps, type JSX } from 'solid-js'\nimport { createLazyCatalogue } from './theme-catalogue-source'\nimport { ThemeProviderWith, type ThemeProviderProps } from './theme-provider-value'\n\n/**\n * The theme provider with the catalogue out of the start-up path.\n *\n * Everything here is free of the 34-theme catalogue: `import` this entry instead of\n * `@adea-ai/ui/components/theme` in a host that paints its theme from a stylesheet.\n * See {@link ThemeProvider} for the rules and `docs/consumption.md` for the setup.\n */\nexport * from './theme-api'\nexport { loadThemeCatalogue } from './theme-catalogue-source'\nexport type { ThemeCatalogueSource } from './theme-provider-value'\nexport { ThemeToggle, type ThemeToggleProps } from './theme-toggle'\nexport { ThemeModeToggle, type ThemeModeToggleProps } from './theme-mode-toggle'\n\n/**\n * ThemeProvider, with the theme catalogue out of the start-up path.\n *\n * Same props, same context and same behaviour as `ThemeProvider` for everything the\n * shipped default pair covers: the default light and dark themes, a host's own\n * `themes`, every accent preset and custom colour, the surface axis, fonts and\n * density. Only the 32 other catalogue themes are not in the start-up chunk. The first\n * time the selection (or a preview) names one, or a theme-derived `ansi-*` accent over\n * such a pair, this provider imports the catalogue in a chunk of its own:\n *\n * - until it arrives the document keeps what is on it (set before first paint by\n * `themeScript`, painted by the stylesheet under `palette=\"stylesheet\"`), and\n * `variant()` is the default of the appearance;\n * - when it arrives the provider re-resolves and paints the stored theme, and\n * `useTheme().catalogueReady()` turns true;\n * - a preview of a theme that has not loaded starts the load and shows when it ends.\n *\n * Pair it with `palette=\"stylesheet\"` and `themeScript`: inline palettes of catalogue\n * themes need the catalogue to compute, so under the default `inline` palette every\n * stored theme but the defaults waits for the import.\n *\n * `useTheme().themes` and `allThemes()` list only the default pair until\n * `catalogueReady()`; a picker calls `useTheme().loadCatalogue()` when it mounts, as\n * `AppearancePanel` does.\n */\nexport function ThemeProvider(props: ThemeProviderProps): JSX.Element {\n return createComponent(ThemeProviderWith, mergeProps(props, { catalogue: createLazyCatalogue() }))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAgB,cAAc,OAAwC;CACpE,OAAO,gBAAgB,mBAAmB,WAAW,OAAO,EAAE,WAAW,oBAAoB,EAAE,CAAC,CAAC;AACnG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { inlineScriptLiteral, type ThemeScriptOptions as BaseThemeScriptOptions, type ThemeTokenProjectionFallback } from './theme-script';
|
|
2
|
+
import type { ThemeTokenProjection } from './token-projection';
|
|
3
|
+
/** Options for the projection-enabled boot script. */
|
|
4
|
+
export type ThemeScriptOptions = Omit<BaseThemeScriptOptions, 'libraryKey'> & {
|
|
5
|
+
libraryKey: string;
|
|
6
|
+
tokenProjection: ThemeTokenProjection;
|
|
7
|
+
/** Optional serialized-record sources for projection tokens omitted by flatTokens. */
|
|
8
|
+
tokenProjectionFallbacks?: readonly ThemeTokenProjectionFallback[];
|
|
9
|
+
};
|
|
10
|
+
/** Alias that makes the opt-in projection requirement explicit at call sites. */
|
|
11
|
+
export type ThemeScriptProjectionOptions = ThemeScriptOptions;
|
|
12
|
+
/** Emit a no-flash script with the same projector used by provider hydration. */
|
|
13
|
+
export declare function themeScript(options: ThemeScriptOptions): string;
|
|
14
|
+
export { inlineScriptLiteral };
|
|
15
|
+
export type { ThemeTokenProjectionFallback };
|
|
16
|
+
export type { ThemeStorageSchema } from './theme-persistence';
|
|
17
|
+
//# sourceMappingURL=script-projection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-projection.d.ts","sourceRoot":"","sources":["../../../src/components/theme/script-projection.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,mBAAmB,EAEnB,KAAK,kBAAkB,IAAI,sBAAsB,EACjD,KAAK,4BAA4B,EAClC,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAI9D,sDAAsD;AACtD,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,sBAAsB,EAAE,YAAY,CAAC,GAAG;IAC5E,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,oBAAoB,CAAA;IACrC,sFAAsF;IACtF,wBAAwB,CAAC,EAAE,SAAS,4BAA4B,EAAE,CAAA;CACnE,CAAA;AAED,iFAAiF;AACjF,MAAM,MAAM,4BAA4B,GAAG,kBAAkB,CAAA;AAE7D,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAO/D;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA;AAC9B,YAAY,EAAE,4BAA4B,EAAE,CAAA;AAC5C,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { safeScriptStringLiteral } from "../../lib/safe-script.js";
|
|
2
|
+
import { themeScriptWithProjection } from "./theme-script.js";
|
|
3
|
+
import { themeTokenProjectionBundle } from "@adea-ai/themes/theme-token-projection/script";
|
|
4
|
+
// src/components/theme/script-projection.ts
|
|
5
|
+
/**
|
|
6
|
+
* Opt-in no-flash script entry that can project imported token maps synchronously.
|
|
7
|
+
* Import this path only when the host supplies declarative projection rules; the
|
|
8
|
+
* ordinary `components/theme/script` entry stays free of the browser bundle.
|
|
9
|
+
*/
|
|
10
|
+
var tokenProjectionFallbackScript = `if(storedTheme&&tokenProjectionFallbacks.length){var sourceTokens=Object.create(null);for(var sourceName in tokens){if(Object.prototype.hasOwnProperty.call(tokens,sourceName))sourceTokens[sourceName]=tokens[sourceName]}for(var fi=0;fi<tokenProjectionFallbacks.length;fi++){var fallbackToken=tokenProjectionFallbacks[fi];if(!fallbackToken||typeof fallbackToken.token!=='string'||!/^--[A-Za-z0-9_-]+$/.test(fallbackToken.token)||Object.prototype.hasOwnProperty.call(sourceTokens,fallbackToken.token)||!Array.isArray(fallbackToken.path)||fallbackToken.path.length===0)continue;var sourceValue=storedTheme;for(var pi=0;pi<fallbackToken.path.length;pi++){var pathKey=fallbackToken.path[pi];if(typeof pathKey!=='string'||!sourceValue||typeof sourceValue!=='object'||!Object.prototype.hasOwnProperty.call(sourceValue,pathKey)){sourceValue=undefined;break}sourceValue=sourceValue[pathKey]}if(typeof sourceValue==='string')sourceTokens[fallbackToken.token]=sourceValue}tokens=sourceTokens}`;
|
|
11
|
+
/** Emit a no-flash script with the same projector used by provider hydration. */
|
|
12
|
+
function themeScript(options) {
|
|
13
|
+
return themeScriptWithProjection(options, options.tokenProjection, themeTokenProjectionBundle, tokenProjectionFallbackScript);
|
|
14
|
+
}
|
|
15
|
+
export { safeScriptStringLiteral as inlineScriptLiteral, themeScript };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=script-projection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-projection.js","names":[],"sources":["../../../src/components/theme/script-projection.ts"],"sourcesContent":["/**\n * Opt-in no-flash script entry that can project imported token maps synchronously.\n * Import this path only when the host supplies declarative projection rules; the\n * ordinary `components/theme/script` entry stays free of the browser bundle.\n */\nimport { themeTokenProjectionBundle } from '@adea-ai/themes/theme-token-projection/script'\nimport {\n inlineScriptLiteral,\n themeScriptWithProjection,\n type ThemeScriptOptions as BaseThemeScriptOptions,\n type ThemeTokenProjectionFallback,\n} from './theme-script'\nimport type { ThemeTokenProjection } from './token-projection'\n\nconst tokenProjectionFallbackScript = `if(storedTheme&&tokenProjectionFallbacks.length){var sourceTokens=Object.create(null);for(var sourceName in tokens){if(Object.prototype.hasOwnProperty.call(tokens,sourceName))sourceTokens[sourceName]=tokens[sourceName]}for(var fi=0;fi<tokenProjectionFallbacks.length;fi++){var fallbackToken=tokenProjectionFallbacks[fi];if(!fallbackToken||typeof fallbackToken.token!=='string'||!/^--[A-Za-z0-9_-]+$/.test(fallbackToken.token)||Object.prototype.hasOwnProperty.call(sourceTokens,fallbackToken.token)||!Array.isArray(fallbackToken.path)||fallbackToken.path.length===0)continue;var sourceValue=storedTheme;for(var pi=0;pi<fallbackToken.path.length;pi++){var pathKey=fallbackToken.path[pi];if(typeof pathKey!=='string'||!sourceValue||typeof sourceValue!=='object'||!Object.prototype.hasOwnProperty.call(sourceValue,pathKey)){sourceValue=undefined;break}sourceValue=sourceValue[pathKey]}if(typeof sourceValue==='string')sourceTokens[fallbackToken.token]=sourceValue}tokens=sourceTokens}`\n\n/** Options for the projection-enabled boot script. */\nexport type ThemeScriptOptions = Omit<BaseThemeScriptOptions, 'libraryKey'> & {\n libraryKey: string\n tokenProjection: ThemeTokenProjection\n /** Optional serialized-record sources for projection tokens omitted by flatTokens. */\n tokenProjectionFallbacks?: readonly ThemeTokenProjectionFallback[]\n}\n\n/** Alias that makes the opt-in projection requirement explicit at call sites. */\nexport type ThemeScriptProjectionOptions = ThemeScriptOptions\n\n/** Emit a no-flash script with the same projector used by provider hydration. */\nexport function themeScript(options: ThemeScriptOptions): string {\n return themeScriptWithProjection(\n options,\n options.tokenProjection,\n themeTokenProjectionBundle,\n tokenProjectionFallbackScript\n )\n}\n\nexport { inlineScriptLiteral }\nexport type { ThemeTokenProjectionFallback }\nexport type { ThemeStorageSchema } from './theme-persistence'\n"],"mappings":";;;;;;;;;AAcA,IAAM,gCAAgC;;AActC,SAAgB,YAAY,SAAqC;CAC/D,OAAO,0BACL,SACA,QAAQ,iBACR,4BACA,6BACF;AACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What both provider entries export beside their `ThemeProvider`: the context hooks,
|
|
3
|
+
* the persistence, the boot script and the selection types. One list, so the eager
|
|
4
|
+
* entry (`./index.ts` via `./theme-provider`) and the lazy one (`./lazy.ts`) cannot
|
|
5
|
+
* drift. Nothing here imports the catalogue.
|
|
6
|
+
*/
|
|
7
|
+
export { useOptionalTheme, useTheme } from './theme-context';
|
|
8
|
+
export { createVersionedPersistence, localStoragePersistence, type ThemePersistence, type VersionedCodec, type VersionedPersistenceOptions, } from './theme-persistence';
|
|
9
|
+
export { inlineScriptLiteral, themeScript, type ThemeScriptOptions, type ThemeStorageSchema, } from './script';
|
|
10
|
+
export { defaultThemeSelection, resolvedDensity, type ThemeContextValue, type ThemeDensity, type ThemeSelection, } from './theme-state';
|
|
11
|
+
export type { ThemeProviderProps } from './theme-provider-value';
|
|
12
|
+
export type { ThemeSurface } from '#lib/theme-surface';
|
|
13
|
+
export type { EditorRolesMode } from '#lib/theme-types';
|
|
14
|
+
//# sourceMappingURL=theme-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-api.d.ts","sourceRoot":"","sources":["../../../src/components/theme/theme-api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,2BAA2B,GACjC,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,GACxB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,cAAc,GACpB,MAAM,eAAe,CAAA;AACtB,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-catalogue-source.d.ts","sourceRoot":"","sources":["../../../src/components/theme/theme-catalogue-source.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAUlE;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,WAAW,CAAC,CAazD;AAED,yFAAyF;AACzF,wBAAgB,mBAAmB,IAAI,oBAAoB,
|
|
1
|
+
{"version":3,"file":"theme-catalogue-source.d.ts","sourceRoot":"","sources":["../../../src/components/theme/theme-catalogue-source.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAUlE;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,WAAW,CAAC,CAazD;AAED,yFAAyF;AACzF,wBAAgB,mBAAmB,IAAI,oBAAoB,CAqB1D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createLightThemeEngine } from "../../lib/theme-engine-light.js";
|
|
2
2
|
import { createSignal } from "solid-js";
|
|
3
3
|
// src/components/theme/theme-catalogue-source.ts
|
|
4
4
|
/**
|
|
@@ -38,8 +38,9 @@ function createLazyCatalogue() {
|
|
|
38
38
|
}, () => {
|
|
39
39
|
setFailed(true);
|
|
40
40
|
});
|
|
41
|
+
const shipped = createLightThemeEngine(() => void load());
|
|
41
42
|
return {
|
|
42
|
-
engine: () => full() ??
|
|
43
|
+
engine: () => full() ?? shipped,
|
|
43
44
|
loaded: () => full() !== void 0,
|
|
44
45
|
failed,
|
|
45
46
|
load
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-catalogue-source.js","names":[],"sources":["../../../src/components/theme/theme-catalogue-source.ts"],"sourcesContent":["import { createSignal } from 'solid-js'\nimport type { ThemeEngine } from '#lib/theme-engine'\nimport {
|
|
1
|
+
{"version":3,"file":"theme-catalogue-source.js","names":[],"sources":["../../../src/components/theme/theme-catalogue-source.ts"],"sourcesContent":["import { createSignal } from 'solid-js'\nimport type { ThemeEngine } from '#lib/theme-engine'\nimport { createLightThemeEngine } from '#lib/theme-engine-light'\nimport type { ThemeCatalogueSource } from './theme-provider-value'\n\n/**\n * The full catalogue engine once something has asked for it, shared by every lazy\n * provider and every caller of {@link loadThemeCatalogue} in the page. A provider\n * created after the load starts with it already in hand.\n */\nlet loadedEngine: ThemeEngine | undefined\nlet loading: Promise<ThemeEngine> | undefined\n\n/**\n * Load the whole theme catalogue (about 129 KB raw, 34 KB gzipped) and resolve to the\n * engine backed by it. Idempotent: every call shares one import, and a failed import is\n * forgotten so the next call retries.\n *\n * The lazy provider calls this itself the moment a selection needs a theme beyond the\n * default pair. Call it earlier — when a settings page mounts, or on hover of its\n * entry — to have the picker ready by the time it opens.\n */\nexport function loadThemeCatalogue(): Promise<ThemeEngine> {\n if (loadedEngine) return Promise.resolve(loadedEngine)\n loading ??= import('#lib/theme-catalogue').then(\n (module) => {\n loadedEngine = module.catalogueThemeEngine\n return loadedEngine\n },\n (error: unknown) => {\n loading = undefined\n throw error\n }\n )\n return loading\n}\n\n/** A catalogue source for one provider: the shipped defaults until the load resolves. */\nexport function createLazyCatalogue(): ThemeCatalogueSource {\n const [full, setFull] = createSignal<ThemeEngine | undefined>(loadedEngine)\n const [failed, setFailed] = createSignal(false)\n const load = () =>\n loadThemeCatalogue().then(\n (loaded) => {\n setFailed(false)\n setFull(() => loaded)\n },\n () => {\n // The theme the stylesheet painted stays; the next request retries.\n setFailed(true)\n }\n )\n const shipped = createLightThemeEngine(() => void load())\n return {\n engine: () => full() ?? shipped,\n loaded: () => full() !== undefined,\n failed,\n load,\n }\n}\n"],"mappings":";;;;;;;;AAUA,IAAI;AACJ,IAAI;;;;;;;;;;AAWJ,SAAgB,qBAA2C;CACzD,IAAI,cAAc,OAAO,QAAQ,QAAQ,YAAY;CACrD,YAAY,OAAO,+BAAuB,CAAC,MACxC,WAAW;EACV,eAAe,OAAO;EACtB,OAAO;CACT,IACC,UAAmB;EAClB,UAAU,KAAA;EACV,MAAM;CACR,CACF;CACA,OAAO;AACT;;AAGA,SAAgB,sBAA4C;CAC1D,MAAM,CAAC,MAAM,WAAW,aAAsC,YAAY;CAC1E,MAAM,CAAC,QAAQ,aAAa,aAAa,KAAK;CAC9C,MAAM,aACJ,mBAAmB,CAAC,CAAC,MAClB,WAAW;EACV,UAAU,KAAK;EACf,cAAc,MAAM;CACtB,SACM;EAEJ,UAAU,IAAI;CAChB,CACF;CACF,MAAM,UAAU,6BAA6B,KAAK,KAAK,CAAC;CACxD,OAAO;EACL,cAAc,KAAK,KAAK;EACxB,cAAc,KAAK,MAAM,KAAA;EACzB;EACA;CACF;AACF"}
|
|
@@ -1,18 +1,120 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import type { ThemeTokenProjectionOptions } from './token-projection';
|
|
2
|
+
import type { ThemeEngine } from '#lib/theme-engine';
|
|
3
|
+
import type { EditorRolesMode, ThemeAppearance, ThemeVariant } from '#lib/theme-types';
|
|
4
|
+
import { type SurfaceState } from '#lib/theme-surface';
|
|
5
|
+
import { type ThemeSelection } from './theme-state';
|
|
3
6
|
/**
|
|
4
|
-
* The
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
7
|
+
* The document half of the theme provider: the single writer of `<html>`.
|
|
8
|
+
*
|
|
9
|
+
* Written against the few members of an element it uses, so the rules can be tested
|
|
10
|
+
* on a stand-in. Every question the catalogue answers goes through the
|
|
11
|
+
* {@link ThemeEngine} it is given, so it imports no catalogue code or data.
|
|
8
12
|
*/
|
|
9
|
-
export
|
|
13
|
+
export type ThemeRoot = Pick<HTMLElement, 'classList' | 'dataset' | 'style' | 'removeAttribute' | 'setAttribute'>;
|
|
14
|
+
export type ThemeDocumentState = {
|
|
15
|
+
/** What the document shows: the committed selection, or a preview laid over it. */
|
|
16
|
+
selection: ThemeSelection;
|
|
17
|
+
appearance: ThemeAppearance;
|
|
18
|
+
variant: ThemeVariant;
|
|
19
|
+
/**
|
|
20
|
+
* The variant whose terminal palette is pinned over the interface variant's.
|
|
21
|
+
* Absent, the terminal follows the interface theme.
|
|
22
|
+
*/
|
|
23
|
+
terminalVariant?: ThemeVariant;
|
|
24
|
+
/**
|
|
25
|
+
* The resolved surface axis. Absent, the axis is off: no attribute and no
|
|
26
|
+
* `--surface-alpha` is written, and any this writer wrote before is removed.
|
|
27
|
+
*/
|
|
28
|
+
surface?: SurfaceState;
|
|
29
|
+
};
|
|
30
|
+
export type ThemeDocumentOptions = {
|
|
31
|
+
/**
|
|
32
|
+
* Rewrites the custom properties just before they are written: the variant's
|
|
33
|
+
* roles with the accent laid over them. It sees every property of the pass and
|
|
34
|
+
* must return the full map; a name it drops is not written.
|
|
35
|
+
*/
|
|
36
|
+
transformTokens?: (tokens: Record<string, string>) => Record<string, string>;
|
|
37
|
+
/**
|
|
38
|
+
* The contrast an accent is held to against the variant's background. Absent, a
|
|
39
|
+
* preset is painted verbatim (the catalogue measured it for its own themes) and
|
|
40
|
+
* only a custom `#rrggbb` is held to the default floor of 3:1.
|
|
41
|
+
*/
|
|
42
|
+
accentContrastFloor?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Where a catalogue variant's palette comes from. `inline` (the default) writes
|
|
45
|
+
* every role onto the root. `stylesheet` writes none for a catalogue variant,
|
|
46
|
+
* because the host loads a stylesheet that carries a `[data-theme]` block for it;
|
|
47
|
+
* a variant the catalogue does not hold (a host's imported theme) is still written
|
|
48
|
+
* inline, since no stylesheet can know it. The accent, the terminal pin, the
|
|
49
|
+
* surface alpha and the fonts are written the same in both.
|
|
50
|
+
*
|
|
51
|
+
* Switching from an imported variant back to a catalogue one removes what the
|
|
52
|
+
* imported one wrote, so nothing inline outlives it to beat the stylesheet.
|
|
53
|
+
*/
|
|
54
|
+
palette?: 'inline' | 'stylesheet';
|
|
55
|
+
/**
|
|
56
|
+
* The `--editor-*` projection. `syntax` (the default) is the catalogue's quiet
|
|
57
|
+
* syntax roles, which is what `theme-variants.css` carries; `floor` holds every
|
|
58
|
+
* editor role to 4.5:1 on the canvas, as hex.
|
|
59
|
+
*
|
|
60
|
+
* With `palette: 'stylesheet'`, `floor` is the one palette write a catalogue
|
|
61
|
+
* variant still gets: the stylesheet is generated for the default projection, so
|
|
62
|
+
* the sixteen `--editor-*` properties are written inline over it. The rest of the
|
|
63
|
+
* palette stays in the stylesheet.
|
|
64
|
+
*/
|
|
65
|
+
editorRoles?: EditorRolesMode;
|
|
66
|
+
} & ThemeTokenProjectionOptions;
|
|
67
|
+
/**
|
|
68
|
+
* The custom properties a state paints: the variant's roles, an optional projection
|
|
69
|
+
* from the raw host map, the accent, the pinned terminal palette, the surface alpha,
|
|
70
|
+
* then `transformTokens`.
|
|
71
|
+
*
|
|
72
|
+
* The accent is applied *here* rather than left to the `[data-accent]` blocks in
|
|
73
|
+
* `theme.css`, because the properties are written inline and an inline declaration
|
|
74
|
+
* outranks every stylesheet selector however specific it is. The blocks still exist
|
|
75
|
+
* and are still correct — they are what styles the window before this runs — but
|
|
76
|
+
* they cannot win from here, so leaving the accent to them meant the attribute was
|
|
77
|
+
* set, the rules were present, and nothing changed on screen.
|
|
78
|
+
*/
|
|
79
|
+
export declare function themeDocumentTokens(engine: ThemeEngine, state: ThemeDocumentState, options?: ThemeDocumentOptions): {
|
|
10
80
|
tokens: Record<string, string>;
|
|
11
81
|
accented: boolean;
|
|
12
82
|
};
|
|
13
83
|
/**
|
|
14
|
-
* Write a state onto a root and report which custom properties it owns
|
|
15
|
-
*
|
|
84
|
+
* Write a state onto a root and report which custom properties it owns.
|
|
85
|
+
*
|
|
86
|
+
* Pass the previous call's return as `previous` and any palette property that pass
|
|
87
|
+
* wrote and this one does not is removed. For the catalogue the two sets are the
|
|
88
|
+
* same, so nothing is ever removed; it matters for a host variant that carries
|
|
89
|
+
* `tokens` the catalogue does not, which would otherwise stay inline, beating the
|
|
90
|
+
* stylesheet, after the user switched away from it.
|
|
91
|
+
*/
|
|
92
|
+
export declare function applyThemeToRoot(engine: ThemeEngine, root: ThemeRoot, state: ThemeDocumentState, options?: ThemeDocumentOptions, previous?: ReadonlySet<string>): ReadonlySet<string>;
|
|
93
|
+
/** What {@link applyWithoutTransitions} needs of a document. */
|
|
94
|
+
export type TransitionDocument = {
|
|
95
|
+
head: {
|
|
96
|
+
appendChild(node: unknown): unknown;
|
|
97
|
+
};
|
|
98
|
+
createElement(tag: 'style'): {
|
|
99
|
+
textContent: string | null;
|
|
100
|
+
offsetHeight?: number;
|
|
101
|
+
remove(): void;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Run `apply` with every CSS transition switched off for the frame that carries
|
|
106
|
+
* it, so a theme switch cannot animate page-wide.
|
|
107
|
+
*
|
|
108
|
+
* Without this, flipping the custom properties on `<html>` starts a transition on
|
|
109
|
+
* every element that declares one, and each fades from the old palette to the new
|
|
110
|
+
* over its own duration: a theme change that looks like a rendering fault. The
|
|
111
|
+
* rule is removed two frames later, after the browser has committed the new styles
|
|
112
|
+
* with transitions off, and `restore` runs it early (the provider calls it when it
|
|
113
|
+
* is disposed mid-switch).
|
|
114
|
+
*
|
|
115
|
+
* `schedule` is the frame source; it defaults to `requestAnimationFrame` and falls
|
|
116
|
+
* back to running at once where there is none, which leaves transitions on rather
|
|
117
|
+
* than off.
|
|
16
118
|
*/
|
|
17
|
-
export declare function
|
|
119
|
+
export declare function applyWithoutTransitions(doc: TransitionDocument, apply: () => void, schedule?: (callback: () => void) => void): () => void;
|
|
18
120
|
//# sourceMappingURL=theme-document.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-document.d.ts","sourceRoot":"","sources":["../../../src/components/theme/theme-document.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme-document.d.ts","sourceRoot":"","sources":["../../../src/components/theme/theme-document.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAErE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEtF,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACpE,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAA;AAEpE;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,CAC1B,WAAW,EACX,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,iBAAiB,GAAG,cAAc,CACvE,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,mFAAmF;IACnF,SAAS,EAAE,cAAc,CAAA;IACzB,UAAU,EAAE,eAAe,CAAA;IAC3B,OAAO,EAAE,YAAY,CAAA;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,YAAY,CAAA;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5E;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,YAAY,CAAA;IACjC;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,eAAe,CAAA;CAC9B,GAAG,2BAA2B,CAAA;AAoB/B;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,oBAAyB,GACjC;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAiCvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,oBAAyB,EAClC,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAC7B,WAAW,CAAC,MAAM,CAAC,CA6CrB;AAED,gEAAgE;AAChE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE;QAAE,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAA;KAAE,CAAA;IAC7C,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG;QAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;QAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,MAAM,IAAI,IAAI,CAAA;KACf,CAAA;CACF,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,kBAAkB,EACvB,KAAK,EAAE,MAAM,IAAI,EACjB,QAAQ,GAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAsB,GACzD,MAAM,IAAI,CAqBZ"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { applyAppearanceFontSettings, normalizeAppearanceEditorFontSettings } from "../../lib/appearance-font-settings.js";
|
|
2
2
|
import { terminalCssVariables } from "../../lib/theme-css.js";
|
|
3
|
+
import { assertThemeTokenProjectionConfig } from "./token-projection-options.js";
|
|
3
4
|
import { isCustomAccent } from "../../lib/accent-roles.js";
|
|
4
5
|
import { surfaceAlpha } from "../../lib/theme-surface.js";
|
|
5
|
-
import { resolvedDensity } from "./theme-state
|
|
6
|
-
// src/components/theme/theme-document
|
|
6
|
+
import { resolvedDensity } from "./theme-state.js";
|
|
7
|
+
// src/components/theme/theme-document.ts
|
|
7
8
|
/**
|
|
8
9
|
* What a catalogue variant still writes inline when its palette is the stylesheet's:
|
|
9
10
|
* nothing, unless the editor projection is not the one the stylesheet was generated
|
|
@@ -14,9 +15,9 @@ function stylesheetOverrides(engine, variant, editorRoles) {
|
|
|
14
15
|
return Object.fromEntries(Object.entries(engine.themeCssVariables(variant, { editor: "floor" })).filter(([name]) => name.startsWith("--editor-")));
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
|
-
* The custom properties a state paints: the variant's roles,
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* The custom properties a state paints: the variant's roles, an optional projection
|
|
19
|
+
* from the raw host map, the accent, the pinned terminal palette, the surface alpha,
|
|
20
|
+
* then `transformTokens`.
|
|
20
21
|
*
|
|
21
22
|
* The accent is applied *here* rather than left to the `[data-accent]` blocks in
|
|
22
23
|
* `theme.css`, because the properties are written inline and an inline declaration
|
|
@@ -25,8 +26,17 @@ function stylesheetOverrides(engine, variant, editorRoles) {
|
|
|
25
26
|
* they cannot win from here, so leaving the accent to them meant the attribute was
|
|
26
27
|
* set, the rules were present, and nothing changed on screen.
|
|
27
28
|
*/
|
|
28
|
-
function
|
|
29
|
+
function themeDocumentTokens(engine, state, options = {}) {
|
|
30
|
+
assertThemeTokenProjectionConfig(options.tokenProjection);
|
|
29
31
|
const properties = options.palette === "stylesheet" && engine.isCatalogueVariant(state.variant) ? stylesheetOverrides(engine, state.variant, options.editorRoles) : { ...engine.themeCssVariables(state.variant, { editor: options.editorRoles }) };
|
|
32
|
+
if (options.tokenProjection && !engine.isCatalogueVariant(state.variant)) {
|
|
33
|
+
const rawTokens = state.variant.tokens ?? {};
|
|
34
|
+
const projected = options.tokenProjection.project(rawTokens, options.tokenProjection.rules);
|
|
35
|
+
for (const rule of options.tokenProjection.rules) {
|
|
36
|
+
if (!rule || typeof rule.target !== "string") continue;
|
|
37
|
+
if (Object.hasOwn(projected, rule.target)) properties[rule.target] = projected[rule.target];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
30
40
|
const accent = engine.accentVariables(state.selection.accent, state.appearance, state.selection, {
|
|
31
41
|
background: state.variant.colors.background,
|
|
32
42
|
floor: options.accentContrastFloor,
|
|
@@ -49,8 +59,8 @@ function themeDocumentTokensWith(engine, state, options = {}) {
|
|
|
49
59
|
* `tokens` the catalogue does not, which would otherwise stay inline, beating the
|
|
50
60
|
* stylesheet, after the user switched away from it.
|
|
51
61
|
*/
|
|
52
|
-
function
|
|
53
|
-
const { tokens, accented } =
|
|
62
|
+
function applyThemeToRoot(engine, root, state, options = {}, previous) {
|
|
63
|
+
const { tokens, accented } = themeDocumentTokens(engine, state, options);
|
|
54
64
|
for (const [name, value] of Object.entries(tokens)) root.style.setProperty(name, value);
|
|
55
65
|
if (previous) {
|
|
56
66
|
for (const name of previous) if (!(name in tokens)) root.style.removeProperty(name);
|
|
@@ -112,6 +122,6 @@ function defaultSchedule(callback) {
|
|
|
112
122
|
if (typeof requestAnimationFrame === "function") requestAnimationFrame(callback);
|
|
113
123
|
else callback();
|
|
114
124
|
}
|
|
115
|
-
export {
|
|
125
|
+
export { applyThemeToRoot, applyWithoutTransitions, themeDocumentTokens };
|
|
116
126
|
|
|
117
|
-
//# sourceMappingURL=theme-document
|
|
127
|
+
//# sourceMappingURL=theme-document.js.map
|