@assistant-ui/react 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -22
- package/dist/{chunk-KIP3YFVM.mjs → chunk-XVZ2GVQM.mjs} +4 -2
- package/dist/chunk-XVZ2GVQM.mjs.map +1 -0
- package/dist/experimental.js +3 -1
- package/dist/experimental.js.map +1 -1
- package/dist/experimental.mjs +1 -1
- package/dist/experimental.mjs.map +1 -1
- package/dist/index.d.mts +53 -53
- package/dist/index.d.ts +53 -53
- package/dist/index.js +34 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +55 -60
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
- package/dist/chunk-KIP3YFVM.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import * as react from 'react';
|
2
|
-
import { FC, ReactNode, PropsWithChildren, ComponentType } from 'react';
|
2
|
+
import { FC, ReactNode, PropsWithChildren, ComponentType, ComponentPropsWithoutRef } from 'react';
|
3
3
|
import { TextareaAutosizeProps } from 'react-textarea-autosize';
|
4
4
|
import { T as TextContentPartComponent, I as ImageContentPartComponent, U as UIContentPartComponent, a as ToolCallContentPartComponent, b as ToolCallContentPartProps, c as ThreadState, d as Unsubscribe, M as ModelConfigProvider, e as ThreadMessage, f as ModelConfig, A as AssistantContentPart, g as AppendMessage } from './Thread-ZUDFhMtm.js';
|
5
5
|
export { k as AppendContentPart, h as AssistantMessage, l as TextContentPart, j as UserContentPart, i as UserMessage } from './Thread-ZUDFhMtm.js';
|
6
|
-
import {
|
6
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
7
7
|
import 'zod';
|
8
8
|
|
9
9
|
declare const useCopyMessage: ({ copiedDuration }: {
|
@@ -18,11 +18,11 @@ declare const useGoToNextBranch: () => (() => void) | null;
|
|
18
18
|
|
19
19
|
declare const useGoToPreviousBranch: () => (() => void) | null;
|
20
20
|
|
21
|
-
declare const ThreadRoot: react.ForwardRefExoticComponent<
|
22
|
-
ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
|
21
|
+
declare const ThreadRoot: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
22
|
+
ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
|
23
23
|
} & {
|
24
24
|
asChild?: boolean;
|
25
|
-
}, "
|
25
|
+
}, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
26
26
|
|
27
27
|
type ThreadEmptyProps = {
|
28
28
|
children: ReactNode;
|
@@ -40,11 +40,11 @@ type ThreadIfFilters = {
|
|
40
40
|
type ThreadIfProps = PropsWithChildren<RequireAtLeastOne<ThreadIfFilters>>;
|
41
41
|
declare const ThreadIf: FC<ThreadIfProps>;
|
42
42
|
|
43
|
-
declare const ThreadViewport: react.ForwardRefExoticComponent<
|
44
|
-
ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
|
43
|
+
declare const ThreadViewport: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
44
|
+
ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
|
45
45
|
} & {
|
46
46
|
asChild?: boolean;
|
47
|
-
}, "
|
47
|
+
}, "ref"> & {
|
48
48
|
autoScroll?: boolean;
|
49
49
|
} & react.RefAttributes<HTMLDivElement>>;
|
50
50
|
|
@@ -63,17 +63,17 @@ type ThreadMessagesProps = {
|
|
63
63
|
};
|
64
64
|
declare const ThreadMessages: FC<ThreadMessagesProps>;
|
65
65
|
|
66
|
-
declare const ThreadScrollToBottom: react.ForwardRefExoticComponent<
|
67
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
|
66
|
+
declare const ThreadScrollToBottom: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
67
|
+
ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
|
68
68
|
} & {
|
69
69
|
asChild?: boolean;
|
70
|
-
}, "
|
70
|
+
}, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
71
71
|
|
72
|
-
declare const ThreadSuggestion: react.ForwardRefExoticComponent<
|
73
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
|
72
|
+
declare const ThreadSuggestion: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
73
|
+
ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
|
74
74
|
} & {
|
75
75
|
asChild?: boolean;
|
76
|
-
}, "
|
76
|
+
}, "ref"> & {
|
77
77
|
prompt: string;
|
78
78
|
method: "replace";
|
79
79
|
autoSend?: boolean;
|
@@ -83,27 +83,27 @@ declare namespace index$5 {
|
|
83
83
|
export { ThreadEmpty as Empty, ThreadIf as If, ThreadMessages as Messages, ThreadRoot as Root, ThreadScrollToBottom as ScrollToBottom, ThreadSuggestion as Suggestion, ThreadViewport as Viewport };
|
84
84
|
}
|
85
85
|
|
86
|
-
declare const ComposerRoot: react.ForwardRefExoticComponent<
|
87
|
-
ref?: ((instance: HTMLFormElement | null) => void) | react.RefObject<HTMLFormElement> | null | undefined;
|
86
|
+
declare const ComposerRoot: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & {
|
87
|
+
ref?: ((instance: HTMLFormElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLFormElement> | null | undefined;
|
88
88
|
} & {
|
89
89
|
asChild?: boolean;
|
90
|
-
}, "
|
90
|
+
}, "ref"> & react.RefAttributes<HTMLFormElement>>;
|
91
91
|
|
92
92
|
declare const ComposerInput: react.ForwardRefExoticComponent<TextareaAutosizeProps & {
|
93
93
|
asChild?: boolean;
|
94
94
|
} & react.RefAttributes<HTMLTextAreaElement>>;
|
95
95
|
|
96
|
-
declare const ComposerSend: react.ForwardRefExoticComponent<
|
97
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
|
96
|
+
declare const ComposerSend: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
97
|
+
ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
|
98
98
|
} & {
|
99
99
|
asChild?: boolean;
|
100
|
-
}, "
|
100
|
+
}, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
101
101
|
|
102
|
-
declare const ComposerCancel: react.ForwardRefExoticComponent<
|
103
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
|
102
|
+
declare const ComposerCancel: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
103
|
+
ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
|
104
104
|
} & {
|
105
105
|
asChild?: boolean;
|
106
|
-
}, "
|
106
|
+
}, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
107
107
|
|
108
108
|
type ComposerIfFilters = {
|
109
109
|
editing: boolean | undefined;
|
@@ -115,11 +115,11 @@ declare namespace index$4 {
|
|
115
115
|
export { ComposerCancel as Cancel, ComposerIf as If, ComposerInput as Input, ComposerRoot as Root, ComposerSend as Send };
|
116
116
|
}
|
117
117
|
|
118
|
-
declare const MessageRoot: react.ForwardRefExoticComponent<
|
119
|
-
ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
|
118
|
+
declare const MessageRoot: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
119
|
+
ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
|
120
120
|
} & {
|
121
121
|
asChild?: boolean;
|
122
|
-
}, "
|
122
|
+
}, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
123
123
|
|
124
124
|
type MessageIfFilters = {
|
125
125
|
user: boolean | undefined;
|
@@ -146,37 +146,37 @@ type MessageContentProps = {
|
|
146
146
|
};
|
147
147
|
declare const MessageContent: FC<MessageContentProps>;
|
148
148
|
|
149
|
-
declare const MessageInProgress: react.ForwardRefExoticComponent<
|
150
|
-
ref?: ((instance: HTMLSpanElement | null) => void) | react.RefObject<HTMLSpanElement> | null | undefined;
|
149
|
+
declare const MessageInProgress: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
150
|
+
ref?: ((instance: HTMLSpanElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLSpanElement> | null | undefined;
|
151
151
|
} & {
|
152
152
|
asChild?: boolean;
|
153
|
-
}, "
|
153
|
+
}, "ref"> & react.RefAttributes<HTMLSpanElement>>;
|
154
154
|
|
155
155
|
declare namespace index$3 {
|
156
156
|
export { MessageContent as Content, MessageIf as If, MessageInProgress as InProgress, MessageRoot as Root };
|
157
157
|
}
|
158
158
|
|
159
|
-
declare const BranchPickerNext: react.ForwardRefExoticComponent<
|
160
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
|
159
|
+
declare const BranchPickerNext: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
160
|
+
ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
|
161
161
|
} & {
|
162
162
|
asChild?: boolean;
|
163
|
-
}, "
|
163
|
+
}, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
164
164
|
|
165
|
-
declare const BranchPickerPrevious: react.ForwardRefExoticComponent<
|
166
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
|
165
|
+
declare const BranchPickerPrevious: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
166
|
+
ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
|
167
167
|
} & {
|
168
168
|
asChild?: boolean;
|
169
|
-
}, "
|
169
|
+
}, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
170
170
|
|
171
171
|
declare const BranchPickerCount: FC;
|
172
172
|
|
173
173
|
declare const BranchPickerNumber: FC;
|
174
174
|
|
175
|
-
declare const BranchPickerRoot: react.ForwardRefExoticComponent<
|
176
|
-
ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
|
175
|
+
declare const BranchPickerRoot: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
176
|
+
ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
|
177
177
|
} & {
|
178
178
|
asChild?: boolean;
|
179
|
-
}, "
|
179
|
+
}, "ref"> & {
|
180
180
|
hideWhenSingleBranch?: boolean;
|
181
181
|
} & react.RefAttributes<HTMLDivElement>>;
|
182
182
|
|
@@ -184,11 +184,11 @@ declare namespace index$2 {
|
|
184
184
|
export { BranchPickerCount as Count, BranchPickerNext as Next, BranchPickerNumber as Number, BranchPickerPrevious as Previous, BranchPickerRoot as Root };
|
185
185
|
}
|
186
186
|
|
187
|
-
declare const ActionBarRoot: react.ForwardRefExoticComponent<
|
188
|
-
ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
|
187
|
+
declare const ActionBarRoot: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
188
|
+
ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
|
189
189
|
} & {
|
190
190
|
asChild?: boolean;
|
191
|
-
}, "
|
191
|
+
}, "ref"> & {
|
192
192
|
hideWhenRunning?: boolean;
|
193
193
|
autohide?: "always" | "not-last" | "never";
|
194
194
|
autohideFloat?: "always" | "single-branch" | "never";
|
@@ -197,23 +197,23 @@ declare const ActionBarRoot: react.ForwardRefExoticComponent<Pick<Omit<react.Det
|
|
197
197
|
type ActionBarCopyProps = {
|
198
198
|
copiedDuration?: number;
|
199
199
|
};
|
200
|
-
declare const ActionBarCopy: react.ForwardRefExoticComponent<
|
201
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
|
200
|
+
declare const ActionBarCopy: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
201
|
+
ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
|
202
202
|
} & {
|
203
203
|
asChild?: boolean;
|
204
|
-
}, "
|
204
|
+
}, "ref"> & ActionBarCopyProps & react.RefAttributes<HTMLButtonElement>>;
|
205
205
|
|
206
|
-
declare const ActionBarReload: react.ForwardRefExoticComponent<
|
207
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
|
206
|
+
declare const ActionBarReload: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
207
|
+
ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
|
208
208
|
} & {
|
209
209
|
asChild?: boolean;
|
210
|
-
}, "
|
210
|
+
}, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
211
211
|
|
212
|
-
declare const ActionBarEdit: react.ForwardRefExoticComponent<
|
213
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
|
212
|
+
declare const ActionBarEdit: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
213
|
+
ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
|
214
214
|
} & {
|
215
215
|
asChild?: boolean;
|
216
|
-
}, "
|
216
|
+
}, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
217
217
|
|
218
218
|
declare namespace index$1 {
|
219
219
|
export { ActionBarCopy as Copy, ActionBarEdit as Edit, ActionBarReload as Reload, ActionBarRoot as Root };
|
@@ -225,11 +225,11 @@ type PrimitiveSpanProps = ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
225
225
|
type ContentPartTextProps = Omit<PrimitiveSpanProps, "children">;
|
226
226
|
declare const ContentPartText: react.ForwardRefExoticComponent<ContentPartTextProps & react.RefAttributes<HTMLSpanElement>>;
|
227
227
|
|
228
|
-
declare const ContentPartImage: react.ForwardRefExoticComponent<
|
229
|
-
ref?: ((instance: HTMLImageElement | null) => void) | react.RefObject<HTMLImageElement> | null | undefined;
|
228
|
+
declare const ContentPartImage: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "ref"> & {
|
229
|
+
ref?: ((instance: HTMLImageElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLImageElement> | null | undefined;
|
230
230
|
} & {
|
231
231
|
asChild?: boolean;
|
232
|
-
}, "
|
232
|
+
}, "ref"> & react.RefAttributes<HTMLImageElement>>;
|
233
233
|
|
234
234
|
declare const ContentPartDisplay: FC;
|
235
235
|
|
package/dist/index.js
CHANGED
@@ -126,7 +126,9 @@ var ThreadContext = (0, import_react5.createContext)(null);
|
|
126
126
|
var useThreadContext = () => {
|
127
127
|
const context = (0, import_react5.useContext)(ThreadContext);
|
128
128
|
if (!context)
|
129
|
-
throw new Error(
|
129
|
+
throw new Error(
|
130
|
+
"This component must be used within an AssistantRuntimeProvider."
|
131
|
+
);
|
130
132
|
return context;
|
131
133
|
};
|
132
134
|
|
@@ -218,6 +220,7 @@ var ThreadRoot = (0, import_react10.forwardRef)(
|
|
218
220
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { ...props, ref });
|
219
221
|
}
|
220
222
|
);
|
223
|
+
ThreadRoot.displayName = "ThreadRoot";
|
221
224
|
|
222
225
|
// src/primitives/thread/ThreadIf.tsx
|
223
226
|
var useThreadIf = (props) => {
|
@@ -252,8 +255,8 @@ var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref");
|
|
252
255
|
var import_react11 = require("react");
|
253
256
|
var useOnResizeContent = (ref, callback) => {
|
254
257
|
const callbackRef = (0, import_react_use_callback_ref.useCallbackRef)(callback);
|
258
|
+
const el = ref.current;
|
255
259
|
(0, import_react11.useEffect)(() => {
|
256
|
-
const el = ref.current;
|
257
260
|
if (!el) return;
|
258
261
|
const resizeObserver = new ResizeObserver(() => {
|
259
262
|
callbackRef();
|
@@ -282,7 +285,7 @@ var useOnResizeContent = (ref, callback) => {
|
|
282
285
|
resizeObserver.disconnect();
|
283
286
|
mutationObserver.disconnect();
|
284
287
|
};
|
285
|
-
}, [
|
288
|
+
}, [el, callbackRef]);
|
286
289
|
};
|
287
290
|
|
288
291
|
// src/utils/hooks/useOnScrollToBottom.tsx
|
@@ -351,6 +354,7 @@ var ThreadViewport = (0, import_react13.forwardRef)(({ autoScroll = true, onScro
|
|
351
354
|
}
|
352
355
|
);
|
353
356
|
});
|
357
|
+
ThreadViewport.displayName = "ThreadViewport";
|
354
358
|
|
355
359
|
// src/primitives/thread/ThreadMessages.tsx
|
356
360
|
var import_react16 = require("react");
|
@@ -588,6 +592,7 @@ var ThreadScrollToBottom = (0, import_react17.forwardRef)(({ onClick, ...rest },
|
|
588
592
|
}
|
589
593
|
);
|
590
594
|
});
|
595
|
+
ThreadScrollToBottom.displayName = "ThreadScrollToBottom";
|
591
596
|
|
592
597
|
// src/primitives/thread/ThreadSuggestion.tsx
|
593
598
|
var import_primitive3 = require("@radix-ui/primitive");
|
@@ -615,6 +620,7 @@ var ThreadSuggestion = (0, import_react18.forwardRef)(({ onClick, prompt, method
|
|
615
620
|
}
|
616
621
|
);
|
617
622
|
});
|
623
|
+
ThreadSuggestion.displayName = "ThreadSuggestion";
|
618
624
|
|
619
625
|
// src/primitives/composer/index.ts
|
620
626
|
var composer_exports = {};
|
@@ -655,6 +661,7 @@ var ComposerRoot = (0, import_react19.forwardRef)(
|
|
655
661
|
);
|
656
662
|
}
|
657
663
|
);
|
664
|
+
ComposerRoot.displayName = "ComposerRoot";
|
658
665
|
|
659
666
|
// src/primitives/composer/ComposerInput.tsx
|
660
667
|
var import_primitive5 = require("@radix-ui/primitive");
|
@@ -724,6 +731,7 @@ var ComposerInput = (0, import_react20.forwardRef)(
|
|
724
731
|
);
|
725
732
|
}
|
726
733
|
);
|
734
|
+
ComposerInput.displayName = "ComposerInput";
|
727
735
|
|
728
736
|
// src/primitives/composer/ComposerSend.tsx
|
729
737
|
var import_react_primitive6 = require("@radix-ui/react-primitive");
|
@@ -744,6 +752,7 @@ var ComposerSend = (0, import_react21.forwardRef)(
|
|
744
752
|
);
|
745
753
|
}
|
746
754
|
);
|
755
|
+
ComposerSend.displayName = "ComposerSend";
|
747
756
|
|
748
757
|
// src/primitives/composer/ComposerCancel.tsx
|
749
758
|
var import_primitive6 = require("@radix-ui/primitive");
|
@@ -765,6 +774,7 @@ var ComposerCancel = (0, import_react22.forwardRef)(({ onClick, ...rest }, ref)
|
|
765
774
|
}
|
766
775
|
);
|
767
776
|
});
|
777
|
+
ComposerCancel.displayName = "ComposerCancel";
|
768
778
|
|
769
779
|
// src/primitives/message/index.ts
|
770
780
|
var message_exports = {};
|
@@ -801,6 +811,7 @@ var MessageRoot = (0, import_react23.forwardRef)(
|
|
801
811
|
);
|
802
812
|
}
|
803
813
|
);
|
814
|
+
MessageRoot.displayName = "MessageRoot";
|
804
815
|
|
805
816
|
// src/primitives/message/MessageContent.tsx
|
806
817
|
var import_react28 = require("react");
|
@@ -910,6 +921,7 @@ var ContentPartText = (0, import_react27.forwardRef)((props, forwardedRef) => {
|
|
910
921
|
});
|
911
922
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_primitive9.Primitive.span, { ...props, ref: forwardedRef, children: text });
|
912
923
|
});
|
924
|
+
ContentPartText.displayName = "ContentPartText";
|
913
925
|
|
914
926
|
// src/primitives/message/MessageContent.tsx
|
915
927
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
@@ -994,6 +1006,7 @@ var MessageInProgress = (0, import_react29.forwardRef)((props, ref) => {
|
|
994
1006
|
}, [useMessage, props, ref]);
|
995
1007
|
return null;
|
996
1008
|
});
|
1009
|
+
MessageInProgress.displayName = "MessageInProgress";
|
997
1010
|
|
998
1011
|
// src/primitives/branchPicker/index.ts
|
999
1012
|
var branchPicker_exports = {};
|
@@ -1011,21 +1024,21 @@ var import_react_primitive11 = require("@radix-ui/react-primitive");
|
|
1011
1024
|
var import_react30 = require("react");
|
1012
1025
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
1013
1026
|
var createActionButton = (useActionButton) => {
|
1014
|
-
|
1015
|
-
(props
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1027
|
+
const ActionButton = (0, import_react30.forwardRef)((props, forwardedRef) => {
|
1028
|
+
const onClick = useActionButton(props);
|
1029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
1030
|
+
import_react_primitive11.Primitive.button,
|
1031
|
+
{
|
1032
|
+
type: "button",
|
1033
|
+
disabled: !onClick,
|
1034
|
+
...props,
|
1035
|
+
ref: forwardedRef,
|
1036
|
+
onClick: (0, import_primitive8.composeEventHandlers)(props.onClick, onClick ?? void 0)
|
1037
|
+
}
|
1038
|
+
);
|
1039
|
+
});
|
1040
|
+
ActionButton.displayName = "ActionButton";
|
1041
|
+
return ActionButton;
|
1029
1042
|
};
|
1030
1043
|
|
1031
1044
|
// src/primitives/branchPicker/BranchPickerNext.tsx
|
@@ -1057,6 +1070,7 @@ var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1057
1070
|
var BranchPickerRoot = (0, import_react31.forwardRef)(({ hideWhenSingleBranch, ...rest }, ref) => {
|
1058
1071
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MessageIf, { hasBranches: hideWhenSingleBranch ? true : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_primitive12.Primitive.div, { ...rest, ref }) });
|
1059
1072
|
});
|
1073
|
+
BranchPickerRoot.displayName = "BranchPickerRoot";
|
1060
1074
|
|
1061
1075
|
// src/primitives/actionBar/index.ts
|
1062
1076
|
var actionBar_exports = {};
|
@@ -1096,6 +1110,7 @@ var ActionBarRoot = (0, import_react32.forwardRef)(({ hideWhenRunning, autohide,
|
|
1096
1110
|
}
|
1097
1111
|
);
|
1098
1112
|
});
|
1113
|
+
ActionBarRoot.displayName = "ActionBarRoot";
|
1099
1114
|
|
1100
1115
|
// src/primitives/actionBar/ActionBarCopy.tsx
|
1101
1116
|
var ActionBarCopy = createActionButton(useCopyMessage);
|
@@ -1130,6 +1145,7 @@ var ContentPartImage = (0, import_react33.forwardRef)((props, forwardedRef) => {
|
|
1130
1145
|
});
|
1131
1146
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_primitive14.Primitive.img, { src: image, ...props, ref: forwardedRef });
|
1132
1147
|
});
|
1148
|
+
ContentPartImage.displayName = "ContentPartImage";
|
1133
1149
|
|
1134
1150
|
// src/runtime/local/useLocalRuntime.tsx
|
1135
1151
|
var import_react34 = require("react");
|