@firecms/collection_editor 3.0.0-beta.13 → 3.0.0-beta.15
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/README.md +165 -1
- package/dist/ConfigControllerProvider.d.ts +0 -1
- package/dist/index.es.js +1620 -948
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1616 -947
- package/dist/index.umd.js.map +1 -1
- package/dist/types/collection_editor_controller.d.ts +0 -1
- package/dist/types/collection_inference.d.ts +3 -0
- package/dist/types/config_controller.d.ts +3 -1
- package/dist/ui/EditorEntityAction.d.ts +2 -0
- package/dist/ui/collection_editor/CollectionEditorWelcomeView.d.ts +1 -1
- package/dist/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +1 -1
- package/dist/ui/collection_editor/EntityActionsEditTab.d.ts +4 -0
- package/dist/ui/collection_editor/EntityActionsSelectDialog.d.ts +4 -0
- package/dist/ui/collection_editor/PropertyTree.d.ts +2 -3
- package/dist/ui/collection_editor/properties/ReferencePropertyField.d.ts +2 -1
- package/dist/useCollectionEditorPlugin.d.ts +3 -3
- package/package.json +8 -9
- package/src/ConfigControllerProvider.tsx +0 -5
- package/src/types/collection_editor_controller.tsx +0 -2
- package/src/types/collection_inference.ts +3 -0
- package/src/types/config_controller.tsx +4 -1
- package/src/ui/EditorCollectionAction.tsx +2 -7
- package/src/ui/EditorEntityAction.tsx +51 -0
- package/src/ui/HomePageEditorCollectionAction.tsx +2 -1
- package/src/ui/collection_editor/CollectionDetailsForm.tsx +69 -37
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +18 -5
- package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +15 -25
- package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +8 -6
- package/src/ui/collection_editor/EntityActionsEditTab.tsx +163 -0
- package/src/ui/collection_editor/EntityActionsSelectDialog.tsx +41 -0
- package/src/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +5 -2
- package/src/ui/collection_editor/GetCodeDialog.tsx +5 -3
- package/src/ui/collection_editor/PropertyEditView.tsx +11 -3
- package/src/ui/collection_editor/PropertyFieldPreview.tsx +1 -0
- package/src/ui/collection_editor/PropertyTree.tsx +183 -139
- package/src/ui/collection_editor/UnsavedChangesDialog.tsx +6 -2
- package/src/ui/collection_editor/properties/MapPropertyField.tsx +1 -1
- package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +5 -3
- package/src/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +2 -0
- package/src/ui/collection_editor/utils/supported_fields.tsx +1 -0
- package/src/ui/collection_editor/utils/update_property_for_widget.ts +9 -0
- package/src/useCollectionEditorPlugin.tsx +12 -7
- package/src/utils/collections.ts +15 -5
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("react-compiler-runtime"), require("@firecms/core"), require("react"), require("react-fast-compare"), require("@firecms/ui"), require("yup"), require("@firecms/formex"), require("@firecms/schema_inference"), require("@
|
|
3
|
-
})(this, function(exports2, jsxRuntime, reactCompilerRuntime, core, React, equal, ui, Yup, formex, schema_inference,
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("react-compiler-runtime"), require("@firecms/core"), require("react"), require("react-fast-compare"), require("@firecms/ui"), require("yup"), require("@firecms/formex"), require("@firecms/schema_inference"), require("@dnd-kit/core"), require("@dnd-kit/sortable"), require("@dnd-kit/modifiers"), require("@dnd-kit/utilities"), require("json5"), require("prism-react-renderer"), require("@firecms/data_import_export"), require("react-router")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "react-compiler-runtime", "@firecms/core", "react", "react-fast-compare", "@firecms/ui", "yup", "@firecms/formex", "@firecms/schema_inference", "@dnd-kit/core", "@dnd-kit/sortable", "@dnd-kit/modifiers", "@dnd-kit/utilities", "json5", "prism-react-renderer", "@firecms/data_import_export", "react-router"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["FireCMS collection editor"] = {}, global.jsxRuntime, global.reactCompilerRuntime, global.core, global.React, global.equal, global.ui, global.Yup, global.formex, global.schema_inference, global.core$1, global.sortable, global.modifiers, global.utilities, global.JSON5, global.prismReactRenderer, global.data_import_export, global.reactRouter));
|
|
3
|
+
})(this, function(exports2, jsxRuntime, reactCompilerRuntime, core, React, equal, ui, Yup, formex, schema_inference, core$1, sortable, modifiers, utilities, JSON5, prismReactRenderer, data_import_export, reactRouter) {
|
|
4
4
|
"use strict";
|
|
5
5
|
function _interopNamespaceDefault(e) {
|
|
6
6
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
return t18;
|
|
170
170
|
}
|
|
171
171
|
function CollectionDetailsForm(t0) {
|
|
172
|
-
const $ = reactCompilerRuntime.c(
|
|
172
|
+
const $ = reactCompilerRuntime.c(192);
|
|
173
173
|
const {
|
|
174
174
|
isNewCollection,
|
|
175
175
|
reservedGroups,
|
|
@@ -185,7 +185,6 @@
|
|
|
185
185
|
touched,
|
|
186
186
|
errors,
|
|
187
187
|
setFieldTouched,
|
|
188
|
-
isSubmitting,
|
|
189
188
|
submitCount
|
|
190
189
|
} = formex.useFormex();
|
|
191
190
|
useCollectionEditorController();
|
|
@@ -253,7 +252,7 @@
|
|
|
253
252
|
t5 = $[10];
|
|
254
253
|
}
|
|
255
254
|
const collectionIcon = t5;
|
|
256
|
-
|
|
255
|
+
groups?.filter((group) => !reservedGroups?.includes(group));
|
|
257
256
|
let t6;
|
|
258
257
|
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
259
258
|
t6 = {
|
|
@@ -263,10 +262,7 @@
|
|
|
263
262
|
} else {
|
|
264
263
|
t6 = $[11];
|
|
265
264
|
}
|
|
266
|
-
|
|
267
|
-
autoCompleteOpen,
|
|
268
|
-
setAutoCompleteOpen
|
|
269
|
-
} = ui.useAutoComplete(t6);
|
|
265
|
+
ui.useAutoComplete(t6);
|
|
270
266
|
const isSubcollection = !!parentCollection;
|
|
271
267
|
let customIdValue;
|
|
272
268
|
if (typeof values.customId === "object") {
|
|
@@ -285,290 +281,316 @@
|
|
|
285
281
|
}
|
|
286
282
|
}
|
|
287
283
|
const showErrors = submitCount > 0;
|
|
288
|
-
const t7 = "
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
t12 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: t10, className: "flex-grow", children: t11 });
|
|
297
|
-
$[12] = t10;
|
|
298
|
-
$[13] = t11;
|
|
299
|
-
$[14] = t12;
|
|
284
|
+
const t7 = !isNewCollection ? "h5" : "h4";
|
|
285
|
+
const t8 = isNewCollection ? "New collection" : `${values?.name} collection`;
|
|
286
|
+
let t9;
|
|
287
|
+
if ($[12] !== t7 || $[13] !== t8) {
|
|
288
|
+
t9 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: t7, className: "flex-grow", children: t8 });
|
|
289
|
+
$[12] = t7;
|
|
290
|
+
$[13] = t8;
|
|
291
|
+
$[14] = t9;
|
|
300
292
|
} else {
|
|
301
|
-
|
|
293
|
+
t9 = $[14];
|
|
302
294
|
}
|
|
303
|
-
let
|
|
295
|
+
let t10;
|
|
304
296
|
if ($[15] !== updateDatabaseId || $[16] !== values.databaseId) {
|
|
305
|
-
|
|
297
|
+
t10 = /* @__PURE__ */ jsxRuntime.jsx(DefaultDatabaseField, { databaseId: values.databaseId, onDatabaseIdUpdate: updateDatabaseId });
|
|
306
298
|
$[15] = updateDatabaseId;
|
|
307
299
|
$[16] = values.databaseId;
|
|
308
|
-
$[17] =
|
|
300
|
+
$[17] = t10;
|
|
309
301
|
} else {
|
|
310
|
-
|
|
302
|
+
t10 = $[17];
|
|
311
303
|
}
|
|
312
|
-
let
|
|
304
|
+
let t11;
|
|
313
305
|
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
314
|
-
|
|
315
|
-
$[18] =
|
|
306
|
+
t11 = () => setIconDialogOpen(true);
|
|
307
|
+
$[18] = t11;
|
|
316
308
|
} else {
|
|
317
|
-
|
|
309
|
+
t11 = $[18];
|
|
318
310
|
}
|
|
319
|
-
let
|
|
311
|
+
let t12;
|
|
320
312
|
if ($[19] !== collectionIcon) {
|
|
321
|
-
|
|
313
|
+
t12 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Change icon", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { shape: "square", onClick: t11, children: collectionIcon }) });
|
|
322
314
|
$[19] = collectionIcon;
|
|
323
|
-
$[20] =
|
|
315
|
+
$[20] = t12;
|
|
324
316
|
} else {
|
|
325
|
-
|
|
317
|
+
t12 = $[20];
|
|
326
318
|
}
|
|
327
|
-
let
|
|
328
|
-
if ($[21] !==
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
319
|
+
let t13;
|
|
320
|
+
if ($[21] !== t10 || $[22] !== t12 || $[23] !== t9) {
|
|
321
|
+
t13 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row gap-2 py-2 pt-3 items-center", children: [
|
|
322
|
+
t9,
|
|
323
|
+
t10,
|
|
324
|
+
t12
|
|
333
325
|
] });
|
|
334
|
-
$[21] =
|
|
335
|
-
$[22] =
|
|
336
|
-
$[23] =
|
|
337
|
-
$[24] =
|
|
326
|
+
$[21] = t10;
|
|
327
|
+
$[22] = t12;
|
|
328
|
+
$[23] = t9;
|
|
329
|
+
$[24] = t13;
|
|
338
330
|
} else {
|
|
339
|
-
|
|
331
|
+
t13 = $[24];
|
|
340
332
|
}
|
|
341
|
-
let
|
|
333
|
+
let t14;
|
|
342
334
|
if ($[25] !== parentCollection) {
|
|
343
|
-
|
|
335
|
+
t14 = parentCollection && /* @__PURE__ */ jsxRuntime.jsx(ui.Chip, { colorScheme: "tealDarker", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "caption", children: [
|
|
344
336
|
"This is a subcollection of ",
|
|
345
337
|
/* @__PURE__ */ jsxRuntime.jsx("b", { children: parentCollection.name })
|
|
346
338
|
] }) });
|
|
347
339
|
$[25] = parentCollection;
|
|
348
|
-
$[26] =
|
|
340
|
+
$[26] = t14;
|
|
349
341
|
} else {
|
|
350
|
-
|
|
342
|
+
t14 = $[26];
|
|
351
343
|
}
|
|
352
|
-
let
|
|
353
|
-
if ($[27] !==
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
344
|
+
let t15;
|
|
345
|
+
if ($[27] !== t13 || $[28] !== t14) {
|
|
346
|
+
t15 = /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
347
|
+
t13,
|
|
348
|
+
t14
|
|
357
349
|
] });
|
|
358
|
-
$[27] =
|
|
359
|
-
$[28] =
|
|
360
|
-
$[29] =
|
|
350
|
+
$[27] = t13;
|
|
351
|
+
$[28] = t14;
|
|
352
|
+
$[29] = t15;
|
|
361
353
|
} else {
|
|
362
|
-
|
|
354
|
+
t15 = $[29];
|
|
363
355
|
}
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
let t21;
|
|
356
|
+
const t16 = values.name ?? "";
|
|
357
|
+
let t17;
|
|
367
358
|
if ($[30] !== updateName) {
|
|
368
|
-
|
|
359
|
+
t17 = (e) => updateName(e.target.value);
|
|
369
360
|
$[30] = updateName;
|
|
370
|
-
$[31] =
|
|
361
|
+
$[31] = t17;
|
|
362
|
+
} else {
|
|
363
|
+
t17 = $[31];
|
|
364
|
+
}
|
|
365
|
+
const t18 = showErrors && Boolean(errors.name);
|
|
366
|
+
let t19;
|
|
367
|
+
if ($[32] !== t16 || $[33] !== t17 || $[34] !== t18) {
|
|
368
|
+
t19 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { value: t16, onChange: t17, label: "Name", autoFocus: true, required: true, error: t18 });
|
|
369
|
+
$[32] = t16;
|
|
370
|
+
$[33] = t17;
|
|
371
|
+
$[34] = t18;
|
|
372
|
+
$[35] = t19;
|
|
371
373
|
} else {
|
|
372
|
-
|
|
374
|
+
t19 = $[35];
|
|
375
|
+
}
|
|
376
|
+
const t20 = touched.name && Boolean(errors.name);
|
|
377
|
+
const t21 = touched.name && Boolean(errors.name) ? errors.name : "Name of this collection, usually a plural name (e.g. Products)";
|
|
378
|
+
let t22;
|
|
379
|
+
if ($[36] !== t20 || $[37] !== t21) {
|
|
380
|
+
t22 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t20, children: t21 });
|
|
381
|
+
$[36] = t20;
|
|
382
|
+
$[37] = t21;
|
|
383
|
+
$[38] = t22;
|
|
384
|
+
} else {
|
|
385
|
+
t22 = $[38];
|
|
373
386
|
}
|
|
374
|
-
const t22 = showErrors && Boolean(errors.name);
|
|
375
387
|
let t23;
|
|
376
|
-
if ($[
|
|
377
|
-
t23 = /* @__PURE__ */ jsxRuntime.
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
$[
|
|
388
|
+
if ($[39] !== t19 || $[40] !== t22) {
|
|
389
|
+
t23 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
|
|
390
|
+
t19,
|
|
391
|
+
t22
|
|
392
|
+
] });
|
|
393
|
+
$[39] = t19;
|
|
394
|
+
$[40] = t22;
|
|
395
|
+
$[41] = t23;
|
|
382
396
|
} else {
|
|
383
|
-
t23 = $[
|
|
397
|
+
t23 = $[41];
|
|
384
398
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
t26 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t24, children: t25 });
|
|
390
|
-
$[36] = t24;
|
|
391
|
-
$[37] = t25;
|
|
392
|
-
$[38] = t26;
|
|
399
|
+
let t24;
|
|
400
|
+
if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
|
|
401
|
+
t24 = ui.cls("col-span-12 ");
|
|
402
|
+
$[42] = t24;
|
|
393
403
|
} else {
|
|
394
|
-
|
|
404
|
+
t24 = $[42];
|
|
395
405
|
}
|
|
406
|
+
const t25 = !isNewCollection;
|
|
407
|
+
const t26 = showErrors && Boolean(errors.path);
|
|
396
408
|
let t27;
|
|
397
|
-
if ($[
|
|
398
|
-
t27 = /* @__PURE__ */ jsxRuntime.
|
|
399
|
-
|
|
400
|
-
|
|
409
|
+
if ($[43] !== t25 || $[44] !== t26) {
|
|
410
|
+
t27 = /* @__PURE__ */ jsxRuntime.jsx(formex.Field, { name: "path", as: ui.DebouncedTextField, label: "Path", disabled: t25, required: true, error: t26 });
|
|
411
|
+
$[43] = t25;
|
|
412
|
+
$[44] = t26;
|
|
413
|
+
$[45] = t27;
|
|
414
|
+
} else {
|
|
415
|
+
t27 = $[45];
|
|
416
|
+
}
|
|
417
|
+
const t28 = touched.path && Boolean(errors.path);
|
|
418
|
+
const t29 = touched.path && Boolean(errors.path) ? errors.path : isSubcollection ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database";
|
|
419
|
+
let t30;
|
|
420
|
+
if ($[46] !== t28 || $[47] !== t29) {
|
|
421
|
+
t30 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t28, children: t29 });
|
|
422
|
+
$[46] = t28;
|
|
423
|
+
$[47] = t29;
|
|
424
|
+
$[48] = t30;
|
|
425
|
+
} else {
|
|
426
|
+
t30 = $[48];
|
|
427
|
+
}
|
|
428
|
+
let t31;
|
|
429
|
+
if ($[49] !== t27 || $[50] !== t30) {
|
|
430
|
+
t31 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t24, children: [
|
|
431
|
+
t27,
|
|
432
|
+
t30
|
|
401
433
|
] });
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
434
|
+
$[49] = t27;
|
|
435
|
+
$[50] = t30;
|
|
436
|
+
$[51] = t31;
|
|
405
437
|
} else {
|
|
406
|
-
|
|
438
|
+
t31 = $[51];
|
|
407
439
|
}
|
|
408
|
-
const
|
|
409
|
-
let
|
|
410
|
-
if ($[
|
|
411
|
-
|
|
412
|
-
$[
|
|
413
|
-
$[
|
|
414
|
-
} else {
|
|
415
|
-
|
|
416
|
-
}
|
|
417
|
-
const t30 = !isNewCollection;
|
|
418
|
-
const t31 = showErrors && Boolean(errors.path);
|
|
419
|
-
let t32;
|
|
420
|
-
if ($[44] !== t30 || $[45] !== t31) {
|
|
421
|
-
t32 = /* @__PURE__ */ jsxRuntime.jsx(formex.Field, { name: "path", as: ui.DebouncedTextField, label: "Path", disabled: t30, required: true, error: t31 });
|
|
422
|
-
$[44] = t30;
|
|
423
|
-
$[45] = t31;
|
|
424
|
-
$[46] = t32;
|
|
425
|
-
} else {
|
|
426
|
-
t32 = $[46];
|
|
427
|
-
}
|
|
428
|
-
const t33 = touched.path && Boolean(errors.path);
|
|
429
|
-
const t34 = touched.path && Boolean(errors.path) ? errors.path : isSubcollection ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database";
|
|
430
|
-
let t35;
|
|
431
|
-
if ($[47] !== t33 || $[48] !== t34) {
|
|
432
|
-
t35 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t33, children: t34 });
|
|
433
|
-
$[47] = t33;
|
|
434
|
-
$[48] = t34;
|
|
435
|
-
$[49] = t35;
|
|
436
|
-
} else {
|
|
437
|
-
t35 = $[49];
|
|
440
|
+
const t32 = values.openEntityMode ?? "side_panel";
|
|
441
|
+
let t33;
|
|
442
|
+
if ($[52] !== setFieldValue) {
|
|
443
|
+
t33 = (value) => setFieldValue("openEntityMode", value);
|
|
444
|
+
$[52] = setFieldValue;
|
|
445
|
+
$[53] = t33;
|
|
446
|
+
} else {
|
|
447
|
+
t33 = $[53];
|
|
438
448
|
}
|
|
449
|
+
let t34;
|
|
450
|
+
if ($[54] !== t32 || $[55] !== t33) {
|
|
451
|
+
t34 = /* @__PURE__ */ jsxRuntime.jsx(LayoutModeSwitch, { className: "col-span-12", value: t32, onChange: t33 });
|
|
452
|
+
$[54] = t32;
|
|
453
|
+
$[55] = t33;
|
|
454
|
+
$[56] = t34;
|
|
455
|
+
} else {
|
|
456
|
+
t34 = $[56];
|
|
457
|
+
}
|
|
458
|
+
const t35 = values.history === null || values.history === void 0 ? "Document history revisions enabled if enabled globally" : values.history ? "Document history revisions ENABLED" : "Document history revisions NOT enabled";
|
|
439
459
|
let t36;
|
|
440
|
-
if ($[
|
|
441
|
-
t36 =
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
$[
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
/* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: showErrors && Boolean(errors.group) ? errors.group : "Group in the home page" })
|
|
459
|
-
] });
|
|
460
|
-
const t38 = values.openEntityMode ?? "side_panel";
|
|
460
|
+
if ($[57] !== setFieldValue) {
|
|
461
|
+
t36 = (v) => setFieldValue("history", v);
|
|
462
|
+
$[57] = setFieldValue;
|
|
463
|
+
$[58] = t36;
|
|
464
|
+
} else {
|
|
465
|
+
t36 = $[58];
|
|
466
|
+
}
|
|
467
|
+
const t37 = values.history === void 0 ? null : values.history;
|
|
468
|
+
let t38;
|
|
469
|
+
if ($[59] !== t35 || $[60] !== t36 || $[61] !== t37) {
|
|
470
|
+
t38 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "large", allowIndeterminate: true, label: t35, onValueChange: t36, value: t37 });
|
|
471
|
+
$[59] = t35;
|
|
472
|
+
$[60] = t36;
|
|
473
|
+
$[61] = t37;
|
|
474
|
+
$[62] = t38;
|
|
475
|
+
} else {
|
|
476
|
+
t38 = $[62];
|
|
477
|
+
}
|
|
461
478
|
let t39;
|
|
462
|
-
if ($[
|
|
463
|
-
t39 =
|
|
464
|
-
|
|
465
|
-
|
|
479
|
+
if ($[63] === Symbol.for("react.memo_cache_sentinel")) {
|
|
480
|
+
t39 = /* @__PURE__ */ jsxRuntime.jsxs(core.FieldCaption, { children: [
|
|
481
|
+
"When enabled, each document in this collection will have a history of changes. This is useful for auditing purposes. The data is stored in a subcollection of the document in your database, called ",
|
|
482
|
+
/* @__PURE__ */ jsxRuntime.jsx("b", { children: "__history" }),
|
|
483
|
+
"."
|
|
484
|
+
] });
|
|
485
|
+
$[63] = t39;
|
|
466
486
|
} else {
|
|
467
|
-
t39 = $[
|
|
487
|
+
t39 = $[63];
|
|
468
488
|
}
|
|
469
489
|
let t40;
|
|
470
|
-
if ($[
|
|
471
|
-
t40 = /* @__PURE__ */ jsxRuntime.
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
490
|
+
if ($[64] !== t38) {
|
|
491
|
+
t40 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
|
|
492
|
+
t38,
|
|
493
|
+
t39
|
|
494
|
+
] });
|
|
495
|
+
$[64] = t38;
|
|
496
|
+
$[65] = t40;
|
|
475
497
|
} else {
|
|
476
|
-
t40 = $[
|
|
498
|
+
t40 = $[65];
|
|
477
499
|
}
|
|
478
500
|
let t41;
|
|
479
|
-
if ($[
|
|
501
|
+
if ($[66] === Symbol.for("react.memo_cache_sentinel")) {
|
|
480
502
|
t41 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row text-surface-500", children: [
|
|
481
503
|
/* @__PURE__ */ jsxRuntime.jsx(ui.SettingsIcon, {}),
|
|
482
504
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "ml-2", children: "Advanced" })
|
|
483
505
|
] });
|
|
484
|
-
$[
|
|
506
|
+
$[66] = t41;
|
|
485
507
|
} else {
|
|
486
|
-
t41 = $[
|
|
508
|
+
t41 = $[66];
|
|
487
509
|
}
|
|
488
510
|
const t42 = !isNewCollection;
|
|
489
511
|
const t43 = showErrors && Boolean(errors.id);
|
|
490
512
|
let t44;
|
|
491
|
-
if ($[
|
|
513
|
+
if ($[67] !== t42 || $[68] !== t43) {
|
|
492
514
|
t44 = /* @__PURE__ */ jsxRuntime.jsx(formex.Field, { name: "id", as: ui.DebouncedTextField, disabled: t42, label: "Collection id", error: t43 });
|
|
493
|
-
$[
|
|
494
|
-
$[
|
|
495
|
-
$[
|
|
515
|
+
$[67] = t42;
|
|
516
|
+
$[68] = t43;
|
|
517
|
+
$[69] = t44;
|
|
496
518
|
} else {
|
|
497
|
-
t44 = $[
|
|
519
|
+
t44 = $[69];
|
|
498
520
|
}
|
|
499
521
|
const t45 = touched.id && Boolean(errors.id);
|
|
500
522
|
const t46 = touched.id && Boolean(errors.id) ? errors.id : "This id identifies this collection. Typically the same as the path.";
|
|
501
523
|
let t47;
|
|
502
|
-
if ($[
|
|
524
|
+
if ($[70] !== t45 || $[71] !== t46) {
|
|
503
525
|
t47 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t45, children: t46 });
|
|
504
|
-
$[
|
|
505
|
-
$[
|
|
506
|
-
$[
|
|
526
|
+
$[70] = t45;
|
|
527
|
+
$[71] = t46;
|
|
528
|
+
$[72] = t47;
|
|
507
529
|
} else {
|
|
508
|
-
t47 = $[
|
|
530
|
+
t47 = $[72];
|
|
509
531
|
}
|
|
510
532
|
let t48;
|
|
511
|
-
if ($[
|
|
533
|
+
if ($[73] !== t44 || $[74] !== t47) {
|
|
512
534
|
t48 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
|
|
513
535
|
t44,
|
|
514
536
|
t47
|
|
515
537
|
] });
|
|
516
|
-
$[
|
|
517
|
-
$[
|
|
518
|
-
$[
|
|
538
|
+
$[73] = t44;
|
|
539
|
+
$[74] = t47;
|
|
540
|
+
$[75] = t48;
|
|
519
541
|
} else {
|
|
520
|
-
t48 = $[
|
|
542
|
+
t48 = $[75];
|
|
521
543
|
}
|
|
522
544
|
const t49 = showErrors && Boolean(errors.singularName);
|
|
523
545
|
let t50;
|
|
524
|
-
if ($[
|
|
546
|
+
if ($[76] !== handleChange || $[77] !== setFieldTouched) {
|
|
525
547
|
t50 = (e_0) => {
|
|
526
548
|
setFieldTouched("singularName", true);
|
|
527
549
|
return handleChange(e_0);
|
|
528
550
|
};
|
|
529
|
-
$[
|
|
530
|
-
$[
|
|
531
|
-
$[
|
|
551
|
+
$[76] = handleChange;
|
|
552
|
+
$[77] = setFieldTouched;
|
|
553
|
+
$[78] = t50;
|
|
532
554
|
} else {
|
|
533
|
-
t50 = $[
|
|
555
|
+
t50 = $[78];
|
|
534
556
|
}
|
|
535
557
|
const t51 = values.singularName ?? "";
|
|
536
558
|
let t52;
|
|
537
|
-
if ($[
|
|
559
|
+
if ($[79] !== t49 || $[80] !== t50 || $[81] !== t51) {
|
|
538
560
|
t52 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { error: t49, name: "singularName", "aria-describedby": "singularName-helper", onChange: t50, value: t51, label: "Singular name" });
|
|
539
|
-
$[
|
|
540
|
-
$[
|
|
541
|
-
$[
|
|
542
|
-
$[
|
|
561
|
+
$[79] = t49;
|
|
562
|
+
$[80] = t50;
|
|
563
|
+
$[81] = t51;
|
|
564
|
+
$[82] = t52;
|
|
543
565
|
} else {
|
|
544
|
-
t52 = $[
|
|
566
|
+
t52 = $[82];
|
|
545
567
|
}
|
|
546
568
|
const t53 = showErrors && Boolean(errors.singularName);
|
|
547
569
|
const t54 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define a singular name for your entities";
|
|
548
570
|
let t55;
|
|
549
|
-
if ($[
|
|
571
|
+
if ($[83] !== t53 || $[84] !== t54) {
|
|
550
572
|
t55 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t53, children: t54 });
|
|
551
|
-
$[
|
|
552
|
-
$[
|
|
553
|
-
$[
|
|
573
|
+
$[83] = t53;
|
|
574
|
+
$[84] = t54;
|
|
575
|
+
$[85] = t55;
|
|
554
576
|
} else {
|
|
555
|
-
t55 = $[
|
|
577
|
+
t55 = $[85];
|
|
556
578
|
}
|
|
557
579
|
let t56;
|
|
558
|
-
if ($[
|
|
580
|
+
if ($[86] !== t52 || $[87] !== t55) {
|
|
559
581
|
t56 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
|
|
560
582
|
t52,
|
|
561
583
|
t55
|
|
562
584
|
] });
|
|
563
|
-
$[
|
|
564
|
-
$[
|
|
565
|
-
$[
|
|
585
|
+
$[86] = t52;
|
|
586
|
+
$[87] = t55;
|
|
587
|
+
$[88] = t56;
|
|
566
588
|
} else {
|
|
567
|
-
t56 = $[
|
|
589
|
+
t56 = $[88];
|
|
568
590
|
}
|
|
569
591
|
const t57 = showErrors && Boolean(errors.sideDialogWidth);
|
|
570
592
|
let t58;
|
|
571
|
-
if ($[
|
|
593
|
+
if ($[89] !== setFieldTouched || $[90] !== setFieldValue) {
|
|
572
594
|
t58 = (e_1) => {
|
|
573
595
|
setFieldTouched("sideDialogWidth", true);
|
|
574
596
|
const value_0 = e_1.target.value;
|
|
@@ -580,362 +602,402 @@
|
|
|
580
602
|
}
|
|
581
603
|
}
|
|
582
604
|
};
|
|
583
|
-
$[
|
|
584
|
-
$[
|
|
585
|
-
$[
|
|
605
|
+
$[89] = setFieldTouched;
|
|
606
|
+
$[90] = setFieldValue;
|
|
607
|
+
$[91] = t58;
|
|
586
608
|
} else {
|
|
587
|
-
t58 = $[
|
|
609
|
+
t58 = $[91];
|
|
588
610
|
}
|
|
589
611
|
let t59;
|
|
590
|
-
if ($[
|
|
612
|
+
if ($[92] !== setFieldValue) {
|
|
591
613
|
t59 = () => {
|
|
592
614
|
setFieldValue("sideDialogWidth", null);
|
|
593
615
|
};
|
|
594
|
-
$[
|
|
595
|
-
$[
|
|
616
|
+
$[92] = setFieldValue;
|
|
617
|
+
$[93] = t59;
|
|
596
618
|
} else {
|
|
597
|
-
t59 = $[
|
|
619
|
+
t59 = $[93];
|
|
598
620
|
}
|
|
599
621
|
const t60 = !values.sideDialogWidth;
|
|
600
622
|
let t61;
|
|
601
|
-
if ($[
|
|
623
|
+
if ($[94] === Symbol.for("react.memo_cache_sentinel")) {
|
|
602
624
|
t61 = /* @__PURE__ */ jsxRuntime.jsx(ui.CloseIcon, { size: "small" });
|
|
603
|
-
$[
|
|
625
|
+
$[94] = t61;
|
|
604
626
|
} else {
|
|
605
|
-
t61 = $[
|
|
627
|
+
t61 = $[94];
|
|
606
628
|
}
|
|
607
629
|
let t62;
|
|
608
|
-
if ($[
|
|
630
|
+
if ($[95] !== t59 || $[96] !== t60) {
|
|
609
631
|
t62 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: t59, disabled: t60, children: t61 });
|
|
610
|
-
$[
|
|
611
|
-
$[
|
|
612
|
-
$[
|
|
632
|
+
$[95] = t59;
|
|
633
|
+
$[96] = t60;
|
|
634
|
+
$[97] = t62;
|
|
613
635
|
} else {
|
|
614
|
-
t62 = $[
|
|
636
|
+
t62 = $[97];
|
|
615
637
|
}
|
|
616
638
|
const t63 = values.sideDialogWidth ?? "";
|
|
617
639
|
let t64;
|
|
618
|
-
if ($[
|
|
640
|
+
if ($[98] !== t57 || $[99] !== t58 || $[100] !== t62 || $[101] !== t63) {
|
|
619
641
|
t64 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { error: t57, name: "sideDialogWidth", type: "number", "aria-describedby": "sideDialogWidth-helper", onChange: t58, endAdornment: t62, value: t63, label: "Side dialog width" });
|
|
620
|
-
$[
|
|
621
|
-
$[
|
|
622
|
-
$[
|
|
623
|
-
$[
|
|
624
|
-
$[
|
|
642
|
+
$[98] = t57;
|
|
643
|
+
$[99] = t58;
|
|
644
|
+
$[100] = t62;
|
|
645
|
+
$[101] = t63;
|
|
646
|
+
$[102] = t64;
|
|
625
647
|
} else {
|
|
626
|
-
t64 = $[
|
|
648
|
+
t64 = $[102];
|
|
627
649
|
}
|
|
628
650
|
const t65 = showErrors && Boolean(errors.singularName);
|
|
629
651
|
const t66 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px";
|
|
630
652
|
let t67;
|
|
631
|
-
if ($[
|
|
653
|
+
if ($[103] !== t65 || $[104] !== t66) {
|
|
632
654
|
t67 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t65, children: t66 });
|
|
633
|
-
$[
|
|
634
|
-
$[
|
|
635
|
-
$[
|
|
655
|
+
$[103] = t65;
|
|
656
|
+
$[104] = t66;
|
|
657
|
+
$[105] = t67;
|
|
636
658
|
} else {
|
|
637
|
-
t67 = $[
|
|
659
|
+
t67 = $[105];
|
|
638
660
|
}
|
|
639
661
|
let t68;
|
|
640
|
-
if ($[
|
|
662
|
+
if ($[106] !== t64 || $[107] !== t67) {
|
|
641
663
|
t68 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
|
|
642
664
|
t64,
|
|
643
665
|
t67
|
|
644
666
|
] });
|
|
645
|
-
$[
|
|
646
|
-
$[
|
|
647
|
-
$[
|
|
667
|
+
$[106] = t64;
|
|
668
|
+
$[107] = t67;
|
|
669
|
+
$[108] = t68;
|
|
648
670
|
} else {
|
|
649
|
-
t68 = $[
|
|
671
|
+
t68 = $[108];
|
|
650
672
|
}
|
|
651
673
|
const t69 = showErrors && Boolean(errors.description);
|
|
652
674
|
const t70 = values.description ?? "";
|
|
653
675
|
let t71;
|
|
654
|
-
if ($[
|
|
676
|
+
if ($[109] !== handleChange || $[110] !== t69 || $[111] !== t70) {
|
|
655
677
|
t71 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { error: t69, name: "description", value: t70, onChange: handleChange, multiline: true, minRows: 2, "aria-describedby": "description-helper-text", label: "Description" });
|
|
656
|
-
$[
|
|
657
|
-
$[
|
|
658
|
-
$[
|
|
659
|
-
$[
|
|
678
|
+
$[109] = handleChange;
|
|
679
|
+
$[110] = t69;
|
|
680
|
+
$[111] = t70;
|
|
681
|
+
$[112] = t71;
|
|
660
682
|
} else {
|
|
661
|
-
t71 = $[
|
|
683
|
+
t71 = $[112];
|
|
662
684
|
}
|
|
663
685
|
const t72 = showErrors && Boolean(errors.description);
|
|
664
686
|
const t73 = showErrors && Boolean(errors.description) ? errors.description : "Description of the collection, you can use markdown";
|
|
665
687
|
let t74;
|
|
666
|
-
if ($[
|
|
688
|
+
if ($[113] !== t72 || $[114] !== t73) {
|
|
667
689
|
t74 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t72, children: t73 });
|
|
668
|
-
$[
|
|
669
|
-
$[
|
|
670
|
-
$[
|
|
690
|
+
$[113] = t72;
|
|
691
|
+
$[114] = t73;
|
|
692
|
+
$[115] = t74;
|
|
671
693
|
} else {
|
|
672
|
-
t74 = $[
|
|
694
|
+
t74 = $[115];
|
|
673
695
|
}
|
|
674
696
|
let t75;
|
|
675
|
-
if ($[
|
|
697
|
+
if ($[116] !== t71 || $[117] !== t74) {
|
|
676
698
|
t75 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
|
|
677
699
|
t71,
|
|
678
700
|
t74
|
|
679
701
|
] });
|
|
680
|
-
$[
|
|
681
|
-
$[
|
|
682
|
-
$[
|
|
702
|
+
$[116] = t71;
|
|
703
|
+
$[117] = t74;
|
|
704
|
+
$[118] = t75;
|
|
683
705
|
} else {
|
|
684
|
-
t75 = $[
|
|
706
|
+
t75 = $[118];
|
|
685
707
|
}
|
|
686
708
|
const t76 = values.defaultSize ?? "";
|
|
687
709
|
let t77;
|
|
688
|
-
if ($[
|
|
689
|
-
t77 = ["xs", "s", "m", "l", "xl"].map(_temp2$
|
|
690
|
-
$[
|
|
710
|
+
if ($[119] === Symbol.for("react.memo_cache_sentinel")) {
|
|
711
|
+
t77 = ["xs", "s", "m", "l", "xl"].map(_temp2$8);
|
|
712
|
+
$[119] = t77;
|
|
691
713
|
} else {
|
|
692
|
-
t77 = $[
|
|
714
|
+
t77 = $[119];
|
|
693
715
|
}
|
|
694
716
|
let t78;
|
|
695
|
-
if ($[
|
|
696
|
-
t78 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { name: "defaultSize", size: "large", fullWidth: true, label: "Default row size", position: "item-aligned", onChange: handleChange, value: t76, renderValue: _temp$
|
|
697
|
-
$[
|
|
698
|
-
$[
|
|
699
|
-
$[
|
|
717
|
+
if ($[120] !== handleChange || $[121] !== t76) {
|
|
718
|
+
t78 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { name: "defaultSize", size: "large", fullWidth: true, label: "Default row size", position: "item-aligned", onChange: handleChange, value: t76, renderValue: _temp$c, children: t77 }) });
|
|
719
|
+
$[120] = handleChange;
|
|
720
|
+
$[121] = t76;
|
|
721
|
+
$[122] = t78;
|
|
700
722
|
} else {
|
|
701
|
-
t78 = $[
|
|
723
|
+
t78 = $[122];
|
|
702
724
|
}
|
|
703
|
-
const t79 =
|
|
725
|
+
const t79 = values.includeJsonView === void 0 || values.includeJsonView ? "Include JSON view" : "Do not include JSON view";
|
|
704
726
|
let t80;
|
|
705
|
-
if ($[
|
|
706
|
-
t80 = (
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
}
|
|
710
|
-
setFieldValue("customId", v);
|
|
711
|
-
};
|
|
712
|
-
$[116] = setFieldValue;
|
|
713
|
-
$[117] = t80;
|
|
727
|
+
if ($[123] !== setFieldValue) {
|
|
728
|
+
t80 = (v_0) => setFieldValue("includeJsonView", v_0);
|
|
729
|
+
$[123] = setFieldValue;
|
|
730
|
+
$[124] = t80;
|
|
714
731
|
} else {
|
|
715
|
-
t80 = $[
|
|
732
|
+
t80 = $[124];
|
|
716
733
|
}
|
|
717
|
-
const t81 =
|
|
734
|
+
const t81 = values.includeJsonView === void 0 ? true : values.includeJsonView;
|
|
718
735
|
let t82;
|
|
736
|
+
if ($[125] !== t79 || $[126] !== t80 || $[127] !== t81) {
|
|
737
|
+
t82 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "large", label: t79, onValueChange: t80, value: t81 });
|
|
738
|
+
$[125] = t79;
|
|
739
|
+
$[126] = t80;
|
|
740
|
+
$[127] = t81;
|
|
741
|
+
$[128] = t82;
|
|
742
|
+
} else {
|
|
743
|
+
t82 = $[128];
|
|
744
|
+
}
|
|
719
745
|
let t83;
|
|
746
|
+
if ($[129] === Symbol.for("react.memo_cache_sentinel")) {
|
|
747
|
+
t83 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: "Include the JSON representation of the document." });
|
|
748
|
+
$[129] = t83;
|
|
749
|
+
} else {
|
|
750
|
+
t83 = $[129];
|
|
751
|
+
}
|
|
720
752
|
let t84;
|
|
721
|
-
if ($[
|
|
722
|
-
|
|
723
|
-
t83 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "true", children: "Users must define an ID" });
|
|
724
|
-
t84 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
|
|
725
|
-
$[118] = t82;
|
|
726
|
-
$[119] = t83;
|
|
727
|
-
$[120] = t84;
|
|
728
|
-
} else {
|
|
729
|
-
t82 = $[118];
|
|
730
|
-
t83 = $[119];
|
|
731
|
-
t84 = $[120];
|
|
732
|
-
}
|
|
733
|
-
let t85;
|
|
734
|
-
if ($[121] !== t79 || $[122] !== t80 || $[123] !== t81) {
|
|
735
|
-
t85 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { name: "customId", label: "Document IDs generation", position: "item-aligned", size: "large", fullWidth: true, disabled: t79, onValueChange: t80, value: t81, renderValue: _temp3$4, children: [
|
|
753
|
+
if ($[130] !== t82) {
|
|
754
|
+
t84 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
|
|
736
755
|
t82,
|
|
737
|
-
t83
|
|
738
|
-
|
|
739
|
-
]
|
|
740
|
-
$[
|
|
741
|
-
$[122] = t80;
|
|
742
|
-
$[123] = t81;
|
|
743
|
-
$[124] = t85;
|
|
756
|
+
t83
|
|
757
|
+
] });
|
|
758
|
+
$[130] = t82;
|
|
759
|
+
$[131] = t84;
|
|
744
760
|
} else {
|
|
745
|
-
|
|
761
|
+
t84 = $[131];
|
|
746
762
|
}
|
|
763
|
+
const t85 = customIdValue === "code_defined";
|
|
747
764
|
let t86;
|
|
748
|
-
if ($[
|
|
749
|
-
t86 = (
|
|
750
|
-
|
|
751
|
-
|
|
765
|
+
if ($[132] !== setFieldValue) {
|
|
766
|
+
t86 = (v_1) => {
|
|
767
|
+
if (v_1 === "code_defined") {
|
|
768
|
+
throw new Error("This should not happen");
|
|
769
|
+
}
|
|
770
|
+
setFieldValue("customId", v_1);
|
|
771
|
+
};
|
|
772
|
+
$[132] = setFieldValue;
|
|
773
|
+
$[133] = t86;
|
|
752
774
|
} else {
|
|
753
|
-
t86 = $[
|
|
775
|
+
t86 = $[133];
|
|
754
776
|
}
|
|
755
|
-
const t87 =
|
|
777
|
+
const t87 = customIdValue ?? "";
|
|
756
778
|
let t88;
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
779
|
+
let t89;
|
|
780
|
+
let t90;
|
|
781
|
+
if ($[134] === Symbol.for("react.memo_cache_sentinel")) {
|
|
782
|
+
t88 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "false", children: "Document ID is generated automatically" });
|
|
783
|
+
t89 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "true", children: "Users must define an ID" });
|
|
784
|
+
t90 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
|
|
785
|
+
$[134] = t88;
|
|
786
|
+
$[135] = t89;
|
|
787
|
+
$[136] = t90;
|
|
788
|
+
} else {
|
|
789
|
+
t88 = $[134];
|
|
790
|
+
t89 = $[135];
|
|
791
|
+
t90 = $[136];
|
|
792
|
+
}
|
|
793
|
+
let t91;
|
|
794
|
+
if ($[137] !== t85 || $[138] !== t86 || $[139] !== t87) {
|
|
795
|
+
t91 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { name: "customId", label: "Document IDs generation", position: "item-aligned", size: "large", fullWidth: true, disabled: t85, onValueChange: t86, value: t87, renderValue: _temp3$5, children: [
|
|
796
|
+
t88,
|
|
797
|
+
t89,
|
|
798
|
+
t90
|
|
799
|
+
] }) });
|
|
800
|
+
$[137] = t85;
|
|
801
|
+
$[138] = t86;
|
|
802
|
+
$[139] = t87;
|
|
803
|
+
$[140] = t91;
|
|
762
804
|
} else {
|
|
763
|
-
|
|
805
|
+
t91 = $[140];
|
|
764
806
|
}
|
|
765
|
-
let
|
|
766
|
-
if ($[
|
|
767
|
-
|
|
768
|
-
$[
|
|
807
|
+
let t92;
|
|
808
|
+
if ($[141] !== setFieldValue) {
|
|
809
|
+
t92 = (v_2) => setFieldValue("collectionGroup", v_2);
|
|
810
|
+
$[141] = setFieldValue;
|
|
811
|
+
$[142] = t92;
|
|
769
812
|
} else {
|
|
770
|
-
|
|
813
|
+
t92 = $[142];
|
|
771
814
|
}
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
815
|
+
const t93 = values.collectionGroup ?? false;
|
|
816
|
+
let t94;
|
|
817
|
+
if ($[143] !== t92 || $[144] !== t93) {
|
|
818
|
+
t94 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "large", label: "Collection group", onValueChange: t92, value: t93 });
|
|
819
|
+
$[143] = t92;
|
|
820
|
+
$[144] = t93;
|
|
821
|
+
$[145] = t94;
|
|
822
|
+
} else {
|
|
823
|
+
t94 = $[145];
|
|
824
|
+
}
|
|
825
|
+
let t95;
|
|
826
|
+
if ($[146] === Symbol.for("react.memo_cache_sentinel")) {
|
|
827
|
+
t95 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." });
|
|
828
|
+
$[146] = t95;
|
|
829
|
+
} else {
|
|
830
|
+
t95 = $[146];
|
|
831
|
+
}
|
|
832
|
+
let t96;
|
|
833
|
+
if ($[147] !== t94) {
|
|
834
|
+
t96 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12 mt-4", children: [
|
|
835
|
+
t94,
|
|
836
|
+
t95
|
|
777
837
|
] });
|
|
778
|
-
$[
|
|
779
|
-
$[
|
|
838
|
+
$[147] = t94;
|
|
839
|
+
$[148] = t96;
|
|
780
840
|
} else {
|
|
781
|
-
|
|
841
|
+
t96 = $[148];
|
|
782
842
|
}
|
|
783
|
-
let
|
|
784
|
-
if ($[
|
|
785
|
-
|
|
786
|
-
$[
|
|
787
|
-
$[
|
|
843
|
+
let t97;
|
|
844
|
+
if ($[149] !== setFieldValue) {
|
|
845
|
+
t97 = (v_3) => setFieldValue("textSearchEnabled", v_3);
|
|
846
|
+
$[149] = setFieldValue;
|
|
847
|
+
$[150] = t97;
|
|
788
848
|
} else {
|
|
789
|
-
|
|
849
|
+
t97 = $[150];
|
|
790
850
|
}
|
|
791
|
-
const
|
|
792
|
-
let
|
|
793
|
-
if ($[
|
|
794
|
-
|
|
795
|
-
$[
|
|
796
|
-
$[
|
|
797
|
-
$[
|
|
851
|
+
const t98 = values.textSearchEnabled ?? false;
|
|
852
|
+
let t99;
|
|
853
|
+
if ($[151] !== t97 || $[152] !== t98) {
|
|
854
|
+
t99 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "large", label: "Enable text search for this collection", onValueChange: t97, value: t98 });
|
|
855
|
+
$[151] = t97;
|
|
856
|
+
$[152] = t98;
|
|
857
|
+
$[153] = t99;
|
|
798
858
|
} else {
|
|
799
|
-
|
|
859
|
+
t99 = $[153];
|
|
800
860
|
}
|
|
801
|
-
let
|
|
802
|
-
if ($[
|
|
803
|
-
|
|
804
|
-
$[
|
|
861
|
+
let t100;
|
|
862
|
+
if ($[154] === Symbol.for("react.memo_cache_sentinel")) {
|
|
863
|
+
t100 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: "Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues." });
|
|
864
|
+
$[154] = t100;
|
|
805
865
|
} else {
|
|
806
|
-
|
|
866
|
+
t100 = $[154];
|
|
807
867
|
}
|
|
808
|
-
let
|
|
809
|
-
if ($[
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
868
|
+
let t101;
|
|
869
|
+
if ($[155] !== t99) {
|
|
870
|
+
t101 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
|
|
871
|
+
t99,
|
|
872
|
+
t100
|
|
813
873
|
] });
|
|
814
|
-
$[
|
|
815
|
-
$[
|
|
874
|
+
$[155] = t99;
|
|
875
|
+
$[156] = t101;
|
|
816
876
|
} else {
|
|
817
|
-
|
|
877
|
+
t101 = $[156];
|
|
818
878
|
}
|
|
819
|
-
let
|
|
820
|
-
if ($[
|
|
821
|
-
|
|
879
|
+
let t102;
|
|
880
|
+
if ($[157] !== t101 || $[158] !== t48 || $[159] !== t56 || $[160] !== t68 || $[161] !== t75 || $[162] !== t78 || $[163] !== t84 || $[164] !== t91 || $[165] !== t96) {
|
|
881
|
+
t102 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
|
|
822
882
|
t48,
|
|
823
883
|
t56,
|
|
824
884
|
t68,
|
|
825
885
|
t75,
|
|
826
886
|
t78,
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
887
|
+
t84,
|
|
888
|
+
t91,
|
|
889
|
+
t96,
|
|
890
|
+
t101
|
|
830
891
|
] });
|
|
831
|
-
$[
|
|
832
|
-
$[
|
|
833
|
-
$[
|
|
834
|
-
$[
|
|
835
|
-
$[
|
|
836
|
-
$[
|
|
837
|
-
$[
|
|
838
|
-
$[
|
|
839
|
-
$[
|
|
892
|
+
$[157] = t101;
|
|
893
|
+
$[158] = t48;
|
|
894
|
+
$[159] = t56;
|
|
895
|
+
$[160] = t68;
|
|
896
|
+
$[161] = t75;
|
|
897
|
+
$[162] = t78;
|
|
898
|
+
$[163] = t84;
|
|
899
|
+
$[164] = t91;
|
|
900
|
+
$[165] = t96;
|
|
901
|
+
$[166] = t102;
|
|
902
|
+
} else {
|
|
903
|
+
t102 = $[166];
|
|
904
|
+
}
|
|
905
|
+
let t103;
|
|
906
|
+
if ($[167] !== advancedPanelExpanded || $[168] !== t102) {
|
|
907
|
+
t103 = /* @__PURE__ */ jsxRuntime.jsx(ui.ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t41, initiallyExpanded: false, children: t102 });
|
|
908
|
+
$[167] = advancedPanelExpanded;
|
|
909
|
+
$[168] = t102;
|
|
910
|
+
$[169] = t103;
|
|
840
911
|
} else {
|
|
841
|
-
|
|
912
|
+
t103 = $[169];
|
|
842
913
|
}
|
|
843
|
-
let
|
|
844
|
-
if ($[
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
$[151] = t96;
|
|
848
|
-
$[152] = t97;
|
|
849
|
-
} else {
|
|
850
|
-
t97 = $[152];
|
|
851
|
-
}
|
|
852
|
-
let t98;
|
|
853
|
-
if ($[153] !== children || $[154] !== t97) {
|
|
854
|
-
t98 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12 mt-8", children: [
|
|
855
|
-
t97,
|
|
914
|
+
let t104;
|
|
915
|
+
if ($[170] !== children || $[171] !== t103) {
|
|
916
|
+
t104 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12 mt-8", children: [
|
|
917
|
+
t103,
|
|
856
918
|
children
|
|
857
919
|
] });
|
|
858
|
-
$[
|
|
859
|
-
$[
|
|
860
|
-
$[
|
|
920
|
+
$[170] = children;
|
|
921
|
+
$[171] = t103;
|
|
922
|
+
$[172] = t104;
|
|
861
923
|
} else {
|
|
862
|
-
|
|
924
|
+
t104 = $[172];
|
|
863
925
|
}
|
|
864
|
-
let
|
|
865
|
-
if ($[
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
926
|
+
let t105;
|
|
927
|
+
if ($[173] !== t104 || $[174] !== t23 || $[175] !== t31 || $[176] !== t34 || $[177] !== t40) {
|
|
928
|
+
t105 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-12 gap-4", children: [
|
|
929
|
+
t23,
|
|
930
|
+
t31,
|
|
931
|
+
t34,
|
|
870
932
|
t40,
|
|
871
|
-
|
|
933
|
+
t104
|
|
872
934
|
] });
|
|
873
|
-
$[
|
|
874
|
-
$[
|
|
875
|
-
$[
|
|
876
|
-
$[
|
|
877
|
-
$[
|
|
878
|
-
$[
|
|
879
|
-
} else {
|
|
880
|
-
|
|
881
|
-
}
|
|
882
|
-
let
|
|
883
|
-
if ($[
|
|
884
|
-
|
|
935
|
+
$[173] = t104;
|
|
936
|
+
$[174] = t23;
|
|
937
|
+
$[175] = t31;
|
|
938
|
+
$[176] = t34;
|
|
939
|
+
$[177] = t40;
|
|
940
|
+
$[178] = t105;
|
|
941
|
+
} else {
|
|
942
|
+
t105 = $[178];
|
|
943
|
+
}
|
|
944
|
+
let t106;
|
|
945
|
+
if ($[179] === Symbol.for("react.memo_cache_sentinel")) {
|
|
946
|
+
t106 = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
885
947
|
height: "52px"
|
|
886
948
|
} });
|
|
887
|
-
$[
|
|
949
|
+
$[179] = t106;
|
|
888
950
|
} else {
|
|
889
|
-
|
|
951
|
+
t106 = $[179];
|
|
890
952
|
}
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
953
|
+
const t107 = typeof values.icon === "string" ? values.icon : void 0;
|
|
954
|
+
let t108;
|
|
955
|
+
if ($[180] !== setFieldValue) {
|
|
956
|
+
t108 = (icon) => {
|
|
894
957
|
setIconDialogOpen(false);
|
|
895
958
|
setFieldValue("icon", icon);
|
|
896
959
|
};
|
|
897
|
-
$[
|
|
898
|
-
$[
|
|
960
|
+
$[180] = setFieldValue;
|
|
961
|
+
$[181] = t108;
|
|
899
962
|
} else {
|
|
900
|
-
|
|
963
|
+
t108 = $[181];
|
|
901
964
|
}
|
|
902
|
-
let
|
|
903
|
-
if ($[
|
|
904
|
-
|
|
905
|
-
$[
|
|
906
|
-
$[
|
|
907
|
-
$[
|
|
965
|
+
let t109;
|
|
966
|
+
if ($[182] !== t107 || $[183] !== t108) {
|
|
967
|
+
t109 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsxRuntime.jsx(core.SearchIconsView, { selectedIcon: t107, onIconSelected: t108 }) });
|
|
968
|
+
$[182] = t107;
|
|
969
|
+
$[183] = t108;
|
|
970
|
+
$[184] = t109;
|
|
908
971
|
} else {
|
|
909
|
-
|
|
972
|
+
t109 = $[184];
|
|
910
973
|
}
|
|
911
|
-
let
|
|
912
|
-
if ($[
|
|
913
|
-
|
|
914
|
-
$[
|
|
915
|
-
$[
|
|
916
|
-
$[
|
|
974
|
+
let t110;
|
|
975
|
+
if ($[185] !== iconDialogOpen || $[186] !== t109) {
|
|
976
|
+
t110 = /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t109 });
|
|
977
|
+
$[185] = iconDialogOpen;
|
|
978
|
+
$[186] = t109;
|
|
979
|
+
$[187] = t110;
|
|
917
980
|
} else {
|
|
918
|
-
|
|
981
|
+
t110 = $[187];
|
|
919
982
|
}
|
|
920
|
-
let
|
|
921
|
-
if ($[
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
983
|
+
let t111;
|
|
984
|
+
if ($[188] !== t105 || $[189] !== t110 || $[190] !== t15) {
|
|
985
|
+
t111 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Container, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
986
|
+
t15,
|
|
987
|
+
t105,
|
|
988
|
+
t106,
|
|
989
|
+
t110
|
|
927
990
|
] }) });
|
|
928
|
-
$[
|
|
929
|
-
$[
|
|
930
|
-
$[
|
|
931
|
-
$[
|
|
932
|
-
$[175] = t104;
|
|
991
|
+
$[188] = t105;
|
|
992
|
+
$[189] = t110;
|
|
993
|
+
$[190] = t15;
|
|
994
|
+
$[191] = t111;
|
|
933
995
|
} else {
|
|
934
|
-
|
|
996
|
+
t111 = $[191];
|
|
935
997
|
}
|
|
936
|
-
return
|
|
998
|
+
return t111;
|
|
937
999
|
}
|
|
938
|
-
function _temp3$
|
|
1000
|
+
function _temp3$5(value_3) {
|
|
939
1001
|
if (value_3 === "code_defined") {
|
|
940
1002
|
return "Code defined";
|
|
941
1003
|
} else {
|
|
@@ -950,10 +1012,10 @@
|
|
|
950
1012
|
}
|
|
951
1013
|
}
|
|
952
1014
|
}
|
|
953
|
-
function _temp2$
|
|
1015
|
+
function _temp2$8(value_2) {
|
|
954
1016
|
return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: value_2, children: value_2.toUpperCase() }, `size-select-${value_2}`);
|
|
955
1017
|
}
|
|
956
|
-
function _temp$
|
|
1018
|
+
function _temp$c(value_1) {
|
|
957
1019
|
return value_1.toUpperCase();
|
|
958
1020
|
}
|
|
959
1021
|
function DefaultDatabaseField(t0) {
|
|
@@ -1178,7 +1240,7 @@
|
|
|
1178
1240
|
inferredValues.add(enumValue_0.id);
|
|
1179
1241
|
});
|
|
1180
1242
|
setFieldValue(enumValuesPath, [...newEnumValues, ...currentEnumValues], true);
|
|
1181
|
-
}).catch(_temp$
|
|
1243
|
+
}).catch(_temp$b).finally(() => setInferring(false));
|
|
1182
1244
|
};
|
|
1183
1245
|
$[8] = enumValuesPath;
|
|
1184
1246
|
$[9] = getData;
|
|
@@ -1301,7 +1363,7 @@
|
|
|
1301
1363
|
}
|
|
1302
1364
|
return t15;
|
|
1303
1365
|
}
|
|
1304
|
-
function _temp$
|
|
1366
|
+
function _temp$b(e) {
|
|
1305
1367
|
console.error(e);
|
|
1306
1368
|
}
|
|
1307
1369
|
const EnumEntry = React.memo(function EnumEntryInternal(t0) {
|
|
@@ -2090,7 +2152,7 @@
|
|
|
2090
2152
|
t192 = $[42];
|
|
2091
2153
|
}
|
|
2092
2154
|
if ($[43] !== acceptedFiles || $[44] !== disabled || $[45] !== handleTypesChange || $[46] !== t172 || $[47] !== t182 || $[48] !== t192) {
|
|
2093
|
-
t10 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsx(ui.MultiSelect, { className: "w-full", placeholder: "All file types allowed", disabled, name: acceptedFiles, value: t172, onValueChange: handleTypesChange, label: t182, renderValues: _temp3$
|
|
2155
|
+
t10 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsx(ui.MultiSelect, { className: "w-full", placeholder: "All file types allowed", disabled, name: acceptedFiles, value: t172, onValueChange: handleTypesChange, label: t182, renderValues: _temp3$4, children: t192 }) });
|
|
2094
2156
|
$[43] = acceptedFiles;
|
|
2095
2157
|
$[44] = disabled;
|
|
2096
2158
|
$[45] = handleTypesChange;
|
|
@@ -2353,16 +2415,16 @@
|
|
|
2353
2415
|
}
|
|
2354
2416
|
return t24;
|
|
2355
2417
|
}
|
|
2356
|
-
function _temp3$
|
|
2418
|
+
function _temp3$4(selected) {
|
|
2357
2419
|
if (!selected || selected.length === 0) {
|
|
2358
2420
|
return "All file types allowed";
|
|
2359
2421
|
}
|
|
2360
|
-
return selected.map(_temp$
|
|
2422
|
+
return selected.map(_temp$a).filter(_temp2$7).join(", ");
|
|
2361
2423
|
}
|
|
2362
|
-
function _temp2$
|
|
2424
|
+
function _temp2$7(v_0) {
|
|
2363
2425
|
return Boolean(v_0);
|
|
2364
2426
|
}
|
|
2365
|
-
function _temp$
|
|
2427
|
+
function _temp$a(v) {
|
|
2366
2428
|
return fileTypes[v];
|
|
2367
2429
|
}
|
|
2368
2430
|
function editableProperty(property) {
|
|
@@ -2434,7 +2496,7 @@
|
|
|
2434
2496
|
const t4 = selected ? ui.cardSelectedMixin : "";
|
|
2435
2497
|
let t5;
|
|
2436
2498
|
if ($[5] !== borderColorClass || $[6] !== t3 || $[7] !== t4) {
|
|
2437
|
-
t5 = ui.cls("border", "pl-2 w-full flex flex-row gap-4 items-center", ui.cardMixin, t3, t4, "flex-grow p-4 border transition-colors duration-200", borderColorClass);
|
|
2499
|
+
t5 = ui.cls("m-1", "border", "pl-2 w-full flex flex-row gap-4 items-center", ui.cardMixin, t3, t4, "flex-grow p-4 border transition-colors duration-200", borderColorClass);
|
|
2438
2500
|
$[5] = borderColorClass;
|
|
2439
2501
|
$[6] = t3;
|
|
2440
2502
|
$[7] = t4;
|
|
@@ -2694,7 +2756,7 @@
|
|
|
2694
2756
|
return t19;
|
|
2695
2757
|
}
|
|
2696
2758
|
const PropertyTree = React.memo(function PropertyTree2(t0) {
|
|
2697
|
-
const $ = reactCompilerRuntime.c(
|
|
2759
|
+
const $ = reactCompilerRuntime.c(37);
|
|
2698
2760
|
const {
|
|
2699
2761
|
namespace,
|
|
2700
2762
|
selectedPropertyKey,
|
|
@@ -2720,94 +2782,152 @@
|
|
|
2720
2782
|
}
|
|
2721
2783
|
const propertiesOrder = t1;
|
|
2722
2784
|
let t2;
|
|
2723
|
-
if ($[3]
|
|
2724
|
-
t2 =
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
}
|
|
2728
|
-
const startIndex = result.source.index;
|
|
2729
|
-
const endIndex = result.destination.index;
|
|
2730
|
-
const newPropertiesOrder = Array.from(propertiesOrder);
|
|
2731
|
-
const [removed] = newPropertiesOrder.splice(startIndex, 1);
|
|
2732
|
-
newPropertiesOrder.splice(endIndex, 0, removed);
|
|
2733
|
-
if (onPropertyMove) {
|
|
2734
|
-
onPropertyMove(newPropertiesOrder, namespace);
|
|
2785
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2786
|
+
t2 = {
|
|
2787
|
+
activationConstraint: {
|
|
2788
|
+
distance: 5
|
|
2735
2789
|
}
|
|
2736
2790
|
};
|
|
2737
|
-
$[3] =
|
|
2738
|
-
$[4] = onPropertyMove;
|
|
2739
|
-
$[5] = propertiesOrder;
|
|
2740
|
-
$[6] = t2;
|
|
2791
|
+
$[3] = t2;
|
|
2741
2792
|
} else {
|
|
2742
|
-
t2 = $[
|
|
2793
|
+
t2 = $[3];
|
|
2794
|
+
}
|
|
2795
|
+
let t3;
|
|
2796
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2797
|
+
t3 = {
|
|
2798
|
+
coordinateGetter: sortable.sortableKeyboardCoordinates
|
|
2799
|
+
};
|
|
2800
|
+
$[4] = t3;
|
|
2801
|
+
} else {
|
|
2802
|
+
t3 = $[4];
|
|
2743
2803
|
}
|
|
2744
|
-
const
|
|
2745
|
-
const t3 = `droppable_${namespace}`;
|
|
2804
|
+
const sensors = core$1.useSensors(core$1.useSensor(core$1.PointerSensor, t2), core$1.useSensor(core$1.KeyboardSensor, t3));
|
|
2746
2805
|
let t4;
|
|
2747
|
-
if ($[
|
|
2748
|
-
t4 = (
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2806
|
+
if ($[5] !== namespace || $[6] !== onPropertyMove || $[7] !== propertiesOrder) {
|
|
2807
|
+
t4 = (event) => {
|
|
2808
|
+
const {
|
|
2809
|
+
active,
|
|
2810
|
+
over
|
|
2811
|
+
} = event;
|
|
2812
|
+
if (!over || active.id === over.id) {
|
|
2813
|
+
return;
|
|
2814
|
+
}
|
|
2815
|
+
const activeId = String(active.id);
|
|
2816
|
+
const overId = String(over.id);
|
|
2817
|
+
const activeKey = activeId.includes(".") ? activeId.split(".").pop() : activeId;
|
|
2818
|
+
const overKey = overId.includes(".") ? overId.split(".").pop() : overId;
|
|
2819
|
+
if (!activeKey || !overKey) {
|
|
2820
|
+
return;
|
|
2821
|
+
}
|
|
2822
|
+
const oldIndex = propertiesOrder.indexOf(activeKey);
|
|
2823
|
+
const newIndex = propertiesOrder.indexOf(overKey);
|
|
2824
|
+
if (oldIndex !== -1 && newIndex !== -1) {
|
|
2825
|
+
const newPropertiesOrder = [...propertiesOrder];
|
|
2826
|
+
const [removed] = newPropertiesOrder.splice(oldIndex, 1);
|
|
2827
|
+
newPropertiesOrder.splice(newIndex, 0, removed);
|
|
2828
|
+
if (onPropertyMove) {
|
|
2829
|
+
onPropertyMove(newPropertiesOrder, namespace);
|
|
2755
2830
|
}
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
]
|
|
2760
|
-
$[7] =
|
|
2761
|
-
$[8] =
|
|
2762
|
-
|
|
2763
|
-
$[
|
|
2764
|
-
$[11] = inferredPropertyKeys;
|
|
2765
|
-
$[12] = namespace;
|
|
2766
|
-
$[13] = onPropertyClick;
|
|
2767
|
-
$[14] = onPropertyMove;
|
|
2768
|
-
$[15] = onPropertyRemove;
|
|
2769
|
-
$[16] = properties;
|
|
2770
|
-
$[17] = propertiesOrder;
|
|
2771
|
-
$[18] = selectedPropertyKey;
|
|
2772
|
-
$[19] = t4;
|
|
2773
|
-
} else {
|
|
2774
|
-
t4 = $[19];
|
|
2831
|
+
}
|
|
2832
|
+
};
|
|
2833
|
+
$[5] = namespace;
|
|
2834
|
+
$[6] = onPropertyMove;
|
|
2835
|
+
$[7] = propertiesOrder;
|
|
2836
|
+
$[8] = t4;
|
|
2837
|
+
} else {
|
|
2838
|
+
t4 = $[8];
|
|
2775
2839
|
}
|
|
2840
|
+
const handleDragEnd = t4;
|
|
2776
2841
|
let t5;
|
|
2777
|
-
if ($[
|
|
2778
|
-
|
|
2779
|
-
$[
|
|
2780
|
-
|
|
2781
|
-
|
|
2842
|
+
if ($[9] !== namespace || $[10] !== propertiesOrder) {
|
|
2843
|
+
let t62;
|
|
2844
|
+
if ($[12] !== namespace) {
|
|
2845
|
+
t62 = (key) => getFullId(key, namespace);
|
|
2846
|
+
$[12] = namespace;
|
|
2847
|
+
$[13] = t62;
|
|
2848
|
+
} else {
|
|
2849
|
+
t62 = $[13];
|
|
2850
|
+
}
|
|
2851
|
+
t5 = propertiesOrder.map(t62);
|
|
2852
|
+
$[9] = namespace;
|
|
2853
|
+
$[10] = propertiesOrder;
|
|
2854
|
+
$[11] = t5;
|
|
2782
2855
|
} else {
|
|
2783
|
-
t5 = $[
|
|
2856
|
+
t5 = $[11];
|
|
2784
2857
|
}
|
|
2858
|
+
const items = t5;
|
|
2785
2859
|
let t6;
|
|
2786
|
-
if ($[
|
|
2787
|
-
t6 =
|
|
2788
|
-
$[
|
|
2789
|
-
$[24] = t5;
|
|
2790
|
-
$[25] = t6;
|
|
2860
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2861
|
+
t6 = [modifiers.restrictToVerticalAxis];
|
|
2862
|
+
$[14] = t6;
|
|
2791
2863
|
} else {
|
|
2792
|
-
t6 = $[
|
|
2864
|
+
t6 = $[14];
|
|
2793
2865
|
}
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2866
|
+
let t7;
|
|
2867
|
+
if ($[15] !== additionalFields || $[16] !== collectionEditable || $[17] !== errors || $[18] !== inferredPropertyKeys || $[19] !== namespace || $[20] !== onPropertyClick || $[21] !== onPropertyMove || $[22] !== onPropertyRemove || $[23] !== properties || $[24] !== propertiesOrder || $[25] !== selectedPropertyKey) {
|
|
2868
|
+
t7 = propertiesOrder && propertiesOrder.map((propertyKey, index) => {
|
|
2869
|
+
const property = properties[propertyKey];
|
|
2870
|
+
const additionalField = additionalFields?.find((field) => field.key === propertyKey);
|
|
2871
|
+
if (!property && !additionalField) {
|
|
2872
|
+
console.warn(`Property ${propertyKey} not found in properties or additionalFields`);
|
|
2873
|
+
return null;
|
|
2874
|
+
}
|
|
2875
|
+
const id = getFullId(propertyKey, namespace);
|
|
2876
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PropertyTreeEntry, { id, propertyKey, propertyOrBuilder: property, additionalField, errors, namespace, inferredPropertyKeys, onPropertyMove, onPropertyRemove, onPropertyClick, selectedPropertyKey, collectionEditable }, id);
|
|
2877
|
+
}).filter(Boolean);
|
|
2878
|
+
$[15] = additionalFields;
|
|
2879
|
+
$[16] = collectionEditable;
|
|
2880
|
+
$[17] = errors;
|
|
2881
|
+
$[18] = inferredPropertyKeys;
|
|
2882
|
+
$[19] = namespace;
|
|
2883
|
+
$[20] = onPropertyClick;
|
|
2884
|
+
$[21] = onPropertyMove;
|
|
2885
|
+
$[22] = onPropertyRemove;
|
|
2886
|
+
$[23] = properties;
|
|
2887
|
+
$[24] = propertiesOrder;
|
|
2888
|
+
$[25] = selectedPropertyKey;
|
|
2889
|
+
$[26] = t7;
|
|
2890
|
+
} else {
|
|
2891
|
+
t7 = $[26];
|
|
2892
|
+
}
|
|
2893
|
+
let t8;
|
|
2894
|
+
if ($[27] !== className || $[28] !== t7) {
|
|
2895
|
+
t8 = /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: t7 });
|
|
2896
|
+
$[27] = className;
|
|
2897
|
+
$[28] = t7;
|
|
2898
|
+
$[29] = t8;
|
|
2899
|
+
} else {
|
|
2900
|
+
t8 = $[29];
|
|
2901
|
+
}
|
|
2902
|
+
let t9;
|
|
2903
|
+
if ($[30] !== items || $[31] !== t8) {
|
|
2904
|
+
t9 = /* @__PURE__ */ jsxRuntime.jsx(sortable.SortableContext, { items, strategy: sortable.verticalListSortingStrategy, children: t8 });
|
|
2905
|
+
$[30] = items;
|
|
2906
|
+
$[31] = t8;
|
|
2907
|
+
$[32] = t9;
|
|
2908
|
+
} else {
|
|
2909
|
+
t9 = $[32];
|
|
2910
|
+
}
|
|
2911
|
+
let t10;
|
|
2912
|
+
if ($[33] !== handleDragEnd || $[34] !== sensors || $[35] !== t9) {
|
|
2913
|
+
t10 = /* @__PURE__ */ jsxRuntime.jsx(core$1.DndContext, { sensors, collisionDetection: core$1.closestCenter, onDragEnd: handleDragEnd, modifiers: t6, children: t9 });
|
|
2914
|
+
$[33] = handleDragEnd;
|
|
2915
|
+
$[34] = sensors;
|
|
2916
|
+
$[35] = t9;
|
|
2917
|
+
$[36] = t10;
|
|
2918
|
+
} else {
|
|
2919
|
+
t10 = $[36];
|
|
2920
|
+
}
|
|
2921
|
+
return t10;
|
|
2922
|
+
}, equal);
|
|
2803
2923
|
function PropertyTreeEntry(t0) {
|
|
2804
|
-
const $ = reactCompilerRuntime.c(
|
|
2924
|
+
const $ = reactCompilerRuntime.c(62);
|
|
2805
2925
|
const {
|
|
2926
|
+
id,
|
|
2806
2927
|
propertyKey,
|
|
2807
2928
|
namespace,
|
|
2808
2929
|
propertyOrBuilder,
|
|
2809
2930
|
additionalField,
|
|
2810
|
-
provided,
|
|
2811
2931
|
selectedPropertyKey,
|
|
2812
2932
|
errors,
|
|
2813
2933
|
onPropertyClick,
|
|
@@ -2817,157 +2937,201 @@
|
|
|
2817
2937
|
collectionEditable
|
|
2818
2938
|
} = t0;
|
|
2819
2939
|
let t1;
|
|
2820
|
-
if ($[0] !==
|
|
2821
|
-
t1 =
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
$[
|
|
2825
|
-
$[
|
|
2940
|
+
if ($[0] !== id) {
|
|
2941
|
+
t1 = {
|
|
2942
|
+
id
|
|
2943
|
+
};
|
|
2944
|
+
$[0] = id;
|
|
2945
|
+
$[1] = t1;
|
|
2826
2946
|
} else {
|
|
2827
|
-
t1 = $[
|
|
2947
|
+
t1 = $[1];
|
|
2828
2948
|
}
|
|
2829
|
-
const
|
|
2949
|
+
const {
|
|
2950
|
+
attributes,
|
|
2951
|
+
listeners,
|
|
2952
|
+
setNodeRef,
|
|
2953
|
+
transform,
|
|
2954
|
+
transition,
|
|
2955
|
+
isDragging
|
|
2956
|
+
} = sortable.useSortable(t1);
|
|
2830
2957
|
let t2;
|
|
2831
|
-
if ($[
|
|
2832
|
-
t2 =
|
|
2833
|
-
$[
|
|
2834
|
-
$[
|
|
2835
|
-
$[6] = t2;
|
|
2958
|
+
if ($[2] !== transform) {
|
|
2959
|
+
t2 = utilities.CSS.Translate.toString(transform);
|
|
2960
|
+
$[2] = transform;
|
|
2961
|
+
$[3] = t2;
|
|
2836
2962
|
} else {
|
|
2837
|
-
t2 = $[
|
|
2963
|
+
t2 = $[3];
|
|
2964
|
+
}
|
|
2965
|
+
const t3 = isDragging ? 10 : void 0;
|
|
2966
|
+
let t4;
|
|
2967
|
+
if ($[4] !== t2 || $[5] !== t3 || $[6] !== transition) {
|
|
2968
|
+
t4 = {
|
|
2969
|
+
transform: t2,
|
|
2970
|
+
transition,
|
|
2971
|
+
zIndex: t3,
|
|
2972
|
+
position: "relative"
|
|
2973
|
+
};
|
|
2974
|
+
$[4] = t2;
|
|
2975
|
+
$[5] = t3;
|
|
2976
|
+
$[6] = transition;
|
|
2977
|
+
$[7] = t4;
|
|
2978
|
+
} else {
|
|
2979
|
+
t4 = $[7];
|
|
2980
|
+
}
|
|
2981
|
+
const style = t4;
|
|
2982
|
+
let t5;
|
|
2983
|
+
if ($[8] !== inferredPropertyKeys || $[9] !== namespace || $[10] !== propertyKey) {
|
|
2984
|
+
t5 = inferredPropertyKeys?.includes(namespace ? `${namespace}.${propertyKey}` : propertyKey);
|
|
2985
|
+
$[8] = inferredPropertyKeys;
|
|
2986
|
+
$[9] = namespace;
|
|
2987
|
+
$[10] = propertyKey;
|
|
2988
|
+
$[11] = t5;
|
|
2989
|
+
} else {
|
|
2990
|
+
t5 = $[11];
|
|
2838
2991
|
}
|
|
2839
|
-
const
|
|
2992
|
+
const isPropertyInferred = t5;
|
|
2993
|
+
const fullId = id;
|
|
2840
2994
|
const fullIdPath = getFullIdPath(propertyKey, namespace);
|
|
2841
2995
|
const hasError = fullIdPath in errors;
|
|
2842
2996
|
let subtree;
|
|
2843
2997
|
if (typeof propertyOrBuilder === "object") {
|
|
2844
2998
|
const property = propertyOrBuilder;
|
|
2845
2999
|
if (property.dataType === "map" && property.properties) {
|
|
2846
|
-
let
|
|
2847
|
-
if ($[
|
|
2848
|
-
|
|
2849
|
-
$[
|
|
2850
|
-
$[
|
|
2851
|
-
$[
|
|
2852
|
-
$[
|
|
2853
|
-
$[
|
|
2854
|
-
$[
|
|
2855
|
-
$[
|
|
2856
|
-
$[
|
|
2857
|
-
$[
|
|
2858
|
-
$[
|
|
3000
|
+
let t62;
|
|
3001
|
+
if ($[12] !== collectionEditable || $[13] !== errors || $[14] !== fullId || $[15] !== onPropertyClick || $[16] !== onPropertyMove || $[17] !== onPropertyRemove || $[18] !== property.properties || $[19] !== property.propertiesOrder || $[20] !== selectedPropertyKey) {
|
|
3002
|
+
t62 = /* @__PURE__ */ jsxRuntime.jsx(PropertyTree, { selectedPropertyKey, namespace: fullId, properties: property.properties, propertiesOrder: property.propertiesOrder, errors, onPropertyClick, onPropertyMove, onPropertyRemove, collectionEditable });
|
|
3003
|
+
$[12] = collectionEditable;
|
|
3004
|
+
$[13] = errors;
|
|
3005
|
+
$[14] = fullId;
|
|
3006
|
+
$[15] = onPropertyClick;
|
|
3007
|
+
$[16] = onPropertyMove;
|
|
3008
|
+
$[17] = onPropertyRemove;
|
|
3009
|
+
$[18] = property.properties;
|
|
3010
|
+
$[19] = property.propertiesOrder;
|
|
3011
|
+
$[20] = selectedPropertyKey;
|
|
3012
|
+
$[21] = t62;
|
|
2859
3013
|
} else {
|
|
2860
|
-
|
|
3014
|
+
t62 = $[21];
|
|
2861
3015
|
}
|
|
2862
|
-
subtree =
|
|
3016
|
+
subtree = t62;
|
|
2863
3017
|
}
|
|
2864
3018
|
}
|
|
2865
3019
|
const selected = selectedPropertyKey === fullId;
|
|
2866
|
-
let
|
|
2867
|
-
if ($[
|
|
2868
|
-
|
|
2869
|
-
$[
|
|
2870
|
-
$[
|
|
2871
|
-
$[
|
|
3020
|
+
let t6;
|
|
3021
|
+
if ($[22] !== collectionEditable || $[23] !== propertyOrBuilder) {
|
|
3022
|
+
t6 = propertyOrBuilder && (collectionEditable && !core.isPropertyBuilder(propertyOrBuilder) || editableProperty(propertyOrBuilder));
|
|
3023
|
+
$[22] = collectionEditable;
|
|
3024
|
+
$[23] = propertyOrBuilder;
|
|
3025
|
+
$[24] = t6;
|
|
2872
3026
|
} else {
|
|
2873
|
-
|
|
3027
|
+
t6 = $[24];
|
|
2874
3028
|
}
|
|
2875
|
-
const editable =
|
|
2876
|
-
let
|
|
2877
|
-
if ($[
|
|
2878
|
-
|
|
3029
|
+
const editable = t6;
|
|
3030
|
+
let t7;
|
|
3031
|
+
if ($[25] !== subtree) {
|
|
3032
|
+
t7 = subtree && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute border-l " + ui.defaultBorderMixin, style: {
|
|
2879
3033
|
left: "32px",
|
|
2880
3034
|
top: "64px",
|
|
2881
3035
|
bottom: "16px"
|
|
2882
3036
|
} });
|
|
2883
|
-
$[
|
|
2884
|
-
$[
|
|
3037
|
+
$[25] = subtree;
|
|
3038
|
+
$[26] = t7;
|
|
2885
3039
|
} else {
|
|
2886
|
-
|
|
2887
|
-
}
|
|
2888
|
-
let t5;
|
|
2889
|
-
if ($[22] !== additionalField || $[23] !== editable || $[24] !== hasError || $[25] !== namespace || $[26] !== onPropertyClick || $[27] !== propertyKey || $[28] !== propertyOrBuilder || $[29] !== selected) {
|
|
2890
|
-
t5 = !core.isPropertyBuilder(propertyOrBuilder) && !additionalField && editable ? /* @__PURE__ */ jsxRuntime.jsx(PropertyFieldPreview, { property: propertyOrBuilder, onClick: onPropertyClick ? () => onPropertyClick(propertyKey, namespace) : void 0, includeName: true, selected, hasError }) : /* @__PURE__ */ jsxRuntime.jsx(NonEditablePropertyPreview, { name: propertyKey, property: propertyOrBuilder, onClick: onPropertyClick ? () => onPropertyClick(propertyKey, namespace) : void 0, selected });
|
|
2891
|
-
$[22] = additionalField;
|
|
2892
|
-
$[23] = editable;
|
|
2893
|
-
$[24] = hasError;
|
|
2894
|
-
$[25] = namespace;
|
|
2895
|
-
$[26] = onPropertyClick;
|
|
2896
|
-
$[27] = propertyKey;
|
|
2897
|
-
$[28] = propertyOrBuilder;
|
|
2898
|
-
$[29] = selected;
|
|
2899
|
-
$[30] = t5;
|
|
2900
|
-
} else {
|
|
2901
|
-
t5 = $[30];
|
|
2902
|
-
}
|
|
2903
|
-
let t6;
|
|
2904
|
-
if ($[31] !== isPropertyInferred) {
|
|
2905
|
-
t6 = isPropertyInferred && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Inferred property", children: /* @__PURE__ */ jsxRuntime.jsx(ui.AutorenewIcon, { size: "small", className: "p-2" }) });
|
|
2906
|
-
$[31] = isPropertyInferred;
|
|
2907
|
-
$[32] = t6;
|
|
2908
|
-
} else {
|
|
2909
|
-
t6 = $[32];
|
|
2910
|
-
}
|
|
2911
|
-
let t7;
|
|
2912
|
-
if ($[33] !== namespace || $[34] !== onPropertyRemove || $[35] !== propertyKey) {
|
|
2913
|
-
t7 = onPropertyRemove && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Remove", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", color: "inherit", onClick: () => onPropertyRemove(propertyKey, namespace), children: /* @__PURE__ */ jsxRuntime.jsx(ui.RemoveIcon, { size: "small" }) }) });
|
|
2914
|
-
$[33] = namespace;
|
|
2915
|
-
$[34] = onPropertyRemove;
|
|
2916
|
-
$[35] = propertyKey;
|
|
2917
|
-
$[36] = t7;
|
|
2918
|
-
} else {
|
|
2919
|
-
t7 = $[36];
|
|
3040
|
+
t7 = $[26];
|
|
2920
3041
|
}
|
|
2921
3042
|
let t8;
|
|
2922
|
-
if ($[
|
|
2923
|
-
t8 =
|
|
2924
|
-
$[
|
|
2925
|
-
$[
|
|
3043
|
+
if ($[27] !== additionalField || $[28] !== editable || $[29] !== hasError || $[30] !== namespace || $[31] !== onPropertyClick || $[32] !== propertyKey || $[33] !== propertyOrBuilder || $[34] !== selected) {
|
|
3044
|
+
t8 = /* @__PURE__ */ jsxRuntime.jsx("div", { children: !core.isPropertyBuilder(propertyOrBuilder) && !additionalField && editable ? /* @__PURE__ */ jsxRuntime.jsx(PropertyFieldPreview, { property: propertyOrBuilder, onClick: onPropertyClick ? () => onPropertyClick(propertyKey, namespace) : void 0, includeName: true, selected, hasError }) : /* @__PURE__ */ jsxRuntime.jsx(NonEditablePropertyPreview, { name: propertyKey, property: propertyOrBuilder, onClick: onPropertyClick ? () => onPropertyClick(propertyKey, namespace) : void 0, selected }) });
|
|
3045
|
+
$[27] = additionalField;
|
|
3046
|
+
$[28] = editable;
|
|
3047
|
+
$[29] = hasError;
|
|
3048
|
+
$[30] = namespace;
|
|
3049
|
+
$[31] = onPropertyClick;
|
|
3050
|
+
$[32] = propertyKey;
|
|
3051
|
+
$[33] = propertyOrBuilder;
|
|
3052
|
+
$[34] = selected;
|
|
3053
|
+
$[35] = t8;
|
|
2926
3054
|
} else {
|
|
2927
|
-
t8 = $[
|
|
3055
|
+
t8 = $[35];
|
|
2928
3056
|
}
|
|
2929
3057
|
let t9;
|
|
2930
|
-
if ($[
|
|
2931
|
-
t9 = /* @__PURE__ */ jsxRuntime.
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
t8
|
|
2935
|
-
] });
|
|
2936
|
-
$[39] = t6;
|
|
2937
|
-
$[40] = t7;
|
|
2938
|
-
$[41] = t8;
|
|
2939
|
-
$[42] = t9;
|
|
3058
|
+
if ($[36] !== isPropertyInferred) {
|
|
3059
|
+
t9 = isPropertyInferred && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Inferred property", children: /* @__PURE__ */ jsxRuntime.jsx(ui.AutorenewIcon, { size: "small", className: "p-2" }) });
|
|
3060
|
+
$[36] = isPropertyInferred;
|
|
3061
|
+
$[37] = t9;
|
|
2940
3062
|
} else {
|
|
2941
|
-
t9 = $[
|
|
3063
|
+
t9 = $[37];
|
|
2942
3064
|
}
|
|
2943
3065
|
let t10;
|
|
2944
|
-
if ($[
|
|
2945
|
-
t10 =
|
|
2946
|
-
$[
|
|
2947
|
-
$[
|
|
3066
|
+
if ($[38] !== isPropertyInferred || $[39] !== namespace || $[40] !== onPropertyRemove || $[41] !== propertyKey) {
|
|
3067
|
+
t10 = onPropertyRemove && !isPropertyInferred && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Remove", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", color: "inherit", onClick: () => onPropertyRemove(propertyKey, namespace), children: /* @__PURE__ */ jsxRuntime.jsx(ui.RemoveIcon, { size: "small" }) }) });
|
|
3068
|
+
$[38] = isPropertyInferred;
|
|
3069
|
+
$[39] = namespace;
|
|
3070
|
+
$[40] = onPropertyRemove;
|
|
3071
|
+
$[41] = propertyKey;
|
|
3072
|
+
$[42] = t10;
|
|
2948
3073
|
} else {
|
|
2949
|
-
t10 = $[
|
|
3074
|
+
t10 = $[42];
|
|
2950
3075
|
}
|
|
2951
3076
|
let t11;
|
|
2952
|
-
if ($[
|
|
2953
|
-
t11 = /* @__PURE__ */ jsxRuntime.
|
|
2954
|
-
|
|
2955
|
-
|
|
3077
|
+
if ($[43] !== attributes || $[44] !== listeners || $[45] !== onPropertyMove) {
|
|
3078
|
+
t11 = onPropertyMove && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Move", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { component: "span", size: "small", ...attributes, ...listeners, children: /* @__PURE__ */ jsxRuntime.jsx(ui.DragHandleIcon, { size: "small" }) }) });
|
|
3079
|
+
$[43] = attributes;
|
|
3080
|
+
$[44] = listeners;
|
|
3081
|
+
$[45] = onPropertyMove;
|
|
3082
|
+
$[46] = t11;
|
|
3083
|
+
} else {
|
|
3084
|
+
t11 = $[46];
|
|
3085
|
+
}
|
|
3086
|
+
let t12;
|
|
3087
|
+
if ($[47] !== t10 || $[48] !== t11 || $[49] !== t9) {
|
|
3088
|
+
t12 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute top-2 right-2 flex flex-row", children: [
|
|
2956
3089
|
t9,
|
|
2957
|
-
t10
|
|
3090
|
+
t10,
|
|
3091
|
+
t11
|
|
2958
3092
|
] });
|
|
2959
|
-
$[
|
|
2960
|
-
$[
|
|
2961
|
-
$[
|
|
2962
|
-
$[
|
|
2963
|
-
$[49] = t4;
|
|
2964
|
-
$[50] = t5;
|
|
2965
|
-
$[51] = t9;
|
|
2966
|
-
$[52] = t11;
|
|
3093
|
+
$[47] = t10;
|
|
3094
|
+
$[48] = t11;
|
|
3095
|
+
$[49] = t9;
|
|
3096
|
+
$[50] = t12;
|
|
2967
3097
|
} else {
|
|
2968
|
-
|
|
3098
|
+
t12 = $[50];
|
|
2969
3099
|
}
|
|
2970
|
-
|
|
3100
|
+
let t13;
|
|
3101
|
+
if ($[51] !== subtree) {
|
|
3102
|
+
t13 = subtree && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-16", children: subtree });
|
|
3103
|
+
$[51] = subtree;
|
|
3104
|
+
$[52] = t13;
|
|
3105
|
+
} else {
|
|
3106
|
+
t13 = $[52];
|
|
3107
|
+
}
|
|
3108
|
+
let t14;
|
|
3109
|
+
if ($[53] !== t12 || $[54] !== t13 || $[55] !== t7 || $[56] !== t8) {
|
|
3110
|
+
t14 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
3111
|
+
t7,
|
|
3112
|
+
t8,
|
|
3113
|
+
t12,
|
|
3114
|
+
t13
|
|
3115
|
+
] });
|
|
3116
|
+
$[53] = t12;
|
|
3117
|
+
$[54] = t13;
|
|
3118
|
+
$[55] = t7;
|
|
3119
|
+
$[56] = t8;
|
|
3120
|
+
$[57] = t14;
|
|
3121
|
+
} else {
|
|
3122
|
+
t14 = $[57];
|
|
3123
|
+
}
|
|
3124
|
+
let t15;
|
|
3125
|
+
if ($[58] !== setNodeRef || $[59] !== style || $[60] !== t14) {
|
|
3126
|
+
t15 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: setNodeRef, style, className: "relative -ml-8", children: t14 });
|
|
3127
|
+
$[58] = setNodeRef;
|
|
3128
|
+
$[59] = style;
|
|
3129
|
+
$[60] = t14;
|
|
3130
|
+
$[61] = t15;
|
|
3131
|
+
} else {
|
|
3132
|
+
t15 = $[61];
|
|
3133
|
+
}
|
|
3134
|
+
return t15;
|
|
2971
3135
|
}
|
|
2972
3136
|
function MapPropertyField(t0) {
|
|
2973
3137
|
const $ = reactCompilerRuntime.c(67);
|
|
@@ -3181,7 +3345,7 @@
|
|
|
3181
3345
|
const t19 = values.spreadChildren ?? false;
|
|
3182
3346
|
let t20;
|
|
3183
3347
|
if ($[40] !== t18 || $[41] !== t19) {
|
|
3184
|
-
t20 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "
|
|
3348
|
+
t20 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "medium", label: "Spread children as columns", onValueChange: t18, value: t19 });
|
|
3185
3349
|
$[40] = t18;
|
|
3186
3350
|
$[41] = t19;
|
|
3187
3351
|
$[42] = t20;
|
|
@@ -4226,7 +4390,8 @@
|
|
|
4226
4390
|
existing,
|
|
4227
4391
|
multiple,
|
|
4228
4392
|
disabled,
|
|
4229
|
-
showErrors
|
|
4393
|
+
showErrors,
|
|
4394
|
+
asString
|
|
4230
4395
|
} = t0;
|
|
4231
4396
|
const {
|
|
4232
4397
|
values,
|
|
@@ -4244,7 +4409,7 @@
|
|
|
4244
4409
|
}
|
|
4245
4410
|
return t12;
|
|
4246
4411
|
}
|
|
4247
|
-
const pathPath = multiple ? "of.path" : "path";
|
|
4412
|
+
const pathPath = asString ? "reference.path" : multiple ? "of.path" : "path";
|
|
4248
4413
|
let t1;
|
|
4249
4414
|
if ($[1] !== pathPath || $[2] !== values) {
|
|
4250
4415
|
t1 = formex.getIn(values, pathPath);
|
|
@@ -4335,8 +4500,8 @@
|
|
|
4335
4500
|
const collections = t1;
|
|
4336
4501
|
let t2;
|
|
4337
4502
|
if ($[10] !== collections || $[11] !== disabled || $[12] !== error || $[13] !== handleChange || $[14] !== pathPath || $[15] !== props || $[16] !== value) {
|
|
4338
|
-
const groups = Array.from(new Set(Object.values(collections).map(_temp$
|
|
4339
|
-
const ungroupedCollections = collections.filter(_temp2$
|
|
4503
|
+
const groups = Array.from(new Set(Object.values(collections).map(_temp$9).filter(Boolean)).values());
|
|
4504
|
+
const ungroupedCollections = collections.filter(_temp2$6);
|
|
4340
4505
|
let t32;
|
|
4341
4506
|
if ($[18] !== collections) {
|
|
4342
4507
|
t32 = (selected) => {
|
|
@@ -4367,7 +4532,7 @@
|
|
|
4367
4532
|
}
|
|
4368
4533
|
t2 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { error: Boolean(error), disabled, value: value ?? "", position: "item-aligned", name: pathPath, size: "large", fullWidth: true, onChange: handleChange, label: "Target collection", renderValue: t32, ...props, children: [
|
|
4369
4534
|
groups.flatMap(t42),
|
|
4370
|
-
ungroupedCollections && /* @__PURE__ */ jsxRuntime.jsx(ui.SelectGroup, { label: "Views", children: ungroupedCollections.map(_temp3$
|
|
4535
|
+
ungroupedCollections && /* @__PURE__ */ jsxRuntime.jsx(ui.SelectGroup, { label: "Views", children: ungroupedCollections.map(_temp3$3) })
|
|
4371
4536
|
] });
|
|
4372
4537
|
$[10] = collections;
|
|
4373
4538
|
$[11] = disabled;
|
|
@@ -4400,16 +4565,16 @@
|
|
|
4400
4565
|
}
|
|
4401
4566
|
return t4;
|
|
4402
4567
|
}
|
|
4403
|
-
function _temp3$
|
|
4568
|
+
function _temp3$3(collection_2) {
|
|
4404
4569
|
return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: collection_2.id ?? collection_2.path, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row", children: [
|
|
4405
4570
|
/* @__PURE__ */ jsxRuntime.jsx(core.IconForView, { collectionOrView: collection_2 }),
|
|
4406
4571
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "font-medium ml-4", children: collection_2?.name.toUpperCase() })
|
|
4407
4572
|
] }) }, collection_2.id ?? collection_2.path);
|
|
4408
4573
|
}
|
|
4409
|
-
function _temp2$
|
|
4574
|
+
function _temp2$6(col) {
|
|
4410
4575
|
return !col.group;
|
|
4411
4576
|
}
|
|
4412
|
-
function _temp$
|
|
4577
|
+
function _temp$9(e) {
|
|
4413
4578
|
return e.group;
|
|
4414
4579
|
}
|
|
4415
4580
|
function DateTimePropertyField(t0) {
|
|
@@ -4484,7 +4649,7 @@
|
|
|
4484
4649
|
}
|
|
4485
4650
|
let t10;
|
|
4486
4651
|
if ($[14] !== disabled || $[15] !== t5 || $[16] !== t6 || $[17] !== t7) {
|
|
4487
|
-
t10 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { name: "mode", value: t5, error: t6, size: "large", onValueChange: t7, label: "Mode", fullWidth: true, renderValue: _temp$
|
|
4652
|
+
t10 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { name: "mode", value: t5, error: t6, size: "large", onValueChange: t7, label: "Mode", fullWidth: true, renderValue: _temp$8, disabled, children: [
|
|
4488
4653
|
t8,
|
|
4489
4654
|
t9
|
|
4490
4655
|
] });
|
|
@@ -4545,7 +4710,7 @@
|
|
|
4545
4710
|
}
|
|
4546
4711
|
let t20;
|
|
4547
4712
|
if ($[30] !== disabled || $[31] !== t14 || $[32] !== t15 || $[33] !== t16) {
|
|
4548
|
-
t20 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { name: "autoValue", disabled, size: "large", fullWidth: true, value: t14, onValueChange: t15, renderValue: _temp2$
|
|
4713
|
+
t20 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { name: "autoValue", disabled, size: "large", fullWidth: true, value: t14, onValueChange: t15, renderValue: _temp2$5, error: t16, label: "Automatic value", children: [
|
|
4549
4714
|
t17,
|
|
4550
4715
|
t18,
|
|
4551
4716
|
t19
|
|
@@ -4615,7 +4780,7 @@
|
|
|
4615
4780
|
}
|
|
4616
4781
|
return t27;
|
|
4617
4782
|
}
|
|
4618
|
-
function _temp2$
|
|
4783
|
+
function _temp2$5(v_2) {
|
|
4619
4784
|
switch (v_2) {
|
|
4620
4785
|
case "on_create": {
|
|
4621
4786
|
return "On create";
|
|
@@ -4628,7 +4793,7 @@
|
|
|
4628
4793
|
}
|
|
4629
4794
|
}
|
|
4630
4795
|
}
|
|
4631
|
-
function _temp$
|
|
4796
|
+
function _temp$8(v_0) {
|
|
4632
4797
|
switch (v_0) {
|
|
4633
4798
|
case "date_time": {
|
|
4634
4799
|
return "Date/Time";
|
|
@@ -4653,7 +4818,7 @@
|
|
|
4653
4818
|
field,
|
|
4654
4819
|
form
|
|
4655
4820
|
} = t22;
|
|
4656
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SwitchControl, { label: "Hide from collection", disabled, form, tooltip: "Hide this field from the collection view. It will still be visible in the form view", field });
|
|
4821
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SwitchControl, { label: "Hide from collection", size: "medium", disabled, form, tooltip: "Hide this field from the collection view. It will still be visible in the form view", field });
|
|
4657
4822
|
} }) });
|
|
4658
4823
|
$[0] = disabled;
|
|
4659
4824
|
$[1] = t1;
|
|
@@ -4667,7 +4832,7 @@
|
|
|
4667
4832
|
field: field_0,
|
|
4668
4833
|
form: form_0
|
|
4669
4834
|
} = t32;
|
|
4670
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SwitchControl, { label: "Read only", disabled, tooltip: "Is this a read only field. Display only as a preview", form: form_0, field: field_0 });
|
|
4835
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SwitchControl, { label: "Read only", size: "medium", disabled, tooltip: "Is this a read only field. Display only as a preview", form: form_0, field: field_0 });
|
|
4671
4836
|
} }) });
|
|
4672
4837
|
$[2] = disabled;
|
|
4673
4838
|
$[3] = t2;
|
|
@@ -4853,6 +5018,12 @@
|
|
|
4853
5018
|
propertyConfig: "reference",
|
|
4854
5019
|
editable: propertyData.editable !== void 0 ? propertyData.editable : true
|
|
4855
5020
|
});
|
|
5021
|
+
} else if (selectedWidgetId === "reference_as_string") {
|
|
5022
|
+
updatedProperty = core.mergeDeep(propertyData, {
|
|
5023
|
+
dataType: "string",
|
|
5024
|
+
propertyConfig: "reference_as_string",
|
|
5025
|
+
editable: propertyData.editable !== void 0 ? propertyData.editable : true
|
|
5026
|
+
});
|
|
4856
5027
|
} else if (selectedWidgetId === "multi_references") {
|
|
4857
5028
|
updatedProperty = core.mergeDeep(propertyData, {
|
|
4858
5029
|
dataType: "array",
|
|
@@ -4953,7 +5124,7 @@
|
|
|
4953
5124
|
}
|
|
4954
5125
|
let t8;
|
|
4955
5126
|
if ($[8] !== disabled || $[9] !== t2 || $[10] !== t3) {
|
|
4956
|
-
t8 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { disabled, position: "item-aligned", fullWidth: true, onValueChange: t2, label: "Preview type", renderValue: _temp$
|
|
5127
|
+
t8 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { disabled, position: "item-aligned", fullWidth: true, onValueChange: t2, label: "Preview type", renderValue: _temp$7, value: t3, children: [
|
|
4957
5128
|
t4,
|
|
4958
5129
|
t5,
|
|
4959
5130
|
t6,
|
|
@@ -5019,7 +5190,7 @@
|
|
|
5019
5190
|
}
|
|
5020
5191
|
return t13;
|
|
5021
5192
|
}
|
|
5022
|
-
function _temp$
|
|
5193
|
+
function _temp$7(value_0) {
|
|
5023
5194
|
switch (value_0) {
|
|
5024
5195
|
case "image": {
|
|
5025
5196
|
return "Image";
|
|
@@ -5035,7 +5206,7 @@
|
|
|
5035
5206
|
}
|
|
5036
5207
|
}
|
|
5037
5208
|
}
|
|
5038
|
-
const supportedFieldsIds = ["text_field", "multiline", "markdown", "url", "email", "select", "multi_select", "number_input", "number_select", "multi_number_select", "file_upload", "multi_file_upload", "reference", "multi_references", "switch", "date_time", "group", "key_value", "repeat", "block"];
|
|
5209
|
+
const supportedFieldsIds = ["text_field", "multiline", "markdown", "url", "email", "select", "multi_select", "number_input", "number_select", "multi_number_select", "file_upload", "multi_file_upload", "reference", "reference_as_string", "multi_references", "switch", "date_time", "group", "key_value", "repeat", "block"];
|
|
5039
5210
|
const supportedFields = Object.entries(core.DEFAULT_FIELD_CONFIGS).filter(([id]) => supportedFieldsIds.includes(id)).map(([id, config]) => ({
|
|
5040
5211
|
[id]: config
|
|
5041
5212
|
})).reduce((a, b) => ({
|
|
@@ -5659,7 +5830,7 @@
|
|
|
5659
5830
|
}
|
|
5660
5831
|
let t7;
|
|
5661
5832
|
if ($[20] !== onCancel) {
|
|
5662
|
-
t7 = onCancel && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", onClick: () => {
|
|
5833
|
+
t7 = onCancel && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", color: "primary", onClick: () => {
|
|
5663
5834
|
onCancel();
|
|
5664
5835
|
formexRef.current?.resetForm();
|
|
5665
5836
|
}, children: "Cancel" });
|
|
@@ -5711,7 +5882,7 @@
|
|
|
5711
5882
|
return t11;
|
|
5712
5883
|
}
|
|
5713
5884
|
function PropertyEditFormFields(t0) {
|
|
5714
|
-
const $ = reactCompilerRuntime.c(
|
|
5885
|
+
const $ = reactCompilerRuntime.c(146);
|
|
5715
5886
|
const {
|
|
5716
5887
|
values,
|
|
5717
5888
|
errors,
|
|
@@ -5800,7 +5971,7 @@
|
|
|
5800
5971
|
let t6;
|
|
5801
5972
|
if ($[14] !== errors || $[15] !== onError || $[16] !== propertyNamespace || $[17] !== values?.id) {
|
|
5802
5973
|
t6 = () => {
|
|
5803
|
-
if (values?.id && onError
|
|
5974
|
+
if (values?.id && onError) {
|
|
5804
5975
|
onError(values?.id, propertyNamespace, errors);
|
|
5805
5976
|
}
|
|
5806
5977
|
};
|
|
@@ -6000,59 +6171,73 @@
|
|
|
6000
6171
|
}
|
|
6001
6172
|
childComponent = t102;
|
|
6002
6173
|
} else {
|
|
6003
|
-
if (selectedFieldConfigId === "
|
|
6174
|
+
if (selectedFieldConfigId === "reference_as_string") {
|
|
6004
6175
|
let t102;
|
|
6005
|
-
if ($[75] !== disabled) {
|
|
6006
|
-
t102 = /* @__PURE__ */ jsxRuntime.jsx(
|
|
6176
|
+
if ($[75] !== disabled || $[76] !== existing || $[77] !== showErrors) {
|
|
6177
|
+
t102 = /* @__PURE__ */ jsxRuntime.jsx(ReferencePropertyField, { showErrors, existing, asString: true, multiple: false, disabled });
|
|
6007
6178
|
$[75] = disabled;
|
|
6008
|
-
$[76] =
|
|
6179
|
+
$[76] = existing;
|
|
6180
|
+
$[77] = showErrors;
|
|
6181
|
+
$[78] = t102;
|
|
6009
6182
|
} else {
|
|
6010
|
-
t102 = $[
|
|
6183
|
+
t102 = $[78];
|
|
6011
6184
|
}
|
|
6012
6185
|
childComponent = t102;
|
|
6013
6186
|
} else {
|
|
6014
|
-
if (selectedFieldConfigId === "
|
|
6187
|
+
if (selectedFieldConfigId === "date_time") {
|
|
6015
6188
|
let t102;
|
|
6016
|
-
if ($[
|
|
6017
|
-
t102 = /* @__PURE__ */ jsxRuntime.jsx(
|
|
6018
|
-
$[
|
|
6019
|
-
$[78] = existing;
|
|
6020
|
-
$[79] = showErrors;
|
|
6189
|
+
if ($[79] !== disabled) {
|
|
6190
|
+
t102 = /* @__PURE__ */ jsxRuntime.jsx(DateTimePropertyField, { disabled });
|
|
6191
|
+
$[79] = disabled;
|
|
6021
6192
|
$[80] = t102;
|
|
6022
6193
|
} else {
|
|
6023
6194
|
t102 = $[80];
|
|
6024
6195
|
}
|
|
6025
6196
|
childComponent = t102;
|
|
6026
6197
|
} else {
|
|
6027
|
-
if (selectedFieldConfigId === "
|
|
6198
|
+
if (selectedFieldConfigId === "multi_references") {
|
|
6028
6199
|
let t102;
|
|
6029
|
-
if ($[81] !==
|
|
6030
|
-
t102 = /* @__PURE__ */ jsxRuntime.jsx(
|
|
6031
|
-
$[81] =
|
|
6032
|
-
$[82] =
|
|
6033
|
-
$[83] =
|
|
6034
|
-
$[84] =
|
|
6035
|
-
$[85] = getData;
|
|
6036
|
-
$[86] = propertyConfigs;
|
|
6037
|
-
$[87] = showErrors;
|
|
6038
|
-
$[88] = t102;
|
|
6200
|
+
if ($[81] !== disabled || $[82] !== existing || $[83] !== showErrors) {
|
|
6201
|
+
t102 = /* @__PURE__ */ jsxRuntime.jsx(ReferencePropertyField, { showErrors, existing, multiple: true, disabled });
|
|
6202
|
+
$[81] = disabled;
|
|
6203
|
+
$[82] = existing;
|
|
6204
|
+
$[83] = showErrors;
|
|
6205
|
+
$[84] = t102;
|
|
6039
6206
|
} else {
|
|
6040
|
-
t102 = $[
|
|
6207
|
+
t102 = $[84];
|
|
6041
6208
|
}
|
|
6042
6209
|
childComponent = t102;
|
|
6043
6210
|
} else {
|
|
6044
|
-
if (selectedFieldConfigId === "
|
|
6211
|
+
if (selectedFieldConfigId === "repeat") {
|
|
6045
6212
|
let t102;
|
|
6046
|
-
if ($[89] !==
|
|
6047
|
-
t102 = /* @__PURE__ */ jsxRuntime.jsx(
|
|
6048
|
-
$[
|
|
6049
|
-
$[
|
|
6213
|
+
if ($[85] !== allowDataInference || $[86] !== collectionEditable || $[87] !== disabled || $[88] !== existing || $[89] !== getData || $[90] !== propertyConfigs || $[91] !== showErrors) {
|
|
6214
|
+
t102 = /* @__PURE__ */ jsxRuntime.jsx(RepeatPropertyField, { showErrors, existing, getData, allowDataInference, disabled, collectionEditable, propertyConfigs });
|
|
6215
|
+
$[85] = allowDataInference;
|
|
6216
|
+
$[86] = collectionEditable;
|
|
6217
|
+
$[87] = disabled;
|
|
6218
|
+
$[88] = existing;
|
|
6219
|
+
$[89] = getData;
|
|
6220
|
+
$[90] = propertyConfigs;
|
|
6221
|
+
$[91] = showErrors;
|
|
6222
|
+
$[92] = t102;
|
|
6050
6223
|
} else {
|
|
6051
|
-
t102 = $[
|
|
6224
|
+
t102 = $[92];
|
|
6052
6225
|
}
|
|
6053
6226
|
childComponent = t102;
|
|
6054
6227
|
} else {
|
|
6055
|
-
|
|
6228
|
+
if (selectedFieldConfigId === "key_value") {
|
|
6229
|
+
let t102;
|
|
6230
|
+
if ($[93] !== disabled) {
|
|
6231
|
+
t102 = /* @__PURE__ */ jsxRuntime.jsx(KeyValuePropertyField, { disabled });
|
|
6232
|
+
$[93] = disabled;
|
|
6233
|
+
$[94] = t102;
|
|
6234
|
+
} else {
|
|
6235
|
+
t102 = $[94];
|
|
6236
|
+
}
|
|
6237
|
+
childComponent = t102;
|
|
6238
|
+
} else {
|
|
6239
|
+
childComponent = null;
|
|
6240
|
+
}
|
|
6056
6241
|
}
|
|
6057
6242
|
}
|
|
6058
6243
|
}
|
|
@@ -6070,7 +6255,7 @@
|
|
|
6070
6255
|
}
|
|
6071
6256
|
}
|
|
6072
6257
|
let t10;
|
|
6073
|
-
if ($[
|
|
6258
|
+
if ($[95] !== disabled) {
|
|
6074
6259
|
t10 = disabled && /* @__PURE__ */ jsxRuntime.jsxs(ui.InfoLabel, { mode: "warn", children: [
|
|
6075
6260
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { children: "This property can't be edited" }),
|
|
6076
6261
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "caption", children: [
|
|
@@ -6079,157 +6264,157 @@
|
|
|
6079
6264
|
" flag"
|
|
6080
6265
|
] })
|
|
6081
6266
|
] });
|
|
6082
|
-
$[
|
|
6083
|
-
$[
|
|
6267
|
+
$[95] = disabled;
|
|
6268
|
+
$[96] = t10;
|
|
6084
6269
|
} else {
|
|
6085
|
-
t10 = $[
|
|
6270
|
+
t10 = $[96];
|
|
6086
6271
|
}
|
|
6087
6272
|
const t11 = selectedFieldConfigId;
|
|
6088
6273
|
let t12;
|
|
6089
|
-
if ($[
|
|
6274
|
+
if ($[97] !== onWidgetSelectChanged) {
|
|
6090
6275
|
t12 = (value) => onWidgetSelectChanged(value);
|
|
6091
|
-
$[
|
|
6092
|
-
$[
|
|
6276
|
+
$[97] = onWidgetSelectChanged;
|
|
6277
|
+
$[98] = t12;
|
|
6093
6278
|
} else {
|
|
6094
|
-
t12 = $[
|
|
6279
|
+
t12 = $[98];
|
|
6095
6280
|
}
|
|
6096
6281
|
let t13;
|
|
6097
|
-
if ($[
|
|
6282
|
+
if ($[99] !== onDismiss) {
|
|
6098
6283
|
t13 = (open, hasValue) => {
|
|
6099
6284
|
if (!hasValue) {
|
|
6100
6285
|
onDismiss?.();
|
|
6101
6286
|
}
|
|
6102
6287
|
setSelectOpen(open);
|
|
6103
6288
|
};
|
|
6104
|
-
$[
|
|
6105
|
-
$[
|
|
6289
|
+
$[99] = onDismiss;
|
|
6290
|
+
$[100] = t13;
|
|
6106
6291
|
} else {
|
|
6107
|
-
t13 = $[
|
|
6292
|
+
t13 = $[100];
|
|
6108
6293
|
}
|
|
6109
6294
|
const t14 = Boolean(selectedWidgetError);
|
|
6110
6295
|
let t15;
|
|
6111
|
-
if ($[
|
|
6296
|
+
if ($[101] !== disabled || $[102] !== existing || $[103] !== inArray || $[104] !== propertyConfigs || $[105] !== selectOpen || $[106] !== t11 || $[107] !== t12 || $[108] !== t13 || $[109] !== t14 || $[110] !== values) {
|
|
6112
6297
|
t15 = /* @__PURE__ */ jsxRuntime.jsx(WidgetSelectView, { initialProperty: values, value: t11, onValueChange: t12, open: selectOpen, onOpenChange: t13, disabled, showError: t14, existing, propertyConfigs, inArray });
|
|
6113
|
-
$[
|
|
6114
|
-
$[
|
|
6115
|
-
$[
|
|
6116
|
-
$[
|
|
6117
|
-
$[
|
|
6118
|
-
$[
|
|
6119
|
-
$[
|
|
6120
|
-
$[
|
|
6121
|
-
$[
|
|
6122
|
-
$[
|
|
6123
|
-
$[
|
|
6124
|
-
} else {
|
|
6125
|
-
t15 = $[
|
|
6298
|
+
$[101] = disabled;
|
|
6299
|
+
$[102] = existing;
|
|
6300
|
+
$[103] = inArray;
|
|
6301
|
+
$[104] = propertyConfigs;
|
|
6302
|
+
$[105] = selectOpen;
|
|
6303
|
+
$[106] = t11;
|
|
6304
|
+
$[107] = t12;
|
|
6305
|
+
$[108] = t13;
|
|
6306
|
+
$[109] = t14;
|
|
6307
|
+
$[110] = values;
|
|
6308
|
+
$[111] = t15;
|
|
6309
|
+
} else {
|
|
6310
|
+
t15 = $[111];
|
|
6126
6311
|
}
|
|
6127
6312
|
let t16;
|
|
6128
|
-
if ($[
|
|
6313
|
+
if ($[112] !== selectedWidgetError) {
|
|
6129
6314
|
t16 = selectedWidgetError && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "ml-3.5", color: "error", children: "Required" });
|
|
6130
|
-
$[
|
|
6131
|
-
$[
|
|
6315
|
+
$[112] = selectedWidgetError;
|
|
6316
|
+
$[113] = t16;
|
|
6132
6317
|
} else {
|
|
6133
|
-
t16 = $[
|
|
6318
|
+
t16 = $[113];
|
|
6134
6319
|
}
|
|
6135
6320
|
let t17;
|
|
6136
|
-
if ($[
|
|
6321
|
+
if ($[114] !== t15 || $[115] !== t16) {
|
|
6137
6322
|
t17 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex flex-col gap-2", children: [
|
|
6138
6323
|
t15,
|
|
6139
6324
|
t16
|
|
6140
6325
|
] });
|
|
6141
|
-
$[
|
|
6142
|
-
$[
|
|
6143
|
-
$[
|
|
6326
|
+
$[114] = t15;
|
|
6327
|
+
$[115] = t16;
|
|
6328
|
+
$[116] = t17;
|
|
6144
6329
|
} else {
|
|
6145
|
-
t17 = $[
|
|
6330
|
+
t17 = $[116];
|
|
6146
6331
|
}
|
|
6147
6332
|
let t18;
|
|
6148
|
-
if ($[
|
|
6333
|
+
if ($[117] !== disabled || $[118] !== onDelete || $[119] !== values?.id) {
|
|
6149
6334
|
t18 = onDelete && values?.id && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { variant: "ghost", className: "m-4", disabled, onClick: () => setDeleteDialogOpen(true), children: /* @__PURE__ */ jsxRuntime.jsx(ui.DeleteIcon, {}) });
|
|
6150
|
-
$[
|
|
6151
|
-
$[
|
|
6152
|
-
$[
|
|
6153
|
-
$[
|
|
6335
|
+
$[117] = disabled;
|
|
6336
|
+
$[118] = onDelete;
|
|
6337
|
+
$[119] = values?.id;
|
|
6338
|
+
$[120] = t18;
|
|
6154
6339
|
} else {
|
|
6155
|
-
t18 = $[
|
|
6340
|
+
t18 = $[120];
|
|
6156
6341
|
}
|
|
6157
6342
|
let t19;
|
|
6158
|
-
if ($[
|
|
6343
|
+
if ($[121] !== t17 || $[122] !== t18) {
|
|
6159
6344
|
t19 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex mt-2 justify-between", children: [
|
|
6160
6345
|
t17,
|
|
6161
6346
|
t18
|
|
6162
6347
|
] });
|
|
6163
|
-
$[
|
|
6164
|
-
$[
|
|
6165
|
-
$[
|
|
6348
|
+
$[121] = t17;
|
|
6349
|
+
$[122] = t18;
|
|
6350
|
+
$[123] = t19;
|
|
6166
6351
|
} else {
|
|
6167
|
-
t19 = $[
|
|
6352
|
+
t19 = $[123];
|
|
6168
6353
|
}
|
|
6169
6354
|
let t20;
|
|
6170
|
-
if ($[
|
|
6355
|
+
if ($[124] !== autoUpdateId || $[125] !== disabled || $[126] !== existing || $[127] !== includeIdAndTitle || $[128] !== showErrors) {
|
|
6171
6356
|
t20 = includeIdAndTitle && /* @__PURE__ */ jsxRuntime.jsx(CommonPropertyFields, { showErrors, disabledId: existing, isNewProperty: !existing, disabled, autoUpdateId, ref: nameFieldRef });
|
|
6172
|
-
$[
|
|
6173
|
-
$[
|
|
6174
|
-
$[
|
|
6175
|
-
$[
|
|
6176
|
-
$[
|
|
6177
|
-
$[
|
|
6357
|
+
$[124] = autoUpdateId;
|
|
6358
|
+
$[125] = disabled;
|
|
6359
|
+
$[126] = existing;
|
|
6360
|
+
$[127] = includeIdAndTitle;
|
|
6361
|
+
$[128] = showErrors;
|
|
6362
|
+
$[129] = t20;
|
|
6178
6363
|
} else {
|
|
6179
|
-
t20 = $[
|
|
6364
|
+
t20 = $[129];
|
|
6180
6365
|
}
|
|
6181
6366
|
let t21;
|
|
6182
|
-
if ($[
|
|
6367
|
+
if ($[130] !== disabled) {
|
|
6183
6368
|
t21 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsx(AdvancedPropertyValidation, { disabled }) });
|
|
6184
|
-
$[
|
|
6185
|
-
$[
|
|
6369
|
+
$[130] = disabled;
|
|
6370
|
+
$[131] = t21;
|
|
6186
6371
|
} else {
|
|
6187
|
-
t21 = $[
|
|
6372
|
+
t21 = $[131];
|
|
6188
6373
|
}
|
|
6189
6374
|
let t22;
|
|
6190
|
-
if ($[
|
|
6375
|
+
if ($[132] !== childComponent || $[133] !== t20 || $[134] !== t21) {
|
|
6191
6376
|
t22 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-12 gap-y-12 mt-8 mb-8", children: [
|
|
6192
6377
|
t20,
|
|
6193
6378
|
childComponent,
|
|
6194
6379
|
t21
|
|
6195
6380
|
] });
|
|
6196
|
-
$[
|
|
6197
|
-
$[
|
|
6198
|
-
$[
|
|
6199
|
-
$[
|
|
6381
|
+
$[132] = childComponent;
|
|
6382
|
+
$[133] = t20;
|
|
6383
|
+
$[134] = t21;
|
|
6384
|
+
$[135] = t22;
|
|
6200
6385
|
} else {
|
|
6201
|
-
t22 = $[
|
|
6386
|
+
t22 = $[135];
|
|
6202
6387
|
}
|
|
6203
6388
|
let t23;
|
|
6204
|
-
if ($[
|
|
6389
|
+
if ($[136] !== deleteDialogOpen || $[137] !== onDelete || $[138] !== propertyNamespace || $[139] !== values?.id) {
|
|
6205
6390
|
t23 = onDelete && /* @__PURE__ */ jsxRuntime.jsx(core.ConfirmationDialog, { open: deleteDialogOpen, onAccept: () => onDelete(values?.id, propertyNamespace), onCancel: () => setDeleteDialogOpen(false), title: /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Delete this property?" }), body: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6206
6391
|
" This will ",
|
|
6207
6392
|
/* @__PURE__ */ jsxRuntime.jsx("b", { children: "not delete any data" }),
|
|
6208
6393
|
", only modify the collection."
|
|
6209
6394
|
] }) });
|
|
6210
|
-
$[
|
|
6211
|
-
$[
|
|
6212
|
-
$[
|
|
6213
|
-
$[
|
|
6214
|
-
$[
|
|
6395
|
+
$[136] = deleteDialogOpen;
|
|
6396
|
+
$[137] = onDelete;
|
|
6397
|
+
$[138] = propertyNamespace;
|
|
6398
|
+
$[139] = values?.id;
|
|
6399
|
+
$[140] = t23;
|
|
6215
6400
|
} else {
|
|
6216
|
-
t23 = $[
|
|
6401
|
+
t23 = $[140];
|
|
6217
6402
|
}
|
|
6218
6403
|
let t24;
|
|
6219
|
-
if ($[
|
|
6404
|
+
if ($[141] !== t10 || $[142] !== t19 || $[143] !== t22 || $[144] !== t23) {
|
|
6220
6405
|
t24 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6221
6406
|
t10,
|
|
6222
6407
|
t19,
|
|
6223
6408
|
t22,
|
|
6224
6409
|
t23
|
|
6225
6410
|
] });
|
|
6226
|
-
$[
|
|
6227
|
-
$[
|
|
6228
|
-
$[
|
|
6229
|
-
$[
|
|
6230
|
-
$[
|
|
6411
|
+
$[141] = t10;
|
|
6412
|
+
$[142] = t19;
|
|
6413
|
+
$[143] = t22;
|
|
6414
|
+
$[144] = t23;
|
|
6415
|
+
$[145] = t24;
|
|
6231
6416
|
} else {
|
|
6232
|
-
t24 = $[
|
|
6417
|
+
t24 = $[145];
|
|
6233
6418
|
}
|
|
6234
6419
|
return t24;
|
|
6235
6420
|
}
|
|
@@ -6269,6 +6454,7 @@
|
|
|
6269
6454
|
file_upload: "File",
|
|
6270
6455
|
multi_file_upload: "File",
|
|
6271
6456
|
reference: "Reference",
|
|
6457
|
+
reference_as_string: "Text",
|
|
6272
6458
|
multi_references: "Reference",
|
|
6273
6459
|
date_time: "Date",
|
|
6274
6460
|
group: "Group",
|
|
@@ -6300,7 +6486,7 @@
|
|
|
6300
6486
|
let t6;
|
|
6301
6487
|
if ($[0] !== disabled || $[1] !== existing || $[2] !== inArray || $[3] !== initialProperty || $[4] !== onOpenChange || $[5] !== onValueChange || $[6] !== open || $[7] !== propertyConfigs || $[8] !== value) {
|
|
6302
6488
|
const allSupportedFields = Object.entries(supportedFields).concat(Object.entries(propertyConfigs));
|
|
6303
|
-
const displayedWidgets = (inArray ? allSupportedFields.filter(_temp$
|
|
6489
|
+
const displayedWidgets = (inArray ? allSupportedFields.filter(_temp$6) : allSupportedFields).map(_temp2$4).reduce(_temp3$2, {});
|
|
6304
6490
|
const key_0 = value;
|
|
6305
6491
|
const propertyConfig_1 = key_0 ? core.DEFAULT_FIELD_CONFIGS[key_0] ?? propertyConfigs[key_0] : void 0;
|
|
6306
6492
|
const baseProperty = propertyConfig_1?.property;
|
|
@@ -6482,19 +6668,19 @@
|
|
|
6482
6668
|
}
|
|
6483
6669
|
return "Custom/Other";
|
|
6484
6670
|
}
|
|
6485
|
-
function _temp3$
|
|
6671
|
+
function _temp3$2(a, b) {
|
|
6486
6672
|
return {
|
|
6487
6673
|
...a,
|
|
6488
6674
|
...b
|
|
6489
6675
|
};
|
|
6490
6676
|
}
|
|
6491
|
-
function _temp2$
|
|
6677
|
+
function _temp2$4(t0) {
|
|
6492
6678
|
const [key, propertyConfig_0] = t0;
|
|
6493
6679
|
return {
|
|
6494
6680
|
[key]: propertyConfig_0
|
|
6495
6681
|
};
|
|
6496
6682
|
}
|
|
6497
|
-
function _temp$
|
|
6683
|
+
function _temp$6(t0) {
|
|
6498
6684
|
const [, propertyConfig] = t0;
|
|
6499
6685
|
return !core.isPropertyBuilder(propertyConfig.property) && propertyConfig.property?.dataType !== "array";
|
|
6500
6686
|
}
|
|
@@ -6588,7 +6774,7 @@
|
|
|
6588
6774
|
}
|
|
6589
6775
|
let t10;
|
|
6590
6776
|
if ($[20] !== onClick || $[21] !== t9) {
|
|
6591
|
-
t10 = /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { onClick, className: "flex flex-row items-center px-4 py-2", children: t9 });
|
|
6777
|
+
t10 = /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { onClick, className: "flex flex-row items-center px-4 py-2 m-1", children: t9 });
|
|
6592
6778
|
$[20] = onClick;
|
|
6593
6779
|
$[21] = t9;
|
|
6594
6780
|
$[22] = t10;
|
|
@@ -6642,7 +6828,7 @@
|
|
|
6642
6828
|
if ($[3] !== code) {
|
|
6643
6829
|
t3 = /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogContent, { children: [
|
|
6644
6830
|
t2,
|
|
6645
|
-
/* @__PURE__ */ jsxRuntime.jsx(prismReactRenderer.Highlight, { theme: prismReactRenderer.themes.vsDark, code, language: "typescript", children: _temp$
|
|
6831
|
+
/* @__PURE__ */ jsxRuntime.jsx(prismReactRenderer.Highlight, { theme: prismReactRenderer.themes.vsDark, code, language: "typescript", children: _temp$5 })
|
|
6646
6832
|
] });
|
|
6647
6833
|
$[3] = code;
|
|
6648
6834
|
$[4] = t3;
|
|
@@ -6656,7 +6842,7 @@
|
|
|
6656
6842
|
e.preventDefault();
|
|
6657
6843
|
snackbarController.open({
|
|
6658
6844
|
type: "success",
|
|
6659
|
-
message:
|
|
6845
|
+
message: "Copied"
|
|
6660
6846
|
});
|
|
6661
6847
|
return navigator.clipboard.writeText(code);
|
|
6662
6848
|
};
|
|
@@ -6675,7 +6861,7 @@
|
|
|
6675
6861
|
}
|
|
6676
6862
|
let t6;
|
|
6677
6863
|
if ($[9] !== t4) {
|
|
6678
|
-
t6 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", size: "small", onClick: t4, children: [
|
|
6864
|
+
t6 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", size: "small", color: "primary", onClick: t4, children: [
|
|
6679
6865
|
t5,
|
|
6680
6866
|
"Copy to clipboard"
|
|
6681
6867
|
] });
|
|
@@ -6722,7 +6908,7 @@
|
|
|
6722
6908
|
}
|
|
6723
6909
|
return t9;
|
|
6724
6910
|
}
|
|
6725
|
-
function _temp$
|
|
6911
|
+
function _temp$5(t0) {
|
|
6726
6912
|
const {
|
|
6727
6913
|
style,
|
|
6728
6914
|
tokens,
|
|
@@ -6835,6 +7021,7 @@
|
|
|
6835
7021
|
const inferPropertiesFromData = doCollectionInference ? () => {
|
|
6836
7022
|
if (!doCollectionInference) return;
|
|
6837
7023
|
setInferringProperties(true);
|
|
7024
|
+
console.debug("CollectionEditor: inferring properties from data", doCollectionInference, values);
|
|
6838
7025
|
doCollectionInference(values).then((newCollection) => {
|
|
6839
7026
|
if (newCollection) core.makePropertiesEditable(newCollection.properties);
|
|
6840
7027
|
if (!newCollection) {
|
|
@@ -6977,8 +7164,8 @@
|
|
|
6977
7164
|
setSelectedPropertyKey(propertyKey_2);
|
|
6978
7165
|
setSelectedPropertyNamespace(namespace_5);
|
|
6979
7166
|
};
|
|
6980
|
-
const body = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-12 gap-2 h-full bg-
|
|
6981
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("p-4 md:p-8 pb-20 md:pb-20", "col-span-12 lg:col-span-5 h-full overflow-auto", !asDialog && "border-r " + ui.defaultBorderMixin), children: [
|
|
7167
|
+
const body = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-12 gap-2 h-full bg-white dark:bg-surface-950", children: [
|
|
7168
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("bg-surface-50 dark:bg-surface-900", "p-4 md:p-8 pb-20 md:pb-20", "col-span-12 lg:col-span-5 h-full overflow-auto", !asDialog && "border-r " + ui.defaultBorderMixin), children: [
|
|
6982
7169
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex my-2", children: [
|
|
6983
7170
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-grow mb-4", children: [
|
|
6984
7171
|
/* @__PURE__ */ jsxRuntime.jsx(formex.Field, { name: "name", as: ui.DebouncedTextField, invisible: true, className: "-ml-1", inputClassName: "text-2xl font-headers", placeholder: "Collection name", size: "small", required: true, error: Boolean(errors?.name) }),
|
|
@@ -6997,7 +7184,7 @@
|
|
|
6997
7184
|
/* @__PURE__ */ jsxRuntime.jsx(core.ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(PropertyTree, { className: "pl-8", inferredPropertyKeys, selectedPropertyKey: selectedPropertyKey ? getFullId(selectedPropertyKey, selectedPropertyNamespace) : void 0, properties: values.properties, additionalFields: values.additionalFields, propertiesOrder: usedPropertiesOrder, onPropertyClick, onPropertyMove, onPropertyRemove: isNewCollection ? deleteProperty : void 0, collectionEditable, errors }) }),
|
|
6998
7185
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { className: "mt-8 w-full", color: "primary", variant: "outlined", size: "large", onClick: () => setNewPropertyDialogOpen(true), startIcon: /* @__PURE__ */ jsxRuntime.jsx(ui.AddIcon, {}), children: "Add new property" })
|
|
6999
7186
|
] }),
|
|
7000
|
-
!asDialog && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12 lg:col-span-7 p-4 md:py-8 md:px-4 h-full overflow-auto pb-20 md:pb-20", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7187
|
+
!asDialog && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12 lg:col-span-7 p-4 md:py-8 md:px-4 h-full overflow-auto pb-20 md:pb-20", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sticky top-8 min-h-full w-full flex flex-col justify-center", children: [
|
|
7001
7188
|
selectedPropertyFullId && selectedProperty && !core.isPropertyBuilder(selectedProperty) && /* @__PURE__ */ jsxRuntime.jsx(PropertyForm, { inArray: false, existingProperty: !isNewCollection, autoUpdateId: false, allowDataInference: !isNewCollection, autoOpenTypeSelect: false, propertyKey: selectedPropertyKey, propertyNamespace: selectedPropertyNamespace, property: selectedProperty, onPropertyChanged, onDelete: deleteProperty, onError: onPropertyErrorInternal, forceShowErrors: showErrors, initialErrors, getData, propertyConfigs, collectionEditable }, `edit_view_${selectedPropertyIndex}`),
|
|
7002
7189
|
!selectedProperty && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex flex-col items-center justify-center h-full gap-4", children: [
|
|
7003
7190
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "label", className: "", children: emptyCollection ? "Now you can add your first property" : "Select a property to edit it" }),
|
|
@@ -7071,7 +7258,7 @@
|
|
|
7071
7258
|
}
|
|
7072
7259
|
let t7;
|
|
7073
7260
|
if ($[10] !== handleCancel) {
|
|
7074
|
-
t7 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", onClick: handleCancel, autoFocus: true, children: " Cancel " });
|
|
7261
|
+
t7 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", color: "primary", onClick: handleCancel, autoFocus: true, children: " Cancel " });
|
|
7075
7262
|
$[10] = handleCancel;
|
|
7076
7263
|
$[11] = t7;
|
|
7077
7264
|
} else {
|
|
@@ -7079,7 +7266,7 @@
|
|
|
7079
7266
|
}
|
|
7080
7267
|
let t8;
|
|
7081
7268
|
if ($[12] !== handleOk) {
|
|
7082
|
-
t8 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: handleOk, children: " Ok " });
|
|
7269
|
+
t8 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { color: "primary", onClick: handleOk, children: " Ok " });
|
|
7083
7270
|
$[12] = handleOk;
|
|
7084
7271
|
$[13] = t8;
|
|
7085
7272
|
} else {
|
|
@@ -7147,7 +7334,7 @@
|
|
|
7147
7334
|
}
|
|
7148
7335
|
let t3;
|
|
7149
7336
|
if ($[4] !== entityViews) {
|
|
7150
|
-
t3 = (entityViews ?? []).length === 0 && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", children: "No custom views defined" });
|
|
7337
|
+
t3 = (entityViews ?? []).length === 0 && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", children: "No custom views defined. Define your custom views in the customization settings, before using this dialog." });
|
|
7151
7338
|
$[4] = entityViews;
|
|
7152
7339
|
$[5] = t3;
|
|
7153
7340
|
} else {
|
|
@@ -7167,7 +7354,7 @@
|
|
|
7167
7354
|
}
|
|
7168
7355
|
let t5;
|
|
7169
7356
|
if ($[9] !== onClose) {
|
|
7170
|
-
t5 = /* @__PURE__ */ jsxRuntime.jsx(ui.DialogActions, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "outlined", onClick: () => onClose(), children: "Cancel" }) });
|
|
7357
|
+
t5 = /* @__PURE__ */ jsxRuntime.jsx(ui.DialogActions, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "outlined", color: "primary", onClick: () => onClose(), children: "Cancel" }) });
|
|
7171
7358
|
$[9] = onClose;
|
|
7172
7359
|
$[10] = t5;
|
|
7173
7360
|
} else {
|
|
@@ -7234,8 +7421,8 @@
|
|
|
7234
7421
|
let t8;
|
|
7235
7422
|
let t9;
|
|
7236
7423
|
if ($[2] !== collection.entityViews || $[3] !== contextEntityViews || $[4] !== subcollections || $[5] !== values.entityViews || $[6] !== values.name) {
|
|
7237
|
-
const resolvedEntityViews = values.entityViews?.filter(_temp$
|
|
7238
|
-
const hardCodedEntityViews = collection.entityViews?.filter(_temp2$
|
|
7424
|
+
const resolvedEntityViews = values.entityViews?.filter(_temp$4).map((e_0) => core.resolveEntityView(e_0, contextEntityViews)).filter(Boolean) ?? [];
|
|
7425
|
+
const hardCodedEntityViews = collection.entityViews?.filter(_temp2$3) ?? [];
|
|
7239
7426
|
const totalEntityViews = resolvedEntityViews.length + hardCodedEntityViews.length;
|
|
7240
7427
|
t12 = "overflow-auto my-auto";
|
|
7241
7428
|
T3 = ui.Container;
|
|
@@ -7344,7 +7531,7 @@
|
|
|
7344
7531
|
t182 = $[36];
|
|
7345
7532
|
}
|
|
7346
7533
|
t2 = resolvedEntityViews.map(t182);
|
|
7347
|
-
t3 = hardCodedEntityViews.map(_temp3);
|
|
7534
|
+
t3 = hardCodedEntityViews.map(_temp3$1);
|
|
7348
7535
|
$[2] = collection.entityViews;
|
|
7349
7536
|
$[3] = contextEntityViews;
|
|
7350
7537
|
$[4] = subcollections;
|
|
@@ -7618,7 +7805,7 @@
|
|
|
7618
7805
|
function _temp4(e_6) {
|
|
7619
7806
|
return e_6.id;
|
|
7620
7807
|
}
|
|
7621
|
-
function _temp3(view_0) {
|
|
7808
|
+
function _temp3$1(view_0) {
|
|
7622
7809
|
return /* @__PURE__ */ jsxRuntime.jsx(ui.TableRow, { children: /* @__PURE__ */ jsxRuntime.jsxs(ui.TableCell, { align: "left", children: [
|
|
7623
7810
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "flex-grow", children: view_0.name }),
|
|
7624
7811
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "caption", className: "flex-grow", children: [
|
|
@@ -7627,10 +7814,10 @@
|
|
|
7627
7814
|
] })
|
|
7628
7815
|
] }) }, view_0.key);
|
|
7629
7816
|
}
|
|
7630
|
-
function _temp2$
|
|
7817
|
+
function _temp2$3(e_1) {
|
|
7631
7818
|
return typeof e_1 !== "string";
|
|
7632
7819
|
}
|
|
7633
|
-
function _temp$
|
|
7820
|
+
function _temp$4(e) {
|
|
7634
7821
|
return typeof e === "string";
|
|
7635
7822
|
}
|
|
7636
7823
|
const productsCollectionTemplate = {
|
|
@@ -8109,6 +8296,10 @@
|
|
|
8109
8296
|
setFieldValue,
|
|
8110
8297
|
setValues
|
|
8111
8298
|
} = formex.useFormex();
|
|
8299
|
+
const noSuggestions = !loadingPathSuggestions && (filteredPathSuggestions ?? [])?.length === 0;
|
|
8300
|
+
if (!noSuggestions) {
|
|
8301
|
+
return null;
|
|
8302
|
+
}
|
|
8112
8303
|
let t3;
|
|
8113
8304
|
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8114
8305
|
t3 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row py-2 pt-3 items-center", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "h4", className: "flex-grow", children: "New collection" }) });
|
|
@@ -8161,7 +8352,7 @@
|
|
|
8161
8352
|
}
|
|
8162
8353
|
let t8;
|
|
8163
8354
|
if ($[16] !== filteredPathSuggestions || $[17] !== loadingPathSuggestions) {
|
|
8164
|
-
t8 =
|
|
8355
|
+
t8 = (filteredPathSuggestions ?? []).length === 0 && !loadingPathSuggestions && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", color: "secondary", children: "No existing paths found" });
|
|
8165
8356
|
$[16] = filteredPathSuggestions;
|
|
8166
8357
|
$[17] = loadingPathSuggestions;
|
|
8167
8358
|
$[18] = t8;
|
|
@@ -8427,7 +8618,7 @@
|
|
|
8427
8618
|
const previousFullId = getFullId(previousId, namespace);
|
|
8428
8619
|
const previousPropertyPath = idToPropertiesPath(previousFullId);
|
|
8429
8620
|
const currentPropertiesOrder = getCurrentPropertiesOrder(namespace);
|
|
8430
|
-
const newPropertiesOrder_0 = currentPropertiesOrder.map((p) => p === previousId ? id : p).filter(_temp$
|
|
8621
|
+
const newPropertiesOrder_0 = currentPropertiesOrder.map((p) => p === previousId ? id : p).filter(_temp$3);
|
|
8431
8622
|
updatePropertiesOrder(newPropertiesOrder_0, namespace);
|
|
8432
8623
|
const newHeadersMapping = {
|
|
8433
8624
|
...importConfig.headersMapping
|
|
@@ -8593,7 +8784,7 @@
|
|
|
8593
8784
|
}
|
|
8594
8785
|
return t13;
|
|
8595
8786
|
}
|
|
8596
|
-
function _temp$
|
|
8787
|
+
function _temp$3(p_0) {
|
|
8597
8788
|
return p_0 !== void 0;
|
|
8598
8789
|
}
|
|
8599
8790
|
function PropertySelect(t0) {
|
|
@@ -8666,7 +8857,7 @@
|
|
|
8666
8857
|
}
|
|
8667
8858
|
let t9;
|
|
8668
8859
|
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8669
|
-
t9 = Object.entries(supportedFields).map(_temp2$
|
|
8860
|
+
t9 = Object.entries(supportedFields).map(_temp2$2);
|
|
8670
8861
|
$[12] = t9;
|
|
8671
8862
|
} else {
|
|
8672
8863
|
t9 = $[12];
|
|
@@ -8696,7 +8887,7 @@
|
|
|
8696
8887
|
}
|
|
8697
8888
|
return t11;
|
|
8698
8889
|
}
|
|
8699
|
-
function _temp2$
|
|
8890
|
+
function _temp2$2(t0) {
|
|
8700
8891
|
const [key, widget_0] = t0;
|
|
8701
8892
|
return /* @__PURE__ */ jsxRuntime.jsx(PropertySelectItem, { value: key, optionDisabled: false, propertyConfig: widget_0, existing: false }, key);
|
|
8702
8893
|
}
|
|
@@ -8862,7 +9053,7 @@
|
|
|
8862
9053
|
}
|
|
8863
9054
|
let t7;
|
|
8864
9055
|
if ($[12] !== propertiesOrder) {
|
|
8865
|
-
t7 = propertiesOrder.map(_temp$
|
|
9056
|
+
t7 = propertiesOrder.map(_temp$2);
|
|
8866
9057
|
$[12] = propertiesOrder;
|
|
8867
9058
|
$[13] = t7;
|
|
8868
9059
|
} else {
|
|
@@ -8881,7 +9072,7 @@
|
|
|
8881
9072
|
}
|
|
8882
9073
|
return t8;
|
|
8883
9074
|
}
|
|
8884
|
-
function _temp$
|
|
9075
|
+
function _temp$2(p) {
|
|
8885
9076
|
return {
|
|
8886
9077
|
key: p,
|
|
8887
9078
|
disabled: false
|
|
@@ -8935,6 +9126,355 @@
|
|
|
8935
9126
|
idColumn
|
|
8936
9127
|
};
|
|
8937
9128
|
}
|
|
9129
|
+
function EntityActionsSelectDialog(t0) {
|
|
9130
|
+
const $ = reactCompilerRuntime.c(15);
|
|
9131
|
+
const {
|
|
9132
|
+
open,
|
|
9133
|
+
onClose
|
|
9134
|
+
} = t0;
|
|
9135
|
+
const {
|
|
9136
|
+
entityActions
|
|
9137
|
+
} = core.useCustomizationController();
|
|
9138
|
+
let t1;
|
|
9139
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9140
|
+
t1 = /* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: "Select custom action" });
|
|
9141
|
+
$[0] = t1;
|
|
9142
|
+
} else {
|
|
9143
|
+
t1 = $[0];
|
|
9144
|
+
}
|
|
9145
|
+
let t2;
|
|
9146
|
+
if ($[1] !== entityActions || $[2] !== onClose) {
|
|
9147
|
+
t2 = entityActions?.map((action) => /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { onClick: () => onClose(action.key), fullWidth: true, variant: "text", children: [
|
|
9148
|
+
action.name,
|
|
9149
|
+
" (",
|
|
9150
|
+
action.key,
|
|
9151
|
+
")"
|
|
9152
|
+
] }, action.key));
|
|
9153
|
+
$[1] = entityActions;
|
|
9154
|
+
$[2] = onClose;
|
|
9155
|
+
$[3] = t2;
|
|
9156
|
+
} else {
|
|
9157
|
+
t2 = $[3];
|
|
9158
|
+
}
|
|
9159
|
+
let t3;
|
|
9160
|
+
if ($[4] !== entityActions) {
|
|
9161
|
+
t3 = (entityActions ?? []).length === 0 && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", children: "No custom actions defined. Define your custom actions in the customization settings, before using this dialog." });
|
|
9162
|
+
$[4] = entityActions;
|
|
9163
|
+
$[5] = t3;
|
|
9164
|
+
} else {
|
|
9165
|
+
t3 = $[5];
|
|
9166
|
+
}
|
|
9167
|
+
let t4;
|
|
9168
|
+
if ($[6] !== t2 || $[7] !== t3) {
|
|
9169
|
+
t4 = /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogContent, { className: "flex flex-col gap-4", children: [
|
|
9170
|
+
t2,
|
|
9171
|
+
t3
|
|
9172
|
+
] });
|
|
9173
|
+
$[6] = t2;
|
|
9174
|
+
$[7] = t3;
|
|
9175
|
+
$[8] = t4;
|
|
9176
|
+
} else {
|
|
9177
|
+
t4 = $[8];
|
|
9178
|
+
}
|
|
9179
|
+
let t5;
|
|
9180
|
+
if ($[9] !== onClose) {
|
|
9181
|
+
t5 = /* @__PURE__ */ jsxRuntime.jsx(ui.DialogActions, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "outlined", color: "primary", onClick: () => onClose(), children: "Cancel" }) });
|
|
9182
|
+
$[9] = onClose;
|
|
9183
|
+
$[10] = t5;
|
|
9184
|
+
} else {
|
|
9185
|
+
t5 = $[10];
|
|
9186
|
+
}
|
|
9187
|
+
let t6;
|
|
9188
|
+
if ($[11] !== open || $[12] !== t4 || $[13] !== t5) {
|
|
9189
|
+
t6 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Dialog, { maxWidth: "md", open, children: [
|
|
9190
|
+
t1,
|
|
9191
|
+
t4,
|
|
9192
|
+
t5
|
|
9193
|
+
] });
|
|
9194
|
+
$[11] = open;
|
|
9195
|
+
$[12] = t4;
|
|
9196
|
+
$[13] = t5;
|
|
9197
|
+
$[14] = t6;
|
|
9198
|
+
} else {
|
|
9199
|
+
t6 = $[14];
|
|
9200
|
+
}
|
|
9201
|
+
return t6;
|
|
9202
|
+
}
|
|
9203
|
+
function EntityActionsEditTab(t0) {
|
|
9204
|
+
const $ = reactCompilerRuntime.c(64);
|
|
9205
|
+
const {
|
|
9206
|
+
collection
|
|
9207
|
+
} = t0;
|
|
9208
|
+
const {
|
|
9209
|
+
entityActions: contextEntityActions
|
|
9210
|
+
} = core.useCustomizationController();
|
|
9211
|
+
const [addEntityActionDialogOpen, setAddEntityActionDialogOpen] = React.useState(false);
|
|
9212
|
+
const [actionToDelete, setActionToDelete] = React.useState();
|
|
9213
|
+
const {
|
|
9214
|
+
values,
|
|
9215
|
+
setFieldValue
|
|
9216
|
+
} = formex.useFormex();
|
|
9217
|
+
let T0;
|
|
9218
|
+
let T1;
|
|
9219
|
+
let T2;
|
|
9220
|
+
let T3;
|
|
9221
|
+
let t1;
|
|
9222
|
+
let t10;
|
|
9223
|
+
let t2;
|
|
9224
|
+
let t3;
|
|
9225
|
+
let t4;
|
|
9226
|
+
let t5;
|
|
9227
|
+
let t6;
|
|
9228
|
+
let t7;
|
|
9229
|
+
let t8;
|
|
9230
|
+
let t9;
|
|
9231
|
+
if ($[0] !== collection.entityActions || $[1] !== contextEntityActions || $[2] !== values.entityActions) {
|
|
9232
|
+
const resolvedEntityActions = values.entityActions?.filter(_temp$1).map((e_0) => core.resolveEntityAction(e_0, contextEntityActions)).filter(Boolean) ?? [];
|
|
9233
|
+
const hardCodedEntityActions = collection.entityActions?.filter(_temp2$1) ?? [];
|
|
9234
|
+
const totalEntityActions = resolvedEntityActions.length + hardCodedEntityActions.length;
|
|
9235
|
+
t10 = "overflow-auto my-auto";
|
|
9236
|
+
T3 = ui.Container;
|
|
9237
|
+
t8 = "2xl";
|
|
9238
|
+
t9 = "flex flex-col gap-4 p-8 m-auto";
|
|
9239
|
+
t7 = "flex flex-col gap-16";
|
|
9240
|
+
t4 = "flex-grow flex flex-col gap-4 items-start";
|
|
9241
|
+
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9242
|
+
t5 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "h5", children: "Custom actions" });
|
|
9243
|
+
$[17] = t5;
|
|
9244
|
+
} else {
|
|
9245
|
+
t5 = $[17];
|
|
9246
|
+
}
|
|
9247
|
+
if ($[18] !== totalEntityActions) {
|
|
9248
|
+
t6 = totalEntityActions === 0 && /* @__PURE__ */ jsxRuntime.jsx(ui.Alert, { action: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", size: "small", href: "https://firecms.co/docs/custom_actions", component: "a", rel: "noopener noreferrer", target: "_blank", children: "More info" }), children: "Define your own custom actions by uploading them with the CLI." });
|
|
9249
|
+
$[18] = totalEntityActions;
|
|
9250
|
+
$[19] = t6;
|
|
9251
|
+
} else {
|
|
9252
|
+
t6 = $[19];
|
|
9253
|
+
}
|
|
9254
|
+
T2 = ui.Paper;
|
|
9255
|
+
t3 = "flex flex-col gap-4 p-2 w-full";
|
|
9256
|
+
T1 = ui.Table;
|
|
9257
|
+
T0 = ui.TableBody;
|
|
9258
|
+
let t112;
|
|
9259
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9260
|
+
t112 = (action) => /* @__PURE__ */ jsxRuntime.jsxs(ui.TableRow, { children: [
|
|
9261
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TableCell, { align: "left", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "flex-grow", children: action.name }) }),
|
|
9262
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TableCell, { align: "right", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Remove", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: (e_2) => {
|
|
9263
|
+
e_2.preventDefault();
|
|
9264
|
+
e_2.stopPropagation();
|
|
9265
|
+
setActionToDelete(action.key);
|
|
9266
|
+
}, color: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx(ui.DeleteIcon, { size: "small" }) }) }) })
|
|
9267
|
+
] }, action.key);
|
|
9268
|
+
$[20] = t112;
|
|
9269
|
+
} else {
|
|
9270
|
+
t112 = $[20];
|
|
9271
|
+
}
|
|
9272
|
+
t1 = resolvedEntityActions.map(t112);
|
|
9273
|
+
t2 = hardCodedEntityActions.map(_temp3);
|
|
9274
|
+
$[0] = collection.entityActions;
|
|
9275
|
+
$[1] = contextEntityActions;
|
|
9276
|
+
$[2] = values.entityActions;
|
|
9277
|
+
$[3] = T0;
|
|
9278
|
+
$[4] = T1;
|
|
9279
|
+
$[5] = T2;
|
|
9280
|
+
$[6] = T3;
|
|
9281
|
+
$[7] = t1;
|
|
9282
|
+
$[8] = t10;
|
|
9283
|
+
$[9] = t2;
|
|
9284
|
+
$[10] = t3;
|
|
9285
|
+
$[11] = t4;
|
|
9286
|
+
$[12] = t5;
|
|
9287
|
+
$[13] = t6;
|
|
9288
|
+
$[14] = t7;
|
|
9289
|
+
$[15] = t8;
|
|
9290
|
+
$[16] = t9;
|
|
9291
|
+
} else {
|
|
9292
|
+
T0 = $[3];
|
|
9293
|
+
T1 = $[4];
|
|
9294
|
+
T2 = $[5];
|
|
9295
|
+
T3 = $[6];
|
|
9296
|
+
t1 = $[7];
|
|
9297
|
+
t10 = $[8];
|
|
9298
|
+
t2 = $[9];
|
|
9299
|
+
t3 = $[10];
|
|
9300
|
+
t4 = $[11];
|
|
9301
|
+
t5 = $[12];
|
|
9302
|
+
t6 = $[13];
|
|
9303
|
+
t7 = $[14];
|
|
9304
|
+
t8 = $[15];
|
|
9305
|
+
t9 = $[16];
|
|
9306
|
+
}
|
|
9307
|
+
let t11;
|
|
9308
|
+
if ($[21] !== T0 || $[22] !== t1 || $[23] !== t2) {
|
|
9309
|
+
t11 = /* @__PURE__ */ jsxRuntime.jsxs(T0, { children: [
|
|
9310
|
+
t1,
|
|
9311
|
+
t2
|
|
9312
|
+
] });
|
|
9313
|
+
$[21] = T0;
|
|
9314
|
+
$[22] = t1;
|
|
9315
|
+
$[23] = t2;
|
|
9316
|
+
$[24] = t11;
|
|
9317
|
+
} else {
|
|
9318
|
+
t11 = $[24];
|
|
9319
|
+
}
|
|
9320
|
+
let t12;
|
|
9321
|
+
if ($[25] !== T1 || $[26] !== t11) {
|
|
9322
|
+
t12 = /* @__PURE__ */ jsxRuntime.jsx(T1, { children: t11 });
|
|
9323
|
+
$[25] = T1;
|
|
9324
|
+
$[26] = t11;
|
|
9325
|
+
$[27] = t12;
|
|
9326
|
+
} else {
|
|
9327
|
+
t12 = $[27];
|
|
9328
|
+
}
|
|
9329
|
+
let t13;
|
|
9330
|
+
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9331
|
+
t13 = () => {
|
|
9332
|
+
setAddEntityActionDialogOpen(true);
|
|
9333
|
+
};
|
|
9334
|
+
$[28] = t13;
|
|
9335
|
+
} else {
|
|
9336
|
+
t13 = $[28];
|
|
9337
|
+
}
|
|
9338
|
+
let t14;
|
|
9339
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9340
|
+
t14 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: t13, variant: "text", startIcon: /* @__PURE__ */ jsxRuntime.jsx(ui.AddIcon, {}), children: "Add custom entity action" });
|
|
9341
|
+
$[29] = t14;
|
|
9342
|
+
} else {
|
|
9343
|
+
t14 = $[29];
|
|
9344
|
+
}
|
|
9345
|
+
let t15;
|
|
9346
|
+
if ($[30] !== T2 || $[31] !== t12 || $[32] !== t3) {
|
|
9347
|
+
t15 = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(T2, { className: t3, children: [
|
|
9348
|
+
t12,
|
|
9349
|
+
t14
|
|
9350
|
+
] }) });
|
|
9351
|
+
$[30] = T2;
|
|
9352
|
+
$[31] = t12;
|
|
9353
|
+
$[32] = t3;
|
|
9354
|
+
$[33] = t15;
|
|
9355
|
+
} else {
|
|
9356
|
+
t15 = $[33];
|
|
9357
|
+
}
|
|
9358
|
+
let t16;
|
|
9359
|
+
if ($[34] !== t15 || $[35] !== t4 || $[36] !== t5 || $[37] !== t6) {
|
|
9360
|
+
t16 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t4, children: [
|
|
9361
|
+
t5,
|
|
9362
|
+
t6,
|
|
9363
|
+
t15
|
|
9364
|
+
] });
|
|
9365
|
+
$[34] = t15;
|
|
9366
|
+
$[35] = t4;
|
|
9367
|
+
$[36] = t5;
|
|
9368
|
+
$[37] = t6;
|
|
9369
|
+
$[38] = t16;
|
|
9370
|
+
} else {
|
|
9371
|
+
t16 = $[38];
|
|
9372
|
+
}
|
|
9373
|
+
let t17;
|
|
9374
|
+
if ($[39] !== t16 || $[40] !== t7) {
|
|
9375
|
+
t17 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: t7, children: t16 });
|
|
9376
|
+
$[39] = t16;
|
|
9377
|
+
$[40] = t7;
|
|
9378
|
+
$[41] = t17;
|
|
9379
|
+
} else {
|
|
9380
|
+
t17 = $[41];
|
|
9381
|
+
}
|
|
9382
|
+
let t18;
|
|
9383
|
+
if ($[42] !== T3 || $[43] !== t17 || $[44] !== t8 || $[45] !== t9) {
|
|
9384
|
+
t18 = /* @__PURE__ */ jsxRuntime.jsx(T3, { maxWidth: t8, className: t9, children: t17 });
|
|
9385
|
+
$[42] = T3;
|
|
9386
|
+
$[43] = t17;
|
|
9387
|
+
$[44] = t8;
|
|
9388
|
+
$[45] = t9;
|
|
9389
|
+
$[46] = t18;
|
|
9390
|
+
} else {
|
|
9391
|
+
t18 = $[46];
|
|
9392
|
+
}
|
|
9393
|
+
let t19;
|
|
9394
|
+
if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9395
|
+
t19 = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
9396
|
+
height: "52px"
|
|
9397
|
+
} });
|
|
9398
|
+
$[47] = t19;
|
|
9399
|
+
} else {
|
|
9400
|
+
t19 = $[47];
|
|
9401
|
+
}
|
|
9402
|
+
let t20;
|
|
9403
|
+
if ($[48] !== actionToDelete || $[49] !== setFieldValue || $[50] !== values.entityActions) {
|
|
9404
|
+
t20 = actionToDelete && /* @__PURE__ */ jsxRuntime.jsx(core.ConfirmationDialog, { open: Boolean(actionToDelete), onAccept: () => {
|
|
9405
|
+
setFieldValue("entityActions", values.entityActions?.filter((e_3) => e_3 !== actionToDelete));
|
|
9406
|
+
setActionToDelete(void 0);
|
|
9407
|
+
}, onCancel: () => setActionToDelete(void 0), title: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: "Remove this action?" }), body: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9408
|
+
"This will ",
|
|
9409
|
+
/* @__PURE__ */ jsxRuntime.jsx("b", { children: "not delete any data" }),
|
|
9410
|
+
", only the action in the CMS"
|
|
9411
|
+
] }) });
|
|
9412
|
+
$[48] = actionToDelete;
|
|
9413
|
+
$[49] = setFieldValue;
|
|
9414
|
+
$[50] = values.entityActions;
|
|
9415
|
+
$[51] = t20;
|
|
9416
|
+
} else {
|
|
9417
|
+
t20 = $[51];
|
|
9418
|
+
}
|
|
9419
|
+
let t21;
|
|
9420
|
+
if ($[52] !== contextEntityActions || $[53] !== setFieldValue || $[54] !== values.entityActions) {
|
|
9421
|
+
t21 = (selectedActionKey) => {
|
|
9422
|
+
if (selectedActionKey) {
|
|
9423
|
+
console.log("Selected action key:", selectedActionKey);
|
|
9424
|
+
const value = [...values.entityActions ?? [], selectedActionKey].filter((e_4) => typeof e_4 === "string" && (contextEntityActions ?? []).some((action_1) => action_1.key === e_4));
|
|
9425
|
+
setFieldValue("entityActions", value);
|
|
9426
|
+
}
|
|
9427
|
+
setAddEntityActionDialogOpen(false);
|
|
9428
|
+
};
|
|
9429
|
+
$[52] = contextEntityActions;
|
|
9430
|
+
$[53] = setFieldValue;
|
|
9431
|
+
$[54] = values.entityActions;
|
|
9432
|
+
$[55] = t21;
|
|
9433
|
+
} else {
|
|
9434
|
+
t21 = $[55];
|
|
9435
|
+
}
|
|
9436
|
+
let t22;
|
|
9437
|
+
if ($[56] !== addEntityActionDialogOpen || $[57] !== t21) {
|
|
9438
|
+
t22 = /* @__PURE__ */ jsxRuntime.jsx(EntityActionsSelectDialog, { open: addEntityActionDialogOpen, onClose: t21 });
|
|
9439
|
+
$[56] = addEntityActionDialogOpen;
|
|
9440
|
+
$[57] = t21;
|
|
9441
|
+
$[58] = t22;
|
|
9442
|
+
} else {
|
|
9443
|
+
t22 = $[58];
|
|
9444
|
+
}
|
|
9445
|
+
let t23;
|
|
9446
|
+
if ($[59] !== t10 || $[60] !== t18 || $[61] !== t20 || $[62] !== t22) {
|
|
9447
|
+
t23 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t10, children: [
|
|
9448
|
+
t18,
|
|
9449
|
+
t19,
|
|
9450
|
+
t20,
|
|
9451
|
+
t22
|
|
9452
|
+
] });
|
|
9453
|
+
$[59] = t10;
|
|
9454
|
+
$[60] = t18;
|
|
9455
|
+
$[61] = t20;
|
|
9456
|
+
$[62] = t22;
|
|
9457
|
+
$[63] = t23;
|
|
9458
|
+
} else {
|
|
9459
|
+
t23 = $[63];
|
|
9460
|
+
}
|
|
9461
|
+
return t23;
|
|
9462
|
+
}
|
|
9463
|
+
function _temp3(action_0) {
|
|
9464
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.TableRow, { children: /* @__PURE__ */ jsxRuntime.jsxs(ui.TableCell, { align: "left", children: [
|
|
9465
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "flex-grow", children: action_0.name }),
|
|
9466
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "caption", className: "flex-grow", children: [
|
|
9467
|
+
"This action is defined in code with key ",
|
|
9468
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: action_0.key })
|
|
9469
|
+
] })
|
|
9470
|
+
] }) }, action_0.key);
|
|
9471
|
+
}
|
|
9472
|
+
function _temp2$1(e_1) {
|
|
9473
|
+
return typeof e_1 !== "string";
|
|
9474
|
+
}
|
|
9475
|
+
function _temp$1(e) {
|
|
9476
|
+
return typeof e === "string";
|
|
9477
|
+
}
|
|
8938
9478
|
function CollectionEditorDialog(props) {
|
|
8939
9479
|
const $ = reactCompilerRuntime.c(24);
|
|
8940
9480
|
const open = props.open;
|
|
@@ -9173,10 +9713,10 @@
|
|
|
9173
9713
|
setCurrentView("details");
|
|
9174
9714
|
}
|
|
9175
9715
|
};
|
|
9176
|
-
const doCollectionInference = (collection_0) => {
|
|
9716
|
+
const doCollectionInference = collectionInference ? (collection_0) => {
|
|
9177
9717
|
if (!collectionInference) return void 0;
|
|
9178
9718
|
return collectionInference?.(collection_0.path, collection_0.collectionGroup ?? false, parentPaths ?? []);
|
|
9179
|
-
};
|
|
9719
|
+
} : void 0;
|
|
9180
9720
|
const inferCollectionFromData = async (newCollection) => {
|
|
9181
9721
|
try {
|
|
9182
9722
|
if (!doCollectionInference) {
|
|
@@ -9395,7 +9935,8 @@
|
|
|
9395
9935
|
!isNewCollection && /* @__PURE__ */ jsxRuntime.jsxs(ui.Tabs, { value: currentView, innerClassName: ui.cls(ui.defaultBorderMixin, "px-4 h-14 w-full justify-end bg-surface-50 dark:bg-surface-950 border-b"), onValueChange: (v) => setCurrentView(v), children: [
|
|
9396
9936
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "details", children: "Details" }),
|
|
9397
9937
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "properties", children: "Properties" }),
|
|
9398
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "subcollections", children: "Additional views" })
|
|
9938
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "subcollections", children: "Additional views" }),
|
|
9939
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "custom_actions", children: "Custom actions" })
|
|
9399
9940
|
] }),
|
|
9400
9941
|
/* @__PURE__ */ jsxRuntime.jsxs("form", { noValidate: true, onSubmit: formController.handleSubmit, className: ui.cls(isNewCollection ? "h-full" : "h-[calc(100%-48px)]", "flex-grow flex flex-col relative"), children: [
|
|
9401
9942
|
currentView === "loading" && /* @__PURE__ */ jsxRuntime.jsx(core.CircularProgressCenter, {}),
|
|
@@ -9424,6 +9965,7 @@
|
|
|
9424
9965
|
setDeleteRequested(true);
|
|
9425
9966
|
}, children: "Reset to code" })
|
|
9426
9967
|
] }) }),
|
|
9968
|
+
currentView === "custom_actions" && collection && /* @__PURE__ */ jsxRuntime.jsx(EntityActionsEditTab, { collection }),
|
|
9427
9969
|
currentView === "subcollections" && collection && /* @__PURE__ */ jsxRuntime.jsx(SubcollectionsEditTab, { parentCollection, configController, getUser, collectionInference, parentCollectionIds, collection }),
|
|
9428
9970
|
currentView === "properties" && /* @__PURE__ */ jsxRuntime.jsx(CollectionPropertiesEditorForm, { showErrors: submitCount > 0, isNewCollection, reservedGroups, onPropertyError: (propertyKey, namespace, error_0) => {
|
|
9429
9971
|
const current = core.removeUndefined({
|
|
@@ -9435,28 +9977,28 @@
|
|
|
9435
9977
|
}, getUser, getData: getDataWithPath, doCollectionInference, propertyConfigs, collectionEditable, extraIcon: extraView?.icon && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { color: "primary", onClick: () => setCurrentView("extra_view"), children: extraView.icon }) }),
|
|
9436
9978
|
currentView !== "welcome" && /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogActions, { position: "absolute", children: [
|
|
9437
9979
|
error && /* @__PURE__ */ jsxRuntime.jsx(core.ErrorView, { error }),
|
|
9438
|
-
isNewCollection && includeTemplates && currentView === "import_data_mapping" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => {
|
|
9980
|
+
isNewCollection && includeTemplates && currentView === "import_data_mapping" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", color: "primary", onClick: () => {
|
|
9439
9981
|
importConfig.setInUse(false);
|
|
9440
9982
|
return setCurrentView("welcome");
|
|
9441
9983
|
}, children: [
|
|
9442
9984
|
/* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
|
|
9443
9985
|
"Back"
|
|
9444
9986
|
] }),
|
|
9445
|
-
isNewCollection && includeTemplates && currentView === "import_data_preview" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => {
|
|
9987
|
+
isNewCollection && includeTemplates && currentView === "import_data_preview" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", color: "primary", onClick: () => {
|
|
9446
9988
|
setCurrentView("import_data_mapping");
|
|
9447
9989
|
}, children: [
|
|
9448
9990
|
/* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
|
|
9449
9991
|
"Back"
|
|
9450
9992
|
] }),
|
|
9451
|
-
isNewCollection && includeTemplates && currentView === "details" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => setCurrentView("welcome"), children: [
|
|
9993
|
+
isNewCollection && includeTemplates && currentView === "details" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", color: "primary", type: "button", onClick: () => setCurrentView("welcome"), children: [
|
|
9452
9994
|
/* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
|
|
9453
9995
|
"Back"
|
|
9454
9996
|
] }),
|
|
9455
|
-
isNewCollection && currentView === "properties" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => setCurrentView("details"), children: [
|
|
9997
|
+
isNewCollection && currentView === "properties" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", color: "primary", onClick: () => setCurrentView("details"), children: [
|
|
9456
9998
|
/* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
|
|
9457
9999
|
"Back"
|
|
9458
10000
|
] }),
|
|
9459
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", onClick: () => {
|
|
10001
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", color: "primary", onClick: () => {
|
|
9460
10002
|
handleCancel();
|
|
9461
10003
|
}, children: "Cancel" }),
|
|
9462
10004
|
isNewCollection && currentView === "import_data_mapping" && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "filled", color: "primary", onClick: onImportMappingComplete, children: "Next" }),
|
|
@@ -9540,7 +10082,7 @@
|
|
|
9540
10082
|
const ConfigControllerContext = React.createContext({});
|
|
9541
10083
|
const CollectionEditorContext = React.createContext({});
|
|
9542
10084
|
const ConfigControllerProvider = React.memo(function ConfigControllerProvider2(t0) {
|
|
9543
|
-
const $ = reactCompilerRuntime.c(
|
|
10085
|
+
const $ = reactCompilerRuntime.c(65);
|
|
9544
10086
|
const {
|
|
9545
10087
|
children,
|
|
9546
10088
|
collectionConfigController,
|
|
@@ -9548,7 +10090,6 @@
|
|
|
9548
10090
|
reservedGroups,
|
|
9549
10091
|
collectionInference,
|
|
9550
10092
|
extraView,
|
|
9551
|
-
getPathSuggestions,
|
|
9552
10093
|
getUser,
|
|
9553
10094
|
getData,
|
|
9554
10095
|
onAnalyticsEvent
|
|
@@ -9669,26 +10210,24 @@
|
|
|
9669
10210
|
const createCollection = t3;
|
|
9670
10211
|
const t4 = configPermissions ?? defaultConfigPermissions;
|
|
9671
10212
|
let t5;
|
|
9672
|
-
if ($[6] !== createCollection || $[7] !== editCollection || $[8] !== editProperty || $[9] !==
|
|
10213
|
+
if ($[6] !== createCollection || $[7] !== editCollection || $[8] !== editProperty || $[9] !== t4) {
|
|
9673
10214
|
t5 = {
|
|
9674
10215
|
editCollection,
|
|
9675
10216
|
createCollection,
|
|
9676
10217
|
editProperty,
|
|
9677
|
-
configPermissions: t4
|
|
9678
|
-
getPathSuggestions
|
|
10218
|
+
configPermissions: t4
|
|
9679
10219
|
};
|
|
9680
10220
|
$[6] = createCollection;
|
|
9681
10221
|
$[7] = editCollection;
|
|
9682
10222
|
$[8] = editProperty;
|
|
9683
|
-
$[9] =
|
|
9684
|
-
$[10] =
|
|
9685
|
-
$[11] = t5;
|
|
10223
|
+
$[9] = t4;
|
|
10224
|
+
$[10] = t5;
|
|
9686
10225
|
} else {
|
|
9687
|
-
t5 = $[
|
|
10226
|
+
t5 = $[10];
|
|
9688
10227
|
}
|
|
9689
10228
|
const t6 = Boolean(currentDialog);
|
|
9690
10229
|
let t7;
|
|
9691
|
-
if ($[
|
|
10230
|
+
if ($[11] !== currentDialog || $[12] !== navigate || $[13] !== navigation) {
|
|
9692
10231
|
t7 = (collection_0) => {
|
|
9693
10232
|
if (currentDialog?.redirect) {
|
|
9694
10233
|
if (collection_0 && currentDialog?.isNewCollection && !currentDialog.parentCollectionIds.length) {
|
|
@@ -9698,29 +10237,28 @@
|
|
|
9698
10237
|
}
|
|
9699
10238
|
setCurrentDialog(void 0);
|
|
9700
10239
|
};
|
|
9701
|
-
$[
|
|
9702
|
-
$[
|
|
9703
|
-
$[
|
|
9704
|
-
$[
|
|
10240
|
+
$[11] = currentDialog;
|
|
10241
|
+
$[12] = navigate;
|
|
10242
|
+
$[13] = navigation;
|
|
10243
|
+
$[14] = t7;
|
|
9705
10244
|
} else {
|
|
9706
|
-
t7 = $[
|
|
10245
|
+
t7 = $[14];
|
|
9707
10246
|
}
|
|
9708
10247
|
let t8;
|
|
9709
|
-
if ($[
|
|
9710
|
-
t8 = /* @__PURE__ */ jsxRuntime.jsx(CollectionEditorDialog, { open: t6, configController: collectionConfigController, isNewCollection: false, collectionInference, ...currentDialog, getData, reservedGroups, extraView,
|
|
9711
|
-
$[
|
|
9712
|
-
$[
|
|
9713
|
-
$[
|
|
9714
|
-
$[
|
|
9715
|
-
$[
|
|
9716
|
-
$[
|
|
9717
|
-
$[
|
|
9718
|
-
$[
|
|
9719
|
-
$[
|
|
9720
|
-
$[
|
|
9721
|
-
$[26] = t8;
|
|
10248
|
+
if ($[15] !== collectionConfigController || $[16] !== collectionInference || $[17] !== currentDialog || $[18] !== extraView || $[19] !== getData || $[20] !== getUser || $[21] !== reservedGroups || $[22] !== t6 || $[23] !== t7) {
|
|
10249
|
+
t8 = /* @__PURE__ */ jsxRuntime.jsx(CollectionEditorDialog, { open: t6, configController: collectionConfigController, isNewCollection: false, collectionInference, ...currentDialog, getData, reservedGroups, extraView, getUser, handleClose: t7 });
|
|
10250
|
+
$[15] = collectionConfigController;
|
|
10251
|
+
$[16] = collectionInference;
|
|
10252
|
+
$[17] = currentDialog;
|
|
10253
|
+
$[18] = extraView;
|
|
10254
|
+
$[19] = getData;
|
|
10255
|
+
$[20] = getUser;
|
|
10256
|
+
$[21] = reservedGroups;
|
|
10257
|
+
$[22] = t6;
|
|
10258
|
+
$[23] = t7;
|
|
10259
|
+
$[24] = t8;
|
|
9722
10260
|
} else {
|
|
9723
|
-
t8 = $[
|
|
10261
|
+
t8 = $[24];
|
|
9724
10262
|
}
|
|
9725
10263
|
const t9 = Boolean(currentPropertyDialog);
|
|
9726
10264
|
const t10 = Boolean(currentPropertyDialog?.propertyKey);
|
|
@@ -9728,21 +10266,21 @@
|
|
|
9728
10266
|
const t12 = !currentPropertyDialog ? false : !currentPropertyDialog?.propertyKey;
|
|
9729
10267
|
const t13 = currentPropertyDialog?.collectionEditable ?? false;
|
|
9730
10268
|
let t14;
|
|
9731
|
-
if ($[
|
|
10269
|
+
if ($[25] !== currentPropertyDialog || $[26] !== getData || $[27] !== navigation) {
|
|
9732
10270
|
t14 = getData && currentPropertyDialog?.editedCollectionId ? () => {
|
|
9733
10271
|
console.debug("get data for property", currentPropertyDialog?.editedCollectionId);
|
|
9734
10272
|
const resolvedPath = navigation.resolveIdsFrom(currentPropertyDialog.editedCollectionId);
|
|
9735
10273
|
return getData(resolvedPath, []);
|
|
9736
10274
|
} : void 0;
|
|
9737
|
-
$[
|
|
9738
|
-
$[
|
|
9739
|
-
$[
|
|
9740
|
-
$[
|
|
10275
|
+
$[25] = currentPropertyDialog;
|
|
10276
|
+
$[26] = getData;
|
|
10277
|
+
$[27] = navigation;
|
|
10278
|
+
$[28] = t14;
|
|
9741
10279
|
} else {
|
|
9742
|
-
t14 = $[
|
|
10280
|
+
t14 = $[28];
|
|
9743
10281
|
}
|
|
9744
10282
|
let t15;
|
|
9745
|
-
if ($[
|
|
10283
|
+
if ($[29] !== collectionConfigController || $[30] !== currentPropertyDialog || $[31] !== snackbarController) {
|
|
9746
10284
|
t15 = (t162) => {
|
|
9747
10285
|
const {
|
|
9748
10286
|
id: id_0,
|
|
@@ -9771,15 +10309,15 @@
|
|
|
9771
10309
|
return false;
|
|
9772
10310
|
});
|
|
9773
10311
|
};
|
|
9774
|
-
$[
|
|
9775
|
-
$[
|
|
9776
|
-
$[
|
|
9777
|
-
$[
|
|
10312
|
+
$[29] = collectionConfigController;
|
|
10313
|
+
$[30] = currentPropertyDialog;
|
|
10314
|
+
$[31] = snackbarController;
|
|
10315
|
+
$[32] = t15;
|
|
9778
10316
|
} else {
|
|
9779
|
-
t15 = $[
|
|
10317
|
+
t15 = $[32];
|
|
9780
10318
|
}
|
|
9781
10319
|
let t16;
|
|
9782
|
-
if ($[
|
|
10320
|
+
if ($[33] !== collectionConfigController || $[34] !== currentPropertyDialog?.currentPropertiesOrder || $[35] !== currentPropertyDialog?.editedCollectionId || $[36] !== currentPropertyDialog?.namespace || $[37] !== currentPropertyDialog?.parentCollectionIds || $[38] !== currentPropertyDialog?.propertyKey || $[39] !== snackbarController) {
|
|
9783
10321
|
t16 = () => {
|
|
9784
10322
|
if (!currentPropertyDialog?.propertyKey) {
|
|
9785
10323
|
return;
|
|
@@ -9802,21 +10340,21 @@
|
|
|
9802
10340
|
return false;
|
|
9803
10341
|
});
|
|
9804
10342
|
};
|
|
9805
|
-
$[
|
|
9806
|
-
$[
|
|
9807
|
-
$[
|
|
9808
|
-
$[
|
|
9809
|
-
$[
|
|
9810
|
-
$[
|
|
9811
|
-
$[
|
|
9812
|
-
$[
|
|
10343
|
+
$[33] = collectionConfigController;
|
|
10344
|
+
$[34] = currentPropertyDialog?.currentPropertiesOrder;
|
|
10345
|
+
$[35] = currentPropertyDialog?.editedCollectionId;
|
|
10346
|
+
$[36] = currentPropertyDialog?.namespace;
|
|
10347
|
+
$[37] = currentPropertyDialog?.parentCollectionIds;
|
|
10348
|
+
$[38] = currentPropertyDialog?.propertyKey;
|
|
10349
|
+
$[39] = snackbarController;
|
|
10350
|
+
$[40] = t16;
|
|
9813
10351
|
} else {
|
|
9814
|
-
t16 = $[
|
|
10352
|
+
t16 = $[40];
|
|
9815
10353
|
}
|
|
9816
10354
|
let t17;
|
|
9817
10355
|
let t18;
|
|
9818
10356
|
let t19;
|
|
9819
|
-
if ($[
|
|
10357
|
+
if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9820
10358
|
t17 = () => {
|
|
9821
10359
|
setCurrentPropertyDialog(void 0);
|
|
9822
10360
|
};
|
|
@@ -9824,64 +10362,64 @@
|
|
|
9824
10362
|
setCurrentPropertyDialog(void 0);
|
|
9825
10363
|
};
|
|
9826
10364
|
t19 = {};
|
|
9827
|
-
$[
|
|
9828
|
-
$[
|
|
9829
|
-
$[
|
|
10365
|
+
$[41] = t17;
|
|
10366
|
+
$[42] = t18;
|
|
10367
|
+
$[43] = t19;
|
|
9830
10368
|
} else {
|
|
9831
|
-
t17 = $[
|
|
9832
|
-
t18 = $[
|
|
9833
|
-
t19 = $[
|
|
10369
|
+
t17 = $[41];
|
|
10370
|
+
t18 = $[42];
|
|
10371
|
+
t19 = $[43];
|
|
9834
10372
|
}
|
|
9835
10373
|
let t20;
|
|
9836
|
-
if ($[
|
|
10374
|
+
if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9837
10375
|
t20 = [];
|
|
9838
|
-
$[
|
|
10376
|
+
$[44] = t20;
|
|
9839
10377
|
} else {
|
|
9840
|
-
t20 = $[
|
|
10378
|
+
t20 = $[44];
|
|
9841
10379
|
}
|
|
9842
10380
|
const t21 = currentPropertyDialog?.property;
|
|
9843
10381
|
const t22 = currentPropertyDialog?.propertyKey;
|
|
9844
10382
|
let t23;
|
|
9845
|
-
if ($[
|
|
10383
|
+
if ($[45] !== propertyConfigs || $[46] !== t10 || $[47] !== t11 || $[48] !== t12 || $[49] !== t13 || $[50] !== t14 || $[51] !== t15 || $[52] !== t16 || $[53] !== t21 || $[54] !== t22 || $[55] !== t9) {
|
|
9846
10384
|
t23 = /* @__PURE__ */ jsxRuntime.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 });
|
|
9847
|
-
$[
|
|
9848
|
-
$[
|
|
9849
|
-
$[
|
|
9850
|
-
$[
|
|
9851
|
-
$[
|
|
9852
|
-
$[
|
|
9853
|
-
$[
|
|
9854
|
-
$[
|
|
9855
|
-
$[
|
|
9856
|
-
$[
|
|
9857
|
-
$[
|
|
9858
|
-
$[
|
|
9859
|
-
} else {
|
|
9860
|
-
t23 = $[
|
|
10385
|
+
$[45] = propertyConfigs;
|
|
10386
|
+
$[46] = t10;
|
|
10387
|
+
$[47] = t11;
|
|
10388
|
+
$[48] = t12;
|
|
10389
|
+
$[49] = t13;
|
|
10390
|
+
$[50] = t14;
|
|
10391
|
+
$[51] = t15;
|
|
10392
|
+
$[52] = t16;
|
|
10393
|
+
$[53] = t21;
|
|
10394
|
+
$[54] = t22;
|
|
10395
|
+
$[55] = t9;
|
|
10396
|
+
$[56] = t23;
|
|
10397
|
+
} else {
|
|
10398
|
+
t23 = $[56];
|
|
9861
10399
|
}
|
|
9862
10400
|
let t24;
|
|
9863
|
-
if ($[
|
|
10401
|
+
if ($[57] !== children || $[58] !== t23 || $[59] !== t5 || $[60] !== t8) {
|
|
9864
10402
|
t24 = /* @__PURE__ */ jsxRuntime.jsxs(CollectionEditorContext.Provider, { value: t5, children: [
|
|
9865
10403
|
children,
|
|
9866
10404
|
t8,
|
|
9867
10405
|
t23
|
|
9868
10406
|
] });
|
|
9869
|
-
$[
|
|
9870
|
-
$[
|
|
9871
|
-
$[
|
|
9872
|
-
$[
|
|
9873
|
-
$[
|
|
10407
|
+
$[57] = children;
|
|
10408
|
+
$[58] = t23;
|
|
10409
|
+
$[59] = t5;
|
|
10410
|
+
$[60] = t8;
|
|
10411
|
+
$[61] = t24;
|
|
9874
10412
|
} else {
|
|
9875
|
-
t24 = $[
|
|
10413
|
+
t24 = $[61];
|
|
9876
10414
|
}
|
|
9877
10415
|
let t25;
|
|
9878
|
-
if ($[
|
|
10416
|
+
if ($[62] !== collectionConfigController || $[63] !== t24) {
|
|
9879
10417
|
t25 = /* @__PURE__ */ jsxRuntime.jsx(ConfigControllerContext.Provider, { value: collectionConfigController, children: t24 });
|
|
9880
|
-
$[
|
|
9881
|
-
$[
|
|
9882
|
-
$[
|
|
10418
|
+
$[62] = collectionConfigController;
|
|
10419
|
+
$[63] = t24;
|
|
10420
|
+
$[64] = t25;
|
|
9883
10421
|
} else {
|
|
9884
|
-
t25 = $[
|
|
10422
|
+
t25 = $[64];
|
|
9885
10423
|
}
|
|
9886
10424
|
return t25;
|
|
9887
10425
|
}, equal);
|
|
@@ -9953,14 +10491,14 @@
|
|
|
9953
10491
|
}
|
|
9954
10492
|
let t6;
|
|
9955
10493
|
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9956
|
-
t6 = /* @__PURE__ */ jsxRuntime.jsx(ui.SettingsIcon, {});
|
|
10494
|
+
t6 = /* @__PURE__ */ jsxRuntime.jsx(ui.SettingsIcon, { size: "small" });
|
|
9957
10495
|
$[15] = t6;
|
|
9958
10496
|
} else {
|
|
9959
10497
|
t6 = $[15];
|
|
9960
10498
|
}
|
|
9961
10499
|
let t7;
|
|
9962
10500
|
if ($[16] !== t4 || $[17] !== t5) {
|
|
9963
|
-
t7 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { color: "primary", disabled: t4, onClick: t5, children: t6 });
|
|
10501
|
+
t7 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", color: "primary", disabled: t4, onClick: t5, children: t6 });
|
|
9964
10502
|
$[16] = t4;
|
|
9965
10503
|
$[17] = t5;
|
|
9966
10504
|
$[18] = t7;
|
|
@@ -10052,7 +10590,7 @@
|
|
|
10052
10590
|
const deleteCollection = t3;
|
|
10053
10591
|
let t4;
|
|
10054
10592
|
if ($[11] !== permissions.deleteCollections) {
|
|
10055
|
-
t4 = permissions.deleteCollections && /* @__PURE__ */ jsxRuntime.jsx(ui.Menu, { trigger: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.MoreVertIcon, { size: "small" }) }), children: /* @__PURE__ */ jsxRuntime.jsxs(ui.MenuItem, { dense: true, onClick: (event) => {
|
|
10593
|
+
t4 = permissions.deleteCollections && /* @__PURE__ */ jsxRuntime.jsx(ui.Menu, { trigger: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", children: /* @__PURE__ */ jsxRuntime.jsx(ui.MoreVertIcon, { size: "small" }) }), children: /* @__PURE__ */ jsxRuntime.jsxs(ui.MenuItem, { dense: true, onClick: (event) => {
|
|
10056
10594
|
event.preventDefault();
|
|
10057
10595
|
event.stopPropagation();
|
|
10058
10596
|
setDeleteRequested(true);
|
|
@@ -10067,7 +10605,7 @@
|
|
|
10067
10605
|
}
|
|
10068
10606
|
let t5;
|
|
10069
10607
|
if ($[13] !== onEditCollectionClicked || $[14] !== permissions.editCollections) {
|
|
10070
|
-
t5 = permissions.editCollections && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { onClick: (event_0) => {
|
|
10608
|
+
t5 = permissions.editCollections && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: (event_0) => {
|
|
10071
10609
|
onEditCollectionClicked();
|
|
10072
10610
|
}, children: /* @__PURE__ */ jsxRuntime.jsx(ui.SettingsIcon, { size: "small" }) });
|
|
10073
10611
|
$[13] = onEditCollectionClicked;
|
|
@@ -10495,22 +11033,115 @@
|
|
|
10495
11033
|
}
|
|
10496
11034
|
return t8;
|
|
10497
11035
|
}
|
|
11036
|
+
function EditorEntityAction(t0) {
|
|
11037
|
+
const $ = reactCompilerRuntime.c(23);
|
|
11038
|
+
const {
|
|
11039
|
+
path: fullPath,
|
|
11040
|
+
parentCollectionIds,
|
|
11041
|
+
collection,
|
|
11042
|
+
formContext
|
|
11043
|
+
} = t0;
|
|
11044
|
+
const authController = core.useAuthController();
|
|
11045
|
+
const navigationController = core.useNavigationController();
|
|
11046
|
+
const collectionEditorController = useCollectionEditorController();
|
|
11047
|
+
let t1;
|
|
11048
|
+
if ($[0] !== navigationController || $[1] !== parentCollectionIds) {
|
|
11049
|
+
t1 = navigationController.getCollectionFromIds(parentCollectionIds);
|
|
11050
|
+
$[0] = navigationController;
|
|
11051
|
+
$[1] = parentCollectionIds;
|
|
11052
|
+
$[2] = t1;
|
|
11053
|
+
} else {
|
|
11054
|
+
t1 = $[2];
|
|
11055
|
+
}
|
|
11056
|
+
const parentCollection = t1;
|
|
11057
|
+
let t2;
|
|
11058
|
+
if ($[3] !== authController || $[4] !== collection || $[5] !== collectionEditorController) {
|
|
11059
|
+
t2 = collectionEditorController.configPermissions ? collectionEditorController.configPermissions({
|
|
11060
|
+
user: authController.user,
|
|
11061
|
+
collection
|
|
11062
|
+
}).editCollections : true;
|
|
11063
|
+
$[3] = authController;
|
|
11064
|
+
$[4] = collection;
|
|
11065
|
+
$[5] = collectionEditorController;
|
|
11066
|
+
$[6] = t2;
|
|
11067
|
+
} else {
|
|
11068
|
+
t2 = $[6];
|
|
11069
|
+
}
|
|
11070
|
+
const canEditCollection = t2;
|
|
11071
|
+
const isDirty = formContext?.formex.dirty ?? false;
|
|
11072
|
+
const t3 = canEditCollection ? isDirty ? "You need to save the document before changing the schema" : "Edit schema for this form" : "You don't have permissions to edit this collection";
|
|
11073
|
+
const t4 = !canEditCollection || isDirty;
|
|
11074
|
+
let t5;
|
|
11075
|
+
if ($[7] !== canEditCollection || $[8] !== collection || $[9] !== collectionEditorController || $[10] !== fullPath || $[11] !== parentCollection || $[12] !== parentCollectionIds) {
|
|
11076
|
+
t5 = canEditCollection ? () => collectionEditorController?.editCollection({
|
|
11077
|
+
id: collection.id,
|
|
11078
|
+
fullPath,
|
|
11079
|
+
parentCollectionIds,
|
|
11080
|
+
parentCollection
|
|
11081
|
+
}) : void 0;
|
|
11082
|
+
$[7] = canEditCollection;
|
|
11083
|
+
$[8] = collection;
|
|
11084
|
+
$[9] = collectionEditorController;
|
|
11085
|
+
$[10] = fullPath;
|
|
11086
|
+
$[11] = parentCollection;
|
|
11087
|
+
$[12] = parentCollectionIds;
|
|
11088
|
+
$[13] = t5;
|
|
11089
|
+
} else {
|
|
11090
|
+
t5 = $[13];
|
|
11091
|
+
}
|
|
11092
|
+
let t6;
|
|
11093
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
11094
|
+
t6 = /* @__PURE__ */ jsxRuntime.jsx(ui.SettingsIcon, { size: "small" });
|
|
11095
|
+
$[14] = t6;
|
|
11096
|
+
} else {
|
|
11097
|
+
t6 = $[14];
|
|
11098
|
+
}
|
|
11099
|
+
let t7;
|
|
11100
|
+
if ($[15] !== t4 || $[16] !== t5) {
|
|
11101
|
+
t7 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { color: "primary", disabled: t4, onClick: t5, children: t6 });
|
|
11102
|
+
$[15] = t4;
|
|
11103
|
+
$[16] = t5;
|
|
11104
|
+
$[17] = t7;
|
|
11105
|
+
} else {
|
|
11106
|
+
t7 = $[17];
|
|
11107
|
+
}
|
|
11108
|
+
let t8;
|
|
11109
|
+
if ($[18] !== t3 || $[19] !== t7) {
|
|
11110
|
+
t8 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { asChild: true, title: t3, children: t7 });
|
|
11111
|
+
$[18] = t3;
|
|
11112
|
+
$[19] = t7;
|
|
11113
|
+
$[20] = t8;
|
|
11114
|
+
} else {
|
|
11115
|
+
t8 = $[20];
|
|
11116
|
+
}
|
|
11117
|
+
const editorButton = t8;
|
|
11118
|
+
let t9;
|
|
11119
|
+
if ($[21] !== editorButton) {
|
|
11120
|
+
t9 = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: editorButton });
|
|
11121
|
+
$[21] = editorButton;
|
|
11122
|
+
$[22] = t9;
|
|
11123
|
+
} else {
|
|
11124
|
+
t9 = $[22];
|
|
11125
|
+
}
|
|
11126
|
+
return t9;
|
|
11127
|
+
}
|
|
10498
11128
|
function useCollectionEditorPlugin(t0) {
|
|
10499
|
-
const $ = reactCompilerRuntime.c(
|
|
11129
|
+
const $ = reactCompilerRuntime.c(22);
|
|
10500
11130
|
const {
|
|
10501
11131
|
collectionConfigController,
|
|
10502
11132
|
configPermissions,
|
|
10503
11133
|
reservedGroups,
|
|
10504
11134
|
extraView,
|
|
10505
|
-
getPathSuggestions,
|
|
10506
11135
|
getUser,
|
|
10507
11136
|
collectionInference,
|
|
10508
11137
|
getData,
|
|
10509
|
-
onAnalyticsEvent
|
|
11138
|
+
onAnalyticsEvent,
|
|
11139
|
+
includeIntroView: t1
|
|
10510
11140
|
} = t0;
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
|
|
11141
|
+
const includeIntroView = t1 === void 0 ? true : t1;
|
|
11142
|
+
let t2;
|
|
11143
|
+
if ($[0] !== collectionConfigController || $[1] !== collectionInference || $[2] !== configPermissions || $[3] !== extraView || $[4] !== getData || $[5] !== getUser || $[6] !== onAnalyticsEvent || $[7] !== reservedGroups) {
|
|
11144
|
+
t2 = {
|
|
10514
11145
|
Component: ConfigControllerProvider,
|
|
10515
11146
|
props: {
|
|
10516
11147
|
collectionConfigController,
|
|
@@ -10518,7 +11149,6 @@
|
|
|
10518
11149
|
collectionInference,
|
|
10519
11150
|
reservedGroups,
|
|
10520
11151
|
extraView,
|
|
10521
|
-
getPathSuggestions,
|
|
10522
11152
|
getUser,
|
|
10523
11153
|
getData,
|
|
10524
11154
|
onAnalyticsEvent
|
|
@@ -10529,53 +11159,84 @@
|
|
|
10529
11159
|
$[2] = configPermissions;
|
|
10530
11160
|
$[3] = extraView;
|
|
10531
11161
|
$[4] = getData;
|
|
10532
|
-
$[5] =
|
|
10533
|
-
$[6] =
|
|
10534
|
-
$[7] =
|
|
10535
|
-
$[8] =
|
|
10536
|
-
$[9] = t1;
|
|
11162
|
+
$[5] = getUser;
|
|
11163
|
+
$[6] = onAnalyticsEvent;
|
|
11164
|
+
$[7] = reservedGroups;
|
|
11165
|
+
$[8] = t2;
|
|
10537
11166
|
} else {
|
|
10538
|
-
|
|
11167
|
+
t2 = $[8];
|
|
10539
11168
|
}
|
|
10540
|
-
let t2;
|
|
10541
11169
|
let t3;
|
|
10542
|
-
if ($[
|
|
10543
|
-
|
|
10544
|
-
|
|
10545
|
-
|
|
11170
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
11171
|
+
t3 = /* @__PURE__ */ jsxRuntime.jsx(NewCollectionButton, {});
|
|
11172
|
+
$[9] = t3;
|
|
11173
|
+
} else {
|
|
11174
|
+
t3 = $[9];
|
|
11175
|
+
}
|
|
11176
|
+
let t4;
|
|
11177
|
+
if ($[10] !== includeIntroView) {
|
|
11178
|
+
t4 = includeIntroView ? /* @__PURE__ */ jsxRuntime.jsx(IntroWidget, {}) : void 0;
|
|
11179
|
+
$[10] = includeIntroView;
|
|
11180
|
+
$[11] = t4;
|
|
11181
|
+
} else {
|
|
11182
|
+
t4 = $[11];
|
|
11183
|
+
}
|
|
11184
|
+
let t5;
|
|
11185
|
+
if ($[12] !== collectionConfigController.navigationEntries || $[13] !== collectionConfigController.saveNavigationEntries || $[14] !== t4) {
|
|
11186
|
+
t5 = {
|
|
11187
|
+
additionalActions: t3,
|
|
11188
|
+
additionalChildrenStart: t4,
|
|
10546
11189
|
CollectionActions: HomePageEditorCollectionAction,
|
|
10547
|
-
AdditionalCards: NewCollectionCard
|
|
11190
|
+
AdditionalCards: NewCollectionCard,
|
|
11191
|
+
allowDragAndDrop: true,
|
|
11192
|
+
navigationEntries: collectionConfigController.navigationEntries,
|
|
11193
|
+
onNavigationEntriesUpdate: collectionConfigController.saveNavigationEntries
|
|
10548
11194
|
};
|
|
10549
|
-
|
|
11195
|
+
$[12] = collectionConfigController.navigationEntries;
|
|
11196
|
+
$[13] = collectionConfigController.saveNavigationEntries;
|
|
11197
|
+
$[14] = t4;
|
|
11198
|
+
$[15] = t5;
|
|
11199
|
+
} else {
|
|
11200
|
+
t5 = $[15];
|
|
11201
|
+
}
|
|
11202
|
+
let t6;
|
|
11203
|
+
let t7;
|
|
11204
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
11205
|
+
t6 = {
|
|
10550
11206
|
CollectionActionsStart: EditorCollectionActionStart,
|
|
10551
11207
|
CollectionActions: EditorCollectionAction,
|
|
10552
11208
|
HeaderAction: CollectionViewHeaderAction,
|
|
10553
11209
|
AddColumnComponent: PropertyAddColumnComponent
|
|
10554
11210
|
};
|
|
10555
|
-
|
|
10556
|
-
|
|
11211
|
+
t7 = {
|
|
11212
|
+
ActionsTop: EditorEntityAction
|
|
11213
|
+
};
|
|
11214
|
+
$[16] = t6;
|
|
11215
|
+
$[17] = t7;
|
|
10557
11216
|
} else {
|
|
10558
|
-
|
|
10559
|
-
|
|
11217
|
+
t6 = $[16];
|
|
11218
|
+
t7 = $[17];
|
|
10560
11219
|
}
|
|
10561
|
-
let
|
|
10562
|
-
if ($[
|
|
10563
|
-
|
|
11220
|
+
let t8;
|
|
11221
|
+
if ($[18] !== collectionConfigController.loading || $[19] !== t2 || $[20] !== t5) {
|
|
11222
|
+
t8 = {
|
|
10564
11223
|
key: "collection_editor",
|
|
10565
11224
|
loading: collectionConfigController.loading,
|
|
10566
|
-
provider:
|
|
10567
|
-
homePage:
|
|
10568
|
-
collectionView:
|
|
11225
|
+
provider: t2,
|
|
11226
|
+
homePage: t5,
|
|
11227
|
+
collectionView: t6,
|
|
11228
|
+
form: t7
|
|
10569
11229
|
};
|
|
10570
|
-
$[
|
|
10571
|
-
$[
|
|
10572
|
-
$[
|
|
11230
|
+
$[18] = collectionConfigController.loading;
|
|
11231
|
+
$[19] = t2;
|
|
11232
|
+
$[20] = t5;
|
|
11233
|
+
$[21] = t8;
|
|
10573
11234
|
} else {
|
|
10574
|
-
|
|
11235
|
+
t8 = $[21];
|
|
10575
11236
|
}
|
|
10576
|
-
return
|
|
11237
|
+
return t8;
|
|
10577
11238
|
}
|
|
10578
|
-
function IntroWidget(
|
|
11239
|
+
function IntroWidget() {
|
|
10579
11240
|
const $ = reactCompilerRuntime.c(11);
|
|
10580
11241
|
const navigation = core.useNavigationController();
|
|
10581
11242
|
if (!navigation.topLevelNavigation) {
|
|
@@ -10583,35 +11244,35 @@
|
|
|
10583
11244
|
}
|
|
10584
11245
|
const authController = core.useAuthController();
|
|
10585
11246
|
const collectionEditorController = useCollectionEditorController();
|
|
10586
|
-
let
|
|
11247
|
+
let t0;
|
|
10587
11248
|
if ($[0] !== authController || $[1] !== collectionEditorController) {
|
|
10588
|
-
|
|
11249
|
+
t0 = collectionEditorController.configPermissions ? collectionEditorController.configPermissions({
|
|
10589
11250
|
user: authController.user
|
|
10590
11251
|
}).createCollections : true;
|
|
10591
11252
|
$[0] = authController;
|
|
10592
11253
|
$[1] = collectionEditorController;
|
|
10593
|
-
$[2] =
|
|
11254
|
+
$[2] = t0;
|
|
10594
11255
|
} else {
|
|
10595
|
-
|
|
11256
|
+
t0 = $[2];
|
|
10596
11257
|
}
|
|
10597
|
-
const canCreateCollections =
|
|
11258
|
+
const canCreateCollections = t0;
|
|
10598
11259
|
if (!navigation.initialised || (navigation.collections ?? []).length > 0) {
|
|
10599
11260
|
return null;
|
|
10600
11261
|
}
|
|
11262
|
+
let t1;
|
|
10601
11263
|
let t2;
|
|
10602
|
-
let t3;
|
|
10603
11264
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10604
|
-
|
|
10605
|
-
|
|
10606
|
-
$[3] =
|
|
10607
|
-
$[4] =
|
|
11265
|
+
t1 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "uppercase", children: "No collections found" });
|
|
11266
|
+
t2 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { children: "Start building collections in FireCMS easily. Map them to your existing database data, import from files, or use our templates." });
|
|
11267
|
+
$[3] = t1;
|
|
11268
|
+
$[4] = t2;
|
|
10608
11269
|
} else {
|
|
10609
|
-
|
|
10610
|
-
|
|
11270
|
+
t1 = $[3];
|
|
11271
|
+
t2 = $[4];
|
|
10611
11272
|
}
|
|
10612
|
-
let
|
|
11273
|
+
let t3;
|
|
10613
11274
|
if ($[5] !== canCreateCollections || $[6] !== collectionEditorController) {
|
|
10614
|
-
|
|
11275
|
+
t3 = canCreateCollections && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { onClick: collectionEditorController && canCreateCollections ? () => collectionEditorController.createCollection({
|
|
10615
11276
|
parentCollectionIds: [],
|
|
10616
11277
|
redirect: true,
|
|
10617
11278
|
sourceClick: "new_collection_card"
|
|
@@ -10621,31 +11282,31 @@
|
|
|
10621
11282
|
] });
|
|
10622
11283
|
$[5] = canCreateCollections;
|
|
10623
11284
|
$[6] = collectionEditorController;
|
|
10624
|
-
$[7] =
|
|
11285
|
+
$[7] = t3;
|
|
10625
11286
|
} else {
|
|
10626
|
-
|
|
11287
|
+
t3 = $[7];
|
|
10627
11288
|
}
|
|
10628
|
-
let
|
|
11289
|
+
let t4;
|
|
10629
11290
|
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10630
|
-
|
|
10631
|
-
$[8] =
|
|
11291
|
+
t4 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { color: "secondary", children: "You can also define collections programmatically." });
|
|
11292
|
+
$[8] = t4;
|
|
10632
11293
|
} else {
|
|
10633
|
-
|
|
11294
|
+
t4 = $[8];
|
|
10634
11295
|
}
|
|
10635
|
-
let
|
|
10636
|
-
if ($[9] !==
|
|
10637
|
-
|
|
11296
|
+
let t5;
|
|
11297
|
+
if ($[9] !== t3) {
|
|
11298
|
+
t5 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Paper, { className: "my-4 px-4 py-6 flex flex-col bg-white dark:bg-surface-accent-800 gap-2", children: [
|
|
11299
|
+
t1,
|
|
10638
11300
|
t2,
|
|
10639
11301
|
t3,
|
|
10640
|
-
t4
|
|
10641
|
-
t5
|
|
11302
|
+
t4
|
|
10642
11303
|
] });
|
|
10643
|
-
$[9] =
|
|
10644
|
-
$[10] =
|
|
11304
|
+
$[9] = t3;
|
|
11305
|
+
$[10] = t5;
|
|
10645
11306
|
} else {
|
|
10646
|
-
|
|
11307
|
+
t5 = $[10];
|
|
10647
11308
|
}
|
|
10648
|
-
return
|
|
11309
|
+
return t5;
|
|
10649
11310
|
}
|
|
10650
11311
|
const mergeCollections = (baseCollections, backendCollections = [], modifyCollection) => {
|
|
10651
11312
|
const markAsEditable = (c) => {
|
|
@@ -10654,11 +11315,19 @@
|
|
|
10654
11315
|
};
|
|
10655
11316
|
backendCollections.forEach(markAsEditable);
|
|
10656
11317
|
const result = core.joinCollectionLists(baseCollections, backendCollections, [], modifyCollection);
|
|
10657
|
-
result.sort((a, b) =>
|
|
10658
|
-
|
|
10659
|
-
baseCollections
|
|
10660
|
-
|
|
10661
|
-
|
|
11318
|
+
result.sort((a, b) => {
|
|
11319
|
+
const indexA = baseCollections.findIndex((c) => c.id === a.id);
|
|
11320
|
+
const indexB = baseCollections.findIndex((c) => c.id === b.id);
|
|
11321
|
+
if (indexA === -1 && indexB === -1) {
|
|
11322
|
+
return 0;
|
|
11323
|
+
}
|
|
11324
|
+
if (indexA === -1) {
|
|
11325
|
+
return 1;
|
|
11326
|
+
}
|
|
11327
|
+
if (indexB === -1) {
|
|
11328
|
+
return -1;
|
|
11329
|
+
}
|
|
11330
|
+
return indexA - indexB;
|
|
10662
11331
|
});
|
|
10663
11332
|
return result;
|
|
10664
11333
|
};
|