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

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 (27) hide show
  1. package/README.md +165 -1
  2. package/dist/ConfigControllerProvider.d.ts +0 -1
  3. package/dist/index.es.js +1034 -844
  4. package/dist/index.es.js.map +1 -1
  5. package/dist/index.umd.js +1030 -843
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/types/collection_editor_controller.d.ts +0 -1
  8. package/dist/ui/collection_editor/CollectionEditorWelcomeView.d.ts +1 -1
  9. package/dist/ui/collection_editor/PropertyTree.d.ts +2 -3
  10. package/dist/useCollectionEditorPlugin.d.ts +3 -3
  11. package/package.json +8 -9
  12. package/src/ConfigControllerProvider.tsx +0 -5
  13. package/src/types/collection_editor_controller.tsx +0 -2
  14. package/src/ui/HomePageEditorCollectionAction.tsx +2 -1
  15. package/src/ui/collection_editor/CollectionDetailsForm.tsx +40 -8
  16. package/src/ui/collection_editor/CollectionEditorDialog.tsx +1 -1
  17. package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +5 -21
  18. package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +5 -4
  19. package/src/ui/collection_editor/EnumForm.tsx +1 -1
  20. package/src/ui/collection_editor/PropertyEditView.tsx +1 -2
  21. package/src/ui/collection_editor/PropertyTree.tsx +183 -139
  22. package/src/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +9 -2
  23. package/src/ui/collection_editor/properties/MapPropertyField.tsx +1 -1
  24. package/src/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +2 -0
  25. package/src/ui/collection_editor/utils/strings.ts +13 -6
  26. package/src/useCollectionEditorPlugin.tsx +5 -6
  27. package/src/utils/collections.ts +1 -0
package/dist/index.es.js CHANGED
@@ -1,14 +1,17 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
- import { FieldCaption, SearchIconsView, toSnakeCase, singular, IconForView, ArrayContainer, serializeRegExp, useSnackbarController, resolveEnumValues, isPropertyBuilder, useCustomizationController, getFieldConfig, ErrorBoundary, PropertyConfigBadge, unslugify, useNavigationController, mergeDeep, DEFAULT_FIELD_CONFIGS, getFieldId, isValidRegExp, isEmptyObject, ConfirmationDialog, useLargeLayout, makePropertiesEditable, resolveEntityView, useSelectionController, CircularProgressCenter, EntityCollectionTable, slugify, useAuthController, randomString, removeUndefined, ErrorView, removeInitialAndTrailingSlashes, getDefaultPropertiesOrder, joinCollectionLists } from "@firecms/core";
3
+ import { FieldCaption, SearchIconsView, toSnakeCase, singular, IconForView, ArrayContainer, serializeRegExp, useSnackbarController, resolveEnumValues, isPropertyBuilder, useCustomizationController, getFieldConfig, ErrorBoundary, PropertyConfigBadge, unslugify, useNavigationController, mergeDeep, DEFAULT_FIELD_CONFIGS, getFieldId, isValidRegExp, ConfirmationDialog, isEmptyObject, useLargeLayout, makePropertiesEditable, resolveEntityView, useAuthController, useSelectionController, CircularProgressCenter, EntityCollectionTable, slugify, randomString, removeUndefined, ErrorView, removeInitialAndTrailingSlashes, getDefaultPropertiesOrder, joinCollectionLists } from "@firecms/core";
4
4
  import * as React from "react";
5
5
  import React__default, { useContext, useState, useEffect, useMemo, useRef, useDeferredValue } from "react";
6
6
  import equal from "react-fast-compare";
7
- import { cls, Typography, VerticalSplitIcon, Tooltip, Card, SquareIcon, useAutoComplete, Chip, TextField, Autocomplete, AutocompleteItem, SelectItem, Container, IconButton, DebouncedTextField, SettingsIcon, CloseIcon, Select, BooleanSwitchWithLabel, ExpandablePanel, Dialog, Badge, AutorenewIcon, ListIcon, Button, CircularProgress, Paper, DialogTitle, DialogContent, DialogActions, RuleIcon, MultiSelectItem, CloudUploadIcon, MultiSelect, cardMixin, cardClickableMixin, cardSelectedMixin, FunctionsIcon, DoNotDisturbOnIcon, defaultBorderMixin, RemoveIcon, DragHandleIcon, AddIcon, SelectGroup, DeleteIcon, InfoLabel, fieldBackgroundMixin, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, WarningIcon, ContentCopyIcon, CodeIcon, Table, TableBody, TableRow, TableCell, Alert, Icon, coolIconKeys, Tabs, Tab, ArrowBackIcon, LoadingButton, CheckIcon, Menu, MoreVertIcon, MenuItem, UndoIcon, SaveIcon } from "@firecms/ui";
7
+ import { cls, Typography, VerticalSplitIcon, Tooltip, Card, SquareIcon, useAutoComplete, Chip, TextField, Autocomplete, AutocompleteItem, SelectItem, Container, IconButton, DebouncedTextField, BooleanSwitchWithLabel, SettingsIcon, CloseIcon, Select, ExpandablePanel, Dialog, Badge, AutorenewIcon, ListIcon, Button, CircularProgress, Paper, DialogTitle, DialogContent, DialogActions, RuleIcon, MultiSelectItem, CloudUploadIcon, MultiSelect, cardMixin, cardClickableMixin, cardSelectedMixin, FunctionsIcon, DoNotDisturbOnIcon, DragHandleIcon, defaultBorderMixin, RemoveIcon, AddIcon, SelectGroup, DeleteIcon, InfoLabel, fieldBackgroundMixin, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, WarningIcon, ContentCopyIcon, CodeIcon, Table, TableBody, TableRow, TableCell, Alert, Icon, coolIconKeys, Tabs, Tab, ArrowBackIcon, LoadingButton, CheckIcon, Menu, MoreVertIcon, MenuItem, UndoIcon, SaveIcon } from "@firecms/ui";
8
8
  import * as Yup from "yup";
9
9
  import { useFormex, getIn, Field, useCreateFormex, Formex, clone } from "@firecms/formex";
10
10
  import { extractEnumFromValues, buildPropertyFromData, buildEntityPropertiesFromData } from "@firecms/schema_inference";
11
- import { Draggable, Droppable, DragDropContext } from "@hello-pangea/dnd";
11
+ import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, closestCenter } from "@dnd-kit/core";
12
+ import { useSortable, sortableKeyboardCoordinates, SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable";
13
+ import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
14
+ import { CSS } from "@dnd-kit/utilities";
12
15
  import JSON5 from "json5";
13
16
  import { Highlight, themes } from "prism-react-renderer";
14
17
  import { ImportFileUpload, getInferenceType, ImportNewPropertyFieldPreview, DataNewPropertiesMapping, convertDataToEntity, useImportConfig, ImportSaveInProgress } from "@firecms/data_import_export";
@@ -162,7 +165,7 @@ function LayoutModeSwitch(t0) {
162
165
  return t18;
163
166
  }
164
167
  function CollectionDetailsForm(t0) {
165
- const $ = c(176);
168
+ const $ = c(196);
166
169
  const {
167
170
  isNewCollection,
168
171
  reservedGroups,
@@ -444,7 +447,7 @@ function CollectionDetailsForm(t0) {
444
447
  }
445
448
  const t37 = !isSubcollection && /* @__PURE__ */ jsxs("div", { className: "col-span-12 sm:col-span-4 relative", children: [
446
449
  /* @__PURE__ */ jsx(TextField, { error: showErrors && Boolean(errors.group), disabled: isSubmitting, value: values.group ?? "", autoComplete: "off", onChange: (event) => setFieldValue("group", event.target.value), name: "group", inputRef: groupRef, label: "Group" }),
447
- /* @__PURE__ */ jsx(Autocomplete, { open: autoCompleteOpen && (groupOptions ?? []).length > 0, setOpen: setAutoCompleteOpen, children: groupOptions?.map((group_0, index) => /* @__PURE__ */ jsx(AutocompleteItem, { onClick: () => {
450
+ /* @__PURE__ */ jsx(Autocomplete, { open: autoCompleteOpen && (groupOptions ?? []).length > 0, setOpen: setAutoCompleteOpen, children: groupOptions?.map((group_0, index) => /* @__PURE__ */ jsx(AutocompleteItem, { className: "pr-6 pl-14", onClick: () => {
448
451
  setAutoCompleteOpen(false);
449
452
  setFieldValue("group", group_0 ?? null);
450
453
  }, children: /* @__PURE__ */ jsx("div", { className: "flex-grow", children: group_0 }) }, index + "_" + group_0)) }),
@@ -468,101 +471,143 @@ function CollectionDetailsForm(t0) {
468
471
  } else {
469
472
  t40 = $[58];
470
473
  }
471
- let t41;
472
- if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
473
- t41 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row text-surface-500", children: [
474
- /* @__PURE__ */ jsx(SettingsIcon, {}),
475
- /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "ml-2", children: "Advanced" })
476
- ] });
477
- $[59] = t41;
478
- } else {
479
- t41 = $[59];
480
- }
481
- const t42 = !isNewCollection;
482
- const t43 = showErrors && Boolean(errors.id);
483
- let t44;
484
- if ($[60] !== t42 || $[61] !== t43) {
485
- t44 = /* @__PURE__ */ jsx(Field, { name: "id", as: DebouncedTextField, disabled: t42, label: "Collection id", error: t43 });
474
+ 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";
475
+ let t42;
476
+ if ($[59] !== setFieldValue) {
477
+ t42 = (v) => setFieldValue("history", v);
478
+ $[59] = setFieldValue;
486
479
  $[60] = t42;
487
- $[61] = t43;
488
- $[62] = t44;
489
480
  } else {
490
- t44 = $[62];
481
+ t42 = $[60];
491
482
  }
492
- const t45 = touched.id && Boolean(errors.id);
493
- const t46 = touched.id && Boolean(errors.id) ? errors.id : "This id identifies this collection. Typically the same as the path.";
494
- let t47;
495
- if ($[63] !== t45 || $[64] !== t46) {
496
- t47 = /* @__PURE__ */ jsx(FieldCaption, { error: t45, children: t46 });
497
- $[63] = t45;
498
- $[64] = t46;
499
- $[65] = t47;
483
+ const t43 = values.history === void 0 ? null : values.history;
484
+ let t44;
485
+ if ($[61] !== t41 || $[62] !== t42 || $[63] !== t43) {
486
+ t44 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", allowIndeterminate: true, label: t41, onValueChange: t42, value: t43 });
487
+ $[61] = t41;
488
+ $[62] = t42;
489
+ $[63] = t43;
490
+ $[64] = t44;
491
+ } else {
492
+ t44 = $[64];
493
+ }
494
+ let t45;
495
+ if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
496
+ t45 = /* @__PURE__ */ jsxs(FieldCaption, { children: [
497
+ "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 ",
498
+ /* @__PURE__ */ jsx("b", { children: "__history" }),
499
+ "."
500
+ ] });
501
+ $[65] = t45;
500
502
  } else {
501
- t47 = $[65];
503
+ t45 = $[65];
502
504
  }
503
- let t48;
504
- if ($[66] !== t44 || $[67] !== t47) {
505
- t48 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
505
+ let t46;
506
+ if ($[66] !== t44) {
507
+ t46 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
506
508
  t44,
507
- t47
509
+ t45
508
510
  ] });
509
511
  $[66] = t44;
510
- $[67] = t47;
511
- $[68] = t48;
512
+ $[67] = t46;
513
+ } else {
514
+ t46 = $[67];
515
+ }
516
+ let t47;
517
+ if ($[68] === Symbol.for("react.memo_cache_sentinel")) {
518
+ t47 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row text-surface-500", children: [
519
+ /* @__PURE__ */ jsx(SettingsIcon, {}),
520
+ /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "ml-2", children: "Advanced" })
521
+ ] });
522
+ $[68] = t47;
512
523
  } else {
513
- t48 = $[68];
524
+ t47 = $[68];
514
525
  }
515
- const t49 = showErrors && Boolean(errors.singularName);
526
+ const t48 = !isNewCollection;
527
+ const t49 = showErrors && Boolean(errors.id);
516
528
  let t50;
517
- if ($[69] !== handleChange || $[70] !== setFieldTouched) {
518
- t50 = (e_0) => {
519
- setFieldTouched("singularName", true);
520
- return handleChange(e_0);
521
- };
522
- $[69] = handleChange;
523
- $[70] = setFieldTouched;
529
+ if ($[69] !== t48 || $[70] !== t49) {
530
+ t50 = /* @__PURE__ */ jsx(Field, { name: "id", as: DebouncedTextField, disabled: t48, label: "Collection id", error: t49 });
531
+ $[69] = t48;
532
+ $[70] = t49;
524
533
  $[71] = t50;
525
534
  } else {
526
535
  t50 = $[71];
527
536
  }
528
- const t51 = values.singularName ?? "";
529
- let t52;
530
- if ($[72] !== t49 || $[73] !== t50 || $[74] !== t51) {
531
- t52 = /* @__PURE__ */ jsx(TextField, { error: t49, name: "singularName", "aria-describedby": "singularName-helper", onChange: t50, value: t51, label: "Singular name" });
532
- $[72] = t49;
533
- $[73] = t50;
534
- $[74] = t51;
535
- $[75] = t52;
536
- } else {
537
- t52 = $[75];
538
- }
539
- const t53 = showErrors && Boolean(errors.singularName);
540
- const t54 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define a singular name for your entities";
541
- let t55;
542
- if ($[76] !== t53 || $[77] !== t54) {
543
- t55 = /* @__PURE__ */ jsx(FieldCaption, { error: t53, children: t54 });
537
+ const t51 = touched.id && Boolean(errors.id);
538
+ const t52 = touched.id && Boolean(errors.id) ? errors.id : "This id identifies this collection. Typically the same as the path.";
539
+ let t53;
540
+ if ($[72] !== t51 || $[73] !== t52) {
541
+ t53 = /* @__PURE__ */ jsx(FieldCaption, { error: t51, children: t52 });
542
+ $[72] = t51;
543
+ $[73] = t52;
544
+ $[74] = t53;
545
+ } else {
546
+ t53 = $[74];
547
+ }
548
+ let t54;
549
+ if ($[75] !== t50 || $[76] !== t53) {
550
+ t54 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
551
+ t50,
552
+ t53
553
+ ] });
554
+ $[75] = t50;
544
555
  $[76] = t53;
545
556
  $[77] = t54;
546
- $[78] = t55;
547
557
  } else {
548
- t55 = $[78];
558
+ t54 = $[77];
549
559
  }
560
+ const t55 = showErrors && Boolean(errors.singularName);
550
561
  let t56;
551
- if ($[79] !== t52 || $[80] !== t55) {
552
- t56 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
553
- t52,
554
- t55
555
- ] });
556
- $[79] = t52;
557
- $[80] = t55;
558
- $[81] = t56;
562
+ if ($[78] !== handleChange || $[79] !== setFieldTouched) {
563
+ t56 = (e_0) => {
564
+ setFieldTouched("singularName", true);
565
+ return handleChange(e_0);
566
+ };
567
+ $[78] = handleChange;
568
+ $[79] = setFieldTouched;
569
+ $[80] = t56;
559
570
  } else {
560
- t56 = $[81];
571
+ t56 = $[80];
561
572
  }
562
- const t57 = showErrors && Boolean(errors.sideDialogWidth);
573
+ const t57 = values.singularName ?? "";
563
574
  let t58;
564
- if ($[82] !== setFieldTouched || $[83] !== setFieldValue) {
565
- t58 = (e_1) => {
575
+ if ($[81] !== t55 || $[82] !== t56 || $[83] !== t57) {
576
+ t58 = /* @__PURE__ */ jsx(TextField, { error: t55, name: "singularName", "aria-describedby": "singularName-helper", onChange: t56, value: t57, label: "Singular name" });
577
+ $[81] = t55;
578
+ $[82] = t56;
579
+ $[83] = t57;
580
+ $[84] = t58;
581
+ } else {
582
+ t58 = $[84];
583
+ }
584
+ const t59 = showErrors && Boolean(errors.singularName);
585
+ const t60 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define a singular name for your entities";
586
+ let t61;
587
+ if ($[85] !== t59 || $[86] !== t60) {
588
+ t61 = /* @__PURE__ */ jsx(FieldCaption, { error: t59, children: t60 });
589
+ $[85] = t59;
590
+ $[86] = t60;
591
+ $[87] = t61;
592
+ } else {
593
+ t61 = $[87];
594
+ }
595
+ let t62;
596
+ if ($[88] !== t58 || $[89] !== t61) {
597
+ t62 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
598
+ t58,
599
+ t61
600
+ ] });
601
+ $[88] = t58;
602
+ $[89] = t61;
603
+ $[90] = t62;
604
+ } else {
605
+ t62 = $[90];
606
+ }
607
+ const t63 = showErrors && Boolean(errors.sideDialogWidth);
608
+ let t64;
609
+ if ($[91] !== setFieldTouched || $[92] !== setFieldValue) {
610
+ t64 = (e_1) => {
566
611
  setFieldTouched("sideDialogWidth", true);
567
612
  const value_0 = e_1.target.value;
568
613
  if (!value_0) {
@@ -573,371 +618,402 @@ function CollectionDetailsForm(t0) {
573
618
  }
574
619
  }
575
620
  };
576
- $[82] = setFieldTouched;
577
- $[83] = setFieldValue;
578
- $[84] = t58;
621
+ $[91] = setFieldTouched;
622
+ $[92] = setFieldValue;
623
+ $[93] = t64;
579
624
  } else {
580
- t58 = $[84];
625
+ t64 = $[93];
581
626
  }
582
- let t59;
583
- if ($[85] !== setFieldValue) {
584
- t59 = () => {
627
+ let t65;
628
+ if ($[94] !== setFieldValue) {
629
+ t65 = () => {
585
630
  setFieldValue("sideDialogWidth", null);
586
631
  };
587
- $[85] = setFieldValue;
588
- $[86] = t59;
589
- } else {
590
- t59 = $[86];
591
- }
592
- const t60 = !values.sideDialogWidth;
593
- let t61;
594
- if ($[87] === Symbol.for("react.memo_cache_sentinel")) {
595
- t61 = /* @__PURE__ */ jsx(CloseIcon, { size: "small" });
596
- $[87] = t61;
597
- } else {
598
- t61 = $[87];
599
- }
600
- let t62;
601
- if ($[88] !== t59 || $[89] !== t60) {
602
- t62 = /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: t59, disabled: t60, children: t61 });
603
- $[88] = t59;
604
- $[89] = t60;
605
- $[90] = t62;
632
+ $[94] = setFieldValue;
633
+ $[95] = t65;
606
634
  } else {
607
- t62 = $[90];
635
+ t65 = $[95];
608
636
  }
609
- const t63 = values.sideDialogWidth ?? "";
610
- let t64;
611
- if ($[91] !== t57 || $[92] !== t58 || $[93] !== t62 || $[94] !== t63) {
612
- t64 = /* @__PURE__ */ jsx(TextField, { error: t57, name: "sideDialogWidth", type: "number", "aria-describedby": "sideDialogWidth-helper", onChange: t58, endAdornment: t62, value: t63, label: "Side dialog width" });
613
- $[91] = t57;
614
- $[92] = t58;
615
- $[93] = t62;
616
- $[94] = t63;
617
- $[95] = t64;
618
- } else {
619
- t64 = $[95];
620
- }
621
- const t65 = showErrors && Boolean(errors.singularName);
622
- const t66 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px";
637
+ const t66 = !values.sideDialogWidth;
623
638
  let t67;
624
- if ($[96] !== t65 || $[97] !== t66) {
625
- t67 = /* @__PURE__ */ jsx(FieldCaption, { error: t65, children: t66 });
626
- $[96] = t65;
627
- $[97] = t66;
628
- $[98] = t67;
639
+ if ($[96] === Symbol.for("react.memo_cache_sentinel")) {
640
+ t67 = /* @__PURE__ */ jsx(CloseIcon, { size: "small" });
641
+ $[96] = t67;
629
642
  } else {
630
- t67 = $[98];
643
+ t67 = $[96];
631
644
  }
632
645
  let t68;
633
- if ($[99] !== t64 || $[100] !== t67) {
634
- t68 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
635
- t64,
636
- t67
637
- ] });
638
- $[99] = t64;
639
- $[100] = t67;
640
- $[101] = t68;
641
- } else {
642
- t68 = $[101];
643
- }
644
- const t69 = showErrors && Boolean(errors.description);
645
- const t70 = values.description ?? "";
646
- let t71;
647
- if ($[102] !== handleChange || $[103] !== t69 || $[104] !== t70) {
648
- t71 = /* @__PURE__ */ jsx(TextField, { error: t69, name: "description", value: t70, onChange: handleChange, multiline: true, rows: 2, "aria-describedby": "description-helper-text", label: "Description" });
649
- $[102] = handleChange;
646
+ if ($[97] !== t65 || $[98] !== t66) {
647
+ t68 = /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: t65, disabled: t66, children: t67 });
648
+ $[97] = t65;
649
+ $[98] = t66;
650
+ $[99] = t68;
651
+ } else {
652
+ t68 = $[99];
653
+ }
654
+ const t69 = values.sideDialogWidth ?? "";
655
+ let t70;
656
+ if ($[100] !== t63 || $[101] !== t64 || $[102] !== t68 || $[103] !== t69) {
657
+ t70 = /* @__PURE__ */ jsx(TextField, { error: t63, name: "sideDialogWidth", type: "number", "aria-describedby": "sideDialogWidth-helper", onChange: t64, endAdornment: t68, value: t69, label: "Side dialog width" });
658
+ $[100] = t63;
659
+ $[101] = t64;
660
+ $[102] = t68;
650
661
  $[103] = t69;
651
662
  $[104] = t70;
652
- $[105] = t71;
653
663
  } else {
654
- t71 = $[105];
664
+ t70 = $[104];
655
665
  }
656
- const t72 = showErrors && Boolean(errors.description);
657
- const t73 = showErrors && Boolean(errors.description) ? errors.description : "Description of the collection, you can use markdown";
658
- let t74;
659
- if ($[106] !== t72 || $[107] !== t73) {
660
- t74 = /* @__PURE__ */ jsx(FieldCaption, { error: t72, children: t73 });
666
+ const t71 = showErrors && Boolean(errors.singularName);
667
+ const t72 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px";
668
+ let t73;
669
+ if ($[105] !== t71 || $[106] !== t72) {
670
+ t73 = /* @__PURE__ */ jsx(FieldCaption, { error: t71, children: t72 });
671
+ $[105] = t71;
661
672
  $[106] = t72;
662
673
  $[107] = t73;
663
- $[108] = t74;
664
674
  } else {
665
- t74 = $[108];
675
+ t73 = $[107];
666
676
  }
667
- let t75;
668
- if ($[109] !== t71 || $[110] !== t74) {
669
- t75 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
670
- t71,
671
- t74
677
+ let t74;
678
+ if ($[108] !== t70 || $[109] !== t73) {
679
+ t74 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
680
+ t70,
681
+ t73
672
682
  ] });
673
- $[109] = t71;
683
+ $[108] = t70;
684
+ $[109] = t73;
674
685
  $[110] = t74;
675
- $[111] = t75;
676
686
  } else {
677
- t75 = $[111];
687
+ t74 = $[110];
678
688
  }
679
- const t76 = values.defaultSize ?? "";
689
+ const t75 = showErrors && Boolean(errors.description);
690
+ const t76 = values.description ?? "";
680
691
  let t77;
681
- if ($[112] === Symbol.for("react.memo_cache_sentinel")) {
682
- t77 = ["xs", "s", "m", "l", "xl"].map(_temp2$7);
683
- $[112] = t77;
684
- } else {
685
- t77 = $[112];
686
- }
687
- let t78;
688
- if ($[113] !== handleChange || $[114] !== t76) {
689
- t78 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(Select, { name: "defaultSize", size: "large", fullWidth: true, label: "Default row size", position: "item-aligned", onChange: handleChange, value: t76, renderValue: _temp$b, children: t77 }) });
690
- $[113] = handleChange;
691
- $[114] = t76;
692
- $[115] = t78;
692
+ if ($[111] !== handleChange || $[112] !== t75 || $[113] !== t76) {
693
+ t77 = /* @__PURE__ */ jsx(TextField, { error: t75, name: "description", value: t76, onChange: handleChange, multiline: true, minRows: 2, "aria-describedby": "description-helper-text", label: "Description" });
694
+ $[111] = handleChange;
695
+ $[112] = t75;
696
+ $[113] = t76;
697
+ $[114] = t77;
693
698
  } else {
694
- t78 = $[115];
699
+ t77 = $[114];
695
700
  }
696
- const t79 = customIdValue === "code_defined";
701
+ const t78 = showErrors && Boolean(errors.description);
702
+ const t79 = showErrors && Boolean(errors.description) ? errors.description : "Description of the collection, you can use markdown";
697
703
  let t80;
698
- if ($[116] !== setFieldValue) {
699
- t80 = (v) => {
700
- if (v === "code_defined") {
701
- throw new Error("This should not happen");
702
- } else {
703
- if (v === "true") {
704
- setFieldValue("customId", true);
705
- } else {
706
- if (v === "false") {
707
- setFieldValue("customId", false);
708
- } else {
709
- if (v === "optional") {
710
- setFieldValue("customId", "optional");
711
- }
712
- }
713
- }
714
- }
715
- };
716
- $[116] = setFieldValue;
704
+ if ($[115] !== t78 || $[116] !== t79) {
705
+ t80 = /* @__PURE__ */ jsx(FieldCaption, { error: t78, children: t79 });
706
+ $[115] = t78;
707
+ $[116] = t79;
717
708
  $[117] = t80;
718
709
  } else {
719
710
  t80 = $[117];
720
711
  }
721
- const t81 = customIdValue ?? "";
722
- let t82;
712
+ let t81;
713
+ if ($[118] !== t77 || $[119] !== t80) {
714
+ t81 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
715
+ t77,
716
+ t80
717
+ ] });
718
+ $[118] = t77;
719
+ $[119] = t80;
720
+ $[120] = t81;
721
+ } else {
722
+ t81 = $[120];
723
+ }
724
+ const t82 = values.defaultSize ?? "";
723
725
  let t83;
726
+ if ($[121] === Symbol.for("react.memo_cache_sentinel")) {
727
+ t83 = ["xs", "s", "m", "l", "xl"].map(_temp2$7);
728
+ $[121] = t83;
729
+ } else {
730
+ t83 = $[121];
731
+ }
724
732
  let t84;
725
- if ($[118] === Symbol.for("react.memo_cache_sentinel")) {
726
- t82 = /* @__PURE__ */ jsx(SelectItem, { value: "false", children: "Document ID is generated automatically" });
727
- t83 = /* @__PURE__ */ jsx(SelectItem, { value: "true", children: "Users must define an ID" });
728
- t84 = /* @__PURE__ */ jsx(SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
729
- $[118] = t82;
730
- $[119] = t83;
731
- $[120] = t84;
732
- } else {
733
- t82 = $[118];
734
- t83 = $[119];
735
- t84 = $[120];
736
- }
737
- let t85;
738
- if ($[121] !== t79 || $[122] !== t80 || $[123] !== t81) {
739
- t85 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxs(Select, { name: "customId", label: "Document IDs generation", position: "item-aligned", size: "large", fullWidth: true, disabled: t79, onValueChange: t80, value: t81, renderValue: _temp3$4, children: [
740
- t82,
741
- t83,
742
- t84
743
- ] }) });
744
- $[121] = t79;
745
- $[122] = t80;
746
- $[123] = t81;
747
- $[124] = t85;
733
+ if ($[122] !== handleChange || $[123] !== t82) {
734
+ t84 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(Select, { name: "defaultSize", size: "large", fullWidth: true, label: "Default row size", position: "item-aligned", onChange: handleChange, value: t82, renderValue: _temp$b, children: t83 }) });
735
+ $[122] = handleChange;
736
+ $[123] = t82;
737
+ $[124] = t84;
748
738
  } else {
749
- t85 = $[124];
739
+ t84 = $[124];
750
740
  }
741
+ const t85 = values.includeJsonView === void 0 || values.includeJsonView ? "Include JSON view" : "Do not include JSON view";
751
742
  let t86;
752
743
  if ($[125] !== setFieldValue) {
753
- t86 = (v_0) => setFieldValue("collectionGroup", v_0);
744
+ t86 = (v_0) => setFieldValue("includeJsonView", v_0);
754
745
  $[125] = setFieldValue;
755
746
  $[126] = t86;
756
747
  } else {
757
748
  t86 = $[126];
758
749
  }
759
- const t87 = values.collectionGroup ?? false;
750
+ const t87 = values.includeJsonView === void 0 ? true : values.includeJsonView;
760
751
  let t88;
761
- if ($[127] !== t86 || $[128] !== t87) {
762
- t88 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", label: "Collection group", onValueChange: t86, value: t87 });
763
- $[127] = t86;
764
- $[128] = t87;
765
- $[129] = t88;
752
+ if ($[127] !== t85 || $[128] !== t86 || $[129] !== t87) {
753
+ t88 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: t85, onValueChange: t86, value: t87 });
754
+ $[127] = t85;
755
+ $[128] = t86;
756
+ $[129] = t87;
757
+ $[130] = t88;
766
758
  } else {
767
- t88 = $[129];
759
+ t88 = $[130];
768
760
  }
769
761
  let t89;
770
- if ($[130] === Symbol.for("react.memo_cache_sentinel")) {
771
- t89 = /* @__PURE__ */ jsx(FieldCaption, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." });
772
- $[130] = t89;
762
+ if ($[131] === Symbol.for("react.memo_cache_sentinel")) {
763
+ t89 = /* @__PURE__ */ jsx(FieldCaption, { children: "Include the JSON representation of the document." });
764
+ $[131] = t89;
773
765
  } else {
774
- t89 = $[130];
766
+ t89 = $[131];
775
767
  }
776
768
  let t90;
777
- if ($[131] !== t88) {
769
+ if ($[132] !== t88) {
778
770
  t90 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
779
771
  t88,
780
772
  t89
781
773
  ] });
782
- $[131] = t88;
783
- $[132] = t90;
774
+ $[132] = t88;
775
+ $[133] = t90;
784
776
  } else {
785
- t90 = $[132];
777
+ t90 = $[133];
786
778
  }
787
- let t91;
788
- if ($[133] !== setFieldValue) {
789
- t91 = (v_1) => setFieldValue("textSearchEnabled", v_1);
790
- $[133] = setFieldValue;
791
- $[134] = t91;
779
+ const t91 = customIdValue === "code_defined";
780
+ let t92;
781
+ if ($[134] !== setFieldValue) {
782
+ t92 = (v_1) => {
783
+ if (v_1 === "code_defined") {
784
+ throw new Error("This should not happen");
785
+ }
786
+ setFieldValue("customId", v_1);
787
+ };
788
+ $[134] = setFieldValue;
789
+ $[135] = t92;
792
790
  } else {
793
- t91 = $[134];
791
+ t92 = $[135];
794
792
  }
795
- const t92 = values.textSearchEnabled ?? false;
796
- let t93;
797
- if ($[135] !== t91 || $[136] !== t92) {
798
- t93 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", label: "Enable text search for this collection", onValueChange: t91, value: t92 });
799
- $[135] = t91;
800
- $[136] = t92;
801
- $[137] = t93;
793
+ const t93 = customIdValue ?? "";
794
+ let t94;
795
+ let t95;
796
+ let t96;
797
+ if ($[136] === Symbol.for("react.memo_cache_sentinel")) {
798
+ t94 = /* @__PURE__ */ jsx(SelectItem, { value: "false", children: "Document ID is generated automatically" });
799
+ t95 = /* @__PURE__ */ jsx(SelectItem, { value: "true", children: "Users must define an ID" });
800
+ t96 = /* @__PURE__ */ jsx(SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
801
+ $[136] = t94;
802
+ $[137] = t95;
803
+ $[138] = t96;
804
+ } else {
805
+ t94 = $[136];
806
+ t95 = $[137];
807
+ t96 = $[138];
808
+ }
809
+ let t97;
810
+ if ($[139] !== t91 || $[140] !== t92 || $[141] !== t93) {
811
+ t97 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxs(Select, { name: "customId", label: "Document IDs generation", position: "item-aligned", size: "large", fullWidth: true, disabled: t91, onValueChange: t92, value: t93, renderValue: _temp3$4, children: [
812
+ t94,
813
+ t95,
814
+ t96
815
+ ] }) });
816
+ $[139] = t91;
817
+ $[140] = t92;
818
+ $[141] = t93;
819
+ $[142] = t97;
802
820
  } else {
803
- t93 = $[137];
821
+ t97 = $[142];
804
822
  }
805
- let t94;
806
- if ($[138] === Symbol.for("react.memo_cache_sentinel")) {
807
- t94 = /* @__PURE__ */ jsx(FieldCaption, { children: "Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues." });
808
- $[138] = t94;
823
+ let t98;
824
+ if ($[143] !== setFieldValue) {
825
+ t98 = (v_2) => setFieldValue("collectionGroup", v_2);
826
+ $[143] = setFieldValue;
827
+ $[144] = t98;
809
828
  } else {
810
- t94 = $[138];
829
+ t98 = $[144];
811
830
  }
812
- let t95;
813
- if ($[139] !== t93) {
814
- t95 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
815
- t93,
816
- t94
817
- ] });
818
- $[139] = t93;
819
- $[140] = t95;
831
+ const t99 = values.collectionGroup ?? false;
832
+ let t100;
833
+ if ($[145] !== t98 || $[146] !== t99) {
834
+ t100 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Collection group", onValueChange: t98, value: t99 });
835
+ $[145] = t98;
836
+ $[146] = t99;
837
+ $[147] = t100;
820
838
  } else {
821
- t95 = $[140];
839
+ t100 = $[147];
822
840
  }
823
- let t96;
824
- if ($[141] !== t48 || $[142] !== t56 || $[143] !== t68 || $[144] !== t75 || $[145] !== t78 || $[146] !== t85 || $[147] !== t90 || $[148] !== t95) {
825
- t96 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
826
- t48,
827
- t56,
828
- t68,
829
- t75,
830
- t78,
831
- t85,
832
- t90,
833
- t95
834
- ] });
835
- $[141] = t48;
836
- $[142] = t56;
837
- $[143] = t68;
838
- $[144] = t75;
839
- $[145] = t78;
840
- $[146] = t85;
841
- $[147] = t90;
842
- $[148] = t95;
843
- $[149] = t96;
844
- } else {
845
- t96 = $[149];
841
+ let t101;
842
+ if ($[148] === Symbol.for("react.memo_cache_sentinel")) {
843
+ t101 = /* @__PURE__ */ jsx(FieldCaption, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." });
844
+ $[148] = t101;
845
+ } else {
846
+ t101 = $[148];
846
847
  }
847
- let t97;
848
- if ($[150] !== advancedPanelExpanded || $[151] !== t96) {
849
- t97 = /* @__PURE__ */ jsx(ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t41, initiallyExpanded: false, children: t96 });
850
- $[150] = advancedPanelExpanded;
851
- $[151] = t96;
852
- $[152] = t97;
848
+ let t102;
849
+ if ($[149] !== t100) {
850
+ t102 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-4", children: [
851
+ t100,
852
+ t101
853
+ ] });
854
+ $[149] = t100;
855
+ $[150] = t102;
853
856
  } else {
854
- t97 = $[152];
857
+ t102 = $[150];
855
858
  }
856
- let t98;
857
- if ($[153] !== children || $[154] !== t97) {
858
- t98 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-8", children: [
859
+ let t103;
860
+ if ($[151] !== setFieldValue) {
861
+ t103 = (v_3) => setFieldValue("textSearchEnabled", v_3);
862
+ $[151] = setFieldValue;
863
+ $[152] = t103;
864
+ } else {
865
+ t103 = $[152];
866
+ }
867
+ const t104 = values.textSearchEnabled ?? false;
868
+ let t105;
869
+ if ($[153] !== t103 || $[154] !== t104) {
870
+ t105 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Enable text search for this collection", onValueChange: t103, value: t104 });
871
+ $[153] = t103;
872
+ $[154] = t104;
873
+ $[155] = t105;
874
+ } else {
875
+ t105 = $[155];
876
+ }
877
+ let t106;
878
+ if ($[156] === Symbol.for("react.memo_cache_sentinel")) {
879
+ t106 = /* @__PURE__ */ jsx(FieldCaption, { children: "Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues." });
880
+ $[156] = t106;
881
+ } else {
882
+ t106 = $[156];
883
+ }
884
+ let t107;
885
+ if ($[157] !== t105) {
886
+ t107 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
887
+ t105,
888
+ t106
889
+ ] });
890
+ $[157] = t105;
891
+ $[158] = t107;
892
+ } else {
893
+ t107 = $[158];
894
+ }
895
+ let t108;
896
+ if ($[159] !== t102 || $[160] !== t107 || $[161] !== t54 || $[162] !== t62 || $[163] !== t74 || $[164] !== t81 || $[165] !== t84 || $[166] !== t90 || $[167] !== t97) {
897
+ t108 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
898
+ t54,
899
+ t62,
900
+ t74,
901
+ t81,
902
+ t84,
903
+ t90,
859
904
  t97,
905
+ t102,
906
+ t107
907
+ ] });
908
+ $[159] = t102;
909
+ $[160] = t107;
910
+ $[161] = t54;
911
+ $[162] = t62;
912
+ $[163] = t74;
913
+ $[164] = t81;
914
+ $[165] = t84;
915
+ $[166] = t90;
916
+ $[167] = t97;
917
+ $[168] = t108;
918
+ } else {
919
+ t108 = $[168];
920
+ }
921
+ let t109;
922
+ if ($[169] !== advancedPanelExpanded || $[170] !== t108) {
923
+ t109 = /* @__PURE__ */ jsx(ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t47, initiallyExpanded: false, children: t108 });
924
+ $[169] = advancedPanelExpanded;
925
+ $[170] = t108;
926
+ $[171] = t109;
927
+ } else {
928
+ t109 = $[171];
929
+ }
930
+ let t110;
931
+ if ($[172] !== children || $[173] !== t109) {
932
+ t110 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-8", children: [
933
+ t109,
860
934
  children
861
935
  ] });
862
- $[153] = children;
863
- $[154] = t97;
864
- $[155] = t98;
936
+ $[172] = children;
937
+ $[173] = t109;
938
+ $[174] = t110;
865
939
  } else {
866
- t98 = $[155];
940
+ t110 = $[174];
867
941
  }
868
- let t99;
869
- if ($[156] !== t27 || $[157] !== t36 || $[158] !== t37 || $[159] !== t40 || $[160] !== t98) {
870
- t99 = /* @__PURE__ */ jsxs("div", { className: t19, children: [
942
+ let t111;
943
+ if ($[175] !== t110 || $[176] !== t27 || $[177] !== t36 || $[178] !== t37 || $[179] !== t40 || $[180] !== t46) {
944
+ t111 = /* @__PURE__ */ jsxs("div", { className: t19, children: [
871
945
  t27,
872
946
  t36,
873
947
  t37,
874
948
  t40,
875
- t98
949
+ t46,
950
+ t110
876
951
  ] });
877
- $[156] = t27;
878
- $[157] = t36;
879
- $[158] = t37;
880
- $[159] = t40;
881
- $[160] = t98;
882
- $[161] = t99;
883
- } else {
884
- t99 = $[161];
885
- }
886
- let t100;
887
- if ($[162] === Symbol.for("react.memo_cache_sentinel")) {
888
- t100 = /* @__PURE__ */ jsx("div", { style: {
952
+ $[175] = t110;
953
+ $[176] = t27;
954
+ $[177] = t36;
955
+ $[178] = t37;
956
+ $[179] = t40;
957
+ $[180] = t46;
958
+ $[181] = t111;
959
+ } else {
960
+ t111 = $[181];
961
+ }
962
+ let t112;
963
+ if ($[182] === Symbol.for("react.memo_cache_sentinel")) {
964
+ t112 = /* @__PURE__ */ jsx("div", { style: {
889
965
  height: "52px"
890
966
  } });
891
- $[162] = t100;
967
+ $[182] = t112;
892
968
  } else {
893
- t100 = $[162];
969
+ t112 = $[182];
894
970
  }
895
- let t101;
896
- if ($[163] !== setFieldValue) {
897
- t101 = (icon) => {
971
+ let t113;
972
+ if ($[183] !== setFieldValue) {
973
+ t113 = (icon) => {
898
974
  setIconDialogOpen(false);
899
975
  setFieldValue("icon", icon);
900
976
  };
901
- $[163] = setFieldValue;
902
- $[164] = t101;
977
+ $[183] = setFieldValue;
978
+ $[184] = t113;
903
979
  } else {
904
- t101 = $[164];
980
+ t113 = $[184];
905
981
  }
906
- let t102;
907
- if ($[165] !== t101 || $[166] !== values.icon) {
908
- t102 = /* @__PURE__ */ jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsx(SearchIconsView, { selectedIcon: values.icon, onIconSelected: t101 }) });
909
- $[165] = t101;
910
- $[166] = values.icon;
911
- $[167] = t102;
982
+ let t114;
983
+ if ($[185] !== t113 || $[186] !== values.icon) {
984
+ t114 = /* @__PURE__ */ jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsx(SearchIconsView, { selectedIcon: values.icon, onIconSelected: t113 }) });
985
+ $[185] = t113;
986
+ $[186] = values.icon;
987
+ $[187] = t114;
912
988
  } else {
913
- t102 = $[167];
989
+ t114 = $[187];
914
990
  }
915
- let t103;
916
- if ($[168] !== iconDialogOpen || $[169] !== t102) {
917
- t103 = /* @__PURE__ */ jsx(Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t102 });
918
- $[168] = iconDialogOpen;
919
- $[169] = t102;
920
- $[170] = t103;
991
+ let t115;
992
+ if ($[188] !== iconDialogOpen || $[189] !== t114) {
993
+ t115 = /* @__PURE__ */ jsx(Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t114 });
994
+ $[188] = iconDialogOpen;
995
+ $[189] = t114;
996
+ $[190] = t115;
921
997
  } else {
922
- t103 = $[170];
998
+ t115 = $[190];
923
999
  }
924
- let t104;
925
- if ($[171] !== T0 || $[172] !== t103 || $[173] !== t18 || $[174] !== t99) {
926
- t104 = /* @__PURE__ */ jsx("div", { className: t7, children: /* @__PURE__ */ jsxs(T0, { maxWidth: t8, className: t9, children: [
1000
+ let t116;
1001
+ if ($[191] !== T0 || $[192] !== t111 || $[193] !== t115 || $[194] !== t18) {
1002
+ t116 = /* @__PURE__ */ jsx("div", { className: t7, children: /* @__PURE__ */ jsxs(T0, { maxWidth: t8, className: t9, children: [
927
1003
  t18,
928
- t99,
929
- t100,
930
- t103
1004
+ t111,
1005
+ t112,
1006
+ t115
931
1007
  ] }) });
932
- $[171] = T0;
933
- $[172] = t103;
934
- $[173] = t18;
935
- $[174] = t99;
936
- $[175] = t104;
1008
+ $[191] = T0;
1009
+ $[192] = t111;
1010
+ $[193] = t115;
1011
+ $[194] = t18;
1012
+ $[195] = t116;
937
1013
  } else {
938
- t104 = $[175];
1014
+ t116 = $[195];
939
1015
  }
940
- return t104;
1016
+ return t116;
941
1017
  }
942
1018
  function _temp3$4(value_3) {
943
1019
  if (value_3 === "code_defined") {
@@ -1251,7 +1327,7 @@ function EnumFormFields(t0) {
1251
1327
  }
1252
1328
  let t10;
1253
1329
  if ($[26] !== buildEntry || $[27] !== disabled || $[28] !== enumValuesPath || $[29] !== t8 || $[30] !== values.enumValues) {
1254
- t10 = /* @__PURE__ */ jsx(ArrayContainer, { droppableId: enumValuesPath, addLabel: "Add enum value", value: values.enumValues, disabled, size: "small", buildEntry, onInternalIdAdded: setLastInternalIdAdded, includeAddButton: true, onValueChange: t8, newDefaultEntry: t9 });
1330
+ t10 = /* @__PURE__ */ jsx(ArrayContainer, { droppableId: enumValuesPath, addLabel: "Add enum value", value: values.enumValues, disabled, size: "small", buildEntry, onInternalIdAdded: setLastInternalIdAdded, canAddElements: true, onValueChange: t8, newDefaultEntry: t9 });
1255
1331
  $[26] = buildEntry;
1256
1332
  $[27] = disabled;
1257
1333
  $[28] = enumValuesPath;
@@ -2698,7 +2774,7 @@ function NonEditablePropertyPreview(t0) {
2698
2774
  return t19;
2699
2775
  }
2700
2776
  const PropertyTree = React__default.memo(function PropertyTree2(t0) {
2701
- const $ = c(26);
2777
+ const $ = c(37);
2702
2778
  const {
2703
2779
  namespace,
2704
2780
  selectedPropertyKey,
@@ -2724,94 +2800,152 @@ const PropertyTree = React__default.memo(function PropertyTree2(t0) {
2724
2800
  }
2725
2801
  const propertiesOrder = t1;
2726
2802
  let t2;
2727
- if ($[3] !== namespace || $[4] !== onPropertyMove || $[5] !== propertiesOrder) {
2728
- t2 = (result) => {
2729
- if (!result.destination) {
2730
- return;
2731
- }
2732
- const startIndex = result.source.index;
2733
- const endIndex = result.destination.index;
2734
- const newPropertiesOrder = Array.from(propertiesOrder);
2735
- const [removed] = newPropertiesOrder.splice(startIndex, 1);
2736
- newPropertiesOrder.splice(endIndex, 0, removed);
2737
- if (onPropertyMove) {
2738
- onPropertyMove(newPropertiesOrder, namespace);
2803
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
2804
+ t2 = {
2805
+ activationConstraint: {
2806
+ distance: 5
2739
2807
  }
2740
2808
  };
2741
- $[3] = namespace;
2742
- $[4] = onPropertyMove;
2743
- $[5] = propertiesOrder;
2744
- $[6] = t2;
2809
+ $[3] = t2;
2745
2810
  } else {
2746
- t2 = $[6];
2811
+ t2 = $[3];
2812
+ }
2813
+ let t3;
2814
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
2815
+ t3 = {
2816
+ coordinateGetter: sortableKeyboardCoordinates
2817
+ };
2818
+ $[4] = t3;
2819
+ } else {
2820
+ t3 = $[4];
2747
2821
  }
2748
- const onDragEnd = t2;
2749
- const t3 = `droppable_${namespace}`;
2822
+ const sensors = useSensors(useSensor(PointerSensor, t2), useSensor(KeyboardSensor, t3));
2750
2823
  let t4;
2751
- if ($[7] !== additionalFields || $[8] !== className || $[9] !== collectionEditable || $[10] !== errors || $[11] !== inferredPropertyKeys || $[12] !== namespace || $[13] !== onPropertyClick || $[14] !== onPropertyMove || $[15] !== onPropertyRemove || $[16] !== properties || $[17] !== propertiesOrder || $[18] !== selectedPropertyKey) {
2752
- t4 = (droppableProvided, droppableSnapshot) => /* @__PURE__ */ jsxs("div", { ...droppableProvided.droppableProps, ref: droppableProvided.innerRef, className, children: [
2753
- propertiesOrder && propertiesOrder.map((propertyKey, index) => {
2754
- const property = properties[propertyKey];
2755
- const additionalField = additionalFields?.find((field) => field.key === propertyKey);
2756
- if (!property && !additionalField) {
2757
- console.warn(`Property ${propertyKey} not found in properties or additionalFields`);
2758
- return null;
2824
+ if ($[5] !== namespace || $[6] !== onPropertyMove || $[7] !== propertiesOrder) {
2825
+ t4 = (event) => {
2826
+ const {
2827
+ active,
2828
+ over
2829
+ } = event;
2830
+ if (!over || active.id === over.id) {
2831
+ return;
2832
+ }
2833
+ const activeId = String(active.id);
2834
+ const overId = String(over.id);
2835
+ const activeKey = activeId.includes(".") ? activeId.split(".").pop() : activeId;
2836
+ const overKey = overId.includes(".") ? overId.split(".").pop() : overId;
2837
+ if (!activeKey || !overKey) {
2838
+ return;
2839
+ }
2840
+ const oldIndex = propertiesOrder.indexOf(activeKey);
2841
+ const newIndex = propertiesOrder.indexOf(overKey);
2842
+ if (oldIndex !== -1 && newIndex !== -1) {
2843
+ const newPropertiesOrder = [...propertiesOrder];
2844
+ const [removed] = newPropertiesOrder.splice(oldIndex, 1);
2845
+ newPropertiesOrder.splice(newIndex, 0, removed);
2846
+ if (onPropertyMove) {
2847
+ onPropertyMove(newPropertiesOrder, namespace);
2759
2848
  }
2760
- return /* @__PURE__ */ jsx(Draggable, { draggableId: `array_field_${namespace}_${propertyKey}}`, index, children: (provided, snapshot) => /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(PropertyTreeEntry, { propertyKey, propertyOrBuilder: property, additionalField, provided, errors, namespace, inferredPropertyKeys, onPropertyMove, onPropertyRemove, onPropertyClick: snapshot.isDragging ? void 0 : onPropertyClick, selectedPropertyKey, collectionEditable }) }) }, `array_field_${namespace}_${propertyKey}}`);
2761
- }).filter(Boolean),
2762
- droppableProvided.placeholder
2763
- ] });
2764
- $[7] = additionalFields;
2765
- $[8] = className;
2766
- $[9] = collectionEditable;
2767
- $[10] = errors;
2768
- $[11] = inferredPropertyKeys;
2769
- $[12] = namespace;
2770
- $[13] = onPropertyClick;
2771
- $[14] = onPropertyMove;
2772
- $[15] = onPropertyRemove;
2773
- $[16] = properties;
2774
- $[17] = propertiesOrder;
2775
- $[18] = selectedPropertyKey;
2776
- $[19] = t4;
2777
- } else {
2778
- t4 = $[19];
2849
+ }
2850
+ };
2851
+ $[5] = namespace;
2852
+ $[6] = onPropertyMove;
2853
+ $[7] = propertiesOrder;
2854
+ $[8] = t4;
2855
+ } else {
2856
+ t4 = $[8];
2779
2857
  }
2858
+ const handleDragEnd = t4;
2780
2859
  let t5;
2781
- if ($[20] !== t3 || $[21] !== t4) {
2782
- t5 = /* @__PURE__ */ jsx(Droppable, { droppableId: t3, children: t4 });
2783
- $[20] = t3;
2784
- $[21] = t4;
2785
- $[22] = t5;
2860
+ if ($[9] !== namespace || $[10] !== propertiesOrder) {
2861
+ let t62;
2862
+ if ($[12] !== namespace) {
2863
+ t62 = (key) => getFullId(key, namespace);
2864
+ $[12] = namespace;
2865
+ $[13] = t62;
2866
+ } else {
2867
+ t62 = $[13];
2868
+ }
2869
+ t5 = propertiesOrder.map(t62);
2870
+ $[9] = namespace;
2871
+ $[10] = propertiesOrder;
2872
+ $[11] = t5;
2786
2873
  } else {
2787
- t5 = $[22];
2874
+ t5 = $[11];
2788
2875
  }
2876
+ const items = t5;
2789
2877
  let t6;
2790
- if ($[23] !== onDragEnd || $[24] !== t5) {
2791
- t6 = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(DragDropContext, { onDragEnd, children: t5 }) });
2792
- $[23] = onDragEnd;
2793
- $[24] = t5;
2794
- $[25] = t6;
2878
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
2879
+ t6 = [restrictToVerticalAxis];
2880
+ $[14] = t6;
2795
2881
  } else {
2796
- t6 = $[25];
2882
+ t6 = $[14];
2797
2883
  }
2798
- return t6;
2799
- }, (prevProps, nextProps) => {
2800
- const isSelected = nextProps.selectedPropertyKey?.startsWith(nextProps.namespace ?? "");
2801
- const wasSelected = prevProps.selectedPropertyKey?.startsWith(prevProps.namespace ?? "");
2802
- if (isSelected || wasSelected) return false;
2803
- return equal(prevProps.properties, nextProps.properties) && prevProps.propertiesOrder === nextProps.propertiesOrder && equal(prevProps.additionalFields, nextProps.additionalFields) && equal(prevProps.errors, nextProps.errors) && equal(prevProps.onPropertyClick, nextProps.onPropertyClick) && // equal(prevProps.onPropertyMove, nextProps.onPropertyMove) &&
2804
- // equal(prevProps.onPropertyRemove, nextProps.onPropertyRemove) &&
2805
- prevProps.namespace === nextProps.namespace && prevProps.collectionEditable === nextProps.collectionEditable;
2806
- });
2884
+ let t7;
2885
+ if ($[15] !== additionalFields || $[16] !== collectionEditable || $[17] !== errors || $[18] !== inferredPropertyKeys || $[19] !== namespace || $[20] !== onPropertyClick || $[21] !== onPropertyMove || $[22] !== onPropertyRemove || $[23] !== properties || $[24] !== propertiesOrder || $[25] !== selectedPropertyKey) {
2886
+ t7 = propertiesOrder && propertiesOrder.map((propertyKey, index) => {
2887
+ const property = properties[propertyKey];
2888
+ const additionalField = additionalFields?.find((field) => field.key === propertyKey);
2889
+ if (!property && !additionalField) {
2890
+ console.warn(`Property ${propertyKey} not found in properties or additionalFields`);
2891
+ return null;
2892
+ }
2893
+ const id = getFullId(propertyKey, namespace);
2894
+ return /* @__PURE__ */ jsx(PropertyTreeEntry, { id, propertyKey, propertyOrBuilder: property, additionalField, errors, namespace, inferredPropertyKeys, onPropertyMove, onPropertyRemove, onPropertyClick, selectedPropertyKey, collectionEditable }, id);
2895
+ }).filter(Boolean);
2896
+ $[15] = additionalFields;
2897
+ $[16] = collectionEditable;
2898
+ $[17] = errors;
2899
+ $[18] = inferredPropertyKeys;
2900
+ $[19] = namespace;
2901
+ $[20] = onPropertyClick;
2902
+ $[21] = onPropertyMove;
2903
+ $[22] = onPropertyRemove;
2904
+ $[23] = properties;
2905
+ $[24] = propertiesOrder;
2906
+ $[25] = selectedPropertyKey;
2907
+ $[26] = t7;
2908
+ } else {
2909
+ t7 = $[26];
2910
+ }
2911
+ let t8;
2912
+ if ($[27] !== className || $[28] !== t7) {
2913
+ t8 = /* @__PURE__ */ jsx("div", { className, children: t7 });
2914
+ $[27] = className;
2915
+ $[28] = t7;
2916
+ $[29] = t8;
2917
+ } else {
2918
+ t8 = $[29];
2919
+ }
2920
+ let t9;
2921
+ if ($[30] !== items || $[31] !== t8) {
2922
+ t9 = /* @__PURE__ */ jsx(SortableContext, { items, strategy: verticalListSortingStrategy, children: t8 });
2923
+ $[30] = items;
2924
+ $[31] = t8;
2925
+ $[32] = t9;
2926
+ } else {
2927
+ t9 = $[32];
2928
+ }
2929
+ let t10;
2930
+ if ($[33] !== handleDragEnd || $[34] !== sensors || $[35] !== t9) {
2931
+ t10 = /* @__PURE__ */ jsx(DndContext, { sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd, modifiers: t6, children: t9 });
2932
+ $[33] = handleDragEnd;
2933
+ $[34] = sensors;
2934
+ $[35] = t9;
2935
+ $[36] = t10;
2936
+ } else {
2937
+ t10 = $[36];
2938
+ }
2939
+ return t10;
2940
+ }, equal);
2807
2941
  function PropertyTreeEntry(t0) {
2808
- const $ = c(53);
2942
+ const $ = c(62);
2809
2943
  const {
2944
+ id,
2810
2945
  propertyKey,
2811
2946
  namespace,
2812
2947
  propertyOrBuilder,
2813
2948
  additionalField,
2814
- provided,
2815
2949
  selectedPropertyKey,
2816
2950
  errors,
2817
2951
  onPropertyClick,
@@ -2821,157 +2955,201 @@ function PropertyTreeEntry(t0) {
2821
2955
  collectionEditable
2822
2956
  } = t0;
2823
2957
  let t1;
2824
- if ($[0] !== inferredPropertyKeys || $[1] !== namespace || $[2] !== propertyKey) {
2825
- t1 = inferredPropertyKeys?.includes(namespace ? `${namespace}.${propertyKey}` : propertyKey);
2826
- $[0] = inferredPropertyKeys;
2827
- $[1] = namespace;
2828
- $[2] = propertyKey;
2829
- $[3] = t1;
2958
+ if ($[0] !== id) {
2959
+ t1 = {
2960
+ id
2961
+ };
2962
+ $[0] = id;
2963
+ $[1] = t1;
2830
2964
  } else {
2831
- t1 = $[3];
2965
+ t1 = $[1];
2832
2966
  }
2833
- const isPropertyInferred = t1;
2967
+ const {
2968
+ attributes,
2969
+ listeners,
2970
+ setNodeRef,
2971
+ transform,
2972
+ transition,
2973
+ isDragging
2974
+ } = useSortable(t1);
2834
2975
  let t2;
2835
- if ($[4] !== namespace || $[5] !== propertyKey) {
2836
- t2 = getFullId(propertyKey, namespace);
2837
- $[4] = namespace;
2838
- $[5] = propertyKey;
2839
- $[6] = t2;
2976
+ if ($[2] !== transform) {
2977
+ t2 = CSS.Translate.toString(transform);
2978
+ $[2] = transform;
2979
+ $[3] = t2;
2840
2980
  } else {
2841
- t2 = $[6];
2981
+ t2 = $[3];
2982
+ }
2983
+ const t3 = isDragging ? 10 : void 0;
2984
+ let t4;
2985
+ if ($[4] !== t2 || $[5] !== t3 || $[6] !== transition) {
2986
+ t4 = {
2987
+ transform: t2,
2988
+ transition,
2989
+ zIndex: t3,
2990
+ position: "relative"
2991
+ };
2992
+ $[4] = t2;
2993
+ $[5] = t3;
2994
+ $[6] = transition;
2995
+ $[7] = t4;
2996
+ } else {
2997
+ t4 = $[7];
2998
+ }
2999
+ const style = t4;
3000
+ let t5;
3001
+ if ($[8] !== inferredPropertyKeys || $[9] !== namespace || $[10] !== propertyKey) {
3002
+ t5 = inferredPropertyKeys?.includes(namespace ? `${namespace}.${propertyKey}` : propertyKey);
3003
+ $[8] = inferredPropertyKeys;
3004
+ $[9] = namespace;
3005
+ $[10] = propertyKey;
3006
+ $[11] = t5;
3007
+ } else {
3008
+ t5 = $[11];
2842
3009
  }
2843
- const fullId = t2;
3010
+ const isPropertyInferred = t5;
3011
+ const fullId = id;
2844
3012
  const fullIdPath = getFullIdPath(propertyKey, namespace);
2845
3013
  const hasError = fullIdPath in errors;
2846
3014
  let subtree;
2847
3015
  if (typeof propertyOrBuilder === "object") {
2848
3016
  const property = propertyOrBuilder;
2849
3017
  if (property.dataType === "map" && property.properties) {
2850
- let t32;
2851
- if ($[7] !== collectionEditable || $[8] !== errors || $[9] !== fullId || $[10] !== onPropertyClick || $[11] !== onPropertyMove || $[12] !== onPropertyRemove || $[13] !== property.properties || $[14] !== property.propertiesOrder || $[15] !== selectedPropertyKey) {
2852
- t32 = /* @__PURE__ */ jsx(PropertyTree, { selectedPropertyKey, namespace: fullId, properties: property.properties, propertiesOrder: property.propertiesOrder, errors, onPropertyClick, onPropertyMove, onPropertyRemove, collectionEditable });
2853
- $[7] = collectionEditable;
2854
- $[8] = errors;
2855
- $[9] = fullId;
2856
- $[10] = onPropertyClick;
2857
- $[11] = onPropertyMove;
2858
- $[12] = onPropertyRemove;
2859
- $[13] = property.properties;
2860
- $[14] = property.propertiesOrder;
2861
- $[15] = selectedPropertyKey;
2862
- $[16] = t32;
3018
+ let t62;
3019
+ if ($[12] !== collectionEditable || $[13] !== errors || $[14] !== fullId || $[15] !== onPropertyClick || $[16] !== onPropertyMove || $[17] !== onPropertyRemove || $[18] !== property.properties || $[19] !== property.propertiesOrder || $[20] !== selectedPropertyKey) {
3020
+ t62 = /* @__PURE__ */ jsx(PropertyTree, { selectedPropertyKey, namespace: fullId, properties: property.properties, propertiesOrder: property.propertiesOrder, errors, onPropertyClick, onPropertyMove, onPropertyRemove, collectionEditable });
3021
+ $[12] = collectionEditable;
3022
+ $[13] = errors;
3023
+ $[14] = fullId;
3024
+ $[15] = onPropertyClick;
3025
+ $[16] = onPropertyMove;
3026
+ $[17] = onPropertyRemove;
3027
+ $[18] = property.properties;
3028
+ $[19] = property.propertiesOrder;
3029
+ $[20] = selectedPropertyKey;
3030
+ $[21] = t62;
2863
3031
  } else {
2864
- t32 = $[16];
3032
+ t62 = $[21];
2865
3033
  }
2866
- subtree = t32;
3034
+ subtree = t62;
2867
3035
  }
2868
3036
  }
2869
3037
  const selected = selectedPropertyKey === fullId;
2870
- let t3;
2871
- if ($[17] !== collectionEditable || $[18] !== propertyOrBuilder) {
2872
- t3 = propertyOrBuilder && (collectionEditable && !isPropertyBuilder(propertyOrBuilder) || editableProperty(propertyOrBuilder));
2873
- $[17] = collectionEditable;
2874
- $[18] = propertyOrBuilder;
2875
- $[19] = t3;
3038
+ let t6;
3039
+ if ($[22] !== collectionEditable || $[23] !== propertyOrBuilder) {
3040
+ t6 = propertyOrBuilder && (collectionEditable && !isPropertyBuilder(propertyOrBuilder) || editableProperty(propertyOrBuilder));
3041
+ $[22] = collectionEditable;
3042
+ $[23] = propertyOrBuilder;
3043
+ $[24] = t6;
2876
3044
  } else {
2877
- t3 = $[19];
3045
+ t6 = $[24];
2878
3046
  }
2879
- const editable = t3;
2880
- let t4;
2881
- if ($[20] !== subtree) {
2882
- t4 = subtree && /* @__PURE__ */ jsx("div", { className: "absolute border-l " + defaultBorderMixin, style: {
3047
+ const editable = t6;
3048
+ let t7;
3049
+ if ($[25] !== subtree) {
3050
+ t7 = subtree && /* @__PURE__ */ jsx("div", { className: "absolute border-l " + defaultBorderMixin, style: {
2883
3051
  left: "32px",
2884
3052
  top: "64px",
2885
3053
  bottom: "16px"
2886
3054
  } });
2887
- $[20] = subtree;
2888
- $[21] = t4;
3055
+ $[25] = subtree;
3056
+ $[26] = t7;
2889
3057
  } else {
2890
- t4 = $[21];
3058
+ t7 = $[26];
2891
3059
  }
2892
- let t5;
2893
- if ($[22] !== additionalField || $[23] !== editable || $[24] !== hasError || $[25] !== namespace || $[26] !== onPropertyClick || $[27] !== propertyKey || $[28] !== propertyOrBuilder || $[29] !== selected) {
2894
- t5 = !isPropertyBuilder(propertyOrBuilder) && !additionalField && editable ? /* @__PURE__ */ jsx(PropertyFieldPreview, { property: propertyOrBuilder, onClick: onPropertyClick ? () => onPropertyClick(propertyKey, namespace) : void 0, includeName: true, selected, hasError }) : /* @__PURE__ */ jsx(NonEditablePropertyPreview, { name: propertyKey, property: propertyOrBuilder, onClick: onPropertyClick ? () => onPropertyClick(propertyKey, namespace) : void 0, selected });
2895
- $[22] = additionalField;
2896
- $[23] = editable;
2897
- $[24] = hasError;
2898
- $[25] = namespace;
2899
- $[26] = onPropertyClick;
2900
- $[27] = propertyKey;
2901
- $[28] = propertyOrBuilder;
2902
- $[29] = selected;
2903
- $[30] = t5;
2904
- } else {
2905
- t5 = $[30];
3060
+ let t8;
3061
+ if ($[27] !== additionalField || $[28] !== editable || $[29] !== hasError || $[30] !== namespace || $[31] !== onPropertyClick || $[32] !== propertyKey || $[33] !== propertyOrBuilder || $[34] !== selected) {
3062
+ t8 = /* @__PURE__ */ jsx("div", { children: !isPropertyBuilder(propertyOrBuilder) && !additionalField && editable ? /* @__PURE__ */ jsx(PropertyFieldPreview, { property: propertyOrBuilder, onClick: onPropertyClick ? () => onPropertyClick(propertyKey, namespace) : void 0, includeName: true, selected, hasError }) : /* @__PURE__ */ jsx(NonEditablePropertyPreview, { name: propertyKey, property: propertyOrBuilder, onClick: onPropertyClick ? () => onPropertyClick(propertyKey, namespace) : void 0, selected }) });
3063
+ $[27] = additionalField;
3064
+ $[28] = editable;
3065
+ $[29] = hasError;
3066
+ $[30] = namespace;
3067
+ $[31] = onPropertyClick;
3068
+ $[32] = propertyKey;
3069
+ $[33] = propertyOrBuilder;
3070
+ $[34] = selected;
3071
+ $[35] = t8;
3072
+ } else {
3073
+ t8 = $[35];
2906
3074
  }
2907
- let t6;
2908
- if ($[31] !== isPropertyInferred) {
2909
- t6 = isPropertyInferred && /* @__PURE__ */ jsx(Tooltip, { title: "Inferred property", children: /* @__PURE__ */ jsx(AutorenewIcon, { size: "small", className: "p-2" }) });
2910
- $[31] = isPropertyInferred;
2911
- $[32] = t6;
3075
+ let t9;
3076
+ if ($[36] !== isPropertyInferred) {
3077
+ t9 = isPropertyInferred && /* @__PURE__ */ jsx(Tooltip, { title: "Inferred property", children: /* @__PURE__ */ jsx(AutorenewIcon, { size: "small", className: "p-2" }) });
3078
+ $[36] = isPropertyInferred;
3079
+ $[37] = t9;
2912
3080
  } else {
2913
- t6 = $[32];
3081
+ t9 = $[37];
2914
3082
  }
2915
- let t7;
2916
- if ($[33] !== namespace || $[34] !== onPropertyRemove || $[35] !== propertyKey) {
2917
- t7 = onPropertyRemove && /* @__PURE__ */ jsx(Tooltip, { title: "Remove", asChild: true, children: /* @__PURE__ */ jsx(IconButton, { size: "small", color: "inherit", onClick: () => onPropertyRemove(propertyKey, namespace), children: /* @__PURE__ */ jsx(RemoveIcon, { size: "small" }) }) });
2918
- $[33] = namespace;
2919
- $[34] = onPropertyRemove;
2920
- $[35] = propertyKey;
2921
- $[36] = t7;
3083
+ let t10;
3084
+ if ($[38] !== isPropertyInferred || $[39] !== namespace || $[40] !== onPropertyRemove || $[41] !== propertyKey) {
3085
+ t10 = onPropertyRemove && !isPropertyInferred && /* @__PURE__ */ jsx(Tooltip, { title: "Remove", asChild: true, children: /* @__PURE__ */ jsx(IconButton, { size: "small", color: "inherit", onClick: () => onPropertyRemove(propertyKey, namespace), children: /* @__PURE__ */ jsx(RemoveIcon, { size: "small" }) }) });
3086
+ $[38] = isPropertyInferred;
3087
+ $[39] = namespace;
3088
+ $[40] = onPropertyRemove;
3089
+ $[41] = propertyKey;
3090
+ $[42] = t10;
2922
3091
  } else {
2923
- t7 = $[36];
3092
+ t10 = $[42];
2924
3093
  }
2925
- let t8;
2926
- if ($[37] !== onPropertyMove) {
2927
- t8 = onPropertyMove && /* @__PURE__ */ jsx(Tooltip, { title: "Move", asChild: true, children: /* @__PURE__ */ jsx(IconButton, { component: "span", size: "small", children: /* @__PURE__ */ jsx(DragHandleIcon, { size: "small" }) }) });
2928
- $[37] = onPropertyMove;
2929
- $[38] = t8;
3094
+ let t11;
3095
+ if ($[43] !== attributes || $[44] !== listeners || $[45] !== onPropertyMove) {
3096
+ t11 = onPropertyMove && /* @__PURE__ */ jsx(Tooltip, { title: "Move", asChild: true, children: /* @__PURE__ */ jsx(IconButton, { component: "span", size: "small", ...attributes, ...listeners, children: /* @__PURE__ */ jsx(DragHandleIcon, { size: "small" }) }) });
3097
+ $[43] = attributes;
3098
+ $[44] = listeners;
3099
+ $[45] = onPropertyMove;
3100
+ $[46] = t11;
2930
3101
  } else {
2931
- t8 = $[38];
3102
+ t11 = $[46];
2932
3103
  }
2933
- let t9;
2934
- if ($[39] !== t6 || $[40] !== t7 || $[41] !== t8) {
2935
- t9 = /* @__PURE__ */ jsxs("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
2936
- t6,
2937
- t7,
2938
- t8
3104
+ let t12;
3105
+ if ($[47] !== t10 || $[48] !== t11 || $[49] !== t9) {
3106
+ t12 = /* @__PURE__ */ jsxs("div", { className: "absolute top-2 right-2 flex flex-row", children: [
3107
+ t9,
3108
+ t10,
3109
+ t11
2939
3110
  ] });
2940
- $[39] = t6;
2941
- $[40] = t7;
2942
- $[41] = t8;
2943
- $[42] = t9;
3111
+ $[47] = t10;
3112
+ $[48] = t11;
3113
+ $[49] = t9;
3114
+ $[50] = t12;
2944
3115
  } else {
2945
- t9 = $[42];
3116
+ t12 = $[50];
2946
3117
  }
2947
- let t10;
2948
- if ($[43] !== subtree) {
2949
- t10 = subtree && /* @__PURE__ */ jsx("div", { className: "ml-16", children: subtree });
2950
- $[43] = subtree;
2951
- $[44] = t10;
3118
+ let t13;
3119
+ if ($[51] !== subtree) {
3120
+ t13 = subtree && /* @__PURE__ */ jsx("div", { className: "ml-16", children: subtree });
3121
+ $[51] = subtree;
3122
+ $[52] = t13;
2952
3123
  } else {
2953
- t10 = $[44];
3124
+ t13 = $[52];
2954
3125
  }
2955
- let t11;
2956
- if ($[45] !== provided.dragHandleProps || $[46] !== provided.draggableProps || $[47] !== provided.innerRef || $[48] !== t10 || $[49] !== t4 || $[50] !== t5 || $[51] !== t9) {
2957
- t11 = /* @__PURE__ */ jsxs("div", { ref: provided.innerRef, ...provided.draggableProps, ...provided.dragHandleProps, className: "relative -ml-8", children: [
2958
- t4,
2959
- t5,
2960
- t9,
2961
- t10
3126
+ let t14;
3127
+ if ($[53] !== t12 || $[54] !== t13 || $[55] !== t7 || $[56] !== t8) {
3128
+ t14 = /* @__PURE__ */ jsxs("div", { className: "relative", children: [
3129
+ t7,
3130
+ t8,
3131
+ t12,
3132
+ t13
2962
3133
  ] });
2963
- $[45] = provided.dragHandleProps;
2964
- $[46] = provided.draggableProps;
2965
- $[47] = provided.innerRef;
2966
- $[48] = t10;
2967
- $[49] = t4;
2968
- $[50] = t5;
2969
- $[51] = t9;
2970
- $[52] = t11;
3134
+ $[53] = t12;
3135
+ $[54] = t13;
3136
+ $[55] = t7;
3137
+ $[56] = t8;
3138
+ $[57] = t14;
2971
3139
  } else {
2972
- t11 = $[52];
3140
+ t14 = $[57];
2973
3141
  }
2974
- return t11;
3142
+ let t15;
3143
+ if ($[58] !== setNodeRef || $[59] !== style || $[60] !== t14) {
3144
+ t15 = /* @__PURE__ */ jsx("div", { ref: setNodeRef, style, className: "relative -ml-8", children: t14 });
3145
+ $[58] = setNodeRef;
3146
+ $[59] = style;
3147
+ $[60] = t14;
3148
+ $[61] = t15;
3149
+ } else {
3150
+ t15 = $[61];
3151
+ }
3152
+ return t15;
2975
3153
  }
2976
3154
  function MapPropertyField(t0) {
2977
3155
  const $ = c(67);
@@ -3185,7 +3363,7 @@ function MapPropertyField(t0) {
3185
3363
  const t19 = values.spreadChildren ?? false;
3186
3364
  let t20;
3187
3365
  if ($[40] !== t18 || $[41] !== t19) {
3188
- t20 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "small", label: "Spread children as columns", onValueChange: t18, value: t19 });
3366
+ t20 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "medium", label: "Spread children as columns", onValueChange: t18, value: t19 });
3189
3367
  $[40] = t18;
3190
3368
  $[41] = t19;
3191
3369
  $[42] = t20;
@@ -4657,7 +4835,7 @@ function AdvancedPropertyValidation(t0) {
4657
4835
  field,
4658
4836
  form
4659
4837
  } = t22;
4660
- return /* @__PURE__ */ jsx(SwitchControl, { label: "Hide from collection", disabled, form, tooltip: "Hide this field from the collection view. It will still be visible in the form view", field });
4838
+ return /* @__PURE__ */ jsx(SwitchControl, { label: "Hide from collection", size: "medium", disabled, form, tooltip: "Hide this field from the collection view. It will still be visible in the form view", field });
4661
4839
  } }) });
4662
4840
  $[0] = disabled;
4663
4841
  $[1] = t1;
@@ -4671,7 +4849,7 @@ function AdvancedPropertyValidation(t0) {
4671
4849
  field: field_0,
4672
4850
  form: form_0
4673
4851
  } = t32;
4674
- return /* @__PURE__ */ jsx(SwitchControl, { label: "Read only", disabled, tooltip: "Is this a read only field. Display only as a preview", form: form_0, field: field_0 });
4852
+ return /* @__PURE__ */ jsx(SwitchControl, { label: "Read only", size: "medium", disabled, tooltip: "Is this a read only field. Display only as a preview", form: form_0, field: field_0 });
4675
4853
  } }) });
4676
4854
  $[2] = disabled;
4677
4855
  $[3] = t2;
@@ -5804,7 +5982,7 @@ function PropertyEditFormFields(t0) {
5804
5982
  let t6;
5805
5983
  if ($[14] !== errors || $[15] !== onError || $[16] !== propertyNamespace || $[17] !== values?.id) {
5806
5984
  t6 = () => {
5807
- if (values?.id && onError && !isEmptyObject(errors)) {
5985
+ if (values?.id && onError) {
5808
5986
  onError(values?.id, propertyNamespace, errors);
5809
5987
  }
5810
5988
  };
@@ -6603,9 +6781,11 @@ function WidgetSelectViewItem(t0) {
6603
6781
  }
6604
6782
  function camelCase(str) {
6605
6783
  if (!str) return "";
6606
- return (str.slice(0, 1).toLowerCase() + str.slice(1)).replace(/([-_ ]){1,}/g, " ").split(/[-_ ]/).reduce((cur, acc) => {
6607
- return cur + acc[0].toUpperCase() + acc.substring(1);
6608
- }, "");
6784
+ if (str.length === 1) return str.toLowerCase();
6785
+ const parts = str.split(/[-_ ]+/).filter(Boolean);
6786
+ if (parts.length === 0) return "";
6787
+ return parts[0].toLowerCase() + // Transform remaining parts to have first letter uppercase
6788
+ parts.slice(1).map((part) => part.charAt(0).toUpperCase() + part.substring(1).toLowerCase()).join("");
6609
6789
  }
6610
6790
  function GetCodeDialog(t0) {
6611
6791
  const $ = c(22);
@@ -6979,8 +7159,8 @@ function CollectionPropertiesEditorForm({
6979
7159
  setSelectedPropertyKey(propertyKey_2);
6980
7160
  setSelectedPropertyNamespace(namespace_5);
6981
7161
  };
6982
- const body = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-2 h-full bg-surface-50 dark:bg-surface-900", children: [
6983
- /* @__PURE__ */ jsxs("div", { className: cls("p-4 md:p-8 pb-20 md:pb-20", "col-span-12 lg:col-span-5 h-full overflow-auto", !asDialog && "border-r " + defaultBorderMixin), children: [
7162
+ const body = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-2 h-full bg-white dark:bg-surface-950", children: [
7163
+ /* @__PURE__ */ jsxs("div", { className: cls("bg-surface-50 dark:bg-surface-900", "p-4 md:p-8 pb-20 md:pb-20", "col-span-12 lg:col-span-5 h-full overflow-auto", !asDialog && "border-r " + defaultBorderMixin), children: [
6984
7164
  /* @__PURE__ */ jsxs("div", { className: "flex my-2", children: [
6985
7165
  /* @__PURE__ */ jsxs("div", { className: "flex-grow mb-4", children: [
6986
7166
  /* @__PURE__ */ jsx(Field, { name: "name", as: DebouncedTextField, invisible: true, className: "-ml-1", inputClassName: "text-2xl font-headers", placeholder: "Collection name", size: "small", required: true, error: Boolean(errors?.name) }),
@@ -6999,7 +7179,7 @@ function CollectionPropertiesEditorForm({
6999
7179
  /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(PropertyTree, { className: "pl-8", inferredPropertyKeys, selectedPropertyKey: selectedPropertyKey ? getFullId(selectedPropertyKey, selectedPropertyNamespace) : void 0, properties: values.properties, additionalFields: values.additionalFields, propertiesOrder: usedPropertiesOrder, onPropertyClick, onPropertyMove, onPropertyRemove: isNewCollection ? deleteProperty : void 0, collectionEditable, errors }) }),
7000
7180
  /* @__PURE__ */ jsx(Button, { className: "mt-8 w-full", color: "primary", variant: "outlined", size: "large", onClick: () => setNewPropertyDialogOpen(true), startIcon: /* @__PURE__ */ jsx(AddIcon, {}), children: "Add new property" })
7001
7181
  ] }),
7002
- !asDialog && /* @__PURE__ */ jsx("div", { className: "col-span-12 lg:col-span-7 p-4 md:py-8 md:px-4 h-full overflow-auto pb-20 md:pb-20", children: /* @__PURE__ */ jsxs(Paper, { className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ", children: [
7182
+ !asDialog && /* @__PURE__ */ jsx("div", { className: "col-span-12 lg:col-span-7 p-4 md:py-8 md:px-4 h-full overflow-auto pb-20 md:pb-20", children: /* @__PURE__ */ jsxs("div", { className: "sticky top-8 min-h-full w-full flex flex-col justify-center", children: [
7003
7183
  selectedPropertyFullId && selectedProperty && !isPropertyBuilder(selectedProperty) && /* @__PURE__ */ jsx(PropertyForm, { inArray: false, existingProperty: !isNewCollection, autoUpdateId: false, allowDataInference: !isNewCollection, autoOpenTypeSelect: false, propertyKey: selectedPropertyKey, propertyNamespace: selectedPropertyNamespace, property: selectedProperty, onPropertyChanged, onDelete: deleteProperty, onError: onPropertyErrorInternal, forceShowErrors: showErrors, initialErrors, getData, propertyConfigs, collectionEditable }, `edit_view_${selectedPropertyIndex}`),
7004
7184
  !selectedProperty && /* @__PURE__ */ jsxs("div", { className: "w-full flex flex-col items-center justify-center h-full gap-4", children: [
7005
7185
  /* @__PURE__ */ jsx(Typography, { variant: "label", className: "", children: emptyCollection ? "Now you can add your first property" : "Select a property to edit it" }),
@@ -8074,7 +8254,7 @@ const pagesCollectionTemplate = {
8074
8254
  }
8075
8255
  };
8076
8256
  function CollectionEditorWelcomeView(t0) {
8077
- const $ = c(56);
8257
+ const $ = c(52);
8078
8258
  const {
8079
8259
  path,
8080
8260
  pathSuggestions,
@@ -8111,6 +8291,10 @@ function CollectionEditorWelcomeView(t0) {
8111
8291
  setFieldValue,
8112
8292
  setValues
8113
8293
  } = useFormex();
8294
+ const noSuggestions = !loadingPathSuggestions && (filteredPathSuggestions ?? [])?.length === 0;
8295
+ if (!noSuggestions) {
8296
+ return null;
8297
+ }
8114
8298
  let t3;
8115
8299
  if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
8116
8300
  t3 = /* @__PURE__ */ jsx("div", { className: "flex flex-row py-2 pt-3 items-center", children: /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "flex-grow", children: "New collection" }) });
@@ -8162,173 +8346,162 @@ function CollectionEditorWelcomeView(t0) {
8162
8346
  t7 = $[15];
8163
8347
  }
8164
8348
  let t8;
8165
- if ($[16] !== filteredPathSuggestions || $[17] !== loadingPathSuggestions) {
8166
- t8 = !loadingPathSuggestions && (filteredPathSuggestions ?? [])?.length === 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", children: "No suggestions" });
8167
- $[16] = filteredPathSuggestions;
8168
- $[17] = loadingPathSuggestions;
8169
- $[18] = t8;
8170
- } else {
8171
- t8 = $[18];
8172
- }
8173
- let t9;
8174
- if ($[19] !== t6 || $[20] !== t7 || $[21] !== t8) {
8175
- t9 = /* @__PURE__ */ jsxs("div", { className: "my-2", children: [
8349
+ if ($[16] !== t6 || $[17] !== t7) {
8350
+ t8 = /* @__PURE__ */ jsxs("div", { className: "my-2", children: [
8176
8351
  t5,
8177
8352
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
8178
8353
  t6,
8179
- t7,
8180
- t8
8354
+ t7
8181
8355
  ] })
8182
8356
  ] });
8183
- $[19] = t6;
8184
- $[20] = t7;
8185
- $[21] = t8;
8186
- $[22] = t9;
8357
+ $[16] = t6;
8358
+ $[17] = t7;
8359
+ $[18] = t8;
8187
8360
  } else {
8188
- t9 = $[22];
8361
+ t8 = $[18];
8362
+ }
8363
+ let t9;
8364
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
8365
+ t9 = /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "● Select a template:" });
8366
+ $[19] = t9;
8367
+ } else {
8368
+ t9 = $[19];
8189
8369
  }
8190
8370
  let t10;
8191
- if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
8192
- t10 = /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "● Select a template:" });
8193
- $[23] = t10;
8371
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
8372
+ t10 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: productsCollectionTemplate.icon });
8373
+ $[20] = t10;
8194
8374
  } else {
8195
- t10 = $[23];
8375
+ t10 = $[20];
8196
8376
  }
8197
8377
  let t11;
8198
- if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
8199
- t11 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: productsCollectionTemplate.icon });
8200
- $[24] = t11;
8378
+ if ($[21] !== onContinue || $[22] !== setValues) {
8379
+ t11 = /* @__PURE__ */ jsx(TemplateButton, { title: "Products", subtitle: "A collection of products with images, prices and stock", icon: t10, onClick: () => {
8380
+ setValues(productsCollectionTemplate);
8381
+ onContinue();
8382
+ } });
8383
+ $[21] = onContinue;
8384
+ $[22] = setValues;
8385
+ $[23] = t11;
8201
8386
  } else {
8202
- t11 = $[24];
8387
+ t11 = $[23];
8203
8388
  }
8204
8389
  let t12;
8390
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
8391
+ t12 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: usersCollectionTemplate.icon });
8392
+ $[24] = t12;
8393
+ } else {
8394
+ t12 = $[24];
8395
+ }
8396
+ let t13;
8205
8397
  if ($[25] !== onContinue || $[26] !== setValues) {
8206
- t12 = /* @__PURE__ */ jsx(TemplateButton, { title: "Products", subtitle: "A collection of products with images, prices and stock", icon: t11, onClick: () => {
8207
- setValues(productsCollectionTemplate);
8398
+ t13 = /* @__PURE__ */ jsx(TemplateButton, { title: "Users", subtitle: "A collection of users with emails, names and roles", icon: t12, onClick: () => {
8399
+ setValues(usersCollectionTemplate);
8208
8400
  onContinue();
8209
8401
  } });
8210
8402
  $[25] = onContinue;
8211
8403
  $[26] = setValues;
8212
- $[27] = t12;
8404
+ $[27] = t13;
8213
8405
  } else {
8214
- t12 = $[27];
8406
+ t13 = $[27];
8215
8407
  }
8216
- let t13;
8408
+ let t14;
8217
8409
  if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
8218
- t13 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: usersCollectionTemplate.icon });
8219
- $[28] = t13;
8410
+ t14 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: blogCollectionTemplate.icon });
8411
+ $[28] = t14;
8220
8412
  } else {
8221
- t13 = $[28];
8413
+ t14 = $[28];
8222
8414
  }
8223
- let t14;
8415
+ let t15;
8224
8416
  if ($[29] !== onContinue || $[30] !== setValues) {
8225
- t14 = /* @__PURE__ */ jsx(TemplateButton, { title: "Users", subtitle: "A collection of users with emails, names and roles", icon: t13, onClick: () => {
8226
- setValues(usersCollectionTemplate);
8417
+ t15 = /* @__PURE__ */ jsx(TemplateButton, { title: "Blog posts", subtitle: "A collection of blog posts with images, authors and complex content", icon: t14, onClick: () => {
8418
+ setValues(blogCollectionTemplate);
8227
8419
  onContinue();
8228
8420
  } });
8229
8421
  $[29] = onContinue;
8230
8422
  $[30] = setValues;
8231
- $[31] = t14;
8423
+ $[31] = t15;
8232
8424
  } else {
8233
- t14 = $[31];
8425
+ t15 = $[31];
8234
8426
  }
8235
- let t15;
8427
+ let t16;
8236
8428
  if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
8237
- t15 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: blogCollectionTemplate.icon });
8238
- $[32] = t15;
8429
+ t16 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: pagesCollectionTemplate.icon });
8430
+ $[32] = t16;
8239
8431
  } else {
8240
- t15 = $[32];
8432
+ t16 = $[32];
8241
8433
  }
8242
- let t16;
8434
+ let t17;
8243
8435
  if ($[33] !== onContinue || $[34] !== setValues) {
8244
- t16 = /* @__PURE__ */ jsx(TemplateButton, { title: "Blog posts", subtitle: "A collection of blog posts with images, authors and complex content", icon: t15, onClick: () => {
8245
- setValues(blogCollectionTemplate);
8436
+ t17 = /* @__PURE__ */ jsx(TemplateButton, { title: "Pages", subtitle: "A collection of pages with images, authors and complex content", icon: t16, onClick: () => {
8437
+ setValues(pagesCollectionTemplate);
8246
8438
  onContinue();
8247
8439
  } });
8248
8440
  $[33] = onContinue;
8249
8441
  $[34] = setValues;
8250
- $[35] = t16;
8251
- } else {
8252
- t16 = $[35];
8253
- }
8254
- let t17;
8255
- if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
8256
- t17 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: pagesCollectionTemplate.icon });
8257
- $[36] = t17;
8442
+ $[35] = t17;
8258
8443
  } else {
8259
- t17 = $[36];
8444
+ t17 = $[35];
8260
8445
  }
8261
8446
  let t18;
8262
- if ($[37] !== onContinue || $[38] !== setValues) {
8263
- t18 = /* @__PURE__ */ jsx(TemplateButton, { title: "Pages", subtitle: "A collection of pages with images, authors and complex content", icon: t17, onClick: () => {
8264
- setValues(pagesCollectionTemplate);
8265
- onContinue();
8266
- } });
8267
- $[37] = onContinue;
8268
- $[38] = setValues;
8269
- $[39] = t18;
8270
- } else {
8271
- t18 = $[39];
8272
- }
8273
- let t19;
8274
- if ($[40] !== t12 || $[41] !== t14 || $[42] !== t16 || $[43] !== t18) {
8275
- t19 = /* @__PURE__ */ jsxs("div", { className: "my-2", children: [
8276
- t10,
8447
+ if ($[36] !== t11 || $[37] !== t13 || $[38] !== t15 || $[39] !== t17) {
8448
+ t18 = /* @__PURE__ */ jsxs("div", { className: "my-2", children: [
8449
+ t9,
8277
8450
  /* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
8278
- t12,
8279
- t14,
8280
- t16,
8281
- t18
8451
+ t11,
8452
+ t13,
8453
+ t15,
8454
+ t17
8282
8455
  ] })
8283
8456
  ] });
8284
- $[40] = t12;
8285
- $[41] = t14;
8286
- $[42] = t16;
8287
- $[43] = t18;
8288
- $[44] = t19;
8457
+ $[36] = t11;
8458
+ $[37] = t13;
8459
+ $[38] = t15;
8460
+ $[39] = t17;
8461
+ $[40] = t18;
8289
8462
  } else {
8290
- t19 = $[44];
8463
+ t18 = $[40];
8291
8464
  }
8292
- let t20;
8293
- if ($[45] !== onContinue || $[46] !== parentCollection) {
8294
- t20 = !parentCollection && /* @__PURE__ */ jsxs("div", { children: [
8465
+ let t19;
8466
+ if ($[41] !== onContinue || $[42] !== parentCollection) {
8467
+ t19 = !parentCollection && /* @__PURE__ */ jsxs("div", { children: [
8295
8468
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "mb-2", children: "● Create a collection from a file (csv, json, xls, xslx...)" }),
8296
8469
  /* @__PURE__ */ jsx(ImportFileUpload, { onDataAdded: (data, propertiesOrder) => onContinue(data, propertiesOrder) })
8297
8470
  ] });
8298
- $[45] = onContinue;
8299
- $[46] = parentCollection;
8300
- $[47] = t20;
8471
+ $[41] = onContinue;
8472
+ $[42] = parentCollection;
8473
+ $[43] = t19;
8301
8474
  } else {
8302
- t20 = $[47];
8475
+ t19 = $[43];
8303
8476
  }
8304
- let t21;
8305
- if ($[48] !== onContinue) {
8306
- t21 = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, { variant: "text", onClick: () => onContinue(), className: "my-2", children: "Continue from scratch" }) });
8307
- $[48] = onContinue;
8308
- $[49] = t21;
8477
+ let t20;
8478
+ if ($[44] !== onContinue) {
8479
+ t20 = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, { variant: "text", onClick: () => onContinue(), className: "my-2", children: "Continue from scratch" }) });
8480
+ $[44] = onContinue;
8481
+ $[45] = t20;
8309
8482
  } else {
8310
- t21 = $[49];
8483
+ t20 = $[45];
8311
8484
  }
8312
- let t22;
8313
- if ($[50] !== t19 || $[51] !== t20 || $[52] !== t21 || $[53] !== t4 || $[54] !== t9) {
8314
- t22 = /* @__PURE__ */ jsx("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ jsxs(Container, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
8485
+ let t21;
8486
+ if ($[46] !== t18 || $[47] !== t19 || $[48] !== t20 || $[49] !== t4 || $[50] !== t8) {
8487
+ t21 = /* @__PURE__ */ jsx("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ jsxs(Container, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
8315
8488
  t3,
8316
8489
  t4,
8317
- t9,
8490
+ t8,
8491
+ t18,
8318
8492
  t19,
8319
- t20,
8320
- t21
8493
+ t20
8321
8494
  ] }) });
8322
- $[50] = t19;
8323
- $[51] = t20;
8324
- $[52] = t21;
8325
- $[53] = t4;
8326
- $[54] = t9;
8327
- $[55] = t22;
8495
+ $[46] = t18;
8496
+ $[47] = t19;
8497
+ $[48] = t20;
8498
+ $[49] = t4;
8499
+ $[50] = t8;
8500
+ $[51] = t21;
8328
8501
  } else {
8329
- t22 = $[55];
8502
+ t21 = $[51];
8330
8503
  }
8331
- return t22;
8504
+ return t21;
8332
8505
  }
8333
8506
  function TemplateButton(t0) {
8334
8507
  const $ = c(10);
@@ -8782,102 +8955,104 @@ function PropertySelectItem(t0) {
8782
8955
  return t9;
8783
8956
  }
8784
8957
  function CollectionEditorImportDataPreview(t0) {
8785
- const $ = c(18);
8958
+ const $ = c(19);
8786
8959
  const {
8787
8960
  importConfig,
8788
8961
  properties,
8789
8962
  propertiesOrder
8790
8963
  } = t0;
8964
+ const authController = useAuthController();
8791
8965
  const [loading, setLoading] = useState(false);
8792
8966
  let t1;
8793
- if ($[0] !== importConfig || $[1] !== properties) {
8967
+ if ($[0] !== authController || $[1] !== importConfig || $[2] !== properties) {
8794
8968
  t1 = async function loadEntities2() {
8795
- const mappedData = importConfig.importData.map((d) => convertDataToEntity(d, importConfig.idColumn, importConfig.headersMapping, properties, "TEMP_PATH", importConfig.defaultValues));
8969
+ const mappedData = importConfig.importData.map((d) => convertDataToEntity(authController, d, importConfig.idColumn, importConfig.headersMapping, properties, "TEMP_PATH", importConfig.defaultValues));
8796
8970
  importConfig.setEntities(mappedData);
8797
8971
  };
8798
- $[0] = importConfig;
8799
- $[1] = properties;
8800
- $[2] = t1;
8972
+ $[0] = authController;
8973
+ $[1] = importConfig;
8974
+ $[2] = properties;
8975
+ $[3] = t1;
8801
8976
  } else {
8802
- t1 = $[2];
8977
+ t1 = $[3];
8803
8978
  }
8804
8979
  const loadEntities = t1;
8805
8980
  let t2;
8806
- if ($[3] !== loadEntities) {
8981
+ if ($[4] !== loadEntities) {
8807
8982
  t2 = () => {
8808
8983
  loadEntities().finally(() => setLoading(false));
8809
8984
  };
8810
- $[3] = loadEntities;
8811
- $[4] = t2;
8985
+ $[4] = loadEntities;
8986
+ $[5] = t2;
8812
8987
  } else {
8813
- t2 = $[4];
8988
+ t2 = $[5];
8814
8989
  }
8815
8990
  let t3;
8816
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
8991
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
8817
8992
  t3 = [];
8818
- $[5] = t3;
8993
+ $[6] = t3;
8819
8994
  } else {
8820
- t3 = $[5];
8995
+ t3 = $[6];
8821
8996
  }
8822
8997
  useEffect(t2, t3);
8823
8998
  const selectionController = useSelectionController();
8824
8999
  if (loading) {
8825
9000
  let t42;
8826
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
9001
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
8827
9002
  t42 = /* @__PURE__ */ jsx(CircularProgressCenter, {});
8828
- $[6] = t42;
9003
+ $[7] = t42;
8829
9004
  } else {
8830
- t42 = $[6];
9005
+ t42 = $[7];
8831
9006
  }
8832
9007
  return t42;
8833
9008
  }
8834
9009
  let t4;
8835
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
9010
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
8836
9011
  t4 = /* @__PURE__ */ jsxs("div", { children: [
8837
9012
  /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Imported data preview" }),
8838
9013
  /* @__PURE__ */ jsx(Typography, { variant: "caption", children: "Entities with the same id will be overwritten" })
8839
9014
  ] });
8840
- $[7] = t4;
9015
+ $[8] = t4;
8841
9016
  } else {
8842
- t4 = $[7];
9017
+ t4 = $[8];
8843
9018
  }
8844
9019
  let t5;
8845
- if ($[8] !== importConfig.entities) {
9020
+ if ($[9] !== importConfig.entities) {
8846
9021
  t5 = {
8847
9022
  data: importConfig.entities,
8848
9023
  dataLoading: false,
8849
9024
  noMoreToLoad: false
8850
9025
  };
8851
- $[8] = importConfig.entities;
8852
- $[9] = t5;
9026
+ $[9] = importConfig.entities;
9027
+ $[10] = t5;
8853
9028
  } else {
8854
- t5 = $[9];
9029
+ t5 = $[10];
8855
9030
  }
8856
9031
  let t6;
8857
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
9032
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
8858
9033
  t6 = /* @__PURE__ */ jsx("div", { className: "h-12" });
8859
- $[10] = t6;
9034
+ $[11] = t6;
8860
9035
  } else {
8861
- t6 = $[10];
9036
+ t6 = $[11];
8862
9037
  }
8863
9038
  let t7;
8864
- if ($[11] !== propertiesOrder) {
9039
+ if ($[12] !== propertiesOrder) {
8865
9040
  t7 = propertiesOrder.map(_temp$1);
8866
- $[11] = propertiesOrder;
8867
- $[12] = t7;
9041
+ $[12] = propertiesOrder;
9042
+ $[13] = t7;
8868
9043
  } else {
8869
- t7 = $[12];
9044
+ t7 = $[13];
8870
9045
  }
8871
9046
  let t8;
8872
- if ($[13] !== properties || $[14] !== selectionController || $[15] !== t5 || $[16] !== t7) {
9047
+ if ($[14] !== properties || $[15] !== selectionController || $[16] !== t5 || $[17] !== t7) {
8873
9048
  t8 = /* @__PURE__ */ jsx(EntityCollectionTable, { title: t4, tableController: t5, endAdornment: t6, filterable: false, sortable: false, selectionController, displayedColumnIds: t7, openEntityMode: "side_panel", properties, enablePopupIcon: false });
8874
- $[13] = properties;
8875
- $[14] = selectionController;
8876
- $[15] = t5;
8877
- $[16] = t7;
8878
- $[17] = t8;
9049
+ $[14] = properties;
9050
+ $[15] = selectionController;
9051
+ $[16] = t5;
9052
+ $[17] = t7;
9053
+ $[18] = t8;
8879
9054
  } else {
8880
- t8 = $[17];
9055
+ t8 = $[18];
8881
9056
  }
8882
9057
  return t8;
8883
9058
  }
@@ -9420,7 +9595,7 @@ function CollectionEditorInternal({
9420
9595
  } }),
9421
9596
  currentView === "details" && /* @__PURE__ */ jsx(CollectionDetailsForm, { existingPaths, existingIds, groups, parentCollectionIds, parentCollection, isNewCollection, children: !isNewCollection && isMergedCollection && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 mt-8", children: [
9422
9597
  /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "secondary", children: "This collection is defined in code. The changes done in this editor will override the properties defined in code. You can delete the overridden values to revert to the state defined in code." }),
9423
- /* @__PURE__ */ jsx(Button, { variant: "neutral", onClick: () => {
9598
+ /* @__PURE__ */ jsx(Button, { color: "neutral", onClick: () => {
9424
9599
  setDeleteRequested(true);
9425
9600
  }, children: "Reset to code" })
9426
9601
  ] }) }),
@@ -9540,7 +9715,7 @@ const validateId = (value, isNewCollection, existingPaths, existingIds) => {
9540
9715
  const ConfigControllerContext = React__default.createContext({});
9541
9716
  const CollectionEditorContext = React__default.createContext({});
9542
9717
  const ConfigControllerProvider = React__default.memo(function ConfigControllerProvider2(t0) {
9543
- const $ = c(67);
9718
+ const $ = c(65);
9544
9719
  const {
9545
9720
  children,
9546
9721
  collectionConfigController,
@@ -9548,7 +9723,6 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
9548
9723
  reservedGroups,
9549
9724
  collectionInference,
9550
9725
  extraView,
9551
- getPathSuggestions,
9552
9726
  getUser,
9553
9727
  getData,
9554
9728
  onAnalyticsEvent
@@ -9669,26 +9843,24 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
9669
9843
  const createCollection = t3;
9670
9844
  const t4 = configPermissions ?? defaultConfigPermissions;
9671
9845
  let t5;
9672
- if ($[6] !== createCollection || $[7] !== editCollection || $[8] !== editProperty || $[9] !== getPathSuggestions || $[10] !== t4) {
9846
+ if ($[6] !== createCollection || $[7] !== editCollection || $[8] !== editProperty || $[9] !== t4) {
9673
9847
  t5 = {
9674
9848
  editCollection,
9675
9849
  createCollection,
9676
9850
  editProperty,
9677
- configPermissions: t4,
9678
- getPathSuggestions
9851
+ configPermissions: t4
9679
9852
  };
9680
9853
  $[6] = createCollection;
9681
9854
  $[7] = editCollection;
9682
9855
  $[8] = editProperty;
9683
- $[9] = getPathSuggestions;
9684
- $[10] = t4;
9685
- $[11] = t5;
9856
+ $[9] = t4;
9857
+ $[10] = t5;
9686
9858
  } else {
9687
- t5 = $[11];
9859
+ t5 = $[10];
9688
9860
  }
9689
9861
  const t6 = Boolean(currentDialog);
9690
9862
  let t7;
9691
- if ($[12] !== currentDialog || $[13] !== navigate || $[14] !== navigation) {
9863
+ if ($[11] !== currentDialog || $[12] !== navigate || $[13] !== navigation) {
9692
9864
  t7 = (collection_0) => {
9693
9865
  if (currentDialog?.redirect) {
9694
9866
  if (collection_0 && currentDialog?.isNewCollection && !currentDialog.parentCollectionIds.length) {
@@ -9698,29 +9870,28 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
9698
9870
  }
9699
9871
  setCurrentDialog(void 0);
9700
9872
  };
9701
- $[12] = currentDialog;
9702
- $[13] = navigate;
9703
- $[14] = navigation;
9704
- $[15] = t7;
9873
+ $[11] = currentDialog;
9874
+ $[12] = navigate;
9875
+ $[13] = navigation;
9876
+ $[14] = t7;
9705
9877
  } else {
9706
- t7 = $[15];
9878
+ t7 = $[14];
9707
9879
  }
9708
9880
  let t8;
9709
- if ($[16] !== collectionConfigController || $[17] !== collectionInference || $[18] !== currentDialog || $[19] !== extraView || $[20] !== getData || $[21] !== getPathSuggestions || $[22] !== getUser || $[23] !== reservedGroups || $[24] !== t6 || $[25] !== t7) {
9710
- t8 = /* @__PURE__ */ jsx(CollectionEditorDialog, { open: t6, configController: collectionConfigController, isNewCollection: false, collectionInference, ...currentDialog, getData, reservedGroups, extraView, pathSuggestions: getPathSuggestions, getUser, handleClose: t7 });
9711
- $[16] = collectionConfigController;
9712
- $[17] = collectionInference;
9713
- $[18] = currentDialog;
9714
- $[19] = extraView;
9715
- $[20] = getData;
9716
- $[21] = getPathSuggestions;
9717
- $[22] = getUser;
9718
- $[23] = reservedGroups;
9719
- $[24] = t6;
9720
- $[25] = t7;
9721
- $[26] = t8;
9881
+ if ($[15] !== collectionConfigController || $[16] !== collectionInference || $[17] !== currentDialog || $[18] !== extraView || $[19] !== getData || $[20] !== getUser || $[21] !== reservedGroups || $[22] !== t6 || $[23] !== t7) {
9882
+ t8 = /* @__PURE__ */ jsx(CollectionEditorDialog, { open: t6, configController: collectionConfigController, isNewCollection: false, collectionInference, ...currentDialog, getData, reservedGroups, extraView, getUser, handleClose: t7 });
9883
+ $[15] = collectionConfigController;
9884
+ $[16] = collectionInference;
9885
+ $[17] = currentDialog;
9886
+ $[18] = extraView;
9887
+ $[19] = getData;
9888
+ $[20] = getUser;
9889
+ $[21] = reservedGroups;
9890
+ $[22] = t6;
9891
+ $[23] = t7;
9892
+ $[24] = t8;
9722
9893
  } else {
9723
- t8 = $[26];
9894
+ t8 = $[24];
9724
9895
  }
9725
9896
  const t9 = Boolean(currentPropertyDialog);
9726
9897
  const t10 = Boolean(currentPropertyDialog?.propertyKey);
@@ -9728,21 +9899,21 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
9728
9899
  const t12 = !currentPropertyDialog ? false : !currentPropertyDialog?.propertyKey;
9729
9900
  const t13 = currentPropertyDialog?.collectionEditable ?? false;
9730
9901
  let t14;
9731
- if ($[27] !== currentPropertyDialog || $[28] !== getData || $[29] !== navigation) {
9902
+ if ($[25] !== currentPropertyDialog || $[26] !== getData || $[27] !== navigation) {
9732
9903
  t14 = getData && currentPropertyDialog?.editedCollectionId ? () => {
9733
9904
  console.debug("get data for property", currentPropertyDialog?.editedCollectionId);
9734
9905
  const resolvedPath = navigation.resolveIdsFrom(currentPropertyDialog.editedCollectionId);
9735
9906
  return getData(resolvedPath, []);
9736
9907
  } : void 0;
9737
- $[27] = currentPropertyDialog;
9738
- $[28] = getData;
9739
- $[29] = navigation;
9740
- $[30] = t14;
9908
+ $[25] = currentPropertyDialog;
9909
+ $[26] = getData;
9910
+ $[27] = navigation;
9911
+ $[28] = t14;
9741
9912
  } else {
9742
- t14 = $[30];
9913
+ t14 = $[28];
9743
9914
  }
9744
9915
  let t15;
9745
- if ($[31] !== collectionConfigController || $[32] !== currentPropertyDialog || $[33] !== snackbarController) {
9916
+ if ($[29] !== collectionConfigController || $[30] !== currentPropertyDialog || $[31] !== snackbarController) {
9746
9917
  t15 = (t162) => {
9747
9918
  const {
9748
9919
  id: id_0,
@@ -9771,15 +9942,15 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
9771
9942
  return false;
9772
9943
  });
9773
9944
  };
9774
- $[31] = collectionConfigController;
9775
- $[32] = currentPropertyDialog;
9776
- $[33] = snackbarController;
9777
- $[34] = t15;
9945
+ $[29] = collectionConfigController;
9946
+ $[30] = currentPropertyDialog;
9947
+ $[31] = snackbarController;
9948
+ $[32] = t15;
9778
9949
  } else {
9779
- t15 = $[34];
9950
+ t15 = $[32];
9780
9951
  }
9781
9952
  let t16;
9782
- if ($[35] !== collectionConfigController || $[36] !== currentPropertyDialog?.currentPropertiesOrder || $[37] !== currentPropertyDialog?.editedCollectionId || $[38] !== currentPropertyDialog?.namespace || $[39] !== currentPropertyDialog?.parentCollectionIds || $[40] !== currentPropertyDialog?.propertyKey || $[41] !== snackbarController) {
9953
+ if ($[33] !== collectionConfigController || $[34] !== currentPropertyDialog?.currentPropertiesOrder || $[35] !== currentPropertyDialog?.editedCollectionId || $[36] !== currentPropertyDialog?.namespace || $[37] !== currentPropertyDialog?.parentCollectionIds || $[38] !== currentPropertyDialog?.propertyKey || $[39] !== snackbarController) {
9783
9954
  t16 = () => {
9784
9955
  if (!currentPropertyDialog?.propertyKey) {
9785
9956
  return;
@@ -9802,21 +9973,21 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
9802
9973
  return false;
9803
9974
  });
9804
9975
  };
9805
- $[35] = collectionConfigController;
9806
- $[36] = currentPropertyDialog?.currentPropertiesOrder;
9807
- $[37] = currentPropertyDialog?.editedCollectionId;
9808
- $[38] = currentPropertyDialog?.namespace;
9809
- $[39] = currentPropertyDialog?.parentCollectionIds;
9810
- $[40] = currentPropertyDialog?.propertyKey;
9811
- $[41] = snackbarController;
9812
- $[42] = t16;
9976
+ $[33] = collectionConfigController;
9977
+ $[34] = currentPropertyDialog?.currentPropertiesOrder;
9978
+ $[35] = currentPropertyDialog?.editedCollectionId;
9979
+ $[36] = currentPropertyDialog?.namespace;
9980
+ $[37] = currentPropertyDialog?.parentCollectionIds;
9981
+ $[38] = currentPropertyDialog?.propertyKey;
9982
+ $[39] = snackbarController;
9983
+ $[40] = t16;
9813
9984
  } else {
9814
- t16 = $[42];
9985
+ t16 = $[40];
9815
9986
  }
9816
9987
  let t17;
9817
9988
  let t18;
9818
9989
  let t19;
9819
- if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
9990
+ if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
9820
9991
  t17 = () => {
9821
9992
  setCurrentPropertyDialog(void 0);
9822
9993
  };
@@ -9824,64 +9995,64 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
9824
9995
  setCurrentPropertyDialog(void 0);
9825
9996
  };
9826
9997
  t19 = {};
9827
- $[43] = t17;
9828
- $[44] = t18;
9829
- $[45] = t19;
9998
+ $[41] = t17;
9999
+ $[42] = t18;
10000
+ $[43] = t19;
9830
10001
  } else {
9831
- t17 = $[43];
9832
- t18 = $[44];
9833
- t19 = $[45];
10002
+ t17 = $[41];
10003
+ t18 = $[42];
10004
+ t19 = $[43];
9834
10005
  }
9835
10006
  let t20;
9836
- if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
10007
+ if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
9837
10008
  t20 = [];
9838
- $[46] = t20;
10009
+ $[44] = t20;
9839
10010
  } else {
9840
- t20 = $[46];
10011
+ t20 = $[44];
9841
10012
  }
9842
10013
  const t21 = currentPropertyDialog?.property;
9843
10014
  const t22 = currentPropertyDialog?.propertyKey;
9844
10015
  let t23;
9845
- if ($[47] !== propertyConfigs || $[48] !== t10 || $[49] !== t11 || $[50] !== t12 || $[51] !== t13 || $[52] !== t14 || $[53] !== t15 || $[54] !== t16 || $[55] !== t21 || $[56] !== t22 || $[57] !== t9) {
10016
+ if ($[45] !== propertyConfigs || $[46] !== t10 || $[47] !== t11 || $[48] !== t12 || $[49] !== t13 || $[50] !== t14 || $[51] !== t15 || $[52] !== t16 || $[53] !== t21 || $[54] !== t22 || $[55] !== t9) {
9846
10017
  t23 = /* @__PURE__ */ jsx(PropertyFormDialog, { open: t9, includeIdAndName: true, existingProperty: t10, autoUpdateId: t11, autoOpenTypeSelect: t12, inArray: false, collectionEditable: t13, getData: t14, onPropertyChanged: t15, onPropertyChangedImmediate: false, onDelete: t16, onError: _temp2, onOkClicked: t17, onCancel: t18, initialErrors: t19, forceShowErrors: false, existingPropertyKeys: t20, allowDataInference: true, propertyConfigs, property: t21, propertyKey: t22 });
9847
- $[47] = propertyConfigs;
9848
- $[48] = t10;
9849
- $[49] = t11;
9850
- $[50] = t12;
9851
- $[51] = t13;
9852
- $[52] = t14;
9853
- $[53] = t15;
9854
- $[54] = t16;
9855
- $[55] = t21;
9856
- $[56] = t22;
9857
- $[57] = t9;
9858
- $[58] = t23;
9859
- } else {
9860
- t23 = $[58];
10018
+ $[45] = propertyConfigs;
10019
+ $[46] = t10;
10020
+ $[47] = t11;
10021
+ $[48] = t12;
10022
+ $[49] = t13;
10023
+ $[50] = t14;
10024
+ $[51] = t15;
10025
+ $[52] = t16;
10026
+ $[53] = t21;
10027
+ $[54] = t22;
10028
+ $[55] = t9;
10029
+ $[56] = t23;
10030
+ } else {
10031
+ t23 = $[56];
9861
10032
  }
9862
10033
  let t24;
9863
- if ($[59] !== children || $[60] !== t23 || $[61] !== t5 || $[62] !== t8) {
10034
+ if ($[57] !== children || $[58] !== t23 || $[59] !== t5 || $[60] !== t8) {
9864
10035
  t24 = /* @__PURE__ */ jsxs(CollectionEditorContext.Provider, { value: t5, children: [
9865
10036
  children,
9866
10037
  t8,
9867
10038
  t23
9868
10039
  ] });
9869
- $[59] = children;
9870
- $[60] = t23;
9871
- $[61] = t5;
9872
- $[62] = t8;
9873
- $[63] = t24;
10040
+ $[57] = children;
10041
+ $[58] = t23;
10042
+ $[59] = t5;
10043
+ $[60] = t8;
10044
+ $[61] = t24;
9874
10045
  } else {
9875
- t24 = $[63];
10046
+ t24 = $[61];
9876
10047
  }
9877
10048
  let t25;
9878
- if ($[64] !== collectionConfigController || $[65] !== t24) {
10049
+ if ($[62] !== collectionConfigController || $[63] !== t24) {
9879
10050
  t25 = /* @__PURE__ */ jsx(ConfigControllerContext.Provider, { value: collectionConfigController, children: t24 });
9880
- $[64] = collectionConfigController;
9881
- $[65] = t24;
9882
- $[66] = t25;
10051
+ $[62] = collectionConfigController;
10052
+ $[63] = t24;
10053
+ $[64] = t25;
9883
10054
  } else {
9884
- t25 = $[66];
10055
+ t25 = $[64];
9885
10056
  }
9886
10057
  return t25;
9887
10058
  }, equal);
@@ -10052,7 +10223,7 @@ function HomePageEditorCollectionAction(t0) {
10052
10223
  const deleteCollection = t3;
10053
10224
  let t4;
10054
10225
  if ($[11] !== permissions.deleteCollections) {
10055
- t4 = permissions.deleteCollections && /* @__PURE__ */ jsx(Menu, { trigger: /* @__PURE__ */ jsx(IconButton, { children: /* @__PURE__ */ jsx(MoreVertIcon, { size: "small" }) }), children: /* @__PURE__ */ jsxs(MenuItem, { dense: true, onClick: (event) => {
10226
+ t4 = permissions.deleteCollections && /* @__PURE__ */ jsx(Menu, { trigger: /* @__PURE__ */ jsx(IconButton, { size: "small", children: /* @__PURE__ */ jsx(MoreVertIcon, { size: "small" }) }), children: /* @__PURE__ */ jsxs(MenuItem, { dense: true, onClick: (event) => {
10056
10227
  event.preventDefault();
10057
10228
  event.stopPropagation();
10058
10229
  setDeleteRequested(true);
@@ -10067,7 +10238,7 @@ function HomePageEditorCollectionAction(t0) {
10067
10238
  }
10068
10239
  let t5;
10069
10240
  if ($[13] !== onEditCollectionClicked || $[14] !== permissions.editCollections) {
10070
- t5 = permissions.editCollections && /* @__PURE__ */ jsx(IconButton, { onClick: (event_0) => {
10241
+ t5 = permissions.editCollections && /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: (event_0) => {
10071
10242
  onEditCollectionClicked();
10072
10243
  }, children: /* @__PURE__ */ jsx(SettingsIcon, { size: "small" }) });
10073
10244
  $[13] = onEditCollectionClicked;
@@ -10496,21 +10667,22 @@ function NewCollectionCard(t0) {
10496
10667
  return t8;
10497
10668
  }
10498
10669
  function useCollectionEditorPlugin(t0) {
10499
- const $ = c(15);
10670
+ const $ = c(19);
10500
10671
  const {
10501
10672
  collectionConfigController,
10502
10673
  configPermissions,
10503
10674
  reservedGroups,
10504
10675
  extraView,
10505
- getPathSuggestions,
10506
10676
  getUser,
10507
10677
  collectionInference,
10508
10678
  getData,
10509
- onAnalyticsEvent
10679
+ onAnalyticsEvent,
10680
+ includeIntroView: t1
10510
10681
  } = t0;
10511
- let t1;
10512
- if ($[0] !== collectionConfigController || $[1] !== collectionInference || $[2] !== configPermissions || $[3] !== extraView || $[4] !== getData || $[5] !== getPathSuggestions || $[6] !== getUser || $[7] !== onAnalyticsEvent || $[8] !== reservedGroups) {
10513
- t1 = {
10682
+ const includeIntroView = t1 === void 0 ? true : t1;
10683
+ let t2;
10684
+ if ($[0] !== collectionConfigController || $[1] !== collectionInference || $[2] !== configPermissions || $[3] !== extraView || $[4] !== getData || $[5] !== getUser || $[6] !== onAnalyticsEvent || $[7] !== reservedGroups) {
10685
+ t2 = {
10514
10686
  Component: ConfigControllerProvider,
10515
10687
  props: {
10516
10688
  collectionConfigController,
@@ -10518,7 +10690,6 @@ function useCollectionEditorPlugin(t0) {
10518
10690
  collectionInference,
10519
10691
  reservedGroups,
10520
10692
  extraView,
10521
- getPathSuggestions,
10522
10693
  getUser,
10523
10694
  getData,
10524
10695
  onAnalyticsEvent
@@ -10529,53 +10700,72 @@ function useCollectionEditorPlugin(t0) {
10529
10700
  $[2] = configPermissions;
10530
10701
  $[3] = extraView;
10531
10702
  $[4] = getData;
10532
- $[5] = getPathSuggestions;
10533
- $[6] = getUser;
10534
- $[7] = onAnalyticsEvent;
10535
- $[8] = reservedGroups;
10536
- $[9] = t1;
10703
+ $[5] = getUser;
10704
+ $[6] = onAnalyticsEvent;
10705
+ $[7] = reservedGroups;
10706
+ $[8] = t2;
10537
10707
  } else {
10538
- t1 = $[9];
10708
+ t2 = $[8];
10539
10709
  }
10540
- let t2;
10541
10710
  let t3;
10542
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
10543
- t2 = {
10544
- additionalActions: /* @__PURE__ */ jsx(NewCollectionButton, {}),
10545
- additionalChildrenStart: /* @__PURE__ */ jsx(IntroWidget, {}),
10711
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
10712
+ t3 = /* @__PURE__ */ jsx(NewCollectionButton, {});
10713
+ $[9] = t3;
10714
+ } else {
10715
+ t3 = $[9];
10716
+ }
10717
+ let t4;
10718
+ if ($[10] !== includeIntroView) {
10719
+ t4 = includeIntroView ? /* @__PURE__ */ jsx(IntroWidget, {}) : void 0;
10720
+ $[10] = includeIntroView;
10721
+ $[11] = t4;
10722
+ } else {
10723
+ t4 = $[11];
10724
+ }
10725
+ let t5;
10726
+ if ($[12] !== t4) {
10727
+ t5 = {
10728
+ additionalActions: t3,
10729
+ additionalChildrenStart: t4,
10546
10730
  CollectionActions: HomePageEditorCollectionAction,
10547
10731
  AdditionalCards: NewCollectionCard
10548
10732
  };
10549
- t3 = {
10733
+ $[12] = t4;
10734
+ $[13] = t5;
10735
+ } else {
10736
+ t5 = $[13];
10737
+ }
10738
+ let t6;
10739
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
10740
+ t6 = {
10550
10741
  CollectionActionsStart: EditorCollectionActionStart,
10551
10742
  CollectionActions: EditorCollectionAction,
10552
10743
  HeaderAction: CollectionViewHeaderAction,
10553
10744
  AddColumnComponent: PropertyAddColumnComponent
10554
10745
  };
10555
- $[10] = t2;
10556
- $[11] = t3;
10746
+ $[14] = t6;
10557
10747
  } else {
10558
- t2 = $[10];
10559
- t3 = $[11];
10748
+ t6 = $[14];
10560
10749
  }
10561
- let t4;
10562
- if ($[12] !== collectionConfigController.loading || $[13] !== t1) {
10563
- t4 = {
10750
+ let t7;
10751
+ if ($[15] !== collectionConfigController.loading || $[16] !== t2 || $[17] !== t5) {
10752
+ t7 = {
10564
10753
  key: "collection_editor",
10565
10754
  loading: collectionConfigController.loading,
10566
- provider: t1,
10567
- homePage: t2,
10568
- collectionView: t3
10755
+ provider: t2,
10756
+ homePage: t5,
10757
+ collectionView: t6
10569
10758
  };
10570
- $[12] = collectionConfigController.loading;
10571
- $[13] = t1;
10572
- $[14] = t4;
10759
+ $[15] = collectionConfigController.loading;
10760
+ $[16] = t2;
10761
+ $[17] = t5;
10762
+ $[18] = t7;
10573
10763
  } else {
10574
- t4 = $[14];
10764
+ t7 = $[18];
10575
10765
  }
10576
- return t4;
10766
+ return t7;
10577
10767
  }
10578
- function IntroWidget(t0) {
10768
+ function IntroWidget() {
10579
10769
  const $ = c(11);
10580
10770
  const navigation = useNavigationController();
10581
10771
  if (!navigation.topLevelNavigation) {
@@ -10583,35 +10773,35 @@ function IntroWidget(t0) {
10583
10773
  }
10584
10774
  const authController = useAuthController();
10585
10775
  const collectionEditorController = useCollectionEditorController();
10586
- let t1;
10776
+ let t0;
10587
10777
  if ($[0] !== authController || $[1] !== collectionEditorController) {
10588
- t1 = collectionEditorController.configPermissions ? collectionEditorController.configPermissions({
10778
+ t0 = collectionEditorController.configPermissions ? collectionEditorController.configPermissions({
10589
10779
  user: authController.user
10590
10780
  }).createCollections : true;
10591
10781
  $[0] = authController;
10592
10782
  $[1] = collectionEditorController;
10593
- $[2] = t1;
10783
+ $[2] = t0;
10594
10784
  } else {
10595
- t1 = $[2];
10785
+ t0 = $[2];
10596
10786
  }
10597
- const canCreateCollections = t1;
10787
+ const canCreateCollections = t0;
10598
10788
  if (!navigation.initialised || (navigation.collections ?? []).length > 0) {
10599
10789
  return null;
10600
10790
  }
10791
+ let t1;
10601
10792
  let t2;
10602
- let t3;
10603
10793
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
10604
- t2 = /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "uppercase", children: "No collections found" });
10605
- t3 = /* @__PURE__ */ jsx(Typography, { children: "Start building collections in FireCMS easily. Map them to your existing database data, import from files, or use our templates." });
10606
- $[3] = t2;
10607
- $[4] = t3;
10794
+ t1 = /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "uppercase", children: "No collections found" });
10795
+ t2 = /* @__PURE__ */ jsx(Typography, { children: "Start building collections in FireCMS easily. Map them to your existing database data, import from files, or use our templates." });
10796
+ $[3] = t1;
10797
+ $[4] = t2;
10608
10798
  } else {
10609
- t2 = $[3];
10610
- t3 = $[4];
10799
+ t1 = $[3];
10800
+ t2 = $[4];
10611
10801
  }
10612
- let t4;
10802
+ let t3;
10613
10803
  if ($[5] !== canCreateCollections || $[6] !== collectionEditorController) {
10614
- t4 = canCreateCollections && /* @__PURE__ */ jsxs(Button, { onClick: collectionEditorController && canCreateCollections ? () => collectionEditorController.createCollection({
10804
+ t3 = canCreateCollections && /* @__PURE__ */ jsxs(Button, { onClick: collectionEditorController && canCreateCollections ? () => collectionEditorController.createCollection({
10615
10805
  parentCollectionIds: [],
10616
10806
  redirect: true,
10617
10807
  sourceClick: "new_collection_card"
@@ -10621,31 +10811,31 @@ function IntroWidget(t0) {
10621
10811
  ] });
10622
10812
  $[5] = canCreateCollections;
10623
10813
  $[6] = collectionEditorController;
10624
- $[7] = t4;
10814
+ $[7] = t3;
10625
10815
  } else {
10626
- t4 = $[7];
10816
+ t3 = $[7];
10627
10817
  }
10628
- let t5;
10818
+ let t4;
10629
10819
  if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
10630
- t5 = /* @__PURE__ */ jsx(Typography, { color: "secondary", children: "You can also define collections programmatically." });
10631
- $[8] = t5;
10820
+ t4 = /* @__PURE__ */ jsx(Typography, { color: "secondary", children: "You can also define collections programmatically." });
10821
+ $[8] = t4;
10632
10822
  } else {
10633
- t5 = $[8];
10823
+ t4 = $[8];
10634
10824
  }
10635
- let t6;
10636
- if ($[9] !== t4) {
10637
- t6 = /* @__PURE__ */ jsxs(Paper, { className: "my-4 px-4 py-6 flex flex-col bg-white dark:bg-surface-accent-800 gap-2", children: [
10825
+ let t5;
10826
+ if ($[9] !== t3) {
10827
+ t5 = /* @__PURE__ */ jsxs(Paper, { className: "my-4 px-4 py-6 flex flex-col bg-white dark:bg-surface-accent-800 gap-2", children: [
10828
+ t1,
10638
10829
  t2,
10639
10830
  t3,
10640
- t4,
10641
- t5
10831
+ t4
10642
10832
  ] });
10643
- $[9] = t4;
10644
- $[10] = t6;
10833
+ $[9] = t3;
10834
+ $[10] = t5;
10645
10835
  } else {
10646
- t6 = $[10];
10836
+ t5 = $[10];
10647
10837
  }
10648
- return t6;
10838
+ return t5;
10649
10839
  }
10650
10840
  const mergeCollections = (baseCollections, backendCollections = [], modifyCollection) => {
10651
10841
  const markAsEditable = (c2) => {