@assistant-ui/react 0.15.24 → 0.15.25
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/hooks/useToolCallElapsed.d.ts +3 -1
- package/dist/hooks/useToolCallElapsed.d.ts.map +1 -1
- package/dist/hooks/useToolCallElapsed.js +7 -8
- package/dist/hooks/useToolCallElapsed.js.map +1 -1
- package/dist/index.d.ts +10 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/model-context/makeAssistantVisible.d.ts +1 -0
- package/dist/model-context/makeAssistantVisible.d.ts.map +1 -1
- package/dist/model-context/makeAssistantVisible.js +31 -12
- package/dist/model-context/makeAssistantVisible.js.map +1 -1
- package/dist/primitives/composer/ComposerInput.d.ts +1 -1
- package/dist/primitives/composer/ComposerInput.js +1 -1
- package/dist/primitives/composer/ComposerInput.js.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopover.d.ts +11 -11
- package/dist/primitives/composer/trigger/TriggerPopover.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopover.js +62 -60
- package/dist/primitives/composer/trigger/TriggerPopover.js.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverAction.d.ts +8 -8
- package/dist/primitives/composer/trigger/TriggerPopoverAction.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverAction.js +6 -6
- package/dist/primitives/composer/trigger/TriggerPopoverAction.js.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverCategories.d.ts +3 -3
- package/dist/primitives/composer/trigger/TriggerPopoverCategories.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverCategories.js.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverDirective.d.ts +9 -9
- package/dist/primitives/composer/trigger/TriggerPopoverDirective.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverDirective.js +7 -7
- package/dist/primitives/composer/trigger/TriggerPopoverDirective.js.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverItems.d.ts +5 -5
- package/dist/primitives/composer/trigger/TriggerPopoverItems.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverItems.js.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverRootContext.d.ts +8 -8
- package/dist/primitives/composer/trigger/TriggerPopoverRootContext.js +8 -8
- package/dist/primitives/composer/trigger/TriggerPopoverRootContext.js.map +1 -1
- package/dist/primitives/composer/trigger/index.d.ts +1 -1
- package/dist/primitives/composer.d.ts +20 -1
- package/dist/primitives/composer.d.ts.map +1 -1
- package/dist/primitives/composer.js +8 -1
- package/dist/primitives/composer.js.map +1 -1
- package/dist/primitives/thread/ThreadLoadEarlier.d.ts +19 -0
- package/dist/primitives/thread/ThreadLoadEarlier.d.ts.map +1 -0
- package/dist/primitives/thread/ThreadLoadEarlier.js +36 -0
- package/dist/primitives/thread/ThreadLoadEarlier.js.map +1 -0
- package/dist/primitives/thread/ThreadMessages.d.ts +1 -1
- package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadMessages.js +2 -2
- package/dist/primitives/thread/useThreadViewportAutoScroll.d.ts.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.js +111 -2
- package/dist/primitives/thread/useThreadViewportAutoScroll.js.map +1 -1
- 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/sandbox-host/SandboxHost.d.ts.map +1 -1
- package/dist/sandbox-host/SandboxHost.js +6 -1
- package/dist/sandbox-host/SandboxHost.js.map +1 -1
- package/dist/unstable/useMessageStallDetection.d.ts.map +1 -1
- package/dist/unstable/useMessageStallDetection.js +10 -6
- package/dist/unstable/useMessageStallDetection.js.map +1 -1
- package/dist/utils/smooth/useSmooth.js +6 -6
- package/dist/utils/smooth/useSmooth.js.map +1 -1
- package/package.json +5 -4
- package/src/hooks/useToolCallElapsed.test.tsx +35 -0
- package/src/hooks/useToolCallElapsed.ts +9 -7
- package/src/index.ts +28 -3
- package/src/model-context/makeAssistantVisible.test.tsx +315 -5
- package/src/model-context/makeAssistantVisible.tsx +43 -7
- package/src/primitives/composer/ComposerInput.tsx +1 -1
- package/src/primitives/composer/trigger/TriggerPopover.tsx +11 -11
- package/src/primitives/composer/trigger/TriggerPopoverAction.tsx +10 -13
- package/src/primitives/composer/trigger/TriggerPopoverCategories.tsx +2 -2
- package/src/primitives/composer/trigger/TriggerPopoverDirective.tsx +11 -14
- package/src/primitives/composer/trigger/TriggerPopoverExports.test.ts +61 -0
- package/src/primitives/composer/trigger/TriggerPopoverItems.tsx +3 -3
- package/src/primitives/composer/trigger/TriggerPopoverRootContext.tsx +8 -8
- package/src/primitives/composer.ts +21 -1
- package/src/primitives/message/MessageRoot.test.tsx +125 -2
- package/src/primitives/thread/ThreadLoadEarlier.tsx +35 -0
- package/src/primitives/thread/ThreadMessages.tsx +1 -0
- package/src/primitives/thread/useThreadViewportAutoScroll.test.tsx +256 -5
- package/src/primitives/thread/useThreadViewportAutoScroll.ts +147 -1
- package/src/primitives/thread.ts +2 -0
- package/src/sandbox-host/SandboxHost.test.tsx +34 -0
- package/src/sandbox-host/SandboxHost.tsx +8 -4
- package/src/tests/toolCallTiming.test.tsx +19 -2
- package/src/unstable/useMessageStallDetection.test.tsx +40 -0
- package/src/unstable/useMessageStallDetection.ts +10 -6
- package/src/utils/smooth/useSmooth.test.tsx +16 -5
- package/src/utils/smooth/useSmooth.ts +7 -7
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* Reads `part.timing`. Returns `undefined` when the part is not a tool call,
|
|
6
6
|
* carries no timing, ended without a recorded completion (the duration is
|
|
7
7
|
* unknown), or when no message part scope is available (so kit components
|
|
8
|
-
* stay renderable standalone, e.g. in docs previews).
|
|
8
|
+
* stay renderable standalone, e.g. in docs previews). A running call also
|
|
9
|
+
* returns `undefined` until the component mounts, so a server render never
|
|
10
|
+
* reads the clock.
|
|
9
11
|
*
|
|
10
12
|
* @example
|
|
11
13
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolCallElapsed.d.ts","sourceRoot":"","sources":["../../src/hooks/useToolCallElapsed.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"useToolCallElapsed.d.ts","sourceRoot":"","sources":["../../src/hooks/useToolCallElapsed.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,kBAAkB,QAAO,MAAM,GAAG,SA4B9C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useLayoutEffect, useState } from "@assistant-ui/tap/react-shim";
|
|
4
4
|
import { useAuiState } from "@assistant-ui/store";
|
|
5
5
|
//#region src/hooks/useToolCallElapsed.ts
|
|
6
6
|
/**
|
|
@@ -10,7 +10,9 @@ import { useAuiState } from "@assistant-ui/store";
|
|
|
10
10
|
* Reads `part.timing`. Returns `undefined` when the part is not a tool call,
|
|
11
11
|
* carries no timing, ended without a recorded completion (the duration is
|
|
12
12
|
* unknown), or when no message part scope is available (so kit components
|
|
13
|
-
* stay renderable standalone, e.g. in docs previews).
|
|
13
|
+
* stay renderable standalone, e.g. in docs previews). A running call also
|
|
14
|
+
* returns `undefined` until the component mounts, so a server render never
|
|
15
|
+
* reads the clock.
|
|
14
16
|
*
|
|
15
17
|
* @example
|
|
16
18
|
* ```tsx
|
|
@@ -26,7 +28,7 @@ const useToolCallElapsed = () => {
|
|
|
26
28
|
const timing = useAuiState(_temp);
|
|
27
29
|
const partRunning = useAuiState(_temp2);
|
|
28
30
|
const running = timing !== void 0 && timing.completedAt === void 0 && partRunning;
|
|
29
|
-
const [now, setNow] = useState(
|
|
31
|
+
const [now, setNow] = useState(void 0);
|
|
30
32
|
let t0;
|
|
31
33
|
let t1;
|
|
32
34
|
if ($[0] !== running) {
|
|
@@ -44,10 +46,10 @@ const useToolCallElapsed = () => {
|
|
|
44
46
|
t0 = $[1];
|
|
45
47
|
t1 = $[2];
|
|
46
48
|
}
|
|
47
|
-
|
|
49
|
+
useLayoutEffect(t0, t1);
|
|
48
50
|
if (timing === void 0) return;
|
|
49
51
|
if (timing.completedAt !== void 0) return Math.max(0, timing.completedAt - timing.startedAt);
|
|
50
|
-
if (!running) return;
|
|
52
|
+
if (!running || now === void 0) return;
|
|
51
53
|
return Math.max(0, now - timing.startedAt);
|
|
52
54
|
};
|
|
53
55
|
function _temp(s) {
|
|
@@ -58,9 +60,6 @@ function _temp2(s_0) {
|
|
|
58
60
|
const part_0 = s_0.optional.part;
|
|
59
61
|
return part_0?.type === "tool-call" && part_0.status.type === "running";
|
|
60
62
|
}
|
|
61
|
-
function _temp3() {
|
|
62
|
-
return Date.now();
|
|
63
|
-
}
|
|
64
63
|
//#endregion
|
|
65
64
|
export { useToolCallElapsed };
|
|
66
65
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolCallElapsed.js","names":["c","_c","
|
|
1
|
+
{"version":3,"file":"useToolCallElapsed.js","names":["c","_c","useLayoutEffect","useState","useAuiState","useToolCallElapsed","$","timing","_temp","partRunning","_temp2","running","undefined","completedAt","now","setNow","t0","t1","Date","id","setInterval","clearInterval","Math","max","startedAt","s","part","optional","type","s_0","part_0","status","_c"],"sources":["../../src/hooks/useToolCallElapsed.ts"],"sourcesContent":["\"use client\";\n\nimport { useLayoutEffect, useState } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\n/**\n * Hook that returns the elapsed wall-clock time of the current tool call in\n * milliseconds, ticking once per second while the call runs.\n *\n * Reads `part.timing`. Returns `undefined` when the part is not a tool call,\n * carries no timing, ended without a recorded completion (the duration is\n * unknown), or when no message part scope is available (so kit components\n * stay renderable standalone, e.g. in docs previews). A running call also\n * returns `undefined` until the component mounts, so a server render never\n * reads the clock.\n *\n * @example\n * ```tsx\n * function ToolDuration() {\n * const elapsedMs = useToolCallElapsed();\n * if (elapsedMs === undefined) return null;\n * return <span>{(elapsedMs / 1000).toFixed(1)}s</span>;\n * }\n * ```\n */\nexport const useToolCallElapsed = (): number | undefined => {\n const timing = useAuiState((s) => {\n const part = s.optional.part;\n return part?.type === \"tool-call\" ? part.timing : undefined;\n });\n const partRunning = useAuiState((s) => {\n const part = s.optional.part;\n return part?.type === \"tool-call\" && part.status.type === \"running\";\n });\n const running =\n timing !== undefined && timing.completedAt === undefined && partRunning;\n const [now, setNow] = useState<number | undefined>(undefined);\n\n useLayoutEffect(() => {\n if (!running) return undefined;\n // The clock is read only after mount so a prerender never reads it; the\n // layout effect still catches the elapsed value up before the first paint.\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setNow(Date.now());\n const id = setInterval(() => setNow(Date.now()), 1000);\n return () => clearInterval(id);\n }, [running]);\n\n if (timing === undefined) return undefined;\n if (timing.completedAt !== undefined)\n return Math.max(0, timing.completedAt - timing.startedAt);\n if (!running || now === undefined) return undefined;\n return Math.max(0, now - timing.startedAt);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAaK,2BAAqB;CAAA,MAAAC,IAAAL,EAAA,CAAA;CAChC,MAAAM,SAAeH,YAAYI,KAG1B;CACD,MAAAC,cAAoBL,YAAYM,MAG/B;CACD,MAAAC,UACEJ,WAAWK,KAAAA,KAAaL,OAAMM,gBAAiBD,KAAAA,KAA/CH;CACF,MAAA,CAAAK,KAAAC,UAAsBZ,SAA6BS,KAAAA,CAAS;CAAE,IAAAI;CAAA,IAAAC;CAAA,IAAAX,EAAA,OAAAK,SAAA;EAE9CK,WAAA;GACd,IAAI,CAACL,SAAO;GAIZI,OAAOG,KAAIJ,IAAK,CAAC;GACjB,MAAAK,KAAWC,kBAAkBL,OAAOG,KAAIJ,IAAK,CAAC,GAAG,GAAI;GAAE,aAC1CO,cAAcF,EAAE;EAAC;EAC7BF,KAAA,CAACN,OAAO;EAACL,EAAA,KAAAK;EAAAL,EAAA,KAAAU;EAAAV,EAAA,KAAAW;CAAA,OAAA;EAAAD,KAAAV,EAAA;EAAAW,KAAAX,EAAA;CAAA;CARZJ,gBAAgBc,IAQbC,EAAS;CAEZ,IAAIV,WAAWK,KAAAA,GAAS;CACxB,IAAIL,OAAMM,gBAAiBD,KAAAA,GAAS,OAC3BU,KAAIC,IAAK,GAAGhB,OAAMM,cAAeN,OAAMiB,SAAU;CAC1D,IAAI,CAACb,WAAWG,QAAQF,KAAAA,GAAS;CAAmB,OAC7CU,KAAIC,IAAK,GAAGT,MAAMP,OAAMiB,SAAU;AAAC;AA3BV,SAAAhB,MAAAiB,GAAA;CAE9B,MAAAC,OAAaD,EAACE,SAASD;CAAM,OACtBA,MAAIE,SAAW,cAAcF,KAAInB,SAAjCK,KAAAA;AAAoD;AAH7B,SAAAF,OAAAmB,KAAA;CAM9B,MAAAC,SAAaL,IAACE,SAASD;CAAM,OACtBA,QAAIE,SAAW,eAAeF,OAAIK,OAAOH,SAAU;AAAS"}
|
package/dist/index.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ export * as ThreadListItemPrimitive from "./primitives/threadListItem.js";
|
|
|
76
76
|
export * as ThreadListItemMorePrimitive from "./primitives/threadListItemMore.js";
|
|
77
77
|
export * as SelectionToolbarPrimitive from "./primitives/selectionToolbar.js";
|
|
78
78
|
export { groupPartByType, type GroupByContext } from "@assistant-ui/core/react";
|
|
79
|
+
export { createThreadRowsSelector, type ThreadRow, type ThreadRowsOptions, } from "@assistant-ui/core/react";
|
|
79
80
|
export { unstable_useThreadMessageIds } from "@assistant-ui/core/react";
|
|
80
81
|
export { useMessagePartText } from "./primitives/messagePart/useMessagePartText.js";
|
|
81
82
|
export { useMessagePartReasoning } from "./primitives/messagePart/useMessagePartReasoning.js";
|
|
@@ -90,7 +91,7 @@ export { useMessageTiming } from "./hooks/useMessageTiming.js";
|
|
|
90
91
|
export { useToolCallElapsed } from "./hooks/useToolCallElapsed.js";
|
|
91
92
|
export { unstable_useMessageStallDetection, type Unstable_MessageStallDetection, type Unstable_MessageStallDetectionOptions, } from "./unstable/useMessageStallDetection.js";
|
|
92
93
|
export { useSmooth, type SmoothOptions } from "./utils/smooth/useSmooth.js";
|
|
93
|
-
export type { Attachment, PendingAttachment, CompleteAttachment, AttachmentStatus, AppendMessage, TextMessagePart, ReasoningMessagePart, PartProviderMetadata, SourceProviderMetadata, SourceMessagePart, ImageMessagePart, FileMessagePart, DataMessagePart, GenerativeUIMessagePart, GenerativeUINode, GenerativeUISpec, Unstable_AudioMessagePart, RespondToToolApprovalOptions, ToolApprovalDisplay, ToolApprovalOption, ToolApprovalOptionKind, ToolApprovalResponse, ToolCallMessagePart, ToolCallTiming, ToolModelContentPart, MessageStatus, MessagePartStatus, MessagePartStreamStatus, ToolCallMessagePartStatus, MessageTiming, MessageModality, ThreadUserMessagePart, ThreadAssistantMessagePart, ThreadSystemMessage, ThreadAssistantMessage, ThreadUserMessage, ThreadMessage, Unsubscribe, QuoteInfo, CreateAttachment, } from "@assistant-ui/core";
|
|
94
|
+
export type { Attachment, PendingAttachment, CompleteAttachment, AttachmentStatus, AppendMessage, TextMessagePart, ReasoningMessagePart, PartProviderMetadata, SourceProviderMetadata, SourceMessagePart, ImageMessagePart, FileMessagePart, DataMessagePart, GenerativeUIMessagePart, GenerativeUINode, GenerativeUISpec, Unstable_AudioMessagePart, RespondToToolApprovalOptions, ToolApprovalDisplay, ToolApprovalOption, ToolApprovalOptionKind, ToolApprovalAnswer, ToolApprovalQuestion, ToolApprovalQuestionOption, ToolApprovalResponse, ToolCallMessagePart, MessagePartTiming, ToolCallTiming, ToolModelContentPart, MessageStatus, MessagePartStatus, MessagePartStreamStatus, ToolCallMessagePartStatus, MessageTiming, MessageModality, ThreadUserMessagePart, ThreadAssistantMessagePart, ThreadSystemMessage, ThreadAssistantMessage, ThreadUserMessage, ThreadMessage, Unsubscribe, QuoteInfo, CreateAttachment, } from "@assistant-ui/core";
|
|
94
95
|
export type { EmptyMessagePartComponent, EmptyMessagePartProps, TextMessagePartComponent, TextMessagePartProps, ReasoningMessagePartComponent, ReasoningMessagePartProps, SourceMessagePartComponent, SourceMessagePartProps, ImageMessagePartComponent, ImageMessagePartProps, FileMessagePartComponent, FileMessagePartProps, Unstable_AudioMessagePartComponent, Unstable_AudioMessagePartProps, DataMessagePartComponent, DataMessagePartProps, ToolCallMessagePartComponent, ToolCallMessagePartProps, ReasoningGroupProps, ReasoningGroupComponent, QuoteMessagePartComponent, QuoteMessagePartProps, GenerativeUIComponentRegistry, GenerativeUIMessagePartComponent, GenerativeUIMessagePartProps, GenerativeUIRenderProps, EnrichedPartState, PartState, } from "@assistant-ui/core/react";
|
|
95
96
|
export { GenerativeUIRender, GenerativeUIRenderError, } from "@assistant-ui/core/react";
|
|
96
97
|
export type { ThreadListItemStatus } from "@assistant-ui/core";
|
|
@@ -106,9 +107,14 @@ export { unstable_useMentionAdapter, type Unstable_IconComponent, type Unstable_
|
|
|
106
107
|
export { unstable_useSlashCommandAdapter, type Unstable_SlashCommand, type Unstable_SlashCommandAction, type Unstable_UseSlashCommandAdapterOptions, } from "./unstable/useSlashCommandAdapter.js";
|
|
107
108
|
export { unstable_useLiveCompletionAdapter, type Unstable_UseLiveCompletionAdapterOptions, } from "./unstable/useLiveCompletionAdapter.js";
|
|
108
109
|
export type { ToolExecutionStatus } from "./internal.js";
|
|
109
|
-
export { useTriggerPopoverRootContext as unstable_useTriggerPopoverRootContext, useTriggerPopoverRootContextOptional as unstable_useTriggerPopoverRootContextOptional, useTriggerPopoverScopeContext as unstable_useTriggerPopoverScopeContext, useTriggerPopoverScopeContextOptional as unstable_useTriggerPopoverScopeContextOptional, useTriggerPopoverTriggers as unstable_useTriggerPopoverTriggers, useTriggerPopoverTriggersOptional as unstable_useTriggerPopoverTriggersOptional, type RegisteredTrigger as Unstable_RegisteredTrigger, type TriggerMatch
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
export { useTriggerPopoverRootContext as unstable_useTriggerPopoverRootContext, useTriggerPopoverRootContextOptional as unstable_useTriggerPopoverRootContextOptional, useTriggerPopoverScopeContext as unstable_useTriggerPopoverScopeContext, useTriggerPopoverScopeContextOptional as unstable_useTriggerPopoverScopeContextOptional, useTriggerPopoverTriggers as unstable_useTriggerPopoverTriggers, useTriggerPopoverTriggersOptional as unstable_useTriggerPopoverTriggersOptional, type RegisteredTrigger as Unstable_RegisteredTrigger, type TriggerMatch, type TriggerMatcher, type TriggerBehavior as Unstable_TriggerBehavior, } from "./primitives/composer/trigger/index.js";
|
|
111
|
+
import type { TriggerMatch, TriggerMatcher } from "./primitives/composer/trigger/index.js";
|
|
112
|
+
/** @deprecated Use `TriggerMatch` instead. */
|
|
113
|
+
export type Unstable_TriggerMatch = TriggerMatch;
|
|
114
|
+
/** @deprecated Use `TriggerMatcher` instead. */
|
|
115
|
+
export type Unstable_TriggerMatcher = TriggerMatcher;
|
|
116
|
+
export type { DirectiveFormatter, DirectiveSegment, TriggerAdapter, TriggerCategory, TriggerItem, Unstable_DirectiveFormatter, Unstable_DirectiveSegment, Unstable_TriggerItem, } from "@assistant-ui/core";
|
|
117
|
+
export { defaultDirectiveFormatter, unstable_defaultDirectiveFormatter, } from "@assistant-ui/core";
|
|
112
118
|
export { unstable_useComposerInputHistory, type Unstable_ComposerInputHistory, } from "./unstable/useComposerInputHistory.js";
|
|
113
119
|
export { unstable_useComposerInput, unstable_useTriggerPopoverAriaProps, type Unstable_UseComposerInputOptions, type Unstable_ComposerInput, type Unstable_TriggerPopoverAriaProps, } from "./unstable/useComposerInput.js";
|
|
114
120
|
export type { Assistant } from "./augmentations.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAGA,OAAO,EACL,MAAM,EACN,WAAW,EACX,SAAS,E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AAY,EACV,YAAY,EACZ,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,iCAAiC,EACjC,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,YAAY,EACV,WAAW,EACX,uBAAuB,EACvB,SAAS,EACT,mBAAmB,GACpB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -64,9 +64,9 @@ import { McpAppRenderer } from "./mcp-apps/McpAppRenderer.js";
|
|
|
64
64
|
import { McpAppsRemoteHost } from "./mcp-apps/McpAppsRemoteHost.js";
|
|
65
65
|
import { defaultWebMcpFilter } from "./unstable/webmcp/convertTools.js";
|
|
66
66
|
import { unstable_useWebMcpProvider } from "./unstable/webmcp/useWebMcpProvider.js";
|
|
67
|
-
import { ChainOfThoughtPartByIndexProvider, DataRenderers, GenerativeUIRender, GenerativeUIRenderError, Interactables, RuntimeAdapterProvider, Tools, 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, useCloudThreadListRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume } from "@assistant-ui/core/react";
|
|
67
|
+
import { ChainOfThoughtPartByIndexProvider, DataRenderers, GenerativeUIRender, GenerativeUIRenderError, Interactables, RuntimeAdapterProvider, Tools, 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, useCloudThreadListRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume } from "@assistant-ui/core/react";
|
|
68
68
|
import { AuiConfig, AuiIf, AuiProvider, useAui, useAuiEvent, useAuiState } from "@assistant-ui/store";
|
|
69
69
|
import { ChainOfThoughtClient, ExternalThread, InMemoryThreadList, ModelContext as ModelContextClient, RemoteThreadList, SingleThreadList, Suggestions } from "@assistant-ui/core/store";
|
|
70
|
-
import { AssistantFrameHost, AssistantFrameProvider, CompositeAttachmentAdapter, ExportedMessageRepository, FRAME_MESSAGE_CHANNEL, InMemoryThreadListAdapter, MessageNotSentError, ModelContextRegistry, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, WebSpeechDictationAdapter, WebSpeechSynthesisAdapter, bindExternalStoreMessage, createMessageQueue, createSuggestionAdapter, createVoiceSession, fromThreadMessageLike, generateId, getExternalStoreMessages, isMessageNotSentError, mergeModelContexts, pickExternalStoreSharedOptions, tool, toolApprovalAcceptsText, unstable_defaultDirectiveFormatter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions } from "@assistant-ui/core";
|
|
70
|
+
import { AssistantFrameHost, AssistantFrameProvider, CompositeAttachmentAdapter, ExportedMessageRepository, FRAME_MESSAGE_CHANNEL, InMemoryThreadListAdapter, MessageNotSentError, ModelContextRegistry, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, WebSpeechDictationAdapter, WebSpeechSynthesisAdapter, 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";
|
|
71
71
|
import { AssistantCloud, readAnonymousRefreshToken } from "assistant-cloud";
|
|
72
|
-
export { actionBarMore_exports as ActionBarMorePrimitive, actionBar_exports as ActionBarPrimitive, AssistantCloud, AssistantFrameHost, AssistantFrameProvider, assistantModal_exports as AssistantModalPrimitive, AssistantRuntimeProvider, attachment_exports as AttachmentPrimitive, AuiConfig, AuiIf, AuiProvider, branchPicker_exports as BranchPickerPrimitive, ChainOfThoughtByIndicesProvider, ChainOfThoughtClient, ChainOfThoughtPartByIndexProvider, chainOfThought_exports as ChainOfThoughtPrimitive, CloudFileAttachmentAdapter, CloudRendererHost, ComposerAttachmentByIndexProvider, composer_exports as ComposerPrimitive, CompositeAttachmentAdapter, DataRenderers, DevToolsHooks, DevToolsProviderApi, error_exports as ErrorPrimitive, ExportedMessageRepository, ExternalThread, FRAME_MESSAGE_CHANNEL, GenerativeUIRender, GenerativeUIRenderError, internal_exports as INTERNAL, InMemoryThreadList, InMemoryThreadListAdapter, Interactables, McpAppRenderer, McpAppsRemoteHost, MessageAttachmentByIndexProvider, MessageByIndexProvider, MessageNotSentError, messagePart_exports as MessagePartPrimitive, message_exports as MessagePrimitive, MessageProvider, ModelContextClient, ModelContextRegistry, PartByIndexProvider, queueItem_exports as QueueItemPrimitive, ReadonlyThreadProvider, RemoteThreadList, RuntimeAdapterProvider, selectionToolbar_exports as SelectionToolbarPrimitive, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SingleThreadList, SuggestionByIndexProvider, suggestion_exports as SuggestionPrimitive, Suggestions, TextMessagePartProvider, ThreadListItemByIndexProvider, threadListItemMore_exports as ThreadListItemMorePrimitive, threadListItem_exports as ThreadListItemPrimitive, ThreadListItemRuntimeProvider, threadList_exports as ThreadListPrimitive, thread_exports as ThreadPrimitive, Tools, WebSpeechDictationAdapter, WebSpeechSynthesisAdapter, bindExternalStoreMessage, createMessageQueue, createSimpleTitleAdapter, createSuggestionAdapter, createVoiceSession, defineMcpToolkit, defineToolkit, externalTool, fromThreadMessageLike, generateId, getExternalStoreMessages, getMcpAppFromToolPart, groupPartByType, hitl, hitlTool, humanTool, isMessageNotSentError, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, makeAssistantVisible, mergeModelContexts, pickExternalStoreSharedOptions, providerTool, readAnonymousRefreshToken, stubTool, tool, toolApprovalAcceptsText, unstable_Interactables, convertExternalMessages as unstable_convertExternalMessages, createExternalMessageConversionCache as unstable_createExternalMessageConversionCache, createMessageConverter as unstable_createMessageConverter, unstable_defaultDirectiveFormatter, defaultWebMcpFilter as unstable_defaultWebMcpFilter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions, unstable_interactableTool, unstable_useComposerInput, unstable_useComposerInputHistory, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useLiveCompletionAdapter, unstable_useMentionAdapter, unstable_useMessageStallDetection, unstable_useSlashCommandAdapter, unstable_useThreadMessageIds, unstable_useTriggerPopoverAriaProps, useTriggerPopoverRootContext as unstable_useTriggerPopoverRootContext, useTriggerPopoverRootContextOptional as unstable_useTriggerPopoverRootContextOptional, useTriggerPopoverScopeContext as unstable_useTriggerPopoverScopeContext, useTriggerPopoverScopeContextOptional as unstable_useTriggerPopoverScopeContextOptional, useTriggerPopoverTriggers as unstable_useTriggerPopoverTriggers, useTriggerPopoverTriggersOptional as unstable_useTriggerPopoverTriggersOptional, unstable_useWebMcpProvider, useAssistantContext, useAssistantDataUI, useAssistantFrameHost, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAssistantTransportRuntime, useAssistantTransportSendCommand, useAssistantTransportState, useAui, useAuiEvent, useAuiState, useAuiToolOverrides, useCloudThreadListAdapter, useCloudThreadListRuntime, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useLocalRuntime, useMessagePartData, useMessagePartFile, useMessagePartImage, useMessagePartReasoning, useMessagePartSource, useMessagePartText, useMessageQuote, useMessageTiming, useRemoteThreadListRuntime, useRuntimeAdapters, useScrollLock, useSmooth, useThreadViewport, useThreadViewportAutoScroll, useThreadViewportStore, useToolArgsStatus, useToolCallElapsed, useVoiceControls, useVoiceState, useVoiceVolume };
|
|
72
|
+
export { actionBarMore_exports as ActionBarMorePrimitive, actionBar_exports as ActionBarPrimitive, AssistantCloud, AssistantFrameHost, AssistantFrameProvider, assistantModal_exports as AssistantModalPrimitive, AssistantRuntimeProvider, attachment_exports as AttachmentPrimitive, AuiConfig, AuiIf, AuiProvider, branchPicker_exports as BranchPickerPrimitive, ChainOfThoughtByIndicesProvider, ChainOfThoughtClient, ChainOfThoughtPartByIndexProvider, chainOfThought_exports as ChainOfThoughtPrimitive, CloudFileAttachmentAdapter, CloudRendererHost, ComposerAttachmentByIndexProvider, composer_exports as ComposerPrimitive, CompositeAttachmentAdapter, DataRenderers, DevToolsHooks, DevToolsProviderApi, error_exports as ErrorPrimitive, ExportedMessageRepository, ExternalThread, FRAME_MESSAGE_CHANNEL, GenerativeUIRender, GenerativeUIRenderError, internal_exports as INTERNAL, InMemoryThreadList, InMemoryThreadListAdapter, Interactables, McpAppRenderer, McpAppsRemoteHost, MessageAttachmentByIndexProvider, MessageByIndexProvider, MessageNotSentError, messagePart_exports as MessagePartPrimitive, message_exports as MessagePrimitive, MessageProvider, ModelContextClient, ModelContextRegistry, PartByIndexProvider, queueItem_exports as QueueItemPrimitive, ReadonlyThreadProvider, RemoteThreadList, RuntimeAdapterProvider, selectionToolbar_exports as SelectionToolbarPrimitive, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SingleThreadList, SuggestionByIndexProvider, suggestion_exports as SuggestionPrimitive, Suggestions, TextMessagePartProvider, ThreadListItemByIndexProvider, threadListItemMore_exports as ThreadListItemMorePrimitive, threadListItem_exports as ThreadListItemPrimitive, ThreadListItemRuntimeProvider, threadList_exports as ThreadListPrimitive, thread_exports as ThreadPrimitive, Tools, WebSpeechDictationAdapter, WebSpeechSynthesisAdapter, bindExternalStoreMessage, createMessageQueue, createSimpleTitleAdapter, createSuggestionAdapter, createThreadRowsSelector, createVoiceSession, defaultDirectiveFormatter, defineMcpToolkit, defineToolkit, externalTool, fromThreadMessageLike, generateId, getExternalStoreMessages, getMcpAppFromToolPart, groupPartByType, hitl, hitlTool, humanTool, isMessageNotSentError, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, makeAssistantVisible, mergeModelContexts, pickExternalStoreSharedOptions, providerTool, readAnonymousRefreshToken, stubTool, tool, toolApprovalAcceptsText, unstable_Interactables, convertExternalMessages as unstable_convertExternalMessages, createExternalMessageConversionCache as unstable_createExternalMessageConversionCache, createMessageConverter as unstable_createMessageConverter, unstable_defaultDirectiveFormatter, defaultWebMcpFilter as unstable_defaultWebMcpFilter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions, unstable_interactableTool, unstable_useComposerInput, unstable_useComposerInputHistory, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useLiveCompletionAdapter, unstable_useMentionAdapter, unstable_useMessageStallDetection, unstable_useSlashCommandAdapter, unstable_useThreadMessageIds, unstable_useTriggerPopoverAriaProps, useTriggerPopoverRootContext as unstable_useTriggerPopoverRootContext, useTriggerPopoverRootContextOptional as unstable_useTriggerPopoverRootContextOptional, useTriggerPopoverScopeContext as unstable_useTriggerPopoverScopeContext, useTriggerPopoverScopeContextOptional as unstable_useTriggerPopoverScopeContextOptional, useTriggerPopoverTriggers as unstable_useTriggerPopoverTriggers, useTriggerPopoverTriggersOptional as unstable_useTriggerPopoverTriggersOptional, unstable_useWebMcpProvider, useAssistantContext, useAssistantDataUI, useAssistantFrameHost, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAssistantTransportRuntime, useAssistantTransportSendCommand, useAssistantTransportState, useAui, useAuiEvent, useAuiState, useAuiToolOverrides, useCloudThreadListAdapter, useCloudThreadListRuntime, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useLocalRuntime, useMessagePartData, useMessagePartFile, useMessagePartImage, useMessagePartReasoning, useMessagePartSource, useMessagePartText, useMessageQuote, useMessageTiming, useRemoteThreadListRuntime, useRuntimeAdapters, useScrollLock, useSmooth, useThreadViewport, useThreadViewportAutoScroll, useThreadViewportStore, useToolArgsStatus, useToolCallElapsed, useVoiceControls, useVoiceState, useVoiceVolume };
|
|
@@ -2,6 +2,7 @@ import { type ComponentType } from "react";
|
|
|
2
2
|
export declare const makeAssistantVisible: <T extends ComponentType<any>>(Component: T, config?: {
|
|
3
3
|
clickable?: boolean | undefined;
|
|
4
4
|
editable?: boolean | undefined;
|
|
5
|
+
settleDelayMs?: number | undefined;
|
|
5
6
|
}) => T;
|
|
6
7
|
export default makeAssistantVisible;
|
|
7
8
|
//# sourceMappingURL=makeAssistantVisible.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeAssistantVisible.d.ts","sourceRoot":"","sources":["../../src/model-context/makeAssistantVisible.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,aAAa,EAMnB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"makeAssistantVisible.d.ts","sourceRoot":"","sources":["../../src/model-context/makeAssistantVisible.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,aAAa,EAMnB,MAAM,OAAO,CAAC;AAgGf,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,EAC/D,WAAW,CAAC,EACZ,SAAS;IACP,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC,KA4DsC,CACxC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -6,6 +6,17 @@ import { jsx } from "react/jsx-runtime";
|
|
|
6
6
|
import { tool } from "@assistant-ui/core";
|
|
7
7
|
import { useComposedRefs } from "radix-ui/internal";
|
|
8
8
|
//#region src/model-context/makeAssistantVisible.tsx
|
|
9
|
+
const DEFAULT_ACTION_SETTLE_DELAY_MS = 2e3;
|
|
10
|
+
const MAX_ACTION_SETTLE_DELAY_MS = 2147483647;
|
|
11
|
+
const waitForSettle = async (settleDelayMs) => {
|
|
12
|
+
const delay = Number.isFinite(settleDelayMs) && settleDelayMs >= 0 && settleDelayMs <= MAX_ACTION_SETTLE_DELAY_MS ? settleDelayMs : DEFAULT_ACTION_SETTLE_DELAY_MS;
|
|
13
|
+
if (delay === 0) return;
|
|
14
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
15
|
+
};
|
|
16
|
+
const readActionSettleDelay = (element) => {
|
|
17
|
+
const value = element.dataset.actionSettleDelay;
|
|
18
|
+
return value === void 0 || value.trim() === "" ? DEFAULT_ACTION_SETTLE_DELAY_MS : Number(value);
|
|
19
|
+
};
|
|
9
20
|
const click = tool({
|
|
10
21
|
parameters: {
|
|
11
22
|
type: "object",
|
|
@@ -17,7 +28,7 @@ const click = tool({
|
|
|
17
28
|
const el = document.querySelector(`[data-click-id='${escapedClickId}']`);
|
|
18
29
|
if (el instanceof HTMLElement) {
|
|
19
30
|
el.click();
|
|
20
|
-
await
|
|
31
|
+
await waitForSettle(readActionSettleDelay(el));
|
|
21
32
|
return {};
|
|
22
33
|
} else return "Element not found";
|
|
23
34
|
}
|
|
@@ -44,15 +55,17 @@ const edit = tool({
|
|
|
44
55
|
setNativeValue(el, value);
|
|
45
56
|
el.dispatchEvent(new Event("input", { bubbles: true }));
|
|
46
57
|
el.dispatchEvent(new Event("change", { bubbles: true }));
|
|
47
|
-
await
|
|
58
|
+
await waitForSettle(readActionSettleDelay(el));
|
|
48
59
|
return {};
|
|
49
60
|
} else return "Element not found";
|
|
50
61
|
}
|
|
51
62
|
});
|
|
52
63
|
const ReadableContext = createContext(false);
|
|
53
64
|
const makeAssistantVisible = (Component, config) => {
|
|
65
|
+
const settleDelayMs = config?.settleDelayMs ?? DEFAULT_ACTION_SETTLE_DELAY_MS;
|
|
66
|
+
if (!Number.isFinite(settleDelayMs) || settleDelayMs < 0 || settleDelayMs > MAX_ACTION_SETTLE_DELAY_MS) throw new RangeError(`settleDelayMs must be between 0 and ${MAX_ACTION_SETTLE_DELAY_MS}`);
|
|
54
67
|
const ReadableComponent = forwardRef((props, outerRef) => {
|
|
55
|
-
const $ = c(
|
|
68
|
+
const $ = c(16);
|
|
56
69
|
const isNestedReadable = useContext(ReadableContext);
|
|
57
70
|
const clickId = useId();
|
|
58
71
|
const componentRef = useRef(null);
|
|
@@ -104,23 +117,29 @@ const makeAssistantVisible = (Component, config) => {
|
|
|
104
117
|
t5 = $[9];
|
|
105
118
|
}
|
|
106
119
|
let t6;
|
|
107
|
-
if ($[10]
|
|
108
|
-
t6 =
|
|
120
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
121
|
+
t6 = config?.settleDelayMs !== void 0 && (config.clickable || config.editable) ? { "data-action-settle-delay": settleDelayMs } : {};
|
|
122
|
+
$[10] = t6;
|
|
123
|
+
} else t6 = $[10];
|
|
124
|
+
let t7;
|
|
125
|
+
if ($[11] !== ref || $[12] !== t3 || $[13] !== t4 || $[14] !== t5) {
|
|
126
|
+
t7 = /* @__PURE__ */ jsx(ReadableContext.Provider, {
|
|
109
127
|
value: true,
|
|
110
128
|
children: /* @__PURE__ */ jsx(Component, {
|
|
111
129
|
...t3,
|
|
112
130
|
...t4,
|
|
113
131
|
...t5,
|
|
132
|
+
...t6,
|
|
114
133
|
ref
|
|
115
134
|
})
|
|
116
135
|
});
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
} else
|
|
123
|
-
return
|
|
136
|
+
$[11] = ref;
|
|
137
|
+
$[12] = t3;
|
|
138
|
+
$[13] = t4;
|
|
139
|
+
$[14] = t5;
|
|
140
|
+
$[15] = t7;
|
|
141
|
+
} else t7 = $[15];
|
|
142
|
+
return t7;
|
|
124
143
|
});
|
|
125
144
|
ReadableComponent.displayName = Component.displayName;
|
|
126
145
|
return ReadableComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeAssistantVisible.js","names":["c","_c","useEffect","useRef","forwardRef","ComponentType","ForwardedRef","PropsWithoutRef","useId","createContext","useContext","useAui","useComposedRefs","tool","
|
|
1
|
+
{"version":3,"file":"makeAssistantVisible.js","names":["c","_c","useEffect","useRef","forwardRef","ComponentType","ForwardedRef","PropsWithoutRef","useId","createContext","useContext","useAui","useComposedRefs","tool","DEFAULT_ACTION_SETTLE_DELAY_MS","MAX_ACTION_SETTLE_DELAY_MS","waitForSettle","settleDelayMs","delay","Number","isFinite","Promise","resolve","setTimeout","readActionSettleDelay","element","HTMLElement","value","dataset","actionSettleDelay","undefined","trim","click","parameters","type","properties","clickId","required","execute","escapedClickId","CSS","escape","el","document","querySelector","setNativeValue","HTMLInputElement","HTMLTextAreaElement","prototype","setter","Object","getOwnPropertyDescriptor","set","call","edit","editId","escapedEditId","dispatchEvent","Event","bubbles","ReadableContext","makeAssistantVisible","Component","T","config","clickable","editable","RangeError","ReadableComponent","props","outerRef","$","isNestedReadable","componentRef","aui","t0","Symbol","for","t1","modelContext","register","getModelContext","tools","system","current","outerHTML","t2","ref","t3","t4","t5","t6","t7","displayName","_c"],"sources":["../../src/model-context/makeAssistantVisible.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n useEffect,\n useRef,\n forwardRef,\n type ComponentType,\n type ForwardedRef,\n type PropsWithoutRef,\n useId,\n createContext,\n useContext,\n} from \"react\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { useComposedRefs } from \"radix-ui/internal\";\nimport { tool } from \"@assistant-ui/core\";\n\nconst DEFAULT_ACTION_SETTLE_DELAY_MS = 2000;\nconst MAX_ACTION_SETTLE_DELAY_MS = 2_147_483_647;\n\nconst waitForSettle = async (settleDelayMs: number) => {\n const delay =\n Number.isFinite(settleDelayMs) &&\n settleDelayMs >= 0 &&\n settleDelayMs <= MAX_ACTION_SETTLE_DELAY_MS\n ? settleDelayMs\n : DEFAULT_ACTION_SETTLE_DELAY_MS;\n if (delay === 0) return;\n await new Promise<void>((resolve) => setTimeout(resolve, delay));\n};\n\nconst readActionSettleDelay = (element: HTMLElement) => {\n const value = element.dataset.actionSettleDelay;\n return value === undefined || value.trim() === \"\"\n ? DEFAULT_ACTION_SETTLE_DELAY_MS\n : Number(value);\n};\n\nconst click = tool({\n parameters: {\n type: \"object\",\n properties: {\n clickId: {\n type: \"string\",\n },\n },\n required: [\"clickId\"],\n },\n execute: async ({ clickId }: { clickId: string }) => {\n const escapedClickId = CSS.escape(clickId);\n const el = document.querySelector(`[data-click-id='${escapedClickId}']`);\n if (el instanceof HTMLElement) {\n el.click();\n await waitForSettle(readActionSettleDelay(el));\n return {};\n } else {\n return \"Element not found\";\n }\n },\n});\n\nconst setNativeValue = (\n element: HTMLInputElement | HTMLTextAreaElement,\n value: string,\n) => {\n const prototype =\n element instanceof HTMLInputElement\n ? HTMLInputElement.prototype\n : HTMLTextAreaElement.prototype;\n const setter = Object.getOwnPropertyDescriptor(prototype, \"value\")?.set;\n\n if (setter) {\n setter.call(element, value);\n } else {\n element.value = value;\n }\n};\n\nconst edit = tool({\n parameters: {\n type: \"object\",\n properties: {\n editId: {\n type: \"string\",\n },\n value: {\n type: \"string\",\n },\n },\n required: [\"editId\", \"value\"],\n },\n execute: async ({ editId, value }: { editId: string; value: string }) => {\n const escapedEditId = CSS.escape(editId);\n const el = document.querySelector(`[data-edit-id='${escapedEditId}']`);\n if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement) {\n setNativeValue(el, value);\n el.dispatchEvent(new Event(\"input\", { bubbles: true }));\n el.dispatchEvent(new Event(\"change\", { bubbles: true }));\n await waitForSettle(readActionSettleDelay(el));\n return {};\n } else {\n return \"Element not found\";\n }\n },\n});\n\nconst ReadableContext = createContext<boolean>(false);\n\nexport const makeAssistantVisible = <T extends ComponentType<any>>(\n Component: T,\n config?: {\n clickable?: boolean | undefined;\n editable?: boolean | undefined;\n settleDelayMs?: number | undefined;\n },\n) => {\n const settleDelayMs = config?.settleDelayMs ?? DEFAULT_ACTION_SETTLE_DELAY_MS;\n if (\n !Number.isFinite(settleDelayMs) ||\n settleDelayMs < 0 ||\n settleDelayMs > MAX_ACTION_SETTLE_DELAY_MS\n ) {\n throw new RangeError(\n `settleDelayMs must be between 0 and ${MAX_ACTION_SETTLE_DELAY_MS}`,\n );\n }\n\n const ReadableComponent = forwardRef(\n (props: PropsWithoutRef<T>, outerRef: ForwardedRef<any>) => {\n const isNestedReadable = useContext(ReadableContext);\n\n const clickId = useId();\n const componentRef = useRef<HTMLElement>(null);\n\n const aui = useAui();\n\n const { clickable, editable } = config ?? {};\n useEffect(() => {\n return aui.modelContext.register({\n getModelContext: () => {\n return {\n tools: {\n ...(clickable ? { click } : {}),\n ...(editable ? { edit } : {}),\n },\n system: !isNestedReadable // only pass content if this readable isn't nested in another readable\n ? componentRef.current?.outerHTML\n : undefined,\n };\n },\n });\n }, [isNestedReadable, aui, clickable, editable]);\n\n const ref = useComposedRefs(componentRef, outerRef);\n\n return (\n <ReadableContext.Provider value={true}>\n <Component\n {...(props as any)}\n {...(config?.clickable ? { \"data-click-id\": clickId } : {})}\n {...(config?.editable ? { \"data-edit-id\": clickId } : {})}\n {...(config?.settleDelayMs !== undefined &&\n (config.clickable || config.editable)\n ? { \"data-action-settle-delay\": settleDelayMs }\n : {})}\n ref={ref}\n />\n </ReadableContext.Provider>\n );\n },\n );\n\n ReadableComponent.displayName = Component.displayName;\n\n return ReadableComponent as unknown as T;\n};\n\nexport default makeAssistantVisible;\n"],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B,MAAAlB,EAAA,QAAAmB,IAAA;GARVE,KAAA,oBAAA,gBAAA,UAAA;IAAiC,OAAA;IAC/B,UAAA,oBAAC,WAAD;KAAU,GACHJ;KAAY,GACZC;KAAqD,GACrDC;KAAmD,GACnDC;KAIAJ;IAAG,CAAA;GAEZ,CAAA;GAA2BhB,EAAA,MAAAgB;GAAAhB,EAAA,MAAAiB;GAAAjB,EAAA,MAAAkB;GAAAlB,EAAA,MAAAmB;GAAAnB,EAAA,MAAAqB;EAAA,OAAAA,KAAArB,EAAA;EAAA,OAX3BqB;CAW2B,CAGjC;CAEAxB,kBAAkByB,cAAc/B,UAAU+B;CAE1C,OAAOzB;AACT"}
|
|
@@ -79,7 +79,7 @@ export declare namespace ComposerPrimitiveInput {
|
|
|
79
79
|
* keyboard shortcuts, file paste support, and intelligent focus management.
|
|
80
80
|
* It integrates with the composer context to manage message state and submission.
|
|
81
81
|
*
|
|
82
|
-
* When rendered inside `
|
|
82
|
+
* When rendered inside `TriggerPopoverRoot` and a popover is open, the
|
|
83
83
|
* underlying `<textarea>` automatically receives `aria-controls`,
|
|
84
84
|
* `aria-expanded`, `aria-haspopup`, and `aria-activedescendant` for the
|
|
85
85
|
* combobox relationship. These computed attributes override user-provided
|
|
@@ -22,7 +22,7 @@ const TOUCH_PRIMARY_QUERY = "(pointer: coarse) and (not (any-pointer: fine))";
|
|
|
22
22
|
* keyboard shortcuts, file paste support, and intelligent focus management.
|
|
23
23
|
* It integrates with the composer context to manage message state and submission.
|
|
24
24
|
*
|
|
25
|
-
* When rendered inside `
|
|
25
|
+
* When rendered inside `TriggerPopoverRoot` and a popover is open, the
|
|
26
26
|
* underlying `<textarea>` automatically receives `aria-controls`,
|
|
27
27
|
* `aria-expanded`, `aria-haspopup`, and `aria-activedescendant` for the
|
|
28
28
|
* combobox relationship. These computed attributes override user-provided
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposerInput.js","names":["composeEventHandlers","useComposedRefs","Slot","ClipboardEvent","KeyboardEvent","ReactElement","ReactNode","forwardRef","useCallback","useEffect","useRef","isValidElement","TextareaAutosize","TextareaAutosizeProps","TextareaHeightChangeMeta","useEscapeKeydown","useOnScrollToBottom","useMediaQuery","renderSlot","isCompositionKey","useAui","flushTapSync","useComposerInputPluginRegistryOptional","useComposerCompactContextOptional","useComposerInputDisabled","useComposerInputValue","useTriggerPopoverAriaProps","TOUCH_PRIMARY_QUERY","ComposerPrimitiveInput","Element","HTMLTextAreaElement","BaseProps","asChild","render","cancelOnEscape","unstable_focusOnRunStart","unstable_focusOnScrollToBottom","unstable_focusOnThreadSwitched","unstable_insertNewlineOnTouchEnter","addAttachmentOnPaste","SubmitModeProps","submitMode","submitOnEnter","Props","autoFocus","disabled","disabledProp","onChange","onKeyDown","onPaste","onSelect","onHeightChange","rest","forwardedRef","aui","pluginRegistry","compactContext","declaredSubmitMode","isTouchPrimary","effectiveSubmitMode","value","isDisabled","textareaRef","ref","compositionRef","e","current","contains","target","Node","plugin","getPlugins","handleKeyDown","composer","getState","canCancel","cancel","preventDefault","handleKeyPress","nativeEvent","key","threadState","thread","hasQueue","capabilities","queue","shiftKey","ctrlKey","metaKey","canSend","send","steer","isRunning","voice","undefined","shouldSubmit","closest","requestSubmit","handlePaste","threadCapabilities","files","Array","from","clipboardData","attachments","length","Promise","all","map","file","addAttachment","handleHeightChange","height","meta","el","cs","getComputedStyle","contentHeight","boxSizing","parseFloat","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","Math","round","rowHeight","setMultiline","autoFocusEnabled","focus","textarea","preventScroll","setSelectionRange","type","on","ariaComboboxProps","inputProps","name","const","React","ForwardedRef","ChangeEvent","isEditing","nativeIsComposing","isComposing","setText","pos","selectionStart","setCursorPosition","onCompositionStart","CompositionEventHandler","onCompositionEnd","CompositionEvent","SyntheticEvent","children","Component","Root","displayName"],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"radix-ui/internal\";\nimport { useComposedRefs } from \"radix-ui/internal\";\nimport { Slot } from \"radix-ui\";\nimport {\n type ClipboardEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n isValidElement,\n} from \"react\";\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n type TextareaHeightChangeMeta,\n} from \"react-textarea-autosize\";\nimport { useEscapeKeydown } from \"radix-ui/internal\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useMediaQuery } from \"../../utils/hooks/useMediaQuery\";\nimport { renderSlot } from \"../../utils/Primitive\";\nimport { isCompositionKey } from \"../../utils/isCompositionKey\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { flushTapSync } from \"@assistant-ui/tap\";\nimport { useComposerInputPluginRegistryOptional } from \"./ComposerInputPluginContext\";\nimport { useComposerCompactContextOptional } from \"./ComposerCompactContext\";\nimport {\n useComposerInputDisabled,\n useComposerInputValue,\n useTriggerPopoverAriaProps,\n} from \"./useComposerInputState\";\n\nconst TOUCH_PRIMARY_QUERY = \"(pointer: coarse) and (not (any-pointer: fine))\";\n\nexport namespace ComposerPrimitiveInput {\n export type Element = HTMLTextAreaElement;\n\n type BaseProps = {\n /**\n * Whether to render as a child component using Slot.\n * When true, the component will merge its props with its child.\n */\n asChild?: boolean | undefined;\n /**\n * A React element to use as the input container, with props merged in.\n */\n render?: ReactElement | undefined;\n /**\n * Whether to cancel message composition when Escape is pressed.\n * @default true\n */\n cancelOnEscape?: boolean | undefined;\n /**\n * Whether to automatically focus the input when a new run starts.\n * @default true\n */\n unstable_focusOnRunStart?: boolean | undefined;\n /**\n * Whether to automatically focus the input when scrolling to bottom.\n * @default true\n */\n unstable_focusOnScrollToBottom?: boolean | undefined;\n /**\n * Whether to automatically focus the input when switching threads.\n * @default true\n */\n unstable_focusOnThreadSwitched?: boolean | undefined;\n /**\n * Whether plain Enter on a touch-primary device should insert a newline\n * instead of submitting, detected via\n * `(pointer: coarse) and (not (any-pointer: fine))`. Only takes effect\n * when `submitMode` resolves to `\"enter\"`.\n * @default false\n */\n unstable_insertNewlineOnTouchEnter?: boolean | undefined;\n /**\n * Whether to automatically add pasted files as attachments.\n * @default true\n */\n addAttachmentOnPaste?: boolean | undefined;\n };\n\n type SubmitModeProps =\n | {\n /**\n * Controls how the Enter key submits messages.\n * - \"enter\": Plain Enter submits (Shift+Enter for newline)\n * - \"ctrlEnter\": Ctrl/Cmd+Enter submits (plain Enter for newline)\n * - \"none\": Keyboard submission disabled\n * @default \"enter\"\n */\n submitMode?: \"enter\" | \"ctrlEnter\" | \"none\" | undefined;\n /**\n * @deprecated Use `submitMode` instead\n * @ignore\n */\n submitOnEnter?: never;\n }\n | {\n submitMode?: never;\n /**\n * Whether to submit the message when Enter is pressed (without Shift).\n * @default true\n * @deprecated Use `submitMode` instead. Will be removed in a future version.\n */\n submitOnEnter?: boolean | undefined;\n };\n\n export type Props = TextareaAutosizeProps & BaseProps & SubmitModeProps;\n}\n\n/**\n * A text input component for composing messages.\n *\n * This component provides a rich text input experience with automatic resizing,\n * keyboard shortcuts, file paste support, and intelligent focus management.\n * It integrates with the composer context to manage message state and submission.\n *\n * When rendered inside `Unstable_TriggerPopoverRoot` and a popover is open, the\n * underlying `<textarea>` automatically receives `aria-controls`,\n * `aria-expanded`, `aria-haspopup`, and `aria-activedescendant` for the\n * combobox relationship. These computed attributes override user-provided\n * values for those four ARIA props while the popover is open.\n *\n * @example\n * ```tsx\n * // Ctrl/Cmd+Enter to submit (plain Enter inserts newline)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitMode=\"ctrlEnter\"\n * />\n *\n * // Insert a newline on Enter on touch-primary devices.\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * unstable_insertNewlineOnTouchEnter\n * />\n *\n * // Old API (deprecated, still supported)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitOnEnter={true}\n * />\n * ```\n */\nexport const ComposerPrimitiveInput = forwardRef<\n ComposerPrimitiveInput.Element,\n ComposerPrimitiveInput.Props\n>(\n (\n {\n autoFocus = false,\n asChild,\n render,\n disabled: disabledProp,\n onChange,\n onKeyDown,\n onPaste,\n onSelect,\n submitOnEnter,\n submitMode,\n cancelOnEscape = true,\n unstable_focusOnRunStart = true,\n unstable_focusOnScrollToBottom = true,\n unstable_focusOnThreadSwitched = true,\n unstable_insertNewlineOnTouchEnter = false,\n addAttachmentOnPaste = true,\n onHeightChange,\n ...rest\n },\n forwardedRef,\n ) => {\n const aui = useAui();\n const pluginRegistry = useComposerInputPluginRegistryOptional();\n const compactContext = useComposerCompactContextOptional();\n\n const declaredSubmitMode =\n submitMode ?? (submitOnEnter === false ? \"none\" : \"enter\");\n const isTouchPrimary = useMediaQuery(\n unstable_insertNewlineOnTouchEnter ? TOUCH_PRIMARY_QUERY : null,\n );\n const effectiveSubmitMode =\n unstable_insertNewlineOnTouchEnter &&\n isTouchPrimary &&\n declaredSubmitMode === \"enter\"\n ? \"none\"\n : declaredSubmitMode;\n\n const value = useComposerInputValue();\n const isDisabled = useComposerInputDisabled(disabledProp);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const ref = useComposedRefs(forwardedRef, textareaRef);\n // suppress text/cursor broadcasts during IME composition\n const compositionRef = useRef(false);\n\n useEscapeKeydown((e) => {\n // Only handle ESC if it originated from within this input\n if (!textareaRef.current?.contains(e.target as Node)) return;\n\n // ignore IME composition events\n if (isCompositionKey(e)) return;\n\n // Let registered plugins (mention, slash command, etc.) handle Escape first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (!cancelOnEscape) return;\n\n const composer = aui.composer;\n if (composer.getState().canCancel) {\n composer.cancel();\n e.preventDefault();\n }\n });\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (isDisabled) return;\n\n // ignore IME composition events\n if (isCompositionKey(e.nativeEvent)) return;\n\n // Let registered plugins (mention, slash command, etc.) handle keyboard events first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (e.key === \"Enter\") {\n const threadState = aui.thread.getState();\n const hasQueue = threadState.capabilities.queue;\n\n // Steer hotkey: Cmd/Ctrl+Shift+Enter (respects submitMode=\"none\" and canSend)\n if (\n e.shiftKey &&\n (e.ctrlKey || e.metaKey) &&\n hasQueue &&\n declaredSubmitMode !== \"none\" &&\n aui.composer.getState().canSend\n ) {\n e.preventDefault();\n aui.composer.send({ steer: true });\n return;\n }\n\n // Regular newline: Shift+Enter\n if (e.shiftKey) return;\n\n // Block submission when running unless queue is supported; a voice\n // session leaves the decision to canSend\n if (\n threadState.isRunning &&\n !hasQueue &&\n threadState.voice === undefined\n )\n return;\n\n let shouldSubmit = false;\n if (effectiveSubmitMode === \"ctrlEnter\") {\n shouldSubmit = e.ctrlKey || e.metaKey;\n } else if (effectiveSubmitMode === \"enter\") {\n shouldSubmit = true;\n }\n\n if (shouldSubmit) {\n e.preventDefault();\n textareaRef.current?.closest(\"form\")?.requestSubmit();\n }\n }\n };\n\n const handlePaste = async (e: ClipboardEvent<HTMLTextAreaElement>) => {\n if (!addAttachmentOnPaste) return;\n const threadCapabilities = aui.thread.getState().capabilities;\n const files = Array.from(e.clipboardData?.files || []);\n\n if (threadCapabilities.attachments && files.length > 0) {\n e.preventDefault();\n await Promise.all(\n files.map(async (file) => {\n try {\n await aui.composer.addAttachment(file);\n } catch {\n // The composer runtime emits composer.attachmentAddError before rejecting.\n }\n }),\n );\n }\n };\n\n const handleHeightChange = (\n height: number,\n meta: TextareaHeightChangeMeta,\n ) => {\n onHeightChange?.(height, meta);\n if (!compactContext) return;\n const el = textareaRef.current;\n if (!el || el.value === \"\") return;\n const cs = getComputedStyle(el);\n const contentHeight =\n cs.boxSizing === \"border-box\"\n ? height -\n parseFloat(cs.paddingTop) -\n parseFloat(cs.paddingBottom) -\n parseFloat(cs.borderTopWidth) -\n parseFloat(cs.borderBottomWidth)\n : height;\n if (Math.round(contentHeight / meta.rowHeight) > 1) {\n compactContext.setMultiline(true);\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(textarea.value.length, textarea.value.length);\n }, [autoFocusEnabled]);\n\n useEffect(() => focus(), [focus]);\n\n useOnScrollToBottom(() => {\n if (\n aui.composer.getState().type === \"thread\" &&\n unstable_focusOnScrollToBottom\n ) {\n focus();\n }\n });\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnRunStart\n )\n return undefined;\n\n return aui.on(\"thread.runStart\", focus);\n }, [unstable_focusOnRunStart, focus, aui]);\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnThreadSwitched\n )\n return undefined;\n\n return aui.on(\"threads.selectionChanged\", focus);\n }, [unstable_focusOnThreadSwitched, focus, aui]);\n\n useEffect(() => {\n if (value === \"\") compactContext?.setMultiline(false);\n }, [value, compactContext]);\n\n const ariaComboboxProps = useTriggerPopoverAriaProps();\n\n const inputProps = {\n name: \"input\" as const,\n value,\n ...rest,\n ...ariaComboboxProps,\n ref: ref as React.ForwardedRef<HTMLTextAreaElement>,\n disabled: isDisabled,\n onChange: composeEventHandlers(\n onChange,\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (!aui.composer.getState().isEditing) return;\n const nativeIsComposing =\n (e.nativeEvent as { isComposing?: boolean }).isComposing === true;\n // recover stuck compositionRef when the browser drops compositionend\n if (compositionRef.current && !nativeIsComposing) {\n compositionRef.current = false;\n }\n const isComposing = nativeIsComposing || compositionRef.current;\n // keep controlled value in sync mid-IME so react does not reset the textarea to a stale value\n flushTapSync(() => {\n aui.composer.setText(e.target.value);\n });\n if (isComposing) return;\n const pos = e.target.selectionStart ?? e.target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onKeyDown: composeEventHandlers(onKeyDown, handleKeyPress),\n onCompositionStart: composeEventHandlers(\n (rest as { onCompositionStart?: React.CompositionEventHandler })\n .onCompositionStart,\n () => {\n compositionRef.current = true;\n },\n ),\n onCompositionEnd: composeEventHandlers(\n (rest as { onCompositionEnd?: React.CompositionEventHandler })\n .onCompositionEnd,\n (e: React.CompositionEvent<HTMLTextAreaElement>) => {\n compositionRef.current = false;\n if (!aui.composer.getState().isEditing) return;\n const target = e.target as HTMLTextAreaElement;\n flushTapSync(() => {\n aui.composer.setText(target.value);\n });\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onSelect: composeEventHandlers(\n onSelect,\n (e: React.SyntheticEvent<HTMLTextAreaElement>) => {\n if (compositionRef.current) return;\n const target = e.target as HTMLTextAreaElement;\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onPaste: composeEventHandlers(onPaste, handlePaste),\n ...(compactContext\n ? { onHeightChange: handleHeightChange }\n : onHeightChange !== undefined\n ? { onHeightChange }\n : {}),\n };\n\n if (render && isValidElement(render)) {\n return renderSlot(\n render,\n (rest as { children?: ReactNode }).children,\n inputProps,\n );\n }\n\n const Component = asChild ? Slot.Root : TextareaAutosize;\n return <Component {...inputProps} />;\n },\n);\n\nComposerPrimitiveInput.displayName = \"ComposerPrimitive.Input\";\n"],"mappings":";;;;;;;;;;;;;;;;AAmCA,MAAM2B,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiH5B,MAAaC,yBAAyBrB,YAKlC,EACEqC,YAAY,OACZZ,SACAC,QACAY,UAAUC,cACVC,UACAC,WACAC,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kB/E,SAAOR,MAAM6C;GAClD,IAAIlD,gBACF,KAAK,MAAMe,YAAUf,eAAegB,WAAW,GAC7CD,SAAO8E,kBAAkBF,KAAG;EAGlC,CACF;EACAjG,SAASjD,qBAAqBiD,SAASiD,WAAW;EAClD,GAAI1C,iBACA,EAAEL,gBAAgB4D,mBAAmB,IACrC5D,mBAAmB2C,KAAAA,IACjB,EAAE3C,eAAe,IACjB,CAAC;CACT;CAEA,IAAIlB,UAAUtB,eAAesB,MAAM,GACjC,OAAOf,WACLe,QACCmB,KAAkCsG,UACnClB,UACF;CAGF,MAAMmB,YAAY3H,UAAU9B,KAAK0J,OAAOhJ;CACxC,OAAO,oBAAC,WAAD,EAAW,GAAI4H,WAAW,CAAA;AACnC,CACF;AAEA5G,uBAAuBiI,cAAc"}
|
|
1
|
+
{"version":3,"file":"ComposerInput.js","names":["composeEventHandlers","useComposedRefs","Slot","ClipboardEvent","KeyboardEvent","ReactElement","ReactNode","forwardRef","useCallback","useEffect","useRef","isValidElement","TextareaAutosize","TextareaAutosizeProps","TextareaHeightChangeMeta","useEscapeKeydown","useOnScrollToBottom","useMediaQuery","renderSlot","isCompositionKey","useAui","flushTapSync","useComposerInputPluginRegistryOptional","useComposerCompactContextOptional","useComposerInputDisabled","useComposerInputValue","useTriggerPopoverAriaProps","TOUCH_PRIMARY_QUERY","ComposerPrimitiveInput","Element","HTMLTextAreaElement","BaseProps","asChild","render","cancelOnEscape","unstable_focusOnRunStart","unstable_focusOnScrollToBottom","unstable_focusOnThreadSwitched","unstable_insertNewlineOnTouchEnter","addAttachmentOnPaste","SubmitModeProps","submitMode","submitOnEnter","Props","autoFocus","disabled","disabledProp","onChange","onKeyDown","onPaste","onSelect","onHeightChange","rest","forwardedRef","aui","pluginRegistry","compactContext","declaredSubmitMode","isTouchPrimary","effectiveSubmitMode","value","isDisabled","textareaRef","ref","compositionRef","e","current","contains","target","Node","plugin","getPlugins","handleKeyDown","composer","getState","canCancel","cancel","preventDefault","handleKeyPress","nativeEvent","key","threadState","thread","hasQueue","capabilities","queue","shiftKey","ctrlKey","metaKey","canSend","send","steer","isRunning","voice","undefined","shouldSubmit","closest","requestSubmit","handlePaste","threadCapabilities","files","Array","from","clipboardData","attachments","length","Promise","all","map","file","addAttachment","handleHeightChange","height","meta","el","cs","getComputedStyle","contentHeight","boxSizing","parseFloat","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","Math","round","rowHeight","setMultiline","autoFocusEnabled","focus","textarea","preventScroll","setSelectionRange","type","on","ariaComboboxProps","inputProps","name","const","React","ForwardedRef","ChangeEvent","isEditing","nativeIsComposing","isComposing","setText","pos","selectionStart","setCursorPosition","onCompositionStart","CompositionEventHandler","onCompositionEnd","CompositionEvent","SyntheticEvent","children","Component","Root","displayName"],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"radix-ui/internal\";\nimport { useComposedRefs } from \"radix-ui/internal\";\nimport { Slot } from \"radix-ui\";\nimport {\n type ClipboardEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n isValidElement,\n} from \"react\";\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n type TextareaHeightChangeMeta,\n} from \"react-textarea-autosize\";\nimport { useEscapeKeydown } from \"radix-ui/internal\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useMediaQuery } from \"../../utils/hooks/useMediaQuery\";\nimport { renderSlot } from \"../../utils/Primitive\";\nimport { isCompositionKey } from \"../../utils/isCompositionKey\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { flushTapSync } from \"@assistant-ui/tap\";\nimport { useComposerInputPluginRegistryOptional } from \"./ComposerInputPluginContext\";\nimport { useComposerCompactContextOptional } from \"./ComposerCompactContext\";\nimport {\n useComposerInputDisabled,\n useComposerInputValue,\n useTriggerPopoverAriaProps,\n} from \"./useComposerInputState\";\n\nconst TOUCH_PRIMARY_QUERY = \"(pointer: coarse) and (not (any-pointer: fine))\";\n\nexport namespace ComposerPrimitiveInput {\n export type Element = HTMLTextAreaElement;\n\n type BaseProps = {\n /**\n * Whether to render as a child component using Slot.\n * When true, the component will merge its props with its child.\n */\n asChild?: boolean | undefined;\n /**\n * A React element to use as the input container, with props merged in.\n */\n render?: ReactElement | undefined;\n /**\n * Whether to cancel message composition when Escape is pressed.\n * @default true\n */\n cancelOnEscape?: boolean | undefined;\n /**\n * Whether to automatically focus the input when a new run starts.\n * @default true\n */\n unstable_focusOnRunStart?: boolean | undefined;\n /**\n * Whether to automatically focus the input when scrolling to bottom.\n * @default true\n */\n unstable_focusOnScrollToBottom?: boolean | undefined;\n /**\n * Whether to automatically focus the input when switching threads.\n * @default true\n */\n unstable_focusOnThreadSwitched?: boolean | undefined;\n /**\n * Whether plain Enter on a touch-primary device should insert a newline\n * instead of submitting, detected via\n * `(pointer: coarse) and (not (any-pointer: fine))`. Only takes effect\n * when `submitMode` resolves to `\"enter\"`.\n * @default false\n */\n unstable_insertNewlineOnTouchEnter?: boolean | undefined;\n /**\n * Whether to automatically add pasted files as attachments.\n * @default true\n */\n addAttachmentOnPaste?: boolean | undefined;\n };\n\n type SubmitModeProps =\n | {\n /**\n * Controls how the Enter key submits messages.\n * - \"enter\": Plain Enter submits (Shift+Enter for newline)\n * - \"ctrlEnter\": Ctrl/Cmd+Enter submits (plain Enter for newline)\n * - \"none\": Keyboard submission disabled\n * @default \"enter\"\n */\n submitMode?: \"enter\" | \"ctrlEnter\" | \"none\" | undefined;\n /**\n * @deprecated Use `submitMode` instead\n * @ignore\n */\n submitOnEnter?: never;\n }\n | {\n submitMode?: never;\n /**\n * Whether to submit the message when Enter is pressed (without Shift).\n * @default true\n * @deprecated Use `submitMode` instead. Will be removed in a future version.\n */\n submitOnEnter?: boolean | undefined;\n };\n\n export type Props = TextareaAutosizeProps & BaseProps & SubmitModeProps;\n}\n\n/**\n * A text input component for composing messages.\n *\n * This component provides a rich text input experience with automatic resizing,\n * keyboard shortcuts, file paste support, and intelligent focus management.\n * It integrates with the composer context to manage message state and submission.\n *\n * When rendered inside `TriggerPopoverRoot` and a popover is open, the\n * underlying `<textarea>` automatically receives `aria-controls`,\n * `aria-expanded`, `aria-haspopup`, and `aria-activedescendant` for the\n * combobox relationship. These computed attributes override user-provided\n * values for those four ARIA props while the popover is open.\n *\n * @example\n * ```tsx\n * // Ctrl/Cmd+Enter to submit (plain Enter inserts newline)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitMode=\"ctrlEnter\"\n * />\n *\n * // Insert a newline on Enter on touch-primary devices.\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * unstable_insertNewlineOnTouchEnter\n * />\n *\n * // Old API (deprecated, still supported)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitOnEnter={true}\n * />\n * ```\n */\nexport const ComposerPrimitiveInput = forwardRef<\n ComposerPrimitiveInput.Element,\n ComposerPrimitiveInput.Props\n>(\n (\n {\n autoFocus = false,\n asChild,\n render,\n disabled: disabledProp,\n onChange,\n onKeyDown,\n onPaste,\n onSelect,\n submitOnEnter,\n submitMode,\n cancelOnEscape = true,\n unstable_focusOnRunStart = true,\n unstable_focusOnScrollToBottom = true,\n unstable_focusOnThreadSwitched = true,\n unstable_insertNewlineOnTouchEnter = false,\n addAttachmentOnPaste = true,\n onHeightChange,\n ...rest\n },\n forwardedRef,\n ) => {\n const aui = useAui();\n const pluginRegistry = useComposerInputPluginRegistryOptional();\n const compactContext = useComposerCompactContextOptional();\n\n const declaredSubmitMode =\n submitMode ?? (submitOnEnter === false ? \"none\" : \"enter\");\n const isTouchPrimary = useMediaQuery(\n unstable_insertNewlineOnTouchEnter ? TOUCH_PRIMARY_QUERY : null,\n );\n const effectiveSubmitMode =\n unstable_insertNewlineOnTouchEnter &&\n isTouchPrimary &&\n declaredSubmitMode === \"enter\"\n ? \"none\"\n : declaredSubmitMode;\n\n const value = useComposerInputValue();\n const isDisabled = useComposerInputDisabled(disabledProp);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const ref = useComposedRefs(forwardedRef, textareaRef);\n // suppress text/cursor broadcasts during IME composition\n const compositionRef = useRef(false);\n\n useEscapeKeydown((e) => {\n // Only handle ESC if it originated from within this input\n if (!textareaRef.current?.contains(e.target as Node)) return;\n\n // ignore IME composition events\n if (isCompositionKey(e)) return;\n\n // Let registered plugins (mention, slash command, etc.) handle Escape first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (!cancelOnEscape) return;\n\n const composer = aui.composer;\n if (composer.getState().canCancel) {\n composer.cancel();\n e.preventDefault();\n }\n });\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (isDisabled) return;\n\n // ignore IME composition events\n if (isCompositionKey(e.nativeEvent)) return;\n\n // Let registered plugins (mention, slash command, etc.) handle keyboard events first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (e.key === \"Enter\") {\n const threadState = aui.thread.getState();\n const hasQueue = threadState.capabilities.queue;\n\n // Steer hotkey: Cmd/Ctrl+Shift+Enter (respects submitMode=\"none\" and canSend)\n if (\n e.shiftKey &&\n (e.ctrlKey || e.metaKey) &&\n hasQueue &&\n declaredSubmitMode !== \"none\" &&\n aui.composer.getState().canSend\n ) {\n e.preventDefault();\n aui.composer.send({ steer: true });\n return;\n }\n\n // Regular newline: Shift+Enter\n if (e.shiftKey) return;\n\n // Block submission when running unless queue is supported; a voice\n // session leaves the decision to canSend\n if (\n threadState.isRunning &&\n !hasQueue &&\n threadState.voice === undefined\n )\n return;\n\n let shouldSubmit = false;\n if (effectiveSubmitMode === \"ctrlEnter\") {\n shouldSubmit = e.ctrlKey || e.metaKey;\n } else if (effectiveSubmitMode === \"enter\") {\n shouldSubmit = true;\n }\n\n if (shouldSubmit) {\n e.preventDefault();\n textareaRef.current?.closest(\"form\")?.requestSubmit();\n }\n }\n };\n\n const handlePaste = async (e: ClipboardEvent<HTMLTextAreaElement>) => {\n if (!addAttachmentOnPaste) return;\n const threadCapabilities = aui.thread.getState().capabilities;\n const files = Array.from(e.clipboardData?.files || []);\n\n if (threadCapabilities.attachments && files.length > 0) {\n e.preventDefault();\n await Promise.all(\n files.map(async (file) => {\n try {\n await aui.composer.addAttachment(file);\n } catch {\n // The composer runtime emits composer.attachmentAddError before rejecting.\n }\n }),\n );\n }\n };\n\n const handleHeightChange = (\n height: number,\n meta: TextareaHeightChangeMeta,\n ) => {\n onHeightChange?.(height, meta);\n if (!compactContext) return;\n const el = textareaRef.current;\n if (!el || el.value === \"\") return;\n const cs = getComputedStyle(el);\n const contentHeight =\n cs.boxSizing === \"border-box\"\n ? height -\n parseFloat(cs.paddingTop) -\n parseFloat(cs.paddingBottom) -\n parseFloat(cs.borderTopWidth) -\n parseFloat(cs.borderBottomWidth)\n : height;\n if (Math.round(contentHeight / meta.rowHeight) > 1) {\n compactContext.setMultiline(true);\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(textarea.value.length, textarea.value.length);\n }, [autoFocusEnabled]);\n\n useEffect(() => focus(), [focus]);\n\n useOnScrollToBottom(() => {\n if (\n aui.composer.getState().type === \"thread\" &&\n unstable_focusOnScrollToBottom\n ) {\n focus();\n }\n });\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnRunStart\n )\n return undefined;\n\n return aui.on(\"thread.runStart\", focus);\n }, [unstable_focusOnRunStart, focus, aui]);\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnThreadSwitched\n )\n return undefined;\n\n return aui.on(\"threads.selectionChanged\", focus);\n }, [unstable_focusOnThreadSwitched, focus, aui]);\n\n useEffect(() => {\n if (value === \"\") compactContext?.setMultiline(false);\n }, [value, compactContext]);\n\n const ariaComboboxProps = useTriggerPopoverAriaProps();\n\n const inputProps = {\n name: \"input\" as const,\n value,\n ...rest,\n ...ariaComboboxProps,\n ref: ref as React.ForwardedRef<HTMLTextAreaElement>,\n disabled: isDisabled,\n onChange: composeEventHandlers(\n onChange,\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (!aui.composer.getState().isEditing) return;\n const nativeIsComposing =\n (e.nativeEvent as { isComposing?: boolean }).isComposing === true;\n // recover stuck compositionRef when the browser drops compositionend\n if (compositionRef.current && !nativeIsComposing) {\n compositionRef.current = false;\n }\n const isComposing = nativeIsComposing || compositionRef.current;\n // keep controlled value in sync mid-IME so react does not reset the textarea to a stale value\n flushTapSync(() => {\n aui.composer.setText(e.target.value);\n });\n if (isComposing) return;\n const pos = e.target.selectionStart ?? e.target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onKeyDown: composeEventHandlers(onKeyDown, handleKeyPress),\n onCompositionStart: composeEventHandlers(\n (rest as { onCompositionStart?: React.CompositionEventHandler })\n .onCompositionStart,\n () => {\n compositionRef.current = true;\n },\n ),\n onCompositionEnd: composeEventHandlers(\n (rest as { onCompositionEnd?: React.CompositionEventHandler })\n .onCompositionEnd,\n (e: React.CompositionEvent<HTMLTextAreaElement>) => {\n compositionRef.current = false;\n if (!aui.composer.getState().isEditing) return;\n const target = e.target as HTMLTextAreaElement;\n flushTapSync(() => {\n aui.composer.setText(target.value);\n });\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onSelect: composeEventHandlers(\n onSelect,\n (e: React.SyntheticEvent<HTMLTextAreaElement>) => {\n if (compositionRef.current) return;\n const target = e.target as HTMLTextAreaElement;\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onPaste: composeEventHandlers(onPaste, handlePaste),\n ...(compactContext\n ? { onHeightChange: handleHeightChange }\n : onHeightChange !== undefined\n ? { onHeightChange }\n : {}),\n };\n\n if (render && isValidElement(render)) {\n return renderSlot(\n render,\n (rest as { children?: ReactNode }).children,\n inputProps,\n );\n }\n\n const Component = asChild ? Slot.Root : TextareaAutosize;\n return <Component {...inputProps} />;\n },\n);\n\nComposerPrimitiveInput.displayName = \"ComposerPrimitive.Input\";\n"],"mappings":";;;;;;;;;;;;;;;;AAmCA,MAAM2B,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiH5B,MAAaC,yBAAyBrB,YAKlC,EACEqC,YAAY,OACZZ,SACAC,QACAY,UAAUC,cACVC,UACAC,WACAC,SACAC,UACAR,eACAD,YACAP,iBAAiB,MACjBC,2BAA2B,MAC3BC,iCAAiC,MACjCC,iCAAiC,MACjCC,qCAAqC,OACrCC,uBAAuB,MACvBY,gBACA,GAAGC,QAELC,iBACG;CACH,MAAMC,MAAMlC,OAAO;CACnB,MAAMmC,iBAAiBjC,uCAAuC;CAC9D,MAAMkC,iBAAiBjC,kCAAkC;CAEzD,MAAMkC,qBACJhB,eAAeC,kBAAkB,QAAQ,SAAS;CACpD,MAAMgB,iBAAiBzC,cACrBqB,qCAAqCX,sBAAsB,IAC7D;CACA,MAAMgC,sBACJrB,sCACAoB,kBACAD,uBAAuB,UACnB,SACAA;CAEN,MAAMG,QAAQnC,sBAAsB;CACpC,MAAMoC,aAAarC,yBAAyBsB,YAAY;CACxD,MAAMgB,cAAcpD,OAA4B,IAAI;CACpD,MAAMqD,MAAM9D,gBAAgBoD,cAAcS,WAAW;CAErD,MAAME,iBAAiBtD,OAAO,KAAK;CAEnCK,kBAAkBkD,MAAM;EAEtB,IAAI,CAACH,YAAYI,SAASC,SAASF,EAAEG,MAAc,GA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KACEiG,0BACG;GACJrF,eAAeE,UAAU;EAC3B,CACF;EACAqF,kBAAkBvJ,qBACfoD,KACEmG,mBACFtF,QAAmD;GAClDD,eAAeE,UAAU;GACzB,IAAI,CAACZ,IAAImB,SAASC,SAAS,CAAC,CAACoE,WAAW;GACxC,MAAM1E,SAASH,IAAEG;GACjB/C,mBAAmB;IACjBiC,IAAImB,SAASwE,QAAQ7E,OAAOR,KAAK;GACnC,CAAC;GACD,MAAMsF,QAAM9E,OAAO+E,kBAAkB/E,OAAOR,MAAM6C;GAClD,IAAIlD,gBACF,KAAK,MAAMe,YAAUf,eAAegB,WAAW,GAC7CD,SAAO8E,kBAAkBF,KAAG;EAGlC,CACF;EACAhG,UAAUlD,qBACRkD,WACCe,QAAiD;GAChD,IAAID,eAAeE,SAAS;GAC5B,MAAME,WAASH,IAAEG;GACjB,MAAM8E,QAAM9E,SAAO+E,kBAAkB/E,SAAOR,MAAM6C;GAClD,IAAIlD,gBACF,KAAK,MAAMe,YAAUf,eAAegB,WAAW,GAC7CD,SAAO8E,kBAAkBF,KAAG;EAGlC,CACF;EACAjG,SAASjD,qBAAqBiD,SAASiD,WAAW;EAClD,GAAI1C,iBACA,EAAEL,gBAAgB4D,mBAAmB,IACrC5D,mBAAmB2C,KAAAA,IACjB,EAAE3C,eAAe,IACjB,CAAC;CACT;CAEA,IAAIlB,UAAUtB,eAAesB,MAAM,GACjC,OAAOf,WACLe,QACCmB,KAAkCsG,UACnClB,UACF;CAGF,MAAMmB,YAAY3H,UAAU9B,KAAK0J,OAAOhJ;CACxC,OAAO,oBAAC,WAAD,EAAW,GAAI4H,WAAW,CAAA;AACnC,CACF;AAEA5G,uBAAuBiI,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TriggerAdapter } from "@assistant-ui/core";
|
|
2
2
|
import { type ComponentPropsWithoutRef, type ComponentRef } from "react";
|
|
3
3
|
import { Primitive } from "../../../utils/Primitive.js";
|
|
4
4
|
import { type TriggerPopoverResourceOutput } from "./TriggerPopoverResource.js";
|
|
@@ -20,7 +20,7 @@ export declare namespace ComposerPrimitiveTriggerPopover {
|
|
|
20
20
|
/** Overrides trigger detection for both textarea and Lexical inputs. `endOffset` is the exclusive replace bound. */
|
|
21
21
|
readonly matcher?: TriggerMatcher | undefined;
|
|
22
22
|
/** Adapter providing categories and items. */
|
|
23
|
-
readonly adapter?:
|
|
23
|
+
readonly adapter?: TriggerAdapter | undefined;
|
|
24
24
|
/** Whether the adapter is resolving items, surfaced to the popover scope for async sources. @default false */
|
|
25
25
|
readonly isLoading?: boolean | undefined;
|
|
26
26
|
};
|
|
@@ -34,22 +34,22 @@ export declare namespace ComposerPrimitiveTriggerPopover {
|
|
|
34
34
|
* `<TriggerPopover.Directive>` or `<TriggerPopover.Action>` as a child. Without
|
|
35
35
|
* a behavior the trigger stays closed.
|
|
36
36
|
*
|
|
37
|
-
* Must be placed inside `ComposerPrimitive.
|
|
37
|
+
* Must be placed inside `ComposerPrimitive.TriggerPopoverRoot`.
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
40
|
* ```tsx
|
|
41
|
-
* <ComposerPrimitive.
|
|
41
|
+
* <ComposerPrimitive.TriggerPopover
|
|
42
42
|
* char="@"
|
|
43
43
|
* adapter={mentionAdapter}
|
|
44
44
|
* >
|
|
45
|
-
* <ComposerPrimitive.
|
|
46
|
-
* <ComposerPrimitive.
|
|
45
|
+
* <ComposerPrimitive.TriggerPopover.Directive formatter={formatter} />
|
|
46
|
+
* <ComposerPrimitive.TriggerPopoverCategories>
|
|
47
47
|
* {(cats) => cats.map(...)}
|
|
48
|
-
* </ComposerPrimitive.
|
|
49
|
-
* <ComposerPrimitive.
|
|
48
|
+
* </ComposerPrimitive.TriggerPopoverCategories>
|
|
49
|
+
* <ComposerPrimitive.TriggerPopoverItems>
|
|
50
50
|
* {(items) => items.map(...)}
|
|
51
|
-
* </ComposerPrimitive.
|
|
52
|
-
* </ComposerPrimitive.
|
|
51
|
+
* </ComposerPrimitive.TriggerPopoverItems>
|
|
52
|
+
* </ComposerPrimitive.TriggerPopover>
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
55
|
export declare const ComposerPrimitiveTriggerPopover: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
@@ -62,7 +62,7 @@ export declare const ComposerPrimitiveTriggerPopover: import("react").ForwardRef
|
|
|
62
62
|
/** Overrides trigger detection for both textarea and Lexical inputs. `endOffset` is the exclusive replace bound. */
|
|
63
63
|
readonly matcher?: TriggerMatcher | undefined;
|
|
64
64
|
/** Adapter providing categories and items. */
|
|
65
|
-
readonly adapter?:
|
|
65
|
+
readonly adapter?: TriggerAdapter | undefined;
|
|
66
66
|
/** Whether the adapter is resolving items, surfaced to the popover scope for async sources. @default false */
|
|
67
67
|
readonly isLoading?: boolean | undefined;
|
|
68
68
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerPopover.d.ts","sourceRoot":"","sources":["../../../../src/primitives/composer/trigger/TriggerPopover.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"TriggerPopover.d.ts","sourceRoot":"","sources":["../../../../src/primitives/composer/trigger/TriggerPopover.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAWL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,oCAAiC;AAErD,OAAO,EAEL,KAAK,4BAA4B,EAClC,oCAAiC;AAClC,OAAO,KAAK,EAAE,eAAe,EAAE,sCAAmC;AAKlE,OAAO,KAAK,EAAE,cAAc,EAAE,2BAAwB;AAKtD,eAAO,MAAM,6BAA6B,oCAOzC,CAAC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