@firecms/core 3.0.0-canary.204 → 3.0.0-canary.206

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -3683,7 +3683,7 @@ function useCollectionFetch(t0) {
3683
3683
  }
3684
3684
  setDataLoading(false);
3685
3685
  setDataLoadingError(void 0);
3686
- setData(entities.map(_temp$t));
3686
+ setData(entities.map(_temp$s));
3687
3687
  setNoMoreToLoad(!itemCount || entities.length < itemCount);
3688
3688
  };
3689
3689
  const onError = (error) => {
@@ -3766,7 +3766,7 @@ function useCollectionFetch(t0) {
3766
3766
  }
3767
3767
  function _temp2$e() {
3768
3768
  }
3769
- function _temp$t(e_0) {
3769
+ function _temp$s(e_0) {
3770
3770
  return {
3771
3771
  ...e_0
3772
3772
  };
@@ -3831,7 +3831,7 @@ function useEntityFetch(t0) {
3831
3831
  setEntity(CACHE[`${path}/${entityId}`]);
3832
3832
  setDataLoading(false);
3833
3833
  setDataLoadingError(void 0);
3834
- return _temp$s;
3834
+ return _temp$r;
3835
3835
  } else {
3836
3836
  if (entityId && path && collection) {
3837
3837
  if (dataSource.listenEntity) {
@@ -3899,7 +3899,7 @@ function _temp3$4() {
3899
3899
  }
3900
3900
  function _temp2$d() {
3901
3901
  }
3902
- function _temp$s() {
3902
+ function _temp$r() {
3903
3903
  }
3904
3904
  async function saveEntityWithCallbacks({
3905
3905
  collection,
@@ -4749,7 +4749,7 @@ function useBuildLocalConfigurationPersistence() {
4749
4749
  t0 = $[0];
4750
4750
  }
4751
4751
  const configCache = useRef(t0);
4752
- const getCollectionFromStorage = _temp$r;
4752
+ const getCollectionFromStorage = _temp$q;
4753
4753
  let t1;
4754
4754
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
4755
4755
  t1 = (path) => {
@@ -4872,7 +4872,7 @@ function useBuildLocalConfigurationPersistence() {
4872
4872
  }
4873
4873
  return t11;
4874
4874
  }
4875
- function _temp$r(storageKey) {
4875
+ function _temp$q(storageKey) {
4876
4876
  const item = localStorage.getItem(storageKey);
4877
4877
  return item ? JSON.parse(item) : {};
4878
4878
  }
@@ -5165,7 +5165,7 @@ function ImagePreview(t0) {
5165
5165
  }
5166
5166
  let t9;
5167
5167
  if ($[16] !== url) {
5168
- 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: "small", onClick: _temp$q, children: t8 }) });
5168
+ 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: "small", onClick: _temp$p, children: t8 }) });
5169
5169
  $[16] = url;
5170
5170
  $[17] = t9;
5171
5171
  } else {
@@ -5199,7 +5199,7 @@ function ImagePreview(t0) {
5199
5199
  }
5200
5200
  return t11;
5201
5201
  }
5202
- function _temp$q(e_0) {
5202
+ function _temp$p(e_0) {
5203
5203
  return e_0.stopPropagation();
5204
5204
  }
5205
5205
  function UrlComponentPreview(t0) {
@@ -5232,7 +5232,7 @@ function UrlComponentPreview(t0) {
5232
5232
  }
5233
5233
  let t3;
5234
5234
  if ($[2] !== url) {
5235
- 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$p, target: "_blank", children: [
5235
+ 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$o, target: "_blank", children: [
5236
5236
  t2,
5237
5237
  url
5238
5238
  ] });
@@ -5363,7 +5363,7 @@ function UrlComponentPreview(t0) {
5363
5363
  function _temp2$c(e_0) {
5364
5364
  return e_0.stopPropagation();
5365
5365
  }
5366
- function _temp$p(e) {
5366
+ function _temp$o(e) {
5367
5367
  e.preventDefault();
5368
5368
  }
5369
5369
  function VideoPreview(t0) {
@@ -5497,7 +5497,7 @@ function SkeletonPropertyComponent(t0) {
5497
5497
  if (Array.isArray(arrayProperty.of)) {
5498
5498
  let t1;
5499
5499
  if ($[6] !== arrayProperty.of) {
5500
- t1 = arrayProperty.of.map(_temp$o);
5500
+ t1 = arrayProperty.of.map(_temp$n);
5501
5501
  $[6] = arrayProperty.of;
5502
5502
  $[7] = t1;
5503
5503
  } else {
@@ -5635,7 +5635,7 @@ function SkeletonPropertyComponent(t0) {
5635
5635
  }
5636
5636
  return content || null;
5637
5637
  }
5638
- function _temp$o(p, i) {
5638
+ function _temp$n(p, i) {
5639
5639
  return renderGenericArrayCell(p, i);
5640
5640
  }
5641
5641
  function renderMap(property, size) {
@@ -6799,7 +6799,7 @@ function KeyValuePreview(t0) {
6799
6799
  }
6800
6800
  let t1;
6801
6801
  if ($[1] !== value) {
6802
- t1 = Object.entries(value).map(_temp$n);
6802
+ t1 = Object.entries(value).map(_temp$m);
6803
6803
  $[1] = value;
6804
6804
  $[2] = t1;
6805
6805
  } else {
@@ -6815,7 +6815,7 @@ function KeyValuePreview(t0) {
6815
6815
  }
6816
6816
  return t2;
6817
6817
  }
6818
- function _temp$n(t0) {
6818
+ function _temp$m(t0) {
6819
6819
  const [key, childValue] = t0;
6820
6820
  return /* @__PURE__ */ jsxs("div", { className: cls(defaultBorderMixin, "last:border-b-0 border-b"), children: [
6821
6821
  /* @__PURE__ */ jsxs("div", { className: "flex flex-row pt-0.5 pb-0.5 gap-2", children: [
@@ -7561,7 +7561,7 @@ function VirtualTableSelect(props) {
7561
7561
  console.trace("onChange");
7562
7562
  if (valueType === "number") {
7563
7563
  if (multiple) {
7564
- const newValue = updatedValue.map(_temp$m);
7564
+ const newValue = updatedValue.map(_temp$l);
7565
7565
  updateValue(newValue);
7566
7566
  } else {
7567
7567
  updateValue(parseFloat(updatedValue));
@@ -7616,7 +7616,7 @@ function VirtualTableSelect(props) {
7616
7616
  function _temp2$b(v_0) {
7617
7617
  return v_0.toString();
7618
7618
  }
7619
- function _temp$m(v) {
7619
+ function _temp$l(v) {
7620
7620
  return parseFloat(v);
7621
7621
  }
7622
7622
  function VirtualTableNumberInput(props) {
@@ -8159,7 +8159,7 @@ function StorageUpload$1(t0) {
8159
8159
  const snackbarContext = useSnackbarController();
8160
8160
  let t1;
8161
8161
  if ($[0] !== storage.acceptedFiles) {
8162
- t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$l).reduce(_temp2$a, {}) : void 0;
8162
+ t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$k).reduce(_temp2$a, {}) : void 0;
8163
8163
  $[0] = storage.acceptedFiles;
8164
8164
  $[1] = t1;
8165
8165
  } else {
@@ -8388,7 +8388,7 @@ function _temp2$a(a, b) {
8388
8388
  ...b
8389
8389
  };
8390
8390
  }
8391
- function _temp$l(e) {
8391
+ function _temp$k(e) {
8392
8392
  return {
8393
8393
  [e]: []
8394
8394
  };
@@ -8495,7 +8495,7 @@ const TableReferenceFieldInternal = React__default.memo(function TableReferenceF
8495
8495
  let t1;
8496
8496
  if ($[2] !== updateValue) {
8497
8497
  t1 = (entities) => {
8498
- updateValue(entities.map(_temp$k));
8498
+ updateValue(entities.map(_temp$j));
8499
8499
  };
8500
8500
  $[2] = updateValue;
8501
8501
  $[3] = t1;
@@ -8656,7 +8656,7 @@ const TableReferenceFieldInternal = React__default.memo(function TableReferenceF
8656
8656
  }
8657
8657
  return t10;
8658
8658
  }, equal);
8659
- function _temp$k(e) {
8659
+ function _temp$j(e) {
8660
8660
  return getReferenceFrom(e);
8661
8661
  }
8662
8662
  function _temp2$9(ref) {
@@ -9792,7 +9792,7 @@ function CollectionTableToolbar(t0) {
9792
9792
  }
9793
9793
  let t6;
9794
9794
  if ($[6] !== t3 || $[7] !== t4) {
9795
- t6 = /* @__PURE__ */ jsx(Tooltip, { title: "Table row size", side: "right", sideOffset: 4, children: /* @__PURE__ */ jsx(Select, { value: t3, className: "w-16 h-10", size: "small", onValueChange: t4, renderValue: _temp$j, children: t5 }) });
9795
+ t6 = /* @__PURE__ */ jsx(Tooltip, { title: "Table row size", side: "right", sideOffset: 4, children: /* @__PURE__ */ jsx(Select, { value: t3, className: "w-16 h-10", size: "small", onValueChange: t4, renderValue: _temp$i, children: t5 }) });
9796
9796
  $[6] = t3;
9797
9797
  $[7] = t4;
9798
9798
  $[8] = t6;
@@ -9879,7 +9879,7 @@ function CollectionTableToolbar(t0) {
9879
9879
  function _temp2$8(size_0) {
9880
9880
  return /* @__PURE__ */ jsx(SelectItem, { value: size_0, className: "w-12 font-medium text-center", children: size_0.toUpperCase() }, size_0);
9881
9881
  }
9882
- function _temp$j(v_0) {
9882
+ function _temp$i(v_0) {
9883
9883
  return /* @__PURE__ */ jsx("div", { className: "font-medium", children: v_0.toUpperCase() });
9884
9884
  }
9885
9885
  function getTableCellAlignment(property) {
@@ -10988,7 +10988,7 @@ const SafeLinkRenderer = (t0) => {
10988
10988
  let t1;
10989
10989
  if ($[0] !== text) {
10990
10990
  const urlRegex = /https?:\/\/[^\s]+/g;
10991
- t1 = text.replace(urlRegex, _temp$i);
10991
+ t1 = text.replace(urlRegex, _temp$h);
10992
10992
  $[0] = text;
10993
10993
  $[1] = t1;
10994
10994
  } else {
@@ -11007,7 +11007,7 @@ const SafeLinkRenderer = (t0) => {
11007
11007
  }
11008
11008
  return t2;
11009
11009
  };
11010
- function _temp$i(url) {
11010
+ function _temp$h(url) {
11011
11011
  return `<a href="${url}" class="underline" target="_blank">Link</a><br/>`;
11012
11012
  }
11013
11013
  const operationLabels$2 = {
@@ -11215,7 +11215,7 @@ function StringNumberFilterField(t0) {
11215
11215
  }
11216
11216
  let t6;
11217
11217
  if ($[16] !== operation || $[17] !== t4 || $[18] !== t5) {
11218
- t6 = /* @__PURE__ */ jsx("div", { className: "w-[80px]", children: /* @__PURE__ */ jsx(Select, { value: operation, fullWidth: true, position: "item-aligned", onValueChange: t4, renderValue: _temp$h, children: t5 }) });
11218
+ t6 = /* @__PURE__ */ jsx("div", { className: "w-[80px]", children: /* @__PURE__ */ jsx(Select, { value: operation, fullWidth: true, position: "item-aligned", onValueChange: t4, renderValue: _temp$g, children: t5 }) });
11219
11219
  $[16] = operation;
11220
11220
  $[17] = t4;
11221
11221
  $[18] = t5;
@@ -11339,7 +11339,7 @@ function _temp3$3(e_1) {
11339
11339
  function _temp2$7(op_1) {
11340
11340
  return /* @__PURE__ */ jsx(SelectItem, { value: op_1, children: operationLabels$1[op_1] }, op_1);
11341
11341
  }
11342
- function _temp$h(op_0) {
11342
+ function _temp$g(op_0) {
11343
11343
  return operationLabels$1[op_0];
11344
11344
  }
11345
11345
  function BooleanFilterField(t0) {
@@ -11478,7 +11478,7 @@ function DateTimeFilterField(t0) {
11478
11478
  }
11479
11479
  let t6;
11480
11480
  if ($[13] !== operation || $[14] !== t4 || $[15] !== t5) {
11481
- t6 = /* @__PURE__ */ jsx("div", { className: "w-[80px]", children: /* @__PURE__ */ jsx(Select, { value: operation, size: "large", fullWidth: true, onValueChange: t4, renderValue: _temp$g, children: t5 }) });
11481
+ t6 = /* @__PURE__ */ jsx("div", { className: "w-[80px]", children: /* @__PURE__ */ jsx(Select, { value: operation, size: "large", fullWidth: true, onValueChange: t4, renderValue: _temp$f, children: t5 }) });
11482
11482
  $[13] = operation;
11483
11483
  $[14] = t4;
11484
11484
  $[15] = t5;
@@ -11567,7 +11567,7 @@ function DateTimeFilterField(t0) {
11567
11567
  function _temp2$6(op_1) {
11568
11568
  return /* @__PURE__ */ jsx(SelectItem, { value: op_1, children: operationLabels[op_1] }, op_1);
11569
11569
  }
11570
- function _temp$g(op_0) {
11570
+ function _temp$f(op_0) {
11571
11571
  return operationLabels[op_0];
11572
11572
  }
11573
11573
  const SelectableTable = React__default.memo(
@@ -12274,7 +12274,7 @@ function useTableSearchHelper(t0) {
12274
12274
  const searchBlocked = t12;
12275
12275
  let t2;
12276
12276
  if ($[15] !== customizationController.plugins || $[16] !== dataSource?.initTextSearch) {
12277
- t2 = Boolean(dataSource?.initTextSearch) || customizationController.plugins?.find(_temp$f);
12277
+ t2 = Boolean(dataSource?.initTextSearch) || customizationController.plugins?.find(_temp$e);
12278
12278
  $[15] = customizationController.plugins;
12279
12279
  $[16] = dataSource?.initTextSearch;
12280
12280
  $[17] = t2;
@@ -12366,7 +12366,7 @@ function useTableSearchHelper(t0) {
12366
12366
  }
12367
12367
  return t1;
12368
12368
  }
12369
- function _temp$f(p_0) {
12369
+ function _temp$e(p_0) {
12370
12370
  return Boolean(p_0.collectionView?.onTextSearchClick);
12371
12371
  }
12372
12372
  function DeleteEntityDialog({
@@ -12916,7 +12916,7 @@ function NavigationCard(t0) {
12916
12916
  }
12917
12917
  let t3;
12918
12918
  if ($[3] !== actions) {
12919
- t3 = /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", onClick: _temp$e, children: actions });
12919
+ t3 = /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", onClick: _temp$d, children: actions });
12920
12920
  $[3] = actions;
12921
12921
  $[4] = t3;
12922
12922
  } else {
@@ -13002,7 +13002,7 @@ function NavigationCard(t0) {
13002
13002
  }
13003
13003
  return t11;
13004
13004
  }
13005
- function _temp$e(event) {
13005
+ function _temp$d(event) {
13006
13006
  event.preventDefault();
13007
13007
  event.stopPropagation();
13008
13008
  }
@@ -13294,7 +13294,7 @@ function FavouritesView(t0) {
13294
13294
  T0 = Collapse;
13295
13295
  t4 = favouriteCollections.length > 0;
13296
13296
  t2 = "flex flex-row flex-wrap gap-2 pb-2 min-h-[32px]";
13297
- t3 = favouriteCollections.map(_temp$d);
13297
+ t3 = favouriteCollections.map(_temp$c);
13298
13298
  $[2] = navigationController.topLevelNavigation?.navigationEntries;
13299
13299
  $[3] = t1;
13300
13300
  $[4] = T0;
@@ -13328,7 +13328,7 @@ function FavouritesView(t0) {
13328
13328
  }
13329
13329
  return t6;
13330
13330
  }
13331
- function _temp$d(entry_0) {
13331
+ function _temp$c(entry_0) {
13332
13332
  return /* @__PURE__ */ jsx(NavigationChip, { entry: entry_0 }, entry_0.path);
13333
13333
  }
13334
13334
  const scrollsMap = {};
@@ -13425,7 +13425,7 @@ function DefaultHomePage(t0) {
13425
13425
  } else {
13426
13426
  const searchResult = fuse.current?.search(value);
13427
13427
  if (searchResult) {
13428
- setFilteredUrls(searchResult.map(_temp$c));
13428
+ setFilteredUrls(searchResult.map(_temp$b));
13429
13429
  }
13430
13430
  }
13431
13431
  };
@@ -13703,7 +13703,7 @@ function _temp3$2(e_1) {
13703
13703
  function _temp2$5(entry) {
13704
13704
  return entry.group;
13705
13705
  }
13706
- function _temp$c(e_0) {
13706
+ function _temp$b(e_0) {
13707
13707
  return e_0.item.url;
13708
13708
  }
13709
13709
  function EntityCollectionViewActions(t0) {
@@ -15481,7 +15481,7 @@ const DefaultAppBar = function DefaultAppBar2(t0) {
15481
15481
  }
15482
15482
  let t7;
15483
15483
  if ($[18] !== breadcrumbs.breadcrumbs) {
15484
- t7 = breadcrumbs.breadcrumbs && /* @__PURE__ */ jsx("div", { className: "mr-8 hidden lg:block", children: /* @__PURE__ */ jsx("div", { className: "flex flex-row gap-2", children: breadcrumbs.breadcrumbs.map(_temp$b) }) });
15484
+ t7 = breadcrumbs.breadcrumbs && /* @__PURE__ */ jsx("div", { className: "mr-8 hidden lg:block", children: /* @__PURE__ */ jsx("div", { className: "flex flex-row gap-2", children: breadcrumbs.breadcrumbs.map(_temp$a) }) });
15485
15485
  $[18] = breadcrumbs.breadcrumbs;
15486
15486
  $[19] = t7;
15487
15487
  } else {
@@ -15593,7 +15593,7 @@ const DefaultAppBar = function DefaultAppBar2(t0) {
15593
15593
  }
15594
15594
  return t14;
15595
15595
  };
15596
- function _temp$b(breadcrumb, index) {
15596
+ function _temp$a(breadcrumb, index) {
15597
15597
  return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
15598
15598
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "/" }),
15599
15599
  /* @__PURE__ */ jsx(Link, { className: "visited:text-inherit visited:dark:text-inherit block", to: breadcrumb.url, children: /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: breadcrumb.title }) }, index)
@@ -15963,7 +15963,7 @@ function SearchIconsView(t0) {
15963
15963
  } else {
15964
15964
  const searchResult = iconsSearch.search(value);
15965
15965
  const limited = searchResult.slice(0, 50);
15966
- setKeys(limited.map(_temp$a));
15966
+ setKeys(limited.map(_temp$9));
15967
15967
  }
15968
15968
  }, UPDATE_SEARCH_INDEX_WAIT_MS);
15969
15969
  $[0] = t3;
@@ -16030,7 +16030,7 @@ function SearchIconsView(t0) {
16030
16030
  }
16031
16031
  return t8;
16032
16032
  }
16033
- function _temp$a(e) {
16033
+ function _temp$9(e) {
16034
16034
  return e.item.key;
16035
16035
  }
16036
16036
  function FieldCaption(t0) {
@@ -16391,6 +16391,21 @@ function EntityForm({
16391
16391
  });
16392
16392
  }
16393
16393
  });
16394
+ useEffect(() => {
16395
+ const handleKeyDown = (e_0) => {
16396
+ const isUndo = (e_0.metaKey || e_0.ctrlKey) && !e_0.shiftKey && e_0.key.toLowerCase() === "z";
16397
+ const isRedo = (e_0.metaKey || e_0.ctrlKey) && e_0.shiftKey && e_0.key.toLowerCase() === "z" || (e_0.metaKey || e_0.ctrlKey) && !e_0.shiftKey && e_0.key.toLowerCase() === "y";
16398
+ if (isUndo && formex.canUndo) {
16399
+ e_0.preventDefault();
16400
+ formex.undo();
16401
+ } else if (isRedo && formex.canRedo) {
16402
+ e_0.preventDefault();
16403
+ formex.redo();
16404
+ }
16405
+ };
16406
+ window.addEventListener("keydown", handleKeyDown);
16407
+ return () => window.removeEventListener("keydown", handleKeyDown);
16408
+ }, [formex]);
16394
16409
  const resolvedCollection = useMemo(() => resolveCollection({
16395
16410
  collection,
16396
16411
  path,
@@ -16399,21 +16414,21 @@ function EntityForm({
16399
16414
  previousValues: formex.initialValues,
16400
16415
  propertyConfigs: customizationController.propertyConfigs
16401
16416
  }), [collection, path, entityId, formex.values, formex.initialValues, customizationController.propertyConfigs]);
16402
- const onPreSaveHookError = useCallback((e_0) => {
16417
+ const onPreSaveHookError = useCallback((e_1) => {
16403
16418
  setSaving(false);
16404
16419
  snackbarController.open({
16405
16420
  type: "error",
16406
- message: "Error before saving: " + e_0?.message
16421
+ message: "Error before saving: " + e_1?.message
16407
16422
  });
16408
- console.error(e_0);
16423
+ console.error(e_1);
16409
16424
  }, [snackbarController]);
16410
- const onSaveSuccessHookError = useCallback((e_1) => {
16425
+ const onSaveSuccessHookError = useCallback((e_2) => {
16411
16426
  setSaving(false);
16412
16427
  snackbarController.open({
16413
16428
  type: "error",
16414
- message: "Error after saving (entity is saved): " + e_1?.message
16429
+ message: "Error after saving (entity is saved): " + e_2?.message
16415
16430
  });
16416
- console.error(e_1);
16431
+ console.error(e_2);
16417
16432
  }, [snackbarController]);
16418
16433
  function clearDirtyCache() {
16419
16434
  if (status === "new" || status === "copy") {
@@ -16443,14 +16458,14 @@ function EntityForm({
16443
16458
  });
16444
16459
  }
16445
16460
  };
16446
- const onSaveFailure = useCallback((e_2) => {
16461
+ const onSaveFailure = useCallback((e_3) => {
16447
16462
  setSaving(false);
16448
16463
  snackbarController.open({
16449
16464
  type: "error",
16450
- message: "Error saving: " + e_2?.message
16465
+ message: "Error saving: " + e_3?.message
16451
16466
  });
16452
16467
  console.error("Error saving entity", path, entityId);
16453
- console.error(e_2);
16468
+ console.error(e_3);
16454
16469
  }, [entityId, path, snackbarController]);
16455
16470
  const saveEntity = ({
16456
16471
  values: values_1,
@@ -16511,9 +16526,9 @@ function EntityForm({
16511
16526
  analyticsController.onAnalyticsEvent?.(eventName, {
16512
16527
  path
16513
16528
  });
16514
- }).catch((e_3) => {
16515
- console.error(e_3);
16516
- setSavingError(e_3);
16529
+ }).catch((e_4) => {
16530
+ console.error(e_4);
16531
+ setSavingError(e_4);
16517
16532
  });
16518
16533
  };
16519
16534
  const formContext = {
@@ -16569,9 +16584,9 @@ function EntityForm({
16569
16584
  context
16570
16585
  });
16571
16586
  setEntityId(updatedId);
16572
- } catch (e_4) {
16573
- onIdUpdateError?.(e_4);
16574
- console.error(e_4);
16587
+ } catch (e_5) {
16588
+ onIdUpdateError?.(e_5);
16589
+ console.error(e_5);
16575
16590
  }
16576
16591
  setCustomIdLoading(false);
16577
16592
  }
@@ -16657,7 +16672,7 @@ function EntityForm({
16657
16672
  };
16658
16673
  const formRef = useRef(null);
16659
16674
  const formView = /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxs(Fragment, { children: [
16660
- /* @__PURE__ */ jsxs("div", { className: "w-full py-2 flex flex-col items-start my-4 lg:my-6", children: [
16675
+ !Builder && /* @__PURE__ */ jsxs("div", { className: "w-full py-2 flex flex-col items-start my-4 lg:my-6", children: [
16661
16676
  /* @__PURE__ */ jsx(Typography, { className: "py-4 flex-grow line-clamp-1 " + (collection.hideIdFromForm ? "mb-2" : "mb-0"), variant: "h4", children: title ?? collection.singularName ?? collection.name }),
16662
16677
  showEntityPath && /* @__PURE__ */ jsx(Alert, { color: "base", className: "w-full", size: "small", children: /* @__PURE__ */ jsxs("code", { className: "text-xs select-all text-text-secondary dark:text-text-secondary-dark", children: [
16663
16678
  entity?.path ?? path,
@@ -16666,7 +16681,7 @@ function EntityForm({
16666
16681
  ] }) })
16667
16682
  ] }),
16668
16683
  children,
16669
- !collection.hideIdFromForm && /* @__PURE__ */ jsx(CustomIdField, { customId: collection.customId, entityId, status, onChange: setEntityId, error: entityIdError, loading: customIdLoading, entity }),
16684
+ !Builder && !collection.hideIdFromForm && /* @__PURE__ */ jsx(CustomIdField, { customId: collection.customId, entityId, status, onChange: setEntityId, error: entityIdError, loading: customIdLoading, entity }),
16670
16685
  entityId && formContext && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: "mt-12 flex flex-col gap-8", ref: formRef, children: [
16671
16686
  formFields(),
16672
16687
  /* @__PURE__ */ jsx(ErrorFocus, { containerRef: formRef })
@@ -16676,7 +16691,20 @@ function EntityForm({
16676
16691
  useEffect(() => {
16677
16692
  if (entityId && onIdChange) onIdChange(entityId);
16678
16693
  }, [entityId, onIdChange]);
16679
- return /* @__PURE__ */ jsx(FormLayoutInner, { className, id: `form_${path}`, pluginActions, forceActionsAtTheBottom, EntityFormActionsComponent, formContext, showDefaultActions, children: formView });
16694
+ const disabled_0 = formex.isSubmitting || !formex.dirty && status === "existing";
16695
+ if (!resolvedCollection || !path) {
16696
+ throw Error("INTERNAL: Collection and path must be defined in form context");
16697
+ }
16698
+ const dialogActions = /* @__PURE__ */ jsx(EntityFormActionsComponent, { collection: resolvedCollection, path, entity, layout: forceActionsAtTheBottom ? "bottom" : "side", savingError, formex, disabled: disabled_0, status, pluginActions, openEntityMode, showDefaultActions });
16699
+ return /* @__PURE__ */ jsx(Formex, { value: formContext.formex, children: /* @__PURE__ */ jsxs("form", { onSubmit: formContext.formex.handleSubmit, onReset: () => formex.resetForm({
16700
+ values: getInitialEntityValues(collection, path, status, entity, customizationController.propertyConfigs)
16701
+ }), noValidate: true, className: cls("flex-1 flex flex-row w-full overflow-y-auto justify-center", className), children: [
16702
+ /* @__PURE__ */ jsx("div", { id: `form_${path}`, className: cls("relative flex flex-row max-w-4xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-6xl w-full h-fit"), children: /* @__PURE__ */ jsxs("div", { className: cls("flex flex-col w-full pt-12 pb-16 px-4 sm:px-8 md:px-10"), children: [
16703
+ formContext.formex.dirty ? /* @__PURE__ */ jsx(Tooltip, { title: "Unsaved changes", className: "self-end sticky top-4 z-10", children: /* @__PURE__ */ jsx(Chip, { size: "small", colorScheme: "orangeDarker", children: /* @__PURE__ */ jsx(EditIcon, { size: "smallest" }) }) }) : /* @__PURE__ */ jsx(Tooltip, { title: "In sync with the database", className: "self-end sticky top-4 z-10", children: /* @__PURE__ */ jsx(Chip, { size: "small", children: /* @__PURE__ */ jsx(CheckIcon, { size: "smallest" }) }) }),
16704
+ formView
16705
+ ] }) }),
16706
+ dialogActions
16707
+ ] }) });
16680
16708
  }
16681
16709
  function getInitialEntityValues(collection, path, status, entity, propertyConfigs) {
16682
16710
  const resolvedCollection = resolveCollection({
@@ -16717,150 +16745,6 @@ function yupToFormErrors(yupError) {
16717
16745
  }
16718
16746
  return errors;
16719
16747
  }
16720
- function FormLayoutInner(t0) {
16721
- const $ = c(43);
16722
- const {
16723
- id,
16724
- formContext,
16725
- children,
16726
- className,
16727
- forceActionsAtTheBottom,
16728
- pluginActions,
16729
- EntityFormActionsComponent,
16730
- showDefaultActions
16731
- } = t0;
16732
- const formex = formContext.formex;
16733
- const collection = formContext.collection;
16734
- const path = formContext.path;
16735
- const entity = formContext.entity;
16736
- const savingError = formContext.savingError;
16737
- const status = formContext.status;
16738
- const openEntityMode = formContext.openEntityMode;
16739
- const disabled = formex.isSubmitting || !formex.dirty && status === "existing";
16740
- const customizationController = useCustomizationController();
16741
- if (!collection || !path) {
16742
- throw Error("INTERNAL: Collection and path must be defined in form context");
16743
- }
16744
- const t1 = forceActionsAtTheBottom ? "bottom" : "side";
16745
- let t2;
16746
- if ($[0] !== pluginActions) {
16747
- t2 = pluginActions ?? [];
16748
- $[0] = pluginActions;
16749
- $[1] = t2;
16750
- } else {
16751
- t2 = $[1];
16752
- }
16753
- let t3;
16754
- if ($[2] !== EntityFormActionsComponent || $[3] !== collection || $[4] !== disabled || $[5] !== entity || $[6] !== formex || $[7] !== openEntityMode || $[8] !== path || $[9] !== savingError || $[10] !== showDefaultActions || $[11] !== status || $[12] !== t1 || $[13] !== t2) {
16755
- t3 = /* @__PURE__ */ jsx(EntityFormActionsComponent, { collection, path, entity, layout: t1, savingError, formex, disabled, status, pluginActions: t2, openEntityMode, showDefaultActions });
16756
- $[2] = EntityFormActionsComponent;
16757
- $[3] = collection;
16758
- $[4] = disabled;
16759
- $[5] = entity;
16760
- $[6] = formex;
16761
- $[7] = openEntityMode;
16762
- $[8] = path;
16763
- $[9] = savingError;
16764
- $[10] = showDefaultActions;
16765
- $[11] = status;
16766
- $[12] = t1;
16767
- $[13] = t2;
16768
- $[14] = t3;
16769
- } else {
16770
- t3 = $[14];
16771
- }
16772
- const dialogActions = t3;
16773
- const t4 = formContext.formex;
16774
- const t5 = formContext.formex.handleSubmit;
16775
- let t6;
16776
- if ($[15] !== collection || $[16] !== customizationController.propertyConfigs || $[17] !== entity || $[18] !== formex || $[19] !== path || $[20] !== status) {
16777
- t6 = () => formex.resetForm({
16778
- values: getInitialEntityValues(collection, path, status, entity, customizationController.propertyConfigs)
16779
- });
16780
- $[15] = collection;
16781
- $[16] = customizationController.propertyConfigs;
16782
- $[17] = entity;
16783
- $[18] = formex;
16784
- $[19] = path;
16785
- $[20] = status;
16786
- $[21] = t6;
16787
- } else {
16788
- t6 = $[21];
16789
- }
16790
- let t7;
16791
- if ($[22] !== className) {
16792
- t7 = cls("flex-1 flex flex-row w-full overflow-y-auto justify-center", className);
16793
- $[22] = className;
16794
- $[23] = t7;
16795
- } else {
16796
- t7 = $[23];
16797
- }
16798
- let t8;
16799
- let t9;
16800
- if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
16801
- t8 = cls("relative flex flex-row max-w-4xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-6xl w-full h-fit");
16802
- t9 = cls("flex flex-col w-full pt-12 pb-16 px-4 sm:px-8 md:px-10");
16803
- $[24] = t8;
16804
- $[25] = t9;
16805
- } else {
16806
- t8 = $[24];
16807
- t9 = $[25];
16808
- }
16809
- let t10;
16810
- if ($[26] !== formContext.formex.dirty) {
16811
- t10 = formContext.formex.dirty ? /* @__PURE__ */ jsx(Tooltip, { title: "Unsaved changes", className: "self-end sticky top-4 z-10", children: /* @__PURE__ */ jsx(Chip, { size: "small", colorScheme: "orangeDarker", children: /* @__PURE__ */ jsx(EditIcon, { size: "smallest" }) }) }) : /* @__PURE__ */ jsx(Tooltip, { title: "In sync with the database", className: "self-end sticky top-4 z-10", children: /* @__PURE__ */ jsx(Chip, { size: "small", children: /* @__PURE__ */ jsx(CheckIcon, { size: "smallest" }) }) });
16812
- $[26] = formContext.formex.dirty;
16813
- $[27] = t10;
16814
- } else {
16815
- t10 = $[27];
16816
- }
16817
- let t11;
16818
- if ($[28] !== children || $[29] !== t10) {
16819
- t11 = /* @__PURE__ */ jsxs("div", { className: t9, children: [
16820
- t10,
16821
- children
16822
- ] });
16823
- $[28] = children;
16824
- $[29] = t10;
16825
- $[30] = t11;
16826
- } else {
16827
- t11 = $[30];
16828
- }
16829
- let t12;
16830
- if ($[31] !== id || $[32] !== t11) {
16831
- t12 = /* @__PURE__ */ jsx("div", { id, className: t8, children: t11 });
16832
- $[31] = id;
16833
- $[32] = t11;
16834
- $[33] = t12;
16835
- } else {
16836
- t12 = $[33];
16837
- }
16838
- let t13;
16839
- if ($[34] !== dialogActions || $[35] !== formContext.formex.handleSubmit || $[36] !== t12 || $[37] !== t6 || $[38] !== t7) {
16840
- t13 = /* @__PURE__ */ jsxs("form", { onSubmit: t5, onReset: t6, noValidate: true, className: t7, children: [
16841
- t12,
16842
- dialogActions
16843
- ] });
16844
- $[34] = dialogActions;
16845
- $[35] = formContext.formex.handleSubmit;
16846
- $[36] = t12;
16847
- $[37] = t6;
16848
- $[38] = t7;
16849
- $[39] = t13;
16850
- } else {
16851
- t13 = $[39];
16852
- }
16853
- let t14;
16854
- if ($[40] !== formContext.formex || $[41] !== t13) {
16855
- t14 = /* @__PURE__ */ jsx(Formex, { value: t4, children: t13 });
16856
- $[40] = formContext.formex;
16857
- $[41] = t13;
16858
- $[42] = t14;
16859
- } else {
16860
- t14 = $[42];
16861
- }
16862
- return t14;
16863
- }
16864
16748
  function useOnAutoSave(autoSave, formex, lastSavedValues, save) {
16865
16749
  if (!autoSave) return;
16866
16750
  useEffect(() => {
@@ -17436,7 +17320,7 @@ function StorageItemPreview(t0) {
17436
17320
  }
17437
17321
  let t5;
17438
17322
  if ($[14] !== placeholder) {
17439
- t5 = placeholder && /* @__PURE__ */ jsx("div", { onClick: _temp$9, className: "flex flex-col items-center justify-center w-full h-full", children: /* @__PURE__ */ jsx(DescriptionIcon, { className: "text-surface-700 dark:text-surface-300" }) });
17323
+ t5 = placeholder && /* @__PURE__ */ jsx("div", { onClick: _temp$8, className: "flex flex-col items-center justify-center w-full h-full", children: /* @__PURE__ */ jsx(DescriptionIcon, { className: "text-surface-700 dark:text-surface-300" }) });
17440
17324
  $[14] = placeholder;
17441
17325
  $[15] = t5;
17442
17326
  } else {
@@ -17459,7 +17343,7 @@ function StorageItemPreview(t0) {
17459
17343
  }
17460
17344
  return t6;
17461
17345
  }
17462
- function _temp$9(e) {
17346
+ function _temp$8(e) {
17463
17347
  return e.stopPropagation();
17464
17348
  }
17465
17349
  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";
@@ -17642,7 +17526,7 @@ function FileDropComponent(t0) {
17642
17526
  const snackbarContext = useSnackbarController();
17643
17527
  let t1;
17644
17528
  if ($[0] !== storage.acceptedFiles) {
17645
- t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$8).reduce(_temp2$4, {}) : void 0;
17529
+ t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$7).reduce(_temp2$4, {}) : void 0;
17646
17530
  $[0] = storage.acceptedFiles;
17647
17531
  $[1] = t1;
17648
17532
  } else {
@@ -17858,7 +17742,7 @@ function _temp2$4(a, b) {
17858
17742
  ...b
17859
17743
  };
17860
17744
  }
17861
- function _temp$8(e) {
17745
+ function _temp$7(e) {
17862
17746
  return {
17863
17747
  [e]: []
17864
17748
  };
@@ -18823,7 +18707,7 @@ function MapFieldBinding(t0) {
18823
18707
  } else {
18824
18708
  t42 = $[20];
18825
18709
  }
18826
- t3 = Object.entries(mapProperties).filter(_temp$7).map(t42);
18710
+ t3 = Object.entries(mapProperties).filter(_temp$6).map(t42);
18827
18711
  $[6] = autoFocus;
18828
18712
  $[7] = context;
18829
18713
  $[8] = disabled;
@@ -18893,7 +18777,7 @@ function MapFieldBinding(t0) {
18893
18777
  }
18894
18778
  return t10;
18895
18779
  }
18896
- function _temp$7(t0) {
18780
+ function _temp$6(t0) {
18897
18781
  const [, property_0] = t0;
18898
18782
  return !isHidden(property_0);
18899
18783
  }
@@ -20016,7 +19900,7 @@ function BlockEntry(t0) {
20016
19900
  const property = t4;
20017
19901
  let t5;
20018
19902
  if ($[9] !== properties) {
20019
- t5 = Object.entries(properties).map(_temp$6);
19903
+ t5 = Object.entries(properties).map(_temp$5);
20020
19904
  $[9] = properties;
20021
19905
  $[10] = t5;
20022
19906
  } else {
@@ -20107,7 +19991,7 @@ function BlockEntry(t0) {
20107
19991
  }
20108
19992
  return t11;
20109
19993
  }
20110
- function _temp$6(t0) {
19994
+ function _temp$5(t0) {
20111
19995
  const [key, property_0] = t0;
20112
19996
  return {
20113
19997
  id: key,
@@ -21177,6 +21061,16 @@ function resolveEntityView(entityView, contextEntityViews) {
21177
21061
  return entityView;
21178
21062
  }
21179
21063
  }
21064
+ function resolvedSelectedEntityView(customViews, customizationController, selectedTab) {
21065
+ const resolvedEntityViews = customViews ? customViews.map((e) => resolveEntityView(e, customizationController.entityViews)).filter(Boolean) : [];
21066
+ const selectedEntityView = resolvedEntityViews.find((e) => e.key === selectedTab);
21067
+ const selectedSecondaryForm = customViews && resolvedEntityViews.filter((e) => e.includeActions).find((e) => e.key === selectedTab);
21068
+ return {
21069
+ resolvedEntityViews,
21070
+ selectedEntityView,
21071
+ selectedSecondaryForm
21072
+ };
21073
+ }
21180
21074
  function getNavigationEntriesFromPath(props) {
21181
21075
  const {
21182
21076
  path,
@@ -21796,12 +21690,14 @@ function EntityEditViewInner({
21796
21690
  const customViews = collection.entityViews;
21797
21691
  const customViewsCount = customViews?.length ?? 0;
21798
21692
  const hasAdditionalViews = customViewsCount > 0 || subcollectionsCount > 0;
21799
- const resolvedEntityViews = customViews ? customViews.map((e) => resolveEntityView(e, customizationController.entityViews)).filter(Boolean) : [];
21800
- const selectedEntityView = resolvedEntityViews.find((e_0) => e_0.key === selectedTab);
21801
- const selectedSecondaryForm = formContext && customViews && resolvedEntityViews.filter((e_1) => e_1.includeActions).find((e_2) => e_2.key === selectedTab);
21693
+ const {
21694
+ resolvedEntityViews,
21695
+ selectedEntityView,
21696
+ selectedSecondaryForm
21697
+ } = resolvedSelectedEntityView(customViews, customizationController, selectedTab);
21802
21698
  const actionsAtTheBottom = !largeLayout || layout === "side_panel" || selectedEntityView?.includeActions === "bottom";
21803
21699
  const mainViewVisible = selectedTab === MAIN_TAB_VALUE || Boolean(selectedSecondaryForm);
21804
- const customViewsView = customViews && resolvedEntityViews.filter((e_3) => !e_3.includeActions).map((customView) => {
21700
+ const customViewsView = customViews && resolvedEntityViews.filter((e) => !e.includeActions).map((customView) => {
21805
21701
  if (!customView) return null;
21806
21702
  const Builder = customView.Builder;
21807
21703
  if (!Builder) {
@@ -21977,16 +21873,19 @@ function EntitySidePanel(props) {
21977
21873
  }
21978
21874
  const NEW_URL_HASH = "new_side";
21979
21875
  const SIDE_URL_HASH = "side";
21980
- function getEntityViewWidth(props, small) {
21876
+ function getEntityViewWidth(props, small, customizationController) {
21981
21877
  if (small) return CONTAINER_FULL_WIDTH;
21982
- const mainViewSelected = !props.selectedTab;
21878
+ const {
21879
+ selectedSecondaryForm
21880
+ } = resolvedSelectedEntityView(props.collection?.entityViews, customizationController, props.selectedTab);
21881
+ const shouldUseSmallLayout = !props.selectedTab || Boolean(selectedSecondaryForm);
21983
21882
  let resolvedWidth;
21984
21883
  if (props.width) {
21985
21884
  resolvedWidth = typeof props.width === "number" ? `${props.width}px` : props.width;
21986
21885
  } else if (props.collection?.sideDialogWidth) {
21987
21886
  resolvedWidth = typeof props.collection.sideDialogWidth === "number" ? `${props.collection.sideDialogWidth}px` : props.collection.sideDialogWidth;
21988
21887
  }
21989
- if (!mainViewSelected) {
21888
+ if (!shouldUseSmallLayout) {
21990
21889
  return `calc(${ADDITIONAL_TAB_WIDTH} + ${resolvedWidth ?? FORM_CONTAINER_WIDTH})`;
21991
21890
  } else {
21992
21891
  if (resolvedWidth) {
@@ -22038,194 +21937,81 @@ function getNestedPropertiesDepth(property, accumulator = 0) {
22038
21937
  }
22039
21938
  }
22040
21939
  const useBuildSideEntityController = (navigation, sideDialogsController) => {
22041
- const $ = c(44);
22042
21940
  const location = useLocation();
22043
21941
  const initialised = useRef(false);
21942
+ const customizationController = useCustomizationController();
22044
21943
  const smallLayout = !useLargeLayout();
22045
- let t0;
22046
- if ($[0] !== location.hash || $[1] !== location.pathname || $[2] !== navigation || $[3] !== sideDialogsController || $[4] !== smallLayout) {
22047
- t0 = () => {
22048
- const newFlag = location.hash === `#${NEW_URL_HASH}`;
22049
- const sideFlag = location.hash === `#${SIDE_URL_HASH}`;
22050
- if (!navigation.loading) {
22051
- if ((newFlag || sideFlag) && navigation.isUrlCollectionPath(location.pathname)) {
22052
- const entityOrCollectionPath = navigation.urlPathToDataPath(location.pathname);
22053
- const panelsFromUrl = buildSidePanelsFromUrl(entityOrCollectionPath, navigation.collections ?? [], newFlag);
22054
- for (let i = 0; i < panelsFromUrl.length; i++) {
22055
- const props = panelsFromUrl[i];
22056
- if (i === 0) {
22057
- sideDialogsController.replace(propsToSidePanel(props, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout));
22058
- } else {
22059
- sideDialogsController.open(propsToSidePanel(props, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout));
22060
- }
22061
- }
21944
+ useEffect(() => {
21945
+ const newFlag = location.hash === `#${NEW_URL_HASH}`;
21946
+ const sideFlag = location.hash === `#${SIDE_URL_HASH}`;
21947
+ if (!navigation.loading) {
21948
+ if ((newFlag || sideFlag) && navigation.isUrlCollectionPath(location.pathname)) {
21949
+ const entityOrCollectionPath = navigation.urlPathToDataPath(location.pathname);
21950
+ const panelsFromUrl = buildSidePanelsFromUrl(entityOrCollectionPath, navigation.collections ?? [], newFlag);
21951
+ for (let i = 0; i < panelsFromUrl.length; i++) {
21952
+ const props = panelsFromUrl[i];
21953
+ if (i === 0) sideDialogsController.replace(propsToSidePanel(props, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController));
21954
+ else sideDialogsController.open(propsToSidePanel(props, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController));
22062
21955
  }
22063
- initialised.current = true;
22064
21956
  }
22065
- };
22066
- $[0] = location.hash;
22067
- $[1] = location.pathname;
22068
- $[2] = navigation;
22069
- $[3] = sideDialogsController;
22070
- $[4] = smallLayout;
22071
- $[5] = t0;
22072
- } else {
22073
- t0 = $[5];
22074
- }
22075
- let t1;
22076
- if ($[6] !== navigation.loading) {
22077
- t1 = [navigation.loading];
22078
- $[6] = navigation.loading;
22079
- $[7] = t1;
22080
- } else {
22081
- t1 = $[7];
22082
- }
22083
- useEffect(t0, t1);
22084
- let t2;
22085
- if ($[8] !== sideDialogsController.sidePanels) {
22086
- t2 = sideDialogsController.sidePanels.map(_temp$5);
22087
- $[8] = sideDialogsController.sidePanels;
22088
- $[9] = t2;
22089
- } else {
22090
- t2 = $[9];
22091
- }
22092
- const currentPanelKeys = t2;
22093
- let t3;
22094
- if ($[10] !== currentPanelKeys || $[11] !== location.hash || $[12] !== location.pathname || $[13] !== navigation || $[14] !== sideDialogsController || $[15] !== smallLayout) {
22095
- t3 = () => {
22096
- if (initialised.current) {
22097
- const sideFlag_0 = location.hash === `#${SIDE_URL_HASH}`;
22098
- if (sideFlag_0) {
22099
- const entityOrCollectionPath_0 = navigation.urlPathToDataPath(location.pathname);
22100
- const panelsFromUrl_0 = buildSidePanelsFromUrl(entityOrCollectionPath_0, navigation.collections ?? [], false);
22101
- if (panelsFromUrl_0.length <= currentPanelKeys.length) {
22102
- return;
22103
- }
22104
- const lastPanel = panelsFromUrl_0[panelsFromUrl_0.length - 1];
22105
- const panelProps = propsToSidePanel(lastPanel, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout);
22106
- const lastCurrentPanel = currentPanelKeys.length > 0 ? currentPanelKeys[currentPanelKeys.length - 1] : void 0;
22107
- if (!lastCurrentPanel || lastCurrentPanel !== panelProps.key) {
22108
- sideDialogsController.replace(panelProps);
22109
- }
21957
+ initialised.current = true;
21958
+ }
21959
+ }, [navigation.loading]);
21960
+ const currentPanelKeys = sideDialogsController.sidePanels.map((p) => p.key);
21961
+ useEffect(() => {
21962
+ if (initialised.current) {
21963
+ const sideFlag_0 = location.hash === `#${SIDE_URL_HASH}`;
21964
+ if (sideFlag_0) {
21965
+ const entityOrCollectionPath_0 = navigation.urlPathToDataPath(location.pathname);
21966
+ const panelsFromUrl_0 = buildSidePanelsFromUrl(entityOrCollectionPath_0, navigation.collections ?? [], false);
21967
+ if (panelsFromUrl_0.length <= currentPanelKeys.length) {
21968
+ return;
22110
21969
  }
22111
- }
22112
- };
22113
- $[10] = currentPanelKeys;
22114
- $[11] = location.hash;
22115
- $[12] = location.pathname;
22116
- $[13] = navigation;
22117
- $[14] = sideDialogsController;
22118
- $[15] = smallLayout;
22119
- $[16] = t3;
22120
- } else {
22121
- t3 = $[16];
22122
- }
22123
- let t4;
22124
- if ($[17] !== currentPanelKeys || $[18] !== location.hash || $[19] !== location.pathname) {
22125
- t4 = [location.pathname, location.hash, currentPanelKeys];
22126
- $[17] = currentPanelKeys;
22127
- $[18] = location.hash;
22128
- $[19] = location.pathname;
22129
- $[20] = t4;
22130
- } else {
22131
- t4 = $[20];
22132
- }
22133
- useEffect(t3, t4);
22134
- let t5;
22135
- if ($[21] !== navigation.buildUrlCollectionPath || $[22] !== navigation.resolveIdsFrom || $[23] !== sideDialogsController || $[24] !== smallLayout) {
22136
- t5 = () => {
22137
- const updatedSidePanels = sideDialogsController.sidePanels.map((sidePanelProps) => {
22138
- if (sidePanelProps.additional) {
22139
- return propsToSidePanel(sidePanelProps.additional, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout);
21970
+ const lastPanel = panelsFromUrl_0[panelsFromUrl_0.length - 1];
21971
+ const panelProps = propsToSidePanel(lastPanel, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController);
21972
+ const lastCurrentPanel = currentPanelKeys.length > 0 ? currentPanelKeys[currentPanelKeys.length - 1] : void 0;
21973
+ if (!lastCurrentPanel || lastCurrentPanel !== panelProps.key) {
21974
+ sideDialogsController.replace(panelProps);
22140
21975
  }
22141
- return sidePanelProps;
22142
- });
22143
- sideDialogsController.setSidePanels(updatedSidePanels);
22144
- };
22145
- $[21] = navigation.buildUrlCollectionPath;
22146
- $[22] = navigation.resolveIdsFrom;
22147
- $[23] = sideDialogsController;
22148
- $[24] = smallLayout;
22149
- $[25] = t5;
22150
- } else {
22151
- t5 = $[25];
22152
- }
22153
- let t6;
22154
- if ($[26] !== smallLayout) {
22155
- t6 = [smallLayout];
22156
- $[26] = smallLayout;
22157
- $[27] = t6;
22158
- } else {
22159
- t6 = $[27];
22160
- }
22161
- useEffect(t5, t6);
22162
- let t7;
22163
- if ($[28] !== sideDialogsController) {
22164
- t7 = () => {
22165
- sideDialogsController.close();
22166
- };
22167
- $[28] = sideDialogsController;
22168
- $[29] = t7;
22169
- } else {
22170
- t7 = $[29];
22171
- }
22172
- const close = t7;
22173
- let t8;
22174
- if ($[30] !== navigation.buildUrlCollectionPath || $[31] !== navigation.resolveIdsFrom || $[32] !== sideDialogsController || $[33] !== smallLayout) {
22175
- t8 = (props_0) => {
22176
- if (props_0.copy && !props_0.entityId) {
22177
- throw Error("If you want to copy an entity you need to provide an entityId");
22178
21976
  }
22179
- const defaultSelectedView = resolveDefaultSelectedView(props_0.collection ? props_0.collection.defaultSelectedView : void 0, {
22180
- status: props_0.copy ? "copy" : props_0.entityId ? "existing" : "new",
22181
- entityId: props_0.entityId
22182
- });
22183
- sideDialogsController.open(propsToSidePanel({
22184
- selectedTab: defaultSelectedView,
22185
- ...props_0
22186
- }, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout));
22187
- };
22188
- $[30] = navigation.buildUrlCollectionPath;
22189
- $[31] = navigation.resolveIdsFrom;
22190
- $[32] = sideDialogsController;
22191
- $[33] = smallLayout;
22192
- $[34] = t8;
22193
- } else {
22194
- t8 = $[34];
22195
- }
22196
- const open = t8;
22197
- let t9;
22198
- if ($[35] !== navigation.buildUrlCollectionPath || $[36] !== navigation.resolveIdsFrom || $[37] !== sideDialogsController || $[38] !== smallLayout) {
22199
- t9 = (props_1) => {
22200
- if (props_1.copy && !props_1.entityId) {
22201
- throw Error("If you want to copy an entity you need to provide an entityId");
21977
+ }
21978
+ }, [location.pathname, location.hash, currentPanelKeys]);
21979
+ useEffect(() => {
21980
+ const updatedSidePanels = sideDialogsController.sidePanels.map((sidePanelProps) => {
21981
+ if (sidePanelProps.additional) {
21982
+ return propsToSidePanel(sidePanelProps.additional, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController);
22202
21983
  }
22203
- sideDialogsController.replace(propsToSidePanel(props_1, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout));
22204
- };
22205
- $[35] = navigation.buildUrlCollectionPath;
22206
- $[36] = navigation.resolveIdsFrom;
22207
- $[37] = sideDialogsController;
22208
- $[38] = smallLayout;
22209
- $[39] = t9;
22210
- } else {
22211
- t9 = $[39];
22212
- }
22213
- const replace = t9;
22214
- let t10;
22215
- if ($[40] !== close || $[41] !== open || $[42] !== replace) {
22216
- t10 = {
22217
- close,
22218
- open,
22219
- replace
22220
- };
22221
- $[40] = close;
22222
- $[41] = open;
22223
- $[42] = replace;
22224
- $[43] = t10;
22225
- } else {
22226
- t10 = $[43];
22227
- }
22228
- return t10;
21984
+ return sidePanelProps;
21985
+ });
21986
+ sideDialogsController.setSidePanels(updatedSidePanels);
21987
+ }, [smallLayout]);
21988
+ const close = useCallback(() => {
21989
+ sideDialogsController.close();
21990
+ }, [sideDialogsController]);
21991
+ const open = useCallback((props_0) => {
21992
+ if (props_0.copy && !props_0.entityId) {
21993
+ throw Error("If you want to copy an entity you need to provide an entityId");
21994
+ }
21995
+ const defaultSelectedView = resolveDefaultSelectedView(props_0.collection ? props_0.collection.defaultSelectedView : void 0, {
21996
+ status: props_0.copy ? "copy" : props_0.entityId ? "existing" : "new",
21997
+ entityId: props_0.entityId
21998
+ });
21999
+ sideDialogsController.open(propsToSidePanel({
22000
+ selectedTab: defaultSelectedView,
22001
+ ...props_0
22002
+ }, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController));
22003
+ }, [sideDialogsController, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout]);
22004
+ const replace = useCallback((props_1) => {
22005
+ if (props_1.copy && !props_1.entityId) {
22006
+ throw Error("If you want to copy an entity you need to provide an entityId");
22007
+ }
22008
+ sideDialogsController.replace(propsToSidePanel(props_1, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController));
22009
+ }, [navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, sideDialogsController, smallLayout]);
22010
+ return {
22011
+ close,
22012
+ open,
22013
+ replace
22014
+ };
22229
22015
  };
22230
22016
  function buildSidePanelsFromUrl(path, collections, newFlag) {
22231
22017
  const navigationViewsForPath = getNavigationEntriesFromPath({
@@ -22265,7 +22051,7 @@ function buildSidePanelsFromUrl(path, collections, newFlag) {
22265
22051
  }
22266
22052
  return sidePanel ? [sidePanel] : [];
22267
22053
  }
22268
- const propsToSidePanel = (props, buildUrlCollectionPath, resolveIdsFrom, smallLayout) => {
22054
+ const propsToSidePanel = (props, buildUrlCollectionPath, resolveIdsFrom, smallLayout, customizationController) => {
22269
22055
  const collectionPath = removeInitialAndTrailingSlashes(props.path);
22270
22056
  const newPath = props.entityId ? buildUrlCollectionPath(`${collectionPath}/${props.entityId}${props.selectedTab ? "/" + props.selectedTab : ""}#${SIDE_URL_HASH}`) : buildUrlCollectionPath(`${collectionPath}#${NEW_URL_HASH}`);
22271
22057
  const resolvedPath = resolveIdsFrom(props.path);
@@ -22274,7 +22060,7 @@ const propsToSidePanel = (props, buildUrlCollectionPath, resolveIdsFrom, smallLa
22274
22060
  path: resolvedPath,
22275
22061
  formProps: props.formProps
22276
22062
  };
22277
- const entityViewWidth = getEntityViewWidth(props, smallLayout);
22063
+ const entityViewWidth = getEntityViewWidth(props, smallLayout, customizationController);
22278
22064
  return {
22279
22065
  key: `${props.path}/${props.entityId}`,
22280
22066
  component: /* @__PURE__ */ jsx(EntitySidePanel, { ...resolvedPanelProps }),
@@ -22285,9 +22071,6 @@ const propsToSidePanel = (props, buildUrlCollectionPath, resolveIdsFrom, smallLa
22285
22071
  additional: props
22286
22072
  };
22287
22073
  };
22288
- function _temp$5(p) {
22289
- return p.key;
22290
- }
22291
22074
  function useBuildSideDialogsController() {
22292
22075
  const $ = c(24);
22293
22076
  const location = useLocation();
@@ -24173,7 +23956,6 @@ export {
24173
23956
  FireCMSRouter,
24174
23957
  FormEntry,
24175
23958
  FormLayout,
24176
- FormLayoutInner,
24177
23959
  GeoPoint,
24178
23960
  IconForView,
24179
23961
  ImagePreview,
@@ -24330,6 +24112,7 @@ export {
24330
24112
  resolvePropertyEnum,
24331
24113
  resolveStorageFilenameString,
24332
24114
  resolveStoragePathString,
24115
+ resolvedSelectedEntityView,
24333
24116
  sanitizeData,
24334
24117
  saveEntityWithCallbacks,
24335
24118
  segmentsToStrippedPath,