@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.
- package/dist/LayoutRenderer-B1IoWb16.js +2 -0
- package/dist/LayoutRenderer-B1IoWb16.js.map +1 -0
- package/dist/LayoutRenderer-Ba6ITI7O.js +2 -0
- package/dist/LayoutRenderer-Ba6ITI7O.js.map +1 -0
- package/dist/config/blocks/blockCard.d.ts +2 -0
- package/dist/config/blocks/blockCard.js +101 -0
- package/dist/config/blocks/blockReference.d.ts +2 -0
- package/dist/config/blocks/blockReference.js +11 -0
- package/dist/config/{blockView.js → blocks/blockView.js} +35 -91
- package/dist/config/collections/collectionBlocks.d.ts +2 -0
- package/dist/config/collections/collectionBlocks.js +35 -0
- package/dist/config/{collectionComponentDefinitions.d.ts → collections/collectionComponentDefinitions.d.ts} +1 -1
- package/dist/config/collections/collectionComponentDefinitions.js +40 -0
- package/dist/config/collections/collectionMenus.d.ts +2 -0
- package/dist/config/{collectionMenus.js → collections/collectionMenus.js} +18 -16
- package/dist/config/collections/collectionStyles.d.ts +2 -0
- package/dist/config/collections/collectionStyles.js +25 -0
- package/dist/config/{collectionViewModes.d.ts → collections/collectionViewModes.d.ts} +1 -1
- package/dist/config/collections/collectionViewModes.js +106 -0
- package/dist/config/fields/fieldCss.js +537 -0
- package/dist/config/fields/fieldRoles.d.ts +2 -0
- package/dist/{fields/utils → config/fields}/fieldRoles.js +7 -11
- package/dist/config/fields/tailwindFieldSelectors.d.ts +2 -1
- package/dist/config/fields/tailwindFieldSelectors.js +1547 -1
- package/dist/config/fields/tailwindSelectorVariants.js +45 -45
- package/dist/config/{configFooter.js → globals/configFooter.js} +11 -9
- package/dist/config/{configHeader.js → globals/configHeader.js} +11 -10
- package/dist/config/{configSettings.js → globals/configSettings.js} +48 -26
- package/dist/{hooks → config/hooks}/fields/populateSiblingClassName.js +0 -2
- package/dist/{hooks → config/hooks}/fields/populateSiblingClassNameAfterChange.js +0 -1
- package/dist/config/hooks/fields/resolveComponentFromRef.d.ts +2 -0
- package/dist/config/hooks/fields/resolveComponentFromRef.js +30 -0
- package/dist/config/hooks/fields/resolveStyleFromRef.d.ts +2 -0
- package/dist/config/hooks/fields/resolveStyleFromRef.js +35 -0
- package/dist/config/hooks/fields/resolveViewModeFromRef.d.ts +2 -0
- package/dist/config/hooks/fields/resolveViewModeFromRef.js +23 -0
- package/dist/config/index.cjs.js +1 -1
- package/dist/config/index.cjs.js.map +1 -1
- package/dist/config/index.d.ts +15 -9
- package/dist/config/index.esm.js +1 -1
- package/dist/config/index.esm.js.map +1 -1
- package/dist/config/index.js +15 -9
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.js +2 -0
- package/dist/react/ComponentRenderer.js +1 -1
- package/dist/react/LayoutRenderer.d.ts +5 -0
- package/dist/react/LayoutRenderer.js +19 -0
- package/dist/react/componentRegistry.js +7 -0
- package/dist/react/components/Card.d.ts +19 -0
- package/dist/react/components/Card.js +6 -0
- package/dist/react/components/Container.d.ts +5 -0
- package/dist/react/components/Container.js +4 -0
- package/dist/react/components/View.d.ts +1 -0
- package/dist/react/components/View.js +9 -0
- package/dist/react/index.cjs.js +1 -1
- package/dist/react/index.d.ts +5 -5
- package/dist/react/index.esm.js +1 -1
- package/dist/react/index.js +5 -5
- package/dist/resolveLayout-DlRnQBn8.js +2 -0
- package/dist/resolveLayout-DlRnQBn8.js.map +1 -0
- package/dist/resolveLayout-DryOXHEy.js +2 -0
- package/dist/resolveLayout-DryOXHEy.js.map +1 -0
- package/dist/seeders/UIMSSeeder.d.ts +7 -0
- package/dist/seeders/UIMSSeeder.js +14 -0
- package/dist/seeders/clearCollection.d.ts +2 -0
- package/dist/seeders/clearCollection.js +18 -0
- package/dist/seeders/components.d.ts +1 -0
- package/dist/seeders/components.js +3 -0
- package/dist/seeders/generateTailwindStyles.d.ts +6 -0
- package/dist/seeders/generateTailwindStyles.js +18 -0
- package/dist/seeders/index.cjs.js +2 -0
- package/dist/seeders/index.cjs.js.map +1 -0
- package/dist/seeders/index.d.ts +2 -0
- package/dist/seeders/index.esm.js +2 -0
- package/dist/seeders/index.esm.js.map +1 -0
- package/dist/seeders/index.js +2 -0
- package/dist/seeders/styles.d.ts +1 -0
- package/dist/seeders/styles.js +27 -0
- package/dist/seeders/viewModes.d.ts +1 -0
- package/dist/seeders/viewModes.js +3 -0
- package/dist/tailwind/index.cjs.js +2 -0
- package/dist/tailwind/index.cjs.js.map +1 -0
- package/dist/tailwind/index.d.ts +2 -94
- package/dist/tailwind/index.esm.js +2 -0
- package/dist/tailwind/index.esm.js.map +1 -0
- package/dist/tailwind/index.js +2 -2692
- package/dist/tailwind/tailwindFieldSelectors.d.ts +181 -0
- package/dist/tailwind/tailwindFieldSelectors.js +1184 -0
- package/dist/tailwind/tailwindSelectorVariants.d.ts +4 -0
- package/dist/tailwind/tailwindSelectorVariants.js +69 -0
- package/dist/uims/index.cjs.js +2 -0
- package/dist/uims/index.cjs.js.map +1 -0
- package/dist/uims/index.d.ts +6 -0
- package/dist/uims/index.esm.js +2 -0
- package/dist/uims/index.esm.js.map +1 -0
- package/dist/uims/index.js +9 -0
- package/dist/uims/mapper/applyStylesToProps.d.ts +4 -0
- package/dist/uims/mapper/applyStylesToProps.js +18 -0
- package/dist/uims/mapper/getValueByPath.d.ts +1 -0
- package/dist/uims/mapper/getValueByPath.js +3 -0
- package/dist/uims/mapper/mapDataToProps.d.ts +6 -0
- package/dist/uims/mapper/mapDataToProps.js +26 -0
- package/dist/uims/mapper/mapInlineBlockToProps.d.ts +6 -0
- package/dist/uims/mapper/mapInlineBlockToProps.js +16 -0
- package/dist/uims/registry/componentRegistry.d.ts +4 -0
- package/dist/uims/registry/componentRegistry.js +20 -0
- package/dist/uims/registry/styleRegistry.d.ts +4 -0
- package/dist/uims/registry/styleRegistry.js +20 -0
- package/dist/uims/registry/viewModeRegistry.d.ts +4 -0
- package/dist/uims/registry/viewModeRegistry.js +20 -0
- package/dist/uims/resolver/createUIMSContext.d.ts +3 -0
- package/dist/uims/resolver/createUIMSContext.js +13 -0
- package/dist/uims/resolver/resolveInlineBlock.d.ts +8 -0
- package/dist/uims/resolver/resolveInlineBlock.js +22 -0
- package/dist/uims/resolver/resolveInlineStylesBySlot.d.ts +1 -0
- package/dist/uims/resolver/resolveInlineStylesBySlot.js +15 -0
- package/dist/uims/resolver/resolveLayout.d.ts +5 -0
- package/dist/uims/resolver/resolveLayout.js +24 -0
- package/dist/uims/resolver/resolveStylesBySlot.d.ts +11 -0
- package/dist/uims/resolver/resolveStylesBySlot.js +12 -0
- package/dist/uims/resolver/resolveViewBlock.d.ts +12 -0
- package/dist/uims/resolver/resolveViewBlock.js +26 -0
- package/dist/{utils → uims/resolver}/resolveViewData.d.ts +3 -1
- package/dist/uims/resolver/resolveViewData.js +56 -0
- package/dist/uims/types/UIMSContext.d.ts +18 -0
- package/dist/uims/types/UIMSContext.js +1 -0
- package/dist/utils/getPropsKeys.d.ts +1 -0
- package/dist/utils/getPropsKeys.js +3 -0
- package/dist/utils/index.cjs.js +1 -1
- package/dist/utils/index.cjs.js.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.esm.js +1 -1
- package/dist/utils/index.esm.js.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/normalizeStyles.d.ts +1 -0
- package/dist/utils/normalizeStyles.js +12 -0
- package/dist/utils/pickProps.d.ts +1 -0
- package/dist/utils/pickProps.js +9 -0
- package/package.json +12 -4
- package/dist/PageRenderer-BiZflIhY.js +0 -2
- package/dist/PageRenderer-BiZflIhY.js.map +0 -1
- package/dist/PageRenderer-DX3iEA8n.js +0 -2
- package/dist/PageRenderer-DX3iEA8n.js.map +0 -1
- package/dist/config/blockComponentInstance.d.ts +0 -2
- package/dist/config/blockComponentInstance.js +0 -84
- package/dist/config/blocks/blockCarousel.d.ts +0 -3
- package/dist/config/blocks/blockCarousel.js +0 -102
- package/dist/config/blocks/blockDisclosureList.d.ts +0 -3
- package/dist/config/blocks/blockDisclosureList.js +0 -58
- package/dist/config/blocks/blockGrid.d.ts +0 -6
- package/dist/config/blocks/blockGrid.js +0 -161
- package/dist/config/blocks/blockGridContent.d.ts +0 -6
- package/dist/config/blocks/blockGridContent.js +0 -195
- package/dist/config/blocks/blockHtmlElement.d.ts +0 -6
- package/dist/config/blocks/blockHtmlElement.js +0 -13
- package/dist/config/blocks/blockImage.d.ts +0 -3
- package/dist/config/blocks/blockImage.js +0 -15
- package/dist/config/blocks/blockParallax.d.ts +0 -3
- package/dist/config/blocks/blockParallax.js +0 -76
- package/dist/config/blocks/blockTabs.d.ts +0 -3
- package/dist/config/blocks/blockTabs.js +0 -24
- package/dist/config/collectionComponentDefinitions.js +0 -33
- package/dist/config/collectionMenus.d.ts +0 -6
- package/dist/config/collectionViewModes.js +0 -20
- package/dist/config/fieldCss.js +0 -543
- package/dist/config/utils/resolveInlineComponent.d.ts +0 -4
- package/dist/config/utils/resolveInlineComponent.js +0 -35
- package/dist/config/utils/resolveViewRow.d.ts +0 -4
- package/dist/config/utils/resolveViewRow.js +0 -15
- package/dist/fields/fieldArray.d.ts +0 -4
- package/dist/fields/fieldArray.js +0 -9
- package/dist/fields/fieldBlocks.d.ts +0 -4
- package/dist/fields/fieldBlocks.js +0 -9
- package/dist/fields/fieldCheckbox.d.ts +0 -4
- package/dist/fields/fieldCheckbox.js +0 -11
- package/dist/fields/fieldCode.d.ts +0 -4
- package/dist/fields/fieldCode.js +0 -8
- package/dist/fields/fieldDate.d.ts +0 -4
- package/dist/fields/fieldDate.js +0 -15
- package/dist/fields/fieldEmail.d.ts +0 -4
- package/dist/fields/fieldEmail.js +0 -8
- package/dist/fields/fieldJoin.d.ts +0 -4
- package/dist/fields/fieldJoin.js +0 -9
- package/dist/fields/fieldNumber.d.ts +0 -4
- package/dist/fields/fieldNumber.js +0 -8
- package/dist/fields/fieldPoint.d.ts +0 -4
- package/dist/fields/fieldPoint.js +0 -8
- package/dist/fields/fieldRadioGroup.d.ts +0 -4
- package/dist/fields/fieldRadioGroup.js +0 -18
- package/dist/fields/fieldRelationship.d.ts +0 -4
- package/dist/fields/fieldRelationship.js +0 -9
- package/dist/fields/fieldRichText.d.ts +0 -4
- package/dist/fields/fieldRichText.js +0 -12
- package/dist/fields/fieldSelect.d.ts +0 -4
- package/dist/fields/fieldSelect.js +0 -9
- package/dist/fields/fieldText.d.ts +0 -4
- package/dist/fields/fieldText.js +0 -8
- package/dist/fields/fieldTextArea.d.ts +0 -4
- package/dist/fields/fieldTextArea.js +0 -8
- package/dist/fields/fieldUpload.d.ts +0 -4
- package/dist/fields/fieldUpload.js +0 -9
- package/dist/fields/index.cjs.js +0 -2
- package/dist/fields/index.cjs.js.map +0 -1
- package/dist/fields/index.d.ts +0 -31
- package/dist/fields/index.esm.js +0 -2
- package/dist/fields/index.esm.js.map +0 -1
- package/dist/fields/index.js +0 -37
- package/dist/fields/layout/fieldContainerProps.d.ts +0 -3
- package/dist/fields/layout/fieldContainerProps.js +0 -74
- package/dist/fields/section/fieldAction.d.ts +0 -6
- package/dist/fields/section/fieldAction.js +0 -236
- package/dist/fields/section/fieldConfigProps.d.ts +0 -3
- package/dist/fields/section/fieldConfigProps.js +0 -11
- package/dist/fields/section/fieldContentProps.d.ts +0 -3
- package/dist/fields/section/fieldContentProps.js +0 -11
- package/dist/fields/section/fieldSectionProps.d.ts +0 -3
- package/dist/fields/section/fieldSectionProps.js +0 -15
- package/dist/fields/section/fieldSectionTabs.d.ts +0 -13
- package/dist/fields/section/fieldSectionTabs.js +0 -40
- package/dist/fields/style/fieldColor.d.ts +0 -4
- package/dist/fields/style/fieldColor.js +0 -21
- package/dist/fields/style/fieldContainerWidths.d.ts +0 -7
- package/dist/fields/style/fieldContainerWidths.js +0 -17
- package/dist/fields/style/fieldCss.d.ts +0 -3
- package/dist/fields/style/fieldCss.js +0 -65
- package/dist/fields/style/fieldFontSizes.d.ts +0 -3
- package/dist/fields/style/fieldFontSizes.js +0 -14
- package/dist/fields/style/fieldHeights.d.ts +0 -7
- package/dist/fields/style/fieldHeights.js +0 -23
- package/dist/fields/style/fieldMargins.d.ts +0 -7
- package/dist/fields/style/fieldMargins.js +0 -138
- package/dist/fields/style/fieldPaddings.d.ts +0 -7
- package/dist/fields/style/fieldPaddings.js +0 -114
- package/dist/fields/style/fieldViewportHeights.d.ts +0 -7
- package/dist/fields/style/fieldViewportHeights.js +0 -22
- package/dist/fields/utils/fieldRoles.d.ts +0 -4
- package/dist/react/Card.d.ts +0 -6
- package/dist/react/Card.js +0 -4
- package/dist/react/PageRenderer.d.ts +0 -4
- package/dist/react/PageRenderer.js +0 -34
- package/dist/react/ViewBlock.d.ts +0 -1
- package/dist/react/ViewBlock.js +0 -62
- package/dist/react/registry.js +0 -5
- package/dist/userRoles-BqQg1D6Q.js +0 -2
- package/dist/userRoles-BqQg1D6Q.js.map +0 -1
- package/dist/userRoles-CL8SQUFs.js +0 -2
- package/dist/userRoles-CL8SQUFs.js.map +0 -1
- package/dist/utils/resolveViewData.js +0 -26
- /package/dist/{acl → config/acl}/hasRoles.d.ts +0 -0
- /package/dist/{acl → config/acl}/hasRoles.js +0 -0
- /package/dist/{acl → config/acl}/index.d.ts +0 -0
- /package/dist/{acl → config/acl}/index.js +0 -0
- /package/dist/config/{blockView.d.ts → blocks/blockView.d.ts} +0 -0
- /package/dist/{enums → config/enums}/index.d.ts +0 -0
- /package/dist/{enums → config/enums}/index.js +0 -0
- /package/dist/{enums → config/enums}/userRoles.d.ts +0 -0
- /package/dist/{enums → config/enums}/userRoles.js +0 -0
- /package/dist/config/{fieldCss.d.ts → fields/fieldCss.d.ts} +0 -0
- /package/dist/config/{configFooter.d.ts → globals/configFooter.d.ts} +0 -0
- /package/dist/config/{configHeader.d.ts → globals/configHeader.d.ts} +0 -0
- /package/dist/config/{configSettings.d.ts → globals/configSettings.d.ts} +0 -0
- /package/dist/{hooks → config/hooks}/fields/getNumberValueFromClassNameString.d.ts +0 -0
- /package/dist/{hooks → config/hooks}/fields/getNumberValueFromClassNameString.js +0 -0
- /package/dist/{hooks → config/hooks}/fields/populateSiblingClassName.d.ts +0 -0
- /package/dist/{hooks → config/hooks}/fields/populateSiblingClassNameAfterChange.d.ts +0 -0
- /package/dist/{hooks → config/hooks}/fields/updateClassNameAfterRead.d.ts +0 -0
- /package/dist/{hooks → config/hooks}/fields/updateClassNameAfterRead.js +0 -0
- /package/dist/{hooks → config/hooks}/index.d.ts +0 -0
- /package/dist/{hooks → config/hooks}/index.js +0 -0
- /package/dist/react/{registry.d.ts → componentRegistry.d.ts} +0 -0
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import fieldRichText from '../fieldRichText';
|
|
2
|
-
import fieldContainerWidths from '../style/fieldContainerWidths';
|
|
3
|
-
import fieldUpload from '../fieldUpload';
|
|
4
|
-
import fieldColor from '../style/fieldColor';
|
|
5
|
-
import fieldSelect from '../fieldSelect';
|
|
6
|
-
import fieldHeights from '../style/fieldHeights';
|
|
7
|
-
import fieldCss from '../style/fieldCss';
|
|
8
|
-
const fieldContainerProps = (customFields = []) => {
|
|
9
|
-
return {
|
|
10
|
-
name: 'ctrP',
|
|
11
|
-
label: 'Proprietà container',
|
|
12
|
-
type: 'group',
|
|
13
|
-
fields: [
|
|
14
|
-
...customFields,
|
|
15
|
-
fieldRichText({ name: 'body', label: 'Contenuto', required: false }),
|
|
16
|
-
fieldContainerWidths(),
|
|
17
|
-
{
|
|
18
|
-
type: 'tabs',
|
|
19
|
-
tabs: [
|
|
20
|
-
{
|
|
21
|
-
label: 'Stile',
|
|
22
|
-
fields: [
|
|
23
|
-
fieldUpload('media', { name: 'bgi', label: 'Immagine di sfondo' }),
|
|
24
|
-
fieldColor({ name: 'bgc', label: 'Colore di sfondo', required: false }),
|
|
25
|
-
fieldSelect({
|
|
26
|
-
name: 'borderRadius',
|
|
27
|
-
type: 'select',
|
|
28
|
-
label: 'Angoli arrotondati',
|
|
29
|
-
defaultValue: 'rounded-none',
|
|
30
|
-
options: [
|
|
31
|
-
{ label: 'Nessuno', value: 'rounded-none' },
|
|
32
|
-
{ label: 'Piccolo', value: 'rounded-sm' },
|
|
33
|
-
{ label: 'Medio', value: 'rounded-md' },
|
|
34
|
-
{ label: 'Grande', value: 'rounded-lg' },
|
|
35
|
-
{ label: 'Extra Grande', value: 'rounded-xl' },
|
|
36
|
-
{ label: 'Massimo', value: 'rounded-full' },
|
|
37
|
-
],
|
|
38
|
-
admin: {
|
|
39
|
-
width: '50%',
|
|
40
|
-
description: 'Imposta lo stile degli angoli arrotondati del contenitore.',
|
|
41
|
-
},
|
|
42
|
-
}),
|
|
43
|
-
fieldSelect({
|
|
44
|
-
name: 'boxShadow',
|
|
45
|
-
type: 'select',
|
|
46
|
-
label: 'Ombra contenitore',
|
|
47
|
-
defaultValue: 'shadow-none', // Default: nessuna ombra
|
|
48
|
-
options: [
|
|
49
|
-
{ label: 'Nessuna', value: 'shadow-none' },
|
|
50
|
-
{ label: 'Piccola', value: 'shadow-sm' },
|
|
51
|
-
{ label: 'Normale', value: 'shadow' },
|
|
52
|
-
{ label: 'Media', value: 'shadow-md' },
|
|
53
|
-
{ label: 'Grande', value: 'shadow-lg' },
|
|
54
|
-
{ label: 'Extra Grande', value: 'shadow-xl' },
|
|
55
|
-
{ label: 'Massima', value: 'shadow-2xl' },
|
|
56
|
-
],
|
|
57
|
-
admin: {
|
|
58
|
-
width: '50%',
|
|
59
|
-
description: "Imposta lo stile dell'ombra per il contenitore.",
|
|
60
|
-
},
|
|
61
|
-
}),
|
|
62
|
-
],
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
label: 'Dimensioni',
|
|
66
|
-
fields: [fieldHeights()],
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
},
|
|
70
|
-
fieldCss(),
|
|
71
|
-
],
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
export default fieldContainerProps;
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import fieldColor from '../style/fieldColor';
|
|
2
|
-
import iconsList from '../../iconsList';
|
|
3
|
-
import fieldCheckbox from '../fieldCheckbox';
|
|
4
|
-
import fieldText from '../fieldText';
|
|
5
|
-
import fieldSelect from '../fieldSelect';
|
|
6
|
-
import fieldRelationship from '../fieldRelationship';
|
|
7
|
-
const fieldAction = (config = {}) => {
|
|
8
|
-
const { relationToOptions = ['pages'] } = config;
|
|
9
|
-
return {
|
|
10
|
-
type: 'group',
|
|
11
|
-
label: 'Azione',
|
|
12
|
-
name: 'action',
|
|
13
|
-
fields: [
|
|
14
|
-
fieldCheckbox({
|
|
15
|
-
name: 'show',
|
|
16
|
-
label: 'Mostra azione',
|
|
17
|
-
defaultValue: false,
|
|
18
|
-
admin: {
|
|
19
|
-
width: '50%',
|
|
20
|
-
},
|
|
21
|
-
}),
|
|
22
|
-
fieldText({
|
|
23
|
-
name: 'label',
|
|
24
|
-
type: 'text',
|
|
25
|
-
label: 'Testo da visualizzare',
|
|
26
|
-
defaultValue: 'Action',
|
|
27
|
-
admin: {
|
|
28
|
-
width: '50%',
|
|
29
|
-
},
|
|
30
|
-
}),
|
|
31
|
-
fieldSelect({
|
|
32
|
-
name: 'actionType',
|
|
33
|
-
label: 'Tipo di azione',
|
|
34
|
-
defaultValue: 'internalLink',
|
|
35
|
-
admin: {
|
|
36
|
-
width: '33%',
|
|
37
|
-
},
|
|
38
|
-
options: [
|
|
39
|
-
{
|
|
40
|
-
label: 'Interno',
|
|
41
|
-
value: 'internalLink',
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
label: 'Esterno',
|
|
45
|
-
value: 'externalLink',
|
|
46
|
-
},
|
|
47
|
-
/*
|
|
48
|
-
{
|
|
49
|
-
label: 'Azione',
|
|
50
|
-
value: 'customAction',
|
|
51
|
-
},
|
|
52
|
-
*/
|
|
53
|
-
],
|
|
54
|
-
}),
|
|
55
|
-
fieldRelationship(relationToOptions, {
|
|
56
|
-
name: 'internalLink',
|
|
57
|
-
label: 'Seleziona una pagina interna',
|
|
58
|
-
admin: {
|
|
59
|
-
condition: (data, siblingData) => {
|
|
60
|
-
return siblingData?.actionType === 'internalLink';
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
}),
|
|
64
|
-
{
|
|
65
|
-
name: 'externalLink',
|
|
66
|
-
type: 'text',
|
|
67
|
-
label: 'URL esterno',
|
|
68
|
-
admin: {
|
|
69
|
-
condition: (data, siblingData) => {
|
|
70
|
-
return siblingData?.actionType === 'externalLink';
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
type: 'collapsible',
|
|
76
|
-
label: 'Stile',
|
|
77
|
-
fields: [
|
|
78
|
-
{
|
|
79
|
-
type: 'row',
|
|
80
|
-
fields: [
|
|
81
|
-
{
|
|
82
|
-
name: 'buttonStyle',
|
|
83
|
-
type: 'select',
|
|
84
|
-
label: 'Stile bottone',
|
|
85
|
-
defaultValue: 'solid',
|
|
86
|
-
admin: {
|
|
87
|
-
width: '33%',
|
|
88
|
-
},
|
|
89
|
-
options: [
|
|
90
|
-
{ label: 'Solido', value: 'solid' },
|
|
91
|
-
{ label: 'Outline', value: 'outline' },
|
|
92
|
-
{ label: 'Ghost', value: 'ghost' },
|
|
93
|
-
{ label: 'Link', value: 'link' },
|
|
94
|
-
],
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
name: 'buttonColor',
|
|
98
|
-
type: 'select',
|
|
99
|
-
label: 'Colore bottone',
|
|
100
|
-
defaultValue: 'primary',
|
|
101
|
-
admin: {
|
|
102
|
-
width: '33%',
|
|
103
|
-
},
|
|
104
|
-
options: [
|
|
105
|
-
{ label: 'Primary', value: 'primary' },
|
|
106
|
-
{ label: 'Secondary', value: 'secondary' },
|
|
107
|
-
{ label: 'Accent', value: 'accent' },
|
|
108
|
-
{ label: 'Dark', value: 'dark' },
|
|
109
|
-
{ label: 'Light', value: 'light' },
|
|
110
|
-
],
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
name: 'buttonSize',
|
|
114
|
-
type: 'select',
|
|
115
|
-
label: 'Dimensione bottone',
|
|
116
|
-
defaultValue: 'default',
|
|
117
|
-
admin: {
|
|
118
|
-
width: '33%',
|
|
119
|
-
},
|
|
120
|
-
options: [
|
|
121
|
-
{ label: 'Small', value: 'small' },
|
|
122
|
-
{ label: 'Default', value: 'default' },
|
|
123
|
-
{ label: 'Medium', value: 'medium' },
|
|
124
|
-
{ label: 'Large', value: 'large' },
|
|
125
|
-
{ label: 'Extra Large', value: 'xl' },
|
|
126
|
-
],
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
name: 'buttonRounded',
|
|
130
|
-
type: 'select',
|
|
131
|
-
label: 'Arrotondamento',
|
|
132
|
-
defaultValue: 'default',
|
|
133
|
-
admin: {
|
|
134
|
-
width: '33%',
|
|
135
|
-
},
|
|
136
|
-
options: [
|
|
137
|
-
{ label: 'Nessuno', value: 'none' },
|
|
138
|
-
{ label: 'Piccolo', value: 'sm' },
|
|
139
|
-
{ label: 'Standard', value: 'default' },
|
|
140
|
-
{ label: 'Grande', value: 'lg' },
|
|
141
|
-
{ label: 'Completo', value: 'full' },
|
|
142
|
-
],
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
name: 'alignment',
|
|
146
|
-
type: 'select',
|
|
147
|
-
label: 'Allineamento del Bottone',
|
|
148
|
-
defaultValue: 'left',
|
|
149
|
-
options: [
|
|
150
|
-
{
|
|
151
|
-
label: 'Sinistra',
|
|
152
|
-
value: 'left',
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
label: 'Centro',
|
|
156
|
-
value: 'center',
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
label: 'Destra',
|
|
160
|
-
value: 'right',
|
|
161
|
-
},
|
|
162
|
-
],
|
|
163
|
-
admin: {
|
|
164
|
-
width: '33%',
|
|
165
|
-
condition: (data) => true, // Puoi modificare questa condizione se il campo deve essere mostrato solo in determinate circostanze
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
fieldColor({
|
|
169
|
-
name: 'textColor',
|
|
170
|
-
label: 'Colore del testo',
|
|
171
|
-
admin: {
|
|
172
|
-
width: '33%',
|
|
173
|
-
},
|
|
174
|
-
}),
|
|
175
|
-
{
|
|
176
|
-
name: 'additionalEffects',
|
|
177
|
-
type: 'select',
|
|
178
|
-
label: 'Effetti aggiuntivi',
|
|
179
|
-
hasMany: true,
|
|
180
|
-
admin: {
|
|
181
|
-
width: '33%',
|
|
182
|
-
},
|
|
183
|
-
options: [
|
|
184
|
-
{ label: 'Ombra', value: 'shadow' },
|
|
185
|
-
{ label: 'Transizione', value: 'transition' },
|
|
186
|
-
{ label: 'Animazione scala', value: 'scale' },
|
|
187
|
-
],
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
type: 'row',
|
|
193
|
-
fields: [
|
|
194
|
-
{
|
|
195
|
-
name: 'useIcon',
|
|
196
|
-
type: 'checkbox',
|
|
197
|
-
label: 'Usa icona',
|
|
198
|
-
defaultValue: false,
|
|
199
|
-
admin: {
|
|
200
|
-
width: '33%',
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
name: 'iconPosition',
|
|
205
|
-
type: 'select',
|
|
206
|
-
label: 'Posizione icona',
|
|
207
|
-
defaultValue: 'left',
|
|
208
|
-
admin: {
|
|
209
|
-
width: '33%',
|
|
210
|
-
condition: (_, siblingData) => siblingData?.useIcon === true,
|
|
211
|
-
},
|
|
212
|
-
options: [
|
|
213
|
-
{ label: 'Sinistra', value: 'left' },
|
|
214
|
-
{ label: 'Destra', value: 'right' },
|
|
215
|
-
{ label: 'Solo icona', value: 'only' },
|
|
216
|
-
],
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
name: 'iconName',
|
|
220
|
-
type: 'select',
|
|
221
|
-
label: 'Icona',
|
|
222
|
-
options: [...iconsList],
|
|
223
|
-
admin: {
|
|
224
|
-
width: '33%',
|
|
225
|
-
condition: (_, siblingData) => siblingData?.useIcon === true,
|
|
226
|
-
},
|
|
227
|
-
// Qui potresti usare un select con le icone disponibili se hai una libreria predefinita
|
|
228
|
-
},
|
|
229
|
-
],
|
|
230
|
-
},
|
|
231
|
-
],
|
|
232
|
-
},
|
|
233
|
-
],
|
|
234
|
-
};
|
|
235
|
-
};
|
|
236
|
-
export default fieldAction;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import fieldRichText from '../fieldRichText';
|
|
2
|
-
import fieldCss from '../style/fieldCss';
|
|
3
|
-
const fieldSectionProps = (customFields = []) => {
|
|
4
|
-
return {
|
|
5
|
-
name: 'sctP',
|
|
6
|
-
label: 'Proprietà sezione',
|
|
7
|
-
type: 'group',
|
|
8
|
-
fields: [
|
|
9
|
-
...customFields,
|
|
10
|
-
fieldRichText({ name: 'body', label: 'Contenuto', required: false }),
|
|
11
|
-
fieldCss(),
|
|
12
|
-
],
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export default fieldSectionProps;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Field } from 'payload';
|
|
2
|
-
export interface BlockTabsOptions {
|
|
3
|
-
config?: boolean;
|
|
4
|
-
section?: boolean;
|
|
5
|
-
container?: boolean;
|
|
6
|
-
content?: boolean;
|
|
7
|
-
configFields?: Field[];
|
|
8
|
-
sectionFields?: Field[];
|
|
9
|
-
containerFields?: Field[];
|
|
10
|
-
contentFields?: Field[];
|
|
11
|
-
}
|
|
12
|
-
declare const fieldSectionTabs: (options?: BlockTabsOptions) => Field;
|
|
13
|
-
export default fieldSectionTabs;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import fieldConfigProps from './fieldConfigProps';
|
|
2
|
-
import fieldSectionProps from './fieldSectionProps';
|
|
3
|
-
import fieldContentProps from './fieldContentProps';
|
|
4
|
-
import fieldContainerProps from '../layout/fieldContainerProps';
|
|
5
|
-
const fieldSectionTabs = (options = {}) => {
|
|
6
|
-
const { config = true, section = true, container = true, content = true, configFields = [], sectionFields = [], containerFields = [], contentFields = [], } = options;
|
|
7
|
-
const tabs = [];
|
|
8
|
-
if (config) {
|
|
9
|
-
tabs.push({
|
|
10
|
-
label: 'Configurazione',
|
|
11
|
-
fields: [fieldConfigProps(configFields)],
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
// Tab per la sezione
|
|
15
|
-
if (section) {
|
|
16
|
-
tabs.push({
|
|
17
|
-
label: 'Sezione',
|
|
18
|
-
fields: [fieldSectionProps(sectionFields)],
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
// Tab per il container
|
|
22
|
-
if (container) {
|
|
23
|
-
tabs.push({
|
|
24
|
-
label: 'Container',
|
|
25
|
-
fields: [fieldContainerProps(containerFields)],
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
// Tab per il contenuto
|
|
29
|
-
if (content) {
|
|
30
|
-
tabs.push({
|
|
31
|
-
label: 'Contenuto',
|
|
32
|
-
fields: [fieldContentProps(contentFields)],
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
type: 'tabs',
|
|
37
|
-
tabs: tabs,
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
export default fieldSectionTabs;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export const fieldThemeColor = (override) => ({
|
|
2
|
-
name: override?.name || 'color',
|
|
3
|
-
label: override?.label || 'Colore',
|
|
4
|
-
type: 'select',
|
|
5
|
-
required: override?.required ?? false,
|
|
6
|
-
options: [
|
|
7
|
-
{ label: 'Default', value: '' },
|
|
8
|
-
{ label: 'Foreground', value: 'foreground' },
|
|
9
|
-
{ label: 'Primary', value: 'primary' },
|
|
10
|
-
{ label: 'Secondary', value: 'secondary' },
|
|
11
|
-
{ label: 'Accent', value: 'accent' },
|
|
12
|
-
{ label: 'Dark', value: 'dark' },
|
|
13
|
-
{ label: 'Light', value: 'light' },
|
|
14
|
-
{ label: 'White', value: 'white' },
|
|
15
|
-
{ label: 'Black', value: 'black' },
|
|
16
|
-
],
|
|
17
|
-
admin: {
|
|
18
|
-
...override?.admin,
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
export default fieldThemeColor;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { TailwindContainerWidths } from '../../tailwind';
|
|
2
|
-
import fieldSelect from '../fieldSelect';
|
|
3
|
-
/**
|
|
4
|
-
* Genera un campo per la selezione delle larghezze del container
|
|
5
|
-
* @returns Field - Campo di tipo `select` per PayloadCMS
|
|
6
|
-
*/
|
|
7
|
-
const fieldContainerWidths = () => {
|
|
8
|
-
return fieldSelect({
|
|
9
|
-
name: 'container',
|
|
10
|
-
label: 'Larghezza del container',
|
|
11
|
-
options: [{ value: '', label: '(Nessuno)' }, ...TailwindContainerWidths],
|
|
12
|
-
admin: {
|
|
13
|
-
description: 'Seleziona una larghezza massima per il container. Usa "None" per una larghezza a schermo intero.',
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
export default fieldContainerWidths;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import fieldText from '../fieldText';
|
|
2
|
-
import fieldMargins from './fieldMargins';
|
|
3
|
-
import fieldPaddings from './fieldPaddings';
|
|
4
|
-
import fieldHeights from './fieldHeights';
|
|
5
|
-
/*
|
|
6
|
-
const concatCssFields: FieldHook = (args) => {
|
|
7
|
-
const { value, siblingData, operation } = args
|
|
8
|
-
console.log(value)
|
|
9
|
-
console.log(siblingData)
|
|
10
|
-
console.log(operation)
|
|
11
|
-
const classes: string[] = []
|
|
12
|
-
if (operation === 'create' || operation === 'update') {
|
|
13
|
-
Object.entries(siblingData).forEach(([key, val]) => {
|
|
14
|
-
if (key !== 'className' && val !== null && val !== undefined) {
|
|
15
|
-
classes.push(`${key}${val}`)
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
}
|
|
19
|
-
return classes.join(' ') || null
|
|
20
|
-
}
|
|
21
|
-
*/
|
|
22
|
-
const concatCssFields = (args) => {
|
|
23
|
-
const { value, siblingData, operation } = args;
|
|
24
|
-
console.log('value', value);
|
|
25
|
-
console.log('siblingData', siblingData);
|
|
26
|
-
console.log('operation', operation);
|
|
27
|
-
if (operation === 'create' || operation === 'update') {
|
|
28
|
-
const classes = [];
|
|
29
|
-
Object.entries(siblingData || {}).forEach(([key, val]) => {
|
|
30
|
-
if (key !== 'className' && val !== null && val !== undefined) {
|
|
31
|
-
classes.push(`${key}${val}`);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
console.log(classes.join(' '));
|
|
35
|
-
return classes.join(' ');
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const fieldCss = () => {
|
|
39
|
-
return {
|
|
40
|
-
name: 'css',
|
|
41
|
-
type: 'group',
|
|
42
|
-
label: 'Regole di stile',
|
|
43
|
-
fields: [
|
|
44
|
-
fieldText({
|
|
45
|
-
name: 'className',
|
|
46
|
-
label: 'className',
|
|
47
|
-
required: false,
|
|
48
|
-
hooks: {
|
|
49
|
-
beforeValidate: [concatCssFields],
|
|
50
|
-
},
|
|
51
|
-
}),
|
|
52
|
-
fieldHeights(),
|
|
53
|
-
{
|
|
54
|
-
type: 'tabs',
|
|
55
|
-
tabs: [
|
|
56
|
-
{
|
|
57
|
-
label: 'Spacing',
|
|
58
|
-
fields: [fieldMargins(), fieldPaddings()],
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
export default fieldCss;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { TailwindTextSizes } from '../../tailwind';
|
|
2
|
-
import fieldSelect from '../fieldSelect';
|
|
3
|
-
const fieldFontSizes = () => {
|
|
4
|
-
return fieldSelect({
|
|
5
|
-
name: 'fs',
|
|
6
|
-
label: 'Dimensione del testo',
|
|
7
|
-
options: TailwindTextSizes,
|
|
8
|
-
defaultValue: 'text-base',
|
|
9
|
-
admin: {
|
|
10
|
-
description: 'Seleziona una dimensione per il testo (es. Small, Base, Large, ecc.).',
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
export default fieldFontSizes;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { TailwindHeights, TailwindViewportHeights } from '../../tailwind';
|
|
2
|
-
import fieldSelect from '../fieldSelect';
|
|
3
|
-
/**
|
|
4
|
-
* Genera un campo per la selezione delle altezze
|
|
5
|
-
* @returns Field - Campo di tipo `select` per PayloadCMS
|
|
6
|
-
*/
|
|
7
|
-
const fieldHeights = () => {
|
|
8
|
-
return fieldSelect({
|
|
9
|
-
name: 'h-',
|
|
10
|
-
label: 'Altezza',
|
|
11
|
-
type: 'select',
|
|
12
|
-
defaultValue: 'full',
|
|
13
|
-
options: [
|
|
14
|
-
{ value: '', label: '(Nessuno)' },
|
|
15
|
-
...TailwindViewportHeights.map((h) => ({ value: `${h}`, label: h })),
|
|
16
|
-
...TailwindHeights.map((h) => ({ value: `${h}`, label: h })),
|
|
17
|
-
],
|
|
18
|
-
admin: {
|
|
19
|
-
description: 'Definisce l’altezza dell’elemento.',
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
export default fieldHeights;
|