@firecms/collection_editor 3.0.0-beta.14 → 3.0.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/index.es.js +1345 -870
  2. package/dist/index.es.js.map +1 -1
  3. package/dist/index.umd.js +1343 -868
  4. package/dist/index.umd.js.map +1 -1
  5. package/dist/types/collection_inference.d.ts +3 -0
  6. package/dist/types/config_controller.d.ts +3 -1
  7. package/dist/ui/EditorEntityAction.d.ts +2 -0
  8. package/dist/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +1 -1
  9. package/dist/ui/collection_editor/EntityActionsEditTab.d.ts +4 -0
  10. package/dist/ui/collection_editor/EntityActionsSelectDialog.d.ts +4 -0
  11. package/dist/ui/collection_editor/properties/ReferencePropertyField.d.ts +2 -1
  12. package/package.json +8 -8
  13. package/src/types/collection_inference.ts +3 -0
  14. package/src/types/config_controller.tsx +4 -1
  15. package/src/ui/EditorCollectionAction.tsx +2 -7
  16. package/src/ui/EditorEntityAction.tsx +51 -0
  17. package/src/ui/collection_editor/CollectionDetailsForm.tsx +36 -38
  18. package/src/ui/collection_editor/CollectionEditorDialog.tsx +18 -5
  19. package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +10 -4
  20. package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +3 -2
  21. package/src/ui/collection_editor/EntityActionsEditTab.tsx +163 -0
  22. package/src/ui/collection_editor/EntityActionsSelectDialog.tsx +41 -0
  23. package/src/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +5 -2
  24. package/src/ui/collection_editor/GetCodeDialog.tsx +5 -3
  25. package/src/ui/collection_editor/PropertyEditView.tsx +10 -1
  26. package/src/ui/collection_editor/PropertyFieldPreview.tsx +1 -0
  27. package/src/ui/collection_editor/UnsavedChangesDialog.tsx +6 -2
  28. package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +5 -3
  29. package/src/ui/collection_editor/utils/supported_fields.tsx +1 -0
  30. package/src/ui/collection_editor/utils/update_property_for_widget.ts +9 -0
  31. package/src/useCollectionEditorPlugin.tsx +7 -1
  32. package/src/utils/collections.ts +14 -5
package/dist/index.umd.js CHANGED
@@ -169,7 +169,7 @@
169
169
  return t18;
170
170
  }
171
171
  function CollectionDetailsForm(t0) {
172
- const $ = reactCompilerRuntime.c(196);
172
+ const $ = reactCompilerRuntime.c(192);
173
173
  const {
174
174
  isNewCollection,
175
175
  reservedGroups,
@@ -185,7 +185,6 @@
185
185
  touched,
186
186
  errors,
187
187
  setFieldTouched,
188
- isSubmitting,
189
188
  submitCount
190
189
  } = formex.useFormex();
191
190
  useCollectionEditorController();
@@ -253,7 +252,7 @@
253
252
  t5 = $[10];
254
253
  }
255
254
  const collectionIcon = t5;
256
- const groupOptions = groups?.filter((group) => !reservedGroups?.includes(group));
255
+ groups?.filter((group) => !reservedGroups?.includes(group));
257
256
  let t6;
258
257
  if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
259
258
  t6 = {
@@ -263,10 +262,7 @@
263
262
  } else {
264
263
  t6 = $[11];
265
264
  }
266
- const {
267
- autoCompleteOpen,
268
- setAutoCompleteOpen
269
- } = ui.useAutoComplete(t6);
265
+ ui.useAutoComplete(t6);
270
266
  const isSubcollection = !!parentCollection;
271
267
  let customIdValue;
272
268
  if (typeof values.customId === "object") {
@@ -285,333 +281,317 @@
285
281
  }
286
282
  }
287
283
  const showErrors = submitCount > 0;
288
- const t7 = "overflow-auto my-auto";
289
- const T0 = ui.Container;
290
- const t8 = "4xl";
291
- const t9 = "flex flex-col gap-4 p-8 m-auto";
292
- const t10 = !isNewCollection ? "h5" : "h4";
293
- const t11 = isNewCollection ? "New collection" : `${values?.name} collection`;
294
- let t12;
295
- if ($[12] !== t10 || $[13] !== t11) {
296
- t12 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: t10, className: "flex-grow", children: t11 });
297
- $[12] = t10;
298
- $[13] = t11;
299
- $[14] = t12;
284
+ const t7 = !isNewCollection ? "h5" : "h4";
285
+ const t8 = isNewCollection ? "New collection" : `${values?.name} collection`;
286
+ let t9;
287
+ if ($[12] !== t7 || $[13] !== t8) {
288
+ t9 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: t7, className: "flex-grow", children: t8 });
289
+ $[12] = t7;
290
+ $[13] = t8;
291
+ $[14] = t9;
300
292
  } else {
301
- t12 = $[14];
293
+ t9 = $[14];
302
294
  }
303
- let t13;
295
+ let t10;
304
296
  if ($[15] !== updateDatabaseId || $[16] !== values.databaseId) {
305
- t13 = /* @__PURE__ */ jsxRuntime.jsx(DefaultDatabaseField, { databaseId: values.databaseId, onDatabaseIdUpdate: updateDatabaseId });
297
+ t10 = /* @__PURE__ */ jsxRuntime.jsx(DefaultDatabaseField, { databaseId: values.databaseId, onDatabaseIdUpdate: updateDatabaseId });
306
298
  $[15] = updateDatabaseId;
307
299
  $[16] = values.databaseId;
308
- $[17] = t13;
300
+ $[17] = t10;
309
301
  } else {
310
- t13 = $[17];
302
+ t10 = $[17];
311
303
  }
312
- let t14;
304
+ let t11;
313
305
  if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
314
- t14 = () => setIconDialogOpen(true);
315
- $[18] = t14;
306
+ t11 = () => setIconDialogOpen(true);
307
+ $[18] = t11;
316
308
  } else {
317
- t14 = $[18];
309
+ t11 = $[18];
318
310
  }
319
- let t15;
311
+ let t12;
320
312
  if ($[19] !== collectionIcon) {
321
- t15 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Change icon", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { shape: "square", onClick: t14, children: collectionIcon }) });
313
+ t12 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Change icon", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { shape: "square", onClick: t11, children: collectionIcon }) });
322
314
  $[19] = collectionIcon;
323
- $[20] = t15;
315
+ $[20] = t12;
324
316
  } else {
325
- t15 = $[20];
317
+ t12 = $[20];
326
318
  }
327
- let t16;
328
- if ($[21] !== t12 || $[22] !== t13 || $[23] !== t15) {
329
- t16 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row gap-2 py-2 pt-3 items-center", children: [
330
- t12,
331
- t13,
332
- t15
319
+ let t13;
320
+ if ($[21] !== t10 || $[22] !== t12 || $[23] !== t9) {
321
+ t13 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row gap-2 py-2 pt-3 items-center", children: [
322
+ t9,
323
+ t10,
324
+ t12
333
325
  ] });
334
- $[21] = t12;
335
- $[22] = t13;
336
- $[23] = t15;
337
- $[24] = t16;
326
+ $[21] = t10;
327
+ $[22] = t12;
328
+ $[23] = t9;
329
+ $[24] = t13;
338
330
  } else {
339
- t16 = $[24];
331
+ t13 = $[24];
340
332
  }
341
- let t17;
333
+ let t14;
342
334
  if ($[25] !== parentCollection) {
343
- t17 = parentCollection && /* @__PURE__ */ jsxRuntime.jsx(ui.Chip, { colorScheme: "tealDarker", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "caption", children: [
335
+ t14 = parentCollection && /* @__PURE__ */ jsxRuntime.jsx(ui.Chip, { colorScheme: "tealDarker", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "caption", children: [
344
336
  "This is a subcollection of ",
345
337
  /* @__PURE__ */ jsxRuntime.jsx("b", { children: parentCollection.name })
346
338
  ] }) });
347
339
  $[25] = parentCollection;
348
- $[26] = t17;
340
+ $[26] = t14;
349
341
  } else {
350
- t17 = $[26];
342
+ t14 = $[26];
351
343
  }
352
- let t18;
353
- if ($[27] !== t16 || $[28] !== t17) {
354
- t18 = /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
355
- t16,
356
- t17
344
+ let t15;
345
+ if ($[27] !== t13 || $[28] !== t14) {
346
+ t15 = /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
347
+ t13,
348
+ t14
357
349
  ] });
358
- $[27] = t16;
359
- $[28] = t17;
360
- $[29] = t18;
350
+ $[27] = t13;
351
+ $[28] = t14;
352
+ $[29] = t15;
361
353
  } else {
362
- t18 = $[29];
354
+ t15 = $[29];
363
355
  }
364
- const t19 = "grid grid-cols-12 gap-4";
365
- const t20 = values.name ?? "";
366
- let t21;
356
+ const t16 = values.name ?? "";
357
+ let t17;
367
358
  if ($[30] !== updateName) {
368
- t21 = (e) => updateName(e.target.value);
359
+ t17 = (e) => updateName(e.target.value);
369
360
  $[30] = updateName;
370
- $[31] = t21;
361
+ $[31] = t17;
362
+ } else {
363
+ t17 = $[31];
364
+ }
365
+ const t18 = showErrors && Boolean(errors.name);
366
+ let t19;
367
+ if ($[32] !== t16 || $[33] !== t17 || $[34] !== t18) {
368
+ t19 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { value: t16, onChange: t17, label: "Name", autoFocus: true, required: true, error: t18 });
369
+ $[32] = t16;
370
+ $[33] = t17;
371
+ $[34] = t18;
372
+ $[35] = t19;
373
+ } else {
374
+ t19 = $[35];
375
+ }
376
+ const t20 = touched.name && Boolean(errors.name);
377
+ const t21 = touched.name && Boolean(errors.name) ? errors.name : "Name of this collection, usually a plural name (e.g. Products)";
378
+ let t22;
379
+ if ($[36] !== t20 || $[37] !== t21) {
380
+ t22 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t20, children: t21 });
381
+ $[36] = t20;
382
+ $[37] = t21;
383
+ $[38] = t22;
371
384
  } else {
372
- t21 = $[31];
385
+ t22 = $[38];
373
386
  }
374
- const t22 = showErrors && Boolean(errors.name);
375
387
  let t23;
376
- if ($[32] !== t20 || $[33] !== t21 || $[34] !== t22) {
377
- t23 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { value: t20, onChange: t21, label: "Name", autoFocus: true, required: true, error: t22 });
378
- $[32] = t20;
379
- $[33] = t21;
380
- $[34] = t22;
381
- $[35] = t23;
388
+ if ($[39] !== t19 || $[40] !== t22) {
389
+ t23 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
390
+ t19,
391
+ t22
392
+ ] });
393
+ $[39] = t19;
394
+ $[40] = t22;
395
+ $[41] = t23;
382
396
  } else {
383
- t23 = $[35];
397
+ t23 = $[41];
384
398
  }
385
- const t24 = touched.name && Boolean(errors.name);
386
- const t25 = touched.name && Boolean(errors.name) ? errors.name : "Name of this collection, usually a plural name (e.g. Products)";
387
- let t26;
388
- if ($[36] !== t24 || $[37] !== t25) {
389
- t26 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t24, children: t25 });
390
- $[36] = t24;
391
- $[37] = t25;
392
- $[38] = t26;
399
+ let t24;
400
+ if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
401
+ t24 = ui.cls("col-span-12 ");
402
+ $[42] = t24;
393
403
  } else {
394
- t26 = $[38];
404
+ t24 = $[42];
395
405
  }
406
+ const t25 = !isNewCollection;
407
+ const t26 = showErrors && Boolean(errors.path);
396
408
  let t27;
397
- if ($[39] !== t23 || $[40] !== t26) {
398
- t27 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
399
- t23,
400
- t26
409
+ if ($[43] !== t25 || $[44] !== t26) {
410
+ t27 = /* @__PURE__ */ jsxRuntime.jsx(formex.Field, { name: "path", as: ui.DebouncedTextField, label: "Path", disabled: t25, required: true, error: t26 });
411
+ $[43] = t25;
412
+ $[44] = t26;
413
+ $[45] = t27;
414
+ } else {
415
+ t27 = $[45];
416
+ }
417
+ const t28 = touched.path && Boolean(errors.path);
418
+ const t29 = touched.path && Boolean(errors.path) ? errors.path : isSubcollection ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database";
419
+ let t30;
420
+ if ($[46] !== t28 || $[47] !== t29) {
421
+ t30 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t28, children: t29 });
422
+ $[46] = t28;
423
+ $[47] = t29;
424
+ $[48] = t30;
425
+ } else {
426
+ t30 = $[48];
427
+ }
428
+ let t31;
429
+ if ($[49] !== t27 || $[50] !== t30) {
430
+ t31 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t24, children: [
431
+ t27,
432
+ t30
401
433
  ] });
402
- $[39] = t23;
403
- $[40] = t26;
404
- $[41] = t27;
434
+ $[49] = t27;
435
+ $[50] = t30;
436
+ $[51] = t31;
405
437
  } else {
406
- t27 = $[41];
438
+ t31 = $[51];
407
439
  }
408
- const t28 = isSubcollection ? "" : "sm:col-span-8";
409
- let t29;
410
- if ($[42] !== t28) {
411
- t29 = ui.cls("col-span-12 ", t28);
412
- $[42] = t28;
413
- $[43] = t29;
414
- } else {
415
- t29 = $[43];
416
- }
417
- const t30 = !isNewCollection;
418
- const t31 = showErrors && Boolean(errors.path);
419
- let t32;
420
- if ($[44] !== t30 || $[45] !== t31) {
421
- t32 = /* @__PURE__ */ jsxRuntime.jsx(formex.Field, { name: "path", as: ui.DebouncedTextField, label: "Path", disabled: t30, required: true, error: t31 });
422
- $[44] = t30;
423
- $[45] = t31;
424
- $[46] = t32;
425
- } else {
426
- t32 = $[46];
427
- }
428
- const t33 = touched.path && Boolean(errors.path);
429
- const t34 = touched.path && Boolean(errors.path) ? errors.path : isSubcollection ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database";
430
- let t35;
431
- if ($[47] !== t33 || $[48] !== t34) {
432
- t35 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t33, children: t34 });
433
- $[47] = t33;
434
- $[48] = t34;
435
- $[49] = t35;
436
- } else {
437
- t35 = $[49];
440
+ const t32 = values.openEntityMode ?? "side_panel";
441
+ let t33;
442
+ if ($[52] !== setFieldValue) {
443
+ t33 = (value) => setFieldValue("openEntityMode", value);
444
+ $[52] = setFieldValue;
445
+ $[53] = t33;
446
+ } else {
447
+ t33 = $[53];
438
448
  }
439
- let t36;
440
- if ($[50] !== t29 || $[51] !== t32 || $[52] !== t35) {
441
- t36 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t29, children: [
442
- t32,
443
- t35
444
- ] });
445
- $[50] = t29;
446
- $[51] = t32;
447
- $[52] = t35;
448
- $[53] = t36;
449
- } else {
450
- t36 = $[53];
451
- }
452
- const t37 = !isSubcollection && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12 sm:col-span-4 relative", children: [
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" }),
454
- /* @__PURE__ */ jsxRuntime.jsx(ui.Autocomplete, { open: autoCompleteOpen && (groupOptions ?? []).length > 0, setOpen: setAutoCompleteOpen, children: groupOptions?.map((group_0, index) => /* @__PURE__ */ jsxRuntime.jsx(ui.AutocompleteItem, { className: "pr-6 pl-14", onClick: () => {
455
- setAutoCompleteOpen(false);
456
- setFieldValue("group", group_0 ?? null);
457
- }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-grow", children: group_0 }) }, index + "_" + group_0)) }),
458
- /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: showErrors && Boolean(errors.group) ? errors.group : "Group in the home page" })
459
- ] });
460
- const t38 = values.openEntityMode ?? "side_panel";
461
- let t39;
462
- if ($[54] !== setFieldValue) {
463
- t39 = (value) => setFieldValue("openEntityMode", value);
464
- $[54] = setFieldValue;
465
- $[55] = t39;
449
+ let t34;
450
+ if ($[54] !== t32 || $[55] !== t33) {
451
+ t34 = /* @__PURE__ */ jsxRuntime.jsx(LayoutModeSwitch, { className: "col-span-12", value: t32, onChange: t33 });
452
+ $[54] = t32;
453
+ $[55] = t33;
454
+ $[56] = t34;
466
455
  } else {
467
- t39 = $[55];
456
+ t34 = $[56];
468
457
  }
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;
458
+ const t35 = values.history === null || values.history === void 0 ? "Document history revisions enabled if enabled globally" : values.history ? "Document history revisions ENABLED" : "Document history revisions NOT enabled";
459
+ let t36;
460
+ if ($[57] !== setFieldValue) {
461
+ t36 = (v) => setFieldValue("history", v);
462
+ $[57] = setFieldValue;
463
+ $[58] = t36;
475
464
  } else {
476
- t40 = $[58];
465
+ t36 = $[58];
477
466
  }
478
- const t41 = values.history === null || values.history === void 0 ? "Document history revisions enabled if enabled globally" : values.history ? "Document history revisions ENABLED" : "Document history revisions NOT enabled";
479
- let t42;
480
- if ($[59] !== setFieldValue) {
481
- t42 = (v) => setFieldValue("history", v);
482
- $[59] = setFieldValue;
483
- $[60] = t42;
467
+ const t37 = values.history === void 0 ? null : values.history;
468
+ let t38;
469
+ if ($[59] !== t35 || $[60] !== t36 || $[61] !== t37) {
470
+ t38 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "large", allowIndeterminate: true, label: t35, onValueChange: t36, value: t37 });
471
+ $[59] = t35;
472
+ $[60] = t36;
473
+ $[61] = t37;
474
+ $[62] = t38;
484
475
  } else {
485
- t42 = $[60];
476
+ t38 = $[62];
486
477
  }
487
- const t43 = values.history === void 0 ? null : values.history;
488
- let t44;
489
- if ($[61] !== t41 || $[62] !== t42 || $[63] !== t43) {
490
- t44 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "large", allowIndeterminate: true, label: t41, onValueChange: t42, value: t43 });
491
- $[61] = t41;
492
- $[62] = t42;
493
- $[63] = t43;
494
- $[64] = t44;
495
- } else {
496
- t44 = $[64];
497
- }
498
- let t45;
499
- if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
500
- t45 = /* @__PURE__ */ jsxRuntime.jsxs(core.FieldCaption, { children: [
478
+ let t39;
479
+ if ($[63] === Symbol.for("react.memo_cache_sentinel")) {
480
+ t39 = /* @__PURE__ */ jsxRuntime.jsxs(core.FieldCaption, { children: [
501
481
  "When enabled, each document in this collection will have a history of changes. This is useful for auditing purposes. The data is stored in a subcollection of the document in your database, called ",
502
482
  /* @__PURE__ */ jsxRuntime.jsx("b", { children: "__history" }),
503
483
  "."
504
484
  ] });
505
- $[65] = t45;
485
+ $[63] = t39;
506
486
  } else {
507
- t45 = $[65];
487
+ t39 = $[63];
508
488
  }
509
- let t46;
510
- if ($[66] !== t44) {
511
- t46 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
512
- t44,
513
- t45
489
+ let t40;
490
+ if ($[64] !== t38) {
491
+ t40 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
492
+ t38,
493
+ t39
514
494
  ] });
515
- $[66] = t44;
516
- $[67] = t46;
495
+ $[64] = t38;
496
+ $[65] = t40;
517
497
  } else {
518
- t46 = $[67];
498
+ t40 = $[65];
519
499
  }
520
- let t47;
521
- if ($[68] === Symbol.for("react.memo_cache_sentinel")) {
522
- t47 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row text-surface-500", children: [
500
+ let t41;
501
+ if ($[66] === Symbol.for("react.memo_cache_sentinel")) {
502
+ t41 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row text-surface-500", children: [
523
503
  /* @__PURE__ */ jsxRuntime.jsx(ui.SettingsIcon, {}),
524
504
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "ml-2", children: "Advanced" })
525
505
  ] });
526
- $[68] = t47;
506
+ $[66] = t41;
527
507
  } else {
528
- t47 = $[68];
508
+ t41 = $[66];
529
509
  }
530
- const t48 = !isNewCollection;
531
- const t49 = showErrors && Boolean(errors.id);
532
- let t50;
533
- if ($[69] !== t48 || $[70] !== t49) {
534
- t50 = /* @__PURE__ */ jsxRuntime.jsx(formex.Field, { name: "id", as: ui.DebouncedTextField, disabled: t48, label: "Collection id", error: t49 });
535
- $[69] = t48;
536
- $[70] = t49;
537
- $[71] = t50;
538
- } else {
539
- t50 = $[71];
540
- }
541
- const t51 = touched.id && Boolean(errors.id);
542
- const t52 = touched.id && Boolean(errors.id) ? errors.id : "This id identifies this collection. Typically the same as the path.";
543
- let t53;
544
- if ($[72] !== t51 || $[73] !== t52) {
545
- t53 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t51, children: t52 });
546
- $[72] = t51;
547
- $[73] = t52;
548
- $[74] = t53;
549
- } else {
550
- t53 = $[74];
551
- }
552
- let t54;
553
- if ($[75] !== t50 || $[76] !== t53) {
554
- t54 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
555
- t50,
556
- t53
557
- ] });
558
- $[75] = t50;
559
- $[76] = t53;
560
- $[77] = t54;
561
- } else {
562
- t54 = $[77];
563
- }
564
- const t55 = showErrors && Boolean(errors.singularName);
565
- let t56;
566
- if ($[78] !== handleChange || $[79] !== setFieldTouched) {
567
- t56 = (e_0) => {
568
- setFieldTouched("singularName", true);
569
- return handleChange(e_0);
570
- };
571
- $[78] = handleChange;
572
- $[79] = setFieldTouched;
573
- $[80] = t56;
510
+ const t42 = !isNewCollection;
511
+ const t43 = showErrors && Boolean(errors.id);
512
+ let t44;
513
+ if ($[67] !== t42 || $[68] !== t43) {
514
+ t44 = /* @__PURE__ */ jsxRuntime.jsx(formex.Field, { name: "id", as: ui.DebouncedTextField, disabled: t42, label: "Collection id", error: t43 });
515
+ $[67] = t42;
516
+ $[68] = t43;
517
+ $[69] = t44;
574
518
  } else {
575
- t56 = $[80];
519
+ t44 = $[69];
576
520
  }
577
- const t57 = values.singularName ?? "";
578
- let t58;
579
- if ($[81] !== t55 || $[82] !== t56 || $[83] !== t57) {
580
- t58 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { error: t55, name: "singularName", "aria-describedby": "singularName-helper", onChange: t56, value: t57, label: "Singular name" });
581
- $[81] = t55;
582
- $[82] = t56;
583
- $[83] = t57;
584
- $[84] = t58;
521
+ const t45 = touched.id && Boolean(errors.id);
522
+ const t46 = touched.id && Boolean(errors.id) ? errors.id : "This id identifies this collection. Typically the same as the path.";
523
+ let t47;
524
+ if ($[70] !== t45 || $[71] !== t46) {
525
+ t47 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t45, children: t46 });
526
+ $[70] = t45;
527
+ $[71] = t46;
528
+ $[72] = t47;
585
529
  } else {
586
- t58 = $[84];
530
+ t47 = $[72];
587
531
  }
588
- const t59 = showErrors && Boolean(errors.singularName);
589
- const t60 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define a singular name for your entities";
590
- let t61;
591
- if ($[85] !== t59 || $[86] !== t60) {
592
- t61 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t59, children: t60 });
593
- $[85] = t59;
594
- $[86] = t60;
595
- $[87] = t61;
532
+ let t48;
533
+ if ($[73] !== t44 || $[74] !== t47) {
534
+ t48 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
535
+ t44,
536
+ t47
537
+ ] });
538
+ $[73] = t44;
539
+ $[74] = t47;
540
+ $[75] = t48;
596
541
  } else {
597
- t61 = $[87];
542
+ t48 = $[75];
598
543
  }
599
- let t62;
600
- if ($[88] !== t58 || $[89] !== t61) {
601
- t62 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
602
- t58,
603
- t61
544
+ const t49 = showErrors && Boolean(errors.singularName);
545
+ let t50;
546
+ if ($[76] !== handleChange || $[77] !== setFieldTouched) {
547
+ t50 = (e_0) => {
548
+ setFieldTouched("singularName", true);
549
+ return handleChange(e_0);
550
+ };
551
+ $[76] = handleChange;
552
+ $[77] = setFieldTouched;
553
+ $[78] = t50;
554
+ } else {
555
+ t50 = $[78];
556
+ }
557
+ const t51 = values.singularName ?? "";
558
+ let t52;
559
+ if ($[79] !== t49 || $[80] !== t50 || $[81] !== t51) {
560
+ t52 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { error: t49, name: "singularName", "aria-describedby": "singularName-helper", onChange: t50, value: t51, label: "Singular name" });
561
+ $[79] = t49;
562
+ $[80] = t50;
563
+ $[81] = t51;
564
+ $[82] = t52;
565
+ } else {
566
+ t52 = $[82];
567
+ }
568
+ const t53 = showErrors && Boolean(errors.singularName);
569
+ const t54 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define a singular name for your entities";
570
+ let t55;
571
+ if ($[83] !== t53 || $[84] !== t54) {
572
+ t55 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t53, children: t54 });
573
+ $[83] = t53;
574
+ $[84] = t54;
575
+ $[85] = t55;
576
+ } else {
577
+ t55 = $[85];
578
+ }
579
+ let t56;
580
+ if ($[86] !== t52 || $[87] !== t55) {
581
+ t56 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
582
+ t52,
583
+ t55
604
584
  ] });
605
- $[88] = t58;
606
- $[89] = t61;
607
- $[90] = t62;
585
+ $[86] = t52;
586
+ $[87] = t55;
587
+ $[88] = t56;
608
588
  } else {
609
- t62 = $[90];
589
+ t56 = $[88];
610
590
  }
611
- const t63 = showErrors && Boolean(errors.sideDialogWidth);
612
- let t64;
613
- if ($[91] !== setFieldTouched || $[92] !== setFieldValue) {
614
- t64 = (e_1) => {
591
+ const t57 = showErrors && Boolean(errors.sideDialogWidth);
592
+ let t58;
593
+ if ($[89] !== setFieldTouched || $[90] !== setFieldValue) {
594
+ t58 = (e_1) => {
615
595
  setFieldTouched("sideDialogWidth", true);
616
596
  const value_0 = e_1.target.value;
617
597
  if (!value_0) {
@@ -622,404 +602,402 @@
622
602
  }
623
603
  }
624
604
  };
625
- $[91] = setFieldTouched;
626
- $[92] = setFieldValue;
627
- $[93] = t64;
605
+ $[89] = setFieldTouched;
606
+ $[90] = setFieldValue;
607
+ $[91] = t58;
628
608
  } else {
629
- t64 = $[93];
609
+ t58 = $[91];
630
610
  }
631
- let t65;
632
- if ($[94] !== setFieldValue) {
633
- t65 = () => {
611
+ let t59;
612
+ if ($[92] !== setFieldValue) {
613
+ t59 = () => {
634
614
  setFieldValue("sideDialogWidth", null);
635
615
  };
636
- $[94] = setFieldValue;
637
- $[95] = t65;
616
+ $[92] = setFieldValue;
617
+ $[93] = t59;
618
+ } else {
619
+ t59 = $[93];
620
+ }
621
+ const t60 = !values.sideDialogWidth;
622
+ let t61;
623
+ if ($[94] === Symbol.for("react.memo_cache_sentinel")) {
624
+ t61 = /* @__PURE__ */ jsxRuntime.jsx(ui.CloseIcon, { size: "small" });
625
+ $[94] = t61;
626
+ } else {
627
+ t61 = $[94];
628
+ }
629
+ let t62;
630
+ if ($[95] !== t59 || $[96] !== t60) {
631
+ t62 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: t59, disabled: t60, children: t61 });
632
+ $[95] = t59;
633
+ $[96] = t60;
634
+ $[97] = t62;
638
635
  } else {
639
- t65 = $[95];
636
+ t62 = $[97];
640
637
  }
641
- const t66 = !values.sideDialogWidth;
638
+ const t63 = values.sideDialogWidth ?? "";
639
+ let t64;
640
+ if ($[98] !== t57 || $[99] !== t58 || $[100] !== t62 || $[101] !== t63) {
641
+ t64 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { error: t57, name: "sideDialogWidth", type: "number", "aria-describedby": "sideDialogWidth-helper", onChange: t58, endAdornment: t62, value: t63, label: "Side dialog width" });
642
+ $[98] = t57;
643
+ $[99] = t58;
644
+ $[100] = t62;
645
+ $[101] = t63;
646
+ $[102] = t64;
647
+ } else {
648
+ t64 = $[102];
649
+ }
650
+ const t65 = showErrors && Boolean(errors.singularName);
651
+ const t66 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px";
642
652
  let t67;
643
- if ($[96] === Symbol.for("react.memo_cache_sentinel")) {
644
- t67 = /* @__PURE__ */ jsxRuntime.jsx(ui.CloseIcon, { size: "small" });
645
- $[96] = t67;
653
+ if ($[103] !== t65 || $[104] !== t66) {
654
+ t67 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t65, children: t66 });
655
+ $[103] = t65;
656
+ $[104] = t66;
657
+ $[105] = t67;
646
658
  } else {
647
- t67 = $[96];
659
+ t67 = $[105];
648
660
  }
649
661
  let t68;
650
- if ($[97] !== t65 || $[98] !== t66) {
651
- t68 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: t65, disabled: t66, children: t67 });
652
- $[97] = t65;
653
- $[98] = t66;
654
- $[99] = t68;
655
- } else {
656
- t68 = $[99];
657
- }
658
- const t69 = values.sideDialogWidth ?? "";
659
- let t70;
660
- if ($[100] !== t63 || $[101] !== t64 || $[102] !== t68 || $[103] !== t69) {
661
- t70 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { error: t63, name: "sideDialogWidth", type: "number", "aria-describedby": "sideDialogWidth-helper", onChange: t64, endAdornment: t68, value: t69, label: "Side dialog width" });
662
- $[100] = t63;
663
- $[101] = t64;
664
- $[102] = t68;
665
- $[103] = t69;
666
- $[104] = t70;
667
- } else {
668
- t70 = $[104];
669
- }
670
- const t71 = showErrors && Boolean(errors.singularName);
671
- const t72 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px";
672
- let t73;
673
- if ($[105] !== t71 || $[106] !== t72) {
674
- t73 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t71, children: t72 });
675
- $[105] = t71;
676
- $[106] = t72;
677
- $[107] = t73;
678
- } else {
679
- t73 = $[107];
680
- }
662
+ if ($[106] !== t64 || $[107] !== t67) {
663
+ t68 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
664
+ t64,
665
+ t67
666
+ ] });
667
+ $[106] = t64;
668
+ $[107] = t67;
669
+ $[108] = t68;
670
+ } else {
671
+ t68 = $[108];
672
+ }
673
+ const t69 = showErrors && Boolean(errors.description);
674
+ const t70 = values.description ?? "";
675
+ let t71;
676
+ if ($[109] !== handleChange || $[110] !== t69 || $[111] !== t70) {
677
+ t71 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { error: t69, name: "description", value: t70, onChange: handleChange, multiline: true, minRows: 2, "aria-describedby": "description-helper-text", label: "Description" });
678
+ $[109] = handleChange;
679
+ $[110] = t69;
680
+ $[111] = t70;
681
+ $[112] = t71;
682
+ } else {
683
+ t71 = $[112];
684
+ }
685
+ const t72 = showErrors && Boolean(errors.description);
686
+ const t73 = showErrors && Boolean(errors.description) ? errors.description : "Description of the collection, you can use markdown";
681
687
  let t74;
682
- if ($[108] !== t70 || $[109] !== t73) {
683
- t74 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
684
- t70,
685
- t73
688
+ if ($[113] !== t72 || $[114] !== t73) {
689
+ t74 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t72, children: t73 });
690
+ $[113] = t72;
691
+ $[114] = t73;
692
+ $[115] = t74;
693
+ } else {
694
+ t74 = $[115];
695
+ }
696
+ let t75;
697
+ if ($[116] !== t71 || $[117] !== t74) {
698
+ t75 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
699
+ t71,
700
+ t74
686
701
  ] });
687
- $[108] = t70;
688
- $[109] = t73;
689
- $[110] = t74;
702
+ $[116] = t71;
703
+ $[117] = t74;
704
+ $[118] = t75;
690
705
  } else {
691
- t74 = $[110];
706
+ t75 = $[118];
692
707
  }
693
- const t75 = showErrors && Boolean(errors.description);
694
- const t76 = values.description ?? "";
708
+ const t76 = values.defaultSize ?? "";
695
709
  let t77;
696
- if ($[111] !== handleChange || $[112] !== t75 || $[113] !== t76) {
697
- t77 = /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { error: t75, name: "description", value: t76, onChange: handleChange, multiline: true, minRows: 2, "aria-describedby": "description-helper-text", label: "Description" });
698
- $[111] = handleChange;
699
- $[112] = t75;
700
- $[113] = t76;
701
- $[114] = t77;
710
+ if ($[119] === Symbol.for("react.memo_cache_sentinel")) {
711
+ t77 = ["xs", "s", "m", "l", "xl"].map(_temp2$8);
712
+ $[119] = t77;
713
+ } else {
714
+ t77 = $[119];
715
+ }
716
+ let t78;
717
+ if ($[120] !== handleChange || $[121] !== t76) {
718
+ t78 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { name: "defaultSize", size: "large", fullWidth: true, label: "Default row size", position: "item-aligned", onChange: handleChange, value: t76, renderValue: _temp$c, children: t77 }) });
719
+ $[120] = handleChange;
720
+ $[121] = t76;
721
+ $[122] = t78;
702
722
  } else {
703
- t77 = $[114];
723
+ t78 = $[122];
704
724
  }
705
- const t78 = showErrors && Boolean(errors.description);
706
- const t79 = showErrors && Boolean(errors.description) ? errors.description : "Description of the collection, you can use markdown";
725
+ const t79 = values.includeJsonView === void 0 || values.includeJsonView ? "Include JSON view" : "Do not include JSON view";
707
726
  let t80;
708
- if ($[115] !== t78 || $[116] !== t79) {
709
- t80 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { error: t78, children: t79 });
710
- $[115] = t78;
711
- $[116] = t79;
712
- $[117] = t80;
727
+ if ($[123] !== setFieldValue) {
728
+ t80 = (v_0) => setFieldValue("includeJsonView", v_0);
729
+ $[123] = setFieldValue;
730
+ $[124] = t80;
713
731
  } else {
714
- t80 = $[117];
732
+ t80 = $[124];
715
733
  }
716
- let t81;
717
- if ($[118] !== t77 || $[119] !== t80) {
718
- t81 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
719
- t77,
720
- t80
721
- ] });
722
- $[118] = t77;
723
- $[119] = t80;
724
- $[120] = t81;
734
+ const t81 = values.includeJsonView === void 0 ? true : values.includeJsonView;
735
+ let t82;
736
+ if ($[125] !== t79 || $[126] !== t80 || $[127] !== t81) {
737
+ t82 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "large", label: t79, onValueChange: t80, value: t81 });
738
+ $[125] = t79;
739
+ $[126] = t80;
740
+ $[127] = t81;
741
+ $[128] = t82;
725
742
  } else {
726
- t81 = $[120];
743
+ t82 = $[128];
727
744
  }
728
- const t82 = values.defaultSize ?? "";
729
745
  let t83;
730
- if ($[121] === Symbol.for("react.memo_cache_sentinel")) {
731
- t83 = ["xs", "s", "m", "l", "xl"].map(_temp2$7);
732
- $[121] = t83;
746
+ if ($[129] === Symbol.for("react.memo_cache_sentinel")) {
747
+ t83 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: "Include the JSON representation of the document." });
748
+ $[129] = t83;
733
749
  } else {
734
- t83 = $[121];
750
+ t83 = $[129];
735
751
  }
736
752
  let t84;
737
- if ($[122] !== handleChange || $[123] !== t82) {
738
- t84 = /* @__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: t82, renderValue: _temp$b, children: t83 }) });
739
- $[122] = handleChange;
740
- $[123] = t82;
741
- $[124] = t84;
753
+ if ($[130] !== t82) {
754
+ t84 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
755
+ t82,
756
+ t83
757
+ ] });
758
+ $[130] = t82;
759
+ $[131] = t84;
742
760
  } else {
743
- t84 = $[124];
761
+ t84 = $[131];
744
762
  }
745
- const t85 = values.includeJsonView === void 0 || values.includeJsonView ? "Include JSON view" : "Do not include JSON view";
763
+ const t85 = customIdValue === "code_defined";
746
764
  let t86;
747
- if ($[125] !== setFieldValue) {
748
- t86 = (v_0) => setFieldValue("includeJsonView", v_0);
749
- $[125] = setFieldValue;
750
- $[126] = t86;
765
+ if ($[132] !== setFieldValue) {
766
+ t86 = (v_1) => {
767
+ if (v_1 === "code_defined") {
768
+ throw new Error("This should not happen");
769
+ }
770
+ setFieldValue("customId", v_1);
771
+ };
772
+ $[132] = setFieldValue;
773
+ $[133] = t86;
751
774
  } else {
752
- t86 = $[126];
775
+ t86 = $[133];
753
776
  }
754
- const t87 = values.includeJsonView === void 0 ? true : values.includeJsonView;
777
+ const t87 = customIdValue ?? "";
755
778
  let t88;
756
- if ($[127] !== t85 || $[128] !== t86 || $[129] !== t87) {
757
- t88 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "large", label: t85, onValueChange: t86, value: t87 });
758
- $[127] = t85;
759
- $[128] = t86;
760
- $[129] = t87;
761
- $[130] = t88;
762
- } else {
763
- t88 = $[130];
764
- }
765
779
  let t89;
766
- if ($[131] === Symbol.for("react.memo_cache_sentinel")) {
767
- t89 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: "Include the JSON representation of the document." });
768
- $[131] = t89;
769
- } else {
770
- t89 = $[131];
771
- }
772
780
  let t90;
773
- if ($[132] !== t88) {
774
- t90 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
781
+ if ($[134] === Symbol.for("react.memo_cache_sentinel")) {
782
+ t88 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "false", children: "Document ID is generated automatically" });
783
+ t89 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "true", children: "Users must define an ID" });
784
+ t90 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
785
+ $[134] = t88;
786
+ $[135] = t89;
787
+ $[136] = t90;
788
+ } else {
789
+ t88 = $[134];
790
+ t89 = $[135];
791
+ t90 = $[136];
792
+ }
793
+ let t91;
794
+ if ($[137] !== t85 || $[138] !== t86 || $[139] !== t87) {
795
+ t91 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { name: "customId", label: "Document IDs generation", position: "item-aligned", size: "large", fullWidth: true, disabled: t85, onValueChange: t86, value: t87, renderValue: _temp3$5, children: [
775
796
  t88,
776
- t89
777
- ] });
778
- $[132] = t88;
779
- $[133] = t90;
797
+ t89,
798
+ t90
799
+ ] }) });
800
+ $[137] = t85;
801
+ $[138] = t86;
802
+ $[139] = t87;
803
+ $[140] = t91;
780
804
  } else {
781
- t90 = $[133];
805
+ t91 = $[140];
782
806
  }
783
- const t91 = customIdValue === "code_defined";
784
807
  let t92;
785
- if ($[134] !== setFieldValue) {
786
- t92 = (v_1) => {
787
- if (v_1 === "code_defined") {
788
- throw new Error("This should not happen");
789
- }
790
- setFieldValue("customId", v_1);
791
- };
792
- $[134] = setFieldValue;
793
- $[135] = t92;
808
+ if ($[141] !== setFieldValue) {
809
+ t92 = (v_2) => setFieldValue("collectionGroup", v_2);
810
+ $[141] = setFieldValue;
811
+ $[142] = t92;
794
812
  } else {
795
- t92 = $[135];
813
+ t92 = $[142];
796
814
  }
797
- const t93 = customIdValue ?? "";
815
+ const t93 = values.collectionGroup ?? false;
798
816
  let t94;
817
+ if ($[143] !== t92 || $[144] !== t93) {
818
+ t94 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "large", label: "Collection group", onValueChange: t92, value: t93 });
819
+ $[143] = t92;
820
+ $[144] = t93;
821
+ $[145] = t94;
822
+ } else {
823
+ t94 = $[145];
824
+ }
799
825
  let t95;
826
+ if ($[146] === Symbol.for("react.memo_cache_sentinel")) {
827
+ t95 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." });
828
+ $[146] = t95;
829
+ } else {
830
+ t95 = $[146];
831
+ }
800
832
  let t96;
801
- if ($[136] === Symbol.for("react.memo_cache_sentinel")) {
802
- t94 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "false", children: "Document ID is generated automatically" });
803
- t95 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "true", children: "Users must define an ID" });
804
- t96 = /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
805
- $[136] = t94;
806
- $[137] = t95;
807
- $[138] = t96;
808
- } else {
809
- t94 = $[136];
810
- t95 = $[137];
811
- t96 = $[138];
833
+ if ($[147] !== t94) {
834
+ t96 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12 mt-4", children: [
835
+ t94,
836
+ t95
837
+ ] });
838
+ $[147] = t94;
839
+ $[148] = t96;
840
+ } else {
841
+ t96 = $[148];
812
842
  }
813
843
  let t97;
814
- if ($[139] !== t91 || $[140] !== t92 || $[141] !== t93) {
815
- t97 = /* @__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: t91, onValueChange: t92, value: t93, renderValue: _temp3$4, children: [
816
- t94,
817
- t95,
818
- t96
819
- ] }) });
820
- $[139] = t91;
821
- $[140] = t92;
822
- $[141] = t93;
823
- $[142] = t97;
844
+ if ($[149] !== setFieldValue) {
845
+ t97 = (v_3) => setFieldValue("textSearchEnabled", v_3);
846
+ $[149] = setFieldValue;
847
+ $[150] = t97;
824
848
  } else {
825
- t97 = $[142];
849
+ t97 = $[150];
826
850
  }
827
- let t98;
828
- if ($[143] !== setFieldValue) {
829
- t98 = (v_2) => setFieldValue("collectionGroup", v_2);
830
- $[143] = setFieldValue;
831
- $[144] = t98;
851
+ const t98 = values.textSearchEnabled ?? false;
852
+ let t99;
853
+ if ($[151] !== t97 || $[152] !== t98) {
854
+ t99 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "large", label: "Enable text search for this collection", onValueChange: t97, value: t98 });
855
+ $[151] = t97;
856
+ $[152] = t98;
857
+ $[153] = t99;
832
858
  } else {
833
- t98 = $[144];
859
+ t99 = $[153];
834
860
  }
835
- const t99 = values.collectionGroup ?? false;
836
861
  let t100;
837
- if ($[145] !== t98 || $[146] !== t99) {
838
- t100 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "large", label: "Collection group", onValueChange: t98, value: t99 });
839
- $[145] = t98;
840
- $[146] = t99;
841
- $[147] = t100;
862
+ if ($[154] === Symbol.for("react.memo_cache_sentinel")) {
863
+ t100 = /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: "Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues." });
864
+ $[154] = t100;
842
865
  } else {
843
- t100 = $[147];
866
+ t100 = $[154];
844
867
  }
845
868
  let t101;
846
- if ($[148] === Symbol.for("react.memo_cache_sentinel")) {
847
- t101 = /* @__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." });
848
- $[148] = t101;
869
+ if ($[155] !== t99) {
870
+ t101 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
871
+ t99,
872
+ t100
873
+ ] });
874
+ $[155] = t99;
875
+ $[156] = t101;
849
876
  } else {
850
- t101 = $[148];
877
+ t101 = $[156];
851
878
  }
852
879
  let t102;
853
- if ($[149] !== t100) {
854
- t102 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12 mt-4", children: [
855
- t100,
880
+ if ($[157] !== t101 || $[158] !== t48 || $[159] !== t56 || $[160] !== t68 || $[161] !== t75 || $[162] !== t78 || $[163] !== t84 || $[164] !== t91 || $[165] !== t96) {
881
+ t102 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
882
+ t48,
883
+ t56,
884
+ t68,
885
+ t75,
886
+ t78,
887
+ t84,
888
+ t91,
889
+ t96,
856
890
  t101
857
891
  ] });
858
- $[149] = t100;
859
- $[150] = t102;
860
- } else {
861
- t102 = $[150];
892
+ $[157] = t101;
893
+ $[158] = t48;
894
+ $[159] = t56;
895
+ $[160] = t68;
896
+ $[161] = t75;
897
+ $[162] = t78;
898
+ $[163] = t84;
899
+ $[164] = t91;
900
+ $[165] = t96;
901
+ $[166] = t102;
902
+ } else {
903
+ t102 = $[166];
862
904
  }
863
905
  let t103;
864
- if ($[151] !== setFieldValue) {
865
- t103 = (v_3) => setFieldValue("textSearchEnabled", v_3);
866
- $[151] = setFieldValue;
867
- $[152] = t103;
868
- } else {
869
- t103 = $[152];
870
- }
871
- const t104 = values.textSearchEnabled ?? false;
872
- let t105;
873
- if ($[153] !== t103 || $[154] !== t104) {
874
- t105 = /* @__PURE__ */ jsxRuntime.jsx(ui.BooleanSwitchWithLabel, { position: "start", size: "large", label: "Enable text search for this collection", onValueChange: t103, value: t104 });
875
- $[153] = t103;
876
- $[154] = t104;
877
- $[155] = t105;
878
- } else {
879
- t105 = $[155];
880
- }
881
- let t106;
882
- if ($[156] === Symbol.for("react.memo_cache_sentinel")) {
883
- t106 = /* @__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." });
884
- $[156] = t106;
885
- } else {
886
- t106 = $[156];
887
- }
888
- let t107;
889
- if ($[157] !== t105) {
890
- t107 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
891
- t105,
892
- t106
893
- ] });
894
- $[157] = t105;
895
- $[158] = t107;
896
- } else {
897
- t107 = $[158];
898
- }
899
- let t108;
900
- if ($[159] !== t102 || $[160] !== t107 || $[161] !== t54 || $[162] !== t62 || $[163] !== t74 || $[164] !== t81 || $[165] !== t84 || $[166] !== t90 || $[167] !== t97) {
901
- t108 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
902
- t54,
903
- t62,
904
- t74,
905
- t81,
906
- t84,
907
- t90,
908
- t97,
909
- t102,
910
- t107
911
- ] });
912
- $[159] = t102;
913
- $[160] = t107;
914
- $[161] = t54;
915
- $[162] = t62;
916
- $[163] = t74;
917
- $[164] = t81;
918
- $[165] = t84;
919
- $[166] = t90;
920
- $[167] = t97;
921
- $[168] = t108;
922
- } else {
923
- t108 = $[168];
924
- }
925
- let t109;
926
- if ($[169] !== advancedPanelExpanded || $[170] !== t108) {
927
- t109 = /* @__PURE__ */ jsxRuntime.jsx(ui.ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t47, initiallyExpanded: false, children: t108 });
928
- $[169] = advancedPanelExpanded;
929
- $[170] = t108;
930
- $[171] = t109;
931
- } else {
932
- t109 = $[171];
933
- }
934
- let t110;
935
- if ($[172] !== children || $[173] !== t109) {
936
- t110 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12 mt-8", children: [
937
- t109,
906
+ if ($[167] !== advancedPanelExpanded || $[168] !== t102) {
907
+ t103 = /* @__PURE__ */ jsxRuntime.jsx(ui.ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t41, initiallyExpanded: false, children: t102 });
908
+ $[167] = advancedPanelExpanded;
909
+ $[168] = t102;
910
+ $[169] = t103;
911
+ } else {
912
+ t103 = $[169];
913
+ }
914
+ let t104;
915
+ if ($[170] !== children || $[171] !== t103) {
916
+ t104 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12 mt-8", children: [
917
+ t103,
938
918
  children
939
919
  ] });
940
- $[172] = children;
941
- $[173] = t109;
942
- $[174] = t110;
920
+ $[170] = children;
921
+ $[171] = t103;
922
+ $[172] = t104;
943
923
  } else {
944
- t110 = $[174];
924
+ t104 = $[172];
945
925
  }
946
- let t111;
947
- if ($[175] !== t110 || $[176] !== t27 || $[177] !== t36 || $[178] !== t37 || $[179] !== t40 || $[180] !== t46) {
948
- t111 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t19, children: [
949
- t27,
950
- t36,
951
- t37,
926
+ let t105;
927
+ if ($[173] !== t104 || $[174] !== t23 || $[175] !== t31 || $[176] !== t34 || $[177] !== t40) {
928
+ t105 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-12 gap-4", children: [
929
+ t23,
930
+ t31,
931
+ t34,
952
932
  t40,
953
- t46,
954
- t110
933
+ t104
955
934
  ] });
956
- $[175] = t110;
957
- $[176] = t27;
958
- $[177] = t36;
959
- $[178] = t37;
960
- $[179] = t40;
961
- $[180] = t46;
962
- $[181] = t111;
935
+ $[173] = t104;
936
+ $[174] = t23;
937
+ $[175] = t31;
938
+ $[176] = t34;
939
+ $[177] = t40;
940
+ $[178] = t105;
963
941
  } else {
964
- t111 = $[181];
942
+ t105 = $[178];
965
943
  }
966
- let t112;
967
- if ($[182] === Symbol.for("react.memo_cache_sentinel")) {
968
- t112 = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
944
+ let t106;
945
+ if ($[179] === Symbol.for("react.memo_cache_sentinel")) {
946
+ t106 = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
969
947
  height: "52px"
970
948
  } });
971
- $[182] = t112;
949
+ $[179] = t106;
972
950
  } else {
973
- t112 = $[182];
951
+ t106 = $[179];
974
952
  }
975
- let t113;
976
- if ($[183] !== setFieldValue) {
977
- t113 = (icon) => {
953
+ const t107 = typeof values.icon === "string" ? values.icon : void 0;
954
+ let t108;
955
+ if ($[180] !== setFieldValue) {
956
+ t108 = (icon) => {
978
957
  setIconDialogOpen(false);
979
958
  setFieldValue("icon", icon);
980
959
  };
981
- $[183] = setFieldValue;
982
- $[184] = t113;
960
+ $[180] = setFieldValue;
961
+ $[181] = t108;
983
962
  } else {
984
- t113 = $[184];
963
+ t108 = $[181];
985
964
  }
986
- let t114;
987
- if ($[185] !== t113 || $[186] !== values.icon) {
988
- t114 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsxRuntime.jsx(core.SearchIconsView, { selectedIcon: values.icon, onIconSelected: t113 }) });
989
- $[185] = t113;
990
- $[186] = values.icon;
991
- $[187] = t114;
965
+ let t109;
966
+ if ($[182] !== t107 || $[183] !== t108) {
967
+ t109 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsxRuntime.jsx(core.SearchIconsView, { selectedIcon: t107, onIconSelected: t108 }) });
968
+ $[182] = t107;
969
+ $[183] = t108;
970
+ $[184] = t109;
992
971
  } else {
993
- t114 = $[187];
972
+ t109 = $[184];
994
973
  }
995
- let t115;
996
- if ($[188] !== iconDialogOpen || $[189] !== t114) {
997
- t115 = /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t114 });
998
- $[188] = iconDialogOpen;
999
- $[189] = t114;
1000
- $[190] = t115;
974
+ let t110;
975
+ if ($[185] !== iconDialogOpen || $[186] !== t109) {
976
+ t110 = /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t109 });
977
+ $[185] = iconDialogOpen;
978
+ $[186] = t109;
979
+ $[187] = t110;
1001
980
  } else {
1002
- t115 = $[190];
981
+ t110 = $[187];
1003
982
  }
1004
- let t116;
1005
- if ($[191] !== T0 || $[192] !== t111 || $[193] !== t115 || $[194] !== t18) {
1006
- t116 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: t7, children: /* @__PURE__ */ jsxRuntime.jsxs(T0, { maxWidth: t8, className: t9, children: [
1007
- t18,
1008
- t111,
1009
- t112,
1010
- t115
983
+ let t111;
984
+ if ($[188] !== t105 || $[189] !== t110 || $[190] !== t15) {
985
+ t111 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Container, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
986
+ t15,
987
+ t105,
988
+ t106,
989
+ t110
1011
990
  ] }) });
1012
- $[191] = T0;
1013
- $[192] = t111;
1014
- $[193] = t115;
1015
- $[194] = t18;
1016
- $[195] = t116;
991
+ $[188] = t105;
992
+ $[189] = t110;
993
+ $[190] = t15;
994
+ $[191] = t111;
1017
995
  } else {
1018
- t116 = $[195];
996
+ t111 = $[191];
1019
997
  }
1020
- return t116;
998
+ return t111;
1021
999
  }
1022
- function _temp3$4(value_3) {
1000
+ function _temp3$5(value_3) {
1023
1001
  if (value_3 === "code_defined") {
1024
1002
  return "Code defined";
1025
1003
  } else {
@@ -1034,10 +1012,10 @@
1034
1012
  }
1035
1013
  }
1036
1014
  }
1037
- function _temp2$7(value_2) {
1015
+ function _temp2$8(value_2) {
1038
1016
  return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: value_2, children: value_2.toUpperCase() }, `size-select-${value_2}`);
1039
1017
  }
1040
- function _temp$b(value_1) {
1018
+ function _temp$c(value_1) {
1041
1019
  return value_1.toUpperCase();
1042
1020
  }
1043
1021
  function DefaultDatabaseField(t0) {
@@ -1262,7 +1240,7 @@
1262
1240
  inferredValues.add(enumValue_0.id);
1263
1241
  });
1264
1242
  setFieldValue(enumValuesPath, [...newEnumValues, ...currentEnumValues], true);
1265
- }).catch(_temp$a).finally(() => setInferring(false));
1243
+ }).catch(_temp$b).finally(() => setInferring(false));
1266
1244
  };
1267
1245
  $[8] = enumValuesPath;
1268
1246
  $[9] = getData;
@@ -1385,7 +1363,7 @@
1385
1363
  }
1386
1364
  return t15;
1387
1365
  }
1388
- function _temp$a(e) {
1366
+ function _temp$b(e) {
1389
1367
  console.error(e);
1390
1368
  }
1391
1369
  const EnumEntry = React.memo(function EnumEntryInternal(t0) {
@@ -2174,7 +2152,7 @@
2174
2152
  t192 = $[42];
2175
2153
  }
2176
2154
  if ($[43] !== acceptedFiles || $[44] !== disabled || $[45] !== handleTypesChange || $[46] !== t172 || $[47] !== t182 || $[48] !== t192) {
2177
- t10 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsx(ui.MultiSelect, { className: "w-full", placeholder: "All file types allowed", disabled, name: acceptedFiles, value: t172, onValueChange: handleTypesChange, label: t182, renderValues: _temp3$3, children: t192 }) });
2155
+ t10 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsx(ui.MultiSelect, { className: "w-full", placeholder: "All file types allowed", disabled, name: acceptedFiles, value: t172, onValueChange: handleTypesChange, label: t182, renderValues: _temp3$4, children: t192 }) });
2178
2156
  $[43] = acceptedFiles;
2179
2157
  $[44] = disabled;
2180
2158
  $[45] = handleTypesChange;
@@ -2437,16 +2415,16 @@
2437
2415
  }
2438
2416
  return t24;
2439
2417
  }
2440
- function _temp3$3(selected) {
2418
+ function _temp3$4(selected) {
2441
2419
  if (!selected || selected.length === 0) {
2442
2420
  return "All file types allowed";
2443
2421
  }
2444
- return selected.map(_temp$9).filter(_temp2$6).join(", ");
2422
+ return selected.map(_temp$a).filter(_temp2$7).join(", ");
2445
2423
  }
2446
- function _temp2$6(v_0) {
2424
+ function _temp2$7(v_0) {
2447
2425
  return Boolean(v_0);
2448
2426
  }
2449
- function _temp$9(v) {
2427
+ function _temp$a(v) {
2450
2428
  return fileTypes[v];
2451
2429
  }
2452
2430
  function editableProperty(property) {
@@ -2518,7 +2496,7 @@
2518
2496
  const t4 = selected ? ui.cardSelectedMixin : "";
2519
2497
  let t5;
2520
2498
  if ($[5] !== borderColorClass || $[6] !== t3 || $[7] !== t4) {
2521
- t5 = ui.cls("border", "pl-2 w-full flex flex-row gap-4 items-center", ui.cardMixin, t3, t4, "flex-grow p-4 border transition-colors duration-200", borderColorClass);
2499
+ t5 = ui.cls("m-1", "border", "pl-2 w-full flex flex-row gap-4 items-center", ui.cardMixin, t3, t4, "flex-grow p-4 border transition-colors duration-200", borderColorClass);
2522
2500
  $[5] = borderColorClass;
2523
2501
  $[6] = t3;
2524
2502
  $[7] = t4;
@@ -4412,7 +4390,8 @@
4412
4390
  existing,
4413
4391
  multiple,
4414
4392
  disabled,
4415
- showErrors
4393
+ showErrors,
4394
+ asString
4416
4395
  } = t0;
4417
4396
  const {
4418
4397
  values,
@@ -4430,7 +4409,7 @@
4430
4409
  }
4431
4410
  return t12;
4432
4411
  }
4433
- const pathPath = multiple ? "of.path" : "path";
4412
+ const pathPath = asString ? "reference.path" : multiple ? "of.path" : "path";
4434
4413
  let t1;
4435
4414
  if ($[1] !== pathPath || $[2] !== values) {
4436
4415
  t1 = formex.getIn(values, pathPath);
@@ -4521,8 +4500,8 @@
4521
4500
  const collections = t1;
4522
4501
  let t2;
4523
4502
  if ($[10] !== collections || $[11] !== disabled || $[12] !== error || $[13] !== handleChange || $[14] !== pathPath || $[15] !== props || $[16] !== value) {
4524
- const groups = Array.from(new Set(Object.values(collections).map(_temp$8).filter(Boolean)).values());
4525
- const ungroupedCollections = collections.filter(_temp2$5);
4503
+ const groups = Array.from(new Set(Object.values(collections).map(_temp$9).filter(Boolean)).values());
4504
+ const ungroupedCollections = collections.filter(_temp2$6);
4526
4505
  let t32;
4527
4506
  if ($[18] !== collections) {
4528
4507
  t32 = (selected) => {
@@ -4553,7 +4532,7 @@
4553
4532
  }
4554
4533
  t2 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { error: Boolean(error), disabled, value: value ?? "", position: "item-aligned", name: pathPath, size: "large", fullWidth: true, onChange: handleChange, label: "Target collection", renderValue: t32, ...props, children: [
4555
4534
  groups.flatMap(t42),
4556
- ungroupedCollections && /* @__PURE__ */ jsxRuntime.jsx(ui.SelectGroup, { label: "Views", children: ungroupedCollections.map(_temp3$2) })
4535
+ ungroupedCollections && /* @__PURE__ */ jsxRuntime.jsx(ui.SelectGroup, { label: "Views", children: ungroupedCollections.map(_temp3$3) })
4557
4536
  ] });
4558
4537
  $[10] = collections;
4559
4538
  $[11] = disabled;
@@ -4586,16 +4565,16 @@
4586
4565
  }
4587
4566
  return t4;
4588
4567
  }
4589
- function _temp3$2(collection_2) {
4568
+ function _temp3$3(collection_2) {
4590
4569
  return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: collection_2.id ?? collection_2.path, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row", children: [
4591
4570
  /* @__PURE__ */ jsxRuntime.jsx(core.IconForView, { collectionOrView: collection_2 }),
4592
4571
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "font-medium ml-4", children: collection_2?.name.toUpperCase() })
4593
4572
  ] }) }, collection_2.id ?? collection_2.path);
4594
4573
  }
4595
- function _temp2$5(col) {
4574
+ function _temp2$6(col) {
4596
4575
  return !col.group;
4597
4576
  }
4598
- function _temp$8(e) {
4577
+ function _temp$9(e) {
4599
4578
  return e.group;
4600
4579
  }
4601
4580
  function DateTimePropertyField(t0) {
@@ -4670,7 +4649,7 @@
4670
4649
  }
4671
4650
  let t10;
4672
4651
  if ($[14] !== disabled || $[15] !== t5 || $[16] !== t6 || $[17] !== t7) {
4673
- t10 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { name: "mode", value: t5, error: t6, size: "large", onValueChange: t7, label: "Mode", fullWidth: true, renderValue: _temp$7, disabled, children: [
4652
+ t10 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { name: "mode", value: t5, error: t6, size: "large", onValueChange: t7, label: "Mode", fullWidth: true, renderValue: _temp$8, disabled, children: [
4674
4653
  t8,
4675
4654
  t9
4676
4655
  ] });
@@ -4731,7 +4710,7 @@
4731
4710
  }
4732
4711
  let t20;
4733
4712
  if ($[30] !== disabled || $[31] !== t14 || $[32] !== t15 || $[33] !== t16) {
4734
- t20 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { name: "autoValue", disabled, size: "large", fullWidth: true, value: t14, onValueChange: t15, renderValue: _temp2$4, error: t16, label: "Automatic value", children: [
4713
+ t20 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { name: "autoValue", disabled, size: "large", fullWidth: true, value: t14, onValueChange: t15, renderValue: _temp2$5, error: t16, label: "Automatic value", children: [
4735
4714
  t17,
4736
4715
  t18,
4737
4716
  t19
@@ -4801,7 +4780,7 @@
4801
4780
  }
4802
4781
  return t27;
4803
4782
  }
4804
- function _temp2$4(v_2) {
4783
+ function _temp2$5(v_2) {
4805
4784
  switch (v_2) {
4806
4785
  case "on_create": {
4807
4786
  return "On create";
@@ -4814,7 +4793,7 @@
4814
4793
  }
4815
4794
  }
4816
4795
  }
4817
- function _temp$7(v_0) {
4796
+ function _temp$8(v_0) {
4818
4797
  switch (v_0) {
4819
4798
  case "date_time": {
4820
4799
  return "Date/Time";
@@ -5039,6 +5018,12 @@
5039
5018
  propertyConfig: "reference",
5040
5019
  editable: propertyData.editable !== void 0 ? propertyData.editable : true
5041
5020
  });
5021
+ } else if (selectedWidgetId === "reference_as_string") {
5022
+ updatedProperty = core.mergeDeep(propertyData, {
5023
+ dataType: "string",
5024
+ propertyConfig: "reference_as_string",
5025
+ editable: propertyData.editable !== void 0 ? propertyData.editable : true
5026
+ });
5042
5027
  } else if (selectedWidgetId === "multi_references") {
5043
5028
  updatedProperty = core.mergeDeep(propertyData, {
5044
5029
  dataType: "array",
@@ -5139,7 +5124,7 @@
5139
5124
  }
5140
5125
  let t8;
5141
5126
  if ($[8] !== disabled || $[9] !== t2 || $[10] !== t3) {
5142
- t8 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { disabled, position: "item-aligned", fullWidth: true, onValueChange: t2, label: "Preview type", renderValue: _temp$6, value: t3, children: [
5127
+ t8 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { disabled, position: "item-aligned", fullWidth: true, onValueChange: t2, label: "Preview type", renderValue: _temp$7, value: t3, children: [
5143
5128
  t4,
5144
5129
  t5,
5145
5130
  t6,
@@ -5205,7 +5190,7 @@
5205
5190
  }
5206
5191
  return t13;
5207
5192
  }
5208
- function _temp$6(value_0) {
5193
+ function _temp$7(value_0) {
5209
5194
  switch (value_0) {
5210
5195
  case "image": {
5211
5196
  return "Image";
@@ -5221,7 +5206,7 @@
5221
5206
  }
5222
5207
  }
5223
5208
  }
5224
- const supportedFieldsIds = ["text_field", "multiline", "markdown", "url", "email", "select", "multi_select", "number_input", "number_select", "multi_number_select", "file_upload", "multi_file_upload", "reference", "multi_references", "switch", "date_time", "group", "key_value", "repeat", "block"];
5209
+ const supportedFieldsIds = ["text_field", "multiline", "markdown", "url", "email", "select", "multi_select", "number_input", "number_select", "multi_number_select", "file_upload", "multi_file_upload", "reference", "reference_as_string", "multi_references", "switch", "date_time", "group", "key_value", "repeat", "block"];
5225
5210
  const supportedFields = Object.entries(core.DEFAULT_FIELD_CONFIGS).filter(([id]) => supportedFieldsIds.includes(id)).map(([id, config]) => ({
5226
5211
  [id]: config
5227
5212
  })).reduce((a, b) => ({
@@ -5845,7 +5830,7 @@
5845
5830
  }
5846
5831
  let t7;
5847
5832
  if ($[20] !== onCancel) {
5848
- t7 = onCancel && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", onClick: () => {
5833
+ t7 = onCancel && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", color: "primary", onClick: () => {
5849
5834
  onCancel();
5850
5835
  formexRef.current?.resetForm();
5851
5836
  }, children: "Cancel" });
@@ -5897,7 +5882,7 @@
5897
5882
  return t11;
5898
5883
  }
5899
5884
  function PropertyEditFormFields(t0) {
5900
- const $ = reactCompilerRuntime.c(142);
5885
+ const $ = reactCompilerRuntime.c(146);
5901
5886
  const {
5902
5887
  values,
5903
5888
  errors,
@@ -6186,59 +6171,73 @@
6186
6171
  }
6187
6172
  childComponent = t102;
6188
6173
  } else {
6189
- if (selectedFieldConfigId === "date_time") {
6174
+ if (selectedFieldConfigId === "reference_as_string") {
6190
6175
  let t102;
6191
- if ($[75] !== disabled) {
6192
- t102 = /* @__PURE__ */ jsxRuntime.jsx(DateTimePropertyField, { disabled });
6176
+ if ($[75] !== disabled || $[76] !== existing || $[77] !== showErrors) {
6177
+ t102 = /* @__PURE__ */ jsxRuntime.jsx(ReferencePropertyField, { showErrors, existing, asString: true, multiple: false, disabled });
6193
6178
  $[75] = disabled;
6194
- $[76] = t102;
6179
+ $[76] = existing;
6180
+ $[77] = showErrors;
6181
+ $[78] = t102;
6195
6182
  } else {
6196
- t102 = $[76];
6183
+ t102 = $[78];
6197
6184
  }
6198
6185
  childComponent = t102;
6199
6186
  } else {
6200
- if (selectedFieldConfigId === "multi_references") {
6187
+ if (selectedFieldConfigId === "date_time") {
6201
6188
  let t102;
6202
- if ($[77] !== disabled || $[78] !== existing || $[79] !== showErrors) {
6203
- t102 = /* @__PURE__ */ jsxRuntime.jsx(ReferencePropertyField, { showErrors, existing, multiple: true, disabled });
6204
- $[77] = disabled;
6205
- $[78] = existing;
6206
- $[79] = showErrors;
6189
+ if ($[79] !== disabled) {
6190
+ t102 = /* @__PURE__ */ jsxRuntime.jsx(DateTimePropertyField, { disabled });
6191
+ $[79] = disabled;
6207
6192
  $[80] = t102;
6208
6193
  } else {
6209
6194
  t102 = $[80];
6210
6195
  }
6211
6196
  childComponent = t102;
6212
6197
  } else {
6213
- if (selectedFieldConfigId === "repeat") {
6198
+ if (selectedFieldConfigId === "multi_references") {
6214
6199
  let t102;
6215
- if ($[81] !== allowDataInference || $[82] !== collectionEditable || $[83] !== disabled || $[84] !== existing || $[85] !== getData || $[86] !== propertyConfigs || $[87] !== showErrors) {
6216
- t102 = /* @__PURE__ */ jsxRuntime.jsx(RepeatPropertyField, { showErrors, existing, getData, allowDataInference, disabled, collectionEditable, propertyConfigs });
6217
- $[81] = allowDataInference;
6218
- $[82] = collectionEditable;
6219
- $[83] = disabled;
6220
- $[84] = existing;
6221
- $[85] = getData;
6222
- $[86] = propertyConfigs;
6223
- $[87] = showErrors;
6224
- $[88] = t102;
6200
+ if ($[81] !== disabled || $[82] !== existing || $[83] !== showErrors) {
6201
+ t102 = /* @__PURE__ */ jsxRuntime.jsx(ReferencePropertyField, { showErrors, existing, multiple: true, disabled });
6202
+ $[81] = disabled;
6203
+ $[82] = existing;
6204
+ $[83] = showErrors;
6205
+ $[84] = t102;
6225
6206
  } else {
6226
- t102 = $[88];
6207
+ t102 = $[84];
6227
6208
  }
6228
6209
  childComponent = t102;
6229
6210
  } else {
6230
- if (selectedFieldConfigId === "key_value") {
6211
+ if (selectedFieldConfigId === "repeat") {
6231
6212
  let t102;
6232
- if ($[89] !== disabled) {
6233
- t102 = /* @__PURE__ */ jsxRuntime.jsx(KeyValuePropertyField, { disabled });
6234
- $[89] = disabled;
6235
- $[90] = t102;
6213
+ if ($[85] !== allowDataInference || $[86] !== collectionEditable || $[87] !== disabled || $[88] !== existing || $[89] !== getData || $[90] !== propertyConfigs || $[91] !== showErrors) {
6214
+ t102 = /* @__PURE__ */ jsxRuntime.jsx(RepeatPropertyField, { showErrors, existing, getData, allowDataInference, disabled, collectionEditable, propertyConfigs });
6215
+ $[85] = allowDataInference;
6216
+ $[86] = collectionEditable;
6217
+ $[87] = disabled;
6218
+ $[88] = existing;
6219
+ $[89] = getData;
6220
+ $[90] = propertyConfigs;
6221
+ $[91] = showErrors;
6222
+ $[92] = t102;
6236
6223
  } else {
6237
- t102 = $[90];
6224
+ t102 = $[92];
6238
6225
  }
6239
6226
  childComponent = t102;
6240
6227
  } else {
6241
- childComponent = null;
6228
+ if (selectedFieldConfigId === "key_value") {
6229
+ let t102;
6230
+ if ($[93] !== disabled) {
6231
+ t102 = /* @__PURE__ */ jsxRuntime.jsx(KeyValuePropertyField, { disabled });
6232
+ $[93] = disabled;
6233
+ $[94] = t102;
6234
+ } else {
6235
+ t102 = $[94];
6236
+ }
6237
+ childComponent = t102;
6238
+ } else {
6239
+ childComponent = null;
6240
+ }
6242
6241
  }
6243
6242
  }
6244
6243
  }
@@ -6256,7 +6255,7 @@
6256
6255
  }
6257
6256
  }
6258
6257
  let t10;
6259
- if ($[91] !== disabled) {
6258
+ if ($[95] !== disabled) {
6260
6259
  t10 = disabled && /* @__PURE__ */ jsxRuntime.jsxs(ui.InfoLabel, { mode: "warn", children: [
6261
6260
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { children: "This property can't be edited" }),
6262
6261
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "caption", children: [
@@ -6265,157 +6264,157 @@
6265
6264
  " flag"
6266
6265
  ] })
6267
6266
  ] });
6268
- $[91] = disabled;
6269
- $[92] = t10;
6267
+ $[95] = disabled;
6268
+ $[96] = t10;
6270
6269
  } else {
6271
- t10 = $[92];
6270
+ t10 = $[96];
6272
6271
  }
6273
6272
  const t11 = selectedFieldConfigId;
6274
6273
  let t12;
6275
- if ($[93] !== onWidgetSelectChanged) {
6274
+ if ($[97] !== onWidgetSelectChanged) {
6276
6275
  t12 = (value) => onWidgetSelectChanged(value);
6277
- $[93] = onWidgetSelectChanged;
6278
- $[94] = t12;
6276
+ $[97] = onWidgetSelectChanged;
6277
+ $[98] = t12;
6279
6278
  } else {
6280
- t12 = $[94];
6279
+ t12 = $[98];
6281
6280
  }
6282
6281
  let t13;
6283
- if ($[95] !== onDismiss) {
6282
+ if ($[99] !== onDismiss) {
6284
6283
  t13 = (open, hasValue) => {
6285
6284
  if (!hasValue) {
6286
6285
  onDismiss?.();
6287
6286
  }
6288
6287
  setSelectOpen(open);
6289
6288
  };
6290
- $[95] = onDismiss;
6291
- $[96] = t13;
6289
+ $[99] = onDismiss;
6290
+ $[100] = t13;
6292
6291
  } else {
6293
- t13 = $[96];
6292
+ t13 = $[100];
6294
6293
  }
6295
6294
  const t14 = Boolean(selectedWidgetError);
6296
6295
  let t15;
6297
- if ($[97] !== disabled || $[98] !== existing || $[99] !== inArray || $[100] !== propertyConfigs || $[101] !== selectOpen || $[102] !== t11 || $[103] !== t12 || $[104] !== t13 || $[105] !== t14 || $[106] !== values) {
6296
+ if ($[101] !== disabled || $[102] !== existing || $[103] !== inArray || $[104] !== propertyConfigs || $[105] !== selectOpen || $[106] !== t11 || $[107] !== t12 || $[108] !== t13 || $[109] !== t14 || $[110] !== values) {
6298
6297
  t15 = /* @__PURE__ */ jsxRuntime.jsx(WidgetSelectView, { initialProperty: values, value: t11, onValueChange: t12, open: selectOpen, onOpenChange: t13, disabled, showError: t14, existing, propertyConfigs, inArray });
6299
- $[97] = disabled;
6300
- $[98] = existing;
6301
- $[99] = inArray;
6302
- $[100] = propertyConfigs;
6303
- $[101] = selectOpen;
6304
- $[102] = t11;
6305
- $[103] = t12;
6306
- $[104] = t13;
6307
- $[105] = t14;
6308
- $[106] = values;
6309
- $[107] = t15;
6310
- } else {
6311
- t15 = $[107];
6298
+ $[101] = disabled;
6299
+ $[102] = existing;
6300
+ $[103] = inArray;
6301
+ $[104] = propertyConfigs;
6302
+ $[105] = selectOpen;
6303
+ $[106] = t11;
6304
+ $[107] = t12;
6305
+ $[108] = t13;
6306
+ $[109] = t14;
6307
+ $[110] = values;
6308
+ $[111] = t15;
6309
+ } else {
6310
+ t15 = $[111];
6312
6311
  }
6313
6312
  let t16;
6314
- if ($[108] !== selectedWidgetError) {
6313
+ if ($[112] !== selectedWidgetError) {
6315
6314
  t16 = selectedWidgetError && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "ml-3.5", color: "error", children: "Required" });
6316
- $[108] = selectedWidgetError;
6317
- $[109] = t16;
6315
+ $[112] = selectedWidgetError;
6316
+ $[113] = t16;
6318
6317
  } else {
6319
- t16 = $[109];
6318
+ t16 = $[113];
6320
6319
  }
6321
6320
  let t17;
6322
- if ($[110] !== t15 || $[111] !== t16) {
6321
+ if ($[114] !== t15 || $[115] !== t16) {
6323
6322
  t17 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex flex-col gap-2", children: [
6324
6323
  t15,
6325
6324
  t16
6326
6325
  ] });
6327
- $[110] = t15;
6328
- $[111] = t16;
6329
- $[112] = t17;
6326
+ $[114] = t15;
6327
+ $[115] = t16;
6328
+ $[116] = t17;
6330
6329
  } else {
6331
- t17 = $[112];
6330
+ t17 = $[116];
6332
6331
  }
6333
6332
  let t18;
6334
- if ($[113] !== disabled || $[114] !== onDelete || $[115] !== values?.id) {
6333
+ if ($[117] !== disabled || $[118] !== onDelete || $[119] !== values?.id) {
6335
6334
  t18 = onDelete && values?.id && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { variant: "ghost", className: "m-4", disabled, onClick: () => setDeleteDialogOpen(true), children: /* @__PURE__ */ jsxRuntime.jsx(ui.DeleteIcon, {}) });
6336
- $[113] = disabled;
6337
- $[114] = onDelete;
6338
- $[115] = values?.id;
6339
- $[116] = t18;
6335
+ $[117] = disabled;
6336
+ $[118] = onDelete;
6337
+ $[119] = values?.id;
6338
+ $[120] = t18;
6340
6339
  } else {
6341
- t18 = $[116];
6340
+ t18 = $[120];
6342
6341
  }
6343
6342
  let t19;
6344
- if ($[117] !== t17 || $[118] !== t18) {
6343
+ if ($[121] !== t17 || $[122] !== t18) {
6345
6344
  t19 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex mt-2 justify-between", children: [
6346
6345
  t17,
6347
6346
  t18
6348
6347
  ] });
6349
- $[117] = t17;
6350
- $[118] = t18;
6351
- $[119] = t19;
6348
+ $[121] = t17;
6349
+ $[122] = t18;
6350
+ $[123] = t19;
6352
6351
  } else {
6353
- t19 = $[119];
6352
+ t19 = $[123];
6354
6353
  }
6355
6354
  let t20;
6356
- if ($[120] !== autoUpdateId || $[121] !== disabled || $[122] !== existing || $[123] !== includeIdAndTitle || $[124] !== showErrors) {
6355
+ if ($[124] !== autoUpdateId || $[125] !== disabled || $[126] !== existing || $[127] !== includeIdAndTitle || $[128] !== showErrors) {
6357
6356
  t20 = includeIdAndTitle && /* @__PURE__ */ jsxRuntime.jsx(CommonPropertyFields, { showErrors, disabledId: existing, isNewProperty: !existing, disabled, autoUpdateId, ref: nameFieldRef });
6358
- $[120] = autoUpdateId;
6359
- $[121] = disabled;
6360
- $[122] = existing;
6361
- $[123] = includeIdAndTitle;
6362
- $[124] = showErrors;
6363
- $[125] = t20;
6357
+ $[124] = autoUpdateId;
6358
+ $[125] = disabled;
6359
+ $[126] = existing;
6360
+ $[127] = includeIdAndTitle;
6361
+ $[128] = showErrors;
6362
+ $[129] = t20;
6364
6363
  } else {
6365
- t20 = $[125];
6364
+ t20 = $[129];
6366
6365
  }
6367
6366
  let t21;
6368
- if ($[126] !== disabled) {
6367
+ if ($[130] !== disabled) {
6369
6368
  t21 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxRuntime.jsx(AdvancedPropertyValidation, { disabled }) });
6370
- $[126] = disabled;
6371
- $[127] = t21;
6369
+ $[130] = disabled;
6370
+ $[131] = t21;
6372
6371
  } else {
6373
- t21 = $[127];
6372
+ t21 = $[131];
6374
6373
  }
6375
6374
  let t22;
6376
- if ($[128] !== childComponent || $[129] !== t20 || $[130] !== t21) {
6375
+ if ($[132] !== childComponent || $[133] !== t20 || $[134] !== t21) {
6377
6376
  t22 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-12 gap-y-12 mt-8 mb-8", children: [
6378
6377
  t20,
6379
6378
  childComponent,
6380
6379
  t21
6381
6380
  ] });
6382
- $[128] = childComponent;
6383
- $[129] = t20;
6384
- $[130] = t21;
6385
- $[131] = t22;
6381
+ $[132] = childComponent;
6382
+ $[133] = t20;
6383
+ $[134] = t21;
6384
+ $[135] = t22;
6386
6385
  } else {
6387
- t22 = $[131];
6386
+ t22 = $[135];
6388
6387
  }
6389
6388
  let t23;
6390
- if ($[132] !== deleteDialogOpen || $[133] !== onDelete || $[134] !== propertyNamespace || $[135] !== values?.id) {
6389
+ if ($[136] !== deleteDialogOpen || $[137] !== onDelete || $[138] !== propertyNamespace || $[139] !== values?.id) {
6391
6390
  t23 = onDelete && /* @__PURE__ */ jsxRuntime.jsx(core.ConfirmationDialog, { open: deleteDialogOpen, onAccept: () => onDelete(values?.id, propertyNamespace), onCancel: () => setDeleteDialogOpen(false), title: /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Delete this property?" }), body: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
6392
6391
  " This will ",
6393
6392
  /* @__PURE__ */ jsxRuntime.jsx("b", { children: "not delete any data" }),
6394
6393
  ", only modify the collection."
6395
6394
  ] }) });
6396
- $[132] = deleteDialogOpen;
6397
- $[133] = onDelete;
6398
- $[134] = propertyNamespace;
6399
- $[135] = values?.id;
6400
- $[136] = t23;
6395
+ $[136] = deleteDialogOpen;
6396
+ $[137] = onDelete;
6397
+ $[138] = propertyNamespace;
6398
+ $[139] = values?.id;
6399
+ $[140] = t23;
6401
6400
  } else {
6402
- t23 = $[136];
6401
+ t23 = $[140];
6403
6402
  }
6404
6403
  let t24;
6405
- if ($[137] !== t10 || $[138] !== t19 || $[139] !== t22 || $[140] !== t23) {
6404
+ if ($[141] !== t10 || $[142] !== t19 || $[143] !== t22 || $[144] !== t23) {
6406
6405
  t24 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6407
6406
  t10,
6408
6407
  t19,
6409
6408
  t22,
6410
6409
  t23
6411
6410
  ] });
6412
- $[137] = t10;
6413
- $[138] = t19;
6414
- $[139] = t22;
6415
- $[140] = t23;
6416
- $[141] = t24;
6411
+ $[141] = t10;
6412
+ $[142] = t19;
6413
+ $[143] = t22;
6414
+ $[144] = t23;
6415
+ $[145] = t24;
6417
6416
  } else {
6418
- t24 = $[141];
6417
+ t24 = $[145];
6419
6418
  }
6420
6419
  return t24;
6421
6420
  }
@@ -6455,6 +6454,7 @@
6455
6454
  file_upload: "File",
6456
6455
  multi_file_upload: "File",
6457
6456
  reference: "Reference",
6457
+ reference_as_string: "Text",
6458
6458
  multi_references: "Reference",
6459
6459
  date_time: "Date",
6460
6460
  group: "Group",
@@ -6486,7 +6486,7 @@
6486
6486
  let t6;
6487
6487
  if ($[0] !== disabled || $[1] !== existing || $[2] !== inArray || $[3] !== initialProperty || $[4] !== onOpenChange || $[5] !== onValueChange || $[6] !== open || $[7] !== propertyConfigs || $[8] !== value) {
6488
6488
  const allSupportedFields = Object.entries(supportedFields).concat(Object.entries(propertyConfigs));
6489
- const displayedWidgets = (inArray ? allSupportedFields.filter(_temp$5) : allSupportedFields).map(_temp2$3).reduce(_temp3$1, {});
6489
+ const displayedWidgets = (inArray ? allSupportedFields.filter(_temp$6) : allSupportedFields).map(_temp2$4).reduce(_temp3$2, {});
6490
6490
  const key_0 = value;
6491
6491
  const propertyConfig_1 = key_0 ? core.DEFAULT_FIELD_CONFIGS[key_0] ?? propertyConfigs[key_0] : void 0;
6492
6492
  const baseProperty = propertyConfig_1?.property;
@@ -6668,19 +6668,19 @@
6668
6668
  }
6669
6669
  return "Custom/Other";
6670
6670
  }
6671
- function _temp3$1(a, b) {
6671
+ function _temp3$2(a, b) {
6672
6672
  return {
6673
6673
  ...a,
6674
6674
  ...b
6675
6675
  };
6676
6676
  }
6677
- function _temp2$3(t0) {
6677
+ function _temp2$4(t0) {
6678
6678
  const [key, propertyConfig_0] = t0;
6679
6679
  return {
6680
6680
  [key]: propertyConfig_0
6681
6681
  };
6682
6682
  }
6683
- function _temp$5(t0) {
6683
+ function _temp$6(t0) {
6684
6684
  const [, propertyConfig] = t0;
6685
6685
  return !core.isPropertyBuilder(propertyConfig.property) && propertyConfig.property?.dataType !== "array";
6686
6686
  }
@@ -6774,7 +6774,7 @@
6774
6774
  }
6775
6775
  let t10;
6776
6776
  if ($[20] !== onClick || $[21] !== t9) {
6777
- t10 = /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { onClick, className: "flex flex-row items-center px-4 py-2", children: t9 });
6777
+ t10 = /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { onClick, className: "flex flex-row items-center px-4 py-2 m-1", children: t9 });
6778
6778
  $[20] = onClick;
6779
6779
  $[21] = t9;
6780
6780
  $[22] = t10;
@@ -6828,7 +6828,7 @@
6828
6828
  if ($[3] !== code) {
6829
6829
  t3 = /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogContent, { children: [
6830
6830
  t2,
6831
- /* @__PURE__ */ jsxRuntime.jsx(prismReactRenderer.Highlight, { theme: prismReactRenderer.themes.vsDark, code, language: "typescript", children: _temp$4 })
6831
+ /* @__PURE__ */ jsxRuntime.jsx(prismReactRenderer.Highlight, { theme: prismReactRenderer.themes.vsDark, code, language: "typescript", children: _temp$5 })
6832
6832
  ] });
6833
6833
  $[3] = code;
6834
6834
  $[4] = t3;
@@ -6842,7 +6842,7 @@
6842
6842
  e.preventDefault();
6843
6843
  snackbarController.open({
6844
6844
  type: "success",
6845
- message: `Copied`
6845
+ message: "Copied"
6846
6846
  });
6847
6847
  return navigator.clipboard.writeText(code);
6848
6848
  };
@@ -6861,7 +6861,7 @@
6861
6861
  }
6862
6862
  let t6;
6863
6863
  if ($[9] !== t4) {
6864
- t6 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", size: "small", onClick: t4, children: [
6864
+ t6 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", size: "small", color: "primary", onClick: t4, children: [
6865
6865
  t5,
6866
6866
  "Copy to clipboard"
6867
6867
  ] });
@@ -6908,7 +6908,7 @@
6908
6908
  }
6909
6909
  return t9;
6910
6910
  }
6911
- function _temp$4(t0) {
6911
+ function _temp$5(t0) {
6912
6912
  const {
6913
6913
  style,
6914
6914
  tokens,
@@ -7021,6 +7021,7 @@
7021
7021
  const inferPropertiesFromData = doCollectionInference ? () => {
7022
7022
  if (!doCollectionInference) return;
7023
7023
  setInferringProperties(true);
7024
+ console.debug("CollectionEditor: inferring properties from data", doCollectionInference, values);
7024
7025
  doCollectionInference(values).then((newCollection) => {
7025
7026
  if (newCollection) core.makePropertiesEditable(newCollection.properties);
7026
7027
  if (!newCollection) {
@@ -7257,7 +7258,7 @@
7257
7258
  }
7258
7259
  let t7;
7259
7260
  if ($[10] !== handleCancel) {
7260
- t7 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", onClick: handleCancel, autoFocus: true, children: " Cancel " });
7261
+ t7 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", color: "primary", onClick: handleCancel, autoFocus: true, children: " Cancel " });
7261
7262
  $[10] = handleCancel;
7262
7263
  $[11] = t7;
7263
7264
  } else {
@@ -7265,7 +7266,7 @@
7265
7266
  }
7266
7267
  let t8;
7267
7268
  if ($[12] !== handleOk) {
7268
- t8 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: handleOk, children: " Ok " });
7269
+ t8 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { color: "primary", onClick: handleOk, children: " Ok " });
7269
7270
  $[12] = handleOk;
7270
7271
  $[13] = t8;
7271
7272
  } else {
@@ -7333,7 +7334,7 @@
7333
7334
  }
7334
7335
  let t3;
7335
7336
  if ($[4] !== entityViews) {
7336
- t3 = (entityViews ?? []).length === 0 && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", children: "No custom views defined" });
7337
+ t3 = (entityViews ?? []).length === 0 && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", children: "No custom views defined. Define your custom views in the customization settings, before using this dialog." });
7337
7338
  $[4] = entityViews;
7338
7339
  $[5] = t3;
7339
7340
  } else {
@@ -7353,7 +7354,7 @@
7353
7354
  }
7354
7355
  let t5;
7355
7356
  if ($[9] !== onClose) {
7356
- t5 = /* @__PURE__ */ jsxRuntime.jsx(ui.DialogActions, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "outlined", onClick: () => onClose(), children: "Cancel" }) });
7357
+ t5 = /* @__PURE__ */ jsxRuntime.jsx(ui.DialogActions, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "outlined", color: "primary", onClick: () => onClose(), children: "Cancel" }) });
7357
7358
  $[9] = onClose;
7358
7359
  $[10] = t5;
7359
7360
  } else {
@@ -7420,8 +7421,8 @@
7420
7421
  let t8;
7421
7422
  let t9;
7422
7423
  if ($[2] !== collection.entityViews || $[3] !== contextEntityViews || $[4] !== subcollections || $[5] !== values.entityViews || $[6] !== values.name) {
7423
- const resolvedEntityViews = values.entityViews?.filter(_temp$3).map((e_0) => core.resolveEntityView(e_0, contextEntityViews)).filter(Boolean) ?? [];
7424
- const hardCodedEntityViews = collection.entityViews?.filter(_temp2$2) ?? [];
7424
+ const resolvedEntityViews = values.entityViews?.filter(_temp$4).map((e_0) => core.resolveEntityView(e_0, contextEntityViews)).filter(Boolean) ?? [];
7425
+ const hardCodedEntityViews = collection.entityViews?.filter(_temp2$3) ?? [];
7425
7426
  const totalEntityViews = resolvedEntityViews.length + hardCodedEntityViews.length;
7426
7427
  t12 = "overflow-auto my-auto";
7427
7428
  T3 = ui.Container;
@@ -7530,7 +7531,7 @@
7530
7531
  t182 = $[36];
7531
7532
  }
7532
7533
  t2 = resolvedEntityViews.map(t182);
7533
- t3 = hardCodedEntityViews.map(_temp3);
7534
+ t3 = hardCodedEntityViews.map(_temp3$1);
7534
7535
  $[2] = collection.entityViews;
7535
7536
  $[3] = contextEntityViews;
7536
7537
  $[4] = subcollections;
@@ -7804,7 +7805,7 @@
7804
7805
  function _temp4(e_6) {
7805
7806
  return e_6.id;
7806
7807
  }
7807
- function _temp3(view_0) {
7808
+ function _temp3$1(view_0) {
7808
7809
  return /* @__PURE__ */ jsxRuntime.jsx(ui.TableRow, { children: /* @__PURE__ */ jsxRuntime.jsxs(ui.TableCell, { align: "left", children: [
7809
7810
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "flex-grow", children: view_0.name }),
7810
7811
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "caption", className: "flex-grow", children: [
@@ -7813,10 +7814,10 @@
7813
7814
  ] })
7814
7815
  ] }) }, view_0.key);
7815
7816
  }
7816
- function _temp2$2(e_1) {
7817
+ function _temp2$3(e_1) {
7817
7818
  return typeof e_1 !== "string";
7818
7819
  }
7819
- function _temp$3(e) {
7820
+ function _temp$4(e) {
7820
7821
  return typeof e === "string";
7821
7822
  }
7822
7823
  const productsCollectionTemplate = {
@@ -8258,7 +8259,7 @@
8258
8259
  }
8259
8260
  };
8260
8261
  function CollectionEditorWelcomeView(t0) {
8261
- const $ = reactCompilerRuntime.c(52);
8262
+ const $ = reactCompilerRuntime.c(56);
8262
8263
  const {
8263
8264
  path,
8264
8265
  pathSuggestions,
@@ -8350,162 +8351,173 @@
8350
8351
  t7 = $[15];
8351
8352
  }
8352
8353
  let t8;
8353
- if ($[16] !== t6 || $[17] !== t7) {
8354
- t8 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-2", children: [
8355
- t5,
8356
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
8357
- t6,
8358
- t7
8359
- ] })
8360
- ] });
8361
- $[16] = t6;
8362
- $[17] = t7;
8354
+ if ($[16] !== filteredPathSuggestions || $[17] !== loadingPathSuggestions) {
8355
+ t8 = (filteredPathSuggestions ?? []).length === 0 && !loadingPathSuggestions && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", color: "secondary", children: "No existing paths found" });
8356
+ $[16] = filteredPathSuggestions;
8357
+ $[17] = loadingPathSuggestions;
8363
8358
  $[18] = t8;
8364
8359
  } else {
8365
8360
  t8 = $[18];
8366
8361
  }
8367
8362
  let t9;
8368
- if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
8369
- t9 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", color: "secondary", children: "● Select a template:" });
8370
- $[19] = t9;
8363
+ if ($[19] !== t6 || $[20] !== t7 || $[21] !== t8) {
8364
+ t9 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-2", children: [
8365
+ t5,
8366
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
8367
+ t6,
8368
+ t7,
8369
+ t8
8370
+ ] })
8371
+ ] });
8372
+ $[19] = t6;
8373
+ $[20] = t7;
8374
+ $[21] = t8;
8375
+ $[22] = t9;
8371
8376
  } else {
8372
- t9 = $[19];
8377
+ t9 = $[22];
8373
8378
  }
8374
8379
  let t10;
8375
- if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
8376
- t10 = /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { size: "small", iconKey: productsCollectionTemplate.icon });
8377
- $[20] = t10;
8380
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
8381
+ t10 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", color: "secondary", children: "● Select a template:" });
8382
+ $[23] = t10;
8378
8383
  } else {
8379
- t10 = $[20];
8384
+ t10 = $[23];
8380
8385
  }
8381
8386
  let t11;
8382
- if ($[21] !== onContinue || $[22] !== setValues) {
8383
- t11 = /* @__PURE__ */ jsxRuntime.jsx(TemplateButton, { title: "Products", subtitle: "A collection of products with images, prices and stock", icon: t10, onClick: () => {
8384
- setValues(productsCollectionTemplate);
8385
- onContinue();
8386
- } });
8387
- $[21] = onContinue;
8388
- $[22] = setValues;
8389
- $[23] = t11;
8390
- } else {
8391
- t11 = $[23];
8392
- }
8393
- let t12;
8394
8387
  if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
8395
- t12 = /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { size: "small", iconKey: usersCollectionTemplate.icon });
8396
- $[24] = t12;
8388
+ t11 = /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { size: "small", iconKey: productsCollectionTemplate.icon });
8389
+ $[24] = t11;
8397
8390
  } else {
8398
- t12 = $[24];
8391
+ t11 = $[24];
8399
8392
  }
8400
- let t13;
8393
+ let t12;
8401
8394
  if ($[25] !== onContinue || $[26] !== setValues) {
8402
- t13 = /* @__PURE__ */ jsxRuntime.jsx(TemplateButton, { title: "Users", subtitle: "A collection of users with emails, names and roles", icon: t12, onClick: () => {
8403
- setValues(usersCollectionTemplate);
8395
+ t12 = /* @__PURE__ */ jsxRuntime.jsx(TemplateButton, { title: "Products", subtitle: "A collection of products with images, prices and stock", icon: t11, onClick: () => {
8396
+ setValues(productsCollectionTemplate);
8404
8397
  onContinue();
8405
8398
  } });
8406
8399
  $[25] = onContinue;
8407
8400
  $[26] = setValues;
8408
- $[27] = t13;
8401
+ $[27] = t12;
8409
8402
  } else {
8410
- t13 = $[27];
8403
+ t12 = $[27];
8411
8404
  }
8412
- let t14;
8405
+ let t13;
8413
8406
  if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
8414
- t14 = /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { size: "small", iconKey: blogCollectionTemplate.icon });
8415
- $[28] = t14;
8407
+ t13 = /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { size: "small", iconKey: usersCollectionTemplate.icon });
8408
+ $[28] = t13;
8416
8409
  } else {
8417
- t14 = $[28];
8410
+ t13 = $[28];
8418
8411
  }
8419
- let t15;
8412
+ let t14;
8420
8413
  if ($[29] !== onContinue || $[30] !== setValues) {
8421
- t15 = /* @__PURE__ */ jsxRuntime.jsx(TemplateButton, { title: "Blog posts", subtitle: "A collection of blog posts with images, authors and complex content", icon: t14, onClick: () => {
8422
- setValues(blogCollectionTemplate);
8414
+ t14 = /* @__PURE__ */ jsxRuntime.jsx(TemplateButton, { title: "Users", subtitle: "A collection of users with emails, names and roles", icon: t13, onClick: () => {
8415
+ setValues(usersCollectionTemplate);
8423
8416
  onContinue();
8424
8417
  } });
8425
8418
  $[29] = onContinue;
8426
8419
  $[30] = setValues;
8427
- $[31] = t15;
8420
+ $[31] = t14;
8428
8421
  } else {
8429
- t15 = $[31];
8422
+ t14 = $[31];
8430
8423
  }
8431
- let t16;
8424
+ let t15;
8432
8425
  if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
8433
- t16 = /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { size: "small", iconKey: pagesCollectionTemplate.icon });
8434
- $[32] = t16;
8426
+ t15 = /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { size: "small", iconKey: blogCollectionTemplate.icon });
8427
+ $[32] = t15;
8435
8428
  } else {
8436
- t16 = $[32];
8429
+ t15 = $[32];
8437
8430
  }
8438
- let t17;
8431
+ let t16;
8439
8432
  if ($[33] !== onContinue || $[34] !== setValues) {
8440
- t17 = /* @__PURE__ */ jsxRuntime.jsx(TemplateButton, { title: "Pages", subtitle: "A collection of pages with images, authors and complex content", icon: t16, onClick: () => {
8441
- setValues(pagesCollectionTemplate);
8433
+ t16 = /* @__PURE__ */ jsxRuntime.jsx(TemplateButton, { title: "Blog posts", subtitle: "A collection of blog posts with images, authors and complex content", icon: t15, onClick: () => {
8434
+ setValues(blogCollectionTemplate);
8442
8435
  onContinue();
8443
8436
  } });
8444
8437
  $[33] = onContinue;
8445
8438
  $[34] = setValues;
8446
- $[35] = t17;
8439
+ $[35] = t16;
8440
+ } else {
8441
+ t16 = $[35];
8442
+ }
8443
+ let t17;
8444
+ if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
8445
+ t17 = /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { size: "small", iconKey: pagesCollectionTemplate.icon });
8446
+ $[36] = t17;
8447
8447
  } else {
8448
- t17 = $[35];
8448
+ t17 = $[36];
8449
8449
  }
8450
8450
  let t18;
8451
- if ($[36] !== t11 || $[37] !== t13 || $[38] !== t15 || $[39] !== t17) {
8452
- t18 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-2", children: [
8453
- t9,
8451
+ if ($[37] !== onContinue || $[38] !== setValues) {
8452
+ t18 = /* @__PURE__ */ jsxRuntime.jsx(TemplateButton, { title: "Pages", subtitle: "A collection of pages with images, authors and complex content", icon: t17, onClick: () => {
8453
+ setValues(pagesCollectionTemplate);
8454
+ onContinue();
8455
+ } });
8456
+ $[37] = onContinue;
8457
+ $[38] = setValues;
8458
+ $[39] = t18;
8459
+ } else {
8460
+ t18 = $[39];
8461
+ }
8462
+ let t19;
8463
+ if ($[40] !== t12 || $[41] !== t14 || $[42] !== t16 || $[43] !== t18) {
8464
+ t19 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-2", children: [
8465
+ t10,
8454
8466
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-4", children: [
8455
- t11,
8456
- t13,
8457
- t15,
8458
- t17
8467
+ t12,
8468
+ t14,
8469
+ t16,
8470
+ t18
8459
8471
  ] })
8460
8472
  ] });
8461
- $[36] = t11;
8462
- $[37] = t13;
8463
- $[38] = t15;
8464
- $[39] = t17;
8465
- $[40] = t18;
8473
+ $[40] = t12;
8474
+ $[41] = t14;
8475
+ $[42] = t16;
8476
+ $[43] = t18;
8477
+ $[44] = t19;
8466
8478
  } else {
8467
- t18 = $[40];
8479
+ t19 = $[44];
8468
8480
  }
8469
- let t19;
8470
- if ($[41] !== onContinue || $[42] !== parentCollection) {
8471
- t19 = !parentCollection && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
8481
+ let t20;
8482
+ if ($[45] !== onContinue || $[46] !== parentCollection) {
8483
+ t20 = !parentCollection && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
8472
8484
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", color: "secondary", className: "mb-2", children: "● Create a collection from a file (csv, json, xls, xslx...)" }),
8473
8485
  /* @__PURE__ */ jsxRuntime.jsx(data_import_export.ImportFileUpload, { onDataAdded: (data, propertiesOrder) => onContinue(data, propertiesOrder) })
8474
8486
  ] });
8475
- $[41] = onContinue;
8476
- $[42] = parentCollection;
8477
- $[43] = t19;
8487
+ $[45] = onContinue;
8488
+ $[46] = parentCollection;
8489
+ $[47] = t20;
8478
8490
  } else {
8479
- t19 = $[43];
8491
+ t20 = $[47];
8480
8492
  }
8481
- let t20;
8482
- if ($[44] !== onContinue) {
8483
- t20 = /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", onClick: () => onContinue(), className: "my-2", children: "Continue from scratch" }) });
8484
- $[44] = onContinue;
8485
- $[45] = t20;
8493
+ let t21;
8494
+ if ($[48] !== onContinue) {
8495
+ t21 = /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", onClick: () => onContinue(), className: "my-2", children: "Continue from scratch" }) });
8496
+ $[48] = onContinue;
8497
+ $[49] = t21;
8486
8498
  } else {
8487
- t20 = $[45];
8499
+ t21 = $[49];
8488
8500
  }
8489
- let t21;
8490
- if ($[46] !== t18 || $[47] !== t19 || $[48] !== t20 || $[49] !== t4 || $[50] !== t8) {
8491
- t21 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Container, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
8501
+ let t22;
8502
+ if ($[50] !== t19 || $[51] !== t20 || $[52] !== t21 || $[53] !== t4 || $[54] !== t9) {
8503
+ t22 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Container, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
8492
8504
  t3,
8493
8505
  t4,
8494
- t8,
8495
- t18,
8506
+ t9,
8496
8507
  t19,
8497
- t20
8508
+ t20,
8509
+ t21
8498
8510
  ] }) });
8499
- $[46] = t18;
8500
- $[47] = t19;
8501
- $[48] = t20;
8502
- $[49] = t4;
8503
- $[50] = t8;
8504
- $[51] = t21;
8511
+ $[50] = t19;
8512
+ $[51] = t20;
8513
+ $[52] = t21;
8514
+ $[53] = t4;
8515
+ $[54] = t9;
8516
+ $[55] = t22;
8505
8517
  } else {
8506
- t21 = $[51];
8518
+ t22 = $[55];
8507
8519
  }
8508
- return t21;
8520
+ return t22;
8509
8521
  }
8510
8522
  function TemplateButton(t0) {
8511
8523
  const $ = reactCompilerRuntime.c(10);
@@ -8606,7 +8618,7 @@
8606
8618
  const previousFullId = getFullId(previousId, namespace);
8607
8619
  const previousPropertyPath = idToPropertiesPath(previousFullId);
8608
8620
  const currentPropertiesOrder = getCurrentPropertiesOrder(namespace);
8609
- const newPropertiesOrder_0 = currentPropertiesOrder.map((p) => p === previousId ? id : p).filter(_temp$2);
8621
+ const newPropertiesOrder_0 = currentPropertiesOrder.map((p) => p === previousId ? id : p).filter(_temp$3);
8610
8622
  updatePropertiesOrder(newPropertiesOrder_0, namespace);
8611
8623
  const newHeadersMapping = {
8612
8624
  ...importConfig.headersMapping
@@ -8772,7 +8784,7 @@
8772
8784
  }
8773
8785
  return t13;
8774
8786
  }
8775
- function _temp$2(p_0) {
8787
+ function _temp$3(p_0) {
8776
8788
  return p_0 !== void 0;
8777
8789
  }
8778
8790
  function PropertySelect(t0) {
@@ -8845,7 +8857,7 @@
8845
8857
  }
8846
8858
  let t9;
8847
8859
  if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
8848
- t9 = Object.entries(supportedFields).map(_temp2$1);
8860
+ t9 = Object.entries(supportedFields).map(_temp2$2);
8849
8861
  $[12] = t9;
8850
8862
  } else {
8851
8863
  t9 = $[12];
@@ -8875,7 +8887,7 @@
8875
8887
  }
8876
8888
  return t11;
8877
8889
  }
8878
- function _temp2$1(t0) {
8890
+ function _temp2$2(t0) {
8879
8891
  const [key, widget_0] = t0;
8880
8892
  return /* @__PURE__ */ jsxRuntime.jsx(PropertySelectItem, { value: key, optionDisabled: false, propertyConfig: widget_0, existing: false }, key);
8881
8893
  }
@@ -9041,7 +9053,7 @@
9041
9053
  }
9042
9054
  let t7;
9043
9055
  if ($[12] !== propertiesOrder) {
9044
- t7 = propertiesOrder.map(_temp$1);
9056
+ t7 = propertiesOrder.map(_temp$2);
9045
9057
  $[12] = propertiesOrder;
9046
9058
  $[13] = t7;
9047
9059
  } else {
@@ -9060,7 +9072,7 @@
9060
9072
  }
9061
9073
  return t8;
9062
9074
  }
9063
- function _temp$1(p) {
9075
+ function _temp$2(p) {
9064
9076
  return {
9065
9077
  key: p,
9066
9078
  disabled: false
@@ -9114,6 +9126,355 @@
9114
9126
  idColumn
9115
9127
  };
9116
9128
  }
9129
+ function EntityActionsSelectDialog(t0) {
9130
+ const $ = reactCompilerRuntime.c(15);
9131
+ const {
9132
+ open,
9133
+ onClose
9134
+ } = t0;
9135
+ const {
9136
+ entityActions
9137
+ } = core.useCustomizationController();
9138
+ let t1;
9139
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
9140
+ t1 = /* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: "Select custom action" });
9141
+ $[0] = t1;
9142
+ } else {
9143
+ t1 = $[0];
9144
+ }
9145
+ let t2;
9146
+ if ($[1] !== entityActions || $[2] !== onClose) {
9147
+ t2 = entityActions?.map((action) => /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { onClick: () => onClose(action.key), fullWidth: true, variant: "text", children: [
9148
+ action.name,
9149
+ " (",
9150
+ action.key,
9151
+ ")"
9152
+ ] }, action.key));
9153
+ $[1] = entityActions;
9154
+ $[2] = onClose;
9155
+ $[3] = t2;
9156
+ } else {
9157
+ t2 = $[3];
9158
+ }
9159
+ let t3;
9160
+ if ($[4] !== entityActions) {
9161
+ t3 = (entityActions ?? []).length === 0 && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", children: "No custom actions defined. Define your custom actions in the customization settings, before using this dialog." });
9162
+ $[4] = entityActions;
9163
+ $[5] = t3;
9164
+ } else {
9165
+ t3 = $[5];
9166
+ }
9167
+ let t4;
9168
+ if ($[6] !== t2 || $[7] !== t3) {
9169
+ t4 = /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogContent, { className: "flex flex-col gap-4", children: [
9170
+ t2,
9171
+ t3
9172
+ ] });
9173
+ $[6] = t2;
9174
+ $[7] = t3;
9175
+ $[8] = t4;
9176
+ } else {
9177
+ t4 = $[8];
9178
+ }
9179
+ let t5;
9180
+ if ($[9] !== onClose) {
9181
+ t5 = /* @__PURE__ */ jsxRuntime.jsx(ui.DialogActions, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "outlined", color: "primary", onClick: () => onClose(), children: "Cancel" }) });
9182
+ $[9] = onClose;
9183
+ $[10] = t5;
9184
+ } else {
9185
+ t5 = $[10];
9186
+ }
9187
+ let t6;
9188
+ if ($[11] !== open || $[12] !== t4 || $[13] !== t5) {
9189
+ t6 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Dialog, { maxWidth: "md", open, children: [
9190
+ t1,
9191
+ t4,
9192
+ t5
9193
+ ] });
9194
+ $[11] = open;
9195
+ $[12] = t4;
9196
+ $[13] = t5;
9197
+ $[14] = t6;
9198
+ } else {
9199
+ t6 = $[14];
9200
+ }
9201
+ return t6;
9202
+ }
9203
+ function EntityActionsEditTab(t0) {
9204
+ const $ = reactCompilerRuntime.c(64);
9205
+ const {
9206
+ collection
9207
+ } = t0;
9208
+ const {
9209
+ entityActions: contextEntityActions
9210
+ } = core.useCustomizationController();
9211
+ const [addEntityActionDialogOpen, setAddEntityActionDialogOpen] = React.useState(false);
9212
+ const [actionToDelete, setActionToDelete] = React.useState();
9213
+ const {
9214
+ values,
9215
+ setFieldValue
9216
+ } = formex.useFormex();
9217
+ let T0;
9218
+ let T1;
9219
+ let T2;
9220
+ let T3;
9221
+ let t1;
9222
+ let t10;
9223
+ let t2;
9224
+ let t3;
9225
+ let t4;
9226
+ let t5;
9227
+ let t6;
9228
+ let t7;
9229
+ let t8;
9230
+ let t9;
9231
+ if ($[0] !== collection.entityActions || $[1] !== contextEntityActions || $[2] !== values.entityActions) {
9232
+ const resolvedEntityActions = values.entityActions?.filter(_temp$1).map((e_0) => core.resolveEntityAction(e_0, contextEntityActions)).filter(Boolean) ?? [];
9233
+ const hardCodedEntityActions = collection.entityActions?.filter(_temp2$1) ?? [];
9234
+ const totalEntityActions = resolvedEntityActions.length + hardCodedEntityActions.length;
9235
+ t10 = "overflow-auto my-auto";
9236
+ T3 = ui.Container;
9237
+ t8 = "2xl";
9238
+ t9 = "flex flex-col gap-4 p-8 m-auto";
9239
+ t7 = "flex flex-col gap-16";
9240
+ t4 = "flex-grow flex flex-col gap-4 items-start";
9241
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
9242
+ t5 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "h5", children: "Custom actions" });
9243
+ $[17] = t5;
9244
+ } else {
9245
+ t5 = $[17];
9246
+ }
9247
+ if ($[18] !== totalEntityActions) {
9248
+ t6 = totalEntityActions === 0 && /* @__PURE__ */ jsxRuntime.jsx(ui.Alert, { action: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", size: "small", href: "https://firecms.co/docs/custom_actions", component: "a", rel: "noopener noreferrer", target: "_blank", children: "More info" }), children: "Define your own custom actions by uploading them with the CLI." });
9249
+ $[18] = totalEntityActions;
9250
+ $[19] = t6;
9251
+ } else {
9252
+ t6 = $[19];
9253
+ }
9254
+ T2 = ui.Paper;
9255
+ t3 = "flex flex-col gap-4 p-2 w-full";
9256
+ T1 = ui.Table;
9257
+ T0 = ui.TableBody;
9258
+ let t112;
9259
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
9260
+ t112 = (action) => /* @__PURE__ */ jsxRuntime.jsxs(ui.TableRow, { children: [
9261
+ /* @__PURE__ */ jsxRuntime.jsx(ui.TableCell, { align: "left", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "flex-grow", children: action.name }) }),
9262
+ /* @__PURE__ */ jsxRuntime.jsx(ui.TableCell, { align: "right", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Remove", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: (e_2) => {
9263
+ e_2.preventDefault();
9264
+ e_2.stopPropagation();
9265
+ setActionToDelete(action.key);
9266
+ }, color: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx(ui.DeleteIcon, { size: "small" }) }) }) })
9267
+ ] }, action.key);
9268
+ $[20] = t112;
9269
+ } else {
9270
+ t112 = $[20];
9271
+ }
9272
+ t1 = resolvedEntityActions.map(t112);
9273
+ t2 = hardCodedEntityActions.map(_temp3);
9274
+ $[0] = collection.entityActions;
9275
+ $[1] = contextEntityActions;
9276
+ $[2] = values.entityActions;
9277
+ $[3] = T0;
9278
+ $[4] = T1;
9279
+ $[5] = T2;
9280
+ $[6] = T3;
9281
+ $[7] = t1;
9282
+ $[8] = t10;
9283
+ $[9] = t2;
9284
+ $[10] = t3;
9285
+ $[11] = t4;
9286
+ $[12] = t5;
9287
+ $[13] = t6;
9288
+ $[14] = t7;
9289
+ $[15] = t8;
9290
+ $[16] = t9;
9291
+ } else {
9292
+ T0 = $[3];
9293
+ T1 = $[4];
9294
+ T2 = $[5];
9295
+ T3 = $[6];
9296
+ t1 = $[7];
9297
+ t10 = $[8];
9298
+ t2 = $[9];
9299
+ t3 = $[10];
9300
+ t4 = $[11];
9301
+ t5 = $[12];
9302
+ t6 = $[13];
9303
+ t7 = $[14];
9304
+ t8 = $[15];
9305
+ t9 = $[16];
9306
+ }
9307
+ let t11;
9308
+ if ($[21] !== T0 || $[22] !== t1 || $[23] !== t2) {
9309
+ t11 = /* @__PURE__ */ jsxRuntime.jsxs(T0, { children: [
9310
+ t1,
9311
+ t2
9312
+ ] });
9313
+ $[21] = T0;
9314
+ $[22] = t1;
9315
+ $[23] = t2;
9316
+ $[24] = t11;
9317
+ } else {
9318
+ t11 = $[24];
9319
+ }
9320
+ let t12;
9321
+ if ($[25] !== T1 || $[26] !== t11) {
9322
+ t12 = /* @__PURE__ */ jsxRuntime.jsx(T1, { children: t11 });
9323
+ $[25] = T1;
9324
+ $[26] = t11;
9325
+ $[27] = t12;
9326
+ } else {
9327
+ t12 = $[27];
9328
+ }
9329
+ let t13;
9330
+ if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
9331
+ t13 = () => {
9332
+ setAddEntityActionDialogOpen(true);
9333
+ };
9334
+ $[28] = t13;
9335
+ } else {
9336
+ t13 = $[28];
9337
+ }
9338
+ let t14;
9339
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
9340
+ t14 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: t13, variant: "text", startIcon: /* @__PURE__ */ jsxRuntime.jsx(ui.AddIcon, {}), children: "Add custom entity action" });
9341
+ $[29] = t14;
9342
+ } else {
9343
+ t14 = $[29];
9344
+ }
9345
+ let t15;
9346
+ if ($[30] !== T2 || $[31] !== t12 || $[32] !== t3) {
9347
+ t15 = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(T2, { className: t3, children: [
9348
+ t12,
9349
+ t14
9350
+ ] }) });
9351
+ $[30] = T2;
9352
+ $[31] = t12;
9353
+ $[32] = t3;
9354
+ $[33] = t15;
9355
+ } else {
9356
+ t15 = $[33];
9357
+ }
9358
+ let t16;
9359
+ if ($[34] !== t15 || $[35] !== t4 || $[36] !== t5 || $[37] !== t6) {
9360
+ t16 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t4, children: [
9361
+ t5,
9362
+ t6,
9363
+ t15
9364
+ ] });
9365
+ $[34] = t15;
9366
+ $[35] = t4;
9367
+ $[36] = t5;
9368
+ $[37] = t6;
9369
+ $[38] = t16;
9370
+ } else {
9371
+ t16 = $[38];
9372
+ }
9373
+ let t17;
9374
+ if ($[39] !== t16 || $[40] !== t7) {
9375
+ t17 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: t7, children: t16 });
9376
+ $[39] = t16;
9377
+ $[40] = t7;
9378
+ $[41] = t17;
9379
+ } else {
9380
+ t17 = $[41];
9381
+ }
9382
+ let t18;
9383
+ if ($[42] !== T3 || $[43] !== t17 || $[44] !== t8 || $[45] !== t9) {
9384
+ t18 = /* @__PURE__ */ jsxRuntime.jsx(T3, { maxWidth: t8, className: t9, children: t17 });
9385
+ $[42] = T3;
9386
+ $[43] = t17;
9387
+ $[44] = t8;
9388
+ $[45] = t9;
9389
+ $[46] = t18;
9390
+ } else {
9391
+ t18 = $[46];
9392
+ }
9393
+ let t19;
9394
+ if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
9395
+ t19 = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
9396
+ height: "52px"
9397
+ } });
9398
+ $[47] = t19;
9399
+ } else {
9400
+ t19 = $[47];
9401
+ }
9402
+ let t20;
9403
+ if ($[48] !== actionToDelete || $[49] !== setFieldValue || $[50] !== values.entityActions) {
9404
+ t20 = actionToDelete && /* @__PURE__ */ jsxRuntime.jsx(core.ConfirmationDialog, { open: Boolean(actionToDelete), onAccept: () => {
9405
+ setFieldValue("entityActions", values.entityActions?.filter((e_3) => e_3 !== actionToDelete));
9406
+ setActionToDelete(void 0);
9407
+ }, onCancel: () => setActionToDelete(void 0), title: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: "Remove this action?" }), body: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9408
+ "This will ",
9409
+ /* @__PURE__ */ jsxRuntime.jsx("b", { children: "not delete any data" }),
9410
+ ", only the action in the CMS"
9411
+ ] }) });
9412
+ $[48] = actionToDelete;
9413
+ $[49] = setFieldValue;
9414
+ $[50] = values.entityActions;
9415
+ $[51] = t20;
9416
+ } else {
9417
+ t20 = $[51];
9418
+ }
9419
+ let t21;
9420
+ if ($[52] !== contextEntityActions || $[53] !== setFieldValue || $[54] !== values.entityActions) {
9421
+ t21 = (selectedActionKey) => {
9422
+ if (selectedActionKey) {
9423
+ console.log("Selected action key:", selectedActionKey);
9424
+ const value = [...values.entityActions ?? [], selectedActionKey].filter((e_4) => typeof e_4 === "string" && (contextEntityActions ?? []).some((action_1) => action_1.key === e_4));
9425
+ setFieldValue("entityActions", value);
9426
+ }
9427
+ setAddEntityActionDialogOpen(false);
9428
+ };
9429
+ $[52] = contextEntityActions;
9430
+ $[53] = setFieldValue;
9431
+ $[54] = values.entityActions;
9432
+ $[55] = t21;
9433
+ } else {
9434
+ t21 = $[55];
9435
+ }
9436
+ let t22;
9437
+ if ($[56] !== addEntityActionDialogOpen || $[57] !== t21) {
9438
+ t22 = /* @__PURE__ */ jsxRuntime.jsx(EntityActionsSelectDialog, { open: addEntityActionDialogOpen, onClose: t21 });
9439
+ $[56] = addEntityActionDialogOpen;
9440
+ $[57] = t21;
9441
+ $[58] = t22;
9442
+ } else {
9443
+ t22 = $[58];
9444
+ }
9445
+ let t23;
9446
+ if ($[59] !== t10 || $[60] !== t18 || $[61] !== t20 || $[62] !== t22) {
9447
+ t23 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t10, children: [
9448
+ t18,
9449
+ t19,
9450
+ t20,
9451
+ t22
9452
+ ] });
9453
+ $[59] = t10;
9454
+ $[60] = t18;
9455
+ $[61] = t20;
9456
+ $[62] = t22;
9457
+ $[63] = t23;
9458
+ } else {
9459
+ t23 = $[63];
9460
+ }
9461
+ return t23;
9462
+ }
9463
+ function _temp3(action_0) {
9464
+ return /* @__PURE__ */ jsxRuntime.jsx(ui.TableRow, { children: /* @__PURE__ */ jsxRuntime.jsxs(ui.TableCell, { align: "left", children: [
9465
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "flex-grow", children: action_0.name }),
9466
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "caption", className: "flex-grow", children: [
9467
+ "This action is defined in code with key ",
9468
+ /* @__PURE__ */ jsxRuntime.jsx("code", { children: action_0.key })
9469
+ ] })
9470
+ ] }) }, action_0.key);
9471
+ }
9472
+ function _temp2$1(e_1) {
9473
+ return typeof e_1 !== "string";
9474
+ }
9475
+ function _temp$1(e) {
9476
+ return typeof e === "string";
9477
+ }
9117
9478
  function CollectionEditorDialog(props) {
9118
9479
  const $ = reactCompilerRuntime.c(24);
9119
9480
  const open = props.open;
@@ -9352,10 +9713,10 @@
9352
9713
  setCurrentView("details");
9353
9714
  }
9354
9715
  };
9355
- const doCollectionInference = (collection_0) => {
9716
+ const doCollectionInference = collectionInference ? (collection_0) => {
9356
9717
  if (!collectionInference) return void 0;
9357
9718
  return collectionInference?.(collection_0.path, collection_0.collectionGroup ?? false, parentPaths ?? []);
9358
- };
9719
+ } : void 0;
9359
9720
  const inferCollectionFromData = async (newCollection) => {
9360
9721
  try {
9361
9722
  if (!doCollectionInference) {
@@ -9574,7 +9935,8 @@
9574
9935
  !isNewCollection && /* @__PURE__ */ jsxRuntime.jsxs(ui.Tabs, { value: currentView, innerClassName: ui.cls(ui.defaultBorderMixin, "px-4 h-14 w-full justify-end bg-surface-50 dark:bg-surface-950 border-b"), onValueChange: (v) => setCurrentView(v), children: [
9575
9936
  /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "details", children: "Details" }),
9576
9937
  /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "properties", children: "Properties" }),
9577
- /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "subcollections", children: "Additional views" })
9938
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "subcollections", children: "Additional views" }),
9939
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "custom_actions", children: "Custom actions" })
9578
9940
  ] }),
9579
9941
  /* @__PURE__ */ jsxRuntime.jsxs("form", { noValidate: true, onSubmit: formController.handleSubmit, className: ui.cls(isNewCollection ? "h-full" : "h-[calc(100%-48px)]", "flex-grow flex flex-col relative"), children: [
9580
9942
  currentView === "loading" && /* @__PURE__ */ jsxRuntime.jsx(core.CircularProgressCenter, {}),
@@ -9603,6 +9965,7 @@
9603
9965
  setDeleteRequested(true);
9604
9966
  }, children: "Reset to code" })
9605
9967
  ] }) }),
9968
+ currentView === "custom_actions" && collection && /* @__PURE__ */ jsxRuntime.jsx(EntityActionsEditTab, { collection }),
9606
9969
  currentView === "subcollections" && collection && /* @__PURE__ */ jsxRuntime.jsx(SubcollectionsEditTab, { parentCollection, configController, getUser, collectionInference, parentCollectionIds, collection }),
9607
9970
  currentView === "properties" && /* @__PURE__ */ jsxRuntime.jsx(CollectionPropertiesEditorForm, { showErrors: submitCount > 0, isNewCollection, reservedGroups, onPropertyError: (propertyKey, namespace, error_0) => {
9608
9971
  const current = core.removeUndefined({
@@ -9614,28 +9977,28 @@
9614
9977
  }, getUser, getData: getDataWithPath, doCollectionInference, propertyConfigs, collectionEditable, extraIcon: extraView?.icon && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { color: "primary", onClick: () => setCurrentView("extra_view"), children: extraView.icon }) }),
9615
9978
  currentView !== "welcome" && /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogActions, { position: "absolute", children: [
9616
9979
  error && /* @__PURE__ */ jsxRuntime.jsx(core.ErrorView, { error }),
9617
- isNewCollection && includeTemplates && currentView === "import_data_mapping" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => {
9980
+ isNewCollection && includeTemplates && currentView === "import_data_mapping" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", color: "primary", onClick: () => {
9618
9981
  importConfig.setInUse(false);
9619
9982
  return setCurrentView("welcome");
9620
9983
  }, children: [
9621
9984
  /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9622
9985
  "Back"
9623
9986
  ] }),
9624
- isNewCollection && includeTemplates && currentView === "import_data_preview" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => {
9987
+ isNewCollection && includeTemplates && currentView === "import_data_preview" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", color: "primary", onClick: () => {
9625
9988
  setCurrentView("import_data_mapping");
9626
9989
  }, children: [
9627
9990
  /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9628
9991
  "Back"
9629
9992
  ] }),
9630
- isNewCollection && includeTemplates && currentView === "details" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => setCurrentView("welcome"), children: [
9993
+ isNewCollection && includeTemplates && currentView === "details" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", color: "primary", type: "button", onClick: () => setCurrentView("welcome"), children: [
9631
9994
  /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9632
9995
  "Back"
9633
9996
  ] }),
9634
- isNewCollection && currentView === "properties" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => setCurrentView("details"), children: [
9997
+ isNewCollection && currentView === "properties" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", color: "primary", onClick: () => setCurrentView("details"), children: [
9635
9998
  /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9636
9999
  "Back"
9637
10000
  ] }),
9638
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", onClick: () => {
10001
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", color: "primary", onClick: () => {
9639
10002
  handleCancel();
9640
10003
  }, children: "Cancel" }),
9641
10004
  isNewCollection && currentView === "import_data_mapping" && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "filled", color: "primary", onClick: onImportMappingComplete, children: "Next" }),
@@ -10128,14 +10491,14 @@
10128
10491
  }
10129
10492
  let t6;
10130
10493
  if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
10131
- t6 = /* @__PURE__ */ jsxRuntime.jsx(ui.SettingsIcon, {});
10494
+ t6 = /* @__PURE__ */ jsxRuntime.jsx(ui.SettingsIcon, { size: "small" });
10132
10495
  $[15] = t6;
10133
10496
  } else {
10134
10497
  t6 = $[15];
10135
10498
  }
10136
10499
  let t7;
10137
10500
  if ($[16] !== t4 || $[17] !== t5) {
10138
- t7 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { color: "primary", disabled: t4, onClick: t5, children: t6 });
10501
+ t7 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", color: "primary", disabled: t4, onClick: t5, children: t6 });
10139
10502
  $[16] = t4;
10140
10503
  $[17] = t5;
10141
10504
  $[18] = t7;
@@ -10670,8 +11033,100 @@
10670
11033
  }
10671
11034
  return t8;
10672
11035
  }
11036
+ function EditorEntityAction(t0) {
11037
+ const $ = reactCompilerRuntime.c(23);
11038
+ const {
11039
+ path: fullPath,
11040
+ parentCollectionIds,
11041
+ collection,
11042
+ formContext
11043
+ } = t0;
11044
+ const authController = core.useAuthController();
11045
+ const navigationController = core.useNavigationController();
11046
+ const collectionEditorController = useCollectionEditorController();
11047
+ let t1;
11048
+ if ($[0] !== navigationController || $[1] !== parentCollectionIds) {
11049
+ t1 = navigationController.getCollectionFromIds(parentCollectionIds);
11050
+ $[0] = navigationController;
11051
+ $[1] = parentCollectionIds;
11052
+ $[2] = t1;
11053
+ } else {
11054
+ t1 = $[2];
11055
+ }
11056
+ const parentCollection = t1;
11057
+ let t2;
11058
+ if ($[3] !== authController || $[4] !== collection || $[5] !== collectionEditorController) {
11059
+ t2 = collectionEditorController.configPermissions ? collectionEditorController.configPermissions({
11060
+ user: authController.user,
11061
+ collection
11062
+ }).editCollections : true;
11063
+ $[3] = authController;
11064
+ $[4] = collection;
11065
+ $[5] = collectionEditorController;
11066
+ $[6] = t2;
11067
+ } else {
11068
+ t2 = $[6];
11069
+ }
11070
+ const canEditCollection = t2;
11071
+ const isDirty = formContext?.formex.dirty ?? false;
11072
+ const t3 = canEditCollection ? isDirty ? "You need to save the document before changing the schema" : "Edit schema for this form" : "You don't have permissions to edit this collection";
11073
+ const t4 = !canEditCollection || isDirty;
11074
+ let t5;
11075
+ if ($[7] !== canEditCollection || $[8] !== collection || $[9] !== collectionEditorController || $[10] !== fullPath || $[11] !== parentCollection || $[12] !== parentCollectionIds) {
11076
+ t5 = canEditCollection ? () => collectionEditorController?.editCollection({
11077
+ id: collection.id,
11078
+ fullPath,
11079
+ parentCollectionIds,
11080
+ parentCollection
11081
+ }) : void 0;
11082
+ $[7] = canEditCollection;
11083
+ $[8] = collection;
11084
+ $[9] = collectionEditorController;
11085
+ $[10] = fullPath;
11086
+ $[11] = parentCollection;
11087
+ $[12] = parentCollectionIds;
11088
+ $[13] = t5;
11089
+ } else {
11090
+ t5 = $[13];
11091
+ }
11092
+ let t6;
11093
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
11094
+ t6 = /* @__PURE__ */ jsxRuntime.jsx(ui.SettingsIcon, { size: "small" });
11095
+ $[14] = t6;
11096
+ } else {
11097
+ t6 = $[14];
11098
+ }
11099
+ let t7;
11100
+ if ($[15] !== t4 || $[16] !== t5) {
11101
+ t7 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { color: "primary", disabled: t4, onClick: t5, children: t6 });
11102
+ $[15] = t4;
11103
+ $[16] = t5;
11104
+ $[17] = t7;
11105
+ } else {
11106
+ t7 = $[17];
11107
+ }
11108
+ let t8;
11109
+ if ($[18] !== t3 || $[19] !== t7) {
11110
+ t8 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { asChild: true, title: t3, children: t7 });
11111
+ $[18] = t3;
11112
+ $[19] = t7;
11113
+ $[20] = t8;
11114
+ } else {
11115
+ t8 = $[20];
11116
+ }
11117
+ const editorButton = t8;
11118
+ let t9;
11119
+ if ($[21] !== editorButton) {
11120
+ t9 = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: editorButton });
11121
+ $[21] = editorButton;
11122
+ $[22] = t9;
11123
+ } else {
11124
+ t9 = $[22];
11125
+ }
11126
+ return t9;
11127
+ }
10673
11128
  function useCollectionEditorPlugin(t0) {
10674
- const $ = reactCompilerRuntime.c(19);
11129
+ const $ = reactCompilerRuntime.c(22);
10675
11130
  const {
10676
11131
  collectionConfigController,
10677
11132
  configPermissions,
@@ -10727,47 +11182,59 @@
10727
11182
  t4 = $[11];
10728
11183
  }
10729
11184
  let t5;
10730
- if ($[12] !== t4) {
11185
+ if ($[12] !== collectionConfigController.navigationEntries || $[13] !== collectionConfigController.saveNavigationEntries || $[14] !== t4) {
10731
11186
  t5 = {
10732
11187
  additionalActions: t3,
10733
11188
  additionalChildrenStart: t4,
10734
11189
  CollectionActions: HomePageEditorCollectionAction,
10735
- AdditionalCards: NewCollectionCard
11190
+ AdditionalCards: NewCollectionCard,
11191
+ allowDragAndDrop: true,
11192
+ navigationEntries: collectionConfigController.navigationEntries,
11193
+ onNavigationEntriesUpdate: collectionConfigController.saveNavigationEntries
10736
11194
  };
10737
- $[12] = t4;
10738
- $[13] = t5;
11195
+ $[12] = collectionConfigController.navigationEntries;
11196
+ $[13] = collectionConfigController.saveNavigationEntries;
11197
+ $[14] = t4;
11198
+ $[15] = t5;
10739
11199
  } else {
10740
- t5 = $[13];
11200
+ t5 = $[15];
10741
11201
  }
10742
11202
  let t6;
10743
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
11203
+ let t7;
11204
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
10744
11205
  t6 = {
10745
11206
  CollectionActionsStart: EditorCollectionActionStart,
10746
11207
  CollectionActions: EditorCollectionAction,
10747
11208
  HeaderAction: CollectionViewHeaderAction,
10748
11209
  AddColumnComponent: PropertyAddColumnComponent
10749
11210
  };
10750
- $[14] = t6;
11211
+ t7 = {
11212
+ ActionsTop: EditorEntityAction
11213
+ };
11214
+ $[16] = t6;
11215
+ $[17] = t7;
10751
11216
  } else {
10752
- t6 = $[14];
11217
+ t6 = $[16];
11218
+ t7 = $[17];
10753
11219
  }
10754
- let t7;
10755
- if ($[15] !== collectionConfigController.loading || $[16] !== t2 || $[17] !== t5) {
10756
- t7 = {
11220
+ let t8;
11221
+ if ($[18] !== collectionConfigController.loading || $[19] !== t2 || $[20] !== t5) {
11222
+ t8 = {
10757
11223
  key: "collection_editor",
10758
11224
  loading: collectionConfigController.loading,
10759
11225
  provider: t2,
10760
11226
  homePage: t5,
10761
- collectionView: t6
11227
+ collectionView: t6,
11228
+ form: t7
10762
11229
  };
10763
- $[15] = collectionConfigController.loading;
10764
- $[16] = t2;
10765
- $[17] = t5;
10766
- $[18] = t7;
11230
+ $[18] = collectionConfigController.loading;
11231
+ $[19] = t2;
11232
+ $[20] = t5;
11233
+ $[21] = t8;
10767
11234
  } else {
10768
- t7 = $[18];
11235
+ t8 = $[21];
10769
11236
  }
10770
- return t7;
11237
+ return t8;
10771
11238
  }
10772
11239
  function IntroWidget() {
10773
11240
  const $ = reactCompilerRuntime.c(11);
@@ -10848,11 +11315,19 @@
10848
11315
  };
10849
11316
  backendCollections.forEach(markAsEditable);
10850
11317
  const result = core.joinCollectionLists(baseCollections, backendCollections, [], modifyCollection);
10851
- result.sort((a, b) => baseCollections.findIndex((c) => c.id === a.id) - baseCollections.findIndex((c) => c.id === b.id));
10852
- console.debug("Collections result", {
10853
- baseCollections,
10854
- backendCollections,
10855
- result
11318
+ result.sort((a, b) => {
11319
+ const indexA = baseCollections.findIndex((c) => c.id === a.id);
11320
+ const indexB = baseCollections.findIndex((c) => c.id === b.id);
11321
+ if (indexA === -1 && indexB === -1) {
11322
+ return 0;
11323
+ }
11324
+ if (indexA === -1) {
11325
+ return 1;
11326
+ }
11327
+ if (indexB === -1) {
11328
+ return -1;
11329
+ }
11330
+ return indexA - indexB;
10856
11331
  });
10857
11332
  return result;
10858
11333
  };