@woodylab/payload 0.0.130 → 0.0.132

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 (272) hide show
  1. package/dist/LayoutRenderer-B1IoWb16.js +2 -0
  2. package/dist/LayoutRenderer-B1IoWb16.js.map +1 -0
  3. package/dist/LayoutRenderer-Ba6ITI7O.js +2 -0
  4. package/dist/LayoutRenderer-Ba6ITI7O.js.map +1 -0
  5. package/dist/config/blocks/blockCard.d.ts +2 -0
  6. package/dist/config/blocks/blockCard.js +101 -0
  7. package/dist/config/blocks/blockReference.d.ts +2 -0
  8. package/dist/config/blocks/blockReference.js +11 -0
  9. package/dist/config/{blockView.js → blocks/blockView.js} +35 -91
  10. package/dist/config/collections/collectionBlocks.d.ts +2 -0
  11. package/dist/config/collections/collectionBlocks.js +35 -0
  12. package/dist/config/{collectionComponentDefinitions.d.ts → collections/collectionComponentDefinitions.d.ts} +1 -1
  13. package/dist/config/collections/collectionComponentDefinitions.js +40 -0
  14. package/dist/config/collections/collectionMenus.d.ts +2 -0
  15. package/dist/config/{collectionMenus.js → collections/collectionMenus.js} +18 -16
  16. package/dist/config/collections/collectionStyles.d.ts +2 -0
  17. package/dist/config/collections/collectionStyles.js +25 -0
  18. package/dist/config/{collectionViewModes.d.ts → collections/collectionViewModes.d.ts} +1 -1
  19. package/dist/config/collections/collectionViewModes.js +106 -0
  20. package/dist/config/fields/fieldCss.js +537 -0
  21. package/dist/config/fields/fieldRoles.d.ts +2 -0
  22. package/dist/{fields/utils → config/fields}/fieldRoles.js +7 -11
  23. package/dist/config/fields/tailwindFieldSelectors.d.ts +2 -1
  24. package/dist/config/fields/tailwindFieldSelectors.js +1547 -1
  25. package/dist/config/fields/tailwindSelectorVariants.js +45 -45
  26. package/dist/config/{configFooter.js → globals/configFooter.js} +11 -9
  27. package/dist/config/{configHeader.js → globals/configHeader.js} +11 -10
  28. package/dist/config/{configSettings.js → globals/configSettings.js} +48 -26
  29. package/dist/{hooks → config/hooks}/fields/populateSiblingClassName.js +0 -2
  30. package/dist/{hooks → config/hooks}/fields/populateSiblingClassNameAfterChange.js +0 -1
  31. package/dist/config/hooks/fields/resolveComponentFromRef.d.ts +2 -0
  32. package/dist/config/hooks/fields/resolveComponentFromRef.js +30 -0
  33. package/dist/config/hooks/fields/resolveStyleFromRef.d.ts +2 -0
  34. package/dist/config/hooks/fields/resolveStyleFromRef.js +35 -0
  35. package/dist/config/hooks/fields/resolveViewModeFromRef.d.ts +2 -0
  36. package/dist/config/hooks/fields/resolveViewModeFromRef.js +23 -0
  37. package/dist/config/index.cjs.js +1 -1
  38. package/dist/config/index.cjs.js.map +1 -1
  39. package/dist/config/index.d.ts +15 -9
  40. package/dist/config/index.esm.js +1 -1
  41. package/dist/config/index.esm.js.map +1 -1
  42. package/dist/config/index.js +15 -9
  43. package/dist/index.cjs.js +1 -1
  44. package/dist/index.d.ts +1 -0
  45. package/dist/index.esm.js +1 -1
  46. package/dist/index.js +2 -0
  47. package/dist/react/ComponentRenderer.js +1 -1
  48. package/dist/react/LayoutRenderer.d.ts +5 -0
  49. package/dist/react/LayoutRenderer.js +19 -0
  50. package/dist/react/componentRegistry.js +7 -0
  51. package/dist/react/components/Card.d.ts +19 -0
  52. package/dist/react/components/Card.js +6 -0
  53. package/dist/react/components/Container.d.ts +5 -0
  54. package/dist/react/components/Container.js +4 -0
  55. package/dist/react/components/View.d.ts +1 -0
  56. package/dist/react/components/View.js +9 -0
  57. package/dist/react/index.cjs.js +1 -1
  58. package/dist/react/index.d.ts +5 -5
  59. package/dist/react/index.esm.js +1 -1
  60. package/dist/react/index.js +5 -5
  61. package/dist/resolveLayout-DlRnQBn8.js +2 -0
  62. package/dist/resolveLayout-DlRnQBn8.js.map +1 -0
  63. package/dist/resolveLayout-DryOXHEy.js +2 -0
  64. package/dist/resolveLayout-DryOXHEy.js.map +1 -0
  65. package/dist/seeders/UIMSSeeder.d.ts +7 -0
  66. package/dist/seeders/UIMSSeeder.js +14 -0
  67. package/dist/seeders/clearCollection.d.ts +2 -0
  68. package/dist/seeders/clearCollection.js +18 -0
  69. package/dist/seeders/components.d.ts +1 -0
  70. package/dist/seeders/components.js +3 -0
  71. package/dist/seeders/generateTailwindStyles.d.ts +6 -0
  72. package/dist/seeders/generateTailwindStyles.js +18 -0
  73. package/dist/seeders/index.cjs.js +2 -0
  74. package/dist/seeders/index.cjs.js.map +1 -0
  75. package/dist/seeders/index.d.ts +2 -0
  76. package/dist/seeders/index.esm.js +2 -0
  77. package/dist/seeders/index.esm.js.map +1 -0
  78. package/dist/seeders/index.js +2 -0
  79. package/dist/seeders/styles.d.ts +1 -0
  80. package/dist/seeders/styles.js +27 -0
  81. package/dist/seeders/viewModes.d.ts +1 -0
  82. package/dist/seeders/viewModes.js +3 -0
  83. package/dist/tailwind/index.cjs.js +2 -0
  84. package/dist/tailwind/index.cjs.js.map +1 -0
  85. package/dist/tailwind/index.d.ts +2 -94
  86. package/dist/tailwind/index.esm.js +2 -0
  87. package/dist/tailwind/index.esm.js.map +1 -0
  88. package/dist/tailwind/index.js +2 -2692
  89. package/dist/tailwind/tailwindFieldSelectors.d.ts +181 -0
  90. package/dist/tailwind/tailwindFieldSelectors.js +1184 -0
  91. package/dist/tailwind/tailwindSelectorVariants.d.ts +4 -0
  92. package/dist/tailwind/tailwindSelectorVariants.js +69 -0
  93. package/dist/uims/index.cjs.js +2 -0
  94. package/dist/uims/index.cjs.js.map +1 -0
  95. package/dist/uims/index.d.ts +6 -0
  96. package/dist/uims/index.esm.js +2 -0
  97. package/dist/uims/index.esm.js.map +1 -0
  98. package/dist/uims/index.js +9 -0
  99. package/dist/uims/mapper/applyStylesToProps.d.ts +4 -0
  100. package/dist/uims/mapper/applyStylesToProps.js +18 -0
  101. package/dist/uims/mapper/getValueByPath.d.ts +1 -0
  102. package/dist/uims/mapper/getValueByPath.js +3 -0
  103. package/dist/uims/mapper/mapDataToProps.d.ts +6 -0
  104. package/dist/uims/mapper/mapDataToProps.js +26 -0
  105. package/dist/uims/mapper/mapInlineBlockToProps.d.ts +6 -0
  106. package/dist/uims/mapper/mapInlineBlockToProps.js +16 -0
  107. package/dist/uims/registry/componentRegistry.d.ts +4 -0
  108. package/dist/uims/registry/componentRegistry.js +20 -0
  109. package/dist/uims/registry/styleRegistry.d.ts +4 -0
  110. package/dist/uims/registry/styleRegistry.js +20 -0
  111. package/dist/uims/registry/viewModeRegistry.d.ts +4 -0
  112. package/dist/uims/registry/viewModeRegistry.js +20 -0
  113. package/dist/uims/resolver/createUIMSContext.d.ts +3 -0
  114. package/dist/uims/resolver/createUIMSContext.js +13 -0
  115. package/dist/uims/resolver/resolveInlineBlock.d.ts +8 -0
  116. package/dist/uims/resolver/resolveInlineBlock.js +22 -0
  117. package/dist/uims/resolver/resolveInlineStylesBySlot.d.ts +1 -0
  118. package/dist/uims/resolver/resolveInlineStylesBySlot.js +15 -0
  119. package/dist/uims/resolver/resolveLayout.d.ts +5 -0
  120. package/dist/uims/resolver/resolveLayout.js +24 -0
  121. package/dist/uims/resolver/resolveStylesBySlot.d.ts +11 -0
  122. package/dist/uims/resolver/resolveStylesBySlot.js +12 -0
  123. package/dist/uims/resolver/resolveViewBlock.d.ts +12 -0
  124. package/dist/uims/resolver/resolveViewBlock.js +26 -0
  125. package/dist/{utils → uims/resolver}/resolveViewData.d.ts +3 -1
  126. package/dist/uims/resolver/resolveViewData.js +56 -0
  127. package/dist/uims/types/UIMSContext.d.ts +18 -0
  128. package/dist/uims/types/UIMSContext.js +1 -0
  129. package/dist/utils/getPropsKeys.d.ts +1 -0
  130. package/dist/utils/getPropsKeys.js +3 -0
  131. package/dist/utils/index.cjs.js +1 -1
  132. package/dist/utils/index.cjs.js.map +1 -1
  133. package/dist/utils/index.d.ts +0 -1
  134. package/dist/utils/index.esm.js +1 -1
  135. package/dist/utils/index.esm.js.map +1 -1
  136. package/dist/utils/index.js +0 -1
  137. package/dist/utils/normalizeStyles.d.ts +1 -0
  138. package/dist/utils/normalizeStyles.js +12 -0
  139. package/dist/utils/pickProps.d.ts +1 -0
  140. package/dist/utils/pickProps.js +9 -0
  141. package/package.json +12 -4
  142. package/dist/PageRenderer-BiZflIhY.js +0 -2
  143. package/dist/PageRenderer-BiZflIhY.js.map +0 -1
  144. package/dist/PageRenderer-DX3iEA8n.js +0 -2
  145. package/dist/PageRenderer-DX3iEA8n.js.map +0 -1
  146. package/dist/config/blockComponentInstance.d.ts +0 -2
  147. package/dist/config/blockComponentInstance.js +0 -84
  148. package/dist/config/blocks/blockCarousel.d.ts +0 -3
  149. package/dist/config/blocks/blockCarousel.js +0 -102
  150. package/dist/config/blocks/blockDisclosureList.d.ts +0 -3
  151. package/dist/config/blocks/blockDisclosureList.js +0 -58
  152. package/dist/config/blocks/blockGrid.d.ts +0 -6
  153. package/dist/config/blocks/blockGrid.js +0 -161
  154. package/dist/config/blocks/blockGridContent.d.ts +0 -6
  155. package/dist/config/blocks/blockGridContent.js +0 -195
  156. package/dist/config/blocks/blockHtmlElement.d.ts +0 -6
  157. package/dist/config/blocks/blockHtmlElement.js +0 -13
  158. package/dist/config/blocks/blockImage.d.ts +0 -3
  159. package/dist/config/blocks/blockImage.js +0 -15
  160. package/dist/config/blocks/blockParallax.d.ts +0 -3
  161. package/dist/config/blocks/blockParallax.js +0 -76
  162. package/dist/config/blocks/blockTabs.d.ts +0 -3
  163. package/dist/config/blocks/blockTabs.js +0 -24
  164. package/dist/config/collectionComponentDefinitions.js +0 -33
  165. package/dist/config/collectionMenus.d.ts +0 -6
  166. package/dist/config/collectionViewModes.js +0 -20
  167. package/dist/config/fieldCss.js +0 -543
  168. package/dist/config/utils/resolveInlineComponent.d.ts +0 -4
  169. package/dist/config/utils/resolveInlineComponent.js +0 -35
  170. package/dist/config/utils/resolveViewRow.d.ts +0 -4
  171. package/dist/config/utils/resolveViewRow.js +0 -15
  172. package/dist/fields/fieldArray.d.ts +0 -4
  173. package/dist/fields/fieldArray.js +0 -9
  174. package/dist/fields/fieldBlocks.d.ts +0 -4
  175. package/dist/fields/fieldBlocks.js +0 -9
  176. package/dist/fields/fieldCheckbox.d.ts +0 -4
  177. package/dist/fields/fieldCheckbox.js +0 -11
  178. package/dist/fields/fieldCode.d.ts +0 -4
  179. package/dist/fields/fieldCode.js +0 -8
  180. package/dist/fields/fieldDate.d.ts +0 -4
  181. package/dist/fields/fieldDate.js +0 -15
  182. package/dist/fields/fieldEmail.d.ts +0 -4
  183. package/dist/fields/fieldEmail.js +0 -8
  184. package/dist/fields/fieldJoin.d.ts +0 -4
  185. package/dist/fields/fieldJoin.js +0 -9
  186. package/dist/fields/fieldNumber.d.ts +0 -4
  187. package/dist/fields/fieldNumber.js +0 -8
  188. package/dist/fields/fieldPoint.d.ts +0 -4
  189. package/dist/fields/fieldPoint.js +0 -8
  190. package/dist/fields/fieldRadioGroup.d.ts +0 -4
  191. package/dist/fields/fieldRadioGroup.js +0 -18
  192. package/dist/fields/fieldRelationship.d.ts +0 -4
  193. package/dist/fields/fieldRelationship.js +0 -9
  194. package/dist/fields/fieldRichText.d.ts +0 -4
  195. package/dist/fields/fieldRichText.js +0 -12
  196. package/dist/fields/fieldSelect.d.ts +0 -4
  197. package/dist/fields/fieldSelect.js +0 -9
  198. package/dist/fields/fieldText.d.ts +0 -4
  199. package/dist/fields/fieldText.js +0 -8
  200. package/dist/fields/fieldTextArea.d.ts +0 -4
  201. package/dist/fields/fieldTextArea.js +0 -8
  202. package/dist/fields/fieldUpload.d.ts +0 -4
  203. package/dist/fields/fieldUpload.js +0 -9
  204. package/dist/fields/index.cjs.js +0 -2
  205. package/dist/fields/index.cjs.js.map +0 -1
  206. package/dist/fields/index.d.ts +0 -31
  207. package/dist/fields/index.esm.js +0 -2
  208. package/dist/fields/index.esm.js.map +0 -1
  209. package/dist/fields/index.js +0 -37
  210. package/dist/fields/layout/fieldContainerProps.d.ts +0 -3
  211. package/dist/fields/layout/fieldContainerProps.js +0 -74
  212. package/dist/fields/section/fieldAction.d.ts +0 -6
  213. package/dist/fields/section/fieldAction.js +0 -236
  214. package/dist/fields/section/fieldConfigProps.d.ts +0 -3
  215. package/dist/fields/section/fieldConfigProps.js +0 -11
  216. package/dist/fields/section/fieldContentProps.d.ts +0 -3
  217. package/dist/fields/section/fieldContentProps.js +0 -11
  218. package/dist/fields/section/fieldSectionProps.d.ts +0 -3
  219. package/dist/fields/section/fieldSectionProps.js +0 -15
  220. package/dist/fields/section/fieldSectionTabs.d.ts +0 -13
  221. package/dist/fields/section/fieldSectionTabs.js +0 -40
  222. package/dist/fields/style/fieldColor.d.ts +0 -4
  223. package/dist/fields/style/fieldColor.js +0 -21
  224. package/dist/fields/style/fieldContainerWidths.d.ts +0 -7
  225. package/dist/fields/style/fieldContainerWidths.js +0 -17
  226. package/dist/fields/style/fieldCss.d.ts +0 -3
  227. package/dist/fields/style/fieldCss.js +0 -65
  228. package/dist/fields/style/fieldFontSizes.d.ts +0 -3
  229. package/dist/fields/style/fieldFontSizes.js +0 -14
  230. package/dist/fields/style/fieldHeights.d.ts +0 -7
  231. package/dist/fields/style/fieldHeights.js +0 -23
  232. package/dist/fields/style/fieldMargins.d.ts +0 -7
  233. package/dist/fields/style/fieldMargins.js +0 -138
  234. package/dist/fields/style/fieldPaddings.d.ts +0 -7
  235. package/dist/fields/style/fieldPaddings.js +0 -114
  236. package/dist/fields/style/fieldViewportHeights.d.ts +0 -7
  237. package/dist/fields/style/fieldViewportHeights.js +0 -22
  238. package/dist/fields/utils/fieldRoles.d.ts +0 -4
  239. package/dist/react/Card.d.ts +0 -6
  240. package/dist/react/Card.js +0 -4
  241. package/dist/react/PageRenderer.d.ts +0 -4
  242. package/dist/react/PageRenderer.js +0 -34
  243. package/dist/react/ViewBlock.d.ts +0 -1
  244. package/dist/react/ViewBlock.js +0 -62
  245. package/dist/react/registry.js +0 -5
  246. package/dist/userRoles-BqQg1D6Q.js +0 -2
  247. package/dist/userRoles-BqQg1D6Q.js.map +0 -1
  248. package/dist/userRoles-CL8SQUFs.js +0 -2
  249. package/dist/userRoles-CL8SQUFs.js.map +0 -1
  250. package/dist/utils/resolveViewData.js +0 -26
  251. /package/dist/{acl → config/acl}/hasRoles.d.ts +0 -0
  252. /package/dist/{acl → config/acl}/hasRoles.js +0 -0
  253. /package/dist/{acl → config/acl}/index.d.ts +0 -0
  254. /package/dist/{acl → config/acl}/index.js +0 -0
  255. /package/dist/config/{blockView.d.ts → blocks/blockView.d.ts} +0 -0
  256. /package/dist/{enums → config/enums}/index.d.ts +0 -0
  257. /package/dist/{enums → config/enums}/index.js +0 -0
  258. /package/dist/{enums → config/enums}/userRoles.d.ts +0 -0
  259. /package/dist/{enums → config/enums}/userRoles.js +0 -0
  260. /package/dist/config/{fieldCss.d.ts → fields/fieldCss.d.ts} +0 -0
  261. /package/dist/config/{configFooter.d.ts → globals/configFooter.d.ts} +0 -0
  262. /package/dist/config/{configHeader.d.ts → globals/configHeader.d.ts} +0 -0
  263. /package/dist/config/{configSettings.d.ts → globals/configSettings.d.ts} +0 -0
  264. /package/dist/{hooks → config/hooks}/fields/getNumberValueFromClassNameString.d.ts +0 -0
  265. /package/dist/{hooks → config/hooks}/fields/getNumberValueFromClassNameString.js +0 -0
  266. /package/dist/{hooks → config/hooks}/fields/populateSiblingClassName.d.ts +0 -0
  267. /package/dist/{hooks → config/hooks}/fields/populateSiblingClassNameAfterChange.d.ts +0 -0
  268. /package/dist/{hooks → config/hooks}/fields/updateClassNameAfterRead.d.ts +0 -0
  269. /package/dist/{hooks → config/hooks}/fields/updateClassNameAfterRead.js +0 -0
  270. /package/dist/{hooks → config/hooks}/index.d.ts +0 -0
  271. /package/dist/{hooks → config/hooks}/index.js +0 -0
  272. /package/dist/react/{registry.d.ts → componentRegistry.d.ts} +0 -0
@@ -0,0 +1,106 @@
1
+ import { resolveStyleFromRef } from '../hooks/fields/resolveStyleFromRef';
2
+ import { resolveComponentFromRef } from '../hooks/fields/resolveComponentFromRef';
3
+ export const collectionViewModes = {
4
+ slug: 'view-modes',
5
+ labels: {
6
+ plural: 'View Modes',
7
+ singular: 'View Mode',
8
+ },
9
+ admin: {
10
+ useAsTitle: 'name',
11
+ description: "Un View Mode è una delle tante visualizzazioni possibili per una sorgente dati. Definendo un View Mode si definisce e regola l'interazione tra JSON dati, Stili UI e Comportamento lato client." +
12
+ 'Un View Mode infatti lega un elenco di stili, un componente e un mapper default (definito per utilizzo del View Mode con blocchi inline).',
13
+ },
14
+ fields: [
15
+ {
16
+ type: 'row',
17
+ fields: [
18
+ {
19
+ name: 'name',
20
+ type: 'text',
21
+ required: true,
22
+ unique: true,
23
+ admin: {
24
+ width: '50%',
25
+ description: 'Nome del View Mode. Usato internamente per organizzare e visualizzare i View Mode a sistema',
26
+ },
27
+ },
28
+ {
29
+ name: 'component',
30
+ type: 'text',
31
+ hooks: {
32
+ beforeChange: [resolveComponentFromRef('componentRef')],
33
+ },
34
+ admin: {
35
+ width: '25%',
36
+ description: 'Componente React incaricato della visualizzazione del View Mode in definizione',
37
+ },
38
+ },
39
+ {
40
+ name: 'componentRef',
41
+ type: 'relationship',
42
+ relationTo: ['component-definitions'],
43
+ virtual: true,
44
+ admin: {
45
+ width: '25%',
46
+ description: 'Componente React incaricato della visualizzazione del View Mode in definizione',
47
+ },
48
+ },
49
+ ],
50
+ },
51
+ {
52
+ name: 'blockPropsMapping',
53
+ type: 'json',
54
+ label: 'Mapping da blocco inline a viewMode',
55
+ admin: {
56
+ width: '100%',
57
+ description: 'Mapping default in caso di utilizzo del View Mode come blocco inline. Garantisce il binding tra campi payload e slot react. Usare sintassi con stesse value dei campi payload ad esempio { "titleProps" : { "text": "titleProps.text"}}',
58
+ },
59
+ },
60
+ {
61
+ name: 'styles',
62
+ type: 'array',
63
+ admin: {
64
+ description: 'Associazione degli stili presenti a sistema con gli slot del componente react selezionato. Includere default slot "root" per applicare gli stili alla radice del componente',
65
+ },
66
+ fields: [
67
+ {
68
+ type: 'row',
69
+ fields: [
70
+ {
71
+ name: 'slot',
72
+ type: 'text',
73
+ required: true,
74
+ admin: {
75
+ width: '25%',
76
+ description: 'Deve essere una delle proprietà definite a livello di propsSchema del nostro componente. Fa direttamente riferimento alla proprietà in input del componente react. Usa "root" per riferire all\'elemento radice del componente',
77
+ },
78
+ },
79
+ {
80
+ name: 'style',
81
+ type: 'text',
82
+ hooks: {
83
+ beforeChange: [resolveStyleFromRef('styleRef')],
84
+ },
85
+ admin: {
86
+ width: '30%',
87
+ description: 'Recupera in automatico lo stile dagli stili selezionati nella select successiva e li usa inline',
88
+ },
89
+ },
90
+ {
91
+ name: 'styleRef',
92
+ type: 'relationship',
93
+ relationTo: ['styles'],
94
+ hasMany: true,
95
+ virtual: true,
96
+ admin: {
97
+ width: '40%',
98
+ description: "Aggiungi uno o più stili per definire l'aspetto di questo slot",
99
+ },
100
+ },
101
+ ],
102
+ },
103
+ ],
104
+ },
105
+ ],
106
+ };
@@ -0,0 +1,537 @@
1
+ //#TODO Il campo fieldCss e elementi annessi dovrebbero essere di dominio della parte react.
2
+ //#TODO Eventualmente capire come creare una UI molto generica per l'associazione degli stili
3
+ export const concatCssFields = (args) => {
4
+ const { siblingData, operation } = args;
5
+ if (operation !== 'create' && operation !== 'update') {
6
+ return;
7
+ }
8
+ const classes = [];
9
+ Object.entries(siblingData || {}).forEach(([key, val]) => {
10
+ if (key === 'className')
11
+ return;
12
+ if (val === null || val === undefined)
13
+ return;
14
+ if (typeof val === 'string' && val.trim() === '')
15
+ return;
16
+ classes.push(val);
17
+ });
18
+ return classes.join(' ');
19
+ };
20
+ export const fieldCss = (enableTabs = false) => {
21
+ return {
22
+ name: 'css',
23
+ type: 'group',
24
+ label: 'Regole di stile',
25
+ fields: [
26
+ {
27
+ type: 'text',
28
+ name: 'className',
29
+ label: 'className',
30
+ required: false,
31
+ hooks: {
32
+ //beforeValidate: [concatCssFields],
33
+ },
34
+ },
35
+ /*
36
+ {
37
+ type: 'tabs',
38
+ tabs: [],
39
+ enableTabs
40
+ ? [
41
+ {
42
+ label: 'Box',
43
+ fields: [
44
+ {
45
+ type: 'tabs',
46
+ tabs: tailwindSelectorVariants.map((bp) => {
47
+ return {
48
+ label: bp.label,
49
+ fields: [
50
+ {
51
+ type: 'row',
52
+ fields: [
53
+ tailwindField('width', bp.value),
54
+ tailwindField('minWidth', bp.value),
55
+ tailwindField('maxWidth', bp.value),
56
+ tailwindField('height', bp.value),
57
+ tailwindField('minHeight', bp.value),
58
+ tailwindField('maxHeight', bp.value),
59
+ tailwindField('aspectRatio', bp.value),
60
+ {
61
+ type: 'collapsible',
62
+ label: 'Margins',
63
+ admin: {
64
+ width: '50%',
65
+ },
66
+ fields: [
67
+ tailwindField('margin', bp.value),
68
+ tailwindField('marginX', bp.value),
69
+ tailwindField('marginY', bp.value),
70
+ tailwindField('marginTop', bp.value),
71
+ tailwindField('marginEnd', bp.value),
72
+ tailwindField('marginBottom', bp.value),
73
+ tailwindField('marginStart', bp.value),
74
+ ],
75
+ },
76
+ {
77
+ type: 'collapsible',
78
+ label: 'Paddings',
79
+ admin: {
80
+ width: '50%',
81
+ },
82
+ fields: [
83
+ tailwindField('padding', bp.value),
84
+ tailwindField('paddingX', bp.value),
85
+ tailwindField('paddingY', bp.value),
86
+ tailwindField('paddingTop', bp.value),
87
+ tailwindField('paddingEnd', bp.value),
88
+ tailwindField('paddingBottom', bp.value),
89
+ tailwindField('paddingStart', bp.value),
90
+ ],
91
+ },
92
+ ],
93
+ },
94
+ ],
95
+ }
96
+ }),
97
+ },
98
+ ],
99
+ },
100
+ {
101
+ label: 'Display',
102
+ fields: [
103
+ {
104
+ type: 'tabs',
105
+ tabs: tailwindSelectorVariants.map((bp) => {
106
+ return {
107
+ label: bp.label,
108
+ fields: [
109
+ {
110
+ type: 'row',
111
+ fields: [
112
+ // BASE DISPLAY
113
+ tailwindField('display', bp.value),
114
+ tailwindField('visibility', bp.value),
115
+ tailwindField('isolation', bp.value),
116
+
117
+ // FLOW / OVERFLOW
118
+ tailwindField('overflow', bp.value),
119
+ tailwindField('overflowX', bp.value),
120
+ tailwindField('overflowY', bp.value),
121
+
122
+ // FLOAT / CLEAR
123
+ tailwindField('float', bp.value),
124
+ tailwindField('clear', bp.value),
125
+
126
+ // FLEX
127
+ tailwindField('flexWrap', bp.value),
128
+ tailwindField('justifyContent', bp.value),
129
+ tailwindField('alignItems', bp.value),
130
+ tailwindField('alignContent', bp.value),
131
+ tailwindField('alignSelf', bp.value),
132
+ tailwindField('flexGrow', bp.value),
133
+ tailwindField('flexShrink', bp.value),
134
+ tailwindField('flexBasis', bp.value),
135
+ tailwindField('order', bp.value),
136
+ tailwindField('gap', bp.value),
137
+ //tailwindField('rowGap', bp.value),
138
+ tailwindField('columnGap', bp.value),
139
+
140
+ // GRID
141
+ tailwindField('gridTemplateColumns', bp.value),
142
+ tailwindField('gridTemplateRows', bp.value),
143
+ tailwindField('gridColumn', bp.value),
144
+ tailwindField('gridRow', bp.value),
145
+ tailwindField('gridAutoFlow', bp.value),
146
+ tailwindField('gridAutoColumns', bp.value),
147
+ tailwindField('gridAutoRows', bp.value),
148
+ tailwindField('justifyItems', bp.value),
149
+ tailwindField('justifySelf', bp.value),
150
+ tailwindField('placeItems', bp.value),
151
+ tailwindField('placeContent', bp.value),
152
+
153
+ // TABLE
154
+ tailwindField('tableLayout', bp.value),
155
+ tailwindField('captionSide', bp.value),
156
+
157
+ // OBJECT / MEDIA
158
+ tailwindField('objectFit', bp.value),
159
+ tailwindField('objectPosition', bp.value),
160
+
161
+ // COLUMNS
162
+ tailwindField('columns', bp.value),
163
+ tailwindField('breakBefore', bp.value),
164
+ tailwindField('breakAfter', bp.value),
165
+ tailwindField('breakInside', bp.value),
166
+ ],
167
+ },
168
+ ],
169
+ }
170
+ }),
171
+ },
172
+ ],
173
+ },
174
+ {
175
+ label: 'Position',
176
+ fields: [
177
+ {
178
+ type: 'tabs',
179
+ tabs: tailwindSelectorVariants.map((bp) => {
180
+ return {
181
+ label: bp.label,
182
+ fields: [
183
+ {
184
+ type: 'row',
185
+ fields: [
186
+ tailwindField('position', bp.value),
187
+ // inset / offsets
188
+ //tailwindField('top', bp.value),
189
+ //tailwindField('right', bp.value),
190
+ //tailwindField('bottom', bp.value),
191
+ //tailwindField('left', bp.value),
192
+ //tailwindField('inset', bp.value),
193
+ //tailwindField('insetX', bp.value),
194
+ //tailwindField('insetY', bp.value),
195
+
196
+ // z-index / stacking
197
+ tailwindField('zIndex', bp.value),
198
+
199
+ // translate (layout-related movement)
200
+ //tailwindField('translateX', bp.value),
201
+ //tailwindField('translateY', bp.value),
202
+ ],
203
+ },
204
+ ],
205
+ }
206
+ }),
207
+ },
208
+ ],
209
+ },
210
+ {
211
+ label: 'Typography',
212
+ fields: [
213
+ {
214
+ type: 'tabs',
215
+ tabs: tailwindSelectorVariants.map((bp) => {
216
+ return {
217
+ label: bp.label,
218
+ fields: [
219
+ {
220
+ type: 'row',
221
+ fields: [
222
+ tailwindField('fontFamily', bp.value),
223
+ tailwindField('fontSize', bp.value),
224
+ tailwindField('fontWeight', bp.value),
225
+ tailwindField('fontStyle', bp.value),
226
+
227
+ // text layout
228
+ tailwindField('lineHeight', bp.value),
229
+ tailwindField('letterSpacing', bp.value),
230
+ tailwindField('textAlign', bp.value),
231
+ tailwindField('verticalAlign', bp.value),
232
+
233
+ // text transform & decoration
234
+ tailwindField('textTransform', bp.value),
235
+ tailwindField('textDecoration', bp.value),
236
+ tailwindField('textDecorationStyle', bp.value),
237
+ tailwindField('textDecorationThickness', bp.value),
238
+ tailwindField('textUnderlineOffset', bp.value),
239
+
240
+ // text behavior
241
+ tailwindField('textOverflow', bp.value),
242
+ tailwindField('whiteSpace', bp.value),
243
+ tailwindField('wordBreak', bp.value),
244
+ tailwindField('hyphens', bp.value),
245
+
246
+ // list
247
+ tailwindField('listStyleType', bp.value),
248
+ tailwindField('listStylePosition', bp.value),
249
+ ],
250
+ },
251
+ ],
252
+ }
253
+ }),
254
+ },
255
+ ],
256
+ },
257
+ {
258
+ label: 'Color',
259
+ fields: [
260
+ {
261
+ type: 'tabs',
262
+ tabs: tailwindSelectorVariants.map((bp) => {
263
+ return {
264
+ label: bp.label,
265
+ fields: [
266
+ {
267
+ type: 'row',
268
+ fields: [
269
+ tailwindField('textColor', bp.value),
270
+ //tailwindField('placeholderColor', bp.value),
271
+ tailwindField('caretColor', bp.value),
272
+
273
+ // background
274
+ tailwindField('backgroundColor', bp.value),
275
+
276
+ // border & divide
277
+ tailwindField('borderColor', bp.value),
278
+ tailwindField('divideColor', bp.value),
279
+
280
+ // accents
281
+ tailwindField('accentColor', bp.value),
282
+ ],
283
+ },
284
+ ],
285
+ }
286
+ }),
287
+ },
288
+ ],
289
+ },
290
+ {
291
+ label: 'Background',
292
+ fields: [
293
+ {
294
+ type: 'tabs',
295
+ tabs: tailwindSelectorVariants.map((bp) => {
296
+ return {
297
+ label: bp.label,
298
+ fields: [
299
+ {
300
+ type: 'row',
301
+ fields: [
302
+ // background image & gradients
303
+ tailwindField('backgroundImage', bp.value),
304
+ //tailwindField('backgroundGradientFrom', bp.value),
305
+ //tailwindField('backgroundGradientVia', bp.value),
306
+ //tailwindField('backgroundGradientTo', bp.value),
307
+
308
+ // background behavior
309
+ tailwindField('backgroundSize', bp.value),
310
+ tailwindField('backgroundPosition', bp.value),
311
+ tailwindField('backgroundRepeat', bp.value),
312
+ tailwindField('backgroundAttachment', bp.value),
313
+
314
+ // clipping & origin
315
+ tailwindField('backgroundClip', bp.value),
316
+ tailwindField('backgroundOrigin', bp.value),
317
+ ],
318
+ },
319
+ ],
320
+ }
321
+ }),
322
+ },
323
+ ],
324
+ },
325
+ {
326
+ label: 'Border',
327
+ fields: [
328
+ {
329
+ type: 'tabs',
330
+ tabs: tailwindSelectorVariants.map((bp) => {
331
+ return {
332
+ label: bp.label,
333
+ fields: [
334
+ {
335
+ type: 'row',
336
+ fields: [
337
+ // border width
338
+ tailwindField('borderWidth', bp.value),
339
+ //tailwindField('borderWidthX', bp.value),
340
+ //tailwindField('borderWidthY', bp.value),
341
+ //tailwindField('borderWidthTop', bp.value),
342
+ //tailwindField('borderWidthRight', bp.value),
343
+ //tailwindField('borderWidthBottom', bp.value),
344
+ //tailwindField('borderWidthLeft', bp.value),
345
+
346
+ // border style & radius
347
+ tailwindField('borderStyle', bp.value),
348
+ tailwindField('borderRadius', bp.value),
349
+ //tailwindField('borderRadiusTop', bp.value),
350
+ //tailwindField('borderRadiusRight', bp.value),
351
+ //tailwindField('borderRadiusBottom', bp.value),
352
+ //tailwindField('borderRadiusLeft', bp.value),
353
+
354
+ // divide
355
+ tailwindField('divideWidth', bp.value),
356
+ tailwindField('divideStyle', bp.value),
357
+
358
+ // outline & ring
359
+ tailwindField('outline', bp.value),
360
+ tailwindField('outlineOffset', bp.value),
361
+ tailwindField('ringWidth', bp.value),
362
+ tailwindField('ringOffsetWidth', bp.value),
363
+ ],
364
+ },
365
+ ],
366
+ }
367
+ }),
368
+ },
369
+ ],
370
+ },
371
+ {
372
+ label: 'Shadow',
373
+ fields: [
374
+ {
375
+ type: 'tabs',
376
+ tabs: tailwindSelectorVariants.map((bp) => {
377
+ return {
378
+ label: bp.label,
379
+ fields: [
380
+ {
381
+ type: 'row',
382
+ fields: [
383
+ tailwindField('boxShadow', bp.value),
384
+ //tailwindField('dropShadow', bp.value),
385
+ ],
386
+ },
387
+ ],
388
+ }
389
+ }),
390
+ },
391
+ ],
392
+ },
393
+ {
394
+ label: 'Effects',
395
+ fields: [
396
+ {
397
+ type: 'tabs',
398
+ tabs: tailwindSelectorVariants.map((bp) => {
399
+ return {
400
+ label: bp.label,
401
+ fields: [
402
+ {
403
+ type: 'row',
404
+ fields: [
405
+ // opacity & blending
406
+ tailwindField('opacity', bp.value),
407
+ tailwindField('mixBlendMode', bp.value),
408
+ //tailwindField('backgroundBlendMode', bp.value),
409
+
410
+ // filters
411
+ //tailwindField('blur', bp.value),
412
+ //tailwindField('brightness', bp.value),
413
+ //tailwindField('contrast', bp.value),
414
+ //tailwindField('grayscale', bp.value),
415
+ //tailwindField('hueRotate', bp.value),
416
+ //tailwindField('invert', bp.value),
417
+ //tailwindField('saturate', bp.value),
418
+ //tailwindField('sepia', bp.value),
419
+
420
+ // backdrop filters
421
+ tailwindField('backdropBlur', bp.value),
422
+ tailwindField('backdropBrightness', bp.value),
423
+ tailwindField('backdropContrast', bp.value),
424
+ tailwindField('backdropGrayscale', bp.value),
425
+ tailwindField('backdropHueRotate', bp.value),
426
+ tailwindField('backdropInvert', bp.value),
427
+ tailwindField('backdropOpacity', bp.value),
428
+ tailwindField('backdropSaturate', bp.value),
429
+ tailwindField('backdropSepia', bp.value),
430
+ ],
431
+ },
432
+ ],
433
+ }
434
+ }),
435
+ },
436
+ ],
437
+ },
438
+ {
439
+ label: 'Transform',
440
+ fields: [
441
+ {
442
+ type: 'tabs',
443
+ tabs: tailwindSelectorVariants.map((bp) => {
444
+ return {
445
+ label: bp.label,
446
+ fields: [
447
+ {
448
+ type: 'row',
449
+ fields: [
450
+ tailwindField('scale', bp.value),
451
+ //tailwindField('scaleX', bp.value),
452
+ //tailwindField('scaleY', bp.value),
453
+
454
+ tailwindField('rotate', bp.value),
455
+
456
+ //tailwindField('translateX', bp.value),
457
+ //tailwindField('translateY', bp.value),
458
+
459
+ //tailwindField('skewX', bp.value),
460
+ //tailwindField('skewY', bp.value),
461
+
462
+ tailwindField('transformOrigin', bp.value),
463
+ ],
464
+ },
465
+ ],
466
+ }
467
+ }),
468
+ },
469
+ ],
470
+ },
471
+ {
472
+ label: 'Animation',
473
+ fields: [
474
+ {
475
+ type: 'tabs',
476
+ tabs: tailwindSelectorVariants.map((bp) => {
477
+ return {
478
+ label: bp.label,
479
+ fields: [
480
+ {
481
+ type: 'row',
482
+ fields: [
483
+ // transition
484
+ tailwindField('transitionProperty', bp.value),
485
+ tailwindField('transitionDuration', bp.value),
486
+ tailwindField('transitionTimingFunction', bp.value),
487
+ tailwindField('transitionDelay', bp.value),
488
+
489
+ // animation
490
+ tailwindField('animation', bp.value),
491
+ ],
492
+ },
493
+ ],
494
+ }
495
+ }),
496
+ },
497
+ ],
498
+ },
499
+ {
500
+ label: 'Interaction',
501
+ fields: [
502
+ {
503
+ type: 'tabs',
504
+ tabs: tailwindSelectorVariants.map((bp) => {
505
+ return {
506
+ label: bp.label,
507
+ fields: [
508
+ {
509
+ type: 'row',
510
+ fields: [
511
+ tailwindField('cursor', bp.value),
512
+ tailwindField('pointerEvents', bp.value),
513
+ tailwindField('userSelect', bp.value),
514
+
515
+ tailwindField('resize', bp.value),
516
+
517
+ tailwindField('scrollBehavior', bp.value),
518
+ tailwindField('scrollMargin', bp.value),
519
+ tailwindField('scrollPadding', bp.value),
520
+ tailwindField('scrollSnapType', bp.value),
521
+ tailwindField('scrollSnapAlign', bp.value),
522
+ tailwindField('scrollSnapStop', bp.value),
523
+ ],
524
+ },
525
+ ],
526
+ }
527
+ }),
528
+ },
529
+ ],
530
+ },
531
+ ]
532
+ : [],
533
+ },
534
+ */
535
+ ],
536
+ };
537
+ };
@@ -0,0 +1,2 @@
1
+ import { Field } from 'payload';
2
+ export declare const fieldRoles: Field;
@@ -1,26 +1,22 @@
1
- import userRoles from '../../enums/userRoles';
2
- const fieldRoles = (override) => ({
3
- name: override?.name || 'roles',
4
- label: override?.label || 'Ruoli',
1
+ import { userRoles } from '../enums';
2
+ export const fieldRoles = {
3
+ name: 'roles',
4
+ label: 'Ruoli',
5
5
  type: 'select',
6
- required: override?.required ?? true,
7
- hasMany: override?.hasMany ?? true,
6
+ required: true,
7
+ hasMany: true,
8
8
  options: [
9
9
  ...Object.values(userRoles).map((role) => ({
10
10
  label: role.charAt(0).toUpperCase() + role.slice(1).toLowerCase(),
11
11
  value: role,
12
12
  })),
13
- ...(override?.options || []),
14
13
  ],
15
14
  access: {
16
15
  create: () => true,
17
16
  update: () => true,
18
17
  read: () => true,
19
- ...override?.access,
20
18
  },
21
19
  admin: {
22
20
  description: 'Seleziona uno o più ruoli utente.',
23
- ...override?.admin,
24
21
  },
25
- });
26
- export default fieldRoles;
22
+ };