@woodylab/payload 0.0.18 → 0.0.21

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