@firecms/collection_editor 3.0.0-rc.1 → 3.0.0-rc.3

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
@@ -165,7 +165,7 @@ function LayoutModeSwitch(t0) {
165
165
  return t18;
166
166
  }
167
167
  function CollectionDetailsForm(t0) {
168
- const $ = c(192);
168
+ const $ = c(202);
169
169
  const {
170
170
  isNewCollection,
171
171
  reservedGroups,
@@ -756,242 +756,282 @@ function CollectionDetailsForm(t0) {
756
756
  } else {
757
757
  t84 = $[131];
758
758
  }
759
- const t85 = customIdValue === "code_defined";
759
+ const t85 = values.inlineEditing === void 0 || values.inlineEditing ? "Data can be edited directly in the table view" : "Data can be edited only in the form view";
760
760
  let t86;
761
761
  if ($[132] !== setFieldValue) {
762
- t86 = (v_1) => {
763
- if (v_1 === "code_defined") {
764
- throw new Error("This should not happen");
765
- }
766
- setFieldValue("customId", v_1);
767
- };
762
+ t86 = (v_1) => setFieldValue("inlineEditing", v_1);
768
763
  $[132] = setFieldValue;
769
764
  $[133] = t86;
770
765
  } else {
771
766
  t86 = $[133];
772
767
  }
773
- const t87 = customIdValue ?? "";
768
+ const t87 = values.inlineEditing === void 0 ? true : values.inlineEditing;
774
769
  let t88;
770
+ if ($[134] !== t85 || $[135] !== t86 || $[136] !== t87) {
771
+ t88 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: t85, onValueChange: t86, value: t87 });
772
+ $[134] = t85;
773
+ $[135] = t86;
774
+ $[136] = t87;
775
+ $[137] = t88;
776
+ } else {
777
+ t88 = $[137];
778
+ }
775
779
  let t89;
780
+ if ($[138] === Symbol.for("react.memo_cache_sentinel")) {
781
+ t89 = /* @__PURE__ */ jsx(FieldCaption, { children: "Allow editing data directly in the table view, without opening the form view." });
782
+ $[138] = t89;
783
+ } else {
784
+ t89 = $[138];
785
+ }
776
786
  let t90;
777
- if ($[134] === Symbol.for("react.memo_cache_sentinel")) {
778
- t88 = /* @__PURE__ */ jsx(SelectItem, { value: "false", children: "Document ID is generated automatically" });
779
- t89 = /* @__PURE__ */ jsx(SelectItem, { value: "true", children: "Users must define an ID" });
780
- t90 = /* @__PURE__ */ jsx(SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
781
- $[134] = t88;
782
- $[135] = t89;
783
- $[136] = t90;
784
- } else {
785
- t88 = $[134];
786
- t89 = $[135];
787
- t90 = $[136];
788
- }
789
- let t91;
790
- if ($[137] !== t85 || $[138] !== t86 || $[139] !== t87) {
791
- 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$5, children: [
787
+ if ($[139] !== t88) {
788
+ t90 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
792
789
  t88,
793
- t89,
794
- t90
795
- ] }) });
796
- $[137] = t85;
797
- $[138] = t86;
798
- $[139] = t87;
799
- $[140] = t91;
790
+ t89
791
+ ] });
792
+ $[139] = t88;
793
+ $[140] = t90;
800
794
  } else {
801
- t91 = $[140];
795
+ t90 = $[140];
802
796
  }
797
+ const t91 = customIdValue === "code_defined";
803
798
  let t92;
804
799
  if ($[141] !== setFieldValue) {
805
- t92 = (v_2) => setFieldValue("collectionGroup", v_2);
800
+ t92 = (v_2) => {
801
+ if (v_2 === "code_defined") {
802
+ throw new Error("This should not happen");
803
+ }
804
+ setFieldValue("customId", v_2);
805
+ };
806
806
  $[141] = setFieldValue;
807
807
  $[142] = t92;
808
808
  } else {
809
809
  t92 = $[142];
810
810
  }
811
- const t93 = values.collectionGroup ?? false;
811
+ const t93 = customIdValue ?? "";
812
812
  let t94;
813
- if ($[143] !== t92 || $[144] !== t93) {
814
- t94 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Collection group", onValueChange: t92, value: t93 });
815
- $[143] = t92;
816
- $[144] = t93;
817
- $[145] = t94;
818
- } else {
819
- t94 = $[145];
820
- }
821
813
  let t95;
822
- if ($[146] === Symbol.for("react.memo_cache_sentinel")) {
823
- 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." });
824
- $[146] = t95;
825
- } else {
826
- t95 = $[146];
827
- }
828
814
  let t96;
829
- if ($[147] !== t94) {
830
- t96 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-4", children: [
815
+ if ($[143] === Symbol.for("react.memo_cache_sentinel")) {
816
+ t94 = /* @__PURE__ */ jsx(SelectItem, { value: "false", children: "Document ID is generated automatically" });
817
+ t95 = /* @__PURE__ */ jsx(SelectItem, { value: "true", children: "Users must define an ID" });
818
+ t96 = /* @__PURE__ */ jsx(SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
819
+ $[143] = t94;
820
+ $[144] = t95;
821
+ $[145] = t96;
822
+ } else {
823
+ t94 = $[143];
824
+ t95 = $[144];
825
+ t96 = $[145];
826
+ }
827
+ let t97;
828
+ if ($[146] !== t91 || $[147] !== t92 || $[148] !== t93) {
829
+ 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$5, children: [
831
830
  t94,
832
- t95
833
- ] });
834
- $[147] = t94;
835
- $[148] = t96;
831
+ t95,
832
+ t96
833
+ ] }) });
834
+ $[146] = t91;
835
+ $[147] = t92;
836
+ $[148] = t93;
837
+ $[149] = t97;
836
838
  } else {
837
- t96 = $[148];
839
+ t97 = $[149];
838
840
  }
839
- let t97;
840
- if ($[149] !== setFieldValue) {
841
- t97 = (v_3) => setFieldValue("textSearchEnabled", v_3);
842
- $[149] = setFieldValue;
843
- $[150] = t97;
844
- } else {
845
- t97 = $[150];
846
- }
847
- const t98 = values.textSearchEnabled ?? false;
848
- let t99;
849
- if ($[151] !== t97 || $[152] !== t98) {
850
- t99 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Enable text search for this collection", onValueChange: t97, value: t98 });
851
- $[151] = t97;
852
- $[152] = t98;
853
- $[153] = t99;
841
+ let t98;
842
+ if ($[150] !== setFieldValue) {
843
+ t98 = (v_3) => setFieldValue("collectionGroup", v_3);
844
+ $[150] = setFieldValue;
845
+ $[151] = t98;
854
846
  } else {
855
- t99 = $[153];
847
+ t98 = $[151];
856
848
  }
849
+ const t99 = values.collectionGroup ?? false;
857
850
  let t100;
858
- if ($[154] === Symbol.for("react.memo_cache_sentinel")) {
859
- 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." });
851
+ if ($[152] !== t98 || $[153] !== t99) {
852
+ t100 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Collection group", onValueChange: t98, value: t99 });
853
+ $[152] = t98;
854
+ $[153] = t99;
860
855
  $[154] = t100;
861
856
  } else {
862
857
  t100 = $[154];
863
858
  }
864
859
  let t101;
865
- if ($[155] !== t99) {
866
- t101 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
867
- t99,
868
- t100
869
- ] });
870
- $[155] = t99;
871
- $[156] = t101;
860
+ if ($[155] === Symbol.for("react.memo_cache_sentinel")) {
861
+ 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." });
862
+ $[155] = t101;
872
863
  } else {
873
- t101 = $[156];
864
+ t101 = $[155];
874
865
  }
875
866
  let t102;
876
- if ($[157] !== t101 || $[158] !== t48 || $[159] !== t56 || $[160] !== t68 || $[161] !== t75 || $[162] !== t78 || $[163] !== t84 || $[164] !== t91 || $[165] !== t96) {
877
- t102 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
867
+ if ($[156] !== t100) {
868
+ t102 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-4", children: [
869
+ t100,
870
+ t101
871
+ ] });
872
+ $[156] = t100;
873
+ $[157] = t102;
874
+ } else {
875
+ t102 = $[157];
876
+ }
877
+ let t103;
878
+ if ($[158] !== setFieldValue) {
879
+ t103 = (v_4) => setFieldValue("textSearchEnabled", v_4);
880
+ $[158] = setFieldValue;
881
+ $[159] = t103;
882
+ } else {
883
+ t103 = $[159];
884
+ }
885
+ const t104 = values.textSearchEnabled ?? false;
886
+ let t105;
887
+ if ($[160] !== t103 || $[161] !== t104) {
888
+ t105 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Enable text search for this collection", onValueChange: t103, value: t104 });
889
+ $[160] = t103;
890
+ $[161] = t104;
891
+ $[162] = t105;
892
+ } else {
893
+ t105 = $[162];
894
+ }
895
+ let t106;
896
+ if ($[163] === Symbol.for("react.memo_cache_sentinel")) {
897
+ 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." });
898
+ $[163] = t106;
899
+ } else {
900
+ t106 = $[163];
901
+ }
902
+ let t107;
903
+ if ($[164] !== t105) {
904
+ t107 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
905
+ t105,
906
+ t106
907
+ ] });
908
+ $[164] = t105;
909
+ $[165] = t107;
910
+ } else {
911
+ t107 = $[165];
912
+ }
913
+ let t108;
914
+ if ($[166] !== t102 || $[167] !== t107 || $[168] !== t48 || $[169] !== t56 || $[170] !== t68 || $[171] !== t75 || $[172] !== t78 || $[173] !== t84 || $[174] !== t90 || $[175] !== t97) {
915
+ t108 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
878
916
  t48,
879
917
  t56,
880
918
  t68,
881
919
  t75,
882
920
  t78,
883
921
  t84,
884
- t91,
885
- t96,
886
- t101
922
+ t90,
923
+ t97,
924
+ t102,
925
+ t107
887
926
  ] });
888
- $[157] = t101;
889
- $[158] = t48;
890
- $[159] = t56;
891
- $[160] = t68;
892
- $[161] = t75;
893
- $[162] = t78;
894
- $[163] = t84;
895
- $[164] = t91;
896
- $[165] = t96;
897
927
  $[166] = t102;
928
+ $[167] = t107;
929
+ $[168] = t48;
930
+ $[169] = t56;
931
+ $[170] = t68;
932
+ $[171] = t75;
933
+ $[172] = t78;
934
+ $[173] = t84;
935
+ $[174] = t90;
936
+ $[175] = t97;
937
+ $[176] = t108;
938
+ } else {
939
+ t108 = $[176];
940
+ }
941
+ let t109;
942
+ if ($[177] !== advancedPanelExpanded || $[178] !== t108) {
943
+ t109 = /* @__PURE__ */ jsx(ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t41, initiallyExpanded: false, children: t108 });
944
+ $[177] = advancedPanelExpanded;
945
+ $[178] = t108;
946
+ $[179] = t109;
898
947
  } else {
899
- t102 = $[166];
948
+ t109 = $[179];
900
949
  }
901
- let t103;
902
- if ($[167] !== advancedPanelExpanded || $[168] !== t102) {
903
- t103 = /* @__PURE__ */ jsx(ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t41, initiallyExpanded: false, children: t102 });
904
- $[167] = advancedPanelExpanded;
905
- $[168] = t102;
906
- $[169] = t103;
907
- } else {
908
- t103 = $[169];
909
- }
910
- let t104;
911
- if ($[170] !== children || $[171] !== t103) {
912
- t104 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-8", children: [
913
- t103,
950
+ let t110;
951
+ if ($[180] !== children || $[181] !== t109) {
952
+ t110 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-8", children: [
953
+ t109,
914
954
  children
915
955
  ] });
916
- $[170] = children;
917
- $[171] = t103;
918
- $[172] = t104;
956
+ $[180] = children;
957
+ $[181] = t109;
958
+ $[182] = t110;
919
959
  } else {
920
- t104 = $[172];
960
+ t110 = $[182];
921
961
  }
922
- let t105;
923
- if ($[173] !== t104 || $[174] !== t23 || $[175] !== t31 || $[176] !== t34 || $[177] !== t40) {
924
- t105 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4", children: [
962
+ let t111;
963
+ if ($[183] !== t110 || $[184] !== t23 || $[185] !== t31 || $[186] !== t34 || $[187] !== t40) {
964
+ t111 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4", children: [
925
965
  t23,
926
966
  t31,
927
967
  t34,
928
968
  t40,
929
- t104
969
+ t110
930
970
  ] });
931
- $[173] = t104;
932
- $[174] = t23;
933
- $[175] = t31;
934
- $[176] = t34;
935
- $[177] = t40;
936
- $[178] = t105;
971
+ $[183] = t110;
972
+ $[184] = t23;
973
+ $[185] = t31;
974
+ $[186] = t34;
975
+ $[187] = t40;
976
+ $[188] = t111;
937
977
  } else {
938
- t105 = $[178];
978
+ t111 = $[188];
939
979
  }
940
- let t106;
941
- if ($[179] === Symbol.for("react.memo_cache_sentinel")) {
942
- t106 = /* @__PURE__ */ jsx("div", { style: {
980
+ let t112;
981
+ if ($[189] === Symbol.for("react.memo_cache_sentinel")) {
982
+ t112 = /* @__PURE__ */ jsx("div", { style: {
943
983
  height: "52px"
944
984
  } });
945
- $[179] = t106;
985
+ $[189] = t112;
946
986
  } else {
947
- t106 = $[179];
987
+ t112 = $[189];
948
988
  }
949
- const t107 = typeof values.icon === "string" ? values.icon : void 0;
950
- let t108;
951
- if ($[180] !== setFieldValue) {
952
- t108 = (icon) => {
989
+ const t113 = typeof values.icon === "string" ? values.icon : void 0;
990
+ let t114;
991
+ if ($[190] !== setFieldValue) {
992
+ t114 = (icon) => {
953
993
  setIconDialogOpen(false);
954
994
  setFieldValue("icon", icon);
955
995
  };
956
- $[180] = setFieldValue;
957
- $[181] = t108;
996
+ $[190] = setFieldValue;
997
+ $[191] = t114;
958
998
  } else {
959
- t108 = $[181];
999
+ t114 = $[191];
960
1000
  }
961
- let t109;
962
- if ($[182] !== t107 || $[183] !== t108) {
963
- t109 = /* @__PURE__ */ jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsx(SearchIconsView, { selectedIcon: t107, onIconSelected: t108 }) });
964
- $[182] = t107;
965
- $[183] = t108;
966
- $[184] = t109;
1001
+ let t115;
1002
+ if ($[192] !== t113 || $[193] !== t114) {
1003
+ t115 = /* @__PURE__ */ jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsx(SearchIconsView, { selectedIcon: t113, onIconSelected: t114 }) });
1004
+ $[192] = t113;
1005
+ $[193] = t114;
1006
+ $[194] = t115;
967
1007
  } else {
968
- t109 = $[184];
1008
+ t115 = $[194];
969
1009
  }
970
- let t110;
971
- if ($[185] !== iconDialogOpen || $[186] !== t109) {
972
- t110 = /* @__PURE__ */ jsx(Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t109 });
973
- $[185] = iconDialogOpen;
974
- $[186] = t109;
975
- $[187] = t110;
1010
+ let t116;
1011
+ if ($[195] !== iconDialogOpen || $[196] !== t115) {
1012
+ t116 = /* @__PURE__ */ jsx(Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t115 });
1013
+ $[195] = iconDialogOpen;
1014
+ $[196] = t115;
1015
+ $[197] = t116;
976
1016
  } else {
977
- t110 = $[187];
1017
+ t116 = $[197];
978
1018
  }
979
- let t111;
980
- if ($[188] !== t105 || $[189] !== t110 || $[190] !== t15) {
981
- t111 = /* @__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: [
1019
+ let t117;
1020
+ if ($[198] !== t111 || $[199] !== t116 || $[200] !== t15) {
1021
+ t117 = /* @__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: [
982
1022
  t15,
983
- t105,
984
- t106,
985
- t110
1023
+ t111,
1024
+ t112,
1025
+ t116
986
1026
  ] }) });
987
- $[188] = t105;
988
- $[189] = t110;
989
- $[190] = t15;
990
- $[191] = t111;
1027
+ $[198] = t111;
1028
+ $[199] = t116;
1029
+ $[200] = t15;
1030
+ $[201] = t117;
991
1031
  } else {
992
- t111 = $[191];
1032
+ t117 = $[201];
993
1033
  }
994
- return t111;
1034
+ return t117;
995
1035
  }
996
1036
  function _temp3$5(value_3) {
997
1037
  if (value_3 === "code_defined") {
@@ -1953,7 +1993,7 @@ function ValidationPanel(t0) {
1953
1993
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1954
1994
  t1 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row text-surface-500", children: [
1955
1995
  /* @__PURE__ */ jsx(RuleIcon, {}),
1956
- /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "ml-2", children: "Validation" })
1996
+ /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "ml-4", children: "Validation" })
1957
1997
  ] });
1958
1998
  $[0] = t1;
1959
1999
  } else {
@@ -2025,7 +2065,7 @@ const fileTypes = {
2025
2065
  "text/*": "Text files"
2026
2066
  };
2027
2067
  function StoragePropertyField(t0) {
2028
- const $ = c(108);
2068
+ const $ = c(180);
2029
2069
  const {
2030
2070
  multiple,
2031
2071
  existing,
@@ -2041,6 +2081,12 @@ function StoragePropertyField(t0) {
2041
2081
  const maxSize = `${baseStoragePath}.maxSize`;
2042
2082
  const storagePath = `${baseStoragePath}.storagePath`;
2043
2083
  const storeUrl = `${baseStoragePath}.storeUrl`;
2084
+ const imageResize = `${baseStoragePath}.imageResize`;
2085
+ const imageResizeMaxWidth = `${imageResize}.maxWidth`;
2086
+ const imageResizeMaxHeight = `${imageResize}.maxHeight`;
2087
+ const imageResizeMode = `${imageResize}.mode`;
2088
+ const imageResizeFormat = `${imageResize}.format`;
2089
+ const imageResizeQuality = `${imageResize}.quality`;
2044
2090
  let t1;
2045
2091
  if ($[0] !== fileName || $[1] !== values) {
2046
2092
  t1 = getIn(values, fileName) ?? "{rand}_{file}";
@@ -2068,6 +2114,13 @@ function StoragePropertyField(t0) {
2068
2114
  let t12;
2069
2115
  let t13;
2070
2116
  let t14;
2117
+ let t15;
2118
+ let t16;
2119
+ let t17;
2120
+ let t18;
2121
+ let t19;
2122
+ let t20;
2123
+ let t21;
2071
2124
  let t3;
2072
2125
  let t4;
2073
2126
  let t5;
@@ -2075,63 +2128,86 @@ function StoragePropertyField(t0) {
2075
2128
  let t7;
2076
2129
  let t8;
2077
2130
  let t9;
2078
- if ($[6] !== acceptedFiles || $[7] !== disabled || $[8] !== existing || $[9] !== fileName || $[10] !== fileNameValue || $[11] !== maxSize || $[12] !== setFieldValue || $[13] !== storagePath || $[14] !== storagePathValue || $[15] !== storeUrl || $[16] !== values) {
2131
+ if ($[6] !== acceptedFiles || $[7] !== disabled || $[8] !== existing || $[9] !== fileName || $[10] !== fileNameValue || $[11] !== imageResizeFormat || $[12] !== imageResizeMaxHeight || $[13] !== imageResizeMaxWidth || $[14] !== imageResizeMode || $[15] !== imageResizeQuality || $[16] !== maxSize || $[17] !== setFieldValue || $[18] !== storagePath || $[19] !== storagePathValue || $[20] !== storeUrl || $[21] !== values) {
2079
2132
  const maxSizeValue = getIn(values, maxSize);
2080
- let t152;
2081
- if ($[31] !== acceptedFiles || $[32] !== values) {
2082
- t152 = getIn(values, acceptedFiles);
2083
- $[31] = acceptedFiles;
2084
- $[32] = values;
2085
- $[33] = t152;
2133
+ const imageResizeMaxWidthValue = getIn(values, imageResizeMaxWidth);
2134
+ const imageResizeMaxHeightValue = getIn(values, imageResizeMaxHeight);
2135
+ let t222;
2136
+ if ($[43] !== imageResizeMode || $[44] !== values) {
2137
+ t222 = getIn(values, imageResizeMode) ?? "cover";
2138
+ $[43] = imageResizeMode;
2139
+ $[44] = values;
2140
+ $[45] = t222;
2086
2141
  } else {
2087
- t152 = $[33];
2142
+ t222 = $[45];
2088
2143
  }
2089
- const storedValue = t152;
2144
+ const imageResizeModeValue = t222;
2145
+ let t232;
2146
+ if ($[46] !== imageResizeFormat || $[47] !== values) {
2147
+ t232 = getIn(values, imageResizeFormat) ?? "original";
2148
+ $[46] = imageResizeFormat;
2149
+ $[47] = values;
2150
+ $[48] = t232;
2151
+ } else {
2152
+ t232 = $[48];
2153
+ }
2154
+ const imageResizeFormatValue = t232;
2155
+ const imageResizeQualityValue = getIn(values, imageResizeQuality);
2156
+ let t242;
2157
+ if ($[49] !== acceptedFiles || $[50] !== values) {
2158
+ t242 = getIn(values, acceptedFiles);
2159
+ $[49] = acceptedFiles;
2160
+ $[50] = values;
2161
+ $[51] = t242;
2162
+ } else {
2163
+ t242 = $[51];
2164
+ }
2165
+ const storedValue = t242;
2090
2166
  const fileTypesValue = Array.isArray(storedValue) ? storedValue : void 0;
2091
2167
  const allFileTypesSelected = !fileTypesValue || fileTypesValue.length === 0;
2092
- let t162;
2093
- if ($[34] !== acceptedFiles || $[35] !== setFieldValue) {
2094
- t162 = (value) => {
2168
+ let t252;
2169
+ if ($[52] !== acceptedFiles || $[53] !== setFieldValue) {
2170
+ t252 = (value) => {
2095
2171
  if (!value) {
2096
2172
  setFieldValue(acceptedFiles, void 0);
2097
2173
  } else {
2098
2174
  setFieldValue(acceptedFiles, value);
2099
2175
  }
2100
2176
  };
2101
- $[34] = acceptedFiles;
2102
- $[35] = setFieldValue;
2103
- $[36] = t162;
2177
+ $[52] = acceptedFiles;
2178
+ $[53] = setFieldValue;
2179
+ $[54] = t252;
2104
2180
  } else {
2105
- t162 = $[36];
2181
+ t252 = $[54];
2106
2182
  }
2107
- const handleTypesChange = t162;
2183
+ const handleTypesChange = t252;
2108
2184
  const hasFilenameCallback = typeof fileNameValue === "function";
2109
2185
  const hasStoragePathCallback = typeof storagePathValue === "function";
2110
- t14 = "col-span-12";
2186
+ t21 = "col-span-12";
2111
2187
  T1 = ExpandablePanel;
2112
- if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
2113
- t13 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row text-surface-500", children: [
2188
+ if ($[55] === Symbol.for("react.memo_cache_sentinel")) {
2189
+ t20 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row text-surface-500", children: [
2114
2190
  /* @__PURE__ */ jsx(CloudUploadIcon, {}),
2115
- /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "ml-2", children: "File upload config" })
2191
+ /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "ml-4", children: "File upload config" })
2116
2192
  ] });
2117
- $[37] = t13;
2193
+ $[55] = t20;
2118
2194
  } else {
2119
- t13 = $[37];
2195
+ t20 = $[55];
2120
2196
  }
2121
- t9 = "grid grid-cols-12 gap-2 p-4";
2122
- let t172;
2123
- if ($[38] !== fileTypesValue) {
2124
- t172 = fileTypesValue ?? [];
2125
- $[38] = fileTypesValue;
2126
- $[39] = t172;
2197
+ t10 = "grid grid-cols-12 gap-2 p-4";
2198
+ let t262;
2199
+ if ($[56] !== fileTypesValue) {
2200
+ t262 = fileTypesValue ?? [];
2201
+ $[56] = fileTypesValue;
2202
+ $[57] = t262;
2127
2203
  } else {
2128
- t172 = $[39];
2204
+ t262 = $[57];
2129
2205
  }
2130
- const t182 = allFileTypesSelected ? void 0 : "Allowed file types";
2131
- let t192;
2132
- if ($[40] !== acceptedFiles || $[41] !== setFieldValue) {
2133
- t192 = Object.entries(fileTypes).map((t203) => {
2134
- const [value_0, label] = t203;
2206
+ const t272 = allFileTypesSelected ? void 0 : "Allowed file types";
2207
+ let t282;
2208
+ if ($[58] !== acceptedFiles || $[59] !== setFieldValue) {
2209
+ t282 = Object.entries(fileTypes).map((t293) => {
2210
+ const [value_0, label] = t293;
2135
2211
  return /* @__PURE__ */ jsxs(MultiSelectItem, { value: value_0, className: "flex items-center gap-2", children: [
2136
2212
  /* @__PURE__ */ jsx("div", { className: "flex-grow", children: label }),
2137
2213
  /* @__PURE__ */ jsx(Button, { size: "small", variant: "text", onClick: (e) => {
@@ -2141,50 +2217,50 @@ function StoragePropertyField(t0) {
2141
2217
  }, children: "Only" })
2142
2218
  ] }, value_0);
2143
2219
  });
2144
- $[40] = acceptedFiles;
2145
- $[41] = setFieldValue;
2146
- $[42] = t192;
2220
+ $[58] = acceptedFiles;
2221
+ $[59] = setFieldValue;
2222
+ $[60] = t282;
2147
2223
  } else {
2148
- t192 = $[42];
2224
+ t282 = $[60];
2149
2225
  }
2150
- if ($[43] !== acceptedFiles || $[44] !== disabled || $[45] !== handleTypesChange || $[46] !== t172 || $[47] !== t182 || $[48] !== t192) {
2151
- t10 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(MultiSelect, { className: "w-full", placeholder: "All file types allowed", disabled, name: acceptedFiles, value: t172, onValueChange: handleTypesChange, label: t182, renderValues: _temp3$4, children: t192 }) });
2152
- $[43] = acceptedFiles;
2153
- $[44] = disabled;
2154
- $[45] = handleTypesChange;
2155
- $[46] = t172;
2156
- $[47] = t182;
2157
- $[48] = t192;
2158
- $[49] = t10;
2226
+ if ($[61] !== acceptedFiles || $[62] !== disabled || $[63] !== handleTypesChange || $[64] !== t262 || $[65] !== t272 || $[66] !== t282) {
2227
+ t11 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(MultiSelect, { className: "w-full", placeholder: "All file types allowed", disabled, name: acceptedFiles, value: t262, onValueChange: handleTypesChange, label: t272, renderValues: _temp3$4, children: t282 }) });
2228
+ $[61] = acceptedFiles;
2229
+ $[62] = disabled;
2230
+ $[63] = handleTypesChange;
2231
+ $[64] = t262;
2232
+ $[65] = t272;
2233
+ $[66] = t282;
2234
+ $[67] = t11;
2159
2235
  } else {
2160
- t10 = $[49];
2236
+ t11 = $[67];
2161
2237
  }
2162
- const t202 = hasFilenameCallback || disabled;
2163
- const t212 = hasFilenameCallback ? "-" : fileNameValue;
2164
- if ($[50] !== fileName || $[51] !== t202 || $[52] !== t212) {
2165
- t11 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(Field, { name: fileName, as: DebouncedTextField, label: "File name", size: "small", disabled: t202, value: t212 }) });
2166
- $[50] = fileName;
2167
- $[51] = t202;
2168
- $[52] = t212;
2169
- $[53] = t11;
2238
+ const t292 = hasFilenameCallback || disabled;
2239
+ const t302 = hasFilenameCallback ? "-" : fileNameValue;
2240
+ if ($[68] !== fileName || $[69] !== t292 || $[70] !== t302) {
2241
+ t12 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(Field, { name: fileName, as: DebouncedTextField, label: "File name", size: "small", disabled: t292, value: t302 }) });
2242
+ $[68] = fileName;
2243
+ $[69] = t292;
2244
+ $[70] = t302;
2245
+ $[71] = t12;
2170
2246
  } else {
2171
- t11 = $[53];
2247
+ t12 = $[71];
2172
2248
  }
2173
- const t222 = hasStoragePathCallback || disabled;
2174
- const t232 = hasStoragePathCallback ? "-" : storagePathValue;
2175
- let t242;
2176
- if ($[54] !== storagePath || $[55] !== t222 || $[56] !== t232) {
2177
- t242 = /* @__PURE__ */ jsx(Field, { name: storagePath, as: DebouncedTextField, label: "Storage path", disabled: t222, size: "small", value: t232 });
2178
- $[54] = storagePath;
2179
- $[55] = t222;
2180
- $[56] = t232;
2181
- $[57] = t242;
2249
+ const t312 = hasStoragePathCallback || disabled;
2250
+ const t322 = hasStoragePathCallback ? "-" : storagePathValue;
2251
+ let t33;
2252
+ if ($[72] !== storagePath || $[73] !== t312 || $[74] !== t322) {
2253
+ t33 = /* @__PURE__ */ jsx(Field, { name: storagePath, as: DebouncedTextField, label: "Storage path", disabled: t312, size: "small", value: t322 });
2254
+ $[72] = storagePath;
2255
+ $[73] = t312;
2256
+ $[74] = t322;
2257
+ $[75] = t33;
2182
2258
  } else {
2183
- t242 = $[57];
2259
+ t33 = $[75];
2184
2260
  }
2185
- let t25;
2186
- if ($[58] === Symbol.for("react.memo_cache_sentinel")) {
2187
- t25 = /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: [
2261
+ let t34;
2262
+ if ($[76] === Symbol.for("react.memo_cache_sentinel")) {
2263
+ t34 = /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: [
2188
2264
  /* @__PURE__ */ jsx("p", { children: "You can use the following placeholders in the file name and storage path values:" }),
2189
2265
  /* @__PURE__ */ jsxs("ul", { children: [
2190
2266
  /* @__PURE__ */ jsx("li", { children: "{file} - Full name of the uploaded file" }),
@@ -2196,220 +2272,445 @@ function StoragePropertyField(t0) {
2196
2272
  /* @__PURE__ */ jsx("li", { children: "{rand} - Random value used to avoid name collisions" })
2197
2273
  ] })
2198
2274
  ] });
2199
- $[58] = t25;
2275
+ $[76] = t34;
2200
2276
  } else {
2201
- t25 = $[58];
2277
+ t34 = $[76];
2202
2278
  }
2203
- let t26;
2204
- if ($[59] !== disabled || $[60] !== existing) {
2205
- t26 = (t272) => {
2279
+ let t35;
2280
+ if ($[77] !== disabled || $[78] !== existing) {
2281
+ t35 = (t362) => {
2206
2282
  const {
2207
2283
  field,
2208
2284
  form
2209
- } = t272;
2285
+ } = t362;
2210
2286
  return /* @__PURE__ */ jsx(SwitchControl, { label: "Save URL instead of storage path", disabled: existing || disabled, form, field });
2211
2287
  };
2212
- $[59] = disabled;
2213
- $[60] = existing;
2214
- $[61] = t26;
2288
+ $[77] = disabled;
2289
+ $[78] = existing;
2290
+ $[79] = t35;
2215
2291
  } else {
2216
- t26 = $[61];
2292
+ t35 = $[79];
2217
2293
  }
2218
- let t27;
2219
- if ($[62] !== storeUrl || $[63] !== t26) {
2220
- t27 = /* @__PURE__ */ jsx(Field, { name: storeUrl, type: "checkbox", children: t26 });
2221
- $[62] = storeUrl;
2222
- $[63] = t26;
2223
- $[64] = t27;
2294
+ let t36;
2295
+ if ($[80] !== storeUrl || $[81] !== t35) {
2296
+ t36 = /* @__PURE__ */ jsx(Field, { name: storeUrl, type: "checkbox", children: t35 });
2297
+ $[80] = storeUrl;
2298
+ $[81] = t35;
2299
+ $[82] = t36;
2224
2300
  } else {
2225
- t27 = $[64];
2301
+ t36 = $[82];
2226
2302
  }
2227
- let t28;
2228
- if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
2229
- t28 = /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: "Turn this setting on, if you prefer to save the download URL of the uploaded file instead of the storage path. You can only change this prop upon creation." });
2230
- $[65] = t28;
2303
+ let t37;
2304
+ if ($[83] === Symbol.for("react.memo_cache_sentinel")) {
2305
+ t37 = /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: "Turn this setting on, if you prefer to save the download URL of the uploaded file instead of the storage path. You can only change this prop upon creation." });
2306
+ $[83] = t37;
2231
2307
  } else {
2232
- t28 = $[65];
2308
+ t37 = $[83];
2233
2309
  }
2234
- if ($[66] !== t242 || $[67] !== t27) {
2235
- t12 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
2236
- t242,
2237
- t25,
2238
- t27,
2239
- t28
2310
+ if ($[84] !== t33 || $[85] !== t36) {
2311
+ t13 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
2312
+ t33,
2313
+ t34,
2314
+ t36,
2315
+ t37
2240
2316
  ] });
2241
- $[66] = t242;
2242
- $[67] = t27;
2243
- $[68] = t12;
2317
+ $[84] = t33;
2318
+ $[85] = t36;
2319
+ $[86] = t13;
2244
2320
  } else {
2245
- t12 = $[68];
2321
+ t13 = $[86];
2246
2322
  }
2247
- t8 = "col-span-12";
2323
+ const t38 = maxSizeValue !== void 0 && maxSizeValue !== null ? maxSizeValue.toString() : "";
2324
+ let t39;
2325
+ if ($[87] !== maxSize || $[88] !== setFieldValue) {
2326
+ t39 = (e_0) => {
2327
+ const value_1 = e_0.target.value;
2328
+ if (value_1 === "") {
2329
+ setFieldValue(maxSize, void 0);
2330
+ } else {
2331
+ setFieldValue(maxSize, parseInt(value_1));
2332
+ }
2333
+ };
2334
+ $[87] = maxSize;
2335
+ $[88] = setFieldValue;
2336
+ $[89] = t39;
2337
+ } else {
2338
+ t39 = $[89];
2339
+ }
2340
+ if ($[90] !== maxSize || $[91] !== t38 || $[92] !== t39) {
2341
+ t14 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(DebouncedTextField, { name: maxSize, type: "number", label: "Max size (in bytes)", size: "small", value: t38, onChange: t39 }) });
2342
+ $[90] = maxSize;
2343
+ $[91] = t38;
2344
+ $[92] = t39;
2345
+ $[93] = t14;
2346
+ } else {
2347
+ t14 = $[93];
2348
+ }
2349
+ if ($[94] === Symbol.for("react.memo_cache_sentinel")) {
2350
+ t15 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-4", children: [
2351
+ /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", color: "secondary", className: "mb-2 block", children: "Image Resize Configuration" }),
2352
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "mb-2 block text-xs", children: "Automatically resize and optimize images before upload (JPEG, PNG, WebP only)" })
2353
+ ] });
2354
+ $[94] = t15;
2355
+ } else {
2356
+ t15 = $[94];
2357
+ }
2358
+ const t40 = imageResizeMaxWidthValue !== void 0 && imageResizeMaxWidthValue !== null ? imageResizeMaxWidthValue.toString() : "";
2359
+ let t41;
2360
+ if ($[95] !== imageResizeMaxWidth || $[96] !== setFieldValue) {
2361
+ t41 = (e_1) => {
2362
+ const value_2 = e_1.target.value;
2363
+ if (value_2 === "") {
2364
+ setFieldValue(imageResizeMaxWidth, void 0);
2365
+ } else {
2366
+ setFieldValue(imageResizeMaxWidth, parseInt(value_2));
2367
+ }
2368
+ };
2369
+ $[95] = imageResizeMaxWidth;
2370
+ $[96] = setFieldValue;
2371
+ $[97] = t41;
2372
+ } else {
2373
+ t41 = $[97];
2374
+ }
2375
+ if ($[98] !== disabled || $[99] !== imageResizeMaxWidth || $[100] !== t40 || $[101] !== t41) {
2376
+ t16 = /* @__PURE__ */ jsx("div", { className: "col-span-6", children: /* @__PURE__ */ jsx(DebouncedTextField, { name: imageResizeMaxWidth, type: "number", label: "Max width (px)", size: "small", disabled, value: t40, onChange: t41 }) });
2377
+ $[98] = disabled;
2378
+ $[99] = imageResizeMaxWidth;
2379
+ $[100] = t40;
2380
+ $[101] = t41;
2381
+ $[102] = t16;
2382
+ } else {
2383
+ t16 = $[102];
2384
+ }
2385
+ const t42 = imageResizeMaxHeightValue !== void 0 && imageResizeMaxHeightValue !== null ? imageResizeMaxHeightValue.toString() : "";
2386
+ let t43;
2387
+ if ($[103] !== imageResizeMaxHeight || $[104] !== setFieldValue) {
2388
+ t43 = (e_2) => {
2389
+ const value_3 = e_2.target.value;
2390
+ if (value_3 === "") {
2391
+ setFieldValue(imageResizeMaxHeight, void 0);
2392
+ } else {
2393
+ setFieldValue(imageResizeMaxHeight, parseInt(value_3));
2394
+ }
2395
+ };
2396
+ $[103] = imageResizeMaxHeight;
2397
+ $[104] = setFieldValue;
2398
+ $[105] = t43;
2399
+ } else {
2400
+ t43 = $[105];
2401
+ }
2402
+ if ($[106] !== disabled || $[107] !== imageResizeMaxHeight || $[108] !== t42 || $[109] !== t43) {
2403
+ t17 = /* @__PURE__ */ jsx("div", { className: "col-span-6", children: /* @__PURE__ */ jsx(DebouncedTextField, { name: imageResizeMaxHeight, type: "number", label: "Max height (px)", size: "small", disabled, value: t42, onChange: t43 }) });
2404
+ $[106] = disabled;
2405
+ $[107] = imageResizeMaxHeight;
2406
+ $[108] = t42;
2407
+ $[109] = t43;
2408
+ $[110] = t17;
2409
+ } else {
2410
+ t17 = $[110];
2411
+ }
2412
+ const t44 = imageResizeModeValue || "cover";
2413
+ let t45;
2414
+ if ($[111] !== imageResizeMode || $[112] !== setFieldValue) {
2415
+ t45 = (value_4) => setFieldValue(imageResizeMode, value_4 || "cover");
2416
+ $[111] = imageResizeMode;
2417
+ $[112] = setFieldValue;
2418
+ $[113] = t45;
2419
+ } else {
2420
+ t45 = $[113];
2421
+ }
2422
+ let t46;
2423
+ let t47;
2424
+ if ($[114] === Symbol.for("react.memo_cache_sentinel")) {
2425
+ t46 = /* @__PURE__ */ jsx(SelectItem, { value: "contain", children: "Contain (fit within bounds)" });
2426
+ t47 = /* @__PURE__ */ jsx(SelectItem, { value: "cover", children: "Cover (fill bounds, may crop)" });
2427
+ $[114] = t46;
2428
+ $[115] = t47;
2429
+ } else {
2430
+ t46 = $[114];
2431
+ t47 = $[115];
2432
+ }
2433
+ if ($[116] !== disabled || $[117] !== imageResizeMode || $[118] !== t44 || $[119] !== t45) {
2434
+ t18 = /* @__PURE__ */ jsx("div", { className: "col-span-6", children: /* @__PURE__ */ jsxs(Select, { disabled, name: imageResizeMode, fullWidth: true, size: "medium", value: t44, onValueChange: t45, label: "Resize mode", renderValue: _temp4$2, children: [
2435
+ t46,
2436
+ t47
2437
+ ] }) });
2438
+ $[116] = disabled;
2439
+ $[117] = imageResizeMode;
2440
+ $[118] = t44;
2441
+ $[119] = t45;
2442
+ $[120] = t18;
2443
+ } else {
2444
+ t18 = $[120];
2445
+ }
2446
+ const t48 = imageResizeFormatValue || "original";
2447
+ let t49;
2448
+ if ($[121] !== imageResizeFormat || $[122] !== setFieldValue) {
2449
+ t49 = (value_5) => setFieldValue(imageResizeFormat, value_5 || "original");
2450
+ $[121] = imageResizeFormat;
2451
+ $[122] = setFieldValue;
2452
+ $[123] = t49;
2453
+ } else {
2454
+ t49 = $[123];
2455
+ }
2456
+ let t50;
2457
+ let t51;
2458
+ let t52;
2459
+ let t53;
2460
+ if ($[124] === Symbol.for("react.memo_cache_sentinel")) {
2461
+ t50 = /* @__PURE__ */ jsx(SelectItem, { value: "original", children: "Original (keep same format)" });
2462
+ t51 = /* @__PURE__ */ jsx(SelectItem, { value: "jpeg", children: "JPEG" });
2463
+ t52 = /* @__PURE__ */ jsx(SelectItem, { value: "png", children: "PNG" });
2464
+ t53 = /* @__PURE__ */ jsx(SelectItem, { value: "webp", children: "WebP (best compression)" });
2465
+ $[124] = t50;
2466
+ $[125] = t51;
2467
+ $[126] = t52;
2468
+ $[127] = t53;
2469
+ } else {
2470
+ t50 = $[124];
2471
+ t51 = $[125];
2472
+ t52 = $[126];
2473
+ t53 = $[127];
2474
+ }
2475
+ if ($[128] !== disabled || $[129] !== imageResizeFormat || $[130] !== t48 || $[131] !== t49) {
2476
+ t19 = /* @__PURE__ */ jsx("div", { className: "col-span-6", children: /* @__PURE__ */ jsxs(Select, { disabled, size: "medium", fullWidth: true, name: imageResizeFormat, value: t48, onValueChange: t49, label: "Output format", renderValue: _temp5, children: [
2477
+ t50,
2478
+ t51,
2479
+ t52,
2480
+ t53
2481
+ ] }) });
2482
+ $[128] = disabled;
2483
+ $[129] = imageResizeFormat;
2484
+ $[130] = t48;
2485
+ $[131] = t49;
2486
+ $[132] = t19;
2487
+ } else {
2488
+ t19 = $[132];
2489
+ }
2490
+ t9 = "col-span-12";
2248
2491
  T0 = DebouncedTextField;
2249
- t3 = maxSize;
2492
+ t3 = imageResizeQuality;
2250
2493
  t4 = "number";
2251
- t5 = "Max size (in bytes)";
2494
+ t5 = "Quality (0-100)";
2252
2495
  t6 = "small";
2253
- t7 = maxSizeValue !== void 0 && maxSizeValue !== null ? maxSizeValue.toString() : "";
2496
+ t7 = disabled;
2497
+ t8 = imageResizeQualityValue !== void 0 && imageResizeQualityValue !== null ? imageResizeQualityValue.toString() : "";
2254
2498
  $[6] = acceptedFiles;
2255
2499
  $[7] = disabled;
2256
2500
  $[8] = existing;
2257
2501
  $[9] = fileName;
2258
2502
  $[10] = fileNameValue;
2259
- $[11] = maxSize;
2260
- $[12] = setFieldValue;
2261
- $[13] = storagePath;
2262
- $[14] = storagePathValue;
2263
- $[15] = storeUrl;
2264
- $[16] = values;
2265
- $[17] = T0;
2266
- $[18] = T1;
2267
- $[19] = t10;
2268
- $[20] = t11;
2269
- $[21] = t12;
2270
- $[22] = t13;
2271
- $[23] = t14;
2272
- $[24] = t3;
2273
- $[25] = t4;
2274
- $[26] = t5;
2275
- $[27] = t6;
2276
- $[28] = t7;
2277
- $[29] = t8;
2278
- $[30] = t9;
2503
+ $[11] = imageResizeFormat;
2504
+ $[12] = imageResizeMaxHeight;
2505
+ $[13] = imageResizeMaxWidth;
2506
+ $[14] = imageResizeMode;
2507
+ $[15] = imageResizeQuality;
2508
+ $[16] = maxSize;
2509
+ $[17] = setFieldValue;
2510
+ $[18] = storagePath;
2511
+ $[19] = storagePathValue;
2512
+ $[20] = storeUrl;
2513
+ $[21] = values;
2514
+ $[22] = T0;
2515
+ $[23] = T1;
2516
+ $[24] = t10;
2517
+ $[25] = t11;
2518
+ $[26] = t12;
2519
+ $[27] = t13;
2520
+ $[28] = t14;
2521
+ $[29] = t15;
2522
+ $[30] = t16;
2523
+ $[31] = t17;
2524
+ $[32] = t18;
2525
+ $[33] = t19;
2526
+ $[34] = t20;
2527
+ $[35] = t21;
2528
+ $[36] = t3;
2529
+ $[37] = t4;
2530
+ $[38] = t5;
2531
+ $[39] = t6;
2532
+ $[40] = t7;
2533
+ $[41] = t8;
2534
+ $[42] = t9;
2279
2535
  } else {
2280
- T0 = $[17];
2281
- T1 = $[18];
2282
- t10 = $[19];
2283
- t11 = $[20];
2284
- t12 = $[21];
2285
- t13 = $[22];
2286
- t14 = $[23];
2287
- t3 = $[24];
2288
- t4 = $[25];
2289
- t5 = $[26];
2290
- t6 = $[27];
2291
- t7 = $[28];
2292
- t8 = $[29];
2293
- t9 = $[30];
2536
+ T0 = $[22];
2537
+ T1 = $[23];
2538
+ t10 = $[24];
2539
+ t11 = $[25];
2540
+ t12 = $[26];
2541
+ t13 = $[27];
2542
+ t14 = $[28];
2543
+ t15 = $[29];
2544
+ t16 = $[30];
2545
+ t17 = $[31];
2546
+ t18 = $[32];
2547
+ t19 = $[33];
2548
+ t20 = $[34];
2549
+ t21 = $[35];
2550
+ t3 = $[36];
2551
+ t4 = $[37];
2552
+ t5 = $[38];
2553
+ t6 = $[39];
2554
+ t7 = $[40];
2555
+ t8 = $[41];
2556
+ t9 = $[42];
2294
2557
  }
2295
- let t15;
2296
- if ($[69] !== maxSize || $[70] !== setFieldValue) {
2297
- t15 = (e_0) => {
2298
- const value_1 = e_0.target.value;
2299
- if (value_1 === "") {
2300
- setFieldValue(maxSize, void 0);
2558
+ let t22;
2559
+ if ($[133] !== imageResizeQuality || $[134] !== setFieldValue) {
2560
+ t22 = (e_3) => {
2561
+ const value_6 = e_3.target.value;
2562
+ if (value_6 === "") {
2563
+ setFieldValue(imageResizeQuality, void 0);
2301
2564
  } else {
2302
- setFieldValue(maxSize, parseInt(value_1));
2565
+ const numValue = parseInt(value_6);
2566
+ if (numValue >= 0 && numValue <= 100) {
2567
+ setFieldValue(imageResizeQuality, numValue);
2568
+ }
2303
2569
  }
2304
2570
  };
2305
- $[69] = maxSize;
2306
- $[70] = setFieldValue;
2307
- $[71] = t15;
2571
+ $[133] = imageResizeQuality;
2572
+ $[134] = setFieldValue;
2573
+ $[135] = t22;
2308
2574
  } else {
2309
- t15 = $[71];
2575
+ t22 = $[135];
2310
2576
  }
2311
- let t16;
2312
- if ($[72] !== T0 || $[73] !== t15 || $[74] !== t3 || $[75] !== t4 || $[76] !== t5 || $[77] !== t6 || $[78] !== t7) {
2313
- t16 = /* @__PURE__ */ jsx(T0, { name: t3, type: t4, label: t5, size: t6, value: t7, onChange: t15 });
2314
- $[72] = T0;
2315
- $[73] = t15;
2316
- $[74] = t3;
2317
- $[75] = t4;
2318
- $[76] = t5;
2319
- $[77] = t6;
2320
- $[78] = t7;
2321
- $[79] = t16;
2577
+ let t23;
2578
+ if ($[136] !== T0 || $[137] !== t22 || $[138] !== t3 || $[139] !== t4 || $[140] !== t5 || $[141] !== t6 || $[142] !== t7 || $[143] !== t8) {
2579
+ t23 = /* @__PURE__ */ jsx(T0, { name: t3, type: t4, label: t5, size: t6, disabled: t7, value: t8, onChange: t22 });
2580
+ $[136] = T0;
2581
+ $[137] = t22;
2582
+ $[138] = t3;
2583
+ $[139] = t4;
2584
+ $[140] = t5;
2585
+ $[141] = t6;
2586
+ $[142] = t7;
2587
+ $[143] = t8;
2588
+ $[144] = t23;
2322
2589
  } else {
2323
- t16 = $[79];
2590
+ t23 = $[144];
2324
2591
  }
2325
- let t17;
2326
- if ($[80] !== t16 || $[81] !== t8) {
2327
- t17 = /* @__PURE__ */ jsx("div", { className: t8, children: t16 });
2328
- $[80] = t16;
2329
- $[81] = t8;
2330
- $[82] = t17;
2592
+ let t24;
2593
+ if ($[145] === Symbol.for("react.memo_cache_sentinel")) {
2594
+ t24 = /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: "Higher quality = larger file size. Recommended: 80-90 for photos, 90-100 for graphics" });
2595
+ $[145] = t24;
2331
2596
  } else {
2332
- t17 = $[82];
2597
+ t24 = $[145];
2333
2598
  }
2334
- let t18;
2335
- if ($[83] !== t10 || $[84] !== t11 || $[85] !== t12 || $[86] !== t17 || $[87] !== t9) {
2336
- t18 = /* @__PURE__ */ jsxs("div", { className: t9, children: [
2337
- t10,
2338
- t11,
2339
- t12,
2340
- t17
2599
+ let t25;
2600
+ if ($[146] !== t23 || $[147] !== t9) {
2601
+ t25 = /* @__PURE__ */ jsxs("div", { className: t9, children: [
2602
+ t23,
2603
+ t24
2341
2604
  ] });
2342
- $[83] = t10;
2343
- $[84] = t11;
2344
- $[85] = t12;
2345
- $[86] = t17;
2346
- $[87] = t9;
2347
- $[88] = t18;
2605
+ $[146] = t23;
2606
+ $[147] = t9;
2607
+ $[148] = t25;
2348
2608
  } else {
2349
- t18 = $[88];
2609
+ t25 = $[148];
2350
2610
  }
2351
- let t19;
2352
- if ($[89] !== T1 || $[90] !== t13 || $[91] !== t18) {
2353
- t19 = /* @__PURE__ */ jsx(T1, { title: t13, children: t18 });
2354
- $[89] = T1;
2355
- $[90] = t13;
2356
- $[91] = t18;
2357
- $[92] = t19;
2611
+ let t26;
2612
+ if ($[149] !== t10 || $[150] !== t11 || $[151] !== t12 || $[152] !== t13 || $[153] !== t14 || $[154] !== t15 || $[155] !== t16 || $[156] !== t17 || $[157] !== t18 || $[158] !== t19 || $[159] !== t25) {
2613
+ t26 = /* @__PURE__ */ jsxs("div", { className: t10, children: [
2614
+ t11,
2615
+ t12,
2616
+ t13,
2617
+ t14,
2618
+ t15,
2619
+ t16,
2620
+ t17,
2621
+ t18,
2622
+ t19,
2623
+ t25
2624
+ ] });
2625
+ $[149] = t10;
2626
+ $[150] = t11;
2627
+ $[151] = t12;
2628
+ $[152] = t13;
2629
+ $[153] = t14;
2630
+ $[154] = t15;
2631
+ $[155] = t16;
2632
+ $[156] = t17;
2633
+ $[157] = t18;
2634
+ $[158] = t19;
2635
+ $[159] = t25;
2636
+ $[160] = t26;
2637
+ } else {
2638
+ t26 = $[160];
2639
+ }
2640
+ let t27;
2641
+ if ($[161] !== T1 || $[162] !== t20 || $[163] !== t26) {
2642
+ t27 = /* @__PURE__ */ jsx(T1, { title: t20, children: t26 });
2643
+ $[161] = T1;
2644
+ $[162] = t20;
2645
+ $[163] = t26;
2646
+ $[164] = t27;
2358
2647
  } else {
2359
- t19 = $[92];
2648
+ t27 = $[164];
2360
2649
  }
2361
- let t20;
2362
- if ($[93] !== t14 || $[94] !== t19) {
2363
- t20 = /* @__PURE__ */ jsx("div", { className: t14, children: t19 });
2364
- $[93] = t14;
2365
- $[94] = t19;
2366
- $[95] = t20;
2650
+ let t28;
2651
+ if ($[165] !== t21 || $[166] !== t27) {
2652
+ t28 = /* @__PURE__ */ jsx("div", { className: t21, children: t27 });
2653
+ $[165] = t21;
2654
+ $[166] = t27;
2655
+ $[167] = t28;
2367
2656
  } else {
2368
- t20 = $[95];
2657
+ t28 = $[167];
2369
2658
  }
2370
- let t21;
2371
- if ($[96] !== disabled || $[97] !== multiple) {
2372
- t21 = !multiple && /* @__PURE__ */ jsx("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ jsx(GeneralPropertyValidation, { disabled }) });
2373
- $[96] = disabled;
2374
- $[97] = multiple;
2375
- $[98] = t21;
2659
+ let t29;
2660
+ if ($[168] !== disabled || $[169] !== multiple) {
2661
+ t29 = !multiple && /* @__PURE__ */ jsx("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ jsx(GeneralPropertyValidation, { disabled }) });
2662
+ $[168] = disabled;
2663
+ $[169] = multiple;
2664
+ $[170] = t29;
2376
2665
  } else {
2377
- t21 = $[98];
2666
+ t29 = $[170];
2378
2667
  }
2379
- let t22;
2380
- if ($[99] !== disabled || $[100] !== multiple) {
2381
- t22 = multiple && /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(ArrayPropertyValidation, { disabled }) });
2382
- $[99] = disabled;
2383
- $[100] = multiple;
2384
- $[101] = t22;
2668
+ let t30;
2669
+ if ($[171] !== disabled || $[172] !== multiple) {
2670
+ t30 = multiple && /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(ArrayPropertyValidation, { disabled }) });
2671
+ $[171] = disabled;
2672
+ $[172] = multiple;
2673
+ $[173] = t30;
2385
2674
  } else {
2386
- t22 = $[101];
2675
+ t30 = $[173];
2387
2676
  }
2388
- let t23;
2389
- if ($[102] !== t21 || $[103] !== t22) {
2390
- t23 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxs(ValidationPanel, { children: [
2391
- t21,
2392
- t22
2677
+ let t31;
2678
+ if ($[174] !== t29 || $[175] !== t30) {
2679
+ t31 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxs(ValidationPanel, { children: [
2680
+ t29,
2681
+ t30
2393
2682
  ] }) });
2394
- $[102] = t21;
2395
- $[103] = t22;
2396
- $[104] = t23;
2683
+ $[174] = t29;
2684
+ $[175] = t30;
2685
+ $[176] = t31;
2397
2686
  } else {
2398
- t23 = $[104];
2687
+ t31 = $[176];
2399
2688
  }
2400
- let t24;
2401
- if ($[105] !== t20 || $[106] !== t23) {
2402
- t24 = /* @__PURE__ */ jsxs(Fragment, { children: [
2403
- t20,
2404
- t23
2689
+ let t32;
2690
+ if ($[177] !== t28 || $[178] !== t31) {
2691
+ t32 = /* @__PURE__ */ jsxs(Fragment, { children: [
2692
+ t28,
2693
+ t31
2405
2694
  ] });
2406
- $[105] = t20;
2407
- $[106] = t23;
2408
- $[107] = t24;
2695
+ $[177] = t28;
2696
+ $[178] = t31;
2697
+ $[179] = t32;
2409
2698
  } else {
2410
- t24 = $[107];
2699
+ t32 = $[179];
2411
2700
  }
2412
- return t24;
2701
+ return t32;
2702
+ }
2703
+ function _temp5(selected_1) {
2704
+ if (!selected_1) {
2705
+ return "Original";
2706
+ }
2707
+ return selected_1.charAt(0).toUpperCase() + selected_1.slice(1);
2708
+ }
2709
+ function _temp4$2(selected_0) {
2710
+ if (!selected_0) {
2711
+ return "Cover";
2712
+ }
2713
+ return selected_0 === "contain" ? "Contain (fit within bounds)" : "Cover (fill bounds, may crop)";
2413
2714
  }
2414
2715
  function _temp3$4(selected) {
2415
2716
  if (!selected || selected.length === 0) {
@@ -2424,13 +2725,12 @@ function _temp$a(v) {
2424
2725
  return fileTypes[v];
2425
2726
  }
2426
2727
  function editableProperty(property) {
2427
- if (isPropertyBuilder(property)) return false;
2428
- if (isPropertyBuilder(property)) return false;
2429
- else {
2430
- const eProperty = property;
2431
- if (eProperty.dataType === "array" && typeof eProperty.of === "function") return false;
2432
- else if (eProperty.dataType === "array" && Array.isArray(eProperty.of)) return false;
2433
- return Boolean(eProperty.editable);
2728
+ if (isPropertyBuilder(property)) {
2729
+ return false;
2730
+ } else {
2731
+ if (property.dataType === "array" && typeof property.of === "function") return false;
2732
+ else if (property.dataType === "array" && Array.isArray(property.of)) return false;
2733
+ return property.editable === void 0 ? true : Boolean(property.editable);
2434
2734
  }
2435
2735
  }
2436
2736
  function removeNonEditableProperties(properties) {
@@ -2502,14 +2802,14 @@ function PropertyFieldPreview(t0) {
2502
2802
  }
2503
2803
  let t6;
2504
2804
  if ($[9] !== includeName || $[10] !== property.name) {
2505
- t6 = includeName && /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Typography, { variant: "body1", component: "span", className: "flex-grow pr-2", children: property.name ? property.name : " " }) });
2805
+ t6 = includeName && /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Typography, { variant: "label", component: "span", className: "flex-grow pr-2", children: property.name ? property.name : " " }) });
2506
2806
  $[9] = includeName;
2507
2807
  $[10] = property.name;
2508
2808
  $[11] = t6;
2509
2809
  } else {
2510
2810
  t6 = $[11];
2511
2811
  }
2512
- const t7 = includeName ? "body2" : "subtitle1";
2812
+ const t7 = includeName ? "body2" : "label";
2513
2813
  const t8 = propertyConfig?.name;
2514
2814
  let t9;
2515
2815
  if ($[12] !== t7 || $[13] !== t8) {
@@ -2619,7 +2919,7 @@ function NonEditablePropertyPreview(t0) {
2619
2919
  }
2620
2920
  let t3;
2621
2921
  if ($[5] !== propertyConfig) {
2622
- t3 = !propertyConfig && /* @__PURE__ */ jsx("div", { className: "h-8 w-8 p-1 rounded-full shadow text-white bg-surface-500", children: /* @__PURE__ */ jsx(FunctionsIcon, { color: "inherit", size: "medium" }) });
2922
+ t3 = !propertyConfig && /* @__PURE__ */ jsx("div", { className: "h-8 w-8 flex items-center justify-center rounded-full shadow text-white bg-surface-500", children: /* @__PURE__ */ jsx(FunctionsIcon, { color: "inherit", size: "small" }) });
2623
2923
  $[5] = propertyConfig;
2624
2924
  $[6] = t3;
2625
2925
  } else {
@@ -2661,7 +2961,7 @@ function NonEditablePropertyPreview(t0) {
2661
2961
  const t10 = property?.name ? property.name : name;
2662
2962
  let t11;
2663
2963
  if ($[15] !== t10) {
2664
- t11 = /* @__PURE__ */ jsx(Typography, { variant: "body1", component: "span", className: "flex-grow pr-2", children: t10 });
2964
+ t11 = /* @__PURE__ */ jsx(Typography, { variant: "label", component: "span", className: "flex-grow pr-2", children: t10 });
2665
2965
  $[15] = t10;
2666
2966
  $[16] = t11;
2667
2967
  } else {
@@ -3771,7 +4071,7 @@ const CommonPropertyFields = React__default.forwardRef(function CommonPropertyFi
3771
4071
  return t25;
3772
4072
  });
3773
4073
  function StringPropertyField(t0) {
3774
- const $ = c(27);
4074
+ const $ = c(32);
3775
4075
  const {
3776
4076
  widgetId,
3777
4077
  disabled,
@@ -3793,7 +4093,7 @@ function StringPropertyField(t0) {
3793
4093
  }
3794
4094
  let t2;
3795
4095
  if ($[4] !== disabled || $[5] !== showErrors || $[6] !== widgetId) {
3796
- t2 = widgetId === "multiline" && /* @__PURE__ */ jsx(StringPropertyValidation, { disabled, length: true, lowercase: true, max: true, min: true, trim: true, uppercase: true, showErrors });
4096
+ t2 = widgetId === "user_select" && /* @__PURE__ */ jsx(StringPropertyValidation, { disabled, showErrors });
3797
4097
  $[4] = disabled;
3798
4098
  $[5] = showErrors;
3799
4099
  $[6] = widgetId;
@@ -3803,7 +4103,7 @@ function StringPropertyField(t0) {
3803
4103
  }
3804
4104
  let t3;
3805
4105
  if ($[8] !== disabled || $[9] !== showErrors || $[10] !== widgetId) {
3806
- t3 = widgetId === "email" && /* @__PURE__ */ jsx(StringPropertyValidation, { disabled, max: true, min: true, trim: true, showErrors });
4106
+ t3 = widgetId === "multiline" && /* @__PURE__ */ jsx(StringPropertyValidation, { disabled, length: true, lowercase: true, max: true, min: true, trim: true, uppercase: true, showErrors });
3807
4107
  $[8] = disabled;
3808
4108
  $[9] = showErrors;
3809
4109
  $[10] = widgetId;
@@ -3812,60 +4112,72 @@ function StringPropertyField(t0) {
3812
4112
  t3 = $[11];
3813
4113
  }
3814
4114
  let t4;
3815
- if ($[12] !== t1 || $[13] !== t2 || $[14] !== t3) {
3816
- t4 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxs(ValidationPanel, { children: [
3817
- t1,
3818
- t2,
3819
- t3
3820
- ] }) });
3821
- $[12] = t1;
3822
- $[13] = t2;
3823
- $[14] = t3;
4115
+ if ($[12] !== disabled || $[13] !== showErrors || $[14] !== widgetId) {
4116
+ t4 = widgetId === "email" && /* @__PURE__ */ jsx(StringPropertyValidation, { disabled, max: true, min: true, trim: true, showErrors });
4117
+ $[12] = disabled;
4118
+ $[13] = showErrors;
4119
+ $[14] = widgetId;
3824
4120
  $[15] = t4;
3825
4121
  } else {
3826
4122
  t4 = $[15];
3827
4123
  }
3828
4124
  let t5;
3829
- if ($[16] !== setFieldValue) {
3830
- t5 = (e) => {
3831
- setFieldValue("defaultValue", e.target.value === "" ? void 0 : e.target.value);
3832
- };
3833
- $[16] = setFieldValue;
3834
- $[17] = t5;
4125
+ if ($[16] !== t1 || $[17] !== t2 || $[18] !== t3 || $[19] !== t4) {
4126
+ t5 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxs(ValidationPanel, { children: [
4127
+ t1,
4128
+ t2,
4129
+ t3,
4130
+ t4
4131
+ ] }) });
4132
+ $[16] = t1;
4133
+ $[17] = t2;
4134
+ $[18] = t3;
4135
+ $[19] = t4;
4136
+ $[20] = t5;
3835
4137
  } else {
3836
- t5 = $[17];
4138
+ t5 = $[20];
3837
4139
  }
3838
4140
  let t6;
3839
- if ($[18] !== values) {
3840
- t6 = getIn(values, "defaultValue") ?? "";
3841
- $[18] = values;
3842
- $[19] = t6;
4141
+ if ($[21] !== setFieldValue) {
4142
+ t6 = (e) => {
4143
+ setFieldValue("defaultValue", e.target.value === "" ? void 0 : e.target.value);
4144
+ };
4145
+ $[21] = setFieldValue;
4146
+ $[22] = t6;
3843
4147
  } else {
3844
- t6 = $[19];
4148
+ t6 = $[22];
3845
4149
  }
3846
4150
  let t7;
3847
- if ($[20] !== disabled || $[21] !== t5 || $[22] !== t6) {
3848
- t7 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(TextField, { name: "defaultValue", disabled, onChange: t5, label: "Default value", value: t6 }) });
3849
- $[20] = disabled;
3850
- $[21] = t5;
3851
- $[22] = t6;
3852
- $[23] = t7;
4151
+ if ($[23] !== values) {
4152
+ t7 = getIn(values, "defaultValue") ?? "";
4153
+ $[23] = values;
4154
+ $[24] = t7;
3853
4155
  } else {
3854
- t7 = $[23];
4156
+ t7 = $[24];
3855
4157
  }
3856
4158
  let t8;
3857
- if ($[24] !== t4 || $[25] !== t7) {
3858
- t8 = /* @__PURE__ */ jsxs(Fragment, { children: [
3859
- t4,
3860
- t7
4159
+ if ($[25] !== disabled || $[26] !== t6 || $[27] !== t7) {
4160
+ t8 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(TextField, { name: "defaultValue", disabled, onChange: t6, label: "Default value", value: t7 }) });
4161
+ $[25] = disabled;
4162
+ $[26] = t6;
4163
+ $[27] = t7;
4164
+ $[28] = t8;
4165
+ } else {
4166
+ t8 = $[28];
4167
+ }
4168
+ let t9;
4169
+ if ($[29] !== t5 || $[30] !== t8) {
4170
+ t9 = /* @__PURE__ */ jsxs(Fragment, { children: [
4171
+ t5,
4172
+ t8
3861
4173
  ] });
3862
- $[24] = t4;
3863
- $[25] = t7;
3864
- $[26] = t8;
4174
+ $[29] = t5;
4175
+ $[30] = t8;
4176
+ $[31] = t9;
3865
4177
  } else {
3866
- t8 = $[26];
4178
+ t9 = $[31];
3867
4179
  }
3868
- return t8;
4180
+ return t9;
3869
4181
  }
3870
4182
  function BooleanPropertyField(t0) {
3871
4183
  const $ = c(10);
@@ -4887,7 +5199,21 @@ function updatePropertyFromWidget(propertyData, selectedWidgetId, propertyConfig
4887
5199
  markdown: void 0,
4888
5200
  email: void 0,
4889
5201
  url: void 0,
4890
- enumValues: void 0
5202
+ enumValues: void 0,
5203
+ userSelect: void 0
5204
+ });
5205
+ } else if (selectedWidgetId === "user_select") {
5206
+ updatedProperty = mergeDeep(propertyData, {
5207
+ dataType: "string",
5208
+ propertyConfig: "user_select",
5209
+ editable: propertyData.editable !== void 0 ? propertyData.editable : true,
5210
+ storage: void 0,
5211
+ multiline: void 0,
5212
+ markdown: void 0,
5213
+ email: void 0,
5214
+ url: void 0,
5215
+ enumValues: void 0,
5216
+ userSelect: true
4891
5217
  });
4892
5218
  } else if (selectedWidgetId === "multiline") {
4893
5219
  updatedProperty = mergeDeep(propertyData, {
@@ -4899,7 +5225,8 @@ function updatePropertyFromWidget(propertyData, selectedWidgetId, propertyConfig
4899
5225
  markdown: void 0,
4900
5226
  email: void 0,
4901
5227
  url: void 0,
4902
- enumValues: void 0
5228
+ enumValues: void 0,
5229
+ userSelect: void 0
4903
5230
  });
4904
5231
  } else if (selectedWidgetId === "markdown") {
4905
5232
  updatedProperty = mergeDeep(propertyData, {
@@ -4910,7 +5237,8 @@ function updatePropertyFromWidget(propertyData, selectedWidgetId, propertyConfig
4910
5237
  multiline: void 0,
4911
5238
  markdown: true,
4912
5239
  email: void 0,
4913
- url: void 0
5240
+ url: void 0,
5241
+ userSelect: void 0
4914
5242
  });
4915
5243
  } else if (selectedWidgetId === "url") {
4916
5244
  updatedProperty = mergeDeep(propertyData, {
@@ -4922,7 +5250,8 @@ function updatePropertyFromWidget(propertyData, selectedWidgetId, propertyConfig
4922
5250
  markdown: void 0,
4923
5251
  email: void 0,
4924
5252
  url: true,
4925
- enumValues: void 0
5253
+ enumValues: void 0,
5254
+ userSelect: void 0
4926
5255
  });
4927
5256
  } else if (selectedWidgetId === "email") {
4928
5257
  updatedProperty = mergeDeep(propertyData, {
@@ -4934,7 +5263,8 @@ function updatePropertyFromWidget(propertyData, selectedWidgetId, propertyConfig
4934
5263
  markdown: void 0,
4935
5264
  email: true,
4936
5265
  url: void 0,
4937
- enumValues: void 0
5266
+ enumValues: void 0,
5267
+ userSelect: void 0
4938
5268
  });
4939
5269
  } else if (selectedWidgetId === "select") {
4940
5270
  updatedProperty = mergeDeep(propertyData, {
@@ -4946,7 +5276,8 @@ function updatePropertyFromWidget(propertyData, selectedWidgetId, propertyConfig
4946
5276
  markdown: void 0,
4947
5277
  email: void 0,
4948
5278
  url: void 0,
4949
- enumValues: propertyData.enumValues ?? []
5279
+ enumValues: propertyData.enumValues ?? [],
5280
+ userSelect: void 0
4950
5281
  });
4951
5282
  } else if (selectedWidgetId === "multi_select") {
4952
5283
  updatedProperty = mergeDeep(propertyData, {
@@ -5213,7 +5544,7 @@ function _temp$7(value_0) {
5213
5544
  }
5214
5545
  }
5215
5546
  }
5216
- const supportedFieldsIds = ["text_field", "multiline", "markdown", "url", "email", "select", "multi_select", "number_input", "number_select", "multi_number_select", "file_upload", "multi_file_upload", "reference", "reference_as_string", "multi_references", "switch", "date_time", "group", "key_value", "repeat", "block"];
5547
+ const supportedFieldsIds = ["text_field", "multiline", "markdown", "url", "email", "user_select", "select", "multi_select", "number_input", "number_select", "multi_number_select", "file_upload", "multi_file_upload", "reference", "reference_as_string", "multi_references", "switch", "date_time", "group", "key_value", "repeat", "block"];
5217
5548
  const supportedFields = Object.entries(DEFAULT_FIELD_CONFIGS).filter(([id]) => supportedFieldsIds.includes(id)).map(([id, config]) => ({
5218
5549
  [id]: config
5219
5550
  })).reduce((a, b) => ({
@@ -5282,7 +5613,7 @@ function MarkdownPropertyField(t0) {
5282
5613
  if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
5283
5614
  t12 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row text-surface-500", children: [
5284
5615
  /* @__PURE__ */ jsx(CloudUploadIcon, {}),
5285
- /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "ml-2", children: "File upload config" })
5616
+ /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "ml-4", children: "File upload config" })
5286
5617
  ] });
5287
5618
  $[26] = t12;
5288
5619
  } else {
@@ -5541,7 +5872,7 @@ const PropertyForm = React__default.memo(function PropertyForm2(props) {
5541
5872
  const initialValue = t2;
5542
5873
  let t3;
5543
5874
  if ($[1] !== collectionEditable || $[2] !== property) {
5544
- t3 = Boolean(property && !editableProperty(property)) && !collectionEditable;
5875
+ t3 = Boolean(property && !editableProperty(property)) || !collectionEditable;
5545
5876
  $[1] = collectionEditable;
5546
5877
  $[2] = property;
5547
5878
  $[3] = t3;
@@ -5601,7 +5932,6 @@ const PropertyForm = React__default.memo(function PropertyForm2(props) {
5601
5932
  let t7;
5602
5933
  if ($[13] !== doOnPropertyChanged || $[14] !== existingProperty) {
5603
5934
  t7 = (newPropertyWithId, controller) => {
5604
- console.debug("onSubmit", newPropertyWithId);
5605
5935
  const {
5606
5936
  id: id_0,
5607
5937
  ...property_1
@@ -6020,7 +6350,7 @@ function PropertyEditFormFields(t0) {
6020
6350
  }
6021
6351
  const onWidgetSelectChanged = t9;
6022
6352
  let childComponent;
6023
- if (selectedFieldConfigId === "text_field" || selectedFieldConfigId === "multiline" || selectedFieldConfigId === "email") {
6353
+ if (selectedFieldConfigId === "text_field" || selectedFieldConfigId === "multiline" || selectedFieldConfigId === "user_select" || selectedFieldConfigId === "email") {
6024
6354
  let t102;
6025
6355
  if ($[27] !== disabled || $[28] !== selectedFieldConfigId || $[29] !== showErrors) {
6026
6356
  t102 = /* @__PURE__ */ jsx(StringPropertyField, { widgetId: selectedFieldConfigId, disabled, showErrors });
@@ -6266,9 +6596,11 @@ function PropertyEditFormFields(t0) {
6266
6596
  t10 = disabled && /* @__PURE__ */ jsxs(InfoLabel, { mode: "warn", children: [
6267
6597
  /* @__PURE__ */ jsx(Typography, { children: "This property can't be edited" }),
6268
6598
  /* @__PURE__ */ jsxs(Typography, { variant: "caption", children: [
6269
- "You may not have permission to edit it or it is defined in code with no ",
6599
+ "You may not have permission to edit it or it is defined in code with the ",
6270
6600
  /* @__PURE__ */ jsx("code", { children: "editable" }),
6271
- " flag"
6601
+ " flag set to ",
6602
+ /* @__PURE__ */ jsx("code", { children: "false" }),
6603
+ "."
6272
6604
  ] })
6273
6605
  ] });
6274
6606
  $[95] = disabled;
@@ -6453,6 +6785,7 @@ const WIDGET_TYPE_MAP = {
6453
6785
  url: "Text",
6454
6786
  email: "Text",
6455
6787
  switch: "Boolean",
6788
+ user_select: "Users",
6456
6789
  select: "Select",
6457
6790
  multi_select: "Select",
6458
6791
  number_input: "Number",
@@ -6728,7 +7061,7 @@ function WidgetSelectViewItem(t0) {
6728
7061
  const t4 = shouldWarnChangingDataType ? "secondary" : void 0;
6729
7062
  let t5;
6730
7063
  if ($[6] !== propertyConfig.name || $[7] !== t4) {
6731
- t5 = /* @__PURE__ */ jsx(Typography, { color: t4, children: propertyConfig.name });
7064
+ t5 = /* @__PURE__ */ jsx(Typography, { variant: "label", color: t4, children: propertyConfig.name });
6732
7065
  $[6] = propertyConfig.name;
6733
7066
  $[7] = t4;
6734
7067
  $[8] = t5;
@@ -7128,13 +7461,6 @@ function CollectionPropertiesEditorForm({
7128
7461
  setFieldValue(previousPropertyPath, void 0, false);
7129
7462
  setFieldTouched(previousPropertyPath, false, false);
7130
7463
  }
7131
- console.debug("onPropertyChanged", {
7132
- id: id_0,
7133
- property: property_0,
7134
- previousId,
7135
- namespace: namespace_3,
7136
- propertyPath
7137
- });
7138
7464
  if (propertyPath) {
7139
7465
  setFieldValue(propertyPath, property_0, false);
7140
7466
  setFieldTouched(propertyPath, true, false);
@@ -7254,7 +7580,7 @@ function UnsavedChangesDialog(t0) {
7254
7580
  }
7255
7581
  let t6;
7256
7582
  if ($[8] !== t4) {
7257
- t6 = /* @__PURE__ */ jsxs(DialogContent, { children: [
7583
+ t6 = /* @__PURE__ */ jsxs(DialogContent, { className: "mt-4", children: [
7258
7584
  t4,
7259
7585
  t5
7260
7586
  ] });
@@ -8980,104 +9306,106 @@ function PropertySelectItem(t0) {
8980
9306
  return t9;
8981
9307
  }
8982
9308
  function CollectionEditorImportDataPreview(t0) {
8983
- const $ = c(19);
9309
+ const $ = c(20);
8984
9310
  const {
8985
9311
  importConfig,
8986
9312
  properties,
8987
9313
  propertiesOrder
8988
9314
  } = t0;
8989
9315
  const authController = useAuthController();
9316
+ const navigation = useNavigationController();
8990
9317
  const [loading, setLoading] = useState(false);
8991
9318
  let t1;
8992
- if ($[0] !== authController || $[1] !== importConfig || $[2] !== properties) {
9319
+ if ($[0] !== authController || $[1] !== importConfig || $[2] !== navigation || $[3] !== properties) {
8993
9320
  t1 = async function loadEntities2() {
8994
- const mappedData = importConfig.importData.map((d) => convertDataToEntity(authController, d, importConfig.idColumn, importConfig.headersMapping, properties, "TEMP_PATH", importConfig.defaultValues));
9321
+ const mappedData = importConfig.importData.map((d) => convertDataToEntity(authController, navigation, d, importConfig.idColumn, importConfig.headersMapping, properties, "TEMP_PATH", importConfig.defaultValues));
8995
9322
  importConfig.setEntities(mappedData);
8996
9323
  };
8997
9324
  $[0] = authController;
8998
9325
  $[1] = importConfig;
8999
- $[2] = properties;
9000
- $[3] = t1;
9326
+ $[2] = navigation;
9327
+ $[3] = properties;
9328
+ $[4] = t1;
9001
9329
  } else {
9002
- t1 = $[3];
9330
+ t1 = $[4];
9003
9331
  }
9004
9332
  const loadEntities = t1;
9005
9333
  let t2;
9006
- if ($[4] !== loadEntities) {
9334
+ if ($[5] !== loadEntities) {
9007
9335
  t2 = () => {
9008
9336
  loadEntities().finally(() => setLoading(false));
9009
9337
  };
9010
- $[4] = loadEntities;
9011
- $[5] = t2;
9338
+ $[5] = loadEntities;
9339
+ $[6] = t2;
9012
9340
  } else {
9013
- t2 = $[5];
9341
+ t2 = $[6];
9014
9342
  }
9015
9343
  let t3;
9016
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
9344
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
9017
9345
  t3 = [];
9018
- $[6] = t3;
9346
+ $[7] = t3;
9019
9347
  } else {
9020
- t3 = $[6];
9348
+ t3 = $[7];
9021
9349
  }
9022
9350
  useEffect(t2, t3);
9023
9351
  const selectionController = useSelectionController();
9024
9352
  if (loading) {
9025
9353
  let t42;
9026
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
9354
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
9027
9355
  t42 = /* @__PURE__ */ jsx(CircularProgressCenter, {});
9028
- $[7] = t42;
9356
+ $[8] = t42;
9029
9357
  } else {
9030
- t42 = $[7];
9358
+ t42 = $[8];
9031
9359
  }
9032
9360
  return t42;
9033
9361
  }
9034
9362
  let t4;
9035
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
9363
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
9036
9364
  t4 = /* @__PURE__ */ jsxs("div", { children: [
9037
9365
  /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Imported data preview" }),
9038
9366
  /* @__PURE__ */ jsx(Typography, { variant: "caption", children: "Entities with the same id will be overwritten" })
9039
9367
  ] });
9040
- $[8] = t4;
9368
+ $[9] = t4;
9041
9369
  } else {
9042
- t4 = $[8];
9370
+ t4 = $[9];
9043
9371
  }
9044
9372
  let t5;
9045
- if ($[9] !== importConfig.entities) {
9373
+ if ($[10] !== importConfig.entities) {
9046
9374
  t5 = {
9047
9375
  data: importConfig.entities,
9048
9376
  dataLoading: false,
9049
9377
  noMoreToLoad: false
9050
9378
  };
9051
- $[9] = importConfig.entities;
9052
- $[10] = t5;
9379
+ $[10] = importConfig.entities;
9380
+ $[11] = t5;
9053
9381
  } else {
9054
- t5 = $[10];
9382
+ t5 = $[11];
9055
9383
  }
9056
9384
  let t6;
9057
- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
9385
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
9058
9386
  t6 = /* @__PURE__ */ jsx("div", { className: "h-12" });
9059
- $[11] = t6;
9387
+ $[12] = t6;
9060
9388
  } else {
9061
- t6 = $[11];
9389
+ t6 = $[12];
9062
9390
  }
9063
9391
  let t7;
9064
- if ($[12] !== propertiesOrder) {
9392
+ if ($[13] !== propertiesOrder) {
9065
9393
  t7 = propertiesOrder.map(_temp$2);
9066
- $[12] = propertiesOrder;
9067
- $[13] = t7;
9394
+ $[13] = propertiesOrder;
9395
+ $[14] = t7;
9068
9396
  } else {
9069
- t7 = $[13];
9397
+ t7 = $[14];
9070
9398
  }
9071
9399
  let t8;
9072
- if ($[14] !== properties || $[15] !== selectionController || $[16] !== t5 || $[17] !== t7) {
9400
+ if ($[15] !== properties || $[16] !== selectionController || $[17] !== t5 || $[18] !== t7) {
9073
9401
  t8 = /* @__PURE__ */ jsx(EntityCollectionTable, { title: t4, tableController: t5, endAdornment: t6, filterable: false, sortable: false, selectionController, displayedColumnIds: t7, openEntityMode: "side_panel", properties, enablePopupIcon: false });
9074
- $[14] = properties;
9075
- $[15] = selectionController;
9076
- $[16] = t5;
9077
- $[17] = t7;
9078
- $[18] = t8;
9402
+ $[15] = properties;
9403
+ $[16] = selectionController;
9404
+ $[17] = t5;
9405
+ $[18] = t7;
9406
+ $[19] = t8;
9079
9407
  } else {
9080
- t8 = $[18];
9408
+ t8 = $[19];
9081
9409
  }
9082
9410
  return t8;
9083
9411
  }
@@ -9724,7 +10052,7 @@ function CollectionEditorInternal({
9724
10052
  };
9725
10053
  const doCollectionInference = collectionInference ? (collection_0) => {
9726
10054
  if (!collectionInference) return void 0;
9727
- return collectionInference?.(collection_0.path, collection_0.collectionGroup ?? false, parentPaths ?? []);
10055
+ return collectionInference?.(collection_0.path, collection_0.collectionGroup ?? false, parentPaths ?? [], collection_0.databaseId);
9728
10056
  } : void 0;
9729
10057
  const inferCollectionFromData = async (newCollection) => {
9730
10058
  try {
@@ -10169,7 +10497,7 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
10169
10497
  currentPropertiesOrder,
10170
10498
  editedCollectionId,
10171
10499
  parentCollectionIds: parentCollectionIds_0,
10172
- collectionEditable: collection?.editable ?? false,
10500
+ collectionEditable: collection?.editable === void 0 || collection?.editable === true,
10173
10501
  existingEntities: existingEntities_0
10174
10502
  });
10175
10503
  };