@woodylab/payload 0.0.131 → 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/{fieldCss.js → fields/fieldCss.js} +3 -10
- 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/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
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export const tailwindSelectorVariants = [
|
|
2
|
+
// Default
|
|
3
|
+
{ label: 'Default', value: '' },
|
|
4
|
+
// Breakpoints
|
|
5
|
+
{ label: 'sm', value: 'sm:' },
|
|
6
|
+
{ label: 'md', value: 'md:' },
|
|
7
|
+
{ label: 'lg', value: 'lg:' },
|
|
8
|
+
{ label: 'xl', value: 'xl:' },
|
|
9
|
+
{ label: '2xl', value: '2xl:' },
|
|
10
|
+
// Interaction states
|
|
11
|
+
{ label: 'hover', value: 'hover:' },
|
|
12
|
+
{ label: 'focus', value: 'focus:' },
|
|
13
|
+
{ label: 'active', value: 'active:' },
|
|
14
|
+
{ label: 'visited', value: 'visited:' },
|
|
15
|
+
{ label: 'disabled', value: 'disabled:' },
|
|
16
|
+
{ label: 'focus-within', value: 'focus-within:' },
|
|
17
|
+
{ label: 'focus-visible', value: 'focus-visible:' },
|
|
18
|
+
{ label: 'checked', value: 'checked:' },
|
|
19
|
+
// Form states
|
|
20
|
+
{ label: 'placeholder-shown', value: 'placeholder-shown:' },
|
|
21
|
+
{ label: 'read-only', value: 'read-only:' },
|
|
22
|
+
{ label: 'required', value: 'required:' },
|
|
23
|
+
{ label: 'valid', value: 'valid:' },
|
|
24
|
+
{ label: 'invalid', value: 'invalid:' },
|
|
25
|
+
// Structural
|
|
26
|
+
{ label: 'first', value: 'first:' },
|
|
27
|
+
{ label: 'last', value: 'last:' },
|
|
28
|
+
{ label: 'odd', value: 'odd:' },
|
|
29
|
+
{ label: 'even', value: 'even:' },
|
|
30
|
+
{ label: 'only', value: 'only:' },
|
|
31
|
+
{ label: 'first-of-type', value: 'first-of-type:' },
|
|
32
|
+
{ label: 'last-of-type', value: 'last-of-type:' },
|
|
33
|
+
// Group
|
|
34
|
+
{ label: 'group-hover', value: 'group-hover:' },
|
|
35
|
+
{ label: 'group-focus', value: 'group-focus:' },
|
|
36
|
+
{ label: 'group-active', value: 'group-active:' },
|
|
37
|
+
// Peer
|
|
38
|
+
{ label: 'peer-hover', value: 'peer-hover:' },
|
|
39
|
+
{ label: 'peer-focus', value: 'peer-focus:' },
|
|
40
|
+
{ label: 'peer-checked', value: 'peer-checked:' },
|
|
41
|
+
// Environment / media
|
|
42
|
+
{ label: 'dark', value: 'dark:' },
|
|
43
|
+
{ label: 'motion-safe', value: 'motion-safe:' },
|
|
44
|
+
{ label: 'motion-reduce', value: 'motion-reduce:' },
|
|
45
|
+
{ label: 'contrast-more', value: 'contrast-more:' },
|
|
46
|
+
{ label: 'contrast-less', value: 'contrast-less:' },
|
|
47
|
+
// Direction / orientation
|
|
48
|
+
{ label: 'rtl', value: 'rtl:' },
|
|
49
|
+
{ label: 'ltr', value: 'ltr:' },
|
|
50
|
+
{ label: 'portrait', value: 'portrait:' },
|
|
51
|
+
{ label: 'landscape', value: 'landscape:' },
|
|
52
|
+
// ARIA
|
|
53
|
+
{ label: 'aria-checked', value: 'aria-checked:' },
|
|
54
|
+
{ label: 'aria-selected', value: 'aria-selected:' },
|
|
55
|
+
{ label: 'aria-expanded', value: 'aria-expanded:' },
|
|
56
|
+
// Data attributes (generic)
|
|
57
|
+
//{ label: 'data-[state]', value: 'data-[state]:' },
|
|
58
|
+
//{ label: 'data-[active]', value: 'data-[active]:' },
|
|
59
|
+
// Pseudo-elements
|
|
60
|
+
{ label: 'before', value: 'before:' },
|
|
61
|
+
{ label: 'after', value: 'after:' },
|
|
62
|
+
{ label: 'placeholder', value: 'placeholder:' },
|
|
63
|
+
{ label: 'selection', value: 'selection:' },
|
|
64
|
+
{ label: 'marker', value: 'marker:' },
|
|
65
|
+
{ label: 'file', value: 'file:' },
|
|
66
|
+
{ label: 'backdrop', value: 'backdrop:' },
|
|
67
|
+
// Feature queries
|
|
68
|
+
//{ label: 'supports-[...]', value: 'supports-[...]:' },
|
|
69
|
+
];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("../resolveLayout-DlRnQBn8.js");require("react/jsx-runtime"),exports.applyStylesToProps=e.applyStylesToProps,exports.getValueByPath=e.getValueByPath,exports.mapDataToProps=e.mapDataToProps,exports.resolveLayout=e.resolveLayout,exports.resolveViewData=e.resolveViewData;
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// RESOLVER
|
|
2
|
+
export * from './resolver/resolveViewData';
|
|
3
|
+
export * from './resolver/resolveLayout';
|
|
4
|
+
// MAPPER
|
|
5
|
+
export * from './mapper/mapDataToProps';
|
|
6
|
+
export * from './mapper/mapDataToProps';
|
|
7
|
+
export * from './mapper/getValueByPath';
|
|
8
|
+
export * from './mapper/applyStylesToProps';
|
|
9
|
+
// RENDER
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function applyStylesToProps(props, stylesBySlot) {
|
|
2
|
+
if (!stylesBySlot)
|
|
3
|
+
return props;
|
|
4
|
+
const nextProps = { ...props };
|
|
5
|
+
for (const [slot, className] of Object.entries(stylesBySlot)) {
|
|
6
|
+
if (slot === 'root') {
|
|
7
|
+
nextProps['className'] = [nextProps['className'], className].filter(Boolean).join(' ');
|
|
8
|
+
continue;
|
|
9
|
+
}
|
|
10
|
+
if (nextProps[slot] && typeof nextProps[slot] === 'object') {
|
|
11
|
+
nextProps[slot] = {
|
|
12
|
+
...nextProps[slot],
|
|
13
|
+
className: [nextProps[slot].className, className].filter(Boolean).join(' '),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return nextProps;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getValueByPath(obj: any, path: string): any;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getValueByPath } from './getValueByPath';
|
|
2
|
+
export function mapDataToProps({ data, mapper }) {
|
|
3
|
+
const result = {};
|
|
4
|
+
if (!mapper)
|
|
5
|
+
return result;
|
|
6
|
+
for (const key of Object.keys(mapper)) {
|
|
7
|
+
const rule = mapper[key];
|
|
8
|
+
if (typeof rule === 'string' && rule.startsWith('__static:')) {
|
|
9
|
+
result[key] = rule.replace('__static:', '');
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
if (typeof rule === 'string') {
|
|
13
|
+
result[key] = getValueByPath(data, rule);
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
if (typeof rule === 'object' && rule !== null) {
|
|
17
|
+
result[key] = mapDataToProps({
|
|
18
|
+
data,
|
|
19
|
+
mapper: rule,
|
|
20
|
+
});
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
result[key] = undefined;
|
|
24
|
+
}
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function mapInlineBlockToProps({ block, viewMode, }) {
|
|
2
|
+
const result = {};
|
|
3
|
+
for (const key of Object.keys(viewMode)) {
|
|
4
|
+
const schemaValue = viewMode[key];
|
|
5
|
+
const blockValue = block[key];
|
|
6
|
+
if (typeof schemaValue === 'object' && schemaValue !== null && !Array.isArray(schemaValue)) {
|
|
7
|
+
result[key] = mapInlineBlockToProps({
|
|
8
|
+
block: blockValue ?? {},
|
|
9
|
+
viewMode: schemaValue,
|
|
10
|
+
});
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
result[key] = blockValue;
|
|
14
|
+
}
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
let cache = null;
|
|
2
|
+
//# TODO sarebbe sensato cancellare la cache o forzare un nuovo caricamento quando viene fatta una modifica a uno degli elementi della collection
|
|
3
|
+
export async function getComponentRegistry(payload) {
|
|
4
|
+
if (cache) {
|
|
5
|
+
return cache;
|
|
6
|
+
}
|
|
7
|
+
const result = await payload.find({
|
|
8
|
+
collection: 'component-definitions',
|
|
9
|
+
depth: 4,
|
|
10
|
+
pagination: false,
|
|
11
|
+
});
|
|
12
|
+
const byName = {};
|
|
13
|
+
for (const vm of result.docs ?? []) {
|
|
14
|
+
if (vm.name) {
|
|
15
|
+
byName[vm.name] = vm;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
cache = { byName };
|
|
19
|
+
return cache;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
let cache = null;
|
|
2
|
+
//# TODO sarebbe sensato cancellare la cache o forzare un nuovo caricamento quando viene fatta una modifica a uno degli elementi della collection
|
|
3
|
+
export async function getStyleRegistry(payload) {
|
|
4
|
+
if (cache) {
|
|
5
|
+
return cache;
|
|
6
|
+
}
|
|
7
|
+
const result = await payload.find({
|
|
8
|
+
collection: 'styles',
|
|
9
|
+
depth: 4,
|
|
10
|
+
pagination: false,
|
|
11
|
+
});
|
|
12
|
+
const byName = {};
|
|
13
|
+
for (const vm of result.docs ?? []) {
|
|
14
|
+
if (vm.name) {
|
|
15
|
+
byName[vm.name] = vm;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
cache = { byName };
|
|
19
|
+
return cache;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
let cache = null;
|
|
2
|
+
//# TODO sarebbe sensato cancellare la cache o forzare un nuovo caricamento quando viene fatta una modifica a uno degli elementi della collection
|
|
3
|
+
export async function getViewModeRegistry(payload) {
|
|
4
|
+
if (cache) {
|
|
5
|
+
return cache;
|
|
6
|
+
}
|
|
7
|
+
const result = await payload.find({
|
|
8
|
+
collection: 'view-modes',
|
|
9
|
+
depth: 4,
|
|
10
|
+
pagination: false,
|
|
11
|
+
});
|
|
12
|
+
const byName = {};
|
|
13
|
+
for (const vm of result.docs ?? []) {
|
|
14
|
+
if (vm.name) {
|
|
15
|
+
byName[vm.name] = vm;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
cache = { byName };
|
|
19
|
+
return cache;
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getStyleRegistry } from '../registry/styleRegistry';
|
|
2
|
+
import { getViewModeRegistry } from '../registry/viewModeRegistry';
|
|
3
|
+
import { getComponentRegistry } from '../registry/componentRegistry';
|
|
4
|
+
export async function createUIMSContext(payload) {
|
|
5
|
+
return {
|
|
6
|
+
payload,
|
|
7
|
+
registries: {
|
|
8
|
+
styles: await getStyleRegistry(payload),
|
|
9
|
+
viewMode: await getViewModeRegistry(payload),
|
|
10
|
+
component: await getComponentRegistry(payload),
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { componentRegistry } from '../../react/componentRegistry';
|
|
2
|
+
import { resolveStylesBySlot } from './resolveStylesBySlot';
|
|
3
|
+
import { applyStylesToProps } from '../mapper/applyStylesToProps';
|
|
4
|
+
import { mapDataToProps } from '../mapper/mapDataToProps';
|
|
5
|
+
export function resolveInlineBlock({ block, context }) {
|
|
6
|
+
//const viewMode = context.registries.viewMode.byId[block.viewMode.value]
|
|
7
|
+
const viewMode = context.registries.viewMode.byName[block.viewMode];
|
|
8
|
+
console.log('viewMode', viewMode);
|
|
9
|
+
if (!viewMode)
|
|
10
|
+
return null;
|
|
11
|
+
const Component = componentRegistry[viewMode.component];
|
|
12
|
+
const stylesBySlot = resolveStylesBySlot(viewMode);
|
|
13
|
+
return {
|
|
14
|
+
Component,
|
|
15
|
+
props: {
|
|
16
|
+
...applyStylesToProps(mapDataToProps({
|
|
17
|
+
data: block,
|
|
18
|
+
mapper: viewMode.blockPropsMapping,
|
|
19
|
+
}), stylesBySlot),
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resolveInlineStylesBySlot(block: any): Record<string, string>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function resolveInlineStylesBySlot(block) {
|
|
2
|
+
const result = {};
|
|
3
|
+
for (const [key, value] of Object.entries(block)) {
|
|
4
|
+
if (value && typeof value === 'object' && Array.isArray(value.style)) {
|
|
5
|
+
const className = value.style
|
|
6
|
+
.map((s) => s?.value?.css?.className)
|
|
7
|
+
.filter(Boolean)
|
|
8
|
+
.join(' ');
|
|
9
|
+
if (className) {
|
|
10
|
+
result[key] = className;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { resolveInlineBlock } from './resolveInlineBlock';
|
|
2
|
+
import { resolveViewBlock } from './resolveViewBlock';
|
|
3
|
+
import { resolveViewData } from './resolveViewData';
|
|
4
|
+
export async function resolveLayout({ layout, context, }) {
|
|
5
|
+
const resolved = [];
|
|
6
|
+
const viewData = await resolveViewData(context.payload, layout);
|
|
7
|
+
for (const [index, block] of layout.entries()) {
|
|
8
|
+
if (block.blockType === 'view') {
|
|
9
|
+
resolved.push(resolveViewBlock({
|
|
10
|
+
block,
|
|
11
|
+
rows: viewData[index] ?? [],
|
|
12
|
+
context,
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
else if (block.blockType === 'reference') {
|
|
16
|
+
const nestedResolved = await resolveLayout({ layout: block.block.value.layout, context });
|
|
17
|
+
resolved.push(...nestedResolved);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
resolved.push(resolveInlineBlock({ block, context }));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return resolved;
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function resolveStylesBySlot(viewMode) {
|
|
2
|
+
const result = {};
|
|
3
|
+
if (!viewMode?.styles)
|
|
4
|
+
return result;
|
|
5
|
+
for (const entry of viewMode.styles) {
|
|
6
|
+
const classNames = entry.style;
|
|
7
|
+
if (classNames) {
|
|
8
|
+
result[entry.slot] = classNames;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UIMSContext } from '../types/UIMSContext';
|
|
2
|
+
export declare function resolveViewBlock({ block, rows, context, }: {
|
|
3
|
+
block: any;
|
|
4
|
+
rows: any[];
|
|
5
|
+
context: UIMSContext;
|
|
6
|
+
}): {
|
|
7
|
+
className: any;
|
|
8
|
+
viewMode: any;
|
|
9
|
+
props: any;
|
|
10
|
+
rowViewMode: any;
|
|
11
|
+
rows: any[];
|
|
12
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { mapDataToProps } from '../mapper/mapDataToProps';
|
|
2
|
+
import { resolveStylesBySlot } from './resolveStylesBySlot';
|
|
3
|
+
import { applyStylesToProps } from '../mapper/applyStylesToProps';
|
|
4
|
+
export function resolveViewBlock({ block, rows, context, }) {
|
|
5
|
+
const viewMode = context.registries.viewMode.byName[block.viewMode];
|
|
6
|
+
const rowViewMode = context.registries.viewMode.byName[block.rowViewMode];
|
|
7
|
+
const stylesBySlot = resolveStylesBySlot(rowViewMode);
|
|
8
|
+
const className = viewMode?.styles.map((style) => {
|
|
9
|
+
return style.style
|
|
10
|
+
.map((ss, i) => {
|
|
11
|
+
const s = context.registries.styles.byName[ss.value.name];
|
|
12
|
+
return ss.value.css.className;
|
|
13
|
+
})
|
|
14
|
+
.join(' ');
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
className,
|
|
18
|
+
viewMode,
|
|
19
|
+
props: block,
|
|
20
|
+
rowViewMode,
|
|
21
|
+
rows: rows.map((row) => applyStylesToProps(mapDataToProps({
|
|
22
|
+
data: row,
|
|
23
|
+
mapper: block.rowPropsMapping,
|
|
24
|
+
}), stylesBySlot)),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { BasePayload } from 'payload';
|
|
2
|
-
|
|
2
|
+
type ViewDataResult = Record<number, any[]>;
|
|
3
|
+
export declare function resolveViewData(payload: BasePayload, layout: any[]): Promise<ViewDataResult>;
|
|
4
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export async function resolveViewData(payload, layout) {
|
|
2
|
+
const results = {};
|
|
3
|
+
for (let index = 0; index < layout.length; index++) {
|
|
4
|
+
const block = layout[index];
|
|
5
|
+
if (!isViewBlock(block)) {
|
|
6
|
+
continue;
|
|
7
|
+
}
|
|
8
|
+
const data = await fetchViewBlockData({
|
|
9
|
+
payload,
|
|
10
|
+
block,
|
|
11
|
+
});
|
|
12
|
+
results[index] = Array.isArray(data) ? data : [];
|
|
13
|
+
}
|
|
14
|
+
return results;
|
|
15
|
+
}
|
|
16
|
+
// ──────────────────────────────────────────────
|
|
17
|
+
// Helpers locali
|
|
18
|
+
// ──────────────────────────────────────────────
|
|
19
|
+
function isViewBlock(block) {
|
|
20
|
+
return block.blockType === 'view';
|
|
21
|
+
}
|
|
22
|
+
async function fetchViewBlockData({ payload, block, }) {
|
|
23
|
+
// Sorgente interna (Payload)
|
|
24
|
+
if (block.useInternalSource) {
|
|
25
|
+
return fetchInternalCollection({
|
|
26
|
+
payload,
|
|
27
|
+
block,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
// Sorgente esterna (REST)
|
|
31
|
+
if (block.dataSource) {
|
|
32
|
+
return fetchExternalSource({
|
|
33
|
+
payload,
|
|
34
|
+
block,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
async function fetchInternalCollection({ payload, block, }) {
|
|
40
|
+
const result = await payload.find({
|
|
41
|
+
collection: block.internalCollection,
|
|
42
|
+
sort: block.internalSort || undefined,
|
|
43
|
+
depth: block.internalDepth ?? 1,
|
|
44
|
+
});
|
|
45
|
+
return result?.docs ?? [];
|
|
46
|
+
}
|
|
47
|
+
async function fetchExternalSource({ payload, block, }) {
|
|
48
|
+
try {
|
|
49
|
+
const res = await fetch(block.dataSource);
|
|
50
|
+
const json = await res.json();
|
|
51
|
+
return Array.isArray(json?.[block.dataSet]) ? json[block.dataSet] : [];
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BasePayload } from 'payload';
|
|
2
|
+
export type StylesRegistry = {
|
|
3
|
+
byName: Record<string, any>;
|
|
4
|
+
};
|
|
5
|
+
export type ViewModeRegistry = {
|
|
6
|
+
byName: Record<string, any>;
|
|
7
|
+
};
|
|
8
|
+
export type ComponentRegistry = {
|
|
9
|
+
byName: Record<string, any>;
|
|
10
|
+
};
|
|
11
|
+
export interface UIMSContext {
|
|
12
|
+
payload: BasePayload;
|
|
13
|
+
registries: {
|
|
14
|
+
styles: StylesRegistry;
|
|
15
|
+
viewMode: ViewModeRegistry;
|
|
16
|
+
component: ComponentRegistry;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getPropsKeys(obj: Record<string, any>): string[];
|
package/dist/utils/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=e=>{const l=e.replace(/^#/,"");if(!/^([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6})$/.test(l))throw new Error(`Colore HEX non valido: ${e}`);const a=3===l.length?l.split("").map(e=>e+e).join(""):l;return{r:parseInt(a.slice(0,2),16),g:parseInt(a.slice(2,4),16),b:parseInt(a.slice(4,6),16)}};exports.generateCssVars=function(l){const a=[300,400,500,600,700,800],o=[l.headingFont,l.textFont].filter(Boolean).map(e=>e?`@import url('https://fonts.googleapis.com/css2?family=${e.replace(/ /g,"+")}:wght@${a.join(";")}&display=swap');`:"").join("\n"),n=(l,a)=>{if(!l)return"";try{const o=e(l);if(!o||"number"!=typeof o.r||"number"!=typeof o.g||"number"!=typeof o.b)return console.warn(`Impossibile convertire il colore ${a}: ${l}`),"";const{r:n,g:r,b:c}=o,i=Array.from({length:9},(e,l)=>{const o=10*(l+1);return`--color-${a}-${o}: rgba(${n}, ${r}, ${c}, ${o/100});`}).join("\n");return`\n --color-${a}: rgb(${n}, ${r}, ${c}); /* Default (opacità 1) */\n ${i}\n `}catch(e){return console.warn(`Errore nella generazione delle varianti di opacità per ${a}: ${e}`),""}},r=(l,a)=>{if(!l)return"";try{const o=e(l);if(!o||"number"!=typeof o.r||"number"!=typeof o.g||"number"!=typeof o.b)return console.warn(`Impossibile convertire il colore ${a}: ${l}`),"";const{r:n,g:r,b:c}=o,i=e=>Math.max(0,Math.min(255,Math.round(e))),t=(e,l)=>`${i(n+(e-n)*l)},${i(r+(e-r)*l)},${i(c+(e-c)*l)}`,u=[.2,.4,.6,.8],b=[10,20,30,40],v=u.map((e,l)=>{const o=b[l];return`--color-${a}-light-${o}: rgb(${t(255,e)});`}).join("\n"),s=u.map((e,l)=>{const o=b[l];return`--color-${a}-dark-${o}: rgb(${t(0,e)});`}).join("\n");return`--color-${a}: rgb(${n}, ${r}, ${c});\n ${v}\n ${s}`}catch(e){return console.warn(`Errore nella generazione delle varianti di brightness per ${a}: ${e}`),""}},c=`${n(l.primaryColor,"primary")} ${r(l.primaryColor,"primary")}`,i=`${n(l.secondaryColor,"secondary")} ${r(l.secondaryColor,"secondary")}`,t=`${n(l.secondaryColor,"accent")} ${r(l.secondaryColor,"accent")}`,u=`${n(l.secondaryColor,"dark")} ${r(l.secondaryColor,"dark")}`,b=`${n(l.secondaryColor,"light")} ${r(l.secondaryColor,"light")}`;return`\n ${o}\n\n :root {\n --font-heading: ${l.headingFont?`'${l.headingFont}', sans-serif`:"system-layout, sans-serif"};\n --font-text: ${l.textFont?`'${l.textFont}', sans-serif`:"system-layout, sans-serif"};\n --color-white: #ffffff;\n --color-black: #000000;\n --color-foreground: ${l.foregroundColor||"#FFFFFF"};\n ${c}\n ${i}\n ${t}\n ${u}\n ${b}\n }\n `},exports.iconsList=[{label:"Academic Cap",value:"AcademicCapIcon"},{label:"Adjustments Horizontal",value:"AdjustmentsHorizontalIcon"},{label:"Adjustments Vertical",value:"AdjustmentsVerticalIcon"},{label:"Archive Box Arrow Down",value:"ArchiveBoxArrowDownIcon"},{label:"Archive Box X Mark",value:"ArchiveBoxXMarkIcon"},{label:"Archive Box",value:"ArchiveBoxIcon"},{label:"Arrow Down Circle",value:"ArrowDownCircleIcon"},{label:"Arrow Down",value:"ArrowDownIcon"},{label:"Arrow Left Circle",value:"ArrowLeftCircleIcon"},{label:"Arrow Left",value:"ArrowLeftIcon"},{label:"Arrow Right Circle",value:"ArrowRightCircleIcon"},{label:"Arrow Right",value:"ArrowRightIcon"},{label:"Arrow Up Circle",value:"ArrowUpCircleIcon"},{label:"Arrow Up",value:"ArrowUpIcon"},{label:"Bell Alert",value:"BellAlertIcon"},{label:"Bell",value:"BellIcon"},{label:"Bookmark Square",value:"BookmarkSquareIcon"},{label:"Bookmark",value:"BookmarkIcon"},{label:"Building Office",value:"BuildingOfficeIcon"},{label:"Calendar",value:"CalendarIcon"},{label:"Camera",value:"CameraIcon"},{label:"Chart Bar",value:"ChartBarIcon"},{label:"Chat Bubble Left Right",value:"ChatBubbleLeftRightIcon"},{label:"Chat Bubble Left",value:"ChatBubbleLeftIcon"},{label:"Check Circle",value:"CheckCircleIcon"},{label:"Check",value:"CheckIcon"},{label:"Chevron Down",value:"ChevronDownIcon"},{label:"Chevron Left",value:"ChevronLeftIcon"},{label:"Chevron Right",value:"ChevronRightIcon"},{label:"Chevron Up",value:"ChevronUpIcon"},{label:"Clock",value:"ClockIcon"},{label:"Cloud Arrow Up",value:"CloudArrowUpIcon"},{label:"Cloud",value:"CloudIcon"},{label:"Code Bracket",value:"CodeBracketIcon"},{label:"Cog",value:"CogIcon"},{label:"Command Line",value:"CommandLineIcon"},{label:"Computer Desktop",value:"ComputerDesktopIcon"},{label:"Credit Card",value:"CreditCardIcon"},{label:"Document",value:"DocumentIcon"},{label:"Envelope",value:"EnvelopeIcon"},{label:"Exclamation Circle",value:"ExclamationCircleIcon"},{label:"Exclamation Triangle",value:"ExclamationTriangleIcon"},{label:"Eye",value:"EyeIcon"},{label:"Face Smile",value:"FaceSmileIcon"},{label:"Film",value:"FilmIcon"},{label:"Finger Print",value:"FingerPrintIcon"},{label:"Fire",value:"FireIcon"},{label:"Flag",value:"FlagIcon"},{label:"Folder Open",value:"FolderOpenIcon"},{label:"Folder",value:"FolderIcon"},{label:"Gift",value:"GiftIcon"},{label:"Globe Alt",value:"GlobeAltIcon"},{label:"Globe Europe Africa",value:"GlobeEuropeAfricaIcon"},{label:"Hand Raised",value:"HandRaisedIcon"},{label:"Heart",value:"HeartIcon"},{label:"Home",value:"HomeIcon"},{label:"Identification",value:"IdentificationIcon"},{label:"Information Circle",value:"InformationCircleIcon"},{label:"Key",value:"KeyIcon"},{label:"Link",value:"LinkIcon"},{label:"List Bullet",value:"ListBulletIcon"},{label:"Lock Closed",value:"LockClosedIcon"},{label:"Lock Open",value:"LockOpenIcon"},{label:"Magnifying Glass Circle",value:"MagnifyingGlassCircleIcon"},{label:"Magnifying Glass",value:"MagnifyingGlassIcon"},{label:"Map Pin",value:"MapPinIcon"},{label:"Map",value:"MapIcon"},{label:"Moon",value:"MoonIcon"},{label:"Paper Airplane",value:"PaperAirplaneIcon"},{label:"Paper Clip",value:"PaperClipIcon"},{label:"Pause Circle",value:"PauseCircleIcon"},{label:"Pencil Square",value:"PencilSquareIcon"},{label:"Pencil",value:"PencilIcon"},{label:"Phone Arrow Up Right",value:"PhoneArrowUpRightIcon"},{label:"Phone X Mark",value:"PhoneXMarkIcon"},{label:"Phone",value:"PhoneIcon"},{label:"Photo",value:"PhotoIcon"},{label:"Play Circle",value:"PlayCircleIcon"},{label:"Play",value:"PlayIcon"},{label:"Plus Circle",value:"PlusCircleIcon"},{label:"Plus",value:"PlusIcon"},{label:"Power",value:"PowerIcon"},{label:"Question Mark Circle",value:"QuestionMarkCircleIcon"},{label:"Rocket Launch",value:"RocketLaunchIcon"},{label:"Rss",value:"RssIcon"},{label:"Scale",value:"ScaleIcon"},{label:"Server",value:"ServerIcon"},{label:"Share",value:"ShareIcon"},{label:"Shield Check",value:"ShieldCheckIcon"},{label:"Shield Exclamation",value:"ShieldExclamationIcon"},{label:"Shopping Bag",value:"ShoppingBagIcon"},{label:"Shopping Cart",value:"ShoppingCartIcon"},{label:"Star",value:"StarIcon"},{label:"Stop Circle",value:"StopCircleIcon"},{label:"Sun",value:"SunIcon"},{label:"Tag",value:"TagIcon"},{label:"Trash",value:"TrashIcon"},{label:"Trophy",value:"TrophyIcon"},{label:"User Circle",value:"UserCircleIcon"},{label:"User Group",value:"UserGroupIcon"},{label:"User",value:"UserIcon"},{label:"Users",value:"UsersIcon"},{label:"Video Camera",value:"VideoCameraIcon"},{label:"Wifi",value:"WifiIcon"},{label:"Window",value:"WindowIcon"},{label:"Wrench Screwdriver",value:"WrenchScrewdriverIcon"},{label:"Wrench",value:"WrenchIcon"},{label:"X Circle",value:"XCircleIcon"},{label:"X Mark",value:"XMarkIcon"}]
|
|
1
|
+
"use strict";const e=e=>{const l=e.replace(/^#/,"");if(!/^([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6})$/.test(l))throw new Error(`Colore HEX non valido: ${e}`);const a=3===l.length?l.split("").map(e=>e+e).join(""):l;return{r:parseInt(a.slice(0,2),16),g:parseInt(a.slice(2,4),16),b:parseInt(a.slice(4,6),16)}};exports.generateCssVars=function(l){const a=[300,400,500,600,700,800],o=[l.headingFont,l.textFont].filter(Boolean).map(e=>e?`@import url('https://fonts.googleapis.com/css2?family=${e.replace(/ /g,"+")}:wght@${a.join(";")}&display=swap');`:"").join("\n"),n=(l,a)=>{if(!l)return"";try{const o=e(l);if(!o||"number"!=typeof o.r||"number"!=typeof o.g||"number"!=typeof o.b)return console.warn(`Impossibile convertire il colore ${a}: ${l}`),"";const{r:n,g:r,b:c}=o,i=Array.from({length:9},(e,l)=>{const o=10*(l+1);return`--color-${a}-${o}: rgba(${n}, ${r}, ${c}, ${o/100});`}).join("\n");return`\n --color-${a}: rgb(${n}, ${r}, ${c}); /* Default (opacità 1) */\n ${i}\n `}catch(e){return console.warn(`Errore nella generazione delle varianti di opacità per ${a}: ${e}`),""}},r=(l,a)=>{if(!l)return"";try{const o=e(l);if(!o||"number"!=typeof o.r||"number"!=typeof o.g||"number"!=typeof o.b)return console.warn(`Impossibile convertire il colore ${a}: ${l}`),"";const{r:n,g:r,b:c}=o,i=e=>Math.max(0,Math.min(255,Math.round(e))),t=(e,l)=>`${i(n+(e-n)*l)},${i(r+(e-r)*l)},${i(c+(e-c)*l)}`,u=[.2,.4,.6,.8],b=[10,20,30,40],v=u.map((e,l)=>{const o=b[l];return`--color-${a}-light-${o}: rgb(${t(255,e)});`}).join("\n"),s=u.map((e,l)=>{const o=b[l];return`--color-${a}-dark-${o}: rgb(${t(0,e)});`}).join("\n");return`--color-${a}: rgb(${n}, ${r}, ${c});\n ${v}\n ${s}`}catch(e){return console.warn(`Errore nella generazione delle varianti di brightness per ${a}: ${e}`),""}},c=`${n(l.primaryColor,"primary")} ${r(l.primaryColor,"primary")}`,i=`${n(l.secondaryColor,"secondary")} ${r(l.secondaryColor,"secondary")}`,t=`${n(l.secondaryColor,"accent")} ${r(l.secondaryColor,"accent")}`,u=`${n(l.secondaryColor,"dark")} ${r(l.secondaryColor,"dark")}`,b=`${n(l.secondaryColor,"light")} ${r(l.secondaryColor,"light")}`;return`\n ${o}\n\n :root {\n --font-heading: ${l.headingFont?`'${l.headingFont}', sans-serif`:"system-layout, sans-serif"};\n --font-text: ${l.textFont?`'${l.textFont}', sans-serif`:"system-layout, sans-serif"};\n --color-white: #ffffff;\n --color-black: #000000;\n --color-foreground: ${l.foregroundColor||"#FFFFFF"};\n ${c}\n ${i}\n ${t}\n ${u}\n ${b}\n }\n `},exports.iconsList=[{label:"Academic Cap",value:"AcademicCapIcon"},{label:"Adjustments Horizontal",value:"AdjustmentsHorizontalIcon"},{label:"Adjustments Vertical",value:"AdjustmentsVerticalIcon"},{label:"Archive Box Arrow Down",value:"ArchiveBoxArrowDownIcon"},{label:"Archive Box X Mark",value:"ArchiveBoxXMarkIcon"},{label:"Archive Box",value:"ArchiveBoxIcon"},{label:"Arrow Down Circle",value:"ArrowDownCircleIcon"},{label:"Arrow Down",value:"ArrowDownIcon"},{label:"Arrow Left Circle",value:"ArrowLeftCircleIcon"},{label:"Arrow Left",value:"ArrowLeftIcon"},{label:"Arrow Right Circle",value:"ArrowRightCircleIcon"},{label:"Arrow Right",value:"ArrowRightIcon"},{label:"Arrow Up Circle",value:"ArrowUpCircleIcon"},{label:"Arrow Up",value:"ArrowUpIcon"},{label:"Bell Alert",value:"BellAlertIcon"},{label:"Bell",value:"BellIcon"},{label:"Bookmark Square",value:"BookmarkSquareIcon"},{label:"Bookmark",value:"BookmarkIcon"},{label:"Building Office",value:"BuildingOfficeIcon"},{label:"Calendar",value:"CalendarIcon"},{label:"Camera",value:"CameraIcon"},{label:"Chart Bar",value:"ChartBarIcon"},{label:"Chat Bubble Left Right",value:"ChatBubbleLeftRightIcon"},{label:"Chat Bubble Left",value:"ChatBubbleLeftIcon"},{label:"Check Circle",value:"CheckCircleIcon"},{label:"Check",value:"CheckIcon"},{label:"Chevron Down",value:"ChevronDownIcon"},{label:"Chevron Left",value:"ChevronLeftIcon"},{label:"Chevron Right",value:"ChevronRightIcon"},{label:"Chevron Up",value:"ChevronUpIcon"},{label:"Clock",value:"ClockIcon"},{label:"Cloud Arrow Up",value:"CloudArrowUpIcon"},{label:"Cloud",value:"CloudIcon"},{label:"Code Bracket",value:"CodeBracketIcon"},{label:"Cog",value:"CogIcon"},{label:"Command Line",value:"CommandLineIcon"},{label:"Computer Desktop",value:"ComputerDesktopIcon"},{label:"Credit Card",value:"CreditCardIcon"},{label:"Document",value:"DocumentIcon"},{label:"Envelope",value:"EnvelopeIcon"},{label:"Exclamation Circle",value:"ExclamationCircleIcon"},{label:"Exclamation Triangle",value:"ExclamationTriangleIcon"},{label:"Eye",value:"EyeIcon"},{label:"Face Smile",value:"FaceSmileIcon"},{label:"Film",value:"FilmIcon"},{label:"Finger Print",value:"FingerPrintIcon"},{label:"Fire",value:"FireIcon"},{label:"Flag",value:"FlagIcon"},{label:"Folder Open",value:"FolderOpenIcon"},{label:"Folder",value:"FolderIcon"},{label:"Gift",value:"GiftIcon"},{label:"Globe Alt",value:"GlobeAltIcon"},{label:"Globe Europe Africa",value:"GlobeEuropeAfricaIcon"},{label:"Hand Raised",value:"HandRaisedIcon"},{label:"Heart",value:"HeartIcon"},{label:"Home",value:"HomeIcon"},{label:"Identification",value:"IdentificationIcon"},{label:"Information Circle",value:"InformationCircleIcon"},{label:"Key",value:"KeyIcon"},{label:"Link",value:"LinkIcon"},{label:"List Bullet",value:"ListBulletIcon"},{label:"Lock Closed",value:"LockClosedIcon"},{label:"Lock Open",value:"LockOpenIcon"},{label:"Magnifying Glass Circle",value:"MagnifyingGlassCircleIcon"},{label:"Magnifying Glass",value:"MagnifyingGlassIcon"},{label:"Map Pin",value:"MapPinIcon"},{label:"Map",value:"MapIcon"},{label:"Moon",value:"MoonIcon"},{label:"Paper Airplane",value:"PaperAirplaneIcon"},{label:"Paper Clip",value:"PaperClipIcon"},{label:"Pause Circle",value:"PauseCircleIcon"},{label:"Pencil Square",value:"PencilSquareIcon"},{label:"Pencil",value:"PencilIcon"},{label:"Phone Arrow Up Right",value:"PhoneArrowUpRightIcon"},{label:"Phone X Mark",value:"PhoneXMarkIcon"},{label:"Phone",value:"PhoneIcon"},{label:"Photo",value:"PhotoIcon"},{label:"Play Circle",value:"PlayCircleIcon"},{label:"Play",value:"PlayIcon"},{label:"Plus Circle",value:"PlusCircleIcon"},{label:"Plus",value:"PlusIcon"},{label:"Power",value:"PowerIcon"},{label:"Question Mark Circle",value:"QuestionMarkCircleIcon"},{label:"Rocket Launch",value:"RocketLaunchIcon"},{label:"Rss",value:"RssIcon"},{label:"Scale",value:"ScaleIcon"},{label:"Server",value:"ServerIcon"},{label:"Share",value:"ShareIcon"},{label:"Shield Check",value:"ShieldCheckIcon"},{label:"Shield Exclamation",value:"ShieldExclamationIcon"},{label:"Shopping Bag",value:"ShoppingBagIcon"},{label:"Shopping Cart",value:"ShoppingCartIcon"},{label:"Star",value:"StarIcon"},{label:"Stop Circle",value:"StopCircleIcon"},{label:"Sun",value:"SunIcon"},{label:"Tag",value:"TagIcon"},{label:"Trash",value:"TrashIcon"},{label:"Trophy",value:"TrophyIcon"},{label:"User Circle",value:"UserCircleIcon"},{label:"User Group",value:"UserGroupIcon"},{label:"User",value:"UserIcon"},{label:"Users",value:"UsersIcon"},{label:"Video Camera",value:"VideoCameraIcon"},{label:"Wifi",value:"WifiIcon"},{label:"Window",value:"WindowIcon"},{label:"Wrench Screwdriver",value:"WrenchScrewdriverIcon"},{label:"Wrench",value:"WrenchIcon"},{label:"X Circle",value:"XCircleIcon"},{label:"X Mark",value:"XMarkIcon"}];
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|