@dungle-scrubs/admin-ui-soft 0.0.0-stage → 0.0.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 +133 -4
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { ImageMessagePart, ImageMessagePartComponent } from "@assistant-ui/react";
|
|
4
|
+
declare namespace image_d_exports {
|
|
5
|
+
export { Image, ImageActions, ImageActionsProps, ImageContentFilterError, ImageFilename, ImageGenerating, ImagePreview, ImageRoot, ImageRootProps, ImageSource, ImageSourceProps, ImageZoom, imageVariants };
|
|
6
|
+
}
|
|
7
|
+
declare const imageVariants: (props?: ({
|
|
8
|
+
variant?: "ghost" | "muted" | "outline" | null | undefined;
|
|
9
|
+
size?: "default" | "full" | "lg" | "sm" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
export type ImageRootProps = React.ComponentProps<"div"> & VariantProps<typeof imageVariants>;
|
|
12
|
+
declare function ImageRoot({ className, variant, size, children, ...props }: ImageRootProps): import("react").JSX.Element;
|
|
13
|
+
type ImagePreviewProps = Omit<React.ComponentProps<"img">, "children"> & {
|
|
14
|
+
containerClassName?: string | undefined;
|
|
15
|
+
ratio?: "auto" | "1:1" | "4:3" | "16:9" | "9:16" | undefined;
|
|
16
|
+
fit?: "cover" | "contain" | undefined;
|
|
17
|
+
};
|
|
18
|
+
declare function ImagePreview({ className, containerClassName, ratio, fit, onLoad, onError, alt, src, ...props }: ImagePreviewProps): import("react").JSX.Element;
|
|
19
|
+
export type ImageSourceProps = {
|
|
20
|
+
label?: string | undefined;
|
|
21
|
+
url?: string | undefined;
|
|
22
|
+
iconUrl?: string | undefined;
|
|
23
|
+
} & React.ComponentProps<"div">;
|
|
24
|
+
declare function ImageSource({ className, label, url, iconUrl, ...props }: ImageSourceProps): import("react").JSX.Element | null;
|
|
25
|
+
declare function ImageFilename({ className, children, ...props }: React.ComponentProps<"span">): import("react").JSX.Element | null;
|
|
26
|
+
type ImageZoomProps = PropsWithChildren<{
|
|
27
|
+
src: string;
|
|
28
|
+
alt?: string;
|
|
29
|
+
}>;
|
|
30
|
+
declare function ImageZoom({ src, alt, children }: ImageZoomProps): import("react").JSX.Element;
|
|
31
|
+
declare function ImageGenerating({ className }: {
|
|
32
|
+
className?: string;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
34
|
+
declare function ImageContentFilterError({ className, reason }: {
|
|
35
|
+
className?: string;
|
|
36
|
+
reason?: string;
|
|
37
|
+
}): import("react").JSX.Element;
|
|
38
|
+
export type ImageActionsProps = {
|
|
39
|
+
part: ImageMessagePart;
|
|
40
|
+
/**
|
|
41
|
+
* Wire to your own generation call to show a regenerate button. The button
|
|
42
|
+
* renders only when this is set and the part carries a `prompt`.
|
|
43
|
+
*/
|
|
44
|
+
onRegenerate?: () => void | Promise<void>;
|
|
45
|
+
className?: string;
|
|
46
|
+
};
|
|
47
|
+
declare function ImageActions({ part, onRegenerate, className }: ImageActionsProps): import("react").JSX.Element;
|
|
48
|
+
declare const Image: ImageMessagePartComponent & {
|
|
49
|
+
Root: typeof ImageRoot;
|
|
50
|
+
Preview: typeof ImagePreview;
|
|
51
|
+
Source: typeof ImageSource;
|
|
52
|
+
Filename: typeof ImageFilename;
|
|
53
|
+
Zoom: typeof ImageZoom;
|
|
54
|
+
Actions: typeof ImageActions;
|
|
55
|
+
Generating: typeof ImageGenerating;
|
|
56
|
+
ContentFilterError: typeof ImageContentFilterError;
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
export { Image, ImageActions, ImageContentFilterError, ImageFilename, ImageGenerating, ImagePreview, ImageRoot, ImageSource, ImageZoom, imageVariants, image_d_exports };
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { hostOf, safeHref } from "../utils/href.js";
|
|
5
|
+
import { memo, useCallback, useEffect, useRef, useState } from "react";
|
|
6
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { CopyIcon, DownloadIcon, ImageIcon, ImageOffIcon, Loader2Icon, RefreshCwIcon, ShieldAlertIcon, XIcon } from "lucide-react";
|
|
8
|
+
import { cva } from "class-variance-authority";
|
|
9
|
+
import { createPortal } from "react-dom";
|
|
10
|
+
//#region src/components/assistant-ui/elements/image.tsx
|
|
11
|
+
var image_exports = /* @__PURE__ */ __exportAll({
|
|
12
|
+
Image: () => Image,
|
|
13
|
+
ImageActions: () => ImageActions,
|
|
14
|
+
ImageContentFilterError: () => ImageContentFilterError,
|
|
15
|
+
ImageFilename: () => ImageFilename,
|
|
16
|
+
ImageGenerating: () => ImageGenerating,
|
|
17
|
+
ImagePreview: () => ImagePreview,
|
|
18
|
+
ImageRoot: () => ImageRoot,
|
|
19
|
+
ImageSource: () => ImageSource,
|
|
20
|
+
ImageZoom: () => ImageZoom,
|
|
21
|
+
imageVariants: () => imageVariants
|
|
22
|
+
});
|
|
23
|
+
const extensionForMimeType = (mimeType) => {
|
|
24
|
+
switch (mimeType) {
|
|
25
|
+
case "image/png": return "png";
|
|
26
|
+
case "image/jpeg":
|
|
27
|
+
case "image/jpg": return "jpg";
|
|
28
|
+
case "image/webp": return "webp";
|
|
29
|
+
case "image/gif": return "gif";
|
|
30
|
+
case "image/svg+xml": return "svg";
|
|
31
|
+
default: return "png";
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const dataUriToBlob = (dataUri) => {
|
|
35
|
+
const commaIndex = dataUri.indexOf(",");
|
|
36
|
+
const meta = commaIndex >= 0 ? dataUri.slice(0, commaIndex) : dataUri;
|
|
37
|
+
const data = commaIndex >= 0 ? dataUri.slice(commaIndex + 1) : "";
|
|
38
|
+
const mime = meta.match(/data:([^;]+)/i)?.[1]?.toLowerCase() ?? "application/octet-stream";
|
|
39
|
+
if (!/;base64/i.test(meta)) {
|
|
40
|
+
const parts = [];
|
|
41
|
+
let last = 0;
|
|
42
|
+
for (const match of data.matchAll(/(?:%[\da-f]{2})+/gi)) {
|
|
43
|
+
if (match.index > last) parts.push(data.slice(last, match.index));
|
|
44
|
+
const run = match[0];
|
|
45
|
+
const escaped = new Uint8Array(run.length / 3);
|
|
46
|
+
for (let index = 0; index < escaped.length; index++) escaped[index] = Number.parseInt(run.slice(index * 3 + 1, index * 3 + 3), 16);
|
|
47
|
+
parts.push(escaped);
|
|
48
|
+
last = match.index + run.length;
|
|
49
|
+
}
|
|
50
|
+
parts.push(data.slice(last));
|
|
51
|
+
return new Blob(parts, { type: mime });
|
|
52
|
+
}
|
|
53
|
+
let bytes;
|
|
54
|
+
try {
|
|
55
|
+
const base64 = data.replace(/%([\da-f]{2})/gi, (_match, hex) => String.fromCharCode(Number.parseInt(hex, 16)));
|
|
56
|
+
bytes = atob(base64);
|
|
57
|
+
} catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
const arr = new Uint8Array(bytes.length);
|
|
61
|
+
for (let i = 0; i < bytes.length; i++) arr[i] = bytes.charCodeAt(i);
|
|
62
|
+
return new Blob([arr], { type: mime });
|
|
63
|
+
};
|
|
64
|
+
const mimeFromImage = (image) => image.match(/^data:([^;,]+)/i)?.[1]?.toLowerCase();
|
|
65
|
+
const defaultFilenameFromImage = (image) => {
|
|
66
|
+
const mime = mimeFromImage(image);
|
|
67
|
+
if (mime) return `image.${extensionForMimeType(mime)}`;
|
|
68
|
+
try {
|
|
69
|
+
const encodedBasename = new URL(image, document.baseURI).pathname.split("/").pop() ?? "";
|
|
70
|
+
let basename = encodedBasename;
|
|
71
|
+
try {
|
|
72
|
+
basename = decodeURIComponent(encodedBasename);
|
|
73
|
+
} catch {}
|
|
74
|
+
if (/\.(png|jpe?g|webp|gif|svg)$/i.test(basename)) return basename;
|
|
75
|
+
} catch {}
|
|
76
|
+
return "image.png";
|
|
77
|
+
};
|
|
78
|
+
const downloadImagePart = (part) => {
|
|
79
|
+
if (typeof document === "undefined") return;
|
|
80
|
+
const filename = part.filename ?? defaultFilenameFromImage(part.image);
|
|
81
|
+
const isDataUri = /^data:/i.test(part.image);
|
|
82
|
+
const blob = isDataUri ? dataUriToBlob(part.image) : null;
|
|
83
|
+
if (isDataUri && !blob) return;
|
|
84
|
+
const objectUrl = blob ? URL.createObjectURL(blob) : null;
|
|
85
|
+
const href = objectUrl ?? part.image;
|
|
86
|
+
const a = document.createElement("a");
|
|
87
|
+
a.href = href;
|
|
88
|
+
a.download = filename;
|
|
89
|
+
a.rel = "noopener";
|
|
90
|
+
document.body.appendChild(a);
|
|
91
|
+
a.click();
|
|
92
|
+
document.body.removeChild(a);
|
|
93
|
+
if (objectUrl) setTimeout(() => URL.revokeObjectURL(objectUrl), 4e4);
|
|
94
|
+
};
|
|
95
|
+
const copyImagePart = async (part) => {
|
|
96
|
+
if (typeof navigator === "undefined" || !navigator.clipboard || typeof ClipboardItem === "undefined") throw new Error("Clipboard API is not available in this environment.");
|
|
97
|
+
const blob = /^data:/i.test(part.image) ? dataUriToBlob(part.image) : await fetch(part.image).then((r) => r.blob());
|
|
98
|
+
if (!blob) return;
|
|
99
|
+
const mime = mimeFromImage(part.image) ?? blob.type ?? "image/png";
|
|
100
|
+
await navigator.clipboard.write([new ClipboardItem({ [mime]: blob })]);
|
|
101
|
+
};
|
|
102
|
+
const imageVariants = cva("aui-image-root relative overflow-hidden rounded-lg", {
|
|
103
|
+
variants: {
|
|
104
|
+
variant: {
|
|
105
|
+
outline: "border-border border",
|
|
106
|
+
ghost: "",
|
|
107
|
+
muted: "bg-muted/50"
|
|
108
|
+
},
|
|
109
|
+
size: {
|
|
110
|
+
sm: "max-w-64",
|
|
111
|
+
default: "max-w-96",
|
|
112
|
+
lg: "max-w-[512px]",
|
|
113
|
+
full: "w-full"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
defaultVariants: {
|
|
117
|
+
variant: "outline",
|
|
118
|
+
size: "default"
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
function ImageRoot({ className, variant, size, children, ...props }) {
|
|
122
|
+
return /* @__PURE__ */ jsx("div", {
|
|
123
|
+
"data-slot": "image-root",
|
|
124
|
+
"data-variant": variant,
|
|
125
|
+
"data-size": size,
|
|
126
|
+
className: cn(imageVariants({
|
|
127
|
+
variant,
|
|
128
|
+
size,
|
|
129
|
+
className
|
|
130
|
+
})),
|
|
131
|
+
...props,
|
|
132
|
+
children
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function ImagePreview({ className, containerClassName, ratio = "auto", fit = "contain", onLoad, onError, alt = "Image content", src, ...props }) {
|
|
136
|
+
const imgRef = useRef(null);
|
|
137
|
+
const [loadedSrc, setLoadedSrc] = useState(void 0);
|
|
138
|
+
const [errorSrc, setErrorSrc] = useState(void 0);
|
|
139
|
+
const loaded = loadedSrc === src;
|
|
140
|
+
const error = errorSrc === src;
|
|
141
|
+
const fixedRatio = ratio !== "auto";
|
|
142
|
+
const ratioClassName = ratio === "1:1" ? "aspect-square" : ratio === "4:3" ? "aspect-[4/3]" : ratio === "16:9" ? "aspect-video" : ratio === "9:16" ? "aspect-[9/16]" : void 0;
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
const image = imgRef.current;
|
|
145
|
+
if (typeof src !== "string" || !image?.complete) return;
|
|
146
|
+
if (image.naturalWidth > 0) setLoadedSrc(src);
|
|
147
|
+
else setErrorSrc(src);
|
|
148
|
+
}, [src]);
|
|
149
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
150
|
+
"data-slot": "image-preview",
|
|
151
|
+
className: cn("relative", fixedRatio ? ratioClassName : "min-h-32", containerClassName),
|
|
152
|
+
children: [!loaded && !error && /* @__PURE__ */ jsx("div", {
|
|
153
|
+
"data-slot": "image-preview-loading",
|
|
154
|
+
className: "bg-muted/50 absolute inset-0 flex items-center justify-center",
|
|
155
|
+
children: /* @__PURE__ */ jsx(ImageIcon, { className: "text-muted-foreground size-8 animate-pulse" })
|
|
156
|
+
}), error ? /* @__PURE__ */ jsx("div", {
|
|
157
|
+
"data-slot": "image-preview-error",
|
|
158
|
+
className: cn("bg-muted/50 flex min-h-32 items-center justify-center p-4", fixedRatio && "absolute inset-0"),
|
|
159
|
+
children: /* @__PURE__ */ jsx(ImageOffIcon, { className: "text-muted-foreground size-8" })
|
|
160
|
+
}) : /* @__PURE__ */ jsx("img", {
|
|
161
|
+
ref: imgRef,
|
|
162
|
+
src,
|
|
163
|
+
alt,
|
|
164
|
+
className: cn(fixedRatio ? cn("block h-full w-full", {
|
|
165
|
+
"object-cover": fit === "cover",
|
|
166
|
+
"object-contain": fit === "contain"
|
|
167
|
+
}) : "block h-auto w-full object-contain", !loaded && "invisible", className),
|
|
168
|
+
onLoad: (e) => {
|
|
169
|
+
if (typeof src === "string") setLoadedSrc(src);
|
|
170
|
+
onLoad?.(e);
|
|
171
|
+
},
|
|
172
|
+
onError: (e) => {
|
|
173
|
+
if (typeof src === "string") setErrorSrc(src);
|
|
174
|
+
onError?.(e);
|
|
175
|
+
},
|
|
176
|
+
...props
|
|
177
|
+
})]
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function ImageSource({ className, label, url, iconUrl, ...props }) {
|
|
181
|
+
const href = safeHref(url);
|
|
182
|
+
const host = hostOf(url);
|
|
183
|
+
const displayLabel = label || host;
|
|
184
|
+
const [failedIconUrl, setFailedIconUrl] = useState();
|
|
185
|
+
if (!displayLabel) return null;
|
|
186
|
+
const showIcon = iconUrl !== void 0 && failedIconUrl !== iconUrl;
|
|
187
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
188
|
+
"data-slot": "image-source",
|
|
189
|
+
className: cn("text-muted-foreground flex items-center gap-2 border-t px-2 py-1.5 text-xs", className),
|
|
190
|
+
...props,
|
|
191
|
+
children: [showIcon ? /* @__PURE__ */ jsx("img", {
|
|
192
|
+
"data-slot": "image-source-icon",
|
|
193
|
+
src: iconUrl,
|
|
194
|
+
alt: "",
|
|
195
|
+
className: "size-4 shrink-0 rounded-sm",
|
|
196
|
+
onError: () => setFailedIconUrl(iconUrl)
|
|
197
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
198
|
+
"data-slot": "image-source-icon-fallback",
|
|
199
|
+
"aria-hidden": "true",
|
|
200
|
+
className: "bg-muted flex size-4 shrink-0 items-center justify-center rounded-sm text-[10px] font-medium",
|
|
201
|
+
children: displayLabel.charAt(0).toUpperCase()
|
|
202
|
+
}), href ? /* @__PURE__ */ jsxs("a", {
|
|
203
|
+
"data-slot": "image-source-label",
|
|
204
|
+
href,
|
|
205
|
+
target: "_blank",
|
|
206
|
+
rel: "noopener noreferrer",
|
|
207
|
+
className: "hover:text-foreground truncate",
|
|
208
|
+
children: [displayLabel, /* @__PURE__ */ jsx("span", {
|
|
209
|
+
className: "sr-only",
|
|
210
|
+
children: " (opens in a new tab)"
|
|
211
|
+
})]
|
|
212
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
213
|
+
"data-slot": "image-source-label",
|
|
214
|
+
className: "truncate",
|
|
215
|
+
children: displayLabel
|
|
216
|
+
})]
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
function ImageFilename({ className, children, ...props }) {
|
|
220
|
+
if (!children) return null;
|
|
221
|
+
return /* @__PURE__ */ jsx("span", {
|
|
222
|
+
"data-slot": "image-filename",
|
|
223
|
+
className: cn("text-muted-foreground block truncate px-2 py-1.5 text-xs", className),
|
|
224
|
+
...props,
|
|
225
|
+
children
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
function ImageZoom({ src, alt = "Image preview", children }) {
|
|
229
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
230
|
+
const triggerRef = useRef(null);
|
|
231
|
+
const closeRef = useRef(null);
|
|
232
|
+
const overlayRef = useRef(null);
|
|
233
|
+
const handleOpen = useCallback(() => setIsOpen(true), []);
|
|
234
|
+
const handleClose = useCallback(() => {
|
|
235
|
+
setIsOpen(false);
|
|
236
|
+
triggerRef.current?.focus();
|
|
237
|
+
}, []);
|
|
238
|
+
useEffect(() => {
|
|
239
|
+
if (!isOpen) return;
|
|
240
|
+
const handleKeyDown = (e) => {
|
|
241
|
+
if (e.key === "Escape") {
|
|
242
|
+
handleClose();
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
if (e.key !== "Tab") return;
|
|
246
|
+
const focusables = overlayRef.current?.querySelectorAll("a[href], button:not([disabled]), [tabindex]:not([tabindex=\"-1\"])");
|
|
247
|
+
const first = focusables?.[0];
|
|
248
|
+
const last = focusables?.[focusables.length - 1];
|
|
249
|
+
if (!first || !last) return;
|
|
250
|
+
if (e.shiftKey && document.activeElement === first) {
|
|
251
|
+
e.preventDefault();
|
|
252
|
+
last.focus();
|
|
253
|
+
} else if (!e.shiftKey && document.activeElement === last) {
|
|
254
|
+
e.preventDefault();
|
|
255
|
+
first.focus();
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
259
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
260
|
+
}, [isOpen, handleClose]);
|
|
261
|
+
useEffect(() => {
|
|
262
|
+
if (!isOpen) return;
|
|
263
|
+
const originalOverflow = document.body.style.overflow;
|
|
264
|
+
document.body.style.overflow = "hidden";
|
|
265
|
+
return () => {
|
|
266
|
+
document.body.style.overflow = originalOverflow;
|
|
267
|
+
};
|
|
268
|
+
}, [isOpen]);
|
|
269
|
+
useEffect(() => {
|
|
270
|
+
if (isOpen) closeRef.current?.focus();
|
|
271
|
+
}, [isOpen]);
|
|
272
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
273
|
+
ref: triggerRef,
|
|
274
|
+
onClick: handleOpen,
|
|
275
|
+
onKeyDown: (e) => {
|
|
276
|
+
if (e.key === "Enter") {
|
|
277
|
+
e.preventDefault();
|
|
278
|
+
e.currentTarget.click();
|
|
279
|
+
} else if (e.key === " ") e.preventDefault();
|
|
280
|
+
},
|
|
281
|
+
onKeyUp: (e) => {
|
|
282
|
+
if (e.key === " ") e.currentTarget.click();
|
|
283
|
+
},
|
|
284
|
+
role: "button",
|
|
285
|
+
tabIndex: 0,
|
|
286
|
+
className: "aui-image-zoom-trigger cursor-zoom-in",
|
|
287
|
+
"aria-label": "Click to zoom image",
|
|
288
|
+
children
|
|
289
|
+
}), isOpen && createPortal(/* @__PURE__ */ jsxs("div", {
|
|
290
|
+
ref: overlayRef,
|
|
291
|
+
"data-slot": "image-zoom-overlay",
|
|
292
|
+
role: "dialog",
|
|
293
|
+
"aria-modal": "true",
|
|
294
|
+
className: "aui-image-zoom-overlay fade-in animate-in fixed inset-0 z-50 flex items-center justify-center bg-black/80 duration-200",
|
|
295
|
+
onClick: handleClose,
|
|
296
|
+
"aria-label": "Zoomed image",
|
|
297
|
+
children: [/* @__PURE__ */ jsx("img", {
|
|
298
|
+
"data-slot": "image-zoom-content",
|
|
299
|
+
src,
|
|
300
|
+
alt,
|
|
301
|
+
className: "aui-image-zoom-content fade-in zoom-in-95 animate-in bg-background ring-foreground/10 max-h-[90vh] max-w-[90vw] cursor-zoom-out rounded-lg object-contain shadow-lg ring-1 duration-200",
|
|
302
|
+
onClick: (e) => {
|
|
303
|
+
e.stopPropagation();
|
|
304
|
+
handleClose();
|
|
305
|
+
}
|
|
306
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
307
|
+
ref: closeRef,
|
|
308
|
+
type: "button",
|
|
309
|
+
"aria-label": "Close zoomed image",
|
|
310
|
+
onClick: (e) => {
|
|
311
|
+
e.stopPropagation();
|
|
312
|
+
handleClose();
|
|
313
|
+
},
|
|
314
|
+
className: "text-muted-foreground hover:text-foreground bg-background/80 absolute end-4 top-4 cursor-pointer rounded-md p-2",
|
|
315
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "size-5" })
|
|
316
|
+
})]
|
|
317
|
+
}), document.body)] });
|
|
318
|
+
}
|
|
319
|
+
function ImageGenerating({ className }) {
|
|
320
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
321
|
+
"data-slot": "image-generating",
|
|
322
|
+
className: cn("bg-muted/50 flex min-h-32 items-center justify-center p-4", className),
|
|
323
|
+
children: [/* @__PURE__ */ jsx(Loader2Icon, { className: "text-muted-foreground size-8 animate-spin" }), /* @__PURE__ */ jsx("span", {
|
|
324
|
+
className: "sr-only",
|
|
325
|
+
children: "Generating image…"
|
|
326
|
+
})]
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
function ImageContentFilterError({ className, reason }) {
|
|
330
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
331
|
+
"data-slot": "image-content-filter-error",
|
|
332
|
+
className: cn("bg-muted/50 flex min-h-32 flex-col items-center justify-center gap-2 p-4 text-center", className),
|
|
333
|
+
children: [
|
|
334
|
+
/* @__PURE__ */ jsx(ShieldAlertIcon, { className: "text-muted-foreground size-8" }),
|
|
335
|
+
/* @__PURE__ */ jsx("p", {
|
|
336
|
+
className: "text-sm font-medium",
|
|
337
|
+
children: "Image could not be generated"
|
|
338
|
+
}),
|
|
339
|
+
reason && /* @__PURE__ */ jsx("p", {
|
|
340
|
+
className: "text-muted-foreground text-xs",
|
|
341
|
+
children: reason
|
|
342
|
+
})
|
|
343
|
+
]
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
function RegenerateButton({ onRegenerate }) {
|
|
347
|
+
const [isRegenerating, setIsRegenerating] = useState(false);
|
|
348
|
+
return /* @__PURE__ */ jsx("button", {
|
|
349
|
+
type: "button",
|
|
350
|
+
onClick: async () => {
|
|
351
|
+
setIsRegenerating(true);
|
|
352
|
+
try {
|
|
353
|
+
await onRegenerate();
|
|
354
|
+
} catch {} finally {
|
|
355
|
+
setIsRegenerating(false);
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
disabled: isRegenerating,
|
|
359
|
+
"data-slot": "image-regenerate",
|
|
360
|
+
"aria-label": "Regenerate image",
|
|
361
|
+
className: "hover:bg-muted inline-flex size-7 items-center justify-center rounded disabled:opacity-50",
|
|
362
|
+
children: /* @__PURE__ */ jsx(RefreshCwIcon, { className: cn("size-4", isRegenerating && "animate-spin") })
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
function ImageActions({ part, onRegenerate, className }) {
|
|
366
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
367
|
+
"data-slot": "image-actions",
|
|
368
|
+
className: cn("flex items-center gap-1 p-1", className),
|
|
369
|
+
children: [
|
|
370
|
+
/* @__PURE__ */ jsx("button", {
|
|
371
|
+
type: "button",
|
|
372
|
+
onClick: () => downloadImagePart(part),
|
|
373
|
+
"data-slot": "image-download",
|
|
374
|
+
"aria-label": "Download image",
|
|
375
|
+
className: "hover:bg-muted inline-flex size-7 items-center justify-center rounded",
|
|
376
|
+
children: /* @__PURE__ */ jsx(DownloadIcon, { className: "size-4" })
|
|
377
|
+
}),
|
|
378
|
+
/* @__PURE__ */ jsx("button", {
|
|
379
|
+
type: "button",
|
|
380
|
+
onClick: () => {
|
|
381
|
+
copyImagePart(part).catch(() => {});
|
|
382
|
+
},
|
|
383
|
+
"data-slot": "image-copy",
|
|
384
|
+
"aria-label": "Copy image",
|
|
385
|
+
className: "hover:bg-muted inline-flex size-7 items-center justify-center rounded",
|
|
386
|
+
children: /* @__PURE__ */ jsx(CopyIcon, { className: "size-4" })
|
|
387
|
+
}),
|
|
388
|
+
onRegenerate && /* @__PURE__ */ jsx(RegenerateButton, { onRegenerate })
|
|
389
|
+
]
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
const ImageImpl = (props) => {
|
|
393
|
+
const { image, filename, status } = props;
|
|
394
|
+
if (status?.type === "running") return /* @__PURE__ */ jsxs(ImageRoot, { children: [/* @__PURE__ */ jsx(ImageGenerating, {}), /* @__PURE__ */ jsx(ImageFilename, { children: filename })] });
|
|
395
|
+
if (status?.type === "incomplete" && status.reason === "content-filter") return /* @__PURE__ */ jsx(ImageRoot, { children: /* @__PURE__ */ jsx(ImageContentFilterError, { reason: "The provider blocked this image." }) });
|
|
396
|
+
return /* @__PURE__ */ jsxs(ImageRoot, { children: [/* @__PURE__ */ jsx(ImageZoom, {
|
|
397
|
+
src: image,
|
|
398
|
+
alt: filename || "Image content",
|
|
399
|
+
children: /* @__PURE__ */ jsx(ImagePreview, {
|
|
400
|
+
src: image,
|
|
401
|
+
alt: filename || "Image content"
|
|
402
|
+
})
|
|
403
|
+
}), /* @__PURE__ */ jsx(ImageFilename, { children: filename })] });
|
|
404
|
+
};
|
|
405
|
+
const Image = memo(ImageImpl);
|
|
406
|
+
Image.displayName = "Image";
|
|
407
|
+
Image.Root = ImageRoot;
|
|
408
|
+
Image.Preview = ImagePreview;
|
|
409
|
+
Image.Source = ImageSource;
|
|
410
|
+
Image.Filename = ImageFilename;
|
|
411
|
+
Image.Zoom = ImageZoom;
|
|
412
|
+
Image.Actions = ImageActions;
|
|
413
|
+
Image.Generating = ImageGenerating;
|
|
414
|
+
Image.ContentFilterError = ImageContentFilterError;
|
|
415
|
+
//#endregion
|
|
416
|
+
export { Image, ImageActions, ImageContentFilterError, ImageFilename, ImageGenerating, ImagePreview, ImageRoot, ImageSource, ImageZoom, imageVariants, image_exports };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace inline_citation_d_exports {
|
|
3
|
+
export { Citation, CitationProps, InlineCitation, InlineCitationProps, Source };
|
|
4
|
+
}
|
|
5
|
+
export interface Source {
|
|
6
|
+
domain?: string | undefined;
|
|
7
|
+
title: string;
|
|
8
|
+
snippet: string;
|
|
9
|
+
url?: string | undefined;
|
|
10
|
+
publishedAt?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface CitationProps extends Omit<ComponentProps<"button">, "aria-label" | "children" | "className" | "type"> {
|
|
13
|
+
index: number;
|
|
14
|
+
source: Source;
|
|
15
|
+
open?: boolean | undefined;
|
|
16
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
17
|
+
className?: string | undefined;
|
|
18
|
+
}
|
|
19
|
+
export declare function Citation({ index, source, open, onOpenChange, className, ...props }: CitationProps): import("react").JSX.Element;
|
|
20
|
+
export interface InlineCitationProps extends ComponentProps<"p"> {}
|
|
21
|
+
export declare function InlineCitation({ children, className, ...props }: InlineCitationProps): import("react").JSX.Element;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { inline_citation_d_exports };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { floating, mono } from "./surfaces.js";
|
|
5
|
+
import { hostOf, safeHref } from "../utils/href.js";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { PreviewCard } from "@base-ui/react/preview-card";
|
|
8
|
+
//#region src/components/assistant-ui/elements/inline-citation.tsx
|
|
9
|
+
var inline_citation_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
Citation: () => Citation,
|
|
11
|
+
InlineCitation: () => InlineCitation
|
|
12
|
+
});
|
|
13
|
+
const dateFormatter = new Intl.DateTimeFormat("en-US", {
|
|
14
|
+
month: "short",
|
|
15
|
+
year: "numeric"
|
|
16
|
+
});
|
|
17
|
+
function formatPublishedAt(publishedAt) {
|
|
18
|
+
if (publishedAt === void 0) return void 0;
|
|
19
|
+
const date = new Date(publishedAt);
|
|
20
|
+
return Number.isNaN(date.getTime()) ? void 0 : dateFormatter.format(date);
|
|
21
|
+
}
|
|
22
|
+
function Citation({ index, source, open, onOpenChange, className, ...props }) {
|
|
23
|
+
const domain = source.domain ?? hostOf(source.url);
|
|
24
|
+
const href = safeHref(source.url);
|
|
25
|
+
const publishedAt = formatPublishedAt(source.publishedAt);
|
|
26
|
+
const hasMetadata = domain !== void 0 || publishedAt !== void 0;
|
|
27
|
+
return /* @__PURE__ */ jsxs(PreviewCard.Root, {
|
|
28
|
+
open,
|
|
29
|
+
onOpenChange,
|
|
30
|
+
children: [/* @__PURE__ */ jsx(PreviewCard.Trigger, {
|
|
31
|
+
delay: 0,
|
|
32
|
+
render: /* @__PURE__ */ jsx("button", {
|
|
33
|
+
type: "button",
|
|
34
|
+
...props
|
|
35
|
+
}),
|
|
36
|
+
"aria-label": `Source ${index + 1}: ${source.title}`,
|
|
37
|
+
className: cn("bg-foreground/[0.06] text-muted-foreground hover:text-foreground/90 data-[popup-open]:bg-foreground data-[popup-open]:text-background ms-0.5 inline-flex h-4 min-w-4 translate-y-[-2px] cursor-default items-center justify-center rounded-[5px] px-1 align-middle font-mono text-[10px] font-medium tabular-nums transition-colors motion-reduce:transition-none", className),
|
|
38
|
+
children: index + 1
|
|
39
|
+
}), /* @__PURE__ */ jsx(PreviewCard.Portal, { children: /* @__PURE__ */ jsx(PreviewCard.Positioner, {
|
|
40
|
+
side: "top",
|
|
41
|
+
sideOffset: 8,
|
|
42
|
+
children: /* @__PURE__ */ jsxs(PreviewCard.Popup, {
|
|
43
|
+
className: cn(floating, "z-50 w-64 origin-(--transform-origin) rounded-2xl p-3.5 outline-none", "transition-[opacity,scale] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none", "data-[starting-style]:scale-[0.97] data-[starting-style]:opacity-0", "data-[ending-style]:scale-[0.97] data-[ending-style]:opacity-0"),
|
|
44
|
+
children: [
|
|
45
|
+
hasMetadata ? /* @__PURE__ */ jsxs("div", {
|
|
46
|
+
className: "flex items-center gap-1.5",
|
|
47
|
+
children: [domain ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
48
|
+
className: "bg-foreground/[0.06] text-muted-foreground flex size-4 items-center justify-center rounded text-[9px] font-medium",
|
|
49
|
+
children: domain[0]?.toUpperCase()
|
|
50
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
51
|
+
className: cn(mono, "text-muted-foreground"),
|
|
52
|
+
children: domain
|
|
53
|
+
})] }) : null, publishedAt ? /* @__PURE__ */ jsx("span", {
|
|
54
|
+
className: cn(mono, "text-muted-foreground"),
|
|
55
|
+
children: publishedAt
|
|
56
|
+
}) : null]
|
|
57
|
+
}) : null,
|
|
58
|
+
/* @__PURE__ */ jsx("p", {
|
|
59
|
+
className: cn("text-[13px] leading-snug font-medium", hasMetadata && "mt-2"),
|
|
60
|
+
children: source.title
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ jsx("p", {
|
|
63
|
+
className: "text-muted-foreground mt-1 text-[13px] leading-relaxed",
|
|
64
|
+
children: source.snippet
|
|
65
|
+
}),
|
|
66
|
+
href ? /* @__PURE__ */ jsxs("a", {
|
|
67
|
+
href,
|
|
68
|
+
target: "_blank",
|
|
69
|
+
rel: "noopener noreferrer",
|
|
70
|
+
className: "text-muted-foreground hover:text-foreground mt-3 inline-flex text-xs underline-offset-2 transition-colors hover:underline motion-reduce:transition-none",
|
|
71
|
+
children: ["Open source ", /* @__PURE__ */ jsx("span", {
|
|
72
|
+
className: "sr-only",
|
|
73
|
+
children: "(opens in a new tab)"
|
|
74
|
+
})]
|
|
75
|
+
}) : null
|
|
76
|
+
]
|
|
77
|
+
})
|
|
78
|
+
}) })]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function InlineCitation({ children, className, ...props }) {
|
|
82
|
+
return /* @__PURE__ */ jsx("p", {
|
|
83
|
+
"data-slot": "inline-citation",
|
|
84
|
+
className: cn("text-foreground/90 max-w-sm text-sm leading-relaxed", className),
|
|
85
|
+
...props,
|
|
86
|
+
children
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { Citation, InlineCitation, inline_citation_exports };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace job_progress_d_exports {
|
|
3
|
+
export { JobProgress, JobStage };
|
|
4
|
+
}
|
|
5
|
+
export interface JobStage {
|
|
6
|
+
name: string;
|
|
7
|
+
weight: number;
|
|
8
|
+
description?: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
type JobOutcomeStatus = "success" | "partial" | "failed" | "cancelled";
|
|
11
|
+
export declare function JobProgress({ title, stages, stageIndex, stageProgress, eta, onCancel, outcome, elapsedMs, className, ...props }: Omit<ComponentProps<"div">, "children" | "title" | "stages" | "stageIndex" | "stageProgress" | "eta" | "onCancel" | "outcome" | "elapsedMs"> & {
|
|
12
|
+
title: string;
|
|
13
|
+
stages: readonly JobStage[];
|
|
14
|
+
stageIndex: number;
|
|
15
|
+
stageProgress: number;
|
|
16
|
+
eta: string;
|
|
17
|
+
onCancel?: (() => void) | undefined;
|
|
18
|
+
outcome?: {
|
|
19
|
+
status: JobOutcomeStatus;
|
|
20
|
+
summary?: string | undefined;
|
|
21
|
+
} | undefined;
|
|
22
|
+
elapsedMs?: number | undefined;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { job_progress_d_exports };
|