@usecrow/ui 0.1.61 → 0.1.63

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 CHANGED
@@ -1256,6 +1256,13 @@ function useCrowAPI({ onIdentified, onReset } = {}) {
1256
1256
  new CustomEvent("crow:setGreeting", { detail: options })
1257
1257
  );
1258
1258
  break;
1259
+ case "ask": {
1260
+ if (!opts || typeof opts !== "object") {
1261
+ console.error("[Crow] ask() requires an options object");
1262
+ return;
1263
+ }
1264
+ return client.crowAsk(opts);
1265
+ }
1259
1266
  case "setSuggestedActions":
1260
1267
  if (!Array.isArray(options)) {
1261
1268
  console.error("[Crow] setSuggestedActions() requires an array of { label, message }");
@@ -3912,7 +3919,22 @@ function CrowWidget({
3912
3919
  const messagesContainerRef = React3.useRef(null);
3913
3920
  const executeClientToolRef = React3.useRef(null);
3914
3921
  const submitToolResultRef = React3.useRef(null);
3915
- const [isCollapsed, setIsCollapsed] = React3.useState(variant === "floating");
3922
+ const [isCollapsed, setIsCollapsed] = React3.useState(() => {
3923
+ if (variant !== "floating") return false;
3924
+ try {
3925
+ const stored = sessionStorage.getItem("crow_widget_collapsed");
3926
+ if (stored !== null) return stored === "true";
3927
+ } catch {
3928
+ }
3929
+ return true;
3930
+ });
3931
+ React3.useEffect(() => {
3932
+ if (variant !== "floating") return;
3933
+ try {
3934
+ sessionStorage.setItem("crow_widget_collapsed", String(isCollapsed));
3935
+ } catch {
3936
+ }
3937
+ }, [isCollapsed, variant]);
3916
3938
  const [showConversationList, setShowConversationList] = React3.useState(false);
3917
3939
  const [isVerifiedUser, setIsVerifiedUser] = React3.useState(false);
3918
3940
  const [isBrowserUseActive, setIsBrowserUseActive] = React3.useState(false);