@assistant-ui/react 0.5.100 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/api/AssistantRuntime.d.ts +2 -52
- package/dist/api/AssistantRuntime.d.ts.map +1 -1
- package/dist/api/AssistantRuntime.js +0 -8
- package/dist/api/AssistantRuntime.js.map +1 -1
- package/dist/api/AssistantRuntime.mjs +0 -8
- package/dist/api/AssistantRuntime.mjs.map +1 -1
- package/dist/api/AttachmentRuntime.d.ts +0 -12
- package/dist/api/AttachmentRuntime.d.ts.map +1 -1
- package/dist/api/AttachmentRuntime.js.map +1 -1
- package/dist/api/AttachmentRuntime.mjs.map +1 -1
- package/dist/api/ComposerRuntime.d.ts +5 -121
- package/dist/api/ComposerRuntime.d.ts.map +1 -1
- package/dist/api/ComposerRuntime.js +4 -84
- package/dist/api/ComposerRuntime.js.map +1 -1
- package/dist/api/ComposerRuntime.mjs +4 -84
- package/dist/api/ComposerRuntime.mjs.map +1 -1
- package/dist/api/ContentPartRuntime.d.ts +0 -4
- package/dist/api/ContentPartRuntime.d.ts.map +1 -1
- package/dist/api/ContentPartRuntime.js.map +1 -1
- package/dist/api/ContentPartRuntime.mjs.map +1 -1
- package/dist/api/MessageRuntime.d.ts +1 -12
- package/dist/api/MessageRuntime.d.ts.map +1 -1
- package/dist/api/MessageRuntime.js +9 -5
- package/dist/api/MessageRuntime.js.map +1 -1
- package/dist/api/MessageRuntime.mjs +8 -4
- package/dist/api/MessageRuntime.mjs.map +1 -1
- package/dist/api/ThreadListItemRuntime.d.ts +9 -5
- package/dist/api/ThreadListItemRuntime.d.ts.map +1 -1
- package/dist/api/ThreadListItemRuntime.js +10 -6
- package/dist/api/ThreadListItemRuntime.js.map +1 -1
- package/dist/api/ThreadListItemRuntime.mjs +10 -6
- package/dist/api/ThreadListItemRuntime.mjs.map +1 -1
- package/dist/api/ThreadListRuntime.d.ts +5 -23
- package/dist/api/ThreadListRuntime.d.ts.map +1 -1
- package/dist/api/ThreadListRuntime.js +23 -26
- package/dist/api/ThreadListRuntime.js.map +1 -1
- package/dist/api/ThreadListRuntime.mjs +23 -26
- package/dist/api/ThreadListRuntime.mjs.map +1 -1
- package/dist/api/ThreadRuntime.d.ts +17 -164
- package/dist/api/ThreadRuntime.d.ts.map +1 -1
- package/dist/api/ThreadRuntime.js +2 -94
- package/dist/api/ThreadRuntime.js.map +1 -1
- package/dist/api/ThreadRuntime.mjs +2 -94
- package/dist/api/ThreadRuntime.mjs.map +1 -1
- package/dist/context/providers/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/context/providers/AssistantRuntimeProvider.js +0 -1
- package/dist/context/providers/AssistantRuntimeProvider.js.map +1 -1
- package/dist/context/providers/AssistantRuntimeProvider.mjs +0 -1
- package/dist/context/providers/AssistantRuntimeProvider.mjs.map +1 -1
- package/dist/context/providers/TextContentPartProvider.d.ts.map +1 -1
- package/dist/context/providers/TextContentPartProvider.js +0 -2
- package/dist/context/providers/TextContentPartProvider.js.map +1 -1
- package/dist/context/providers/TextContentPartProvider.mjs +0 -2
- package/dist/context/providers/TextContentPartProvider.mjs.map +1 -1
- package/dist/context/providers/ThreadListItemRuntimeProvider.d.ts +1 -4
- package/dist/context/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
- package/dist/context/providers/ThreadRuntimeProvider.d.ts.map +1 -1
- package/dist/context/providers/ThreadRuntimeProvider.js +1 -13
- package/dist/context/providers/ThreadRuntimeProvider.js.map +1 -1
- package/dist/context/providers/ThreadRuntimeProvider.mjs +1 -13
- package/dist/context/providers/ThreadRuntimeProvider.mjs.map +1 -1
- package/dist/context/react/AssistantContext.d.ts +16 -88
- package/dist/context/react/AssistantContext.d.ts.map +1 -1
- package/dist/context/react/AssistantContext.js +0 -15
- package/dist/context/react/AssistantContext.js.map +1 -1
- package/dist/context/react/AssistantContext.mjs +0 -11
- package/dist/context/react/AssistantContext.mjs.map +1 -1
- package/dist/context/react/AttachmentContext.d.ts +16 -32
- package/dist/context/react/AttachmentContext.d.ts.map +1 -1
- package/dist/context/react/ComposerContext.d.ts +0 -5
- package/dist/context/react/ComposerContext.d.ts.map +1 -1
- package/dist/context/react/ComposerContext.js +3 -5
- package/dist/context/react/ComposerContext.js.map +1 -1
- package/dist/context/react/ComposerContext.mjs +2 -3
- package/dist/context/react/ComposerContext.mjs.map +1 -1
- package/dist/context/react/ContentPartContext.d.ts +0 -5
- package/dist/context/react/ContentPartContext.d.ts.map +1 -1
- package/dist/context/react/ContentPartContext.js +3 -5
- package/dist/context/react/ContentPartContext.js.map +1 -1
- package/dist/context/react/ContentPartContext.mjs +2 -3
- package/dist/context/react/ContentPartContext.mjs.map +1 -1
- package/dist/context/react/MessageContext.d.ts +0 -10
- package/dist/context/react/MessageContext.d.ts.map +1 -1
- package/dist/context/react/MessageContext.js +2 -6
- package/dist/context/react/MessageContext.js.map +1 -1
- package/dist/context/react/MessageContext.mjs +2 -4
- package/dist/context/react/MessageContext.mjs.map +1 -1
- package/dist/context/react/ThreadContext.d.ts +25 -1635
- package/dist/context/react/ThreadContext.d.ts.map +1 -1
- package/dist/context/react/ThreadContext.js +4 -30
- package/dist/context/react/ThreadContext.js.map +1 -1
- package/dist/context/react/ThreadContext.mjs +4 -22
- package/dist/context/react/ThreadContext.mjs.map +1 -1
- package/dist/context/react/ThreadListItemContext.d.ts +6 -24
- package/dist/context/react/ThreadListItemContext.d.ts.map +1 -1
- package/dist/context/react/index.d.ts +5 -101
- package/dist/context/react/index.d.ts.map +1 -1
- package/dist/context/react/index.js +0 -38
- package/dist/context/react/index.js.map +1 -1
- package/dist/context/react/index.mjs +5 -49
- package/dist/context/react/index.mjs.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.ts +1 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +3 -0
- package/dist/internal.js.map +1 -1
- package/dist/internal.mjs +2 -0
- package/dist/internal.mjs.map +1 -1
- package/dist/model-config/useAssistantToolUI.d.ts.map +1 -1
- package/dist/model-config/useAssistantToolUI.js.map +1 -1
- package/dist/model-config/useAssistantToolUI.mjs.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartDisplay.d.ts +0 -3
- package/dist/primitive-hooks/contentPart/useContentPartDisplay.d.ts.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartDisplay.js.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartDisplay.mjs.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartImage.d.ts +0 -3
- package/dist/primitive-hooks/contentPart/useContentPartImage.d.ts.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartImage.js.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartImage.mjs.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartText.d.ts +0 -3
- package/dist/primitive-hooks/contentPart/useContentPartText.d.ts.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartText.js.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartText.mjs.map +1 -1
- package/dist/primitive-hooks/index.d.ts +0 -5
- package/dist/primitive-hooks/index.d.ts.map +1 -1
- package/dist/primitive-hooks/index.js +1 -11
- package/dist/primitive-hooks/index.js.map +1 -1
- package/dist/primitive-hooks/index.mjs +0 -5
- package/dist/primitive-hooks/index.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.d.ts +1 -5
- package/dist/primitives/actionBar/ActionBarCopy.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.d.ts +0 -4
- package/dist/primitives/actionBar/ActionBarEdit.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts +0 -4
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts +0 -4
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.d.ts +0 -4
- package/dist/primitives/actionBar/ActionBarReload.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarRoot.d.ts +0 -4
- package/dist/primitives/actionBar/ActionBarRoot.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarRoot.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarRoot.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.d.ts +0 -4
- package/dist/primitives/actionBar/ActionBarSpeak.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts +0 -4
- package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarStopSpeaking.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarStopSpeaking.mjs.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalContent.d.ts +0 -4
- package/dist/primitives/assistantModal/AssistantModalContent.d.ts.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalContent.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalContent.mjs.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalRoot.d.ts +0 -4
- package/dist/primitives/assistantModal/AssistantModalRoot.d.ts.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalRoot.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalRoot.mjs.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalTrigger.d.ts +0 -4
- package/dist/primitives/assistantModal/AssistantModalTrigger.d.ts.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalTrigger.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalTrigger.mjs.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerCount.d.ts +0 -4
- package/dist/primitives/branchPicker/BranchPickerCount.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerCount.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerCount.mjs.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.d.ts +0 -4
- package/dist/primitives/branchPicker/BranchPickerNext.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.mjs.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNumber.d.ts +0 -4
- package/dist/primitives/branchPicker/BranchPickerNumber.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNumber.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNumber.mjs.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts +0 -4
- package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.mjs.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerRoot.d.ts +0 -4
- package/dist/primitives/branchPicker/BranchPickerRoot.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerRoot.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerRoot.mjs.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.d.ts +1 -5
- package/dist/primitives/composer/ComposerAddAttachment.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.js +2 -2
- package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.mjs +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.mjs.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.d.ts +0 -4
- package/dist/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.js.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.mjs.map +1 -1
- package/dist/primitives/composer/ComposerCancel.d.ts +0 -4
- package/dist/primitives/composer/ComposerCancel.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerCancel.js.map +1 -1
- package/dist/primitives/composer/ComposerCancel.mjs.map +1 -1
- package/dist/primitives/composer/ComposerIf.d.ts +0 -4
- package/dist/primitives/composer/ComposerIf.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerIf.js.map +1 -1
- package/dist/primitives/composer/ComposerIf.mjs.map +1 -1
- package/dist/primitives/composer/ComposerInput.d.ts +0 -4
- package/dist/primitives/composer/ComposerInput.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerInput.js.map +1 -1
- package/dist/primitives/composer/ComposerInput.mjs.map +1 -1
- package/dist/primitives/composer/ComposerRoot.d.ts +0 -1
- package/dist/primitives/composer/ComposerRoot.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerRoot.js +2 -2
- package/dist/primitives/composer/ComposerRoot.js.map +1 -1
- package/dist/primitives/composer/ComposerRoot.mjs +1 -1
- package/dist/primitives/composer/ComposerRoot.mjs.map +1 -1
- package/dist/primitives/composer/ComposerSend.d.ts +1 -5
- package/dist/primitives/composer/ComposerSend.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerSend.js +2 -2
- package/dist/primitives/composer/ComposerSend.js.map +1 -1
- package/dist/primitives/composer/ComposerSend.mjs +1 -1
- package/dist/primitives/composer/ComposerSend.mjs.map +1 -1
- package/dist/primitives/contentPart/ContentPartDisplay.d.ts +0 -4
- package/dist/primitives/contentPart/ContentPartDisplay.d.ts.map +1 -1
- package/dist/primitives/contentPart/ContentPartDisplay.js.map +1 -1
- package/dist/primitives/contentPart/ContentPartDisplay.mjs.map +1 -1
- package/dist/primitives/contentPart/ContentPartImage.d.ts +0 -4
- package/dist/primitives/contentPart/ContentPartImage.d.ts.map +1 -1
- package/dist/primitives/contentPart/ContentPartImage.js.map +1 -1
- package/dist/primitives/contentPart/ContentPartImage.mjs.map +1 -1
- package/dist/primitives/contentPart/ContentPartInProgress.d.ts +0 -4
- package/dist/primitives/contentPart/ContentPartInProgress.d.ts.map +1 -1
- package/dist/primitives/contentPart/ContentPartInProgress.js.map +1 -1
- package/dist/primitives/contentPart/ContentPartInProgress.mjs.map +1 -1
- package/dist/primitives/contentPart/ContentPartText.d.ts +0 -4
- package/dist/primitives/contentPart/ContentPartText.d.ts.map +1 -1
- package/dist/primitives/contentPart/ContentPartText.js.map +1 -1
- package/dist/primitives/contentPart/ContentPartText.mjs.map +1 -1
- package/dist/primitives/index.d.ts +0 -7
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/index.mjs.map +1 -1
- package/dist/primitives/message/MessageAttachments.d.ts +0 -4
- package/dist/primitives/message/MessageAttachments.d.ts.map +1 -1
- package/dist/primitives/message/MessageAttachments.js +2 -4
- package/dist/primitives/message/MessageAttachments.js.map +1 -1
- package/dist/primitives/message/MessageAttachments.mjs +2 -4
- package/dist/primitives/message/MessageAttachments.mjs.map +1 -1
- package/dist/primitives/message/MessageContent.d.ts +0 -4
- package/dist/primitives/message/MessageContent.d.ts.map +1 -1
- package/dist/primitives/message/MessageContent.js +6 -6
- package/dist/primitives/message/MessageContent.js.map +1 -1
- package/dist/primitives/message/MessageContent.mjs +7 -7
- package/dist/primitives/message/MessageContent.mjs.map +1 -1
- package/dist/primitives/message/MessageIf.d.ts +0 -4
- package/dist/primitives/message/MessageIf.d.ts.map +1 -1
- package/dist/primitives/message/MessageIf.js.map +1 -1
- package/dist/primitives/message/MessageIf.mjs.map +1 -1
- package/dist/primitives/message/MessageRoot.d.ts +0 -4
- package/dist/primitives/message/MessageRoot.d.ts.map +1 -1
- package/dist/primitives/message/MessageRoot.js.map +1 -1
- package/dist/primitives/message/MessageRoot.mjs.map +1 -1
- package/dist/primitives/message/index.d.ts +0 -1
- package/dist/primitives/message/index.d.ts.map +1 -1
- package/dist/primitives/message/index.js +0 -3
- package/dist/primitives/message/index.js.map +1 -1
- package/dist/primitives/message/index.mjs +0 -2
- package/dist/primitives/message/index.mjs.map +1 -1
- package/dist/primitives/thread/ThreadEmpty.d.ts +0 -4
- package/dist/primitives/thread/ThreadEmpty.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadEmpty.js +2 -2
- package/dist/primitives/thread/ThreadEmpty.js.map +1 -1
- package/dist/primitives/thread/ThreadEmpty.mjs +1 -1
- package/dist/primitives/thread/ThreadEmpty.mjs.map +1 -1
- package/dist/primitives/thread/ThreadIf.d.ts +0 -4
- package/dist/primitives/thread/ThreadIf.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadIf.js.map +1 -1
- package/dist/primitives/thread/ThreadIf.mjs.map +1 -1
- package/dist/primitives/thread/ThreadMessages.d.ts +0 -4
- package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/primitives/thread/ThreadMessages.mjs.map +1 -1
- package/dist/primitives/thread/ThreadRoot.d.ts +0 -4
- package/dist/primitives/thread/ThreadRoot.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadRoot.js.map +1 -1
- package/dist/primitives/thread/ThreadRoot.mjs.map +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.d.ts +0 -4
- package/dist/primitives/thread/ThreadScrollToBottom.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.js.map +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.mjs.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.d.ts +0 -4
- package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.js.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.mjs.map +1 -1
- package/dist/primitives/thread/ThreadViewport.d.ts +0 -4
- package/dist/primitives/thread/ThreadViewport.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadViewport.js.map +1 -1
- package/dist/primitives/thread/ThreadViewport.mjs.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.js +3 -2
- package/dist/primitives/threadListItem/ThreadListItemArchive.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.mjs +3 -2
- package/dist/primitives/threadListItem/ThreadListItemArchive.mjs.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts +14 -0
- package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemRoot.js +47 -0
- package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemRoot.mjs +23 -0
- package/dist/primitives/threadListItem/ThreadListItemRoot.mjs.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemTitle.d.ts +8 -0
- package/dist/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -0
- package/dist/primitives/{message/MessageInProgress.js → threadListItem/ThreadListItemTitle.js} +13 -10
- package/dist/primitives/threadListItem/ThreadListItemTitle.js.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemTitle.mjs +14 -0
- package/dist/primitives/threadListItem/ThreadListItemTitle.mjs.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts +13 -0
- package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts.map +1 -0
- package/dist/{runtimes/core/subscribeToMainThread.js → primitives/threadListItem/ThreadListItemTrigger.js} +17 -22
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemTrigger.mjs +21 -0
- package/dist/primitives/threadListItem/ThreadListItemTrigger.mjs.map +1 -0
- package/dist/primitives/threadListItem/index.d.ts +3 -0
- package/dist/primitives/threadListItem/index.d.ts.map +1 -1
- package/dist/primitives/threadListItem/index.js +9 -0
- package/dist/primitives/threadListItem/index.js.map +1 -1
- package/dist/primitives/threadListItem/index.mjs +6 -0
- package/dist/primitives/threadListItem/index.mjs.map +1 -1
- package/dist/runtimes/attachment/AttachmentAdapter.d.ts +3 -7
- package/dist/runtimes/attachment/AttachmentAdapter.d.ts.map +1 -1
- package/dist/runtimes/attachment/AttachmentAdapter.js.map +1 -1
- package/dist/runtimes/attachment/CompositeAttachmentAdapter.d.ts +2 -6
- package/dist/runtimes/attachment/CompositeAttachmentAdapter.d.ts.map +1 -1
- package/dist/runtimes/attachment/CompositeAttachmentAdapter.js +1 -2
- package/dist/runtimes/attachment/CompositeAttachmentAdapter.js.map +1 -1
- package/dist/runtimes/attachment/CompositeAttachmentAdapter.mjs +1 -2
- package/dist/runtimes/attachment/CompositeAttachmentAdapter.mjs.map +1 -1
- package/dist/runtimes/composer/BaseComposerRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/composer/BaseComposerRuntimeCore.js +0 -6
- package/dist/runtimes/composer/BaseComposerRuntimeCore.js.map +1 -1
- package/dist/runtimes/composer/BaseComposerRuntimeCore.mjs +0 -6
- package/dist/runtimes/composer/BaseComposerRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/core/BaseThreadRuntimeCore.d.ts +5 -4
- package/dist/runtimes/core/BaseThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/core/BaseThreadRuntimeCore.js +8 -4
- package/dist/runtimes/core/BaseThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/core/BaseThreadRuntimeCore.mjs +8 -4
- package/dist/runtimes/core/BaseThreadRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/core/ComposerRuntimeCore.d.ts +0 -3
- package/dist/runtimes/core/ComposerRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/core/ComposerRuntimeCore.js.map +1 -1
- package/dist/runtimes/core/ThreadListRuntimeCore.d.ts +7 -10
- package/dist/runtimes/core/ThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/core/ThreadListRuntimeCore.js.map +1 -1
- package/dist/runtimes/core/ThreadRuntimeCore.d.ts +14 -1
- package/dist/runtimes/core/ThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/core/ThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/core/index.d.ts +1 -2
- package/dist/runtimes/core/index.d.ts.map +1 -1
- package/dist/runtimes/core/index.js +0 -12
- package/dist/runtimes/core/index.js.map +1 -1
- package/dist/runtimes/core/index.mjs +0 -5
- package/dist/runtimes/core/index.mjs.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.d.ts +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.d.ts.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.js.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.mjs.map +1 -1
- package/dist/runtimes/edge/createEdgeRuntimeAPI.d.ts +0 -4
- package/dist/runtimes/edge/createEdgeRuntimeAPI.d.ts.map +1 -1
- package/dist/runtimes/edge/createEdgeRuntimeAPI.js +0 -2
- package/dist/runtimes/edge/createEdgeRuntimeAPI.js.map +1 -1
- package/dist/runtimes/edge/createEdgeRuntimeAPI.mjs +0 -2
- package/dist/runtimes/edge/createEdgeRuntimeAPI.mjs.map +1 -1
- package/dist/runtimes/edge/streams/runResultStream.js +0 -2
- package/dist/runtimes/edge/streams/runResultStream.js.map +1 -1
- package/dist/runtimes/edge/streams/runResultStream.mjs +0 -2
- package/dist/runtimes/edge/streams/runResultStream.mjs.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreAdapter.d.ts +3 -16
- package/dist/runtimes/external-store/ExternalStoreAdapter.d.ts.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreAdapter.js.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreRuntimeCore.js +0 -3
- package/dist/runtimes/external-store/ExternalStoreRuntimeCore.js.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreRuntimeCore.mjs +0 -3
- package/dist/runtimes/external-store/ExternalStoreRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.d.ts +9 -11
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.js +29 -7
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.js.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.mjs +29 -7
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.d.ts +0 -1
- package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.js +4 -3
- package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.mjs +4 -3
- package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.d.ts.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.js +2 -0
- package/dist/runtimes/external-store/ThreadMessageLike.js.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.mjs +2 -0
- package/dist/runtimes/external-store/ThreadMessageLike.mjs.map +1 -1
- package/dist/runtimes/local/ChatModelAdapter.d.ts +0 -8
- package/dist/runtimes/local/ChatModelAdapter.d.ts.map +1 -1
- package/dist/runtimes/local/ChatModelAdapter.js.map +1 -1
- package/dist/runtimes/local/LocalRuntimeOptions.d.ts +1 -6
- package/dist/runtimes/local/LocalRuntimeOptions.d.ts.map +1 -1
- package/dist/runtimes/local/LocalRuntimeOptions.js +1 -2
- package/dist/runtimes/local/LocalRuntimeOptions.js.map +1 -1
- package/dist/runtimes/local/LocalRuntimeOptions.mjs +1 -2
- package/dist/runtimes/local/LocalRuntimeOptions.mjs.map +1 -1
- package/dist/runtimes/local/LocalThreadListRuntimeCore.d.ts +16 -20
- package/dist/runtimes/local/LocalThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/local/LocalThreadListRuntimeCore.js +112 -72
- package/dist/runtimes/local/LocalThreadListRuntimeCore.js.map +1 -1
- package/dist/runtimes/local/LocalThreadListRuntimeCore.mjs +112 -72
- package/dist/runtimes/local/LocalThreadListRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.d.ts +19 -0
- package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.d.ts.map +1 -0
- package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.js +87 -0
- package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.js.map +1 -0
- package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.mjs +62 -0
- package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.mjs.map +1 -0
- package/dist/runtimes/local/LocalThreadRuntimeCore.d.ts +1 -1
- package/dist/runtimes/local/LocalThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/local/LocalThreadRuntimeCore.js +15 -11
- package/dist/runtimes/local/LocalThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/local/LocalThreadRuntimeCore.mjs +15 -11
- package/dist/runtimes/local/LocalThreadRuntimeCore.mjs.map +1 -1
- package/dist/styles/index.css.map +1 -1
- package/dist/types/AssistantTypes.d.ts +1 -18
- package/dist/types/AssistantTypes.d.ts.map +1 -1
- package/dist/types/AssistantTypes.js.map +1 -1
- package/dist/types/AttachmentTypes.d.ts +1 -1
- package/dist/types/AttachmentTypes.d.ts.map +1 -1
- package/dist/types/AttachmentTypes.js.map +1 -1
- package/dist/types/ContentPartComponentTypes.d.ts +4 -28
- package/dist/types/ContentPartComponentTypes.d.ts.map +1 -1
- package/dist/types/ContentPartComponentTypes.js.map +1 -1
- package/dist/ui/assistant-message.d.ts +1 -10
- package/dist/ui/assistant-message.d.ts.map +1 -1
- package/dist/ui/assistant-message.js.map +1 -1
- package/dist/ui/assistant-message.mjs.map +1 -1
- package/dist/ui/composer.d.ts +1 -25
- package/dist/ui/composer.d.ts.map +1 -1
- package/dist/ui/composer.js.map +1 -1
- package/dist/ui/composer.mjs.map +1 -1
- package/dist/ui/index.d.ts +6 -14
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +0 -4
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +14 -24
- package/dist/ui/index.mjs.map +1 -1
- package/dist/ui/thread-welcome.d.ts +5 -17
- package/dist/ui/thread-welcome.d.ts.map +1 -1
- package/dist/ui/thread-welcome.js.map +1 -1
- package/dist/ui/thread-welcome.mjs.map +1 -1
- package/dist/ui/thread.d.ts +1 -19
- package/dist/ui/thread.d.ts.map +1 -1
- package/dist/ui/thread.js.map +1 -1
- package/dist/ui/thread.mjs.map +1 -1
- package/dist/ui/user-message.d.ts +1 -18
- package/dist/ui/user-message.d.ts.map +1 -1
- package/dist/ui/user-message.js.map +1 -1
- package/dist/ui/user-message.mjs.map +1 -1
- package/dist/utils/smooth/SmoothContext.js +2 -2
- package/dist/utils/smooth/SmoothContext.js.map +1 -1
- package/dist/utils/smooth/SmoothContext.mjs +3 -3
- package/dist/utils/smooth/SmoothContext.mjs.map +1 -1
- package/dist/utils/smooth/useSmooth.d.ts.map +1 -1
- package/dist/utils/smooth/useSmooth.js +0 -1
- package/dist/utils/smooth/useSmooth.js.map +1 -1
- package/dist/utils/smooth/useSmooth.mjs +0 -1
- package/dist/utils/smooth/useSmooth.mjs.map +1 -1
- package/package.json +5 -5
- package/src/api/AssistantRuntime.ts +1 -23
- package/src/api/AttachmentRuntime.ts +0 -12
- package/src/api/ComposerRuntime.ts +11 -207
- package/src/api/ContentPartRuntime.ts +0 -4
- package/src/api/MessageRuntime.ts +7 -11
- package/src/api/ThreadListItemRuntime.ts +16 -8
- package/src/api/ThreadListRuntime.ts +34 -53
- package/src/api/ThreadRuntime.ts +11 -203
- package/src/context/providers/AssistantRuntimeProvider.tsx +0 -1
- package/src/context/providers/TextContentPartProvider.tsx +0 -2
- package/src/context/providers/ThreadRuntimeProvider.tsx +1 -17
- package/src/context/react/AssistantContext.ts +0 -25
- package/src/context/react/ComposerContext.ts +1 -1
- package/src/context/react/ContentPartContext.ts +1 -1
- package/src/context/react/MessageContext.ts +2 -2
- package/src/context/react/ThreadContext.ts +5 -42
- package/src/context/react/index.ts +2 -125
- package/src/index.ts +0 -1
- package/src/internal.ts +1 -0
- package/src/model-config/useAssistantToolUI.tsx +0 -1
- package/src/primitive-hooks/contentPart/useContentPartDisplay.tsx +1 -1
- package/src/primitive-hooks/contentPart/useContentPartImage.tsx +1 -2
- package/src/primitive-hooks/contentPart/useContentPartText.tsx +1 -1
- package/src/primitive-hooks/index.ts +0 -5
- package/src/primitives/actionBar/ActionBarCopy.tsx +0 -5
- package/src/primitives/actionBar/ActionBarEdit.tsx +0 -5
- package/src/primitives/actionBar/ActionBarFeedbackNegative.tsx +0 -6
- package/src/primitives/actionBar/ActionBarFeedbackPositive.tsx +0 -6
- package/src/primitives/actionBar/ActionBarReload.tsx +0 -5
- package/src/primitives/actionBar/ActionBarRoot.tsx +0 -5
- package/src/primitives/actionBar/ActionBarSpeak.tsx +0 -5
- package/src/primitives/actionBar/ActionBarStopSpeaking.tsx +0 -6
- package/src/primitives/assistantModal/AssistantModalContent.tsx +1 -7
- package/src/primitives/assistantModal/AssistantModalRoot.tsx +0 -6
- package/src/primitives/assistantModal/AssistantModalTrigger.tsx +0 -6
- package/src/primitives/branchPicker/BranchPickerCount.tsx +0 -5
- package/src/primitives/branchPicker/BranchPickerNext.tsx +0 -6
- package/src/primitives/branchPicker/BranchPickerNumber.tsx +0 -5
- package/src/primitives/branchPicker/BranchPickerPrevious.tsx +1 -6
- package/src/primitives/branchPicker/BranchPickerRoot.tsx +0 -5
- package/src/primitives/composer/ComposerAddAttachment.tsx +2 -7
- package/src/primitives/composer/ComposerAttachments.tsx +0 -6
- package/src/primitives/composer/ComposerCancel.tsx +0 -5
- package/src/primitives/composer/ComposerIf.tsx +0 -5
- package/src/primitives/composer/ComposerInput.tsx +0 -5
- package/src/primitives/composer/ComposerRoot.tsx +1 -3
- package/src/primitives/composer/ComposerSend.tsx +2 -7
- package/src/primitives/contentPart/ContentPartDisplay.tsx +0 -6
- package/src/primitives/contentPart/ContentPartImage.tsx +0 -5
- package/src/primitives/contentPart/ContentPartInProgress.tsx +0 -6
- package/src/primitives/contentPart/ContentPartText.tsx +0 -5
- package/src/primitives/index.ts +0 -8
- package/src/primitives/message/MessageAttachments.tsx +2 -10
- package/src/primitives/message/MessageContent.tsx +7 -15
- package/src/primitives/message/MessageIf.tsx +0 -5
- package/src/primitives/message/MessageRoot.tsx +0 -5
- package/src/primitives/message/index.ts +0 -1
- package/src/primitives/thread/ThreadEmpty.tsx +1 -6
- package/src/primitives/thread/ThreadIf.tsx +0 -5
- package/src/primitives/thread/ThreadMessages.tsx +0 -5
- package/src/primitives/thread/ThreadRoot.tsx +0 -5
- package/src/primitives/thread/ThreadScrollToBottom.tsx +0 -6
- package/src/primitives/thread/ThreadSuggestion.tsx +0 -5
- package/src/primitives/thread/ThreadViewport.tsx +0 -5
- package/src/primitives/threadListItem/ThreadListItemArchive.ts +3 -2
- package/src/primitives/threadListItem/ThreadListItemRoot.tsx +29 -0
- package/src/primitives/threadListItem/ThreadListItemTitle.tsx +19 -0
- package/src/primitives/threadListItem/ThreadListItemTrigger.ts +25 -0
- package/src/primitives/threadListItem/index.ts +4 -1
- package/src/runtimes/attachment/AttachmentAdapter.ts +2 -12
- package/src/runtimes/attachment/CompositeAttachmentAdapter.ts +1 -1
- package/src/runtimes/composer/BaseComposerRuntimeCore.tsx +0 -8
- package/src/runtimes/core/BaseThreadRuntimeCore.tsx +11 -5
- package/src/runtimes/core/ComposerRuntimeCore.tsx +0 -3
- package/src/runtimes/core/ThreadListRuntimeCore.tsx +7 -11
- package/src/runtimes/core/ThreadRuntimeCore.tsx +18 -1
- package/src/runtimes/core/index.ts +1 -2
- package/src/runtimes/edge/converters/toCoreMessages.ts +1 -1
- package/src/runtimes/edge/createEdgeRuntimeAPI.ts +0 -6
- package/src/runtimes/edge/streams/runResultStream.ts +0 -2
- package/src/runtimes/external-store/ExternalStoreAdapter.tsx +3 -17
- package/src/runtimes/external-store/ExternalStoreRuntimeCore.tsx +0 -3
- package/src/runtimes/external-store/ExternalStoreThreadListRuntimeCore.tsx +39 -7
- package/src/runtimes/external-store/ExternalStoreThreadRuntimeCore.tsx +4 -3
- package/src/runtimes/external-store/ThreadMessageLike.tsx +4 -3
- package/src/runtimes/local/ChatModelAdapter.tsx +0 -9
- package/src/runtimes/local/LocalRuntimeOptions.tsx +1 -7
- package/src/runtimes/local/LocalThreadListRuntimeCore.tsx +140 -96
- package/src/runtimes/local/LocalThreadMetadataRuntimeCore.tsx +79 -0
- package/src/runtimes/local/LocalThreadRuntimeCore.tsx +16 -11
- package/src/types/AssistantTypes.ts +1 -20
- package/src/types/AttachmentTypes.ts +1 -2
- package/src/types/ContentPartComponentTypes.tsx +4 -31
- package/src/ui/assistant-message.tsx +0 -5
- package/src/ui/composer.tsx +0 -5
- package/src/ui/index.ts +5 -23
- package/src/ui/thread-welcome.tsx +6 -9
- package/src/ui/thread.tsx +0 -5
- package/src/ui/user-message.tsx +2 -12
- package/src/utils/smooth/SmoothContext.tsx +3 -3
- package/src/utils/smooth/useSmooth.tsx +0 -1
- package/dist/hooks/index.d.ts +0 -3
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js +0 -34
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/index.mjs +0 -8
- package/dist/hooks/index.mjs.map +0 -1
- package/dist/hooks/useAppendMessage.d.ts +0 -6
- package/dist/hooks/useAppendMessage.d.ts.map +0 -1
- package/dist/hooks/useAppendMessage.js +0 -42
- package/dist/hooks/useAppendMessage.js.map +0 -1
- package/dist/hooks/useAppendMessage.mjs +0 -17
- package/dist/hooks/useAppendMessage.mjs.map +0 -1
- package/dist/hooks/useSwitchToNewThread.d.ts +0 -5
- package/dist/hooks/useSwitchToNewThread.d.ts.map +0 -1
- package/dist/hooks/useSwitchToNewThread.js +0 -39
- package/dist/hooks/useSwitchToNewThread.js.map +0 -1
- package/dist/hooks/useSwitchToNewThread.mjs +0 -14
- package/dist/hooks/useSwitchToNewThread.mjs.map +0 -1
- package/dist/primitive-hooks/actionBar/index.d.ts +0 -34
- package/dist/primitive-hooks/actionBar/index.d.ts.map +0 -1
- package/dist/primitive-hooks/actionBar/index.js +0 -49
- package/dist/primitive-hooks/actionBar/index.js.map +0 -1
- package/dist/primitive-hooks/actionBar/index.mjs +0 -20
- package/dist/primitive-hooks/actionBar/index.mjs.map +0 -1
- package/dist/primitive-hooks/branchPicker/index.d.ts +0 -17
- package/dist/primitive-hooks/branchPicker/index.d.ts.map +0 -1
- package/dist/primitive-hooks/branchPicker/index.js +0 -40
- package/dist/primitive-hooks/branchPicker/index.js.map +0 -1
- package/dist/primitive-hooks/branchPicker/index.mjs +0 -12
- package/dist/primitive-hooks/branchPicker/index.mjs.map +0 -1
- package/dist/primitive-hooks/composer/index.d.ts +0 -17
- package/dist/primitive-hooks/composer/index.d.ts.map +0 -1
- package/dist/primitive-hooks/composer/index.js +0 -40
- package/dist/primitive-hooks/composer/index.js.map +0 -1
- package/dist/primitive-hooks/composer/index.mjs +0 -12
- package/dist/primitive-hooks/composer/index.mjs.map +0 -1
- package/dist/primitive-hooks/message/index.d.ts +0 -5
- package/dist/primitive-hooks/message/index.d.ts.map +0 -1
- package/dist/primitive-hooks/message/index.js +0 -31
- package/dist/primitive-hooks/message/index.js.map +0 -1
- package/dist/primitive-hooks/message/index.mjs +0 -6
- package/dist/primitive-hooks/message/index.mjs.map +0 -1
- package/dist/primitive-hooks/thread/index.d.ts +0 -17
- package/dist/primitive-hooks/thread/index.d.ts.map +0 -1
- package/dist/primitive-hooks/thread/index.js +0 -40
- package/dist/primitive-hooks/thread/index.js.map +0 -1
- package/dist/primitive-hooks/thread/index.mjs +0 -12
- package/dist/primitive-hooks/thread/index.mjs.map +0 -1
- package/dist/primitives/actionBar/types.d.ts +0 -9
- package/dist/primitives/actionBar/types.d.ts.map +0 -1
- package/dist/primitives/actionBar/types.js +0 -19
- package/dist/primitives/actionBar/types.js.map +0 -1
- package/dist/primitives/actionBar/types.mjs +0 -1
- package/dist/primitives/actionBar/types.mjs.map +0 -1
- package/dist/primitives/assistantModal/types.d.ts +0 -4
- package/dist/primitives/assistantModal/types.d.ts.map +0 -1
- package/dist/primitives/assistantModal/types.js +0 -19
- package/dist/primitives/assistantModal/types.js.map +0 -1
- package/dist/primitives/assistantModal/types.mjs +0 -1
- package/dist/primitives/assistantModal/types.mjs.map +0 -1
- package/dist/primitives/attachment/types.d.ts +0 -1
- package/dist/primitives/attachment/types.d.ts.map +0 -1
- package/dist/primitives/attachment/types.js +0 -2
- package/dist/primitives/attachment/types.js.map +0 -1
- package/dist/primitives/attachment/types.mjs +0 -1
- package/dist/primitives/attachment/types.mjs.map +0 -1
- package/dist/primitives/branchPicker/types.d.ts +0 -6
- package/dist/primitives/branchPicker/types.d.ts.map +0 -1
- package/dist/primitives/branchPicker/types.js +0 -19
- package/dist/primitives/branchPicker/types.js.map +0 -1
- package/dist/primitives/branchPicker/types.mjs +0 -1
- package/dist/primitives/branchPicker/types.mjs.map +0 -1
- package/dist/primitives/composer/types.d.ts +0 -6
- package/dist/primitives/composer/types.d.ts.map +0 -1
- package/dist/primitives/composer/types.js +0 -19
- package/dist/primitives/composer/types.js.map +0 -1
- package/dist/primitives/composer/types.mjs +0 -1
- package/dist/primitives/composer/types.mjs.map +0 -1
- package/dist/primitives/contentPart/types.d.ts +0 -5
- package/dist/primitives/contentPart/types.d.ts.map +0 -1
- package/dist/primitives/contentPart/types.js +0 -19
- package/dist/primitives/contentPart/types.js.map +0 -1
- package/dist/primitives/contentPart/types.mjs +0 -1
- package/dist/primitives/contentPart/types.mjs.map +0 -1
- package/dist/primitives/message/MessageInProgress.d.ts +0 -13
- package/dist/primitives/message/MessageInProgress.d.ts.map +0 -1
- package/dist/primitives/message/MessageInProgress.js.map +0 -1
- package/dist/primitives/message/MessageInProgress.mjs +0 -11
- package/dist/primitives/message/MessageInProgress.mjs.map +0 -1
- package/dist/primitives/message/types.d.ts +0 -5
- package/dist/primitives/message/types.d.ts.map +0 -1
- package/dist/primitives/message/types.js +0 -19
- package/dist/primitives/message/types.js.map +0 -1
- package/dist/primitives/message/types.mjs +0 -1
- package/dist/primitives/message/types.mjs.map +0 -1
- package/dist/primitives/thread/types.d.ts +0 -8
- package/dist/primitives/thread/types.d.ts.map +0 -1
- package/dist/primitives/thread/types.js +0 -19
- package/dist/primitives/thread/types.js.map +0 -1
- package/dist/primitives/thread/types.mjs +0 -1
- package/dist/primitives/thread/types.mjs.map +0 -1
- package/dist/runtimes/core/subscribeToMainThread.d.ts +0 -6
- package/dist/runtimes/core/subscribeToMainThread.d.ts.map +0 -1
- package/dist/runtimes/core/subscribeToMainThread.js.map +0 -1
- package/dist/runtimes/core/subscribeToMainThread.mjs +0 -23
- package/dist/runtimes/core/subscribeToMainThread.mjs.map +0 -1
- package/src/hooks/index.ts +0 -2
- package/src/hooks/useAppendMessage.tsx +0 -19
- package/src/hooks/useSwitchToNewThread.tsx +0 -14
- package/src/primitive-hooks/actionBar/index.ts +0 -39
- package/src/primitive-hooks/branchPicker/index.ts +0 -18
- package/src/primitive-hooks/composer/index.ts +0 -17
- package/src/primitive-hooks/message/index.ts +0 -4
- package/src/primitive-hooks/thread/index.ts +0 -16
- package/src/primitives/actionBar/types.ts +0 -8
- package/src/primitives/assistantModal/types.ts +0 -3
- package/src/primitives/attachment/types.ts +0 -0
- package/src/primitives/branchPicker/types.ts +0 -5
- package/src/primitives/composer/types.ts +0 -5
- package/src/primitives/contentPart/types.ts +0 -4
- package/src/primitives/message/MessageInProgress.tsx +0 -22
- package/src/primitives/message/types.ts +0 -4
- package/src/primitives/thread/types.ts +0 -7
- package/src/runtimes/core/subscribeToMainThread.ts +0 -30
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n type KeyboardEvent,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n} from \"react\";\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n} from \"react-textarea-autosize\";\nimport {\n useComposer,\n useComposerRuntime,\n} from \"../../context/react/ComposerContext\";\nimport { useThread, useThreadRuntime } from \"../../context/react/ThreadContext\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\n\
|
1
|
+
{"version":3,"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n type KeyboardEvent,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n} from \"react\";\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n} from \"react-textarea-autosize\";\nimport {\n useComposer,\n useComposerRuntime,\n} from \"../../context/react/ComposerContext\";\nimport { useThread, useThreadRuntime } from \"../../context/react/ThreadContext\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\n\nexport namespace ComposerPrimitiveInput {\n export type Element = HTMLTextAreaElement;\n export type Props = TextareaAutosizeProps & {\n asChild?: boolean | undefined;\n submitOnEnter?: boolean | undefined;\n cancelOnEscape?: boolean | undefined;\n unstable_focusOnRunStart?: boolean | undefined;\n unstable_focusOnScrollToBottom?: boolean | undefined;\n unstable_focusOnThreadSwitched?: boolean | undefined;\n };\n}\n\nexport const ComposerPrimitiveInput = forwardRef<\n ComposerPrimitiveInput.Element,\n ComposerPrimitiveInput.Props\n>(\n (\n {\n autoFocus = false,\n asChild,\n disabled: disabledProp,\n onChange,\n onKeyDown,\n submitOnEnter = true,\n cancelOnEscape = true,\n unstable_focusOnRunStart = true,\n unstable_focusOnScrollToBottom = true,\n unstable_focusOnThreadSwitched = true,\n ...rest\n },\n forwardedRef,\n ) => {\n const threadRuntime = useThreadRuntime();\n const composerRuntime = useComposerRuntime();\n\n const value = useComposer((c) => {\n if (!c.isEditing) return \"\";\n return c.text;\n });\n\n const Component = asChild ? Slot : TextareaAutosize;\n\n const isDisabled = useThread((t) => t.isDisabled) ?? disabledProp ?? false;\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const ref = useComposedRefs(forwardedRef, textareaRef);\n\n useEscapeKeydown((e) => {\n if (!cancelOnEscape) return;\n\n if (composerRuntime.getState().canCancel) {\n composerRuntime.cancel();\n e.preventDefault();\n }\n });\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (isDisabled || !submitOnEnter) return;\n\n // ignore IME composition events\n if (e.nativeEvent.isComposing) return;\n\n if (e.key === \"Enter\" && e.shiftKey === false) {\n const { isRunning } = threadRuntime.getState();\n\n if (!isRunning) {\n e.preventDefault();\n\n textareaRef.current?.closest(\"form\")?.requestSubmit();\n }\n }\n };\n\n const autoFocusEnabled = autoFocus && !isDisabled;\n const focus = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea || !autoFocusEnabled) return;\n\n textarea.focus({ preventScroll: true });\n textarea.setSelectionRange(\n textareaRef.current.value.length,\n textareaRef.current.value.length,\n );\n }, [autoFocusEnabled]);\n\n useEffect(() => focus(), [focus]);\n\n useOnScrollToBottom(() => {\n if (composerRuntime.type === \"thread\" && unstable_focusOnScrollToBottom) {\n focus();\n }\n });\n\n useEffect(() => {\n if (composerRuntime.type !== \"thread\" || !unstable_focusOnRunStart)\n return undefined;\n\n return threadRuntime.unstable_on(\"run-start\", focus);\n }, [unstable_focusOnRunStart]);\n\n useEffect(() => {\n if (composerRuntime.type !== \"thread\" || !unstable_focusOnThreadSwitched)\n return undefined;\n\n return threadRuntime.unstable_on(\"switched-to\", focus);\n }, [unstable_focusOnThreadSwitched]);\n\n return (\n <Component\n name=\"input\"\n value={value}\n {...rest}\n ref={ref}\n disabled={isDisabled}\n onChange={composeEventHandlers(onChange, (e) => {\n if (!composerRuntime.getState().isEditing) return;\n return composerRuntime.setText(e.target.value);\n })}\n onKeyDown={composeEventHandlers(onKeyDown, handleKeyPress)}\n />\n );\n },\n);\n\nComposerPrimitiveInput.displayName = \"ComposerPrimitive.Input\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,uBAAqC;AACrC,gCAAgC;AAChC,wBAAqB;AACrB,mBAMO;AACP,qCAEO;AACP,6BAGO;AACP,2BAA4C;AAC5C,sCAAiC;AACjC,iCAAoC;AA6G9B;AA/FC,IAAM,6BAAyB;AAAA,EAIpC,CACE;AAAA,IACE,YAAY;AAAA,IACZ;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,2BAA2B;AAAA,IAC3B,iCAAiC;AAAA,IACjC,iCAAiC;AAAA,IACjC,GAAG;AAAA,EACL,GACA,iBACG;AACH,UAAM,oBAAgB,uCAAiB;AACvC,UAAM,sBAAkB,2CAAmB;AAE3C,UAAM,YAAQ,oCAAY,CAAC,MAAM;AAC/B,UAAI,CAAC,EAAE,UAAW,QAAO;AACzB,aAAO,EAAE;AAAA,IACX,CAAC;AAED,UAAM,YAAY,UAAU,yBAAO,+BAAAA;AAEnC,UAAM,iBAAa,gCAAU,CAAC,MAAM,EAAE,UAAU,KAAK,gBAAgB;AACrE,UAAM,kBAAc,qBAA4B,IAAI;AACpD,UAAM,UAAM,2CAAgB,cAAc,WAAW;AAErD,0DAAiB,CAAC,MAAM;AACtB,UAAI,CAAC,eAAgB;AAErB,UAAI,gBAAgB,SAAS,EAAE,WAAW;AACxC,wBAAgB,OAAO;AACvB,UAAE,eAAe;AAAA,MACnB;AAAA,IACF,CAAC;AAED,UAAM,iBAAiB,CAAC,MAAqB;AAC3C,UAAI,cAAc,CAAC,cAAe;AAGlC,UAAI,EAAE,YAAY,YAAa;AAE/B,UAAI,EAAE,QAAQ,WAAW,EAAE,aAAa,OAAO;AAC7C,cAAM,EAAE,UAAU,IAAI,cAAc,SAAS;AAE7C,YAAI,CAAC,WAAW;AACd,YAAE,eAAe;AAEjB,sBAAY,SAAS,QAAQ,MAAM,GAAG,cAAc;AAAA,QACtD;AAAA,MACF;AAAA,IACF;AAEA,UAAM,mBAAmB,aAAa,CAAC;AACvC,UAAM,YAAQ,0BAAY,MAAM;AAC9B,YAAM,WAAW,YAAY;AAC7B,UAAI,CAAC,YAAY,CAAC,iBAAkB;AAEpC,eAAS,MAAM,EAAE,eAAe,KAAK,CAAC;AACtC,eAAS;AAAA,QACP,YAAY,QAAQ,MAAM;AAAA,QAC1B,YAAY,QAAQ,MAAM;AAAA,MAC5B;AAAA,IACF,GAAG,CAAC,gBAAgB,CAAC;AAErB,gCAAU,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC;AAEhC,wDAAoB,MAAM;AACxB,UAAI,gBAAgB,SAAS,YAAY,gCAAgC;AACvE,cAAM;AAAA,MACR;AAAA,IACF,CAAC;AAED,gCAAU,MAAM;AACd,UAAI,gBAAgB,SAAS,YAAY,CAAC;AACxC,eAAO;AAET,aAAO,cAAc,YAAY,aAAa,KAAK;AAAA,IACrD,GAAG,CAAC,wBAAwB,CAAC;AAE7B,gCAAU,MAAM;AACd,UAAI,gBAAgB,SAAS,YAAY,CAAC;AACxC,eAAO;AAET,aAAO,cAAc,YAAY,eAAe,KAAK;AAAA,IACvD,GAAG,CAAC,8BAA8B,CAAC;AAEnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL;AAAA,QACC,GAAG;AAAA,QACJ;AAAA,QACA,UAAU;AAAA,QACV,cAAU,uCAAqB,UAAU,CAAC,MAAM;AAC9C,cAAI,CAAC,gBAAgB,SAAS,EAAE,UAAW;AAC3C,iBAAO,gBAAgB,QAAQ,EAAE,OAAO,KAAK;AAAA,QAC/C,CAAC;AAAA,QACD,eAAW,uCAAqB,WAAW,cAAc;AAAA;AAAA,IAC3D;AAAA,EAEJ;AACF;AAEA,uBAAuB,cAAc;","names":["TextareaAutosize"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n type KeyboardEvent,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n} from \"react\";\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n} from \"react-textarea-autosize\";\nimport {\n useComposer,\n useComposerRuntime,\n} from \"../../context/react/ComposerContext\";\nimport { useThread, useThreadRuntime } from \"../../context/react/ThreadContext\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\n\
|
1
|
+
{"version":3,"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n type KeyboardEvent,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n} from \"react\";\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n} from \"react-textarea-autosize\";\nimport {\n useComposer,\n useComposerRuntime,\n} from \"../../context/react/ComposerContext\";\nimport { useThread, useThreadRuntime } from \"../../context/react/ThreadContext\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\n\nexport namespace ComposerPrimitiveInput {\n export type Element = HTMLTextAreaElement;\n export type Props = TextareaAutosizeProps & {\n asChild?: boolean | undefined;\n submitOnEnter?: boolean | undefined;\n cancelOnEscape?: boolean | undefined;\n unstable_focusOnRunStart?: boolean | undefined;\n unstable_focusOnScrollToBottom?: boolean | undefined;\n unstable_focusOnThreadSwitched?: boolean | undefined;\n };\n}\n\nexport const ComposerPrimitiveInput = forwardRef<\n ComposerPrimitiveInput.Element,\n ComposerPrimitiveInput.Props\n>(\n (\n {\n autoFocus = false,\n asChild,\n disabled: disabledProp,\n onChange,\n onKeyDown,\n submitOnEnter = true,\n cancelOnEscape = true,\n unstable_focusOnRunStart = true,\n unstable_focusOnScrollToBottom = true,\n unstable_focusOnThreadSwitched = true,\n ...rest\n },\n forwardedRef,\n ) => {\n const threadRuntime = useThreadRuntime();\n const composerRuntime = useComposerRuntime();\n\n const value = useComposer((c) => {\n if (!c.isEditing) return \"\";\n return c.text;\n });\n\n const Component = asChild ? Slot : TextareaAutosize;\n\n const isDisabled = useThread((t) => t.isDisabled) ?? disabledProp ?? false;\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const ref = useComposedRefs(forwardedRef, textareaRef);\n\n useEscapeKeydown((e) => {\n if (!cancelOnEscape) return;\n\n if (composerRuntime.getState().canCancel) {\n composerRuntime.cancel();\n e.preventDefault();\n }\n });\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (isDisabled || !submitOnEnter) return;\n\n // ignore IME composition events\n if (e.nativeEvent.isComposing) return;\n\n if (e.key === \"Enter\" && e.shiftKey === false) {\n const { isRunning } = threadRuntime.getState();\n\n if (!isRunning) {\n e.preventDefault();\n\n textareaRef.current?.closest(\"form\")?.requestSubmit();\n }\n }\n };\n\n const autoFocusEnabled = autoFocus && !isDisabled;\n const focus = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea || !autoFocusEnabled) return;\n\n textarea.focus({ preventScroll: true });\n textarea.setSelectionRange(\n textareaRef.current.value.length,\n textareaRef.current.value.length,\n );\n }, [autoFocusEnabled]);\n\n useEffect(() => focus(), [focus]);\n\n useOnScrollToBottom(() => {\n if (composerRuntime.type === \"thread\" && unstable_focusOnScrollToBottom) {\n focus();\n }\n });\n\n useEffect(() => {\n if (composerRuntime.type !== \"thread\" || !unstable_focusOnRunStart)\n return undefined;\n\n return threadRuntime.unstable_on(\"run-start\", focus);\n }, [unstable_focusOnRunStart]);\n\n useEffect(() => {\n if (composerRuntime.type !== \"thread\" || !unstable_focusOnThreadSwitched)\n return undefined;\n\n return threadRuntime.unstable_on(\"switched-to\", focus);\n }, [unstable_focusOnThreadSwitched]);\n\n return (\n <Component\n name=\"input\"\n value={value}\n {...rest}\n ref={ref}\n disabled={isDisabled}\n onChange={composeEventHandlers(onChange, (e) => {\n if (!composerRuntime.getState().isEditing) return;\n return composerRuntime.setText(e.target.value);\n })}\n onKeyDown={composeEventHandlers(onKeyDown, handleKeyPress)}\n />\n );\n },\n);\n\nComposerPrimitiveInput.displayName = \"ComposerPrimitive.Input\";\n"],"mappings":";;;AAEA,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,YAAY;AACrB;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,OAAO,sBAEA;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,WAAW,wBAAwB;AAC5C,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AA6G9B;AA/FC,IAAM,yBAAyB;AAAA,EAIpC,CACE;AAAA,IACE,YAAY;AAAA,IACZ;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,2BAA2B;AAAA,IAC3B,iCAAiC;AAAA,IACjC,iCAAiC;AAAA,IACjC,GAAG;AAAA,EACL,GACA,iBACG;AACH,UAAM,gBAAgB,iBAAiB;AACvC,UAAM,kBAAkB,mBAAmB;AAE3C,UAAM,QAAQ,YAAY,CAAC,MAAM;AAC/B,UAAI,CAAC,EAAE,UAAW,QAAO;AACzB,aAAO,EAAE;AAAA,IACX,CAAC;AAED,UAAM,YAAY,UAAU,OAAO;AAEnC,UAAM,aAAa,UAAU,CAAC,MAAM,EAAE,UAAU,KAAK,gBAAgB;AACrE,UAAM,cAAc,OAA4B,IAAI;AACpD,UAAM,MAAM,gBAAgB,cAAc,WAAW;AAErD,qBAAiB,CAAC,MAAM;AACtB,UAAI,CAAC,eAAgB;AAErB,UAAI,gBAAgB,SAAS,EAAE,WAAW;AACxC,wBAAgB,OAAO;AACvB,UAAE,eAAe;AAAA,MACnB;AAAA,IACF,CAAC;AAED,UAAM,iBAAiB,CAAC,MAAqB;AAC3C,UAAI,cAAc,CAAC,cAAe;AAGlC,UAAI,EAAE,YAAY,YAAa;AAE/B,UAAI,EAAE,QAAQ,WAAW,EAAE,aAAa,OAAO;AAC7C,cAAM,EAAE,UAAU,IAAI,cAAc,SAAS;AAE7C,YAAI,CAAC,WAAW;AACd,YAAE,eAAe;AAEjB,sBAAY,SAAS,QAAQ,MAAM,GAAG,cAAc;AAAA,QACtD;AAAA,MACF;AAAA,IACF;AAEA,UAAM,mBAAmB,aAAa,CAAC;AACvC,UAAM,QAAQ,YAAY,MAAM;AAC9B,YAAM,WAAW,YAAY;AAC7B,UAAI,CAAC,YAAY,CAAC,iBAAkB;AAEpC,eAAS,MAAM,EAAE,eAAe,KAAK,CAAC;AACtC,eAAS;AAAA,QACP,YAAY,QAAQ,MAAM;AAAA,QAC1B,YAAY,QAAQ,MAAM;AAAA,MAC5B;AAAA,IACF,GAAG,CAAC,gBAAgB,CAAC;AAErB,cAAU,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC;AAEhC,wBAAoB,MAAM;AACxB,UAAI,gBAAgB,SAAS,YAAY,gCAAgC;AACvE,cAAM;AAAA,MACR;AAAA,IACF,CAAC;AAED,cAAU,MAAM;AACd,UAAI,gBAAgB,SAAS,YAAY,CAAC;AACxC,eAAO;AAET,aAAO,cAAc,YAAY,aAAa,KAAK;AAAA,IACrD,GAAG,CAAC,wBAAwB,CAAC;AAE7B,cAAU,MAAM;AACd,UAAI,gBAAgB,SAAS,YAAY,CAAC;AACxC,eAAO;AAET,aAAO,cAAc,YAAY,eAAe,KAAK;AAAA,IACvD,GAAG,CAAC,8BAA8B,CAAC;AAEnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL;AAAA,QACC,GAAG;AAAA,QACJ;AAAA,QACA,UAAU;AAAA,QACV,UAAU,qBAAqB,UAAU,CAAC,MAAM;AAC9C,cAAI,CAAC,gBAAgB,SAAS,EAAE,UAAW;AAC3C,iBAAO,gBAAgB,QAAQ,EAAE,OAAO,KAAK;AAAA,QAC/C,CAAC;AAAA,QACD,WAAW,qBAAqB,WAAW,cAAc;AAAA;AAAA,IAC3D;AAAA,EAEJ;AACF;AAEA,uBAAuB,cAAc;","names":[]}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { Primitive } from "@radix-ui/react-primitive";
|
2
2
|
import { type ElementRef, ComponentPropsWithoutRef } from "react";
|
3
|
-
export type ComposerPrimitiveRootProps = ComposerPrimitiveRoot.Props;
|
4
3
|
export declare namespace ComposerPrimitiveRoot {
|
5
4
|
type Element = ElementRef<typeof Primitive.form>;
|
6
5
|
type Props = ComponentPropsWithoutRef<typeof Primitive.form>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ComposerRoot.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerRoot.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,KAAK,UAAU,EAGf,wBAAwB,EACzB,MAAM,OAAO,CAAC;AAGf,
|
1
|
+
{"version":3,"file":"ComposerRoot.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerRoot.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,KAAK,UAAU,EAGf,wBAAwB,EACzB,MAAM,OAAO,CAAC;AAGf,yBAAiB,qBAAqB,CAAC;IACrC,KAAY,OAAO,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IACxD,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;CACrE;AAED,eAAO,MAAM,qBAAqB;;;;2DAoBhC,CAAC"}
|
@@ -27,10 +27,10 @@ module.exports = __toCommonJS(ComposerRoot_exports);
|
|
27
27
|
var import_primitive = require("@radix-ui/primitive");
|
28
28
|
var import_react_primitive = require("@radix-ui/react-primitive");
|
29
29
|
var import_react = require("react");
|
30
|
-
var
|
30
|
+
var import_useComposerSend = require("../../primitive-hooks/composer/useComposerSend.cjs");
|
31
31
|
var import_jsx_runtime = require("react/jsx-runtime");
|
32
32
|
var ComposerPrimitiveRoot = (0, import_react.forwardRef)(({ onSubmit, ...rest }, forwardedRef) => {
|
33
|
-
const send = (0,
|
33
|
+
const send = (0, import_useComposerSend.useComposerSend)();
|
34
34
|
const handleSubmit = (e) => {
|
35
35
|
e.preventDefault();
|
36
36
|
if (!send) return;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/composer/ComposerRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport {\n type ElementRef,\n type FormEvent,\n forwardRef,\n ComponentPropsWithoutRef,\n} from \"react\";\nimport { useComposerSend } from \"../../primitive-hooks\";\n\nexport
|
1
|
+
{"version":3,"sources":["../../../src/primitives/composer/ComposerRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport {\n type ElementRef,\n type FormEvent,\n forwardRef,\n ComponentPropsWithoutRef,\n} from \"react\";\nimport { useComposerSend } from \"../../primitive-hooks/composer/useComposerSend\";\n\nexport namespace ComposerPrimitiveRoot {\n export type Element = ElementRef<typeof Primitive.form>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.form>;\n}\n\nexport const ComposerPrimitiveRoot = forwardRef<\n ComposerPrimitiveRoot.Element,\n ComposerPrimitiveRoot.Props\n>(({ onSubmit, ...rest }, forwardedRef) => {\n const send = useComposerSend();\n\n const handleSubmit = (e: FormEvent) => {\n e.preventDefault();\n\n if (!send) return;\n send();\n };\n\n return (\n <Primitive.form\n {...rest}\n ref={forwardedRef}\n onSubmit={composeEventHandlers(onSubmit, handleSubmit)}\n />\n );\n});\n\nComposerPrimitiveRoot.displayName = \"ComposerPrimitive.Root\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,uBAAqC;AACrC,6BAA0B;AAC1B,mBAKO;AACP,6BAAgC;AAqB5B;AAdG,IAAM,4BAAwB,yBAGnC,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,iBAAiB;AACzC,QAAM,WAAO,wCAAgB;AAE7B,QAAM,eAAe,CAAC,MAAiB;AACrC,MAAE,eAAe;AAEjB,QAAI,CAAC,KAAM;AACX,SAAK;AAAA,EACP;AAEA,SACE;AAAA,IAAC,iCAAU;AAAA,IAAV;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,cAAU,uCAAqB,UAAU,YAAY;AAAA;AAAA,EACvD;AAEJ,CAAC;AAED,sBAAsB,cAAc;","names":[]}
|
@@ -6,7 +6,7 @@ import { Primitive } from "@radix-ui/react-primitive";
|
|
6
6
|
import {
|
7
7
|
forwardRef
|
8
8
|
} from "react";
|
9
|
-
import { useComposerSend } from "../../primitive-hooks/
|
9
|
+
import { useComposerSend } from "../../primitive-hooks/composer/useComposerSend.mjs";
|
10
10
|
import { jsx } from "react/jsx-runtime";
|
11
11
|
var ComposerPrimitiveRoot = forwardRef(({ onSubmit, ...rest }, forwardedRef) => {
|
12
12
|
const send = useComposerSend();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/composer/ComposerRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport {\n type ElementRef,\n type FormEvent,\n forwardRef,\n ComponentPropsWithoutRef,\n} from \"react\";\nimport { useComposerSend } from \"../../primitive-hooks\";\n\nexport
|
1
|
+
{"version":3,"sources":["../../../src/primitives/composer/ComposerRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport {\n type ElementRef,\n type FormEvent,\n forwardRef,\n ComponentPropsWithoutRef,\n} from \"react\";\nimport { useComposerSend } from \"../../primitive-hooks/composer/useComposerSend\";\n\nexport namespace ComposerPrimitiveRoot {\n export type Element = ElementRef<typeof Primitive.form>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.form>;\n}\n\nexport const ComposerPrimitiveRoot = forwardRef<\n ComposerPrimitiveRoot.Element,\n ComposerPrimitiveRoot.Props\n>(({ onSubmit, ...rest }, forwardedRef) => {\n const send = useComposerSend();\n\n const handleSubmit = (e: FormEvent) => {\n e.preventDefault();\n\n if (!send) return;\n send();\n };\n\n return (\n <Primitive.form\n {...rest}\n ref={forwardedRef}\n onSubmit={composeEventHandlers(onSubmit, handleSubmit)}\n />\n );\n});\n\nComposerPrimitiveRoot.displayName = \"ComposerPrimitive.Root\";\n"],"mappings":";;;AAEA,SAAS,4BAA4B;AACrC,SAAS,iBAAiB;AAC1B;AAAA,EAGE;AAAA,OAEK;AACP,SAAS,uBAAuB;AAqB5B;AAdG,IAAM,wBAAwB,WAGnC,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,iBAAiB;AACzC,QAAM,OAAO,gBAAgB;AAE7B,QAAM,eAAe,CAAC,MAAiB;AACrC,MAAE,eAAe;AAEjB,QAAI,CAAC,KAAM;AACX,SAAK;AAAA,EACP;AAEA,SACE;AAAA,IAAC,UAAU;AAAA,IAAV;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,UAAU,qBAAqB,UAAU,YAAY;AAAA;AAAA,EACvD;AAEJ,CAAC;AAED,sBAAsB,cAAc;","names":[]}
|
@@ -1,9 +1,5 @@
|
|
1
1
|
import { ActionButtonElement, ActionButtonProps } from "../../utils/createActionButton";
|
2
|
-
import { useComposerSend } from "../../primitive-hooks";
|
3
|
-
/**
|
4
|
-
* @deprecated Use `ComposerPrimitive.Send.Props` instead. This will be removed in 0.6.
|
5
|
-
*/
|
6
|
-
export type ComposerPrimitiveSendProps = ComposerPrimitiveSend.Props;
|
2
|
+
import { useComposerSend } from "../../primitive-hooks/composer/useComposerSend";
|
7
3
|
export declare namespace ComposerPrimitiveSend {
|
8
4
|
type Element = ActionButtonElement;
|
9
5
|
type Props = ActionButtonProps<typeof useComposerSend>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ComposerSend.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerSend.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"ComposerSend.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerSend.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEjF,yBAAiB,qBAAqB,CAAC;IACrC,KAAY,OAAO,GAAG,mBAAmB,CAAC;IAC1C,KAAY,KAAK,GAAG,iBAAiB,CAAC,OAAO,eAAe,CAAC,CAAC;CAC/D;AAED,eAAO,MAAM,qBAAqB;;;;6DAGjC,CAAC"}
|
@@ -25,10 +25,10 @@ __export(ComposerSend_exports, {
|
|
25
25
|
});
|
26
26
|
module.exports = __toCommonJS(ComposerSend_exports);
|
27
27
|
var import_createActionButton = require("../../utils/createActionButton.cjs");
|
28
|
-
var
|
28
|
+
var import_useComposerSend = require("../../primitive-hooks/composer/useComposerSend.cjs");
|
29
29
|
var ComposerPrimitiveSend = (0, import_createActionButton.createActionButton)(
|
30
30
|
"ComposerPrimitive.Send",
|
31
|
-
|
31
|
+
import_useComposerSend.useComposerSend
|
32
32
|
);
|
33
33
|
// Annotate the CommonJS export names for ESM import in node:
|
34
34
|
0 && (module.exports = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/composer/ComposerSend.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useComposerSend } from \"../../primitive-hooks\";\n\
|
1
|
+
{"version":3,"sources":["../../../src/primitives/composer/ComposerSend.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useComposerSend } from \"../../primitive-hooks/composer/useComposerSend\";\n\nexport namespace ComposerPrimitiveSend {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useComposerSend>;\n}\n\nexport const ComposerPrimitiveSend = createActionButton(\n \"ComposerPrimitive.Send\",\n useComposerSend,\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,gCAIO;AACP,6BAAgC;AAOzB,IAAM,4BAAwB;AAAA,EACnC;AAAA,EACA;AACF;","names":[]}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
import {
|
5
5
|
createActionButton
|
6
6
|
} from "../../utils/createActionButton.mjs";
|
7
|
-
import { useComposerSend } from "../../primitive-hooks/
|
7
|
+
import { useComposerSend } from "../../primitive-hooks/composer/useComposerSend.mjs";
|
8
8
|
var ComposerPrimitiveSend = createActionButton(
|
9
9
|
"ComposerPrimitive.Send",
|
10
10
|
useComposerSend
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/composer/ComposerSend.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useComposerSend } from \"../../primitive-hooks\";\n\
|
1
|
+
{"version":3,"sources":["../../../src/primitives/composer/ComposerSend.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useComposerSend } from \"../../primitive-hooks/composer/useComposerSend\";\n\nexport namespace ComposerPrimitiveSend {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useComposerSend>;\n}\n\nexport const ComposerPrimitiveSend = createActionButton(\n \"ComposerPrimitive.Send\",\n useComposerSend,\n);\n"],"mappings":";;;AAEA;AAAA,EAGE;AAAA,OACK;AACP,SAAS,uBAAuB;AAOzB,IAAM,wBAAwB;AAAA,EACnC;AAAA,EACA;AACF;","names":[]}
|
@@ -1,8 +1,4 @@
|
|
1
1
|
import type { FC } from "react";
|
2
|
-
/**
|
3
|
-
* @deprecated Use `ContentPartPrimitive.Display.Props` instead. This will be removed in 0.6.
|
4
|
-
*/
|
5
|
-
export type ContentPartPrimitiveDisplayProps = ContentPartPrimitiveDisplay.Props;
|
6
2
|
export declare namespace ContentPartPrimitiveDisplay {
|
7
3
|
type Props = Record<string, never>;
|
8
4
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ContentPartDisplay.d.ts","sourceRoot":"","sources":["../../../src/primitives/contentPart/ContentPartDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC
|
1
|
+
{"version":3,"file":"ContentPartDisplay.d.ts","sourceRoot":"","sources":["../../../src/primitives/contentPart/ContentPartDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,yBAAiB,2BAA2B,CAAC;IAC3C,KAAY,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CAC3C;AAED,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAC1C,2BAA2B,CAAC,KAAK,CAIlC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartDisplay.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useContentPartDisplay } from \"../../primitive-hooks/contentPart/useContentPartDisplay\";\n\
|
1
|
+
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartDisplay.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useContentPartDisplay } from \"../../primitive-hooks/contentPart/useContentPartDisplay\";\n\nexport namespace ContentPartPrimitiveDisplay {\n export type Props = Record<string, never>;\n}\n\nexport const ContentPartPrimitiveDisplay: FC<\n ContentPartPrimitiveDisplay.Props\n> = () => {\n const { display } = useContentPartDisplay();\n return display ?? null;\n};\n\nContentPartPrimitiveDisplay.displayName = \"ContentPartPrimitive.Display\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mCAAsC;AAM/B,IAAM,8BAET,MAAM;AACR,QAAM,EAAE,QAAQ,QAAI,oDAAsB;AAC1C,SAAO,WAAW;AACpB;AAEA,4BAA4B,cAAc;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartDisplay.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useContentPartDisplay } from \"../../primitive-hooks/contentPart/useContentPartDisplay\";\n\
|
1
|
+
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartDisplay.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useContentPartDisplay } from \"../../primitive-hooks/contentPart/useContentPartDisplay\";\n\nexport namespace ContentPartPrimitiveDisplay {\n export type Props = Record<string, never>;\n}\n\nexport const ContentPartPrimitiveDisplay: FC<\n ContentPartPrimitiveDisplay.Props\n> = () => {\n const { display } = useContentPartDisplay();\n return display ?? null;\n};\n\nContentPartPrimitiveDisplay.displayName = \"ContentPartPrimitive.Display\";\n"],"mappings":";AACA,SAAS,6BAA6B;AAM/B,IAAM,8BAET,MAAM;AACR,QAAM,EAAE,QAAQ,IAAI,sBAAsB;AAC1C,SAAO,WAAW;AACpB;AAEA,4BAA4B,cAAc;","names":[]}
|
@@ -1,9 +1,5 @@
|
|
1
1
|
import { Primitive } from "@radix-ui/react-primitive";
|
2
2
|
import { type ElementRef, ComponentPropsWithoutRef } from "react";
|
3
|
-
/**
|
4
|
-
* @deprecated Use `ContentPartPrimitive.Image.Props` instead. This will be removed in 0.6.
|
5
|
-
*/
|
6
|
-
export type ContentPartPrimitiveImageProps = ContentPartPrimitiveImage.Props;
|
7
3
|
export declare namespace ContentPartPrimitiveImage {
|
8
4
|
type Element = ElementRef<typeof Primitive.img>;
|
9
5
|
type Props = ComponentPropsWithoutRef<typeof Primitive.img>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ContentPartImage.d.ts","sourceRoot":"","sources":["../../../src/primitives/contentPart/ContentPartImage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,KAAK,UAAU,EAAc,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAG9E
|
1
|
+
{"version":3,"file":"ContentPartImage.d.ts","sourceRoot":"","sources":["../../../src/primitives/contentPart/ContentPartImage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,KAAK,UAAU,EAAc,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAG9E,yBAAiB,yBAAyB,CAAC;IACzC,KAAY,OAAO,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACvD,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;CACpE;AAED,eAAO,MAAM,yBAAyB;;;;4DAMpC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartImage.tsx"],"sourcesContent":["import { Primitive } from \"@radix-ui/react-primitive\";\nimport { type ElementRef, forwardRef, ComponentPropsWithoutRef } from \"react\";\nimport { useContentPartImage } from \"../../primitive-hooks/contentPart/useContentPartImage\";\n\
|
1
|
+
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartImage.tsx"],"sourcesContent":["import { Primitive } from \"@radix-ui/react-primitive\";\nimport { type ElementRef, forwardRef, ComponentPropsWithoutRef } from \"react\";\nimport { useContentPartImage } from \"../../primitive-hooks/contentPart/useContentPartImage\";\n\nexport namespace ContentPartPrimitiveImage {\n export type Element = ElementRef<typeof Primitive.img>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.img>;\n}\n\nexport const ContentPartPrimitiveImage = forwardRef<\n ContentPartPrimitiveImage.Element,\n ContentPartPrimitiveImage.Props\n>((props, forwardedRef) => {\n const { image } = useContentPartImage();\n return <Primitive.img src={image} {...props} ref={forwardedRef} />;\n});\n\nContentPartPrimitiveImage.displayName = \"ContentPartPrimitive.Image\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAA0B;AAC1B,mBAAsE;AACtE,iCAAoC;AAY3B;AALF,IAAM,gCAA4B,yBAGvC,CAAC,OAAO,iBAAiB;AACzB,QAAM,EAAE,MAAM,QAAI,gDAAoB;AACtC,SAAO,4CAAC,iCAAU,KAAV,EAAc,KAAK,OAAQ,GAAG,OAAO,KAAK,cAAc;AAClE,CAAC;AAED,0BAA0B,cAAc;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartImage.tsx"],"sourcesContent":["import { Primitive } from \"@radix-ui/react-primitive\";\nimport { type ElementRef, forwardRef, ComponentPropsWithoutRef } from \"react\";\nimport { useContentPartImage } from \"../../primitive-hooks/contentPart/useContentPartImage\";\n\
|
1
|
+
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartImage.tsx"],"sourcesContent":["import { Primitive } from \"@radix-ui/react-primitive\";\nimport { type ElementRef, forwardRef, ComponentPropsWithoutRef } from \"react\";\nimport { useContentPartImage } from \"../../primitive-hooks/contentPart/useContentPartImage\";\n\nexport namespace ContentPartPrimitiveImage {\n export type Element = ElementRef<typeof Primitive.img>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.img>;\n}\n\nexport const ContentPartPrimitiveImage = forwardRef<\n ContentPartPrimitiveImage.Element,\n ContentPartPrimitiveImage.Props\n>((props, forwardedRef) => {\n const { image } = useContentPartImage();\n return <Primitive.img src={image} {...props} ref={forwardedRef} />;\n});\n\nContentPartPrimitiveImage.displayName = \"ContentPartPrimitive.Image\";\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAA0B,kBAA4C;AACtE,SAAS,2BAA2B;AAY3B;AALF,IAAM,4BAA4B,WAGvC,CAAC,OAAO,iBAAiB;AACzB,QAAM,EAAE,MAAM,IAAI,oBAAoB;AACtC,SAAO,oBAAC,UAAU,KAAV,EAAc,KAAK,OAAQ,GAAG,OAAO,KAAK,cAAc;AAClE,CAAC;AAED,0BAA0B,cAAc;","names":[]}
|
@@ -1,8 +1,4 @@
|
|
1
1
|
import { FC, PropsWithChildren } from "react";
|
2
|
-
/**
|
3
|
-
* @deprecated Use `ContentPartPrimitive.InProgress.Props` instead. This will be removed in 0.6.
|
4
|
-
*/
|
5
|
-
export type ContentPartPrimitiveInProgressProps = ContentPartPrimitiveInProgress.Props;
|
6
2
|
export declare namespace ContentPartPrimitiveInProgress {
|
7
3
|
type Props = PropsWithChildren;
|
8
4
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ContentPartInProgress.d.ts","sourceRoot":"","sources":["../../../src/primitives/contentPart/ContentPartInProgress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG9C
|
1
|
+
{"version":3,"file":"ContentPartInProgress.d.ts","sourceRoot":"","sources":["../../../src/primitives/contentPart/ContentPartInProgress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG9C,yBAAiB,8BAA8B,CAAC;IAC9C,KAAY,KAAK,GAAG,iBAAiB,CAAC;CACvC;AAGD,eAAO,MAAM,8BAA8B,EAAE,EAAE,CAC7C,8BAA8B,CAAC,KAAK,CAKrC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartInProgress.tsx"],"sourcesContent":["import { FC, PropsWithChildren } from \"react\";\nimport { useContentPart } from \"../../context\";\n\
|
1
|
+
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartInProgress.tsx"],"sourcesContent":["import { FC, PropsWithChildren } from \"react\";\nimport { useContentPart } from \"../../context\";\n\nexport namespace ContentPartPrimitiveInProgress {\n export type Props = PropsWithChildren;\n}\n\n// TODO should this be renamed to IsRunning?\nexport const ContentPartPrimitiveInProgress: FC<\n ContentPartPrimitiveInProgress.Props\n> = ({ children }) => {\n const isInProgress = useContentPart((c) => c.status.type === \"running\");\n\n return isInProgress ? children : null;\n};\n\nContentPartPrimitiveInProgress.displayName = \"ContentPartPrimitive.InProgress\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAA+B;AAOxB,IAAM,iCAET,CAAC,EAAE,SAAS,MAAM;AACpB,QAAM,mBAAe,+BAAe,CAAC,MAAM,EAAE,OAAO,SAAS,SAAS;AAEtE,SAAO,eAAe,WAAW;AACnC;AAEA,+BAA+B,cAAc;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartInProgress.tsx"],"sourcesContent":["import { FC, PropsWithChildren } from \"react\";\nimport { useContentPart } from \"../../context\";\n\
|
1
|
+
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartInProgress.tsx"],"sourcesContent":["import { FC, PropsWithChildren } from \"react\";\nimport { useContentPart } from \"../../context\";\n\nexport namespace ContentPartPrimitiveInProgress {\n export type Props = PropsWithChildren;\n}\n\n// TODO should this be renamed to IsRunning?\nexport const ContentPartPrimitiveInProgress: FC<\n ContentPartPrimitiveInProgress.Props\n> = ({ children }) => {\n const isInProgress = useContentPart((c) => c.status.type === \"running\");\n\n return isInProgress ? children : null;\n};\n\nContentPartPrimitiveInProgress.displayName = \"ContentPartPrimitive.InProgress\";\n"],"mappings":";AACA,SAAS,sBAAsB;AAOxB,IAAM,iCAET,CAAC,EAAE,SAAS,MAAM;AACpB,QAAM,eAAe,eAAe,CAAC,MAAM,EAAE,OAAO,SAAS,SAAS;AAEtE,SAAO,eAAe,WAAW;AACnC;AAEA,+BAA+B,cAAc;","names":[]}
|
@@ -1,9 +1,5 @@
|
|
1
1
|
import { Primitive } from "@radix-ui/react-primitive";
|
2
2
|
import { type ElementRef, ComponentPropsWithoutRef, ElementType } from "react";
|
3
|
-
/**
|
4
|
-
* @deprecated Use `ContentPartPrimitive.Text.Props` instead. This will be removed in 0.6.
|
5
|
-
*/
|
6
|
-
export type ContentPartPrimitiveTextProps = ContentPartPrimitiveText.Props;
|
7
3
|
export declare namespace ContentPartPrimitiveText {
|
8
4
|
type Element = ElementRef<typeof Primitive.span>;
|
9
5
|
type Props = Omit<ComponentPropsWithoutRef<typeof Primitive.span>, "children" | "asChild"> & {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ContentPartText.d.ts","sourceRoot":"","sources":["../../../src/primitives/contentPart/ContentPartText.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,KAAK,UAAU,EAEf,wBAAwB,EACxB,WAAW,EACZ,MAAM,OAAO,CAAC;AAIf
|
1
|
+
{"version":3,"file":"ContentPartText.d.ts","sourceRoot":"","sources":["../../../src/primitives/contentPart/ContentPartText.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,KAAK,UAAU,EAEf,wBAAwB,EACxB,WAAW,EACZ,MAAM,OAAO,CAAC;AAIf,yBAAiB,wBAAwB,CAAC;IACxC,KAAY,OAAO,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IACxD,KAAY,KAAK,GAAG,IAAI,CACtB,wBAAwB,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,EAC/C,UAAU,GAAG,SAAS,CACvB,GAAG;QACF,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,SAAS,CAAC,EAAE,WAAW,CAAC;KACzB,CAAC;CACH;AAED,eAAO,MAAM,wBAAwB;;;;;aALxB,OAAO;gBACJ,WAAW;mDAezB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartText.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport {\n type ElementRef,\n forwardRef,\n ComponentPropsWithoutRef,\n ElementType,\n} from \"react\";\nimport { useContentPartText } from \"../../primitive-hooks/contentPart/useContentPartText\";\nimport { useSmooth } from \"../../utils/smooth/useSmooth\";\n\
|
1
|
+
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartText.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport {\n type ElementRef,\n forwardRef,\n ComponentPropsWithoutRef,\n ElementType,\n} from \"react\";\nimport { useContentPartText } from \"../../primitive-hooks/contentPart/useContentPartText\";\nimport { useSmooth } from \"../../utils/smooth/useSmooth\";\n\nexport namespace ContentPartPrimitiveText {\n export type Element = ElementRef<typeof Primitive.span>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.span>,\n \"children\" | \"asChild\"\n > & {\n smooth?: boolean;\n component?: ElementType;\n };\n}\n\nexport const ContentPartPrimitiveText = forwardRef<\n ContentPartPrimitiveText.Element,\n ContentPartPrimitiveText.Props\n>(({ smooth = true, component: Component = \"span\", ...rest }, forwardedRef) => {\n const { text, status } = useSmooth(useContentPartText(), smooth);\n\n return (\n <Component data-status={status.type} {...rest} ref={forwardedRef}>\n {text}\n </Component>\n );\n});\n\nContentPartPrimitiveText.displayName = \"ContentPartPrimitive.Text\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAKO;AACP,gCAAmC;AACnC,uBAA0B;AAoBtB;AAPG,IAAM,+BAA2B,yBAGtC,CAAC,EAAE,SAAS,MAAM,WAAW,YAAY,QAAQ,GAAG,KAAK,GAAG,iBAAiB;AAC7E,QAAM,EAAE,MAAM,OAAO,QAAI,gCAAU,8CAAmB,GAAG,MAAM;AAE/D,SACE,4CAAC,aAAU,eAAa,OAAO,MAAO,GAAG,MAAM,KAAK,cACjD,gBACH;AAEJ,CAAC;AAED,yBAAyB,cAAc;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartText.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport {\n type ElementRef,\n forwardRef,\n ComponentPropsWithoutRef,\n ElementType,\n} from \"react\";\nimport { useContentPartText } from \"../../primitive-hooks/contentPart/useContentPartText\";\nimport { useSmooth } from \"../../utils/smooth/useSmooth\";\n\
|
1
|
+
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartText.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport {\n type ElementRef,\n forwardRef,\n ComponentPropsWithoutRef,\n ElementType,\n} from \"react\";\nimport { useContentPartText } from \"../../primitive-hooks/contentPart/useContentPartText\";\nimport { useSmooth } from \"../../utils/smooth/useSmooth\";\n\nexport namespace ContentPartPrimitiveText {\n export type Element = ElementRef<typeof Primitive.span>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.span>,\n \"children\" | \"asChild\"\n > & {\n smooth?: boolean;\n component?: ElementType;\n };\n}\n\nexport const ContentPartPrimitiveText = forwardRef<\n ContentPartPrimitiveText.Element,\n ContentPartPrimitiveText.Props\n>(({ smooth = true, component: Component = \"span\", ...rest }, forwardedRef) => {\n const { text, status } = useSmooth(useContentPartText(), smooth);\n\n return (\n <Component data-status={status.type} {...rest} ref={forwardedRef}>\n {text}\n </Component>\n );\n});\n\nContentPartPrimitiveText.displayName = \"ContentPartPrimitive.Text\";\n"],"mappings":";;;AAGA;AAAA,EAEE;AAAA,OAGK;AACP,SAAS,0BAA0B;AACnC,SAAS,iBAAiB;AAoBtB;AAPG,IAAM,2BAA2B,WAGtC,CAAC,EAAE,SAAS,MAAM,WAAW,YAAY,QAAQ,GAAG,KAAK,GAAG,iBAAiB;AAC7E,QAAM,EAAE,MAAM,OAAO,IAAI,UAAU,mBAAmB,GAAG,MAAM;AAE/D,SACE,oBAAC,aAAU,eAAa,OAAO,MAAO,GAAG,MAAM,KAAK,cACjD,gBACH;AAEJ,CAAC;AAED,yBAAyB,cAAc;","names":[]}
|
@@ -8,11 +8,4 @@ export * as MessagePrimitive from "./message";
|
|
8
8
|
export * as ThreadPrimitive from "./thread";
|
9
9
|
export * as ThreadListPrimitive from "./threadList";
|
10
10
|
export * as ThreadListItemPrimitive from "./threadListItem";
|
11
|
-
export type * from "./actionBar/types";
|
12
|
-
export type * from "./assistantModal/types";
|
13
|
-
export type * from "./branchPicker/types";
|
14
|
-
export type * from "./composer/types";
|
15
|
-
export type * from "./contentPart/types";
|
16
|
-
export type * from "./message/types";
|
17
|
-
export type * from "./thread/types";
|
18
11
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,uBAAuB,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,mBAAmB,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,qBAAqB,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,iBAAiB,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,oBAAoB,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,gBAAgB,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,eAAe,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,mBAAmB,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,uBAAuB,MAAM,kBAAkB,CAAC
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,uBAAuB,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,mBAAmB,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,qBAAqB,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,iBAAiB,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,oBAAoB,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,gBAAgB,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,eAAe,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,mBAAmB,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,uBAAuB,MAAM,kBAAkB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/primitives/index.ts"],"sourcesContent":["export * as ActionBarPrimitive from \"./actionBar\";\nexport * as AssistantModalPrimitive from \"./assistantModal\";\nexport * as AttachmentPrimitive from \"./attachment\";\nexport * as BranchPickerPrimitive from \"./branchPicker\";\nexport * as ComposerPrimitive from \"./composer\";\nexport * as ContentPartPrimitive from \"./contentPart\";\nexport * as MessagePrimitive from \"./message\";\nexport * as ThreadPrimitive from \"./thread\";\nexport * as ThreadListPrimitive from \"./threadList\";\nexport * as ThreadListItemPrimitive from \"./threadListItem\";\n
|
1
|
+
{"version":3,"sources":["../../src/primitives/index.ts"],"sourcesContent":["export * as ActionBarPrimitive from \"./actionBar\";\nexport * as AssistantModalPrimitive from \"./assistantModal\";\nexport * as AttachmentPrimitive from \"./attachment\";\nexport * as BranchPickerPrimitive from \"./branchPicker\";\nexport * as ComposerPrimitive from \"./composer\";\nexport * as ContentPartPrimitive from \"./contentPart\";\nexport * as MessagePrimitive from \"./message\";\nexport * as ThreadPrimitive from \"./thread\";\nexport * as ThreadListPrimitive from \"./threadList\";\nexport * as ThreadListItemPrimitive from \"./threadListItem\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAoC;AACpC,8BAAyC;AACzC,0BAAqC;AACrC,4BAAuC;AACvC,wBAAmC;AACnC,2BAAsC;AACtC,uBAAkC;AAClC,sBAAiC;AACjC,0BAAqC;AACrC,8BAAyC;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/primitives/index.ts"],"sourcesContent":["export * as ActionBarPrimitive from \"./actionBar\";\nexport * as AssistantModalPrimitive from \"./assistantModal\";\nexport * as AttachmentPrimitive from \"./attachment\";\nexport * as BranchPickerPrimitive from \"./branchPicker\";\nexport * as ComposerPrimitive from \"./composer\";\nexport * as ContentPartPrimitive from \"./contentPart\";\nexport * as MessagePrimitive from \"./message\";\nexport * as ThreadPrimitive from \"./thread\";\nexport * as ThreadListPrimitive from \"./threadList\";\nexport * as ThreadListItemPrimitive from \"./threadListItem\";\n
|
1
|
+
{"version":3,"sources":["../../src/primitives/index.ts"],"sourcesContent":["export * as ActionBarPrimitive from \"./actionBar\";\nexport * as AssistantModalPrimitive from \"./assistantModal\";\nexport * as AttachmentPrimitive from \"./attachment\";\nexport * as BranchPickerPrimitive from \"./branchPicker\";\nexport * as ComposerPrimitive from \"./composer\";\nexport * as ContentPartPrimitive from \"./contentPart\";\nexport * as MessagePrimitive from \"./message\";\nexport * as ThreadPrimitive from \"./thread\";\nexport * as ThreadListPrimitive from \"./threadList\";\nexport * as ThreadListItemPrimitive from \"./threadListItem\";\n"],"mappings":";AAAA,YAAY,wBAAwB;AACpC,YAAY,6BAA6B;AACzC,YAAY,yBAAyB;AACrC,YAAY,2BAA2B;AACvC,YAAY,uBAAuB;AACnC,YAAY,0BAA0B;AACtC,YAAY,sBAAsB;AAClC,YAAY,qBAAqB;AACjC,YAAY,yBAAyB;AACrC,YAAY,6BAA6B;","names":[]}
|
@@ -1,8 +1,4 @@
|
|
1
1
|
import { ComponentType, type FC } from "react";
|
2
|
-
/**
|
3
|
-
* @deprecated Use `MessagePrimitive.Attachments.Props` instead. This will be removed in 0.6.
|
4
|
-
*/
|
5
|
-
export type MessagePrimitiveAttachmentsProps = MessagePrimitiveAttachments.Props;
|
6
2
|
export declare namespace MessagePrimitiveAttachments {
|
7
3
|
type Props = {
|
8
4
|
components: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MessageAttachments.d.ts","sourceRoot":"","sources":["../../../src/primitives/message/MessageAttachments.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,EAAiB,MAAM,OAAO,CAAC;AAM9D
|
1
|
+
{"version":3,"file":"MessageAttachments.d.ts","sourceRoot":"","sources":["../../../src/primitives/message/MessageAttachments.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,EAAiB,MAAM,OAAO,CAAC;AAM9D,yBAAiB,2BAA2B,CAAC;IAC3C,KAAY,KAAK,GAAG;QAClB,UAAU,EACN;YACE,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YAClC,QAAQ,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YACrC,IAAI,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YACjC,UAAU,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;SACxC,GACD,SAAS,CAAC;KACf,CAAC;CACH;AAuDD,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAC1C,2BAA2B,CAAC,KAAK,CAclC,CAAC"}
|
@@ -44,9 +44,7 @@ var getComponent = (components, attachment) => {
|
|
44
44
|
}
|
45
45
|
};
|
46
46
|
var AttachmentComponent = ({ components }) => {
|
47
|
-
const Component = (0, import_AttachmentContext.useMessageAttachment)(
|
48
|
-
(a) => getComponent(components, a.attachment)
|
49
|
-
);
|
47
|
+
const Component = (0, import_AttachmentContext.useMessageAttachment)((a) => getComponent(components, a));
|
50
48
|
if (!Component) return null;
|
51
49
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {});
|
52
50
|
};
|
@@ -63,7 +61,7 @@ var MessageAttachment = (0, import_react.memo)(
|
|
63
61
|
(prev, next) => prev.attachmentIndex === next.attachmentIndex && prev.components?.Image === next.components?.Image && prev.components?.Document === next.components?.Document && prev.components?.File === next.components?.File && prev.components?.Attachment === next.components?.Attachment
|
64
62
|
);
|
65
63
|
var MessagePrimitiveAttachments = ({ components }) => {
|
66
|
-
const attachmentsCount = (0, import_context.useMessage)((
|
64
|
+
const attachmentsCount = (0, import_context.useMessage)((message) => {
|
67
65
|
if (message.role !== "user") return 0;
|
68
66
|
return message.attachments.length;
|
69
67
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/message/MessageAttachments.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentType, type FC, memo, useMemo } from \"react\";\nimport { useMessage, useMessageRuntime } from \"../../context\";\nimport { useMessageAttachment } from \"../../context/react/AttachmentContext\";\nimport { AttachmentRuntimeProvider } from \"../../context/providers/AttachmentRuntimeProvider\";\nimport { CompleteAttachment } from \"../../types\";\n\
|
1
|
+
{"version":3,"sources":["../../../src/primitives/message/MessageAttachments.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentType, type FC, memo, useMemo } from \"react\";\nimport { useMessage, useMessageRuntime } from \"../../context\";\nimport { useMessageAttachment } from \"../../context/react/AttachmentContext\";\nimport { AttachmentRuntimeProvider } from \"../../context/providers/AttachmentRuntimeProvider\";\nimport { CompleteAttachment } from \"../../types\";\n\nexport namespace MessagePrimitiveAttachments {\n export type Props = {\n components:\n | {\n Image?: ComponentType | undefined;\n Document?: ComponentType | undefined;\n File?: ComponentType | undefined;\n Attachment?: ComponentType | undefined;\n }\n | undefined;\n };\n}\n\nconst getComponent = (\n components: MessagePrimitiveAttachments.Props[\"components\"],\n attachment: CompleteAttachment,\n) => {\n const type = attachment.type;\n switch (type) {\n case \"image\":\n return components?.Image ?? components?.Attachment;\n case \"document\":\n return components?.Document ?? components?.Attachment;\n case \"file\":\n return components?.File ?? components?.Attachment;\n default:\n const _exhaustiveCheck: never = type;\n throw new Error(`Unknown attachment type: ${_exhaustiveCheck}`);\n }\n};\n\nconst AttachmentComponent: FC<{\n components: MessagePrimitiveAttachments.Props[\"components\"];\n}> = ({ components }) => {\n const Component = useMessageAttachment((a) => getComponent(components, a));\n\n if (!Component) return null;\n return <Component />;\n};\n\nconst MessageAttachmentImpl: FC<\n MessagePrimitiveAttachments.Props & { attachmentIndex: number }\n> = ({ components, attachmentIndex }) => {\n const messageRuntime = useMessageRuntime();\n const runtime = useMemo(\n () => messageRuntime.getAttachmentByIndex(attachmentIndex),\n [messageRuntime, attachmentIndex],\n );\n\n return (\n <AttachmentRuntimeProvider runtime={runtime}>\n <AttachmentComponent components={components} />\n </AttachmentRuntimeProvider>\n );\n};\n\nconst MessageAttachment = memo(\n MessageAttachmentImpl,\n (prev, next) =>\n prev.attachmentIndex === next.attachmentIndex &&\n prev.components?.Image === next.components?.Image &&\n prev.components?.Document === next.components?.Document &&\n prev.components?.File === next.components?.File &&\n prev.components?.Attachment === next.components?.Attachment,\n);\n\nexport const MessagePrimitiveAttachments: FC<\n MessagePrimitiveAttachments.Props\n> = ({ components }) => {\n const attachmentsCount = useMessage((message) => {\n if (message.role !== \"user\") return 0;\n return message.attachments.length;\n });\n\n return Array.from({ length: attachmentsCount }, (_, index) => (\n <MessageAttachment\n key={index}\n attachmentIndex={index}\n components={components}\n />\n ));\n};\n\nMessagePrimitiveAttachments.displayName = \"MessagePrimitive.Attachments\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAsD;AACtD,qBAA8C;AAC9C,+BAAqC;AACrC,uCAA0C;AAwCjC;AAxBT,IAAM,eAAe,CACnB,YACA,eACG;AACH,QAAM,OAAO,WAAW;AACxB,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO,YAAY,SAAS,YAAY;AAAA,IAC1C,KAAK;AACH,aAAO,YAAY,YAAY,YAAY;AAAA,IAC7C,KAAK;AACH,aAAO,YAAY,QAAQ,YAAY;AAAA,IACzC;AACE,YAAM,mBAA0B;AAChC,YAAM,IAAI,MAAM,4BAA4B,gBAAgB,EAAE;AAAA,EAClE;AACF;AAEA,IAAM,sBAED,CAAC,EAAE,WAAW,MAAM;AACvB,QAAM,gBAAY,+CAAqB,CAAC,MAAM,aAAa,YAAY,CAAC,CAAC;AAEzE,MAAI,CAAC,UAAW,QAAO;AACvB,SAAO,4CAAC,aAAU;AACpB;AAEA,IAAM,wBAEF,CAAC,EAAE,YAAY,gBAAgB,MAAM;AACvC,QAAM,qBAAiB,kCAAkB;AACzC,QAAM,cAAU;AAAA,IACd,MAAM,eAAe,qBAAqB,eAAe;AAAA,IACzD,CAAC,gBAAgB,eAAe;AAAA,EAClC;AAEA,SACE,4CAAC,8DAA0B,SACzB,sDAAC,uBAAoB,YAAwB,GAC/C;AAEJ;AAEA,IAAM,wBAAoB;AAAA,EACxB;AAAA,EACA,CAAC,MAAM,SACL,KAAK,oBAAoB,KAAK,mBAC9B,KAAK,YAAY,UAAU,KAAK,YAAY,SAC5C,KAAK,YAAY,aAAa,KAAK,YAAY,YAC/C,KAAK,YAAY,SAAS,KAAK,YAAY,QAC3C,KAAK,YAAY,eAAe,KAAK,YAAY;AACrD;AAEO,IAAM,8BAET,CAAC,EAAE,WAAW,MAAM;AACtB,QAAM,uBAAmB,2BAAW,CAAC,YAAY;AAC/C,QAAI,QAAQ,SAAS,OAAQ,QAAO;AACpC,WAAO,QAAQ,YAAY;AAAA,EAC7B,CAAC;AAED,SAAO,MAAM,KAAK,EAAE,QAAQ,iBAAiB,GAAG,CAAC,GAAG,UAClD;AAAA,IAAC;AAAA;AAAA,MAEC,iBAAiB;AAAA,MACjB;AAAA;AAAA,IAFK;AAAA,EAGP,CACD;AACH;AAEA,4BAA4B,cAAc;","names":[]}
|
@@ -21,9 +21,7 @@ var getComponent = (components, attachment) => {
|
|
21
21
|
}
|
22
22
|
};
|
23
23
|
var AttachmentComponent = ({ components }) => {
|
24
|
-
const Component = useMessageAttachment(
|
25
|
-
(a) => getComponent(components, a.attachment)
|
26
|
-
);
|
24
|
+
const Component = useMessageAttachment((a) => getComponent(components, a));
|
27
25
|
if (!Component) return null;
|
28
26
|
return /* @__PURE__ */ jsx(Component, {});
|
29
27
|
};
|
@@ -40,7 +38,7 @@ var MessageAttachment = memo(
|
|
40
38
|
(prev, next) => prev.attachmentIndex === next.attachmentIndex && prev.components?.Image === next.components?.Image && prev.components?.Document === next.components?.Document && prev.components?.File === next.components?.File && prev.components?.Attachment === next.components?.Attachment
|
41
39
|
);
|
42
40
|
var MessagePrimitiveAttachments = ({ components }) => {
|
43
|
-
const attachmentsCount = useMessage((
|
41
|
+
const attachmentsCount = useMessage((message) => {
|
44
42
|
if (message.role !== "user") return 0;
|
45
43
|
return message.attachments.length;
|
46
44
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/message/MessageAttachments.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentType, type FC, memo, useMemo } from \"react\";\nimport { useMessage, useMessageRuntime } from \"../../context\";\nimport { useMessageAttachment } from \"../../context/react/AttachmentContext\";\nimport { AttachmentRuntimeProvider } from \"../../context/providers/AttachmentRuntimeProvider\";\nimport { CompleteAttachment } from \"../../types\";\n\
|
1
|
+
{"version":3,"sources":["../../../src/primitives/message/MessageAttachments.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentType, type FC, memo, useMemo } from \"react\";\nimport { useMessage, useMessageRuntime } from \"../../context\";\nimport { useMessageAttachment } from \"../../context/react/AttachmentContext\";\nimport { AttachmentRuntimeProvider } from \"../../context/providers/AttachmentRuntimeProvider\";\nimport { CompleteAttachment } from \"../../types\";\n\nexport namespace MessagePrimitiveAttachments {\n export type Props = {\n components:\n | {\n Image?: ComponentType | undefined;\n Document?: ComponentType | undefined;\n File?: ComponentType | undefined;\n Attachment?: ComponentType | undefined;\n }\n | undefined;\n };\n}\n\nconst getComponent = (\n components: MessagePrimitiveAttachments.Props[\"components\"],\n attachment: CompleteAttachment,\n) => {\n const type = attachment.type;\n switch (type) {\n case \"image\":\n return components?.Image ?? components?.Attachment;\n case \"document\":\n return components?.Document ?? components?.Attachment;\n case \"file\":\n return components?.File ?? components?.Attachment;\n default:\n const _exhaustiveCheck: never = type;\n throw new Error(`Unknown attachment type: ${_exhaustiveCheck}`);\n }\n};\n\nconst AttachmentComponent: FC<{\n components: MessagePrimitiveAttachments.Props[\"components\"];\n}> = ({ components }) => {\n const Component = useMessageAttachment((a) => getComponent(components, a));\n\n if (!Component) return null;\n return <Component />;\n};\n\nconst MessageAttachmentImpl: FC<\n MessagePrimitiveAttachments.Props & { attachmentIndex: number }\n> = ({ components, attachmentIndex }) => {\n const messageRuntime = useMessageRuntime();\n const runtime = useMemo(\n () => messageRuntime.getAttachmentByIndex(attachmentIndex),\n [messageRuntime, attachmentIndex],\n );\n\n return (\n <AttachmentRuntimeProvider runtime={runtime}>\n <AttachmentComponent components={components} />\n </AttachmentRuntimeProvider>\n );\n};\n\nconst MessageAttachment = memo(\n MessageAttachmentImpl,\n (prev, next) =>\n prev.attachmentIndex === next.attachmentIndex &&\n prev.components?.Image === next.components?.Image &&\n prev.components?.Document === next.components?.Document &&\n prev.components?.File === next.components?.File &&\n prev.components?.Attachment === next.components?.Attachment,\n);\n\nexport const MessagePrimitiveAttachments: FC<\n MessagePrimitiveAttachments.Props\n> = ({ components }) => {\n const attachmentsCount = useMessage((message) => {\n if (message.role !== \"user\") return 0;\n return message.attachments.length;\n });\n\n return Array.from({ length: attachmentsCount }, (_, index) => (\n <MessageAttachment\n key={index}\n attachmentIndex={index}\n components={components}\n />\n ));\n};\n\nMessagePrimitiveAttachments.displayName = \"MessagePrimitive.Attachments\";\n"],"mappings":";;;AAEA,SAAiC,MAAM,eAAe;AACtD,SAAS,YAAY,yBAAyB;AAC9C,SAAS,4BAA4B;AACrC,SAAS,iCAAiC;AAwCjC;AAxBT,IAAM,eAAe,CACnB,YACA,eACG;AACH,QAAM,OAAO,WAAW;AACxB,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO,YAAY,SAAS,YAAY;AAAA,IAC1C,KAAK;AACH,aAAO,YAAY,YAAY,YAAY;AAAA,IAC7C,KAAK;AACH,aAAO,YAAY,QAAQ,YAAY;AAAA,IACzC;AACE,YAAM,mBAA0B;AAChC,YAAM,IAAI,MAAM,4BAA4B,gBAAgB,EAAE;AAAA,EAClE;AACF;AAEA,IAAM,sBAED,CAAC,EAAE,WAAW,MAAM;AACvB,QAAM,YAAY,qBAAqB,CAAC,MAAM,aAAa,YAAY,CAAC,CAAC;AAEzE,MAAI,CAAC,UAAW,QAAO;AACvB,SAAO,oBAAC,aAAU;AACpB;AAEA,IAAM,wBAEF,CAAC,EAAE,YAAY,gBAAgB,MAAM;AACvC,QAAM,iBAAiB,kBAAkB;AACzC,QAAM,UAAU;AAAA,IACd,MAAM,eAAe,qBAAqB,eAAe;AAAA,IACzD,CAAC,gBAAgB,eAAe;AAAA,EAClC;AAEA,SACE,oBAAC,6BAA0B,SACzB,8BAAC,uBAAoB,YAAwB,GAC/C;AAEJ;AAEA,IAAM,oBAAoB;AAAA,EACxB;AAAA,EACA,CAAC,MAAM,SACL,KAAK,oBAAoB,KAAK,mBAC9B,KAAK,YAAY,UAAU,KAAK,YAAY,SAC5C,KAAK,YAAY,aAAa,KAAK,YAAY,YAC/C,KAAK,YAAY,SAAS,KAAK,YAAY,QAC3C,KAAK,YAAY,eAAe,KAAK,YAAY;AACrD;AAEO,IAAM,8BAET,CAAC,EAAE,WAAW,MAAM;AACtB,QAAM,mBAAmB,WAAW,CAAC,YAAY;AAC/C,QAAI,QAAQ,SAAS,OAAQ,QAAO;AACpC,WAAO,QAAQ,YAAY;AAAA,EAC7B,CAAC;AAED,SAAO,MAAM,KAAK,EAAE,QAAQ,iBAAiB,GAAG,CAAC,GAAG,UAClD;AAAA,IAAC;AAAA;AAAA,MAEC,iBAAiB;AAAA,MACjB;AAAA;AAAA,IAFK;AAAA,EAGP,CACD;AACH;AAEA,4BAA4B,cAAc;","names":[]}
|
@@ -1,9 +1,5 @@
|
|
1
1
|
import { type ComponentType, type FC } from "react";
|
2
2
|
import type { Unstable_AudioContentPartComponent, EmptyContentPartComponent, ImageContentPartComponent, TextContentPartComponent, ToolCallContentPartComponent, ToolCallContentPartProps, UIContentPartComponent } from "../../types/ContentPartComponentTypes";
|
3
|
-
/**
|
4
|
-
* @deprecated Use `MessagePrimitive.Content.Props` instead. This will be removed in 0.6.
|
5
|
-
*/
|
6
|
-
export type MessagePrimitiveContentProps = MessagePrimitiveContent.Props;
|
7
3
|
export declare namespace MessagePrimitiveContent {
|
8
4
|
type Props = {
|
9
5
|
components?: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MessageContent.d.ts","sourceRoot":"","sources":["../../../src/primitives/message/MessageContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,EAAE,EAAiB,MAAM,OAAO,CAAC;AAcnE,OAAO,KAAK,EACV,kCAAkC,EAClC,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,EAC5B,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,uCAAuC,CAAC;AAI/C
|
1
|
+
{"version":3,"file":"MessageContent.d.ts","sourceRoot":"","sources":["../../../src/primitives/message/MessageContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,EAAE,EAAiB,MAAM,OAAO,CAAC;AAcnE,OAAO,KAAK,EACV,kCAAkC,EAClC,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,EAC5B,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,uCAAuC,CAAC;AAI/C,yBAAiB,uBAAuB,CAAC;IACvC,KAAY,KAAK,GAAG;QAClB,UAAU,CAAC,EACP;YACE,KAAK,CAAC,EAAE,yBAAyB,GAAG,SAAS,CAAC;YAC9C,IAAI,CAAC,EAAE,wBAAwB,GAAG,SAAS,CAAC;YAC5C,KAAK,CAAC,EAAE,yBAAyB,GAAG,SAAS,CAAC;YAC9C,cAAc,CAAC,EAAE,kCAAkC,GAAG,SAAS,CAAC;YAChE,EAAE,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAC;YACxC,KAAK,CAAC,EACF;gBACE,OAAO,CAAC,EACJ,MAAM,CAAC,MAAM,EAAE,4BAA4B,GAAG,SAAS,CAAC,GACxD,SAAS,CAAC;gBACd,QAAQ,CAAC,EAAE,aAAa,CAAC,wBAAwB,CAAC,GAAG,SAAS,CAAC;aAChE,GACD,SAAS,CAAC;SACf,GACD,SAAS,CAAC;KACf,CAAC;CACH;AAgHD,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,uBAAuB,CAAC,KAAK,CAQrE,CAAC"}
|
@@ -67,22 +67,22 @@ var MessageContentPartComponent = ({
|
|
67
67
|
if (type === "tool-call") {
|
68
68
|
const Tool = by_name[part.toolName] || Fallback;
|
69
69
|
const addResult = (result) => contentPartRuntime.addToolResult(result);
|
70
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolUIDisplay, { ...part,
|
70
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolUIDisplay, { ...part, UI: Tool, addResult });
|
71
71
|
}
|
72
72
|
if (part.status.type === "requires-action")
|
73
73
|
throw new Error("Encountered unexpected requires-action status");
|
74
74
|
switch (type) {
|
75
75
|
case "text":
|
76
|
-
if (part
|
76
|
+
if (part[import_MessageRuntime.EMPTY_CONTENT_SYMBOL] && !!Empty) {
|
77
77
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Empty, { status: part.status });
|
78
78
|
}
|
79
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { ...part
|
79
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { ...part });
|
80
80
|
case "image":
|
81
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Image, { ...part
|
81
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Image, { ...part });
|
82
82
|
case "audio":
|
83
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Audio, { ...part
|
83
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Audio, { ...part });
|
84
84
|
case "ui":
|
85
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UI, { ...part
|
85
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UI, { ...part });
|
86
86
|
default:
|
87
87
|
const unhandledType = type;
|
88
88
|
throw new Error(`Unknown content part type: ${unhandledType}`);
|