@firecms/collection_editor 3.0.0-beta.11 → 3.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ConfigControllerProvider.d.ts +0 -9
- package/dist/index.es.js +804 -613
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +803 -612
- package/dist/index.umd.js.map +1 -1
- package/dist/types/collection_editor_controller.d.ts +0 -10
- package/dist/ui/collection_editor/CollectionDetailsForm.d.ts +3 -1
- package/dist/ui/collection_editor/LayoutModeSwitch.d.ts +5 -0
- package/dist/useCollectionEditorPlugin.d.ts +1 -10
- package/dist/utils/collections.d.ts +1 -1
- package/package.json +18 -17
- package/src/ConfigControllerProvider.tsx +1 -10
- package/src/types/collection_editor_controller.tsx +0 -7
- package/src/ui/HomePageEditorCollectionAction.tsx +1 -0
- package/src/ui/collection_editor/CollectionDetailsForm.tsx +18 -6
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +42 -4
- package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +0 -2
- package/src/ui/collection_editor/EnumForm.tsx +1 -1
- package/src/ui/collection_editor/GetCodeDialog.tsx +1 -1
- package/src/ui/collection_editor/LayoutModeSwitch.tsx +54 -0
- package/src/ui/collection_editor/PropertyEditView.tsx +2 -1
- package/src/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +1 -0
- package/src/useCollectionEditorPlugin.tsx +0 -9
- package/src/utils/collections.ts +13 -7
package/dist/index.es.js
CHANGED
|
@@ -4,7 +4,7 @@ import { FieldCaption, SearchIconsView, toSnakeCase, singular, IconForView, Arra
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import React__default, { useContext, useState, useEffect, useMemo, useRef, useDeferredValue } from "react";
|
|
6
6
|
import equal from "react-fast-compare";
|
|
7
|
-
import {
|
|
7
|
+
import { cls, Typography, VerticalSplitIcon, Tooltip, Card, SquareIcon, useAutoComplete, Chip, TextField, Autocomplete, AutocompleteItem, SelectItem, Container, IconButton, DebouncedTextField, SettingsIcon, CloseIcon, Select, BooleanSwitchWithLabel, ExpandablePanel, Dialog, Badge, AutorenewIcon, ListIcon, Button, CircularProgress, Paper, DialogTitle, DialogContent, DialogActions, RuleIcon, MultiSelectItem, CloudUploadIcon, MultiSelect, cardMixin, cardClickableMixin, cardSelectedMixin, FunctionsIcon, DoNotDisturbOnIcon, defaultBorderMixin, RemoveIcon, DragHandleIcon, AddIcon, SelectGroup, DeleteIcon, InfoLabel, fieldBackgroundMixin, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, WarningIcon, ContentCopyIcon, CodeIcon, Table, TableBody, TableRow, TableCell, Alert, Icon, coolIconKeys, Tabs, Tab, ArrowBackIcon, LoadingButton, CheckIcon, Menu, MoreVertIcon, MenuItem, UndoIcon, SaveIcon } from "@firecms/ui";
|
|
8
8
|
import * as Yup from "yup";
|
|
9
9
|
import { useFormex, getIn, Field, useCreateFormex, Formex, clone } from "@firecms/formex";
|
|
10
10
|
import { extractEnumFromValues, buildPropertyFromData, buildEntityPropertiesFromData } from "@firecms/schema_inference";
|
|
@@ -21,13 +21,154 @@ const YupSchema = Yup.object().shape({
|
|
|
21
21
|
const useCollectionEditorController = () => {
|
|
22
22
|
return useContext(CollectionEditorContext);
|
|
23
23
|
};
|
|
24
|
+
function LayoutModeSwitch(t0) {
|
|
25
|
+
const $ = c(29);
|
|
26
|
+
const {
|
|
27
|
+
value,
|
|
28
|
+
onChange,
|
|
29
|
+
className
|
|
30
|
+
} = t0;
|
|
31
|
+
let t1;
|
|
32
|
+
if ($[0] !== className) {
|
|
33
|
+
t1 = cls(className);
|
|
34
|
+
$[0] = className;
|
|
35
|
+
$[1] = t1;
|
|
36
|
+
} else {
|
|
37
|
+
t1 = $[1];
|
|
38
|
+
}
|
|
39
|
+
let t2;
|
|
40
|
+
let t3;
|
|
41
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
42
|
+
t2 = /* @__PURE__ */ jsx(Typography, { variant: "label", color: "secondary", className: "ml-3.5", children: "Document view" });
|
|
43
|
+
t3 = cls("flex flex-row gap-4");
|
|
44
|
+
$[2] = t2;
|
|
45
|
+
$[3] = t3;
|
|
46
|
+
} else {
|
|
47
|
+
t2 = $[2];
|
|
48
|
+
t3 = $[3];
|
|
49
|
+
}
|
|
50
|
+
let t4;
|
|
51
|
+
if ($[4] !== onChange) {
|
|
52
|
+
t4 = () => onChange("side_panel");
|
|
53
|
+
$[4] = onChange;
|
|
54
|
+
$[5] = t4;
|
|
55
|
+
} else {
|
|
56
|
+
t4 = $[5];
|
|
57
|
+
}
|
|
58
|
+
const t5 = value === "side_panel" ? "border-primary dark:border-primary" : "border-surface-400 dark:border-surface-600";
|
|
59
|
+
let t6;
|
|
60
|
+
if ($[6] !== t5) {
|
|
61
|
+
t6 = cls("my-2 rounded-md mx-0 p-4 focus:outline-none transition ease-in-out duration-150 flex flex-row gap-4 items-center", "text-surface-700 dark:text-surface-accent-300", "hover:text-primary-dark dark:hover:text-primary focus:ring-primary hover:ring-1 hover:ring-primary", t5);
|
|
62
|
+
$[6] = t5;
|
|
63
|
+
$[7] = t6;
|
|
64
|
+
} else {
|
|
65
|
+
t6 = $[7];
|
|
66
|
+
}
|
|
67
|
+
let t7;
|
|
68
|
+
let t8;
|
|
69
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
70
|
+
t7 = /* @__PURE__ */ jsx(VerticalSplitIcon, {});
|
|
71
|
+
t8 = /* @__PURE__ */ jsx(Typography, { variant: "label", children: "Side panel" });
|
|
72
|
+
$[8] = t7;
|
|
73
|
+
$[9] = t8;
|
|
74
|
+
} else {
|
|
75
|
+
t7 = $[8];
|
|
76
|
+
t8 = $[9];
|
|
77
|
+
}
|
|
78
|
+
let t9;
|
|
79
|
+
if ($[10] !== t4 || $[11] !== t6) {
|
|
80
|
+
t9 = /* @__PURE__ */ jsx(Tooltip, { title: "Documents are open in a side panel", children: /* @__PURE__ */ jsxs(Card, { onClick: t4, className: t6, children: [
|
|
81
|
+
t7,
|
|
82
|
+
t8
|
|
83
|
+
] }) });
|
|
84
|
+
$[10] = t4;
|
|
85
|
+
$[11] = t6;
|
|
86
|
+
$[12] = t9;
|
|
87
|
+
} else {
|
|
88
|
+
t9 = $[12];
|
|
89
|
+
}
|
|
90
|
+
let t10;
|
|
91
|
+
if ($[13] !== onChange) {
|
|
92
|
+
t10 = () => onChange("full_screen");
|
|
93
|
+
$[13] = onChange;
|
|
94
|
+
$[14] = t10;
|
|
95
|
+
} else {
|
|
96
|
+
t10 = $[14];
|
|
97
|
+
}
|
|
98
|
+
const t11 = value === "full_screen" ? "border-primary dark:border-primary" : "border-surface-400 dark:border-surface-600";
|
|
99
|
+
let t12;
|
|
100
|
+
if ($[15] !== t11) {
|
|
101
|
+
t12 = cls("my-2 rounded-md mx-0 p-4 focus:outline-none transition ease-in-out duration-150 flex flex-row gap-4 items-center", "text-surface-700 dark:text-surface-accent-300", "hover:text-primary-dark dark:hover:text-primary focus:ring-primary hover:ring-1 hover:ring-primary", t11);
|
|
102
|
+
$[15] = t11;
|
|
103
|
+
$[16] = t12;
|
|
104
|
+
} else {
|
|
105
|
+
t12 = $[16];
|
|
106
|
+
}
|
|
107
|
+
let t13;
|
|
108
|
+
let t14;
|
|
109
|
+
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
110
|
+
t13 = /* @__PURE__ */ jsx(SquareIcon, {});
|
|
111
|
+
t14 = /* @__PURE__ */ jsx(Typography, { variant: "label", children: "Full screen" });
|
|
112
|
+
$[17] = t13;
|
|
113
|
+
$[18] = t14;
|
|
114
|
+
} else {
|
|
115
|
+
t13 = $[17];
|
|
116
|
+
t14 = $[18];
|
|
117
|
+
}
|
|
118
|
+
let t15;
|
|
119
|
+
if ($[19] !== t10 || $[20] !== t12) {
|
|
120
|
+
t15 = /* @__PURE__ */ jsx(Tooltip, { title: "Documents are open full-screen", children: /* @__PURE__ */ jsxs(Card, { onClick: t10, className: t12, children: [
|
|
121
|
+
t13,
|
|
122
|
+
t14
|
|
123
|
+
] }) });
|
|
124
|
+
$[19] = t10;
|
|
125
|
+
$[20] = t12;
|
|
126
|
+
$[21] = t15;
|
|
127
|
+
} else {
|
|
128
|
+
t15 = $[21];
|
|
129
|
+
}
|
|
130
|
+
let t16;
|
|
131
|
+
if ($[22] !== t15 || $[23] !== t9) {
|
|
132
|
+
t16 = /* @__PURE__ */ jsxs("div", { className: t3, children: [
|
|
133
|
+
t9,
|
|
134
|
+
t15
|
|
135
|
+
] });
|
|
136
|
+
$[22] = t15;
|
|
137
|
+
$[23] = t9;
|
|
138
|
+
$[24] = t16;
|
|
139
|
+
} else {
|
|
140
|
+
t16 = $[24];
|
|
141
|
+
}
|
|
142
|
+
let t17;
|
|
143
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
144
|
+
t17 = /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "ml-3.5", children: "Should documents be opened full screen or in an inline side dialog" });
|
|
145
|
+
$[25] = t17;
|
|
146
|
+
} else {
|
|
147
|
+
t17 = $[25];
|
|
148
|
+
}
|
|
149
|
+
let t18;
|
|
150
|
+
if ($[26] !== t1 || $[27] !== t16) {
|
|
151
|
+
t18 = /* @__PURE__ */ jsxs("div", { className: t1, children: [
|
|
152
|
+
t2,
|
|
153
|
+
t16,
|
|
154
|
+
t17
|
|
155
|
+
] });
|
|
156
|
+
$[26] = t1;
|
|
157
|
+
$[27] = t16;
|
|
158
|
+
$[28] = t18;
|
|
159
|
+
} else {
|
|
160
|
+
t18 = $[28];
|
|
161
|
+
}
|
|
162
|
+
return t18;
|
|
163
|
+
}
|
|
24
164
|
function CollectionDetailsForm(t0) {
|
|
25
|
-
const $ = c(
|
|
165
|
+
const $ = c(176);
|
|
26
166
|
const {
|
|
27
167
|
isNewCollection,
|
|
28
168
|
reservedGroups,
|
|
29
169
|
groups,
|
|
30
|
-
parentCollection
|
|
170
|
+
parentCollection,
|
|
171
|
+
children
|
|
31
172
|
} = t0;
|
|
32
173
|
const groupRef = React__default.useRef(null);
|
|
33
174
|
const {
|
|
@@ -40,7 +181,7 @@ function CollectionDetailsForm(t0) {
|
|
|
40
181
|
isSubmitting,
|
|
41
182
|
submitCount
|
|
42
183
|
} = useFormex();
|
|
43
|
-
|
|
184
|
+
useCollectionEditorController();
|
|
44
185
|
const [iconDialogOpen, setIconDialogOpen] = useState(false);
|
|
45
186
|
const [advancedPanelExpanded, setAdvancedPanelExpanded] = useState(false);
|
|
46
187
|
let t1;
|
|
@@ -96,7 +237,6 @@ function CollectionDetailsForm(t0) {
|
|
|
96
237
|
t4 = $[8];
|
|
97
238
|
}
|
|
98
239
|
useEffect(t3, t4);
|
|
99
|
-
const DatabaseField = collectionEditor.components?.DatabaseField ?? DefaultDatabaseField;
|
|
100
240
|
let t5;
|
|
101
241
|
if ($[9] !== values) {
|
|
102
242
|
t5 = /* @__PURE__ */ jsx(IconForView, { collectionOrView: values });
|
|
@@ -154,154 +294,153 @@ function CollectionDetailsForm(t0) {
|
|
|
154
294
|
t12 = $[14];
|
|
155
295
|
}
|
|
156
296
|
let t13;
|
|
157
|
-
if ($[15] !==
|
|
158
|
-
t13 = /* @__PURE__ */ jsx(
|
|
159
|
-
$[15] =
|
|
160
|
-
$[16] =
|
|
161
|
-
$[17] =
|
|
162
|
-
$[18] = t13;
|
|
297
|
+
if ($[15] !== updateDatabaseId || $[16] !== values.databaseId) {
|
|
298
|
+
t13 = /* @__PURE__ */ jsx(DefaultDatabaseField, { databaseId: values.databaseId, onDatabaseIdUpdate: updateDatabaseId });
|
|
299
|
+
$[15] = updateDatabaseId;
|
|
300
|
+
$[16] = values.databaseId;
|
|
301
|
+
$[17] = t13;
|
|
163
302
|
} else {
|
|
164
|
-
t13 = $[
|
|
303
|
+
t13 = $[17];
|
|
165
304
|
}
|
|
166
305
|
let t14;
|
|
167
|
-
if ($[
|
|
306
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
168
307
|
t14 = () => setIconDialogOpen(true);
|
|
169
|
-
$[
|
|
308
|
+
$[18] = t14;
|
|
170
309
|
} else {
|
|
171
|
-
t14 = $[
|
|
310
|
+
t14 = $[18];
|
|
172
311
|
}
|
|
173
312
|
let t15;
|
|
174
|
-
if ($[
|
|
313
|
+
if ($[19] !== collectionIcon) {
|
|
175
314
|
t15 = /* @__PURE__ */ jsx(Tooltip, { title: "Change icon", asChild: true, children: /* @__PURE__ */ jsx(IconButton, { shape: "square", onClick: t14, children: collectionIcon }) });
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
315
|
+
$[19] = collectionIcon;
|
|
316
|
+
$[20] = t15;
|
|
178
317
|
} else {
|
|
179
|
-
t15 = $[
|
|
318
|
+
t15 = $[20];
|
|
180
319
|
}
|
|
181
320
|
let t16;
|
|
182
|
-
if ($[
|
|
321
|
+
if ($[21] !== t12 || $[22] !== t13 || $[23] !== t15) {
|
|
183
322
|
t16 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-2 py-2 pt-3 items-center", children: [
|
|
184
323
|
t12,
|
|
185
324
|
t13,
|
|
186
325
|
t15
|
|
187
326
|
] });
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
327
|
+
$[21] = t12;
|
|
328
|
+
$[22] = t13;
|
|
329
|
+
$[23] = t15;
|
|
330
|
+
$[24] = t16;
|
|
192
331
|
} else {
|
|
193
|
-
t16 = $[
|
|
332
|
+
t16 = $[24];
|
|
194
333
|
}
|
|
195
334
|
let t17;
|
|
196
|
-
if ($[
|
|
335
|
+
if ($[25] !== parentCollection) {
|
|
197
336
|
t17 = parentCollection && /* @__PURE__ */ jsx(Chip, { colorScheme: "tealDarker", children: /* @__PURE__ */ jsxs(Typography, { variant: "caption", children: [
|
|
198
337
|
"This is a subcollection of ",
|
|
199
338
|
/* @__PURE__ */ jsx("b", { children: parentCollection.name })
|
|
200
339
|
] }) });
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
340
|
+
$[25] = parentCollection;
|
|
341
|
+
$[26] = t17;
|
|
203
342
|
} else {
|
|
204
|
-
t17 = $[
|
|
343
|
+
t17 = $[26];
|
|
205
344
|
}
|
|
206
345
|
let t18;
|
|
207
|
-
if ($[
|
|
346
|
+
if ($[27] !== t16 || $[28] !== t17) {
|
|
208
347
|
t18 = /* @__PURE__ */ jsxs("div", { children: [
|
|
209
348
|
t16,
|
|
210
349
|
t17
|
|
211
350
|
] });
|
|
212
|
-
$[
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
351
|
+
$[27] = t16;
|
|
352
|
+
$[28] = t17;
|
|
353
|
+
$[29] = t18;
|
|
215
354
|
} else {
|
|
216
|
-
t18 = $[
|
|
355
|
+
t18 = $[29];
|
|
217
356
|
}
|
|
218
357
|
const t19 = "grid grid-cols-12 gap-4";
|
|
219
358
|
const t20 = values.name ?? "";
|
|
220
359
|
let t21;
|
|
221
|
-
if ($[
|
|
360
|
+
if ($[30] !== updateName) {
|
|
222
361
|
t21 = (e) => updateName(e.target.value);
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
362
|
+
$[30] = updateName;
|
|
363
|
+
$[31] = t21;
|
|
225
364
|
} else {
|
|
226
|
-
t21 = $[
|
|
365
|
+
t21 = $[31];
|
|
227
366
|
}
|
|
228
367
|
const t22 = showErrors && Boolean(errors.name);
|
|
229
368
|
let t23;
|
|
230
|
-
if ($[
|
|
369
|
+
if ($[32] !== t20 || $[33] !== t21 || $[34] !== t22) {
|
|
231
370
|
t23 = /* @__PURE__ */ jsx(TextField, { value: t20, onChange: t21, label: "Name", autoFocus: true, required: true, error: t22 });
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
371
|
+
$[32] = t20;
|
|
372
|
+
$[33] = t21;
|
|
373
|
+
$[34] = t22;
|
|
374
|
+
$[35] = t23;
|
|
236
375
|
} else {
|
|
237
|
-
t23 = $[
|
|
376
|
+
t23 = $[35];
|
|
238
377
|
}
|
|
239
378
|
const t24 = touched.name && Boolean(errors.name);
|
|
240
379
|
const t25 = touched.name && Boolean(errors.name) ? errors.name : "Name of this collection, usually a plural name (e.g. Products)";
|
|
241
380
|
let t26;
|
|
242
|
-
if ($[
|
|
381
|
+
if ($[36] !== t24 || $[37] !== t25) {
|
|
243
382
|
t26 = /* @__PURE__ */ jsx(FieldCaption, { error: t24, children: t25 });
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
246
|
-
$[
|
|
383
|
+
$[36] = t24;
|
|
384
|
+
$[37] = t25;
|
|
385
|
+
$[38] = t26;
|
|
247
386
|
} else {
|
|
248
|
-
t26 = $[
|
|
387
|
+
t26 = $[38];
|
|
249
388
|
}
|
|
250
389
|
let t27;
|
|
251
|
-
if ($[
|
|
390
|
+
if ($[39] !== t23 || $[40] !== t26) {
|
|
252
391
|
t27 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
253
392
|
t23,
|
|
254
393
|
t26
|
|
255
394
|
] });
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
395
|
+
$[39] = t23;
|
|
396
|
+
$[40] = t26;
|
|
397
|
+
$[41] = t27;
|
|
259
398
|
} else {
|
|
260
|
-
t27 = $[
|
|
399
|
+
t27 = $[41];
|
|
261
400
|
}
|
|
262
401
|
const t28 = isSubcollection ? "" : "sm:col-span-8";
|
|
263
402
|
let t29;
|
|
264
|
-
if ($[
|
|
403
|
+
if ($[42] !== t28) {
|
|
265
404
|
t29 = cls("col-span-12 ", t28);
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
405
|
+
$[42] = t28;
|
|
406
|
+
$[43] = t29;
|
|
268
407
|
} else {
|
|
269
|
-
t29 = $[
|
|
408
|
+
t29 = $[43];
|
|
270
409
|
}
|
|
271
410
|
const t30 = !isNewCollection;
|
|
272
411
|
const t31 = showErrors && Boolean(errors.path);
|
|
273
412
|
let t32;
|
|
274
|
-
if ($[
|
|
413
|
+
if ($[44] !== t30 || $[45] !== t31) {
|
|
275
414
|
t32 = /* @__PURE__ */ jsx(Field, { name: "path", as: DebouncedTextField, label: "Path", disabled: t30, required: true, error: t31 });
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
415
|
+
$[44] = t30;
|
|
416
|
+
$[45] = t31;
|
|
417
|
+
$[46] = t32;
|
|
279
418
|
} else {
|
|
280
|
-
t32 = $[
|
|
419
|
+
t32 = $[46];
|
|
281
420
|
}
|
|
282
421
|
const t33 = touched.path && Boolean(errors.path);
|
|
283
422
|
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";
|
|
284
423
|
let t35;
|
|
285
|
-
if ($[
|
|
424
|
+
if ($[47] !== t33 || $[48] !== t34) {
|
|
286
425
|
t35 = /* @__PURE__ */ jsx(FieldCaption, { error: t33, children: t34 });
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
426
|
+
$[47] = t33;
|
|
427
|
+
$[48] = t34;
|
|
428
|
+
$[49] = t35;
|
|
290
429
|
} else {
|
|
291
|
-
t35 = $[
|
|
430
|
+
t35 = $[49];
|
|
292
431
|
}
|
|
293
432
|
let t36;
|
|
294
|
-
if ($[
|
|
433
|
+
if ($[50] !== t29 || $[51] !== t32 || $[52] !== t35) {
|
|
295
434
|
t36 = /* @__PURE__ */ jsxs("div", { className: t29, children: [
|
|
296
435
|
t32,
|
|
297
436
|
t35
|
|
298
437
|
] });
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
$[
|
|
438
|
+
$[50] = t29;
|
|
439
|
+
$[51] = t32;
|
|
440
|
+
$[52] = t35;
|
|
441
|
+
$[53] = t36;
|
|
303
442
|
} else {
|
|
304
|
-
t36 = $[
|
|
443
|
+
t36 = $[53];
|
|
305
444
|
}
|
|
306
445
|
const t37 = !isSubcollection && /* @__PURE__ */ jsxs("div", { className: "col-span-12 sm:col-span-4 relative", children: [
|
|
307
446
|
/* @__PURE__ */ jsx(TextField, { error: showErrors && Boolean(errors.group), disabled: isSubmitting, value: values.group ?? "", autoComplete: "off", onChange: (event) => setFieldValue("group", event.target.value), name: "group", inputRef: groupRef, label: "Group" }),
|
|
@@ -311,235 +450,253 @@ function CollectionDetailsForm(t0) {
|
|
|
311
450
|
}, children: /* @__PURE__ */ jsx("div", { className: "flex-grow", children: group_0 }) }, index + "_" + group_0)) }),
|
|
312
451
|
/* @__PURE__ */ jsx(FieldCaption, { children: showErrors && Boolean(errors.group) ? errors.group : "Group in the home page" })
|
|
313
452
|
] });
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
453
|
+
const t38 = values.openEntityMode ?? "side_panel";
|
|
454
|
+
let t39;
|
|
455
|
+
if ($[54] !== setFieldValue) {
|
|
456
|
+
t39 = (value) => setFieldValue("openEntityMode", value);
|
|
457
|
+
$[54] = setFieldValue;
|
|
458
|
+
$[55] = t39;
|
|
459
|
+
} else {
|
|
460
|
+
t39 = $[55];
|
|
461
|
+
}
|
|
462
|
+
let t40;
|
|
463
|
+
if ($[56] !== t38 || $[57] !== t39) {
|
|
464
|
+
t40 = /* @__PURE__ */ jsx(LayoutModeSwitch, { className: "col-span-12", value: t38, onChange: t39 });
|
|
465
|
+
$[56] = t38;
|
|
466
|
+
$[57] = t39;
|
|
467
|
+
$[58] = t40;
|
|
468
|
+
} else {
|
|
469
|
+
t40 = $[58];
|
|
470
|
+
}
|
|
471
|
+
let t41;
|
|
472
|
+
if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
|
|
473
|
+
t41 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row text-surface-500", children: [
|
|
317
474
|
/* @__PURE__ */ jsx(SettingsIcon, {}),
|
|
318
475
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "ml-2", children: "Advanced" })
|
|
319
476
|
] });
|
|
320
|
-
$[
|
|
477
|
+
$[59] = t41;
|
|
321
478
|
} else {
|
|
322
|
-
|
|
479
|
+
t41 = $[59];
|
|
323
480
|
}
|
|
324
|
-
const
|
|
325
|
-
const
|
|
326
|
-
let
|
|
327
|
-
if ($[
|
|
328
|
-
|
|
329
|
-
$[
|
|
330
|
-
$[
|
|
331
|
-
$[
|
|
481
|
+
const t42 = !isNewCollection;
|
|
482
|
+
const t43 = showErrors && Boolean(errors.id);
|
|
483
|
+
let t44;
|
|
484
|
+
if ($[60] !== t42 || $[61] !== t43) {
|
|
485
|
+
t44 = /* @__PURE__ */ jsx(Field, { name: "id", as: DebouncedTextField, disabled: t42, label: "Collection id", error: t43 });
|
|
486
|
+
$[60] = t42;
|
|
487
|
+
$[61] = t43;
|
|
488
|
+
$[62] = t44;
|
|
332
489
|
} else {
|
|
333
|
-
|
|
490
|
+
t44 = $[62];
|
|
334
491
|
}
|
|
335
|
-
const
|
|
336
|
-
const
|
|
337
|
-
let
|
|
338
|
-
if ($[
|
|
339
|
-
|
|
340
|
-
$[
|
|
341
|
-
$[
|
|
342
|
-
$[
|
|
343
|
-
} else {
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
let
|
|
347
|
-
if ($[
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
492
|
+
const t45 = touched.id && Boolean(errors.id);
|
|
493
|
+
const t46 = touched.id && Boolean(errors.id) ? errors.id : "This id identifies this collection. Typically the same as the path.";
|
|
494
|
+
let t47;
|
|
495
|
+
if ($[63] !== t45 || $[64] !== t46) {
|
|
496
|
+
t47 = /* @__PURE__ */ jsx(FieldCaption, { error: t45, children: t46 });
|
|
497
|
+
$[63] = t45;
|
|
498
|
+
$[64] = t46;
|
|
499
|
+
$[65] = t47;
|
|
500
|
+
} else {
|
|
501
|
+
t47 = $[65];
|
|
502
|
+
}
|
|
503
|
+
let t48;
|
|
504
|
+
if ($[66] !== t44 || $[67] !== t47) {
|
|
505
|
+
t48 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
506
|
+
t44,
|
|
507
|
+
t47
|
|
351
508
|
] });
|
|
352
|
-
$[
|
|
353
|
-
$[
|
|
354
|
-
$[
|
|
509
|
+
$[66] = t44;
|
|
510
|
+
$[67] = t47;
|
|
511
|
+
$[68] = t48;
|
|
355
512
|
} else {
|
|
356
|
-
|
|
513
|
+
t48 = $[68];
|
|
357
514
|
}
|
|
358
|
-
const
|
|
359
|
-
let
|
|
360
|
-
if ($[
|
|
361
|
-
|
|
515
|
+
const t49 = showErrors && Boolean(errors.singularName);
|
|
516
|
+
let t50;
|
|
517
|
+
if ($[69] !== handleChange || $[70] !== setFieldTouched) {
|
|
518
|
+
t50 = (e_0) => {
|
|
362
519
|
setFieldTouched("singularName", true);
|
|
363
520
|
return handleChange(e_0);
|
|
364
521
|
};
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
$[
|
|
522
|
+
$[69] = handleChange;
|
|
523
|
+
$[70] = setFieldTouched;
|
|
524
|
+
$[71] = t50;
|
|
368
525
|
} else {
|
|
369
|
-
|
|
526
|
+
t50 = $[71];
|
|
370
527
|
}
|
|
371
|
-
const
|
|
372
|
-
let
|
|
373
|
-
if ($[
|
|
374
|
-
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
528
|
+
const t51 = values.singularName ?? "";
|
|
529
|
+
let t52;
|
|
530
|
+
if ($[72] !== t49 || $[73] !== t50 || $[74] !== t51) {
|
|
531
|
+
t52 = /* @__PURE__ */ jsx(TextField, { error: t49, name: "singularName", "aria-describedby": "singularName-helper", onChange: t50, value: t51, label: "Singular name" });
|
|
532
|
+
$[72] = t49;
|
|
533
|
+
$[73] = t50;
|
|
534
|
+
$[74] = t51;
|
|
535
|
+
$[75] = t52;
|
|
379
536
|
} else {
|
|
380
|
-
|
|
537
|
+
t52 = $[75];
|
|
381
538
|
}
|
|
382
|
-
const
|
|
383
|
-
const
|
|
384
|
-
let
|
|
385
|
-
if ($[
|
|
386
|
-
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
389
|
-
$[
|
|
390
|
-
} else {
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
let
|
|
394
|
-
if ($[
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
539
|
+
const t53 = showErrors && Boolean(errors.singularName);
|
|
540
|
+
const t54 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define a singular name for your entities";
|
|
541
|
+
let t55;
|
|
542
|
+
if ($[76] !== t53 || $[77] !== t54) {
|
|
543
|
+
t55 = /* @__PURE__ */ jsx(FieldCaption, { error: t53, children: t54 });
|
|
544
|
+
$[76] = t53;
|
|
545
|
+
$[77] = t54;
|
|
546
|
+
$[78] = t55;
|
|
547
|
+
} else {
|
|
548
|
+
t55 = $[78];
|
|
549
|
+
}
|
|
550
|
+
let t56;
|
|
551
|
+
if ($[79] !== t52 || $[80] !== t55) {
|
|
552
|
+
t56 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
553
|
+
t52,
|
|
554
|
+
t55
|
|
398
555
|
] });
|
|
399
|
-
$[
|
|
400
|
-
$[
|
|
401
|
-
$[
|
|
556
|
+
$[79] = t52;
|
|
557
|
+
$[80] = t55;
|
|
558
|
+
$[81] = t56;
|
|
402
559
|
} else {
|
|
403
|
-
|
|
560
|
+
t56 = $[81];
|
|
404
561
|
}
|
|
405
|
-
const
|
|
406
|
-
let
|
|
407
|
-
if ($[
|
|
408
|
-
|
|
562
|
+
const t57 = showErrors && Boolean(errors.sideDialogWidth);
|
|
563
|
+
let t58;
|
|
564
|
+
if ($[82] !== setFieldTouched || $[83] !== setFieldValue) {
|
|
565
|
+
t58 = (e_1) => {
|
|
409
566
|
setFieldTouched("sideDialogWidth", true);
|
|
410
|
-
const
|
|
411
|
-
if (!
|
|
567
|
+
const value_0 = e_1.target.value;
|
|
568
|
+
if (!value_0) {
|
|
412
569
|
setFieldValue("sideDialogWidth", null);
|
|
413
570
|
} else {
|
|
414
|
-
if (!isNaN(Number(
|
|
415
|
-
setFieldValue("sideDialogWidth", Number(
|
|
571
|
+
if (!isNaN(Number(value_0))) {
|
|
572
|
+
setFieldValue("sideDialogWidth", Number(value_0));
|
|
416
573
|
}
|
|
417
574
|
}
|
|
418
575
|
};
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
576
|
+
$[82] = setFieldTouched;
|
|
577
|
+
$[83] = setFieldValue;
|
|
578
|
+
$[84] = t58;
|
|
422
579
|
} else {
|
|
423
|
-
|
|
580
|
+
t58 = $[84];
|
|
424
581
|
}
|
|
425
|
-
let
|
|
426
|
-
if ($[
|
|
427
|
-
|
|
582
|
+
let t59;
|
|
583
|
+
if ($[85] !== setFieldValue) {
|
|
584
|
+
t59 = () => {
|
|
428
585
|
setFieldValue("sideDialogWidth", null);
|
|
429
586
|
};
|
|
430
|
-
$[
|
|
431
|
-
$[
|
|
587
|
+
$[85] = setFieldValue;
|
|
588
|
+
$[86] = t59;
|
|
432
589
|
} else {
|
|
433
|
-
|
|
590
|
+
t59 = $[86];
|
|
434
591
|
}
|
|
435
|
-
const
|
|
436
|
-
let
|
|
437
|
-
if ($[
|
|
438
|
-
|
|
439
|
-
$[
|
|
592
|
+
const t60 = !values.sideDialogWidth;
|
|
593
|
+
let t61;
|
|
594
|
+
if ($[87] === Symbol.for("react.memo_cache_sentinel")) {
|
|
595
|
+
t61 = /* @__PURE__ */ jsx(CloseIcon, { size: "small" });
|
|
596
|
+
$[87] = t61;
|
|
440
597
|
} else {
|
|
441
|
-
|
|
598
|
+
t61 = $[87];
|
|
442
599
|
}
|
|
443
|
-
let
|
|
444
|
-
if ($[
|
|
445
|
-
|
|
446
|
-
$[
|
|
447
|
-
$[
|
|
448
|
-
$[
|
|
600
|
+
let t62;
|
|
601
|
+
if ($[88] !== t59 || $[89] !== t60) {
|
|
602
|
+
t62 = /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: t59, disabled: t60, children: t61 });
|
|
603
|
+
$[88] = t59;
|
|
604
|
+
$[89] = t60;
|
|
605
|
+
$[90] = t62;
|
|
449
606
|
} else {
|
|
450
|
-
|
|
607
|
+
t62 = $[90];
|
|
451
608
|
}
|
|
452
|
-
const
|
|
453
|
-
let t61;
|
|
454
|
-
if ($[87] !== t54 || $[88] !== t55 || $[89] !== t59 || $[90] !== t60) {
|
|
455
|
-
t61 = /* @__PURE__ */ jsx(TextField, { error: t54, name: "sideDialogWidth", type: "number", "aria-describedby": "sideDialogWidth-helper", onChange: t55, endAdornment: t59, value: t60, label: "Side dialog width" });
|
|
456
|
-
$[87] = t54;
|
|
457
|
-
$[88] = t55;
|
|
458
|
-
$[89] = t59;
|
|
459
|
-
$[90] = t60;
|
|
460
|
-
$[91] = t61;
|
|
461
|
-
} else {
|
|
462
|
-
t61 = $[91];
|
|
463
|
-
}
|
|
464
|
-
const t62 = showErrors && Boolean(errors.singularName);
|
|
465
|
-
const t63 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px";
|
|
609
|
+
const t63 = values.sideDialogWidth ?? "";
|
|
466
610
|
let t64;
|
|
467
|
-
if ($[92] !==
|
|
468
|
-
t64 = /* @__PURE__ */ jsx(
|
|
469
|
-
$[
|
|
470
|
-
$[
|
|
471
|
-
$[
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
$[96] =
|
|
483
|
-
$[97] =
|
|
484
|
-
|
|
485
|
-
|
|
611
|
+
if ($[91] !== t57 || $[92] !== t58 || $[93] !== t62 || $[94] !== t63) {
|
|
612
|
+
t64 = /* @__PURE__ */ jsx(TextField, { error: t57, name: "sideDialogWidth", type: "number", "aria-describedby": "sideDialogWidth-helper", onChange: t58, endAdornment: t62, value: t63, label: "Side dialog width" });
|
|
613
|
+
$[91] = t57;
|
|
614
|
+
$[92] = t58;
|
|
615
|
+
$[93] = t62;
|
|
616
|
+
$[94] = t63;
|
|
617
|
+
$[95] = t64;
|
|
618
|
+
} else {
|
|
619
|
+
t64 = $[95];
|
|
620
|
+
}
|
|
621
|
+
const t65 = showErrors && Boolean(errors.singularName);
|
|
622
|
+
const t66 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px";
|
|
623
|
+
let t67;
|
|
624
|
+
if ($[96] !== t65 || $[97] !== t66) {
|
|
625
|
+
t67 = /* @__PURE__ */ jsx(FieldCaption, { error: t65, children: t66 });
|
|
626
|
+
$[96] = t65;
|
|
627
|
+
$[97] = t66;
|
|
628
|
+
$[98] = t67;
|
|
629
|
+
} else {
|
|
630
|
+
t67 = $[98];
|
|
486
631
|
}
|
|
487
|
-
const t66 = showErrors && Boolean(errors.description);
|
|
488
|
-
const t67 = values.description ?? "";
|
|
489
632
|
let t68;
|
|
490
|
-
if ($[
|
|
491
|
-
t68 = /* @__PURE__ */
|
|
492
|
-
|
|
493
|
-
|
|
633
|
+
if ($[99] !== t64 || $[100] !== t67) {
|
|
634
|
+
t68 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
635
|
+
t64,
|
|
636
|
+
t67
|
|
637
|
+
] });
|
|
638
|
+
$[99] = t64;
|
|
494
639
|
$[100] = t67;
|
|
495
640
|
$[101] = t68;
|
|
496
641
|
} else {
|
|
497
642
|
t68 = $[101];
|
|
498
643
|
}
|
|
499
644
|
const t69 = showErrors && Boolean(errors.description);
|
|
500
|
-
const t70 =
|
|
645
|
+
const t70 = values.description ?? "";
|
|
501
646
|
let t71;
|
|
502
|
-
if ($[102] !==
|
|
503
|
-
t71 = /* @__PURE__ */ jsx(
|
|
504
|
-
$[102] =
|
|
505
|
-
$[103] =
|
|
506
|
-
$[104] =
|
|
507
|
-
|
|
508
|
-
t71 = $[104];
|
|
509
|
-
}
|
|
510
|
-
let t72;
|
|
511
|
-
if ($[105] !== t68 || $[106] !== t71) {
|
|
512
|
-
t72 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
513
|
-
t68,
|
|
514
|
-
t71
|
|
515
|
-
] });
|
|
516
|
-
$[105] = t68;
|
|
517
|
-
$[106] = t71;
|
|
518
|
-
$[107] = t72;
|
|
647
|
+
if ($[102] !== handleChange || $[103] !== t69 || $[104] !== t70) {
|
|
648
|
+
t71 = /* @__PURE__ */ jsx(TextField, { error: t69, name: "description", value: t70, onChange: handleChange, multiline: true, rows: 2, "aria-describedby": "description-helper-text", label: "Description" });
|
|
649
|
+
$[102] = handleChange;
|
|
650
|
+
$[103] = t69;
|
|
651
|
+
$[104] = t70;
|
|
652
|
+
$[105] = t71;
|
|
519
653
|
} else {
|
|
520
|
-
|
|
654
|
+
t71 = $[105];
|
|
521
655
|
}
|
|
522
|
-
const
|
|
656
|
+
const t72 = showErrors && Boolean(errors.description);
|
|
657
|
+
const t73 = showErrors && Boolean(errors.description) ? errors.description : "Description of the collection, you can use markdown";
|
|
523
658
|
let t74;
|
|
524
|
-
if ($[
|
|
525
|
-
t74 =
|
|
659
|
+
if ($[106] !== t72 || $[107] !== t73) {
|
|
660
|
+
t74 = /* @__PURE__ */ jsx(FieldCaption, { error: t72, children: t73 });
|
|
661
|
+
$[106] = t72;
|
|
662
|
+
$[107] = t73;
|
|
526
663
|
$[108] = t74;
|
|
527
664
|
} else {
|
|
528
665
|
t74 = $[108];
|
|
529
666
|
}
|
|
530
667
|
let t75;
|
|
531
|
-
if ($[109] !==
|
|
532
|
-
t75 = /* @__PURE__ */
|
|
533
|
-
|
|
534
|
-
|
|
668
|
+
if ($[109] !== t71 || $[110] !== t74) {
|
|
669
|
+
t75 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
670
|
+
t71,
|
|
671
|
+
t74
|
|
672
|
+
] });
|
|
673
|
+
$[109] = t71;
|
|
674
|
+
$[110] = t74;
|
|
535
675
|
$[111] = t75;
|
|
536
676
|
} else {
|
|
537
677
|
t75 = $[111];
|
|
538
678
|
}
|
|
539
|
-
const t76 =
|
|
679
|
+
const t76 = values.defaultSize ?? "";
|
|
540
680
|
let t77;
|
|
541
|
-
if ($[112]
|
|
542
|
-
t77 = (
|
|
681
|
+
if ($[112] === Symbol.for("react.memo_cache_sentinel")) {
|
|
682
|
+
t77 = ["xs", "s", "m", "l", "xl"].map(_temp2$7);
|
|
683
|
+
$[112] = t77;
|
|
684
|
+
} else {
|
|
685
|
+
t77 = $[112];
|
|
686
|
+
}
|
|
687
|
+
let t78;
|
|
688
|
+
if ($[113] !== handleChange || $[114] !== t76) {
|
|
689
|
+
t78 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(Select, { name: "defaultSize", size: "large", fullWidth: true, label: "Default row size", position: "item-aligned", onChange: handleChange, value: t76, renderValue: _temp$b, children: t77 }) });
|
|
690
|
+
$[113] = handleChange;
|
|
691
|
+
$[114] = t76;
|
|
692
|
+
$[115] = t78;
|
|
693
|
+
} else {
|
|
694
|
+
t78 = $[115];
|
|
695
|
+
}
|
|
696
|
+
const t79 = customIdValue === "code_defined";
|
|
697
|
+
let t80;
|
|
698
|
+
if ($[116] !== setFieldValue) {
|
|
699
|
+
t80 = (v) => {
|
|
543
700
|
if (v === "code_defined") {
|
|
544
701
|
throw new Error("This should not happen");
|
|
545
702
|
} else {
|
|
@@ -556,226 +713,240 @@ function CollectionDetailsForm(t0) {
|
|
|
556
713
|
}
|
|
557
714
|
}
|
|
558
715
|
};
|
|
559
|
-
$[
|
|
560
|
-
$[
|
|
716
|
+
$[116] = setFieldValue;
|
|
717
|
+
$[117] = t80;
|
|
561
718
|
} else {
|
|
562
|
-
|
|
563
|
-
}
|
|
564
|
-
const t78 = customIdValue ?? "";
|
|
565
|
-
let t79;
|
|
566
|
-
let t80;
|
|
567
|
-
let t81;
|
|
568
|
-
if ($[114] === Symbol.for("react.memo_cache_sentinel")) {
|
|
569
|
-
t79 = /* @__PURE__ */ jsx(SelectItem, { value: "false", children: "Document ID is generated automatically" });
|
|
570
|
-
t80 = /* @__PURE__ */ jsx(SelectItem, { value: "true", children: "Users must define an ID" });
|
|
571
|
-
t81 = /* @__PURE__ */ jsx(SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
|
|
572
|
-
$[114] = t79;
|
|
573
|
-
$[115] = t80;
|
|
574
|
-
$[116] = t81;
|
|
575
|
-
} else {
|
|
576
|
-
t79 = $[114];
|
|
577
|
-
t80 = $[115];
|
|
578
|
-
t81 = $[116];
|
|
719
|
+
t80 = $[117];
|
|
579
720
|
}
|
|
721
|
+
const t81 = customIdValue ?? "";
|
|
580
722
|
let t82;
|
|
581
|
-
if ($[117] !== t76 || $[118] !== t77 || $[119] !== t78) {
|
|
582
|
-
t82 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxs(Select, { name: "customId", label: "Document IDs generation", position: "item-aligned", size: "large", fullWidth: true, disabled: t76, onValueChange: t77, value: t78, renderValue: _temp3$4, children: [
|
|
583
|
-
t79,
|
|
584
|
-
t80,
|
|
585
|
-
t81
|
|
586
|
-
] }) });
|
|
587
|
-
$[117] = t76;
|
|
588
|
-
$[118] = t77;
|
|
589
|
-
$[119] = t78;
|
|
590
|
-
$[120] = t82;
|
|
591
|
-
} else {
|
|
592
|
-
t82 = $[120];
|
|
593
|
-
}
|
|
594
723
|
let t83;
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
724
|
+
let t84;
|
|
725
|
+
if ($[118] === Symbol.for("react.memo_cache_sentinel")) {
|
|
726
|
+
t82 = /* @__PURE__ */ jsx(SelectItem, { value: "false", children: "Document ID is generated automatically" });
|
|
727
|
+
t83 = /* @__PURE__ */ jsx(SelectItem, { value: "true", children: "Users must define an ID" });
|
|
728
|
+
t84 = /* @__PURE__ */ jsx(SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
|
|
729
|
+
$[118] = t82;
|
|
730
|
+
$[119] = t83;
|
|
731
|
+
$[120] = t84;
|
|
732
|
+
} else {
|
|
733
|
+
t82 = $[118];
|
|
734
|
+
t83 = $[119];
|
|
735
|
+
t84 = $[120];
|
|
601
736
|
}
|
|
602
|
-
const t84 = values.collectionGroup ?? false;
|
|
603
737
|
let t85;
|
|
604
|
-
if ($[
|
|
605
|
-
t85 = /* @__PURE__ */ jsx(
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
738
|
+
if ($[121] !== t79 || $[122] !== t80 || $[123] !== t81) {
|
|
739
|
+
t85 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxs(Select, { name: "customId", label: "Document IDs generation", position: "item-aligned", size: "large", fullWidth: true, disabled: t79, onValueChange: t80, value: t81, renderValue: _temp3$4, children: [
|
|
740
|
+
t82,
|
|
741
|
+
t83,
|
|
742
|
+
t84
|
|
743
|
+
] }) });
|
|
744
|
+
$[121] = t79;
|
|
745
|
+
$[122] = t80;
|
|
746
|
+
$[123] = t81;
|
|
747
|
+
$[124] = t85;
|
|
609
748
|
} else {
|
|
610
|
-
t85 = $[
|
|
749
|
+
t85 = $[124];
|
|
611
750
|
}
|
|
612
751
|
let t86;
|
|
613
|
-
if ($[
|
|
614
|
-
t86 =
|
|
752
|
+
if ($[125] !== setFieldValue) {
|
|
753
|
+
t86 = (v_0) => setFieldValue("collectionGroup", v_0);
|
|
754
|
+
$[125] = setFieldValue;
|
|
615
755
|
$[126] = t86;
|
|
616
756
|
} else {
|
|
617
757
|
t86 = $[126];
|
|
618
758
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
] });
|
|
625
|
-
$[127] = t85;
|
|
759
|
+
const t87 = values.collectionGroup ?? false;
|
|
760
|
+
let t88;
|
|
761
|
+
if ($[127] !== t86 || $[128] !== t87) {
|
|
762
|
+
t88 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", label: "Collection group", onValueChange: t86, value: t87 });
|
|
763
|
+
$[127] = t86;
|
|
626
764
|
$[128] = t87;
|
|
765
|
+
$[129] = t88;
|
|
627
766
|
} else {
|
|
628
|
-
|
|
767
|
+
t88 = $[129];
|
|
629
768
|
}
|
|
630
|
-
let
|
|
631
|
-
if ($[
|
|
632
|
-
|
|
633
|
-
$[
|
|
634
|
-
$[130] = t88;
|
|
769
|
+
let t89;
|
|
770
|
+
if ($[130] === Symbol.for("react.memo_cache_sentinel")) {
|
|
771
|
+
t89 = /* @__PURE__ */ jsx(FieldCaption, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." });
|
|
772
|
+
$[130] = t89;
|
|
635
773
|
} else {
|
|
636
|
-
|
|
774
|
+
t89 = $[130];
|
|
637
775
|
}
|
|
638
|
-
const t89 = values.textSearchEnabled ?? false;
|
|
639
776
|
let t90;
|
|
640
|
-
if ($[131] !== t88
|
|
641
|
-
t90 = /* @__PURE__ */
|
|
777
|
+
if ($[131] !== t88) {
|
|
778
|
+
t90 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
779
|
+
t88,
|
|
780
|
+
t89
|
|
781
|
+
] });
|
|
642
782
|
$[131] = t88;
|
|
643
|
-
$[132] =
|
|
644
|
-
$[133] = t90;
|
|
783
|
+
$[132] = t90;
|
|
645
784
|
} else {
|
|
646
|
-
t90 = $[
|
|
785
|
+
t90 = $[132];
|
|
647
786
|
}
|
|
648
787
|
let t91;
|
|
649
|
-
if ($[
|
|
650
|
-
t91 =
|
|
788
|
+
if ($[133] !== setFieldValue) {
|
|
789
|
+
t91 = (v_1) => setFieldValue("textSearchEnabled", v_1);
|
|
790
|
+
$[133] = setFieldValue;
|
|
651
791
|
$[134] = t91;
|
|
652
792
|
} else {
|
|
653
793
|
t91 = $[134];
|
|
654
794
|
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
] });
|
|
661
|
-
$[135] = t90;
|
|
795
|
+
const t92 = values.textSearchEnabled ?? false;
|
|
796
|
+
let t93;
|
|
797
|
+
if ($[135] !== t91 || $[136] !== t92) {
|
|
798
|
+
t93 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", label: "Enable text search for this collection", onValueChange: t91, value: t92 });
|
|
799
|
+
$[135] = t91;
|
|
662
800
|
$[136] = t92;
|
|
801
|
+
$[137] = t93;
|
|
663
802
|
} else {
|
|
664
|
-
|
|
803
|
+
t93 = $[137];
|
|
665
804
|
}
|
|
666
|
-
let
|
|
667
|
-
if ($[
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
805
|
+
let t94;
|
|
806
|
+
if ($[138] === Symbol.for("react.memo_cache_sentinel")) {
|
|
807
|
+
t94 = /* @__PURE__ */ jsx(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." });
|
|
808
|
+
$[138] = t94;
|
|
809
|
+
} else {
|
|
810
|
+
t94 = $[138];
|
|
811
|
+
}
|
|
812
|
+
let t95;
|
|
813
|
+
if ($[139] !== t93) {
|
|
814
|
+
t95 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
815
|
+
t93,
|
|
816
|
+
t94
|
|
817
|
+
] });
|
|
818
|
+
$[139] = t93;
|
|
819
|
+
$[140] = t95;
|
|
820
|
+
} else {
|
|
821
|
+
t95 = $[140];
|
|
822
|
+
}
|
|
823
|
+
let t96;
|
|
824
|
+
if ($[141] !== t48 || $[142] !== t56 || $[143] !== t68 || $[144] !== t75 || $[145] !== t78 || $[146] !== t85 || $[147] !== t90 || $[148] !== t95) {
|
|
825
|
+
t96 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
|
|
826
|
+
t48,
|
|
827
|
+
t56,
|
|
828
|
+
t68,
|
|
673
829
|
t75,
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
830
|
+
t78,
|
|
831
|
+
t85,
|
|
832
|
+
t90,
|
|
833
|
+
t95
|
|
677
834
|
] });
|
|
678
|
-
$[
|
|
679
|
-
$[
|
|
680
|
-
$[
|
|
681
|
-
$[
|
|
682
|
-
$[
|
|
683
|
-
$[
|
|
684
|
-
$[
|
|
685
|
-
$[
|
|
686
|
-
$[
|
|
687
|
-
} else {
|
|
688
|
-
|
|
835
|
+
$[141] = t48;
|
|
836
|
+
$[142] = t56;
|
|
837
|
+
$[143] = t68;
|
|
838
|
+
$[144] = t75;
|
|
839
|
+
$[145] = t78;
|
|
840
|
+
$[146] = t85;
|
|
841
|
+
$[147] = t90;
|
|
842
|
+
$[148] = t95;
|
|
843
|
+
$[149] = t96;
|
|
844
|
+
} else {
|
|
845
|
+
t96 = $[149];
|
|
689
846
|
}
|
|
690
|
-
let
|
|
691
|
-
if ($[
|
|
692
|
-
|
|
693
|
-
$[
|
|
694
|
-
$[
|
|
695
|
-
$[
|
|
847
|
+
let t97;
|
|
848
|
+
if ($[150] !== advancedPanelExpanded || $[151] !== t96) {
|
|
849
|
+
t97 = /* @__PURE__ */ jsx(ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t41, initiallyExpanded: false, children: t96 });
|
|
850
|
+
$[150] = advancedPanelExpanded;
|
|
851
|
+
$[151] = t96;
|
|
852
|
+
$[152] = t97;
|
|
696
853
|
} else {
|
|
697
|
-
|
|
854
|
+
t97 = $[152];
|
|
698
855
|
}
|
|
699
|
-
let
|
|
700
|
-
if ($[
|
|
701
|
-
|
|
856
|
+
let t98;
|
|
857
|
+
if ($[153] !== children || $[154] !== t97) {
|
|
858
|
+
t98 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-8", children: [
|
|
859
|
+
t97,
|
|
860
|
+
children
|
|
861
|
+
] });
|
|
862
|
+
$[153] = children;
|
|
863
|
+
$[154] = t97;
|
|
864
|
+
$[155] = t98;
|
|
865
|
+
} else {
|
|
866
|
+
t98 = $[155];
|
|
867
|
+
}
|
|
868
|
+
let t99;
|
|
869
|
+
if ($[156] !== t27 || $[157] !== t36 || $[158] !== t37 || $[159] !== t40 || $[160] !== t98) {
|
|
870
|
+
t99 = /* @__PURE__ */ jsxs("div", { className: t19, children: [
|
|
702
871
|
t27,
|
|
703
872
|
t36,
|
|
704
873
|
t37,
|
|
705
|
-
|
|
874
|
+
t40,
|
|
875
|
+
t98
|
|
706
876
|
] });
|
|
707
|
-
$[
|
|
708
|
-
$[
|
|
709
|
-
$[
|
|
710
|
-
$[
|
|
711
|
-
$[
|
|
877
|
+
$[156] = t27;
|
|
878
|
+
$[157] = t36;
|
|
879
|
+
$[158] = t37;
|
|
880
|
+
$[159] = t40;
|
|
881
|
+
$[160] = t98;
|
|
882
|
+
$[161] = t99;
|
|
712
883
|
} else {
|
|
713
|
-
|
|
884
|
+
t99 = $[161];
|
|
714
885
|
}
|
|
715
|
-
let
|
|
716
|
-
if ($[
|
|
717
|
-
|
|
886
|
+
let t100;
|
|
887
|
+
if ($[162] === Symbol.for("react.memo_cache_sentinel")) {
|
|
888
|
+
t100 = /* @__PURE__ */ jsx("div", { style: {
|
|
718
889
|
height: "52px"
|
|
719
890
|
} });
|
|
720
|
-
$[
|
|
891
|
+
$[162] = t100;
|
|
721
892
|
} else {
|
|
722
|
-
|
|
893
|
+
t100 = $[162];
|
|
723
894
|
}
|
|
724
|
-
let
|
|
725
|
-
if ($[
|
|
726
|
-
|
|
895
|
+
let t101;
|
|
896
|
+
if ($[163] !== setFieldValue) {
|
|
897
|
+
t101 = (icon) => {
|
|
727
898
|
setIconDialogOpen(false);
|
|
728
899
|
setFieldValue("icon", icon);
|
|
729
900
|
};
|
|
730
|
-
$[
|
|
731
|
-
$[
|
|
901
|
+
$[163] = setFieldValue;
|
|
902
|
+
$[164] = t101;
|
|
732
903
|
} else {
|
|
733
|
-
|
|
904
|
+
t101 = $[164];
|
|
734
905
|
}
|
|
735
|
-
let
|
|
736
|
-
if ($[
|
|
737
|
-
|
|
738
|
-
$[
|
|
739
|
-
$[
|
|
740
|
-
$[
|
|
906
|
+
let t102;
|
|
907
|
+
if ($[165] !== t101 || $[166] !== values.icon) {
|
|
908
|
+
t102 = /* @__PURE__ */ jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsx(SearchIconsView, { selectedIcon: values.icon, onIconSelected: t101 }) });
|
|
909
|
+
$[165] = t101;
|
|
910
|
+
$[166] = values.icon;
|
|
911
|
+
$[167] = t102;
|
|
741
912
|
} else {
|
|
742
|
-
|
|
913
|
+
t102 = $[167];
|
|
743
914
|
}
|
|
744
|
-
let
|
|
745
|
-
if ($[
|
|
746
|
-
|
|
747
|
-
$[
|
|
748
|
-
$[
|
|
749
|
-
$[
|
|
915
|
+
let t103;
|
|
916
|
+
if ($[168] !== iconDialogOpen || $[169] !== t102) {
|
|
917
|
+
t103 = /* @__PURE__ */ jsx(Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t102 });
|
|
918
|
+
$[168] = iconDialogOpen;
|
|
919
|
+
$[169] = t102;
|
|
920
|
+
$[170] = t103;
|
|
750
921
|
} else {
|
|
751
|
-
|
|
922
|
+
t103 = $[170];
|
|
752
923
|
}
|
|
753
|
-
let
|
|
754
|
-
if ($[
|
|
755
|
-
|
|
924
|
+
let t104;
|
|
925
|
+
if ($[171] !== T0 || $[172] !== t103 || $[173] !== t18 || $[174] !== t99) {
|
|
926
|
+
t104 = /* @__PURE__ */ jsx("div", { className: t7, children: /* @__PURE__ */ jsxs(T0, { maxWidth: t8, className: t9, children: [
|
|
756
927
|
t18,
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
928
|
+
t99,
|
|
929
|
+
t100,
|
|
930
|
+
t103
|
|
760
931
|
] }) });
|
|
761
|
-
$[
|
|
762
|
-
$[
|
|
763
|
-
$[
|
|
764
|
-
$[
|
|
765
|
-
$[
|
|
932
|
+
$[171] = T0;
|
|
933
|
+
$[172] = t103;
|
|
934
|
+
$[173] = t18;
|
|
935
|
+
$[174] = t99;
|
|
936
|
+
$[175] = t104;
|
|
766
937
|
} else {
|
|
767
|
-
|
|
938
|
+
t104 = $[175];
|
|
768
939
|
}
|
|
769
|
-
return
|
|
940
|
+
return t104;
|
|
770
941
|
}
|
|
771
|
-
function _temp3$4(
|
|
772
|
-
if (
|
|
942
|
+
function _temp3$4(value_3) {
|
|
943
|
+
if (value_3 === "code_defined") {
|
|
773
944
|
return "Code defined";
|
|
774
945
|
} else {
|
|
775
|
-
if (
|
|
946
|
+
if (value_3 === "true") {
|
|
776
947
|
return "Users must define an ID";
|
|
777
948
|
} else {
|
|
778
|
-
if (
|
|
949
|
+
if (value_3 === "optional") {
|
|
779
950
|
return "Users can define an ID, but it is not required";
|
|
780
951
|
} else {
|
|
781
952
|
return "Document ID is generated automatically";
|
|
@@ -783,11 +954,11 @@ function _temp3$4(value_2) {
|
|
|
783
954
|
}
|
|
784
955
|
}
|
|
785
956
|
}
|
|
786
|
-
function _temp2$7(
|
|
787
|
-
return /* @__PURE__ */ jsx(SelectItem, { value:
|
|
957
|
+
function _temp2$7(value_2) {
|
|
958
|
+
return /* @__PURE__ */ jsx(SelectItem, { value: value_2, children: value_2.toUpperCase() }, `size-select-${value_2}`);
|
|
788
959
|
}
|
|
789
|
-
function _temp$b(
|
|
790
|
-
return
|
|
960
|
+
function _temp$b(value_1) {
|
|
961
|
+
return value_1.toUpperCase();
|
|
791
962
|
}
|
|
792
963
|
function DefaultDatabaseField(t0) {
|
|
793
964
|
const $ = c(5);
|
|
@@ -1036,7 +1207,7 @@ function EnumFormFields(t0) {
|
|
|
1036
1207
|
let t6;
|
|
1037
1208
|
if ($[15] !== allowDataInference || $[16] !== disabled || $[17] !== inferValues || $[18] !== inferring) {
|
|
1038
1209
|
t6 = allowDataInference && /* @__PURE__ */ jsxs(Button, { loading: inferring, disabled: disabled || inferring, variant: "text", size: "small", onClick: inferValues, children: [
|
|
1039
|
-
inferring ? /* @__PURE__ */ jsx(CircularProgress, { size: "
|
|
1210
|
+
inferring ? /* @__PURE__ */ jsx(CircularProgress, { size: "smallest" }) : /* @__PURE__ */ jsx(AutorenewIcon, {}),
|
|
1040
1211
|
"Infer values from data"
|
|
1041
1212
|
] });
|
|
1042
1213
|
$[15] = allowDataInference;
|
|
@@ -6462,7 +6633,7 @@ function GetCodeDialog(t0) {
|
|
|
6462
6633
|
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
6463
6634
|
t2 = /* @__PURE__ */ jsxs(Typography, { variant: "body2", className: "my-4 mb-8", children: [
|
|
6464
6635
|
"If you want to customise the collection in code, you can add this collection code to your CMS app configuration. More info in the ",
|
|
6465
|
-
/* @__PURE__ */ jsx("a", { rel: "noopener noreferrer", href: "https://firecms.co/docs/
|
|
6636
|
+
/* @__PURE__ */ jsx("a", { rel: "noopener noreferrer", href: "https://firecms.co/docs/cloud/quickstart", children: "docs" }),
|
|
6466
6637
|
"."
|
|
6467
6638
|
] });
|
|
6468
6639
|
$[2] = t2;
|
|
@@ -6750,7 +6921,6 @@ function CollectionPropertiesEditorForm({
|
|
|
6750
6921
|
previousId,
|
|
6751
6922
|
namespace: namespace_3
|
|
6752
6923
|
}) => {
|
|
6753
|
-
console.log("!!!!!! onPropertyChanged", property_0);
|
|
6754
6924
|
const fullId_0 = id_0 ? getFullId(id_0, namespace_3) : void 0;
|
|
6755
6925
|
const propertyPath = fullId_0 ? idToPropertiesPath(fullId_0) : void 0;
|
|
6756
6926
|
if (previousId && previousId !== id_0) {
|
|
@@ -8304,10 +8474,8 @@ function CollectionEditorImportMapping(t0) {
|
|
|
8304
8474
|
editable: true
|
|
8305
8475
|
};
|
|
8306
8476
|
if (propertyPath_0) {
|
|
8307
|
-
|
|
8477
|
+
{
|
|
8308
8478
|
setFieldValue(propertyPath_0, inferredNewProperty, false);
|
|
8309
|
-
} else {
|
|
8310
|
-
setFieldValue(propertyPath_0, property_1, false);
|
|
8311
8479
|
}
|
|
8312
8480
|
setFieldTouched(propertyPath_0, true, false);
|
|
8313
8481
|
}
|
|
@@ -8702,7 +8870,7 @@ function CollectionEditorImportDataPreview(t0) {
|
|
|
8702
8870
|
}
|
|
8703
8871
|
let t8;
|
|
8704
8872
|
if ($[13] !== properties || $[14] !== selectionController || $[15] !== t5 || $[16] !== t7) {
|
|
8705
|
-
t8 = /* @__PURE__ */ jsx(EntityCollectionTable, { title: t4, tableController: t5, endAdornment: t6, filterable: false, sortable: false, selectionController, displayedColumnIds: t7, properties, enablePopupIcon: false });
|
|
8873
|
+
t8 = /* @__PURE__ */ jsx(EntityCollectionTable, { title: t4, tableController: t5, endAdornment: t6, filterable: false, sortable: false, selectionController, displayedColumnIds: t7, openEntityMode: "side_panel", properties, enablePopupIcon: false });
|
|
8706
8874
|
$[13] = properties;
|
|
8707
8875
|
$[14] = selectionController;
|
|
8708
8876
|
$[15] = t5;
|
|
@@ -9169,7 +9337,7 @@ function CollectionEditorInternal({
|
|
|
9169
9337
|
const updatedFullPath = fullPath?.includes("/") ? fullPath?.split("/").slice(0, -1).join("/") + "/" + path : path;
|
|
9170
9338
|
const pathError_0 = validatePath(path, isNewCollection, existingPaths, values_1.id);
|
|
9171
9339
|
const parentPaths = !pathError_0 && parentCollectionIds ? navigation.convertIdsToPaths(parentCollectionIds) : void 0;
|
|
9172
|
-
const resolvedPath = !pathError_0 ? navigation.
|
|
9340
|
+
const resolvedPath = !pathError_0 ? navigation.resolveIdsFrom(updatedFullPath) : void 0;
|
|
9173
9341
|
const getDataWithPath = resolvedPath && getData ? async () => {
|
|
9174
9342
|
const data = await getData(resolvedPath, parentPaths ?? []);
|
|
9175
9343
|
if (existingEntities) {
|
|
@@ -9206,82 +9374,109 @@ function CollectionEditorInternal({
|
|
|
9206
9374
|
setNextMode();
|
|
9207
9375
|
};
|
|
9208
9376
|
const editable = collection?.editable === void 0 || collection?.editable === true;
|
|
9377
|
+
const isMergedCollection = collection?.merged ?? false;
|
|
9209
9378
|
const collectionEditable = editable || isNewCollection;
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
})
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
/* @__PURE__ */ jsx(
|
|
9254
|
-
"
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
|
|
9272
|
-
|
|
9273
|
-
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
|
|
9277
|
-
|
|
9278
|
-
|
|
9279
|
-
|
|
9280
|
-
|
|
9281
|
-
|
|
9379
|
+
const [deleteRequested, setDeleteRequested] = useState(false);
|
|
9380
|
+
const deleteCollection = () => {
|
|
9381
|
+
if (!collection) return;
|
|
9382
|
+
configController?.deleteCollection({
|
|
9383
|
+
id: collection.id
|
|
9384
|
+
}).then(() => {
|
|
9385
|
+
setDeleteRequested(false);
|
|
9386
|
+
handleCancel();
|
|
9387
|
+
snackbarController.open({
|
|
9388
|
+
message: "Collection deleted",
|
|
9389
|
+
type: "success"
|
|
9390
|
+
});
|
|
9391
|
+
});
|
|
9392
|
+
};
|
|
9393
|
+
return /* @__PURE__ */ jsxs(DialogContent, { fullHeight: true, children: [
|
|
9394
|
+
/* @__PURE__ */ jsx(Formex, { value: formController, children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9395
|
+
!isNewCollection && /* @__PURE__ */ jsxs(Tabs, { value: currentView, innerClassName: cls(defaultBorderMixin, "px-4 h-14 w-full justify-end bg-surface-50 dark:bg-surface-950 border-b"), onValueChange: (v) => setCurrentView(v), children: [
|
|
9396
|
+
/* @__PURE__ */ jsx(Tab, { value: "details", children: "Details" }),
|
|
9397
|
+
/* @__PURE__ */ jsx(Tab, { value: "properties", children: "Properties" }),
|
|
9398
|
+
/* @__PURE__ */ jsx(Tab, { value: "subcollections", children: "Additional views" })
|
|
9399
|
+
] }),
|
|
9400
|
+
/* @__PURE__ */ jsxs("form", { noValidate: true, onSubmit: formController.handleSubmit, className: cls(isNewCollection ? "h-full" : "h-[calc(100%-48px)]", "flex-grow flex flex-col relative"), children: [
|
|
9401
|
+
currentView === "loading" && /* @__PURE__ */ jsx(CircularProgressCenter, {}),
|
|
9402
|
+
currentView === "extra_view" && path && extraView?.View && /* @__PURE__ */ jsx(extraView.View, { path }),
|
|
9403
|
+
currentView === "welcome" && /* @__PURE__ */ jsx(CollectionEditorWelcomeView, { path, onContinue: (importData, propertiesOrder_0) => {
|
|
9404
|
+
if (importData) {
|
|
9405
|
+
onImportDataSet(importData, propertiesOrder_0);
|
|
9406
|
+
setCurrentView("import_data_mapping");
|
|
9407
|
+
} else {
|
|
9408
|
+
setCurrentView("details");
|
|
9409
|
+
}
|
|
9410
|
+
}, existingCollectionPaths: existingPaths, parentCollection, pathSuggestions }),
|
|
9411
|
+
currentView === "import_data_mapping" && importConfig && /* @__PURE__ */ jsx(CollectionEditorImportMapping, { importConfig, collectionEditable, propertyConfigs }),
|
|
9412
|
+
currentView === "import_data_preview" && importConfig && /* @__PURE__ */ jsx(CollectionEditorImportDataPreview, { importConfig, properties: values_1.properties, propertiesOrder: values_1.propertiesOrder }),
|
|
9413
|
+
currentView === "import_data_saving" && importConfig && /* @__PURE__ */ jsx(ImportSaveInProgress, { importConfig, collection: values_1, path, onImportSuccess: async (importedCollection) => {
|
|
9414
|
+
snackbarController.open({
|
|
9415
|
+
type: "info",
|
|
9416
|
+
message: "Data imported successfully"
|
|
9417
|
+
});
|
|
9418
|
+
await saveCollection(values_1);
|
|
9419
|
+
handleClose(importedCollection);
|
|
9420
|
+
} }),
|
|
9421
|
+
currentView === "details" && /* @__PURE__ */ jsx(CollectionDetailsForm, { existingPaths, existingIds, groups, parentCollectionIds, parentCollection, isNewCollection, children: !isNewCollection && isMergedCollection && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 mt-8", children: [
|
|
9422
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", color: "secondary", children: "This collection is defined in code. The changes done in this editor will override the properties defined in code. You can delete the overridden values to revert to the state defined in code." }),
|
|
9423
|
+
/* @__PURE__ */ jsx(Button, { variant: "neutral", onClick: () => {
|
|
9424
|
+
setDeleteRequested(true);
|
|
9425
|
+
}, children: "Reset to code" })
|
|
9426
|
+
] }) }),
|
|
9427
|
+
currentView === "subcollections" && collection && /* @__PURE__ */ jsx(SubcollectionsEditTab, { parentCollection, configController, getUser, collectionInference, parentCollectionIds, collection }),
|
|
9428
|
+
currentView === "properties" && /* @__PURE__ */ jsx(CollectionPropertiesEditorForm, { showErrors: submitCount > 0, isNewCollection, reservedGroups, onPropertyError: (propertyKey, namespace, error_0) => {
|
|
9429
|
+
const current = removeUndefined({
|
|
9430
|
+
...propertyErrorsRef.current,
|
|
9431
|
+
[getFullIdPath(propertyKey, namespace)]: removeUndefined(error_0, true)
|
|
9432
|
+
}, true);
|
|
9433
|
+
propertyErrorsRef.current = current;
|
|
9434
|
+
formController.validate();
|
|
9435
|
+
}, getUser, getData: getDataWithPath, doCollectionInference, propertyConfigs, collectionEditable, extraIcon: extraView?.icon && /* @__PURE__ */ jsx(IconButton, { color: "primary", onClick: () => setCurrentView("extra_view"), children: extraView.icon }) }),
|
|
9436
|
+
currentView !== "welcome" && /* @__PURE__ */ jsxs(DialogActions, { position: "absolute", children: [
|
|
9437
|
+
error && /* @__PURE__ */ jsx(ErrorView, { error }),
|
|
9438
|
+
isNewCollection && includeTemplates && currentView === "import_data_mapping" && /* @__PURE__ */ jsxs(Button, { variant: "text", type: "button", onClick: () => {
|
|
9439
|
+
importConfig.setInUse(false);
|
|
9440
|
+
return setCurrentView("welcome");
|
|
9441
|
+
}, children: [
|
|
9442
|
+
/* @__PURE__ */ jsx(ArrowBackIcon, {}),
|
|
9443
|
+
"Back"
|
|
9444
|
+
] }),
|
|
9445
|
+
isNewCollection && includeTemplates && currentView === "import_data_preview" && /* @__PURE__ */ jsxs(Button, { variant: "text", type: "button", onClick: () => {
|
|
9446
|
+
setCurrentView("import_data_mapping");
|
|
9447
|
+
}, children: [
|
|
9448
|
+
/* @__PURE__ */ jsx(ArrowBackIcon, {}),
|
|
9449
|
+
"Back"
|
|
9450
|
+
] }),
|
|
9451
|
+
isNewCollection && includeTemplates && currentView === "details" && /* @__PURE__ */ jsxs(Button, { variant: "text", type: "button", onClick: () => setCurrentView("welcome"), children: [
|
|
9452
|
+
/* @__PURE__ */ jsx(ArrowBackIcon, {}),
|
|
9453
|
+
"Back"
|
|
9454
|
+
] }),
|
|
9455
|
+
isNewCollection && currentView === "properties" && /* @__PURE__ */ jsxs(Button, { variant: "text", type: "button", onClick: () => setCurrentView("details"), children: [
|
|
9456
|
+
/* @__PURE__ */ jsx(ArrowBackIcon, {}),
|
|
9457
|
+
"Back"
|
|
9458
|
+
] }),
|
|
9459
|
+
/* @__PURE__ */ jsx(Button, { variant: "text", onClick: () => {
|
|
9460
|
+
handleCancel();
|
|
9461
|
+
}, children: "Cancel" }),
|
|
9462
|
+
isNewCollection && currentView === "import_data_mapping" && /* @__PURE__ */ jsx(Button, { variant: "filled", color: "primary", onClick: onImportMappingComplete, children: "Next" }),
|
|
9463
|
+
isNewCollection && currentView === "import_data_preview" && /* @__PURE__ */ jsx(Button, { variant: "filled", color: "primary", onClick: () => {
|
|
9464
|
+
setNextMode();
|
|
9465
|
+
}, children: "Next" }),
|
|
9466
|
+
isNewCollection && (currentView === "details" || currentView === "properties") && /* @__PURE__ */ jsxs(LoadingButton, { variant: "filled", color: "primary", type: "submit", loading: isSubmitting, disabled: isSubmitting || currentView === "details" && !validValues, startIcon: currentView === "properties" ? /* @__PURE__ */ jsx(CheckIcon, {}) : void 0, children: [
|
|
9467
|
+
currentView === "details" && "Next",
|
|
9468
|
+
currentView === "properties" && "Create collection"
|
|
9469
|
+
] }),
|
|
9470
|
+
!isNewCollection && /* @__PURE__ */ jsx(LoadingButton, { variant: "filled", color: "primary", type: "submit", loading: isSubmitting, children: "Update collection" })
|
|
9471
|
+
] })
|
|
9282
9472
|
] })
|
|
9283
|
-
] })
|
|
9284
|
-
|
|
9473
|
+
] }) }),
|
|
9474
|
+
/* @__PURE__ */ jsx(ConfirmationDialog, { open: deleteRequested, onAccept: deleteCollection, onCancel: () => setDeleteRequested(false), title: /* @__PURE__ */ jsx(Fragment, { children: "Delete the stored config?" }), body: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9475
|
+
" This will ",
|
|
9476
|
+
/* @__PURE__ */ jsx("b", { children: "not delete any data" }),
|
|
9477
|
+
", only the stored config, and reset to the code state."
|
|
9478
|
+
] }) })
|
|
9479
|
+
] });
|
|
9285
9480
|
}
|
|
9286
9481
|
function applyPropertyConfigs(collection, propertyConfigs) {
|
|
9287
9482
|
const {
|
|
@@ -9345,7 +9540,7 @@ const validateId = (value, isNewCollection, existingPaths, existingIds) => {
|
|
|
9345
9540
|
const ConfigControllerContext = React__default.createContext({});
|
|
9346
9541
|
const CollectionEditorContext = React__default.createContext({});
|
|
9347
9542
|
const ConfigControllerProvider = React__default.memo(function ConfigControllerProvider2(t0) {
|
|
9348
|
-
const $ = c(
|
|
9543
|
+
const $ = c(67);
|
|
9349
9544
|
const {
|
|
9350
9545
|
children,
|
|
9351
9546
|
collectionConfigController,
|
|
@@ -9356,8 +9551,7 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9356
9551
|
getPathSuggestions,
|
|
9357
9552
|
getUser,
|
|
9358
9553
|
getData,
|
|
9359
|
-
onAnalyticsEvent
|
|
9360
|
-
components
|
|
9554
|
+
onAnalyticsEvent
|
|
9361
9555
|
} = t0;
|
|
9362
9556
|
const navigation = useNavigationController();
|
|
9363
9557
|
const navigate = useNavigate();
|
|
@@ -9475,28 +9669,26 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9475
9669
|
const createCollection = t3;
|
|
9476
9670
|
const t4 = configPermissions ?? defaultConfigPermissions;
|
|
9477
9671
|
let t5;
|
|
9478
|
-
if ($[6] !==
|
|
9672
|
+
if ($[6] !== createCollection || $[7] !== editCollection || $[8] !== editProperty || $[9] !== getPathSuggestions || $[10] !== t4) {
|
|
9479
9673
|
t5 = {
|
|
9480
9674
|
editCollection,
|
|
9481
9675
|
createCollection,
|
|
9482
9676
|
editProperty,
|
|
9483
9677
|
configPermissions: t4,
|
|
9484
|
-
getPathSuggestions
|
|
9485
|
-
components
|
|
9678
|
+
getPathSuggestions
|
|
9486
9679
|
};
|
|
9487
|
-
$[6] =
|
|
9488
|
-
$[7] =
|
|
9489
|
-
$[8] =
|
|
9490
|
-
$[9] =
|
|
9491
|
-
$[10] =
|
|
9492
|
-
$[11] =
|
|
9493
|
-
$[12] = t5;
|
|
9680
|
+
$[6] = createCollection;
|
|
9681
|
+
$[7] = editCollection;
|
|
9682
|
+
$[8] = editProperty;
|
|
9683
|
+
$[9] = getPathSuggestions;
|
|
9684
|
+
$[10] = t4;
|
|
9685
|
+
$[11] = t5;
|
|
9494
9686
|
} else {
|
|
9495
|
-
t5 = $[
|
|
9687
|
+
t5 = $[11];
|
|
9496
9688
|
}
|
|
9497
9689
|
const t6 = Boolean(currentDialog);
|
|
9498
9690
|
let t7;
|
|
9499
|
-
if ($[
|
|
9691
|
+
if ($[12] !== currentDialog || $[13] !== navigate || $[14] !== navigation) {
|
|
9500
9692
|
t7 = (collection_0) => {
|
|
9501
9693
|
if (currentDialog?.redirect) {
|
|
9502
9694
|
if (collection_0 && currentDialog?.isNewCollection && !currentDialog.parentCollectionIds.length) {
|
|
@@ -9506,29 +9698,29 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9506
9698
|
}
|
|
9507
9699
|
setCurrentDialog(void 0);
|
|
9508
9700
|
};
|
|
9509
|
-
$[
|
|
9510
|
-
$[
|
|
9511
|
-
$[
|
|
9512
|
-
$[
|
|
9701
|
+
$[12] = currentDialog;
|
|
9702
|
+
$[13] = navigate;
|
|
9703
|
+
$[14] = navigation;
|
|
9704
|
+
$[15] = t7;
|
|
9513
9705
|
} else {
|
|
9514
|
-
t7 = $[
|
|
9706
|
+
t7 = $[15];
|
|
9515
9707
|
}
|
|
9516
9708
|
let t8;
|
|
9517
|
-
if ($[
|
|
9709
|
+
if ($[16] !== collectionConfigController || $[17] !== collectionInference || $[18] !== currentDialog || $[19] !== extraView || $[20] !== getData || $[21] !== getPathSuggestions || $[22] !== getUser || $[23] !== reservedGroups || $[24] !== t6 || $[25] !== t7) {
|
|
9518
9710
|
t8 = /* @__PURE__ */ jsx(CollectionEditorDialog, { open: t6, configController: collectionConfigController, isNewCollection: false, collectionInference, ...currentDialog, getData, reservedGroups, extraView, pathSuggestions: getPathSuggestions, getUser, handleClose: t7 });
|
|
9519
|
-
$[
|
|
9520
|
-
$[
|
|
9521
|
-
$[
|
|
9522
|
-
$[
|
|
9523
|
-
$[
|
|
9524
|
-
$[
|
|
9525
|
-
$[
|
|
9526
|
-
$[
|
|
9527
|
-
$[
|
|
9528
|
-
$[
|
|
9529
|
-
$[
|
|
9711
|
+
$[16] = collectionConfigController;
|
|
9712
|
+
$[17] = collectionInference;
|
|
9713
|
+
$[18] = currentDialog;
|
|
9714
|
+
$[19] = extraView;
|
|
9715
|
+
$[20] = getData;
|
|
9716
|
+
$[21] = getPathSuggestions;
|
|
9717
|
+
$[22] = getUser;
|
|
9718
|
+
$[23] = reservedGroups;
|
|
9719
|
+
$[24] = t6;
|
|
9720
|
+
$[25] = t7;
|
|
9721
|
+
$[26] = t8;
|
|
9530
9722
|
} else {
|
|
9531
|
-
t8 = $[
|
|
9723
|
+
t8 = $[26];
|
|
9532
9724
|
}
|
|
9533
9725
|
const t9 = Boolean(currentPropertyDialog);
|
|
9534
9726
|
const t10 = Boolean(currentPropertyDialog?.propertyKey);
|
|
@@ -9536,21 +9728,21 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9536
9728
|
const t12 = !currentPropertyDialog ? false : !currentPropertyDialog?.propertyKey;
|
|
9537
9729
|
const t13 = currentPropertyDialog?.collectionEditable ?? false;
|
|
9538
9730
|
let t14;
|
|
9539
|
-
if ($[
|
|
9731
|
+
if ($[27] !== currentPropertyDialog || $[28] !== getData || $[29] !== navigation) {
|
|
9540
9732
|
t14 = getData && currentPropertyDialog?.editedCollectionId ? () => {
|
|
9541
9733
|
console.debug("get data for property", currentPropertyDialog?.editedCollectionId);
|
|
9542
|
-
const resolvedPath = navigation.
|
|
9734
|
+
const resolvedPath = navigation.resolveIdsFrom(currentPropertyDialog.editedCollectionId);
|
|
9543
9735
|
return getData(resolvedPath, []);
|
|
9544
9736
|
} : void 0;
|
|
9545
|
-
$[
|
|
9546
|
-
$[
|
|
9547
|
-
$[
|
|
9548
|
-
$[
|
|
9737
|
+
$[27] = currentPropertyDialog;
|
|
9738
|
+
$[28] = getData;
|
|
9739
|
+
$[29] = navigation;
|
|
9740
|
+
$[30] = t14;
|
|
9549
9741
|
} else {
|
|
9550
|
-
t14 = $[
|
|
9742
|
+
t14 = $[30];
|
|
9551
9743
|
}
|
|
9552
9744
|
let t15;
|
|
9553
|
-
if ($[
|
|
9745
|
+
if ($[31] !== collectionConfigController || $[32] !== currentPropertyDialog || $[33] !== snackbarController) {
|
|
9554
9746
|
t15 = (t162) => {
|
|
9555
9747
|
const {
|
|
9556
9748
|
id: id_0,
|
|
@@ -9579,15 +9771,15 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9579
9771
|
return false;
|
|
9580
9772
|
});
|
|
9581
9773
|
};
|
|
9582
|
-
$[
|
|
9583
|
-
$[
|
|
9584
|
-
$[
|
|
9585
|
-
$[
|
|
9774
|
+
$[31] = collectionConfigController;
|
|
9775
|
+
$[32] = currentPropertyDialog;
|
|
9776
|
+
$[33] = snackbarController;
|
|
9777
|
+
$[34] = t15;
|
|
9586
9778
|
} else {
|
|
9587
|
-
t15 = $[
|
|
9779
|
+
t15 = $[34];
|
|
9588
9780
|
}
|
|
9589
9781
|
let t16;
|
|
9590
|
-
if ($[
|
|
9782
|
+
if ($[35] !== collectionConfigController || $[36] !== currentPropertyDialog?.currentPropertiesOrder || $[37] !== currentPropertyDialog?.editedCollectionId || $[38] !== currentPropertyDialog?.namespace || $[39] !== currentPropertyDialog?.parentCollectionIds || $[40] !== currentPropertyDialog?.propertyKey || $[41] !== snackbarController) {
|
|
9591
9783
|
t16 = () => {
|
|
9592
9784
|
if (!currentPropertyDialog?.propertyKey) {
|
|
9593
9785
|
return;
|
|
@@ -9610,21 +9802,21 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9610
9802
|
return false;
|
|
9611
9803
|
});
|
|
9612
9804
|
};
|
|
9613
|
-
$[
|
|
9614
|
-
$[
|
|
9615
|
-
$[
|
|
9616
|
-
$[
|
|
9617
|
-
$[
|
|
9618
|
-
$[
|
|
9619
|
-
$[
|
|
9620
|
-
$[
|
|
9805
|
+
$[35] = collectionConfigController;
|
|
9806
|
+
$[36] = currentPropertyDialog?.currentPropertiesOrder;
|
|
9807
|
+
$[37] = currentPropertyDialog?.editedCollectionId;
|
|
9808
|
+
$[38] = currentPropertyDialog?.namespace;
|
|
9809
|
+
$[39] = currentPropertyDialog?.parentCollectionIds;
|
|
9810
|
+
$[40] = currentPropertyDialog?.propertyKey;
|
|
9811
|
+
$[41] = snackbarController;
|
|
9812
|
+
$[42] = t16;
|
|
9621
9813
|
} else {
|
|
9622
|
-
t16 = $[
|
|
9814
|
+
t16 = $[42];
|
|
9623
9815
|
}
|
|
9624
9816
|
let t17;
|
|
9625
9817
|
let t18;
|
|
9626
9818
|
let t19;
|
|
9627
|
-
if ($[
|
|
9819
|
+
if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9628
9820
|
t17 = () => {
|
|
9629
9821
|
setCurrentPropertyDialog(void 0);
|
|
9630
9822
|
};
|
|
@@ -9632,64 +9824,64 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9632
9824
|
setCurrentPropertyDialog(void 0);
|
|
9633
9825
|
};
|
|
9634
9826
|
t19 = {};
|
|
9635
|
-
$[
|
|
9636
|
-
$[
|
|
9637
|
-
$[
|
|
9827
|
+
$[43] = t17;
|
|
9828
|
+
$[44] = t18;
|
|
9829
|
+
$[45] = t19;
|
|
9638
9830
|
} else {
|
|
9639
|
-
t17 = $[
|
|
9640
|
-
t18 = $[
|
|
9641
|
-
t19 = $[
|
|
9831
|
+
t17 = $[43];
|
|
9832
|
+
t18 = $[44];
|
|
9833
|
+
t19 = $[45];
|
|
9642
9834
|
}
|
|
9643
9835
|
let t20;
|
|
9644
|
-
if ($[
|
|
9836
|
+
if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9645
9837
|
t20 = [];
|
|
9646
|
-
$[
|
|
9838
|
+
$[46] = t20;
|
|
9647
9839
|
} else {
|
|
9648
|
-
t20 = $[
|
|
9840
|
+
t20 = $[46];
|
|
9649
9841
|
}
|
|
9650
9842
|
const t21 = currentPropertyDialog?.property;
|
|
9651
9843
|
const t22 = currentPropertyDialog?.propertyKey;
|
|
9652
9844
|
let t23;
|
|
9653
|
-
if ($[
|
|
9845
|
+
if ($[47] !== propertyConfigs || $[48] !== t10 || $[49] !== t11 || $[50] !== t12 || $[51] !== t13 || $[52] !== t14 || $[53] !== t15 || $[54] !== t16 || $[55] !== t21 || $[56] !== t22 || $[57] !== t9) {
|
|
9654
9846
|
t23 = /* @__PURE__ */ jsx(PropertyFormDialog, { open: t9, includeIdAndName: true, existingProperty: t10, autoUpdateId: t11, autoOpenTypeSelect: t12, inArray: false, collectionEditable: t13, getData: t14, onPropertyChanged: t15, onPropertyChangedImmediate: false, onDelete: t16, onError: _temp2, onOkClicked: t17, onCancel: t18, initialErrors: t19, forceShowErrors: false, existingPropertyKeys: t20, allowDataInference: true, propertyConfigs, property: t21, propertyKey: t22 });
|
|
9655
|
-
$[
|
|
9656
|
-
$[
|
|
9657
|
-
$[
|
|
9658
|
-
$[
|
|
9659
|
-
$[
|
|
9660
|
-
$[
|
|
9661
|
-
$[
|
|
9662
|
-
$[
|
|
9663
|
-
$[
|
|
9664
|
-
$[
|
|
9665
|
-
$[
|
|
9666
|
-
$[
|
|
9667
|
-
} else {
|
|
9668
|
-
t23 = $[
|
|
9847
|
+
$[47] = propertyConfigs;
|
|
9848
|
+
$[48] = t10;
|
|
9849
|
+
$[49] = t11;
|
|
9850
|
+
$[50] = t12;
|
|
9851
|
+
$[51] = t13;
|
|
9852
|
+
$[52] = t14;
|
|
9853
|
+
$[53] = t15;
|
|
9854
|
+
$[54] = t16;
|
|
9855
|
+
$[55] = t21;
|
|
9856
|
+
$[56] = t22;
|
|
9857
|
+
$[57] = t9;
|
|
9858
|
+
$[58] = t23;
|
|
9859
|
+
} else {
|
|
9860
|
+
t23 = $[58];
|
|
9669
9861
|
}
|
|
9670
9862
|
let t24;
|
|
9671
|
-
if ($[
|
|
9863
|
+
if ($[59] !== children || $[60] !== t23 || $[61] !== t5 || $[62] !== t8) {
|
|
9672
9864
|
t24 = /* @__PURE__ */ jsxs(CollectionEditorContext.Provider, { value: t5, children: [
|
|
9673
9865
|
children,
|
|
9674
9866
|
t8,
|
|
9675
9867
|
t23
|
|
9676
9868
|
] });
|
|
9677
|
-
$[
|
|
9678
|
-
$[
|
|
9679
|
-
$[
|
|
9680
|
-
$[
|
|
9681
|
-
$[
|
|
9869
|
+
$[59] = children;
|
|
9870
|
+
$[60] = t23;
|
|
9871
|
+
$[61] = t5;
|
|
9872
|
+
$[62] = t8;
|
|
9873
|
+
$[63] = t24;
|
|
9682
9874
|
} else {
|
|
9683
|
-
t24 = $[
|
|
9875
|
+
t24 = $[63];
|
|
9684
9876
|
}
|
|
9685
9877
|
let t25;
|
|
9686
|
-
if ($[
|
|
9878
|
+
if ($[64] !== collectionConfigController || $[65] !== t24) {
|
|
9687
9879
|
t25 = /* @__PURE__ */ jsx(ConfigControllerContext.Provider, { value: collectionConfigController, children: t24 });
|
|
9688
|
-
$[
|
|
9689
|
-
$[
|
|
9690
|
-
$[
|
|
9880
|
+
$[64] = collectionConfigController;
|
|
9881
|
+
$[65] = t24;
|
|
9882
|
+
$[66] = t25;
|
|
9691
9883
|
} else {
|
|
9692
|
-
t25 = $[
|
|
9884
|
+
t25 = $[66];
|
|
9693
9885
|
}
|
|
9694
9886
|
return t25;
|
|
9695
9887
|
}, equal);
|
|
@@ -10304,7 +10496,7 @@ function NewCollectionCard(t0) {
|
|
|
10304
10496
|
return t8;
|
|
10305
10497
|
}
|
|
10306
10498
|
function useCollectionEditorPlugin(t0) {
|
|
10307
|
-
const $ = c(
|
|
10499
|
+
const $ = c(15);
|
|
10308
10500
|
const {
|
|
10309
10501
|
collectionConfigController,
|
|
10310
10502
|
configPermissions,
|
|
@@ -10314,11 +10506,10 @@ function useCollectionEditorPlugin(t0) {
|
|
|
10314
10506
|
getUser,
|
|
10315
10507
|
collectionInference,
|
|
10316
10508
|
getData,
|
|
10317
|
-
onAnalyticsEvent
|
|
10318
|
-
components
|
|
10509
|
+
onAnalyticsEvent
|
|
10319
10510
|
} = t0;
|
|
10320
10511
|
let t1;
|
|
10321
|
-
if ($[0] !== collectionConfigController || $[1] !== collectionInference || $[2] !==
|
|
10512
|
+
if ($[0] !== collectionConfigController || $[1] !== collectionInference || $[2] !== configPermissions || $[3] !== extraView || $[4] !== getData || $[5] !== getPathSuggestions || $[6] !== getUser || $[7] !== onAnalyticsEvent || $[8] !== reservedGroups) {
|
|
10322
10513
|
t1 = {
|
|
10323
10514
|
Component: ConfigControllerProvider,
|
|
10324
10515
|
props: {
|
|
@@ -10330,27 +10521,25 @@ function useCollectionEditorPlugin(t0) {
|
|
|
10330
10521
|
getPathSuggestions,
|
|
10331
10522
|
getUser,
|
|
10332
10523
|
getData,
|
|
10333
|
-
onAnalyticsEvent
|
|
10334
|
-
components
|
|
10524
|
+
onAnalyticsEvent
|
|
10335
10525
|
}
|
|
10336
10526
|
};
|
|
10337
10527
|
$[0] = collectionConfigController;
|
|
10338
10528
|
$[1] = collectionInference;
|
|
10339
|
-
$[2] =
|
|
10340
|
-
$[3] =
|
|
10341
|
-
$[4] =
|
|
10342
|
-
$[5] =
|
|
10343
|
-
$[6] =
|
|
10344
|
-
$[7] =
|
|
10345
|
-
$[8] =
|
|
10346
|
-
$[9] =
|
|
10347
|
-
$[10] = t1;
|
|
10529
|
+
$[2] = configPermissions;
|
|
10530
|
+
$[3] = extraView;
|
|
10531
|
+
$[4] = getData;
|
|
10532
|
+
$[5] = getPathSuggestions;
|
|
10533
|
+
$[6] = getUser;
|
|
10534
|
+
$[7] = onAnalyticsEvent;
|
|
10535
|
+
$[8] = reservedGroups;
|
|
10536
|
+
$[9] = t1;
|
|
10348
10537
|
} else {
|
|
10349
|
-
t1 = $[
|
|
10538
|
+
t1 = $[9];
|
|
10350
10539
|
}
|
|
10351
10540
|
let t2;
|
|
10352
10541
|
let t3;
|
|
10353
|
-
if ($[
|
|
10542
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10354
10543
|
t2 = {
|
|
10355
10544
|
additionalActions: /* @__PURE__ */ jsx(NewCollectionButton, {}),
|
|
10356
10545
|
additionalChildrenStart: /* @__PURE__ */ jsx(IntroWidget, {}),
|
|
@@ -10363,14 +10552,14 @@ function useCollectionEditorPlugin(t0) {
|
|
|
10363
10552
|
HeaderAction: CollectionViewHeaderAction,
|
|
10364
10553
|
AddColumnComponent: PropertyAddColumnComponent
|
|
10365
10554
|
};
|
|
10366
|
-
$[
|
|
10367
|
-
$[
|
|
10555
|
+
$[10] = t2;
|
|
10556
|
+
$[11] = t3;
|
|
10368
10557
|
} else {
|
|
10369
|
-
t2 = $[
|
|
10370
|
-
t3 = $[
|
|
10558
|
+
t2 = $[10];
|
|
10559
|
+
t3 = $[11];
|
|
10371
10560
|
}
|
|
10372
10561
|
let t4;
|
|
10373
|
-
if ($[
|
|
10562
|
+
if ($[12] !== collectionConfigController.loading || $[13] !== t1) {
|
|
10374
10563
|
t4 = {
|
|
10375
10564
|
key: "collection_editor",
|
|
10376
10565
|
loading: collectionConfigController.loading,
|
|
@@ -10378,11 +10567,11 @@ function useCollectionEditorPlugin(t0) {
|
|
|
10378
10567
|
homePage: t2,
|
|
10379
10568
|
collectionView: t3
|
|
10380
10569
|
};
|
|
10381
|
-
$[
|
|
10382
|
-
$[
|
|
10383
|
-
$[
|
|
10570
|
+
$[12] = collectionConfigController.loading;
|
|
10571
|
+
$[13] = t1;
|
|
10572
|
+
$[14] = t4;
|
|
10384
10573
|
} else {
|
|
10385
|
-
t4 = $[
|
|
10574
|
+
t4 = $[14];
|
|
10386
10575
|
}
|
|
10387
10576
|
return t4;
|
|
10388
10577
|
}
|
|
@@ -10458,17 +10647,19 @@ function IntroWidget(t0) {
|
|
|
10458
10647
|
}
|
|
10459
10648
|
return t6;
|
|
10460
10649
|
}
|
|
10461
|
-
const mergeCollections = (baseCollections, backendCollections, modifyCollection) => {
|
|
10650
|
+
const mergeCollections = (baseCollections, backendCollections = [], modifyCollection) => {
|
|
10462
10651
|
const markAsEditable = (c2) => {
|
|
10463
10652
|
makePropertiesEditable(c2.properties);
|
|
10464
10653
|
c2.subcollections?.forEach(markAsEditable);
|
|
10465
10654
|
};
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
console.debug("Collections
|
|
10470
|
-
|
|
10471
|
-
|
|
10655
|
+
backendCollections.forEach(markAsEditable);
|
|
10656
|
+
const result = joinCollectionLists(baseCollections, backendCollections, [], modifyCollection);
|
|
10657
|
+
result.sort((a, b) => baseCollections.findIndex((c2) => c2.id === a.id) - baseCollections.findIndex((c2) => c2.id === b.id));
|
|
10658
|
+
console.debug("Collections result", {
|
|
10659
|
+
baseCollections,
|
|
10660
|
+
backendCollections,
|
|
10661
|
+
result
|
|
10662
|
+
});
|
|
10472
10663
|
return result;
|
|
10473
10664
|
};
|
|
10474
10665
|
function MissingReferenceWidget(t0) {
|