@firecms/collection_editor 3.0.0-beta.11 → 3.0.0-beta.13

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.umd.js CHANGED
@@ -28,13 +28,154 @@
28
28
  const useCollectionEditorController = () => {
29
29
  return React.useContext(CollectionEditorContext);
30
30
  };
31
+ function LayoutModeSwitch(t0) {
32
+ const $ = reactCompilerRuntime.c(29);
33
+ const {
34
+ value,
35
+ onChange,
36
+ className
37
+ } = t0;
38
+ let t1;
39
+ if ($[0] !== className) {
40
+ t1 = ui.cls(className);
41
+ $[0] = className;
42
+ $[1] = t1;
43
+ } else {
44
+ t1 = $[1];
45
+ }
46
+ let t2;
47
+ let t3;
48
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
49
+ t2 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "label", color: "secondary", className: "ml-3.5", children: "Document view" });
50
+ t3 = ui.cls("flex flex-row gap-4");
51
+ $[2] = t2;
52
+ $[3] = t3;
53
+ } else {
54
+ t2 = $[2];
55
+ t3 = $[3];
56
+ }
57
+ let t4;
58
+ if ($[4] !== onChange) {
59
+ t4 = () => onChange("side_panel");
60
+ $[4] = onChange;
61
+ $[5] = t4;
62
+ } else {
63
+ t4 = $[5];
64
+ }
65
+ const t5 = value === "side_panel" ? "border-primary dark:border-primary" : "border-surface-400 dark:border-surface-600";
66
+ let t6;
67
+ if ($[6] !== t5) {
68
+ t6 = ui.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);
69
+ $[6] = t5;
70
+ $[7] = t6;
71
+ } else {
72
+ t6 = $[7];
73
+ }
74
+ let t7;
75
+ let t8;
76
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
77
+ t7 = /* @__PURE__ */ jsxRuntime.jsx(ui.VerticalSplitIcon, {});
78
+ t8 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "label", children: "Side panel" });
79
+ $[8] = t7;
80
+ $[9] = t8;
81
+ } else {
82
+ t7 = $[8];
83
+ t8 = $[9];
84
+ }
85
+ let t9;
86
+ if ($[10] !== t4 || $[11] !== t6) {
87
+ t9 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Documents are open in a side panel", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { onClick: t4, className: t6, children: [
88
+ t7,
89
+ t8
90
+ ] }) });
91
+ $[10] = t4;
92
+ $[11] = t6;
93
+ $[12] = t9;
94
+ } else {
95
+ t9 = $[12];
96
+ }
97
+ let t10;
98
+ if ($[13] !== onChange) {
99
+ t10 = () => onChange("full_screen");
100
+ $[13] = onChange;
101
+ $[14] = t10;
102
+ } else {
103
+ t10 = $[14];
104
+ }
105
+ const t11 = value === "full_screen" ? "border-primary dark:border-primary" : "border-surface-400 dark:border-surface-600";
106
+ let t12;
107
+ if ($[15] !== t11) {
108
+ t12 = ui.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);
109
+ $[15] = t11;
110
+ $[16] = t12;
111
+ } else {
112
+ t12 = $[16];
113
+ }
114
+ let t13;
115
+ let t14;
116
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
117
+ t13 = /* @__PURE__ */ jsxRuntime.jsx(ui.SquareIcon, {});
118
+ t14 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "label", children: "Full screen" });
119
+ $[17] = t13;
120
+ $[18] = t14;
121
+ } else {
122
+ t13 = $[17];
123
+ t14 = $[18];
124
+ }
125
+ let t15;
126
+ if ($[19] !== t10 || $[20] !== t12) {
127
+ t15 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Documents are open full-screen", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { onClick: t10, className: t12, children: [
128
+ t13,
129
+ t14
130
+ ] }) });
131
+ $[19] = t10;
132
+ $[20] = t12;
133
+ $[21] = t15;
134
+ } else {
135
+ t15 = $[21];
136
+ }
137
+ let t16;
138
+ if ($[22] !== t15 || $[23] !== t9) {
139
+ t16 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t3, children: [
140
+ t9,
141
+ t15
142
+ ] });
143
+ $[22] = t15;
144
+ $[23] = t9;
145
+ $[24] = t16;
146
+ } else {
147
+ t16 = $[24];
148
+ }
149
+ let t17;
150
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
151
+ t17 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", color: "secondary", className: "ml-3.5", children: "Should documents be opened full screen or in an inline side dialog" });
152
+ $[25] = t17;
153
+ } else {
154
+ t17 = $[25];
155
+ }
156
+ let t18;
157
+ if ($[26] !== t1 || $[27] !== t16) {
158
+ t18 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t1, children: [
159
+ t2,
160
+ t16,
161
+ t17
162
+ ] });
163
+ $[26] = t1;
164
+ $[27] = t16;
165
+ $[28] = t18;
166
+ } else {
167
+ t18 = $[28];
168
+ }
169
+ return t18;
170
+ }
31
171
  function CollectionDetailsForm(t0) {
32
- const $ = reactCompilerRuntime.c(168);
172
+ const $ = reactCompilerRuntime.c(176);
33
173
  const {
34
174
  isNewCollection,
35
175
  reservedGroups,
36
176
  groups,
37
- parentCollection
177
+ parentCollection,
178
+ children
38
179
  } = t0;
39
180
  const groupRef = React.useRef(null);
40
181
  const {
@@ -47,7 +188,7 @@
47
188
  isSubmitting,
48
189
  submitCount
49
190
  } = formex.useFormex();
50
- const collectionEditor = useCollectionEditorController();
191
+ useCollectionEditorController();
51
192
  const [iconDialogOpen, setIconDialogOpen] = React.useState(false);
52
193
  const [advancedPanelExpanded, setAdvancedPanelExpanded] = React.useState(false);
53
194
  let t1;
@@ -103,7 +244,6 @@
103
244
  t4 = $[8];
104
245
  }
105
246
  React.useEffect(t3, t4);
106
- const DatabaseField = collectionEditor.components?.DatabaseField ?? DefaultDatabaseField;
107
247
  let t5;
108
248
  if ($[9] !== values) {
109
249
  t5 = /* @__PURE__ */ jsxRuntime.jsx(core.IconForView, { collectionOrView: values });
@@ -161,154 +301,153 @@
161
301
  t12 = $[14];
162
302
  }
163
303
  let t13;
164
- if ($[15] !== DatabaseField || $[16] !== updateDatabaseId || $[17] !== values.databaseId) {
165
- t13 = /* @__PURE__ */ jsxRuntime.jsx(DatabaseField, { databaseId: values.databaseId, onDatabaseIdUpdate: updateDatabaseId });
166
- $[15] = DatabaseField;
167
- $[16] = updateDatabaseId;
168
- $[17] = values.databaseId;
169
- $[18] = t13;
304
+ if ($[15] !== updateDatabaseId || $[16] !== values.databaseId) {
305
+ t13 = /* @__PURE__ */ jsxRuntime.jsx(DefaultDatabaseField, { databaseId: values.databaseId, onDatabaseIdUpdate: updateDatabaseId });
306
+ $[15] = updateDatabaseId;
307
+ $[16] = values.databaseId;
308
+ $[17] = t13;
170
309
  } else {
171
- t13 = $[18];
310
+ t13 = $[17];
172
311
  }
173
312
  let t14;
174
- if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
313
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
175
314
  t14 = () => setIconDialogOpen(true);
176
- $[19] = t14;
315
+ $[18] = t14;
177
316
  } else {
178
- t14 = $[19];
317
+ t14 = $[18];
179
318
  }
180
319
  let t15;
181
- if ($[20] !== collectionIcon) {
320
+ if ($[19] !== collectionIcon) {
182
321
  t15 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Change icon", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { shape: "square", onClick: t14, children: collectionIcon }) });
183
- $[20] = collectionIcon;
184
- $[21] = t15;
322
+ $[19] = collectionIcon;
323
+ $[20] = t15;
185
324
  } else {
186
- t15 = $[21];
325
+ t15 = $[20];
187
326
  }
188
327
  let t16;
189
- if ($[22] !== t12 || $[23] !== t13 || $[24] !== t15) {
328
+ if ($[21] !== t12 || $[22] !== t13 || $[23] !== t15) {
190
329
  t16 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row gap-2 py-2 pt-3 items-center", children: [
191
330
  t12,
192
331
  t13,
193
332
  t15
194
333
  ] });
195
- $[22] = t12;
196
- $[23] = t13;
197
- $[24] = t15;
198
- $[25] = t16;
334
+ $[21] = t12;
335
+ $[22] = t13;
336
+ $[23] = t15;
337
+ $[24] = t16;
199
338
  } else {
200
- t16 = $[25];
339
+ t16 = $[24];
201
340
  }
202
341
  let t17;
203
- if ($[26] !== parentCollection) {
342
+ if ($[25] !== parentCollection) {
204
343
  t17 = parentCollection && /* @__PURE__ */ jsxRuntime.jsx(ui.Chip, { colorScheme: "tealDarker", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "caption", children: [
205
344
  "This is a subcollection of ",
206
345
  /* @__PURE__ */ jsxRuntime.jsx("b", { children: parentCollection.name })
207
346
  ] }) });
208
- $[26] = parentCollection;
209
- $[27] = t17;
347
+ $[25] = parentCollection;
348
+ $[26] = t17;
210
349
  } else {
211
- t17 = $[27];
350
+ t17 = $[26];
212
351
  }
213
352
  let t18;
214
- if ($[28] !== t16 || $[29] !== t17) {
353
+ if ($[27] !== t16 || $[28] !== t17) {
215
354
  t18 = /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
216
355
  t16,
217
356
  t17
218
357
  ] });
219
- $[28] = t16;
220
- $[29] = t17;
221
- $[30] = t18;
358
+ $[27] = t16;
359
+ $[28] = t17;
360
+ $[29] = t18;
222
361
  } else {
223
- t18 = $[30];
362
+ t18 = $[29];
224
363
  }
225
364
  const t19 = "grid grid-cols-12 gap-4";
226
365
  const t20 = values.name ?? "";
227
366
  let t21;
228
- if ($[31] !== updateName) {
367
+ if ($[30] !== updateName) {
229
368
  t21 = (e) => updateName(e.target.value);
230
- $[31] = updateName;
231
- $[32] = t21;
369
+ $[30] = updateName;
370
+ $[31] = t21;
232
371
  } else {
233
- t21 = $[32];
372
+ t21 = $[31];
234
373
  }
235
374
  const t22 = showErrors && Boolean(errors.name);
236
375
  let t23;
237
- if ($[33] !== t20 || $[34] !== t21 || $[35] !== t22) {
376
+ if ($[32] !== t20 || $[33] !== t21 || $[34] !== t22) {
238
377
  t23 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { value: t20, onChange: t21, label: "Name", autoFocus: true, required: true, error: t22 });
239
- $[33] = t20;
240
- $[34] = t21;
241
- $[35] = t22;
242
- $[36] = t23;
378
+ $[32] = t20;
379
+ $[33] = t21;
380
+ $[34] = t22;
381
+ $[35] = t23;
243
382
  } else {
244
- t23 = $[36];
383
+ t23 = $[35];
245
384
  }
246
385
  const t24 = touched.name && Boolean(errors.name);
247
386
  const t25 = touched.name && Boolean(errors.name) ? errors.name : "Name of this collection, usually a plural name (e.g. Products)";
248
387
  let t26;
249
- if ($[37] !== t24 || $[38] !== t25) {
388
+ if ($[36] !== t24 || $[37] !== t25) {
250
389
  t26 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t24, children: t25 });
251
- $[37] = t24;
252
- $[38] = t25;
253
- $[39] = t26;
390
+ $[36] = t24;
391
+ $[37] = t25;
392
+ $[38] = t26;
254
393
  } else {
255
- t26 = $[39];
394
+ t26 = $[38];
256
395
  }
257
396
  let t27;
258
- if ($[40] !== t23 || $[41] !== t26) {
397
+ if ($[39] !== t23 || $[40] !== t26) {
259
398
  t27 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
260
399
  t23,
261
400
  t26
262
401
  ] });
263
- $[40] = t23;
264
- $[41] = t26;
265
- $[42] = t27;
402
+ $[39] = t23;
403
+ $[40] = t26;
404
+ $[41] = t27;
266
405
  } else {
267
- t27 = $[42];
406
+ t27 = $[41];
268
407
  }
269
408
  const t28 = isSubcollection ? "" : "sm:col-span-8";
270
409
  let t29;
271
- if ($[43] !== t28) {
410
+ if ($[42] !== t28) {
272
411
  t29 = ui.cls("col-span-12 ", t28);
273
- $[43] = t28;
274
- $[44] = t29;
412
+ $[42] = t28;
413
+ $[43] = t29;
275
414
  } else {
276
- t29 = $[44];
415
+ t29 = $[43];
277
416
  }
278
417
  const t30 = !isNewCollection;
279
418
  const t31 = showErrors && Boolean(errors.path);
280
419
  let t32;
281
- if ($[45] !== t30 || $[46] !== t31) {
420
+ if ($[44] !== t30 || $[45] !== t31) {
282
421
  t32 = /* @__PURE__ */ jsxRuntime.jsx(formex.Field, { name: "path", as: ui.DebouncedTextField, label: "Path", disabled: t30, required: true, error: t31 });
283
- $[45] = t30;
284
- $[46] = t31;
285
- $[47] = t32;
422
+ $[44] = t30;
423
+ $[45] = t31;
424
+ $[46] = t32;
286
425
  } else {
287
- t32 = $[47];
426
+ t32 = $[46];
288
427
  }
289
428
  const t33 = touched.path && Boolean(errors.path);
290
429
  const t34 = touched.path && Boolean(errors.path) ? errors.path : isSubcollection ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database";
291
430
  let t35;
292
- if ($[48] !== t33 || $[49] !== t34) {
431
+ if ($[47] !== t33 || $[48] !== t34) {
293
432
  t35 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t33, children: t34 });
294
- $[48] = t33;
295
- $[49] = t34;
296
- $[50] = t35;
433
+ $[47] = t33;
434
+ $[48] = t34;
435
+ $[49] = t35;
297
436
  } else {
298
- t35 = $[50];
437
+ t35 = $[49];
299
438
  }
300
439
  let t36;
301
- if ($[51] !== t29 || $[52] !== t32 || $[53] !== t35) {
440
+ if ($[50] !== t29 || $[51] !== t32 || $[52] !== t35) {
302
441
  t36 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t29, children: [
303
442
  t32,
304
443
  t35
305
444
  ] });
306
- $[51] = t29;
307
- $[52] = t32;
308
- $[53] = t35;
309
- $[54] = t36;
445
+ $[50] = t29;
446
+ $[51] = t32;
447
+ $[52] = t35;
448
+ $[53] = t36;
310
449
  } else {
311
- t36 = $[54];
450
+ t36 = $[53];
312
451
  }
313
452
  const t37 = !isSubcollection && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12 sm:col-span-4 relative", children: [
314
453
  /* @__PURE__ */ jsxRuntime.jsx(ui.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" }),
@@ -318,471 +457,492 @@
318
457
  }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-grow", children: group_0 }) }, index + "_" + group_0)) }),
319
458
  /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: showErrors && Boolean(errors.group) ? errors.group : "Group in the home page" })
320
459
  ] });
321
- let t38;
322
- if ($[55] === Symbol.for("react.memo_cache_sentinel")) {
323
- t38 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row text-surface-500", children: [
460
+ const t38 = values.openEntityMode ?? "side_panel";
461
+ let t39;
462
+ if ($[54] !== setFieldValue) {
463
+ t39 = (value) => setFieldValue("openEntityMode", value);
464
+ $[54] = setFieldValue;
465
+ $[55] = t39;
466
+ } else {
467
+ t39 = $[55];
468
+ }
469
+ let t40;
470
+ if ($[56] !== t38 || $[57] !== t39) {
471
+ t40 = /* @__PURE__ */ jsxRuntime.jsx(LayoutModeSwitch, { className: "col-span-12", value: t38, onChange: t39 });
472
+ $[56] = t38;
473
+ $[57] = t39;
474
+ $[58] = t40;
475
+ } else {
476
+ t40 = $[58];
477
+ }
478
+ let t41;
479
+ if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
480
+ t41 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row text-surface-500", children: [
324
481
  /* @__PURE__ */ jsxRuntime.jsx(ui.SettingsIcon, {}),
325
482
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "ml-2", children: "Advanced" })
326
483
  ] });
327
- $[55] = t38;
484
+ $[59] = t41;
328
485
  } else {
329
- t38 = $[55];
486
+ t41 = $[59];
330
487
  }
331
- const t39 = !isNewCollection;
332
- const t40 = showErrors && Boolean(errors.id);
333
- let t41;
334
- if ($[56] !== t39 || $[57] !== t40) {
335
- t41 = /* @__PURE__ */ jsxRuntime.jsx(formex.Field, { name: "id", as: ui.DebouncedTextField, disabled: t39, label: "Collection id", error: t40 });
336
- $[56] = t39;
337
- $[57] = t40;
338
- $[58] = t41;
488
+ const t42 = !isNewCollection;
489
+ const t43 = showErrors && Boolean(errors.id);
490
+ let t44;
491
+ if ($[60] !== t42 || $[61] !== t43) {
492
+ t44 = /* @__PURE__ */ jsxRuntime.jsx(formex.Field, { name: "id", as: ui.DebouncedTextField, disabled: t42, label: "Collection id", error: t43 });
493
+ $[60] = t42;
494
+ $[61] = t43;
495
+ $[62] = t44;
339
496
  } else {
340
- t41 = $[58];
497
+ t44 = $[62];
341
498
  }
342
- const t42 = touched.id && Boolean(errors.id);
343
- const t43 = touched.id && Boolean(errors.id) ? errors.id : "This id identifies this collection. Typically the same as the path.";
344
- let t44;
345
- if ($[59] !== t42 || $[60] !== t43) {
346
- t44 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t42, children: t43 });
347
- $[59] = t42;
348
- $[60] = t43;
349
- $[61] = t44;
350
- } else {
351
- t44 = $[61];
352
- }
353
- let t45;
354
- if ($[62] !== t41 || $[63] !== t44) {
355
- t45 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
356
- t41,
357
- t44
499
+ const t45 = touched.id && Boolean(errors.id);
500
+ const t46 = touched.id && Boolean(errors.id) ? errors.id : "This id identifies this collection. Typically the same as the path.";
501
+ let t47;
502
+ if ($[63] !== t45 || $[64] !== t46) {
503
+ t47 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t45, children: t46 });
504
+ $[63] = t45;
505
+ $[64] = t46;
506
+ $[65] = t47;
507
+ } else {
508
+ t47 = $[65];
509
+ }
510
+ let t48;
511
+ if ($[66] !== t44 || $[67] !== t47) {
512
+ t48 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
513
+ t44,
514
+ t47
358
515
  ] });
359
- $[62] = t41;
360
- $[63] = t44;
361
- $[64] = t45;
516
+ $[66] = t44;
517
+ $[67] = t47;
518
+ $[68] = t48;
362
519
  } else {
363
- t45 = $[64];
520
+ t48 = $[68];
364
521
  }
365
- const t46 = showErrors && Boolean(errors.singularName);
366
- let t47;
367
- if ($[65] !== handleChange || $[66] !== setFieldTouched) {
368
- t47 = (e_0) => {
522
+ const t49 = showErrors && Boolean(errors.singularName);
523
+ let t50;
524
+ if ($[69] !== handleChange || $[70] !== setFieldTouched) {
525
+ t50 = (e_0) => {
369
526
  setFieldTouched("singularName", true);
370
527
  return handleChange(e_0);
371
528
  };
372
- $[65] = handleChange;
373
- $[66] = setFieldTouched;
374
- $[67] = t47;
529
+ $[69] = handleChange;
530
+ $[70] = setFieldTouched;
531
+ $[71] = t50;
375
532
  } else {
376
- t47 = $[67];
533
+ t50 = $[71];
377
534
  }
378
- const t48 = values.singularName ?? "";
379
- let t49;
380
- if ($[68] !== t46 || $[69] !== t47 || $[70] !== t48) {
381
- t49 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { error: t46, name: "singularName", "aria-describedby": "singularName-helper", onChange: t47, value: t48, label: "Singular name" });
382
- $[68] = t46;
383
- $[69] = t47;
384
- $[70] = t48;
385
- $[71] = t49;
535
+ const t51 = values.singularName ?? "";
536
+ let t52;
537
+ if ($[72] !== t49 || $[73] !== t50 || $[74] !== t51) {
538
+ t52 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { error: t49, name: "singularName", "aria-describedby": "singularName-helper", onChange: t50, value: t51, label: "Singular name" });
539
+ $[72] = t49;
540
+ $[73] = t50;
541
+ $[74] = t51;
542
+ $[75] = t52;
386
543
  } else {
387
- t49 = $[71];
544
+ t52 = $[75];
388
545
  }
389
- const t50 = showErrors && Boolean(errors.singularName);
390
- const t51 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define a singular name for your entities";
391
- let t52;
392
- if ($[72] !== t50 || $[73] !== t51) {
393
- t52 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t50, children: t51 });
394
- $[72] = t50;
395
- $[73] = t51;
396
- $[74] = t52;
397
- } else {
398
- t52 = $[74];
399
- }
400
- let t53;
401
- if ($[75] !== t49 || $[76] !== t52) {
402
- t53 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
403
- t49,
404
- t52
546
+ const t53 = showErrors && Boolean(errors.singularName);
547
+ const t54 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define a singular name for your entities";
548
+ let t55;
549
+ if ($[76] !== t53 || $[77] !== t54) {
550
+ t55 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t53, children: t54 });
551
+ $[76] = t53;
552
+ $[77] = t54;
553
+ $[78] = t55;
554
+ } else {
555
+ t55 = $[78];
556
+ }
557
+ let t56;
558
+ if ($[79] !== t52 || $[80] !== t55) {
559
+ t56 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
560
+ t52,
561
+ t55
405
562
  ] });
406
- $[75] = t49;
407
- $[76] = t52;
408
- $[77] = t53;
563
+ $[79] = t52;
564
+ $[80] = t55;
565
+ $[81] = t56;
409
566
  } else {
410
- t53 = $[77];
567
+ t56 = $[81];
411
568
  }
412
- const t54 = showErrors && Boolean(errors.sideDialogWidth);
413
- let t55;
414
- if ($[78] !== setFieldTouched || $[79] !== setFieldValue) {
415
- t55 = (e_1) => {
569
+ const t57 = showErrors && Boolean(errors.sideDialogWidth);
570
+ let t58;
571
+ if ($[82] !== setFieldTouched || $[83] !== setFieldValue) {
572
+ t58 = (e_1) => {
416
573
  setFieldTouched("sideDialogWidth", true);
417
- const value = e_1.target.value;
418
- if (!value) {
574
+ const value_0 = e_1.target.value;
575
+ if (!value_0) {
419
576
  setFieldValue("sideDialogWidth", null);
420
577
  } else {
421
- if (!isNaN(Number(value))) {
422
- setFieldValue("sideDialogWidth", Number(value));
578
+ if (!isNaN(Number(value_0))) {
579
+ setFieldValue("sideDialogWidth", Number(value_0));
423
580
  }
424
581
  }
425
582
  };
426
- $[78] = setFieldTouched;
427
- $[79] = setFieldValue;
428
- $[80] = t55;
583
+ $[82] = setFieldTouched;
584
+ $[83] = setFieldValue;
585
+ $[84] = t58;
429
586
  } else {
430
- t55 = $[80];
587
+ t58 = $[84];
431
588
  }
432
- let t56;
433
- if ($[81] !== setFieldValue) {
434
- t56 = () => {
589
+ let t59;
590
+ if ($[85] !== setFieldValue) {
591
+ t59 = () => {
435
592
  setFieldValue("sideDialogWidth", null);
436
593
  };
437
- $[81] = setFieldValue;
438
- $[82] = t56;
594
+ $[85] = setFieldValue;
595
+ $[86] = t59;
439
596
  } else {
440
- t56 = $[82];
597
+ t59 = $[86];
441
598
  }
442
- const t57 = !values.sideDialogWidth;
443
- let t58;
444
- if ($[83] === Symbol.for("react.memo_cache_sentinel")) {
445
- t58 = /* @__PURE__ */ jsxRuntime.jsx(ui.CloseIcon, { size: "small" });
446
- $[83] = t58;
599
+ const t60 = !values.sideDialogWidth;
600
+ let t61;
601
+ if ($[87] === Symbol.for("react.memo_cache_sentinel")) {
602
+ t61 = /* @__PURE__ */ jsxRuntime.jsx(ui.CloseIcon, { size: "small" });
603
+ $[87] = t61;
447
604
  } else {
448
- t58 = $[83];
605
+ t61 = $[87];
449
606
  }
450
- let t59;
451
- if ($[84] !== t56 || $[85] !== t57) {
452
- t59 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: t56, disabled: t57, children: t58 });
453
- $[84] = t56;
454
- $[85] = t57;
455
- $[86] = t59;
607
+ let t62;
608
+ if ($[88] !== t59 || $[89] !== t60) {
609
+ t62 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: t59, disabled: t60, children: t61 });
610
+ $[88] = t59;
611
+ $[89] = t60;
612
+ $[90] = t62;
456
613
  } else {
457
- t59 = $[86];
614
+ t62 = $[90];
458
615
  }
459
- const t60 = values.sideDialogWidth ?? "";
460
- let t61;
461
- if ($[87] !== t54 || $[88] !== t55 || $[89] !== t59 || $[90] !== t60) {
462
- t61 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { error: t54, name: "sideDialogWidth", type: "number", "aria-describedby": "sideDialogWidth-helper", onChange: t55, endAdornment: t59, value: t60, label: "Side dialog width" });
463
- $[87] = t54;
464
- $[88] = t55;
465
- $[89] = t59;
466
- $[90] = t60;
467
- $[91] = t61;
468
- } else {
469
- t61 = $[91];
470
- }
471
- const t62 = showErrors && Boolean(errors.singularName);
472
- const t63 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px";
616
+ const t63 = values.sideDialogWidth ?? "";
473
617
  let t64;
474
- if ($[92] !== t62 || $[93] !== t63) {
475
- t64 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t62, children: t63 });
476
- $[92] = t62;
477
- $[93] = t63;
478
- $[94] = t64;
479
- } else {
480
- t64 = $[94];
481
- }
482
- let t65;
483
- if ($[95] !== t61 || $[96] !== t64) {
484
- t65 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
485
- t61,
486
- t64
487
- ] });
488
- $[95] = t61;
489
- $[96] = t64;
490
- $[97] = t65;
491
- } else {
492
- t65 = $[97];
618
+ if ($[91] !== t57 || $[92] !== t58 || $[93] !== t62 || $[94] !== t63) {
619
+ t64 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { error: t57, name: "sideDialogWidth", type: "number", "aria-describedby": "sideDialogWidth-helper", onChange: t58, endAdornment: t62, value: t63, label: "Side dialog width" });
620
+ $[91] = t57;
621
+ $[92] = t58;
622
+ $[93] = t62;
623
+ $[94] = t63;
624
+ $[95] = t64;
625
+ } else {
626
+ t64 = $[95];
627
+ }
628
+ const t65 = showErrors && Boolean(errors.singularName);
629
+ const t66 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px";
630
+ let t67;
631
+ if ($[96] !== t65 || $[97] !== t66) {
632
+ t67 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t65, children: t66 });
633
+ $[96] = t65;
634
+ $[97] = t66;
635
+ $[98] = t67;
636
+ } else {
637
+ t67 = $[98];
493
638
  }
494
- const t66 = showErrors && Boolean(errors.description);
495
- const t67 = values.description ?? "";
496
639
  let t68;
497
- if ($[98] !== handleChange || $[99] !== t66 || $[100] !== t67) {
498
- t68 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { error: t66, name: "description", value: t67, onChange: handleChange, multiline: true, rows: 2, "aria-describedby": "description-helper-text", label: "Description" });
499
- $[98] = handleChange;
500
- $[99] = t66;
640
+ if ($[99] !== t64 || $[100] !== t67) {
641
+ t68 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
642
+ t64,
643
+ t67
644
+ ] });
645
+ $[99] = t64;
501
646
  $[100] = t67;
502
647
  $[101] = t68;
503
648
  } else {
504
649
  t68 = $[101];
505
650
  }
506
651
  const t69 = showErrors && Boolean(errors.description);
507
- const t70 = showErrors && Boolean(errors.description) ? errors.description : "Description of the collection, you can use markdown";
652
+ const t70 = values.description ?? "";
508
653
  let t71;
509
- if ($[102] !== t69 || $[103] !== t70) {
510
- t71 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t69, children: t70 });
511
- $[102] = t69;
512
- $[103] = t70;
513
- $[104] = t71;
514
- } else {
515
- t71 = $[104];
516
- }
517
- let t72;
518
- if ($[105] !== t68 || $[106] !== t71) {
519
- t72 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
520
- t68,
521
- t71
522
- ] });
523
- $[105] = t68;
524
- $[106] = t71;
525
- $[107] = t72;
654
+ if ($[102] !== handleChange || $[103] !== t69 || $[104] !== t70) {
655
+ t71 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { error: t69, name: "description", value: t70, onChange: handleChange, multiline: true, minRows: 2, "aria-describedby": "description-helper-text", label: "Description" });
656
+ $[102] = handleChange;
657
+ $[103] = t69;
658
+ $[104] = t70;
659
+ $[105] = t71;
526
660
  } else {
527
- t72 = $[107];
661
+ t71 = $[105];
528
662
  }
529
- const t73 = values.defaultSize ?? "";
663
+ const t72 = showErrors && Boolean(errors.description);
664
+ const t73 = showErrors && Boolean(errors.description) ? errors.description : "Description of the collection, you can use markdown";
530
665
  let t74;
531
- if ($[108] === Symbol.for("react.memo_cache_sentinel")) {
532
- t74 = ["xs", "s", "m", "l", "xl"].map(_temp2$7);
666
+ if ($[106] !== t72 || $[107] !== t73) {
667
+ t74 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t72, children: t73 });
668
+ $[106] = t72;
669
+ $[107] = t73;
533
670
  $[108] = t74;
534
671
  } else {
535
672
  t74 = $[108];
536
673
  }
537
674
  let t75;
538
- if ($[109] !== handleChange || $[110] !== t73) {
539
- t75 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { name: "defaultSize", size: "large", fullWidth: true, label: "Default row size", position: "item-aligned", onChange: handleChange, value: t73, renderValue: _temp$b, children: t74 }) });
540
- $[109] = handleChange;
541
- $[110] = t73;
675
+ if ($[109] !== t71 || $[110] !== t74) {
676
+ t75 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
677
+ t71,
678
+ t74
679
+ ] });
680
+ $[109] = t71;
681
+ $[110] = t74;
542
682
  $[111] = t75;
543
683
  } else {
544
684
  t75 = $[111];
545
685
  }
546
- const t76 = customIdValue === "code_defined";
686
+ const t76 = values.defaultSize ?? "";
547
687
  let t77;
548
- if ($[112] !== setFieldValue) {
549
- t77 = (v) => {
688
+ if ($[112] === Symbol.for("react.memo_cache_sentinel")) {
689
+ t77 = ["xs", "s", "m", "l", "xl"].map(_temp2$7);
690
+ $[112] = t77;
691
+ } else {
692
+ t77 = $[112];
693
+ }
694
+ let t78;
695
+ if ($[113] !== handleChange || $[114] !== t76) {
696
+ t78 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { name: "defaultSize", size: "large", fullWidth: true, label: "Default row size", position: "item-aligned", onChange: handleChange, value: t76, renderValue: _temp$b, children: t77 }) });
697
+ $[113] = handleChange;
698
+ $[114] = t76;
699
+ $[115] = t78;
700
+ } else {
701
+ t78 = $[115];
702
+ }
703
+ const t79 = customIdValue === "code_defined";
704
+ let t80;
705
+ if ($[116] !== setFieldValue) {
706
+ t80 = (v) => {
550
707
  if (v === "code_defined") {
551
708
  throw new Error("This should not happen");
552
- } else {
553
- if (v === "true") {
554
- setFieldValue("customId", true);
555
- } else {
556
- if (v === "false") {
557
- setFieldValue("customId", false);
558
- } else {
559
- if (v === "optional") {
560
- setFieldValue("customId", "optional");
561
- }
562
- }
563
- }
564
709
  }
710
+ setFieldValue("customId", v);
565
711
  };
566
- $[112] = setFieldValue;
567
- $[113] = t77;
712
+ $[116] = setFieldValue;
713
+ $[117] = t80;
568
714
  } else {
569
- t77 = $[113];
570
- }
571
- const t78 = customIdValue ?? "";
572
- let t79;
573
- let t80;
574
- let t81;
575
- if ($[114] === Symbol.for("react.memo_cache_sentinel")) {
576
- t79 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "false", children: "Document ID is generated automatically" });
577
- t80 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "true", children: "Users must define an ID" });
578
- t81 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
579
- $[114] = t79;
580
- $[115] = t80;
581
- $[116] = t81;
582
- } else {
583
- t79 = $[114];
584
- t80 = $[115];
585
- t81 = $[116];
715
+ t80 = $[117];
586
716
  }
717
+ const t81 = customIdValue ?? "";
587
718
  let t82;
588
- if ($[117] !== t76 || $[118] !== t77 || $[119] !== t78) {
589
- t82 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { name: "customId", label: "Document IDs generation", position: "item-aligned", size: "large", fullWidth: true, disabled: t76, onValueChange: t77, value: t78, renderValue: _temp3$4, children: [
590
- t79,
591
- t80,
592
- t81
593
- ] }) });
594
- $[117] = t76;
595
- $[118] = t77;
596
- $[119] = t78;
597
- $[120] = t82;
598
- } else {
599
- t82 = $[120];
600
- }
601
719
  let t83;
602
- if ($[121] !== setFieldValue) {
603
- t83 = (v_0) => setFieldValue("collectionGroup", v_0);
604
- $[121] = setFieldValue;
605
- $[122] = t83;
606
- } else {
607
- t83 = $[122];
720
+ let t84;
721
+ if ($[118] === Symbol.for("react.memo_cache_sentinel")) {
722
+ t82 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "false", children: "Document ID is generated automatically" });
723
+ t83 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "true", children: "Users must define an ID" });
724
+ t84 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
725
+ $[118] = t82;
726
+ $[119] = t83;
727
+ $[120] = t84;
728
+ } else {
729
+ t82 = $[118];
730
+ t83 = $[119];
731
+ t84 = $[120];
608
732
  }
609
- const t84 = values.collectionGroup ?? false;
610
733
  let t85;
611
- if ($[123] !== t83 || $[124] !== t84) {
612
- t85 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", label: "Collection group", onValueChange: t83, value: t84 });
613
- $[123] = t83;
614
- $[124] = t84;
615
- $[125] = t85;
734
+ if ($[121] !== t79 || $[122] !== t80 || $[123] !== t81) {
735
+ t85 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { name: "customId", label: "Document IDs generation", position: "item-aligned", size: "large", fullWidth: true, disabled: t79, onValueChange: t80, value: t81, renderValue: _temp3$4, children: [
736
+ t82,
737
+ t83,
738
+ t84
739
+ ] }) });
740
+ $[121] = t79;
741
+ $[122] = t80;
742
+ $[123] = t81;
743
+ $[124] = t85;
616
744
  } else {
617
- t85 = $[125];
745
+ t85 = $[124];
618
746
  }
619
747
  let t86;
620
- if ($[126] === Symbol.for("react.memo_cache_sentinel")) {
621
- t86 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." });
748
+ if ($[125] !== setFieldValue) {
749
+ t86 = (v_0) => setFieldValue("collectionGroup", v_0);
750
+ $[125] = setFieldValue;
622
751
  $[126] = t86;
623
752
  } else {
624
753
  t86 = $[126];
625
754
  }
626
- let t87;
627
- if ($[127] !== t85) {
628
- t87 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
629
- t85,
630
- t86
631
- ] });
632
- $[127] = t85;
755
+ const t87 = values.collectionGroup ?? false;
756
+ let t88;
757
+ if ($[127] !== t86 || $[128] !== t87) {
758
+ t88 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "large", label: "Collection group", onValueChange: t86, value: t87 });
759
+ $[127] = t86;
633
760
  $[128] = t87;
761
+ $[129] = t88;
634
762
  } else {
635
- t87 = $[128];
763
+ t88 = $[129];
636
764
  }
637
- let t88;
638
- if ($[129] !== setFieldValue) {
639
- t88 = (v_1) => setFieldValue("textSearchEnabled", v_1);
640
- $[129] = setFieldValue;
641
- $[130] = t88;
765
+ let t89;
766
+ if ($[130] === Symbol.for("react.memo_cache_sentinel")) {
767
+ t89 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." });
768
+ $[130] = t89;
642
769
  } else {
643
- t88 = $[130];
770
+ t89 = $[130];
644
771
  }
645
- const t89 = values.textSearchEnabled ?? false;
646
772
  let t90;
647
- if ($[131] !== t88 || $[132] !== t89) {
648
- t90 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", label: "Enable text search for this collection", onValueChange: t88, value: t89 });
773
+ if ($[131] !== t88) {
774
+ t90 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12 mt-4", children: [
775
+ t88,
776
+ t89
777
+ ] });
649
778
  $[131] = t88;
650
- $[132] = t89;
651
- $[133] = t90;
779
+ $[132] = t90;
652
780
  } else {
653
- t90 = $[133];
781
+ t90 = $[132];
654
782
  }
655
783
  let t91;
656
- if ($[134] === Symbol.for("react.memo_cache_sentinel")) {
657
- t91 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: "Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues." });
784
+ if ($[133] !== setFieldValue) {
785
+ t91 = (v_1) => setFieldValue("textSearchEnabled", v_1);
786
+ $[133] = setFieldValue;
658
787
  $[134] = t91;
659
788
  } else {
660
789
  t91 = $[134];
661
790
  }
662
- let t92;
663
- if ($[135] !== t90) {
664
- t92 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
665
- t90,
666
- t91
667
- ] });
668
- $[135] = t90;
791
+ const t92 = values.textSearchEnabled ?? false;
792
+ let t93;
793
+ if ($[135] !== t91 || $[136] !== t92) {
794
+ t93 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "large", label: "Enable text search for this collection", onValueChange: t91, value: t92 });
795
+ $[135] = t91;
669
796
  $[136] = t92;
797
+ $[137] = t93;
670
798
  } else {
671
- t92 = $[136];
799
+ t93 = $[137];
672
800
  }
673
- let t93;
674
- if ($[137] !== t45 || $[138] !== t53 || $[139] !== t65 || $[140] !== t72 || $[141] !== t75 || $[142] !== t82 || $[143] !== t87 || $[144] !== t92) {
675
- t93 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
676
- t45,
677
- t53,
678
- t65,
679
- t72,
801
+ let t94;
802
+ if ($[138] === Symbol.for("react.memo_cache_sentinel")) {
803
+ t94 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: "Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues." });
804
+ $[138] = t94;
805
+ } else {
806
+ t94 = $[138];
807
+ }
808
+ let t95;
809
+ if ($[139] !== t93) {
810
+ t95 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
811
+ t93,
812
+ t94
813
+ ] });
814
+ $[139] = t93;
815
+ $[140] = t95;
816
+ } else {
817
+ t95 = $[140];
818
+ }
819
+ let t96;
820
+ if ($[141] !== t48 || $[142] !== t56 || $[143] !== t68 || $[144] !== t75 || $[145] !== t78 || $[146] !== t85 || $[147] !== t90 || $[148] !== t95) {
821
+ t96 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
822
+ t48,
823
+ t56,
824
+ t68,
680
825
  t75,
681
- t82,
682
- t87,
683
- t92
826
+ t78,
827
+ t85,
828
+ t90,
829
+ t95
684
830
  ] });
685
- $[137] = t45;
686
- $[138] = t53;
687
- $[139] = t65;
688
- $[140] = t72;
689
- $[141] = t75;
690
- $[142] = t82;
691
- $[143] = t87;
692
- $[144] = t92;
693
- $[145] = t93;
694
- } else {
695
- t93 = $[145];
831
+ $[141] = t48;
832
+ $[142] = t56;
833
+ $[143] = t68;
834
+ $[144] = t75;
835
+ $[145] = t78;
836
+ $[146] = t85;
837
+ $[147] = t90;
838
+ $[148] = t95;
839
+ $[149] = t96;
840
+ } else {
841
+ t96 = $[149];
696
842
  }
697
- let t94;
698
- if ($[146] !== advancedPanelExpanded || $[147] !== t93) {
699
- t94 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsx(ui.ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t38, initiallyExpanded: false, children: t93 }) });
700
- $[146] = advancedPanelExpanded;
701
- $[147] = t93;
702
- $[148] = t94;
843
+ let t97;
844
+ if ($[150] !== advancedPanelExpanded || $[151] !== t96) {
845
+ t97 = /* @__PURE__ */ jsxRuntime.jsx(ui.ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t41, initiallyExpanded: false, children: t96 });
846
+ $[150] = advancedPanelExpanded;
847
+ $[151] = t96;
848
+ $[152] = t97;
703
849
  } else {
704
- t94 = $[148];
850
+ t97 = $[152];
705
851
  }
706
- let t95;
707
- if ($[149] !== t27 || $[150] !== t36 || $[151] !== t37 || $[152] !== t94) {
708
- t95 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t19, children: [
852
+ let t98;
853
+ if ($[153] !== children || $[154] !== t97) {
854
+ t98 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12 mt-8", children: [
855
+ t97,
856
+ children
857
+ ] });
858
+ $[153] = children;
859
+ $[154] = t97;
860
+ $[155] = t98;
861
+ } else {
862
+ t98 = $[155];
863
+ }
864
+ let t99;
865
+ if ($[156] !== t27 || $[157] !== t36 || $[158] !== t37 || $[159] !== t40 || $[160] !== t98) {
866
+ t99 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t19, children: [
709
867
  t27,
710
868
  t36,
711
869
  t37,
712
- t94
870
+ t40,
871
+ t98
713
872
  ] });
714
- $[149] = t27;
715
- $[150] = t36;
716
- $[151] = t37;
717
- $[152] = t94;
718
- $[153] = t95;
873
+ $[156] = t27;
874
+ $[157] = t36;
875
+ $[158] = t37;
876
+ $[159] = t40;
877
+ $[160] = t98;
878
+ $[161] = t99;
719
879
  } else {
720
- t95 = $[153];
880
+ t99 = $[161];
721
881
  }
722
- let t96;
723
- if ($[154] === Symbol.for("react.memo_cache_sentinel")) {
724
- t96 = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
882
+ let t100;
883
+ if ($[162] === Symbol.for("react.memo_cache_sentinel")) {
884
+ t100 = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
725
885
  height: "52px"
726
886
  } });
727
- $[154] = t96;
887
+ $[162] = t100;
728
888
  } else {
729
- t96 = $[154];
889
+ t100 = $[162];
730
890
  }
731
- let t97;
732
- if ($[155] !== setFieldValue) {
733
- t97 = (icon) => {
891
+ let t101;
892
+ if ($[163] !== setFieldValue) {
893
+ t101 = (icon) => {
734
894
  setIconDialogOpen(false);
735
895
  setFieldValue("icon", icon);
736
896
  };
737
- $[155] = setFieldValue;
738
- $[156] = t97;
897
+ $[163] = setFieldValue;
898
+ $[164] = t101;
739
899
  } else {
740
- t97 = $[156];
900
+ t101 = $[164];
741
901
  }
742
- let t98;
743
- if ($[157] !== t97 || $[158] !== values.icon) {
744
- t98 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsxRuntime.jsx(core.SearchIconsView, { selectedIcon: values.icon, onIconSelected: t97 }) });
745
- $[157] = t97;
746
- $[158] = values.icon;
747
- $[159] = t98;
902
+ let t102;
903
+ if ($[165] !== t101 || $[166] !== values.icon) {
904
+ t102 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsxRuntime.jsx(core.SearchIconsView, { selectedIcon: values.icon, onIconSelected: t101 }) });
905
+ $[165] = t101;
906
+ $[166] = values.icon;
907
+ $[167] = t102;
748
908
  } else {
749
- t98 = $[159];
909
+ t102 = $[167];
750
910
  }
751
- let t99;
752
- if ($[160] !== iconDialogOpen || $[161] !== t98) {
753
- t99 = /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t98 });
754
- $[160] = iconDialogOpen;
755
- $[161] = t98;
756
- $[162] = t99;
911
+ let t103;
912
+ if ($[168] !== iconDialogOpen || $[169] !== t102) {
913
+ t103 = /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t102 });
914
+ $[168] = iconDialogOpen;
915
+ $[169] = t102;
916
+ $[170] = t103;
757
917
  } else {
758
- t99 = $[162];
918
+ t103 = $[170];
759
919
  }
760
- let t100;
761
- if ($[163] !== T0 || $[164] !== t18 || $[165] !== t95 || $[166] !== t99) {
762
- t100 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: t7, children: /* @__PURE__ */ jsxRuntime.jsxs(T0, { maxWidth: t8, className: t9, children: [
920
+ let t104;
921
+ if ($[171] !== T0 || $[172] !== t103 || $[173] !== t18 || $[174] !== t99) {
922
+ t104 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: t7, children: /* @__PURE__ */ jsxRuntime.jsxs(T0, { maxWidth: t8, className: t9, children: [
763
923
  t18,
764
- t95,
765
- t96,
766
- t99
924
+ t99,
925
+ t100,
926
+ t103
767
927
  ] }) });
768
- $[163] = T0;
769
- $[164] = t18;
770
- $[165] = t95;
771
- $[166] = t99;
772
- $[167] = t100;
928
+ $[171] = T0;
929
+ $[172] = t103;
930
+ $[173] = t18;
931
+ $[174] = t99;
932
+ $[175] = t104;
773
933
  } else {
774
- t100 = $[167];
934
+ t104 = $[175];
775
935
  }
776
- return t100;
936
+ return t104;
777
937
  }
778
- function _temp3$4(value_2) {
779
- if (value_2 === "code_defined") {
938
+ function _temp3$4(value_3) {
939
+ if (value_3 === "code_defined") {
780
940
  return "Code defined";
781
941
  } else {
782
- if (value_2 === "true") {
942
+ if (value_3 === "true") {
783
943
  return "Users must define an ID";
784
944
  } else {
785
- if (value_2 === "optional") {
945
+ if (value_3 === "optional") {
786
946
  return "Users can define an ID, but it is not required";
787
947
  } else {
788
948
  return "Document ID is generated automatically";
@@ -790,11 +950,11 @@
790
950
  }
791
951
  }
792
952
  }
793
- function _temp2$7(value_1) {
794
- return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: value_1, children: value_1.toUpperCase() }, `size-select-${value_1}`);
953
+ function _temp2$7(value_2) {
954
+ return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: value_2, children: value_2.toUpperCase() }, `size-select-${value_2}`);
795
955
  }
796
- function _temp$b(value_0) {
797
- return value_0.toUpperCase();
956
+ function _temp$b(value_1) {
957
+ return value_1.toUpperCase();
798
958
  }
799
959
  function DefaultDatabaseField(t0) {
800
960
  const $ = reactCompilerRuntime.c(5);
@@ -1043,7 +1203,7 @@
1043
1203
  let t6;
1044
1204
  if ($[15] !== allowDataInference || $[16] !== disabled || $[17] !== inferValues || $[18] !== inferring) {
1045
1205
  t6 = allowDataInference && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { loading: inferring, disabled: disabled || inferring, variant: "text", size: "small", onClick: inferValues, children: [
1046
- inferring ? /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "small" }) : /* @__PURE__ */ jsxRuntime.jsx(ui.AutorenewIcon, {}),
1206
+ inferring ? /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "smallest" }) : /* @__PURE__ */ jsxRuntime.jsx(ui.AutorenewIcon, {}),
1047
1207
  "Infer values from data"
1048
1208
  ] });
1049
1209
  $[15] = allowDataInference;
@@ -1087,7 +1247,7 @@
1087
1247
  }
1088
1248
  let t10;
1089
1249
  if ($[26] !== buildEntry || $[27] !== disabled || $[28] !== enumValuesPath || $[29] !== t8 || $[30] !== values.enumValues) {
1090
- t10 = /* @__PURE__ */ jsxRuntime.jsx(core.ArrayContainer, { droppableId: enumValuesPath, addLabel: "Add enum value", value: values.enumValues, disabled, size: "small", buildEntry, onInternalIdAdded: setLastInternalIdAdded, includeAddButton: true, onValueChange: t8, newDefaultEntry: t9 });
1250
+ t10 = /* @__PURE__ */ jsxRuntime.jsx(core.ArrayContainer, { droppableId: enumValuesPath, addLabel: "Add enum value", value: values.enumValues, disabled, size: "small", buildEntry, onInternalIdAdded: setLastInternalIdAdded, canAddElements: true, onValueChange: t8, newDefaultEntry: t9 });
1091
1251
  $[26] = buildEntry;
1092
1252
  $[27] = disabled;
1093
1253
  $[28] = enumValuesPath;
@@ -6439,9 +6599,11 @@
6439
6599
  }
6440
6600
  function camelCase(str) {
6441
6601
  if (!str) return "";
6442
- return (str.slice(0, 1).toLowerCase() + str.slice(1)).replace(/([-_ ]){1,}/g, " ").split(/[-_ ]/).reduce((cur, acc) => {
6443
- return cur + acc[0].toUpperCase() + acc.substring(1);
6444
- }, "");
6602
+ if (str.length === 1) return str.toLowerCase();
6603
+ const parts = str.split(/[-_ ]+/).filter(Boolean);
6604
+ if (parts.length === 0) return "";
6605
+ return parts[0].toLowerCase() + // Transform remaining parts to have first letter uppercase
6606
+ parts.slice(1).map((part) => part.charAt(0).toUpperCase() + part.substring(1).toLowerCase()).join("");
6445
6607
  }
6446
6608
  function GetCodeDialog(t0) {
6447
6609
  const $ = reactCompilerRuntime.c(22);
@@ -6469,7 +6631,7 @@
6469
6631
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
6470
6632
  t2 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "body2", className: "my-4 mb-8", children: [
6471
6633
  "If you want to customise the collection in code, you can add this collection code to your CMS app configuration. More info in the ",
6472
- /* @__PURE__ */ jsxRuntime.jsx("a", { rel: "noopener noreferrer", href: "https://firecms.co/docs/customization_quickstart", children: "docs" }),
6634
+ /* @__PURE__ */ jsxRuntime.jsx("a", { rel: "noopener noreferrer", href: "https://firecms.co/docs/cloud/quickstart", children: "docs" }),
6473
6635
  "."
6474
6636
  ] });
6475
6637
  $[2] = t2;
@@ -6757,7 +6919,6 @@
6757
6919
  previousId,
6758
6920
  namespace: namespace_3
6759
6921
  }) => {
6760
- console.log("!!!!!! onPropertyChanged", property_0);
6761
6922
  const fullId_0 = id_0 ? getFullId(id_0, namespace_3) : void 0;
6762
6923
  const propertyPath = fullId_0 ? idToPropertiesPath(fullId_0) : void 0;
6763
6924
  if (previousId && previousId !== id_0) {
@@ -8311,10 +8472,8 @@
8311
8472
  editable: true
8312
8473
  };
8313
8474
  if (propertyPath_0) {
8314
- if (inferredNewProperty) {
8475
+ {
8315
8476
  setFieldValue(propertyPath_0, inferredNewProperty, false);
8316
- } else {
8317
- setFieldValue(propertyPath_0, property_1, false);
8318
8477
  }
8319
8478
  setFieldTouched(propertyPath_0, true, false);
8320
8479
  }
@@ -8621,102 +8780,104 @@
8621
8780
  return t9;
8622
8781
  }
8623
8782
  function CollectionEditorImportDataPreview(t0) {
8624
- const $ = reactCompilerRuntime.c(18);
8783
+ const $ = reactCompilerRuntime.c(19);
8625
8784
  const {
8626
8785
  importConfig,
8627
8786
  properties,
8628
8787
  propertiesOrder
8629
8788
  } = t0;
8789
+ const authController = core.useAuthController();
8630
8790
  const [loading, setLoading] = React.useState(false);
8631
8791
  let t1;
8632
- if ($[0] !== importConfig || $[1] !== properties) {
8792
+ if ($[0] !== authController || $[1] !== importConfig || $[2] !== properties) {
8633
8793
  t1 = async function loadEntities2() {
8634
- const mappedData = importConfig.importData.map((d) => data_import_export.convertDataToEntity(d, importConfig.idColumn, importConfig.headersMapping, properties, "TEMP_PATH", importConfig.defaultValues));
8794
+ const mappedData = importConfig.importData.map((d) => data_import_export.convertDataToEntity(authController, d, importConfig.idColumn, importConfig.headersMapping, properties, "TEMP_PATH", importConfig.defaultValues));
8635
8795
  importConfig.setEntities(mappedData);
8636
8796
  };
8637
- $[0] = importConfig;
8638
- $[1] = properties;
8639
- $[2] = t1;
8797
+ $[0] = authController;
8798
+ $[1] = importConfig;
8799
+ $[2] = properties;
8800
+ $[3] = t1;
8640
8801
  } else {
8641
- t1 = $[2];
8802
+ t1 = $[3];
8642
8803
  }
8643
8804
  const loadEntities = t1;
8644
8805
  let t2;
8645
- if ($[3] !== loadEntities) {
8806
+ if ($[4] !== loadEntities) {
8646
8807
  t2 = () => {
8647
8808
  loadEntities().finally(() => setLoading(false));
8648
8809
  };
8649
- $[3] = loadEntities;
8650
- $[4] = t2;
8810
+ $[4] = loadEntities;
8811
+ $[5] = t2;
8651
8812
  } else {
8652
- t2 = $[4];
8813
+ t2 = $[5];
8653
8814
  }
8654
8815
  let t3;
8655
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
8816
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
8656
8817
  t3 = [];
8657
- $[5] = t3;
8818
+ $[6] = t3;
8658
8819
  } else {
8659
- t3 = $[5];
8820
+ t3 = $[6];
8660
8821
  }
8661
8822
  React.useEffect(t2, t3);
8662
8823
  const selectionController = core.useSelectionController();
8663
8824
  if (loading) {
8664
8825
  let t42;
8665
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
8826
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
8666
8827
  t42 = /* @__PURE__ */ jsxRuntime.jsx(core.CircularProgressCenter, {});
8667
- $[6] = t42;
8828
+ $[7] = t42;
8668
8829
  } else {
8669
- t42 = $[6];
8830
+ t42 = $[7];
8670
8831
  }
8671
8832
  return t42;
8672
8833
  }
8673
8834
  let t4;
8674
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
8835
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
8675
8836
  t4 = /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
8676
8837
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", children: "Imported data preview" }),
8677
8838
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", children: "Entities with the same id will be overwritten" })
8678
8839
  ] });
8679
- $[7] = t4;
8840
+ $[8] = t4;
8680
8841
  } else {
8681
- t4 = $[7];
8842
+ t4 = $[8];
8682
8843
  }
8683
8844
  let t5;
8684
- if ($[8] !== importConfig.entities) {
8845
+ if ($[9] !== importConfig.entities) {
8685
8846
  t5 = {
8686
8847
  data: importConfig.entities,
8687
8848
  dataLoading: false,
8688
8849
  noMoreToLoad: false
8689
8850
  };
8690
- $[8] = importConfig.entities;
8691
- $[9] = t5;
8851
+ $[9] = importConfig.entities;
8852
+ $[10] = t5;
8692
8853
  } else {
8693
- t5 = $[9];
8854
+ t5 = $[10];
8694
8855
  }
8695
8856
  let t6;
8696
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
8857
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
8697
8858
  t6 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-12" });
8698
- $[10] = t6;
8859
+ $[11] = t6;
8699
8860
  } else {
8700
- t6 = $[10];
8861
+ t6 = $[11];
8701
8862
  }
8702
8863
  let t7;
8703
- if ($[11] !== propertiesOrder) {
8864
+ if ($[12] !== propertiesOrder) {
8704
8865
  t7 = propertiesOrder.map(_temp$1);
8705
- $[11] = propertiesOrder;
8706
- $[12] = t7;
8866
+ $[12] = propertiesOrder;
8867
+ $[13] = t7;
8707
8868
  } else {
8708
- t7 = $[12];
8869
+ t7 = $[13];
8709
8870
  }
8710
8871
  let t8;
8711
- if ($[13] !== properties || $[14] !== selectionController || $[15] !== t5 || $[16] !== t7) {
8712
- t8 = /* @__PURE__ */ jsxRuntime.jsx(core.EntityCollectionTable, { title: t4, tableController: t5, endAdornment: t6, filterable: false, sortable: false, selectionController, displayedColumnIds: t7, properties, enablePopupIcon: false });
8713
- $[13] = properties;
8714
- $[14] = selectionController;
8715
- $[15] = t5;
8716
- $[16] = t7;
8717
- $[17] = t8;
8872
+ if ($[14] !== properties || $[15] !== selectionController || $[16] !== t5 || $[17] !== t7) {
8873
+ t8 = /* @__PURE__ */ jsxRuntime.jsx(core.EntityCollectionTable, { title: t4, tableController: t5, endAdornment: t6, filterable: false, sortable: false, selectionController, displayedColumnIds: t7, openEntityMode: "side_panel", properties, enablePopupIcon: false });
8874
+ $[14] = properties;
8875
+ $[15] = selectionController;
8876
+ $[16] = t5;
8877
+ $[17] = t7;
8878
+ $[18] = t8;
8718
8879
  } else {
8719
- t8 = $[17];
8880
+ t8 = $[18];
8720
8881
  }
8721
8882
  return t8;
8722
8883
  }
@@ -9176,7 +9337,7 @@
9176
9337
  const updatedFullPath = fullPath?.includes("/") ? fullPath?.split("/").slice(0, -1).join("/") + "/" + path : path;
9177
9338
  const pathError_0 = validatePath(path, isNewCollection, existingPaths, values_1.id);
9178
9339
  const parentPaths = !pathError_0 && parentCollectionIds ? navigation.convertIdsToPaths(parentCollectionIds) : void 0;
9179
- const resolvedPath = !pathError_0 ? navigation.resolveAliasesFrom(updatedFullPath) : void 0;
9340
+ const resolvedPath = !pathError_0 ? navigation.resolveIdsFrom(updatedFullPath) : void 0;
9180
9341
  const getDataWithPath = resolvedPath && getData ? async () => {
9181
9342
  const data = await getData(resolvedPath, parentPaths ?? []);
9182
9343
  if (existingEntities) {
@@ -9213,82 +9374,109 @@
9213
9374
  setNextMode();
9214
9375
  };
9215
9376
  const editable = collection?.editable === void 0 || collection?.editable === true;
9377
+ const isMergedCollection = collection?.merged ?? false;
9216
9378
  const collectionEditable = editable || isNewCollection;
9217
- return /* @__PURE__ */ jsxRuntime.jsx(ui.DialogContent, { fullHeight: true, children: /* @__PURE__ */ jsxRuntime.jsx(formex.Formex, { value: formController, children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9218
- !isNewCollection && /* @__PURE__ */ jsxRuntime.jsxs(ui.Tabs, { value: currentView, innerClassName: ui.cls(ui.defaultBorderMixin, "justify-end bg-surface-50 dark:bg-surface-950 border-b"), onValueChange: (v) => setCurrentView(v), children: [
9219
- /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "details", children: "Details" }),
9220
- /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "properties", children: "Properties" }),
9221
- /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "subcollections", children: "Additional views" })
9222
- ] }),
9223
- /* @__PURE__ */ jsxRuntime.jsxs("form", { noValidate: true, onSubmit: formController.handleSubmit, className: ui.cls(isNewCollection ? "h-full" : "h-[calc(100%-48px)]", "flex-grow flex flex-col relative"), children: [
9224
- currentView === "loading" && /* @__PURE__ */ jsxRuntime.jsx(core.CircularProgressCenter, {}),
9225
- currentView === "extra_view" && path && extraView?.View && /* @__PURE__ */ jsxRuntime.jsx(extraView.View, { path }),
9226
- currentView === "welcome" && /* @__PURE__ */ jsxRuntime.jsx(CollectionEditorWelcomeView, { path, onContinue: (importData, propertiesOrder_0) => {
9227
- if (importData) {
9228
- onImportDataSet(importData, propertiesOrder_0);
9229
- setCurrentView("import_data_mapping");
9230
- } else {
9231
- setCurrentView("details");
9232
- }
9233
- }, existingCollectionPaths: existingPaths, parentCollection, pathSuggestions }),
9234
- currentView === "import_data_mapping" && importConfig && /* @__PURE__ */ jsxRuntime.jsx(CollectionEditorImportMapping, { importConfig, collectionEditable, propertyConfigs }),
9235
- currentView === "import_data_preview" && importConfig && /* @__PURE__ */ jsxRuntime.jsx(CollectionEditorImportDataPreview, { importConfig, properties: values_1.properties, propertiesOrder: values_1.propertiesOrder }),
9236
- currentView === "import_data_saving" && importConfig && /* @__PURE__ */ jsxRuntime.jsx(data_import_export.ImportSaveInProgress, { importConfig, collection: values_1, path, onImportSuccess: async (importedCollection) => {
9237
- snackbarController.open({
9238
- type: "info",
9239
- message: "Data imported successfully"
9240
- });
9241
- await saveCollection(values_1);
9242
- handleClose(importedCollection);
9243
- } }),
9244
- currentView === "details" && /* @__PURE__ */ jsxRuntime.jsx(CollectionDetailsForm, { existingPaths, existingIds, groups, parentCollectionIds, parentCollection, isNewCollection }),
9245
- currentView === "subcollections" && collection && /* @__PURE__ */ jsxRuntime.jsx(SubcollectionsEditTab, { parentCollection, configController, getUser, collectionInference, parentCollectionIds, collection }),
9246
- currentView === "properties" && /* @__PURE__ */ jsxRuntime.jsx(CollectionPropertiesEditorForm, { showErrors: submitCount > 0, isNewCollection, reservedGroups, onPropertyError: (propertyKey, namespace, error_0) => {
9247
- const current = core.removeUndefined({
9248
- ...propertyErrorsRef.current,
9249
- [getFullIdPath(propertyKey, namespace)]: core.removeUndefined(error_0, true)
9250
- }, true);
9251
- propertyErrorsRef.current = current;
9252
- formController.validate();
9253
- }, getUser, getData: getDataWithPath, doCollectionInference, propertyConfigs, collectionEditable, extraIcon: extraView?.icon && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { color: "primary", onClick: () => setCurrentView("extra_view"), children: extraView.icon }) }),
9254
- currentView !== "welcome" && /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogActions, { position: "absolute", children: [
9255
- error && /* @__PURE__ */ jsxRuntime.jsx(core.ErrorView, { error }),
9256
- isNewCollection && includeTemplates && currentView === "import_data_mapping" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => {
9257
- importConfig.setInUse(false);
9258
- return setCurrentView("welcome");
9259
- }, children: [
9260
- /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9261
- "Back"
9262
- ] }),
9263
- isNewCollection && includeTemplates && currentView === "import_data_preview" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => {
9264
- setCurrentView("import_data_mapping");
9265
- }, children: [
9266
- /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9267
- "Back"
9268
- ] }),
9269
- isNewCollection && includeTemplates && currentView === "details" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => setCurrentView("welcome"), children: [
9270
- /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9271
- "Back"
9272
- ] }),
9273
- isNewCollection && currentView === "properties" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => setCurrentView("details"), children: [
9274
- /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9275
- "Back"
9276
- ] }),
9277
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", onClick: () => {
9278
- handleCancel();
9279
- }, children: "Cancel" }),
9280
- isNewCollection && currentView === "import_data_mapping" && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "filled", color: "primary", onClick: onImportMappingComplete, children: "Next" }),
9281
- isNewCollection && currentView === "import_data_preview" && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "filled", color: "primary", onClick: () => {
9282
- setNextMode();
9283
- }, children: "Next" }),
9284
- isNewCollection && (currentView === "details" || currentView === "properties") && /* @__PURE__ */ jsxRuntime.jsxs(ui.LoadingButton, { variant: "filled", color: "primary", type: "submit", loading: isSubmitting, disabled: isSubmitting || currentView === "details" && !validValues, startIcon: currentView === "properties" ? /* @__PURE__ */ jsxRuntime.jsx(ui.CheckIcon, {}) : void 0, children: [
9285
- currentView === "details" && "Next",
9286
- currentView === "properties" && "Create collection"
9287
- ] }),
9288
- !isNewCollection && /* @__PURE__ */ jsxRuntime.jsx(ui.LoadingButton, { variant: "filled", color: "primary", type: "submit", loading: isSubmitting, children: "Update collection" })
9379
+ const [deleteRequested, setDeleteRequested] = React.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__ */ jsxRuntime.jsxs(ui.DialogContent, { fullHeight: true, children: [
9394
+ /* @__PURE__ */ jsxRuntime.jsx(formex.Formex, { value: formController, children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9395
+ !isNewCollection && /* @__PURE__ */ jsxRuntime.jsxs(ui.Tabs, { value: currentView, innerClassName: ui.cls(ui.defaultBorderMixin, "px-4 h-14 w-full justify-end bg-surface-50 dark:bg-surface-950 border-b"), onValueChange: (v) => setCurrentView(v), children: [
9396
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "details", children: "Details" }),
9397
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "properties", children: "Properties" }),
9398
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "subcollections", children: "Additional views" })
9399
+ ] }),
9400
+ /* @__PURE__ */ jsxRuntime.jsxs("form", { noValidate: true, onSubmit: formController.handleSubmit, className: ui.cls(isNewCollection ? "h-full" : "h-[calc(100%-48px)]", "flex-grow flex flex-col relative"), children: [
9401
+ currentView === "loading" && /* @__PURE__ */ jsxRuntime.jsx(core.CircularProgressCenter, {}),
9402
+ currentView === "extra_view" && path && extraView?.View && /* @__PURE__ */ jsxRuntime.jsx(extraView.View, { path }),
9403
+ currentView === "welcome" && /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(CollectionEditorImportMapping, { importConfig, collectionEditable, propertyConfigs }),
9412
+ currentView === "import_data_preview" && importConfig && /* @__PURE__ */ jsxRuntime.jsx(CollectionEditorImportDataPreview, { importConfig, properties: values_1.properties, propertiesOrder: values_1.propertiesOrder }),
9413
+ currentView === "import_data_saving" && importConfig && /* @__PURE__ */ jsxRuntime.jsx(data_import_export.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__ */ jsxRuntime.jsx(CollectionDetailsForm, { existingPaths, existingIds, groups, parentCollectionIds, parentCollection, isNewCollection, children: !isNewCollection && isMergedCollection && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 mt-8", children: [
9422
+ /* @__PURE__ */ jsxRuntime.jsx(ui.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__ */ jsxRuntime.jsx(ui.Button, { color: "neutral", onClick: () => {
9424
+ setDeleteRequested(true);
9425
+ }, children: "Reset to code" })
9426
+ ] }) }),
9427
+ currentView === "subcollections" && collection && /* @__PURE__ */ jsxRuntime.jsx(SubcollectionsEditTab, { parentCollection, configController, getUser, collectionInference, parentCollectionIds, collection }),
9428
+ currentView === "properties" && /* @__PURE__ */ jsxRuntime.jsx(CollectionPropertiesEditorForm, { showErrors: submitCount > 0, isNewCollection, reservedGroups, onPropertyError: (propertyKey, namespace, error_0) => {
9429
+ const current = core.removeUndefined({
9430
+ ...propertyErrorsRef.current,
9431
+ [getFullIdPath(propertyKey, namespace)]: core.removeUndefined(error_0, true)
9432
+ }, true);
9433
+ propertyErrorsRef.current = current;
9434
+ formController.validate();
9435
+ }, getUser, getData: getDataWithPath, doCollectionInference, propertyConfigs, collectionEditable, extraIcon: extraView?.icon && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { color: "primary", onClick: () => setCurrentView("extra_view"), children: extraView.icon }) }),
9436
+ currentView !== "welcome" && /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogActions, { position: "absolute", children: [
9437
+ error && /* @__PURE__ */ jsxRuntime.jsx(core.ErrorView, { error }),
9438
+ isNewCollection && includeTemplates && currentView === "import_data_mapping" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => {
9439
+ importConfig.setInUse(false);
9440
+ return setCurrentView("welcome");
9441
+ }, children: [
9442
+ /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9443
+ "Back"
9444
+ ] }),
9445
+ isNewCollection && includeTemplates && currentView === "import_data_preview" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => {
9446
+ setCurrentView("import_data_mapping");
9447
+ }, children: [
9448
+ /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9449
+ "Back"
9450
+ ] }),
9451
+ isNewCollection && includeTemplates && currentView === "details" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => setCurrentView("welcome"), children: [
9452
+ /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9453
+ "Back"
9454
+ ] }),
9455
+ isNewCollection && currentView === "properties" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => setCurrentView("details"), children: [
9456
+ /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9457
+ "Back"
9458
+ ] }),
9459
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", onClick: () => {
9460
+ handleCancel();
9461
+ }, children: "Cancel" }),
9462
+ isNewCollection && currentView === "import_data_mapping" && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "filled", color: "primary", onClick: onImportMappingComplete, children: "Next" }),
9463
+ isNewCollection && currentView === "import_data_preview" && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "filled", color: "primary", onClick: () => {
9464
+ setNextMode();
9465
+ }, children: "Next" }),
9466
+ isNewCollection && (currentView === "details" || currentView === "properties") && /* @__PURE__ */ jsxRuntime.jsxs(ui.LoadingButton, { variant: "filled", color: "primary", type: "submit", loading: isSubmitting, disabled: isSubmitting || currentView === "details" && !validValues, startIcon: currentView === "properties" ? /* @__PURE__ */ jsxRuntime.jsx(ui.CheckIcon, {}) : void 0, children: [
9467
+ currentView === "details" && "Next",
9468
+ currentView === "properties" && "Create collection"
9469
+ ] }),
9470
+ !isNewCollection && /* @__PURE__ */ jsxRuntime.jsx(ui.LoadingButton, { variant: "filled", color: "primary", type: "submit", loading: isSubmitting, children: "Update collection" })
9471
+ ] })
9289
9472
  ] })
9290
- ] })
9291
- ] }) }) });
9473
+ ] }) }),
9474
+ /* @__PURE__ */ jsxRuntime.jsx(core.ConfirmationDialog, { open: deleteRequested, onAccept: deleteCollection, onCancel: () => setDeleteRequested(false), title: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: "Delete the stored config?" }), body: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9475
+ " This will ",
9476
+ /* @__PURE__ */ jsxRuntime.jsx("b", { children: "not delete any data" }),
9477
+ ", only the stored config, and reset to the code state."
9478
+ ] }) })
9479
+ ] });
9292
9480
  }
9293
9481
  function applyPropertyConfigs(collection, propertyConfigs) {
9294
9482
  const {
@@ -9352,7 +9540,7 @@
9352
9540
  const ConfigControllerContext = React.createContext({});
9353
9541
  const CollectionEditorContext = React.createContext({});
9354
9542
  const ConfigControllerProvider = React.memo(function ConfigControllerProvider2(t0) {
9355
- const $ = reactCompilerRuntime.c(68);
9543
+ const $ = reactCompilerRuntime.c(67);
9356
9544
  const {
9357
9545
  children,
9358
9546
  collectionConfigController,
@@ -9363,8 +9551,7 @@
9363
9551
  getPathSuggestions,
9364
9552
  getUser,
9365
9553
  getData,
9366
- onAnalyticsEvent,
9367
- components
9554
+ onAnalyticsEvent
9368
9555
  } = t0;
9369
9556
  const navigation = core.useNavigationController();
9370
9557
  const navigate = reactRouter.useNavigate();
@@ -9482,28 +9669,26 @@
9482
9669
  const createCollection = t3;
9483
9670
  const t4 = configPermissions ?? defaultConfigPermissions;
9484
9671
  let t5;
9485
- 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) {
9486
9673
  t5 = {
9487
9674
  editCollection,
9488
9675
  createCollection,
9489
9676
  editProperty,
9490
9677
  configPermissions: t4,
9491
- getPathSuggestions,
9492
- components
9678
+ getPathSuggestions
9493
9679
  };
9494
- $[6] = components;
9495
- $[7] = createCollection;
9496
- $[8] = editCollection;
9497
- $[9] = editProperty;
9498
- $[10] = getPathSuggestions;
9499
- $[11] = t4;
9500
- $[12] = t5;
9680
+ $[6] = createCollection;
9681
+ $[7] = editCollection;
9682
+ $[8] = editProperty;
9683
+ $[9] = getPathSuggestions;
9684
+ $[10] = t4;
9685
+ $[11] = t5;
9501
9686
  } else {
9502
- t5 = $[12];
9687
+ t5 = $[11];
9503
9688
  }
9504
9689
  const t6 = Boolean(currentDialog);
9505
9690
  let t7;
9506
- if ($[13] !== currentDialog || $[14] !== navigate || $[15] !== navigation) {
9691
+ if ($[12] !== currentDialog || $[13] !== navigate || $[14] !== navigation) {
9507
9692
  t7 = (collection_0) => {
9508
9693
  if (currentDialog?.redirect) {
9509
9694
  if (collection_0 && currentDialog?.isNewCollection && !currentDialog.parentCollectionIds.length) {
@@ -9513,29 +9698,29 @@
9513
9698
  }
9514
9699
  setCurrentDialog(void 0);
9515
9700
  };
9516
- $[13] = currentDialog;
9517
- $[14] = navigate;
9518
- $[15] = navigation;
9519
- $[16] = t7;
9701
+ $[12] = currentDialog;
9702
+ $[13] = navigate;
9703
+ $[14] = navigation;
9704
+ $[15] = t7;
9520
9705
  } else {
9521
- t7 = $[16];
9706
+ t7 = $[15];
9522
9707
  }
9523
9708
  let t8;
9524
- 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) {
9525
9710
  t8 = /* @__PURE__ */ jsxRuntime.jsx(CollectionEditorDialog, { open: t6, configController: collectionConfigController, isNewCollection: false, collectionInference, ...currentDialog, getData, reservedGroups, extraView, pathSuggestions: getPathSuggestions, getUser, handleClose: t7 });
9526
- $[17] = collectionConfigController;
9527
- $[18] = collectionInference;
9528
- $[19] = currentDialog;
9529
- $[20] = extraView;
9530
- $[21] = getData;
9531
- $[22] = getPathSuggestions;
9532
- $[23] = getUser;
9533
- $[24] = reservedGroups;
9534
- $[25] = t6;
9535
- $[26] = t7;
9536
- $[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;
9537
9722
  } else {
9538
- t8 = $[27];
9723
+ t8 = $[26];
9539
9724
  }
9540
9725
  const t9 = Boolean(currentPropertyDialog);
9541
9726
  const t10 = Boolean(currentPropertyDialog?.propertyKey);
@@ -9543,21 +9728,21 @@
9543
9728
  const t12 = !currentPropertyDialog ? false : !currentPropertyDialog?.propertyKey;
9544
9729
  const t13 = currentPropertyDialog?.collectionEditable ?? false;
9545
9730
  let t14;
9546
- if ($[28] !== currentPropertyDialog || $[29] !== getData || $[30] !== navigation) {
9731
+ if ($[27] !== currentPropertyDialog || $[28] !== getData || $[29] !== navigation) {
9547
9732
  t14 = getData && currentPropertyDialog?.editedCollectionId ? () => {
9548
9733
  console.debug("get data for property", currentPropertyDialog?.editedCollectionId);
9549
- const resolvedPath = navigation.resolveAliasesFrom(currentPropertyDialog.editedCollectionId);
9734
+ const resolvedPath = navigation.resolveIdsFrom(currentPropertyDialog.editedCollectionId);
9550
9735
  return getData(resolvedPath, []);
9551
9736
  } : void 0;
9552
- $[28] = currentPropertyDialog;
9553
- $[29] = getData;
9554
- $[30] = navigation;
9555
- $[31] = t14;
9737
+ $[27] = currentPropertyDialog;
9738
+ $[28] = getData;
9739
+ $[29] = navigation;
9740
+ $[30] = t14;
9556
9741
  } else {
9557
- t14 = $[31];
9742
+ t14 = $[30];
9558
9743
  }
9559
9744
  let t15;
9560
- if ($[32] !== collectionConfigController || $[33] !== currentPropertyDialog || $[34] !== snackbarController) {
9745
+ if ($[31] !== collectionConfigController || $[32] !== currentPropertyDialog || $[33] !== snackbarController) {
9561
9746
  t15 = (t162) => {
9562
9747
  const {
9563
9748
  id: id_0,
@@ -9586,15 +9771,15 @@
9586
9771
  return false;
9587
9772
  });
9588
9773
  };
9589
- $[32] = collectionConfigController;
9590
- $[33] = currentPropertyDialog;
9591
- $[34] = snackbarController;
9592
- $[35] = t15;
9774
+ $[31] = collectionConfigController;
9775
+ $[32] = currentPropertyDialog;
9776
+ $[33] = snackbarController;
9777
+ $[34] = t15;
9593
9778
  } else {
9594
- t15 = $[35];
9779
+ t15 = $[34];
9595
9780
  }
9596
9781
  let t16;
9597
- 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) {
9598
9783
  t16 = () => {
9599
9784
  if (!currentPropertyDialog?.propertyKey) {
9600
9785
  return;
@@ -9617,21 +9802,21 @@
9617
9802
  return false;
9618
9803
  });
9619
9804
  };
9620
- $[36] = collectionConfigController;
9621
- $[37] = currentPropertyDialog?.currentPropertiesOrder;
9622
- $[38] = currentPropertyDialog?.editedCollectionId;
9623
- $[39] = currentPropertyDialog?.namespace;
9624
- $[40] = currentPropertyDialog?.parentCollectionIds;
9625
- $[41] = currentPropertyDialog?.propertyKey;
9626
- $[42] = snackbarController;
9627
- $[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;
9628
9813
  } else {
9629
- t16 = $[43];
9814
+ t16 = $[42];
9630
9815
  }
9631
9816
  let t17;
9632
9817
  let t18;
9633
9818
  let t19;
9634
- if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
9819
+ if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
9635
9820
  t17 = () => {
9636
9821
  setCurrentPropertyDialog(void 0);
9637
9822
  };
@@ -9639,64 +9824,64 @@
9639
9824
  setCurrentPropertyDialog(void 0);
9640
9825
  };
9641
9826
  t19 = {};
9642
- $[44] = t17;
9643
- $[45] = t18;
9644
- $[46] = t19;
9827
+ $[43] = t17;
9828
+ $[44] = t18;
9829
+ $[45] = t19;
9645
9830
  } else {
9646
- t17 = $[44];
9647
- t18 = $[45];
9648
- t19 = $[46];
9831
+ t17 = $[43];
9832
+ t18 = $[44];
9833
+ t19 = $[45];
9649
9834
  }
9650
9835
  let t20;
9651
- if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
9836
+ if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
9652
9837
  t20 = [];
9653
- $[47] = t20;
9838
+ $[46] = t20;
9654
9839
  } else {
9655
- t20 = $[47];
9840
+ t20 = $[46];
9656
9841
  }
9657
9842
  const t21 = currentPropertyDialog?.property;
9658
9843
  const t22 = currentPropertyDialog?.propertyKey;
9659
9844
  let t23;
9660
- 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) {
9661
9846
  t23 = /* @__PURE__ */ jsxRuntime.jsx(PropertyFormDialog, { open: t9, includeIdAndName: true, existingProperty: t10, autoUpdateId: t11, autoOpenTypeSelect: t12, inArray: false, collectionEditable: t13, getData: t14, onPropertyChanged: t15, onPropertyChangedImmediate: false, onDelete: t16, onError: _temp2, onOkClicked: t17, onCancel: t18, initialErrors: t19, forceShowErrors: false, existingPropertyKeys: t20, allowDataInference: true, propertyConfigs, property: t21, propertyKey: t22 });
9662
- $[48] = propertyConfigs;
9663
- $[49] = t10;
9664
- $[50] = t11;
9665
- $[51] = t12;
9666
- $[52] = t13;
9667
- $[53] = t14;
9668
- $[54] = t15;
9669
- $[55] = t16;
9670
- $[56] = t21;
9671
- $[57] = t22;
9672
- $[58] = t9;
9673
- $[59] = t23;
9674
- } else {
9675
- 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];
9676
9861
  }
9677
9862
  let t24;
9678
- if ($[60] !== children || $[61] !== t23 || $[62] !== t5 || $[63] !== t8) {
9863
+ if ($[59] !== children || $[60] !== t23 || $[61] !== t5 || $[62] !== t8) {
9679
9864
  t24 = /* @__PURE__ */ jsxRuntime.jsxs(CollectionEditorContext.Provider, { value: t5, children: [
9680
9865
  children,
9681
9866
  t8,
9682
9867
  t23
9683
9868
  ] });
9684
- $[60] = children;
9685
- $[61] = t23;
9686
- $[62] = t5;
9687
- $[63] = t8;
9688
- $[64] = t24;
9869
+ $[59] = children;
9870
+ $[60] = t23;
9871
+ $[61] = t5;
9872
+ $[62] = t8;
9873
+ $[63] = t24;
9689
9874
  } else {
9690
- t24 = $[64];
9875
+ t24 = $[63];
9691
9876
  }
9692
9877
  let t25;
9693
- if ($[65] !== collectionConfigController || $[66] !== t24) {
9878
+ if ($[64] !== collectionConfigController || $[65] !== t24) {
9694
9879
  t25 = /* @__PURE__ */ jsxRuntime.jsx(ConfigControllerContext.Provider, { value: collectionConfigController, children: t24 });
9695
- $[65] = collectionConfigController;
9696
- $[66] = t24;
9697
- $[67] = t25;
9880
+ $[64] = collectionConfigController;
9881
+ $[65] = t24;
9882
+ $[66] = t25;
9698
9883
  } else {
9699
- t25 = $[67];
9884
+ t25 = $[66];
9700
9885
  }
9701
9886
  return t25;
9702
9887
  }, equal);
@@ -10311,7 +10496,7 @@
10311
10496
  return t8;
10312
10497
  }
10313
10498
  function useCollectionEditorPlugin(t0) {
10314
- const $ = reactCompilerRuntime.c(16);
10499
+ const $ = reactCompilerRuntime.c(15);
10315
10500
  const {
10316
10501
  collectionConfigController,
10317
10502
  configPermissions,
@@ -10321,11 +10506,10 @@
10321
10506
  getUser,
10322
10507
  collectionInference,
10323
10508
  getData,
10324
- onAnalyticsEvent,
10325
- components
10509
+ onAnalyticsEvent
10326
10510
  } = t0;
10327
10511
  let t1;
10328
- 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) {
10329
10513
  t1 = {
10330
10514
  Component: ConfigControllerProvider,
10331
10515
  props: {
@@ -10337,27 +10521,25 @@
10337
10521
  getPathSuggestions,
10338
10522
  getUser,
10339
10523
  getData,
10340
- onAnalyticsEvent,
10341
- components
10524
+ onAnalyticsEvent
10342
10525
  }
10343
10526
  };
10344
10527
  $[0] = collectionConfigController;
10345
10528
  $[1] = collectionInference;
10346
- $[2] = components;
10347
- $[3] = configPermissions;
10348
- $[4] = extraView;
10349
- $[5] = getData;
10350
- $[6] = getPathSuggestions;
10351
- $[7] = getUser;
10352
- $[8] = onAnalyticsEvent;
10353
- $[9] = reservedGroups;
10354
- $[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;
10355
10537
  } else {
10356
- t1 = $[10];
10538
+ t1 = $[9];
10357
10539
  }
10358
10540
  let t2;
10359
10541
  let t3;
10360
- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
10542
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
10361
10543
  t2 = {
10362
10544
  additionalActions: /* @__PURE__ */ jsxRuntime.jsx(NewCollectionButton, {}),
10363
10545
  additionalChildrenStart: /* @__PURE__ */ jsxRuntime.jsx(IntroWidget, {}),
@@ -10370,14 +10552,14 @@
10370
10552
  HeaderAction: CollectionViewHeaderAction,
10371
10553
  AddColumnComponent: PropertyAddColumnComponent
10372
10554
  };
10373
- $[11] = t2;
10374
- $[12] = t3;
10555
+ $[10] = t2;
10556
+ $[11] = t3;
10375
10557
  } else {
10376
- t2 = $[11];
10377
- t3 = $[12];
10558
+ t2 = $[10];
10559
+ t3 = $[11];
10378
10560
  }
10379
10561
  let t4;
10380
- if ($[13] !== collectionConfigController.loading || $[14] !== t1) {
10562
+ if ($[12] !== collectionConfigController.loading || $[13] !== t1) {
10381
10563
  t4 = {
10382
10564
  key: "collection_editor",
10383
10565
  loading: collectionConfigController.loading,
@@ -10385,11 +10567,11 @@
10385
10567
  homePage: t2,
10386
10568
  collectionView: t3
10387
10569
  };
10388
- $[13] = collectionConfigController.loading;
10389
- $[14] = t1;
10390
- $[15] = t4;
10570
+ $[12] = collectionConfigController.loading;
10571
+ $[13] = t1;
10572
+ $[14] = t4;
10391
10573
  } else {
10392
- t4 = $[15];
10574
+ t4 = $[14];
10393
10575
  }
10394
10576
  return t4;
10395
10577
  }
@@ -10465,17 +10647,19 @@
10465
10647
  }
10466
10648
  return t6;
10467
10649
  }
10468
- const mergeCollections = (baseCollections, backendCollections, modifyCollection) => {
10650
+ const mergeCollections = (baseCollections, backendCollections = [], modifyCollection) => {
10469
10651
  const markAsEditable = (c) => {
10470
10652
  core.makePropertiesEditable(c.properties);
10471
10653
  c.subcollections?.forEach(markAsEditable);
10472
10654
  };
10473
- const storedCollections = backendCollections ?? [];
10474
- storedCollections.forEach(markAsEditable);
10475
- console.debug("Collections specified in code:", baseCollections);
10476
- console.debug("Collections stored in the backend", storedCollections);
10477
- const result = core.joinCollectionLists(baseCollections, storedCollections, [], modifyCollection);
10478
- console.debug("Collections after joining:", result);
10655
+ backendCollections.forEach(markAsEditable);
10656
+ const result = core.joinCollectionLists(baseCollections, backendCollections, [], modifyCollection);
10657
+ result.sort((a, b) => baseCollections.findIndex((c) => c.id === a.id) - baseCollections.findIndex((c) => c.id === b.id));
10658
+ console.debug("Collections result", {
10659
+ baseCollections,
10660
+ backendCollections,
10661
+ result
10662
+ });
10479
10663
  return result;
10480
10664
  };
10481
10665
  function MissingReferenceWidget(t0) {