@timbal-ai/timbal-react 0.5.2 → 0.5.4
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 +676 -658
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.esm.js +410 -392
- package/dist/styles.css +1 -4
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/runtime/provider.tsx
|
|
2
2
|
import {
|
|
3
|
-
createContext,
|
|
3
|
+
createContext as createContext2,
|
|
4
4
|
useCallback,
|
|
5
|
-
useContext,
|
|
5
|
+
useContext as useContext2,
|
|
6
6
|
useEffect,
|
|
7
7
|
useMemo,
|
|
8
8
|
useRef,
|
|
@@ -444,6 +444,20 @@ function buildPromptBody({
|
|
|
444
444
|
return { prompt: parts, context };
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
+
// src/runtime/attachments-context.tsx
|
|
448
|
+
import { createContext, useContext } from "react";
|
|
449
|
+
import { jsx } from "react/jsx-runtime";
|
|
450
|
+
var TimbalAttachmentsEnabledContext = createContext(false);
|
|
451
|
+
function TimbalAttachmentsEnabledProvider({
|
|
452
|
+
enabled,
|
|
453
|
+
children
|
|
454
|
+
}) {
|
|
455
|
+
return /* @__PURE__ */ jsx(TimbalAttachmentsEnabledContext.Provider, { value: enabled, children });
|
|
456
|
+
}
|
|
457
|
+
function useTimbalAttachmentsEnabled() {
|
|
458
|
+
return useContext(TimbalAttachmentsEnabledContext);
|
|
459
|
+
}
|
|
460
|
+
|
|
447
461
|
// src/runtime/upload-adapter.ts
|
|
448
462
|
var DEFAULT_UPLOAD_ACCEPT = "image/*,application/pdf,text/*,.md,.json,.csv,.tsv,.xlsx,.docx";
|
|
449
463
|
function createDefaultAttachmentAdapter({
|
|
@@ -497,8 +511,9 @@ async function readUploadedUrl(res) {
|
|
|
497
511
|
const contentType = res.headers.get("content-type") ?? "";
|
|
498
512
|
if (contentType.includes("application/json")) {
|
|
499
513
|
const data = await res.json();
|
|
500
|
-
const
|
|
501
|
-
|
|
514
|
+
const raw = data.url ?? data.signed_url ?? data.id;
|
|
515
|
+
const candidate = typeof raw === "string" ? raw : typeof raw === "number" ? String(raw) : "";
|
|
516
|
+
if (candidate.length > 0) {
|
|
502
517
|
return candidate;
|
|
503
518
|
}
|
|
504
519
|
throw new Error(
|
|
@@ -550,7 +565,7 @@ function resolveAttachmentAdapter(attachments, options = {}) {
|
|
|
550
565
|
}
|
|
551
566
|
|
|
552
567
|
// src/runtime/provider.tsx
|
|
553
|
-
import { jsx } from "react/jsx-runtime";
|
|
568
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
554
569
|
function projectAttachment(attachment) {
|
|
555
570
|
const filename = attachment.name ?? "attachment";
|
|
556
571
|
const mimeType = attachment.contentType ?? "application/octet-stream";
|
|
@@ -787,9 +802,9 @@ function readTopLevelStartRunId(event) {
|
|
|
787
802
|
}
|
|
788
803
|
return null;
|
|
789
804
|
}
|
|
790
|
-
var TimbalStreamContext =
|
|
805
|
+
var TimbalStreamContext = createContext2(null);
|
|
791
806
|
function useTimbalRuntime() {
|
|
792
|
-
const ctx =
|
|
807
|
+
const ctx = useContext2(TimbalStreamContext);
|
|
793
808
|
if (!ctx) {
|
|
794
809
|
throw new Error(
|
|
795
810
|
"useTimbalRuntime must be used inside a <TimbalRuntimeProvider>."
|
|
@@ -856,7 +871,7 @@ function TimbalRuntimeProvider({
|
|
|
856
871
|
onCancel,
|
|
857
872
|
...attachmentAdapter ? { adapters: { attachments: attachmentAdapter } } : {}
|
|
858
873
|
});
|
|
859
|
-
return /* @__PURE__ */
|
|
874
|
+
return /* @__PURE__ */ jsx2(TimbalStreamContext.Provider, { value: stream, children: /* @__PURE__ */ jsx2(TimbalAttachmentsEnabledProvider, { enabled: attachmentAdapter !== void 0, children: /* @__PURE__ */ jsx2(AssistantRuntimeProvider, { runtime, children }) }) });
|
|
860
875
|
}
|
|
861
876
|
function findParentIdFromAuiParent(messages, auiParentId) {
|
|
862
877
|
const idx = messages.findIndex((m) => m.id === auiParentId);
|
|
@@ -914,12 +929,12 @@ function cn(...inputs) {
|
|
|
914
929
|
}
|
|
915
930
|
|
|
916
931
|
// src/ui/tooltip.tsx
|
|
917
|
-
import { jsx as
|
|
932
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
918
933
|
function TooltipProvider({
|
|
919
934
|
delayDuration = 0,
|
|
920
935
|
...props
|
|
921
936
|
}) {
|
|
922
|
-
return /* @__PURE__ */
|
|
937
|
+
return /* @__PURE__ */ jsx3(
|
|
923
938
|
TooltipPrimitive.Provider,
|
|
924
939
|
{
|
|
925
940
|
"data-slot": "tooltip-provider",
|
|
@@ -931,12 +946,12 @@ function TooltipProvider({
|
|
|
931
946
|
function Tooltip({
|
|
932
947
|
...props
|
|
933
948
|
}) {
|
|
934
|
-
return /* @__PURE__ */
|
|
949
|
+
return /* @__PURE__ */ jsx3(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
|
|
935
950
|
}
|
|
936
951
|
function TooltipTrigger({
|
|
937
952
|
...props
|
|
938
953
|
}) {
|
|
939
|
-
return /* @__PURE__ */
|
|
954
|
+
return /* @__PURE__ */ jsx3(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
940
955
|
}
|
|
941
956
|
function TooltipContent({
|
|
942
957
|
className,
|
|
@@ -944,7 +959,7 @@ function TooltipContent({
|
|
|
944
959
|
children,
|
|
945
960
|
...props
|
|
946
961
|
}) {
|
|
947
|
-
return /* @__PURE__ */
|
|
962
|
+
return /* @__PURE__ */ jsx3(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
948
963
|
TooltipPrimitive.Content,
|
|
949
964
|
{
|
|
950
965
|
"data-slot": "tooltip-content",
|
|
@@ -956,7 +971,7 @@ function TooltipContent({
|
|
|
956
971
|
...props,
|
|
957
972
|
children: [
|
|
958
973
|
children,
|
|
959
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ jsx3(TooltipPrimitive.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
960
975
|
]
|
|
961
976
|
}
|
|
962
977
|
) });
|
|
@@ -965,32 +980,32 @@ function TooltipContent({
|
|
|
965
980
|
// src/ui/dialog.tsx
|
|
966
981
|
import { XIcon } from "lucide-react";
|
|
967
982
|
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
968
|
-
import { jsx as
|
|
983
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
969
984
|
function Dialog({
|
|
970
985
|
...props
|
|
971
986
|
}) {
|
|
972
|
-
return /* @__PURE__ */
|
|
987
|
+
return /* @__PURE__ */ jsx4(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
973
988
|
}
|
|
974
989
|
function DialogTrigger({
|
|
975
990
|
...props
|
|
976
991
|
}) {
|
|
977
|
-
return /* @__PURE__ */
|
|
992
|
+
return /* @__PURE__ */ jsx4(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
978
993
|
}
|
|
979
994
|
function DialogPortal({
|
|
980
995
|
...props
|
|
981
996
|
}) {
|
|
982
|
-
return /* @__PURE__ */
|
|
997
|
+
return /* @__PURE__ */ jsx4(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
983
998
|
}
|
|
984
999
|
function DialogClose({
|
|
985
1000
|
...props
|
|
986
1001
|
}) {
|
|
987
|
-
return /* @__PURE__ */
|
|
1002
|
+
return /* @__PURE__ */ jsx4(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
988
1003
|
}
|
|
989
1004
|
function DialogOverlay({
|
|
990
1005
|
className,
|
|
991
1006
|
...props
|
|
992
1007
|
}) {
|
|
993
|
-
return /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ jsx4(
|
|
994
1009
|
DialogPrimitive.Overlay,
|
|
995
1010
|
{
|
|
996
1011
|
"data-slot": "dialog-overlay",
|
|
@@ -1009,7 +1024,7 @@ function DialogContent({
|
|
|
1009
1024
|
...props
|
|
1010
1025
|
}) {
|
|
1011
1026
|
return /* @__PURE__ */ jsxs2(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
1012
|
-
/* @__PURE__ */
|
|
1027
|
+
/* @__PURE__ */ jsx4(DialogOverlay, {}),
|
|
1013
1028
|
/* @__PURE__ */ jsxs2(
|
|
1014
1029
|
DialogPrimitive.Content,
|
|
1015
1030
|
{
|
|
@@ -1027,8 +1042,8 @@ function DialogContent({
|
|
|
1027
1042
|
"data-slot": "dialog-close",
|
|
1028
1043
|
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1029
1044
|
children: [
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
/* @__PURE__ */
|
|
1045
|
+
/* @__PURE__ */ jsx4(XIcon, {}),
|
|
1046
|
+
/* @__PURE__ */ jsx4("span", { className: "sr-only", children: "Close" })
|
|
1032
1047
|
]
|
|
1033
1048
|
}
|
|
1034
1049
|
)
|
|
@@ -1041,7 +1056,7 @@ function DialogTitle({
|
|
|
1041
1056
|
className,
|
|
1042
1057
|
...props
|
|
1043
1058
|
}) {
|
|
1044
|
-
return /* @__PURE__ */
|
|
1059
|
+
return /* @__PURE__ */ jsx4(
|
|
1045
1060
|
DialogPrimitive.Title,
|
|
1046
1061
|
{
|
|
1047
1062
|
"data-slot": "dialog-title",
|
|
@@ -1053,13 +1068,13 @@ function DialogTitle({
|
|
|
1053
1068
|
|
|
1054
1069
|
// src/ui/avatar.tsx
|
|
1055
1070
|
import { Avatar as AvatarPrimitive } from "radix-ui";
|
|
1056
|
-
import { jsx as
|
|
1071
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1057
1072
|
function Avatar({
|
|
1058
1073
|
className,
|
|
1059
1074
|
size = "default",
|
|
1060
1075
|
...props
|
|
1061
1076
|
}) {
|
|
1062
|
-
return /* @__PURE__ */
|
|
1077
|
+
return /* @__PURE__ */ jsx5(
|
|
1063
1078
|
AvatarPrimitive.Root,
|
|
1064
1079
|
{
|
|
1065
1080
|
"data-slot": "avatar",
|
|
@@ -1076,7 +1091,7 @@ function AvatarImage({
|
|
|
1076
1091
|
className,
|
|
1077
1092
|
...props
|
|
1078
1093
|
}) {
|
|
1079
|
-
return /* @__PURE__ */
|
|
1094
|
+
return /* @__PURE__ */ jsx5(
|
|
1080
1095
|
AvatarPrimitive.Image,
|
|
1081
1096
|
{
|
|
1082
1097
|
"data-slot": "avatar-image",
|
|
@@ -1089,7 +1104,7 @@ function AvatarFallback({
|
|
|
1089
1104
|
className,
|
|
1090
1105
|
...props
|
|
1091
1106
|
}) {
|
|
1092
|
-
return /* @__PURE__ */
|
|
1107
|
+
return /* @__PURE__ */ jsx5(
|
|
1093
1108
|
AvatarPrimitive.Fallback,
|
|
1094
1109
|
{
|
|
1095
1110
|
"data-slot": "avatar-fallback",
|
|
@@ -1187,7 +1202,7 @@ var TIMBAL_V2_SECONDARY_CHROME = [
|
|
|
1187
1202
|
].join(" ");
|
|
1188
1203
|
|
|
1189
1204
|
// src/ui/timbal-v2-button.tsx
|
|
1190
|
-
import { jsx as
|
|
1205
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1191
1206
|
var TimbalV2Button = React.forwardRef(function TimbalV2Button2({
|
|
1192
1207
|
variant = "secondary",
|
|
1193
1208
|
size = "sm",
|
|
@@ -1227,7 +1242,7 @@ var TimbalV2Button = React.forwardRef(function TimbalV2Button2({
|
|
|
1227
1242
|
),
|
|
1228
1243
|
...props,
|
|
1229
1244
|
children: [
|
|
1230
|
-
/* @__PURE__ */
|
|
1245
|
+
/* @__PURE__ */ jsx6(
|
|
1231
1246
|
"span",
|
|
1232
1247
|
{
|
|
1233
1248
|
"aria-hidden": true,
|
|
@@ -1237,7 +1252,7 @@ var TimbalV2Button = React.forwardRef(function TimbalV2Button2({
|
|
|
1237
1252
|
)
|
|
1238
1253
|
}
|
|
1239
1254
|
),
|
|
1240
|
-
/* @__PURE__ */
|
|
1255
|
+
/* @__PURE__ */ jsx6(
|
|
1241
1256
|
"span",
|
|
1242
1257
|
{
|
|
1243
1258
|
className: cn(
|
|
@@ -1245,7 +1260,7 @@ var TimbalV2Button = React.forwardRef(function TimbalV2Button2({
|
|
|
1245
1260
|
!isIconOnly && TIMBAL_V2_SIZE_LABEL_PX[size],
|
|
1246
1261
|
TIMBAL_V2_LABEL[variant]
|
|
1247
1262
|
),
|
|
1248
|
-
children: isLoading ? /* @__PURE__ */
|
|
1263
|
+
children: isLoading ? /* @__PURE__ */ jsx6("span", { className: "size-4 animate-spin rounded-full border-2 border-current border-t-transparent" }) : children
|
|
1249
1264
|
}
|
|
1250
1265
|
)
|
|
1251
1266
|
]
|
|
@@ -1254,19 +1269,19 @@ var TimbalV2Button = React.forwardRef(function TimbalV2Button2({
|
|
|
1254
1269
|
});
|
|
1255
1270
|
|
|
1256
1271
|
// src/components/tooltip-icon-button.tsx
|
|
1257
|
-
import { jsx as
|
|
1272
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1258
1273
|
var TooltipIconButton = forwardRef2(function TooltipIconButton2({ tooltip, side = "bottom", variant = "secondary", children, ...props }, ref) {
|
|
1259
1274
|
return /* @__PURE__ */ jsxs4(Tooltip, { children: [
|
|
1260
|
-
/* @__PURE__ */
|
|
1275
|
+
/* @__PURE__ */ jsx7(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs4(TimbalV2Button, { ref, variant, size: "sm", isIconOnly: true, ...props, children: [
|
|
1261
1276
|
children,
|
|
1262
|
-
/* @__PURE__ */
|
|
1277
|
+
/* @__PURE__ */ jsx7("span", { className: "sr-only", children: tooltip })
|
|
1263
1278
|
] }) }),
|
|
1264
|
-
/* @__PURE__ */
|
|
1279
|
+
/* @__PURE__ */ jsx7(TooltipContent, { side, children: tooltip })
|
|
1265
1280
|
] });
|
|
1266
1281
|
});
|
|
1267
1282
|
|
|
1268
1283
|
// src/components/attachment.tsx
|
|
1269
|
-
import { jsx as
|
|
1284
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1270
1285
|
var useFileSrc = (file) => {
|
|
1271
1286
|
const [src, setSrc] = useState2(void 0);
|
|
1272
1287
|
useEffect2(() => {
|
|
@@ -1296,7 +1311,7 @@ var useAttachmentSrc = () => {
|
|
|
1296
1311
|
};
|
|
1297
1312
|
var AttachmentPreview = ({ src }) => {
|
|
1298
1313
|
const [isLoaded, setIsLoaded] = useState2(false);
|
|
1299
|
-
return /* @__PURE__ */
|
|
1314
|
+
return /* @__PURE__ */ jsx8(
|
|
1300
1315
|
"img",
|
|
1301
1316
|
{
|
|
1302
1317
|
src,
|
|
@@ -1313,7 +1328,7 @@ var AttachmentPreviewDialog = ({ children }) => {
|
|
|
1313
1328
|
const src = useAttachmentSrc();
|
|
1314
1329
|
if (!src) return children;
|
|
1315
1330
|
return /* @__PURE__ */ jsxs5(Dialog, { children: [
|
|
1316
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ jsx8(
|
|
1317
1332
|
DialogTrigger,
|
|
1318
1333
|
{
|
|
1319
1334
|
className: "aui-attachment-preview-trigger cursor-pointer transition-colors hover:bg-accent/50",
|
|
@@ -1322,8 +1337,8 @@ var AttachmentPreviewDialog = ({ children }) => {
|
|
|
1322
1337
|
}
|
|
1323
1338
|
),
|
|
1324
1339
|
/* @__PURE__ */ jsxs5(DialogContent, { className: "aui-attachment-preview-dialog-content p-2 sm:max-w-3xl [&>button]:rounded-full [&>button]:bg-foreground/60 [&>button]:p-1 [&>button]:opacity-100 [&>button]:ring-0! [&_svg]:text-background [&>button]:hover:[&_svg]:text-destructive", children: [
|
|
1325
|
-
/* @__PURE__ */
|
|
1326
|
-
/* @__PURE__ */
|
|
1340
|
+
/* @__PURE__ */ jsx8(DialogTitle, { className: "aui-sr-only sr-only", children: "Image Attachment Preview" }),
|
|
1341
|
+
/* @__PURE__ */ jsx8("div", { className: "aui-attachment-preview relative mx-auto flex max-h-[80dvh] w-full items-center justify-center overflow-hidden bg-background", children: /* @__PURE__ */ jsx8(AttachmentPreview, { src }) })
|
|
1327
1342
|
] })
|
|
1328
1343
|
] });
|
|
1329
1344
|
};
|
|
@@ -1331,7 +1346,7 @@ var AttachmentThumb = () => {
|
|
|
1331
1346
|
const isImage = useAuiState((s) => s.attachment.type === "image");
|
|
1332
1347
|
const src = useAttachmentSrc();
|
|
1333
1348
|
return /* @__PURE__ */ jsxs5(Avatar, { className: "aui-attachment-tile-avatar h-full w-full rounded-none", children: [
|
|
1334
|
-
/* @__PURE__ */
|
|
1349
|
+
/* @__PURE__ */ jsx8(
|
|
1335
1350
|
AvatarImage,
|
|
1336
1351
|
{
|
|
1337
1352
|
src,
|
|
@@ -1339,7 +1354,7 @@ var AttachmentThumb = () => {
|
|
|
1339
1354
|
className: "aui-attachment-tile-image object-cover"
|
|
1340
1355
|
}
|
|
1341
1356
|
),
|
|
1342
|
-
/* @__PURE__ */
|
|
1357
|
+
/* @__PURE__ */ jsx8(AvatarFallback, { delayMs: isImage ? 200 : 0, children: /* @__PURE__ */ jsx8(FileText, { className: "aui-attachment-tile-fallback-icon size-8 text-muted-foreground" }) })
|
|
1343
1358
|
] });
|
|
1344
1359
|
};
|
|
1345
1360
|
var AttachmentUI = () => {
|
|
@@ -1368,7 +1383,7 @@ var AttachmentUI = () => {
|
|
|
1368
1383
|
isImage && "aui-attachment-root-composer only:[&>#attachment-tile]:size-24"
|
|
1369
1384
|
),
|
|
1370
1385
|
children: [
|
|
1371
|
-
/* @__PURE__ */
|
|
1386
|
+
/* @__PURE__ */ jsx8(AttachmentPreviewDialog, { children: /* @__PURE__ */ jsx8(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx8(
|
|
1372
1387
|
"div",
|
|
1373
1388
|
{
|
|
1374
1389
|
className: cn(
|
|
@@ -1378,32 +1393,32 @@ var AttachmentUI = () => {
|
|
|
1378
1393
|
role: "button",
|
|
1379
1394
|
id: "attachment-tile",
|
|
1380
1395
|
"aria-label": `${typeLabel} attachment`,
|
|
1381
|
-
children: /* @__PURE__ */
|
|
1396
|
+
children: /* @__PURE__ */ jsx8(AttachmentThumb, {})
|
|
1382
1397
|
}
|
|
1383
1398
|
) }) }),
|
|
1384
|
-
isComposer && /* @__PURE__ */
|
|
1399
|
+
isComposer && /* @__PURE__ */ jsx8(AttachmentRemove, {})
|
|
1385
1400
|
]
|
|
1386
1401
|
}
|
|
1387
1402
|
),
|
|
1388
|
-
/* @__PURE__ */
|
|
1403
|
+
/* @__PURE__ */ jsx8(TooltipContent, { side: "top", children: /* @__PURE__ */ jsx8(AttachmentPrimitive.Name, {}) })
|
|
1389
1404
|
] });
|
|
1390
1405
|
};
|
|
1391
1406
|
var AttachmentRemove = () => {
|
|
1392
|
-
return /* @__PURE__ */
|
|
1407
|
+
return /* @__PURE__ */ jsx8(AttachmentPrimitive.Remove, { asChild: true, children: /* @__PURE__ */ jsx8(
|
|
1393
1408
|
TooltipIconButton,
|
|
1394
1409
|
{
|
|
1395
1410
|
tooltip: "Remove file",
|
|
1396
1411
|
className: "aui-attachment-tile-remove absolute top-1.5 right-1.5 size-3.5 rounded-full bg-card text-foreground opacity-100 shadow-card hover:bg-card! [&_svg]:text-foreground hover:[&_svg]:text-destructive",
|
|
1397
1412
|
side: "top",
|
|
1398
|
-
children: /* @__PURE__ */
|
|
1413
|
+
children: /* @__PURE__ */ jsx8(XIcon2, { className: "aui-attachment-remove-icon size-3" })
|
|
1399
1414
|
}
|
|
1400
1415
|
) });
|
|
1401
1416
|
};
|
|
1402
1417
|
var UserMessageAttachments = () => {
|
|
1403
|
-
return /* @__PURE__ */
|
|
1418
|
+
return /* @__PURE__ */ jsx8("div", { className: "aui-user-message-attachments-end col-span-full col-start-1 row-start-1 flex w-full flex-row justify-end gap-2", children: /* @__PURE__ */ jsx8(MessagePrimitive.Attachments, { components: { Attachment: AttachmentUI } }) });
|
|
1404
1419
|
};
|
|
1405
1420
|
var ComposerAttachments = () => {
|
|
1406
|
-
return /* @__PURE__ */
|
|
1421
|
+
return /* @__PURE__ */ jsx8("div", { className: "aui-composer-attachments mb-2 flex w-full flex-row items-center gap-2 overflow-x-auto px-1.5 pt-0.5 pb-1 empty:hidden", children: /* @__PURE__ */ jsx8(
|
|
1407
1422
|
ComposerPrimitive.Attachments,
|
|
1408
1423
|
{
|
|
1409
1424
|
components: { Attachment: AttachmentUI }
|
|
@@ -1411,7 +1426,7 @@ var ComposerAttachments = () => {
|
|
|
1411
1426
|
) });
|
|
1412
1427
|
};
|
|
1413
1428
|
var ComposerAddAttachment = () => {
|
|
1414
|
-
return /* @__PURE__ */
|
|
1429
|
+
return /* @__PURE__ */ jsx8(ComposerPrimitive.AddAttachment, { asChild: true, children: /* @__PURE__ */ jsx8(
|
|
1415
1430
|
TooltipIconButton,
|
|
1416
1431
|
{
|
|
1417
1432
|
tooltip: "Add Attachment",
|
|
@@ -1419,7 +1434,7 @@ var ComposerAddAttachment = () => {
|
|
|
1419
1434
|
variant: "secondary",
|
|
1420
1435
|
className: "aui-composer-add-attachment shrink-0 text-muted-foreground",
|
|
1421
1436
|
"aria-label": "Add Attachment",
|
|
1422
|
-
children: /* @__PURE__ */
|
|
1437
|
+
children: /* @__PURE__ */ jsx8(PlusIcon, { className: "aui-attachment-add-icon size-4 stroke-[1.5]" })
|
|
1423
1438
|
}
|
|
1424
1439
|
) });
|
|
1425
1440
|
};
|
|
@@ -1444,13 +1459,13 @@ import { createHighlighterCore } from "shiki/core";
|
|
|
1444
1459
|
import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
|
|
1445
1460
|
|
|
1446
1461
|
// src/artifacts/registry.tsx
|
|
1447
|
-
import { createContext as
|
|
1462
|
+
import { createContext as createContext4, useContext as useContext4, useMemo as useMemo3 } from "react";
|
|
1448
1463
|
|
|
1449
1464
|
// src/artifacts/chart-artifact.tsx
|
|
1450
1465
|
import { useMemo as useMemo2 } from "react";
|
|
1451
1466
|
|
|
1452
1467
|
// src/artifacts/artifact-card.tsx
|
|
1453
|
-
import { jsx as
|
|
1468
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1454
1469
|
var ArtifactCard = ({ title, kind, className, bodyClassName, toolbar, children }) => {
|
|
1455
1470
|
const hasHeader = Boolean(title || toolbar);
|
|
1456
1471
|
return /* @__PURE__ */ jsxs6(
|
|
@@ -1463,18 +1478,18 @@ var ArtifactCard = ({ title, kind, className, bodyClassName, toolbar, children }
|
|
|
1463
1478
|
"data-artifact-kind": kind,
|
|
1464
1479
|
children: [
|
|
1465
1480
|
hasHeader && /* @__PURE__ */ jsxs6("div", { className: "aui-artifact-header flex items-center gap-2 border-b border-border/40 bg-muted/30 px-3 py-1.5", children: [
|
|
1466
|
-
title && /* @__PURE__ */
|
|
1467
|
-
!title && /* @__PURE__ */
|
|
1481
|
+
title && /* @__PURE__ */ jsx9("span", { className: "aui-artifact-title flex-1 truncate text-xs font-semibold text-foreground/80", children: title }),
|
|
1482
|
+
!title && /* @__PURE__ */ jsx9("span", { className: "flex-1" }),
|
|
1468
1483
|
toolbar
|
|
1469
1484
|
] }),
|
|
1470
|
-
/* @__PURE__ */
|
|
1485
|
+
/* @__PURE__ */ jsx9("div", { className: cn("aui-artifact-body", bodyClassName), children })
|
|
1471
1486
|
]
|
|
1472
1487
|
}
|
|
1473
1488
|
);
|
|
1474
1489
|
};
|
|
1475
1490
|
|
|
1476
1491
|
// src/artifacts/chart-artifact.tsx
|
|
1477
|
-
import { Fragment, jsx as
|
|
1492
|
+
import { Fragment, jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1478
1493
|
var ChartArtifactView = ({
|
|
1479
1494
|
artifact
|
|
1480
1495
|
}) => {
|
|
@@ -1485,8 +1500,8 @@ var ChartArtifactView = ({
|
|
|
1485
1500
|
if (typeof artifact.dataKey === "string") return [artifact.dataKey];
|
|
1486
1501
|
return inferDataKeys(data, xKey);
|
|
1487
1502
|
}, [artifact.dataKey, data, xKey]);
|
|
1488
|
-
return /* @__PURE__ */
|
|
1489
|
-
/* @__PURE__ */
|
|
1503
|
+
return /* @__PURE__ */ jsx10(ArtifactCard, { title: artifact.title, kind: "chart", children: /* @__PURE__ */ jsxs7("div", { className: "aui-artifact-chart p-3", children: [
|
|
1504
|
+
/* @__PURE__ */ jsx10(
|
|
1490
1505
|
ChartSvg,
|
|
1491
1506
|
{
|
|
1492
1507
|
chartType,
|
|
@@ -1496,7 +1511,7 @@ var ChartArtifactView = ({
|
|
|
1496
1511
|
unit: artifact.unit
|
|
1497
1512
|
}
|
|
1498
1513
|
),
|
|
1499
|
-
dataKeys.length > 1 && /* @__PURE__ */
|
|
1514
|
+
dataKeys.length > 1 && /* @__PURE__ */ jsx10(Legend, { dataKeys })
|
|
1500
1515
|
] }) });
|
|
1501
1516
|
};
|
|
1502
1517
|
var COLORS = [
|
|
@@ -1512,10 +1527,10 @@ var H = 240;
|
|
|
1512
1527
|
var PAD = { top: 12, right: 16, bottom: 28, left: 36 };
|
|
1513
1528
|
var ChartSvg = ({ chartType, data, xKey, dataKeys, unit }) => {
|
|
1514
1529
|
if (data.length === 0 || dataKeys.length === 0) {
|
|
1515
|
-
return /* @__PURE__ */
|
|
1530
|
+
return /* @__PURE__ */ jsx10(EmptyState, {});
|
|
1516
1531
|
}
|
|
1517
1532
|
if (chartType === "pie") {
|
|
1518
|
-
return /* @__PURE__ */
|
|
1533
|
+
return /* @__PURE__ */ jsx10(PieChart, { data, xKey, dataKey: dataKeys[0] });
|
|
1519
1534
|
}
|
|
1520
1535
|
const innerW = W - PAD.left - PAD.right;
|
|
1521
1536
|
const innerH = H - PAD.top - PAD.bottom;
|
|
@@ -1537,7 +1552,7 @@ var ChartSvg = ({ chartType, data, xKey, dataKeys, unit }) => {
|
|
|
1537
1552
|
"aria-label": "Chart",
|
|
1538
1553
|
children: [
|
|
1539
1554
|
ticks.map((t, i) => /* @__PURE__ */ jsxs7("g", { children: [
|
|
1540
|
-
/* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ jsx10(
|
|
1541
1556
|
"line",
|
|
1542
1557
|
{
|
|
1543
1558
|
x1: PAD.left,
|
|
@@ -1548,7 +1563,7 @@ var ChartSvg = ({ chartType, data, xKey, dataKeys, unit }) => {
|
|
|
1548
1563
|
strokeOpacity: 0.08
|
|
1549
1564
|
}
|
|
1550
1565
|
),
|
|
1551
|
-
/* @__PURE__ */
|
|
1566
|
+
/* @__PURE__ */ jsx10(
|
|
1552
1567
|
"text",
|
|
1553
1568
|
{
|
|
1554
1569
|
x: PAD.left - 6,
|
|
@@ -1560,7 +1575,7 @@ var ChartSvg = ({ chartType, data, xKey, dataKeys, unit }) => {
|
|
|
1560
1575
|
}
|
|
1561
1576
|
)
|
|
1562
1577
|
] }, i)),
|
|
1563
|
-
data.map((d, i) => /* @__PURE__ */
|
|
1578
|
+
data.map((d, i) => /* @__PURE__ */ jsx10(
|
|
1564
1579
|
"text",
|
|
1565
1580
|
{
|
|
1566
1581
|
x: xPos(i),
|
|
@@ -1572,7 +1587,7 @@ var ChartSvg = ({ chartType, data, xKey, dataKeys, unit }) => {
|
|
|
1572
1587
|
i
|
|
1573
1588
|
)),
|
|
1574
1589
|
chartType === "bar" && renderBars({ data, dataKeys, xCount, xPos, yScale, minV, innerW }),
|
|
1575
|
-
chartType === "line" && dataKeys.map((k, ki) => /* @__PURE__ */
|
|
1590
|
+
chartType === "line" && dataKeys.map((k, ki) => /* @__PURE__ */ jsx10(
|
|
1576
1591
|
Polyline,
|
|
1577
1592
|
{
|
|
1578
1593
|
data,
|
|
@@ -1583,7 +1598,7 @@ var ChartSvg = ({ chartType, data, xKey, dataKeys, unit }) => {
|
|
|
1583
1598
|
},
|
|
1584
1599
|
k
|
|
1585
1600
|
)),
|
|
1586
|
-
chartType === "area" && dataKeys.map((k, ki) => /* @__PURE__ */
|
|
1601
|
+
chartType === "area" && dataKeys.map((k, ki) => /* @__PURE__ */ jsx10(
|
|
1587
1602
|
Area,
|
|
1588
1603
|
{
|
|
1589
1604
|
data,
|
|
@@ -1611,7 +1626,7 @@ function renderBars(args) {
|
|
|
1611
1626
|
const x = xPos(i) - groupWidth / 2 + ki * barWidth;
|
|
1612
1627
|
const top = Math.min(y, baseY);
|
|
1613
1628
|
const height = Math.abs(y - baseY);
|
|
1614
|
-
return /* @__PURE__ */
|
|
1629
|
+
return /* @__PURE__ */ jsx10(
|
|
1615
1630
|
"rect",
|
|
1616
1631
|
{
|
|
1617
1632
|
x,
|
|
@@ -1628,7 +1643,7 @@ function renderBars(args) {
|
|
|
1628
1643
|
}
|
|
1629
1644
|
var Polyline = ({ data, dataKey, xPos, yScale, color }) => {
|
|
1630
1645
|
const points = data.map((d, i) => `${xPos(i)},${yScale(toNum(d[dataKey]))}`).join(" ");
|
|
1631
|
-
return /* @__PURE__ */
|
|
1646
|
+
return /* @__PURE__ */ jsx10(
|
|
1632
1647
|
"polyline",
|
|
1633
1648
|
{
|
|
1634
1649
|
points,
|
|
@@ -1645,8 +1660,8 @@ var Area = ({ data, dataKey, xPos, yScale, baseY, color }) => {
|
|
|
1645
1660
|
const top = data.map((d, i) => `${xPos(i)},${yScale(toNum(d[dataKey]))}`).join(" ");
|
|
1646
1661
|
const path = `M ${xPos(0)},${baseY} L ${top} L ${xPos(data.length - 1)},${baseY} Z`;
|
|
1647
1662
|
return /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
1648
|
-
/* @__PURE__ */
|
|
1649
|
-
/* @__PURE__ */
|
|
1663
|
+
/* @__PURE__ */ jsx10("path", { d: path, fill: color, fillOpacity: 0.18 }),
|
|
1664
|
+
/* @__PURE__ */ jsx10(Polyline, { data, dataKey, xPos, yScale, color })
|
|
1650
1665
|
] });
|
|
1651
1666
|
};
|
|
1652
1667
|
var PieChart = ({ data, xKey, dataKey }) => {
|
|
@@ -1655,7 +1670,7 @@ var PieChart = ({ data, xKey, dataKey }) => {
|
|
|
1655
1670
|
const r = Math.min(W, H) / 2 - 16;
|
|
1656
1671
|
const total = data.reduce((sum, d) => sum + toNum(d[dataKey]), 0) || 1;
|
|
1657
1672
|
let acc = 0;
|
|
1658
|
-
return /* @__PURE__ */
|
|
1673
|
+
return /* @__PURE__ */ jsx10(
|
|
1659
1674
|
"svg",
|
|
1660
1675
|
{
|
|
1661
1676
|
viewBox: `0 0 ${W} ${H}`,
|
|
@@ -1667,7 +1682,7 @@ var PieChart = ({ data, xKey, dataKey }) => {
|
|
|
1667
1682
|
const start = acc / total * Math.PI * 2;
|
|
1668
1683
|
acc += value;
|
|
1669
1684
|
const end = acc / total * Math.PI * 2;
|
|
1670
|
-
return /* @__PURE__ */
|
|
1685
|
+
return /* @__PURE__ */ jsx10(
|
|
1671
1686
|
PieSlice,
|
|
1672
1687
|
{
|
|
1673
1688
|
cx,
|
|
@@ -1695,8 +1710,8 @@ var PieSlice = ({ cx, cy, r, start, end, color, label }) => {
|
|
|
1695
1710
|
const lx = cx + Math.sin(mid) * (r * 0.65);
|
|
1696
1711
|
const ly = cy - Math.cos(mid) * (r * 0.65);
|
|
1697
1712
|
return /* @__PURE__ */ jsxs7("g", { children: [
|
|
1698
|
-
/* @__PURE__ */
|
|
1699
|
-
/* @__PURE__ */
|
|
1713
|
+
/* @__PURE__ */ jsx10("path", { d: path, fill: color, stroke: "var(--background, #fff)", strokeWidth: 1 }),
|
|
1714
|
+
/* @__PURE__ */ jsx10(
|
|
1700
1715
|
"text",
|
|
1701
1716
|
{
|
|
1702
1717
|
x: lx,
|
|
@@ -1709,8 +1724,8 @@ var PieSlice = ({ cx, cy, r, start, end, color, label }) => {
|
|
|
1709
1724
|
)
|
|
1710
1725
|
] });
|
|
1711
1726
|
};
|
|
1712
|
-
var Legend = ({ dataKeys }) => /* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
1727
|
+
var Legend = ({ dataKeys }) => /* @__PURE__ */ jsx10("div", { className: "aui-artifact-chart-legend mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground", children: dataKeys.map((k, i) => /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
1728
|
+
/* @__PURE__ */ jsx10(
|
|
1714
1729
|
"span",
|
|
1715
1730
|
{
|
|
1716
1731
|
className: "inline-block size-2 rounded-sm",
|
|
@@ -1720,7 +1735,7 @@ var Legend = ({ dataKeys }) => /* @__PURE__ */ jsx9("div", { className: "aui-art
|
|
|
1720
1735
|
),
|
|
1721
1736
|
k
|
|
1722
1737
|
] }, k)) });
|
|
1723
|
-
var EmptyState = () => /* @__PURE__ */
|
|
1738
|
+
var EmptyState = () => /* @__PURE__ */ jsx10("div", { className: "aui-artifact-chart-empty flex h-32 items-center justify-center text-xs text-muted-foreground", children: "No data" });
|
|
1724
1739
|
function inferXKey(data) {
|
|
1725
1740
|
if (data.length === 0) return "x";
|
|
1726
1741
|
for (const k of Object.keys(data[0])) {
|
|
@@ -1879,12 +1894,12 @@ var studioQuestionOptionSelectedClass = cn(
|
|
|
1879
1894
|
);
|
|
1880
1895
|
|
|
1881
1896
|
// src/artifacts/question-artifact.tsx
|
|
1882
|
-
import { jsx as
|
|
1897
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1883
1898
|
function optionKey(option, index) {
|
|
1884
1899
|
const id = option.id?.trim();
|
|
1885
1900
|
return id ? id : `__option-${index}`;
|
|
1886
1901
|
}
|
|
1887
|
-
var OptionRadio = ({ selected }) => /* @__PURE__ */
|
|
1902
|
+
var OptionRadio = ({ selected }) => /* @__PURE__ */ jsx11(
|
|
1888
1903
|
"span",
|
|
1889
1904
|
{
|
|
1890
1905
|
className: cn(
|
|
@@ -1892,7 +1907,7 @@ var OptionRadio = ({ selected }) => /* @__PURE__ */ jsx10(
|
|
|
1892
1907
|
selected ? "border-foreground bg-foreground text-background" : "border-border bg-background"
|
|
1893
1908
|
),
|
|
1894
1909
|
"aria-hidden": true,
|
|
1895
|
-
children: selected ? /* @__PURE__ */
|
|
1910
|
+
children: selected ? /* @__PURE__ */ jsx11(CheckIcon, { className: "size-2.5 stroke-[3]" }) : null
|
|
1896
1911
|
}
|
|
1897
1912
|
);
|
|
1898
1913
|
var QuestionArtifactView = ({
|
|
@@ -1931,9 +1946,9 @@ var QuestionArtifactView = ({
|
|
|
1931
1946
|
const onConfirm = useCallback2(() => {
|
|
1932
1947
|
send(selected);
|
|
1933
1948
|
}, [selected, send]);
|
|
1934
|
-
return /* @__PURE__ */
|
|
1935
|
-
artifact.prompt ? /* @__PURE__ */
|
|
1936
|
-
/* @__PURE__ */
|
|
1949
|
+
return /* @__PURE__ */ jsx11("div", { className: studioArtifactShellClass, "data-artifact-kind": "question", children: /* @__PURE__ */ jsxs8("div", { className: "px-2.5 py-2", children: [
|
|
1950
|
+
artifact.prompt ? /* @__PURE__ */ jsx11("p", { className: "mb-2 text-sm font-normal leading-snug text-foreground", children: artifact.prompt }) : null,
|
|
1951
|
+
/* @__PURE__ */ jsx11("div", { className: "flex flex-col gap-0.5", role: "list", children: artifact.options.map((option, index) => {
|
|
1937
1952
|
const key = optionKey(option, index);
|
|
1938
1953
|
const isSelected = submittedIds ? submittedIds.includes(key) : isMulti && selected.includes(key);
|
|
1939
1954
|
return /* @__PURE__ */ jsxs8(
|
|
@@ -1948,17 +1963,17 @@ var QuestionArtifactView = ({
|
|
|
1948
1963
|
isDisabled && (isSelected ? "cursor-default" : "cursor-not-allowed opacity-50")
|
|
1949
1964
|
),
|
|
1950
1965
|
children: [
|
|
1951
|
-
/* @__PURE__ */
|
|
1966
|
+
/* @__PURE__ */ jsx11(OptionRadio, { selected: isSelected }),
|
|
1952
1967
|
/* @__PURE__ */ jsxs8("span", { className: "min-w-0 flex-1 text-left", children: [
|
|
1953
|
-
/* @__PURE__ */
|
|
1954
|
-
option.description ? /* @__PURE__ */
|
|
1968
|
+
/* @__PURE__ */ jsx11("span", { className: "block font-normal text-foreground", children: option.label }),
|
|
1969
|
+
option.description ? /* @__PURE__ */ jsx11("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: option.description }) : null
|
|
1955
1970
|
] })
|
|
1956
1971
|
]
|
|
1957
1972
|
},
|
|
1958
1973
|
key
|
|
1959
1974
|
);
|
|
1960
1975
|
}) }),
|
|
1961
|
-
isMulti && !submittedIds ? /* @__PURE__ */
|
|
1976
|
+
isMulti && !submittedIds ? /* @__PURE__ */ jsx11("div", { className: "mt-2 flex justify-end", children: /* @__PURE__ */ jsx11(
|
|
1962
1977
|
TimbalV2Button,
|
|
1963
1978
|
{
|
|
1964
1979
|
type: "button",
|
|
@@ -1973,12 +1988,12 @@ var QuestionArtifactView = ({
|
|
|
1973
1988
|
};
|
|
1974
1989
|
|
|
1975
1990
|
// src/artifacts/html-artifact.tsx
|
|
1976
|
-
import { jsx as
|
|
1991
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1977
1992
|
var HtmlArtifactView = ({ artifact }) => {
|
|
1978
1993
|
const sandboxed = artifact.sandboxed !== false;
|
|
1979
1994
|
const sandbox = sandboxed ? "allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock" : void 0;
|
|
1980
1995
|
const height = artifact.height ?? "320px";
|
|
1981
|
-
return /* @__PURE__ */
|
|
1996
|
+
return /* @__PURE__ */ jsx12(ArtifactCard, { title: artifact.title, kind: "html", children: /* @__PURE__ */ jsx12(
|
|
1982
1997
|
"iframe",
|
|
1983
1998
|
{
|
|
1984
1999
|
title: artifact.title ?? "HTML artifact",
|
|
@@ -1991,7 +2006,7 @@ var HtmlArtifactView = ({ artifact }) => {
|
|
|
1991
2006
|
};
|
|
1992
2007
|
|
|
1993
2008
|
// src/artifacts/json-artifact.tsx
|
|
1994
|
-
import { jsx as
|
|
2009
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1995
2010
|
var JsonArtifactView = ({
|
|
1996
2011
|
artifact
|
|
1997
2012
|
}) => {
|
|
@@ -2003,16 +2018,16 @@ var JsonArtifactView = ({
|
|
|
2003
2018
|
} catch {
|
|
2004
2019
|
body = String(data);
|
|
2005
2020
|
}
|
|
2006
|
-
return /* @__PURE__ */
|
|
2021
|
+
return /* @__PURE__ */ jsx13(ArtifactCard, { title, kind: "json", children: /* @__PURE__ */ jsx13("pre", { className: "aui-artifact-json m-0 max-h-[420px] overflow-auto p-3 font-mono text-[12px] leading-relaxed text-foreground/85", children: body }) });
|
|
2007
2022
|
};
|
|
2008
2023
|
|
|
2009
2024
|
// src/artifacts/table-artifact.tsx
|
|
2010
|
-
import { jsx as
|
|
2025
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2011
2026
|
var TableArtifactView = ({ artifact }) => {
|
|
2012
2027
|
const rows = artifact.rows ?? [];
|
|
2013
2028
|
const columns = artifact.columns ?? deriveColumns(rows);
|
|
2014
|
-
return /* @__PURE__ */
|
|
2015
|
-
/* @__PURE__ */
|
|
2029
|
+
return /* @__PURE__ */ jsx14(ArtifactCard, { title: artifact.title, kind: "table", children: /* @__PURE__ */ jsx14("div", { className: "aui-artifact-table-wrap overflow-x-auto", children: /* @__PURE__ */ jsxs9("table", { className: "aui-artifact-table w-full border-collapse text-sm", children: [
|
|
2030
|
+
/* @__PURE__ */ jsx14("thead", { children: /* @__PURE__ */ jsx14("tr", { className: "border-b border-border/40 bg-muted/20", children: columns.map((col) => /* @__PURE__ */ jsx14(
|
|
2016
2031
|
"th",
|
|
2017
2032
|
{
|
|
2018
2033
|
className: "px-3 py-2 text-left text-xs font-semibold uppercase tracking-wider text-muted-foreground",
|
|
@@ -2020,11 +2035,11 @@ var TableArtifactView = ({ artifact }) => {
|
|
|
2020
2035
|
},
|
|
2021
2036
|
col.key
|
|
2022
2037
|
)) }) }),
|
|
2023
|
-
/* @__PURE__ */
|
|
2038
|
+
/* @__PURE__ */ jsx14("tbody", { children: rows.map((row, i) => /* @__PURE__ */ jsx14(
|
|
2024
2039
|
"tr",
|
|
2025
2040
|
{
|
|
2026
2041
|
className: "border-b border-border/30 transition-colors last:border-b-0 hover:bg-muted/20",
|
|
2027
|
-
children: columns.map((col) => /* @__PURE__ */
|
|
2042
|
+
children: columns.map((col) => /* @__PURE__ */ jsx14(
|
|
2028
2043
|
"td",
|
|
2029
2044
|
{
|
|
2030
2045
|
className: "px-3 py-2 align-top text-foreground/85",
|
|
@@ -2111,31 +2126,31 @@ function resolveBindable(value, state) {
|
|
|
2111
2126
|
|
|
2112
2127
|
// src/artifacts/ui/registry.tsx
|
|
2113
2128
|
import {
|
|
2114
|
-
createContext as
|
|
2115
|
-
useContext as
|
|
2129
|
+
createContext as createContext3,
|
|
2130
|
+
useContext as useContext3
|
|
2116
2131
|
} from "react";
|
|
2117
|
-
import { jsx as
|
|
2118
|
-
var UiStateContext =
|
|
2119
|
-
var UiDispatchContext =
|
|
2132
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2133
|
+
var UiStateContext = createContext3({});
|
|
2134
|
+
var UiDispatchContext = createContext3(() => {
|
|
2120
2135
|
});
|
|
2121
|
-
var UiStateProvider = ({ state, dispatch, children }) => /* @__PURE__ */
|
|
2136
|
+
var UiStateProvider = ({ state, dispatch, children }) => /* @__PURE__ */ jsx15(UiStateContext.Provider, { value: state, children: /* @__PURE__ */ jsx15(UiDispatchContext.Provider, { value: dispatch, children }) });
|
|
2122
2137
|
function useUiState() {
|
|
2123
|
-
return
|
|
2138
|
+
return useContext3(UiStateContext);
|
|
2124
2139
|
}
|
|
2125
2140
|
function useUiDispatch() {
|
|
2126
|
-
return
|
|
2141
|
+
return useContext3(UiDispatchContext);
|
|
2127
2142
|
}
|
|
2128
|
-
var UiEventContext =
|
|
2143
|
+
var UiEventContext = createContext3(
|
|
2129
2144
|
null
|
|
2130
2145
|
);
|
|
2131
|
-
var UiEventProvider = ({ onEvent, children }) => /* @__PURE__ */
|
|
2146
|
+
var UiEventProvider = ({ onEvent, children }) => /* @__PURE__ */ jsx15(UiEventContext.Provider, { value: onEvent, children });
|
|
2132
2147
|
function useUiEventEmitter() {
|
|
2133
|
-
return
|
|
2148
|
+
return useContext3(UiEventContext);
|
|
2134
2149
|
}
|
|
2135
|
-
var UiCustomNodeRegistryContext =
|
|
2136
|
-
var UiCustomNodeRegistryProvider = ({ renderers, children }) => /* @__PURE__ */
|
|
2150
|
+
var UiCustomNodeRegistryContext = createContext3({});
|
|
2151
|
+
var UiCustomNodeRegistryProvider = ({ renderers, children }) => /* @__PURE__ */ jsx15(UiCustomNodeRegistryContext.Provider, { value: renderers, children });
|
|
2137
2152
|
function useUiCustomNodeRegistry() {
|
|
2138
|
-
return
|
|
2153
|
+
return useContext3(UiCustomNodeRegistryContext);
|
|
2139
2154
|
}
|
|
2140
2155
|
|
|
2141
2156
|
// src/artifacts/ui/nodes.tsx
|
|
@@ -2146,7 +2161,7 @@ import { useThreadRuntime as useThreadRuntime2 } from "@assistant-ui/react";
|
|
|
2146
2161
|
// src/ui/button.tsx
|
|
2147
2162
|
import { cva } from "class-variance-authority";
|
|
2148
2163
|
import { Slot as Slot2 } from "radix-ui";
|
|
2149
|
-
import { jsx as
|
|
2164
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
2150
2165
|
var buttonVariants = cva(
|
|
2151
2166
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/30 aria-invalid:border-destructive",
|
|
2152
2167
|
{
|
|
@@ -2184,7 +2199,7 @@ function Button({
|
|
|
2184
2199
|
...props
|
|
2185
2200
|
}) {
|
|
2186
2201
|
const Comp = asChild ? Slot2.Root : "button";
|
|
2187
|
-
return /* @__PURE__ */
|
|
2202
|
+
return /* @__PURE__ */ jsx16(
|
|
2188
2203
|
Comp,
|
|
2189
2204
|
{
|
|
2190
2205
|
"data-slot": "button",
|
|
@@ -2197,29 +2212,29 @@ function Button({
|
|
|
2197
2212
|
}
|
|
2198
2213
|
|
|
2199
2214
|
// src/artifacts/ui/nodes.tsx
|
|
2200
|
-
import { jsx as
|
|
2215
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2201
2216
|
var UiNodeView = ({ node }) => {
|
|
2202
2217
|
switch (node.kind) {
|
|
2203
2218
|
case "box":
|
|
2204
|
-
return /* @__PURE__ */
|
|
2219
|
+
return /* @__PURE__ */ jsx17(BoxNode, { node });
|
|
2205
2220
|
case "text":
|
|
2206
|
-
return /* @__PURE__ */
|
|
2221
|
+
return /* @__PURE__ */ jsx17(TextNode, { node });
|
|
2207
2222
|
case "heading":
|
|
2208
|
-
return /* @__PURE__ */
|
|
2223
|
+
return /* @__PURE__ */ jsx17(HeadingNode, { node });
|
|
2209
2224
|
case "badge":
|
|
2210
|
-
return /* @__PURE__ */
|
|
2225
|
+
return /* @__PURE__ */ jsx17(BadgeNode, { node });
|
|
2211
2226
|
case "button":
|
|
2212
|
-
return /* @__PURE__ */
|
|
2227
|
+
return /* @__PURE__ */ jsx17(ButtonNode, { node });
|
|
2213
2228
|
case "toggle":
|
|
2214
|
-
return /* @__PURE__ */
|
|
2229
|
+
return /* @__PURE__ */ jsx17(ToggleNode, { node });
|
|
2215
2230
|
case "slider":
|
|
2216
|
-
return /* @__PURE__ */
|
|
2231
|
+
return /* @__PURE__ */ jsx17(SliderNode, { node });
|
|
2217
2232
|
case "tooltip":
|
|
2218
|
-
return /* @__PURE__ */
|
|
2233
|
+
return /* @__PURE__ */ jsx17(TooltipNode, { node });
|
|
2219
2234
|
case "draggable":
|
|
2220
|
-
return /* @__PURE__ */
|
|
2235
|
+
return /* @__PURE__ */ jsx17(DraggableNode, { node });
|
|
2221
2236
|
case "custom":
|
|
2222
|
-
return /* @__PURE__ */
|
|
2237
|
+
return /* @__PURE__ */ jsx17(CustomNode, { node });
|
|
2223
2238
|
default:
|
|
2224
2239
|
return null;
|
|
2225
2240
|
}
|
|
@@ -2279,7 +2294,7 @@ var JUSTIFY_CLS = {
|
|
|
2279
2294
|
};
|
|
2280
2295
|
var BoxNode = ({ node }) => {
|
|
2281
2296
|
const dir = node.direction ?? "col";
|
|
2282
|
-
return /* @__PURE__ */
|
|
2297
|
+
return /* @__PURE__ */ jsx17(
|
|
2283
2298
|
"div",
|
|
2284
2299
|
{
|
|
2285
2300
|
className: cn(
|
|
@@ -2294,7 +2309,7 @@ var BoxNode = ({ node }) => {
|
|
|
2294
2309
|
gap: node.gap !== void 0 ? `${node.gap * 0.25}rem` : void 0,
|
|
2295
2310
|
padding: node.padding !== void 0 ? `${node.padding * 0.25}rem` : void 0
|
|
2296
2311
|
},
|
|
2297
|
-
children: node.children?.map((child, i) => /* @__PURE__ */
|
|
2312
|
+
children: node.children?.map((child, i) => /* @__PURE__ */ jsx17(UiNodeView, { node: child }, child.id ?? i))
|
|
2298
2313
|
}
|
|
2299
2314
|
);
|
|
2300
2315
|
};
|
|
@@ -2313,7 +2328,7 @@ var TEXT_WEIGHT = {
|
|
|
2313
2328
|
var TextNode = ({ node }) => {
|
|
2314
2329
|
const state = useUiState();
|
|
2315
2330
|
const value = resolveBindable(node.value, state);
|
|
2316
|
-
return /* @__PURE__ */
|
|
2331
|
+
return /* @__PURE__ */ jsx17(
|
|
2317
2332
|
"span",
|
|
2318
2333
|
{
|
|
2319
2334
|
className: cn(
|
|
@@ -2344,13 +2359,13 @@ var HeadingNode = ({ node }) => {
|
|
|
2344
2359
|
);
|
|
2345
2360
|
switch (level) {
|
|
2346
2361
|
case 1:
|
|
2347
|
-
return /* @__PURE__ */
|
|
2362
|
+
return /* @__PURE__ */ jsx17("h1", { className: cls, children: value });
|
|
2348
2363
|
case 2:
|
|
2349
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ jsx17("h2", { className: cls, children: value });
|
|
2350
2365
|
case 3:
|
|
2351
|
-
return /* @__PURE__ */
|
|
2366
|
+
return /* @__PURE__ */ jsx17("h3", { className: cls, children: value });
|
|
2352
2367
|
case 4:
|
|
2353
|
-
return /* @__PURE__ */
|
|
2368
|
+
return /* @__PURE__ */ jsx17("h4", { className: cls, children: value });
|
|
2354
2369
|
}
|
|
2355
2370
|
};
|
|
2356
2371
|
var BADGE_TONE = {
|
|
@@ -2363,7 +2378,7 @@ var BADGE_TONE = {
|
|
|
2363
2378
|
var BadgeNode = ({ node }) => {
|
|
2364
2379
|
const state = useUiState();
|
|
2365
2380
|
const value = String(resolveBindable(node.value, state) ?? "");
|
|
2366
|
-
return /* @__PURE__ */
|
|
2381
|
+
return /* @__PURE__ */ jsx17(
|
|
2367
2382
|
"span",
|
|
2368
2383
|
{
|
|
2369
2384
|
className: cn(
|
|
@@ -2380,7 +2395,7 @@ var ButtonNode = ({ node }) => {
|
|
|
2380
2395
|
const run = useActionRunner();
|
|
2381
2396
|
const label = String(resolveBindable(node.label, state) ?? "");
|
|
2382
2397
|
const disabled = node.disabled !== void 0 ? Boolean(resolveBindable(node.disabled, state)) : false;
|
|
2383
|
-
return /* @__PURE__ */
|
|
2398
|
+
return /* @__PURE__ */ jsx17(
|
|
2384
2399
|
Button,
|
|
2385
2400
|
{
|
|
2386
2401
|
variant: node.variant ?? "default",
|
|
@@ -2410,7 +2425,7 @@ var ToggleNode = ({ node }) => {
|
|
|
2410
2425
|
node.className
|
|
2411
2426
|
),
|
|
2412
2427
|
children: [
|
|
2413
|
-
/* @__PURE__ */
|
|
2428
|
+
/* @__PURE__ */ jsx17(
|
|
2414
2429
|
"button",
|
|
2415
2430
|
{
|
|
2416
2431
|
type: "button",
|
|
@@ -2421,7 +2436,7 @@ var ToggleNode = ({ node }) => {
|
|
|
2421
2436
|
"relative inline-flex h-5 w-9 shrink-0 items-center rounded-full border transition-colors",
|
|
2422
2437
|
value ? "border-primary bg-primary" : "border-border bg-muted hover:bg-muted/80"
|
|
2423
2438
|
),
|
|
2424
|
-
children: /* @__PURE__ */
|
|
2439
|
+
children: /* @__PURE__ */ jsx17(
|
|
2425
2440
|
"span",
|
|
2426
2441
|
{
|
|
2427
2442
|
className: cn(
|
|
@@ -2433,7 +2448,7 @@ var ToggleNode = ({ node }) => {
|
|
|
2433
2448
|
)
|
|
2434
2449
|
}
|
|
2435
2450
|
),
|
|
2436
|
-
label && /* @__PURE__ */
|
|
2451
|
+
label && /* @__PURE__ */ jsx17("span", { className: "text-foreground/85", children: label })
|
|
2437
2452
|
]
|
|
2438
2453
|
}
|
|
2439
2454
|
);
|
|
@@ -2455,10 +2470,10 @@ var SliderNode = ({ node }) => {
|
|
|
2455
2470
|
};
|
|
2456
2471
|
return /* @__PURE__ */ jsxs10("div", { className: cn("aui-ui-slider flex flex-col gap-1", node.className), children: [
|
|
2457
2472
|
(label || showValue) && /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
|
|
2458
|
-
label && /* @__PURE__ */
|
|
2459
|
-
showValue && /* @__PURE__ */
|
|
2473
|
+
label && /* @__PURE__ */ jsx17("span", { children: label }),
|
|
2474
|
+
showValue && /* @__PURE__ */ jsx17("span", { className: "font-mono", children: value })
|
|
2460
2475
|
] }),
|
|
2461
|
-
/* @__PURE__ */
|
|
2476
|
+
/* @__PURE__ */ jsx17(
|
|
2462
2477
|
"input",
|
|
2463
2478
|
{
|
|
2464
2479
|
type: "range",
|
|
@@ -2480,9 +2495,9 @@ var SliderNode = ({ node }) => {
|
|
|
2480
2495
|
var TooltipNode = ({ node }) => {
|
|
2481
2496
|
const state = useUiState();
|
|
2482
2497
|
const content = String(resolveBindable(node.content, state) ?? "");
|
|
2483
|
-
return /* @__PURE__ */
|
|
2484
|
-
/* @__PURE__ */
|
|
2485
|
-
/* @__PURE__ */
|
|
2498
|
+
return /* @__PURE__ */ jsx17(TooltipProvider, { children: /* @__PURE__ */ jsxs10(Tooltip, { children: [
|
|
2499
|
+
/* @__PURE__ */ jsx17(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx17("span", { className: cn("aui-ui-tooltip-trigger inline-flex", node.className), children: /* @__PURE__ */ jsx17(UiNodeView, { node: node.child }) }) }),
|
|
2500
|
+
/* @__PURE__ */ jsx17(TooltipContent, { side: node.side ?? "top", children: content })
|
|
2486
2501
|
] }) });
|
|
2487
2502
|
};
|
|
2488
2503
|
var DraggableNode = ({ node }) => {
|
|
@@ -2490,7 +2505,7 @@ var DraggableNode = ({ node }) => {
|
|
|
2490
2505
|
const snapBack = node.snapBack ?? true;
|
|
2491
2506
|
const axis = node.axis ?? "both";
|
|
2492
2507
|
const dragProp = axis === "both" ? true : axis;
|
|
2493
|
-
return /* @__PURE__ */
|
|
2508
|
+
return /* @__PURE__ */ jsx17(
|
|
2494
2509
|
motion.div,
|
|
2495
2510
|
{
|
|
2496
2511
|
drag: dragProp,
|
|
@@ -2502,7 +2517,7 @@ var DraggableNode = ({ node }) => {
|
|
|
2502
2517
|
"aui-ui-draggable inline-block cursor-grab touch-none",
|
|
2503
2518
|
node.className
|
|
2504
2519
|
),
|
|
2505
|
-
children: /* @__PURE__ */
|
|
2520
|
+
children: /* @__PURE__ */ jsx17(UiNodeView, { node: node.child })
|
|
2506
2521
|
}
|
|
2507
2522
|
);
|
|
2508
2523
|
};
|
|
@@ -2512,8 +2527,8 @@ var CustomNode = ({ node }) => {
|
|
|
2512
2527
|
const Renderer = registry[node.name];
|
|
2513
2528
|
if (!Renderer) return null;
|
|
2514
2529
|
const resolvedProps = resolveProps(node.props ?? {}, state);
|
|
2515
|
-
const children = node.children?.map((child, i) => /* @__PURE__ */
|
|
2516
|
-
return /* @__PURE__ */
|
|
2530
|
+
const children = node.children?.map((child, i) => /* @__PURE__ */ jsx17(UiNodeView, { node: child }, child.id ?? i));
|
|
2531
|
+
return /* @__PURE__ */ jsx17(Renderer, { props: resolvedProps, children });
|
|
2517
2532
|
};
|
|
2518
2533
|
function resolveProps(props, state) {
|
|
2519
2534
|
const out = {};
|
|
@@ -2524,17 +2539,17 @@ function resolveProps(props, state) {
|
|
|
2524
2539
|
}
|
|
2525
2540
|
|
|
2526
2541
|
// src/artifacts/ui/ui-artifact.tsx
|
|
2527
|
-
import { jsx as
|
|
2542
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2528
2543
|
var UiArtifactView = ({ artifact }) => {
|
|
2529
2544
|
const [state, dispatch] = useReducer(
|
|
2530
2545
|
uiStateReducer,
|
|
2531
2546
|
artifact.initialState ?? {}
|
|
2532
2547
|
);
|
|
2533
|
-
return /* @__PURE__ */
|
|
2548
|
+
return /* @__PURE__ */ jsx18(ArtifactCard, { title: artifact.title, kind: "ui", children: /* @__PURE__ */ jsx18(UiStateProvider, { state, dispatch, children: /* @__PURE__ */ jsx18("div", { className: "aui-ui-root p-3", children: /* @__PURE__ */ jsx18(UiNodeView, { node: artifact.root }) }) }) });
|
|
2534
2549
|
};
|
|
2535
2550
|
|
|
2536
2551
|
// src/artifacts/registry.tsx
|
|
2537
|
-
import { jsx as
|
|
2552
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2538
2553
|
var defaultArtifactRenderers = {
|
|
2539
2554
|
chart: ChartArtifactView,
|
|
2540
2555
|
question: QuestionArtifactView,
|
|
@@ -2543,7 +2558,7 @@ var defaultArtifactRenderers = {
|
|
|
2543
2558
|
table: TableArtifactView,
|
|
2544
2559
|
ui: UiArtifactView
|
|
2545
2560
|
};
|
|
2546
|
-
var ArtifactRegistryContext =
|
|
2561
|
+
var ArtifactRegistryContext = createContext4(
|
|
2547
2562
|
defaultArtifactRenderers
|
|
2548
2563
|
);
|
|
2549
2564
|
var ArtifactRegistryProvider = ({ renderers, override, children }) => {
|
|
@@ -2552,16 +2567,16 @@ var ArtifactRegistryProvider = ({ renderers, override, children }) => {
|
|
|
2552
2567
|
if (override) return renderers;
|
|
2553
2568
|
return { ...defaultArtifactRenderers, ...renderers };
|
|
2554
2569
|
}, [renderers, override]);
|
|
2555
|
-
return /* @__PURE__ */
|
|
2570
|
+
return /* @__PURE__ */ jsx19(ArtifactRegistryContext.Provider, { value: merged, children });
|
|
2556
2571
|
};
|
|
2557
2572
|
function useArtifactRegistry() {
|
|
2558
|
-
return
|
|
2573
|
+
return useContext4(ArtifactRegistryContext);
|
|
2559
2574
|
}
|
|
2560
2575
|
var ArtifactView = ({ artifact }) => {
|
|
2561
2576
|
const registry = useArtifactRegistry();
|
|
2562
2577
|
const Renderer = registry[artifact.type] ?? registry.json;
|
|
2563
2578
|
if (!Renderer) return null;
|
|
2564
|
-
return /* @__PURE__ */
|
|
2579
|
+
return /* @__PURE__ */ jsx19(Renderer, { artifact });
|
|
2565
2580
|
};
|
|
2566
2581
|
|
|
2567
2582
|
// src/artifacts/parse.ts
|
|
@@ -2677,7 +2692,7 @@ import langC from "shiki/langs/c.mjs";
|
|
|
2677
2692
|
import langCpp from "shiki/langs/cpp.mjs";
|
|
2678
2693
|
import themeVitesseDark from "shiki/themes/vitesse-dark.mjs";
|
|
2679
2694
|
import themeVitesseLight from "shiki/themes/vitesse-light.mjs";
|
|
2680
|
-
import { jsx as
|
|
2695
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2681
2696
|
var SHIKI_THEME_DARK = "vitesse-dark";
|
|
2682
2697
|
var SHIKI_THEME_LIGHT = "vitesse-light";
|
|
2683
2698
|
var highlighterPromise = null;
|
|
@@ -2746,13 +2761,13 @@ var ShikiSyntaxHighlighter = ({
|
|
|
2746
2761
|
try {
|
|
2747
2762
|
const parsed = JSON.parse(code);
|
|
2748
2763
|
if (isArtifact(parsed)) {
|
|
2749
|
-
return /* @__PURE__ */
|
|
2764
|
+
return /* @__PURE__ */ jsx20(ArtifactView, { artifact: parsed });
|
|
2750
2765
|
}
|
|
2751
2766
|
} catch {
|
|
2752
2767
|
}
|
|
2753
2768
|
}
|
|
2754
2769
|
if (html) {
|
|
2755
|
-
return /* @__PURE__ */
|
|
2770
|
+
return /* @__PURE__ */ jsx20(
|
|
2756
2771
|
"div",
|
|
2757
2772
|
{
|
|
2758
2773
|
className: "shiki-wrapper [&>pre]:!m-0 [&>pre]:!rounded-t-none [&>pre]:!rounded-b-lg [&>pre]:!border [&>pre]:!border-t-0 [&>pre]:!border-border/50 [&>pre]:!p-3 [&>pre]:!text-xs [&>pre]:!leading-relaxed [&>pre]:overflow-x-auto",
|
|
@@ -2760,14 +2775,14 @@ var ShikiSyntaxHighlighter = ({
|
|
|
2760
2775
|
}
|
|
2761
2776
|
);
|
|
2762
2777
|
}
|
|
2763
|
-
return /* @__PURE__ */
|
|
2778
|
+
return /* @__PURE__ */ jsx20(Pre, { children: /* @__PURE__ */ jsx20(Code2, { children: code }) });
|
|
2764
2779
|
};
|
|
2765
2780
|
var syntax_highlighter_default = ShikiSyntaxHighlighter;
|
|
2766
2781
|
|
|
2767
2782
|
// src/components/markdown-text.tsx
|
|
2768
|
-
import { jsx as
|
|
2783
|
+
import { jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2769
2784
|
var MarkdownTextImpl = () => {
|
|
2770
|
-
return /* @__PURE__ */
|
|
2785
|
+
return /* @__PURE__ */ jsx21(
|
|
2771
2786
|
MarkdownTextPrimitive,
|
|
2772
2787
|
{
|
|
2773
2788
|
remarkPlugins: [remarkGfm, remarkMath],
|
|
@@ -2790,7 +2805,7 @@ var CodeHeader = ({ language, code }) => {
|
|
|
2790
2805
|
};
|
|
2791
2806
|
return /* @__PURE__ */ jsxs11("div", { className: "aui-code-header flex items-center justify-between rounded-t-lg border border-b-0 border-border/50 bg-code-header-bg px-4 py-2", children: [
|
|
2792
2807
|
/* @__PURE__ */ jsxs11("span", { className: "flex items-center gap-2 text-xs font-semibold tracking-wide text-muted-foreground/80 uppercase", children: [
|
|
2793
|
-
/* @__PURE__ */
|
|
2808
|
+
/* @__PURE__ */ jsx21("span", { className: "inline-block h-2 w-2 rounded-full bg-primary/40" }),
|
|
2794
2809
|
language
|
|
2795
2810
|
] }),
|
|
2796
2811
|
/* @__PURE__ */ jsxs11(
|
|
@@ -2800,8 +2815,8 @@ var CodeHeader = ({ language, code }) => {
|
|
|
2800
2815
|
onClick: onCopy,
|
|
2801
2816
|
className: "transition-colors hover:text-foreground",
|
|
2802
2817
|
children: [
|
|
2803
|
-
!isCopied && /* @__PURE__ */
|
|
2804
|
-
isCopied && /* @__PURE__ */
|
|
2818
|
+
!isCopied && /* @__PURE__ */ jsx21(CopyIcon, { className: "h-3.5 w-3.5" }),
|
|
2819
|
+
isCopied && /* @__PURE__ */ jsx21(CheckIcon2, { className: "h-3.5 w-3.5 text-emerald-500" })
|
|
2805
2820
|
]
|
|
2806
2821
|
}
|
|
2807
2822
|
)
|
|
@@ -2821,7 +2836,7 @@ var useCopyToClipboard = ({
|
|
|
2821
2836
|
return { isCopied, copyToClipboard };
|
|
2822
2837
|
};
|
|
2823
2838
|
var defaultComponents = memoizeMarkdownComponents({
|
|
2824
|
-
h1: ({ className, ...props }) => /* @__PURE__ */
|
|
2839
|
+
h1: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2825
2840
|
"h1",
|
|
2826
2841
|
{
|
|
2827
2842
|
className: cn(
|
|
@@ -2831,7 +2846,7 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2831
2846
|
...props
|
|
2832
2847
|
}
|
|
2833
2848
|
),
|
|
2834
|
-
h2: ({ className, ...props }) => /* @__PURE__ */
|
|
2849
|
+
h2: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2835
2850
|
"h2",
|
|
2836
2851
|
{
|
|
2837
2852
|
className: cn(
|
|
@@ -2841,7 +2856,7 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2841
2856
|
...props
|
|
2842
2857
|
}
|
|
2843
2858
|
),
|
|
2844
|
-
h3: ({ className, ...props }) => /* @__PURE__ */
|
|
2859
|
+
h3: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2845
2860
|
"h3",
|
|
2846
2861
|
{
|
|
2847
2862
|
className: cn(
|
|
@@ -2851,7 +2866,7 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2851
2866
|
...props
|
|
2852
2867
|
}
|
|
2853
2868
|
),
|
|
2854
|
-
h4: ({ className, ...props }) => /* @__PURE__ */
|
|
2869
|
+
h4: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2855
2870
|
"h4",
|
|
2856
2871
|
{
|
|
2857
2872
|
className: cn(
|
|
@@ -2861,7 +2876,7 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2861
2876
|
...props
|
|
2862
2877
|
}
|
|
2863
2878
|
),
|
|
2864
|
-
h5: ({ className, ...props }) => /* @__PURE__ */
|
|
2879
|
+
h5: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2865
2880
|
"h5",
|
|
2866
2881
|
{
|
|
2867
2882
|
className: cn(
|
|
@@ -2871,7 +2886,7 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2871
2886
|
...props
|
|
2872
2887
|
}
|
|
2873
2888
|
),
|
|
2874
|
-
h6: ({ className, ...props }) => /* @__PURE__ */
|
|
2889
|
+
h6: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2875
2890
|
"h6",
|
|
2876
2891
|
{
|
|
2877
2892
|
className: cn(
|
|
@@ -2881,7 +2896,7 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2881
2896
|
...props
|
|
2882
2897
|
}
|
|
2883
2898
|
),
|
|
2884
|
-
p: ({ className, ...props }) => /* @__PURE__ */
|
|
2899
|
+
p: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2885
2900
|
"p",
|
|
2886
2901
|
{
|
|
2887
2902
|
className: cn(
|
|
@@ -2891,7 +2906,7 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2891
2906
|
...props
|
|
2892
2907
|
}
|
|
2893
2908
|
),
|
|
2894
|
-
a: ({ className, ...props }) => /* @__PURE__ */
|
|
2909
|
+
a: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2895
2910
|
"a",
|
|
2896
2911
|
{
|
|
2897
2912
|
className: cn(
|
|
@@ -2903,7 +2918,7 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2903
2918
|
...props
|
|
2904
2919
|
}
|
|
2905
2920
|
),
|
|
2906
|
-
blockquote: ({ className, ...props }) => /* @__PURE__ */
|
|
2921
|
+
blockquote: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2907
2922
|
"blockquote",
|
|
2908
2923
|
{
|
|
2909
2924
|
className: cn(
|
|
@@ -2913,7 +2928,7 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2913
2928
|
...props
|
|
2914
2929
|
}
|
|
2915
2930
|
),
|
|
2916
|
-
ul: ({ className, ...props }) => /* @__PURE__ */
|
|
2931
|
+
ul: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2917
2932
|
"ul",
|
|
2918
2933
|
{
|
|
2919
2934
|
className: cn(
|
|
@@ -2923,7 +2938,7 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2923
2938
|
...props
|
|
2924
2939
|
}
|
|
2925
2940
|
),
|
|
2926
|
-
ol: ({ className, ...props }) => /* @__PURE__ */
|
|
2941
|
+
ol: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2927
2942
|
"ol",
|
|
2928
2943
|
{
|
|
2929
2944
|
className: cn(
|
|
@@ -2933,7 +2948,7 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2933
2948
|
...props
|
|
2934
2949
|
}
|
|
2935
2950
|
),
|
|
2936
|
-
hr: ({ className, ...props }) => /* @__PURE__ */
|
|
2951
|
+
hr: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2937
2952
|
"hr",
|
|
2938
2953
|
{
|
|
2939
2954
|
className: cn(
|
|
@@ -2943,14 +2958,14 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2943
2958
|
...props
|
|
2944
2959
|
}
|
|
2945
2960
|
),
|
|
2946
|
-
table: ({ className, ...props }) => /* @__PURE__ */
|
|
2961
|
+
table: ({ className, ...props }) => /* @__PURE__ */ jsx21("div", { className: "my-4 w-full overflow-x-auto rounded-lg border border-border/50", children: /* @__PURE__ */ jsx21(
|
|
2947
2962
|
"table",
|
|
2948
2963
|
{
|
|
2949
2964
|
className: cn("aui-md-table w-full border-collapse text-sm", className),
|
|
2950
2965
|
...props
|
|
2951
2966
|
}
|
|
2952
2967
|
) }),
|
|
2953
|
-
th: ({ className, ...props }) => /* @__PURE__ */
|
|
2968
|
+
th: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2954
2969
|
"th",
|
|
2955
2970
|
{
|
|
2956
2971
|
className: cn(
|
|
@@ -2960,7 +2975,7 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2960
2975
|
...props
|
|
2961
2976
|
}
|
|
2962
2977
|
),
|
|
2963
|
-
td: ({ className, ...props }) => /* @__PURE__ */
|
|
2978
|
+
td: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2964
2979
|
"td",
|
|
2965
2980
|
{
|
|
2966
2981
|
className: cn(
|
|
@@ -2970,7 +2985,7 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2970
2985
|
...props
|
|
2971
2986
|
}
|
|
2972
2987
|
),
|
|
2973
|
-
tr: ({ className, ...props }) => /* @__PURE__ */
|
|
2988
|
+
tr: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2974
2989
|
"tr",
|
|
2975
2990
|
{
|
|
2976
2991
|
className: cn(
|
|
@@ -2980,8 +2995,8 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2980
2995
|
...props
|
|
2981
2996
|
}
|
|
2982
2997
|
),
|
|
2983
|
-
li: ({ className, ...props }) => /* @__PURE__ */
|
|
2984
|
-
sup: ({ className, ...props }) => /* @__PURE__ */
|
|
2998
|
+
li: ({ className, ...props }) => /* @__PURE__ */ jsx21("li", { className: cn("aui-md-li leading-[1.7]", className), ...props }),
|
|
2999
|
+
sup: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2985
3000
|
"sup",
|
|
2986
3001
|
{
|
|
2987
3002
|
className: cn(
|
|
@@ -2991,7 +3006,7 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
2991
3006
|
...props
|
|
2992
3007
|
}
|
|
2993
3008
|
),
|
|
2994
|
-
pre: ({ className, ...props }) => /* @__PURE__ */
|
|
3009
|
+
pre: ({ className, ...props }) => /* @__PURE__ */ jsx21(
|
|
2995
3010
|
"pre",
|
|
2996
3011
|
{
|
|
2997
3012
|
className: cn(
|
|
@@ -3003,7 +3018,7 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
3003
3018
|
),
|
|
3004
3019
|
code: function Code({ className, ...props }) {
|
|
3005
3020
|
const isCodeBlock = useIsMarkdownCodeBlock();
|
|
3006
|
-
return /* @__PURE__ */
|
|
3021
|
+
return /* @__PURE__ */ jsx21(
|
|
3007
3022
|
"code",
|
|
3008
3023
|
{
|
|
3009
3024
|
className: cn(
|
|
@@ -3014,8 +3029,8 @@ var defaultComponents = memoizeMarkdownComponents({
|
|
|
3014
3029
|
}
|
|
3015
3030
|
);
|
|
3016
3031
|
},
|
|
3017
|
-
strong: ({ className, ...props }) => /* @__PURE__ */
|
|
3018
|
-
em: ({ className, ...props }) => /* @__PURE__ */
|
|
3032
|
+
strong: ({ className, ...props }) => /* @__PURE__ */ jsx21("strong", { className: cn("font-semibold text-foreground", className), ...props }),
|
|
3033
|
+
em: ({ className, ...props }) => /* @__PURE__ */ jsx21("em", { className: cn("italic", className), ...props }),
|
|
3019
3034
|
CodeHeader
|
|
3020
3035
|
});
|
|
3021
3036
|
|
|
@@ -3032,7 +3047,7 @@ import {
|
|
|
3032
3047
|
memo as memo2,
|
|
3033
3048
|
useMemo as useMemo4
|
|
3034
3049
|
} from "react";
|
|
3035
|
-
import { jsx as
|
|
3050
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
3036
3051
|
var ShimmerComponent = ({
|
|
3037
3052
|
children,
|
|
3038
3053
|
as: Component = "p",
|
|
@@ -3047,7 +3062,7 @@ var ShimmerComponent = ({
|
|
|
3047
3062
|
() => (children?.length ?? 0) * spread,
|
|
3048
3063
|
[children, spread]
|
|
3049
3064
|
);
|
|
3050
|
-
return /* @__PURE__ */
|
|
3065
|
+
return /* @__PURE__ */ jsx22(
|
|
3051
3066
|
MotionComponent,
|
|
3052
3067
|
{
|
|
3053
3068
|
animate: { backgroundPosition: "0% center" },
|
|
@@ -3074,7 +3089,7 @@ var Shimmer = memo2(ShimmerComponent);
|
|
|
3074
3089
|
|
|
3075
3090
|
// src/components/motion.tsx
|
|
3076
3091
|
import { AnimatePresence, motion as motion3, useReducedMotion } from "motion/react";
|
|
3077
|
-
import { jsx as
|
|
3092
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
3078
3093
|
var luxuryEase = [0.16, 1, 0.3, 1];
|
|
3079
3094
|
var TOOL_ENTER_MS = 0.78;
|
|
3080
3095
|
var TOOL_EXIT_MS = 0.28;
|
|
@@ -3102,7 +3117,7 @@ function toolMotionState(reduced, entering, variant) {
|
|
|
3102
3117
|
function ToolMotion({ children, className, motionKey }) {
|
|
3103
3118
|
const reduced = useReducedMotion() ?? false;
|
|
3104
3119
|
const { enter, exit } = toolPresenceTransition(reduced);
|
|
3105
|
-
return /* @__PURE__ */
|
|
3120
|
+
return /* @__PURE__ */ jsx23(
|
|
3106
3121
|
motion3.div,
|
|
3107
3122
|
{
|
|
3108
3123
|
className: cn("aui-tool-motion w-full min-w-0", className),
|
|
@@ -3125,7 +3140,7 @@ function ToolPresence({
|
|
|
3125
3140
|
const reduced = useReducedMotion() ?? false;
|
|
3126
3141
|
const { enter, exit } = toolPresenceTransition(reduced);
|
|
3127
3142
|
const enterTransition = variant === "executing" ? { duration: reduced ? 0.3 : 0.52, ease: luxuryEase } : enter;
|
|
3128
|
-
return /* @__PURE__ */
|
|
3143
|
+
return /* @__PURE__ */ jsx23(AnimatePresence, { mode: "wait", initial: true, children: /* @__PURE__ */ jsx23(
|
|
3129
3144
|
motion3.div,
|
|
3130
3145
|
{
|
|
3131
3146
|
className: cn("aui-tool-presence w-full min-w-0", className),
|
|
@@ -3147,7 +3162,7 @@ function ToolBodyPresence({
|
|
|
3147
3162
|
className
|
|
3148
3163
|
}) {
|
|
3149
3164
|
const reduced = useReducedMotion() ?? false;
|
|
3150
|
-
return /* @__PURE__ */
|
|
3165
|
+
return /* @__PURE__ */ jsx23(
|
|
3151
3166
|
"div",
|
|
3152
3167
|
{
|
|
3153
3168
|
className: cn(
|
|
@@ -3155,7 +3170,7 @@ function ToolBodyPresence({
|
|
|
3155
3170
|
open ? reduced ? "duration-200 ease-out" : "duration-[340ms] ease-[cubic-bezier(0.16,1,0.3,1)]" : reduced ? "duration-150 ease-[cubic-bezier(0.4,0,0.2,1)]" : "duration-200 ease-[cubic-bezier(0.4,0,0.2,1)]"
|
|
3156
3171
|
),
|
|
3157
3172
|
style: { gridTemplateRows: open ? "1fr" : "0fr" },
|
|
3158
|
-
children: /* @__PURE__ */
|
|
3173
|
+
children: /* @__PURE__ */ jsx23("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ jsx23(
|
|
3159
3174
|
"div",
|
|
3160
3175
|
{
|
|
3161
3176
|
className: cn(
|
|
@@ -3171,7 +3186,7 @@ function ToolBodyPresence({
|
|
|
3171
3186
|
}
|
|
3172
3187
|
|
|
3173
3188
|
// src/components/tool-fallback.tsx
|
|
3174
|
-
import { jsx as
|
|
3189
|
+
import { jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3175
3190
|
function detectRunning({
|
|
3176
3191
|
status,
|
|
3177
3192
|
result,
|
|
@@ -3204,7 +3219,7 @@ function formatToolResult(result) {
|
|
|
3204
3219
|
}
|
|
3205
3220
|
}
|
|
3206
3221
|
var TimelineActionLabel = ({ action, detail, shimmer = false }) => /* @__PURE__ */ jsxs12("span", { className: "inline-flex min-w-0 max-w-full items-baseline gap-1", children: [
|
|
3207
|
-
action ? shimmer ? /* @__PURE__ */
|
|
3222
|
+
action ? shimmer ? /* @__PURE__ */ jsx24(
|
|
3208
3223
|
Shimmer,
|
|
3209
3224
|
{
|
|
3210
3225
|
as: "span",
|
|
@@ -3213,10 +3228,10 @@ var TimelineActionLabel = ({ action, detail, shimmer = false }) => /* @__PURE__
|
|
|
3213
3228
|
spread: 2.5,
|
|
3214
3229
|
children: action
|
|
3215
3230
|
}
|
|
3216
|
-
) : /* @__PURE__ */
|
|
3217
|
-
detail ? /* @__PURE__ */
|
|
3231
|
+
) : /* @__PURE__ */ jsx24("span", { className: studioTimelineActionClass, children: action }) : null,
|
|
3232
|
+
detail ? /* @__PURE__ */ jsx24("span", { className: studioTimelineDetailClass, children: detail }) : null
|
|
3218
3233
|
] });
|
|
3219
|
-
var TimelineHoverChevron = ({ expanded }) => /* @__PURE__ */
|
|
3234
|
+
var TimelineHoverChevron = ({ expanded }) => /* @__PURE__ */ jsx24(
|
|
3220
3235
|
ChevronRightIcon,
|
|
3221
3236
|
{
|
|
3222
3237
|
className: studioTimelineChevronClass(expanded),
|
|
@@ -3241,10 +3256,10 @@ var ToolPanel = ({ toolName, argsText, result, isError }) => {
|
|
|
3241
3256
|
const hasBody = Boolean(formattedArgs || formattedResult);
|
|
3242
3257
|
const action = isError ? "Failed" : "Used";
|
|
3243
3258
|
if (!hasBody) {
|
|
3244
|
-
return /* @__PURE__ */
|
|
3259
|
+
return /* @__PURE__ */ jsx24("div", { className: "aui-tool-row w-full min-w-0", children: /* @__PURE__ */ jsx24(TimelineActionLabel, { action, detail }) });
|
|
3245
3260
|
}
|
|
3246
3261
|
return /* @__PURE__ */ jsxs12("div", { className: "aui-tool-row w-full min-w-0", children: [
|
|
3247
|
-
/* @__PURE__ */
|
|
3262
|
+
/* @__PURE__ */ jsx24(
|
|
3248
3263
|
"button",
|
|
3249
3264
|
{
|
|
3250
3265
|
type: "button",
|
|
@@ -3261,8 +3276,8 @@ var ToolPanel = ({ toolName, argsText, result, isError }) => {
|
|
|
3261
3276
|
"text-foreground"
|
|
3262
3277
|
),
|
|
3263
3278
|
children: [
|
|
3264
|
-
/* @__PURE__ */
|
|
3265
|
-
/* @__PURE__ */
|
|
3279
|
+
/* @__PURE__ */ jsx24(TimelineActionLabel, { action, detail }),
|
|
3280
|
+
/* @__PURE__ */ jsx24(TimelineHoverChevron, { expanded: open })
|
|
3266
3281
|
]
|
|
3267
3282
|
}
|
|
3268
3283
|
)
|
|
@@ -3274,24 +3289,24 @@ var ToolPanel = ({ toolName, argsText, result, isError }) => {
|
|
|
3274
3289
|
open,
|
|
3275
3290
|
className: cn(studioTimelineBodyPadClass, "gap-2"),
|
|
3276
3291
|
children: [
|
|
3277
|
-
formattedArgs ? /* @__PURE__ */
|
|
3292
|
+
formattedArgs ? /* @__PURE__ */ jsx24(
|
|
3278
3293
|
"div",
|
|
3279
3294
|
{
|
|
3280
3295
|
className: cn(
|
|
3281
3296
|
studioComposerIoWellClass,
|
|
3282
3297
|
"max-h-48 overflow-auto px-2.5 py-2"
|
|
3283
3298
|
),
|
|
3284
|
-
children: /* @__PURE__ */
|
|
3299
|
+
children: /* @__PURE__ */ jsx24("pre", { className: "whitespace-pre-wrap break-words font-mono text-[11px] font-normal leading-relaxed text-foreground", children: formattedArgs })
|
|
3285
3300
|
}
|
|
3286
3301
|
) : null,
|
|
3287
|
-
formattedResult ? /* @__PURE__ */
|
|
3302
|
+
formattedResult ? /* @__PURE__ */ jsx24(
|
|
3288
3303
|
"div",
|
|
3289
3304
|
{
|
|
3290
3305
|
className: cn(
|
|
3291
3306
|
studioComposerIoWellClass,
|
|
3292
3307
|
"max-h-48 overflow-auto px-2.5 py-2"
|
|
3293
3308
|
),
|
|
3294
|
-
children: /* @__PURE__ */
|
|
3309
|
+
children: /* @__PURE__ */ jsx24("pre", { className: "whitespace-pre-wrap break-words font-mono text-[11px] font-normal leading-relaxed text-foreground", children: formattedResult })
|
|
3295
3310
|
}
|
|
3296
3311
|
) : null
|
|
3297
3312
|
]
|
|
@@ -3308,20 +3323,20 @@ var ToolFallbackImpl = ({
|
|
|
3308
3323
|
const isRunning = useToolRunning({ status, result });
|
|
3309
3324
|
const isError = status?.type === "incomplete" && status.reason !== "cancelled";
|
|
3310
3325
|
const presenceKey = isRunning ? "running" : isError ? "error" : "complete";
|
|
3311
|
-
return /* @__PURE__ */
|
|
3326
|
+
return /* @__PURE__ */ jsx24(
|
|
3312
3327
|
ToolPresence,
|
|
3313
3328
|
{
|
|
3314
3329
|
presenceKey,
|
|
3315
3330
|
variant: isRunning ? "executing" : "settled",
|
|
3316
3331
|
className: "py-0.5",
|
|
3317
|
-
children: isRunning ? /* @__PURE__ */
|
|
3332
|
+
children: isRunning ? /* @__PURE__ */ jsx24("div", { className: "aui-tool-running", children: /* @__PURE__ */ jsx24(
|
|
3318
3333
|
TimelineActionLabel,
|
|
3319
3334
|
{
|
|
3320
3335
|
action: "Using",
|
|
3321
3336
|
detail: formatToolLabel(toolName),
|
|
3322
3337
|
shimmer: true
|
|
3323
3338
|
}
|
|
3324
|
-
) }) : /* @__PURE__ */
|
|
3339
|
+
) }) : /* @__PURE__ */ jsx24(
|
|
3325
3340
|
ToolPanel,
|
|
3326
3341
|
{
|
|
3327
3342
|
toolName,
|
|
@@ -3339,7 +3354,7 @@ var ToolFallback = memo3(
|
|
|
3339
3354
|
ToolFallback.displayName = "ToolFallback";
|
|
3340
3355
|
|
|
3341
3356
|
// src/artifacts/tool-artifact.tsx
|
|
3342
|
-
import { jsx as
|
|
3357
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
3343
3358
|
var ToolArtifactFallback = (props) => {
|
|
3344
3359
|
const registry = useArtifactRegistry();
|
|
3345
3360
|
const isRunning = useToolRunning({
|
|
@@ -3351,18 +3366,18 @@ var ToolArtifactFallback = (props) => {
|
|
|
3351
3366
|
if (artifact) {
|
|
3352
3367
|
const Renderer = registry[artifact.type];
|
|
3353
3368
|
if (Renderer) {
|
|
3354
|
-
return /* @__PURE__ */
|
|
3369
|
+
return /* @__PURE__ */ jsx25(
|
|
3355
3370
|
ToolMotion,
|
|
3356
3371
|
{
|
|
3357
3372
|
motionKey: `artifact-${artifact.type}`,
|
|
3358
3373
|
className: "aui-tool-artifact",
|
|
3359
|
-
children: /* @__PURE__ */
|
|
3374
|
+
children: /* @__PURE__ */ jsx25(Renderer, { artifact })
|
|
3360
3375
|
}
|
|
3361
3376
|
);
|
|
3362
3377
|
}
|
|
3363
3378
|
}
|
|
3364
3379
|
}
|
|
3365
|
-
return /* @__PURE__ */
|
|
3380
|
+
return /* @__PURE__ */ jsx25(ToolFallback, { ...props });
|
|
3366
3381
|
};
|
|
3367
3382
|
|
|
3368
3383
|
// src/components/composer.tsx
|
|
@@ -3372,43 +3387,46 @@ import {
|
|
|
3372
3387
|
useComposerRuntime
|
|
3373
3388
|
} from "@assistant-ui/react";
|
|
3374
3389
|
import { ArrowUpIcon, SquareIcon } from "lucide-react";
|
|
3375
|
-
import { Fragment as Fragment2, jsx as
|
|
3390
|
+
import { Fragment as Fragment2, jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3376
3391
|
var Composer = ({
|
|
3377
3392
|
placeholder = "Send a message...",
|
|
3378
|
-
showAttachments
|
|
3393
|
+
showAttachments,
|
|
3379
3394
|
toolbar,
|
|
3380
3395
|
sendTooltip = "Send message",
|
|
3381
3396
|
noAutoFocus,
|
|
3382
3397
|
className
|
|
3383
3398
|
}) => {
|
|
3384
|
-
|
|
3399
|
+
const attachmentsEnabled = useTimbalAttachmentsEnabled();
|
|
3400
|
+
const attachUi = showAttachments !== false && attachmentsEnabled;
|
|
3401
|
+
const shell = /* @__PURE__ */ jsxs13(Fragment2, { children: [
|
|
3402
|
+
attachUi && /* @__PURE__ */ jsx26(ComposerAttachments, {}),
|
|
3403
|
+
/* @__PURE__ */ jsx26(ComposerInput, { placeholder, autoFocus: !noAutoFocus }),
|
|
3404
|
+
/* @__PURE__ */ jsx26(
|
|
3405
|
+
ComposerToolbar,
|
|
3406
|
+
{
|
|
3407
|
+
showAttachments: attachUi,
|
|
3408
|
+
toolbar,
|
|
3409
|
+
sendTooltip
|
|
3410
|
+
}
|
|
3411
|
+
)
|
|
3412
|
+
] });
|
|
3413
|
+
return /* @__PURE__ */ jsx26(
|
|
3385
3414
|
ComposerPrimitive2.Root,
|
|
3386
3415
|
{
|
|
3387
3416
|
className: cn(
|
|
3388
3417
|
"aui-composer-root relative flex w-full flex-col",
|
|
3389
3418
|
className
|
|
3390
3419
|
),
|
|
3391
|
-
children: /* @__PURE__ */
|
|
3420
|
+
children: attachUi ? /* @__PURE__ */ jsx26(
|
|
3392
3421
|
ComposerPrimitive2.AttachmentDropzone,
|
|
3393
3422
|
{
|
|
3394
3423
|
className: cn(
|
|
3395
3424
|
studioComposeInputShellClass,
|
|
3396
3425
|
"data-[dragging=true]:border-2 data-[dragging=true]:border-dashed data-[dragging=true]:border-primary data-[dragging=true]:bg-accent/50"
|
|
3397
3426
|
),
|
|
3398
|
-
children:
|
|
3399
|
-
showAttachments && /* @__PURE__ */ jsx25(ComposerAttachments, {}),
|
|
3400
|
-
/* @__PURE__ */ jsx25(ComposerInput, { placeholder, autoFocus: !noAutoFocus }),
|
|
3401
|
-
/* @__PURE__ */ jsx25(
|
|
3402
|
-
ComposerToolbar,
|
|
3403
|
-
{
|
|
3404
|
-
showAttachments,
|
|
3405
|
-
toolbar,
|
|
3406
|
-
sendTooltip
|
|
3407
|
-
}
|
|
3408
|
-
)
|
|
3409
|
-
]
|
|
3427
|
+
children: shell
|
|
3410
3428
|
}
|
|
3411
|
-
)
|
|
3429
|
+
) : /* @__PURE__ */ jsx26("div", { className: studioComposeInputShellClass, children: shell })
|
|
3412
3430
|
}
|
|
3413
3431
|
);
|
|
3414
3432
|
};
|
|
@@ -3428,7 +3446,7 @@ var ComposerInput = ({
|
|
|
3428
3446
|
el.style.height = "auto";
|
|
3429
3447
|
el.style.height = `${Math.min(el.scrollHeight, 240)}px`;
|
|
3430
3448
|
};
|
|
3431
|
-
return /* @__PURE__ */
|
|
3449
|
+
return /* @__PURE__ */ jsx26(
|
|
3432
3450
|
ComposerPrimitive2.Input,
|
|
3433
3451
|
{
|
|
3434
3452
|
placeholder,
|
|
@@ -3444,15 +3462,15 @@ var ComposerInput = ({
|
|
|
3444
3462
|
var ComposerToolbar = ({ showAttachments, toolbar, sendTooltip }) => {
|
|
3445
3463
|
return /* @__PURE__ */ jsxs13("div", { className: "aui-composer-action-wrapper relative z-[1] flex items-center justify-between gap-1 bg-composer-bg px-2.5 pb-2.5", children: [
|
|
3446
3464
|
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1", children: [
|
|
3447
|
-
showAttachments && /* @__PURE__ */
|
|
3465
|
+
showAttachments && /* @__PURE__ */ jsx26(ComposerAddAttachment, {}),
|
|
3448
3466
|
toolbar
|
|
3449
3467
|
] }),
|
|
3450
|
-
/* @__PURE__ */
|
|
3468
|
+
/* @__PURE__ */ jsx26(ComposerSendOrCancel, { sendTooltip })
|
|
3451
3469
|
] });
|
|
3452
3470
|
};
|
|
3453
3471
|
var ComposerSendOrCancel = ({ sendTooltip }) => {
|
|
3454
3472
|
return /* @__PURE__ */ jsxs13(Fragment2, { children: [
|
|
3455
|
-
/* @__PURE__ */
|
|
3473
|
+
/* @__PURE__ */ jsx26(AuiIf, { condition: (s) => !s.thread.isRunning, children: /* @__PURE__ */ jsx26(ComposerPrimitive2.Send, { asChild: true, children: /* @__PURE__ */ jsx26(
|
|
3456
3474
|
TooltipIconButton,
|
|
3457
3475
|
{
|
|
3458
3476
|
tooltip: sendTooltip,
|
|
@@ -3460,17 +3478,17 @@ var ComposerSendOrCancel = ({ sendTooltip }) => {
|
|
|
3460
3478
|
type: "submit",
|
|
3461
3479
|
className: "aui-composer-send shrink-0 disabled:opacity-30",
|
|
3462
3480
|
"aria-label": "Send message",
|
|
3463
|
-
children: /* @__PURE__ */
|
|
3481
|
+
children: /* @__PURE__ */ jsx26(ArrowUpIcon, { className: "aui-composer-send-icon size-4" })
|
|
3464
3482
|
}
|
|
3465
3483
|
) }) }),
|
|
3466
|
-
/* @__PURE__ */
|
|
3484
|
+
/* @__PURE__ */ jsx26(AuiIf, { condition: (s) => s.thread.isRunning, children: /* @__PURE__ */ jsx26(ComposerPrimitive2.Cancel, { asChild: true, children: /* @__PURE__ */ jsx26(
|
|
3467
3485
|
TooltipIconButton,
|
|
3468
3486
|
{
|
|
3469
3487
|
tooltip: "Stop generating",
|
|
3470
3488
|
variant: "primary",
|
|
3471
3489
|
className: "aui-composer-cancel shrink-0",
|
|
3472
3490
|
"aria-label": "Stop generating",
|
|
3473
|
-
children: /* @__PURE__ */
|
|
3491
|
+
children: /* @__PURE__ */ jsx26(SquareIcon, { className: "aui-composer-cancel-icon size-3 fill-current" })
|
|
3474
3492
|
}
|
|
3475
3493
|
) }) })
|
|
3476
3494
|
] });
|
|
@@ -3484,14 +3502,14 @@ import {
|
|
|
3484
3502
|
} from "react";
|
|
3485
3503
|
import { useThreadRuntime as useThreadRuntime3 } from "@assistant-ui/react";
|
|
3486
3504
|
import { ArrowUpIcon as ArrowUpIcon2 } from "lucide-react";
|
|
3487
|
-
import { jsx as
|
|
3505
|
+
import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3488
3506
|
var Suggestions = ({
|
|
3489
3507
|
suggestions,
|
|
3490
3508
|
className
|
|
3491
3509
|
}) => {
|
|
3492
3510
|
const items = useResolvedSuggestions(suggestions);
|
|
3493
3511
|
if (!items || items.length === 0) return null;
|
|
3494
|
-
return /* @__PURE__ */
|
|
3512
|
+
return /* @__PURE__ */ jsx27(
|
|
3495
3513
|
"div",
|
|
3496
3514
|
{
|
|
3497
3515
|
className: cn(
|
|
@@ -3500,7 +3518,7 @@ var Suggestions = ({
|
|
|
3500
3518
|
),
|
|
3501
3519
|
role: "list",
|
|
3502
3520
|
"aria-label": "Suggested prompts",
|
|
3503
|
-
children: items.map((suggestion, i) => /* @__PURE__ */
|
|
3521
|
+
children: items.map((suggestion, i) => /* @__PURE__ */ jsx27(SuggestionRow, { suggestion }, (suggestion.prompt ?? suggestion.title) + i))
|
|
3504
3522
|
}
|
|
3505
3523
|
);
|
|
3506
3524
|
};
|
|
@@ -3518,10 +3536,10 @@ var SuggestionRow = ({ suggestion }) => {
|
|
|
3518
3536
|
onClick,
|
|
3519
3537
|
className: cn("aui-thread-suggestion", studioListRowButtonClass),
|
|
3520
3538
|
children: [
|
|
3521
|
-
/* @__PURE__ */
|
|
3539
|
+
/* @__PURE__ */ jsx27("span", { className: "aui-thread-suggestion-icon shrink-0 text-muted-foreground", children: suggestion.icon ?? /* @__PURE__ */ jsx27(ArrowUpIcon2, { className: "size-4", strokeWidth: 1.75, "aria-hidden": true }) }),
|
|
3522
3540
|
/* @__PURE__ */ jsxs14("span", { className: "aui-thread-suggestion-text min-w-0 flex-1 text-left", children: [
|
|
3523
|
-
/* @__PURE__ */
|
|
3524
|
-
suggestion.description && /* @__PURE__ */
|
|
3541
|
+
/* @__PURE__ */ jsx27("span", { className: "aui-thread-suggestion-text-1 block truncate text-sm font-normal text-foreground", children: suggestion.title }),
|
|
3542
|
+
suggestion.description && /* @__PURE__ */ jsx27("span", { className: "aui-thread-suggestion-text-2 mt-0.5 block truncate text-xs text-muted-foreground", children: suggestion.description })
|
|
3525
3543
|
] })
|
|
3526
3544
|
]
|
|
3527
3545
|
}
|
|
@@ -3623,7 +3641,7 @@ function scheduleThemeSanityCheck() {
|
|
|
3623
3641
|
}
|
|
3624
3642
|
|
|
3625
3643
|
// src/components/thread.tsx
|
|
3626
|
-
import { jsx as
|
|
3644
|
+
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3627
3645
|
var Thread = ({
|
|
3628
3646
|
className,
|
|
3629
3647
|
maxWidth = "44rem",
|
|
@@ -3644,17 +3662,17 @@ var Thread = ({
|
|
|
3644
3662
|
useEffect5(() => {
|
|
3645
3663
|
scheduleThemeSanityCheck();
|
|
3646
3664
|
}, []);
|
|
3647
|
-
return /* @__PURE__ */
|
|
3665
|
+
return /* @__PURE__ */ jsx28(
|
|
3648
3666
|
ArtifactRegistryProvider,
|
|
3649
3667
|
{
|
|
3650
3668
|
renderers: artifacts?.renderers,
|
|
3651
3669
|
override: artifacts?.override,
|
|
3652
|
-
children: /* @__PURE__ */
|
|
3653
|
-
}), children: /* @__PURE__ */
|
|
3670
|
+
children: /* @__PURE__ */ jsx28(UiEventProvider, { onEvent: onArtifactEvent ?? (() => {
|
|
3671
|
+
}), children: /* @__PURE__ */ jsx28(
|
|
3654
3672
|
ThreadPrimitive.Root,
|
|
3655
3673
|
{
|
|
3656
3674
|
className: cn(
|
|
3657
|
-
"aui-root aui-thread-root @container flex h-full flex-col bg-
|
|
3675
|
+
"aui-root aui-thread-root @container flex h-full flex-col bg-transparent",
|
|
3658
3676
|
className
|
|
3659
3677
|
),
|
|
3660
3678
|
style: { ["--thread-max-width"]: maxWidth },
|
|
@@ -3664,7 +3682,7 @@ var Thread = ({
|
|
|
3664
3682
|
turnAnchor: "bottom",
|
|
3665
3683
|
className: "aui-thread-viewport relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-pb-4 px-4 pt-4",
|
|
3666
3684
|
children: [
|
|
3667
|
-
/* @__PURE__ */
|
|
3685
|
+
/* @__PURE__ */ jsx28(
|
|
3668
3686
|
WelcomeSlot,
|
|
3669
3687
|
{
|
|
3670
3688
|
config: welcome,
|
|
@@ -3672,7 +3690,7 @@ var Thread = ({
|
|
|
3672
3690
|
Suggestions: SuggestionsSlot
|
|
3673
3691
|
}
|
|
3674
3692
|
),
|
|
3675
|
-
/* @__PURE__ */
|
|
3693
|
+
/* @__PURE__ */ jsx28(
|
|
3676
3694
|
ThreadPrimitive.Messages,
|
|
3677
3695
|
{
|
|
3678
3696
|
components: {
|
|
@@ -3682,9 +3700,9 @@ var Thread = ({
|
|
|
3682
3700
|
}
|
|
3683
3701
|
}
|
|
3684
3702
|
),
|
|
3685
|
-
/* @__PURE__ */ jsxs15(ThreadPrimitive.ViewportFooter, { className: "aui-thread-viewport-footer sticky bottom-0 z-10 mx-auto mt-auto flex w-full max-w-(--thread-max-width) isolate flex-col gap-4 bg-
|
|
3686
|
-
/* @__PURE__ */
|
|
3687
|
-
/* @__PURE__ */
|
|
3703
|
+
/* @__PURE__ */ jsxs15(ThreadPrimitive.ViewportFooter, { className: "aui-thread-viewport-footer sticky bottom-0 z-10 mx-auto mt-auto flex w-full max-w-(--thread-max-width) isolate flex-col gap-4 bg-transparent pt-2 pb-4 md:pb-6", children: [
|
|
3704
|
+
/* @__PURE__ */ jsx28(ScrollToBottomSlot, {}),
|
|
3705
|
+
/* @__PURE__ */ jsx28(ComposerSlot, { placeholder: composerPlaceholder })
|
|
3688
3706
|
] })
|
|
3689
3707
|
]
|
|
3690
3708
|
}
|
|
@@ -3695,13 +3713,13 @@ var Thread = ({
|
|
|
3695
3713
|
);
|
|
3696
3714
|
};
|
|
3697
3715
|
var ThreadScrollToBottom = () => {
|
|
3698
|
-
return /* @__PURE__ */
|
|
3716
|
+
return /* @__PURE__ */ jsx28(ThreadPrimitive.ScrollToBottom, { asChild: true, children: /* @__PURE__ */ jsx28(
|
|
3699
3717
|
TooltipIconButton,
|
|
3700
3718
|
{
|
|
3701
3719
|
tooltip: "Scroll to bottom",
|
|
3702
3720
|
variant: "secondary",
|
|
3703
3721
|
className: "aui-thread-scroll-to-bottom absolute -top-12 z-10 self-center disabled:invisible",
|
|
3704
|
-
children: /* @__PURE__ */
|
|
3722
|
+
children: /* @__PURE__ */ jsx28(ArrowDownIcon, { className: "size-4" })
|
|
3705
3723
|
}
|
|
3706
3724
|
) });
|
|
3707
3725
|
};
|
|
@@ -3736,7 +3754,7 @@ var ThreadWelcome = ({
|
|
|
3736
3754
|
const isEmpty = useThread((s) => s.messages.length === 0);
|
|
3737
3755
|
if (!isEmpty) return null;
|
|
3738
3756
|
return /* @__PURE__ */ jsxs15("div", { className: "aui-thread-welcome-root mx-auto my-auto flex w-full max-w-(--thread-max-width) grow flex-col", children: [
|
|
3739
|
-
/* @__PURE__ */
|
|
3757
|
+
/* @__PURE__ */ jsx28("div", { className: "aui-thread-welcome-center flex w-full grow flex-col items-center justify-center", children: /* @__PURE__ */ jsxs15(
|
|
3740
3758
|
motion4.div,
|
|
3741
3759
|
{
|
|
3742
3760
|
className: "aui-thread-welcome-message flex flex-col items-center justify-center px-4 text-center",
|
|
@@ -3744,8 +3762,8 @@ var ThreadWelcome = ({
|
|
|
3744
3762
|
initial: "initial",
|
|
3745
3763
|
animate: "animate",
|
|
3746
3764
|
children: [
|
|
3747
|
-
config?.icon && /* @__PURE__ */
|
|
3748
|
-
/* @__PURE__ */
|
|
3765
|
+
config?.icon && /* @__PURE__ */ jsx28(motion4.div, { variants: welcomeIcon, className: "mb-5", children: config.icon }),
|
|
3766
|
+
/* @__PURE__ */ jsx28(
|
|
3749
3767
|
motion4.h1,
|
|
3750
3768
|
{
|
|
3751
3769
|
variants: welcomeItem,
|
|
@@ -3753,7 +3771,7 @@ var ThreadWelcome = ({
|
|
|
3753
3771
|
children: config?.heading ?? "How can I help you today?"
|
|
3754
3772
|
}
|
|
3755
3773
|
),
|
|
3756
|
-
/* @__PURE__ */
|
|
3774
|
+
/* @__PURE__ */ jsx28(
|
|
3757
3775
|
motion4.p,
|
|
3758
3776
|
{
|
|
3759
3777
|
variants: welcomeItem,
|
|
@@ -3764,11 +3782,11 @@ var ThreadWelcome = ({
|
|
|
3764
3782
|
]
|
|
3765
3783
|
}
|
|
3766
3784
|
) }),
|
|
3767
|
-
suggestions && /* @__PURE__ */
|
|
3785
|
+
suggestions && /* @__PURE__ */ jsx28("div", { className: "aui-thread-welcome-suggestions mx-auto w-full max-w-(--thread-max-width) px-2", children: /* @__PURE__ */ jsx28(SuggestionsSlot, { suggestions }) })
|
|
3768
3786
|
] });
|
|
3769
3787
|
};
|
|
3770
3788
|
var MessageError = () => {
|
|
3771
|
-
return /* @__PURE__ */
|
|
3789
|
+
return /* @__PURE__ */ jsx28(MessagePrimitive2.Error, { children: /* @__PURE__ */ jsx28(ErrorPrimitive.Root, { className: "aui-message-error-root mt-2 rounded-md border border-destructive bg-destructive/10 p-3 text-destructive text-sm", children: /* @__PURE__ */ jsx28(ErrorPrimitive.Message, { className: "aui-message-error-message line-clamp-2" }) }) });
|
|
3772
3790
|
};
|
|
3773
3791
|
var AssistantMessage = () => {
|
|
3774
3792
|
return /* @__PURE__ */ jsxs15(
|
|
@@ -3778,7 +3796,7 @@ var AssistantMessage = () => {
|
|
|
3778
3796
|
"data-role": "assistant",
|
|
3779
3797
|
children: [
|
|
3780
3798
|
/* @__PURE__ */ jsxs15("div", { className: "aui-assistant-message-content wrap-break-word px-2 text-foreground leading-relaxed", children: [
|
|
3781
|
-
/* @__PURE__ */
|
|
3799
|
+
/* @__PURE__ */ jsx28(
|
|
3782
3800
|
MessagePrimitive2.Parts,
|
|
3783
3801
|
{
|
|
3784
3802
|
components: {
|
|
@@ -3789,9 +3807,9 @@ var AssistantMessage = () => {
|
|
|
3789
3807
|
}
|
|
3790
3808
|
}
|
|
3791
3809
|
),
|
|
3792
|
-
/* @__PURE__ */
|
|
3810
|
+
/* @__PURE__ */ jsx28(MessageError, {})
|
|
3793
3811
|
] }),
|
|
3794
|
-
/* @__PURE__ */
|
|
3812
|
+
/* @__PURE__ */ jsx28("div", { className: "aui-assistant-message-footer mt-1 mb-3 ml-1 flex", children: /* @__PURE__ */ jsx28(AssistantActionBar, {}) })
|
|
3795
3813
|
]
|
|
3796
3814
|
}
|
|
3797
3815
|
);
|
|
@@ -3811,29 +3829,29 @@ var AssistantActionBar = () => {
|
|
|
3811
3829
|
autohide: "never",
|
|
3812
3830
|
className: "aui-assistant-action-bar-root flex items-center gap-0 bg-transparent px-0 py-0.5 text-muted-foreground/60",
|
|
3813
3831
|
children: [
|
|
3814
|
-
/* @__PURE__ */
|
|
3832
|
+
/* @__PURE__ */ jsx28(ActionBarPrimitive.Copy, { asChild: true, children: /* @__PURE__ */ jsxs15(
|
|
3815
3833
|
TooltipIconButton,
|
|
3816
3834
|
{
|
|
3817
3835
|
tooltip: "Copy",
|
|
3818
3836
|
variant: "ghost",
|
|
3819
3837
|
className: ASSISTANT_ACTION_ICON_CLASS,
|
|
3820
3838
|
children: [
|
|
3821
|
-
/* @__PURE__ */
|
|
3822
|
-
/* @__PURE__ */
|
|
3839
|
+
/* @__PURE__ */ jsx28(AuiIf2, { condition: (s) => s.message.isCopied, children: /* @__PURE__ */ jsx28(CheckIcon3, { className: "size-3" }) }),
|
|
3840
|
+
/* @__PURE__ */ jsx28(AuiIf2, { condition: (s) => !s.message.isCopied, children: /* @__PURE__ */ jsx28(CopyIcon2, { className: "size-3" }) })
|
|
3823
3841
|
]
|
|
3824
3842
|
}
|
|
3825
3843
|
) }),
|
|
3826
|
-
/* @__PURE__ */
|
|
3844
|
+
/* @__PURE__ */ jsx28(ActionBarPrimitive.Reload, { asChild: true, children: /* @__PURE__ */ jsx28(
|
|
3827
3845
|
TooltipIconButton,
|
|
3828
3846
|
{
|
|
3829
3847
|
tooltip: "Regenerate",
|
|
3830
3848
|
variant: "ghost",
|
|
3831
3849
|
className: ASSISTANT_ACTION_ICON_CLASS,
|
|
3832
|
-
children: /* @__PURE__ */
|
|
3850
|
+
children: /* @__PURE__ */ jsx28(RefreshCwIcon, { className: "size-3" })
|
|
3833
3851
|
}
|
|
3834
3852
|
) }),
|
|
3835
3853
|
/* @__PURE__ */ jsxs15(ActionBarMorePrimitive.Root, { children: [
|
|
3836
|
-
/* @__PURE__ */
|
|
3854
|
+
/* @__PURE__ */ jsx28(ActionBarMorePrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsx28(
|
|
3837
3855
|
TooltipIconButton,
|
|
3838
3856
|
{
|
|
3839
3857
|
tooltip: "More",
|
|
@@ -3842,17 +3860,17 @@ var AssistantActionBar = () => {
|
|
|
3842
3860
|
ASSISTANT_ACTION_ICON_CLASS,
|
|
3843
3861
|
"data-[state=open]:text-muted-foreground/80"
|
|
3844
3862
|
),
|
|
3845
|
-
children: /* @__PURE__ */
|
|
3863
|
+
children: /* @__PURE__ */ jsx28(MoreHorizontalIcon, { className: "size-3" })
|
|
3846
3864
|
}
|
|
3847
3865
|
) }),
|
|
3848
|
-
/* @__PURE__ */
|
|
3866
|
+
/* @__PURE__ */ jsx28(
|
|
3849
3867
|
ActionBarMorePrimitive.Content,
|
|
3850
3868
|
{
|
|
3851
3869
|
side: "bottom",
|
|
3852
3870
|
align: "start",
|
|
3853
3871
|
className: "aui-action-bar-more-content z-50 min-w-36 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-card-elevated",
|
|
3854
|
-
children: /* @__PURE__ */
|
|
3855
|
-
/* @__PURE__ */
|
|
3872
|
+
children: /* @__PURE__ */ jsx28(ActionBarPrimitive.ExportMarkdown, { asChild: true, children: /* @__PURE__ */ jsxs15(ActionBarMorePrimitive.Item, { className: "aui-action-bar-more-item flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none hover:bg-muted focus:bg-muted", children: [
|
|
3873
|
+
/* @__PURE__ */ jsx28(DownloadIcon, { className: "size-4 shrink-0" }),
|
|
3856
3874
|
"Export as Markdown"
|
|
3857
3875
|
] }) })
|
|
3858
3876
|
}
|
|
@@ -3863,7 +3881,7 @@ var AssistantActionBar = () => {
|
|
|
3863
3881
|
);
|
|
3864
3882
|
};
|
|
3865
3883
|
var UserMessageText = () => {
|
|
3866
|
-
return /* @__PURE__ */
|
|
3884
|
+
return /* @__PURE__ */ jsx28("span", { className: "whitespace-pre-wrap", children: /* @__PURE__ */ jsx28(MessagePartPrimitive.Text, { smooth: false }) });
|
|
3867
3885
|
};
|
|
3868
3886
|
var UserMessage = () => {
|
|
3869
3887
|
return /* @__PURE__ */ jsxs15(
|
|
@@ -3872,7 +3890,7 @@ var UserMessage = () => {
|
|
|
3872
3890
|
className: "aui-user-message-root mx-auto flex w-full max-w-(--thread-max-width) flex-col items-end gap-2 px-2 py-3",
|
|
3873
3891
|
"data-role": "user",
|
|
3874
3892
|
children: [
|
|
3875
|
-
/* @__PURE__ */
|
|
3893
|
+
/* @__PURE__ */ jsx28(UserMessageAttachments, {}),
|
|
3876
3894
|
/* @__PURE__ */ jsxs15(
|
|
3877
3895
|
motion4.div,
|
|
3878
3896
|
{
|
|
@@ -3881,8 +3899,8 @@ var UserMessage = () => {
|
|
|
3881
3899
|
animate: { opacity: 1, y: 0, scale: 1 },
|
|
3882
3900
|
transition: { duration: 0.65, ease: luxuryEase },
|
|
3883
3901
|
children: [
|
|
3884
|
-
/* @__PURE__ */
|
|
3885
|
-
/* @__PURE__ */
|
|
3902
|
+
/* @__PURE__ */ jsx28(MessagePrimitive2.Parts, { components: { Text: UserMessageText } }),
|
|
3903
|
+
/* @__PURE__ */ jsx28("div", { className: "aui-user-action-bar-wrapper absolute top-1/2 left-0 -translate-x-full -translate-y-1/2 pr-2", children: /* @__PURE__ */ jsx28(UserActionBar, {}) })
|
|
3886
3904
|
]
|
|
3887
3905
|
}
|
|
3888
3906
|
)
|
|
@@ -3891,27 +3909,27 @@ var UserMessage = () => {
|
|
|
3891
3909
|
);
|
|
3892
3910
|
};
|
|
3893
3911
|
var UserActionBar = () => {
|
|
3894
|
-
return /* @__PURE__ */
|
|
3912
|
+
return /* @__PURE__ */ jsx28(
|
|
3895
3913
|
ActionBarPrimitive.Root,
|
|
3896
3914
|
{
|
|
3897
3915
|
hideWhenRunning: true,
|
|
3898
|
-
autohide: "
|
|
3916
|
+
autohide: "always",
|
|
3899
3917
|
className: "aui-user-action-bar-root flex flex-col items-end",
|
|
3900
|
-
children: /* @__PURE__ */
|
|
3918
|
+
children: /* @__PURE__ */ jsx28(ActionBarPrimitive.Edit, { asChild: true, children: /* @__PURE__ */ jsx28(
|
|
3901
3919
|
TooltipIconButton,
|
|
3902
3920
|
{
|
|
3903
3921
|
tooltip: "Edit",
|
|
3904
3922
|
variant: "ghost",
|
|
3905
3923
|
className: ASSISTANT_ACTION_ICON_CLASS,
|
|
3906
|
-
children: /* @__PURE__ */
|
|
3924
|
+
children: /* @__PURE__ */ jsx28(PencilIcon, { className: "size-3" })
|
|
3907
3925
|
}
|
|
3908
3926
|
) })
|
|
3909
3927
|
}
|
|
3910
3928
|
);
|
|
3911
3929
|
};
|
|
3912
3930
|
var EditComposer = () => {
|
|
3913
|
-
return /* @__PURE__ */
|
|
3914
|
-
/* @__PURE__ */
|
|
3931
|
+
return /* @__PURE__ */ jsx28(MessagePrimitive2.Root, { className: "aui-edit-composer-wrapper mx-auto flex w-full max-w-(--thread-max-width) flex-col px-2 py-3", children: /* @__PURE__ */ jsxs15(ComposerPrimitive3.Root, { className: "aui-edit-composer-root ml-auto flex w-full max-w-[85%] flex-col rounded-2xl bg-muted", children: [
|
|
3932
|
+
/* @__PURE__ */ jsx28(
|
|
3915
3933
|
ComposerPrimitive3.Input,
|
|
3916
3934
|
{
|
|
3917
3935
|
className: "aui-edit-composer-input min-h-14 w-full resize-none bg-transparent p-4 text-foreground text-sm outline-none",
|
|
@@ -3919,14 +3937,14 @@ var EditComposer = () => {
|
|
|
3919
3937
|
}
|
|
3920
3938
|
),
|
|
3921
3939
|
/* @__PURE__ */ jsxs15("div", { className: "aui-edit-composer-footer mx-3 mb-3 flex items-center gap-2 self-end", children: [
|
|
3922
|
-
/* @__PURE__ */
|
|
3923
|
-
/* @__PURE__ */
|
|
3940
|
+
/* @__PURE__ */ jsx28(ComposerPrimitive3.Cancel, { asChild: true, children: /* @__PURE__ */ jsx28(TimbalV2Button, { variant: "ghost", size: "sm", children: "Cancel" }) }),
|
|
3941
|
+
/* @__PURE__ */ jsx28(ComposerPrimitive3.Send, { asChild: true, children: /* @__PURE__ */ jsx28(TimbalV2Button, { variant: "primary", size: "sm", children: "Update" }) })
|
|
3924
3942
|
] })
|
|
3925
3943
|
] }) });
|
|
3926
3944
|
};
|
|
3927
3945
|
|
|
3928
3946
|
// src/components/chat.tsx
|
|
3929
|
-
import { jsx as
|
|
3947
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3930
3948
|
function TimbalChat({
|
|
3931
3949
|
workforceId,
|
|
3932
3950
|
baseUrl,
|
|
@@ -3937,7 +3955,7 @@ function TimbalChat({
|
|
|
3937
3955
|
debug,
|
|
3938
3956
|
...threadProps
|
|
3939
3957
|
}) {
|
|
3940
|
-
return /* @__PURE__ */
|
|
3958
|
+
return /* @__PURE__ */ jsx29(
|
|
3941
3959
|
TimbalRuntimeProvider,
|
|
3942
3960
|
{
|
|
3943
3961
|
workforceId,
|
|
@@ -3947,14 +3965,14 @@ function TimbalChat({
|
|
|
3947
3965
|
attachmentsUploadUrl,
|
|
3948
3966
|
attachmentsAccept,
|
|
3949
3967
|
debug,
|
|
3950
|
-
children: /* @__PURE__ */
|
|
3968
|
+
children: /* @__PURE__ */ jsx29(Thread, { ...threadProps })
|
|
3951
3969
|
}
|
|
3952
3970
|
);
|
|
3953
3971
|
}
|
|
3954
3972
|
|
|
3955
3973
|
// src/components/workforce-selector.tsx
|
|
3956
3974
|
import { ChevronDownIcon } from "lucide-react";
|
|
3957
|
-
import { jsx as
|
|
3975
|
+
import { jsx as jsx30, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3958
3976
|
var WorkforceSelector = ({
|
|
3959
3977
|
workforces,
|
|
3960
3978
|
value,
|
|
@@ -3984,15 +4002,15 @@ var WorkforceSelector = ({
|
|
|
3984
4002
|
onChange: (e) => onChange(e.target.value),
|
|
3985
4003
|
"aria-label": placeholder,
|
|
3986
4004
|
children: [
|
|
3987
|
-
!value && /* @__PURE__ */
|
|
4005
|
+
!value && /* @__PURE__ */ jsx30("option", { value: "", children: placeholder }),
|
|
3988
4006
|
workforces.map((w) => {
|
|
3989
4007
|
const id = idOf(w);
|
|
3990
|
-
return /* @__PURE__ */
|
|
4008
|
+
return /* @__PURE__ */ jsx30("option", { value: id, children: w.name ?? id }, id);
|
|
3991
4009
|
})
|
|
3992
4010
|
]
|
|
3993
4011
|
}
|
|
3994
4012
|
),
|
|
3995
|
-
/* @__PURE__ */
|
|
4013
|
+
/* @__PURE__ */ jsx30(
|
|
3996
4014
|
ChevronDownIcon,
|
|
3997
4015
|
{
|
|
3998
4016
|
className: "aui-workforce-selector-icon pointer-events-none absolute right-3 size-3.5 text-muted-foreground/70",
|
|
@@ -4111,7 +4129,7 @@ var DOM_IDS = {
|
|
|
4111
4129
|
};
|
|
4112
4130
|
|
|
4113
4131
|
// src/components/chat-shell.tsx
|
|
4114
|
-
import { jsx as
|
|
4132
|
+
import { jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4115
4133
|
var TimbalChatShell = ({
|
|
4116
4134
|
workforceId,
|
|
4117
4135
|
brand,
|
|
@@ -4138,7 +4156,7 @@ var TimbalChatShell = ({
|
|
|
4138
4156
|
),
|
|
4139
4157
|
style: studioChromeShellStyle,
|
|
4140
4158
|
children: [
|
|
4141
|
-
/* @__PURE__ */
|
|
4159
|
+
/* @__PURE__ */ jsx31(
|
|
4142
4160
|
"div",
|
|
4143
4161
|
{
|
|
4144
4162
|
className: cn(
|
|
@@ -4152,14 +4170,14 @@ var TimbalChatShell = ({
|
|
|
4152
4170
|
"header",
|
|
4153
4171
|
{
|
|
4154
4172
|
className: cn(
|
|
4155
|
-
"aui-chat-shell-header relative z-10 flex shrink-0 items-center justify-between px-4 pt-[var(--studio-topbar-gap)] pb-2",
|
|
4173
|
+
"aui-chat-shell-header relative z-10 flex shrink-0 items-center justify-between bg-transparent px-4 pt-[var(--studio-topbar-gap)] pb-2",
|
|
4156
4174
|
headerClassName
|
|
4157
4175
|
),
|
|
4158
4176
|
style: { minHeight: "var(--studio-topbar-height)" },
|
|
4159
4177
|
children: [
|
|
4160
4178
|
/* @__PURE__ */ jsxs17("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
4161
4179
|
brand,
|
|
4162
|
-
showSelector && /* @__PURE__ */
|
|
4180
|
+
showSelector && /* @__PURE__ */ jsx31(
|
|
4163
4181
|
WorkforceSelector,
|
|
4164
4182
|
{
|
|
4165
4183
|
workforces,
|
|
@@ -4168,11 +4186,11 @@ var TimbalChatShell = ({
|
|
|
4168
4186
|
}
|
|
4169
4187
|
)
|
|
4170
4188
|
] }),
|
|
4171
|
-
/* @__PURE__ */
|
|
4189
|
+
/* @__PURE__ */ jsx31("div", { className: "flex shrink-0 items-center gap-1", children: headerActions })
|
|
4172
4190
|
]
|
|
4173
4191
|
}
|
|
4174
4192
|
),
|
|
4175
|
-
/* @__PURE__ */
|
|
4193
|
+
/* @__PURE__ */ jsx31(
|
|
4176
4194
|
TimbalChat,
|
|
4177
4195
|
{
|
|
4178
4196
|
workforceId: effectiveId,
|
|
@@ -4345,13 +4363,13 @@ function useSidebarCollapsePhase(collapsed, reducedMotion) {
|
|
|
4345
4363
|
|
|
4346
4364
|
// src/components/studio/sidebar-backdrop.tsx
|
|
4347
4365
|
import { AnimatePresence as AnimatePresence2, motion as motion5, useReducedMotion as useReducedMotion2 } from "motion/react";
|
|
4348
|
-
import { jsx as
|
|
4366
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
4349
4367
|
var StudioSidebarBackdrop = ({
|
|
4350
4368
|
open,
|
|
4351
4369
|
onClose
|
|
4352
4370
|
}) => {
|
|
4353
4371
|
const reducedMotion = useReducedMotion2();
|
|
4354
|
-
return /* @__PURE__ */
|
|
4372
|
+
return /* @__PURE__ */ jsx32(AnimatePresence2, { children: open ? /* @__PURE__ */ jsx32(
|
|
4355
4373
|
motion5.button,
|
|
4356
4374
|
{
|
|
4357
4375
|
type: "button",
|
|
@@ -4367,15 +4385,15 @@ var StudioSidebarBackdrop = ({
|
|
|
4367
4385
|
};
|
|
4368
4386
|
|
|
4369
4387
|
// src/components/studio/sidebar-context.tsx
|
|
4370
|
-
import { createContext as
|
|
4371
|
-
var StudioSidebarContext =
|
|
4388
|
+
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
4389
|
+
var StudioSidebarContext = createContext5({
|
|
4372
4390
|
collapsed: false,
|
|
4373
4391
|
isMobile: false,
|
|
4374
4392
|
isCollapsedRail: false,
|
|
4375
4393
|
iconOnlyLayout: false
|
|
4376
4394
|
});
|
|
4377
4395
|
function useStudioSidebarLayout() {
|
|
4378
|
-
return
|
|
4396
|
+
return useContext5(StudioSidebarContext);
|
|
4379
4397
|
}
|
|
4380
4398
|
|
|
4381
4399
|
// src/components/studio/sidebar.tsx
|
|
@@ -4389,7 +4407,7 @@ import { motion as motion8, useReducedMotion as useReducedMotion5 } from "motion
|
|
|
4389
4407
|
|
|
4390
4408
|
// src/components/studio/sidebar-entries.tsx
|
|
4391
4409
|
import { motion as motion6, useReducedMotion as useReducedMotion3 } from "motion/react";
|
|
4392
|
-
import { jsx as
|
|
4410
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
4393
4411
|
var StudioSidebarEntries = ({
|
|
4394
4412
|
visible,
|
|
4395
4413
|
onBlurOutComplete,
|
|
@@ -4398,9 +4416,9 @@ var StudioSidebarEntries = ({
|
|
|
4398
4416
|
}) => {
|
|
4399
4417
|
const reducedMotion = useReducedMotion3();
|
|
4400
4418
|
if (reducedMotion) {
|
|
4401
|
-
return visible ? /* @__PURE__ */
|
|
4419
|
+
return visible ? /* @__PURE__ */ jsx33("div", { className: cn("flex min-h-0 flex-1 flex-col", className), children }) : null;
|
|
4402
4420
|
}
|
|
4403
|
-
return /* @__PURE__ */
|
|
4421
|
+
return /* @__PURE__ */ jsx33(
|
|
4404
4422
|
motion6.div,
|
|
4405
4423
|
{
|
|
4406
4424
|
className: cn("flex min-h-0 flex-1 flex-col", className),
|
|
@@ -4425,13 +4443,13 @@ import { LogOut } from "lucide-react";
|
|
|
4425
4443
|
|
|
4426
4444
|
// src/auth/provider.tsx
|
|
4427
4445
|
import {
|
|
4428
|
-
createContext as
|
|
4446
|
+
createContext as createContext6,
|
|
4429
4447
|
useCallback as useCallback5,
|
|
4430
|
-
useContext as
|
|
4448
|
+
useContext as useContext6,
|
|
4431
4449
|
useEffect as useEffect8,
|
|
4432
4450
|
useState as useState10
|
|
4433
4451
|
} from "react";
|
|
4434
|
-
import { jsx as
|
|
4452
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
4435
4453
|
function isInsideIframe() {
|
|
4436
4454
|
try {
|
|
4437
4455
|
return typeof window !== "undefined" && window.self !== window.top;
|
|
@@ -4439,16 +4457,16 @@ function isInsideIframe() {
|
|
|
4439
4457
|
return true;
|
|
4440
4458
|
}
|
|
4441
4459
|
}
|
|
4442
|
-
var SessionContext =
|
|
4460
|
+
var SessionContext = createContext6(void 0);
|
|
4443
4461
|
var useSession = () => {
|
|
4444
|
-
const context =
|
|
4462
|
+
const context = useContext6(SessionContext);
|
|
4445
4463
|
if (context === void 0) {
|
|
4446
4464
|
throw new Error("useSession must be used within a SessionProvider");
|
|
4447
4465
|
}
|
|
4448
4466
|
return context;
|
|
4449
4467
|
};
|
|
4450
4468
|
var useOptionalSession = () => {
|
|
4451
|
-
const context =
|
|
4469
|
+
const context = useContext6(SessionContext);
|
|
4452
4470
|
return context ?? null;
|
|
4453
4471
|
};
|
|
4454
4472
|
var SessionProvider = ({
|
|
@@ -4529,7 +4547,7 @@ var SessionProvider = ({
|
|
|
4529
4547
|
() => window.location.href = `/api/auth/login?return_to=${returnTo}`
|
|
4530
4548
|
);
|
|
4531
4549
|
}, []);
|
|
4532
|
-
return /* @__PURE__ */
|
|
4550
|
+
return /* @__PURE__ */ jsx34(
|
|
4533
4551
|
SessionContext.Provider,
|
|
4534
4552
|
{
|
|
4535
4553
|
value: {
|
|
@@ -4568,34 +4586,34 @@ function studioSidebarNavItemClasses(iconOnly, isActive) {
|
|
|
4568
4586
|
|
|
4569
4587
|
// src/components/studio/sidebar-entry-motion.tsx
|
|
4570
4588
|
import { motion as motion7, useReducedMotion as useReducedMotion4 } from "motion/react";
|
|
4571
|
-
import { jsx as
|
|
4589
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
4572
4590
|
var StudioSidebarEntryMotion = ({
|
|
4573
4591
|
children,
|
|
4574
4592
|
className
|
|
4575
4593
|
}) => {
|
|
4576
4594
|
const reducedMotion = useReducedMotion4();
|
|
4577
4595
|
if (reducedMotion) {
|
|
4578
|
-
return /* @__PURE__ */
|
|
4596
|
+
return /* @__PURE__ */ jsx35("div", { className, children });
|
|
4579
4597
|
}
|
|
4580
|
-
return /* @__PURE__ */
|
|
4598
|
+
return /* @__PURE__ */ jsx35(motion7.div, { variants: studioSidebarEntryItemVariants, className: cn(className), children });
|
|
4581
4599
|
};
|
|
4582
4600
|
|
|
4583
4601
|
// src/components/studio/sidebar-tooltip.tsx
|
|
4584
|
-
import { Fragment as Fragment3, jsx as
|
|
4602
|
+
import { Fragment as Fragment3, jsx as jsx36, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4585
4603
|
var StudioSidebarTooltip = ({
|
|
4586
4604
|
label,
|
|
4587
4605
|
enabled,
|
|
4588
4606
|
children
|
|
4589
4607
|
}) => {
|
|
4590
|
-
if (!enabled) return /* @__PURE__ */
|
|
4608
|
+
if (!enabled) return /* @__PURE__ */ jsx36(Fragment3, { children });
|
|
4591
4609
|
return /* @__PURE__ */ jsxs18(Tooltip, { children: [
|
|
4592
|
-
/* @__PURE__ */
|
|
4593
|
-
/* @__PURE__ */
|
|
4610
|
+
/* @__PURE__ */ jsx36(TooltipTrigger, { asChild: true, children }),
|
|
4611
|
+
/* @__PURE__ */ jsx36(TooltipContent, { side: "right", className: "text-xs", children: label })
|
|
4594
4612
|
] });
|
|
4595
4613
|
};
|
|
4596
4614
|
|
|
4597
4615
|
// src/components/studio/sidebar-footer.tsx
|
|
4598
|
-
import { jsx as
|
|
4616
|
+
import { jsx as jsx37, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4599
4617
|
function userInitials(name, email) {
|
|
4600
4618
|
const fromName = name.trim().split(/\s+/).map((part) => part.charAt(0)).join("").slice(0, 2).toUpperCase();
|
|
4601
4619
|
if (fromName) return fromName;
|
|
@@ -4613,7 +4631,7 @@ var StudioSidebarFooter = ({
|
|
|
4613
4631
|
session?.logout();
|
|
4614
4632
|
onSignOut?.();
|
|
4615
4633
|
};
|
|
4616
|
-
return /* @__PURE__ */
|
|
4634
|
+
return /* @__PURE__ */ jsx37(StudioSidebarEntryMotion, { children: /* @__PURE__ */ jsx37(
|
|
4617
4635
|
"footer",
|
|
4618
4636
|
{
|
|
4619
4637
|
className: cn(
|
|
@@ -4621,24 +4639,24 @@ var StudioSidebarFooter = ({
|
|
|
4621
4639
|
iconOnlyLayout ? studioSidebarCollapsedRailInsetClass : "px-2.5"
|
|
4622
4640
|
),
|
|
4623
4641
|
children: user ? /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-2", children: [
|
|
4624
|
-
iconOnlyLayout ? /* @__PURE__ */
|
|
4625
|
-
user.user_photo_url ? /* @__PURE__ */
|
|
4626
|
-
/* @__PURE__ */
|
|
4642
|
+
iconOnlyLayout ? /* @__PURE__ */ jsx37("div", { className: studioSidebarCollapsedRailChipRowClass, children: /* @__PURE__ */ jsxs19(Avatar, { size: "sm", className: "size-8", children: [
|
|
4643
|
+
user.user_photo_url ? /* @__PURE__ */ jsx37(AvatarImage, { src: user.user_photo_url, alt: user.user_name }) : null,
|
|
4644
|
+
/* @__PURE__ */ jsx37(AvatarFallback, { className: "text-[10px]", children: userInitials(user.user_name, user.user_email) })
|
|
4627
4645
|
] }) }) : /* @__PURE__ */ jsxs19("div", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
4628
4646
|
/* @__PURE__ */ jsxs19(Avatar, { size: "sm", children: [
|
|
4629
|
-
user.user_photo_url ? /* @__PURE__ */
|
|
4630
|
-
/* @__PURE__ */
|
|
4647
|
+
user.user_photo_url ? /* @__PURE__ */ jsx37(AvatarImage, { src: user.user_photo_url, alt: user.user_name }) : null,
|
|
4648
|
+
/* @__PURE__ */ jsx37(AvatarFallback, { children: userInitials(user.user_name, user.user_email) })
|
|
4631
4649
|
] }),
|
|
4632
4650
|
/* @__PURE__ */ jsxs19("div", { className: "min-w-0 flex-1", children: [
|
|
4633
|
-
/* @__PURE__ */
|
|
4634
|
-
/* @__PURE__ */
|
|
4651
|
+
/* @__PURE__ */ jsx37("p", { className: "truncate text-sm font-medium text-foreground", children: user.user_name }),
|
|
4652
|
+
/* @__PURE__ */ jsx37("p", { className: "truncate text-xs text-muted-foreground", children: user.user_email })
|
|
4635
4653
|
] })
|
|
4636
4654
|
] }),
|
|
4637
|
-
/* @__PURE__ */
|
|
4655
|
+
/* @__PURE__ */ jsx37(
|
|
4638
4656
|
"div",
|
|
4639
4657
|
{
|
|
4640
4658
|
className: iconOnlyLayout ? studioSidebarCollapsedRailChipRowClass : void 0,
|
|
4641
|
-
children: /* @__PURE__ */
|
|
4659
|
+
children: /* @__PURE__ */ jsx37(StudioSidebarTooltip, { label: "Sign out", enabled: showTooltips, children: /* @__PURE__ */ jsxs19(
|
|
4642
4660
|
"button",
|
|
4643
4661
|
{
|
|
4644
4662
|
type: "button",
|
|
@@ -4649,28 +4667,28 @@ var StudioSidebarFooter = ({
|
|
|
4649
4667
|
),
|
|
4650
4668
|
"aria-label": "Sign out",
|
|
4651
4669
|
children: [
|
|
4652
|
-
/* @__PURE__ */
|
|
4670
|
+
/* @__PURE__ */ jsx37(LogOut, { className: "size-3.5 shrink-0" }),
|
|
4653
4671
|
!iconOnlyLayout ? "Sign out" : null
|
|
4654
4672
|
]
|
|
4655
4673
|
}
|
|
4656
4674
|
) })
|
|
4657
4675
|
}
|
|
4658
4676
|
)
|
|
4659
|
-
] }) : !iconOnlyLayout && emptyCaption ? /* @__PURE__ */
|
|
4677
|
+
] }) : !iconOnlyLayout && emptyCaption ? /* @__PURE__ */ jsx37("p", { className: "px-1 text-xs text-muted-foreground", children: emptyCaption }) : null
|
|
4660
4678
|
}
|
|
4661
4679
|
) });
|
|
4662
4680
|
};
|
|
4663
4681
|
|
|
4664
4682
|
// src/components/studio/sidebar-header.tsx
|
|
4665
4683
|
import { ChevronLeft, ChevronRight, X } from "lucide-react";
|
|
4666
|
-
import { jsx as
|
|
4684
|
+
import { jsx as jsx38, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4667
4685
|
var sidebarHeaderClass = "flex h-12 shrink-0 items-center px-2";
|
|
4668
4686
|
var toggleButtonClass = cn(
|
|
4669
4687
|
"flex shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors",
|
|
4670
4688
|
"hover:bg-muted hover:text-foreground",
|
|
4671
4689
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-foreground/15"
|
|
4672
4690
|
);
|
|
4673
|
-
var SidebarToggleButton = ({ ariaLabel, expanded, onClick, children }) => /* @__PURE__ */
|
|
4691
|
+
var SidebarToggleButton = ({ ariaLabel, expanded, onClick, children }) => /* @__PURE__ */ jsx38(
|
|
4674
4692
|
"button",
|
|
4675
4693
|
{
|
|
4676
4694
|
type: "button",
|
|
@@ -4684,7 +4702,7 @@ var SidebarToggleButton = ({ ariaLabel, expanded, onClick, children }) => /* @__
|
|
|
4684
4702
|
var CollapsedBrandToggle = ({
|
|
4685
4703
|
onExpand,
|
|
4686
4704
|
brand
|
|
4687
|
-
}) => /* @__PURE__ */
|
|
4705
|
+
}) => /* @__PURE__ */ jsx38("div", { className: studioSidebarCollapsedRailChipRowClass, children: /* @__PURE__ */ jsx38(StudioSidebarTooltip, { label: "Expand sidebar", enabled: true, children: /* @__PURE__ */ jsxs20(
|
|
4688
4706
|
"button",
|
|
4689
4707
|
{
|
|
4690
4708
|
type: "button",
|
|
@@ -4696,7 +4714,7 @@ var CollapsedBrandToggle = ({
|
|
|
4696
4714
|
"group relative inline-flex size-8 items-center justify-center overflow-hidden rounded-lg"
|
|
4697
4715
|
),
|
|
4698
4716
|
children: [
|
|
4699
|
-
/* @__PURE__ */
|
|
4717
|
+
/* @__PURE__ */ jsx38(
|
|
4700
4718
|
"span",
|
|
4701
4719
|
{
|
|
4702
4720
|
"aria-hidden": true,
|
|
@@ -4708,7 +4726,7 @@ var CollapsedBrandToggle = ({
|
|
|
4708
4726
|
children: brand
|
|
4709
4727
|
}
|
|
4710
4728
|
),
|
|
4711
|
-
/* @__PURE__ */
|
|
4729
|
+
/* @__PURE__ */ jsx38(
|
|
4712
4730
|
ChevronRight,
|
|
4713
4731
|
{
|
|
4714
4732
|
"aria-hidden": true,
|
|
@@ -4732,38 +4750,38 @@ var StudioSidebarHeader = ({
|
|
|
4732
4750
|
if (isMobile) {
|
|
4733
4751
|
return /* @__PURE__ */ jsxs20("header", { className: cn(sidebarHeaderClass, "justify-between gap-2 pr-2"), children: [
|
|
4734
4752
|
brand,
|
|
4735
|
-
/* @__PURE__ */
|
|
4753
|
+
/* @__PURE__ */ jsx38(
|
|
4736
4754
|
SidebarToggleButton,
|
|
4737
4755
|
{
|
|
4738
4756
|
ariaLabel: "Close menu",
|
|
4739
4757
|
expanded: mobileOpen,
|
|
4740
4758
|
onClick: onToggle,
|
|
4741
|
-
children: /* @__PURE__ */
|
|
4759
|
+
children: /* @__PURE__ */ jsx38(X, { className: "size-3.5" })
|
|
4742
4760
|
}
|
|
4743
4761
|
)
|
|
4744
4762
|
] });
|
|
4745
4763
|
}
|
|
4746
4764
|
if (isCollapsedRail) {
|
|
4747
|
-
return /* @__PURE__ */
|
|
4765
|
+
return /* @__PURE__ */ jsx38(
|
|
4748
4766
|
"header",
|
|
4749
4767
|
{
|
|
4750
4768
|
className: cn(
|
|
4751
4769
|
"flex h-12 shrink-0 items-center",
|
|
4752
4770
|
studioSidebarCollapsedRailInsetClass
|
|
4753
4771
|
),
|
|
4754
|
-
children: /* @__PURE__ */
|
|
4772
|
+
children: /* @__PURE__ */ jsx38(CollapsedBrandToggle, { onExpand: onToggle, brand })
|
|
4755
4773
|
}
|
|
4756
4774
|
);
|
|
4757
4775
|
}
|
|
4758
4776
|
return /* @__PURE__ */ jsxs20("header", { className: cn(sidebarHeaderClass, "justify-between gap-1 pr-2"), children: [
|
|
4759
4777
|
brand,
|
|
4760
|
-
/* @__PURE__ */
|
|
4778
|
+
/* @__PURE__ */ jsx38(
|
|
4761
4779
|
SidebarToggleButton,
|
|
4762
4780
|
{
|
|
4763
4781
|
ariaLabel: "Collapse sidebar",
|
|
4764
4782
|
expanded: true,
|
|
4765
4783
|
onClick: onToggle,
|
|
4766
|
-
children: /* @__PURE__ */
|
|
4784
|
+
children: /* @__PURE__ */ jsx38(ChevronLeft, { className: "size-4" })
|
|
4767
4785
|
}
|
|
4768
4786
|
)
|
|
4769
4787
|
] });
|
|
@@ -4782,7 +4800,7 @@ function workforceItemInitial(w) {
|
|
|
4782
4800
|
}
|
|
4783
4801
|
|
|
4784
4802
|
// src/components/studio/sidebar-nav.tsx
|
|
4785
|
-
import { jsx as
|
|
4803
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
4786
4804
|
var StudioSidebarNav = ({
|
|
4787
4805
|
workforces,
|
|
4788
4806
|
selectedId,
|
|
@@ -4791,7 +4809,7 @@ var StudioSidebarNav = ({
|
|
|
4791
4809
|
showTooltips
|
|
4792
4810
|
}) => {
|
|
4793
4811
|
if (workforces.length === 0) return null;
|
|
4794
|
-
return /* @__PURE__ */
|
|
4812
|
+
return /* @__PURE__ */ jsx39(
|
|
4795
4813
|
"nav",
|
|
4796
4814
|
{
|
|
4797
4815
|
className: cn(
|
|
@@ -4803,11 +4821,11 @@ var StudioSidebarNav = ({
|
|
|
4803
4821
|
const id = workforceItemId(w);
|
|
4804
4822
|
const isActive = id === selectedId;
|
|
4805
4823
|
const label = workforceItemLabel(w);
|
|
4806
|
-
return /* @__PURE__ */
|
|
4824
|
+
return /* @__PURE__ */ jsx39(
|
|
4807
4825
|
StudioSidebarEntryMotion,
|
|
4808
4826
|
{
|
|
4809
4827
|
className: iconOnlyLayout ? studioSidebarCollapsedRailChipRowClass : void 0,
|
|
4810
|
-
children: /* @__PURE__ */
|
|
4828
|
+
children: /* @__PURE__ */ jsx39(StudioSidebarTooltip, { label, enabled: showTooltips, children: /* @__PURE__ */ jsx39(
|
|
4811
4829
|
"button",
|
|
4812
4830
|
{
|
|
4813
4831
|
type: "button",
|
|
@@ -4818,7 +4836,7 @@ var StudioSidebarNav = ({
|
|
|
4818
4836
|
studioSidebarNavItemClasses(iconOnlyLayout, isActive),
|
|
4819
4837
|
iconOnlyLayout && "inline-flex"
|
|
4820
4838
|
),
|
|
4821
|
-
children: iconOnlyLayout ? /* @__PURE__ */
|
|
4839
|
+
children: iconOnlyLayout ? /* @__PURE__ */ jsx39("span", { className: "text-xs font-semibold leading-none", children: workforceItemInitial(w) }) : /* @__PURE__ */ jsx39("span", { className: "min-w-0 truncate", children: label })
|
|
4822
4840
|
}
|
|
4823
4841
|
) })
|
|
4824
4842
|
},
|
|
@@ -4831,7 +4849,7 @@ var StudioSidebarNav = ({
|
|
|
4831
4849
|
|
|
4832
4850
|
// src/components/studio/timbal-mark.tsx
|
|
4833
4851
|
import { LiquidMetal } from "@paper-design/shaders-react";
|
|
4834
|
-
import { jsx as
|
|
4852
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
4835
4853
|
var DEFAULT_SIZE = 64;
|
|
4836
4854
|
var TRANSPARENT_BACK = "#00000000";
|
|
4837
4855
|
var TIMBAL_SYMBOL_DATA_URI = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAH6ElEQVR4Aeyci7EcNRBFFxIBIgEygUiASCATyASIBOa4rFrZntmPPq1W93218o5nZyTd26dbmnX5fX3TjxyY4IDAmmCqurzdBJYomOKAwJpiqzoVWGJgigMCa4qt6lRgZWHAWKfAMjY8y3ACK0ukjXUKLGPDswwnsLJE2linwDI2PMtwAitLpI11Cixjw+/DxT4SWLHju0ydwHrP+p/euzzE1T8cKr492lsvgfWaXZj733Hp90fL9Pr1EPvn0QTWYcLoF8bS6Pdf/kjQAAnNv7RqVcW6do4q9ffxMe/HW5oXy323boF1zkvzEnDe3RZnS5X6fcRsBdbdRY6oTl1LAJ1s2NDdXaVq3QLr7kapUph8Pxv/iESiDVUqsG63sgQ0b1Rve/6QQEOrVG1DdrCGbFRrQzc5Zh9FlSKppkw5M1gYi8FTjHXaaalSJNTUKWYEC3P5spP3qeY667zsIadVqVpvNrCoUrTag+jHgIRm0z2ka7AGRpzqNG2jOnCeo7uiSi3RnQEszCVjydzRgfPaH1rRbFqlajMig0WVWmpubbThMRvzJVWq1hgVrFKlgKvWG/2YRHLxpBsNrOVLwCJySSBXT7qRwHKxBCwAiypFWzD09ZARwCpVysUScG318E+oUsv3Uleq3gPrqpd1512bO9GWsockqSYO0971zmBR/mnt6ve7k0RC87KvEV61bEewMNftEvCq8Q3XlSqF/obbbW/ZDSz2UWSs2yVgQvjQimb3VarWvgtYZCnm8uRXzz/6MXq3rM47gLXVEjCI9FKlqNCDurTtxjNYxdytloAB4aM6r65S3TK8grXtEtAZEZZ7Wmc362/3BlapUtsuAY0hDVGlau2ewApnbm30g+OyhySpHly210dewKL80/Zyr2+2JBKaQ+4hV4OFudtvVBv4KlUK/Q23+79lJVjso8jYUEvAk5CjFc0hq1StfQVYZCnm8uRXzyX6MXqbq/Nu5liDFX4JOAGgVCkq9MnHMU9ZgVXMDb8EfIYJ1TlNlaq1W4BFlcpoLss9rfY7zfFMsFSl0mD0pdBZYKXaqFa2so+iSpFU1el8hzPAwlgMzuQmeyl0k1ARdf/zrqiRYGGuq/+C9K4Zb11/v5g9JFCh/342+dEosDCWlslOljs0Z3vSfSnGvWCRpRmf+KhSGXW/BBUX9YCFuWQsmUtfGdo3h0g0q0odRjx6tYAFSFnNZXNOlX7kqT47HGgB67jtJnNv+nnkQCtYj/rUZ3LgFggsRdOTAwLLUzQCzUVgBQqmJykCy1M0As1FYAUKpicpAstTNALNRWAFCqYnKTPB8qRTczF2QGAZG55lOIGVJdLGOgWWseFZhhNYWSJtrFNgGRueZTiBlSXSM3We9C2wTkzRqX4HBFa/h+rhxAGBdWKKTvU7ILD6PVQPJw4IrBNTdKrfAYHV76F6OHFAYJ2Ysv+p9QoE1voYhJyBwAoZ1vWiBNb6GIScgcAKGdb1ogTW+hiEnIHAChnW9aIElk0M0o0isNKF3EawwLLxOd0oAitdyN8W/Ndxx9LfmnyMH/aFuX+EVXct7Lfjox+P9vZLFeu5ZcXcf59fGuYKKhRA8Xtmm0QJrGvbqFJd5l537foTKvN3xwzRf7y1vdKC9cSuUqW6zH0yhsePSaSfR0xMYH3qYvcS8Gl32/yNBPrqmC3vx1v/S2DdPRyyBNy72+aIKkUbOuEWsPg970MnsbizUqWGLAGLtbwzPNWpey91NWALWFd97Xh+qrmODSl7SJJqyjQzg0X5p00x1mmnJBKam79GeFVXRrAwd9oS8KrxC64rVQr904f3A9Z0qR8GYB9Fxk5bAj6M4usPtKJ5epWqZWcBiyzFXJ78av3Rj9G7pDpnAMt0CXBCaqlSVOglU4oMVjHXdAlYEsVPB6U6L6lS9TSigkWVWm5ubbTRMcs9zWi462GigaUqdR1r008igbVso2oasS8HYx9FlSKpvvx00ZkHYC2aUduwGIvBbXfveRd7KXSTUO4U7A4W5g79V3l3ETqfEHtIoEL/+RWLz+4MFsbSFltoOjzLHZrdP+nuCBZZmvGJjyVvG927gVWWADLXtFQsHAytVKmt9pC7gEWVwlz3S8BgANG9TZWqte8AVqlSmFzPPfoxiUSbrnPGAJ7BKkuAqtSMyE/u0ytYW21UB8aIfRRViqQa2K19Vx7BwlgMtndj3Ygs8+gmodbNYuDInsDCXH3ZOTC4K7vyAhbZSlvphfXYLHdoDrmHXA0WVWrLx+lOCnnSDa17JViYS8aSuZ1x2uZ2tKL5cZXaRs71RFeARZVKYe5ntrMxD12lar3WYJUqBVz1PKIfk0ipnnStwEqzBHyWISRQxifdmwVYqZaACiyqFK06ledwJlilSqVaAg50qFJp9lKH3tPXLLCymlv2kCTVqeFZTs4Ai/JPC+ThUykkEprDf43w1ImPF4wEC3MzLgGlSqH/o616GwUW+ygyNtMSgFY0q0qd5FEvWGQp5vLkd9J92FPozVidXw5oD1hZlwASiQr9sskZL2wBK+sSgO6UX3a2JEYrWCyBLePtfA/L387zN517C1imE7wYTKedOyCwnAdo1+kJrF0j53zeAst5gHadnsDaNXLO5y2wnAdo1+kJrF0j53zew8ByrlPTM3ZAYBkbnmU4gZUl0sY6BZax4VmGE1hZIm2sU2AZG55lOIGVJdLDdL7W0f8AAAD//x3VUCQAAAAGSURBVAMArsj7LTb9pqMAAAAASUVORK5CYII=";
|
|
@@ -4840,14 +4858,14 @@ function TimbalMark({
|
|
|
4840
4858
|
size = DEFAULT_SIZE,
|
|
4841
4859
|
src = TIMBAL_SYMBOL_DATA_URI
|
|
4842
4860
|
}) {
|
|
4843
|
-
return /* @__PURE__ */
|
|
4861
|
+
return /* @__PURE__ */ jsx40(
|
|
4844
4862
|
"div",
|
|
4845
4863
|
{
|
|
4846
4864
|
className: cn("relative shrink-0 bg-transparent", className),
|
|
4847
4865
|
style: { width: size, height: size },
|
|
4848
4866
|
role: "img",
|
|
4849
4867
|
"aria-label": "Timbal",
|
|
4850
|
-
children: /* @__PURE__ */
|
|
4868
|
+
children: /* @__PURE__ */ jsx40(
|
|
4851
4869
|
LiquidMetal,
|
|
4852
4870
|
{
|
|
4853
4871
|
width: size,
|
|
@@ -4879,7 +4897,7 @@ function TimbalMark({
|
|
|
4879
4897
|
}
|
|
4880
4898
|
|
|
4881
4899
|
// src/components/studio/sidebar.tsx
|
|
4882
|
-
import { jsx as
|
|
4900
|
+
import { jsx as jsx41, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4883
4901
|
var DEFAULT_BREAKPOINT_PX = 768;
|
|
4884
4902
|
function readPersistedCollapsed(key) {
|
|
4885
4903
|
if (!key || typeof window === "undefined") return false;
|
|
@@ -4929,7 +4947,7 @@ var StudioSidebarPanel = ({
|
|
|
4929
4947
|
onCollapsedChange(!collapsed);
|
|
4930
4948
|
};
|
|
4931
4949
|
const panelWidthPx = isMobile ? SIDEBAR_MOBILE_PX : widthCollapsed ? SIDEBAR_WIDTH_COLLAPSED_PX : SIDEBAR_WIDTH_PX;
|
|
4932
|
-
const brandNode = brand ?? /* @__PURE__ */
|
|
4950
|
+
const brandNode = brand ?? /* @__PURE__ */ jsx41(TimbalMark, { size: 32 });
|
|
4933
4951
|
const panel = /* @__PURE__ */ jsxs21(
|
|
4934
4952
|
motion8.div,
|
|
4935
4953
|
{
|
|
@@ -4945,7 +4963,7 @@ var StudioSidebarPanel = ({
|
|
|
4945
4963
|
style: { willChange: entriesVisible ? void 0 : "width" },
|
|
4946
4964
|
onAnimationComplete: isMobile || entriesVisible ? void 0 : () => onPanelWidthComplete(),
|
|
4947
4965
|
children: [
|
|
4948
|
-
/* @__PURE__ */
|
|
4966
|
+
/* @__PURE__ */ jsx41(
|
|
4949
4967
|
StudioSidebarHeader,
|
|
4950
4968
|
{
|
|
4951
4969
|
isCollapsedRail,
|
|
@@ -4961,7 +4979,7 @@ var StudioSidebarPanel = ({
|
|
|
4961
4979
|
visible: entriesVisible,
|
|
4962
4980
|
onBlurOutComplete: onEntriesBlurOutComplete,
|
|
4963
4981
|
children: [
|
|
4964
|
-
/* @__PURE__ */
|
|
4982
|
+
/* @__PURE__ */ jsx41(
|
|
4965
4983
|
"div",
|
|
4966
4984
|
{
|
|
4967
4985
|
id: DOM_IDS.sidebarRuntimeAnchor,
|
|
@@ -4971,7 +4989,7 @@ var StudioSidebarPanel = ({
|
|
|
4971
4989
|
)
|
|
4972
4990
|
}
|
|
4973
4991
|
),
|
|
4974
|
-
/* @__PURE__ */
|
|
4992
|
+
/* @__PURE__ */ jsx41(
|
|
4975
4993
|
StudioSidebarNav,
|
|
4976
4994
|
{
|
|
4977
4995
|
workforces,
|
|
@@ -4981,8 +4999,8 @@ var StudioSidebarPanel = ({
|
|
|
4981
4999
|
showTooltips: isCollapsedRail
|
|
4982
5000
|
}
|
|
4983
5001
|
),
|
|
4984
|
-
workforces.length === 0 ? /* @__PURE__ */
|
|
4985
|
-
/* @__PURE__ */
|
|
5002
|
+
workforces.length === 0 ? /* @__PURE__ */ jsx41("div", { className: "min-h-0 flex-1" }) : null,
|
|
5003
|
+
/* @__PURE__ */ jsx41(
|
|
4986
5004
|
StudioSidebarFooter,
|
|
4987
5005
|
{
|
|
4988
5006
|
iconOnlyLayout,
|
|
@@ -4998,7 +5016,7 @@ var StudioSidebarPanel = ({
|
|
|
4998
5016
|
}
|
|
4999
5017
|
);
|
|
5000
5018
|
if (isMobile) {
|
|
5001
|
-
return /* @__PURE__ */
|
|
5019
|
+
return /* @__PURE__ */ jsx41(
|
|
5002
5020
|
motion8.aside,
|
|
5003
5021
|
{
|
|
5004
5022
|
className: "fixed inset-y-0 left-0 z-[60] flex",
|
|
@@ -5014,7 +5032,7 @@ var StudioSidebarPanel = ({
|
|
|
5014
5032
|
}
|
|
5015
5033
|
);
|
|
5016
5034
|
}
|
|
5017
|
-
return /* @__PURE__ */
|
|
5035
|
+
return /* @__PURE__ */ jsx41(
|
|
5018
5036
|
"aside",
|
|
5019
5037
|
{
|
|
5020
5038
|
className: "absolute inset-y-0 left-0 z-[60] flex py-[var(--studio-sidebar-gap)] pl-[var(--studio-sidebar-gap)]",
|
|
@@ -5105,7 +5123,7 @@ var StudioSidebar = ({
|
|
|
5105
5123
|
}),
|
|
5106
5124
|
[effectiveCollapsed, isMobile, isCollapsedRail, iconOnlyLayout]
|
|
5107
5125
|
);
|
|
5108
|
-
return /* @__PURE__ */
|
|
5126
|
+
return /* @__PURE__ */ jsx41(StudioSidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx41(
|
|
5109
5127
|
StudioSidebarPanel,
|
|
5110
5128
|
{
|
|
5111
5129
|
workforces,
|
|
@@ -5131,7 +5149,7 @@ import { useCallback as useCallback7, useLayoutEffect, useState as useState12 }
|
|
|
5131
5149
|
import { createPortal } from "react-dom";
|
|
5132
5150
|
import { MessageSquarePlus } from "lucide-react";
|
|
5133
5151
|
import { useThread as useThread2 } from "@assistant-ui/react";
|
|
5134
|
-
import { jsx as
|
|
5152
|
+
import { jsx as jsx42, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5135
5153
|
var StudioSidebarRuntimePortal = ({
|
|
5136
5154
|
label = "New chat"
|
|
5137
5155
|
}) => {
|
|
@@ -5154,15 +5172,15 @@ var StudioSidebarRuntimePortal = ({
|
|
|
5154
5172
|
"aria-label": label,
|
|
5155
5173
|
className: studioSidebarNavItemClasses(iconOnlyLayout, false),
|
|
5156
5174
|
children: [
|
|
5157
|
-
/* @__PURE__ */
|
|
5158
|
-
!iconOnlyLayout ? /* @__PURE__ */
|
|
5175
|
+
/* @__PURE__ */ jsx42(MessageSquarePlus, { className: "size-3.5 shrink-0" }),
|
|
5176
|
+
!iconOnlyLayout ? /* @__PURE__ */ jsx42("span", { className: "min-w-0 truncate", children: label }) : null
|
|
5159
5177
|
]
|
|
5160
5178
|
}
|
|
5161
5179
|
);
|
|
5162
5180
|
return createPortal(
|
|
5163
5181
|
iconOnlyLayout ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
5164
|
-
/* @__PURE__ */
|
|
5165
|
-
/* @__PURE__ */
|
|
5182
|
+
/* @__PURE__ */ jsx42(TooltipTrigger, { asChild: true, children: button }),
|
|
5183
|
+
/* @__PURE__ */ jsx42(TooltipContent, { side: "right", className: "text-xs", children: label })
|
|
5166
5184
|
] }) : button,
|
|
5167
5185
|
anchor
|
|
5168
5186
|
);
|
|
@@ -5171,7 +5189,7 @@ var StudioSidebarRuntimePortal = ({
|
|
|
5171
5189
|
// src/components/studio/welcome.tsx
|
|
5172
5190
|
import { motion as motion9 } from "motion/react";
|
|
5173
5191
|
import { useThread as useThread3 } from "@assistant-ui/react";
|
|
5174
|
-
import { jsx as
|
|
5192
|
+
import { jsx as jsx43, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5175
5193
|
var luxuryEase2 = [0.16, 1, 0.3, 1];
|
|
5176
5194
|
var welcomeStagger2 = {
|
|
5177
5195
|
initial: {},
|
|
@@ -5199,14 +5217,14 @@ var welcomeIcon2 = {
|
|
|
5199
5217
|
var StudioWelcome = ({ config, icon }) => {
|
|
5200
5218
|
const isEmpty = useThread3((s) => s.messages.length === 0);
|
|
5201
5219
|
if (!isEmpty) return null;
|
|
5202
|
-
const iconNode = icon ?? /* @__PURE__ */
|
|
5220
|
+
const iconNode = icon ?? /* @__PURE__ */ jsx43(
|
|
5203
5221
|
TimbalMark,
|
|
5204
5222
|
{
|
|
5205
5223
|
size: 112,
|
|
5206
5224
|
className: "max-md:scale-[0.58] max-md:origin-center"
|
|
5207
5225
|
}
|
|
5208
5226
|
);
|
|
5209
|
-
return /* @__PURE__ */
|
|
5227
|
+
return /* @__PURE__ */ jsx43("div", { className: "aui-thread-welcome-root mx-auto my-auto flex w-full max-w-(--thread-max-width) grow flex-col", children: /* @__PURE__ */ jsx43("div", { className: "aui-thread-welcome-center flex w-full grow flex-col items-center justify-center", children: /* @__PURE__ */ jsxs23(
|
|
5210
5228
|
motion9.div,
|
|
5211
5229
|
{
|
|
5212
5230
|
className: "aui-thread-welcome-message flex flex-col items-center justify-center px-2 text-center sm:px-4",
|
|
@@ -5214,8 +5232,8 @@ var StudioWelcome = ({ config, icon }) => {
|
|
|
5214
5232
|
initial: "initial",
|
|
5215
5233
|
animate: "animate",
|
|
5216
5234
|
children: [
|
|
5217
|
-
/* @__PURE__ */
|
|
5218
|
-
/* @__PURE__ */
|
|
5235
|
+
/* @__PURE__ */ jsx43(motion9.div, { variants: welcomeIcon2, className: "mb-4 md:mb-5", children: iconNode }),
|
|
5236
|
+
/* @__PURE__ */ jsx43(
|
|
5219
5237
|
motion9.h1,
|
|
5220
5238
|
{
|
|
5221
5239
|
variants: welcomeItem2,
|
|
@@ -5223,7 +5241,7 @@ var StudioWelcome = ({ config, icon }) => {
|
|
|
5223
5241
|
children: config?.heading ?? "How can I help you today?"
|
|
5224
5242
|
}
|
|
5225
5243
|
),
|
|
5226
|
-
/* @__PURE__ */
|
|
5244
|
+
/* @__PURE__ */ jsx43(
|
|
5227
5245
|
motion9.p,
|
|
5228
5246
|
{
|
|
5229
5247
|
variants: welcomeItem2,
|
|
@@ -5237,7 +5255,7 @@ var StudioWelcome = ({ config, icon }) => {
|
|
|
5237
5255
|
};
|
|
5238
5256
|
|
|
5239
5257
|
// src/components/studio/studio-shell.tsx
|
|
5240
|
-
import { Fragment as Fragment4, jsx as
|
|
5258
|
+
import { Fragment as Fragment4, jsx as jsx44, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5241
5259
|
import { createElement } from "react";
|
|
5242
5260
|
var DEFAULT_BREAKPOINT_PX2 = 768;
|
|
5243
5261
|
function readPersistedCollapsed2(key) {
|
|
@@ -5259,8 +5277,8 @@ function makeComposerWithPortal(BaseComposer) {
|
|
|
5259
5277
|
const Resolved = BaseComposer ?? Composer;
|
|
5260
5278
|
return function StudioComposerWithSidebar(props) {
|
|
5261
5279
|
return /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
5262
|
-
/* @__PURE__ */
|
|
5263
|
-
/* @__PURE__ */
|
|
5280
|
+
/* @__PURE__ */ jsx44(StudioSidebarRuntimePortal, {}),
|
|
5281
|
+
/* @__PURE__ */ jsx44(Resolved, { ...props })
|
|
5264
5282
|
] });
|
|
5265
5283
|
};
|
|
5266
5284
|
}
|
|
@@ -5369,7 +5387,7 @@ var TimbalStudioShell = ({
|
|
|
5369
5387
|
next.Composer = makeComposerWithPortal(components?.Composer);
|
|
5370
5388
|
return next;
|
|
5371
5389
|
}, [components]);
|
|
5372
|
-
return /* @__PURE__ */
|
|
5390
|
+
return /* @__PURE__ */ jsx44(StudioSidebarContext.Provider, { value: sidebarContext, children: /* @__PURE__ */ jsxs24(
|
|
5373
5391
|
"div",
|
|
5374
5392
|
{
|
|
5375
5393
|
className: cn(
|
|
@@ -5378,14 +5396,14 @@ var TimbalStudioShell = ({
|
|
|
5378
5396
|
),
|
|
5379
5397
|
style: studioChromeShellStyle,
|
|
5380
5398
|
children: [
|
|
5381
|
-
/* @__PURE__ */
|
|
5399
|
+
/* @__PURE__ */ jsx44(
|
|
5382
5400
|
"div",
|
|
5383
5401
|
{
|
|
5384
5402
|
className: "pointer-events-none absolute inset-0 z-0 bg-background",
|
|
5385
5403
|
"aria-hidden": true
|
|
5386
5404
|
}
|
|
5387
5405
|
),
|
|
5388
|
-
/* @__PURE__ */
|
|
5406
|
+
/* @__PURE__ */ jsx44(
|
|
5389
5407
|
"div",
|
|
5390
5408
|
{
|
|
5391
5409
|
className: cn(
|
|
@@ -5395,14 +5413,14 @@ var TimbalStudioShell = ({
|
|
|
5395
5413
|
"aria-hidden": true
|
|
5396
5414
|
}
|
|
5397
5415
|
),
|
|
5398
|
-
/* @__PURE__ */
|
|
5416
|
+
/* @__PURE__ */ jsx44(
|
|
5399
5417
|
StudioSidebarBackdrop,
|
|
5400
5418
|
{
|
|
5401
5419
|
open: isMobile && mobileSidebarOpen,
|
|
5402
5420
|
onClose: () => setMobileSidebarOpen(false)
|
|
5403
5421
|
}
|
|
5404
5422
|
),
|
|
5405
|
-
/* @__PURE__ */
|
|
5423
|
+
/* @__PURE__ */ jsx44(
|
|
5406
5424
|
StudioSidebarPanel,
|
|
5407
5425
|
{
|
|
5408
5426
|
workforces,
|
|
@@ -5441,7 +5459,7 @@ var TimbalStudioShell = ({
|
|
|
5441
5459
|
studioTopbarPillHeightClass
|
|
5442
5460
|
),
|
|
5443
5461
|
children: [
|
|
5444
|
-
isMobile && !mobileSidebarOpen ? /* @__PURE__ */
|
|
5462
|
+
isMobile && !mobileSidebarOpen ? /* @__PURE__ */ jsx44(
|
|
5445
5463
|
TimbalV2Button,
|
|
5446
5464
|
{
|
|
5447
5465
|
variant: "secondary",
|
|
@@ -5451,18 +5469,18 @@ var TimbalStudioShell = ({
|
|
|
5451
5469
|
onClick: () => setMobileSidebarOpen(true),
|
|
5452
5470
|
"aria-label": "Open menu",
|
|
5453
5471
|
"aria-expanded": false,
|
|
5454
|
-
children: /* @__PURE__ */
|
|
5472
|
+
children: /* @__PURE__ */ jsx44(Menu, { className: "size-4" })
|
|
5455
5473
|
}
|
|
5456
5474
|
) : null,
|
|
5457
5475
|
headerStart
|
|
5458
5476
|
]
|
|
5459
5477
|
}
|
|
5460
5478
|
),
|
|
5461
|
-
headerActions ? /* @__PURE__ */
|
|
5479
|
+
headerActions ? /* @__PURE__ */ jsx44("div", { className: "flex shrink-0 items-center gap-1", children: headerActions }) : null
|
|
5462
5480
|
]
|
|
5463
5481
|
}
|
|
5464
5482
|
),
|
|
5465
|
-
/* @__PURE__ */
|
|
5483
|
+
/* @__PURE__ */ jsx44(
|
|
5466
5484
|
motion10.main,
|
|
5467
5485
|
{
|
|
5468
5486
|
className: cn(
|
|
@@ -5494,7 +5512,7 @@ var TimbalStudioShell = ({
|
|
|
5494
5512
|
// src/components/studio/mode-toggle.tsx
|
|
5495
5513
|
import { useCallback as useCallback9, useEffect as useEffect11, useState as useState14 } from "react";
|
|
5496
5514
|
import { Moon, Sun } from "lucide-react";
|
|
5497
|
-
import { jsx as
|
|
5515
|
+
import { jsx as jsx45, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5498
5516
|
var ModeToggle = ({
|
|
5499
5517
|
theme,
|
|
5500
5518
|
setTheme,
|
|
@@ -5535,9 +5553,9 @@ var ModeToggle = ({
|
|
|
5535
5553
|
"aria-label": label,
|
|
5536
5554
|
title: label,
|
|
5537
5555
|
children: [
|
|
5538
|
-
/* @__PURE__ */
|
|
5539
|
-
/* @__PURE__ */
|
|
5540
|
-
/* @__PURE__ */
|
|
5556
|
+
/* @__PURE__ */ jsx45(Sun, { className: "size-3.5 scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" }),
|
|
5557
|
+
/* @__PURE__ */ jsx45(Moon, { className: "absolute size-3.5 scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0" }),
|
|
5558
|
+
/* @__PURE__ */ jsx45("span", { className: "sr-only", children: label })
|
|
5541
5559
|
]
|
|
5542
5560
|
}
|
|
5543
5561
|
);
|
|
@@ -5671,7 +5689,7 @@ When you call a tool that returns an artifact (\`make_chart\`, \`ask_question\`,
|
|
|
5671
5689
|
|
|
5672
5690
|
// src/auth/guard.tsx
|
|
5673
5691
|
import { Loader2 } from "lucide-react";
|
|
5674
|
-
import { jsx as
|
|
5692
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
5675
5693
|
var AuthGuard = ({
|
|
5676
5694
|
children,
|
|
5677
5695
|
requireAuth = false,
|
|
@@ -5682,7 +5700,7 @@ var AuthGuard = ({
|
|
|
5682
5700
|
return children;
|
|
5683
5701
|
}
|
|
5684
5702
|
if (loading) {
|
|
5685
|
-
return /* @__PURE__ */
|
|
5703
|
+
return /* @__PURE__ */ jsx46("div", { className: "flex items-center justify-center h-screen", children: /* @__PURE__ */ jsx46(Loader2, { className: "w-8 h-8 animate-spin" }) });
|
|
5686
5704
|
}
|
|
5687
5705
|
if (requireAuth && !isAuthenticated && !isEmbedded) {
|
|
5688
5706
|
const returnTo = encodeURIComponent(
|