@lukeashford/aurelius 4.3.0 → 4.4.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.js +19 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +79 -68
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1275,7 +1275,7 @@ var ListSubheader = React14.forwardRef(
|
|
|
1275
1275
|
ListSubheader.displayName = "ListSubheader";
|
|
1276
1276
|
|
|
1277
1277
|
// src/components/FileChip.tsx
|
|
1278
|
-
import React15 from "react";
|
|
1278
|
+
import React15, { useState as useState2 } from "react";
|
|
1279
1279
|
import {
|
|
1280
1280
|
File,
|
|
1281
1281
|
FileArchive,
|
|
@@ -1331,12 +1331,12 @@ var statusBorderClass = {
|
|
|
1331
1331
|
};
|
|
1332
1332
|
var statusHoverLabel = {
|
|
1333
1333
|
pending: null,
|
|
1334
|
-
uploading: "Uploading
|
|
1335
|
-
uploaded: "
|
|
1336
|
-
analyzing: "
|
|
1334
|
+
uploading: "Uploading",
|
|
1335
|
+
uploaded: "Analyzing",
|
|
1336
|
+
analyzing: "Analyzing",
|
|
1337
1337
|
analyzed: null,
|
|
1338
|
-
upload_failed: "Upload failed
|
|
1339
|
-
analysis_failed: "
|
|
1338
|
+
upload_failed: "Upload failed",
|
|
1339
|
+
analysis_failed: "Couldn't process this file"
|
|
1340
1340
|
};
|
|
1341
1341
|
function isErrorStatus(status) {
|
|
1342
1342
|
return status === "upload_failed" || status === "analysis_failed";
|
|
@@ -1362,7 +1362,9 @@ var FileChip = React15.forwardRef(
|
|
|
1362
1362
|
const showPreview = isImage && previewUrl;
|
|
1363
1363
|
const clickable = !!(artifactId && onOpen);
|
|
1364
1364
|
const hoverLabel = statusHoverLabel[status];
|
|
1365
|
-
const
|
|
1365
|
+
const tooltipContent = isErrorStatus(status) ? error ?? hoverLabel ?? null : hoverLabel;
|
|
1366
|
+
const [hovered, setHovered] = useState2(false);
|
|
1367
|
+
const [focused, setFocused] = useState2(false);
|
|
1366
1368
|
const showError = isErrorStatus(status);
|
|
1367
1369
|
const handleClick = () => {
|
|
1368
1370
|
if (clickable) {
|
|
@@ -1378,7 +1380,8 @@ var FileChip = React15.forwardRef(
|
|
|
1378
1380
|
onOpen(artifactId);
|
|
1379
1381
|
}
|
|
1380
1382
|
};
|
|
1381
|
-
|
|
1383
|
+
const tooltipOpen = tooltipContent !== null && (hovered || focused);
|
|
1384
|
+
const chip = /* @__PURE__ */ React15.createElement(
|
|
1382
1385
|
"div",
|
|
1383
1386
|
{
|
|
1384
1387
|
...rest,
|
|
@@ -1396,7 +1399,11 @@ var FileChip = React15.forwardRef(
|
|
|
1396
1399
|
tabIndex: clickable ? 0 : void 0,
|
|
1397
1400
|
onClick: clickable ? handleClick : void 0,
|
|
1398
1401
|
onKeyDown: clickable ? handleKeyDown : void 0,
|
|
1399
|
-
|
|
1402
|
+
onMouseEnter: () => setHovered(true),
|
|
1403
|
+
onMouseLeave: () => setHovered(false),
|
|
1404
|
+
onFocus: () => setFocused(true),
|
|
1405
|
+
onBlur: () => setFocused(false),
|
|
1406
|
+
title,
|
|
1400
1407
|
"aria-label": hoverLabel ? `${name}: ${hoverLabel}` : name
|
|
1401
1408
|
},
|
|
1402
1409
|
showPreview ? /* @__PURE__ */ React15.createElement("div", { className: "w-8 h-8 flex-shrink-0 overflow-hidden bg-slate" }, /* @__PURE__ */ React15.createElement(
|
|
@@ -1433,6 +1440,10 @@ var FileChip = React15.forwardRef(
|
|
|
1433
1440
|
/* @__PURE__ */ React15.createElement(X, { className: "w-3.5 h-3.5" })
|
|
1434
1441
|
)
|
|
1435
1442
|
);
|
|
1443
|
+
if (tooltipContent === null) {
|
|
1444
|
+
return chip;
|
|
1445
|
+
}
|
|
1446
|
+
return /* @__PURE__ */ React15.createElement(Tooltip, { content: tooltipContent, open: tooltipOpen, side: "top" }, chip);
|
|
1436
1447
|
}
|
|
1437
1448
|
);
|
|
1438
1449
|
FileChip.displayName = "FileChip";
|
|
@@ -1695,7 +1706,7 @@ var Radio = React22.forwardRef(
|
|
|
1695
1706
|
Radio.displayName = "Radio";
|
|
1696
1707
|
|
|
1697
1708
|
// src/components/Switch.tsx
|
|
1698
|
-
import React23, { useCallback as useCallback4, useRef as useRef2, useState as
|
|
1709
|
+
import React23, { useCallback as useCallback4, useRef as useRef2, useState as useState3 } from "react";
|
|
1699
1710
|
var Switch = React23.forwardRef(
|
|
1700
1711
|
({
|
|
1701
1712
|
checked: controlledChecked,
|
|
@@ -1706,7 +1717,7 @@ var Switch = React23.forwardRef(
|
|
|
1706
1717
|
label,
|
|
1707
1718
|
...rest
|
|
1708
1719
|
}, ref) => {
|
|
1709
|
-
const [internalChecked, setInternalChecked] =
|
|
1720
|
+
const [internalChecked, setInternalChecked] = useState3(defaultChecked);
|
|
1710
1721
|
const isControlled = controlledChecked !== void 0;
|
|
1711
1722
|
const checked = isControlled ? controlledChecked : internalChecked;
|
|
1712
1723
|
const buttonRef = useRef2(null);
|
|
@@ -1780,7 +1791,7 @@ var Switch = React23.forwardRef(
|
|
|
1780
1791
|
Switch.displayName = "Switch";
|
|
1781
1792
|
|
|
1782
1793
|
// src/components/Slider.tsx
|
|
1783
|
-
import React24, { useCallback as useCallback5, useRef as useRef3, useState as
|
|
1794
|
+
import React24, { useCallback as useCallback5, useRef as useRef3, useState as useState4 } from "react";
|
|
1784
1795
|
var SIZE_TRACK = {
|
|
1785
1796
|
sm: "h-1",
|
|
1786
1797
|
md: "h-2",
|
|
@@ -1807,8 +1818,8 @@ var Slider = React24.forwardRef(
|
|
|
1807
1818
|
className,
|
|
1808
1819
|
...props
|
|
1809
1820
|
}, ref) => {
|
|
1810
|
-
const [internalValue, setInternalValue] =
|
|
1811
|
-
const [isDragging, setIsDragging] =
|
|
1821
|
+
const [internalValue, setInternalValue] = useState4(defaultValue);
|
|
1822
|
+
const [isDragging, setIsDragging] = useState4(false);
|
|
1812
1823
|
const trackRef = useRef3(null);
|
|
1813
1824
|
const isControlled = controlledValue !== void 0;
|
|
1814
1825
|
const value = isControlled ? controlledValue : internalValue;
|
|
@@ -2169,7 +2180,7 @@ var Progress = React28.forwardRef(
|
|
|
2169
2180
|
Progress.displayName = "Progress";
|
|
2170
2181
|
|
|
2171
2182
|
// src/components/Toast.tsx
|
|
2172
|
-
import React29, { createContext as createContext2, useCallback as useCallback6, useContext as useContext2, useEffect as useEffect2, useState as
|
|
2183
|
+
import React29, { createContext as createContext2, useCallback as useCallback6, useContext as useContext2, useEffect as useEffect2, useState as useState5 } from "react";
|
|
2173
2184
|
import { createPortal } from "react-dom";
|
|
2174
2185
|
import { AlertCircle, AlertTriangle as AlertTriangle2, CheckCircle as CheckCircle2, Info as Info2, X as X2 } from "lucide-react";
|
|
2175
2186
|
var toastCounter = 0;
|
|
@@ -2199,8 +2210,8 @@ var ToastProvider = ({
|
|
|
2199
2210
|
position = "bottom-right",
|
|
2200
2211
|
defaultDuration = 5e3
|
|
2201
2212
|
}) => {
|
|
2202
|
-
const [toasts, setToasts] =
|
|
2203
|
-
const [mounted, setMounted] =
|
|
2213
|
+
const [toasts, setToasts] = useState5([]);
|
|
2214
|
+
const [mounted, setMounted] = useState5(false);
|
|
2204
2215
|
useEffect2(() => {
|
|
2205
2216
|
setMounted(true);
|
|
2206
2217
|
}, []);
|
|
@@ -2306,11 +2317,11 @@ var Toast = ({
|
|
|
2306
2317
|
Toast.displayName = "Toast";
|
|
2307
2318
|
|
|
2308
2319
|
// src/components/Modal.tsx
|
|
2309
|
-
import React30, { useEffect as useEffect3, useState as
|
|
2320
|
+
import React30, { useEffect as useEffect3, useState as useState6 } from "react";
|
|
2310
2321
|
import { createPortal as createPortal2 } from "react-dom";
|
|
2311
2322
|
import { X as X3 } from "lucide-react";
|
|
2312
2323
|
var Modal = ({ isOpen, onClose, title, children, className }) => {
|
|
2313
|
-
const [mounted, setMounted] =
|
|
2324
|
+
const [mounted, setMounted] = useState6(false);
|
|
2314
2325
|
useEffect3(() => {
|
|
2315
2326
|
setMounted(true);
|
|
2316
2327
|
}, []);
|
|
@@ -2355,7 +2366,7 @@ var Modal = ({ isOpen, onClose, title, children, className }) => {
|
|
|
2355
2366
|
Modal.displayName = "Modal";
|
|
2356
2367
|
|
|
2357
2368
|
// src/components/Drawer.tsx
|
|
2358
|
-
import React31, { useEffect as useEffect4, useState as
|
|
2369
|
+
import React31, { useEffect as useEffect4, useState as useState7 } from "react";
|
|
2359
2370
|
import { createPortal as createPortal3 } from "react-dom";
|
|
2360
2371
|
import { X as X4 } from "lucide-react";
|
|
2361
2372
|
var SIZE_MAP2 = {
|
|
@@ -2411,7 +2422,7 @@ var Drawer = ({
|
|
|
2411
2422
|
children,
|
|
2412
2423
|
className
|
|
2413
2424
|
}) => {
|
|
2414
|
-
const [mounted, setMounted] =
|
|
2425
|
+
const [mounted, setMounted] = useState7(false);
|
|
2415
2426
|
useEffect4(() => {
|
|
2416
2427
|
setMounted(true);
|
|
2417
2428
|
}, []);
|
|
@@ -2474,7 +2485,7 @@ var Drawer = ({
|
|
|
2474
2485
|
Drawer.displayName = "Drawer";
|
|
2475
2486
|
|
|
2476
2487
|
// src/components/Popover.tsx
|
|
2477
|
-
import React32, { useCallback as useCallback7, useId as useId3, useRef as useRef4, useState as
|
|
2488
|
+
import React32, { useCallback as useCallback7, useId as useId3, useRef as useRef4, useState as useState8 } from "react";
|
|
2478
2489
|
var POSITION_CLASSES3 = {
|
|
2479
2490
|
top: {
|
|
2480
2491
|
start: "bottom-full left-0 mb-2",
|
|
@@ -2506,7 +2517,7 @@ var Popover = ({
|
|
|
2506
2517
|
onOpenChange,
|
|
2507
2518
|
closeOnClickOutside = true
|
|
2508
2519
|
}) => {
|
|
2509
|
-
const [internalOpen, setInternalOpen] =
|
|
2520
|
+
const [internalOpen, setInternalOpen] = useState8(false);
|
|
2510
2521
|
const isControlled = controlledOpen !== void 0;
|
|
2511
2522
|
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
2512
2523
|
const containerRef = useRef4(null);
|
|
@@ -2654,7 +2665,7 @@ var PromptDialog = ({
|
|
|
2654
2665
|
PromptDialog.displayName = "PromptDialog";
|
|
2655
2666
|
|
|
2656
2667
|
// src/components/Tabs.tsx
|
|
2657
|
-
import React34, { createContext as createContext3, useCallback as useCallback9, useContext as useContext3, useId as useId4, useState as
|
|
2668
|
+
import React34, { createContext as createContext3, useCallback as useCallback9, useContext as useContext3, useId as useId4, useState as useState9 } from "react";
|
|
2658
2669
|
var TabsContext = createContext3(null);
|
|
2659
2670
|
function useTabsContext() {
|
|
2660
2671
|
const context = useContext3(TabsContext);
|
|
@@ -2665,7 +2676,7 @@ function useTabsContext() {
|
|
|
2665
2676
|
}
|
|
2666
2677
|
var Tabs = React34.forwardRef(
|
|
2667
2678
|
({ defaultValue, value, onValueChange, children, className, ...props }, ref) => {
|
|
2668
|
-
const [internalValue, setInternalValue] =
|
|
2679
|
+
const [internalValue, setInternalValue] = useState9(defaultValue ?? "");
|
|
2669
2680
|
const isControlled = value !== void 0;
|
|
2670
2681
|
const activeTab = isControlled ? value : internalValue;
|
|
2671
2682
|
const baseId = useId4();
|
|
@@ -2765,7 +2776,7 @@ var TabPanel = React34.forwardRef(
|
|
|
2765
2776
|
TabPanel.displayName = "TabPanel";
|
|
2766
2777
|
|
|
2767
2778
|
// src/components/Accordion.tsx
|
|
2768
|
-
import React35, { createContext as createContext4, useCallback as useCallback10, useContext as useContext4, useId as useId5, useState as
|
|
2779
|
+
import React35, { createContext as createContext4, useCallback as useCallback10, useContext as useContext4, useId as useId5, useState as useState10 } from "react";
|
|
2769
2780
|
import { ChevronDown } from "lucide-react";
|
|
2770
2781
|
var AccordionContext = createContext4(null);
|
|
2771
2782
|
function useAccordionContext() {
|
|
@@ -2777,7 +2788,7 @@ function useAccordionContext() {
|
|
|
2777
2788
|
}
|
|
2778
2789
|
var Accordion = React35.forwardRef(
|
|
2779
2790
|
({ type = "single", defaultValue, value, onValueChange, children, className, ...props }, ref) => {
|
|
2780
|
-
const [internalValue, setInternalValue] =
|
|
2791
|
+
const [internalValue, setInternalValue] = useState10(() => {
|
|
2781
2792
|
if (defaultValue) {
|
|
2782
2793
|
return new Set(Array.isArray(defaultValue) ? defaultValue : [defaultValue]);
|
|
2783
2794
|
}
|
|
@@ -2916,7 +2927,7 @@ import React36, {
|
|
|
2916
2927
|
useEffect as useEffect5,
|
|
2917
2928
|
useId as useId6,
|
|
2918
2929
|
useRef as useRef5,
|
|
2919
|
-
useState as
|
|
2930
|
+
useState as useState11
|
|
2920
2931
|
} from "react";
|
|
2921
2932
|
var MenuContext = createContext5(null);
|
|
2922
2933
|
function useMenuContext() {
|
|
@@ -2927,7 +2938,7 @@ function useMenuContext() {
|
|
|
2927
2938
|
return context;
|
|
2928
2939
|
}
|
|
2929
2940
|
var Menu = ({ children, open, onOpenChange }) => {
|
|
2930
|
-
const [internalOpen, setInternalOpen] =
|
|
2941
|
+
const [internalOpen, setInternalOpen] = useState11(false);
|
|
2931
2942
|
const isControlled = open !== void 0;
|
|
2932
2943
|
const isOpen = isControlled ? open : internalOpen;
|
|
2933
2944
|
const baseId = useId6();
|
|
@@ -3751,7 +3762,7 @@ function SquareLoaderIcon({ className, ...props }) {
|
|
|
3751
3762
|
}
|
|
3752
3763
|
|
|
3753
3764
|
// src/components/Message.tsx
|
|
3754
|
-
import React55, { useCallback as useCallback12, useEffect as useEffect6, useRef as useRef6, useState as
|
|
3765
|
+
import React55, { useCallback as useCallback12, useEffect as useEffect6, useRef as useRef6, useState as useState12 } from "react";
|
|
3755
3766
|
import { Check as Check3, ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight3, Copy, GitBranch, Pencil, RotateCcw, Send, X as X5 } from "lucide-react";
|
|
3756
3767
|
|
|
3757
3768
|
// src/components/MarkdownContent.tsx
|
|
@@ -3942,8 +3953,8 @@ var Message = React55.forwardRef(
|
|
|
3942
3953
|
}, ref) => {
|
|
3943
3954
|
const isUser = variant === "user";
|
|
3944
3955
|
const { copied, copy } = useCopyToClipboard();
|
|
3945
|
-
const [isEditing, setIsEditing] =
|
|
3946
|
-
const [editValue, setEditValue] =
|
|
3956
|
+
const [isEditing, setIsEditing] = useState12(false);
|
|
3957
|
+
const [editValue, setEditValue] = useState12(typeof content === "string" ? content : "");
|
|
3947
3958
|
const textareaRef = useRef6(null);
|
|
3948
3959
|
const showBranchNav = branchInfo && branchInfo.total > 1;
|
|
3949
3960
|
const showActions = actions && !hideActions && !isStreaming;
|
|
@@ -4123,7 +4134,7 @@ var StreamingCursor = React56.forwardRef(
|
|
|
4123
4134
|
StreamingCursor.displayName = "StreamingCursor";
|
|
4124
4135
|
|
|
4125
4136
|
// src/components/chat/ChatInterface.tsx
|
|
4126
|
-
import React76, { useCallback as useCallback22, useEffect as useEffect16, useMemo as useMemo5, useRef as useRef15, useState as
|
|
4137
|
+
import React76, { useCallback as useCallback22, useEffect as useEffect16, useMemo as useMemo5, useRef as useRef15, useState as useState23 } from "react";
|
|
4127
4138
|
|
|
4128
4139
|
// src/components/chat/ChatView.tsx
|
|
4129
4140
|
import React60, { useEffect as useEffect9 } from "react";
|
|
@@ -4175,14 +4186,14 @@ function useScrollAnchor(options = {}) {
|
|
|
4175
4186
|
}
|
|
4176
4187
|
|
|
4177
4188
|
// src/components/chat/hooks/useAdaptiveSpacer.ts
|
|
4178
|
-
import { useCallback as useCallback14, useEffect as useEffect7, useRef as useRef8, useState as
|
|
4189
|
+
import { useCallback as useCallback14, useEffect as useEffect7, useRef as useRef8, useState as useState13 } from "react";
|
|
4179
4190
|
function useAdaptiveSpacer(options = {}) {
|
|
4180
4191
|
const { minHeight = 0, containerRef: externalContainerRef, anchorRef } = options;
|
|
4181
4192
|
const internalContainerRef = useRef8(null);
|
|
4182
4193
|
const containerRef = externalContainerRef ?? internalContainerRef;
|
|
4183
4194
|
const contentRef = useRef8(null);
|
|
4184
4195
|
const spacerRef = useRef8(null);
|
|
4185
|
-
const [spacerHeight, setSpacerHeight] =
|
|
4196
|
+
const [spacerHeight, setSpacerHeight] = useState13(0);
|
|
4186
4197
|
const recalculate = useCallback14(() => {
|
|
4187
4198
|
const container = containerRef.current;
|
|
4188
4199
|
const content = contentRef.current;
|
|
@@ -4242,7 +4253,7 @@ function useAdaptiveSpacer(options = {}) {
|
|
|
4242
4253
|
}
|
|
4243
4254
|
|
|
4244
4255
|
// src/components/chat/ThinkingIndicator.tsx
|
|
4245
|
-
import React57, { useEffect as useEffect8, useState as
|
|
4256
|
+
import React57, { useEffect as useEffect8, useState as useState14 } from "react";
|
|
4246
4257
|
var THINKING_PHRASES = [
|
|
4247
4258
|
"Consulting the ancient tomes...",
|
|
4248
4259
|
"Parsing the ineffable...",
|
|
@@ -4267,10 +4278,10 @@ var ThinkingIndicator = React57.forwardRef(
|
|
|
4267
4278
|
className,
|
|
4268
4279
|
...rest
|
|
4269
4280
|
}, ref) => {
|
|
4270
|
-
const [currentIndex, setCurrentIndex] =
|
|
4281
|
+
const [currentIndex, setCurrentIndex] = useState14(
|
|
4271
4282
|
() => Math.floor(Math.random() * phrases.length)
|
|
4272
4283
|
);
|
|
4273
|
-
const [isTransitioning, setIsTransitioning] =
|
|
4284
|
+
const [isTransitioning, setIsTransitioning] = useState14(false);
|
|
4274
4285
|
const isManual = manualLabel !== void 0;
|
|
4275
4286
|
useEffect8(() => {
|
|
4276
4287
|
if (!isVisible || isManual || phrases.length <= 1) {
|
|
@@ -4624,7 +4635,7 @@ var ChatView = React60.forwardRef(
|
|
|
4624
4635
|
ChatView.displayName = "ChatView";
|
|
4625
4636
|
|
|
4626
4637
|
// src/components/chat/ChatInput.tsx
|
|
4627
|
-
import React61, { useCallback as useCallback15, useEffect as useEffect10, useRef as useRef9, useState as
|
|
4638
|
+
import React61, { useCallback as useCallback15, useEffect as useEffect10, useRef as useRef9, useState as useState15 } from "react";
|
|
4628
4639
|
import { Paperclip, Send as Send2, Square, X as X6 } from "lucide-react";
|
|
4629
4640
|
|
|
4630
4641
|
// src/components/chat/types.ts
|
|
@@ -4672,9 +4683,9 @@ var ChatInput = React61.forwardRef(
|
|
|
4672
4683
|
className,
|
|
4673
4684
|
...rest
|
|
4674
4685
|
}, ref) => {
|
|
4675
|
-
const [value, setValue] =
|
|
4676
|
-
const [localAttachments, setLocalAttachments] =
|
|
4677
|
-
const [isDragOver, setIsDragOver] =
|
|
4686
|
+
const [value, setValue] = useState15(initialInputValue);
|
|
4687
|
+
const [localAttachments, setLocalAttachments] = useState15([]);
|
|
4688
|
+
const [isDragOver, setIsDragOver] = useState15(false);
|
|
4678
4689
|
const textareaRef = useRef9(null);
|
|
4679
4690
|
const fileInputRef = useRef9(null);
|
|
4680
4691
|
const attachments = controlledAttachments ?? localAttachments;
|
|
@@ -4931,7 +4942,7 @@ var ChatInput = React61.forwardRef(
|
|
|
4931
4942
|
ChatInput.displayName = "ChatInput";
|
|
4932
4943
|
|
|
4933
4944
|
// src/components/chat/ArtifactsPanel.tsx
|
|
4934
|
-
import React71, { useCallback as useCallback18, useEffect as useEffect13, useRef as useRef12, useState as
|
|
4945
|
+
import React71, { useCallback as useCallback18, useEffect as useEffect13, useRef as useRef12, useState as useState19 } from "react";
|
|
4935
4946
|
import { Image } from "lucide-react";
|
|
4936
4947
|
|
|
4937
4948
|
// src/components/ArtifactCard.tsx
|
|
@@ -5460,7 +5471,7 @@ var ArtifactCard = React68.forwardRef(
|
|
|
5460
5471
|
ArtifactCard.displayName = "ArtifactCard";
|
|
5461
5472
|
|
|
5462
5473
|
// src/components/ArtifactGroup.tsx
|
|
5463
|
-
import React69, { useEffect as useEffect11, useRef as useRef10, useState as
|
|
5474
|
+
import React69, { useEffect as useEffect11, useRef as useRef10, useState as useState16 } from "react";
|
|
5464
5475
|
var LAYER_OFFSET = "8px";
|
|
5465
5476
|
var LAYER_OFFSET_2X = "16px";
|
|
5466
5477
|
var ArtifactGroup = React69.forwardRef(
|
|
@@ -5469,7 +5480,7 @@ var ArtifactGroup = React69.forwardRef(
|
|
|
5469
5480
|
const count = children.length;
|
|
5470
5481
|
const frontChild = children[0];
|
|
5471
5482
|
const prevCountRef = useRef10(count);
|
|
5472
|
-
const [badgePing, setBadgePing] =
|
|
5483
|
+
const [badgePing, setBadgePing] = useState16(false);
|
|
5473
5484
|
useEffect11(() => {
|
|
5474
5485
|
if (count !== prevCountRef.current) {
|
|
5475
5486
|
prevCountRef.current = count;
|
|
@@ -5590,15 +5601,15 @@ var ArtifactVariantStack = React70.forwardRef(
|
|
|
5590
5601
|
ArtifactVariantStack.displayName = "ArtifactVariantStack";
|
|
5591
5602
|
|
|
5592
5603
|
// src/components/chat/hooks/useResizable.ts
|
|
5593
|
-
import { useCallback as useCallback16, useEffect as useEffect12, useRef as useRef11, useState as
|
|
5604
|
+
import { useCallback as useCallback16, useEffect as useEffect12, useRef as useRef11, useState as useState17 } from "react";
|
|
5594
5605
|
function useResizable({
|
|
5595
5606
|
initialWidthPercent,
|
|
5596
5607
|
minWidthPercent,
|
|
5597
5608
|
maxWidthPercent,
|
|
5598
5609
|
direction
|
|
5599
5610
|
}) {
|
|
5600
|
-
const [widthPercent, setWidthPercent] =
|
|
5601
|
-
const [isResizing, setIsResizing] =
|
|
5611
|
+
const [widthPercent, setWidthPercent] = useState17(initialWidthPercent);
|
|
5612
|
+
const [isResizing, setIsResizing] = useState17(false);
|
|
5602
5613
|
const lastX = useRef11(null);
|
|
5603
5614
|
const startResizing = useCallback16((e) => {
|
|
5604
5615
|
e.preventDefault();
|
|
@@ -5649,9 +5660,9 @@ function useResizable({
|
|
|
5649
5660
|
}
|
|
5650
5661
|
|
|
5651
5662
|
// src/components/chat/hooks/useArtifactTreeNavigation.ts
|
|
5652
|
-
import { useCallback as useCallback17, useMemo as useMemo2, useState as
|
|
5663
|
+
import { useCallback as useCallback17, useMemo as useMemo2, useState as useState18 } from "react";
|
|
5653
5664
|
function useArtifactTreeNavigation(rootNodes) {
|
|
5654
|
-
const [stack, setStack] =
|
|
5665
|
+
const [stack, setStack] = useState18([]);
|
|
5655
5666
|
const currentNodes = useMemo2(() => {
|
|
5656
5667
|
if (stack.length === 0) return rootNodes;
|
|
5657
5668
|
return stack[stack.length - 1].children;
|
|
@@ -5825,8 +5836,8 @@ var ArtifactsPanel = React71.forwardRef(
|
|
|
5825
5836
|
className,
|
|
5826
5837
|
...rest
|
|
5827
5838
|
}, ref) => {
|
|
5828
|
-
const [expandedArtifact, setExpandedArtifact] =
|
|
5829
|
-
const [zoomIndex, setZoomIndex] =
|
|
5839
|
+
const [expandedArtifact, setExpandedArtifact] = useState19(null);
|
|
5840
|
+
const [zoomIndex, setZoomIndex] = useState19(ZOOM_LEVELS.length - 1);
|
|
5830
5841
|
const treeNav = useArtifactTreeNavigation(nodes || []);
|
|
5831
5842
|
const hasNodes = !!nodes && nodes.length > 0;
|
|
5832
5843
|
const handleExpandArtifact = useCallback18((artifact) => {
|
|
@@ -5856,7 +5867,7 @@ var ArtifactsPanel = React71.forwardRef(
|
|
|
5856
5867
|
}, []);
|
|
5857
5868
|
const currentZoom = ZOOM_LEVELS[zoomIndex];
|
|
5858
5869
|
const contentRef = useRef12(null);
|
|
5859
|
-
const [contentHeight, setContentHeight] =
|
|
5870
|
+
const [contentHeight, setContentHeight] = useState19(void 0);
|
|
5860
5871
|
useEffect13(() => {
|
|
5861
5872
|
const el = contentRef.current;
|
|
5862
5873
|
if (!el) {
|
|
@@ -6025,7 +6036,7 @@ var ArtifactsPanelToggle = React71.forwardRef(({ artifactCount = 0, onExpand, cl
|
|
|
6025
6036
|
ArtifactsPanelToggle.displayName = "ArtifactsPanelToggle";
|
|
6026
6037
|
|
|
6027
6038
|
// src/components/chat/HistoryPanel.tsx
|
|
6028
|
-
import React72, { useCallback as useCallback19, useEffect as useEffect14, useMemo as useMemo3, useRef as useRef13, useState as
|
|
6039
|
+
import React72, { useCallback as useCallback19, useEffect as useEffect14, useMemo as useMemo3, useRef as useRef13, useState as useState20 } from "react";
|
|
6029
6040
|
import { ChevronDown as ChevronDown2, Pencil as Pencil2 } from "lucide-react";
|
|
6030
6041
|
function parseTimestamp(ts) {
|
|
6031
6042
|
if (ts == null) {
|
|
@@ -6068,7 +6079,7 @@ function ProjectFilter({
|
|
|
6068
6079
|
onChange,
|
|
6069
6080
|
className
|
|
6070
6081
|
}) {
|
|
6071
|
-
const [open, setOpen] =
|
|
6082
|
+
const [open, setOpen] = useState20(false);
|
|
6072
6083
|
const ref = useRef13(null);
|
|
6073
6084
|
const closeFilter = useCallback19(() => setOpen(false), []);
|
|
6074
6085
|
useClickOutside(ref, closeFilter, open);
|
|
@@ -6145,8 +6156,8 @@ function ConversationRow({
|
|
|
6145
6156
|
onSelect,
|
|
6146
6157
|
onRename
|
|
6147
6158
|
}) {
|
|
6148
|
-
const [isEditing, setIsEditing] =
|
|
6149
|
-
const [draft, setDraft] =
|
|
6159
|
+
const [isEditing, setIsEditing] = useState20(false);
|
|
6160
|
+
const [draft, setDraft] = useState20(conversation.title);
|
|
6150
6161
|
const inputRef = useRef13(null);
|
|
6151
6162
|
useEffect14(() => {
|
|
6152
6163
|
if (isEditing && inputRef.current) {
|
|
@@ -6250,7 +6261,7 @@ function HistoryPanel({
|
|
|
6250
6261
|
onNewChat,
|
|
6251
6262
|
onRenameConversation
|
|
6252
6263
|
}) {
|
|
6253
|
-
const [projectFilter, setProjectFilter] =
|
|
6264
|
+
const [projectFilter, setProjectFilter] = useState20(null);
|
|
6254
6265
|
const projects = useMemo3(() => {
|
|
6255
6266
|
const set = /* @__PURE__ */ new Set();
|
|
6256
6267
|
for (const c of conversations) {
|
|
@@ -6316,7 +6327,7 @@ function HistoryPanel({
|
|
|
6316
6327
|
}
|
|
6317
6328
|
|
|
6318
6329
|
// src/components/chat/TodosList.tsx
|
|
6319
|
-
import React73, { useCallback as useCallback20, useMemo as useMemo4, useState as
|
|
6330
|
+
import React73, { useCallback as useCallback20, useMemo as useMemo4, useState as useState21 } from "react";
|
|
6320
6331
|
import { Loader2 as Loader22, Square as Square2 } from "lucide-react";
|
|
6321
6332
|
var TASK_STATUSES = {
|
|
6322
6333
|
PENDING: "pending",
|
|
@@ -6395,7 +6406,7 @@ function hasInProgressTask(tasks) {
|
|
|
6395
6406
|
var TodosList = React73.forwardRef(
|
|
6396
6407
|
({ tasks, title = "Tasks", onStopAllTasks, className, ...rest }, ref) => {
|
|
6397
6408
|
const sortedTasks = useMemo4(() => sortTasks(tasks), [tasks]);
|
|
6398
|
-
const [isStopping, setIsStopping] =
|
|
6409
|
+
const [isStopping, setIsStopping] = useState21(false);
|
|
6399
6410
|
const handleStopClick = useCallback20(async () => {
|
|
6400
6411
|
if (!onStopAllTasks || isStopping) {
|
|
6401
6412
|
return;
|
|
@@ -6521,7 +6532,7 @@ var ToolSidebar = React74.forwardRef(
|
|
|
6521
6532
|
ToolSidebar.displayName = "ToolSidebar";
|
|
6522
6533
|
|
|
6523
6534
|
// src/components/chat/ToolPanelContainer.tsx
|
|
6524
|
-
import React75, { useCallback as useCallback21, useEffect as useEffect15, useRef as useRef14, useState as
|
|
6535
|
+
import React75, { useCallback as useCallback21, useEffect as useEffect15, useRef as useRef14, useState as useState22 } from "react";
|
|
6525
6536
|
var ToolPanelContainer = React75.forwardRef(
|
|
6526
6537
|
({
|
|
6527
6538
|
topContent,
|
|
@@ -6533,8 +6544,8 @@ var ToolPanelContainer = React75.forwardRef(
|
|
|
6533
6544
|
initialTopPercent = 60,
|
|
6534
6545
|
...rest
|
|
6535
6546
|
}, ref) => {
|
|
6536
|
-
const [topPercent, setTopPercent] =
|
|
6537
|
-
const [isResizingHeight, setIsResizingHeight] =
|
|
6547
|
+
const [topPercent, setTopPercent] = useState22(initialTopPercent);
|
|
6548
|
+
const [isResizingHeight, setIsResizingHeight] = useState22(false);
|
|
6538
6549
|
const containerRef = useRef14(null);
|
|
6539
6550
|
const lastY = useRef14(null);
|
|
6540
6551
|
const hasBoth = topContent !== null && bottomContent !== null;
|
|
@@ -6827,7 +6838,7 @@ var ChatInterface = React76.forwardRef(
|
|
|
6827
6838
|
}, ref) => {
|
|
6828
6839
|
const prevArtifactNodesRef = useRef15([]);
|
|
6829
6840
|
const prevTasksRef = useRef15([]);
|
|
6830
|
-
const [panelOpenArtifactId, setPanelOpenArtifactId] =
|
|
6841
|
+
const [panelOpenArtifactId, setPanelOpenArtifactId] = useState23(null);
|
|
6831
6842
|
const handleAttachmentOpen = useCallback22((artifactId) => {
|
|
6832
6843
|
setPanelOpenArtifactId(artifactId);
|
|
6833
6844
|
onAttachmentOpen?.(artifactId);
|
|
@@ -6835,7 +6846,7 @@ var ChatInterface = React76.forwardRef(
|
|
|
6835
6846
|
const handleArtifactPanelClosed = useCallback22(() => {
|
|
6836
6847
|
setPanelOpenArtifactId(null);
|
|
6837
6848
|
}, []);
|
|
6838
|
-
const [internalTools, setInternalTools] =
|
|
6849
|
+
const [internalTools, setInternalTools] = useState23({
|
|
6839
6850
|
"top-left": "history",
|
|
6840
6851
|
"bottom-left": null,
|
|
6841
6852
|
"top-right": null,
|
|
@@ -7229,7 +7240,7 @@ var ChatInterface = React76.forwardRef(
|
|
|
7229
7240
|
ChatInterface.displayName = "ChatInterface";
|
|
7230
7241
|
|
|
7231
7242
|
// src/components/chat/MessageActions.tsx
|
|
7232
|
-
import React77, { useCallback as useCallback23, useState as
|
|
7243
|
+
import React77, { useCallback as useCallback23, useState as useState24 } from "react";
|
|
7233
7244
|
import { Check as Check4, Copy as Copy2, Pencil as Pencil3, RotateCcw as RotateCcw2, Send as Send3, X as X7 } from "lucide-react";
|
|
7234
7245
|
var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */ React77.createElement(
|
|
7235
7246
|
"button",
|
|
@@ -7259,8 +7270,8 @@ var MessageActions = React77.forwardRef(
|
|
|
7259
7270
|
className,
|
|
7260
7271
|
...rest
|
|
7261
7272
|
}, ref) => {
|
|
7262
|
-
const [localIsEditing, setLocalIsEditing] =
|
|
7263
|
-
const [localEditValue, setLocalEditValue] =
|
|
7273
|
+
const [localIsEditing, setLocalIsEditing] = useState24(false);
|
|
7274
|
+
const [localEditValue, setLocalEditValue] = useState24(content);
|
|
7264
7275
|
const { copied, copy } = useCopyToClipboard();
|
|
7265
7276
|
const isEditing = controlledIsEditing ?? localIsEditing;
|
|
7266
7277
|
const editValue = controlledEditValue ?? localEditValue;
|