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