@agimon-ai/doompi-web-components 0.0.1-alpha.5 → 0.0.1-alpha.50
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 +1 -1
- package/dist/doompi-core/dist/src/extensions/webPlugin.d.mts +2 -0
- package/dist/doompi-core/dist/src/web/models/globalStore.d.mts +1 -0
- package/dist/doompi-core/dist/src/web/models/sessionStore.d.mts +1 -0
- package/dist/doompi-core/dist/src/web/models/workspaceStore.d.mts +1 -0
- package/dist/doompi-core/dist/src/web/schemas/template.d.mts +1 -0
- package/dist/doompi-core/dist/src/web/types/extensionFile.d.mts +2 -0
- package/dist/doompi-core/dist/src/web/types/mcpWidget.d.mts +16 -0
- package/dist/doompi-core/dist/src/web/types/mcpWidget.d.mts.map +1 -0
- package/dist/doompi-core/dist/src/web/types/template.d.mts +1 -0
- package/dist/doompi-core/dist/src/web/types/webPlugin.d.mts +2 -0
- package/dist/doompi-core/dist/web.d.mts +10 -0
- package/dist/doompi-web-components/src/components/Accordion.d.mts +11 -0
- package/dist/doompi-web-components/src/components/Accordion.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Accordion.mjs +2 -0
- package/dist/doompi-web-components/src/components/Accordion.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/AnsiText.d.mts +16 -0
- package/dist/doompi-web-components/src/components/AnsiText.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/AnsiText.mjs +4 -0
- package/dist/doompi-web-components/src/components/AnsiText.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Avatar.d.mts +10 -0
- package/dist/doompi-web-components/src/components/Avatar.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Avatar.mjs +2 -0
- package/dist/doompi-web-components/src/components/Avatar.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/Badge.d.mts +5 -6
- package/dist/doompi-web-components/src/components/Badge.d.mts.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/Badge.mjs +1 -1
- package/dist/doompi-web-components/src/components/Badge.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/Breadcrumb.d.mts +5 -6
- package/dist/doompi-web-components/src/components/Breadcrumb.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Breadcrumb.mjs +2 -0
- package/dist/doompi-web-components/src/components/Breadcrumb.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/Button.d.mts +6 -7
- package/dist/doompi-web-components/src/components/Button.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Button.mjs +2 -0
- package/dist/doompi-web-components/src/components/Button.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Checkbox.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Checkbox.mjs +2 -0
- package/dist/doompi-web-components/src/components/Checkbox.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/CodeBlock.mjs +2 -0
- package/dist/doompi-web-components/src/components/CodeBlock.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/CodeEditor.d.mts +5 -0
- package/dist/doompi-web-components/src/components/CodeEditor.d.mts.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/CodeEditor.mjs +1 -1
- package/dist/doompi-web-components/src/components/CodeEditor.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/CodeEditorView.mjs +2 -0
- package/dist/doompi-web-components/src/components/CodeEditorView.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Collapsible.d.mts +10 -0
- package/dist/doompi-web-components/src/components/Collapsible.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Collapsible.mjs +2 -0
- package/dist/doompi-web-components/src/components/Collapsible.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Command.d.mts +41 -0
- package/dist/doompi-web-components/src/components/Command.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Command.mjs +2 -0
- package/dist/doompi-web-components/src/components/Command.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/CopyButton.mjs +2 -0
- package/dist/doompi-web-components/src/components/CopyButton.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Dialog.d.mts +39 -0
- package/dist/doompi-web-components/src/components/Dialog.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Dialog.mjs +2 -0
- package/dist/doompi-web-components/src/components/Dialog.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/Dot.d.mts +5 -6
- package/dist/doompi-web-components/src/components/Dot.d.mts.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/Dot.mjs +1 -1
- package/dist/doompi-web-components/src/components/Dot.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Drawer.d.mts +17 -0
- package/dist/doompi-web-components/src/components/Drawer.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Drawer.mjs +2 -0
- package/dist/doompi-web-components/src/components/Drawer.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/DropdownMenu.d.mts +34 -0
- package/dist/doompi-web-components/src/components/DropdownMenu.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/DropdownMenu.mjs +2 -0
- package/dist/doompi-web-components/src/components/DropdownMenu.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/EmptyState.d.mts +2 -3
- package/dist/doompi-web-components/src/components/EmptyState.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/EmptyState.mjs +2 -0
- package/dist/doompi-web-components/src/components/EmptyState.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/HashlineLines.d.mts +23 -0
- package/dist/doompi-web-components/src/components/HashlineLines.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/HashlineLines.mjs +2 -0
- package/dist/doompi-web-components/src/components/HashlineLines.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/Input.d.mts +6 -7
- package/dist/doompi-web-components/src/components/Input.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Input.mjs +2 -0
- package/dist/doompi-web-components/src/components/Input.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/Kbd.d.mts +1 -2
- package/dist/doompi-web-components/src/components/Kbd.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Kbd.mjs +2 -0
- package/dist/doompi-web-components/src/components/Kbd.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Label.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Label.mjs +2 -0
- package/dist/doompi-web-components/src/components/Label.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/Markdown.d.mts +2 -3
- package/dist/doompi-web-components/src/components/Markdown.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Markdown.mjs +3 -0
- package/dist/doompi-web-components/src/components/Markdown.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/McpApp.d.mts +18 -0
- package/dist/doompi-web-components/src/components/McpApp.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/McpApp.mjs +2 -0
- package/dist/doompi-web-components/src/components/McpApp.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/McpToolWidget.d.mts +14 -0
- package/dist/doompi-web-components/src/components/McpToolWidget.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/McpToolWidget.mjs +3 -0
- package/dist/doompi-web-components/src/components/McpToolWidget.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/MediaPreview.d.mts +61 -0
- package/dist/doompi-web-components/src/components/MediaPreview.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/MediaPreview.mjs +2 -0
- package/dist/doompi-web-components/src/components/MediaPreview.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/MermaidDiagram.mjs +2 -0
- package/dist/doompi-web-components/src/components/MermaidDiagram.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/MessageItem.d.mts +102 -0
- package/dist/doompi-web-components/src/components/MessageItem.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/MessageItem.mjs +2 -0
- package/dist/doompi-web-components/src/components/MessageItem.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/MessageLines.d.mts +5 -6
- package/dist/doompi-web-components/src/components/MessageLines.d.mts.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/MessageLines.mjs +1 -1
- package/dist/doompi-web-components/src/components/MessageLines.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/OptionList.d.mts +9 -10
- package/dist/doompi-web-components/src/components/OptionList.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/OptionList.mjs +2 -0
- package/dist/doompi-web-components/src/components/OptionList.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Panel.d.mts +14 -0
- package/dist/doompi-web-components/src/components/Panel.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Panel.mjs +2 -0
- package/dist/doompi-web-components/src/components/Panel.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/PdfPreview.d.mts +52 -0
- package/dist/doompi-web-components/src/components/PdfPreview.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/PdfPreview.mjs +2 -0
- package/dist/doompi-web-components/src/components/PdfPreview.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Popover.d.mts +19 -0
- package/dist/doompi-web-components/src/components/Popover.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Popover.mjs +2 -0
- package/dist/doompi-web-components/src/components/Popover.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Progress.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Progress.mjs +2 -0
- package/dist/doompi-web-components/src/components/Progress.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/RadioGroup.d.mts +3 -3
- package/dist/doompi-web-components/src/components/RadioGroup.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/RadioGroup.mjs +2 -0
- package/dist/doompi-web-components/src/components/RadioGroup.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/ScrollArea.d.mts +2 -2
- package/dist/doompi-web-components/src/components/ScrollArea.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/ScrollArea.mjs +2 -0
- package/dist/doompi-web-components/src/components/ScrollArea.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/SectionLabel.d.mts +1 -2
- package/dist/doompi-web-components/src/components/SectionLabel.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/SectionLabel.mjs +2 -0
- package/dist/doompi-web-components/src/components/SectionLabel.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Select.d.mts +19 -0
- package/dist/doompi-web-components/src/components/Select.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Select.mjs +2 -0
- package/dist/doompi-web-components/src/components/Select.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Separator.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Separator.mjs +2 -0
- package/dist/doompi-web-components/src/components/Separator.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Sheet.d.mts +35 -0
- package/dist/doompi-web-components/src/components/Sheet.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Sheet.mjs +2 -0
- package/dist/doompi-web-components/src/components/Sheet.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/Skeleton.d.mts +1 -2
- package/dist/doompi-web-components/src/components/Skeleton.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Skeleton.mjs +2 -0
- package/dist/doompi-web-components/src/components/Skeleton.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/Spinner.d.mts +2 -3
- package/dist/doompi-web-components/src/components/Spinner.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Spinner.mjs +2 -0
- package/dist/doompi-web-components/src/components/Spinner.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/StatusBadge.d.mts +6 -7
- package/dist/doompi-web-components/src/components/StatusBadge.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/StatusBadge.mjs +2 -0
- package/dist/doompi-web-components/src/components/StatusBadge.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/StreamCursor.d.mts +6 -0
- package/dist/doompi-web-components/src/components/StreamCursor.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/StreamCursor.mjs +2 -0
- package/dist/doompi-web-components/src/components/StreamCursor.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Switch.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Switch.mjs +2 -0
- package/dist/doompi-web-components/src/components/Switch.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/SyntaxText.d.mts +50 -0
- package/dist/doompi-web-components/src/components/SyntaxText.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/SyntaxText.mjs +4 -0
- package/dist/doompi-web-components/src/components/SyntaxText.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/Tabs.d.mts +10 -10
- package/dist/doompi-web-components/src/components/Tabs.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Tabs.mjs +2 -0
- package/dist/doompi-web-components/src/components/Tabs.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/TerminalView.d.mts +31 -0
- package/dist/doompi-web-components/src/components/TerminalView.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/TerminalView.mjs +2 -0
- package/dist/doompi-web-components/src/components/TerminalView.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/components/Textarea.d.mts +3 -4
- package/dist/doompi-web-components/src/components/Textarea.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Textarea.mjs +2 -0
- package/dist/doompi-web-components/src/components/Textarea.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Toast.d.mts +24 -0
- package/dist/doompi-web-components/src/components/Toast.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Toast.mjs +2 -0
- package/dist/doompi-web-components/src/components/Toast.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/ToolPathLink.d.mts +22 -0
- package/dist/doompi-web-components/src/components/ToolPathLink.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/ToolPathLink.mjs +2 -0
- package/dist/doompi-web-components/src/components/ToolPathLink.mjs.map +1 -0
- package/dist/doompi-web-components/src/components/Tooltip.d.mts +11 -0
- package/dist/doompi-web-components/src/components/Tooltip.d.mts.map +1 -0
- package/dist/doompi-web-components/src/components/Tooltip.mjs +2 -0
- package/dist/doompi-web-components/src/components/Tooltip.mjs.map +1 -0
- package/dist/doompi-web-components/src/icons/icons.d.mts +2 -0
- package/dist/doompi-web-components/src/icons/icons.mjs +1 -0
- package/dist/doompi-web-components/src/lib/ansiSpans.d.mts +42 -0
- package/dist/doompi-web-components/src/lib/ansiSpans.d.mts.map +1 -0
- package/dist/doompi-web-components/src/lib/ansiSpans.mjs +2 -0
- package/dist/doompi-web-components/src/lib/ansiSpans.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/lib/cn.d.mts +1 -2
- package/dist/doompi-web-components/src/lib/cn.d.mts.map +1 -0
- package/dist/doompi-web-components/src/lib/cn.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/lib/collapse.d.mts +2 -3
- package/dist/doompi-web-components/src/lib/collapse.d.mts.map +1 -0
- package/dist/doompi-web-components/src/lib/collapse.mjs.map +1 -0
- package/dist/doompi-web-components/src/lib/editorController.mjs +2 -0
- package/dist/doompi-web-components/src/lib/editorController.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/lib/editorLanguage.d.mts +2 -3
- package/dist/doompi-web-components/src/lib/editorLanguage.d.mts.map +1 -0
- package/dist/doompi-web-components/src/lib/editorLanguage.mjs.map +1 -0
- package/dist/doompi-web-components/src/lib/editorTheme.d.mts +76 -0
- package/dist/doompi-web-components/src/lib/editorTheme.d.mts.map +1 -0
- package/dist/doompi-web-components/src/lib/editorTheme.mjs +2 -0
- package/dist/doompi-web-components/src/lib/editorTheme.mjs.map +1 -0
- package/dist/doompi-web-components/src/lib/fenceGrammar.mjs +2 -0
- package/dist/doompi-web-components/src/lib/fenceGrammar.mjs.map +1 -0
- package/dist/doompi-web-components/src/lib/hashlineHighlight.d.mts +30 -0
- package/dist/doompi-web-components/src/lib/hashlineHighlight.d.mts.map +1 -0
- package/dist/doompi-web-components/src/lib/hashlineHighlight.mjs +3 -0
- package/dist/doompi-web-components/src/lib/hashlineHighlight.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/lib/hashlineView.d.mts +15 -16
- package/dist/doompi-web-components/src/lib/hashlineView.d.mts.map +1 -0
- package/dist/doompi-web-components/src/lib/hashlineView.mjs +6 -0
- package/dist/{src → doompi-web-components/src}/lib/hashlineView.mjs.map +1 -1
- package/dist/{src → doompi-web-components/src}/lib/media.d.mts +1 -2
- package/dist/doompi-web-components/src/lib/media.d.mts.map +1 -0
- package/dist/{src → doompi-web-components/src}/lib/media.mjs.map +1 -1
- package/dist/doompi-web-components/src/lib/mediaPlayback.mjs +2 -0
- package/dist/doompi-web-components/src/lib/mediaPlayback.mjs.map +1 -0
- package/dist/doompi-web-components/src/lib/mermaidDiagram.mjs +2 -0
- package/dist/doompi-web-components/src/lib/mermaidDiagram.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/lib/optionList.d.mts +4 -5
- package/dist/doompi-web-components/src/lib/optionList.d.mts.map +1 -0
- package/dist/doompi-web-components/src/lib/optionList.mjs.map +1 -0
- package/dist/doompi-web-components/src/lib/syntaxHighlight.d.mts +54 -0
- package/dist/doompi-web-components/src/lib/syntaxHighlight.d.mts.map +1 -0
- package/dist/doompi-web-components/src/lib/syntaxHighlight.mjs +3 -0
- package/dist/doompi-web-components/src/lib/syntaxHighlight.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/lib/tone.d.mts +4 -5
- package/dist/doompi-web-components/src/lib/tone.d.mts.map +1 -0
- package/dist/{src → doompi-web-components/src}/lib/tone.mjs.map +1 -1
- package/dist/{src → doompi-web-components/src}/theme/apply.d.mts +5 -6
- package/dist/doompi-web-components/src/theme/apply.d.mts.map +1 -0
- package/dist/doompi-web-components/src/theme/apply.mjs.map +1 -0
- package/dist/doompi-web-components/src/theme/builtinThemes.d.mts +11 -0
- package/dist/doompi-web-components/src/theme/builtinThemes.d.mts.map +1 -0
- package/dist/doompi-web-components/src/theme/builtinThemes.mjs.map +1 -0
- package/dist/doompi-web-components/src/theme/derive.d.mts +14 -0
- package/dist/doompi-web-components/src/theme/derive.d.mts.map +1 -0
- package/dist/doompi-web-components/src/theme/derive.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/theme/parse.d.mts +1 -2
- package/dist/doompi-web-components/src/theme/parse.d.mts.map +1 -0
- package/dist/{src → doompi-web-components/src}/theme/parse.mjs.map +1 -1
- package/dist/{src → doompi-web-components/src}/theme/piTheme.d.mts +2 -3
- package/dist/doompi-web-components/src/theme/piTheme.d.mts.map +1 -0
- package/dist/doompi-web-components/src/theme/piTheme.mjs.map +1 -0
- package/dist/{src → doompi-web-components/src}/theme/preference.d.mts +4 -5
- package/dist/doompi-web-components/src/theme/preference.d.mts.map +1 -0
- package/dist/doompi-web-components/src/theme/preference.mjs.map +1 -0
- package/dist/doompi-web-components/src/types/editor.d.mts +78 -0
- package/dist/doompi-web-components/src/types/editor.d.mts.map +1 -0
- package/dist/doompi-web-components/src/types/editor.mjs.map +1 -0
- package/dist/doompi-web-components/src/types/theme.d.mts +38 -0
- package/dist/doompi-web-components/src/types/theme.d.mts.map +1 -0
- package/dist/doompi-web-components/src/types/theme.mjs.map +1 -0
- package/dist/doompi-web-components/src/types/tone.d.mts +28 -0
- package/dist/doompi-web-components/src/types/tone.d.mts.map +1 -0
- package/dist/doompi-web-components/src/types/tone.mjs.map +1 -0
- package/dist/{themes → doompi-web-components/themes}/doom-nord-dark.mjs +1 -1
- package/dist/doompi-web-components/themes/doom-nord-dark.mjs.map +1 -0
- package/dist/{themes → doompi-web-components/themes}/doom-one-dark.mjs +1 -1
- package/dist/doompi-web-components/themes/doom-one-dark.mjs.map +1 -0
- package/dist/{themes → doompi-web-components/themes}/doom-one-light.mjs +1 -1
- package/dist/doompi-web-components/themes/doom-one-light.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts +61 -51
- package/dist/index.mjs +1 -1
- package/dist/mcpWidget.cjs +1 -0
- package/dist/mcpWidget.d.mts +3 -0
- package/dist/mcpWidget.mjs +1 -0
- package/dist/src/components/Accordion.cjs +1 -1
- package/dist/src/components/Accordion.cjs.map +1 -1
- package/dist/src/components/AnsiText.cjs +4 -0
- package/dist/src/components/AnsiText.cjs.map +1 -0
- package/dist/src/components/Avatar.cjs +1 -1
- package/dist/src/components/Avatar.cjs.map +1 -1
- package/dist/src/components/Badge.cjs +1 -1
- package/dist/src/components/Badge.cjs.map +1 -1
- package/dist/src/components/Breadcrumb.cjs +1 -1
- package/dist/src/components/Breadcrumb.cjs.map +1 -1
- package/dist/src/components/Button.cjs +1 -1
- package/dist/src/components/Button.cjs.map +1 -1
- package/dist/src/components/Checkbox.cjs +1 -1
- package/dist/src/components/Checkbox.cjs.map +1 -1
- package/dist/src/components/CodeBlock.cjs +2 -0
- package/dist/src/components/CodeBlock.cjs.map +1 -0
- package/dist/src/components/CodeEditor.cjs +1 -1
- package/dist/src/components/CodeEditor.cjs.map +1 -1
- package/dist/src/components/CodeEditorView.cjs +1 -1
- package/dist/src/components/CodeEditorView.cjs.map +1 -1
- package/dist/src/components/Collapsible.cjs +1 -1
- package/dist/src/components/Collapsible.cjs.map +1 -1
- package/dist/src/components/Command.cjs +1 -1
- package/dist/src/components/Command.cjs.map +1 -1
- package/dist/src/components/CopyButton.cjs +2 -0
- package/dist/src/components/CopyButton.cjs.map +1 -0
- package/dist/src/components/Dialog.cjs +1 -1
- package/dist/src/components/Dialog.cjs.map +1 -1
- package/dist/src/components/Dot.cjs +1 -1
- package/dist/src/components/Dot.cjs.map +1 -1
- package/dist/src/components/Drawer.cjs +2 -0
- package/dist/src/components/Drawer.cjs.map +1 -0
- package/dist/src/components/DropdownMenu.cjs +1 -1
- package/dist/src/components/DropdownMenu.cjs.map +1 -1
- package/dist/src/components/EmptyState.cjs +1 -1
- package/dist/src/components/EmptyState.cjs.map +1 -1
- package/dist/src/components/HashlineLines.cjs +1 -1
- package/dist/src/components/HashlineLines.cjs.map +1 -1
- package/dist/src/components/Input.cjs +1 -1
- package/dist/src/components/Input.cjs.map +1 -1
- package/dist/src/components/Kbd.cjs +1 -1
- package/dist/src/components/Kbd.cjs.map +1 -1
- package/dist/src/components/Label.cjs +1 -1
- package/dist/src/components/Label.cjs.map +1 -1
- package/dist/src/components/Markdown.cjs +2 -2
- package/dist/src/components/Markdown.cjs.map +1 -1
- package/dist/src/components/McpApp.cjs +2 -0
- package/dist/src/components/McpApp.cjs.map +1 -0
- package/dist/src/components/McpToolWidget.cjs +3 -0
- package/dist/src/components/McpToolWidget.cjs.map +1 -0
- package/dist/src/components/MediaPreview.cjs +1 -1
- package/dist/src/components/MediaPreview.cjs.map +1 -1
- package/dist/src/components/MermaidDiagram.cjs +2 -0
- package/dist/src/components/MermaidDiagram.cjs.map +1 -0
- package/dist/src/components/MessageItem.cjs +1 -1
- package/dist/src/components/MessageItem.cjs.map +1 -1
- package/dist/src/components/MessageLines.cjs +1 -1
- package/dist/src/components/MessageLines.cjs.map +1 -1
- package/dist/src/components/OptionList.cjs +1 -1
- package/dist/src/components/OptionList.cjs.map +1 -1
- package/dist/src/components/Panel.cjs +1 -1
- package/dist/src/components/Panel.cjs.map +1 -1
- package/dist/src/components/PdfPreview.cjs +2 -0
- package/dist/src/components/PdfPreview.cjs.map +1 -0
- package/dist/src/components/Popover.cjs +1 -1
- package/dist/src/components/Popover.cjs.map +1 -1
- package/dist/src/components/Progress.cjs +1 -1
- package/dist/src/components/Progress.cjs.map +1 -1
- package/dist/src/components/RadioGroup.cjs +1 -1
- package/dist/src/components/RadioGroup.cjs.map +1 -1
- package/dist/src/components/ScrollArea.cjs +1 -1
- package/dist/src/components/ScrollArea.cjs.map +1 -1
- package/dist/src/components/SectionLabel.cjs +1 -1
- package/dist/src/components/SectionLabel.cjs.map +1 -1
- package/dist/src/components/Select.cjs +1 -1
- package/dist/src/components/Select.cjs.map +1 -1
- package/dist/src/components/Separator.cjs +1 -1
- package/dist/src/components/Separator.cjs.map +1 -1
- package/dist/src/components/Sheet.cjs +1 -1
- package/dist/src/components/Sheet.cjs.map +1 -1
- package/dist/src/components/Skeleton.cjs +1 -1
- package/dist/src/components/Skeleton.cjs.map +1 -1
- package/dist/src/components/Spinner.cjs +1 -1
- package/dist/src/components/Spinner.cjs.map +1 -1
- package/dist/src/components/StatusBadge.cjs +1 -1
- package/dist/src/components/StatusBadge.cjs.map +1 -1
- package/dist/src/components/StreamCursor.cjs +1 -1
- package/dist/src/components/StreamCursor.cjs.map +1 -1
- package/dist/src/components/Switch.cjs +1 -1
- package/dist/src/components/Switch.cjs.map +1 -1
- package/dist/src/components/SyntaxText.cjs +4 -0
- package/dist/src/components/SyntaxText.cjs.map +1 -0
- package/dist/src/components/Tabs.cjs +1 -1
- package/dist/src/components/Tabs.cjs.map +1 -1
- package/dist/src/components/TerminalView.cjs +2 -0
- package/dist/src/components/TerminalView.cjs.map +1 -0
- package/dist/src/components/Textarea.cjs +1 -1
- package/dist/src/components/Textarea.cjs.map +1 -1
- package/dist/src/components/Toast.cjs +1 -1
- package/dist/src/components/Toast.cjs.map +1 -1
- package/dist/src/components/ToolPathLink.cjs +2 -0
- package/dist/src/components/ToolPathLink.cjs.map +1 -0
- package/dist/src/components/Tooltip.cjs +1 -1
- package/dist/src/components/Tooltip.cjs.map +1 -1
- package/dist/src/icons/icons.cjs +1 -1
- package/dist/src/lib/ansiSpans.cjs +2 -0
- package/dist/src/lib/ansiSpans.cjs.map +1 -0
- package/dist/src/lib/editorController.cjs +2 -0
- package/dist/src/lib/editorController.cjs.map +1 -0
- package/dist/src/lib/editorTheme.cjs +1 -1
- package/dist/src/lib/editorTheme.cjs.map +1 -1
- package/dist/src/lib/fenceGrammar.cjs +2 -0
- package/dist/src/lib/fenceGrammar.cjs.map +1 -0
- package/dist/src/lib/hashlineHighlight.cjs +3 -0
- package/dist/src/lib/hashlineHighlight.cjs.map +1 -0
- package/dist/src/lib/hashlineView.cjs +1 -1
- package/dist/src/lib/hashlineView.cjs.map +1 -1
- package/dist/src/lib/media.cjs.map +1 -1
- package/dist/src/lib/mediaPlayback.cjs +2 -0
- package/dist/src/lib/mediaPlayback.cjs.map +1 -0
- package/dist/src/lib/mermaidDiagram.cjs +2 -0
- package/dist/src/lib/mermaidDiagram.cjs.map +1 -0
- package/dist/src/lib/syntaxHighlight.cjs +3 -0
- package/dist/src/lib/syntaxHighlight.cjs.map +1 -0
- package/dist/src/lib/tone.cjs.map +1 -1
- package/dist/src/theme/apply.cjs.map +1 -1
- package/dist/src/theme/builtinThemes.cjs.map +1 -1
- package/dist/src/theme/derive.cjs.map +1 -1
- package/dist/src/theme/parse.cjs.map +1 -1
- package/dist/src/theme/piTheme.cjs.map +1 -1
- package/dist/src/types/editor.cjs.map +1 -1
- package/dist/theme.d.mts +7 -7
- package/dist/theme.mjs +1 -1
- package/dist/themes/doom-nord-dark.cjs +1 -1
- package/dist/themes/doom-one-dark.cjs +1 -1
- package/dist/themes/doom-one-light.cjs +1 -1
- package/package.json +29 -18
- package/styles/mcp.css +22 -0
- package/styles/preview.css +17 -0
- package/styles/tokens.css +51 -1
- package/themes/doom-nord-dark.json +1 -1
- package/themes/doom-one-dark.json +1 -1
- package/themes/doom-one-light.json +2 -2
- package/dist/components/Accordion.d.cts +0 -11
- package/dist/components/Accordion.d.cts.map +0 -1
- package/dist/components/Avatar.d.cts +0 -10
- package/dist/components/Avatar.d.cts.map +0 -1
- package/dist/components/Badge.d.cts +0 -18
- package/dist/components/Badge.d.cts.map +0 -1
- package/dist/components/Breadcrumb.d.cts +0 -37
- package/dist/components/Breadcrumb.d.cts.map +0 -1
- package/dist/components/Button.d.cts +0 -25
- package/dist/components/Button.d.cts.map +0 -1
- package/dist/components/Checkbox.d.cts +0 -8
- package/dist/components/Checkbox.d.cts.map +0 -1
- package/dist/components/CodeEditor.d.cts +0 -6
- package/dist/components/CodeEditor.d.cts.map +0 -1
- package/dist/components/Collapsible.d.cts +0 -10
- package/dist/components/Collapsible.d.cts.map +0 -1
- package/dist/components/Command.d.cts +0 -42
- package/dist/components/Command.d.cts.map +0 -1
- package/dist/components/Dialog.d.cts +0 -39
- package/dist/components/Dialog.d.cts.map +0 -1
- package/dist/components/Dot.d.cts +0 -16
- package/dist/components/Dot.d.cts.map +0 -1
- package/dist/components/DropdownMenu.d.cts +0 -34
- package/dist/components/DropdownMenu.d.cts.map +0 -1
- package/dist/components/EmptyState.d.cts +0 -18
- package/dist/components/EmptyState.d.cts.map +0 -1
- package/dist/components/HashlineLines.d.cts +0 -17
- package/dist/components/HashlineLines.d.cts.map +0 -1
- package/dist/components/Input.d.cts +0 -20
- package/dist/components/Input.d.cts.map +0 -1
- package/dist/components/Kbd.d.cts +0 -7
- package/dist/components/Kbd.d.cts.map +0 -1
- package/dist/components/Label.d.cts +0 -8
- package/dist/components/Label.d.cts.map +0 -1
- package/dist/components/Markdown.d.cts +0 -18
- package/dist/components/Markdown.d.cts.map +0 -1
- package/dist/components/MediaPreview.d.cts +0 -25
- package/dist/components/MediaPreview.d.cts.map +0 -1
- package/dist/components/MessageItem.d.cts +0 -71
- package/dist/components/MessageItem.d.cts.map +0 -1
- package/dist/components/MessageLines.d.cts +0 -24
- package/dist/components/MessageLines.d.cts.map +0 -1
- package/dist/components/OptionList.d.cts +0 -50
- package/dist/components/OptionList.d.cts.map +0 -1
- package/dist/components/Panel.d.cts +0 -15
- package/dist/components/Panel.d.cts.map +0 -1
- package/dist/components/Popover.d.cts +0 -19
- package/dist/components/Popover.d.cts.map +0 -1
- package/dist/components/Progress.d.cts +0 -8
- package/dist/components/Progress.d.cts.map +0 -1
- package/dist/components/RadioGroup.d.cts +0 -15
- package/dist/components/RadioGroup.d.cts.map +0 -1
- package/dist/components/ScrollArea.d.cts +0 -13
- package/dist/components/ScrollArea.d.cts.map +0 -1
- package/dist/components/SectionLabel.d.cts +0 -7
- package/dist/components/SectionLabel.d.cts.map +0 -1
- package/dist/components/Select.d.cts +0 -19
- package/dist/components/Select.d.cts.map +0 -1
- package/dist/components/Separator.d.cts +0 -13
- package/dist/components/Separator.d.cts.map +0 -1
- package/dist/components/Sheet.d.cts +0 -36
- package/dist/components/Sheet.d.cts.map +0 -1
- package/dist/components/Skeleton.d.cts +0 -11
- package/dist/components/Skeleton.d.cts.map +0 -1
- package/dist/components/Spinner.d.cts +0 -15
- package/dist/components/Spinner.d.cts.map +0 -1
- package/dist/components/StatusBadge.d.cts +0 -24
- package/dist/components/StatusBadge.d.cts.map +0 -1
- package/dist/components/StreamCursor.d.cts +0 -7
- package/dist/components/StreamCursor.d.cts.map +0 -1
- package/dist/components/Switch.d.cts +0 -8
- package/dist/components/Switch.d.cts.map +0 -1
- package/dist/components/Tabs.d.cts +0 -36
- package/dist/components/Tabs.d.cts.map +0 -1
- package/dist/components/Textarea.d.cts +0 -10
- package/dist/components/Textarea.d.cts.map +0 -1
- package/dist/components/Toast.d.cts +0 -24
- package/dist/components/Toast.d.cts.map +0 -1
- package/dist/components/Tooltip.d.cts +0 -11
- package/dist/components/Tooltip.d.cts.map +0 -1
- package/dist/icons/icons.d.cts +0 -2
- package/dist/index.d.cts +0 -51
- package/dist/lib/cn.d.cts +0 -7
- package/dist/lib/cn.d.cts.map +0 -1
- package/dist/lib/collapse.d.cts +0 -15
- package/dist/lib/collapse.d.cts.map +0 -1
- package/dist/lib/editorLanguage.d.cts +0 -22
- package/dist/lib/editorLanguage.d.cts.map +0 -1
- package/dist/lib/hashlineView.d.cts +0 -61
- package/dist/lib/hashlineView.d.cts.map +0 -1
- package/dist/lib/media.d.cts +0 -12
- package/dist/lib/media.d.cts.map +0 -1
- package/dist/lib/optionList.d.cts +0 -22
- package/dist/lib/optionList.d.cts.map +0 -1
- package/dist/lib/tone.d.cts +0 -26
- package/dist/lib/tone.d.cts.map +0 -1
- package/dist/src/components/Accordion.d.mts +0 -11
- package/dist/src/components/Accordion.d.mts.map +0 -1
- package/dist/src/components/Accordion.mjs +0 -2
- package/dist/src/components/Accordion.mjs.map +0 -1
- package/dist/src/components/Avatar.d.mts +0 -10
- package/dist/src/components/Avatar.d.mts.map +0 -1
- package/dist/src/components/Avatar.mjs +0 -2
- package/dist/src/components/Avatar.mjs.map +0 -1
- package/dist/src/components/Badge.d.mts.map +0 -1
- package/dist/src/components/Badge.mjs.map +0 -1
- package/dist/src/components/Breadcrumb.d.mts.map +0 -1
- package/dist/src/components/Breadcrumb.mjs +0 -2
- package/dist/src/components/Breadcrumb.mjs.map +0 -1
- package/dist/src/components/Button.d.mts.map +0 -1
- package/dist/src/components/Button.mjs +0 -2
- package/dist/src/components/Button.mjs.map +0 -1
- package/dist/src/components/Checkbox.d.mts.map +0 -1
- package/dist/src/components/Checkbox.mjs +0 -2
- package/dist/src/components/Checkbox.mjs.map +0 -1
- package/dist/src/components/CodeEditor.d.mts +0 -6
- package/dist/src/components/CodeEditor.d.mts.map +0 -1
- package/dist/src/components/CodeEditor.mjs.map +0 -1
- package/dist/src/components/CodeEditorView.mjs +0 -2
- package/dist/src/components/CodeEditorView.mjs.map +0 -1
- package/dist/src/components/Collapsible.d.mts +0 -10
- package/dist/src/components/Collapsible.d.mts.map +0 -1
- package/dist/src/components/Collapsible.mjs +0 -2
- package/dist/src/components/Collapsible.mjs.map +0 -1
- package/dist/src/components/Command.d.mts +0 -42
- package/dist/src/components/Command.d.mts.map +0 -1
- package/dist/src/components/Command.mjs +0 -2
- package/dist/src/components/Command.mjs.map +0 -1
- package/dist/src/components/Dialog.d.mts +0 -39
- package/dist/src/components/Dialog.d.mts.map +0 -1
- package/dist/src/components/Dialog.mjs +0 -2
- package/dist/src/components/Dialog.mjs.map +0 -1
- package/dist/src/components/Dot.d.mts.map +0 -1
- package/dist/src/components/Dot.mjs.map +0 -1
- package/dist/src/components/DropdownMenu.d.mts +0 -34
- package/dist/src/components/DropdownMenu.d.mts.map +0 -1
- package/dist/src/components/DropdownMenu.mjs +0 -2
- package/dist/src/components/DropdownMenu.mjs.map +0 -1
- package/dist/src/components/EmptyState.d.mts.map +0 -1
- package/dist/src/components/EmptyState.mjs +0 -2
- package/dist/src/components/EmptyState.mjs.map +0 -1
- package/dist/src/components/HashlineLines.d.mts +0 -17
- package/dist/src/components/HashlineLines.d.mts.map +0 -1
- package/dist/src/components/HashlineLines.mjs +0 -2
- package/dist/src/components/HashlineLines.mjs.map +0 -1
- package/dist/src/components/Input.d.mts.map +0 -1
- package/dist/src/components/Input.mjs +0 -2
- package/dist/src/components/Input.mjs.map +0 -1
- package/dist/src/components/Kbd.d.mts.map +0 -1
- package/dist/src/components/Kbd.mjs +0 -2
- package/dist/src/components/Kbd.mjs.map +0 -1
- package/dist/src/components/Label.d.mts.map +0 -1
- package/dist/src/components/Label.mjs +0 -2
- package/dist/src/components/Label.mjs.map +0 -1
- package/dist/src/components/Markdown.d.mts.map +0 -1
- package/dist/src/components/Markdown.mjs +0 -3
- package/dist/src/components/Markdown.mjs.map +0 -1
- package/dist/src/components/MediaPreview.d.mts +0 -25
- package/dist/src/components/MediaPreview.d.mts.map +0 -1
- package/dist/src/components/MediaPreview.mjs +0 -2
- package/dist/src/components/MediaPreview.mjs.map +0 -1
- package/dist/src/components/MessageItem.d.mts +0 -71
- package/dist/src/components/MessageItem.d.mts.map +0 -1
- package/dist/src/components/MessageItem.mjs +0 -2
- package/dist/src/components/MessageItem.mjs.map +0 -1
- package/dist/src/components/MessageLines.d.mts.map +0 -1
- package/dist/src/components/MessageLines.mjs.map +0 -1
- package/dist/src/components/OptionList.d.mts.map +0 -1
- package/dist/src/components/OptionList.mjs +0 -2
- package/dist/src/components/OptionList.mjs.map +0 -1
- package/dist/src/components/Panel.d.mts +0 -15
- package/dist/src/components/Panel.d.mts.map +0 -1
- package/dist/src/components/Panel.mjs +0 -2
- package/dist/src/components/Panel.mjs.map +0 -1
- package/dist/src/components/Popover.d.mts +0 -19
- package/dist/src/components/Popover.d.mts.map +0 -1
- package/dist/src/components/Popover.mjs +0 -2
- package/dist/src/components/Popover.mjs.map +0 -1
- package/dist/src/components/Progress.d.mts.map +0 -1
- package/dist/src/components/Progress.mjs +0 -2
- package/dist/src/components/Progress.mjs.map +0 -1
- package/dist/src/components/RadioGroup.d.mts.map +0 -1
- package/dist/src/components/RadioGroup.mjs +0 -2
- package/dist/src/components/RadioGroup.mjs.map +0 -1
- package/dist/src/components/ScrollArea.d.mts.map +0 -1
- package/dist/src/components/ScrollArea.mjs +0 -2
- package/dist/src/components/ScrollArea.mjs.map +0 -1
- package/dist/src/components/SectionLabel.d.mts.map +0 -1
- package/dist/src/components/SectionLabel.mjs +0 -2
- package/dist/src/components/SectionLabel.mjs.map +0 -1
- package/dist/src/components/Select.d.mts +0 -19
- package/dist/src/components/Select.d.mts.map +0 -1
- package/dist/src/components/Select.mjs +0 -2
- package/dist/src/components/Select.mjs.map +0 -1
- package/dist/src/components/Separator.d.mts.map +0 -1
- package/dist/src/components/Separator.mjs +0 -2
- package/dist/src/components/Separator.mjs.map +0 -1
- package/dist/src/components/Sheet.d.mts +0 -36
- package/dist/src/components/Sheet.d.mts.map +0 -1
- package/dist/src/components/Sheet.mjs +0 -2
- package/dist/src/components/Sheet.mjs.map +0 -1
- package/dist/src/components/Skeleton.d.mts.map +0 -1
- package/dist/src/components/Skeleton.mjs +0 -2
- package/dist/src/components/Skeleton.mjs.map +0 -1
- package/dist/src/components/Spinner.d.mts.map +0 -1
- package/dist/src/components/Spinner.mjs +0 -2
- package/dist/src/components/Spinner.mjs.map +0 -1
- package/dist/src/components/StatusBadge.d.mts.map +0 -1
- package/dist/src/components/StatusBadge.mjs +0 -2
- package/dist/src/components/StatusBadge.mjs.map +0 -1
- package/dist/src/components/StreamCursor.d.mts +0 -7
- package/dist/src/components/StreamCursor.d.mts.map +0 -1
- package/dist/src/components/StreamCursor.mjs +0 -2
- package/dist/src/components/StreamCursor.mjs.map +0 -1
- package/dist/src/components/Switch.d.mts.map +0 -1
- package/dist/src/components/Switch.mjs +0 -2
- package/dist/src/components/Switch.mjs.map +0 -1
- package/dist/src/components/Tabs.d.mts.map +0 -1
- package/dist/src/components/Tabs.mjs +0 -2
- package/dist/src/components/Tabs.mjs.map +0 -1
- package/dist/src/components/Textarea.d.mts.map +0 -1
- package/dist/src/components/Textarea.mjs +0 -2
- package/dist/src/components/Textarea.mjs.map +0 -1
- package/dist/src/components/Toast.d.mts +0 -24
- package/dist/src/components/Toast.d.mts.map +0 -1
- package/dist/src/components/Toast.mjs +0 -2
- package/dist/src/components/Toast.mjs.map +0 -1
- package/dist/src/components/Tooltip.d.mts +0 -11
- package/dist/src/components/Tooltip.d.mts.map +0 -1
- package/dist/src/components/Tooltip.mjs +0 -2
- package/dist/src/components/Tooltip.mjs.map +0 -1
- package/dist/src/icons/icons.d.mts +0 -2
- package/dist/src/icons/icons.mjs +0 -1
- package/dist/src/lib/cn.d.mts.map +0 -1
- package/dist/src/lib/cn.mjs.map +0 -1
- package/dist/src/lib/collapse.d.mts.map +0 -1
- package/dist/src/lib/collapse.mjs.map +0 -1
- package/dist/src/lib/editorLanguage.d.mts.map +0 -1
- package/dist/src/lib/editorLanguage.mjs.map +0 -1
- package/dist/src/lib/editorTheme.mjs +0 -2
- package/dist/src/lib/editorTheme.mjs.map +0 -1
- package/dist/src/lib/hashlineView.d.mts.map +0 -1
- package/dist/src/lib/hashlineView.mjs +0 -6
- package/dist/src/lib/media.d.mts.map +0 -1
- package/dist/src/lib/optionList.d.mts.map +0 -1
- package/dist/src/lib/optionList.mjs.map +0 -1
- package/dist/src/lib/tone.d.mts.map +0 -1
- package/dist/src/theme/apply.d.mts.map +0 -1
- package/dist/src/theme/apply.mjs.map +0 -1
- package/dist/src/theme/builtinThemes.d.mts +0 -12
- package/dist/src/theme/builtinThemes.d.mts.map +0 -1
- package/dist/src/theme/builtinThemes.mjs.map +0 -1
- package/dist/src/theme/derive.d.mts +0 -15
- package/dist/src/theme/derive.d.mts.map +0 -1
- package/dist/src/theme/derive.mjs.map +0 -1
- package/dist/src/theme/parse.d.mts.map +0 -1
- package/dist/src/theme/piTheme.d.mts.map +0 -1
- package/dist/src/theme/piTheme.mjs.map +0 -1
- package/dist/src/theme/preference.d.mts.map +0 -1
- package/dist/src/theme/preference.mjs.map +0 -1
- package/dist/src/types/editor.d.mts +0 -44
- package/dist/src/types/editor.d.mts.map +0 -1
- package/dist/src/types/editor.mjs.map +0 -1
- package/dist/src/types/theme.d.mts +0 -39
- package/dist/src/types/theme.d.mts.map +0 -1
- package/dist/src/types/theme.mjs.map +0 -1
- package/dist/src/types/tone.d.mts +0 -29
- package/dist/src/types/tone.d.mts.map +0 -1
- package/dist/src/types/tone.mjs.map +0 -1
- package/dist/theme/apply.d.cts +0 -26
- package/dist/theme/apply.d.cts.map +0 -1
- package/dist/theme/builtinThemes.d.cts +0 -12
- package/dist/theme/builtinThemes.d.cts.map +0 -1
- package/dist/theme/derive.d.cts +0 -15
- package/dist/theme/derive.d.cts.map +0 -1
- package/dist/theme/parse.d.cts +0 -11
- package/dist/theme/parse.d.cts.map +0 -1
- package/dist/theme/piTheme.d.cts +0 -20
- package/dist/theme/piTheme.d.cts.map +0 -1
- package/dist/theme/preference.d.cts +0 -16
- package/dist/theme/preference.d.cts.map +0 -1
- package/dist/theme.d.cts +0 -8
- package/dist/themes/doom-nord-dark.mjs.map +0 -1
- package/dist/themes/doom-one-dark.mjs.map +0 -1
- package/dist/themes/doom-one-light.mjs.map +0 -1
- package/dist/types/editor.d.cts +0 -44
- package/dist/types/editor.d.cts.map +0 -1
- package/dist/types/theme.d.cts +0 -39
- package/dist/types/theme.d.cts.map +0 -1
- package/dist/types/tone.d.cts +0 -29
- package/dist/types/tone.d.cts.map +0 -1
- /package/dist/{src → doompi-web-components/src}/components/Checkbox.d.mts +0 -0
- /package/dist/{src → doompi-web-components/src}/components/Label.d.mts +0 -0
- /package/dist/{src → doompi-web-components/src}/components/Progress.d.mts +0 -0
- /package/dist/{src → doompi-web-components/src}/components/Separator.d.mts +0 -0
- /package/dist/{src → doompi-web-components/src}/components/Switch.d.mts +0 -0
- /package/dist/{src → doompi-web-components/src}/lib/cn.mjs +0 -0
- /package/dist/{src → doompi-web-components/src}/lib/collapse.mjs +0 -0
- /package/dist/{src → doompi-web-components/src}/lib/editorLanguage.mjs +0 -0
- /package/dist/{src → doompi-web-components/src}/lib/media.mjs +0 -0
- /package/dist/{src → doompi-web-components/src}/lib/optionList.mjs +0 -0
- /package/dist/{src → doompi-web-components/src}/lib/tone.mjs +0 -0
- /package/dist/{src → doompi-web-components/src}/theme/apply.mjs +0 -0
- /package/dist/{src → doompi-web-components/src}/theme/builtinThemes.mjs +0 -0
- /package/dist/{src → doompi-web-components/src}/theme/derive.mjs +0 -0
- /package/dist/{src → doompi-web-components/src}/theme/parse.mjs +0 -0
- /package/dist/{src → doompi-web-components/src}/theme/piTheme.mjs +0 -0
- /package/dist/{src → doompi-web-components/src}/theme/preference.mjs +0 -0
- /package/dist/{src → doompi-web-components/src}/types/editor.mjs +0 -0
- /package/dist/{src → doompi-web-components/src}/types/theme.mjs +0 -0
- /package/dist/{src → doompi-web-components/src}/types/tone.mjs +0 -0
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ a download rather than as something that looks editable.
|
|
|
79
79
|
## Using it from a plugin's `web/` client
|
|
80
80
|
|
|
81
81
|
A web plugin's client code may import `react`, the `@tanstack` store packages,
|
|
82
|
-
`@agimon-ai/doompi-web
|
|
82
|
+
`@agimon-ai/doompi-core/web`, and this package. Declare it as a `workspace:*` dependency and
|
|
83
83
|
import the same way the host does; the cockpit bundler dedupes it so one copy renders everywhere.
|
|
84
84
|
Do not import `radix-ui` or `class-variance-authority` directly from plugin code: the doom-web
|
|
85
85
|
vibe-lint rules route every primitive through this package so a theme change reaches all of them.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types/webPlugin.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types/webPlugin.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types/webPlugin.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types/template.mjs";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
//#region ../doompi-core/dist/src/web/types/mcpWidget.d.mts
|
|
3
|
+
//#region src/web/types/mcpWidget.d.ts
|
|
4
|
+
/** The MCP host supplies invocation data. Widgets never receive host services or credentials. */
|
|
5
|
+
export interface DoomMcpWidgetProps {
|
|
6
|
+
readonly toolName: string;
|
|
7
|
+
readonly args: Readonly<Record<string, unknown>>;
|
|
8
|
+
readonly result: CallToolResult | null;
|
|
9
|
+
readonly phase: 'connecting' | 'preparing' | 'running' | 'result' | 'cancelled' | 'error';
|
|
10
|
+
readonly error?: string;
|
|
11
|
+
/** Only available when this tool explicitly allows app calls and the host supports them. */
|
|
12
|
+
readonly refresh?: () => Promise<CallToolResult>;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#endregion
|
|
16
|
+
//# sourceMappingURL=mcpWidget.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpWidget.d.mts","names":[],"sources":["../../../../../../../doompi-core/dist/src/web/types/mcpWidget.d.mts"],"mappings":";;;;iBAGiB;WACN;WACA,MAAM,SAAS;WACf,QAAQ;WACR;WACA;;WAEA,gBAAgB,QAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from "react";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DoomMcpWidgetProps } from "./src/web/types/mcpWidget.mjs";
|
|
2
|
+
import "./src/web/types/template.mjs";
|
|
3
|
+
import "./src/web/types/webPlugin.mjs";
|
|
4
|
+
import "./src/web/types/extensionFile.mjs";
|
|
5
|
+
import "./src/extensions/webPlugin.mjs";
|
|
6
|
+
import "./src/web/models/globalStore.mjs";
|
|
7
|
+
import "./src/web/models/sessionStore.mjs";
|
|
8
|
+
import "./src/web/models/workspaceStore.mjs";
|
|
9
|
+
import "./src/web/schemas/template.mjs";
|
|
10
|
+
export type { DoomMcpWidgetProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Accordion } from "radix-ui";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
//#region src/components/Accordion.d.ts
|
|
4
|
+
/** Several collapsibles that know about each other; pass type="single" for one open at a time. */
|
|
5
|
+
declare function Accordion$1(props: ComponentProps<typeof Accordion.Root>): import("react").JSX.Element;
|
|
6
|
+
export declare function AccordionItem({ className, ...props }: ComponentProps<typeof Accordion.Item>): import("react").JSX.Element;
|
|
7
|
+
export declare function AccordionTrigger({ className, children, ...props }: ComponentProps<typeof Accordion.Trigger>): import("react").JSX.Element;
|
|
8
|
+
export declare function AccordionContent({ className, ...props }: ComponentProps<typeof Accordion.Content>): import("react").JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Accordion$1 as Accordion };
|
|
11
|
+
//# sourceMappingURL=Accordion.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.d.mts","names":[],"sources":["../../../../src/components/Accordion.tsx"],"mappings":";;;;iBAOgB,YAAU,OAAO,sBAAsB,UAAmB,wBAAK,IAAA;wBAI/D,gBAAgB,cAAc,SAAS,sBAAsB,UAAmB,wBAAK,IAAA;wBAUrF,mBAAmB,WAAW,aAAa,SAAS,sBAAsB,UAAmB,2BAAQ,IAAA;wBAkBrG,mBAAmB,cAAc,SAAS,sBAAsB,UAAmB,2BAAQ,IAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ChevronDownIcon as e}from"../icons/icons.mjs";import{cn as t}from"../lib/cn.mjs";import{Accordion as n}from"radix-ui";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a(e){return/* @__PURE__ */ r(n.Root,{"data-slot":`accordion`,...e})}function o({className:e,...i}){return/* @__PURE__ */ r(n.Item,{"data-slot":`accordion-item`,className:t(`border-b border-doom-border-soft last:border-b-0`,e),...i})}function s({className:a,children:o,...s}){return/* @__PURE__ */ r(n.Header,{className:`flex`,children:/* @__PURE__ */ i(n.Trigger,{"data-slot":`accordion-trigger`,className:t(`flex flex-1 cursor-pointer items-center justify-between gap-2 py-2 text-left text-sm text-doom-hi outline-none transition-colors hover:text-doom-blue focus-visible:text-doom-blue [&[data-state=open]>svg]:rotate-180`,a),...s,children:[o,/* @__PURE__ */ r(e,{className:`h-3 w-3 shrink-0 text-doom-faint transition-transform`})]})})}function c({className:e,...i}){return/* @__PURE__ */ r(n.Content,{"data-slot":`accordion-content`,className:t(`overflow-hidden pb-2 text-sm text-doom-dim`,e),...i})}export{a as Accordion,c as AccordionContent,o as AccordionItem,s as AccordionTrigger};
|
|
2
|
+
//# sourceMappingURL=Accordion.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.mjs","names":["Accordion","AccordionPrimitive"],"sources":["../../../../src/components/Accordion.tsx"],"sourcesContent":["import { Accordion as AccordionPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { ChevronDownIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\n\n/** Several collapsibles that know about each other; pass type=\"single\" for one open at a time. */\nexport function Accordion(props: ComponentProps<typeof AccordionPrimitive.Root>) {\n return <AccordionPrimitive.Root data-slot=\"accordion\" {...props} />;\n}\n\nexport function AccordionItem({ className, ...props }: ComponentProps<typeof AccordionPrimitive.Item>) {\n return (\n <AccordionPrimitive.Item\n data-slot=\"accordion-item\"\n className={cn('border-b border-doom-border-soft last:border-b-0', className)}\n {...props}\n />\n );\n}\n\nexport function AccordionTrigger({ className, children, ...props }: ComponentProps<typeof AccordionPrimitive.Trigger>) {\n return (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n data-slot=\"accordion-trigger\"\n className={cn(\n 'flex flex-1 cursor-pointer items-center justify-between gap-2 py-2 text-left text-sm text-doom-hi outline-none transition-colors hover:text-doom-blue focus-visible:text-doom-blue [&[data-state=open]>svg]:rotate-180',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronDownIcon className=\"h-3 w-3 shrink-0 text-doom-faint transition-transform\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n}\n\nexport function AccordionContent({ className, ...props }: ComponentProps<typeof AccordionPrimitive.Content>) {\n return (\n <AccordionPrimitive.Content\n data-slot=\"accordion-content\"\n className={cn('overflow-hidden pb-2 text-sm text-doom-dim', className)}\n {...props}\n />\n );\n}\n"],"mappings":"+KAOA,SAAgBA,EAAU,EAAuD,CAC/E,MAAO,kBAACC,EAAmB,KAApB,CAAyB,YAAU,YAAY,GAAI,CAAQ,CAAA,CACpE,CAEA,SAAgB,EAAc,CAAE,YAAW,GAAG,GAAyD,CACrG,MACE,kBAACA,EAAmB,KAApB,CACE,YAAU,iBACV,UAAW,EAAG,mDAAoD,CAAS,EAC3E,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAiB,CAAE,YAAW,WAAU,GAAG,GAA4D,CACrH,MACE,kBAACA,EAAmB,OAApB,CAA2B,UAAU,OACnC,SAAA,kBAACA,EAAmB,QAApB,CACE,YAAU,oBACV,UAAW,EACT,yNACA,CACF,EACA,GAAI,EANN,SAAA,CAQG,EACD,kBAAC,EAAD,CAAiB,UAAU,uDAAyD,CAAA,CAC1D,GACH,CAAA,CAE/B,CAEA,SAAgB,EAAiB,CAAE,YAAW,GAAG,GAA4D,CAC3G,MACE,kBAACA,EAAmB,QAApB,CACE,YAAU,oBACV,UAAW,EAAG,6CAA8C,CAAS,EACrE,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
//#region src/components/AnsiText.d.ts
|
|
3
|
+
export interface AnsiLineProps extends Omit<ComponentProps<'span'>, 'children'> {
|
|
4
|
+
/** One line of terminal output, escapes and all. */
|
|
5
|
+
line: string;
|
|
6
|
+
}
|
|
7
|
+
/** One line, for a caller that already lays out a screen row by row. */
|
|
8
|
+
export declare function AnsiLine({ line, className, ...props }: AnsiLineProps): import("react").JSX.Element;
|
|
9
|
+
export interface AnsiTextProps extends Omit<ComponentProps<'pre'>, 'children'> {
|
|
10
|
+
/** Terminal output, newline separated, escapes and all. */
|
|
11
|
+
text: string;
|
|
12
|
+
}
|
|
13
|
+
/** A block of terminal output: a log tail, or anything else that arrives whole. */
|
|
14
|
+
export declare function AnsiText({ text, ...props }: AnsiTextProps): import("react").JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
//# sourceMappingURL=AnsiText.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnsiText.d.mts","names":[],"sources":["../../../../src/components/AnsiText.tsx"],"mappings":";;iBAmDiB,sBAAsB,KAAK;;EAE1C;;;wBAIc,WAAW,MAAM,cAAc,SAAS,gCAAa,IAAA;iBASpD,sBAAsB,KAAK;;EAE1C;;;wBAIc,WAAW,SAAS,SAAS,gCAAa,IAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{ansiSpans as t}from"../lib/ansiSpans.mjs";import{Fragment as n,jsx as r,jsxs as i}from"react/jsx-runtime";import{Fragment as a,useMemo as o}from"react";function s(t){return e(t.className,t.bold===!0&&`font-bold`,t.faint===!0&&`opacity-60`,t.italic===!0&&`italic`,t.underline===!0&&`underline`,t.inverse===!0&&`bg-doom-text text-doom-deep`)}function c({spans:e}){return/* @__PURE__ */ r(n,{children:e.map((e,t)=>/* @__PURE__ */ r(`span`,{className:s(e),style:e.color===void 0?void 0:{color:e.color},children:e.text},t))})}function l({line:e,className:n,...i}){let a=o(()=>t(e),[e]);return/* @__PURE__ */ r(`span`,{"data-slot":`ansi-line`,className:n,...i,children:/* @__PURE__ */ r(c,{spans:a})})}function u({text:e,...n}){let s=o(()=>e.split(`
|
|
2
|
+
`).map(e=>t(e)),[e]);return/* @__PURE__ */ r(`pre`,{"data-slot":`ansi-text`,...n,children:s.map((e,t)=>/* @__PURE__ */ i(a,{children:[t>0?`
|
|
3
|
+
`:null,/* @__PURE__ */ r(c,{spans:e})]},t))})}export{l as AnsiLine,u as AnsiText};
|
|
4
|
+
//# sourceMappingURL=AnsiText.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnsiText.mjs","names":["Fragment"],"sources":["../../../../src/components/AnsiText.tsx"],"sourcesContent":["import { type ComponentProps, Fragment, useMemo } from 'react';\n\nimport { type AnsiSpan, ansiSpans } from '../lib/ansiSpans';\nimport { cn } from '../lib/cn';\n\n/**\n * Terminal output with the colours it was written in.\n *\n * Both readers of terminal text render it the same way, so the mapping from a\n * span's attributes to classes lives here rather than in each of them: a\n * captured workflow screen is a line at a time, and a runner log is a block.\n * Parsing is synchronous and cheap; text with no escapes in it takes a path\n * that allocates nothing.\n *\n * DESIGN PATTERNS:\n * - Named colours arrive as theme classes from `ansiSpans`; only 256-colour\n * and truecolour, which no token stands for, come through as a style.\n * - One element per line, so wrapping and selection behave as they do in a pre.\n *\n * AVOID:\n * - Carrying attributes across lines. A captured screen and a bounded log tail\n * both start mid-stream.\n */\n\nfunction spanClassName(span: AnsiSpan): string {\n return cn(\n span.className,\n span.bold === true && 'font-bold',\n span.faint === true && 'opacity-60',\n span.italic === true && 'italic',\n span.underline === true && 'underline',\n span.inverse === true && 'bg-doom-text text-doom-deep',\n );\n}\n\nfunction AnsiSpans({ spans }: { spans: readonly AnsiSpan[] }) {\n return (\n <>\n {spans.map((span, index) => (\n <span\n key={index}\n className={spanClassName(span)}\n style={span.color === undefined ? undefined : { color: span.color }}\n >\n {span.text}\n </span>\n ))}\n </>\n );\n}\n\nexport interface AnsiLineProps extends Omit<ComponentProps<'span'>, 'children'> {\n /** One line of terminal output, escapes and all. */\n line: string;\n}\n\n/** One line, for a caller that already lays out a screen row by row. */\nexport function AnsiLine({ line, className, ...props }: AnsiLineProps) {\n const spans = useMemo(() => ansiSpans(line), [line]);\n return (\n <span data-slot=\"ansi-line\" className={className} {...props}>\n <AnsiSpans spans={spans} />\n </span>\n );\n}\n\nexport interface AnsiTextProps extends Omit<ComponentProps<'pre'>, 'children'> {\n /** Terminal output, newline separated, escapes and all. */\n text: string;\n}\n\n/** A block of terminal output: a log tail, or anything else that arrives whole. */\nexport function AnsiText({ text, ...props }: AnsiTextProps) {\n const lines = useMemo(() => text.split('\\n').map((line) => ansiSpans(line)), [text]);\n return (\n <pre data-slot=\"ansi-text\" {...props}>\n {lines.map((spans, index) => (\n <Fragment key={index}>\n {index > 0 ? '\\n' : null}\n <AnsiSpans spans={spans} />\n </Fragment>\n ))}\n </pre>\n );\n}\n"],"mappings":"kMAwBA,SAAS,EAAc,EAAwB,CAC7C,OAAO,EACL,EAAK,UACL,EAAK,OAAS,IAAQ,YACtB,EAAK,QAAU,IAAQ,aACvB,EAAK,SAAW,IAAQ,SACxB,EAAK,YAAc,IAAQ,YAC3B,EAAK,UAAY,IAAQ,6BAC3B,CACF,CAEA,SAAS,EAAU,CAAE,SAAyC,CAC5D,MACE,kBAAA,EAAA,CAAA,SACG,EAAM,KAAK,EAAM,IAChB,kBAAC,OAAD,CAEE,UAAW,EAAc,CAAI,EAC7B,MAAO,EAAK,QAAU,IAAA,GAAY,IAAA,GAAY,CAAE,MAAO,EAAK,KAAM,EAEjE,SAAA,EAAK,IACF,EALC,CAKD,CACP,CACD,CAAA,CAEN,CAQA,SAAgB,EAAS,CAAE,OAAM,YAAW,GAAG,GAAwB,CACrE,IAAM,EAAQ,MAAc,EAAU,CAAI,EAAG,CAAC,CAAI,CAAC,EACnD,MACE,kBAAC,OAAD,CAAM,YAAU,YAAuB,YAAW,GAAI,EACpD,SAAA,kBAAC,EAAD,CAAkB,OAAQ,CAAA,CACtB,CAAA,CAEV,CAQA,SAAgB,EAAS,CAAE,OAAM,GAAG,GAAwB,CAC1D,IAAM,EAAQ,MAAc,EAAK,MAAM;CAAI,CAAC,CAAC,IAAK,GAAS,EAAU,CAAI,CAAC,EAAG,CAAC,CAAI,CAAC,EACnF,MACE,kBAAC,MAAD,CAAK,YAAU,YAAY,GAAI,EAC5B,SAAA,EAAM,KAAK,EAAO,IACjB,kBAACA,EAAD,CAAA,SAAA,CACG,EAAQ,EAAI;EAAO,KACpB,kBAAC,EAAD,CAAkB,OAAQ,CAAA,CAClB,CAAA,EAHK,CAGL,CACX,CACE,CAAA,CAET"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Avatar } from "radix-ui";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
//#region src/components/Avatar.d.ts
|
|
4
|
+
/** A face or an initial; Radix only shows the fallback once the image has actually failed. */
|
|
5
|
+
declare function Avatar$1({ className, ...props }: ComponentProps<typeof Avatar.Root>): import("react").JSX.Element;
|
|
6
|
+
export declare function AvatarImage({ className, ...props }: ComponentProps<typeof Avatar.Image>): import("react").JSX.Element;
|
|
7
|
+
export declare function AvatarFallback({ className, ...props }: ComponentProps<typeof Avatar.Fallback>): import("react").JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Avatar$1 as Avatar };
|
|
10
|
+
//# sourceMappingURL=Avatar.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.d.mts","names":[],"sources":["../../../../src/components/Avatar.tsx"],"mappings":";;;;iBAMgB,WAAS,cAAc,SAAS,sBAAsB,OAAgB,wBAAK,IAAA;wBAU3E,cAAc,cAAc,SAAS,sBAAsB,OAAgB,yBAAM,IAAA;wBAUjF,iBAAiB,cAAc,SAAS,sBAAsB,OAAgB,4BAAS,IAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{Avatar as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";function r({className:r,...i}){return/* @__PURE__ */ n(t.Root,{"data-slot":`avatar`,className:e(`relative flex h-6 w-6 shrink-0 overflow-hidden rounded-full bg-doom-deep`,r),...i})}function i({className:r,...i}){return/* @__PURE__ */ n(t.Image,{"data-slot":`avatar-image`,className:e(`h-full w-full object-cover`,r),...i})}function a({className:r,...i}){return/* @__PURE__ */ n(t.Fallback,{"data-slot":`avatar-fallback`,className:e(`flex h-full w-full items-center justify-center text-xs font-bold text-doom-dim`,r),...i})}export{r as Avatar,a as AvatarFallback,i as AvatarImage};
|
|
2
|
+
//# sourceMappingURL=Avatar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.mjs","names":["Avatar","AvatarPrimitive"],"sources":["../../../../src/components/Avatar.tsx"],"sourcesContent":["import { Avatar as AvatarPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** A face or an initial; Radix only shows the fallback once the image has actually failed. */\nexport function Avatar({ className, ...props }: ComponentProps<typeof AvatarPrimitive.Root>) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n className={cn('relative flex h-6 w-6 shrink-0 overflow-hidden rounded-full bg-doom-deep', className)}\n {...props}\n />\n );\n}\n\nexport function AvatarImage({ className, ...props }: ComponentProps<typeof AvatarPrimitive.Image>) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn('h-full w-full object-cover', className)}\n {...props}\n />\n );\n}\n\nexport function AvatarFallback({ className, ...props }: ComponentProps<typeof AvatarPrimitive.Fallback>) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn('flex h-full w-full items-center justify-center text-xs font-bold text-doom-dim', className)}\n {...props}\n />\n );\n}\n"],"mappings":"6GAMA,SAAgBA,EAAO,CAAE,YAAW,GAAG,GAAsD,CAC3F,MACE,kBAACC,EAAgB,KAAjB,CACE,YAAU,SACV,UAAW,EAAG,2EAA4E,CAAS,EACnG,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAY,CAAE,YAAW,GAAG,GAAuD,CACjG,MACE,kBAACA,EAAgB,MAAjB,CACE,YAAU,eACV,UAAW,EAAG,6BAA8B,CAAS,EACrD,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAe,CAAE,YAAW,GAAG,GAA0D,CACvG,MACE,kBAACA,EAAgB,SAAjB,CACE,YAAU,kBACV,UAAW,EAAG,iFAAkF,CAAS,EACzG,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { ChipTone } from "../types/tone.mjs";
|
|
2
|
-
import { VariantProps } from "class-variance-authority";
|
|
3
2
|
import { ComponentProps } from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
//#region src/components/Badge.d.ts
|
|
5
|
-
declare const badgeVariants: (props?: ({
|
|
5
|
+
export declare const badgeVariants: (props?: ({
|
|
6
6
|
tone?: "blue" | "cyan" | "green" | "magenta" | "neutral" | "orange" | "red" | "teal" | "violet" | "yellow" | null | undefined;
|
|
7
7
|
size?: "lg" | "md" | "sm" | "xs" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
-
type BadgeTone = ChipTone;
|
|
10
|
-
interface BadgeProps extends ComponentProps<'span'>, VariantProps<typeof badgeVariants> {
|
|
9
|
+
export type BadgeTone = ChipTone;
|
|
10
|
+
export interface BadgeProps extends ComponentProps<'span'>, VariantProps<typeof badgeVariants> {
|
|
11
11
|
/** Render the child element instead of a <span>, so a link can look like a chip. */
|
|
12
12
|
asChild?: boolean;
|
|
13
13
|
}
|
|
14
14
|
/** An outlined chip in one of the accent tones; the Chip the cockpit mockup draws. */
|
|
15
|
-
declare function Badge({ className, tone, size, asChild, ...props }: BadgeProps): import("react").JSX.Element;
|
|
15
|
+
export declare function Badge({ className, tone, size, asChild, ...props }: BadgeProps): import("react").JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { Badge, BadgeProps, BadgeTone, badgeVariants };
|
|
18
17
|
//# sourceMappingURL=Badge.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.d.mts","names":[],"sources":["../../../../src/components/Badge.tsx"],"mappings":";;;;qBAOa,gBAAa;;;6CAuBxB;YAEU,YAAY;iBAEP,mBAAmB,wBAAwB,oBAAoB;;EAE9E;;;wBAIc,QAAQ,WAAW,MAAM,MAAM,YAAoB,SAAS,6BAAU,IAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as e}from"../lib/cn.mjs";import{Slot as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";const i=r(`inline-flex items-center gap-1.5 whitespace-nowrap rounded border font-mono`,{variants:{tone:{neutral:`border-doom-border text-doom-dim`,blue:`border-doom-blue/40 text-doom-blue`,green:`border-doom-green/40 text-doom-green`,yellow:`border-doom-yellow/40 text-doom-yellow`,red:`border-doom-red/40 text-doom-red`,magenta:`border-doom-magenta/40 text-doom-magenta`,violet:`border-doom-violet/40 text-doom-violet`,cyan:`border-doom-cyan/40 text-doom-cyan`,orange:`border-doom-orange/40 text-doom-orange`,teal:`border-doom-teal/40 text-doom-teal`},size:{xs:`px-1.5 py-0.5 text-
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{Slot as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";const i=r(`inline-flex items-center gap-1.5 whitespace-nowrap rounded border font-mono`,{variants:{tone:{neutral:`border-doom-border text-doom-dim`,blue:`border-doom-blue/40 text-doom-blue`,green:`border-doom-green/40 text-doom-green`,yellow:`border-doom-yellow/40 text-doom-yellow`,red:`border-doom-red/40 text-doom-red`,magenta:`border-doom-magenta/40 text-doom-magenta`,violet:`border-doom-violet/40 text-doom-violet`,cyan:`border-doom-cyan/40 text-doom-cyan`,orange:`border-doom-orange/40 text-doom-orange`,teal:`border-doom-teal/40 text-doom-teal`},size:{xs:`px-1.5 py-0.5 text-2xs font-bold`,sm:`px-2 py-0.5 text-xs`,md:`px-2.5 py-1 text-sm`,lg:`px-3 py-1.5 text-base`}},defaultVariants:{tone:`neutral`,size:`sm`}});function a({className:r,tone:a,size:o,asChild:s=!1,...c}){let l=s?t.Root:`span`;return/* @__PURE__ */ n(l,{"data-slot":`badge`,className:e(i({tone:a,size:o}),r),...c})}export{a as Badge,i as badgeVariants};
|
|
2
2
|
//# sourceMappingURL=Badge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.mjs","names":[],"sources":["../../../../src/components/Badge.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\nimport type { ChipTone } from '../types/tone';\n\nexport const badgeVariants = cva('inline-flex items-center gap-1.5 whitespace-nowrap rounded border font-mono', {\n variants: {\n tone: {\n neutral: 'border-doom-border text-doom-dim',\n blue: 'border-doom-blue/40 text-doom-blue',\n green: 'border-doom-green/40 text-doom-green',\n yellow: 'border-doom-yellow/40 text-doom-yellow',\n red: 'border-doom-red/40 text-doom-red',\n magenta: 'border-doom-magenta/40 text-doom-magenta',\n violet: 'border-doom-violet/40 text-doom-violet',\n cyan: 'border-doom-cyan/40 text-doom-cyan',\n orange: 'border-doom-orange/40 text-doom-orange',\n teal: 'border-doom-teal/40 text-doom-teal',\n } satisfies Record<ChipTone, string>,\n /** The same rungs Button names, so a chip can sit beside a button of any size. */\n size: {\n xs: 'px-1.5 py-0.5 text-2xs font-bold',\n sm: 'px-2 py-0.5 text-xs',\n md: 'px-2.5 py-1 text-sm',\n lg: 'px-3 py-1.5 text-base',\n },\n },\n defaultVariants: { tone: 'neutral', size: 'sm' },\n});\n\nexport type BadgeTone = ChipTone;\n\nexport interface BadgeProps extends ComponentProps<'span'>, VariantProps<typeof badgeVariants> {\n /** Render the child element instead of a <span>, so a link can look like a chip. */\n asChild?: boolean;\n}\n\n/** An outlined chip in one of the accent tones; the Chip the cockpit mockup draws. */\nexport function Badge({ className, tone, size, asChild = false, ...props }: BadgeProps) {\n const Component = asChild ? Slot.Root : 'span';\n return <Component data-slot=\"badge\" className={cn(badgeVariants({ tone, size }), className)} {...props} />;\n}\n"],"mappings":"0JAOA,MAAa,EAAgB,EAAI,8EAA+E,CAC9G,SAAU,CACR,KAAM,CACJ,QAAS,mCACT,KAAM,qCACN,MAAO,uCACP,OAAQ,yCACR,IAAK,mCACL,QAAS,2CACT,OAAQ,yCACR,KAAM,qCACN,OAAQ,yCACR,KAAM,oCACR,EAEA,KAAM,CACJ,GAAI,mCACJ,GAAI,sBACJ,GAAI,sBACJ,GAAI,uBACN,CACF,EACA,gBAAiB,CAAE,KAAM,UAAW,KAAM,IAAK,CACjD,CAAC,EAUD,SAAgB,EAAM,CAAE,YAAW,OAAM,OAAM,UAAU,GAAO,GAAG,GAAqB,CACtF,IAAM,EAAY,EAAU,EAAK,KAAO,OACxC,MAAO,kBAAC,EAAD,CAAW,YAAU,QAAQ,UAAW,EAAG,EAAc,CAAE,OAAM,MAAK,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CAC3G"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/components/Breadcrumb.d.ts
|
|
2
2
|
/** The marker a collapsed run of segments is shown as. */
|
|
3
|
-
declare const BREADCRUMB_ELLIPSIS = "…";
|
|
3
|
+
export declare const BREADCRUMB_ELLIPSIS = "…";
|
|
4
4
|
/**
|
|
5
5
|
* A path as breadcrumb segments, with the middle collapsed when it is deeper
|
|
6
6
|
* than `keep` allows.
|
|
@@ -9,11 +9,11 @@ declare const BREADCRUMB_ELLIPSIS = "…";
|
|
|
9
9
|
* are what a reader skims past, so those are the ones that go. The leaf is
|
|
10
10
|
* always the final segment and is never collapsed.
|
|
11
11
|
*/
|
|
12
|
-
declare function breadcrumbSegments(path: string, keep?: number): string[];
|
|
13
|
-
interface BreadcrumbProps {
|
|
12
|
+
export declare function breadcrumbSegments(path: string, keep?: number): string[];
|
|
13
|
+
export interface BreadcrumbProps {
|
|
14
14
|
/** The path to show, separated by forward slashes. */
|
|
15
15
|
path: string;
|
|
16
|
-
/** How many segments survive
|
|
16
|
+
/** How many segments survive, with a minimum of three to retain the leaf. */
|
|
17
17
|
keep?: number;
|
|
18
18
|
/** Marks the trail so a test can find it. */
|
|
19
19
|
'data-testid'?: string;
|
|
@@ -31,7 +31,6 @@ interface BreadcrumbProps {
|
|
|
31
31
|
* The leaf carries the emphasis. A reader scanning a header is looking for the
|
|
32
32
|
* file, and the directories are context for it.
|
|
33
33
|
*/
|
|
34
|
-
declare function Breadcrumb({ path, keep, className, 'data-testid': testId }: BreadcrumbProps): import("react").JSX.Element;
|
|
34
|
+
export declare function Breadcrumb({ path, keep, className, 'data-testid': testId }: BreadcrumbProps): import("react").JSX.Element;
|
|
35
35
|
//#endregion
|
|
36
|
-
export { BREADCRUMB_ELLIPSIS, Breadcrumb, BreadcrumbProps, breadcrumbSegments };
|
|
37
36
|
//# sourceMappingURL=Breadcrumb.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumb.d.mts","names":[],"sources":["../../../../src/components/Breadcrumb.tsx"],"mappings":";;qBAIa;;;;;;;;;wBAUG,mBAAmB,cAAc;iBAShC;;EAEf;;EAEA;;EAEA;EACA;;;;;;;;;;;;;;wBAec,aAAa,MAAM,MAAM,0BAA0B,UAAU,kCAAe,IAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{Tooltip as t,TooltipContent as n,TooltipProvider as r,TooltipTrigger as i}from"./Tooltip.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";const s=`…`;function c(e,t=4){let n=e.split(`/`).filter(e=>e!==``);if(n.length===0)return[e];let r=Math.max(3,t);return n.length<=r?n:[n[0]??``,`…`,...n.slice(n.length-(r-2))]}function l({path:s,keep:l,className:u,"data-testid":d}){let f=c(s,l),p=f.length-1;return/* @__PURE__ */ a(r,{children:/* @__PURE__ */ o(t,{children:[/* @__PURE__ */ a(i,{asChild:!0,children:/* @__PURE__ */ a(`span`,{"data-slot":`breadcrumb`,"data-testid":d,title:void 0,className:e(`flex min-w-0 items-baseline gap-1 truncate font-mono text-sm`,u),children:f.map((e,t)=>/* @__PURE__ */ o(`span`,{className:`flex min-w-0 items-baseline gap-1`,children:[t>0?/* @__PURE__ */ a(`span`,{className:`shrink-0 text-doom-faint`,children:`/`}):null,/* @__PURE__ */ a(`span`,{className:t===p?`truncate font-bold text-doom-hi`:`min-w-0 truncate text-doom-faint`,children:e})]},`${e}-${String(t)}`))})}),/* @__PURE__ */ a(n,{className:`max-w-[32rem] break-all whitespace-normal`,children:s})]})})}export{s as BREADCRUMB_ELLIPSIS,l as Breadcrumb,c as breadcrumbSegments};
|
|
2
|
+
//# sourceMappingURL=Breadcrumb.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumb.mjs","names":[],"sources":["../../../../src/components/Breadcrumb.tsx"],"sourcesContent":["import { cn } from '../lib/cn';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './Tooltip';\n\n/** The marker a collapsed run of segments is shown as. */\nexport const BREADCRUMB_ELLIPSIS = '…';\n\n/**\n * A path as breadcrumb segments, with the middle collapsed when it is deeper\n * than `keep` allows.\n *\n * The first segment and the last few are what place a leaf; the ones between\n * are what a reader skims past, so those are the ones that go. The leaf is\n * always the final segment and is never collapsed.\n */\nexport function breadcrumbSegments(path: string, keep = 4): string[] {\n const segments = path.split('/').filter((segment) => segment !== '');\n if (segments.length === 0) return [path];\n const limit = Math.max(3, keep);\n if (segments.length <= limit) return segments;\n // Keep room for the first segment, the collapse marker, and the leaf.\n return [segments[0] ?? '', BREADCRUMB_ELLIPSIS, ...segments.slice(segments.length - (limit - 2))];\n}\n\nexport interface BreadcrumbProps {\n /** The path to show, separated by forward slashes. */\n path: string;\n /** How many segments survive, with a minimum of three to retain the leaf. */\n keep?: number;\n /** Marks the trail so a test can find it. */\n 'data-testid'?: string;\n className?: string;\n}\n\n/**\n * A slash-separated path, shortened to fit and readable in full on hover.\n *\n * Two things shorten it, because they solve different problems. Collapsing the\n * middle keeps a deep path legible at any width, and truncation handles what is\n * left when the container is narrower than even that. Either one hides\n * something, so the whole path is always one hover away, wrapped rather than\n * clipped: a tooltip that truncates too would defeat the point of having one.\n *\n * The leaf carries the emphasis. A reader scanning a header is looking for the\n * file, and the directories are context for it.\n */\nexport function Breadcrumb({ path, keep, className, 'data-testid': testId }: BreadcrumbProps) {\n const segments = breadcrumbSegments(path, keep);\n const lastIndex = segments.length - 1;\n\n return (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <span\n data-slot=\"breadcrumb\"\n data-testid={testId}\n title={undefined}\n className={cn('flex min-w-0 items-baseline gap-1 truncate font-mono text-sm', className)}\n >\n {segments.map((segment, index) => (\n // Segments repeat in a path (src/app/src), so the index is what\n // keeps two of the same name apart.\n <span key={`${segment}-${String(index)}`} className=\"flex min-w-0 items-baseline gap-1\">\n {index > 0 ? <span className=\"shrink-0 text-doom-faint\">/</span> : null}\n <span\n className={\n index === lastIndex ? 'truncate font-bold text-doom-hi' : 'min-w-0 truncate text-doom-faint'\n }\n >\n {segment}\n </span>\n </span>\n ))}\n </span>\n </TooltipTrigger>\n <TooltipContent className=\"max-w-[32rem] break-all whitespace-normal\">{path}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n}\n"],"mappings":"0LAIA,MAAa,EAAsB,IAUnC,SAAgB,EAAmB,EAAc,EAAO,EAAa,CACnE,IAAM,EAAW,EAAK,MAAM,GAAG,CAAC,CAAC,OAAQ,GAAY,IAAY,EAAE,EACnE,GAAI,EAAS,SAAW,EAAG,MAAO,CAAC,CAAI,EACvC,IAAM,EAAQ,KAAK,IAAI,EAAG,CAAI,EAG9B,OAFI,EAAS,QAAU,EAAc,EAE9B,CAAC,EAAS,IAAM,OAAyB,GAAG,EAAS,MAAM,EAAS,QAAU,EAAQ,EAAE,CAAC,CAClG,CAwBA,SAAgB,EAAW,CAAE,OAAM,OAAM,YAAW,cAAe,GAA2B,CAC5F,IAAM,EAAW,EAAmB,EAAM,CAAI,EACxC,EAAY,EAAS,OAAS,EAEpC,MACE,kBAAC,EAAD,CAAA,SACE,kBAAC,EAAD,CAAA,SAAA,CACE,kBAAC,EAAD,CAAgB,QAAA,GACd,SAAA,kBAAC,OAAD,CACE,YAAU,aACV,cAAa,EACb,MAAO,IAAA,GACP,UAAW,EAAG,+DAAgE,CAAS,EAEtF,SAAA,EAAS,KAAK,EAAS,IAGtB,kBAAC,OAAD,CAA0C,UAAU,oCAApD,SAAA,CACG,EAAQ,EAAI,kBAAC,OAAD,CAAM,UAAU,2BAA2B,SAAA,GAAO,CAAA,EAAI,KACnE,kBAAC,OAAD,CACE,UACE,IAAU,EAAY,kCAAoC,mCAG3D,SAAA,CACG,CAAA,CACF,CATK,EAAA,GAAG,EAAQ,GAAG,OAAO,CAAK,GAS/B,CACP,CACG,CAAA,CACQ,CAAA,EAChB,kBAAC,EAAD,CAAgB,UAAU,4CAA6C,SAAA,CAAqB,CAAA,CACrF,CAAA,CAAA,CACM,CAAA,CAErB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { VariantProps } from "class-variance-authority";
|
|
2
1
|
import { ComponentProps } from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
//#region src/components/Button.d.ts
|
|
4
|
-
declare const buttonVariants: (props?: ({
|
|
4
|
+
export declare const buttonVariants: (props?: ({
|
|
5
5
|
variant?: "danger" | "danger-outline" | "ghost" | "link" | "outline" | "primary" | "subtle" | "success" | null | undefined;
|
|
6
6
|
size?: "card" | "icon" | "icon-md" | "lg" | "md" | "sm" | "xs" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
-
type ButtonVariant = NonNullable<VariantProps<typeof buttonVariants>['variant']>;
|
|
9
|
-
type ButtonSize = NonNullable<VariantProps<typeof buttonVariants>['size']>;
|
|
10
|
-
interface ButtonProps extends ComponentProps<'button'>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
export type ButtonVariant = NonNullable<VariantProps<typeof buttonVariants>['variant']>;
|
|
9
|
+
export type ButtonSize = NonNullable<VariantProps<typeof buttonVariants>['size']>;
|
|
10
|
+
export interface ButtonProps extends ComponentProps<'button'>, VariantProps<typeof buttonVariants> {
|
|
11
11
|
/** Render the child element instead of a <button>, passing the classes down (shadcn's asChild). */
|
|
12
12
|
asChild?: boolean;
|
|
13
13
|
/**
|
|
@@ -19,7 +19,6 @@ interface ButtonProps extends ComponentProps<'button'>, VariantProps<typeof butt
|
|
|
19
19
|
loadingLabel?: string;
|
|
20
20
|
}
|
|
21
21
|
/** The one button: every variant is a theme token, so it recolours with the theme. */
|
|
22
|
-
declare function Button({ className, variant, size, asChild, loading, loadingLabel, disabled, type, children, ...props }: ButtonProps): import("react").JSX.Element;
|
|
22
|
+
export declare function Button({ className, variant, size, asChild, loading, loadingLabel, disabled, type, children, ...props }: ButtonProps): import("react").JSX.Element;
|
|
23
23
|
//#endregion
|
|
24
|
-
export { Button, ButtonProps, ButtonSize, ButtonVariant, buttonVariants };
|
|
25
24
|
//# sourceMappingURL=Button.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.mts","names":[],"sources":["../../../../src/components/Button.tsx"],"mappings":";;;qBAOa,iBAAc;;;6CAgC1B;YAEW,gBAAgB,YAAY,oBAAoB;YAChD,aAAa,YAAY,oBAAoB;iBAExC,oBAAoB,0BAA0B,oBAAoB;;EAEjF;;;;;EAKA;;EAEA;;;wBAIc,SACd,WACA,SACA,MACA,SACA,SACA,cACA,UACA,MACA,aACG,SACF,8BAAW,IAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{Spinner as t}from"./Spinner.mjs";import{Slot as n}from"radix-ui";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";import{cva as o}from"class-variance-authority";const s=o(`inline-flex min-h-6 min-w-6 shrink-0 cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-mono transition-[color,background-color,border-color,filter] outline-none focus-visible:ring-2 focus-visible:ring-doom-blue/50 disabled:pointer-events-none disabled:opacity-40 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{primary:`bg-doom-blue font-bold text-doom-rail hover:brightness-110`,outline:`border border-doom-border text-doom-dim hover:border-doom-blue/50 hover:text-doom-hi`,ghost:`text-doom-dim hover:bg-doom-panel hover:text-doom-hi`,subtle:`bg-doom-panel text-doom-dim hover:bg-doom-deep hover:text-doom-hi`,danger:`bg-doom-red font-bold text-doom-rail hover:brightness-110`,"danger-outline":`border border-doom-edge-red bg-doom-tint-red font-bold text-doom-red hover:brightness-110`,success:`bg-doom-green font-bold text-doom-rail hover:brightness-110`,link:`text-doom-blue hover:underline`},size:{xs:`h-6 rounded px-1.5 text-2xs`,sm:`h-7 px-2.5 text-xs`,md:`h-8 px-3 text-sm`,lg:`h-9 px-3.5 text-base`,icon:`h-6 w-6 rounded p-0`,"icon-md":`h-8 w-8 p-0`,card:`h-auto w-full flex-col items-stretch justify-start gap-1 px-[11px] py-2.5 text-left whitespace-normal`}},defaultVariants:{variant:`outline`,size:`md`}});function c({className:o,variant:c,size:l,asChild:u=!1,loading:d=!1,loadingLabel:f,disabled:p,type:m,children:h,...g}){let _=u?n.Root:`button`,v=!u&&d;return/* @__PURE__ */ i(_,{"data-slot":`button`,type:u?void 0:m??`button`,"aria-busy":v?!0:void 0,disabled:u?void 0:p??v,className:e(s({variant:c,size:l}),o),...g,children:u?h:/* @__PURE__ */ a(r,{children:[v?/* @__PURE__ */ i(t,{label:f}):null,h]})})}export{c as Button,s as buttonVariants};
|
|
2
|
+
//# sourceMappingURL=Button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.mjs","names":[],"sources":["../../../../src/components/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { Spinner } from './Spinner';\n\nexport const buttonVariants = cva(\n 'inline-flex min-h-6 min-w-6 shrink-0 cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-mono transition-[color,background-color,border-color,filter] outline-none focus-visible:ring-2 focus-visible:ring-doom-blue/50 disabled:pointer-events-none disabled:opacity-40 [&_svg]:pointer-events-none [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n primary: 'bg-doom-blue font-bold text-doom-rail hover:brightness-110',\n outline: 'border border-doom-border text-doom-dim hover:border-doom-blue/50 hover:text-doom-hi',\n ghost: 'text-doom-dim hover:bg-doom-panel hover:text-doom-hi',\n subtle: 'bg-doom-panel text-doom-dim hover:bg-doom-deep hover:text-doom-hi',\n danger: 'bg-doom-red font-bold text-doom-rail hover:brightness-110',\n 'danger-outline': 'border border-doom-edge-red bg-doom-tint-red font-bold text-doom-red hover:brightness-110',\n success: 'bg-doom-green font-bold text-doom-rail hover:brightness-110',\n link: 'text-doom-blue hover:underline',\n },\n size: {\n xs: 'h-6 rounded px-1.5 text-2xs',\n sm: 'h-7 px-2.5 text-xs',\n md: 'h-8 px-3 text-sm',\n lg: 'h-9 px-3.5 text-base',\n icon: 'h-6 w-6 rounded p-0',\n 'icon-md': 'h-8 w-8 p-0',\n /**\n * A whole card that is one click target: a session in the rail, a run\n * in a panel. It keeps the button's focus ring and cursor and gives up\n * the button's single-line box, which is what a card-shaped <button>\n * would otherwise have to restate.\n */\n card: 'h-auto w-full flex-col items-stretch justify-start gap-1 px-[11px] py-2.5 text-left whitespace-normal',\n },\n },\n defaultVariants: { variant: 'outline', size: 'md' },\n },\n);\n\nexport type ButtonVariant = NonNullable<VariantProps<typeof buttonVariants>['variant']>;\nexport type ButtonSize = NonNullable<VariantProps<typeof buttonVariants>['size']>;\n\nexport interface ButtonProps extends ComponentProps<'button'>, VariantProps<typeof buttonVariants> {\n /** Render the child element instead of a <button>, passing the classes down (shadcn's asChild). */\n asChild?: boolean;\n /**\n * Work is in flight: the button shows a spinner and stops accepting clicks.\n * Ignored under asChild, where the child owns its own content.\n */\n loading?: boolean;\n /** What the spinner announces while loading; omit it and the wait is silent. */\n loadingLabel?: string;\n}\n\n/** The one button: every variant is a theme token, so it recolours with the theme. */\nexport function Button({\n className,\n variant,\n size,\n asChild = false,\n loading = false,\n loadingLabel,\n disabled,\n type,\n children,\n ...props\n}: ButtonProps) {\n const Component = asChild ? Slot.Root : 'button';\n const busy = !asChild && loading;\n return (\n <Component\n data-slot=\"button\"\n type={asChild ? undefined : (type ?? 'button')}\n aria-busy={busy ? true : undefined}\n disabled={asChild ? undefined : (disabled ?? busy)}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n >\n {/* Slot takes exactly one child, so asChild hands its element straight through. */}\n {asChild ? (\n children\n ) : (\n <>\n {busy ? <Spinner label={loadingLabel} /> : null}\n {children}\n </>\n )}\n </Component>\n );\n}\n"],"mappings":"0NAOA,MAAa,EAAiB,EAC5B,yVACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,6DACT,QAAS,uFACT,MAAO,uDACP,OAAQ,oEACR,OAAQ,4DACR,iBAAkB,4FAClB,QAAS,8DACT,KAAM,gCACR,EACA,KAAM,CACJ,GAAI,8BACJ,GAAI,qBACJ,GAAI,mBACJ,GAAI,uBACJ,KAAM,sBACN,UAAW,cAOX,KAAM,uGACR,CACF,EACA,gBAAiB,CAAE,QAAS,UAAW,KAAM,IAAK,CACpD,CACF,EAkBA,SAAgB,EAAO,CACrB,YACA,UACA,OACA,UAAU,GACV,UAAU,GACV,eACA,WACA,OACA,WACA,GAAG,GACW,CACd,IAAM,EAAY,EAAU,EAAK,KAAO,SAClC,EAAO,CAAC,GAAW,EACzB,MACE,kBAAC,EAAD,CACE,YAAU,SACV,KAAM,EAAU,IAAA,GAAa,GAAQ,SACrC,YAAW,EAAO,GAAO,IAAA,GACzB,SAAU,EAAU,IAAA,GAAa,GAAY,EAC7C,UAAW,EAAG,EAAe,CAAE,UAAS,MAAK,CAAC,EAAG,CAAS,EAC1D,GAAI,EAGH,SAAA,EACC,EAEA,kBAAA,EAAA,CAAA,SAAA,CACG,EAAO,kBAAC,EAAD,CAAS,MAAO,CAAe,CAAA,EAAI,KAC1C,CACD,CAAA,CAAA,CAEK,CAAA,CAEf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.mts","names":[],"sources":["../../../../src/components/Checkbox.tsx"],"mappings":";;;;iBAOgB,aAAW,cAAc,SAAS,sBAAsB,SAAkB,wBAAK,IAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{CheckIcon as e}from"../icons/icons.mjs";import{cn as t}from"../lib/cn.mjs";import{Checkbox as n}from"radix-ui";import{jsx as r}from"react/jsx-runtime";function i({className:i,...a}){return/* @__PURE__ */ r(n.Root,{"data-slot":`checkbox`,className:t(`flex h-3.5 w-3.5 shrink-0 cursor-pointer items-center justify-center rounded-sm border border-doom-border bg-doom-deep outline-none transition-colors focus-visible:ring-2 focus-visible:ring-doom-blue/50 disabled:pointer-events-none disabled:opacity-40 data-[state=checked]:border-doom-blue data-[state=indeterminate]:border-doom-blue`,i),...a,children:/* @__PURE__ */ r(n.Indicator,{"data-slot":`checkbox-indicator`,className:`text-doom-blue`,children:/* @__PURE__ */ r(e,{className:`h-2.5 w-2.5`})})})}export{i as Checkbox};
|
|
2
|
+
//# sourceMappingURL=Checkbox.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.mjs","names":["Checkbox","CheckboxPrimitive"],"sources":["../../../../src/components/Checkbox.tsx"],"sourcesContent":["import { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { CheckIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\n\n/** A box that is on, off, or indeterminate; the tick is the accent on the deep well. */\nexport function Checkbox({ className, ...props }: ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'flex h-3.5 w-3.5 shrink-0 cursor-pointer items-center justify-center rounded-sm border border-doom-border bg-doom-deep outline-none transition-colors focus-visible:ring-2 focus-visible:ring-doom-blue/50 disabled:pointer-events-none disabled:opacity-40 data-[state=checked]:border-doom-blue data-[state=indeterminate]:border-doom-blue',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator data-slot=\"checkbox-indicator\" className=\"text-doom-blue\">\n <CheckIcon className=\"h-2.5 w-2.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n"],"mappings":"8JAOA,SAAgBA,EAAS,CAAE,YAAW,GAAG,GAAwD,CAC/F,MACE,kBAACC,EAAkB,KAAnB,CACE,YAAU,WACV,UAAW,EACT,gVACA,CACF,EACA,GAAI,EAEJ,SAAA,kBAACA,EAAkB,UAAnB,CAA6B,YAAU,qBAAqB,UAAU,iBACpE,SAAA,kBAAC,EAAD,CAAW,UAAU,aAAe,CAAA,CACT,CAAA,CACP,CAAA,CAE5B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{SyntaxText as e}from"./SyntaxText.mjs";import{fenceGrammarOf as t,fenceLanguageOf as n}from"../lib/fenceGrammar.mjs";import{CopyButton as r}from"./CopyButton.mjs";import{MermaidDiagram as i}from"./MermaidDiagram.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s({text:s,className:c}){let l=n(c),u=l===`mermaid`?/* @__PURE__ */ a(i,{code:s}):/* @__PURE__ */ a(e,{text:s,grammar:t(l),className:`overflow-x-auto text-sm leading-relaxed text-doom-text`});return/* @__PURE__ */ o(`div`,{"data-slot":`code-block`,"data-language":l??``,className:`relative rounded border border-doom-border bg-doom-deep p-2.5`,children:[u,/* @__PURE__ */ a(r,{text:s,className:`absolute top-1.5 right-1.5`})]})}export{s as CodeBlock};
|
|
2
|
+
//# sourceMappingURL=CodeBlock.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlock.mjs","names":[],"sources":["../../../../src/components/CodeBlock.tsx"],"sourcesContent":["import { fenceGrammarOf, fenceLanguageOf, MERMAID_LANGUAGE } from '../lib/fenceGrammar';\nimport { CopyButton } from './CopyButton';\nimport { MermaidDiagram } from './MermaidDiagram';\nimport { SyntaxText } from './SyntaxText';\n\n/**\n * A fenced code block: coloured, copyable, and a picture when it is mermaid.\n *\n * DESIGN PATTERNS:\n * - The fence's own word picks the grammar, and an unknown word means plain\n * text rather than a guess at the wrong language.\n * - Colour and the diagram both arrive asynchronously, so the block always has\n * the source on screen from the first frame of a streaming reply.\n *\n * AVOID:\n * - Reading the language anywhere but the fence. A block in a message has no\n * path, and guessing from the body colours prose as code.\n */\n\nexport interface CodeBlockProps {\n /** The block's source, without the fence lines. */\n text: string;\n /** The `language-*` class react-markdown puts on the inner <code>. */\n className?: string | undefined;\n}\n\nexport function CodeBlock({ text, className }: CodeBlockProps) {\n const language = fenceLanguageOf(className);\n const body =\n language === MERMAID_LANGUAGE ? (\n <MermaidDiagram code={text} />\n ) : (\n <SyntaxText\n text={text}\n grammar={fenceGrammarOf(language)}\n className=\"overflow-x-auto text-sm leading-relaxed text-doom-text\"\n />\n );\n return (\n <div\n data-slot=\"code-block\"\n data-language={language ?? ''}\n className=\"relative rounded border border-doom-border bg-doom-deep p-2.5\"\n >\n {body}\n <CopyButton text={text} className=\"absolute top-1.5 right-1.5\" />\n </div>\n );\n}\n"],"mappings":"kRA0BA,SAAgB,EAAU,CAAE,OAAM,aAA6B,CAC7D,IAAM,EAAW,EAAgB,CAAS,EACpC,EACJ,IAAA,UACE,kBAAC,EAAD,CAAgB,KAAM,CAAO,CAAA,EAE7B,kBAAC,EAAD,CACQ,OACN,QAAS,EAAe,CAAQ,EAChC,UAAU,wDACX,CAAA,EAEL,MACE,kBAAC,MAAD,CACE,YAAU,aACV,gBAAe,GAAY,GAC3B,UAAU,gEAHZ,SAAA,CAKG,EACD,kBAAC,EAAD,CAAkB,OAAM,UAAU,4BAA8B,CAAA,CAC7D,GAET"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditor.d.mts","names":[],"sources":["../../../../src/components/CodeEditor.tsx"],"mappings":";;wBAkBgB,aAAa,cAAc,SAAS,kCAAe,IAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as e}from"../lib/cn.mjs";import{Skeleton as t}from"./Skeleton.mjs";import{jsx as n}from"react/jsx-runtime";import{Suspense as r,lazy as i}from"react";const a=i(async()=>({default:(await import(`./CodeEditorView.mjs`)).CodeEditorView}));function o({className:i,...o}){return n(r,{fallback
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{Skeleton as t}from"./Skeleton.mjs";import{jsx as n}from"react/jsx-runtime";import{Suspense as r,lazy as i}from"react";const a=i(async()=>({default:(await import(`./CodeEditorView.mjs`)).CodeEditorView}));function o({className:i,...o}){return/* @__PURE__ */ n(r,{fallback:/* @__PURE__ */ n(t,{className:e(`min-h-0`,i)}),children:/* @__PURE__ */ n(a,{className:i,...o})})}export{o as CodeEditor};
|
|
2
2
|
//# sourceMappingURL=CodeEditor.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditor.mjs","names":[],"sources":["../../../../src/components/CodeEditor.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\n\nimport { cn } from '../lib/cn';\nimport type { CodeEditorProps } from '../types/editor';\nimport { Skeleton } from './Skeleton';\n\n/**\n * A code editor: line numbers, syntax colour, folding, undo, and a search\n * panel on the usual keys.\n *\n * The editor arrives as its own chunk. The cockpit is one bundle that every\n * session downloads, most of them without ever opening a file, and it is read\n * over a tunnel as often as over localhost; an editor nobody opened has no\n * business in that first load. What this module holds is the boundary, so the\n * cost is paid on the first render that asks for an editor and never again.\n */\nconst CodeEditorView = lazy(async () => ({ default: (await import('./CodeEditorView')).CodeEditorView }));\n\nexport function CodeEditor({ className, ...props }: CodeEditorProps) {\n return (\n <Suspense fallback={<Skeleton className={cn('min-h-0', className)} />}>\n <CodeEditorView className={className} {...props} />\n </Suspense>\n );\n}\n"],"mappings":"gKAgBA,MAAM,EAAiB,EAAK,UAAa,CAAE,SAAU,MAAM,OAAO,wBAAA,CAAqB,cAAe,EAAE,EAExG,SAAgB,EAAW,CAAE,YAAW,GAAG,GAA0B,CACnE,MACE,kBAAC,EAAD,CAAU,SAAU,kBAAC,EAAD,CAAU,UAAW,EAAG,UAAW,CAAS,CAAI,CAAA,EAClE,SAAA,kBAAC,EAAD,CAA2B,YAAW,GAAI,CAAQ,CAAA,CAC1C,CAAA,CAEd"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{grammarKeyOf as t,loadGrammar as n}from"../lib/editorLanguage.mjs";import{DOOM_EDITOR_STYLES as r,DOOM_SYNTAX_STYLES as i}from"../lib/editorTheme.mjs";import{boundedEditorEdits as a,boundedEditorRanges as o}from"../lib/editorController.mjs";import{jsx as s}from"react/jsx-runtime";import{useEffect as c,useImperativeHandle as l,useLayoutEffect as u,useRef as d}from"react";import{defaultKeymap as f,history as p,historyKeymap as m,indentWithTab as h}from"@codemirror/commands";import{HighlightStyle as g,bracketMatching as _,foldGutter as v,foldKeymap as y,indentOnInput as b,syntaxHighlighting as x}from"@codemirror/language";import{highlightSelectionMatches as S,search as C,searchKeymap as w}from"@codemirror/search";import{Compartment as T,EditorState as E,StateEffect as D,StateField as O}from"@codemirror/state";import{Decoration as k,EditorView as A,WidgetType as j,drawSelection as M,highlightActiveLine as N,highlightActiveLineGutter as P,keymap as F,lineNumbers as I,rectangularSelection as L}from"@codemirror/view";import{tags as R}from"@lezer/highlight";function z(e,t,n){let r=Math.min(t,n),i=Math.max(t,n);return{text:e.state.sliceDoc(r,i),from:r,to:i,startLine:e.state.doc.lineAt(r).number,endLine:e.state.doc.lineAt(i).number}}function B(e,t){let n=e.posAtCoords({x:t.left,y:t.top}),r=e.posAtCoords({x:t.right,y:t.bottom});return n===null||r===null?null:z(e,n,r)}const V=A.theme(r),H=g.define([{tag:R.comment,...i.comment},{tag:R.keyword,...i.keyword},{tag:[R.atom,R.bool,R.null,R.self],...i.constant},{tag:R.number,...i.literal},{tag:[R.string,R.special(R.string),R.character],...i.string},{tag:R.regexp,...i.regexp},{tag:R.operator,...i.operator},{tag:R.punctuation,...i.punctuation},{tag:R.variableName,...i.variable},{tag:R.propertyName,...i.property},{tag:[R.function(R.variableName),R.function(R.propertyName)],...i.callable},{tag:[R.typeName,R.className,R.namespace],...i.type},{tag:R.tagName,...i.tag},{tag:R.attributeName,...i.attribute},{tag:[R.meta,R.processingInstruction],...i.meta},{tag:R.heading,...i.heading},{tag:[R.link,R.url],...i.link},{tag:R.emphasis,...i.emphasis},{tag:R.strong,...i.strong},{tag:R.strikethrough,...i.strikethrough},{tag:R.invalid,...i.invalid}]),U=D.define(),W=O.define({create:()=>k.none,update:(e,t)=>{let n=e.map(t.changes);for(let e of t.effects)e.is(U)&&(n=e.value);return n},provide:e=>A.decorations.from(e)}),G=D.define(),K=O.define({create:()=>k.none,update:(e,t)=>{let n=e.map(t.changes);for(let e of t.effects)e.is(G)&&(n=e.value);return n},provide:e=>A.decorations.from(e)});var q=class extends j{label;constructor(e){super(),this.label=e}eq(e){return e.label===this.label}toDOM(){let e=document.createElement(`span`);return e.className=`cm-marked-region-label`,e.dataset.authorRegionLabel=this.label,e.textContent=this.label,e}};const J=A.baseTheme({".cm-marked-region":{backgroundColor:`var(--doom-tint-yellow)`,borderBottom:`1px solid var(--doom-edge-yellow)`},".cm-marked-region-label":{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:`16px`,height:`16px`,marginRight:`4px`,borderRadius:`999px`,backgroundColor:`var(--doom-yellow)`,color:`var(--doom-deep)`,fontSize:`9px`,fontWeight:`700`,lineHeight:`1`,verticalAlign:`text-bottom`}}),Y=[I(),P(),v(),N(),M(),L(),b(),_(),p(),C({top:!0}),S(),F.of([...f,...m,...w,...y,h]),x(H),W,K,J,V];function X({value:r,path:i,readOnly:f=!1,lineWrapping:p=!0,className:m,onChange:h,onSelect:g,controllerRef:_,"data-testid":v}){let y=d(null),b=d(null),x=d({onChange:h,onSelect:g}),S=d(r),C=d({language:new T,readOnly:new T,wrapping:new T});return c(()=>{x.current={onChange:h,onSelect:g}}),u(()=>{let e=y.current;if(e===null)return;let{language:t,readOnly:n,wrapping:r}=C.current,i=new A({parent:e,state:E.create({doc:S.current,extensions:[...Y,t.of([]),n.of([]),r.of([]),A.updateListener.of(e=>{if(e.docChanged&&x.current.onChange?.(e.state.doc.toString()),!e.selectionSet&&!e.docChanged)return;let t=x.current.onSelect;if(t===void 0)return;let n=e.state.selection.main;t(z(e.view,n.from,n.to))})]})});return b.current=i,()=>{i.destroy(),b.current=null}},[]),l(_,()=>({focus:()=>b.current?.focus(),revealAndSelect:e=>{let t=b.current;if(t===null)return;let[n]=o(t.state.doc.length,[e]);n!==void 0&&t.dispatch({selection:{anchor:n.from,head:n.to},effects:A.scrollIntoView(n.from,{y:`center`})})},applyEdits:e=>{let t=b.current;t!==null&&e.length!==0&&t.dispatch({changes:a(t.state.doc.length,e)})},setClosedRanges:e=>{let t=b.current;if(t===null)return;let n=o(t.state.doc.length,e).map(e=>e.from===e.to?k.line({attributes:{class:`cm-closed-tone`,"data-tone":`closed`}}).range(t.state.doc.lineAt(e.from).from):k.mark({class:`cm-closed-tone`,attributes:{"data-tone":`closed`}}).range(e.from,e.to));t.dispatch({effects:U.of(k.set(n))})},setMarkedRanges:e=>{let t=b.current;if(t===null)return;let n=e.flatMap(e=>{let[n]=o(t.state.doc.length,[e]);return n===void 0||n.from===n.to?[]:[k.widget({widget:new q(e.label),side:-1}).range(n.from),k.mark({class:`cm-marked-region`,attributes:{"data-author-region":e.label}}).range(n.from,n.to)]});t.dispatch({effects:G.of(k.set(n,!0))})},resolveViewportRegion:e=>{let t=b.current;return t===null?null:B(t,e)}}),[]),c(()=>{let e=b.current;e!==null&&e.state.doc.toString()!==r&&e.dispatch({changes:{from:0,to:e.state.doc.length,insert:r}})},[r]),c(()=>{b.current?.dispatch({effects:C.current.readOnly.reconfigure([E.readOnly.of(f),A.editable.of(!f)])})},[f]),c(()=>{b.current?.dispatch({effects:C.current.wrapping.reconfigure(p?A.lineWrapping:[])})},[p]),c(()=>{let e=i===void 0?void 0:t(i),{language:r}=C.current;if(e===void 0){b.current?.dispatch({effects:r.reconfigure([])});return}let a=!1;return n(e).then(e=>{a||b.current?.dispatch({effects:r.reconfigure(e)})}).catch(()=>{a||b.current?.dispatch({effects:r.reconfigure([])})}),()=>{a=!0}},[i]),/* @__PURE__ */ s(`div`,{ref:y,"data-testid":v,className:e(`min-h-0 overflow-hidden`,m)})}export{X as CodeEditorView,B as resolveEditorViewportRegion};
|
|
2
|
+
//# sourceMappingURL=CodeEditorView.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditorView.mjs","names":[],"sources":["../../../../src/components/CodeEditorView.tsx"],"sourcesContent":["import { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands';\nimport {\n bracketMatching,\n foldGutter,\n foldKeymap,\n HighlightStyle,\n indentOnInput,\n syntaxHighlighting,\n} from '@codemirror/language';\nimport { highlightSelectionMatches, search, searchKeymap } from '@codemirror/search';\nimport { Compartment, EditorState, StateEffect, StateField } from '@codemirror/state';\nimport {\n Decoration,\n type DecorationSet,\n drawSelection,\n EditorView,\n highlightActiveLine,\n highlightActiveLineGutter,\n keymap,\n lineNumbers,\n rectangularSelection,\n WidgetType,\n} from '@codemirror/view';\nimport { tags } from '@lezer/highlight';\nimport { useEffect, useImperativeHandle, useLayoutEffect, useRef } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { boundedEditorEdits, boundedEditorRanges } from '../lib/editorController';\nimport { grammarKeyOf, loadGrammar } from '../lib/editorLanguage';\nimport { DOOM_EDITOR_STYLES, DOOM_SYNTAX_STYLES } from '../lib/editorTheme';\nimport type { CodeEditorProps, EditorSelectionRange, EditorViewportRectangle } from '../types/editor';\n\nfunction selectionRange(editor: { readonly state: EditorState }, from: number, to: number): EditorSelectionRange {\n const start = Math.min(from, to);\n const end = Math.max(from, to);\n return {\n text: editor.state.sliceDoc(start, end),\n from: start,\n to: end,\n startLine: editor.state.doc.lineAt(start).number,\n endLine: editor.state.doc.lineAt(end).number,\n };\n}\n\nexport function resolveEditorViewportRegion(\n editor: {\n readonly state: EditorState;\n posAtCoords(coords: { x: number; y: number }): number | null;\n },\n rectangle: EditorViewportRectangle,\n): EditorSelectionRange | null {\n const start = editor.posAtCoords({ x: rectangle.left, y: rectangle.top });\n const end = editor.posAtCoords({ x: rectangle.right, y: rectangle.bottom });\n if (start === null || end === null) return null;\n return selectionRange(editor, start, end);\n}\n/**\n * The editor itself, mounted on a real CodeMirror view.\n *\n * Nothing imports this module directly: `CodeEditor` reaches it through a lazy\n * import so the whole editor, and every grammar under it, stays out of the\n * cockpit's first load. Behaviour lives here rather than in that wrapper so\n * the split costs one file and no indirection.\n *\n * The three things a caller can change after mount each sit in their own\n * compartment. Reconfiguring one is a transaction; rebuilding the editor would\n * throw away the undo history, the scroll position and the cursor, which is\n * what a reader loses if a parent re-render is allowed to remount this.\n */\n\n/** Not a colour or a layout choice: how CodeMirror is told to draw the doom palette. */\nconst DOOM_THEME = EditorView.theme(DOOM_EDITOR_STYLES);\n\nconst DOOM_HIGHLIGHT = HighlightStyle.define([\n { tag: tags.comment, ...DOOM_SYNTAX_STYLES.comment },\n { tag: tags.keyword, ...DOOM_SYNTAX_STYLES.keyword },\n { tag: [tags.atom, tags.bool, tags.null, tags.self], ...DOOM_SYNTAX_STYLES.constant },\n { tag: tags.number, ...DOOM_SYNTAX_STYLES.literal },\n { tag: [tags.string, tags.special(tags.string), tags.character], ...DOOM_SYNTAX_STYLES.string },\n { tag: tags.regexp, ...DOOM_SYNTAX_STYLES.regexp },\n { tag: tags.operator, ...DOOM_SYNTAX_STYLES.operator },\n { tag: tags.punctuation, ...DOOM_SYNTAX_STYLES.punctuation },\n { tag: tags.variableName, ...DOOM_SYNTAX_STYLES.variable },\n { tag: tags.propertyName, ...DOOM_SYNTAX_STYLES.property },\n { tag: [tags.function(tags.variableName), tags.function(tags.propertyName)], ...DOOM_SYNTAX_STYLES.callable },\n { tag: [tags.typeName, tags.className, tags.namespace], ...DOOM_SYNTAX_STYLES.type },\n { tag: tags.tagName, ...DOOM_SYNTAX_STYLES.tag },\n { tag: tags.attributeName, ...DOOM_SYNTAX_STYLES.attribute },\n { tag: [tags.meta, tags.processingInstruction], ...DOOM_SYNTAX_STYLES.meta },\n { tag: tags.heading, ...DOOM_SYNTAX_STYLES.heading },\n { tag: [tags.link, tags.url], ...DOOM_SYNTAX_STYLES.link },\n { tag: tags.emphasis, ...DOOM_SYNTAX_STYLES.emphasis },\n { tag: tags.strong, ...DOOM_SYNTAX_STYLES.strong },\n { tag: tags.strikethrough, ...DOOM_SYNTAX_STYLES.strikethrough },\n { tag: tags.invalid, ...DOOM_SYNTAX_STYLES.invalid },\n]);\n\nconst setClosedDecorations = StateEffect.define<DecorationSet>();\nconst closedDecorations = StateField.define<DecorationSet>({\n create: () => Decoration.none,\n update: (decorations, transaction) => {\n let next = decorations.map(transaction.changes);\n for (const effect of transaction.effects) {\n if (effect.is(setClosedDecorations)) next = effect.value;\n }\n return next;\n },\n provide: (field) => EditorView.decorations.from(field),\n});\n\nconst setMarkedDecorations = StateEffect.define<DecorationSet>();\nconst markedDecorations = StateField.define<DecorationSet>({\n create: () => Decoration.none,\n update: (decorations, transaction) => {\n let next = decorations.map(transaction.changes);\n for (const effect of transaction.effects) {\n if (effect.is(setMarkedDecorations)) next = effect.value;\n }\n return next;\n },\n provide: (field) => EditorView.decorations.from(field),\n});\n\nclass MarkedRangeLabel extends WidgetType {\n constructor(private readonly label: string) {\n super();\n }\n\n eq(other: MarkedRangeLabel): boolean {\n return other.label === this.label;\n }\n\n toDOM(): HTMLElement {\n const label = document.createElement('span');\n label.className = 'cm-marked-region-label';\n label.dataset.authorRegionLabel = this.label;\n label.textContent = this.label;\n return label;\n }\n}\n\nconst MARKED_REGION_THEME = EditorView.baseTheme({\n '.cm-marked-region': {\n backgroundColor: 'var(--doom-tint-yellow)',\n borderBottom: '1px solid var(--doom-edge-yellow)',\n },\n '.cm-marked-region-label': {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n minWidth: '16px',\n height: '16px',\n marginRight: '4px',\n borderRadius: '999px',\n backgroundColor: 'var(--doom-yellow)',\n color: 'var(--doom-deep)',\n fontSize: '9px',\n fontWeight: '700',\n lineHeight: '1',\n verticalAlign: 'text-bottom',\n },\n});\n\n/** Everything that never changes for the life of an editor. */\nconst FIXED_EXTENSIONS = [\n lineNumbers(),\n highlightActiveLineGutter(),\n foldGutter(),\n highlightActiveLine(),\n drawSelection(),\n rectangularSelection(),\n indentOnInput(),\n bracketMatching(),\n history(),\n search({ top: true }),\n highlightSelectionMatches(),\n // Tab indents rather than leaving the editor. That trades a keyboard user's\n // escape route for the behaviour every other editor has, so it is last in\n // the keymap and Escape then Tab still moves focus out.\n keymap.of([...defaultKeymap, ...historyKeymap, ...searchKeymap, ...foldKeymap, indentWithTab]),\n syntaxHighlighting(DOOM_HIGHLIGHT),\n closedDecorations,\n markedDecorations,\n MARKED_REGION_THEME,\n DOOM_THEME,\n];\n\nexport function CodeEditorView({\n value,\n path,\n readOnly = false,\n lineWrapping = true,\n className,\n onChange,\n onSelect,\n controllerRef,\n 'data-testid': testId,\n}: CodeEditorProps) {\n const host = useRef<HTMLDivElement>(null);\n const view = useRef<EditorView | null>(null);\n // The callbacks are new objects on every parent render. Reading them through\n // a ref is what lets the editor be built once and still call the current\n // pair, rather than being rebuilt whenever the parent re-renders.\n const handlers = useRef({ onChange, onSelect });\n // The document is seeded once from the value of the first render; the sync effect\n // below owns every later change.\n const initialValue = useRef(value);\n const compartments = useRef({\n language: new Compartment(),\n readOnly: new Compartment(),\n wrapping: new Compartment(),\n });\n\n useEffect(() => {\n handlers.current = { onChange, onSelect };\n });\n\n useLayoutEffect(() => {\n const parent = host.current;\n if (parent === null) return;\n const { language, readOnly: readOnlyPart, wrapping } = compartments.current;\n const editor = new EditorView({\n parent,\n state: EditorState.create({\n // The initial document only; every later change arrives as a\n // transaction from the effect below.\n doc: initialValue.current,\n extensions: [\n ...FIXED_EXTENSIONS,\n language.of([]),\n readOnlyPart.of([]),\n wrapping.of([]),\n EditorView.updateListener.of((update) => {\n if (update.docChanged) handlers.current.onChange?.(update.state.doc.toString());\n if (!update.selectionSet && !update.docChanged) return;\n const report = handlers.current.onSelect;\n if (report === undefined) return;\n const range = update.state.selection.main;\n report(selectionRange(update.view, range.from, range.to));\n }),\n ],\n }),\n });\n view.current = editor;\n return () => {\n editor.destroy();\n view.current = null;\n };\n // Built once.\n }, []);\n\n useImperativeHandle(\n controllerRef,\n () => ({\n focus: () => view.current?.focus(),\n revealAndSelect: (range) => {\n const editor = view.current;\n if (editor === null) return;\n const [bounded] = boundedEditorRanges(editor.state.doc.length, [range]);\n if (bounded === undefined) return;\n editor.dispatch({\n selection: { anchor: bounded.from, head: bounded.to },\n effects: EditorView.scrollIntoView(bounded.from, { y: 'center' }),\n });\n },\n applyEdits: (edits) => {\n const editor = view.current;\n if (editor === null || edits.length === 0) return;\n editor.dispatch({ changes: boundedEditorEdits(editor.state.doc.length, edits) });\n },\n setClosedRanges: (ranges) => {\n const editor = view.current;\n if (editor === null) return;\n const bounded = boundedEditorRanges(editor.state.doc.length, ranges);\n const decorations = bounded.map((range) =>\n range.from === range.to\n ? Decoration.line({ attributes: { class: 'cm-closed-tone', 'data-tone': 'closed' } }).range(\n editor.state.doc.lineAt(range.from).from,\n )\n : Decoration.mark({ class: 'cm-closed-tone', attributes: { 'data-tone': 'closed' } }).range(\n range.from,\n range.to,\n ),\n );\n editor.dispatch({ effects: setClosedDecorations.of(Decoration.set(decorations)) });\n },\n setMarkedRanges: (ranges) => {\n const editor = view.current;\n if (editor === null) return;\n const decorations = ranges.flatMap((range) => {\n const [bounded] = boundedEditorRanges(editor.state.doc.length, [range]);\n if (bounded === undefined || bounded.from === bounded.to) return [];\n return [\n Decoration.widget({ widget: new MarkedRangeLabel(range.label), side: -1 }).range(bounded.from),\n Decoration.mark({\n class: 'cm-marked-region',\n attributes: { 'data-author-region': range.label },\n }).range(bounded.from, bounded.to),\n ];\n });\n editor.dispatch({ effects: setMarkedDecorations.of(Decoration.set(decorations, true)) });\n },\n resolveViewportRegion: (rectangle) => {\n const editor = view.current;\n return editor === null ? null : resolveEditorViewportRegion(editor, rectangle);\n },\n }),\n [],\n );\n\n useEffect(() => {\n const editor = view.current;\n // A caller that echoes onChange back into `value` would otherwise replace\n // the document on every keystroke and drop the cursor to the end.\n if (editor === null || editor.state.doc.toString() === value) return;\n editor.dispatch({ changes: { from: 0, to: editor.state.doc.length, insert: value } });\n }, [value]);\n\n useEffect(() => {\n view.current?.dispatch({\n effects: compartments.current.readOnly.reconfigure([\n EditorState.readOnly.of(readOnly),\n EditorView.editable.of(!readOnly),\n ]),\n });\n }, [readOnly]);\n\n useEffect(() => {\n view.current?.dispatch({\n effects: compartments.current.wrapping.reconfigure(lineWrapping ? EditorView.lineWrapping : []),\n });\n }, [lineWrapping]);\n\n useEffect(() => {\n const key = path === undefined ? undefined : grammarKeyOf(path);\n const { language } = compartments.current;\n if (key === undefined) {\n view.current?.dispatch({ effects: language.reconfigure([]) });\n return;\n }\n let cancelled = false;\n void loadGrammar(key)\n .then((grammar) => {\n if (!cancelled) view.current?.dispatch({ effects: language.reconfigure(grammar) });\n })\n .catch(() => {\n // A grammar is a separate chunk over the network, and the cockpit is\n // often read through a tunnel. Losing it costs syntax colour, not the\n // file, so fall back to plain text rather than failing the pane.\n if (!cancelled) view.current?.dispatch({ effects: language.reconfigure([]) });\n });\n return () => {\n cancelled = true;\n };\n }, [path]);\n\n return <div ref={host} data-testid={testId} className={cn('min-h-0 overflow-hidden', className)} />;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Collapsible } from "radix-ui";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
//#region src/components/Collapsible.d.ts
|
|
4
|
+
/** A section that folds; Radix keeps the trigger's aria-expanded in step with the content. */
|
|
5
|
+
declare function Collapsible$1(props: ComponentProps<typeof Collapsible.Root>): import("react").JSX.Element;
|
|
6
|
+
export declare function CollapsibleTrigger(props: ComponentProps<typeof Collapsible.CollapsibleTrigger>): import("react").JSX.Element;
|
|
7
|
+
export declare function CollapsibleContent({ className, ...props }: ComponentProps<typeof Collapsible.CollapsibleContent>): import("react").JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Collapsible$1 as Collapsible };
|
|
10
|
+
//# sourceMappingURL=Collapsible.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collapsible.d.mts","names":[],"sources":["../../../../src/components/Collapsible.tsx"],"mappings":";;;;iBAMgB,cAAY,OAAO,sBAAsB,YAAqB,wBAAK,IAAA;wBAInE,mBAAmB,OAAO,sBAAsB,YAAqB,sCAAmB,IAAA;wBAIxF,qBACd,cACG,SACF,sBAAsB,YAAqB,sCAAmB,IAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{Collapsible as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";function r(e){return/* @__PURE__ */ n(t.Root,{"data-slot":`collapsible`,...e})}function i(e){return/* @__PURE__ */ n(t.CollapsibleTrigger,{"data-slot":`collapsible-trigger`,...e})}function a({className:r,...i}){return/* @__PURE__ */ n(t.CollapsibleContent,{"data-slot":`collapsible-content`,className:e(`overflow-hidden`,r),...i})}export{r as Collapsible,a as CollapsibleContent,i as CollapsibleTrigger};
|
|
2
|
+
//# sourceMappingURL=Collapsible.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collapsible.mjs","names":["Collapsible","CollapsiblePrimitive"],"sources":["../../../../src/components/Collapsible.tsx"],"sourcesContent":["import { Collapsible as CollapsiblePrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** A section that folds; Radix keeps the trigger's aria-expanded in step with the content. */\nexport function Collapsible(props: ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nexport function CollapsibleTrigger(props: ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />;\n}\n\nexport function CollapsibleContent({\n className,\n ...props\n}: ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return (\n <CollapsiblePrimitive.CollapsibleContent\n data-slot=\"collapsible-content\"\n className={cn('overflow-hidden', className)}\n {...props}\n />\n );\n}\n"],"mappings":"kHAMA,SAAgBA,EAAY,EAAyD,CACnF,MAAO,kBAACC,EAAqB,KAAtB,CAA2B,YAAU,cAAc,GAAI,CAAQ,CAAA,CACxE,CAEA,SAAgB,EAAmB,EAAuE,CACxG,MAAO,kBAACA,EAAqB,mBAAtB,CAAyC,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAC9F,CAEA,SAAgB,EAAmB,CACjC,YACA,GAAG,GAC8D,CACjE,MACE,kBAACA,EAAqB,mBAAtB,CACE,YAAU,sBACV,UAAW,EAAG,kBAAmB,CAAS,EAC1C,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DialogContentProps } from "./Dialog.mjs";
|
|
2
|
+
import { InputProps } from "./Input.mjs";
|
|
3
|
+
import { OptionRowProps } from "./OptionList.mjs";
|
|
4
|
+
import { ComponentProps, ReactNode } from "react";
|
|
5
|
+
//#region src/components/Command.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* The command palette's frame, its search strip, its rows, and its hint.
|
|
8
|
+
*
|
|
9
|
+
* It has no Radix counterpart and it deliberately does no filtering: the
|
|
10
|
+
* surface that opens a palette already knows how to rank its own commands,
|
|
11
|
+
* and a matcher baked in here would be a second, worse one. Built on Dialog,
|
|
12
|
+
* Input, and the option row so a palette and a select popover cannot drift
|
|
13
|
+
* apart, rather than on a new dependency.
|
|
14
|
+
*/
|
|
15
|
+
export interface CommandDialogProps extends Omit<DialogContentProps, 'title'> {
|
|
16
|
+
open: boolean;
|
|
17
|
+
onOpenChange: (open: boolean) => void;
|
|
18
|
+
/** Names the dialog for assistive tech; visually hidden unless the palette draws its own heading. */
|
|
19
|
+
title: ReactNode;
|
|
20
|
+
titleVisible?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function CommandDialog({ open, onOpenChange, title, titleVisible, className, children, width, ...props }: CommandDialogProps): import("react").JSX.Element;
|
|
23
|
+
/** The strip the search field sits in. */
|
|
24
|
+
export declare function CommandHeader({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
25
|
+
/** The search field: bare, because the header already draws the surface. */
|
|
26
|
+
export declare function CommandInput({ className, ...props }: InputProps): import("react").JSX.Element;
|
|
27
|
+
/** The scrolling body. It is the listbox, so its rows are the options. */
|
|
28
|
+
export declare function CommandList({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
29
|
+
/** A labelled run of rows. */
|
|
30
|
+
export declare function CommandGroup({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
31
|
+
export declare function CommandGroupLabel({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
32
|
+
/** One command. Compact by default, since a palette shows many at once. */
|
|
33
|
+
export declare function CommandItem({ density, ...props }: OptionRowProps): import("react").JSX.Element;
|
|
34
|
+
/** A command's name, taking the width the row has left. */
|
|
35
|
+
export declare function CommandItemLabel(props: ComponentProps<'span'>): import("react").JSX.Element;
|
|
36
|
+
/** What the palette says when nothing matches. */
|
|
37
|
+
export declare function CommandEmpty({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
38
|
+
/** The hint strip along the bottom: what the keys do. */
|
|
39
|
+
export declare function CommandFooter({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
40
|
+
//#endregion
|
|
41
|
+
//# sourceMappingURL=Command.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Command.d.mts","names":[],"sources":["../../../../src/components/Command.tsx"],"mappings":";;;;;;;;;;;;;;iBAiBiB,2BAA2B,KAAK;EAC/C;EACA,eAAe;;EAEf,OAAO;EACP;;wBAGc,gBACd,MACA,cACA,OACA,cACA,WACA,UACA,UACG,SACF,qCAAkB,IAAA;;wBAYL,gBAAgB,cAAc,SAAS,wCAAqB,IAAA;;wBAW5D,eAAe,cAAc,SAAS,6BAAU,IAAA;;wBAchD,cAAc,cAAc,SAAS,wCAAqB,IAAA;;wBAY1D,eAAe,cAAc,SAAS,wCAAqB,IAAA;wBAI3D,oBAAoB,cAAc,SAAS,wCAAqB,IAAA;;wBAWhE,cAAc,YAAwB,SAAS,iCAAc,IAAA;;wBAK7D,iBAAiB,OAAO,yCAAsB,IAAA;;wBAK9C,eAAe,cAAc,SAAS,wCAAqB,IAAA;;wBAW3D,gBAAgB,cAAc,SAAS,wCAAqB,IAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{Dialog as t,DialogContent as n,DialogTitle as r}from"./Dialog.mjs";import{Input as i}from"./Input.mjs";import{OptionLabel as a,OptionRow as o}from"./OptionList.mjs";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l({open:i,onOpenChange:a,title:o,titleVisible:l=!1,className:u,children:d,width:f=`lg`,...p}){return/* @__PURE__ */ s(t,{open:i,onOpenChange:a,children:/* @__PURE__ */ c(n,{"data-slot":`command-dialog`,width:f,className:e(`max-h-[70vh]`,u),...p,children:[/* @__PURE__ */ s(r,{className:l?void 0:`sr-only`,children:o}),d]})})}function u({className:t,...n}){return/* @__PURE__ */ s(`div`,{"data-slot":`command-header`,className:e(`flex shrink-0 items-center gap-2 border-b border-doom-border px-3 py-2.5`,t),...n})}function d({className:t,...n}){return/* @__PURE__ */ s(i,{"data-slot":`command-input`,variant:`bare`,autoFocus:!0,autoComplete:`off`,className:e(`flex-1`,t),...n})}function f({className:t,...n}){return/* @__PURE__ */ s(`div`,{role:`listbox`,"data-slot":`command-list`,className:e(`flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto p-1.5`,t),...n})}function p({className:t,...n}){return/* @__PURE__ */ s(`div`,{"data-slot":`command-group`,className:e(`flex flex-col gap-0.5`,t),...n})}function m({className:t,...n}){return/* @__PURE__ */ s(`div`,{"data-slot":`command-group-label`,className:e(`px-2 pt-2 pb-1 text-2xs font-bold tracking-wider text-doom-faint uppercase`,t),...n})}function h({density:e=`compact`,...t}){return/* @__PURE__ */ s(o,{"data-slot":`command-item`,density:e,...t})}function g(e){return/* @__PURE__ */ s(a,{"data-slot":`command-item-label`,density:`compact`,...e})}function _({className:t,...n}){return/* @__PURE__ */ s(`div`,{"data-slot":`command-empty`,className:e(`px-2 py-6 text-center text-sm text-doom-faint`,t),...n})}function v({className:t,...n}){return/* @__PURE__ */ s(`div`,{"data-slot":`command-footer`,className:e(`flex min-h-[30px] shrink-0 items-center justify-between gap-3 border-t border-doom-border-soft bg-doom-deep px-3 text-2xs text-doom-faint`,t),...n})}export{l as CommandDialog,_ as CommandEmpty,v as CommandFooter,p as CommandGroup,m as CommandGroupLabel,u as CommandHeader,d as CommandInput,h as CommandItem,g as CommandItemLabel,f as CommandList};
|
|
2
|
+
//# sourceMappingURL=Command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Command.mjs","names":[],"sources":["../../../../src/components/Command.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { Dialog, DialogContent, type DialogContentProps, DialogTitle } from './Dialog';\nimport { Input, type InputProps } from './Input';\nimport { OptionLabel, OptionRow, type OptionRowProps } from './OptionList';\n\n/**\n * The command palette's frame, its search strip, its rows, and its hint.\n *\n * It has no Radix counterpart and it deliberately does no filtering: the\n * surface that opens a palette already knows how to rank its own commands,\n * and a matcher baked in here would be a second, worse one. Built on Dialog,\n * Input, and the option row so a palette and a select popover cannot drift\n * apart, rather than on a new dependency.\n */\n\nexport interface CommandDialogProps extends Omit<DialogContentProps, 'title'> {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** Names the dialog for assistive tech; visually hidden unless the palette draws its own heading. */\n title: ReactNode;\n titleVisible?: boolean;\n}\n\nexport function CommandDialog({\n open,\n onOpenChange,\n title,\n titleVisible = false,\n className,\n children,\n width = 'lg',\n ...props\n}: CommandDialogProps) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent data-slot=\"command-dialog\" width={width} className={cn('max-h-[70vh]', className)} {...props}>\n <DialogTitle className={titleVisible ? undefined : 'sr-only'}>{title}</DialogTitle>\n {children}\n </DialogContent>\n </Dialog>\n );\n}\n\n/** The strip the search field sits in. */\nexport function CommandHeader({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-header\"\n className={cn('flex shrink-0 items-center gap-2 border-b border-doom-border px-3 py-2.5', className)}\n {...props}\n />\n );\n}\n\n/** The search field: bare, because the header already draws the surface. */\nexport function CommandInput({ className, ...props }: InputProps) {\n return (\n <Input\n data-slot=\"command-input\"\n variant=\"bare\"\n autoFocus\n autoComplete=\"off\"\n className={cn('flex-1', className)}\n {...props}\n />\n );\n}\n\n/** The scrolling body. It is the listbox, so its rows are the options. */\nexport function CommandList({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n role=\"listbox\"\n data-slot=\"command-list\"\n className={cn('flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto p-1.5', className)}\n {...props}\n />\n );\n}\n\n/** A labelled run of rows. */\nexport function CommandGroup({ className, ...props }: ComponentProps<'div'>) {\n return <div data-slot=\"command-group\" className={cn('flex flex-col gap-0.5', className)} {...props} />;\n}\n\nexport function CommandGroupLabel({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-group-label\"\n className={cn('px-2 pt-2 pb-1 text-2xs font-bold tracking-wider text-doom-faint uppercase', className)}\n {...props}\n />\n );\n}\n\n/** One command. Compact by default, since a palette shows many at once. */\nexport function CommandItem({ density = 'compact', ...props }: OptionRowProps) {\n return <OptionRow data-slot=\"command-item\" density={density} {...props} />;\n}\n\n/** A command's name, taking the width the row has left. */\nexport function CommandItemLabel(props: ComponentProps<'span'>) {\n return <OptionLabel data-slot=\"command-item-label\" density=\"compact\" {...props} />;\n}\n\n/** What the palette says when nothing matches. */\nexport function CommandEmpty({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-empty\"\n className={cn('px-2 py-6 text-center text-sm text-doom-faint', className)}\n {...props}\n />\n );\n}\n\n/** The hint strip along the bottom: what the keys do. */\nexport function CommandFooter({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-footer\"\n className={cn(\n 'flex min-h-[30px] shrink-0 items-center justify-between gap-3 border-t border-doom-border-soft bg-doom-deep px-3 text-2xs text-doom-faint',\n className,\n )}\n {...props}\n />\n );\n}\n"],"mappings":"iQAyBA,SAAgB,EAAc,CAC5B,OACA,eACA,QACA,eAAe,GACf,YACA,WACA,QAAQ,KACR,GAAG,GACkB,CACrB,MACE,kBAAC,EAAD,CAAc,OAAoB,eAChC,SAAA,kBAAC,EAAD,CAAe,YAAU,iBAAwB,QAAO,UAAW,EAAG,eAAgB,CAAS,EAAG,GAAI,EAAtG,SAAA,CACE,kBAAC,EAAD,CAAa,UAAW,EAAe,IAAA,GAAY,UAAY,SAAA,CAAmB,CAAA,EACjF,CACY,GACT,CAAA,CAEZ,CAGA,SAAgB,EAAc,CAAE,YAAW,GAAG,GAAgC,CAC5E,MACE,kBAAC,MAAD,CACE,YAAU,iBACV,UAAW,EAAG,2EAA4E,CAAS,EACnG,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAa,CAAE,YAAW,GAAG,GAAqB,CAChE,MACE,kBAAC,EAAD,CACE,YAAU,gBACV,QAAQ,OACR,UAAA,GACA,aAAa,MACb,UAAW,EAAG,SAAU,CAAS,EACjC,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAY,CAAE,YAAW,GAAG,GAAgC,CAC1E,MACE,kBAAC,MAAD,CACE,KAAK,UACL,YAAU,eACV,UAAW,EAAG,6DAA8D,CAAS,EACrF,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAa,CAAE,YAAW,GAAG,GAAgC,CAC3E,MAAO,kBAAC,MAAD,CAAK,YAAU,gBAAgB,UAAW,EAAG,wBAAyB,CAAS,EAAG,GAAI,CAAQ,CAAA,CACvG,CAEA,SAAgB,EAAkB,CAAE,YAAW,GAAG,GAAgC,CAChF,MACE,kBAAC,MAAD,CACE,YAAU,sBACV,UAAW,EAAG,6EAA8E,CAAS,EACrG,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAY,CAAE,UAAU,UAAW,GAAG,GAAyB,CAC7E,MAAO,kBAAC,EAAD,CAAW,YAAU,eAAwB,UAAS,GAAI,CAAQ,CAAA,CAC3E,CAGA,SAAgB,EAAiB,EAA+B,CAC9D,MAAO,kBAAC,EAAD,CAAa,YAAU,qBAAqB,QAAQ,UAAU,GAAI,CAAQ,CAAA,CACnF,CAGA,SAAgB,EAAa,CAAE,YAAW,GAAG,GAAgC,CAC3E,MACE,kBAAC,MAAD,CACE,YAAU,gBACV,UAAW,EAAG,gDAAiD,CAAS,EACxE,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAc,CAAE,YAAW,GAAG,GAAgC,CAC5E,MACE,kBAAC,MAAD,CACE,YAAU,iBACV,UAAW,EACT,4IACA,CACF,EACA,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{CheckIcon as e,CopyIcon as t}from"../icons/icons.mjs";import{cn as n}from"../lib/cn.mjs";import{Button as r}from"./Button.mjs";import{jsx as i}from"react/jsx-runtime";import{useCallback as a,useEffect as o,useState as s}from"react";const c={idle:`copy`,copied:`copied`,failed:`copying was blocked by the browser`};function l({text:l,className:u}){let[d,f]=s(`idle`);o(()=>{if(d===`idle`)return;let e=setTimeout(()=>f(`idle`),1500);return()=>clearTimeout(e)},[d]);let p=a(()=>{navigator.clipboard.writeText(l).then(()=>f(`copied`),()=>f(`failed`))},[l]),m=c[d];return/* @__PURE__ */ i(r,{type:`button`,variant:`ghost`,size:`icon`,"data-testid":`copy-button`,"data-state":d,title:m,"aria-label":m,onClick:p,className:n(`opacity-60 hover:opacity-100`,u),children:d===`copied`?/* @__PURE__ */ i(e,{className:`size-3 text-doom-green`}):/* @__PURE__ */ i(t,{className:`size-3`})})}export{l as CopyButton};
|
|
2
|
+
//# sourceMappingURL=CopyButton.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyButton.mjs","names":[],"sources":["../../../../src/components/CopyButton.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport { CheckIcon, CopyIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport { Button } from './Button';\n\n/**\n * Puts a piece of text on the clipboard and says so.\n *\n * DESIGN PATTERNS:\n * - Always visible, dimmed. Half the cockpit's surfaces are touched rather\n * than pointed at, and a control revealed by hover does not exist there.\n * - A refused clipboard is a state, not a crash: the label says the browser\n * blocked it and the text is still there to select by hand.\n */\n\n/** How long the control stays acknowledged before returning to its icon. */\nconst FEEDBACK_MS = 1500;\n\ntype CopyState = 'idle' | 'copied' | 'failed';\n\nconst LABELS: Readonly<Record<CopyState, string>> = {\n idle: 'copy',\n copied: 'copied',\n failed: 'copying was blocked by the browser',\n};\n\nexport interface CopyButtonProps {\n /** What lands on the clipboard. */\n text: string;\n className?: string | undefined;\n}\n\nexport function CopyButton({ text, className }: CopyButtonProps) {\n const [state, setState] = useState<CopyState>('idle');\n\n useEffect(() => {\n if (state === 'idle') return;\n const timer = setTimeout(() => setState('idle'), FEEDBACK_MS);\n return () => clearTimeout(timer);\n }, [state]);\n\n const copy = useCallback(() => {\n void navigator.clipboard.writeText(text).then(\n () => setState('copied'),\n () => setState('failed'),\n );\n }, [text]);\n\n const label = LABELS[state];\n return (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n data-testid=\"copy-button\"\n data-state={state}\n title={label}\n aria-label={label}\n onClick={copy}\n className={cn('opacity-60 hover:opacity-100', className)}\n >\n {state === 'copied' ? <CheckIcon className=\"size-3 text-doom-green\" /> : <CopyIcon className=\"size-3\" />}\n </Button>\n );\n}\n"],"mappings":"+OAiBA,MAIM,EAA8C,CAClD,KAAM,OACN,OAAQ,SACR,OAAQ,oCACV,EAQA,SAAgB,EAAW,CAAE,OAAM,aAA8B,CAC/D,GAAM,CAAC,EAAO,GAAY,EAAoB,MAAM,EAEpD,MAAgB,CACd,GAAI,IAAU,OAAQ,OACtB,IAAM,EAAQ,eAAiB,EAAS,MAAM,EAAG,IAAW,EAC5D,UAAa,aAAa,CAAK,CACjC,EAAG,CAAC,CAAK,CAAC,EAEV,IAAM,EAAO,MAAkB,CAC7B,UAAe,UAAU,UAAU,CAAI,CAAC,CAAC,SACjC,EAAS,QAAQ,MACjB,EAAS,QAAQ,CACzB,CACF,EAAG,CAAC,CAAI,CAAC,EAEH,EAAQ,EAAO,GACrB,MACE,kBAAC,EAAD,CACE,KAAK,SACL,QAAQ,QACR,KAAK,OACL,cAAY,cACZ,aAAY,EACZ,MAAO,EACP,aAAY,EACZ,QAAS,EACT,UAAW,EAAG,+BAAgC,CAAS,EAEtD,SAAA,IAAU,SAAW,kBAAC,EAAD,CAAW,UAAU,wBAA0B,CAAA,EAAI,kBAAC,EAAD,CAAU,UAAU,QAAU,CAAA,CACjG,CAAA,CAEZ"}
|