@firecms/core 3.0.0-canary.272 → 3.0.0-canary.274
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.es.js +23 -11
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +23 -11
- package/dist/index.umd.js.map +1 -1
- package/dist/types/entities.d.ts +5 -1
- package/package.json +5 -5
- package/src/components/HomePage/DefaultHomePage.tsx +0 -1
- package/src/components/HomePage/HomePageDnD.tsx +1 -0
- package/src/components/HomePage/RenameGroupDialog.tsx +9 -3
- package/src/hooks/useCollapsedGroups.ts +10 -0
- package/src/types/entities.ts +7 -1
package/dist/index.umd.js
CHANGED
|
@@ -208,9 +208,14 @@
|
|
|
208
208
|
* to the root of the database).
|
|
209
209
|
*/
|
|
210
210
|
path;
|
|
211
|
-
|
|
211
|
+
/**
|
|
212
|
+
* Optional database ID where the entity is stored (if multiple databases are used)
|
|
213
|
+
*/
|
|
214
|
+
databaseId;
|
|
215
|
+
constructor(id, path, databaseId) {
|
|
212
216
|
this.id = id;
|
|
213
217
|
this.path = path;
|
|
218
|
+
this.databaseId = databaseId;
|
|
214
219
|
}
|
|
215
220
|
get pathWithId() {
|
|
216
221
|
return `${this.path}/${this.id}`;
|
|
@@ -4761,21 +4766,27 @@
|
|
|
4761
4766
|
return window.matchMedia(`(min-width: ${breakpoints[breakpoint] + 1}px)`).matches;
|
|
4762
4767
|
}
|
|
4763
4768
|
function useCollapsedGroups(groupNames) {
|
|
4769
|
+
console.log("Group names:", groupNames);
|
|
4764
4770
|
const [collapsedGroups, setCollapsedGroups] = React.useState(() => {
|
|
4765
4771
|
try {
|
|
4766
4772
|
const stored = localStorage.getItem("firecms-collapsed-groups");
|
|
4773
|
+
console.log("Loaded collapsed groups from localStorage:", stored);
|
|
4767
4774
|
return stored ? JSON.parse(stored) : {};
|
|
4768
4775
|
} catch {
|
|
4776
|
+
console.warn("Could not access localStorage to get collapsed groups");
|
|
4769
4777
|
return {};
|
|
4770
4778
|
}
|
|
4771
4779
|
});
|
|
4772
4780
|
React.useEffect(() => {
|
|
4773
4781
|
try {
|
|
4774
4782
|
localStorage.setItem("firecms-collapsed-groups", JSON.stringify(collapsedGroups));
|
|
4783
|
+
console.log("Loaded collapsed groups from localStorage to get collapsed groups");
|
|
4775
4784
|
} catch {
|
|
4785
|
+
console.warn("Could not access localStorage to get collapsed groups");
|
|
4776
4786
|
}
|
|
4777
4787
|
}, [collapsedGroups]);
|
|
4778
4788
|
React.useEffect(() => {
|
|
4789
|
+
console.log("Cleaning up collapsed groups. Current groups:", groupNames, "Current collapsed state:", collapsedGroups);
|
|
4779
4790
|
if (groupNames.length === 0) return;
|
|
4780
4791
|
const currentGroupNames = new Set(groupNames);
|
|
4781
4792
|
setCollapsedGroups((prev) => {
|
|
@@ -4789,9 +4800,11 @@
|
|
|
4789
4800
|
});
|
|
4790
4801
|
}, [groupNames]);
|
|
4791
4802
|
const isGroupCollapsed = React.useCallback((name) => {
|
|
4803
|
+
console.log("Checking if group is collapsed:", name, "State:", collapsedGroups);
|
|
4792
4804
|
return !!collapsedGroups[name];
|
|
4793
4805
|
}, [collapsedGroups]);
|
|
4794
4806
|
const toggleGroupCollapsed = React.useCallback((name_0) => {
|
|
4807
|
+
console.log("Toggle group collapsed group:", name_0);
|
|
4795
4808
|
setCollapsedGroups((prev_0) => ({
|
|
4796
4809
|
...prev_0,
|
|
4797
4810
|
[name_0]: !prev_0[name_0]
|
|
@@ -13879,6 +13892,7 @@
|
|
|
13879
13892
|
onPersist?.(updated);
|
|
13880
13893
|
return updated;
|
|
13881
13894
|
});
|
|
13895
|
+
setDialogOpenForGroup(null);
|
|
13882
13896
|
};
|
|
13883
13897
|
const activeItemForOverlay = disabled || !activeId || activeIsGroup ? null : dndItems.flatMap((g_19) => g_19.entries).find((e_7) => e_7.url === activeId) || null;
|
|
13884
13898
|
const activeGroupData = disabled || !activeId || !activeIsGroup ? null : dndItems.find((g_20) => g_20.name === activeId) || null;
|
|
@@ -13999,7 +14013,7 @@
|
|
|
13999
14013
|
return t8;
|
|
14000
14014
|
}
|
|
14001
14015
|
function RenameGroupDialog(t0) {
|
|
14002
|
-
const $ = reactCompilerRuntime.c(
|
|
14016
|
+
const $ = reactCompilerRuntime.c(40);
|
|
14003
14017
|
const {
|
|
14004
14018
|
open,
|
|
14005
14019
|
initialName,
|
|
@@ -14191,19 +14205,18 @@
|
|
|
14191
14205
|
t15 = $[35];
|
|
14192
14206
|
}
|
|
14193
14207
|
let t16;
|
|
14194
|
-
if ($[36] !==
|
|
14195
|
-
t16 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Dialog, { open,
|
|
14208
|
+
if ($[36] !== open || $[37] !== t11 || $[38] !== t15) {
|
|
14209
|
+
t16 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Dialog, { open, children: [
|
|
14196
14210
|
t6,
|
|
14197
14211
|
t11,
|
|
14198
14212
|
t15
|
|
14199
14213
|
] });
|
|
14200
|
-
$[36] =
|
|
14201
|
-
$[37] =
|
|
14202
|
-
$[38] =
|
|
14203
|
-
$[39] =
|
|
14204
|
-
$[40] = t16;
|
|
14214
|
+
$[36] = open;
|
|
14215
|
+
$[37] = t11;
|
|
14216
|
+
$[38] = t15;
|
|
14217
|
+
$[39] = t16;
|
|
14205
14218
|
} else {
|
|
14206
|
-
t16 = $[
|
|
14219
|
+
t16 = $[39];
|
|
14207
14220
|
}
|
|
14208
14221
|
return t16;
|
|
14209
14222
|
}
|
|
@@ -14427,7 +14440,6 @@
|
|
|
14427
14440
|
] }),
|
|
14428
14441
|
dialogOpenForGroup && /* @__PURE__ */ jsxRuntime.jsx(RenameGroupDialog, { open: true, initialName: dialogOpenForGroup, existingGroupNames: items.map((g_9) => g_9.name).filter((n) => n !== dialogOpenForGroup), onClose: () => setDialogOpenForGroup(null), onRename: (newName) => {
|
|
14429
14442
|
handleRenameGroup(dialogOpenForGroup, newName);
|
|
14430
|
-
setDialogOpenForGroup(null);
|
|
14431
14443
|
} })
|
|
14432
14444
|
] });
|
|
14433
14445
|
}
|