@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,138 +0,0 @@
|
|
|
1
|
-
import fieldNumber from '../fieldNumber';
|
|
2
|
-
import { getNumberValueFromClassNameString } from '../../hooks';
|
|
3
|
-
const concatMarginFields = (args) => {
|
|
4
|
-
const { value, siblingData, operation } = args;
|
|
5
|
-
if (operation === 'create' || operation === 'update') {
|
|
6
|
-
const margins = siblingData || {};
|
|
7
|
-
const { all, x, y, t, r, b, l } = margins;
|
|
8
|
-
const classes = [];
|
|
9
|
-
if (all)
|
|
10
|
-
classes.push(`m-${all}`);
|
|
11
|
-
if (x)
|
|
12
|
-
classes.push(`mx-${x}`);
|
|
13
|
-
if (y)
|
|
14
|
-
classes.push(`my-${y}`);
|
|
15
|
-
if (t)
|
|
16
|
-
classes.push(`mt-${t}`);
|
|
17
|
-
if (r)
|
|
18
|
-
classes.push(`mr-${r}`);
|
|
19
|
-
if (b)
|
|
20
|
-
classes.push(`mb-${b}`);
|
|
21
|
-
if (l)
|
|
22
|
-
classes.push(`ml-${l}`);
|
|
23
|
-
return classes.join(' ');
|
|
24
|
-
}
|
|
25
|
-
return value;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Genera un campo per la selezione dinamica dei margini
|
|
29
|
-
* @returns Field - Campo di tipo `group` per PayloadCMS
|
|
30
|
-
*/
|
|
31
|
-
const fieldMargins = () => {
|
|
32
|
-
return {
|
|
33
|
-
label: 'Margini',
|
|
34
|
-
type: 'collapsible',
|
|
35
|
-
admin: {
|
|
36
|
-
initCollapsed: true,
|
|
37
|
-
},
|
|
38
|
-
fields: [
|
|
39
|
-
{
|
|
40
|
-
type: 'row',
|
|
41
|
-
fields: [
|
|
42
|
-
fieldNumber({
|
|
43
|
-
name: 'm-',
|
|
44
|
-
label: 'Tutti i lati',
|
|
45
|
-
virtual: true,
|
|
46
|
-
min: 0,
|
|
47
|
-
max: 96,
|
|
48
|
-
admin: {
|
|
49
|
-
width: '25%',
|
|
50
|
-
},
|
|
51
|
-
hooks: {
|
|
52
|
-
afterRead: [getNumberValueFromClassNameString],
|
|
53
|
-
},
|
|
54
|
-
}),
|
|
55
|
-
fieldNumber({
|
|
56
|
-
name: 'mx-',
|
|
57
|
-
label: 'Orizzontale',
|
|
58
|
-
virtual: true,
|
|
59
|
-
min: 0,
|
|
60
|
-
max: 96,
|
|
61
|
-
admin: {
|
|
62
|
-
width: '25%',
|
|
63
|
-
},
|
|
64
|
-
hooks: {
|
|
65
|
-
afterRead: [getNumberValueFromClassNameString],
|
|
66
|
-
},
|
|
67
|
-
}),
|
|
68
|
-
fieldNumber({
|
|
69
|
-
name: 'my-',
|
|
70
|
-
label: 'Verticale',
|
|
71
|
-
virtual: true,
|
|
72
|
-
min: 0,
|
|
73
|
-
max: 96,
|
|
74
|
-
admin: {
|
|
75
|
-
width: '25%',
|
|
76
|
-
},
|
|
77
|
-
hooks: {
|
|
78
|
-
afterRead: [getNumberValueFromClassNameString],
|
|
79
|
-
},
|
|
80
|
-
}),
|
|
81
|
-
fieldNumber({
|
|
82
|
-
name: 'mt-',
|
|
83
|
-
label: 'Top',
|
|
84
|
-
virtual: true,
|
|
85
|
-
min: 0,
|
|
86
|
-
max: 96,
|
|
87
|
-
admin: {
|
|
88
|
-
width: '25%',
|
|
89
|
-
},
|
|
90
|
-
hooks: {
|
|
91
|
-
afterRead: [getNumberValueFromClassNameString],
|
|
92
|
-
},
|
|
93
|
-
}),
|
|
94
|
-
fieldNumber({
|
|
95
|
-
name: 'mr-',
|
|
96
|
-
label: 'Right',
|
|
97
|
-
virtual: true,
|
|
98
|
-
min: 0,
|
|
99
|
-
max: 96,
|
|
100
|
-
admin: {
|
|
101
|
-
width: '25%',
|
|
102
|
-
},
|
|
103
|
-
hooks: {
|
|
104
|
-
afterRead: [getNumberValueFromClassNameString],
|
|
105
|
-
},
|
|
106
|
-
}),
|
|
107
|
-
fieldNumber({
|
|
108
|
-
name: 'mb-',
|
|
109
|
-
label: 'Bottom',
|
|
110
|
-
virtual: true,
|
|
111
|
-
min: 0,
|
|
112
|
-
max: 96,
|
|
113
|
-
admin: {
|
|
114
|
-
width: '25%',
|
|
115
|
-
},
|
|
116
|
-
hooks: {
|
|
117
|
-
afterRead: [getNumberValueFromClassNameString],
|
|
118
|
-
},
|
|
119
|
-
}),
|
|
120
|
-
fieldNumber({
|
|
121
|
-
name: 'ml-',
|
|
122
|
-
label: 'Left',
|
|
123
|
-
virtual: true,
|
|
124
|
-
min: 0,
|
|
125
|
-
max: 96,
|
|
126
|
-
admin: {
|
|
127
|
-
width: '25%',
|
|
128
|
-
},
|
|
129
|
-
hooks: {
|
|
130
|
-
afterRead: [getNumberValueFromClassNameString],
|
|
131
|
-
},
|
|
132
|
-
}),
|
|
133
|
-
],
|
|
134
|
-
},
|
|
135
|
-
],
|
|
136
|
-
};
|
|
137
|
-
};
|
|
138
|
-
export default fieldMargins;
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import fieldNumber from '../fieldNumber';
|
|
2
|
-
import { getNumberValueFromClassNameString } from '../../hooks';
|
|
3
|
-
/**
|
|
4
|
-
* Genera un campo per la selezione dinamica dei margini
|
|
5
|
-
* @returns Field - Campo di tipo `group` per PayloadCMS
|
|
6
|
-
*/
|
|
7
|
-
const fieldPaddings = () => {
|
|
8
|
-
return {
|
|
9
|
-
label: 'Paddings',
|
|
10
|
-
type: 'collapsible',
|
|
11
|
-
admin: {
|
|
12
|
-
initCollapsed: true,
|
|
13
|
-
},
|
|
14
|
-
fields: [
|
|
15
|
-
{
|
|
16
|
-
type: 'row',
|
|
17
|
-
fields: [
|
|
18
|
-
fieldNumber({
|
|
19
|
-
name: 'p-',
|
|
20
|
-
label: 'Tutti i lati',
|
|
21
|
-
virtual: true,
|
|
22
|
-
min: 0,
|
|
23
|
-
max: 96,
|
|
24
|
-
admin: {
|
|
25
|
-
width: '25%',
|
|
26
|
-
},
|
|
27
|
-
hooks: {
|
|
28
|
-
afterRead: [getNumberValueFromClassNameString],
|
|
29
|
-
},
|
|
30
|
-
}),
|
|
31
|
-
fieldNumber({
|
|
32
|
-
name: 'px-',
|
|
33
|
-
label: 'Orizzontale',
|
|
34
|
-
virtual: true,
|
|
35
|
-
min: 0,
|
|
36
|
-
max: 96,
|
|
37
|
-
admin: {
|
|
38
|
-
width: '25%',
|
|
39
|
-
},
|
|
40
|
-
hooks: {
|
|
41
|
-
afterRead: [getNumberValueFromClassNameString],
|
|
42
|
-
},
|
|
43
|
-
}),
|
|
44
|
-
fieldNumber({
|
|
45
|
-
name: 'py-',
|
|
46
|
-
label: 'Verticale',
|
|
47
|
-
virtual: true,
|
|
48
|
-
min: 0,
|
|
49
|
-
max: 96,
|
|
50
|
-
admin: {
|
|
51
|
-
width: '25%',
|
|
52
|
-
},
|
|
53
|
-
hooks: {
|
|
54
|
-
afterRead: [getNumberValueFromClassNameString],
|
|
55
|
-
},
|
|
56
|
-
}),
|
|
57
|
-
fieldNumber({
|
|
58
|
-
name: 'pt-',
|
|
59
|
-
label: 'Top',
|
|
60
|
-
virtual: true,
|
|
61
|
-
min: 0,
|
|
62
|
-
max: 96,
|
|
63
|
-
admin: {
|
|
64
|
-
width: '25%',
|
|
65
|
-
},
|
|
66
|
-
hooks: {
|
|
67
|
-
afterRead: [getNumberValueFromClassNameString],
|
|
68
|
-
},
|
|
69
|
-
}),
|
|
70
|
-
fieldNumber({
|
|
71
|
-
name: 'pr-',
|
|
72
|
-
label: 'Right',
|
|
73
|
-
virtual: true,
|
|
74
|
-
min: 0,
|
|
75
|
-
max: 96,
|
|
76
|
-
admin: {
|
|
77
|
-
width: '25%',
|
|
78
|
-
},
|
|
79
|
-
hooks: {
|
|
80
|
-
afterRead: [getNumberValueFromClassNameString],
|
|
81
|
-
},
|
|
82
|
-
}),
|
|
83
|
-
fieldNumber({
|
|
84
|
-
name: 'pb-',
|
|
85
|
-
label: 'Bottom',
|
|
86
|
-
virtual: true,
|
|
87
|
-
min: 0,
|
|
88
|
-
max: 96,
|
|
89
|
-
admin: {
|
|
90
|
-
width: '25%',
|
|
91
|
-
},
|
|
92
|
-
hooks: {
|
|
93
|
-
afterRead: [getNumberValueFromClassNameString],
|
|
94
|
-
},
|
|
95
|
-
}),
|
|
96
|
-
fieldNumber({
|
|
97
|
-
name: 'pl-',
|
|
98
|
-
label: 'Left',
|
|
99
|
-
virtual: true,
|
|
100
|
-
min: 0,
|
|
101
|
-
max: 96,
|
|
102
|
-
admin: {
|
|
103
|
-
width: '25%',
|
|
104
|
-
},
|
|
105
|
-
hooks: {
|
|
106
|
-
afterRead: [getNumberValueFromClassNameString],
|
|
107
|
-
},
|
|
108
|
-
}),
|
|
109
|
-
],
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
export default fieldPaddings;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { 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 fieldViewportHeights = () => {
|
|
8
|
-
return fieldSelect({
|
|
9
|
-
name: 'h-',
|
|
10
|
-
label: 'Altezza viewport',
|
|
11
|
-
type: 'select',
|
|
12
|
-
options: [
|
|
13
|
-
{ value: '', label: '(Nessuno)' },
|
|
14
|
-
...TailwindViewportHeights.map((h) => ({ value: `${h}`, label: h })),
|
|
15
|
-
],
|
|
16
|
-
admin: {
|
|
17
|
-
description: 'Definisce l’altezza dell’elemento.',
|
|
18
|
-
width: '50%',
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
export default fieldViewportHeights;
|
package/dist/react/Card.d.ts
DELETED
package/dist/react/Card.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
// #TODO Gestire doppio caricamento dati:
|
|
3
|
-
// 1 lato payload usando come già fatto api interne di payload mappando i campi in un blocco di tipo view dedicato
|
|
4
|
-
import { resolveInlineComponent } from '../config/utils/resolveInlineComponent';
|
|
5
|
-
import { ViewBlock } from './ViewBlock';
|
|
6
|
-
// 2 recupero dati sempre lato server chiamando un EP in maniera asincrona e gestendo il corretto binding
|
|
7
|
-
export async function PageRenderer({ layout, serverData, }) {
|
|
8
|
-
const resolvedLayout = layout.map((block, index) => {
|
|
9
|
-
if (block.blockType !== 'view')
|
|
10
|
-
return block;
|
|
11
|
-
return {
|
|
12
|
-
blockType: block.blockType,
|
|
13
|
-
component: block.component,
|
|
14
|
-
viewMode: block.viewMode,
|
|
15
|
-
containerProps: block.containerProps,
|
|
16
|
-
rowComponent: block.rowComponent,
|
|
17
|
-
rowViewMode: block.rowViewMode,
|
|
18
|
-
rowPropsMapping: block.rowPropsMapping,
|
|
19
|
-
rowChildren: block.rowChildren,
|
|
20
|
-
_resolvedData: serverData[index] ?? [],
|
|
21
|
-
_resolvedOk: true,
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
return (_jsx(_Fragment, { children: resolvedLayout.map((block, i) => {
|
|
25
|
-
if (block.blockType === 'view') {
|
|
26
|
-
return _jsx(ViewBlock, { ...block }, i);
|
|
27
|
-
}
|
|
28
|
-
const resolved = resolveInlineComponent(block);
|
|
29
|
-
if (!resolved)
|
|
30
|
-
return null;
|
|
31
|
-
const { Component, props } = resolved;
|
|
32
|
-
return _jsx(Component, { ...props }, i);
|
|
33
|
-
}) }));
|
|
34
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function ViewBlock(block: any): import("react/jsx-runtime").JSX.Element | null;
|
package/dist/react/ViewBlock.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { componentRegistry } from './registry';
|
|
4
|
-
function resolveClassName(viewMode) {
|
|
5
|
-
if (Array.isArray(viewMode) && viewMode.length > 0) {
|
|
6
|
-
return viewMode
|
|
7
|
-
.map((vm) => vm?.css.className)
|
|
8
|
-
.filter(Boolean)
|
|
9
|
-
.join(' ');
|
|
10
|
-
}
|
|
11
|
-
return viewMode?.css.className ?? '';
|
|
12
|
-
}
|
|
13
|
-
export function ViewBlock(block) {
|
|
14
|
-
const { component, viewMode, rowComponent, rowViewMode, containerProps = {}, rowPropsMapping = {}, rowChildren = [], _resolvedData = [], _resolvedOk = true, } = block;
|
|
15
|
-
const Container = componentRegistry[component.componentName];
|
|
16
|
-
const Row = componentRegistry[rowComponent.componentName];
|
|
17
|
-
if (!Container || !Row)
|
|
18
|
-
return null;
|
|
19
|
-
if (!_resolvedOk) {
|
|
20
|
-
return (_jsx(Container, { className: resolveClassName(viewMode), children: _jsx("div", { className: "text-red-600", children: "Impossibile caricare i dati" }) }));
|
|
21
|
-
}
|
|
22
|
-
//#TODO gestire rendering di molteplici rowChildren al mometno stampa solo il primo elemento dell'array
|
|
23
|
-
// --- helper per render figli di riga (con sourceProps mapping) ---
|
|
24
|
-
const renderRowChildren = (children, item) => {
|
|
25
|
-
return children.map((child, idx) => {
|
|
26
|
-
const ChildComp = componentRegistry[child.definition?.componentName];
|
|
27
|
-
if (!ChildComp)
|
|
28
|
-
return null;
|
|
29
|
-
const childVM = Array.isArray(child.viewMode) ? child.viewMode[0] : child.viewMode;
|
|
30
|
-
const hasSourceProps = child.sourceProps &&
|
|
31
|
-
typeof child.sourceProps === 'object' &&
|
|
32
|
-
Object.keys(child.sourceProps).length > 0;
|
|
33
|
-
let finalProps = {};
|
|
34
|
-
if (hasSourceProps) {
|
|
35
|
-
for (const [key, path] of Object.entries(child.sourceProps)) {
|
|
36
|
-
// @ts-ignore
|
|
37
|
-
finalProps[key] = path
|
|
38
|
-
.toString()
|
|
39
|
-
.split('.')
|
|
40
|
-
.reduce((acc, k) => acc?.[k], item);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
// fallback ai props statici
|
|
45
|
-
finalProps = child.staticProps || {};
|
|
46
|
-
}
|
|
47
|
-
return _jsx(ChildComp, { ...finalProps, className: resolveClassName(childVM) }, idx);
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
return (_jsx(Container, { className: resolveClassName(viewMode), ...containerProps, children: _resolvedData.map((item, i) => {
|
|
51
|
-
const props = {};
|
|
52
|
-
// mapping valori verso props della card
|
|
53
|
-
for (const [key, path] of Object.entries(rowPropsMapping)) {
|
|
54
|
-
// @ts-ignore
|
|
55
|
-
props[key] = path
|
|
56
|
-
.toString()
|
|
57
|
-
.split('.')
|
|
58
|
-
.reduce((acc, k) => acc?.[k], item);
|
|
59
|
-
}
|
|
60
|
-
return (_jsx(Row, { ...props, className: resolveClassName(rowViewMode), children: rowChildren?.length > 0 ? renderRowChildren(rowChildren, item) : null }, i));
|
|
61
|
-
}) }));
|
|
62
|
-
}
|
package/dist/react/registry.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const e=e=>({name:"text",label:"Text",type:"text",required:!0,...e}),a=(e,a)=>({name:"upload",label:"upload",type:"upload",required:!1,relationTo:e,...a}),l=e=>({name:"number",label:"Number",type:"number",required:!1,...e}),i=e=>({name:"richText",label:"Rich Text",type:"richText",required:!1,admin:{placeholder:"Insert text here",rows:5},...e}),t=e=>({name:"select",label:"select",type:"select",required:!1,hasMany:!1,...e}),o=["container","container-sm","container-md","container-lg","container-xl","container-2xl"],n=["screen","1/5-vh","1/4-vh","1/3-vh","2/5-vh","1/2-vh","3/5-vh","2/3-vh","3/4-vh","4/5-vh"],r=["auto","min","max","fit","full","1/2","1/3","2/3","1/4","3/4","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59","60","61","62","63","64","65","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","87","88","89","90","91","92","93","94","95","96"],s=["text-xs","text-sm","text-base","text-lg","text-xl","text-2xl","text-3xl","text-4xl","text-5xl","text-6xl","text-7xl"],d=()=>t({name:"container",label:"Larghezza del container",options:[{value:"",label:"(Nessuno)"},...o],admin:{description:'Seleziona una larghezza massima per il container. Usa "None" per una larghezza a schermo intero.'}}),m=e=>({name:e?.name||"color",label:e?.label||"Colore",type:"select",required:e?.required??!1,options:[{label:"Default",value:""},{label:"Foreground",value:"foreground"},{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"},{label:"Accent",value:"accent"},{label:"Dark",value:"dark"},{label:"Light",value:"light"},{label:"White",value:"white"},{label:"Black",value:"black"}],admin:{...e?.admin}}),u=()=>t({name:"h-",label:"Altezza",type:"select",defaultValue:"full",options:[{value:"",label:"(Nessuno)"},...n.map(e=>({value:`${e}`,label:e})),...r.map(e=>({value:`${e}`,label:e}))],admin:{description:"Definisce l’altezza dell’elemento."}}),b=e=>{const{value:a,siblingData:l}=e,i=e.field.name||"",t=l.className?.split(" "),o=t?.find(e=>e.startsWith(i));if(!o)return a;const n=o.replace(i,""),r=Number(n);return isNaN(r)?a:r},p=()=>({label:"Margini",type:"collapsible",admin:{initCollapsed:!0},fields:[{type:"row",fields:[l({name:"m-",label:"Tutti i lati",virtual:!0,min:0,max:96,admin:{width:"25%"},hooks:{afterRead:[b]}}),l({name:"mx-",label:"Orizzontale",virtual:!0,min:0,max:96,admin:{width:"25%"},hooks:{afterRead:[b]}}),l({name:"my-",label:"Verticale",virtual:!0,min:0,max:96,admin:{width:"25%"},hooks:{afterRead:[b]}}),l({name:"mt-",label:"Top",virtual:!0,min:0,max:96,admin:{width:"25%"},hooks:{afterRead:[b]}}),l({name:"mr-",label:"Right",virtual:!0,min:0,max:96,admin:{width:"25%"},hooks:{afterRead:[b]}}),l({name:"mb-",label:"Bottom",virtual:!0,min:0,max:96,admin:{width:"25%"},hooks:{afterRead:[b]}}),l({name:"ml-",label:"Left",virtual:!0,min:0,max:96,admin:{width:"25%"},hooks:{afterRead:[b]}})]}]}),c=()=>({label:"Paddings",type:"collapsible",admin:{initCollapsed:!0},fields:[{type:"row",fields:[l({name:"p-",label:"Tutti i lati",virtual:!0,min:0,max:96,admin:{width:"25%"},hooks:{afterRead:[b]}}),l({name:"px-",label:"Orizzontale",virtual:!0,min:0,max:96,admin:{width:"25%"},hooks:{afterRead:[b]}}),l({name:"py-",label:"Verticale",virtual:!0,min:0,max:96,admin:{width:"25%"},hooks:{afterRead:[b]}}),l({name:"pt-",label:"Top",virtual:!0,min:0,max:96,admin:{width:"25%"},hooks:{afterRead:[b]}}),l({name:"pr-",label:"Right",virtual:!0,min:0,max:96,admin:{width:"25%"},hooks:{afterRead:[b]}}),l({name:"pb-",label:"Bottom",virtual:!0,min:0,max:96,admin:{width:"25%"},hooks:{afterRead:[b]}}),l({name:"pl-",label:"Left",virtual:!0,min:0,max:96,admin:{width:"25%"},hooks:{afterRead:[b]}})]}]}),h=e=>{const{value:a,siblingData:l,operation:i}=e;if(console.log("value",a),console.log("siblingData",l),console.log("operation",i),"create"===i||"update"===i){const e=[];return Object.entries(l||{}).forEach(([a,l])=>{"className"!==a&&null!=l&&e.push(`${a}${l}`)}),console.log(e.join(" ")),e.join(" ")}},x=()=>({name:"css",type:"group",label:"Regole di stile",fields:[e({name:"className",label:"className",required:!1,hooks:{beforeValidate:[h]}}),u(),{type:"tabs",tabs:[{label:"Spacing",fields:[p(),c()]}]}]}),f=(e=[])=>({name:"ctrP",label:"Proprietà container",type:"group",fields:[...e,i({name:"body",label:"Contenuto",required:!1}),d(),{type:"tabs",tabs:[{label:"Stile",fields:[a("media",{name:"bgi",label:"Immagine di sfondo"}),m({name:"bgc",label:"Colore di sfondo",required:!1}),t({name:"borderRadius",type:"select",label:"Angoli arrotondati",defaultValue:"rounded-none",options:[{label:"Nessuno",value:"rounded-none"},{label:"Piccolo",value:"rounded-sm"},{label:"Medio",value:"rounded-md"},{label:"Grande",value:"rounded-lg"},{label:"Extra Grande",value:"rounded-xl"},{label:"Massimo",value:"rounded-full"}],admin:{width:"50%",description:"Imposta lo stile degli angoli arrotondati del contenitore."}}),t({name:"boxShadow",type:"select",label:"Ombra contenitore",defaultValue:"shadow-none",options:[{label:"Nessuna",value:"shadow-none"},{label:"Piccola",value:"shadow-sm"},{label:"Normale",value:"shadow"},{label:"Media",value:"shadow-md"},{label:"Grande",value:"shadow-lg"},{label:"Extra Grande",value:"shadow-xl"},{label:"Massima",value:"shadow-2xl"}],admin:{width:"50%",description:"Imposta lo stile dell'ombra per il contenitore."}})]},{label:"Dimensioni",fields:[u()]}]},x()]}),v=(e=[])=>({name:"config",label:"Configurazione",type:"group",fields:[...e]}),g=(e=[])=>({name:"cntP",label:"Contenuto",type:"group",fields:[...e]}),y=(e=[])=>({name:"sctP",label:"Proprietà sezione",type:"group",fields:[...e,i({name:"body",label:"Contenuto",required:!1}),x()]});var w;!function(e){e.ADMIN="admin",e.DESIGNER="designer",e.COPY="copy",e.WEBADMIN="webadmin"}(w||(w={}));var k=w;exports.TailwindTextSizes=s,exports.TailwindViewportHeights=n,exports.fieldArray=e=>({name:"list",label:"List",type:"array",fields:[],required:!1,...e}),exports.fieldCheckbox=e=>({name:"checkbox",label:"Checkbox",type:"checkbox",required:!1,admin:{description:"Enable or disable the checkbox"},...e}),exports.fieldConfigProps=v,exports.fieldContainerProps=f,exports.fieldContainerWidths=d,exports.fieldContentProps=g,exports.fieldCss=x,exports.fieldHeights=u,exports.fieldMargins=p,exports.fieldNumber=l,exports.fieldPaddings=c,exports.fieldRelationship=(e,a)=>({name:"relationship",label:"Relationship",type:"relationship",relationTo:e,required:!1,...a}),exports.fieldRichText=i,exports.fieldSectionProps=y,exports.fieldSectionTabs=(e={})=>{const{config:a=!0,section:l=!0,container:i=!0,content:t=!0,configFields:o=[],sectionFields:n=[],containerFields:r=[],contentFields:s=[]}=e,d=[];return a&&d.push({label:"Configurazione",fields:[v(o)]}),l&&d.push({label:"Sezione",fields:[y(n)]}),i&&d.push({label:"Container",fields:[f(r)]}),t&&d.push({label:"Contenuto",fields:[g(s)]}),{type:"tabs",tabs:d}},exports.fieldSelect=t,exports.fieldText=e,exports.fieldThemeColor=m,exports.fieldUpload=a,exports.userRoles=k;
|
|
2
|
-
//# sourceMappingURL=userRoles-BqQg1D6Q.js.map
|