@assistant-ui/react-native 0.1.45 → 0.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +13 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/primitives/actionBar/ActionBarCopy.d.ts +2 -2
- package/dist/primitives/actionBar/ActionBarCopy.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.js +2 -1
- package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts +2 -2
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js +2 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts +2 -2
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js +2 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
- package/dist/primitives/composer/ComposerInput.d.ts +1 -1
- package/dist/primitives/composer/ComposerInput.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerInput.js +55 -38
- package/dist/primitives/composer/ComposerInput.js.map +1 -1
- package/dist/primitives/message/MessageContent.d.ts.map +1 -1
- package/dist/primitives/message/MessageContent.js +13 -10
- package/dist/primitives/message/MessageContent.js.map +1 -1
- package/dist/primitives/message/MessageParts.d.ts +1 -0
- package/dist/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/primitives/message/MessageParts.js +22 -3
- package/dist/primitives/message/MessageParts.js.map +1 -1
- package/dist/primitives/message.d.ts +1 -0
- package/dist/primitives/message.d.ts.map +1 -1
- package/dist/primitives/message.js +4 -3
- package/dist/primitives/message.js.map +1 -1
- package/dist/primitives/messagePart.js +1 -1
- package/dist/primitives/thread/ThreadMessages.d.ts +7 -5
- package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadMessages.js +109 -376
- package/dist/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/primitives/thread/ThreadRowsFlatList.d.ts +29 -0
- package/dist/primitives/thread/ThreadRowsFlatList.d.ts.map +1 -0
- package/dist/primitives/thread/ThreadRowsFlatList.js +226 -0
- package/dist/primitives/thread/ThreadRowsFlatList.js.map +1 -0
- package/dist/primitives/thread/flatListScroll.d.ts +52 -0
- package/dist/primitives/thread/flatListScroll.d.ts.map +1 -0
- package/dist/primitives/thread/flatListScroll.js +380 -0
- package/dist/primitives/thread/flatListScroll.js.map +1 -0
- package/dist/primitives/thread.d.ts +2 -0
- package/dist/primitives/thread.d.ts.map +1 -1
- package/dist/primitives/thread.js +5 -2
- package/dist/primitives/thread.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTitle.d.ts +10 -0
- package/dist/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemTitle.js +47 -0
- package/dist/primitives/threadListItem/ThreadListItemTitle.js.map +1 -0
- package/dist/primitives/threadListItem.d.ts +1 -1
- package/dist/primitives/threadListItem.d.ts.map +1 -1
- package/dist/primitives/threadListItem.js +3 -3
- package/dist/primitives/threadListItem.js.map +1 -1
- package/package.json +8 -7
- package/src/index.ts +22 -1
- package/src/primitives/actionBar/ActionBar.test.tsx +45 -0
- package/src/primitives/actionBar/ActionBarCopy.tsx +12 -3
- package/src/primitives/actionBar/ActionBarFeedbackNegative.tsx +13 -3
- package/src/primitives/actionBar/ActionBarFeedbackPositive.tsx +13 -3
- package/src/primitives/composer/ComposerInput.test.tsx +64 -4
- package/src/primitives/composer/ComposerInput.tsx +13 -2
- package/src/primitives/message/MessageContent.runtime.test.tsx +35 -0
- package/src/primitives/message/MessageContent.test.tsx +68 -4
- package/src/primitives/message/MessageContent.tsx +19 -9
- package/src/primitives/message/MessageParts.test.tsx +68 -1
- package/src/primitives/message/MessageParts.tsx +17 -1
- package/src/primitives/message.test.tsx +74 -0
- package/src/primitives/message.ts +1 -0
- package/src/primitives/thread/ThreadMessages.test.tsx +28 -1
- package/src/primitives/thread/ThreadMessages.tsx +49 -343
- package/src/primitives/thread/ThreadRowsFlatList.test.tsx +253 -0
- package/src/primitives/thread/ThreadRowsFlatList.tsx +159 -0
- package/src/primitives/thread/flatListScroll.ts +467 -0
- package/src/primitives/thread.ts +5 -0
- package/src/primitives/threadListItem/ThreadListItemTitle.test.tsx +164 -0
- package/src/primitives/threadListItem/ThreadListItemTitle.tsx +23 -0
- package/src/primitives/threadListItem.ts +4 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="@assistant-ui/core/react" preserve="true" />
|
|
2
|
-
export type { ThreadMessage, ThreadUserMessage, ThreadAssistantMessage, ThreadSystemMessage, MessageStatus, MessageRole, ThreadMessageLike, AppendMessage, RunConfig, TextMessagePart, ReasoningMessagePart, SourceMessagePart, RespondToToolApprovalOptions, ToolApprovalDisplay, ToolApprovalOption, ToolApprovalOptionKind, ToolApprovalResponse, ToolCallMessagePart, ToolCallMessagePartStatus, ToolCallTiming, ToolModelContentPart, ImageMessagePart, FileMessagePart, DataMessagePart, Unstable_AudioMessagePart, ThreadUserMessagePart, ThreadAssistantMessagePart, AssistantRuntime, ThreadRuntime, ThreadRuntimeState, MessageRuntime, MessageRuntimeState, ThreadComposerRuntime, EditComposerRuntime, ComposerRuntime, ComposerRuntimeState, ThreadListRuntime, ThreadListItemRuntime, ThreadListItemRuntimeState, ChatModelAdapter, ChatModelRunOptions, ChatModelRunResult, RuntimeCapabilities, Attachment, PendingAttachment, CompleteAttachment, CreateAttachment, AttachmentRuntime, AttachmentRuntimeState, AttachmentAdapter, ThreadHistoryAdapter, FeedbackAdapter, RealtimeVoiceAdapter, VoiceSessionControls, VoiceSessionHelpers, SuggestionAdapter, SuggestionAdapterGenerateOptions, CreateSuggestionAdapterOptions, Unsubscribe, } from "@assistant-ui/core";
|
|
2
|
+
export type { ThreadMessage, ThreadUserMessage, ThreadAssistantMessage, ThreadSystemMessage, MessageStatus, MessageRole, ThreadMessageLike, AppendMessage, RunConfig, TextMessagePart, ReasoningMessagePart, SourceMessagePart, RespondToToolApprovalOptions, ToolApprovalDisplay, ToolApprovalOption, ToolApprovalOptionKind, ToolApprovalAnswer, ToolApprovalQuestion, ToolApprovalQuestionOption, ToolApprovalResponse, ToolCallMessagePart, ToolCallMessagePartStatus, MessagePartTiming, ToolCallTiming, ToolModelContentPart, ImageMessagePart, FileMessagePart, DataMessagePart, Unstable_AudioMessagePart, ThreadUserMessagePart, ThreadAssistantMessagePart, AssistantRuntime, ThreadRuntime, ThreadRuntimeState, MessageRuntime, MessageRuntimeState, ThreadComposerRuntime, EditComposerRuntime, ComposerRuntime, ComposerRuntimeState, ThreadListRuntime, ThreadListItemRuntime, ThreadListItemRuntimeState, ChatModelAdapter, ChatModelRunOptions, ChatModelRunResult, RuntimeCapabilities, Attachment, PendingAttachment, CompleteAttachment, CreateAttachment, AttachmentRuntime, AttachmentRuntimeState, AttachmentAdapter, ThreadHistoryAdapter, FeedbackAdapter, RealtimeVoiceAdapter, VoiceSessionControls, VoiceSessionHelpers, SuggestionAdapter, SuggestionAdapterGenerateOptions, CreateSuggestionAdapterOptions, Unsubscribe, } from "@assistant-ui/core";
|
|
3
3
|
export type { RemoteThreadListAdapter, RemoteThreadListOptions, RemoteThreadListProviderComponent, } from "@assistant-ui/core";
|
|
4
4
|
export { InMemoryThreadListAdapter } from "@assistant-ui/core";
|
|
5
5
|
export { createVoiceSession, toolApprovalAcceptsText, } from "@assistant-ui/core";
|
|
@@ -13,7 +13,15 @@ export { RuntimeAdapterProvider, useRuntimeAdapters, type RuntimeAdapters, } fro
|
|
|
13
13
|
export { useLocalRuntime, type LocalRuntimeOptions, } from "./runtimes/useLocalRuntime.js";
|
|
14
14
|
export { useRemoteThreadListRuntime } from "./runtimes/useRemoteThreadListRuntime.js";
|
|
15
15
|
export { getExternalStoreMessages, bindExternalStoreMessage, pickExternalStoreSharedOptions, createMessageQueue, MessageNotSentError, isMessageNotSentError, type ExternalStoreAdapter, type ExternalStoreMessageConverter, type ExternalStoreSharedOptions, type ExternalStoreThreadListAdapter, type ExternalStoreThreadData, type ExternalStoreBranchChange, type ExternalThreadQueueAdapter, type ExternalThreadBranchAdapter, type MessageQueueDriver, type MessageQueueController, } from "@assistant-ui/core";
|
|
16
|
-
export { useExternalStoreRuntime, useExternalStoreSharedOptions, useExternalMessageConverter,
|
|
16
|
+
export { useExternalStoreRuntime, useExternalStoreSharedOptions, useExternalMessageConverter,
|
|
17
|
+
/** @deprecated Experimental since 2025-01-26. Not scheduled for removal; the API may change in any release. */
|
|
18
|
+
convertExternalMessages as unstable_convertExternalMessages,
|
|
19
|
+
/** @deprecated Experimental since 2026-09-15. Not scheduled for removal; the API may change in any release. */
|
|
20
|
+
createExternalMessageConversionCache as unstable_createExternalMessageConversionCache,
|
|
21
|
+
/** @deprecated Experimental since 2025-02-02. Not scheduled for removal; the API may change in any release. */
|
|
22
|
+
createMessageConverter as unstable_createMessageConverter,
|
|
23
|
+
/** @deprecated Experimental since 2026-09-15. Not scheduled for removal; the API may change in any release. */
|
|
24
|
+
type ExternalMessageConversionCache as Unstable_ExternalMessageConversionCache, type JoinStrategy, } from "@assistant-ui/core/react";
|
|
17
25
|
export * as ThreadPrimitive from "./primitives/thread.js";
|
|
18
26
|
export * as ComposerPrimitive from "./primitives/composer.js";
|
|
19
27
|
export * as QueueItemPrimitive from "./primitives/queueItem.js";
|
|
@@ -28,6 +36,7 @@ export * as ChainOfThoughtPrimitive from "./primitives/chainOfThought.js";
|
|
|
28
36
|
export * as SuggestionPrimitive from "./primitives/suggestion.js";
|
|
29
37
|
export * as ErrorPrimitive from "./primitives/error/index.js";
|
|
30
38
|
export { groupPartByType, type GroupByContext } from "@assistant-ui/core/react";
|
|
39
|
+
export { createThreadRowsSelector, type ThreadRow, type ThreadRowsOptions, } from "@assistant-ui/core/react";
|
|
31
40
|
export { unstable_useThreadMessageIds } from "@assistant-ui/core/react";
|
|
32
41
|
export { ThreadListItemByIndexProvider, ThreadListItemRuntimeProvider, ChainOfThoughtByIndicesProvider, MessageByIndexProvider, MessageAttachmentByIndexProvider, ComposerAttachmentByIndexProvider, PartByIndexProvider, TextMessagePartProvider, ChainOfThoughtPartByIndexProvider, SuggestionByIndexProvider, ReadonlyThreadProvider, } from "@assistant-ui/core/react";
|
|
33
42
|
export { makeAssistantTool, type AssistantTool, makeAssistantToolUI, type AssistantToolUI, makeAssistantDataUI, type AssistantDataUI, useAssistantTool, type AssistantToolProps, useAssistantToolUI, type AssistantToolUIProps, useAssistantDataUI, type AssistantDataUIProps, useAssistantInstructions, useAssistantContext, type AssistantContextConfig, useInlineRender, type Toolkit, type ToolDefinition, type ToolkitDefinition, type ToolkitDefinitionEntry, type ToolCallText, defineToolkit, stubTool, externalTool, useAuiToolOverrides, hitl, hitlTool, humanTool, providerTool, type ProviderToolConfig, defineMcpToolkit, type McpToolkitEntry, type McpToolkitDefinition, type McpToolkitToolConfig, Tools, DataRenderers, Interactables, useAssistantInteractable, type AssistantInteractableProps, useInteractableState, unstable_Interactables, unstable_useInteractable, type Unstable_InteractableConfig, type Unstable_InferInteractableState, type Unstable_InteractableVersionInfo, unstable_useInteractableState, unstable_useInteractableVersions, unstable_interactableTool, type Unstable_InteractableToolConfig, type Unstable_InteractableToolRenderProps, type Unstable_InteractableStateSchema, type Unstable_InteractablesState, type Unstable_InteractableDefinition, type Unstable_InteractableRegistration, type Unstable_InteractablesMethods, type Unstable_InteractablePersistedState, type Unstable_InteractablePersistenceAdapter, type Unstable_InteractablePersistenceStatus, type Unstable_InteractablesClientSchema, type Unstable_InteractablesConfig, useToolArgsStatus, type ToolArgsStatus, } from "@assistant-ui/core/react";
|
|
@@ -49,6 +58,6 @@ export type { AssistantTransportProtocol, EnrichedPartState, GenerativeUICompone
|
|
|
49
58
|
export { CloudFileAttachmentAdapter, createSimpleTitleAdapter, GenerativeUIRender, GenerativeUIRenderError, useCloudThreadListAdapter, useCloudThreadListRuntime, } from "@assistant-ui/core/react";
|
|
50
59
|
export type { ComposerSendOptions, ExternalThreadMessage, ExternalThreadProps, InMemoryThreadListProps, QueueItemMethods, RemoteThreadListProps, TaskMethods, } from "@assistant-ui/core/store";
|
|
51
60
|
export { ExternalThread, InMemoryThreadList, RemoteThreadList, SingleThreadList, } from "@assistant-ui/core/store";
|
|
52
|
-
export type { AddToolResultOptions, AttachmentStatus, ChatModelRunUpdate, CreateAppendMessage, CreateResumeRunConfig, CreateStartRunConfig, ComposerSubmission, DictationAdapter, DictationState, EditComposerState, GenerativeUIMessagePart, GenerativeUINode, GenerativeUISpec, GenericThreadHistoryAdapter, LocalRuntimeOptionsBase, McpAppMetadata, MessageFormatAdapter, MessageFormatItem, MessageFormatRepository, MessageModality, MessagePartRuntime, MessagePartState, MessagePartStatus, MessagePartStreamStatus, MessageStorageEntry, MessageTiming, PartProviderMetadata, QuoteInfo, SourceProviderMetadata, SpeechSynthesisAdapter, SubmitFeedbackOptions, ThreadComposerState, ThreadListItemStatus, ThreadListState, ThreadSuggestion, ToolCallMessagePartMcpMetadata, ToolExecutionStatus, Unstable_DirectiveFormatter, Unstable_DirectiveSegment, Unstable_TriggerItem, VoiceSessionState, } from "@assistant-ui/core";
|
|
53
|
-
export { unstable_defaultDirectiveFormatter } from "@assistant-ui/core";
|
|
61
|
+
export type { AddToolResultOptions, AttachmentStatus, ChatModelRunUpdate, CreateAppendMessage, CreateResumeRunConfig, CreateStartRunConfig, ComposerSubmission, DictationAdapter, DictationState, EditComposerState, GenerativeUIMessagePart, GenerativeUINode, GenerativeUISpec, GenericThreadHistoryAdapter, LocalRuntimeOptionsBase, McpAppMetadata, MessageFormatAdapter, MessageFormatItem, MessageFormatRepository, MessageModality, MessagePartRuntime, MessagePartState, MessagePartStatus, MessagePartStreamStatus, MessageStorageEntry, MessageTiming, PartProviderMetadata, QuoteInfo, SourceProviderMetadata, SpeechSynthesisAdapter, SubmitFeedbackOptions, ThreadComposerState, ThreadListItemStatus, ThreadListState, ThreadSuggestion, ToolCallMessagePartMcpMetadata, ToolExecutionStatus, DirectiveFormatter, DirectiveSegment, TriggerAdapter, TriggerCategory, TriggerItem, Unstable_DirectiveFormatter, Unstable_DirectiveSegment, Unstable_TriggerItem, VoiceSessionState, } from "@assistant-ui/core";
|
|
62
|
+
export { defaultDirectiveFormatter, unstable_defaultDirectiveFormatter, } from "@assistant-ui/core";
|
|
54
63
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAGA,YAAY,EAEV,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,SAAS,EAET,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,4BAA4B,EAC5B,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,qBAAqB,EACrB,0BAA0B,EAE1B,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAE1B,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EAEnB,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EAEtB,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,oBA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AAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,uBAAuB,EACvB,6BAA6B,EAC7B,2BAA2B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAGA,YAAY,EAEV,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,SAAS,EAET,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,4BAA4B,EAC5B,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,qBAAqB,EACrB,0BAA0B,EAE1B,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAE1B,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EAEnB,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EAEtB,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,gCAAgC,EAChC,8BAA8B,EAE9B,W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 +14,8 @@ import { threadListItem_exports } from "./primitives/threadListItem.js";
|
|
|
14
14
|
import { chainOfThought_exports } from "./primitives/chainOfThought.js";
|
|
15
15
|
import { suggestion_exports } from "./primitives/suggestion.js";
|
|
16
16
|
import { error_exports } from "./primitives/error/index.js";
|
|
17
|
-
import { ChainOfThoughtByIndicesProvider, ChainOfThoughtPartByIndexProvider, CloudFileAttachmentAdapter, ComposerAttachmentByIndexProvider, DataRenderers, GenerativeUIRender, GenerativeUIRenderError, Interactables, MessageAttachmentByIndexProvider, MessageByIndexProvider, PartByIndexProvider, ReadonlyThreadProvider, RuntimeAdapterProvider, SuggestionByIndexProvider, TextMessagePartProvider, ThreadListItemByIndexProvider, ThreadListItemRuntimeProvider, Tools, convertExternalMessages as unstable_convertExternalMessages, createExternalMessageConversionCache as unstable_createExternalMessageConversionCache, createMessageConverter as unstable_createMessageConverter, createSimpleTitleAdapter, defineMcpToolkit, defineToolkit, externalTool, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, providerTool, stubTool, unstable_Interactables, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAuiToolOverrides, useCloudThreadListAdapter, useCloudThreadListRuntime, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume } from "@assistant-ui/core/react";
|
|
18
|
-
import { CompositeAttachmentAdapter, ExportedMessageRepository, InMemoryThreadListAdapter, MessageNotSentError, ModelContextRegistry, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, bindExternalStoreMessage, createMessageQueue, createSuggestionAdapter, createVoiceSession, fromThreadMessageLike, generateId, getExternalStoreMessages, isMessageNotSentError, mergeModelContexts, pickExternalStoreSharedOptions, tool, toolApprovalAcceptsText, unstable_defaultDirectiveFormatter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions } from "@assistant-ui/core";
|
|
17
|
+
import { ChainOfThoughtByIndicesProvider, ChainOfThoughtPartByIndexProvider, CloudFileAttachmentAdapter, ComposerAttachmentByIndexProvider, DataRenderers, GenerativeUIRender, GenerativeUIRenderError, Interactables, MessageAttachmentByIndexProvider, MessageByIndexProvider, PartByIndexProvider, ReadonlyThreadProvider, RuntimeAdapterProvider, SuggestionByIndexProvider, TextMessagePartProvider, ThreadListItemByIndexProvider, ThreadListItemRuntimeProvider, Tools, convertExternalMessages as unstable_convertExternalMessages, createExternalMessageConversionCache as unstable_createExternalMessageConversionCache, createMessageConverter as unstable_createMessageConverter, createSimpleTitleAdapter, createThreadRowsSelector, defineMcpToolkit, defineToolkit, externalTool, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, providerTool, stubTool, unstable_Interactables, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAuiToolOverrides, useCloudThreadListAdapter, useCloudThreadListRuntime, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume } from "@assistant-ui/core/react";
|
|
18
|
+
import { CompositeAttachmentAdapter, ExportedMessageRepository, InMemoryThreadListAdapter, MessageNotSentError, ModelContextRegistry, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, bindExternalStoreMessage, createMessageQueue, createSuggestionAdapter, createVoiceSession, defaultDirectiveFormatter, fromThreadMessageLike, generateId, getExternalStoreMessages, isMessageNotSentError, mergeModelContexts, pickExternalStoreSharedOptions, tool, toolApprovalAcceptsText, unstable_defaultDirectiveFormatter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions } from "@assistant-ui/core";
|
|
19
19
|
import { AuiConfig, AuiIf, AuiProvider, useAui, useAuiEvent, useAuiState } from "@assistant-ui/store";
|
|
20
20
|
import { ChainOfThoughtClient, ExternalThread, InMemoryThreadList, ModelContext as ModelContextClient, RemoteThreadList, SingleThreadList, Suggestions } from "@assistant-ui/core/store";
|
|
21
|
-
export { actionBar_exports as ActionBarPrimitive, AssistantRuntimeProvider, attachment_exports as AttachmentPrimitive, AuiConfig, AuiIf, AuiProvider, branchPicker_exports as BranchPickerPrimitive, ChainOfThoughtByIndicesProvider, ChainOfThoughtClient, ChainOfThoughtPartByIndexProvider, chainOfThought_exports as ChainOfThoughtPrimitive, CloudFileAttachmentAdapter, ComposerAttachmentByIndexProvider, composer_exports as ComposerPrimitive, CompositeAttachmentAdapter, DataRenderers, error_exports as ErrorPrimitive, ExportedMessageRepository, ExternalThread, GenerativeUIRender, GenerativeUIRenderError, InMemoryThreadList, InMemoryThreadListAdapter, Interactables, MessageAttachmentByIndexProvider, MessageByIndexProvider, MessageNotSentError, messagePart_exports as MessagePartPrimitive, message_exports as MessagePrimitive, ModelContextClient, ModelContextRegistry, PartByIndexProvider, queueItem_exports as QueueItemPrimitive, ReadonlyThreadProvider, RemoteThreadList, RuntimeAdapterProvider, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SingleThreadList, SuggestionByIndexProvider, suggestion_exports as SuggestionPrimitive, Suggestions, TextMessagePartProvider, ThreadListItemByIndexProvider, threadListItem_exports as ThreadListItemPrimitive, ThreadListItemRuntimeProvider, threadList_exports as ThreadListPrimitive, thread_exports as ThreadPrimitive, Tools, bindExternalStoreMessage, createMessageQueue, createSimpleTitleAdapter, createSuggestionAdapter, createVoiceSession, defineMcpToolkit, defineToolkit, externalTool, fromThreadMessageLike, generateId, getExternalStoreMessages, groupPartByType, hitl, hitlTool, humanTool, isMessageNotSentError, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, mergeModelContexts, pickExternalStoreSharedOptions, providerTool, stubTool, tool, toolApprovalAcceptsText, unstable_Interactables, unstable_convertExternalMessages, unstable_createExternalMessageConversionCache, unstable_createMessageConverter, unstable_defaultDirectiveFormatter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAui, useAuiEvent, useAuiState, useAuiToolOverrides, useCloudThreadListAdapter, useCloudThreadListRuntime, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useLocalRuntime, useRemoteThreadListRuntime, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume };
|
|
21
|
+
export { actionBar_exports as ActionBarPrimitive, AssistantRuntimeProvider, attachment_exports as AttachmentPrimitive, AuiConfig, AuiIf, AuiProvider, branchPicker_exports as BranchPickerPrimitive, ChainOfThoughtByIndicesProvider, ChainOfThoughtClient, ChainOfThoughtPartByIndexProvider, chainOfThought_exports as ChainOfThoughtPrimitive, CloudFileAttachmentAdapter, ComposerAttachmentByIndexProvider, composer_exports as ComposerPrimitive, CompositeAttachmentAdapter, DataRenderers, error_exports as ErrorPrimitive, ExportedMessageRepository, ExternalThread, GenerativeUIRender, GenerativeUIRenderError, InMemoryThreadList, InMemoryThreadListAdapter, Interactables, MessageAttachmentByIndexProvider, MessageByIndexProvider, MessageNotSentError, messagePart_exports as MessagePartPrimitive, message_exports as MessagePrimitive, ModelContextClient, ModelContextRegistry, PartByIndexProvider, queueItem_exports as QueueItemPrimitive, ReadonlyThreadProvider, RemoteThreadList, RuntimeAdapterProvider, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SingleThreadList, SuggestionByIndexProvider, suggestion_exports as SuggestionPrimitive, Suggestions, TextMessagePartProvider, ThreadListItemByIndexProvider, threadListItem_exports as ThreadListItemPrimitive, ThreadListItemRuntimeProvider, threadList_exports as ThreadListPrimitive, thread_exports as ThreadPrimitive, Tools, bindExternalStoreMessage, createMessageQueue, createSimpleTitleAdapter, createSuggestionAdapter, createThreadRowsSelector, createVoiceSession, defaultDirectiveFormatter, defineMcpToolkit, defineToolkit, externalTool, fromThreadMessageLike, generateId, getExternalStoreMessages, groupPartByType, hitl, hitlTool, humanTool, isMessageNotSentError, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, mergeModelContexts, pickExternalStoreSharedOptions, providerTool, stubTool, tool, toolApprovalAcceptsText, unstable_Interactables, unstable_convertExternalMessages, unstable_createExternalMessageConversionCache, unstable_createMessageConverter, unstable_defaultDirectiveFormatter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAui, useAuiEvent, useAuiState, useAuiToolOverrides, useCloudThreadListAdapter, useCloudThreadListRuntime, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useLocalRuntime, useRemoteThreadListRuntime, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import { type PressableProps } from "react-native";
|
|
2
|
+
import { type PressableProps, type PressableStateCallbackType } from "react-native";
|
|
3
3
|
import { type UseActionBarCopyOptions } from "@assistant-ui/core/react";
|
|
4
4
|
export type ActionBarCopyProps = Omit<PressableProps, "onPress" | "children"> & UseActionBarCopyOptions & {
|
|
5
|
-
children: ReactNode | ((props: {
|
|
5
|
+
children: ReactNode | ((props: PressableStateCallbackType & {
|
|
6
6
|
isCopied: boolean;
|
|
7
7
|
disabled: boolean;
|
|
8
8
|
}) => ReactNode);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBarCopy.d.ts","sourceRoot":"","sources":["../../../src/primitives/actionBar/ActionBarCopy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"ActionBarCopy.d.ts","sourceRoot":"","sources":["../../../src/primitives/actionBar/ActionBarCopy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,0BAA0B,EAChC,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,0BAA0B,CAAC;AAElC,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,UAAU,CAAC,GAC3E,uBAAuB,GAAG;IACxB,QAAQ,EACJ,SAAS,GACT,CAAC,CACC,KAAK,EAAE,0BAA0B,GAAG;QAClC,QAAQ,EAAE,OAAO,CAAC;QAClB,QAAQ,EAAE,OAAO,CAAC;KACnB,KACE,SAAS,CAAC,CAAC;CACrB,CAAC;AAEJ,eAAO,MAAM,aAAa,GAAI,0FAM3B,kBAAkB,gCAmBpB,CAAC"}
|
|
@@ -39,7 +39,8 @@ const ActionBarCopy = (t0) => {
|
|
|
39
39
|
const isDisabled = disabledProp ?? disabled;
|
|
40
40
|
let t2;
|
|
41
41
|
if ($[9] !== children || $[10] !== isCopied || $[11] !== isDisabled) {
|
|
42
|
-
t2 = typeof children === "function" ? children({
|
|
42
|
+
t2 = typeof children === "function" ? (state) => children({
|
|
43
|
+
...state,
|
|
43
44
|
isCopied,
|
|
44
45
|
disabled: isDisabled
|
|
45
46
|
}) : children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBarCopy.js","names":["ReactNode","Pressable","PressableProps","useActionBarCopy","UseActionBarCopyOptions","ActionBarCopyProps","Omit","children","props","isCopied","disabled","ActionBarCopy","t0","$","_c","copiedDuration","copyToClipboard","disabledProp","pressableProps","t1","copy","isDisabled","t2","t3","_c"],"sources":["../../../src/primitives/actionBar/ActionBarCopy.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"ActionBarCopy.js","names":["ReactNode","Pressable","PressableProps","PressableStateCallbackType","useActionBarCopy","UseActionBarCopyOptions","ActionBarCopyProps","Omit","children","props","isCopied","disabled","ActionBarCopy","t0","$","_c","copiedDuration","copyToClipboard","disabledProp","pressableProps","t1","copy","isDisabled","t2","state","t3","_c"],"sources":["../../../src/primitives/actionBar/ActionBarCopy.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n Pressable,\n type PressableProps,\n type PressableStateCallbackType,\n} from \"react-native\";\nimport {\n useActionBarCopy,\n type UseActionBarCopyOptions,\n} from \"@assistant-ui/core/react\";\n\nexport type ActionBarCopyProps = Omit<PressableProps, \"onPress\" | \"children\"> &\n UseActionBarCopyOptions & {\n children:\n | ReactNode\n | ((\n props: PressableStateCallbackType & {\n isCopied: boolean;\n disabled: boolean;\n },\n ) => ReactNode);\n };\n\nexport const ActionBarCopy = ({\n children,\n disabled: disabledProp,\n copiedDuration,\n copyToClipboard,\n ...pressableProps\n}: ActionBarCopyProps) => {\n const { copy, disabled, isCopied } = useActionBarCopy({\n copiedDuration,\n copyToClipboard,\n });\n const isDisabled = disabledProp ?? disabled;\n\n return (\n <Pressable\n onPress={copy}\n disabled={isDisabled}\n accessibilityRole=\"button\"\n {...pressableProps}\n >\n {typeof children === \"function\"\n ? (state) => children({ ...state, isCopied, disabled: isDisabled })\n : children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;AAuBA,MAAaY,iBAAgBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAP;CAAA,I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,MAAAQ;EAAAR,EAAA,MAAAK;EAAAL,EAAA,MAAAS;EAAAT,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OATZW;AASY"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import { type PressableProps } from "react-native";
|
|
2
|
+
import { type PressableProps, type PressableStateCallbackType } from "react-native";
|
|
3
3
|
export type ActionBarFeedbackNegativeProps = Omit<PressableProps, "onPress" | "children"> & {
|
|
4
|
-
children: ReactNode | ((props: {
|
|
4
|
+
children: ReactNode | ((props: PressableStateCallbackType & {
|
|
5
5
|
isSubmitted: boolean;
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
}) => ReactNode);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBarFeedbackNegative.d.ts","sourceRoot":"","sources":["../../../src/primitives/actionBar/ActionBarFeedbackNegative.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"ActionBarFeedbackNegative.d.ts","sourceRoot":"","sources":["../../../src/primitives/actionBar/ActionBarFeedbackNegative.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,0BAA0B,EAChC,MAAM,cAAc,CAAC;AAGtB,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAC/C,cAAc,EACd,SAAS,GAAG,UAAU,CACvB,GAAG;IACF,QAAQ,EACJ,SAAS,GACT,CAAC,CACC,KAAK,EAAE,0BAA0B,GAAG;QAClC,WAAW,EAAE,OAAO,CAAC;QACrB,QAAQ,EAAE,OAAO,CAAC;KACnB,KACE,SAAS,CAAC,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,yDAIvC,8BAA8B,gCAmBhC,CAAC"}
|
|
@@ -29,7 +29,8 @@ const ActionBarFeedbackNegative = (t0) => {
|
|
|
29
29
|
} else t1 = $[5];
|
|
30
30
|
let t2;
|
|
31
31
|
if ($[6] !== children || $[7] !== disabled || $[8] !== isSubmitted) {
|
|
32
|
-
t2 = typeof children === "function" ? children({
|
|
32
|
+
t2 = typeof children === "function" ? (state) => children({
|
|
33
|
+
...state,
|
|
33
34
|
isSubmitted,
|
|
34
35
|
disabled
|
|
35
36
|
}) : children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBarFeedbackNegative.js","names":["ReactNode","Platform","Pressable","PressableProps","useActionBarFeedbackNegative","ActionBarFeedbackNegativeProps","Omit","children","props","isSubmitted","disabled","ActionBarFeedbackNegative","t0","$","_c","disabledProp","pressableProps","submit","t1","OS","t2","t3","_c"],"sources":["../../../src/primitives/actionBar/ActionBarFeedbackNegative.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"ActionBarFeedbackNegative.js","names":["ReactNode","Platform","Pressable","PressableProps","PressableStateCallbackType","useActionBarFeedbackNegative","ActionBarFeedbackNegativeProps","Omit","children","props","isSubmitted","disabled","ActionBarFeedbackNegative","t0","$","_c","disabledProp","pressableProps","submit","t1","OS","t2","state","t3","_c"],"sources":["../../../src/primitives/actionBar/ActionBarFeedbackNegative.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n Platform,\n Pressable,\n type PressableProps,\n type PressableStateCallbackType,\n} from \"react-native\";\nimport { useActionBarFeedbackNegative } from \"@assistant-ui/core/react\";\n\nexport type ActionBarFeedbackNegativeProps = Omit<\n PressableProps,\n \"onPress\" | \"children\"\n> & {\n children:\n | ReactNode\n | ((\n props: PressableStateCallbackType & {\n isSubmitted: boolean;\n disabled: boolean;\n },\n ) => ReactNode);\n};\n\nexport const ActionBarFeedbackNegative = ({\n children,\n disabled: disabledProp,\n ...pressableProps\n}: ActionBarFeedbackNegativeProps) => {\n const { submit, isSubmitted } = useActionBarFeedbackNegative();\n const disabled = disabledProp ?? false;\n\n return (\n <Pressable\n onPress={submit}\n disabled={disabledProp}\n accessibilityRole=\"button\"\n {...(Platform.OS === \"web\"\n ? { \"aria-pressed\": isSubmitted }\n : { \"aria-selected\": isSubmitted })}\n {...pressableProps}\n >\n {typeof children === \"function\"\n ? (state) => children({ ...state, isSubmitted, disabled })\n : children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;AAuBA,MAAaY,6BAA4BC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAP;CAAA,IAAAQ;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAL,UAAAG,UAAAK,cAAA,GAAAC,kBAAAJ;EAITC,EAAA,KAAAD;EAAAC,EAAA,KAAAN;EAAAM,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAT,WAAAM,EAAA;EAAAE,eAAAF,EAAA;EAAAG,iBAAAH,EAAA;CAAA;CAC/B,MAAA,EAAAI,QAAAR,gBAAgCL,6BAA6B;CAC7D,MAAAM,WAAiBK,gBAAA;CAAsB,IAAAG;CAAA,IAAAL,EAAA,OAAAJ,aAAA;EAO9BS,KAAAlB,SAAQmB,OAAQ,QAAhB,EAAA,gBACiBV,YACa,IAF9B,EAAA,iBAEkBA,YAAY;EAACI,EAAA,KAAAJ;EAAAI,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAN,YAAAM,EAAA,OAAAH,YAAAG,EAAA,OAAAJ,aAAA;EAGnCW,KAAA,OAAOb,aAAa,cAApBc,UACcd,SAAS;GAAA,GAAKc;GAAKZ;GAAAC;EAAwB,CAAC,IAD1DH;EAEWM,EAAA,KAAAN;EAAAM,EAAA,KAAAH;EAAAG,EAAA,KAAAJ;EAAAI,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,QAAAE,gBAAAF,EAAA,QAAAG,kBAAAH,EAAA,QAAAI,UAAAJ,EAAA,QAAAK,MAAAL,EAAA,QAAAO,IAAA;EAXdE,KAAA,oBAAC,WAAD;GACWL,SAAAA;GACCF,UAAAA;GACQ,mBAAA;GAAQ,GACrBG;GAE+B,GAChCF;GAEHI,UAAAA;EATO,CAAA;EAYEP,EAAA,MAAAE;EAAAF,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAO;EAAAP,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OAZZS;AAYY"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import { type PressableProps } from "react-native";
|
|
2
|
+
import { type PressableProps, type PressableStateCallbackType } from "react-native";
|
|
3
3
|
export type ActionBarFeedbackPositiveProps = Omit<PressableProps, "onPress" | "children"> & {
|
|
4
|
-
children: ReactNode | ((props: {
|
|
4
|
+
children: ReactNode | ((props: PressableStateCallbackType & {
|
|
5
5
|
isSubmitted: boolean;
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
}) => ReactNode);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBarFeedbackPositive.d.ts","sourceRoot":"","sources":["../../../src/primitives/actionBar/ActionBarFeedbackPositive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"ActionBarFeedbackPositive.d.ts","sourceRoot":"","sources":["../../../src/primitives/actionBar/ActionBarFeedbackPositive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,0BAA0B,EAChC,MAAM,cAAc,CAAC;AAGtB,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAC/C,cAAc,EACd,SAAS,GAAG,UAAU,CACvB,GAAG;IACF,QAAQ,EACJ,SAAS,GACT,CAAC,CACC,KAAK,EAAE,0BAA0B,GAAG;QAClC,WAAW,EAAE,OAAO,CAAC;QACrB,QAAQ,EAAE,OAAO,CAAC;KACnB,KACE,SAAS,CAAC,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,yDAIvC,8BAA8B,gCAmBhC,CAAC"}
|
|
@@ -29,7 +29,8 @@ const ActionBarFeedbackPositive = (t0) => {
|
|
|
29
29
|
} else t1 = $[5];
|
|
30
30
|
let t2;
|
|
31
31
|
if ($[6] !== children || $[7] !== disabled || $[8] !== isSubmitted) {
|
|
32
|
-
t2 = typeof children === "function" ? children({
|
|
32
|
+
t2 = typeof children === "function" ? (state) => children({
|
|
33
|
+
...state,
|
|
33
34
|
isSubmitted,
|
|
34
35
|
disabled
|
|
35
36
|
}) : children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBarFeedbackPositive.js","names":["ReactNode","Platform","Pressable","PressableProps","useActionBarFeedbackPositive","ActionBarFeedbackPositiveProps","Omit","children","props","isSubmitted","disabled","ActionBarFeedbackPositive","t0","$","_c","disabledProp","pressableProps","submit","t1","OS","t2","t3","_c"],"sources":["../../../src/primitives/actionBar/ActionBarFeedbackPositive.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"ActionBarFeedbackPositive.js","names":["ReactNode","Platform","Pressable","PressableProps","PressableStateCallbackType","useActionBarFeedbackPositive","ActionBarFeedbackPositiveProps","Omit","children","props","isSubmitted","disabled","ActionBarFeedbackPositive","t0","$","_c","disabledProp","pressableProps","submit","t1","OS","t2","state","t3","_c"],"sources":["../../../src/primitives/actionBar/ActionBarFeedbackPositive.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n Platform,\n Pressable,\n type PressableProps,\n type PressableStateCallbackType,\n} from \"react-native\";\nimport { useActionBarFeedbackPositive } from \"@assistant-ui/core/react\";\n\nexport type ActionBarFeedbackPositiveProps = Omit<\n PressableProps,\n \"onPress\" | \"children\"\n> & {\n children:\n | ReactNode\n | ((\n props: PressableStateCallbackType & {\n isSubmitted: boolean;\n disabled: boolean;\n },\n ) => ReactNode);\n};\n\nexport const ActionBarFeedbackPositive = ({\n children,\n disabled: disabledProp,\n ...pressableProps\n}: ActionBarFeedbackPositiveProps) => {\n const { submit, isSubmitted } = useActionBarFeedbackPositive();\n const disabled = disabledProp ?? false;\n\n return (\n <Pressable\n onPress={submit}\n disabled={disabledProp}\n accessibilityRole=\"button\"\n {...(Platform.OS === \"web\"\n ? { \"aria-pressed\": isSubmitted }\n : { \"aria-selected\": isSubmitted })}\n {...pressableProps}\n >\n {typeof children === \"function\"\n ? (state) => children({ ...state, isSubmitted, disabled })\n : children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;AAuBA,MAAaY,6BAA4BC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAP;CAAA,IAAAQ;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAL,UAAAG,UAAAK,cAAA,GAAAC,kBAAAJ;EAITC,EAAA,KAAAD;EAAAC,EAAA,KAAAN;EAAAM,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAT,WAAAM,EAAA;EAAAE,eAAAF,EAAA;EAAAG,iBAAAH,EAAA;CAAA;CAC/B,MAAA,EAAAI,QAAAR,gBAAgCL,6BAA6B;CAC7D,MAAAM,WAAiBK,gBAAA;CAAsB,IAAAG;CAAA,IAAAL,EAAA,OAAAJ,aAAA;EAO9BS,KAAAlB,SAAQmB,OAAQ,QAAhB,EAAA,gBACiBV,YACa,IAF9B,EAAA,iBAEkBA,YAAY;EAACI,EAAA,KAAAJ;EAAAI,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAN,YAAAM,EAAA,OAAAH,YAAAG,EAAA,OAAAJ,aAAA;EAGnCW,KAAA,OAAOb,aAAa,cAApBc,UACcd,SAAS;GAAA,GAAKc;GAAKZ;GAAAC;EAAwB,CAAC,IAD1DH;EAEWM,EAAA,KAAAN;EAAAM,EAAA,KAAAH;EAAAG,EAAA,KAAAJ;EAAAI,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,QAAAE,gBAAAF,EAAA,QAAAG,kBAAAH,EAAA,QAAAI,UAAAJ,EAAA,QAAAK,MAAAL,EAAA,QAAAO,IAAA;EAXdE,KAAA,oBAAC,WAAD;GACWL,SAAAA;GACCF,UAAAA;GACQ,mBAAA;GAAQ,GACrBG;GAE+B,GAChCF;GAEHI,UAAAA;EATO,CAAA;EAYEP,EAAA,MAAAE;EAAAF,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAO;EAAAP,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OAZZS;AAYY"}
|
|
@@ -8,5 +8,5 @@ export type ComposerInputProps = Omit<TextInputProps, "value" | "onChangeText">
|
|
|
8
8
|
*/
|
|
9
9
|
submitMode?: "enter" | "none";
|
|
10
10
|
};
|
|
11
|
-
export declare const ComposerInput: ({ submitMode, onKeyPress: onKeyPressProp, numberOfLines, style, ...props }: ComposerInputProps) => import("react").JSX.Element;
|
|
11
|
+
export declare const ComposerInput: ({ submitMode, onKeyPress: onKeyPressProp, numberOfLines, style, editable, readOnly, ...props }: ComposerInputProps) => import("react").JSX.Element;
|
|
12
12
|
//# sourceMappingURL=ComposerInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposerInput.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ComposerInput.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAUxE,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,cAAc,EACd,OAAO,GAAG,cAAc,CACzB,GAAG;IACF;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC/B,CAAC;AAmCF,eAAO,MAAM,aAAa,GAAI,gGAQ3B,kBAAkB,gCA2EpB,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
|
3
3
|
import { Platform, TextInput } from "react-native";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { useEffect, useRef } from "@assistant-ui/tap/react-shim";
|
|
6
|
+
import { composerInputDisabled } from "@assistant-ui/core/store/internal";
|
|
6
7
|
import { flushTapSync } from "@assistant-ui/tap";
|
|
7
8
|
//#region src/primitives/composer/ComposerInput.tsx
|
|
8
9
|
const getWebTextareaMaxHeight = (el) => {
|
|
@@ -28,34 +29,42 @@ const adjustWebTextareaHeight = (ref) => {
|
|
|
28
29
|
el.style.height = `${nextHeight}px`;
|
|
29
30
|
};
|
|
30
31
|
const ComposerInput = (t0) => {
|
|
31
|
-
const $ = c(
|
|
32
|
+
const $ = c(28);
|
|
33
|
+
let editable;
|
|
32
34
|
let numberOfLines;
|
|
33
35
|
let onKeyPressProp;
|
|
34
36
|
let props;
|
|
37
|
+
let readOnly;
|
|
35
38
|
let style;
|
|
36
39
|
let t1;
|
|
37
40
|
if ($[0] !== t0) {
|
|
38
|
-
({submitMode: t1, onKeyPress: onKeyPressProp, numberOfLines, style, ...props} = t0);
|
|
41
|
+
({submitMode: t1, onKeyPress: onKeyPressProp, numberOfLines, style, editable, readOnly, ...props} = t0);
|
|
39
42
|
$[0] = t0;
|
|
40
|
-
$[1] =
|
|
41
|
-
$[2] =
|
|
42
|
-
$[3] =
|
|
43
|
-
$[4] =
|
|
44
|
-
$[5] =
|
|
43
|
+
$[1] = editable;
|
|
44
|
+
$[2] = numberOfLines;
|
|
45
|
+
$[3] = onKeyPressProp;
|
|
46
|
+
$[4] = props;
|
|
47
|
+
$[5] = readOnly;
|
|
48
|
+
$[6] = style;
|
|
49
|
+
$[7] = t1;
|
|
45
50
|
} else {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
editable = $[1];
|
|
52
|
+
numberOfLines = $[2];
|
|
53
|
+
onKeyPressProp = $[3];
|
|
54
|
+
props = $[4];
|
|
55
|
+
readOnly = $[5];
|
|
56
|
+
style = $[6];
|
|
57
|
+
t1 = $[7];
|
|
51
58
|
}
|
|
52
59
|
const submitMode = t1 === void 0 ? "enter" : t1;
|
|
53
60
|
const aui = useAui();
|
|
54
61
|
const text = useAuiState(_temp);
|
|
62
|
+
const isInputDisabled = useAuiState(composerInputDisabled);
|
|
55
63
|
const inputRef = useRef(null);
|
|
56
64
|
let t2;
|
|
57
|
-
if ($[
|
|
65
|
+
if ($[8] !== aui || $[9] !== isInputDisabled) {
|
|
58
66
|
t2 = (value) => {
|
|
67
|
+
if (isInputDisabled) return;
|
|
59
68
|
if (Platform.OS === "web") {
|
|
60
69
|
flushTapSync(() => {
|
|
61
70
|
aui.composer.setText(value);
|
|
@@ -64,29 +73,31 @@ const ComposerInput = (t0) => {
|
|
|
64
73
|
}
|
|
65
74
|
aui.composer.setText(value);
|
|
66
75
|
};
|
|
67
|
-
$[
|
|
68
|
-
$[
|
|
69
|
-
|
|
76
|
+
$[8] = aui;
|
|
77
|
+
$[9] = isInputDisabled;
|
|
78
|
+
$[10] = t2;
|
|
79
|
+
} else t2 = $[10];
|
|
70
80
|
const onChangeText = t2;
|
|
71
81
|
let t3;
|
|
72
|
-
if ($[
|
|
82
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
73
83
|
t3 = () => {
|
|
74
84
|
adjustWebTextareaHeight(inputRef);
|
|
75
85
|
};
|
|
76
|
-
$[
|
|
77
|
-
} else t3 = $[
|
|
86
|
+
$[11] = t3;
|
|
87
|
+
} else t3 = $[11];
|
|
78
88
|
let t4;
|
|
79
|
-
if ($[
|
|
89
|
+
if ($[12] !== text) {
|
|
80
90
|
t4 = [text];
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
} else t4 = $[
|
|
91
|
+
$[12] = text;
|
|
92
|
+
$[13] = t4;
|
|
93
|
+
} else t4 = $[13];
|
|
84
94
|
useEffect(t3, t4);
|
|
85
95
|
let t5;
|
|
86
|
-
if ($[
|
|
96
|
+
if ($[14] !== aui || $[15] !== isInputDisabled || $[16] !== onKeyPressProp || $[17] !== submitMode) {
|
|
87
97
|
t5 = (e) => {
|
|
88
98
|
onKeyPressProp?.(e);
|
|
89
99
|
if (e.isDefaultPrevented()) return;
|
|
100
|
+
if (isInputDisabled) return;
|
|
90
101
|
if (Platform.OS !== "web") return;
|
|
91
102
|
if (submitMode !== "enter") return;
|
|
92
103
|
const nativeEvent = e.nativeEvent;
|
|
@@ -98,32 +109,38 @@ const ComposerInput = (t0) => {
|
|
|
98
109
|
aui.composer.send();
|
|
99
110
|
}
|
|
100
111
|
};
|
|
101
|
-
$[
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
105
|
-
|
|
112
|
+
$[14] = aui;
|
|
113
|
+
$[15] = isInputDisabled;
|
|
114
|
+
$[16] = onKeyPressProp;
|
|
115
|
+
$[17] = submitMode;
|
|
116
|
+
$[18] = t5;
|
|
117
|
+
} else t5 = $[18];
|
|
106
118
|
const onKeyPress = t5;
|
|
119
|
+
const isReadOnly = isInputDisabled || editable === false || readOnly === true;
|
|
107
120
|
const t6 = numberOfLines ?? (Platform.OS === "web" ? 1 : void 0);
|
|
108
121
|
let t7;
|
|
109
|
-
if ($[
|
|
122
|
+
if ($[19] !== editable || $[20] !== isReadOnly || $[21] !== onChangeText || $[22] !== onKeyPress || $[23] !== props || $[24] !== style || $[25] !== t6 || $[26] !== text) {
|
|
110
123
|
t7 = /* @__PURE__ */ jsx(TextInput, {
|
|
111
124
|
ref: inputRef,
|
|
112
125
|
value: text,
|
|
113
126
|
onChangeText,
|
|
114
127
|
onKeyPress,
|
|
115
128
|
numberOfLines: t6,
|
|
129
|
+
editable,
|
|
130
|
+
readOnly: isReadOnly,
|
|
116
131
|
style,
|
|
117
132
|
...props
|
|
118
133
|
});
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
|
|
134
|
+
$[19] = editable;
|
|
135
|
+
$[20] = isReadOnly;
|
|
136
|
+
$[21] = onChangeText;
|
|
137
|
+
$[22] = onKeyPress;
|
|
138
|
+
$[23] = props;
|
|
139
|
+
$[24] = style;
|
|
140
|
+
$[25] = t6;
|
|
141
|
+
$[26] = text;
|
|
142
|
+
$[27] = t7;
|
|
143
|
+
} else t7 = $[27];
|
|
127
144
|
return t7;
|
|
128
145
|
};
|
|
129
146
|
function _temp(s) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposerInput.js","names":["useCallback","useEffect","useRef","Platform","TextInput","TextInputProps","useAui","useAuiState","flushTapSync","TextInputInstance","React","ComponentRef","TextInputKeyPressEvent","Parameters","NonNullable","ComposerInputProps","Omit","submitMode","getWebTextareaMaxHeight","el","HTMLTextAreaElement","computedMaxHeight","globalThis","getComputedStyle","maxHeight","parsedComputedMaxHeight","Number","parseFloat","isFinite","inlineMaxHeight","style","adjustWebTextareaHeight","ref","RefObject","OS","current","rows","overflowX","overflowY","height","scrollHeight","needsScrollbar","nextHeight","Math","min","ComposerInput","t0","$","_c","numberOfLines","onKeyPressProp","props","t1","onKeyPress","undefined","aui","text","_temp","inputRef","t2","value","composer","setText","onChangeText","t3","Symbol","for","t4","t5","e","isDefaultPrevented","nativeEvent","shiftKey","isComposing","keyCode","key","threadState","thread","getState","isRunning","capabilities","queue","voice","Event","preventDefault","send","t6","t7","s","_c"],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef } from \"react\";\nimport { Platform, TextInput, type TextInputProps } from \"react-native\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\nimport { flushTapSync } from \"@assistant-ui/tap\";\n\ntype TextInputInstance = React.ComponentRef<typeof TextInput>;\ntype TextInputKeyPressEvent = Parameters<\n NonNullable<TextInputProps[\"onKeyPress\"]>\n>[0];\n\nexport type ComposerInputProps = Omit<\n TextInputProps,\n \"value\" | \"onChangeText\"\n> & {\n /**\n * Controls how the Enter key submits messages (web only).\n * - \"enter\": Plain Enter submits (Shift+Enter for newline)\n * - \"none\": Enter inserts newline (no keyboard submission)\n * @default \"enter\"\n */\n submitMode?: \"enter\" | \"none\";\n};\n\nconst getWebTextareaMaxHeight = (el: HTMLTextAreaElement) => {\n const computedMaxHeight = globalThis.getComputedStyle?.(el).maxHeight;\n const parsedComputedMaxHeight = Number.parseFloat(computedMaxHeight ?? \"\");\n if (Number.isFinite(parsedComputedMaxHeight)) return parsedComputedMaxHeight;\n\n const inlineMaxHeight = Number.parseFloat(el.style.maxHeight);\n return Number.isFinite(inlineMaxHeight) ? inlineMaxHeight : null;\n};\n\nconst adjustWebTextareaHeight = (\n ref: React.RefObject<TextInputInstance | null>,\n) => {\n if (Platform.OS !== \"web\") return;\n // On web, the TextInput ref IS the DOM element\n const el = ref.current as unknown as HTMLTextAreaElement | null;\n if (!el) return;\n // Ensure rows=1 so scrollHeight reflects actual content\n if (el.rows !== 1) el.rows = 1;\n\n el.style.overflowX = \"hidden\";\n el.style.overflowY = \"hidden\";\n el.style.height = \"auto\";\n\n const scrollHeight = el.scrollHeight;\n const maxHeight = getWebTextareaMaxHeight(el);\n const needsScrollbar = maxHeight !== null && scrollHeight > maxHeight;\n const nextHeight =\n maxHeight === null ? scrollHeight : Math.min(scrollHeight, maxHeight);\n\n el.style.overflowY = needsScrollbar ? \"auto\" : \"hidden\";\n el.style.height = `${nextHeight}px`;\n};\n\nexport const ComposerInput = ({\n submitMode = \"enter\",\n onKeyPress: onKeyPressProp,\n numberOfLines,\n style,\n ...props\n}: ComposerInputProps) => {\n const aui = useAui();\n const text = useAuiState((s) => s.composer.text);\n const inputRef = useRef<TextInputInstance>(null);\n\n const onChangeText = useCallback(\n (value: string) => {\n if (Platform.OS === \"web\") {\n // Keep the controlled value in sync mid-IME so react-dom does not reset the textarea to a stale value\n flushTapSync(() => {\n aui.composer.setText(value);\n });\n return;\n }\n aui.composer.setText(value);\n },\n [aui],\n );\n\n // Auto-resize textarea on web when text changes\n useEffect(() => {\n void text; // trigger re-run when text changes\n adjustWebTextareaHeight(inputRef);\n }, [text]);\n\n const onKeyPress = useCallback(\n (e: TextInputKeyPressEvent) => {\n onKeyPressProp?.(e);\n if (e.isDefaultPrevented()) return;\n\n if (Platform.OS !== \"web\") return;\n if (submitMode !== \"enter\") return;\n\n const nativeEvent =\n e.nativeEvent as TextInputKeyPressEvent[\"nativeEvent\"] & {\n shiftKey?: boolean;\n isComposing?: boolean;\n keyCode?: number;\n };\n // react-native-web forwards the raw DOM keydown before its own composition guard, so re-check it here (mirrors isEventComposing)\n if (nativeEvent.isComposing || nativeEvent.keyCode === 229) return;\n if (nativeEvent.key === \"Enter\" && !nativeEvent.shiftKey) {\n const threadState = aui.thread.getState();\n if (\n threadState.isRunning &&\n !threadState.capabilities.queue &&\n threadState.voice === undefined\n )\n return;\n (e as unknown as Event).preventDefault?.();\n aui.composer.send();\n }\n },\n [aui, submitMode, onKeyPressProp],\n );\n\n return (\n <TextInput\n ref={inputRef}\n value={text}\n onChangeText={onChangeText}\n onKeyPress={onKeyPress}\n numberOfLines={numberOfLines ?? (Platform.OS === \"web\" ? 1 : undefined)}\n style={style}\n {...props}\n />\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ComposerInput.js","names":["useCallback","useEffect","useRef","Platform","TextInput","TextInputProps","composerInputDisabled","useAui","useAuiState","flushTapSync","TextInputInstance","React","ComponentRef","TextInputKeyPressEvent","Parameters","NonNullable","ComposerInputProps","Omit","submitMode","getWebTextareaMaxHeight","el","HTMLTextAreaElement","computedMaxHeight","globalThis","getComputedStyle","maxHeight","parsedComputedMaxHeight","Number","parseFloat","isFinite","inlineMaxHeight","style","adjustWebTextareaHeight","ref","RefObject","OS","current","rows","overflowX","overflowY","height","scrollHeight","needsScrollbar","nextHeight","Math","min","ComposerInput","t0","$","_c","editable","numberOfLines","onKeyPressProp","props","readOnly","t1","onKeyPress","undefined","aui","text","_temp","isInputDisabled","inputRef","t2","value","composer","setText","onChangeText","t3","Symbol","for","t4","t5","e","isDefaultPrevented","nativeEvent","shiftKey","isComposing","keyCode","key","threadState","thread","getState","isRunning","capabilities","queue","voice","Event","preventDefault","send","isReadOnly","t6","t7","s","_c"],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef } from \"react\";\nimport { Platform, TextInput, type TextInputProps } from \"react-native\";\nimport { composerInputDisabled } from \"@assistant-ui/core/store/internal\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\nimport { flushTapSync } from \"@assistant-ui/tap\";\n\ntype TextInputInstance = React.ComponentRef<typeof TextInput>;\ntype TextInputKeyPressEvent = Parameters<\n NonNullable<TextInputProps[\"onKeyPress\"]>\n>[0];\n\nexport type ComposerInputProps = Omit<\n TextInputProps,\n \"value\" | \"onChangeText\"\n> & {\n /**\n * Controls how the Enter key submits messages (web only).\n * - \"enter\": Plain Enter submits (Shift+Enter for newline)\n * - \"none\": Enter inserts newline (no keyboard submission)\n * @default \"enter\"\n */\n submitMode?: \"enter\" | \"none\";\n};\n\nconst getWebTextareaMaxHeight = (el: HTMLTextAreaElement) => {\n const computedMaxHeight = globalThis.getComputedStyle?.(el).maxHeight;\n const parsedComputedMaxHeight = Number.parseFloat(computedMaxHeight ?? \"\");\n if (Number.isFinite(parsedComputedMaxHeight)) return parsedComputedMaxHeight;\n\n const inlineMaxHeight = Number.parseFloat(el.style.maxHeight);\n return Number.isFinite(inlineMaxHeight) ? inlineMaxHeight : null;\n};\n\nconst adjustWebTextareaHeight = (\n ref: React.RefObject<TextInputInstance | null>,\n) => {\n if (Platform.OS !== \"web\") return;\n // On web, the TextInput ref IS the DOM element\n const el = ref.current as unknown as HTMLTextAreaElement | null;\n if (!el) return;\n // Ensure rows=1 so scrollHeight reflects actual content\n if (el.rows !== 1) el.rows = 1;\n\n el.style.overflowX = \"hidden\";\n el.style.overflowY = \"hidden\";\n el.style.height = \"auto\";\n\n const scrollHeight = el.scrollHeight;\n const maxHeight = getWebTextareaMaxHeight(el);\n const needsScrollbar = maxHeight !== null && scrollHeight > maxHeight;\n const nextHeight =\n maxHeight === null ? scrollHeight : Math.min(scrollHeight, maxHeight);\n\n el.style.overflowY = needsScrollbar ? \"auto\" : \"hidden\";\n el.style.height = `${nextHeight}px`;\n};\n\nexport const ComposerInput = ({\n submitMode = \"enter\",\n onKeyPress: onKeyPressProp,\n numberOfLines,\n style,\n editable,\n readOnly,\n ...props\n}: ComposerInputProps) => {\n const aui = useAui();\n const text = useAuiState((s) => s.composer.text);\n const isInputDisabled = useAuiState(composerInputDisabled);\n const inputRef = useRef<TextInputInstance>(null);\n\n const onChangeText = useCallback(\n (value: string) => {\n if (isInputDisabled) return;\n\n if (Platform.OS === \"web\") {\n // Keep the controlled value in sync mid-IME so react-dom does not reset the textarea to a stale value\n flushTapSync(() => {\n aui.composer.setText(value);\n });\n return;\n }\n aui.composer.setText(value);\n },\n [aui, isInputDisabled],\n );\n\n // Auto-resize textarea on web when text changes\n useEffect(() => {\n void text; // trigger re-run when text changes\n adjustWebTextareaHeight(inputRef);\n }, [text]);\n\n const onKeyPress = useCallback(\n (e: TextInputKeyPressEvent) => {\n onKeyPressProp?.(e);\n if (e.isDefaultPrevented()) return;\n if (isInputDisabled) return;\n\n if (Platform.OS !== \"web\") return;\n if (submitMode !== \"enter\") return;\n\n const nativeEvent =\n e.nativeEvent as TextInputKeyPressEvent[\"nativeEvent\"] & {\n shiftKey?: boolean;\n isComposing?: boolean;\n keyCode?: number;\n };\n // react-native-web forwards the raw DOM keydown before its own composition guard, so re-check it here (mirrors isEventComposing)\n if (nativeEvent.isComposing || nativeEvent.keyCode === 229) return;\n if (nativeEvent.key === \"Enter\" && !nativeEvent.shiftKey) {\n const threadState = aui.thread.getState();\n if (\n threadState.isRunning &&\n !threadState.capabilities.queue &&\n threadState.voice === undefined\n )\n return;\n (e as unknown as Event).preventDefault?.();\n aui.composer.send();\n }\n },\n [aui, isInputDisabled, submitMode, onKeyPressProp],\n );\n\n const isReadOnly = isInputDisabled || editable === false || readOnly === true;\n\n return (\n <TextInput\n ref={inputRef}\n value={text}\n onChangeText={onChangeText}\n onKeyPress={onKeyPress}\n numberOfLines={numberOfLines ?? (Platform.OS === \"web\" ? 1 : undefined)}\n editable={editable}\n readOnly={isReadOnly}\n style={style}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;;;AAwBA,MAAMmB,2BAA2BC,OAA4B;CAC3D,MAAME,oBAAoBC,WAAWC,mBAAmBJ,EAAE,CAAC,CAACK;CAC5D,MAAMC,0BAA0BC,OAAOC,WAAWN,qBAAqB,EAAE;CACzE,IAAIK,OAAOE,SAASH,uBAAuB,GAAG,OAAOA;CAErD,MAAMI,kBAAkBH,OAAOC,WAAWR,GAAGW,MAAMN,SAAS;CAC5D,OAAOE,OAAOE,SAASC,eAAe,IAAIA,kBAAkB;AAC9D;AAEA,MAAME,2BACJC,QACG;CACH,IAAI9B,SAASgC,OAAO,OAAO;CAE3B,MAAMf,KAAKa,IAAIG;CACf,IAAI,CAAChB,IAAI;CAET,IAAIA,GAAGiB,SAAS,GAAGjB,GAAGiB,OAAO;CAE7BjB,GAAGW,MAAMO,YAAY;CACrBlB,GAAGW,MAAMQ,YAAY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,EAAA,MAAAa;EAAAb,EAAA,MAAAI;EAAAJ,EAAA,MAAA9B;EAAA8B,EAAA,MAAAwB;CAAA,OAAAA,KAAAxB,EAAA;CA5BH,MAAAQ,aAAmBgB;CAgCnB,MAAAkB,aAAmB7B,mBAAmBX,aAAa,SAASI,aAAa;CAQtD,MAAAqC,KAAAxC,kBAAkBhD,SAAQgC,OAAQ,QAAhB,IAAAsB,KAAAA;CAAsC,IAAAmC;CAAA,IAAA5C,EAAA,QAAAE,YAAAF,EAAA,QAAA0C,cAAA1C,EAAA,QAAAmB,gBAAAnB,EAAA,QAAAQ,cAAAR,EAAA,QAAAK,SAAAL,EAAA,QAAAjB,SAAAiB,EAAA,QAAA2C,MAAA3C,EAAA,QAAAW,MAAA;EALzEiC,KAAA,oBAAC,WAAD;GACO9B,KAAAA;GACEH,OAAAA;GACOQ;GACFX;GACG,eAAAmC;GACLzC;GACAwC,UAAAA;GACH3D;GAAK,GACRsB;EAAK,CAAA;EACTL,EAAA,MAAAE;EAAAF,EAAA,MAAA0C;EAAA1C,EAAA,MAAAmB;EAAAnB,EAAA,MAAAQ;EAAAR,EAAA,MAAAK;EAAAL,EAAA,MAAAjB;EAAAiB,EAAA,MAAA2C;EAAA3C,EAAA,MAAAW;EAAAX,EAAA,MAAA4C;CAAA,OAAAA,KAAA5C,EAAA;CAAA,OAVF4C;AAUE;AAjFuB,SAAAhC,MAAAiC,GAAA;CAAA,OAUKA,EAAC5B,SAASN;AAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageContent.d.ts","sourceRoot":"","sources":["../../../src/primitives/message/MessageContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MessageContent.d.ts","sourceRoot":"","sources":["../../../src/primitives/message/MessageContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,OAAO,CAAC;A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CAAC;QACpD,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,YAAY,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE;QACnB,IAAI,EAAE,OAAO,CAAC,kBAAkB,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACpD,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,YAAY,CAAC;CACpB,CAAC;AAqEF,eAAO,MAAM,cAAc,GAAI,qGAQ5B,mBAAmB,gCAsErB,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { DefaultMessageImage } from "./MessageParts.js";
|
|
2
|
+
import { PartByIndexProvider } from "@assistant-ui/core/react";
|
|
1
3
|
import { useAui, useAuiState } from "@assistant-ui/store";
|
|
2
4
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
3
5
|
import { Text } from "react-native";
|
|
4
6
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
5
7
|
import { Fragment as Fragment$1 } from "@assistant-ui/tap/react-shim";
|
|
6
|
-
import { getMessagePartKeys } from "@assistant-ui/core/internal";
|
|
8
|
+
import { getMessagePartKeys, resolveToolRender } from "@assistant-ui/core/internal";
|
|
7
9
|
//#region src/primitives/message/MessageContent.tsx
|
|
8
10
|
const DefaultTextRenderer = (t0) => {
|
|
9
11
|
const $ = c(2);
|
|
@@ -21,9 +23,9 @@ const ToolUIDisplay = (t0) => {
|
|
|
21
23
|
const { Fallback, part, index } = t0;
|
|
22
24
|
const aui = useAui();
|
|
23
25
|
let t1;
|
|
24
|
-
if ($[0] !== part
|
|
25
|
-
t1 = (s) => s.tools
|
|
26
|
-
$[0] = part
|
|
26
|
+
if ($[0] !== part) {
|
|
27
|
+
t1 = (s) => resolveToolRender(s.tools, part);
|
|
28
|
+
$[0] = part;
|
|
27
29
|
$[1] = t1;
|
|
28
30
|
} else t1 = $[1];
|
|
29
31
|
const Render = useAuiState(t1);
|
|
@@ -144,12 +146,13 @@ const MessageContent = (t0) => {
|
|
|
144
146
|
part,
|
|
145
147
|
index
|
|
146
148
|
}) }, key);
|
|
147
|
-
case "image":
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
149
|
+
case "image": return /* @__PURE__ */ jsx(Fragment$1, { children: renderImage ? renderImage({
|
|
150
|
+
part,
|
|
151
|
+
index
|
|
152
|
+
}) : /* @__PURE__ */ jsx(PartByIndexProvider, {
|
|
153
|
+
index,
|
|
154
|
+
children: /* @__PURE__ */ jsx(DefaultMessageImage, {})
|
|
155
|
+
}) }, key);
|
|
153
156
|
case "reasoning":
|
|
154
157
|
if (!renderReasoning) return null;
|
|
155
158
|
return /* @__PURE__ */ jsx(Fragment$1, { children: renderReasoning({
|