@agent-native/toolkit 0.0.0-beta-20260819143124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -0
- package/agent-native.eject.json +588 -0
- package/dist/app-shell/header-actions.d.ts +18 -0
- package/dist/app-shell/header-actions.d.ts.map +1 -0
- package/dist/app-shell/header-actions.js +52 -0
- package/dist/app-shell/header-actions.js.map +1 -0
- package/dist/app-shell/index.d.ts +3 -0
- package/dist/app-shell/index.d.ts.map +1 -0
- package/dist/app-shell/index.js +3 -0
- package/dist/app-shell/index.js.map +1 -0
- package/dist/app-shell/sidebar-footer-actions.d.ts +14 -0
- package/dist/app-shell/sidebar-footer-actions.d.ts.map +1 -0
- package/dist/app-shell/sidebar-footer-actions.js +10 -0
- package/dist/app-shell/sidebar-footer-actions.js.map +1 -0
- package/dist/app-shell/sidebar-footer-actions.spec.d.ts +2 -0
- package/dist/app-shell/sidebar-footer-actions.spec.d.ts.map +1 -0
- package/dist/app-shell/sidebar-footer-actions.spec.js +43 -0
- package/dist/app-shell/sidebar-footer-actions.spec.js.map +1 -0
- package/dist/canvas-annotations/CanvasCommentPins.d.ts +68 -0
- package/dist/canvas-annotations/CanvasCommentPins.d.ts.map +1 -0
- package/dist/canvas-annotations/CanvasCommentPins.js +513 -0
- package/dist/canvas-annotations/CanvasCommentPins.js.map +1 -0
- package/dist/canvas-annotations/DrawOverlay.d.ts +108 -0
- package/dist/canvas-annotations/DrawOverlay.d.ts.map +1 -0
- package/dist/canvas-annotations/DrawOverlay.js +746 -0
- package/dist/canvas-annotations/DrawOverlay.js.map +1 -0
- package/dist/canvas-annotations/DrawOverlay.spec.d.ts +2 -0
- package/dist/canvas-annotations/DrawOverlay.spec.d.ts.map +1 -0
- package/dist/canvas-annotations/DrawOverlay.spec.js +111 -0
- package/dist/canvas-annotations/DrawOverlay.spec.js.map +1 -0
- package/dist/canvas-annotations/index.d.ts +4 -0
- package/dist/canvas-annotations/index.d.ts.map +1 -0
- package/dist/canvas-annotations/index.js +3 -0
- package/dist/canvas-annotations/index.js.map +1 -0
- package/dist/canvas-annotations/types.d.ts +8 -0
- package/dist/canvas-annotations/types.d.ts.map +1 -0
- package/dist/canvas-annotations/types.js +2 -0
- package/dist/canvas-annotations/types.js.map +1 -0
- package/dist/canvas-interactions/canvas-interactions.d.ts +334 -0
- package/dist/canvas-interactions/canvas-interactions.d.ts.map +1 -0
- package/dist/canvas-interactions/canvas-interactions.js +486 -0
- package/dist/canvas-interactions/canvas-interactions.js.map +1 -0
- package/dist/canvas-interactions/canvas-interactions.spec.d.ts +2 -0
- package/dist/canvas-interactions/canvas-interactions.spec.d.ts.map +1 -0
- package/dist/canvas-interactions/canvas-interactions.spec.js +593 -0
- package/dist/canvas-interactions/canvas-interactions.spec.js.map +1 -0
- package/dist/canvas-interactions/index.d.ts +2 -0
- package/dist/canvas-interactions/index.d.ts.map +1 -0
- package/dist/canvas-interactions/index.js +2 -0
- package/dist/canvas-interactions/index.js.map +1 -0
- package/dist/chat-history/ChatHistoryList.d.ts +103 -0
- package/dist/chat-history/ChatHistoryList.d.ts.map +1 -0
- package/dist/chat-history/ChatHistoryList.js +102 -0
- package/dist/chat-history/ChatHistoryList.js.map +1 -0
- package/dist/chat-history/ChatHistoryList.spec.d.ts +2 -0
- package/dist/chat-history/ChatHistoryList.spec.d.ts.map +1 -0
- package/dist/chat-history/ChatHistoryList.spec.js +293 -0
- package/dist/chat-history/ChatHistoryList.spec.js.map +1 -0
- package/dist/chat-history/ChatHistoryRail.d.ts +33 -0
- package/dist/chat-history/ChatHistoryRail.d.ts.map +1 -0
- package/dist/chat-history/ChatHistoryRail.js +35 -0
- package/dist/chat-history/ChatHistoryRail.js.map +1 -0
- package/dist/chat-history/ChatHistoryRail.spec.d.ts +2 -0
- package/dist/chat-history/ChatHistoryRail.spec.d.ts.map +1 -0
- package/dist/chat-history/ChatHistoryRail.spec.js +157 -0
- package/dist/chat-history/ChatHistoryRail.spec.js.map +1 -0
- package/dist/chat-history/index.d.ts +4 -0
- package/dist/chat-history/index.d.ts.map +1 -0
- package/dist/chat-history/index.js +4 -0
- package/dist/chat-history/index.js.map +1 -0
- package/dist/chat-history/useChatHistoryRailController.d.ts +26 -0
- package/dist/chat-history/useChatHistoryRailController.d.ts.map +1 -0
- package/dist/chat-history/useChatHistoryRailController.js +36 -0
- package/dist/chat-history/useChatHistoryRailController.js.map +1 -0
- package/dist/chat-history/useChatHistoryRailController.spec.d.ts +2 -0
- package/dist/chat-history/useChatHistoryRailController.spec.d.ts.map +1 -0
- package/dist/chat-history/useChatHistoryRailController.spec.js +101 -0
- package/dist/chat-history/useChatHistoryRailController.spec.js.map +1 -0
- package/dist/chat-history.css +469 -0
- package/dist/collab-ui/AgentPresenceChip.d.ts +12 -0
- package/dist/collab-ui/AgentPresenceChip.d.ts.map +1 -0
- package/dist/collab-ui/AgentPresenceChip.js +42 -0
- package/dist/collab-ui/AgentPresenceChip.js.map +1 -0
- package/dist/collab-ui/LiveCursorOverlay.d.ts +46 -0
- package/dist/collab-ui/LiveCursorOverlay.d.ts.map +1 -0
- package/dist/collab-ui/LiveCursorOverlay.js +125 -0
- package/dist/collab-ui/LiveCursorOverlay.js.map +1 -0
- package/dist/collab-ui/PresenceBar.d.ts +30 -0
- package/dist/collab-ui/PresenceBar.d.ts.map +1 -0
- package/dist/collab-ui/PresenceBar.js +172 -0
- package/dist/collab-ui/PresenceBar.js.map +1 -0
- package/dist/collab-ui/PresenceBar.spec.d.ts +2 -0
- package/dist/collab-ui/PresenceBar.spec.d.ts.map +1 -0
- package/dist/collab-ui/PresenceBar.spec.js +30 -0
- package/dist/collab-ui/PresenceBar.spec.js.map +1 -0
- package/dist/collab-ui/RecentEditHighlights.d.ts +46 -0
- package/dist/collab-ui/RecentEditHighlights.d.ts.map +1 -0
- package/dist/collab-ui/RecentEditHighlights.js +154 -0
- package/dist/collab-ui/RecentEditHighlights.js.map +1 -0
- package/dist/collab-ui/RemoteSelectionRings.d.ts +53 -0
- package/dist/collab-ui/RemoteSelectionRings.d.ts.map +1 -0
- package/dist/collab-ui/RemoteSelectionRings.js +130 -0
- package/dist/collab-ui/RemoteSelectionRings.js.map +1 -0
- package/dist/collab-ui/agent-identity.d.ts +9 -0
- package/dist/collab-ui/agent-identity.d.ts.map +1 -0
- package/dist/collab-ui/agent-identity.js +9 -0
- package/dist/collab-ui/agent-identity.js.map +1 -0
- package/dist/collab-ui/index.d.ts +9 -0
- package/dist/collab-ui/index.d.ts.map +1 -0
- package/dist/collab-ui/index.js +9 -0
- package/dist/collab-ui/index.js.map +1 -0
- package/dist/collab-ui/lead-client.d.ts +3 -0
- package/dist/collab-ui/lead-client.d.ts.map +1 -0
- package/dist/collab-ui/lead-client.js +29 -0
- package/dist/collab-ui/lead-client.js.map +1 -0
- package/dist/collab-ui/types.d.ts +48 -0
- package/dist/collab-ui/types.d.ts.map +1 -0
- package/dist/collab-ui/types.js +52 -0
- package/dist/collab-ui/types.js.map +1 -0
- package/dist/collab-ui/types.spec.d.ts +2 -0
- package/dist/collab-ui/types.spec.d.ts.map +1 -0
- package/dist/collab-ui/types.spec.js +15 -0
- package/dist/collab-ui/types.spec.js.map +1 -0
- package/dist/composer/AgentComposerFrame.d.ts +19 -0
- package/dist/composer/AgentComposerFrame.d.ts.map +1 -0
- package/dist/composer/AgentComposerFrame.js +17 -0
- package/dist/composer/AgentComposerFrame.js.map +1 -0
- package/dist/composer/ComposerPlusMenu.d.ts +30 -0
- package/dist/composer/ComposerPlusMenu.d.ts.map +1 -0
- package/dist/composer/ComposerPlusMenu.js +635 -0
- package/dist/composer/ComposerPlusMenu.js.map +1 -0
- package/dist/composer/ComposerPlusMenu.spec.d.ts +2 -0
- package/dist/composer/ComposerPlusMenu.spec.d.ts.map +1 -0
- package/dist/composer/ComposerPlusMenu.spec.js +12 -0
- package/dist/composer/ComposerPlusMenu.spec.js.map +1 -0
- package/dist/composer/MentionPopover.d.ts +29 -0
- package/dist/composer/MentionPopover.d.ts.map +1 -0
- package/dist/composer/MentionPopover.js +221 -0
- package/dist/composer/MentionPopover.js.map +1 -0
- package/dist/composer/PastedTextChip.d.ts +9 -0
- package/dist/composer/PastedTextChip.d.ts.map +1 -0
- package/dist/composer/PastedTextChip.js +71 -0
- package/dist/composer/PastedTextChip.js.map +1 -0
- package/dist/composer/PastedTextChip.spec.d.ts +2 -0
- package/dist/composer/PastedTextChip.spec.d.ts.map +1 -0
- package/dist/composer/PastedTextChip.spec.js +42 -0
- package/dist/composer/PastedTextChip.spec.js.map +1 -0
- package/dist/composer/PromptComposer.d.ts +151 -0
- package/dist/composer/PromptComposer.d.ts.map +1 -0
- package/dist/composer/PromptComposer.js +322 -0
- package/dist/composer/PromptComposer.js.map +1 -0
- package/dist/composer/PromptComposer.spec.d.ts +2 -0
- package/dist/composer/PromptComposer.spec.d.ts.map +1 -0
- package/dist/composer/PromptComposer.spec.js +87 -0
- package/dist/composer/PromptComposer.spec.js.map +1 -0
- package/dist/composer/RealtimeVoiceMode.d.ts +108 -0
- package/dist/composer/RealtimeVoiceMode.d.ts.map +1 -0
- package/dist/composer/RealtimeVoiceMode.js +312 -0
- package/dist/composer/RealtimeVoiceMode.js.map +1 -0
- package/dist/composer/RealtimeVoiceMode.spec.d.ts +2 -0
- package/dist/composer/RealtimeVoiceMode.spec.d.ts.map +1 -0
- package/dist/composer/RealtimeVoiceMode.spec.js +540 -0
- package/dist/composer/RealtimeVoiceMode.spec.js.map +1 -0
- package/dist/composer/TiptapComposer.d.ts +288 -0
- package/dist/composer/TiptapComposer.d.ts.map +1 -0
- package/dist/composer/TiptapComposer.js +2233 -0
- package/dist/composer/TiptapComposer.js.map +1 -0
- package/dist/composer/TiptapComposer.spec.d.ts +2 -0
- package/dist/composer/TiptapComposer.spec.d.ts.map +1 -0
- package/dist/composer/TiptapComposer.spec.js +415 -0
- package/dist/composer/TiptapComposer.spec.js.map +1 -0
- package/dist/composer/VoiceButton.d.ts +27 -0
- package/dist/composer/VoiceButton.d.ts.map +1 -0
- package/dist/composer/VoiceButton.js +151 -0
- package/dist/composer/VoiceButton.js.map +1 -0
- package/dist/composer/VoiceButton.spec.d.ts +2 -0
- package/dist/composer/VoiceButton.spec.d.ts.map +1 -0
- package/dist/composer/VoiceButton.spec.js +27 -0
- package/dist/composer/VoiceButton.spec.js.map +1 -0
- package/dist/composer/asset-picker-url.d.ts +16 -0
- package/dist/composer/asset-picker-url.d.ts.map +1 -0
- package/dist/composer/asset-picker-url.js +64 -0
- package/dist/composer/asset-picker-url.js.map +1 -0
- package/dist/composer/asset-picker-url.spec.d.ts +2 -0
- package/dist/composer/asset-picker-url.spec.d.ts.map +1 -0
- package/dist/composer/asset-picker-url.spec.js +23 -0
- package/dist/composer/asset-picker-url.spec.js.map +1 -0
- package/dist/composer/attachment-accept.d.ts +9 -0
- package/dist/composer/attachment-accept.d.ts.map +1 -0
- package/dist/composer/attachment-accept.js +69 -0
- package/dist/composer/attachment-accept.js.map +1 -0
- package/dist/composer/attachment-accept.spec.d.ts +2 -0
- package/dist/composer/attachment-accept.spec.d.ts.map +1 -0
- package/dist/composer/attachment-accept.spec.js +24 -0
- package/dist/composer/attachment-accept.spec.js.map +1 -0
- package/dist/composer/draft-key.d.ts +2 -0
- package/dist/composer/draft-key.d.ts.map +1 -0
- package/dist/composer/draft-key.js +8 -0
- package/dist/composer/draft-key.js.map +1 -0
- package/dist/composer/draft-key.spec.d.ts +2 -0
- package/dist/composer/draft-key.spec.d.ts.map +1 -0
- package/dist/composer/draft-key.spec.js +13 -0
- package/dist/composer/draft-key.spec.js.map +1 -0
- package/dist/composer/extensions/FileReference.d.ts +3 -0
- package/dist/composer/extensions/FileReference.d.ts.map +1 -0
- package/dist/composer/extensions/FileReference.js +36 -0
- package/dist/composer/extensions/FileReference.js.map +1 -0
- package/dist/composer/extensions/MentionReference.d.ts +3 -0
- package/dist/composer/extensions/MentionReference.d.ts.map +1 -0
- package/dist/composer/extensions/MentionReference.js +66 -0
- package/dist/composer/extensions/MentionReference.js.map +1 -0
- package/dist/composer/extensions/SkillReference.d.ts +3 -0
- package/dist/composer/extensions/SkillReference.d.ts.map +1 -0
- package/dist/composer/extensions/SkillReference.js +40 -0
- package/dist/composer/extensions/SkillReference.js.map +1 -0
- package/dist/composer/index.d.ts +16 -0
- package/dist/composer/index.d.ts.map +1 -0
- package/dist/composer/index.js +14 -0
- package/dist/composer/index.js.map +1 -0
- package/dist/composer/model-selection.d.ts +12 -0
- package/dist/composer/model-selection.d.ts.map +1 -0
- package/dist/composer/model-selection.js +31 -0
- package/dist/composer/model-selection.js.map +1 -0
- package/dist/composer/model-selection.spec.d.ts +2 -0
- package/dist/composer/model-selection.spec.d.ts.map +1 -0
- package/dist/composer/model-selection.spec.js +38 -0
- package/dist/composer/model-selection.spec.js.map +1 -0
- package/dist/composer/pasted-text.d.ts +31 -0
- package/dist/composer/pasted-text.d.ts.map +1 -0
- package/dist/composer/pasted-text.js +130 -0
- package/dist/composer/pasted-text.js.map +1 -0
- package/dist/composer/pasted-text.spec.d.ts +2 -0
- package/dist/composer/pasted-text.spec.d.ts.map +1 -0
- package/dist/composer/pasted-text.spec.js +107 -0
- package/dist/composer/pasted-text.spec.js.map +1 -0
- package/dist/composer/prompt-attachments.d.ts +18 -0
- package/dist/composer/prompt-attachments.d.ts.map +1 -0
- package/dist/composer/prompt-attachments.js +65 -0
- package/dist/composer/prompt-attachments.js.map +1 -0
- package/dist/composer/prompt-attachments.spec.d.ts +2 -0
- package/dist/composer/prompt-attachments.spec.d.ts.map +1 -0
- package/dist/composer/prompt-attachments.spec.js +63 -0
- package/dist/composer/prompt-attachments.spec.js.map +1 -0
- package/dist/composer/realtime-voice-audio-level.d.ts +14 -0
- package/dist/composer/realtime-voice-audio-level.d.ts.map +1 -0
- package/dist/composer/realtime-voice-audio-level.js +48 -0
- package/dist/composer/realtime-voice-audio-level.js.map +1 -0
- package/dist/composer/realtime-voice-audio-level.spec.d.ts +2 -0
- package/dist/composer/realtime-voice-audio-level.spec.d.ts.map +1 -0
- package/dist/composer/realtime-voice-audio-level.spec.js +32 -0
- package/dist/composer/realtime-voice-audio-level.spec.js.map +1 -0
- package/dist/composer/realtime-voice-transcript.d.ts +26 -0
- package/dist/composer/realtime-voice-transcript.d.ts.map +1 -0
- package/dist/composer/realtime-voice-transcript.js +103 -0
- package/dist/composer/realtime-voice-transcript.js.map +1 -0
- package/dist/composer/realtime-voice-transcript.spec.d.ts +2 -0
- package/dist/composer/realtime-voice-transcript.spec.d.ts.map +1 -0
- package/dist/composer/realtime-voice-transcript.spec.js +76 -0
- package/dist/composer/realtime-voice-transcript.spec.js.map +1 -0
- package/dist/composer/runtime-adapters.d.ts +169 -0
- package/dist/composer/runtime-adapters.d.ts.map +1 -0
- package/dist/composer/runtime-adapters.js +141 -0
- package/dist/composer/runtime-adapters.js.map +1 -0
- package/dist/composer/runtime-adapters.spec.d.ts +2 -0
- package/dist/composer/runtime-adapters.spec.d.ts.map +1 -0
- package/dist/composer/runtime-adapters.spec.js +69 -0
- package/dist/composer/runtime-adapters.spec.js.map +1 -0
- package/dist/composer/types.d.ts +60 -0
- package/dist/composer/types.d.ts.map +1 -0
- package/dist/composer/types.js +2 -0
- package/dist/composer/types.js.map +1 -0
- package/dist/composer/use-file-search.d.ts +6 -0
- package/dist/composer/use-file-search.d.ts.map +1 -0
- package/dist/composer/use-file-search.js +53 -0
- package/dist/composer/use-file-search.js.map +1 -0
- package/dist/composer/use-mention-search.d.ts +6 -0
- package/dist/composer/use-mention-search.d.ts.map +1 -0
- package/dist/composer/use-mention-search.js +75 -0
- package/dist/composer/use-mention-search.js.map +1 -0
- package/dist/composer/use-skills.d.ts +7 -0
- package/dist/composer/use-skills.d.ts.map +1 -0
- package/dist/composer/use-skills.js +40 -0
- package/dist/composer/use-skills.js.map +1 -0
- package/dist/composer/useRealtimeVoiceMode.d.ts +189 -0
- package/dist/composer/useRealtimeVoiceMode.d.ts.map +1 -0
- package/dist/composer/useRealtimeVoiceMode.js +1899 -0
- package/dist/composer/useRealtimeVoiceMode.js.map +1 -0
- package/dist/composer/useRealtimeVoiceMode.spec.d.ts +2 -0
- package/dist/composer/useRealtimeVoiceMode.spec.d.ts.map +1 -0
- package/dist/composer/useRealtimeVoiceMode.spec.js +716 -0
- package/dist/composer/useRealtimeVoiceMode.spec.js.map +1 -0
- package/dist/composer/useVoiceDictation.browser.spec.d.ts +2 -0
- package/dist/composer/useVoiceDictation.browser.spec.d.ts.map +1 -0
- package/dist/composer/useVoiceDictation.browser.spec.js +220 -0
- package/dist/composer/useVoiceDictation.browser.spec.js.map +1 -0
- package/dist/composer/useVoiceDictation.d.ts +58 -0
- package/dist/composer/useVoiceDictation.d.ts.map +1 -0
- package/dist/composer/useVoiceDictation.js +1058 -0
- package/dist/composer/useVoiceDictation.js.map +1 -0
- package/dist/composer/useVoiceDictation.spec.d.ts +2 -0
- package/dist/composer/useVoiceDictation.spec.d.ts.map +1 -0
- package/dist/composer/useVoiceDictation.spec.js +32 -0
- package/dist/composer/useVoiceDictation.spec.js.map +1 -0
- package/dist/conformance/__fixtures__/css-in-js-adapter.d.ts +7 -0
- package/dist/conformance/__fixtures__/css-in-js-adapter.d.ts.map +1 -0
- package/dist/conformance/__fixtures__/css-in-js-adapter.js +84 -0
- package/dist/conformance/__fixtures__/css-in-js-adapter.js.map +1 -0
- package/dist/conformance/conformance.spec.d.ts +2 -0
- package/dist/conformance/conformance.spec.d.ts.map +1 -0
- package/dist/conformance/conformance.spec.js +87 -0
- package/dist/conformance/conformance.spec.js.map +1 -0
- package/dist/conformance/index.d.ts +4 -0
- package/dist/conformance/index.d.ts.map +1 -0
- package/dist/conformance/index.js +4 -0
- package/dist/conformance/index.js.map +1 -0
- package/dist/conformance/runner.d.ts +12 -0
- package/dist/conformance/runner.d.ts.map +1 -0
- package/dist/conformance/runner.js +515 -0
- package/dist/conformance/runner.js.map +1 -0
- package/dist/conformance/types.d.ts +26 -0
- package/dist/conformance/types.d.ts.map +1 -0
- package/dist/conformance/types.js +13 -0
- package/dist/conformance/types.js.map +1 -0
- package/dist/conformance/version.d.ts +6 -0
- package/dist/conformance/version.d.ts.map +1 -0
- package/dist/conformance/version.js +14 -0
- package/dist/conformance/version.js.map +1 -0
- package/dist/context-ui/ContextMeter.d.ts +11 -0
- package/dist/context-ui/ContextMeter.d.ts.map +1 -0
- package/dist/context-ui/ContextMeter.js +40 -0
- package/dist/context-ui/ContextMeter.js.map +1 -0
- package/dist/context-ui/ContextMeter.spec.d.ts +2 -0
- package/dist/context-ui/ContextMeter.spec.d.ts.map +1 -0
- package/dist/context-ui/ContextMeter.spec.js +52 -0
- package/dist/context-ui/ContextMeter.spec.js.map +1 -0
- package/dist/context-ui/ContextSegmentRow.d.ts +16 -0
- package/dist/context-ui/ContextSegmentRow.d.ts.map +1 -0
- package/dist/context-ui/ContextSegmentRow.js +92 -0
- package/dist/context-ui/ContextSegmentRow.js.map +1 -0
- package/dist/context-ui/ContextTreemap.d.ts +8 -0
- package/dist/context-ui/ContextTreemap.d.ts.map +1 -0
- package/dist/context-ui/ContextTreemap.js +58 -0
- package/dist/context-ui/ContextTreemap.js.map +1 -0
- package/dist/context-ui/ContextXRayPanel.d.ts +14 -0
- package/dist/context-ui/ContextXRayPanel.d.ts.map +1 -0
- package/dist/context-ui/ContextXRayPanel.js +209 -0
- package/dist/context-ui/ContextXRayPanel.js.map +1 -0
- package/dist/context-ui/format.d.ts +6 -0
- package/dist/context-ui/format.d.ts.map +1 -0
- package/dist/context-ui/format.js +58 -0
- package/dist/context-ui/format.js.map +1 -0
- package/dist/context-ui/index.d.ts +7 -0
- package/dist/context-ui/index.d.ts.map +1 -0
- package/dist/context-ui/index.js +6 -0
- package/dist/context-ui/index.js.map +1 -0
- package/dist/context-ui/types.d.ts +41 -0
- package/dist/context-ui/types.d.ts.map +1 -0
- package/dist/context-ui/types.js +8 -0
- package/dist/context-ui/types.js.map +1 -0
- package/dist/dashboard/DataTable.d.ts +20 -0
- package/dist/dashboard/DataTable.d.ts.map +1 -0
- package/dist/dashboard/DataTable.js +87 -0
- package/dist/dashboard/DataTable.js.map +1 -0
- package/dist/dashboard/DateRangePicker.d.ts +15 -0
- package/dist/dashboard/DateRangePicker.d.ts.map +1 -0
- package/dist/dashboard/DateRangePicker.js +15 -0
- package/dist/dashboard/DateRangePicker.js.map +1 -0
- package/dist/dashboard/GenericChartPanel.d.ts +57 -0
- package/dist/dashboard/GenericChartPanel.d.ts.map +1 -0
- package/dist/dashboard/GenericChartPanel.js +119 -0
- package/dist/dashboard/GenericChartPanel.js.map +1 -0
- package/dist/dashboard/GenericChartPanel.spec.d.ts +2 -0
- package/dist/dashboard/GenericChartPanel.spec.d.ts.map +1 -0
- package/dist/dashboard/GenericChartPanel.spec.js +41 -0
- package/dist/dashboard/GenericChartPanel.spec.js.map +1 -0
- package/dist/dashboard/MetricCard.d.ts +14 -0
- package/dist/dashboard/MetricCard.d.ts.map +1 -0
- package/dist/dashboard/MetricCard.js +10 -0
- package/dist/dashboard/MetricCard.js.map +1 -0
- package/dist/dashboard/StatsCard.d.ts +16 -0
- package/dist/dashboard/StatsCard.d.ts.map +1 -0
- package/dist/dashboard/StatsCard.js +8 -0
- package/dist/dashboard/StatsCard.js.map +1 -0
- package/dist/dashboard/dashboard-layout.d.ts +49 -0
- package/dist/dashboard/dashboard-layout.d.ts.map +1 -0
- package/dist/dashboard/dashboard-layout.js +231 -0
- package/dist/dashboard/dashboard-layout.js.map +1 -0
- package/dist/dashboard/dashboard-layout.spec.d.ts +2 -0
- package/dist/dashboard/dashboard-layout.spec.d.ts.map +1 -0
- package/dist/dashboard/dashboard-layout.spec.js +52 -0
- package/dist/dashboard/dashboard-layout.spec.js.map +1 -0
- package/dist/dashboard/index.d.ts +7 -0
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.js +7 -0
- package/dist/dashboard/index.js.map +1 -0
- package/dist/data-grid/DataGrid.d.ts +92 -0
- package/dist/data-grid/DataGrid.d.ts.map +1 -0
- package/dist/data-grid/DataGrid.js +315 -0
- package/dist/data-grid/DataGrid.js.map +1 -0
- package/dist/data-grid/DataGrid.spec.d.ts +2 -0
- package/dist/data-grid/DataGrid.spec.d.ts.map +1 -0
- package/dist/data-grid/DataGrid.spec.js +134 -0
- package/dist/data-grid/DataGrid.spec.js.map +1 -0
- package/dist/data-grid/index.d.ts +2 -0
- package/dist/data-grid/index.d.ts.map +1 -0
- package/dist/data-grid/index.js +2 -0
- package/dist/data-grid/index.js.map +1 -0
- package/dist/design-system/components.d.ts +58 -0
- package/dist/design-system/components.d.ts.map +1 -0
- package/dist/design-system/components.js +88 -0
- package/dist/design-system/components.js.map +1 -0
- package/dist/design-system/context.d.ts +11 -0
- package/dist/design-system/context.d.ts.map +1 -0
- package/dist/design-system/context.js +17 -0
- package/dist/design-system/context.js.map +1 -0
- package/dist/design-system/default-adapter.d.ts +3 -0
- package/dist/design-system/default-adapter.d.ts.map +1 -0
- package/dist/design-system/default-adapter.js +172 -0
- package/dist/design-system/default-adapter.js.map +1 -0
- package/dist/design-system/default-adapter.spec.d.ts +2 -0
- package/dist/design-system/default-adapter.spec.d.ts.map +1 -0
- package/dist/design-system/default-adapter.spec.js +108 -0
- package/dist/design-system/default-adapter.spec.js.map +1 -0
- package/dist/design-system/definition.d.ts +9 -0
- package/dist/design-system/definition.d.ts.map +1 -0
- package/dist/design-system/definition.js +4 -0
- package/dist/design-system/definition.js.map +1 -0
- package/dist/design-system/design-system.spec.d.ts +2 -0
- package/dist/design-system/design-system.spec.d.ts.map +1 -0
- package/dist/design-system/design-system.spec.js +208 -0
- package/dist/design-system/design-system.spec.js.map +1 -0
- package/dist/design-system/error-boundary.d.ts +18 -0
- package/dist/design-system/error-boundary.d.ts.map +1 -0
- package/dist/design-system/error-boundary.js +16 -0
- package/dist/design-system/error-boundary.js.map +1 -0
- package/dist/design-system/index.d.ts +8 -0
- package/dist/design-system/index.d.ts.map +1 -0
- package/dist/design-system/index.js +8 -0
- package/dist/design-system/index.js.map +1 -0
- package/dist/design-system/theme.d.ts +30 -0
- package/dist/design-system/theme.d.ts.map +1 -0
- package/dist/design-system/theme.js +95 -0
- package/dist/design-system/theme.js.map +1 -0
- package/dist/design-system/theme.spec.d.ts +2 -0
- package/dist/design-system/theme.spec.d.ts.map +1 -0
- package/dist/design-system/theme.spec.js +43 -0
- package/dist/design-system/theme.spec.js.map +1 -0
- package/dist/design-system/types.d.ts +292 -0
- package/dist/design-system/types.d.ts.map +1 -0
- package/dist/design-system/types.js +2 -0
- package/dist/design-system/types.js.map +1 -0
- package/dist/design-tweaks/index.d.ts +2 -0
- package/dist/design-tweaks/index.d.ts.map +1 -0
- package/dist/design-tweaks/index.js +2 -0
- package/dist/design-tweaks/index.js.map +1 -0
- package/dist/design-tweaks/scrub-input-utils.d.ts +61 -0
- package/dist/design-tweaks/scrub-input-utils.d.ts.map +1 -0
- package/dist/design-tweaks/scrub-input-utils.js +235 -0
- package/dist/design-tweaks/scrub-input-utils.js.map +1 -0
- package/dist/design-tweaks/scrub-input.d.ts +70 -0
- package/dist/design-tweaks/scrub-input.d.ts.map +1 -0
- package/dist/design-tweaks/scrub-input.js +319 -0
- package/dist/design-tweaks/scrub-input.js.map +1 -0
- package/dist/design-tweaks/visual-style-controls.d.ts +90 -0
- package/dist/design-tweaks/visual-style-controls.d.ts.map +1 -0
- package/dist/design-tweaks/visual-style-controls.js +423 -0
- package/dist/design-tweaks/visual-style-controls.js.map +1 -0
- package/dist/design-tweaks/visual-style-controls.spec.d.ts +2 -0
- package/dist/design-tweaks/visual-style-controls.spec.d.ts.map +1 -0
- package/dist/design-tweaks/visual-style-controls.spec.js +84 -0
- package/dist/design-tweaks/visual-style-controls.spec.js.map +1 -0
- package/dist/editor/BubbleToolbar.d.ts +37 -0
- package/dist/editor/BubbleToolbar.d.ts.map +1 -0
- package/dist/editor/BubbleToolbar.js +171 -0
- package/dist/editor/BubbleToolbar.js.map +1 -0
- package/dist/editor/CodeBlockNode.d.ts +49 -0
- package/dist/editor/CodeBlockNode.d.ts.map +1 -0
- package/dist/editor/CodeBlockNode.js +127 -0
- package/dist/editor/CodeBlockNode.js.map +1 -0
- package/dist/editor/DragHandle.d.ts +103 -0
- package/dist/editor/DragHandle.d.ts.map +1 -0
- package/dist/editor/DragHandle.js +1101 -0
- package/dist/editor/DragHandle.js.map +1 -0
- package/dist/editor/DragHandle.spec.d.ts +2 -0
- package/dist/editor/DragHandle.spec.d.ts.map +1 -0
- package/dist/editor/DragHandle.spec.js +495 -0
- package/dist/editor/DragHandle.spec.js.map +1 -0
- package/dist/editor/ImageExtension.d.ts +63 -0
- package/dist/editor/ImageExtension.d.ts.map +1 -0
- package/dist/editor/ImageExtension.js +243 -0
- package/dist/editor/ImageExtension.js.map +1 -0
- package/dist/editor/ImageExtension.roundtrip.spec.d.ts +2 -0
- package/dist/editor/ImageExtension.roundtrip.spec.d.ts.map +1 -0
- package/dist/editor/ImageExtension.roundtrip.spec.js +103 -0
- package/dist/editor/ImageExtension.roundtrip.spec.js.map +1 -0
- package/dist/editor/RegistryBlockContext.d.ts +68 -0
- package/dist/editor/RegistryBlockContext.d.ts.map +1 -0
- package/dist/editor/RegistryBlockContext.js +10 -0
- package/dist/editor/RegistryBlockContext.js.map +1 -0
- package/dist/editor/RegistryBlockNode.d.ts +66 -0
- package/dist/editor/RegistryBlockNode.d.ts.map +1 -0
- package/dist/editor/RegistryBlockNode.js +406 -0
- package/dist/editor/RegistryBlockNode.js.map +1 -0
- package/dist/editor/RegistryBlockNode.spec.d.ts +2 -0
- package/dist/editor/RegistryBlockNode.spec.d.ts.map +1 -0
- package/dist/editor/RegistryBlockNode.spec.js +215 -0
- package/dist/editor/RegistryBlockNode.spec.js.map +1 -0
- package/dist/editor/RichMarkdownEditor.collab.spec.d.ts +2 -0
- package/dist/editor/RichMarkdownEditor.collab.spec.d.ts.map +1 -0
- package/dist/editor/RichMarkdownEditor.collab.spec.js +65 -0
- package/dist/editor/RichMarkdownEditor.collab.spec.js.map +1 -0
- package/dist/editor/RichMarkdownEditor.d.ts +52 -0
- package/dist/editor/RichMarkdownEditor.d.ts.map +1 -0
- package/dist/editor/RichMarkdownEditor.js +38 -0
- package/dist/editor/RichMarkdownEditor.js.map +1 -0
- package/dist/editor/RichMarkdownEditor.roundtrip.spec.d.ts +2 -0
- package/dist/editor/RichMarkdownEditor.roundtrip.spec.d.ts.map +1 -0
- package/dist/editor/RichMarkdownEditor.roundtrip.spec.js +186 -0
- package/dist/editor/RichMarkdownEditor.roundtrip.spec.js.map +1 -0
- package/dist/editor/RunId.d.ts +28 -0
- package/dist/editor/RunId.d.ts.map +1 -0
- package/dist/editor/RunId.js +60 -0
- package/dist/editor/RunId.js.map +1 -0
- package/dist/editor/SharedRichEditor.d.ts +112 -0
- package/dist/editor/SharedRichEditor.d.ts.map +1 -0
- package/dist/editor/SharedRichEditor.js +159 -0
- package/dist/editor/SharedRichEditor.js.map +1 -0
- package/dist/editor/SharedRichEditor.spec.d.ts +2 -0
- package/dist/editor/SharedRichEditor.spec.d.ts.map +1 -0
- package/dist/editor/SharedRichEditor.spec.js +63 -0
- package/dist/editor/SharedRichEditor.spec.js.map +1 -0
- package/dist/editor/SlashCommandMenu.d.ts +59 -0
- package/dist/editor/SlashCommandMenu.d.ts.map +1 -0
- package/dist/editor/SlashCommandMenu.js +279 -0
- package/dist/editor/SlashCommandMenu.js.map +1 -0
- package/dist/editor/SlashCommandMenu.spec.d.ts +2 -0
- package/dist/editor/SlashCommandMenu.spec.d.ts.map +1 -0
- package/dist/editor/SlashCommandMenu.spec.js +67 -0
- package/dist/editor/SlashCommandMenu.spec.js.map +1 -0
- package/dist/editor/disableHistory.spec.d.ts +2 -0
- package/dist/editor/disableHistory.spec.d.ts.map +1 -0
- package/dist/editor/disableHistory.spec.js +73 -0
- package/dist/editor/disableHistory.spec.js.map +1 -0
- package/dist/editor/extensions.d.ts +178 -0
- package/dist/editor/extensions.d.ts.map +1 -0
- package/dist/editor/extensions.js +264 -0
- package/dist/editor/extensions.js.map +1 -0
- package/dist/editor/gfmDoc.d.ts +24 -0
- package/dist/editor/gfmDoc.d.ts.map +1 -0
- package/dist/editor/gfmDoc.js +83 -0
- package/dist/editor/gfmDoc.js.map +1 -0
- package/dist/editor/gfmDoc.spec.d.ts +2 -0
- package/dist/editor/gfmDoc.spec.d.ts.map +1 -0
- package/dist/editor/gfmDoc.spec.js +194 -0
- package/dist/editor/gfmDoc.spec.js.map +1 -0
- package/dist/editor/index.d.ts +16 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/index.js +15 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/editor/registrySlashCommands.d.ts +68 -0
- package/dist/editor/registrySlashCommands.d.ts.map +1 -0
- package/dist/editor/registrySlashCommands.js +51 -0
- package/dist/editor/registrySlashCommands.js.map +1 -0
- package/dist/editor/structuralReorderUndo.spec.d.ts +2 -0
- package/dist/editor/structuralReorderUndo.spec.d.ts.map +1 -0
- package/dist/editor/structuralReorderUndo.spec.js +120 -0
- package/dist/editor/structuralReorderUndo.spec.js.map +1 -0
- package/dist/editor/surgical-apply.d.ts +66 -0
- package/dist/editor/surgical-apply.d.ts.map +1 -0
- package/dist/editor/surgical-apply.js +147 -0
- package/dist/editor/surgical-apply.js.map +1 -0
- package/dist/editor/surgical-apply.spec.d.ts +2 -0
- package/dist/editor/surgical-apply.spec.d.ts.map +1 -0
- package/dist/editor/surgical-apply.spec.js +257 -0
- package/dist/editor/surgical-apply.spec.js.map +1 -0
- package/dist/editor/useCollabReconcile.concurrent.spec.d.ts +2 -0
- package/dist/editor/useCollabReconcile.concurrent.spec.d.ts.map +1 -0
- package/dist/editor/useCollabReconcile.concurrent.spec.js +641 -0
- package/dist/editor/useCollabReconcile.concurrent.spec.js.map +1 -0
- package/dist/editor/useCollabReconcile.d.ts +117 -0
- package/dist/editor/useCollabReconcile.d.ts.map +1 -0
- package/dist/editor/useCollabReconcile.idempotent.spec.d.ts +2 -0
- package/dist/editor/useCollabReconcile.idempotent.spec.d.ts.map +1 -0
- package/dist/editor/useCollabReconcile.idempotent.spec.js +248 -0
- package/dist/editor/useCollabReconcile.idempotent.spec.js.map +1 -0
- package/dist/editor/useCollabReconcile.js +521 -0
- package/dist/editor/useCollabReconcile.js.map +1 -0
- package/dist/editor.css +587 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-toast.d.ts +45 -0
- package/dist/hooks/use-toast.d.ts.map +1 -0
- package/dist/hooks/use-toast.js +127 -0
- package/dist/hooks/use-toast.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/onboarding/index.d.ts +2 -0
- package/dist/onboarding/index.d.ts.map +1 -0
- package/dist/onboarding/index.js +2 -0
- package/dist/onboarding/index.js.map +1 -0
- package/dist/provider.d.ts +15 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +60 -0
- package/dist/provider.js.map +1 -0
- package/dist/sharing/SharePrimitives.d.ts +42 -0
- package/dist/sharing/SharePrimitives.d.ts.map +1 -0
- package/dist/sharing/SharePrimitives.js +53 -0
- package/dist/sharing/SharePrimitives.js.map +1 -0
- package/dist/sharing/VisibilityBadge.d.ts +11 -0
- package/dist/sharing/VisibilityBadge.d.ts.map +1 -0
- package/dist/sharing/VisibilityBadge.js +19 -0
- package/dist/sharing/VisibilityBadge.js.map +1 -0
- package/dist/sharing/VisibilityBadge.spec.d.ts +2 -0
- package/dist/sharing/VisibilityBadge.spec.d.ts.map +1 -0
- package/dist/sharing/VisibilityBadge.spec.js +60 -0
- package/dist/sharing/VisibilityBadge.spec.js.map +1 -0
- package/dist/sharing/index.d.ts +3 -0
- package/dist/sharing/index.d.ts.map +1 -0
- package/dist/sharing/index.js +3 -0
- package/dist/sharing/index.js.map +1 -0
- package/dist/styles.css +232 -0
- package/dist/ui/accordion.d.ts +8 -0
- package/dist/ui/accordion.d.ts.map +1 -0
- package/dist/ui/accordion.js +14 -0
- package/dist/ui/accordion.js.map +1 -0
- package/dist/ui/alert-dialog.d.ts +21 -0
- package/dist/ui/alert-dialog.d.ts.map +1 -0
- package/dist/ui/alert-dialog.js +27 -0
- package/dist/ui/alert-dialog.js.map +1 -0
- package/dist/ui/alert.d.ts +9 -0
- package/dist/ui/alert.d.ts.map +1 -0
- package/dist/ui/alert.js +23 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/aspect-ratio.d.ts +4 -0
- package/dist/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/ui/aspect-ratio.js +4 -0
- package/dist/ui/aspect-ratio.js.map +1 -0
- package/dist/ui/avatar.d.ts +7 -0
- package/dist/ui/avatar.d.ts.map +1 -0
- package/dist/ui/avatar.js +12 -0
- package/dist/ui/avatar.js.map +1 -0
- package/dist/ui/badge.d.ts +10 -0
- package/dist/ui/badge.d.ts.map +1 -0
- package/dist/ui/badge.js +21 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/breadcrumb.d.ts +20 -0
- package/dist/ui/breadcrumb.d.ts.map +1 -0
- package/dist/ui/breadcrumb.js +24 -0
- package/dist/ui/breadcrumb.js.map +1 -0
- package/dist/ui/button.d.ts +18 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/button.js +67 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/calendar.d.ts +9 -0
- package/dist/ui/calendar.d.ts.map +1 -0
- package/dist/ui/calendar.js +74 -0
- package/dist/ui/calendar.js.map +1 -0
- package/dist/ui/card.d.ts +9 -0
- package/dist/ui/card.d.ts.map +1 -0
- package/dist/ui/card.js +17 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/carousel.d.ts +19 -0
- package/dist/ui/carousel.d.ts.map +1 -0
- package/dist/ui/carousel.js +99 -0
- package/dist/ui/carousel.js.map +1 -0
- package/dist/ui/chart.d.ts +80 -0
- package/dist/ui/chart.d.ts.map +1 -0
- package/dist/ui/chart.js +131 -0
- package/dist/ui/chart.js.map +1 -0
- package/dist/ui/checkbox.d.ts +5 -0
- package/dist/ui/checkbox.d.ts.map +1 -0
- package/dist/ui/checkbox.js +9 -0
- package/dist/ui/checkbox.js.map +1 -0
- package/dist/ui/collapsible.d.ts +6 -0
- package/dist/ui/collapsible.d.ts.map +1 -0
- package/dist/ui/collapsible.js +6 -0
- package/dist/ui/collapsible.js.map +1 -0
- package/dist/ui/command.d.ts +85 -0
- package/dist/ui/command.d.ts.map +1 -0
- package/dist/ui/command.js +29 -0
- package/dist/ui/command.js.map +1 -0
- package/dist/ui/command.spec.d.ts +2 -0
- package/dist/ui/command.spec.d.ts.map +1 -0
- package/dist/ui/command.spec.js +29 -0
- package/dist/ui/command.spec.js.map +1 -0
- package/dist/ui/context-menu.d.ts +28 -0
- package/dist/ui/context-menu.d.ts.map +1 -0
- package/dist/ui/context-menu.js +34 -0
- package/dist/ui/context-menu.js.map +1 -0
- package/dist/ui/date-picker.d.ts +10 -0
- package/dist/ui/date-picker.d.ts.map +1 -0
- package/dist/ui/date-picker.js +20 -0
- package/dist/ui/date-picker.js.map +1 -0
- package/dist/ui/dialog.d.ts +32 -0
- package/dist/ui/dialog.d.ts.map +1 -0
- package/dist/ui/dialog.js +26 -0
- package/dist/ui/dialog.js.map +1 -0
- package/dist/ui/dialog.spec.d.ts +2 -0
- package/dist/ui/dialog.spec.d.ts.map +1 -0
- package/dist/ui/dialog.spec.js +21 -0
- package/dist/ui/dialog.spec.js.map +1 -0
- package/dist/ui/drawer.d.ts +35 -0
- package/dist/ui/drawer.d.ts.map +1 -0
- package/dist/ui/drawer.js +25 -0
- package/dist/ui/drawer.js.map +1 -0
- package/dist/ui/dropdown-menu.d.ts +32 -0
- package/dist/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/ui/dropdown-menu.js +42 -0
- package/dist/ui/dropdown-menu.js.map +1 -0
- package/dist/ui/form.d.ts +26 -0
- package/dist/ui/form.d.ts.map +1 -0
- package/dist/ui/form.js +63 -0
- package/dist/ui/form.js.map +1 -0
- package/dist/ui/hover-card.d.ts +7 -0
- package/dist/ui/hover-card.d.ts.map +1 -0
- package/dist/ui/hover-card.js +10 -0
- package/dist/ui/hover-card.js.map +1 -0
- package/dist/ui/index.d.ts +53 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +53 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/input-otp.d.ts +35 -0
- package/dist/ui/input-otp.d.ts.map +1 -0
- package/dist/ui/input-otp.js +19 -0
- package/dist/ui/input-otp.js.map +1 -0
- package/dist/ui/input.d.ts +4 -0
- package/dist/ui/input.d.ts.map +1 -0
- package/dist/ui/input.js +9 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/label.d.ts +6 -0
- package/dist/ui/label.d.ts.map +1 -0
- package/dist/ui/label.js +10 -0
- package/dist/ui/label.js.map +1 -0
- package/dist/ui/logo.d.ts +7 -0
- package/dist/ui/logo.d.ts.map +1 -0
- package/dist/ui/logo.js +10 -0
- package/dist/ui/logo.js.map +1 -0
- package/dist/ui/menubar.d.ts +29 -0
- package/dist/ui/menubar.d.ts.map +1 -0
- package/dist/ui/menubar.js +36 -0
- package/dist/ui/menubar.js.map +1 -0
- package/dist/ui/navigation-menu.d.ts +13 -0
- package/dist/ui/navigation-menu.d.ts.map +1 -0
- package/dist/ui/navigation-menu.js +25 -0
- package/dist/ui/navigation-menu.js.map +1 -0
- package/dist/ui/pagination.d.ts +29 -0
- package/dist/ui/pagination.d.ts.map +1 -0
- package/dist/ui/pagination.js +24 -0
- package/dist/ui/pagination.js.map +1 -0
- package/dist/ui/popover.d.ts +11 -0
- package/dist/ui/popover.d.ts.map +1 -0
- package/dist/ui/popover.js +16 -0
- package/dist/ui/popover.js.map +1 -0
- package/dist/ui/progress.d.ts +5 -0
- package/dist/ui/progress.d.ts.map +1 -0
- package/dist/ui/progress.js +8 -0
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/radio-group.d.ts +6 -0
- package/dist/ui/radio-group.d.ts.map +1 -0
- package/dist/ui/radio-group.js +15 -0
- package/dist/ui/radio-group.js.map +1 -0
- package/dist/ui/resizable.d.ts +8 -0
- package/dist/ui/resizable.d.ts.map +1 -0
- package/dist/ui/resizable.js +9 -0
- package/dist/ui/resizable.js.map +1 -0
- package/dist/ui/scroll-area.d.ts +6 -0
- package/dist/ui/scroll-area.d.ts.map +1 -0
- package/dist/ui/scroll-area.js +12 -0
- package/dist/ui/scroll-area.js.map +1 -0
- package/dist/ui/select.d.ts +16 -0
- package/dist/ui/select.d.ts.map +1 -0
- package/dist/ui/select.js +27 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/separator.d.ts +5 -0
- package/dist/ui/separator.d.ts.map +1 -0
- package/dist/ui/separator.js +8 -0
- package/dist/ui/separator.js.map +1 -0
- package/dist/ui/sheet.d.ts +29 -0
- package/dist/ui/sheet.d.ts.map +1 -0
- package/dist/ui/sheet.js +37 -0
- package/dist/ui/sheet.js.map +1 -0
- package/dist/ui/sidebar.d.ts +71 -0
- package/dist/ui/sidebar.d.ts.map +1 -0
- package/dist/ui/sidebar.js +230 -0
- package/dist/ui/sidebar.js.map +1 -0
- package/dist/ui/skeleton.d.ts +3 -0
- package/dist/ui/skeleton.d.ts.map +1 -0
- package/dist/ui/skeleton.js +7 -0
- package/dist/ui/skeleton.js.map +1 -0
- package/dist/ui/slider.d.ts +5 -0
- package/dist/ui/slider.d.ts.map +1 -0
- package/dist/ui/slider.js +8 -0
- package/dist/ui/slider.js.map +1 -0
- package/dist/ui/sonner.d.ts +5 -0
- package/dist/ui/sonner.d.ts.map +1 -0
- package/dist/ui/sonner.js +25 -0
- package/dist/ui/sonner.js.map +1 -0
- package/dist/ui/spinner.d.ts +3 -0
- package/dist/ui/spinner.d.ts.map +1 -0
- package/dist/ui/spinner.js +7 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/switch.d.ts +5 -0
- package/dist/ui/switch.d.ts.map +1 -0
- package/dist/ui/switch.js +8 -0
- package/dist/ui/switch.js.map +1 -0
- package/dist/ui/table.d.ts +11 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +21 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/tabs.d.ts +8 -0
- package/dist/ui/tabs.d.ts.map +1 -0
- package/dist/ui/tabs.js +13 -0
- package/dist/ui/tabs.js.map +1 -0
- package/dist/ui/textarea.d.ts +6 -0
- package/dist/ui/textarea.d.ts.map +1 -0
- package/dist/ui/textarea.js +9 -0
- package/dist/ui/textarea.js.map +1 -0
- package/dist/ui/toast.d.ts +16 -0
- package/dist/ui/toast.d.ts.map +1 -0
- package/dist/ui/toast.js +34 -0
- package/dist/ui/toast.js.map +1 -0
- package/dist/ui/toaster.d.ts +2 -0
- package/dist/ui/toaster.d.ts.map +1 -0
- package/dist/ui/toaster.js +10 -0
- package/dist/ui/toaster.js.map +1 -0
- package/dist/ui/toggle-group.d.ts +13 -0
- package/dist/ui/toggle-group.d.ts.map +1 -0
- package/dist/ui/toggle-group.js +21 -0
- package/dist/ui/toggle-group.js.map +1 -0
- package/dist/ui/toggle.d.ts +13 -0
- package/dist/ui/toggle.d.ts.map +1 -0
- package/dist/ui/toggle.js +26 -0
- package/dist/ui/toggle.js.map +1 -0
- package/dist/ui/tooltip.d.ts +11 -0
- package/dist/ui/tooltip.d.ts.map +1 -0
- package/dist/ui/tooltip.js +18 -0
- package/dist/ui/tooltip.js.map +1 -0
- package/dist/ui/use-toast.d.ts +3 -0
- package/dist/ui/use-toast.d.ts.map +1 -0
- package/dist/ui/use-toast.js +3 -0
- package/dist/ui/use-toast.js.map +1 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +7 -0
- package/dist/utils.js.map +1 -0
- package/migration-manifest.json +4 -0
- package/package.json +369 -0
- package/src/app-shell/header-actions.tsx +84 -0
- package/src/app-shell/index.ts +2 -0
- package/src/app-shell/sidebar-footer-actions.spec.tsx +81 -0
- package/src/app-shell/sidebar-footer-actions.tsx +45 -0
- package/src/canvas-annotations/CanvasCommentPins.tsx +861 -0
- package/src/canvas-annotations/DrawOverlay.spec.tsx +145 -0
- package/src/canvas-annotations/DrawOverlay.tsx +1233 -0
- package/src/canvas-annotations/index.ts +15 -0
- package/src/canvas-annotations/types.ts +14 -0
- package/src/canvas-interactions/canvas-interactions.spec.ts +765 -0
- package/src/canvas-interactions/canvas-interactions.ts +965 -0
- package/src/canvas-interactions/index.ts +67 -0
- package/src/chat-history/ChatHistoryList.spec.tsx +485 -0
- package/src/chat-history/ChatHistoryList.tsx +481 -0
- package/src/chat-history/ChatHistoryRail.spec.tsx +312 -0
- package/src/chat-history/ChatHistoryRail.tsx +150 -0
- package/src/chat-history/index.ts +21 -0
- package/src/chat-history/useChatHistoryRailController.spec.tsx +131 -0
- package/src/chat-history/useChatHistoryRailController.ts +76 -0
- package/src/chat-history.css +469 -0
- package/src/collab-ui/AgentPresenceChip.tsx +69 -0
- package/src/collab-ui/LiveCursorOverlay.tsx +241 -0
- package/src/collab-ui/PresenceBar.spec.tsx +44 -0
- package/src/collab-ui/PresenceBar.tsx +373 -0
- package/src/collab-ui/RecentEditHighlights.tsx +239 -0
- package/src/collab-ui/RemoteSelectionRings.tsx +227 -0
- package/src/collab-ui/agent-identity.ts +16 -0
- package/src/collab-ui/index.ts +39 -0
- package/src/collab-ui/lead-client.ts +32 -0
- package/src/collab-ui/types.spec.ts +18 -0
- package/src/collab-ui/types.ts +96 -0
- package/src/composer/AgentComposerFrame.tsx +62 -0
- package/src/composer/ComposerPlusMenu.spec.ts +14 -0
- package/src/composer/ComposerPlusMenu.tsx +1266 -0
- package/src/composer/MentionPopover.tsx +483 -0
- package/src/composer/PastedTextChip.spec.tsx +58 -0
- package/src/composer/PastedTextChip.tsx +178 -0
- package/src/composer/PromptComposer.spec.ts +110 -0
- package/src/composer/PromptComposer.tsx +796 -0
- package/src/composer/RealtimeVoiceMode.spec.tsx +998 -0
- package/src/composer/RealtimeVoiceMode.tsx +1019 -0
- package/src/composer/TiptapComposer.spec.ts +592 -0
- package/src/composer/TiptapComposer.tsx +3746 -0
- package/src/composer/VoiceButton.spec.ts +49 -0
- package/src/composer/VoiceButton.tsx +329 -0
- package/src/composer/asset-picker-url.spec.ts +56 -0
- package/src/composer/asset-picker-url.ts +80 -0
- package/src/composer/attachment-accept.spec.ts +32 -0
- package/src/composer/attachment-accept.ts +75 -0
- package/src/composer/draft-key.spec.ts +19 -0
- package/src/composer/draft-key.ts +7 -0
- package/src/composer/extensions/FileReference.tsx +55 -0
- package/src/composer/extensions/MentionReference.tsx +93 -0
- package/src/composer/extensions/SkillReference.tsx +56 -0
- package/src/composer/index.ts +86 -0
- package/src/composer/model-selection.spec.ts +45 -0
- package/src/composer/model-selection.ts +51 -0
- package/src/composer/pasted-text.spec.ts +162 -0
- package/src/composer/pasted-text.ts +160 -0
- package/src/composer/prompt-attachments.spec.ts +80 -0
- package/src/composer/prompt-attachments.ts +93 -0
- package/src/composer/realtime-voice-audio-level.spec.ts +47 -0
- package/src/composer/realtime-voice-audio-level.ts +65 -0
- package/src/composer/realtime-voice-transcript.spec.ts +95 -0
- package/src/composer/realtime-voice-transcript.ts +134 -0
- package/src/composer/runtime-adapters.spec.tsx +102 -0
- package/src/composer/runtime-adapters.tsx +364 -0
- package/src/composer/types.ts +66 -0
- package/src/composer/use-file-search.ts +64 -0
- package/src/composer/use-mention-search.ts +90 -0
- package/src/composer/use-skills.ts +45 -0
- package/src/composer/useRealtimeVoiceMode.spec.ts +952 -0
- package/src/composer/useRealtimeVoiceMode.tsx +2388 -0
- package/src/composer/useVoiceDictation.browser.spec.tsx +265 -0
- package/src/composer/useVoiceDictation.spec.ts +45 -0
- package/src/composer/useVoiceDictation.ts +1256 -0
- package/src/conformance/__fixtures__/css-in-js-adapter.tsx +401 -0
- package/src/conformance/conformance.spec.tsx +143 -0
- package/src/conformance/index.ts +3 -0
- package/src/conformance/runner.tsx +862 -0
- package/src/conformance/types.ts +45 -0
- package/src/conformance/version.ts +22 -0
- package/src/context-ui/ContextMeter.spec.tsx +73 -0
- package/src/context-ui/ContextMeter.tsx +131 -0
- package/src/context-ui/ContextSegmentRow.tsx +273 -0
- package/src/context-ui/ContextTreemap.tsx +131 -0
- package/src/context-ui/ContextXRayPanel.tsx +491 -0
- package/src/context-ui/format.ts +42 -0
- package/src/context-ui/index.ts +15 -0
- package/src/context-ui/types.ts +57 -0
- package/src/dashboard/DataTable.tsx +273 -0
- package/src/dashboard/DateRangePicker.tsx +57 -0
- package/src/dashboard/GenericChartPanel.spec.tsx +53 -0
- package/src/dashboard/GenericChartPanel.tsx +461 -0
- package/src/dashboard/MetricCard.tsx +54 -0
- package/src/dashboard/StatsCard.tsx +49 -0
- package/src/dashboard/dashboard-layout.spec.ts +79 -0
- package/src/dashboard/dashboard-layout.ts +329 -0
- package/src/dashboard/index.ts +6 -0
- package/src/data-grid/DataGrid.spec.tsx +243 -0
- package/src/data-grid/DataGrid.tsx +754 -0
- package/src/data-grid/index.ts +15 -0
- package/src/design-system/components.tsx +196 -0
- package/src/design-system/context.tsx +31 -0
- package/src/design-system/default-adapter.spec.tsx +158 -0
- package/src/design-system/default-adapter.tsx +923 -0
- package/src/design-system/definition.ts +14 -0
- package/src/design-system/design-system.spec.tsx +356 -0
- package/src/design-system/error-boundary.tsx +37 -0
- package/src/design-system/index.ts +7 -0
- package/src/design-system/theme.spec.ts +61 -0
- package/src/design-system/theme.ts +145 -0
- package/src/design-system/types.ts +367 -0
- package/src/design-tweaks/index.ts +1 -0
- package/src/design-tweaks/scrub-input-utils.ts +311 -0
- package/src/design-tweaks/scrub-input.tsx +525 -0
- package/src/design-tweaks/visual-style-controls.spec.tsx +172 -0
- package/src/design-tweaks/visual-style-controls.tsx +1043 -0
- package/src/editor/BubbleToolbar.tsx +253 -0
- package/src/editor/CodeBlockNode.tsx +254 -0
- package/src/editor/DragHandle.spec.ts +694 -0
- package/src/editor/DragHandle.ts +1491 -0
- package/src/editor/ImageExtension.roundtrip.spec.ts +117 -0
- package/src/editor/ImageExtension.ts +306 -0
- package/src/editor/RegistryBlockContext.tsx +107 -0
- package/src/editor/RegistryBlockNode.spec.ts +279 -0
- package/src/editor/RegistryBlockNode.tsx +652 -0
- package/src/editor/RichMarkdownEditor.collab.spec.ts +79 -0
- package/src/editor/RichMarkdownEditor.roundtrip.spec.ts +226 -0
- package/src/editor/RichMarkdownEditor.tsx +81 -0
- package/src/editor/RunId.ts +61 -0
- package/src/editor/SharedRichEditor.spec.tsx +82 -0
- package/src/editor/SharedRichEditor.tsx +353 -0
- package/src/editor/SlashCommandMenu.spec.ts +90 -0
- package/src/editor/SlashCommandMenu.tsx +396 -0
- package/src/editor/disableHistory.spec.ts +85 -0
- package/src/editor/extensions.ts +454 -0
- package/src/editor/gfmDoc.spec.ts +230 -0
- package/src/editor/gfmDoc.ts +92 -0
- package/src/editor/index.ts +96 -0
- package/src/editor/registrySlashCommands.ts +131 -0
- package/src/editor/structuralReorderUndo.spec.ts +144 -0
- package/src/editor/surgical-apply.spec.ts +279 -0
- package/src/editor/surgical-apply.ts +192 -0
- package/src/editor/useCollabReconcile.concurrent.spec.ts +781 -0
- package/src/editor/useCollabReconcile.idempotent.spec.ts +324 -0
- package/src/editor/useCollabReconcile.ts +684 -0
- package/src/editor.css +587 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/use-mobile.tsx +21 -0
- package/src/hooks/use-toast.ts +188 -0
- package/src/index.ts +10 -0
- package/src/onboarding/index.ts +1 -0
- package/src/provider.tsx +148 -0
- package/src/sharing/SharePrimitives.tsx +224 -0
- package/src/sharing/VisibilityBadge.spec.ts +96 -0
- package/src/sharing/VisibilityBadge.tsx +37 -0
- package/src/sharing/index.ts +16 -0
- package/src/styles.css +232 -0
- package/src/ui/accordion.tsx +56 -0
- package/src/ui/alert-dialog.tsx +141 -0
- package/src/ui/alert.tsx +59 -0
- package/src/ui/aspect-ratio.tsx +5 -0
- package/src/ui/avatar.tsx +48 -0
- package/src/ui/badge.tsx +37 -0
- package/src/ui/breadcrumb.tsx +115 -0
- package/src/ui/button.tsx +167 -0
- package/src/ui/calendar.tsx +214 -0
- package/src/ui/card.tsx +86 -0
- package/src/ui/carousel.tsx +260 -0
- package/src/ui/chart.tsx +375 -0
- package/src/ui/checkbox.tsx +28 -0
- package/src/ui/collapsible.tsx +9 -0
- package/src/ui/command.spec.tsx +51 -0
- package/src/ui/command.tsx +174 -0
- package/src/ui/context-menu.tsx +202 -0
- package/src/ui/date-picker.tsx +67 -0
- package/src/ui/dialog.spec.tsx +43 -0
- package/src/ui/dialog.tsx +171 -0
- package/src/ui/drawer.tsx +126 -0
- package/src/ui/dropdown-menu.tsx +222 -0
- package/src/ui/form.tsx +177 -0
- package/src/ui/hover-card.tsx +27 -0
- package/src/ui/index.ts +52 -0
- package/src/ui/input-otp.tsx +69 -0
- package/src/ui/input.tsx +22 -0
- package/src/ui/label.tsx +24 -0
- package/src/ui/logo.tsx +36 -0
- package/src/ui/menubar.tsx +235 -0
- package/src/ui/navigation-menu.tsx +128 -0
- package/src/ui/pagination.tsx +121 -0
- package/src/ui/popover.tsx +58 -0
- package/src/ui/progress.tsx +27 -0
- package/src/ui/radio-group.tsx +42 -0
- package/src/ui/resizable.tsx +43 -0
- package/src/ui/scroll-area.tsx +46 -0
- package/src/ui/select.tsx +162 -0
- package/src/ui/separator.tsx +29 -0
- package/src/ui/sheet.tsx +160 -0
- package/src/ui/sidebar.tsx +776 -0
- package/src/ui/skeleton.tsx +18 -0
- package/src/ui/slider.tsx +26 -0
- package/src/ui/sonner.tsx +58 -0
- package/src/ui/spinner.tsx +17 -0
- package/src/ui/switch.tsx +27 -0
- package/src/ui/table.tsx +110 -0
- package/src/ui/tabs.tsx +53 -0
- package/src/ui/textarea.tsx +23 -0
- package/src/ui/toast.tsx +127 -0
- package/src/ui/toaster.tsx +33 -0
- package/src/ui/toggle-group.tsx +59 -0
- package/src/ui/toggle.tsx +43 -0
- package/src/ui/tooltip.tsx +57 -0
- package/src/ui/use-toast.ts +3 -0
- package/src/utils.ts +8 -0
|
@@ -0,0 +1,1266 @@
|
|
|
1
|
+
import { useComposerRuntime } from "@assistant-ui/react";
|
|
2
|
+
import {
|
|
3
|
+
IconPlus,
|
|
4
|
+
IconUpload,
|
|
5
|
+
IconBulb,
|
|
6
|
+
IconClock,
|
|
7
|
+
IconBolt,
|
|
8
|
+
IconTool,
|
|
9
|
+
IconPlugConnected,
|
|
10
|
+
IconPhotoPlus,
|
|
11
|
+
IconLoader2,
|
|
12
|
+
IconArrowLeft,
|
|
13
|
+
IconX,
|
|
14
|
+
IconHelpCircle,
|
|
15
|
+
IconTerminal2,
|
|
16
|
+
} from "@tabler/icons-react";
|
|
17
|
+
import React, {
|
|
18
|
+
useState,
|
|
19
|
+
useRef,
|
|
20
|
+
useEffect,
|
|
21
|
+
useMemo,
|
|
22
|
+
useCallback,
|
|
23
|
+
} from "react";
|
|
24
|
+
import { createPortal } from "react-dom";
|
|
25
|
+
|
|
26
|
+
import { Popover, PopoverTrigger, PopoverContent } from "../ui/popover.js";
|
|
27
|
+
import { Switch } from "../ui/switch.js";
|
|
28
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip.js";
|
|
29
|
+
import { cn } from "../utils.js";
|
|
30
|
+
import {
|
|
31
|
+
createAssetPickerHandoffId,
|
|
32
|
+
isExternalAssetPickerUrl,
|
|
33
|
+
standaloneAssetPickerUrl,
|
|
34
|
+
} from "./asset-picker-url.js";
|
|
35
|
+
import { useComposerRuntimeAdapters } from "./runtime-adapters.js";
|
|
36
|
+
import type { ComposerMode } from "./types.js";
|
|
37
|
+
|
|
38
|
+
export interface ComposerTerminalModeControl {
|
|
39
|
+
enabled: boolean;
|
|
40
|
+
onChange: (enabled: boolean) => void;
|
|
41
|
+
onNewTerminal?: () => void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface ComposerPlusMenuProps {
|
|
45
|
+
onSelectMode?: (mode: ComposerMode) => void;
|
|
46
|
+
onAttachmentError?: (message: string) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Show the "Create Extension" entry. Extensions are optional and hidden
|
|
49
|
+
* unless the host explicitly enables their agent tool surface.
|
|
50
|
+
*/
|
|
51
|
+
extensionTools?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* "full" (default): full + menu with Upload File, Create Skill, Schedule Task,
|
|
54
|
+
* Automation, and MCP Server. Extension is included only when
|
|
55
|
+
* `extensionTools` is true. "upload-only": clicking + opens the file picker
|
|
56
|
+
* directly — no popover, no other modes. Use for prompt popovers where the
|
|
57
|
+
* only thing to attach is a file. "terminal": one new-terminal action plus
|
|
58
|
+
* the Terminal mode switch.
|
|
59
|
+
*/
|
|
60
|
+
mode?: "full" | "upload-only" | "terminal";
|
|
61
|
+
terminalModeControl?: ComposerTerminalModeControl;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
type View = "menu" | "skill-upload";
|
|
65
|
+
|
|
66
|
+
const DEFAULT_ASSETS_PICKER_URL = "https://assets.agent-native.com/picker";
|
|
67
|
+
const EMBED_PROTOCOL = "agent-native.embed";
|
|
68
|
+
const EMBED_VERSION = 1;
|
|
69
|
+
|
|
70
|
+
export function isExtensionComposerMenuEnabled(
|
|
71
|
+
extensionTools?: boolean,
|
|
72
|
+
): boolean {
|
|
73
|
+
return extensionTools === true;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
interface EmbedEnvelope<TPayload = unknown> {
|
|
77
|
+
protocol?: string;
|
|
78
|
+
version?: number;
|
|
79
|
+
type?: string;
|
|
80
|
+
name?: string;
|
|
81
|
+
payload?: TPayload;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
interface AssetPickerPayload {
|
|
85
|
+
assetId?: unknown;
|
|
86
|
+
handoffId?: unknown;
|
|
87
|
+
url?: unknown;
|
|
88
|
+
previewUrl?: unknown;
|
|
89
|
+
downloadUrl?: unknown;
|
|
90
|
+
embedUrl?: unknown;
|
|
91
|
+
altText?: unknown;
|
|
92
|
+
title?: unknown;
|
|
93
|
+
prompt?: unknown;
|
|
94
|
+
mediaType?: unknown;
|
|
95
|
+
libraryId?: unknown;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function assetPickerUrl() {
|
|
99
|
+
const env =
|
|
100
|
+
(import.meta as ImportMeta & { env?: Record<string, string | undefined> })
|
|
101
|
+
.env ?? {};
|
|
102
|
+
return env.VITE_AGENT_NATIVE_ASSETS_PICKER_URL || DEFAULT_ASSETS_PICKER_URL;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function withEmbeddedParams(url: string): string {
|
|
106
|
+
try {
|
|
107
|
+
const parsed = new URL(url, window.location.href);
|
|
108
|
+
parsed.searchParams.set("embedded", "1");
|
|
109
|
+
parsed.searchParams.set("mediaType", "image");
|
|
110
|
+
return parsed.toString();
|
|
111
|
+
} catch {
|
|
112
|
+
const separator = url.includes("?") ? "&" : "?";
|
|
113
|
+
return `${url}${separator}embedded=1&mediaType=image`;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function assetPickerOrigin(url: string): string | null {
|
|
118
|
+
try {
|
|
119
|
+
return new URL(url, window.location.href).origin;
|
|
120
|
+
} catch {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function embedEnvelope(
|
|
126
|
+
type: "message" | "ready",
|
|
127
|
+
options: { name?: string; payload?: unknown } = {},
|
|
128
|
+
): EmbedEnvelope {
|
|
129
|
+
return {
|
|
130
|
+
protocol: EMBED_PROTOCOL,
|
|
131
|
+
version: EMBED_VERSION,
|
|
132
|
+
type,
|
|
133
|
+
...options,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function isEmbedEnvelope(value: unknown): value is EmbedEnvelope {
|
|
138
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
139
|
+
const candidate = value as EmbedEnvelope;
|
|
140
|
+
return (
|
|
141
|
+
candidate.protocol === EMBED_PROTOCOL &&
|
|
142
|
+
candidate.version === EMBED_VERSION &&
|
|
143
|
+
typeof candidate.type === "string"
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function assetString(value: unknown): string | null {
|
|
148
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function assetImageSource(payload: unknown): string | null {
|
|
152
|
+
if (!payload || typeof payload !== "object") return null;
|
|
153
|
+
const asset = payload as AssetPickerPayload;
|
|
154
|
+
return (
|
|
155
|
+
assetString(asset.url) ??
|
|
156
|
+
assetString(asset.previewUrl) ??
|
|
157
|
+
assetString(asset.downloadUrl) ??
|
|
158
|
+
assetString(asset.embedUrl)
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function assetTitle(
|
|
163
|
+
payload: unknown,
|
|
164
|
+
url: string,
|
|
165
|
+
generatedImageLabel: string,
|
|
166
|
+
): string {
|
|
167
|
+
if (payload && typeof payload === "object") {
|
|
168
|
+
const title = assetString((payload as AssetPickerPayload).title);
|
|
169
|
+
if (title) return title;
|
|
170
|
+
const prompt = assetString((payload as AssetPickerPayload).prompt);
|
|
171
|
+
if (prompt) return prompt.slice(0, 80);
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
const name = new URL(url).pathname.split("/").filter(Boolean).pop();
|
|
175
|
+
return name ? decodeURIComponent(name) : generatedImageLabel;
|
|
176
|
+
} catch {
|
|
177
|
+
return generatedImageLabel;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function assetContext(payload: unknown, url: string): string {
|
|
182
|
+
const lines = [`Image URL: ${url}`];
|
|
183
|
+
if (payload && typeof payload === "object") {
|
|
184
|
+
const asset = payload as AssetPickerPayload;
|
|
185
|
+
const assetId = assetString(asset.assetId);
|
|
186
|
+
const libraryId = assetString(asset.libraryId);
|
|
187
|
+
const prompt = assetString(asset.prompt);
|
|
188
|
+
const altText = assetString(asset.altText);
|
|
189
|
+
if (assetId) lines.push(`Asset ID: ${assetId}`);
|
|
190
|
+
if (libraryId) lines.push(`Library ID: ${libraryId}`);
|
|
191
|
+
if (prompt) lines.push(`Prompt: ${prompt}`);
|
|
192
|
+
if (altText) lines.push(`Alt text: ${altText}`);
|
|
193
|
+
}
|
|
194
|
+
return lines.join("\n");
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function slugifyName(value: string): string {
|
|
198
|
+
return (
|
|
199
|
+
value
|
|
200
|
+
.toLowerCase()
|
|
201
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
202
|
+
.replace(/^-+|-+$/g, "") || "uploaded-skill"
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function formatAttachmentError(error: unknown, fallback: string): string {
|
|
207
|
+
return error instanceof Error ? error.message : fallback;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function MenuItemHelp({
|
|
211
|
+
label,
|
|
212
|
+
description,
|
|
213
|
+
}: {
|
|
214
|
+
label: string;
|
|
215
|
+
description?: string;
|
|
216
|
+
}) {
|
|
217
|
+
const normalizedDescription = description?.trim();
|
|
218
|
+
if (!normalizedDescription) return null;
|
|
219
|
+
return (
|
|
220
|
+
<Tooltip>
|
|
221
|
+
<TooltipTrigger asChild>
|
|
222
|
+
<span
|
|
223
|
+
role="img"
|
|
224
|
+
tabIndex={0}
|
|
225
|
+
aria-label={`${label}: ${normalizedDescription}`}
|
|
226
|
+
onClick={(event) => event.stopPropagation()}
|
|
227
|
+
className="flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
228
|
+
>
|
|
229
|
+
<IconHelpCircle
|
|
230
|
+
aria-hidden="true"
|
|
231
|
+
className="size-3"
|
|
232
|
+
strokeWidth={1.8}
|
|
233
|
+
/>
|
|
234
|
+
</span>
|
|
235
|
+
</TooltipTrigger>
|
|
236
|
+
<TooltipContent side="right" className="max-w-xs">
|
|
237
|
+
{normalizedDescription}
|
|
238
|
+
</TooltipContent>
|
|
239
|
+
</Tooltip>
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function UploadOnlyAttachButton({
|
|
244
|
+
onAttachmentError,
|
|
245
|
+
}: Pick<ComposerPlusMenuProps, "onAttachmentError">) {
|
|
246
|
+
const composerRuntime = useComposerRuntime();
|
|
247
|
+
const t = useComposerRuntimeAdapters().translate!;
|
|
248
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
249
|
+
const handleFilesSelected = async (files: FileList | null) => {
|
|
250
|
+
if (!files || files.length === 0) return;
|
|
251
|
+
try {
|
|
252
|
+
await Promise.all(
|
|
253
|
+
Array.from(files).map((file) => composerRuntime.addAttachment(file)),
|
|
254
|
+
);
|
|
255
|
+
} catch (error) {
|
|
256
|
+
onAttachmentError?.(
|
|
257
|
+
formatAttachmentError(
|
|
258
|
+
error,
|
|
259
|
+
t("agentChat.composer.uploadFailed", {
|
|
260
|
+
defaultValue: "Could not upload the selected file.",
|
|
261
|
+
}),
|
|
262
|
+
),
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
return (
|
|
268
|
+
<>
|
|
269
|
+
<input
|
|
270
|
+
ref={inputRef}
|
|
271
|
+
type="file"
|
|
272
|
+
multiple
|
|
273
|
+
className="hidden"
|
|
274
|
+
onChange={(event) => {
|
|
275
|
+
void handleFilesSelected(event.target.files);
|
|
276
|
+
event.target.value = "";
|
|
277
|
+
}}
|
|
278
|
+
/>
|
|
279
|
+
<Tooltip>
|
|
280
|
+
<TooltipTrigger asChild>
|
|
281
|
+
<span className="inline-flex shrink-0">
|
|
282
|
+
<button
|
|
283
|
+
type="button"
|
|
284
|
+
className="shrink-0 flex h-7 w-7 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50"
|
|
285
|
+
aria-label={t("agentChat.composer.upload", {
|
|
286
|
+
defaultValue: "Upload",
|
|
287
|
+
})}
|
|
288
|
+
onClick={() => inputRef.current?.click()}
|
|
289
|
+
>
|
|
290
|
+
<IconPlus className="h-4 w-4" />
|
|
291
|
+
</button>
|
|
292
|
+
</span>
|
|
293
|
+
</TooltipTrigger>
|
|
294
|
+
<TooltipContent>
|
|
295
|
+
{t("agentChat.composer.upload", { defaultValue: "Upload" })}
|
|
296
|
+
</TooltipContent>
|
|
297
|
+
</Tooltip>
|
|
298
|
+
</>
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export function ComposerPlusMenu({
|
|
303
|
+
onSelectMode,
|
|
304
|
+
onAttachmentError,
|
|
305
|
+
extensionTools = false,
|
|
306
|
+
mode = "full",
|
|
307
|
+
terminalModeControl,
|
|
308
|
+
}: ComposerPlusMenuProps) {
|
|
309
|
+
if (mode === "upload-only") {
|
|
310
|
+
return <UploadOnlyAttachButton onAttachmentError={onAttachmentError} />;
|
|
311
|
+
}
|
|
312
|
+
if (mode === "terminal" && terminalModeControl) {
|
|
313
|
+
return (
|
|
314
|
+
<ComposerPlusMenuTerminal terminalModeControl={terminalModeControl} />
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
return (
|
|
318
|
+
<ComposerPlusMenuFull
|
|
319
|
+
onSelectMode={onSelectMode}
|
|
320
|
+
onAttachmentError={onAttachmentError}
|
|
321
|
+
extensionTools={extensionTools}
|
|
322
|
+
/>
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function ComposerPlusMenuTerminal({
|
|
327
|
+
terminalModeControl,
|
|
328
|
+
}: Pick<ComposerPlusMenuProps, "terminalModeControl">) {
|
|
329
|
+
const [open, setOpen] = useState(false);
|
|
330
|
+
|
|
331
|
+
if (!terminalModeControl) return null;
|
|
332
|
+
|
|
333
|
+
const handlePrimaryAction = () => {
|
|
334
|
+
if (!terminalModeControl.enabled) {
|
|
335
|
+
terminalModeControl.onChange(true);
|
|
336
|
+
setOpen(false);
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
terminalModeControl.onNewTerminal?.();
|
|
340
|
+
setOpen(false);
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
return (
|
|
344
|
+
<>
|
|
345
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
346
|
+
<PopoverTrigger asChild>
|
|
347
|
+
<button
|
|
348
|
+
type="button"
|
|
349
|
+
className="flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground"
|
|
350
|
+
aria-label="Terminal options" /* i18n-ignore -- portable toolkit label */
|
|
351
|
+
title="Terminal options" /* i18n-ignore -- portable toolkit label */
|
|
352
|
+
>
|
|
353
|
+
<IconPlus className="h-4 w-4" />
|
|
354
|
+
</button>
|
|
355
|
+
</PopoverTrigger>
|
|
356
|
+
<PopoverContent
|
|
357
|
+
align="start"
|
|
358
|
+
sideOffset={8}
|
|
359
|
+
className="w-56 border-input bg-muted p-1 text-foreground"
|
|
360
|
+
onOpenAutoFocus={(event) => event.preventDefault()}
|
|
361
|
+
>
|
|
362
|
+
<button
|
|
363
|
+
type="button"
|
|
364
|
+
className="flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-start text-[12px] font-medium text-foreground hover:bg-accent/60"
|
|
365
|
+
onClick={handlePrimaryAction}
|
|
366
|
+
>
|
|
367
|
+
<IconTerminal2
|
|
368
|
+
size={14}
|
|
369
|
+
className="shrink-0 text-muted-foreground"
|
|
370
|
+
aria-hidden="true"
|
|
371
|
+
/>
|
|
372
|
+
<span>
|
|
373
|
+
{terminalModeControl.enabled ? "New terminal" : "Start terminal"}
|
|
374
|
+
</span>
|
|
375
|
+
</button>
|
|
376
|
+
<div className="my-1 border-t border-border/70" />
|
|
377
|
+
<div className="flex items-center justify-between gap-3 px-2.5 py-2">
|
|
378
|
+
<span className="text-[12px] font-medium text-foreground">
|
|
379
|
+
{"Terminal mode" /* i18n-ignore -- portable toolkit label */}
|
|
380
|
+
</span>
|
|
381
|
+
<Switch
|
|
382
|
+
checked={terminalModeControl.enabled}
|
|
383
|
+
onCheckedChange={terminalModeControl.onChange}
|
|
384
|
+
aria-label="Terminal mode" /* i18n-ignore -- portable toolkit label */
|
|
385
|
+
/>
|
|
386
|
+
</div>
|
|
387
|
+
</PopoverContent>
|
|
388
|
+
</Popover>
|
|
389
|
+
</>
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
function ComposerPlusMenuFull({
|
|
394
|
+
onSelectMode,
|
|
395
|
+
onAttachmentError,
|
|
396
|
+
extensionTools,
|
|
397
|
+
}: Pick<
|
|
398
|
+
ComposerPlusMenuProps,
|
|
399
|
+
"onSelectMode" | "onAttachmentError" | "extensionTools"
|
|
400
|
+
>) {
|
|
401
|
+
const adapters = useComposerRuntimeAdapters();
|
|
402
|
+
const t = adapters.translate!;
|
|
403
|
+
const resources = adapters.resources!;
|
|
404
|
+
const composerRuntime = useComposerRuntime();
|
|
405
|
+
const [open, setOpen] = useState(false);
|
|
406
|
+
const [assetsPickerOpen, setAssetsPickerOpen] = useState(false);
|
|
407
|
+
const [mcpDialogOpen, setMcpDialogOpen] = useState(false);
|
|
408
|
+
const [view, setView] = useState<View>("menu");
|
|
409
|
+
const showMcpIntegrations = useMemo(
|
|
410
|
+
() => resources.isMcpIntegrationAvailable!(),
|
|
411
|
+
[resources],
|
|
412
|
+
);
|
|
413
|
+
|
|
414
|
+
const { data: org } = resources.useOrg!();
|
|
415
|
+
const canCreateOrgMcp =
|
|
416
|
+
!org?.orgId || org.role === "owner" || org.role === "admin";
|
|
417
|
+
const hasOrg = !!org?.orgId;
|
|
418
|
+
// Composer connections belong to the person asking for them. Organization
|
|
419
|
+
// sharing remains an explicit choice for owners and admins in the dialog.
|
|
420
|
+
const defaultMcpScope: "user" = "user";
|
|
421
|
+
const createMcp = resources.useCreateMcpServer!();
|
|
422
|
+
const McpIntegrationDialog = resources.McpIntegrationDialog;
|
|
423
|
+
|
|
424
|
+
const fileUploadRef = useRef<HTMLInputElement>(null);
|
|
425
|
+
const skillFileInputRef = useRef<HTMLInputElement>(null);
|
|
426
|
+
const skillHoverTimerRef = useRef<number | null>(null);
|
|
427
|
+
const [skillUploadSlug, setSkillUploadSlug] = useState("");
|
|
428
|
+
const [skillUploadContent, setSkillUploadContent] = useState("");
|
|
429
|
+
const [skillUploadFileName, setSkillUploadFileName] = useState("");
|
|
430
|
+
const [skillUploadStatus, setSkillUploadStatus] = useState<{
|
|
431
|
+
kind: "ok" | "err";
|
|
432
|
+
message: string;
|
|
433
|
+
} | null>(null);
|
|
434
|
+
const [skillUploadBusy, setSkillUploadBusy] = useState(false);
|
|
435
|
+
const [skillFlyoutOpen, setSkillFlyoutOpen] = useState(false);
|
|
436
|
+
const [skillFlyoutSide, setSkillFlyoutSide] = useState<"right" | "left">(
|
|
437
|
+
"right",
|
|
438
|
+
);
|
|
439
|
+
const skillFlyoutCloseTimerRef = useRef<number | null>(null);
|
|
440
|
+
const openSkillFlyout = (rowEl?: HTMLElement | null) => {
|
|
441
|
+
if (skillFlyoutCloseTimerRef.current) {
|
|
442
|
+
window.clearTimeout(skillFlyoutCloseTimerRef.current);
|
|
443
|
+
skillFlyoutCloseTimerRef.current = null;
|
|
444
|
+
}
|
|
445
|
+
if (rowEl && typeof window !== "undefined") {
|
|
446
|
+
const rect = rowEl.getBoundingClientRect();
|
|
447
|
+
const FLYOUT_WIDTH = 248;
|
|
448
|
+
setSkillFlyoutSide(
|
|
449
|
+
window.innerWidth - rect.right < FLYOUT_WIDTH ? "left" : "right",
|
|
450
|
+
);
|
|
451
|
+
}
|
|
452
|
+
setSkillFlyoutOpen(true);
|
|
453
|
+
};
|
|
454
|
+
const scheduleSkillFlyoutClose = () => {
|
|
455
|
+
if (skillFlyoutCloseTimerRef.current)
|
|
456
|
+
window.clearTimeout(skillFlyoutCloseTimerRef.current);
|
|
457
|
+
skillFlyoutCloseTimerRef.current = window.setTimeout(() => {
|
|
458
|
+
setSkillFlyoutOpen(false);
|
|
459
|
+
}, 160);
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
useEffect(() => {
|
|
463
|
+
if (open) {
|
|
464
|
+
setView("menu");
|
|
465
|
+
setSkillUploadSlug("");
|
|
466
|
+
setSkillUploadContent("");
|
|
467
|
+
setSkillUploadFileName("");
|
|
468
|
+
setSkillUploadStatus(null);
|
|
469
|
+
setSkillUploadBusy(false);
|
|
470
|
+
setSkillFlyoutOpen(false);
|
|
471
|
+
}
|
|
472
|
+
}, [open]);
|
|
473
|
+
|
|
474
|
+
const handleSkillFileSelected = async (files: FileList | null) => {
|
|
475
|
+
if (!files || files.length === 0) return;
|
|
476
|
+
const file = files[0];
|
|
477
|
+
const text = await file.text();
|
|
478
|
+
const baseName = file.name.replace(/\.[^./]+$/, "");
|
|
479
|
+
const slug = slugifyName(
|
|
480
|
+
baseName.toLowerCase() === "skill" ? "uploaded-skill" : baseName,
|
|
481
|
+
);
|
|
482
|
+
setSkillUploadSlug(slug);
|
|
483
|
+
setSkillUploadContent(text);
|
|
484
|
+
setSkillUploadFileName(file.name);
|
|
485
|
+
setSkillUploadStatus(null);
|
|
486
|
+
setView("skill-upload");
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
const handleFilesSelected = async (files: FileList | null) => {
|
|
490
|
+
if (!files || files.length === 0) return;
|
|
491
|
+
try {
|
|
492
|
+
await Promise.all(
|
|
493
|
+
Array.from(files).map((file) => composerRuntime.addAttachment(file)),
|
|
494
|
+
);
|
|
495
|
+
} catch (error) {
|
|
496
|
+
onAttachmentError?.(
|
|
497
|
+
formatAttachmentError(
|
|
498
|
+
error,
|
|
499
|
+
t("agentChat.composer.uploadFailed", {
|
|
500
|
+
defaultValue: "Could not upload the selected file.",
|
|
501
|
+
}),
|
|
502
|
+
),
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
const submitSkillUpload = async () => {
|
|
508
|
+
if (skillUploadBusy) return;
|
|
509
|
+
const slug = slugifyName(skillUploadSlug || "uploaded-skill");
|
|
510
|
+
const path = `skills/${slug}/SKILL.md`;
|
|
511
|
+
setSkillUploadBusy(true);
|
|
512
|
+
setSkillUploadStatus(null);
|
|
513
|
+
try {
|
|
514
|
+
const res = await fetch(
|
|
515
|
+
adapters.resolvePath!("/_agent-native/resources"),
|
|
516
|
+
{
|
|
517
|
+
method: "POST",
|
|
518
|
+
headers: { "Content-Type": "application/json" },
|
|
519
|
+
body: JSON.stringify({
|
|
520
|
+
path,
|
|
521
|
+
content: skillUploadContent,
|
|
522
|
+
mimeType: "text/markdown",
|
|
523
|
+
shared: false,
|
|
524
|
+
}),
|
|
525
|
+
},
|
|
526
|
+
);
|
|
527
|
+
if (!res.ok) {
|
|
528
|
+
const body = await res.text().catch(() => "");
|
|
529
|
+
throw new Error(
|
|
530
|
+
body ||
|
|
531
|
+
t("agentChat.composer.skill.uploadFailedStatus", {
|
|
532
|
+
status: res.status,
|
|
533
|
+
defaultValue: `Upload failed (${res.status})`,
|
|
534
|
+
}),
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
setSkillUploadStatus({
|
|
538
|
+
kind: "ok",
|
|
539
|
+
message: t("agentChat.composer.skill.added", {
|
|
540
|
+
name: skillUploadFileName || `${slug}/SKILL.md`,
|
|
541
|
+
defaultValue: `Skill "${skillUploadFileName || `${slug}/SKILL.md`}" added`,
|
|
542
|
+
}),
|
|
543
|
+
});
|
|
544
|
+
window.setTimeout(() => setOpen(false), 1200);
|
|
545
|
+
} catch (err: any) {
|
|
546
|
+
setSkillUploadStatus({
|
|
547
|
+
kind: "err",
|
|
548
|
+
message:
|
|
549
|
+
err?.message ||
|
|
550
|
+
t("agentChat.composer.skill.saveFailed", {
|
|
551
|
+
defaultValue: "Failed to save skill file",
|
|
552
|
+
}),
|
|
553
|
+
});
|
|
554
|
+
} finally {
|
|
555
|
+
setSkillUploadBusy(false);
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
const menuItems: {
|
|
560
|
+
icon: React.ReactNode;
|
|
561
|
+
label: string;
|
|
562
|
+
desc: string;
|
|
563
|
+
action: () => void;
|
|
564
|
+
hoverAction?: () => void;
|
|
565
|
+
isSkill?: boolean;
|
|
566
|
+
}[] = [
|
|
567
|
+
{
|
|
568
|
+
icon: <IconUpload className="h-3.5 w-3.5" />,
|
|
569
|
+
label: t("agentChat.composer.menu.uploadFile", {
|
|
570
|
+
defaultValue: "Upload File",
|
|
571
|
+
}),
|
|
572
|
+
desc: t("agentChat.composer.menu.uploadFileDescription", {
|
|
573
|
+
defaultValue: "Images, PDFs, text/code, JSON, CSV",
|
|
574
|
+
}),
|
|
575
|
+
action: () => {
|
|
576
|
+
setOpen(false);
|
|
577
|
+
setTimeout(() => fileUploadRef.current?.click(), 0);
|
|
578
|
+
},
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
icon: <IconPhotoPlus className="h-3.5 w-3.5" />,
|
|
582
|
+
label: t("agentChat.composer.menu.generateImage", {
|
|
583
|
+
defaultValue: "Generate Image",
|
|
584
|
+
}),
|
|
585
|
+
desc: t("agentChat.composer.menu.generateImageDescription", {
|
|
586
|
+
defaultValue: "Open the Assets image picker",
|
|
587
|
+
}),
|
|
588
|
+
action: () => {
|
|
589
|
+
setOpen(false);
|
|
590
|
+
setAssetsPickerOpen(true);
|
|
591
|
+
},
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
icon: <IconClock className="h-3.5 w-3.5" />,
|
|
595
|
+
label: t("agentChat.composer.menu.scheduleTask", {
|
|
596
|
+
defaultValue: "Schedule Task",
|
|
597
|
+
}),
|
|
598
|
+
desc: t("agentChat.composer.menu.scheduleTaskDescription", {
|
|
599
|
+
defaultValue: "Run something on a schedule",
|
|
600
|
+
}),
|
|
601
|
+
action: () => {
|
|
602
|
+
onSelectMode?.("job");
|
|
603
|
+
setOpen(false);
|
|
604
|
+
},
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
icon: <IconBolt className="h-3.5 w-3.5" />,
|
|
608
|
+
label: t("agentChat.composer.menu.createAutomation", {
|
|
609
|
+
defaultValue: "Create Automation",
|
|
610
|
+
}),
|
|
611
|
+
desc: t("agentChat.composer.menu.createAutomationDescription", {
|
|
612
|
+
defaultValue: "Set up a when-X-do-Y rule",
|
|
613
|
+
}),
|
|
614
|
+
action: () => {
|
|
615
|
+
onSelectMode?.("automation");
|
|
616
|
+
setOpen(false);
|
|
617
|
+
},
|
|
618
|
+
},
|
|
619
|
+
...(isExtensionComposerMenuEnabled(extensionTools)
|
|
620
|
+
? [
|
|
621
|
+
{
|
|
622
|
+
icon: <IconTool className="h-3.5 w-3.5" />,
|
|
623
|
+
label: t("agentChat.composer.menu.createExtension", {
|
|
624
|
+
defaultValue: "Create Extension",
|
|
625
|
+
}),
|
|
626
|
+
desc: t("agentChat.composer.menu.createExtensionDescription", {
|
|
627
|
+
defaultValue: "Build a mini app extension",
|
|
628
|
+
}),
|
|
629
|
+
action: () => {
|
|
630
|
+
onSelectMode?.("extension");
|
|
631
|
+
setOpen(false);
|
|
632
|
+
},
|
|
633
|
+
},
|
|
634
|
+
]
|
|
635
|
+
: []),
|
|
636
|
+
...(showMcpIntegrations
|
|
637
|
+
? [
|
|
638
|
+
{
|
|
639
|
+
icon: <IconPlugConnected className="h-3.5 w-3.5" />,
|
|
640
|
+
label: t("agentChat.composer.menu.integrations", {
|
|
641
|
+
defaultValue: "Integrations",
|
|
642
|
+
}),
|
|
643
|
+
desc: t("agentChat.composer.menu.integrationsDescription", {
|
|
644
|
+
defaultValue: "Connect tools and services to the agent",
|
|
645
|
+
}),
|
|
646
|
+
action: () => {
|
|
647
|
+
setOpen(false);
|
|
648
|
+
setMcpDialogOpen(true);
|
|
649
|
+
},
|
|
650
|
+
},
|
|
651
|
+
]
|
|
652
|
+
: []),
|
|
653
|
+
{
|
|
654
|
+
icon: <IconBulb className="h-3.5 w-3.5" />,
|
|
655
|
+
label: t("agentChat.composer.menu.createSkill", {
|
|
656
|
+
defaultValue: "Create Skill",
|
|
657
|
+
}),
|
|
658
|
+
desc: t("agentChat.composer.menu.createSkillDescription", {
|
|
659
|
+
defaultValue: "Teach the agent a new ability",
|
|
660
|
+
}),
|
|
661
|
+
action: openSkillFlyout,
|
|
662
|
+
hoverAction: openSkillFlyout,
|
|
663
|
+
isSkill: true,
|
|
664
|
+
},
|
|
665
|
+
];
|
|
666
|
+
|
|
667
|
+
return (
|
|
668
|
+
<>
|
|
669
|
+
{/* Hidden input to trigger the native file upload with explicit errors. */}
|
|
670
|
+
<input
|
|
671
|
+
ref={fileUploadRef}
|
|
672
|
+
type="file"
|
|
673
|
+
multiple
|
|
674
|
+
className="hidden"
|
|
675
|
+
onChange={(event) => {
|
|
676
|
+
void handleFilesSelected(event.target.files);
|
|
677
|
+
event.target.value = "";
|
|
678
|
+
}}
|
|
679
|
+
/>
|
|
680
|
+
<input
|
|
681
|
+
ref={skillFileInputRef}
|
|
682
|
+
type="file"
|
|
683
|
+
accept=".md,text/markdown"
|
|
684
|
+
className="hidden"
|
|
685
|
+
onChange={(e) => {
|
|
686
|
+
void handleSkillFileSelected(e.target.files);
|
|
687
|
+
e.target.value = "";
|
|
688
|
+
}}
|
|
689
|
+
/>
|
|
690
|
+
|
|
691
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
692
|
+
<Tooltip>
|
|
693
|
+
<TooltipTrigger asChild>
|
|
694
|
+
<span className="inline-flex shrink-0">
|
|
695
|
+
<PopoverTrigger asChild>
|
|
696
|
+
<button
|
|
697
|
+
type="button"
|
|
698
|
+
aria-label={t("agentChat.composer.add", {
|
|
699
|
+
defaultValue: "Add...",
|
|
700
|
+
})}
|
|
701
|
+
className="shrink-0 flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50 disabled:opacity-30 disabled:cursor-not-allowed"
|
|
702
|
+
>
|
|
703
|
+
<IconPlus className="h-4 w-4" />
|
|
704
|
+
</button>
|
|
705
|
+
</PopoverTrigger>
|
|
706
|
+
</span>
|
|
707
|
+
</TooltipTrigger>
|
|
708
|
+
<TooltipContent>
|
|
709
|
+
{t("agentChat.composer.add", { defaultValue: "Add..." })}
|
|
710
|
+
</TooltipContent>
|
|
711
|
+
</Tooltip>
|
|
712
|
+
<PopoverContent
|
|
713
|
+
side="top"
|
|
714
|
+
align="start"
|
|
715
|
+
sideOffset={8}
|
|
716
|
+
className={cn(
|
|
717
|
+
"rounded-lg border-input bg-muted p-0 text-foreground",
|
|
718
|
+
view === "skill-upload"
|
|
719
|
+
? "max-h-[70vh] w-[calc(100vw-24px)] max-w-[380px] overflow-y-auto"
|
|
720
|
+
: "w-[260px]",
|
|
721
|
+
)}
|
|
722
|
+
style={{ fontSize: 13, lineHeight: "normal" }}
|
|
723
|
+
onOpenAutoFocus={(e) => e.preventDefault()}
|
|
724
|
+
>
|
|
725
|
+
{view === "menu" && (
|
|
726
|
+
<div className="py-1">
|
|
727
|
+
{menuItems.map((item) => {
|
|
728
|
+
const isSkill = item.isSkill === true;
|
|
729
|
+
return (
|
|
730
|
+
<div
|
|
731
|
+
key={item.label}
|
|
732
|
+
className={cn(
|
|
733
|
+
"relative flex items-center hover:bg-accent/50",
|
|
734
|
+
isSkill && "group/skill",
|
|
735
|
+
isSkill && skillFlyoutOpen && "bg-accent/50",
|
|
736
|
+
)}
|
|
737
|
+
onMouseEnter={(e) => {
|
|
738
|
+
if (isSkill) {
|
|
739
|
+
openSkillFlyout(e.currentTarget);
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
742
|
+
if (!item.hoverAction) return;
|
|
743
|
+
if (skillHoverTimerRef.current)
|
|
744
|
+
window.clearTimeout(skillHoverTimerRef.current);
|
|
745
|
+
skillHoverTimerRef.current = window.setTimeout(() => {
|
|
746
|
+
item.hoverAction?.();
|
|
747
|
+
}, 180);
|
|
748
|
+
}}
|
|
749
|
+
onMouseLeave={() => {
|
|
750
|
+
if (isSkill) {
|
|
751
|
+
scheduleSkillFlyoutClose();
|
|
752
|
+
return;
|
|
753
|
+
}
|
|
754
|
+
if (skillHoverTimerRef.current) {
|
|
755
|
+
window.clearTimeout(skillHoverTimerRef.current);
|
|
756
|
+
skillHoverTimerRef.current = null;
|
|
757
|
+
}
|
|
758
|
+
}}
|
|
759
|
+
>
|
|
760
|
+
<button
|
|
761
|
+
type="button"
|
|
762
|
+
onClick={item.action}
|
|
763
|
+
className={cn(
|
|
764
|
+
"flex min-w-0 flex-1 items-center gap-2.5 px-3 py-2 text-start",
|
|
765
|
+
)}
|
|
766
|
+
>
|
|
767
|
+
<span className="text-muted-foreground">{item.icon}</span>
|
|
768
|
+
<span className="flex min-w-0 items-center gap-0.5">
|
|
769
|
+
<span className="min-w-0 truncate text-[12px] font-medium text-foreground">
|
|
770
|
+
{item.label}
|
|
771
|
+
</span>
|
|
772
|
+
<MenuItemHelp
|
|
773
|
+
label={item.label}
|
|
774
|
+
description={item.desc}
|
|
775
|
+
/>
|
|
776
|
+
</span>
|
|
777
|
+
</button>
|
|
778
|
+
{isSkill && (
|
|
779
|
+
<span className="me-3 ms-auto text-muted-foreground/60">
|
|
780
|
+
›
|
|
781
|
+
</span>
|
|
782
|
+
)}
|
|
783
|
+
{isSkill && skillFlyoutOpen && (
|
|
784
|
+
<div
|
|
785
|
+
role="menu"
|
|
786
|
+
onMouseEnter={() => openSkillFlyout()}
|
|
787
|
+
onMouseLeave={scheduleSkillFlyoutClose}
|
|
788
|
+
className={cn(
|
|
789
|
+
"absolute top-0 z-20 w-[240px] rounded-lg border border-input bg-muted py-1 text-foreground shadow-md",
|
|
790
|
+
skillFlyoutSide === "right"
|
|
791
|
+
? "left-full ml-1"
|
|
792
|
+
: "right-full mr-1",
|
|
793
|
+
)}
|
|
794
|
+
>
|
|
795
|
+
<div className="flex items-center hover:bg-accent/50">
|
|
796
|
+
<button
|
|
797
|
+
type="button"
|
|
798
|
+
onClick={() => {
|
|
799
|
+
onSelectMode?.("skill");
|
|
800
|
+
setSkillFlyoutOpen(false);
|
|
801
|
+
setOpen(false);
|
|
802
|
+
}}
|
|
803
|
+
className="flex min-w-0 flex-1 items-center gap-2.5 px-3 py-2 text-start"
|
|
804
|
+
>
|
|
805
|
+
<span className="text-muted-foreground">
|
|
806
|
+
<IconBulb className="h-3.5 w-3.5" />
|
|
807
|
+
</span>
|
|
808
|
+
<span className="flex min-w-0 items-center gap-0.5">
|
|
809
|
+
<span className="min-w-0 truncate text-[12px] font-medium text-foreground">
|
|
810
|
+
{t("agentChat.composer.skill.createNew", {
|
|
811
|
+
defaultValue: "Create new skill",
|
|
812
|
+
})}
|
|
813
|
+
</span>
|
|
814
|
+
<MenuItemHelp
|
|
815
|
+
label={t("agentChat.composer.skill.createNew", {
|
|
816
|
+
defaultValue: "Create new skill",
|
|
817
|
+
})}
|
|
818
|
+
description={t(
|
|
819
|
+
"agentChat.composer.skill.createDescription",
|
|
820
|
+
{
|
|
821
|
+
defaultValue:
|
|
822
|
+
"Describe a skill and let the agent draft it",
|
|
823
|
+
},
|
|
824
|
+
)}
|
|
825
|
+
/>
|
|
826
|
+
</span>
|
|
827
|
+
</button>
|
|
828
|
+
</div>
|
|
829
|
+
<div className="flex items-center hover:bg-accent/50">
|
|
830
|
+
<button
|
|
831
|
+
type="button"
|
|
832
|
+
onClick={() => {
|
|
833
|
+
setSkillFlyoutOpen(false);
|
|
834
|
+
skillFileInputRef.current?.click();
|
|
835
|
+
}}
|
|
836
|
+
className="flex min-w-0 flex-1 items-center gap-2.5 px-3 py-2 text-start"
|
|
837
|
+
>
|
|
838
|
+
<span className="text-muted-foreground">
|
|
839
|
+
<IconUpload className="h-3.5 w-3.5" />
|
|
840
|
+
</span>
|
|
841
|
+
<span className="flex min-w-0 items-center gap-0.5">
|
|
842
|
+
<span className="min-w-0 truncate text-[12px] font-medium text-foreground">
|
|
843
|
+
{t("agentChat.composer.skill.uploadFile", {
|
|
844
|
+
defaultValue: "Upload skill file",
|
|
845
|
+
})}
|
|
846
|
+
</span>
|
|
847
|
+
<MenuItemHelp
|
|
848
|
+
label={t(
|
|
849
|
+
"agentChat.composer.skill.uploadFile",
|
|
850
|
+
{
|
|
851
|
+
defaultValue: "Upload skill file",
|
|
852
|
+
},
|
|
853
|
+
)}
|
|
854
|
+
description={t(
|
|
855
|
+
"agentChat.composer.skill.uploadDescription",
|
|
856
|
+
{
|
|
857
|
+
defaultValue:
|
|
858
|
+
"Import an existing SKILL.md file",
|
|
859
|
+
},
|
|
860
|
+
)}
|
|
861
|
+
/>
|
|
862
|
+
</span>
|
|
863
|
+
</button>
|
|
864
|
+
</div>
|
|
865
|
+
</div>
|
|
866
|
+
)}
|
|
867
|
+
</div>
|
|
868
|
+
);
|
|
869
|
+
})}
|
|
870
|
+
</div>
|
|
871
|
+
)}
|
|
872
|
+
|
|
873
|
+
{view === "skill-upload" && (
|
|
874
|
+
<div className="p-3">
|
|
875
|
+
<button
|
|
876
|
+
type="button"
|
|
877
|
+
onClick={() => setView("menu")}
|
|
878
|
+
className="mb-1.5 flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground"
|
|
879
|
+
>
|
|
880
|
+
<IconArrowLeft className="h-3 w-3 rtl:-scale-x-100" />
|
|
881
|
+
{t("agentChat.composer.skill.back", {
|
|
882
|
+
defaultValue: "Back",
|
|
883
|
+
})}
|
|
884
|
+
</button>
|
|
885
|
+
<label className="mb-1 block text-[11px] font-semibold text-foreground">
|
|
886
|
+
{t("agentChat.composer.skill.uploadFile", {
|
|
887
|
+
defaultValue: "Upload skill file",
|
|
888
|
+
})}
|
|
889
|
+
</label>
|
|
890
|
+
<p className="mb-2 text-[10px] leading-relaxed text-muted-foreground/60">
|
|
891
|
+
{t("agentChat.composer.skill.review", {
|
|
892
|
+
name:
|
|
893
|
+
skillUploadFileName ||
|
|
894
|
+
t("agentChat.composer.skill.selectedFile", {
|
|
895
|
+
defaultValue: "the selected file",
|
|
896
|
+
}),
|
|
897
|
+
defaultValue: `Review the content from ${skillUploadFileName || "the selected file"} before saving.`,
|
|
898
|
+
})}
|
|
899
|
+
</p>
|
|
900
|
+
<label className="mb-1 block text-[10px] font-medium text-muted-foreground">
|
|
901
|
+
{t("agentChat.composer.skill.name", {
|
|
902
|
+
defaultValue: "Skill name",
|
|
903
|
+
})}
|
|
904
|
+
</label>
|
|
905
|
+
<input
|
|
906
|
+
value={skillUploadSlug}
|
|
907
|
+
onChange={(e) => setSkillUploadSlug(e.target.value)}
|
|
908
|
+
className="mb-2 w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[12px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent"
|
|
909
|
+
placeholder="my-skill"
|
|
910
|
+
/>
|
|
911
|
+
<p className="mb-2 text-[10px] text-muted-foreground/60">
|
|
912
|
+
{t("agentChat.composer.skill.savedAt", {
|
|
913
|
+
defaultValue: "Saved at",
|
|
914
|
+
})}{" "}
|
|
915
|
+
<span className="font-mono">
|
|
916
|
+
skills/{slugifyName(skillUploadSlug || "uploaded-skill")}
|
|
917
|
+
/SKILL.md
|
|
918
|
+
</span>
|
|
919
|
+
</p>
|
|
920
|
+
<label className="mb-1 block text-[10px] font-medium text-muted-foreground">
|
|
921
|
+
{t("agentChat.composer.skill.content", {
|
|
922
|
+
defaultValue: "Content",
|
|
923
|
+
})}
|
|
924
|
+
</label>
|
|
925
|
+
<textarea
|
|
926
|
+
value={skillUploadContent}
|
|
927
|
+
onChange={(e) => setSkillUploadContent(e.target.value)}
|
|
928
|
+
rows={10}
|
|
929
|
+
className="w-full rounded-md border border-border bg-background px-2.5 py-1.5 font-mono text-[11px] leading-relaxed text-foreground outline-none focus:ring-1 focus:ring-accent"
|
|
930
|
+
/>
|
|
931
|
+
{skillUploadStatus && (
|
|
932
|
+
<div
|
|
933
|
+
className={cn(
|
|
934
|
+
"mt-2 text-[11px] leading-snug",
|
|
935
|
+
skillUploadStatus.kind === "ok"
|
|
936
|
+
? "text-green-600 dark:text-green-400"
|
|
937
|
+
: "text-red-600 dark:text-red-400",
|
|
938
|
+
)}
|
|
939
|
+
>
|
|
940
|
+
{skillUploadStatus.message}
|
|
941
|
+
</div>
|
|
942
|
+
)}
|
|
943
|
+
<div className="mt-2.5 flex justify-end gap-2">
|
|
944
|
+
<button
|
|
945
|
+
type="button"
|
|
946
|
+
onClick={() => setView("menu")}
|
|
947
|
+
className="rounded-md px-3 py-1.5 text-[12px] font-medium text-muted-foreground hover:bg-accent/40"
|
|
948
|
+
>
|
|
949
|
+
{t("agentChat.common.cancel", {
|
|
950
|
+
defaultValue: "Cancel",
|
|
951
|
+
})}
|
|
952
|
+
</button>
|
|
953
|
+
<button
|
|
954
|
+
type="button"
|
|
955
|
+
onClick={submitSkillUpload}
|
|
956
|
+
disabled={
|
|
957
|
+
skillUploadBusy ||
|
|
958
|
+
!skillUploadContent.trim() ||
|
|
959
|
+
!skillUploadSlug.trim()
|
|
960
|
+
}
|
|
961
|
+
className="rounded-md bg-accent px-3 py-1.5 text-[12px] font-medium text-foreground hover:bg-accent/80 disabled:opacity-40 disabled:pointer-events-none"
|
|
962
|
+
>
|
|
963
|
+
{skillUploadBusy ? (
|
|
964
|
+
<IconLoader2 className="h-3 w-3 animate-spin" />
|
|
965
|
+
) : (
|
|
966
|
+
t("agentChat.common.save", { defaultValue: "Save" })
|
|
967
|
+
)}
|
|
968
|
+
</button>
|
|
969
|
+
</div>
|
|
970
|
+
</div>
|
|
971
|
+
)}
|
|
972
|
+
</PopoverContent>
|
|
973
|
+
</Popover>
|
|
974
|
+
{McpIntegrationDialog ? (
|
|
975
|
+
<McpIntegrationDialog
|
|
976
|
+
open={mcpDialogOpen}
|
|
977
|
+
onOpenChange={setMcpDialogOpen}
|
|
978
|
+
defaultScope={defaultMcpScope}
|
|
979
|
+
canCreateOrgMcp={canCreateOrgMcp}
|
|
980
|
+
hasOrg={hasOrg}
|
|
981
|
+
onCreateMcpServer={(args: unknown) => createMcp.mutateAsync(args)}
|
|
982
|
+
/>
|
|
983
|
+
) : null}
|
|
984
|
+
<AssetsPickerModal
|
|
985
|
+
open={assetsPickerOpen}
|
|
986
|
+
onOpenChange={setAssetsPickerOpen}
|
|
987
|
+
/>
|
|
988
|
+
</>
|
|
989
|
+
);
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
function AssetsPickerModal({
|
|
993
|
+
open,
|
|
994
|
+
onOpenChange,
|
|
995
|
+
}: {
|
|
996
|
+
open: boolean;
|
|
997
|
+
onOpenChange: (open: boolean) => void;
|
|
998
|
+
}) {
|
|
999
|
+
const adapters = useComposerRuntimeAdapters();
|
|
1000
|
+
const t = adapters.translate!;
|
|
1001
|
+
const iframeRef = useRef<HTMLIFrameElement | null>(null);
|
|
1002
|
+
const standaloneWindowRef = useRef<Window | null>(null);
|
|
1003
|
+
const [pickerReady, setPickerReady] = useState(false);
|
|
1004
|
+
const [standaloneHandoffId, setStandaloneHandoffId] = useState<string | null>(
|
|
1005
|
+
null,
|
|
1006
|
+
);
|
|
1007
|
+
const sourceUrl = useMemo(() => assetPickerUrl(), []);
|
|
1008
|
+
const externalPicker = useMemo(
|
|
1009
|
+
() =>
|
|
1010
|
+
typeof window !== "undefined" &&
|
|
1011
|
+
isExternalAssetPickerUrl(sourceUrl, window.location.origin),
|
|
1012
|
+
[sourceUrl],
|
|
1013
|
+
);
|
|
1014
|
+
const standaloneUrl = useMemo(
|
|
1015
|
+
() =>
|
|
1016
|
+
standaloneAssetPickerUrl(
|
|
1017
|
+
sourceUrl,
|
|
1018
|
+
typeof window !== "undefined" ? window.location.href : undefined,
|
|
1019
|
+
{
|
|
1020
|
+
handoffId: standaloneHandoffId ?? undefined,
|
|
1021
|
+
returnOrigin:
|
|
1022
|
+
typeof window !== "undefined" ? window.location.origin : undefined,
|
|
1023
|
+
},
|
|
1024
|
+
),
|
|
1025
|
+
[sourceUrl, standaloneHandoffId],
|
|
1026
|
+
);
|
|
1027
|
+
const iframeUrl = useMemo(() => withEmbeddedParams(sourceUrl), [sourceUrl]);
|
|
1028
|
+
const targetOrigin = useMemo(() => assetPickerOrigin(iframeUrl), [iframeUrl]);
|
|
1029
|
+
const configurePicker = useCallback(() => {
|
|
1030
|
+
if (!targetOrigin) return;
|
|
1031
|
+
iframeRef.current?.contentWindow?.postMessage(
|
|
1032
|
+
embedEnvelope("message", {
|
|
1033
|
+
name: "configure",
|
|
1034
|
+
payload: { mediaType: "image", count: 3 },
|
|
1035
|
+
}),
|
|
1036
|
+
targetOrigin,
|
|
1037
|
+
);
|
|
1038
|
+
}, [targetOrigin]);
|
|
1039
|
+
|
|
1040
|
+
useEffect(() => {
|
|
1041
|
+
if (open) {
|
|
1042
|
+
setPickerReady(false);
|
|
1043
|
+
if (externalPicker) {
|
|
1044
|
+
standaloneWindowRef.current = null;
|
|
1045
|
+
setStandaloneHandoffId(createAssetPickerHandoffId());
|
|
1046
|
+
} else {
|
|
1047
|
+
setStandaloneHandoffId(null);
|
|
1048
|
+
}
|
|
1049
|
+
return;
|
|
1050
|
+
}
|
|
1051
|
+
if (!standaloneWindowRef.current) setStandaloneHandoffId(null);
|
|
1052
|
+
}, [externalPicker, iframeUrl, open]);
|
|
1053
|
+
|
|
1054
|
+
useEffect(() => {
|
|
1055
|
+
if (
|
|
1056
|
+
!targetOrigin ||
|
|
1057
|
+
(!open && !standaloneWindowRef.current) ||
|
|
1058
|
+
(externalPicker && !standaloneHandoffId)
|
|
1059
|
+
)
|
|
1060
|
+
return;
|
|
1061
|
+
|
|
1062
|
+
const handleMessage = (event: MessageEvent) => {
|
|
1063
|
+
const expectedSource = externalPicker
|
|
1064
|
+
? standaloneWindowRef.current
|
|
1065
|
+
: iframeRef.current?.contentWindow;
|
|
1066
|
+
if (!expectedSource || event.source !== expectedSource) return;
|
|
1067
|
+
if (event.origin !== targetOrigin) return;
|
|
1068
|
+
if (!isEmbedEnvelope(event.data)) return;
|
|
1069
|
+
|
|
1070
|
+
if (event.data.type === "ready") {
|
|
1071
|
+
setPickerReady(true);
|
|
1072
|
+
configurePicker();
|
|
1073
|
+
return;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
if (event.data.type !== "message") return;
|
|
1077
|
+
if (externalPicker) {
|
|
1078
|
+
const payload = event.data.payload;
|
|
1079
|
+
const handoffId =
|
|
1080
|
+
payload && typeof payload === "object"
|
|
1081
|
+
? assetString((payload as AssetPickerPayload).handoffId)
|
|
1082
|
+
: null;
|
|
1083
|
+
if (handoffId !== standaloneHandoffId) return;
|
|
1084
|
+
}
|
|
1085
|
+
if (event.data.name === "close") {
|
|
1086
|
+
onOpenChange(false);
|
|
1087
|
+
return;
|
|
1088
|
+
}
|
|
1089
|
+
if (
|
|
1090
|
+
event.data.name !== "chooseImage" &&
|
|
1091
|
+
event.data.name !== "chooseAsset"
|
|
1092
|
+
)
|
|
1093
|
+
return;
|
|
1094
|
+
|
|
1095
|
+
const url = assetImageSource(event.data.payload);
|
|
1096
|
+
if (!url) return;
|
|
1097
|
+
const title = assetTitle(
|
|
1098
|
+
event.data.payload,
|
|
1099
|
+
url,
|
|
1100
|
+
t("agentChat.composer.assets.generatedImage", {
|
|
1101
|
+
defaultValue: "Generated image",
|
|
1102
|
+
}),
|
|
1103
|
+
);
|
|
1104
|
+
const assetId =
|
|
1105
|
+
event.data.payload && typeof event.data.payload === "object"
|
|
1106
|
+
? assetString((event.data.payload as AssetPickerPayload).assetId)
|
|
1107
|
+
: null;
|
|
1108
|
+
adapters.agentChat!.setContextItem!({
|
|
1109
|
+
key: `asset-image:${assetId ?? url}`,
|
|
1110
|
+
title: t("agentChat.composer.assets.contextTitle", {
|
|
1111
|
+
title,
|
|
1112
|
+
defaultValue: `Image: ${title}`,
|
|
1113
|
+
}),
|
|
1114
|
+
context: assetContext(event.data.payload, url),
|
|
1115
|
+
});
|
|
1116
|
+
standaloneWindowRef.current = null;
|
|
1117
|
+
setStandaloneHandoffId(null);
|
|
1118
|
+
onOpenChange(false);
|
|
1119
|
+
};
|
|
1120
|
+
|
|
1121
|
+
const handleKey = (event: KeyboardEvent) => {
|
|
1122
|
+
if (event.key === "Escape") onOpenChange(false);
|
|
1123
|
+
};
|
|
1124
|
+
|
|
1125
|
+
window.addEventListener("message", handleMessage);
|
|
1126
|
+
window.addEventListener("keydown", handleKey);
|
|
1127
|
+
return () => {
|
|
1128
|
+
window.removeEventListener("message", handleMessage);
|
|
1129
|
+
window.removeEventListener("keydown", handleKey);
|
|
1130
|
+
};
|
|
1131
|
+
}, [
|
|
1132
|
+
configurePicker,
|
|
1133
|
+
adapters,
|
|
1134
|
+
externalPicker,
|
|
1135
|
+
onOpenChange,
|
|
1136
|
+
open,
|
|
1137
|
+
standaloneHandoffId,
|
|
1138
|
+
t,
|
|
1139
|
+
targetOrigin,
|
|
1140
|
+
]);
|
|
1141
|
+
|
|
1142
|
+
const openStandalonePicker = useCallback(
|
|
1143
|
+
(event: React.MouseEvent<HTMLAnchorElement>) => {
|
|
1144
|
+
if (!standaloneHandoffId) return;
|
|
1145
|
+
event.preventDefault();
|
|
1146
|
+
const pickerWindow = window.open(standaloneUrl, "_blank");
|
|
1147
|
+
if (!pickerWindow) return;
|
|
1148
|
+
standaloneWindowRef.current = pickerWindow;
|
|
1149
|
+
onOpenChange(false);
|
|
1150
|
+
},
|
|
1151
|
+
[onOpenChange, standaloneHandoffId, standaloneUrl],
|
|
1152
|
+
);
|
|
1153
|
+
|
|
1154
|
+
if (!open || typeof document === "undefined") return null;
|
|
1155
|
+
|
|
1156
|
+
return createPortal(
|
|
1157
|
+
<div
|
|
1158
|
+
className="fixed inset-0 z-[280] flex items-center justify-center bg-black/50 p-3"
|
|
1159
|
+
role="dialog"
|
|
1160
|
+
aria-modal="true"
|
|
1161
|
+
aria-labelledby="composer-assets-picker-title"
|
|
1162
|
+
onMouseDown={(event) => {
|
|
1163
|
+
if (event.target === event.currentTarget) onOpenChange(false);
|
|
1164
|
+
}}
|
|
1165
|
+
>
|
|
1166
|
+
<div className="flex h-[min(86vh,760px)] w-[min(96vw,1040px)] flex-col overflow-hidden rounded-xl border border-border bg-background shadow-2xl">
|
|
1167
|
+
<div className="flex h-12 shrink-0 items-center justify-between border-b border-border px-4">
|
|
1168
|
+
<div
|
|
1169
|
+
id="composer-assets-picker-title"
|
|
1170
|
+
className="text-sm font-medium text-foreground"
|
|
1171
|
+
>
|
|
1172
|
+
{t("agentChat.composer.assets.generateImage", {
|
|
1173
|
+
defaultValue: "Generate image",
|
|
1174
|
+
})}
|
|
1175
|
+
</div>
|
|
1176
|
+
<button
|
|
1177
|
+
type="button"
|
|
1178
|
+
onClick={() => onOpenChange(false)}
|
|
1179
|
+
className="flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground"
|
|
1180
|
+
aria-label={t("agentChat.composer.assets.closePicker", {
|
|
1181
|
+
defaultValue: "Close image picker",
|
|
1182
|
+
})}
|
|
1183
|
+
>
|
|
1184
|
+
<IconX className="h-4 w-4" />
|
|
1185
|
+
</button>
|
|
1186
|
+
</div>
|
|
1187
|
+
{externalPicker ? (
|
|
1188
|
+
<div className="flex min-h-0 flex-1 flex-col items-center justify-center gap-3 p-8 text-center">
|
|
1189
|
+
<div className="max-w-md text-sm text-muted-foreground">
|
|
1190
|
+
{t("agentChat.composer.assets.openSecurely", {
|
|
1191
|
+
defaultValue:
|
|
1192
|
+
"Open Assets in a new tab to sign in and choose an image securely.",
|
|
1193
|
+
})}
|
|
1194
|
+
</div>
|
|
1195
|
+
<a
|
|
1196
|
+
href={standaloneUrl}
|
|
1197
|
+
target="_blank"
|
|
1198
|
+
onClick={openStandalonePicker}
|
|
1199
|
+
className="inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground hover:bg-primary/90"
|
|
1200
|
+
>
|
|
1201
|
+
{t("agentChat.composer.assets.openPicker", {
|
|
1202
|
+
defaultValue: "Open Assets image picker",
|
|
1203
|
+
})}
|
|
1204
|
+
</a>
|
|
1205
|
+
</div>
|
|
1206
|
+
) : targetOrigin ? (
|
|
1207
|
+
<div className="relative min-h-0 flex-1 overflow-hidden bg-background">
|
|
1208
|
+
{!pickerReady && <AssetsPickerLoadingSkeleton />}
|
|
1209
|
+
<iframe
|
|
1210
|
+
ref={iframeRef}
|
|
1211
|
+
src={iframeUrl}
|
|
1212
|
+
title={t("agentChat.composer.assets.pickerTitle", {
|
|
1213
|
+
defaultValue: "Assets image picker",
|
|
1214
|
+
})}
|
|
1215
|
+
className={cn(
|
|
1216
|
+
"absolute inset-0 h-full w-full border-0 bg-background transition-opacity duration-150",
|
|
1217
|
+
pickerReady ? "opacity-100" : "pointer-events-none opacity-0",
|
|
1218
|
+
)}
|
|
1219
|
+
sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-downloads"
|
|
1220
|
+
allow="clipboard-read; clipboard-write; microphone; fullscreen"
|
|
1221
|
+
referrerPolicy="strict-origin-when-cross-origin"
|
|
1222
|
+
onLoad={() => {
|
|
1223
|
+
configurePicker();
|
|
1224
|
+
setPickerReady(true);
|
|
1225
|
+
}}
|
|
1226
|
+
/>
|
|
1227
|
+
</div>
|
|
1228
|
+
) : (
|
|
1229
|
+
<div className="flex min-h-0 flex-1 items-center justify-center p-8 text-center text-sm text-muted-foreground">
|
|
1230
|
+
{t("agentChat.composer.assets.invalidUrl", {
|
|
1231
|
+
defaultValue: "The configured image picker URL is not valid.",
|
|
1232
|
+
})}
|
|
1233
|
+
</div>
|
|
1234
|
+
)}
|
|
1235
|
+
</div>
|
|
1236
|
+
</div>,
|
|
1237
|
+
document.body,
|
|
1238
|
+
);
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
function AssetsPickerLoadingSkeleton() {
|
|
1242
|
+
const t = useComposerRuntimeAdapters().translate!;
|
|
1243
|
+
return (
|
|
1244
|
+
<div
|
|
1245
|
+
className="absolute inset-0 flex flex-col gap-5 p-5"
|
|
1246
|
+
role="status"
|
|
1247
|
+
aria-label={t("agentChat.composer.assets.loadingPicker", {
|
|
1248
|
+
defaultValue: "Loading Assets picker",
|
|
1249
|
+
})}
|
|
1250
|
+
>
|
|
1251
|
+
<div className="flex items-center gap-3">
|
|
1252
|
+
<div className="h-9 flex-1 animate-pulse rounded-md bg-muted" />
|
|
1253
|
+
<div className="h-9 w-24 animate-pulse rounded-md bg-muted" />
|
|
1254
|
+
</div>
|
|
1255
|
+
<div className="grid min-h-0 flex-1 grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4">
|
|
1256
|
+
{Array.from({ length: 8 }).map((_, index) => (
|
|
1257
|
+
<div key={index} className="flex min-w-0 flex-col gap-2">
|
|
1258
|
+
<div className="aspect-square w-full animate-pulse rounded-lg bg-muted" />
|
|
1259
|
+
<div className="h-3 w-3/4 animate-pulse rounded bg-muted" />
|
|
1260
|
+
<div className="h-3 w-1/2 animate-pulse rounded bg-muted" />
|
|
1261
|
+
</div>
|
|
1262
|
+
))}
|
|
1263
|
+
</div>
|
|
1264
|
+
</div>
|
|
1265
|
+
);
|
|
1266
|
+
}
|