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