@adea-ai/ui 0.162.6 → 0.162.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/composites/about-dialog/about-dialog.js +5 -5
- package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
- package/dist/components/composites/accent-picker/accent-picker.js +3 -3
- package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
- package/dist/components/composites/accent-picker/custom-color-popover.js +2 -2
- package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +22 -22
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.js +2 -2
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js +3 -3
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +10 -10
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +13 -13
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +12 -12
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.js +13 -13
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.js +9 -9
- package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js +10 -10
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.js +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js +5 -5
- package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
- package/dist/components/composites/chat/chat.js +7 -7
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.js +5 -5
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js +13 -13
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context.js +7 -7
- package/dist/components/composites/context/context.js.map +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.js +9 -9
- package/dist/components/composites/file-tree/file-tree.js.map +1 -1
- package/dist/components/composites/help-center/help-center.js +5 -5
- package/dist/components/composites/help-center/help-center.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js +10 -10
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/icon-picker/image-data-url.js.map +1 -1
- package/dist/components/composites/icon-picker/shell-icons.js +117 -117
- package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.js +7 -7
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js +1 -1
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/list-row/list-row.js +2 -2
- package/dist/components/composites/list-row/list-row.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js +7 -7
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/message-scroller/scroll-anchor.js +1 -1
- package/dist/components/composites/message-scroller/scroll-anchor.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.js +12 -12
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/plan/plan.js +5 -5
- package/dist/components/composites/plan/plan.js.map +1 -1
- package/dist/components/composites/prompt-input/prompt-input.js +3 -3
- package/dist/components/composites/prompt-input/prompt-input.js.map +1 -1
- package/dist/components/composites/queue/queue.js +13 -13
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/reasoning.js +5 -5
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.js +16 -16
- package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
- package/dist/components/composites/settings/settings-layout.js +2 -2
- package/dist/components/composites/settings/settings-layout.js.map +1 -1
- package/dist/components/composites/settings/settings-navigation.js +2 -2
- package/dist/components/composites/settings/settings-navigation.js.map +1 -1
- package/dist/components/composites/settings/settings.js +5 -5
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/sources/sources.js +5 -5
- package/dist/components/composites/sources/sources.js.map +1 -1
- package/dist/components/composites/stack-trace/parse-stack-trace.js +2 -2
- package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js +10 -10
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/stat/stat.js +6 -6
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/subagent/subagent.js +5 -5
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/suggestion/suggestion.js +2 -2
- package/dist/components/composites/suggestion/suggestion.js.map +1 -1
- package/dist/components/composites/task/task.js +5 -5
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/ansi.js +1 -1
- package/dist/components/composites/terminal/ansi.js.map +1 -1
- package/dist/components/composites/terminal/terminal.js +18 -18
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/test-results/test-results.js +17 -17
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.js +5 -5
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree.js +6 -6
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.js +1 -1
- package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +23 -23
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js +2 -2
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +6 -6
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.js +11 -11
- package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
- package/dist/components/conversation/atomic/chat-composer.js +1 -1
- package/dist/components/conversation/busy-send-button.js +10 -10
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/chat-composer.js +1 -1
- package/dist/components/conversation/composer-core.js +1 -1
- package/dist/components/conversation/composer-menu.js +2 -2
- package/dist/components/conversation/composer-menu.js.map +1 -1
- package/dist/components/conversation/conversation-avatar.js +7 -7
- package/dist/components/conversation/conversation-avatar.js.map +1 -1
- package/dist/components/conversation/conversation-pane.js +1 -1
- package/dist/components/conversation/conversation-pane.js.map +1 -1
- package/dist/components/conversation/conversation-surface.js +5 -5
- package/dist/components/conversation/conversation-surface.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +9 -9
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.js +9 -9
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/message-row.js +13 -13
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/paste-token-editor.js +1 -1
- package/dist/components/conversation/paste-token-editor.js.map +1 -1
- package/dist/components/conversation/scroll-follow.js +1 -1
- package/dist/components/conversation/thread-panel.js +5 -5
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/conversation/transcript-composition.js +5 -5
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/layout/app-shell/app-shell.js +1 -1
- package/dist/components/layout/app-shell/app-shell.js.map +1 -1
- package/dist/components/layout/app-shell/skip-link.js +1 -1
- package/dist/components/layout/app-shell/skip-link.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +2 -2
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js +1 -1
- package/dist/components/layout/floating-preview/floating-preview.js +7 -7
- package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
- package/dist/components/layout/orbit-layout/orbit-layout.js +1 -1
- package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -1
- package/dist/components/layout/page/page.js +2 -2
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/panel/panel.js +1 -1
- package/dist/components/layout/panel/panel.js.map +1 -1
- package/dist/components/layout/pixel-pane/pixel-pane.js +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +5 -5
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.js +5 -5
- package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
- package/dist/components/layout/shell-top-bar/shell-top-bar.js +2 -2
- package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js +2 -2
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +5 -5
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/split-layout/pane-focus.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.js +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.js +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +7 -7
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/status-bar/status-bar.js +1 -1
- package/dist/components/layout/status-bar/status-bar.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +5 -5
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/layout/virtual-window/virtual-window.js +1 -1
- package/dist/components/layout/virtual-window/virtual-window.js.map +1 -1
- package/dist/components/motion/presence.js +1 -1
- package/dist/components/theme/appearance-panel.js +3 -3
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/lazy.js +3 -3
- package/dist/components/theme/lazy.js.map +1 -1
- package/dist/components/theme/script-projection.js +1 -1
- package/dist/components/theme/theme-catalogue-source.js +1 -1
- package/dist/components/theme/theme-document.js.map +1 -1
- package/dist/components/theme/theme-mode-toggle.js +7 -7
- package/dist/components/theme/theme-mode-toggle.js.map +1 -1
- package/dist/components/theme/theme-picker.js +2 -2
- package/dist/components/theme/theme-picker.js.map +1 -1
- package/dist/components/theme/theme-provider-value.js +1 -1
- package/dist/components/theme/theme-provider-value.js.map +1 -1
- package/dist/components/theme/theme-provider.js +1 -1
- package/dist/components/theme/theme-toggle.js +7 -7
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/accordion/accordion.js +13 -13
- package/dist/components/ui/accordion/accordion.js.map +1 -1
- package/dist/components/ui/alert/alert.js +12 -12
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.js +14 -14
- package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js +2 -2
- package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
- package/dist/components/ui/aspect-ratio/aspect-ratio.js +1 -1
- package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/components/ui/attachment/attachment.js +16 -16
- package/dist/components/ui/attachment/attachment.js.map +1 -1
- package/dist/components/ui/avatar/avatar.js +1 -1
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/badge/badge.js +2 -2
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/board/board.js +2 -2
- package/dist/components/ui/board/board.js.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js +7 -7
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/ui/bubble/bubble.js +2 -2
- package/dist/components/ui/bubble/bubble.js.map +1 -1
- package/dist/components/ui/button/button.js +2 -2
- package/dist/components/ui/button-group/button-group.js +2 -2
- package/dist/components/ui/button-group/button-group.js.map +1 -1
- package/dist/components/ui/calendar/calendar.js +8 -8
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/callout/callout.js +2 -2
- package/dist/components/ui/callout/callout.js.map +1 -1
- package/dist/components/ui/card/card.js +2 -2
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/carousel/carousel.js +8 -8
- package/dist/components/ui/carousel/carousel.js.map +1 -1
- package/dist/components/ui/chart/chart.js +2 -2
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +6 -6
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/code-block/code-block.js +6 -6
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/collapsible/collapsible.js +7 -7
- package/dist/components/ui/collapsible/collapsible.js.map +1 -1
- package/dist/components/ui/combobox/combobox.js +21 -21
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/combobox/value-combobox.js +1 -1
- package/dist/components/ui/command/command.js +23 -23
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/context-menu/context-menu.js +2 -2
- package/dist/components/ui/detail-panel/detail-panel.js +5 -5
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.js +2 -2
- package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
- package/dist/components/ui/dialog/dialog.js +21 -21
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/diff-block/diff-block.js +2 -2
- package/dist/components/ui/diff-block/diff-block.js.map +1 -1
- package/dist/components/ui/drawer/drawer.js +14 -14
- package/dist/components/ui/drawer/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +3 -3
- package/dist/components/ui/dropdown-menu/menu-parts.js +10 -10
- package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
- package/dist/components/ui/empty/empty-state.js +5 -5
- package/dist/components/ui/empty/empty-state.js.map +1 -1
- package/dist/components/ui/empty/empty.js +1 -1
- package/dist/components/ui/empty/empty.js.map +1 -1
- package/dist/components/ui/entity-icon/entity-icon.js +2 -2
- package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
- package/dist/components/ui/field/field.js +14 -14
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/field/number-field.js +2 -2
- package/dist/components/ui/field/number-field.js.map +1 -1
- package/dist/components/ui/hover-card/hover-card.js +10 -10
- package/dist/components/ui/hover-card/hover-card.js.map +1 -1
- package/dist/components/ui/input/input-control.js +1 -1
- package/dist/components/ui/input/input-control.js.map +1 -1
- package/dist/components/ui/input/input.js +2 -2
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/input-group/input-group.js +2 -2
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/input-group/secret-input-group.js +2 -2
- package/dist/components/ui/input-otp/input-otp.js +2 -2
- package/dist/components/ui/input-otp/input-otp.js.map +1 -1
- package/dist/components/ui/item/item.js +2 -2
- package/dist/components/ui/item/item.js.map +1 -1
- package/dist/components/ui/kbd/kbd.js +2 -2
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/components/ui/label/label.js +1 -1
- package/dist/components/ui/label/label.js.map +1 -1
- package/dist/components/ui/marker/marker.js +2 -2
- package/dist/components/ui/marker/marker.js.map +1 -1
- package/dist/components/ui/menubar/menubar.js +7 -7
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/message/message.js +3 -3
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.js +2 -2
- package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/ui/native-select/native-select.js +5 -5
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js +18 -18
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination/pagination.js +28 -28
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/popover/popover.js +15 -15
- package/dist/components/ui/popover/popover.js.map +1 -1
- package/dist/components/ui/progress/progress.js +5 -5
- package/dist/components/ui/progress/progress.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js +10 -10
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js +9 -9
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/resizable/resizable.js +11 -11
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/ui/select/select.js +21 -21
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/separator/separator.js +5 -5
- package/dist/components/ui/separator/separator.js.map +1 -1
- package/dist/components/ui/sheet/sheet.js +6 -6
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/skeleton/skeleton.js +1 -1
- package/dist/components/ui/skeleton/skeleton.js.map +1 -1
- package/dist/components/ui/slider/slider.js +5 -5
- package/dist/components/ui/slider/slider.js.map +1 -1
- package/dist/components/ui/spinner/spinner.js +5 -5
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js +2 -2
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/components/ui/switch/switch.js +4 -4
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/table/table.js +1 -1
- package/dist/components/ui/table/table.js.map +1 -1
- package/dist/components/ui/tabs/tabs.js +7 -7
- package/dist/components/ui/tabs/tabs.js.map +1 -1
- package/dist/components/ui/text-link/text-link.js +1 -1
- package/dist/components/ui/text-link/text-link.js.map +1 -1
- package/dist/components/ui/textarea/textarea.js +2 -2
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.js +7 -7
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/toggle/toggle.js +6 -6
- package/dist/components/ui/toggle/toggle.js.map +1 -1
- package/dist/components/ui/toggle-group/toggle-group.js +7 -8
- package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.js +6 -6
- package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
- package/dist/components/ui/tooltip/lazy-tooltip.js +2 -2
- package/dist/components/ui/tooltip/tooltip.js +10 -10
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/components/ui/trace/trace.js +19 -19
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/components/ui/typography/typography.js +2 -2
- package/dist/lib/accent-presets.js +1 -1
- package/dist/lib/accent-roles.js +2 -2
- package/dist/lib/async-action.js +1 -1
- package/dist/lib/create-poll.js +1 -1
- package/dist/lib/create-poll.js.map +1 -1
- package/dist/lib/external-link.js +1 -1
- package/dist/lib/external-link.js.map +1 -1
- package/dist/lib/fast-icon.js +1 -1
- package/dist/lib/theme-css.js +1 -1
- package/dist/lib/theme-engine-light.js +1 -1
- package/dist/lib/theme-projection.js +2 -2
- package/dist/lib/theme-records.js +1 -1
- package/dist/lib/themes.js +1 -1
- package/dist/lib/themes.js.map +1 -1
- package/dist/lib/tooltip-focus-gate.js.map +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/vite/source-parser.js +1 -1
- package/dist/vite/tailwind-sources.js +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.js","names":["<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 }: { value: number; max: number }) =>\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 <For keyed={false} each={local.steps}>\n {(step) => (\n <TaskItemRow\n text={step().label}\n description={step().description}\n status={step().status}\n />\n )}\n </For>\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>","class=\"flex flex-col gap-2\"","<Show when={description()}>\n {(descriptionSlot) => <div class=\"text-sm text-muted-foreground\">{descriptionSlot()}</div>}\n </Show>","<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 }: { value: number; max: number }) =>\n `${done} of ${max} ${max === 1 ? 'step' : 'steps'} done`\n }\n />\n )}\n </Show>","<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 }: { value: number; max: number }) =>\n `${done} of ${max} ${max === 1 ? 'step' : 'steps'} done`\n }\n />","minValue={0}","getValueLabel={({ value: done, max }: { value: number; max: number }) =>\n `${done} of ${max} ${max === 1 ? 'step' : 'steps'} done`\n }","<Show when={local.steps.length > 0}>\n <TaskItemList label=\"Plan steps\">\n <For keyed={false} each={local.steps}>\n {(step) => (\n <TaskItemRow\n text={step().label}\n description={step().description}\n status={step().status}\n />\n )}\n </For>\n </TaskItemList>\n </Show>","<TaskItemList label=\"Plan steps\">\n <For keyed={false} each={local.steps}>\n {(step) => (\n <TaskItemRow\n text={step().label}\n description={step().description}\n status={step().status}\n />\n )}\n </For>\n </TaskItemList>","label=\"Plan steps\"","<For keyed={false} each={local.steps}>\n {(step) => (\n <TaskItemRow\n text={step().label}\n description={step().description}\n status={step().status}\n />\n )}\n </For>","keyed={false}","<TaskItemRow\n text={step().label}\n description={step().description}\n status={step().status}\n />","<Show when={local.streaming}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>","<span class=\"streaming-caret\" aria-hidden=\"true\" />","<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>","<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>","<ListTodo />","statusLabel=\"Generating\"","ListTodo","LucideListTodo","resolveChildren"],"sources":["../../../../src/components/composites/plan/plan.tsx"],"sourcesContent":["import { ListTodo as LucideListTodo } from '@lucide/solid'\nimport { children as resolveChildren, createMemo, For, Show, omit } from 'solid-js'\nimport { type JSX } from '@solidjs/web'\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 = props\n const rest = omit(\n 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 }: { value: number; max: number }) =>\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 <For keyed={false} each={local.steps}>\n {(step) => (\n <TaskItemRow\n text={step().label}\n description={step().description}\n status={step().status}\n />\n )}\n </For>\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":";;;;;;;;;;;AAeA,IAAMmB,aAAW,SAASC,QAAc;AAgExC,SAAgB,KAAK,OAAkB;CACrC,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,S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;OAApB,IAAA,WAAA;QACEC,OAAAA,gBAAAA,KAAAA;SAAKC,OAAO;SAAO,IAAA,OAAA;UAAM,OAAA,MAAM;SAAK;SAApCD,WACI,SACAE,gBAAAA,aAAAA;UACE,IAAA,OAAA;WAAM,OAAA,KAAK,CAAC,CAAC;UAAK;UAClB,IAAA,cAAA;WAAa,OAAA,KAAK,CAAC,CAAC;UAAW;UAC/B,IAAA,SAAA;WAAQ,OAAA,KAAK,CAAC,CAAC;UAAM;SACtB,CAAA;QAEA,CAAA;OACO;;KACV;;IACNC,gBAAAA,MAAAA;KAAM,IAAA,OAAA;MAAM,OAAA,MAAM;KAAS;KAA3B,IAAA,WAAA;MACEC,OAAAA,OAAkD;KAC9C;;IACNC,gBAAAA,MAAAA;KAAM,IAAA,OAAA;MAAM,OAAA,QAAQ;KAAC;KAArBA,WACI,uBACA;MAEK,IAAA,QAAA,QAAA;MAFL,OAAA,OACG,WACE;MAFL,OAAA;KAEK,EAAA,CAAA;IAEH,CAAA;GAtCP;EAuCY;;CAGf,OACEC,gBAAAA,WAAAA,WAAAA;EACE,IAAA,OAAA;GAAM,OAAA,MAAM,QAAQC,gBAAAA,YAAAA,CAAW,CAAA;EAAC;EAChC,IAAA,SAAA;GAAQ,OAAA,MAAM,YAAY,YAAY,KAAA;EAAS;EAC/CC,aAAY;EACZ,IAAA,OAAA;GAAM,OAAA,KAAK;EAAC;EACZ,IAAA,cAAA;GAAa,OAAA,MAAM,eAAe;EAAI;CAI7B,GAHL,MANN,EAAA,IAAA,WAAA;EAQG,OAAA,UAAU,IAAI,SAAS,KAAA;CACf,EAAA,CAAA,CAAA;AAEf"}
|
|
1
|
+
{"version":3,"file":"plan.js","names":["<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 }: { value: number; max: number }) =>\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 <For keyed={false} each={local.steps}>\n {(step) => (\n <TaskItemRow\n text={step().label}\n description={step().description}\n status={step().status}\n />\n )}\n </For>\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>","class=\"flex flex-col gap-2\"","<Show when={description()}>\n {(descriptionSlot) => <div class=\"text-sm text-muted-foreground\">{descriptionSlot()}</div>}\n </Show>","<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 }: { value: number; max: number }) =>\n `${done} of ${max} ${max === 1 ? 'step' : 'steps'} done`\n }\n />\n )}\n </Show>","<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 }: { value: number; max: number }) =>\n `${done} of ${max} ${max === 1 ? 'step' : 'steps'} done`\n }\n />","minValue={0}","getValueLabel={({ value: done, max }: { value: number; max: number }) =>\n `${done} of ${max} ${max === 1 ? 'step' : 'steps'} done`\n }","<Show when={local.steps.length > 0}>\n <TaskItemList label=\"Plan steps\">\n <For keyed={false} each={local.steps}>\n {(step) => (\n <TaskItemRow\n text={step().label}\n description={step().description}\n status={step().status}\n />\n )}\n </For>\n </TaskItemList>\n </Show>","<TaskItemList label=\"Plan steps\">\n <For keyed={false} each={local.steps}>\n {(step) => (\n <TaskItemRow\n text={step().label}\n description={step().description}\n status={step().status}\n />\n )}\n </For>\n </TaskItemList>","label=\"Plan steps\"","<For keyed={false} each={local.steps}>\n {(step) => (\n <TaskItemRow\n text={step().label}\n description={step().description}\n status={step().status}\n />\n )}\n </For>","keyed={false}","<TaskItemRow\n text={step().label}\n description={step().description}\n status={step().status}\n />","<Show when={local.streaming}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>","<span class=\"streaming-caret\" aria-hidden=\"true\" />","<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>","<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>","<ListTodo />","statusLabel=\"Generating\"","LucideListTodo","resolveChildren","_$insert"],"sources":["../../../../src/components/composites/plan/plan.tsx"],"sourcesContent":["import { ListTodo as LucideListTodo } from '@lucide/solid'\nimport { children as resolveChildren, createMemo, For, Show, omit } from 'solid-js'\nimport { type JSX } from '@solidjs/web'\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 = props\n const rest = omit(\n 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 }: { value: number; max: number }) =>\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 <For keyed={false} each={local.steps}>\n {(step) => (\n <TaskItemRow\n text={step().label}\n description={step().description}\n status={step().status}\n />\n )}\n </For>\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":";;;;;;;;;;;AAeA,IAAM,WAAW,SAASmB,UAAc;AAgExC,SAAgB,KAAK,OAAkB;CACrC,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,SACA,eACA,aACA,WACA,QACA,QACA,aACF;CACA,MAAM,WAAW,iBAAkB,MAAM,YAAY,KAAA,IAAY,aAAa,MAAM,KAAK,CAAE;CAC3F,MAAM,aAAa;EACjB,IAAI,MAAM,SAAS,KAAA,GAAW,OAAO,MAAM;EAC3C,IAAI,MAAM,WAAW,OAAO;EAC5B,MAAM,QAAQ,SAAS;EACvB,OAAO,QAAQ,kBAAkB,KAAK,IAAI,KAAA;CAC5C;CACA,MAAM,cAAcC,eAAsB,MAAM,WAAW;CAC3D,MAAM,UAAUA,eAAsB,M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AAA,MAAAA;KAAM,IAAA,OAAA;MAAM,OAAA,MAAM;KAAS;KAA3B,IAAA,WAAA;MACEC,OAAAA,OAAkD;KAC9C;;IACNC,gBAAAA,MAAAA;KAAM,IAAA,OAAA;MAAM,OAAA,QAAQ;KAAC;KAArBA,WACI,uBACA;MAEK,IAAA,QAAA,QAAA;MAFLM,OAAA,OACG,WACE;MAFL,OAAA;KAEK,EAAA,CAAA;IAEH,CAAA;GAtCP;EAuCY;;CAGf,OACEL,gBAAAA,WAAAA,WAAAA;EACE,IAAA,OAAA;GAAM,OAAA,MAAM,QAAQC,gBAAAA,UAAAA,CAAW,CAAA;EAAC;EAChC,IAAA,SAAA;GAAQ,OAAA,MAAM,YAAY,YAAY,KAAA;EAAS;EAC/CC,aAAY;EACZ,IAAA,OAAA;GAAM,OAAA,KAAK;EAAC;EACZ,IAAA,cAAA;GAAa,OAAA,MAAM,eAAe;EAAI;CAI7B,GAHL,MANN,EAAA,IAAA,WAAA;EAQG,OAAA,UAAU,IAAI,SAAS,KAAA;CACf,EAAA,CAAA,CAAA;AAEf"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { createComponent, insert, memo, mergeProps, spread, template } from "@solidjs/web";
|
|
2
|
+
import { ArrowUp, Square, X } from "@lucide/solid";
|
|
3
|
+
import { Show, children, omit } from "solid-js";
|
|
1
4
|
import { callHandler } from "../../../lib/events.js";
|
|
2
5
|
import { cn } from "../../../lib/utils.js";
|
|
3
6
|
import { Button } from "../../ui/button/button.js";
|
|
4
7
|
import { InputGroup, InputGroupAddon, InputGroupTextarea } from "../../ui/input-group/input-group.js";
|
|
5
8
|
import { Spinner } from "../../ui/spinner/spinner.js";
|
|
6
9
|
import { ActionButton } from "../action-button/action-button.js";
|
|
7
|
-
import { createComponent, insert, memo, mergeProps, spread, template } from "@solidjs/web";
|
|
8
|
-
import { ArrowUp, Square, X } from "@lucide/solid";
|
|
9
|
-
import { Show, children, omit } from "solid-js";
|
|
10
10
|
// src/components/composites/prompt-input/prompt-input.tsx
|
|
11
11
|
var _tmpl$ = /* @__PURE__ */ template(`<form><!><!><!>`);
|
|
12
12
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-input.js","names":["onSubmit={(event) => {\n event.preventDefault()\n callHandler(local.onSubmit, event)\n }}","<form\n data-slot=\"prompt-input\"\n class={cn('flex w-full flex-col gap-2', local.class)}\n onSubmit={(event) => {\n event.preventDefault()\n callHandler(local.onSubmit, event)\n }}\n {...rest}\n >\n {local.before}\n <InputGroup\n data-disabled={local.disabled ? '' : undefined}\n class={cn(\n 'bg-card h-auto gap-0 overflow-hidden rounded-2xl px-0 shadow-xs',\n 'data-[disabled]:opacity-50',\n local.groupClass\n )}\n >\n {local.children}\n </InputGroup>\n {local.after}\n </form>","<InputGroup\n data-disabled={local.disabled ? '' : undefined}\n class={cn(\n 'bg-card h-auto gap-0 overflow-hidden rounded-2xl px-0 shadow-xs',\n 'data-[disabled]:opacity-50',\n local.groupClass\n )}\n >\n {local.children}\n </InputGroup>","<InputGroupAddon\n align=\"block-start\"\n data-slot=\"prompt-input-header\"\n class={cn('flex-wrap gap-1 px-3', local.class)}\n {...rest}\n />","align=\"block-start\"","<div data-slot=\"prompt-input-body\" class={cn('w-full min-w-0', local.class)} {...rest} />","<InputGroupTextarea\n data-slot=\"prompt-input-textarea\"\n placeholder=\"Write a message…\"\n class={cn('min-h-11 px-3 pt-3', local.class)}\n onKeyDown={(event) => {\n callHandler(local.onKeyDown, event)\n if (local.submitOnEnter === false || event.defaultPrevented) return\n if (event.key !== 'Enter' || event.shiftKey || event.isComposing) return\n event.preventDefault()\n event.currentTarget.form?.requestSubmit()\n }}\n {...rest}\n />","placeholder=\"Write a message…\"","onKeyDown={(event) => {\n callHandler(local.onKeyDown, event)\n if (local.submitOnEnter === false || event.defaultPrevented) return\n if (event.key !== 'Enter' || event.shiftKey || event.isComposing) return\n event.preventDefault()\n event.currentTarget.form?.requestSubmit()\n }}","<InputGroupAddon\n align=\"block-end\"\n data-slot=\"prompt-input-footer\"\n class={cn('justify-between gap-2 px-2', local.class)}\n {...rest}\n />","align=\"block-end\"","<div\n data-slot=\"prompt-input-tools\"\n class={cn('flex min-w-0 items-center gap-1', local.class)}\n {...rest}\n />","<ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n data-slot=\"prompt-input-button\"\n tooltipSide=\"top\"\n {...(props as ActionButtonProps)}\n />","type=\"button\"","variant=\"ghost\"","size=\"icon-sm\"","tooltipSide=\"top\"","<Button\n variant=\"toolbar\"\n size=\"sm\"\n data-slot=\"prompt-input-control\"\n class={cn(\n 'text-muted-foreground hover:text-foreground min-w-0 font-normal',\n 'aria-pressed:bg-primary-subtle aria-pressed:text-primary',\n '[&_[data-control-label]]:truncate',\n local.class\n )}\n {...rest}\n />","variant=\"toolbar\"","size=\"sm\"","<ActionButton\n type={stopping() ? 'button' : 'submit'}\n variant=\"default\"\n size=\"icon-sm\"\n data-slot=\"prompt-input-submit\"\n data-status={local.status ?? 'ready'}\n aria-label={label()}\n tooltip={label()}\n tooltipSide=\"top\"\n class={cn('rounded-full', local.class)}\n onClick={(event: MouseEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n if (stopping()) {\n event.preventDefault()\n local.onStop?.()\n return\n }\n callHandler(local.onClick as JSX.EventHandlerUnion<HTMLButtonElement, MouseEvent>, event)\n }}\n {...(rest as ActionButtonProps)}\n >\n <Show when={custom()} fallback={<SubmitGlyph status={local.status} stop={stopping()} />}>\n {custom()}\n </Show>\n </ActionButton>","variant=\"default\"","onClick={(event: MouseEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n if (stopping()) {\n event.preventDefault()\n local.onStop?.()\n return\n }\n callHandler(local.onClick as JSX.EventHandlerUnion<HTMLButtonElement, MouseEvent>, event)\n }}","<Show when={custom()} fallback={<SubmitGlyph status={local.status} stop={stopping()} />}>\n {custom()}\n </Show>","<SubmitGlyph status={local.status} stop={stopping()} />","<Show when={!props.stop} fallback={<Square class=\"fill-current\" />}>\n <Show when={props.status !== 'submitted'} fallback={<Spinner size=\"sm\" label={false} />}>\n <Show when={props.status !== 'error'} fallback={<X />}>\n <ArrowUp />\n </Show>\n </Show>\n </Show>","<Show when={props.status !== 'submitted'} fallback={<Spinner size=\"sm\" label={false} />}>\n <Show when={props.status !== 'error'} fallback={<X />}>\n <ArrowUp />\n </Show>\n </Show>","<Show when={props.status !== 'error'} fallback={<X />}>\n <ArrowUp />\n </Show>","<ArrowUp />","<X />","<Spinner size=\"sm\" label={false} />","label={false}","<Square class=\"fill-current\" />","class=\"fill-current\"","resolveChildren"],"sources":["../../../../src/components/composites/prompt-input/prompt-input.tsx"],"sourcesContent":["/*\n * Part structure and names ported from Vercel AI Elements prompt-input.tsx\n * (https://elements.ai-sdk.dev, Apache-2.0). The control pill is ported from\n * T3 Code apps/web/src/components/chat/ComposerControl.tsx and the card from\n * ComposerSurface.tsx at ff7aa5ace3 (MIT, Copyright (c) T3 Tools Inc.).\n * Translated from React to Solid onto this library's InputGroup, Button and\n * ActionButton. See NOTICE.\n */\nimport { ArrowUp, Square, X } from '@lucide/solid'\nimport { Show, children as resolveChildren, omit } from 'solid-js'\nimport { type ComponentProps, type JSX, type ValidComponent } from '@solidjs/web'\nimport { callHandler } from '#lib/events'\nimport { cn } from '#lib/utils'\nimport { Button, type ButtonProps } from '../../ui/button'\nimport { InputGroup, InputGroupAddon, InputGroupTextarea } from '../../ui/input-group'\nimport { Spinner } from '../../ui/spinner'\nimport { ActionButton, type ActionButtonProps } from '../action-button'\n\n/**\n * PromptInput.\n *\n * The one box a person writes to an agent in. It is shadcn's InputGroup in its\n * column form: an optional header row (attachments, a reply strip), the field,\n * and a footer row of tools on the left and the submit control on the right.\n * Every chat surface draws this box, so the agent view, the dev chat and a new\n * thread page cannot drift apart in radius, focus ring or button placement.\n *\n * It knows nothing about drafts, sending or keys beyond Enter. The composers in\n * `conversation/` own those and render their chrome through these parts.\n */\nexport type PromptInputProps = Omit<ComponentProps<'form'>, 'onSubmit'> & {\n onSubmit?: JSX.EventHandlerUnion<HTMLFormElement, SubmitEvent>\n /** Classes for the box itself; `class` lands on the form. */\n groupClass?: string\n /** Dims the box. The field and buttons carry their own disabled state. */\n disabled?: boolean\n /** Rendered inside the form above the box: a mention menu, a reply strip. */\n before?: JSX.Element\n /** Rendered inside the form under the box: a hint, a live status region. */\n after?: JSX.Element\n}\n\nexport function PromptInput(props: PromptInputProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'groupClass',\n 'children',\n 'onSubmit',\n 'disabled',\n 'before',\n 'after'\n )\n\n return (\n <form\n data-slot=\"prompt-input\"\n class={cn('flex w-full flex-col gap-2', local.class)}\n onSubmit={(event) => {\n event.preventDefault()\n callHandler(local.onSubmit, event)\n }}\n {...rest}\n >\n {local.before}\n <InputGroup\n data-disabled={local.disabled ? '' : undefined}\n class={cn(\n 'bg-card h-auto gap-0 overflow-hidden rounded-2xl px-0 shadow-xs',\n 'data-[disabled]:opacity-50',\n local.groupClass\n )}\n >\n {local.children}\n </InputGroup>\n {local.after}\n </form>\n )\n}\n\n/** A row above the field: staged attachments, a reply target, a context chip. */\nexport function PromptInputHeader(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <InputGroupAddon\n align=\"block-start\"\n data-slot=\"prompt-input-header\"\n class={cn('flex-wrap gap-1 px-3', local.class)}\n {...rest}\n />\n )\n}\n\n/** Wraps a custom field (a token editor) so it spans the box like the textarea. */\nexport function PromptInputBody(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return <div data-slot=\"prompt-input-body\" class={cn('w-full min-w-0', local.class)} {...rest} />\n}\n\nexport type PromptInputTextareaProps = ComponentProps<'textarea'> & {\n /**\n * Enter submits the form and Shift+Enter breaks the line, unless an IME is\n * composing. A composer that runs its own key policy passes false.\n */\n submitOnEnter?: boolean\n}\n\nexport function PromptInputTextarea(props: PromptInputTextareaProps) {\n const local = props\n const rest = omit(props, 'class', 'submitOnEnter', 'onKeyDown')\n return (\n <InputGroupTextarea\n data-slot=\"prompt-input-textarea\"\n placeholder=\"Write a message…\"\n class={cn('min-h-11 px-3 pt-3', local.class)}\n onKeyDown={(event) => {\n callHandler(local.onKeyDown, event)\n if (local.submitOnEnter === false || event.defaultPrevented) return\n if (event.key !== 'Enter' || event.shiftKey || event.isComposing) return\n event.preventDefault()\n event.currentTarget.form?.requestSubmit()\n }}\n {...rest}\n />\n )\n}\n\n/** The row under the field: tools on the start edge, submit on the end. */\nexport function PromptInputFooter(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <InputGroupAddon\n align=\"block-end\"\n data-slot=\"prompt-input-footer\"\n class={cn('justify-between gap-2 px-2', local.class)}\n {...rest}\n />\n )\n}\n\n/** A group of tools in the footer, kept on one line. */\nexport function PromptInputTools(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"prompt-input-tools\"\n class={cn('flex min-w-0 items-center gap-1', local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * An icon tool in the footer (attach, dictate, mention). Always carries a\n * tooltip, because an icon alone does not say what it does.\n */\nexport function PromptInputButton<T extends ValidComponent = 'button'>(\n props: ActionButtonProps<T>\n) {\n return (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n data-slot=\"prompt-input-button\"\n tooltipSide=\"top\"\n {...(props as ActionButtonProps)}\n />\n )\n}\n\n/**\n * A labelled control in the footer: a model, an effort, a mode, a location.\n * T3's ComposerControl: a ghost pill in muted text that brightens on hover and\n * holds the accent tint while its menu is open. Use it as a menu trigger with\n * `as={PromptInputControl}`, or directly as a toggle with `aria-pressed`.\n */\nexport function PromptInputControl<T extends ValidComponent = 'button'>(props: ButtonProps<T>) {\n const local = props as ButtonProps\n const rest = omit(props as ButtonProps, 'class')\n return (\n <Button\n variant=\"toolbar\"\n size=\"sm\"\n data-slot=\"prompt-input-control\"\n class={cn(\n 'text-muted-foreground hover:text-foreground min-w-0 font-normal',\n 'aria-pressed:bg-primary-subtle aria-pressed:text-primary',\n '[&_[data-control-label]]:truncate',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type PromptInputStatus = 'ready' | 'submitted' | 'streaming' | 'error'\n\nexport type PromptInputSubmitProps = Omit<ActionButtonProps, 'children' | 'tooltip'> & {\n /** Drives the glyph: arrow, spinner, stop square, or a cross after a failure. */\n status?: PromptInputStatus\n /** While streaming, the button stops the turn instead of submitting. */\n onStop?: () => void\n /** The action's name. Defaults to \"Send message\", or \"Stop\" while streaming. */\n label?: string\n children?: JSX.Element\n}\n\n/**\n * The send control. A filled circle at the end of the footer, as in T3 and\n * AI Elements; while a turn streams and `onStop` is given it becomes Stop.\n */\nexport function PromptInputSubmit(props: PromptInputSubmitProps) {\n const local = props\n const rest = omit(props, 'status', 'onStop', 'label', 'children', 'class', 'onClick')\n const custom = resolveChildren(() => local.children)\n const stopping = () => local.status === 'streaming' && local.onStop !== undefined\n const label = () => local.label ?? (stopping() ? 'Stop' : 'Send message')\n\n return (\n <ActionButton\n type={stopping() ? 'button' : 'submit'}\n variant=\"default\"\n size=\"icon-sm\"\n data-slot=\"prompt-input-submit\"\n data-status={local.status ?? 'ready'}\n aria-label={label()}\n tooltip={label()}\n tooltipSide=\"top\"\n class={cn('rounded-full', local.class)}\n onClick={(event: MouseEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n if (stopping()) {\n event.preventDefault()\n local.onStop?.()\n return\n }\n callHandler(local.onClick as JSX.EventHandlerUnion<HTMLButtonElement, MouseEvent>, event)\n }}\n {...(rest as ActionButtonProps)}\n >\n <Show when={custom()} fallback={<SubmitGlyph status={local.status} stop={stopping()} />}>\n {custom()}\n </Show>\n </ActionButton>\n )\n}\n\nfunction SubmitGlyph(props: { status?: PromptInputStatus; stop: boolean }) {\n return (\n <Show when={!props.stop} fallback={<Square class=\"fill-current\" />}>\n <Show when={props.status !== 'submitted'} fallback={<Spinner size=\"sm\" label={false} />}>\n <Show when={props.status !== 'error'} fallback={<X />}>\n <ArrowUp />\n </Show>\n </Show>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;AA0CA,SAAgB,YAAY,OAAyB;CACnD,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,SACA,cACA,YACA,YACA,YACA,UACA,OACF;CAGE,IAAA,OAAA,OAqBM;CArBN,IAAA,QAAA,KAAA;;;CAOE,OAAA,MAAA,CAAA;EANA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,8BAA8B,MAAM,KAAK;EAAC;EACpDA,WAAW,UAAU;GACnB,MAAM,eAAe;GACrB,YAAY,MAAM,UAAU,KAAK;EACnC;CACQ,GAAJ,IAAA,GAAA,IAAA;CAPN,OAAA,YASE;EAAC,OAAA,MAAM;CAAM,GATfC,KAqBM;CArBN,OAAA,MAUEC,gBAAAA,YAAAA;EACE,IAAA,kBAAA;GAAe,OAAA,MAAM,WAAW,KAAK,KAAA;EAAS;EAC9C,IAAA,UAAA;GAAO,OAAA,GACL,mEACA,8BACA,MAAM,UACR;EAAC;EANH,IAAA,WAAA;GAQG,OAAA,MAAM;EACG;CAnBdD,CAAAA,GAAAA,KAqBM;CArBN,OAAA,YAoBE;EAAC,OAAA,MAAM;CAAK,GApBdA,KAqBM;CAtBR,OACEA;AAuBJ;;AAGA,SAAgB,kBAAkB,OAA8B;CAC9D,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,OAAO;CAChC,OACEE,gBAAAA,iBAAAA,WAAAA;EACEC,OAAM;EACN,aAAU;EACV,IAAA,UAAA;GAAO,OAAA,GAAG,wBAAwB,MAAM,KAAK;EAAC;CAE/C,GADK,IACL,CAAA;AAEL;;AAGA,SAAgB,gBAAgB,OAA8B;CAC5D,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,OAAO;CACzB,IAAA,QAAA,QAAwF;CAAX,OAAA,OAAA,CAAA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AA;GAAC;GAAvF,IAAA,WAAA;IACG,OAAA,OAAO;GACJ;;CACM,EAAA,CAAA,CAAA;AAElB;AAEA,SAAS,YAAY,OAAsD;CACzE,OACEC,WAAAA;;GAAY,OAAA,CAAC,MAAM;EAMb,CAAA,CAAC,CAAD,IALJC,WAAAA;;IAAY,OAAA,MAAM,WAAW;GAIvB,CAAA,CAAC,CAAD,IAHJC,WAAAA;;KAAY,OAAA,MAAM,WAAW;IAEvB,CAAA,CAAC,CAAD,IADJC,gBAAAA,SAAAA,CAAU,CAAA,IADoCC,gBAAAA,GAAAA,CAAI,CAAA;GAE9C,CAAA,IAH4CC,gBAAAA,SAAAA;IAASX,MAAK;IAAKY,OAAO;GAAQ,CAAA;EAIhF,CAAA,IAL2BC,gBAAAA,QAAAA,EAAQC,OAAM,eAAgB,CAAA;CAM3D,CAAA;AAEV"}
|
|
1
|
+
{"version":3,"file":"prompt-input.js","names":["onSubmit={(event) => {\n event.preventDefault()\n callHandler(local.onSubmit, event)\n }}","<form\n data-slot=\"prompt-input\"\n class={cn('flex w-full flex-col gap-2', local.class)}\n onSubmit={(event) => {\n event.preventDefault()\n callHandler(local.onSubmit, event)\n }}\n {...rest}\n >\n {local.before}\n <InputGroup\n data-disabled={local.disabled ? '' : undefined}\n class={cn(\n 'bg-card h-auto gap-0 overflow-hidden rounded-2xl px-0 shadow-xs',\n 'data-[disabled]:opacity-50',\n local.groupClass\n )}\n >\n {local.children}\n </InputGroup>\n {local.after}\n </form>","<InputGroup\n data-disabled={local.disabled ? '' : undefined}\n class={cn(\n 'bg-card h-auto gap-0 overflow-hidden rounded-2xl px-0 shadow-xs',\n 'data-[disabled]:opacity-50',\n local.groupClass\n )}\n >\n {local.children}\n </InputGroup>","<InputGroupAddon\n align=\"block-start\"\n data-slot=\"prompt-input-header\"\n class={cn('flex-wrap gap-1 px-3', local.class)}\n {...rest}\n />","align=\"block-start\"","<div data-slot=\"prompt-input-body\" class={cn('w-full min-w-0', local.class)} {...rest} />","<InputGroupTextarea\n data-slot=\"prompt-input-textarea\"\n placeholder=\"Write a message…\"\n class={cn('min-h-11 px-3 pt-3', local.class)}\n onKeyDown={(event) => {\n callHandler(local.onKeyDown, event)\n if (local.submitOnEnter === false || event.defaultPrevented) return\n if (event.key !== 'Enter' || event.shiftKey || event.isComposing) return\n event.preventDefault()\n event.currentTarget.form?.requestSubmit()\n }}\n {...rest}\n />","placeholder=\"Write a message…\"","onKeyDown={(event) => {\n callHandler(local.onKeyDown, event)\n if (local.submitOnEnter === false || event.defaultPrevented) return\n if (event.key !== 'Enter' || event.shiftKey || event.isComposing) return\n event.preventDefault()\n event.currentTarget.form?.requestSubmit()\n }}","<InputGroupAddon\n align=\"block-end\"\n data-slot=\"prompt-input-footer\"\n class={cn('justify-between gap-2 px-2', local.class)}\n {...rest}\n />","align=\"block-end\"","<div\n data-slot=\"prompt-input-tools\"\n class={cn('flex min-w-0 items-center gap-1', local.class)}\n {...rest}\n />","<ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n data-slot=\"prompt-input-button\"\n tooltipSide=\"top\"\n {...(props as ActionButtonProps)}\n />","type=\"button\"","variant=\"ghost\"","size=\"icon-sm\"","tooltipSide=\"top\"","<Button\n variant=\"toolbar\"\n size=\"sm\"\n data-slot=\"prompt-input-control\"\n class={cn(\n 'text-muted-foreground hover:text-foreground min-w-0 font-normal',\n 'aria-pressed:bg-primary-subtle aria-pressed:text-primary',\n '[&_[data-control-label]]:truncate',\n local.class\n )}\n {...rest}\n />","variant=\"toolbar\"","size=\"sm\"","<ActionButton\n type={stopping() ? 'button' : 'submit'}\n variant=\"default\"\n size=\"icon-sm\"\n data-slot=\"prompt-input-submit\"\n data-status={local.status ?? 'ready'}\n aria-label={label()}\n tooltip={label()}\n tooltipSide=\"top\"\n class={cn('rounded-full', local.class)}\n onClick={(event: MouseEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n if (stopping()) {\n event.preventDefault()\n local.onStop?.()\n return\n }\n callHandler(local.onClick as JSX.EventHandlerUnion<HTMLButtonElement, MouseEvent>, event)\n }}\n {...(rest as ActionButtonProps)}\n >\n <Show when={custom()} fallback={<SubmitGlyph status={local.status} stop={stopping()} />}>\n {custom()}\n </Show>\n </ActionButton>","variant=\"default\"","onClick={(event: MouseEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n if (stopping()) {\n event.preventDefault()\n local.onStop?.()\n return\n }\n callHandler(local.onClick as JSX.EventHandlerUnion<HTMLButtonElement, MouseEvent>, event)\n }}","<Show when={custom()} fallback={<SubmitGlyph status={local.status} stop={stopping()} />}>\n {custom()}\n </Show>","<SubmitGlyph status={local.status} stop={stopping()} />","<Show when={!props.stop} fallback={<Square class=\"fill-current\" />}>\n <Show when={props.status !== 'submitted'} fallback={<Spinner size=\"sm\" label={false} />}>\n <Show when={props.status !== 'error'} fallback={<X />}>\n <ArrowUp />\n </Show>\n </Show>\n </Show>","<Show when={props.status !== 'submitted'} fallback={<Spinner size=\"sm\" label={false} />}>\n <Show when={props.status !== 'error'} fallback={<X />}>\n <ArrowUp />\n </Show>\n </Show>","<Show when={props.status !== 'error'} fallback={<X />}>\n <ArrowUp />\n </Show>","<ArrowUp />","<X />","<Spinner size=\"sm\" label={false} />","label={false}","<Square class=\"fill-current\" />","class=\"fill-current\"","_$spread","_$insert","resolveChildren"],"sources":["../../../../src/components/composites/prompt-input/prompt-input.tsx"],"sourcesContent":["/*\n * Part structure and names ported from Vercel AI Elements prompt-input.tsx\n * (https://elements.ai-sdk.dev, Apache-2.0). The control pill is ported from\n * T3 Code apps/web/src/components/chat/ComposerControl.tsx and the card from\n * ComposerSurface.tsx at ff7aa5ace3 (MIT, Copyright (c) T3 Tools Inc.).\n * Translated from React to Solid onto this library's InputGroup, Button and\n * ActionButton. See NOTICE.\n */\nimport { ArrowUp, Square, X } from '@lucide/solid'\nimport { Show, children as resolveChildren, omit } from 'solid-js'\nimport { type ComponentProps, type JSX, type ValidComponent } from '@solidjs/web'\nimport { callHandler } from '#lib/events'\nimport { cn } from '#lib/utils'\nimport { Button, type ButtonProps } from '../../ui/button'\nimport { InputGroup, InputGroupAddon, InputGroupTextarea } from '../../ui/input-group'\nimport { Spinner } from '../../ui/spinner'\nimport { ActionButton, type ActionButtonProps } from '../action-button'\n\n/**\n * PromptInput.\n *\n * The one box a person writes to an agent in. It is shadcn's InputGroup in its\n * column form: an optional header row (attachments, a reply strip), the field,\n * and a footer row of tools on the left and the submit control on the right.\n * Every chat surface draws this box, so the agent view, the dev chat and a new\n * thread page cannot drift apart in radius, focus ring or button placement.\n *\n * It knows nothing about drafts, sending or keys beyond Enter. The composers in\n * `conversation/` own those and render their chrome through these parts.\n */\nexport type PromptInputProps = Omit<ComponentProps<'form'>, 'onSubmit'> & {\n onSubmit?: JSX.EventHandlerUnion<HTMLFormElement, SubmitEvent>\n /** Classes for the box itself; `class` lands on the form. */\n groupClass?: string\n /** Dims the box. The field and buttons carry their own disabled state. */\n disabled?: boolean\n /** Rendered inside the form above the box: a mention menu, a reply strip. */\n before?: JSX.Element\n /** Rendered inside the form under the box: a hint, a live status region. */\n after?: JSX.Element\n}\n\nexport function PromptInput(props: PromptInputProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'groupClass',\n 'children',\n 'onSubmit',\n 'disabled',\n 'before',\n 'after'\n )\n\n return (\n <form\n data-slot=\"prompt-input\"\n class={cn('flex w-full flex-col gap-2', local.class)}\n onSubmit={(event) => {\n event.preventDefault()\n callHandler(local.onSubmit, event)\n }}\n {...rest}\n >\n {local.before}\n <InputGroup\n data-disabled={local.disabled ? '' : undefined}\n class={cn(\n 'bg-card h-auto gap-0 overflow-hidden rounded-2xl px-0 shadow-xs',\n 'data-[disabled]:opacity-50',\n local.groupClass\n )}\n >\n {local.children}\n </InputGroup>\n {local.after}\n </form>\n )\n}\n\n/** A row above the field: staged attachments, a reply target, a context chip. */\nexport function PromptInputHeader(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <InputGroupAddon\n align=\"block-start\"\n data-slot=\"prompt-input-header\"\n class={cn('flex-wrap gap-1 px-3', local.class)}\n {...rest}\n />\n )\n}\n\n/** Wraps a custom field (a token editor) so it spans the box like the textarea. */\nexport function PromptInputBody(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return <div data-slot=\"prompt-input-body\" class={cn('w-full min-w-0', local.class)} {...rest} />\n}\n\nexport type PromptInputTextareaProps = ComponentProps<'textarea'> & {\n /**\n * Enter submits the form and Shift+Enter breaks the line, unless an IME is\n * composing. A composer that runs its own key policy passes false.\n */\n submitOnEnter?: boolean\n}\n\nexport function PromptInputTextarea(props: PromptInputTextareaProps) {\n const local = props\n const rest = omit(props, 'class', 'submitOnEnter', 'onKeyDown')\n return (\n <InputGroupTextarea\n data-slot=\"prompt-input-textarea\"\n placeholder=\"Write a message…\"\n class={cn('min-h-11 px-3 pt-3', local.class)}\n onKeyDown={(event) => {\n callHandler(local.onKeyDown, event)\n if (local.submitOnEnter === false || event.defaultPrevented) return\n if (event.key !== 'Enter' || event.shiftKey || event.isComposing) return\n event.preventDefault()\n event.currentTarget.form?.requestSubmit()\n }}\n {...rest}\n />\n )\n}\n\n/** The row under the field: tools on the start edge, submit on the end. */\nexport function PromptInputFooter(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <InputGroupAddon\n align=\"block-end\"\n data-slot=\"prompt-input-footer\"\n class={cn('justify-between gap-2 px-2', local.class)}\n {...rest}\n />\n )\n}\n\n/** A group of tools in the footer, kept on one line. */\nexport function PromptInputTools(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"prompt-input-tools\"\n class={cn('flex min-w-0 items-center gap-1', local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * An icon tool in the footer (attach, dictate, mention). Always carries a\n * tooltip, because an icon alone does not say what it does.\n */\nexport function PromptInputButton<T extends ValidComponent = 'button'>(\n props: ActionButtonProps<T>\n) {\n return (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n data-slot=\"prompt-input-button\"\n tooltipSide=\"top\"\n {...(props as ActionButtonProps)}\n />\n )\n}\n\n/**\n * A labelled control in the footer: a model, an effort, a mode, a location.\n * T3's ComposerControl: a ghost pill in muted text that brightens on hover and\n * holds the accent tint while its menu is open. Use it as a menu trigger with\n * `as={PromptInputControl}`, or directly as a toggle with `aria-pressed`.\n */\nexport function PromptInputControl<T extends ValidComponent = 'button'>(props: ButtonProps<T>) {\n const local = props as ButtonProps\n const rest = omit(props as ButtonProps, 'class')\n return (\n <Button\n variant=\"toolbar\"\n size=\"sm\"\n data-slot=\"prompt-input-control\"\n class={cn(\n 'text-muted-foreground hover:text-foreground min-w-0 font-normal',\n 'aria-pressed:bg-primary-subtle aria-pressed:text-primary',\n '[&_[data-control-label]]:truncate',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type PromptInputStatus = 'ready' | 'submitted' | 'streaming' | 'error'\n\nexport type PromptInputSubmitProps = Omit<ActionButtonProps, 'children' | 'tooltip'> & {\n /** Drives the glyph: arrow, spinner, stop square, or a cross after a failure. */\n status?: PromptInputStatus\n /** While streaming, the button stops the turn instead of submitting. */\n onStop?: () => void\n /** The action's name. Defaults to \"Send message\", or \"Stop\" while streaming. */\n label?: string\n children?: JSX.Element\n}\n\n/**\n * The send control. A filled circle at the end of the footer, as in T3 and\n * AI Elements; while a turn streams and `onStop` is given it becomes Stop.\n */\nexport function PromptInputSubmit(props: PromptInputSubmitProps) {\n const local = props\n const rest = omit(props, 'status', 'onStop', 'label', 'children', 'class', 'onClick')\n const custom = resolveChildren(() => local.children)\n const stopping = () => local.status === 'streaming' && local.onStop !== undefined\n const label = () => local.label ?? (stopping() ? 'Stop' : 'Send message')\n\n return (\n <ActionButton\n type={stopping() ? 'button' : 'submit'}\n variant=\"default\"\n size=\"icon-sm\"\n data-slot=\"prompt-input-submit\"\n data-status={local.status ?? 'ready'}\n aria-label={label()}\n tooltip={label()}\n tooltipSide=\"top\"\n class={cn('rounded-full', local.class)}\n onClick={(event: MouseEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n if (stopping()) {\n event.preventDefault()\n local.onStop?.()\n return\n }\n callHandler(local.onClick as JSX.EventHandlerUnion<HTMLButtonElement, MouseEvent>, event)\n }}\n {...(rest as ActionButtonProps)}\n >\n <Show when={custom()} fallback={<SubmitGlyph status={local.status} stop={stopping()} />}>\n {custom()}\n </Show>\n </ActionButton>\n )\n}\n\nfunction SubmitGlyph(props: { status?: PromptInputStatus; stop: boolean }) {\n return (\n <Show when={!props.stop} fallback={<Square class=\"fill-current\" />}>\n <Show when={props.status !== 'submitted'} fallback={<Spinner size=\"sm\" label={false} />}>\n <Show when={props.status !== 'error'} fallback={<X />}>\n <ArrowUp />\n </Show>\n </Show>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;AA0CA,SAAgB,YAAY,OAAyB;CACnD,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,SACA,cACA,YACA,YACA,YACA,UACA,OACF;CAGE,IAAA,OAAA,OAqBM;CArBN,IAAA,QAAA,KAAA;;;CAOEkC,OAAA,MAAA,CAAA;EANA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,8BAA8B,MAAM,KAAK;EAAC;EACpDlC,WAAW,UAAU;GACnB,MAAM,eAAe;GACrB,YAAY,MAAM,UAAU,KAAK;EACnC;CACQ,GAAJ,IAAA,GAAA,IAAA;CAPNmC,OAAA,YASE;EAAC,OAAA,MAAM;CAAM,GATflC,KAqBM;CArBNkC,OAAA,MAUEjC,gBAAAA,YAAAA;EACE,IAAA,kBAAA;GAAe,OAAA,MAAM,WAAW,KAAK,KAAA;EAAS;EAC9C,IAAA,UAAA;GAAO,OAAA,GACL,mEACA,8BACA,MAAM,UACR;EAAC;EANH,IAAA,WAAA;GAQG,OAAA,MAAM;EACG;CAnBdD,CAAAA,GAAAA,KAqBM;CArBNkC,OAAA,YAoBE;EAAC,OAAA,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AAA;GAAO,OAAA,GAAG,gBAAgB,MAAM,KAAK;EAAC;EACtCM,UAAU,UAA8E;GACtF,IAAI,SAAS,GAAG;IACd,MAAM,eAAe;IACrB,MAAM,SAAS;IACf;GACF;GACA,YAAY,MAAM,SAAiE,KAAK;EAC1F;CAMY,GALP,MAlBP,EAAA,IAAA,WAAA;EAoBEC,OAAAA,gBAAAA,MAAAA;GAAM,IAAA,OAAA;IAAM,OAAA,OAAO;GAAC;GAAE,IAAA,WAAA;IAAUC,OAAAA,gBAAAA,aAAAA;KAAa,IAAA,SAAA;MAAQ,OAAA,MAAM;KAAM;KAAE,IAAA,OAAA;MAAM,OAAA,SAAS;KAAC;IAAG,CAAA;GAAC;GAAvF,IAAA,WAAA;IACG,OAAA,OAAO;GACJ;;CACM,EAAA,CAAA,CAAA;AAElB;AAEA,SAAS,YAAY,OAAsD;CACzE,OACEC,WAAAA;;GAAY,OAAA,CAAC,MAAM;EAMb,CAAA,CAAC,CAAD,IALJC,WAAAA;;IAAY,OAAA,MAAM,WAAW;GAIvB,CAAA,CAAC,CAAD,IAHJC,WAAAA;;KAAY,OAAA,MAAM,WAAW;IAEvB,CAAA,CAAC,CAAD,IADJC,gBAAAA,SAAAA,CAAU,CAAA,IADoCC,gBAAAA,GAAAA,CAAI,CAAA;GAE9C,CAAA,IAH4CC,gBAAAA,SAAAA;IAASX,MAAK;IAAKY,OAAO;GAAQ,CAAA;EAIhF,CAAA,IAL2BC,gBAAAA,QAAAA,EAAQC,OAAM,eAAgB,CAAA;CAM3D,CAAA;AAEV"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
import { createComponent, effect, insert, memo, mergeProps, setAttribute, template } from "@solidjs/web";
|
|
2
|
+
import { CornerDownRight as CornerDownRight$1, ListChecks as ListChecks$1, ListTodo as ListTodo$1, MessageSquarePlus as MessageSquarePlus$1, X as X$1 } from "@lucide/solid";
|
|
3
|
+
import { For, Show, createMemo, omit, onCleanup } from "solid-js";
|
|
1
4
|
import { Button } from "../../ui/button/button.js";
|
|
2
5
|
import { Trace, TraceLine } from "../../ui/trace/trace.js";
|
|
3
6
|
import { TaskItemList, TaskItemRow } from "../task/task.js";
|
|
4
7
|
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
5
|
-
import { createComponent, effect, insert, memo, mergeProps, setAttribute, template } from "@solidjs/web";
|
|
6
|
-
import { CornerDownRight, ListChecks, ListTodo, MessageSquarePlus, X } from "@lucide/solid";
|
|
7
|
-
import { For, Show, createMemo, omit, onCleanup } from "solid-js";
|
|
8
8
|
// src/components/composites/queue/queue.tsx
|
|
9
9
|
var _tmpl$ = /* @__PURE__ */ template(`<span aria-hidden=true>`);
|
|
10
10
|
var _tmpl$2 = /* @__PURE__ */ template(`<span class=sr-only>`);
|
|
11
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"></p><!>`);
|
|
12
|
-
var CornerDownRight
|
|
13
|
-
var ListChecks
|
|
14
|
-
var ListTodo
|
|
15
|
-
var MessageSquarePlus
|
|
16
|
-
var X
|
|
12
|
+
var CornerDownRight = fastIcon(CornerDownRight$1);
|
|
13
|
+
var ListChecks = fastIcon(ListChecks$1);
|
|
14
|
+
var ListTodo = fastIcon(ListTodo$1);
|
|
15
|
+
var MessageSquarePlus = fastIcon(MessageSquarePlus$1);
|
|
16
|
+
var X = fastIcon(X$1);
|
|
17
17
|
/** Split a todo list into the two sections. Order is preserved within each. */
|
|
18
18
|
function partitionQueue(items) {
|
|
19
19
|
return {
|
|
@@ -59,7 +59,7 @@ function Queue(props) {
|
|
|
59
59
|
get children() {
|
|
60
60
|
return createComponent(TraceLine, {
|
|
61
61
|
get icon() {
|
|
62
|
-
return createComponent(ListTodo
|
|
62
|
+
return createComponent(ListTodo, {});
|
|
63
63
|
},
|
|
64
64
|
get title() {
|
|
65
65
|
return pendingLabel();
|
|
@@ -103,7 +103,7 @@ function Queue(props) {
|
|
|
103
103
|
get children() {
|
|
104
104
|
return createComponent(TraceLine, {
|
|
105
105
|
get icon() {
|
|
106
|
-
return createComponent(ListChecks
|
|
106
|
+
return createComponent(ListChecks, {});
|
|
107
107
|
},
|
|
108
108
|
get title() {
|
|
109
109
|
return completedLabel();
|
|
@@ -166,7 +166,7 @@ function FollowUpRow(props) {
|
|
|
166
166
|
var _el$3 = _tmpl$3();
|
|
167
167
|
var _el$4 = _el$3.firstChild;
|
|
168
168
|
var _el$5 = _el$4.nextSibling;
|
|
169
|
-
insert(_el$3, createComponent(CornerDownRight
|
|
169
|
+
insert(_el$3, createComponent(CornerDownRight, {
|
|
170
170
|
"aria-hidden": "true",
|
|
171
171
|
class: "mt-0.5 size-3.5 shrink-0 text-muted-foreground"
|
|
172
172
|
}), _el$4);
|
|
@@ -187,7 +187,7 @@ function FollowUpRow(props) {
|
|
|
187
187
|
},
|
|
188
188
|
onClick: () => onRemove()(),
|
|
189
189
|
get children() {
|
|
190
|
-
return createComponent(X
|
|
190
|
+
return createComponent(X, { "aria-hidden": "true" });
|
|
191
191
|
}
|
|
192
192
|
})
|
|
193
193
|
}), _el$5);
|
|
@@ -216,7 +216,7 @@ function QueueFollowUps(props) {
|
|
|
216
216
|
} }, rest, { get children() {
|
|
217
217
|
return createComponent(TraceLine, {
|
|
218
218
|
get icon() {
|
|
219
|
-
return createComponent(MessageSquarePlus
|
|
219
|
+
return createComponent(MessageSquarePlus, {});
|
|
220
220
|
},
|
|
221
221
|
get title() {
|
|
222
222
|
return title();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.js","names":["<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 <For keyed={false} each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </For>\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 <For keyed={false} each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </For>\n </TaskItemList>\n )}\n </TraceLine>\n </Show>\n </Trace>\n </Show>","<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 <For keyed={false} each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </For>\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 <For keyed={false} each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </For>\n </TaskItemList>\n )}\n </TraceLine>\n </Show>\n </Trace>","<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 <For keyed={false} each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </For>\n </TaskItemList>\n )}\n </TraceLine>\n </Show>","<TraceLine\n icon={<ListTodo />}\n title={pendingLabel()}\n meta={<Count count={pending().length} />}\n defaultOpen\n >\n {() => (\n <TaskItemList label={pendingLabel()}>\n <For keyed={false} each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </For>\n </TaskItemList>\n )}\n </TraceLine>","<ListTodo />","<Count count={pending().length} />","<TaskItemList label={pendingLabel()}>\n <For keyed={false} each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </For>\n </TaskItemList>","<For keyed={false} each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </For>","keyed={false}","<TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\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 <For keyed={false} each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </For>\n </TaskItemList>\n )}\n </TraceLine>\n </Show>","<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 <For keyed={false} each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </For>\n </TaskItemList>\n )}\n </TraceLine>","<ListChecks />","<Count count={completed().length} />","<TaskItemList label={completedLabel()}>\n <For keyed={false} each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </For>\n </TaskItemList>","<For keyed={false} each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </For>","<TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />","status=\"complete\"","<Show when={local.empty}>\n {(emptySlot) => (\n <Trace aria-label=\"Queue\" {...rest}>\n <TraceLine title={emptySlot()} />\n </Trace>\n )}\n </Show>","<Trace aria-label=\"Queue\" {...rest}>\n <TraceLine title={emptySlot()} />\n </Trace>","<TraceLine title={emptySlot()} />","<CornerDownRight aria-hidden=\"true\" class=\"mt-0.5 size-3.5 shrink-0 text-muted-foreground\" />","class=\"mt-0.5 size-3.5 shrink-0 text-muted-foreground\"","<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: HTMLButtonElement) => (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>","<Show when={props.item.onRemove}>\n {(onRemove) => (\n <Button\n ref={(element: HTMLButtonElement) => (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>","<Button\n ref={(element: HTMLButtonElement) => (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>","ref={(element: HTMLButtonElement) => (remove = element)}","type=\"button\"","variant=\"ghost\"","size=\"icon-2xs\"","class=\"shrink-0\"","onClick={() => onRemove()()}","<X aria-hidden=\"true\" />","<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 <For keyed={false} each={local.items}>\n {(item) => <FollowUpRow item={item()} />}\n </For>\n </TaskItemList>\n )}\n </TraceLine>\n </Trace>\n </Show>","<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 <For keyed={false} each={local.items}>\n {(item) => <FollowUpRow item={item()} />}\n </For>\n </TaskItemList>\n )}\n </TraceLine>\n </Trace>","<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 <For keyed={false} each={local.items}>\n {(item) => <FollowUpRow item={item()} />}\n </For>\n </TaskItemList>\n )}\n </TraceLine>","<MessageSquarePlus />","<Count count={local.items.length} noun={`${local.items.length} waiting`} />","<TaskItemList label={title()}>\n <For keyed={false} each={local.items}>\n {(item) => <FollowUpRow item={item()} />}\n </For>\n </TaskItemList>","<For keyed={false} each={local.items}>\n {(item) => <FollowUpRow item={item()} />}\n </For>","<FollowUpRow item={item()} />","CornerDownRight","LucideCornerDownRight","ListChecks","LucideListChecks","ListTodo","LucideListTodo","MessageSquarePlus","LucideMessageSquarePlus","X","LucideX"],"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 { createMemo, For, onCleanup, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\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 = props\n const rest = omit(\n 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 <For keyed={false} each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </For>\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 <For keyed={false} each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </For>\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: HTMLButtonElement) => (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 = props\n const rest = omit(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 <For keyed={false} each={local.items}>\n {(item) => <FollowUpRow item={item()} />}\n </For>\n </TaskItemList>\n )}\n </TraceLine>\n </Trace>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;AAeA,IAAMyC,oBAAkB,SAASC,eAAqB;AACtD,IAAMC,eAAa,SAASC,UAAgB;AAC5C,IAAMC,aAAW,SAASC,QAAc;AACxC,IAAMC,sBAAoB,SAASC,iBAAuB;AAC1D,IAAMC,MAAI,SAASC,CAAO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AC;KAA5B,IAAA,WAAA;MACEC,OAAAA,gBAAAA,KAAAA;OAAK/B,OAAO;OAAO,IAAA,OAAA;QAAM,OAAA,MAAM;OAAK;OAApC+B,WACI,SAASC,gBAAAA,aAAAA,EAAa,IAAA,OAAA;QAAM,OAAA,KAAK;OAAC,EAAG,CAAA;MACpC,CAAA;KACO;;GAEP,CAAA;EACN,EAAA,CAAA,CAAA,IAhBT,KAAA;CAiBM,CAAA;AAEV"}
|
|
1
|
+
{"version":3,"file":"queue.js","names":["<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 <For keyed={false} each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </For>\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 <For keyed={false} each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </For>\n </TaskItemList>\n )}\n </TraceLine>\n </Show>\n </Trace>\n </Show>","<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 <For keyed={false} each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </For>\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 <For keyed={false} each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </For>\n </TaskItemList>\n )}\n </TraceLine>\n </Show>\n </Trace>","<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 <For keyed={false} each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </For>\n </TaskItemList>\n )}\n </TraceLine>\n </Show>","<TraceLine\n icon={<ListTodo />}\n title={pendingLabel()}\n meta={<Count count={pending().length} />}\n defaultOpen\n >\n {() => (\n <TaskItemList label={pendingLabel()}>\n <For keyed={false} each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </For>\n </TaskItemList>\n )}\n </TraceLine>","<ListTodo />","<Count count={pending().length} />","<TaskItemList label={pendingLabel()}>\n <For keyed={false} each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </For>\n </TaskItemList>","<For keyed={false} each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </For>","keyed={false}","<TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\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 <For keyed={false} each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </For>\n </TaskItemList>\n )}\n </TraceLine>\n </Show>","<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 <For keyed={false} each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </For>\n </TaskItemList>\n )}\n </TraceLine>","<ListChecks />","<Count count={completed().length} />","<TaskItemList label={completedLabel()}>\n <For keyed={false} each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </For>\n </TaskItemList>","<For keyed={false} each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </For>","<TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />","status=\"complete\"","<Show when={local.empty}>\n {(emptySlot) => (\n <Trace aria-label=\"Queue\" {...rest}>\n <TraceLine title={emptySlot()} />\n </Trace>\n )}\n </Show>","<Trace aria-label=\"Queue\" {...rest}>\n <TraceLine title={emptySlot()} />\n </Trace>","<TraceLine title={emptySlot()} />","<CornerDownRight aria-hidden=\"true\" class=\"mt-0.5 size-3.5 shrink-0 text-muted-foreground\" />","class=\"mt-0.5 size-3.5 shrink-0 text-muted-foreground\"","<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: HTMLButtonElement) => (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>","<Show when={props.item.onRemove}>\n {(onRemove) => (\n <Button\n ref={(element: HTMLButtonElement) => (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>","<Button\n ref={(element: HTMLButtonElement) => (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>","ref={(element: HTMLButtonElement) => (remove = element)}","type=\"button\"","variant=\"ghost\"","size=\"icon-2xs\"","class=\"shrink-0\"","onClick={() => onRemove()()}","<X aria-hidden=\"true\" />","<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 <For keyed={false} each={local.items}>\n {(item) => <FollowUpRow item={item()} />}\n </For>\n </TaskItemList>\n )}\n </TraceLine>\n </Trace>\n </Show>","<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 <For keyed={false} each={local.items}>\n {(item) => <FollowUpRow item={item()} />}\n </For>\n </TaskItemList>\n )}\n </TraceLine>\n </Trace>","<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 <For keyed={false} each={local.items}>\n {(item) => <FollowUpRow item={item()} />}\n </For>\n </TaskItemList>\n )}\n </TraceLine>","<MessageSquarePlus />","<Count count={local.items.length} noun={`${local.items.length} waiting`} />","<TaskItemList label={title()}>\n <For keyed={false} each={local.items}>\n {(item) => <FollowUpRow item={item()} />}\n </For>\n </TaskItemList>","<For keyed={false} each={local.items}>\n {(item) => <FollowUpRow item={item()} />}\n </For>","<FollowUpRow item={item()} />","LucideCornerDownRight","LucideListChecks","LucideListTodo","LucideMessageSquarePlus","LucideX","_$insert","_$effect","_$setAttribute"],"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 { createMemo, For, onCleanup, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\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 = props\n const rest = omit(\n 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 <For keyed={false} each={pending()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status ?? 'pending'}\n />\n )}\n </For>\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 <For keyed={false} each={completed()}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status=\"complete\"\n />\n )}\n </For>\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: HTMLButtonElement) => (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 = props\n const rest = omit(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 <For keyed={false} each={local.items}>\n {(item) => <FollowUpRow item={item()} />}\n </For>\n </TaskItemList>\n )}\n </TraceLine>\n </Trace>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;AAeA,IAAM,kBAAkB,SAASyC,iBAAqB;AACtD,IAAM,aAAa,SAASC,YAAgB;AAC5C,IAAM,WAAW,SAASC,UAAc;AACxC,IAAM,oBAAoB,SAASC,mBAAuB;AAC1D,IAAM,IAAI,SAASC,GAAO;;AA2C1B,SAAgB,eAAe,OAG5B;CACD,OAAO;EACL,SAAS,MAAM,QAAQ,SAAS,KAAK,WAAW,UAAU;EAC1D,WAAW,MAAM,QAAQ,SAAS,KAAK,WAAW,UAAU;CAC9D;AACF;AAEA,SAAS,UAAU,OAAuB;CACxC,OAAO,GAAG,MAAM,GAAG,UAAU,IAAI,SAAS;AAC5C;;AAGA,SAAS,MAAM,OAAyC;CACtD,OACI,QACA;EAA4C,IAAA,OAAA,OAAA;EAA5CC,OAAA,YAAyB;GAAC,OAAA,MAAM;EAAK,CAAO;EAA5C,OAAA;CAA4C,EAAA,CAAA,UAC5C;EAAkE,IAAA,QAAA,QAAA;EAAlEA,OAAA,aAAsB;GAAC,OAAA,MAAM,QAAQ,UAAU,MAAM,KAAK;EAAC,CAAO;EAAlE,OAAA;CAAkE,EAAA,CAAA,CADnE;AAIL;AAYA,SAAgB,MAAM,OAAmB;CACvC,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,SACA,gBACA,kBACA,SACA,sBACF;CACA,MAAM,WAAW,iBAAiB,eAAe,MAAM,KAAK,CAAC;CAC7D,MAAM,gBAAgB,SAAS,CAAC,CAAC;CACjC,MAAM,kBAAkB,SAAS,CAAC,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,MAAM;EAAC,EAenB,GAfyB,MAAhC,EAAA,IAAA,WAAA;GACEC,OAAAA,gBAAAA,WAAAA;IACE,IAAA,OAAA;KAAMC,OAAAA,gBAAAA,mBAAAA,CAAoB,CAAA;IAAC;IAC3B,IAAA,QAAA;KAAO,OAAA,MAAM;IAAC;IACd,IAAA,OAAA;KAAMC,OAAAA,gBAAAA,OAAAA;MAAO,IAAA,QAAA;OAAO,OAAA,MAAM,MAAM;MAAM;MAAE,IAAA,OAAA;OAAM,OAAA,GAAG,MAAM,MAAM,OAAO;MAAS;KAAG,CAAA;IAAC;IACjF,IAAA,cAAA;KAAa,OAAA,MAAM,eAAe;IAAI;IAJxCF,gBAOIG,gBAAAA,cAAAA;KAAc,IAAA,QAAA;MAAO,OAAA,MAAM;KAAC;KAA5B,IAAA,WAAA;MACEC,OAAAA,gBAAAA,KAAAA;OAAK/B,OAAO;OAAO,IAAA,OAAA;QAAM,OAAA,MAAM;OAAK;OAApC+B,WACI,SAASC,gBAAAA,aAAAA,EAAa,IAAA,OAAA;QAAM,OAAA,KAAK;OAAC,EAAG,CAAA;MACpC,CAAA;KACO;;GAEP,CAAA;EACN,EAAA,CAAA,CAAA,IAhBT,KAAA;CAiBM,CAAA;AAEV"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { createComponent, mergeProps } from "@solidjs/web";
|
|
2
|
+
import { Brain as Brain$1 } from "@lucide/solid";
|
|
3
|
+
import { createEffect, createSignal, omit } from "solid-js";
|
|
1
4
|
import { isAtEnd, scrollGeometry } from "../../../lib/scroll-geometry.js";
|
|
2
5
|
import { MessageText } from "../../ui/message/message.js";
|
|
3
6
|
import { ScrollArea } from "../../ui/scroll-area/scroll-area.js";
|
|
4
7
|
import { TraceDetail, TraceLine, formatDuration } from "../../ui/trace/trace.js";
|
|
5
8
|
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
6
|
-
import { createComponent, mergeProps } from "@solidjs/web";
|
|
7
|
-
import { Brain } from "@lucide/solid";
|
|
8
|
-
import { createEffect, createSignal, omit } from "solid-js";
|
|
9
9
|
// src/components/composites/reasoning/reasoning.tsx
|
|
10
|
-
var Brain
|
|
10
|
+
var Brain = fastIcon(Brain$1);
|
|
11
11
|
/**
|
|
12
12
|
* Reasoning.
|
|
13
13
|
*
|
|
@@ -109,7 +109,7 @@ function Reasoning(props) {
|
|
|
109
109
|
});
|
|
110
110
|
return createComponent(TraceLine, mergeProps({
|
|
111
111
|
get icon() {
|
|
112
|
-
return local.icon ?? createComponent(Brain
|
|
112
|
+
return local.icon ?? createComponent(Brain, {});
|
|
113
113
|
},
|
|
114
114
|
get title() {
|
|
115
115
|
return local.title ?? reasoningTitle({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reasoning.js","names":["<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>","<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>","ref={(element) => (scroller = element)}","role=\"region\"","class=\"max-h-72\"","onScroll={(event) => {\n following = isAtEnd(scrollGeometry(event.currentTarget))\n }}","<MessageText\n text={props.text}\n streaming={props.streaming}\n codeBlockProps={{ maxHeight: '16rem', wrap: true }}\n />","codeBlockProps={{ maxHeight: '16rem', wrap: true }}","<ReasoningBody text={local.text ?? ''} streaming={local.streaming} />","<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>","<Brain />","statusLabel=\"In progress\"","onOpenChange={(value) => {\n setChosen(value)\n local.onOpenChange?.(value)\n }}","
|
|
1
|
+
{"version":3,"file":"reasoning.js","names":["<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>","<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>","ref={(element) => (scroller = element)}","role=\"region\"","class=\"max-h-72\"","onScroll={(event) => {\n following = isAtEnd(scrollGeometry(event.currentTarget))\n }}","<MessageText\n text={props.text}\n streaming={props.streaming}\n codeBlockProps={{ maxHeight: '16rem', wrap: true }}\n />","codeBlockProps={{ maxHeight: '16rem', wrap: true }}","<ReasoningBody text={local.text ?? ''} streaming={local.streaming} />","<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>","<Brain />","statusLabel=\"In progress\"","onOpenChange={(value) => {\n setChosen(value)\n local.onOpenChange?.(value)\n }}","LucideBrain"],"sources":["../../../../src/components/composites/reasoning/reasoning.tsx"],"sourcesContent":["import { Brain as LucideBrain } from '@lucide/solid'\nimport { createEffect, createSignal, omit } from 'solid-js'\nimport { type JSX } from '@solidjs/web'\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 // New text is the event that may need following.\n createEffect(\n () => ({ text: props.text, streaming: props.streaming }),\n ({ streaming }) => {\n if (streaming && following && scroller) scroller.scrollTop = scroller.scrollHeight\n }\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 = props\n const rest = omit(props, 'text', 'streaming', 'duration', 'title', 'icon', 'open', 'onOpenChange')\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 // A new stream hands the line back to the stream: the reader's last choice was\n // about the previous one.\n createEffect(\n () => local.streaming,\n (streaming) => {\n if (streaming) setChosen(undefined)\n },\n { defer: true }\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":";;;;;;;;;AAUA,IAAM,QAAQ,SAASa,OAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+ClC,SAAgB,eAAe,OAA2D;CACxF,IAAI,MAAM,WAAW,OAAO;CAC5B,MAAM,WAAW,eAAe,MAAM,QAAQ;CAC9C,OAAO,WAAW,eAAe,aAAa;AAChD;AAwBA,SAAS,cAAc,OAA8C;CACnE,IAAI;CACJ,IAAI,YAAY;CAGhB,oBACS;EAAE,MAAM,MAAM;EAAM,WAAW,MAAM;CAAU,KACrD,EAAE,gBAAgB;EACjB,IAAI,aAAa,aAAa,UAAU,SAAS,YAAY,SAAS;CACxE,CACF;CAEA,OACEb,gBAAAA,aAAAA,EAAAA,IAAAA,WAAAA;EACEC,OAAAA,gBAAAA,YAAAA;GACEC,MAAM,YAAa,WAAW;GAC9BC,MAAK;GACL,cAAW;GACXC,OAAM;GACNC,WAAW,UAAU;IACnB,YAAY,QAAQ,eAAe,MAAM,aAAa,CAAC;GACzD;GAPF,IAAA,WAAA;IASEC,OAAAA,gBAAAA,aAAAA;KACE,IAAA,OAAA;MAAM,OAAA,MAAM;KAAI;KAChB,IAAA,YAAA;MAAW,OAAA,MAAM;KAAS;KAC1BC,gBAAgB;MAAE,WAAW;MAAS,MAAM;KAAK;IAClD,CAAA;GACS;;CACD,EAAA,CAAA;AAEjB;AAEA,SAAgB,UAAU,OAAuB;CAC/C,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,QAAQ,aAAa,YAAY,SAAS,QAAQ,QAAQ,cAAc;CAGjG,MAAM,CAAC,QAAQ,aAAa,aAAsB;CAClD,MAAM,aAAa,MAAM,QAAQ,OAAO,KAAK,MAAM,cAAc;CACjE,MAAM,iBAAiB,MAAM,QAAQ,GAAA,CAAI,KAAK,MAAM,MAAM,MAAM,cAAc;CAI9E,mBACQ,MAAM,YACX,cAAc;EACb,IAAI,WAAW,UAAU,KAAA,CAAS;CACpC,GACA,EAAE,OAAO,KAAK,CAChB;CAEA,MAAM,aAAaC,gBAAAA,eAAAA;EAAe,IAAA,OAAA;GAAM,OAAA,MAAM,QAAQ;EAAE;EAAE,IAAA,YAAA;GAAW,OAAA,MAAM;EAAS;CAAG,CAAA;CAEvF,OACEC,gBAAAA,WAAAA,WAAAA;EACE,IAAA,OAAA;GAAM,OAAA,MAAM,QAAQC,gBAAAA,OAAAA,CAAQ,CAAA;EAAC;EAC7B,IAAA,QAAA;GACE,OAAA,MAAM,SAAS,eAAe;IAAE,WAAW,MAAM;IAAW,UAAU,MAAM;GAAS,CAAC;EACxF;EACA,IAAA,SAAA;GAAQ,OAAA,MAAM,YAAY,YAAY,KAAA;EAAS;EAC/CC,aAAY;EACZ,IAAA,OAAA;GAAM,OAAA,KAAK;EAAC;EACZC,eAAe,UAAU;GACvB,UAAU,KAAK;GACf,MAAM,eAAe,KAAK;EAC5B;CAIS,GAHL,MAZN,EAAA,IAAA,WAAA;EAcG,OAAA,QAAQ,IAAI,OAAO,KAAA;CACX,EAAA,CAAA,CAAA;AAEf"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ActionButton } from "../action-button/action-button.js";
|
|
2
|
-
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
3
1
|
import { createComponent, effect, insert, memo, setAttribute, template } from "@solidjs/web";
|
|
4
|
-
import { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, ZoomIn, ZoomOut } from "@lucide/solid";
|
|
2
|
+
import { ArrowDown as ArrowDown$1, ArrowLeft as ArrowLeft$1, ArrowRight as ArrowRight$1, ArrowUp as ArrowUp$1, ZoomIn as ZoomIn$1, ZoomOut as ZoomOut$1 } from "@lucide/solid";
|
|
5
3
|
import { createSignal, onCleanup } from "solid-js";
|
|
4
|
+
import { ActionButton } from "../action-button/action-button.js";
|
|
5
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
6
6
|
// src/components/composites/scene-controls/scene-controls.tsx
|
|
7
7
|
var _tmpl$ = /* @__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"><!><!>`);
|
|
8
8
|
var _tmpl$2 = /* @__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></span><!><!><!>`);
|
|
9
9
|
var _tmpl$3 = /* @__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"><!><!>`);
|
|
10
|
-
var ArrowDown
|
|
11
|
-
var ArrowLeft
|
|
12
|
-
var ArrowRight
|
|
13
|
-
var ArrowUp
|
|
14
|
-
var ZoomIn
|
|
15
|
-
var ZoomOut
|
|
10
|
+
var ArrowDown = fastIcon(ArrowDown$1);
|
|
11
|
+
var ArrowLeft = fastIcon(ArrowLeft$1);
|
|
12
|
+
var ArrowRight = fastIcon(ArrowRight$1);
|
|
13
|
+
var ArrowUp = fastIcon(ArrowUp$1);
|
|
14
|
+
var ZoomIn = fastIcon(ZoomIn$1);
|
|
15
|
+
var ZoomOut = fastIcon(ZoomOut$1);
|
|
16
16
|
var DEFAULT_LABELS = {
|
|
17
17
|
movementGroup: "Scene movement controls",
|
|
18
18
|
forward: "Move forward",
|
|
@@ -168,7 +168,7 @@ function SceneControls(props) {
|
|
|
168
168
|
return (pressed) => callback?.("forward", pressed);
|
|
169
169
|
},
|
|
170
170
|
get children() {
|
|
171
|
-
return createComponent(ArrowUp
|
|
171
|
+
return createComponent(ArrowUp, { "aria-hidden": "true" });
|
|
172
172
|
}
|
|
173
173
|
}), _el$7);
|
|
174
174
|
insert(_el$5, createComponent(HoldAction, {
|
|
@@ -183,7 +183,7 @@ function SceneControls(props) {
|
|
|
183
183
|
return (pressed) => callback?.("left", pressed);
|
|
184
184
|
},
|
|
185
185
|
get children() {
|
|
186
|
-
return createComponent(ArrowLeft
|
|
186
|
+
return createComponent(ArrowLeft, { "aria-hidden": "true" });
|
|
187
187
|
}
|
|
188
188
|
}), _el$8);
|
|
189
189
|
insert(_el$5, createComponent(HoldAction, {
|
|
@@ -198,7 +198,7 @@ function SceneControls(props) {
|
|
|
198
198
|
return (pressed) => callback?.("backward", pressed);
|
|
199
199
|
},
|
|
200
200
|
get children() {
|
|
201
|
-
return createComponent(ArrowDown
|
|
201
|
+
return createComponent(ArrowDown, { "aria-hidden": "true" });
|
|
202
202
|
}
|
|
203
203
|
}), _el$9);
|
|
204
204
|
insert(_el$5, createComponent(HoldAction, {
|
|
@@ -213,7 +213,7 @@ function SceneControls(props) {
|
|
|
213
213
|
return (pressed) => callback?.("right", pressed);
|
|
214
214
|
},
|
|
215
215
|
get children() {
|
|
216
|
-
return createComponent(ArrowRight
|
|
216
|
+
return createComponent(ArrowRight, { "aria-hidden": "true" });
|
|
217
217
|
}
|
|
218
218
|
}), _el$10);
|
|
219
219
|
effect(() => labels().movementGroup, (_v$) => {
|
|
@@ -249,7 +249,7 @@ function SceneControls(props) {
|
|
|
249
249
|
},
|
|
250
250
|
onClick: () => props.onZoomOut?.(),
|
|
251
251
|
get children() {
|
|
252
|
-
return createComponent(ZoomOut
|
|
252
|
+
return createComponent(ZoomOut, { "aria-hidden": "true" });
|
|
253
253
|
}
|
|
254
254
|
}) : void 0;
|
|
255
255
|
};
|
|
@@ -271,7 +271,7 @@ function SceneControls(props) {
|
|
|
271
271
|
},
|
|
272
272
|
onClick: () => props.onZoomIn?.(),
|
|
273
273
|
get children() {
|
|
274
|
-
return createComponent(ZoomIn
|
|
274
|
+
return createComponent(ZoomIn, { "aria-hidden": "true" });
|
|
275
275
|
}
|
|
276
276
|
}) : void 0;
|
|
277
277
|
};
|
|
@@ -300,7 +300,7 @@ function SceneControls(props) {
|
|
|
300
300
|
return (pressed) => callback?.(pressed);
|
|
301
301
|
},
|
|
302
302
|
get children() {
|
|
303
|
-
return createComponent(ArrowUp
|
|
303
|
+
return createComponent(ArrowUp, { "aria-hidden": "true" });
|
|
304
304
|
}
|
|
305
305
|
}) : void 0;
|
|
306
306
|
};
|