@firecms/collection_editor 3.0.0-canary.240 → 3.0.0-canary.242

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/README.md CHANGED
@@ -1 +1,165 @@
1
- ## Collection editor plugin
1
+ # FireCMS Collection Editor Plugin
2
+
3
+ This plugin enables creating and managing Firestore collections directly from your FireCMS interface. It adds a visual
4
+ collection editor that allows you to create, edit, and delete collections without writing code.
5
+
6
+ ## Installation
7
+
8
+ ```bash
9
+ npm install @firecms/collection_editor
10
+ # or
11
+ yarn add @firecms/collection_editor
12
+ ```
13
+
14
+ For Firebase integration, also install:
15
+
16
+ ```bash
17
+ npm install @firecms/collection_editor_firebase
18
+ # or
19
+ yarn add @firecms/collection_editor_firebase
20
+ ```
21
+
22
+ ## Features
23
+
24
+ - Create and edit collections through a visual interface
25
+ - Define properties, validations, and display options
26
+ - Organize collections with groups and subcollections
27
+ - Merge UI-defined collections with code-defined collections
28
+ - Persist collection configurations in Firestore
29
+ - Control permissions for collection editing operations
30
+
31
+ ## Basic Usage
32
+
33
+ ```tsx
34
+ import React from "react";
35
+ import { FireCMS } from "@firecms/core";
36
+ import { useCollectionEditorPlugin } from "@firecms/collection_editor";
37
+ import { useFirestoreCollectionsConfigController } from "@firecms/collection_editor_firebase";
38
+
39
+ export default function App() {
40
+ // Controller to save collection configs in Firestore
41
+ const collectionConfigController = useFirestoreCollectionsConfigController({
42
+ firebaseApp
43
+ });
44
+
45
+ // Initialize the collection editor plugin
46
+ const collectionEditorPlugin = useCollectionEditorPlugin({
47
+ collectionConfigController
48
+ });
49
+
50
+ const navigationController = useBuildNavigationController({
51
+ // Your other config options
52
+ plugins: [collectionEditorPlugin]
53
+ });
54
+
55
+ return <FireCMS
56
+ name={"My CMS"}
57
+ navigationController={navigationController}
58
+ authentication={myAuthenticator}
59
+ firebaseConfig={firebaseConfig}
60
+ />;
61
+ }
62
+ ```
63
+
64
+ ## Advanced Configuration
65
+
66
+ You can customize collection editor behavior with these options:
67
+
68
+ ```tsx
69
+ const collectionEditorPlugin = useCollectionEditorPlugin({
70
+ collectionConfigController, // Required: controller that handles persistence
71
+
72
+ // Define permissions for collection operations
73
+ configPermissions: ({ user }) => ({
74
+ createCollections: user.roles?.includes("admin") ?? false,
75
+ editCollections: user.roles?.includes("admin") ?? false,
76
+ deleteCollections: user.roles?.includes("admin") ?? false
77
+ }),
78
+
79
+ // Prevent these group names from being used
80
+ reservedGroups: ["admin", "system"],
81
+
82
+ // Optional custom view to add to the editor
83
+ extraView: {
84
+ View: MyCustomView,
85
+ icon: <CustomIcon />
86
+ },
87
+
88
+ // Function to infer collection structure from existing data
89
+ collectionInference: async ({ path }) => {
90
+ // Return inferred schema based on data at path
91
+ },
92
+
93
+ // Function to get sample data for a collection
94
+ getData: async (path, parentPaths) => {
95
+ // Return sample data for the specified path
96
+ },
97
+
98
+ // Track collection editor events
99
+ onAnalyticsEvent: (event, params) => {
100
+ console.log("Collection editor event:", event, params);
101
+ },
102
+
103
+ // Include introduction widget when no collections exist
104
+ includeIntroView: true
105
+ });
106
+ ```
107
+
108
+ ## Integration with Code-Defined Collections
109
+
110
+ You can combine collections defined in code with those created in the UI:
111
+
112
+ ```tsx
113
+ import { mergeCollections } from "@firecms/collection_editor";
114
+
115
+ const collectionsBuilder = useCallback(() => {
116
+ // Collections defined in code
117
+ const codeCollections = [productsCollection, ordersCollection];
118
+
119
+ // Merge with collections from the editor UI
120
+ return mergeCollections(codeCollections, collectionConfigController.collections ?? []);
121
+ }, [collectionConfigController.collections]);
122
+
123
+ const navigationController = useBuildNavigationController({
124
+ collections: collectionsBuilder,
125
+ // Other options
126
+ });
127
+ ```
128
+
129
+ ## Firestore Configuration Controller
130
+
131
+ To persist collections in Firestore:
132
+
133
+ ```tsx
134
+ const collectionConfigController = useFirestoreCollectionsConfigController({
135
+ firebaseApp,
136
+
137
+ // Optional: specify where to save configs (default: "__FIRECMS/config/collections")
138
+ configPath: "custom/config/path",
139
+
140
+ // Optional: define permissions for collections
141
+ permissions: ({ user }) => ({
142
+ // Your permissions logic
143
+ }),
144
+
145
+ // Optional: custom property configurations
146
+ propertyConfigs: [
147
+ // Custom property types
148
+ ]
149
+ });
150
+ ```
151
+
152
+ ## Additional Notes
153
+
154
+ - Collections created through the editor are stored in Firestore and loaded dynamically
155
+ - The plugin automatically adds UI elements for creating and managing collections
156
+ - For a complete solution, consider using alongside other plugins like data import/export
157
+
158
+ ## Related Plugins
159
+
160
+ FireCMS offers several complementary plugins:
161
+
162
+ - Data Import: Import data from CSV or JSON into Firestore collections
163
+ - Data Export: Export collection data to CSV or JSON formats
164
+ - Data Enhancement: Generate content using AI for your collections
165
+ - Entity History: Track changes to your collection entities
package/dist/index.es.js CHANGED
@@ -162,7 +162,7 @@ function LayoutModeSwitch(t0) {
162
162
  return t18;
163
163
  }
164
164
  function CollectionDetailsForm(t0) {
165
- const $ = c(186);
165
+ const $ = c(196);
166
166
  const {
167
167
  isNewCollection,
168
168
  reservedGroups,
@@ -444,7 +444,7 @@ function CollectionDetailsForm(t0) {
444
444
  }
445
445
  const t37 = !isSubcollection && /* @__PURE__ */ jsxs("div", { className: "col-span-12 sm:col-span-4 relative", children: [
446
446
  /* @__PURE__ */ jsx(TextField, { error: showErrors && Boolean(errors.group), disabled: isSubmitting, value: values.group ?? "", autoComplete: "off", onChange: (event) => setFieldValue("group", event.target.value), name: "group", inputRef: groupRef, label: "Group" }),
447
- /* @__PURE__ */ jsx(Autocomplete, { open: autoCompleteOpen && (groupOptions ?? []).length > 0, setOpen: setAutoCompleteOpen, children: groupOptions?.map((group_0, index) => /* @__PURE__ */ jsx(AutocompleteItem, { onClick: () => {
447
+ /* @__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
448
  setAutoCompleteOpen(false);
449
449
  setFieldValue("group", group_0 ?? null);
450
450
  }, children: /* @__PURE__ */ jsx("div", { className: "flex-grow", children: group_0 }) }, index + "_" + group_0)) }),
@@ -468,7 +468,7 @@ function CollectionDetailsForm(t0) {
468
468
  } else {
469
469
  t40 = $[58];
470
470
  }
471
- const t41 = values.history === null ? "Document history revisions enabled if enabled globally" : values.history ? "Document history revisions ENABLED" : "Document history revisions NOT enabled";
471
+ 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";
472
472
  let t42;
473
473
  if ($[59] !== setFieldValue) {
474
474
  t42 = (v) => setFieldValue("history", v);
@@ -477,7 +477,7 @@ function CollectionDetailsForm(t0) {
477
477
  } else {
478
478
  t42 = $[60];
479
479
  }
480
- const t43 = values.history ?? null;
480
+ const t43 = values.history === void 0 ? null : values.history;
481
481
  let t44;
482
482
  if ($[61] !== t41 || $[62] !== t42 || $[63] !== t43) {
483
483
  t44 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", allowIndeterminate: true, label: t41, onValueChange: t42, value: t43 });
@@ -735,242 +735,282 @@ function CollectionDetailsForm(t0) {
735
735
  } else {
736
736
  t84 = $[124];
737
737
  }
738
- const t85 = customIdValue === "code_defined";
738
+ const t85 = values.includeJsonView === void 0 || values.includeJsonView ? "Include JSON view" : "Do not include JSON view";
739
739
  let t86;
740
740
  if ($[125] !== setFieldValue) {
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
- };
741
+ t86 = (v_0) => setFieldValue("includeJsonView", v_0);
747
742
  $[125] = setFieldValue;
748
743
  $[126] = t86;
749
744
  } else {
750
745
  t86 = $[126];
751
746
  }
752
- const t87 = customIdValue ?? "";
747
+ const t87 = values.includeJsonView === void 0 ? true : values.includeJsonView;
753
748
  let t88;
749
+ if ($[127] !== t85 || $[128] !== t86 || $[129] !== t87) {
750
+ t88 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: t85, onValueChange: t86, value: t87 });
751
+ $[127] = t85;
752
+ $[128] = t86;
753
+ $[129] = t87;
754
+ $[130] = t88;
755
+ } else {
756
+ t88 = $[130];
757
+ }
754
758
  let t89;
759
+ if ($[131] === Symbol.for("react.memo_cache_sentinel")) {
760
+ t89 = /* @__PURE__ */ jsx(FieldCaption, { children: "Include the JSON representation of the document." });
761
+ $[131] = t89;
762
+ } else {
763
+ t89 = $[131];
764
+ }
755
765
  let t90;
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: [
766
+ if ($[132] !== t88) {
767
+ t90 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
771
768
  t88,
772
- t89,
773
- t90
774
- ] }) });
775
- $[130] = t85;
776
- $[131] = t86;
777
- $[132] = t87;
778
- $[133] = t91;
769
+ t89
770
+ ] });
771
+ $[132] = t88;
772
+ $[133] = t90;
779
773
  } else {
780
- t91 = $[133];
774
+ t90 = $[133];
781
775
  }
776
+ const t91 = customIdValue === "code_defined";
782
777
  let t92;
783
778
  if ($[134] !== setFieldValue) {
784
- t92 = (v_1) => setFieldValue("collectionGroup", v_1);
779
+ t92 = (v_1) => {
780
+ if (v_1 === "code_defined") {
781
+ throw new Error("This should not happen");
782
+ }
783
+ setFieldValue("customId", v_1);
784
+ };
785
785
  $[134] = setFieldValue;
786
786
  $[135] = t92;
787
787
  } else {
788
788
  t92 = $[135];
789
789
  }
790
- const t93 = values.collectionGroup ?? false;
790
+ const t93 = customIdValue ?? "";
791
791
  let t94;
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;
796
- $[138] = t94;
797
- } else {
798
- t94 = $[138];
799
- }
800
792
  let 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;
804
- } else {
805
- t95 = $[139];
806
- }
807
793
  let t96;
808
- if ($[140] !== t94) {
809
- t96 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-4", children: [
794
+ if ($[136] === Symbol.for("react.memo_cache_sentinel")) {
795
+ t94 = /* @__PURE__ */ jsx(SelectItem, { value: "false", children: "Document ID is generated automatically" });
796
+ t95 = /* @__PURE__ */ jsx(SelectItem, { value: "true", children: "Users must define an ID" });
797
+ t96 = /* @__PURE__ */ jsx(SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
798
+ $[136] = t94;
799
+ $[137] = t95;
800
+ $[138] = t96;
801
+ } else {
802
+ t94 = $[136];
803
+ t95 = $[137];
804
+ t96 = $[138];
805
+ }
806
+ let t97;
807
+ if ($[139] !== t91 || $[140] !== t92 || $[141] !== t93) {
808
+ 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: [
810
809
  t94,
811
- t95
812
- ] });
813
- $[140] = t94;
814
- $[141] = t96;
810
+ t95,
811
+ t96
812
+ ] }) });
813
+ $[139] = t91;
814
+ $[140] = t92;
815
+ $[141] = t93;
816
+ $[142] = t97;
815
817
  } else {
816
- t96 = $[141];
818
+ t97 = $[142];
817
819
  }
818
- let 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;
820
+ let t98;
821
+ if ($[143] !== setFieldValue) {
822
+ t98 = (v_2) => setFieldValue("collectionGroup", v_2);
823
+ $[143] = setFieldValue;
824
+ $[144] = t98;
833
825
  } else {
834
- t99 = $[146];
826
+ t98 = $[144];
835
827
  }
828
+ const t99 = values.collectionGroup ?? false;
836
829
  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." });
830
+ if ($[145] !== t98 || $[146] !== t99) {
831
+ t100 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Collection group", onValueChange: t98, value: t99 });
832
+ $[145] = t98;
833
+ $[146] = t99;
839
834
  $[147] = t100;
840
835
  } else {
841
836
  t100 = $[147];
842
837
  }
843
838
  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;
839
+ if ($[148] === Symbol.for("react.memo_cache_sentinel")) {
840
+ 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." });
841
+ $[148] = t101;
851
842
  } else {
852
- t101 = $[149];
843
+ t101 = $[148];
853
844
  }
854
845
  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: [
846
+ if ($[149] !== t100) {
847
+ t102 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-4", children: [
848
+ t100,
849
+ t101
850
+ ] });
851
+ $[149] = t100;
852
+ $[150] = t102;
853
+ } else {
854
+ t102 = $[150];
855
+ }
856
+ let t103;
857
+ if ($[151] !== setFieldValue) {
858
+ t103 = (v_3) => setFieldValue("textSearchEnabled", v_3);
859
+ $[151] = setFieldValue;
860
+ $[152] = t103;
861
+ } else {
862
+ t103 = $[152];
863
+ }
864
+ const t104 = values.textSearchEnabled ?? false;
865
+ let t105;
866
+ if ($[153] !== t103 || $[154] !== t104) {
867
+ t105 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Enable text search for this collection", onValueChange: t103, value: t104 });
868
+ $[153] = t103;
869
+ $[154] = t104;
870
+ $[155] = t105;
871
+ } else {
872
+ t105 = $[155];
873
+ }
874
+ let t106;
875
+ if ($[156] === Symbol.for("react.memo_cache_sentinel")) {
876
+ 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." });
877
+ $[156] = t106;
878
+ } else {
879
+ t106 = $[156];
880
+ }
881
+ let t107;
882
+ if ($[157] !== t105) {
883
+ t107 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
884
+ t105,
885
+ t106
886
+ ] });
887
+ $[157] = t105;
888
+ $[158] = t107;
889
+ } else {
890
+ t107 = $[158];
891
+ }
892
+ let t108;
893
+ if ($[159] !== t102 || $[160] !== t107 || $[161] !== t54 || $[162] !== t62 || $[163] !== t74 || $[164] !== t81 || $[165] !== t84 || $[166] !== t90 || $[167] !== t97) {
894
+ t108 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
857
895
  t54,
858
896
  t62,
859
897
  t74,
860
898
  t81,
861
899
  t84,
862
- t91,
863
- t96,
864
- t101
900
+ t90,
901
+ t97,
902
+ t102,
903
+ t107
865
904
  ] });
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];
905
+ $[159] = t102;
906
+ $[160] = t107;
907
+ $[161] = t54;
908
+ $[162] = t62;
909
+ $[163] = t74;
910
+ $[164] = t81;
911
+ $[165] = t84;
912
+ $[166] = t90;
913
+ $[167] = t97;
914
+ $[168] = t108;
915
+ } else {
916
+ t108 = $[168];
877
917
  }
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,
918
+ let t109;
919
+ if ($[169] !== advancedPanelExpanded || $[170] !== t108) {
920
+ t109 = /* @__PURE__ */ jsx(ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t47, initiallyExpanded: false, children: t108 });
921
+ $[169] = advancedPanelExpanded;
922
+ $[170] = t108;
923
+ $[171] = t109;
924
+ } else {
925
+ t109 = $[171];
926
+ }
927
+ let t110;
928
+ if ($[172] !== children || $[173] !== t109) {
929
+ t110 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-8", children: [
930
+ t109,
891
931
  children
892
932
  ] });
893
- $[162] = children;
894
- $[163] = t103;
895
- $[164] = t104;
933
+ $[172] = children;
934
+ $[173] = t109;
935
+ $[174] = t110;
896
936
  } else {
897
- t104 = $[164];
937
+ t110 = $[174];
898
938
  }
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: [
939
+ let t111;
940
+ if ($[175] !== t110 || $[176] !== t27 || $[177] !== t36 || $[178] !== t37 || $[179] !== t40 || $[180] !== t46) {
941
+ t111 = /* @__PURE__ */ jsxs("div", { className: t19, children: [
902
942
  t27,
903
943
  t36,
904
944
  t37,
905
945
  t40,
906
946
  t46,
907
- t104
947
+ t110
908
948
  ] });
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: {
949
+ $[175] = t110;
950
+ $[176] = t27;
951
+ $[177] = t36;
952
+ $[178] = t37;
953
+ $[179] = t40;
954
+ $[180] = t46;
955
+ $[181] = t111;
956
+ } else {
957
+ t111 = $[181];
958
+ }
959
+ let t112;
960
+ if ($[182] === Symbol.for("react.memo_cache_sentinel")) {
961
+ t112 = /* @__PURE__ */ jsx("div", { style: {
922
962
  height: "52px"
923
963
  } });
924
- $[172] = t106;
964
+ $[182] = t112;
925
965
  } else {
926
- t106 = $[172];
966
+ t112 = $[182];
927
967
  }
928
- let t107;
929
- if ($[173] !== setFieldValue) {
930
- t107 = (icon) => {
968
+ let t113;
969
+ if ($[183] !== setFieldValue) {
970
+ t113 = (icon) => {
931
971
  setIconDialogOpen(false);
932
972
  setFieldValue("icon", icon);
933
973
  };
934
- $[173] = setFieldValue;
935
- $[174] = t107;
974
+ $[183] = setFieldValue;
975
+ $[184] = t113;
936
976
  } else {
937
- t107 = $[174];
977
+ t113 = $[184];
938
978
  }
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;
979
+ let t114;
980
+ if ($[185] !== t113 || $[186] !== values.icon) {
981
+ t114 = /* @__PURE__ */ jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsx(SearchIconsView, { selectedIcon: values.icon, onIconSelected: t113 }) });
982
+ $[185] = t113;
983
+ $[186] = values.icon;
984
+ $[187] = t114;
945
985
  } else {
946
- t108 = $[177];
986
+ t114 = $[187];
947
987
  }
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;
988
+ let t115;
989
+ if ($[188] !== iconDialogOpen || $[189] !== t114) {
990
+ t115 = /* @__PURE__ */ jsx(Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t114 });
991
+ $[188] = iconDialogOpen;
992
+ $[189] = t114;
993
+ $[190] = t115;
954
994
  } else {
955
- t109 = $[180];
995
+ t115 = $[190];
956
996
  }
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: [
997
+ let t116;
998
+ if ($[191] !== T0 || $[192] !== t111 || $[193] !== t115 || $[194] !== t18) {
999
+ t116 = /* @__PURE__ */ jsx("div", { className: t7, children: /* @__PURE__ */ jsxs(T0, { maxWidth: t8, className: t9, children: [
960
1000
  t18,
961
- t105,
962
- t106,
963
- t109
1001
+ t111,
1002
+ t112,
1003
+ t115
964
1004
  ] }) });
965
- $[181] = T0;
966
- $[182] = t105;
967
- $[183] = t109;
968
- $[184] = t18;
969
- $[185] = t110;
1005
+ $[191] = T0;
1006
+ $[192] = t111;
1007
+ $[193] = t115;
1008
+ $[194] = t18;
1009
+ $[195] = t116;
970
1010
  } else {
971
- t110 = $[185];
1011
+ t116 = $[195];
972
1012
  }
973
- return t110;
1013
+ return t116;
974
1014
  }
975
1015
  function _temp3$4(value_3) {
976
1016
  if (value_3 === "code_defined") {
@@ -7014,8 +7054,8 @@ function CollectionPropertiesEditorForm({
7014
7054
  setSelectedPropertyKey(propertyKey_2);
7015
7055
  setSelectedPropertyNamespace(namespace_5);
7016
7056
  };
7017
- const body = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-2 h-full bg-surface-50 dark:bg-surface-900", children: [
7018
- /* @__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: [
7057
+ const body = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-2 h-full bg-white dark:bg-surface-950", children: [
7058
+ /* @__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: [
7019
7059
  /* @__PURE__ */ jsxs("div", { className: "flex my-2", children: [
7020
7060
  /* @__PURE__ */ jsxs("div", { className: "flex-grow mb-4", children: [
7021
7061
  /* @__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) }),
@@ -7034,7 +7074,7 @@ function CollectionPropertiesEditorForm({
7034
7074
  /* @__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 }) }),
7035
7075
  /* @__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" })
7036
7076
  ] }),
7037
- !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: [
7077
+ !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: [
7038
7078
  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}`),
7039
7079
  !selectedProperty && /* @__PURE__ */ jsxs("div", { className: "w-full flex flex-col items-center justify-center h-full gap-4", children: [
7040
7080
  /* @__PURE__ */ jsx(Typography, { variant: "label", className: "", children: emptyCollection ? "Now you can add your first property" : "Select a property to edit it" }),