@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.cjs
CHANGED
|
@@ -921,6 +921,12 @@ function useCrowAPI({ onIdentified, onReset } = {}) {
|
|
|
921
921
|
window.__crow_on_tool_result = opts;
|
|
922
922
|
console.log("[Crow] onToolResult callback registered");
|
|
923
923
|
break;
|
|
924
|
+
case "open":
|
|
925
|
+
window.dispatchEvent(new CustomEvent("crow:open"));
|
|
926
|
+
break;
|
|
927
|
+
case "close":
|
|
928
|
+
window.dispatchEvent(new CustomEvent("crow:close"));
|
|
929
|
+
break;
|
|
924
930
|
case "registerToolRenderers":
|
|
925
931
|
if (!opts || typeof opts !== "object") {
|
|
926
932
|
console.error("[Crow] registerToolRenderers() requires an object");
|
|
@@ -3342,6 +3348,16 @@ function CrowWidget({
|
|
|
3342
3348
|
const handleExitWorkflow = async () => {
|
|
3343
3349
|
await workflowActions.exitWorkflow();
|
|
3344
3350
|
};
|
|
3351
|
+
React3.useEffect(() => {
|
|
3352
|
+
const handleOpen = () => setIsCollapsed(false);
|
|
3353
|
+
const handleClose = () => setIsCollapsed(true);
|
|
3354
|
+
window.addEventListener("crow:open", handleOpen);
|
|
3355
|
+
window.addEventListener("crow:close", handleClose);
|
|
3356
|
+
return () => {
|
|
3357
|
+
window.removeEventListener("crow:open", handleOpen);
|
|
3358
|
+
window.removeEventListener("crow:close", handleClose);
|
|
3359
|
+
};
|
|
3360
|
+
}, []);
|
|
3345
3361
|
const handleBubbleClick = () => {
|
|
3346
3362
|
setIsCollapsed(!isCollapsed);
|
|
3347
3363
|
};
|
|
@@ -3586,6 +3602,16 @@ function CopilotContainer({
|
|
|
3586
3602
|
delete window.crowCopilot;
|
|
3587
3603
|
};
|
|
3588
3604
|
}, []);
|
|
3605
|
+
React3.useEffect(() => {
|
|
3606
|
+
const handleOpen = () => setIsOpen(true);
|
|
3607
|
+
const handleClose = () => setIsOpen(false);
|
|
3608
|
+
window.addEventListener("crow:open", handleOpen);
|
|
3609
|
+
window.addEventListener("crow:close", handleClose);
|
|
3610
|
+
return () => {
|
|
3611
|
+
window.removeEventListener("crow:open", handleOpen);
|
|
3612
|
+
window.removeEventListener("crow:close", handleClose);
|
|
3613
|
+
};
|
|
3614
|
+
}, []);
|
|
3589
3615
|
const handleMouseMove = React3.useCallback(
|
|
3590
3616
|
(e) => {
|
|
3591
3617
|
const deltaX = e.clientX - dragStartXRef.current;
|
|
@@ -3846,6 +3872,16 @@ function CrowCopilot({
|
|
|
3846
3872
|
setIsCollapsed(false);
|
|
3847
3873
|
}
|
|
3848
3874
|
}, [isCollapsed]);
|
|
3875
|
+
React3.useEffect(() => {
|
|
3876
|
+
const handleOpen = () => setIsCollapsed(false);
|
|
3877
|
+
const handleClose = () => setIsCollapsed(true);
|
|
3878
|
+
window.addEventListener("crow:open", handleOpen);
|
|
3879
|
+
window.addEventListener("crow:close", handleClose);
|
|
3880
|
+
return () => {
|
|
3881
|
+
window.removeEventListener("crow:open", handleOpen);
|
|
3882
|
+
window.removeEventListener("crow:close", handleClose);
|
|
3883
|
+
};
|
|
3884
|
+
}, []);
|
|
3849
3885
|
const messagesContainerRef = React3.useRef(null);
|
|
3850
3886
|
const tabsScrollRef = React3.useRef(null);
|
|
3851
3887
|
const executeClientToolRef = React3.useRef(null);
|
|
@@ -3962,6 +3998,7 @@ function CrowCopilot({
|
|
|
3962
3998
|
}
|
|
3963
3999
|
}, [shouldRestoreHistory, chat.conversationId, conversations, chat]);
|
|
3964
4000
|
React3.useEffect(() => {
|
|
4001
|
+
if (effectiveGetIdentityToken) return;
|
|
3965
4002
|
if (isLoadingStyles || hasRestoredActiveConvRef.current) return;
|
|
3966
4003
|
const timer = setTimeout(() => {
|
|
3967
4004
|
if (hasRestoredActiveConvRef.current || isVerifiedUser) return;
|
|
@@ -3978,7 +4015,7 @@ function CrowCopilot({
|
|
|
3978
4015
|
});
|
|
3979
4016
|
}, 500);
|
|
3980
4017
|
return () => clearTimeout(timer);
|
|
3981
|
-
}, [isLoadingStyles]);
|
|
4018
|
+
}, [isLoadingStyles, effectiveGetIdentityToken]);
|
|
3982
4019
|
React3.useEffect(() => {
|
|
3983
4020
|
try {
|
|
3984
4021
|
if (chat.conversationId) {
|