@lukeashford/aurelius 4.8.0 → 4.9.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 +20 -2
- package/dist/index.d.ts +20 -2
- package/dist/index.js +17 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4414,7 +4414,7 @@ var StreamingCursor = React59.forwardRef(
|
|
|
4414
4414
|
StreamingCursor.displayName = "StreamingCursor";
|
|
4415
4415
|
|
|
4416
4416
|
// src/components/chat/ChatInterface.tsx
|
|
4417
|
-
import React88, { useCallback as useCallback24, useEffect as useEffect17, useMemo as useMemo5, useRef as useRef16, useState as useState26 } from "react";
|
|
4417
|
+
import React88, { useCallback as useCallback24, useEffect as useEffect17, useImperativeHandle, useMemo as useMemo5, useRef as useRef16, useState as useState26 } from "react";
|
|
4418
4418
|
|
|
4419
4419
|
// src/components/chat/ChatView.tsx
|
|
4420
4420
|
import React63, { useEffect as useEffect10 } from "react";
|
|
@@ -7346,13 +7346,6 @@ var ChatInterface = React88.forwardRef(
|
|
|
7346
7346
|
const prevArtifactNodesRef = useRef16([]);
|
|
7347
7347
|
const prevTasksRef = useRef16([]);
|
|
7348
7348
|
const [panelOpenArtifactId, setPanelOpenArtifactId] = useState26(null);
|
|
7349
|
-
const handleAttachmentOpen = useCallback24((artifactId) => {
|
|
7350
|
-
setPanelOpenArtifactId(artifactId);
|
|
7351
|
-
onAttachmentOpen?.(artifactId);
|
|
7352
|
-
}, [onAttachmentOpen]);
|
|
7353
|
-
const handleArtifactPanelClosed = useCallback24(() => {
|
|
7354
|
-
setPanelOpenArtifactId(null);
|
|
7355
|
-
}, []);
|
|
7356
7349
|
const [internalTools, setInternalTools] = useState26({
|
|
7357
7350
|
"top-left": "history",
|
|
7358
7351
|
"bottom-left": null,
|
|
@@ -7360,6 +7353,23 @@ var ChatInterface = React88.forwardRef(
|
|
|
7360
7353
|
"bottom-right": null
|
|
7361
7354
|
});
|
|
7362
7355
|
const dismissedToolsRef = useRef16(/* @__PURE__ */ new Set());
|
|
7356
|
+
const openArtifact = useCallback24((artifactId) => {
|
|
7357
|
+
dismissedToolsRef.current.delete("artifacts");
|
|
7358
|
+
if (isArtifactsPanelOpen === void 0) {
|
|
7359
|
+
setInternalTools((prev) => prev["top-right"] === "artifacts" ? prev : { ...prev, "top-right": "artifacts" });
|
|
7360
|
+
} else if (!isArtifactsPanelOpen) {
|
|
7361
|
+
onArtifactsPanelOpenChange?.(true);
|
|
7362
|
+
}
|
|
7363
|
+
setPanelOpenArtifactId(artifactId);
|
|
7364
|
+
}, [isArtifactsPanelOpen, onArtifactsPanelOpenChange]);
|
|
7365
|
+
const handleAttachmentOpen = useCallback24((artifactId) => {
|
|
7366
|
+
openArtifact(artifactId);
|
|
7367
|
+
onAttachmentOpen?.(artifactId);
|
|
7368
|
+
}, [openArtifact, onAttachmentOpen]);
|
|
7369
|
+
const handleArtifactPanelClosed = useCallback24(() => {
|
|
7370
|
+
setPanelOpenArtifactId(null);
|
|
7371
|
+
}, []);
|
|
7372
|
+
useImperativeHandle(ref, () => ({ openArtifact }), [openArtifact]);
|
|
7363
7373
|
const isPanelControlled = isArtifactsPanelOpen !== void 0;
|
|
7364
7374
|
const activeTools = useMemo5(() => {
|
|
7365
7375
|
if (isPanelControlled) {
|
|
@@ -7656,7 +7666,6 @@ var ChatInterface = React88.forwardRef(
|
|
|
7656
7666
|
return /* @__PURE__ */ React88.createElement(
|
|
7657
7667
|
"div",
|
|
7658
7668
|
{
|
|
7659
|
-
ref,
|
|
7660
7669
|
className: cx("flex h-full w-full bg-obsidian overflow-hidden", className),
|
|
7661
7670
|
...rest
|
|
7662
7671
|
},
|