@woodylab/payload 0.0.130 → 0.0.132

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/dist/LayoutRenderer-B1IoWb16.js +2 -0
  2. package/dist/LayoutRenderer-B1IoWb16.js.map +1 -0
  3. package/dist/LayoutRenderer-Ba6ITI7O.js +2 -0
  4. package/dist/LayoutRenderer-Ba6ITI7O.js.map +1 -0
  5. package/dist/config/blocks/blockCard.d.ts +2 -0
  6. package/dist/config/blocks/blockCard.js +101 -0
  7. package/dist/config/blocks/blockReference.d.ts +2 -0
  8. package/dist/config/blocks/blockReference.js +11 -0
  9. package/dist/config/{blockView.js → blocks/blockView.js} +35 -91
  10. package/dist/config/collections/collectionBlocks.d.ts +2 -0
  11. package/dist/config/collections/collectionBlocks.js +35 -0
  12. package/dist/config/{collectionComponentDefinitions.d.ts → collections/collectionComponentDefinitions.d.ts} +1 -1
  13. package/dist/config/collections/collectionComponentDefinitions.js +40 -0
  14. package/dist/config/collections/collectionMenus.d.ts +2 -0
  15. package/dist/config/{collectionMenus.js → collections/collectionMenus.js} +18 -16
  16. package/dist/config/collections/collectionStyles.d.ts +2 -0
  17. package/dist/config/collections/collectionStyles.js +25 -0
  18. package/dist/config/{collectionViewModes.d.ts → collections/collectionViewModes.d.ts} +1 -1
  19. package/dist/config/collections/collectionViewModes.js +106 -0
  20. package/dist/config/fields/fieldCss.js +537 -0
  21. package/dist/config/fields/fieldRoles.d.ts +2 -0
  22. package/dist/{fields/utils → config/fields}/fieldRoles.js +7 -11
  23. package/dist/config/fields/tailwindFieldSelectors.d.ts +2 -1
  24. package/dist/config/fields/tailwindFieldSelectors.js +1547 -1
  25. package/dist/config/fields/tailwindSelectorVariants.js +45 -45
  26. package/dist/config/{configFooter.js → globals/configFooter.js} +11 -9
  27. package/dist/config/{configHeader.js → globals/configHeader.js} +11 -10
  28. package/dist/config/{configSettings.js → globals/configSettings.js} +48 -26
  29. package/dist/{hooks → config/hooks}/fields/populateSiblingClassName.js +0 -2
  30. package/dist/{hooks → config/hooks}/fields/populateSiblingClassNameAfterChange.js +0 -1
  31. package/dist/config/hooks/fields/resolveComponentFromRef.d.ts +2 -0
  32. package/dist/config/hooks/fields/resolveComponentFromRef.js +30 -0
  33. package/dist/config/hooks/fields/resolveStyleFromRef.d.ts +2 -0
  34. package/dist/config/hooks/fields/resolveStyleFromRef.js +35 -0
  35. package/dist/config/hooks/fields/resolveViewModeFromRef.d.ts +2 -0
  36. package/dist/config/hooks/fields/resolveViewModeFromRef.js +23 -0
  37. package/dist/config/index.cjs.js +1 -1
  38. package/dist/config/index.cjs.js.map +1 -1
  39. package/dist/config/index.d.ts +15 -9
  40. package/dist/config/index.esm.js +1 -1
  41. package/dist/config/index.esm.js.map +1 -1
  42. package/dist/config/index.js +15 -9
  43. package/dist/index.cjs.js +1 -1
  44. package/dist/index.d.ts +1 -0
  45. package/dist/index.esm.js +1 -1
  46. package/dist/index.js +2 -0
  47. package/dist/react/ComponentRenderer.js +1 -1
  48. package/dist/react/LayoutRenderer.d.ts +5 -0
  49. package/dist/react/LayoutRenderer.js +19 -0
  50. package/dist/react/componentRegistry.js +7 -0
  51. package/dist/react/components/Card.d.ts +19 -0
  52. package/dist/react/components/Card.js +6 -0
  53. package/dist/react/components/Container.d.ts +5 -0
  54. package/dist/react/components/Container.js +4 -0
  55. package/dist/react/components/View.d.ts +1 -0
  56. package/dist/react/components/View.js +9 -0
  57. package/dist/react/index.cjs.js +1 -1
  58. package/dist/react/index.d.ts +5 -5
  59. package/dist/react/index.esm.js +1 -1
  60. package/dist/react/index.js +5 -5
  61. package/dist/resolveLayout-DlRnQBn8.js +2 -0
  62. package/dist/resolveLayout-DlRnQBn8.js.map +1 -0
  63. package/dist/resolveLayout-DryOXHEy.js +2 -0
  64. package/dist/resolveLayout-DryOXHEy.js.map +1 -0
  65. package/dist/seeders/UIMSSeeder.d.ts +7 -0
  66. package/dist/seeders/UIMSSeeder.js +14 -0
  67. package/dist/seeders/clearCollection.d.ts +2 -0
  68. package/dist/seeders/clearCollection.js +18 -0
  69. package/dist/seeders/components.d.ts +1 -0
  70. package/dist/seeders/components.js +3 -0
  71. package/dist/seeders/generateTailwindStyles.d.ts +6 -0
  72. package/dist/seeders/generateTailwindStyles.js +18 -0
  73. package/dist/seeders/index.cjs.js +2 -0
  74. package/dist/seeders/index.cjs.js.map +1 -0
  75. package/dist/seeders/index.d.ts +2 -0
  76. package/dist/seeders/index.esm.js +2 -0
  77. package/dist/seeders/index.esm.js.map +1 -0
  78. package/dist/seeders/index.js +2 -0
  79. package/dist/seeders/styles.d.ts +1 -0
  80. package/dist/seeders/styles.js +27 -0
  81. package/dist/seeders/viewModes.d.ts +1 -0
  82. package/dist/seeders/viewModes.js +3 -0
  83. package/dist/tailwind/index.cjs.js +2 -0
  84. package/dist/tailwind/index.cjs.js.map +1 -0
  85. package/dist/tailwind/index.d.ts +2 -94
  86. package/dist/tailwind/index.esm.js +2 -0
  87. package/dist/tailwind/index.esm.js.map +1 -0
  88. package/dist/tailwind/index.js +2 -2692
  89. package/dist/tailwind/tailwindFieldSelectors.d.ts +181 -0
  90. package/dist/tailwind/tailwindFieldSelectors.js +1184 -0
  91. package/dist/tailwind/tailwindSelectorVariants.d.ts +4 -0
  92. package/dist/tailwind/tailwindSelectorVariants.js +69 -0
  93. package/dist/uims/index.cjs.js +2 -0
  94. package/dist/uims/index.cjs.js.map +1 -0
  95. package/dist/uims/index.d.ts +6 -0
  96. package/dist/uims/index.esm.js +2 -0
  97. package/dist/uims/index.esm.js.map +1 -0
  98. package/dist/uims/index.js +9 -0
  99. package/dist/uims/mapper/applyStylesToProps.d.ts +4 -0
  100. package/dist/uims/mapper/applyStylesToProps.js +18 -0
  101. package/dist/uims/mapper/getValueByPath.d.ts +1 -0
  102. package/dist/uims/mapper/getValueByPath.js +3 -0
  103. package/dist/uims/mapper/mapDataToProps.d.ts +6 -0
  104. package/dist/uims/mapper/mapDataToProps.js +26 -0
  105. package/dist/uims/mapper/mapInlineBlockToProps.d.ts +6 -0
  106. package/dist/uims/mapper/mapInlineBlockToProps.js +16 -0
  107. package/dist/uims/registry/componentRegistry.d.ts +4 -0
  108. package/dist/uims/registry/componentRegistry.js +20 -0
  109. package/dist/uims/registry/styleRegistry.d.ts +4 -0
  110. package/dist/uims/registry/styleRegistry.js +20 -0
  111. package/dist/uims/registry/viewModeRegistry.d.ts +4 -0
  112. package/dist/uims/registry/viewModeRegistry.js +20 -0
  113. package/dist/uims/resolver/createUIMSContext.d.ts +3 -0
  114. package/dist/uims/resolver/createUIMSContext.js +13 -0
  115. package/dist/uims/resolver/resolveInlineBlock.d.ts +8 -0
  116. package/dist/uims/resolver/resolveInlineBlock.js +22 -0
  117. package/dist/uims/resolver/resolveInlineStylesBySlot.d.ts +1 -0
  118. package/dist/uims/resolver/resolveInlineStylesBySlot.js +15 -0
  119. package/dist/uims/resolver/resolveLayout.d.ts +5 -0
  120. package/dist/uims/resolver/resolveLayout.js +24 -0
  121. package/dist/uims/resolver/resolveStylesBySlot.d.ts +11 -0
  122. package/dist/uims/resolver/resolveStylesBySlot.js +12 -0
  123. package/dist/uims/resolver/resolveViewBlock.d.ts +12 -0
  124. package/dist/uims/resolver/resolveViewBlock.js +26 -0
  125. package/dist/{utils → uims/resolver}/resolveViewData.d.ts +3 -1
  126. package/dist/uims/resolver/resolveViewData.js +56 -0
  127. package/dist/uims/types/UIMSContext.d.ts +18 -0
  128. package/dist/uims/types/UIMSContext.js +1 -0
  129. package/dist/utils/getPropsKeys.d.ts +1 -0
  130. package/dist/utils/getPropsKeys.js +3 -0
  131. package/dist/utils/index.cjs.js +1 -1
  132. package/dist/utils/index.cjs.js.map +1 -1
  133. package/dist/utils/index.d.ts +0 -1
  134. package/dist/utils/index.esm.js +1 -1
  135. package/dist/utils/index.esm.js.map +1 -1
  136. package/dist/utils/index.js +0 -1
  137. package/dist/utils/normalizeStyles.d.ts +1 -0
  138. package/dist/utils/normalizeStyles.js +12 -0
  139. package/dist/utils/pickProps.d.ts +1 -0
  140. package/dist/utils/pickProps.js +9 -0
  141. package/package.json +12 -4
  142. package/dist/PageRenderer-BiZflIhY.js +0 -2
  143. package/dist/PageRenderer-BiZflIhY.js.map +0 -1
  144. package/dist/PageRenderer-DX3iEA8n.js +0 -2
  145. package/dist/PageRenderer-DX3iEA8n.js.map +0 -1
  146. package/dist/config/blockComponentInstance.d.ts +0 -2
  147. package/dist/config/blockComponentInstance.js +0 -84
  148. package/dist/config/blocks/blockCarousel.d.ts +0 -3
  149. package/dist/config/blocks/blockCarousel.js +0 -102
  150. package/dist/config/blocks/blockDisclosureList.d.ts +0 -3
  151. package/dist/config/blocks/blockDisclosureList.js +0 -58
  152. package/dist/config/blocks/blockGrid.d.ts +0 -6
  153. package/dist/config/blocks/blockGrid.js +0 -161
  154. package/dist/config/blocks/blockGridContent.d.ts +0 -6
  155. package/dist/config/blocks/blockGridContent.js +0 -195
  156. package/dist/config/blocks/blockHtmlElement.d.ts +0 -6
  157. package/dist/config/blocks/blockHtmlElement.js +0 -13
  158. package/dist/config/blocks/blockImage.d.ts +0 -3
  159. package/dist/config/blocks/blockImage.js +0 -15
  160. package/dist/config/blocks/blockParallax.d.ts +0 -3
  161. package/dist/config/blocks/blockParallax.js +0 -76
  162. package/dist/config/blocks/blockTabs.d.ts +0 -3
  163. package/dist/config/blocks/blockTabs.js +0 -24
  164. package/dist/config/collectionComponentDefinitions.js +0 -33
  165. package/dist/config/collectionMenus.d.ts +0 -6
  166. package/dist/config/collectionViewModes.js +0 -20
  167. package/dist/config/fieldCss.js +0 -543
  168. package/dist/config/utils/resolveInlineComponent.d.ts +0 -4
  169. package/dist/config/utils/resolveInlineComponent.js +0 -35
  170. package/dist/config/utils/resolveViewRow.d.ts +0 -4
  171. package/dist/config/utils/resolveViewRow.js +0 -15
  172. package/dist/fields/fieldArray.d.ts +0 -4
  173. package/dist/fields/fieldArray.js +0 -9
  174. package/dist/fields/fieldBlocks.d.ts +0 -4
  175. package/dist/fields/fieldBlocks.js +0 -9
  176. package/dist/fields/fieldCheckbox.d.ts +0 -4
  177. package/dist/fields/fieldCheckbox.js +0 -11
  178. package/dist/fields/fieldCode.d.ts +0 -4
  179. package/dist/fields/fieldCode.js +0 -8
  180. package/dist/fields/fieldDate.d.ts +0 -4
  181. package/dist/fields/fieldDate.js +0 -15
  182. package/dist/fields/fieldEmail.d.ts +0 -4
  183. package/dist/fields/fieldEmail.js +0 -8
  184. package/dist/fields/fieldJoin.d.ts +0 -4
  185. package/dist/fields/fieldJoin.js +0 -9
  186. package/dist/fields/fieldNumber.d.ts +0 -4
  187. package/dist/fields/fieldNumber.js +0 -8
  188. package/dist/fields/fieldPoint.d.ts +0 -4
  189. package/dist/fields/fieldPoint.js +0 -8
  190. package/dist/fields/fieldRadioGroup.d.ts +0 -4
  191. package/dist/fields/fieldRadioGroup.js +0 -18
  192. package/dist/fields/fieldRelationship.d.ts +0 -4
  193. package/dist/fields/fieldRelationship.js +0 -9
  194. package/dist/fields/fieldRichText.d.ts +0 -4
  195. package/dist/fields/fieldRichText.js +0 -12
  196. package/dist/fields/fieldSelect.d.ts +0 -4
  197. package/dist/fields/fieldSelect.js +0 -9
  198. package/dist/fields/fieldText.d.ts +0 -4
  199. package/dist/fields/fieldText.js +0 -8
  200. package/dist/fields/fieldTextArea.d.ts +0 -4
  201. package/dist/fields/fieldTextArea.js +0 -8
  202. package/dist/fields/fieldUpload.d.ts +0 -4
  203. package/dist/fields/fieldUpload.js +0 -9
  204. package/dist/fields/index.cjs.js +0 -2
  205. package/dist/fields/index.cjs.js.map +0 -1
  206. package/dist/fields/index.d.ts +0 -31
  207. package/dist/fields/index.esm.js +0 -2
  208. package/dist/fields/index.esm.js.map +0 -1
  209. package/dist/fields/index.js +0 -37
  210. package/dist/fields/layout/fieldContainerProps.d.ts +0 -3
  211. package/dist/fields/layout/fieldContainerProps.js +0 -74
  212. package/dist/fields/section/fieldAction.d.ts +0 -6
  213. package/dist/fields/section/fieldAction.js +0 -236
  214. package/dist/fields/section/fieldConfigProps.d.ts +0 -3
  215. package/dist/fields/section/fieldConfigProps.js +0 -11
  216. package/dist/fields/section/fieldContentProps.d.ts +0 -3
  217. package/dist/fields/section/fieldContentProps.js +0 -11
  218. package/dist/fields/section/fieldSectionProps.d.ts +0 -3
  219. package/dist/fields/section/fieldSectionProps.js +0 -15
  220. package/dist/fields/section/fieldSectionTabs.d.ts +0 -13
  221. package/dist/fields/section/fieldSectionTabs.js +0 -40
  222. package/dist/fields/style/fieldColor.d.ts +0 -4
  223. package/dist/fields/style/fieldColor.js +0 -21
  224. package/dist/fields/style/fieldContainerWidths.d.ts +0 -7
  225. package/dist/fields/style/fieldContainerWidths.js +0 -17
  226. package/dist/fields/style/fieldCss.d.ts +0 -3
  227. package/dist/fields/style/fieldCss.js +0 -65
  228. package/dist/fields/style/fieldFontSizes.d.ts +0 -3
  229. package/dist/fields/style/fieldFontSizes.js +0 -14
  230. package/dist/fields/style/fieldHeights.d.ts +0 -7
  231. package/dist/fields/style/fieldHeights.js +0 -23
  232. package/dist/fields/style/fieldMargins.d.ts +0 -7
  233. package/dist/fields/style/fieldMargins.js +0 -138
  234. package/dist/fields/style/fieldPaddings.d.ts +0 -7
  235. package/dist/fields/style/fieldPaddings.js +0 -114
  236. package/dist/fields/style/fieldViewportHeights.d.ts +0 -7
  237. package/dist/fields/style/fieldViewportHeights.js +0 -22
  238. package/dist/fields/utils/fieldRoles.d.ts +0 -4
  239. package/dist/react/Card.d.ts +0 -6
  240. package/dist/react/Card.js +0 -4
  241. package/dist/react/PageRenderer.d.ts +0 -4
  242. package/dist/react/PageRenderer.js +0 -34
  243. package/dist/react/ViewBlock.d.ts +0 -1
  244. package/dist/react/ViewBlock.js +0 -62
  245. package/dist/react/registry.js +0 -5
  246. package/dist/userRoles-BqQg1D6Q.js +0 -2
  247. package/dist/userRoles-BqQg1D6Q.js.map +0 -1
  248. package/dist/userRoles-CL8SQUFs.js +0 -2
  249. package/dist/userRoles-CL8SQUFs.js.map +0 -1
  250. package/dist/utils/resolveViewData.js +0 -26
  251. /package/dist/{acl → config/acl}/hasRoles.d.ts +0 -0
  252. /package/dist/{acl → config/acl}/hasRoles.js +0 -0
  253. /package/dist/{acl → config/acl}/index.d.ts +0 -0
  254. /package/dist/{acl → config/acl}/index.js +0 -0
  255. /package/dist/config/{blockView.d.ts → blocks/blockView.d.ts} +0 -0
  256. /package/dist/{enums → config/enums}/index.d.ts +0 -0
  257. /package/dist/{enums → config/enums}/index.js +0 -0
  258. /package/dist/{enums → config/enums}/userRoles.d.ts +0 -0
  259. /package/dist/{enums → config/enums}/userRoles.js +0 -0
  260. /package/dist/config/{fieldCss.d.ts → fields/fieldCss.d.ts} +0 -0
  261. /package/dist/config/{configFooter.d.ts → globals/configFooter.d.ts} +0 -0
  262. /package/dist/config/{configHeader.d.ts → globals/configHeader.d.ts} +0 -0
  263. /package/dist/config/{configSettings.d.ts → globals/configSettings.d.ts} +0 -0
  264. /package/dist/{hooks → config/hooks}/fields/getNumberValueFromClassNameString.d.ts +0 -0
  265. /package/dist/{hooks → config/hooks}/fields/getNumberValueFromClassNameString.js +0 -0
  266. /package/dist/{hooks → config/hooks}/fields/populateSiblingClassName.d.ts +0 -0
  267. /package/dist/{hooks → config/hooks}/fields/populateSiblingClassNameAfterChange.d.ts +0 -0
  268. /package/dist/{hooks → config/hooks}/fields/updateClassNameAfterRead.d.ts +0 -0
  269. /package/dist/{hooks → config/hooks}/fields/updateClassNameAfterRead.js +0 -0
  270. /package/dist/{hooks → config/hooks}/index.d.ts +0 -0
  271. /package/dist/{hooks → config/hooks}/index.js +0 -0
  272. /package/dist/react/{registry.d.ts → componentRegistry.d.ts} +0 -0
@@ -1,16 +1,22 @@
1
1
  // GLOBALS
2
- export * from './configSettings';
3
- export * from './configHeader';
4
- export * from './configFooter';
2
+ export * from './globals/configSettings';
3
+ export * from './globals/configHeader';
4
+ export * from './globals/configFooter';
5
5
  // COLLECTION
6
- export * from './collectionMenus';
7
- export * from './collectionComponentDefinitions';
8
- export * from './collectionViewModes';
6
+ export * from './collections/collectionComponentDefinitions';
7
+ export * from './collections/collectionViewModes';
8
+ export * from './collections/collectionStyles';
9
+ export * from './collections/collectionBlocks';
10
+ export * from './collections/collectionMenus';
9
11
  // BLOCKS
10
- export * from './blockView';
11
- export * from './blockComponentInstance';
12
+ export * from './blocks/blockReference';
13
+ export * from './blocks/blockView';
14
+ export * from './blocks/blockCard';
12
15
  // FIELDS
13
- export * from './fieldCss';
16
+ export * from './fields/fieldRoles';
17
+ export * from './fields/fieldCss';
18
+ export * from './fields/tailwindFieldSelectors';
19
+ export * from './fields/tailwindSelectorVariants';
14
20
  // TAILWIND
15
21
  export * from './fields/tailwindField';
16
22
  export * from './fields/tailwindFieldSelectors';
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("./config/index.cjs.js"),o=require("./utils/index.cjs.js"),s=require("./PageRenderer-BiZflIhY.js");require("./userRoles-BqQg1D6Q.js"),require("react/jsx-runtime"),exports.ComponentInstance=e.ComponentInstance,exports.blockView=e.blockView,exports.collectionComponentDefinitions=e.collectionComponentDefinitions,exports.collectionMenus=e.collectionMenus,exports.collectionViewModes=e.collectionViewModes,exports.concatCssFields=e.concatCssFields,exports.configFooter=e.configFooter,exports.configHeader=e.configHeader,exports.configSettings=e.configSettings,exports.fieldCss=e.fieldCss,exports.tailwindField=e.tailwindField,exports.tailwindFieldsSelectors=e.tailwindFieldsSelectors,exports.generateCssVars=o.generateCssVars,exports.iconsList=o.iconsList,exports.resolveViewData=o.resolveViewData,exports.Card=s.Card,exports.ComponentRenderer=s.ComponentRenderer,exports.PageRenderer=s.PageRenderer,exports.ViewBlock=s.ViewBlock,exports.componentRegistry=s.componentRegistry;
1
+ "use strict";var e=require("./resolveLayout-DlRnQBn8.js"),o=require("./config/index.cjs.js"),t=require("./utils/index.cjs.js"),s=require("./LayoutRenderer-B1IoWb16.js");require("react/jsx-runtime"),exports.Card=e.Card,exports.Container=e.Container,exports.applyStylesToProps=e.applyStylesToProps,exports.componentRegistry=e.componentRegistry,exports.getValueByPath=e.getValueByPath,exports.mapDataToProps=e.mapDataToProps,exports.resolveLayout=e.resolveLayout,exports.resolveViewData=e.resolveViewData,exports.blockCard=o.blockCard,exports.blockReference=o.blockReference,exports.blockView=o.blockView,exports.collectionBlocks=o.collectionBlocks,exports.collectionComponentDefinitions=o.collectionComponentDefinitions,exports.collectionMenus=o.collectionMenus,exports.collectionStyles=o.collectionStyles,exports.collectionViewModes=o.collectionViewModes,exports.concatCssFields=o.concatCssFields,exports.configFooter=o.configFooter,exports.configHeader=o.configHeader,exports.configSettings=o.configSettings,exports.fieldCss=o.fieldCss,exports.fieldRoles=o.fieldRoles,exports.tailwindField=o.tailwindField,exports.tailwindFieldsSelectors=o.tailwindFieldsSelectors,exports.tailwindSelectorVariants=o.tailwindSelectorVariants,exports.generateCssVars=t.generateCssVars,exports.iconsList=t.iconsList,exports.LayoutRenderer=s.LayoutRenderer,exports.View=s.View;
2
2
  //# sourceMappingURL=index.cjs.js.map
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './uims';
1
2
  export * from './config';
2
3
  export * from './utils';
3
4
  export * from './react';
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- export{ComponentInstance,blockView,collectionComponentDefinitions,collectionMenus,collectionViewModes,concatCssFields,configFooter,configHeader,configSettings,fieldCss,tailwindField,tailwindFieldsSelectors}from"./config/index.esm.js";export{generateCssVars,iconsList,resolveViewData}from"./utils/index.esm.js";export{C as Card,a as ComponentRenderer,P as PageRenderer,V as ViewBlock,c as componentRegistry}from"./PageRenderer-DX3iEA8n.js";import"./userRoles-CL8SQUFs.js";import"react/jsx-runtime";
1
+ export{C as Card,c as Container,b as applyStylesToProps,d as componentRegistry,g as getValueByPath,m as mapDataToProps,a as resolveLayout,r as resolveViewData}from"./resolveLayout-DryOXHEy.js";export{blockCard,blockReference,blockView,collectionBlocks,collectionComponentDefinitions,collectionMenus,collectionStyles,collectionViewModes,concatCssFields,configFooter,configHeader,configSettings,fieldCss,fieldRoles,tailwindField,tailwindFieldsSelectors,tailwindSelectorVariants}from"./config/index.esm.js";export{generateCssVars,iconsList}from"./utils/index.esm.js";export{L as LayoutRenderer,V as View}from"./LayoutRenderer-Ba6ITI7O.js";import"react/jsx-runtime";
2
2
  //# sourceMappingURL=index.esm.js.map
package/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ // REACT
2
+ export * from './uims';
1
3
  // CONFIG
2
4
  export * from './config';
3
5
  // UTILS
@@ -1,7 +1,7 @@
1
1
  // components/ComponentRenderer.tsx
2
2
  'use client';
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
- import { componentRegistry } from './registry';
4
+ import { componentRegistry } from './componentRegistry';
5
5
  function getValueByPath(obj, path) {
6
6
  return path.split('.').reduce((acc, key) => acc?.[key], obj);
7
7
  }
@@ -0,0 +1,5 @@
1
+ import { BasePayload } from 'payload';
2
+ export declare function LayoutRenderer({ layout, payload }: {
3
+ layout: any[];
4
+ payload: BasePayload;
5
+ }): Promise<import("react/jsx-runtime").JSX.Element>;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { View } from './components/View';
3
+ import { resolveLayout } from '../uims';
4
+ import { createUIMSContext } from '../uims/resolver/createUIMSContext';
5
+ //#TODO Ricordarsi di introdurre il concetto di PageRenderer, sarebbe carino se riuscissimo a delegarle la stampa anche dei meta dati e info accessorie oltre al layout.
6
+ export async function LayoutRenderer({ layout, payload }) {
7
+ const uims = await createUIMSContext(payload);
8
+ const resolvedLayout = await resolveLayout({ layout, context: uims });
9
+ return (_jsx(_Fragment, { children: resolvedLayout.map((block, i) => {
10
+ if (!block)
11
+ return null;
12
+ if (block.rows) {
13
+ return _jsx(View, { ...block }, i);
14
+ }
15
+ const { Component, props } = block;
16
+ return _jsx(Component, { ...props }, i);
17
+ return null;
18
+ }) }));
19
+ }
@@ -0,0 +1,7 @@
1
+ // components/registry.ts
2
+ import { Container } from '.';
3
+ import { Card } from './components/Card';
4
+ export const componentRegistry = {
5
+ Card,
6
+ Container,
7
+ };
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from 'react';
2
+ type CardTextProps = {
3
+ text?: string;
4
+ className?: string;
5
+ };
6
+ type CardImageProps = {
7
+ src?: string;
8
+ alt?: string;
9
+ className?: string;
10
+ };
11
+ export type CardProps = {
12
+ className?: string;
13
+ imageProps?: CardImageProps;
14
+ titleProps?: CardTextProps;
15
+ descriptionProps?: CardTextProps;
16
+ children?: ReactNode;
17
+ };
18
+ export declare const Card: ({ className, imageProps, titleProps, descriptionProps, children, }: CardProps) => import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export const Card = ({ className, imageProps, titleProps, descriptionProps, children, }) => {
3
+ // # TODO sarebbe da aggiungere un componente specifico per la stampa dei valori non stilati. Ossia se non viene selezionato alcun componente in fase di editing e per esempio le proprietà di una card arrivano a un DIV
4
+ // Questo non è in grado di stampare i valori simil JSON, discorso diverso invece si presenta se a ricevere tutte le proprietà è invece un componente dedicato (comodo anche per debug)
5
+ return (_jsxs("div", { className: className, children: [imageProps?.src && (_jsx("img", { src: imageProps.src, alt: imageProps.alt ?? '', className: imageProps.className })), titleProps?.text && _jsx("h3", { className: titleProps.className, children: titleProps.text }), descriptionProps?.text && (_jsx("p", { className: descriptionProps.className, children: descriptionProps.text })), children] }));
6
+ };
@@ -0,0 +1,5 @@
1
+ export type ContainerProps = {
2
+ className?: string;
3
+ children?: [];
4
+ };
5
+ export declare const Container: ({ className, children }: ContainerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export const Container = ({ className, children }) => {
3
+ return _jsx("div", { className: className, children: children });
4
+ };
@@ -0,0 +1 @@
1
+ export declare function View({ className, rows, viewMode, rowViewMode }: any): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { componentRegistry } from '../componentRegistry';
3
+ export function View({ className = '', rows = [], viewMode, rowViewMode }) {
4
+ const ContainerComponent = componentRegistry[viewMode?.component] ?? 'div';
5
+ const RowComponent = componentRegistry[rowViewMode?.component] ?? 'div';
6
+ return (_jsx(ContainerComponent, { className: className, children: rows.map((rowProps, i) => {
7
+ return _jsx(RowComponent, { ...rowProps }, i);
8
+ }) }));
9
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../PageRenderer-BiZflIhY.js");require("react/jsx-runtime"),exports.Card=e.Card,exports.ComponentRenderer=e.ComponentRenderer,exports.PageRenderer=e.PageRenderer,exports.ViewBlock=e.ViewBlock,exports.componentRegistry=e.componentRegistry;
1
+ "use strict";var e=require("../resolveLayout-DlRnQBn8.js"),r=require("../LayoutRenderer-B1IoWb16.js");require("react/jsx-runtime"),exports.Card=e.Card,exports.Container=e.Container,exports.componentRegistry=e.componentRegistry,exports.LayoutRenderer=r.LayoutRenderer,exports.View=r.View;
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1,5 +1,5 @@
1
- export { Card } from './Card';
2
- export { ViewBlock } from './ViewBlock';
3
- export { ComponentRenderer } from './ComponentRenderer';
4
- export { PageRenderer } from './PageRenderer';
5
- export * from './registry';
1
+ export { Card } from './components/Card';
2
+ export { Container } from './components/Container';
3
+ export { View } from './components/View';
4
+ export { LayoutRenderer } from './LayoutRenderer';
5
+ export * from './componentRegistry';
@@ -1,2 +1,2 @@
1
- export{C as Card,a as ComponentRenderer,P as PageRenderer,V as ViewBlock,c as componentRegistry}from"../PageRenderer-DX3iEA8n.js";import"react/jsx-runtime";
1
+ export{C as Card,c as Container,d as componentRegistry}from"../resolveLayout-DryOXHEy.js";export{L as LayoutRenderer,V as View}from"../LayoutRenderer-Ba6ITI7O.js";import"react/jsx-runtime";
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -1,5 +1,5 @@
1
- export { Card } from './Card';
2
- export { ViewBlock } from './ViewBlock';
3
- export { ComponentRenderer } from './ComponentRenderer';
4
- export { PageRenderer } from './PageRenderer';
5
- export * from './registry';
1
+ export { Card } from './components/Card';
2
+ export { Container } from './components/Container';
3
+ export { View } from './components/View';
4
+ export { LayoutRenderer } from './LayoutRenderer';
5
+ export * from './componentRegistry';
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime");async function t(e,t){const a={};for(let r=0;r<t.length;r++){const n=t[r];if(!o(n))continue;const c=await s({payload:e,block:n});a[r]=Array.isArray(c)?c:[]}return a}function o(e){return"view"===e.blockType}async function s({payload:e,block:t}){return t.useInternalSource?async function({payload:e,block:t}){const o=await e.find({collection:t.internalCollection,sort:t.internalSort||void 0,depth:t.internalDepth??1});return o?.docs??[]}({payload:e,block:t}):t.dataSource?async function({payload:e,block:t}){try{const e=await fetch(t.dataSource),o=await e.json();return Array.isArray(o?.[t.dataSet])?o[t.dataSet]:[]}catch{return[]}}({payload:e,block:t}):[]}const a=({className:t,imageProps:o,titleProps:s,descriptionProps:a,children:r})=>e.jsxs("div",{className:t,children:[o?.src&&e.jsx("img",{src:o.src,alt:o.alt??"",className:o.className}),s?.text&&e.jsx("h3",{className:s.className,children:s.text}),a?.text&&e.jsx("p",{className:a.className,children:a.text}),r]}),r=({className:t,children:o})=>e.jsx("div",{className:t,children:o}),n={Card:a,Container:r};function c(e){const t={};if(!e?.styles)return t;for(const o of e.styles){const e=o.style;e&&(t[o.slot]=e)}return t}function i(e,t){if(!t)return e;const o={...e};for(const[e,s]of Object.entries(t))"root"!==e?o[e]&&"object"==typeof o[e]&&(o[e]={...o[e],className:[o[e].className,s].filter(Boolean).join(" ")}):o.className=[o.className,s].filter(Boolean).join(" ");return o}function l(e,t){return t.split(".").reduce((e,t)=>e?e[t]:void 0,e)}function p({data:e,mapper:t}){const o={};if(!t)return o;for(const s of Object.keys(t)){const a=t[s];"string"==typeof a&&a.startsWith("__static:")?o[s]=a.replace("__static:",""):o[s]="string"!=typeof a?"object"!=typeof a||null===a?void 0:p({data:e,mapper:a}):l(e,a)}return o}function u({block:e,context:t}){const o=t.registries.viewMode.byName[e.viewMode];if(console.log("viewMode",o),!o)return null;const s=n[o.component],a=c(o);return{Component:s,props:{...i(p({data:e,mapper:o.blockPropsMapping}),a)}}}function y({block:e,rows:t,context:o}){const s=o.registries.viewMode.byName[e.viewMode],a=o.registries.viewMode.byName[e.rowViewMode],r=c(a),n=s?.styles.map(e=>e.style.map((e,t)=>(o.registries.styles.byName[e.value.name],e.value.css.className)).join(" "));return{className:n,viewMode:s,props:e,rowViewMode:a,rows:t.map(t=>i(p({data:t,mapper:e.rowPropsMapping}),r))}}exports.Card=a,exports.Container=r,exports.applyStylesToProps=i,exports.componentRegistry=n,exports.getValueByPath=l,exports.mapDataToProps=p,exports.resolveLayout=async function e({layout:o,context:s}){const a=[],r=await t(s.payload,o);for(const[t,n]of o.entries())if("view"===n.blockType)a.push(y({block:n,rows:r[t]??[],context:s}));else if("reference"===n.blockType){const t=await e({layout:n.block.value.layout,context:s});a.push(...t)}else a.push(u({block:n,context:s}));return a},exports.resolveViewData=t;
2
+ //# sourceMappingURL=resolveLayout-DlRnQBn8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveLayout-DlRnQBn8.js","sources":["../src/uims/resolver/resolveViewData.ts","../src/react/components/Card.tsx","../src/react/components/Container.tsx","../src/react/componentRegistry.ts","../src/uims/resolver/resolveStylesBySlot.ts","../src/uims/mapper/applyStylesToProps.ts","../src/uims/mapper/getValueByPath.ts","../src/uims/mapper/mapDataToProps.ts","../src/uims/resolver/resolveInlineBlock.ts","../src/uims/resolver/resolveViewBlock.ts","../src/uims/resolver/resolveLayout.ts"],"sourcesContent":["import { BasePayload } from 'payload'\n\ntype ResolveViewDataParams = {\n payload: BasePayload\n layout: any[]\n}\n\ntype ViewDataResult = Record<number, any[]>\n\nexport async function resolveViewData(\n payload: BasePayload,\n layout: any[],\n): Promise<ViewDataResult> {\n const results: ViewDataResult = {}\n\n for (let index = 0; index < layout.length; index++) {\n const block = layout[index]\n\n if (!isViewBlock(block)) {\n continue\n }\n\n const data = await fetchViewBlockData({\n payload,\n block,\n })\n\n results[index] = Array.isArray(data) ? data : []\n }\n\n return results\n}\n\n// ──────────────────────────────────────────────\n// Helpers locali\n// ──────────────────────────────────────────────\n\nfunction isViewBlock(block: any): boolean {\n return block.blockType === 'view'\n}\n\nasync function fetchViewBlockData({\n payload,\n block,\n}: {\n payload: BasePayload\n block: any\n}): Promise<any[]> {\n // Sorgente interna (Payload)\n if (block.useInternalSource) {\n return fetchInternalCollection({\n payload,\n block,\n })\n }\n\n // Sorgente esterna (REST)\n if (block.dataSource) {\n return fetchExternalSource({\n payload,\n block,\n })\n }\n\n return []\n}\n\nasync function fetchInternalCollection({\n payload,\n block,\n}: {\n payload: BasePayload\n block: any\n}): Promise<any[]> {\n const result = await payload.find({\n collection: block.internalCollection,\n sort: block.internalSort || undefined,\n depth: block.internalDepth ?? 1,\n })\n\n return result?.docs ?? []\n}\n\nasync function fetchExternalSource({\n payload,\n block,\n}: {\n payload: BasePayload\n block: any\n}): Promise<any[]> {\n try {\n const res = await fetch(block.dataSource)\n const json = await res.json()\n\n return Array.isArray(json?.[block.dataSet]) ? json[block.dataSet] : []\n } catch {\n return []\n }\n}\n","import type { ReactNode } from 'react'\n\ntype CardTextProps = {\n text?: string\n className?: string\n}\n\ntype CardImageProps = {\n src?: string\n alt?: string\n className?: string\n}\n\nexport type CardProps = {\n className?: string\n imageProps?: CardImageProps\n titleProps?: CardTextProps\n descriptionProps?: CardTextProps\n children?: ReactNode\n}\n\nexport const Card = ({\n className,\n imageProps,\n titleProps,\n descriptionProps,\n children,\n}: CardProps) => {\n // # TODO sarebbe da aggiungere un componente specifico per la stampa dei valori non stilati. Ossia se non viene selezionato alcun componente in fase di editing e per esempio le proprietà di una card arrivano a un DIV\n // Questo non è in grado di stampare i valori simil JSON, discorso diverso invece si presenta se a ricevere tutte le proprietà è invece un componente dedicato (comodo anche per debug)\n return (\n <div className={className}>\n {imageProps?.src && (\n <img src={imageProps.src} alt={imageProps.alt ?? ''} className={imageProps.className} />\n )}\n\n {titleProps?.text && <h3 className={titleProps.className}>{titleProps.text}</h3>}\n\n {descriptionProps?.text && (\n <p className={descriptionProps.className}>{descriptionProps.text}</p>\n )}\n\n {children}\n </div>\n )\n}\n","export type ContainerProps = {\n className?: string\n children?: []\n}\n\nexport const Container = ({ className, children }: ContainerProps) => {\n return <div className={className}>{children}</div>\n}\n","// components/registry.ts\nimport { Container } from '.'\nimport { Card } from './components/Card'\n\nexport const componentRegistry: Record<string, any> = {\n Card,\n Container,\n}\n","type ViewMode = {\n css?: {\n className?: string\n }\n styles?: Array<{\n slot: string\n style: string\n }>\n}\n\nexport function resolveStylesBySlot(viewMode: ViewMode): Record<string, string> {\n const result: Record<string, string> = {}\n\n if (!viewMode?.styles) return result\n\n for (const entry of viewMode.styles) {\n const classNames = entry.style\n\n if (classNames) {\n result[entry.slot] = classNames\n }\n }\n\n return result\n}\n","type StylesBySlot = Record<string, string>\ntype AnyProps = Record<string, any>\n\nexport function applyStylesToProps<T extends AnyProps>(props: T, stylesBySlot?: StylesBySlot): T {\n if (!stylesBySlot) return props\n const nextProps = { ...props } as AnyProps\n\n for (const [slot, className] of Object.entries(stylesBySlot)) {\n if (slot === 'root') {\n nextProps['className'] = [nextProps['className'], className].filter(Boolean).join(' ')\n continue\n }\n if (nextProps[slot] && typeof nextProps[slot] === 'object') {\n nextProps[slot] = {\n ...nextProps[slot],\n className: [nextProps[slot].className, className].filter(Boolean).join(' '),\n }\n }\n }\n\n return nextProps as T\n}\n","export function getValueByPath(obj: any, path: string): any {\n return path.split('.').reduce((acc, key) => (acc ? acc[key] : undefined), obj)\n}\n","import { getValueByPath } from './getValueByPath'\n\ntype Mapper = Record<string, any>\n\nexport function mapDataToProps<T = any>({ data, mapper }: { data: any; mapper: Mapper }): T {\n const result: any = {}\n if (!mapper) return result\n for (const key of Object.keys(mapper)) {\n const rule = mapper[key]\n if (typeof rule === 'string' && rule.startsWith('__static:')) {\n result[key] = rule.replace('__static:', '')\n continue\n }\n\n if (typeof rule === 'string') {\n result[key] = getValueByPath(data, rule)\n continue\n }\n\n if (typeof rule === 'object' && rule !== null) {\n result[key] = mapDataToProps({\n data,\n mapper: rule,\n })\n continue\n }\n\n result[key] = undefined\n }\n\n return result\n}\n","import { componentRegistry } from '../../react/componentRegistry'\nimport { UIMSContext } from '../types/UIMSContext'\nimport { resolveStylesBySlot } from './resolveStylesBySlot'\nimport { applyStylesToProps } from '../mapper/applyStylesToProps'\nimport { mapDataToProps } from '../mapper/mapDataToProps'\n\nexport function resolveInlineBlock({ block, context }: { block: any; context: UIMSContext }) {\n //const viewMode = context.registries.viewMode.byId[block.viewMode.value]\n const viewMode = context.registries.viewMode.byName[block.viewMode]\n console.log('viewMode', viewMode)\n if (!viewMode) return null\n\n const Component = componentRegistry[viewMode.component]\n const stylesBySlot = resolveStylesBySlot(viewMode)\n return {\n Component,\n props: {\n ...applyStylesToProps(\n mapDataToProps({\n data: block,\n mapper: viewMode.blockPropsMapping,\n }),\n stylesBySlot,\n ),\n },\n }\n}\n","import { mapDataToProps } from '../mapper/mapDataToProps'\nimport { UIMSContext } from '../types/UIMSContext'\nimport { resolveStylesBySlot } from './resolveStylesBySlot'\nimport { applyStylesToProps } from '../mapper/applyStylesToProps'\n\nexport function resolveViewBlock({\n block,\n rows,\n context,\n}: {\n block: any\n rows: any[]\n context: UIMSContext\n}) {\n const viewMode = context.registries.viewMode.byName[block.viewMode]\n const rowViewMode = context.registries.viewMode.byName[block.rowViewMode]\n const stylesBySlot = resolveStylesBySlot(rowViewMode)\n const className = viewMode?.styles.map((style: any) => {\n return style.style\n .map((ss: any, i: any) => {\n const s = context.registries.styles.byName[ss.value.name]\n return ss.value.css.className\n })\n .join(' ')\n })\n\n return {\n className,\n viewMode,\n props: block,\n rowViewMode,\n rows: rows.map((row) =>\n applyStylesToProps(\n mapDataToProps({\n data: row,\n mapper: block.rowPropsMapping,\n }),\n stylesBySlot,\n ),\n ),\n }\n}\n","import { resolveInlineBlock } from './resolveInlineBlock'\nimport { resolveViewBlock } from './resolveViewBlock'\nimport { resolveViewData } from './resolveViewData'\nimport { UIMSContext } from '../types/UIMSContext'\n\nexport async function resolveLayout({\n layout,\n context,\n}: {\n layout: Array<any>\n context: UIMSContext\n}) {\n const resolved: any[] = []\n const viewData = await resolveViewData(context.payload, layout)\n for (const [index, block] of layout.entries()) {\n if (block.blockType === 'view') {\n resolved.push(\n resolveViewBlock({\n block,\n rows: viewData[index] ?? [],\n context,\n }),\n )\n } else if (block.blockType === 'reference') {\n const nestedResolved = await resolveLayout({ layout: block.block.value.layout, context })\n resolved.push(...nestedResolved)\n } else {\n resolved.push(resolveInlineBlock({ block, context }))\n }\n }\n return resolved\n}\n"],"names":["async","resolveViewData","payload","layout","results","index","length","block","isViewBlock","data","fetchViewBlockData","Array","isArray","blockType","useInternalSource","result","find","collection","internalCollection","sort","internalSort","undefined","depth","internalDepth","docs","fetchInternalCollection","dataSource","res","fetch","json","dataSet","fetchExternalSource","Card","className","imageProps","titleProps","descriptionProps","children","_jsxs","src","_jsx","alt","text","Container","componentRegistry","resolveStylesBySlot","viewMode","styles","entry","classNames","style","slot","applyStylesToProps","props","stylesBySlot","nextProps","Object","entries","filter","Boolean","join","getValueByPath","obj","path","split","reduce","acc","key","mapDataToProps","mapper","keys","rule","startsWith","replace","resolveInlineBlock","context","registries","byName","console","log","Component","component","blockPropsMapping","resolveViewBlock","rows","rowViewMode","map","ss","i","value","name","css","row","rowPropsMapping","resolveLayout","resolved","viewData","push","nestedResolved"],"mappings":"gDASOA,eAAeC,EACpBC,EACAC,GAEA,MAAMC,EAA0B,CAAA,EAEhC,IAAK,IAAIC,EAAQ,EAAGA,EAAQF,EAAOG,OAAQD,IAAS,CAClD,MAAME,EA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AOoE,aAG9C,OAAOoB,CACT"}
@@ -0,0 +1,2 @@
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";async function o(e,t){const o={};for(let n=0;n<t.length;n++){const r=t[n];if(!a(r))continue;const c=await s({payload:e,block:r});o[n]=Array.isArray(c)?c:[]}return o}function a(e){return"view"===e.blockType}async function s({payload:e,block:t}){return t.useInternalSource?async function({payload:e,block:t}){const o=await e.find({collection:t.internalCollection,sort:t.internalSort||void 0,depth:t.internalDepth??1});return o?.docs??[]}({payload:e,block:t}):t.dataSource?async function({payload:e,block:t}){try{const e=await fetch(t.dataSource),o=await e.json();return Array.isArray(o?.[t.dataSet])?o[t.dataSet]:[]}catch{return[]}}({payload:e,block:t}):[]}const n=({className:o,imageProps:a,titleProps:s,descriptionProps:n,children:r})=>e("div",{className:o,children:[a?.src&&t("img",{src:a.src,alt:a.alt??"",className:a.className}),s?.text&&t("h3",{className:s.className,children:s.text}),n?.text&&t("p",{className:n.className,children:n.text}),r]}),r=({className:e,children:o})=>t("div",{className:e,children:o}),c={Card:n,Container:r};function i(e){const t={};if(!e?.styles)return t;for(const o of e.styles){const e=o.style;e&&(t[o.slot]=e)}return t}function l(e,t){if(!t)return e;const o={...e};for(const[e,a]of Object.entries(t))"root"!==e?o[e]&&"object"==typeof o[e]&&(o[e]={...o[e],className:[o[e].className,a].filter(Boolean).join(" ")}):o.className=[o.className,a].filter(Boolean).join(" ");return o}function p(e,t){return t.split(".").reduce((e,t)=>e?e[t]:void 0,e)}function u({data:e,mapper:t}){const o={};if(!t)return o;for(const a of Object.keys(t)){const s=t[a];"string"==typeof s&&s.startsWith("__static:")?o[a]=s.replace("__static:",""):o[a]="string"!=typeof s?"object"!=typeof s||null===s?void 0:u({data:e,mapper:s}):p(e,s)}return o}function d({block:e,context:t}){const o=t.registries.viewMode.byName[e.viewMode];if(console.log("viewMode",o),!o)return null;const a=c[o.component],s=i(o);return{Component:a,props:{...l(u({data:e,mapper:o.blockPropsMapping}),s)}}}function f({block:e,rows:t,context:o}){const a=o.registries.viewMode.byName[e.viewMode],s=o.registries.viewMode.byName[e.rowViewMode],n=i(s),r=a?.styles.map(e=>e.style.map((e,t)=>(o.registries.styles.byName[e.value.name],e.value.css.className)).join(" "));return{className:r,viewMode:a,props:e,rowViewMode:s,rows:t.map(t=>l(u({data:t,mapper:e.rowPropsMapping}),n))}}async function y({layout:e,context:t}){const a=[],s=await o(t.payload,e);for(const[o,n]of e.entries())if("view"===n.blockType)a.push(f({block:n,rows:s[o]??[],context:t}));else if("reference"===n.blockType){const e=await y({layout:n.block.value.layout,context:t});a.push(...e)}else a.push(d({block:n,context:t}));return a}export{n as C,y as a,l as b,r as c,c as d,p as g,u as m,o as r};
2
+ //# sourceMappingURL=resolveLayout-DryOXHEy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveLayout-DryOXHEy.js","sources":["../src/uims/resolver/resolveViewData.ts","../src/react/components/Card.tsx","../src/react/components/Container.tsx","../src/react/componentRegistry.ts","../src/uims/resolver/resolveStylesBySlot.ts","../src/uims/mapper/applyStylesToProps.ts","../src/uims/mapper/getValueByPath.ts","../src/uims/mapper/mapDataToProps.ts","../src/uims/resolver/resolveInlineBlock.ts","../src/uims/resolver/resolveViewBlock.ts","../src/uims/resolver/resolveLayout.ts"],"sourcesContent":["import { BasePayload } from 'payload'\n\ntype ResolveViewDataParams = {\n payload: BasePayload\n layout: any[]\n}\n\ntype ViewDataResult = Record<number, any[]>\n\nexport async function resolveViewData(\n payload: BasePayload,\n layout: any[],\n): Promise<ViewDataResult> {\n const results: ViewDataResult = {}\n\n for (let index = 0; index < layout.length; index++) {\n const block = layout[index]\n\n if (!isViewBlock(block)) {\n continue\n }\n\n const data = await fetchViewBlockData({\n payload,\n block,\n })\n\n results[index] = Array.isArray(data) ? data : []\n }\n\n return results\n}\n\n// ──────────────────────────────────────────────\n// Helpers locali\n// ──────────────────────────────────────────────\n\nfunction isViewBlock(block: any): boolean {\n return block.blockType === 'view'\n}\n\nasync function fetchViewBlockData({\n payload,\n block,\n}: {\n payload: BasePayload\n block: any\n}): Promise<any[]> {\n // Sorgente interna (Payload)\n if (block.useInternalSource) {\n return fetchInternalCollection({\n payload,\n block,\n })\n }\n\n // Sorgente esterna (REST)\n if (block.dataSource) {\n return fetchExternalSource({\n payload,\n block,\n })\n }\n\n return []\n}\n\nasync function fetchInternalCollection({\n payload,\n block,\n}: {\n payload: BasePayload\n block: any\n}): Promise<any[]> {\n const result = await payload.find({\n collection: block.internalCollection,\n sort: block.internalSort || undefined,\n depth: block.internalDepth ?? 1,\n })\n\n return result?.docs ?? []\n}\n\nasync function fetchExternalSource({\n payload,\n block,\n}: {\n payload: BasePayload\n block: any\n}): Promise<any[]> {\n try {\n const res = await fetch(block.dataSource)\n const json = await res.json()\n\n return Array.isArray(json?.[block.dataSet]) ? json[block.dataSet] : []\n } catch {\n return []\n }\n}\n","import type { ReactNode } from 'react'\n\ntype CardTextProps = {\n text?: string\n className?: string\n}\n\ntype CardImageProps = {\n src?: string\n alt?: string\n className?: string\n}\n\nexport type CardProps = {\n className?: string\n imageProps?: CardImageProps\n titleProps?: CardTextProps\n descriptionProps?: CardTextProps\n children?: ReactNode\n}\n\nexport const Card = ({\n className,\n imageProps,\n titleProps,\n descriptionProps,\n children,\n}: CardProps) => {\n // # TODO sarebbe da aggiungere un componente specifico per la stampa dei valori non stilati. Ossia se non viene selezionato alcun componente in fase di editing e per esempio le proprietà di una card arrivano a un DIV\n // Questo non è in grado di stampare i valori simil JSON, discorso diverso invece si presenta se a ricevere tutte le proprietà è invece un componente dedicato (comodo anche per debug)\n return (\n <div className={className}>\n {imageProps?.src && (\n <img src={imageProps.src} alt={imageProps.alt ?? ''} className={imageProps.className} />\n )}\n\n {titleProps?.text && <h3 className={titleProps.className}>{titleProps.text}</h3>}\n\n {descriptionProps?.text && (\n <p className={descriptionProps.className}>{descriptionProps.text}</p>\n )}\n\n {children}\n </div>\n )\n}\n","export type ContainerProps = {\n className?: string\n children?: []\n}\n\nexport const Container = ({ className, children }: ContainerProps) => {\n return <div className={className}>{children}</div>\n}\n","// components/registry.ts\nimport { Container } from '.'\nimport { Card } from './components/Card'\n\nexport const componentRegistry: Record<string, any> = {\n Card,\n Container,\n}\n","type ViewMode = {\n css?: {\n className?: string\n }\n styles?: Array<{\n slot: string\n style: string\n }>\n}\n\nexport function resolveStylesBySlot(viewMode: ViewMode): Record<string, string> {\n const result: Record<string, string> = {}\n\n if (!viewMode?.styles) return result\n\n for (const entry of viewMode.styles) {\n const classNames = entry.style\n\n if (classNames) {\n result[entry.slot] = classNames\n }\n }\n\n return result\n}\n","type StylesBySlot = Record<string, string>\ntype AnyProps = Record<string, any>\n\nexport function applyStylesToProps<T extends AnyProps>(props: T, stylesBySlot?: StylesBySlot): T {\n if (!stylesBySlot) return props\n const nextProps = { ...props } as AnyProps\n\n for (const [slot, className] of Object.entries(stylesBySlot)) {\n if (slot === 'root') {\n nextProps['className'] = [nextProps['className'], className].filter(Boolean).join(' ')\n continue\n }\n if (nextProps[slot] && typeof nextProps[slot] === 'object') {\n nextProps[slot] = {\n ...nextProps[slot],\n className: [nextProps[slot].className, className].filter(Boolean).join(' '),\n }\n }\n }\n\n return nextProps as T\n}\n","export function getValueByPath(obj: any, path: string): any {\n return path.split('.').reduce((acc, key) => (acc ? acc[key] : undefined), obj)\n}\n","import { getValueByPath } from './getValueByPath'\n\ntype Mapper = Record<string, any>\n\nexport function mapDataToProps<T = any>({ data, mapper }: { data: any; mapper: Mapper }): T {\n const result: any = {}\n if (!mapper) return result\n for (const key of Object.keys(mapper)) {\n const rule = mapper[key]\n if (typeof rule === 'string' && rule.startsWith('__static:')) {\n result[key] = rule.replace('__static:', '')\n continue\n }\n\n if (typeof rule === 'string') {\n result[key] = getValueByPath(data, rule)\n continue\n }\n\n if (typeof rule === 'object' && rule !== null) {\n result[key] = mapDataToProps({\n data,\n mapper: rule,\n })\n continue\n }\n\n result[key] = undefined\n }\n\n return result\n}\n","import { componentRegistry } from '../../react/componentRegistry'\nimport { UIMSContext } from '../types/UIMSContext'\nimport { resolveStylesBySlot } from './resolveStylesBySlot'\nimport { applyStylesToProps } from '../mapper/applyStylesToProps'\nimport { mapDataToProps } from '../mapper/mapDataToProps'\n\nexport function resolveInlineBlock({ block, context }: { block: any; context: UIMSContext }) {\n //const viewMode = context.registries.viewMode.byId[block.viewMode.value]\n const viewMode = context.registries.viewMode.byName[block.viewMode]\n console.log('viewMode', viewMode)\n if (!viewMode) return null\n\n const Component = componentRegistry[viewMode.component]\n const stylesBySlot = resolveStylesBySlot(viewMode)\n return {\n Component,\n props: {\n ...applyStylesToProps(\n mapDataToProps({\n data: block,\n mapper: viewMode.blockPropsMapping,\n }),\n stylesBySlot,\n ),\n },\n }\n}\n","import { mapDataToProps } from '../mapper/mapDataToProps'\nimport { UIMSContext } from '../types/UIMSContext'\nimport { resolveStylesBySlot } from './resolveStylesBySlot'\nimport { applyStylesToProps } from '../mapper/applyStylesToProps'\n\nexport function resolveViewBlock({\n block,\n rows,\n context,\n}: {\n block: any\n rows: any[]\n context: UIMSContext\n}) {\n const viewMode = context.registries.viewMode.byName[block.viewMode]\n const rowViewMode = context.registries.viewMode.byName[block.rowViewMode]\n const stylesBySlot = resolveStylesBySlot(rowViewMode)\n const className = viewMode?.styles.map((style: any) => {\n return style.style\n .map((ss: any, i: any) => {\n const s = context.registries.styles.byName[ss.value.name]\n return ss.value.css.className\n })\n .join(' ')\n })\n\n return {\n className,\n viewMode,\n props: block,\n rowViewMode,\n rows: rows.map((row) =>\n applyStylesToProps(\n mapDataToProps({\n data: row,\n mapper: block.rowPropsMapping,\n }),\n stylesBySlot,\n ),\n ),\n }\n}\n","import { resolveInlineBlock } from './resolveInlineBlock'\nimport { resolveViewBlock } from './resolveViewBlock'\nimport { resolveViewData } from './resolveViewData'\nimport { UIMSContext } from '../types/UIMSContext'\n\nexport async function resolveLayout({\n layout,\n context,\n}: {\n layout: Array<any>\n context: UIMSContext\n}) {\n const resolved: any[] = []\n const viewData = await resolveViewData(context.payload, layout)\n for (const [index, block] of layout.entries()) {\n if (block.blockType === 'view') {\n resolved.push(\n resolveViewBlock({\n block,\n rows: viewData[index] ?? [],\n context,\n }),\n )\n } else if (block.blockType === 'reference') {\n const nestedResolved = await resolveLayout({ layout: block.block.value.layout, context })\n resolved.push(...nestedResolved)\n } else {\n resolved.push(resolveInlineBlock({ block, context }))\n }\n }\n return resolved\n}\n"],"names":["async","resolveViewData","payload","layout","results","index","length","block","isViewBlock","data","fetchViewBlockData","Array","isArray","blockType","useInternalSource","result","find","collection","internalCollection","sort","internalSort","undefined","depth","internalDepth","docs","fetchInternalCollection","dataSource","res","fetch","json","dataSet","fetchExternalSource","Card","className","imageProps","titleProps","descriptionProps","children","_jsxs","src","_jsx","alt","text","Container","componentRegistry","resolveStylesBySlot","viewMode","styles","entry","classNames","style","slot","applyStylesToProps","props","stylesBySlot","nextProps","Object","entries","filter","Boolean","join","getValueByPath","obj","path","split","reduce","acc","key","mapDataToProps","mapper","keys","rule","startsWith","replace","resolveInlineBlock","context","registries","byName","console","log","Component","component","blockPropsMapping","resolveViewBlock","rows","rowViewMode","map","ss","i","value","name","css","row","rowPropsMapping","resolveLayout","resolved","viewData","push","nestedResolved"],"mappings":"kDASOA,eAAeC,EACpBC,EACAC,GAEA,MAAMC,EAA0B,CAAA,EAEhC,IAAK,IAAIC,EAAQ,EAAGA,EAAQF,EAAOG,OAAQD,IAAS,CAClD,MAAME,EAAQJ,EAAOE,GAErB,IAAKG,EAAYD,GACf,SAGF,MAAME,QAAaC,EAAmB,CACpCR,UACAK,UAGFH,EAAQC,GAASM,MAAMC,QAAQH,GAAQA,EAAO,EAChD,CAEA,OAAOL,CACT,CAMA,SAASI,EAAYD,GACnB,MAA2B,SAApBA,EAAMM,SACf,CAEAb,eAAeU,GAAmBR,QAChCA,EAAOK,MACPA,IAMA,OAAIA,EAAMO,kBAkBZd,gBAAuCE,QACrCA,EAAOK,MACPA,IAKA,MAAMQ,QAAeb,EAAQc,KAAK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+B,OAAOtE,EAAMuC,UACpDuC,EAAcV,EAAQC,WAAW9B,SAAS+B,OAAOtE,EAAM8E,aACvD/B,EAAeT,EAAoBwC,GACnCpD,EAAYa,GAAUC,OAAOuC,IAAKpC,GAC/BA,EAAMA,MACVoC,IAAI,CAACC,EAASC,KACHb,EAAQC,WAAW7B,OAAO8B,OAAOU,EAAGE,MAAMC,MAC7CH,EAAGE,MAAME,IAAI1D,YAErB2B,KAAK,MAGV,MAAO,CACL3B,YACAa,WACAO,MAAO9C,EACP8E,cACAD,KAAMA,EAAKE,IAAKM,GACdxC,EACEgB,EAAe,CACb3D,KAAMmF,EACNvB,OAAQ9D,EAAMsF,kBAEhBvC,IAIR,CCpCOtD,eAAe8F,GAAc3F,OAClCA,EAAMwE,QACNA,IAKA,MAAMoB,EAAkB,GAClBC,QAAiB/F,EAAgB0E,EAAQzE,QAASC,GACxD,IAAK,MAAOE,EAAOE,KAAUJ,EAAOsD,UAClC,GAAwB,SAApBlD,EAAMM,UACRkF,EAASE,KACPd,EAAiB,CACf5E,QACA6E,KAAMY,EAAS3F,IAAU,GACzBsE,kBAGC,GAAwB,cAApBpE,EAAMM,UAA2B,CAC1C,MAAMqF,QAAuBJ,EAAc,CAAE3F,OAAQI,EAAMA,MAAMkF,MAAMtF,OAAQwE,YAC/EoB,EAASE,QAAQC,EACnB,MACEH,EAASE,KAAKvB,EAAmB,CAAEnE,QAAOoE,aAG9C,OAAOoB,CACT"}
@@ -0,0 +1,7 @@
1
+ type SeederTarget = 'styles' | 'viewMode' | 'component';
2
+ interface SeederOptions {
3
+ payload: any;
4
+ include: SeederTarget[];
5
+ }
6
+ export declare function UIMSSeeder({ payload, include }: SeederOptions): Promise<void>;
7
+ export {};
@@ -0,0 +1,14 @@
1
+ import { seedStyles } from './styles';
2
+ import { seedViewModes } from './viewModes';
3
+ import { seedComponents } from './components';
4
+ export async function UIMSSeeder({ payload, include }) {
5
+ if (include.includes('styles')) {
6
+ await seedStyles(payload);
7
+ }
8
+ if (include.includes('viewMode')) {
9
+ await seedViewModes(payload);
10
+ }
11
+ if (include.includes('component')) {
12
+ await seedComponents(payload);
13
+ }
14
+ }
@@ -0,0 +1,2 @@
1
+ import type { CollectionSlug, Payload } from 'payload';
2
+ export declare const clearCollection: (payload: Payload, collection: CollectionSlug) => Promise<void>;
@@ -0,0 +1,18 @@
1
+ export const clearCollection = async (payload, collection) => {
2
+ const docs = await payload.find({
3
+ collection,
4
+ limit: 1000000,
5
+ depth: 0,
6
+ });
7
+ for (const doc of docs.docs) {
8
+ try {
9
+ await payload.delete({
10
+ collection,
11
+ id: doc.id,
12
+ });
13
+ }
14
+ catch (error) {
15
+ console.warn(`[CLEAR COLLECTION] Skip ${collection}:${doc.id}`, error?.message ?? error);
16
+ }
17
+ }
18
+ };
@@ -0,0 +1 @@
1
+ export declare function seedComponents(payload: any): Promise<void>;
@@ -0,0 +1,3 @@
1
+ export async function seedComponents(payload) {
2
+ // TODO: implementazione
3
+ }
@@ -0,0 +1,6 @@
1
+ type StyleSeed = {
2
+ name: string;
3
+ css: string;
4
+ };
5
+ export declare const generateTailwindStyles: () => StyleSeed[];
6
+ export {};
@@ -0,0 +1,18 @@
1
+ import { tailwindSelectorVariants } from '../tailwind/tailwindSelectorVariants';
2
+ import { tailwindFieldsSelectors } from '../tailwind/tailwindFieldSelectors';
3
+ export const generateTailwindStyles = () => {
4
+ const styles = [];
5
+ for (const variant of tailwindSelectorVariants) {
6
+ for (const selectors of Object.values(tailwindFieldsSelectors)) {
7
+ for (const selector of selectors) {
8
+ const value = `${variant.value}${selector}`; // es. md:mx-auto
9
+ const name = `t:${value}`;
10
+ styles.push({
11
+ name,
12
+ css: value,
13
+ });
14
+ }
15
+ }
16
+ }
17
+ return styles;
18
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("../tailwind/index.cjs.js");const s=()=>{const s=[];for(const n of e.tailwindSelectorVariants)for(const t of Object.values(e.tailwindFieldsSelectors))for(const e of t){const t=`${n.value}${e}`,a=`t:${t}`;s.push({name:a,css:t})}return s};exports.UIMSSeeder=async function({payload:e,include:n}){n.includes("styles")&&await async function(e){const n=s(),t=await e.find({collection:"styles",limit:1e6,depth:0}),a=new Set(t.docs.map(e=>e.name));for(const s of n)if(!a.has(s.name))try{await e.create({collection:"styles",data:{name:s.name,css:{className:s.css}}})}catch(e){console.warn(`[SEED STYLES] Errore su "${s.name}", skip`,e?.message??e)}}(e),n.includes("viewMode")&&await async function(){}(),n.includes("component")&&await async function(){}()},exports.generateTailwindStyles=s;
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":["../../src/seeders/generateTailwindStyles.ts","../../src/seeders/UIMSSeeder.ts","../../src/seeders/styles.ts","../../src/seeders/viewModes.ts","../../src/seeders/components.ts"],"sourcesContent":["import { tailwindSelectorVariants } from '../tailwind/tailwindSelectorVariants'\nimport { tailwindFieldsSelectors } from '../tailwind/tailwindFieldSelectors'\n\ntype StyleSeed = {\n name: string\n css: string\n}\nexport const generateTailwindStyles = (): StyleSeed[] => {\n const styles: StyleSeed[] = []\n\n for (const variant of tailwindSelectorVariants) {\n for (const selectors of Object.values(tailwindFieldsSelectors)) {\n for (const selector of selectors) {\n const value = `${variant.value}${selector}` // es. md:mx-auto\n const name = `t:${value}`\n styles.push({\n name,\n css: value,\n })\n }\n }\n }\n\n return styles\n}\n","import { seedStyles } from './styles'\nimport { seedViewModes } from './viewModes'\nimport { seedComponents } from './components'\n\ntype SeederTarget = 'styles' | 'viewMode' | 'component'\n\ninterface SeederOptions {\n payload: any\n include: SeederTarget[]\n}\n\nexport async function UIMSSeeder({ payload, include }: SeederOptions): Promise<void> {\n if (include.includes('styles')) {\n await seedStyles(payload)\n }\n\n if (include.includes('viewMode')) {\n await seedViewModes(payload)\n }\n\n if (include.includes('component')) {\n await seedComponents(payload)\n }\n}\n","import { generateTailwindStyles } from './generateTailwindStyles'\n\nexport async function seedStyles(payload: any): Promise<void> {\n const generatedStyles = generateTailwindStyles()\n\n const existing = await payload.find({\n collection: 'styles',\n limit: 1000000,\n depth: 0,\n })\n\n const existingNames = new Set(existing.docs.map((style: any) => style.name))\n\n for (const style of generatedStyles) {\n if (existingNames.has(style.name)) {\n continue\n }\n\n try {\n await payload.create({\n collection: 'styles',\n data: {\n name: style.name,\n css: { className: style.css },\n },\n })\n } catch (error: any) {\n console.warn(`[SEED STYLES] Errore su \"${style.name}\", skip`, error?.message ?? error)\n }\n }\n}\n","export async function seedViewModes(payload: any): Promise<void> {\n // TODO: implementazione\n}\n","export async function seedComponents(payload: any): Promise<void> {\n // TODO: implementazione\n}\n"],"names":["generateTailwindStyles","styles","variant","tailwindSelectorVariants","selectors","Object","values","tailwindFieldsSelectors","selector","value","name","push","css","async","payload","include","includes","generatedStyles","existing","find","collection","limit","depth","existingNames","Set","docs","map","style","has","create","data","className","error","console","warn","message","seedStyles","seedViewModes","seedComponents"],"mappings":"uDAOO,MAAMA,EAAyB,KACpC,MAAMC,EAAsB,GAE5B,IAAK,MAAMC,KAAWC,2BACpB,IAAK,MAAMC,KAAaC,OAAOC,OAAOC,EAAAA,yBACpC,IAAK,MAAMC,KAAYJ,EAAW,CAChC,MAAMK,EAAQ,GAAGP,EAAQO,QAAQD,IAC3BE,EAAO,KAAKD,IAClBR,EAAOU,KAAK,CACVD,OACAE,IAAKH,GAET,CAIJ,OAAOR,sBCZFY,gBAA0BC,QAAEA,EAAOC,QAAEA,IACtCA,EAAQC,SAAS,iBCVhBH,eAA0BC,GAC/B,MAAMG,EAAkBjB,IAElBkB,QAAiBJ,EAAQK,KAAK,CAClCC,WAAY,SACZC,MAAO,IACPC,MAAO,IAGHC,EAAgB,IAAIC,IAAIN,EAASO,KAAKC,IAAKC,GAAeA,EAAMjB,OAEtE,IAAK,MAAMiB,KAASV,EAClB,IAAIM,EAAcK,IAAID,EAAMjB,MAI5B,UACQI,EAAQe,OAAO,CACnBT,WAAY,SACZU,KAAM,CACJpB,KAAMiB,EAAMjB,KACZE,IAAK,CAAEmB,UAAWJ,EAAMf,OAG9B,CAAE,MAAOoB,GACPC,QAAQC,KAAK,4BAA4BP,EAAMjB,cAAesB,GAAOG,SAAWH,EAClF,CAEJ,CDjBUI,CAAWtB,GAGfC,EAAQC,SAAS,mBEhBhBH,iBAEP,CFeUwB,GAGJtB,EAAQC,SAAS,oBGpBhBH,iBAEP,CHmBUyB,EAEV"}
@@ -0,0 +1,2 @@
1
+ export * from './UIMSSeeder';
2
+ export * from './generateTailwindStyles';
@@ -0,0 +1,2 @@
1
+ import{tailwindSelectorVariants as n,tailwindFieldsSelectors as s}from"../tailwind/index.esm.js";const e=()=>{const e=[];for(const t of n)for(const n of Object.values(s))for(const s of n){const n=`${t.value}${s}`,a=`t:${n}`;e.push({name:a,css:n})}return e};async function t({payload:n,include:s}){s.includes("styles")&&await async function(n){const s=e(),t=await n.find({collection:"styles",limit:1e6,depth:0}),a=new Set(t.docs.map(n=>n.name));for(const e of s)if(!a.has(e.name))try{await n.create({collection:"styles",data:{name:e.name,css:{className:e.css}}})}catch(n){console.warn(`[SEED STYLES] Errore su "${e.name}", skip`,n?.message??n)}}(n),s.includes("viewMode")&&await async function(){}(),s.includes("component")&&await async function(){}()}export{t as UIMSSeeder,e as generateTailwindStyles};
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../../src/seeders/generateTailwindStyles.ts","../../src/seeders/UIMSSeeder.ts","../../src/seeders/styles.ts","../../src/seeders/viewModes.ts","../../src/seeders/components.ts"],"sourcesContent":["import { tailwindSelectorVariants } from '../tailwind/tailwindSelectorVariants'\nimport { tailwindFieldsSelectors } from '../tailwind/tailwindFieldSelectors'\n\ntype StyleSeed = {\n name: string\n css: string\n}\nexport const generateTailwindStyles = (): StyleSeed[] => {\n const styles: StyleSeed[] = []\n\n for (const variant of tailwindSelectorVariants) {\n for (const selectors of Object.values(tailwindFieldsSelectors)) {\n for (const selector of selectors) {\n const value = `${variant.value}${selector}` // es. md:mx-auto\n const name = `t:${value}`\n styles.push({\n name,\n css: value,\n })\n }\n }\n }\n\n return styles\n}\n","import { seedStyles } from './styles'\nimport { seedViewModes } from './viewModes'\nimport { seedComponents } from './components'\n\ntype SeederTarget = 'styles' | 'viewMode' | 'component'\n\ninterface SeederOptions {\n payload: any\n include: SeederTarget[]\n}\n\nexport async function UIMSSeeder({ payload, include }: SeederOptions): Promise<void> {\n if (include.includes('styles')) {\n await seedStyles(payload)\n }\n\n if (include.includes('viewMode')) {\n await seedViewModes(payload)\n }\n\n if (include.includes('component')) {\n await seedComponents(payload)\n }\n}\n","import { generateTailwindStyles } from './generateTailwindStyles'\n\nexport async function seedStyles(payload: any): Promise<void> {\n const generatedStyles = generateTailwindStyles()\n\n const existing = await payload.find({\n collection: 'styles',\n limit: 1000000,\n depth: 0,\n })\n\n const existingNames = new Set(existing.docs.map((style: any) => style.name))\n\n for (const style of generatedStyles) {\n if (existingNames.has(style.name)) {\n continue\n }\n\n try {\n await payload.create({\n collection: 'styles',\n data: {\n name: style.name,\n css: { className: style.css },\n },\n })\n } catch (error: any) {\n console.warn(`[SEED STYLES] Errore su \"${style.name}\", skip`, error?.message ?? error)\n }\n }\n}\n","export async function seedViewModes(payload: any): Promise<void> {\n // TODO: implementazione\n}\n","export async function seedComponents(payload: any): Promise<void> {\n // TODO: implementazione\n}\n"],"names":["generateTailwindStyles","styles","variant","tailwindSelectorVariants","selectors","Object","values","tailwindFieldsSelectors","selector","value","name","push","css","async","UIMSSeeder","payload","include","includes","generatedStyles","existing","find","collection","limit","depth","existingNames","Set","docs","map","style","has","create","data","className","error","console","warn","message","seedStyles","seedViewModes","seedComponents"],"mappings":"iGAOO,MAAMA,EAAyB,KACpC,MAAMC,EAAsB,GAE5B,IAAK,MAAMC,KAAWC,EACpB,IAAK,MAAMC,KAAaC,OAAOC,OAAOC,GACpC,IAAK,MAAMC,KAAYJ,EAAW,CAChC,MAAMK,EAAQ,GAAGP,EAAQO,QAAQD,IAC3BE,EAAO,KAAKD,IAClBR,EAAOU,KAAK,CACVD,OACAE,IAAKH,GAET,CAIJ,OAAOR,GCZFY,eAAeC,GAAWC,QAAEA,EAAOC,QAAEA,IACtCA,EAAQC,SAAS,iBCVhBJ,eAA0BE,GAC/B,MAAMG,EAAkBlB,IAElBmB,QAAiBJ,EAAQK,KAAK,CAClCC,WAAY,SACZC,MAAO,IACPC,MAAO,IAGHC,EAAgB,IAAIC,IAAIN,EAASO,KAAKC,IAAKC,GAAeA,EAAMlB,OAEtE,IAAK,MAAMkB,KAASV,EAClB,IAAIM,EAAcK,IAAID,EAAMlB,MAI5B,UACQK,EAAQe,OAAO,CACnBT,WAAY,SACZU,KAAM,CACJrB,KAAMkB,EAAMlB,KACZE,IAAK,CAAEoB,UAAWJ,EAAMhB,OAG9B,CAAE,MAAOqB,GACPC,QAAQC,KAAK,4BAA4BP,EAAMlB,cAAeuB,GAAOG,SAAWH,EAClF,CAEJ,CDjBUI,CAAWtB,GAGfC,EAAQC,SAAS,mBEhBhBJ,iBAEP,CFeUyB,GAGJtB,EAAQC,SAAS,oBGpBhBJ,iBAEP,CHmBU0B,EAEV"}
@@ -0,0 +1,2 @@
1
+ export * from './UIMSSeeder';
2
+ export * from './generateTailwindStyles';
@@ -0,0 +1 @@
1
+ export declare function seedStyles(payload: any): Promise<void>;
@@ -0,0 +1,27 @@
1
+ import { generateTailwindStyles } from './generateTailwindStyles';
2
+ export async function seedStyles(payload) {
3
+ const generatedStyles = generateTailwindStyles();
4
+ const existing = await payload.find({
5
+ collection: 'styles',
6
+ limit: 1000000,
7
+ depth: 0,
8
+ });
9
+ const existingNames = new Set(existing.docs.map((style) => style.name));
10
+ for (const style of generatedStyles) {
11
+ if (existingNames.has(style.name)) {
12
+ continue;
13
+ }
14
+ try {
15
+ await payload.create({
16
+ collection: 'styles',
17
+ data: {
18
+ name: style.name,
19
+ css: { className: style.css },
20
+ },
21
+ });
22
+ }
23
+ catch (error) {
24
+ console.warn(`[SEED STYLES] Errore su "${style.name}", skip`, error?.message ?? error);
25
+ }
26
+ }
27
+ }
@@ -0,0 +1 @@
1
+ export declare function seedViewModes(payload: any): Promise<void>;
@@ -0,0 +1,3 @@
1
+ export async function seedViewModes(payload) {
2
+ // TODO: implementazione
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";exports.tailwindFieldsSelectors={accentColor:["accent-auto","accent-transparent","accent-current","accent-black","accent-white"],alignContent:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-stretch"],alignItems:["items-start","items-end","items-center","items-baseline","items-stretch"],alignSelf:["self-auto","self-start","self-end","self-center","self-stretch","self-baseline"],animation:["animate-none","animate-spin","animate-ping","animate-pulse","animate-bounce"],appearance:["appearance-none","appearance-auto"],aspectRatio:["aspect-auto","aspect-square","aspect-video"],backdropBlur:["backdrop-blur-none","backdrop-blur-sm","backdrop-blur","backdrop-blur-md","backdrop-blur-lg","backdrop-blur-xl","backdrop-blur-2xl","backdrop-blur-3xl"],backdropBrightness:["backdrop-brightness-0","backdrop-brightness-50","backdrop-brightness-75","backdrop-brightness-90","backdrop-brightness-95","backdrop-brightness-100","backdrop-brightness-105","backdrop-brightness-110","backdrop-brightness-125","backdrop-brightness-150","backdrop-brightness-200"],backdropContrast:["backdrop-contrast-0","backdrop-contrast-50","backdrop-contrast-75","backdrop-contrast-100","backdrop-contrast-125","backdrop-contrast-150","backdrop-contrast-200"],backdropFilter:["backdrop-filter","backdrop-filter-none"],backdropGrayscale:["backdrop-grayscale","backdrop-grayscale-0"],backdropHueRotate:["backdrop-hue-rotate-0","backdrop-hue-rotate-15","backdrop-hue-rotate-30","backdrop-hue-rotate-60","backdrop-hue-rotate-90","backdrop-hue-rotate-180"],backdropInvert:["backdrop-invert","backdrop-invert-0"],backdropOpacity:["backdrop-opacity-0","backdrop-opacity-5","backdrop-opacity-10","backdrop-opacity-20","backdrop-opacity-25","backdrop-opacity-30","backdrop-opacity-40","backdrop-opacity-50","backdrop-opacity-60","backdrop-opacity-70","backdrop-opacity-75","backdrop-opacity-80","backdrop-opacity-90","backdrop-opacity-95","backdrop-opacity-100"],backdropSaturate:["backdrop-saturate-0","backdrop-saturate-50","backdrop-saturate-100","backdrop-saturate-150","backdrop-saturate-200"],backdropSepia:["backdrop-sepia","backdrop-sepia-0"],backgroundAttachment:["bg-fixed","bg-local","bg-scroll"],backgroundClip:["bg-clip-border","bg-clip-padding","bg-clip-content","bg-clip-text"],backgroundColor:["bg-transparent","bg-current","bg-black","bg-white"],backgroundImage:["bg-none","bg-gradient-to-t","bg-gradient-to-tr","bg-gradient-to-r","bg-gradient-to-br","bg-gradient-to-b","bg-gradient-to-bl","bg-gradient-to-l","bg-gradient-to-tl"],backgroundOrigin:["bg-origin-border","bg-origin-padding","bg-origin-content"],backgroundPosition:["bg-bottom","bg-center","bg-left","bg-left-bottom","bg-left-top","bg-right","bg-right-bottom","bg-right-top","bg-top"],backgroundRepeat:["bg-repeat","bg-no-repeat","bg-repeat-x","bg-repeat-y","bg-repeat-round","bg-repeat-space"],backgroundSize:["bg-auto","bg-cover","bg-contain"],borderCollapse:["border-collapse","border-separate"],borderColor:["border-transparent","border-current","border-black","border-white"],borderRadius:["rounded-none","rounded-sm","rounded","rounded-md","rounded-lg","rounded-xl","rounded-2xl","rounded-3xl","rounded-full"],borderStyle:["border-solid","border-dashed","border-dotted","border-double","border-hidden","border-none"],borderWidth:["border-0","border","border-2","border-4","border-8"],boxDecorationBreak:["box-decoration-slice","box-decoration-clone"],boxShadow:["shadow-none","shadow-sm","shadow","shadow-md","shadow-lg","shadow-xl","shadow-2xl","shadow-inner"],boxSizing:["box-border","box-content"],breakAfter:["break-after-auto","break-after-avoid","break-after-all","break-after-avoid-page","break-after-page","break-after-left","break-after-right","break-after-column"],breakBefore:["break-before-auto","break-before-avoid","break-before-all","break-before-avoid-page","break-before-page","break-before-left","break-before-right","break-before-column"],breakInside:["break-inside-auto","break-inside-avoid","break-inside-avoid-page","break-inside-avoid-column"],captionSide:["caption-top","caption-bottom"],caretColor:["caret-transparent","caret-current","caret-black","caret-white"],clear:["clear-left","clear-right","clear-both","clear-none"],columns:["columns-auto","columns-1","columns-2","columns-3","columns-4","columns-5","columns-6","columns-12"],columnGap:["gap-x-0","gap-x-1","gap-x-2","gap-x-3","gap-x-4","gap-x-5","gap-x-6","gap-x-8","gap-x-10","gap-x-12"],columnSpan:["col-span-1","col-span-2","col-span-3","col-span-4","col-span-5","col-span-6","col-span-full"],container:["container"],content:["content-none"],cursor:["cursor-auto","cursor-default","cursor-pointer","cursor-wait","cursor-text","cursor-move","cursor-help","cursor-not-allowed"],direction:["direction-ltr","direction-rtl"],display:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","flow-root","contents","table","table-row","table-cell","list-item","hidden"],divideColor:["divide-transparent","divide-current","divide-black","divide-white"],divideStyle:["divide-solid","divide-dashed","divide-dotted","divide-double","divide-none"],divideWidth:["divide-x","divide-y","divide-x-2","divide-y-2","divide-x-4","divide-y-4"],filter:["filter","filter-none"],flex:["flex-1","flex-auto","flex-initial","flex-none"],flexBasis:["basis-0","basis-1/2","basis-1/3","basis-2/3","basis-1/4","basis-3/4","basis-full","basis-auto"],flexDirection:["flex-row","flex-row-reverse","flex-col","flex-col-reverse"],flexGrow:["grow","grow-0"],flexShrink:["shrink","shrink-0"],flexWrap:["flex-wrap","flex-wrap-reverse","flex-nowrap"],float:["float-left","float-right","float-none"],fontFamily:["font-sans","font-serif","font-mono"],fontSize:["text-xs","text-sm","text-base","text-lg","text-xl","text-2xl","text-3xl","text-4xl","text-5xl","text-6xl"],fontStyle:["italic","not-italic"],fontSmoothing:["antialiased","subpixel-antialiased"],fontVariantNumeric:["normal-nums","ordinal","slashed-zero","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions"],fontWeight:["font-thin","font-extralight","font-light","font-normal","font-medium","font-semibold","font-bold","font-extrabold","font-black"],gap:["gap-0","gap-1","gap-2","gap-3","gap-4","gap-5","gap-6","gap-8","gap-10","gap-12"],gridAutoColumns:["auto-cols-auto","auto-cols-min","auto-cols-max","auto-cols-fr"],gridAutoFlow:["grid-flow-row","grid-flow-col","grid-flow-row-dense","grid-flow-col-dense"],gridAutoRows:["auto-rows-auto","auto-rows-min","auto-rows-max","auto-rows-fr"],gridColumn:["col-auto","col-span-1","col-span-2","col-span-3","col-span-4","col-span-5","col-span-6","col-span-full"],gridRow:["row-auto","row-span-1","row-span-2","row-span-3","row-span-4","row-span-5","row-span-6","row-span-full"],gridTemplateColumns:["grid-cols-1","grid-cols-2","grid-cols-3","grid-cols-4","grid-cols-5","grid-cols-6","grid-cols-12","grid-cols-none"],gridTemplateRows:["grid-rows-1","grid-rows-2","grid-rows-3","grid-rows-4","grid-rows-5","grid-rows-6","grid-rows-none"],height:["h-auto","h-full","h-screen","h-dvh","h-svh","h-lvh","h-min","h-max","h-fit"],hyphens:["hyphens-none","hyphens-manual","hyphens-auto"],imageRendering:["image-rendering-auto","image-rendering-crisp-edges","image-rendering-pixelated"],isolation:["isolate","isolation-auto"],justifyContent:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly"],justifyItems:["justify-items-start","justify-items-end","justify-items-center","justify-items-stretch"],justifySelf:["justify-self-auto","justify-self-start","justify-self-end","justify-self-center","justify-self-stretch"],letterSpacing:["tracking-tighter","tracking-tight","tracking-normal","tracking-wide","tracking-wider","tracking-widest"],lineClamp:["line-clamp-1","line-clamp-2","line-clamp-3","line-clamp-4","line-clamp-5","line-clamp-6","line-clamp-none"],lineHeight:["leading-none","leading-tight","leading-snug","leading-normal","leading-relaxed","leading-loose"],listStylePosition:["list-inside","list-outside"],listStyleType:["list-none","list-disc","list-decimal"],margin:["m-0","m-px","m-0.5","m-1","m-2","m-3","m-4","m-5","m-6","m-8","m-10","m-12","m-16","m-auto"],marginX:["mx-0","mx-px","mx-0.5","mx-1","mx-2","mx-3","mx-4","mx-5","mx-6","mx-8","mx-10","mx-12","mx-16","mx-auto"],marginY:["my-0","my-px","my-0.5","my-1","my-2","my-3","my-4","my-5","my-6","my-8","my-10","my-12","my-16","my-auto"],marginTop:["mt-0","mt-px","mt-0.5","mt-1","mt-2","mt-3","mt-4","mt-5","mt-6","mt-8","mt-10","mt-12","mt-16","mt-auto"],marginEnd:["me-0","me-px","me-0.5","me-1","me-2","me-3","me-4","me-5","me-6","me-8","me-10","me-12","me-16","me-auto"],marginBottom:["mb-0","mb-px","mb-0.5","mb-1","mb-2","mb-3","mb-4","mb-5","mb-6","mb-8","mb-10","mb-12","mb-16","mb-auto"],marginStart:["ms-0","ms-px","ms-0.5","ms-1","ms-2","ms-3","ms-4","ms-5","ms-6","ms-8","ms-10","ms-12","ms-16","ms-auto"],maxHeight:["max-h-none","max-h-full","max-h-screen","max-h-dvh","max-h-svh","max-h-lvh","max-h-min","max-h-max","max-h-fit"],maxWidth:["max-w-none","max-w-xs","max-w-sm","max-w-md","max-w-lg","max-w-xl","max-w-2xl","max-w-full","max-w-screen"],minHeight:["min-h-0","min-h-full","min-h-screen","min-h-dvh","min-h-svh","min-h-lvh","min-h-min","min-h-max","min-h-fit"],minWidth:["min-w-0","min-w-full","min-w-min","min-w-max","min-w-fit"],mixBlendMode:["mix-blend-normal","mix-blend-multiply","mix-blend-screen","mix-blend-overlay","mix-blend-darken","mix-blend-lighten","mix-blend-color-dodge","mix-blend-color-burn","mix-blend-hard-light","mix-blend-soft-light","mix-blend-difference","mix-blend-exclusion","mix-blend-hue","mix-blend-saturation","mix-blend-color","mix-blend-luminosity"],objectFit:["object-contain","object-cover","object-fill","object-none","object-scale-down"],objectPosition:["object-bottom","object-center","object-left","object-left-bottom","object-left-top","object-right","object-right-bottom","object-right-top","object-top"],opacity:["opacity-0","opacity-5","opacity-10","opacity-20","opacity-25","opacity-30","opacity-40","opacity-50","opacity-60","opacity-70","opacity-75","opacity-80","opacity-90","opacity-95","opacity-100"],order:["order-first","order-last","order-none","order-1","order-2","order-3","order-4","order-5","order-6","order-12"],outline:["outline-none","outline"],outlineColor:["outline-transparent","outline-current","outline-black","outline-white"],outlineOffset:["outline-offset-0","outline-offset-1","outline-offset-2","outline-offset-4","outline-offset-8"],outlineStyle:["outline-solid","outline-dashed","outline-dotted","outline-double"],outlineWidth:["outline-0","outline-1","outline-2","outline-4","outline-8"],overflow:["overflow-auto","overflow-hidden","overflow-clip","overflow-visible","overflow-scroll"],overflowX:["overflow-x-auto","overflow-x-hidden","overflow-x-clip","overflow-x-visible","overflow-x-scroll"],overflowY:["overflow-y-auto","overflow-y-hidden","overflow-y-clip","overflow-y-visible","overflow-y-scroll"],overscrollBehavior:["overscroll-auto","overscroll-contain","overscroll-none"],padding:["p-0","p-px","p-0.5","p-1","p-2","p-3","p-4","p-5","p-6","p-8","p-10","p-12","p-16"],paddingX:["px-0","px-px","px-0.5","px-1","px-2","px-3","px-4","px-5","px-6","px-8","px-10","px-12","px-16"],paddingY:["py-0","py-px","py-0.5","py-1","py-2","py-3","py-4","py-5","py-6","py-8","py-10","py-12","py-16"],paddingTop:["pt-0","pt-px","pt-0.5","pt-1","pt-2","pt-3","pt-4","pt-5","pt-6","pt-8","pt-10","pt-12","pt-16"],paddingBottom:["pb-0","pb-px","pb-0.5","pb-1","pb-2","pb-3","pb-4","pb-5","pb-6","pb-8","pb-10","pb-12","pb-16"],paddingStart:["ps-0","ps-px","ps-0.5","ps-1","ps-2","ps-3","ps-4","ps-5","ps-6","ps-8","ps-10","ps-12","ps-16"],paddingEnd:["pe-0","pe-px","pe-0.5","pe-1","pe-2","pe-3","pe-4","pe-5","pe-6","pe-8","pe-10","pe-12","pe-16"],placeContent:["place-content-start","place-content-end","place-content-center","place-content-between","place-content-around","place-content-evenly","place-content-stretch"],placeItems:["place-items-start","place-items-end","place-items-center","place-items-stretch"],placeSelf:["place-self-auto","place-self-start","place-self-end","place-self-center","place-self-stretch"],pointerEvents:["pointer-events-none","pointer-events-auto"],position:["static","fixed","absolute","relative","sticky"],resize:["resize-none","resize-y","resize-x","resize"],ringColor:["ring-transparent","ring-current","ring-black","ring-white"],ringOffsetColor:["ring-offset-transparent","ring-offset-current","ring-offset-black","ring-offset-white"],ringOffsetWidth:["ring-offset-0","ring-offset-1","ring-offset-2","ring-offset-4","ring-offset-8"],ringWidth:["ring-0","ring-1","ring-2","ring-4","ring-8"],rotate:["rotate-0","rotate-1","rotate-2","rotate-3","rotate-6","rotate-12","rotate-45","rotate-90","rotate-180"],rowGap:["gap-y-0","gap-y-0.5","gap-y-1","gap-y-1.5","gap-y-2","gap-y-2.5","gap-y-3","gap-y-4","gap-y-5","gap-y-6","gap-y-8","gap-y-10","gap-y-12","gap-y-16"],scale:["scale-0","scale-50","scale-75","scale-90","scale-95","scale-100","scale-105","scale-110","scale-125","scale-150"],scrollBehavior:["scroll-auto","scroll-smooth"],scrollMargin:["scroll-m-0","scroll-m-px","scroll-m-0.5","scroll-m-1","scroll-m-2","scroll-m-3","scroll-m-4","scroll-m-6","scroll-m-8","scroll-m-12","scroll-m-16"],scrollMarginX:["scroll-mx-0","scroll-mx-px","scroll-mx-0.5","scroll-mx-1","scroll-mx-2","scroll-mx-3","scroll-mx-4","scroll-mx-6","scroll-mx-8","scroll-mx-12","scroll-mx-16"],scrollMarginY:["scroll-my-0","scroll-my-px","scroll-my-0.5","scroll-my-1","scroll-my-2","scroll-my-3","scroll-my-4","scroll-my-6","scroll-my-8","scroll-my-12","scroll-my-16"],scrollMarginTop:["scroll-mt-0","scroll-mt-px","scroll-mt-0.5","scroll-mt-1","scroll-mt-2","scroll-mt-3","scroll-mt-4","scroll-mt-6","scroll-mt-8","scroll-mt-12","scroll-mt-16"],scrollMarginBottom:["scroll-mb-0","scroll-mb-px","scroll-mb-0.5","scroll-mb-1","scroll-mb-2","scroll-mb-3","scroll-mb-4","scroll-mb-6","scroll-mb-8","scroll-mb-12","scroll-mb-16"],scrollMarginStart:["scroll-ms-0","scroll-ms-px","scroll-ms-0.5","scroll-ms-1","scroll-ms-2","scroll-ms-3","scroll-ms-4","scroll-ms-6","scroll-ms-8","scroll-ms-12","scroll-ms-16"],scrollMarginEnd:["scroll-me-0","scroll-me-px","scroll-me-0.5","scroll-me-1","scroll-me-2","scroll-me-3","scroll-me-4","scroll-me-6","scroll-me-8","scroll-me-12","scroll-me-16"],scrollPadding:["scroll-p-0","scroll-p-px","scroll-p-0.5","scroll-p-1","scroll-p-2","scroll-p-3","scroll-p-4","scroll-p-6","scroll-p-8","scroll-p-12","scroll-p-16"],scrollPaddingX:["scroll-px-0","scroll-px-px","scroll-px-0.5","scroll-px-1","scroll-px-2","scroll-px-3","scroll-px-4","scroll-px-6","scroll-px-8","scroll-px-12","scroll-px-16"],scrollPaddingY:["scroll-py-0","scroll-py-px","scroll-py-0.5","scroll-py-1","scroll-py-2","scroll-py-3","scroll-py-4","scroll-py-6","scroll-py-8","scroll-py-12","scroll-py-16"],scrollPaddingTop:["scroll-pt-0","scroll-pt-px","scroll-pt-0.5","scroll-pt-1","scroll-pt-2","scroll-pt-3","scroll-pt-4","scroll-pt-6","scroll-pt-8","scroll-pt-12","scroll-pt-16"],scrollPaddingBottom:["scroll-pb-0","scroll-pb-px","scroll-pb-0.5","scroll-pb-1","scroll-pb-2","scroll-pb-3","scroll-pb-4","scroll-pb-6","scroll-pb-8","scroll-pb-12","scroll-pb-16"],scrollPaddingStart:["scroll-ps-0","scroll-ps-px","scroll-ps-0.5","scroll-ps-1","scroll-ps-2","scroll-ps-3","scroll-ps-4","scroll-ps-6","scroll-ps-8","scroll-ps-12","scroll-ps-16"],scrollPaddingEnd:["scroll-pe-0","scroll-pe-px","scroll-pe-0.5","scroll-pe-1","scroll-pe-2","scroll-pe-3","scroll-pe-4","scroll-pe-6","scroll-pe-8","scroll-pe-12","scroll-pe-16"],size:["size-0","size-px","size-0.5","size-1","size-2","size-3","size-4","size-6","size-8","size-10","size-12","size-16","size-20","size-24"],strokeWidth:["stroke-0","stroke-1","stroke-2"],scrollSnapAlign:["snap-start","snap-end","snap-center","snap-align-none"],scrollSnapStop:["snap-normal","snap-always"],scrollSnapType:["snap-none","snap-x","snap-y","snap-both","snap-mandatory"],skew:["skew-x-0","skew-x-1","skew-x-2","skew-x-3","skew-x-6","skew-x-12","skew-y-0","skew-y-1","skew-y-2","skew-y-3","skew-y-6","skew-y-12"],stroke:["stroke-none","stroke-current"],tableLayout:["table-auto","table-fixed"],textAlign:["text-left","text-center","text-right","text-justify","text-start","text-end"],textColor:["text-transparent","text-current","text-black","text-white"],textDecoration:["underline","overline","line-through","no-underline"],textDecorationColor:["decoration-transparent","decoration-current","decoration-black","decoration-white"],textDecorationStyle:["decoration-solid","decoration-double","decoration-dotted","decoration-dashed","decoration-wavy"],textDecorationThickness:["decoration-auto","decoration-from-font","decoration-0","decoration-1","decoration-2","decoration-4","decoration-8"],textIndent:["indent-0","indent-1","indent-2","indent-3","indent-4","indent-8"],textOverflow:["truncate","text-ellipsis","text-clip"],textTransform:["uppercase","lowercase","capitalize","normal-case"],textUnderlineOffset:["underline-offset-auto","underline-offset-0","underline-offset-1","underline-offset-2","underline-offset-4","underline-offset-8"],transform:["transform","transform-gpu","transform-none"],transformOrigin:["origin-center","origin-top","origin-top-right","origin-right","origin-bottom-right","origin-bottom","origin-bottom-left","origin-left","origin-top-left"],transition:["transition-none","transition-all","transition","transition-colors","transition-opacity","transition-shadow","transition-transform"],transitionDelay:["delay-0","delay-75","delay-100","delay-150","delay-200","delay-300","delay-500","delay-700","delay-1000"],transitionDuration:["duration-0","duration-75","duration-100","duration-150","duration-200","duration-300","duration-500","duration-700","duration-1000"],transitionProperty:["transition-none","transition-all","transition","transition-colors","transition-opacity","transition-shadow","transition-transform"],transitionTimingFunction:["ease-linear","ease-in","ease-out","ease-in-out"],translate:["translate-x-0","translate-x-1","translate-x-2","translate-x-3","translate-x-4","translate-y-0","translate-y-1","translate-y-2","translate-y-3","translate-y-4"],userSelect:["select-none","select-text","select-all","select-auto"],verticalAlign:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"],visibility:["visible","invisible","collapse"],whiteSpace:["whitespace-normal","whitespace-nowrap","whitespace-pre","whitespace-pre-line","whitespace-pre-wrap","whitespace-break-spaces"],width:["w-auto","w-full","w-screen","w-dvh","w-svh","w-lvh","w-min","w-max","w-fit"],willChange:["will-change-auto","will-change-scroll","will-change-contents","will-change-transform"],wordBreak:["break-normal","break-words","break-all","break-keep"],writingMode:["writing-mode-horizontal-tb","writing-mode-vertical-rl","writing-mode-vertical-lr"],zIndex:["z-0","z-10","z-20","z-30","z-40","z-50","z-auto"]},exports.tailwindSelectorVariants=[{label:"Default",value:""},{label:"sm",value:"sm:"},{label:"md",value:"md:"},{label:"lg",value:"lg:"},{label:"xl",value:"xl:"},{label:"2xl",value:"2xl:"},{label:"hover",value:"hover:"},{label:"focus",value:"focus:"},{label:"active",value:"active:"},{label:"visited",value:"visited:"},{label:"disabled",value:"disabled:"},{label:"focus-within",value:"focus-within:"},{label:"focus-visible",value:"focus-visible:"},{label:"checked",value:"checked:"},{label:"placeholder-shown",value:"placeholder-shown:"},{label:"read-only",value:"read-only:"},{label:"required",value:"required:"},{label:"valid",value:"valid:"},{label:"invalid",value:"invalid:"},{label:"first",value:"first:"},{label:"last",value:"last:"},{label:"odd",value:"odd:"},{label:"even",value:"even:"},{label:"only",value:"only:"},{label:"first-of-type",value:"first-of-type:"},{label:"last-of-type",value:"last-of-type:"},{label:"group-hover",value:"group-hover:"},{label:"group-focus",value:"group-focus:"},{label:"group-active",value:"group-active:"},{label:"peer-hover",value:"peer-hover:"},{label:"peer-focus",value:"peer-focus:"},{label:"peer-checked",value:"peer-checked:"},{label:"dark",value:"dark:"},{label:"motion-safe",value:"motion-safe:"},{label:"motion-reduce",value:"motion-reduce:"},{label:"contrast-more",value:"contrast-more:"},{label:"contrast-less",value:"contrast-less:"},{label:"rtl",value:"rtl:"},{label:"ltr",value:"ltr:"},{label:"portrait",value:"portrait:"},{label:"landscape",value:"landscape:"},{label:"aria-checked",value:"aria-checked:"},{label:"aria-selected",value:"aria-selected:"},{label:"aria-expanded",value:"aria-expanded:"},{label:"before",value:"before:"},{label:"after",value:"after:"},{label:"placeholder",value:"placeholder:"},{label:"selection",value:"selection:"},{label:"marker",value:"marker:"},{label:"file",value:"file:"},{label:"backdrop",value:"backdrop:"}];
2
+ //# sourceMappingURL=index.cjs.js.map