@algenium/blocks 1.2.0-rc.2 → 1.2.0
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 +3 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -33
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6118,8 +6118,7 @@ function ChatSidebarProvider({
|
|
|
6118
6118
|
if (conv && conv.rooms.length === 1) {
|
|
6119
6119
|
setActiveRoomId(conv.rooms[0].id);
|
|
6120
6120
|
setView("chat");
|
|
6121
|
-
} else {
|
|
6122
|
-
setActiveRoomId(null);
|
|
6121
|
+
} else if (conv && conv.rooms.length > 1) {
|
|
6123
6122
|
setView("list");
|
|
6124
6123
|
}
|
|
6125
6124
|
}
|
|
@@ -6793,35 +6792,17 @@ function ChatSidebar({
|
|
|
6793
6792
|
selectRoom,
|
|
6794
6793
|
back
|
|
6795
6794
|
} = useChatSidebar();
|
|
6796
|
-
useEffect(() => {
|
|
6797
|
-
if (!isOpen || typeof window === "undefined") return;
|
|
6798
|
-
const mq = window.matchMedia("(max-width: 639px)");
|
|
6799
|
-
const apply = () => {
|
|
6800
|
-
if (mq.matches) document.body.style.overflow = "hidden";
|
|
6801
|
-
else document.body.style.overflow = "";
|
|
6802
|
-
};
|
|
6803
|
-
apply();
|
|
6804
|
-
mq.addEventListener("change", apply);
|
|
6805
|
-
return () => {
|
|
6806
|
-
mq.removeEventListener("change", apply);
|
|
6807
|
-
document.body.style.overflow = "";
|
|
6808
|
-
};
|
|
6809
|
-
}, [isOpen]);
|
|
6810
6795
|
if (!isOpen) return null;
|
|
6811
6796
|
const getRoomTypeLabel = (type) => {
|
|
6812
6797
|
if (roomTypeLabel) return roomTypeLabel(type);
|
|
6813
6798
|
return roomTypeLabels[type] ?? type;
|
|
6814
6799
|
};
|
|
6815
6800
|
const activeConversation = activeCaseId ? conversations.find((c) => c.caseId === activeCaseId) : null;
|
|
6816
|
-
|
|
6801
|
+
return /* @__PURE__ */ jsx(
|
|
6817
6802
|
"div",
|
|
6818
6803
|
{
|
|
6819
6804
|
className: cn(
|
|
6820
|
-
"flex
|
|
6821
|
-
// Below sm (~640px): fullscreen overlay drawer above sticky app headers (often z-50)
|
|
6822
|
-
"fixed inset-0 z-[100] w-full max-w-none border-0 shadow-none",
|
|
6823
|
-
// sm+: docked right sidebar in the app shell flex row
|
|
6824
|
-
"sm:relative sm:inset-auto sm:z-auto sm:h-full sm:w-[360px] sm:max-w-[360px] sm:shrink-0 sm:border-l sm:shadow-none xl:w-[400px] xl:max-w-[400px]",
|
|
6805
|
+
"flex h-full w-[360px] flex-col border-l bg-background xl:w-[400px]",
|
|
6825
6806
|
className
|
|
6826
6807
|
),
|
|
6827
6808
|
children: view === "list" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -6916,17 +6897,6 @@ function ChatSidebar({
|
|
|
6916
6897
|
] })
|
|
6917
6898
|
}
|
|
6918
6899
|
);
|
|
6919
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6920
|
-
/* @__PURE__ */ jsx(
|
|
6921
|
-
"div",
|
|
6922
|
-
{
|
|
6923
|
-
className: "fixed inset-0 z-[90] bg-black/50 sm:hidden",
|
|
6924
|
-
"aria-hidden": true,
|
|
6925
|
-
onClick: close
|
|
6926
|
-
}
|
|
6927
|
-
),
|
|
6928
|
-
panel
|
|
6929
|
-
] });
|
|
6930
6900
|
}
|
|
6931
6901
|
function formatRelativeTime(dateStr) {
|
|
6932
6902
|
const date = new Date(dateStr);
|