@firecms/core 3.5.2-canary.16bf7bb → 3.5.2-canary.a36570e

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.
Files changed (27) hide show
  1. package/dist/components/EntityCollectionView/CollectionCountBadge.d.ts +8 -0
  2. package/dist/components/EntityCollectionView/CollectionPathTitle.d.ts +24 -0
  3. package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +5 -0
  4. package/dist/components/EntityCollectionView/EntityIdHeaderWidget.d.ts +12 -0
  5. package/dist/components/EntityCollectionView/utils.d.ts +4 -3
  6. package/dist/index.es.js +592 -567
  7. package/dist/index.es.js.map +1 -1
  8. package/dist/index.umd.js +592 -567
  9. package/dist/index.umd.js.map +1 -1
  10. package/dist/internal/useLeavePageConfirmation.d.ts +11 -0
  11. package/dist/types/side_dialogs_controller.d.ts +4 -2
  12. package/package.json +3 -3
  13. package/src/components/EntityCollectionView/CollectionCountBadge.tsx +17 -0
  14. package/src/components/EntityCollectionView/CollectionPathTitle.tsx +68 -0
  15. package/src/components/EntityCollectionView/EntityCollectionView.tsx +12 -111
  16. package/src/components/EntityCollectionView/EntityIdHeaderWidget.tsx +166 -0
  17. package/src/components/EntityCollectionView/utils.ts +13 -7
  18. package/src/components/common/default_entity_actions.tsx +2 -1
  19. package/src/core/DefaultAppBar.tsx +12 -9
  20. package/src/core/EntityEditView.tsx +26 -1
  21. package/src/core/SideDialogs.tsx +6 -13
  22. package/src/hooks/useReferenceDialog.tsx +2 -2
  23. package/src/internal/useBuildSideDialogsController.tsx +44 -2
  24. package/src/internal/useLeavePageConfirmation.ts +25 -0
  25. package/src/types/side_dialogs_controller.tsx +4 -2
  26. package/dist/internal/useUnsavedChangesDialog.d.ts +0 -12
  27. package/src/internal/useUnsavedChangesDialog.tsx +0 -142
package/dist/index.es.js CHANGED
@@ -4805,7 +4805,7 @@ function getLoadedDateFnsLocale(locale) {
4805
4805
  }
4806
4806
  function useDateFnsLocale(locale) {
4807
4807
  const $ = c(7);
4808
- const [, forceUpdate] = useReducer(_temp$A, 0);
4808
+ const [, forceUpdate] = useReducer(_temp$C, 0);
4809
4809
  let t0;
4810
4810
  if ($[0] !== forceUpdate || $[1] !== locale) {
4811
4811
  t0 = () => {
@@ -4848,7 +4848,7 @@ function useDateFnsLocale(locale) {
4848
4848
  }
4849
4849
  return t2;
4850
4850
  }
4851
- function _temp$A(count) {
4851
+ function _temp$C(count) {
4852
4852
  return count + 1;
4853
4853
  }
4854
4854
  const CONTAINER_FULL_WIDTH = "100vw";
@@ -5065,7 +5065,7 @@ function useCollectionFetch(t0) {
5065
5065
  }
5066
5066
  setDataLoading(false);
5067
5067
  setDataLoadingError(void 0);
5068
- setData(entities.map(_temp$z));
5068
+ setData(entities.map(_temp$B));
5069
5069
  setNoMoreToLoad(!itemCount || entities.length < itemCount);
5070
5070
  };
5071
5071
  const onError = (error) => {
@@ -5100,7 +5100,7 @@ function useCollectionFetch(t0) {
5100
5100
  orderBy: sortByProperty,
5101
5101
  order: currentSort
5102
5102
  }).then(onEntitiesUpdate).catch(onError);
5103
- return _temp2$g;
5103
+ return _temp2$h;
5104
5104
  }
5105
5105
  };
5106
5106
  $[8] = collection;
@@ -5149,9 +5149,9 @@ function useCollectionFetch(t0) {
5149
5149
  }
5150
5150
  return t6;
5151
5151
  }
5152
- function _temp2$g() {
5152
+ function _temp2$h() {
5153
5153
  }
5154
- function _temp$z(e_1) {
5154
+ function _temp$B(e_1) {
5155
5155
  return {
5156
5156
  ...e_1
5157
5157
  };
@@ -5364,7 +5364,7 @@ function useEntityFetch(t0) {
5364
5364
  setEntity(CACHE[entityCacheKey(path, entityId)]);
5365
5365
  setDataLoading(false);
5366
5366
  setDataLoadingError(void 0);
5367
- return _temp$y;
5367
+ return _temp$A;
5368
5368
  } else {
5369
5369
  if (entityId && path && collection) {
5370
5370
  if (dataSource.listenEntity) {
@@ -5385,7 +5385,7 @@ function useEntityFetch(t0) {
5385
5385
  databaseId,
5386
5386
  collection
5387
5387
  }).then(onEntityUpdate).catch(onError);
5388
- return _temp2$f;
5388
+ return _temp2$g;
5389
5389
  }
5390
5390
  } else {
5391
5391
  onEntityUpdate(void 0);
@@ -5433,9 +5433,9 @@ function useEntityFetch(t0) {
5433
5433
  }
5434
5434
  function _temp3$6() {
5435
5435
  }
5436
- function _temp2$f() {
5436
+ function _temp2$g() {
5437
5437
  }
5438
- function _temp$y() {
5438
+ function _temp$A() {
5439
5439
  }
5440
5440
  async function saveEntityWithCallbacks({
5441
5441
  collection,
@@ -6090,7 +6090,7 @@ function ImagePreview(t0) {
6090
6090
  }
6091
6091
  let t9;
6092
6092
  if ($[19] !== url) {
6093
- t9 = /* @__PURE__ */ jsx(Tooltip, { title: "Open image in new tab", side: "bottom", children: /* @__PURE__ */ jsx(IconButton, { className: "invisible group-hover:visible", variant: "filled", component: "a", href: url, rel: "noopener noreferrer", target: "_blank", size: "smallest", onClick: _temp$x, children: t8 }) });
6093
+ t9 = /* @__PURE__ */ jsx(Tooltip, { title: "Open image in new tab", side: "bottom", children: /* @__PURE__ */ jsx(IconButton, { className: "invisible group-hover:visible", variant: "filled", component: "a", href: url, rel: "noopener noreferrer", target: "_blank", size: "smallest", onClick: _temp$z, children: t8 }) });
6094
6094
  $[19] = url;
6095
6095
  $[20] = t9;
6096
6096
  } else {
@@ -6124,7 +6124,7 @@ function ImagePreview(t0) {
6124
6124
  }
6125
6125
  return t11;
6126
6126
  }
6127
- function _temp$x(e_0) {
6127
+ function _temp$z(e_0) {
6128
6128
  return e_0.stopPropagation();
6129
6129
  }
6130
6130
  const FIRECMS_NS$1 = "firecms_core";
@@ -6191,7 +6191,7 @@ function UrlComponentPreview(t0) {
6191
6191
  }
6192
6192
  let t3;
6193
6193
  if ($[2] !== url) {
6194
- t3 = /* @__PURE__ */ jsxs("a", { className: "flex gap-4 break-words items-center font-medium text-primary visited:text-primary dark:visited:text-primary dark:text-primary", href: url, rel: "noopener noreferrer", onMouseDown: _temp$w, target: "_blank", children: [
6194
+ t3 = /* @__PURE__ */ jsxs("a", { className: "flex gap-4 break-words items-center font-medium text-primary visited:text-primary dark:visited:text-primary dark:text-primary", href: url, rel: "noopener noreferrer", onMouseDown: _temp$y, target: "_blank", children: [
6195
6195
  t2,
6196
6196
  url
6197
6197
  ] });
@@ -6293,7 +6293,7 @@ function UrlComponentPreview(t0) {
6293
6293
  }
6294
6294
  let t7;
6295
6295
  if ($[27] !== t4 || $[28] !== t6 || $[29] !== url) {
6296
- t7 = /* @__PURE__ */ jsxs("a", { href: url, rel: "noopener noreferrer", target: "_blank", onClick: _temp2$e, className: "flex flex-col items-center justify-center", style: t4, children: [
6296
+ t7 = /* @__PURE__ */ jsxs("a", { href: url, rel: "noopener noreferrer", target: "_blank", onClick: _temp2$f, className: "flex flex-col items-center justify-center", style: t4, children: [
6297
6297
  t5,
6298
6298
  t6
6299
6299
  ] });
@@ -6318,10 +6318,10 @@ function UrlComponentPreview(t0) {
6318
6318
  }
6319
6319
  }
6320
6320
  }
6321
- function _temp2$e(e_0) {
6321
+ function _temp2$f(e_0) {
6322
6322
  return e_0.stopPropagation();
6323
6323
  }
6324
- function _temp$w(e) {
6324
+ function _temp$y(e) {
6325
6325
  e.preventDefault();
6326
6326
  }
6327
6327
  function VideoPreview(t0) {
@@ -6455,7 +6455,7 @@ function SkeletonPropertyComponent(t0) {
6455
6455
  if (Array.isArray(arrayProperty.of)) {
6456
6456
  let t1;
6457
6457
  if ($[6] !== arrayProperty.of) {
6458
- t1 = arrayProperty.of.map(_temp$v);
6458
+ t1 = arrayProperty.of.map(_temp$x);
6459
6459
  $[6] = arrayProperty.of;
6460
6460
  $[7] = t1;
6461
6461
  } else {
@@ -6593,7 +6593,7 @@ function SkeletonPropertyComponent(t0) {
6593
6593
  }
6594
6594
  return content || null;
6595
6595
  }
6596
- function _temp$v(p, i) {
6596
+ function _temp$x(p, i) {
6597
6597
  return renderGenericArrayCell(p, i);
6598
6598
  }
6599
6599
  function renderMap(property, size) {
@@ -7784,7 +7784,7 @@ function DatePreview(t0) {
7784
7784
  timeZoneName: "short"
7785
7785
  });
7786
7786
  const parts = tzFormatter.formatToParts(date);
7787
- t32 = parts.find(_temp$u)?.value ?? "";
7787
+ t32 = parts.find(_temp$w)?.value ?? "";
7788
7788
  $[6] = date;
7789
7789
  $[7] = timezone;
7790
7790
  $[8] = t32;
@@ -7855,7 +7855,7 @@ function DatePreview(t0) {
7855
7855
  }
7856
7856
  return t3;
7857
7857
  }
7858
- function _temp$u(p) {
7858
+ function _temp$w(p) {
7859
7859
  return p.type === "timeZoneName";
7860
7860
  }
7861
7861
  function MapPropertyPreview(t0) {
@@ -7950,7 +7950,7 @@ function KeyValuePreview(t0) {
7950
7950
  }
7951
7951
  let t1;
7952
7952
  if ($[1] !== value) {
7953
- t1 = Object.entries(value).map(_temp$t);
7953
+ t1 = Object.entries(value).map(_temp$v);
7954
7954
  $[1] = value;
7955
7955
  $[2] = t1;
7956
7956
  } else {
@@ -7966,7 +7966,7 @@ function KeyValuePreview(t0) {
7966
7966
  }
7967
7967
  return t2;
7968
7968
  }
7969
- function _temp$t(t0) {
7969
+ function _temp$v(t0) {
7970
7970
  const [key, childValue] = t0;
7971
7971
  const isTimestampObj = childValue && typeof childValue === "object" && (childValue instanceof Date || "_seconds" in childValue && "_nanoseconds" in childValue && typeof childValue._seconds === "number" && typeof childValue._nanoseconds === "number" || "seconds" in childValue && "nanoseconds" in childValue && typeof childValue.seconds === "number" && typeof childValue.nanoseconds === "number");
7972
7972
  const isScalar = childValue && (typeof childValue !== "object" || isTimestampObj);
@@ -9289,7 +9289,7 @@ function VirtualTableSelect(props) {
9289
9289
  console.trace("onChange");
9290
9290
  if (valueType === "number") {
9291
9291
  if (multiple) {
9292
- const newValue = updatedValue.map(_temp$s);
9292
+ const newValue = updatedValue.map(_temp$u);
9293
9293
  updateValue(newValue);
9294
9294
  } else {
9295
9295
  updateValue(parseFloat(updatedValue));
@@ -9342,7 +9342,7 @@ function VirtualTableSelect(props) {
9342
9342
  const handleOpenChange = t4;
9343
9343
  let t5;
9344
9344
  if ($[11] !== disabled || $[12] !== enumValues || $[13] !== internalValue || $[14] !== multiple || $[15] !== onChange || $[16] !== renderValue || $[17] !== small || $[18] !== validValue) {
9345
- t5 = multiple ? /* @__PURE__ */ jsx(MultiSelect, { inputRef: ref, className: "w-full h-full p-0 bg-transparent outline-none", position: "item-aligned", disabled, includeClear: false, useChips: false, value: validValue ? internalValue.map(_temp2$d) : [], onValueChange: onChange, onOpenChange: handleOpenChange, children: enumValues?.map((enumConfig) => /* @__PURE__ */ jsx(MultiSelectItem, { value: String(enumConfig.id), children: /* @__PURE__ */ jsx(EnumValuesChip, { enumKey: enumConfig.id, enumValues, size: small ? "small" : "medium" }) }, enumConfig.id)) }) : /* @__PURE__ */ jsx(Select, { inputRef: ref, size: "large", fullWidth: true, className: "w-full h-full p-0 bg-transparent outline-none [&_button]:ring-0 [&_button]:ring-offset-0", inputClassName: "ring-0 ring-offset-0 focus:ring-0 focus-visible:ring-0 outline-none focus:outline-none focus-visible:outline-none focus-visible:ring-offset-0", position: "item-aligned", disabled, padding: false, value: validValue ? internalValue?.toString() : "", onValueChange: onChange, onOpenChange: handleOpenChange, renderValue, children: enumValues?.map((enumConfig_0) => /* @__PURE__ */ jsx(SelectItem, { value: String(enumConfig_0.id), children: /* @__PURE__ */ jsx(EnumValuesChip, { enumKey: enumConfig_0.id, enumValues, size: small ? "small" : "medium" }) }, enumConfig_0.id)) });
9345
+ t5 = multiple ? /* @__PURE__ */ jsx(MultiSelect, { inputRef: ref, className: "w-full h-full p-0 bg-transparent outline-none", position: "item-aligned", disabled, includeClear: false, useChips: false, value: validValue ? internalValue.map(_temp2$e) : [], onValueChange: onChange, onOpenChange: handleOpenChange, children: enumValues?.map((enumConfig) => /* @__PURE__ */ jsx(MultiSelectItem, { value: String(enumConfig.id), children: /* @__PURE__ */ jsx(EnumValuesChip, { enumKey: enumConfig.id, enumValues, size: small ? "small" : "medium" }) }, enumConfig.id)) }) : /* @__PURE__ */ jsx(Select, { inputRef: ref, size: "large", fullWidth: true, className: "w-full h-full p-0 bg-transparent outline-none [&_button]:ring-0 [&_button]:ring-offset-0", inputClassName: "ring-0 ring-offset-0 focus:ring-0 focus-visible:ring-0 outline-none focus:outline-none focus-visible:outline-none focus-visible:ring-offset-0", position: "item-aligned", disabled, padding: false, value: validValue ? internalValue?.toString() : "", onValueChange: onChange, onOpenChange: handleOpenChange, renderValue, children: enumValues?.map((enumConfig_0) => /* @__PURE__ */ jsx(SelectItem, { value: String(enumConfig_0.id), children: /* @__PURE__ */ jsx(EnumValuesChip, { enumKey: enumConfig_0.id, enumValues, size: small ? "small" : "medium" }) }, enumConfig_0.id)) });
9346
9346
  $[11] = disabled;
9347
9347
  $[12] = enumValues;
9348
9348
  $[13] = internalValue;
@@ -9357,10 +9357,10 @@ function VirtualTableSelect(props) {
9357
9357
  }
9358
9358
  return t5;
9359
9359
  }
9360
- function _temp2$d(v_0) {
9360
+ function _temp2$e(v_0) {
9361
9361
  return v_0.toString();
9362
9362
  }
9363
- function _temp$s(v) {
9363
+ function _temp$u(v) {
9364
9364
  return parseFloat(v);
9365
9365
  }
9366
9366
  function VirtualTableNumberInput(props) {
@@ -9556,7 +9556,7 @@ function VirtualTableUserSelect(props) {
9556
9556
  const renderValue = t3;
9557
9557
  let t4;
9558
9558
  if ($[7] !== disabled || $[8] !== internalValue || $[9] !== multiple || $[10] !== onChange || $[11] !== renderValue || $[12] !== users || $[13] !== validValue) {
9559
- t4 = multiple ? /* @__PURE__ */ jsx(MultiSelect, { inputRef: ref, className: "w-full h-full p-0 bg-transparent", position: "item-aligned", disabled, includeClear: false, useChips: false, value: validValue ? internalValue : [], onValueChange: onChange, children: users?.map(_temp$r) }) : /* @__PURE__ */ jsx(Select, { inputRef: ref, size: "large", fullWidth: true, className: "w-full h-full p-0 bg-transparent", position: "item-aligned", disabled, padding: false, value: validValue ? internalValue : "", onValueChange: onChange, renderValue, children: users?.map(_temp2$c) });
9559
+ t4 = multiple ? /* @__PURE__ */ jsx(MultiSelect, { inputRef: ref, className: "w-full h-full p-0 bg-transparent", position: "item-aligned", disabled, includeClear: false, useChips: false, value: validValue ? internalValue : [], onValueChange: onChange, children: users?.map(_temp$t) }) : /* @__PURE__ */ jsx(Select, { inputRef: ref, size: "large", fullWidth: true, className: "w-full h-full p-0 bg-transparent", position: "item-aligned", disabled, padding: false, value: validValue ? internalValue : "", onValueChange: onChange, renderValue, children: users?.map(_temp2$d) });
9560
9560
  $[7] = disabled;
9561
9561
  $[8] = internalValue;
9562
9562
  $[9] = multiple;
@@ -9570,10 +9570,10 @@ function VirtualTableUserSelect(props) {
9570
9570
  }
9571
9571
  return t4;
9572
9572
  }
9573
- function _temp2$c(user_1) {
9573
+ function _temp2$d(user_1) {
9574
9574
  return /* @__PURE__ */ jsx(SelectItem, { value: user_1.uid, children: /* @__PURE__ */ jsx(UserDisplay, { user: user_1 }) }, user_1.uid);
9575
9575
  }
9576
- function _temp$r(user_0) {
9576
+ function _temp$t(user_0) {
9577
9577
  return /* @__PURE__ */ jsx(MultiSelectItem, { value: user_0.uid, children: /* @__PURE__ */ jsx(UserDisplay, { user: user_0 }) }, user_0.uid);
9578
9578
  }
9579
9579
  class ErrorBoundary extends React__default.Component {
@@ -9821,7 +9821,7 @@ function useStorageUploadController(t0) {
9821
9821
  newValue = [...internalValue];
9822
9822
  newValue = removeDuplicates(newValue);
9823
9823
  setInternalValue(newValue);
9824
- const fieldValue = newValue.filter(_temp$q).map(_temp2$b);
9824
+ const fieldValue = newValue.filter(_temp$s).map(_temp2$c);
9825
9825
  if (multipleFilesSupported) {
9826
9826
  onChange(fieldValue);
9827
9827
  } else {
@@ -9939,10 +9939,10 @@ function useStorageUploadController(t0) {
9939
9939
  }
9940
9940
  return t11;
9941
9941
  }
9942
- function _temp2$b(e_0) {
9942
+ function _temp2$c(e_0) {
9943
9943
  return e_0.storagePathOrDownloadUrl;
9944
9944
  }
9945
- function _temp$q(e) {
9945
+ function _temp$s(e) {
9946
9946
  return !!e.storagePathOrDownloadUrl;
9947
9947
  }
9948
9948
  function getInternalInitialValue(multipleFilesSupported, value, metadata, size) {
@@ -10233,7 +10233,7 @@ function StorageUpload$1(t0) {
10233
10233
  const snackbarContext = useSnackbarController();
10234
10234
  let t1;
10235
10235
  if ($[0] !== storage.acceptedFiles) {
10236
- t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$p).reduce(_temp2$a, {}) : void 0;
10236
+ t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$r).reduce(_temp2$b, {}) : void 0;
10237
10237
  $[0] = storage.acceptedFiles;
10238
10238
  $[1] = t1;
10239
10239
  } else {
@@ -10456,13 +10456,13 @@ function StorageUpload$1(t0) {
10456
10456
  }
10457
10457
  return t20;
10458
10458
  }
10459
- function _temp2$a(a, b) {
10459
+ function _temp2$b(a, b) {
10460
10460
  return {
10461
10461
  ...a,
10462
10462
  ...b
10463
10463
  };
10464
10464
  }
10465
- function _temp$p(e) {
10465
+ function _temp$r(e) {
10466
10466
  return {
10467
10467
  [e]: []
10468
10468
  };
@@ -10572,7 +10572,7 @@ const TableReferenceFieldInternal = React__default.memo(function TableReferenceF
10572
10572
  let t1;
10573
10573
  if ($[2] !== updateValue) {
10574
10574
  t1 = (entities) => {
10575
- updateValue(entities.filter(Boolean).map(_temp$o));
10575
+ updateValue(entities.filter(Boolean).map(_temp$q));
10576
10576
  };
10577
10577
  $[2] = updateValue;
10578
10578
  $[3] = t1;
@@ -10582,7 +10582,7 @@ const TableReferenceFieldInternal = React__default.memo(function TableReferenceF
10582
10582
  const onMultipleEntitiesSelected = t1;
10583
10583
  let t2;
10584
10584
  if ($[4] !== internalValue) {
10585
- t2 = internalValue ? Array.isArray(internalValue) ? internalValue.map(_temp2$9) : internalValue.id ? [internalValue.id] : [] : [];
10585
+ t2 = internalValue ? Array.isArray(internalValue) ? internalValue.map(_temp2$a) : internalValue.id ? [internalValue.id] : [] : [];
10586
10586
  $[4] = internalValue;
10587
10587
  $[5] = t2;
10588
10588
  } else {
@@ -10744,10 +10744,10 @@ const TableReferenceFieldInternal = React__default.memo(function TableReferenceF
10744
10744
  }
10745
10745
  return t10;
10746
10746
  }, equal);
10747
- function _temp$o(e) {
10747
+ function _temp$q(e) {
10748
10748
  return getReferenceFrom(e);
10749
10749
  }
10750
- function _temp2$9(ref) {
10750
+ function _temp2$a(ref) {
10751
10751
  return ref.id;
10752
10752
  }
10753
10753
  yup.addMethod(yup.array, "uniqueInArray", function(mapper = (a) => a, message) {
@@ -12402,7 +12402,7 @@ function StorageItemPreview(t0) {
12402
12402
  }
12403
12403
  let t5;
12404
12404
  if ($[15] !== placeholder) {
12405
- t5 = placeholder && /* @__PURE__ */ jsx("div", { onClick: _temp$n, className: "flex flex-col items-center justify-center w-full h-full", children: /* @__PURE__ */ jsx(DescriptionIcon, { className: "text-surface-700 dark:text-surface-300" }) });
12405
+ t5 = placeholder && /* @__PURE__ */ jsx("div", { onClick: _temp$p, className: "flex flex-col items-center justify-center w-full h-full", children: /* @__PURE__ */ jsx(DescriptionIcon, { className: "text-surface-700 dark:text-surface-300" }) });
12406
12406
  $[15] = placeholder;
12407
12407
  $[16] = t5;
12408
12408
  } else {
@@ -12425,7 +12425,7 @@ function StorageItemPreview(t0) {
12425
12425
  }
12426
12426
  return t6;
12427
12427
  }
12428
- function _temp$n(e) {
12428
+ function _temp$p(e) {
12429
12429
  return e.stopPropagation();
12430
12430
  }
12431
12431
  const dropZoneClasses = "box-border relative pt-[2px] items-center border border-transparent min-h-[254px] outline-none rounded-md duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] focus:border-primary-solid";
@@ -12653,7 +12653,7 @@ function SortableStorageItem(t0) {
12653
12653
  t4 = $[7];
12654
12654
  }
12655
12655
  const style = t4;
12656
- const getImageSizeNumber = _temp$m;
12656
+ const getImageSizeNumber = _temp$o;
12657
12657
  let child;
12658
12658
  if (entry.storagePathOrDownloadUrl) {
12659
12659
  const t52 = `storage_preview_${entry.storagePathOrDownloadUrl}`;
@@ -12728,7 +12728,7 @@ function SortableStorageItem(t0) {
12728
12728
  }
12729
12729
  return t6;
12730
12730
  }
12731
- function _temp$m(previewSize) {
12731
+ function _temp$o(previewSize) {
12732
12732
  switch (previewSize) {
12733
12733
  case "small": {
12734
12734
  return 40;
@@ -12765,7 +12765,7 @@ function FileDropComponent(t0) {
12765
12765
  const snackbarContext = useSnackbarController();
12766
12766
  let t1;
12767
12767
  if ($[0] !== storage.acceptedFiles) {
12768
- t1 = storage.acceptedFiles ? storage.acceptedFiles.reduce(_temp2$8, {}) : void 0;
12768
+ t1 = storage.acceptedFiles ? storage.acceptedFiles.reduce(_temp2$9, {}) : void 0;
12769
12769
  $[0] = storage.acceptedFiles;
12770
12770
  $[1] = t1;
12771
12771
  } else {
@@ -12958,7 +12958,7 @@ function FileDropComponent(t0) {
12958
12958
  }
12959
12959
  return t21;
12960
12960
  }
12961
- function _temp2$8(acc, ext) {
12961
+ function _temp2$9(acc, ext) {
12962
12962
  return {
12963
12963
  ...acc,
12964
12964
  [ext]: []
@@ -14501,7 +14501,7 @@ function MapFieldBinding(t0) {
14501
14501
  } else {
14502
14502
  t42 = $[20];
14503
14503
  }
14504
- t3 = Object.entries(mapProperties).filter(_temp$l).map(t42);
14504
+ t3 = Object.entries(mapProperties).filter(_temp$n).map(t42);
14505
14505
  $[6] = autoFocus;
14506
14506
  $[7] = context;
14507
14507
  $[8] = disabled;
@@ -14580,7 +14580,7 @@ function MapFieldBinding(t0) {
14580
14580
  }
14581
14581
  return t10;
14582
14582
  }
14583
- function _temp$l(t0) {
14583
+ function _temp$n(t0) {
14584
14584
  const [, property_0] = t0;
14585
14585
  return !isHidden(property_0);
14586
14586
  }
@@ -15954,7 +15954,7 @@ function BlockEntry(t0) {
15954
15954
  const property = t4;
15955
15955
  let t5;
15956
15956
  if ($[9] !== properties) {
15957
- t5 = Object.entries(properties).map(_temp$k);
15957
+ t5 = Object.entries(properties).map(_temp$m);
15958
15958
  $[9] = properties;
15959
15959
  $[10] = t5;
15960
15960
  } else {
@@ -16047,7 +16047,7 @@ function BlockEntry(t0) {
16047
16047
  }
16048
16048
  return t11;
16049
16049
  }
16050
- function _temp$k(t0) {
16050
+ function _temp$m(t0) {
16051
16051
  const [key, property_0] = t0;
16052
16052
  return {
16053
16053
  id: key,
@@ -19380,7 +19380,7 @@ const SafeLinkRenderer = (t0) => {
19380
19380
  let t1;
19381
19381
  if ($[0] !== text) {
19382
19382
  const urlRegex = /https?:\/\/[^\s]+/g;
19383
- t1 = text.replace(urlRegex, _temp$j);
19383
+ t1 = text.replace(urlRegex, _temp$l);
19384
19384
  $[0] = text;
19385
19385
  $[1] = t1;
19386
19386
  } else {
@@ -19399,7 +19399,7 @@ const SafeLinkRenderer = (t0) => {
19399
19399
  }
19400
19400
  return t2;
19401
19401
  };
19402
- function _temp$j(url) {
19402
+ function _temp$l(url) {
19403
19403
  return `<a href="${url}" class="underline" target="_blank">Link</a><br/>`;
19404
19404
  }
19405
19405
  const operationLabels$2 = {
@@ -19712,7 +19712,7 @@ function StringNumberFilterField(t0) {
19712
19712
  }
19713
19713
  let t9;
19714
19714
  if ($[24] !== possibleOperations) {
19715
- t9 = possibleOperations.map(_temp2$7);
19715
+ t9 = possibleOperations.map(_temp2$8);
19716
19716
  $[24] = possibleOperations;
19717
19717
  $[25] = t9;
19718
19718
  } else {
@@ -19720,7 +19720,7 @@ function StringNumberFilterField(t0) {
19720
19720
  }
19721
19721
  let t10;
19722
19722
  if ($[26] !== operation || $[27] !== t8 || $[28] !== t9) {
19723
- t10 = /* @__PURE__ */ jsx("div", { className: "w-[100px]", children: /* @__PURE__ */ jsx(Select, { value: operation, size: "medium", fullWidth: true, position: "item-aligned", onValueChange: t8, renderValue: _temp$i, children: t9 }) });
19723
+ t10 = /* @__PURE__ */ jsx("div", { className: "w-[100px]", children: /* @__PURE__ */ jsx(Select, { value: operation, size: "medium", fullWidth: true, position: "item-aligned", onValueChange: t8, renderValue: _temp$k, children: t9 }) });
19724
19724
  $[26] = operation;
19725
19725
  $[27] = t8;
19726
19726
  $[28] = t9;
@@ -19822,10 +19822,10 @@ function _temp4$2(v) {
19822
19822
  function _temp3$4(e_1) {
19823
19823
  return String(e_1);
19824
19824
  }
19825
- function _temp2$7(op_2) {
19825
+ function _temp2$8(op_2) {
19826
19826
  return /* @__PURE__ */ jsx(SelectItem, { value: op_2, children: operationLabels$1[op_2] }, op_2);
19827
19827
  }
19828
- function _temp$i(op_1) {
19828
+ function _temp$k(op_1) {
19829
19829
  return operationLabels$1[op_1];
19830
19830
  }
19831
19831
  function BooleanFilterField(t0) {
@@ -19988,7 +19988,7 @@ function DateTimeFilterField(t0) {
19988
19988
  }
19989
19989
  let t7;
19990
19990
  if ($[15] !== possibleOperations) {
19991
- t7 = possibleOperations.map(_temp2$6);
19991
+ t7 = possibleOperations.map(_temp2$7);
19992
19992
  $[15] = possibleOperations;
19993
19993
  $[16] = t7;
19994
19994
  } else {
@@ -19996,7 +19996,7 @@ function DateTimeFilterField(t0) {
19996
19996
  }
19997
19997
  let t8;
19998
19998
  if ($[17] !== operation || $[18] !== t6 || $[19] !== t7) {
19999
- t8 = /* @__PURE__ */ jsx("div", { className: "w-[100px]", children: /* @__PURE__ */ jsx(Select, { value: operation, size: "medium", fullWidth: true, onValueChange: t6, renderValue: _temp$h, children: t7 }) });
19999
+ t8 = /* @__PURE__ */ jsx("div", { className: "w-[100px]", children: /* @__PURE__ */ jsx(Select, { value: operation, size: "medium", fullWidth: true, onValueChange: t6, renderValue: _temp$j, children: t7 }) });
20000
20000
  $[17] = operation;
20001
20001
  $[18] = t6;
20002
20002
  $[19] = t7;
@@ -20043,10 +20043,10 @@ function DateTimeFilterField(t0) {
20043
20043
  }
20044
20044
  return t12;
20045
20045
  }
20046
- function _temp2$6(op_2) {
20046
+ function _temp2$7(op_2) {
20047
20047
  return /* @__PURE__ */ jsx(SelectItem, { value: op_2, children: operationLabels[op_2] }, op_2);
20048
20048
  }
20049
- function _temp$h(op_1) {
20049
+ function _temp$j(op_1) {
20050
20050
  return operationLabels[op_1];
20051
20051
  }
20052
20052
  const SelectableTable = function SelectableTable2({
@@ -20809,7 +20809,7 @@ function useTableSearchHelper(t0) {
20809
20809
  parentCollectionIds
20810
20810
  };
20811
20811
  const searchBlocked = customizationController.plugins?.find((p) => p.collectionView?.blockSearch?.(props));
20812
- const addTextSearchClickListener = Boolean(dataSource?.initTextSearch) || customizationController.plugins?.find(_temp$g);
20812
+ const addTextSearchClickListener = Boolean(dataSource?.initTextSearch) || customizationController.plugins?.find(_temp$i);
20813
20813
  if (addTextSearchClickListener) {
20814
20814
  onTextSearchClick = addTextSearchClickListener ? () => {
20815
20815
  setTextSearchLoading(true);
@@ -20905,7 +20905,7 @@ function useTableSearchHelper(t0) {
20905
20905
  }
20906
20906
  return t3;
20907
20907
  }
20908
- function _temp$g(p_0) {
20908
+ function _temp$i(p_0) {
20909
20909
  return Boolean(p_0.collectionView?.onTextSearchClick);
20910
20910
  }
20911
20911
  function DeleteEntityDialog({
@@ -21072,20 +21072,25 @@ function removeLocalStorageItem(key) {
21072
21072
  } catch {
21073
21073
  }
21074
21074
  }
21075
- function addRecentId(collectionId, id) {
21076
- const recentIds = getRecentIds(collectionId);
21075
+ function addRecentId(key, id) {
21076
+ const recentIds = getRecentIds(key);
21077
21077
  const newRecentIds = [id, ...recentIds.filter((i) => i !== id)];
21078
21078
  if (newRecentIds.length > 5) {
21079
21079
  newRecentIds.pop();
21080
21080
  }
21081
- saveSearchedIdsLocally(collectionId, newRecentIds);
21081
+ saveSearchedIdsLocally(key, newRecentIds);
21082
21082
  return newRecentIds;
21083
21083
  }
21084
- function saveSearchedIdsLocally(collectionId, ids) {
21085
- setLocalStorageItem("recent_id_searches::" + collectionId, JSON.stringify(ids));
21084
+ function saveSearchedIdsLocally(key, ids) {
21085
+ setLocalStorageItem("recent_id_searches::" + key, JSON.stringify(ids));
21086
21086
  }
21087
- function getRecentIds(collectionId) {
21088
- return getLocalStorageJSON("recent_id_searches::" + collectionId, []);
21087
+ function getRecentIds(key) {
21088
+ return getLocalStorageJSON("recent_id_searches::" + key, []);
21089
+ }
21090
+ function removeRecentIds(key, ids) {
21091
+ const remaining = getRecentIds(key).filter((id) => !ids.includes(id));
21092
+ saveSearchedIdsLocally(key, remaining);
21093
+ return remaining;
21089
21094
  }
21090
21095
  const editEntityAction = {
21091
21096
  icon: /* @__PURE__ */ jsx(EditIcon, { size: "small" }),
@@ -21115,7 +21120,7 @@ const editEntityAction = {
21115
21120
  entityId: entity.id
21116
21121
  });
21117
21122
  if (collection) {
21118
- addRecentId(collection.id, entity.id);
21123
+ addRecentId(fullIdPath ?? fullPath ?? collection.id, entity.id);
21119
21124
  }
21120
21125
  const path = collection?.collectionGroup ? entity.path : fullPath ?? collection?.path ?? entity.path;
21121
21126
  const resolvedPathSegments = collection?.collectionGroup ? entity.pathSegments : pathSegments ?? entity.pathSegments;
@@ -21568,7 +21573,7 @@ function FavouritesView(t0) {
21568
21573
  T0 = Collapse;
21569
21574
  t4 = favouriteCollections.length > 0;
21570
21575
  t2 = "flex flex-row flex-wrap gap-2 pb-2 min-h-[32px]";
21571
- t3 = favouriteCollections.map(_temp$f);
21576
+ t3 = favouriteCollections.map(_temp$h);
21572
21577
  $[2] = navigationController;
21573
21578
  $[3] = t1;
21574
21579
  $[4] = T0;
@@ -21602,7 +21607,7 @@ function FavouritesView(t0) {
21602
21607
  }
21603
21608
  return t6;
21604
21609
  }
21605
- function _temp$f(entry_0) {
21610
+ function _temp$h(entry_0) {
21606
21611
  return /* @__PURE__ */ jsx(NavigationChip, { entry: entry_0 }, entry_0.path);
21607
21612
  }
21608
21613
  const scrollsMap = {};
@@ -21839,7 +21844,7 @@ const NavigationCard = React__default.memo(function NavigationCard2(t0) {
21839
21844
  }
21840
21845
  let t4;
21841
21846
  if ($[4] !== actions) {
21842
- t4 = /* @__PURE__ */ jsx("div", { className: "flex items-center gap-0.5", onClick: _temp$e, children: actions });
21847
+ t4 = /* @__PURE__ */ jsx("div", { className: "flex items-center gap-0.5", onClick: _temp$g, children: actions });
21843
21848
  $[4] = actions;
21844
21849
  $[5] = t4;
21845
21850
  } else {
@@ -21926,7 +21931,7 @@ const NavigationCard = React__default.memo(function NavigationCard2(t0) {
21926
21931
  }
21927
21932
  return t12;
21928
21933
  });
21929
- function _temp$e(event) {
21934
+ function _temp$g(event) {
21930
21935
  event.preventDefault();
21931
21936
  event.stopPropagation();
21932
21937
  }
@@ -24293,7 +24298,7 @@ const BoardColumn = memo(function BoardColumn2(t0) {
24293
24298
  let t19;
24294
24299
  let t20;
24295
24300
  if ($[19] !== items) {
24296
- t20 = items.map(_temp$d);
24301
+ t20 = items.map(_temp$f);
24297
24302
  $[19] = items;
24298
24303
  $[20] = t20;
24299
24304
  } else {
@@ -24399,7 +24404,7 @@ const BoardColumn = memo(function BoardColumn2(t0) {
24399
24404
  }
24400
24405
  return t29;
24401
24406
  });
24402
- function _temp$d(i) {
24407
+ function _temp$f(i) {
24403
24408
  return i.id;
24404
24409
  }
24405
24410
  function Board(t0) {
@@ -26571,7 +26576,7 @@ function EntityCollectionViewStartActions(t0) {
26571
26576
  }
26572
26577
  let t7;
26573
26578
  if ($[30] !== collection.forceFilter || $[31] !== filtersDialogOpen || $[32] !== resolvedProperties || $[33] !== tableController) {
26574
- t7 = resolvedProperties && tableController.setFilterValues && /* @__PURE__ */ jsx(FiltersDialog, { open: filtersDialogOpen, onOpenChange: setFiltersDialogOpen, properties: resolvedProperties, filterValues: tableController.filterValues, setFilterValues: (filterValues_0) => tableController.setFilterValues?.(filterValues_0 ?? {}), forceFilter: collection.forceFilter, allowedFilters: tableController.allowedFilters?.map(_temp$c) });
26579
+ t7 = resolvedProperties && tableController.setFilterValues && /* @__PURE__ */ jsx(FiltersDialog, { open: filtersDialogOpen, onOpenChange: setFiltersDialogOpen, properties: resolvedProperties, filterValues: tableController.filterValues, setFilterValues: (filterValues_0) => tableController.setFilterValues?.(filterValues_0 ?? {}), forceFilter: collection.forceFilter, allowedFilters: tableController.allowedFilters?.map(_temp$e) });
26575
26580
  $[30] = collection.forceFilter;
26576
26581
  $[31] = filtersDialogOpen;
26577
26582
  $[32] = resolvedProperties;
@@ -26594,9 +26599,104 @@ function EntityCollectionViewStartActions(t0) {
26594
26599
  }
26595
26600
  return t8;
26596
26601
  }
26597
- function _temp$c(key_0) {
26602
+ function _temp$e(key_0) {
26598
26603
  return key_0.toString();
26599
26604
  }
26605
+ const DEFAULT_ENTITY_OPEN_MODE$1 = "side_panel";
26606
+ function EntityIdHeaderWidget({
26607
+ collection,
26608
+ path,
26609
+ pathSegments,
26610
+ fullIdPath
26611
+ }) {
26612
+ const navigation = useNavigationController();
26613
+ const dataSource = useDataSource();
26614
+ const [openPopup, setOpenPopup] = React__default.useState(false);
26615
+ const [searchString, setSearchString] = React__default.useState("");
26616
+ const [recentIds, setRecentIds] = React__default.useState([]);
26617
+ const latestCheck = useRef(0);
26618
+ const sideEntityController = useSideEntityController();
26619
+ const {
26620
+ t
26621
+ } = useTranslation();
26622
+ const resolvedPath = navigation.resolveIdsFrom(path, pathSegments);
26623
+ const resolvedPathSegments = pathSegments ? navigation.resolveSegmentsFrom?.(pathSegments) ?? pathSegments : void 0;
26624
+ const entityExists = useCallback(async (entityId) => {
26625
+ try {
26626
+ const entity = await dataSource.fetchEntity({
26627
+ path: resolvedPath,
26628
+ pathSegments: resolvedPathSegments,
26629
+ entityId,
26630
+ collection
26631
+ });
26632
+ return Boolean(entity?.values);
26633
+ } catch (e) {
26634
+ return void 0;
26635
+ }
26636
+ }, [dataSource, resolvedPath, resolvedPathSegments, collection]);
26637
+ const refreshRecentIds = () => {
26638
+ const ids = getRecentIds(fullIdPath);
26639
+ const check = ++latestCheck.current;
26640
+ Promise.all(ids.map(entityExists)).then((results) => {
26641
+ if (check !== latestCheck.current) return;
26642
+ const missing = ids.filter((_, i) => results[i] === false);
26643
+ if (missing.length > 0) removeRecentIds(fullIdPath, missing);
26644
+ setRecentIds(ids.filter((__0, i_0) => results[i_0] === true));
26645
+ });
26646
+ };
26647
+ const openEntityMode = collection?.openEntityMode ?? DEFAULT_ENTITY_OPEN_MODE$1;
26648
+ return /* @__PURE__ */ jsx(Tooltip, { title: !openPopup ? t("find_by_id") : void 0, asChild: false, children: /* @__PURE__ */ jsx(Popover, { open: openPopup, onOpenChange: (open) => {
26649
+ if (open) refreshRecentIds();
26650
+ setOpenPopup(open);
26651
+ }, sideOffset: 0, align: "start", alignOffset: -117, trigger: /* @__PURE__ */ jsx(IconButton, { size: "small", children: /* @__PURE__ */ jsx(SearchIcon, { size: "small" }) }), children: /* @__PURE__ */ jsxs("div", { className: cls("my-2 rounded-lg bg-surface-50 dark:bg-surface-950 text-surface-900 dark:text-white"), children: [
26652
+ /* @__PURE__ */ jsx("form", { noValidate: true, onSubmit: (e_0) => {
26653
+ e_0.preventDefault();
26654
+ const entityId_0 = searchString.trim();
26655
+ if (!entityId_0) return;
26656
+ setOpenPopup(false);
26657
+ entityExists(entityId_0).then((exists) => {
26658
+ if (exists) addRecentId(fullIdPath, entityId_0);
26659
+ });
26660
+ navigateToEntity({
26661
+ openEntityMode,
26662
+ collection,
26663
+ entityId: entityId_0,
26664
+ path,
26665
+ pathSegments,
26666
+ fullIdPath,
26667
+ sideEntityController,
26668
+ navigation
26669
+ });
26670
+ }, className: "w-96 max-w-full", children: /* @__PURE__ */ jsxs("div", { className: "flex p-2 w-full gap-2", children: [
26671
+ /* @__PURE__ */ jsx(
26672
+ "input",
26673
+ {
26674
+ autoFocus: openPopup,
26675
+ placeholder: t("find_entity_by_id"),
26676
+ onChange: (e_1) => {
26677
+ setSearchString(e_1.target.value);
26678
+ },
26679
+ value: searchString,
26680
+ className: "rounded-lg bg-white dark:bg-surface-800 flex-grow bg-transparent outline-none p-2 " + focusedDisabled
26681
+ }
26682
+ ),
26683
+ /* @__PURE__ */ jsx(Button, { variant: "text", disabled: !searchString.trim(), type: "submit", children: /* @__PURE__ */ jsx(KeyboardTabIcon, {}) })
26684
+ ] }) }),
26685
+ recentIds && recentIds.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 p-2", children: recentIds.map((id) => /* @__PURE__ */ jsx(ReferencePreview, { reference: new EntityReference(id, path, void 0, pathSegments), hover: true, onClick: () => {
26686
+ setOpenPopup(false);
26687
+ navigateToEntity({
26688
+ openEntityMode,
26689
+ collection,
26690
+ entityId: id,
26691
+ path,
26692
+ pathSegments,
26693
+ fullIdPath,
26694
+ sideEntityController,
26695
+ navigation
26696
+ });
26697
+ }, includeEntityLink: false, size: "small" }, id)) })
26698
+ ] }) }) });
26699
+ }
26600
26700
  const collectionScrollCache = /* @__PURE__ */ new Map();
26601
26701
  function useScrollRestoration() {
26602
26702
  const updateCollectionScroll = ({
@@ -26637,6 +26737,7 @@ const EntityCollectionView$1 = React__default.memo(function EntityCollectionView
26637
26737
  isSubCollection,
26638
26738
  className,
26639
26739
  updateUrl,
26740
+ onCountChange,
26640
26741
  ...collectionProp
26641
26742
  }) {
26642
26743
  const context = useFireCMSContext();
@@ -26774,7 +26875,7 @@ const EntityCollectionView$1 = React__default.memo(function EntityCollectionView
26774
26875
  entityId: clickedEntity.id
26775
26876
  });
26776
26877
  if (collection_1) {
26777
- addRecentId(collection_1.id, clickedEntity.id);
26878
+ addRecentId(fullIdPath ?? fullPath, clickedEntity.id);
26778
26879
  }
26779
26880
  const isCollectionGroup = Boolean(collection_1?.collectionGroup);
26780
26881
  const path = isCollectionGroup ? clickedEntity.path : fullPath ?? clickedEntity.path;
@@ -27102,8 +27203,9 @@ const EntityCollectionView$1 = React__default.memo(function EntityCollectionView
27102
27203
  useEffect(() => {
27103
27204
  if (docsCount !== void 0) {
27104
27205
  breadcrumbs.updateCount(fullPath, docsCount);
27206
+ onCountChange?.(docsCount);
27105
27207
  }
27106
- }, [docsCount, fullPath, breadcrumbs.updateCount]);
27208
+ }, [docsCount, fullPath, breadcrumbs.updateCount, onCountChange]);
27107
27209
  const countFetcher = /* @__PURE__ */ jsx(EntitiesCount, { fullPath, pathSegments, collection, filter: tableController.filterValues, sortBy: tableController.sortBy, onCountChange: setDocsCount });
27108
27210
  const buildAdditionalHeaderWidget = useCallback(({
27109
27211
  property: property_2,
@@ -27249,207 +27351,6 @@ function buildPropertyWidthOverwrite(key, width) {
27249
27351
  }
27250
27352
  };
27251
27353
  }
27252
- function EntityIdHeaderWidget(t0) {
27253
- const $ = c(50);
27254
- const {
27255
- collection,
27256
- path,
27257
- pathSegments,
27258
- fullIdPath
27259
- } = t0;
27260
- const navigation = useNavigationController();
27261
- const [openPopup, setOpenPopup] = React__default.useState(false);
27262
- const [searchString, setSearchString] = React__default.useState("");
27263
- let t1;
27264
- if ($[0] !== collection.id) {
27265
- t1 = getRecentIds(collection.id);
27266
- $[0] = collection.id;
27267
- $[1] = t1;
27268
- } else {
27269
- t1 = $[1];
27270
- }
27271
- const [recentIds, setRecentIds] = React__default.useState(t1);
27272
- const sideEntityController = useSideEntityController();
27273
- const {
27274
- t
27275
- } = useTranslation();
27276
- const openEntityMode = collection?.openEntityMode ?? DEFAULT_ENTITY_OPEN_MODE;
27277
- let t2;
27278
- if ($[2] !== openPopup || $[3] !== t) {
27279
- t2 = !openPopup ? t("find_by_id") : void 0;
27280
- $[2] = openPopup;
27281
- $[3] = t;
27282
- $[4] = t2;
27283
- } else {
27284
- t2 = $[4];
27285
- }
27286
- let t3;
27287
- let t4;
27288
- if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
27289
- t3 = /* @__PURE__ */ jsx(IconButton, { size: "small", children: /* @__PURE__ */ jsx(SearchIcon, { size: "small" }) });
27290
- t4 = cls("my-2 rounded-lg bg-surface-50 dark:bg-surface-950 text-surface-900 dark:text-white");
27291
- $[5] = t3;
27292
- $[6] = t4;
27293
- } else {
27294
- t3 = $[5];
27295
- t4 = $[6];
27296
- }
27297
- let t5;
27298
- if ($[7] !== collection || $[8] !== fullIdPath || $[9] !== navigation || $[10] !== openEntityMode || $[11] !== path || $[12] !== pathSegments || $[13] !== searchString || $[14] !== sideEntityController) {
27299
- t5 = (e) => {
27300
- e.preventDefault();
27301
- if (!searchString) {
27302
- return;
27303
- }
27304
- setOpenPopup(false);
27305
- const entityId = searchString.trim();
27306
- setRecentIds(addRecentId(collection.id, entityId));
27307
- navigateToEntity({
27308
- openEntityMode,
27309
- collection,
27310
- entityId,
27311
- path,
27312
- pathSegments,
27313
- fullIdPath,
27314
- sideEntityController,
27315
- navigation
27316
- });
27317
- };
27318
- $[7] = collection;
27319
- $[8] = fullIdPath;
27320
- $[9] = navigation;
27321
- $[10] = openEntityMode;
27322
- $[11] = path;
27323
- $[12] = pathSegments;
27324
- $[13] = searchString;
27325
- $[14] = sideEntityController;
27326
- $[15] = t5;
27327
- } else {
27328
- t5 = $[15];
27329
- }
27330
- let t6;
27331
- if ($[16] !== t) {
27332
- t6 = t("find_entity_by_id");
27333
- $[16] = t;
27334
- $[17] = t6;
27335
- } else {
27336
- t6 = $[17];
27337
- }
27338
- let t7;
27339
- if ($[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
27340
- t7 = (e_0) => {
27341
- setSearchString(e_0.target.value);
27342
- };
27343
- $[18] = t7;
27344
- } else {
27345
- t7 = $[18];
27346
- }
27347
- let t8;
27348
- if ($[19] !== openPopup || $[20] !== searchString || $[21] !== t6) {
27349
- t8 = /* @__PURE__ */ jsx("input", { autoFocus: openPopup, placeholder: t6, onChange: t7, value: searchString, className: "rounded-lg bg-white dark:bg-surface-800 flex-grow bg-transparent outline-none p-2 " + focusedDisabled });
27350
- $[19] = openPopup;
27351
- $[20] = searchString;
27352
- $[21] = t6;
27353
- $[22] = t8;
27354
- } else {
27355
- t8 = $[22];
27356
- }
27357
- const t9 = !searchString.trim();
27358
- let t10;
27359
- if ($[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
27360
- t10 = /* @__PURE__ */ jsx(KeyboardTabIcon, {});
27361
- $[23] = t10;
27362
- } else {
27363
- t10 = $[23];
27364
- }
27365
- let t11;
27366
- if ($[24] !== t9) {
27367
- t11 = /* @__PURE__ */ jsx(Button, { variant: "text", disabled: t9, type: "submit", children: t10 });
27368
- $[24] = t9;
27369
- $[25] = t11;
27370
- } else {
27371
- t11 = $[25];
27372
- }
27373
- let t12;
27374
- if ($[26] !== t11 || $[27] !== t8) {
27375
- t12 = /* @__PURE__ */ jsxs("div", { className: "flex p-2 w-full gap-2", children: [
27376
- t8,
27377
- t11
27378
- ] });
27379
- $[26] = t11;
27380
- $[27] = t8;
27381
- $[28] = t12;
27382
- } else {
27383
- t12 = $[28];
27384
- }
27385
- let t13;
27386
- if ($[29] !== t12 || $[30] !== t5) {
27387
- t13 = /* @__PURE__ */ jsx("form", { noValidate: true, onSubmit: t5, className: "w-96 max-w-full", children: t12 });
27388
- $[29] = t12;
27389
- $[30] = t5;
27390
- $[31] = t13;
27391
- } else {
27392
- t13 = $[31];
27393
- }
27394
- let t14;
27395
- if ($[32] !== collection || $[33] !== fullIdPath || $[34] !== navigation || $[35] !== openEntityMode || $[36] !== path || $[37] !== pathSegments || $[38] !== recentIds || $[39] !== sideEntityController) {
27396
- t14 = recentIds && recentIds.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 p-2", children: recentIds.map((id) => /* @__PURE__ */ jsx(ReferencePreview, { reference: new EntityReference(id, path, void 0, pathSegments), hover: true, onClick: () => {
27397
- setOpenPopup(false);
27398
- navigateToEntity({
27399
- openEntityMode,
27400
- collection,
27401
- entityId: id,
27402
- path,
27403
- pathSegments,
27404
- fullIdPath,
27405
- sideEntityController,
27406
- navigation
27407
- });
27408
- }, includeEntityLink: false, size: "small" }, id)) });
27409
- $[32] = collection;
27410
- $[33] = fullIdPath;
27411
- $[34] = navigation;
27412
- $[35] = openEntityMode;
27413
- $[36] = path;
27414
- $[37] = pathSegments;
27415
- $[38] = recentIds;
27416
- $[39] = sideEntityController;
27417
- $[40] = t14;
27418
- } else {
27419
- t14 = $[40];
27420
- }
27421
- let t15;
27422
- if ($[41] !== t13 || $[42] !== t14) {
27423
- t15 = /* @__PURE__ */ jsxs("div", { className: t4, children: [
27424
- t13,
27425
- t14
27426
- ] });
27427
- $[41] = t13;
27428
- $[42] = t14;
27429
- $[43] = t15;
27430
- } else {
27431
- t15 = $[43];
27432
- }
27433
- let t16;
27434
- if ($[44] !== openPopup || $[45] !== t15) {
27435
- t16 = /* @__PURE__ */ jsx(Popover, { open: openPopup, onOpenChange: setOpenPopup, sideOffset: 0, align: "start", alignOffset: -117, trigger: t3, children: t15 });
27436
- $[44] = openPopup;
27437
- $[45] = t15;
27438
- $[46] = t16;
27439
- } else {
27440
- t16 = $[46];
27441
- }
27442
- let t17;
27443
- if ($[47] !== t16 || $[48] !== t2) {
27444
- t17 = /* @__PURE__ */ jsx(Tooltip, { title: t2, asChild: false, children: t16 });
27445
- $[47] = t16;
27446
- $[48] = t2;
27447
- $[49] = t17;
27448
- } else {
27449
- t17 = $[49];
27450
- }
27451
- return t17;
27452
- }
27453
27354
  const EntityCollectionView$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
27454
27355
  __proto__: null,
27455
27356
  EntityCollectionView: EntityCollectionView$1
@@ -27869,7 +27770,7 @@ function DrawerNavigationGroup(t0) {
27869
27770
  }
27870
27771
  let t10;
27871
27772
  if ($[11] !== headerActions) {
27872
- t10 = headerActions && /* @__PURE__ */ jsx("div", { onClick: _temp$b, children: headerActions });
27773
+ t10 = headerActions && /* @__PURE__ */ jsx("div", { onClick: _temp$d, children: headerActions });
27873
27774
  $[11] = headerActions;
27874
27775
  $[12] = t10;
27875
27776
  } else {
@@ -27949,7 +27850,7 @@ function DrawerNavigationGroup(t0) {
27949
27850
  }
27950
27851
  return t16;
27951
27852
  }
27952
- function _temp$b(e) {
27853
+ function _temp$d(e) {
27953
27854
  return e.stopPropagation();
27954
27855
  }
27955
27856
  function DefaultDrawer(t0) {
@@ -27994,10 +27895,10 @@ function DefaultDrawer(t0) {
27994
27895
  navigationEntries,
27995
27896
  groups
27996
27897
  } = navigation.topLevelNavigation;
27997
- const adminViews = navigationEntries.filter(_temp$a) ?? [];
27898
+ const adminViews = navigationEntries.filter(_temp$c) ?? [];
27998
27899
  let t2;
27999
27900
  if ($[1] !== groups) {
28000
- t2 = groups.filter(_temp2$5);
27901
+ t2 = groups.filter(_temp2$6);
28001
27902
  $[1] = groups;
28002
27903
  $[2] = t2;
28003
27904
  } else {
@@ -28134,10 +28035,10 @@ function DefaultDrawer(t0) {
28134
28035
  }
28135
28036
  return t14;
28136
28037
  }
28137
- function _temp2$5(g) {
28038
+ function _temp2$6(g) {
28138
28039
  return g !== "Admin";
28139
28040
  }
28140
- function _temp$a(e) {
28041
+ function _temp$c(e) {
28141
28042
  return e.type === "admin";
28142
28043
  }
28143
28044
  function DrawerToggle() {
@@ -28268,8 +28169,149 @@ function DrawerLogo(t0) {
28268
28169
  }
28269
28170
  return t2;
28270
28171
  }
28172
+ function CollectionCountBadge(t0) {
28173
+ const $ = c(3);
28174
+ const {
28175
+ count
28176
+ } = t0;
28177
+ if (count === void 0) {
28178
+ return null;
28179
+ }
28180
+ if (count === null) {
28181
+ let t12;
28182
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
28183
+ t12 = /* @__PURE__ */ jsx(Skeleton, { className: "w-8 h-4 rounded-md" });
28184
+ $[0] = t12;
28185
+ } else {
28186
+ t12 = $[0];
28187
+ }
28188
+ return t12;
28189
+ }
28190
+ let t1;
28191
+ if ($[1] !== count) {
28192
+ t1 = /* @__PURE__ */ jsx("span", { className: "text-xs text-surface-accent-500 dark:text-surface-accent-400 bg-surface-100 dark:bg-surface-700 px-1 py-0 rounded", children: count });
28193
+ $[1] = count;
28194
+ $[2] = t1;
28195
+ } else {
28196
+ t1 = $[2];
28197
+ }
28198
+ return t1;
28199
+ }
28200
+ function PathTitle(t0) {
28201
+ const $ = c(15);
28202
+ const {
28203
+ parents,
28204
+ name,
28205
+ count,
28206
+ className
28207
+ } = t0;
28208
+ let t1;
28209
+ if ($[0] !== className) {
28210
+ t1 = cls("flex flex-col", className);
28211
+ $[0] = className;
28212
+ $[1] = t1;
28213
+ } else {
28214
+ t1 = $[1];
28215
+ }
28216
+ let t2;
28217
+ if ($[2] !== parents) {
28218
+ t2 = parents.length > 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", noWrap: true, children: parents.join(" / ") });
28219
+ $[2] = parents;
28220
+ $[3] = t2;
28221
+ } else {
28222
+ t2 = $[3];
28223
+ }
28224
+ let t3;
28225
+ if ($[4] !== name) {
28226
+ t3 = /* @__PURE__ */ jsx(Typography, { variant: "body2", noWrap: true, className: "font-medium", children: name });
28227
+ $[4] = name;
28228
+ $[5] = t3;
28229
+ } else {
28230
+ t3 = $[5];
28231
+ }
28232
+ let t4;
28233
+ if ($[6] !== count) {
28234
+ t4 = /* @__PURE__ */ jsx(CollectionCountBadge, { count });
28235
+ $[6] = count;
28236
+ $[7] = t4;
28237
+ } else {
28238
+ t4 = $[7];
28239
+ }
28240
+ let t5;
28241
+ if ($[8] !== t3 || $[9] !== t4) {
28242
+ t5 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-2 min-w-0", children: [
28243
+ t3,
28244
+ t4
28245
+ ] });
28246
+ $[8] = t3;
28247
+ $[9] = t4;
28248
+ $[10] = t5;
28249
+ } else {
28250
+ t5 = $[10];
28251
+ }
28252
+ let t6;
28253
+ if ($[11] !== t1 || $[12] !== t2 || $[13] !== t5) {
28254
+ t6 = /* @__PURE__ */ jsxs("div", { className: t1, children: [
28255
+ t2,
28256
+ t5
28257
+ ] });
28258
+ $[11] = t1;
28259
+ $[12] = t2;
28260
+ $[13] = t5;
28261
+ $[14] = t6;
28262
+ } else {
28263
+ t6 = $[14];
28264
+ }
28265
+ return t6;
28266
+ }
28267
+ function CollectionPathTitle(t0) {
28268
+ const $ = c(9);
28269
+ const {
28270
+ path,
28271
+ name,
28272
+ count
28273
+ } = t0;
28274
+ const navigation = useNavigationController();
28275
+ let t1;
28276
+ let t2;
28277
+ if ($[0] !== navigation.collections) {
28278
+ t2 = navigation.collections ?? [];
28279
+ $[0] = navigation.collections;
28280
+ $[1] = t2;
28281
+ } else {
28282
+ t2 = $[1];
28283
+ }
28284
+ let t3;
28285
+ if ($[2] !== path || $[3] !== t2) {
28286
+ t3 = getNavigationEntriesFromPath({
28287
+ path,
28288
+ collections: t2
28289
+ }).slice(0, -1).map(_temp$b);
28290
+ $[2] = path;
28291
+ $[3] = t2;
28292
+ $[4] = t3;
28293
+ } else {
28294
+ t3 = $[4];
28295
+ }
28296
+ t1 = t3;
28297
+ const parents = t1;
28298
+ let t4;
28299
+ if ($[5] !== count || $[6] !== name || $[7] !== parents) {
28300
+ t4 = /* @__PURE__ */ jsx(PathTitle, { parents, name, count, className: "shrink-0 mx-2 max-w-[140px] sm:max-w-[240px] lg:max-w-[320px]" });
28301
+ $[5] = count;
28302
+ $[6] = name;
28303
+ $[7] = parents;
28304
+ $[8] = t4;
28305
+ } else {
28306
+ t4 = $[8];
28307
+ }
28308
+ return t4;
28309
+ }
28310
+ function _temp$b(entry) {
28311
+ return entry.type === "entity" ? entry.entityId : entry.type === "collection" ? entry.collection.name : entry.view.name;
28312
+ }
28271
28313
  const DefaultAppBar = function DefaultAppBar2(t0) {
28272
- const $ = c(54);
28314
+ const $ = c(58);
28273
28315
  const {
28274
28316
  title,
28275
28317
  endAdornment,
@@ -28290,6 +28332,7 @@ const DefaultAppBar = function DefaultAppBar2(t0) {
28290
28332
  const logo = logoProp ?? appLogo;
28291
28333
  const navigation = useNavigationController();
28292
28334
  const breadcrumbs = useBreadcrumbsController();
28335
+ const lastBreadcrumb = breadcrumbs.breadcrumbs?.[breadcrumbs.breadcrumbs.length - 1];
28293
28336
  const authController = useAuthController();
28294
28337
  const {
28295
28338
  mode,
@@ -28380,30 +28423,39 @@ const DefaultAppBar = function DefaultAppBar2(t0) {
28380
28423
  }
28381
28424
  let t8;
28382
28425
  if ($[21] !== breadcrumbs.breadcrumbs) {
28383
- t8 = (breadcrumbs.breadcrumbs ?? []).length > 0 && /* @__PURE__ */ jsx("div", { className: "mr-8 hidden lg:block", children: /* @__PURE__ */ jsx("div", { className: "flex flex-row gap-2 items-center", children: breadcrumbs.breadcrumbs.map(_temp$9) }) });
28426
+ t8 = (breadcrumbs.breadcrumbs ?? []).length > 0 && /* @__PURE__ */ jsx("div", { className: "mr-8 hidden lg:block", children: /* @__PURE__ */ jsx("div", { className: "flex flex-row gap-2 items-center", children: breadcrumbs.breadcrumbs.map(_temp$a) }) });
28384
28427
  $[21] = breadcrumbs.breadcrumbs;
28385
28428
  $[22] = t8;
28386
28429
  } else {
28387
28430
  t8 = $[22];
28388
28431
  }
28389
28432
  let t9;
28390
- if ($[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
28391
- t9 = /* @__PURE__ */ jsx("div", { className: "flex-grow" });
28392
- $[23] = t9;
28433
+ if ($[23] !== breadcrumbs.breadcrumbs || $[24] !== lastBreadcrumb) {
28434
+ t9 = lastBreadcrumb && /* @__PURE__ */ jsx(PathTitle, { className: "lg:hidden min-w-0 mr-2", parents: breadcrumbs.breadcrumbs.slice(0, -1).map(_temp2$5), name: lastBreadcrumb.title, count: lastBreadcrumb.count });
28435
+ $[23] = breadcrumbs.breadcrumbs;
28436
+ $[24] = lastBreadcrumb;
28437
+ $[25] = t9;
28393
28438
  } else {
28394
- t9 = $[23];
28439
+ t9 = $[25];
28395
28440
  }
28396
28441
  let t10;
28397
- if ($[24] !== endAdornment) {
28398
- t10 = endAdornment && /* @__PURE__ */ jsx(ErrorBoundary, { children: endAdornment });
28399
- $[24] = endAdornment;
28400
- $[25] = t10;
28442
+ if ($[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
28443
+ t10 = /* @__PURE__ */ jsx("div", { className: "flex-grow" });
28444
+ $[26] = t10;
28401
28445
  } else {
28402
- t10 = $[25];
28446
+ t10 = $[26];
28403
28447
  }
28404
28448
  let t11;
28405
- if ($[26] !== includeModeToggle || $[27] !== mode || $[28] !== setMode || $[29] !== t) {
28406
- t11 = includeModeToggle && /* @__PURE__ */ jsxs(Menu, { trigger: /* @__PURE__ */ jsx(IconButton, { color: "inherit", "aria-label": "Open drawer", children: mode === "dark" ? /* @__PURE__ */ jsx(DarkModeIcon, { size: "small" }) : /* @__PURE__ */ jsx(LightModeIcon, { size: "small" }) }), children: [
28449
+ if ($[27] !== endAdornment) {
28450
+ t11 = endAdornment && /* @__PURE__ */ jsx(ErrorBoundary, { children: endAdornment });
28451
+ $[27] = endAdornment;
28452
+ $[28] = t11;
28453
+ } else {
28454
+ t11 = $[28];
28455
+ }
28456
+ let t12;
28457
+ if ($[29] !== includeModeToggle || $[30] !== mode || $[31] !== setMode || $[32] !== t) {
28458
+ t12 = includeModeToggle && /* @__PURE__ */ jsxs(Menu, { trigger: /* @__PURE__ */ jsx(IconButton, { color: "inherit", "aria-label": "Open drawer", children: mode === "dark" ? /* @__PURE__ */ jsx(DarkModeIcon, { size: "small" }) : /* @__PURE__ */ jsx(LightModeIcon, { size: "small" }) }), children: [
28407
28459
  /* @__PURE__ */ jsxs(MenuItem, { onClick: () => setMode("dark"), children: [
28408
28460
  /* @__PURE__ */ jsx(DarkModeIcon, { size: "smallest" }),
28409
28461
  " ",
@@ -28420,101 +28472,106 @@ const DefaultAppBar = function DefaultAppBar2(t0) {
28420
28472
  t("system_mode")
28421
28473
  ] })
28422
28474
  ] });
28423
- $[26] = includeModeToggle;
28424
- $[27] = mode;
28425
- $[28] = setMode;
28426
- $[29] = t;
28427
- $[30] = t11;
28475
+ $[29] = includeModeToggle;
28476
+ $[30] = mode;
28477
+ $[31] = setMode;
28478
+ $[32] = t;
28479
+ $[33] = t12;
28428
28480
  } else {
28429
- t11 = $[30];
28481
+ t12 = $[33];
28430
28482
  }
28431
- let t12;
28432
- if ($[31] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
28433
- t12 = /* @__PURE__ */ jsx(LanguageToggle, {});
28434
- $[31] = t12;
28483
+ let t13;
28484
+ if ($[34] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
28485
+ t13 = /* @__PURE__ */ jsx(LanguageToggle, {});
28486
+ $[34] = t13;
28435
28487
  } else {
28436
- t12 = $[31];
28488
+ t13 = $[34];
28437
28489
  }
28438
- let t13;
28439
- if ($[32] !== user) {
28440
- t13 = user && /* @__PURE__ */ jsxs("div", { className: "px-4 py-2 mb-2", children: [
28490
+ let t14;
28491
+ if ($[35] !== user) {
28492
+ t14 = user && /* @__PURE__ */ jsxs("div", { className: "px-4 py-2 mb-2", children: [
28441
28493
  user.displayName && /* @__PURE__ */ jsx(Typography, { variant: "body1", color: "secondary", children: user.displayName }),
28442
28494
  user.email && /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "secondary", children: user.email })
28443
28495
  ] });
28444
- $[32] = user;
28445
- $[33] = t13;
28496
+ $[35] = user;
28497
+ $[36] = t14;
28446
28498
  } else {
28447
- t13 = $[33];
28499
+ t14 = $[36];
28448
28500
  }
28449
- let t14;
28450
- if ($[34] !== authController || $[35] !== dropDownActions || $[36] !== navigate || $[37] !== t) {
28451
- t14 = !dropDownActions && /* @__PURE__ */ jsxs(MenuItem, { onClick: async () => {
28501
+ let t15;
28502
+ if ($[37] !== authController || $[38] !== dropDownActions || $[39] !== navigate || $[40] !== t) {
28503
+ t15 = !dropDownActions && /* @__PURE__ */ jsxs(MenuItem, { onClick: async () => {
28452
28504
  await authController.signOut();
28453
28505
  navigate("/");
28454
28506
  }, children: [
28455
28507
  /* @__PURE__ */ jsx(LogoutIcon, {}),
28456
28508
  t("log_out")
28457
28509
  ] });
28458
- $[34] = authController;
28459
- $[35] = dropDownActions;
28460
- $[36] = navigate;
28461
- $[37] = t;
28462
- $[38] = t14;
28510
+ $[37] = authController;
28511
+ $[38] = dropDownActions;
28512
+ $[39] = navigate;
28513
+ $[40] = t;
28514
+ $[41] = t15;
28463
28515
  } else {
28464
- t14 = $[38];
28516
+ t15 = $[41];
28465
28517
  }
28466
- let t15;
28467
- if ($[39] !== avatarComponent || $[40] !== dropDownActions || $[41] !== t13 || $[42] !== t14) {
28468
- t15 = /* @__PURE__ */ jsxs(Menu, { trigger: avatarComponent, children: [
28469
- t13,
28518
+ let t16;
28519
+ if ($[42] !== avatarComponent || $[43] !== dropDownActions || $[44] !== t14 || $[45] !== t15) {
28520
+ t16 = /* @__PURE__ */ jsxs(Menu, { trigger: avatarComponent, children: [
28521
+ t14,
28470
28522
  dropDownActions,
28471
- t14
28523
+ t15
28472
28524
  ] });
28473
- $[39] = avatarComponent;
28474
- $[40] = dropDownActions;
28475
- $[41] = t13;
28476
- $[42] = t14;
28477
- $[43] = t15;
28525
+ $[42] = avatarComponent;
28526
+ $[43] = dropDownActions;
28527
+ $[44] = t14;
28528
+ $[45] = t15;
28529
+ $[46] = t16;
28478
28530
  } else {
28479
- t15 = $[43];
28531
+ t16 = $[46];
28480
28532
  }
28481
- let t16;
28482
- if ($[44] !== startAdornment || $[45] !== style || $[46] !== t10 || $[47] !== t11 || $[48] !== t15 || $[49] !== t5 || $[50] !== t6 || $[51] !== t7 || $[52] !== t8) {
28483
- t16 = /* @__PURE__ */ jsxs("div", { style, className: t5, children: [
28533
+ let t17;
28534
+ if ($[47] !== startAdornment || $[48] !== style || $[49] !== t11 || $[50] !== t12 || $[51] !== t16 || $[52] !== t5 || $[53] !== t6 || $[54] !== t7 || $[55] !== t8 || $[56] !== t9) {
28535
+ t17 = /* @__PURE__ */ jsxs("div", { style, className: t5, children: [
28484
28536
  t6,
28485
28537
  t7,
28486
28538
  t8,
28487
- startAdornment,
28488
28539
  t9,
28540
+ startAdornment,
28489
28541
  t10,
28490
28542
  t11,
28491
28543
  t12,
28492
- t15
28544
+ t13,
28545
+ t16
28493
28546
  ] });
28494
- $[44] = startAdornment;
28495
- $[45] = style;
28496
- $[46] = t10;
28497
- $[47] = t11;
28498
- $[48] = t15;
28499
- $[49] = t5;
28500
- $[50] = t6;
28501
- $[51] = t7;
28502
- $[52] = t8;
28503
- $[53] = t16;
28547
+ $[47] = startAdornment;
28548
+ $[48] = style;
28549
+ $[49] = t11;
28550
+ $[50] = t12;
28551
+ $[51] = t16;
28552
+ $[52] = t5;
28553
+ $[53] = t6;
28554
+ $[54] = t7;
28555
+ $[55] = t8;
28556
+ $[56] = t9;
28557
+ $[57] = t17;
28504
28558
  } else {
28505
- t16 = $[53];
28559
+ t17 = $[57];
28506
28560
  }
28507
- return t16;
28561
+ return t17;
28508
28562
  };
28509
- function _temp$9(breadcrumb, index) {
28563
+ function _temp$a(breadcrumb, index) {
28510
28564
  return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
28511
28565
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "/" }),
28512
28566
  /* @__PURE__ */ jsx(Link, { className: "visited:text-inherit visited:dark:text-inherit block", to: breadcrumb.url, children: /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-2 whitespace-nowrap", children: [
28513
28567
  /* @__PURE__ */ jsx(Typography, { variant: "body2", children: breadcrumb.title }),
28514
- breadcrumb.count !== void 0 && (breadcrumb.count !== null ? /* @__PURE__ */ jsx("span", { className: "text-xs text-surface-accent-500 dark:text-surface-accent-400 bg-surface-100 dark:bg-surface-700 px-1 py-0 rounded", children: breadcrumb.count }) : /* @__PURE__ */ jsx(Skeleton, { className: "w-8 h-4 rounded-md" }))
28568
+ /* @__PURE__ */ jsx(CollectionCountBadge, { count: breadcrumb.count })
28515
28569
  ] }) }, index)
28516
28570
  ] }, breadcrumb.url + "_" + index);
28517
28571
  }
28572
+ function _temp2$5(breadcrumb_0) {
28573
+ return breadcrumb_0.title;
28574
+ }
28518
28575
  const buildIdsMap = (value) => value && Array.isArray(value) && value.length > 0 ? value.map((v, index) => {
28519
28576
  if (!v) return {};
28520
28577
  return {
@@ -28951,7 +29008,7 @@ function SearchIconsView(t0) {
28951
29008
  } else {
28952
29009
  const searchResult = iconsSearch.search(value);
28953
29010
  const limited = searchResult.slice(0, 50);
28954
- setKeys(limited.map(_temp$8));
29011
+ setKeys(limited.map(_temp$9));
28955
29012
  }
28956
29013
  }, UPDATE_SEARCH_INDEX_WAIT_MS);
28957
29014
  $[0] = t3;
@@ -29043,7 +29100,7 @@ function SearchIconsView(t0) {
29043
29100
  }
29044
29101
  return t11;
29045
29102
  }
29046
- function _temp$8(e) {
29103
+ function _temp$9(e) {
29047
29104
  return e.item.key;
29048
29105
  }
29049
29106
  function FieldCaption(t0) {
@@ -29502,7 +29559,7 @@ function LicenseBanner(t0) {
29502
29559
  i18n
29503
29560
  } = useTranslation();
29504
29561
  const plugins = useContext(CustomizationControllerContext)?.plugins;
29505
- const runsProPlugin = plugins?.some(_temp$7) ?? false;
29562
+ const runsProPlugin = plugins?.some(_temp$8) ?? false;
29506
29563
  const [dismissed, setDismissed] = useState(_temp2$4);
29507
29564
  const [dismissedForGood, setDismissedForGood] = useState(_temp3$3);
29508
29565
  const content = licenseStatus ? buildBannerContent(licenseStatus, t, i18n?.language, runsProPlugin) : null;
@@ -29592,7 +29649,7 @@ function _temp3$3() {
29592
29649
  function _temp2$4() {
29593
29650
  return readDismissed(sessionDismissals);
29594
29651
  }
29595
- function _temp$7(plugin) {
29652
+ function _temp$8(plugin) {
29596
29653
  return PRO_PLUGIN_KEYS.includes(plugin.key);
29597
29654
  }
29598
29655
  function buildBannerContent(status, t, language, runsProPlugin) {
@@ -29732,64 +29789,32 @@ function writeDismissed(store, states) {
29732
29789
  }
29733
29790
  }
29734
29791
  function useReferenceDialog(referenceDialogProps) {
29735
- const $ = c(9);
29736
29792
  const navigation = useNavigationController();
29737
29793
  const sideDialogsController = useSideDialogsController();
29738
- let t0;
29739
- if ($[0] !== navigation || $[1] !== referenceDialogProps || $[2] !== sideDialogsController) {
29740
- t0 = () => {
29741
- if (referenceDialogProps.path) {
29742
- let usedCollection = referenceDialogProps.collection;
29743
- if (!usedCollection) {
29744
- usedCollection = navigation.getCollection(referenceDialogProps.path);
29745
- }
29746
- if (!usedCollection) {
29747
- throw Error("Not able to resolve the collection in useReferenceDialog. Make sure a collection is registered in path " + referenceDialogProps.path);
29794
+ const open = useCallback(() => {
29795
+ if (referenceDialogProps.path) {
29796
+ let usedCollection = referenceDialogProps.collection;
29797
+ if (!usedCollection) usedCollection = navigation.getCollection(referenceDialogProps.path);
29798
+ if (!usedCollection) throw Error("Not able to resolve the collection in useReferenceDialog. Make sure a collection is registered in path " + referenceDialogProps.path);
29799
+ sideDialogsController.open({
29800
+ key: `reference_${referenceDialogProps.path}`,
29801
+ component: /* @__PURE__ */ jsx(ReferenceSelectionTable, { collection: usedCollection, ...referenceDialogProps }),
29802
+ width: "90vw",
29803
+ onClose: () => {
29804
+ referenceDialogProps.onClose?.();
29748
29805
  }
29749
- sideDialogsController.open({
29750
- key: `reference_${referenceDialogProps.path}`,
29751
- component: /* @__PURE__ */ jsx(ReferenceSelectionTable, { collection: usedCollection, ...referenceDialogProps }),
29752
- width: "90vw",
29753
- onClose: () => {
29754
- referenceDialogProps.onClose?.();
29755
- }
29756
- });
29757
- } else {
29758
- throw Error("useReferenceDialog: You are trying to open a reference dialog, but have not declared the `path`");
29759
- }
29760
- };
29761
- $[0] = navigation;
29762
- $[1] = referenceDialogProps;
29763
- $[2] = sideDialogsController;
29764
- $[3] = t0;
29765
- } else {
29766
- t0 = $[3];
29767
- }
29768
- const open = t0;
29769
- let t1;
29770
- if ($[4] !== sideDialogsController) {
29771
- t1 = () => {
29772
- sideDialogsController.close();
29773
- };
29774
- $[4] = sideDialogsController;
29775
- $[5] = t1;
29776
- } else {
29777
- t1 = $[5];
29778
- }
29779
- const close = t1;
29780
- let t2;
29781
- if ($[6] !== close || $[7] !== open) {
29782
- t2 = {
29783
- open,
29784
- close
29785
- };
29786
- $[6] = close;
29787
- $[7] = open;
29788
- $[8] = t2;
29789
- } else {
29790
- t2 = $[8];
29791
- }
29792
- return t2;
29806
+ });
29807
+ } else {
29808
+ throw Error("useReferenceDialog: You are trying to open a reference dialog, but have not declared the `path`");
29809
+ }
29810
+ }, [navigation, referenceDialogProps, sideDialogsController]);
29811
+ const close = useCallback(() => {
29812
+ sideDialogsController.close(`reference_${referenceDialogProps.path}`);
29813
+ }, [sideDialogsController, referenceDialogProps.path]);
29814
+ return {
29815
+ open,
29816
+ close
29817
+ };
29793
29818
  }
29794
29819
  const fireCMSLogo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAa9SURBVHgB7Z1NbBNHFMf/a7uBEgMOHy2pSlnUql+oEG7lgNgcqZAgR9RKSU5tT9mcqp6SXNoj5tBzHAmk3ggSUo/Ziko9skXqoVIlJm3Von4IhzhAIIk7b9ab+COJvZ63610nP8netWx5Z//73syb2Zm3BjqJXc4BixaQMgHjDFCWW5iVb83aH5eL8jdC7lS2a/Ny3wGyLvJGER3CQJRsCHZBfrqCBpHaRkCJuXYb2O9EKWg0AtpKtDF5gnJr5BA+BSVm/sAsQiY8AZW1PSHR7IhE2wwhX1NAWlrlywIhwC9gPISrR8iyFJDvnQIzvALapRH5PgG+uo0bAbLIfLYAJngEtJ+awOq03LOQCAxZN6bGOdw6BV3GyV1X7iEx4hFlGQGs3qt4jBbtW6Cq65bIXW0km7x06XG0SXsCei57S+4NoDtwZUs91I5LBxfQE28O8W0o2kVIEQeDihhMwO4Vz0cEFbF1AbtfPB8RRMTWBNw54vmIVkVsMYxRDYaJnYOpztl+1LQn1VxAu3QN3dPaBkGe80sTzX60vQt7geY0IsDcMw8r+wPO9N6H2TOPXHpBbn9DcfWgehHu09OYf/YGnNJ5uE9OIyJkjyWb3+rLrQVU9R71MMIbELD238XlvjsYOXQTuUywIbziSg6zC5cw8+/HcBbPI0RkwdJnt6oPtxFw6ZbX5eFn5PANDB+5qQTkQCyfwNSfX6Lw3ycICTkclh3c7IvNBQzJdUmwide+YhOunpCFHN1sFGcrAR+AsdUl95zo/xr2q98gCkhAEpIEZUQAL6Qr99XUNY2tsL3EOp5HjcPc2x9FJh5BVQQdk47NiAlkGgZOai2QOWD2xWM+kZah1nvwl+84W2xpfS9OVlthnQWuWugS8QgKhebeuYiBfffBRK7eCutduGng2ApxEM+HX0RjrPrThoD2Y7b7tHERz4dEvPXmVbXl+DvvNq1HlQWmLoMBClPiJJ4PlWn65KfgIbVuhV4jojrNLz2CJlTIBx+cQpwZ+vVbzBYvQZP1xqRigWkLDEybnyHuXDv+BYcrS4PrsWinIqC++17J3Qmth8EJeQlPTErTVDbqQAuajEUYKOsyfPgm9DGU0Rkc9V8S6r56KMDWH8V50SctMKM9WErumzSGj9yAPj0WubAFTXhcIlp4LnrZTFVmhbYNtWiMXaXI4Cm3cUYKmNIa80mieD76UYOyQGgN2SdZQLrnovsXJKAJDRgK0TE4upzaFpjLsHTQO8JB/R6JmYEuyz3A4gEkkuW90EVfwLvyZtXffUgkB03gfWihP0N1h0MCCmhQTOu7QadY0C97UdsCxd64rGQIjtijXXahbYHuvn4kFbf3GDQhC1zTCobcfdqF6Bhur+7FN8gCUy40KGb2wjlgImmQ++pf/LV5skABTb6ncCBhMF10Rwq46kCT/LFzSBozr5yFPituqjJNQUCDpLkxuS9DeUXVXbnybWgydXwQSWHquAUGHHrzBXSgCV3RJFghWV/hKIf7GsroKgKqelB7mfzoW0OIO0zWJ3nu0LsnoKoH9a2Qru64eRFxpXB0gMn6UPCnuFV35a6DgXz/h7F0Zd6La6y3GXUTLEt0f1i7g2guFzH387TaxgESb/DUKEffV/0d8tmT/oe6wYQyixUyF1gLCrGG3r3KWZaavAt1Aq7QghIWs4mDiCQelYGxvy5UBpAqagX0GhMWK1RHq4jIMOrR1rHPnv6cebCjPFO/4KZxmYM3V4ZyIJhgZPIPBxO/zyEKrvefw+TrlrJARmrqPp9IF9qE3biQ1VEsGlIUEGChDWGXyFwshMDIPy7G/voRA0sPwQFVEddl+MQU422CMYt876a9hCaLDVfJlUNrBQaePIQthbywIAJbJbnnjAyMZw+9F3LcSVnjMm0sNiTsEq2JuIYIIDHNZ0VYjx/gxPMicivPar4nweZ7cmoUmSwuwpHw0e0yHTVf8m8v5uvXRuwcZESS379tXpwW7sqtTELlVdlxuM3EI5oLqGLDNFWgAjsHUTnnpuymPWlE8Kc98dlNvNNAMAGJ3dRPNQSf2qEOkKYbIN3UsLjtiEcEt8BquiLEocGT7GS7mX/1BCS8fjMF2wmbZaTyUk9tlxOmFfQFJLwcM1JE4wqSgSNddpQjBSiPgD67SWiZsBcn5V8PIzZCkrvSTTPprsxZzsMRkPDCHQsdtcjwhPMJT8BqvHwM8pUaRuiQaCkHWKOBAAchE42APusPI1Bi0gMJTPAgvPk9NDmgGx9GsBVK0NIA1Mg3rdlTCx9z3rYha5zY2NLjMMo/eXMboxWsnv8Br15XnnLWoGsAAAAASUVORK5CYII=";
29795
29820
  function useBrowserTitleAndIcon(name, logo) {
@@ -30448,7 +30473,7 @@ function useBuildLocalConfigurationPersistence() {
30448
30473
  t0 = $[0];
30449
30474
  }
30450
30475
  const configCache = useRef(t0);
30451
- const getCollectionFromStorage = _temp$6;
30476
+ const getCollectionFromStorage = _temp$7;
30452
30477
  let t1;
30453
30478
  if ($[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
30454
30479
  t1 = (path) => {
@@ -30571,7 +30596,7 @@ function useBuildLocalConfigurationPersistence() {
30571
30596
  }
30572
30597
  return t11;
30573
30598
  }
30574
- function _temp$6(storageKey) {
30599
+ function _temp$7(storageKey) {
30575
30600
  return getLocalStorageJSON(storageKey, {});
30576
30601
  }
30577
30602
  function useBuildModeController() {
@@ -30734,78 +30759,32 @@ function useValidateAuthenticator(t0) {
30734
30759
  }
30735
30760
  return t7;
30736
30761
  }
30737
- function useNavigationUnsavedChangesDialog(when, onSuccess) {
30738
- const [isDialogOpen, setIsDialogOpen] = useState(false);
30739
- const [pendingNavigation, setPendingNavigation] = useState(null);
30740
- const handleCancel = useCallback(() => {
30741
- setIsDialogOpen(false);
30742
- setPendingNavigation(null);
30743
- }, []);
30744
- const handleOk = useCallback(() => {
30745
- setIsDialogOpen(false);
30746
- if (pendingNavigation) {
30747
- onSuccess();
30748
- if (pendingNavigation.type === "popstate") {
30749
- window.history.go(pendingNavigation.delta);
30750
- } else if (pendingNavigation.type === "link") {
30751
- window.location.href = pendingNavigation.href;
30752
- }
30753
- setPendingNavigation(null);
30754
- }
30755
- }, [onSuccess, pendingNavigation]);
30756
- const handleBeforeUnload = useCallback((e) => {
30757
- if (when) {
30758
- e.preventDefault();
30759
- e.returnValue = "";
30760
- }
30761
- }, [when]);
30762
- const handlePopState = useCallback((e_0) => {
30763
- if (when) {
30764
- e_0.preventDefault();
30765
- setPendingNavigation({
30766
- type: "popstate",
30767
- delta: -1
30768
- });
30769
- setIsDialogOpen(true);
30770
- }
30771
- }, [when]);
30772
- const handleLinkClick = useCallback((e_1) => {
30773
- if (!when) return;
30774
- const target = e_1.target;
30775
- const anchor = target.closest("a[href]");
30776
- if (anchor && anchor.host === window.location.host) {
30777
- e_1.preventDefault();
30778
- const href = anchor.getAttribute("href");
30779
- if (href) {
30780
- setPendingNavigation({
30781
- type: "link",
30782
- href
30783
- });
30784
- setIsDialogOpen(true);
30762
+ function useLeavePageConfirmation(when) {
30763
+ const $ = c(3);
30764
+ let t0;
30765
+ let t1;
30766
+ if ($[0] !== when) {
30767
+ t0 = () => {
30768
+ if (!when) {
30769
+ return;
30785
30770
  }
30786
- }
30787
- }, [when]);
30788
- useEffect(() => {
30789
- if (when) {
30771
+ const handleBeforeUnload = _temp$6;
30790
30772
  window.addEventListener("beforeunload", handleBeforeUnload);
30791
- window.addEventListener("popstate", handlePopState);
30792
- document.addEventListener("click", handleLinkClick);
30793
- } else {
30794
- window.removeEventListener("beforeunload", handleBeforeUnload);
30795
- window.removeEventListener("popstate", handlePopState);
30796
- document.removeEventListener("click", handleLinkClick);
30797
- }
30798
- return () => {
30799
- window.removeEventListener("beforeunload", handleBeforeUnload);
30800
- window.removeEventListener("popstate", handlePopState);
30801
- document.removeEventListener("click", handleLinkClick);
30773
+ return () => window.removeEventListener("beforeunload", handleBeforeUnload);
30802
30774
  };
30803
- }, [when, handleBeforeUnload, handlePopState, handleLinkClick]);
30804
- return {
30805
- navigationWasBlocked: isDialogOpen,
30806
- handleCancel,
30807
- handleOk
30808
- };
30775
+ t1 = [when];
30776
+ $[0] = when;
30777
+ $[1] = t0;
30778
+ $[2] = t1;
30779
+ } else {
30780
+ t0 = $[1];
30781
+ t1 = $[2];
30782
+ }
30783
+ useEffect(t0, t1);
30784
+ }
30785
+ function _temp$6(e) {
30786
+ e.preventDefault();
30787
+ e.returnValue = "";
30809
30788
  }
30810
30789
  function UnsavedChangesDialog(t0) {
30811
30790
  const $ = c(30);
@@ -31125,17 +31104,14 @@ function SideDialogView({
31125
31104
  const widthRef = React__default.useRef(panel?.width);
31126
31105
  const width = widthRef.current;
31127
31106
  const sideDialogsController = useSideDialogsController();
31128
- const {
31129
- handleOk: handleNavigationOk,
31130
- handleCancel: handleNavigationCancel
31131
- } = useNavigationUnsavedChangesDialog(blocked && !drawerCloseRequested, () => setBlocked(false));
31107
+ useLeavePageConfirmation(blocked && !drawerCloseRequested);
31132
31108
  useEffect(() => {
31133
31109
  if (panel) widthRef.current = panel.width;
31134
31110
  }, [panel]);
31135
31111
  const handleDrawerCloseOk = () => {
31136
31112
  setBlocked(false);
31137
31113
  setDrawerCloseRequested(false);
31138
- sideDialogsController.close();
31114
+ sideDialogsController.close(panel?.key);
31139
31115
  panel?.onClose?.();
31140
31116
  };
31141
31117
  const handleDrawerCloseCancel = () => {
@@ -31145,7 +31121,7 @@ function SideDialogView({
31145
31121
  if (blocked && !force) {
31146
31122
  setDrawerCloseRequested(true);
31147
31123
  } else {
31148
- sideDialogsController.close();
31124
+ sideDialogsController.close(panel?.key);
31149
31125
  panel?.onClose?.();
31150
31126
  }
31151
31127
  };
@@ -31178,7 +31154,7 @@ function SideDialogView({
31178
31154
  width
31179
31155
  } })
31180
31156
  ] }),
31181
- /* @__PURE__ */ jsx(UnsavedChangesDialog, { open: drawerCloseRequested, handleOk: drawerCloseRequested ? handleDrawerCloseOk : handleNavigationOk, handleCancel: drawerCloseRequested ? handleDrawerCloseCancel : handleNavigationCancel, body: blockedNavigationMessage })
31157
+ /* @__PURE__ */ jsx(UnsavedChangesDialog, { open: drawerCloseRequested, handleOk: handleDrawerCloseOk, handleCancel: handleDrawerCloseCancel, body: blockedNavigationMessage })
31182
31158
  ] });
31183
31159
  }
31184
31160
  function EntityEditViewFormActions({
@@ -31644,6 +31620,9 @@ function EntityEditViewInner({
31644
31620
  }, [selectedTabProp]);
31645
31621
  const subcollections = (collection.subcollections ?? []).filter((c2) => !c2.hideFromNavigation);
31646
31622
  const subcollectionsCount = subcollections?.length ?? 0;
31623
+ const [subcollectionCounts, setSubcollectionCounts] = useState({});
31624
+ const selectedSubcollection = subcollections.find((subcollection) => (subcollection.id ?? subcollection.path) === selectedTab);
31625
+ const selectedSubcollectionDataSource = useDataSource();
31647
31626
  const customViews = collection.entityViews ?? [];
31648
31627
  const customViewsCount = customViews?.length ?? 0;
31649
31628
  const includeJsonView = collection.includeJsonView === void 0 ? true : collection.includeJsonView;
@@ -31717,15 +31696,18 @@ function EntityEditViewInner({
31717
31696
  const jsonView = selectedTab === JSON_TAB_VALUE || mountedTabsRef.current.has(JSON_TAB_VALUE) ? /* @__PURE__ */ jsx("div", { className: cls("relative flex-1 h-full overflow-auto w-full", {
31718
31697
  "hidden": selectedTab !== JSON_TAB_VALUE
31719
31698
  }), role: "tabpanel", children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(EntityJsonPreview, { values: formContext?.values ?? entity?.values ?? {} }) }) }, "json_view") : null;
31720
- const subCollectionsViews = subcollections && subcollections.map((subcollection) => {
31721
- const subcollectionId = subcollection.id ?? subcollection.path;
31722
- const newFullPath = usedEntity ? `${path}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(subcollection.path)}` : void 0;
31699
+ const subCollectionsViews = subcollections && subcollections.map((subcollection_0) => {
31700
+ const subcollectionId = subcollection_0.id ?? subcollection_0.path;
31701
+ const newFullPath = usedEntity ? `${path}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(subcollection_0.path)}` : void 0;
31723
31702
  const newFullIdPath = fullIdPath && usedEntity ? `${fullIdPath}/${encodeEntityId(usedEntity.id)}/${removeInitialAndTrailingSlashes(subcollectionId)}` : void 0;
31724
- const newPathSegments = buildSubcollectionPathSegments(pathSegments, usedEntity?.id, subcollection.path);
31703
+ const newPathSegments = buildSubcollectionPathSegments(pathSegments, usedEntity?.id, subcollection_0.path);
31725
31704
  if (selectedTab !== subcollectionId) return null;
31726
31705
  return /* @__PURE__ */ jsxs("div", { className: "relative flex-1 h-full overflow-auto w-full", role: "tabpanel", children: [
31727
31706
  globalLoading && /* @__PURE__ */ jsx(CircularProgressCenter, {}),
31728
- !globalLoading && (usedEntity && newFullPath ? /* @__PURE__ */ jsx(EntityCollectionView$1, { fullPath: newFullPath, pathSegments: newPathSegments, fullIdPath: newFullIdPath, parentCollectionIds: [...parentCollectionIds, collection.id], isSubCollection: true, updateUrl: false, ...subcollection, openEntityMode: layout }) : /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-full h-full p-3", children: /* @__PURE__ */ jsx(Typography, { variant: "label", children: t("youd_need_to_save_before_additional_collections") }) }))
31707
+ !globalLoading && (usedEntity && newFullPath ? /* @__PURE__ */ jsx(EntityCollectionView$1, { fullPath: newFullPath, pathSegments: newPathSegments, fullIdPath: newFullIdPath, parentCollectionIds: [...parentCollectionIds, collection.id], isSubCollection: true, updateUrl: false, ...subcollection_0, openEntityMode: layout, onCountChange: (count) => setSubcollectionCounts((counts) => counts[subcollectionId] === count ? counts : {
31708
+ ...counts,
31709
+ [subcollectionId]: count
31710
+ }) }) : /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-full h-full p-3", children: /* @__PURE__ */ jsx(Typography, { variant: "label", children: t("youd_need_to_save_before_additional_collections") }) }))
31729
31711
  ] }, `subcol_${subcollectionId}`);
31730
31712
  }).filter(Boolean);
31731
31713
  const onSideTabClick = (value_0) => {
@@ -31761,7 +31743,7 @@ function EntityEditViewInner({
31761
31743
  onSaved?.(res);
31762
31744
  formProps?.onSaved?.(res);
31763
31745
  }, Builder: selectedSecondaryForm?.Builder });
31764
- const subcollectionTabs = subcollections && subcollections.filter((sub) => !groupedViews.includes(sub.id ?? sub.path)).map((subcollection_0) => /* @__PURE__ */ jsx(Tab, { className: "text-sm min-w-[120px]", value: subcollection_0.id ?? subcollection_0.path, children: subcollection_0.name }, `entity_detail_collection_tab_${subcollection_0.name}`));
31746
+ const subcollectionTabs = subcollections && subcollections.filter((sub) => !groupedViews.includes(sub.id ?? sub.path)).map((subcollection_1) => /* @__PURE__ */ jsx(Tab, { className: "text-sm min-w-[120px]", value: subcollection_1.id ?? subcollection_1.path, children: subcollection_1.name }, `entity_detail_collection_tab_${subcollection_1.name}`));
31765
31747
  const customViewTabsStart = resolvedEntityViews.filter((view) => view.position === "start" && !groupedViews.includes(view.key)).map((view_0) => /* @__PURE__ */ jsx(Tab, { className: !view_0.tabComponent ? "text-sm min-w-[120px]" : void 0, value: view_0.key, children: view_0.tabComponent ?? view_0.name }, `entity_detail_collection_tab_${view_0.name}`));
31766
31748
  const customViewTabsEnd = resolvedEntityViews.filter((view_1) => (!view_1.position || view_1.position === "end") && !groupedViews.includes(view_1.key)).map((view_2) => /* @__PURE__ */ jsx(Tab, { className: !view_2.tabComponent ? "text-sm min-w-[120px]" : void 0, value: view_2.key, children: view_2.tabComponent ?? view_2.name }, `entity_detail_collection_tab_${view_2.name}`));
31767
31749
  const viewGroupMenus = collection.viewGroups?.map((group) => {
@@ -31770,13 +31752,17 @@ function EntityEditViewInner({
31770
31752
  group.name,
31771
31753
  /* @__PURE__ */ jsx(ExpandMoreIcon, { className: "ml-1 -mr-1", size: "small" })
31772
31754
  ] }), children: group.views.map((viewId) => {
31773
- const subcollection_1 = subcollections.find((s) => (s.id ?? s.path) === viewId);
31755
+ const subcollection_2 = subcollections.find((s) => (s.id ?? s.path) === viewId);
31774
31756
  const customView_0 = resolvedEntityViews.find((v) => v.key === viewId);
31775
- const name = subcollection_1?.name ?? customView_0?.name ?? viewId;
31757
+ const name = subcollection_2?.name ?? customView_0?.name ?? viewId;
31776
31758
  return /* @__PURE__ */ jsx(MenuItem, { onClick: () => onSideTabClick(viewId), className: selectedTab === viewId ? "bg-surface-accent-100 dark:bg-surface-accent-900" : "", children: name }, `view_group_${group.name}_${viewId}`);
31777
31759
  }) }, `view_group_${group.name}`);
31778
31760
  });
31779
31761
  const shouldShowTopBar = Boolean(barActions) || hasAdditionalViews;
31762
+ const subcollectionTitle = layout === "side_panel" && selectedSubcollection && usedEntity ? (() => {
31763
+ const subcollectionId_0 = selectedSubcollection.id ?? selectedSubcollection.path;
31764
+ return /* @__PURE__ */ jsx(CollectionPathTitle, { path: fullIdPath ? `${fullIdPath}/${encodeEntityId(usedEntity.id)}/${removeInitialAndTrailingSlashes(subcollectionId_0)}` : `${path}/${usedEntity.id}/${removeInitialAndTrailingSlashes(selectedSubcollection.path)}`, name: selectedSubcollection.name, count: subcollectionCounts[subcollectionId_0] ?? (selectedSubcollectionDataSource.countEntities ? null : void 0) });
31765
+ })() : null;
31780
31766
  let result = /* @__PURE__ */ jsxs("div", { className: "relative flex flex-col h-full w-full bg-white dark:bg-surface-900", children: [
31781
31767
  shouldShowTopBar && /* @__PURE__ */ jsxs("div", { className: cls("h-14 items-center overflow-hidden w-full border-b pl-2 pr-2 flex gap-2 bg-surface-50 dark:bg-surface-900", defaultBorderMixin), children: [
31782
31768
  barActions?.({
@@ -31785,6 +31771,7 @@ function EntityEditViewInner({
31785
31771
  values: formContext?.values ?? usedEntity?.values ?? {},
31786
31772
  status
31787
31773
  }),
31774
+ subcollectionTitle,
31788
31775
  /* @__PURE__ */ jsx("div", { className: "flex-grow" }),
31789
31776
  pluginActionsTop,
31790
31777
  globalLoading && /* @__PURE__ */ jsx("div", { className: "self-center", children: /* @__PURE__ */ jsx(CircularProgress, { size: "small" }) }),
@@ -32036,7 +32023,7 @@ const propsToSidePanel = (props, buildUrlCollectionPath, resolveIdsFrom, smallLa
32036
32023
  };
32037
32024
  };
32038
32025
  function useBuildSideDialogsController() {
32039
- const $ = c(21);
32026
+ const $ = c(23);
32040
32027
  const location = useLocation();
32041
32028
  const navigate = useNavigate();
32042
32029
  let t0;
@@ -32059,46 +32046,78 @@ function useBuildSideDialogsController() {
32059
32046
  const routesCount = useRef(0);
32060
32047
  let t2;
32061
32048
  if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
32062
- t2 = (newPanels) => {
32063
- sidePanelsRef.current = newPanels;
32064
- setSidePanels(newPanels);
32065
- };
32049
+ t2 = {};
32066
32050
  $[2] = t2;
32067
32051
  } else {
32068
32052
  t2 = $[2];
32069
32053
  }
32070
- const updateSidePanels = t2;
32054
+ const entryKeysOfPanelsWithoutUrl = useRef(t2);
32071
32055
  let t3;
32072
- if ($[3] !== location.state) {
32073
- t3 = () => {
32056
+ if ($[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
32057
+ t3 = (newPanels) => {
32058
+ sidePanelsRef.current = newPanels;
32059
+ setSidePanels(newPanels);
32060
+ };
32061
+ $[3] = t3;
32062
+ } else {
32063
+ t3 = $[3];
32064
+ }
32065
+ const updateSidePanels = t3;
32066
+ let t4;
32067
+ if ($[4] !== location.key || $[5] !== location.state) {
32068
+ t4 = () => {
32074
32069
  const state = location.state;
32075
32070
  const panelKeys = state?.panels ?? [];
32076
- const newPanels_0 = panelKeys.map((key) => routesStore.current[key]).filter(_temp$4);
32071
+ const panelsInHistory = panelKeys.map((key) => routesStore.current[key]).filter(_temp$4);
32072
+ const keptPanels = [];
32073
+ let matched = 0;
32074
+ for (const panel of sidePanelsRef.current) {
32075
+ if (panelsInHistory[matched]?.key === panel.key) {
32076
+ keptPanels.push(panel);
32077
+ matched++;
32078
+ } else {
32079
+ if (!panel.urlPath && (keptPanels.length > 0 || entryKeysOfPanelsWithoutUrl.current[panel.key] === location.key)) {
32080
+ keptPanels.push(panel);
32081
+ } else {
32082
+ break;
32083
+ }
32084
+ }
32085
+ }
32086
+ const newPanels_0 = [...keptPanels, ...panelsInHistory.slice(matched)];
32077
32087
  if (!equal(sidePanelsRef.current.map(_temp2$3), newPanels_0.map(_temp3$2))) {
32078
32088
  updateSidePanels(newPanels_0);
32079
32089
  }
32080
32090
  };
32081
- $[3] = location.state;
32082
- $[4] = t3;
32083
- } else {
32084
- t3 = $[4];
32085
- }
32086
- let t4;
32087
- if ($[5] !== location) {
32088
- t4 = [location];
32089
- $[5] = location;
32091
+ $[4] = location.key;
32092
+ $[5] = location.state;
32090
32093
  $[6] = t4;
32091
32094
  } else {
32092
32095
  t4 = $[6];
32093
32096
  }
32094
- useEffect(t3, t4);
32095
32097
  let t5;
32096
- if ($[7] !== location || $[8] !== navigate) {
32097
- t5 = () => {
32098
+ if ($[7] !== location) {
32099
+ t5 = [location];
32100
+ $[7] = location;
32101
+ $[8] = t5;
32102
+ } else {
32103
+ t5 = $[8];
32104
+ }
32105
+ useEffect(t4, t5);
32106
+ let t6;
32107
+ if ($[9] !== location || $[10] !== navigate) {
32108
+ t6 = (key_0) => {
32098
32109
  const currentPanels = sidePanelsRef.current;
32099
32110
  if (currentPanels.length === 0) {
32100
32111
  return;
32101
32112
  }
32113
+ const index = key_0 !== void 0 ? currentPanels.findLastIndex((p_2) => p_2.key === key_0) : -1;
32114
+ if (index !== -1 && index < currentPanels.length - 1 && !currentPanels[index].urlPath) {
32115
+ updateSidePanels(currentPanels.filter((_, i) => i !== index));
32116
+ if (routesCount.current > 0) {
32117
+ routesCount.current = routesCount.current - 1;
32118
+ }
32119
+ return;
32120
+ }
32102
32121
  const lastSidePanel = currentPanels[currentPanels.length - 1];
32103
32122
  const updatedPanels = [...currentPanels.slice(0, -1)];
32104
32123
  updateSidePanels(updatedPanels);
@@ -32120,28 +32139,31 @@ function useBuildSideDialogsController() {
32120
32139
  }
32121
32140
  }
32122
32141
  };
32123
- $[7] = location;
32124
- $[8] = navigate;
32125
- $[9] = t5;
32142
+ $[9] = location;
32143
+ $[10] = navigate;
32144
+ $[11] = t6;
32126
32145
  } else {
32127
- t5 = $[9];
32146
+ t6 = $[11];
32128
32147
  }
32129
- const close = t5;
32130
- let t6;
32131
- if ($[10] !== location || $[11] !== navigate) {
32132
- t6 = (panelProps) => {
32148
+ const close = t6;
32149
+ let t7;
32150
+ if ($[12] !== location || $[13] !== navigate) {
32151
+ t7 = (panelProps) => {
32133
32152
  const newPanels_1 = Array.isArray(panelProps) ? panelProps : [panelProps];
32134
- newPanels_1.forEach((panel) => {
32135
- routesStore.current[panel.key] = panel;
32153
+ newPanels_1.forEach((panel_0) => {
32154
+ routesStore.current[panel_0.key] = panel_0;
32155
+ if (!panel_0.urlPath) {
32156
+ entryKeysOfPanelsWithoutUrl.current[panel_0.key] = location.key;
32157
+ }
32136
32158
  });
32137
32159
  routesCount.current = routesCount.current + newPanels_1.length;
32138
32160
  const baseLocation_0 = location.state?.base_location ?? location;
32139
32161
  const currentPanels_0 = sidePanelsRef.current;
32140
32162
  const updatedPanels_0 = [...currentPanels_0, ...newPanels_1];
32141
32163
  updateSidePanels(updatedPanels_0);
32142
- newPanels_1.forEach((panel_0) => {
32143
- if (panel_0.urlPath) {
32144
- navigate(panel_0.urlPath, {
32164
+ newPanels_1.forEach((panel_1) => {
32165
+ if (panel_1.urlPath) {
32166
+ navigate(panel_1.urlPath, {
32145
32167
  state: {
32146
32168
  base_location: baseLocation_0,
32147
32169
  panels: updatedPanels_0.map(_temp5)
@@ -32150,27 +32172,30 @@ function useBuildSideDialogsController() {
32150
32172
  }
32151
32173
  });
32152
32174
  };
32153
- $[10] = location;
32154
- $[11] = navigate;
32155
- $[12] = t6;
32175
+ $[12] = location;
32176
+ $[13] = navigate;
32177
+ $[14] = t7;
32156
32178
  } else {
32157
- t6 = $[12];
32179
+ t7 = $[14];
32158
32180
  }
32159
- const open = t6;
32160
- let t7;
32161
- if ($[13] !== location || $[14] !== navigate) {
32162
- t7 = (panelProps_0) => {
32181
+ const open = t7;
32182
+ let t8;
32183
+ if ($[15] !== location || $[16] !== navigate) {
32184
+ t8 = (panelProps_0) => {
32163
32185
  const newPanels_2 = Array.isArray(panelProps_0) ? panelProps_0 : [panelProps_0];
32164
- newPanels_2.forEach((panel_1) => {
32165
- routesStore.current[panel_1.key] = panel_1;
32186
+ newPanels_2.forEach((panel_2) => {
32187
+ routesStore.current[panel_2.key] = panel_2;
32188
+ if (!panel_2.urlPath) {
32189
+ entryKeysOfPanelsWithoutUrl.current[panel_2.key] = location.key;
32190
+ }
32166
32191
  });
32167
32192
  const baseLocation_1 = location.state?.base_location ?? location;
32168
32193
  const currentPanels_1 = sidePanelsRef.current;
32169
32194
  const updatedPanels_1 = [...currentPanels_1.slice(0, -newPanels_2.length), ...newPanels_2];
32170
32195
  updateSidePanels(updatedPanels_1);
32171
- newPanels_2.forEach((panel_2) => {
32172
- if (panel_2.urlPath) {
32173
- navigate(panel_2.urlPath, {
32196
+ newPanels_2.forEach((panel_3) => {
32197
+ if (panel_3.urlPath) {
32198
+ navigate(panel_3.urlPath, {
32174
32199
  replace: true,
32175
32200
  state: {
32176
32201
  base_location: baseLocation_1,
@@ -32180,41 +32205,41 @@ function useBuildSideDialogsController() {
32180
32205
  }
32181
32206
  });
32182
32207
  };
32183
- $[13] = location;
32184
- $[14] = navigate;
32185
- $[15] = t7;
32208
+ $[15] = location;
32209
+ $[16] = navigate;
32210
+ $[17] = t8;
32186
32211
  } else {
32187
- t7 = $[15];
32212
+ t8 = $[17];
32188
32213
  }
32189
- const replace = t7;
32190
- let t8;
32191
- if ($[16] !== close || $[17] !== open || $[18] !== replace || $[19] !== sidePanels) {
32192
- t8 = {
32214
+ const replace = t8;
32215
+ let t9;
32216
+ if ($[18] !== close || $[19] !== open || $[20] !== replace || $[21] !== sidePanels) {
32217
+ t9 = {
32193
32218
  sidePanels,
32194
32219
  setSidePanels: updateSidePanels,
32195
32220
  close,
32196
32221
  open,
32197
32222
  replace
32198
32223
  };
32199
- $[16] = close;
32200
- $[17] = open;
32201
- $[18] = replace;
32202
- $[19] = sidePanels;
32203
- $[20] = t8;
32224
+ $[18] = close;
32225
+ $[19] = open;
32226
+ $[20] = replace;
32227
+ $[21] = sidePanels;
32228
+ $[22] = t9;
32204
32229
  } else {
32205
- t8 = $[20];
32230
+ t9 = $[22];
32206
32231
  }
32207
- return t8;
32232
+ return t9;
32233
+ }
32234
+ function _temp6(p_5) {
32235
+ return p_5.key;
32208
32236
  }
32209
- function _temp6(p_4) {
32237
+ function _temp5(p_4) {
32210
32238
  return p_4.key;
32211
32239
  }
32212
- function _temp5(p_3) {
32240
+ function _temp4$1(p_3) {
32213
32241
  return p_3.key;
32214
32242
  }
32215
- function _temp4$1(p_2) {
32216
- return p_2.key;
32217
- }
32218
32243
  function _temp3$2(p_1) {
32219
32244
  return p_1.key;
32220
32245
  }