@usecrow/ui 0.1.77 → 0.1.79
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 +56 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +56 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4907,8 +4907,11 @@ function CrowWidget({
|
|
|
4907
4907
|
wasLoadingRef.current = chat.isLoading;
|
|
4908
4908
|
}, [chat.isLoading, chat.messages]);
|
|
4909
4909
|
React3.useEffect(() => {
|
|
4910
|
-
if (!isOnboarding && initialSuggestions.length > 0
|
|
4911
|
-
|
|
4910
|
+
if (!isOnboarding && initialSuggestions.length > 0) {
|
|
4911
|
+
defaultSuggestedActionsRef.current = initialSuggestions;
|
|
4912
|
+
if (chat.suggestedActions.length === 0) {
|
|
4913
|
+
chat.setSuggestedActions(initialSuggestions);
|
|
4914
|
+
}
|
|
4912
4915
|
}
|
|
4913
4916
|
}, [initialSuggestions, isOnboarding]);
|
|
4914
4917
|
React3.useEffect(() => {
|
|
@@ -5845,8 +5848,8 @@ function CrowCopilot({
|
|
|
5845
5848
|
language,
|
|
5846
5849
|
contextLabel: contextLabelProp,
|
|
5847
5850
|
forceOnboarding = false,
|
|
5848
|
-
fullscreenTopOffset
|
|
5849
|
-
mode
|
|
5851
|
+
fullscreenTopOffset = 0,
|
|
5852
|
+
mode
|
|
5850
5853
|
}) {
|
|
5851
5854
|
const effectiveGetIdentityToken = getIdentityToken || window.__crow_identity_token_fetcher;
|
|
5852
5855
|
const effectiveOnToolResult = onToolResult || window.__crow_on_tool_result;
|
|
@@ -5878,6 +5881,7 @@ function CrowCopilot({
|
|
|
5878
5881
|
});
|
|
5879
5882
|
const agentName = agentNameProp ?? agentNameFromAPI ?? title;
|
|
5880
5883
|
const [isOnboarding, setIsOnboarding] = React3.useState(false);
|
|
5884
|
+
const [isFullscreenOnboarding, setIsFullscreenOnboarding] = React3.useState(true);
|
|
5881
5885
|
const [onboardingChecked, setOnboardingChecked] = React3.useState(false);
|
|
5882
5886
|
const [onboardingPhase, setOnboardingPhase] = React3.useState("intro");
|
|
5883
5887
|
React3.useEffect(() => {
|
|
@@ -6311,6 +6315,7 @@ function CrowCopilot({
|
|
|
6311
6315
|
React3.useEffect(() => {
|
|
6312
6316
|
if (isOnboarding && !prevOnboardingRef.current) {
|
|
6313
6317
|
chat.setSuggestedActions([]);
|
|
6318
|
+
chat.resetMessages();
|
|
6314
6319
|
}
|
|
6315
6320
|
if (prevOnboardingRef.current && !isOnboarding) {
|
|
6316
6321
|
chat.resetMessages();
|
|
@@ -6624,7 +6629,7 @@ function CrowCopilot({
|
|
|
6624
6629
|
checkTabsOverflow();
|
|
6625
6630
|
}, [tabs.length, checkTabsOverflow]);
|
|
6626
6631
|
const widthStyle = typeof width === "number" ? `${width}px` : width;
|
|
6627
|
-
const renderCopilotContent = (overrideOnClose, forceShowClose, overrideWidth) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6632
|
+
const renderCopilotContent = (overrideOnClose, forceShowClose, overrideWidth, hideBorder) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6628
6633
|
CopilotStyleProvider,
|
|
6629
6634
|
{
|
|
6630
6635
|
styles,
|
|
@@ -6633,7 +6638,7 @@ function CrowCopilot({
|
|
|
6633
6638
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6634
6639
|
"div",
|
|
6635
6640
|
{
|
|
6636
|
-
className: `crow-flex crow-flex-col crow-h-full ${position === "left" ? "crow-border-r" : "crow-border-l"} ${className || ""}`,
|
|
6641
|
+
className: `crow-flex crow-flex-col crow-h-full ${hideBorder ? "" : position === "left" ? "crow-border-r" : "crow-border-l"} ${className || ""}`,
|
|
6637
6642
|
style: {
|
|
6638
6643
|
width: overrideWidth ? typeof overrideWidth === "number" ? `${overrideWidth}px` : overrideWidth : widthStyle,
|
|
6639
6644
|
fontFamily: styles.typography.fontFamily,
|
|
@@ -6666,17 +6671,30 @@ function CrowCopilot({
|
|
|
6666
6671
|
style: { borderColor: styles.colors.border },
|
|
6667
6672
|
children: [
|
|
6668
6673
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "crow-text-[13px] crow-font-semibold", style: { color: styles.colors.text }, children: onboardingAgentName || agentName }),
|
|
6669
|
-
/* @__PURE__ */ jsxRuntime.
|
|
6670
|
-
"
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6674
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "crow-flex crow-items-center crow-gap-1", children: [
|
|
6675
|
+
mode === "fullscreen" && isFullscreenOnboarding && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6676
|
+
"button",
|
|
6677
|
+
{
|
|
6678
|
+
onClick: () => {
|
|
6679
|
+
setIsFullscreenOnboarding(false);
|
|
6680
|
+
},
|
|
6681
|
+
className: "crow-text-xs crow-border-none crow-bg-transparent crow-cursor-pointer crow-px-2 crow-py-1",
|
|
6682
|
+
style: { color: styles.colors.text + "60" },
|
|
6683
|
+
children: "Minimize"
|
|
6684
|
+
}
|
|
6685
|
+
),
|
|
6686
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6687
|
+
"button",
|
|
6688
|
+
{
|
|
6689
|
+
onClick: () => {
|
|
6690
|
+
setIsOnboarding(false);
|
|
6691
|
+
},
|
|
6692
|
+
className: "crow-text-xs crow-border-none crow-bg-transparent crow-cursor-pointer crow-px-2 crow-py-1",
|
|
6693
|
+
style: { color: styles.colors.text + "60" },
|
|
6694
|
+
children: "Skip"
|
|
6695
|
+
}
|
|
6696
|
+
)
|
|
6697
|
+
] })
|
|
6680
6698
|
]
|
|
6681
6699
|
}
|
|
6682
6700
|
),
|
|
@@ -7005,6 +7023,27 @@ function CrowCopilot({
|
|
|
7005
7023
|
}
|
|
7006
7024
|
);
|
|
7007
7025
|
const floatingWidth = typeof width === "number" ? width : parseInt(String(width), 10) || 400;
|
|
7026
|
+
if (mode === "fullscreen" && isOnboarding && isFullscreenOnboarding) {
|
|
7027
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShadowContainer, { styles: WIDGET_CSS, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
7028
|
+
position: "fixed",
|
|
7029
|
+
top: 0,
|
|
7030
|
+
left: 0,
|
|
7031
|
+
width: "100vw",
|
|
7032
|
+
height: "100vh",
|
|
7033
|
+
zIndex: 2147483647,
|
|
7034
|
+
background: styles.colors.background || "#ffffff",
|
|
7035
|
+
display: "flex",
|
|
7036
|
+
flexDirection: "column",
|
|
7037
|
+
alignItems: "center",
|
|
7038
|
+
paddingTop: fullscreenTopOffset || 0
|
|
7039
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
7040
|
+
width: "100%",
|
|
7041
|
+
maxWidth: 760,
|
|
7042
|
+
height: "100%",
|
|
7043
|
+
display: "flex",
|
|
7044
|
+
flexDirection: "column"
|
|
7045
|
+
}, children: renderCopilotContent(void 0, false, "100%", true) }) }) });
|
|
7046
|
+
}
|
|
7008
7047
|
if (variant === "floating") {
|
|
7009
7048
|
return /* @__PURE__ */ jsxRuntime.jsx(ShadowContainer, { styles: WIDGET_CSS, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7010
7049
|
CopilotContainer,
|