@adea-ai/ui 0.153.0 → 0.154.1
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/README.md +10 -10
- package/dist/NOTICE +10 -1
- package/dist/components/composites/about-dialog/about-dialog.d.ts.map +1 -1
- package/dist/components/composites/about-dialog/about-dialog.js +3 -1
- package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
- package/dist/components/composites/accent-picker/accent-picker.js +20 -9
- package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
- package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +20 -10
- 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 +37 -24
- package/dist/components/composites/action-button/action-button.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 +7 -3
- 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 +11 -6
- 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 +8 -3
- 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 +8 -4
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.js +7 -3
- package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js +8 -4
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- 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 +3 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
- package/dist/components/composites/chat/chat.d.ts.map +1 -1
- package/dist/components/composites/chat/chat.js +5 -1
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.d.ts.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.js +3 -1
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.d.ts.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js +11 -5
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context.d.ts.map +1 -1
- package/dist/components/composites/context/context.js +7 -4
- package/dist/components/composites/context/context.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -1
- package/dist/components/composites/file-tree/file-tree.js +7 -3
- package/dist/components/composites/file-tree/file-tree.js.map +1 -1
- package/dist/components/composites/help-center/help-center.d.ts.map +1 -1
- package/dist/components/composites/help-center/help-center.js +3 -1
- package/dist/components/composites/help-center/help-center.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.d.ts +2 -2
- package/dist/components/composites/icon-picker/icon-picker.d.ts.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js +77 -71
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/icon-picker/shell-icons.d.ts.map +1 -1
- package/dist/components/composites/icon-picker/shell-icons.js +119 -59
- package/dist/components/composites/icon-picker/shell-icons.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 +5 -2
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.d.ts.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js +3 -4
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.d.ts.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js +5 -2
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.d.ts +15 -1
- package/dist/components/composites/model-selector/model-selector.d.ts.map +1 -1
- package/dist/components/composites/model-selector/model-selector.js +271 -33
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/plan/plan.d.ts.map +1 -1
- package/dist/components/composites/plan/plan.js +3 -1
- package/dist/components/composites/plan/plan.js.map +1 -1
- package/dist/components/composites/queue/queue.d.ts.map +1 -1
- package/dist/components/composites/queue/queue.js +11 -5
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/reasoning.d.ts.map +1 -1
- package/dist/components/composites/reasoning/reasoning.js +3 -1
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.d.ts.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.js +14 -7
- package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
- package/dist/components/composites/settings/settings.d.ts.map +1 -1
- package/dist/components/composites/settings/settings.js +77 -67
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/sources/sources.d.ts.map +1 -1
- package/dist/components/composites/sources/sources.js +39 -39
- 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 +9 -4
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/stat/stat.d.ts.map +1 -1
- package/dist/components/composites/stat/stat.js +4 -1
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/subagent/subagent.d.ts.map +1 -1
- package/dist/components/composites/subagent/subagent.js +3 -1
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/task/task.d.ts.map +1 -1
- package/dist/components/composites/task/task.js +3 -1
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/ansi.d.ts.map +1 -1
- package/dist/components/composites/terminal/ansi.js +16 -0
- package/dist/components/composites/terminal/ansi.js.map +1 -1
- package/dist/components/composites/terminal/terminal.d.ts.map +1 -1
- package/dist/components/composites/terminal/terminal.js +15 -7
- 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 +15 -7
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.d.ts.map +1 -1
- package/dist/components/composites/tool/tool.js +3 -1
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree.d.ts.map +1 -1
- package/dist/components/composites/tree/tree.js +3 -1
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +34 -24
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.d.ts.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js +17 -12
- 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 +5 -2
- 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 +9 -4
- package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
- package/dist/components/conversation/busy-send-button.d.ts.map +1 -1
- package/dist/components/conversation/busy-send-button.js +9 -5
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/conversation-avatar.d.ts.map +1 -1
- package/dist/components/conversation/conversation-avatar.js +6 -3
- package/dist/components/conversation/conversation-avatar.js.map +1 -1
- package/dist/components/conversation/conversation-surface.d.ts.map +1 -1
- package/dist/components/conversation/conversation-surface.js +3 -1
- package/dist/components/conversation/conversation-surface.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 +9 -4
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.d.ts.map +1 -1
- package/dist/components/conversation/message-composer.js +9 -4
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/message-row.d.ts.map +1 -1
- package/dist/components/conversation/message-row.js +11 -5
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/thread-panel.d.ts.map +1 -1
- package/dist/components/conversation/thread-panel.js +3 -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 +3 -1
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/layout/floating-preview/floating-preview.d.ts.map +1 -1
- package/dist/components/layout/floating-preview/floating-preview.js +5 -2
- package/dist/components/layout/floating-preview/floating-preview.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 +3 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.d.ts.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.js +3 -1
- package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js +46 -42
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +3 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.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 +5 -2
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +16 -13
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/theme/appearance-panel.d.ts.map +1 -1
- package/dist/components/theme/appearance-panel.js +3 -1
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/theme-mode-toggle.d.ts.map +1 -1
- package/dist/components/theme/theme-mode-toggle.js +6 -3
- package/dist/components/theme/theme-mode-toggle.js.map +1 -1
- package/dist/components/theme/theme-toggle.d.ts.map +1 -1
- package/dist/components/theme/theme-toggle.js +6 -3
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/accordion/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion/accordion.js +3 -1
- package/dist/components/ui/accordion/accordion.js.map +1 -1
- package/dist/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/components/ui/alert/alert.js +15 -9
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.d.ts.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js +5 -4
- package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
- package/dist/components/ui/attachment/attachment.d.ts.map +1 -1
- package/dist/components/ui/attachment/attachment.js +18 -9
- package/dist/components/ui/attachment/attachment.js.map +1 -1
- package/dist/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.js +30 -11
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js +5 -2
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/button/button.js +37 -13
- package/dist/components/ui/button/button.js.map +1 -1
- package/dist/components/ui/calendar/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar/calendar.js +5 -2
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/carousel/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel/carousel.js +12 -6
- package/dist/components/ui/carousel/carousel.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts +13 -0
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +296 -21
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
- package/dist/components/ui/code-block/code-block.js +9 -6
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.js +8 -11
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/command/command.d.ts.map +1 -1
- package/dist/components/ui/command/command.js +4 -2
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.d.ts.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.js +3 -1
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.js +10 -10
- package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.js +3 -1
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.js +7 -3
- package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
- package/dist/components/ui/empty/empty-state.d.ts.map +1 -1
- package/dist/components/ui/empty/empty-state.js +3 -1
- package/dist/components/ui/empty/empty-state.js.map +1 -1
- package/dist/components/ui/field/field.d.ts.map +1 -1
- package/dist/components/ui/field/field.js +12 -6
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/input/input-control.d.ts +2 -0
- package/dist/components/ui/input/input-control.d.ts.map +1 -1
- package/dist/components/ui/input/input-control.js +24 -6
- package/dist/components/ui/input/input-control.js.map +1 -1
- package/dist/components/ui/input/input.d.ts.map +1 -1
- package/dist/components/ui/input/input.js +47 -48
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/input-group/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group/input-group.js +1 -8
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/kbd/kbd.d.ts +23 -10
- package/dist/components/ui/kbd/kbd.d.ts.map +1 -1
- package/dist/components/ui/kbd/kbd.js +42 -11
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/components/ui/message/index.d.ts +1 -1
- package/dist/components/ui/message/index.d.ts.map +1 -1
- package/dist/components/ui/message/index.js +2 -2
- package/dist/components/ui/message/message.d.ts.map +1 -1
- package/dist/components/ui/message/message.js +5 -3
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/message/parse-message-text.d.ts +32 -0
- package/dist/components/ui/message/parse-message-text.d.ts.map +1 -1
- package/dist/components/ui/message/parse-message-text.js +63 -3
- package/dist/components/ui/message/parse-message-text.js.map +1 -1
- package/dist/components/ui/native-select/native-select.d.ts.map +1 -1
- package/dist/components/ui/native-select/native-select.js +4 -9
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js +3 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination/pagination.js +7 -3
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.d.ts.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js +9 -4
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js +4 -9
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/resizable/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable/resizable.js +3 -1
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/select/select.d.ts.map +1 -1
- package/dist/components/ui/select/select.js +7 -3
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet/sheet.js +3 -1
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/spinner/spinner.d.ts.map +1 -1
- package/dist/components/ui/spinner/spinner.js +3 -1
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js +35 -30
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/components/ui/switch/switch.d.ts +7 -0
- package/dist/components/ui/switch/switch.d.ts.map +1 -1
- package/dist/components/ui/switch/switch.js +255 -17
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea/textarea.js +1 -8
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.d.ts.map +1 -1
- package/dist/components/ui/toast/toast.js +3 -1
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.js +10 -4
- package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
- package/dist/components/ui/tooltip/index.d.ts +1 -0
- package/dist/components/ui/tooltip/index.d.ts.map +1 -1
- package/dist/components/ui/tooltip/index.js +2 -1
- package/dist/components/ui/tooltip/lazy-tooltip.d.ts +40 -0
- package/dist/components/ui/tooltip/lazy-tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip/lazy-tooltip.js +61 -0
- package/dist/components/ui/tooltip/lazy-tooltip.js.map +1 -0
- package/dist/components/ui/trace/trace.d.ts.map +1 -1
- package/dist/components/ui/trace/trace.js +82 -68
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/components/ui/typography/typography.d.ts +1 -1
- package/dist/components/ui/typography/typography.d.ts.map +1 -1
- package/dist/components/ui/typography/typography.js +5 -6
- package/dist/components/ui/typography/typography.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/lib/clipboard.d.ts.map +1 -1
- package/dist/lib/clipboard.js +3 -0
- package/dist/lib/clipboard.js.map +1 -1
- package/dist/lib/fast-icon.d.ts +18 -0
- package/dist/lib/fast-icon.d.ts.map +1 -0
- package/dist/lib/fast-icon.js +75 -0
- package/dist/lib/fast-icon.js.map +1 -0
- package/dist/lib/form-field.d.ts +1 -1
- package/dist/lib/form-field.js +3 -1
- package/dist/lib/form-field.js.map +1 -1
- package/dist/lib/observe-resize.d.ts +14 -0
- package/dist/lib/observe-resize.d.ts.map +1 -0
- package/dist/lib/observe-resize.js +19 -0
- package/dist/lib/observe-resize.js.map +1 -0
- package/dist/lib/overlay.d.ts +1 -1
- package/dist/lib/overlay.d.ts.map +1 -1
- package/dist/lib/overlay.js +1 -1
- package/dist/lib/overlay.js.map +1 -1
- package/dist/lint/index.d.ts +1 -0
- package/dist/lint/index.d.ts.map +1 -1
- package/dist/lint.js +251 -118
- package/dist/lint.js.map +1 -1
- package/dist/r/action-button.json +3 -1
- package/dist/r/floating-preview.json +2 -1
- package/dist/r/icon-picker.json +0 -1
- package/dist/r/lib.json +10 -0
- package/dist/r/model-selector.json +1 -0
- package/dist/r/plan.json +2 -1
- package/dist/r/queue.json +2 -1
- package/dist/r/registry.json +33 -9
- package/dist/r/scene-controls.json +2 -1
- package/dist/r/side-rail.json +1 -0
- package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +5 -1
- package/dist/r/src/components/composites/accent-picker/accent-picker.tsx +22 -17
- package/dist/r/src/components/composites/account-menu/account-menu.tsx +21 -9
- package/dist/r/src/components/composites/action-button/action-button.tsx +38 -21
- package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
- package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
- package/dist/r/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
- package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
- package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
- package/dist/r/src/components/composites/chat/chat.tsx +11 -1
- package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +5 -1
- package/dist/r/src/components/composites/confirmation/confirmation.tsx +15 -1
- package/dist/r/src/components/composites/context/context.tsx +9 -1
- package/dist/r/src/components/composites/file-tree/file-tree.tsx +11 -1
- package/dist/r/src/components/composites/help-center/help-center.tsx +5 -1
- package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +59 -31
- package/dist/r/src/components/composites/icon-picker/shell-icons.ts +121 -59
- package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +6 -1
- package/dist/r/src/components/composites/list-row/list-row-control.tsx +7 -5
- package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +6 -1
- package/dist/r/src/components/composites/model-selector/model-selector.tsx +197 -11
- package/dist/r/src/components/composites/plan/plan.tsx +5 -1
- package/dist/r/src/components/composites/queue/queue.tsx +15 -1
- package/dist/r/src/components/composites/reasoning/reasoning.tsx +5 -1
- package/dist/r/src/components/composites/scene-controls/scene-controls.tsx +17 -1
- package/dist/r/src/components/composites/settings/settings.tsx +23 -14
- package/dist/r/src/components/composites/sources/sources.tsx +27 -20
- package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +13 -1
- package/dist/r/src/components/composites/stat/stat.tsx +9 -1
- package/dist/r/src/components/composites/subagent/subagent.tsx +5 -1
- package/dist/r/src/components/composites/task/task.tsx +5 -1
- package/dist/r/src/components/composites/terminal/ansi.ts +18 -0
- package/dist/r/src/components/composites/terminal/terminal.tsx +17 -7
- package/dist/r/src/components/composites/test-results/test-results.tsx +17 -7
- package/dist/r/src/components/composites/tool/tool.tsx +5 -1
- package/dist/r/src/components/composites/tree/tree.tsx +5 -1
- package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +35 -15
- package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
- package/dist/r/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
- package/dist/r/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
- package/dist/r/src/components/conversation/busy-send-button.tsx +11 -1
- package/dist/r/src/components/conversation/conversation-avatar.tsx +7 -1
- package/dist/r/src/components/conversation/conversation-surface.tsx +5 -1
- package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
- package/dist/r/src/components/conversation/message-composer.tsx +13 -1
- package/dist/r/src/components/conversation/message-row.tsx +15 -1
- package/dist/r/src/components/conversation/thread-panel.tsx +5 -1
- package/dist/r/src/components/conversation/transcript-composition.tsx +5 -1
- package/dist/r/src/components/layout/floating-preview/floating-preview.tsx +6 -1
- package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
- package/dist/r/src/components/layout/shell-rail/shell-rail.tsx +5 -1
- package/dist/r/src/components/layout/side-rail/side-rail.tsx +16 -19
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +6 -1
- package/dist/r/src/components/layout/top-bar/top-bar.tsx +8 -8
- package/dist/r/src/components/theme/appearance-panel.tsx +6 -1
- package/dist/r/src/components/theme/theme-mode-toggle.tsx +7 -1
- package/dist/r/src/components/theme/theme-toggle.tsx +7 -1
- package/dist/r/src/components/ui/accordion/accordion.tsx +5 -1
- package/dist/r/src/components/ui/alert/alert.tsx +20 -3
- package/dist/r/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
- package/dist/r/src/components/ui/attachment/attachment.tsx +19 -8
- package/dist/r/src/components/ui/badge/badge.tsx +24 -8
- package/dist/r/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
- package/dist/r/src/components/ui/button/button.tsx +47 -16
- package/dist/r/src/components/ui/calendar/calendar.tsx +6 -1
- package/dist/r/src/components/ui/carousel/carousel.tsx +15 -5
- package/dist/r/src/components/ui/checkbox/checkbox.tsx +260 -22
- package/dist/r/src/components/ui/code-block/code-block.tsx +11 -5
- package/dist/r/src/components/ui/combobox/combobox.tsx +8 -9
- package/dist/r/src/components/ui/command/command.tsx +8 -4
- package/dist/r/src/components/ui/detail-panel/detail-panel.tsx +5 -1
- package/dist/r/src/components/ui/dialog/dialog-layer.tsx +16 -18
- package/dist/r/src/components/ui/dialog/dialog.tsx +5 -1
- package/dist/r/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
- package/dist/r/src/components/ui/empty/empty-state.tsx +5 -1
- package/dist/r/src/components/ui/field/field.tsx +14 -5
- package/dist/r/src/components/ui/input/input-control.tsx +28 -19
- package/dist/r/src/components/ui/input/input.tsx +9 -12
- package/dist/r/src/components/ui/input-group/input-group.tsx +1 -8
- package/dist/r/src/components/ui/kbd/kbd.tsx +53 -12
- package/dist/r/src/components/ui/message/index.ts +3 -0
- package/dist/r/src/components/ui/message/message.tsx +11 -2
- package/dist/r/src/components/ui/message/parse-message-text.ts +94 -2
- package/dist/r/src/components/ui/native-select/native-select.tsx +6 -9
- package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
- package/dist/r/src/components/ui/pagination/pagination.tsx +11 -1
- package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +13 -1
- package/dist/r/src/components/ui/radio-group/radio-group.tsx +6 -9
- package/dist/r/src/components/ui/resizable/resizable.tsx +5 -1
- package/dist/r/src/components/ui/select/select.tsx +11 -1
- package/dist/r/src/components/ui/sheet/sheet.tsx +5 -1
- package/dist/r/src/components/ui/spinner/spinner.tsx +5 -1
- package/dist/r/src/components/ui/status-chip/status-chip.tsx +14 -7
- package/dist/r/src/components/ui/switch/switch.tsx +235 -28
- package/dist/r/src/components/ui/textarea/textarea.tsx +1 -8
- package/dist/r/src/components/ui/toast/toast.tsx +5 -1
- package/dist/r/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
- package/dist/r/src/components/ui/tooltip/index.ts +1 -0
- package/dist/r/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
- package/dist/r/src/components/ui/trace/trace.tsx +61 -28
- package/dist/r/src/components/ui/typography/typography.tsx +6 -5
- package/dist/r/src/lib/clipboard.ts +4 -0
- package/dist/r/src/lib/fast-icon.ts +88 -0
- package/dist/r/src/lib/form-field.ts +7 -7
- package/dist/r/src/lib/observe-resize.ts +28 -0
- package/dist/r/src/lib/overlay.ts +1 -1
- package/dist/r/subagent.json +2 -1
- package/dist/r/tool.json +2 -1
- package/dist/r/tooltip.json +5 -0
- package/dist/r/top-bar.json +1 -0
- package/dist/r/trace.json +0 -1
- package/package.json +1 -1
- package/registry.json +33 -9
- package/src/components/composites/about-dialog/about-dialog.tsx +5 -1
- package/src/components/composites/accent-picker/accent-picker.tsx +22 -17
- package/src/components/composites/account-menu/account-menu.tsx +21 -9
- package/src/components/composites/action-button/action-button.tsx +38 -21
- package/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
- package/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
- package/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
- package/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
- package/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
- package/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
- package/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
- package/src/components/composites/chat/chat.tsx +11 -1
- package/src/components/composites/checkpoint/checkpoint.tsx +5 -1
- package/src/components/composites/confirmation/confirmation.tsx +15 -1
- package/src/components/composites/context/context.tsx +9 -1
- package/src/components/composites/file-tree/file-tree.tsx +11 -1
- package/src/components/composites/help-center/help-center.tsx +5 -1
- package/src/components/composites/icon-picker/icon-picker.tsx +59 -31
- package/src/components/composites/icon-picker/shell-icons.ts +121 -59
- package/src/components/composites/inline-citation/inline-citation.tsx +6 -1
- package/src/components/composites/list-row/list-row-control.tsx +7 -5
- package/src/components/composites/message-scroller/message-scroller.tsx +6 -1
- package/src/components/composites/model-selector/model-selector.tsx +197 -11
- package/src/components/composites/plan/plan.tsx +5 -1
- package/src/components/composites/queue/queue.tsx +15 -1
- package/src/components/composites/reasoning/reasoning.tsx +5 -1
- package/src/components/composites/scene-controls/scene-controls.tsx +17 -1
- package/src/components/composites/settings/settings.tsx +23 -14
- package/src/components/composites/sources/sources.tsx +27 -20
- package/src/components/composites/stack-trace/stack-trace.tsx +13 -1
- package/src/components/composites/stat/stat.tsx +9 -1
- package/src/components/composites/subagent/subagent.tsx +5 -1
- package/src/components/composites/task/task.tsx +5 -1
- package/src/components/composites/terminal/ansi.ts +18 -0
- package/src/components/composites/terminal/terminal.tsx +17 -7
- package/src/components/composites/test-results/test-results.tsx +17 -7
- package/src/components/composites/tool/tool.tsx +5 -1
- package/src/components/composites/tree/tree.tsx +5 -1
- package/src/components/composites/update-dialog/update-dialog.tsx +35 -15
- package/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
- package/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
- package/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
- package/src/components/conversation/busy-send-button.tsx +11 -1
- package/src/components/conversation/conversation-avatar.tsx +7 -1
- package/src/components/conversation/conversation-surface.tsx +5 -1
- package/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
- package/src/components/conversation/message-composer.tsx +13 -1
- package/src/components/conversation/message-row.tsx +15 -1
- package/src/components/conversation/thread-panel.tsx +5 -1
- package/src/components/conversation/transcript-composition.tsx +5 -1
- package/src/components/layout/floating-preview/floating-preview.tsx +6 -1
- package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
- package/src/components/layout/shell-rail/shell-rail.tsx +5 -1
- package/src/components/layout/side-rail/side-rail.tsx +16 -19
- package/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
- package/src/components/layout/split-layout/split-layout.tsx +6 -1
- package/src/components/layout/top-bar/top-bar.tsx +8 -8
- package/src/components/theme/appearance-panel.tsx +6 -1
- package/src/components/theme/theme-mode-toggle.tsx +7 -1
- package/src/components/theme/theme-toggle.tsx +7 -1
- package/src/components/ui/accordion/accordion.tsx +5 -1
- package/src/components/ui/alert/alert.tsx +20 -3
- package/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
- package/src/components/ui/attachment/attachment.tsx +19 -8
- package/src/components/ui/badge/badge.tsx +24 -8
- package/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
- package/src/components/ui/button/button.tsx +47 -16
- package/src/components/ui/calendar/calendar.tsx +6 -1
- package/src/components/ui/carousel/carousel.tsx +15 -5
- package/src/components/ui/checkbox/checkbox.tsx +260 -22
- package/src/components/ui/code-block/code-block.tsx +11 -5
- package/src/components/ui/combobox/combobox.tsx +8 -9
- package/src/components/ui/command/command.tsx +8 -4
- package/src/components/ui/detail-panel/detail-panel.tsx +5 -1
- package/src/components/ui/dialog/dialog-layer.tsx +16 -18
- package/src/components/ui/dialog/dialog.tsx +5 -1
- package/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
- package/src/components/ui/empty/empty-state.tsx +5 -1
- package/src/components/ui/field/field.tsx +14 -5
- package/src/components/ui/input/input-control.tsx +28 -19
- package/src/components/ui/input/input.tsx +9 -12
- package/src/components/ui/input-group/input-group.tsx +1 -8
- package/src/components/ui/kbd/kbd.tsx +53 -12
- package/src/components/ui/message/index.ts +3 -0
- package/src/components/ui/message/message.tsx +11 -2
- package/src/components/ui/message/parse-message-text.ts +94 -2
- package/src/components/ui/native-select/native-select.tsx +6 -9
- package/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
- package/src/components/ui/pagination/pagination.tsx +11 -1
- package/src/components/ui/questionnaire/questionnaire.tsx +13 -1
- package/src/components/ui/radio-group/radio-group.tsx +6 -9
- package/src/components/ui/resizable/resizable.tsx +5 -1
- package/src/components/ui/select/select.tsx +11 -1
- package/src/components/ui/sheet/sheet.tsx +5 -1
- package/src/components/ui/spinner/spinner.tsx +5 -1
- package/src/components/ui/status-chip/status-chip.tsx +14 -7
- package/src/components/ui/switch/switch.tsx +235 -28
- package/src/components/ui/textarea/textarea.tsx +1 -8
- package/src/components/ui/toast/toast.tsx +5 -1
- package/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
- package/src/components/ui/tooltip/index.ts +1 -0
- package/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
- package/src/components/ui/trace/trace.tsx +61 -28
- package/src/components/ui/typography/typography.tsx +6 -5
- package/src/lib/clipboard.ts +4 -0
- package/src/lib/fast-icon.ts +88 -0
- package/src/lib/form-field.ts +7 -7
- package/src/lib/observe-resize.ts +28 -0
- package/src/lib/overlay.ts +1 -1
- package/src/lint/index.ts +199 -0
|
@@ -11,11 +11,17 @@ import {
|
|
|
11
11
|
type ComponentProps,
|
|
12
12
|
type JSX,
|
|
13
13
|
} from 'solid-js'
|
|
14
|
-
import { Check, Copy } from 'lucide-solid'
|
|
14
|
+
import { Check as LucideCheck, Copy as LucideCopy } from 'lucide-solid'
|
|
15
15
|
import { createCopyFeedback } from '#lib/clipboard'
|
|
16
|
+
import { observeResize } from '#lib/observe-resize'
|
|
16
17
|
import { cn } from '#lib/utils'
|
|
17
18
|
import { ActionButton } from '../../composites/action-button'
|
|
18
19
|
import { Button } from '../button'
|
|
20
|
+
import { fastIcon } from '#lib/fast-icon'
|
|
21
|
+
|
|
22
|
+
// lucide icons drawn from a cloned template (see fastIcon).
|
|
23
|
+
const Check = fastIcon(LucideCheck)
|
|
24
|
+
const Copy = fastIcon(LucideCopy)
|
|
19
25
|
|
|
20
26
|
/**
|
|
21
27
|
* CodeBlock.
|
|
@@ -275,17 +281,17 @@ export function CodeBlock(props: CodeBlockProps) {
|
|
|
275
281
|
// it as an uncaught "loop completed with undelivered notifications" error).
|
|
276
282
|
// The footer's own height is left out of the measure for the same reason: a
|
|
277
283
|
// block is tall by its content, not by the row that tallness adds.
|
|
278
|
-
|
|
284
|
+
// One observer is shared by every block (see observeResize).
|
|
285
|
+
const measure = () => {
|
|
279
286
|
const footer = element.querySelector<HTMLElement>('[data-code-block-footer]')
|
|
280
287
|
setTall(
|
|
281
288
|
element.offsetHeight - (footer?.offsetHeight ?? 0) >
|
|
282
289
|
(local.tallThreshold ?? TALL_CODE_BLOCK_PX)
|
|
283
290
|
)
|
|
284
|
-
}
|
|
291
|
+
}
|
|
285
292
|
onMount(() => {
|
|
286
|
-
if (bodyElement)
|
|
293
|
+
if (bodyElement) onCleanup(observeResize(bodyElement, measure))
|
|
287
294
|
})
|
|
288
|
-
onCleanup(() => observer.disconnect())
|
|
289
295
|
}}
|
|
290
296
|
>
|
|
291
297
|
<div
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { Combobox as KobalteCombobox } from '@kobalte/core/combobox'
|
|
2
|
-
import { Check, ChevronDown, X } from 'lucide-solid'
|
|
2
|
+
import { Check as LucideCheck, ChevronDown as LucideChevronDown, X as LucideX } from 'lucide-solid'
|
|
3
3
|
import type { ComponentProps } from 'solid-js'
|
|
4
4
|
import { Show, splitProps } from 'solid-js'
|
|
5
5
|
import { menuContentPadding, menuItem, popoverArrow, topLayerProps } from '#lib/overlay'
|
|
6
6
|
import { useFormFieldControl } from '#lib/form-field'
|
|
7
7
|
import { cn } from '#lib/utils'
|
|
8
|
+
import { fastIcon } from '#lib/fast-icon'
|
|
9
|
+
|
|
10
|
+
// lucide icons drawn from a cloned template (see fastIcon).
|
|
11
|
+
const Check = fastIcon(LucideCheck)
|
|
12
|
+
const ChevronDown = fastIcon(LucideChevronDown)
|
|
13
|
+
const X = fastIcon(LucideX)
|
|
8
14
|
|
|
9
15
|
/**
|
|
10
16
|
* Combobox.
|
|
@@ -53,14 +59,7 @@ export function ComboboxInput(props: ComponentProps<typeof KobalteCombobox.Input
|
|
|
53
59
|
'aria-invalid',
|
|
54
60
|
'aria-errormessage',
|
|
55
61
|
])
|
|
56
|
-
const field = useFormFieldControl('control',
|
|
57
|
-
id: local.id,
|
|
58
|
-
'aria-label': local['aria-label'],
|
|
59
|
-
'aria-labelledby': local['aria-labelledby'],
|
|
60
|
-
'aria-describedby': local['aria-describedby'],
|
|
61
|
-
'aria-invalid': local['aria-invalid'],
|
|
62
|
-
'aria-errormessage': local['aria-errormessage'],
|
|
63
|
-
})
|
|
62
|
+
const field = useFormFieldControl('control', local)
|
|
64
63
|
|
|
65
64
|
return (
|
|
66
65
|
<KobalteCombobox.Input
|
|
@@ -11,12 +11,16 @@ import {
|
|
|
11
11
|
useCommandState,
|
|
12
12
|
} from 'cmdk-solid'
|
|
13
13
|
import { Dialog as KobalteDialog } from '@kobalte/core/dialog'
|
|
14
|
-
import { Search } from 'lucide-solid'
|
|
14
|
+
import { Search as LucideSearch } from 'lucide-solid'
|
|
15
15
|
import type { ComponentProps } from 'solid-js'
|
|
16
16
|
import { createEffect, createSignal, splitProps } from 'solid-js'
|
|
17
17
|
import { createDialogLayer } from '../dialog/dialog-layer'
|
|
18
18
|
import { menuItem, menuShortcut, overlaySurface, overlayZoom } from '#lib/overlay'
|
|
19
19
|
import { cn } from '#lib/utils'
|
|
20
|
+
import { fastIcon } from '#lib/fast-icon'
|
|
21
|
+
|
|
22
|
+
// lucide icons drawn from a cloned template (see fastIcon).
|
|
23
|
+
const Search = fastIcon(LucideSearch)
|
|
20
24
|
|
|
21
25
|
// cmdk emits data-disabled="false" on enabled items, unlike the presence-only
|
|
22
26
|
// attributes Kobalte menu rows use. Apply those shared disabled styles only when
|
|
@@ -181,9 +185,9 @@ export function CommandList(props: ComponentProps<typeof CmdkList>) {
|
|
|
181
185
|
createEffect(() => {
|
|
182
186
|
const root = wrapper()
|
|
183
187
|
if (!root) return
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
188
|
+
// Every separator, not the first: a palette with three groups has two.
|
|
189
|
+
for (const node of root.querySelectorAll('[cmdk-list-sizer], [cmdk-separator]'))
|
|
190
|
+
node.setAttribute('role', 'presentation')
|
|
187
191
|
|
|
188
192
|
/*
|
|
189
193
|
* A `listbox` must own at least one `option`, so a listbox with nothing in it
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { createUniqueId, Show, splitProps, type ComponentProps, type JSX } from 'solid-js'
|
|
2
|
-
import { X } from 'lucide-solid'
|
|
2
|
+
import { X as LucideX } from 'lucide-solid'
|
|
3
3
|
import { Button } from '../button'
|
|
4
4
|
import { cn } from '#lib/utils'
|
|
5
|
+
import { fastIcon } from '#lib/fast-icon'
|
|
6
|
+
|
|
7
|
+
// lucide icons drawn from a cloned template (see fastIcon).
|
|
8
|
+
const X = fastIcon(LucideX)
|
|
5
9
|
|
|
6
10
|
/**
|
|
7
11
|
* DetailPanel.
|
|
@@ -34,8 +34,8 @@ type FocusCycle = {
|
|
|
34
34
|
closed: boolean
|
|
35
35
|
focusMovedOutside: boolean
|
|
36
36
|
closeAutoFocusScheduled: boolean
|
|
37
|
-
/**
|
|
38
|
-
|
|
37
|
+
/** Restore frames that found the opener still hidden; see FOCUS_RESTORE_FRAME_BUDGET. */
|
|
38
|
+
hiddenFrames: number
|
|
39
39
|
frame?: number
|
|
40
40
|
fallbackTimer?: number
|
|
41
41
|
observer?: MutationObserver
|
|
@@ -78,8 +78,13 @@ function anotherLayerOpen(content: HTMLElement, opener: HTMLElement): boolean {
|
|
|
78
78
|
* The focus-return half of the layer rules, for a layer whose open state is
|
|
79
79
|
* `open`. Returns the autofocus handlers to give the Kobalte content.
|
|
80
80
|
*/
|
|
81
|
-
/**
|
|
82
|
-
|
|
81
|
+
/**
|
|
82
|
+
* How many restore frames a closed layer may spend on an opener that is still
|
|
83
|
+
* hidden. It counts frames, not time: Kobalte clears its own markers when the
|
|
84
|
+
* overlay finishes unmounting, which on a loaded machine (WebKit in CI) can be
|
|
85
|
+
* well over a second, and a frame count slows down with the page.
|
|
86
|
+
*/
|
|
87
|
+
const FOCUS_RESTORE_FRAME_BUDGET = 120
|
|
83
88
|
|
|
84
89
|
export function createDialogFocusReturn(
|
|
85
90
|
open: Accessor<boolean>,
|
|
@@ -150,7 +155,8 @@ export function createDialogFocusReturn(
|
|
|
150
155
|
// Kobalte removes the `inert` / `aria-hidden` it put on the background
|
|
151
156
|
// only after the layer unmounts; the observer below brings us back here.
|
|
152
157
|
if (opener.closest('[inert], [aria-hidden="true"]')) {
|
|
153
|
-
|
|
158
|
+
cycle.hiddenFrames += 1
|
|
159
|
+
if (cycle.hiddenFrames >= FOCUS_RESTORE_FRAME_BUDGET) finishFocusCycle(cycle)
|
|
154
160
|
return
|
|
155
161
|
}
|
|
156
162
|
if (cycle.openerEligible && canRestoreFocus(opener)) {
|
|
@@ -180,7 +186,7 @@ export function createDialogFocusReturn(
|
|
|
180
186
|
closed: false,
|
|
181
187
|
focusMovedOutside: false,
|
|
182
188
|
closeAutoFocusScheduled: false,
|
|
183
|
-
|
|
189
|
+
hiddenFrames: 0,
|
|
184
190
|
onFocusIn: (focusEvent) => {
|
|
185
191
|
const target = focusEvent.target
|
|
186
192
|
if (
|
|
@@ -231,19 +237,11 @@ export function createDialogFocusReturn(
|
|
|
231
237
|
childList: true,
|
|
232
238
|
subtree: true,
|
|
233
239
|
})
|
|
234
|
-
scheduleFocusRestore(cycle)
|
|
235
240
|
// The observer watches every mutation in the document. If the opener stays
|
|
236
|
-
// under an `inert` or `aria-hidden` that is not this layer's,
|
|
237
|
-
//
|
|
238
|
-
//
|
|
239
|
-
|
|
240
|
-
// or throttled page (WebKit under load) can hold the frame past it.
|
|
241
|
-
cycle.fallbackTimer = window.setTimeout(() => {
|
|
242
|
-
cycle.fallbackTimer = undefined
|
|
243
|
-
cycle.deadlinePassed = true
|
|
244
|
-
cycle.observer?.disconnect()
|
|
245
|
-
if (cycle.frame === undefined) finishFocusCycle(cycle)
|
|
246
|
-
}, FOCUS_RESTORE_DEADLINE_MS)
|
|
241
|
+
// under an `inert` or `aria-hidden` that is not this layer's, a streaming
|
|
242
|
+
// page would schedule a frame per DOM change for good, so the frames that
|
|
243
|
+
// find it hidden are capped. A quiet page schedules none while it waits.
|
|
244
|
+
scheduleFocusRestore(cycle)
|
|
247
245
|
}
|
|
248
246
|
|
|
249
247
|
onCleanup(() => {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
Overlay as KobalteDialogOverlay,
|
|
5
5
|
} from '@kobalte/core/dialog'
|
|
6
6
|
// AlertDialog assigns to the shared DialogRoot.Content object, so these named exports stay role-stable.
|
|
7
|
-
import { X } from 'lucide-solid'
|
|
7
|
+
import { X as LucideX } from 'lucide-solid'
|
|
8
8
|
import type { Accessor, ComponentProps, JSX } from 'solid-js'
|
|
9
9
|
import { children as resolveChildren, Show, splitProps } from 'solid-js'
|
|
10
10
|
import {
|
|
@@ -22,6 +22,10 @@ import {
|
|
|
22
22
|
import { cn } from '#lib/utils'
|
|
23
23
|
import { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip'
|
|
24
24
|
import { createDialogLayer, DialogEscapeTarget } from './dialog-layer'
|
|
25
|
+
import { fastIcon } from '#lib/fast-icon'
|
|
26
|
+
|
|
27
|
+
// lucide icons drawn from a cloned template (see fastIcon).
|
|
28
|
+
const X = fastIcon(LucideX)
|
|
25
29
|
|
|
26
30
|
/**
|
|
27
31
|
* Dialog.
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { DropdownMenu as KobalteDropdownMenu } from '@kobalte/core/dropdown-menu'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Check as LucideCheck,
|
|
4
|
+
ChevronRight as LucideChevronRight,
|
|
5
|
+
Circle as LucideCircle,
|
|
6
|
+
} from 'lucide-solid'
|
|
3
7
|
import type { ComponentProps } from 'solid-js'
|
|
4
8
|
import { Show, splitProps } from 'solid-js'
|
|
5
9
|
import {
|
|
@@ -16,6 +20,12 @@ import {
|
|
|
16
20
|
type MenuSwatchTone,
|
|
17
21
|
} from '#lib/overlay'
|
|
18
22
|
import { cn } from '#lib/utils'
|
|
23
|
+
import { fastIcon } from '#lib/fast-icon'
|
|
24
|
+
|
|
25
|
+
// lucide icons drawn from a cloned template (see fastIcon).
|
|
26
|
+
const Check = fastIcon(LucideCheck)
|
|
27
|
+
const ChevronRight = fastIcon(LucideChevronRight)
|
|
28
|
+
const Circle = fastIcon(LucideCircle)
|
|
19
29
|
|
|
20
30
|
/**
|
|
21
31
|
* The rows and panels every Kobalte menu family draws alike: DropdownMenu,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { Search } from 'lucide-solid'
|
|
1
|
+
import { Search as LucideSearch } from 'lucide-solid'
|
|
2
2
|
import type { ComponentProps, JSX } from 'solid-js'
|
|
3
3
|
import { children as resolveChildren, Show, splitProps } from 'solid-js'
|
|
4
4
|
import { ActionButton } from '../../composites/action-button'
|
|
5
5
|
import { cn } from '#lib/utils'
|
|
6
6
|
import { Spinner } from '../spinner'
|
|
7
7
|
import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from './empty'
|
|
8
|
+
import { fastIcon } from '#lib/fast-icon'
|
|
9
|
+
|
|
10
|
+
// lucide icons drawn from a cloned template (see fastIcon).
|
|
11
|
+
const Search = fastIcon(LucideSearch)
|
|
8
12
|
|
|
9
13
|
type EmptyStateSecondaryAction =
|
|
10
14
|
| {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TextField as KobalteTextField } from '@kobalte/core/text-field'
|
|
2
2
|
import type { ComponentProps, JSX } from 'solid-js'
|
|
3
|
-
import { createUniqueId, Show, splitProps } from 'solid-js'
|
|
3
|
+
import { children as resolveChildren, createUniqueId, Show, splitProps } from 'solid-js'
|
|
4
4
|
import { Label } from '../label'
|
|
5
5
|
import { createFormFieldContext, FormFieldContext } from '#lib/form-field'
|
|
6
6
|
import { cn } from '#lib/utils'
|
|
@@ -91,8 +91,11 @@ export function FormField(props: FormFieldProps) {
|
|
|
91
91
|
</>
|
|
92
92
|
)
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
// Rendered under the provider so the control sees the field context. The control is
|
|
95
|
+
// built once: switching `group` moves the same control between the two layouts.
|
|
96
|
+
const Body = () => {
|
|
97
|
+
const control = resolveChildren(() => local.children)
|
|
98
|
+
return (
|
|
96
99
|
<div class={cn('flex flex-col gap-1.5', local.class)} {...rest}>
|
|
97
100
|
{local.group ? (
|
|
98
101
|
<FieldSet
|
|
@@ -103,7 +106,7 @@ export function FormField(props: FormFieldProps) {
|
|
|
103
106
|
<FieldLegend id={labelId} variant="label">
|
|
104
107
|
{local.label}
|
|
105
108
|
</FieldLegend>
|
|
106
|
-
{
|
|
109
|
+
{control()}
|
|
107
110
|
{help()}
|
|
108
111
|
</FieldSet>
|
|
109
112
|
) : (
|
|
@@ -111,11 +114,17 @@ export function FormField(props: FormFieldProps) {
|
|
|
111
114
|
<Label id={labelId} for={field.controlId()}>
|
|
112
115
|
{local.label}
|
|
113
116
|
</Label>
|
|
114
|
-
{
|
|
117
|
+
{control()}
|
|
115
118
|
{help()}
|
|
116
119
|
</>
|
|
117
120
|
)}
|
|
118
121
|
</div>
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<FormFieldContext.Provider value={field}>
|
|
127
|
+
<Body />
|
|
119
128
|
</FormFieldContext.Provider>
|
|
120
129
|
)
|
|
121
130
|
}
|
|
@@ -17,6 +17,33 @@ export type InputControlProps = Omit<ComponentProps<'input'>, 'size'> & {
|
|
|
17
17
|
size?: 'sm' | 'md' | 'lg'
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
const inputBase = [
|
|
21
|
+
'w-full min-w-0 rounded-md border border-input bg-transparent py-1',
|
|
22
|
+
'transition-[color,box-shadow,border-color] ease-out outline-none',
|
|
23
|
+
'placeholder:text-muted-foreground',
|
|
24
|
+
'selection:bg-primary selection:text-primary-foreground',
|
|
25
|
+
'file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground',
|
|
26
|
+
/* A pointer click on a text field is a typing affordance, so the ring
|
|
27
|
+
appears where the user agent already matches :focus-visible. */
|
|
28
|
+
'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',
|
|
29
|
+
'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',
|
|
30
|
+
'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
31
|
+
'read-only:bg-surface-hover',
|
|
32
|
+
].join(' ')
|
|
33
|
+
|
|
34
|
+
/** Each rung's full class list, merged once rather than on every input. */
|
|
35
|
+
const inputSizeClass = {
|
|
36
|
+
sm: cn(inputBase, 'h-control-sm px-control-sm text-xs'),
|
|
37
|
+
md: cn(inputBase, 'h-control-md px-control-md text-sm'),
|
|
38
|
+
lg: cn(inputBase, 'h-control-lg px-control-lg text-sm'),
|
|
39
|
+
} as const
|
|
40
|
+
|
|
41
|
+
/** The input's class for a rung, with the caller's class merged last. */
|
|
42
|
+
export function inputControlClass(size: InputControlProps['size'], className?: string) {
|
|
43
|
+
const base = inputSizeClass[size ?? 'md']
|
|
44
|
+
return className ? cn(base, className) : base
|
|
45
|
+
}
|
|
46
|
+
|
|
20
47
|
export function InputControl(props: InputControlProps) {
|
|
21
48
|
const [local, rest] = splitProps(props, ['class', 'type', 'size'])
|
|
22
49
|
|
|
@@ -24,25 +51,7 @@ export function InputControl(props: InputControlProps) {
|
|
|
24
51
|
<input
|
|
25
52
|
data-slot="input"
|
|
26
53
|
type={local.type ?? 'text'}
|
|
27
|
-
class={
|
|
28
|
-
'w-full min-w-0 rounded-md border border-input bg-transparent py-1',
|
|
29
|
-
{
|
|
30
|
-
'h-control-sm px-control-sm text-xs': local.size === 'sm',
|
|
31
|
-
'h-control-md px-control-md text-sm': local.size === 'md' || local.size === undefined,
|
|
32
|
-
'h-control-lg px-control-lg text-sm': local.size === 'lg',
|
|
33
|
-
},
|
|
34
|
-
'transition-[color,box-shadow,border-color] ease-out outline-none',
|
|
35
|
-
'placeholder:text-muted-foreground',
|
|
36
|
-
'selection:bg-primary selection:text-primary-foreground',
|
|
37
|
-
'file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground',
|
|
38
|
-
/* A pointer click on a text field is a typing affordance, so the ring
|
|
39
|
-
appears where the user agent already matches :focus-visible. */
|
|
40
|
-
'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',
|
|
41
|
-
'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',
|
|
42
|
-
'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
43
|
-
'read-only:bg-surface-hover',
|
|
44
|
-
local.class
|
|
45
|
-
)}
|
|
54
|
+
class={inputControlClass(local.size, local.class)}
|
|
46
55
|
{...rest}
|
|
47
56
|
/>
|
|
48
57
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createUniqueId, For, Show, splitProps } from 'solid-js'
|
|
2
2
|
import { useFormFieldControl } from '#lib/form-field'
|
|
3
|
-
import {
|
|
3
|
+
import { inputControlClass, type InputControlProps } from './input-control'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Input.
|
|
@@ -24,6 +24,7 @@ export function Input(props: InputProps) {
|
|
|
24
24
|
const [local, rest] = splitProps(props, [
|
|
25
25
|
'class',
|
|
26
26
|
'type',
|
|
27
|
+
'size',
|
|
27
28
|
'id',
|
|
28
29
|
'list',
|
|
29
30
|
'suggestions',
|
|
@@ -33,23 +34,19 @@ export function Input(props: InputProps) {
|
|
|
33
34
|
'aria-invalid',
|
|
34
35
|
'aria-errormessage',
|
|
35
36
|
])
|
|
36
|
-
const field = useFormFieldControl('control',
|
|
37
|
-
id: local.id,
|
|
38
|
-
'aria-label': local['aria-label'],
|
|
39
|
-
'aria-labelledby': local['aria-labelledby'],
|
|
40
|
-
'aria-describedby': local['aria-describedby'],
|
|
41
|
-
'aria-invalid': local['aria-invalid'],
|
|
42
|
-
'aria-errormessage': local['aria-errormessage'],
|
|
43
|
-
})
|
|
37
|
+
const field = useFormFieldControl('control', local)
|
|
44
38
|
const suggestionsId = createUniqueId()
|
|
45
39
|
const listId = () => local.list ?? `input-suggestions-${suggestionsId}`
|
|
46
40
|
|
|
41
|
+
// The input is written here rather than through InputControl: one prop
|
|
42
|
+
// split and one spread instead of two of each.
|
|
47
43
|
return (
|
|
48
44
|
<>
|
|
49
|
-
<
|
|
45
|
+
<input
|
|
46
|
+
data-slot="input"
|
|
50
47
|
{...rest}
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
type={local.type ?? 'text'}
|
|
49
|
+
class={inputControlClass(local.size, local.class)}
|
|
53
50
|
id={field?.id ?? local.id}
|
|
54
51
|
list={local.suggestions ? listId() : local.list}
|
|
55
52
|
aria-label={local['aria-label']}
|
|
@@ -59,14 +59,7 @@ export function InputGroupInput(props: ComponentProps<'input'>) {
|
|
|
59
59
|
'aria-invalid',
|
|
60
60
|
'aria-errormessage',
|
|
61
61
|
])
|
|
62
|
-
const field = useFormFieldControl('control',
|
|
63
|
-
id: local.id,
|
|
64
|
-
'aria-label': local['aria-label'],
|
|
65
|
-
'aria-labelledby': local['aria-labelledby'],
|
|
66
|
-
'aria-describedby': local['aria-describedby'],
|
|
67
|
-
'aria-invalid': local['aria-invalid'],
|
|
68
|
-
'aria-errormessage': local['aria-errormessage'],
|
|
69
|
-
})
|
|
62
|
+
const field = useFormFieldControl('control', local)
|
|
70
63
|
|
|
71
64
|
return (
|
|
72
65
|
<input
|
|
@@ -6,21 +6,28 @@ import { cn } from '#lib/utils'
|
|
|
6
6
|
/**
|
|
7
7
|
* Kbd.
|
|
8
8
|
*
|
|
9
|
-
* A keyboard key,
|
|
10
|
-
* `<kbd>` so the semantics survive copy-paste
|
|
11
|
-
*
|
|
9
|
+
* A keyboard key, ported from shadcn/ui's `Kbd` (MIT, see NOTICE). The element
|
|
10
|
+
* is a real `<kbd>` so the semantics survive copy-paste.
|
|
11
|
+
*
|
|
12
|
+
* The cap is set in the UI face at `text-xs`, as shadcn draws it, not in the
|
|
13
|
+
* code face. Monospace faces carry letters but rarely the modifier glyphs, so
|
|
14
|
+
* a mono `⌘` fell back to another font and sat visibly smaller than the mono
|
|
15
|
+
* `K` beside it. The UI face draws `⌘ ⇧ ⌥ ⌃` and letters as one family, so
|
|
16
|
+
* every cap in a chord reads at the same size.
|
|
12
17
|
*
|
|
13
18
|
* `size="compact"` exists for the dense rows a default cap would outweigh, a
|
|
14
19
|
* rail search row, a sidebar shortcut hint. It drops a height rung, and it
|
|
15
20
|
* lightens the fill and weight with it because at that size a solid muted cap
|
|
16
|
-
* reads heavier than the row text it sits in.
|
|
17
|
-
* cap that is not inside such a row, and it is untouched by the rung.
|
|
21
|
+
* reads heavier than the row text it sits in.
|
|
18
22
|
*
|
|
19
23
|
* `KbdGroup` exists because a shortcut is a sequence: typing `⌘` then `K`
|
|
20
24
|
* needs a gap between them that is a layout concern, not punctuation.
|
|
21
25
|
*/
|
|
22
26
|
export const kbdVariants = cva(
|
|
23
|
-
|
|
27
|
+
[
|
|
28
|
+
'bg-muted text-muted-foreground pointer-events-none inline-flex min-h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none',
|
|
29
|
+
"[&_svg:not([class*='size-'])]:size-3",
|
|
30
|
+
],
|
|
24
31
|
{
|
|
25
32
|
variants: {
|
|
26
33
|
size: {
|
|
@@ -57,6 +64,10 @@ export const kbdGroupVariants = cva('inline-flex items-center gap-1', {
|
|
|
57
64
|
},
|
|
58
65
|
})
|
|
59
66
|
|
|
67
|
+
/**
|
|
68
|
+
* shadcn renders the group as a `<kbd>`; it stays a `<span>` here so a
|
|
69
|
+
* `kbd` selector still finds exactly the caps, which hosts and tests count.
|
|
70
|
+
*/
|
|
60
71
|
export function KbdGroup(props: ComponentProps<'span'> & { size?: KbdSize }) {
|
|
61
72
|
const [local, rest] = splitProps(props, ['size', 'class'])
|
|
62
73
|
|
|
@@ -69,17 +80,47 @@ export function KbdGroup(props: ComponentProps<'span'> & { size?: KbdSize }) {
|
|
|
69
80
|
)
|
|
70
81
|
}
|
|
71
82
|
|
|
83
|
+
/** Key names that are drawn as one word on one cap. */
|
|
84
|
+
const NAMED_KEY =
|
|
85
|
+
/^(?:Ctrl|Control|Alt|Option|Opt|Shift|Cmd|Command|Meta|Super|Win|Fn|Enter|Return|Escape|Esc|Tab|Space|Backspace|Delete|Del|Insert|Home|End|PageUp|PageDown|PgUp|PgDn|Up|Down|Left|Right|F(?:1\d|2[0-4]|[1-9]))/
|
|
86
|
+
|
|
72
87
|
/**
|
|
73
|
-
* Split a written chord into one entry per key cap.
|
|
74
|
-
*
|
|
75
|
-
*
|
|
88
|
+
* Split a written chord into one entry per key cap.
|
|
89
|
+
*
|
|
90
|
+
* - Glyph chords draw one cap per character: `⌘K` is `⌘` + `K`, and `⇧⌘P`
|
|
91
|
+
* stays three caps wide, which matches how the system draws chords in menus.
|
|
92
|
+
* - Spelled-out names stay whole: `CtrlK` is `Ctrl` + `K`, `⇧Enter` is
|
|
93
|
+
* `⇧` + `Enter`.
|
|
94
|
+
* - `+` and spaces separate keys and are not drawn (`Ctrl+K`, `Ctrl Shift P`),
|
|
95
|
+
* except a `+` that is itself the key (`Ctrl++`, `⌘+`).
|
|
76
96
|
*/
|
|
77
97
|
export function kbdChordKeys(keys: string): string[] {
|
|
78
|
-
|
|
98
|
+
const caps: string[] = []
|
|
99
|
+
let rest = keys
|
|
100
|
+
let separated = true
|
|
101
|
+
while (rest.length > 0) {
|
|
102
|
+
const first = rest[0]!
|
|
103
|
+
if (first === ' ' || (first === '+' && !separated && rest.length > 1)) {
|
|
104
|
+
rest = rest.slice(1)
|
|
105
|
+
separated = true
|
|
106
|
+
continue
|
|
107
|
+
}
|
|
108
|
+
const named = NAMED_KEY.exec(rest)?.[0]
|
|
109
|
+
// A name only counts when a lowercase letter does not continue it: `Tab`
|
|
110
|
+
// in `Table` is not a key, so a caller's literal text is drawn as written.
|
|
111
|
+
const cap =
|
|
112
|
+
named && !/^[a-z]/.test(rest.charAt(named.length))
|
|
113
|
+
? named
|
|
114
|
+
: String.fromCodePoint(rest.codePointAt(0)!)
|
|
115
|
+
caps.push(cap)
|
|
116
|
+
rest = rest.slice(cap.length)
|
|
117
|
+
separated = false
|
|
118
|
+
}
|
|
119
|
+
return caps
|
|
79
120
|
}
|
|
80
121
|
|
|
81
122
|
export type KbdChordProps = Omit<ComponentProps<'span'>, 'children'> & {
|
|
82
|
-
/** The chord as it is drawn, e.g. `"⌘K"` or `"
|
|
123
|
+
/** The chord as it is drawn, e.g. `"⌘K"`, `"⇧⌘P"` or `"Ctrl+K"`. See `kbdChordKeys`. */
|
|
83
124
|
keys: string
|
|
84
125
|
size?: KbdSize
|
|
85
126
|
}
|
|
@@ -87,7 +128,7 @@ export type KbdChordProps = Omit<ComponentProps<'span'>, 'children'> & {
|
|
|
87
128
|
/**
|
|
88
129
|
* KbdChord.
|
|
89
130
|
*
|
|
90
|
-
* A written chord drawn as caps, one per
|
|
131
|
+
* A written chord drawn as caps, one per key (see `kbdChordKeys`). Decoration only: the
|
|
91
132
|
* composition renders `aria-hidden`, so the accessible name and the parseable
|
|
92
133
|
* `aria-keyshortcuts` stay on the control the chord belongs to. That is why
|
|
93
134
|
* there is no children, the chord says what was drawn, nothing more.
|
|
@@ -16,8 +16,11 @@ export { placeCitationMarkers, type CitationPlacement, type PlacedCitations } fr
|
|
|
16
16
|
export {
|
|
17
17
|
parseInline,
|
|
18
18
|
parseMessageText,
|
|
19
|
+
parseMessageTextIncremental,
|
|
19
20
|
safeHref,
|
|
20
21
|
type MessageBlock,
|
|
21
22
|
type MessageInline,
|
|
23
|
+
type MessageParse,
|
|
24
|
+
type MessageParseOptions,
|
|
22
25
|
type ParseInlineOptions,
|
|
23
26
|
} from './parse-message-text'
|
|
@@ -11,7 +11,12 @@ import {
|
|
|
11
11
|
} from 'solid-js'
|
|
12
12
|
import { cn } from '#lib/utils'
|
|
13
13
|
import { CodeBlock, InlineCode, type CodeBlockProps } from '../code-block'
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
parseMessageTextIncremental,
|
|
16
|
+
type MessageBlock,
|
|
17
|
+
type MessageInline,
|
|
18
|
+
type MessageParse,
|
|
19
|
+
} from './parse-message-text'
|
|
15
20
|
|
|
16
21
|
/**
|
|
17
22
|
* Message.
|
|
@@ -219,6 +224,7 @@ export function MessageText(props: MessageTextProps) {
|
|
|
219
224
|
])
|
|
220
225
|
let previous: readonly MessageBlock[] = []
|
|
221
226
|
let previousCount = 0
|
|
227
|
+
let parsed: MessageParse | undefined
|
|
222
228
|
// Only the number of sources reaches the parser, so a new `render` function
|
|
223
229
|
// does not reparse the text, and a changed count does.
|
|
224
230
|
const citationCount = () => local.citations?.count ?? 0
|
|
@@ -226,10 +232,13 @@ export function MessageText(props: MessageTextProps) {
|
|
|
226
232
|
const count = citationCount()
|
|
227
233
|
if (count !== previousCount) previous = []
|
|
228
234
|
previousCount = count
|
|
229
|
-
|
|
235
|
+
// A streamed reply only grows, so each delta parses the tail it touched
|
|
236
|
+
// rather than the whole reply (which made a long reply quadratic).
|
|
237
|
+
parsed = parseMessageTextIncremental(parsed, local.text, {
|
|
230
238
|
streaming: local.streaming,
|
|
231
239
|
citations: count || undefined,
|
|
232
240
|
})
|
|
241
|
+
const next = parsed.blocks
|
|
233
242
|
const merged = next.map((block, index) =>
|
|
234
243
|
sameBlock(previous[index], block) ? previous[index]! : block
|
|
235
244
|
)
|