@wix/auto-patterns 1.4.0 → 1.5.0

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 (311) hide show
  1. package/dist/cjs/collectionData/CollectionData.js +4 -0
  2. package/dist/cjs/collectionData/CollectionData.js.map +1 -0
  3. package/dist/cjs/collectionData/CollectionDataFactory.js +12 -0
  4. package/dist/cjs/collectionData/CollectionDataFactory.js.map +1 -0
  5. package/dist/cjs/collectionData/SchemaFactory.js +12 -0
  6. package/dist/cjs/collectionData/SchemaFactory.js.map +1 -0
  7. package/dist/cjs/{config/cms/CmsCompositeConfig.js → collectionData/cms/CmsCollectionData.js} +26 -10
  8. package/dist/cjs/collectionData/cms/CmsCollectionData.js.map +1 -0
  9. package/dist/cjs/{config → collectionData}/cms/filterUtils.js +24 -10
  10. package/dist/cjs/collectionData/cms/filterUtils.js.map +1 -0
  11. package/dist/cjs/collectionData/cms/sortUtils.js.map +1 -0
  12. package/dist/cjs/collectionData/constants.js +13 -0
  13. package/dist/cjs/collectionData/constants.js.map +1 -0
  14. package/dist/cjs/collectionData/index.js +10 -0
  15. package/dist/cjs/collectionData/index.js.map +1 -0
  16. package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.js +47 -0
  17. package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -0
  18. package/dist/cjs/components/AutoPatternsApp/index.js +10 -0
  19. package/dist/cjs/components/AutoPatternsApp/index.js.map +1 -0
  20. package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +22 -33
  21. package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
  22. package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +33 -142
  23. package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
  24. package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +164 -0
  25. package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -0
  26. package/dist/cjs/components/AutoPatternsEntityPage/Fields/Checkbox.js +33 -0
  27. package/dist/cjs/components/AutoPatternsEntityPage/Fields/Checkbox.js.map +1 -0
  28. package/dist/cjs/components/AutoPatternsEntityPage/Fields/FormFieldInput.js +50 -0
  29. package/dist/cjs/components/AutoPatternsEntityPage/Fields/FormFieldInput.js.map +1 -0
  30. package/dist/cjs/components/AutoPatternsEntityPage/Fields/ShortText.js +60 -0
  31. package/dist/cjs/components/AutoPatternsEntityPage/Fields/ShortText.js.map +1 -0
  32. package/dist/cjs/components/AutoPatternsEntityPage/index.js +10 -0
  33. package/dist/cjs/components/AutoPatternsEntityPage/index.js.map +1 -0
  34. package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.js +35 -0
  35. package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -0
  36. package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGridContent.js +44 -0
  37. package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGridContent.js.map +1 -0
  38. package/dist/cjs/components/AutoPatternsGrid/index.js +10 -0
  39. package/dist/cjs/components/AutoPatternsGrid/index.js.map +1 -0
  40. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js +61 -0
  41. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -0
  42. package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js +35 -0
  43. package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -0
  44. package/dist/cjs/components/AutoPatternsTable/AutoPatternsTableContent.js +55 -0
  45. package/dist/cjs/components/AutoPatternsTable/AutoPatternsTableContent.js.map +1 -0
  46. package/dist/cjs/components/AutoPatternsTable/index.js +10 -0
  47. package/dist/cjs/components/AutoPatternsTable/index.js.map +1 -0
  48. package/dist/cjs/exports/react.js +7 -0
  49. package/dist/cjs/exports/react.js.map +1 -1
  50. package/dist/cjs/hooks/index.js +16 -4
  51. package/dist/cjs/hooks/index.js.map +1 -1
  52. package/dist/cjs/hooks/useColumns.js +2 -5
  53. package/dist/cjs/hooks/useColumns.js.map +1 -1
  54. package/dist/cjs/hooks/useCommonCollectionFeatures.js +109 -0
  55. package/dist/cjs/hooks/useCommonCollectionFeatures.js.map +1 -0
  56. package/dist/cjs/hooks/useEmptyStates.js +2 -7
  57. package/dist/cjs/hooks/useEmptyStates.js.map +1 -1
  58. package/dist/cjs/hooks/useFetchData.js +7 -8
  59. package/dist/cjs/hooks/useFetchData.js.map +1 -1
  60. package/dist/cjs/hooks/useFilters.js +72 -76
  61. package/dist/cjs/hooks/useFilters.js.map +1 -1
  62. package/dist/cjs/hooks/useGridFeatures.js +77 -0
  63. package/dist/cjs/hooks/useGridFeatures.js.map +1 -0
  64. package/dist/cjs/hooks/useTableFeatures.js +69 -0
  65. package/dist/cjs/hooks/useTableFeatures.js.map +1 -0
  66. package/dist/cjs/providers/CollectionDataContext.js +44 -0
  67. package/dist/cjs/providers/CollectionDataContext.js.map +1 -0
  68. package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +1 -1
  69. package/dist/cjs/providers/{ConfigContext.js → SchemaContext.js} +21 -20
  70. package/dist/cjs/providers/SchemaContext.js.map +1 -0
  71. package/dist/cjs/providers/index.js +4 -4
  72. package/dist/cjs/providers/index.js.map +1 -1
  73. package/dist/cjs/react.js +4 -4
  74. package/dist/cjs/react.js.map +1 -1
  75. package/dist/cjs/{types.js → types/CollectionPageConfig.js} +3 -9
  76. package/dist/cjs/types/CollectionPageConfig.js.map +1 -0
  77. package/dist/cjs/types/EntityPageConfig.js +4 -0
  78. package/dist/cjs/types/EntityPageConfig.js.map +1 -0
  79. package/dist/cjs/types/index.js +22 -0
  80. package/dist/cjs/types/index.js.map +1 -0
  81. package/dist/cjs/types/types.js +4 -0
  82. package/dist/cjs/types/types.js.map +1 -0
  83. package/dist/cjs/utils/filters.js +53 -0
  84. package/dist/cjs/utils/filters.js.map +1 -0
  85. package/dist/esm/collectionData/CollectionData.js +2 -0
  86. package/dist/esm/collectionData/CollectionData.js.map +1 -0
  87. package/dist/esm/collectionData/CollectionDataFactory.js +8 -0
  88. package/dist/esm/collectionData/CollectionDataFactory.js.map +1 -0
  89. package/dist/esm/collectionData/SchemaFactory.js +8 -0
  90. package/dist/esm/collectionData/SchemaFactory.js.map +1 -0
  91. package/dist/esm/{config/cms/CmsCompositeConfig.js → collectionData/cms/CmsCollectionData.js} +25 -9
  92. package/dist/esm/collectionData/cms/CmsCollectionData.js.map +1 -0
  93. package/dist/esm/{config → collectionData}/cms/filterUtils.js +25 -11
  94. package/dist/esm/collectionData/cms/filterUtils.js.map +1 -0
  95. package/dist/esm/collectionData/cms/sortUtils.js.map +1 -0
  96. package/dist/esm/collectionData/constants.js +9 -0
  97. package/dist/esm/collectionData/constants.js.map +1 -0
  98. package/dist/esm/collectionData/index.js +2 -0
  99. package/dist/esm/collectionData/index.js.map +1 -0
  100. package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js +22 -0
  101. package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -0
  102. package/dist/esm/components/AutoPatternsApp/index.js +2 -0
  103. package/dist/esm/components/AutoPatternsApp/index.js.map +1 -0
  104. package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +11 -13
  105. package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
  106. package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +31 -109
  107. package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
  108. package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +82 -0
  109. package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -0
  110. package/dist/esm/components/AutoPatternsEntityPage/Fields/Checkbox.js +19 -0
  111. package/dist/esm/components/AutoPatternsEntityPage/Fields/Checkbox.js.map +1 -0
  112. package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js +37 -0
  113. package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js.map +1 -0
  114. package/dist/esm/components/AutoPatternsEntityPage/Fields/ShortText.js +40 -0
  115. package/dist/esm/components/AutoPatternsEntityPage/Fields/ShortText.js.map +1 -0
  116. package/dist/esm/components/AutoPatternsEntityPage/index.js +2 -0
  117. package/dist/esm/components/AutoPatternsEntityPage/index.js.map +1 -0
  118. package/dist/esm/components/AutoPatternsGrid/AutoPatternsGrid.js +16 -0
  119. package/dist/esm/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -0
  120. package/dist/esm/components/AutoPatternsGrid/AutoPatternsGridContent.js +32 -0
  121. package/dist/esm/components/AutoPatternsGrid/AutoPatternsGridContent.js.map +1 -0
  122. package/dist/esm/components/AutoPatternsGrid/index.js +2 -0
  123. package/dist/esm/components/AutoPatternsGrid/index.js.map +1 -0
  124. package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js +37 -0
  125. package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -0
  126. package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js +16 -0
  127. package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -0
  128. package/dist/esm/components/AutoPatternsTable/AutoPatternsTableContent.js +43 -0
  129. package/dist/esm/components/AutoPatternsTable/AutoPatternsTableContent.js.map +1 -0
  130. package/dist/esm/components/AutoPatternsTable/index.js +2 -0
  131. package/dist/esm/components/AutoPatternsTable/index.js.map +1 -0
  132. package/dist/esm/exports/react.js +1 -0
  133. package/dist/esm/exports/react.js.map +1 -1
  134. package/dist/esm/hooks/index.js +3 -1
  135. package/dist/esm/hooks/index.js.map +1 -1
  136. package/dist/esm/hooks/useColumns.js +3 -6
  137. package/dist/esm/hooks/useColumns.js.map +1 -1
  138. package/dist/esm/hooks/useCommonCollectionFeatures.js +72 -0
  139. package/dist/esm/hooks/useCommonCollectionFeatures.js.map +1 -0
  140. package/dist/esm/hooks/useEmptyStates.js +2 -7
  141. package/dist/esm/hooks/useEmptyStates.js.map +1 -1
  142. package/dist/esm/hooks/useFetchData.js +8 -9
  143. package/dist/esm/hooks/useFetchData.js.map +1 -1
  144. package/dist/esm/hooks/useFilters.js +63 -75
  145. package/dist/esm/hooks/useFilters.js.map +1 -1
  146. package/dist/esm/hooks/useGridFeatures.js +75 -0
  147. package/dist/esm/hooks/useGridFeatures.js.map +1 -0
  148. package/dist/esm/hooks/useTableFeatures.js +58 -0
  149. package/dist/esm/hooks/useTableFeatures.js.map +1 -0
  150. package/dist/esm/providers/CollectionDataContext.js +30 -0
  151. package/dist/esm/providers/CollectionDataContext.js.map +1 -0
  152. package/dist/esm/providers/PatternsWizardOverridesContext.js +1 -1
  153. package/dist/esm/providers/PatternsWizardOverridesContext.js.map +1 -1
  154. package/dist/esm/providers/SchemaContext.js +30 -0
  155. package/dist/esm/providers/SchemaContext.js.map +1 -0
  156. package/dist/esm/providers/index.js +1 -1
  157. package/dist/esm/providers/index.js.map +1 -1
  158. package/dist/esm/react.js +1 -1
  159. package/dist/esm/react.js.map +1 -1
  160. package/dist/esm/{types.js → types/CollectionPageConfig.js} +1 -9
  161. package/dist/esm/types/CollectionPageConfig.js.map +1 -0
  162. package/dist/esm/types/EntityPageConfig.js +2 -0
  163. package/dist/esm/types/EntityPageConfig.js.map +1 -0
  164. package/dist/esm/types/index.js +4 -0
  165. package/dist/esm/types/index.js.map +1 -0
  166. package/dist/esm/types/types.js +2 -0
  167. package/dist/esm/types/types.js.map +1 -0
  168. package/dist/esm/utils/filters.js +49 -0
  169. package/dist/esm/utils/filters.js.map +1 -0
  170. package/dist/types/collectionData/CollectionData.d.ts +9 -0
  171. package/dist/types/collectionData/CollectionData.d.ts.map +1 -0
  172. package/dist/types/collectionData/CollectionDataFactory.d.ts +4 -0
  173. package/dist/types/collectionData/CollectionDataFactory.d.ts.map +1 -0
  174. package/dist/types/collectionData/SchemaFactory.d.ts +3 -0
  175. package/dist/types/collectionData/SchemaFactory.d.ts.map +1 -0
  176. package/dist/types/collectionData/cms/CmsCollectionData.d.ts +8 -0
  177. package/dist/types/collectionData/cms/CmsCollectionData.d.ts.map +1 -0
  178. package/dist/types/{config → collectionData}/cms/filterUtils.d.ts +3 -3
  179. package/dist/types/collectionData/cms/filterUtils.d.ts.map +1 -0
  180. package/dist/types/collectionData/cms/sortUtils.d.ts.map +1 -0
  181. package/dist/types/{config → collectionData}/constants.d.ts +4 -0
  182. package/dist/types/collectionData/constants.d.ts.map +1 -0
  183. package/dist/types/collectionData/index.d.ts +2 -0
  184. package/dist/types/collectionData/index.d.ts.map +1 -0
  185. package/dist/types/components/AutoPatternsApp/AutoPatternsApp.d.ts +7 -0
  186. package/dist/types/components/AutoPatternsApp/AutoPatternsApp.d.ts.map +1 -0
  187. package/dist/types/components/AutoPatternsApp/index.d.ts +2 -0
  188. package/dist/types/components/AutoPatternsApp/index.d.ts.map +1 -0
  189. package/dist/types/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.d.ts +2 -2
  190. package/dist/types/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.d.ts.map +1 -1
  191. package/dist/types/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.d.ts +5 -1
  192. package/dist/types/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.d.ts.map +1 -1
  193. package/dist/types/components/AutoPatternsEntityPage/AutoPatternsEntityPage.d.ts +7 -0
  194. package/dist/types/components/AutoPatternsEntityPage/AutoPatternsEntityPage.d.ts.map +1 -0
  195. package/dist/types/components/AutoPatternsEntityPage/Fields/Checkbox.d.ts +6 -0
  196. package/dist/types/components/AutoPatternsEntityPage/Fields/Checkbox.d.ts.map +1 -0
  197. package/dist/types/components/AutoPatternsEntityPage/Fields/FormFieldInput.d.ts +14 -0
  198. package/dist/types/components/AutoPatternsEntityPage/Fields/FormFieldInput.d.ts.map +1 -0
  199. package/dist/types/components/AutoPatternsEntityPage/Fields/ShortText.d.ts +13 -0
  200. package/dist/types/components/AutoPatternsEntityPage/Fields/ShortText.d.ts.map +1 -0
  201. package/dist/types/components/AutoPatternsEntityPage/index.d.ts +2 -0
  202. package/dist/types/components/AutoPatternsEntityPage/index.d.ts.map +1 -0
  203. package/dist/types/components/AutoPatternsGrid/AutoPatternsGrid.d.ts +7 -0
  204. package/dist/types/components/AutoPatternsGrid/AutoPatternsGrid.d.ts.map +1 -0
  205. package/dist/types/components/AutoPatternsGrid/AutoPatternsGridContent.d.ts +7 -0
  206. package/dist/types/components/AutoPatternsGrid/AutoPatternsGridContent.d.ts.map +1 -0
  207. package/dist/types/components/AutoPatternsGrid/index.d.ts +2 -0
  208. package/dist/types/components/AutoPatternsGrid/index.d.ts.map +1 -0
  209. package/dist/types/components/AutoPatternsRoute/AutoPatternsPage.d.ts +7 -0
  210. package/dist/types/components/AutoPatternsRoute/AutoPatternsPage.d.ts.map +1 -0
  211. package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts +7 -0
  212. package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts.map +1 -0
  213. package/dist/types/components/AutoPatternsTable/AutoPatternsTableContent.d.ts +7 -0
  214. package/dist/types/components/AutoPatternsTable/AutoPatternsTableContent.d.ts.map +1 -0
  215. package/dist/types/components/AutoPatternsTable/index.d.ts +2 -0
  216. package/dist/types/components/AutoPatternsTable/index.d.ts.map +1 -0
  217. package/dist/types/exports/react.d.ts +1 -0
  218. package/dist/types/exports/react.d.ts.map +1 -1
  219. package/dist/types/hooks/index.d.ts +3 -1
  220. package/dist/types/hooks/index.d.ts.map +1 -1
  221. package/dist/types/hooks/useColumns.d.ts +2 -1
  222. package/dist/types/hooks/useColumns.d.ts.map +1 -1
  223. package/dist/types/hooks/useCommonCollectionFeatures.d.ts +15 -0
  224. package/dist/types/hooks/useCommonCollectionFeatures.d.ts.map +1 -0
  225. package/dist/types/hooks/useEmptyStates.d.ts +2 -1
  226. package/dist/types/hooks/useEmptyStates.d.ts.map +1 -1
  227. package/dist/types/hooks/useFetchData.d.ts +2 -1
  228. package/dist/types/hooks/useFetchData.d.ts.map +1 -1
  229. package/dist/types/hooks/useFilters.d.ts +7 -2
  230. package/dist/types/hooks/useFilters.d.ts.map +1 -1
  231. package/dist/types/hooks/useGridFeatures.d.ts +25 -0
  232. package/dist/types/hooks/useGridFeatures.d.ts.map +1 -0
  233. package/dist/types/hooks/useTableFeatures.d.ts +19 -0
  234. package/dist/types/hooks/useTableFeatures.d.ts.map +1 -0
  235. package/dist/types/providers/CollectionDataContext.d.ts +12 -0
  236. package/dist/types/providers/CollectionDataContext.d.ts.map +1 -0
  237. package/dist/types/providers/PatternsWizardOverridesContext.d.ts +2 -2
  238. package/dist/types/providers/SchemaContext.d.ts +11 -0
  239. package/dist/types/providers/SchemaContext.d.ts.map +1 -0
  240. package/dist/types/providers/index.d.ts +1 -1
  241. package/dist/types/providers/index.d.ts.map +1 -1
  242. package/dist/types/react.d.ts +1 -1
  243. package/dist/types/react.d.ts.map +1 -1
  244. package/dist/types/types/CollectionPageConfig.d.ts +166 -0
  245. package/dist/types/types/CollectionPageConfig.d.ts.map +1 -0
  246. package/dist/types/types/EntityPageConfig.d.ts +17 -0
  247. package/dist/types/types/EntityPageConfig.d.ts.map +1 -0
  248. package/dist/types/types/index.d.ts +4 -0
  249. package/dist/types/types/index.d.ts.map +1 -0
  250. package/dist/types/types/types.d.ts +49 -0
  251. package/dist/types/types/types.d.ts.map +1 -0
  252. package/dist/types/utils/filters.d.ts +7 -0
  253. package/dist/types/utils/filters.d.ts.map +1 -0
  254. package/package.json +24 -23
  255. package/dist/cjs/config/CompositeConfig.js +0 -4
  256. package/dist/cjs/config/CompositeConfig.js.map +0 -1
  257. package/dist/cjs/config/ConfigFactory.js +0 -12
  258. package/dist/cjs/config/ConfigFactory.js.map +0 -1
  259. package/dist/cjs/config/cms/CmsCompositeConfig.js.map +0 -1
  260. package/dist/cjs/config/cms/filterUtils.js.map +0 -1
  261. package/dist/cjs/config/cms/sortUtils.js.map +0 -1
  262. package/dist/cjs/config/constants.js +0 -9
  263. package/dist/cjs/config/constants.js.map +0 -1
  264. package/dist/cjs/config/index.js +0 -10
  265. package/dist/cjs/config/index.js.map +0 -1
  266. package/dist/cjs/hooks/useFeatures.js +0 -50
  267. package/dist/cjs/hooks/useFeatures.js.map +0 -1
  268. package/dist/cjs/hooks/useTableProps.js +0 -34
  269. package/dist/cjs/hooks/useTableProps.js.map +0 -1
  270. package/dist/cjs/providers/ConfigContext.js.map +0 -1
  271. package/dist/cjs/types.js.map +0 -1
  272. package/dist/esm/config/CompositeConfig.js +0 -2
  273. package/dist/esm/config/CompositeConfig.js.map +0 -1
  274. package/dist/esm/config/ConfigFactory.js +0 -8
  275. package/dist/esm/config/ConfigFactory.js.map +0 -1
  276. package/dist/esm/config/cms/CmsCompositeConfig.js.map +0 -1
  277. package/dist/esm/config/cms/filterUtils.js.map +0 -1
  278. package/dist/esm/config/cms/sortUtils.js.map +0 -1
  279. package/dist/esm/config/constants.js +0 -5
  280. package/dist/esm/config/constants.js.map +0 -1
  281. package/dist/esm/config/index.js +0 -2
  282. package/dist/esm/config/index.js.map +0 -1
  283. package/dist/esm/hooks/useFeatures.js +0 -22
  284. package/dist/esm/hooks/useFeatures.js.map +0 -1
  285. package/dist/esm/hooks/useTableProps.js +0 -29
  286. package/dist/esm/hooks/useTableProps.js.map +0 -1
  287. package/dist/esm/providers/ConfigContext.js +0 -29
  288. package/dist/esm/providers/ConfigContext.js.map +0 -1
  289. package/dist/esm/types.js.map +0 -1
  290. package/dist/types/config/CompositeConfig.d.ts +0 -8
  291. package/dist/types/config/CompositeConfig.d.ts.map +0 -1
  292. package/dist/types/config/ConfigFactory.d.ts +0 -4
  293. package/dist/types/config/ConfigFactory.d.ts.map +0 -1
  294. package/dist/types/config/cms/CmsCompositeConfig.d.ts +0 -7
  295. package/dist/types/config/cms/CmsCompositeConfig.d.ts.map +0 -1
  296. package/dist/types/config/cms/filterUtils.d.ts.map +0 -1
  297. package/dist/types/config/cms/sortUtils.d.ts.map +0 -1
  298. package/dist/types/config/constants.d.ts.map +0 -1
  299. package/dist/types/config/index.d.ts +0 -2
  300. package/dist/types/config/index.d.ts.map +0 -1
  301. package/dist/types/hooks/useFeatures.d.ts +0 -8
  302. package/dist/types/hooks/useFeatures.d.ts.map +0 -1
  303. package/dist/types/hooks/useTableProps.d.ts +0 -13
  304. package/dist/types/hooks/useTableProps.d.ts.map +0 -1
  305. package/dist/types/providers/ConfigContext.d.ts +0 -11
  306. package/dist/types/providers/ConfigContext.d.ts.map +0 -1
  307. package/dist/types/types.d.ts +0 -211
  308. package/dist/types/types.d.ts.map +0 -1
  309. /package/dist/cjs/{config → collectionData}/cms/sortUtils.js +0 -0
  310. /package/dist/esm/{config → collectionData}/cms/sortUtils.js +0 -0
  311. /package/dist/types/{config → collectionData}/cms/sortUtils.d.ts +0 -0
@@ -3,161 +3,52 @@
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  exports.__esModule = true;
5
5
  exports.AutoPatternsCollectionPageContent = void 0;
6
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
7
6
  var _react = _interopRequireDefault(require("react"));
8
- var _patterns = require("@wix/patterns");
9
- var _hooks = require("../../hooks");
10
- var _providers = require("../../providers");
11
- var _wixUiIconsCommon = require("@wix/wix-ui-icons-common");
12
- var _designSystem = require("@wix/design-system");
7
+ var _AutoPatternsTable = require("../AutoPatternsTable");
8
+ var _AutoPatternsGrid = require("../AutoPatternsGrid");
13
9
  var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.tsx";
14
- const AutoPatternsCollectionPageContent = () => {
15
- var _toolbarTitle$subtitl, _toolbarTitle$subtitl2, _toolbarTitle$subtitl3, _toolbarTitle$subtitl4, _toolbarTitle$subtitl5, _toolbarTitle$subtitl6, _toolbarTitle$subtitl7;
16
- const config = (0, _providers.useConfig)();
10
+ const AutoPatternsCollectionPageContent = ({
11
+ configuration
12
+ }) => {
17
13
  const {
18
- page: {
19
- pageTitle,
20
- collectionId,
21
- actions: secondaryActions = [],
22
- search,
23
- toolbarTitle,
24
- limit,
25
- persistQueryToUrl,
26
- disableAutoSelectAllCount,
27
- selectionConsistencyMode
28
- }
29
- } = config;
30
- const context = (0, _providers.usePatternsWizardOverridesContext)();
31
- const {
32
- columns,
33
- views,
34
- dataExtension,
35
- customColumns,
36
- filters: {
37
- filters,
38
- components,
39
- collectionToolbarFiltersProps
40
- },
41
- emptyState,
42
- fetchData
43
- } = (0, _hooks.useTableProps)();
44
- const tableState = (0, _patterns.useTableCollection)({
45
- queryName: `${collectionId}-${pageTitle.text}`,
46
- itemKey: item => item._id,
47
- // Should be taken from some CMS extractor to avoid hardcoding
48
- itemName: item => item[config.schema.displayField],
49
- filters,
50
- toExtendedFields: item => item.extendedFields,
51
- fetchErrorMessage: ({
52
- err
53
- }) => String(err),
54
- fetchData,
55
- limit,
56
- persistQueryToUrl,
57
- disableAutoSelectAllCount,
58
- selectionConsistencyMode
59
- });
60
- const secondaryActionComponents = _react.default.useMemo(() => {
61
- if (secondaryActions.length === 0) {
62
- return undefined;
63
- }
64
- return secondaryActions.map(action => item => ({
65
- icon: /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.Edit, {
66
- __self: void 0,
67
- __source: {
68
- fileName: _jsxFileName,
69
- lineNumber: 61,
70
- columnNumber: 13
71
- }
72
- }),
73
- text: action.text,
74
- onClick: () => {
75
- var _context$actions, _context$actions$acti;
76
- context == null || (_context$actions = context.actions) == null || (_context$actions$acti = _context$actions[action.id]) == null || _context$actions$acti.call(_context$actions, {
77
- item
78
- });
79
- }
80
- }));
81
- }, [secondaryActions, context == null ? void 0 : context.actions]);
82
- return /*#__PURE__*/_react.default.createElement(_patterns.Table, {
83
- search: (search == null ? void 0 : search.shown) !== false,
84
- title: toolbarTitle && /*#__PURE__*/_react.default.createElement(_patterns.ToolbarTitle, {
85
- title: toolbarTitle.title,
86
- subtitle: {
87
- text: ((_toolbarTitle$subtitl = toolbarTitle.subtitle) == null ? void 0 : _toolbarTitle$subtitl.text) ?? '',
88
- learnMore: (_toolbarTitle$subtitl2 = toolbarTitle.subtitle) == null ? void 0 : _toolbarTitle$subtitl2.learnMore,
89
- info: ((_toolbarTitle$subtitl3 = toolbarTitle.subtitle) == null ? void 0 : _toolbarTitle$subtitl3.info) && {
90
- content: /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
91
- direction: "vertical",
92
- gap: "6px",
14
+ components
15
+ } = configuration;
16
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, components.map(component => {
17
+ const {
18
+ type
19
+ } = component;
20
+ switch (type) {
21
+ case 'Table':
22
+ if (component.table) {
23
+ return /*#__PURE__*/_react.default.createElement(_AutoPatternsTable.AutoPatternsTable, {
24
+ key: component.table.collection.collectionId,
25
+ configuration: component.table,
93
26
  __self: void 0,
94
27
  __source: {
95
28
  fileName: _jsxFileName,
96
- lineNumber: 80,
97
- columnNumber: 19
29
+ lineNumber: 22,
30
+ columnNumber: 17
98
31
  }
99
- }, /*#__PURE__*/_react.default.createElement(_designSystem.Text, {
100
- dataHook: "toolbar-title-subtitle-info-content",
101
- light: true,
102
- size: "small",
103
- __self: void 0,
104
- __source: {
105
- fileName: _jsxFileName,
106
- lineNumber: 81,
107
- columnNumber: 21
108
- }
109
- }, (_toolbarTitle$subtitl4 = toolbarTitle.subtitle) == null || (_toolbarTitle$subtitl4 = _toolbarTitle$subtitl4.info) == null ? void 0 : _toolbarTitle$subtitl4.content.text), ((_toolbarTitle$subtitl5 = toolbarTitle.subtitle) == null || (_toolbarTitle$subtitl5 = _toolbarTitle$subtitl5.info) == null ? void 0 : _toolbarTitle$subtitl5.content.link) && /*#__PURE__*/_react.default.createElement(_designSystem.TextButton, {
110
- dataHook: "toolbar-title-subtitle-info-link",
111
- size: "small",
112
- underline: "always",
113
- skin: "light",
114
- as: "a",
115
- rel: "noopener",
116
- target: "_blank",
117
- href: (_toolbarTitle$subtitl6 = toolbarTitle.subtitle) == null || (_toolbarTitle$subtitl6 = _toolbarTitle$subtitl6.info) == null ? void 0 : _toolbarTitle$subtitl6.content.link.url,
32
+ });
33
+ }
34
+ return null;
35
+ case 'Grid':
36
+ if (component.grid) {
37
+ return /*#__PURE__*/_react.default.createElement(_AutoPatternsGrid.AutoPatternsGrid, {
38
+ configuration: component.grid,
118
39
  __self: void 0,
119
40
  __source: {
120
41
  fileName: _jsxFileName,
121
- lineNumber: 89,
122
- columnNumber: 23
42
+ lineNumber: 31,
43
+ columnNumber: 22
123
44
  }
124
- }, (_toolbarTitle$subtitl7 = toolbarTitle.subtitle) == null || (_toolbarTitle$subtitl7 = _toolbarTitle$subtitl7.info) == null ? void 0 : _toolbarTitle$subtitl7.content.link.label))
45
+ });
125
46
  }
126
- },
127
- itemsLimit: toolbarTitle.itemsLimit,
128
- showTotal: toolbarTitle.showTotal,
129
- __self: void 0,
130
- __source: {
131
- fileName: _jsxFileName,
132
- lineNumber: 73,
133
- columnNumber: 11
134
- }
135
- }),
136
- dataHook: "auto-patterns-table",
137
- state: tableState,
138
- columns: columns,
139
- views: views,
140
- dataExtension: dataExtension,
141
- customColumns: customColumns,
142
- actionCell: item => ({
143
- secondaryActions: secondaryActionComponents == null ? void 0 : secondaryActionComponents.map(action => action(item))
144
- }),
145
- filters: components.length > 0 ? /*#__PURE__*/_react.default.createElement(_patterns.CollectionToolbarFilters, (0, _extends2.default)({}, collectionToolbarFiltersProps, {
146
- __self: void 0,
147
- __source: {
148
- fileName: _jsxFileName,
149
- lineNumber: 124,
150
- columnNumber: 11
151
- }
152
- }), components) : undefined,
153
- emptyState: emptyState,
154
- __self: void 0,
155
- __source: {
156
- fileName: _jsxFileName,
157
- lineNumber: 69,
158
- columnNumber: 5
47
+ return null;
48
+ default:
49
+ return null;
159
50
  }
160
- });
51
+ }));
161
52
  };
162
53
  exports.AutoPatternsCollectionPageContent = AutoPatternsCollectionPageContent;
163
54
  //# sourceMappingURL=AutoPatternsCollectionPageContent.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_patterns","_hooks","_providers","_wixUiIconsCommon","_designSystem","_jsxFileName","AutoPatternsCollectionPageContent","_toolbarTitle$subtitl","_toolbarTitle$subtitl2","_toolbarTitle$subtitl3","_toolbarTitle$subtitl4","_toolbarTitle$subtitl5","_toolbarTitle$subtitl6","_toolbarTitle$subtitl7","config","useConfig","page","pageTitle","collectionId","actions","secondaryActions","search","toolbarTitle","limit","persistQueryToUrl","disableAutoSelectAllCount","selectionConsistencyMode","context","usePatternsWizardOverridesContext","columns","views","dataExtension","customColumns","filters","components","collectionToolbarFiltersProps","emptyState","fetchData","useTableProps","tableState","useTableCollection","queryName","text","itemKey","item","_id","itemName","schema","displayField","toExtendedFields","extendedFields","fetchErrorMessage","err","String","secondaryActionComponents","React","useMemo","length","undefined","map","action","icon","default","createElement","Edit","__self","__source","fileName","lineNumber","columnNumber","onClick","_context$actions","_context$actions$acti","id","call","Table","shown","title","ToolbarTitle","subtitle","learnMore","info","content","Box","direction","gap","Text","dataHook","light","size","link","TextButton","underline","skin","as","rel","target","href","url","label","itemsLimit","showTotal","state","actionCell","CollectionToolbarFilters","_extends2","exports"],"sources":["../../../../src/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.tsx"],"sourcesContent":["import React from 'react';\nimport {\n CollectionToolbarFilters,\n Table,\n ToolbarTitle,\n useTableCollection,\n} from '@wix/patterns';\nimport { useTableProps } from '../../hooks';\nimport { usePatternsWizardOverridesContext, useConfig } from '../../providers';\nimport { Edit } from '@wix/wix-ui-icons-common';\nimport { Box, Text, TextButton } from '@wix/design-system';\n\nexport const AutoPatternsCollectionPageContent: React.FC = () => {\n const config = useConfig();\n\n const {\n page: {\n pageTitle,\n collectionId,\n actions: secondaryActions = [],\n search,\n toolbarTitle,\n limit,\n persistQueryToUrl,\n disableAutoSelectAllCount,\n selectionConsistencyMode,\n },\n } = config;\n const context = usePatternsWizardOverridesContext();\n\n const {\n columns,\n views,\n dataExtension,\n customColumns,\n filters: { filters, components, collectionToolbarFiltersProps },\n emptyState,\n fetchData,\n } = useTableProps();\n\n const tableState = useTableCollection<any>({\n queryName: `${collectionId}-${pageTitle.text}`,\n itemKey: (item) => item._id, // Should be taken from some CMS extractor to avoid hardcoding\n itemName: (item) => item[config.schema.displayField],\n filters,\n toExtendedFields: (item) => item.extendedFields,\n fetchErrorMessage: ({ err }) => String(err),\n fetchData,\n limit,\n persistQueryToUrl,\n disableAutoSelectAllCount,\n selectionConsistencyMode,\n });\n\n const secondaryActionComponents = React.useMemo(() => {\n if (secondaryActions.length === 0) {\n return undefined;\n }\n\n return secondaryActions.map((action) => (item: any) => ({\n icon: <Edit />,\n text: action.text,\n onClick: () => {\n context?.actions?.[action.id]?.({ item });\n },\n }));\n }, [secondaryActions, context?.actions]);\n return (\n <Table\n search={search?.shown !== false}\n title={\n toolbarTitle && (\n <ToolbarTitle\n title={toolbarTitle.title}\n subtitle={{\n text: toolbarTitle.subtitle?.text ?? '',\n learnMore: toolbarTitle.subtitle?.learnMore,\n info: toolbarTitle.subtitle?.info && {\n content: (\n <Box direction=\"vertical\" gap=\"6px\">\n <Text\n dataHook=\"toolbar-title-subtitle-info-content\"\n light\n size=\"small\"\n >\n {toolbarTitle.subtitle?.info?.content.text}\n </Text>\n {toolbarTitle.subtitle?.info?.content.link && (\n <TextButton\n dataHook=\"toolbar-title-subtitle-info-link\"\n size=\"small\"\n underline=\"always\"\n skin=\"light\"\n as=\"a\"\n rel=\"noopener\"\n target=\"_blank\"\n href={toolbarTitle.subtitle?.info?.content.link.url}\n >\n {toolbarTitle.subtitle?.info?.content.link.label}\n </TextButton>\n )}\n </Box>\n ),\n },\n }}\n itemsLimit={toolbarTitle.itemsLimit}\n showTotal={toolbarTitle.showTotal}\n />\n )\n }\n dataHook=\"auto-patterns-table\"\n state={tableState}\n columns={columns}\n views={views}\n dataExtension={dataExtension}\n customColumns={customColumns}\n actionCell={(item) => ({\n secondaryActions: secondaryActionComponents?.map((action) =>\n action(item),\n ),\n })}\n filters={\n components.length > 0 ? (\n <CollectionToolbarFilters {...collectionToolbarFiltersProps}>\n {components}\n </CollectionToolbarFilters>\n ) : undefined\n }\n emptyState={emptyState}\n />\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAMA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAA2D,IAAAM,YAAA;AAEpD,MAAMC,iCAA2C,GAAGA,CAAA,KAAM;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA;EAC/D,MAAMC,MAAM,GAAG,IAAAC,oBAAS,EAAC,CAAC;EAE1B,MAAM;IACJC,IAAI,EAAE;MACJC,SAAS;MACTC,YAAY;MACZC,OAAO,EAAEC,gBAAgB,GAAG,EAAE;MAC9BC,MAAM;MACNC,YAAY;MACZC,KAAK;MACLC,iBAAiB;MACjBC,yBAAyB;MACzBC;IACF;EACF,CAAC,GAAGZ,MAAM;EACV,MAAMa,OAAO,GAAG,IAAAC,4CAAiC,EAAC,CAAC;EAEnD,MAAM;IACJC,OAAO;IACPC,KAAK;IACLC,aAAa;IACbC,aAAa;IACbC,OAAO,EAAE;MAAEA,OAAO;MAAEC,UAAU;MAAEC;IAA8B,CAAC;IAC/DC,UAAU;IACVC;EACF,CAAC,GAAG,IAAAC,oBAAa,EAAC,CAAC;EAEnB,MAAMC,UAAU,GAAG,IAAAC,4BAAkB,EAAM;IACzCC,SAAS,EAAE,GAAGvB,YAAY,IAAID,SAAS,CAACyB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C,MAAM,IACtDA,MAAM,CAAChB,IAAI,CACb;IACF,CAAC,CAAE;IACHX,OAAO,EACLC,UAAU,CAACuB,MAAM,GAAG,CAAC,gBACnB5D,MAAA,CAAAiE,OAAA,CAAAC,aAAA,CAAC/D,SAAA,CAAAwG,wBAAwB,MAAAC,SAAA,CAAA3C,OAAA,MAAK3B,6BAA6B;MAAA8B,MAAA;MAAAC,QAAA;QAAAC,QAAA,EAAA9D,YAAA;QAAA+D,UAAA;QAAAC,YAAA;MAAA;IAAA,IACxDnC,UACuB,CAAC,GACzBwB,SACL;IACDtB,UAAU,EAAEA,UAAW;IAAA6B,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA9D,YAAA;MAAA+D,UAAA;MAAAC,YAAA;IAAA;EAAA,CACxB,CAAC;AAEN,CAAC;AAACqC,OAAA,CAAApG,iCAAA,GAAAA,iCAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_AutoPatternsTable","_AutoPatternsGrid","_jsxFileName","AutoPatternsCollectionPageContent","configuration","components","default","createElement","Fragment","map","component","type","table","AutoPatternsTable","key","collection","collectionId","__self","__source","fileName","lineNumber","columnNumber","grid","AutoPatternsGrid","exports"],"sources":["../../../../src/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.tsx"],"sourcesContent":["import React from 'react';\nimport { AutoPatternsTable } from '../AutoPatternsTable';\nimport { CollectionPageConfig } from '../../types';\nimport { AutoPatternsGrid } from '../AutoPatternsGrid';\n\nexport interface AutoPatternsCollectionPageContentProps {\n configuration: CollectionPageConfig;\n}\n\nexport const AutoPatternsCollectionPageContent = ({\n configuration,\n}: AutoPatternsCollectionPageContentProps) => {\n const { components } = configuration;\n return (\n <>\n {components.map((component) => {\n const { type } = component;\n switch (type) {\n case 'Table':\n if (component.table) {\n return (\n <AutoPatternsTable\n key={component.table.collection.collectionId}\n configuration={component.table}\n />\n );\n }\n return null;\n case 'Grid':\n if (component.grid) {\n return <AutoPatternsGrid configuration={component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CAAArB,iCAAA,GAAAA,iCAAA","ignoreList":[]}
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ exports.__esModule = true;
5
+ exports.AutoPatternsEntityPage = void 0;
6
+ var _react = _interopRequireDefault(require("react"));
7
+ var _patterns = require("@wix/patterns");
8
+ var _form = require("@wix/patterns/form");
9
+ var _designSystem = require("@wix/design-system");
10
+ var _FormFieldInput = require("./Fields/FormFieldInput");
11
+ var _reactRouterDom = require("react-router-dom");
12
+ var _SchemaContext = require("../../providers/SchemaContext");
13
+ var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.tsx";
14
+ const AutoPatternsEntityPage = ({
15
+ configuration
16
+ }) => {
17
+ const {
18
+ title,
19
+ subtitle,
20
+ visibleFieldIds = [],
21
+ collectionPagePath: parentPath
22
+ } = configuration;
23
+ const form = (0, _form.useForm)();
24
+ const params = (0, _reactRouterDom.useParams)();
25
+ const entityId = params.entityId;
26
+ const schema = (0, _SchemaContext.useSchema)();
27
+ const state = (0, _patterns.useEntityPage)({
28
+ parentPath,
29
+ form,
30
+ onSave: async () => {
31
+ var _state$entity;
32
+ const formValues = form.getValues();
33
+ const updatedEntity = {
34
+ ...state.entity,
35
+ ...formValues
36
+ };
37
+ let newUpdatedEntity;
38
+ // TODO: Works only for CMS collections, need to be extracted from collection data somehow or share similar context
39
+ if ((_state$entity = state.entity) != null && _state$entity._id) {
40
+ newUpdatedEntity = await schema.actions.update(updatedEntity);
41
+ } else {
42
+ newUpdatedEntity = await schema.actions.create(updatedEntity);
43
+ }
44
+ return {
45
+ updatedEntity: newUpdatedEntity
46
+ };
47
+ },
48
+ saveErrorToast: () => 'Failed to save',
49
+ fetch: async () => {
50
+ if (!entityId) {
51
+ return {
52
+ entity: undefined
53
+ };
54
+ }
55
+ const entity = await schema.actions.get(entityId);
56
+ return {
57
+ entity
58
+ };
59
+ }
60
+ });
61
+ const entity = (0, _patterns.useEntity)(state);
62
+ return /*#__PURE__*/_react.default.createElement(_patterns.EntityPage, {
63
+ state: state,
64
+ dataHook: "auto-patterns-entity-page",
65
+ __self: void 0,
66
+ __source: {
67
+ fileName: _jsxFileName,
68
+ lineNumber: 65,
69
+ columnNumber: 5
70
+ }
71
+ }, /*#__PURE__*/_react.default.createElement(_patterns.EntityPage.Header, {
72
+ title: title ?? {
73
+ text: (entity == null ? void 0 : entity[schema.displayField]) ?? 'Edit Entity'
74
+ },
75
+ subtitle: subtitle,
76
+ __self: void 0,
77
+ __source: {
78
+ fileName: _jsxFileName,
79
+ lineNumber: 66,
80
+ columnNumber: 7
81
+ }
82
+ }), /*#__PURE__*/_react.default.createElement(_patterns.EntityPage.Content, {
83
+ __self: void 0,
84
+ __source: {
85
+ fileName: _jsxFileName,
86
+ lineNumber: 72,
87
+ columnNumber: 7
88
+ }
89
+ }, /*#__PURE__*/_react.default.createElement(_patterns.EntityPage.MainContent, {
90
+ __self: void 0,
91
+ __source: {
92
+ fileName: _jsxFileName,
93
+ lineNumber: 73,
94
+ columnNumber: 9
95
+ }
96
+ }, /*#__PURE__*/_react.default.createElement(_patterns.EntityPage.Card, {
97
+ minHeight: "50px",
98
+ __self: void 0,
99
+ __source: {
100
+ fileName: _jsxFileName,
101
+ lineNumber: 74,
102
+ columnNumber: 11
103
+ }
104
+ }, /*#__PURE__*/_react.default.createElement(_designSystem.Card.Header, {
105
+ title: "Item details",
106
+ subtitle: "Modify the details of your selected item below",
107
+ __self: void 0,
108
+ __source: {
109
+ fileName: _jsxFileName,
110
+ lineNumber: 75,
111
+ columnNumber: 13
112
+ }
113
+ }), /*#__PURE__*/_react.default.createElement(_designSystem.Card.Divider, {
114
+ __self: void 0,
115
+ __source: {
116
+ fileName: _jsxFileName,
117
+ lineNumber: 79,
118
+ columnNumber: 13
119
+ }
120
+ }), /*#__PURE__*/_react.default.createElement(_designSystem.Card.Content, {
121
+ __self: void 0,
122
+ __source: {
123
+ fileName: _jsxFileName,
124
+ lineNumber: 80,
125
+ columnNumber: 13
126
+ }
127
+ }, /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
128
+ gap: "SP2",
129
+ direction: "vertical",
130
+ __self: void 0,
131
+ __source: {
132
+ fileName: _jsxFileName,
133
+ lineNumber: 81,
134
+ columnNumber: 15
135
+ }
136
+ }, visibleFieldIds.map(fieldId => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
137
+ key: fieldId,
138
+ __self: void 0,
139
+ __source: {
140
+ fileName: _jsxFileName,
141
+ lineNumber: 83,
142
+ columnNumber: 19
143
+ }
144
+ }, /*#__PURE__*/_react.default.createElement(_designSystem.Cell, {
145
+ span: 12,
146
+ __self: void 0,
147
+ __source: {
148
+ fileName: _jsxFileName,
149
+ lineNumber: 84,
150
+ columnNumber: 21
151
+ }
152
+ }, /*#__PURE__*/_react.default.createElement(_FormFieldInput.FormFieldInput, {
153
+ key: fieldId,
154
+ field: schema.fields[fieldId],
155
+ __self: void 0,
156
+ __source: {
157
+ fileName: _jsxFileName,
158
+ lineNumber: 85,
159
+ columnNumber: 23
160
+ }
161
+ }))))))))));
162
+ };
163
+ exports.AutoPatternsEntityPage = AutoPatternsEntityPage;
164
+ //# sourceMappingURL=AutoPatternsEntityPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_patterns","_form","_designSystem","_FormFieldInput","_reactRouterDom","_SchemaContext","_jsxFileName","AutoPatternsEntityPage","configuration","title","subtitle","visibleFieldIds","collectionPagePath","parentPath","form","useForm","params","useParams","entityId","schema","useSchema","state","useEntityPage","onSave","_state$entity","formValues","getValues","updatedEntity","entity","newUpdatedEntity","_id","actions","update","create","saveErrorToast","fetch","undefined","get","useEntity","default","createElement","EntityPage","dataHook","__self","__source","fileName","lineNumber","columnNumber","Header","text","displayField","Content","MainContent","Card","minHeight","Divider","Box","gap","direction","map","fieldId","Fragment","key","Cell","span","FormFieldInput","field","fields","exports"],"sources":["../../../../src/components/AutoPatternsEntityPage/AutoPatternsEntityPage.tsx"],"sourcesContent":["import React from 'react';\nimport { EntityPageConfig } from '../../types';\nimport {\n EntityPage,\n EntityPageState,\n useEntity,\n useEntityPage,\n} from '@wix/patterns';\nimport { useForm } from '@wix/patterns/form';\nimport { Box, Card, Cell } from '@wix/design-system';\nimport { FormFieldInput } from './Fields/FormFieldInput';\nimport { useParams } from 'react-router-dom';\nimport { useSchema } from '../../providers/SchemaContext';\n\nexport interface AutoPatternsEntityPageProps {\n configuration: EntityPageConfig;\n}\n\nexport const AutoPatternsEntityPage: React.FC<AutoPatternsEntityPageProps> = ({\n configuration,\n}) => {\n const {\n title,\n subtitle,\n visibleFieldIds = [],\n collectionPagePath: parentPath,\n } = configuration;\n const form = useForm<any>();\n const params = useParams();\n const entityId = params.entityId;\n const schema = useSchema();\n const state: EntityPageState<any> = useEntityPage<any, any>({\n parentPath,\n form,\n onSave: async () => {\n const formValues = form.getValues();\n const updatedEntity: any = {\n ...state.entity,\n ...formValues,\n };\n\n let newUpdatedEntity;\n // TODO: Works only for CMS collections, need to be extracted from collection data somehow or share similar context\n if (state.entity?._id) {\n newUpdatedEntity = await schema.actions.update(updatedEntity);\n } else {\n newUpdatedEntity = await schema.actions.create(updatedEntity);\n }\n\n return { updatedEntity: newUpdatedEntity };\n },\n saveErrorToast: () => 'Failed to save',\n fetch: async () => {\n if (!entityId) {\n return { entity: undefined };\n }\n\n const entity = await schema.actions.get(entityId);\n return { entity };\n },\n });\n const entity = useEntity<any, any>(state);\n\n return (\n <EntityPage state={state} dataHook=\"auto-patterns-entity-page\">\n <EntityPage.Header\n title={\n title ?? { text: entity?.[schema.displayField] ?? 'Edit Entity' }\n }\n subtitle={subtitle}\n />\n <EntityPage.Content>\n <EntityPage.MainContent>\n <EntityPage.Card minHeight=\"50px\">\n <Card.Header\n title=\"Item details\"\n subtitle=\"Modify the details of your selected item below\"\n />\n <Card.Divider />\n <Card.Content>\n <Box gap=\"SP2\" direction=\"vertical\">\n {visibleFieldIds.map((fieldId) => (\n <React.Fragment key={fieldId}>\n <Cell span={12}>\n <FormFieldInput\n key={fieldId}\n field={schema.fields[fieldId]}\n />\n </Cell>\n </React.Fragment>\n ))}\n </Box>\n </Card.Content>\n </EntityPage.Card>\n </EntityPage.MainContent>\n </EntityPage.Content>\n </EntityPage>\n );\n};\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AAA0D,IAAAO,YAAA;AAMnD,MAAMC,sBAA6D,GAAGA,CAAC;EAC5EC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC,KAAK;IACLC,QAAQ;IACRC,eAAe,GAAG,EAAE;IACpBC,kBAAkB,EAAEC;EACtB,CAAC,GAAGL,aAAa;EACjB,MAAMM,IAAI,GAAG,IAAAC,aAAO,EAAM,CAAC;EAC3B,MAAMC,MAAM,GAAG,IAAAC,yBAAS,EAAC,CAAC;EAC1B,MAAMC,QAAQ,GAAGF,MAAM,CAACE,QAAQ;EAChC,MAAMC,MAAM,GAAG,IAAAC,wBAAS,EAAC,CAAC;EAC1B,MAAMC,KAA2B,GAAG,IAAAC,uBAAa,EAAW;IAC1DT,UAAU;IACVC,IAAI;IACJS,MAAM,EAAE,MAAAA,CAAA,KAAY;MAAA,IAAAC,aAAA;MAClB,MAAMC,UAAU,GAAGX,IAAI,CAACY,SAAS,CAAC,CAAC;MACnC,MAAMC,aAAkB,GAAG;QACzB,GAAGN,KAAK,CAACO,MAAM;QACf,GAAGH;MACL,CAAC;MAED,IAAII,gBAAgB;MACpB;MACA,KAAAL,aAAA,GAAIH,KAAK,CAACO,MAAM,a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C,SAAS,EAAC,UAAU;IAAAf,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAvC,YAAA;MAAAwC,UAAA;MAAAC,YAAA;IAAA;EAAA,GAChCpC,eAAe,CAACgD,GAAG,CAAEC,OAAO,iBAC3B/D,MAAA,CAAA0C,OAAA,CAAAC,aAAA,CAAC3C,MAAA,CAAA0C,OAAK,CAACsB,QAAQ;IAACC,GAAG,EAAEF,OAAQ;IAAAjB,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAvC,YAAA;MAAAwC,UAAA;MAAAC,YAAA;IAAA;EAAA,gBAC3BlD,MAAA,CAAA0C,OAAA,CAAAC,aAAA,CAACtC,aAAA,CAAA6D,IAAI;IAACC,IAAI,EAAE,EAAG;IAAArB,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAvC,YAAA;MAAAwC,UAAA;MAAAC,YAAA;IAAA;EAAA,gBACblD,MAAA,CAAA0C,OAAA,CAAAC,aAAA,CAACrC,eAAA,CAAA8D,cAAc;IACbH,GAAG,EAAEF,OAAQ;IACbM,KAAK,EAAE/C,MAAM,CAACgD,MAAM,CAACP,OAAO,CAAE;IAAAjB,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAvC,YAAA;MAAAwC,UAAA;MAAAC,YAAA;IAAA;EAAA,CAC/B,CACG,CACQ,CACjB,CACE,CACO,CACC,CACK,CACN,CACV,CAAC;AAEjB,CAAC;AAACqB,OAAA,CAAA7D,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.Checkbox = void 0;
5
+ var _react = _interopRequireWildcard(require("react"));
6
+ var _designSystem = require("@wix/design-system");
7
+ var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/components/AutoPatternsEntityPage/Fields/Checkbox.tsx";
8
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
+ const Checkbox = props => {
11
+ const {
12
+ field,
13
+ initialValue,
14
+ onChange
15
+ } = props;
16
+ const [value, setValue] = (0, _react.useState)(initialValue);
17
+ return /*#__PURE__*/_react.default.createElement(_designSystem.Checkbox, {
18
+ checked: value,
19
+ onChange: e => {
20
+ setValue(e.target.checked);
21
+ onChange(e.target.checked);
22
+ },
23
+ dataHook: `checkbox-${field.id}`,
24
+ __self: void 0,
25
+ __source: {
26
+ fileName: _jsxFileName,
27
+ lineNumber: 12,
28
+ columnNumber: 5
29
+ }
30
+ }, field.displayName);
31
+ };
32
+ exports.Checkbox = Checkbox;
33
+ //# sourceMappingURL=Checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_designSystem","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Checkbox","props","field","initialValue","onChange","value","setValue","useState","createElement","checked","target","dataHook","id","__self","__source","fileName","lineNumber","columnNumber","displayName","exports"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/Checkbox.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Checkbox as CheckboxWSR } from '@wix/design-system';\nimport { BaseInputProps } from './FormFieldInput';\n\nexport interface CheckboxProps extends BaseInputProps<boolean> {}\n\nexport const Checkbox = (props: CheckboxProps) => {\n const { field, initialValue, onChange } = props;\n const [value, setValue] = useState(initialValue);\n\n return (\n <CheckboxWSR\n checked={value}\n onChange={(e) => {\n setValue(e.target.checked);\n onChange(e.target.checked);\n }}\n dataHook={`checkbox-${field.id}`}\n >\n {field.displayName}\n </CheckboxWSR>\n );\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAA6D,IAAAE,YAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAKtD,MAAMW,QAAQ,GAAIC,KAAoB,IAAK;EAChD,MAAM;IAAEC,KAAK;IAAEC,YAAY;IAAEC;EAAS,CAAC,GAAGH,KAAK;EAC/C,MAAM,CAACI,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAC,eAAQ,EAACJ,YAAY,CAAC;EAEhD,oBACE5B,MAAA,CAAAW,OAAA,CAAAsB,aAAA,CAAC9B,aAAA,CAAAsB,QAAW;IACVS,OAAO,EAAEJ,KAAM;IACfD,QAAQ,EAAGvB,CAAC,IAAK;MACfyB,QAAQ,CAACzB,CAAC,CAAC6B,MAAM,CAACD,OAAO,CAAC;MAC1BL,QAAQ,CAACvB,CAAC,CAAC6B,MAAM,CAACD,OAAO,CAAC;IAC5B,CAAE;IACFE,QAAQ,EAAE,YAAYT,KAAK,CAACU,EAAE,EAAG;IAAAC,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAApC,YAAA;MAAAqC,UAAA;MAAAC,YAAA;IAAA;EAAA,GAEhCf,KAAK,CAACgB,WACI,CAAC;AAElB,CAAC;AAACC,OAAA,CAAAnB,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ exports.__esModule = true;
5
+ exports.FormFieldInput = exports.EDITABLE_INPUT_ELEMENTS = void 0;
6
+ var _react = _interopRequireDefault(require("react"));
7
+ var _ShortText = require("./ShortText");
8
+ var _patterns = require("@wix/patterns");
9
+ var _form = require("@wix/patterns/form");
10
+ var _data = require("@wix/data");
11
+ var _Checkbox = require("./Checkbox");
12
+ var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/components/AutoPatternsEntityPage/Fields/FormFieldInput.tsx";
13
+ const EDITABLE_INPUT_ELEMENTS = exports.EDITABLE_INPUT_ELEMENTS = {
14
+ [_data.collections.Type.TEXT]: _ShortText.ShortText,
15
+ [_data.collections.Type.BOOLEAN]: _Checkbox.Checkbox
16
+ };
17
+ const FormFieldInput = props => {
18
+ var _pageState$entity, _controller$fieldStat;
19
+ const {
20
+ field
21
+ } = props;
22
+ const pageState = (0, _patterns.useEntityPageContext)();
23
+ const controller = (0, _form.useController)({
24
+ name: (field == null ? void 0 : field.id) ?? '',
25
+ control: pageState.form.control,
26
+ defaultValue: (_pageState$entity = pageState.entity) == null ? void 0 : _pageState$entity[(field == null ? void 0 : field.id) ?? '']
27
+ });
28
+ if (!field || !EDITABLE_INPUT_ELEMENTS.hasOwnProperty(field.originalType) || !pageState || !pageState.entity) {
29
+ return null;
30
+ }
31
+ const FieldInput = EDITABLE_INPUT_ELEMENTS[field.originalType];
32
+ return /*#__PURE__*/_react.default.createElement(FieldInput, {
33
+ field: field,
34
+ initialValue: pageState.entity[field.id],
35
+ status: controller.fieldState.invalid ? 'error' : undefined,
36
+ statusMessage: (_controller$fieldStat = controller.fieldState.error) == null ? void 0 : _controller$fieldStat.message,
37
+ inputRef: controller.field.ref,
38
+ value: controller.field.value,
39
+ onChange: controller.field.onChange,
40
+ onBlur: controller.field.onBlur,
41
+ __self: void 0,
42
+ __source: {
43
+ fileName: _jsxFileName,
44
+ lineNumber: 47,
45
+ columnNumber: 5
46
+ }
47
+ });
48
+ };
49
+ exports.FormFieldInput = FormFieldInput;
50
+ //# sourceMappingURL=FormFieldInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_ShortText","_patterns","_form","_data","_Checkbox","_jsxFileName","EDITABLE_INPUT_ELEMENTS","exports","collections","Type","TEXT","ShortText","BOOLEAN","Checkbox","FormFieldInput","props","_pageState$entity","_controller$fieldStat","field","pageState","useEntityPageContext","controller","useController","name","id","control","form","defaultValue","entity","hasOwnProperty","originalType","FieldInput","default","createElement","initialValue","status","fieldState","invalid","undefined","statusMessage","error","message","inputRef","ref","value","onChange","onBlur","__self","__source","fileName","lineNumber","columnNumber"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/FormFieldInput.tsx"],"sourcesContent":["import React from 'react';\nimport { ShortText } from './ShortText';\nimport { useEntityPageContext } from '@wix/patterns';\nimport { useController } from '@wix/patterns/form';\nimport { Field } from '../../../types';\nimport { collections } from '@wix/data';\nimport { Checkbox } from './Checkbox';\n\nexport interface BaseInputProps<T> {\n field: Field;\n initialValue: T;\n onChange: (newValue: T) => void;\n}\n\nexport const EDITABLE_INPUT_ELEMENTS: Partial<\n Record<collections.Type, React.ComponentType<any>>\n> = {\n [collections.Type.TEXT]: ShortText,\n [collections.Type.BOOLEAN]: Checkbox,\n};\n\nexport interface FormFieldInputProps {\n field?: Field;\n}\n\nexport const FormFieldInput = (props: FormFieldInputProps) => {\n const { field } = props;\n\n const pageState = useEntityPageContext();\n const controller = useController({\n name: field?.id ?? '',\n control: pageState.form.control,\n defaultValue: (pageState.entity as any)?.[field?.id ?? ''],\n });\n\n if (\n !field ||\n !EDITABLE_INPUT_ELEMENTS.hasOwnProperty(field.originalType) ||\n !pageState ||\n !pageState.entity\n ) {\n return null;\n }\n const FieldInput = EDITABLE_INPUT_ELEMENTS[field.originalType]!;\n\n return (\n <FieldInput\n field={field}\n initialValue={(pageState.entity as any)[field.id]}\n status={controller.fieldState.invalid ? 'error' : undefined}\n statusMessage={controller.fieldState.error?.message}\n inputRef={controller.field.ref}\n value={controller.field.value}\n onChange={controller.field.onChange}\n onBlur={controller.field.onBlur}\n />\n );\n};\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAJ,OAAA;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AAU,CAACI,KAAK,qBAA3BvB,qBAAA,CAA6BwB,OAAQ;IACpDC,QAAQ,EAAErB,UAAU,CAACH,KAAK,CAACyB,GAAI;IAC/BC,KAAK,EAAEvB,UAAU,CAACH,KAAK,CAAC0B,KAAM;IAC9BC,QAAQ,EAAExB,UAAU,CAACH,KAAK,CAAC2B,QAAS;IACpCC,MAAM,EAAEzB,UAAU,CAACH,KAAK,CAAC4B,MAAO;IAAAC,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA5C,YAAA;MAAA6C,UAAA;MAAAC,YAAA;IAAA;EAAA,CACjC,CAAC;AAEN,CAAC;AAAC5C,OAAA,CAAAO,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.useTextInput = exports.ShortText = void 0;
5
+ var _react = _interopRequireWildcard(require("react"));
6
+ var _designSystem = require("@wix/design-system");
7
+ var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/components/AutoPatternsEntityPage/Fields/ShortText.tsx";
8
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
+ const useTextInput = ({
11
+ initialValue,
12
+ onChange
13
+ }) => {
14
+ const [value, setValue] = (0, _react.useState)(initialValue || '');
15
+ const handleChange = e => {
16
+ const newValue = e.target.value;
17
+ setValue(newValue);
18
+ onChange == null || onChange(newValue);
19
+ };
20
+ return {
21
+ value,
22
+ handleChange
23
+ };
24
+ };
25
+ exports.useTextInput = useTextInput;
26
+ const ShortText = props => {
27
+ const {
28
+ field,
29
+ initialValue,
30
+ onChange
31
+ } = props;
32
+ const {
33
+ value,
34
+ handleChange
35
+ } = useTextInput({
36
+ initialValue,
37
+ onChange
38
+ });
39
+ return /*#__PURE__*/_react.default.createElement(_designSystem.FormField, {
40
+ label: field.displayName,
41
+ __self: void 0,
42
+ __source: {
43
+ fileName: _jsxFileName,
44
+ lineNumber: 39,
45
+ columnNumber: 5
46
+ }
47
+ }, /*#__PURE__*/_react.default.createElement(_designSystem.Input, {
48
+ value: value,
49
+ onChange: handleChange,
50
+ dataHook: `short-text-${field.id}`,
51
+ __self: void 0,
52
+ __source: {
53
+ fileName: _jsxFileName,
54
+ lineNumber: 40,
55
+ columnNumber: 7
56
+ }
57
+ }));
58
+ };
59
+ exports.ShortText = ShortText;
60
+ //# sourceMappingURL=ShortText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_designSystem","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","useTextInput","initialValue","onChange","value","setValue","useState","handleChange","newValue","target","exports","ShortText","props","field","createElement","FormField","label","displayName","__self","__source","fileName","lineNumber","columnNumber","Input","dataHook","id"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/ShortText.tsx"],"sourcesContent":["import React, { ChangeEvent, useState } from 'react';\nimport { FormField, Input } from '@wix/design-system';\nimport { BaseInputProps } from './FormFieldInput';\n\nexport const useTextInput = ({\n initialValue,\n onChange,\n}: {\n initialValue: string;\n onChange: (value: string) => void;\n}) => {\n const [value, setValue] = useState(initialValue || '');\n\n const handleChange = (\n e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n ) => {\n const newValue = e.target.value;\n\n setValue(newValue);\n onChange?.(newValue);\n };\n\n return {\n value,\n handleChange,\n };\n};\n\nexport interface ShortTextProps extends BaseInputProps<string> {}\n\nexport const ShortText = (props: ShortTextProps) => {\n const { field, initialValue, onChange } = props;\n const { value, handleChange } = useTextInput({\n initialValue,\n onChange,\n });\n\n return (\n <FormField label={field.displayName}>\n <Input\n value={value}\n onChange={handleChange}\n dataHook={`short-text-${field.id}`}\n />\n </FormField>\n );\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAAsD,IAAAE,YAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAA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ACbD,QAAQ,EAAEI,YAAa;IACvBiB,QAAQ,EAAE,cAAcX,KAAK,CAACY,EAAE,EAAG;IAAAP,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAxC,YAAA;MAAAyC,UAAA;MAAAC,YAAA;IAAA;EAAA,CACpC,CACQ,CAAC;AAEhB,CAAC;AAACZ,OAAA,CAAAC,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ var _AutoPatternsEntityPage = require("./AutoPatternsEntityPage");
5
+ Object.keys(_AutoPatternsEntityPage).forEach(function (key) {
6
+ if (key === "default" || key === "__esModule") return;
7
+ if (key in exports && exports[key] === _AutoPatternsEntityPage[key]) return;
8
+ exports[key] = _AutoPatternsEntityPage[key];
9
+ });
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_AutoPatternsEntityPage","require","Object","keys","forEach","key","exports"],"sources":["../../../../src/components/AutoPatternsEntityPage/index.ts"],"sourcesContent":["export * from './AutoPatternsEntityPage';\n"],"mappings":";;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,uBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,uBAAA,CAAAK,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAL,uBAAA,CAAAK,GAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.AutoPatternsGrid = void 0;
5
+ var _react = _interopRequireWildcard(require("react"));
6
+ var _providers = require("../../providers");
7
+ var _AutoPatternsGridContent = require("./AutoPatternsGridContent");
8
+ var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.tsx";
9
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
+ const AutoPatternsGrid = ({
12
+ configuration
13
+ }) => {
14
+ const visibleFieldIds = (0, _react.useMemo)(() => [configuration.item.title, configuration.item.subtitle].filter(value => value != null), [configuration]);
15
+ return /*#__PURE__*/_react.default.createElement(_providers.CollectionDataProvider, {
16
+ collectionConfig: configuration.collection,
17
+ visibleFieldIds: visibleFieldIds,
18
+ __self: void 0,
19
+ __source: {
20
+ fileName: _jsxFileName,
21
+ lineNumber: 20,
22
+ columnNumber: 5
23
+ }
24
+ }, /*#__PURE__*/_react.default.createElement(_AutoPatternsGridContent.AutoPatternsGridContent, {
25
+ configuration: configuration,
26
+ __self: void 0,
27
+ __source: {
28
+ fileName: _jsxFileName,
29
+ lineNumber: 24,
30
+ columnNumber: 7
31
+ }
32
+ }));
33
+ };
34
+ exports.AutoPatternsGrid = AutoPatternsGrid;
35
+ //# sourceMappingURL=AutoPatternsGrid.js.map