@invergent/agent-chat-react 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +272 -210
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +267 -203
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from './chunk-QSC4UIVT.js';
|
|
2
2
|
import { createContext, memo, useRef, useState, useEffect, useCallback, useMemo, lazy, useContext, Suspense, Children } from 'react';
|
|
3
|
-
import { ChevronDownIcon, AlertTriangle, ChevronDown, ChevronRight, RefreshCw, ChevronRightIcon, GitBranchIcon, XIcon, ThumbsUpIcon, ThumbsDownIcon, ActivityIcon, Loader2Icon, GlobeIcon, SearchIcon, ListTodoIcon, XCircleIcon, CheckCircle2Icon, Code, CheckIcon, CopyIcon, TerminalIcon, Trash2Icon, CircleDotIcon, CircleCheckIcon, CircleXIcon, SkullIcon, ClockIcon, CheckCircleIcon, CircleIcon, CalendarClockIcon, UsersIcon, MessageSquareIcon, ZapIcon, FolderOpenIcon, UploadIcon, RefreshCwIcon, AlertCircleIcon, SquareIcon, ArrowDownIcon, RotateCcwIcon, MousePointer2Icon, DownloadIcon, TrashIcon, ImageIcon, FileTextIcon,
|
|
3
|
+
import { ChevronDownIcon, AlertTriangle, ChevronDown, ChevronRight, RefreshCw, ChevronRightIcon, GitBranchIcon, XIcon, ThumbsUpIcon, ThumbsDownIcon, ActivityIcon, Loader2Icon, GlobeIcon, SearchIcon, ListTodoIcon, XCircleIcon, CheckCircle2Icon, Code, CheckIcon, CopyIcon, TerminalIcon, Trash2Icon, CircleDotIcon, CircleCheckIcon, CircleXIcon, SkullIcon, ClockIcon, CheckCircleIcon, CircleIcon, CalendarClockIcon, UsersIcon, MessageSquareIcon, ZapIcon, Maximize2Icon, PlayIcon, FolderOpenIcon, UploadIcon, RefreshCwIcon, AlertCircleIcon, SquareIcon, ArrowDownIcon, RotateCcwIcon, MousePointer2Icon, DownloadIcon, TrashIcon, ImageIcon, FileTextIcon, FolderIcon, FileIcon, ChevronLeftIcon, MinusIcon, PlusIcon, CornerDownLeftIcon } from 'lucide-react';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
5
|
import { Collapsible as Collapsible$1, Slot, Dialog as Dialog$1, ScrollArea as ScrollArea$1, Tooltip as Tooltip$1, Tabs as Tabs$1, Popover as Popover$1, DropdownMenu as DropdownMenu$1, HoverCard as HoverCard$1, Progress as Progress$1 } from 'radix-ui';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -124,11 +124,14 @@ function BrowserControlBar({
|
|
|
124
124
|
error && /* @__PURE__ */ jsx("span", { className: "max-w-40 truncate text-[11px] text-destructive", children: error })
|
|
125
125
|
] });
|
|
126
126
|
}
|
|
127
|
-
function BrowserLiveView({
|
|
127
|
+
function BrowserLiveView({
|
|
128
|
+
src,
|
|
129
|
+
testId = "browser-iframe"
|
|
130
|
+
}) {
|
|
128
131
|
return /* @__PURE__ */ jsx(
|
|
129
132
|
"iframe",
|
|
130
133
|
{
|
|
131
|
-
"data-testid":
|
|
134
|
+
"data-testid": testId,
|
|
132
135
|
title: "Browser live view",
|
|
133
136
|
src,
|
|
134
137
|
className: "h-full w-full border-0 bg-black",
|
|
@@ -153,40 +156,276 @@ function BrowserStatusDot({
|
|
|
153
156
|
}
|
|
154
157
|
);
|
|
155
158
|
}
|
|
156
|
-
function
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
function Dialog({
|
|
160
|
+
...props
|
|
161
|
+
}) {
|
|
162
|
+
return /* @__PURE__ */ jsx(Dialog$1.Root, { "data-slot": "dialog", ...props });
|
|
163
|
+
}
|
|
164
|
+
function DialogPortal({
|
|
165
|
+
...props
|
|
166
|
+
}) {
|
|
167
|
+
return /* @__PURE__ */ jsx(Dialog$1.Portal, { "data-slot": "dialog-portal", ...props });
|
|
168
|
+
}
|
|
169
|
+
function DialogOverlay({
|
|
170
|
+
className,
|
|
171
|
+
...props
|
|
172
|
+
}) {
|
|
173
|
+
return /* @__PURE__ */ jsx(
|
|
174
|
+
Dialog$1.Overlay,
|
|
175
|
+
{
|
|
176
|
+
"data-slot": "dialog-overlay",
|
|
177
|
+
className: cn(
|
|
178
|
+
"fixed inset-0 isolate z-50 bg-black/20 duration-100 supports-backdrop-filter:backdrop-blur-sm data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
179
|
+
className
|
|
180
|
+
),
|
|
181
|
+
...props
|
|
182
|
+
}
|
|
160
183
|
);
|
|
161
|
-
|
|
184
|
+
}
|
|
185
|
+
function DialogContent({
|
|
186
|
+
className,
|
|
187
|
+
children,
|
|
188
|
+
showCloseButton = true,
|
|
189
|
+
...props
|
|
190
|
+
}) {
|
|
191
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
192
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
193
|
+
/* @__PURE__ */ jsxs(
|
|
194
|
+
Dialog$1.Content,
|
|
195
|
+
{
|
|
196
|
+
"data-slot": "dialog-content",
|
|
197
|
+
className: cn(
|
|
198
|
+
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-none bg-popover p-6 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
199
|
+
className
|
|
200
|
+
),
|
|
201
|
+
...props,
|
|
202
|
+
children: [
|
|
203
|
+
children,
|
|
204
|
+
showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, { "data-slot": "dialog-close", asChild: true, children: /* @__PURE__ */ jsxs(
|
|
205
|
+
Button,
|
|
206
|
+
{
|
|
207
|
+
variant: "ghost",
|
|
208
|
+
className: "absolute top-5 right-5 bg-secondary",
|
|
209
|
+
size: "icon-sm",
|
|
210
|
+
children: [
|
|
211
|
+
/* @__PURE__ */ jsx(
|
|
212
|
+
XIcon,
|
|
213
|
+
{}
|
|
214
|
+
),
|
|
215
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
) })
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
] });
|
|
223
|
+
}
|
|
224
|
+
function DialogHeader({ className, ...props }) {
|
|
225
|
+
return /* @__PURE__ */ jsx(
|
|
226
|
+
"div",
|
|
227
|
+
{
|
|
228
|
+
"data-slot": "dialog-header",
|
|
229
|
+
className: cn("flex flex-col gap-2", className),
|
|
230
|
+
...props
|
|
231
|
+
}
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
function DialogFooter({
|
|
235
|
+
className,
|
|
236
|
+
showCloseButton = false,
|
|
237
|
+
children,
|
|
238
|
+
...props
|
|
239
|
+
}) {
|
|
162
240
|
return /* @__PURE__ */ jsxs(
|
|
163
241
|
"div",
|
|
164
242
|
{
|
|
165
|
-
"data-
|
|
166
|
-
className:
|
|
243
|
+
"data-slot": "dialog-footer",
|
|
244
|
+
className: cn(
|
|
245
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
246
|
+
className
|
|
247
|
+
),
|
|
248
|
+
...props,
|
|
167
249
|
children: [
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium", children: "Browser" }),
|
|
171
|
-
/* @__PURE__ */ jsx(BrowserStatusDot, { status: state.status }),
|
|
172
|
-
state.controlOwner && /* @__PURE__ */ jsxs("span", { className: "min-w-0 truncate text-amber-500", children: [
|
|
173
|
-
state.controlOwner,
|
|
174
|
-
" has control"
|
|
175
|
-
] })
|
|
176
|
-
] }),
|
|
177
|
-
/* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 bg-black", children: state.status === "provisioning" ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center bg-background text-sm text-muted-foreground", children: "Starting browser..." }) : state.status === "closed" ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center bg-background text-sm text-muted-foreground", children: "Browser closed." }) : /* @__PURE__ */ jsx(BrowserLiveView, { src: liveViewUrl }) }),
|
|
178
|
-
hasLiveView && /* @__PURE__ */ jsx(
|
|
179
|
-
BrowserControlBar,
|
|
180
|
-
{
|
|
181
|
-
sessionId,
|
|
182
|
-
hasControl: state.status === "user-control",
|
|
183
|
-
adapter
|
|
184
|
-
}
|
|
185
|
-
)
|
|
250
|
+
children,
|
|
251
|
+
showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "outline", children: "Close" }) })
|
|
186
252
|
]
|
|
187
253
|
}
|
|
188
254
|
);
|
|
189
255
|
}
|
|
256
|
+
function DialogTitle({
|
|
257
|
+
className,
|
|
258
|
+
...props
|
|
259
|
+
}) {
|
|
260
|
+
return /* @__PURE__ */ jsx(
|
|
261
|
+
Dialog$1.Title,
|
|
262
|
+
{
|
|
263
|
+
"data-slot": "dialog-title",
|
|
264
|
+
className: cn(
|
|
265
|
+
"font-heading text-lg leading-none font-semibold tracking-wider uppercase",
|
|
266
|
+
className
|
|
267
|
+
),
|
|
268
|
+
...props
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
function DialogDescription({
|
|
273
|
+
className,
|
|
274
|
+
...props
|
|
275
|
+
}) {
|
|
276
|
+
return /* @__PURE__ */ jsx(
|
|
277
|
+
Dialog$1.Description,
|
|
278
|
+
{
|
|
279
|
+
"data-slot": "dialog-description",
|
|
280
|
+
className: cn(
|
|
281
|
+
"mt-0.5 text-sm leading-relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
282
|
+
className
|
|
283
|
+
),
|
|
284
|
+
...props
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
function TooltipProvider({
|
|
289
|
+
delayDuration = 0,
|
|
290
|
+
...props
|
|
291
|
+
}) {
|
|
292
|
+
return /* @__PURE__ */ jsx(
|
|
293
|
+
Tooltip$1.Provider,
|
|
294
|
+
{
|
|
295
|
+
"data-slot": "tooltip-provider",
|
|
296
|
+
delayDuration,
|
|
297
|
+
...props
|
|
298
|
+
}
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
function Tooltip({
|
|
302
|
+
...props
|
|
303
|
+
}) {
|
|
304
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Root, { "data-slot": "tooltip", ...props });
|
|
305
|
+
}
|
|
306
|
+
function TooltipTrigger({
|
|
307
|
+
...props
|
|
308
|
+
}) {
|
|
309
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
310
|
+
}
|
|
311
|
+
function TooltipContent({
|
|
312
|
+
className,
|
|
313
|
+
sideOffset = 0,
|
|
314
|
+
children,
|
|
315
|
+
...props
|
|
316
|
+
}) {
|
|
317
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsxs(
|
|
318
|
+
Tooltip$1.Content,
|
|
319
|
+
{
|
|
320
|
+
"data-slot": "tooltip-content",
|
|
321
|
+
sideOffset,
|
|
322
|
+
className: cn(
|
|
323
|
+
"z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-none bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-none data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
324
|
+
className
|
|
325
|
+
),
|
|
326
|
+
...props,
|
|
327
|
+
children: [
|
|
328
|
+
children,
|
|
329
|
+
/* @__PURE__ */ jsx(Tooltip$1.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-none bg-foreground fill-foreground" })
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
) });
|
|
333
|
+
}
|
|
334
|
+
function BrowserPane({ sessionId, state, adapter }) {
|
|
335
|
+
const [fullscreenOpen, setFullscreenOpen] = useState(false);
|
|
336
|
+
const [inlinePreviewOpen, setInlinePreviewOpen] = useState(false);
|
|
337
|
+
const hasLiveViewAdapter = typeof adapter.browserLiveViewUrl === "function";
|
|
338
|
+
const hasControlAdapter = typeof adapter.acquireBrowserControl === "function" && typeof adapter.releaseBrowserControl === "function";
|
|
339
|
+
const liveViewUrl = useMemo(() => {
|
|
340
|
+
if (!hasLiveViewAdapter) return "";
|
|
341
|
+
return adapter.browserLiveViewUrl(sessionId);
|
|
342
|
+
}, [adapter, hasLiveViewAdapter, sessionId]);
|
|
343
|
+
const hasLiveView = state.status !== "provisioning" && state.status !== "closed";
|
|
344
|
+
const canOpenFullscreen = hasLiveView && Boolean(liveViewUrl);
|
|
345
|
+
useEffect(() => {
|
|
346
|
+
setFullscreenOpen(false);
|
|
347
|
+
setInlinePreviewOpen(false);
|
|
348
|
+
}, [sessionId]);
|
|
349
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
350
|
+
/* @__PURE__ */ jsxs(
|
|
351
|
+
"div",
|
|
352
|
+
{
|
|
353
|
+
"data-testid": "browser-pane",
|
|
354
|
+
className: "flex h-full min-h-0 flex-col bg-background",
|
|
355
|
+
children: [
|
|
356
|
+
/* @__PURE__ */ jsxs("header", { className: "flex min-h-10 items-center gap-2 border-b border-line bg-card px-3 text-xs text-foreground", children: [
|
|
357
|
+
/* @__PURE__ */ jsx(ZapIcon, { className: "size-3.5 text-muted-foreground", "aria-hidden": "true" }),
|
|
358
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: "Browser" }),
|
|
359
|
+
/* @__PURE__ */ jsx(BrowserStatusDot, { status: state.status }),
|
|
360
|
+
state.controlOwner && /* @__PURE__ */ jsxs("span", { className: "min-w-0 truncate text-amber-500", children: [
|
|
361
|
+
state.controlOwner,
|
|
362
|
+
" has control"
|
|
363
|
+
] }),
|
|
364
|
+
canOpenFullscreen && /* @__PURE__ */ jsx("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
365
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
366
|
+
"button",
|
|
367
|
+
{
|
|
368
|
+
type: "button",
|
|
369
|
+
"aria-label": "Maximize browser",
|
|
370
|
+
className: "inline-flex size-7 items-center justify-center text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
371
|
+
onClick: () => setFullscreenOpen(true),
|
|
372
|
+
children: /* @__PURE__ */ jsx(Maximize2Icon, { className: "size-3.5", "aria-hidden": "true" })
|
|
373
|
+
}
|
|
374
|
+
) }),
|
|
375
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: "Full screen" })
|
|
376
|
+
] }) }) })
|
|
377
|
+
] }),
|
|
378
|
+
/* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 bg-black", children: state.status === "provisioning" ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center bg-background text-sm text-muted-foreground", children: "Starting browser..." }) : state.status === "closed" ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center bg-background text-sm text-muted-foreground", children: "Browser closed." }) : liveViewUrl && inlinePreviewOpen ? /* @__PURE__ */ jsx(BrowserLiveView, { src: liveViewUrl }) : liveViewUrl ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center bg-background text-sm text-muted-foreground", children: /* @__PURE__ */ jsxs(
|
|
379
|
+
"button",
|
|
380
|
+
{
|
|
381
|
+
type: "button",
|
|
382
|
+
"aria-label": "Open browser live preview",
|
|
383
|
+
className: "inline-flex items-center gap-2 border border-line bg-card px-3 py-2 text-xs font-medium text-foreground transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
384
|
+
onClick: () => setInlinePreviewOpen(true),
|
|
385
|
+
children: [
|
|
386
|
+
/* @__PURE__ */ jsx(PlayIcon, { className: "size-3.5", "aria-hidden": "true" }),
|
|
387
|
+
/* @__PURE__ */ jsx("span", { children: "Open live preview" })
|
|
388
|
+
]
|
|
389
|
+
}
|
|
390
|
+
) }) : /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center bg-background text-sm text-muted-foreground", children: "Browser live view is unavailable." }) }),
|
|
391
|
+
hasLiveView && hasControlAdapter && /* @__PURE__ */ jsx(
|
|
392
|
+
BrowserControlBar,
|
|
393
|
+
{
|
|
394
|
+
sessionId,
|
|
395
|
+
hasControl: state.status === "user-control",
|
|
396
|
+
adapter
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
]
|
|
400
|
+
}
|
|
401
|
+
),
|
|
402
|
+
/* @__PURE__ */ jsx(Dialog, { open: fullscreenOpen, onOpenChange: setFullscreenOpen, children: /* @__PURE__ */ jsxs(
|
|
403
|
+
DialogContent,
|
|
404
|
+
{
|
|
405
|
+
"aria-describedby": void 0,
|
|
406
|
+
className: "flex h-screen w-screen max-w-none flex-col gap-0 overflow-hidden rounded-none border-0 bg-background p-0 shadow-none ring-0 sm:max-w-none",
|
|
407
|
+
children: [
|
|
408
|
+
/* @__PURE__ */ jsxs(DialogHeader, { className: "h-10 shrink-0 flex-row items-center gap-2 border-b border-line bg-card px-4 py-0", children: [
|
|
409
|
+
/* @__PURE__ */ jsx(ZapIcon, { className: "size-3.5 text-muted-foreground", "aria-hidden": "true" }),
|
|
410
|
+
/* @__PURE__ */ jsx(DialogTitle, { className: "text-xs normal-case tracking-normal", children: "Browser" }),
|
|
411
|
+
/* @__PURE__ */ jsx(BrowserStatusDot, { status: state.status }),
|
|
412
|
+
state.controlOwner && /* @__PURE__ */ jsxs("span", { className: "min-w-0 truncate text-xs text-amber-500", children: [
|
|
413
|
+
state.controlOwner,
|
|
414
|
+
" has control"
|
|
415
|
+
] })
|
|
416
|
+
] }),
|
|
417
|
+
/* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 bg-black", children: liveViewUrl ? /* @__PURE__ */ jsx(
|
|
418
|
+
BrowserLiveView,
|
|
419
|
+
{
|
|
420
|
+
src: liveViewUrl,
|
|
421
|
+
testId: "browser-fullscreen-iframe"
|
|
422
|
+
}
|
|
423
|
+
) : /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center bg-background text-sm text-muted-foreground", children: "Browser live view is unavailable." }) })
|
|
424
|
+
]
|
|
425
|
+
}
|
|
426
|
+
) })
|
|
427
|
+
] });
|
|
428
|
+
}
|
|
190
429
|
var Conversation = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
191
430
|
StickToBottom,
|
|
192
431
|
{
|
|
@@ -255,52 +494,6 @@ var ConversationScrollButton = ({
|
|
|
255
494
|
}
|
|
256
495
|
);
|
|
257
496
|
};
|
|
258
|
-
function TooltipProvider({
|
|
259
|
-
delayDuration = 0,
|
|
260
|
-
...props
|
|
261
|
-
}) {
|
|
262
|
-
return /* @__PURE__ */ jsx(
|
|
263
|
-
Tooltip$1.Provider,
|
|
264
|
-
{
|
|
265
|
-
"data-slot": "tooltip-provider",
|
|
266
|
-
delayDuration,
|
|
267
|
-
...props
|
|
268
|
-
}
|
|
269
|
-
);
|
|
270
|
-
}
|
|
271
|
-
function Tooltip({
|
|
272
|
-
...props
|
|
273
|
-
}) {
|
|
274
|
-
return /* @__PURE__ */ jsx(Tooltip$1.Root, { "data-slot": "tooltip", ...props });
|
|
275
|
-
}
|
|
276
|
-
function TooltipTrigger({
|
|
277
|
-
...props
|
|
278
|
-
}) {
|
|
279
|
-
return /* @__PURE__ */ jsx(Tooltip$1.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
280
|
-
}
|
|
281
|
-
function TooltipContent({
|
|
282
|
-
className,
|
|
283
|
-
sideOffset = 0,
|
|
284
|
-
children,
|
|
285
|
-
...props
|
|
286
|
-
}) {
|
|
287
|
-
return /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsxs(
|
|
288
|
-
Tooltip$1.Content,
|
|
289
|
-
{
|
|
290
|
-
"data-slot": "tooltip-content",
|
|
291
|
-
sideOffset,
|
|
292
|
-
className: cn(
|
|
293
|
-
"z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-none bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-none data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
294
|
-
className
|
|
295
|
-
),
|
|
296
|
-
...props,
|
|
297
|
-
children: [
|
|
298
|
-
children,
|
|
299
|
-
/* @__PURE__ */ jsx(Tooltip$1.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-none bg-foreground fill-foreground" })
|
|
300
|
-
]
|
|
301
|
-
}
|
|
302
|
-
) });
|
|
303
|
-
}
|
|
304
497
|
var Message = ({ className, from, ...props }) => /* @__PURE__ */ jsx(
|
|
305
498
|
"div",
|
|
306
499
|
{
|
|
@@ -1773,135 +1966,6 @@ function WebToolBlock({ tc }) {
|
|
|
1773
1966
|
displayText && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/70 truncate text-xs", children: displayText })
|
|
1774
1967
|
] });
|
|
1775
1968
|
}
|
|
1776
|
-
function Dialog({
|
|
1777
|
-
...props
|
|
1778
|
-
}) {
|
|
1779
|
-
return /* @__PURE__ */ jsx(Dialog$1.Root, { "data-slot": "dialog", ...props });
|
|
1780
|
-
}
|
|
1781
|
-
function DialogPortal({
|
|
1782
|
-
...props
|
|
1783
|
-
}) {
|
|
1784
|
-
return /* @__PURE__ */ jsx(Dialog$1.Portal, { "data-slot": "dialog-portal", ...props });
|
|
1785
|
-
}
|
|
1786
|
-
function DialogOverlay({
|
|
1787
|
-
className,
|
|
1788
|
-
...props
|
|
1789
|
-
}) {
|
|
1790
|
-
return /* @__PURE__ */ jsx(
|
|
1791
|
-
Dialog$1.Overlay,
|
|
1792
|
-
{
|
|
1793
|
-
"data-slot": "dialog-overlay",
|
|
1794
|
-
className: cn(
|
|
1795
|
-
"fixed inset-0 isolate z-50 bg-black/20 duration-100 supports-backdrop-filter:backdrop-blur-sm data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
1796
|
-
className
|
|
1797
|
-
),
|
|
1798
|
-
...props
|
|
1799
|
-
}
|
|
1800
|
-
);
|
|
1801
|
-
}
|
|
1802
|
-
function DialogContent({
|
|
1803
|
-
className,
|
|
1804
|
-
children,
|
|
1805
|
-
showCloseButton = true,
|
|
1806
|
-
...props
|
|
1807
|
-
}) {
|
|
1808
|
-
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
1809
|
-
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
1810
|
-
/* @__PURE__ */ jsxs(
|
|
1811
|
-
Dialog$1.Content,
|
|
1812
|
-
{
|
|
1813
|
-
"data-slot": "dialog-content",
|
|
1814
|
-
className: cn(
|
|
1815
|
-
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-none bg-popover p-6 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
1816
|
-
className
|
|
1817
|
-
),
|
|
1818
|
-
...props,
|
|
1819
|
-
children: [
|
|
1820
|
-
children,
|
|
1821
|
-
showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, { "data-slot": "dialog-close", asChild: true, children: /* @__PURE__ */ jsxs(
|
|
1822
|
-
Button,
|
|
1823
|
-
{
|
|
1824
|
-
variant: "ghost",
|
|
1825
|
-
className: "absolute top-5 right-5 bg-secondary",
|
|
1826
|
-
size: "icon-sm",
|
|
1827
|
-
children: [
|
|
1828
|
-
/* @__PURE__ */ jsx(
|
|
1829
|
-
XIcon,
|
|
1830
|
-
{}
|
|
1831
|
-
),
|
|
1832
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
1833
|
-
]
|
|
1834
|
-
}
|
|
1835
|
-
) })
|
|
1836
|
-
]
|
|
1837
|
-
}
|
|
1838
|
-
)
|
|
1839
|
-
] });
|
|
1840
|
-
}
|
|
1841
|
-
function DialogHeader({ className, ...props }) {
|
|
1842
|
-
return /* @__PURE__ */ jsx(
|
|
1843
|
-
"div",
|
|
1844
|
-
{
|
|
1845
|
-
"data-slot": "dialog-header",
|
|
1846
|
-
className: cn("flex flex-col gap-2", className),
|
|
1847
|
-
...props
|
|
1848
|
-
}
|
|
1849
|
-
);
|
|
1850
|
-
}
|
|
1851
|
-
function DialogFooter({
|
|
1852
|
-
className,
|
|
1853
|
-
showCloseButton = false,
|
|
1854
|
-
children,
|
|
1855
|
-
...props
|
|
1856
|
-
}) {
|
|
1857
|
-
return /* @__PURE__ */ jsxs(
|
|
1858
|
-
"div",
|
|
1859
|
-
{
|
|
1860
|
-
"data-slot": "dialog-footer",
|
|
1861
|
-
className: cn(
|
|
1862
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
1863
|
-
className
|
|
1864
|
-
),
|
|
1865
|
-
...props,
|
|
1866
|
-
children: [
|
|
1867
|
-
children,
|
|
1868
|
-
showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "outline", children: "Close" }) })
|
|
1869
|
-
]
|
|
1870
|
-
}
|
|
1871
|
-
);
|
|
1872
|
-
}
|
|
1873
|
-
function DialogTitle({
|
|
1874
|
-
className,
|
|
1875
|
-
...props
|
|
1876
|
-
}) {
|
|
1877
|
-
return /* @__PURE__ */ jsx(
|
|
1878
|
-
Dialog$1.Title,
|
|
1879
|
-
{
|
|
1880
|
-
"data-slot": "dialog-title",
|
|
1881
|
-
className: cn(
|
|
1882
|
-
"font-heading text-lg leading-none font-semibold tracking-wider uppercase",
|
|
1883
|
-
className
|
|
1884
|
-
),
|
|
1885
|
-
...props
|
|
1886
|
-
}
|
|
1887
|
-
);
|
|
1888
|
-
}
|
|
1889
|
-
function DialogDescription({
|
|
1890
|
-
className,
|
|
1891
|
-
...props
|
|
1892
|
-
}) {
|
|
1893
|
-
return /* @__PURE__ */ jsx(
|
|
1894
|
-
Dialog$1.Description,
|
|
1895
|
-
{
|
|
1896
|
-
"data-slot": "dialog-description",
|
|
1897
|
-
className: cn(
|
|
1898
|
-
"mt-0.5 text-sm leading-relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
1899
|
-
className
|
|
1900
|
-
),
|
|
1901
|
-
...props
|
|
1902
|
-
}
|
|
1903
|
-
);
|
|
1904
|
-
}
|
|
1905
1969
|
function splitChangeLines(change) {
|
|
1906
1970
|
const v = change.value;
|
|
1907
1971
|
if (v === "") return [];
|