@woodylab/payload 0.0.12 → 0.0.14

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.
@@ -1,4 +1,4 @@
1
- import { c as fieldUpload, f as fieldCheckbox, a as fieldText, d as fieldSelect, T as TailwindViewportHeights, e as TailwindContainerWidths, g as TailwindTextSizes, h as TailwindHeights, b as fieldArray, j as fieldRoles } from './fieldRoles-bNqKk0DO.js';
1
+ import { f as fieldCheckbox, a as fieldText, d as fieldSelect, e as fieldThemeColor, T as TailwindTextSizes, b as fieldArray, j as fieldConfigProps, k as fieldContainerProps, l as fieldContainerWidths, m as fieldContentProps, n as fieldHeights, o as fieldMargins, p as fieldNumber, q as fieldPaddings, g as fieldRelationship, r as fieldRichText, s as fieldRoles, t as fieldSectionProps, h as fieldSectionTabs, c as fieldUpload, u as fieldViewportHeights } from './fieldRoles-BbW92YWL.js';
2
2
 
3
3
  const fieldTextArea = (override) => ({
4
4
  name: 'textarea',
@@ -57,14 +57,6 @@ const fieldJoin = (collection, on, override) => ({
57
57
  ...override,
58
58
  });
59
59
 
60
- const fieldNumber = (override) => ({
61
- name: 'number',
62
- label: 'Number',
63
- type: 'number',
64
- required: false,
65
- ...override,
66
- });
67
-
68
60
  const fieldPoint = (override) => ({
69
61
  name: 'point',
70
62
  label: 'Point',
@@ -91,133 +83,6 @@ const fieldRadioGroup = (override) => ({
91
83
  ...override,
92
84
  });
93
85
 
94
- const fieldRelationship = (relationTo, override) => ({
95
- name: 'relationship',
96
- label: 'Relationship',
97
- type: 'relationship',
98
- relationTo,
99
- required: false,
100
- ...override,
101
- });
102
-
103
- const fieldRichText = (override) => ({
104
- name: 'richText',
105
- label: 'Rich Text',
106
- type: 'richText',
107
- required: false,
108
- admin: {
109
- placeholder: 'Insert text here',
110
- rows: 5,
111
- },
112
- ...override,
113
- });
114
-
115
- const fieldContainerProps = (customFields = []) => {
116
- return {
117
- name: 'ctrP',
118
- label: 'Proprietà container',
119
- type: 'group',
120
- fields: [
121
- ...customFields,
122
- fieldRichText({ name: 'body', label: 'Contenuto', required: false }),
123
- fieldContainerWidths(),
124
- {
125
- type: 'tabs',
126
- tabs: [
127
- {
128
- label: 'Stile',
129
- fields: [
130
- fieldUpload('media', { name: 'bgi', label: 'Immagine di sfondo' }),
131
- //WFieldColor({name:'bgc', label:'Colore di sfondo', required:false}),
132
- {
133
- name: 'borderRadius',
134
- type: 'select',
135
- label: 'Angoli arrotondati',
136
- defaultValue: 'rounded-none',
137
- options: [
138
- { label: 'Nessuno', value: 'rounded-none' },
139
- { label: 'Piccolo', value: 'rounded-sm' },
140
- { label: 'Medio', value: 'rounded-md' },
141
- { label: 'Grande', value: 'rounded-lg' },
142
- { label: 'Extra Grande', value: 'rounded-xl' },
143
- { label: 'Massimo', value: 'rounded-full' },
144
- ],
145
- admin: {
146
- width: '50%',
147
- description: 'Imposta lo stile degli angoli arrotondati del contenitore.',
148
- },
149
- },
150
- {
151
- name: 'boxShadow',
152
- type: 'select',
153
- label: 'Ombra contenitore',
154
- defaultValue: 'shadow-none', // Default: nessuna ombra
155
- options: [
156
- { label: 'Nessuna', value: 'shadow-none' },
157
- { label: 'Piccola', value: 'shadow-sm' },
158
- { label: 'Normale', value: 'shadow' },
159
- { label: 'Media', value: 'shadow-md' },
160
- { label: 'Grande', value: 'shadow-lg' },
161
- { label: 'Extra Grande', value: 'shadow-xl' },
162
- { label: 'Massima', value: 'shadow-2xl' },
163
- ],
164
- admin: {
165
- width: '50%',
166
- description: 'Imposta lo stile dell\'ombra per il contenitore.',
167
- },
168
- }
169
- ]
170
- },
171
- {
172
- label: 'Dimensioni',
173
- fields: [
174
- fieldHeights(),
175
- {
176
- type: 'tabs',
177
- tabs: [
178
- {
179
- label: 'Margini',
180
- fields: [
181
- fieldMargins()
182
- ]
183
- },
184
- {
185
- label: 'Paddings',
186
- fields: [
187
- fieldPaddings()
188
- ]
189
- }
190
- ]
191
- }
192
- ]
193
- }
194
- ]
195
- },
196
- ]
197
- };
198
- };
199
-
200
- const fieldThemeColor = (override) => ({
201
- name: override?.name || 'color',
202
- label: override?.label || 'Colore',
203
- type: 'select',
204
- required: override?.required ?? false,
205
- options: [
206
- { label: 'Default', value: '' },
207
- { label: 'Foreground', value: 'foreground' },
208
- { label: 'Primary', value: 'primary' },
209
- { label: 'Secondary', value: 'secondary' },
210
- { label: 'Accent', value: 'accent' },
211
- { label: 'Dark', value: 'dark' },
212
- { label: 'Light', value: 'light' },
213
- { label: 'White', value: 'white' },
214
- { label: 'Black', value: 'black' },
215
- ],
216
- admin: {
217
- ...override?.admin,
218
- },
219
- });
220
-
221
86
  const iconsList = [
222
87
  { label: 'Academic Cap', value: 'AcademicCapIcon' },
223
88
  { label: 'Adjustments Horizontal', value: 'AdjustmentsHorizontalIcon' },
@@ -556,155 +421,6 @@ const fieldAction = () => ({
556
421
  ]
557
422
  });
558
423
 
559
- const fieldConfigProps = (customFields = []) => {
560
- return {
561
- name: 'config',
562
- label: 'Configurazione',
563
- type: 'group',
564
- fields: [
565
- ...customFields,
566
- ],
567
- };
568
- };
569
-
570
- const fieldContentProps = (customFields = []) => {
571
- return {
572
- name: 'cntP',
573
- label: 'Contenuto',
574
- type: 'group',
575
- fields: [
576
- ...customFields,
577
- ],
578
- };
579
- };
580
-
581
- /**
582
- * Genera un campo per la selezione delle altezze
583
- * @returns Field - Campo di tipo `select` per PayloadCMS
584
- */
585
- const fieldViewportHeights = () => {
586
- return fieldSelect({
587
- name: 'h',
588
- label: 'Altezza',
589
- type: 'select',
590
- options: [{ value: '', label: '(Nessuno)' }, ...TailwindViewportHeights.map(h => ({ value: `h-${h}`, label: h }))],
591
- admin: {
592
- description: 'Definisce l’altezza dell’elemento.',
593
- width: '50%'
594
- },
595
- });
596
- };
597
-
598
- const fieldSectionProps = (customFields = []) => {
599
- return {
600
- name: 'sctP',
601
- label: 'Proprietà sezione',
602
- type: 'group',
603
- fields: [
604
- ...customFields,
605
- fieldRichText({ name: 'body', label: 'Contenuto', required: false }),
606
- {
607
- type: 'tabs',
608
- tabs: [
609
- {
610
- label: 'Stile',
611
- fields: [
612
- fieldUpload('media', { name: 'bgi', label: 'Immagine di sfondo' }),
613
- fieldThemeColor({ name: 'bgc', label: 'Colore di sfondo', required: false }),
614
- ]
615
- }
616
- ]
617
- },
618
- {
619
- type: 'tabs',
620
- tabs: [
621
- {
622
- label: 'Dimensioni',
623
- fields: [
624
- fieldViewportHeights(),
625
- {
626
- type: 'tabs',
627
- tabs: [{
628
- label: 'Margini',
629
- fields: [
630
- fieldMargins()
631
- ]
632
- },
633
- {
634
- label: 'Paddings',
635
- fields: [
636
- fieldPaddings()
637
- ]
638
- }
639
- ]
640
- }
641
- ]
642
- }
643
- ]
644
- },
645
- ],
646
- };
647
- };
648
-
649
- const fieldSectionTabs = (options = {}) => {
650
- const { config = true, section = true, container = true, content = true, configFields = [], sectionFields = [], containerFields = [], contentFields = [] } = options;
651
- const tabs = [];
652
- if (config) {
653
- tabs.push({
654
- label: 'Configurazione',
655
- fields: [
656
- fieldConfigProps(configFields)
657
- ],
658
- });
659
- }
660
- // Tab per la sezione
661
- if (section) {
662
- tabs.push({
663
- label: 'Sezione',
664
- fields: [
665
- fieldSectionProps(sectionFields)
666
- ],
667
- });
668
- }
669
- // Tab per il container
670
- if (container) {
671
- tabs.push({
672
- label: 'Container',
673
- fields: [
674
- fieldContainerProps(containerFields)
675
- ],
676
- });
677
- }
678
- // Tab per il contenuto
679
- if (content) {
680
- tabs.push({
681
- label: 'Contenuto',
682
- fields: [
683
- fieldContentProps(contentFields)
684
- ],
685
- });
686
- }
687
- return {
688
- type: 'tabs',
689
- tabs: tabs,
690
- };
691
- };
692
-
693
- /**
694
- * Genera un campo per la selezione delle larghezze del container
695
- * @returns Field - Campo di tipo `select` per PayloadCMS
696
- */
697
- const fieldContainerWidths = () => {
698
- return fieldSelect({
699
- name: 'container',
700
- label: 'Larghezza del container',
701
- options: [{ value: '', label: '(Nessuno)' }, ...TailwindContainerWidths],
702
- admin: {
703
- description: 'Seleziona una larghezza massima per il container. Usa "None" per una larghezza a schermo intero.',
704
- },
705
- });
706
- };
707
-
708
424
  const fieldFontSizes = () => {
709
425
  return fieldSelect({
710
426
  name: 'fs',
@@ -717,282 +433,6 @@ const fieldFontSizes = () => {
717
433
  });
718
434
  };
719
435
 
720
- /**
721
- * Genera un campo per la selezione delle altezze
722
- * @returns Field - Campo di tipo `select` per PayloadCMS
723
- */
724
- const fieldHeights = () => {
725
- return fieldSelect({
726
- name: 'h',
727
- label: 'Altezza',
728
- type: 'select',
729
- defaultValue: 'h-full',
730
- options: [{ value: '', label: '(Nessuno)' }, ...TailwindHeights.map(h => ({ value: `h-${h}`, label: h }))],
731
- admin: {
732
- description: 'Definisce l’altezza dell’elemento.',
733
- },
734
- });
735
- };
736
-
737
- const concatMarginFields = (args) => {
738
- const { value, siblingData, operation, } = args;
739
- if (operation === 'create' || operation === 'update') {
740
- const margins = siblingData || {};
741
- const { all, x, y, t, r, b, l } = margins;
742
- const classes = [];
743
- if (all)
744
- classes.push(`m-${all}`);
745
- if (x)
746
- classes.push(`mx-${x}`);
747
- if (y)
748
- classes.push(`my-${y}`);
749
- if (t)
750
- classes.push(`mt-${t}`);
751
- if (r)
752
- classes.push(`mr-${r}`);
753
- if (b)
754
- classes.push(`mb-${b}`);
755
- if (l)
756
- classes.push(`ml-${l}`);
757
- return classes.join(' ');
758
- }
759
- return value;
760
- };
761
- /**
762
- * Genera un campo per la selezione dinamica dei margini
763
- * @returns Field - Campo di tipo `group` per PayloadCMS
764
- */
765
- const fieldMargins = () => {
766
- return {
767
- name: 'm',
768
- label: 'Margini',
769
- type: 'group',
770
- fields: [
771
- {
772
- name: 'className',
773
- label: 'Classi CSS Margini',
774
- type: 'text',
775
- hooks: {
776
- beforeChange: [concatMarginFields],
777
- },
778
- admin: {
779
- readOnly: true,
780
- description: 'Questa stringa verrà generata automaticamente in base ai campi sottostanti.',
781
- },
782
- },
783
- {
784
- type: 'row',
785
- fields: [
786
- fieldNumber({
787
- name: 'all',
788
- label: 'Tutti i lati',
789
- type: 'number',
790
- min: 0,
791
- max: 96,
792
- admin: {
793
- width: '33%'
794
- }
795
- }),
796
- fieldNumber({
797
- name: 'x',
798
- label: 'Orizzontale',
799
- type: 'number',
800
- min: 0,
801
- max: 96,
802
- admin: {
803
- width: '33%'
804
- }
805
- }),
806
- fieldNumber({
807
- name: 'y',
808
- label: 'Verticale',
809
- type: 'number',
810
- min: 0,
811
- max: 96,
812
- admin: {
813
- width: '33%'
814
- }
815
- }),
816
- fieldNumber({
817
- name: 't',
818
- label: 'Top',
819
- type: 'number',
820
- min: 0,
821
- max: 96,
822
- admin: {
823
- width: '25%'
824
- }
825
- }),
826
- fieldNumber({
827
- name: 'r',
828
- label: 'Right',
829
- type: 'number',
830
- min: 0,
831
- max: 96,
832
- admin: {
833
- width: '25%'
834
- }
835
- }),
836
- fieldNumber({
837
- name: 'b',
838
- label: 'Bottom',
839
- type: 'number',
840
- min: 0,
841
- max: 96,
842
- admin: {
843
- width: '25%'
844
- }
845
- }),
846
- fieldNumber({
847
- name: 'l',
848
- label: 'Left',
849
- type: 'number',
850
- min: 0,
851
- max: 96,
852
- admin: {
853
- width: '25%'
854
- }
855
- }),
856
- ]
857
- }
858
- ],
859
- admin: {
860
- description: 'Definisce lo spazio esterno generale, orizzontale, verticale o per ciascun lato.',
861
- },
862
- };
863
- };
864
-
865
- /**
866
- * Hook per concatenare le classi CSS di padding
867
- */
868
- const concatPaddingFields = (args) => {
869
- const { value, siblingData, operation, } = args;
870
- if (operation === 'create' || operation === 'update') {
871
- const paddings = siblingData || {};
872
- const { all, x, y, t, r, b, l } = paddings;
873
- const classes = [];
874
- if (all)
875
- classes.push(`p-${all}`);
876
- if (x)
877
- classes.push(`px-${x}`);
878
- if (y)
879
- classes.push(`py-${y}`);
880
- if (t)
881
- classes.push(`pt-${t}`);
882
- if (r)
883
- classes.push(`pr-${r}`);
884
- if (b)
885
- classes.push(`pb-${b}`);
886
- if (l)
887
- classes.push(`pl-${l}`);
888
- return classes.join(' ');
889
- }
890
- return value;
891
- };
892
- /**
893
- * Genera un campo per la selezione dinamica dei padding
894
- * @returns Field - Campo di tipo `group` per PayloadCMS
895
- */
896
- const fieldPaddings = () => {
897
- return {
898
- name: 'p',
899
- label: 'Padding',
900
- type: 'group',
901
- fields: [
902
- {
903
- name: 'className',
904
- label: 'Classi CSS Padding',
905
- type: 'text',
906
- hooks: {
907
- beforeChange: [concatPaddingFields],
908
- },
909
- admin: {
910
- readOnly: true,
911
- description: 'Questa stringa verrà generata automaticamente in base ai campi sottostanti.',
912
- },
913
- },
914
- {
915
- type: 'row',
916
- fields: [
917
- fieldNumber({
918
- name: 'all',
919
- label: 'Tutti i lati',
920
- type: 'number',
921
- min: 0,
922
- max: 96,
923
- admin: {
924
- width: '33%'
925
- }
926
- }),
927
- fieldNumber({
928
- name: 'x',
929
- label: 'Orizzontale',
930
- type: 'number',
931
- min: 0,
932
- max: 96,
933
- admin: {
934
- width: '33%'
935
- }
936
- }),
937
- fieldNumber({
938
- name: 'y',
939
- label: 'Verticale',
940
- type: 'number',
941
- min: 0,
942
- max: 96,
943
- admin: {
944
- width: '33%'
945
- }
946
- }),
947
- fieldNumber({
948
- name: 't',
949
- label: 'Top',
950
- type: 'number',
951
- min: 0,
952
- max: 96,
953
- admin: {
954
- width: '25%'
955
- }
956
- }),
957
- fieldNumber({
958
- name: 'r',
959
- label: 'Right',
960
- type: 'number',
961
- min: 0,
962
- max: 96,
963
- admin: {
964
- width: '25%'
965
- }
966
- }),
967
- fieldNumber({
968
- name: 'b',
969
- label: 'Bottom',
970
- type: 'number',
971
- min: 0,
972
- max: 96,
973
- admin: {
974
- width: '25%'
975
- }
976
- }),
977
- fieldNumber({
978
- name: 'l',
979
- label: 'Left',
980
- type: 'number',
981
- min: 0,
982
- max: 96,
983
- admin: {
984
- width: '25%'
985
- }
986
- }),
987
- ]
988
- }
989
- ],
990
- admin: {
991
- description: 'Definisce lo spazio interno generale, orizzontale, verticale o per ciascun lato.',
992
- },
993
- };
994
- };
995
-
996
436
  const fieldMenuItems = (override) => ({
997
437
  name: 'menuItems',
998
438
  label: 'Menu items',
@@ -1072,5 +512,5 @@ var index = /*#__PURE__*/Object.freeze({
1072
512
  fieldViewportHeights: fieldViewportHeights
1073
513
  });
1074
514
 
1075
- export { fieldBlocks as a, fieldCode as b, fieldDate as c, fieldEmail as d, fieldJoin as e, fieldTextArea as f, fieldNumber as g, fieldPoint as h, index as i, fieldRadioGroup as j, fieldRelationship as k, fieldRichText as l, fieldContainerProps as m, fieldAction as n, fieldConfigProps as o, fieldContentProps as p, fieldSectionProps as q, fieldSectionTabs as r, fieldThemeColor as s, fieldContainerWidths as t, fieldFontSizes as u, fieldHeights as v, fieldMargins as w, fieldPaddings as x, fieldViewportHeights as y, fieldMenuItems as z };
1076
- //# sourceMappingURL=index-DDhqrKyJ.js.map
515
+ export { fieldBlocks as a, fieldCode as b, fieldDate as c, fieldEmail as d, fieldJoin as e, fieldTextArea as f, fieldPoint as g, fieldRadioGroup as h, index as i, fieldAction as j, fieldFontSizes as k, fieldMenuItems as l };
516
+ //# sourceMappingURL=index-kCiCVXG-.js.map