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,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChatEmptyState — the conversation idle / empty view: an agent avatar, a
|
|
3
|
+
* heading, and a row of suggestion chips. Ported 1:1 from Veryfront Studio's
|
|
4
|
+
* `ChatIdleView` family (`ChatIdleView` + `…Avatar` + `…Heading` +
|
|
5
|
+
* `Suggestions`/`SuggestionItem`), restyled onto the chat primitives.
|
|
6
|
+
*
|
|
7
|
+
* Composed via children — every part is a small, focused piece you arrange
|
|
8
|
+
* yourself, so there is no monolithic prop surface:
|
|
9
|
+
*
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <ChatEmptyState.Root>
|
|
12
|
+
* <ChatEmptyState.Avatar src={agent.avatarUrl} alt={agent.name} />
|
|
13
|
+
* <ChatEmptyState.Heading>{agent.name}</ChatEmptyState.Heading>
|
|
14
|
+
* <ChatEmptyState.Suggestions>
|
|
15
|
+
* <ChatEmptyState.Suggestion onClick={() => send("Create a plan")}>
|
|
16
|
+
* Create a plan
|
|
17
|
+
* </ChatEmptyState.Suggestion>
|
|
18
|
+
* </ChatEmptyState.Suggestions>
|
|
19
|
+
* </ChatEmptyState.Root>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @module react/components/chat/composition/chat-empty-state
|
|
23
|
+
*/
|
|
24
|
+
import * as React from "../../../../../../react/react.js";
|
|
25
|
+
import { cn } from "../../theme.js";
|
|
26
|
+
import { Avatar, Button } from "../../ui/index.js";
|
|
27
|
+
/** Centered container for the empty-state pieces. */
|
|
28
|
+
function Root({ className, children, ref, ...props }) {
|
|
29
|
+
return (React.createElement("div", { ref: ref, className: cn("flex flex-1 flex-col items-center justify-center gap-3.5 px-4", className), ...props }, children));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Hero agent avatar (64px). Renders the generic {@link Avatar} in `muted`
|
|
33
|
+
* tone — the agent's image when `src` resolves, otherwise its initial. Same as
|
|
34
|
+
* Studio's `ChatIdleView` avatar: agent identity comes from the data, not a
|
|
35
|
+
* bespoke component.
|
|
36
|
+
*/
|
|
37
|
+
function EmptyStateAvatar({ className, isCreating, src, alt = "Veryfront Agent", ...props }) {
|
|
38
|
+
return (React.createElement(Avatar, { name: alt, avatarSrc: src, tone: "muted", className: cn("size-16!", isCreating && "animate-pulse", className), ...props }));
|
|
39
|
+
}
|
|
40
|
+
/** Balanced, centered title (e.g. the agent name). */
|
|
41
|
+
function Heading({ level = 2, className, children, ref, ...props }) {
|
|
42
|
+
const Tag = `h${level}`;
|
|
43
|
+
return (React.createElement(Tag, { ref: ref, className: cn("text-[1.375rem] font-semibold text-balance text-center leading-[1.2] tracking-normal text-[var(--foreground)]", className), ...props }, children));
|
|
44
|
+
}
|
|
45
|
+
/** Wrapping, centered row of suggestion chips. */
|
|
46
|
+
function Suggestions({ className, role = "group", children, ref, ...props }) {
|
|
47
|
+
return (React.createElement("div", { ref: ref, role: role, className: cn("mt-4 flex flex-wrap justify-center gap-2", className), ...props }, children));
|
|
48
|
+
}
|
|
49
|
+
/** A single filled suggestion chip. */
|
|
50
|
+
function Suggestion({ className, size = "sm", children, ...props }) {
|
|
51
|
+
return (React.createElement(Button, { variant: "tertiary", size: size, className: cn("h-9! rounded-md! px-3.5", className), ...props }, children));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Compound empty state. Use the namespaced parts to compose the view:
|
|
55
|
+
* `Root`, `Avatar`, `Heading`, `Suggestions`, `Suggestion`.
|
|
56
|
+
*/
|
|
57
|
+
export const ChatEmptyState = {
|
|
58
|
+
Root,
|
|
59
|
+
Avatar: EmptyStateAvatar,
|
|
60
|
+
Heading,
|
|
61
|
+
Suggestions,
|
|
62
|
+
Suggestion,
|
|
63
|
+
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ChatEmpty —
|
|
2
|
+
* ChatEmpty — the preset's empty state, composed from the `ChatEmptyState`
|
|
3
|
+
* primitive (`Root` + `Avatar`/icon + `Heading` + `Suggestions`/`Suggestion`)
|
|
4
|
+
* plus optional `QuickActions`. Prop-driven wrapper so `<Chat>` can render an
|
|
5
|
+
* empty state from data; drop to `ChatEmptyState.*` directly for full control.
|
|
3
6
|
*
|
|
4
7
|
* @module react/components/chat/composition/chat-empty
|
|
5
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-empty.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-empty.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"chat-empty.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-empty.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,gCAAgC,CAAC;AAEhF,oCAAoC;AACpC,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,yBAAyB;AACzB,eAAO,MAAM,SAAS,uFAgDrB,CAAC"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ChatEmpty —
|
|
2
|
+
* ChatEmpty — the preset's empty state, composed from the `ChatEmptyState`
|
|
3
|
+
* primitive (`Root` + `Avatar`/icon + `Heading` + `Suggestions`/`Suggestion`)
|
|
4
|
+
* plus optional `QuickActions`. Prop-driven wrapper so `<Chat>` can render an
|
|
5
|
+
* empty state from data; drop to `ChatEmptyState.*` directly for full control.
|
|
3
6
|
*
|
|
4
7
|
* @module react/components/chat/composition/chat-empty
|
|
5
8
|
*/
|
|
6
9
|
import * as React from "../../../../../../react/react.js";
|
|
7
|
-
import {
|
|
8
|
-
import { ConversationEmptyState, Suggestion, Suggestions } from "../components/empty-state.js";
|
|
10
|
+
import { ChatEmptyState } from "./chat-empty-state.js";
|
|
9
11
|
import { QuickActions } from "../components/quick-actions.js";
|
|
10
12
|
/** Render chat empty. */
|
|
11
13
|
export const ChatEmpty = React.forwardRef(function ChatEmpty({ icon, title = "What can I help with?", description, suggestions, onSuggestionClick, quickActions, onQuickAction, className, children, }, ref) {
|
|
12
14
|
const showSuggestions = (suggestions?.length ?? 0) > 0;
|
|
13
15
|
const showQuickActions = (quickActions?.length ?? 0) > 0;
|
|
14
|
-
return (React.createElement(
|
|
15
|
-
|
|
16
|
-
React.createElement(
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
return (React.createElement(ChatEmptyState.Root, { ref: ref, className: className },
|
|
17
|
+
icon,
|
|
18
|
+
React.createElement(ChatEmptyState.Heading, null, title),
|
|
19
|
+
description && (React.createElement("p", { className: "max-w-md text-center text-sm text-[var(--foreground)]" }, description)),
|
|
20
|
+
showSuggestions && (React.createElement(ChatEmptyState.Suggestions, null, suggestions?.map((suggestion) => (React.createElement(ChatEmptyState.Suggestion, { key: suggestion, onClick: () => onSuggestionClick?.(suggestion) }, suggestion))))),
|
|
19
21
|
showQuickActions && (React.createElement("div", { className: "mt-4" },
|
|
20
22
|
React.createElement(QuickActions, { actions: quickActions, onActionClick: onQuickAction }))),
|
|
21
|
-
children
|
|
22
|
-
React.createElement("div", { className: "flex-1" })));
|
|
23
|
+
children));
|
|
23
24
|
});
|
|
24
25
|
ChatEmpty.displayName = "ChatEmpty";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ChatMessageList — Message rendering loop
|
|
2
|
+
* ChatMessageList — Message rendering loop, composed from the `Message` primitive.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Every turn renders through `<Message message={…} />` so the `<Chat>` transcript
|
|
5
|
+
* is identical to the standalone `Message` component (header, reasoning, tools,
|
|
6
|
+
* sources, tokens, hover actions). Pass `renderMessage` to override a row.
|
|
6
7
|
*
|
|
7
8
|
* @module react/components/chat/composition/chat-message-list
|
|
8
9
|
*/
|
|
@@ -23,6 +24,11 @@ export interface ChatMessageListProps {
|
|
|
23
24
|
showSources?: boolean;
|
|
24
25
|
showSteps?: boolean;
|
|
25
26
|
showScrollButton?: boolean;
|
|
27
|
+
/** Override the scroll-to-bottom button; receives the click handler + pin state. */
|
|
28
|
+
renderScrollButton?: (opts: {
|
|
29
|
+
onClick: () => void;
|
|
30
|
+
isAtBottom: boolean;
|
|
31
|
+
}) => React.ReactNode;
|
|
26
32
|
onSourceClick?: (source: Source, index: number) => void;
|
|
27
33
|
inferenceMode?: InferenceMode;
|
|
28
34
|
editMessage?: (messageId: string, newText: string) => Promise<void>;
|
|
@@ -30,6 +36,8 @@ export interface ChatMessageListProps {
|
|
|
30
36
|
switchBranch?: (messageId: string, branchIndex: number) => void;
|
|
31
37
|
onFeedback?: (messageId: string, feedback: FeedbackValue) => void;
|
|
32
38
|
className?: string;
|
|
39
|
+
/** Classes for the inner centered content column (default `max-w-[850px]`). */
|
|
40
|
+
contentClassName?: string;
|
|
33
41
|
children?: React.ReactNode;
|
|
34
42
|
}
|
|
35
43
|
/** Render chat message list. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-list.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-message-list.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"chat-message-list.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-message-list.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAE1D,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,aAAa,EACd,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAMvE,2CAA2C;AAC3C,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAGlB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,KAAK,CAAC,SAAS,CAAC;IAC1D,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,GAAG,mBAAmB,KAAK,KAAK,CAAC,SAAS,CAAC;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oFAAoF;IACpF,kBAAkB,CAAC,EAAE,CACnB,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,IAAI,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE,KAC/C,KAAK,CAAC,SAAS,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,aAAa,CAAC,EAAE,aAAa,CAAC;IAG9B,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,UAAU,CAAC;IAChD,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAGhE,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAElE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,gCAAgC;AAChC,eAAO,MAAM,eAAe,6FA4J3B,CAAC"}
|
|
@@ -1,123 +1,93 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ChatMessageList — Message rendering loop
|
|
2
|
+
* ChatMessageList — Message rendering loop, composed from the `Message` primitive.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Every turn renders through `<Message message={…} />` so the `<Chat>` transcript
|
|
5
|
+
* is identical to the standalone `Message` component (header, reasoning, tools,
|
|
6
|
+
* sources, tokens, hover actions). Pass `renderMessage` to override a row.
|
|
6
7
|
*
|
|
7
8
|
* @module react/components/chat/composition/chat-message-list
|
|
8
9
|
*/
|
|
9
10
|
import * as React from "../../../../../../react/react.js";
|
|
10
|
-
import {
|
|
11
|
+
import { MessageList } from "../../../../primitives/index.js";
|
|
11
12
|
import { cn } from "../../theme.js";
|
|
12
|
-
import { Markdown } from "../../markdown.js";
|
|
13
|
-
import { extractSourcesFromParts, getTextContent, groupPartsInOrder, isSkillToolPart, } from "../utils/message-parts.js";
|
|
14
13
|
import { ConversationScrollButton } from "../components/empty-state.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { ToolCallCard } from "../components/tool-ui.js";
|
|
19
|
-
import { Sources } from "../components/sources.js";
|
|
20
|
-
import { MessageEditForm } from "../components/message-edit-form.js";
|
|
21
|
-
import { BranchPicker } from "../components/branch-picker.js";
|
|
22
|
-
import { MessageFeedback } from "../components/message-feedback.js";
|
|
23
|
-
import { StepIndicator } from "../components/step-indicator.js";
|
|
24
|
-
import { AgentAvatar } from "./agent-avatar.js";
|
|
25
|
-
import { ModelAvatar } from "./model-avatar.js";
|
|
26
|
-
function metadataString(metadata, key) {
|
|
27
|
-
const value = metadata?.[key];
|
|
28
|
-
return typeof value === "string" && value.trim().length > 0 ? value : undefined;
|
|
29
|
-
}
|
|
30
|
-
function getAssistantIdentity(message) {
|
|
31
|
-
return {
|
|
32
|
-
model: metadataString(message.metadata, "model"),
|
|
33
|
-
agentName: metadataString(message.metadata, "agentName") ??
|
|
34
|
-
metadataString(message.metadata, "agentId"),
|
|
35
|
-
agentAvatarUrl: metadataString(message.metadata, "agentAvatarUrl"),
|
|
36
|
-
};
|
|
37
|
-
}
|
|
14
|
+
import { useStickToBottom } from "../hooks/use-stick-to-bottom.js";
|
|
15
|
+
import { PendingMessage } from "./pending-message.js";
|
|
16
|
+
import { Message } from "./message.js";
|
|
38
17
|
/** Render chat message list. */
|
|
39
|
-
export const ChatMessageList = React.forwardRef(function ChatMessageList({ messages, isLoading,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const messageCount = messages.length;
|
|
18
|
+
export const ChatMessageList = React.forwardRef(function ChatMessageList({ messages, isLoading, renderMessage, renderTool, showSources = false, showSteps = false, showScrollButton = false, renderScrollButton, onSourceClick, inferenceMode: _inferenceMode, editMessage, getBranches, switchBranch, onFeedback, className, contentClassName, children, }, ref) {
|
|
19
|
+
// Stick-to-bottom: auto-scroll on new messages only while pinned, and drive
|
|
20
|
+
// the scroll-to-bottom button's visibility off `isAtBottom`.
|
|
21
|
+
const { scrollRef, contentRef, isAtBottom, scrollToBottom } = useStickToBottom(messages.length);
|
|
22
|
+
// Fade the top edge once the user scrolls down, so messages dissolve under
|
|
23
|
+
// whatever sits above the list (e.g. a borderless header) instead of a hard
|
|
24
|
+
// cut. Top-only: the bottom is never masked, so nothing is clipped at rest.
|
|
25
|
+
const [topFaded, setTopFaded] = React.useState(false);
|
|
48
26
|
React.useEffect(() => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
27
|
+
const el = scrollRef.current;
|
|
28
|
+
if (!el)
|
|
29
|
+
return undefined;
|
|
30
|
+
const onScroll = () => setTopFaded(el.scrollTop > 8);
|
|
31
|
+
onScroll();
|
|
32
|
+
el.addEventListener("scroll", onScroll, { passive: true });
|
|
33
|
+
return () => el.removeEventListener("scroll", onScroll);
|
|
34
|
+
}, [scrollRef]);
|
|
35
|
+
// Merge the forwarded ref with the stick-to-bottom scroll container ref.
|
|
36
|
+
const setListRef = React.useCallback((node) => {
|
|
37
|
+
scrollRef.current = node;
|
|
38
|
+
if (typeof ref === "function")
|
|
39
|
+
ref(node);
|
|
40
|
+
else if (ref) {
|
|
41
|
+
ref.current = node;
|
|
42
|
+
}
|
|
43
|
+
}, [ref, scrollRef]);
|
|
44
|
+
const lastMessage = messages[messages.length - 1];
|
|
45
|
+
// Force-scroll to the bottom when the user submits a new message, even if
|
|
46
|
+
// they'd scrolled up into history. `useStickToBottom` only *follows* growth
|
|
47
|
+
// while already pinned, so a fresh user turn from a scrolled-up position
|
|
48
|
+
// would otherwise stay off-screen. Scrolling re-pins the view (the scroll
|
|
49
|
+
// listener flips `isAtBottom` back to true), so the streaming response then
|
|
50
|
+
// follows normally.
|
|
51
|
+
const lastUserIdRef = React.useRef(undefined);
|
|
52
|
+
React.useEffect(() => {
|
|
53
|
+
if (lastMessage?.role !== "user")
|
|
54
|
+
return;
|
|
55
|
+
if (lastMessage.id === lastUserIdRef.current)
|
|
56
|
+
return;
|
|
57
|
+
lastUserIdRef.current = lastMessage.id;
|
|
58
|
+
scrollToBottom("smooth");
|
|
59
|
+
}, [lastMessage, scrollToBottom]);
|
|
60
|
+
return (
|
|
61
|
+
// The scroll button must overlay the *visible* viewport, so it lives in a
|
|
62
|
+
// non-scrolling `relative` wrapper as a sibling of the scroll container —
|
|
63
|
+
// not inside it, where `absolute bottom-4` would anchor to the bottom of
|
|
64
|
+
// the full scrollable content and scroll away with the messages.
|
|
65
|
+
React.createElement("div", { className: cn("relative flex-1 min-h-0 flex flex-col", className) },
|
|
66
|
+
React.createElement(MessageList, { ref: setListRef, className: cn("flex-1 min-h-0 overflow-y-auto", topFaded && "[mask-image:linear-gradient(to_bottom,transparent,black_1.5rem)]") },
|
|
67
|
+
React.createElement("div", { ref: contentRef, className: cn("max-w-[850px] mx-auto px-9 py-6 space-y-6", contentClassName) },
|
|
68
|
+
messages.map((msg) => {
|
|
69
|
+
if (renderMessage) {
|
|
70
|
+
return (React.createElement(React.Fragment, { key: msg.id }, renderMessage(msg)));
|
|
71
|
+
}
|
|
72
|
+
// The last assistant turn shimmers while a response is streaming.
|
|
73
|
+
const isStreaming = Boolean(isLoading && msg === lastMessage && msg.role === "assistant");
|
|
74
|
+
return (React.createElement(Message, { key: msg.id, message: msg, isStreaming: isStreaming, showSources: showSources, showSteps: showSteps, editMessage: editMessage, getBranches: getBranches, switchBranch: switchBranch, onFeedback: onFeedback }, renderTool
|
|
75
|
+
? (React.createElement(React.Fragment, null,
|
|
76
|
+
React.createElement(Message.Header, null),
|
|
77
|
+
React.createElement(Message.Content, { showSources: showSources, showSteps: showSteps, renderTool: renderTool, onSourceClick: onSourceClick }),
|
|
78
|
+
React.createElement(Message.Continuing, null),
|
|
79
|
+
React.createElement("div", { className: "mt-1.5 flex items-center gap-0.5" },
|
|
80
|
+
React.createElement(Message.Actions, null),
|
|
81
|
+
React.createElement(Message.Tokens, null))))
|
|
82
|
+
: undefined));
|
|
83
|
+
}),
|
|
84
|
+
isLoading && lastMessage?.role !== "assistant" && React.createElement(PendingMessage, null)),
|
|
85
|
+
children),
|
|
86
|
+
showScrollButton && (renderScrollButton
|
|
87
|
+
? renderScrollButton({
|
|
88
|
+
onClick: () => scrollToBottom("smooth"),
|
|
89
|
+
isAtBottom,
|
|
90
|
+
})
|
|
91
|
+
: (!isAtBottom && React.createElement(ConversationScrollButton, { onClick: () => scrollToBottom("smooth") })))));
|
|
71
92
|
});
|
|
72
93
|
ChatMessageList.displayName = "ChatMessageList";
|
|
73
|
-
function UserMessage({ message: msg, theme, isEditing, onStartEdit, onCancelEdit, editMessage, getBranches, switchBranch, }) {
|
|
74
|
-
const content = getTextContent(msg);
|
|
75
|
-
const branches = getBranches?.(msg.id);
|
|
76
|
-
const hasBranches = branches && branches.total > 1;
|
|
77
|
-
return (React.createElement(MessageItem, { role: msg.role, className: cn("flex flex-col items-end", "group/msg") },
|
|
78
|
-
isEditing
|
|
79
|
-
? (React.createElement("div", { className: "w-full max-w-md" },
|
|
80
|
-
React.createElement(MessageEditForm, { initialContent: content, onSave: (text) => {
|
|
81
|
-
onCancelEdit();
|
|
82
|
-
editMessage?.(msg.id, text);
|
|
83
|
-
}, onCancel: onCancelEdit })))
|
|
84
|
-
: (React.createElement("div", { className: theme?.message?.user },
|
|
85
|
-
React.createElement("p", { className: "whitespace-pre-wrap text-[15px] leading-relaxed" }, content))),
|
|
86
|
-
!isEditing && (React.createElement("div", { className: "flex items-center gap-2 mt-1" },
|
|
87
|
-
hasBranches && (React.createElement(BranchPicker, { current: branches.current, total: branches.total, onPrev: () => switchBranch?.(msg.id, branches.current - 2), onNext: () => switchBranch?.(msg.id, branches.current) })),
|
|
88
|
-
editMessage && React.createElement(MessageActions, { content: content, onEdit: onStartEdit })))));
|
|
89
|
-
}
|
|
90
|
-
function AssistantMessage({ message: msg, theme, renderTool, showMessageActions = true, showSources = false, showSteps = false, onSourceClick, onFeedback, feedbackMap, }) {
|
|
91
|
-
const partGroups = groupPartsInOrder(msg.parts);
|
|
92
|
-
const stepCount = partGroups.filter((g) => g.type === "step").length;
|
|
93
|
-
const textContent = getTextContent(msg);
|
|
94
|
-
const messageSources = showSources ? extractSourcesFromParts(msg.parts) : [];
|
|
95
|
-
const identity = getAssistantIdentity(msg);
|
|
96
|
-
return (React.createElement(MessageItem, { role: msg.role, className: cn("flex items-start gap-3", "justify-start", "group/msg") },
|
|
97
|
-
React.createElement(AgentAvatar, { name: identity.agentName, avatarUrl: identity.agentAvatarUrl, model: identity.model }),
|
|
98
|
-
React.createElement("div", { className: cn(theme?.message?.assistant, "flex-1 min-w-0") },
|
|
99
|
-
identity.agentName && (React.createElement("div", { className: "mb-1 text-xs font-medium text-[var(--muted-foreground)]" }, identity.agentName)),
|
|
100
|
-
partGroups.map((group, index) => {
|
|
101
|
-
if (group.type === "text") {
|
|
102
|
-
return (React.createElement(Markdown, { key: `text-${index}`, className: "text-[15px] leading-7" }, group.content));
|
|
103
|
-
}
|
|
104
|
-
if (group.type === "reasoning") {
|
|
105
|
-
return (React.createElement(ReasoningCard, { key: `reasoning-${index}`, text: group.text, isStreaming: group.isStreaming }));
|
|
106
|
-
}
|
|
107
|
-
if (group.type === "step") {
|
|
108
|
-
return showSteps && stepCount > 1
|
|
109
|
-
? (React.createElement(StepIndicator, { key: `step-${group.stepIndex}`, stepIndex: group.stepIndex, isComplete: group.isComplete }))
|
|
110
|
-
: null;
|
|
111
|
-
}
|
|
112
|
-
const isSkill = isSkillToolPart(group.tool);
|
|
113
|
-
return (React.createElement("div", { key: group.tool.toolCallId, className: isSkill ? "my-2" : "my-3" }, renderTool
|
|
114
|
-
? renderTool(group.tool)
|
|
115
|
-
: isSkill
|
|
116
|
-
? React.createElement(SkillBadge, { tool: group.tool })
|
|
117
|
-
: React.createElement(ToolCallCard, { tool: group.tool })));
|
|
118
|
-
}),
|
|
119
|
-
(showMessageActions || onFeedback) && textContent && (React.createElement("div", { className: "flex items-center gap-1 mt-1" },
|
|
120
|
-
showMessageActions && React.createElement(MessageActions, { content: textContent }),
|
|
121
|
-
onFeedback && (React.createElement(MessageFeedback, { messageId: msg.id, feedback: feedbackMap[msg.id], onFeedback: onFeedback })))),
|
|
122
|
-
messageSources.length > 0 && (React.createElement(Sources, { sources: messageSources, onSourceClick: onSourceClick })))));
|
|
123
|
-
}
|
|
@@ -28,6 +28,10 @@ export interface ChatRootProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
28
28
|
model?: string;
|
|
29
29
|
models?: ModelOption[];
|
|
30
30
|
onModelChange?: (modelId: string) => void;
|
|
31
|
+
agent?: {
|
|
32
|
+
name?: string;
|
|
33
|
+
avatarUrl?: string;
|
|
34
|
+
};
|
|
31
35
|
attachments?: AttachmentInfo[];
|
|
32
36
|
onAttach?: (files: FileList) => void;
|
|
33
37
|
onRemoveAttachment?: (id: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-root.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-root.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAItE,mCAAmC;AACnC,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC3F,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAG1B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAGrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAGnC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAGtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAG1C,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACrC,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAG1C,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,UAAU,CAAC;IAChD,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAGhE,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAGlE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAGxD,KAAK,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAwB;AACxB,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"chat-root.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-root.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAItE,mCAAmC;AACnC,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC3F,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAG1B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAGrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAGnC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAGtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAG1C,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAG9C,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACrC,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAG1C,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,UAAU,CAAC;IAChD,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAGhE,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAGlE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAGxD,KAAK,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAwB;AACxB,eAAO,MAAM,QAAQ,sFAqHpB,CAAC"}
|
|
@@ -12,7 +12,7 @@ import { getDocumentNonce } from "../../csp-nonce.js";
|
|
|
12
12
|
import { cn, defaultChatTheme, generateTokenCSS, mergeThemes } from "../../theme.js";
|
|
13
13
|
import { ChatContextProvider } from "../contexts/chat-context.js";
|
|
14
14
|
/** Render chat root. */
|
|
15
|
-
export const ChatRoot = React.forwardRef(function ChatRoot({ children, messages, isLoading = false, error = null, input, setInput, onSubmit, onStop, onReload, model, models = [], onModelChange, attachments = [], onAttach, onRemoveAttachment, editMessage, getBranches, switchBranch, onFeedback, showSources = false, onSourceClick, theme: userTheme, maxHeight = "100%", className, style, ...containerProps }, ref) {
|
|
15
|
+
export const ChatRoot = React.forwardRef(function ChatRoot({ children, messages, isLoading = false, error = null, input, setInput, onSubmit, onStop, onReload, model, models = [], onModelChange, agent, attachments = [], onAttach, onRemoveAttachment, editMessage, getBranches, switchBranch, onFeedback, showSources = false, onSourceClick, theme: userTheme, maxHeight = "100%", className, style, ...containerProps }, ref) {
|
|
16
16
|
const theme = React.useMemo(() => mergeThemes(defaultChatTheme, userTheme), [userTheme]);
|
|
17
17
|
const nonce = getDocumentNonce();
|
|
18
18
|
const tokenCSS = React.useMemo(() => generateTokenCSS(), []);
|
|
@@ -36,6 +36,7 @@ export const ChatRoot = React.forwardRef(function ChatRoot({ children, messages,
|
|
|
36
36
|
model,
|
|
37
37
|
models,
|
|
38
38
|
onModelChange,
|
|
39
|
+
agent,
|
|
39
40
|
attachments,
|
|
40
41
|
onAttach,
|
|
41
42
|
onRemoveAttachment,
|
|
@@ -61,6 +62,7 @@ export const ChatRoot = React.forwardRef(function ChatRoot({ children, messages,
|
|
|
61
62
|
model,
|
|
62
63
|
models,
|
|
63
64
|
onModelChange,
|
|
65
|
+
agent,
|
|
64
66
|
attachments,
|
|
65
67
|
onAttach,
|
|
66
68
|
onRemoveAttachment,
|
|
@@ -9,6 +9,10 @@ export interface ErrorBannerProps {
|
|
|
9
9
|
error: Error;
|
|
10
10
|
onRetry?: () => void;
|
|
11
11
|
className?: string;
|
|
12
|
+
/** Override the retry glyph. Defaults to the built-in refresh icon. */
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
/** Label for the retry button. Defaults to "Retry". */
|
|
15
|
+
retryLabel?: string;
|
|
12
16
|
}
|
|
13
17
|
/** Render error banner. */
|
|
14
18
|
export declare const ErrorBanner: React.ForwardRefExoticComponent<ErrorBannerProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-banner.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/error-banner.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"error-banner.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/error-banner.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAM1D,sCAAsC;AACtC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,2BAA2B;AAC3B,eAAO,MAAM,WAAW,yFAqBvB,CAAC"}
|
|
@@ -6,13 +6,16 @@
|
|
|
6
6
|
import * as React from "../../../../../../react/react.js";
|
|
7
7
|
import { cn } from "../../theme.js";
|
|
8
8
|
import { RefreshCwIcon } from "../../icons/index.js";
|
|
9
|
+
import { Alert, AlertAction, AlertContent } from "../../ui/alert.js";
|
|
10
|
+
import { Button } from "../../ui/button.js";
|
|
9
11
|
/** Render error banner. */
|
|
10
|
-
export const ErrorBanner = React.forwardRef(function ErrorBanner({ error, onRetry, className }, ref) {
|
|
11
|
-
return (React.createElement("div", { ref: ref, className: cn("max-w-2xl mx-auto px-4 pb-
|
|
12
|
-
React.createElement(
|
|
13
|
-
React.createElement(
|
|
14
|
-
onRetry && (React.createElement(
|
|
15
|
-
React.createElement(
|
|
16
|
-
|
|
12
|
+
export const ErrorBanner = React.forwardRef(function ErrorBanner({ error, onRetry, className, icon, retryLabel = "Retry" }, ref) {
|
|
13
|
+
return (React.createElement("div", { ref: ref, className: cn("max-w-2xl mx-auto px-4 pb-3", className) },
|
|
14
|
+
React.createElement(Alert, { variant: "error" },
|
|
15
|
+
React.createElement(AlertContent, null, error.message),
|
|
16
|
+
onRetry && (React.createElement(AlertAction, null,
|
|
17
|
+
React.createElement(Button, { variant: "link", size: "sm", onClick: onRetry },
|
|
18
|
+
icon ?? React.createElement(RefreshCwIcon, { className: "size-3.5" }),
|
|
19
|
+
retryLabel))))));
|
|
17
20
|
});
|
|
18
21
|
ErrorBanner.displayName = "ErrorBanner";
|