@axiom-lattice/react-sdk 2.1.87 → 2.1.88

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.mjs CHANGED
@@ -5174,7 +5174,7 @@ var ColumnLayout = ({
5174
5174
  closeTools
5175
5175
  } = useChatUIContext();
5176
5176
  const isMobile = useMediaQuery("(max-width: 768px)");
5177
- const isMenuCollapsed = menuCollapsed ?? (isMobile || detailVisible);
5177
+ const isMenuCollapsed = detailVisible || (menuCollapsed ?? isMobile);
5178
5178
  const isAutoCollapsed = detailVisible && !isMobile;
5179
5179
  const menuStateClass = isMenuCollapsed ? "collapsed" : "expanded";
5180
5180
  const hasSidePanelsOpen = detailVisible || toolsVisible;
@@ -30719,6 +30719,7 @@ var IFRAME_STYLE = {
30719
30719
  };
30720
30720
  var AgentChatWithThread = ({ assistantId }) => {
30721
30721
  const { thread } = useConversationContext();
30722
+ const { menuCollapsed } = useChatUIContext();
30722
30723
  if (!thread) {
30723
30724
  return /* @__PURE__ */ jsx119("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: "100%" }, children: /* @__PURE__ */ jsx119(Spin21, { tip: "Creating conversation..." }) });
30724
30725
  }
@@ -30728,7 +30729,7 @@ var AgentChatWithThread = ({ assistantId }) => {
30728
30729
  thread_id: thread.id,
30729
30730
  assistant_id: assistantId,
30730
30731
  showProjectSelector: false,
30731
- menu: /* @__PURE__ */ jsx119(AgentConversations, {})
30732
+ menu: menuCollapsed ? void 0 : /* @__PURE__ */ jsx119(AgentConversations, {})
30732
30733
  }
30733
30734
  );
30734
30735
  };
@@ -31319,17 +31320,14 @@ var WorkspaceResourceManager = ({
31319
31320
  const { user, logout, tenants, currentTenant, selectTenant, isLoading } = useAuth();
31320
31321
  const { setWorkspace, setProject } = useWorkspaceContext();
31321
31322
  const { config } = useLatticeChatShellContext();
31323
+ const { get } = useApi();
31322
31324
  const [tenantModalOpen, setTenantModalOpen] = useState76(false);
31323
31325
  const [changePasswordOpen, setChangePasswordOpen] = useState76(false);
31324
31326
  const [fetchedCustomMenuItems, setFetchedCustomMenuItems] = useState76([]);
31325
31327
  useEffect52(() => {
31326
31328
  const fetchCustomMenu = async () => {
31327
31329
  try {
31328
- const baseUrl = config.baseURL || "";
31329
- const headers = {};
31330
- if (currentTenant?.id) headers["x-tenant-id"] = currentTenant.id;
31331
- const response = await fetch(`${baseUrl}/api/menu-items?menuTarget=workspace`, { headers });
31332
- const json = await response.json();
31330
+ const json = await get("/api/menu-items?menuTarget=workspace");
31333
31331
  if (json.success && json.data?.records) {
31334
31332
  const items = json.data.records.map(menuItemToSideMenuItemConfig);
31335
31333
  setFetchedCustomMenuItems(items);
@@ -31338,7 +31336,7 @@ var WorkspaceResourceManager = ({
31338
31336
  }
31339
31337
  };
31340
31338
  fetchCustomMenu();
31341
- }, [config.baseURL, currentTenant?.id]);
31339
+ }, [get]);
31342
31340
  useEffect52(() => {
31343
31341
  for (const item of fetchedCustomMenuItems) {
31344
31342
  regsiterElement(item.id, {
@@ -31915,9 +31913,8 @@ var MODAL_BODY_STYLE = {
31915
31913
  gap: 12
31916
31914
  };
31917
31915
  var PinToMenuButton = ({ assistantId }) => {
31918
- const { currentTenant } = useAuth();
31919
31916
  const workspaceCtx = React70.useContext(WorkspaceContext);
31920
- const { config } = useLatticeChatShellContext();
31917
+ const { post } = useApi();
31921
31918
  const [open, setOpen] = useState78(false);
31922
31919
  const [group, setGroup] = useState78("");
31923
31920
  const [name, setName] = useState78("");
@@ -31930,9 +31927,6 @@ var PinToMenuButton = ({ assistantId }) => {
31930
31927
  }
31931
31928
  setLoading(true);
31932
31929
  try {
31933
- const baseUrl = config.baseURL || "";
31934
- const headers = { "Content-Type": "application/json" };
31935
- if (currentTenant?.id) headers["x-tenant-id"] = currentTenant.id;
31936
31930
  const body = {
31937
31931
  menuTarget: "workspace",
31938
31932
  contentType: "agent",
@@ -31945,12 +31939,7 @@ var PinToMenuButton = ({ assistantId }) => {
31945
31939
  name: name.trim(),
31946
31940
  sortOrder: 0
31947
31941
  };
31948
- const response = await fetch(`${baseUrl}/api/menu-items`, {
31949
- method: "POST",
31950
- headers,
31951
- body: JSON.stringify(body)
31952
- });
31953
- const json = await response.json();
31942
+ const json = await post("/api/menu-items", body);
31954
31943
  if (json.success) {
31955
31944
  message19.success("Pinned to menu");
31956
31945
  setOpen(false);