@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/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 { useAutoComplete, Chip, Typography, cls, TextField, Autocomplete, AutocompleteItem, SelectItem, Container, Tooltip, 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, Card, ContentCopyIcon, CodeIcon, Table, TableBody, TableRow, TableCell, Alert, Icon, coolIconKeys, Tabs, Tab, ArrowBackIcon, LoadingButton, CheckIcon, Menu, MoreVertIcon, MenuItem, UndoIcon, SaveIcon } from "@firecms/ui";
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(168);
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
- const collectionEditor = useCollectionEditorController();
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] !== DatabaseField || $[16] !== updateDatabaseId || $[17] !== values.databaseId) {
158
- t13 = /* @__PURE__ */ jsx(DatabaseField, { databaseId: values.databaseId, onDatabaseIdUpdate: updateDatabaseId });
159
- $[15] = DatabaseField;
160
- $[16] = updateDatabaseId;
161
- $[17] = values.databaseId;
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 = $[18];
303
+ t13 = $[17];
165
304
  }
166
305
  let t14;
167
- if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
306
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
168
307
  t14 = () => setIconDialogOpen(true);
169
- $[19] = t14;
308
+ $[18] = t14;
170
309
  } else {
171
- t14 = $[19];
310
+ t14 = $[18];
172
311
  }
173
312
  let t15;
174
- if ($[20] !== collectionIcon) {
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
- $[20] = collectionIcon;
177
- $[21] = t15;
315
+ $[19] = collectionIcon;
316
+ $[20] = t15;
178
317
  } else {
179
- t15 = $[21];
318
+ t15 = $[20];
180
319
  }
181
320
  let t16;
182
- if ($[22] !== t12 || $[23] !== t13 || $[24] !== t15) {
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
- $[22] = t12;
189
- $[23] = t13;
190
- $[24] = t15;
191
- $[25] = t16;
327
+ $[21] = t12;
328
+ $[22] = t13;
329
+ $[23] = t15;
330
+ $[24] = t16;
192
331
  } else {
193
- t16 = $[25];
332
+ t16 = $[24];
194
333
  }
195
334
  let t17;
196
- if ($[26] !== parentCollection) {
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
- $[26] = parentCollection;
202
- $[27] = t17;
340
+ $[25] = parentCollection;
341
+ $[26] = t17;
203
342
  } else {
204
- t17 = $[27];
343
+ t17 = $[26];
205
344
  }
206
345
  let t18;
207
- if ($[28] !== t16 || $[29] !== t17) {
346
+ if ($[27] !== t16 || $[28] !== t17) {
208
347
  t18 = /* @__PURE__ */ jsxs("div", { children: [
209
348
  t16,
210
349
  t17
211
350
  ] });
212
- $[28] = t16;
213
- $[29] = t17;
214
- $[30] = t18;
351
+ $[27] = t16;
352
+ $[28] = t17;
353
+ $[29] = t18;
215
354
  } else {
216
- t18 = $[30];
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 ($[31] !== updateName) {
360
+ if ($[30] !== updateName) {
222
361
  t21 = (e) => updateName(e.target.value);
223
- $[31] = updateName;
224
- $[32] = t21;
362
+ $[30] = updateName;
363
+ $[31] = t21;
225
364
  } else {
226
- t21 = $[32];
365
+ t21 = $[31];
227
366
  }
228
367
  const t22 = showErrors && Boolean(errors.name);
229
368
  let t23;
230
- if ($[33] !== t20 || $[34] !== t21 || $[35] !== t22) {
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
- $[33] = t20;
233
- $[34] = t21;
234
- $[35] = t22;
235
- $[36] = t23;
371
+ $[32] = t20;
372
+ $[33] = t21;
373
+ $[34] = t22;
374
+ $[35] = t23;
236
375
  } else {
237
- t23 = $[36];
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 ($[37] !== t24 || $[38] !== t25) {
381
+ if ($[36] !== t24 || $[37] !== t25) {
243
382
  t26 = /* @__PURE__ */ jsx(FieldCaption, { error: t24, children: t25 });
244
- $[37] = t24;
245
- $[38] = t25;
246
- $[39] = t26;
383
+ $[36] = t24;
384
+ $[37] = t25;
385
+ $[38] = t26;
247
386
  } else {
248
- t26 = $[39];
387
+ t26 = $[38];
249
388
  }
250
389
  let t27;
251
- if ($[40] !== t23 || $[41] !== t26) {
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
- $[40] = t23;
257
- $[41] = t26;
258
- $[42] = t27;
395
+ $[39] = t23;
396
+ $[40] = t26;
397
+ $[41] = t27;
259
398
  } else {
260
- t27 = $[42];
399
+ t27 = $[41];
261
400
  }
262
401
  const t28 = isSubcollection ? "" : "sm:col-span-8";
263
402
  let t29;
264
- if ($[43] !== t28) {
403
+ if ($[42] !== t28) {
265
404
  t29 = cls("col-span-12 ", t28);
266
- $[43] = t28;
267
- $[44] = t29;
405
+ $[42] = t28;
406
+ $[43] = t29;
268
407
  } else {
269
- t29 = $[44];
408
+ t29 = $[43];
270
409
  }
271
410
  const t30 = !isNewCollection;
272
411
  const t31 = showErrors && Boolean(errors.path);
273
412
  let t32;
274
- if ($[45] !== t30 || $[46] !== t31) {
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
- $[45] = t30;
277
- $[46] = t31;
278
- $[47] = t32;
415
+ $[44] = t30;
416
+ $[45] = t31;
417
+ $[46] = t32;
279
418
  } else {
280
- t32 = $[47];
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 ($[48] !== t33 || $[49] !== t34) {
424
+ if ($[47] !== t33 || $[48] !== t34) {
286
425
  t35 = /* @__PURE__ */ jsx(FieldCaption, { error: t33, children: t34 });
287
- $[48] = t33;
288
- $[49] = t34;
289
- $[50] = t35;
426
+ $[47] = t33;
427
+ $[48] = t34;
428
+ $[49] = t35;
290
429
  } else {
291
- t35 = $[50];
430
+ t35 = $[49];
292
431
  }
293
432
  let t36;
294
- if ($[51] !== t29 || $[52] !== t32 || $[53] !== t35) {
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
- $[51] = t29;
300
- $[52] = t32;
301
- $[53] = t35;
302
- $[54] = t36;
438
+ $[50] = t29;
439
+ $[51] = t32;
440
+ $[52] = t35;
441
+ $[53] = t36;
303
442
  } else {
304
- t36 = $[54];
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
- let t38;
315
- if ($[55] === Symbol.for("react.memo_cache_sentinel")) {
316
- t38 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row text-surface-500", children: [
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
- $[55] = t38;
477
+ $[59] = t41;
321
478
  } else {
322
- t38 = $[55];
479
+ t41 = $[59];
323
480
  }
324
- const t39 = !isNewCollection;
325
- const t40 = showErrors && Boolean(errors.id);
326
- let t41;
327
- if ($[56] !== t39 || $[57] !== t40) {
328
- t41 = /* @__PURE__ */ jsx(Field, { name: "id", as: DebouncedTextField, disabled: t39, label: "Collection id", error: t40 });
329
- $[56] = t39;
330
- $[57] = t40;
331
- $[58] = t41;
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
- t41 = $[58];
490
+ t44 = $[62];
334
491
  }
335
- const t42 = touched.id && Boolean(errors.id);
336
- const t43 = touched.id && Boolean(errors.id) ? errors.id : "This id identifies this collection. Typically the same as the path.";
337
- let t44;
338
- if ($[59] !== t42 || $[60] !== t43) {
339
- t44 = /* @__PURE__ */ jsx(FieldCaption, { error: t42, children: t43 });
340
- $[59] = t42;
341
- $[60] = t43;
342
- $[61] = t44;
343
- } else {
344
- t44 = $[61];
345
- }
346
- let t45;
347
- if ($[62] !== t41 || $[63] !== t44) {
348
- t45 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
349
- t41,
350
- t44
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
- $[62] = t41;
353
- $[63] = t44;
354
- $[64] = t45;
509
+ $[66] = t44;
510
+ $[67] = t47;
511
+ $[68] = t48;
355
512
  } else {
356
- t45 = $[64];
513
+ t48 = $[68];
357
514
  }
358
- const t46 = showErrors && Boolean(errors.singularName);
359
- let t47;
360
- if ($[65] !== handleChange || $[66] !== setFieldTouched) {
361
- t47 = (e_0) => {
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
- $[65] = handleChange;
366
- $[66] = setFieldTouched;
367
- $[67] = t47;
522
+ $[69] = handleChange;
523
+ $[70] = setFieldTouched;
524
+ $[71] = t50;
368
525
  } else {
369
- t47 = $[67];
526
+ t50 = $[71];
370
527
  }
371
- const t48 = values.singularName ?? "";
372
- let t49;
373
- if ($[68] !== t46 || $[69] !== t47 || $[70] !== t48) {
374
- t49 = /* @__PURE__ */ jsx(TextField, { error: t46, name: "singularName", "aria-describedby": "singularName-helper", onChange: t47, value: t48, label: "Singular name" });
375
- $[68] = t46;
376
- $[69] = t47;
377
- $[70] = t48;
378
- $[71] = t49;
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
- t49 = $[71];
537
+ t52 = $[75];
381
538
  }
382
- const t50 = showErrors && Boolean(errors.singularName);
383
- const t51 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define a singular name for your entities";
384
- let t52;
385
- if ($[72] !== t50 || $[73] !== t51) {
386
- t52 = /* @__PURE__ */ jsx(FieldCaption, { error: t50, children: t51 });
387
- $[72] = t50;
388
- $[73] = t51;
389
- $[74] = t52;
390
- } else {
391
- t52 = $[74];
392
- }
393
- let t53;
394
- if ($[75] !== t49 || $[76] !== t52) {
395
- t53 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
396
- t49,
397
- t52
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
- $[75] = t49;
400
- $[76] = t52;
401
- $[77] = t53;
556
+ $[79] = t52;
557
+ $[80] = t55;
558
+ $[81] = t56;
402
559
  } else {
403
- t53 = $[77];
560
+ t56 = $[81];
404
561
  }
405
- const t54 = showErrors && Boolean(errors.sideDialogWidth);
406
- let t55;
407
- if ($[78] !== setFieldTouched || $[79] !== setFieldValue) {
408
- t55 = (e_1) => {
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 value = e_1.target.value;
411
- if (!value) {
567
+ const value_0 = e_1.target.value;
568
+ if (!value_0) {
412
569
  setFieldValue("sideDialogWidth", null);
413
570
  } else {
414
- if (!isNaN(Number(value))) {
415
- setFieldValue("sideDialogWidth", Number(value));
571
+ if (!isNaN(Number(value_0))) {
572
+ setFieldValue("sideDialogWidth", Number(value_0));
416
573
  }
417
574
  }
418
575
  };
419
- $[78] = setFieldTouched;
420
- $[79] = setFieldValue;
421
- $[80] = t55;
576
+ $[82] = setFieldTouched;
577
+ $[83] = setFieldValue;
578
+ $[84] = t58;
422
579
  } else {
423
- t55 = $[80];
580
+ t58 = $[84];
424
581
  }
425
- let t56;
426
- if ($[81] !== setFieldValue) {
427
- t56 = () => {
582
+ let t59;
583
+ if ($[85] !== setFieldValue) {
584
+ t59 = () => {
428
585
  setFieldValue("sideDialogWidth", null);
429
586
  };
430
- $[81] = setFieldValue;
431
- $[82] = t56;
587
+ $[85] = setFieldValue;
588
+ $[86] = t59;
432
589
  } else {
433
- t56 = $[82];
590
+ t59 = $[86];
434
591
  }
435
- const t57 = !values.sideDialogWidth;
436
- let t58;
437
- if ($[83] === Symbol.for("react.memo_cache_sentinel")) {
438
- t58 = /* @__PURE__ */ jsx(CloseIcon, { size: "small" });
439
- $[83] = t58;
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
- t58 = $[83];
598
+ t61 = $[87];
442
599
  }
443
- let t59;
444
- if ($[84] !== t56 || $[85] !== t57) {
445
- t59 = /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: t56, disabled: t57, children: t58 });
446
- $[84] = t56;
447
- $[85] = t57;
448
- $[86] = t59;
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
- t59 = $[86];
607
+ t62 = $[90];
451
608
  }
452
- const t60 = values.sideDialogWidth ?? "";
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] !== t62 || $[93] !== t63) {
468
- t64 = /* @__PURE__ */ jsx(FieldCaption, { error: t62, children: t63 });
469
- $[92] = t62;
470
- $[93] = t63;
471
- $[94] = t64;
472
- } else {
473
- t64 = $[94];
474
- }
475
- let t65;
476
- if ($[95] !== t61 || $[96] !== t64) {
477
- t65 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
478
- t61,
479
- t64
480
- ] });
481
- $[95] = t61;
482
- $[96] = t64;
483
- $[97] = t65;
484
- } else {
485
- t65 = $[97];
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 ($[98] !== handleChange || $[99] !== t66 || $[100] !== t67) {
491
- t68 = /* @__PURE__ */ jsx(TextField, { error: t66, name: "description", value: t67, onChange: handleChange, multiline: true, rows: 2, "aria-describedby": "description-helper-text", label: "Description" });
492
- $[98] = handleChange;
493
- $[99] = t66;
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 = showErrors && Boolean(errors.description) ? errors.description : "Description of the collection, you can use markdown";
645
+ const t70 = values.description ?? "";
501
646
  let t71;
502
- if ($[102] !== t69 || $[103] !== t70) {
503
- t71 = /* @__PURE__ */ jsx(FieldCaption, { error: t69, children: t70 });
504
- $[102] = t69;
505
- $[103] = t70;
506
- $[104] = t71;
507
- } else {
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
- t72 = $[107];
654
+ t71 = $[105];
521
655
  }
522
- const t73 = values.defaultSize ?? "";
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 ($[108] === Symbol.for("react.memo_cache_sentinel")) {
525
- t74 = ["xs", "s", "m", "l", "xl"].map(_temp2$7);
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] !== handleChange || $[110] !== t73) {
532
- t75 = /* @__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: t73, renderValue: _temp$b, children: t74 }) });
533
- $[109] = handleChange;
534
- $[110] = t73;
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 = customIdValue === "code_defined";
679
+ const t76 = values.defaultSize ?? "";
540
680
  let t77;
541
- if ($[112] !== setFieldValue) {
542
- t77 = (v) => {
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
- $[112] = setFieldValue;
560
- $[113] = t77;
716
+ $[116] = setFieldValue;
717
+ $[117] = t80;
561
718
  } else {
562
- t77 = $[113];
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
- if ($[121] !== setFieldValue) {
596
- t83 = (v_0) => setFieldValue("collectionGroup", v_0);
597
- $[121] = setFieldValue;
598
- $[122] = t83;
599
- } else {
600
- t83 = $[122];
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 ($[123] !== t83 || $[124] !== t84) {
605
- t85 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", label: "Collection group", onValueChange: t83, value: t84 });
606
- $[123] = t83;
607
- $[124] = t84;
608
- $[125] = t85;
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 = $[125];
749
+ t85 = $[124];
611
750
  }
612
751
  let t86;
613
- if ($[126] === Symbol.for("react.memo_cache_sentinel")) {
614
- t86 = /* @__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." });
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
- let t87;
620
- if ($[127] !== t85) {
621
- t87 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
622
- t85,
623
- t86
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
- t87 = $[128];
767
+ t88 = $[129];
629
768
  }
630
- let t88;
631
- if ($[129] !== setFieldValue) {
632
- t88 = (v_1) => setFieldValue("textSearchEnabled", v_1);
633
- $[129] = setFieldValue;
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
- t88 = $[130];
774
+ t89 = $[130];
637
775
  }
638
- const t89 = values.textSearchEnabled ?? false;
639
776
  let t90;
640
- if ($[131] !== t88 || $[132] !== t89) {
641
- t90 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", label: "Enable text search for this collection", onValueChange: t88, value: t89 });
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] = t89;
644
- $[133] = t90;
783
+ $[132] = t90;
645
784
  } else {
646
- t90 = $[133];
785
+ t90 = $[132];
647
786
  }
648
787
  let t91;
649
- if ($[134] === Symbol.for("react.memo_cache_sentinel")) {
650
- t91 = /* @__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." });
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
- let t92;
656
- if ($[135] !== t90) {
657
- t92 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
658
- t90,
659
- t91
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
- t92 = $[136];
803
+ t93 = $[137];
665
804
  }
666
- let t93;
667
- if ($[137] !== t45 || $[138] !== t53 || $[139] !== t65 || $[140] !== t72 || $[141] !== t75 || $[142] !== t82 || $[143] !== t87 || $[144] !== t92) {
668
- t93 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
669
- t45,
670
- t53,
671
- t65,
672
- t72,
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
- t82,
675
- t87,
676
- t92
830
+ t78,
831
+ t85,
832
+ t90,
833
+ t95
677
834
  ] });
678
- $[137] = t45;
679
- $[138] = t53;
680
- $[139] = t65;
681
- $[140] = t72;
682
- $[141] = t75;
683
- $[142] = t82;
684
- $[143] = t87;
685
- $[144] = t92;
686
- $[145] = t93;
687
- } else {
688
- t93 = $[145];
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 t94;
691
- if ($[146] !== advancedPanelExpanded || $[147] !== t93) {
692
- t94 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t38, initiallyExpanded: false, children: t93 }) });
693
- $[146] = advancedPanelExpanded;
694
- $[147] = t93;
695
- $[148] = t94;
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
- t94 = $[148];
854
+ t97 = $[152];
698
855
  }
699
- let t95;
700
- if ($[149] !== t27 || $[150] !== t36 || $[151] !== t37 || $[152] !== t94) {
701
- t95 = /* @__PURE__ */ jsxs("div", { className: t19, children: [
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
- t94
874
+ t40,
875
+ t98
706
876
  ] });
707
- $[149] = t27;
708
- $[150] = t36;
709
- $[151] = t37;
710
- $[152] = t94;
711
- $[153] = t95;
877
+ $[156] = t27;
878
+ $[157] = t36;
879
+ $[158] = t37;
880
+ $[159] = t40;
881
+ $[160] = t98;
882
+ $[161] = t99;
712
883
  } else {
713
- t95 = $[153];
884
+ t99 = $[161];
714
885
  }
715
- let t96;
716
- if ($[154] === Symbol.for("react.memo_cache_sentinel")) {
717
- t96 = /* @__PURE__ */ jsx("div", { style: {
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
- $[154] = t96;
891
+ $[162] = t100;
721
892
  } else {
722
- t96 = $[154];
893
+ t100 = $[162];
723
894
  }
724
- let t97;
725
- if ($[155] !== setFieldValue) {
726
- t97 = (icon) => {
895
+ let t101;
896
+ if ($[163] !== setFieldValue) {
897
+ t101 = (icon) => {
727
898
  setIconDialogOpen(false);
728
899
  setFieldValue("icon", icon);
729
900
  };
730
- $[155] = setFieldValue;
731
- $[156] = t97;
901
+ $[163] = setFieldValue;
902
+ $[164] = t101;
732
903
  } else {
733
- t97 = $[156];
904
+ t101 = $[164];
734
905
  }
735
- let t98;
736
- if ($[157] !== t97 || $[158] !== values.icon) {
737
- t98 = /* @__PURE__ */ jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsx(SearchIconsView, { selectedIcon: values.icon, onIconSelected: t97 }) });
738
- $[157] = t97;
739
- $[158] = values.icon;
740
- $[159] = t98;
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
- t98 = $[159];
913
+ t102 = $[167];
743
914
  }
744
- let t99;
745
- if ($[160] !== iconDialogOpen || $[161] !== t98) {
746
- t99 = /* @__PURE__ */ jsx(Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t98 });
747
- $[160] = iconDialogOpen;
748
- $[161] = t98;
749
- $[162] = t99;
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
- t99 = $[162];
922
+ t103 = $[170];
752
923
  }
753
- let t100;
754
- if ($[163] !== T0 || $[164] !== t18 || $[165] !== t95 || $[166] !== t99) {
755
- t100 = /* @__PURE__ */ jsx("div", { className: t7, children: /* @__PURE__ */ jsxs(T0, { maxWidth: t8, className: t9, children: [
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
- t95,
758
- t96,
759
- t99
928
+ t99,
929
+ t100,
930
+ t103
760
931
  ] }) });
761
- $[163] = T0;
762
- $[164] = t18;
763
- $[165] = t95;
764
- $[166] = t99;
765
- $[167] = t100;
932
+ $[171] = T0;
933
+ $[172] = t103;
934
+ $[173] = t18;
935
+ $[174] = t99;
936
+ $[175] = t104;
766
937
  } else {
767
- t100 = $[167];
938
+ t104 = $[175];
768
939
  }
769
- return t100;
940
+ return t104;
770
941
  }
771
- function _temp3$4(value_2) {
772
- if (value_2 === "code_defined") {
942
+ function _temp3$4(value_3) {
943
+ if (value_3 === "code_defined") {
773
944
  return "Code defined";
774
945
  } else {
775
- if (value_2 === "true") {
946
+ if (value_3 === "true") {
776
947
  return "Users must define an ID";
777
948
  } else {
778
- if (value_2 === "optional") {
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(value_1) {
787
- return /* @__PURE__ */ jsx(SelectItem, { value: value_1, children: value_1.toUpperCase() }, `size-select-${value_1}`);
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(value_0) {
790
- return value_0.toUpperCase();
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: "small" }) : /* @__PURE__ */ jsx(AutorenewIcon, {}),
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/customization_quickstart", children: "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
- if (inferredNewProperty) {
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.resolveAliasesFrom(updatedFullPath) : void 0;
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
- return /* @__PURE__ */ jsx(DialogContent, { fullHeight: true, children: /* @__PURE__ */ jsx(Formex, { value: formController, children: /* @__PURE__ */ jsxs(Fragment, { children: [
9211
- !isNewCollection && /* @__PURE__ */ jsxs(Tabs, { value: currentView, innerClassName: cls(defaultBorderMixin, "justify-end bg-surface-50 dark:bg-surface-950 border-b"), onValueChange: (v) => setCurrentView(v), children: [
9212
- /* @__PURE__ */ jsx(Tab, { value: "details", children: "Details" }),
9213
- /* @__PURE__ */ jsx(Tab, { value: "properties", children: "Properties" }),
9214
- /* @__PURE__ */ jsx(Tab, { value: "subcollections", children: "Additional views" })
9215
- ] }),
9216
- /* @__PURE__ */ jsxs("form", { noValidate: true, onSubmit: formController.handleSubmit, className: cls(isNewCollection ? "h-full" : "h-[calc(100%-48px)]", "flex-grow flex flex-col relative"), children: [
9217
- currentView === "loading" && /* @__PURE__ */ jsx(CircularProgressCenter, {}),
9218
- currentView === "extra_view" && path && extraView?.View && /* @__PURE__ */ jsx(extraView.View, { path }),
9219
- currentView === "welcome" && /* @__PURE__ */ jsx(CollectionEditorWelcomeView, { path, onContinue: (importData, propertiesOrder_0) => {
9220
- if (importData) {
9221
- onImportDataSet(importData, propertiesOrder_0);
9222
- setCurrentView("import_data_mapping");
9223
- } else {
9224
- setCurrentView("details");
9225
- }
9226
- }, existingCollectionPaths: existingPaths, parentCollection, pathSuggestions }),
9227
- currentView === "import_data_mapping" && importConfig && /* @__PURE__ */ jsx(CollectionEditorImportMapping, { importConfig, collectionEditable, propertyConfigs }),
9228
- currentView === "import_data_preview" && importConfig && /* @__PURE__ */ jsx(CollectionEditorImportDataPreview, { importConfig, properties: values_1.properties, propertiesOrder: values_1.propertiesOrder }),
9229
- currentView === "import_data_saving" && importConfig && /* @__PURE__ */ jsx(ImportSaveInProgress, { importConfig, collection: values_1, path, onImportSuccess: async (importedCollection) => {
9230
- snackbarController.open({
9231
- type: "info",
9232
- message: "Data imported successfully"
9233
- });
9234
- await saveCollection(values_1);
9235
- handleClose(importedCollection);
9236
- } }),
9237
- currentView === "details" && /* @__PURE__ */ jsx(CollectionDetailsForm, { existingPaths, existingIds, groups, parentCollectionIds, parentCollection, isNewCollection }),
9238
- currentView === "subcollections" && collection && /* @__PURE__ */ jsx(SubcollectionsEditTab, { parentCollection, configController, getUser, collectionInference, parentCollectionIds, collection }),
9239
- currentView === "properties" && /* @__PURE__ */ jsx(CollectionPropertiesEditorForm, { showErrors: submitCount > 0, isNewCollection, reservedGroups, onPropertyError: (propertyKey, namespace, error_0) => {
9240
- const current = removeUndefined({
9241
- ...propertyErrorsRef.current,
9242
- [getFullIdPath(propertyKey, namespace)]: removeUndefined(error_0, true)
9243
- }, true);
9244
- propertyErrorsRef.current = current;
9245
- formController.validate();
9246
- }, getUser, getData: getDataWithPath, doCollectionInference, propertyConfigs, collectionEditable, extraIcon: extraView?.icon && /* @__PURE__ */ jsx(IconButton, { color: "primary", onClick: () => setCurrentView("extra_view"), children: extraView.icon }) }),
9247
- currentView !== "welcome" && /* @__PURE__ */ jsxs(DialogActions, { position: "absolute", children: [
9248
- error && /* @__PURE__ */ jsx(ErrorView, { error }),
9249
- isNewCollection && includeTemplates && currentView === "import_data_mapping" && /* @__PURE__ */ jsxs(Button, { variant: "text", type: "button", onClick: () => {
9250
- importConfig.setInUse(false);
9251
- return setCurrentView("welcome");
9252
- }, children: [
9253
- /* @__PURE__ */ jsx(ArrowBackIcon, {}),
9254
- "Back"
9255
- ] }),
9256
- isNewCollection && includeTemplates && currentView === "import_data_preview" && /* @__PURE__ */ jsxs(Button, { variant: "text", type: "button", onClick: () => {
9257
- setCurrentView("import_data_mapping");
9258
- }, children: [
9259
- /* @__PURE__ */ jsx(ArrowBackIcon, {}),
9260
- "Back"
9261
- ] }),
9262
- isNewCollection && includeTemplates && currentView === "details" && /* @__PURE__ */ jsxs(Button, { variant: "text", type: "button", onClick: () => setCurrentView("welcome"), children: [
9263
- /* @__PURE__ */ jsx(ArrowBackIcon, {}),
9264
- "Back"
9265
- ] }),
9266
- isNewCollection && currentView === "properties" && /* @__PURE__ */ jsxs(Button, { variant: "text", type: "button", onClick: () => setCurrentView("details"), children: [
9267
- /* @__PURE__ */ jsx(ArrowBackIcon, {}),
9268
- "Back"
9269
- ] }),
9270
- /* @__PURE__ */ jsx(Button, { variant: "text", onClick: () => {
9271
- handleCancel();
9272
- }, children: "Cancel" }),
9273
- isNewCollection && currentView === "import_data_mapping" && /* @__PURE__ */ jsx(Button, { variant: "filled", color: "primary", onClick: onImportMappingComplete, children: "Next" }),
9274
- isNewCollection && currentView === "import_data_preview" && /* @__PURE__ */ jsx(Button, { variant: "filled", color: "primary", onClick: () => {
9275
- setNextMode();
9276
- }, children: "Next" }),
9277
- 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: [
9278
- currentView === "details" && "Next",
9279
- currentView === "properties" && "Create collection"
9280
- ] }),
9281
- !isNewCollection && /* @__PURE__ */ jsx(LoadingButton, { variant: "filled", color: "primary", type: "submit", loading: isSubmitting, children: "Update collection" })
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(68);
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] !== components || $[7] !== createCollection || $[8] !== editCollection || $[9] !== editProperty || $[10] !== getPathSuggestions || $[11] !== t4) {
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] = components;
9488
- $[7] = createCollection;
9489
- $[8] = editCollection;
9490
- $[9] = editProperty;
9491
- $[10] = getPathSuggestions;
9492
- $[11] = t4;
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 = $[12];
9687
+ t5 = $[11];
9496
9688
  }
9497
9689
  const t6 = Boolean(currentDialog);
9498
9690
  let t7;
9499
- if ($[13] !== currentDialog || $[14] !== navigate || $[15] !== navigation) {
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
- $[13] = currentDialog;
9510
- $[14] = navigate;
9511
- $[15] = navigation;
9512
- $[16] = t7;
9701
+ $[12] = currentDialog;
9702
+ $[13] = navigate;
9703
+ $[14] = navigation;
9704
+ $[15] = t7;
9513
9705
  } else {
9514
- t7 = $[16];
9706
+ t7 = $[15];
9515
9707
  }
9516
9708
  let t8;
9517
- if ($[17] !== collectionConfigController || $[18] !== collectionInference || $[19] !== currentDialog || $[20] !== extraView || $[21] !== getData || $[22] !== getPathSuggestions || $[23] !== getUser || $[24] !== reservedGroups || $[25] !== t6 || $[26] !== t7) {
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
- $[17] = collectionConfigController;
9520
- $[18] = collectionInference;
9521
- $[19] = currentDialog;
9522
- $[20] = extraView;
9523
- $[21] = getData;
9524
- $[22] = getPathSuggestions;
9525
- $[23] = getUser;
9526
- $[24] = reservedGroups;
9527
- $[25] = t6;
9528
- $[26] = t7;
9529
- $[27] = t8;
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 = $[27];
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 ($[28] !== currentPropertyDialog || $[29] !== getData || $[30] !== navigation) {
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.resolveAliasesFrom(currentPropertyDialog.editedCollectionId);
9734
+ const resolvedPath = navigation.resolveIdsFrom(currentPropertyDialog.editedCollectionId);
9543
9735
  return getData(resolvedPath, []);
9544
9736
  } : void 0;
9545
- $[28] = currentPropertyDialog;
9546
- $[29] = getData;
9547
- $[30] = navigation;
9548
- $[31] = t14;
9737
+ $[27] = currentPropertyDialog;
9738
+ $[28] = getData;
9739
+ $[29] = navigation;
9740
+ $[30] = t14;
9549
9741
  } else {
9550
- t14 = $[31];
9742
+ t14 = $[30];
9551
9743
  }
9552
9744
  let t15;
9553
- if ($[32] !== collectionConfigController || $[33] !== currentPropertyDialog || $[34] !== snackbarController) {
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
- $[32] = collectionConfigController;
9583
- $[33] = currentPropertyDialog;
9584
- $[34] = snackbarController;
9585
- $[35] = t15;
9774
+ $[31] = collectionConfigController;
9775
+ $[32] = currentPropertyDialog;
9776
+ $[33] = snackbarController;
9777
+ $[34] = t15;
9586
9778
  } else {
9587
- t15 = $[35];
9779
+ t15 = $[34];
9588
9780
  }
9589
9781
  let t16;
9590
- if ($[36] !== collectionConfigController || $[37] !== currentPropertyDialog?.currentPropertiesOrder || $[38] !== currentPropertyDialog?.editedCollectionId || $[39] !== currentPropertyDialog?.namespace || $[40] !== currentPropertyDialog?.parentCollectionIds || $[41] !== currentPropertyDialog?.propertyKey || $[42] !== snackbarController) {
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
- $[36] = collectionConfigController;
9614
- $[37] = currentPropertyDialog?.currentPropertiesOrder;
9615
- $[38] = currentPropertyDialog?.editedCollectionId;
9616
- $[39] = currentPropertyDialog?.namespace;
9617
- $[40] = currentPropertyDialog?.parentCollectionIds;
9618
- $[41] = currentPropertyDialog?.propertyKey;
9619
- $[42] = snackbarController;
9620
- $[43] = t16;
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 = $[43];
9814
+ t16 = $[42];
9623
9815
  }
9624
9816
  let t17;
9625
9817
  let t18;
9626
9818
  let t19;
9627
- if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
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
- $[44] = t17;
9636
- $[45] = t18;
9637
- $[46] = t19;
9827
+ $[43] = t17;
9828
+ $[44] = t18;
9829
+ $[45] = t19;
9638
9830
  } else {
9639
- t17 = $[44];
9640
- t18 = $[45];
9641
- t19 = $[46];
9831
+ t17 = $[43];
9832
+ t18 = $[44];
9833
+ t19 = $[45];
9642
9834
  }
9643
9835
  let t20;
9644
- if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
9836
+ if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
9645
9837
  t20 = [];
9646
- $[47] = t20;
9838
+ $[46] = t20;
9647
9839
  } else {
9648
- t20 = $[47];
9840
+ t20 = $[46];
9649
9841
  }
9650
9842
  const t21 = currentPropertyDialog?.property;
9651
9843
  const t22 = currentPropertyDialog?.propertyKey;
9652
9844
  let t23;
9653
- if ($[48] !== propertyConfigs || $[49] !== t10 || $[50] !== t11 || $[51] !== t12 || $[52] !== t13 || $[53] !== t14 || $[54] !== t15 || $[55] !== t16 || $[56] !== t21 || $[57] !== t22 || $[58] !== t9) {
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
- $[48] = propertyConfigs;
9656
- $[49] = t10;
9657
- $[50] = t11;
9658
- $[51] = t12;
9659
- $[52] = t13;
9660
- $[53] = t14;
9661
- $[54] = t15;
9662
- $[55] = t16;
9663
- $[56] = t21;
9664
- $[57] = t22;
9665
- $[58] = t9;
9666
- $[59] = t23;
9667
- } else {
9668
- t23 = $[59];
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 ($[60] !== children || $[61] !== t23 || $[62] !== t5 || $[63] !== t8) {
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
- $[60] = children;
9678
- $[61] = t23;
9679
- $[62] = t5;
9680
- $[63] = t8;
9681
- $[64] = t24;
9869
+ $[59] = children;
9870
+ $[60] = t23;
9871
+ $[61] = t5;
9872
+ $[62] = t8;
9873
+ $[63] = t24;
9682
9874
  } else {
9683
- t24 = $[64];
9875
+ t24 = $[63];
9684
9876
  }
9685
9877
  let t25;
9686
- if ($[65] !== collectionConfigController || $[66] !== t24) {
9878
+ if ($[64] !== collectionConfigController || $[65] !== t24) {
9687
9879
  t25 = /* @__PURE__ */ jsx(ConfigControllerContext.Provider, { value: collectionConfigController, children: t24 });
9688
- $[65] = collectionConfigController;
9689
- $[66] = t24;
9690
- $[67] = t25;
9880
+ $[64] = collectionConfigController;
9881
+ $[65] = t24;
9882
+ $[66] = t25;
9691
9883
  } else {
9692
- t25 = $[67];
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(16);
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] !== components || $[3] !== configPermissions || $[4] !== extraView || $[5] !== getData || $[6] !== getPathSuggestions || $[7] !== getUser || $[8] !== onAnalyticsEvent || $[9] !== reservedGroups) {
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] = components;
10340
- $[3] = configPermissions;
10341
- $[4] = extraView;
10342
- $[5] = getData;
10343
- $[6] = getPathSuggestions;
10344
- $[7] = getUser;
10345
- $[8] = onAnalyticsEvent;
10346
- $[9] = reservedGroups;
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 = $[10];
10538
+ t1 = $[9];
10350
10539
  }
10351
10540
  let t2;
10352
10541
  let t3;
10353
- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
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
- $[11] = t2;
10367
- $[12] = t3;
10555
+ $[10] = t2;
10556
+ $[11] = t3;
10368
10557
  } else {
10369
- t2 = $[11];
10370
- t3 = $[12];
10558
+ t2 = $[10];
10559
+ t3 = $[11];
10371
10560
  }
10372
10561
  let t4;
10373
- if ($[13] !== collectionConfigController.loading || $[14] !== t1) {
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
- $[13] = collectionConfigController.loading;
10382
- $[14] = t1;
10383
- $[15] = t4;
10570
+ $[12] = collectionConfigController.loading;
10571
+ $[13] = t1;
10572
+ $[14] = t4;
10384
10573
  } else {
10385
- t4 = $[15];
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
- const storedCollections = backendCollections ?? [];
10467
- storedCollections.forEach(markAsEditable);
10468
- console.debug("Collections specified in code:", baseCollections);
10469
- console.debug("Collections stored in the backend", storedCollections);
10470
- const result = joinCollectionLists(baseCollections, storedCollections, [], modifyCollection);
10471
- console.debug("Collections after joining:", result);
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) {