@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.d.cts CHANGED
@@ -535,7 +535,7 @@ interface CrowCopilotProps {
535
535
  */
536
536
  mode?: "sidebar" | "fullscreen";
537
537
  }
538
- declare function CrowCopilot({ productId, apiUrl, subdomain, variant, title, agentName: agentNameProp, welcomeMessage: welcomeMessageProp, position, width, defaultOpen, showClose, onClose, styles: propStyles, previewMode, className, onReady, navigate, onToolResult, toolRenderers, getIdentityToken, context, language, contextLabel: contextLabelProp, forceOnboarding, fullscreenTopOffset: _fullscreenTopOffset, mode: _mode, }: CrowCopilotProps): react_jsx_runtime.JSX.Element;
538
+ declare function CrowCopilot({ productId, apiUrl, subdomain, variant, title, agentName: agentNameProp, welcomeMessage: welcomeMessageProp, position, width, defaultOpen, showClose, onClose, styles: propStyles, previewMode, className, onReady, navigate, onToolResult, toolRenderers, getIdentityToken, context, language, contextLabel: contextLabelProp, forceOnboarding, fullscreenTopOffset, mode, }: CrowCopilotProps): react_jsx_runtime.JSX.Element;
539
539
 
540
540
  interface CrowOnboardingProps {
541
541
  /** Product ID */
package/dist/index.d.ts CHANGED
@@ -535,7 +535,7 @@ interface CrowCopilotProps {
535
535
  */
536
536
  mode?: "sidebar" | "fullscreen";
537
537
  }
538
- declare function CrowCopilot({ productId, apiUrl, subdomain, variant, title, agentName: agentNameProp, welcomeMessage: welcomeMessageProp, position, width, defaultOpen, showClose, onClose, styles: propStyles, previewMode, className, onReady, navigate, onToolResult, toolRenderers, getIdentityToken, context, language, contextLabel: contextLabelProp, forceOnboarding, fullscreenTopOffset: _fullscreenTopOffset, mode: _mode, }: CrowCopilotProps): react_jsx_runtime.JSX.Element;
538
+ declare function CrowCopilot({ productId, apiUrl, subdomain, variant, title, agentName: agentNameProp, welcomeMessage: welcomeMessageProp, position, width, defaultOpen, showClose, onClose, styles: propStyles, previewMode, className, onReady, navigate, onToolResult, toolRenderers, getIdentityToken, context, language, contextLabel: contextLabelProp, forceOnboarding, fullscreenTopOffset, mode, }: CrowCopilotProps): react_jsx_runtime.JSX.Element;
539
539
 
540
540
  interface CrowOnboardingProps {
541
541
  /** Product ID */
package/dist/index.js CHANGED
@@ -5818,8 +5818,8 @@ function CrowCopilot({
5818
5818
  language,
5819
5819
  contextLabel: contextLabelProp,
5820
5820
  forceOnboarding = false,
5821
- fullscreenTopOffset: _fullscreenTopOffset = 0,
5822
- mode: _mode
5821
+ fullscreenTopOffset = 0,
5822
+ mode
5823
5823
  }) {
5824
5824
  const effectiveGetIdentityToken = getIdentityToken || window.__crow_identity_token_fetcher;
5825
5825
  const effectiveOnToolResult = onToolResult || window.__crow_on_tool_result;
@@ -5851,6 +5851,7 @@ function CrowCopilot({
5851
5851
  });
5852
5852
  const agentName = agentNameProp ?? agentNameFromAPI ?? title;
5853
5853
  const [isOnboarding, setIsOnboarding] = useState(false);
5854
+ const [isFullscreenOnboarding, setIsFullscreenOnboarding] = useState(true);
5854
5855
  const [onboardingChecked, setOnboardingChecked] = useState(false);
5855
5856
  const [onboardingPhase, setOnboardingPhase] = useState("intro");
5856
5857
  useEffect(() => {
@@ -6284,6 +6285,7 @@ function CrowCopilot({
6284
6285
  useEffect(() => {
6285
6286
  if (isOnboarding && !prevOnboardingRef.current) {
6286
6287
  chat.setSuggestedActions([]);
6288
+ chat.resetMessages();
6287
6289
  }
6288
6290
  if (prevOnboardingRef.current && !isOnboarding) {
6289
6291
  chat.resetMessages();
@@ -6597,7 +6599,7 @@ function CrowCopilot({
6597
6599
  checkTabsOverflow();
6598
6600
  }, [tabs.length, checkTabsOverflow]);
6599
6601
  const widthStyle = typeof width === "number" ? `${width}px` : width;
6600
- const renderCopilotContent = (overrideOnClose, forceShowClose, overrideWidth) => /* @__PURE__ */ jsx(
6602
+ const renderCopilotContent = (overrideOnClose, forceShowClose, overrideWidth, hideBorder) => /* @__PURE__ */ jsx(
6601
6603
  CopilotStyleProvider,
6602
6604
  {
6603
6605
  styles,
@@ -6606,7 +6608,7 @@ function CrowCopilot({
6606
6608
  children: /* @__PURE__ */ jsxs(
6607
6609
  "div",
6608
6610
  {
6609
- className: `crow-flex crow-flex-col crow-h-full ${position === "left" ? "crow-border-r" : "crow-border-l"} ${className || ""}`,
6611
+ className: `crow-flex crow-flex-col crow-h-full ${hideBorder ? "" : position === "left" ? "crow-border-r" : "crow-border-l"} ${className || ""}`,
6610
6612
  style: {
6611
6613
  width: overrideWidth ? typeof overrideWidth === "number" ? `${overrideWidth}px` : overrideWidth : widthStyle,
6612
6614
  fontFamily: styles.typography.fontFamily,
@@ -6639,17 +6641,30 @@ function CrowCopilot({
6639
6641
  style: { borderColor: styles.colors.border },
6640
6642
  children: [
6641
6643
  /* @__PURE__ */ jsx("span", { className: "crow-text-[13px] crow-font-semibold", style: { color: styles.colors.text }, children: onboardingAgentName || agentName }),
6642
- /* @__PURE__ */ jsx(
6643
- "button",
6644
- {
6645
- onClick: () => {
6646
- setIsOnboarding(false);
6647
- },
6648
- className: "crow-text-xs crow-border-none crow-bg-transparent crow-cursor-pointer crow-px-2 crow-py-1",
6649
- style: { color: styles.colors.text + "60" },
6650
- children: "Skip"
6651
- }
6652
- )
6644
+ /* @__PURE__ */ jsxs("div", { className: "crow-flex crow-items-center crow-gap-1", children: [
6645
+ mode === "fullscreen" && isFullscreenOnboarding && /* @__PURE__ */ jsx(
6646
+ "button",
6647
+ {
6648
+ onClick: () => {
6649
+ setIsFullscreenOnboarding(false);
6650
+ },
6651
+ className: "crow-text-xs crow-border-none crow-bg-transparent crow-cursor-pointer crow-px-2 crow-py-1",
6652
+ style: { color: styles.colors.text + "60" },
6653
+ children: "Minimize"
6654
+ }
6655
+ ),
6656
+ /* @__PURE__ */ jsx(
6657
+ "button",
6658
+ {
6659
+ onClick: () => {
6660
+ setIsOnboarding(false);
6661
+ },
6662
+ className: "crow-text-xs crow-border-none crow-bg-transparent crow-cursor-pointer crow-px-2 crow-py-1",
6663
+ style: { color: styles.colors.text + "60" },
6664
+ children: "Skip"
6665
+ }
6666
+ )
6667
+ ] })
6653
6668
  ]
6654
6669
  }
6655
6670
  ),
@@ -6978,6 +6993,27 @@ function CrowCopilot({
6978
6993
  }
6979
6994
  );
6980
6995
  const floatingWidth = typeof width === "number" ? width : parseInt(String(width), 10) || 400;
6996
+ if (mode === "fullscreen" && isOnboarding && isFullscreenOnboarding) {
6997
+ return /* @__PURE__ */ jsx(ShadowContainer, { styles: WIDGET_CSS, children: /* @__PURE__ */ jsx("div", { style: {
6998
+ position: "fixed",
6999
+ top: 0,
7000
+ left: 0,
7001
+ width: "100vw",
7002
+ height: "100vh",
7003
+ zIndex: 2147483647,
7004
+ background: styles.colors.background || "#ffffff",
7005
+ display: "flex",
7006
+ flexDirection: "column",
7007
+ alignItems: "center",
7008
+ paddingTop: fullscreenTopOffset || 0
7009
+ }, children: /* @__PURE__ */ jsx("div", { style: {
7010
+ width: "100%",
7011
+ maxWidth: 760,
7012
+ height: "100%",
7013
+ display: "flex",
7014
+ flexDirection: "column"
7015
+ }, children: renderCopilotContent(void 0, false, "100%", true) }) }) });
7016
+ }
6981
7017
  if (variant === "floating") {
6982
7018
  return /* @__PURE__ */ jsx(ShadowContainer, { styles: WIDGET_CSS, children: /* @__PURE__ */ jsx(
6983
7019
  CopilotContainer,