@axiom-lattice/react-sdk 4.2.1 → 4.2.2

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.mts CHANGED
@@ -5236,6 +5236,11 @@ interface RoomsPageProps {
5236
5236
  workspaceId: string;
5237
5237
  openRoom?: OpenRoomRequest | null;
5238
5238
  onRoomOpened?: () => void;
5239
+ /**
5240
+ * Notifies the host when a room chat is open so it can hide chrome that
5241
+ * would otherwise sit under a full-screen conversation (mobile tab bar).
5242
+ */
5243
+ onChatOpenChange?: (open: boolean) => void;
5239
5244
  }
5240
5245
  declare const RoomsPage: React__default.FC<RoomsPageProps>;
5241
5246
 
package/dist/index.d.ts CHANGED
@@ -5236,6 +5236,11 @@ interface RoomsPageProps {
5236
5236
  workspaceId: string;
5237
5237
  openRoom?: OpenRoomRequest | null;
5238
5238
  onRoomOpened?: () => void;
5239
+ /**
5240
+ * Notifies the host when a room chat is open so it can hide chrome that
5241
+ * would otherwise sit under a full-screen conversation (mobile tab bar).
5242
+ */
5243
+ onChatOpenChange?: (open: boolean) => void;
5239
5244
  }
5240
5245
  declare const RoomsPage: React__default.FC<RoomsPageProps>;
5241
5246
 
package/dist/index.js CHANGED
@@ -107976,9 +107976,14 @@ var init_ProjectRoomComposer = __esm({
107976
107976
  useStyles46 = (0, import_antd_style63.createStyles)(({ token, css }) => ({
107977
107977
  root: css`
107978
107978
  flex-shrink: 0;
107979
- border-top: 1px solid ${token.colorBorderSecondary};
107980
107979
  background: ${token.colorBgContainer};
107981
107980
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
107981
+
107982
+ @media (max-width: 768px) {
107983
+ /* Nearly full-bleed on phones: the Sender already brings its own inner
107984
+ padding, so extra host padding just wastes scarce width. */
107985
+ padding: 4px 6px max(6px, env(safe-area-inset-bottom));
107986
+ }
107982
107987
  `,
107983
107988
  reply: css`
107984
107989
  display: flex;
@@ -108223,6 +108228,7 @@ var init_ProjectRoomComposer = __esm({
108223
108228
  onKeyDown: handleSuggestionKeyDown,
108224
108229
  placeholder: "Message the room",
108225
108230
  autoSize: isMobile ? { minRows: 1, maxRows: 1 } : { minRows: 2, maxRows: 8 },
108231
+ styles: isMobile ? { content: { paddingInlineStart: 8, paddingInlineEnd: 8 } } : void 0,
108226
108232
  suffix: isMobile ? void 0 : false,
108227
108233
  prefix: isMobile ? attachButton : void 0,
108228
108234
  footer: isMobile ? void 0 : (actionNode) => /* @__PURE__ */ (0, import_jsx_runtime245.jsxs)(import_antd110.Flex, { justify: "space-between", align: "center", style: { padding: "8px 0 0" }, children: [
@@ -110690,7 +110696,7 @@ var init_RoomsPage = __esm({
110690
110696
  overflow: hidden;
110691
110697
  `
110692
110698
  }));
110693
- RoomsPage = ({ workspaceId, openRoom, onRoomOpened }) => {
110699
+ RoomsPage = ({ workspaceId, openRoom, onRoomOpened, onChatOpenChange }) => {
110694
110700
  const { styles } = useStyles54();
110695
110701
  const isMobile = useMediaQuery("(max-width: 768px)");
110696
110702
  const [selectedRoom, setSelectedRoom] = (0, import_react143.useState)(null);
@@ -110704,6 +110710,10 @@ var init_RoomsPage = __esm({
110704
110710
  void refreshRooms();
110705
110711
  onRoomOpened?.();
110706
110712
  }, [openRoom, onRoomOpened, refreshRooms]);
110713
+ (0, import_react143.useEffect)(() => {
110714
+ onChatOpenChange?.(selectedRoom !== null);
110715
+ return () => onChatOpenChange?.(false);
110716
+ }, [selectedRoom, onChatOpenChange]);
110707
110717
  const roomMenu = /* @__PURE__ */ (0, import_jsx_runtime253.jsx)("div", { className: styles.menuList, children: /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(
110708
110718
  RoomList,
110709
110719
  {
@@ -111523,16 +111533,22 @@ var init_CoSpaceContainer = __esm({
111523
111533
  const [activeTab, setActiveTab] = (0, import_react146.useState)("rooms");
111524
111534
  const [pendingRoom, setPendingRoom] = (0, import_react146.useState)(null);
111525
111535
  const [meOpen, setMeOpen] = (0, import_react146.useState)(false);
111536
+ const [roomChatOpen, setRoomChatOpen] = (0, import_react146.useState)(false);
111526
111537
  const handleNavigateToRoom = (0, import_react146.useCallback)((room) => {
111527
111538
  setPendingRoom(room);
111528
111539
  setActiveTab("rooms");
111529
111540
  }, []);
111541
+ const selectTab = (0, import_react146.useCallback)((tab) => {
111542
+ setActiveTab(tab);
111543
+ setRoomChatOpen(false);
111544
+ }, []);
111530
111545
  const page = activeTab === "rooms" ? /* @__PURE__ */ (0, import_jsx_runtime257.jsx)("div", { className: styles.page, children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
111531
111546
  RoomsPage,
111532
111547
  {
111533
111548
  workspaceId,
111534
111549
  openRoom: pendingRoom,
111535
- onRoomOpened: () => setPendingRoom(null)
111550
+ onRoomOpened: () => setPendingRoom(null),
111551
+ onChatOpenChange: setRoomChatOpen
111536
111552
  }
111537
111553
  ) }) : /* @__PURE__ */ (0, import_jsx_runtime257.jsx)("div", { className: styles.page, children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(OrgsPage, { workspaceId, onNavigateToRoom: handleNavigateToRoom }) });
111538
111554
  if (isMobile) {
@@ -111540,13 +111556,13 @@ var init_CoSpaceContainer = __esm({
111540
111556
  /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(RoomConnectionBanner, {}),
111541
111557
  /* @__PURE__ */ (0, import_jsx_runtime257.jsx)("div", { className: styles.inner, children: /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)("div", { className: styles.mobileRoot, children: [
111542
111558
  /* @__PURE__ */ (0, import_jsx_runtime257.jsx)("div", { className: styles.mobilePage, children: page }),
111543
- /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)("nav", { className: styles.tabBar, "aria-label": "CoSpace navigation", children: [
111559
+ !roomChatOpen && /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)("nav", { className: styles.tabBar, "aria-label": "CoSpace navigation", children: [
111544
111560
  /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)(
111545
111561
  "button",
111546
111562
  {
111547
111563
  type: "button",
111548
111564
  className: `${styles.tabButton} ${activeTab === "rooms" ? "active" : ""}`,
111549
- onClick: () => setActiveTab("rooms"),
111565
+ onClick: () => selectTab("rooms"),
111550
111566
  "aria-pressed": activeTab === "rooms",
111551
111567
  children: [
111552
111568
  /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(import_lucide_react58.MessageSquare, { size: 20 }),
@@ -111559,7 +111575,7 @@ var init_CoSpaceContainer = __esm({
111559
111575
  {
111560
111576
  type: "button",
111561
111577
  className: `${styles.tabButton} ${activeTab === "orgs" ? "active" : ""}`,
111562
- onClick: () => setActiveTab("orgs"),
111578
+ onClick: () => selectTab("orgs"),
111563
111579
  "aria-pressed": activeTab === "orgs",
111564
111580
  children: [
111565
111581
  /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(import_lucide_react58.Building2, { size: 20 }),