@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 CHANGED
@@ -210,9 +210,14 @@ class EntityReference {
210
210
  * to the root of the database).
211
211
  */
212
212
  path;
213
- constructor(id, path) {
213
+ /**
214
+ * Optional database ID where the entity is stored (if multiple databases are used)
215
+ */
216
+ databaseId;
217
+ constructor(id, path, databaseId) {
214
218
  this.id = id;
215
219
  this.path = path;
220
+ this.databaseId = databaseId;
216
221
  }
217
222
  get pathWithId() {
218
223
  return `${this.path}/${this.id}`;
@@ -4763,21 +4768,27 @@ function checkLargeLayout(breakpoint = "lg") {
4763
4768
  return window.matchMedia(`(min-width: ${breakpoints[breakpoint] + 1}px)`).matches;
4764
4769
  }
4765
4770
  function useCollapsedGroups(groupNames) {
4771
+ console.log("Group names:", groupNames);
4766
4772
  const [collapsedGroups, setCollapsedGroups] = useState(() => {
4767
4773
  try {
4768
4774
  const stored = localStorage.getItem("firecms-collapsed-groups");
4775
+ console.log("Loaded collapsed groups from localStorage:", stored);
4769
4776
  return stored ? JSON.parse(stored) : {};
4770
4777
  } catch {
4778
+ console.warn("Could not access localStorage to get collapsed groups");
4771
4779
  return {};
4772
4780
  }
4773
4781
  });
4774
4782
  useEffect(() => {
4775
4783
  try {
4776
4784
  localStorage.setItem("firecms-collapsed-groups", JSON.stringify(collapsedGroups));
4785
+ console.log("Loaded collapsed groups from localStorage to get collapsed groups");
4777
4786
  } catch {
4787
+ console.warn("Could not access localStorage to get collapsed groups");
4778
4788
  }
4779
4789
  }, [collapsedGroups]);
4780
4790
  useEffect(() => {
4791
+ console.log("Cleaning up collapsed groups. Current groups:", groupNames, "Current collapsed state:", collapsedGroups);
4781
4792
  if (groupNames.length === 0) return;
4782
4793
  const currentGroupNames = new Set(groupNames);
4783
4794
  setCollapsedGroups((prev) => {
@@ -4791,9 +4802,11 @@ function useCollapsedGroups(groupNames) {
4791
4802
  });
4792
4803
  }, [groupNames]);
4793
4804
  const isGroupCollapsed = useCallback((name) => {
4805
+ console.log("Checking if group is collapsed:", name, "State:", collapsedGroups);
4794
4806
  return !!collapsedGroups[name];
4795
4807
  }, [collapsedGroups]);
4796
4808
  const toggleGroupCollapsed = useCallback((name_0) => {
4809
+ console.log("Toggle group collapsed group:", name_0);
4797
4810
  setCollapsedGroups((prev_0) => ({
4798
4811
  ...prev_0,
4799
4812
  [name_0]: !prev_0[name_0]
@@ -13881,6 +13894,7 @@ function useHomePageDnd({
13881
13894
  onPersist?.(updated);
13882
13895
  return updated;
13883
13896
  });
13897
+ setDialogOpenForGroup(null);
13884
13898
  };
13885
13899
  const activeItemForOverlay = disabled || !activeId || activeIsGroup ? null : dndItems.flatMap((g_19) => g_19.entries).find((e_7) => e_7.url === activeId) || null;
13886
13900
  const activeGroupData = disabled || !activeId || !activeIsGroup ? null : dndItems.find((g_20) => g_20.name === activeId) || null;
@@ -14001,7 +14015,7 @@ function NewGroupDropZone(t0) {
14001
14015
  return t8;
14002
14016
  }
14003
14017
  function RenameGroupDialog(t0) {
14004
- const $ = c(41);
14018
+ const $ = c(40);
14005
14019
  const {
14006
14020
  open,
14007
14021
  initialName,
@@ -14193,19 +14207,18 @@ function RenameGroupDialog(t0) {
14193
14207
  t15 = $[35];
14194
14208
  }
14195
14209
  let t16;
14196
- if ($[36] !== onClose || $[37] !== open || $[38] !== t11 || $[39] !== t15) {
14197
- t16 = /* @__PURE__ */ jsxs(Dialog, { open, onOpenChange: onClose, children: [
14210
+ if ($[36] !== open || $[37] !== t11 || $[38] !== t15) {
14211
+ t16 = /* @__PURE__ */ jsxs(Dialog, { open, children: [
14198
14212
  t6,
14199
14213
  t11,
14200
14214
  t15
14201
14215
  ] });
14202
- $[36] = onClose;
14203
- $[37] = open;
14204
- $[38] = t11;
14205
- $[39] = t15;
14206
- $[40] = t16;
14216
+ $[36] = open;
14217
+ $[37] = t11;
14218
+ $[38] = t15;
14219
+ $[39] = t16;
14207
14220
  } else {
14208
- t16 = $[40];
14221
+ t16 = $[39];
14209
14222
  }
14210
14223
  return t16;
14211
14224
  }
@@ -14429,7 +14442,6 @@ function DefaultHomePage({
14429
14442
  ] }),
14430
14443
  dialogOpenForGroup && /* @__PURE__ */ jsx(RenameGroupDialog, { open: true, initialName: dialogOpenForGroup, existingGroupNames: items.map((g_9) => g_9.name).filter((n) => n !== dialogOpenForGroup), onClose: () => setDialogOpenForGroup(null), onRename: (newName) => {
14431
14444
  handleRenameGroup(dialogOpenForGroup, newName);
14432
- setDialogOpenForGroup(null);
14433
14445
  } })
14434
14446
  ] });
14435
14447
  }