@firecms/core 3.0.0-canary.204 → 3.0.0-canary.205
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/form/EntityForm.d.ts +0 -10
- package/dist/index.es.js +155 -387
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +155 -387
- package/dist/index.umd.js.map +1 -1
- package/dist/internal/useBuildSideEntityController.d.ts +2 -2
- package/dist/util/resolutions.d.ts +6 -1
- package/package.json +5 -5
- package/src/core/EntityEditView.tsx +14 -50
- package/src/core/EntitySidePanel.tsx +2 -2
- package/src/form/EntityForm.tsx +56 -98
- package/src/internal/useBuildSideEntityController.tsx +28 -14
- package/src/util/resolutions.ts +26 -5
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
16033
|
+
function _temp$9(e) {
|
|
16034
16034
|
return e.item.key;
|
|
16035
16035
|
}
|
|
16036
16036
|
function FieldCaption(t0) {
|
|
@@ -16657,7 +16657,7 @@ function EntityForm({
|
|
|
16657
16657
|
};
|
|
16658
16658
|
const formRef = useRef(null);
|
|
16659
16659
|
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: [
|
|
16660
|
+
!Builder && /* @__PURE__ */ jsxs("div", { className: "w-full py-2 flex flex-col items-start my-4 lg:my-6", children: [
|
|
16661
16661
|
/* @__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
16662
|
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
16663
|
entity?.path ?? path,
|
|
@@ -16666,7 +16666,7 @@ function EntityForm({
|
|
|
16666
16666
|
] }) })
|
|
16667
16667
|
] }),
|
|
16668
16668
|
children,
|
|
16669
|
-
!collection.hideIdFromForm && /* @__PURE__ */ jsx(CustomIdField, { customId: collection.customId, entityId, status, onChange: setEntityId, error: entityIdError, loading: customIdLoading, entity }),
|
|
16669
|
+
!Builder && !collection.hideIdFromForm && /* @__PURE__ */ jsx(CustomIdField, { customId: collection.customId, entityId, status, onChange: setEntityId, error: entityIdError, loading: customIdLoading, entity }),
|
|
16670
16670
|
entityId && formContext && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: "mt-12 flex flex-col gap-8", ref: formRef, children: [
|
|
16671
16671
|
formFields(),
|
|
16672
16672
|
/* @__PURE__ */ jsx(ErrorFocus, { containerRef: formRef })
|
|
@@ -16676,7 +16676,20 @@ function EntityForm({
|
|
|
16676
16676
|
useEffect(() => {
|
|
16677
16677
|
if (entityId && onIdChange) onIdChange(entityId);
|
|
16678
16678
|
}, [entityId, onIdChange]);
|
|
16679
|
-
|
|
16679
|
+
const disabled_0 = formex.isSubmitting || !formex.dirty && status === "existing";
|
|
16680
|
+
if (!resolvedCollection || !path) {
|
|
16681
|
+
throw Error("INTERNAL: Collection and path must be defined in form context");
|
|
16682
|
+
}
|
|
16683
|
+
const dialogActions = /* @__PURE__ */ jsx(EntityFormActionsComponent, { collection: resolvedCollection, path, entity, layout: forceActionsAtTheBottom ? "bottom" : "side", savingError, formex, disabled: disabled_0, status, pluginActions, openEntityMode, showDefaultActions });
|
|
16684
|
+
return /* @__PURE__ */ jsx(Formex, { value: formContext.formex, children: /* @__PURE__ */ jsxs("form", { onSubmit: formContext.formex.handleSubmit, onReset: () => formex.resetForm({
|
|
16685
|
+
values: getInitialEntityValues(collection, path, status, entity, customizationController.propertyConfigs)
|
|
16686
|
+
}), noValidate: true, className: cls("flex-1 flex flex-row w-full overflow-y-auto justify-center", className), children: [
|
|
16687
|
+
/* @__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: [
|
|
16688
|
+
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" }) }) }),
|
|
16689
|
+
formView
|
|
16690
|
+
] }) }),
|
|
16691
|
+
dialogActions
|
|
16692
|
+
] }) });
|
|
16680
16693
|
}
|
|
16681
16694
|
function getInitialEntityValues(collection, path, status, entity, propertyConfigs) {
|
|
16682
16695
|
const resolvedCollection = resolveCollection({
|
|
@@ -16717,150 +16730,6 @@ function yupToFormErrors(yupError) {
|
|
|
16717
16730
|
}
|
|
16718
16731
|
return errors;
|
|
16719
16732
|
}
|
|
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
16733
|
function useOnAutoSave(autoSave, formex, lastSavedValues, save) {
|
|
16865
16734
|
if (!autoSave) return;
|
|
16866
16735
|
useEffect(() => {
|
|
@@ -17436,7 +17305,7 @@ function StorageItemPreview(t0) {
|
|
|
17436
17305
|
}
|
|
17437
17306
|
let t5;
|
|
17438
17307
|
if ($[14] !== placeholder) {
|
|
17439
|
-
t5 = placeholder && /* @__PURE__ */ jsx("div", { onClick: _temp$
|
|
17308
|
+
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
17309
|
$[14] = placeholder;
|
|
17441
17310
|
$[15] = t5;
|
|
17442
17311
|
} else {
|
|
@@ -17459,7 +17328,7 @@ function StorageItemPreview(t0) {
|
|
|
17459
17328
|
}
|
|
17460
17329
|
return t6;
|
|
17461
17330
|
}
|
|
17462
|
-
function _temp$
|
|
17331
|
+
function _temp$8(e) {
|
|
17463
17332
|
return e.stopPropagation();
|
|
17464
17333
|
}
|
|
17465
17334
|
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 +17511,7 @@ function FileDropComponent(t0) {
|
|
|
17642
17511
|
const snackbarContext = useSnackbarController();
|
|
17643
17512
|
let t1;
|
|
17644
17513
|
if ($[0] !== storage.acceptedFiles) {
|
|
17645
|
-
t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$
|
|
17514
|
+
t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$7).reduce(_temp2$4, {}) : void 0;
|
|
17646
17515
|
$[0] = storage.acceptedFiles;
|
|
17647
17516
|
$[1] = t1;
|
|
17648
17517
|
} else {
|
|
@@ -17858,7 +17727,7 @@ function _temp2$4(a, b) {
|
|
|
17858
17727
|
...b
|
|
17859
17728
|
};
|
|
17860
17729
|
}
|
|
17861
|
-
function _temp$
|
|
17730
|
+
function _temp$7(e) {
|
|
17862
17731
|
return {
|
|
17863
17732
|
[e]: []
|
|
17864
17733
|
};
|
|
@@ -18823,7 +18692,7 @@ function MapFieldBinding(t0) {
|
|
|
18823
18692
|
} else {
|
|
18824
18693
|
t42 = $[20];
|
|
18825
18694
|
}
|
|
18826
|
-
t3 = Object.entries(mapProperties).filter(_temp$
|
|
18695
|
+
t3 = Object.entries(mapProperties).filter(_temp$6).map(t42);
|
|
18827
18696
|
$[6] = autoFocus;
|
|
18828
18697
|
$[7] = context;
|
|
18829
18698
|
$[8] = disabled;
|
|
@@ -18893,7 +18762,7 @@ function MapFieldBinding(t0) {
|
|
|
18893
18762
|
}
|
|
18894
18763
|
return t10;
|
|
18895
18764
|
}
|
|
18896
|
-
function _temp$
|
|
18765
|
+
function _temp$6(t0) {
|
|
18897
18766
|
const [, property_0] = t0;
|
|
18898
18767
|
return !isHidden(property_0);
|
|
18899
18768
|
}
|
|
@@ -20016,7 +19885,7 @@ function BlockEntry(t0) {
|
|
|
20016
19885
|
const property = t4;
|
|
20017
19886
|
let t5;
|
|
20018
19887
|
if ($[9] !== properties) {
|
|
20019
|
-
t5 = Object.entries(properties).map(_temp$
|
|
19888
|
+
t5 = Object.entries(properties).map(_temp$5);
|
|
20020
19889
|
$[9] = properties;
|
|
20021
19890
|
$[10] = t5;
|
|
20022
19891
|
} else {
|
|
@@ -20107,7 +19976,7 @@ function BlockEntry(t0) {
|
|
|
20107
19976
|
}
|
|
20108
19977
|
return t11;
|
|
20109
19978
|
}
|
|
20110
|
-
function _temp$
|
|
19979
|
+
function _temp$5(t0) {
|
|
20111
19980
|
const [key, property_0] = t0;
|
|
20112
19981
|
return {
|
|
20113
19982
|
id: key,
|
|
@@ -21177,6 +21046,16 @@ function resolveEntityView(entityView, contextEntityViews) {
|
|
|
21177
21046
|
return entityView;
|
|
21178
21047
|
}
|
|
21179
21048
|
}
|
|
21049
|
+
function resolvedSelectedEntityView(customViews, customizationController, selectedTab) {
|
|
21050
|
+
const resolvedEntityViews = customViews ? customViews.map((e) => resolveEntityView(e, customizationController.entityViews)).filter(Boolean) : [];
|
|
21051
|
+
const selectedEntityView = resolvedEntityViews.find((e) => e.key === selectedTab);
|
|
21052
|
+
const selectedSecondaryForm = customViews && resolvedEntityViews.filter((e) => e.includeActions).find((e) => e.key === selectedTab);
|
|
21053
|
+
return {
|
|
21054
|
+
resolvedEntityViews,
|
|
21055
|
+
selectedEntityView,
|
|
21056
|
+
selectedSecondaryForm
|
|
21057
|
+
};
|
|
21058
|
+
}
|
|
21180
21059
|
function getNavigationEntriesFromPath(props) {
|
|
21181
21060
|
const {
|
|
21182
21061
|
path,
|
|
@@ -21796,12 +21675,14 @@ function EntityEditViewInner({
|
|
|
21796
21675
|
const customViews = collection.entityViews;
|
|
21797
21676
|
const customViewsCount = customViews?.length ?? 0;
|
|
21798
21677
|
const hasAdditionalViews = customViewsCount > 0 || subcollectionsCount > 0;
|
|
21799
|
-
const
|
|
21800
|
-
|
|
21801
|
-
|
|
21678
|
+
const {
|
|
21679
|
+
resolvedEntityViews,
|
|
21680
|
+
selectedEntityView,
|
|
21681
|
+
selectedSecondaryForm
|
|
21682
|
+
} = resolvedSelectedEntityView(customViews, customizationController, selectedTab);
|
|
21802
21683
|
const actionsAtTheBottom = !largeLayout || layout === "side_panel" || selectedEntityView?.includeActions === "bottom";
|
|
21803
21684
|
const mainViewVisible = selectedTab === MAIN_TAB_VALUE || Boolean(selectedSecondaryForm);
|
|
21804
|
-
const customViewsView = customViews && resolvedEntityViews.filter((
|
|
21685
|
+
const customViewsView = customViews && resolvedEntityViews.filter((e) => !e.includeActions).map((customView) => {
|
|
21805
21686
|
if (!customView) return null;
|
|
21806
21687
|
const Builder = customView.Builder;
|
|
21807
21688
|
if (!Builder) {
|
|
@@ -21977,16 +21858,19 @@ function EntitySidePanel(props) {
|
|
|
21977
21858
|
}
|
|
21978
21859
|
const NEW_URL_HASH = "new_side";
|
|
21979
21860
|
const SIDE_URL_HASH = "side";
|
|
21980
|
-
function getEntityViewWidth(props, small) {
|
|
21861
|
+
function getEntityViewWidth(props, small, customizationController) {
|
|
21981
21862
|
if (small) return CONTAINER_FULL_WIDTH;
|
|
21982
|
-
const
|
|
21863
|
+
const {
|
|
21864
|
+
selectedSecondaryForm
|
|
21865
|
+
} = resolvedSelectedEntityView(props.collection?.entityViews, customizationController, props.selectedTab);
|
|
21866
|
+
const shouldUseSmallLayout = !props.selectedTab || Boolean(selectedSecondaryForm);
|
|
21983
21867
|
let resolvedWidth;
|
|
21984
21868
|
if (props.width) {
|
|
21985
21869
|
resolvedWidth = typeof props.width === "number" ? `${props.width}px` : props.width;
|
|
21986
21870
|
} else if (props.collection?.sideDialogWidth) {
|
|
21987
21871
|
resolvedWidth = typeof props.collection.sideDialogWidth === "number" ? `${props.collection.sideDialogWidth}px` : props.collection.sideDialogWidth;
|
|
21988
21872
|
}
|
|
21989
|
-
if (!
|
|
21873
|
+
if (!shouldUseSmallLayout) {
|
|
21990
21874
|
return `calc(${ADDITIONAL_TAB_WIDTH} + ${resolvedWidth ?? FORM_CONTAINER_WIDTH})`;
|
|
21991
21875
|
} else {
|
|
21992
21876
|
if (resolvedWidth) {
|
|
@@ -22038,194 +21922,81 @@ function getNestedPropertiesDepth(property, accumulator = 0) {
|
|
|
22038
21922
|
}
|
|
22039
21923
|
}
|
|
22040
21924
|
const useBuildSideEntityController = (navigation, sideDialogsController) => {
|
|
22041
|
-
const $ = c(44);
|
|
22042
21925
|
const location = useLocation();
|
|
22043
21926
|
const initialised = useRef(false);
|
|
21927
|
+
const customizationController = useCustomizationController();
|
|
22044
21928
|
const smallLayout = !useLargeLayout();
|
|
22045
|
-
|
|
22046
|
-
|
|
22047
|
-
|
|
22048
|
-
|
|
22049
|
-
|
|
22050
|
-
|
|
22051
|
-
|
|
22052
|
-
|
|
22053
|
-
const
|
|
22054
|
-
|
|
22055
|
-
|
|
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
|
-
}
|
|
21929
|
+
useEffect(() => {
|
|
21930
|
+
const newFlag = location.hash === `#${NEW_URL_HASH}`;
|
|
21931
|
+
const sideFlag = location.hash === `#${SIDE_URL_HASH}`;
|
|
21932
|
+
if (!navigation.loading) {
|
|
21933
|
+
if ((newFlag || sideFlag) && navigation.isUrlCollectionPath(location.pathname)) {
|
|
21934
|
+
const entityOrCollectionPath = navigation.urlPathToDataPath(location.pathname);
|
|
21935
|
+
const panelsFromUrl = buildSidePanelsFromUrl(entityOrCollectionPath, navigation.collections ?? [], newFlag);
|
|
21936
|
+
for (let i = 0; i < panelsFromUrl.length; i++) {
|
|
21937
|
+
const props = panelsFromUrl[i];
|
|
21938
|
+
if (i === 0) sideDialogsController.replace(propsToSidePanel(props, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController));
|
|
21939
|
+
else sideDialogsController.open(propsToSidePanel(props, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController));
|
|
22062
21940
|
}
|
|
22063
|
-
initialised.current = true;
|
|
22064
21941
|
}
|
|
22065
|
-
|
|
22066
|
-
|
|
22067
|
-
|
|
22068
|
-
|
|
22069
|
-
|
|
22070
|
-
|
|
22071
|
-
|
|
22072
|
-
|
|
22073
|
-
|
|
22074
|
-
|
|
22075
|
-
|
|
22076
|
-
|
|
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
|
-
}
|
|
21942
|
+
initialised.current = true;
|
|
21943
|
+
}
|
|
21944
|
+
}, [navigation.loading]);
|
|
21945
|
+
const currentPanelKeys = sideDialogsController.sidePanels.map((p) => p.key);
|
|
21946
|
+
useEffect(() => {
|
|
21947
|
+
if (initialised.current) {
|
|
21948
|
+
const sideFlag_0 = location.hash === `#${SIDE_URL_HASH}`;
|
|
21949
|
+
if (sideFlag_0) {
|
|
21950
|
+
const entityOrCollectionPath_0 = navigation.urlPathToDataPath(location.pathname);
|
|
21951
|
+
const panelsFromUrl_0 = buildSidePanelsFromUrl(entityOrCollectionPath_0, navigation.collections ?? [], false);
|
|
21952
|
+
if (panelsFromUrl_0.length <= currentPanelKeys.length) {
|
|
21953
|
+
return;
|
|
22110
21954
|
}
|
|
22111
|
-
|
|
22112
|
-
|
|
22113
|
-
|
|
22114
|
-
|
|
22115
|
-
|
|
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);
|
|
21955
|
+
const lastPanel = panelsFromUrl_0[panelsFromUrl_0.length - 1];
|
|
21956
|
+
const panelProps = propsToSidePanel(lastPanel, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController);
|
|
21957
|
+
const lastCurrentPanel = currentPanelKeys.length > 0 ? currentPanelKeys[currentPanelKeys.length - 1] : void 0;
|
|
21958
|
+
if (!lastCurrentPanel || lastCurrentPanel !== panelProps.key) {
|
|
21959
|
+
sideDialogsController.replace(panelProps);
|
|
22140
21960
|
}
|
|
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
21961
|
}
|
|
22179
|
-
|
|
22180
|
-
|
|
22181
|
-
|
|
22182
|
-
|
|
22183
|
-
|
|
22184
|
-
|
|
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");
|
|
21962
|
+
}
|
|
21963
|
+
}, [location.pathname, location.hash, currentPanelKeys]);
|
|
21964
|
+
useEffect(() => {
|
|
21965
|
+
const updatedSidePanels = sideDialogsController.sidePanels.map((sidePanelProps) => {
|
|
21966
|
+
if (sidePanelProps.additional) {
|
|
21967
|
+
return propsToSidePanel(sidePanelProps.additional, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController);
|
|
22202
21968
|
}
|
|
22203
|
-
|
|
22204
|
-
};
|
|
22205
|
-
|
|
22206
|
-
|
|
22207
|
-
|
|
22208
|
-
|
|
22209
|
-
|
|
22210
|
-
|
|
22211
|
-
|
|
22212
|
-
|
|
22213
|
-
|
|
22214
|
-
|
|
22215
|
-
|
|
22216
|
-
|
|
22217
|
-
|
|
22218
|
-
|
|
22219
|
-
|
|
22220
|
-
|
|
22221
|
-
|
|
22222
|
-
|
|
22223
|
-
|
|
22224
|
-
|
|
22225
|
-
|
|
22226
|
-
|
|
22227
|
-
|
|
22228
|
-
|
|
21969
|
+
return sidePanelProps;
|
|
21970
|
+
});
|
|
21971
|
+
sideDialogsController.setSidePanels(updatedSidePanels);
|
|
21972
|
+
}, [smallLayout]);
|
|
21973
|
+
const close = useCallback(() => {
|
|
21974
|
+
sideDialogsController.close();
|
|
21975
|
+
}, [sideDialogsController]);
|
|
21976
|
+
const open = useCallback((props_0) => {
|
|
21977
|
+
if (props_0.copy && !props_0.entityId) {
|
|
21978
|
+
throw Error("If you want to copy an entity you need to provide an entityId");
|
|
21979
|
+
}
|
|
21980
|
+
const defaultSelectedView = resolveDefaultSelectedView(props_0.collection ? props_0.collection.defaultSelectedView : void 0, {
|
|
21981
|
+
status: props_0.copy ? "copy" : props_0.entityId ? "existing" : "new",
|
|
21982
|
+
entityId: props_0.entityId
|
|
21983
|
+
});
|
|
21984
|
+
sideDialogsController.open(propsToSidePanel({
|
|
21985
|
+
selectedTab: defaultSelectedView,
|
|
21986
|
+
...props_0
|
|
21987
|
+
}, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController));
|
|
21988
|
+
}, [sideDialogsController, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout]);
|
|
21989
|
+
const replace = useCallback((props_1) => {
|
|
21990
|
+
if (props_1.copy && !props_1.entityId) {
|
|
21991
|
+
throw Error("If you want to copy an entity you need to provide an entityId");
|
|
21992
|
+
}
|
|
21993
|
+
sideDialogsController.replace(propsToSidePanel(props_1, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController));
|
|
21994
|
+
}, [navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, sideDialogsController, smallLayout]);
|
|
21995
|
+
return {
|
|
21996
|
+
close,
|
|
21997
|
+
open,
|
|
21998
|
+
replace
|
|
21999
|
+
};
|
|
22229
22000
|
};
|
|
22230
22001
|
function buildSidePanelsFromUrl(path, collections, newFlag) {
|
|
22231
22002
|
const navigationViewsForPath = getNavigationEntriesFromPath({
|
|
@@ -22265,7 +22036,7 @@ function buildSidePanelsFromUrl(path, collections, newFlag) {
|
|
|
22265
22036
|
}
|
|
22266
22037
|
return sidePanel ? [sidePanel] : [];
|
|
22267
22038
|
}
|
|
22268
|
-
const propsToSidePanel = (props, buildUrlCollectionPath, resolveIdsFrom, smallLayout) => {
|
|
22039
|
+
const propsToSidePanel = (props, buildUrlCollectionPath, resolveIdsFrom, smallLayout, customizationController) => {
|
|
22269
22040
|
const collectionPath = removeInitialAndTrailingSlashes(props.path);
|
|
22270
22041
|
const newPath = props.entityId ? buildUrlCollectionPath(`${collectionPath}/${props.entityId}${props.selectedTab ? "/" + props.selectedTab : ""}#${SIDE_URL_HASH}`) : buildUrlCollectionPath(`${collectionPath}#${NEW_URL_HASH}`);
|
|
22271
22042
|
const resolvedPath = resolveIdsFrom(props.path);
|
|
@@ -22274,7 +22045,7 @@ const propsToSidePanel = (props, buildUrlCollectionPath, resolveIdsFrom, smallLa
|
|
|
22274
22045
|
path: resolvedPath,
|
|
22275
22046
|
formProps: props.formProps
|
|
22276
22047
|
};
|
|
22277
|
-
const entityViewWidth = getEntityViewWidth(props, smallLayout);
|
|
22048
|
+
const entityViewWidth = getEntityViewWidth(props, smallLayout, customizationController);
|
|
22278
22049
|
return {
|
|
22279
22050
|
key: `${props.path}/${props.entityId}`,
|
|
22280
22051
|
component: /* @__PURE__ */ jsx(EntitySidePanel, { ...resolvedPanelProps }),
|
|
@@ -22285,9 +22056,6 @@ const propsToSidePanel = (props, buildUrlCollectionPath, resolveIdsFrom, smallLa
|
|
|
22285
22056
|
additional: props
|
|
22286
22057
|
};
|
|
22287
22058
|
};
|
|
22288
|
-
function _temp$5(p) {
|
|
22289
|
-
return p.key;
|
|
22290
|
-
}
|
|
22291
22059
|
function useBuildSideDialogsController() {
|
|
22292
22060
|
const $ = c(24);
|
|
22293
22061
|
const location = useLocation();
|
|
@@ -24173,7 +23941,6 @@ export {
|
|
|
24173
23941
|
FireCMSRouter,
|
|
24174
23942
|
FormEntry,
|
|
24175
23943
|
FormLayout,
|
|
24176
|
-
FormLayoutInner,
|
|
24177
23944
|
GeoPoint,
|
|
24178
23945
|
IconForView,
|
|
24179
23946
|
ImagePreview,
|
|
@@ -24330,6 +24097,7 @@ export {
|
|
|
24330
24097
|
resolvePropertyEnum,
|
|
24331
24098
|
resolveStorageFilenameString,
|
|
24332
24099
|
resolveStoragePathString,
|
|
24100
|
+
resolvedSelectedEntityView,
|
|
24333
24101
|
sanitizeData,
|
|
24334
24102
|
saveEntityWithCallbacks,
|
|
24335
24103
|
segmentsToStrippedPath,
|