@lukeashford/aurelius 2.16.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +64 -13
- package/dist/index.d.ts +64 -13
- package/dist/index.js +679 -610
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +648 -581
- package/dist/index.mjs.map +1 -1
- package/dist/styles/theme.css +5 -0
- package/llms.md +23 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -36,6 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
AccordionTrigger: () => AccordionTrigger,
|
|
37
37
|
Alert: () => Alert,
|
|
38
38
|
AlertDialog: () => AlertDialog,
|
|
39
|
+
ArtifactCard: () => ArtifactCard,
|
|
39
40
|
ArtifactsPanel: () => ArtifactsPanel,
|
|
40
41
|
ArtifactsPanelToggle: () => ArtifactsPanelToggle,
|
|
41
42
|
AttachmentPreview: () => AttachmentPreview,
|
|
@@ -132,6 +133,7 @@ __export(index_exports, {
|
|
|
132
133
|
TableHeader: () => TableHeader,
|
|
133
134
|
TableRow: () => TableRow,
|
|
134
135
|
Tabs: () => Tabs,
|
|
136
|
+
TextCard: () => TextCard,
|
|
135
137
|
Textarea: () => Textarea,
|
|
136
138
|
ThinkingIndicator: () => ThinkingIndicator,
|
|
137
139
|
ToastProvider: () => ToastProvider,
|
|
@@ -249,9 +251,28 @@ var Input = import_react2.default.forwardRef(
|
|
|
249
251
|
Input.displayName = "Input";
|
|
250
252
|
|
|
251
253
|
// src/components/Card.tsx
|
|
252
|
-
var
|
|
253
|
-
var import_react_player = __toESM(require("react-player"));
|
|
254
|
+
var import_react4 = __toESM(require("react"));
|
|
254
255
|
var import_lucide_react = require("lucide-react");
|
|
256
|
+
|
|
257
|
+
// src/components/Skeleton.tsx
|
|
258
|
+
var import_react3 = __toESM(require("react"));
|
|
259
|
+
var Skeleton = import_react3.default.forwardRef(
|
|
260
|
+
({ className, ...rest }, ref) => {
|
|
261
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
262
|
+
"div",
|
|
263
|
+
{
|
|
264
|
+
ref,
|
|
265
|
+
className: cx("animate-pulse bg-ash", className),
|
|
266
|
+
...rest
|
|
267
|
+
}
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
Skeleton.displayName = "Skeleton";
|
|
272
|
+
|
|
273
|
+
// src/components/Card.tsx
|
|
274
|
+
var CardContext = (0, import_react4.createContext)({ isLoading: false });
|
|
275
|
+
var useCardContext = () => (0, import_react4.useContext)(CardContext);
|
|
255
276
|
var VARIANT_STYLES = {
|
|
256
277
|
default: "bg-charcoal shadow-sm border border-gold/30",
|
|
257
278
|
elevated: "bg-charcoal shadow-lg border-0",
|
|
@@ -259,22 +280,23 @@ var VARIANT_STYLES = {
|
|
|
259
280
|
ghost: "bg-transparent shadow-none border-0",
|
|
260
281
|
featured: "bg-charcoal border border-gold glow-sm"
|
|
261
282
|
};
|
|
262
|
-
var CardBase =
|
|
283
|
+
var CardBase = import_react4.default.forwardRef(
|
|
263
284
|
({
|
|
264
285
|
variant = "default",
|
|
265
286
|
interactive = false,
|
|
266
287
|
selected = false,
|
|
267
288
|
noPadding = false,
|
|
289
|
+
isLoading = false,
|
|
268
290
|
className,
|
|
269
291
|
children,
|
|
270
292
|
...props
|
|
271
293
|
}, ref) => {
|
|
272
|
-
return /* @__PURE__ */
|
|
294
|
+
return /* @__PURE__ */ import_react4.default.createElement(CardContext.Provider, { value: { isLoading } }, /* @__PURE__ */ import_react4.default.createElement(
|
|
273
295
|
"div",
|
|
274
296
|
{
|
|
275
297
|
ref,
|
|
276
298
|
className: cx(
|
|
277
|
-
"rounded-none relative",
|
|
299
|
+
"rounded-none relative transition-opacity duration-500",
|
|
278
300
|
!noPadding && "p-6",
|
|
279
301
|
VARIANT_STYLES[variant],
|
|
280
302
|
interactive && "transition-all duration-200 hover:border-gold hover:shadow-glow cursor-pointer",
|
|
@@ -284,38 +306,47 @@ var CardBase = import_react3.default.forwardRef(
|
|
|
284
306
|
...props
|
|
285
307
|
},
|
|
286
308
|
children,
|
|
287
|
-
selected && /* @__PURE__ */
|
|
309
|
+
selected && /* @__PURE__ */ import_react4.default.createElement(
|
|
288
310
|
"div",
|
|
289
311
|
{
|
|
290
312
|
className: "absolute top-3 right-3 flex items-center justify-center h-6 w-6 rounded-full bg-gold text-obsidian"
|
|
291
313
|
},
|
|
292
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ import_react4.default.createElement(import_lucide_react.Check, { className: "h-4 w-4" })
|
|
293
315
|
)
|
|
294
|
-
);
|
|
316
|
+
));
|
|
295
317
|
}
|
|
296
318
|
);
|
|
297
319
|
CardBase.displayName = "Card";
|
|
298
|
-
var CardHeader =
|
|
320
|
+
var CardHeader = import_react4.default.forwardRef(
|
|
299
321
|
({ title, subtitle, action, className, children, ...props }, ref) => {
|
|
300
|
-
|
|
322
|
+
const { isLoading } = useCardContext();
|
|
323
|
+
const hasContent = title || subtitle || action || children;
|
|
324
|
+
if (!hasContent && !isLoading) {
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
|
301
328
|
"div",
|
|
302
329
|
{
|
|
303
330
|
ref,
|
|
304
331
|
className: cx("px-6 py-4 border-b border-ash", className),
|
|
305
332
|
...props
|
|
306
333
|
},
|
|
307
|
-
title || subtitle || action ? /* @__PURE__ */
|
|
334
|
+
isLoading && !title && !subtitle ? /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex flex-col gap-2" }, /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "h-5 w-3/4" }), /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "h-4 w-1/2" })) : title || subtitle || action ? /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex items-start justify-between gap-4" }, /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex-1 min-w-0" }, title ? /* @__PURE__ */ import_react4.default.createElement("h3", { className: "text-lg font-semibold text-white m-0" }, title) : isLoading ? /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "h-5 w-3/4 mb-1" }) : null, subtitle ? /* @__PURE__ */ import_react4.default.createElement("p", { className: "text-sm text-silver mt-1 m-0" }, subtitle) : isLoading ? /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "h-4 w-1/2 mt-1" }) : null), action && /* @__PURE__ */ import_react4.default.createElement("div", { className: "shrink-0" }, action)) : children
|
|
308
335
|
);
|
|
309
336
|
}
|
|
310
337
|
);
|
|
311
338
|
CardHeader.displayName = "CardHeader";
|
|
312
|
-
var CardBody =
|
|
339
|
+
var CardBody = import_react4.default.forwardRef(
|
|
313
340
|
({ className, children, ...props }, ref) => {
|
|
314
|
-
|
|
341
|
+
const { isLoading } = useCardContext();
|
|
342
|
+
if (!children && !isLoading) {
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
return /* @__PURE__ */ import_react4.default.createElement("div", { ref, className: cx("px-6 py-4", className), ...props }, isLoading && !children ? /* @__PURE__ */ import_react4.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "h-4 w-full" }), /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "h-4 w-full" }), /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "h-4 w-3/4" })) : children);
|
|
315
346
|
}
|
|
316
347
|
);
|
|
317
348
|
CardBody.displayName = "CardBody";
|
|
318
|
-
var CardFooter =
|
|
349
|
+
var CardFooter = import_react4.default.forwardRef(
|
|
319
350
|
({ align = "end", className, children, ...props }, ref) => {
|
|
320
351
|
const alignClass = {
|
|
321
352
|
start: "justify-start",
|
|
@@ -323,7 +354,7 @@ var CardFooter = import_react3.default.forwardRef(
|
|
|
323
354
|
end: "justify-end",
|
|
324
355
|
between: "justify-between"
|
|
325
356
|
}[align];
|
|
326
|
-
return /* @__PURE__ */
|
|
357
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
|
327
358
|
"div",
|
|
328
359
|
{
|
|
329
360
|
ref,
|
|
@@ -339,23 +370,24 @@ var CardFooter = import_react3.default.forwardRef(
|
|
|
339
370
|
}
|
|
340
371
|
);
|
|
341
372
|
CardFooter.displayName = "CardFooter";
|
|
342
|
-
var CardMedia =
|
|
373
|
+
var CardMedia = import_react4.default.forwardRef(
|
|
343
374
|
({
|
|
344
|
-
|
|
345
|
-
alt = "",
|
|
346
|
-
aspect = "video",
|
|
375
|
+
aspect,
|
|
347
376
|
position = "top",
|
|
348
|
-
isVideo = false,
|
|
349
377
|
className,
|
|
350
378
|
children,
|
|
351
379
|
...props
|
|
352
380
|
}, ref) => {
|
|
353
|
-
const
|
|
381
|
+
const { isLoading } = useCardContext();
|
|
382
|
+
const aspectClass = aspect && aspect !== "none" ? {
|
|
354
383
|
video: "aspect-video",
|
|
355
384
|
square: "aspect-square",
|
|
356
385
|
wide: "aspect-wide"
|
|
357
|
-
}[aspect];
|
|
358
|
-
|
|
386
|
+
}[aspect] : "";
|
|
387
|
+
if (!children && !isLoading) {
|
|
388
|
+
return null;
|
|
389
|
+
}
|
|
390
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
|
359
391
|
"div",
|
|
360
392
|
{
|
|
361
393
|
ref,
|
|
@@ -368,16 +400,7 @@ var CardMedia = import_react3.default.forwardRef(
|
|
|
368
400
|
),
|
|
369
401
|
...props
|
|
370
402
|
},
|
|
371
|
-
|
|
372
|
-
import_react_player.default,
|
|
373
|
-
{
|
|
374
|
-
src,
|
|
375
|
-
width: "100%",
|
|
376
|
-
height: "100%",
|
|
377
|
-
className: "absolute top-0 left-0",
|
|
378
|
-
controls: true
|
|
379
|
-
}
|
|
380
|
-
) : /* @__PURE__ */ import_react3.default.createElement("img", { src, alt, className: "w-full h-full object-cover" }) : children
|
|
403
|
+
isLoading && !children ? /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "w-full h-full" }) : children
|
|
381
404
|
);
|
|
382
405
|
}
|
|
383
406
|
);
|
|
@@ -390,7 +413,7 @@ var Card = Object.assign(CardBase, {
|
|
|
390
413
|
});
|
|
391
414
|
|
|
392
415
|
// src/components/Container.tsx
|
|
393
|
-
var
|
|
416
|
+
var import_react5 = __toESM(require("react"));
|
|
394
417
|
var SIZE_CLASSES = {
|
|
395
418
|
sm: "container-sm",
|
|
396
419
|
md: "container-md",
|
|
@@ -399,15 +422,15 @@ var SIZE_CLASSES = {
|
|
|
399
422
|
fluid: "container-fluid",
|
|
400
423
|
responsive: "container"
|
|
401
424
|
};
|
|
402
|
-
var Container =
|
|
425
|
+
var Container = import_react5.default.forwardRef(
|
|
403
426
|
({ size = "responsive", className, children, ...props }, ref) => {
|
|
404
|
-
return /* @__PURE__ */
|
|
427
|
+
return /* @__PURE__ */ import_react5.default.createElement("div", { ref, className: cx(SIZE_CLASSES[size], className), ...props }, children);
|
|
405
428
|
}
|
|
406
429
|
);
|
|
407
430
|
Container.displayName = "Container";
|
|
408
431
|
|
|
409
432
|
// src/components/Row.tsx
|
|
410
|
-
var
|
|
433
|
+
var import_react6 = __toESM(require("react"));
|
|
411
434
|
var JUSTIFY_MAP = {
|
|
412
435
|
start: "justify-start",
|
|
413
436
|
center: "justify-center",
|
|
@@ -459,12 +482,12 @@ var GAP_Y_MAP = {
|
|
|
459
482
|
10: "gap-y-10",
|
|
460
483
|
12: "gap-y-12"
|
|
461
484
|
};
|
|
462
|
-
var Row =
|
|
485
|
+
var Row = import_react6.default.forwardRef(
|
|
463
486
|
({ gutter = 4, gutterX, gutterY, justify, align, className, children, ...props }, ref) => {
|
|
464
487
|
const gapClass = gutterX === void 0 && gutterY === void 0 ? GAP_MAP[gutter] : "";
|
|
465
488
|
const gapXClass = gutterX !== void 0 ? GAP_X_MAP[gutterX] : "";
|
|
466
489
|
const gapYClass = gutterY !== void 0 ? GAP_Y_MAP[gutterY] : "";
|
|
467
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
468
491
|
"div",
|
|
469
492
|
{
|
|
470
493
|
ref,
|
|
@@ -486,7 +509,7 @@ var Row = import_react5.default.forwardRef(
|
|
|
486
509
|
Row.displayName = "Row";
|
|
487
510
|
|
|
488
511
|
// src/components/Col.tsx
|
|
489
|
-
var
|
|
512
|
+
var import_react7 = __toESM(require("react"));
|
|
490
513
|
var SPAN_CLASS_MAP = {
|
|
491
514
|
base: {
|
|
492
515
|
1: "col-span-1",
|
|
@@ -797,14 +820,14 @@ function buildResponsiveClasses(value, classMap) {
|
|
|
797
820
|
}
|
|
798
821
|
return classes;
|
|
799
822
|
}
|
|
800
|
-
var Col =
|
|
823
|
+
var Col = import_react7.default.forwardRef(
|
|
801
824
|
({ span, offset, order, className, children, ...props }, ref) => {
|
|
802
825
|
const spanClasses = buildResponsiveClasses(span, SPAN_CLASS_MAP);
|
|
803
826
|
const offsetClasses = buildResponsiveClasses(offset, OFFSET_CLASS_MAP);
|
|
804
827
|
const orderClasses = buildResponsiveClasses(order, ORDER_CLASS_MAP);
|
|
805
828
|
const hasSpan = span !== void 0;
|
|
806
829
|
const defaultSpan = hasSpan ? "" : "col-span-12";
|
|
807
|
-
return /* @__PURE__ */
|
|
830
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
808
831
|
"div",
|
|
809
832
|
{
|
|
810
833
|
ref,
|
|
@@ -824,7 +847,7 @@ var Col = import_react6.default.forwardRef(
|
|
|
824
847
|
Col.displayName = "Col";
|
|
825
848
|
|
|
826
849
|
// src/components/Stack.tsx
|
|
827
|
-
var
|
|
850
|
+
var import_react8 = __toESM(require("react"));
|
|
828
851
|
var ALIGN_MAP2 = {
|
|
829
852
|
start: "items-start",
|
|
830
853
|
center: "items-center",
|
|
@@ -852,7 +875,7 @@ var GAP_MAP2 = {
|
|
|
852
875
|
10: "gap-10",
|
|
853
876
|
12: "gap-12"
|
|
854
877
|
};
|
|
855
|
-
var Stack =
|
|
878
|
+
var Stack = import_react8.default.forwardRef(
|
|
856
879
|
({
|
|
857
880
|
direction = "vertical",
|
|
858
881
|
align,
|
|
@@ -864,7 +887,7 @@ var Stack = import_react7.default.forwardRef(
|
|
|
864
887
|
children,
|
|
865
888
|
...props
|
|
866
889
|
}, ref) => {
|
|
867
|
-
return /* @__PURE__ */
|
|
890
|
+
return /* @__PURE__ */ import_react8.default.createElement(
|
|
868
891
|
Component,
|
|
869
892
|
{
|
|
870
893
|
ref,
|
|
@@ -886,7 +909,7 @@ var Stack = import_react7.default.forwardRef(
|
|
|
886
909
|
Stack.displayName = "Stack";
|
|
887
910
|
|
|
888
911
|
// src/components/Divider.tsx
|
|
889
|
-
var
|
|
912
|
+
var import_react9 = __toESM(require("react"));
|
|
890
913
|
var COLOR_MAP = {
|
|
891
914
|
default: "border-ash",
|
|
892
915
|
gold: "border-gold/50",
|
|
@@ -897,7 +920,7 @@ var VARIANT_MAP = {
|
|
|
897
920
|
dashed: "border-dashed",
|
|
898
921
|
dotted: "border-dotted"
|
|
899
922
|
};
|
|
900
|
-
var Divider =
|
|
923
|
+
var Divider = import_react9.default.forwardRef(
|
|
901
924
|
({
|
|
902
925
|
orientation = "horizontal",
|
|
903
926
|
variant = "solid",
|
|
@@ -908,14 +931,14 @@ var Divider = import_react8.default.forwardRef(
|
|
|
908
931
|
}, ref) => {
|
|
909
932
|
const isHorizontal = orientation === "horizontal";
|
|
910
933
|
if (label && isHorizontal) {
|
|
911
|
-
return /* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
912
935
|
"div",
|
|
913
936
|
{
|
|
914
937
|
className: cx("flex items-center gap-4", className),
|
|
915
938
|
role: "separator",
|
|
916
939
|
"aria-orientation": orientation
|
|
917
940
|
},
|
|
918
|
-
/* @__PURE__ */
|
|
941
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
919
942
|
"div",
|
|
920
943
|
{
|
|
921
944
|
className: cx(
|
|
@@ -925,8 +948,8 @@ var Divider = import_react8.default.forwardRef(
|
|
|
925
948
|
)
|
|
926
949
|
}
|
|
927
950
|
),
|
|
928
|
-
/* @__PURE__ */
|
|
929
|
-
/* @__PURE__ */
|
|
951
|
+
/* @__PURE__ */ import_react9.default.createElement("span", { className: "text-sm text-silver shrink-0" }, label),
|
|
952
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
930
953
|
"div",
|
|
931
954
|
{
|
|
932
955
|
className: cx(
|
|
@@ -938,7 +961,7 @@ var Divider = import_react8.default.forwardRef(
|
|
|
938
961
|
)
|
|
939
962
|
);
|
|
940
963
|
}
|
|
941
|
-
return /* @__PURE__ */
|
|
964
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
942
965
|
"hr",
|
|
943
966
|
{
|
|
944
967
|
ref,
|
|
@@ -960,7 +983,7 @@ var Divider = import_react8.default.forwardRef(
|
|
|
960
983
|
Divider.displayName = "Divider";
|
|
961
984
|
|
|
962
985
|
// src/components/Avatar.tsx
|
|
963
|
-
var
|
|
986
|
+
var import_react10 = __toESM(require("react"));
|
|
964
987
|
var sizeMap = {
|
|
965
988
|
xs: "h-6 w-6 text-[10px]",
|
|
966
989
|
sm: "h-8 w-8 text-[11px]",
|
|
@@ -976,10 +999,10 @@ function initials(name) {
|
|
|
976
999
|
const parts = name.trim().split(/\s+/);
|
|
977
1000
|
return parts.slice(0, 2).map((p) => p[0].toUpperCase()).join("");
|
|
978
1001
|
}
|
|
979
|
-
var Avatar =
|
|
1002
|
+
var Avatar = import_react10.default.forwardRef(
|
|
980
1003
|
({ src, alt = "", name, size = "md", status, className, ...rest }, ref) => {
|
|
981
1004
|
const statusColor = status === "online" ? "bg-success" : status === "busy" ? "bg-warning" : "bg-zinc";
|
|
982
|
-
return /* @__PURE__ */
|
|
1005
|
+
return /* @__PURE__ */ import_react10.default.createElement(
|
|
983
1006
|
"div",
|
|
984
1007
|
{
|
|
985
1008
|
ref,
|
|
@@ -990,15 +1013,15 @@ var Avatar = import_react9.default.forwardRef(
|
|
|
990
1013
|
),
|
|
991
1014
|
...rest
|
|
992
1015
|
},
|
|
993
|
-
src ? /* @__PURE__ */
|
|
1016
|
+
src ? /* @__PURE__ */ import_react10.default.createElement(
|
|
994
1017
|
"img",
|
|
995
1018
|
{
|
|
996
1019
|
src,
|
|
997
1020
|
alt: alt || name || "Avatar",
|
|
998
1021
|
className: "h-full w-full object-cover"
|
|
999
1022
|
}
|
|
1000
|
-
) : /* @__PURE__ */
|
|
1001
|
-
status && /* @__PURE__ */
|
|
1023
|
+
) : /* @__PURE__ */ import_react10.default.createElement("span", { "aria-hidden": true }, initials(name) || "\xB7"),
|
|
1024
|
+
status && /* @__PURE__ */ import_react10.default.createElement(
|
|
1002
1025
|
"span",
|
|
1003
1026
|
{
|
|
1004
1027
|
className: cx(
|
|
@@ -1015,8 +1038,8 @@ var Avatar = import_react9.default.forwardRef(
|
|
|
1015
1038
|
Avatar.displayName = "Avatar";
|
|
1016
1039
|
|
|
1017
1040
|
// src/components/Badge.tsx
|
|
1018
|
-
var
|
|
1019
|
-
var Badge =
|
|
1041
|
+
var import_react11 = __toESM(require("react"));
|
|
1042
|
+
var Badge = import_react11.default.forwardRef(
|
|
1020
1043
|
({ variant = "default", className, ...rest }, ref) => {
|
|
1021
1044
|
const base = "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border";
|
|
1022
1045
|
const variantClasses = {
|
|
@@ -1028,20 +1051,20 @@ var Badge = import_react10.default.forwardRef(
|
|
|
1028
1051
|
info: "bg-info/20 text-info border-info/30"
|
|
1029
1052
|
};
|
|
1030
1053
|
const variantClass = variantClasses[variant];
|
|
1031
|
-
return /* @__PURE__ */
|
|
1054
|
+
return /* @__PURE__ */ import_react11.default.createElement("span", { ref, className: cx(base, variantClass, className), ...rest });
|
|
1032
1055
|
}
|
|
1033
1056
|
);
|
|
1034
1057
|
Badge.displayName = "Badge";
|
|
1035
1058
|
|
|
1036
1059
|
// src/components/Tooltip.tsx
|
|
1037
|
-
var
|
|
1060
|
+
var import_react12 = __toESM(require("react"));
|
|
1038
1061
|
var Tooltip = ({
|
|
1039
1062
|
content,
|
|
1040
1063
|
children,
|
|
1041
1064
|
open = false,
|
|
1042
1065
|
side = "top"
|
|
1043
1066
|
}) => {
|
|
1044
|
-
return /* @__PURE__ */
|
|
1067
|
+
return /* @__PURE__ */ import_react12.default.createElement("span", { className: "relative inline-block" }, children, /* @__PURE__ */ import_react12.default.createElement(
|
|
1045
1068
|
"span",
|
|
1046
1069
|
{
|
|
1047
1070
|
role: "tooltip",
|
|
@@ -1059,10 +1082,10 @@ var Tooltip = ({
|
|
|
1059
1082
|
};
|
|
1060
1083
|
|
|
1061
1084
|
// src/components/Table.tsx
|
|
1062
|
-
var
|
|
1063
|
-
var Table =
|
|
1085
|
+
var import_react13 = __toESM(require("react"));
|
|
1086
|
+
var Table = import_react13.default.forwardRef(
|
|
1064
1087
|
({ responsive = true, className, children, ...props }, ref) => {
|
|
1065
|
-
const table = /* @__PURE__ */
|
|
1088
|
+
const table = /* @__PURE__ */ import_react13.default.createElement(
|
|
1066
1089
|
"table",
|
|
1067
1090
|
{
|
|
1068
1091
|
ref,
|
|
@@ -1072,14 +1095,14 @@ var Table = import_react12.default.forwardRef(
|
|
|
1072
1095
|
children
|
|
1073
1096
|
);
|
|
1074
1097
|
if (responsive) {
|
|
1075
|
-
return /* @__PURE__ */
|
|
1098
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", { className: "w-full overflow-x-auto" }, table);
|
|
1076
1099
|
}
|
|
1077
1100
|
return table;
|
|
1078
1101
|
}
|
|
1079
1102
|
);
|
|
1080
1103
|
Table.displayName = "Table";
|
|
1081
|
-
var TableHeader =
|
|
1082
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
1104
|
+
var TableHeader = import_react13.default.forwardRef(
|
|
1105
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ import_react13.default.createElement(
|
|
1083
1106
|
"thead",
|
|
1084
1107
|
{
|
|
1085
1108
|
ref,
|
|
@@ -1090,8 +1113,8 @@ var TableHeader = import_react12.default.forwardRef(
|
|
|
1090
1113
|
)
|
|
1091
1114
|
);
|
|
1092
1115
|
TableHeader.displayName = "TableHeader";
|
|
1093
|
-
var TableBody =
|
|
1094
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
1116
|
+
var TableBody = import_react13.default.forwardRef(
|
|
1117
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ import_react13.default.createElement(
|
|
1095
1118
|
"tbody",
|
|
1096
1119
|
{
|
|
1097
1120
|
ref,
|
|
@@ -1102,8 +1125,8 @@ var TableBody = import_react12.default.forwardRef(
|
|
|
1102
1125
|
)
|
|
1103
1126
|
);
|
|
1104
1127
|
TableBody.displayName = "TableBody";
|
|
1105
|
-
var TableFooter =
|
|
1106
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
1128
|
+
var TableFooter = import_react13.default.forwardRef(
|
|
1129
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ import_react13.default.createElement(
|
|
1107
1130
|
"tfoot",
|
|
1108
1131
|
{
|
|
1109
1132
|
ref,
|
|
@@ -1114,8 +1137,8 @@ var TableFooter = import_react12.default.forwardRef(
|
|
|
1114
1137
|
)
|
|
1115
1138
|
);
|
|
1116
1139
|
TableFooter.displayName = "TableFooter";
|
|
1117
|
-
var TableRow =
|
|
1118
|
-
({ hoverable = true, selected = false, className, children, ...props }, ref) => /* @__PURE__ */
|
|
1140
|
+
var TableRow = import_react13.default.forwardRef(
|
|
1141
|
+
({ hoverable = true, selected = false, className, children, ...props }, ref) => /* @__PURE__ */ import_react13.default.createElement(
|
|
1119
1142
|
"tr",
|
|
1120
1143
|
{
|
|
1121
1144
|
ref,
|
|
@@ -1131,8 +1154,8 @@ var TableRow = import_react12.default.forwardRef(
|
|
|
1131
1154
|
)
|
|
1132
1155
|
);
|
|
1133
1156
|
TableRow.displayName = "TableRow";
|
|
1134
|
-
var TableHead =
|
|
1135
|
-
({ sortable, sortDirection, className, children, ...props }, ref) => /* @__PURE__ */
|
|
1157
|
+
var TableHead = import_react13.default.forwardRef(
|
|
1158
|
+
({ sortable, sortDirection, className, children, ...props }, ref) => /* @__PURE__ */ import_react13.default.createElement(
|
|
1136
1159
|
"th",
|
|
1137
1160
|
{
|
|
1138
1161
|
ref,
|
|
@@ -1143,12 +1166,12 @@ var TableHead = import_react12.default.forwardRef(
|
|
|
1143
1166
|
),
|
|
1144
1167
|
...props
|
|
1145
1168
|
},
|
|
1146
|
-
/* @__PURE__ */
|
|
1169
|
+
/* @__PURE__ */ import_react13.default.createElement("div", { className: "flex items-center gap-2" }, children, sortable && sortDirection && /* @__PURE__ */ import_react13.default.createElement("span", { className: "text-gold" }, sortDirection === "asc" ? "\u2191" : "\u2193"))
|
|
1147
1170
|
)
|
|
1148
1171
|
);
|
|
1149
1172
|
TableHead.displayName = "TableHead";
|
|
1150
|
-
var TableCell =
|
|
1151
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
1173
|
+
var TableCell = import_react13.default.forwardRef(
|
|
1174
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ import_react13.default.createElement(
|
|
1152
1175
|
"td",
|
|
1153
1176
|
{
|
|
1154
1177
|
ref,
|
|
@@ -1159,8 +1182,8 @@ var TableCell = import_react12.default.forwardRef(
|
|
|
1159
1182
|
)
|
|
1160
1183
|
);
|
|
1161
1184
|
TableCell.displayName = "TableCell";
|
|
1162
|
-
var TableCaption =
|
|
1163
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
1185
|
+
var TableCaption = import_react13.default.forwardRef(
|
|
1186
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ import_react13.default.createElement(
|
|
1164
1187
|
"caption",
|
|
1165
1188
|
{
|
|
1166
1189
|
ref,
|
|
@@ -1173,11 +1196,11 @@ var TableCaption = import_react12.default.forwardRef(
|
|
|
1173
1196
|
TableCaption.displayName = "TableCaption";
|
|
1174
1197
|
|
|
1175
1198
|
// src/components/List.tsx
|
|
1176
|
-
var
|
|
1177
|
-
var List =
|
|
1199
|
+
var import_react14 = __toESM(require("react"));
|
|
1200
|
+
var List = import_react14.default.forwardRef(
|
|
1178
1201
|
({ variant = "default", ordered = false, className, children, ...props }, ref) => {
|
|
1179
1202
|
const Component = ordered ? "ol" : "ul";
|
|
1180
|
-
return /* @__PURE__ */
|
|
1203
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
1181
1204
|
Component,
|
|
1182
1205
|
{
|
|
1183
1206
|
ref,
|
|
@@ -1194,7 +1217,7 @@ var List = import_react13.default.forwardRef(
|
|
|
1194
1217
|
}
|
|
1195
1218
|
);
|
|
1196
1219
|
List.displayName = "List";
|
|
1197
|
-
var ListItem =
|
|
1220
|
+
var ListItem = import_react14.default.forwardRef(
|
|
1198
1221
|
({
|
|
1199
1222
|
leading,
|
|
1200
1223
|
trailing,
|
|
@@ -1212,7 +1235,7 @@ var ListItem = import_react13.default.forwardRef(
|
|
|
1212
1235
|
}
|
|
1213
1236
|
onClick?.(e);
|
|
1214
1237
|
};
|
|
1215
|
-
return /* @__PURE__ */
|
|
1238
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
1216
1239
|
"li",
|
|
1217
1240
|
{
|
|
1218
1241
|
ref,
|
|
@@ -1227,22 +1250,22 @@ var ListItem = import_react13.default.forwardRef(
|
|
|
1227
1250
|
),
|
|
1228
1251
|
...props
|
|
1229
1252
|
},
|
|
1230
|
-
leading && /* @__PURE__ */
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
trailing && /* @__PURE__ */
|
|
1253
|
+
leading && /* @__PURE__ */ import_react14.default.createElement("div", { className: "shrink-0" }, leading),
|
|
1254
|
+
/* @__PURE__ */ import_react14.default.createElement("div", { className: "flex-1 min-w-0" }, children),
|
|
1255
|
+
trailing && /* @__PURE__ */ import_react14.default.createElement("div", { className: "shrink-0" }, trailing)
|
|
1233
1256
|
);
|
|
1234
1257
|
}
|
|
1235
1258
|
);
|
|
1236
1259
|
ListItem.displayName = "ListItem";
|
|
1237
|
-
var ListItemText =
|
|
1260
|
+
var ListItemText = import_react14.default.forwardRef(
|
|
1238
1261
|
({ primary, secondary, className, ...props }, ref) => {
|
|
1239
|
-
return /* @__PURE__ */
|
|
1262
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { ref, className: cx("flex flex-col", className), ...props }, /* @__PURE__ */ import_react14.default.createElement("span", { className: "text-sm font-medium text-white" }, primary), secondary && /* @__PURE__ */ import_react14.default.createElement("span", { className: "text-xs text-silver mt-0.5" }, secondary));
|
|
1240
1263
|
}
|
|
1241
1264
|
);
|
|
1242
1265
|
ListItemText.displayName = "ListItemText";
|
|
1243
|
-
var ListSubheader =
|
|
1266
|
+
var ListSubheader = import_react14.default.forwardRef(
|
|
1244
1267
|
({ className, children, ...props }, ref) => {
|
|
1245
|
-
return /* @__PURE__ */
|
|
1268
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
1246
1269
|
"li",
|
|
1247
1270
|
{
|
|
1248
1271
|
ref,
|
|
@@ -1259,7 +1282,7 @@ var ListSubheader = import_react13.default.forwardRef(
|
|
|
1259
1282
|
ListSubheader.displayName = "ListSubheader";
|
|
1260
1283
|
|
|
1261
1284
|
// src/components/FileChip.tsx
|
|
1262
|
-
var
|
|
1285
|
+
var import_react15 = __toESM(require("react"));
|
|
1263
1286
|
var import_lucide_react2 = require("lucide-react");
|
|
1264
1287
|
function formatBytes(bytes) {
|
|
1265
1288
|
if (bytes === 0) {
|
|
@@ -1300,7 +1323,7 @@ var statusStyles = {
|
|
|
1300
1323
|
complete: "border-success/50",
|
|
1301
1324
|
error: "border-error/50"
|
|
1302
1325
|
};
|
|
1303
|
-
var FileChip =
|
|
1326
|
+
var FileChip = import_react15.default.forwardRef(
|
|
1304
1327
|
({
|
|
1305
1328
|
name,
|
|
1306
1329
|
size,
|
|
@@ -1316,7 +1339,7 @@ var FileChip = import_react14.default.forwardRef(
|
|
|
1316
1339
|
const Icon = getFileIcon(type);
|
|
1317
1340
|
const isImage = type?.startsWith("image/");
|
|
1318
1341
|
const showPreview = isImage && previewUrl;
|
|
1319
|
-
return /* @__PURE__ */
|
|
1342
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
1320
1343
|
"div",
|
|
1321
1344
|
{
|
|
1322
1345
|
ref,
|
|
@@ -1331,21 +1354,21 @@ var FileChip = import_react14.default.forwardRef(
|
|
|
1331
1354
|
role: "listitem",
|
|
1332
1355
|
...rest
|
|
1333
1356
|
},
|
|
1334
|
-
showPreview ? /* @__PURE__ */
|
|
1357
|
+
showPreview ? /* @__PURE__ */ import_react15.default.createElement("div", { className: "w-8 h-8 flex-shrink-0 overflow-hidden bg-slate" }, /* @__PURE__ */ import_react15.default.createElement(
|
|
1335
1358
|
"img",
|
|
1336
1359
|
{
|
|
1337
1360
|
src: previewUrl,
|
|
1338
1361
|
alt: "",
|
|
1339
1362
|
className: "w-full h-full object-cover"
|
|
1340
1363
|
}
|
|
1341
|
-
)) : /* @__PURE__ */
|
|
1364
|
+
)) : /* @__PURE__ */ import_react15.default.createElement(Icon, { className: cx(
|
|
1342
1365
|
"w-4 h-4 flex-shrink-0",
|
|
1343
1366
|
status === "error" ? "text-error" : "text-silver"
|
|
1344
1367
|
) }),
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
status === "uploading" && /* @__PURE__ */
|
|
1347
|
-
status === "pending" && /* @__PURE__ */
|
|
1348
|
-
removable && onRemove && /* @__PURE__ */
|
|
1368
|
+
/* @__PURE__ */ import_react15.default.createElement("div", { className: "flex flex-col min-w-0 flex-1" }, /* @__PURE__ */ import_react15.default.createElement("span", { className: "truncate max-w-40", title: name }, name), size !== void 0 && status !== "error" && /* @__PURE__ */ import_react15.default.createElement("span", { className: "text-xs text-silver/60" }, formatBytes(size)), status === "error" && error && /* @__PURE__ */ import_react15.default.createElement("span", { className: "text-xs text-error truncate", title: error }, error)),
|
|
1369
|
+
status === "uploading" && /* @__PURE__ */ import_react15.default.createElement(import_lucide_react2.Loader2, { className: "w-3.5 h-3.5 text-gold animate-spin flex-shrink-0" }),
|
|
1370
|
+
status === "pending" && /* @__PURE__ */ import_react15.default.createElement("div", { className: "w-2 h-2 rounded-full bg-silver/50 flex-shrink-0" }),
|
|
1371
|
+
removable && onRemove && /* @__PURE__ */ import_react15.default.createElement(
|
|
1349
1372
|
"button",
|
|
1350
1373
|
{
|
|
1351
1374
|
type: "button",
|
|
@@ -1361,7 +1384,7 @@ var FileChip = import_react14.default.forwardRef(
|
|
|
1361
1384
|
),
|
|
1362
1385
|
"aria-label": `Remove ${name}`
|
|
1363
1386
|
},
|
|
1364
|
-
/* @__PURE__ */
|
|
1387
|
+
/* @__PURE__ */ import_react15.default.createElement(import_lucide_react2.X, { className: "w-3.5 h-3.5" })
|
|
1365
1388
|
)
|
|
1366
1389
|
);
|
|
1367
1390
|
}
|
|
@@ -1369,8 +1392,8 @@ var FileChip = import_react14.default.forwardRef(
|
|
|
1369
1392
|
FileChip.displayName = "FileChip";
|
|
1370
1393
|
|
|
1371
1394
|
// src/components/AttachmentPreview.tsx
|
|
1372
|
-
var
|
|
1373
|
-
var AttachmentPreview =
|
|
1395
|
+
var import_react16 = __toESM(require("react"));
|
|
1396
|
+
var AttachmentPreview = import_react16.default.forwardRef(
|
|
1374
1397
|
({
|
|
1375
1398
|
attachments,
|
|
1376
1399
|
onRemove,
|
|
@@ -1384,7 +1407,7 @@ var AttachmentPreview = import_react15.default.forwardRef(
|
|
|
1384
1407
|
}
|
|
1385
1408
|
const visibleAttachments = maxVisible && maxVisible > 0 ? attachments.slice(0, maxVisible) : attachments;
|
|
1386
1409
|
const hiddenCount = maxVisible && maxVisible > 0 ? Math.max(0, attachments.length - maxVisible) : 0;
|
|
1387
|
-
return /* @__PURE__ */
|
|
1410
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
1388
1411
|
"div",
|
|
1389
1412
|
{
|
|
1390
1413
|
ref,
|
|
@@ -1393,7 +1416,7 @@ var AttachmentPreview = import_react15.default.forwardRef(
|
|
|
1393
1416
|
"aria-label": "Attached files",
|
|
1394
1417
|
...rest
|
|
1395
1418
|
},
|
|
1396
|
-
visibleAttachments.map((attachment) => /* @__PURE__ */
|
|
1419
|
+
visibleAttachments.map((attachment) => /* @__PURE__ */ import_react16.default.createElement(
|
|
1397
1420
|
FileChip,
|
|
1398
1421
|
{
|
|
1399
1422
|
key: attachment.id,
|
|
@@ -1407,7 +1430,7 @@ var AttachmentPreview = import_react15.default.forwardRef(
|
|
|
1407
1430
|
onRemove: onRemove ? () => onRemove(attachment.id) : void 0
|
|
1408
1431
|
}
|
|
1409
1432
|
)),
|
|
1410
|
-
hiddenCount > 0 && /* @__PURE__ */
|
|
1433
|
+
hiddenCount > 0 && /* @__PURE__ */ import_react16.default.createElement(
|
|
1411
1434
|
"div",
|
|
1412
1435
|
{
|
|
1413
1436
|
className: "inline-flex items-center px-2 py-1.5 bg-charcoal border border-silver/30 text-sm text-silver"
|
|
@@ -1422,10 +1445,10 @@ var AttachmentPreview = import_react15.default.forwardRef(
|
|
|
1422
1445
|
AttachmentPreview.displayName = "AttachmentPreview";
|
|
1423
1446
|
|
|
1424
1447
|
// src/components/Label.tsx
|
|
1425
|
-
var
|
|
1426
|
-
var Label =
|
|
1448
|
+
var import_react17 = __toESM(require("react"));
|
|
1449
|
+
var Label = import_react17.default.forwardRef(
|
|
1427
1450
|
({ className, required, children, ...rest }, ref) => {
|
|
1428
|
-
return /* @__PURE__ */
|
|
1451
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
1429
1452
|
"label",
|
|
1430
1453
|
{
|
|
1431
1454
|
ref,
|
|
@@ -1433,17 +1456,17 @@ var Label = import_react16.default.forwardRef(
|
|
|
1433
1456
|
...rest
|
|
1434
1457
|
},
|
|
1435
1458
|
children,
|
|
1436
|
-
required && /* @__PURE__ */
|
|
1459
|
+
required && /* @__PURE__ */ import_react17.default.createElement("span", { className: "text-error ml-1" }, "*")
|
|
1437
1460
|
);
|
|
1438
1461
|
}
|
|
1439
1462
|
);
|
|
1440
1463
|
Label.displayName = "Label";
|
|
1441
1464
|
|
|
1442
1465
|
// src/components/HelperText.tsx
|
|
1443
|
-
var
|
|
1444
|
-
var HelperText =
|
|
1466
|
+
var import_react18 = __toESM(require("react"));
|
|
1467
|
+
var HelperText = import_react18.default.forwardRef(
|
|
1445
1468
|
({ className, error, children, ...rest }, ref) => {
|
|
1446
|
-
return /* @__PURE__ */
|
|
1469
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
1447
1470
|
"p",
|
|
1448
1471
|
{
|
|
1449
1472
|
ref,
|
|
@@ -1457,12 +1480,12 @@ var HelperText = import_react17.default.forwardRef(
|
|
|
1457
1480
|
HelperText.displayName = "HelperText";
|
|
1458
1481
|
|
|
1459
1482
|
// src/components/Textarea.tsx
|
|
1460
|
-
var
|
|
1461
|
-
var Textarea =
|
|
1483
|
+
var import_react19 = __toESM(require("react"));
|
|
1484
|
+
var Textarea = import_react19.default.forwardRef(
|
|
1462
1485
|
({ error = false, className, disabled, ...rest }, ref) => {
|
|
1463
1486
|
const base = "w-full px-3 py-2 bg-graphite border border-ash rounded-none text-white placeholder:text-zinc min-h-[80px] transition-all duration-fast focus:border-gold focus:ring-1 focus:ring-gold focus:outline-none disabled:bg-slate disabled:text-dim disabled:cursor-not-allowed";
|
|
1464
1487
|
const errorCls = error ? "border-error focus:border-error focus:ring-error" : "";
|
|
1465
|
-
return /* @__PURE__ */
|
|
1488
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
1466
1489
|
"textarea",
|
|
1467
1490
|
{
|
|
1468
1491
|
ref,
|
|
@@ -1476,11 +1499,11 @@ var Textarea = import_react18.default.forwardRef(
|
|
|
1476
1499
|
Textarea.displayName = "Textarea";
|
|
1477
1500
|
|
|
1478
1501
|
// src/components/Select.tsx
|
|
1479
|
-
var
|
|
1502
|
+
var import_react20 = __toESM(require("react"));
|
|
1480
1503
|
var selectBgImage = `url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23C9A227' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e")`;
|
|
1481
|
-
var Select =
|
|
1504
|
+
var Select = import_react20.default.forwardRef(
|
|
1482
1505
|
({ error = false, className, disabled, options, children, ...rest }, ref) => {
|
|
1483
|
-
return /* @__PURE__ */
|
|
1506
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
1484
1507
|
"select",
|
|
1485
1508
|
{
|
|
1486
1509
|
ref,
|
|
@@ -1500,19 +1523,19 @@ var Select = import_react19.default.forwardRef(
|
|
|
1500
1523
|
disabled,
|
|
1501
1524
|
...rest
|
|
1502
1525
|
},
|
|
1503
|
-
options ? options.map((opt) => /* @__PURE__ */
|
|
1526
|
+
options ? options.map((opt) => /* @__PURE__ */ import_react20.default.createElement("option", { key: opt.value, value: opt.value }, opt.label)) : children
|
|
1504
1527
|
);
|
|
1505
1528
|
}
|
|
1506
1529
|
);
|
|
1507
1530
|
Select.displayName = "Select";
|
|
1508
1531
|
|
|
1509
1532
|
// src/components/Checkbox.tsx
|
|
1510
|
-
var
|
|
1533
|
+
var import_react21 = __toESM(require("react"));
|
|
1511
1534
|
var checkmarkSvg = `url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='%231A1A1A' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")`;
|
|
1512
|
-
var Checkbox =
|
|
1535
|
+
var Checkbox = import_react21.default.forwardRef(
|
|
1513
1536
|
({ className, label, id, ...rest }, ref) => {
|
|
1514
1537
|
const inputId = id || rest.name || Math.random().toString(36).substr(2, 9);
|
|
1515
|
-
const setRef = (0,
|
|
1538
|
+
const setRef = (0, import_react21.useCallback)((node) => {
|
|
1516
1539
|
if (node) {
|
|
1517
1540
|
if (node.checked) {
|
|
1518
1541
|
node.style.backgroundImage = checkmarkSvg;
|
|
@@ -1524,7 +1547,7 @@ var Checkbox = import_react20.default.forwardRef(
|
|
|
1524
1547
|
ref.current = node;
|
|
1525
1548
|
}
|
|
1526
1549
|
}, [ref]);
|
|
1527
|
-
return /* @__PURE__ */
|
|
1550
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
1528
1551
|
"input",
|
|
1529
1552
|
{
|
|
1530
1553
|
type: "checkbox",
|
|
@@ -1554,7 +1577,7 @@ var Checkbox = import_react20.default.forwardRef(
|
|
|
1554
1577
|
},
|
|
1555
1578
|
...rest
|
|
1556
1579
|
}
|
|
1557
|
-
), label && /* @__PURE__ */
|
|
1580
|
+
), label && /* @__PURE__ */ import_react21.default.createElement(
|
|
1558
1581
|
"label",
|
|
1559
1582
|
{
|
|
1560
1583
|
htmlFor: inputId,
|
|
@@ -1567,12 +1590,12 @@ var Checkbox = import_react20.default.forwardRef(
|
|
|
1567
1590
|
Checkbox.displayName = "Checkbox";
|
|
1568
1591
|
|
|
1569
1592
|
// src/components/Radio.tsx
|
|
1570
|
-
var
|
|
1593
|
+
var import_react22 = __toESM(require("react"));
|
|
1571
1594
|
var radioDotSvg = `url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='%231A1A1A' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")`;
|
|
1572
|
-
var Radio =
|
|
1595
|
+
var Radio = import_react22.default.forwardRef(
|
|
1573
1596
|
({ className, label, id, ...rest }, ref) => {
|
|
1574
1597
|
const inputId = id || rest.name || Math.random().toString(36).substr(2, 9);
|
|
1575
|
-
const setRef = (0,
|
|
1598
|
+
const setRef = (0, import_react22.useCallback)((node) => {
|
|
1576
1599
|
if (node) {
|
|
1577
1600
|
if (node.checked) {
|
|
1578
1601
|
node.style.backgroundImage = radioDotSvg;
|
|
@@ -1584,7 +1607,7 @@ var Radio = import_react21.default.forwardRef(
|
|
|
1584
1607
|
ref.current = node;
|
|
1585
1608
|
}
|
|
1586
1609
|
}, [ref]);
|
|
1587
|
-
return /* @__PURE__ */
|
|
1610
|
+
return /* @__PURE__ */ import_react22.default.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ import_react22.default.createElement(
|
|
1588
1611
|
"input",
|
|
1589
1612
|
{
|
|
1590
1613
|
type: "radio",
|
|
@@ -1624,7 +1647,7 @@ var Radio = import_react21.default.forwardRef(
|
|
|
1624
1647
|
},
|
|
1625
1648
|
...rest
|
|
1626
1649
|
}
|
|
1627
|
-
), label && /* @__PURE__ */
|
|
1650
|
+
), label && /* @__PURE__ */ import_react22.default.createElement(
|
|
1628
1651
|
"label",
|
|
1629
1652
|
{
|
|
1630
1653
|
htmlFor: inputId,
|
|
@@ -1637,8 +1660,8 @@ var Radio = import_react21.default.forwardRef(
|
|
|
1637
1660
|
Radio.displayName = "Radio";
|
|
1638
1661
|
|
|
1639
1662
|
// src/components/Switch.tsx
|
|
1640
|
-
var
|
|
1641
|
-
var Switch =
|
|
1663
|
+
var import_react23 = __toESM(require("react"));
|
|
1664
|
+
var Switch = import_react23.default.forwardRef(
|
|
1642
1665
|
({
|
|
1643
1666
|
checked: controlledChecked,
|
|
1644
1667
|
defaultChecked = false,
|
|
@@ -1648,11 +1671,11 @@ var Switch = import_react22.default.forwardRef(
|
|
|
1648
1671
|
label,
|
|
1649
1672
|
...rest
|
|
1650
1673
|
}, ref) => {
|
|
1651
|
-
const [internalChecked, setInternalChecked] = (0,
|
|
1674
|
+
const [internalChecked, setInternalChecked] = (0, import_react23.useState)(defaultChecked);
|
|
1652
1675
|
const isControlled = controlledChecked !== void 0;
|
|
1653
1676
|
const checked = isControlled ? controlledChecked : internalChecked;
|
|
1654
|
-
const buttonRef = (0,
|
|
1655
|
-
const setRefs = (0,
|
|
1677
|
+
const buttonRef = (0, import_react23.useRef)(null);
|
|
1678
|
+
const setRefs = (0, import_react23.useCallback)(
|
|
1656
1679
|
(node) => {
|
|
1657
1680
|
buttonRef.current = node;
|
|
1658
1681
|
if (typeof ref === "function") {
|
|
@@ -1674,7 +1697,7 @@ var Switch = import_react22.default.forwardRef(
|
|
|
1674
1697
|
onCheckedChange?.(newChecked);
|
|
1675
1698
|
rest.onClick?.(e);
|
|
1676
1699
|
};
|
|
1677
|
-
return /* @__PURE__ */
|
|
1700
|
+
return /* @__PURE__ */ import_react23.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ import_react23.default.createElement(
|
|
1678
1701
|
"button",
|
|
1679
1702
|
{
|
|
1680
1703
|
type: "button",
|
|
@@ -1694,7 +1717,7 @@ var Switch = import_react22.default.forwardRef(
|
|
|
1694
1717
|
),
|
|
1695
1718
|
...rest
|
|
1696
1719
|
},
|
|
1697
|
-
/* @__PURE__ */
|
|
1720
|
+
/* @__PURE__ */ import_react23.default.createElement(
|
|
1698
1721
|
"span",
|
|
1699
1722
|
{
|
|
1700
1723
|
className: cx(
|
|
@@ -1704,7 +1727,7 @@ var Switch = import_react22.default.forwardRef(
|
|
|
1704
1727
|
)
|
|
1705
1728
|
}
|
|
1706
1729
|
)
|
|
1707
|
-
), label && /* @__PURE__ */
|
|
1730
|
+
), label && /* @__PURE__ */ import_react23.default.createElement(
|
|
1708
1731
|
"span",
|
|
1709
1732
|
{
|
|
1710
1733
|
className: "text-sm text-silver cursor-pointer",
|
|
@@ -1722,7 +1745,7 @@ var Switch = import_react22.default.forwardRef(
|
|
|
1722
1745
|
Switch.displayName = "Switch";
|
|
1723
1746
|
|
|
1724
1747
|
// src/components/Slider.tsx
|
|
1725
|
-
var
|
|
1748
|
+
var import_react24 = __toESM(require("react"));
|
|
1726
1749
|
var SIZE_TRACK = {
|
|
1727
1750
|
sm: "h-1",
|
|
1728
1751
|
md: "h-2",
|
|
@@ -1733,7 +1756,7 @@ var SIZE_THUMB = {
|
|
|
1733
1756
|
md: "h-4 w-4",
|
|
1734
1757
|
lg: "h-5 w-5"
|
|
1735
1758
|
};
|
|
1736
|
-
var Slider =
|
|
1759
|
+
var Slider = import_react24.default.forwardRef(
|
|
1737
1760
|
({
|
|
1738
1761
|
value: controlledValue,
|
|
1739
1762
|
defaultValue = 0,
|
|
@@ -1749,13 +1772,13 @@ var Slider = import_react23.default.forwardRef(
|
|
|
1749
1772
|
className,
|
|
1750
1773
|
...props
|
|
1751
1774
|
}, ref) => {
|
|
1752
|
-
const [internalValue, setInternalValue] = (0,
|
|
1753
|
-
const [isDragging, setIsDragging] = (0,
|
|
1754
|
-
const trackRef = (0,
|
|
1775
|
+
const [internalValue, setInternalValue] = (0, import_react24.useState)(defaultValue);
|
|
1776
|
+
const [isDragging, setIsDragging] = (0, import_react24.useState)(false);
|
|
1777
|
+
const trackRef = (0, import_react24.useRef)(null);
|
|
1755
1778
|
const isControlled = controlledValue !== void 0;
|
|
1756
1779
|
const value = isControlled ? controlledValue : internalValue;
|
|
1757
1780
|
const percentage = (value - min) / (max - min) * 100;
|
|
1758
|
-
const updateValue = (0,
|
|
1781
|
+
const updateValue = (0, import_react24.useCallback)(
|
|
1759
1782
|
(clientX) => {
|
|
1760
1783
|
if (!trackRef.current || disabled) {
|
|
1761
1784
|
return;
|
|
@@ -1827,14 +1850,14 @@ var Slider = import_react23.default.forwardRef(
|
|
|
1827
1850
|
onChange?.(newValue);
|
|
1828
1851
|
onChangeEnd?.(newValue);
|
|
1829
1852
|
};
|
|
1830
|
-
return /* @__PURE__ */
|
|
1853
|
+
return /* @__PURE__ */ import_react24.default.createElement(
|
|
1831
1854
|
"div",
|
|
1832
1855
|
{
|
|
1833
1856
|
ref,
|
|
1834
1857
|
className: cx("relative w-full py-2", disabled && "opacity-50", className),
|
|
1835
1858
|
...props
|
|
1836
1859
|
},
|
|
1837
|
-
/* @__PURE__ */
|
|
1860
|
+
/* @__PURE__ */ import_react24.default.createElement(
|
|
1838
1861
|
"div",
|
|
1839
1862
|
{
|
|
1840
1863
|
ref: trackRef,
|
|
@@ -1844,14 +1867,14 @@ var Slider = import_react23.default.forwardRef(
|
|
|
1844
1867
|
),
|
|
1845
1868
|
onMouseDown: handleMouseDown
|
|
1846
1869
|
},
|
|
1847
|
-
/* @__PURE__ */
|
|
1870
|
+
/* @__PURE__ */ import_react24.default.createElement(
|
|
1848
1871
|
"div",
|
|
1849
1872
|
{
|
|
1850
1873
|
className: cx("absolute inset-y-0 left-0 bg-gold", SIZE_TRACK[size]),
|
|
1851
1874
|
style: { width: `${percentage}%` }
|
|
1852
1875
|
}
|
|
1853
1876
|
),
|
|
1854
|
-
/* @__PURE__ */
|
|
1877
|
+
/* @__PURE__ */ import_react24.default.createElement(
|
|
1855
1878
|
"div",
|
|
1856
1879
|
{
|
|
1857
1880
|
role: "slider",
|
|
@@ -1872,7 +1895,7 @@ var Slider = import_react23.default.forwardRef(
|
|
|
1872
1895
|
),
|
|
1873
1896
|
style: { left: `${percentage}%` }
|
|
1874
1897
|
},
|
|
1875
|
-
showTooltip && isDragging && /* @__PURE__ */
|
|
1898
|
+
showTooltip && isDragging && /* @__PURE__ */ import_react24.default.createElement(
|
|
1876
1899
|
"div",
|
|
1877
1900
|
{
|
|
1878
1901
|
className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-graphite border border-ash text-xs text-white whitespace-nowrap"
|
|
@@ -1887,10 +1910,10 @@ var Slider = import_react23.default.forwardRef(
|
|
|
1887
1910
|
Slider.displayName = "Slider";
|
|
1888
1911
|
|
|
1889
1912
|
// src/components/InputGroup.tsx
|
|
1890
|
-
var
|
|
1891
|
-
var InputGroup =
|
|
1913
|
+
var import_react25 = __toESM(require("react"));
|
|
1914
|
+
var InputGroup = import_react25.default.forwardRef(
|
|
1892
1915
|
({ className, children, ...props }, ref) => {
|
|
1893
|
-
return /* @__PURE__ */
|
|
1916
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
1894
1917
|
"div",
|
|
1895
1918
|
{
|
|
1896
1919
|
ref,
|
|
@@ -1902,9 +1925,9 @@ var InputGroup = import_react24.default.forwardRef(
|
|
|
1902
1925
|
}
|
|
1903
1926
|
);
|
|
1904
1927
|
InputGroup.displayName = "InputGroup";
|
|
1905
|
-
var InputLeftAddon =
|
|
1928
|
+
var InputLeftAddon = import_react25.default.forwardRef(
|
|
1906
1929
|
({ className, children, ...props }, ref) => {
|
|
1907
|
-
return /* @__PURE__ */
|
|
1930
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
1908
1931
|
"div",
|
|
1909
1932
|
{
|
|
1910
1933
|
ref,
|
|
@@ -1920,9 +1943,9 @@ var InputLeftAddon = import_react24.default.forwardRef(
|
|
|
1920
1943
|
}
|
|
1921
1944
|
);
|
|
1922
1945
|
InputLeftAddon.displayName = "InputLeftAddon";
|
|
1923
|
-
var InputRightAddon =
|
|
1946
|
+
var InputRightAddon = import_react25.default.forwardRef(
|
|
1924
1947
|
({ className, children, ...props }, ref) => {
|
|
1925
|
-
return /* @__PURE__ */
|
|
1948
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
1926
1949
|
"div",
|
|
1927
1950
|
{
|
|
1928
1951
|
ref,
|
|
@@ -1938,9 +1961,9 @@ var InputRightAddon = import_react24.default.forwardRef(
|
|
|
1938
1961
|
}
|
|
1939
1962
|
);
|
|
1940
1963
|
InputRightAddon.displayName = "InputRightAddon";
|
|
1941
|
-
var InputLeftElement =
|
|
1964
|
+
var InputLeftElement = import_react25.default.forwardRef(
|
|
1942
1965
|
({ className, children, ...props }, ref) => {
|
|
1943
|
-
return /* @__PURE__ */
|
|
1966
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
1944
1967
|
"div",
|
|
1945
1968
|
{
|
|
1946
1969
|
ref,
|
|
@@ -1956,9 +1979,9 @@ var InputLeftElement = import_react24.default.forwardRef(
|
|
|
1956
1979
|
}
|
|
1957
1980
|
);
|
|
1958
1981
|
InputLeftElement.displayName = "InputLeftElement";
|
|
1959
|
-
var InputRightElement =
|
|
1982
|
+
var InputRightElement = import_react25.default.forwardRef(
|
|
1960
1983
|
({ className, children, ...props }, ref) => {
|
|
1961
|
-
return /* @__PURE__ */
|
|
1984
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
1962
1985
|
"div",
|
|
1963
1986
|
{
|
|
1964
1987
|
ref,
|
|
@@ -1973,9 +1996,9 @@ var InputRightElement = import_react24.default.forwardRef(
|
|
|
1973
1996
|
}
|
|
1974
1997
|
);
|
|
1975
1998
|
InputRightElement.displayName = "InputRightElement";
|
|
1976
|
-
var InputWrapper =
|
|
1999
|
+
var InputWrapper = import_react25.default.forwardRef(
|
|
1977
2000
|
({ className, children, ...props }, ref) => {
|
|
1978
|
-
return /* @__PURE__ */
|
|
2001
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
1979
2002
|
"div",
|
|
1980
2003
|
{
|
|
1981
2004
|
ref,
|
|
@@ -1989,7 +2012,7 @@ var InputWrapper = import_react24.default.forwardRef(
|
|
|
1989
2012
|
InputWrapper.displayName = "InputWrapper";
|
|
1990
2013
|
|
|
1991
2014
|
// src/components/Alert.tsx
|
|
1992
|
-
var
|
|
2015
|
+
var import_react26 = __toESM(require("react"));
|
|
1993
2016
|
var import_lucide_react3 = require("lucide-react");
|
|
1994
2017
|
var icons = {
|
|
1995
2018
|
info: import_lucide_react3.Info,
|
|
@@ -2003,10 +2026,10 @@ var variantStyles = {
|
|
|
2003
2026
|
warning: "bg-warning/10 border-warning text-warning",
|
|
2004
2027
|
error: "bg-error/10 border-error text-error"
|
|
2005
2028
|
};
|
|
2006
|
-
var Alert =
|
|
2029
|
+
var Alert = import_react26.default.forwardRef(
|
|
2007
2030
|
({ variant = "info", title, children, className, ...rest }, ref) => {
|
|
2008
2031
|
const Icon = icons[variant];
|
|
2009
|
-
return /* @__PURE__ */
|
|
2032
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
2010
2033
|
"div",
|
|
2011
2034
|
{
|
|
2012
2035
|
ref,
|
|
@@ -2018,24 +2041,24 @@ var Alert = import_react25.default.forwardRef(
|
|
|
2018
2041
|
),
|
|
2019
2042
|
...rest
|
|
2020
2043
|
},
|
|
2021
|
-
/* @__PURE__ */
|
|
2022
|
-
/* @__PURE__ */
|
|
2044
|
+
/* @__PURE__ */ import_react26.default.createElement(Icon, { className: "h-5 w-5 shrink-0" }),
|
|
2045
|
+
/* @__PURE__ */ import_react26.default.createElement("div", { className: "flex-1" }, title && /* @__PURE__ */ import_react26.default.createElement(
|
|
2023
2046
|
"h5",
|
|
2024
2047
|
{
|
|
2025
2048
|
className: "mb-1 font-medium leading-none tracking-tight text-current"
|
|
2026
2049
|
},
|
|
2027
2050
|
title
|
|
2028
|
-
), /* @__PURE__ */
|
|
2051
|
+
), /* @__PURE__ */ import_react26.default.createElement("div", { className: "text-sm opacity-90" }, children))
|
|
2029
2052
|
);
|
|
2030
2053
|
}
|
|
2031
2054
|
);
|
|
2032
2055
|
Alert.displayName = "Alert";
|
|
2033
2056
|
|
|
2034
2057
|
// src/components/Spinner.tsx
|
|
2035
|
-
var
|
|
2058
|
+
var import_react27 = __toESM(require("react"));
|
|
2036
2059
|
var Spinner = ({ className, size = "md", ...rest }) => {
|
|
2037
2060
|
const sizeClass = size === "sm" ? "h-4 w-4" : size === "lg" ? "h-8 w-8" : "h-6 w-6";
|
|
2038
|
-
return /* @__PURE__ */
|
|
2061
|
+
return /* @__PURE__ */ import_react27.default.createElement(
|
|
2039
2062
|
"svg",
|
|
2040
2063
|
{
|
|
2041
2064
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2048,27 +2071,11 @@ var Spinner = ({ className, size = "md", ...rest }) => {
|
|
|
2048
2071
|
className: cx("animate-spin text-gold", sizeClass, className),
|
|
2049
2072
|
...rest
|
|
2050
2073
|
},
|
|
2051
|
-
/* @__PURE__ */
|
|
2074
|
+
/* @__PURE__ */ import_react27.default.createElement("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
2052
2075
|
);
|
|
2053
2076
|
};
|
|
2054
2077
|
Spinner.displayName = "Spinner";
|
|
2055
2078
|
|
|
2056
|
-
// src/components/Skeleton.tsx
|
|
2057
|
-
var import_react27 = __toESM(require("react"));
|
|
2058
|
-
var Skeleton = import_react27.default.forwardRef(
|
|
2059
|
-
({ className, ...rest }, ref) => {
|
|
2060
|
-
return /* @__PURE__ */ import_react27.default.createElement(
|
|
2061
|
-
"div",
|
|
2062
|
-
{
|
|
2063
|
-
ref,
|
|
2064
|
-
className: cx("animate-pulse bg-ash", className),
|
|
2065
|
-
...rest
|
|
2066
|
-
}
|
|
2067
|
-
);
|
|
2068
|
-
}
|
|
2069
|
-
);
|
|
2070
|
-
Skeleton.displayName = "Skeleton";
|
|
2071
|
-
|
|
2072
2079
|
// src/components/Progress.tsx
|
|
2073
2080
|
var import_react28 = __toESM(require("react"));
|
|
2074
2081
|
var SIZE_MAP = {
|
|
@@ -3842,7 +3849,7 @@ function injectStreamingCursor(html, cursorClassName) {
|
|
|
3842
3849
|
return container.innerHTML;
|
|
3843
3850
|
}
|
|
3844
3851
|
var MarkdownContent = import_react52.default.forwardRef(
|
|
3845
|
-
({ className, content, sanitizeConfig, isStreaming, cursorClassName, ...rest }, ref) => {
|
|
3852
|
+
({ className, content, isMarkdown = true, sanitizeConfig, isStreaming, cursorClassName, ...rest }, ref) => {
|
|
3846
3853
|
useDOMPurifySetup();
|
|
3847
3854
|
const sanitizedHtml = (0, import_react52.useMemo)(() => {
|
|
3848
3855
|
if (!content && !isStreaming) {
|
|
@@ -3850,10 +3857,14 @@ var MarkdownContent = import_react52.default.forwardRef(
|
|
|
3850
3857
|
}
|
|
3851
3858
|
const config = sanitizeConfig ?? DEFAULT_SANITIZE_CONFIG;
|
|
3852
3859
|
let htmlContent;
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3860
|
+
if (isMarkdown) {
|
|
3861
|
+
try {
|
|
3862
|
+
htmlContent = import_marked.marked.parse(content);
|
|
3863
|
+
} catch (e) {
|
|
3864
|
+
console.error("Error parsing markdown:", e);
|
|
3865
|
+
htmlContent = content;
|
|
3866
|
+
}
|
|
3867
|
+
} else {
|
|
3857
3868
|
htmlContent = content;
|
|
3858
3869
|
}
|
|
3859
3870
|
const sanitized = htmlContent ? import_dompurify.default.sanitize(htmlContent, config) : "";
|
|
@@ -4231,7 +4242,7 @@ var StreamingCursor = import_react54.default.forwardRef(
|
|
|
4231
4242
|
StreamingCursor.displayName = "StreamingCursor";
|
|
4232
4243
|
|
|
4233
4244
|
// src/components/chat/ChatInterface.tsx
|
|
4234
|
-
var
|
|
4245
|
+
var import_react72 = __toESM(require("react"));
|
|
4235
4246
|
|
|
4236
4247
|
// src/components/chat/ChatView.tsx
|
|
4237
4248
|
var import_react58 = __toESM(require("react"));
|
|
@@ -5143,7 +5154,10 @@ var CollapsedSidebarToggle = import_react60.default.forwardRef(({ onExpand, clas
|
|
|
5143
5154
|
CollapsedSidebarToggle.displayName = "CollapsedSidebarToggle";
|
|
5144
5155
|
|
|
5145
5156
|
// src/components/chat/ArtifactsPanel.tsx
|
|
5146
|
-
var
|
|
5157
|
+
var import_react68 = __toESM(require("react"));
|
|
5158
|
+
|
|
5159
|
+
// src/components/ArtifactCard.tsx
|
|
5160
|
+
var import_react67 = __toESM(require("react"));
|
|
5147
5161
|
|
|
5148
5162
|
// src/components/ImageCard.tsx
|
|
5149
5163
|
var import_react61 = __toESM(require("react"));
|
|
@@ -5161,58 +5175,69 @@ function resolveAspectRatio(ratio) {
|
|
|
5161
5175
|
var ImageCard = import_react61.default.forwardRef(
|
|
5162
5176
|
({
|
|
5163
5177
|
src,
|
|
5164
|
-
alt,
|
|
5178
|
+
alt = "",
|
|
5165
5179
|
title,
|
|
5166
5180
|
subtitle,
|
|
5167
|
-
aspectRatio,
|
|
5181
|
+
aspectRatio = "landscape",
|
|
5168
5182
|
objectFit = "cover",
|
|
5169
5183
|
overlay,
|
|
5170
5184
|
mediaClassName,
|
|
5171
5185
|
contentClassName,
|
|
5172
5186
|
className,
|
|
5173
5187
|
children,
|
|
5188
|
+
isLoading,
|
|
5174
5189
|
...props
|
|
5175
5190
|
}, ref) => {
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
return /* @__PURE__ */ import_react61.default.createElement(Card, { ref, className: cx("p-0 overflow-hidden group w-fit", className), ...props }, /* @__PURE__ */ import_react61.default.createElement(
|
|
5179
|
-
"div",
|
|
5191
|
+
return /* @__PURE__ */ import_react61.default.createElement(
|
|
5192
|
+
Card,
|
|
5180
5193
|
{
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
),
|
|
5186
|
-
style: hasAspectRatio ? { aspectRatio: resolveAspectRatio(aspectRatio) } : void 0
|
|
5194
|
+
ref,
|
|
5195
|
+
className: cx("p-0 overflow-hidden w-full", className),
|
|
5196
|
+
isLoading,
|
|
5197
|
+
...props
|
|
5187
5198
|
},
|
|
5188
5199
|
/* @__PURE__ */ import_react61.default.createElement(
|
|
5189
|
-
|
|
5200
|
+
Card.Media,
|
|
5190
5201
|
{
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5202
|
+
className: mediaClassName,
|
|
5203
|
+
style: { aspectRatio: resolveAspectRatio(aspectRatio) }
|
|
5204
|
+
},
|
|
5205
|
+
src && /* @__PURE__ */ import_react61.default.createElement(
|
|
5206
|
+
"img",
|
|
5207
|
+
{
|
|
5208
|
+
src,
|
|
5209
|
+
alt,
|
|
5210
|
+
className: cx(
|
|
5211
|
+
"w-full h-full",
|
|
5212
|
+
objectFit === "cover" ? "object-cover" : "object-contain"
|
|
5213
|
+
)
|
|
5214
|
+
}
|
|
5215
|
+
),
|
|
5216
|
+
overlay && /* @__PURE__ */ import_react61.default.createElement(
|
|
5217
|
+
"div",
|
|
5218
|
+
{
|
|
5219
|
+
className: "absolute inset-0 bg-obsidian/80 opacity-0 group-hover:opacity-100 transition-opacity duration-200 flex items-center justify-center"
|
|
5220
|
+
},
|
|
5221
|
+
overlay
|
|
5222
|
+
)
|
|
5200
5223
|
),
|
|
5201
|
-
|
|
5202
|
-
|
|
5224
|
+
/* @__PURE__ */ import_react61.default.createElement(
|
|
5225
|
+
Card.Header,
|
|
5203
5226
|
{
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5227
|
+
title,
|
|
5228
|
+
subtitle,
|
|
5229
|
+
className: contentClassName
|
|
5230
|
+
}
|
|
5231
|
+
),
|
|
5232
|
+
children && /* @__PURE__ */ import_react61.default.createElement(Card.Body, { className: contentClassName }, children)
|
|
5233
|
+
);
|
|
5209
5234
|
}
|
|
5210
5235
|
);
|
|
5211
5236
|
ImageCard.displayName = "ImageCard";
|
|
5212
5237
|
|
|
5213
5238
|
// src/components/VideoCard.tsx
|
|
5214
5239
|
var import_react62 = __toESM(require("react"));
|
|
5215
|
-
var
|
|
5240
|
+
var import_react_player = __toESM(require("react-player"));
|
|
5216
5241
|
var ASPECT_RATIO_PRESETS2 = {
|
|
5217
5242
|
video: "16 / 9",
|
|
5218
5243
|
cinema: "21 / 9",
|
|
@@ -5241,48 +5266,57 @@ var VideoCard = import_react62.default.forwardRef(
|
|
|
5241
5266
|
className,
|
|
5242
5267
|
children,
|
|
5243
5268
|
playerProps,
|
|
5269
|
+
isLoading,
|
|
5244
5270
|
...props
|
|
5245
5271
|
}, ref) => {
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
"div",
|
|
5272
|
+
return /* @__PURE__ */ import_react62.default.createElement(
|
|
5273
|
+
Card,
|
|
5249
5274
|
{
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
style: { aspectRatio: resolveAspectRatio2(aspectRatio) }
|
|
5275
|
+
ref,
|
|
5276
|
+
className: cx("p-0 overflow-hidden w-full", className),
|
|
5277
|
+
isLoading,
|
|
5278
|
+
...props
|
|
5255
5279
|
},
|
|
5256
5280
|
/* @__PURE__ */ import_react62.default.createElement(
|
|
5257
|
-
|
|
5281
|
+
Card.Media,
|
|
5258
5282
|
{
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5283
|
+
className: mediaClassName,
|
|
5284
|
+
style: { aspectRatio: resolveAspectRatio2(aspectRatio) }
|
|
5285
|
+
},
|
|
5286
|
+
src && /* @__PURE__ */ import_react62.default.createElement(
|
|
5287
|
+
import_react_player.default,
|
|
5288
|
+
{
|
|
5289
|
+
src,
|
|
5290
|
+
playing,
|
|
5291
|
+
controls,
|
|
5292
|
+
light,
|
|
5293
|
+
volume,
|
|
5294
|
+
muted,
|
|
5295
|
+
loop,
|
|
5296
|
+
width: "100%",
|
|
5297
|
+
height: "100%",
|
|
5298
|
+
className: "absolute top-0 left-0",
|
|
5299
|
+
...playerProps
|
|
5300
|
+
}
|
|
5301
|
+
)
|
|
5302
|
+
),
|
|
5303
|
+
/* @__PURE__ */ import_react62.default.createElement(
|
|
5304
|
+
Card.Header,
|
|
5305
|
+
{
|
|
5306
|
+
title,
|
|
5307
|
+
subtitle,
|
|
5308
|
+
className: contentClassName
|
|
5270
5309
|
}
|
|
5271
|
-
)
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
{
|
|
5275
|
-
className: "text-sm text-silver leading-normal mt-1"
|
|
5276
|
-
},
|
|
5277
|
-
subtitle
|
|
5278
|
-
), children));
|
|
5310
|
+
),
|
|
5311
|
+
children && /* @__PURE__ */ import_react62.default.createElement(Card.Body, { className: contentClassName }, children)
|
|
5312
|
+
);
|
|
5279
5313
|
}
|
|
5280
5314
|
);
|
|
5281
5315
|
VideoCard.displayName = "VideoCard";
|
|
5282
5316
|
|
|
5283
5317
|
// src/components/AudioCard.tsx
|
|
5284
5318
|
var import_react63 = __toESM(require("react"));
|
|
5285
|
-
var
|
|
5319
|
+
var import_react_player2 = __toESM(require("react-player"));
|
|
5286
5320
|
var import_lucide_react12 = require("lucide-react");
|
|
5287
5321
|
var AudioCard = import_react63.default.forwardRef(
|
|
5288
5322
|
({
|
|
@@ -5300,19 +5334,22 @@ var AudioCard = import_react63.default.forwardRef(
|
|
|
5300
5334
|
children,
|
|
5301
5335
|
playerProps,
|
|
5302
5336
|
height = "40px",
|
|
5337
|
+
isLoading,
|
|
5303
5338
|
...props
|
|
5304
5339
|
}, ref) => {
|
|
5305
|
-
return /* @__PURE__ */ import_react63.default.createElement(
|
|
5306
|
-
|
|
5340
|
+
return /* @__PURE__ */ import_react63.default.createElement(
|
|
5341
|
+
Card,
|
|
5307
5342
|
{
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5343
|
+
ref,
|
|
5344
|
+
className: cx("p-0 overflow-hidden w-full", className),
|
|
5345
|
+
isLoading,
|
|
5346
|
+
...props
|
|
5312
5347
|
},
|
|
5313
|
-
/* @__PURE__ */ import_react63.default.createElement(
|
|
5314
|
-
|
|
5315
|
-
|
|
5348
|
+
/* @__PURE__ */ import_react63.default.createElement(Card.Media, { className: cx(
|
|
5349
|
+
"bg-obsidian py-8 flex flex-col items-center justify-center",
|
|
5350
|
+
mediaClassName
|
|
5351
|
+
) }, /* @__PURE__ */ import_react63.default.createElement("div", { className: "mb-4 text-gold" }, /* @__PURE__ */ import_react63.default.createElement(import_lucide_react12.Music, { size: 48 })), src && /* @__PURE__ */ import_react63.default.createElement("div", { className: "w-full px-4" }, /* @__PURE__ */ import_react63.default.createElement(
|
|
5352
|
+
import_react_player2.default,
|
|
5316
5353
|
{
|
|
5317
5354
|
src,
|
|
5318
5355
|
playing,
|
|
@@ -5333,130 +5370,296 @@ var AudioCard = import_react63.default.forwardRef(
|
|
|
5333
5370
|
},
|
|
5334
5371
|
...playerProps
|
|
5335
5372
|
}
|
|
5336
|
-
))
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5373
|
+
))),
|
|
5374
|
+
/* @__PURE__ */ import_react63.default.createElement(
|
|
5375
|
+
Card.Header,
|
|
5376
|
+
{
|
|
5377
|
+
title,
|
|
5378
|
+
subtitle,
|
|
5379
|
+
className: contentClassName
|
|
5380
|
+
}
|
|
5381
|
+
),
|
|
5382
|
+
children && /* @__PURE__ */ import_react63.default.createElement(Card.Body, { className: contentClassName }, children)
|
|
5383
|
+
);
|
|
5384
|
+
}
|
|
5385
|
+
);
|
|
5386
|
+
AudioCard.displayName = "AudioCard";
|
|
5387
|
+
|
|
5388
|
+
// src/components/PdfCard.tsx
|
|
5389
|
+
var import_react64 = __toESM(require("react"));
|
|
5390
|
+
var import_lucide_react13 = require("lucide-react");
|
|
5391
|
+
var PdfCard = import_react64.default.forwardRef(
|
|
5392
|
+
({
|
|
5393
|
+
src,
|
|
5394
|
+
title,
|
|
5395
|
+
subtitle,
|
|
5396
|
+
height = "400px",
|
|
5397
|
+
mediaClassName,
|
|
5398
|
+
contentClassName,
|
|
5399
|
+
className,
|
|
5400
|
+
children,
|
|
5401
|
+
isLoading,
|
|
5402
|
+
...props
|
|
5403
|
+
}, ref) => {
|
|
5404
|
+
return /* @__PURE__ */ import_react64.default.createElement(
|
|
5405
|
+
Card,
|
|
5345
5406
|
{
|
|
5346
|
-
|
|
5407
|
+
ref,
|
|
5408
|
+
className: cx("p-0 overflow-hidden w-full", className),
|
|
5409
|
+
isLoading,
|
|
5410
|
+
...props
|
|
5347
5411
|
},
|
|
5348
|
-
|
|
5349
|
-
|
|
5412
|
+
/* @__PURE__ */ import_react64.default.createElement(
|
|
5413
|
+
Card.Media,
|
|
5414
|
+
{
|
|
5415
|
+
className: cx("bg-obsidian", mediaClassName),
|
|
5416
|
+
style: { height }
|
|
5417
|
+
},
|
|
5418
|
+
src && /* @__PURE__ */ import_react64.default.createElement(
|
|
5419
|
+
"iframe",
|
|
5420
|
+
{
|
|
5421
|
+
src: `${src}#view=FitH`,
|
|
5422
|
+
title: typeof title === "string" ? title : "PDF Document",
|
|
5423
|
+
className: "w-full h-full border-0"
|
|
5424
|
+
}
|
|
5425
|
+
)
|
|
5426
|
+
),
|
|
5427
|
+
/* @__PURE__ */ import_react64.default.createElement(
|
|
5428
|
+
Card.Header,
|
|
5429
|
+
{
|
|
5430
|
+
title,
|
|
5431
|
+
subtitle,
|
|
5432
|
+
className: contentClassName,
|
|
5433
|
+
action: /* @__PURE__ */ import_react64.default.createElement("div", { className: "p-2 bg-ash/20 text-gold shrink-0" }, /* @__PURE__ */ import_react64.default.createElement(import_lucide_react13.FileText, { size: 20 }))
|
|
5434
|
+
}
|
|
5435
|
+
),
|
|
5436
|
+
children && /* @__PURE__ */ import_react64.default.createElement(Card.Body, { className: contentClassName }, children)
|
|
5437
|
+
);
|
|
5350
5438
|
}
|
|
5351
5439
|
);
|
|
5352
|
-
|
|
5440
|
+
PdfCard.displayName = "PdfCard";
|
|
5353
5441
|
|
|
5354
5442
|
// src/components/ScriptCard.tsx
|
|
5355
|
-
var
|
|
5443
|
+
var import_react65 = __toESM(require("react"));
|
|
5356
5444
|
function ScriptElementRenderer({ element }) {
|
|
5357
5445
|
switch (element.type) {
|
|
5358
5446
|
case "scene-heading":
|
|
5359
|
-
return /* @__PURE__ */
|
|
5447
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "mt-4 mb-2 font-bold uppercase text-gold text-xs tracking-wide" }, element.content);
|
|
5360
5448
|
case "action":
|
|
5361
|
-
return /* @__PURE__ */
|
|
5449
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "my-2 text-silver text-xs leading-relaxed" }, element.content);
|
|
5362
5450
|
case "character":
|
|
5363
|
-
return /* @__PURE__ */
|
|
5451
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "mt-4 mb-0.5 ml-8 font-bold text-white text-xs uppercase tracking-wide" }, element.content);
|
|
5364
5452
|
case "parenthetical":
|
|
5365
|
-
return /* @__PURE__ */
|
|
5453
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "ml-6 text-silver/70 text-xs italic" }, "(", element.content, ")");
|
|
5366
5454
|
case "dialogue":
|
|
5367
|
-
return /* @__PURE__ */
|
|
5455
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "ml-4 mr-8 text-silver text-xs leading-relaxed" }, element.content);
|
|
5368
5456
|
case "transition":
|
|
5369
|
-
return /* @__PURE__ */
|
|
5457
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "mt-4 mb-2 text-right font-bold uppercase text-gold/80 text-xs tracking-wide" }, element.content);
|
|
5370
5458
|
case "title":
|
|
5371
|
-
return /* @__PURE__ */
|
|
5459
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "mt-6 mb-2 text-center font-bold text-gold text-sm" }, element.content);
|
|
5372
5460
|
case "subtitle":
|
|
5373
|
-
return /* @__PURE__ */
|
|
5461
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-center italic text-gold/70 text-xs" }, element.content);
|
|
5374
5462
|
default:
|
|
5375
5463
|
return null;
|
|
5376
5464
|
}
|
|
5377
5465
|
}
|
|
5378
|
-
var ScriptCard =
|
|
5379
|
-
({ title, subtitle, elements, maxHeight = "16rem", className, style, ...rest }, ref) => {
|
|
5380
|
-
return /* @__PURE__ */
|
|
5381
|
-
|
|
5466
|
+
var ScriptCard = import_react65.default.forwardRef(
|
|
5467
|
+
({ title, subtitle, elements, maxHeight = "16rem", className, style, isLoading, ...rest }, ref) => {
|
|
5468
|
+
return /* @__PURE__ */ import_react65.default.createElement(
|
|
5469
|
+
Card,
|
|
5382
5470
|
{
|
|
5383
5471
|
ref,
|
|
5384
|
-
className: cx(
|
|
5385
|
-
|
|
5386
|
-
className
|
|
5387
|
-
),
|
|
5472
|
+
className: cx("p-0 overflow-hidden w-full", className),
|
|
5473
|
+
isLoading,
|
|
5388
5474
|
...rest
|
|
5389
5475
|
},
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5476
|
+
/* @__PURE__ */ import_react65.default.createElement(
|
|
5477
|
+
Card.Header,
|
|
5478
|
+
{
|
|
5479
|
+
title,
|
|
5480
|
+
subtitle
|
|
5481
|
+
}
|
|
5482
|
+
),
|
|
5483
|
+
/* @__PURE__ */ import_react65.default.createElement(
|
|
5484
|
+
Card.Body,
|
|
5393
5485
|
{
|
|
5394
|
-
className: "
|
|
5486
|
+
className: "font-mono overflow-y-auto",
|
|
5395
5487
|
style: { maxHeight, ...style }
|
|
5396
5488
|
},
|
|
5397
|
-
elements.map((element, index) => /* @__PURE__ */
|
|
5489
|
+
elements.map((element, index) => /* @__PURE__ */ import_react65.default.createElement(ScriptElementRenderer, { key: index, element }))
|
|
5398
5490
|
)
|
|
5399
5491
|
);
|
|
5400
5492
|
}
|
|
5401
5493
|
);
|
|
5402
5494
|
ScriptCard.displayName = "ScriptCard";
|
|
5403
5495
|
|
|
5404
|
-
// src/components/
|
|
5405
|
-
var
|
|
5406
|
-
var
|
|
5407
|
-
var PdfCard = import_react65.default.forwardRef(
|
|
5496
|
+
// src/components/TextCard.tsx
|
|
5497
|
+
var import_react66 = __toESM(require("react"));
|
|
5498
|
+
var TextCard = import_react66.default.forwardRef(
|
|
5408
5499
|
({
|
|
5409
|
-
|
|
5500
|
+
content,
|
|
5410
5501
|
title,
|
|
5411
5502
|
subtitle,
|
|
5412
|
-
|
|
5413
|
-
|
|
5503
|
+
isMarkdown = true,
|
|
5504
|
+
maxHeight = "16rem",
|
|
5414
5505
|
contentClassName,
|
|
5415
5506
|
className,
|
|
5416
|
-
|
|
5507
|
+
isLoading,
|
|
5417
5508
|
...props
|
|
5418
5509
|
}, ref) => {
|
|
5419
|
-
return /* @__PURE__ */
|
|
5420
|
-
|
|
5510
|
+
return /* @__PURE__ */ import_react66.default.createElement(
|
|
5511
|
+
Card,
|
|
5421
5512
|
{
|
|
5422
|
-
|
|
5423
|
-
|
|
5513
|
+
ref,
|
|
5514
|
+
className: cx("p-0 overflow-hidden w-full", className),
|
|
5515
|
+
isLoading,
|
|
5516
|
+
...props
|
|
5424
5517
|
},
|
|
5425
|
-
/* @__PURE__ */
|
|
5426
|
-
|
|
5518
|
+
/* @__PURE__ */ import_react66.default.createElement(
|
|
5519
|
+
Card.Header,
|
|
5427
5520
|
{
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
className: "w-full h-full border-0"
|
|
5521
|
+
title,
|
|
5522
|
+
subtitle
|
|
5431
5523
|
}
|
|
5524
|
+
),
|
|
5525
|
+
/* @__PURE__ */ import_react66.default.createElement(
|
|
5526
|
+
Card.Body,
|
|
5527
|
+
{
|
|
5528
|
+
className: cx("overflow-y-auto", contentClassName),
|
|
5529
|
+
style: { maxHeight }
|
|
5530
|
+
},
|
|
5531
|
+
/* @__PURE__ */ import_react66.default.createElement(
|
|
5532
|
+
MarkdownContent,
|
|
5533
|
+
{
|
|
5534
|
+
content,
|
|
5535
|
+
isMarkdown,
|
|
5536
|
+
className: "prose-sm prose-invert max-w-none"
|
|
5537
|
+
}
|
|
5538
|
+
)
|
|
5432
5539
|
)
|
|
5433
|
-
)
|
|
5540
|
+
);
|
|
5434
5541
|
}
|
|
5435
5542
|
);
|
|
5436
|
-
|
|
5543
|
+
TextCard.displayName = "TextCard";
|
|
5437
5544
|
|
|
5438
|
-
// src/components/
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5545
|
+
// src/components/ArtifactCard.tsx
|
|
5546
|
+
var ArtifactCard = import_react67.default.forwardRef(
|
|
5547
|
+
({ artifact, onExpand, isLoading, className, ...props }, ref) => {
|
|
5548
|
+
const commonProps = {
|
|
5549
|
+
title: artifact.title,
|
|
5550
|
+
subtitle: artifact.subtitle,
|
|
5551
|
+
isLoading: isLoading || artifact.isPending,
|
|
5552
|
+
className: "w-full"
|
|
5553
|
+
};
|
|
5554
|
+
const handleExpand = (e) => {
|
|
5555
|
+
e.stopPropagation();
|
|
5556
|
+
if (onExpand) {
|
|
5557
|
+
onExpand(artifact);
|
|
5558
|
+
}
|
|
5559
|
+
};
|
|
5560
|
+
const renderContent = () => {
|
|
5561
|
+
switch (artifact.type) {
|
|
5562
|
+
case "IMAGE":
|
|
5563
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5564
|
+
ImageCard,
|
|
5565
|
+
{
|
|
5566
|
+
...commonProps,
|
|
5567
|
+
src: artifact.url,
|
|
5568
|
+
alt: artifact.alt,
|
|
5569
|
+
aspectRatio: "landscape"
|
|
5570
|
+
}
|
|
5571
|
+
);
|
|
5572
|
+
case "VIDEO":
|
|
5573
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5574
|
+
VideoCard,
|
|
5575
|
+
{
|
|
5576
|
+
...commonProps,
|
|
5577
|
+
src: artifact.url,
|
|
5578
|
+
aspectRatio: "video",
|
|
5579
|
+
controls: true
|
|
5580
|
+
}
|
|
5581
|
+
);
|
|
5582
|
+
case "AUDIO":
|
|
5583
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5584
|
+
AudioCard,
|
|
5585
|
+
{
|
|
5586
|
+
...commonProps,
|
|
5587
|
+
src: artifact.url,
|
|
5588
|
+
controls: true
|
|
5589
|
+
}
|
|
5590
|
+
);
|
|
5591
|
+
case "PDF":
|
|
5592
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5593
|
+
PdfCard,
|
|
5594
|
+
{
|
|
5595
|
+
...commonProps,
|
|
5596
|
+
src: artifact.url
|
|
5597
|
+
}
|
|
5598
|
+
);
|
|
5599
|
+
case "SCRIPT":
|
|
5600
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5601
|
+
ScriptCard,
|
|
5602
|
+
{
|
|
5603
|
+
...commonProps,
|
|
5604
|
+
elements: artifact.scriptElements || [],
|
|
5605
|
+
maxHeight: "16rem"
|
|
5606
|
+
}
|
|
5607
|
+
);
|
|
5608
|
+
case "TEXT":
|
|
5609
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5610
|
+
TextCard,
|
|
5611
|
+
{
|
|
5612
|
+
...commonProps,
|
|
5613
|
+
content: artifact.inlineContent || "",
|
|
5614
|
+
isMarkdown: artifact.mimeType !== "text/plain",
|
|
5615
|
+
contentClassName: cx(
|
|
5616
|
+
artifact.mimeType === "text/plain" && "whitespace-pre-wrap"
|
|
5617
|
+
)
|
|
5618
|
+
}
|
|
5619
|
+
);
|
|
5620
|
+
default:
|
|
5621
|
+
return null;
|
|
5622
|
+
}
|
|
5623
|
+
};
|
|
5624
|
+
const isCardExpandable = !!onExpand && (artifact.type === "IMAGE" || artifact.type === "PDF" || artifact.type === "SCRIPT" || artifact.type === "TEXT");
|
|
5625
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5626
|
+
"div",
|
|
5627
|
+
{
|
|
5628
|
+
ref,
|
|
5629
|
+
className: cx(
|
|
5630
|
+
"relative group",
|
|
5631
|
+
isCardExpandable && "cursor-pointer",
|
|
5632
|
+
artifact.fullWidth && "col-span-full",
|
|
5633
|
+
className
|
|
5634
|
+
),
|
|
5635
|
+
onClick: isCardExpandable ? handleExpand : void 0,
|
|
5636
|
+
...props
|
|
5637
|
+
},
|
|
5638
|
+
onExpand && /* @__PURE__ */ import_react67.default.createElement(
|
|
5639
|
+
"button",
|
|
5640
|
+
{
|
|
5641
|
+
onClick: handleExpand,
|
|
5642
|
+
className: cx(
|
|
5643
|
+
"absolute top-2 right-2 z-10 p-1.5",
|
|
5644
|
+
"bg-obsidian/80 text-silver hover:text-white hover:bg-obsidian",
|
|
5645
|
+
"opacity-0 group-hover:opacity-100 transition-opacity"
|
|
5646
|
+
),
|
|
5647
|
+
"aria-label": "Expand artifact"
|
|
5648
|
+
},
|
|
5649
|
+
/* @__PURE__ */ import_react67.default.createElement(ExpandIcon, { className: "w-4 h-4" })
|
|
5650
|
+
),
|
|
5651
|
+
renderContent()
|
|
5652
|
+
);
|
|
5452
5653
|
}
|
|
5453
|
-
|
|
5454
|
-
|
|
5654
|
+
);
|
|
5655
|
+
ArtifactCard.displayName = "ArtifactCard";
|
|
5656
|
+
|
|
5657
|
+
// src/components/chat/ArtifactsPanel.tsx
|
|
5455
5658
|
function ArtifactModal({
|
|
5456
5659
|
artifact,
|
|
5457
5660
|
onClose
|
|
5458
5661
|
}) {
|
|
5459
|
-
(0,
|
|
5662
|
+
(0, import_react68.useEffect)(() => {
|
|
5460
5663
|
const handleKeyDown = (e) => {
|
|
5461
5664
|
if (e.key === "Escape") {
|
|
5462
5665
|
onClose();
|
|
@@ -5465,46 +5668,46 @@ function ArtifactModal({
|
|
|
5465
5668
|
document.addEventListener("keydown", handleKeyDown);
|
|
5466
5669
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
5467
5670
|
}, [onClose]);
|
|
5468
|
-
const handleBackdropClick = (0,
|
|
5671
|
+
const handleBackdropClick = (0, import_react68.useCallback)((e) => {
|
|
5469
5672
|
if (e.target === e.currentTarget) {
|
|
5470
5673
|
onClose();
|
|
5471
5674
|
}
|
|
5472
5675
|
}, [onClose]);
|
|
5473
|
-
return /* @__PURE__ */
|
|
5676
|
+
return /* @__PURE__ */ import_react68.default.createElement(
|
|
5474
5677
|
"div",
|
|
5475
5678
|
{
|
|
5476
5679
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-void/90 backdrop-blur-sm animate-fade-in",
|
|
5477
5680
|
onClick: handleBackdropClick
|
|
5478
5681
|
},
|
|
5479
|
-
/* @__PURE__ */
|
|
5682
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5480
5683
|
"div",
|
|
5481
5684
|
{
|
|
5482
5685
|
className: "relative w-11/12 h-5/6 max-w-6xl bg-charcoal border border-ash/40 flex flex-col overflow-hidden"
|
|
5483
5686
|
},
|
|
5484
|
-
/* @__PURE__ */
|
|
5687
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5485
5688
|
"div",
|
|
5486
5689
|
{
|
|
5487
5690
|
className: "flex items-center justify-between p-4 border-b border-ash/40 shrink-0"
|
|
5488
5691
|
},
|
|
5489
|
-
/* @__PURE__ */
|
|
5490
|
-
/* @__PURE__ */
|
|
5692
|
+
/* @__PURE__ */ import_react68.default.createElement("div", null, artifact.title && /* @__PURE__ */ import_react68.default.createElement("h3", { className: "text-sm font-semibold text-white" }, artifact.title), artifact.subtitle && /* @__PURE__ */ import_react68.default.createElement("p", { className: "text-xs text-silver" }, artifact.subtitle)),
|
|
5693
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5491
5694
|
"button",
|
|
5492
5695
|
{
|
|
5493
5696
|
onClick: onClose,
|
|
5494
5697
|
className: "p-2 text-silver hover:text-white hover:bg-ash/20 transition-colors",
|
|
5495
5698
|
"aria-label": "Close modal"
|
|
5496
5699
|
},
|
|
5497
|
-
/* @__PURE__ */
|
|
5700
|
+
/* @__PURE__ */ import_react68.default.createElement(CloseIcon, { className: "w-5 h-5" })
|
|
5498
5701
|
)
|
|
5499
5702
|
),
|
|
5500
|
-
/* @__PURE__ */
|
|
5703
|
+
/* @__PURE__ */ import_react68.default.createElement("div", { className: "flex-1 overflow-auto p-4" }, artifact.type === "IMAGE" && /* @__PURE__ */ import_react68.default.createElement(
|
|
5501
5704
|
"img",
|
|
5502
5705
|
{
|
|
5503
5706
|
src: artifact.url,
|
|
5504
5707
|
alt: artifact.alt || "Artifact image",
|
|
5505
5708
|
className: "max-w-full max-h-full object-contain mx-auto"
|
|
5506
5709
|
}
|
|
5507
|
-
), artifact.type === "VIDEO" && /* @__PURE__ */
|
|
5710
|
+
), artifact.type === "VIDEO" && /* @__PURE__ */ import_react68.default.createElement(
|
|
5508
5711
|
VideoCard,
|
|
5509
5712
|
{
|
|
5510
5713
|
src: artifact.url || "",
|
|
@@ -5512,20 +5715,20 @@ function ArtifactModal({
|
|
|
5512
5715
|
controls: true,
|
|
5513
5716
|
className: "max-w-full max-h-full mx-auto"
|
|
5514
5717
|
}
|
|
5515
|
-
), artifact.type === "AUDIO" && /* @__PURE__ */
|
|
5718
|
+
), artifact.type === "AUDIO" && /* @__PURE__ */ import_react68.default.createElement(
|
|
5516
5719
|
AudioCard,
|
|
5517
5720
|
{
|
|
5518
5721
|
src: artifact.url || "",
|
|
5519
5722
|
controls: true,
|
|
5520
5723
|
className: "max-w-xl mx-auto"
|
|
5521
5724
|
}
|
|
5522
|
-
), artifact.type === "PDF" && /* @__PURE__ */
|
|
5725
|
+
), artifact.type === "PDF" && /* @__PURE__ */ import_react68.default.createElement(
|
|
5523
5726
|
PdfCard,
|
|
5524
5727
|
{
|
|
5525
|
-
|
|
5728
|
+
src: artifact.url || "",
|
|
5526
5729
|
className: "h-full border-0"
|
|
5527
5730
|
}
|
|
5528
|
-
), artifact.type === "TEXT" && /* @__PURE__ */
|
|
5731
|
+
), artifact.type === "TEXT" && /* @__PURE__ */ import_react68.default.createElement(
|
|
5529
5732
|
MarkdownContent,
|
|
5530
5733
|
{
|
|
5531
5734
|
content: artifact.inlineContent || "",
|
|
@@ -5535,7 +5738,7 @@ function ArtifactModal({
|
|
|
5535
5738
|
artifact.mimeType === "text/plain" && "whitespace-pre-wrap"
|
|
5536
5739
|
)
|
|
5537
5740
|
}
|
|
5538
|
-
), artifact.type === "SCRIPT" && artifact.scriptElements && /* @__PURE__ */
|
|
5741
|
+
), artifact.type === "SCRIPT" && artifact.scriptElements && /* @__PURE__ */ import_react68.default.createElement(
|
|
5539
5742
|
ScriptCard,
|
|
5540
5743
|
{
|
|
5541
5744
|
elements: artifact.scriptElements,
|
|
@@ -5551,152 +5754,16 @@ function ArtifactRenderer({
|
|
|
5551
5754
|
isLoading,
|
|
5552
5755
|
onExpand
|
|
5553
5756
|
}) {
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
(0, import_react66.useEffect)(() => {
|
|
5557
|
-
setImageLoaded(false);
|
|
5558
|
-
setMinDelayPassed(false);
|
|
5559
|
-
const timer = setTimeout(() => {
|
|
5560
|
-
setMinDelayPassed(true);
|
|
5561
|
-
}, 800);
|
|
5562
|
-
return () => clearTimeout(timer);
|
|
5563
|
-
}, [artifact.url, artifact.id]);
|
|
5564
|
-
const fullWidthClass = artifact.fullWidth ? "col-span-full" : "";
|
|
5565
|
-
if (isLoading || artifact.isPending) {
|
|
5566
|
-
return /* @__PURE__ */ import_react66.default.createElement(ArtifactSkeleton, { type: artifact.type, fullWidth: artifact.fullWidth });
|
|
5567
|
-
}
|
|
5568
|
-
const showContent = artifact.type !== "IMAGE" || imageLoaded && minDelayPassed;
|
|
5569
|
-
const expandButton = onExpand && /* @__PURE__ */ import_react66.default.createElement(
|
|
5570
|
-
"button",
|
|
5757
|
+
return /* @__PURE__ */ import_react68.default.createElement(
|
|
5758
|
+
ArtifactCard,
|
|
5571
5759
|
{
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
className: cx(
|
|
5577
|
-
"absolute top-2 right-2 z-10 p-1.5",
|
|
5578
|
-
"bg-obsidian/80 text-silver hover:text-white hover:bg-obsidian",
|
|
5579
|
-
"opacity-0 group-hover:opacity-100 transition-opacity"
|
|
5580
|
-
),
|
|
5581
|
-
"aria-label": "Expand artifact"
|
|
5582
|
-
},
|
|
5583
|
-
/* @__PURE__ */ import_react66.default.createElement(ExpandIcon, { className: "w-4 h-4" })
|
|
5760
|
+
artifact,
|
|
5761
|
+
isLoading,
|
|
5762
|
+
onExpand
|
|
5763
|
+
}
|
|
5584
5764
|
);
|
|
5585
|
-
switch (artifact.type) {
|
|
5586
|
-
case "IMAGE":
|
|
5587
|
-
return /* @__PURE__ */ import_react66.default.createElement(
|
|
5588
|
-
"div",
|
|
5589
|
-
{
|
|
5590
|
-
className: cx("relative group cursor-pointer", fullWidthClass),
|
|
5591
|
-
onClick: onExpand
|
|
5592
|
-
},
|
|
5593
|
-
!showContent && /* @__PURE__ */ import_react66.default.createElement(ArtifactSkeleton, { type: "IMAGE" }),
|
|
5594
|
-
expandButton,
|
|
5595
|
-
/* @__PURE__ */ import_react66.default.createElement(
|
|
5596
|
-
ImageCard,
|
|
5597
|
-
{
|
|
5598
|
-
src: artifact.url || "",
|
|
5599
|
-
alt: artifact.alt || "Artifact image",
|
|
5600
|
-
title: artifact.title,
|
|
5601
|
-
subtitle: artifact.subtitle,
|
|
5602
|
-
aspectRatio: "landscape",
|
|
5603
|
-
className: cx(
|
|
5604
|
-
"w-full transition-opacity duration-300",
|
|
5605
|
-
showContent ? "opacity-100" : "opacity-0 absolute inset-0"
|
|
5606
|
-
),
|
|
5607
|
-
onLoad: () => setImageLoaded(true)
|
|
5608
|
-
}
|
|
5609
|
-
)
|
|
5610
|
-
);
|
|
5611
|
-
case "VIDEO":
|
|
5612
|
-
return /* @__PURE__ */ import_react66.default.createElement("div", { className: cx("relative group", fullWidthClass) }, expandButton, /* @__PURE__ */ import_react66.default.createElement(
|
|
5613
|
-
VideoCard,
|
|
5614
|
-
{
|
|
5615
|
-
src: artifact.url || "",
|
|
5616
|
-
title: artifact.title,
|
|
5617
|
-
subtitle: artifact.subtitle,
|
|
5618
|
-
aspectRatio: "video",
|
|
5619
|
-
controls: true,
|
|
5620
|
-
className: "w-full"
|
|
5621
|
-
}
|
|
5622
|
-
));
|
|
5623
|
-
case "AUDIO":
|
|
5624
|
-
return /* @__PURE__ */ import_react66.default.createElement("div", { className: cx("relative group", fullWidthClass) }, expandButton, /* @__PURE__ */ import_react66.default.createElement(
|
|
5625
|
-
AudioCard,
|
|
5626
|
-
{
|
|
5627
|
-
src: artifact.url || "",
|
|
5628
|
-
title: artifact.title,
|
|
5629
|
-
subtitle: artifact.subtitle,
|
|
5630
|
-
controls: true,
|
|
5631
|
-
className: "w-full"
|
|
5632
|
-
}
|
|
5633
|
-
));
|
|
5634
|
-
case "PDF":
|
|
5635
|
-
return /* @__PURE__ */ import_react66.default.createElement(
|
|
5636
|
-
"div",
|
|
5637
|
-
{
|
|
5638
|
-
className: cx("relative group cursor-pointer", fullWidthClass),
|
|
5639
|
-
onClick: onExpand
|
|
5640
|
-
},
|
|
5641
|
-
expandButton,
|
|
5642
|
-
/* @__PURE__ */ import_react66.default.createElement(
|
|
5643
|
-
PdfCard,
|
|
5644
|
-
{
|
|
5645
|
-
url: artifact.url || "",
|
|
5646
|
-
title: artifact.title,
|
|
5647
|
-
subtitle: artifact.subtitle,
|
|
5648
|
-
className: "w-full"
|
|
5649
|
-
}
|
|
5650
|
-
)
|
|
5651
|
-
);
|
|
5652
|
-
case "SCRIPT":
|
|
5653
|
-
return /* @__PURE__ */ import_react66.default.createElement(
|
|
5654
|
-
"div",
|
|
5655
|
-
{
|
|
5656
|
-
className: cx("relative group cursor-pointer", fullWidthClass),
|
|
5657
|
-
onClick: onExpand
|
|
5658
|
-
},
|
|
5659
|
-
expandButton,
|
|
5660
|
-
/* @__PURE__ */ import_react66.default.createElement(
|
|
5661
|
-
ScriptCard,
|
|
5662
|
-
{
|
|
5663
|
-
title: artifact.title,
|
|
5664
|
-
subtitle: artifact.subtitle,
|
|
5665
|
-
elements: artifact.scriptElements || [],
|
|
5666
|
-
maxHeight: "16rem",
|
|
5667
|
-
className: "w-full"
|
|
5668
|
-
}
|
|
5669
|
-
)
|
|
5670
|
-
);
|
|
5671
|
-
case "TEXT":
|
|
5672
|
-
return /* @__PURE__ */ import_react66.default.createElement(
|
|
5673
|
-
"div",
|
|
5674
|
-
{
|
|
5675
|
-
className: cx(
|
|
5676
|
-
"relative group cursor-pointer p-4 bg-charcoal border border-ash/40",
|
|
5677
|
-
fullWidthClass
|
|
5678
|
-
),
|
|
5679
|
-
onClick: onExpand
|
|
5680
|
-
},
|
|
5681
|
-
expandButton,
|
|
5682
|
-
artifact.title && /* @__PURE__ */ import_react66.default.createElement("h4", { className: "text-sm font-semibold text-white mb-2" }, artifact.title),
|
|
5683
|
-
/* @__PURE__ */ import_react66.default.createElement(
|
|
5684
|
-
MarkdownContent,
|
|
5685
|
-
{
|
|
5686
|
-
content: artifact.inlineContent || "",
|
|
5687
|
-
isMarkdown: artifact.mimeType === "text/markdown",
|
|
5688
|
-
className: cx(
|
|
5689
|
-
"prose-sm prose-invert max-h-48 overflow-y-auto",
|
|
5690
|
-
artifact.mimeType === "text/plain" && "whitespace-pre-wrap"
|
|
5691
|
-
)
|
|
5692
|
-
}
|
|
5693
|
-
)
|
|
5694
|
-
);
|
|
5695
|
-
default:
|
|
5696
|
-
return null;
|
|
5697
|
-
}
|
|
5698
5765
|
}
|
|
5699
|
-
var ArtifactsPanel =
|
|
5766
|
+
var ArtifactsPanel = import_react68.default.forwardRef(
|
|
5700
5767
|
({
|
|
5701
5768
|
artifacts,
|
|
5702
5769
|
isOpen = false,
|
|
@@ -5708,10 +5775,10 @@ var ArtifactsPanel = import_react66.default.forwardRef(
|
|
|
5708
5775
|
className,
|
|
5709
5776
|
...rest
|
|
5710
5777
|
}, ref) => {
|
|
5711
|
-
const [expandedArtifact, setExpandedArtifact] = (0,
|
|
5778
|
+
const [expandedArtifact, setExpandedArtifact] = (0, import_react68.useState)(null);
|
|
5712
5779
|
const columns = widthPercent && widthPercent > 55 ? 3 : widthPercent && widthPercent > 35 ? 2 : 1;
|
|
5713
5780
|
if (!isOpen) {
|
|
5714
|
-
return /* @__PURE__ */
|
|
5781
|
+
return /* @__PURE__ */ import_react68.default.createElement(
|
|
5715
5782
|
"div",
|
|
5716
5783
|
{
|
|
5717
5784
|
ref,
|
|
@@ -5722,7 +5789,7 @@ var ArtifactsPanel = import_react66.default.forwardRef(
|
|
|
5722
5789
|
),
|
|
5723
5790
|
...rest
|
|
5724
5791
|
},
|
|
5725
|
-
/* @__PURE__ */
|
|
5792
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5726
5793
|
"button",
|
|
5727
5794
|
{
|
|
5728
5795
|
onClick: onClose,
|
|
@@ -5734,8 +5801,8 @@ var ArtifactsPanel = import_react66.default.forwardRef(
|
|
|
5734
5801
|
),
|
|
5735
5802
|
"aria-label": "Expand artifacts panel"
|
|
5736
5803
|
},
|
|
5737
|
-
/* @__PURE__ */
|
|
5738
|
-
artifacts.length > 0 && /* @__PURE__ */
|
|
5804
|
+
/* @__PURE__ */ import_react68.default.createElement(LayersIcon, { className: "w-5 h-5" }),
|
|
5805
|
+
artifacts.length > 0 && /* @__PURE__ */ import_react68.default.createElement(
|
|
5739
5806
|
"span",
|
|
5740
5807
|
{
|
|
5741
5808
|
className: "absolute -top-1 -right-1 w-4 h-4 bg-gold text-obsidian text-xs font-medium flex items-center justify-center rounded-full"
|
|
@@ -5745,7 +5812,7 @@ var ArtifactsPanel = import_react66.default.forwardRef(
|
|
|
5745
5812
|
)
|
|
5746
5813
|
);
|
|
5747
5814
|
}
|
|
5748
|
-
return /* @__PURE__ */
|
|
5815
|
+
return /* @__PURE__ */ import_react68.default.createElement(import_react68.default.Fragment, null, /* @__PURE__ */ import_react68.default.createElement(
|
|
5749
5816
|
"div",
|
|
5750
5817
|
{
|
|
5751
5818
|
ref,
|
|
@@ -5759,7 +5826,7 @@ var ArtifactsPanel = import_react66.default.forwardRef(
|
|
|
5759
5826
|
style: width ? { width } : void 0,
|
|
5760
5827
|
...rest
|
|
5761
5828
|
},
|
|
5762
|
-
/* @__PURE__ */
|
|
5829
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5763
5830
|
"div",
|
|
5764
5831
|
{
|
|
5765
5832
|
onMouseDown: onResizeStart,
|
|
@@ -5772,13 +5839,13 @@ var ArtifactsPanel = import_react66.default.forwardRef(
|
|
|
5772
5839
|
)
|
|
5773
5840
|
}
|
|
5774
5841
|
),
|
|
5775
|
-
/* @__PURE__ */
|
|
5842
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5776
5843
|
"div",
|
|
5777
5844
|
{
|
|
5778
5845
|
className: "flex items-center justify-between p-4 border-b border-ash/40 shrink-0"
|
|
5779
5846
|
},
|
|
5780
|
-
/* @__PURE__ */
|
|
5781
|
-
/* @__PURE__ */
|
|
5847
|
+
/* @__PURE__ */ import_react68.default.createElement("h3", { className: "text-sm font-semibold text-white" }, "Artifacts"),
|
|
5848
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5782
5849
|
"button",
|
|
5783
5850
|
{
|
|
5784
5851
|
onClick: onClose,
|
|
@@ -5789,10 +5856,10 @@ var ArtifactsPanel = import_react66.default.forwardRef(
|
|
|
5789
5856
|
),
|
|
5790
5857
|
"aria-label": "Collapse artifacts panel"
|
|
5791
5858
|
},
|
|
5792
|
-
/* @__PURE__ */
|
|
5859
|
+
/* @__PURE__ */ import_react68.default.createElement(ChevronRightIcon, { className: "w-5 h-5" })
|
|
5793
5860
|
)
|
|
5794
5861
|
),
|
|
5795
|
-
/* @__PURE__ */
|
|
5862
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5796
5863
|
"div",
|
|
5797
5864
|
{
|
|
5798
5865
|
"data-testid": "artifacts-grid",
|
|
@@ -5803,7 +5870,7 @@ var ArtifactsPanel = import_react66.default.forwardRef(
|
|
|
5803
5870
|
columns === 3 && "grid-cols-3"
|
|
5804
5871
|
)
|
|
5805
5872
|
},
|
|
5806
|
-
artifacts.length === 0 && !isLoading ? /* @__PURE__ */
|
|
5873
|
+
artifacts.length === 0 && !isLoading ? /* @__PURE__ */ import_react68.default.createElement("p", { className: "text-xs text-silver/60 text-center py-8" }, "No artifacts to display") : artifacts.map((artifact) => /* @__PURE__ */ import_react68.default.createElement(
|
|
5807
5874
|
ArtifactRenderer,
|
|
5808
5875
|
{
|
|
5809
5876
|
key: artifact.id,
|
|
@@ -5813,7 +5880,7 @@ var ArtifactsPanel = import_react66.default.forwardRef(
|
|
|
5813
5880
|
}
|
|
5814
5881
|
))
|
|
5815
5882
|
)
|
|
5816
|
-
), expandedArtifact && /* @__PURE__ */
|
|
5883
|
+
), expandedArtifact && /* @__PURE__ */ import_react68.default.createElement(
|
|
5817
5884
|
ArtifactModal,
|
|
5818
5885
|
{
|
|
5819
5886
|
artifact: expandedArtifact,
|
|
@@ -5823,8 +5890,8 @@ var ArtifactsPanel = import_react66.default.forwardRef(
|
|
|
5823
5890
|
}
|
|
5824
5891
|
);
|
|
5825
5892
|
ArtifactsPanel.displayName = "ArtifactsPanel";
|
|
5826
|
-
var ArtifactsPanelToggle =
|
|
5827
|
-
return /* @__PURE__ */
|
|
5893
|
+
var ArtifactsPanelToggle = import_react68.default.forwardRef(({ artifactCount = 0, onExpand, className, ...rest }, ref) => {
|
|
5894
|
+
return /* @__PURE__ */ import_react68.default.createElement(
|
|
5828
5895
|
"button",
|
|
5829
5896
|
{
|
|
5830
5897
|
ref,
|
|
@@ -5841,8 +5908,8 @@ var ArtifactsPanelToggle = import_react66.default.forwardRef(({ artifactCount =
|
|
|
5841
5908
|
"aria-label": "Expand artifacts panel",
|
|
5842
5909
|
...rest
|
|
5843
5910
|
},
|
|
5844
|
-
/* @__PURE__ */
|
|
5845
|
-
artifactCount > 0 && /* @__PURE__ */
|
|
5911
|
+
/* @__PURE__ */ import_react68.default.createElement(LayersIcon, { className: "w-5 h-5" }),
|
|
5912
|
+
artifactCount > 0 && /* @__PURE__ */ import_react68.default.createElement(
|
|
5846
5913
|
"span",
|
|
5847
5914
|
{
|
|
5848
5915
|
className: "absolute -top-1 -right-1 w-4 h-4 bg-gold text-obsidian text-xs font-medium flex items-center justify-center rounded-full"
|
|
@@ -5854,20 +5921,20 @@ var ArtifactsPanelToggle = import_react66.default.forwardRef(({ artifactCount =
|
|
|
5854
5921
|
ArtifactsPanelToggle.displayName = "ArtifactsPanelToggle";
|
|
5855
5922
|
|
|
5856
5923
|
// src/components/chat/TodosList.tsx
|
|
5857
|
-
var
|
|
5924
|
+
var import_react69 = __toESM(require("react"));
|
|
5858
5925
|
function TaskIcon({ status }) {
|
|
5859
5926
|
switch (status) {
|
|
5860
5927
|
case "done":
|
|
5861
|
-
return /* @__PURE__ */
|
|
5928
|
+
return /* @__PURE__ */ import_react69.default.createElement(CheckSquareIcon, null);
|
|
5862
5929
|
case "in_progress":
|
|
5863
|
-
return /* @__PURE__ */
|
|
5930
|
+
return /* @__PURE__ */ import_react69.default.createElement(SquareLoaderIcon, null);
|
|
5864
5931
|
case "cancelled":
|
|
5865
|
-
return /* @__PURE__ */
|
|
5932
|
+
return /* @__PURE__ */ import_react69.default.createElement(CrossSquareIcon, { variant: "cancelled" });
|
|
5866
5933
|
case "failed":
|
|
5867
|
-
return /* @__PURE__ */
|
|
5934
|
+
return /* @__PURE__ */ import_react69.default.createElement(CrossSquareIcon, { variant: "failed" });
|
|
5868
5935
|
case "pending":
|
|
5869
5936
|
default:
|
|
5870
|
-
return /* @__PURE__ */
|
|
5937
|
+
return /* @__PURE__ */ import_react69.default.createElement(EmptySquareIcon, null);
|
|
5871
5938
|
}
|
|
5872
5939
|
}
|
|
5873
5940
|
function sortTasks(tasks) {
|
|
@@ -5887,7 +5954,7 @@ function TaskItem({ task, depth = 0 }) {
|
|
|
5887
5954
|
const isSubtle = task.status === "cancelled" || task.status === "failed";
|
|
5888
5955
|
const showSubtasks = (task.status === "in_progress" || task.status === "done") && task.subtasks && task.subtasks.length > 0;
|
|
5889
5956
|
const sortedSubtasks = showSubtasks ? sortTasks(task.subtasks) : [];
|
|
5890
|
-
return /* @__PURE__ */
|
|
5957
|
+
return /* @__PURE__ */ import_react69.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ import_react69.default.createElement(
|
|
5891
5958
|
"div",
|
|
5892
5959
|
{
|
|
5893
5960
|
className: cx(
|
|
@@ -5895,8 +5962,8 @@ function TaskItem({ task, depth = 0 }) {
|
|
|
5895
5962
|
depth > 0 && "pl-6"
|
|
5896
5963
|
)
|
|
5897
5964
|
},
|
|
5898
|
-
/* @__PURE__ */
|
|
5899
|
-
/* @__PURE__ */
|
|
5965
|
+
/* @__PURE__ */ import_react69.default.createElement(TaskIcon, { status: task.status }),
|
|
5966
|
+
/* @__PURE__ */ import_react69.default.createElement(
|
|
5900
5967
|
"span",
|
|
5901
5968
|
{
|
|
5902
5969
|
className: cx(
|
|
@@ -5908,14 +5975,14 @@ function TaskItem({ task, depth = 0 }) {
|
|
|
5908
5975
|
)
|
|
5909
5976
|
},
|
|
5910
5977
|
task.label,
|
|
5911
|
-
task.status === "cancelled" && /* @__PURE__ */
|
|
5912
|
-
task.status === "failed" && /* @__PURE__ */
|
|
5978
|
+
task.status === "cancelled" && /* @__PURE__ */ import_react69.default.createElement("span", { className: "text-silver/40 ml-1" }, "(cancelled)"),
|
|
5979
|
+
task.status === "failed" && /* @__PURE__ */ import_react69.default.createElement("span", { className: "text-error/60 ml-1" }, "(failed)")
|
|
5913
5980
|
)
|
|
5914
|
-
), showSubtasks && /* @__PURE__ */
|
|
5981
|
+
), showSubtasks && /* @__PURE__ */ import_react69.default.createElement("div", { className: "flex flex-col" }, sortedSubtasks.map((subtask) => /* @__PURE__ */ import_react69.default.createElement(TaskItem, { key: subtask.id, task: subtask, depth: depth + 1 }))));
|
|
5915
5982
|
}
|
|
5916
|
-
var TodosList =
|
|
5983
|
+
var TodosList = import_react69.default.forwardRef(
|
|
5917
5984
|
({ tasks, title = "Tasks", className, ...rest }, ref) => {
|
|
5918
|
-
const sortedTasks = (0,
|
|
5985
|
+
const sortedTasks = (0, import_react69.useMemo)(() => sortTasks(tasks), [tasks]);
|
|
5919
5986
|
const countCompleted = (taskList) => {
|
|
5920
5987
|
let count = 0;
|
|
5921
5988
|
for (const task of taskList) {
|
|
@@ -5934,7 +6001,7 @@ var TodosList = import_react67.default.forwardRef(
|
|
|
5934
6001
|
if (tasks.length === 0) {
|
|
5935
6002
|
return null;
|
|
5936
6003
|
}
|
|
5937
|
-
return /* @__PURE__ */
|
|
6004
|
+
return /* @__PURE__ */ import_react69.default.createElement(
|
|
5938
6005
|
"div",
|
|
5939
6006
|
{
|
|
5940
6007
|
ref,
|
|
@@ -5946,21 +6013,21 @@ var TodosList = import_react67.default.forwardRef(
|
|
|
5946
6013
|
style: { maxHeight: "25vh" },
|
|
5947
6014
|
...rest
|
|
5948
6015
|
},
|
|
5949
|
-
/* @__PURE__ */
|
|
5950
|
-
/* @__PURE__ */
|
|
6016
|
+
/* @__PURE__ */ import_react69.default.createElement("div", { className: "flex items-center justify-between px-4 py-2 border-b border-ash/40 flex-shrink-0" }, /* @__PURE__ */ import_react69.default.createElement("h4", { className: "text-xs font-medium text-white" }, title), /* @__PURE__ */ import_react69.default.createElement("span", { className: "text-xs text-silver/60" }, countCompleted(tasks), "/", countTotal(tasks))),
|
|
6017
|
+
/* @__PURE__ */ import_react69.default.createElement("div", { className: "flex-1 overflow-y-auto px-4 py-2" }, sortedTasks.map((task) => /* @__PURE__ */ import_react69.default.createElement(TaskItem, { key: task.id, task })))
|
|
5951
6018
|
);
|
|
5952
6019
|
}
|
|
5953
6020
|
);
|
|
5954
6021
|
TodosList.displayName = "TodosList";
|
|
5955
6022
|
|
|
5956
6023
|
// src/components/chat/hooks/useArtifacts.ts
|
|
5957
|
-
var
|
|
6024
|
+
var import_react70 = require("react");
|
|
5958
6025
|
function useArtifacts() {
|
|
5959
|
-
const [artifacts, setArtifacts] = (0,
|
|
5960
|
-
const scheduleArtifact = (0,
|
|
6026
|
+
const [artifacts, setArtifacts] = (0, import_react70.useState)([]);
|
|
6027
|
+
const scheduleArtifact = (0, import_react70.useCallback)((artifact) => {
|
|
5961
6028
|
setArtifacts((prev) => [...prev, { ...artifact, isPending: true }]);
|
|
5962
6029
|
}, []);
|
|
5963
|
-
const showArtifact = (0,
|
|
6030
|
+
const showArtifact = (0, import_react70.useCallback)(
|
|
5964
6031
|
(artifactId, updates) => {
|
|
5965
6032
|
setArtifacts((prev) => {
|
|
5966
6033
|
const existingIndex = prev.findIndex((a) => a.id === artifactId);
|
|
@@ -5975,36 +6042,36 @@ function useArtifacts() {
|
|
|
5975
6042
|
},
|
|
5976
6043
|
[]
|
|
5977
6044
|
);
|
|
5978
|
-
const removeArtifact = (0,
|
|
6045
|
+
const removeArtifact = (0, import_react70.useCallback)((artifactId) => {
|
|
5979
6046
|
setArtifacts((prev) => prev.filter((a) => a.id !== artifactId));
|
|
5980
6047
|
}, []);
|
|
5981
|
-
const clearArtifacts = (0,
|
|
6048
|
+
const clearArtifacts = (0, import_react70.useCallback)(() => {
|
|
5982
6049
|
setArtifacts([]);
|
|
5983
6050
|
}, []);
|
|
5984
6051
|
return { artifacts, scheduleArtifact, showArtifact, removeArtifact, clearArtifacts };
|
|
5985
6052
|
}
|
|
5986
6053
|
|
|
5987
6054
|
// src/components/chat/hooks/useResizable.ts
|
|
5988
|
-
var
|
|
6055
|
+
var import_react71 = require("react");
|
|
5989
6056
|
function useResizable({
|
|
5990
6057
|
initialWidthPercent,
|
|
5991
6058
|
minWidthPercent,
|
|
5992
6059
|
maxWidthPercent,
|
|
5993
6060
|
direction
|
|
5994
6061
|
}) {
|
|
5995
|
-
const [widthPercent, setWidthPercent] = (0,
|
|
5996
|
-
const [isResizing, setIsResizing] = (0,
|
|
5997
|
-
const lastX = (0,
|
|
5998
|
-
const startResizing = (0,
|
|
6062
|
+
const [widthPercent, setWidthPercent] = (0, import_react71.useState)(initialWidthPercent);
|
|
6063
|
+
const [isResizing, setIsResizing] = (0, import_react71.useState)(false);
|
|
6064
|
+
const lastX = (0, import_react71.useRef)(null);
|
|
6065
|
+
const startResizing = (0, import_react71.useCallback)((e) => {
|
|
5999
6066
|
e.preventDefault();
|
|
6000
6067
|
setIsResizing(true);
|
|
6001
6068
|
lastX.current = e.clientX;
|
|
6002
6069
|
}, []);
|
|
6003
|
-
const stopResizing = (0,
|
|
6070
|
+
const stopResizing = (0, import_react71.useCallback)(() => {
|
|
6004
6071
|
setIsResizing(false);
|
|
6005
6072
|
lastX.current = null;
|
|
6006
6073
|
}, []);
|
|
6007
|
-
const resize = (0,
|
|
6074
|
+
const resize = (0, import_react71.useCallback)(
|
|
6008
6075
|
(e) => {
|
|
6009
6076
|
if (!isResizing || lastX.current === null) {
|
|
6010
6077
|
return;
|
|
@@ -6020,7 +6087,7 @@ function useResizable({
|
|
|
6020
6087
|
},
|
|
6021
6088
|
[isResizing, direction, minWidthPercent, maxWidthPercent]
|
|
6022
6089
|
);
|
|
6023
|
-
(0,
|
|
6090
|
+
(0, import_react71.useEffect)(() => {
|
|
6024
6091
|
if (isResizing) {
|
|
6025
6092
|
window.addEventListener("mousemove", resize);
|
|
6026
6093
|
window.addEventListener("mouseup", stopResizing);
|
|
@@ -6044,7 +6111,7 @@ function useResizable({
|
|
|
6044
6111
|
}
|
|
6045
6112
|
|
|
6046
6113
|
// src/components/chat/ChatInterface.tsx
|
|
6047
|
-
var ChatInterface =
|
|
6114
|
+
var ChatInterface = import_react72.default.forwardRef(
|
|
6048
6115
|
({
|
|
6049
6116
|
messages = [],
|
|
6050
6117
|
conversationTree,
|
|
@@ -6074,8 +6141,8 @@ var ChatInterface = import_react70.default.forwardRef(
|
|
|
6074
6141
|
className,
|
|
6075
6142
|
...rest
|
|
6076
6143
|
}, ref) => {
|
|
6077
|
-
const [sidebarCollapsed, setSidebarCollapsed] = (0,
|
|
6078
|
-
const [internalPanelOpen, setInternalPanelOpen] = (0,
|
|
6144
|
+
const [sidebarCollapsed, setSidebarCollapsed] = (0, import_react72.useState)(initialSidebarCollapsed);
|
|
6145
|
+
const [internalPanelOpen, setInternalPanelOpen] = (0, import_react72.useState)(false);
|
|
6079
6146
|
const {
|
|
6080
6147
|
width: sidebarWidth,
|
|
6081
6148
|
startResizing: startResizingSidebar
|
|
@@ -6098,7 +6165,7 @@ var ChatInterface = import_react70.default.forwardRef(
|
|
|
6098
6165
|
const isPanelControlled = isArtifactsPanelOpen !== void 0;
|
|
6099
6166
|
const artifactsPanelOpen = isPanelControlled ? isArtifactsPanelOpen : internalPanelOpen;
|
|
6100
6167
|
const isTreeMode = !!conversationTree;
|
|
6101
|
-
const effectiveMessages = (0,
|
|
6168
|
+
const effectiveMessages = (0, import_react72.useMemo)(() => {
|
|
6102
6169
|
if (isTreeMode && conversationTree) {
|
|
6103
6170
|
const pathNodes = getActivePathMessages(conversationTree);
|
|
6104
6171
|
return pathNodes.map((node) => ({
|
|
@@ -6110,7 +6177,7 @@ var ChatInterface = import_react70.default.forwardRef(
|
|
|
6110
6177
|
}
|
|
6111
6178
|
return messages;
|
|
6112
6179
|
}, [isTreeMode, conversationTree, messages]);
|
|
6113
|
-
const latestUserMessageIndex = (0,
|
|
6180
|
+
const latestUserMessageIndex = (0, import_react72.useMemo)(() => {
|
|
6114
6181
|
for (let i = effectiveMessages.length - 1; i >= 0; i--) {
|
|
6115
6182
|
if (effectiveMessages[i].variant === "user") {
|
|
6116
6183
|
return i;
|
|
@@ -6118,15 +6185,15 @@ var ChatInterface = import_react70.default.forwardRef(
|
|
|
6118
6185
|
}
|
|
6119
6186
|
return -1;
|
|
6120
6187
|
}, [effectiveMessages]);
|
|
6121
|
-
const hasPendingArtifact = (0,
|
|
6188
|
+
const hasPendingArtifact = (0, import_react72.useMemo)(() => {
|
|
6122
6189
|
return artifacts.some((a) => a.isPending);
|
|
6123
6190
|
}, [artifacts]);
|
|
6124
|
-
|
|
6191
|
+
import_react72.default.useEffect(() => {
|
|
6125
6192
|
if (!isPanelControlled && artifacts.length > 0) {
|
|
6126
6193
|
setInternalPanelOpen(true);
|
|
6127
6194
|
}
|
|
6128
6195
|
}, [artifacts.length, isPanelControlled]);
|
|
6129
|
-
const handleBranchSwitch = (0,
|
|
6196
|
+
const handleBranchSwitch = (0, import_react72.useCallback)(
|
|
6130
6197
|
(nodeId, direction) => {
|
|
6131
6198
|
if (!isTreeMode || !conversationTree || !onTreeChange) {
|
|
6132
6199
|
return;
|
|
@@ -6136,7 +6203,7 @@ var ChatInterface = import_react70.default.forwardRef(
|
|
|
6136
6203
|
},
|
|
6137
6204
|
[isTreeMode, conversationTree, onTreeChange]
|
|
6138
6205
|
);
|
|
6139
|
-
const displayMessages = (0,
|
|
6206
|
+
const displayMessages = (0, import_react72.useMemo)(() => {
|
|
6140
6207
|
return effectiveMessages.map((msg) => {
|
|
6141
6208
|
let branchInfo = void 0;
|
|
6142
6209
|
if (isTreeMode && conversationTree) {
|
|
@@ -6170,16 +6237,16 @@ var ChatInterface = import_react70.default.forwardRef(
|
|
|
6170
6237
|
onRetryMessage,
|
|
6171
6238
|
handleBranchSwitch
|
|
6172
6239
|
]);
|
|
6173
|
-
const handleSubmit = (0,
|
|
6240
|
+
const handleSubmit = (0, import_react72.useCallback)(
|
|
6174
6241
|
(message, attachments) => {
|
|
6175
6242
|
onMessageSubmit?.(message, attachments);
|
|
6176
6243
|
},
|
|
6177
6244
|
[onMessageSubmit]
|
|
6178
6245
|
);
|
|
6179
|
-
const toggleSidebar = (0,
|
|
6246
|
+
const toggleSidebar = (0, import_react72.useCallback)(() => {
|
|
6180
6247
|
setSidebarCollapsed((prev) => !prev);
|
|
6181
6248
|
}, []);
|
|
6182
|
-
const toggleArtifactsPanel = (0,
|
|
6249
|
+
const toggleArtifactsPanel = (0, import_react72.useCallback)(() => {
|
|
6183
6250
|
if (isPanelControlled) {
|
|
6184
6251
|
onArtifactsPanelOpenChange?.(!artifactsPanelOpen);
|
|
6185
6252
|
} else {
|
|
@@ -6187,14 +6254,14 @@ var ChatInterface = import_react70.default.forwardRef(
|
|
|
6187
6254
|
}
|
|
6188
6255
|
}, [isPanelControlled, artifactsPanelOpen, onArtifactsPanelOpenChange]);
|
|
6189
6256
|
const isEmpty = effectiveMessages.length === 0;
|
|
6190
|
-
return /* @__PURE__ */
|
|
6257
|
+
return /* @__PURE__ */ import_react72.default.createElement(
|
|
6191
6258
|
"div",
|
|
6192
6259
|
{
|
|
6193
6260
|
ref,
|
|
6194
6261
|
className: cx("flex h-full w-full bg-obsidian overflow-hidden", className),
|
|
6195
6262
|
...rest
|
|
6196
6263
|
},
|
|
6197
|
-
/* @__PURE__ */
|
|
6264
|
+
/* @__PURE__ */ import_react72.default.createElement(
|
|
6198
6265
|
ConversationSidebar,
|
|
6199
6266
|
{
|
|
6200
6267
|
conversations,
|
|
@@ -6206,16 +6273,16 @@ var ChatInterface = import_react70.default.forwardRef(
|
|
|
6206
6273
|
onResizeStart: startResizingSidebar
|
|
6207
6274
|
}
|
|
6208
6275
|
),
|
|
6209
|
-
/* @__PURE__ */
|
|
6276
|
+
/* @__PURE__ */ import_react72.default.createElement("div", { className: "flex-1 flex flex-col min-w-0 relative" }, /* @__PURE__ */ import_react72.default.createElement("div", { className: cx(
|
|
6210
6277
|
"flex-1 flex flex-col min-h-0 relative",
|
|
6211
6278
|
isEmpty ? "justify-center" : "justify-start"
|
|
6212
|
-
) }, /* @__PURE__ */
|
|
6279
|
+
) }, /* @__PURE__ */ import_react72.default.createElement("div", { className: cx(
|
|
6213
6280
|
"transition-all duration-500 ease-in-out",
|
|
6214
6281
|
isEmpty ? "flex-1" : "flex-zero"
|
|
6215
|
-
) }), /* @__PURE__ */
|
|
6282
|
+
) }), /* @__PURE__ */ import_react72.default.createElement("div", { className: cx(
|
|
6216
6283
|
"transition-all duration-500 ease-in-out overflow-hidden flex flex-col",
|
|
6217
6284
|
isEmpty ? "flex-zero opacity-0" : "flex-1 opacity-100"
|
|
6218
|
-
) }, /* @__PURE__ */
|
|
6285
|
+
) }, /* @__PURE__ */ import_react72.default.createElement(
|
|
6219
6286
|
ChatView,
|
|
6220
6287
|
{
|
|
6221
6288
|
messages: displayMessages,
|
|
@@ -6224,10 +6291,10 @@ var ChatInterface = import_react70.default.forwardRef(
|
|
|
6224
6291
|
isThinking,
|
|
6225
6292
|
className: "flex-1"
|
|
6226
6293
|
}
|
|
6227
|
-
)), /* @__PURE__ */
|
|
6294
|
+
)), /* @__PURE__ */ import_react72.default.createElement("div", { className: cx(
|
|
6228
6295
|
"transition-all duration-500 ease-in-out z-10 w-full flex flex-col items-center",
|
|
6229
6296
|
isEmpty ? "p-4" : "shrink-0 p-4 border-t border-ash/40 bg-obsidian"
|
|
6230
|
-
) }, isEmpty && /* @__PURE__ */
|
|
6297
|
+
) }, isEmpty && /* @__PURE__ */ import_react72.default.createElement("div", { className: "mb-8 text-center animate-fade-in duration-500" }, emptyState ? emptyState : /* @__PURE__ */ import_react72.default.createElement("h1", { className: "text-4xl md:text-5xl font-heading text-gold mb-2 tracking-tight" }, "Welcome!")), /* @__PURE__ */ import_react72.default.createElement(
|
|
6231
6298
|
ChatInput,
|
|
6232
6299
|
{
|
|
6233
6300
|
position: isEmpty ? "centered" : "bottom",
|
|
@@ -6241,11 +6308,11 @@ var ChatInterface = import_react70.default.forwardRef(
|
|
|
6241
6308
|
attachments: propsAttachments,
|
|
6242
6309
|
onAttachmentsChange
|
|
6243
6310
|
}
|
|
6244
|
-
)), /* @__PURE__ */
|
|
6311
|
+
)), /* @__PURE__ */ import_react72.default.createElement("div", { className: cx(
|
|
6245
6312
|
"transition-all duration-500 ease-in-out",
|
|
6246
6313
|
isEmpty ? "flex-1" : "flex-zero"
|
|
6247
6314
|
) }))),
|
|
6248
|
-
/* @__PURE__ */
|
|
6315
|
+
/* @__PURE__ */ import_react72.default.createElement("div", { className: "h-full flex flex-col shrink-0" }, /* @__PURE__ */ import_react72.default.createElement("div", { className: "flex-1 min-h-0" }, /* @__PURE__ */ import_react72.default.createElement(
|
|
6249
6316
|
ArtifactsPanel,
|
|
6250
6317
|
{
|
|
6251
6318
|
artifacts,
|
|
@@ -6257,7 +6324,7 @@ var ChatInterface = import_react70.default.forwardRef(
|
|
|
6257
6324
|
onResizeStart: startResizingArtifacts,
|
|
6258
6325
|
className: "h-full"
|
|
6259
6326
|
}
|
|
6260
|
-
)), tasks.length > 0 && artifactsPanelOpen && /* @__PURE__ */
|
|
6327
|
+
)), tasks.length > 0 && artifactsPanelOpen && /* @__PURE__ */ import_react72.default.createElement(
|
|
6261
6328
|
TodosList,
|
|
6262
6329
|
{
|
|
6263
6330
|
tasks,
|
|
@@ -6271,9 +6338,9 @@ var ChatInterface = import_react70.default.forwardRef(
|
|
|
6271
6338
|
ChatInterface.displayName = "ChatInterface";
|
|
6272
6339
|
|
|
6273
6340
|
// src/components/chat/MessageActions.tsx
|
|
6274
|
-
var
|
|
6341
|
+
var import_react73 = __toESM(require("react"));
|
|
6275
6342
|
var import_lucide_react14 = require("lucide-react");
|
|
6276
|
-
var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */
|
|
6343
|
+
var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */ import_react73.default.createElement(
|
|
6277
6344
|
"button",
|
|
6278
6345
|
{
|
|
6279
6346
|
type: "button",
|
|
@@ -6289,7 +6356,7 @@ var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @_
|
|
|
6289
6356
|
},
|
|
6290
6357
|
children
|
|
6291
6358
|
);
|
|
6292
|
-
var MessageActions =
|
|
6359
|
+
var MessageActions = import_react73.default.forwardRef(
|
|
6293
6360
|
({
|
|
6294
6361
|
variant,
|
|
6295
6362
|
content,
|
|
@@ -6301,12 +6368,12 @@ var MessageActions = import_react71.default.forwardRef(
|
|
|
6301
6368
|
className,
|
|
6302
6369
|
...rest
|
|
6303
6370
|
}, ref) => {
|
|
6304
|
-
const [localIsEditing, setLocalIsEditing] = (0,
|
|
6305
|
-
const [localEditValue, setLocalEditValue] = (0,
|
|
6306
|
-
const [copied, setCopied] = (0,
|
|
6371
|
+
const [localIsEditing, setLocalIsEditing] = (0, import_react73.useState)(false);
|
|
6372
|
+
const [localEditValue, setLocalEditValue] = (0, import_react73.useState)(content);
|
|
6373
|
+
const [copied, setCopied] = (0, import_react73.useState)(false);
|
|
6307
6374
|
const isEditing = controlledIsEditing ?? localIsEditing;
|
|
6308
6375
|
const editValue = controlledEditValue ?? localEditValue;
|
|
6309
|
-
const setIsEditing = (0,
|
|
6376
|
+
const setIsEditing = (0, import_react73.useCallback)(
|
|
6310
6377
|
(value) => {
|
|
6311
6378
|
if (onEditingChange) {
|
|
6312
6379
|
onEditingChange(value);
|
|
@@ -6316,10 +6383,10 @@ var MessageActions = import_react71.default.forwardRef(
|
|
|
6316
6383
|
},
|
|
6317
6384
|
[onEditingChange]
|
|
6318
6385
|
);
|
|
6319
|
-
const setEditValue = (0,
|
|
6386
|
+
const setEditValue = (0, import_react73.useCallback)((value) => {
|
|
6320
6387
|
setLocalEditValue(value);
|
|
6321
6388
|
}, []);
|
|
6322
|
-
const handleCopy = (0,
|
|
6389
|
+
const handleCopy = (0, import_react73.useCallback)(async () => {
|
|
6323
6390
|
try {
|
|
6324
6391
|
await navigator.clipboard.writeText(content);
|
|
6325
6392
|
setCopied(true);
|
|
@@ -6335,22 +6402,22 @@ var MessageActions = import_react71.default.forwardRef(
|
|
|
6335
6402
|
setTimeout(() => setCopied(false), 2e3);
|
|
6336
6403
|
}
|
|
6337
6404
|
}, [content]);
|
|
6338
|
-
const handleStartEdit = (0,
|
|
6405
|
+
const handleStartEdit = (0, import_react73.useCallback)(() => {
|
|
6339
6406
|
setLocalEditValue(content);
|
|
6340
6407
|
setIsEditing(true);
|
|
6341
6408
|
}, [content, setIsEditing]);
|
|
6342
|
-
const handleCancelEdit = (0,
|
|
6409
|
+
const handleCancelEdit = (0, import_react73.useCallback)(() => {
|
|
6343
6410
|
setIsEditing(false);
|
|
6344
6411
|
setLocalEditValue(content);
|
|
6345
6412
|
}, [content, setIsEditing]);
|
|
6346
|
-
const handleSubmitEdit = (0,
|
|
6413
|
+
const handleSubmitEdit = (0, import_react73.useCallback)(() => {
|
|
6347
6414
|
const trimmed = editValue.trim();
|
|
6348
6415
|
if (trimmed && trimmed !== content) {
|
|
6349
6416
|
onEdit?.(trimmed);
|
|
6350
6417
|
}
|
|
6351
6418
|
setIsEditing(false);
|
|
6352
6419
|
}, [editValue, content, onEdit, setIsEditing]);
|
|
6353
|
-
const handleEditKeyDown = (0,
|
|
6420
|
+
const handleEditKeyDown = (0, import_react73.useCallback)(
|
|
6354
6421
|
(e) => {
|
|
6355
6422
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
6356
6423
|
e.preventDefault();
|
|
@@ -6363,19 +6430,19 @@ var MessageActions = import_react71.default.forwardRef(
|
|
|
6363
6430
|
);
|
|
6364
6431
|
const isUser = variant === "user";
|
|
6365
6432
|
if (isUser && isEditing) {
|
|
6366
|
-
return /* @__PURE__ */
|
|
6433
|
+
return /* @__PURE__ */ import_react73.default.createElement(
|
|
6367
6434
|
"div",
|
|
6368
6435
|
{
|
|
6369
6436
|
ref,
|
|
6370
6437
|
className: cx("mt-2", className),
|
|
6371
6438
|
...rest
|
|
6372
6439
|
},
|
|
6373
|
-
/* @__PURE__ */
|
|
6440
|
+
/* @__PURE__ */ import_react73.default.createElement(
|
|
6374
6441
|
"div",
|
|
6375
6442
|
{
|
|
6376
6443
|
className: "relative bg-charcoal border border-ash/60 focus-within:border-gold/60 focus-within:ring-1 focus-within:ring-gold/20"
|
|
6377
6444
|
},
|
|
6378
|
-
/* @__PURE__ */
|
|
6445
|
+
/* @__PURE__ */ import_react73.default.createElement(
|
|
6379
6446
|
"textarea",
|
|
6380
6447
|
{
|
|
6381
6448
|
value: editValue,
|
|
@@ -6386,15 +6453,15 @@ var MessageActions = import_react71.default.forwardRef(
|
|
|
6386
6453
|
rows: 2
|
|
6387
6454
|
}
|
|
6388
6455
|
),
|
|
6389
|
-
/* @__PURE__ */
|
|
6456
|
+
/* @__PURE__ */ import_react73.default.createElement("div", { className: "absolute right-2 bottom-2 flex gap-1" }, /* @__PURE__ */ import_react73.default.createElement(
|
|
6390
6457
|
ActionButton2,
|
|
6391
6458
|
{
|
|
6392
6459
|
onClick: handleCancelEdit,
|
|
6393
6460
|
label: "Cancel edit",
|
|
6394
6461
|
className: "text-silver/60 hover:text-error"
|
|
6395
6462
|
},
|
|
6396
|
-
/* @__PURE__ */
|
|
6397
|
-
), /* @__PURE__ */
|
|
6463
|
+
/* @__PURE__ */ import_react73.default.createElement(import_lucide_react14.X, { className: "w-4 h-4" })
|
|
6464
|
+
), /* @__PURE__ */ import_react73.default.createElement(
|
|
6398
6465
|
ActionButton2,
|
|
6399
6466
|
{
|
|
6400
6467
|
onClick: handleSubmitEdit,
|
|
@@ -6402,13 +6469,13 @@ var MessageActions = import_react71.default.forwardRef(
|
|
|
6402
6469
|
className: "text-silver/60 hover:text-gold",
|
|
6403
6470
|
disabled: !editValue.trim() || editValue.trim() === content
|
|
6404
6471
|
},
|
|
6405
|
-
/* @__PURE__ */
|
|
6472
|
+
/* @__PURE__ */ import_react73.default.createElement(import_lucide_react14.Send, { className: "w-4 h-4" })
|
|
6406
6473
|
))
|
|
6407
6474
|
),
|
|
6408
|
-
/* @__PURE__ */
|
|
6475
|
+
/* @__PURE__ */ import_react73.default.createElement("p", { className: "text-xs text-silver/50 mt-1" }, "Press Enter to submit, Esc to cancel. This will create a new branch.")
|
|
6409
6476
|
);
|
|
6410
6477
|
}
|
|
6411
|
-
return /* @__PURE__ */
|
|
6478
|
+
return /* @__PURE__ */ import_react73.default.createElement(
|
|
6412
6479
|
"div",
|
|
6413
6480
|
{
|
|
6414
6481
|
ref,
|
|
@@ -6419,18 +6486,18 @@ var MessageActions = import_react71.default.forwardRef(
|
|
|
6419
6486
|
),
|
|
6420
6487
|
...rest
|
|
6421
6488
|
},
|
|
6422
|
-
/* @__PURE__ */
|
|
6423
|
-
isUser && onEdit && /* @__PURE__ */
|
|
6424
|
-
!isUser && onRetry && /* @__PURE__ */
|
|
6489
|
+
/* @__PURE__ */ import_react73.default.createElement(ActionButton2, { onClick: handleCopy, label: copied ? "Copied!" : "Copy message" }, copied ? /* @__PURE__ */ import_react73.default.createElement(import_lucide_react14.Check, { className: "w-3.5 h-3.5 text-success" }) : /* @__PURE__ */ import_react73.default.createElement(import_lucide_react14.Copy, { className: "w-3.5 h-3.5" })),
|
|
6490
|
+
isUser && onEdit && /* @__PURE__ */ import_react73.default.createElement(ActionButton2, { onClick: handleStartEdit, label: "Edit message" }, /* @__PURE__ */ import_react73.default.createElement(import_lucide_react14.Pencil, { className: "w-3.5 h-3.5" })),
|
|
6491
|
+
!isUser && onRetry && /* @__PURE__ */ import_react73.default.createElement(ActionButton2, { onClick: onRetry, label: "Regenerate response" }, /* @__PURE__ */ import_react73.default.createElement(import_lucide_react14.RotateCcw, { className: "w-3.5 h-3.5" }))
|
|
6425
6492
|
);
|
|
6426
6493
|
}
|
|
6427
6494
|
);
|
|
6428
6495
|
MessageActions.displayName = "MessageActions";
|
|
6429
6496
|
|
|
6430
6497
|
// src/components/chat/BranchNavigator.tsx
|
|
6431
|
-
var
|
|
6498
|
+
var import_react74 = __toESM(require("react"));
|
|
6432
6499
|
var import_lucide_react15 = require("lucide-react");
|
|
6433
|
-
var BranchNavigator =
|
|
6500
|
+
var BranchNavigator = import_react74.default.forwardRef(
|
|
6434
6501
|
({
|
|
6435
6502
|
current,
|
|
6436
6503
|
total,
|
|
@@ -6449,7 +6516,7 @@ var BranchNavigator = import_react72.default.forwardRef(
|
|
|
6449
6516
|
const buttonSize = size === "sm" ? "p-0.5" : "p-1";
|
|
6450
6517
|
const iconSize = size === "sm" ? "w-3 h-3" : "w-4 h-4";
|
|
6451
6518
|
const textSize = size === "sm" ? "text-xs" : "text-sm";
|
|
6452
|
-
return /* @__PURE__ */
|
|
6519
|
+
return /* @__PURE__ */ import_react74.default.createElement(
|
|
6453
6520
|
"div",
|
|
6454
6521
|
{
|
|
6455
6522
|
ref,
|
|
@@ -6461,8 +6528,8 @@ var BranchNavigator = import_react72.default.forwardRef(
|
|
|
6461
6528
|
"aria-label": "Branch navigation",
|
|
6462
6529
|
...rest
|
|
6463
6530
|
},
|
|
6464
|
-
showIcon && /* @__PURE__ */
|
|
6465
|
-
/* @__PURE__ */
|
|
6531
|
+
showIcon && /* @__PURE__ */ import_react74.default.createElement(import_lucide_react15.GitBranch, { className: cx(iconSize, "mr-0.5 text-silver/50"), "aria-hidden": "true" }),
|
|
6532
|
+
/* @__PURE__ */ import_react74.default.createElement(
|
|
6466
6533
|
"button",
|
|
6467
6534
|
{
|
|
6468
6535
|
type: "button",
|
|
@@ -6475,10 +6542,10 @@ var BranchNavigator = import_react72.default.forwardRef(
|
|
|
6475
6542
|
),
|
|
6476
6543
|
"aria-label": "Previous branch"
|
|
6477
6544
|
},
|
|
6478
|
-
/* @__PURE__ */
|
|
6545
|
+
/* @__PURE__ */ import_react74.default.createElement(import_lucide_react15.ChevronLeft, { className: iconSize })
|
|
6479
6546
|
),
|
|
6480
|
-
/* @__PURE__ */
|
|
6481
|
-
/* @__PURE__ */
|
|
6547
|
+
/* @__PURE__ */ import_react74.default.createElement("span", { className: cx(textSize, "tabular-nums min-w-6 text-center") }, current, "/", total),
|
|
6548
|
+
/* @__PURE__ */ import_react74.default.createElement(
|
|
6482
6549
|
"button",
|
|
6483
6550
|
{
|
|
6484
6551
|
type: "button",
|
|
@@ -6491,7 +6558,7 @@ var BranchNavigator = import_react72.default.forwardRef(
|
|
|
6491
6558
|
),
|
|
6492
6559
|
"aria-label": "Next branch"
|
|
6493
6560
|
},
|
|
6494
|
-
/* @__PURE__ */
|
|
6561
|
+
/* @__PURE__ */ import_react74.default.createElement(import_lucide_react15.ChevronRight, { className: iconSize })
|
|
6495
6562
|
)
|
|
6496
6563
|
);
|
|
6497
6564
|
}
|
|
@@ -6499,16 +6566,16 @@ var BranchNavigator = import_react72.default.forwardRef(
|
|
|
6499
6566
|
BranchNavigator.displayName = "BranchNavigator";
|
|
6500
6567
|
|
|
6501
6568
|
// src/components/BrandIcon.tsx
|
|
6502
|
-
var
|
|
6569
|
+
var import_react75 = __toESM(require("react"));
|
|
6503
6570
|
var sizeMap2 = {
|
|
6504
6571
|
sm: "h-8 w-8 text-sm",
|
|
6505
6572
|
md: "h-12 w-12 text-base",
|
|
6506
6573
|
lg: "h-16 w-16 text-lg"
|
|
6507
6574
|
};
|
|
6508
|
-
var BrandIcon =
|
|
6575
|
+
var BrandIcon = import_react75.default.forwardRef(
|
|
6509
6576
|
({ size = "md", variant = "solid", children, className, ...rest }, ref) => {
|
|
6510
6577
|
const variantClasses = variant === "solid" ? "bg-gold text-obsidian border-2 border-gold" : "bg-transparent text-gold border-2 border-gold";
|
|
6511
|
-
return /* @__PURE__ */
|
|
6578
|
+
return /* @__PURE__ */ import_react75.default.createElement(
|
|
6512
6579
|
"div",
|
|
6513
6580
|
{
|
|
6514
6581
|
ref,
|
|
@@ -6527,17 +6594,17 @@ var BrandIcon = import_react73.default.forwardRef(
|
|
|
6527
6594
|
BrandIcon.displayName = "BrandIcon";
|
|
6528
6595
|
|
|
6529
6596
|
// src/components/ColorSwatch.tsx
|
|
6530
|
-
var
|
|
6531
|
-
var ColorSwatch =
|
|
6597
|
+
var import_react76 = __toESM(require("react"));
|
|
6598
|
+
var ColorSwatch = import_react76.default.forwardRef(
|
|
6532
6599
|
({ color, label, className, ...rest }, ref) => {
|
|
6533
|
-
return /* @__PURE__ */
|
|
6600
|
+
return /* @__PURE__ */ import_react76.default.createElement(
|
|
6534
6601
|
"div",
|
|
6535
6602
|
{
|
|
6536
6603
|
ref,
|
|
6537
6604
|
className: cx("flex flex-col items-center gap-2", className),
|
|
6538
6605
|
...rest
|
|
6539
6606
|
},
|
|
6540
|
-
/* @__PURE__ */
|
|
6607
|
+
/* @__PURE__ */ import_react76.default.createElement(
|
|
6541
6608
|
"div",
|
|
6542
6609
|
{
|
|
6543
6610
|
className: "h-16 w-16 border-2 border-ash rounded-none shadow-sm",
|
|
@@ -6545,22 +6612,22 @@ var ColorSwatch = import_react74.default.forwardRef(
|
|
|
6545
6612
|
"aria-label": label || color
|
|
6546
6613
|
}
|
|
6547
6614
|
),
|
|
6548
|
-
label && /* @__PURE__ */
|
|
6615
|
+
label && /* @__PURE__ */ import_react76.default.createElement("span", { className: "text-xs text-silver font-medium" }, label)
|
|
6549
6616
|
);
|
|
6550
6617
|
}
|
|
6551
6618
|
);
|
|
6552
6619
|
ColorSwatch.displayName = "ColorSwatch";
|
|
6553
6620
|
|
|
6554
6621
|
// src/components/SectionHeading.tsx
|
|
6555
|
-
var
|
|
6622
|
+
var import_react77 = __toESM(require("react"));
|
|
6556
6623
|
var levelStyles = {
|
|
6557
6624
|
h2: "text-2xl mb-4",
|
|
6558
6625
|
h3: "text-xl mb-3"
|
|
6559
6626
|
};
|
|
6560
|
-
var SectionHeading =
|
|
6627
|
+
var SectionHeading = import_react77.default.forwardRef(
|
|
6561
6628
|
({ level = "h2", children, className, ...rest }, ref) => {
|
|
6562
6629
|
const Component = level;
|
|
6563
|
-
return /* @__PURE__ */
|
|
6630
|
+
return /* @__PURE__ */ import_react77.default.createElement(
|
|
6564
6631
|
Component,
|
|
6565
6632
|
{
|
|
6566
6633
|
ref,
|
|
@@ -6587,6 +6654,7 @@ var version = "2.0.0";
|
|
|
6587
6654
|
AccordionTrigger,
|
|
6588
6655
|
Alert,
|
|
6589
6656
|
AlertDialog,
|
|
6657
|
+
ArtifactCard,
|
|
6590
6658
|
ArtifactsPanel,
|
|
6591
6659
|
ArtifactsPanelToggle,
|
|
6592
6660
|
AttachmentPreview,
|
|
@@ -6683,6 +6751,7 @@ var version = "2.0.0";
|
|
|
6683
6751
|
TableHeader,
|
|
6684
6752
|
TableRow,
|
|
6685
6753
|
Tabs,
|
|
6754
|
+
TextCard,
|
|
6686
6755
|
Textarea,
|
|
6687
6756
|
ThinkingIndicator,
|
|
6688
6757
|
ToastProvider,
|