@wix/auto-patterns 1.43.0 → 1.45.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 (473) hide show
  1. package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.js +19 -5
  2. package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -1
  3. package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js +3 -0
  4. package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js.map +1 -1
  5. package/dist/cjs/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +29 -74
  6. package/dist/cjs/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
  7. package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +3 -3
  8. package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
  9. package/dist/cjs/components/AutoPatternsEntityPage/EditModeEntityPage.js +26 -14
  10. package/dist/cjs/components/AutoPatternsEntityPage/EditModeEntityPage.js.map +1 -1
  11. package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.js +38 -29
  12. package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.js.map +1 -1
  13. package/dist/cjs/components/AutoPatternsEntityPage/index.js +0 -6
  14. package/dist/cjs/components/AutoPatternsEntityPage/index.js.map +1 -1
  15. package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.js +147 -25
  16. package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -1
  17. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js +68 -30
  18. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -1
  19. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js +8 -7
  20. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
  21. package/dist/cjs/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.js +165 -0
  22. package/dist/cjs/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.js.map +1 -0
  23. package/dist/cjs/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.js +15 -0
  24. package/dist/cjs/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.js.map +1 -0
  25. package/dist/cjs/components/AutoPatternsSettingsPage/index.js +10 -0
  26. package/dist/cjs/components/AutoPatternsSettingsPage/index.js.map +1 -0
  27. package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js +141 -41
  28. package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
  29. package/dist/cjs/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js +169 -9
  30. package/dist/cjs/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js.map +1 -1
  31. package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/Checkbox.js +1 -1
  32. package/dist/cjs/components/fields/Checkbox.js.map +1 -0
  33. package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/DateInput.js +9 -8
  34. package/dist/cjs/components/fields/DateInput.js.map +1 -0
  35. package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/DateTime.js +13 -12
  36. package/dist/cjs/components/fields/DateTime.js.map +1 -0
  37. package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/ImageInput.js +11 -10
  38. package/dist/cjs/components/fields/ImageInput.js.map +1 -0
  39. package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/LongText.js +9 -8
  40. package/dist/cjs/components/fields/LongText.js.map +1 -0
  41. package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/Number.js +9 -8
  42. package/dist/cjs/components/fields/Number.js.map +1 -0
  43. package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/ShortText.js +9 -8
  44. package/dist/cjs/components/fields/ShortText.js.map +1 -0
  45. package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/Url.js +11 -10
  46. package/dist/cjs/components/fields/Url.js.map +1 -0
  47. package/dist/cjs/components/fields/index.js +38 -0
  48. package/dist/cjs/components/fields/index.js.map +1 -0
  49. package/dist/cjs/components/fields/types.js.map +1 -0
  50. package/dist/cjs/components/fields/utils/dates.js.map +1 -0
  51. package/dist/cjs/components/{AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js → layouts/ContentCard.js} +26 -15
  52. package/dist/cjs/components/layouts/ContentCard.js.map +1 -0
  53. package/dist/cjs/components/layouts/ContentCardLayout.js +157 -0
  54. package/dist/cjs/components/layouts/ContentCardLayout.js.map +1 -0
  55. package/dist/cjs/components/layouts/ContentSkeleton.js +98 -0
  56. package/dist/cjs/components/layouts/ContentSkeleton.js.map +1 -0
  57. package/dist/cjs/components/layouts/FormField.js +52 -0
  58. package/dist/cjs/components/layouts/FormField.js.map +1 -0
  59. package/dist/cjs/components/layouts/ViewField.js +68 -0
  60. package/dist/cjs/components/layouts/ViewField.js.map +1 -0
  61. package/dist/cjs/components/layouts/types.js +4 -0
  62. package/dist/cjs/components/layouts/types.js.map +1 -0
  63. package/dist/cjs/hooks/getCommonCollectionFeaturesAsync.js +11 -0
  64. package/dist/cjs/hooks/getCommonCollectionFeaturesAsync.js.map +1 -0
  65. package/dist/cjs/hooks/getFilterComponent.js +52 -0
  66. package/dist/cjs/hooks/getFilterComponent.js.map +1 -0
  67. package/dist/cjs/hooks/index.js +4 -11
  68. package/dist/cjs/hooks/index.js.map +1 -1
  69. package/dist/cjs/hooks/pluginsDynamicImports.js +25 -0
  70. package/dist/cjs/hooks/pluginsDynamicImports.js.map +1 -0
  71. package/dist/cjs/hooks/useAsyncFeaturesPromiseState.js +30 -0
  72. package/dist/cjs/hooks/useAsyncFeaturesPromiseState.js.map +1 -0
  73. package/dist/cjs/hooks/useBaseCollectionComponentReadyFeatures.js +62 -0
  74. package/dist/cjs/hooks/useBaseCollectionComponentReadyFeatures.js.map +1 -0
  75. package/dist/cjs/hooks/useBasePatternsStateParams.js +36 -0
  76. package/dist/cjs/hooks/useBasePatternsStateParams.js.map +1 -0
  77. package/dist/cjs/hooks/useBaseTableFeatures.js +2 -1
  78. package/dist/cjs/hooks/useBaseTableFeatures.js.map +1 -1
  79. package/dist/cjs/hooks/useCollectionInitAsyncDeps.js +15 -0
  80. package/dist/cjs/hooks/useCollectionInitAsyncDeps.js.map +1 -0
  81. package/dist/cjs/hooks/useCommonCollectionFeatures.js +14 -4
  82. package/dist/cjs/hooks/useCommonCollectionFeatures.js.map +1 -1
  83. package/dist/cjs/hooks/useFilters.js +17 -103
  84. package/dist/cjs/hooks/useFilters.js.map +1 -1
  85. package/dist/cjs/hooks/useFiltersState.js +112 -0
  86. package/dist/cjs/hooks/useFiltersState.js.map +1 -0
  87. package/dist/cjs/hooks/useGridFeaturesAsync.js +42 -0
  88. package/dist/cjs/hooks/useGridFeaturesAsync.js.map +1 -0
  89. package/dist/cjs/hooks/useGridVisibleFieldIds.js +17 -0
  90. package/dist/cjs/hooks/useGridVisibleFieldIds.js.map +1 -0
  91. package/dist/cjs/hooks/usePagePath.js +4 -1
  92. package/dist/cjs/hooks/usePagePath.js.map +1 -1
  93. package/dist/cjs/hooks/useSettingsPageMoreActions.js +36 -0
  94. package/dist/cjs/hooks/useSettingsPageMoreActions.js.map +1 -0
  95. package/dist/cjs/hooks/useSyncCollectionStateToAppContext.js +22 -0
  96. package/dist/cjs/hooks/useSyncCollectionStateToAppContext.js.map +1 -0
  97. package/dist/cjs/hooks/useTableFeaturesAsync.js +51 -0
  98. package/dist/cjs/hooks/useTableFeaturesAsync.js.map +1 -0
  99. package/dist/cjs/hooks/useTableGridSwitchFeaturesAsync.js +52 -0
  100. package/dist/cjs/hooks/useTableGridSwitchFeaturesAsync.js.map +1 -0
  101. package/dist/cjs/hooks/useTableSections.js +18 -0
  102. package/dist/cjs/hooks/useTableSections.js.map +1 -0
  103. package/dist/cjs/providers/AutoPatternsOverridesContext.js +1 -1
  104. package/dist/cjs/providers/AutoPatternsOverridesContext.js.map +1 -1
  105. package/dist/cjs/types/SettingsPageConfig.js +4 -0
  106. package/dist/cjs/types/SettingsPageConfig.js.map +1 -0
  107. package/dist/cjs/types/actions/base.js.map +1 -1
  108. package/dist/cjs/types/actions/entityPageActions.js.map +1 -1
  109. package/dist/cjs/types/actions/formPageActions.js +4 -0
  110. package/dist/cjs/types/actions/formPageActions.js.map +1 -0
  111. package/dist/cjs/types/actions/index.js +6 -0
  112. package/dist/cjs/types/actions/index.js.map +1 -1
  113. package/dist/cjs/types/index.js +6 -0
  114. package/dist/cjs/types/index.js.map +1 -1
  115. package/dist/cjs/types/types.js.map +1 -1
  116. package/dist/cjs/utils/filterCreators.js +16 -31
  117. package/dist/cjs/utils/filterCreators.js.map +1 -1
  118. package/dist/cjs/utils/minimalRequiredPatternsRuntimeCheck.js +18 -0
  119. package/dist/cjs/utils/minimalRequiredPatternsRuntimeCheck.js.map +1 -0
  120. package/dist/cjs/utils/minimalRequiredRuntimeCheck.js +21 -0
  121. package/dist/cjs/utils/minimalRequiredRuntimeCheck.js.map +1 -0
  122. package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js +14 -1
  123. package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -1
  124. package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js +4 -1
  125. package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js.map +1 -1
  126. package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +23 -31
  127. package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
  128. package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +3 -3
  129. package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
  130. package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js +21 -8
  131. package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js.map +1 -1
  132. package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js +21 -12
  133. package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js.map +1 -1
  134. package/dist/esm/components/AutoPatternsEntityPage/index.js +0 -1
  135. package/dist/esm/components/AutoPatternsEntityPage/index.js.map +1 -1
  136. package/dist/esm/components/AutoPatternsGrid/AutoPatternsGrid.js +134 -28
  137. package/dist/esm/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -1
  138. package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js +34 -13
  139. package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -1
  140. package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js +2 -1
  141. package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
  142. package/dist/esm/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.js +108 -0
  143. package/dist/esm/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.js.map +1 -0
  144. package/dist/esm/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.js +10 -0
  145. package/dist/esm/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.js.map +1 -0
  146. package/dist/esm/components/AutoPatternsSettingsPage/index.js +2 -0
  147. package/dist/esm/components/AutoPatternsSettingsPage/index.js.map +1 -0
  148. package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js +126 -42
  149. package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
  150. package/dist/esm/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js +155 -10
  151. package/dist/esm/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js.map +1 -1
  152. package/dist/esm/components/fields/Checkbox.js.map +1 -0
  153. package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/DateInput.js +7 -6
  154. package/dist/esm/components/fields/DateInput.js.map +1 -0
  155. package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/DateTime.js +7 -6
  156. package/dist/esm/components/fields/DateTime.js.map +1 -0
  157. package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/ImageInput.js +9 -8
  158. package/dist/esm/components/fields/ImageInput.js.map +1 -0
  159. package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/LongText.js +7 -6
  160. package/dist/esm/components/fields/LongText.js.map +1 -0
  161. package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/Number.js +7 -6
  162. package/dist/esm/components/fields/Number.js.map +1 -0
  163. package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/ShortText.js +7 -6
  164. package/dist/esm/components/fields/ShortText.js.map +1 -0
  165. package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/Url.js +7 -6
  166. package/dist/esm/components/fields/Url.js.map +1 -0
  167. package/dist/esm/components/fields/index.js +10 -0
  168. package/dist/esm/components/fields/index.js.map +1 -0
  169. package/dist/esm/components/fields/types.js.map +1 -0
  170. package/dist/esm/components/fields/utils/dates.js.map +1 -0
  171. package/dist/esm/components/{AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js → layouts/ContentCard.js} +19 -8
  172. package/dist/esm/components/layouts/ContentCard.js.map +1 -0
  173. package/dist/esm/components/{AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js → layouts/ContentCardLayout.js} +38 -19
  174. package/dist/esm/components/layouts/ContentCardLayout.js.map +1 -0
  175. package/dist/esm/components/layouts/ContentSkeleton.js +47 -0
  176. package/dist/esm/components/layouts/ContentSkeleton.js.map +1 -0
  177. package/dist/esm/components/layouts/FormField.js +40 -0
  178. package/dist/esm/components/layouts/FormField.js.map +1 -0
  179. package/dist/esm/components/layouts/ViewField.js +43 -0
  180. package/dist/esm/components/layouts/ViewField.js.map +1 -0
  181. package/dist/esm/components/layouts/types.js +2 -0
  182. package/dist/esm/components/layouts/types.js.map +1 -0
  183. package/dist/esm/hooks/getCommonCollectionFeaturesAsync.js +7 -0
  184. package/dist/esm/hooks/getCommonCollectionFeaturesAsync.js.map +1 -0
  185. package/dist/esm/hooks/getFilterComponent.js +48 -0
  186. package/dist/esm/hooks/getFilterComponent.js.map +1 -0
  187. package/dist/esm/hooks/index.js +1 -2
  188. package/dist/esm/hooks/index.js.map +1 -1
  189. package/dist/esm/hooks/pluginsDynamicImports.js +13 -0
  190. package/dist/esm/hooks/pluginsDynamicImports.js.map +1 -0
  191. package/dist/esm/hooks/useAsyncFeaturesPromiseState.js +28 -0
  192. package/dist/esm/hooks/useAsyncFeaturesPromiseState.js.map +1 -0
  193. package/dist/esm/hooks/useBaseCollectionComponentReadyFeatures.js +58 -0
  194. package/dist/esm/hooks/useBaseCollectionComponentReadyFeatures.js.map +1 -0
  195. package/dist/esm/hooks/useBasePatternsStateParams.js +32 -0
  196. package/dist/esm/hooks/useBasePatternsStateParams.js.map +1 -0
  197. package/dist/esm/hooks/useBaseTableFeatures.js +1 -0
  198. package/dist/esm/hooks/useBaseTableFeatures.js.map +1 -1
  199. package/dist/esm/hooks/useCollectionInitAsyncDeps.js +11 -0
  200. package/dist/esm/hooks/useCollectionInitAsyncDeps.js.map +1 -0
  201. package/dist/esm/hooks/useCommonCollectionFeatures.js +1 -0
  202. package/dist/esm/hooks/useCommonCollectionFeatures.js.map +1 -1
  203. package/dist/esm/hooks/useFilters.js +14 -100
  204. package/dist/esm/hooks/useFilters.js.map +1 -1
  205. package/dist/esm/hooks/useFiltersState.js +107 -0
  206. package/dist/esm/hooks/useFiltersState.js.map +1 -0
  207. package/dist/esm/hooks/useGridFeaturesAsync.js +37 -0
  208. package/dist/esm/hooks/useGridFeaturesAsync.js.map +1 -0
  209. package/dist/esm/hooks/useGridVisibleFieldIds.js +13 -0
  210. package/dist/esm/hooks/useGridVisibleFieldIds.js.map +1 -0
  211. package/dist/esm/hooks/usePagePath.js +4 -1
  212. package/dist/esm/hooks/usePagePath.js.map +1 -1
  213. package/dist/esm/hooks/useSettingsPageMoreActions.js +32 -0
  214. package/dist/esm/hooks/useSettingsPageMoreActions.js.map +1 -0
  215. package/dist/esm/hooks/useSyncCollectionStateToAppContext.js +18 -0
  216. package/dist/esm/hooks/useSyncCollectionStateToAppContext.js.map +1 -0
  217. package/dist/esm/hooks/useTableFeaturesAsync.js +46 -0
  218. package/dist/esm/hooks/useTableFeaturesAsync.js.map +1 -0
  219. package/dist/esm/hooks/useTableGridSwitchFeaturesAsync.js +47 -0
  220. package/dist/esm/hooks/useTableGridSwitchFeaturesAsync.js.map +1 -0
  221. package/dist/esm/hooks/useTableSections.js +14 -0
  222. package/dist/esm/hooks/useTableSections.js.map +1 -0
  223. package/dist/esm/providers/AutoPatternsOverridesContext.js.map +1 -1
  224. package/dist/esm/types/SettingsPageConfig.js +2 -0
  225. package/dist/esm/types/SettingsPageConfig.js.map +1 -0
  226. package/dist/esm/types/actions/base.js.map +1 -1
  227. package/dist/esm/types/actions/entityPageActions.js.map +1 -1
  228. package/dist/esm/types/actions/formPageActions.js +2 -0
  229. package/dist/esm/types/actions/formPageActions.js.map +1 -0
  230. package/dist/esm/types/actions/index.js +1 -0
  231. package/dist/esm/types/actions/index.js.map +1 -1
  232. package/dist/esm/types/index.js +1 -0
  233. package/dist/esm/types/index.js.map +1 -1
  234. package/dist/esm/types/types.js.map +1 -1
  235. package/dist/esm/utils/filterCreators.js +17 -32
  236. package/dist/esm/utils/filterCreators.js.map +1 -1
  237. package/dist/esm/utils/minimalRequiredPatternsRuntimeCheck.js +14 -0
  238. package/dist/esm/utils/minimalRequiredPatternsRuntimeCheck.js.map +1 -0
  239. package/dist/esm/utils/minimalRequiredRuntimeCheck.js +17 -0
  240. package/dist/esm/utils/minimalRequiredRuntimeCheck.js.map +1 -0
  241. package/dist/types/components/AutoPatternsApp/AutoPatternsApp.d.ts.map +1 -1
  242. package/dist/types/components/AutoPatternsApp/AutoPatternsApp.uni.driver.d.ts +4 -1
  243. package/dist/types/components/AutoPatternsApp/AutoPatternsApp.uni.driver.d.ts.map +1 -1
  244. package/dist/types/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.d.ts +6 -0
  245. package/dist/types/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.d.ts.map +1 -1
  246. package/dist/types/components/AutoPatternsEntityPage/EditModeEntityPage.d.ts.map +1 -1
  247. package/dist/types/components/AutoPatternsEntityPage/ViewModeEntityPage.d.ts.map +1 -1
  248. package/dist/types/components/AutoPatternsEntityPage/index.d.ts +0 -1
  249. package/dist/types/components/AutoPatternsEntityPage/index.d.ts.map +1 -1
  250. package/dist/types/components/AutoPatternsGrid/AutoPatternsGrid.d.ts +17 -2
  251. package/dist/types/components/AutoPatternsGrid/AutoPatternsGrid.d.ts.map +1 -1
  252. package/dist/types/components/AutoPatternsRoute/AutoPatternsPage.d.ts.map +1 -1
  253. package/dist/types/components/AutoPatternsRoute/AutoPatternsRoutes.d.ts.map +1 -1
  254. package/dist/types/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.d.ts +6 -0
  255. package/dist/types/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.d.ts.map +1 -0
  256. package/dist/types/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.d.ts +145 -0
  257. package/dist/types/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.d.ts.map +1 -0
  258. package/dist/types/components/AutoPatternsSettingsPage/index.d.ts +2 -0
  259. package/dist/types/components/AutoPatternsSettingsPage/index.d.ts.map +1 -0
  260. package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts +17 -2
  261. package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts.map +1 -1
  262. package/dist/types/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.d.ts +18 -2
  263. package/dist/types/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.d.ts.map +1 -1
  264. package/dist/types/components/fields/Checkbox.d.ts.map +1 -0
  265. package/dist/types/components/fields/DateInput.d.ts.map +1 -0
  266. package/dist/types/components/fields/DateTime.d.ts.map +1 -0
  267. package/dist/types/components/fields/ImageInput.d.ts.map +1 -0
  268. package/dist/types/components/fields/LongText.d.ts.map +1 -0
  269. package/dist/types/components/fields/Number.d.ts.map +1 -0
  270. package/dist/types/components/fields/ShortText.d.ts.map +1 -0
  271. package/dist/types/components/fields/Url.d.ts.map +1 -0
  272. package/dist/types/components/fields/index.d.ts +10 -0
  273. package/dist/types/components/fields/index.d.ts.map +1 -0
  274. package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/types.d.ts +4 -1
  275. package/dist/types/components/fields/types.d.ts.map +1 -0
  276. package/dist/types/components/fields/utils/dates.d.ts.map +1 -0
  277. package/dist/types/components/layouts/ContentCard.d.ts +17 -0
  278. package/dist/types/components/layouts/ContentCard.d.ts.map +1 -0
  279. package/dist/types/components/layouts/ContentCardLayout.d.ts +18 -0
  280. package/dist/types/components/layouts/ContentCardLayout.d.ts.map +1 -0
  281. package/dist/types/components/layouts/ContentSkeleton.d.ts +9 -0
  282. package/dist/types/components/layouts/ContentSkeleton.d.ts.map +1 -0
  283. package/dist/types/components/layouts/FormField.d.ts +13 -0
  284. package/dist/types/components/layouts/FormField.d.ts.map +1 -0
  285. package/dist/types/components/layouts/ViewField.d.ts +8 -0
  286. package/dist/types/components/layouts/ViewField.d.ts.map +1 -0
  287. package/dist/types/components/layouts/types.d.ts +3 -0
  288. package/dist/types/components/layouts/types.d.ts.map +1 -0
  289. package/dist/types/hooks/getCommonCollectionFeaturesAsync.d.ts +4 -0
  290. package/dist/types/hooks/getCommonCollectionFeaturesAsync.d.ts.map +1 -0
  291. package/dist/types/hooks/getFilterComponent.d.ts +4 -0
  292. package/dist/types/hooks/getFilterComponent.d.ts.map +1 -0
  293. package/dist/types/hooks/index.d.ts +1 -2
  294. package/dist/types/hooks/index.d.ts.map +1 -1
  295. package/dist/types/hooks/pluginsDynamicImports.d.ts +7 -0
  296. package/dist/types/hooks/pluginsDynamicImports.d.ts.map +1 -0
  297. package/dist/types/hooks/useAsyncFeaturesPromiseState.d.ts +6 -0
  298. package/dist/types/hooks/useAsyncFeaturesPromiseState.d.ts.map +1 -0
  299. package/dist/types/hooks/useBaseCollectionComponentReadyFeatures.d.ts +36 -0
  300. package/dist/types/hooks/useBaseCollectionComponentReadyFeatures.d.ts.map +1 -0
  301. package/dist/types/hooks/useBasePatternsStateParams.d.ts +31 -0
  302. package/dist/types/hooks/useBasePatternsStateParams.d.ts.map +1 -0
  303. package/dist/types/hooks/useBaseTableFeatures.d.ts +2 -0
  304. package/dist/types/hooks/useBaseTableFeatures.d.ts.map +1 -1
  305. package/dist/types/hooks/useCollectionInitAsyncDeps.d.ts +4 -0
  306. package/dist/types/hooks/useCollectionInitAsyncDeps.d.ts.map +1 -0
  307. package/dist/types/hooks/useCommonCollectionFeatures.d.ts +1 -0
  308. package/dist/types/hooks/useCommonCollectionFeatures.d.ts.map +1 -1
  309. package/dist/types/hooks/useFilters.d.ts +9 -21
  310. package/dist/types/hooks/useFilters.d.ts.map +1 -1
  311. package/dist/types/hooks/useFiltersState.d.ts +26 -0
  312. package/dist/types/hooks/useFiltersState.d.ts.map +1 -0
  313. package/dist/types/hooks/useGridDragAndDrop.d.ts +1 -1
  314. package/dist/types/hooks/useGridFeaturesAsync.d.ts +26 -0
  315. package/dist/types/hooks/useGridFeaturesAsync.d.ts.map +1 -0
  316. package/dist/types/hooks/useGridVisibleFieldIds.d.ts +3 -0
  317. package/dist/types/hooks/useGridVisibleFieldIds.d.ts.map +1 -0
  318. package/dist/types/hooks/usePagePath.d.ts.map +1 -1
  319. package/dist/types/hooks/useSettingsPageMoreActions.d.ts +5 -0
  320. package/dist/types/hooks/useSettingsPageMoreActions.d.ts.map +1 -0
  321. package/dist/types/hooks/useSyncCollectionStateToAppContext.d.ts +6 -0
  322. package/dist/types/hooks/useSyncCollectionStateToAppContext.d.ts.map +1 -0
  323. package/dist/types/hooks/useTableFeaturesAsync.d.ts +29 -0
  324. package/dist/types/hooks/useTableFeaturesAsync.d.ts.map +1 -0
  325. package/dist/types/hooks/useTableGridSwitchDragAndDrop.d.ts +1 -1
  326. package/dist/types/hooks/useTableGridSwitchFeaturesAsync.d.ts +29 -0
  327. package/dist/types/hooks/useTableGridSwitchFeaturesAsync.d.ts.map +1 -0
  328. package/dist/types/hooks/useTableSections.d.ts +8 -0
  329. package/dist/types/hooks/useTableSections.d.ts.map +1 -0
  330. package/dist/types/providers/AutoPatternsOverridesContext.d.ts +2 -2
  331. package/dist/types/providers/AutoPatternsOverridesContext.d.ts.map +1 -1
  332. package/dist/types/testkit/enzyme.d.ts +1 -0
  333. package/dist/types/testkit/enzyme.d.ts.map +1 -1
  334. package/dist/types/testkit/jsdom.d.ts +1 -0
  335. package/dist/types/testkit/jsdom.d.ts.map +1 -1
  336. package/dist/types/testkit/playwright.d.ts +1 -0
  337. package/dist/types/testkit/playwright.d.ts.map +1 -1
  338. package/dist/types/testkit/puppeteer.d.ts +1 -0
  339. package/dist/types/testkit/puppeteer.d.ts.map +1 -1
  340. package/dist/types/types/SettingsPageConfig.d.ts +140 -0
  341. package/dist/types/types/SettingsPageConfig.d.ts.map +1 -0
  342. package/dist/types/types/actions/base.d.ts +1 -0
  343. package/dist/types/types/actions/base.d.ts.map +1 -1
  344. package/dist/types/types/actions/entityPageActions.d.ts +2 -7
  345. package/dist/types/types/actions/entityPageActions.d.ts.map +1 -1
  346. package/dist/types/types/actions/formPageActions.d.ts +8 -0
  347. package/dist/types/types/actions/formPageActions.d.ts.map +1 -0
  348. package/dist/types/types/actions/index.d.ts +1 -0
  349. package/dist/types/types/actions/index.d.ts.map +1 -1
  350. package/dist/types/types/index.d.ts +1 -0
  351. package/dist/types/types/index.d.ts.map +1 -1
  352. package/dist/types/types/types.d.ts +20 -1
  353. package/dist/types/types/types.d.ts.map +1 -1
  354. package/dist/types/utils/filterCreators.d.ts +10 -19
  355. package/dist/types/utils/filterCreators.d.ts.map +1 -1
  356. package/dist/types/utils/minimalRequiredPatternsRuntimeCheck.d.ts +5 -0
  357. package/dist/types/utils/minimalRequiredPatternsRuntimeCheck.d.ts.map +1 -0
  358. package/dist/types/utils/minimalRequiredRuntimeCheck.d.ts +9 -0
  359. package/dist/types/utils/minimalRequiredRuntimeCheck.d.ts.map +1 -0
  360. package/docs/GETTING_STARTED.md +73 -18
  361. package/mcp-docs/app_config_structure.md +66 -3
  362. package/mcp-docs/auto-patterns-guide.md +86 -6
  363. package/mcp-docs/index.md +4 -0
  364. package/mcp-docs/pages_configuration.md +20 -3
  365. package/mcp-docs/settings_page.md +599 -0
  366. package/package.json +14 -13
  367. package/dist/cjs/components/AutoPatternsEntityPage/Fields/Checkbox.js.map +0 -1
  368. package/dist/cjs/components/AutoPatternsEntityPage/Fields/DateInput.js.map +0 -1
  369. package/dist/cjs/components/AutoPatternsEntityPage/Fields/DateTime.js.map +0 -1
  370. package/dist/cjs/components/AutoPatternsEntityPage/Fields/FormFieldInput.js +0 -59
  371. package/dist/cjs/components/AutoPatternsEntityPage/Fields/FormFieldInput.js.map +0 -1
  372. package/dist/cjs/components/AutoPatternsEntityPage/Fields/ImageInput.js.map +0 -1
  373. package/dist/cjs/components/AutoPatternsEntityPage/Fields/LongText.js.map +0 -1
  374. package/dist/cjs/components/AutoPatternsEntityPage/Fields/Number.js.map +0 -1
  375. package/dist/cjs/components/AutoPatternsEntityPage/Fields/ShortText.js.map +0 -1
  376. package/dist/cjs/components/AutoPatternsEntityPage/Fields/Url.js.map +0 -1
  377. package/dist/cjs/components/AutoPatternsEntityPage/Fields/types.js.map +0 -1
  378. package/dist/cjs/components/AutoPatternsEntityPage/Fields/utils/dates.js.map +0 -1
  379. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js.map +0 -1
  380. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +0 -119
  381. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +0 -1
  382. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js +0 -79
  383. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js.map +0 -1
  384. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/index.js +0 -16
  385. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/index.js.map +0 -1
  386. package/dist/cjs/components/AutoPatternsEntityPage/SkeletonEntity.js +0 -198
  387. package/dist/cjs/components/AutoPatternsEntityPage/SkeletonEntity.js.map +0 -1
  388. package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js +0 -77
  389. package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js.map +0 -1
  390. package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +0 -109
  391. package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +0 -1
  392. package/dist/cjs/hooks/useGridFeatures.js +0 -63
  393. package/dist/cjs/hooks/useGridFeatures.js.map +0 -1
  394. package/dist/cjs/hooks/useTableFeatures.js +0 -79
  395. package/dist/cjs/hooks/useTableFeatures.js.map +0 -1
  396. package/dist/cjs/hooks/useTableGridSwitchFeatures.js +0 -83
  397. package/dist/cjs/hooks/useTableGridSwitchFeatures.js.map +0 -1
  398. package/dist/esm/components/AutoPatternsEntityPage/Fields/Checkbox.js.map +0 -1
  399. package/dist/esm/components/AutoPatternsEntityPage/Fields/DateInput.js.map +0 -1
  400. package/dist/esm/components/AutoPatternsEntityPage/Fields/DateTime.js.map +0 -1
  401. package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js +0 -46
  402. package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js.map +0 -1
  403. package/dist/esm/components/AutoPatternsEntityPage/Fields/ImageInput.js.map +0 -1
  404. package/dist/esm/components/AutoPatternsEntityPage/Fields/LongText.js.map +0 -1
  405. package/dist/esm/components/AutoPatternsEntityPage/Fields/Number.js.map +0 -1
  406. package/dist/esm/components/AutoPatternsEntityPage/Fields/ShortText.js.map +0 -1
  407. package/dist/esm/components/AutoPatternsEntityPage/Fields/Url.js.map +0 -1
  408. package/dist/esm/components/AutoPatternsEntityPage/Fields/types.js.map +0 -1
  409. package/dist/esm/components/AutoPatternsEntityPage/Fields/utils/dates.js.map +0 -1
  410. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js.map +0 -1
  411. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +0 -1
  412. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js +0 -48
  413. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js.map +0 -1
  414. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/index.js +0 -3
  415. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/index.js.map +0 -1
  416. package/dist/esm/components/AutoPatternsEntityPage/SkeletonEntity.js +0 -91
  417. package/dist/esm/components/AutoPatternsEntityPage/SkeletonEntity.js.map +0 -1
  418. package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js +0 -31
  419. package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js.map +0 -1
  420. package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +0 -66
  421. package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +0 -1
  422. package/dist/esm/hooks/useGridFeatures.js +0 -58
  423. package/dist/esm/hooks/useGridFeatures.js.map +0 -1
  424. package/dist/esm/hooks/useTableFeatures.js +0 -74
  425. package/dist/esm/hooks/useTableFeatures.js.map +0 -1
  426. package/dist/esm/hooks/useTableGridSwitchFeatures.js +0 -78
  427. package/dist/esm/hooks/useTableGridSwitchFeatures.js.map +0 -1
  428. package/dist/types/components/AutoPatternsEntityPage/Fields/Checkbox.d.ts.map +0 -1
  429. package/dist/types/components/AutoPatternsEntityPage/Fields/DateInput.d.ts.map +0 -1
  430. package/dist/types/components/AutoPatternsEntityPage/Fields/DateTime.d.ts.map +0 -1
  431. package/dist/types/components/AutoPatternsEntityPage/Fields/FormFieldInput.d.ts +0 -10
  432. package/dist/types/components/AutoPatternsEntityPage/Fields/FormFieldInput.d.ts.map +0 -1
  433. package/dist/types/components/AutoPatternsEntityPage/Fields/ImageInput.d.ts.map +0 -1
  434. package/dist/types/components/AutoPatternsEntityPage/Fields/LongText.d.ts.map +0 -1
  435. package/dist/types/components/AutoPatternsEntityPage/Fields/Number.d.ts.map +0 -1
  436. package/dist/types/components/AutoPatternsEntityPage/Fields/ShortText.d.ts.map +0 -1
  437. package/dist/types/components/AutoPatternsEntityPage/Fields/Url.d.ts.map +0 -1
  438. package/dist/types/components/AutoPatternsEntityPage/Fields/types.d.ts.map +0 -1
  439. package/dist/types/components/AutoPatternsEntityPage/Fields/utils/dates.d.ts.map +0 -1
  440. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.d.ts +0 -11
  441. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.d.ts.map +0 -1
  442. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.d.ts +0 -13
  443. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.d.ts.map +0 -1
  444. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.d.ts +0 -8
  445. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.d.ts.map +0 -1
  446. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/index.d.ts +0 -3
  447. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/index.d.ts.map +0 -1
  448. package/dist/types/components/AutoPatternsEntityPage/SkeletonEntity.d.ts +0 -7
  449. package/dist/types/components/AutoPatternsEntityPage/SkeletonEntity.d.ts.map +0 -1
  450. package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.d.ts +0 -8
  451. package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.d.ts.map +0 -1
  452. package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts +0 -8
  453. package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts.map +0 -1
  454. package/dist/types/hooks/useGridFeatures.d.ts +0 -43
  455. package/dist/types/hooks/useGridFeatures.d.ts.map +0 -1
  456. package/dist/types/hooks/useTableFeatures.d.ts +0 -27
  457. package/dist/types/hooks/useTableFeatures.d.ts.map +0 -1
  458. package/dist/types/hooks/useTableGridSwitchFeatures.d.ts +0 -52
  459. package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +0 -1
  460. /package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/types.js +0 -0
  461. /package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/utils/dates.js +0 -0
  462. /package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/Checkbox.js +0 -0
  463. /package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/types.js +0 -0
  464. /package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/utils/dates.js +0 -0
  465. /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/Checkbox.d.ts +0 -0
  466. /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/DateInput.d.ts +0 -0
  467. /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/DateTime.d.ts +0 -0
  468. /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/ImageInput.d.ts +0 -0
  469. /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/LongText.d.ts +0 -0
  470. /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/Number.d.ts +0 -0
  471. /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/ShortText.d.ts +0 -0
  472. /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/Url.d.ts +0 -0
  473. /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/utils/dates.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["React","usePagePath","PatternsReactRoute","PatternsReactRouter","AutoPatternsPage","Navigate","useWixPatternsContainer","pageTypeToRouteType","collectionPage","entityPage","AutoPatternsRoutes","_ref","config","getPagePath","layoutType","createElement","Fragment","pages","map","page","key","id","pageConfig","mainPage","find","appMainPage","routes","routePath","type","path","element","filter","Boolean","mainPagePath","push","to"],"sources":["../../../../src/components/AutoPatternsRoute/AutoPatternsRoutes.tsx"],"sourcesContent":["import React from 'react';\nimport { usePagePath } from '../../hooks';\nimport { PatternsReactRoute, PatternsReactRouter } from '@wix/patterns/router';\nimport { AutoPatternsPage } from './AutoPatternsPage';\nimport type { RouteType } from '@wix/patterns/dist/types/components/Router/types';\nimport { Navigate } from 'react-router-dom';\nimport { AppConfig } from '../../types';\nimport { useWixPatternsContainer } from '@wix/patterns';\n\nconst pageTypeToRouteType: Record<string, RouteType> = {\n collectionPage: 'collection',\n entityPage: 'editEntity',\n};\n\nexport const AutoPatternsRoutes = ({ config }: { config: AppConfig }) => {\n const { getPagePath } = usePagePath(config);\n const { layoutType } = useWixPatternsContainer();\n\n if (layoutType === 'panel') {\n return (\n <>\n {config.pages.map((page) => {\n return <AutoPatternsPage key={page.id} pageConfig={page} />;\n })}\n </>\n );\n }\n\n const mainPage = config.pages.find((page) => page.appMainPage);\n\n const routes = config.pages\n .map((page) => {\n const routePath = getPagePath(page.id);\n\n if (!routePath) {\n return null;\n }\n\n return (\n <PatternsReactRoute\n key={page.id}\n type={pageTypeToRouteType[page.type] ?? 'other'}\n path={routePath}\n element={<AutoPatternsPage pageConfig={page} />}\n />\n );\n })\n .filter(Boolean);\n\n if (mainPage) {\n const mainPagePath = getPagePath(mainPage.id);\n\n if (mainPagePath) {\n routes.push(\n <PatternsReactRoute\n key=\"main-redirect\"\n type=\"other\"\n path=\"/\"\n element={<Navigate to={mainPagePath} />}\n />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,CAACb,kBAAkB;MACjBkB,GAAG,EAAED,IAAI,CAACE,EAAG;MACbO,IAAI,EAAErB,mBAAmB,CAACY,IAAI,CAACS,IAAI,CAAC,IAAI,OAAQ;MAChDC,IAAI,EAAEF,SAAU;MAChBG,OAAO,eAAE9B,KAAA,CAAAe,aAAA,CAACX,gBAAgB;QAACkB,UAAU,EAAEH;MAAK,CAAE;IAAE,CACjD,CAAC;EAEN,CAAC,CAAC,CACDY,MAAM,CAACC,OAAO,CAAC;EAElB,IAAIT,QAAQ,EAAE;IACZ,MAAMU,YAAY,GAAGpB,WAAW,CAACU,QAAQ,CAACF,EAAE,CAAC;IAE7C,IAAIY,YAAY,EAAE;MAChBP,MAAM,CAACQ,IAAI,cACTlC,KAAA,CAAAe,aAAA,CAACb,kBAAkB;QACjBkB,GAAG,EAAC,eAAe;QACnBQ,IAAI,EAAC,OAAO;QACZC,IAAI,EAAC,GAAG;QACRC,OAAO,eAAE9B,KAAA,CAAAe,aAAA,CAACV,QAAQ;UAAC8B,EAAE,EAAEF;QAAa,CAAE;MAAE,CACzC,CACH,CAAC;IACH;EACF;EAEA,oBAAOjC,KAAA,CAAAe,aAAA,CAACZ,mBAAmB,QAAEuB,MAA4B,CAAC;AAC5D,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","usePagePath","PatternsReactRoute","PatternsReactRouter","AutoPatternsPage","Navigate","useWixPatternsContainer","pageTypeToRouteType","collectionPage","entityPage","settingsPage","AutoPatternsRoutes","_ref","config","getPagePath","layoutType","createElement","Fragment","pages","map","page","key","id","pageConfig","mainPage","find","appMainPage","routes","routePath","type","path","element","filter","Boolean","mainPagePath","push","to"],"sources":["../../../../src/components/AutoPatternsRoute/AutoPatternsRoutes.tsx"],"sourcesContent":["import React from 'react';\nimport { usePagePath } from '../../hooks';\nimport { PatternsReactRoute, PatternsReactRouter } from '@wix/patterns/router';\nimport { AutoPatternsPage } from './AutoPatternsPage';\nimport type { RouteType } from '@wix/patterns/dist/types/components/Router/types';\nimport { Navigate } from 'react-router-dom';\nimport { AppConfig } from '../../types';\nimport { useWixPatternsContainer } from '@wix/patterns';\n\nconst pageTypeToRouteType: Record<string, RouteType> = {\n collectionPage: 'collection',\n entityPage: 'editEntity',\n settingsPage: 'other',\n};\n\nexport const AutoPatternsRoutes = ({ config }: { config: AppConfig }) => {\n const { getPagePath } = usePagePath(config);\n const { layoutType } = useWixPatternsContainer();\n\n if (layoutType === 'panel') {\n return (\n <>\n {config.pages.map((page) => {\n return <AutoPatternsPage key={page.id} pageConfig={page} />;\n })}\n </>\n );\n }\n\n const mainPage = config.pages.find((page) => page.appMainPage);\n\n const routes = config.pages\n .map((page) => {\n const routePath = getPagePath(page.id);\n\n if (!routePath) {\n return null;\n }\n\n return (\n <PatternsReactRoute\n key={page.id}\n type={pageTypeToRouteType[page.type] ?? 'other'}\n path={routePath}\n element={<AutoPatternsPage pageConfig={page} />}\n />\n );\n })\n .filter(Boolean);\n\n if (mainPage) {\n const mainPagePath = getPagePath(mainPage.id);\n\n if (mainPagePath) {\n routes.push(\n <PatternsReactRoute\n key=\"main-redirect\"\n type=\"other\"\n path=\"/\"\n element={<Navigate to={mainPagePath} />}\n />,\n );\n }\n }\n\n return <PatternsReactRouter>{routes}</PatternsReactRouter>;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,kBAAkB,EAAEC,mBAAmB,QAAQ,sBAAsB;AAC9E,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,SAASC,QAAQ,QAAQ,kBAAkB;AAE3C,SAASC,uBAAuB,QAAQ,eAAe;AAEvD,MAAMC,mBAA8C,GAAG;EACrDC,cAAc,EAAE,YAAY;EAC5BC,UAAU,EAAE,YAAY;EACxBC,YAAY,EAAE;AAChB,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAGC,IAAA,IAAuC;EAAA,IAAtC;IAAEC;EAA8B,CAAC,GAAAD,IAAA;EAClE,MAAM;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aAAA,CAACd,kBAAkB;QACjBmB,GAAG,EAAC,eAAe;QACnBQ,IAAI,EAAC,OAAO;QACZC,IAAI,EAAC,GAAG;QACRC,OAAO,eAAE/B,KAAA,CAAAgB,aAAA,CAACX,QAAQ;UAAC+B,EAAE,EAAEF;QAAa,CAAE;MAAE,CACzC,CACH,CAAC;IACH;EACF;EAEA,oBAAOlC,KAAA,CAAAgB,aAAA,CAACb,mBAAmB,QAAEwB,MAA4B,CAAC;AAC5D,CAAC","ignoreList":[]}
@@ -0,0 +1,108 @@
1
+ import React, { useRef } from 'react';
2
+ import { errorHandler } from '@wix/essentials';
3
+ import { MoreActions, SettingsPage, useSettingsPage, useSettings } from '@wix/patterns';
4
+ import { useForm } from '@wix/patterns/form';
5
+ import { ContentCard } from '../layouts/ContentCard';
6
+ import { useSettingsPageMoreActions } from '../../hooks/useSettingsPageMoreActions';
7
+ import { useBaseSDK } from '../../hooks/useBaseSDK';
8
+ import { useSchema } from '../../providers/SchemaContext';
9
+ export const AutoPatternsSettingsPage = _ref => {
10
+ var _pageLayout$main, _pageLayout$sidebar;
11
+ let {
12
+ configuration
13
+ } = _ref;
14
+ const {
15
+ title,
16
+ subtitle,
17
+ actions: pageActions,
18
+ layout: pageLayout
19
+ } = configuration;
20
+ const schema = useSchema();
21
+ const {
22
+ fields,
23
+ actions
24
+ } = schema;
25
+ const form = useForm({
26
+ mode: 'onChange'
27
+ });
28
+ const inputRefs = useRef({});
29
+ const setInputRef = (id, input) => {
30
+ inputRefs.current[id] = input;
31
+ };
32
+ const validate = () => {
33
+ const invalidFieldId = Object.keys(inputRefs.current).find(fieldId => {
34
+ var _inputRefs$current$fi;
35
+ // change to get
36
+ return (_inputRefs$current$fi = inputRefs.current[fieldId]) == null ? void 0 : _inputRefs$current$fi.invalid;
37
+ });
38
+ if (invalidFieldId) {
39
+ var _inputRefs$current$in;
40
+ (_inputRefs$current$in = inputRefs.current[invalidFieldId]) == null || _inputRefs$current$in.focus == null || _inputRefs$current$in.focus();
41
+ throw new Error('Invalid form');
42
+ }
43
+ };
44
+ const state = useSettingsPage({
45
+ form,
46
+ saveErrorToast: err => ({
47
+ message: errorHandler.getResolvedError(err).message
48
+ }),
49
+ onCancel: async () => {
50
+ form.reset();
51
+ },
52
+ onSave: async () => {
53
+ validate();
54
+ const formValues = form.getValues();
55
+ const currentSettings = state.settings || {};
56
+ const updatedSettings = {
57
+ ...currentSettings,
58
+ ...formValues
59
+ };
60
+ await actions.update(updatedSettings);
61
+ },
62
+ fetch: async () => {
63
+ const result = await actions.get('');
64
+ return {
65
+ settings: result
66
+ };
67
+ }
68
+ });
69
+ const settings = useSettings(state);
70
+ const baseSDK = useBaseSDK();
71
+ const resolvedMoreActions = useSettingsPageMoreActions(pageActions == null ? void 0 : pageActions.moreActions, baseSDK);
72
+ return /*#__PURE__*/React.createElement(SettingsPage, {
73
+ state: state,
74
+ dataHook: "auto-patterns-settings-page"
75
+ }, /*#__PURE__*/React.createElement(SettingsPage.Header, {
76
+ title: {
77
+ ...title,
78
+ text: (title == null ? void 0 : title.text) ?? ''
79
+ },
80
+ subtitle: subtitle,
81
+ moreActions: resolvedMoreActions.length > 0 ? /*#__PURE__*/React.createElement(MoreActions, {
82
+ items: resolvedMoreActions
83
+ }) : undefined
84
+ }), /*#__PURE__*/React.createElement(SettingsPage.Content, null, /*#__PURE__*/React.createElement(SettingsPage.MainContent, {
85
+ dataHook: "settings-page-main-content"
86
+ }, pageLayout == null || (_pageLayout$main = pageLayout.main) == null ? void 0 : _pageLayout$main.map((layout, layoutIndex) => /*#__PURE__*/React.createElement(ContentCard, {
87
+ type: "settings",
88
+ key: `main-section-card-${layoutIndex}`,
89
+ layout: layout,
90
+ sectionId: "main",
91
+ cardIndex: layoutIndex,
92
+ setInputRef: setInputRef,
93
+ fields: fields,
94
+ form: form,
95
+ data: settings
96
+ }))), pageLayout != null && pageLayout.sidebar ? /*#__PURE__*/React.createElement(SettingsPage.AdditionalContent, null, (_pageLayout$sidebar = pageLayout.sidebar) == null ? void 0 : _pageLayout$sidebar.map((layout, layoutIndex) => /*#__PURE__*/React.createElement(ContentCard, {
97
+ type: "settings",
98
+ key: `sidebar-section-card-${layoutIndex}`,
99
+ layout: layout,
100
+ sectionId: "sidebar",
101
+ cardIndex: layoutIndex,
102
+ setInputRef: setInputRef,
103
+ fields: fields,
104
+ form: form,
105
+ data: settings
106
+ }))) : null));
107
+ };
108
+ //# sourceMappingURL=AutoPatternsSettingsPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useRef","errorHandler","MoreActions","SettingsPage","useSettingsPage","useSettings","useForm","ContentCard","useSettingsPageMoreActions","useBaseSDK","useSchema","AutoPatternsSettingsPage","_ref","_pageLayout$main","_pageLayout$sidebar","configuration","title","subtitle","actions","pageActions","layout","pageLayout","schema","fields","form","mode","inputRefs","setInputRef","id","input","current","validate","invalidFieldId","Object","keys","find","fieldId","_inputRefs$current$fi","invalid","_inputRefs$current$in","focus","Error","state","saveErrorToast","err","message","getResolvedError","onCancel","reset","onSave","formValues","getValues","currentSettings","settings","updatedSettings","update","fetch","result","get","baseSDK","resolvedMoreActions","moreActions","createElement","dataHook","Header","text","length","items","undefined","Content","MainContent","main","map","layoutIndex","type","key","sectionId","cardIndex","data","sidebar","AdditionalContent"],"sources":["../../../../src/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { errorHandler } from '@wix/essentials';\nimport {\n MoreActions,\n SettingsPage,\n SettingsPageState,\n useSettingsPage,\n useSettings,\n} from '@wix/patterns';\nimport { useForm } from '@wix/patterns/form';\nimport { ContentCard } from '../layouts/ContentCard';\nimport { SettingsPageConfig, BaseInputRef } from '../../types';\nimport { useSettingsPageMoreActions } from '../../hooks/useSettingsPageMoreActions';\nimport { useBaseSDK } from '../../hooks/useBaseSDK';\nimport { useSchema } from '../../providers/SchemaContext';\n\nexport const AutoPatternsSettingsPage: React.FC<{\n configuration: SettingsPageConfig;\n}> = ({ configuration }) => {\n const {\n title,\n subtitle,\n actions: pageActions,\n layout: pageLayout,\n } = configuration;\n\n const schema = useSchema();\n const { fields, actions } = schema;\n\n const form = useForm<any>({\n mode: 'onChange',\n });\n\n const inputRefs = useRef<{ [fieldId: string]: BaseInputRef }>({});\n\n const setInputRef = (id: string, input: BaseInputRef) => {\n inputRefs.current[id] = input;\n };\n\n const validate = () => {\n const invalidFieldId = Object.keys(inputRefs.current).find((fieldId) => {\n // change to get\n return inputRefs.current[fieldId]?.invalid;\n });\n\n if (invalidFieldId) {\n inputRefs.current[invalidFieldId]?.focus?.();\n throw new Error('Invalid form');\n }\n };\n\n const state: SettingsPageState<any> = useSettingsPage<any, any>({\n form,\n saveErrorToast: (err) => ({\n message: errorHandler.getResolvedError(err).message,\n }),\n onCancel: async () => {\n form.reset();\n },\n onSave: async () => {\n validate();\n\n const formValues = form.getValues();\n const currentSettings = state.settings || {};\n const updatedSettings = {\n ...currentSettings,\n ...formValues,\n };\n\n await actions.update(updatedSettings);\n },\n fetch: async () => {\n const result = await actions.get('');\n return { settings: result };\n },\n });\n\n const settings = useSettings(state);\n\n const baseSDK = useBaseSDK();\n const resolvedMoreActions = useSettingsPageMoreActions(\n pageActions?.moreActions,\n baseSDK,\n );\n\n return (\n <SettingsPage state={state} dataHook=\"auto-patterns-settings-page\">\n <SettingsPage.Header\n title={{ ...title, text: title?.text ?? '' }}\n subtitle={subtitle}\n moreActions={\n resolvedMoreActions.length > 0 ? (\n <MoreActions items={resolvedMoreActions} />\n ) : undefined\n }\n />\n <SettingsPage.Content>\n <SettingsPage.MainContent dataHook=\"settings-page-main-content\">\n {pageLayout?.main?.map((layout, layoutIndex) => (\n <ContentCard\n type=\"settings\"\n key={`main-section-card-${layoutIndex}`}\n layout={layout}\n sectionId=\"main\"\n cardIndex={layoutIndex}\n setInputRef={setInputRef}\n fields={fields}\n form={form}\n data={settings}\n />\n ))}\n </SettingsPage.MainContent>\n {pageLayout?.sidebar ? (\n <SettingsPage.AdditionalContent>\n {pageLayout.sidebar?.map((layout, layoutIndex) => (\n <ContentCard\n type=\"settings\"\n key={`sidebar-section-card-${layoutIndex}`}\n layout={layout}\n sectionId=\"sidebar\"\n cardIndex={layoutIndex}\n setInputRef={setInputRef}\n fields={fields}\n form={form}\n data={settings}\n />\n ))}\n </SettingsPage.AdditionalContent>\n ) : null}\n </SettingsPage.Content>\n </SettingsPage>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SACEC,WAAW,EACXC,YAAY,EAEZC,eAAe,EACfC,WAAW,QACN,eAAe;AACtB,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,WAAW,QAAQ,wBAAwB;AAEpD,SAASC,0BAA0B,QAAQ,wCAAwC;AACnF,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,SAAS,QAAQ,+BAA+B;AAEzD,OAAO,MAAMC,wBAEX,GAAGC,IAAA,IAAuB;EAAA,IAAAC,gBAAA,EAAAC,mBAAA;EAAA,IAAtB;IAAEC;EAAc,CAAC,GAAAH,IAAA;EACrB,MAAM;IACJI,KAAK;IACLC,QAAQ;IACRC,OAAO,EAAEC,WAAW;IACpBC,MAAM,EAAEC;EACV,CAAC,GAAGN,aAAa;EAEjB,MAAMO,MAAM,GAAGZ,SAAS,CAAC,CAAC;EAC1B,MAAM;IAAEa,MAAM;IAAEL;EAAQ,CAAC,GAAGI,MAAM;EAElC,MAAME,IAAI,GAAGlB,OAAO,CAAM;IACxBmB,IAAI,EAAE;EACR,CAAC,CAAC;EAEF,MAAMC,SAAS,GAAG1B,MAAM,CAAsC,CAAC,CAAC,CAAC;EAEjE,MAAM2B,WAAW,GAAGA,CAACC,EAAU,EAAEC,KAAmB,KAAK;IACvDH,SAAS,CAACI,OAAO,CAACF,EAAE,CAAC,GAAGC,KAAK;EAC/B,CAAC;EAED,MAAME,QAAQ,GAAGA,CAAA,KAAM;IACrB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ACXsD,IAAI,EAAEzB;EAAS,CAChB,CACF,CACuB,CAAC,EAC1BhC,UAAU,YAAVA,UAAU,CAAE0D,OAAO,gBAClBhF,KAAA,CAAA+D,aAAA,CAAC3D,YAAY,CAAC6E,iBAAiB,SAAAlE,mBAAA,GAC5BO,UAAU,CAAC0D,OAAO,qBAAlBjE,mBAAA,CAAoB0D,GAAG,CAAC,CAACpD,MAAM,EAAEqD,WAAW,kBAC3C1E,KAAA,CAAA+D,aAAA,CAACvD,WAAW;IACVmE,IAAI,EAAC,UAAU;IACfC,GAAG,EAAE,wBAAwBF,WAAW,EAAG;IAC3CrD,MAAM,EAAEA,MAAO;IACfwD,SAAS,EAAC,SAAS;IACnBC,SAAS,EAAEJ,WAAY;IACvB9C,WAAW,EAAEA,WAAY;IACzBJ,MAAM,EAAEA,MAAO;IACfC,IAAI,EAAEA,IAAK;IACXsD,IAAI,EAAEzB;EAAS,CAChB,CACF,CAC6B,CAAC,GAC/B,IACgB,CACV,CAAC;AAEnB,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import { SettingsPageUniDriver } from '@wix/patterns/testkit/unidriver';
2
+ import { baseUniDriverFactory } from '../AutoPatternsApp/AutoPatternsApp.uni.driver';
3
+ export const AutoPatternsSettingsPageUniDriver = (base, body) => {
4
+ const settingsPageDriver = SettingsPageUniDriver(base, body);
5
+ return {
6
+ ...baseUniDriverFactory(base),
7
+ ...settingsPageDriver
8
+ };
9
+ };
10
+ //# sourceMappingURL=AutoPatternsSettingsPage.uni.driver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SettingsPageUniDriver","baseUniDriverFactory","AutoPatternsSettingsPageUniDriver","base","body","settingsPageDriver"],"sources":["../../../../src/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.ts"],"sourcesContent":["import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';\nimport { SettingsPageUniDriver } from '@wix/patterns/testkit/unidriver';\nimport { baseUniDriverFactory } from '../AutoPatternsApp/AutoPatternsApp.uni.driver';\n\nexport const AutoPatternsSettingsPageUniDriver = (\n base: UniDriver,\n body: UniDriver,\n) => {\n const settingsPageDriver = SettingsPageUniDriver(base, body);\n\n return {\n ...baseUniDriverFactory(base),\n ...settingsPageDriver,\n };\n};\n"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,iCAAiC;AACvE,SAASC,oBAAoB,QAAQ,+CAA+C;AAEpF,OAAO,MAAMC,iCAAiC,GAAGA,CAC/CC,IAAe,EACfC,IAAe,KACZ;EACH,MAAMC,kBAAkB,GAAGL,qBAAqB,CAACG,IAAI,EAAEC,IAAI,CAAC;EAE5D,OAAO;IACL,GAAGH,oBAAoB,CAACE,IAAI,CAAC;IAC7B,GAAGE;EACL,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export * from './AutoPatternsSettingsPage';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../../../src/components/AutoPatternsSettingsPage/index.ts"],"sourcesContent":["export * from './AutoPatternsSettingsPage';\n"],"mappings":"AAAA,cAAc,4BAA4B","ignoreList":[]}
@@ -1,50 +1,134 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import { Table } from '@wix/patterns';
4
- import { useTableFeatures } from '../../hooks';
5
- export const AutoPatternsTable = _ref => {
6
- let {
7
- configuration
8
- } = _ref;
2
+ import React, { useMemo, useState } from 'react';
3
+ import { Table, TableState, useCreateCollection, useSelector, useTableCollection, useWixPatternsContainer } from '@wix/patterns';
4
+ import { useBasePatternsStateParams } from '../../hooks/useBasePatternsStateParams';
5
+ import { useTableFeaturesAsync } from '../../hooks/useTableFeaturesAsync';
6
+ import { useBaseCollectionComponentReadyFeatures } from '../../hooks/useBaseCollectionComponentReadyFeatures';
7
+ /**
8
+ * AutoPatternsTableLoaded - Step 4 in Table Flow
9
+ *
10
+ * FLOW 1: AutoPatternsCollectionComponent → AutoPatternsTable → useTableFeaturesAsync → [AutoPatternsTableLoaded] → useBaseCollectionComponentReadyFeatures → Table
11
+ *
12
+ * This component renders when all async features have been loaded and are ready.
13
+ * It represents the "loaded" state of the table flow and handles:
14
+ *
15
+ * Key Responsibilities:
16
+ * - Creates the table collection state using loaded async features
17
+ * - Calls useBaseCollectionComponentReadyFeatures for final feature preparation
18
+ * - Extracts and applies table-specific features (baseTableFeatures, sections, dragAndDrop)
19
+ * - Renders the final Table component with all features combined
20
+ * - Merges all feature props into a single props object for the Table
21
+ */
22
+ const AutoPatternsTableLoaded = props => {
9
23
  const {
10
- state,
11
- columns,
12
- customColumns,
13
- search,
14
- title,
15
- emptyState,
16
- filters,
17
- views,
18
- actionCell,
19
- bulkActionToolbar,
20
- onRowClick,
21
- stickyColumns,
22
- stickySelectionColumn,
23
- showTitleBar,
24
+ config,
25
+ asyncFeaturesState,
26
+ baseStateParams,
27
+ dataHook
28
+ } = props;
29
+
30
+ // Extract loaded async features from the successful feature loading state
31
+ const {
32
+ baseTableFeatures,
24
33
  sections,
25
- dragAndDropProps,
26
- dataExtension
27
- } = useTableFeatures(configuration);
34
+ dragAndDrop
35
+ } = useSelector(() => ({
36
+ ...asyncFeaturesState.status.data
37
+ }));
38
+
39
+ // Create table collection state with the loaded async dependencies
40
+ const state = useTableCollection(baseStateParams.params);
41
+
42
+ // STEP 5: Call shared hook that prepares final collection features
43
+ // This hook is shared across all three flows (Table, Grid, TableGridSwitch)
44
+ const baseCollectionComponentReadyFeatures = useBaseCollectionComponentReadyFeatures({
45
+ config,
46
+ collection: state.collection,
47
+ asyncFeaturesState,
48
+ baseStateParams
49
+ });
50
+
51
+ // Extract feature-specific props from loaded features
52
+ const dragAndDropProps = dragAndDrop == null || dragAndDrop.useTableDragAndDrop == null ? void 0 : dragAndDrop.useTableDragAndDrop(config);
53
+ const baseTableFeaturesProps = baseTableFeatures == null ? void 0 : baseTableFeatures.useBaseTableFeatures(config);
54
+ const sectionsProps = sections == null ? void 0 : sections.useTableSections(config);
55
+
56
+ // FINAL STEP: Render the fully-featured Table component
57
+ // Combines all loaded features into final table props
28
58
  return /*#__PURE__*/React.createElement(Table, _extends({
29
- dataHook: "auto-patterns-table",
30
- search: search,
31
- title: title,
59
+ dataHook: dataHook,
32
60
  state: state,
33
- columns: columns,
34
- dataExtension: dataExtension,
35
- customColumns: customColumns
36
- }, dragAndDropProps, {
37
- actionCell: actionCell,
38
- filters: filters,
39
- views: views,
40
- emptyState: emptyState,
41
- bulkActionToolbar: bulkActionToolbar,
42
- onRowClick: onRowClick,
43
- horizontalScroll: true,
44
- stickyColumns: stickyColumns,
45
- stickySelectionColumn: stickySelectionColumn,
46
- showTitleBar: showTitleBar,
47
- sections: sections
61
+ columns: [],
62
+ useNewInfiniteScrollLoader: true
63
+ }, sectionsProps && {
64
+ sections: sectionsProps
65
+ }, baseTableFeaturesProps, baseCollectionComponentReadyFeatures, dragAndDropProps));
66
+ };
67
+
68
+ /**
69
+ * AutoPatternsTable - Step 2 in Table Flow
70
+ *
71
+ * FLOW 1: AutoPatternsCollectionComponent → [AutoPatternsTable] → useTableFeaturesAsync → AutoPatternsTableLoaded → useBaseCollectionComponentReadyFeatures → Table
72
+ *
73
+ * This is the main table component that orchestrates the table rendering flow.
74
+ * It handles the loading states and coordinates between async feature loading and final rendering.
75
+ *
76
+ * Key Responsibilities:
77
+ * - Prepares visible field IDs from table column configuration
78
+ * - Calls useTableFeaturesAsync (Step 3) to load table-specific async features
79
+ * - Creates initial table state with basic collection
80
+ * - Monitors loading status and switches between loading/loaded states
81
+ * - Renders skeleton table during loading or AutoPatternsTableLoaded when ready
82
+ */
83
+ export const AutoPatternsTable = props => {
84
+ const {
85
+ config
86
+ } = props;
87
+
88
+ // Extract visible field IDs from table columns for data fetching optimization
89
+ const visibleFieldIds = useMemo(() => config.columns.map(column => column.id), [config]);
90
+
91
+ // Initialize base state parameters with collection config and visible fields
92
+ const baseStateParams = useBasePatternsStateParams(config, {
93
+ visibleFieldIds
94
+ });
95
+
96
+ // STEP 3: Load table-specific async features (drag&drop, sections, base table features)
97
+ const {
98
+ asyncFeaturesState
99
+ } = useTableFeaturesAsync({
100
+ config
101
+ });
102
+
103
+ // Create patterns container and collection factory
104
+ const container = useWixPatternsContainer();
105
+ const createCollection = useCreateCollection();
106
+
107
+ // Initialize table state with basic collection (used during loading)
108
+ const [state] = useState(() => new TableState({
109
+ collection: createCollection(baseStateParams.params),
110
+ container
48
111
  }));
112
+
113
+ // Monitor async features loading status
114
+ const isReady = useSelector(() => asyncFeaturesState.status.isSuccess || asyncFeaturesState.status.isError);
115
+ const dataHook = 'auto-patterns-table';
116
+ if (isReady) {
117
+ // STEP 4: All features loaded - render the fully-featured table
118
+ return /*#__PURE__*/React.createElement(AutoPatternsTableLoaded, {
119
+ dataHook: dataHook,
120
+ config: config,
121
+ baseStateParams: baseStateParams,
122
+ asyncFeaturesState: asyncFeaturesState
123
+ });
124
+ }
125
+
126
+ // LOADING STATE: Render basic table skeleton while features are loading
127
+ return /*#__PURE__*/React.createElement(Table, {
128
+ dataHook: dataHook,
129
+ useNewInfiniteScrollLoader: true,
130
+ state: state,
131
+ columns: []
132
+ });
49
133
  };
50
134
  //# sourceMappingURL=AutoPatternsTable.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Table","useTableFeatures","AutoPatternsTable","_ref","configuration","state","columns","customColumns","search","title","emptyState","filters","views","actionCell","bulkActionToolbar","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","sections","dragAndDropProps","dataExtension","createElement","_extends","dataHook","horizontalScroll"],"sources":["../../../../src/components/AutoPatternsTable/AutoPatternsTable.tsx"],"sourcesContent":["import React from 'react';\nimport { Table } from '@wix/patterns';\nimport { TableConfig } from '../../types';\nimport { useTableFeatures } from '../../hooks';\n\nexport interface AutoPatternsTableContentProps {\n configuration: TableConfig;\n}\n\nexport const AutoPatternsTable = ({\n configuration,\n}: AutoPatternsTableContentProps) => {\n const {\n state,\n columns,\n customColumns,\n search,\n title,\n emptyState,\n filters,\n views,\n actionCell,\n bulkActionToolbar,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n sections,\n dragAndDropProps,\n dataExtension,\n } = useTableFeatures(configuration);\n\n return (\n <Table\n dataHook=\"auto-patterns-table\"\n search={search}\n title={title}\n state={state}\n columns={columns}\n dataExtension={dataExtension}\n customColumns={customColumns}\n {...dragAndDropProps}\n actionCell={actionCell}\n filters={filters}\n views={views}\n emptyState={emptyState}\n bulkActionToolbar={bulkActionToolbar}\n onRowClick={onRowClick}\n horizontalScroll\n stickyColumns={stickyColumns}\n stickySelectionColumn={stickySelectionColumn}\n showTitleBar={showTitleBar}\n sections={sections}\n />\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,QAAQ,eAAe;AAErC,SAASC,gBAAgB,QAAQ,aAAa;AAM9C,OAAO,MAAMC,iBAAiB,GAAGC,IAAA,IAEI;EAAA,IAFH;IAChCC;EAC6B,CAAC,GAAAD,IAAA;EAC9B,MAAM;IACJE,KAAK;IACLC,OAAO;IACPC,aAAa;IACbC,MAAM;IACNC,KAAK;IACLC,UAAU;IACVC,OAAO;IACPC,KAAK;IACLC,UAAU;IACVC,iBAAiB;IACjBC,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBC,YAAY;IACZC,QAAQ;IACRC,gBAAgB;IAChBC;EACF,CAAC,GAAGpB,gBAAgB,CAACG,aAAa,CAAC;EAEnC,oBACEL,KAAA,CAAAuB,aAAA,CAACtB,KAAK,EAAAuB,QAAA;IACJC,QAAQ,EAAC,qBAAqB;IAC9BhB,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA,KAAM;IACbJ,KAAK,EAAEA,KAAM;IACbC,OAAO,EAAEA,OAAQ;IACjBe,aAAa,EAAEA,aAAc;IAC7Bd,aAAa,EAAEA;EAAc,GACzBa,gBAAgB;IACpBP,UAAU,EAAEA,UAAW;IACvBF,OAAO,EAAEA,OAAQ;IACjBC,KAAK,EAAEA,KAAM;IACbF,UAAU,EAAEA,UAAW;IACvBI,iBAAiB,EAAEA,iBAAkB;IACrCC,UAAU,EAAEA,UAAW;IACvBU,gBAAgB;IAChBT,aAAa,EAAEA,aAAc;IAC7BC,qBAAqB,EAAEA,qBAAsB;IAC7CC,YAAY,EAAEA,YAAa;IAC3BC,QAAQ,EAAEA;EAAS,EACpB,CAAC;AAEN,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","useState","Table","TableState","useCreateCollection","useSelector","useTableCollection","useWixPatternsContainer","useBasePatternsStateParams","useTableFeaturesAsync","useBaseCollectionComponentReadyFeatures","AutoPatternsTableLoaded","props","config","asyncFeaturesState","baseStateParams","dataHook","baseTableFeatures","sections","dragAndDrop","status","data","state","params","baseCollectionComponentReadyFeatures","collection","dragAndDropProps","useTableDragAndDrop","baseTableFeaturesProps","useBaseTableFeatures","sectionsProps","useTableSections","createElement","_extends","columns","useNewInfiniteScrollLoader","AutoPatternsTable","visibleFieldIds","map","column","id","container","createCollection","isReady","isSuccess","isError"],"sources":["../../../../src/components/AutoPatternsTable/AutoPatternsTable.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport {\n Table,\n TableState,\n useCreateCollection,\n useSelector,\n useTableCollection,\n useWixPatternsContainer,\n} from '@wix/patterns';\nimport { TableConfig } from '../../types';\nimport { useBasePatternsStateParams } from '../../hooks/useBasePatternsStateParams';\nimport { useTableFeaturesAsync } from '../../hooks/useTableFeaturesAsync';\nimport { useBaseCollectionComponentReadyFeatures } from '../../hooks/useBaseCollectionComponentReadyFeatures';\n\nexport interface AutoPatternsTableContentProps {\n config: TableConfig;\n}\n\n/**\n * AutoPatternsTableLoaded - Step 4 in Table Flow\n *\n * FLOW 1: AutoPatternsCollectionComponent → AutoPatternsTable → useTableFeaturesAsync → [AutoPatternsTableLoaded] → useBaseCollectionComponentReadyFeatures → Table\n *\n * This component renders when all async features have been loaded and are ready.\n * It represents the \"loaded\" state of the table flow and handles:\n *\n * Key Responsibilities:\n * - Creates the table collection state using loaded async features\n * - Calls useBaseCollectionComponentReadyFeatures for final feature preparation\n * - Extracts and applies table-specific features (baseTableFeatures, sections, dragAndDrop)\n * - Renders the final Table component with all features combined\n * - Merges all feature props into a single props object for the Table\n */\nconst AutoPatternsTableLoaded = (\n props: NonNullable<ReturnType<typeof useTableFeaturesAsync>> &\n AutoPatternsTableContentProps & {\n baseStateParams: ReturnType<typeof useBasePatternsStateParams>;\n dataHook?: string;\n },\n) => {\n const { config, asyncFeaturesState, baseStateParams, dataHook } = props;\n\n // Extract loaded async features from the successful feature loading state\n const { baseTableFeatures, sections, dragAndDrop } = useSelector(() => ({\n ...asyncFeaturesState.status.data,\n }));\n\n // Create table collection state with the loaded async dependencies\n const state = useTableCollection<any>(baseStateParams.params);\n\n // STEP 5: Call shared hook that prepares final collection features\n // This hook is shared across all three flows (Table, Grid, TableGridSwitch)\n const baseCollectionComponentReadyFeatures =\n useBaseCollectionComponentReadyFeatures({\n config,\n collection: state.collection,\n asyncFeaturesState,\n baseStateParams,\n });\n\n // Extract feature-specific props from loaded features\n const dragAndDropProps = dragAndDrop?.useTableDragAndDrop?.(config);\n const baseTableFeaturesProps =\n baseTableFeatures?.useBaseTableFeatures(config);\n const sectionsProps = sections?.useTableSections(config);\n\n // FINAL STEP: Render the fully-featured Table component\n // Combines all loaded features into final table props\n return (\n <Table\n dataHook={dataHook}\n state={state}\n columns={[]}\n useNewInfiniteScrollLoader\n {...(sectionsProps && { sections: sectionsProps })}\n {...baseTableFeaturesProps}\n {...baseCollectionComponentReadyFeatures}\n {...dragAndDropProps}\n />\n );\n};\n\n/**\n * AutoPatternsTable - Step 2 in Table Flow\n *\n * FLOW 1: AutoPatternsCollectionComponent → [AutoPatternsTable] → useTableFeaturesAsync → AutoPatternsTableLoaded → useBaseCollectionComponentReadyFeatures → Table\n *\n * This is the main table component that orchestrates the table rendering flow.\n * It handles the loading states and coordinates between async feature loading and final rendering.\n *\n * Key Responsibilities:\n * - Prepares visible field IDs from table column configuration\n * - Calls useTableFeaturesAsync (Step 3) to load table-specific async features\n * - Creates initial table state with basic collection\n * - Monitors loading status and switches between loading/loaded states\n * - Renders skeleton table during loading or AutoPatternsTableLoaded when ready\n */\nexport const AutoPatternsTable = (props: AutoPatternsTableContentProps) => {\n const { config } = props;\n\n // Extract visible field IDs from table columns for data fetching optimization\n const visibleFieldIds = useMemo(\n () => config.columns.map((column) => column.id),\n [config],\n );\n\n // Initialize base state parameters with collection config and visible fields\n const baseStateParams = useBasePatternsStateParams(config, {\n visibleFieldIds,\n });\n\n // STEP 3: Load table-specific async features (drag&drop, sections, base table features)\n const { asyncFeaturesState } = useTableFeaturesAsync({ config });\n\n // Create patterns container and collection factory\n const container = useWixPatternsContainer();\n const createCollection = useCreateCollection();\n\n // Initialize table state with basic collection (used during loading)\n const [state] = useState(\n () =>\n new TableState<any, {}>({\n collection: createCollection<any, {}>(baseStateParams.params),\n container,\n }),\n );\n\n // Monitor async features loading status\n const isReady = useSelector(\n () =>\n asyncFeaturesState.status.isSuccess || asyncFeaturesState.status.isError,\n );\n\n const dataHook = 'auto-patterns-table';\n\n if (isReady) {\n // STEP 4: All features loaded - render the fully-featured table\n return (\n <AutoPatternsTableLoaded\n dataHook={dataHook}\n config={config}\n baseStateParams={baseStateParams}\n asyncFeaturesState={asyncFeaturesState}\n />\n );\n }\n\n // LOADING STATE: Render basic table skeleton while features are loading\n return (\n <Table\n dataHook={dataHook}\n useNewInfiniteScrollLoader\n state={state}\n columns={[]}\n />\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAChD,SACEC,KAAK,EACLC,UAAU,EACVC,mBAAmB,EACnBC,WAAW,EACXC,kBAAkB,EAClBC,uBAAuB,QAClB,eAAe;AAEtB,SAASC,0BAA0B,QAAQ,wCAAwC;AACnF,SAASC,qBAAqB,QAAQ,mCAAmC;AACzE,SAASC,uCAAuC,QAAQ,qDAAqD;AAM7G;AAC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bY,OAAO,EAAE;EAAG,CACb,CAAC;AAEN,CAAC","ignoreList":[]}
@@ -1,14 +1,159 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import { TableGridSwitch } from '@wix/patterns';
4
- import { useTableGridSwitchFeatures } from '../../hooks/useTableGridSwitchFeatures';
5
- export const AutoPatternsTableGridSwitch = _ref => {
6
- let {
7
- configuration
8
- } = _ref;
9
- const props = useTableGridSwitchFeatures(configuration);
2
+ import React, { useMemo, useState } from 'react';
3
+ import { TableGridSwitch, TableGridSwitchState, useCreateCollection, useSelector, useTableGridSwitchCollection, useWixPatternsContainer } from '@wix/patterns';
4
+ import { useBasePatternsStateParams } from '../../hooks/useBasePatternsStateParams';
5
+ import { useTableGridSwitchFeaturesAsync } from '../../hooks/useTableGridSwitchFeaturesAsync';
6
+ import { useBaseGridFeatures } from '../../hooks/useBaseGridFeatures';
7
+ import { useBaseCollectionComponentReadyFeatures } from '../../hooks/useBaseCollectionComponentReadyFeatures';
8
+ /**
9
+ * AutoPatternsTableGridSwitchLoaded - Step 4 in TableGridSwitch Flow
10
+ *
11
+ * FLOW 3: AutoPatternsCollectionComponent → AutoPatternsTableGridSwitch → useTableGridSwitchFeaturesAsync → [AutoPatternsTableGridSwitchLoaded] → useBaseCollectionComponentReadyFeatures → TableGridSwitch
12
+ *
13
+ * This component renders when all async features have been loaded and are ready.
14
+ * It represents the "loaded" state of the table-grid switch flow and handles:
15
+ *
16
+ * Key Responsibilities:
17
+ * - Creates the table-grid-switch collection state using loaded async features
18
+ * - Calls useBaseCollectionComponentReadyFeatures for final feature preparation
19
+ * - Combines both table features (baseTableFeatures) and grid features (renderItem, preset, imagePlacement)
20
+ * - Extracts async features like dragAndDrop if enabled
21
+ * - Renders the final TableGridSwitch component with all features combined
22
+ * - Provides both table columns AND grid display props to support switching
23
+ */
24
+ const AutoPatternsTableGridSwitchLoaded = props => {
25
+ const {
26
+ config,
27
+ asyncFeaturesState,
28
+ baseStateParams,
29
+ dataHook
30
+ } = props;
31
+
32
+ // Extract grid-specific display features (for grid mode when user switches)
33
+ const {
34
+ renderItem,
35
+ imagePlacement,
36
+ preset
37
+ } = useBaseGridFeatures(config);
38
+
39
+ // Extract loaded async features from the successful feature loading state
40
+ const {
41
+ baseTableFeatures,
42
+ dragAndDrop
43
+ } = useSelector(() => ({
44
+ ...asyncFeaturesState.status.data
45
+ }));
46
+
47
+ // Create table-grid-switch collection state with the loaded async dependencies
48
+ const state = useTableGridSwitchCollection(baseStateParams.params);
49
+
50
+ // STEP 5: Call shared hook that prepares final collection features
51
+ // This hook is shared across all three flows (Table, Grid, TableGridSwitch)
52
+ const baseCollectionComponentReadyFeatures = useBaseCollectionComponentReadyFeatures({
53
+ config,
54
+ collection: state.collection,
55
+ asyncFeaturesState,
56
+ baseStateParams
57
+ });
58
+
59
+ // Extract table-grid-switch specific drag and drop props if feature is loaded
60
+ const dragAndDropProps = dragAndDrop == null || dragAndDrop.useTableGridSwitchDragAndDrop == null ? void 0 : dragAndDrop.useTableGridSwitchDragAndDrop(config);
61
+
62
+ // Extract table-specific features (for table mode when user switches)
63
+ const baseTableFeaturesProps = baseTableFeatures == null ? void 0 : baseTableFeatures.useBaseTableFeatures(config);
64
+
65
+ // FINAL STEP: Render the fully-featured TableGridSwitch component
66
+ // Combines table features, grid features, and switch functionality
10
67
  return /*#__PURE__*/React.createElement(TableGridSwitch, _extends({
11
- dataHook: "auto-patterns-table-grid-switch"
12
- }, props));
68
+ dataHook: dataHook,
69
+ preset: preset,
70
+ imagePlacement: imagePlacement,
71
+ renderItem: renderItem,
72
+ columns: [],
73
+ state: state
74
+ }, baseCollectionComponentReadyFeatures, baseTableFeaturesProps, dragAndDropProps));
75
+ };
76
+
77
+ /**
78
+ * AutoPatternsTableGridSwitch - Step 2 in TableGridSwitch Flow
79
+ *
80
+ * FLOW 3: AutoPatternsCollectionComponent → [AutoPatternsTableGridSwitch] → useTableGridSwitchFeaturesAsync → AutoPatternsTableGridSwitchLoaded → useBaseCollectionComponentReadyFeatures → TableGridSwitch
81
+ *
82
+ * This is the main table-grid-switch component that orchestrates the combined table/grid rendering flow.
83
+ * It handles both table and grid configurations simultaneously to support runtime switching.
84
+ *
85
+ * Key Responsibilities:
86
+ * - Merges visible field IDs from both table columns AND grid features for comprehensive data fetching
87
+ * - Extracts grid display features (renderItem, preset, imagePlacement) for grid mode
88
+ * - Calls useTableGridSwitchFeaturesAsync (Step 3) to load combined async features
89
+ * - Creates initial table-grid-switch state with basic collection
90
+ * - Monitors loading status and switches between loading/loaded states
91
+ * - Renders skeleton TableGridSwitch during loading or AutoPatternsTableGridSwitchLoaded when ready
92
+ */
93
+ export const AutoPatternsTableGridSwitch = props => {
94
+ const {
95
+ config
96
+ } = props;
97
+
98
+ // Extract visible field IDs from table columns (for table mode)
99
+ const tableVisibleFieldIds = useMemo(() => config.columns.map(column => column.id), [config]);
100
+
101
+ // Extract grid display features and visible field IDs (for grid mode)
102
+ const {
103
+ renderItem,
104
+ imagePlacement,
105
+ preset,
106
+ visibleFieldIds: gridVisibleFieldIds
107
+ } = useBaseGridFeatures(config);
108
+
109
+ // IMPORTANT: Merge visible fields from BOTH table AND grid to support switching
110
+ // This ensures all necessary data is loaded regardless of current view mode
111
+ const visibleFieldIds = useMemo(() => Array.from(new Set([...tableVisibleFieldIds, ...gridVisibleFieldIds])), [tableVisibleFieldIds, gridVisibleFieldIds]);
112
+
113
+ // Initialize base state parameters with collection config and combined visible fields
114
+ const baseStateParams = useBasePatternsStateParams(config, {
115
+ visibleFieldIds
116
+ });
117
+
118
+ // STEP 3: Load table-grid-switch async features (combines table + grid features)
119
+ const {
120
+ asyncFeaturesState
121
+ } = useTableGridSwitchFeaturesAsync({
122
+ config
123
+ });
124
+
125
+ // Create patterns container and collection factory
126
+ const container = useWixPatternsContainer();
127
+ const createCollection = useCreateCollection();
128
+
129
+ // Initialize table-grid-switch state with basic collection (used during loading)
130
+ const [state] = useState(() => new TableGridSwitchState({
131
+ collection: createCollection(baseStateParams.params),
132
+ container,
133
+ containerOverrides: {}
134
+ }));
135
+
136
+ // Monitor async features loading status
137
+ const isReady = useSelector(() => asyncFeaturesState.status.isSuccess || asyncFeaturesState.status.isError);
138
+ const dataHook = 'auto-patterns-table-grid-switch';
139
+ if (isReady) {
140
+ // STEP 4: All features loaded - render the fully-featured table-grid-switch
141
+ return /*#__PURE__*/React.createElement(AutoPatternsTableGridSwitchLoaded, {
142
+ dataHook: dataHook,
143
+ config: config,
144
+ baseStateParams: baseStateParams,
145
+ asyncFeaturesState: asyncFeaturesState
146
+ });
147
+ }
148
+
149
+ // LOADING STATE: Render basic table-grid-switch skeleton while features are loading
150
+ return /*#__PURE__*/React.createElement(TableGridSwitch, {
151
+ dataHook: dataHook,
152
+ state: state,
153
+ columns: [],
154
+ preset: preset,
155
+ imagePlacement: imagePlacement,
156
+ renderItem: renderItem
157
+ });
13
158
  };
14
159
  //# sourceMappingURL=AutoPatternsTableGridSwitch.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","TableGridSwitch","useTableGridSwitchFeatures","AutoPatternsTableGridSwitch","_ref","configuration","props","createElement","_extends","dataHook"],"sources":["../../../../src/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.tsx"],"sourcesContent":["import React from 'react';\nimport { TableGridSwitch } from '@wix/patterns';\nimport { TableGridSwitchConfig } from '../../types';\nimport { useTableGridSwitchFeatures } from '../../hooks/useTableGridSwitchFeatures';\n\nexport interface AutoPatternsTableGridSwitchProps {\n configuration: TableGridSwitchConfig;\n}\n\nexport const AutoPatternsTableGridSwitch = ({\n configuration,\n}: AutoPatternsTableGridSwitchProps) => {\n const props = useTableGridSwitchFeatures(configuration);\n return (\n <TableGridSwitch dataHook=\"auto-patterns-table-grid-switch\" {...props} />\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,QAAQ,eAAe;AAE/C,SAASC,0BAA0B,QAAQ,wCAAwC;AAMnF,OAAO,MAAMC,2BAA2B,GAAGC,IAAA,IAEH;EAAA,IAFI;IAC1CC;EACgC,CAAC,GAAAD,IAAA;EACjC,MAAME,KAAK,GAAGJ,0BAA0B,CAACG,aAAa,CAAC;EACvD,oBACEL,KAAA,CAAAO,aAAA,CAACN,eAAe,EAAAO,QAAA;IAACC,QAAQ,EAAC;EAAiC,GAAKH,KAAK,CAAG,CAAC;AAE7E,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","useState","TableGridSwitch","TableGridSwitchState","useCreateCollection","useSelector","useTableGridSwitchCollection","useWixPatternsContainer","useBasePatternsStateParams","useTableGridSwitchFeaturesAsync","useBaseGridFeatures","useBaseCollectionComponentReadyFeatures","AutoPatternsTableGridSwitchLoaded","props","config","asyncFeaturesState","baseStateParams","dataHook","renderItem","imagePlacement","preset","baseTableFeatures","dragAndDrop","status","data","state","params","baseCollectionComponentReadyFeatures","collection","dragAndDropProps","useTableGridSwitchDragAndDrop","baseTableFeaturesProps","useBaseTableFeatures","createElement","_extends","columns","AutoPatternsTableGridSwitch","tableVisibleFieldIds","map","column","id","visibleFieldIds","gridVisibleFieldIds","Array","from","Set","container","createCollection","containerOverrides","isReady","isSuccess","isError"],"sources":["../../../../src/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport {\n TableGridSwitch,\n TableGridSwitchState,\n useCreateCollection,\n useSelector,\n useTableGridSwitchCollection,\n useWixPatternsContainer,\n} from '@wix/patterns';\nimport { TableGridSwitchConfig } from '../../types';\nimport { useBasePatternsStateParams } from '../../hooks/useBasePatternsStateParams';\nimport { useTableGridSwitchFeaturesAsync } from '../../hooks/useTableGridSwitchFeaturesAsync';\nimport { useBaseGridFeatures } from '../../hooks/useBaseGridFeatures';\nimport { useBaseCollectionComponentReadyFeatures } from '../../hooks/useBaseCollectionComponentReadyFeatures';\n\nexport interface AutoPatternsTableGridSwitchProps {\n config: TableGridSwitchConfig;\n}\n\n/**\n * AutoPatternsTableGridSwitchLoaded - Step 4 in TableGridSwitch Flow\n *\n * FLOW 3: AutoPatternsCollectionComponent → AutoPatternsTableGridSwitch → useTableGridSwitchFeaturesAsync → [AutoPatternsTableGridSwitchLoaded] → useBaseCollectionComponentReadyFeatures → TableGridSwitch\n *\n * This component renders when all async features have been loaded and are ready.\n * It represents the \"loaded\" state of the table-grid switch flow and handles:\n *\n * Key Responsibilities:\n * - Creates the table-grid-switch collection state using loaded async features\n * - Calls useBaseCollectionComponentReadyFeatures for final feature preparation\n * - Combines both table features (baseTableFeatures) and grid features (renderItem, preset, imagePlacement)\n * - Extracts async features like dragAndDrop if enabled\n * - Renders the final TableGridSwitch component with all features combined\n * - Provides both table columns AND grid display props to support switching\n */\nconst AutoPatternsTableGridSwitchLoaded = (\n props: NonNullable<ReturnType<typeof useTableGridSwitchFeaturesAsync>> &\n AutoPatternsTableGridSwitchProps & {\n baseStateParams: ReturnType<typeof useBasePatternsStateParams>;\n dataHook?: string;\n },\n) => {\n const { config, asyncFeaturesState, baseStateParams, dataHook } = props;\n\n // Extract grid-specific display features (for grid mode when user switches)\n const { renderItem, imagePlacement, preset } = useBaseGridFeatures(config);\n\n // Extract loaded async features from the successful feature loading state\n const { baseTableFeatures, dragAndDrop } = useSelector(() => ({\n ...asyncFeaturesState.status.data,\n }));\n\n // Create table-grid-switch collection state with the loaded async dependencies\n const state = useTableGridSwitchCollection<any>(baseStateParams.params);\n\n // STEP 5: Call shared hook that prepares final collection features\n // This hook is shared across all three flows (Table, Grid, TableGridSwitch)\n const baseCollectionComponentReadyFeatures =\n useBaseCollectionComponentReadyFeatures({\n config,\n collection: state.collection,\n asyncFeaturesState,\n baseStateParams,\n });\n\n // Extract table-grid-switch specific drag and drop props if feature is loaded\n const dragAndDropProps = dragAndDrop?.useTableGridSwitchDragAndDrop?.(config);\n\n // Extract table-specific features (for table mode when user switches)\n const baseTableFeaturesProps =\n baseTableFeatures?.useBaseTableFeatures(config);\n\n // FINAL STEP: Render the fully-featured TableGridSwitch component\n // Combines table features, grid features, and switch functionality\n return (\n <TableGridSwitch\n dataHook={dataHook}\n preset={preset}\n imagePlacement={imagePlacement}\n renderItem={renderItem}\n columns={[]}\n state={state}\n {...baseCollectionComponentReadyFeatures}\n {...baseTableFeaturesProps}\n {...dragAndDropProps}\n />\n );\n};\n\n/**\n * AutoPatternsTableGridSwitch - Step 2 in TableGridSwitch Flow\n *\n * FLOW 3: AutoPatternsCollectionComponent → [AutoPatternsTableGridSwitch] → useTableGridSwitchFeaturesAsync → AutoPatternsTableGridSwitchLoaded → useBaseCollectionComponentReadyFeatures → TableGridSwitch\n *\n * This is the main table-grid-switch component that orchestrates the combined table/grid rendering flow.\n * It handles both table and grid configurations simultaneously to support runtime switching.\n *\n * Key Responsibilities:\n * - Merges visible field IDs from both table columns AND grid features for comprehensive data fetching\n * - Extracts grid display features (renderItem, preset, imagePlacement) for grid mode\n * - Calls useTableGridSwitchFeaturesAsync (Step 3) to load combined async features\n * - Creates initial table-grid-switch state with basic collection\n * - Monitors loading status and switches between loading/loaded states\n * - Renders skeleton TableGridSwitch during loading or AutoPatternsTableGridSwitchLoaded when ready\n */\nexport const AutoPatternsTableGridSwitch = (\n props: AutoPatternsTableGridSwitchProps,\n) => {\n const { config } = props;\n\n // Extract visible field IDs from table columns (for table mode)\n const tableVisibleFieldIds = useMemo(\n () => config.columns.map((column) => column.id),\n [config],\n );\n\n // Extract grid display features and visible field IDs (for grid mode)\n const {\n renderItem,\n imagePlacement,\n preset,\n visibleFieldIds: gridVisibleFieldIds,\n } = useBaseGridFeatures(config);\n\n // IMPORTANT: Merge visible fields from BOTH table AND grid to support switching\n // This ensures all necessary data is loaded regardless of current view mode\n const visibleFieldIds = useMemo(\n () =>\n Array.from(new Set([...tableVisibleFieldIds, ...gridVisibleFieldIds])),\n [tableVisibleFieldIds, gridVisibleFieldIds],\n );\n\n // Initialize base state parameters with collection config and combined visible fields\n const baseStateParams = useBasePatternsStateParams(config, {\n visibleFieldIds,\n });\n\n // STEP 3: Load table-grid-switch async features (combines table + grid features)\n const { asyncFeaturesState } = useTableGridSwitchFeaturesAsync({ config });\n\n // Create patterns container and collection factory\n const container = useWixPatternsContainer();\n const createCollection = useCreateCollection();\n\n // Initialize table-grid-switch state with basic collection (used during loading)\n const [state] = useState(\n () =>\n new TableGridSwitchState<any, {}>({\n collection: createCollection<any, {}>(baseStateParams.params),\n container,\n containerOverrides: {},\n }),\n );\n\n // Monitor async features loading status\n const isReady = useSelector(\n () =>\n asyncFeaturesState.status.isSuccess || asyncFeaturesState.status.isError,\n );\n\n const dataHook = 'auto-patterns-table-grid-switch';\n\n if (isReady) {\n // STEP 4: All features loaded - render the fully-featured table-grid-switch\n return (\n <AutoPatternsTableGridSwitchLoaded\n dataHook={dataHook}\n config={config}\n baseStateParams={baseStateParams}\n asyncFeaturesState={asyncFeaturesState}\n />\n );\n }\n\n // LOADING STATE: Render basic table-grid-switch skeleton while features are loading\n return (\n <TableGridSwitch\n dataHook={dataHook}\n state={state}\n columns={[]}\n preset={preset}\n imagePlacement={imagePlacement}\n renderItem={renderItem}\n />\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAChD,SACEC,eAAe,EACfC,oBAAoB,EACpBC,mBAAmB,EACnBC,WAAW,EACXC,4BAA4B,EAC5BC,uBAAuB,QAClB,eAAe;AAEtB,SAASC,0BAA0B,QAAQ,wCAAwC;AACnF,SAASC,+BAA+B,QAAQ,6CAA6C;AAC7F,SAASC,mBAAmB,QAAQ,iCAAiC;AACrE,SAASC,uCAAuC,QAAQ,qDAAqD;AAM7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,iCAAiC,GACrCC,KAIG,IACA;EACH,MAAM;IAAEC,MAAM;IAAEC,kBAAkB;IAAEC,eAAe;IAAEC;EAAS,CAAC,GAAGJ,KAAK;;EAEvE;EACA,M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EAAEA,eAAgB;MACjCD,kBAAkB,EAAEA;IAAmB,CACxC,CAAC;EAEN;;EAEA;EACA,oBACEhB,KAAA,CAAAkC,aAAA,CAAC/B,eAAe;IACde,QAAQ,EAAEA,QAAS;IACnBQ,KAAK,EAAEA,KAAM;IACbU,OAAO,EAAE,EAAG;IACZf,MAAM,EAAEA,MAAO;IACfD,cAAc,EAAEA,cAAe;IAC/BD,UAAU,EAAEA;EAAW,CACxB,CAAC;AAEN,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Checkbox","CheckboxWSR","props","field","onChange","value","createElement","checked","e","target","dataHook","id","displayName"],"sources":["../../../../src/components/fields/Checkbox.tsx"],"sourcesContent":["import React from 'react';\nimport { Checkbox as CheckboxWSR } from '@wix/design-system';\nimport { BaseInputProps } from './types';\n\nexport interface CheckboxProps extends BaseInputProps<boolean> {}\n\nexport const Checkbox = (props: CheckboxProps) => {\n const { field, onChange, value } = props;\n\n return (\n <CheckboxWSR\n checked={value}\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n dataHook={`checkbox-${field.id}`}\n >\n {field.displayName}\n </CheckboxWSR>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,IAAIC,WAAW,QAAQ,oBAAoB;AAK5D,OAAO,MAAMD,QAAQ,GAAIE,KAAoB,IAAK;EAChD,MAAM;IAAEC,KAAK;IAAEC,QAAQ;IAAEC;EAAM,CAAC,GAAGH,KAAK;EAExC,oBACEH,KAAA,CAAAO,aAAA,CAACL,WAAW;IACVM,OAAO,EAAEF,KAAM;IACfD,QAAQ,EAAGI,CAAC,IAAK;MACfJ,QAAQ,CAACI,CAAC,CAACC,MAAM,CAACF,OAAO,CAAC;IAC5B,CAAE;IACFG,QAAQ,EAAE,YAAYP,KAAK,CAACQ,EAAE;EAAG,GAEhCR,KAAK,CAACS,WACI,CAAC;AAElB,CAAC","ignoreList":[]}