@usecrow/ui 0.1.46 → 0.1.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +38 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +38 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -895,6 +895,12 @@ function useCrowAPI({ onIdentified, onReset } = {}) {
|
|
|
895
895
|
window.__crow_on_tool_result = opts;
|
|
896
896
|
console.log("[Crow] onToolResult callback registered");
|
|
897
897
|
break;
|
|
898
|
+
case "open":
|
|
899
|
+
window.dispatchEvent(new CustomEvent("crow:open"));
|
|
900
|
+
break;
|
|
901
|
+
case "close":
|
|
902
|
+
window.dispatchEvent(new CustomEvent("crow:close"));
|
|
903
|
+
break;
|
|
898
904
|
case "registerToolRenderers":
|
|
899
905
|
if (!opts || typeof opts !== "object") {
|
|
900
906
|
console.error("[Crow] registerToolRenderers() requires an object");
|
|
@@ -3316,6 +3322,16 @@ function CrowWidget({
|
|
|
3316
3322
|
const handleExitWorkflow = async () => {
|
|
3317
3323
|
await workflowActions.exitWorkflow();
|
|
3318
3324
|
};
|
|
3325
|
+
useEffect(() => {
|
|
3326
|
+
const handleOpen = () => setIsCollapsed(false);
|
|
3327
|
+
const handleClose = () => setIsCollapsed(true);
|
|
3328
|
+
window.addEventListener("crow:open", handleOpen);
|
|
3329
|
+
window.addEventListener("crow:close", handleClose);
|
|
3330
|
+
return () => {
|
|
3331
|
+
window.removeEventListener("crow:open", handleOpen);
|
|
3332
|
+
window.removeEventListener("crow:close", handleClose);
|
|
3333
|
+
};
|
|
3334
|
+
}, []);
|
|
3319
3335
|
const handleBubbleClick = () => {
|
|
3320
3336
|
setIsCollapsed(!isCollapsed);
|
|
3321
3337
|
};
|
|
@@ -3560,6 +3576,16 @@ function CopilotContainer({
|
|
|
3560
3576
|
delete window.crowCopilot;
|
|
3561
3577
|
};
|
|
3562
3578
|
}, []);
|
|
3579
|
+
useEffect(() => {
|
|
3580
|
+
const handleOpen = () => setIsOpen(true);
|
|
3581
|
+
const handleClose = () => setIsOpen(false);
|
|
3582
|
+
window.addEventListener("crow:open", handleOpen);
|
|
3583
|
+
window.addEventListener("crow:close", handleClose);
|
|
3584
|
+
return () => {
|
|
3585
|
+
window.removeEventListener("crow:open", handleOpen);
|
|
3586
|
+
window.removeEventListener("crow:close", handleClose);
|
|
3587
|
+
};
|
|
3588
|
+
}, []);
|
|
3563
3589
|
const handleMouseMove = useCallback(
|
|
3564
3590
|
(e) => {
|
|
3565
3591
|
const deltaX = e.clientX - dragStartXRef.current;
|
|
@@ -3820,6 +3846,16 @@ function CrowCopilot({
|
|
|
3820
3846
|
setIsCollapsed(false);
|
|
3821
3847
|
}
|
|
3822
3848
|
}, [isCollapsed]);
|
|
3849
|
+
useEffect(() => {
|
|
3850
|
+
const handleOpen = () => setIsCollapsed(false);
|
|
3851
|
+
const handleClose = () => setIsCollapsed(true);
|
|
3852
|
+
window.addEventListener("crow:open", handleOpen);
|
|
3853
|
+
window.addEventListener("crow:close", handleClose);
|
|
3854
|
+
return () => {
|
|
3855
|
+
window.removeEventListener("crow:open", handleOpen);
|
|
3856
|
+
window.removeEventListener("crow:close", handleClose);
|
|
3857
|
+
};
|
|
3858
|
+
}, []);
|
|
3823
3859
|
const messagesContainerRef = useRef(null);
|
|
3824
3860
|
const tabsScrollRef = useRef(null);
|
|
3825
3861
|
const executeClientToolRef = useRef(null);
|
|
@@ -3936,6 +3972,7 @@ function CrowCopilot({
|
|
|
3936
3972
|
}
|
|
3937
3973
|
}, [shouldRestoreHistory, chat.conversationId, conversations, chat]);
|
|
3938
3974
|
useEffect(() => {
|
|
3975
|
+
if (effectiveGetIdentityToken) return;
|
|
3939
3976
|
if (isLoadingStyles || hasRestoredActiveConvRef.current) return;
|
|
3940
3977
|
const timer = setTimeout(() => {
|
|
3941
3978
|
if (hasRestoredActiveConvRef.current || isVerifiedUser) return;
|
|
@@ -3952,7 +3989,7 @@ function CrowCopilot({
|
|
|
3952
3989
|
});
|
|
3953
3990
|
}, 500);
|
|
3954
3991
|
return () => clearTimeout(timer);
|
|
3955
|
-
}, [isLoadingStyles]);
|
|
3992
|
+
}, [isLoadingStyles, effectiveGetIdentityToken]);
|
|
3956
3993
|
useEffect(() => {
|
|
3957
3994
|
try {
|
|
3958
3995
|
if (chat.conversationId) {
|