@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-selector.js","names":["Brain","Check","ChevronsUpDown","createEffect","createMemo","createSignal","createUniqueId","For","Show","splitProps","cn","Button","Command","CommandEmpty","CommandGroup","CommandInput","CommandItem","CommandList","DropdownMenu","DropdownMenuContent","DropdownMenuGroup","DropdownMenuLabel","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuTrigger","Popover","PopoverContent","PopoverTrigger","boundText","findModel","groupModels","modelSearchValue","needsSearch","normalizeEfforts","resolveEffort","models","value","effort","onChange","id","onEffortChange","searchThreshold","disabledReason","label","class","ModelSelector","props","local","blocked","undefined","selected","efforts","effortChoice","reason","reasonId","describedBy","_el$","_tmpl$2","_el$2","firstChild","_$insert","_$createComponent","when","fallback","children","_el$4","_tmpl$3","triggerText","length","ModelMenu","ModelSearch","choice","_el$6","_tmpl$4","_el$7","EffortMenu","_el$3","_tmpl$","_$setAttribute","_$effect","_p$","_v$","_v$2","e","_$className","t","ModelOptionBody","model","_el$8","_tmpl$7","_el$9","description","_el$0","_tmpl$5","_el$1","_tmpl$6","ModelTrigger","empty","_el$11","_tmpl$8","_c$","_$memo","open","setOpen","groups","inert","onOpenChange","next","placement","gutter","as","variant","size","hideArrow","each","group","provider","disabled","defaultValue","trim","placeholder","heading","onSelect","_tmpl$9","find","_el$13","_tmpl$0","_el$14","_tmpl$1","_el$15","_el$16"],"sources":["../../../../src/components/composites/model-selector/model-selector.tsx"],"sourcesContent":["import { Brain, Check, ChevronsUpDown } from 'lucide-solid'\nimport {\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n For,\n Show,\n splitProps,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '../../ui/command'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from '../../ui/dropdown-menu'\nimport { Popover, PopoverContent, PopoverTrigger } from '../../ui/popover'\nimport { REASON_TEXT_LIMIT, boundText } from '#lib/text'\nimport {\n findModel,\n groupModels,\n modelSearchValue,\n needsSearch,\n normalizeEfforts,\n resolveEffort,\n type ModelOption,\n} from './models'\n\n/**\n * ModelSelector.\n *\n * Two controls in one group beside the composer: *which model*, and *how hard it\n * thinks*. They are one component because the second depends on the first, an\n * effort level belongs to a model, and switching model can make the chosen effort\n * meaningless, so a host should not have to keep two menus consistent by hand.\n *\n * ## What it takes and what it will not decide\n *\n * `models` carries each option's provider, optional description and optional\n * `disabledReason`; `value` and `effort` are the current choice; `onChange` and\n * `onEffortChange` report a new one. The component holds no selection of its own\n * (the host may veto, persist or reset it) and never decides what is allowed:\n *\n * - **An unavailable model stays in the list**, disabled, with the host's reason\n * beside it in words. Hiding it would leave the person guessing where it went.\n * - **No `onChange`, no menu.** The model is then plain text, a read-only\n * statement of what is running, not a button that does nothing. The same holds\n * for effort and `onEffortChange`.\n * - **Effort renders only when the selected model advertises `efforts`.** A model\n * that does not has no effort control, and a stored `effort` the model does not\n * offer is shown as unset rather than as a level the model never had.\n * - **A `value` that is not in the list is shown as given**, not swapped for a\n * model the person did not choose.\n * - `disabledReason` disables both and says why under the group.\n *\n * ## Short list or long\n *\n * Up to `searchThreshold` models (7) the model picker is a `DropdownMenu` with\n * radio rows grouped by provider: arrows, typeahead and Escape come from the menu\n * contract. Beyond it the list is a `Popover` holding a `Command` palette with a\n * search box, because scanning thirty rows is slower than typing four letters.\n * Both close on choice and return focus to the trigger. Triggers use\n * `aria-disabled` so a blocked control is still reachable and its reason read.\n */\nexport type ModelSelectorProps = {\n models: readonly ModelOption[]\n /** The selected model's id. */\n value?: string\n /** The selected effort's id. */\n effort?: string\n onChange?: (id: string) => void\n onEffortChange?: (effort: string) => void\n /** Show a search box above this many models. Default 7. */\n searchThreshold?: number\n /** Why neither control can be used right now. */\n disabledReason?: string\n /** The group's accessible name. */\n label?: string\n class?: string\n}\n\nexport function ModelSelector(props: ModelSelectorProps) {\n const [local] = splitProps(props, [\n 'models',\n 'value',\n 'effort',\n 'onChange',\n 'onEffortChange',\n 'searchThreshold',\n 'disabledReason',\n 'label',\n 'class',\n ])\n const blocked = () => local.disabledReason !== undefined\n const selected = () => findModel(local.models, local.value)\n const efforts = createMemo(() => normalizeEfforts(selected()?.efforts))\n const effortChoice = () => resolveEffort(selected(), local.effort)\n const reason = () =>\n local.disabledReason ? boundText(local.disabledReason, REASON_TEXT_LIMIT) : undefined\n const reasonId = `${createUniqueId()}-reason`\n const describedBy = () => (reason() ? reasonId : undefined)\n\n return (\n <div data-slot=\"model-selector\" class={cn('flex min-w-0 flex-col gap-1', local.class)}>\n <div\n role=\"group\"\n aria-label={local.label ?? 'Model and thinking effort'}\n class=\"flex min-w-0 items-center gap-1\"\n >\n <Show\n when={local.onChange}\n fallback={\n <Show when={local.value}>\n <span class=\"truncate px-2 text-sm text-muted-foreground\">\n <span class=\"visually-hidden\">Model: </span>\n {triggerText({ selected: selected(), value: local.value })}\n </span>\n </Show>\n }\n >\n <Show\n when={needsSearch(local.models.length, local.searchThreshold)}\n fallback={\n <ModelMenu\n models={local.models}\n selected={selected()}\n value={local.value}\n blocked={blocked()}\n describedBy={describedBy()}\n onChange={(id) => local.onChange?.(id)}\n />\n }\n >\n <ModelSearch\n models={local.models}\n selected={selected()}\n value={local.value}\n blocked={blocked()}\n describedBy={describedBy()}\n onChange={(id) => local.onChange?.(id)}\n />\n </Show>\n </Show>\n <Show when={efforts().length > 0}>\n <Show\n when={local.onEffortChange}\n fallback={\n <Show when={effortChoice()}>\n {(choice) => (\n <span class=\"flex items-center gap-1 truncate px-2 text-sm text-muted-foreground\">\n <Brain aria-hidden=\"true\" class=\"size-3.5 shrink-0\" />\n <span class=\"visually-hidden\">Thinking effort: </span>\n {choice().label}\n </span>\n )}\n </Show>\n }\n >\n <EffortMenu\n efforts={efforts()}\n value={effortChoice()?.id}\n blocked={blocked()}\n describedBy={describedBy()}\n onChange={(id) => local.onEffortChange?.(id)}\n />\n </Show>\n </Show>\n </div>\n <Show when={reason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {reason()}\n </p>\n </Show>\n </div>\n )\n}\n\nfunction triggerText(props: { selected?: ModelOption; value?: string }): string {\n if (props.selected) return boundText(props.selected.label, 60)\n return props.value ? boundText(props.value, 60) : 'Choose a model'\n}\n\nfunction ModelOptionBody(props: { model: ModelOption }) {\n return (\n <span class=\"flex min-w-0 flex-col\">\n <span class=\"[overflow-wrap:anywhere]\">{boundText(props.model.label, 60)}</span>\n <Show when={props.model.description}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {boundText(props.model.description ?? '', 160)}\n </span>\n </Show>\n <Show when={props.model.disabledReason}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Unavailable: </span>\n {boundText(props.model.disabledReason ?? '', 160)}\n </span>\n </Show>\n </span>\n )\n}\n\ntype PickerProps = {\n models: readonly ModelOption[]\n selected?: ModelOption\n value?: string\n blocked: boolean\n describedBy?: string\n onChange: (id: string) => void\n}\n\nfunction ModelTrigger(props: { selected?: ModelOption; value?: string; empty: boolean }) {\n return (\n <>\n <span class=\"max-w-48 truncate\">\n {props.empty ? 'No models available' : triggerText(props)}\n </span>\n <ChevronsUpDown aria-hidden=\"true\" />\n </>\n )\n}\n\nfunction ModelMenu(props: PickerProps) {\n const [open, setOpen] = createSignal(false)\n const groups = createMemo(() => groupModels(props.models))\n const inert = () => props.blocked || props.models.length === 0\n\n createEffect(() => {\n if (inert()) setOpen(false)\n })\n\n return (\n <DropdownMenu\n open={open()}\n onOpenChange={(next) => setOpen(next && !inert())}\n placement=\"top-start\"\n gutter={6}\n >\n <DropdownMenuTrigger\n as={Button}\n variant=\"ghost\"\n size=\"sm\"\n aria-label={`Model: ${props.models.length === 0 ? 'No models available' : triggerText(props)}`}\n aria-disabled={inert() || undefined}\n aria-describedby={props.describedBy}\n >\n <ModelTrigger\n selected={props.selected}\n value={props.value}\n empty={props.models.length === 0}\n />\n </DropdownMenuTrigger>\n <DropdownMenuContent hideArrow class=\"w-72 max-w-full\">\n <DropdownMenuRadioGroup\n value={props.value ?? ''}\n onChange={(id: unknown) => {\n // Disabled rows cannot be activated, but the guard is the contract.\n const model = typeof id === 'string' ? findModel(props.models, id) : undefined\n if (!props.blocked && model && model.disabledReason === undefined) {\n props.onChange(model.id)\n }\n }}\n >\n <For each={groups()}>\n {(group) => (\n <DropdownMenuGroup>\n <DropdownMenuLabel>{group.provider}</DropdownMenuLabel>\n <For each={group.models}>\n {(model) => (\n <DropdownMenuRadioItem\n value={model.id}\n disabled={inert() || model.disabledReason !== undefined}\n >\n <ModelOptionBody model={model} />\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuGroup>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n\nfunction ModelSearch(props: PickerProps) {\n const [open, setOpen] = createSignal(false)\n const groups = createMemo(() => groupModels(props.models))\n\n createEffect(() => {\n if (props.blocked) setOpen(false)\n })\n\n return (\n <Popover\n open={open()}\n onOpenChange={(next) => setOpen(next && !props.blocked)}\n placement=\"top-start\"\n gutter={6}\n >\n <PopoverTrigger\n as={Button}\n variant=\"ghost\"\n size=\"sm\"\n aria-label={`Model: ${triggerText(props)}`}\n aria-disabled={props.blocked || undefined}\n aria-describedby={props.describedBy}\n >\n <ModelTrigger selected={props.selected} value={props.value} empty={false} />\n </PopoverTrigger>\n <PopoverContent class=\"w-80 max-w-full\">\n <Command\n label=\"Choose a model\"\n defaultValue={props.selected ? modelSearchValue(props.selected).trim() : undefined}\n >\n <CommandInput placeholder=\"Search models\" />\n <CommandList>\n <CommandEmpty>No model matches.</CommandEmpty>\n <For each={groups()}>\n {(group) => (\n <CommandGroup heading={group.provider}>\n <For each={group.models}>\n {(model) => (\n <CommandItem\n value={modelSearchValue(model)}\n disabled={props.blocked || model.disabledReason !== undefined}\n onSelect={() => {\n if (props.blocked || model.disabledReason !== undefined) return\n props.onChange(model.id)\n setOpen(false)\n }}\n >\n <ModelOptionBody model={model} />\n <Show when={model.id === props.value}>\n <Check aria-hidden=\"true\" class=\"ms-auto text-primary\" />\n <span class=\"visually-hidden\">Current model</span>\n </Show>\n </CommandItem>\n )}\n </For>\n </CommandGroup>\n )}\n </For>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n )\n}\n\nfunction EffortMenu(props: {\n efforts: ReturnType<typeof normalizeEfforts>\n value?: string\n blocked: boolean\n describedBy?: string\n onChange: (id: string) => void\n}) {\n const [open, setOpen] = createSignal(false)\n const label = () => props.efforts.find((effort) => effort.id === props.value)?.label\n\n createEffect(() => {\n if (props.blocked) setOpen(false)\n })\n\n return (\n <DropdownMenu\n open={open()}\n onOpenChange={(next) => setOpen(next && !props.blocked)}\n placement=\"top-start\"\n gutter={6}\n >\n <DropdownMenuTrigger\n as={Button}\n variant=\"ghost\"\n size=\"sm\"\n aria-label={`Thinking effort: ${label() ?? 'not set'}`}\n aria-disabled={props.blocked || undefined}\n aria-describedby={props.describedBy}\n >\n <Brain aria-hidden=\"true\" />\n <span aria-hidden=\"true\">{label() ?? 'Effort'}</span>\n </DropdownMenuTrigger>\n <DropdownMenuContent hideArrow class=\"w-56 max-w-full\">\n <DropdownMenuRadioGroup\n value={props.value ?? ''}\n onChange={(id: unknown) => {\n if (!props.blocked && typeof id === 'string') props.onChange(id)\n }}\n >\n <DropdownMenuGroup>\n <DropdownMenuLabel>Thinking effort</DropdownMenuLabel>\n <For each={props.efforts}>\n {(effort) => (\n <DropdownMenuRadioItem value={effort.id} disabled={props.blocked}>\n <span class=\"flex min-w-0 flex-col\">\n <span>{effort.label}</span>\n <Show when={effort.description}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {effort.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuGroup>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8FA,SAAgB6C,cAAcC,OAA2B;CACvD,MAAM,CAACC,SAAStC,WAAWqC,OAAO;EAChC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CACD,MAAME,gBAAgBD,MAAML,mBAAmBO,KAAAA;CAC/C,MAAMC,iBAAi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WAAA;OAAA,OAAAH,gBAEAzC,mBAAiB,EAAA,IAAA4C,WAAA;QAAA,OAAA,CAAAH,gBACfxC,mBAAiB,EAAA2C,UAAA,kBAAA,CAAA,GAAAH,gBACjBtD,KAAG;SAAA,IAAC2G,OAAI;UAAA,OAAEpE,MAAMK;SAAO;SAAAa,WACpB3B,WAAMwB,gBACLtC,uBAAqB;UAAA,IAACa,QAAK;WAAA,OAAEC,OAAOE;UAAE;UAAA,IAAE8E,WAAQ;WAAA,OAAEvE,MAAME;UAAO;UAAA,IAAAgB,WAAA;WAAA,IAAA+D,SAAAC,QAAA,GAAAC,SAAAF,OAAApE;WAAAC,OAAAqE,cAErD5F,OAAOM,KAAK;WAAAiB,OAAAmE,QAAAlE,gBAClBrD,MAAI;YAAA,IAACsD,OAAI;aAAA,OAAEzB,OAAOsD;YAAW;YAAA,IAAA3B,WAAA;aAAA,IAAAkE,SAAArC,QAAA;aAAAjC,OAAAsE,cAEzB7F,OAAOsD,WAAW;aAAA,OAAAuC;YAAA;WAAA,CAAA,GAAA,IAAA;WAAA,OAAAH;UAAA;SAAA,CAAA;QAK5B,CAAA,CAAA;OAAA,EAAA,CAAA;MAAA;KAAA,CAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAOf"}
|
|
1
|
+
{"version":3,"file":"model-selector.js","names":["Brain","LucideBrain","Check","LucideCheck","ChevronsUpDown","LucideChevronsUpDown","createEffect","createMemo","createSignal","createUniqueId","For","Show","splitProps","cn","Button","Command","CommandEmpty","CommandGroup","CommandInput","CommandItem","CommandList","DropdownMenu","DropdownMenuContent","DropdownMenuGroup","DropdownMenuLabel","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuTrigger","Popover","PopoverContent","PopoverTrigger","Tabs","TabsContent","TabsList","TabsTrigger","boundText","findModel","groupModels","modelSearchValue","needsSearch","normalizeEfforts","resolveEffort","fastIcon","models","value","effort","onChange","id","onEffortChange","searchThreshold","disabledReason","label","layout","providerIcon","provider","class","ModelSelector","props","local","blocked","undefined","selected","efforts","effortChoice","reason","reasonId","describedBy","_el$","_tmpl$2","_el$2","firstChild","_$insert","_$createComponent","when","fallback","children","_el$4","_tmpl$3","triggerText","ModelTabs","length","ModelMenu","ModelSearch","choice","_el$6","_tmpl$4","_el$7","EffortMenu","_el$3","_tmpl$","_$setAttribute","_$effect","_p$","_v$","_v$2","e","_$className","t","ModelOptionBody","model","_el$8","_tmpl$7","_el$9","description","_el$0","_tmpl$5","_el$1","_tmpl$6","ModelTrigger","empty","_el$11","_tmpl$8","_c$","_$memo","open","setOpen","groups","inert","onOpenChange","next","placement","gutter","as","variant","size","hideArrow","each","group","disabled","defaultValue","trim","placeholder","heading","onSelect","_tmpl$9","ProviderGlyph","icon","_el$13","_tmpl$0","charAt","_el$14","_tmpl$1","groupOf","find","includes","tab","setTab","current","chosen","some","content","focusSearch","queueMicrotask","querySelector","focus","ref","element","onOpenAutoFocus","event","preventDefault","fill","scrollable","title","_el$16","_tmpl$10","_el$17","_tmpl$11","_el$18","_el$19"],"sources":["../../../../src/components/composites/model-selector/model-selector.tsx"],"sourcesContent":["import {\n Brain as LucideBrain,\n Check as LucideCheck,\n ChevronsUpDown as LucideChevronsUpDown,\n} from 'lucide-solid'\nimport {\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n For,\n Show,\n splitProps,\n type JSX,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '../../ui/command'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from '../../ui/dropdown-menu'\nimport { Popover, PopoverContent, PopoverTrigger } from '../../ui/popover'\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from '../../ui/tabs'\nimport { REASON_TEXT_LIMIT, boundText } from '#lib/text'\nimport {\n findModel,\n groupModels,\n modelSearchValue,\n needsSearch,\n normalizeEfforts,\n resolveEffort,\n type ModelOption,\n} from './models'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Brain = fastIcon(LucideBrain)\nconst Check = fastIcon(LucideCheck)\nconst ChevronsUpDown = fastIcon(LucideChevronsUpDown)\n\n/**\n * ModelSelector.\n *\n * Two controls in one group beside the composer: *which model*, and *how hard it\n * thinks*. They are one component because the second depends on the first, an\n * effort level belongs to a model, and switching model can make the chosen effort\n * meaningless, so a host should not have to keep two menus consistent by hand.\n *\n * ## What it takes and what it will not decide\n *\n * `models` carries each option's provider, optional description and optional\n * `disabledReason`; `value` and `effort` are the current choice; `onChange` and\n * `onEffortChange` report a new one. The component holds no selection of its own\n * (the host may veto, persist or reset it) and never decides what is allowed:\n *\n * - **An unavailable model stays in the list**, disabled, with the host's reason\n * beside it in words. Hiding it would leave the person guessing where it went.\n * - **No `onChange`, no menu.** The model is then plain text, a read-only\n * statement of what is running, not a button that does nothing. The same holds\n * for effort and `onEffortChange`.\n * - **Effort renders only when the selected model advertises `efforts`.** A model\n * that does not has no effort control, and a stored `effort` the model does not\n * offer is shown as unset rather than as a level the model never had.\n * - **A `value` that is not in the list is shown as given**, not swapped for a\n * model the person did not choose.\n * - `disabledReason` disables both and says why under the group.\n *\n * ## Short list or long\n *\n * Up to `searchThreshold` models (7) the model picker is a `DropdownMenu` with\n * radio rows grouped by provider: arrows, typeahead and Escape come from the menu\n * contract. Beyond it the list is a `Popover` holding a `Command` palette with a\n * search box, because scanning thirty rows is slower than typing four letters.\n * Both close on choice and return focus to the trigger. Triggers use\n * `aria-disabled` so a blocked control is still reachable and its reason read.\n *\n * ## Tabs\n *\n * `layout=\"tabs\"` is for a list whose providers are the first choice, such as\n * one row of harnesses. The popover opens with one tab per provider, in the\n * order they first appear (the host's order), each drawn with `providerIcon`\n * or the provider's initial and named by its tooltip. Under the tabs, a search\n * box and the list cover the selected tab's models only. The tab starts on the\n * selected model's provider. Effort stays its own menu.\n */\nexport type ModelSelectorProps = {\n models: readonly ModelOption[]\n /** The selected model's id. */\n value?: string\n /** The selected effort's id. */\n effort?: string\n onChange?: (id: string) => void\n onEffortChange?: (effort: string) => void\n /** Show a search box above this many models. Default 7. */\n searchThreshold?: number\n /** Why neither control can be used right now. */\n disabledReason?: string\n /** The group's accessible name. */\n label?: string\n /** `tabs`: one tab per provider above a searchable list of that provider's models. */\n layout?: 'list' | 'tabs'\n /** The provider's mark, drawn with `currentColor`, for the tabs and the trigger. */\n providerIcon?: (provider: string) => JSX.Element\n class?: string\n}\n\nexport function ModelSelector(props: ModelSelectorProps) {\n const [local] = splitProps(props, [\n 'models',\n 'value',\n 'effort',\n 'onChange',\n 'onEffortChange',\n 'searchThreshold',\n 'disabledReason',\n 'label',\n 'layout',\n 'providerIcon',\n 'class',\n ])\n const blocked = () => local.disabledReason !== undefined\n const selected = () => findModel(local.models, local.value)\n const efforts = createMemo(() => normalizeEfforts(selected()?.efforts))\n const effortChoice = () => resolveEffort(selected(), local.effort)\n const reason = () =>\n local.disabledReason ? boundText(local.disabledReason, REASON_TEXT_LIMIT) : undefined\n const reasonId = `${createUniqueId()}-reason`\n const describedBy = () => (reason() ? reasonId : undefined)\n\n return (\n <div data-slot=\"model-selector\" class={cn('flex min-w-0 flex-col gap-1', local.class)}>\n <div\n role=\"group\"\n aria-label={local.label ?? 'Model and thinking effort'}\n class=\"flex min-w-0 items-center gap-1\"\n >\n <Show\n when={local.onChange}\n fallback={\n <Show when={local.value}>\n <span class=\"truncate px-2 text-sm text-muted-foreground\">\n <span class=\"visually-hidden\">Model: </span>\n {triggerText({ selected: selected(), value: local.value })}\n </span>\n </Show>\n }\n >\n <Show\n when={local.layout !== 'tabs'}\n fallback={\n <ModelTabs\n models={local.models}\n selected={selected()}\n value={local.value}\n blocked={blocked()}\n describedBy={describedBy()}\n providerIcon={local.providerIcon}\n onChange={(id) => local.onChange?.(id)}\n />\n }\n >\n <Show\n when={needsSearch(local.models.length, local.searchThreshold)}\n fallback={\n <ModelMenu\n models={local.models}\n selected={selected()}\n value={local.value}\n blocked={blocked()}\n describedBy={describedBy()}\n onChange={(id) => local.onChange?.(id)}\n />\n }\n >\n <ModelSearch\n models={local.models}\n selected={selected()}\n value={local.value}\n blocked={blocked()}\n describedBy={describedBy()}\n onChange={(id) => local.onChange?.(id)}\n />\n </Show>\n </Show>\n </Show>\n <Show when={efforts().length > 0}>\n <Show\n when={local.onEffortChange}\n fallback={\n <Show when={effortChoice()}>\n {(choice) => (\n <span class=\"flex items-center gap-1 truncate px-2 text-sm text-muted-foreground\">\n <Brain aria-hidden=\"true\" class=\"size-3.5 shrink-0\" />\n <span class=\"visually-hidden\">Thinking effort: </span>\n {choice().label}\n </span>\n )}\n </Show>\n }\n >\n <EffortMenu\n efforts={efforts()}\n value={effortChoice()?.id}\n blocked={blocked()}\n describedBy={describedBy()}\n onChange={(id) => local.onEffortChange?.(id)}\n />\n </Show>\n </Show>\n </div>\n <Show when={reason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {reason()}\n </p>\n </Show>\n </div>\n )\n}\n\nfunction triggerText(props: { selected?: ModelOption; value?: string }): string {\n if (props.selected) return boundText(props.selected.label, 60)\n return props.value ? boundText(props.value, 60) : 'Choose a model'\n}\n\nfunction ModelOptionBody(props: { model: ModelOption }) {\n return (\n <span class=\"flex min-w-0 flex-col\">\n <span class=\"[overflow-wrap:anywhere]\">{boundText(props.model.label, 60)}</span>\n <Show when={props.model.description}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {boundText(props.model.description ?? '', 160)}\n </span>\n </Show>\n <Show when={props.model.disabledReason}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Unavailable: </span>\n {boundText(props.model.disabledReason ?? '', 160)}\n </span>\n </Show>\n </span>\n )\n}\n\ntype PickerProps = {\n models: readonly ModelOption[]\n selected?: ModelOption\n value?: string\n blocked: boolean\n describedBy?: string\n onChange: (id: string) => void\n}\n\nfunction ModelTrigger(props: { selected?: ModelOption; value?: string; empty: boolean }) {\n return (\n <>\n <span class=\"max-w-48 truncate\">\n {props.empty ? 'No models available' : triggerText(props)}\n </span>\n <ChevronsUpDown aria-hidden=\"true\" />\n </>\n )\n}\n\nfunction ModelMenu(props: PickerProps) {\n const [open, setOpen] = createSignal(false)\n const groups = createMemo(() => groupModels(props.models))\n const inert = () => props.blocked || props.models.length === 0\n\n createEffect(() => {\n if (inert()) setOpen(false)\n })\n\n return (\n <DropdownMenu\n open={open()}\n onOpenChange={(next) => setOpen(next && !inert())}\n placement=\"top-start\"\n gutter={6}\n >\n <DropdownMenuTrigger\n as={Button}\n variant=\"ghost\"\n size=\"sm\"\n aria-label={`Model: ${props.models.length === 0 ? 'No models available' : triggerText(props)}`}\n aria-disabled={inert() || undefined}\n aria-describedby={props.describedBy}\n >\n <ModelTrigger\n selected={props.selected}\n value={props.value}\n empty={props.models.length === 0}\n />\n </DropdownMenuTrigger>\n <DropdownMenuContent hideArrow class=\"w-72 max-w-full\">\n <DropdownMenuRadioGroup\n value={props.value ?? ''}\n onChange={(id: unknown) => {\n // Disabled rows cannot be activated, but the guard is the contract.\n const model = typeof id === 'string' ? findModel(props.models, id) : undefined\n if (!props.blocked && model && model.disabledReason === undefined) {\n props.onChange(model.id)\n }\n }}\n >\n <For each={groups()}>\n {(group) => (\n <DropdownMenuGroup>\n <DropdownMenuLabel>{group.provider}</DropdownMenuLabel>\n <For each={group.models}>\n {(model) => (\n <DropdownMenuRadioItem\n value={model.id}\n disabled={inert() || model.disabledReason !== undefined}\n >\n <ModelOptionBody model={model} />\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuGroup>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n\nfunction ModelSearch(props: PickerProps) {\n const [open, setOpen] = createSignal(false)\n const groups = createMemo(() => groupModels(props.models))\n\n createEffect(() => {\n if (props.blocked) setOpen(false)\n })\n\n return (\n <Popover\n open={open()}\n onOpenChange={(next) => setOpen(next && !props.blocked)}\n placement=\"top-start\"\n gutter={6}\n >\n <PopoverTrigger\n as={Button}\n variant=\"ghost\"\n size=\"sm\"\n aria-label={`Model: ${triggerText(props)}`}\n aria-disabled={props.blocked || undefined}\n aria-describedby={props.describedBy}\n >\n <ModelTrigger selected={props.selected} value={props.value} empty={false} />\n </PopoverTrigger>\n <PopoverContent class=\"w-80 max-w-full\">\n <Command\n label=\"Choose a model\"\n defaultValue={props.selected ? modelSearchValue(props.selected).trim() : undefined}\n >\n <CommandInput placeholder=\"Search models\" />\n <CommandList>\n <CommandEmpty>No model matches.</CommandEmpty>\n <For each={groups()}>\n {(group) => (\n <CommandGroup heading={group.provider}>\n <For each={group.models}>\n {(model) => (\n <CommandItem\n value={modelSearchValue(model)}\n disabled={props.blocked || model.disabledReason !== undefined}\n onSelect={() => {\n if (props.blocked || model.disabledReason !== undefined) return\n props.onChange(model.id)\n setOpen(false)\n }}\n >\n <ModelOptionBody model={model} />\n <Show when={model.id === props.value}>\n <Check aria-hidden=\"true\" class=\"ms-auto text-primary\" />\n <span class=\"visually-hidden\">Current model</span>\n </Show>\n </CommandItem>\n )}\n </For>\n </CommandGroup>\n )}\n </For>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n )\n}\n\n/** The provider's mark, or its initial when the host gives none. */\nfunction ProviderGlyph(props: { provider: string; icon?: (provider: string) => JSX.Element }) {\n return (\n <Show\n when={props.icon?.(props.provider)}\n fallback={\n <span aria-hidden=\"true\" class=\"text-xs font-semibold uppercase\">\n {props.provider.charAt(0)}\n </span>\n }\n >\n {(icon) => (\n <span aria-hidden=\"true\" class=\"inline-flex size-4 shrink-0 items-center justify-center\">\n {icon()}\n </span>\n )}\n </Show>\n )\n}\n\nfunction ModelTabs(props: PickerProps & { providerIcon?: (provider: string) => JSX.Element }) {\n const [open, setOpen] = createSignal(false)\n const groups = createMemo(() => groupModels(props.models))\n const inert = () => props.blocked || props.models.length === 0\n const groupOf = (model: ModelOption | undefined) =>\n model ? groups().find((group) => group.models.includes(model))?.provider : undefined\n const [tab, setTab] = createSignal<string>()\n // Each opening starts on the selected model's provider, else the first.\n const current = () => {\n const chosen = tab()\n return chosen && groups().some((group) => group.provider === chosen)\n ? chosen\n : (groupOf(props.selected) ?? groups()[0]?.provider)\n }\n let content: HTMLDivElement | undefined\n const focusSearch = () =>\n queueMicrotask(() => content?.querySelector<HTMLInputElement>('[cmdk-input]')?.focus())\n\n createEffect(() => {\n if (inert()) setOpen(false)\n })\n\n return (\n <Popover\n open={open()}\n onOpenChange={(next) => {\n setOpen(next && !inert())\n if (!next) setTab(undefined)\n }}\n placement=\"top-start\"\n gutter={6}\n >\n <PopoverTrigger\n as={Button}\n variant=\"ghost\"\n size=\"sm\"\n aria-label={`Model: ${props.models.length === 0 ? 'No models available' : triggerText(props)}`}\n aria-disabled={inert() || undefined}\n aria-describedby={props.describedBy}\n >\n <Show when={groupOf(props.selected)}>\n {(provider) => <ProviderGlyph provider={provider()} icon={props.providerIcon} />}\n </Show>\n <ModelTrigger\n selected={props.selected}\n value={props.value}\n empty={props.models.length === 0}\n />\n </PopoverTrigger>\n <PopoverContent\n ref={(element: HTMLDivElement) => (content = element)}\n hideArrow\n class=\"w-80 max-w-full p-0\"\n onOpenAutoFocus={(event: Event) => {\n event.preventDefault()\n focusSearch()\n }}\n >\n <Tabs\n value={current()}\n onChange={(next: string) => {\n setTab(next)\n focusSearch()\n }}\n class=\"gap-0\"\n >\n <TabsList fill scrollable aria-label=\"Providers\" class=\"px-1.5 pt-1\">\n <For each={groups()}>\n {(group) => (\n <TabsTrigger\n value={group.provider}\n aria-label={group.provider}\n title={group.provider}\n class=\"h-8 min-w-8 px-1.5 pb-1.5 text-muted-foreground data-[selected]:text-foreground\"\n >\n <ProviderGlyph provider={group.provider} icon={props.providerIcon} />\n </TabsTrigger>\n )}\n </For>\n </TabsList>\n <For each={groups()}>\n {(group) => (\n <TabsContent value={group.provider}>\n <Command\n label={`${group.provider} models`}\n defaultValue={\n props.selected && group.models.includes(props.selected)\n ? modelSearchValue(props.selected).trim()\n : undefined\n }\n >\n <CommandInput placeholder=\"Search models\" />\n <CommandList>\n <CommandEmpty>No model matches.</CommandEmpty>\n <For each={group.models}>\n {(model) => (\n <CommandItem\n value={modelSearchValue(model)}\n disabled={props.blocked || model.disabledReason !== undefined}\n onSelect={() => {\n if (props.blocked || model.disabledReason !== undefined) return\n props.onChange(model.id)\n setOpen(false)\n }}\n >\n <ModelOptionBody model={model} />\n <Show when={model.id === props.value}>\n <Check aria-hidden=\"true\" class=\"ms-auto text-primary\" />\n <span class=\"visually-hidden\">Current model</span>\n </Show>\n </CommandItem>\n )}\n </For>\n </CommandList>\n </Command>\n </TabsContent>\n )}\n </For>\n </Tabs>\n </PopoverContent>\n </Popover>\n )\n}\n\nfunction EffortMenu(props: {\n efforts: ReturnType<typeof normalizeEfforts>\n value?: string\n blocked: boolean\n describedBy?: string\n onChange: (id: string) => void\n}) {\n const [open, setOpen] = createSignal(false)\n const label = () => props.efforts.find((effort) => effort.id === props.value)?.label\n\n createEffect(() => {\n if (props.blocked) setOpen(false)\n })\n\n return (\n <DropdownMenu\n open={open()}\n onOpenChange={(next) => setOpen(next && !props.blocked)}\n placement=\"top-start\"\n gutter={6}\n >\n <DropdownMenuTrigger\n as={Button}\n variant=\"ghost\"\n size=\"sm\"\n aria-label={`Thinking effort: ${label() ?? 'not set'}`}\n aria-disabled={props.blocked || undefined}\n aria-describedby={props.describedBy}\n >\n <Brain aria-hidden=\"true\" />\n <span aria-hidden=\"true\">{label() ?? 'Effort'}</span>\n </DropdownMenuTrigger>\n <DropdownMenuContent hideArrow class=\"w-56 max-w-full\">\n <DropdownMenuRadioGroup\n value={props.value ?? ''}\n onChange={(id: unknown) => {\n if (!props.blocked && typeof id === 'string') props.onChange(id)\n }}\n >\n <DropdownMenuGroup>\n <DropdownMenuLabel>Thinking effort</DropdownMenuLabel>\n <For each={props.efforts}>\n {(effort) => (\n <DropdownMenuRadioItem value={effort.id} disabled={props.blocked}>\n <span class=\"flex min-w-0 flex-col\">\n <span>{effort.label}</span>\n <Show when={effort.description}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {effort.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuGroup>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAMA,UAAQ0C,SAASzC,KAAW;AAClC,IAAMC,UAAQwC,SAASvC,KAAW;AAClC,IAAMC,mBAAiBsC,SAASrC,cAAoB;AAoEpD,SAAgBmD,cAAcC,OAA2B;CACvD,MAAM,CAACC,SAAS9C,WAAW6C,OAAO;EAChC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CACD,MAAME,gBAAgBD,MAAMR,mBAAmBU,KAAAA;CAC/C,MAAMC,iBAAiBzB,UAAUsB,MAAMf,QAAQe,MAAMd,KAAK;CAC1D,MAAMkB,UAAUvD,iBAAiBiC,iBAAiBqB,SAAS,CAAC,EAAEC,OAAO,CAAC;CACtE,MAAMC,qBAAqBtB,cAAcoB,SAAS,GAAGH,MAAMb,MAAM;CACjE,MAAMmB,eACJN,MAAMR,iBAAiBf,UAAUuB,MAAMR,gBAAAA,GAAiC,IAAIU,KAAAA;CAC9E,MAAMK,WAAW,GAAGxD,eAAe,EAAC;CACpC,MAAMyD,oBAAqBF,OAAO,IAAIC,WAAWL,KAAAA;CAEjD,cAAA;EAAA,IAAAO,OAAAC,QAAA,GAAAC,QAAAF,KAAAG;EAAAC,OAAAF,OAAAG,gBAOO7D,MAAI;GAAA,IACH8D,OAAI;IAAA,OAAEf,MAAMZ;GAAQ;GAAA,IACpB4B,WAAQ;IAAA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,OAAEC,OAAOE;UAAE;UAAA,IAAEiF,WAAQ;WAAA,OAAEvE,MAAME;UAAO;UAAA,IAAAgB,WAAA;WAAA,IAAA0F,SAAAC,SAAA,GAAAC,SAAAF,OAAA/F;WAAAC,OAAAgG,cAErD1H,OAAOM,KAAK;WAAAoB,OAAA8F,QAAA7F,gBAClB7D,MAAI;YAAA,IAAC8D,OAAI;aAAA,OAAE5B,OAAO0D;YAAW;YAAA,IAAA5B,WAAA;aAAA,IAAA6F,SAAA/D,QAAA;aAAAlC,OAAAiG,cAEzB3H,OAAO0D,WAAW;aAAA,OAAAiE;YAAA;WAAA,CAAA,GAAA,IAAA;WAAA,OAAAH;UAAA;SAAA,CAAA;QAK5B,CAAA,CAAA;OAAA,EAAA,CAAA;MAAA;KAAA,CAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAOf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/plan/plan.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,GAAG,EACT,MAAM,UAAU,CAAA;AAEjB,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC5E,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/plan/plan.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,GAAG,EACT,MAAM,UAAU,CAAA;AAEjB,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC5E,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,SAAS,CAAA;AAMhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,CAAA;AAE3C,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB,CAAC,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,IAAI,CAC1B,cAAc,EACd,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,gBAAgB,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,CAC/F,GAAG;IACF,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAA;IAC1B,6CAA6C;IAC7C,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACzB,oDAAoD;IACpD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gFAAgF;IAChF,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACtB,CAAA;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,eA8EpC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Progress } from "../../ui/progress/progress.js";
|
|
2
2
|
import { TraceDetail, TraceLine } from "../../ui/trace/trace.js";
|
|
3
3
|
import { TaskItemList, TaskItemRow, taskProgress, taskProgressLabel } from "../task/task.js";
|
|
4
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
4
5
|
import { createComponent, insert, mergeProps, template } from "solid-js/web";
|
|
5
6
|
import { ListTodo } from "lucide-solid";
|
|
6
7
|
import { Index, Show, children, createMemo, splitProps } from "solid-js";
|
|
@@ -8,6 +9,7 @@ import { Index, Show, children, createMemo, splitProps } from "solid-js";
|
|
|
8
9
|
var _tmpl$ = /*#__PURE__*/ template(`<span class=streaming-caret aria-hidden=true>`);
|
|
9
10
|
var _tmpl$2 = /*#__PURE__*/ template(`<div class="text-sm text-muted-foreground">`);
|
|
10
11
|
var _tmpl$3 = /*#__PURE__*/ template(`<div data-slot=plan-actions class="flex flex-wrap items-center gap-2 pt-1">`);
|
|
12
|
+
var ListTodo$1 = fastIcon(ListTodo);
|
|
11
13
|
function Plan(props) {
|
|
12
14
|
const [local, rest] = splitProps(props, [
|
|
13
15
|
"steps",
|
|
@@ -109,7 +111,7 @@ function Plan(props) {
|
|
|
109
111
|
});
|
|
110
112
|
return createComponent(TraceLine, mergeProps({
|
|
111
113
|
get icon() {
|
|
112
|
-
return local.icon ?? createComponent(ListTodo, {});
|
|
114
|
+
return local.icon ?? createComponent(ListTodo$1, {});
|
|
113
115
|
},
|
|
114
116
|
get status() {
|
|
115
117
|
return local.streaming ? "running" : void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.js","names":["ListTodo","children","resolveChildren","createMemo","Index","Show","splitProps","Progress","TraceDetail","TraceLine","TaskItemList","TaskItemRow","taskProgress","taskProgressLabel","label","description","status","steps","streaming","actions","Plan","props","local","rest","progress","undefined","meta","value","hasDetail","length","detail","_$createComponent","when","descriptionSlot","_el$2","_tmpl$2","_$insert","done","minValue","maxValue","Math","max","total","getValueLabel","each","step","text","_tmpl$","actionsSlot","_el$3","_tmpl$3","_$mergeProps","icon","statusLabel","defaultOpen"],"sources":["../../../../src/components/composites/plan/plan.tsx"],"sourcesContent":["import { ListTodo } from 'lucide-solid'\nimport {\n children as resolveChildren,\n createMemo,\n Index,\n Show,\n splitProps,\n type JSX,\n} from 'solid-js'\nimport { Progress } from '../../ui/progress'\nimport { TraceDetail, TraceLine, type TraceLineProps } from '../../ui/trace'\nimport {\n TaskItemList,\n TaskItemRow,\n taskProgress,\n taskProgressLabel,\n type TaskItemStatus,\n} from '../task'\n\n/**\n * Plan.\n *\n * What the agent intends to do, as a `TraceLine` that opens onto the steps: a\n * title, an optional description, the steps with their status, how far along\n * they are, and — when the host supplies them — the actions the reader can take\n * (approve, edit, run). Reach for `Task` when the list is a unit of work that is\n * already under way and not a proposal, for `Queue` when it is the agent's\n * running todo list, and for `ChainOfThought` when the steps describe how an\n * answer was reached rather than what will be done.\n *\n * ## It opens by default\n *\n * Unlike a tool call, the plan is the thing being decided or followed, so it\n * starts open (`defaultOpen={false}` folds it). A plan with no steps, no\n * description and no actions is a plain line.\n *\n * ## Progress is derived, in words\n *\n * \"2 of 5 steps done\" and the bar come from the steps' own `status` and appear\n * only when at least one step has one; a step with no status counts toward the\n * total and not toward \"done\" (the host did not say it was finished). The bar is\n * the shared `Progress`, which publishes the same phrase to assistive\n * technology, so the number is never only a length.\n *\n * ## Streaming\n *\n * While `streaming` the plan is still being written, so its length is not known\n * and no progress is claimed: the title shimmers, the line says \"Drafting\", and\n * a caret trails the last step. Finished steps keep their DOM while the last one\n * grows (rows are kept by position).\n *\n * ## The host owns authority\n *\n * `actions` is a slot. The plan neither enables nor disables what is in it, and\n * with no `actions` there are no controls — a plan the reader may not approve\n * simply has no Approve button.\n *\n * A `Plan` is a line: place it inside a `Trace`.\n */\nexport type PlanStepStatus = TaskItemStatus\n\nexport type PlanStep = Readonly<{\n id?: string\n label: string\n description?: string\n status?: PlanStepStatus\n}>\n\nexport type PlanProps = Omit<\n TraceLineProps,\n 'description' | 'href' | 'onSelect' | 'selectHaspopup' | 'children' | 'status' | 'statusLabel'\n> & {\n steps: readonly PlanStep[]\n /** What the plan is for, above the steps. */\n description?: JSX.Element\n /** True while the plan is still being generated. */\n streaming?: boolean\n /** Controls for the reader: approve, edit, run. Absent means there are none. */\n actions?: JSX.Element\n}\n\nexport function Plan(props: PlanProps) {\n const [local, rest] = splitProps(props, [\n 'steps',\n 'description',\n 'streaming',\n 'actions',\n 'icon',\n 'meta',\n 'defaultOpen',\n ])\n const progress = createMemo(() => (local.streaming ? undefined : taskProgress(local.steps)))\n const meta = () => {\n if (local.meta !== undefined) return local.meta\n if (local.streaming) return 'Drafting'\n const value = progress()\n return value ? taskProgressLabel(value) : undefined\n }\n const description = resolveChildren(() => local.description)\n const actions = resolveChildren(() => local.actions)\n const hasDetail = () =>\n local.steps.length > 0 || description() != null || actions() != null || local.streaming === true\n\n const detail = () => (\n <TraceDetail class=\"flex flex-col gap-2\">\n <Show when={description()}>\n {(descriptionSlot) => <div class=\"text-sm text-muted-foreground\">{descriptionSlot()}</div>}\n </Show>\n <Show when={progress()}>\n {(value) => (\n <Progress\n value={value().done}\n minValue={0}\n maxValue={Math.max(1, value().total)}\n aria-label=\"Plan progress\"\n getValueLabel={({ value: done, max }) =>\n `${done} of ${max} ${max === 1 ? 'step' : 'steps'} done`\n }\n />\n )}\n </Show>\n <Show when={local.steps.length > 0}>\n <TaskItemList label=\"Plan steps\">\n <Index each={local.steps}>\n {(step) => (\n <TaskItemRow\n text={step().label}\n description={step().description}\n status={step().status}\n />\n )}\n </Index>\n </TaskItemList>\n </Show>\n <Show when={local.streaming}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n <Show when={actions()}>\n {(actionsSlot) => (\n <div data-slot=\"plan-actions\" class=\"flex flex-wrap items-center gap-2 pt-1\">\n {actionsSlot()}\n </div>\n )}\n </Show>\n </TraceDetail>\n )\n\n return (\n <TraceLine\n icon={local.icon ?? <ListTodo />}\n status={local.streaming ? 'running' : undefined}\n statusLabel=\"Generating\"\n meta={meta()}\n defaultOpen={local.defaultOpen ?? true}\n {...rest}\n >\n {hasDetail() ? detail : undefined}\n </TraceLine>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plan.js","names":["ListTodo","LucideListTodo","children","resolveChildren","createMemo","Index","Show","splitProps","Progress","TraceDetail","TraceLine","TaskItemList","TaskItemRow","taskProgress","taskProgressLabel","fastIcon","label","description","status","steps","streaming","actions","Plan","props","local","rest","progress","undefined","meta","value","hasDetail","length","detail","_$createComponent","when","descriptionSlot","_el$2","_tmpl$2","_$insert","done","minValue","maxValue","Math","max","total","getValueLabel","each","step","text","_tmpl$","actionsSlot","_el$3","_tmpl$3","_$mergeProps","icon","statusLabel","defaultOpen"],"sources":["../../../../src/components/composites/plan/plan.tsx"],"sourcesContent":["import { ListTodo as LucideListTodo } from 'lucide-solid'\nimport {\n children as resolveChildren,\n createMemo,\n Index,\n Show,\n splitProps,\n type JSX,\n} from 'solid-js'\nimport { Progress } from '../../ui/progress'\nimport { TraceDetail, TraceLine, type TraceLineProps } from '../../ui/trace'\nimport {\n TaskItemList,\n TaskItemRow,\n taskProgress,\n taskProgressLabel,\n type TaskItemStatus,\n} from '../task'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ListTodo = fastIcon(LucideListTodo)\n\n/**\n * Plan.\n *\n * What the agent intends to do, as a `TraceLine` that opens onto the steps: a\n * title, an optional description, the steps with their status, how far along\n * they are, and — when the host supplies them — the actions the reader can take\n * (approve, edit, run). Reach for `Task` when the list is a unit of work that is\n * already under way and not a proposal, for `Queue` when it is the agent's\n * running todo list, and for `ChainOfThought` when the steps describe how an\n * answer was reached rather than what will be done.\n *\n * ## It opens by default\n *\n * Unlike a tool call, the plan is the thing being decided or followed, so it\n * starts open (`defaultOpen={false}` folds it). A plan with no steps, no\n * description and no actions is a plain line.\n *\n * ## Progress is derived, in words\n *\n * \"2 of 5 steps done\" and the bar come from the steps' own `status` and appear\n * only when at least one step has one; a step with no status counts toward the\n * total and not toward \"done\" (the host did not say it was finished). The bar is\n * the shared `Progress`, which publishes the same phrase to assistive\n * technology, so the number is never only a length.\n *\n * ## Streaming\n *\n * While `streaming` the plan is still being written, so its length is not known\n * and no progress is claimed: the title shimmers, the line says \"Drafting\", and\n * a caret trails the last step. Finished steps keep their DOM while the last one\n * grows (rows are kept by position).\n *\n * ## The host owns authority\n *\n * `actions` is a slot. The plan neither enables nor disables what is in it, and\n * with no `actions` there are no controls — a plan the reader may not approve\n * simply has no Approve button.\n *\n * A `Plan` is a line: place it inside a `Trace`.\n */\nexport type PlanStepStatus = TaskItemStatus\n\nexport type PlanStep = Readonly<{\n id?: string\n label: string\n description?: string\n status?: PlanStepStatus\n}>\n\nexport type PlanProps = Omit<\n TraceLineProps,\n 'description' | 'href' | 'onSelect' | 'selectHaspopup' | 'children' | 'status' | 'statusLabel'\n> & {\n steps: readonly PlanStep[]\n /** What the plan is for, above the steps. */\n description?: JSX.Element\n /** True while the plan is still being generated. */\n streaming?: boolean\n /** Controls for the reader: approve, edit, run. Absent means there are none. */\n actions?: JSX.Element\n}\n\nexport function Plan(props: PlanProps) {\n const [local, rest] = splitProps(props, [\n 'steps',\n 'description',\n 'streaming',\n 'actions',\n 'icon',\n 'meta',\n 'defaultOpen',\n ])\n const progress = createMemo(() => (local.streaming ? undefined : taskProgress(local.steps)))\n const meta = () => {\n if (local.meta !== undefined) return local.meta\n if (local.streaming) return 'Drafting'\n const value = progress()\n return value ? taskProgressLabel(value) : undefined\n }\n const description = resolveChildren(() => local.description)\n const actions = resolveChildren(() => local.actions)\n const hasDetail = () =>\n local.steps.length > 0 || description() != null || actions() != null || local.streaming === true\n\n const detail = () => (\n <TraceDetail class=\"flex flex-col gap-2\">\n <Show when={description()}>\n {(descriptionSlot) => <div class=\"text-sm text-muted-foreground\">{descriptionSlot()}</div>}\n </Show>\n <Show when={progress()}>\n {(value) => (\n <Progress\n value={value().done}\n minValue={0}\n maxValue={Math.max(1, value().total)}\n aria-label=\"Plan progress\"\n getValueLabel={({ value: done, max }) =>\n `${done} of ${max} ${max === 1 ? 'step' : 'steps'} done`\n }\n />\n )}\n </Show>\n <Show when={local.steps.length > 0}>\n <TaskItemList label=\"Plan steps\">\n <Index each={local.steps}>\n {(step) => (\n <TaskItemRow\n text={step().label}\n description={step().description}\n status={step().status}\n />\n )}\n </Index>\n </TaskItemList>\n </Show>\n <Show when={local.streaming}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n <Show when={actions()}>\n {(actionsSlot) => (\n <div data-slot=\"plan-actions\" class=\"flex flex-wrap items-center gap-2 pt-1\">\n {actionsSlot()}\n </div>\n )}\n </Show>\n </TraceDetail>\n )\n\n return (\n <TraceLine\n icon={local.icon ?? <ListTodo />}\n status={local.streaming ? 'running' : undefined}\n statusLabel=\"Generating\"\n meta={meta()}\n defaultOpen={local.defaultOpen ?? true}\n {...rest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GAAA,OAAEA,KAAK;EAAC;EAAA,IACZ4B,cAAW;GAAA,OAAEhC,MAAMgC,eAAe;EAAI;CAAA,GAClC/B,MAAI,EAAA,IAAAvB,WAAA;EAAA,OAEP4B,UAAU,IAAIE,SAASL,KAAAA;CAAS,EAAA,CAAA,CAAA;AAGvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/queue/queue.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/queue/queue.tsx"],"names":[],"mappings":"AAOA,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,GAAG,EACT,MAAM,UAAU,CAAA;AAEjB,OAAO,EAAE,KAAK,EAAa,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAWlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,UAAU,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC,CAAA;AAEpF,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,eAAe,CAAA;CACzB,CAAC,CAAA;AAEF,+EAA+E;AAC/E,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,QAAQ,CAAC;IACpE,OAAO,EAAE,SAAS,SAAS,EAAE,CAAA;IAC7B,SAAS,EAAE,SAAS,SAAS,EAAE,CAAA;CAChC,CAAC,CAKD;AAgBD,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACxE,KAAK,EAAE,SAAS,SAAS,EAAE,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACnB,4CAA4C;IAC5C,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B,CAAA;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,eA2EtC;AAED,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB,CAAC,CAAA;AAuDF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACjF,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;IAC/B,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,eAqBxD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Button } from "../../ui/button/button.js";
|
|
2
2
|
import { Trace, TraceLine } from "../../ui/trace/trace.js";
|
|
3
3
|
import { TaskItemList, TaskItemRow } from "../task/task.js";
|
|
4
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
4
5
|
import { createComponent, effect, insert, mergeProps, setAttribute, template } from "solid-js/web";
|
|
5
6
|
import { CornerDownRight, ListChecks, ListTodo, MessageSquarePlus, X } from "lucide-solid";
|
|
6
7
|
import { Index, Show, createMemo, onCleanup, splitProps } from "solid-js";
|
|
@@ -8,6 +9,11 @@ import { Index, Show, createMemo, onCleanup, splitProps } from "solid-js";
|
|
|
8
9
|
var _tmpl$ = /*#__PURE__*/ template(`<span aria-hidden=true>`);
|
|
9
10
|
var _tmpl$2 = /*#__PURE__*/ template(`<span class=sr-only>`);
|
|
10
11
|
var _tmpl$3 = /*#__PURE__*/ template(`<li data-slot=queue-follow-up class="flex min-w-0 items-start gap-2 rounded-md px-1.5 py-0.5"><p class="m-0 line-clamp-3 min-w-0 flex-1 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap text-foreground">`);
|
|
12
|
+
var CornerDownRight$1 = fastIcon(CornerDownRight);
|
|
13
|
+
var ListChecks$1 = fastIcon(ListChecks);
|
|
14
|
+
var ListTodo$1 = fastIcon(ListTodo);
|
|
15
|
+
var MessageSquarePlus$1 = fastIcon(MessageSquarePlus);
|
|
16
|
+
var X$1 = fastIcon(X);
|
|
11
17
|
/** Split a todo list into the two sections. Order is preserved within each. */
|
|
12
18
|
function partitionQueue(items) {
|
|
13
19
|
return {
|
|
@@ -68,7 +74,7 @@ function Queue(props) {
|
|
|
68
74
|
get children() {
|
|
69
75
|
return createComponent(TraceLine, {
|
|
70
76
|
get icon() {
|
|
71
|
-
return createComponent(ListTodo, {});
|
|
77
|
+
return createComponent(ListTodo$1, {});
|
|
72
78
|
},
|
|
73
79
|
get title() {
|
|
74
80
|
return pendingLabel();
|
|
@@ -111,7 +117,7 @@ function Queue(props) {
|
|
|
111
117
|
get children() {
|
|
112
118
|
return createComponent(TraceLine, {
|
|
113
119
|
get icon() {
|
|
114
|
-
return createComponent(ListChecks, {});
|
|
120
|
+
return createComponent(ListChecks$1, {});
|
|
115
121
|
},
|
|
116
122
|
get title() {
|
|
117
123
|
return completedLabel();
|
|
@@ -164,7 +170,7 @@ function FollowUpRow(props) {
|
|
|
164
170
|
const label = () => props.item.text.length > REMOVE_LABEL_CHARS ? `${props.item.text.slice(0, REMOVE_LABEL_CHARS)}…` : props.item.text;
|
|
165
171
|
return (() => {
|
|
166
172
|
var _el$3 = _tmpl$3(), _el$4 = _el$3.firstChild;
|
|
167
|
-
insert(_el$3, createComponent(CornerDownRight, {
|
|
173
|
+
insert(_el$3, createComponent(CornerDownRight$1, {
|
|
168
174
|
"aria-hidden": "true",
|
|
169
175
|
"class": "mt-0.5 size-3.5 shrink-0 text-muted-foreground"
|
|
170
176
|
}), _el$4);
|
|
@@ -185,7 +191,7 @@ function FollowUpRow(props) {
|
|
|
185
191
|
},
|
|
186
192
|
onClick: () => onRemove()(),
|
|
187
193
|
get children() {
|
|
188
|
-
return createComponent(X, { "aria-hidden": "true" });
|
|
194
|
+
return createComponent(X$1, { "aria-hidden": "true" });
|
|
189
195
|
}
|
|
190
196
|
})
|
|
191
197
|
}), null);
|
|
@@ -218,7 +224,7 @@ function QueueFollowUps(props) {
|
|
|
218
224
|
} }, rest, { get children() {
|
|
219
225
|
return createComponent(TraceLine, {
|
|
220
226
|
get icon() {
|
|
221
|
-
return createComponent(MessageSquarePlus, {});
|
|
227
|
+
return createComponent(MessageSquarePlus$1, {});
|
|
222
228
|
},
|
|
223
229
|
get title() {
|
|
224
230
|
return title();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.js","names":["CornerDownRight","ListChecks","ListTodo","MessageSquarePlus","X","createMemo","Index","onCleanup","Show","splitProps","Button","Trace","TraceLine","TaskItemList","TaskItemRow","text","description","status","partitionQueue","items","pending","completed","filter","item","itemCount","count","Count","props","noun","_el$","_tmpl$","_$insert","_el$2","_tmpl$2","pendingLabel","completedLabel","empty","defaultCompletedOpen","Queue","local","rest","sections","_$createComponent","when","length","fallback","children","emptySlot","_$mergeProps","title","icon","meta","defaultOpen","label","each","onRemove","REMOVE_LABEL_CHARS","FollowUpRow","remove","document","activeElement","buttons","closest","querySelectorAll","previous","Array","from","button","at","focus","slice","_el$3","_tmpl$3","_el$4","firstChild","ref","element","type","variant","size","onClick","_$effect","_$setAttribute","QueueFollowUps"],"sources":["../../../../src/components/composites/queue/queue.tsx"],"sourcesContent":["import { CornerDownRight, ListChecks, ListTodo, MessageSquarePlus, X } from 'lucide-solid'\nimport {\n createMemo,\n Index,\n onCleanup,\n Show,\n splitProps,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { Button } from '../../ui/button'\nimport { Trace, TraceLine, type WorkStatus } from '../../ui/trace'\nimport { TaskItemList, TaskItemRow } from '../task'\n\n/**\n * Queue.\n *\n * The agent's todo list, split the way a reader asks about it: what is still to\n * do, and what is already done. Two collapsible sections with their counts,\n * \"Pending\" open and \"Completed\" folded — the finished work is the record, the\n * pending work is the question. Reach for `Plan` when the list is a proposal\n * awaiting a decision, for `Task` when it is one piece of work with files\n * attached, and for `QueueFollowUps` (below) when the things waiting are\n * *messages from the person*, not work the agent set itself.\n *\n * ## Sorting is the host's statement, not ours\n *\n * An item is in the Completed section only if its `status` is `complete`.\n * Everything else — `pending`, `active`, or no status at all — is still to do,\n * which is what \"not marked done\" means; the mark shown matches (an item with\n * no status gets the pending mark, because it is in the Pending section). An\n * empty section is not drawn: \"Completed (0)\" is noise, and a list with nothing\n * in either section renders nothing, or the `empty` content if the host gave\n * some, rather than a heading over a void.\n *\n * ## Bounded\n *\n * Each section scrolls inside a capped, keyboard-focusable region, and rows are\n * kept by position, so a list of two hundred items does not push the answer out\n * of view and a status change updates a row instead of recreating it. Item text\n * wraps to three lines and is clamped (see `Task`).\n *\n * A `Queue` is a block (its own `Trace`) and can sit between other parts of a\n * turn.\n */\nexport type QueueItemStatus = Extract<WorkStatus, 'pending' | 'active' | 'complete'>\n\nexport type QueueItem = Readonly<{\n id?: string\n text: string\n description?: string\n status?: QueueItemStatus\n}>\n\n/** Split a todo list into the two sections. Order is preserved within each. */\nexport function partitionQueue(items: readonly QueueItem[]): Readonly<{\n pending: readonly QueueItem[]\n completed: readonly QueueItem[]\n}> {\n return {\n pending: items.filter((item) => item.status !== 'complete'),\n completed: items.filter((item) => item.status === 'complete'),\n }\n}\n\nfunction itemCount(count: number): string {\n return `${count} ${count === 1 ? 'item' : 'items'}`\n}\n\n/** The count, shown as a number and spoken as a phrase. */\nfunction Count(props: { count: number; noun?: string }) {\n return (\n <>\n <span aria-hidden=\"true\">{props.count}</span>\n <span class=\"sr-only\">{props.noun ?? itemCount(props.count)}</span>\n </>\n )\n}\n\nexport type QueueProps = Omit<ComponentProps<typeof Trace>, 'children'> & {\n items: readonly QueueItem[]\n pendingLabel?: string\n completedLabel?: string\n /** Shown when there is nothing in either section. Omit to draw nothing. */\n empty?: JSX.Element\n /** Open the Completed section initially. */\n defaultCompletedOpen?: boolean\n}\n\nexport function Queue(props: QueueProps) {\n const [local, rest] = splitProps(props, [\n 'items',\n 'pendingLabel',\n 'completedLabel',\n 'empty',\n 'defaultCompletedOpen',\n ])\n const sections = createMemo(() => partitionQueue(local.items))\n const pending = () => sections().pending\n const completed = () => sections().completed\n const pendingLabel = () => local.pendingLabel ?? 'Pending'\n const completedLabel = () => local.completedLabel ?? 'Completed'\n\n return (\n <Show\n when={local.items.length > 0}\n fallback={\n <Show when={local.empty}>\n {(emptySlot) => (\n <Trace aria-label=\"Queue\" {...rest}>\n <TraceLine title={emptySlot()} />\n </Trace>\n )}\n </Show>\n }\n >\n <Trace aria-label=\"Queue\" {...rest}>\n <Show when={pending().length > 0}>\n <TraceLine\n icon={<ListTodo />}\n title={pendingLabel()}\n meta={<Count count={pending().length} />}\n defaultOpen\n >\n {() => (\n <TaskItemList label={pendingLabel()}>\n <Index each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </Index>\n </TaskItemList>\n )}\n </TraceLine>\n </Show>\n <Show when={completed().length > 0}>\n <TraceLine\n icon={<ListChecks />}\n title={completedLabel()}\n meta={<Count count={completed().length} />}\n defaultOpen={local.defaultCompletedOpen ?? false}\n >\n {() => (\n <TaskItemList label={completedLabel()}>\n <Index each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </Index>\n </TaskItemList>\n )}\n </TraceLine>\n </Show>\n </Trace>\n </Show>\n )\n}\n\nexport type QueueFollowUp = Readonly<{\n id?: string\n text: string\n /** Removes it from the queue. Omit it and the row has no remove control. */\n onRemove?: () => void\n}>\n\nconst REMOVE_LABEL_CHARS = 60\n\nfunction FollowUpRow(props: { item: QueueFollowUp }) {\n let remove: HTMLButtonElement | undefined\n\n // Rows are kept by position, so removing a middle row leaves the focused\n // button where it is (now on the next message). Only the last row is ever\n // disposed under focus; hand focus to the one before it rather than to `body`.\n onCleanup(() => {\n if (!remove || document.activeElement !== remove) return\n const buttons = remove\n .closest('ul')\n ?.querySelectorAll<HTMLButtonElement>('button[data-slot=\"queue-follow-up-remove\"]')\n const previous = Array.from(buttons ?? []).filter((button) => button !== remove)\n previous.at(-1)?.focus()\n })\n\n const text = () =>\n props.item.text.length > 1_000 ? `${props.item.text.slice(0, 1_000)}…` : props.item.text\n const label = () =>\n props.item.text.length > REMOVE_LABEL_CHARS\n ? `${props.item.text.slice(0, REMOVE_LABEL_CHARS)}…`\n : props.item.text\n\n return (\n <li data-slot=\"queue-follow-up\" class=\"flex min-w-0 items-start gap-2 rounded-md px-1.5 py-0.5\">\n <CornerDownRight aria-hidden=\"true\" class=\"mt-0.5 size-3.5 shrink-0 text-muted-foreground\" />\n <p\n title={text()}\n class=\"m-0 line-clamp-3 min-w-0 flex-1 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap text-foreground\"\n >\n {text()}\n </p>\n <Show when={props.item.onRemove}>\n {(onRemove) => (\n <Button\n ref={(element) => (remove = element)}\n data-slot=\"queue-follow-up-remove\"\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={`Remove queued message: ${label()}`}\n onClick={() => onRemove()()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n )}\n </Show>\n </li>\n )\n}\n\nexport type QueueFollowUpsProps = Omit<ComponentProps<typeof Trace>, 'children'> & {\n items: readonly QueueFollowUp[]\n /** The section's title. */\n title?: string\n defaultOpen?: boolean\n}\n\n/**\n * Follow-up messages the person sent that have not been delivered yet. They are\n * the person's words, so they are shown as sent (wrapped, clamped to three\n * lines) rather than as work. The remove control exists per message only when\n * that message carries `onRemove`: whether it may still be withdrawn is the\n * runtime's to say, and a message past recall simply has no button. With no\n * messages the component draws nothing.\n */\nexport function QueueFollowUps(props: QueueFollowUpsProps) {\n const [local, rest] = splitProps(props, ['items', 'title', 'defaultOpen'])\n const title = () => local.title ?? 'Queued follow-ups'\n return (\n <Show when={local.items.length > 0}>\n <Trace aria-label={title()} {...rest}>\n <TraceLine\n icon={<MessageSquarePlus />}\n title={title()}\n meta={<Count count={local.items.length} noun={`${local.items.length} waiting`} />}\n defaultOpen={local.defaultOpen ?? true}\n >\n {() => (\n <TaskItemList label={title()}>\n <Index each={local.items}>{(item) => <FollowUpRow item={item()} />}</Index>\n </TaskItemList>\n )}\n </TraceLine>\n </Trace>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;AAuDA,SAAgBkB,eAAeC,OAG5B;CACD,OAAO;EACLC,SAASD,MAAMG,QAAQC,SAASA,KAAKN,WAAW,UAAU;EAC1DI,WAAWF,MAAMG,QAAQC,SAASA,KAAKN,WAAW,UAAU;CAC9D;AACF;AAEA,SAASO,UAAUC,OAAuB;CACxC,OAAO,GAAGA,MAAK,GAAIA,UAAU,IAAI,SAAS;AAC5C;;AAGA,SAASC,MAAMC,OAAyC;CACtD,OAAA,QAAA;EAAA,IAAAE,OAAAC,OAAA;EAAAC,OAAAF,YAE8BF,MAAMF,KAAK;EAAA,OAAAI;CAAA,EAAA,CAAA,UAAA;EAAA,IAAAG,QAAAC,QAAA;EAAAF,OAAAC,aACdL,MAAMC,QAAQJ,UAAUG,MAAMF,KAAK,CAAC;EAAA,OAAAO;CAAA,EAAA,CAAA,CAAA;AAGjE;AAYA,SAAgBM,MAAMX,OAAmB;CACvC,MAAM,CAACY,OAAOC,QAAQ/B,WAAWkB,OAAO;EACtC;EACA;EACA;EACA;EACA;CAAsB,CACvB;CACD,MAAMc,WAAWpC,iBAAiBa,eAAeqB,MAAMpB,KAAK,CAAC;CAC7D,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{"version":3,"file":"queue.js","names":["CornerDownRight","LucideCornerDownRight","ListChecks","LucideListChecks","ListTodo","LucideListTodo","MessageSquarePlus","LucideMessageSquarePlus","X","LucideX","createMemo","Index","onCleanup","Show","splitProps","Button","Trace","TraceLine","TaskItemList","TaskItemRow","fastIcon","text","description","status","partitionQueue","items","pending","completed","filter","item","itemCount","count","Count","props","noun","_el$","_tmpl$","_$insert","_el$2","_tmpl$2","pendingLabel","completedLabel","empty","defaultCompletedOpen","Queue","local","rest","sections","_$createComponent","when","length","fallback","children","emptySlot","_$mergeProps","title","icon","meta","defaultOpen","label","each","onRemove","REMOVE_LABEL_CHARS","FollowUpRow","remove","document","activeElement","buttons","closest","querySelectorAll","previous","Array","from","button","at","focus","slice","_el$3","_tmpl$3","_el$4","firstChild","ref","element","type","variant","size","onClick","_$effect","_$setAttribute","QueueFollowUps"],"sources":["../../../../src/components/composites/queue/queue.tsx"],"sourcesContent":["import {\n CornerDownRight as LucideCornerDownRight,\n ListChecks as LucideListChecks,\n ListTodo as LucideListTodo,\n MessageSquarePlus as LucideMessageSquarePlus,\n X as LucideX,\n} from 'lucide-solid'\nimport {\n createMemo,\n Index,\n onCleanup,\n Show,\n splitProps,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { Button } from '../../ui/button'\nimport { Trace, TraceLine, type WorkStatus } from '../../ui/trace'\nimport { TaskItemList, TaskItemRow } from '../task'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst CornerDownRight = fastIcon(LucideCornerDownRight)\nconst ListChecks = fastIcon(LucideListChecks)\nconst ListTodo = fastIcon(LucideListTodo)\nconst MessageSquarePlus = fastIcon(LucideMessageSquarePlus)\nconst X = fastIcon(LucideX)\n\n/**\n * Queue.\n *\n * The agent's todo list, split the way a reader asks about it: what is still to\n * do, and what is already done. Two collapsible sections with their counts,\n * \"Pending\" open and \"Completed\" folded — the finished work is the record, the\n * pending work is the question. Reach for `Plan` when the list is a proposal\n * awaiting a decision, for `Task` when it is one piece of work with files\n * attached, and for `QueueFollowUps` (below) when the things waiting are\n * *messages from the person*, not work the agent set itself.\n *\n * ## Sorting is the host's statement, not ours\n *\n * An item is in the Completed section only if its `status` is `complete`.\n * Everything else — `pending`, `active`, or no status at all — is still to do,\n * which is what \"not marked done\" means; the mark shown matches (an item with\n * no status gets the pending mark, because it is in the Pending section). An\n * empty section is not drawn: \"Completed (0)\" is noise, and a list with nothing\n * in either section renders nothing, or the `empty` content if the host gave\n * some, rather than a heading over a void.\n *\n * ## Bounded\n *\n * Each section scrolls inside a capped, keyboard-focusable region, and rows are\n * kept by position, so a list of two hundred items does not push the answer out\n * of view and a status change updates a row instead of recreating it. Item text\n * wraps to three lines and is clamped (see `Task`).\n *\n * A `Queue` is a block (its own `Trace`) and can sit between other parts of a\n * turn.\n */\nexport type QueueItemStatus = Extract<WorkStatus, 'pending' | 'active' | 'complete'>\n\nexport type QueueItem = Readonly<{\n id?: string\n text: string\n description?: string\n status?: QueueItemStatus\n}>\n\n/** Split a todo list into the two sections. Order is preserved within each. */\nexport function partitionQueue(items: readonly QueueItem[]): Readonly<{\n pending: readonly QueueItem[]\n completed: readonly QueueItem[]\n}> {\n return {\n pending: items.filter((item) => item.status !== 'complete'),\n completed: items.filter((item) => item.status === 'complete'),\n }\n}\n\nfunction itemCount(count: number): string {\n return `${count} ${count === 1 ? 'item' : 'items'}`\n}\n\n/** The count, shown as a number and spoken as a phrase. */\nfunction Count(props: { count: number; noun?: string }) {\n return (\n <>\n <span aria-hidden=\"true\">{props.count}</span>\n <span class=\"sr-only\">{props.noun ?? itemCount(props.count)}</span>\n </>\n )\n}\n\nexport type QueueProps = Omit<ComponentProps<typeof Trace>, 'children'> & {\n items: readonly QueueItem[]\n pendingLabel?: string\n completedLabel?: string\n /** Shown when there is nothing in either section. Omit to draw nothing. */\n empty?: JSX.Element\n /** Open the Completed section initially. */\n defaultCompletedOpen?: boolean\n}\n\nexport function Queue(props: QueueProps) {\n const [local, rest] = splitProps(props, [\n 'items',\n 'pendingLabel',\n 'completedLabel',\n 'empty',\n 'defaultCompletedOpen',\n ])\n const sections = createMemo(() => partitionQueue(local.items))\n const pending = () => sections().pending\n const completed = () => sections().completed\n const pendingLabel = () => local.pendingLabel ?? 'Pending'\n const completedLabel = () => local.completedLabel ?? 'Completed'\n\n return (\n <Show\n when={local.items.length > 0}\n fallback={\n <Show when={local.empty}>\n {(emptySlot) => (\n <Trace aria-label=\"Queue\" {...rest}>\n <TraceLine title={emptySlot()} />\n </Trace>\n )}\n </Show>\n }\n >\n <Trace aria-label=\"Queue\" {...rest}>\n <Show when={pending().length > 0}>\n <TraceLine\n icon={<ListTodo />}\n title={pendingLabel()}\n meta={<Count count={pending().length} />}\n defaultOpen\n >\n {() => (\n <TaskItemList label={pendingLabel()}>\n <Index each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </Index>\n </TaskItemList>\n )}\n </TraceLine>\n </Show>\n <Show when={completed().length > 0}>\n <TraceLine\n icon={<ListChecks />}\n title={completedLabel()}\n meta={<Count count={completed().length} />}\n defaultOpen={local.defaultCompletedOpen ?? false}\n >\n {() => (\n <TaskItemList label={completedLabel()}>\n <Index each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </Index>\n </TaskItemList>\n )}\n </TraceLine>\n </Show>\n </Trace>\n </Show>\n )\n}\n\nexport type QueueFollowUp = Readonly<{\n id?: string\n text: string\n /** Removes it from the queue. Omit it and the row has no remove control. */\n onRemove?: () => void\n}>\n\nconst REMOVE_LABEL_CHARS = 60\n\nfunction FollowUpRow(props: { item: QueueFollowUp }) {\n let remove: HTMLButtonElement | undefined\n\n // Rows are kept by position, so removing a middle row leaves the focused\n // button where it is (now on the next message). Only the last row is ever\n // disposed under focus; hand focus to the one before it rather than to `body`.\n onCleanup(() => {\n if (!remove || document.activeElement !== remove) return\n const buttons = remove\n .closest('ul')\n ?.querySelectorAll<HTMLButtonElement>('button[data-slot=\"queue-follow-up-remove\"]')\n const previous = Array.from(buttons ?? []).filter((button) => button !== remove)\n previous.at(-1)?.focus()\n })\n\n const text = () =>\n props.item.text.length > 1_000 ? `${props.item.text.slice(0, 1_000)}…` : props.item.text\n const label = () =>\n props.item.text.length > REMOVE_LABEL_CHARS\n ? `${props.item.text.slice(0, REMOVE_LABEL_CHARS)}…`\n : props.item.text\n\n return (\n <li data-slot=\"queue-follow-up\" class=\"flex min-w-0 items-start gap-2 rounded-md px-1.5 py-0.5\">\n <CornerDownRight aria-hidden=\"true\" class=\"mt-0.5 size-3.5 shrink-0 text-muted-foreground\" />\n <p\n title={text()}\n class=\"m-0 line-clamp-3 min-w-0 flex-1 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap text-foreground\"\n >\n {text()}\n </p>\n <Show when={props.item.onRemove}>\n {(onRemove) => (\n <Button\n ref={(element) => (remove = element)}\n data-slot=\"queue-follow-up-remove\"\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={`Remove queued message: ${label()}`}\n onClick={() => onRemove()()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n )}\n </Show>\n </li>\n )\n}\n\nexport type QueueFollowUpsProps = Omit<ComponentProps<typeof Trace>, 'children'> & {\n items: readonly QueueFollowUp[]\n /** The section's title. */\n title?: string\n defaultOpen?: boolean\n}\n\n/**\n * Follow-up messages the person sent that have not been delivered yet. They are\n * the person's words, so they are shown as sent (wrapped, clamped to three\n * lines) rather than as work. The remove control exists per message only when\n * that message carries `onRemove`: whether it may still be withdrawn is the\n * runtime's to say, and a message past recall simply has no button. With no\n * messages the component draws nothing.\n */\nexport function QueueFollowUps(props: QueueFollowUpsProps) {\n const [local, rest] = splitProps(props, ['items', 'title', 'defaultOpen'])\n const title = () => local.title ?? 'Queued follow-ups'\n return (\n <Show when={local.items.length > 0}>\n <Trace aria-label={title()} {...rest}>\n <TraceLine\n icon={<MessageSquarePlus />}\n title={title()}\n meta={<Count count={local.items.length} noun={`${local.items.length} waiting`} />}\n defaultOpen={local.defaultOpen ?? true}\n >\n {() => (\n <TaskItemList label={title()}>\n <Index each={local.items}>{(item) => <FollowUpRow item={item()} />}</Index>\n </TaskItemList>\n )}\n </TraceLine>\n </Trace>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;AAsBA,IAAMA,oBAAkBoB,SAASnB,eAAqB;AACtD,IAAMC,eAAakB,SAASjB,UAAgB;AAC5C,IAAMC,aAAWgB,SAASf,QAAc;AACxC,IAAMC,sBAAoBc,SAASb,iBAAuB;AAC1D,IAAMC,MAAIY,SAASX,CAAO;;AA2C1B,SAAgBe,eAAeC,OAG5B;CACD,OAAO;EACLC,SAASD,MAAMG,QAAQC,SAASA,KAAKN,WAAW,UAAU;EAC1DI,WAAWF,MAAMG,QAAQC,SAASA,KAAKN,WAAW,UAAU;CAC9D;AACF;AAEA,SAASO,UAAUC,OAAuB;CACxC,OAAO,GAAGA,MAAK,GAAIA,UAAU,IAAI,SAAS;AAC5C;;AAGA,SAASC,MAAMC,OAAyC;CACtD,OAAA,QAAA;EAAA,IAAAE,OAAAC,OAAA;EAAAC,OAAAF,YAE8BF,MAAMF,KAAK;EAAA,OAAAI;CAAA,EAAA,CAAA,UAAA;EAAA,IAAAG,QAAAC,QAAA;EAAAF,OAAAC,aACdL,MAAMC,QAAQJ,UAAUG,MAAMF,KAAK,CAAC;EAAA,OAAAO;CAAA,EAAA,CAAA,CAAA;AAGjE;AAYA,SAAgBM,MAAMX,OAAmB;CACvC,MAAM,CAACY,OAAOC,QAAQhC,WAAWmB,OAAO;EACtC;EACA;EACA;EACA;EACA;CAAsB,CACvB;CACD,MAAMc,WAAWrC,iBAAiBc,eAAeqB,MAAMpB,KAAK,CAAC;CAC7D,MAAMC,gBAAgBqB,SAAS,CAAC,CAACrB;CACjC,MAAMC,kBAAkBoB,SAAS,CAAC,CAACpB;CACnC,MAAMa,qBA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mappings":"AACA,OAAO,EAA8C,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAI/E,OAAO,EAAE,cAAc,EAA0B,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"reasoning.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/reasoning/reasoning.tsx"],"names":[],"mappings":"AACA,OAAO,EAA8C,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAI/E,OAAO,EAAE,cAAc,EAA0B,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAM5F,OAAO,EAAE,cAAc,EAAE,CAAA;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,yFAAyF;AACzF,wBAAgB,cAAc,CAAC,KAAK,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAIxF;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,cAAc,EACZ,OAAO,GACP,aAAa,GACb,QAAQ,GACR,aAAa,GACb,aAAa,GACb,UAAU,GACV,MAAM,GACN,UAAU,GACV,gBAAgB,CACnB,GAAG;IACF,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,wCAAwC;IACxC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,mEAAmE;IACnE,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACpB,CAAA;AAiCD,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,eA8C9C"}
|
|
@@ -2,10 +2,12 @@ import { isAtEnd, scrollGeometry } from "../../../lib/scroll-geometry.js";
|
|
|
2
2
|
import { MessageText } from "../../ui/message/message.js";
|
|
3
3
|
import { ScrollArea } from "../../ui/scroll-area/scroll-area.js";
|
|
4
4
|
import { TraceDetail, TraceLine, formatDuration } from "../../ui/trace/trace.js";
|
|
5
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
5
6
|
import { createComponent, mergeProps } from "solid-js/web";
|
|
6
7
|
import { Brain } from "lucide-solid";
|
|
7
8
|
import { createEffect, createSignal, on, splitProps } from "solid-js";
|
|
8
9
|
// src/components/composites/reasoning/reasoning.tsx
|
|
10
|
+
var Brain$1 = fastIcon(Brain);
|
|
9
11
|
/**
|
|
10
12
|
* Reasoning.
|
|
11
13
|
*
|
|
@@ -112,7 +114,7 @@ function Reasoning(props) {
|
|
|
112
114
|
});
|
|
113
115
|
return createComponent(TraceLine, mergeProps({
|
|
114
116
|
get icon() {
|
|
115
|
-
return local.icon ?? createComponent(Brain, {});
|
|
117
|
+
return local.icon ?? createComponent(Brain$1, {});
|
|
116
118
|
},
|
|
117
119
|
get title() {
|
|
118
120
|
return local.title ?? reasoningTitle({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reasoning.js","names":["Brain","createEffect","createSignal","on","splitProps","isAtEnd","scrollGeometry","MessageText","ScrollArea","formatDuration","TraceDetail","TraceLine","reasoningTitle","state","streaming","duration","text","title","ReasoningBody","props","scroller","following","scrollTop","scrollHeight","_$createComponent","children","ref","element","role","onScroll","event","currentTarget","codeBlockProps","maxHeight","wrap","Reasoning","local","rest","chosen","setChosen","open","hasBody","trim","undefined","defer","body","_$mergeProps","icon","status","statusLabel","onOpenChange","value"],"sources":["../../../../src/components/composites/reasoning/reasoning.tsx"],"sourcesContent":["import { Brain } from 'lucide-solid'\nimport { createEffect, createSignal, on, splitProps, type JSX } from 'solid-js'\nimport { isAtEnd, scrollGeometry } from '#lib/scroll-geometry'\nimport { MessageText } from '../../ui/message'\nimport { ScrollArea } from '../../ui/scroll-area'\nimport { formatDuration, TraceDetail, TraceLine, type TraceLineProps } from '../../ui/trace'\n\nexport { formatDuration }\n\n/**\n * Reasoning.\n *\n * The agent's thinking, as a `TraceLine`: a title that says what state it is in,\n * and a body that is the text the host chose to show. Reach for `ChainOfThought`\n * when the thinking is a sequence of discrete steps with their own status, and\n * for a plain `MessageText` when the text is simply part of the answer.\n *\n * ## It shows what it is given, and nothing else\n *\n * `text` is whatever the host has decided is user-visible, a provider's reasoning\n * summary, a model's visible scratchpad. This component never implies there is\n * more behind it: no \"show full reasoning\" control, no placeholder body, no\n * ellipsis standing in for hidden content. With no `text` and no `streaming` the\n * line is a plain, non-expandable line titled \"Reasoning\", because there is\n * nothing to open.\n *\n * ## The title is the state\n *\n * - `streaming`: \"Thinking…\", with the running mark and shimmer.\n * - finished with a `duration` (seconds): \"Thought for 4s\".\n * - finished without one: \"Reasoning\". A duration the host did not measure is\n * not invented.\n *\n * ## Open while it is arriving, closed once it is done\n *\n * While streaming the body is open so the reader can follow along; when the\n * stream ends it folds away so the settled transcript stays one quiet column. The\n * reader's own toggle wins in both directions and is remembered until the next\n * stream begins, so someone who closed it mid-stream is not re-opened and\n * someone who opened it afterwards is not folded. Pass `open` and `onOpenChange`\n * to own the state instead.\n *\n * ## Bounded, and stable while it grows\n *\n * The body is `MessageText`, so the text is untrusted and rendered as text (see\n * its doc comment), and earlier paragraphs keep their DOM while the last one\n * grows. The scroller is capped; while streaming it follows the newest text only\n * if the reader has not scrolled up, so reading the start of a long thought is\n * not interrupted by the end of it.\n */\n\n/** The line's title for a state. Exported so a host can say the same thing elsewhere. */\nexport function reasoningTitle(state: { streaming?: boolean; duration?: number }): string {\n if (state.streaming) return 'Thinking…'\n const duration = formatDuration(state.duration)\n return duration ? `Thought for ${duration}` : 'Reasoning'\n}\n\nexport type ReasoningProps = Omit<\n TraceLineProps,\n | 'title'\n | 'description'\n | 'status'\n | 'statusLabel'\n | 'defaultOpen'\n | 'children'\n | 'href'\n | 'onSelect'\n | 'selectHaspopup'\n> & {\n /** The reasoning the host marked as user-visible. Untrusted text. */\n text?: string\n /** True while text may still arrive. */\n streaming?: boolean\n /** Seconds the thinking took, if the host measured it. */\n duration?: number\n /** Replaces the state-derived title, e.g. for another language. */\n title?: JSX.Element\n}\n\nfunction ReasoningBody(props: { text: string; streaming?: boolean }) {\n let scroller: HTMLDivElement | undefined\n let following = true\n\n createEffect(() => {\n // Read for the dependency: new text is the event that may need following.\n void props.text\n if (props.streaming && following && scroller) scroller.scrollTop = scroller.scrollHeight\n })\n\n return (\n <TraceDetail>\n <ScrollArea\n ref={(element) => (scroller = element)}\n role=\"region\"\n aria-label=\"Reasoning text\"\n class=\"max-h-72\"\n onScroll={(event) => {\n following = isAtEnd(scrollGeometry(event.currentTarget))\n }}\n >\n <MessageText\n text={props.text}\n streaming={props.streaming}\n codeBlockProps={{ maxHeight: '16rem', wrap: true }}\n />\n </ScrollArea>\n </TraceDetail>\n )\n}\n\nexport function Reasoning(props: ReasoningProps) {\n const [local, rest] = splitProps(props, [\n 'text',\n 'streaming',\n 'duration',\n 'title',\n 'icon',\n 'open',\n 'onOpenChange',\n ])\n // `undefined` means \"the reader has not decided\", which is what lets the stream\n // open and close the line on its own.\n const [chosen, setChosen] = createSignal<boolean>()\n const open = () => local.open ?? chosen() ?? local.streaming === true\n const hasBody = () => (local.text ?? '').trim() !== '' || local.streaming === true\n\n createEffect(\n on(\n () => local.streaming,\n (streaming) => {\n if (streaming) setChosen(undefined)\n },\n { defer: true }\n )\n )\n\n const body = () => <ReasoningBody text={local.text ?? ''} streaming={local.streaming} />\n\n return (\n <TraceLine\n icon={local.icon ?? <Brain />}\n title={\n local.title ?? reasoningTitle({ streaming: local.streaming, duration: local.duration })\n }\n status={local.streaming ? 'running' : undefined}\n statusLabel=\"In progress\"\n open={open()}\n onOpenChange={(value) => {\n setChosen(value)\n local.onOpenChange?.(value)\n }}\n {...rest}\n >\n {hasBody() ? body : undefined}\n </TraceLine>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"reasoning.js","names":["Brain","LucideBrain","createEffect","createSignal","on","splitProps","isAtEnd","scrollGeometry","MessageText","ScrollArea","formatDuration","TraceDetail","TraceLine","fastIcon","reasoningTitle","state","streaming","duration","text","title","ReasoningBody","props","scroller","following","scrollTop","scrollHeight","_$createComponent","children","ref","element","role","onScroll","event","currentTarget","codeBlockProps","maxHeight","wrap","Reasoning","local","rest","chosen","setChosen","open","hasBody","trim","undefined","defer","body","_$mergeProps","icon","status","statusLabel","onOpenChange","value"],"sources":["../../../../src/components/composites/reasoning/reasoning.tsx"],"sourcesContent":["import { Brain as LucideBrain } from 'lucide-solid'\nimport { createEffect, createSignal, on, splitProps, type JSX } from 'solid-js'\nimport { isAtEnd, scrollGeometry } from '#lib/scroll-geometry'\nimport { MessageText } from '../../ui/message'\nimport { ScrollArea } from '../../ui/scroll-area'\nimport { formatDuration, TraceDetail, TraceLine, type TraceLineProps } from '../../ui/trace'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Brain = fastIcon(LucideBrain)\n\nexport { formatDuration }\n\n/**\n * Reasoning.\n *\n * The agent's thinking, as a `TraceLine`: a title that says what state it is in,\n * and a body that is the text the host chose to show. Reach for `ChainOfThought`\n * when the thinking is a sequence of discrete steps with their own status, and\n * for a plain `MessageText` when the text is simply part of the answer.\n *\n * ## It shows what it is given, and nothing else\n *\n * `text` is whatever the host has decided is user-visible, a provider's reasoning\n * summary, a model's visible scratchpad. This component never implies there is\n * more behind it: no \"show full reasoning\" control, no placeholder body, no\n * ellipsis standing in for hidden content. With no `text` and no `streaming` the\n * line is a plain, non-expandable line titled \"Reasoning\", because there is\n * nothing to open.\n *\n * ## The title is the state\n *\n * - `streaming`: \"Thinking…\", with the running mark and shimmer.\n * - finished with a `duration` (seconds): \"Thought for 4s\".\n * - finished without one: \"Reasoning\". A duration the host did not measure is\n * not invented.\n *\n * ## Open while it is arriving, closed once it is done\n *\n * While streaming the body is open so the reader can follow along; when the\n * stream ends it folds away so the settled transcript stays one quiet column. The\n * reader's own toggle wins in both directions and is remembered until the next\n * stream begins, so someone who closed it mid-stream is not re-opened and\n * someone who opened it afterwards is not folded. Pass `open` and `onOpenChange`\n * to own the state instead.\n *\n * ## Bounded, and stable while it grows\n *\n * The body is `MessageText`, so the text is untrusted and rendered as text (see\n * its doc comment), and earlier paragraphs keep their DOM while the last one\n * grows. The scroller is capped; while streaming it follows the newest text only\n * if the reader has not scrolled up, so reading the start of a long thought is\n * not interrupted by the end of it.\n */\n\n/** The line's title for a state. Exported so a host can say the same thing elsewhere. */\nexport function reasoningTitle(state: { streaming?: boolean; duration?: number }): string {\n if (state.streaming) return 'Thinking…'\n const duration = formatDuration(state.duration)\n return duration ? `Thought for ${duration}` : 'Reasoning'\n}\n\nexport type ReasoningProps = Omit<\n TraceLineProps,\n | 'title'\n | 'description'\n | 'status'\n | 'statusLabel'\n | 'defaultOpen'\n | 'children'\n | 'href'\n | 'onSelect'\n | 'selectHaspopup'\n> & {\n /** The reasoning the host marked as user-visible. Untrusted text. */\n text?: string\n /** True while text may still arrive. */\n streaming?: boolean\n /** Seconds the thinking took, if the host measured it. */\n duration?: number\n /** Replaces the state-derived title, e.g. for another language. */\n title?: JSX.Element\n}\n\nfunction ReasoningBody(props: { text: string; streaming?: boolean }) {\n let scroller: HTMLDivElement | undefined\n let following = true\n\n createEffect(() => {\n // Read for the dependency: new text is the event that may need following.\n void props.text\n if (props.streaming && following && scroller) scroller.scrollTop = scroller.scrollHeight\n })\n\n return (\n <TraceDetail>\n <ScrollArea\n ref={(element) => (scroller = element)}\n role=\"region\"\n aria-label=\"Reasoning text\"\n class=\"max-h-72\"\n onScroll={(event) => {\n following = isAtEnd(scrollGeometry(event.currentTarget))\n }}\n >\n <MessageText\n text={props.text}\n streaming={props.streaming}\n codeBlockProps={{ maxHeight: '16rem', wrap: true }}\n />\n </ScrollArea>\n </TraceDetail>\n )\n}\n\nexport function Reasoning(props: ReasoningProps) {\n const [local, rest] = splitProps(props, [\n 'text',\n 'streaming',\n 'duration',\n 'title',\n 'icon',\n 'open',\n 'onOpenChange',\n ])\n // `undefined` means \"the reader has not decided\", which is what lets the stream\n // open and close the line on its own.\n const [chosen, setChosen] = createSignal<boolean>()\n const open = () => local.open ?? chosen() ?? local.streaming === true\n const hasBody = () => (local.text ?? '').trim() !== '' || local.streaming === true\n\n createEffect(\n on(\n () => local.streaming,\n (streaming) => {\n if (streaming) setChosen(undefined)\n },\n { defer: true }\n )\n )\n\n const body = () => <ReasoningBody text={local.text ?? ''} streaming={local.streaming} />\n\n return (\n <TraceLine\n icon={local.icon ?? <Brain />}\n title={\n local.title ?? reasoningTitle({ streaming: local.streaming, duration: local.duration })\n }\n status={local.streaming ? 'running' : undefined}\n statusLabel=\"In progress\"\n open={open()}\n onOpenChange={(value) => {\n setChosen(value)\n local.onOpenChange?.(value)\n }}\n {...rest}\n >\n {hasBody() ? body : undefined}\n </TraceLine>\n )\n}\n"],"mappings":";;;;;;;;;AASA,IAAMA,UAAQa,SAASZ,KAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+ClC,SAAgBa,eAAeC,OAA2D;CACxF,IAAIA,MAAMC,WAAW,OAAO;CAC5B,MAAMC,WAAWP,eAAeK,MAAME,QAAQ;CAC9C,OAAOA,WAAW,eAAeA,aAAa;AAChD;AAwBA,SAASG,cAAcC,OAA8C;CACnE,IAAIC;CACJ,IAAIC,YAAY;CAEhBrB,mBAAmB;EAEjB,MAAWgB;EACX,IAAIG,MAAML,aAAaO,aAAaD,UAAUA,SAASE,YAAYF,SAASG;CAC9E,CAAC;CAED,OAAAC,gBACGf,aAAW,EAAA,IAAAgB,WAAA;EAAA,OAAAD,gBACTjB,YAAU;GAAAmB,MACHC,YAAaP,WAAWO;GAC9BC,MAAI;GAAA,cAAA;GAAA,SAAA;GAGJC,WAAWC,UAAU;IACnBT,YAAYjB,QAAQC,eAAeyB,MAAMC,aAAa,CAAC;GACzD;GAAC,IAAAN,WAAA;IAAA,OAAAD,gBAEAlB,aAAW;KAAA,IACVU,OAAI;MAAA,OAAEG,MAAMH;KAAI;KAAA,IAChBF,YAAS;MAAA,OAAEK,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CAAS,EAAA,CAAA,CAAA;AAGnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-controls.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/scene-controls/scene-controls.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scene-controls.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/scene-controls/scene-controls.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAiC,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAYlE,0EAA0E;AAC1E,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CAAA;AAE9E,uEAAuE;AACvE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,cAAc,EAAE,MAAM,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAsBD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,sBAAsB,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IAChF,+DAA+D;IAC/D,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IACzC,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,sEAAsE;IACtE,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAA;CACrC,CAAA;AAmHD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,eAuGtD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ActionButton } from "../action-button/action-button.js";
|
|
2
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
2
3
|
import { createComponent, effect, insert, setAttribute, template } from "solid-js/web";
|
|
3
4
|
import { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, ZoomIn, ZoomOut } from "lucide-solid";
|
|
4
5
|
import { Show, createSignal, onCleanup } from "solid-js";
|
|
@@ -6,6 +7,12 @@ import { Show, createSignal, onCleanup } from "solid-js";
|
|
|
6
7
|
var _tmpl$ = /*#__PURE__*/ template(`<div role=group class="glass-scrim grid min-w-0 max-w-full grid-cols-3 gap-1.5 rounded-3xl p-2"><span aria-hidden=true></span><span aria-hidden=true>`);
|
|
7
8
|
var _tmpl$2 = /*#__PURE__*/ template(`<div role=group class="glass-scrim flex min-w-0 max-w-full flex-wrap gap-1.5 rounded-2xl p-1.5">`);
|
|
8
9
|
var _tmpl$3 = /*#__PURE__*/ template(`<div class="flex min-w-0 max-w-full flex-wrap items-end gap-3"><div class="ml-auto flex min-w-0 max-w-full flex-col items-end gap-2">`);
|
|
10
|
+
var ArrowDown$1 = fastIcon(ArrowDown);
|
|
11
|
+
var ArrowLeft$1 = fastIcon(ArrowLeft);
|
|
12
|
+
var ArrowRight$1 = fastIcon(ArrowRight);
|
|
13
|
+
var ArrowUp$1 = fastIcon(ArrowUp);
|
|
14
|
+
var ZoomIn$1 = fastIcon(ZoomIn);
|
|
15
|
+
var ZoomOut$1 = fastIcon(ZoomOut);
|
|
9
16
|
var DEFAULT_LABELS = {
|
|
10
17
|
movementGroup: "Scene movement controls",
|
|
11
18
|
forward: "Move forward",
|
|
@@ -154,7 +161,7 @@ function SceneControls(props) {
|
|
|
154
161
|
return (pressed) => callback?.("forward", pressed);
|
|
155
162
|
},
|
|
156
163
|
get children() {
|
|
157
|
-
return createComponent(ArrowUp, { "aria-hidden": "true" });
|
|
164
|
+
return createComponent(ArrowUp$1, { "aria-hidden": "true" });
|
|
158
165
|
}
|
|
159
166
|
}), _el$4);
|
|
160
167
|
insert(_el$2, createComponent(HoldAction, {
|
|
@@ -169,7 +176,7 @@ function SceneControls(props) {
|
|
|
169
176
|
return (pressed) => callback?.("left", pressed);
|
|
170
177
|
},
|
|
171
178
|
get children() {
|
|
172
|
-
return createComponent(ArrowLeft, { "aria-hidden": "true" });
|
|
179
|
+
return createComponent(ArrowLeft$1, { "aria-hidden": "true" });
|
|
173
180
|
}
|
|
174
181
|
}), null);
|
|
175
182
|
insert(_el$2, createComponent(HoldAction, {
|
|
@@ -184,7 +191,7 @@ function SceneControls(props) {
|
|
|
184
191
|
return (pressed) => callback?.("backward", pressed);
|
|
185
192
|
},
|
|
186
193
|
get children() {
|
|
187
|
-
return createComponent(ArrowDown, { "aria-hidden": "true" });
|
|
194
|
+
return createComponent(ArrowDown$1, { "aria-hidden": "true" });
|
|
188
195
|
}
|
|
189
196
|
}), null);
|
|
190
197
|
insert(_el$2, createComponent(HoldAction, {
|
|
@@ -199,7 +206,7 @@ function SceneControls(props) {
|
|
|
199
206
|
return (pressed) => callback?.("right", pressed);
|
|
200
207
|
},
|
|
201
208
|
get children() {
|
|
202
|
-
return createComponent(ArrowRight, { "aria-hidden": "true" });
|
|
209
|
+
return createComponent(ArrowRight$1, { "aria-hidden": "true" });
|
|
203
210
|
}
|
|
204
211
|
}), null);
|
|
205
212
|
effect(() => setAttribute(_el$2, "aria-label", labels().movementGroup));
|
|
@@ -229,7 +236,7 @@ function SceneControls(props) {
|
|
|
229
236
|
},
|
|
230
237
|
onClick: () => props.onZoomOut?.(),
|
|
231
238
|
get children() {
|
|
232
|
-
return createComponent(ZoomOut, { "aria-hidden": "true" });
|
|
239
|
+
return createComponent(ZoomOut$1, { "aria-hidden": "true" });
|
|
233
240
|
}
|
|
234
241
|
});
|
|
235
242
|
}
|
|
@@ -251,7 +258,7 @@ function SceneControls(props) {
|
|
|
251
258
|
},
|
|
252
259
|
onClick: () => props.onZoomIn?.(),
|
|
253
260
|
get children() {
|
|
254
|
-
return createComponent(ZoomIn, { "aria-hidden": "true" });
|
|
261
|
+
return createComponent(ZoomIn$1, { "aria-hidden": "true" });
|
|
255
262
|
}
|
|
256
263
|
});
|
|
257
264
|
}
|
|
@@ -277,7 +284,7 @@ function SceneControls(props) {
|
|
|
277
284
|
return (pressed) => callback?.(pressed);
|
|
278
285
|
},
|
|
279
286
|
get children() {
|
|
280
|
-
return createComponent(ArrowUp, { "aria-hidden": "true" });
|
|
287
|
+
return createComponent(ArrowUp$1, { "aria-hidden": "true" });
|
|
281
288
|
}
|
|
282
289
|
});
|
|
283
290
|
}
|