@woodylab/payload 0.0.17 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/config/blocks/blockCarousel.d.ts +3 -0
  2. package/dist/config/blocks/blockDisclosureList.d.ts +3 -0
  3. package/dist/config/blocks/blockGrid.d.ts +3 -0
  4. package/dist/config/blocks/blockGridContent.d.ts +3 -0
  5. package/dist/config/blocks/blockImage.d.ts +3 -0
  6. package/dist/config/blocks/blockParallax.d.ts +3 -0
  7. package/dist/config/blocks/blockTabs.d.ts +3 -0
  8. package/dist/config/index.cjs.js +10 -3
  9. package/dist/config/index.cjs.js.map +1 -1
  10. package/dist/config/index.d.ts +8 -1
  11. package/dist/config/index.esm.js +2 -2
  12. package/dist/{fieldRoles-BH5WwJxZ.js → fieldRoles-ByWB8j1Q.js} +618 -276
  13. package/dist/fieldRoles-ByWB8j1Q.js.map +1 -0
  14. package/dist/{fieldRoles-BbW92YWL.js → fieldRoles-C_8MuKLB.js} +617 -277
  15. package/dist/fieldRoles-C_8MuKLB.js.map +1 -0
  16. package/dist/fields/index.cjs.js +3 -3
  17. package/dist/fields/index.esm.js +2 -2
  18. package/dist/{index-DwwAtuaU.js → index-BPmTpfXE.js} +582 -4
  19. package/dist/index-BPmTpfXE.js.map +1 -0
  20. package/dist/index-DhejC-CC.js +146 -0
  21. package/dist/index-DhejC-CC.js.map +1 -0
  22. package/dist/{index-CXtwWOSW.js → index-Ds44OSfM.js} +588 -3
  23. package/dist/index-Ds44OSfM.js.map +1 -0
  24. package/dist/index-zJMnbEc6.js +135 -0
  25. package/dist/index-zJMnbEc6.js.map +1 -0
  26. package/dist/index.cjs.js +3 -3
  27. package/dist/index.esm.js +3 -3
  28. package/package.json +1 -1
  29. package/dist/fieldRoles-BH5WwJxZ.js.map +0 -1
  30. package/dist/fieldRoles-BbW92YWL.js.map +0 -1
  31. package/dist/index-CXtwWOSW.js.map +0 -1
  32. package/dist/index-DeuyvLG-.js +0 -485
  33. package/dist/index-DeuyvLG-.js.map +0 -1
  34. package/dist/index-DwwAtuaU.js.map +0 -1
  35. package/dist/index-qjse1Cxj.js +0 -473
  36. package/dist/index-qjse1Cxj.js.map +0 -1
@@ -75,134 +75,6 @@ const fieldSelect = (override) => ({
75
75
  ...override
76
76
  });
77
77
 
78
- const fieldContainerProps = (customFields = []) => {
79
- return {
80
- name: 'ctrP',
81
- label: 'Proprietà container',
82
- type: 'group',
83
- fields: [
84
- ...customFields,
85
- fieldRichText({ name: 'body', label: 'Contenuto', required: false }),
86
- fieldContainerWidths(),
87
- {
88
- type: 'tabs',
89
- tabs: [
90
- {
91
- label: 'Stile',
92
- fields: [
93
- fieldUpload('media', { name: 'bgi', label: 'Immagine di sfondo' }),
94
- //WFieldColor({name:'bgc', label:'Colore di sfondo', required:false}),
95
- {
96
- name: 'borderRadius',
97
- type: 'select',
98
- label: 'Angoli arrotondati',
99
- defaultValue: 'rounded-none',
100
- options: [
101
- { label: 'Nessuno', value: 'rounded-none' },
102
- { label: 'Piccolo', value: 'rounded-sm' },
103
- { label: 'Medio', value: 'rounded-md' },
104
- { label: 'Grande', value: 'rounded-lg' },
105
- { label: 'Extra Grande', value: 'rounded-xl' },
106
- { label: 'Massimo', value: 'rounded-full' },
107
- ],
108
- admin: {
109
- width: '50%',
110
- description: 'Imposta lo stile degli angoli arrotondati del contenitore.',
111
- },
112
- },
113
- {
114
- name: 'boxShadow',
115
- type: 'select',
116
- label: 'Ombra contenitore',
117
- defaultValue: 'shadow-none', // Default: nessuna ombra
118
- options: [
119
- { label: 'Nessuna', value: 'shadow-none' },
120
- { label: 'Piccola', value: 'shadow-sm' },
121
- { label: 'Normale', value: 'shadow' },
122
- { label: 'Media', value: 'shadow-md' },
123
- { label: 'Grande', value: 'shadow-lg' },
124
- { label: 'Extra Grande', value: 'shadow-xl' },
125
- { label: 'Massima', value: 'shadow-2xl' },
126
- ],
127
- admin: {
128
- width: '50%',
129
- description: 'Imposta lo stile dell\'ombra per il contenitore.',
130
- },
131
- }
132
- ]
133
- },
134
- {
135
- label: 'Dimensioni',
136
- fields: [
137
- fieldHeights(),
138
- {
139
- type: 'tabs',
140
- tabs: [
141
- {
142
- label: 'Margini',
143
- fields: [
144
- fieldMargins()
145
- ]
146
- },
147
- {
148
- label: 'Paddings',
149
- fields: [
150
- fieldPaddings()
151
- ]
152
- }
153
- ]
154
- }
155
- ]
156
- }
157
- ]
158
- },
159
- ]
160
- };
161
- };
162
-
163
- const fieldThemeColor = (override) => ({
164
- name: override?.name || 'color',
165
- label: override?.label || 'Colore',
166
- type: 'select',
167
- required: override?.required ?? false,
168
- options: [
169
- { label: 'Default', value: '' },
170
- { label: 'Foreground', value: 'foreground' },
171
- { label: 'Primary', value: 'primary' },
172
- { label: 'Secondary', value: 'secondary' },
173
- { label: 'Accent', value: 'accent' },
174
- { label: 'Dark', value: 'dark' },
175
- { label: 'Light', value: 'light' },
176
- { label: 'White', value: 'white' },
177
- { label: 'Black', value: 'black' },
178
- ],
179
- admin: {
180
- ...override?.admin,
181
- },
182
- });
183
-
184
- const fieldConfigProps = (customFields = []) => {
185
- return {
186
- name: 'config',
187
- label: 'Configurazione',
188
- type: 'group',
189
- fields: [
190
- ...customFields,
191
- ],
192
- };
193
- };
194
-
195
- const fieldContentProps = (customFields = []) => {
196
- return {
197
- name: 'cntP',
198
- label: 'Contenuto',
199
- type: 'group',
200
- fields: [
201
- ...customFields,
202
- ],
203
- };
204
- };
205
-
206
78
  /**
207
79
  * Costante che definisce le varianti di larghezza del container come classi Tailwind
208
80
  */
@@ -846,118 +718,6 @@ var index = /*#__PURE__*/Object.freeze({
846
718
  TailwindWidths: TailwindWidths
847
719
  });
848
720
 
849
- /**
850
- * Genera un campo per la selezione delle altezze
851
- * @returns Field - Campo di tipo `select` per PayloadCMS
852
- */
853
- const fieldViewportHeights = () => {
854
- return fieldSelect({
855
- name: 'h',
856
- label: 'Altezza',
857
- type: 'select',
858
- options: [{ value: '', label: '(Nessuno)' }, ...TailwindViewportHeights.map(h => ({ value: `h-${h}`, label: h }))],
859
- admin: {
860
- description: 'Definisce l’altezza dell’elemento.',
861
- width: '50%'
862
- },
863
- });
864
- };
865
-
866
- const fieldSectionProps = (customFields = []) => {
867
- return {
868
- name: 'sctP',
869
- label: 'Proprietà sezione',
870
- type: 'group',
871
- fields: [
872
- ...customFields,
873
- fieldRichText({ name: 'body', label: 'Contenuto', required: false }),
874
- {
875
- type: 'tabs',
876
- tabs: [
877
- {
878
- label: 'Stile',
879
- fields: [
880
- fieldUpload('media', { name: 'bgi', label: 'Immagine di sfondo' }),
881
- fieldThemeColor({ name: 'bgc', label: 'Colore di sfondo', required: false }),
882
- ]
883
- }
884
- ]
885
- },
886
- {
887
- type: 'tabs',
888
- tabs: [
889
- {
890
- label: 'Dimensioni',
891
- fields: [
892
- fieldViewportHeights(),
893
- {
894
- type: 'tabs',
895
- tabs: [{
896
- label: 'Margini',
897
- fields: [
898
- fieldMargins()
899
- ]
900
- },
901
- {
902
- label: 'Paddings',
903
- fields: [
904
- fieldPaddings()
905
- ]
906
- }
907
- ]
908
- }
909
- ]
910
- }
911
- ]
912
- },
913
- ],
914
- };
915
- };
916
-
917
- const fieldSectionTabs = (options = {}) => {
918
- const { config = true, section = true, container = true, content = true, configFields = [], sectionFields = [], containerFields = [], contentFields = [] } = options;
919
- const tabs = [];
920
- if (config) {
921
- tabs.push({
922
- label: 'Configurazione',
923
- fields: [
924
- fieldConfigProps(configFields)
925
- ],
926
- });
927
- }
928
- // Tab per la sezione
929
- if (section) {
930
- tabs.push({
931
- label: 'Sezione',
932
- fields: [
933
- fieldSectionProps(sectionFields)
934
- ],
935
- });
936
- }
937
- // Tab per il container
938
- if (container) {
939
- tabs.push({
940
- label: 'Container',
941
- fields: [
942
- fieldContainerProps(containerFields)
943
- ],
944
- });
945
- }
946
- // Tab per il contenuto
947
- if (content) {
948
- tabs.push({
949
- label: 'Contenuto',
950
- fields: [
951
- fieldContentProps(contentFields)
952
- ],
953
- });
954
- }
955
- return {
956
- type: 'tabs',
957
- tabs: tabs,
958
- };
959
- };
960
-
961
721
  /**
962
722
  * Genera un campo per la selezione delle larghezze del container
963
723
  * @returns Field - Campo di tipo `select` per PayloadCMS
@@ -973,6 +733,27 @@ const fieldContainerWidths = () => {
973
733
  });
974
734
  };
975
735
 
736
+ const fieldThemeColor = (override) => ({
737
+ name: override?.name || 'color',
738
+ label: override?.label || 'Colore',
739
+ type: 'select',
740
+ required: override?.required ?? false,
741
+ options: [
742
+ { label: 'Default', value: '' },
743
+ { label: 'Foreground', value: 'foreground' },
744
+ { label: 'Primary', value: 'primary' },
745
+ { label: 'Secondary', value: 'secondary' },
746
+ { label: 'Accent', value: 'accent' },
747
+ { label: 'Dark', value: 'dark' },
748
+ { label: 'Light', value: 'light' },
749
+ { label: 'White', value: 'white' },
750
+ { label: 'Black', value: 'black' },
751
+ ],
752
+ admin: {
753
+ ...override?.admin,
754
+ },
755
+ });
756
+
976
757
  /**
977
758
  * Genera un campo per la selezione delle altezze
978
759
  * @returns Field - Campo di tipo `select` per PayloadCMS
@@ -983,7 +764,10 @@ const fieldHeights = () => {
983
764
  label: 'Altezza',
984
765
  type: 'select',
985
766
  defaultValue: 'h-full',
986
- options: [{ value: '', label: '(Nessuno)' }, ...TailwindHeights.map(h => ({ value: `h-${h}`, label: h }))],
767
+ options: [
768
+ { value: '', label: '(Nessuno)' },
769
+ ...TailwindHeights.map((h) => ({ value: `h-${h}`, label: h })),
770
+ ],
987
771
  admin: {
988
772
  description: 'Definisce l’altezza dell’elemento.',
989
773
  },
@@ -991,7 +775,7 @@ const fieldHeights = () => {
991
775
  };
992
776
 
993
777
  const concatMarginFields = (args) => {
994
- const { value, siblingData, operation, } = args;
778
+ const { value, siblingData, operation } = args;
995
779
  if (operation === 'create' || operation === 'update') {
996
780
  const margins = siblingData || {};
997
781
  const { all, x, y, t, r, b, l } = margins;
@@ -1046,8 +830,8 @@ const fieldMargins = () => {
1046
830
  min: 0,
1047
831
  max: 96,
1048
832
  admin: {
1049
- width: '33%'
1050
- }
833
+ width: '33%',
834
+ },
1051
835
  }),
1052
836
  fieldNumber({
1053
837
  name: 'x',
@@ -1056,8 +840,8 @@ const fieldMargins = () => {
1056
840
  min: 0,
1057
841
  max: 96,
1058
842
  admin: {
1059
- width: '33%'
1060
- }
843
+ width: '33%',
844
+ },
1061
845
  }),
1062
846
  fieldNumber({
1063
847
  name: 'y',
@@ -1066,8 +850,8 @@ const fieldMargins = () => {
1066
850
  min: 0,
1067
851
  max: 96,
1068
852
  admin: {
1069
- width: '33%'
1070
- }
853
+ width: '33%',
854
+ },
1071
855
  }),
1072
856
  fieldNumber({
1073
857
  name: 't',
@@ -1076,8 +860,8 @@ const fieldMargins = () => {
1076
860
  min: 0,
1077
861
  max: 96,
1078
862
  admin: {
1079
- width: '25%'
1080
- }
863
+ width: '25%',
864
+ },
1081
865
  }),
1082
866
  fieldNumber({
1083
867
  name: 'r',
@@ -1086,8 +870,8 @@ const fieldMargins = () => {
1086
870
  min: 0,
1087
871
  max: 96,
1088
872
  admin: {
1089
- width: '25%'
1090
- }
873
+ width: '25%',
874
+ },
1091
875
  }),
1092
876
  fieldNumber({
1093
877
  name: 'b',
@@ -1096,8 +880,8 @@ const fieldMargins = () => {
1096
880
  min: 0,
1097
881
  max: 96,
1098
882
  admin: {
1099
- width: '25%'
1100
- }
883
+ width: '25%',
884
+ },
1101
885
  }),
1102
886
  fieldNumber({
1103
887
  name: 'l',
@@ -1106,11 +890,11 @@ const fieldMargins = () => {
1106
890
  min: 0,
1107
891
  max: 96,
1108
892
  admin: {
1109
- width: '25%'
1110
- }
893
+ width: '25%',
894
+ },
1111
895
  }),
1112
- ]
1113
- }
896
+ ],
897
+ },
1114
898
  ],
1115
899
  admin: {
1116
900
  description: 'Definisce lo spazio esterno generale, orizzontale, verticale o per ciascun lato.',
@@ -1122,7 +906,7 @@ const fieldMargins = () => {
1122
906
  * Hook per concatenare le classi CSS di padding
1123
907
  */
1124
908
  const concatPaddingFields = (args) => {
1125
- const { value, siblingData, operation, } = args;
909
+ const { value, siblingData, operation } = args;
1126
910
  if (operation === 'create' || operation === 'update') {
1127
911
  const paddings = siblingData || {};
1128
912
  const { all, x, y, t, r, b, l } = paddings;
@@ -1177,8 +961,8 @@ const fieldPaddings = () => {
1177
961
  min: 0,
1178
962
  max: 96,
1179
963
  admin: {
1180
- width: '33%'
1181
- }
964
+ width: '33%',
965
+ },
1182
966
  }),
1183
967
  fieldNumber({
1184
968
  name: 'x',
@@ -1187,8 +971,8 @@ const fieldPaddings = () => {
1187
971
  min: 0,
1188
972
  max: 96,
1189
973
  admin: {
1190
- width: '33%'
1191
- }
974
+ width: '33%',
975
+ },
1192
976
  }),
1193
977
  fieldNumber({
1194
978
  name: 'y',
@@ -1197,8 +981,8 @@ const fieldPaddings = () => {
1197
981
  min: 0,
1198
982
  max: 96,
1199
983
  admin: {
1200
- width: '33%'
1201
- }
984
+ width: '33%',
985
+ },
1202
986
  }),
1203
987
  fieldNumber({
1204
988
  name: 't',
@@ -1207,8 +991,8 @@ const fieldPaddings = () => {
1207
991
  min: 0,
1208
992
  max: 96,
1209
993
  admin: {
1210
- width: '25%'
1211
- }
994
+ width: '25%',
995
+ },
1212
996
  }),
1213
997
  fieldNumber({
1214
998
  name: 'r',
@@ -1217,8 +1001,8 @@ const fieldPaddings = () => {
1217
1001
  min: 0,
1218
1002
  max: 96,
1219
1003
  admin: {
1220
- width: '25%'
1221
- }
1004
+ width: '25%',
1005
+ },
1222
1006
  }),
1223
1007
  fieldNumber({
1224
1008
  name: 'b',
@@ -1227,8 +1011,8 @@ const fieldPaddings = () => {
1227
1011
  min: 0,
1228
1012
  max: 96,
1229
1013
  admin: {
1230
- width: '25%'
1231
- }
1014
+ width: '25%',
1015
+ },
1232
1016
  }),
1233
1017
  fieldNumber({
1234
1018
  name: 'l',
@@ -1237,11 +1021,11 @@ const fieldPaddings = () => {
1237
1021
  min: 0,
1238
1022
  max: 96,
1239
1023
  admin: {
1240
- width: '25%'
1241
- }
1024
+ width: '25%',
1025
+ },
1242
1026
  }),
1243
- ]
1244
- }
1027
+ ],
1028
+ },
1245
1029
  ],
1246
1030
  admin: {
1247
1031
  description: 'Definisce lo spazio interno generale, orizzontale, verticale o per ciascun lato.',
@@ -1249,6 +1033,562 @@ const fieldPaddings = () => {
1249
1033
  };
1250
1034
  };
1251
1035
 
1036
+ const fieldContainerProps = (customFields = []) => {
1037
+ return {
1038
+ name: 'ctrP',
1039
+ label: 'Proprietà container',
1040
+ type: 'group',
1041
+ fields: [
1042
+ ...customFields,
1043
+ fieldRichText({ name: 'body', label: 'Contenuto', required: false }),
1044
+ fieldContainerWidths(),
1045
+ {
1046
+ type: 'tabs',
1047
+ tabs: [
1048
+ {
1049
+ label: 'Stile',
1050
+ fields: [
1051
+ fieldUpload('media', { name: 'bgi', label: 'Immagine di sfondo' }),
1052
+ fieldThemeColor({ name: 'bgc', label: 'Colore di sfondo', required: false }),
1053
+ fieldSelect({
1054
+ name: 'borderRadius',
1055
+ type: 'select',
1056
+ label: 'Angoli arrotondati',
1057
+ defaultValue: 'rounded-none',
1058
+ options: [
1059
+ { label: 'Nessuno', value: 'rounded-none' },
1060
+ { label: 'Piccolo', value: 'rounded-sm' },
1061
+ { label: 'Medio', value: 'rounded-md' },
1062
+ { label: 'Grande', value: 'rounded-lg' },
1063
+ { label: 'Extra Grande', value: 'rounded-xl' },
1064
+ { label: 'Massimo', value: 'rounded-full' },
1065
+ ],
1066
+ admin: {
1067
+ width: '50%',
1068
+ description: 'Imposta lo stile degli angoli arrotondati del contenitore.',
1069
+ },
1070
+ }),
1071
+ fieldSelect({
1072
+ name: 'boxShadow',
1073
+ type: 'select',
1074
+ label: 'Ombra contenitore',
1075
+ defaultValue: 'shadow-none', // Default: nessuna ombra
1076
+ options: [
1077
+ { label: 'Nessuna', value: 'shadow-none' },
1078
+ { label: 'Piccola', value: 'shadow-sm' },
1079
+ { label: 'Normale', value: 'shadow' },
1080
+ { label: 'Media', value: 'shadow-md' },
1081
+ { label: 'Grande', value: 'shadow-lg' },
1082
+ { label: 'Extra Grande', value: 'shadow-xl' },
1083
+ { label: 'Massima', value: 'shadow-2xl' },
1084
+ ],
1085
+ admin: {
1086
+ width: '50%',
1087
+ description: "Imposta lo stile dell'ombra per il contenitore.",
1088
+ },
1089
+ }),
1090
+ ],
1091
+ },
1092
+ {
1093
+ label: 'Dimensioni',
1094
+ fields: [
1095
+ fieldHeights(),
1096
+ {
1097
+ type: 'tabs',
1098
+ tabs: [
1099
+ {
1100
+ label: 'Margini',
1101
+ fields: [fieldMargins()],
1102
+ },
1103
+ {
1104
+ label: 'Paddings',
1105
+ fields: [fieldPaddings()],
1106
+ },
1107
+ ],
1108
+ },
1109
+ ],
1110
+ },
1111
+ ],
1112
+ },
1113
+ ],
1114
+ };
1115
+ };
1116
+
1117
+ const iconsList = [
1118
+ { label: 'Academic Cap', value: 'AcademicCapIcon' },
1119
+ { label: 'Adjustments Horizontal', value: 'AdjustmentsHorizontalIcon' },
1120
+ { label: 'Adjustments Vertical', value: 'AdjustmentsVerticalIcon' },
1121
+ { label: 'Archive Box Arrow Down', value: 'ArchiveBoxArrowDownIcon' },
1122
+ { label: 'Archive Box X Mark', value: 'ArchiveBoxXMarkIcon' },
1123
+ { label: 'Archive Box', value: 'ArchiveBoxIcon' },
1124
+ { label: 'Arrow Down Circle', value: 'ArrowDownCircleIcon' },
1125
+ { label: 'Arrow Down', value: 'ArrowDownIcon' },
1126
+ { label: 'Arrow Left Circle', value: 'ArrowLeftCircleIcon' },
1127
+ { label: 'Arrow Left', value: 'ArrowLeftIcon' },
1128
+ { label: 'Arrow Right Circle', value: 'ArrowRightCircleIcon' },
1129
+ { label: 'Arrow Right', value: 'ArrowRightIcon' },
1130
+ { label: 'Arrow Up Circle', value: 'ArrowUpCircleIcon' },
1131
+ { label: 'Arrow Up', value: 'ArrowUpIcon' },
1132
+ { label: 'Bell Alert', value: 'BellAlertIcon' },
1133
+ { label: 'Bell', value: 'BellIcon' },
1134
+ { label: 'Bookmark Square', value: 'BookmarkSquareIcon' },
1135
+ { label: 'Bookmark', value: 'BookmarkIcon' },
1136
+ { label: 'Building Office', value: 'BuildingOfficeIcon' },
1137
+ { label: 'Calendar', value: 'CalendarIcon' },
1138
+ { label: 'Camera', value: 'CameraIcon' },
1139
+ { label: 'Chart Bar', value: 'ChartBarIcon' },
1140
+ { label: 'Chat Bubble Left Right', value: 'ChatBubbleLeftRightIcon' },
1141
+ { label: 'Chat Bubble Left', value: 'ChatBubbleLeftIcon' },
1142
+ { label: 'Check Circle', value: 'CheckCircleIcon' },
1143
+ { label: 'Check', value: 'CheckIcon' },
1144
+ { label: 'Chevron Down', value: 'ChevronDownIcon' },
1145
+ { label: 'Chevron Left', value: 'ChevronLeftIcon' },
1146
+ { label: 'Chevron Right', value: 'ChevronRightIcon' },
1147
+ { label: 'Chevron Up', value: 'ChevronUpIcon' },
1148
+ { label: 'Clock', value: 'ClockIcon' },
1149
+ { label: 'Cloud Arrow Up', value: 'CloudArrowUpIcon' },
1150
+ { label: 'Cloud', value: 'CloudIcon' },
1151
+ { label: 'Code Bracket', value: 'CodeBracketIcon' },
1152
+ { label: 'Cog', value: 'CogIcon' },
1153
+ { label: 'Command Line', value: 'CommandLineIcon' },
1154
+ { label: 'Computer Desktop', value: 'ComputerDesktopIcon' },
1155
+ { label: 'Credit Card', value: 'CreditCardIcon' },
1156
+ { label: 'Document', value: 'DocumentIcon' },
1157
+ { label: 'Envelope', value: 'EnvelopeIcon' },
1158
+ { label: 'Exclamation Circle', value: 'ExclamationCircleIcon' },
1159
+ { label: 'Exclamation Triangle', value: 'ExclamationTriangleIcon' },
1160
+ { label: 'Eye', value: 'EyeIcon' },
1161
+ { label: 'Face Smile', value: 'FaceSmileIcon' },
1162
+ { label: 'Film', value: 'FilmIcon' },
1163
+ { label: 'Finger Print', value: 'FingerPrintIcon' },
1164
+ { label: 'Fire', value: 'FireIcon' },
1165
+ { label: 'Flag', value: 'FlagIcon' },
1166
+ { label: 'Folder Open', value: 'FolderOpenIcon' },
1167
+ { label: 'Folder', value: 'FolderIcon' },
1168
+ { label: 'Gift', value: 'GiftIcon' },
1169
+ { label: 'Globe Alt', value: 'GlobeAltIcon' },
1170
+ { label: 'Globe Europe Africa', value: 'GlobeEuropeAfricaIcon' },
1171
+ { label: 'Hand Raised', value: 'HandRaisedIcon' },
1172
+ { label: 'Heart', value: 'HeartIcon' },
1173
+ { label: 'Home', value: 'HomeIcon' },
1174
+ { label: 'Identification', value: 'IdentificationIcon' },
1175
+ { label: 'Information Circle', value: 'InformationCircleIcon' },
1176
+ { label: 'Key', value: 'KeyIcon' },
1177
+ { label: 'Link', value: 'LinkIcon' },
1178
+ { label: 'List Bullet', value: 'ListBulletIcon' },
1179
+ { label: 'Lock Closed', value: 'LockClosedIcon' },
1180
+ { label: 'Lock Open', value: 'LockOpenIcon' },
1181
+ { label: 'Magnifying Glass Circle', value: 'MagnifyingGlassCircleIcon' },
1182
+ { label: 'Magnifying Glass', value: 'MagnifyingGlassIcon' },
1183
+ { label: 'Map Pin', value: 'MapPinIcon' },
1184
+ { label: 'Map', value: 'MapIcon' },
1185
+ { label: 'Moon', value: 'MoonIcon' },
1186
+ { label: 'Paper Airplane', value: 'PaperAirplaneIcon' },
1187
+ { label: 'Paper Clip', value: 'PaperClipIcon' },
1188
+ { label: 'Pause Circle', value: 'PauseCircleIcon' },
1189
+ { label: 'Pencil Square', value: 'PencilSquareIcon' },
1190
+ { label: 'Pencil', value: 'PencilIcon' },
1191
+ { label: 'Phone Arrow Up Right', value: 'PhoneArrowUpRightIcon' },
1192
+ { label: 'Phone X Mark', value: 'PhoneXMarkIcon' },
1193
+ { label: 'Phone', value: 'PhoneIcon' },
1194
+ { label: 'Photo', value: 'PhotoIcon' },
1195
+ { label: 'Play Circle', value: 'PlayCircleIcon' },
1196
+ { label: 'Play', value: 'PlayIcon' },
1197
+ { label: 'Plus Circle', value: 'PlusCircleIcon' },
1198
+ { label: 'Plus', value: 'PlusIcon' },
1199
+ { label: 'Power', value: 'PowerIcon' },
1200
+ { label: 'Question Mark Circle', value: 'QuestionMarkCircleIcon' },
1201
+ { label: 'Rocket Launch', value: 'RocketLaunchIcon' },
1202
+ { label: 'Rss', value: 'RssIcon' },
1203
+ { label: 'Scale', value: 'ScaleIcon' },
1204
+ { label: 'Server', value: 'ServerIcon' },
1205
+ { label: 'Share', value: 'ShareIcon' },
1206
+ { label: 'Shield Check', value: 'ShieldCheckIcon' },
1207
+ { label: 'Shield Exclamation', value: 'ShieldExclamationIcon' },
1208
+ { label: 'Shopping Bag', value: 'ShoppingBagIcon' },
1209
+ { label: 'Shopping Cart', value: 'ShoppingCartIcon' },
1210
+ { label: 'Star', value: 'StarIcon' },
1211
+ { label: 'Stop Circle', value: 'StopCircleIcon' },
1212
+ { label: 'Sun', value: 'SunIcon' },
1213
+ { label: 'Tag', value: 'TagIcon' },
1214
+ { label: 'Trash', value: 'TrashIcon' },
1215
+ { label: 'Trophy', value: 'TrophyIcon' },
1216
+ { label: 'User Circle', value: 'UserCircleIcon' },
1217
+ { label: 'User Group', value: 'UserGroupIcon' },
1218
+ { label: 'User', value: 'UserIcon' },
1219
+ { label: 'Users', value: 'UsersIcon' },
1220
+ { label: 'Video Camera', value: 'VideoCameraIcon' },
1221
+ { label: 'Wifi', value: 'WifiIcon' },
1222
+ { label: 'Window', value: 'WindowIcon' },
1223
+ { label: 'Wrench Screwdriver', value: 'WrenchScrewdriverIcon' },
1224
+ { label: 'Wrench', value: 'WrenchIcon' },
1225
+ { label: 'X Circle', value: 'XCircleIcon' },
1226
+ { label: 'X Mark', value: 'XMarkIcon' },
1227
+ ];
1228
+
1229
+ const fieldAction = () => ({
1230
+ type: 'group',
1231
+ label: 'Azione',
1232
+ name: 'action',
1233
+ fields: [
1234
+ fieldCheckbox({
1235
+ name: 'show',
1236
+ label: 'Mostra azione',
1237
+ defaultValue: false,
1238
+ admin: {
1239
+ width: '50%',
1240
+ },
1241
+ }),
1242
+ fieldText({
1243
+ name: 'label',
1244
+ type: 'text',
1245
+ label: 'Testo da visualizzare',
1246
+ defaultValue: 'Action',
1247
+ admin: {
1248
+ width: '50%',
1249
+ },
1250
+ }),
1251
+ fieldSelect({
1252
+ name: 'actionType',
1253
+ label: 'Tipo di azione',
1254
+ defaultValue: 'internalLink',
1255
+ admin: {
1256
+ width: '33%',
1257
+ },
1258
+ options: [
1259
+ {
1260
+ label: 'Interno',
1261
+ value: 'internalLink',
1262
+ },
1263
+ {
1264
+ label: 'Esterno',
1265
+ value: 'externalLink',
1266
+ },
1267
+ /*
1268
+ {
1269
+ label: 'Azione',
1270
+ value: 'customAction',
1271
+ },
1272
+ */
1273
+ ],
1274
+ }),
1275
+ {
1276
+ name: 'internalLink',
1277
+ type: 'relationship',
1278
+ label: 'Seleziona una pagina interna',
1279
+ admin: {
1280
+ condition: (data, siblingData) => {
1281
+ return siblingData?.actionType === 'internalLink';
1282
+ },
1283
+ },
1284
+ relationTo: ['pages', 'posts', 'destinations'],
1285
+ },
1286
+ {
1287
+ name: 'externalLink',
1288
+ type: 'text',
1289
+ label: 'URL esterno',
1290
+ admin: {
1291
+ condition: (data, siblingData) => {
1292
+ return siblingData?.actionType === 'externalLink';
1293
+ },
1294
+ },
1295
+ },
1296
+ {
1297
+ type: 'collapsible',
1298
+ label: 'Stile',
1299
+ fields: [
1300
+ {
1301
+ type: 'row',
1302
+ fields: [
1303
+ {
1304
+ name: 'buttonStyle',
1305
+ type: 'select',
1306
+ label: 'Stile bottone',
1307
+ defaultValue: 'solid',
1308
+ admin: {
1309
+ width: '33%',
1310
+ },
1311
+ options: [
1312
+ { label: 'Solido', value: 'solid' },
1313
+ { label: 'Outline', value: 'outline' },
1314
+ { label: 'Ghost', value: 'ghost' },
1315
+ { label: 'Link', value: 'link' },
1316
+ ],
1317
+ },
1318
+ {
1319
+ name: 'buttonColor',
1320
+ type: 'select',
1321
+ label: 'Colore bottone',
1322
+ defaultValue: 'primary',
1323
+ admin: {
1324
+ width: '33%',
1325
+ },
1326
+ options: [
1327
+ { label: 'Primary', value: 'primary' },
1328
+ { label: 'Secondary', value: 'secondary' },
1329
+ { label: 'Accent', value: 'accent' },
1330
+ { label: 'Dark', value: 'dark' },
1331
+ { label: 'Light', value: 'light' },
1332
+ ],
1333
+ },
1334
+ {
1335
+ name: 'buttonSize',
1336
+ type: 'select',
1337
+ label: 'Dimensione bottone',
1338
+ defaultValue: 'default',
1339
+ admin: {
1340
+ width: '33%',
1341
+ },
1342
+ options: [
1343
+ { label: 'Small', value: 'small' },
1344
+ { label: 'Default', value: 'default' },
1345
+ { label: 'Medium', value: 'medium' },
1346
+ { label: 'Large', value: 'large' },
1347
+ { label: 'Extra Large', value: 'xl' },
1348
+ ],
1349
+ },
1350
+ {
1351
+ name: 'buttonRounded',
1352
+ type: 'select',
1353
+ label: 'Arrotondamento',
1354
+ defaultValue: 'default',
1355
+ admin: {
1356
+ width: '33%',
1357
+ },
1358
+ options: [
1359
+ { label: 'Nessuno', value: 'none' },
1360
+ { label: 'Piccolo', value: 'sm' },
1361
+ { label: 'Standard', value: 'default' },
1362
+ { label: 'Grande', value: 'lg' },
1363
+ { label: 'Completo', value: 'full' },
1364
+ ],
1365
+ },
1366
+ {
1367
+ name: 'alignment',
1368
+ type: 'select',
1369
+ label: 'Allineamento del Bottone',
1370
+ defaultValue: 'left',
1371
+ options: [
1372
+ {
1373
+ label: 'Sinistra',
1374
+ value: 'left',
1375
+ },
1376
+ {
1377
+ label: 'Centro',
1378
+ value: 'center',
1379
+ },
1380
+ {
1381
+ label: 'Destra',
1382
+ value: 'right',
1383
+ },
1384
+ ],
1385
+ admin: {
1386
+ width: '33%',
1387
+ condition: (data) => true, // Puoi modificare questa condizione se il campo deve essere mostrato solo in determinate circostanze
1388
+ },
1389
+ },
1390
+ fieldThemeColor({
1391
+ name: 'textColor',
1392
+ label: 'Colore del testo',
1393
+ admin: {
1394
+ width: '33%',
1395
+ },
1396
+ }),
1397
+ {
1398
+ name: 'additionalEffects',
1399
+ type: 'select',
1400
+ label: 'Effetti aggiuntivi',
1401
+ hasMany: true,
1402
+ admin: {
1403
+ width: '33%',
1404
+ },
1405
+ options: [
1406
+ { label: 'Ombra', value: 'shadow' },
1407
+ { label: 'Transizione', value: 'transition' },
1408
+ { label: 'Animazione scala', value: 'scale' },
1409
+ ],
1410
+ },
1411
+ ],
1412
+ },
1413
+ {
1414
+ type: 'row',
1415
+ fields: [
1416
+ {
1417
+ name: 'useIcon',
1418
+ type: 'checkbox',
1419
+ label: 'Usa icona',
1420
+ defaultValue: false,
1421
+ admin: {
1422
+ width: '33%',
1423
+ },
1424
+ },
1425
+ {
1426
+ name: 'iconPosition',
1427
+ type: 'select',
1428
+ label: 'Posizione icona',
1429
+ defaultValue: 'left',
1430
+ admin: {
1431
+ width: '33%',
1432
+ condition: (_, siblingData) => siblingData?.useIcon === true,
1433
+ },
1434
+ options: [
1435
+ { label: 'Sinistra', value: 'left' },
1436
+ { label: 'Destra', value: 'right' },
1437
+ { label: 'Solo icona', value: 'only' },
1438
+ ],
1439
+ },
1440
+ {
1441
+ name: 'iconName',
1442
+ type: 'select',
1443
+ label: 'Icona',
1444
+ options: [...iconsList],
1445
+ admin: {
1446
+ width: '33%',
1447
+ condition: (_, siblingData) => siblingData?.useIcon === true,
1448
+ },
1449
+ // Qui potresti usare un select con le icone disponibili se hai una libreria predefinita
1450
+ },
1451
+ ],
1452
+ },
1453
+ ],
1454
+ },
1455
+ ],
1456
+ });
1457
+
1458
+ const fieldConfigProps = (customFields = []) => {
1459
+ return {
1460
+ name: 'config',
1461
+ label: 'Configurazione',
1462
+ type: 'group',
1463
+ fields: [
1464
+ ...customFields,
1465
+ ],
1466
+ };
1467
+ };
1468
+
1469
+ const fieldContentProps = (customFields = []) => {
1470
+ return {
1471
+ name: 'cntP',
1472
+ label: 'Contenuto',
1473
+ type: 'group',
1474
+ fields: [
1475
+ ...customFields,
1476
+ ],
1477
+ };
1478
+ };
1479
+
1480
+ /**
1481
+ * Genera un campo per la selezione delle altezze
1482
+ * @returns Field - Campo di tipo `select` per PayloadCMS
1483
+ */
1484
+ const fieldViewportHeights = () => {
1485
+ return fieldSelect({
1486
+ name: 'h',
1487
+ label: 'Altezza',
1488
+ type: 'select',
1489
+ options: [
1490
+ { value: '', label: '(Nessuno)' },
1491
+ ...TailwindViewportHeights.map((h) => ({ value: `h-${h}`, label: h })),
1492
+ ],
1493
+ admin: {
1494
+ description: 'Definisce l’altezza dell’elemento.',
1495
+ width: '50%',
1496
+ },
1497
+ });
1498
+ };
1499
+
1500
+ const fieldSectionProps = (customFields = []) => {
1501
+ return {
1502
+ name: 'sctP',
1503
+ label: 'Proprietà sezione',
1504
+ type: 'group',
1505
+ fields: [
1506
+ ...customFields,
1507
+ fieldRichText({ name: 'body', label: 'Contenuto', required: false }),
1508
+ {
1509
+ type: 'tabs',
1510
+ tabs: [
1511
+ {
1512
+ label: 'Stile',
1513
+ fields: [
1514
+ fieldUpload('media', { name: 'bgi', label: 'Immagine di sfondo' }),
1515
+ fieldThemeColor({ name: 'bgc', label: 'Colore di sfondo', required: false }),
1516
+ ],
1517
+ },
1518
+ ],
1519
+ },
1520
+ {
1521
+ type: 'tabs',
1522
+ tabs: [
1523
+ {
1524
+ label: 'Dimensioni',
1525
+ fields: [
1526
+ fieldViewportHeights(),
1527
+ {
1528
+ type: 'tabs',
1529
+ tabs: [
1530
+ {
1531
+ label: 'Margini',
1532
+ fields: [fieldMargins()],
1533
+ },
1534
+ {
1535
+ label: 'Paddings',
1536
+ fields: [fieldPaddings()],
1537
+ },
1538
+ ],
1539
+ },
1540
+ ],
1541
+ },
1542
+ ],
1543
+ },
1544
+ ],
1545
+ };
1546
+ };
1547
+
1548
+ const fieldSectionTabs = (options = {}) => {
1549
+ const { config = true, section = true, container = true, content = true, configFields = [], sectionFields = [], containerFields = [], contentFields = [] } = options;
1550
+ const tabs = [];
1551
+ if (config) {
1552
+ tabs.push({
1553
+ label: 'Configurazione',
1554
+ fields: [
1555
+ fieldConfigProps(configFields)
1556
+ ],
1557
+ });
1558
+ }
1559
+ // Tab per la sezione
1560
+ if (section) {
1561
+ tabs.push({
1562
+ label: 'Sezione',
1563
+ fields: [
1564
+ fieldSectionProps(sectionFields)
1565
+ ],
1566
+ });
1567
+ }
1568
+ // Tab per il container
1569
+ if (container) {
1570
+ tabs.push({
1571
+ label: 'Container',
1572
+ fields: [
1573
+ fieldContainerProps(containerFields)
1574
+ ],
1575
+ });
1576
+ }
1577
+ // Tab per il contenuto
1578
+ if (content) {
1579
+ tabs.push({
1580
+ label: 'Contenuto',
1581
+ fields: [
1582
+ fieldContentProps(contentFields)
1583
+ ],
1584
+ });
1585
+ }
1586
+ return {
1587
+ type: 'tabs',
1588
+ tabs: tabs,
1589
+ };
1590
+ };
1591
+
1252
1592
  var UserRole;
1253
1593
  (function (UserRole) {
1254
1594
  UserRole["ADMIN"] = "admin";
@@ -1282,6 +1622,7 @@ const fieldRoles = (override) => ({
1282
1622
  });
1283
1623
 
1284
1624
  exports.TailwindTextSizes = TailwindTextSizes;
1625
+ exports.fieldAction = fieldAction;
1285
1626
  exports.fieldArray = fieldArray;
1286
1627
  exports.fieldCheckbox = fieldCheckbox;
1287
1628
  exports.fieldConfigProps = fieldConfigProps;
@@ -1302,5 +1643,6 @@ exports.fieldText = fieldText;
1302
1643
  exports.fieldThemeColor = fieldThemeColor;
1303
1644
  exports.fieldUpload = fieldUpload;
1304
1645
  exports.fieldViewportHeights = fieldViewportHeights;
1646
+ exports.iconsList = iconsList;
1305
1647
  exports.index = index;
1306
- //# sourceMappingURL=fieldRoles-BH5WwJxZ.js.map
1648
+ //# sourceMappingURL=fieldRoles-ByWB8j1Q.js.map