@firecms/collection_editor 3.0.0-canary.235 → 3.0.0-canary.237
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/ConfigControllerProvider.d.ts +0 -1
- package/dist/index.es.js +268 -260
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +268 -260
- package/dist/index.umd.js.map +1 -1
- package/dist/types/collection_editor_controller.d.ts +0 -1
- package/dist/ui/collection_editor/CollectionEditorWelcomeView.d.ts +1 -1
- package/dist/useCollectionEditorPlugin.d.ts +3 -3
- package/package.json +8 -8
- package/src/ConfigControllerProvider.tsx +0 -5
- package/src/types/collection_editor_controller.tsx +0 -2
- package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +5 -21
- package/src/useCollectionEditorPlugin.tsx +5 -6
- package/src/utils/collections.ts +1 -0
package/dist/index.es.js
CHANGED
|
@@ -8065,7 +8065,7 @@ const pagesCollectionTemplate = {
|
|
|
8065
8065
|
}
|
|
8066
8066
|
};
|
|
8067
8067
|
function CollectionEditorWelcomeView(t0) {
|
|
8068
|
-
const $ = c(
|
|
8068
|
+
const $ = c(52);
|
|
8069
8069
|
const {
|
|
8070
8070
|
path,
|
|
8071
8071
|
pathSuggestions,
|
|
@@ -8102,6 +8102,10 @@ function CollectionEditorWelcomeView(t0) {
|
|
|
8102
8102
|
setFieldValue,
|
|
8103
8103
|
setValues
|
|
8104
8104
|
} = useFormex();
|
|
8105
|
+
const noSuggestions = !loadingPathSuggestions && (filteredPathSuggestions ?? [])?.length === 0;
|
|
8106
|
+
if (!noSuggestions) {
|
|
8107
|
+
return null;
|
|
8108
|
+
}
|
|
8105
8109
|
let t3;
|
|
8106
8110
|
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8107
8111
|
t3 = /* @__PURE__ */ jsx("div", { className: "flex flex-row py-2 pt-3 items-center", children: /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "flex-grow", children: "New collection" }) });
|
|
@@ -8153,173 +8157,162 @@ function CollectionEditorWelcomeView(t0) {
|
|
|
8153
8157
|
t7 = $[15];
|
|
8154
8158
|
}
|
|
8155
8159
|
let t8;
|
|
8156
|
-
if ($[16] !==
|
|
8157
|
-
t8 =
|
|
8158
|
-
$[16] = filteredPathSuggestions;
|
|
8159
|
-
$[17] = loadingPathSuggestions;
|
|
8160
|
-
$[18] = t8;
|
|
8161
|
-
} else {
|
|
8162
|
-
t8 = $[18];
|
|
8163
|
-
}
|
|
8164
|
-
let t9;
|
|
8165
|
-
if ($[19] !== t6 || $[20] !== t7 || $[21] !== t8) {
|
|
8166
|
-
t9 = /* @__PURE__ */ jsxs("div", { className: "my-2", children: [
|
|
8160
|
+
if ($[16] !== t6 || $[17] !== t7) {
|
|
8161
|
+
t8 = /* @__PURE__ */ jsxs("div", { className: "my-2", children: [
|
|
8167
8162
|
t5,
|
|
8168
8163
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
|
|
8169
8164
|
t6,
|
|
8170
|
-
t7
|
|
8171
|
-
t8
|
|
8165
|
+
t7
|
|
8172
8166
|
] })
|
|
8173
8167
|
] });
|
|
8174
|
-
$[
|
|
8175
|
-
$[
|
|
8176
|
-
$[
|
|
8177
|
-
$[22] = t9;
|
|
8168
|
+
$[16] = t6;
|
|
8169
|
+
$[17] = t7;
|
|
8170
|
+
$[18] = t8;
|
|
8178
8171
|
} else {
|
|
8179
|
-
|
|
8172
|
+
t8 = $[18];
|
|
8173
|
+
}
|
|
8174
|
+
let t9;
|
|
8175
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8176
|
+
t9 = /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "● Select a template:" });
|
|
8177
|
+
$[19] = t9;
|
|
8178
|
+
} else {
|
|
8179
|
+
t9 = $[19];
|
|
8180
8180
|
}
|
|
8181
8181
|
let t10;
|
|
8182
|
-
if ($[
|
|
8183
|
-
t10 = /* @__PURE__ */ jsx(
|
|
8184
|
-
$[
|
|
8182
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8183
|
+
t10 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: productsCollectionTemplate.icon });
|
|
8184
|
+
$[20] = t10;
|
|
8185
8185
|
} else {
|
|
8186
|
-
t10 = $[
|
|
8186
|
+
t10 = $[20];
|
|
8187
8187
|
}
|
|
8188
8188
|
let t11;
|
|
8189
|
-
if ($[
|
|
8190
|
-
t11 = /* @__PURE__ */ jsx(
|
|
8191
|
-
|
|
8189
|
+
if ($[21] !== onContinue || $[22] !== setValues) {
|
|
8190
|
+
t11 = /* @__PURE__ */ jsx(TemplateButton, { title: "Products", subtitle: "A collection of products with images, prices and stock", icon: t10, onClick: () => {
|
|
8191
|
+
setValues(productsCollectionTemplate);
|
|
8192
|
+
onContinue();
|
|
8193
|
+
} });
|
|
8194
|
+
$[21] = onContinue;
|
|
8195
|
+
$[22] = setValues;
|
|
8196
|
+
$[23] = t11;
|
|
8192
8197
|
} else {
|
|
8193
|
-
t11 = $[
|
|
8198
|
+
t11 = $[23];
|
|
8194
8199
|
}
|
|
8195
8200
|
let t12;
|
|
8201
|
+
if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8202
|
+
t12 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: usersCollectionTemplate.icon });
|
|
8203
|
+
$[24] = t12;
|
|
8204
|
+
} else {
|
|
8205
|
+
t12 = $[24];
|
|
8206
|
+
}
|
|
8207
|
+
let t13;
|
|
8196
8208
|
if ($[25] !== onContinue || $[26] !== setValues) {
|
|
8197
|
-
|
|
8198
|
-
setValues(
|
|
8209
|
+
t13 = /* @__PURE__ */ jsx(TemplateButton, { title: "Users", subtitle: "A collection of users with emails, names and roles", icon: t12, onClick: () => {
|
|
8210
|
+
setValues(usersCollectionTemplate);
|
|
8199
8211
|
onContinue();
|
|
8200
8212
|
} });
|
|
8201
8213
|
$[25] = onContinue;
|
|
8202
8214
|
$[26] = setValues;
|
|
8203
|
-
$[27] =
|
|
8215
|
+
$[27] = t13;
|
|
8204
8216
|
} else {
|
|
8205
|
-
|
|
8217
|
+
t13 = $[27];
|
|
8206
8218
|
}
|
|
8207
|
-
let
|
|
8219
|
+
let t14;
|
|
8208
8220
|
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8209
|
-
|
|
8210
|
-
$[28] =
|
|
8221
|
+
t14 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: blogCollectionTemplate.icon });
|
|
8222
|
+
$[28] = t14;
|
|
8211
8223
|
} else {
|
|
8212
|
-
|
|
8224
|
+
t14 = $[28];
|
|
8213
8225
|
}
|
|
8214
|
-
let
|
|
8226
|
+
let t15;
|
|
8215
8227
|
if ($[29] !== onContinue || $[30] !== setValues) {
|
|
8216
|
-
|
|
8217
|
-
setValues(
|
|
8228
|
+
t15 = /* @__PURE__ */ jsx(TemplateButton, { title: "Blog posts", subtitle: "A collection of blog posts with images, authors and complex content", icon: t14, onClick: () => {
|
|
8229
|
+
setValues(blogCollectionTemplate);
|
|
8218
8230
|
onContinue();
|
|
8219
8231
|
} });
|
|
8220
8232
|
$[29] = onContinue;
|
|
8221
8233
|
$[30] = setValues;
|
|
8222
|
-
$[31] =
|
|
8234
|
+
$[31] = t15;
|
|
8223
8235
|
} else {
|
|
8224
|
-
|
|
8236
|
+
t15 = $[31];
|
|
8225
8237
|
}
|
|
8226
|
-
let
|
|
8238
|
+
let t16;
|
|
8227
8239
|
if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8228
|
-
|
|
8229
|
-
$[32] =
|
|
8240
|
+
t16 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: pagesCollectionTemplate.icon });
|
|
8241
|
+
$[32] = t16;
|
|
8230
8242
|
} else {
|
|
8231
|
-
|
|
8243
|
+
t16 = $[32];
|
|
8232
8244
|
}
|
|
8233
|
-
let
|
|
8245
|
+
let t17;
|
|
8234
8246
|
if ($[33] !== onContinue || $[34] !== setValues) {
|
|
8235
|
-
|
|
8236
|
-
setValues(
|
|
8247
|
+
t17 = /* @__PURE__ */ jsx(TemplateButton, { title: "Pages", subtitle: "A collection of pages with images, authors and complex content", icon: t16, onClick: () => {
|
|
8248
|
+
setValues(pagesCollectionTemplate);
|
|
8237
8249
|
onContinue();
|
|
8238
8250
|
} });
|
|
8239
8251
|
$[33] = onContinue;
|
|
8240
8252
|
$[34] = setValues;
|
|
8241
|
-
$[35] =
|
|
8242
|
-
} else {
|
|
8243
|
-
t16 = $[35];
|
|
8244
|
-
}
|
|
8245
|
-
let t17;
|
|
8246
|
-
if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8247
|
-
t17 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: pagesCollectionTemplate.icon });
|
|
8248
|
-
$[36] = t17;
|
|
8253
|
+
$[35] = t17;
|
|
8249
8254
|
} else {
|
|
8250
|
-
t17 = $[
|
|
8255
|
+
t17 = $[35];
|
|
8251
8256
|
}
|
|
8252
8257
|
let t18;
|
|
8253
|
-
if ($[37] !==
|
|
8254
|
-
t18 = /* @__PURE__ */
|
|
8255
|
-
|
|
8256
|
-
onContinue();
|
|
8257
|
-
} });
|
|
8258
|
-
$[37] = onContinue;
|
|
8259
|
-
$[38] = setValues;
|
|
8260
|
-
$[39] = t18;
|
|
8261
|
-
} else {
|
|
8262
|
-
t18 = $[39];
|
|
8263
|
-
}
|
|
8264
|
-
let t19;
|
|
8265
|
-
if ($[40] !== t12 || $[41] !== t14 || $[42] !== t16 || $[43] !== t18) {
|
|
8266
|
-
t19 = /* @__PURE__ */ jsxs("div", { className: "my-2", children: [
|
|
8267
|
-
t10,
|
|
8258
|
+
if ($[36] !== t11 || $[37] !== t13 || $[38] !== t15 || $[39] !== t17) {
|
|
8259
|
+
t18 = /* @__PURE__ */ jsxs("div", { className: "my-2", children: [
|
|
8260
|
+
t9,
|
|
8268
8261
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8262
|
+
t11,
|
|
8263
|
+
t13,
|
|
8264
|
+
t15,
|
|
8265
|
+
t17
|
|
8273
8266
|
] })
|
|
8274
8267
|
] });
|
|
8275
|
-
$[
|
|
8276
|
-
$[
|
|
8277
|
-
$[
|
|
8278
|
-
$[
|
|
8279
|
-
$[
|
|
8268
|
+
$[36] = t11;
|
|
8269
|
+
$[37] = t13;
|
|
8270
|
+
$[38] = t15;
|
|
8271
|
+
$[39] = t17;
|
|
8272
|
+
$[40] = t18;
|
|
8280
8273
|
} else {
|
|
8281
|
-
|
|
8274
|
+
t18 = $[40];
|
|
8282
8275
|
}
|
|
8283
|
-
let
|
|
8284
|
-
if ($[
|
|
8285
|
-
|
|
8276
|
+
let t19;
|
|
8277
|
+
if ($[41] !== onContinue || $[42] !== parentCollection) {
|
|
8278
|
+
t19 = !parentCollection && /* @__PURE__ */ jsxs("div", { children: [
|
|
8286
8279
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "mb-2", children: "● Create a collection from a file (csv, json, xls, xslx...)" }),
|
|
8287
8280
|
/* @__PURE__ */ jsx(ImportFileUpload, { onDataAdded: (data, propertiesOrder) => onContinue(data, propertiesOrder) })
|
|
8288
8281
|
] });
|
|
8289
|
-
$[
|
|
8290
|
-
$[
|
|
8291
|
-
$[
|
|
8282
|
+
$[41] = onContinue;
|
|
8283
|
+
$[42] = parentCollection;
|
|
8284
|
+
$[43] = t19;
|
|
8292
8285
|
} else {
|
|
8293
|
-
|
|
8286
|
+
t19 = $[43];
|
|
8294
8287
|
}
|
|
8295
|
-
let
|
|
8296
|
-
if ($[
|
|
8297
|
-
|
|
8298
|
-
$[
|
|
8299
|
-
$[
|
|
8288
|
+
let t20;
|
|
8289
|
+
if ($[44] !== onContinue) {
|
|
8290
|
+
t20 = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, { variant: "text", onClick: () => onContinue(), className: "my-2", children: "Continue from scratch" }) });
|
|
8291
|
+
$[44] = onContinue;
|
|
8292
|
+
$[45] = t20;
|
|
8300
8293
|
} else {
|
|
8301
|
-
|
|
8294
|
+
t20 = $[45];
|
|
8302
8295
|
}
|
|
8303
|
-
let
|
|
8304
|
-
if ($[
|
|
8305
|
-
|
|
8296
|
+
let t21;
|
|
8297
|
+
if ($[46] !== t18 || $[47] !== t19 || $[48] !== t20 || $[49] !== t4 || $[50] !== t8) {
|
|
8298
|
+
t21 = /* @__PURE__ */ jsx("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ jsxs(Container, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
8306
8299
|
t3,
|
|
8307
8300
|
t4,
|
|
8308
|
-
|
|
8301
|
+
t8,
|
|
8302
|
+
t18,
|
|
8309
8303
|
t19,
|
|
8310
|
-
t20
|
|
8311
|
-
t21
|
|
8304
|
+
t20
|
|
8312
8305
|
] }) });
|
|
8313
|
-
$[
|
|
8314
|
-
$[
|
|
8315
|
-
$[
|
|
8316
|
-
$[
|
|
8317
|
-
$[
|
|
8318
|
-
$[
|
|
8306
|
+
$[46] = t18;
|
|
8307
|
+
$[47] = t19;
|
|
8308
|
+
$[48] = t20;
|
|
8309
|
+
$[49] = t4;
|
|
8310
|
+
$[50] = t8;
|
|
8311
|
+
$[51] = t21;
|
|
8319
8312
|
} else {
|
|
8320
|
-
|
|
8313
|
+
t21 = $[51];
|
|
8321
8314
|
}
|
|
8322
|
-
return
|
|
8315
|
+
return t21;
|
|
8323
8316
|
}
|
|
8324
8317
|
function TemplateButton(t0) {
|
|
8325
8318
|
const $ = c(10);
|
|
@@ -9533,7 +9526,7 @@ const validateId = (value, isNewCollection, existingPaths, existingIds) => {
|
|
|
9533
9526
|
const ConfigControllerContext = React__default.createContext({});
|
|
9534
9527
|
const CollectionEditorContext = React__default.createContext({});
|
|
9535
9528
|
const ConfigControllerProvider = React__default.memo(function ConfigControllerProvider2(t0) {
|
|
9536
|
-
const $ = c(
|
|
9529
|
+
const $ = c(65);
|
|
9537
9530
|
const {
|
|
9538
9531
|
children,
|
|
9539
9532
|
collectionConfigController,
|
|
@@ -9541,7 +9534,6 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9541
9534
|
reservedGroups,
|
|
9542
9535
|
collectionInference,
|
|
9543
9536
|
extraView,
|
|
9544
|
-
getPathSuggestions,
|
|
9545
9537
|
getUser,
|
|
9546
9538
|
getData,
|
|
9547
9539
|
onAnalyticsEvent
|
|
@@ -9662,26 +9654,24 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9662
9654
|
const createCollection = t3;
|
|
9663
9655
|
const t4 = configPermissions ?? defaultConfigPermissions;
|
|
9664
9656
|
let t5;
|
|
9665
|
-
if ($[6] !== createCollection || $[7] !== editCollection || $[8] !== editProperty || $[9] !==
|
|
9657
|
+
if ($[6] !== createCollection || $[7] !== editCollection || $[8] !== editProperty || $[9] !== t4) {
|
|
9666
9658
|
t5 = {
|
|
9667
9659
|
editCollection,
|
|
9668
9660
|
createCollection,
|
|
9669
9661
|
editProperty,
|
|
9670
|
-
configPermissions: t4
|
|
9671
|
-
getPathSuggestions
|
|
9662
|
+
configPermissions: t4
|
|
9672
9663
|
};
|
|
9673
9664
|
$[6] = createCollection;
|
|
9674
9665
|
$[7] = editCollection;
|
|
9675
9666
|
$[8] = editProperty;
|
|
9676
|
-
$[9] =
|
|
9677
|
-
$[10] =
|
|
9678
|
-
$[11] = t5;
|
|
9667
|
+
$[9] = t4;
|
|
9668
|
+
$[10] = t5;
|
|
9679
9669
|
} else {
|
|
9680
|
-
t5 = $[
|
|
9670
|
+
t5 = $[10];
|
|
9681
9671
|
}
|
|
9682
9672
|
const t6 = Boolean(currentDialog);
|
|
9683
9673
|
let t7;
|
|
9684
|
-
if ($[
|
|
9674
|
+
if ($[11] !== currentDialog || $[12] !== navigate || $[13] !== navigation) {
|
|
9685
9675
|
t7 = (collection_0) => {
|
|
9686
9676
|
if (currentDialog?.redirect) {
|
|
9687
9677
|
if (collection_0 && currentDialog?.isNewCollection && !currentDialog.parentCollectionIds.length) {
|
|
@@ -9691,29 +9681,28 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9691
9681
|
}
|
|
9692
9682
|
setCurrentDialog(void 0);
|
|
9693
9683
|
};
|
|
9694
|
-
$[
|
|
9695
|
-
$[
|
|
9696
|
-
$[
|
|
9697
|
-
$[
|
|
9684
|
+
$[11] = currentDialog;
|
|
9685
|
+
$[12] = navigate;
|
|
9686
|
+
$[13] = navigation;
|
|
9687
|
+
$[14] = t7;
|
|
9698
9688
|
} else {
|
|
9699
|
-
t7 = $[
|
|
9689
|
+
t7 = $[14];
|
|
9700
9690
|
}
|
|
9701
9691
|
let t8;
|
|
9702
|
-
if ($[
|
|
9703
|
-
t8 = /* @__PURE__ */ jsx(CollectionEditorDialog, { open: t6, configController: collectionConfigController, isNewCollection: false, collectionInference, ...currentDialog, getData, reservedGroups, extraView,
|
|
9704
|
-
$[
|
|
9705
|
-
$[
|
|
9706
|
-
$[
|
|
9707
|
-
$[
|
|
9708
|
-
$[
|
|
9709
|
-
$[
|
|
9710
|
-
$[
|
|
9711
|
-
$[
|
|
9712
|
-
$[
|
|
9713
|
-
$[
|
|
9714
|
-
$[26] = t8;
|
|
9692
|
+
if ($[15] !== collectionConfigController || $[16] !== collectionInference || $[17] !== currentDialog || $[18] !== extraView || $[19] !== getData || $[20] !== getUser || $[21] !== reservedGroups || $[22] !== t6 || $[23] !== t7) {
|
|
9693
|
+
t8 = /* @__PURE__ */ jsx(CollectionEditorDialog, { open: t6, configController: collectionConfigController, isNewCollection: false, collectionInference, ...currentDialog, getData, reservedGroups, extraView, getUser, handleClose: t7 });
|
|
9694
|
+
$[15] = collectionConfigController;
|
|
9695
|
+
$[16] = collectionInference;
|
|
9696
|
+
$[17] = currentDialog;
|
|
9697
|
+
$[18] = extraView;
|
|
9698
|
+
$[19] = getData;
|
|
9699
|
+
$[20] = getUser;
|
|
9700
|
+
$[21] = reservedGroups;
|
|
9701
|
+
$[22] = t6;
|
|
9702
|
+
$[23] = t7;
|
|
9703
|
+
$[24] = t8;
|
|
9715
9704
|
} else {
|
|
9716
|
-
t8 = $[
|
|
9705
|
+
t8 = $[24];
|
|
9717
9706
|
}
|
|
9718
9707
|
const t9 = Boolean(currentPropertyDialog);
|
|
9719
9708
|
const t10 = Boolean(currentPropertyDialog?.propertyKey);
|
|
@@ -9721,21 +9710,21 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9721
9710
|
const t12 = !currentPropertyDialog ? false : !currentPropertyDialog?.propertyKey;
|
|
9722
9711
|
const t13 = currentPropertyDialog?.collectionEditable ?? false;
|
|
9723
9712
|
let t14;
|
|
9724
|
-
if ($[
|
|
9713
|
+
if ($[25] !== currentPropertyDialog || $[26] !== getData || $[27] !== navigation) {
|
|
9725
9714
|
t14 = getData && currentPropertyDialog?.editedCollectionId ? () => {
|
|
9726
9715
|
console.debug("get data for property", currentPropertyDialog?.editedCollectionId);
|
|
9727
9716
|
const resolvedPath = navigation.resolveIdsFrom(currentPropertyDialog.editedCollectionId);
|
|
9728
9717
|
return getData(resolvedPath, []);
|
|
9729
9718
|
} : void 0;
|
|
9730
|
-
$[
|
|
9731
|
-
$[
|
|
9732
|
-
$[
|
|
9733
|
-
$[
|
|
9719
|
+
$[25] = currentPropertyDialog;
|
|
9720
|
+
$[26] = getData;
|
|
9721
|
+
$[27] = navigation;
|
|
9722
|
+
$[28] = t14;
|
|
9734
9723
|
} else {
|
|
9735
|
-
t14 = $[
|
|
9724
|
+
t14 = $[28];
|
|
9736
9725
|
}
|
|
9737
9726
|
let t15;
|
|
9738
|
-
if ($[
|
|
9727
|
+
if ($[29] !== collectionConfigController || $[30] !== currentPropertyDialog || $[31] !== snackbarController) {
|
|
9739
9728
|
t15 = (t162) => {
|
|
9740
9729
|
const {
|
|
9741
9730
|
id: id_0,
|
|
@@ -9764,15 +9753,15 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9764
9753
|
return false;
|
|
9765
9754
|
});
|
|
9766
9755
|
};
|
|
9767
|
-
$[
|
|
9768
|
-
$[
|
|
9769
|
-
$[
|
|
9770
|
-
$[
|
|
9756
|
+
$[29] = collectionConfigController;
|
|
9757
|
+
$[30] = currentPropertyDialog;
|
|
9758
|
+
$[31] = snackbarController;
|
|
9759
|
+
$[32] = t15;
|
|
9771
9760
|
} else {
|
|
9772
|
-
t15 = $[
|
|
9761
|
+
t15 = $[32];
|
|
9773
9762
|
}
|
|
9774
9763
|
let t16;
|
|
9775
|
-
if ($[
|
|
9764
|
+
if ($[33] !== collectionConfigController || $[34] !== currentPropertyDialog?.currentPropertiesOrder || $[35] !== currentPropertyDialog?.editedCollectionId || $[36] !== currentPropertyDialog?.namespace || $[37] !== currentPropertyDialog?.parentCollectionIds || $[38] !== currentPropertyDialog?.propertyKey || $[39] !== snackbarController) {
|
|
9776
9765
|
t16 = () => {
|
|
9777
9766
|
if (!currentPropertyDialog?.propertyKey) {
|
|
9778
9767
|
return;
|
|
@@ -9795,21 +9784,21 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9795
9784
|
return false;
|
|
9796
9785
|
});
|
|
9797
9786
|
};
|
|
9798
|
-
$[
|
|
9799
|
-
$[
|
|
9800
|
-
$[
|
|
9801
|
-
$[
|
|
9802
|
-
$[
|
|
9803
|
-
$[
|
|
9804
|
-
$[
|
|
9805
|
-
$[
|
|
9787
|
+
$[33] = collectionConfigController;
|
|
9788
|
+
$[34] = currentPropertyDialog?.currentPropertiesOrder;
|
|
9789
|
+
$[35] = currentPropertyDialog?.editedCollectionId;
|
|
9790
|
+
$[36] = currentPropertyDialog?.namespace;
|
|
9791
|
+
$[37] = currentPropertyDialog?.parentCollectionIds;
|
|
9792
|
+
$[38] = currentPropertyDialog?.propertyKey;
|
|
9793
|
+
$[39] = snackbarController;
|
|
9794
|
+
$[40] = t16;
|
|
9806
9795
|
} else {
|
|
9807
|
-
t16 = $[
|
|
9796
|
+
t16 = $[40];
|
|
9808
9797
|
}
|
|
9809
9798
|
let t17;
|
|
9810
9799
|
let t18;
|
|
9811
9800
|
let t19;
|
|
9812
|
-
if ($[
|
|
9801
|
+
if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9813
9802
|
t17 = () => {
|
|
9814
9803
|
setCurrentPropertyDialog(void 0);
|
|
9815
9804
|
};
|
|
@@ -9817,64 +9806,64 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9817
9806
|
setCurrentPropertyDialog(void 0);
|
|
9818
9807
|
};
|
|
9819
9808
|
t19 = {};
|
|
9820
|
-
$[
|
|
9821
|
-
$[
|
|
9822
|
-
$[
|
|
9809
|
+
$[41] = t17;
|
|
9810
|
+
$[42] = t18;
|
|
9811
|
+
$[43] = t19;
|
|
9823
9812
|
} else {
|
|
9824
|
-
t17 = $[
|
|
9825
|
-
t18 = $[
|
|
9826
|
-
t19 = $[
|
|
9813
|
+
t17 = $[41];
|
|
9814
|
+
t18 = $[42];
|
|
9815
|
+
t19 = $[43];
|
|
9827
9816
|
}
|
|
9828
9817
|
let t20;
|
|
9829
|
-
if ($[
|
|
9818
|
+
if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9830
9819
|
t20 = [];
|
|
9831
|
-
$[
|
|
9820
|
+
$[44] = t20;
|
|
9832
9821
|
} else {
|
|
9833
|
-
t20 = $[
|
|
9822
|
+
t20 = $[44];
|
|
9834
9823
|
}
|
|
9835
9824
|
const t21 = currentPropertyDialog?.property;
|
|
9836
9825
|
const t22 = currentPropertyDialog?.propertyKey;
|
|
9837
9826
|
let t23;
|
|
9838
|
-
if ($[
|
|
9827
|
+
if ($[45] !== propertyConfigs || $[46] !== t10 || $[47] !== t11 || $[48] !== t12 || $[49] !== t13 || $[50] !== t14 || $[51] !== t15 || $[52] !== t16 || $[53] !== t21 || $[54] !== t22 || $[55] !== t9) {
|
|
9839
9828
|
t23 = /* @__PURE__ */ jsx(PropertyFormDialog, { open: t9, includeIdAndName: true, existingProperty: t10, autoUpdateId: t11, autoOpenTypeSelect: t12, inArray: false, collectionEditable: t13, getData: t14, onPropertyChanged: t15, onPropertyChangedImmediate: false, onDelete: t16, onError: _temp2, onOkClicked: t17, onCancel: t18, initialErrors: t19, forceShowErrors: false, existingPropertyKeys: t20, allowDataInference: true, propertyConfigs, property: t21, propertyKey: t22 });
|
|
9840
|
-
$[
|
|
9841
|
-
$[
|
|
9842
|
-
$[
|
|
9843
|
-
$[
|
|
9844
|
-
$[
|
|
9845
|
-
$[
|
|
9846
|
-
$[
|
|
9847
|
-
$[
|
|
9848
|
-
$[
|
|
9849
|
-
$[
|
|
9850
|
-
$[
|
|
9851
|
-
$[
|
|
9852
|
-
} else {
|
|
9853
|
-
t23 = $[
|
|
9829
|
+
$[45] = propertyConfigs;
|
|
9830
|
+
$[46] = t10;
|
|
9831
|
+
$[47] = t11;
|
|
9832
|
+
$[48] = t12;
|
|
9833
|
+
$[49] = t13;
|
|
9834
|
+
$[50] = t14;
|
|
9835
|
+
$[51] = t15;
|
|
9836
|
+
$[52] = t16;
|
|
9837
|
+
$[53] = t21;
|
|
9838
|
+
$[54] = t22;
|
|
9839
|
+
$[55] = t9;
|
|
9840
|
+
$[56] = t23;
|
|
9841
|
+
} else {
|
|
9842
|
+
t23 = $[56];
|
|
9854
9843
|
}
|
|
9855
9844
|
let t24;
|
|
9856
|
-
if ($[
|
|
9845
|
+
if ($[57] !== children || $[58] !== t23 || $[59] !== t5 || $[60] !== t8) {
|
|
9857
9846
|
t24 = /* @__PURE__ */ jsxs(CollectionEditorContext.Provider, { value: t5, children: [
|
|
9858
9847
|
children,
|
|
9859
9848
|
t8,
|
|
9860
9849
|
t23
|
|
9861
9850
|
] });
|
|
9862
|
-
$[
|
|
9863
|
-
$[
|
|
9864
|
-
$[
|
|
9865
|
-
$[
|
|
9866
|
-
$[
|
|
9851
|
+
$[57] = children;
|
|
9852
|
+
$[58] = t23;
|
|
9853
|
+
$[59] = t5;
|
|
9854
|
+
$[60] = t8;
|
|
9855
|
+
$[61] = t24;
|
|
9867
9856
|
} else {
|
|
9868
|
-
t24 = $[
|
|
9857
|
+
t24 = $[61];
|
|
9869
9858
|
}
|
|
9870
9859
|
let t25;
|
|
9871
|
-
if ($[
|
|
9860
|
+
if ($[62] !== collectionConfigController || $[63] !== t24) {
|
|
9872
9861
|
t25 = /* @__PURE__ */ jsx(ConfigControllerContext.Provider, { value: collectionConfigController, children: t24 });
|
|
9873
|
-
$[
|
|
9874
|
-
$[
|
|
9875
|
-
$[
|
|
9862
|
+
$[62] = collectionConfigController;
|
|
9863
|
+
$[63] = t24;
|
|
9864
|
+
$[64] = t25;
|
|
9876
9865
|
} else {
|
|
9877
|
-
t25 = $[
|
|
9866
|
+
t25 = $[64];
|
|
9878
9867
|
}
|
|
9879
9868
|
return t25;
|
|
9880
9869
|
}, equal);
|
|
@@ -10489,21 +10478,22 @@ function NewCollectionCard(t0) {
|
|
|
10489
10478
|
return t8;
|
|
10490
10479
|
}
|
|
10491
10480
|
function useCollectionEditorPlugin(t0) {
|
|
10492
|
-
const $ = c(
|
|
10481
|
+
const $ = c(19);
|
|
10493
10482
|
const {
|
|
10494
10483
|
collectionConfigController,
|
|
10495
10484
|
configPermissions,
|
|
10496
10485
|
reservedGroups,
|
|
10497
10486
|
extraView,
|
|
10498
|
-
getPathSuggestions,
|
|
10499
10487
|
getUser,
|
|
10500
10488
|
collectionInference,
|
|
10501
10489
|
getData,
|
|
10502
|
-
onAnalyticsEvent
|
|
10490
|
+
onAnalyticsEvent,
|
|
10491
|
+
includeIntroView: t1
|
|
10503
10492
|
} = t0;
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
|
|
10493
|
+
const includeIntroView = t1 === void 0 ? true : t1;
|
|
10494
|
+
let t2;
|
|
10495
|
+
if ($[0] !== collectionConfigController || $[1] !== collectionInference || $[2] !== configPermissions || $[3] !== extraView || $[4] !== getData || $[5] !== getUser || $[6] !== onAnalyticsEvent || $[7] !== reservedGroups) {
|
|
10496
|
+
t2 = {
|
|
10507
10497
|
Component: ConfigControllerProvider,
|
|
10508
10498
|
props: {
|
|
10509
10499
|
collectionConfigController,
|
|
@@ -10511,7 +10501,6 @@ function useCollectionEditorPlugin(t0) {
|
|
|
10511
10501
|
collectionInference,
|
|
10512
10502
|
reservedGroups,
|
|
10513
10503
|
extraView,
|
|
10514
|
-
getPathSuggestions,
|
|
10515
10504
|
getUser,
|
|
10516
10505
|
getData,
|
|
10517
10506
|
onAnalyticsEvent
|
|
@@ -10522,53 +10511,72 @@ function useCollectionEditorPlugin(t0) {
|
|
|
10522
10511
|
$[2] = configPermissions;
|
|
10523
10512
|
$[3] = extraView;
|
|
10524
10513
|
$[4] = getData;
|
|
10525
|
-
$[5] =
|
|
10526
|
-
$[6] =
|
|
10527
|
-
$[7] =
|
|
10528
|
-
$[8] =
|
|
10529
|
-
$[9] = t1;
|
|
10514
|
+
$[5] = getUser;
|
|
10515
|
+
$[6] = onAnalyticsEvent;
|
|
10516
|
+
$[7] = reservedGroups;
|
|
10517
|
+
$[8] = t2;
|
|
10530
10518
|
} else {
|
|
10531
|
-
|
|
10519
|
+
t2 = $[8];
|
|
10532
10520
|
}
|
|
10533
|
-
let t2;
|
|
10534
10521
|
let t3;
|
|
10535
|
-
if ($[
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10522
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10523
|
+
t3 = /* @__PURE__ */ jsx(NewCollectionButton, {});
|
|
10524
|
+
$[9] = t3;
|
|
10525
|
+
} else {
|
|
10526
|
+
t3 = $[9];
|
|
10527
|
+
}
|
|
10528
|
+
let t4;
|
|
10529
|
+
if ($[10] !== includeIntroView) {
|
|
10530
|
+
t4 = includeIntroView ? /* @__PURE__ */ jsx(IntroWidget, {}) : void 0;
|
|
10531
|
+
$[10] = includeIntroView;
|
|
10532
|
+
$[11] = t4;
|
|
10533
|
+
} else {
|
|
10534
|
+
t4 = $[11];
|
|
10535
|
+
}
|
|
10536
|
+
let t5;
|
|
10537
|
+
if ($[12] !== t4) {
|
|
10538
|
+
t5 = {
|
|
10539
|
+
additionalActions: t3,
|
|
10540
|
+
additionalChildrenStart: t4,
|
|
10539
10541
|
CollectionActions: HomePageEditorCollectionAction,
|
|
10540
10542
|
AdditionalCards: NewCollectionCard
|
|
10541
10543
|
};
|
|
10542
|
-
|
|
10544
|
+
$[12] = t4;
|
|
10545
|
+
$[13] = t5;
|
|
10546
|
+
} else {
|
|
10547
|
+
t5 = $[13];
|
|
10548
|
+
}
|
|
10549
|
+
let t6;
|
|
10550
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10551
|
+
t6 = {
|
|
10543
10552
|
CollectionActionsStart: EditorCollectionActionStart,
|
|
10544
10553
|
CollectionActions: EditorCollectionAction,
|
|
10545
10554
|
HeaderAction: CollectionViewHeaderAction,
|
|
10546
10555
|
AddColumnComponent: PropertyAddColumnComponent
|
|
10547
10556
|
};
|
|
10548
|
-
$[
|
|
10549
|
-
$[11] = t3;
|
|
10557
|
+
$[14] = t6;
|
|
10550
10558
|
} else {
|
|
10551
|
-
|
|
10552
|
-
t3 = $[11];
|
|
10559
|
+
t6 = $[14];
|
|
10553
10560
|
}
|
|
10554
|
-
let
|
|
10555
|
-
if ($[
|
|
10556
|
-
|
|
10561
|
+
let t7;
|
|
10562
|
+
if ($[15] !== collectionConfigController.loading || $[16] !== t2 || $[17] !== t5) {
|
|
10563
|
+
t7 = {
|
|
10557
10564
|
key: "collection_editor",
|
|
10558
10565
|
loading: collectionConfigController.loading,
|
|
10559
|
-
provider:
|
|
10560
|
-
homePage:
|
|
10561
|
-
collectionView:
|
|
10566
|
+
provider: t2,
|
|
10567
|
+
homePage: t5,
|
|
10568
|
+
collectionView: t6
|
|
10562
10569
|
};
|
|
10563
|
-
$[
|
|
10564
|
-
$[
|
|
10565
|
-
$[
|
|
10570
|
+
$[15] = collectionConfigController.loading;
|
|
10571
|
+
$[16] = t2;
|
|
10572
|
+
$[17] = t5;
|
|
10573
|
+
$[18] = t7;
|
|
10566
10574
|
} else {
|
|
10567
|
-
|
|
10575
|
+
t7 = $[18];
|
|
10568
10576
|
}
|
|
10569
|
-
return
|
|
10577
|
+
return t7;
|
|
10570
10578
|
}
|
|
10571
|
-
function IntroWidget(
|
|
10579
|
+
function IntroWidget() {
|
|
10572
10580
|
const $ = c(11);
|
|
10573
10581
|
const navigation = useNavigationController();
|
|
10574
10582
|
if (!navigation.topLevelNavigation) {
|
|
@@ -10576,35 +10584,35 @@ function IntroWidget(t0) {
|
|
|
10576
10584
|
}
|
|
10577
10585
|
const authController = useAuthController();
|
|
10578
10586
|
const collectionEditorController = useCollectionEditorController();
|
|
10579
|
-
let
|
|
10587
|
+
let t0;
|
|
10580
10588
|
if ($[0] !== authController || $[1] !== collectionEditorController) {
|
|
10581
|
-
|
|
10589
|
+
t0 = collectionEditorController.configPermissions ? collectionEditorController.configPermissions({
|
|
10582
10590
|
user: authController.user
|
|
10583
10591
|
}).createCollections : true;
|
|
10584
10592
|
$[0] = authController;
|
|
10585
10593
|
$[1] = collectionEditorController;
|
|
10586
|
-
$[2] =
|
|
10594
|
+
$[2] = t0;
|
|
10587
10595
|
} else {
|
|
10588
|
-
|
|
10596
|
+
t0 = $[2];
|
|
10589
10597
|
}
|
|
10590
|
-
const canCreateCollections =
|
|
10598
|
+
const canCreateCollections = t0;
|
|
10591
10599
|
if (!navigation.initialised || (navigation.collections ?? []).length > 0) {
|
|
10592
10600
|
return null;
|
|
10593
10601
|
}
|
|
10602
|
+
let t1;
|
|
10594
10603
|
let t2;
|
|
10595
|
-
let t3;
|
|
10596
10604
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10597
|
-
|
|
10598
|
-
|
|
10599
|
-
$[3] =
|
|
10600
|
-
$[4] =
|
|
10605
|
+
t1 = /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "uppercase", children: "No collections found" });
|
|
10606
|
+
t2 = /* @__PURE__ */ jsx(Typography, { children: "Start building collections in FireCMS easily. Map them to your existing database data, import from files, or use our templates." });
|
|
10607
|
+
$[3] = t1;
|
|
10608
|
+
$[4] = t2;
|
|
10601
10609
|
} else {
|
|
10602
|
-
|
|
10603
|
-
|
|
10610
|
+
t1 = $[3];
|
|
10611
|
+
t2 = $[4];
|
|
10604
10612
|
}
|
|
10605
|
-
let
|
|
10613
|
+
let t3;
|
|
10606
10614
|
if ($[5] !== canCreateCollections || $[6] !== collectionEditorController) {
|
|
10607
|
-
|
|
10615
|
+
t3 = canCreateCollections && /* @__PURE__ */ jsxs(Button, { onClick: collectionEditorController && canCreateCollections ? () => collectionEditorController.createCollection({
|
|
10608
10616
|
parentCollectionIds: [],
|
|
10609
10617
|
redirect: true,
|
|
10610
10618
|
sourceClick: "new_collection_card"
|
|
@@ -10614,31 +10622,31 @@ function IntroWidget(t0) {
|
|
|
10614
10622
|
] });
|
|
10615
10623
|
$[5] = canCreateCollections;
|
|
10616
10624
|
$[6] = collectionEditorController;
|
|
10617
|
-
$[7] =
|
|
10625
|
+
$[7] = t3;
|
|
10618
10626
|
} else {
|
|
10619
|
-
|
|
10627
|
+
t3 = $[7];
|
|
10620
10628
|
}
|
|
10621
|
-
let
|
|
10629
|
+
let t4;
|
|
10622
10630
|
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10623
|
-
|
|
10624
|
-
$[8] =
|
|
10631
|
+
t4 = /* @__PURE__ */ jsx(Typography, { color: "secondary", children: "You can also define collections programmatically." });
|
|
10632
|
+
$[8] = t4;
|
|
10625
10633
|
} else {
|
|
10626
|
-
|
|
10634
|
+
t4 = $[8];
|
|
10627
10635
|
}
|
|
10628
|
-
let
|
|
10629
|
-
if ($[9] !==
|
|
10630
|
-
|
|
10636
|
+
let t5;
|
|
10637
|
+
if ($[9] !== t3) {
|
|
10638
|
+
t5 = /* @__PURE__ */ jsxs(Paper, { className: "my-4 px-4 py-6 flex flex-col bg-white dark:bg-surface-accent-800 gap-2", children: [
|
|
10639
|
+
t1,
|
|
10631
10640
|
t2,
|
|
10632
10641
|
t3,
|
|
10633
|
-
t4
|
|
10634
|
-
t5
|
|
10642
|
+
t4
|
|
10635
10643
|
] });
|
|
10636
|
-
$[9] =
|
|
10637
|
-
$[10] =
|
|
10644
|
+
$[9] = t3;
|
|
10645
|
+
$[10] = t5;
|
|
10638
10646
|
} else {
|
|
10639
|
-
|
|
10647
|
+
t5 = $[10];
|
|
10640
10648
|
}
|
|
10641
|
-
return
|
|
10649
|
+
return t5;
|
|
10642
10650
|
}
|
|
10643
10651
|
const mergeCollections = (baseCollections, backendCollections = [], modifyCollection) => {
|
|
10644
10652
|
const markAsEditable = (c2) => {
|