@dungle-scrubs/admin-ui-soft 0.0.0-stage → 0.1.0
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/GUIDE.md +110 -0
- package/LICENSE +21 -0
- package/README.md +36 -2
- package/THIRD-PARTY-NOTICES.md +25 -0
- package/UPSTREAM-VENDORED-CHANGES.md +317 -0
- package/VENDORED-CHANGES.md +60 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/ai/compositions/agent-console/agent-console.d.ts +109 -0
- package/dist/ai/compositions/agent-console/agent-console.js +644 -0
- package/dist/ai/compositions/attention-feed/attention-feed.d.ts +127 -0
- package/dist/ai/compositions/attention-feed/attention-feed.js +626 -0
- package/dist/ai/compositions/conversation-browser/conversation-browser.d.ts +126 -0
- package/dist/ai/compositions/conversation-browser/conversation-browser.js +364 -0
- package/dist/ai/compositions/redaction-marker/redaction-marker.d.ts +42 -0
- package/dist/ai/compositions/redaction-marker/redaction-marker.js +202 -0
- package/dist/ai/compositions/run-inspector/json-view.js +164 -0
- package/dist/ai/compositions/run-inspector/run-inspector.d.ts +66 -0
- package/dist/ai/compositions/run-inspector/run-inspector.js +703 -0
- package/dist/ai/compositions/run-inspector/run-model.js +155 -0
- package/dist/ai/compositions/tool-approval/json-args.js +54 -0
- package/dist/ai/compositions/tool-approval/tool-approval.d.ts +57 -0
- package/dist/ai/compositions/tool-approval/tool-approval.js +331 -0
- package/dist/ai/compositions/tool-call-row/tool-call-row.js +74 -0
- package/dist/ai/compositions/transcript-viewer/to-thread-messages.js +65 -0
- package/dist/ai/compositions/transcript-viewer/transcript-viewer.d.ts +63 -0
- package/dist/ai/compositions/transcript-viewer/transcript-viewer.js +471 -0
- package/dist/ai/compositions/usage-meter/usage-format.js +107 -0
- package/dist/ai/compositions/usage-meter/usage-meter.d.ts +32 -0
- package/dist/ai/compositions/usage-meter/usage-meter.js +258 -0
- package/dist/ai/testing/mock-clock.d.ts +31 -0
- package/dist/ai/testing/mock-clock.js +66 -0
- package/dist/ai/testing/mock-reply.d.ts +70 -0
- package/dist/ai/testing/mock-reply.js +100 -0
- package/dist/ai/testing/mock-runtime.d.ts +86 -0
- package/dist/ai/testing/mock-runtime.js +384 -0
- package/dist/ai/types.d.ts +323 -0
- package/dist/ai.css +1088 -0
- package/dist/ai.d.ts +160 -0
- package/dist/ai.js +158 -0
- package/dist/components/assistant-ui/elements/activity-graph.d.ts +14 -0
- package/dist/components/assistant-ui/elements/activity-graph.js +69 -0
- package/dist/components/assistant-ui/elements/agent-card.d.ts +21 -0
- package/dist/components/assistant-ui/elements/agent-card.js +75 -0
- package/dist/components/assistant-ui/elements/agent-handoff.d.ts +13 -0
- package/dist/components/assistant-ui/elements/agent-handoff.js +47 -0
- package/dist/components/assistant-ui/elements/agent-plan.d.ts +16 -0
- package/dist/components/assistant-ui/elements/agent-plan.js +93 -0
- package/dist/components/assistant-ui/elements/agent-status.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/agent-status.aui.js +161 -0
- package/dist/components/assistant-ui/elements/agent-status.d.ts +17 -0
- package/dist/components/assistant-ui/elements/agent-status.js +47 -0
- package/dist/components/assistant-ui/elements/approval-card.d.ts +31 -0
- package/dist/components/assistant-ui/elements/approval-card.js +99 -0
- package/dist/components/assistant-ui/elements/artifact-card.d.ts +12 -0
- package/dist/components/assistant-ui/elements/artifact-card.js +47 -0
- package/dist/components/assistant-ui/elements/assistant-modal.aui.d.ts +7 -0
- package/dist/components/assistant-ui/elements/assistant-modal.aui.js +276 -0
- package/dist/components/assistant-ui/elements/assistant-sidebar.aui.d.ts +7 -0
- package/dist/components/assistant-ui/elements/assistant-sidebar.aui.js +18 -0
- package/dist/components/assistant-ui/elements/attachment.aui.d.ts +9 -0
- package/dist/components/assistant-ui/elements/attachment.aui.js +143 -0
- package/dist/components/assistant-ui/elements/background-inbox.d.ts +18 -0
- package/dist/components/assistant-ui/elements/background-inbox.js +65 -0
- package/dist/components/assistant-ui/elements/canvas-split.d.ts +25 -0
- package/dist/components/assistant-ui/elements/canvas-split.js +106 -0
- package/dist/components/assistant-ui/elements/chart.d.ts +19 -0
- package/dist/components/assistant-ui/elements/chart.js +105 -0
- package/dist/components/assistant-ui/elements/chat-panel.d.ts +15 -0
- package/dist/components/assistant-ui/elements/chat-panel.js +82 -0
- package/dist/components/assistant-ui/elements/checkpoint-history.d.ts +17 -0
- package/dist/components/assistant-ui/elements/checkpoint-history.js +60 -0
- package/dist/components/assistant-ui/elements/code-diff.d.ts +18 -0
- package/dist/components/assistant-ui/elements/code-diff.js +89 -0
- package/dist/components/assistant-ui/elements/code-runner.d.ts +15 -0
- package/dist/components/assistant-ui/elements/code-runner.js +108 -0
- package/dist/components/assistant-ui/elements/command-palette.d.ts +20 -0
- package/dist/components/assistant-ui/elements/command-palette.js +129 -0
- package/dist/components/assistant-ui/elements/comparison-card.d.ts +18 -0
- package/dist/components/assistant-ui/elements/comparison-card.js +58 -0
- package/dist/components/assistant-ui/elements/composer-trigger-popover.aui.d.ts +51 -0
- package/dist/components/assistant-ui/elements/composer-trigger-popover.aui.js +104 -0
- package/dist/components/assistant-ui/elements/composer.d.ts +91 -0
- package/dist/components/assistant-ui/elements/composer.js +416 -0
- package/dist/components/assistant-ui/elements/computer-use.d.ts +19 -0
- package/dist/components/assistant-ui/elements/computer-use.js +84 -0
- package/dist/components/assistant-ui/elements/confidence-marker.d.ts +20 -0
- package/dist/components/assistant-ui/elements/confidence-marker.js +58 -0
- package/dist/components/assistant-ui/elements/connection-state.d.ts +13 -0
- package/dist/components/assistant-ui/elements/connection-state.js +59 -0
- package/dist/components/assistant-ui/elements/context-breakdown.d.ts +15 -0
- package/dist/components/assistant-ui/elements/context-breakdown.js +91 -0
- package/dist/components/assistant-ui/elements/context-display.aui.d.ts +25 -0
- package/dist/components/assistant-ui/elements/context-display.aui.js +26 -0
- package/dist/components/assistant-ui/elements/context-display.d.ts +43 -0
- package/dist/components/assistant-ui/elements/context-display.js +300 -0
- package/dist/components/assistant-ui/elements/conversation-map.aui.d.ts +9 -0
- package/dist/components/assistant-ui/elements/conversation-map.aui.js +177 -0
- package/dist/components/assistant-ui/elements/conversation-map.d.ts +19 -0
- package/dist/components/assistant-ui/elements/conversation-map.js +84 -0
- package/dist/components/assistant-ui/elements/conversation-search.d.ts +20 -0
- package/dist/components/assistant-ui/elements/conversation-search.js +75 -0
- package/dist/components/assistant-ui/elements/cost-meter.d.ts +19 -0
- package/dist/components/assistant-ui/elements/cost-meter.js +76 -0
- package/dist/components/assistant-ui/elements/data-table.d.ts +72 -0
- package/dist/components/assistant-ui/elements/data-table.js +368 -0
- package/dist/components/assistant-ui/elements/day-separator.d.ts +16 -0
- package/dist/components/assistant-ui/elements/day-separator.js +44 -0
- package/dist/components/assistant-ui/elements/diagram.d.ts +15 -0
- package/dist/components/assistant-ui/elements/diagram.js +65 -0
- package/dist/components/assistant-ui/elements/directive-text.aui.d.ts +11 -0
- package/dist/components/assistant-ui/elements/directive-text.aui.js +18 -0
- package/dist/components/assistant-ui/elements/directive-text.d.ts +32 -0
- package/dist/components/assistant-ui/elements/directive-text.js +35 -0
- package/dist/components/assistant-ui/elements/document-reference.d.ts +17 -0
- package/dist/components/assistant-ui/elements/document-reference.js +62 -0
- package/dist/components/assistant-ui/elements/draft-restore.d.ts +12 -0
- package/dist/components/assistant-ui/elements/draft-restore.js +43 -0
- package/dist/components/assistant-ui/elements/edit-message.d.ts +15 -0
- package/dist/components/assistant-ui/elements/edit-message.js +63 -0
- package/dist/components/assistant-ui/elements/elicitation-form.d.ts +23 -0
- package/dist/components/assistant-ui/elements/elicitation-form.js +112 -0
- package/dist/components/assistant-ui/elements/empty-state.d.ts +16 -0
- package/dist/components/assistant-ui/elements/empty-state.js +71 -0
- package/dist/components/assistant-ui/elements/error-state.d.ts +13 -0
- package/dist/components/assistant-ui/elements/error-state.js +52 -0
- package/dist/components/assistant-ui/elements/feedback-dialog.d.ts +15 -0
- package/dist/components/assistant-ui/elements/feedback-dialog.js +77 -0
- package/dist/components/assistant-ui/elements/file-tree.d.ts +20 -0
- package/dist/components/assistant-ui/elements/file-tree.js +74 -0
- package/dist/components/assistant-ui/elements/file.d.ts +52 -0
- package/dist/components/assistant-ui/elements/file.js +222 -0
- package/dist/components/assistant-ui/elements/flow-graph.d.ts +23 -0
- package/dist/components/assistant-ui/elements/flow-graph.js +72 -0
- package/dist/components/assistant-ui/elements/follow-up-suggestions.aui.d.ts +7 -0
- package/dist/components/assistant-ui/elements/follow-up-suggestions.aui.js +30 -0
- package/dist/components/assistant-ui/elements/generative-ui.d.ts +8 -0
- package/dist/components/assistant-ui/elements/generative-ui.js +27 -0
- package/dist/components/assistant-ui/elements/geo-map.d.ts +29 -0
- package/dist/components/assistant-ui/elements/geo-map.js +190 -0
- package/dist/components/assistant-ui/elements/guardrail-notice.d.ts +15 -0
- package/dist/components/assistant-ui/elements/guardrail-notice.js +59 -0
- package/dist/components/assistant-ui/elements/heat-graph.d.ts +9 -0
- package/dist/components/assistant-ui/elements/heat-graph.js +90 -0
- package/dist/components/assistant-ui/elements/image-gallery.d.ts +22 -0
- package/dist/components/assistant-ui/elements/image-gallery.js +192 -0
- package/dist/components/assistant-ui/elements/image-generation.d.ts +11 -0
- package/dist/components/assistant-ui/elements/image-generation.js +64 -0
- package/dist/components/assistant-ui/elements/image.d.ts +59 -0
- package/dist/components/assistant-ui/elements/image.js +416 -0
- package/dist/components/assistant-ui/elements/inline-citation.d.ts +23 -0
- package/dist/components/assistant-ui/elements/inline-citation.js +90 -0
- package/dist/components/assistant-ui/elements/job-progress.d.ts +25 -0
- package/dist/components/assistant-ui/elements/job-progress.js +102 -0
- package/dist/components/assistant-ui/elements/launcher-bubble.d.ts +15 -0
- package/dist/components/assistant-ui/elements/launcher-bubble.js +71 -0
- package/dist/components/assistant-ui/elements/link-preview.d.ts +17 -0
- package/dist/components/assistant-ui/elements/link-preview.js +77 -0
- package/dist/components/assistant-ui/elements/loading-state.d.ts +13 -0
- package/dist/components/assistant-ui/elements/loading-state.js +33 -0
- package/dist/components/assistant-ui/elements/logos.d.ts +10 -0
- package/dist/components/assistant-ui/elements/logos.js +63 -0
- package/dist/components/assistant-ui/elements/map-answer.d.ts +19 -0
- package/dist/components/assistant-ui/elements/map-answer.js +120 -0
- package/dist/components/assistant-ui/elements/markdown-text.d.ts +11 -0
- package/dist/components/assistant-ui/elements/markdown-text.js +152 -0
- package/dist/components/assistant-ui/elements/math-block.d.ts +25 -0
- package/dist/components/assistant-ui/elements/math-block.js +60 -0
- package/dist/components/assistant-ui/elements/mcp-config.aui.d.ts +28 -0
- package/dist/components/assistant-ui/elements/mcp-config.aui.js +380 -0
- package/dist/components/assistant-ui/elements/mcp-server-panel.d.ts +20 -0
- package/dist/components/assistant-ui/elements/mcp-server-panel.js +114 -0
- package/dist/components/assistant-ui/elements/media-player.d.ts +21 -0
- package/dist/components/assistant-ui/elements/media-player.js +302 -0
- package/dist/components/assistant-ui/elements/memory-chips.d.ts +16 -0
- package/dist/components/assistant-ui/elements/memory-chips.js +44 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.aui.d.ts +14 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.aui.js +43 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.d.ts +20 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.js +258 -0
- package/dist/components/assistant-ui/elements/message-actions.d.ts +17 -0
- package/dist/components/assistant-ui/elements/message-actions.js +57 -0
- package/dist/components/assistant-ui/elements/message-attachment.d.ts +18 -0
- package/dist/components/assistant-ui/elements/message-attachment.js +58 -0
- package/dist/components/assistant-ui/elements/message-branches.d.ts +12 -0
- package/dist/components/assistant-ui/elements/message-branches.js +55 -0
- package/dist/components/assistant-ui/elements/message-pair.d.ts +16 -0
- package/dist/components/assistant-ui/elements/message-pair.js +63 -0
- package/dist/components/assistant-ui/elements/message-queue.d.ts +15 -0
- package/dist/components/assistant-ui/elements/message-queue.js +70 -0
- package/dist/components/assistant-ui/elements/message-timing.aui.d.ts +30 -0
- package/dist/components/assistant-ui/elements/message-timing.aui.js +98 -0
- package/dist/components/assistant-ui/elements/message-timing.d.ts +14 -0
- package/dist/components/assistant-ui/elements/message-timing.js +26 -0
- package/dist/components/assistant-ui/elements/mobile-composer.d.ts +18 -0
- package/dist/components/assistant-ui/elements/mobile-composer.js +76 -0
- package/dist/components/assistant-ui/elements/model-picker.d.ts +19 -0
- package/dist/components/assistant-ui/elements/model-picker.js +68 -0
- package/dist/components/assistant-ui/elements/model-selector.aui.d.ts +23 -0
- package/dist/components/assistant-ui/elements/model-selector.aui.js +79 -0
- package/dist/components/assistant-ui/elements/model-selector.d.ts +130 -0
- package/dist/components/assistant-ui/elements/model-selector.js +399 -0
- package/dist/components/assistant-ui/elements/number-ticker.d.ts +10 -0
- package/dist/components/assistant-ui/elements/number-ticker.js +41 -0
- package/dist/components/assistant-ui/elements/onboarding.d.ts +17 -0
- package/dist/components/assistant-ui/elements/onboarding.js +69 -0
- package/dist/components/assistant-ui/elements/option-list.d.ts +39 -0
- package/dist/components/assistant-ui/elements/option-list.js +176 -0
- package/dist/components/assistant-ui/elements/permission-grant.d.ts +14 -0
- package/dist/components/assistant-ui/elements/permission-grant.js +84 -0
- package/dist/components/assistant-ui/elements/prompt-library.d.ts +20 -0
- package/dist/components/assistant-ui/elements/prompt-library.js +121 -0
- package/dist/components/assistant-ui/elements/question-flow.d.ts +24 -0
- package/dist/components/assistant-ui/elements/question-flow.js +180 -0
- package/dist/components/assistant-ui/elements/quota-banner.d.ts +14 -0
- package/dist/components/assistant-ui/elements/quota-banner.js +68 -0
- package/dist/components/assistant-ui/elements/quote-reply.d.ts +20 -0
- package/dist/components/assistant-ui/elements/quote-reply.js +66 -0
- package/dist/components/assistant-ui/elements/quote.aui.d.ts +61 -0
- package/dist/components/assistant-ui/elements/quote.aui.js +170 -0
- package/dist/components/assistant-ui/elements/read-aloud.d.ts +16 -0
- package/dist/components/assistant-ui/elements/read-aloud.js +66 -0
- package/dist/components/assistant-ui/elements/reasoning-effort.d.ts +17 -0
- package/dist/components/assistant-ui/elements/reasoning-effort.js +67 -0
- package/dist/components/assistant-ui/elements/reasoning-panel.d.ts +20 -0
- package/dist/components/assistant-ui/elements/reasoning-panel.js +60 -0
- package/dist/components/assistant-ui/elements/reasoning.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/reasoning.aui.js +70 -0
- package/dist/components/assistant-ui/elements/reasoning.d.ts +38 -0
- package/dist/components/assistant-ui/elements/reasoning.js +194 -0
- package/dist/components/assistant-ui/elements/recommendation-card.d.ts +16 -0
- package/dist/components/assistant-ui/elements/recommendation-card.js +65 -0
- package/dist/components/assistant-ui/elements/regenerate-menu.d.ts +18 -0
- package/dist/components/assistant-ui/elements/regenerate-menu.js +46 -0
- package/dist/components/assistant-ui/elements/research-report.d.ts +19 -0
- package/dist/components/assistant-ui/elements/research-report.js +63 -0
- package/dist/components/assistant-ui/elements/retrieval-chunks.d.ts +19 -0
- package/dist/components/assistant-ui/elements/retrieval-chunks.js +86 -0
- package/dist/components/assistant-ui/elements/reviewable-diff.d.ts +21 -0
- package/dist/components/assistant-ui/elements/reviewable-diff.js +104 -0
- package/dist/components/assistant-ui/elements/schedule-card.d.ts +19 -0
- package/dist/components/assistant-ui/elements/schedule-card.js +80 -0
- package/dist/components/assistant-ui/elements/score-breakdown.d.ts +19 -0
- package/dist/components/assistant-ui/elements/score-breakdown.js +107 -0
- package/dist/components/assistant-ui/elements/scroll-anchor.d.ts +15 -0
- package/dist/components/assistant-ui/elements/scroll-anchor.js +104 -0
- package/dist/components/assistant-ui/elements/settings-panel.d.ts +23 -0
- package/dist/components/assistant-ui/elements/settings-panel.js +108 -0
- package/dist/components/assistant-ui/elements/shared-conversation.d.ts +18 -0
- package/dist/components/assistant-ui/elements/shared-conversation.js +56 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.aui.d.ts +29 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.aui.js +31 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.d.ts +26 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.js +49 -0
- package/dist/components/assistant-ui/elements/sources.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/sources.aui.js +121 -0
- package/dist/components/assistant-ui/elements/sources.d.ts +21 -0
- package/dist/components/assistant-ui/elements/sources.js +109 -0
- package/dist/components/assistant-ui/elements/speaker-identity.d.ts +17 -0
- package/dist/components/assistant-ui/elements/speaker-identity.js +45 -0
- package/dist/components/assistant-ui/elements/spec-sheet.d.ts +17 -0
- package/dist/components/assistant-ui/elements/spec-sheet.js +39 -0
- package/dist/components/assistant-ui/elements/stopped-run.d.ts +12 -0
- package/dist/components/assistant-ui/elements/stopped-run.js +44 -0
- package/dist/components/assistant-ui/elements/streaming-text.d.ts +15 -0
- package/dist/components/assistant-ui/elements/streaming-text.js +45 -0
- package/dist/components/assistant-ui/elements/subagent-list.d.ts +17 -0
- package/dist/components/assistant-ui/elements/subagent-list.js +74 -0
- package/dist/components/assistant-ui/elements/suggestions.d.ts +14 -0
- package/dist/components/assistant-ui/elements/suggestions.js +25 -0
- package/dist/components/assistant-ui/elements/surfaces.d.ts +42 -0
- package/dist/components/assistant-ui/elements/surfaces.js +87 -0
- package/dist/components/assistant-ui/elements/syntax-highlighter.d.ts +7 -0
- package/dist/components/assistant-ui/elements/syntax-highlighter.js +41 -0
- package/dist/components/assistant-ui/elements/task-card.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/task-card.aui.js +136 -0
- package/dist/components/assistant-ui/elements/task-card.d.ts +22 -0
- package/dist/components/assistant-ui/elements/task-card.js +104 -0
- package/dist/components/assistant-ui/elements/terminal-block.d.ts +27 -0
- package/dist/components/assistant-ui/elements/terminal-block.js +266 -0
- package/dist/components/assistant-ui/elements/thinking-indicator.d.ts +10 -0
- package/dist/components/assistant-ui/elements/thinking-indicator.js +30 -0
- package/dist/components/assistant-ui/elements/thread-list.aui.d.ts +39 -0
- package/dist/components/assistant-ui/elements/thread-list.aui.js +331 -0
- package/dist/components/assistant-ui/elements/thread-list.d.ts +19 -0
- package/dist/components/assistant-ui/elements/thread-list.js +72 -0
- package/dist/components/assistant-ui/elements/thread-search.d.ts +20 -0
- package/dist/components/assistant-ui/elements/thread-search.js +94 -0
- package/dist/components/assistant-ui/elements/thread.aui.d.ts +36 -0
- package/dist/components/assistant-ui/elements/thread.aui.js +625 -0
- package/dist/components/assistant-ui/elements/threadlist-sidebar.aui.d.ts +19 -0
- package/dist/components/assistant-ui/elements/threadlist-sidebar.aui.js +75 -0
- package/dist/components/assistant-ui/elements/timeline.d.ts +18 -0
- package/dist/components/assistant-ui/elements/timeline.js +40 -0
- package/dist/components/assistant-ui/elements/todo-list.d.ts +21 -0
- package/dist/components/assistant-ui/elements/todo-list.js +100 -0
- package/dist/components/assistant-ui/elements/tool-call.d.ts +17 -0
- package/dist/components/assistant-ui/elements/tool-call.js +70 -0
- package/dist/components/assistant-ui/elements/tool-error.d.ts +16 -0
- package/dist/components/assistant-ui/elements/tool-error.js +62 -0
- package/dist/components/assistant-ui/elements/tool-fallback.aui.d.ts +44 -0
- package/dist/components/assistant-ui/elements/tool-fallback.aui.js +542 -0
- package/dist/components/assistant-ui/elements/tool-group.aui.d.ts +37 -0
- package/dist/components/assistant-ui/elements/tool-group.aui.js +104 -0
- package/dist/components/assistant-ui/elements/tool-group.d.ts +20 -0
- package/dist/components/assistant-ui/elements/tool-group.js +71 -0
- package/dist/components/assistant-ui/elements/tool-timeline.d.ts +44 -0
- package/dist/components/assistant-ui/elements/tool-timeline.js +109 -0
- package/dist/components/assistant-ui/elements/tooltip-icon-button.d.ts +12 -0
- package/dist/components/assistant-ui/elements/tooltip-icon-button.js +30 -0
- package/dist/components/assistant-ui/elements/trace-waterfall.d.ts +33 -0
- package/dist/components/assistant-ui/elements/trace-waterfall.js +102 -0
- package/dist/components/assistant-ui/elements/typing-indicator.d.ts +9 -0
- package/dist/components/assistant-ui/elements/typing-indicator.js +45 -0
- package/dist/components/assistant-ui/elements/voice-conversation.aui.d.ts +11 -0
- package/dist/components/assistant-ui/elements/voice-conversation.aui.js +54 -0
- package/dist/components/assistant-ui/elements/voice-conversation.d.ts +21 -0
- package/dist/components/assistant-ui/elements/voice-conversation.js +110 -0
- package/dist/components/assistant-ui/elements/voice.aui.d.ts +22 -0
- package/dist/components/assistant-ui/elements/voice.aui.js +100 -0
- package/dist/components/assistant-ui/elements/voice.d.ts +15 -0
- package/dist/components/assistant-ui/elements/voice.js +400 -0
- package/dist/components/assistant-ui/elements/web-preview.d.ts +18 -0
- package/dist/components/assistant-ui/elements/web-preview.js +61 -0
- package/dist/components/assistant-ui/elements/web-search.d.ts +17 -0
- package/dist/components/assistant-ui/elements/web-search.js +54 -0
- package/dist/components/assistant-ui/utils/href.d.ts +13 -0
- package/dist/components/assistant-ui/utils/href.js +39 -0
- package/dist/components/assistant-ui/utils/range.d.ts +22 -0
- package/dist/components/assistant-ui/utils/range.js +48 -0
- package/dist/components/assistant-ui/utils/task.d.ts +14 -0
- package/dist/components/assistant-ui/utils/task.js +75 -0
- package/dist/components/icons/github.js +13 -0
- package/dist/components/theme-provider.d.ts +16 -0
- package/dist/components/theme-provider.js +116 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.js +53 -0
- package/dist/components/ui/alert-dialog.d.ts +20 -0
- package/dist/components/ui/alert-dialog.js +93 -0
- package/dist/components/ui/alert.d.ts +12 -0
- package/dist/components/ui/alert.js +42 -0
- package/dist/components/ui/aspect-ratio.d.ts +6 -0
- package/dist/components/ui/aspect-ratio.js +13 -0
- package/dist/components/ui/attachment.d.ts +25 -0
- package/dist/components/ui/attachment.js +103 -0
- package/dist/components/ui/avatar.d.ts +13 -0
- package/dist/components/ui/avatar.js +50 -0
- package/dist/components/ui/badge.d.ts +14 -0
- package/dist/components/ui/badge.js +30 -0
- package/dist/components/ui/breadcrumb.d.ts +12 -0
- package/dist/components/ui/breadcrumb.js +71 -0
- package/dist/components/ui/bubble.d.ts +18 -0
- package/dist/components/ui/bubble.js +72 -0
- package/dist/components/ui/button-group.d.ts +12 -0
- package/dist/components/ui/button-group.js +41 -0
- package/dist/components/ui/button.d.ts +19 -0
- package/dist/components/ui/button.js +71 -0
- package/dist/components/ui/calendar.d.ts +12 -0
- package/dist/components/ui/calendar.js +108 -0
- package/dist/components/ui/card.d.ts +13 -0
- package/dist/components/ui/card.js +55 -0
- package/dist/components/ui/carousel.d.ts +30 -0
- package/dist/components/ui/carousel.js +131 -0
- package/dist/components/ui/chart.d.ts +46 -0
- package/dist/components/ui/chart.js +148 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.js +20 -0
- package/dist/components/ui/collapsible.d.ts +7 -0
- package/dist/components/ui/collapsible.js +23 -0
- package/dist/components/ui/combobox.d.ts +26 -0
- package/dist/components/ui/combobox.js +161 -0
- package/dist/components/ui/command.d.ts +21 -0
- package/dist/components/ui/command.js +87 -0
- package/dist/components/ui/context-menu.d.ts +31 -0
- package/dist/components/ui/context-menu.js +132 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dialog.js +91 -0
- package/dist/components/ui/diff-viewer.d.ts +100 -0
- package/dist/components/ui/diff-viewer.js +461 -0
- package/dist/components/ui/direction.d.ts +2 -0
- package/dist/components/ui/direction.js +2 -0
- package/dist/components/ui/dot-matrix.d.ts +150 -0
- package/dist/components/ui/dot-matrix.js +248 -0
- package/dist/components/ui/drawer.d.ts +18 -0
- package/dist/components/ui/drawer.js +123 -0
- package/dist/components/ui/dropdown-menu.d.ts +31 -0
- package/dist/components/ui/dropdown-menu.js +136 -0
- package/dist/components/ui/empty.d.ts +13 -0
- package/dist/components/ui/empty.js +59 -0
- package/dist/components/ui/field.d.ts +26 -0
- package/dist/components/ui/field.js +109 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.js +36 -0
- package/dist/components/ui/input-group.d.ts +20 -0
- package/dist/components/ui/input-group.js +77 -0
- package/dist/components/ui/input-otp.d.ts +13 -0
- package/dist/components/ui/input-otp.js +46 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/input.js +14 -0
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/item.js +120 -0
- package/dist/components/ui/kbd.d.ts +5 -0
- package/dist/components/ui/kbd.js +19 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/label.js +12 -0
- package/dist/components/ui/marker.d.ts +12 -0
- package/dist/components/ui/marker.js +42 -0
- package/dist/components/ui/menubar.d.ts +31 -0
- package/dist/components/ui/menubar.js +135 -0
- package/dist/components/ui/message-scroller.d.ts +12 -0
- package/dist/components/ui/message-scroller.js +59 -0
- package/dist/components/ui/message.d.ts +12 -0
- package/dist/components/ui/message.js +48 -0
- package/dist/components/ui/native-select.d.ts +10 -0
- package/dist/components/ui/native-select.js +37 -0
- package/dist/components/ui/navigation-menu.d.ts +13 -0
- package/dist/components/ui/navigation-menu.js +82 -0
- package/dist/components/ui/number-roll.d.ts +21 -0
- package/dist/components/ui/number-roll.js +269 -0
- package/dist/components/ui/pagination.d.ts +19 -0
- package/dist/components/ui/pagination.js +79 -0
- package/dist/components/ui/popover.d.ts +11 -0
- package/dist/components/ui/popover.js +54 -0
- package/dist/components/ui/progress.d.ts +9 -0
- package/dist/components/ui/progress.js +44 -0
- package/dist/components/ui/questionnaire.d.ts +21 -0
- package/dist/components/ui/questionnaire.js +169 -0
- package/dist/components/ui/radio-group.d.ts +7 -0
- package/dist/components/ui/radio-group.js +26 -0
- package/dist/components/ui/resizable.d.ts +9 -0
- package/dist/components/ui/resizable.js +28 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.js +35 -0
- package/dist/components/ui/select.d.ts +17 -0
- package/dist/components/ui/select.js +96 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.js +14 -0
- package/dist/components/ui/sheet.d.ts +16 -0
- package/dist/components/ui/sheet.js +87 -0
- package/dist/components/ui/sidebar.d.ts +65 -0
- package/dist/components/ui/sidebar.js +386 -0
- package/dist/components/ui/skeleton.d.ts +4 -0
- package/dist/components/ui/skeleton.js +12 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.js +33 -0
- package/dist/components/ui/spinner.d.ts +4 -0
- package/dist/components/ui/spinner.js +15 -0
- package/dist/components/ui/switch.d.ts +7 -0
- package/dist/components/ui/switch.js +19 -0
- package/dist/components/ui/table.d.ts +12 -0
- package/dist/components/ui/table.js +65 -0
- package/dist/components/ui/tabs.d.ts +12 -0
- package/dist/components/ui/tabs.js +45 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/textarea.js +12 -0
- package/dist/components/ui/toast.d.ts +18 -0
- package/dist/components/ui/toast.js +121 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group.js +51 -0
- package/dist/components/ui/toggle.d.ts +10 -0
- package/dist/components/ui/toggle.js +35 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.js +43 -0
- package/dist/compositions/app-rail/app-rail.d.ts +19 -0
- package/dist/compositions/app-rail/app-rail.js +58 -0
- package/dist/compositions/app-shell/app-shell.d.ts +56 -0
- package/dist/compositions/app-shell/app-shell.js +143 -0
- package/dist/compositions/app-shell/theme-toggle.d.ts +10 -0
- package/dist/compositions/app-shell/theme-toggle.js +65 -0
- package/dist/compositions/confirm-action/confirm-action.d.ts +48 -0
- package/dist/compositions/confirm-action/confirm-action.js +48 -0
- package/dist/compositions/data-table/data-table-state.d.ts +23 -0
- package/dist/compositions/data-table/data-table-state.js +46 -0
- package/dist/compositions/data-table/data-table.d.ts +185 -0
- package/dist/compositions/data-table/data-table.js +615 -0
- package/dist/compositions/date-range-picker/date-range-options.d.ts +28 -0
- package/dist/compositions/date-range-picker/date-range-options.js +61 -0
- package/dist/compositions/date-range-picker/date-range-picker.d.ts +55 -0
- package/dist/compositions/date-range-picker/date-range-picker.js +409 -0
- package/dist/compositions/decision-queue/decision-queue.d.ts +114 -0
- package/dist/compositions/decision-queue/decision-queue.js +478 -0
- package/dist/compositions/event-feed/event-feed.d.ts +59 -0
- package/dist/compositions/event-feed/event-feed.js +105 -0
- package/dist/compositions/feedback.d.ts +20 -0
- package/dist/compositions/feedback.js +49 -0
- package/dist/compositions/fields.d.ts +64 -0
- package/dist/compositions/fields.js +293 -0
- package/dist/compositions/form-kit/form-context.d.ts +10 -0
- package/dist/compositions/form-kit/form-context.js +12 -0
- package/dist/compositions/form-kit/form-fields.d.ts +95 -0
- package/dist/compositions/form-kit/form-fields.js +233 -0
- package/dist/compositions/form-kit/form-kit.d.ts +128 -0
- package/dist/compositions/form-kit/form-kit.js +119 -0
- package/dist/compositions/inspector/inspector.d.ts +53 -0
- package/dist/compositions/inspector/inspector.js +80 -0
- package/dist/compositions/layout.d.ts +36 -0
- package/dist/compositions/layout.js +86 -0
- package/dist/compositions/state-blocks/state-blocks.d.ts +42 -0
- package/dist/compositions/state-blocks/state-blocks.js +81 -0
- package/dist/compositions/status-panel/status-panel.d.ts +94 -0
- package/dist/compositions/status-panel/status-panel.js +189 -0
- package/dist/fonts/InterVariable.woff2 +0 -0
- package/dist/fonts/inter.css +15 -0
- package/dist/hooks/use-attachment-src.js +35 -0
- package/dist/hooks/use-copy-to-clipboard.js +34 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +18 -0
- package/dist/index.d.ts +102 -0
- package/dist/index.js +102 -0
- package/dist/lib/context-level.js +7 -0
- package/dist/lib/elapsed.js +61 -0
- package/dist/lib/iso-date.js +30 -0
- package/dist/lib/motion-loop.js +41 -0
- package/dist/lib/pointer.js +14 -0
- package/dist/lib/status-tone.d.ts +7 -0
- package/dist/lib/status-tone.js +55 -0
- package/dist/lib/triage-keys.js +229 -0
- package/dist/lib/utils.js +2 -0
- package/dist/motion/alert-toast/alert-toast.d.ts +51 -0
- package/dist/motion/alert-toast/alert-toast.js +226 -0
- package/dist/motion/branch-menu/branch-menu.d.ts +47 -0
- package/dist/motion/branch-menu/branch-menu.js +287 -0
- package/dist/motion/check-item/check-item.d.ts +24 -0
- package/dist/motion/check-item/check-item.js +110 -0
- package/dist/motion/dial/dial.d.ts +39 -0
- package/dist/motion/dial/dial.js +290 -0
- package/dist/motion/dictation-button/dictation-button.d.ts +45 -0
- package/dist/motion/dictation-button/dictation-button.js +232 -0
- package/dist/motion/hold-button/hold-button.d.ts +37 -0
- package/dist/motion/hold-button/hold-button.js +192 -0
- package/dist/motion/masonry-grid/masonry-grid.d.ts +42 -0
- package/dist/motion/masonry-grid/masonry-grid.js +145 -0
- package/dist/motion/prompt-composer/prompt-composer.d.ts +90 -0
- package/dist/motion/prompt-composer/prompt-composer.js +374 -0
- package/dist/motion/scrub-select/scrub-select.d.ts +33 -0
- package/dist/motion/scrub-select/scrub-select.js +346 -0
- package/dist/motion/spotlight-grid/spotlight-grid.d.ts +40 -0
- package/dist/motion/spotlight-grid/spotlight-grid.js +171 -0
- package/dist/motion/star-rating/star-rating.d.ts +32 -0
- package/dist/motion/star-rating/star-rating.js +191 -0
- package/dist/motion/status-glyph/status-glyph.d.ts +28 -0
- package/dist/motion/status-glyph/status-glyph.js +171 -0
- package/dist/motion/stepper/stepper.d.ts +56 -0
- package/dist/motion/stepper/stepper.js +211 -0
- package/dist/motion/swipe-row/swipe-row.d.ts +52 -0
- package/dist/motion/swipe-row/swipe-row.js +208 -0
- package/dist/motion/thinking-trace/thinking-trace.d.ts +32 -0
- package/dist/motion/thinking-trace/thinking-trace.js +186 -0
- package/dist/motion/tool-call-chip/tool-call-chip.d.ts +36 -0
- package/dist/motion/tool-call-chip/tool-call-chip.js +135 -0
- package/dist/motion/working-indicator/working-indicator.d.ts +38 -0
- package/dist/motion/working-indicator/working-indicator.js +171 -0
- package/dist/styles.css +828 -0
- package/dist/tokens.css +230 -0
- package/licenses/Inter-OFL.txt +92 -0
- package/licenses/assistant-ui-MIT.txt +21 -0
- package/licenses/shadcn-MIT.md +21 -0
- package/package.json +131 -3
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Maximize2, Minus, Plus, RotateCcw, X } from "lucide-react";
|
|
7
|
+
import { createPortal } from "react-dom";
|
|
8
|
+
import { renderMermaidSVG } from "beautiful-mermaid";
|
|
9
|
+
//#region src/components/assistant-ui/elements/mermaid-diagram.tsx
|
|
10
|
+
var mermaid_diagram_exports = /* @__PURE__ */ __exportAll({
|
|
11
|
+
MermaidDiagram: () => MermaidDiagram,
|
|
12
|
+
MermaidZoom: () => MermaidZoom
|
|
13
|
+
});
|
|
14
|
+
const MIN_SCALE = .5;
|
|
15
|
+
const MAX_SCALE = 4;
|
|
16
|
+
function MermaidZoom({ svg, children }) {
|
|
17
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
18
|
+
const [transform, setTransform] = useState({
|
|
19
|
+
x: 0,
|
|
20
|
+
y: 0,
|
|
21
|
+
scale: 1
|
|
22
|
+
});
|
|
23
|
+
const triggerRef = useRef(null);
|
|
24
|
+
const closeRef = useRef(null);
|
|
25
|
+
const overlayRef = useRef(null);
|
|
26
|
+
const viewportRef = useRef(null);
|
|
27
|
+
const drag = useRef(null);
|
|
28
|
+
const transformRef = useRef(transform);
|
|
29
|
+
transformRef.current = transform;
|
|
30
|
+
const zoomSvg = useMemo(() => svg.replace(/id="([^"]+)"/g, "id=\"$1-zoom\"").replace(/url\(#([^)]+)\)/g, "url(#$1-zoom)").replace(/(href|xlink:href)="#([^"]+)"/g, "$1=\"#$2-zoom\""), [svg]);
|
|
31
|
+
const handleClose = useCallback(() => {
|
|
32
|
+
setIsOpen(false);
|
|
33
|
+
setTransform({
|
|
34
|
+
x: 0,
|
|
35
|
+
y: 0,
|
|
36
|
+
scale: 1
|
|
37
|
+
});
|
|
38
|
+
triggerRef.current?.focus();
|
|
39
|
+
}, []);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (!isOpen) return;
|
|
42
|
+
const handleKeyDown = (e) => {
|
|
43
|
+
if (e.key === "Escape") {
|
|
44
|
+
handleClose();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (e.key !== "Tab") return;
|
|
48
|
+
const focusables = overlayRef.current?.querySelectorAll("a[href], button:not([disabled]), [tabindex]:not([tabindex=\"-1\"])");
|
|
49
|
+
const first = focusables?.[0];
|
|
50
|
+
const last = focusables?.[focusables.length - 1];
|
|
51
|
+
if (!first || !last) return;
|
|
52
|
+
if (e.shiftKey && document.activeElement === first) {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
last.focus();
|
|
55
|
+
} else if (!e.shiftKey && document.activeElement === last) {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
first.focus();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
61
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
62
|
+
}, [isOpen, handleClose]);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (!isOpen) return;
|
|
65
|
+
const originalOverflow = document.body.style.overflow;
|
|
66
|
+
document.body.style.overflow = "hidden";
|
|
67
|
+
return () => {
|
|
68
|
+
document.body.style.overflow = originalOverflow;
|
|
69
|
+
};
|
|
70
|
+
}, [isOpen]);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (isOpen) closeRef.current?.focus();
|
|
73
|
+
}, [isOpen]);
|
|
74
|
+
const zoomBy = useCallback((factor, cx, cy) => {
|
|
75
|
+
setTransform((t) => {
|
|
76
|
+
const scale = Math.min(MAX_SCALE, Math.max(MIN_SCALE, t.scale * factor));
|
|
77
|
+
const ratio = scale / t.scale;
|
|
78
|
+
if (cx === void 0 || cy === void 0) {
|
|
79
|
+
const viewport = viewportRef.current;
|
|
80
|
+
cx = (viewport?.clientWidth ?? 0) / 2;
|
|
81
|
+
cy = (viewport?.clientHeight ?? 0) / 2;
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
scale,
|
|
85
|
+
x: cx - (cx - t.x) * ratio,
|
|
86
|
+
y: cy - (cy - t.y) * ratio
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
}, []);
|
|
90
|
+
const onWheel = useCallback((e) => {
|
|
91
|
+
const viewport = viewportRef.current;
|
|
92
|
+
if (!viewport) return;
|
|
93
|
+
const rect = viewport.getBoundingClientRect();
|
|
94
|
+
zoomBy(Math.exp(-e.deltaY * .0015), e.clientX - rect.left, e.clientY - rect.top);
|
|
95
|
+
}, [zoomBy]);
|
|
96
|
+
const onPointerDown = useCallback((e) => {
|
|
97
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
98
|
+
const t = transformRef.current;
|
|
99
|
+
drag.current = {
|
|
100
|
+
startX: e.clientX,
|
|
101
|
+
startY: e.clientY,
|
|
102
|
+
originX: t.x,
|
|
103
|
+
originY: t.y
|
|
104
|
+
};
|
|
105
|
+
}, []);
|
|
106
|
+
const onPointerMove = useCallback((e) => {
|
|
107
|
+
const d = drag.current;
|
|
108
|
+
if (!d) return;
|
|
109
|
+
setTransform((t) => ({
|
|
110
|
+
...t,
|
|
111
|
+
x: d.originX + e.clientX - d.startX,
|
|
112
|
+
y: d.originY + e.clientY - d.startY
|
|
113
|
+
}));
|
|
114
|
+
}, []);
|
|
115
|
+
const onPointerUp = useCallback(() => {
|
|
116
|
+
drag.current = null;
|
|
117
|
+
}, []);
|
|
118
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
119
|
+
"data-slot": "mermaid-zoom-wrap",
|
|
120
|
+
className: "aui-mermaid-zoom-wrap group/mermaid relative",
|
|
121
|
+
children: [
|
|
122
|
+
children,
|
|
123
|
+
/* @__PURE__ */ jsx("button", {
|
|
124
|
+
ref: triggerRef,
|
|
125
|
+
type: "button",
|
|
126
|
+
"data-slot": "mermaid-zoom-trigger",
|
|
127
|
+
"aria-label": "Expand diagram",
|
|
128
|
+
onClick: () => setIsOpen(true),
|
|
129
|
+
className: "aui-mermaid-zoom-trigger text-muted-foreground hover:text-foreground hover:border-muted-foreground/70 border-border bg-background absolute top-2 right-2 cursor-pointer rounded-md border p-1.5 opacity-0 transition group-hover/mermaid:opacity-100 focus-visible:opacity-100",
|
|
130
|
+
children: /* @__PURE__ */ jsx(Maximize2, { className: "size-3.5" })
|
|
131
|
+
}),
|
|
132
|
+
isOpen && createPortal(/* @__PURE__ */ jsxs("div", {
|
|
133
|
+
ref: overlayRef,
|
|
134
|
+
"data-slot": "mermaid-zoom-overlay",
|
|
135
|
+
role: "dialog",
|
|
136
|
+
"aria-modal": "true",
|
|
137
|
+
"aria-label": "Diagram",
|
|
138
|
+
className: "aui-mermaid-zoom-overlay fade-in animate-in bg-background fixed inset-0 z-50 duration-200",
|
|
139
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
140
|
+
ref: viewportRef,
|
|
141
|
+
className: "aui-mermaid-zoom-viewport h-full w-full cursor-grab touch-none overflow-hidden active:cursor-grabbing",
|
|
142
|
+
onWheel,
|
|
143
|
+
onPointerDown,
|
|
144
|
+
onPointerMove,
|
|
145
|
+
onPointerUp,
|
|
146
|
+
onPointerCancel: onPointerUp,
|
|
147
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
148
|
+
"data-slot": "mermaid-zoom-content",
|
|
149
|
+
className: "aui-mermaid-zoom-content flex h-full w-full items-center justify-center [&_svg]:max-h-[80vh] [&_svg]:max-w-[90vw]",
|
|
150
|
+
style: {
|
|
151
|
+
transform: `translate(${transform.x}px, ${transform.y}px) scale(${transform.scale})`,
|
|
152
|
+
transformOrigin: "0 0"
|
|
153
|
+
},
|
|
154
|
+
dangerouslySetInnerHTML: { __html: zoomSvg }
|
|
155
|
+
})
|
|
156
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
157
|
+
"data-slot": "mermaid-zoom-toolbar",
|
|
158
|
+
className: "aui-mermaid-zoom-toolbar border-border bg-background absolute top-4 right-4 flex items-center gap-1 rounded-lg border p-1",
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ jsx("button", {
|
|
161
|
+
type: "button",
|
|
162
|
+
"aria-label": "Zoom in",
|
|
163
|
+
onClick: () => zoomBy(1.25),
|
|
164
|
+
className: "text-muted-foreground hover:text-foreground cursor-pointer rounded-sm p-1.5",
|
|
165
|
+
children: /* @__PURE__ */ jsx(Plus, { className: "size-4" })
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ jsx("button", {
|
|
168
|
+
type: "button",
|
|
169
|
+
"aria-label": "Zoom out",
|
|
170
|
+
onClick: () => zoomBy(.8),
|
|
171
|
+
className: "text-muted-foreground hover:text-foreground cursor-pointer rounded-sm p-1.5",
|
|
172
|
+
children: /* @__PURE__ */ jsx(Minus, { className: "size-4" })
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ jsx("button", {
|
|
175
|
+
type: "button",
|
|
176
|
+
"aria-label": "Reset zoom",
|
|
177
|
+
onClick: () => setTransform({
|
|
178
|
+
x: 0,
|
|
179
|
+
y: 0,
|
|
180
|
+
scale: 1
|
|
181
|
+
}),
|
|
182
|
+
className: "text-muted-foreground hover:text-foreground cursor-pointer rounded-sm p-1.5",
|
|
183
|
+
children: /* @__PURE__ */ jsx(RotateCcw, { className: "size-4" })
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ jsx("button", {
|
|
186
|
+
ref: closeRef,
|
|
187
|
+
type: "button",
|
|
188
|
+
"aria-label": "Close",
|
|
189
|
+
onClick: handleClose,
|
|
190
|
+
className: "text-muted-foreground hover:text-foreground cursor-pointer rounded-sm p-1.5",
|
|
191
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-4" })
|
|
192
|
+
})
|
|
193
|
+
]
|
|
194
|
+
})]
|
|
195
|
+
}), document.body)
|
|
196
|
+
]
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
const MermaidDiagramImpl = ({ code, className, streaming = false }) => {
|
|
200
|
+
const result = useMemo(() => {
|
|
201
|
+
if (streaming) return null;
|
|
202
|
+
try {
|
|
203
|
+
return {
|
|
204
|
+
svg: renderMermaidSVG(code, {
|
|
205
|
+
bg: "var(--background)",
|
|
206
|
+
fg: "var(--foreground)",
|
|
207
|
+
muted: "var(--muted-foreground)",
|
|
208
|
+
border: "var(--border)",
|
|
209
|
+
accent: "var(--foreground)",
|
|
210
|
+
transparent: true
|
|
211
|
+
}),
|
|
212
|
+
error: null
|
|
213
|
+
};
|
|
214
|
+
} catch (err) {
|
|
215
|
+
return {
|
|
216
|
+
svg: null,
|
|
217
|
+
error: err instanceof Error ? err : new Error(String(err))
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
}, [streaming, code]);
|
|
221
|
+
if (!result) return /* @__PURE__ */ jsxs("div", {
|
|
222
|
+
"data-slot": "mermaid-skeleton",
|
|
223
|
+
role: "status",
|
|
224
|
+
"aria-label": "Rendering diagram",
|
|
225
|
+
className: cn("aui-mermaid-skeleton bg-muted flex h-32 animate-pulse items-center justify-center gap-3 rounded-b-lg p-4", className),
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ jsx("div", { className: "bg-muted-foreground/20 h-8 w-20 rounded-md" }),
|
|
228
|
+
/* @__PURE__ */ jsx("div", { className: "bg-muted-foreground/20 h-px w-10" }),
|
|
229
|
+
/* @__PURE__ */ jsx("div", { className: "bg-muted-foreground/20 h-8 w-20 rounded-md" }),
|
|
230
|
+
/* @__PURE__ */ jsx("div", { className: "bg-muted-foreground/20 h-px w-10" }),
|
|
231
|
+
/* @__PURE__ */ jsx("div", { className: "bg-muted-foreground/20 h-8 w-20 rounded-md" })
|
|
232
|
+
]
|
|
233
|
+
});
|
|
234
|
+
if (result.error) return /* @__PURE__ */ jsxs("div", {
|
|
235
|
+
"data-slot": "mermaid-fallback",
|
|
236
|
+
className: cn("aui-mermaid-fallback bg-muted/75 rounded-b-lg", className),
|
|
237
|
+
children: [/* @__PURE__ */ jsx("pre", {
|
|
238
|
+
className: "overflow-x-auto p-4 text-sm",
|
|
239
|
+
children: code.trim()
|
|
240
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
241
|
+
className: "text-muted-foreground border-border border-t px-4 py-1.5 text-xs",
|
|
242
|
+
children: "diagram could not be rendered"
|
|
243
|
+
})]
|
|
244
|
+
});
|
|
245
|
+
return /* @__PURE__ */ jsx(MermaidZoom, {
|
|
246
|
+
svg: result.svg,
|
|
247
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
248
|
+
"data-slot": "mermaid-diagram",
|
|
249
|
+
className: cn("aui-mermaid-diagram bg-muted overflow-x-auto rounded-b-lg p-2 [&_svg]:mx-auto [&_svg]:h-auto [&_svg]:max-w-full", className),
|
|
250
|
+
dangerouslySetInnerHTML: { __html: result.svg }
|
|
251
|
+
})
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
const MermaidDiagram = memo(MermaidDiagramImpl);
|
|
255
|
+
MermaidDiagram.displayName = "MermaidDiagram";
|
|
256
|
+
MermaidDiagram.Zoom = MermaidZoom;
|
|
257
|
+
//#endregion
|
|
258
|
+
export { MermaidDiagram, MermaidZoom, mermaid_diagram_exports };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace message_actions_d_exports {
|
|
3
|
+
export { MessageActions, MessageActionsProps, Reaction };
|
|
4
|
+
}
|
|
5
|
+
export type Reaction = "up" | "down" | null;
|
|
6
|
+
export interface MessageActionsProps extends Omit<ComponentProps<"div">, "children"> {
|
|
7
|
+
copied: boolean;
|
|
8
|
+
reaction: Reaction;
|
|
9
|
+
regenerating: boolean;
|
|
10
|
+
onCopy: () => void;
|
|
11
|
+
onReactionChange: (reaction: Reaction) => void;
|
|
12
|
+
onRegenerate: () => void;
|
|
13
|
+
onMore: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function MessageActions({ copied, reaction, regenerating, onCopy, onReactionChange, onRegenerate, onMore, className, ...props }: MessageActionsProps): import("react").JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { message_actions_d_exports };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { ghostButton, iconSwap, iconSwapIn, iconSwapOut } from "./surfaces.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { CheckIcon, CopyIcon, EllipsisIcon, RefreshCwIcon, ThumbsDownIcon, ThumbsUpIcon } from "lucide-react";
|
|
7
|
+
//#region src/components/assistant-ui/elements/message-actions.tsx
|
|
8
|
+
var message_actions_exports = /* @__PURE__ */ __exportAll({ MessageActions: () => MessageActions });
|
|
9
|
+
function MessageActions({ copied, reaction, regenerating, onCopy, onReactionChange, onRegenerate, onMore, className, ...props }) {
|
|
10
|
+
const buttonClassName = cn(ghostButton, "size-7");
|
|
11
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
12
|
+
"data-slot": "message-actions",
|
|
13
|
+
className: cn("flex items-center gap-1", className),
|
|
14
|
+
...props,
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ jsxs("button", {
|
|
17
|
+
type: "button",
|
|
18
|
+
"aria-label": copied ? "Copied response" : "Copy response",
|
|
19
|
+
onClick: onCopy,
|
|
20
|
+
className: cn(buttonClassName, "grid place-items-center", copied && "text-success"),
|
|
21
|
+
children: [/* @__PURE__ */ jsx(CopyIcon, { className: cn(iconSwap, "size-3.5", copied ? iconSwapOut : iconSwapIn) }), /* @__PURE__ */ jsx(CheckIcon, { className: cn(iconSwap, "size-3.5", copied ? iconSwapIn : iconSwapOut) })]
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ jsx("button", {
|
|
24
|
+
type: "button",
|
|
25
|
+
"aria-label": "Mark response helpful",
|
|
26
|
+
"aria-pressed": reaction === "up",
|
|
27
|
+
onClick: () => onReactionChange(reaction === "up" ? null : "up"),
|
|
28
|
+
className: cn(buttonClassName, reaction === "up" && "bg-foreground/[0.06] text-foreground/90 dark:bg-foreground/[0.09]"),
|
|
29
|
+
children: /* @__PURE__ */ jsx(ThumbsUpIcon, { className: "size-3.5" })
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ jsx("button", {
|
|
32
|
+
type: "button",
|
|
33
|
+
"aria-label": "Mark response unhelpful",
|
|
34
|
+
"aria-pressed": reaction === "down",
|
|
35
|
+
onClick: () => onReactionChange(reaction === "down" ? null : "down"),
|
|
36
|
+
className: cn(buttonClassName, reaction === "down" && "bg-foreground/[0.06] text-foreground/90 dark:bg-foreground/[0.09]"),
|
|
37
|
+
children: /* @__PURE__ */ jsx(ThumbsDownIcon, { className: "size-3.5" })
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsx("button", {
|
|
40
|
+
type: "button",
|
|
41
|
+
"aria-label": "Regenerate response",
|
|
42
|
+
onClick: onRegenerate,
|
|
43
|
+
className: buttonClassName,
|
|
44
|
+
children: /* @__PURE__ */ jsx(RefreshCwIcon, { className: cn("size-3.5", regenerating && "animate-spin motion-reduce:animate-none") })
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ jsx("button", {
|
|
47
|
+
type: "button",
|
|
48
|
+
"aria-label": "More response actions",
|
|
49
|
+
onClick: onMore,
|
|
50
|
+
className: buttonClassName,
|
|
51
|
+
children: /* @__PURE__ */ jsx(EllipsisIcon, { className: "size-3.5" })
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { MessageActions, message_actions_exports };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace message_attachment_d_exports {
|
|
3
|
+
export { MessageAttachmentItem, MessageAttachments };
|
|
4
|
+
}
|
|
5
|
+
export interface MessageAttachmentItem {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
size: string;
|
|
9
|
+
kind: "image" | "document" | "file";
|
|
10
|
+
pages?: number;
|
|
11
|
+
swatch?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function MessageAttachments({ attachments, onOpen, className, ...props }: Omit<ComponentProps<"div">, "children" | "attachments" | "onOpen"> & {
|
|
14
|
+
attachments: readonly MessageAttachmentItem[];
|
|
15
|
+
onOpen?: (id: string) => void;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { message_attachment_d_exports };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { field, mono } from "./surfaces.js";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { FileTextIcon, PaperclipIcon } from "lucide-react";
|
|
7
|
+
//#region src/components/assistant-ui/elements/message-attachment.tsx
|
|
8
|
+
var message_attachment_exports = /* @__PURE__ */ __exportAll({ MessageAttachments: () => MessageAttachments });
|
|
9
|
+
function MessageAttachments({ attachments, onOpen, className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx("div", {
|
|
11
|
+
"data-slot": "message-attachments",
|
|
12
|
+
className: cn("flex w-full max-w-sm flex-col gap-1.5", className),
|
|
13
|
+
...props,
|
|
14
|
+
children: attachments.map((item) => {
|
|
15
|
+
const content = item.kind === "image" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
16
|
+
"aria-hidden": true,
|
|
17
|
+
className: cn("size-12 shrink-0 rounded-xl bg-cover bg-center transition-transform duration-300 motion-reduce:transition-none", onOpen && "group-hover:scale-[1.04]"),
|
|
18
|
+
style: {
|
|
19
|
+
backgroundImage: item.swatch,
|
|
20
|
+
backgroundColor: "var(--color-foreground)"
|
|
21
|
+
}
|
|
22
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
23
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
24
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
25
|
+
className: "text-foreground/90 truncate text-[13.5px]",
|
|
26
|
+
children: item.name
|
|
27
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
28
|
+
className: cn(mono, "text-muted-foreground"),
|
|
29
|
+
children: item.size
|
|
30
|
+
})]
|
|
31
|
+
})] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
32
|
+
className: "bg-background/70 text-muted-foreground flex size-8 shrink-0 items-center justify-center rounded-lg",
|
|
33
|
+
children: item.kind === "document" ? /* @__PURE__ */ jsx(FileTextIcon, { className: "size-3.5" }) : /* @__PURE__ */ jsx(PaperclipIcon, { className: "size-3.5" })
|
|
34
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
35
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
36
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
37
|
+
className: "text-foreground/90 truncate text-[13.5px]",
|
|
38
|
+
children: item.name
|
|
39
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
40
|
+
className: cn(mono, "text-muted-foreground"),
|
|
41
|
+
children: [item.size, item.pages !== void 0 && ` · ${item.pages} pages`]
|
|
42
|
+
})]
|
|
43
|
+
})] });
|
|
44
|
+
const className = cn(field, "fade-in animate-in fill-mode-both flex w-full items-center gap-2.5 rounded-2xl px-3 py-2 text-start duration-300", item.kind === "image" && onOpen && "group", onOpen && "transition-colors hover:bg-foreground/[0.07] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring/50");
|
|
45
|
+
return onOpen ? /* @__PURE__ */ jsx("button", {
|
|
46
|
+
type: "button",
|
|
47
|
+
onClick: () => onOpen(item.id),
|
|
48
|
+
className,
|
|
49
|
+
children: content
|
|
50
|
+
}, item.id) : /* @__PURE__ */ jsx("div", {
|
|
51
|
+
className,
|
|
52
|
+
children: content
|
|
53
|
+
}, item.id);
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { MessageAttachments, message_attachment_exports };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace message_branches_d_exports {
|
|
3
|
+
export { MessageBranches, MessageBranchesProps };
|
|
4
|
+
}
|
|
5
|
+
export interface MessageBranchesProps extends Omit<ComponentProps<"div">, "children"> {
|
|
6
|
+
variants: readonly string[];
|
|
7
|
+
index: number;
|
|
8
|
+
onIndexChange: (index: number) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function MessageBranches({ variants, index, onIndexChange, className, ...props }: MessageBranchesProps): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { message_branches_d_exports };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import "./surfaces.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
7
|
+
//#region src/components/assistant-ui/elements/message-branches.tsx
|
|
8
|
+
var message_branches_exports = /* @__PURE__ */ __exportAll({ MessageBranches: () => MessageBranches });
|
|
9
|
+
function MessageBranches({ variants, index, onIndexChange, className, ...props }) {
|
|
10
|
+
const message = variants[index] ?? variants[0] ?? "";
|
|
11
|
+
const hasNavigation = variants.length > 1;
|
|
12
|
+
const goPrevious = () => {
|
|
13
|
+
if (!hasNavigation) return;
|
|
14
|
+
onIndexChange(index === 0 ? variants.length - 1 : index - 1);
|
|
15
|
+
};
|
|
16
|
+
const goNext = () => {
|
|
17
|
+
if (!hasNavigation) return;
|
|
18
|
+
onIndexChange(index === variants.length - 1 ? 0 : index + 1);
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
21
|
+
"data-slot": "message-branches",
|
|
22
|
+
className: cn("flex max-w-sm flex-col gap-2", className),
|
|
23
|
+
...props,
|
|
24
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
25
|
+
className: "fade-in slide-in-from-bottom-1 animate-in text-foreground/90 min-h-[4.25rem] text-sm leading-relaxed duration-300 motion-reduce:animate-none",
|
|
26
|
+
children: message
|
|
27
|
+
}, index), hasNavigation && /* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: "flex items-center gap-1",
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
"aria-label": "Show previous response",
|
|
33
|
+
disabled: !hasNavigation,
|
|
34
|
+
onClick: goPrevious,
|
|
35
|
+
className: cn("flex items-center justify-center rounded-full text-muted-foreground outline-none transition-[background-color,color,scale] duration-150 hover:bg-foreground/[0.06] hover:text-foreground/90 active:scale-[0.96] focus-visible:ring-1 focus-visible:ring-foreground/20 motion-reduce:transition-none dark:hover:bg-foreground/[0.09]", "size-6"),
|
|
36
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "size-3.5" })
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ jsx("span", {
|
|
39
|
+
className: cn("font-mono text-[11px] tracking-tight", "text-muted-foreground px-1 tabular-nums"),
|
|
40
|
+
children: variants.length === 0 ? "0 / 0" : `${index + 1} / ${variants.length}`
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ jsx("button", {
|
|
43
|
+
type: "button",
|
|
44
|
+
"aria-label": "Show next response",
|
|
45
|
+
disabled: !hasNavigation,
|
|
46
|
+
onClick: goNext,
|
|
47
|
+
className: cn("flex items-center justify-center rounded-full text-muted-foreground outline-none transition-[background-color,color,scale] duration-150 hover:bg-foreground/[0.06] hover:text-foreground/90 active:scale-[0.96] focus-visible:ring-1 focus-visible:ring-foreground/20 motion-reduce:transition-none dark:hover:bg-foreground/[0.09]", "size-6"),
|
|
48
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "size-3.5" })
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { MessageBranches, message_branches_exports };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace message_pair_d_exports {
|
|
3
|
+
export { MessagePair, MessagePairProps };
|
|
4
|
+
}
|
|
5
|
+
export interface MessagePairProps extends Omit<ComponentProps<"div">, "children" | "onCopy"> {
|
|
6
|
+
userMessage: string;
|
|
7
|
+
words: readonly string[];
|
|
8
|
+
visibleWords: number;
|
|
9
|
+
streaming: boolean;
|
|
10
|
+
variant?: "bubble" | "flat";
|
|
11
|
+
onCopy?: () => void;
|
|
12
|
+
onRegenerate?: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function MessagePair({ userMessage, words, visibleWords, streaming, variant, onCopy, onRegenerate, className, ...props }: MessagePairProps): import("react").JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { message_pair_d_exports };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { paper } from "./surfaces.js";
|
|
5
|
+
import { take } from "../utils/range.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { CopyIcon, RefreshCwIcon } from "lucide-react";
|
|
8
|
+
//#region src/components/assistant-ui/elements/message-pair.tsx
|
|
9
|
+
var message_pair_exports = /* @__PURE__ */ __exportAll({ MessagePair: () => MessagePair });
|
|
10
|
+
function MessagePair({ userMessage, words, visibleWords, streaming, variant = "bubble", onCopy, onRegenerate, className, ...props }) {
|
|
11
|
+
const shown = take(words, visibleWords);
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
13
|
+
"data-slot": "message-pair",
|
|
14
|
+
className: cn("flex w-full max-w-sm flex-col gap-5", className),
|
|
15
|
+
...props,
|
|
16
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
17
|
+
className: cn("max-w-[85%] self-end text-sm", variant === "bubble" ? cn(paper, "rounded-2xl px-3.5 py-2") : "text-foreground/90 text-end"),
|
|
18
|
+
children: userMessage
|
|
19
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
20
|
+
className: "group/message flex flex-col items-start",
|
|
21
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
22
|
+
className: "min-h-[4.25rem] text-sm leading-relaxed",
|
|
23
|
+
children: [
|
|
24
|
+
shown.map((word, index) => /* @__PURE__ */ jsxs("span", {
|
|
25
|
+
className: "fade-in animate-in fill-mode-both duration-500 motion-reduce:animate-none",
|
|
26
|
+
children: [word, " "]
|
|
27
|
+
}, `${word}-${index}`)),
|
|
28
|
+
streaming && shown.length === 0 && /* @__PURE__ */ jsxs("span", {
|
|
29
|
+
role: "status",
|
|
30
|
+
"aria-label": "Waiting for the reply",
|
|
31
|
+
className: "inline-flex items-center gap-1 py-2 align-middle",
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ jsx("span", { className: "size-1.5 animate-pulse rounded-full bg-muted-foreground motion-reduce:animate-none" }),
|
|
34
|
+
/* @__PURE__ */ jsx("span", { className: "size-1.5 animate-pulse rounded-full bg-muted-foreground [animation-delay:-0.7s] motion-reduce:animate-none" }),
|
|
35
|
+
/* @__PURE__ */ jsx("span", { className: "size-1.5 animate-pulse rounded-full bg-muted-foreground [animation-delay:-1.4s] motion-reduce:animate-none" })
|
|
36
|
+
]
|
|
37
|
+
}),
|
|
38
|
+
streaming && shown.length > 0 && /* @__PURE__ */ jsx("span", {
|
|
39
|
+
"aria-hidden": true,
|
|
40
|
+
className: "-mb-0.5 ml-0.5 inline-block h-4 w-0.5 animate-pulse rounded-full bg-foreground motion-reduce:animate-none"
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
}), (onCopy || onRegenerate) && /* @__PURE__ */ jsxs("div", {
|
|
44
|
+
className: "flex items-center gap-1 pt-1 opacity-0 transition-opacity group-focus-within/message:opacity-100 group-hover/message:opacity-100 motion-reduce:transition-none",
|
|
45
|
+
children: [onCopy && /* @__PURE__ */ jsx("button", {
|
|
46
|
+
type: "button",
|
|
47
|
+
"aria-label": "Copy response",
|
|
48
|
+
onClick: onCopy,
|
|
49
|
+
className: cn("flex items-center justify-center rounded-full text-muted-foreground outline-none transition-[background-color,color,scale] duration-150 hover:bg-foreground/[0.06] hover:text-foreground/90 active:scale-[0.96] focus-visible:ring-1 focus-visible:ring-foreground/20 motion-reduce:transition-none dark:hover:bg-foreground/[0.09]", "size-7"),
|
|
50
|
+
children: /* @__PURE__ */ jsx(CopyIcon, { className: "size-3.5" })
|
|
51
|
+
}), onRegenerate && /* @__PURE__ */ jsx("button", {
|
|
52
|
+
type: "button",
|
|
53
|
+
"aria-label": "Regenerate response",
|
|
54
|
+
onClick: onRegenerate,
|
|
55
|
+
className: cn("flex items-center justify-center rounded-full text-muted-foreground outline-none transition-[background-color,color,scale] duration-150 hover:bg-foreground/[0.06] hover:text-foreground/90 active:scale-[0.96] focus-visible:ring-1 focus-visible:ring-foreground/20 motion-reduce:transition-none dark:hover:bg-foreground/[0.09]", "size-7"),
|
|
56
|
+
children: /* @__PURE__ */ jsx(RefreshCwIcon, { className: "size-3.5" })
|
|
57
|
+
})]
|
|
58
|
+
})]
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { MessagePair, message_pair_exports };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace message_queue_d_exports {
|
|
3
|
+
export { MessageQueue, QueuedMessage };
|
|
4
|
+
}
|
|
5
|
+
export interface QueuedMessage {
|
|
6
|
+
id: string;
|
|
7
|
+
text: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function MessageQueue({ running, queued, onCancel, className, ...props }: Omit<ComponentProps<"div">, "children" | "running" | "queued" | "onCancel"> & {
|
|
10
|
+
running: string;
|
|
11
|
+
queued: readonly QueuedMessage[];
|
|
12
|
+
onCancel?: (id: string) => void;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { message_queue_d_exports };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { field, mono, paper } from "./surfaces.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { ArrowUpIcon, XIcon } from "lucide-react";
|
|
7
|
+
//#region src/components/assistant-ui/elements/message-queue.tsx
|
|
8
|
+
var message_queue_exports = /* @__PURE__ */ __exportAll({ MessageQueue: () => MessageQueue });
|
|
9
|
+
function MessageQueue({ running, queued, onCancel, className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
+
"data-slot": "message-queue",
|
|
12
|
+
className: cn("flex w-full max-w-sm flex-col gap-2", className),
|
|
13
|
+
...props,
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ jsxs("div", {
|
|
16
|
+
className: cn(paper, "flex items-center gap-2.5 rounded-2xl p-3"),
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ jsxs("span", {
|
|
19
|
+
className: "relative flex size-2 shrink-0",
|
|
20
|
+
children: [/* @__PURE__ */ jsx("span", { className: "absolute inline-flex size-full animate-ping rounded-full bg-info/60 motion-reduce:hidden" }), /* @__PURE__ */ jsx("span", { className: "relative inline-flex size-2 rounded-full bg-info dark:bg-info" })]
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ jsx("span", {
|
|
23
|
+
className: "text-foreground/90 min-w-0 flex-1 truncate text-[13.5px]",
|
|
24
|
+
children: running
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ jsx("span", {
|
|
27
|
+
className: cn(mono, "text-muted-foreground shrink-0"),
|
|
28
|
+
children: "running"
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
}),
|
|
32
|
+
queued.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: "flex items-baseline justify-between px-1",
|
|
34
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
35
|
+
className: cn("font-mono text-[11px] tracking-tight", "text-muted-foreground"),
|
|
36
|
+
children: [queued.length, " queued"]
|
|
37
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
38
|
+
className: cn("font-mono text-[11px] tracking-tight", "text-muted-foreground"),
|
|
39
|
+
children: "sends when this finishes"
|
|
40
|
+
})]
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ jsx("ul", {
|
|
43
|
+
className: "flex flex-col gap-1.5",
|
|
44
|
+
children: queued.map((message, index) => /* @__PURE__ */ jsxs("li", {
|
|
45
|
+
className: cn(field, "fade-in slide-in-from-bottom-1 animate-in fill-mode-both flex items-center gap-2.5 rounded-2xl py-2 pr-2 pl-3 duration-300"),
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx("span", {
|
|
48
|
+
className: cn(mono, "text-muted-foreground w-3 shrink-0 tabular-nums"),
|
|
49
|
+
children: index + 1
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ jsx("span", {
|
|
52
|
+
className: "text-muted-foreground min-w-0 flex-1 truncate text-[13.5px]",
|
|
53
|
+
children: message.text
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ jsx(ArrowUpIcon, { className: "text-muted-foreground size-3 shrink-0" }),
|
|
56
|
+
onCancel && /* @__PURE__ */ jsx("button", {
|
|
57
|
+
type: "button",
|
|
58
|
+
"aria-label": `Remove "${message.text}" from the queue`,
|
|
59
|
+
onClick: () => onCancel(message.id),
|
|
60
|
+
className: cn("flex items-center justify-center rounded-full text-muted-foreground outline-none transition-[background-color,color,scale] duration-150 hover:bg-foreground/[0.06] hover:text-foreground/90 active:scale-[0.96] focus-visible:ring-1 focus-visible:ring-foreground/20 motion-reduce:transition-none dark:hover:bg-foreground/[0.09]", "size-6 shrink-0"),
|
|
61
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "size-3.5" })
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
}, message.id))
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { MessageQueue, message_queue_exports };
|