@adea-ai/ui 0.154.0 → 0.154.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/components/composites/about-dialog/about-dialog.d.ts.map +1 -1
- package/dist/components/composites/about-dialog/about-dialog.js +3 -1
- package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
- package/dist/components/composites/accent-picker/accent-picker.js +20 -9
- package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
- package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +20 -10
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
- package/dist/components/composites/action-button/action-button.js +37 -24
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +7 -3
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +11 -6
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +8 -3
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.js +8 -4
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.js +7 -3
- package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js +8 -4
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js +3 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
- package/dist/components/composites/chat/chat.d.ts.map +1 -1
- package/dist/components/composites/chat/chat.js +5 -1
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.d.ts.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.js +3 -1
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.d.ts.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js +11 -5
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context.d.ts.map +1 -1
- package/dist/components/composites/context/context.js +7 -4
- package/dist/components/composites/context/context.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -1
- package/dist/components/composites/file-tree/file-tree.js +7 -3
- package/dist/components/composites/file-tree/file-tree.js.map +1 -1
- package/dist/components/composites/help-center/help-center.d.ts.map +1 -1
- package/dist/components/composites/help-center/help-center.js +3 -1
- package/dist/components/composites/help-center/help-center.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.d.ts +2 -2
- package/dist/components/composites/icon-picker/icon-picker.d.ts.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js +77 -71
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/icon-picker/shell-icons.d.ts.map +1 -1
- package/dist/components/composites/icon-picker/shell-icons.js +119 -59
- package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.d.ts.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.js +5 -2
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.d.ts.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js +3 -4
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.d.ts.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js +5 -2
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.d.ts.map +1 -1
- package/dist/components/composites/model-selector/model-selector.js +9 -5
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/plan/plan.d.ts.map +1 -1
- package/dist/components/composites/plan/plan.js +3 -1
- package/dist/components/composites/plan/plan.js.map +1 -1
- package/dist/components/composites/queue/queue.d.ts.map +1 -1
- package/dist/components/composites/queue/queue.js +11 -5
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/reasoning.d.ts.map +1 -1
- package/dist/components/composites/reasoning/reasoning.js +3 -1
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.d.ts.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.js +14 -7
- package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
- package/dist/components/composites/settings/settings.d.ts.map +1 -1
- package/dist/components/composites/settings/settings.js +77 -67
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/sources/sources.d.ts.map +1 -1
- package/dist/components/composites/sources/sources.js +39 -39
- package/dist/components/composites/sources/sources.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.d.ts.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js +9 -4
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/stat/stat.d.ts.map +1 -1
- package/dist/components/composites/stat/stat.js +4 -1
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/subagent/subagent.d.ts.map +1 -1
- package/dist/components/composites/subagent/subagent.js +3 -1
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/task/task.d.ts.map +1 -1
- package/dist/components/composites/task/task.js +3 -1
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/ansi.d.ts.map +1 -1
- package/dist/components/composites/terminal/ansi.js +16 -0
- package/dist/components/composites/terminal/ansi.js.map +1 -1
- package/dist/components/composites/terminal/terminal.d.ts.map +1 -1
- package/dist/components/composites/terminal/terminal.js +15 -7
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/test-results/test-results.d.ts.map +1 -1
- package/dist/components/composites/test-results/test-results.js +15 -7
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.d.ts.map +1 -1
- package/dist/components/composites/tool/tool.js +3 -1
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree.d.ts.map +1 -1
- package/dist/components/composites/tree/tree.js +3 -1
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +34 -24
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.d.ts.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js +17 -12
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.d.ts.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +5 -2
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.d.ts.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.js +9 -4
- package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
- package/dist/components/conversation/busy-send-button.d.ts.map +1 -1
- package/dist/components/conversation/busy-send-button.js +9 -5
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/conversation-avatar.d.ts.map +1 -1
- package/dist/components/conversation/conversation-avatar.js +6 -3
- package/dist/components/conversation/conversation-avatar.js.map +1 -1
- package/dist/components/conversation/conversation-surface.d.ts.map +1 -1
- package/dist/components/conversation/conversation-surface.js +3 -1
- package/dist/components/conversation/conversation-surface.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +9 -4
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.d.ts.map +1 -1
- package/dist/components/conversation/message-composer.js +9 -4
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/message-row.d.ts.map +1 -1
- package/dist/components/conversation/message-row.js +11 -5
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/thread-panel.d.ts.map +1 -1
- package/dist/components/conversation/thread-panel.js +3 -1
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/conversation/transcript-composition.d.ts.map +1 -1
- package/dist/components/conversation/transcript-composition.js +3 -1
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/layout/floating-preview/floating-preview.d.ts.map +1 -1
- package/dist/components/layout/floating-preview/floating-preview.js +5 -2
- package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +3 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.d.ts.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.js +3 -1
- package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +3 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +5 -2
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +3 -1
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/theme/appearance-panel.d.ts.map +1 -1
- package/dist/components/theme/appearance-panel.js +3 -1
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/theme-mode-toggle.d.ts.map +1 -1
- package/dist/components/theme/theme-mode-toggle.js +6 -3
- package/dist/components/theme/theme-mode-toggle.js.map +1 -1
- package/dist/components/theme/theme-toggle.d.ts.map +1 -1
- package/dist/components/theme/theme-toggle.js +6 -3
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/accordion/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion/accordion.js +3 -1
- package/dist/components/ui/accordion/accordion.js.map +1 -1
- package/dist/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/components/ui/alert/alert.js +15 -9
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.d.ts.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js +5 -4
- package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
- package/dist/components/ui/attachment/attachment.d.ts.map +1 -1
- package/dist/components/ui/attachment/attachment.js +18 -9
- package/dist/components/ui/attachment/attachment.js.map +1 -1
- package/dist/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.js +30 -11
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js +5 -2
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/button/button.js +37 -13
- package/dist/components/ui/button/button.js.map +1 -1
- package/dist/components/ui/calendar/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar/calendar.js +5 -2
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/carousel/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel/carousel.js +12 -6
- package/dist/components/ui/carousel/carousel.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts +13 -0
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +296 -21
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
- package/dist/components/ui/code-block/code-block.js +9 -6
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.js +8 -11
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/command/command.d.ts.map +1 -1
- package/dist/components/ui/command/command.js +4 -2
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.d.ts.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.js +3 -1
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.js +3 -1
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.js +7 -3
- package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
- package/dist/components/ui/empty/empty-state.d.ts.map +1 -1
- package/dist/components/ui/empty/empty-state.js +3 -1
- package/dist/components/ui/empty/empty-state.js.map +1 -1
- package/dist/components/ui/field/field.d.ts.map +1 -1
- package/dist/components/ui/field/field.js +12 -6
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/input/input-control.d.ts +2 -0
- package/dist/components/ui/input/input-control.d.ts.map +1 -1
- package/dist/components/ui/input/input-control.js +24 -6
- package/dist/components/ui/input/input-control.js.map +1 -1
- package/dist/components/ui/input/input.d.ts.map +1 -1
- package/dist/components/ui/input/input.js +47 -48
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/input-group/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group/input-group.js +1 -8
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/message/index.d.ts +1 -1
- package/dist/components/ui/message/index.d.ts.map +1 -1
- package/dist/components/ui/message/index.js +2 -2
- package/dist/components/ui/message/message.d.ts.map +1 -1
- package/dist/components/ui/message/message.js +5 -3
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/message/parse-message-text.d.ts +32 -0
- package/dist/components/ui/message/parse-message-text.d.ts.map +1 -1
- package/dist/components/ui/message/parse-message-text.js +63 -3
- package/dist/components/ui/message/parse-message-text.js.map +1 -1
- package/dist/components/ui/native-select/native-select.d.ts.map +1 -1
- package/dist/components/ui/native-select/native-select.js +4 -9
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js +3 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination/pagination.js +7 -3
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.d.ts.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js +9 -4
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js +4 -9
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/resizable/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable/resizable.js +3 -1
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/select/select.d.ts.map +1 -1
- package/dist/components/ui/select/select.js +7 -3
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet/sheet.js +3 -1
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/spinner/spinner.d.ts.map +1 -1
- package/dist/components/ui/spinner/spinner.js +3 -1
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js +35 -30
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/components/ui/switch/switch.d.ts +7 -0
- package/dist/components/ui/switch/switch.d.ts.map +1 -1
- package/dist/components/ui/switch/switch.js +255 -17
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea/textarea.js +1 -8
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.d.ts.map +1 -1
- package/dist/components/ui/toast/toast.js +3 -1
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.js +10 -4
- package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
- package/dist/components/ui/tooltip/index.d.ts +1 -0
- package/dist/components/ui/tooltip/index.d.ts.map +1 -1
- package/dist/components/ui/tooltip/index.js +2 -1
- package/dist/components/ui/tooltip/lazy-tooltip.d.ts +40 -0
- package/dist/components/ui/tooltip/lazy-tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip/lazy-tooltip.js +61 -0
- package/dist/components/ui/tooltip/lazy-tooltip.js.map +1 -0
- package/dist/components/ui/trace/trace.d.ts.map +1 -1
- package/dist/components/ui/trace/trace.js +82 -68
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/components/ui/typography/typography.d.ts +1 -1
- package/dist/components/ui/typography/typography.d.ts.map +1 -1
- package/dist/components/ui/typography/typography.js +5 -6
- package/dist/components/ui/typography/typography.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/lib/clipboard.d.ts.map +1 -1
- package/dist/lib/clipboard.js +3 -0
- package/dist/lib/clipboard.js.map +1 -1
- package/dist/lib/fast-icon.d.ts +18 -0
- package/dist/lib/fast-icon.d.ts.map +1 -0
- package/dist/lib/fast-icon.js +75 -0
- package/dist/lib/fast-icon.js.map +1 -0
- package/dist/lib/form-field.d.ts +1 -1
- package/dist/lib/form-field.js +3 -1
- package/dist/lib/form-field.js.map +1 -1
- package/dist/lib/observe-resize.d.ts +14 -0
- package/dist/lib/observe-resize.d.ts.map +1 -0
- package/dist/lib/observe-resize.js +19 -0
- package/dist/lib/observe-resize.js.map +1 -0
- package/dist/lint/index.d.ts +1 -0
- package/dist/lint/index.d.ts.map +1 -1
- package/dist/lint.js +251 -118
- package/dist/lint.js.map +1 -1
- package/dist/r/action-button.json +3 -1
- package/dist/r/floating-preview.json +2 -1
- package/dist/r/icon-picker.json +0 -1
- package/dist/r/lib.json +10 -0
- package/dist/r/plan.json +2 -1
- package/dist/r/queue.json +2 -1
- package/dist/r/registry.json +30 -9
- package/dist/r/scene-controls.json +2 -1
- package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +5 -1
- package/dist/r/src/components/composites/accent-picker/accent-picker.tsx +22 -17
- package/dist/r/src/components/composites/account-menu/account-menu.tsx +21 -9
- package/dist/r/src/components/composites/action-button/action-button.tsx +38 -21
- package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
- package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
- package/dist/r/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
- package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
- package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
- package/dist/r/src/components/composites/chat/chat.tsx +11 -1
- package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +5 -1
- package/dist/r/src/components/composites/confirmation/confirmation.tsx +15 -1
- package/dist/r/src/components/composites/context/context.tsx +9 -1
- package/dist/r/src/components/composites/file-tree/file-tree.tsx +11 -1
- package/dist/r/src/components/composites/help-center/help-center.tsx +5 -1
- package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +59 -31
- package/dist/r/src/components/composites/icon-picker/shell-icons.ts +121 -59
- package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +6 -1
- package/dist/r/src/components/composites/list-row/list-row-control.tsx +7 -5
- package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +6 -1
- package/dist/r/src/components/composites/model-selector/model-selector.tsx +11 -1
- package/dist/r/src/components/composites/plan/plan.tsx +5 -1
- package/dist/r/src/components/composites/queue/queue.tsx +15 -1
- package/dist/r/src/components/composites/reasoning/reasoning.tsx +5 -1
- package/dist/r/src/components/composites/scene-controls/scene-controls.tsx +17 -1
- package/dist/r/src/components/composites/settings/settings.tsx +23 -14
- package/dist/r/src/components/composites/sources/sources.tsx +27 -20
- package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +13 -1
- package/dist/r/src/components/composites/stat/stat.tsx +9 -1
- package/dist/r/src/components/composites/subagent/subagent.tsx +5 -1
- package/dist/r/src/components/composites/task/task.tsx +5 -1
- package/dist/r/src/components/composites/terminal/ansi.ts +18 -0
- package/dist/r/src/components/composites/terminal/terminal.tsx +17 -7
- package/dist/r/src/components/composites/test-results/test-results.tsx +17 -7
- package/dist/r/src/components/composites/tool/tool.tsx +5 -1
- package/dist/r/src/components/composites/tree/tree.tsx +5 -1
- package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +35 -15
- package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
- package/dist/r/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
- package/dist/r/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
- package/dist/r/src/components/conversation/busy-send-button.tsx +11 -1
- package/dist/r/src/components/conversation/conversation-avatar.tsx +7 -1
- package/dist/r/src/components/conversation/conversation-surface.tsx +5 -1
- package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
- package/dist/r/src/components/conversation/message-composer.tsx +13 -1
- package/dist/r/src/components/conversation/message-row.tsx +15 -1
- package/dist/r/src/components/conversation/thread-panel.tsx +5 -1
- package/dist/r/src/components/conversation/transcript-composition.tsx +5 -1
- package/dist/r/src/components/layout/floating-preview/floating-preview.tsx +6 -1
- package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
- package/dist/r/src/components/layout/shell-rail/shell-rail.tsx +5 -1
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +6 -1
- package/dist/r/src/components/layout/top-bar/top-bar.tsx +5 -1
- package/dist/r/src/components/theme/appearance-panel.tsx +6 -1
- package/dist/r/src/components/theme/theme-mode-toggle.tsx +7 -1
- package/dist/r/src/components/theme/theme-toggle.tsx +7 -1
- package/dist/r/src/components/ui/accordion/accordion.tsx +5 -1
- package/dist/r/src/components/ui/alert/alert.tsx +20 -3
- package/dist/r/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
- package/dist/r/src/components/ui/attachment/attachment.tsx +19 -8
- package/dist/r/src/components/ui/badge/badge.tsx +24 -8
- package/dist/r/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
- package/dist/r/src/components/ui/button/button.tsx +47 -16
- package/dist/r/src/components/ui/calendar/calendar.tsx +6 -1
- package/dist/r/src/components/ui/carousel/carousel.tsx +15 -5
- package/dist/r/src/components/ui/checkbox/checkbox.tsx +260 -22
- package/dist/r/src/components/ui/code-block/code-block.tsx +11 -5
- package/dist/r/src/components/ui/combobox/combobox.tsx +8 -9
- package/dist/r/src/components/ui/command/command.tsx +8 -4
- package/dist/r/src/components/ui/detail-panel/detail-panel.tsx +5 -1
- package/dist/r/src/components/ui/dialog/dialog.tsx +5 -1
- package/dist/r/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
- package/dist/r/src/components/ui/empty/empty-state.tsx +5 -1
- package/dist/r/src/components/ui/field/field.tsx +14 -5
- package/dist/r/src/components/ui/input/input-control.tsx +28 -19
- package/dist/r/src/components/ui/input/input.tsx +9 -12
- package/dist/r/src/components/ui/input-group/input-group.tsx +1 -8
- package/dist/r/src/components/ui/message/index.ts +3 -0
- package/dist/r/src/components/ui/message/message.tsx +11 -2
- package/dist/r/src/components/ui/message/parse-message-text.ts +94 -2
- package/dist/r/src/components/ui/native-select/native-select.tsx +6 -9
- package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
- package/dist/r/src/components/ui/pagination/pagination.tsx +11 -1
- package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +13 -1
- package/dist/r/src/components/ui/radio-group/radio-group.tsx +6 -9
- package/dist/r/src/components/ui/resizable/resizable.tsx +5 -1
- package/dist/r/src/components/ui/select/select.tsx +11 -1
- package/dist/r/src/components/ui/sheet/sheet.tsx +5 -1
- package/dist/r/src/components/ui/spinner/spinner.tsx +5 -1
- package/dist/r/src/components/ui/status-chip/status-chip.tsx +14 -7
- package/dist/r/src/components/ui/switch/switch.tsx +235 -28
- package/dist/r/src/components/ui/textarea/textarea.tsx +1 -8
- package/dist/r/src/components/ui/toast/toast.tsx +5 -1
- package/dist/r/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
- package/dist/r/src/components/ui/tooltip/index.ts +1 -0
- package/dist/r/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
- package/dist/r/src/components/ui/trace/trace.tsx +61 -28
- package/dist/r/src/components/ui/typography/typography.tsx +6 -5
- package/dist/r/src/lib/clipboard.ts +4 -0
- package/dist/r/src/lib/fast-icon.ts +88 -0
- package/dist/r/src/lib/form-field.ts +7 -7
- package/dist/r/src/lib/observe-resize.ts +28 -0
- package/dist/r/subagent.json +2 -1
- package/dist/r/tool.json +2 -1
- package/dist/r/tooltip.json +5 -0
- package/dist/r/trace.json +0 -1
- package/package.json +1 -1
- package/registry.json +30 -9
- package/src/components/composites/about-dialog/about-dialog.tsx +5 -1
- package/src/components/composites/accent-picker/accent-picker.tsx +22 -17
- package/src/components/composites/account-menu/account-menu.tsx +21 -9
- package/src/components/composites/action-button/action-button.tsx +38 -21
- package/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
- package/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
- package/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
- package/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
- package/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
- package/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
- package/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
- package/src/components/composites/chat/chat.tsx +11 -1
- package/src/components/composites/checkpoint/checkpoint.tsx +5 -1
- package/src/components/composites/confirmation/confirmation.tsx +15 -1
- package/src/components/composites/context/context.tsx +9 -1
- package/src/components/composites/file-tree/file-tree.tsx +11 -1
- package/src/components/composites/help-center/help-center.tsx +5 -1
- package/src/components/composites/icon-picker/icon-picker.tsx +59 -31
- package/src/components/composites/icon-picker/shell-icons.ts +121 -59
- package/src/components/composites/inline-citation/inline-citation.tsx +6 -1
- package/src/components/composites/list-row/list-row-control.tsx +7 -5
- package/src/components/composites/message-scroller/message-scroller.tsx +6 -1
- package/src/components/composites/model-selector/model-selector.tsx +11 -1
- package/src/components/composites/plan/plan.tsx +5 -1
- package/src/components/composites/queue/queue.tsx +15 -1
- package/src/components/composites/reasoning/reasoning.tsx +5 -1
- package/src/components/composites/scene-controls/scene-controls.tsx +17 -1
- package/src/components/composites/settings/settings.tsx +23 -14
- package/src/components/composites/sources/sources.tsx +27 -20
- package/src/components/composites/stack-trace/stack-trace.tsx +13 -1
- package/src/components/composites/stat/stat.tsx +9 -1
- package/src/components/composites/subagent/subagent.tsx +5 -1
- package/src/components/composites/task/task.tsx +5 -1
- package/src/components/composites/terminal/ansi.ts +18 -0
- package/src/components/composites/terminal/terminal.tsx +17 -7
- package/src/components/composites/test-results/test-results.tsx +17 -7
- package/src/components/composites/tool/tool.tsx +5 -1
- package/src/components/composites/tree/tree.tsx +5 -1
- package/src/components/composites/update-dialog/update-dialog.tsx +35 -15
- package/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
- package/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
- package/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
- package/src/components/conversation/busy-send-button.tsx +11 -1
- package/src/components/conversation/conversation-avatar.tsx +7 -1
- package/src/components/conversation/conversation-surface.tsx +5 -1
- package/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
- package/src/components/conversation/message-composer.tsx +13 -1
- package/src/components/conversation/message-row.tsx +15 -1
- package/src/components/conversation/thread-panel.tsx +5 -1
- package/src/components/conversation/transcript-composition.tsx +5 -1
- package/src/components/layout/floating-preview/floating-preview.tsx +6 -1
- package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
- package/src/components/layout/shell-rail/shell-rail.tsx +5 -1
- package/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
- package/src/components/layout/split-layout/split-layout.tsx +6 -1
- package/src/components/layout/top-bar/top-bar.tsx +5 -1
- package/src/components/theme/appearance-panel.tsx +6 -1
- package/src/components/theme/theme-mode-toggle.tsx +7 -1
- package/src/components/theme/theme-toggle.tsx +7 -1
- package/src/components/ui/accordion/accordion.tsx +5 -1
- package/src/components/ui/alert/alert.tsx +20 -3
- package/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
- package/src/components/ui/attachment/attachment.tsx +19 -8
- package/src/components/ui/badge/badge.tsx +24 -8
- package/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
- package/src/components/ui/button/button.tsx +47 -16
- package/src/components/ui/calendar/calendar.tsx +6 -1
- package/src/components/ui/carousel/carousel.tsx +15 -5
- package/src/components/ui/checkbox/checkbox.tsx +260 -22
- package/src/components/ui/code-block/code-block.tsx +11 -5
- package/src/components/ui/combobox/combobox.tsx +8 -9
- package/src/components/ui/command/command.tsx +8 -4
- package/src/components/ui/detail-panel/detail-panel.tsx +5 -1
- package/src/components/ui/dialog/dialog.tsx +5 -1
- package/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
- package/src/components/ui/empty/empty-state.tsx +5 -1
- package/src/components/ui/field/field.tsx +14 -5
- package/src/components/ui/input/input-control.tsx +28 -19
- package/src/components/ui/input/input.tsx +9 -12
- package/src/components/ui/input-group/input-group.tsx +1 -8
- package/src/components/ui/message/index.ts +3 -0
- package/src/components/ui/message/message.tsx +11 -2
- package/src/components/ui/message/parse-message-text.ts +94 -2
- package/src/components/ui/native-select/native-select.tsx +6 -9
- package/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
- package/src/components/ui/pagination/pagination.tsx +11 -1
- package/src/components/ui/questionnaire/questionnaire.tsx +13 -1
- package/src/components/ui/radio-group/radio-group.tsx +6 -9
- package/src/components/ui/resizable/resizable.tsx +5 -1
- package/src/components/ui/select/select.tsx +11 -1
- package/src/components/ui/sheet/sheet.tsx +5 -1
- package/src/components/ui/spinner/spinner.tsx +5 -1
- package/src/components/ui/status-chip/status-chip.tsx +14 -7
- package/src/components/ui/switch/switch.tsx +235 -28
- package/src/components/ui/textarea/textarea.tsx +1 -8
- package/src/components/ui/toast/toast.tsx +5 -1
- package/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
- package/src/components/ui/tooltip/index.ts +1 -0
- package/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
- package/src/components/ui/trace/trace.tsx +61 -28
- package/src/components/ui/typography/typography.tsx +6 -5
- package/src/lib/clipboard.ts +4 -0
- package/src/lib/fast-icon.ts +88 -0
- package/src/lib/form-field.ts +7 -7
- package/src/lib/observe-resize.ts +28 -0
- package/src/lint/index.ts +199 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { JSX } from 'solid-js'
|
|
2
|
+
import { createRoot, mergeProps, splitProps } from 'solid-js'
|
|
3
|
+
import { isServer, spread } from 'solid-js/web'
|
|
4
|
+
|
|
5
|
+
type IconComponent = (props: JSX.SvgSVGAttributes<SVGSVGElement>) => JSX.Element
|
|
6
|
+
// lucide's own drawing props: an icon given one keeps lucide's component.
|
|
7
|
+
const DRAWING = [
|
|
8
|
+
'size',
|
|
9
|
+
'color',
|
|
10
|
+
'strokeWidth',
|
|
11
|
+
'absoluteStrokeWidth',
|
|
12
|
+
'nonScalingStroke',
|
|
13
|
+
'width',
|
|
14
|
+
'height',
|
|
15
|
+
]
|
|
16
|
+
type Captured = { attributes: [string, string][]; className: string; body: DocumentFragment }
|
|
17
|
+
|
|
18
|
+
const captured = new WeakMap<IconComponent, Captured>()
|
|
19
|
+
const A11Y = /^(aria-|role$|title$)/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The same lucide icon, built by cloning a template instead of by components.
|
|
23
|
+
*
|
|
24
|
+
* lucide-solid builds every icon as a `<For>` of `<Dynamic>` children, one
|
|
25
|
+
* component and one spread effect per path. A plain six-path icon cost as much
|
|
26
|
+
* to mount as a Button, and a transcript row spent a quarter of its mount time
|
|
27
|
+
* in its avatar's icon. The paths never change, so they are drawn once per icon
|
|
28
|
+
* and cloned after that; only the outer `<svg>` takes props.
|
|
29
|
+
*
|
|
30
|
+
* The first instance renders the lucide component itself and records what it
|
|
31
|
+
* drew, so the markup (attributes, class names, path keys) stays exactly
|
|
32
|
+
* lucide's. Props that change the drawing (`size`, `color`, `strokeWidth`,
|
|
33
|
+
* `absoluteStrokeWidth`) or a `LucideProvider` are not supported: those callers
|
|
34
|
+
* keep the lucide component. On the server the lucide component renders as is.
|
|
35
|
+
*/
|
|
36
|
+
export function fastIcon<T extends (props: never) => JSX.Element>(LucideIcon: T): T {
|
|
37
|
+
const Icon = LucideIcon as unknown as IconComponent
|
|
38
|
+
const Fast = (props: JSX.SvgSVGAttributes<SVGSVGElement>) => {
|
|
39
|
+
// Children (a <title>), drawing props and the server keep lucide's component.
|
|
40
|
+
if (isServer || props.children !== undefined || DRAWING.some((key) => key in props))
|
|
41
|
+
return Icon(props)
|
|
42
|
+
const template = capture(Icon)
|
|
43
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
44
|
+
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg')
|
|
45
|
+
let labelled = false
|
|
46
|
+
for (const key in rest) if (A11Y.test(key)) labelled = true
|
|
47
|
+
for (const [name, value] of template.attributes) svg.setAttribute(name, value)
|
|
48
|
+
svg.append(template.body.cloneNode(true))
|
|
49
|
+
// In lucide's order: its attributes, the class, aria-hidden, then the caller's.
|
|
50
|
+
spread(
|
|
51
|
+
svg,
|
|
52
|
+
mergeProps(
|
|
53
|
+
{
|
|
54
|
+
get class() {
|
|
55
|
+
return local.class ? `${template.className} ${local.class}` : template.className
|
|
56
|
+
},
|
|
57
|
+
...(labelled ? {} : { 'aria-hidden': 'true' }),
|
|
58
|
+
},
|
|
59
|
+
rest
|
|
60
|
+
) as never,
|
|
61
|
+
true,
|
|
62
|
+
true
|
|
63
|
+
)
|
|
64
|
+
return svg as unknown as JSX.Element
|
|
65
|
+
}
|
|
66
|
+
return Fast as unknown as T
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function capture(Icon: IconComponent): Captured {
|
|
70
|
+
const known = captured.get(Icon)
|
|
71
|
+
if (known) return known
|
|
72
|
+
const svg = createRoot((dispose) => {
|
|
73
|
+
const element = Icon({}) as unknown as SVGSVGElement
|
|
74
|
+
dispose()
|
|
75
|
+
return element
|
|
76
|
+
})
|
|
77
|
+
const attributes: [string, string][] = []
|
|
78
|
+
let className = ''
|
|
79
|
+
for (const attribute of Array.from(svg.attributes)) {
|
|
80
|
+
if (attribute.name === 'class') className = attribute.value
|
|
81
|
+
else if (attribute.name !== 'aria-hidden') attributes.push([attribute.name, attribute.value])
|
|
82
|
+
}
|
|
83
|
+
const body = document.createDocumentFragment()
|
|
84
|
+
for (const child of Array.from(svg.childNodes)) body.append(child.cloneNode(true))
|
|
85
|
+
const result = { attributes, className, body }
|
|
86
|
+
captured.set(Icon, result)
|
|
87
|
+
return result
|
|
88
|
+
}
|
package/src/lib/form-field.ts
CHANGED
|
@@ -71,15 +71,15 @@ export function useFormFieldControl(
|
|
|
71
71
|
|
|
72
72
|
const groupedDescendant = field.group() && kind !== 'group'
|
|
73
73
|
const id = groupedDescendant ? props.id : field.registerControlId(props.id)
|
|
74
|
-
const labelledBy =
|
|
75
|
-
props['aria-label'] || props['aria-labelledby']
|
|
76
|
-
? props['aria-labelledby']
|
|
77
|
-
: groupedDescendant
|
|
78
|
-
? undefined
|
|
79
|
-
: field.labelId
|
|
80
74
|
return {
|
|
81
75
|
id,
|
|
82
|
-
'aria-labelledby'
|
|
76
|
+
get 'aria-labelledby'() {
|
|
77
|
+
return props['aria-label'] || props['aria-labelledby']
|
|
78
|
+
? props['aria-labelledby']
|
|
79
|
+
: groupedDescendant
|
|
80
|
+
? undefined
|
|
81
|
+
: field.labelId
|
|
82
|
+
},
|
|
83
83
|
get 'aria-describedby'() {
|
|
84
84
|
return mergeIds(props['aria-describedby'], field.describedBy())
|
|
85
85
|
},
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Watch an element's size through one ResizeObserver shared by every caller.
|
|
3
|
+
*
|
|
4
|
+
* A component that creates its own observer per instance pays for one observer
|
|
5
|
+
* object, one browser registration and one delivery callback per mount; a reply
|
|
6
|
+
* with a dozen code blocks made a dozen. The shared observer delivers every
|
|
7
|
+
* changed element in one batch per frame and calls each element's callback.
|
|
8
|
+
*
|
|
9
|
+
* Returns a function that stops watching. Outside a browser it does nothing.
|
|
10
|
+
*/
|
|
11
|
+
type ResizeCallback = (entry: ResizeObserverEntry) => void
|
|
12
|
+
|
|
13
|
+
let shared: ResizeObserver | undefined
|
|
14
|
+
const callbacks = new WeakMap<Element, ResizeCallback>()
|
|
15
|
+
|
|
16
|
+
export function observeResize(element: Element, callback: ResizeCallback): () => void {
|
|
17
|
+
if (typeof ResizeObserver === 'undefined') return () => {}
|
|
18
|
+
shared ??= new ResizeObserver((entries) => {
|
|
19
|
+
for (const entry of entries) callbacks.get(entry.target)?.(entry)
|
|
20
|
+
})
|
|
21
|
+
callbacks.set(element, callback)
|
|
22
|
+
shared.observe(element)
|
|
23
|
+
return () => {
|
|
24
|
+
if (callbacks.get(element) !== callback) return
|
|
25
|
+
callbacks.delete(element)
|
|
26
|
+
shared?.unobserve(element)
|
|
27
|
+
}
|
|
28
|
+
}
|
package/src/lint/index.ts
CHANGED
|
@@ -1098,6 +1098,204 @@ const noPrimitiveLibraryImports: RuleModule = {
|
|
|
1098
1098
|
},
|
|
1099
1099
|
}
|
|
1100
1100
|
|
|
1101
|
+
/** Child nodes of an ESTree node, without the back-pointer. */
|
|
1102
|
+
const childNodes = (node: any): any[] => {
|
|
1103
|
+
const out: any[] = []
|
|
1104
|
+
for (const key of Object.keys(node)) {
|
|
1105
|
+
if (key === 'parent' || key === 'loc' || key === 'range') continue
|
|
1106
|
+
const value = node[key]
|
|
1107
|
+
if (Array.isArray(value)) {
|
|
1108
|
+
for (const item of value) if (item && typeof item.type === 'string') out.push(item)
|
|
1109
|
+
} else if (value && typeof value.type === 'string') out.push(value)
|
|
1110
|
+
}
|
|
1111
|
+
return out
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
const FUNCTION_TYPES = new Set([
|
|
1115
|
+
'FunctionDeclaration',
|
|
1116
|
+
'FunctionExpression',
|
|
1117
|
+
'ArrowFunctionExpression',
|
|
1118
|
+
])
|
|
1119
|
+
const PROP_HELPERS = new Set(['splitProps', 'mergeProps'])
|
|
1120
|
+
|
|
1121
|
+
/** `local.icon`: a plain, non-computed property read on an identifier. */
|
|
1122
|
+
const isPropRead = (node: any) =>
|
|
1123
|
+
node.type === 'MemberExpression' &&
|
|
1124
|
+
!node.computed &&
|
|
1125
|
+
node.object?.type === 'Identifier' &&
|
|
1126
|
+
node.property?.type === 'Identifier'
|
|
1127
|
+
|
|
1128
|
+
const readKey = (node: any) => `${node.object.name}.${node.property.name}`
|
|
1129
|
+
|
|
1130
|
+
const isPropsHelperCall = (init: any): boolean =>
|
|
1131
|
+
init?.type === 'CallExpression' &&
|
|
1132
|
+
init.callee?.type === 'Identifier' &&
|
|
1133
|
+
PROP_HELPERS.has(init.callee.name)
|
|
1134
|
+
|
|
1135
|
+
/** By convention a component names its first parameter `props`. */
|
|
1136
|
+
const isComponent = (fn: any) =>
|
|
1137
|
+
fn.params?.[0]?.type === 'Identifier' && fn.params[0].name === 'props'
|
|
1138
|
+
|
|
1139
|
+
/** The prop reads a JSX child expression renders: `{a}`, `{x ? a : b}`, `{x && a}`. */
|
|
1140
|
+
const renderedReads = (expression: any): any[] => {
|
|
1141
|
+
if (!expression) return []
|
|
1142
|
+
if (expression.type === 'ConditionalExpression')
|
|
1143
|
+
return [...renderedReads(expression.consequent), ...renderedReads(expression.alternate)]
|
|
1144
|
+
if (expression.type === 'LogicalExpression')
|
|
1145
|
+
return [...renderedReads(expression.left), ...renderedReads(expression.right)]
|
|
1146
|
+
return isPropRead(expression) ? [expression] : []
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
/** The JSX attribute an expression is the whole value of, if any. */
|
|
1150
|
+
const attributeOf = (node: any, parent: any) =>
|
|
1151
|
+
parent?.type === 'JSXExpressionContainer' &&
|
|
1152
|
+
parent.expression === node &&
|
|
1153
|
+
parent.parent?.type === 'JSXAttribute'
|
|
1154
|
+
? parent.parent
|
|
1155
|
+
: undefined
|
|
1156
|
+
|
|
1157
|
+
/**
|
|
1158
|
+
* `<Tip icon={local.icon} />` compiles to a getter on Tip's props, so the read
|
|
1159
|
+
* happens where Tip reads it, not here. Show and Match read `when` as soon as
|
|
1160
|
+
* they mount, so that one counts.
|
|
1161
|
+
*/
|
|
1162
|
+
const isForwarded = (node: any, parent: any) => {
|
|
1163
|
+
const attribute = attributeOf(node, parent)
|
|
1164
|
+
if (!attribute) return false
|
|
1165
|
+
const tag = attribute.parent?.name
|
|
1166
|
+
const toComponent =
|
|
1167
|
+
tag?.type === 'JSXMemberExpression' ||
|
|
1168
|
+
(tag?.type === 'JSXIdentifier' && /^[A-Z]/.test(tag.name ?? ''))
|
|
1169
|
+
return toComponent && attribute.name?.name !== 'when'
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
/** A type annotation that is, or contains, `JSX.Element`. */
|
|
1173
|
+
const typesJsx = (node: any): boolean => {
|
|
1174
|
+
if (!node || typeof node.type !== 'string') return false
|
|
1175
|
+
if (node.type === 'TSTypeReference') {
|
|
1176
|
+
const name = node.typeName
|
|
1177
|
+
const text =
|
|
1178
|
+
name?.type === 'TSQualifiedName'
|
|
1179
|
+
? `${name.left?.name}.${name.right?.name}`
|
|
1180
|
+
: (name?.name as string | undefined)
|
|
1181
|
+
if (text === 'JSX.Element' || text === 'JSXElement') return true
|
|
1182
|
+
}
|
|
1183
|
+
return childNodes(node).some(typesJsx)
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
/** Property names this file types as JSX. `children` is always a slot. */
|
|
1187
|
+
const jsxTypedNames = (program: any): Set<string> => {
|
|
1188
|
+
const names = new Set<string>(['children'])
|
|
1189
|
+
const visit = (node: any) => {
|
|
1190
|
+
if (
|
|
1191
|
+
(node.type === 'TSPropertySignature' || node.type === 'PropertyDefinition') &&
|
|
1192
|
+
node.key?.type === 'Identifier' &&
|
|
1193
|
+
typesJsx(node.typeAnnotation)
|
|
1194
|
+
)
|
|
1195
|
+
names.add(node.key.name)
|
|
1196
|
+
for (const child of childNodes(node)) visit(child)
|
|
1197
|
+
}
|
|
1198
|
+
visit(program)
|
|
1199
|
+
return names
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
/**
|
|
1203
|
+
* Solid compiles a JSX prop to a getter, so every read of a prop that holds JSX
|
|
1204
|
+
* builds that JSX again: `<Show when={local.icon}>{local.icon}</Show>` creates
|
|
1205
|
+
* the icon twice and keeps the unused copy, with its effects and listeners,
|
|
1206
|
+
* alive for as long as the component. The fix is to resolve the slot once with
|
|
1207
|
+
* `children(() => local.icon)` and read the accessor, or to use Show's callback
|
|
1208
|
+
* form.
|
|
1209
|
+
*
|
|
1210
|
+
* A prop is reported when it is read more than once in its component and is a
|
|
1211
|
+
* slot: `children`, a prop typed `JSX.Element` in the same file, or a prop that
|
|
1212
|
+
* is both the `when` of a Show or Match and rendered. Props are the
|
|
1213
|
+
* component's first parameter and the results of splitProps and mergeProps.
|
|
1214
|
+
* Passing a prop on to another component's attribute is not a read here.
|
|
1215
|
+
*/
|
|
1216
|
+
const singleSlotRead: RuleModule = {
|
|
1217
|
+
meta: {
|
|
1218
|
+
type: 'problem',
|
|
1219
|
+
docs: {
|
|
1220
|
+
description:
|
|
1221
|
+
'Read a JSX slot prop once: every read of a Solid prop getter builds its JSX again.',
|
|
1222
|
+
},
|
|
1223
|
+
schema: [],
|
|
1224
|
+
messages: {
|
|
1225
|
+
doubleRead:
|
|
1226
|
+
'{{name}} is rendered here and read {{count}} times in this component. Each read builds the slot again; resolve it once with children(() => {{name}}) and read the accessor.',
|
|
1227
|
+
doubleReadGated:
|
|
1228
|
+
'{{name}} is a JSX slot read {{count}} times in this component. Each read builds it again; resolve it once with children(() => {{name}}) and read the accessor.',
|
|
1229
|
+
},
|
|
1230
|
+
},
|
|
1231
|
+
create(context) {
|
|
1232
|
+
let slots = new Set<string>()
|
|
1233
|
+
|
|
1234
|
+
const component = (fn: any) => {
|
|
1235
|
+
const holders = new Set<string>()
|
|
1236
|
+
if (fn.params?.[0]?.type === 'Identifier') holders.add(fn.params[0].name)
|
|
1237
|
+
const reads = new Map<string, any[]>()
|
|
1238
|
+
const rendered = new Map<string, any>()
|
|
1239
|
+
const gated = new Set<string>()
|
|
1240
|
+
|
|
1241
|
+
const visit = (node: any, parent: any) => {
|
|
1242
|
+
// A component declared inside another function (a parts factory) has
|
|
1243
|
+
// props of its own.
|
|
1244
|
+
if (FUNCTION_TYPES.has(node.type) && isComponent(node)) return component(node)
|
|
1245
|
+
if (node.type === 'VariableDeclarator' && isPropsHelperCall(node.init)) {
|
|
1246
|
+
if (node.id?.type === 'Identifier') holders.add(node.id.name)
|
|
1247
|
+
if (node.id?.type === 'ArrayPattern')
|
|
1248
|
+
for (const element of node.id.elements ?? [])
|
|
1249
|
+
if (element?.type === 'Identifier') holders.add(element.name)
|
|
1250
|
+
}
|
|
1251
|
+
if (isPropRead(node)) {
|
|
1252
|
+
const key = readKey(node)
|
|
1253
|
+
if (attributeOf(node, parent)?.name?.name === 'when') gated.add(key)
|
|
1254
|
+
const called = parent?.type === 'CallExpression' && parent.callee === node
|
|
1255
|
+
const written = parent?.type === 'AssignmentExpression' && parent.left === node
|
|
1256
|
+
if (!called && !written && !isForwarded(node, parent))
|
|
1257
|
+
reads.set(key, [...(reads.get(key) ?? []), node])
|
|
1258
|
+
}
|
|
1259
|
+
if (
|
|
1260
|
+
node.type === 'JSXExpressionContainer' &&
|
|
1261
|
+
(parent?.type === 'JSXElement' || parent?.type === 'JSXFragment')
|
|
1262
|
+
)
|
|
1263
|
+
for (const read of renderedReads(node.expression))
|
|
1264
|
+
if (!rendered.has(readKey(read))) rendered.set(readKey(read), read)
|
|
1265
|
+
for (const child of childNodes(node)) visit(child, node)
|
|
1266
|
+
}
|
|
1267
|
+
for (const child of childNodes(fn)) visit(child, fn)
|
|
1268
|
+
|
|
1269
|
+
const candidates = new Map<string, any>()
|
|
1270
|
+
for (const [key, list] of reads) if (gated.has(key)) candidates.set(key, list[0])
|
|
1271
|
+
for (const [key, node] of rendered) candidates.set(key, node)
|
|
1272
|
+
for (const [name, node] of candidates) {
|
|
1273
|
+
if (!holders.has(node.object.name)) continue
|
|
1274
|
+
const slot = slots.has(node.property.name) || (gated.has(name) && rendered.has(name))
|
|
1275
|
+
const count = reads.get(name)?.length ?? 0
|
|
1276
|
+
if (slot && count > 1)
|
|
1277
|
+
context.report({
|
|
1278
|
+
node,
|
|
1279
|
+
messageId: rendered.has(name) ? 'doubleRead' : 'doubleReadGated',
|
|
1280
|
+
data: { name, count },
|
|
1281
|
+
})
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
// Components are module-level functions; nested callbacks belong to theirs.
|
|
1286
|
+
const visitTop = (node: any) => {
|
|
1287
|
+
if (FUNCTION_TYPES.has(node.type)) return component(node)
|
|
1288
|
+
for (const child of childNodes(node)) visitTop(child)
|
|
1289
|
+
}
|
|
1290
|
+
return {
|
|
1291
|
+
Program(node: any) {
|
|
1292
|
+
slots = jsxTypedNames(node)
|
|
1293
|
+
visitTop(node)
|
|
1294
|
+
},
|
|
1295
|
+
}
|
|
1296
|
+
},
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1101
1299
|
const plugin = {
|
|
1102
1300
|
meta: { name: 'adea' },
|
|
1103
1301
|
rules: {
|
|
@@ -1107,6 +1305,7 @@ const plugin = {
|
|
|
1107
1305
|
'no-primitive-library-imports': noPrimitiveLibraryImports,
|
|
1108
1306
|
'no-interactive-wrappers': noInteractiveWrappers,
|
|
1109
1307
|
'require-action-button-tooltip': requireActionButtonTooltip,
|
|
1308
|
+
'single-slot-read': singleSlotRead,
|
|
1110
1309
|
},
|
|
1111
1310
|
}
|
|
1112
1311
|
|