@firecms/collection_editor 3.0.0-canary.235 → 3.0.0-canary.239

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -4,7 +4,7 @@ import { FieldCaption, SearchIconsView, toSnakeCase, singular, IconForView, Arra
4
4
  import * as React from "react";
5
5
  import React__default, { useContext, useState, useEffect, useMemo, useRef, useDeferredValue } from "react";
6
6
  import equal from "react-fast-compare";
7
- import { 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, defaultBorderMixin, RemoveIcon, DragHandleIcon, AddIcon, SelectGroup, DeleteIcon, InfoLabel, fieldBackgroundMixin, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, WarningIcon, ContentCopyIcon, CodeIcon, Table, TableBody, TableRow, TableCell, Alert, Icon, coolIconKeys, Tabs, Tab, ArrowBackIcon, LoadingButton, CheckIcon, Menu, MoreVertIcon, MenuItem, UndoIcon, SaveIcon } from "@firecms/ui";
8
8
  import * as Yup from "yup";
9
9
  import { useFormex, getIn, Field, useCreateFormex, Formex, clone } from "@firecms/formex";
10
10
  import { extractEnumFromValues, buildPropertyFromData, buildEntityPropertiesFromData } from "@firecms/schema_inference";
@@ -162,7 +162,7 @@ function LayoutModeSwitch(t0) {
162
162
  return t18;
163
163
  }
164
164
  function CollectionDetailsForm(t0) {
165
- const $ = c(176);
165
+ const $ = c(186);
166
166
  const {
167
167
  isNewCollection,
168
168
  reservedGroups,
@@ -468,101 +468,143 @@ function CollectionDetailsForm(t0) {
468
468
  } else {
469
469
  t40 = $[58];
470
470
  }
471
- let t41;
472
- if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
473
- t41 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row text-surface-500", children: [
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 });
471
+ const t41 = values.history === null ? "Document history revisions enabled if enabled globally" : values.history ? "Document history revisions ENABLED" : "Document history revisions NOT enabled";
472
+ let t42;
473
+ if ($[59] !== setFieldValue) {
474
+ t42 = (v) => setFieldValue("history", v);
475
+ $[59] = setFieldValue;
486
476
  $[60] = t42;
487
- $[61] = t43;
488
- $[62] = t44;
489
477
  } else {
490
- t44 = $[62];
478
+ t42 = $[60];
491
479
  }
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;
480
+ const t43 = values.history ?? null;
481
+ let t44;
482
+ if ($[61] !== t41 || $[62] !== t42 || $[63] !== t43) {
483
+ t44 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", allowIndeterminate: true, label: t41, onValueChange: t42, value: t43 });
484
+ $[61] = t41;
485
+ $[62] = t42;
486
+ $[63] = t43;
487
+ $[64] = t44;
488
+ } else {
489
+ t44 = $[64];
490
+ }
491
+ let t45;
492
+ if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
493
+ t45 = /* @__PURE__ */ jsxs(FieldCaption, { children: [
494
+ "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 ",
495
+ /* @__PURE__ */ jsx("b", { children: "__history" }),
496
+ "."
497
+ ] });
498
+ $[65] = t45;
500
499
  } else {
501
- t47 = $[65];
500
+ t45 = $[65];
502
501
  }
503
- let t48;
504
- if ($[66] !== t44 || $[67] !== t47) {
505
- t48 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
502
+ let t46;
503
+ if ($[66] !== t44) {
504
+ t46 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
506
505
  t44,
507
- t47
506
+ t45
508
507
  ] });
509
508
  $[66] = t44;
510
- $[67] = t47;
511
- $[68] = t48;
509
+ $[67] = t46;
510
+ } else {
511
+ t46 = $[67];
512
+ }
513
+ let t47;
514
+ if ($[68] === Symbol.for("react.memo_cache_sentinel")) {
515
+ t47 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row text-surface-500", children: [
516
+ /* @__PURE__ */ jsx(SettingsIcon, {}),
517
+ /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "ml-2", children: "Advanced" })
518
+ ] });
519
+ $[68] = t47;
512
520
  } else {
513
- t48 = $[68];
521
+ t47 = $[68];
514
522
  }
515
- const t49 = showErrors && Boolean(errors.singularName);
523
+ const t48 = !isNewCollection;
524
+ const t49 = showErrors && Boolean(errors.id);
516
525
  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;
526
+ if ($[69] !== t48 || $[70] !== t49) {
527
+ t50 = /* @__PURE__ */ jsx(Field, { name: "id", as: DebouncedTextField, disabled: t48, label: "Collection id", error: t49 });
528
+ $[69] = t48;
529
+ $[70] = t49;
524
530
  $[71] = t50;
525
531
  } else {
526
532
  t50 = $[71];
527
533
  }
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 });
534
+ const t51 = touched.id && Boolean(errors.id);
535
+ const t52 = touched.id && Boolean(errors.id) ? errors.id : "This id identifies this collection. Typically the same as the path.";
536
+ let t53;
537
+ if ($[72] !== t51 || $[73] !== t52) {
538
+ t53 = /* @__PURE__ */ jsx(FieldCaption, { error: t51, children: t52 });
539
+ $[72] = t51;
540
+ $[73] = t52;
541
+ $[74] = t53;
542
+ } else {
543
+ t53 = $[74];
544
+ }
545
+ let t54;
546
+ if ($[75] !== t50 || $[76] !== t53) {
547
+ t54 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
548
+ t50,
549
+ t53
550
+ ] });
551
+ $[75] = t50;
544
552
  $[76] = t53;
545
553
  $[77] = t54;
546
- $[78] = t55;
547
554
  } else {
548
- t55 = $[78];
555
+ t54 = $[77];
549
556
  }
557
+ const t55 = showErrors && Boolean(errors.singularName);
550
558
  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;
559
+ if ($[78] !== handleChange || $[79] !== setFieldTouched) {
560
+ t56 = (e_0) => {
561
+ setFieldTouched("singularName", true);
562
+ return handleChange(e_0);
563
+ };
564
+ $[78] = handleChange;
565
+ $[79] = setFieldTouched;
566
+ $[80] = t56;
559
567
  } else {
560
- t56 = $[81];
568
+ t56 = $[80];
561
569
  }
562
- const t57 = showErrors && Boolean(errors.sideDialogWidth);
570
+ const t57 = values.singularName ?? "";
563
571
  let t58;
564
- if ($[82] !== setFieldTouched || $[83] !== setFieldValue) {
565
- t58 = (e_1) => {
572
+ if ($[81] !== t55 || $[82] !== t56 || $[83] !== t57) {
573
+ t58 = /* @__PURE__ */ jsx(TextField, { error: t55, name: "singularName", "aria-describedby": "singularName-helper", onChange: t56, value: t57, label: "Singular name" });
574
+ $[81] = t55;
575
+ $[82] = t56;
576
+ $[83] = t57;
577
+ $[84] = t58;
578
+ } else {
579
+ t58 = $[84];
580
+ }
581
+ const t59 = showErrors && Boolean(errors.singularName);
582
+ const t60 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define a singular name for your entities";
583
+ let t61;
584
+ if ($[85] !== t59 || $[86] !== t60) {
585
+ t61 = /* @__PURE__ */ jsx(FieldCaption, { error: t59, children: t60 });
586
+ $[85] = t59;
587
+ $[86] = t60;
588
+ $[87] = t61;
589
+ } else {
590
+ t61 = $[87];
591
+ }
592
+ let t62;
593
+ if ($[88] !== t58 || $[89] !== t61) {
594
+ t62 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
595
+ t58,
596
+ t61
597
+ ] });
598
+ $[88] = t58;
599
+ $[89] = t61;
600
+ $[90] = t62;
601
+ } else {
602
+ t62 = $[90];
603
+ }
604
+ const t63 = showErrors && Boolean(errors.sideDialogWidth);
605
+ let t64;
606
+ if ($[91] !== setFieldTouched || $[92] !== setFieldValue) {
607
+ t64 = (e_1) => {
566
608
  setFieldTouched("sideDialogWidth", true);
567
609
  const value_0 = e_1.target.value;
568
610
  if (!value_0) {
@@ -573,360 +615,362 @@ function CollectionDetailsForm(t0) {
573
615
  }
574
616
  }
575
617
  };
576
- $[82] = setFieldTouched;
577
- $[83] = setFieldValue;
578
- $[84] = t58;
618
+ $[91] = setFieldTouched;
619
+ $[92] = setFieldValue;
620
+ $[93] = t64;
579
621
  } else {
580
- t58 = $[84];
622
+ t64 = $[93];
581
623
  }
582
- let t59;
583
- if ($[85] !== setFieldValue) {
584
- t59 = () => {
624
+ let t65;
625
+ if ($[94] !== setFieldValue) {
626
+ t65 = () => {
585
627
  setFieldValue("sideDialogWidth", null);
586
628
  };
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;
629
+ $[94] = setFieldValue;
630
+ $[95] = t65;
597
631
  } else {
598
- t61 = $[87];
632
+ t65 = $[95];
599
633
  }
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;
606
- } else {
607
- t62 = $[90];
608
- }
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";
634
+ const t66 = !values.sideDialogWidth;
623
635
  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;
636
+ if ($[96] === Symbol.for("react.memo_cache_sentinel")) {
637
+ t67 = /* @__PURE__ */ jsx(CloseIcon, { size: "small" });
638
+ $[96] = t67;
629
639
  } else {
630
- t67 = $[98];
640
+ t67 = $[96];
631
641
  }
632
642
  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, minRows: 2, "aria-describedby": "description-helper-text", label: "Description" });
649
- $[102] = handleChange;
643
+ if ($[97] !== t65 || $[98] !== t66) {
644
+ t68 = /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: t65, disabled: t66, children: t67 });
645
+ $[97] = t65;
646
+ $[98] = t66;
647
+ $[99] = t68;
648
+ } else {
649
+ t68 = $[99];
650
+ }
651
+ const t69 = values.sideDialogWidth ?? "";
652
+ let t70;
653
+ if ($[100] !== t63 || $[101] !== t64 || $[102] !== t68 || $[103] !== t69) {
654
+ t70 = /* @__PURE__ */ jsx(TextField, { error: t63, name: "sideDialogWidth", type: "number", "aria-describedby": "sideDialogWidth-helper", onChange: t64, endAdornment: t68, value: t69, label: "Side dialog width" });
655
+ $[100] = t63;
656
+ $[101] = t64;
657
+ $[102] = t68;
650
658
  $[103] = t69;
651
659
  $[104] = t70;
652
- $[105] = t71;
653
660
  } else {
654
- t71 = $[105];
661
+ t70 = $[104];
655
662
  }
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 });
663
+ const t71 = showErrors && Boolean(errors.singularName);
664
+ const t72 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px";
665
+ let t73;
666
+ if ($[105] !== t71 || $[106] !== t72) {
667
+ t73 = /* @__PURE__ */ jsx(FieldCaption, { error: t71, children: t72 });
668
+ $[105] = t71;
661
669
  $[106] = t72;
662
670
  $[107] = t73;
663
- $[108] = t74;
664
671
  } else {
665
- t74 = $[108];
672
+ t73 = $[107];
666
673
  }
667
- let t75;
668
- if ($[109] !== t71 || $[110] !== t74) {
669
- t75 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
670
- t71,
671
- t74
674
+ let t74;
675
+ if ($[108] !== t70 || $[109] !== t73) {
676
+ t74 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
677
+ t70,
678
+ t73
672
679
  ] });
673
- $[109] = t71;
680
+ $[108] = t70;
681
+ $[109] = t73;
674
682
  $[110] = t74;
675
- $[111] = t75;
676
683
  } else {
677
- t75 = $[111];
684
+ t74 = $[110];
678
685
  }
679
- const t76 = values.defaultSize ?? "";
686
+ const t75 = showErrors && Boolean(errors.description);
687
+ const t76 = values.description ?? "";
680
688
  let t77;
681
- if ($[112] === Symbol.for("react.memo_cache_sentinel")) {
682
- t77 = ["xs", "s", "m", "l", "xl"].map(_temp2$7);
683
- $[112] = t77;
689
+ if ($[111] !== handleChange || $[112] !== t75 || $[113] !== t76) {
690
+ t77 = /* @__PURE__ */ jsx(TextField, { error: t75, name: "description", value: t76, onChange: handleChange, multiline: true, minRows: 2, "aria-describedby": "description-helper-text", label: "Description" });
691
+ $[111] = handleChange;
692
+ $[112] = t75;
693
+ $[113] = t76;
694
+ $[114] = t77;
684
695
  } else {
685
- t77 = $[112];
696
+ t77 = $[114];
686
697
  }
687
- let t78;
688
- if ($[113] !== handleChange || $[114] !== t76) {
689
- t78 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(Select, { name: "defaultSize", size: "large", fullWidth: true, label: "Default row size", position: "item-aligned", onChange: handleChange, value: t76, renderValue: _temp$b, children: t77 }) });
690
- $[113] = handleChange;
691
- $[114] = t76;
692
- $[115] = t78;
693
- } else {
694
- t78 = $[115];
695
- }
696
- const t79 = customIdValue === "code_defined";
698
+ const t78 = showErrors && Boolean(errors.description);
699
+ const t79 = showErrors && Boolean(errors.description) ? errors.description : "Description of the collection, you can use markdown";
697
700
  let t80;
698
- if ($[116] !== setFieldValue) {
699
- t80 = (v) => {
700
- if (v === "code_defined") {
701
- throw new Error("This should not happen");
702
- }
703
- setFieldValue("customId", v);
704
- };
705
- $[116] = setFieldValue;
701
+ if ($[115] !== t78 || $[116] !== t79) {
702
+ t80 = /* @__PURE__ */ jsx(FieldCaption, { error: t78, children: t79 });
703
+ $[115] = t78;
704
+ $[116] = t79;
706
705
  $[117] = t80;
707
706
  } else {
708
707
  t80 = $[117];
709
708
  }
710
- const t81 = customIdValue ?? "";
711
- let t82;
709
+ let t81;
710
+ if ($[118] !== t77 || $[119] !== t80) {
711
+ t81 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
712
+ t77,
713
+ t80
714
+ ] });
715
+ $[118] = t77;
716
+ $[119] = t80;
717
+ $[120] = t81;
718
+ } else {
719
+ t81 = $[120];
720
+ }
721
+ const t82 = values.defaultSize ?? "";
712
722
  let t83;
723
+ if ($[121] === Symbol.for("react.memo_cache_sentinel")) {
724
+ t83 = ["xs", "s", "m", "l", "xl"].map(_temp2$7);
725
+ $[121] = t83;
726
+ } else {
727
+ t83 = $[121];
728
+ }
713
729
  let t84;
714
- if ($[118] === Symbol.for("react.memo_cache_sentinel")) {
715
- t82 = /* @__PURE__ */ jsx(SelectItem, { value: "false", children: "Document ID is generated automatically" });
716
- t83 = /* @__PURE__ */ jsx(SelectItem, { value: "true", children: "Users must define an ID" });
717
- t84 = /* @__PURE__ */ jsx(SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
718
- $[118] = t82;
719
- $[119] = t83;
720
- $[120] = t84;
721
- } else {
722
- t82 = $[118];
723
- t83 = $[119];
724
- t84 = $[120];
725
- }
726
- let t85;
727
- if ($[121] !== t79 || $[122] !== t80 || $[123] !== t81) {
728
- 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: [
729
- t82,
730
- t83,
731
- t84
732
- ] }) });
733
- $[121] = t79;
734
- $[122] = t80;
735
- $[123] = t81;
736
- $[124] = t85;
730
+ if ($[122] !== handleChange || $[123] !== t82) {
731
+ 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 }) });
732
+ $[122] = handleChange;
733
+ $[123] = t82;
734
+ $[124] = t84;
737
735
  } else {
738
- t85 = $[124];
736
+ t84 = $[124];
739
737
  }
738
+ const t85 = customIdValue === "code_defined";
740
739
  let t86;
741
740
  if ($[125] !== setFieldValue) {
742
- t86 = (v_0) => setFieldValue("collectionGroup", v_0);
741
+ t86 = (v_0) => {
742
+ if (v_0 === "code_defined") {
743
+ throw new Error("This should not happen");
744
+ }
745
+ setFieldValue("customId", v_0);
746
+ };
743
747
  $[125] = setFieldValue;
744
748
  $[126] = t86;
745
749
  } else {
746
750
  t86 = $[126];
747
751
  }
748
- const t87 = values.collectionGroup ?? false;
752
+ const t87 = customIdValue ?? "";
749
753
  let t88;
750
- if ($[127] !== t86 || $[128] !== t87) {
751
- t88 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Collection group", onValueChange: t86, value: t87 });
752
- $[127] = t86;
753
- $[128] = t87;
754
- $[129] = t88;
755
- } else {
756
- t88 = $[129];
757
- }
758
754
  let t89;
759
- if ($[130] === Symbol.for("react.memo_cache_sentinel")) {
760
- 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." });
761
- $[130] = t89;
762
- } else {
763
- t89 = $[130];
764
- }
765
755
  let t90;
766
- if ($[131] !== t88) {
767
- t90 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-4", children: [
756
+ if ($[127] === Symbol.for("react.memo_cache_sentinel")) {
757
+ t88 = /* @__PURE__ */ jsx(SelectItem, { value: "false", children: "Document ID is generated automatically" });
758
+ t89 = /* @__PURE__ */ jsx(SelectItem, { value: "true", children: "Users must define an ID" });
759
+ t90 = /* @__PURE__ */ jsx(SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
760
+ $[127] = t88;
761
+ $[128] = t89;
762
+ $[129] = t90;
763
+ } else {
764
+ t88 = $[127];
765
+ t89 = $[128];
766
+ t90 = $[129];
767
+ }
768
+ let t91;
769
+ if ($[130] !== t85 || $[131] !== t86 || $[132] !== t87) {
770
+ t91 = /* @__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: t85, onValueChange: t86, value: t87, renderValue: _temp3$4, children: [
768
771
  t88,
769
- t89
770
- ] });
771
- $[131] = t88;
772
- $[132] = t90;
772
+ t89,
773
+ t90
774
+ ] }) });
775
+ $[130] = t85;
776
+ $[131] = t86;
777
+ $[132] = t87;
778
+ $[133] = t91;
773
779
  } else {
774
- t90 = $[132];
780
+ t91 = $[133];
775
781
  }
776
- let t91;
777
- if ($[133] !== setFieldValue) {
778
- t91 = (v_1) => setFieldValue("textSearchEnabled", v_1);
779
- $[133] = setFieldValue;
780
- $[134] = t91;
781
- } else {
782
- t91 = $[134];
783
- }
784
- const t92 = values.textSearchEnabled ?? false;
785
- let t93;
786
- if ($[135] !== t91 || $[136] !== t92) {
787
- t93 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Enable text search for this collection", onValueChange: t91, value: t92 });
788
- $[135] = t91;
789
- $[136] = t92;
790
- $[137] = t93;
782
+ let t92;
783
+ if ($[134] !== setFieldValue) {
784
+ t92 = (v_1) => setFieldValue("collectionGroup", v_1);
785
+ $[134] = setFieldValue;
786
+ $[135] = t92;
791
787
  } else {
792
- t93 = $[137];
788
+ t92 = $[135];
793
789
  }
790
+ const t93 = values.collectionGroup ?? false;
794
791
  let t94;
795
- if ($[138] === Symbol.for("react.memo_cache_sentinel")) {
796
- 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." });
792
+ if ($[136] !== t92 || $[137] !== t93) {
793
+ t94 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Collection group", onValueChange: t92, value: t93 });
794
+ $[136] = t92;
795
+ $[137] = t93;
797
796
  $[138] = t94;
798
797
  } else {
799
798
  t94 = $[138];
800
799
  }
801
800
  let t95;
802
- if ($[139] !== t93) {
803
- t95 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
804
- t93,
805
- t94
806
- ] });
807
- $[139] = t93;
808
- $[140] = t95;
801
+ if ($[139] === Symbol.for("react.memo_cache_sentinel")) {
802
+ t95 = /* @__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." });
803
+ $[139] = t95;
809
804
  } else {
810
- t95 = $[140];
805
+ t95 = $[139];
811
806
  }
812
807
  let t96;
813
- if ($[141] !== t48 || $[142] !== t56 || $[143] !== t68 || $[144] !== t75 || $[145] !== t78 || $[146] !== t85 || $[147] !== t90 || $[148] !== t95) {
814
- t96 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
815
- t48,
816
- t56,
817
- t68,
818
- t75,
819
- t78,
820
- t85,
821
- t90,
808
+ if ($[140] !== t94) {
809
+ t96 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-4", children: [
810
+ t94,
822
811
  t95
823
812
  ] });
824
- $[141] = t48;
825
- $[142] = t56;
826
- $[143] = t68;
827
- $[144] = t75;
828
- $[145] = t78;
829
- $[146] = t85;
830
- $[147] = t90;
831
- $[148] = t95;
832
- $[149] = t96;
833
- } else {
834
- t96 = $[149];
813
+ $[140] = t94;
814
+ $[141] = t96;
815
+ } else {
816
+ t96 = $[141];
835
817
  }
836
818
  let t97;
837
- if ($[150] !== advancedPanelExpanded || $[151] !== t96) {
838
- t97 = /* @__PURE__ */ jsx(ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t41, initiallyExpanded: false, children: t96 });
839
- $[150] = advancedPanelExpanded;
840
- $[151] = t96;
841
- $[152] = t97;
842
- } else {
843
- t97 = $[152];
844
- }
845
- let t98;
846
- if ($[153] !== children || $[154] !== t97) {
847
- t98 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-8", children: [
848
- t97,
819
+ if ($[142] !== setFieldValue) {
820
+ t97 = (v_2) => setFieldValue("textSearchEnabled", v_2);
821
+ $[142] = setFieldValue;
822
+ $[143] = t97;
823
+ } else {
824
+ t97 = $[143];
825
+ }
826
+ const t98 = values.textSearchEnabled ?? false;
827
+ let t99;
828
+ if ($[144] !== t97 || $[145] !== t98) {
829
+ t99 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Enable text search for this collection", onValueChange: t97, value: t98 });
830
+ $[144] = t97;
831
+ $[145] = t98;
832
+ $[146] = t99;
833
+ } else {
834
+ t99 = $[146];
835
+ }
836
+ let t100;
837
+ if ($[147] === Symbol.for("react.memo_cache_sentinel")) {
838
+ t100 = /* @__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." });
839
+ $[147] = t100;
840
+ } else {
841
+ t100 = $[147];
842
+ }
843
+ let t101;
844
+ if ($[148] !== t99) {
845
+ t101 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
846
+ t99,
847
+ t100
848
+ ] });
849
+ $[148] = t99;
850
+ $[149] = t101;
851
+ } else {
852
+ t101 = $[149];
853
+ }
854
+ let t102;
855
+ if ($[150] !== t101 || $[151] !== t54 || $[152] !== t62 || $[153] !== t74 || $[154] !== t81 || $[155] !== t84 || $[156] !== t91 || $[157] !== t96) {
856
+ t102 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
857
+ t54,
858
+ t62,
859
+ t74,
860
+ t81,
861
+ t84,
862
+ t91,
863
+ t96,
864
+ t101
865
+ ] });
866
+ $[150] = t101;
867
+ $[151] = t54;
868
+ $[152] = t62;
869
+ $[153] = t74;
870
+ $[154] = t81;
871
+ $[155] = t84;
872
+ $[156] = t91;
873
+ $[157] = t96;
874
+ $[158] = t102;
875
+ } else {
876
+ t102 = $[158];
877
+ }
878
+ let t103;
879
+ if ($[159] !== advancedPanelExpanded || $[160] !== t102) {
880
+ t103 = /* @__PURE__ */ jsx(ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t47, initiallyExpanded: false, children: t102 });
881
+ $[159] = advancedPanelExpanded;
882
+ $[160] = t102;
883
+ $[161] = t103;
884
+ } else {
885
+ t103 = $[161];
886
+ }
887
+ let t104;
888
+ if ($[162] !== children || $[163] !== t103) {
889
+ t104 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-8", children: [
890
+ t103,
849
891
  children
850
892
  ] });
851
- $[153] = children;
852
- $[154] = t97;
853
- $[155] = t98;
893
+ $[162] = children;
894
+ $[163] = t103;
895
+ $[164] = t104;
854
896
  } else {
855
- t98 = $[155];
897
+ t104 = $[164];
856
898
  }
857
- let t99;
858
- if ($[156] !== t27 || $[157] !== t36 || $[158] !== t37 || $[159] !== t40 || $[160] !== t98) {
859
- t99 = /* @__PURE__ */ jsxs("div", { className: t19, children: [
899
+ let t105;
900
+ if ($[165] !== t104 || $[166] !== t27 || $[167] !== t36 || $[168] !== t37 || $[169] !== t40 || $[170] !== t46) {
901
+ t105 = /* @__PURE__ */ jsxs("div", { className: t19, children: [
860
902
  t27,
861
903
  t36,
862
904
  t37,
863
905
  t40,
864
- t98
906
+ t46,
907
+ t104
865
908
  ] });
866
- $[156] = t27;
867
- $[157] = t36;
868
- $[158] = t37;
869
- $[159] = t40;
870
- $[160] = t98;
871
- $[161] = t99;
872
- } else {
873
- t99 = $[161];
874
- }
875
- let t100;
876
- if ($[162] === Symbol.for("react.memo_cache_sentinel")) {
877
- t100 = /* @__PURE__ */ jsx("div", { style: {
909
+ $[165] = t104;
910
+ $[166] = t27;
911
+ $[167] = t36;
912
+ $[168] = t37;
913
+ $[169] = t40;
914
+ $[170] = t46;
915
+ $[171] = t105;
916
+ } else {
917
+ t105 = $[171];
918
+ }
919
+ let t106;
920
+ if ($[172] === Symbol.for("react.memo_cache_sentinel")) {
921
+ t106 = /* @__PURE__ */ jsx("div", { style: {
878
922
  height: "52px"
879
923
  } });
880
- $[162] = t100;
924
+ $[172] = t106;
881
925
  } else {
882
- t100 = $[162];
926
+ t106 = $[172];
883
927
  }
884
- let t101;
885
- if ($[163] !== setFieldValue) {
886
- t101 = (icon) => {
928
+ let t107;
929
+ if ($[173] !== setFieldValue) {
930
+ t107 = (icon) => {
887
931
  setIconDialogOpen(false);
888
932
  setFieldValue("icon", icon);
889
933
  };
890
- $[163] = setFieldValue;
891
- $[164] = t101;
934
+ $[173] = setFieldValue;
935
+ $[174] = t107;
892
936
  } else {
893
- t101 = $[164];
937
+ t107 = $[174];
894
938
  }
895
- let t102;
896
- if ($[165] !== t101 || $[166] !== values.icon) {
897
- t102 = /* @__PURE__ */ jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsx(SearchIconsView, { selectedIcon: values.icon, onIconSelected: t101 }) });
898
- $[165] = t101;
899
- $[166] = values.icon;
900
- $[167] = t102;
939
+ let t108;
940
+ if ($[175] !== t107 || $[176] !== values.icon) {
941
+ t108 = /* @__PURE__ */ jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsx(SearchIconsView, { selectedIcon: values.icon, onIconSelected: t107 }) });
942
+ $[175] = t107;
943
+ $[176] = values.icon;
944
+ $[177] = t108;
901
945
  } else {
902
- t102 = $[167];
946
+ t108 = $[177];
903
947
  }
904
- let t103;
905
- if ($[168] !== iconDialogOpen || $[169] !== t102) {
906
- t103 = /* @__PURE__ */ jsx(Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t102 });
907
- $[168] = iconDialogOpen;
908
- $[169] = t102;
909
- $[170] = t103;
948
+ let t109;
949
+ if ($[178] !== iconDialogOpen || $[179] !== t108) {
950
+ t109 = /* @__PURE__ */ jsx(Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t108 });
951
+ $[178] = iconDialogOpen;
952
+ $[179] = t108;
953
+ $[180] = t109;
910
954
  } else {
911
- t103 = $[170];
955
+ t109 = $[180];
912
956
  }
913
- let t104;
914
- if ($[171] !== T0 || $[172] !== t103 || $[173] !== t18 || $[174] !== t99) {
915
- t104 = /* @__PURE__ */ jsx("div", { className: t7, children: /* @__PURE__ */ jsxs(T0, { maxWidth: t8, className: t9, children: [
957
+ let t110;
958
+ if ($[181] !== T0 || $[182] !== t105 || $[183] !== t109 || $[184] !== t18) {
959
+ t110 = /* @__PURE__ */ jsx("div", { className: t7, children: /* @__PURE__ */ jsxs(T0, { maxWidth: t8, className: t9, children: [
916
960
  t18,
917
- t99,
918
- t100,
919
- t103
961
+ t105,
962
+ t106,
963
+ t109
920
964
  ] }) });
921
- $[171] = T0;
922
- $[172] = t103;
923
- $[173] = t18;
924
- $[174] = t99;
925
- $[175] = t104;
965
+ $[181] = T0;
966
+ $[182] = t105;
967
+ $[183] = t109;
968
+ $[184] = t18;
969
+ $[185] = t110;
926
970
  } else {
927
- t104 = $[175];
971
+ t110 = $[185];
928
972
  }
929
- return t104;
973
+ return t110;
930
974
  }
931
975
  function _temp3$4(value_3) {
932
976
  if (value_3 === "code_defined") {
@@ -8065,7 +8109,7 @@ const pagesCollectionTemplate = {
8065
8109
  }
8066
8110
  };
8067
8111
  function CollectionEditorWelcomeView(t0) {
8068
- const $ = c(56);
8112
+ const $ = c(52);
8069
8113
  const {
8070
8114
  path,
8071
8115
  pathSuggestions,
@@ -8102,6 +8146,10 @@ function CollectionEditorWelcomeView(t0) {
8102
8146
  setFieldValue,
8103
8147
  setValues
8104
8148
  } = useFormex();
8149
+ const noSuggestions = !loadingPathSuggestions && (filteredPathSuggestions ?? [])?.length === 0;
8150
+ if (!noSuggestions) {
8151
+ return null;
8152
+ }
8105
8153
  let t3;
8106
8154
  if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
8107
8155
  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" }) });
@@ -8153,173 +8201,162 @@ function CollectionEditorWelcomeView(t0) {
8153
8201
  t7 = $[15];
8154
8202
  }
8155
8203
  let t8;
8156
- if ($[16] !== filteredPathSuggestions || $[17] !== loadingPathSuggestions) {
8157
- t8 = !loadingPathSuggestions && (filteredPathSuggestions ?? [])?.length === 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", children: "No suggestions" });
8158
- $[16] = filteredPathSuggestions;
8159
- $[17] = loadingPathSuggestions;
8160
- $[18] = t8;
8161
- } else {
8162
- t8 = $[18];
8163
- }
8164
- let t9;
8165
- if ($[19] !== t6 || $[20] !== t7 || $[21] !== t8) {
8166
- t9 = /* @__PURE__ */ jsxs("div", { className: "my-2", children: [
8204
+ if ($[16] !== t6 || $[17] !== t7) {
8205
+ t8 = /* @__PURE__ */ jsxs("div", { className: "my-2", children: [
8167
8206
  t5,
8168
8207
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
8169
8208
  t6,
8170
- t7,
8171
- t8
8209
+ t7
8172
8210
  ] })
8173
8211
  ] });
8174
- $[19] = t6;
8175
- $[20] = t7;
8176
- $[21] = t8;
8177
- $[22] = t9;
8212
+ $[16] = t6;
8213
+ $[17] = t7;
8214
+ $[18] = t8;
8178
8215
  } else {
8179
- t9 = $[22];
8216
+ t8 = $[18];
8217
+ }
8218
+ let t9;
8219
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
8220
+ t9 = /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "● Select a template:" });
8221
+ $[19] = t9;
8222
+ } else {
8223
+ t9 = $[19];
8180
8224
  }
8181
8225
  let t10;
8182
- if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
8183
- t10 = /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "● Select a template:" });
8184
- $[23] = t10;
8226
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
8227
+ t10 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: productsCollectionTemplate.icon });
8228
+ $[20] = t10;
8185
8229
  } else {
8186
- t10 = $[23];
8230
+ t10 = $[20];
8187
8231
  }
8188
8232
  let t11;
8189
- if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
8190
- t11 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: productsCollectionTemplate.icon });
8191
- $[24] = t11;
8233
+ if ($[21] !== onContinue || $[22] !== setValues) {
8234
+ t11 = /* @__PURE__ */ jsx(TemplateButton, { title: "Products", subtitle: "A collection of products with images, prices and stock", icon: t10, onClick: () => {
8235
+ setValues(productsCollectionTemplate);
8236
+ onContinue();
8237
+ } });
8238
+ $[21] = onContinue;
8239
+ $[22] = setValues;
8240
+ $[23] = t11;
8192
8241
  } else {
8193
- t11 = $[24];
8242
+ t11 = $[23];
8194
8243
  }
8195
8244
  let t12;
8245
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
8246
+ t12 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: usersCollectionTemplate.icon });
8247
+ $[24] = t12;
8248
+ } else {
8249
+ t12 = $[24];
8250
+ }
8251
+ let t13;
8196
8252
  if ($[25] !== onContinue || $[26] !== setValues) {
8197
- t12 = /* @__PURE__ */ jsx(TemplateButton, { title: "Products", subtitle: "A collection of products with images, prices and stock", icon: t11, onClick: () => {
8198
- setValues(productsCollectionTemplate);
8253
+ t13 = /* @__PURE__ */ jsx(TemplateButton, { title: "Users", subtitle: "A collection of users with emails, names and roles", icon: t12, onClick: () => {
8254
+ setValues(usersCollectionTemplate);
8199
8255
  onContinue();
8200
8256
  } });
8201
8257
  $[25] = onContinue;
8202
8258
  $[26] = setValues;
8203
- $[27] = t12;
8259
+ $[27] = t13;
8204
8260
  } else {
8205
- t12 = $[27];
8261
+ t13 = $[27];
8206
8262
  }
8207
- let t13;
8263
+ let t14;
8208
8264
  if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
8209
- t13 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: usersCollectionTemplate.icon });
8210
- $[28] = t13;
8265
+ t14 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: blogCollectionTemplate.icon });
8266
+ $[28] = t14;
8211
8267
  } else {
8212
- t13 = $[28];
8268
+ t14 = $[28];
8213
8269
  }
8214
- let t14;
8270
+ let t15;
8215
8271
  if ($[29] !== onContinue || $[30] !== setValues) {
8216
- t14 = /* @__PURE__ */ jsx(TemplateButton, { title: "Users", subtitle: "A collection of users with emails, names and roles", icon: t13, onClick: () => {
8217
- setValues(usersCollectionTemplate);
8272
+ t15 = /* @__PURE__ */ jsx(TemplateButton, { title: "Blog posts", subtitle: "A collection of blog posts with images, authors and complex content", icon: t14, onClick: () => {
8273
+ setValues(blogCollectionTemplate);
8218
8274
  onContinue();
8219
8275
  } });
8220
8276
  $[29] = onContinue;
8221
8277
  $[30] = setValues;
8222
- $[31] = t14;
8278
+ $[31] = t15;
8223
8279
  } else {
8224
- t14 = $[31];
8280
+ t15 = $[31];
8225
8281
  }
8226
- let t15;
8282
+ let t16;
8227
8283
  if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
8228
- t15 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: blogCollectionTemplate.icon });
8229
- $[32] = t15;
8284
+ t16 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: pagesCollectionTemplate.icon });
8285
+ $[32] = t16;
8230
8286
  } else {
8231
- t15 = $[32];
8287
+ t16 = $[32];
8232
8288
  }
8233
- let t16;
8289
+ let t17;
8234
8290
  if ($[33] !== onContinue || $[34] !== setValues) {
8235
- t16 = /* @__PURE__ */ jsx(TemplateButton, { title: "Blog posts", subtitle: "A collection of blog posts with images, authors and complex content", icon: t15, onClick: () => {
8236
- setValues(blogCollectionTemplate);
8291
+ t17 = /* @__PURE__ */ jsx(TemplateButton, { title: "Pages", subtitle: "A collection of pages with images, authors and complex content", icon: t16, onClick: () => {
8292
+ setValues(pagesCollectionTemplate);
8237
8293
  onContinue();
8238
8294
  } });
8239
8295
  $[33] = onContinue;
8240
8296
  $[34] = setValues;
8241
- $[35] = t16;
8242
- } else {
8243
- t16 = $[35];
8244
- }
8245
- let t17;
8246
- if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
8247
- t17 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: pagesCollectionTemplate.icon });
8248
- $[36] = t17;
8297
+ $[35] = t17;
8249
8298
  } else {
8250
- t17 = $[36];
8299
+ t17 = $[35];
8251
8300
  }
8252
8301
  let t18;
8253
- if ($[37] !== onContinue || $[38] !== setValues) {
8254
- t18 = /* @__PURE__ */ jsx(TemplateButton, { title: "Pages", subtitle: "A collection of pages with images, authors and complex content", icon: t17, onClick: () => {
8255
- setValues(pagesCollectionTemplate);
8256
- onContinue();
8257
- } });
8258
- $[37] = onContinue;
8259
- $[38] = setValues;
8260
- $[39] = t18;
8261
- } else {
8262
- t18 = $[39];
8263
- }
8264
- let t19;
8265
- if ($[40] !== t12 || $[41] !== t14 || $[42] !== t16 || $[43] !== t18) {
8266
- t19 = /* @__PURE__ */ jsxs("div", { className: "my-2", children: [
8267
- t10,
8302
+ if ($[36] !== t11 || $[37] !== t13 || $[38] !== t15 || $[39] !== t17) {
8303
+ t18 = /* @__PURE__ */ jsxs("div", { className: "my-2", children: [
8304
+ t9,
8268
8305
  /* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
8269
- t12,
8270
- t14,
8271
- t16,
8272
- t18
8306
+ t11,
8307
+ t13,
8308
+ t15,
8309
+ t17
8273
8310
  ] })
8274
8311
  ] });
8275
- $[40] = t12;
8276
- $[41] = t14;
8277
- $[42] = t16;
8278
- $[43] = t18;
8279
- $[44] = t19;
8312
+ $[36] = t11;
8313
+ $[37] = t13;
8314
+ $[38] = t15;
8315
+ $[39] = t17;
8316
+ $[40] = t18;
8280
8317
  } else {
8281
- t19 = $[44];
8318
+ t18 = $[40];
8282
8319
  }
8283
- let t20;
8284
- if ($[45] !== onContinue || $[46] !== parentCollection) {
8285
- t20 = !parentCollection && /* @__PURE__ */ jsxs("div", { children: [
8320
+ let t19;
8321
+ if ($[41] !== onContinue || $[42] !== parentCollection) {
8322
+ t19 = !parentCollection && /* @__PURE__ */ jsxs("div", { children: [
8286
8323
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "mb-2", children: "● Create a collection from a file (csv, json, xls, xslx...)" }),
8287
8324
  /* @__PURE__ */ jsx(ImportFileUpload, { onDataAdded: (data, propertiesOrder) => onContinue(data, propertiesOrder) })
8288
8325
  ] });
8289
- $[45] = onContinue;
8290
- $[46] = parentCollection;
8291
- $[47] = t20;
8326
+ $[41] = onContinue;
8327
+ $[42] = parentCollection;
8328
+ $[43] = t19;
8292
8329
  } else {
8293
- t20 = $[47];
8330
+ t19 = $[43];
8294
8331
  }
8295
- let t21;
8296
- if ($[48] !== onContinue) {
8297
- t21 = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, { variant: "text", onClick: () => onContinue(), className: "my-2", children: "Continue from scratch" }) });
8298
- $[48] = onContinue;
8299
- $[49] = t21;
8332
+ let t20;
8333
+ if ($[44] !== onContinue) {
8334
+ t20 = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, { variant: "text", onClick: () => onContinue(), className: "my-2", children: "Continue from scratch" }) });
8335
+ $[44] = onContinue;
8336
+ $[45] = t20;
8300
8337
  } else {
8301
- t21 = $[49];
8338
+ t20 = $[45];
8302
8339
  }
8303
- let t22;
8304
- if ($[50] !== t19 || $[51] !== t20 || $[52] !== t21 || $[53] !== t4 || $[54] !== t9) {
8305
- 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: [
8340
+ let t21;
8341
+ if ($[46] !== t18 || $[47] !== t19 || $[48] !== t20 || $[49] !== t4 || $[50] !== t8) {
8342
+ 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: [
8306
8343
  t3,
8307
8344
  t4,
8308
- t9,
8345
+ t8,
8346
+ t18,
8309
8347
  t19,
8310
- t20,
8311
- t21
8348
+ t20
8312
8349
  ] }) });
8313
- $[50] = t19;
8314
- $[51] = t20;
8315
- $[52] = t21;
8316
- $[53] = t4;
8317
- $[54] = t9;
8318
- $[55] = t22;
8350
+ $[46] = t18;
8351
+ $[47] = t19;
8352
+ $[48] = t20;
8353
+ $[49] = t4;
8354
+ $[50] = t8;
8355
+ $[51] = t21;
8319
8356
  } else {
8320
- t22 = $[55];
8357
+ t21 = $[51];
8321
8358
  }
8322
- return t22;
8359
+ return t21;
8323
8360
  }
8324
8361
  function TemplateButton(t0) {
8325
8362
  const $ = c(10);
@@ -9533,7 +9570,7 @@ const validateId = (value, isNewCollection, existingPaths, existingIds) => {
9533
9570
  const ConfigControllerContext = React__default.createContext({});
9534
9571
  const CollectionEditorContext = React__default.createContext({});
9535
9572
  const ConfigControllerProvider = React__default.memo(function ConfigControllerProvider2(t0) {
9536
- const $ = c(67);
9573
+ const $ = c(65);
9537
9574
  const {
9538
9575
  children,
9539
9576
  collectionConfigController,
@@ -9541,7 +9578,6 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
9541
9578
  reservedGroups,
9542
9579
  collectionInference,
9543
9580
  extraView,
9544
- getPathSuggestions,
9545
9581
  getUser,
9546
9582
  getData,
9547
9583
  onAnalyticsEvent
@@ -9662,26 +9698,24 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
9662
9698
  const createCollection = t3;
9663
9699
  const t4 = configPermissions ?? defaultConfigPermissions;
9664
9700
  let t5;
9665
- if ($[6] !== createCollection || $[7] !== editCollection || $[8] !== editProperty || $[9] !== getPathSuggestions || $[10] !== t4) {
9701
+ if ($[6] !== createCollection || $[7] !== editCollection || $[8] !== editProperty || $[9] !== t4) {
9666
9702
  t5 = {
9667
9703
  editCollection,
9668
9704
  createCollection,
9669
9705
  editProperty,
9670
- configPermissions: t4,
9671
- getPathSuggestions
9706
+ configPermissions: t4
9672
9707
  };
9673
9708
  $[6] = createCollection;
9674
9709
  $[7] = editCollection;
9675
9710
  $[8] = editProperty;
9676
- $[9] = getPathSuggestions;
9677
- $[10] = t4;
9678
- $[11] = t5;
9711
+ $[9] = t4;
9712
+ $[10] = t5;
9679
9713
  } else {
9680
- t5 = $[11];
9714
+ t5 = $[10];
9681
9715
  }
9682
9716
  const t6 = Boolean(currentDialog);
9683
9717
  let t7;
9684
- if ($[12] !== currentDialog || $[13] !== navigate || $[14] !== navigation) {
9718
+ if ($[11] !== currentDialog || $[12] !== navigate || $[13] !== navigation) {
9685
9719
  t7 = (collection_0) => {
9686
9720
  if (currentDialog?.redirect) {
9687
9721
  if (collection_0 && currentDialog?.isNewCollection && !currentDialog.parentCollectionIds.length) {
@@ -9691,29 +9725,28 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
9691
9725
  }
9692
9726
  setCurrentDialog(void 0);
9693
9727
  };
9694
- $[12] = currentDialog;
9695
- $[13] = navigate;
9696
- $[14] = navigation;
9697
- $[15] = t7;
9728
+ $[11] = currentDialog;
9729
+ $[12] = navigate;
9730
+ $[13] = navigation;
9731
+ $[14] = t7;
9698
9732
  } else {
9699
- t7 = $[15];
9733
+ t7 = $[14];
9700
9734
  }
9701
9735
  let t8;
9702
- if ($[16] !== collectionConfigController || $[17] !== collectionInference || $[18] !== currentDialog || $[19] !== extraView || $[20] !== getData || $[21] !== getPathSuggestions || $[22] !== getUser || $[23] !== reservedGroups || $[24] !== t6 || $[25] !== t7) {
9703
- t8 = /* @__PURE__ */ jsx(CollectionEditorDialog, { open: t6, configController: collectionConfigController, isNewCollection: false, collectionInference, ...currentDialog, getData, reservedGroups, extraView, pathSuggestions: getPathSuggestions, getUser, handleClose: t7 });
9704
- $[16] = collectionConfigController;
9705
- $[17] = collectionInference;
9706
- $[18] = currentDialog;
9707
- $[19] = extraView;
9708
- $[20] = getData;
9709
- $[21] = getPathSuggestions;
9710
- $[22] = getUser;
9711
- $[23] = reservedGroups;
9712
- $[24] = t6;
9713
- $[25] = t7;
9714
- $[26] = t8;
9736
+ if ($[15] !== collectionConfigController || $[16] !== collectionInference || $[17] !== currentDialog || $[18] !== extraView || $[19] !== getData || $[20] !== getUser || $[21] !== reservedGroups || $[22] !== t6 || $[23] !== t7) {
9737
+ t8 = /* @__PURE__ */ jsx(CollectionEditorDialog, { open: t6, configController: collectionConfigController, isNewCollection: false, collectionInference, ...currentDialog, getData, reservedGroups, extraView, getUser, handleClose: t7 });
9738
+ $[15] = collectionConfigController;
9739
+ $[16] = collectionInference;
9740
+ $[17] = currentDialog;
9741
+ $[18] = extraView;
9742
+ $[19] = getData;
9743
+ $[20] = getUser;
9744
+ $[21] = reservedGroups;
9745
+ $[22] = t6;
9746
+ $[23] = t7;
9747
+ $[24] = t8;
9715
9748
  } else {
9716
- t8 = $[26];
9749
+ t8 = $[24];
9717
9750
  }
9718
9751
  const t9 = Boolean(currentPropertyDialog);
9719
9752
  const t10 = Boolean(currentPropertyDialog?.propertyKey);
@@ -9721,21 +9754,21 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
9721
9754
  const t12 = !currentPropertyDialog ? false : !currentPropertyDialog?.propertyKey;
9722
9755
  const t13 = currentPropertyDialog?.collectionEditable ?? false;
9723
9756
  let t14;
9724
- if ($[27] !== currentPropertyDialog || $[28] !== getData || $[29] !== navigation) {
9757
+ if ($[25] !== currentPropertyDialog || $[26] !== getData || $[27] !== navigation) {
9725
9758
  t14 = getData && currentPropertyDialog?.editedCollectionId ? () => {
9726
9759
  console.debug("get data for property", currentPropertyDialog?.editedCollectionId);
9727
9760
  const resolvedPath = navigation.resolveIdsFrom(currentPropertyDialog.editedCollectionId);
9728
9761
  return getData(resolvedPath, []);
9729
9762
  } : void 0;
9730
- $[27] = currentPropertyDialog;
9731
- $[28] = getData;
9732
- $[29] = navigation;
9733
- $[30] = t14;
9763
+ $[25] = currentPropertyDialog;
9764
+ $[26] = getData;
9765
+ $[27] = navigation;
9766
+ $[28] = t14;
9734
9767
  } else {
9735
- t14 = $[30];
9768
+ t14 = $[28];
9736
9769
  }
9737
9770
  let t15;
9738
- if ($[31] !== collectionConfigController || $[32] !== currentPropertyDialog || $[33] !== snackbarController) {
9771
+ if ($[29] !== collectionConfigController || $[30] !== currentPropertyDialog || $[31] !== snackbarController) {
9739
9772
  t15 = (t162) => {
9740
9773
  const {
9741
9774
  id: id_0,
@@ -9764,15 +9797,15 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
9764
9797
  return false;
9765
9798
  });
9766
9799
  };
9767
- $[31] = collectionConfigController;
9768
- $[32] = currentPropertyDialog;
9769
- $[33] = snackbarController;
9770
- $[34] = t15;
9800
+ $[29] = collectionConfigController;
9801
+ $[30] = currentPropertyDialog;
9802
+ $[31] = snackbarController;
9803
+ $[32] = t15;
9771
9804
  } else {
9772
- t15 = $[34];
9805
+ t15 = $[32];
9773
9806
  }
9774
9807
  let t16;
9775
- if ($[35] !== collectionConfigController || $[36] !== currentPropertyDialog?.currentPropertiesOrder || $[37] !== currentPropertyDialog?.editedCollectionId || $[38] !== currentPropertyDialog?.namespace || $[39] !== currentPropertyDialog?.parentCollectionIds || $[40] !== currentPropertyDialog?.propertyKey || $[41] !== snackbarController) {
9808
+ if ($[33] !== collectionConfigController || $[34] !== currentPropertyDialog?.currentPropertiesOrder || $[35] !== currentPropertyDialog?.editedCollectionId || $[36] !== currentPropertyDialog?.namespace || $[37] !== currentPropertyDialog?.parentCollectionIds || $[38] !== currentPropertyDialog?.propertyKey || $[39] !== snackbarController) {
9776
9809
  t16 = () => {
9777
9810
  if (!currentPropertyDialog?.propertyKey) {
9778
9811
  return;
@@ -9795,21 +9828,21 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
9795
9828
  return false;
9796
9829
  });
9797
9830
  };
9798
- $[35] = collectionConfigController;
9799
- $[36] = currentPropertyDialog?.currentPropertiesOrder;
9800
- $[37] = currentPropertyDialog?.editedCollectionId;
9801
- $[38] = currentPropertyDialog?.namespace;
9802
- $[39] = currentPropertyDialog?.parentCollectionIds;
9803
- $[40] = currentPropertyDialog?.propertyKey;
9804
- $[41] = snackbarController;
9805
- $[42] = t16;
9831
+ $[33] = collectionConfigController;
9832
+ $[34] = currentPropertyDialog?.currentPropertiesOrder;
9833
+ $[35] = currentPropertyDialog?.editedCollectionId;
9834
+ $[36] = currentPropertyDialog?.namespace;
9835
+ $[37] = currentPropertyDialog?.parentCollectionIds;
9836
+ $[38] = currentPropertyDialog?.propertyKey;
9837
+ $[39] = snackbarController;
9838
+ $[40] = t16;
9806
9839
  } else {
9807
- t16 = $[42];
9840
+ t16 = $[40];
9808
9841
  }
9809
9842
  let t17;
9810
9843
  let t18;
9811
9844
  let t19;
9812
- if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
9845
+ if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
9813
9846
  t17 = () => {
9814
9847
  setCurrentPropertyDialog(void 0);
9815
9848
  };
@@ -9817,64 +9850,64 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
9817
9850
  setCurrentPropertyDialog(void 0);
9818
9851
  };
9819
9852
  t19 = {};
9820
- $[43] = t17;
9821
- $[44] = t18;
9822
- $[45] = t19;
9853
+ $[41] = t17;
9854
+ $[42] = t18;
9855
+ $[43] = t19;
9823
9856
  } else {
9824
- t17 = $[43];
9825
- t18 = $[44];
9826
- t19 = $[45];
9857
+ t17 = $[41];
9858
+ t18 = $[42];
9859
+ t19 = $[43];
9827
9860
  }
9828
9861
  let t20;
9829
- if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
9862
+ if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
9830
9863
  t20 = [];
9831
- $[46] = t20;
9864
+ $[44] = t20;
9832
9865
  } else {
9833
- t20 = $[46];
9866
+ t20 = $[44];
9834
9867
  }
9835
9868
  const t21 = currentPropertyDialog?.property;
9836
9869
  const t22 = currentPropertyDialog?.propertyKey;
9837
9870
  let t23;
9838
- if ($[47] !== propertyConfigs || $[48] !== t10 || $[49] !== t11 || $[50] !== t12 || $[51] !== t13 || $[52] !== t14 || $[53] !== t15 || $[54] !== t16 || $[55] !== t21 || $[56] !== t22 || $[57] !== t9) {
9871
+ if ($[45] !== propertyConfigs || $[46] !== t10 || $[47] !== t11 || $[48] !== t12 || $[49] !== t13 || $[50] !== t14 || $[51] !== t15 || $[52] !== t16 || $[53] !== t21 || $[54] !== t22 || $[55] !== t9) {
9839
9872
  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 });
9840
- $[47] = propertyConfigs;
9841
- $[48] = t10;
9842
- $[49] = t11;
9843
- $[50] = t12;
9844
- $[51] = t13;
9845
- $[52] = t14;
9846
- $[53] = t15;
9847
- $[54] = t16;
9848
- $[55] = t21;
9849
- $[56] = t22;
9850
- $[57] = t9;
9851
- $[58] = t23;
9852
- } else {
9853
- t23 = $[58];
9873
+ $[45] = propertyConfigs;
9874
+ $[46] = t10;
9875
+ $[47] = t11;
9876
+ $[48] = t12;
9877
+ $[49] = t13;
9878
+ $[50] = t14;
9879
+ $[51] = t15;
9880
+ $[52] = t16;
9881
+ $[53] = t21;
9882
+ $[54] = t22;
9883
+ $[55] = t9;
9884
+ $[56] = t23;
9885
+ } else {
9886
+ t23 = $[56];
9854
9887
  }
9855
9888
  let t24;
9856
- if ($[59] !== children || $[60] !== t23 || $[61] !== t5 || $[62] !== t8) {
9889
+ if ($[57] !== children || $[58] !== t23 || $[59] !== t5 || $[60] !== t8) {
9857
9890
  t24 = /* @__PURE__ */ jsxs(CollectionEditorContext.Provider, { value: t5, children: [
9858
9891
  children,
9859
9892
  t8,
9860
9893
  t23
9861
9894
  ] });
9862
- $[59] = children;
9863
- $[60] = t23;
9864
- $[61] = t5;
9865
- $[62] = t8;
9866
- $[63] = t24;
9895
+ $[57] = children;
9896
+ $[58] = t23;
9897
+ $[59] = t5;
9898
+ $[60] = t8;
9899
+ $[61] = t24;
9867
9900
  } else {
9868
- t24 = $[63];
9901
+ t24 = $[61];
9869
9902
  }
9870
9903
  let t25;
9871
- if ($[64] !== collectionConfigController || $[65] !== t24) {
9904
+ if ($[62] !== collectionConfigController || $[63] !== t24) {
9872
9905
  t25 = /* @__PURE__ */ jsx(ConfigControllerContext.Provider, { value: collectionConfigController, children: t24 });
9873
- $[64] = collectionConfigController;
9874
- $[65] = t24;
9875
- $[66] = t25;
9906
+ $[62] = collectionConfigController;
9907
+ $[63] = t24;
9908
+ $[64] = t25;
9876
9909
  } else {
9877
- t25 = $[66];
9910
+ t25 = $[64];
9878
9911
  }
9879
9912
  return t25;
9880
9913
  }, equal);
@@ -10489,21 +10522,22 @@ function NewCollectionCard(t0) {
10489
10522
  return t8;
10490
10523
  }
10491
10524
  function useCollectionEditorPlugin(t0) {
10492
- const $ = c(15);
10525
+ const $ = c(19);
10493
10526
  const {
10494
10527
  collectionConfigController,
10495
10528
  configPermissions,
10496
10529
  reservedGroups,
10497
10530
  extraView,
10498
- getPathSuggestions,
10499
10531
  getUser,
10500
10532
  collectionInference,
10501
10533
  getData,
10502
- onAnalyticsEvent
10534
+ onAnalyticsEvent,
10535
+ includeIntroView: t1
10503
10536
  } = t0;
10504
- let t1;
10505
- if ($[0] !== collectionConfigController || $[1] !== collectionInference || $[2] !== configPermissions || $[3] !== extraView || $[4] !== getData || $[5] !== getPathSuggestions || $[6] !== getUser || $[7] !== onAnalyticsEvent || $[8] !== reservedGroups) {
10506
- t1 = {
10537
+ const includeIntroView = t1 === void 0 ? true : t1;
10538
+ let t2;
10539
+ if ($[0] !== collectionConfigController || $[1] !== collectionInference || $[2] !== configPermissions || $[3] !== extraView || $[4] !== getData || $[5] !== getUser || $[6] !== onAnalyticsEvent || $[7] !== reservedGroups) {
10540
+ t2 = {
10507
10541
  Component: ConfigControllerProvider,
10508
10542
  props: {
10509
10543
  collectionConfigController,
@@ -10511,7 +10545,6 @@ function useCollectionEditorPlugin(t0) {
10511
10545
  collectionInference,
10512
10546
  reservedGroups,
10513
10547
  extraView,
10514
- getPathSuggestions,
10515
10548
  getUser,
10516
10549
  getData,
10517
10550
  onAnalyticsEvent
@@ -10522,53 +10555,72 @@ function useCollectionEditorPlugin(t0) {
10522
10555
  $[2] = configPermissions;
10523
10556
  $[3] = extraView;
10524
10557
  $[4] = getData;
10525
- $[5] = getPathSuggestions;
10526
- $[6] = getUser;
10527
- $[7] = onAnalyticsEvent;
10528
- $[8] = reservedGroups;
10529
- $[9] = t1;
10558
+ $[5] = getUser;
10559
+ $[6] = onAnalyticsEvent;
10560
+ $[7] = reservedGroups;
10561
+ $[8] = t2;
10530
10562
  } else {
10531
- t1 = $[9];
10563
+ t2 = $[8];
10532
10564
  }
10533
- let t2;
10534
10565
  let t3;
10535
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
10536
- t2 = {
10537
- additionalActions: /* @__PURE__ */ jsx(NewCollectionButton, {}),
10538
- additionalChildrenStart: /* @__PURE__ */ jsx(IntroWidget, {}),
10566
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
10567
+ t3 = /* @__PURE__ */ jsx(NewCollectionButton, {});
10568
+ $[9] = t3;
10569
+ } else {
10570
+ t3 = $[9];
10571
+ }
10572
+ let t4;
10573
+ if ($[10] !== includeIntroView) {
10574
+ t4 = includeIntroView ? /* @__PURE__ */ jsx(IntroWidget, {}) : void 0;
10575
+ $[10] = includeIntroView;
10576
+ $[11] = t4;
10577
+ } else {
10578
+ t4 = $[11];
10579
+ }
10580
+ let t5;
10581
+ if ($[12] !== t4) {
10582
+ t5 = {
10583
+ additionalActions: t3,
10584
+ additionalChildrenStart: t4,
10539
10585
  CollectionActions: HomePageEditorCollectionAction,
10540
10586
  AdditionalCards: NewCollectionCard
10541
10587
  };
10542
- t3 = {
10588
+ $[12] = t4;
10589
+ $[13] = t5;
10590
+ } else {
10591
+ t5 = $[13];
10592
+ }
10593
+ let t6;
10594
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
10595
+ t6 = {
10543
10596
  CollectionActionsStart: EditorCollectionActionStart,
10544
10597
  CollectionActions: EditorCollectionAction,
10545
10598
  HeaderAction: CollectionViewHeaderAction,
10546
10599
  AddColumnComponent: PropertyAddColumnComponent
10547
10600
  };
10548
- $[10] = t2;
10549
- $[11] = t3;
10601
+ $[14] = t6;
10550
10602
  } else {
10551
- t2 = $[10];
10552
- t3 = $[11];
10603
+ t6 = $[14];
10553
10604
  }
10554
- let t4;
10555
- if ($[12] !== collectionConfigController.loading || $[13] !== t1) {
10556
- t4 = {
10605
+ let t7;
10606
+ if ($[15] !== collectionConfigController.loading || $[16] !== t2 || $[17] !== t5) {
10607
+ t7 = {
10557
10608
  key: "collection_editor",
10558
10609
  loading: collectionConfigController.loading,
10559
- provider: t1,
10560
- homePage: t2,
10561
- collectionView: t3
10610
+ provider: t2,
10611
+ homePage: t5,
10612
+ collectionView: t6
10562
10613
  };
10563
- $[12] = collectionConfigController.loading;
10564
- $[13] = t1;
10565
- $[14] = t4;
10614
+ $[15] = collectionConfigController.loading;
10615
+ $[16] = t2;
10616
+ $[17] = t5;
10617
+ $[18] = t7;
10566
10618
  } else {
10567
- t4 = $[14];
10619
+ t7 = $[18];
10568
10620
  }
10569
- return t4;
10621
+ return t7;
10570
10622
  }
10571
- function IntroWidget(t0) {
10623
+ function IntroWidget() {
10572
10624
  const $ = c(11);
10573
10625
  const navigation = useNavigationController();
10574
10626
  if (!navigation.topLevelNavigation) {
@@ -10576,35 +10628,35 @@ function IntroWidget(t0) {
10576
10628
  }
10577
10629
  const authController = useAuthController();
10578
10630
  const collectionEditorController = useCollectionEditorController();
10579
- let t1;
10631
+ let t0;
10580
10632
  if ($[0] !== authController || $[1] !== collectionEditorController) {
10581
- t1 = collectionEditorController.configPermissions ? collectionEditorController.configPermissions({
10633
+ t0 = collectionEditorController.configPermissions ? collectionEditorController.configPermissions({
10582
10634
  user: authController.user
10583
10635
  }).createCollections : true;
10584
10636
  $[0] = authController;
10585
10637
  $[1] = collectionEditorController;
10586
- $[2] = t1;
10638
+ $[2] = t0;
10587
10639
  } else {
10588
- t1 = $[2];
10640
+ t0 = $[2];
10589
10641
  }
10590
- const canCreateCollections = t1;
10642
+ const canCreateCollections = t0;
10591
10643
  if (!navigation.initialised || (navigation.collections ?? []).length > 0) {
10592
10644
  return null;
10593
10645
  }
10646
+ let t1;
10594
10647
  let t2;
10595
- let t3;
10596
10648
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
10597
- t2 = /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "uppercase", children: "No collections found" });
10598
- 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." });
10599
- $[3] = t2;
10600
- $[4] = t3;
10649
+ t1 = /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "uppercase", children: "No collections found" });
10650
+ 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." });
10651
+ $[3] = t1;
10652
+ $[4] = t2;
10601
10653
  } else {
10602
- t2 = $[3];
10603
- t3 = $[4];
10654
+ t1 = $[3];
10655
+ t2 = $[4];
10604
10656
  }
10605
- let t4;
10657
+ let t3;
10606
10658
  if ($[5] !== canCreateCollections || $[6] !== collectionEditorController) {
10607
- t4 = canCreateCollections && /* @__PURE__ */ jsxs(Button, { onClick: collectionEditorController && canCreateCollections ? () => collectionEditorController.createCollection({
10659
+ t3 = canCreateCollections && /* @__PURE__ */ jsxs(Button, { onClick: collectionEditorController && canCreateCollections ? () => collectionEditorController.createCollection({
10608
10660
  parentCollectionIds: [],
10609
10661
  redirect: true,
10610
10662
  sourceClick: "new_collection_card"
@@ -10614,31 +10666,31 @@ function IntroWidget(t0) {
10614
10666
  ] });
10615
10667
  $[5] = canCreateCollections;
10616
10668
  $[6] = collectionEditorController;
10617
- $[7] = t4;
10669
+ $[7] = t3;
10618
10670
  } else {
10619
- t4 = $[7];
10671
+ t3 = $[7];
10620
10672
  }
10621
- let t5;
10673
+ let t4;
10622
10674
  if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
10623
- t5 = /* @__PURE__ */ jsx(Typography, { color: "secondary", children: "You can also define collections programmatically." });
10624
- $[8] = t5;
10675
+ t4 = /* @__PURE__ */ jsx(Typography, { color: "secondary", children: "You can also define collections programmatically." });
10676
+ $[8] = t4;
10625
10677
  } else {
10626
- t5 = $[8];
10678
+ t4 = $[8];
10627
10679
  }
10628
- let t6;
10629
- if ($[9] !== t4) {
10630
- t6 = /* @__PURE__ */ jsxs(Paper, { className: "my-4 px-4 py-6 flex flex-col bg-white dark:bg-surface-accent-800 gap-2", children: [
10680
+ let t5;
10681
+ if ($[9] !== t3) {
10682
+ t5 = /* @__PURE__ */ jsxs(Paper, { className: "my-4 px-4 py-6 flex flex-col bg-white dark:bg-surface-accent-800 gap-2", children: [
10683
+ t1,
10631
10684
  t2,
10632
10685
  t3,
10633
- t4,
10634
- t5
10686
+ t4
10635
10687
  ] });
10636
- $[9] = t4;
10637
- $[10] = t6;
10688
+ $[9] = t3;
10689
+ $[10] = t5;
10638
10690
  } else {
10639
- t6 = $[10];
10691
+ t5 = $[10];
10640
10692
  }
10641
- return t6;
10693
+ return t5;
10642
10694
  }
10643
10695
  const mergeCollections = (baseCollections, backendCollections = [], modifyCollection) => {
10644
10696
  const markAsEditable = (c2) => {