veryfront 0.1.997 → 0.1.998
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/esm/cli/templates/manifest.js +1 -1
- package/esm/deno.d.ts +7 -0
- package/esm/deno.js +11 -3
- package/esm/deps/esm.sh/react-dom@19.2.4.d.ts +2 -0
- package/esm/deps/esm.sh/react-dom@19.2.4.d.ts.map +1 -0
- package/esm/deps/esm.sh/react-dom@19.2.4.js +3 -0
- package/esm/react/react-dom.d.ts +3 -0
- package/esm/react/react-dom.d.ts.map +1 -0
- package/esm/react/react-dom.js +2 -0
- package/esm/src/agent/ag-ui/host-support.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/host-support.js +12 -0
- package/esm/src/agent/react/index.d.ts +4 -2
- package/esm/src/agent/react/index.d.ts.map +1 -1
- package/esm/src/agent/react/index.js +2 -1
- package/esm/src/agent/react/use-agent-metadata.d.ts +5 -0
- package/esm/src/agent/react/use-agent-metadata.d.ts.map +1 -1
- package/esm/src/agent/react/use-agent-metadata.js +18 -9
- package/esm/src/agent/react/use-agents.d.ts +33 -0
- package/esm/src/agent/react/use-agents.d.ts.map +1 -0
- package/esm/src/agent/react/use-agents.js +72 -0
- package/esm/src/agent/react/use-chat/index.d.ts +1 -1
- package/esm/src/agent/react/use-chat/index.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/types.d.ts +3 -2
- package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.d.ts +12 -1
- package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +47 -7
- package/esm/src/agent/react/use-chat/utils.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/utils.js +4 -0
- package/esm/src/agent/runtime/message-adapter.d.ts.map +1 -1
- package/esm/src/agent/runtime/message-adapter.js +3 -1
- package/esm/src/agent/runtime/text-generation-runtime-message-converter.d.ts.map +1 -1
- package/esm/src/agent/runtime/text-generation-runtime-message-converter.js +6 -2
- package/esm/src/chat/index.d.ts +17 -7
- package/esm/src/chat/index.d.ts.map +1 -1
- package/esm/src/chat/index.js +33 -7
- package/esm/src/chat/protocol.d.ts +13 -1
- package/esm/src/chat/protocol.d.ts.map +1 -1
- package/esm/src/chat/upload-handler.d.ts +55 -0
- package/esm/src/chat/upload-handler.d.ts.map +1 -0
- package/esm/src/chat/upload-handler.js +180 -0
- package/esm/src/discovery/import-rewriter.d.ts +1 -1
- package/esm/src/discovery/import-rewriter.d.ts.map +1 -1
- package/esm/src/discovery/import-rewriter.js +2 -0
- package/esm/src/discovery/transpiler.d.ts.map +1 -1
- package/esm/src/discovery/transpiler.js +2 -0
- package/esm/src/react/components/chat/agent-card.d.ts +84 -11
- package/esm/src/react/components/chat/agent-card.d.ts.map +1 -1
- package/esm/src/react/components/chat/agent-card.js +151 -57
- package/esm/src/react/components/chat/agent-picker.d.ts +166 -0
- package/esm/src/react/components/chat/agent-picker.d.ts.map +1 -0
- package/esm/src/react/components/chat/agent-picker.js +183 -0
- package/esm/src/react/components/chat/chat/components/animations.js +1 -1
- package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts +125 -3
- package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/attachment-pill.js +209 -25
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts +149 -0
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/attachments-panel.js +187 -0
- package/esm/src/react/components/chat/chat/components/branch-picker.d.ts +13 -2
- package/esm/src/react/components/chat/chat/components/branch-picker.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/branch-picker.js +6 -8
- package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts +20 -0
- package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.js +31 -0
- package/esm/src/react/components/chat/chat/components/code-block.d.ts +9 -1
- package/esm/src/react/components/chat/chat/components/code-block.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/code-block.js +14 -6
- package/esm/src/react/components/chat/chat/components/drop-zone.d.ts +11 -4
- package/esm/src/react/components/chat/chat/components/drop-zone.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/drop-zone.js +10 -8
- package/esm/src/react/components/chat/chat/components/empty-state.d.ts +2 -1
- package/esm/src/react/components/chat/chat/components/empty-state.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/empty-state.js +7 -8
- package/esm/src/react/components/chat/chat/components/inference-badge.d.ts +6 -2
- package/esm/src/react/components/chat/chat/components/inference-badge.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/inference-badge.js +5 -4
- package/esm/src/react/components/chat/chat/components/inline-citation.d.ts +9 -1
- package/esm/src/react/components/chat/chat/components/inline-citation.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/inline-citation.js +19 -20
- package/esm/src/react/components/chat/chat/components/message-actions.d.ts +28 -5
- package/esm/src/react/components/chat/chat/components/message-actions.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-actions.js +24 -36
- package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts +7 -2
- package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-edit-form.js +5 -5
- package/esm/src/react/components/chat/chat/components/message-feedback.d.ts +11 -1
- package/esm/src/react/components/chat/chat/components/message-feedback.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-feedback.js +9 -11
- package/esm/src/react/components/chat/chat/components/quick-actions.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/quick-actions.js +3 -1
- package/esm/src/react/components/chat/chat/components/reasoning.d.ts +66 -3
- package/esm/src/react/components/chat/chat/components/reasoning.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/reasoning.js +95 -21
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts +178 -12
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/sidebar.js +228 -45
- package/esm/src/react/components/chat/chat/components/skill-badge.d.ts +6 -1
- package/esm/src/react/components/chat/chat/components/skill-badge.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/skill-badge.js +6 -5
- package/esm/src/react/components/chat/chat/components/skill-tool.d.ts +37 -0
- package/esm/src/react/components/chat/chat/components/skill-tool.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/skill-tool.js +46 -0
- package/esm/src/react/components/chat/chat/components/sources.d.ts +55 -3
- package/esm/src/react/components/chat/chat/components/sources.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/sources.js +50 -16
- package/esm/src/react/components/chat/chat/components/step-indicator.d.ts +42 -3
- package/esm/src/react/components/chat/chat/components/step-indicator.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/step-indicator.js +55 -12
- package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/tab-switcher.js +3 -3
- package/esm/src/react/components/chat/chat/components/tool-ui.d.ts +96 -3
- package/esm/src/react/components/chat/chat/components/tool-ui.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/tool-ui.js +158 -36
- package/esm/src/react/components/chat/chat/composition/api.d.ts +4 -2
- package/esm/src/react/components/chat/chat/composition/api.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/api.js +4 -2
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts +112 -5
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.js +251 -61
- package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts +78 -0
- package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/composition/chat-empty-state.js +63 -0
- package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts +4 -1
- package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-empty.js +11 -10
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts +11 -3
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-message-list.js +81 -111
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts +4 -0
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-root.js +3 -1
- package/esm/src/react/components/chat/chat/composition/error-banner.d.ts +4 -0
- package/esm/src/react/components/chat/chat/composition/error-banner.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/error-banner.js +10 -7
- package/esm/src/react/components/chat/chat/composition/message.d.ts +123 -5
- package/esm/src/react/components/chat/chat/composition/message.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/message.js +332 -53
- package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts +6 -1
- package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/model-avatar.js +3 -4
- package/esm/src/react/components/chat/chat/composition/pending-message.d.ts +31 -0
- package/esm/src/react/components/chat/chat/composition/pending-message.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/composition/pending-message.js +31 -0
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts +4 -0
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts +1 -0
- package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts +29 -0
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/contexts/conversations-context.js +39 -0
- package/esm/src/react/components/chat/chat/contexts/index.d.ts +1 -1
- package/esm/src/react/components/chat/chat/contexts/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/index.js +1 -1
- package/esm/src/react/components/chat/chat/contexts/message-context.d.ts +2 -0
- package/esm/src/react/components/chat/chat/contexts/message-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-clipboard.d.ts +10 -0
- package/esm/src/react/components/chat/chat/hooks/use-clipboard.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-clipboard.js +34 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversation.d.ts +21 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversation.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversation.js +54 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversations.d.ts +67 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversations.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversations.js +317 -0
- package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts +27 -0
- package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-drop-zone.js +50 -0
- package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts +49 -0
- package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.js +120 -0
- package/esm/src/react/components/chat/chat/hooks/use-upload.d.ts +34 -0
- package/esm/src/react/components/chat/chat/hooks/use-upload.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-upload.js +147 -0
- package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.d.ts +37 -0
- package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.js +178 -0
- package/esm/src/react/components/chat/chat/index.d.ts +171 -31
- package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/index.js +371 -77
- package/esm/src/react/components/chat/chat/persistence/conversation-store.d.ts +63 -0
- package/esm/src/react/components/chat/chat/persistence/conversation-store.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/persistence/conversation-store.js +1 -0
- package/esm/src/react/components/chat/chat/persistence/local-conversation-store.d.ts +13 -0
- package/esm/src/react/components/chat/chat/persistence/local-conversation-store.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/persistence/local-conversation-store.js +102 -0
- package/esm/src/react/components/chat/chat/persistence/memory-conversation-store.d.ts +11 -0
- package/esm/src/react/components/chat/chat/persistence/memory-conversation-store.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/persistence/memory-conversation-store.js +33 -0
- package/esm/src/react/components/chat/chat/utils/message-parts.d.ts +4 -1
- package/esm/src/react/components/chat/chat/utils/message-parts.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/utils/message-parts.js +4 -0
- package/esm/src/react/components/chat/chat-actions.d.ts +164 -0
- package/esm/src/react/components/chat/chat-actions.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat-actions.js +191 -0
- package/esm/src/react/components/chat/chat-agent-picker.d.ts +50 -0
- package/esm/src/react/components/chat/chat-agent-picker.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat-agent-picker.js +40 -0
- package/esm/src/react/components/chat/chat-theme-scope.d.ts +26 -0
- package/esm/src/react/components/chat/chat-theme-scope.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat-theme-scope.js +27 -0
- package/esm/src/react/components/chat/chat-tokens-style.d.ts +21 -0
- package/esm/src/react/components/chat/chat-tokens-style.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat-tokens-style.js +24 -0
- package/esm/src/react/components/chat/chat.d.ts +5 -5
- package/esm/src/react/components/chat/chat.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat.js +5 -5
- package/esm/src/react/components/chat/color-mode.d.ts +46 -0
- package/esm/src/react/components/chat/color-mode.d.ts.map +1 -0
- package/esm/src/react/components/chat/color-mode.js +123 -0
- package/esm/src/react/components/chat/error-boundary.js +2 -2
- package/esm/src/react/components/chat/icons/index.d.ts +8 -0
- package/esm/src/react/components/chat/icons/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/icons/index.js +64 -0
- package/esm/src/react/components/chat/markdown.d.ts +24 -1
- package/esm/src/react/components/chat/markdown.d.ts.map +1 -1
- package/esm/src/react/components/chat/markdown.js +122 -38
- package/esm/src/react/components/chat/model-selector.d.ts +130 -8
- package/esm/src/react/components/chat/model-selector.d.ts.map +1 -1
- package/esm/src/react/components/chat/model-selector.js +148 -121
- package/esm/src/react/components/chat/theme.d.ts +9 -12
- package/esm/src/react/components/chat/theme.d.ts.map +1 -1
- package/esm/src/react/components/chat/theme.js +149 -93
- package/esm/src/react/components/chat/ui/alert.d.ts +30 -0
- package/esm/src/react/components/chat/ui/alert.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/alert.js +35 -0
- package/esm/src/react/components/chat/ui/app-shell.d.ts +155 -0
- package/esm/src/react/components/chat/ui/app-shell.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/app-shell.js +276 -0
- package/esm/src/react/components/chat/ui/avatar.d.ts +24 -0
- package/esm/src/react/components/chat/ui/avatar.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/avatar.js +44 -0
- package/esm/src/react/components/chat/ui/badge.d.ts +24 -0
- package/esm/src/react/components/chat/ui/badge.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/badge.js +30 -0
- package/esm/src/react/components/chat/ui/button.d.ts +44 -0
- package/esm/src/react/components/chat/ui/button.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/button.js +108 -0
- package/esm/src/react/components/chat/ui/card.d.ts +42 -0
- package/esm/src/react/components/chat/ui/card.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/card.js +55 -0
- package/esm/src/react/components/chat/ui/checkbox.d.ts +28 -0
- package/esm/src/react/components/chat/ui/checkbox.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/checkbox.js +36 -0
- package/esm/src/react/components/chat/ui/code-block.d.ts +89 -0
- package/esm/src/react/components/chat/ui/code-block.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/code-block.js +277 -0
- package/esm/src/react/components/chat/ui/collapsible.d.ts +30 -0
- package/esm/src/react/components/chat/ui/collapsible.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/collapsible.js +44 -0
- package/esm/src/react/components/chat/ui/command.d.ts +65 -0
- package/esm/src/react/components/chat/ui/command.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/command.js +121 -0
- package/esm/src/react/components/chat/ui/cva.d.ts +36 -0
- package/esm/src/react/components/chat/ui/cva.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/cva.js +45 -0
- package/esm/src/react/components/chat/ui/dialog.d.ts +55 -0
- package/esm/src/react/components/chat/ui/dialog.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/dialog.js +116 -0
- package/esm/src/react/components/chat/ui/drawer.d.ts +41 -0
- package/esm/src/react/components/chat/ui/drawer.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/drawer.js +92 -0
- package/esm/src/react/components/chat/ui/dropdown-menu.d.ts +63 -0
- package/esm/src/react/components/chat/ui/dropdown-menu.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/dropdown-menu.js +76 -0
- package/esm/src/react/components/chat/ui/file-type.d.ts +26 -0
- package/esm/src/react/components/chat/ui/file-type.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/file-type.js +235 -0
- package/esm/src/react/components/chat/ui/floating.d.ts +29 -0
- package/esm/src/react/components/chat/ui/floating.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/floating.js +90 -0
- package/esm/src/react/components/chat/ui/icon-button.d.ts +19 -0
- package/esm/src/react/components/chat/ui/icon-button.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/icon-button.js +20 -0
- package/esm/src/react/components/chat/ui/index.d.ts +43 -0
- package/esm/src/react/components/chat/ui/index.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/index.js +42 -0
- package/esm/src/react/components/chat/ui/input.d.ts +27 -0
- package/esm/src/react/components/chat/ui/input.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/input.js +41 -0
- package/esm/src/react/components/chat/ui/label.d.ts +29 -0
- package/esm/src/react/components/chat/ui/label.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/label.js +40 -0
- package/esm/src/react/components/chat/ui/list.d.ts +47 -0
- package/esm/src/react/components/chat/ui/list.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/list.js +40 -0
- package/esm/src/react/components/chat/ui/pill.d.ts +26 -0
- package/esm/src/react/components/chat/ui/pill.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/pill.js +39 -0
- package/esm/src/react/components/chat/ui/popover.d.ts +47 -0
- package/esm/src/react/components/chat/ui/popover.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/popover.js +68 -0
- package/esm/src/react/components/chat/ui/progress-bar.d.ts +20 -0
- package/esm/src/react/components/chat/ui/progress-bar.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/progress-bar.js +31 -0
- package/esm/src/react/components/chat/ui/radio.d.ts +25 -0
- package/esm/src/react/components/chat/ui/radio.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/radio.js +29 -0
- package/esm/src/react/components/chat/ui/scroll-fade.d.ts +23 -0
- package/esm/src/react/components/chat/ui/scroll-fade.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/scroll-fade.js +40 -0
- package/esm/src/react/components/chat/ui/select.d.ts +64 -0
- package/esm/src/react/components/chat/ui/select.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/select.js +148 -0
- package/esm/src/react/components/chat/ui/shimmer.d.ts +25 -0
- package/esm/src/react/components/chat/ui/shimmer.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/shimmer.js +24 -0
- package/esm/src/react/components/chat/ui/skeleton.d.ts +14 -0
- package/esm/src/react/components/chat/ui/skeleton.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/skeleton.js +12 -0
- package/esm/src/react/components/chat/ui/slot.d.ts +21 -0
- package/esm/src/react/components/chat/ui/slot.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/slot.js +70 -0
- package/esm/src/react/components/chat/ui/status.d.ts +28 -0
- package/esm/src/react/components/chat/ui/status.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/status.js +23 -0
- package/esm/src/react/components/chat/ui/switch.d.ts +34 -0
- package/esm/src/react/components/chat/ui/switch.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/switch.js +58 -0
- package/esm/src/react/components/chat/ui/tabs.d.ts +44 -0
- package/esm/src/react/components/chat/ui/tabs.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/tabs.js +51 -0
- package/esm/src/react/components/chat/ui/tag.d.ts +22 -0
- package/esm/src/react/components/chat/ui/tag.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/tag.js +27 -0
- package/esm/src/react/components/chat/ui/textarea.d.ts +22 -0
- package/esm/src/react/components/chat/ui/textarea.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/textarea.js +35 -0
- package/esm/src/react/components/chat/ui/tooltip.d.ts +40 -0
- package/esm/src/react/components/chat/ui/tooltip.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/tooltip.js +132 -0
- package/esm/src/react/primitives/input-box.d.ts.map +1 -1
- package/esm/src/react/primitives/input-box.js +17 -4
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +9437 -1064
- package/esm/src/server/handlers/dev/projects/html-shell.d.ts +1 -1
- package/esm/src/server/handlers/dev/projects/html-shell.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/projects/html-shell.js +1 -12
- package/esm/src/server/handlers/request/public-agents-list.handler.d.ts +18 -0
- package/esm/src/server/handlers/request/public-agents-list.handler.d.ts.map +1 -0
- package/esm/src/server/handlers/request/public-agents-list.handler.js +44 -0
- package/esm/src/server/runtime-handler/index.d.ts +1 -1
- package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/index.js +3 -0
- package/esm/src/studio/bridge/bridge-bundle.generated.d.ts +1 -1
- package/esm/src/studio/bridge/bridge-bundle.generated.d.ts.map +1 -1
- package/esm/src/studio/bridge/bridge-bundle.generated.js +3 -2
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/workflow/blob/local-storage.d.ts +32 -0
- package/esm/src/workflow/blob/local-storage.d.ts.map +1 -0
- package/esm/src/workflow/blob/local-storage.js +179 -0
- package/esm/src/workflow/blob/types.d.ts +5 -0
- package/esm/src/workflow/blob/types.d.ts.map +1 -1
- package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts +11 -0
- package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts.map +1 -1
- package/esm/src/workflow/blob/veryfront-cloud-storage.js +36 -0
- package/package.json +5 -1
- package/esm/src/react/components/chat/chat/components/uploads-panel.d.ts +0 -20
- package/esm/src/react/components/chat/chat/components/uploads-panel.d.ts.map +0 -1
- package/esm/src/react/components/chat/chat/components/uploads-panel.js +0 -49
- package/esm/src/react/components/chat/chat/contexts/thread-list-context.d.ts +0 -28
- package/esm/src/react/components/chat/chat/contexts/thread-list-context.d.ts.map +0 -1
- package/esm/src/react/components/chat/chat/contexts/thread-list-context.js +0 -27
- package/esm/src/react/components/chat/chat/hooks/use-threads.d.ts +0 -28
- package/esm/src/react/components/chat/chat/hooks/use-threads.d.ts.map +0 -1
- package/esm/src/react/components/chat/chat/hooks/use-threads.js +0 -151
- package/esm/src/react/components/chat/chat-with-sidebar.d.ts +0 -110
- package/esm/src/react/components/chat/chat-with-sidebar.d.ts.map +0 -1
- package/esm/src/react/components/chat/chat-with-sidebar.js +0 -167
- package/esm/src/react/components/chat/message.d.ts +0 -42
- package/esm/src/react/components/chat/message.d.ts.map +0 -1
- package/esm/src/react/components/chat/message.js +0 -69
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Card — flat surface primitive, forked dependency-light from Veryfront
|
|
3
|
+
* Studio's `Card` (studio/components/Card). Solid (`bg-secondary`, no border,
|
|
4
|
+
* no shadow) for interactive content; outline (`border-outline-border`, no bg)
|
|
5
|
+
* for layout / non-interactive content. Both flat, radius baked in.
|
|
6
|
+
*
|
|
7
|
+
* Studio deps (cva/class-variance-authority, Heading/Text) are swapped for our
|
|
8
|
+
* private `cva` and plain elements. Private to the chat module.
|
|
9
|
+
*
|
|
10
|
+
* @module react/components/chat/ui/card
|
|
11
|
+
*/
|
|
12
|
+
import * as React from "../../../../../react/react.js";
|
|
13
|
+
import { cn } from "../theme.js";
|
|
14
|
+
import { cva } from "./cva.js";
|
|
15
|
+
const cardVariants = cva("w-full overflow-hidden", {
|
|
16
|
+
variants: {
|
|
17
|
+
surface: {
|
|
18
|
+
// Studio: solid = bg-secondary (interactive), outline = border only.
|
|
19
|
+
solid: "bg-[var(--secondary)]",
|
|
20
|
+
outline: "border border-[var(--outline-border)]",
|
|
21
|
+
},
|
|
22
|
+
padding: {
|
|
23
|
+
none: "",
|
|
24
|
+
sm: "p-4",
|
|
25
|
+
md: "p-5",
|
|
26
|
+
lg: "p-6",
|
|
27
|
+
},
|
|
28
|
+
// Studio radius scale: default = lg (20px), sm = md (12px). Nested cards
|
|
29
|
+
// read better at `sm` so they don't fight the outer chrome.
|
|
30
|
+
radius: {
|
|
31
|
+
default: "rounded-[var(--radius-lg)]",
|
|
32
|
+
sm: "rounded-[var(--radius-md)]",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
surface: "solid",
|
|
37
|
+
padding: "none",
|
|
38
|
+
radius: "default",
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
/** A flat card surface (Studio `Card`). */
|
|
42
|
+
export function Card({ className, surface, padding, radius, ref, ...props }) {
|
|
43
|
+
return (React.createElement("div", { ref: ref, className: cn(cardVariants({ surface, padding, radius }), className), ...props }));
|
|
44
|
+
}
|
|
45
|
+
Card.displayName = "Card";
|
|
46
|
+
/** Card header row — a flex row (Studio composes these inline). */
|
|
47
|
+
export function CardHeader({ className, ...props }) {
|
|
48
|
+
return (React.createElement("div", { className: cn("flex items-center gap-2", className), ...props }));
|
|
49
|
+
}
|
|
50
|
+
CardHeader.displayName = "Card.Header";
|
|
51
|
+
/** Card body region — vertical stack. */
|
|
52
|
+
export function CardContent({ className, ...props }) {
|
|
53
|
+
return React.createElement("div", { className: cn("flex flex-col", className), ...props });
|
|
54
|
+
}
|
|
55
|
+
CardContent.displayName = "Card.Content";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkbox — Studio's Checkbox is built on `@radix-ui/react-checkbox`; here it's
|
|
3
|
+
* re-expressed on a native `<input type="checkbox">` (full a11y for free — focus,
|
|
4
|
+
* keyboard, form participation) with an overlaid check, keeping Studio's exact
|
|
5
|
+
* box styling. Self-contained, no radix. Accepts the native API plus an optional
|
|
6
|
+
* radix-style `onCheckedChange`. Plus `CheckboxField` + `CheckboxGroup`.
|
|
7
|
+
*
|
|
8
|
+
* @module react/components/chat/ui/checkbox
|
|
9
|
+
*/
|
|
10
|
+
import * as React from "../../../../../react/react.js";
|
|
11
|
+
/** Props accepted by `<Checkbox>`. */
|
|
12
|
+
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
13
|
+
/** Radix-style convenience callback fired with the next checked state. */
|
|
14
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
15
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
16
|
+
}
|
|
17
|
+
/** A checkbox with an overlaid check indicator. */
|
|
18
|
+
export declare function Checkbox({ className, onChange, onCheckedChange, ref, ...props }: CheckboxProps): React.ReactElement;
|
|
19
|
+
/** Props accepted by `<CheckboxField>`. */
|
|
20
|
+
export interface CheckboxFieldProps extends CheckboxProps {
|
|
21
|
+
label: React.ReactNode;
|
|
22
|
+
description?: string;
|
|
23
|
+
}
|
|
24
|
+
/** A checkbox paired with a clickable label and optional description. */
|
|
25
|
+
export declare function CheckboxField({ label, description, id, ref, ...props }: CheckboxFieldProps): React.ReactElement;
|
|
26
|
+
/** Vertical group of checkboxes. */
|
|
27
|
+
export declare function CheckboxGroup({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.ReactElement;
|
|
28
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../../../../src/src/react/components/chat/ui/checkbox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AAKvD,sCAAsC;AACtC,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC9F,0EAA0E;IAC1E,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACnC;AAED,mDAAmD;AACnD,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,QAAQ,EACR,eAAe,EACf,GAAG,EACH,GAAG,KAAK,EACT,EAAE,aAAa,GAAG,KAAK,CAAC,YAAY,CAwBpC;AAED,2CAA2C;AAC3C,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,yEAAyE;AACzE,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,WAAW,EACX,EAAE,EACF,GAAG,EACH,GAAG,KAAK,EACT,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAoBzC;AAED,oCAAoC;AACpC,wBAAgB,aAAa,CAC3B,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAC5D,KAAK,CAAC,YAAY,CAEpB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkbox — Studio's Checkbox is built on `@radix-ui/react-checkbox`; here it's
|
|
3
|
+
* re-expressed on a native `<input type="checkbox">` (full a11y for free — focus,
|
|
4
|
+
* keyboard, form participation) with an overlaid check, keeping Studio's exact
|
|
5
|
+
* box styling. Self-contained, no radix. Accepts the native API plus an optional
|
|
6
|
+
* radix-style `onCheckedChange`. Plus `CheckboxField` + `CheckboxGroup`.
|
|
7
|
+
*
|
|
8
|
+
* @module react/components/chat/ui/checkbox
|
|
9
|
+
*/
|
|
10
|
+
import * as React from "../../../../../react/react.js";
|
|
11
|
+
import { cn } from "../theme.js";
|
|
12
|
+
import { CheckIcon } from "../icons/index.js";
|
|
13
|
+
import { Label } from "./label.js";
|
|
14
|
+
/** A checkbox with an overlaid check indicator. */
|
|
15
|
+
export function Checkbox({ className, onChange, onCheckedChange, ref, ...props }) {
|
|
16
|
+
return (React.createElement("span", { className: "relative inline-flex shrink-0" },
|
|
17
|
+
React.createElement("input", { ref: ref, type: "checkbox", className: cn("peer size-5 shrink-0 appearance-none rounded-[var(--radius-xs)] border border-[var(--outline-border)] dark:border-[var(--background)]", "bg-[var(--input-bg)] cursor-pointer", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--edge-medium)]", "disabled:cursor-not-allowed disabled:opacity-50", "checked:bg-[var(--primary)] checked:border-[var(--primary)]", "transition-colors", className), onChange: (e) => {
|
|
18
|
+
onChange?.(e);
|
|
19
|
+
onCheckedChange?.(e.currentTarget.checked);
|
|
20
|
+
}, ...props }),
|
|
21
|
+
React.createElement(CheckIcon, { className: "pointer-events-none absolute inset-0 m-auto size-3! text-[var(--secondary)] opacity-0 peer-checked:opacity-100" })));
|
|
22
|
+
}
|
|
23
|
+
/** A checkbox paired with a clickable label and optional description. */
|
|
24
|
+
export function CheckboxField({ label, description, id, ref, ...props }) {
|
|
25
|
+
const generatedId = React.useId();
|
|
26
|
+
const fieldId = id || generatedId;
|
|
27
|
+
return (React.createElement(Label, { htmlFor: fieldId, weight: "normal", className: "cursor-pointer flex items-center gap-2.5" },
|
|
28
|
+
React.createElement(Checkbox, { id: fieldId, ref: ref, ...props }),
|
|
29
|
+
React.createElement("span", { className: "flex flex-col" },
|
|
30
|
+
React.createElement("span", { className: cn(description && "mb-1") }, label),
|
|
31
|
+
description && (React.createElement("span", { className: "text-base font-normal text-[var(--foreground)]" }, description)))));
|
|
32
|
+
}
|
|
33
|
+
/** Vertical group of checkboxes. */
|
|
34
|
+
export function CheckboxGroup({ className, ...props }) {
|
|
35
|
+
return React.createElement("div", { className: cn("flex flex-col gap-2", className), ...props });
|
|
36
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as React from "../../../../../react/react.js";
|
|
2
|
+
/** Light/dark, for switching the shiki + mermaid theme. */
|
|
3
|
+
type CodeBlockMode = "light" | "dark";
|
|
4
|
+
/** Props accepted by `<CodeBlock>`. */
|
|
5
|
+
export interface CodeBlockProps {
|
|
6
|
+
/** The source code to render. */
|
|
7
|
+
code: string;
|
|
8
|
+
/** Language id for syntax highlighting (e.g. `tsx`, `json`, `mermaid`). */
|
|
9
|
+
language?: string;
|
|
10
|
+
/** Additional class names for the outer container. */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Render inside a collapsible shell (header stays, body toggles). */
|
|
13
|
+
collapsible?: boolean;
|
|
14
|
+
/** When `collapsible`, start collapsed. @default false */
|
|
15
|
+
defaultCollapsed?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Force the highlight theme. Defaults to the `ColorModeProvider` when present,
|
|
18
|
+
* else `light` — so `CodeBlock` renders standalone (e.g. inside markdown)
|
|
19
|
+
* without requiring a provider.
|
|
20
|
+
*/
|
|
21
|
+
mode?: CodeBlockMode;
|
|
22
|
+
/** Override the idle copy icon in the header copy button. */
|
|
23
|
+
copyIcon?: React.ReactNode;
|
|
24
|
+
/** Override the collapse chevron icon (only used when `collapsible`). */
|
|
25
|
+
collapseIcon?: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Intercept the built-in header copy. The caller runs first and must call
|
|
28
|
+
* `next()` to actually copy.
|
|
29
|
+
*/
|
|
30
|
+
onCopy?: (e: React.MouseEvent, next: () => void) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Replace the header row entirely. Receives the language label, a `copy`
|
|
33
|
+
* trigger, and (for the collapsible variant) the `collapsed` state + a
|
|
34
|
+
* `toggle`. When provided, the built-in header/trigger row is not rendered.
|
|
35
|
+
*/
|
|
36
|
+
renderHeader?: (opts: {
|
|
37
|
+
language?: string;
|
|
38
|
+
copy: () => void;
|
|
39
|
+
collapsed: boolean;
|
|
40
|
+
toggle: () => void;
|
|
41
|
+
}) => React.ReactNode;
|
|
42
|
+
}
|
|
43
|
+
/** Result of {@link useClipboard}: the copied flag + a `copy` trigger. */
|
|
44
|
+
export interface UseClipboardResult {
|
|
45
|
+
/** `true` for ~2s after a successful (or fallback) copy. */
|
|
46
|
+
copied: boolean;
|
|
47
|
+
/** Copy `text` to the clipboard (with a `execCommand` fallback). */
|
|
48
|
+
copy: () => void;
|
|
49
|
+
}
|
|
50
|
+
/** Clipboard copy hook: copies `text`, flips `copied` for ~2s. */
|
|
51
|
+
export declare function useClipboard(text: string): UseClipboardResult;
|
|
52
|
+
/** Props accepted by {@link CopyButton}. */
|
|
53
|
+
export interface CopyButtonProps {
|
|
54
|
+
/** The text copied to the clipboard on click. */
|
|
55
|
+
code: string;
|
|
56
|
+
/**
|
|
57
|
+
* Override the idle copy icon (the copied/check state is unchanged). When
|
|
58
|
+
* omitted, the built-in {@link CopyIcon} is used.
|
|
59
|
+
*/
|
|
60
|
+
copyIcon?: React.ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* Intercept the built-in copy. The caller runs first and must call `next()`
|
|
63
|
+
* to actually copy. When omitted, the copy happens directly.
|
|
64
|
+
*/
|
|
65
|
+
onCopy?: (e: React.MouseEvent, next: () => void) => void;
|
|
66
|
+
}
|
|
67
|
+
export declare function CopyButton({ code, copyIcon, onCopy }: CopyButtonProps): React.ReactElement;
|
|
68
|
+
/** Props accepted by {@link CodeSurface}. */
|
|
69
|
+
export interface CodeSurfaceProps {
|
|
70
|
+
/** The source code to highlight. */
|
|
71
|
+
code: string;
|
|
72
|
+
/** Language id for syntax highlighting (defaults handled by the caller). */
|
|
73
|
+
language: string;
|
|
74
|
+
/** Resolved light/dark mode for the shiki theme. */
|
|
75
|
+
resolvedMode: CodeBlockMode;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The code surface. Plain highlighted code is ALWAYS visible immediately —
|
|
79
|
+
* shiki is progressive enhancement layered on top once it lazy-loads from
|
|
80
|
+
* esm.sh (so a stalled/blocked network never leaves an empty "no code block").
|
|
81
|
+
*/
|
|
82
|
+
export declare function CodeSurface({ code, language, resolvedMode, }: CodeSurfaceProps): React.ReactElement;
|
|
83
|
+
/** Render a syntax-highlighted code block (or a mermaid diagram). */
|
|
84
|
+
export declare function CodeBlock({ code, language, className, collapsible, defaultCollapsed, mode, copyIcon, collapseIcon, onCopy, renderHeader, }: CodeBlockProps): React.ReactElement;
|
|
85
|
+
export declare namespace CodeBlock {
|
|
86
|
+
var displayName: string;
|
|
87
|
+
}
|
|
88
|
+
export {};
|
|
89
|
+
//# sourceMappingURL=code-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../../../../../src/src/react/components/chat/ui/code-block.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AAOvD,2DAA2D;AAC3D,KAAK,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAsMtC,uCAAuC;AACvC,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,yEAAyE;IACzE,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IACzD;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,IAAI,CAAC;QACjB,SAAS,EAAE,OAAO,CAAC;QACnB,MAAM,EAAE,MAAM,IAAI,CAAC;KACpB,KAAK,KAAK,CAAC,SAAS,CAAC;CACvB;AAED,0EAA0E;AAC1E,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,MAAM,EAAE,OAAO,CAAC;IAChB,oEAAoE;IACpE,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,kEAAkE;AAClE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAoB7D;AAED,4CAA4C;AAC5C,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CAC1D;AAID,wBAAgB,UAAU,CACxB,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,eAAe,GAC1C,KAAK,CAAC,YAAY,CAqBpB;AAED,6CAA6C;AAC7C,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,YAAY,EAAE,aAAa,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,QAAQ,EACR,YAAY,GACb,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CAyDvC;AAED,qEAAqE;AACrE,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,WAAmB,EACnB,gBAAwB,EACxB,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,YAAY,GACb,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAqFrC;yBAhGe,SAAS"}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CodeBlock — the "ace" syntax-highlighted code primitive, forked
|
|
3
|
+
* dependency-light from Veryfront Studio's `ChatCodeBlock`. Structurally 1:1
|
|
4
|
+
* (shiki highlight + copy + language label + collapsible + mermaid), but:
|
|
5
|
+
*
|
|
6
|
+
* - **Themes:** shiki built-in `github-light` / `github-dark`, switched on our
|
|
7
|
+
* `useColorMode` — NOT Studio's `veryfrontDarkTheme`.
|
|
8
|
+
* - **Dependency-light:** shiki and mermaid are lazy-loaded from esm.sh on first
|
|
9
|
+
* render (same pattern as `markdown.tsx`), never bundled. A `Skeleton` shows
|
|
10
|
+
* while the highlighter loads; a plain `<pre>` is the graceful fallback.
|
|
11
|
+
* - **Stripped (Studio-panel only):** `openTab`/`openPanel`/`openFilePath`/
|
|
12
|
+
* `executeCommand`, file previews, the actions dropdown, radix
|
|
13
|
+
* `useControllableState`, and `printReadiness`.
|
|
14
|
+
*
|
|
15
|
+
* Private to the chat module.
|
|
16
|
+
*
|
|
17
|
+
* @module react/components/chat/ui/code-block
|
|
18
|
+
*/
|
|
19
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
|
20
|
+
import * as React from "../../../../../react/react.js";
|
|
21
|
+
import { cn } from "../theme.js";
|
|
22
|
+
import { isBrowserEnvironment } from "../../../../platform/compat/runtime.js";
|
|
23
|
+
import { validateTrustedHtml } from "../../../../security/client/html-sanitizer.js";
|
|
24
|
+
import { CheckIcon, ChevronDownIcon, CopyIcon } from "../icons/index.js";
|
|
25
|
+
import { useColorModeOptional } from "../color-mode.js";
|
|
26
|
+
import { Skeleton } from "./skeleton.js";
|
|
27
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./collapsible.js";
|
|
28
|
+
import { IconButton } from "./icon-button.js";
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// Lazy esm.sh loaders (dependency-light — mirrors markdown.tsx)
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
const ESM_SHIKI = "https://esm.sh/shiki@1.24.0?target=es2022&pin=v135";
|
|
33
|
+
const ESM_MERMAID = "https://esm.sh/mermaid@11.4.1?pin=v135";
|
|
34
|
+
async function importFromUrl(url) {
|
|
35
|
+
return await import(/* @vite-ignore */ url);
|
|
36
|
+
}
|
|
37
|
+
// The shiki highlighter is expensive to spin up and its grammars are loaded on
|
|
38
|
+
// demand, so cache a single instance (and per-language load promises) module-wide.
|
|
39
|
+
let shikiModule = null;
|
|
40
|
+
let highlighterPromise = null;
|
|
41
|
+
let highlighter = null;
|
|
42
|
+
const loadedLangs = new Set(["text"]);
|
|
43
|
+
const langLoadPromises = new Map();
|
|
44
|
+
async function loadHighlighter() {
|
|
45
|
+
if (!isBrowserEnvironment())
|
|
46
|
+
return null;
|
|
47
|
+
if (highlighter)
|
|
48
|
+
return highlighter;
|
|
49
|
+
highlighterPromise ??= (async () => {
|
|
50
|
+
shikiModule ??= await importFromUrl(ESM_SHIKI);
|
|
51
|
+
return await shikiModule.createHighlighter({
|
|
52
|
+
themes: ["github-light", "github-dark"],
|
|
53
|
+
langs: ["text"],
|
|
54
|
+
});
|
|
55
|
+
})();
|
|
56
|
+
highlighter = await highlighterPromise;
|
|
57
|
+
return highlighter;
|
|
58
|
+
}
|
|
59
|
+
async function ensureLanguage(lang) {
|
|
60
|
+
if (!highlighter || loadedLangs.has(lang))
|
|
61
|
+
return;
|
|
62
|
+
const existing = langLoadPromises.get(lang);
|
|
63
|
+
if (existing) {
|
|
64
|
+
await existing;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const load = highlighter
|
|
68
|
+
.loadLanguage(lang)
|
|
69
|
+
.then(() => {
|
|
70
|
+
loadedLangs.add(lang);
|
|
71
|
+
})
|
|
72
|
+
.catch(() => {
|
|
73
|
+
// Unknown/unsupported grammar — fall back to plain rendering.
|
|
74
|
+
loadedLangs.add(lang);
|
|
75
|
+
});
|
|
76
|
+
langLoadPromises.set(lang, load);
|
|
77
|
+
await load;
|
|
78
|
+
}
|
|
79
|
+
let mermaidPromise = null;
|
|
80
|
+
let mermaidModule = null;
|
|
81
|
+
let mermaidTheme = null;
|
|
82
|
+
async function loadMermaid(theme) {
|
|
83
|
+
if (!isBrowserEnvironment())
|
|
84
|
+
return null;
|
|
85
|
+
mermaidPromise ??= importFromUrl(ESM_MERMAID);
|
|
86
|
+
mermaidModule = await mermaidPromise;
|
|
87
|
+
// Re-initialize when the theme flips so the SVG re-renders in the new palette.
|
|
88
|
+
if (mermaidTheme !== theme) {
|
|
89
|
+
mermaidModule.default.initialize({
|
|
90
|
+
startOnLoad: false,
|
|
91
|
+
theme,
|
|
92
|
+
securityLevel: "strict",
|
|
93
|
+
fontFamily: "inherit",
|
|
94
|
+
});
|
|
95
|
+
mermaidTheme = theme;
|
|
96
|
+
}
|
|
97
|
+
return mermaidModule;
|
|
98
|
+
}
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
// MermaidDiagram — ported from Studio's MermaidDiagram, next-themes swapped for
|
|
101
|
+
// useColorMode, Skeleton kept, printReadiness dropped.
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
function MermaidDiagram({ code, className, resolvedMode }) {
|
|
104
|
+
const [svg, setSvg] = React.useState("");
|
|
105
|
+
const [error, setError] = React.useState("");
|
|
106
|
+
React.useEffect(() => {
|
|
107
|
+
if (!isBrowserEnvironment() || !code.trim())
|
|
108
|
+
return;
|
|
109
|
+
let cancelled = false;
|
|
110
|
+
const theme = resolvedMode === "dark" ? "dark" : "default";
|
|
111
|
+
async function render() {
|
|
112
|
+
try {
|
|
113
|
+
const mermaid = await loadMermaid(theme);
|
|
114
|
+
if (!mermaid || cancelled)
|
|
115
|
+
return;
|
|
116
|
+
const id = `mermaid-${Math.random().toString(36).slice(2, 9)}`;
|
|
117
|
+
const { svg: rendered } = await mermaid.default.render(id, code.trim());
|
|
118
|
+
if (cancelled)
|
|
119
|
+
return;
|
|
120
|
+
setSvg(validateTrustedHtml(rendered, { strict: true }));
|
|
121
|
+
setError("");
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
if (cancelled)
|
|
125
|
+
return;
|
|
126
|
+
setError(err instanceof Error ? err.message : "Failed to render diagram");
|
|
127
|
+
setSvg("");
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
render();
|
|
131
|
+
return () => {
|
|
132
|
+
cancelled = true;
|
|
133
|
+
};
|
|
134
|
+
}, [code, resolvedMode]);
|
|
135
|
+
if (error) {
|
|
136
|
+
return (React.createElement("div", { className: cn("rounded-[var(--radius-md)] border border-[var(--outline-border)] p-3 text-sm", className) },
|
|
137
|
+
React.createElement("p", { className: "font-medium" }, "Diagram error"),
|
|
138
|
+
React.createElement("pre", { className: "mt-1 whitespace-pre-wrap text-xs" }, error)));
|
|
139
|
+
}
|
|
140
|
+
if (!svg) {
|
|
141
|
+
return React.createElement(Skeleton, { className: cn("h-32 rounded-[var(--radius-md)]", className) });
|
|
142
|
+
}
|
|
143
|
+
return (React.createElement("div", { className: cn("overflow-x-auto rounded-[var(--radius-md)] border border-[var(--outline-border)] bg-[var(--secondary)] p-3 [&_svg]:max-w-full", className), dangerouslySetInnerHTML: { __html: svg } }));
|
|
144
|
+
}
|
|
145
|
+
/** Clipboard copy hook: copies `text`, flips `copied` for ~2s. */
|
|
146
|
+
export function useClipboard(text) {
|
|
147
|
+
const [copied, setCopied] = React.useState(false);
|
|
148
|
+
const copy = React.useCallback(() => {
|
|
149
|
+
void (async () => {
|
|
150
|
+
try {
|
|
151
|
+
await navigator.clipboard.writeText(text);
|
|
152
|
+
}
|
|
153
|
+
catch (_) {
|
|
154
|
+
/* expected: clipboard API unavailable, using fallback */
|
|
155
|
+
const textarea = document.createElement("textarea");
|
|
156
|
+
textarea.value = text;
|
|
157
|
+
document.body.appendChild(textarea);
|
|
158
|
+
textarea.select();
|
|
159
|
+
document.execCommand("copy");
|
|
160
|
+
document.body.removeChild(textarea);
|
|
161
|
+
}
|
|
162
|
+
setCopied(true);
|
|
163
|
+
dntShim.setTimeout(() => setCopied(false), 2000);
|
|
164
|
+
})();
|
|
165
|
+
}, [text]);
|
|
166
|
+
return { copied, copy };
|
|
167
|
+
}
|
|
168
|
+
// Icon-only copy control (Studio's ChatCodeBlock copy = `icon-ghost`/`icon-sm`,
|
|
169
|
+
// no "Copy" text). The label lives in the hover tooltip instead.
|
|
170
|
+
export function CopyButton({ code, copyIcon, onCopy }) {
|
|
171
|
+
const { copied, copy } = useClipboard(code);
|
|
172
|
+
const handleClick = (e) => {
|
|
173
|
+
if (onCopy)
|
|
174
|
+
onCopy(e, copy);
|
|
175
|
+
else
|
|
176
|
+
copy();
|
|
177
|
+
};
|
|
178
|
+
return (React.createElement(IconButton, { variant: "icon-ghost", size: "icon-sm", onClick: handleClick, tooltip: copied ? "Copied" : "Copy code", "aria-label": "Copy code", className: "-mr-1 text-[var(--faint)] hover:text-[var(--foreground)]" }, copied
|
|
179
|
+
? React.createElement(CheckIcon, { className: "size-3.5" })
|
|
180
|
+
: (copyIcon ?? React.createElement(CopyIcon, { className: "size-3.5" }))));
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* The code surface. Plain highlighted code is ALWAYS visible immediately —
|
|
184
|
+
* shiki is progressive enhancement layered on top once it lazy-loads from
|
|
185
|
+
* esm.sh (so a stalled/blocked network never leaves an empty "no code block").
|
|
186
|
+
*/
|
|
187
|
+
export function CodeSurface({ code, language, resolvedMode, }) {
|
|
188
|
+
const [html, setHtml] = React.useState("");
|
|
189
|
+
React.useEffect(() => {
|
|
190
|
+
if (!isBrowserEnvironment())
|
|
191
|
+
return;
|
|
192
|
+
let cancelled = false;
|
|
193
|
+
const theme = resolvedMode === "dark" ? "github-dark" : "github-light";
|
|
194
|
+
async function highlight() {
|
|
195
|
+
try {
|
|
196
|
+
const hl = await loadHighlighter();
|
|
197
|
+
if (!hl || cancelled)
|
|
198
|
+
return;
|
|
199
|
+
await ensureLanguage(language);
|
|
200
|
+
if (cancelled)
|
|
201
|
+
return;
|
|
202
|
+
const lang = loadedLangs.has(language) ? language : "text";
|
|
203
|
+
const rendered = hl.codeToHtml(code.trim(), { lang, theme });
|
|
204
|
+
if (cancelled)
|
|
205
|
+
return;
|
|
206
|
+
setHtml(validateTrustedHtml(rendered, { strict: true }));
|
|
207
|
+
}
|
|
208
|
+
catch (_err) {
|
|
209
|
+
// Graceful fallback — the plain <pre> below stays.
|
|
210
|
+
if (!cancelled)
|
|
211
|
+
setHtml("");
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
setHtml("");
|
|
215
|
+
highlight();
|
|
216
|
+
return () => {
|
|
217
|
+
cancelled = true;
|
|
218
|
+
};
|
|
219
|
+
}, [code, language, resolvedMode]);
|
|
220
|
+
// Highlighted surface, once shiki has produced HTML.
|
|
221
|
+
if (html && isBrowserEnvironment()) {
|
|
222
|
+
return (React.createElement("div", { className: cn("overflow-x-auto text-sm",
|
|
223
|
+
// Strip shiki's own <pre> chrome so it inherits our container.
|
|
224
|
+
"[&_pre]:!m-0 [&_pre]:!bg-transparent [&_pre]:!p-3 [&_.shiki]:!bg-transparent"), dangerouslySetInnerHTML: { __html: html } }));
|
|
225
|
+
}
|
|
226
|
+
// Always-visible base: plain code (SSR, pre-highlight, or fallback).
|
|
227
|
+
return (React.createElement("pre", { className: "overflow-x-auto p-3 text-sm text-[var(--foreground)]" },
|
|
228
|
+
React.createElement("code", { className: language ? `language-${language}` : undefined }, code.trim())));
|
|
229
|
+
}
|
|
230
|
+
/** Render a syntax-highlighted code block (or a mermaid diagram). */
|
|
231
|
+
export function CodeBlock({ code, language, className, collapsible = false, defaultCollapsed = false, mode, copyIcon, collapseIcon, onCopy, renderHeader, }) {
|
|
232
|
+
const lang = language ?? "text";
|
|
233
|
+
// Hook called unconditionally; prop wins, else provider, else light. Never throws.
|
|
234
|
+
const contextMode = useColorModeOptional()?.resolvedMode;
|
|
235
|
+
const resolvedMode = mode ?? contextMode ?? "light";
|
|
236
|
+
// Control the collapsible open state locally so `renderHeader` can expose a
|
|
237
|
+
// working `collapsed`/`toggle` (DOM output is identical to the uncontrolled
|
|
238
|
+
// default). Hook is called unconditionally.
|
|
239
|
+
const [open, setOpen] = React.useState(!defaultCollapsed);
|
|
240
|
+
const toggle = React.useCallback(() => setOpen((v) => !v), []);
|
|
241
|
+
// A `copy` trigger for `renderHeader` that honours `onCopy`.
|
|
242
|
+
const clipboard = useClipboard(code);
|
|
243
|
+
const copy = React.useCallback(() => {
|
|
244
|
+
if (onCopy) {
|
|
245
|
+
onCopy({}, clipboard.copy);
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
clipboard.copy();
|
|
249
|
+
}
|
|
250
|
+
}, [onCopy, clipboard]);
|
|
251
|
+
// Mermaid fences render as an SVG diagram, no chrome.
|
|
252
|
+
if (language === "mermaid" && code.trim()) {
|
|
253
|
+
return (React.createElement(MermaidDiagram, { code: code, className: className, resolvedMode: resolvedMode }));
|
|
254
|
+
}
|
|
255
|
+
const header = (React.createElement("div", { className: "flex items-center justify-between py-1.5 pl-3 pr-1.5 text-xs text-[var(--faint)]" },
|
|
256
|
+
React.createElement("span", { className: "font-mono font-medium" }, lang),
|
|
257
|
+
React.createElement(CopyButton, { code: code, copyIcon: copyIcon, onCopy: onCopy })));
|
|
258
|
+
const surface = React.createElement(CodeSurface, { code: code, language: lang, resolvedMode: resolvedMode });
|
|
259
|
+
if (collapsible) {
|
|
260
|
+
return (React.createElement(Collapsible, { open: open, onOpenChange: setOpen, className: cn("not-prose my-4 overflow-hidden rounded-[var(--radius-md)] border border-[var(--outline-border)] bg-[var(--secondary)]", className) },
|
|
261
|
+
renderHeader ? renderHeader({ language, copy, collapsed: !open, toggle }) : (
|
|
262
|
+
/* Trigger + copy are siblings (not nested — that would be a
|
|
263
|
+
button-in-button). The trigger is `flex-1`, so the whole row toggles
|
|
264
|
+
the body; the in-flow copy button keeps the header the same height as
|
|
265
|
+
the flat variant. */
|
|
266
|
+
React.createElement("div", { className: "flex items-center py-1.5 pl-3 pr-1.5 text-xs text-[var(--faint)]" },
|
|
267
|
+
React.createElement(CollapsibleTrigger, { className: "group flex flex-1 items-center gap-1.5 font-mono font-medium text-[var(--faint)] transition-colors hover:text-[var(--foreground)]" },
|
|
268
|
+
collapseIcon ?? (React.createElement(ChevronDownIcon, { className: "size-3.5 shrink-0 transition-transform duration-100 group-data-[state=closed]:-rotate-90" })),
|
|
269
|
+
React.createElement("span", null, lang)),
|
|
270
|
+
React.createElement(CopyButton, { code: code, copyIcon: copyIcon, onCopy: onCopy }))),
|
|
271
|
+
React.createElement(CollapsibleContent, { className: "border-t border-[var(--outline-border)]" }, surface)));
|
|
272
|
+
}
|
|
273
|
+
return (React.createElement("div", { className: cn("not-prose my-4 overflow-hidden rounded-[var(--radius-md)] border border-[var(--outline-border)] bg-[var(--secondary)]", className) },
|
|
274
|
+
renderHeader ? renderHeader({ language, copy, collapsed: !open, toggle }) : header,
|
|
275
|
+
React.createElement("div", { className: "border-t border-[var(--outline-border)]" }, surface)));
|
|
276
|
+
}
|
|
277
|
+
CodeBlock.displayName = "CodeBlock";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collapsible — BASIC fork of @radix-ui/react-collapsible with the same API
|
|
3
|
+
* (Collapsible / CollapsibleTrigger / CollapsibleContent). Controlled or
|
|
4
|
+
* uncontrolled open state; content unmounts when closed.
|
|
5
|
+
*
|
|
6
|
+
* TODO(a11y): id-wired `aria-controls`, height transition
|
|
7
|
+
* (`--radix-collapsible-content-height`), `hidden` instead of unmount for
|
|
8
|
+
* find-in-page. Private to the chat module.
|
|
9
|
+
*
|
|
10
|
+
* @module react/components/chat/ui/collapsible
|
|
11
|
+
*/
|
|
12
|
+
import * as React from "../../../../../react/react.js";
|
|
13
|
+
/** Props accepted by `<Collapsible>`. */
|
|
14
|
+
export interface CollapsibleProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
15
|
+
open?: boolean;
|
|
16
|
+
defaultOpen?: boolean;
|
|
17
|
+
onOpenChange?: (open: boolean) => void;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Collapsible root — owns open state. */
|
|
21
|
+
export declare function Collapsible({ open, defaultOpen, onOpenChange, disabled, children, ...props }: CollapsibleProps): React.ReactElement;
|
|
22
|
+
/** Props accepted by `<CollapsibleTrigger>`. */
|
|
23
|
+
export interface CollapsibleTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
24
|
+
asChild?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** Toggles the collapsible. `asChild` merges onto the child element. */
|
|
27
|
+
export declare function CollapsibleTrigger({ asChild, onClick, children, ...props }: CollapsibleTriggerProps): React.ReactElement;
|
|
28
|
+
/** Collapsible content — rendered only while open. */
|
|
29
|
+
export declare function CollapsibleContent({ children, ...props }: React.HTMLAttributes<HTMLDivElement>): React.ReactElement | null;
|
|
30
|
+
//# sourceMappingURL=collapsible.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../../../../src/src/react/components/chat/ui/collapsible.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AAOvD,yCAAyC;AACzC,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC9F,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,0CAA0C;AAC1C,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CAgBvC;AAED,gDAAgD;AAChD,MAAM,WAAW,uBAAwB,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAC5F,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wEAAwE;AACxE,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,uBAAuB,GAAG,KAAK,CAAC,YAAY,CAkB9C;AAED,sDAAsD;AACtD,wBAAgB,kBAAkB,CAChC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAC3D,KAAK,CAAC,YAAY,GAAG,IAAI,CAQ3B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collapsible — BASIC fork of @radix-ui/react-collapsible with the same API
|
|
3
|
+
* (Collapsible / CollapsibleTrigger / CollapsibleContent). Controlled or
|
|
4
|
+
* uncontrolled open state; content unmounts when closed.
|
|
5
|
+
*
|
|
6
|
+
* TODO(a11y): id-wired `aria-controls`, height transition
|
|
7
|
+
* (`--radix-collapsible-content-height`), `hidden` instead of unmount for
|
|
8
|
+
* find-in-page. Private to the chat module.
|
|
9
|
+
*
|
|
10
|
+
* @module react/components/chat/ui/collapsible
|
|
11
|
+
*/
|
|
12
|
+
import * as React from "../../../../../react/react.js";
|
|
13
|
+
import { Slot } from "./slot.js";
|
|
14
|
+
const CollapsibleContext = React.createContext(null);
|
|
15
|
+
/** Collapsible root — owns open state. */
|
|
16
|
+
export function Collapsible({ open, defaultOpen, onOpenChange, disabled, children, ...props }) {
|
|
17
|
+
const [internal, setInternal] = React.useState(defaultOpen ?? false);
|
|
18
|
+
const isControlled = open !== undefined;
|
|
19
|
+
const isOpen = isControlled ? open : internal;
|
|
20
|
+
const toggle = React.useCallback(() => {
|
|
21
|
+
const next = !isOpen;
|
|
22
|
+
if (!isControlled)
|
|
23
|
+
setInternal(next);
|
|
24
|
+
onOpenChange?.(next);
|
|
25
|
+
}, [isOpen, isControlled, onOpenChange]);
|
|
26
|
+
return (React.createElement("div", { "data-state": isOpen ? "open" : "closed", ...props },
|
|
27
|
+
React.createElement(CollapsibleContext.Provider, { value: { open: isOpen, toggle, disabled } }, children)));
|
|
28
|
+
}
|
|
29
|
+
/** Toggles the collapsible. `asChild` merges onto the child element. */
|
|
30
|
+
export function CollapsibleTrigger({ asChild, onClick, children, ...props }) {
|
|
31
|
+
const ctx = React.useContext(CollapsibleContext);
|
|
32
|
+
const Comp = asChild ? Slot : "button";
|
|
33
|
+
return (React.createElement(Comp, { ...(asChild ? {} : { type: "button" }), "aria-expanded": ctx?.open, "data-state": ctx?.open ? "open" : "closed", disabled: ctx?.disabled, onClick: (e) => {
|
|
34
|
+
onClick?.(e);
|
|
35
|
+
ctx?.toggle();
|
|
36
|
+
}, ...props }, children));
|
|
37
|
+
}
|
|
38
|
+
/** Collapsible content — rendered only while open. */
|
|
39
|
+
export function CollapsibleContent({ children, ...props }) {
|
|
40
|
+
const ctx = React.useContext(CollapsibleContext);
|
|
41
|
+
if (!ctx?.open)
|
|
42
|
+
return null;
|
|
43
|
+
return (React.createElement("div", { "data-state": "open", ...props }, children));
|
|
44
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command — BASIC self-contained fork of Studio's `Command` (which wraps `cmdk`).
|
|
3
|
+
* A searchable, filtered list: Input / List / Empty / Group / Item (+ Item
|
|
4
|
+
* Content/Title/Description, Shortcut, Separator). Classes ported 1:1 from
|
|
5
|
+
* Studio (tokens remapped, icons sized down a half-step). Used by the model
|
|
6
|
+
* picker (Popover + Command). No `cmdk` dependency.
|
|
7
|
+
*
|
|
8
|
+
* TODO(a11y): arrow-key navigation + `aria-activedescendant`, fuzzy ranking
|
|
9
|
+
* (this does case-insensitive substring matching), `CommandDialog`. Private to
|
|
10
|
+
* the chat module.
|
|
11
|
+
*
|
|
12
|
+
* @module react/components/chat/ui/command
|
|
13
|
+
*/
|
|
14
|
+
import * as React from "../../../../../react/react.js";
|
|
15
|
+
/** Command root — owns the filter query and the item registry. */
|
|
16
|
+
export declare function Command({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>): React.ReactElement;
|
|
17
|
+
/** Props accepted by `<CommandDialog>`. */
|
|
18
|
+
export interface CommandDialogProps {
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
open?: boolean;
|
|
21
|
+
defaultOpen?: boolean;
|
|
22
|
+
onOpenChange?: (open: boolean) => void;
|
|
23
|
+
}
|
|
24
|
+
/** A Command palette inside a modal Dialog overlay. */
|
|
25
|
+
export declare function CommandDialog({ children, open, defaultOpen, onOpenChange, }: CommandDialogProps): React.ReactElement;
|
|
26
|
+
/** Props accepted by `<CommandInput>`. */
|
|
27
|
+
export interface CommandInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "value"> {
|
|
28
|
+
icon?: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/** Search input row — bound to the command's filter query. */
|
|
31
|
+
export declare function CommandInput({ className, icon, placeholder, ...props }: CommandInputProps): React.ReactElement;
|
|
32
|
+
/** Scrollable results list. */
|
|
33
|
+
export declare function CommandList({ className, variant, ...props }: React.HTMLAttributes<HTMLDivElement> & {
|
|
34
|
+
variant?: "default" | "flush";
|
|
35
|
+
}): React.ReactElement;
|
|
36
|
+
/** Shown when the query matches no items. */
|
|
37
|
+
export declare function CommandEmpty({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.ReactElement | null;
|
|
38
|
+
/** A labelled group of items; auto-hides when all its items are filtered out. */
|
|
39
|
+
export declare function CommandGroup({ className, heading, children, ...props }: React.HTMLAttributes<HTMLDivElement> & {
|
|
40
|
+
heading?: React.ReactNode;
|
|
41
|
+
}): React.ReactElement;
|
|
42
|
+
/** Divider between groups. */
|
|
43
|
+
export declare function CommandSeparator({ className }: {
|
|
44
|
+
className?: string;
|
|
45
|
+
}): React.ReactElement;
|
|
46
|
+
/** Props accepted by `<CommandItem>`. */
|
|
47
|
+
export interface CommandItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
48
|
+
/** Searchable text for filtering (falls back to nothing → always visible). */
|
|
49
|
+
value?: string;
|
|
50
|
+
/** Top-align the icon for two-line items. */
|
|
51
|
+
align?: "center" | "start";
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
onSelect?: (value?: string) => void;
|
|
54
|
+
}
|
|
55
|
+
/** A selectable, filterable result row. */
|
|
56
|
+
export declare function CommandItem({ className, align, value, disabled, onSelect, children, ...props }: CommandItemProps): React.ReactElement;
|
|
57
|
+
/** Flex column wrapper for an item's title + description. */
|
|
58
|
+
export declare function CommandItemContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.ReactElement;
|
|
59
|
+
/** Item primary text. */
|
|
60
|
+
export declare function CommandItemTitle({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.ReactElement;
|
|
61
|
+
/** Item secondary text. */
|
|
62
|
+
export declare function CommandItemDescription({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.ReactElement;
|
|
63
|
+
/** Trailing shortcut / metadata text. */
|
|
64
|
+
export declare function CommandShortcut({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.ReactElement;
|
|
65
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../../src/src/react/components/chat/ui/command.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AAsBvD,kEAAkE;AAClE,wBAAgB,OAAO,CAAC,EACtB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC,YAAY,CA4C3D;AAED,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED,uDAAuD;AACvD,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,YAAY,GACb,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CASzC;AAED,0CAA0C;AAC1C,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAClE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,8DAA8D;AAC9D,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,IAAI,EACJ,WAAuB,EACvB,GAAG,KAAK,EACT,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CA8BxC;AAED,+BAA+B;AAC/B,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,YAAY,CAW/F;AAED,6CAA6C;AAC7C,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAYlE;AAED,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,GAAG,KAAK,CAAC,YAAY,CAiB3F;AAED,8BAA8B;AAC9B,wBAAgB,gBAAgB,CAC9B,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACpC,KAAK,CAAC,YAAY,CAEpB;AAED,yCAAyC;AACzC,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC9F,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,2CAA2C;AAC3C,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,KAAgB,EAChB,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CAmCvC;AAED,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAChC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAC5D,KAAK,CAAC,YAAY,CAEpB;AAED,yBAAyB;AACzB,wBAAgB,gBAAgB,CAC9B,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAC5D,KAAK,CAAC,YAAY,CAEpB;AAED,2BAA2B;AAC3B,wBAAgB,sBAAsB,CACpC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAC5D,KAAK,CAAC,YAAY,CAOpB;AAED,yCAAyC;AACzC,wBAAgB,eAAe,CAC7B,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,GAC7D,KAAK,CAAC,YAAY,CAUpB"}
|