@wix/auto-patterns 1.42.0 → 1.44.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 (175) 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/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +29 -74
  4. package/dist/cjs/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
  5. package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.js +147 -25
  6. package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -1
  7. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js +10 -27
  8. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -1
  9. package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js +141 -40
  10. package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
  11. package/dist/cjs/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js +169 -9
  12. package/dist/cjs/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js.map +1 -1
  13. package/dist/cjs/hooks/getCommonCollectionFeaturesAsync.js +11 -0
  14. package/dist/cjs/hooks/getCommonCollectionFeaturesAsync.js.map +1 -0
  15. package/dist/cjs/hooks/getFilterComponent.js +52 -0
  16. package/dist/cjs/hooks/getFilterComponent.js.map +1 -0
  17. package/dist/cjs/hooks/index.js +4 -11
  18. package/dist/cjs/hooks/index.js.map +1 -1
  19. package/dist/cjs/hooks/pluginsDynamicImports.js +25 -0
  20. package/dist/cjs/hooks/pluginsDynamicImports.js.map +1 -0
  21. package/dist/cjs/hooks/useAsyncFeaturesPromiseState.js +30 -0
  22. package/dist/cjs/hooks/useAsyncFeaturesPromiseState.js.map +1 -0
  23. package/dist/cjs/hooks/useBaseCollectionComponentReadyFeatures.js +62 -0
  24. package/dist/cjs/hooks/useBaseCollectionComponentReadyFeatures.js.map +1 -0
  25. package/dist/cjs/hooks/useBasePatternsStateParams.js +36 -0
  26. package/dist/cjs/hooks/useBasePatternsStateParams.js.map +1 -0
  27. package/dist/cjs/hooks/useCollectionInitAsyncDeps.js +15 -0
  28. package/dist/cjs/hooks/useCollectionInitAsyncDeps.js.map +1 -0
  29. package/dist/cjs/hooks/useCommonCollectionFeatures.js +14 -4
  30. package/dist/cjs/hooks/useCommonCollectionFeatures.js.map +1 -1
  31. package/dist/cjs/hooks/useFilters.js +17 -103
  32. package/dist/cjs/hooks/useFilters.js.map +1 -1
  33. package/dist/cjs/hooks/useFiltersState.js +112 -0
  34. package/dist/cjs/hooks/useFiltersState.js.map +1 -0
  35. package/dist/cjs/hooks/useGridFeaturesAsync.js +42 -0
  36. package/dist/cjs/hooks/useGridFeaturesAsync.js.map +1 -0
  37. package/dist/cjs/hooks/useGridVisibleFieldIds.js +17 -0
  38. package/dist/cjs/hooks/useGridVisibleFieldIds.js.map +1 -0
  39. package/dist/cjs/hooks/useSyncCollectionStateToAppContext.js +22 -0
  40. package/dist/cjs/hooks/useSyncCollectionStateToAppContext.js.map +1 -0
  41. package/dist/cjs/hooks/useTableFeaturesAsync.js +51 -0
  42. package/dist/cjs/hooks/useTableFeaturesAsync.js.map +1 -0
  43. package/dist/cjs/hooks/useTableGridSwitchFeaturesAsync.js +52 -0
  44. package/dist/cjs/hooks/useTableGridSwitchFeaturesAsync.js.map +1 -0
  45. package/dist/cjs/hooks/useTableSections.js +18 -0
  46. package/dist/cjs/hooks/useTableSections.js.map +1 -0
  47. package/dist/cjs/utils/filterCreators.js +16 -31
  48. package/dist/cjs/utils/filterCreators.js.map +1 -1
  49. package/dist/cjs/utils/minimalRequiredPatternsRuntimeCheck.js +18 -0
  50. package/dist/cjs/utils/minimalRequiredPatternsRuntimeCheck.js.map +1 -0
  51. package/dist/cjs/utils/minimalRequiredRuntimeCheck.js +21 -0
  52. package/dist/cjs/utils/minimalRequiredRuntimeCheck.js.map +1 -0
  53. package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js +14 -1
  54. package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -1
  55. package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +23 -31
  56. package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
  57. package/dist/esm/components/AutoPatternsGrid/AutoPatternsGrid.js +134 -28
  58. package/dist/esm/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -1
  59. package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js +3 -7
  60. package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -1
  61. package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js +126 -41
  62. package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
  63. package/dist/esm/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js +155 -10
  64. package/dist/esm/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js.map +1 -1
  65. package/dist/esm/hooks/getCommonCollectionFeaturesAsync.js +7 -0
  66. package/dist/esm/hooks/getCommonCollectionFeaturesAsync.js.map +1 -0
  67. package/dist/esm/hooks/getFilterComponent.js +48 -0
  68. package/dist/esm/hooks/getFilterComponent.js.map +1 -0
  69. package/dist/esm/hooks/index.js +1 -2
  70. package/dist/esm/hooks/index.js.map +1 -1
  71. package/dist/esm/hooks/pluginsDynamicImports.js +13 -0
  72. package/dist/esm/hooks/pluginsDynamicImports.js.map +1 -0
  73. package/dist/esm/hooks/useAsyncFeaturesPromiseState.js +28 -0
  74. package/dist/esm/hooks/useAsyncFeaturesPromiseState.js.map +1 -0
  75. package/dist/esm/hooks/useBaseCollectionComponentReadyFeatures.js +58 -0
  76. package/dist/esm/hooks/useBaseCollectionComponentReadyFeatures.js.map +1 -0
  77. package/dist/esm/hooks/useBasePatternsStateParams.js +32 -0
  78. package/dist/esm/hooks/useBasePatternsStateParams.js.map +1 -0
  79. package/dist/esm/hooks/useCollectionInitAsyncDeps.js +11 -0
  80. package/dist/esm/hooks/useCollectionInitAsyncDeps.js.map +1 -0
  81. package/dist/esm/hooks/useCommonCollectionFeatures.js +1 -0
  82. package/dist/esm/hooks/useCommonCollectionFeatures.js.map +1 -1
  83. package/dist/esm/hooks/useFilters.js +14 -100
  84. package/dist/esm/hooks/useFilters.js.map +1 -1
  85. package/dist/esm/hooks/useFiltersState.js +107 -0
  86. package/dist/esm/hooks/useFiltersState.js.map +1 -0
  87. package/dist/esm/hooks/useGridFeaturesAsync.js +37 -0
  88. package/dist/esm/hooks/useGridFeaturesAsync.js.map +1 -0
  89. package/dist/esm/hooks/useGridVisibleFieldIds.js +13 -0
  90. package/dist/esm/hooks/useGridVisibleFieldIds.js.map +1 -0
  91. package/dist/esm/hooks/useSyncCollectionStateToAppContext.js +18 -0
  92. package/dist/esm/hooks/useSyncCollectionStateToAppContext.js.map +1 -0
  93. package/dist/esm/hooks/useTableFeaturesAsync.js +46 -0
  94. package/dist/esm/hooks/useTableFeaturesAsync.js.map +1 -0
  95. package/dist/esm/hooks/useTableGridSwitchFeaturesAsync.js +47 -0
  96. package/dist/esm/hooks/useTableGridSwitchFeaturesAsync.js.map +1 -0
  97. package/dist/esm/hooks/useTableSections.js +14 -0
  98. package/dist/esm/hooks/useTableSections.js.map +1 -0
  99. package/dist/esm/utils/filterCreators.js +17 -32
  100. package/dist/esm/utils/filterCreators.js.map +1 -1
  101. package/dist/esm/utils/minimalRequiredPatternsRuntimeCheck.js +14 -0
  102. package/dist/esm/utils/minimalRequiredPatternsRuntimeCheck.js.map +1 -0
  103. package/dist/esm/utils/minimalRequiredRuntimeCheck.js +17 -0
  104. package/dist/esm/utils/minimalRequiredRuntimeCheck.js.map +1 -0
  105. package/dist/types/components/AutoPatternsApp/AutoPatternsApp.d.ts.map +1 -1
  106. package/dist/types/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.d.ts +6 -0
  107. package/dist/types/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.d.ts.map +1 -1
  108. package/dist/types/components/AutoPatternsGrid/AutoPatternsGrid.d.ts +17 -2
  109. package/dist/types/components/AutoPatternsGrid/AutoPatternsGrid.d.ts.map +1 -1
  110. package/dist/types/components/AutoPatternsRoute/AutoPatternsPage.d.ts.map +1 -1
  111. package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts +17 -2
  112. package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts.map +1 -1
  113. package/dist/types/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.d.ts +18 -2
  114. package/dist/types/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.d.ts.map +1 -1
  115. package/dist/types/hooks/getCommonCollectionFeaturesAsync.d.ts +4 -0
  116. package/dist/types/hooks/getCommonCollectionFeaturesAsync.d.ts.map +1 -0
  117. package/dist/types/hooks/getFilterComponent.d.ts +4 -0
  118. package/dist/types/hooks/getFilterComponent.d.ts.map +1 -0
  119. package/dist/types/hooks/index.d.ts +1 -2
  120. package/dist/types/hooks/index.d.ts.map +1 -1
  121. package/dist/types/hooks/pluginsDynamicImports.d.ts +7 -0
  122. package/dist/types/hooks/pluginsDynamicImports.d.ts.map +1 -0
  123. package/dist/types/hooks/useAsyncFeaturesPromiseState.d.ts +6 -0
  124. package/dist/types/hooks/useAsyncFeaturesPromiseState.d.ts.map +1 -0
  125. package/dist/types/hooks/useBaseCollectionComponentReadyFeatures.d.ts +36 -0
  126. package/dist/types/hooks/useBaseCollectionComponentReadyFeatures.d.ts.map +1 -0
  127. package/dist/types/hooks/useBasePatternsStateParams.d.ts +31 -0
  128. package/dist/types/hooks/useBasePatternsStateParams.d.ts.map +1 -0
  129. package/dist/types/hooks/useCollectionInitAsyncDeps.d.ts +4 -0
  130. package/dist/types/hooks/useCollectionInitAsyncDeps.d.ts.map +1 -0
  131. package/dist/types/hooks/useCommonCollectionFeatures.d.ts +1 -0
  132. package/dist/types/hooks/useCommonCollectionFeatures.d.ts.map +1 -1
  133. package/dist/types/hooks/useFilters.d.ts +9 -21
  134. package/dist/types/hooks/useFilters.d.ts.map +1 -1
  135. package/dist/types/hooks/useFiltersState.d.ts +26 -0
  136. package/dist/types/hooks/useFiltersState.d.ts.map +1 -0
  137. package/dist/types/hooks/useGridDragAndDrop.d.ts +1 -1
  138. package/dist/types/hooks/useGridFeaturesAsync.d.ts +26 -0
  139. package/dist/types/hooks/useGridFeaturesAsync.d.ts.map +1 -0
  140. package/dist/types/hooks/useGridVisibleFieldIds.d.ts +3 -0
  141. package/dist/types/hooks/useGridVisibleFieldIds.d.ts.map +1 -0
  142. package/dist/types/hooks/useSyncCollectionStateToAppContext.d.ts +6 -0
  143. package/dist/types/hooks/useSyncCollectionStateToAppContext.d.ts.map +1 -0
  144. package/dist/types/hooks/useTableFeaturesAsync.d.ts +29 -0
  145. package/dist/types/hooks/useTableFeaturesAsync.d.ts.map +1 -0
  146. package/dist/types/hooks/useTableGridSwitchDragAndDrop.d.ts +1 -1
  147. package/dist/types/hooks/useTableGridSwitchFeaturesAsync.d.ts +29 -0
  148. package/dist/types/hooks/useTableGridSwitchFeaturesAsync.d.ts.map +1 -0
  149. package/dist/types/hooks/useTableSections.d.ts +8 -0
  150. package/dist/types/hooks/useTableSections.d.ts.map +1 -0
  151. package/dist/types/utils/filterCreators.d.ts +10 -19
  152. package/dist/types/utils/filterCreators.d.ts.map +1 -1
  153. package/dist/types/utils/minimalRequiredPatternsRuntimeCheck.d.ts +5 -0
  154. package/dist/types/utils/minimalRequiredPatternsRuntimeCheck.d.ts.map +1 -0
  155. package/dist/types/utils/minimalRequiredRuntimeCheck.d.ts +9 -0
  156. package/dist/types/utils/minimalRequiredRuntimeCheck.d.ts.map +1 -0
  157. package/package.json +18 -17
  158. package/dist/cjs/hooks/useGridFeatures.js +0 -63
  159. package/dist/cjs/hooks/useGridFeatures.js.map +0 -1
  160. package/dist/cjs/hooks/useTableFeatures.js +0 -79
  161. package/dist/cjs/hooks/useTableFeatures.js.map +0 -1
  162. package/dist/cjs/hooks/useTableGridSwitchFeatures.js +0 -83
  163. package/dist/cjs/hooks/useTableGridSwitchFeatures.js.map +0 -1
  164. package/dist/esm/hooks/useGridFeatures.js +0 -58
  165. package/dist/esm/hooks/useGridFeatures.js.map +0 -1
  166. package/dist/esm/hooks/useTableFeatures.js +0 -74
  167. package/dist/esm/hooks/useTableFeatures.js.map +0 -1
  168. package/dist/esm/hooks/useTableGridSwitchFeatures.js +0 -78
  169. package/dist/esm/hooks/useTableGridSwitchFeatures.js.map +0 -1
  170. package/dist/types/hooks/useGridFeatures.d.ts +0 -43
  171. package/dist/types/hooks/useGridFeatures.d.ts.map +0 -1
  172. package/dist/types/hooks/useTableFeatures.d.ts +0 -27
  173. package/dist/types/hooks/useTableFeatures.d.ts.map +0 -1
  174. package/dist/types/hooks/useTableGridSwitchFeatures.d.ts +0 -52
  175. package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +0 -1
@@ -1,22 +1,36 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  exports.__esModule = true;
5
4
  exports.AutoPatternsApp = void 0;
6
- var _react = _interopRequireDefault(require("react"));
5
+ var _react = _interopRequireWildcard(require("react"));
7
6
  var _RootAppProvider = require("../../providers/RootAppProvider");
8
7
  var _AppContext = require("../../providers/AppContext");
9
8
  var _AutoPatternsRoutes = require("../AutoPatternsRoute/AutoPatternsRoutes");
9
+ var _patterns = require("@wix/patterns");
10
+ var _minimalRequiredPatternsRuntimeCheck = require("../../utils/minimalRequiredPatternsRuntimeCheck");
10
11
  var _jsxFileName = "/home/builduser/work/8f3ab5a55e62623a/packages/auto-patterns/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.tsx";
12
+ 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); }
13
+ 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
14
  const AutoPatternsApp = ({
12
15
  configuration,
13
16
  children
14
17
  }) => {
18
+ if (process.env.NODE_ENV !== 'production') {
19
+ (0, _minimalRequiredPatternsRuntimeCheck.minimalRequiredPatternsRuntimeCheck)({
20
+ required: '^1.304.0',
21
+ requiredBy: 'AutoPatternsApp'
22
+ });
23
+ }
24
+ const container = (0, _patterns.useWixPatternsContainer)();
25
+ (0, _react.useEffect)(() => {
26
+ // set isAutoPatterns to true for BI events
27
+ container.setIsAutoPatterns(true);
28
+ }, [container]);
15
29
  return /*#__PURE__*/_react.default.createElement(_AppContext.AppContextProvider, {
16
30
  __self: void 0,
17
31
  __source: {
18
32
  fileName: _jsxFileName,
19
- lineNumber: 17,
33
+ lineNumber: 33,
20
34
  columnNumber: 5
21
35
  }
22
36
  }, /*#__PURE__*/_react.default.createElement(_RootAppProvider.RootAppProvider, {
@@ -24,7 +38,7 @@ const AutoPatternsApp = ({
24
38
  __self: void 0,
25
39
  __source: {
26
40
  fileName: _jsxFileName,
27
- lineNumber: 18,
41
+ lineNumber: 34,
28
42
  columnNumber: 7
29
43
  }
30
44
  }, /*#__PURE__*/_react.default.createElement(_AutoPatternsRoutes.AutoPatternsRoutes, {
@@ -32,7 +46,7 @@ const AutoPatternsApp = ({
32
46
  __self: void 0,
33
47
  __source: {
34
48
  fileName: _jsxFileName,
35
- lineNumber: 19,
49
+ lineNumber: 35,
36
50
  columnNumber: 9
37
51
  }
38
52
  })), children);
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_RootAppProvider","_AppContext","_AutoPatternsRoutes","_jsxFileName","AutoPatternsApp","configuration","children","default","createElement","AppContextProvider","__self","__source","fileName","lineNumber","columnNumber","RootAppProvider","appConfig","AutoPatternsRoutes","config","exports"],"sources":["../../../../src/components/AutoPatternsApp/AutoPatternsApp.tsx"],"sourcesContent":["import React from 'react';\nimport { AppConfig } from '../../types';\nimport { RootAppProvider } from '../../providers/RootAppProvider';\nimport { AppContextProvider } from '../../providers/AppContext';\nimport { AutoPatternsRoutes } from '../AutoPatternsRoute/AutoPatternsRoutes';\n\nexport interface AutoPatternsAppProps {\n configuration: AppConfig;\n children?: React.ReactNode;\n}\n\nexport const AutoPatternsApp: React.FC<AutoPatternsAppProps> = ({\n configuration,\n children,\n}) => {\n return (\n <AppContextProvider>\n <RootAppProvider appConfig={configuration}>\n <AutoPatternsRoutes config={configuration} />\n </RootAppProvider>\n {children}\n </AppContextProvider>\n );\n};\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AAA6E,IAAAI,YAAA;AAOtE,MAAMC,eAA+C,GAAGA,CAAC;EAC9DC,aAAa;EACbC;AACF,CAAC,KAAK;EACJ,oBACET,MAAA,CAAAU,OAAA,CAAAC,aAAA,CAACP,WAAA,CAAAQ,kBAAkB;IAAAC,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAT,YAAA;MAAAU,UAAA;MAAAC,YAAA;IAAA;EAAA,gBACjBjB,MAAA,CAAAU,OAAA,CAAAC,aAAA,CAACR,gBAAA,CAAAe,eAAe;IAACC,SAAS,EAAEX,aAAc;IAAAK,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAT,YAAA;MAAAU,UAAA;MAAAC,YAAA;IAAA;EAAA,gBACxCjB,MAAA,CAAAU,OAAA,CAAAC,aAAA,CAACN,mBAAA,CAAAe,kBAAkB;IAACC,MAAM,EAAEb,aAAc;IAAAK,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAT,YAAA;MAAAU,UAAA;MAAAC,YAAA;IAAA;EAAA,CAAE,CAC7B,CAAC,EACjBR,QACiB,CAAC;AAEzB,CAAC;AAACa,OAAA,CAAAf,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_RootAppProvider","_AppContext","_AutoPatternsRoutes","_patterns","_minimalRequiredPatternsRuntimeCheck","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AutoPatternsApp","configuration","children","process","env","NODE_ENV","minimalRequiredPatternsRuntimeCheck","required","requiredBy","container","useWixPatternsContainer","useEffect","setIsAutoPatterns","createElement","AppContextProvider","__self","__source","fileName","lineNumber","columnNumber","RootAppProvider","appConfig","AutoPatternsRoutes","config","exports"],"sources":["../../../../src/components/AutoPatternsApp/AutoPatternsApp.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { AppConfig } from '../../types';\nimport { RootAppProvider } from '../../providers/RootAppProvider';\nimport { AppContextProvider } from '../../providers/AppContext';\nimport { AutoPatternsRoutes } from '../AutoPatternsRoute/AutoPatternsRoutes';\nimport { useWixPatternsContainer } from '@wix/patterns';\nimport { minimalRequiredPatternsRuntimeCheck } from '../../utils/minimalRequiredPatternsRuntimeCheck';\n\nexport interface AutoPatternsAppProps {\n configuration: AppConfig;\n children?: React.ReactNode;\n}\n\nexport const AutoPatternsApp: React.FC<AutoPatternsAppProps> = ({\n configuration,\n children,\n}) => {\n if (process.env.NODE_ENV !== 'production') {\n minimalRequiredPatternsRuntimeCheck({\n required: '^1.304.0',\n requiredBy: 'AutoPatternsApp',\n });\n }\n\n const container = useWixPatternsContainer();\n\n useEffect(() => {\n // set isAutoPatterns to true for BI events\n container.setIsAutoPatterns(true);\n }, [container]);\n\n return (\n <AppContextProvider>\n <RootAppProvider appConfig={configuration}>\n <AutoPatternsRoutes config={configuration} />\n </RootAppProvider>\n {children}\n </AppContextProvider>\n );\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,oCAAA,GAAAL,OAAA;AAAsG,IAAAM,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,SAAAT,wBAAAS,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,UAA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MAAAuC,UAAA;MAAAC,YAAA;IAAA;EAAA,CAAE,CAC7B,CAAC,EACjBjB,QACiB,CAAC;AAEzB,CAAC;AAACsB,OAAA,CAAAxB,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -5,18 +5,18 @@ exports.AutoPatternsCollectionComponent = void 0;
5
5
  var _react = _interopRequireWildcard(require("react"));
6
6
  var _providers = require("../../providers");
7
7
  var _SkeletonCollection = require("../AutoPatternsCollectionPageContent/SkeletonCollection");
8
+ var _AutoPatternsTable = require("../AutoPatternsTable");
9
+ var _AutoPatternsTableGridSwitch = require("../AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch");
10
+ var _AutoPatternsGrid = require("../AutoPatternsGrid");
8
11
  var _jsxFileName = "/home/builduser/work/8f3ab5a55e62623a/packages/auto-patterns/dist/cjs/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.tsx";
9
12
  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
13
  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 AutoPatternsTableGridSwitch = /*#__PURE__*/(0, _react.lazy)(() => Promise.resolve().then(() => _interopRequireWildcard(require('../AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch'))).then(module => ({
12
- default: module.AutoPatternsTableGridSwitch
13
- })));
14
- const AutoPatternsTable = /*#__PURE__*/(0, _react.lazy)(() => Promise.resolve().then(() => _interopRequireWildcard(require('../AutoPatternsTable/AutoPatternsTable'))).then(module => ({
15
- default: module.AutoPatternsTable
16
- })));
17
- const AutoPatternsGrid = /*#__PURE__*/(0, _react.lazy)(() => Promise.resolve().then(() => _interopRequireWildcard(require('../AutoPatternsGrid/AutoPatternsGrid'))).then(module => ({
18
- default: module.AutoPatternsGrid
19
- })));
14
+ /**
15
+ * AutoPatternsCollectionComponent - Entry Point for All Data Display Flows
16
+ *
17
+ * This is the main component that determines which data display pattern to render based on configuration.
18
+ * It serves as the entry point for three distinct rendering flows:
19
+ */
20
20
  const AutoPatternsCollectionComponent = ({
21
21
  component,
22
22
  index
@@ -27,12 +27,15 @@ const AutoPatternsCollectionComponent = ({
27
27
  } = component;
28
28
  const memoized = (0, _react.useMemo)(() => {
29
29
  var _layout$find, _layout$find2;
30
+ // No layout configuration - return null to render nothing
30
31
  if (!(layout != null && layout.length)) {
31
32
  return {
32
33
  componentToRender: null,
33
34
  componentType: 'Table'
34
35
  };
35
36
  }
37
+
38
+ // Extract table and grid configurations from layout array
36
39
  const tableConfig = (_layout$find = layout.find(item => item.type === 'Table')) == null ? void 0 : _layout$find.table;
37
40
  const gridConfig = (_layout$find2 = layout.find(item => item.type === 'Grid')) == null ? void 0 : _layout$find2.grid;
38
41
  let componentType = 'Table';
@@ -43,92 +46,44 @@ const AutoPatternsCollectionComponent = ({
43
46
  ...tableConfig,
44
47
  ...gridConfig
45
48
  };
46
- componentToRender = /*#__PURE__*/_react.default.createElement(_react.Suspense, {
47
- fallback: /*#__PURE__*/_react.default.createElement(_SkeletonCollection.SkeletonCollection, {
48
- componentType: "Table",
49
- __self: void 0,
50
- __source: {
51
- fileName: _jsxFileName,
52
- lineNumber: 52,
53
- columnNumber: 29
54
- }
55
- }),
56
- __self: void 0,
57
- __source: {
58
- fileName: _jsxFileName,
59
- lineNumber: 52,
60
- columnNumber: 9
61
- }
62
- }, /*#__PURE__*/_react.default.createElement(AutoPatternsTableGridSwitch, {
63
- configuration: config,
49
+ componentToRender = /*#__PURE__*/_react.default.createElement(_AutoPatternsTableGridSwitch.AutoPatternsTableGridSwitch, {
50
+ config: config,
64
51
  __self: void 0,
65
52
  __source: {
66
53
  fileName: _jsxFileName,
67
- lineNumber: 53,
68
- columnNumber: 11
54
+ lineNumber: 46,
55
+ columnNumber: 27
69
56
  }
70
- }));
57
+ });
71
58
  } else if (tableConfig) {
72
59
  const config = {
73
60
  ...sharedConfig,
74
61
  ...tableConfig
75
62
  };
76
- componentToRender = /*#__PURE__*/_react.default.createElement(_react.Suspense, {
77
- fallback: /*#__PURE__*/_react.default.createElement(_SkeletonCollection.SkeletonCollection, {
78
- componentType: "Table",
79
- __self: void 0,
80
- __source: {
81
- fileName: _jsxFileName,
82
- lineNumber: 59,
83
- columnNumber: 29
84
- }
85
- }),
63
+ componentToRender = /*#__PURE__*/_react.default.createElement(_AutoPatternsTable.AutoPatternsTable, {
64
+ config: config,
86
65
  __self: void 0,
87
66
  __source: {
88
67
  fileName: _jsxFileName,
89
- lineNumber: 59,
90
- columnNumber: 9
68
+ lineNumber: 49,
69
+ columnNumber: 27
91
70
  }
92
- }, /*#__PURE__*/_react.default.createElement(AutoPatternsTable, {
93
- configuration: config,
94
- __self: void 0,
95
- __source: {
96
- fileName: _jsxFileName,
97
- lineNumber: 60,
98
- columnNumber: 11
99
- }
100
- }));
71
+ });
101
72
  } else if (gridConfig) {
102
73
  componentType = 'Grid';
103
74
  const config = {
104
75
  ...sharedConfig,
105
76
  ...gridConfig
106
77
  };
107
- componentToRender = /*#__PURE__*/_react.default.createElement(_react.Suspense, {
108
- fallback: /*#__PURE__*/_react.default.createElement(_SkeletonCollection.SkeletonCollection, {
109
- componentType: "Grid",
110
- __self: void 0,
111
- __source: {
112
- fileName: _jsxFileName,
113
- lineNumber: 67,
114
- columnNumber: 29
115
- }
116
- }),
78
+ componentToRender = /*#__PURE__*/_react.default.createElement(_AutoPatternsGrid.AutoPatternsGrid, {
79
+ config: config,
117
80
  __self: void 0,
118
81
  __source: {
119
82
  fileName: _jsxFileName,
120
- lineNumber: 67,
121
- columnNumber: 9
122
- }
123
- }, /*#__PURE__*/_react.default.createElement(AutoPatternsGrid, {
124
- configuration: config,
125
- __self: void 0,
126
- __source: {
127
- fileName: _jsxFileName,
128
- lineNumber: 68,
129
- columnNumber: 11
83
+ lineNumber: 53,
84
+ columnNumber: 27
130
85
  }
131
- }));
86
+ });
132
87
  }
133
88
  return {
134
89
  componentToRender,
@@ -147,14 +102,14 @@ const AutoPatternsCollectionComponent = ({
147
102
  __self: void 0,
148
103
  __source: {
149
104
  fileName: _jsxFileName,
150
- lineNumber: 84,
105
+ lineNumber: 67,
151
106
  columnNumber: 21
152
107
  }
153
108
  }),
154
109
  __self: void 0,
155
110
  __source: {
156
111
  fileName: _jsxFileName,
157
- lineNumber: 81,
112
+ lineNumber: 64,
158
113
  columnNumber: 9
159
114
  }
160
115
  }, componentToRender) : null);
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_providers","_SkeletonCollection","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AutoPatternsTableGridSwitch","lazy","Promise","resolve","then","module","AutoPatternsTable","AutoPatternsGrid","AutoPatternsCollectionComponent","component","index","layout","sharedConfig","memoized","useMemo","_layout$find","_layout$find2","length","componentToRender","componentType","tableConfig","find","item","type","table","gridConfig","grid","config","createElement","Suspense","fallback","SkeletonCollection","__self","__source","fileName","lineNumber","columnNumber","configuration","Fragment","SchemaProvider","key","collection","collectionId","skeleton","exports"],"sources":["../../../../src/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.tsx"],"sourcesContent":["import React, { useMemo, lazy, Suspense } from 'react';\nimport { CollectionComponentConfig } from '../../types';\nimport { SchemaProvider } from '../../providers';\nimport { SkeletonCollection } from '../AutoPatternsCollectionPageContent/SkeletonCollection';\n\nconst AutoPatternsTableGridSwitch = lazy(() =>\n import('../AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch').then(\n (module) => ({ default: module.AutoPatternsTableGridSwitch }),\n ),\n);\nconst AutoPatternsTable = lazy(() =>\n import('../AutoPatternsTable/AutoPatternsTable').then((module) => ({\n default: module.AutoPatternsTable,\n })),\n);\nconst AutoPatternsGrid = lazy(() =>\n import('../AutoPatternsGrid/AutoPatternsGrid').then((module) => ({\n default: module.AutoPatternsGrid,\n })),\n);\n\nexport const AutoPatternsCollectionComponent = ({\n component,\n index,\n}: {\n component: CollectionComponentConfig;\n index: number;\n}) => {\n const { layout, ...sharedConfig } = component;\n\n const memoized = useMemo(() => {\n if (!layout?.length) {\n return {\n componentToRender: null,\n componentType: 'Table' as 'Table' | 'Grid',\n };\n }\n\n const tableConfig = layout.find((item) => item.type === 'Table')?.table;\n const gridConfig = layout.find((item) => item.type === 'Grid')?.grid;\n\n let componentType: 'Table' | 'Grid' = 'Table';\n let componentToRender: React.ReactNode = null;\n\n if (tableConfig && gridConfig) {\n const config = {\n ...sharedConfig,\n ...tableConfig,\n ...gridConfig,\n };\n componentToRender = (\n <Suspense fallback={<SkeletonCollection componentType=\"Table\" />}>\n <AutoPatternsTableGridSwitch configuration={config} />\n </Suspense>\n );\n } else if (tableConfig) {\n const config = { ...sharedConfig, ...tableConfig };\n componentToRender = (\n <Suspense fallback={<SkeletonCollection componentType=\"Table\" />}>\n <AutoPatternsTable configuration={config} />\n </Suspense>\n );\n } else if (gridConfig) {\n componentType = 'Grid';\n const config = { ...sharedConfig, ...gridConfig };\n componentToRender = (\n <Suspense fallback={<SkeletonCollection componentType=\"Grid\" />}>\n <AutoPatternsGrid configuration={config} />\n </Suspense>\n );\n }\n\n return { componentToRender, componentType };\n }, [layout, sharedConfig]);\n\n const { componentToRender, componentType } = memoized;\n\n return (\n <>\n {componentToRender ? (\n <SchemaProvider\n key={`${sharedConfig.collection.collectionId}-${index}`}\n collection={sharedConfig.collection}\n skeleton={<SkeletonCollection componentType={componentType} />}\n >\n {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AC;EAE1B,MAAM;IAAEM,iBAAiB;IAAEC;EAAc,CAAC,GAAGN,QAAQ;EAErD,oBACEvC,MAAA,CAAAY,OAAA,CAAA0C,aAAA,CAAAtD,MAAA,CAAAY,OAAA,CAAAoD,QAAA,QACGpB,iBAAiB,gBAChB5C,MAAA,CAAAY,OAAA,CAAA0C,aAAA,CAACnD,UAAA,CAAA8D,cAAc;IACbC,GAAG,EAAE,GAAG5B,YAAY,CAAC6B,UAAU,CAACC,YAAY,IAAIhC,KAAK,EAAG;IACxD+B,UAAU,EAAE7B,YAAY,CAAC6B,UAAW;IACpCE,QAAQ,eAAErE,MAAA,CAAAY,OAAA,CAAA0C,aAAA,CAAClD,mBAAA,CAAAqD,kBAAkB;MAACZ,aAAa,EAAEA,aAAc;MAAAa,MAAA;MAAAC,QAAA;QAAAC,QAAA,EAAAvD,YAAA;QAAAwD,UAAA;QAAAC,YAAA;MAAA;IAAA,CAAE,CAAE;IAAAJ,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAvD,YAAA;MAAAwD,UAAA;MAAAC,YAAA;IAAA;EAAA,GAE9DlB,iBACa,CAAC,GACf,IACJ,CAAC;AAEP,CAAC;AAAC0B,OAAA,CAAApC,+BAAA,GAAAA,+BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_providers","_SkeletonCollection","_AutoPatternsTable","_AutoPatternsTableGridSwitch","_AutoPatternsGrid","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AutoPatternsCollectionComponent","component","index","layout","sharedConfig","memoized","useMemo","_layout$find","_layout$find2","length","componentToRender","componentType","tableConfig","find","item","type","table","gridConfig","grid","config","createElement","AutoPatternsTableGridSwitch","__self","__source","fileName","lineNumber","columnNumber","AutoPatternsTable","AutoPatternsGrid","Fragment","SchemaProvider","key","collection","collectionId","skeleton","SkeletonCollection","exports"],"sources":["../../../../src/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { CollectionComponentConfig } from '../../types';\nimport { SchemaProvider } from '../../providers';\nimport { SkeletonCollection } from '../AutoPatternsCollectionPageContent/SkeletonCollection';\nimport { AutoPatternsTable } from '../AutoPatternsTable';\nimport { AutoPatternsTableGridSwitch } from '../AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch';\nimport { AutoPatternsGrid } from '../AutoPatternsGrid';\n\n/**\n * AutoPatternsCollectionComponent - Entry Point for All Data Display Flows\n *\n * This is the main component that determines which data display pattern to render based on configuration.\n * It serves as the entry point for three distinct rendering flows:\n */\nexport const AutoPatternsCollectionComponent = ({\n component,\n index,\n}: {\n component: CollectionComponentConfig;\n index: number;\n}) => {\n const { layout, ...sharedConfig } = component;\n\n const memoized = useMemo(() => {\n // No layout configuration - return null to render nothing\n if (!layout?.length) {\n return {\n componentToRender: null,\n componentType: 'Table' as 'Table' | 'Grid',\n };\n }\n\n // Extract table and grid configurations from layout array\n const tableConfig = layout.find((item) => item.type === 'Table')?.table;\n const gridConfig = layout.find((item) => item.type === 'Grid')?.grid;\n\n let componentType: 'Table' | 'Grid' = 'Table';\n let componentToRender: React.ReactNode = null;\n\n if (tableConfig && gridConfig) {\n const config = {\n ...sharedConfig,\n ...tableConfig,\n ...gridConfig,\n };\n componentToRender = <AutoPatternsTableGridSwitch config={config} />;\n } else if (tableConfig) {\n const config = { ...sharedConfig, ...tableConfig };\n componentToRender = <AutoPatternsTable config={config} />;\n } else if (gridConfig) {\n componentType = 'Grid';\n const config = { ...sharedConfig, ...gridConfig };\n componentToRender = <AutoPatternsGrid config={config} />;\n }\n\n return { componentToRender, componentType };\n }, [layout, sharedConfig]);\n\n const { componentToRender, componentType } = memoized;\n\n return (\n <>\n {componentToRender ? (\n <SchemaProvider\n key={`${sharedConfig.collection.collectionId}-${index}`}\n collection={sharedConfig.collection}\n skeleton={<SkeletonCollection component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AAC7C,mBAAA,CAAA4D,kBAAkB;MAACxB,aAAa,EAAEA,aAAc;MAAAW,MAAA;MAAAC,QAAA;QAAAC,QAAA,EAAA7C,YAAA;QAAA8C,UAAA;QAAAC,YAAA;MAAA;IAAA,CAAE,CAAE;IAAAJ,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA7C,YAAA;MAAA8C,UAAA;MAAAC,YAAA;IAAA;EAAA,GAE9DhB,iBACa,CAAC,GACf,IACJ,CAAC;AAEP,CAAC;AAAC0B,OAAA,CAAApC,+BAAA,GAAAA,+BAAA","ignoreList":[]}
@@ -4,46 +4,168 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  exports.__esModule = true;
5
5
  exports.AutoPatternsGrid = void 0;
6
6
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
7
- var _react = _interopRequireDefault(require("react"));
7
+ var _react = _interopRequireWildcard(require("react"));
8
8
  var _patterns = require("@wix/patterns");
9
+ var _useBasePatternsStateParams = require("../../hooks/useBasePatternsStateParams");
9
10
  var _hooks = require("../../hooks");
11
+ var _useBaseGridFeatures = require("../../hooks/useBaseGridFeatures");
12
+ var _useBaseCollectionComponentReadyFeatures = require("../../hooks/useBaseCollectionComponentReadyFeatures");
10
13
  var _jsxFileName = "/home/builduser/work/8f3ab5a55e62623a/packages/auto-patterns/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.tsx";
11
- const AutoPatternsGrid = ({
12
- configuration
13
- }) => {
14
+ 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); }
15
+ 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; }
16
+ /**
17
+ * AutoPatternsGridLoaded - Step 4 in Grid Flow
18
+ *
19
+ * FLOW 2: AutoPatternsCollectionComponent → AutoPatternsGrid → useGridFeaturesAsync → [AutoPatternsGridLoaded] → useBaseCollectionComponentReadyFeatures → Grid
20
+ *
21
+ * This component renders when all async features have been loaded and are ready.
22
+ * It represents the "loaded" state of the grid flow and handles:
23
+ *
24
+ * Key Responsibilities:
25
+ * - Creates the grid collection state using loaded async features
26
+ * - Calls useBaseCollectionComponentReadyFeatures for final feature preparation
27
+ * - Extracts grid-specific features (renderItem, preset, imagePlacement) from base features
28
+ * - Extracts async features like dragAndDrop if enabled
29
+ * - Renders the final Grid component with all features combined
30
+ */
31
+ const AutoPatternsGridLoaded = props => {
32
+ const {
33
+ config,
34
+ asyncFeaturesState,
35
+ baseStateParams,
36
+ dataHook
37
+ } = props;
38
+
39
+ // Extract grid-specific display features (how items are rendered and displayed)
14
40
  const {
15
- state,
16
- search,
17
- title,
18
- emptyState,
19
- filters,
20
- actionCell,
21
41
  renderItem,
22
42
  imagePlacement,
23
- views,
24
- preset,
25
- dragAndDropProps
26
- } = (0, _hooks.useGridFeatures)(configuration);
43
+ preset
44
+ } = (0, _useBaseGridFeatures.useBaseGridFeatures)(config);
45
+
46
+ // Extract loaded async features from the successful feature loading state
47
+ const {
48
+ dragAndDrop
49
+ } = (0, _patterns.useSelector)(() => ({
50
+ ...asyncFeaturesState.status.data
51
+ }));
52
+
53
+ // Create grid collection state with the loaded async dependencies
54
+ const state = (0, _patterns.useGridCollection)(baseStateParams.params);
55
+
56
+ // STEP 5: Call shared hook that prepares final collection features
57
+ // This hook is shared across all three flows (Table, Grid, TableGridSwitch)
58
+ const baseCollectionComponentReadyFeatures = (0, _useBaseCollectionComponentReadyFeatures.useBaseCollectionComponentReadyFeatures)({
59
+ config,
60
+ collection: state.collection,
61
+ asyncFeaturesState,
62
+ baseStateParams
63
+ });
64
+
65
+ // Extract grid-specific drag and drop props if feature is loaded
66
+ const dragAndDropProps = dragAndDrop == null || dragAndDrop.useGridDragAndDrop == null ? void 0 : dragAndDrop.useGridDragAndDrop(config);
67
+
68
+ // FINAL STEP: Render the fully-featured Grid component
69
+ // Combines grid display features with loaded async features
27
70
  return /*#__PURE__*/_react.default.createElement(_patterns.Grid, (0, _extends2.default)({
28
- dataHook: "auto-patterns-grid",
29
- search: search,
30
- title: title,
31
- state: state,
32
- actionCell: actionCell,
33
- filters: filters,
34
- views: views,
35
- emptyState: emptyState,
36
- imagePlacement: imagePlacement
37
- }, dragAndDropProps, {
71
+ dataHook: dataHook,
38
72
  preset: preset,
73
+ imagePlacement: imagePlacement,
39
74
  renderItem: renderItem,
75
+ state: state
76
+ }, baseCollectionComponentReadyFeatures, dragAndDropProps, {
40
77
  __self: void 0,
41
78
  __source: {
42
79
  fileName: _jsxFileName,
43
- lineNumber: 28,
80
+ lineNumber: 71,
44
81
  columnNumber: 5
45
82
  }
46
83
  }));
47
84
  };
85
+
86
+ /**
87
+ * AutoPatternsGrid - Step 2 in Grid Flow
88
+ *
89
+ * FLOW 2: AutoPatternsCollectionComponent → [AutoPatternsGrid] → useGridFeaturesAsync → AutoPatternsGridLoaded → useBaseCollectionComponentReadyFeatures → Grid
90
+ *
91
+ * This is the main grid component that orchestrates the grid rendering flow.
92
+ * It handles the loading states and coordinates between async feature loading and final rendering.
93
+ *
94
+ * Key Responsibilities:
95
+ * - Extracts grid display features (renderItem, preset, imagePlacement) and visible field IDs
96
+ * - Calls useGridFeaturesAsync (Step 3) to load grid-specific async features
97
+ * - Creates initial grid state with basic collection
98
+ * - Monitors loading status and switches between loading/loaded states
99
+ * - Renders skeleton grid during loading or AutoPatternsGridLoaded when ready
100
+ */
101
+ const AutoPatternsGrid = props => {
102
+ const {
103
+ config
104
+ } = props;
105
+
106
+ // Extract grid display features and visible field IDs from configuration
107
+ const {
108
+ renderItem,
109
+ imagePlacement,
110
+ preset,
111
+ visibleFieldIds
112
+ } = (0, _useBaseGridFeatures.useBaseGridFeatures)(config);
113
+
114
+ // Initialize base state parameters with collection config and visible fields
115
+ const baseStateParams = (0, _useBasePatternsStateParams.useBasePatternsStateParams)(config, {
116
+ visibleFieldIds
117
+ });
118
+
119
+ // STEP 3: Load grid-specific async features (currently only drag&drop)
120
+ const {
121
+ asyncFeaturesState
122
+ } = (0, _hooks.useGridFeaturesAsync)({
123
+ config
124
+ });
125
+
126
+ // Create patterns container and collection factory
127
+ const container = (0, _patterns.useWixPatternsContainer)();
128
+ const createCollection = (0, _patterns.useCreateCollection)();
129
+
130
+ // Initialize grid state with basic collection (used during loading)
131
+ const [state] = (0, _react.useState)(() => new _patterns.GridState({
132
+ collection: createCollection(baseStateParams.params),
133
+ container
134
+ }));
135
+
136
+ // Monitor async features loading status
137
+ const isReady = (0, _patterns.useSelector)(() => asyncFeaturesState.status.isSuccess || asyncFeaturesState.status.isError);
138
+ const dataHook = 'auto-patterns-grid';
139
+ if (isReady) {
140
+ // STEP 4: All features loaded - render the fully-featured grid
141
+ return /*#__PURE__*/_react.default.createElement(AutoPatternsGridLoaded, {
142
+ dataHook: dataHook,
143
+ config: config,
144
+ baseStateParams: baseStateParams,
145
+ asyncFeaturesState: asyncFeaturesState,
146
+ __self: void 0,
147
+ __source: {
148
+ fileName: _jsxFileName,
149
+ lineNumber: 137,
150
+ columnNumber: 7
151
+ }
152
+ });
153
+ }
154
+
155
+ // LOADING STATE: Render basic grid skeleton while features are loading
156
+ return /*#__PURE__*/_react.default.createElement(_patterns.Grid, {
157
+ dataHook: dataHook,
158
+ preset: preset,
159
+ imagePlacement: imagePlacement,
160
+ renderItem: renderItem,
161
+ state: state,
162
+ __self: void 0,
163
+ __source: {
164
+ fileName: _jsxFileName,
165
+ lineNumber: 148,
166
+ columnNumber: 5
167
+ }
168
+ });
169
+ };
48
170
  exports.AutoPatternsGrid = AutoPatternsGrid;
49
171
  //# sourceMappingURL=AutoPatternsGrid.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_patterns","_hooks","_jsxFileName","AutoPatternsGrid","configuration","state","search","title","emptyState","filters","actionCell","renderItem","imagePlacement","views","preset","dragAndDropProps","useGridFeatures","default","createElement","Grid","_extends2","dataHook","__self","__source","fileName","lineNumber","columnNumber","exports"],"sources":["../../../../src/components/AutoPatternsGrid/AutoPatternsGrid.tsx"],"sourcesContent":["import React from 'react';\nimport { Grid } from '@wix/patterns';\nimport { GridConfig } from '../../types';\nimport { useGridFeatures } from '../../hooks';\n\nexport interface AutoPatternsGridContentProps {\n configuration: GridConfig;\n}\n\nexport const AutoPatternsGrid = ({\n configuration,\n}: AutoPatternsGridContentProps) => {\n const {\n state,\n search,\n title,\n emptyState,\n filters,\n actionCell,\n renderItem,\n imagePlacement,\n views,\n preset,\n dragAndDropProps,\n } = useGridFeatures(configuration);\n\n return (\n <Grid\n dataHook=\"auto-patterns-grid\"\n search={search}\n title={title}\n state={state}\n actionCell={actionCell}\n filters={filters}\n views={views}\n emptyState={emptyState}\n imagePlacement={imagePlacement}\n {...dragAndDropProps}\n preset={preset}\n renderItem={renderItem}\n />\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAA8C,IAAAG,YAAA;AAMvC,MAAMC,gBAAgB,GAAGA,CAAC;EAC/BC;AAC4B,CAAC,KAAK;EAClC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,KAAK;IACLC,UAAU;IACVC,OAAO;IACPC,UAAU;IACVC,UAAU;IACVC,cAAc;IACdC,KAAK;IACLC,MAAM;IACNC;EACF,CAAC,GAAG,IAAAC,sBAAe,EAACZ,aAAa,CAAC;EAElC,oBACEP,MAAA,CAAAoB,OAAA,CAAAC,aAAA,CAAClB,SAAA,CAAAmB,IAAI,MAAAC,SAAA,CAAAH,OAAA;IACHI,QAAQ,EAAC,oBAAoB;IAC7Bf,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA,KAAM;IACbF,KAAK,EAAEA,KAAM;IACbK,UAAU,EAAEA,UAAW;IACvBD,OAAO,EAAEA,OAAQ;IACjBI,KAAK,EAAEA,KAAM;IACbL,UAAU,EAAEA,UAAW;IACvBI,cAAc,EAAEA;EAAe,GAC3BG,gBAAgB;IACpBD,MAAM,EAAEA,MAAO;IACfH,UAAU,EAAEA,UAAW;IAAAW,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAtB,YAAA;MAAAuB,UAAA;MAAAC,YAAA;IAAA;EAAA,EACxB,CAAC;AAEN,CAAC;AAACC,OAAA,CAAAxB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_patterns","_useBasePatternsStateParams","_hooks","_useBaseGridFeatures","_useBaseCollectionComponentReadyFeatures","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AutoPatternsGridLoaded","props","config","asyncFeaturesState","baseStateParams","dataHook","renderItem","imagePlacement","preset","useBaseGridFeatures","dragAndDrop","useSelector","status","data","state","useGridCollection","params","baseCollectionComponentReadyFeatures","useBaseCollectionComponentReadyFeatures","collection","dragAndDropProps","useGridDragAndDrop","createElement","Grid","_extends2","__self","__source","fileName","lineNumber","columnNumber","AutoPatternsGrid","visibleFieldIds","useBasePatternsStateParams","useGridFeaturesAsync","container","useWixPatternsContainer","createCollection","useCreateCollection","useState","GridState","isReady","isSuccess","isError","exports"],"sources":["../../../../src/components/AutoPatternsGrid/AutoPatternsGrid.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport {\n Grid,\n GridState,\n useCreateCollection,\n useGridCollection,\n useSelector,\n useWixPatternsContainer,\n} from '@wix/patterns';\nimport { GridConfig } from '../../types';\nimport { useBasePatternsStateParams } from '../../hooks/useBasePatternsStateParams';\nimport { useGridFeaturesAsync } from '../../hooks';\nimport { useBaseGridFeatures } from '../../hooks/useBaseGridFeatures';\nimport { useBaseCollectionComponentReadyFeatures } from '../../hooks/useBaseCollectionComponentReadyFeatures';\n\nexport interface AutoPatternsGridContentProps {\n config: GridConfig;\n}\n\n/**\n * AutoPatternsGridLoaded - Step 4 in Grid Flow\n *\n * FLOW 2: AutoPatternsCollectionComponent → AutoPatternsGrid → useGridFeaturesAsync → [AutoPatternsGridLoaded] → useBaseCollectionComponentReadyFeatures → Grid\n *\n * This component renders when all async features have been loaded and are ready.\n * It represents the \"loaded\" state of the grid flow and handles:\n *\n * Key Responsibilities:\n * - Creates the grid collection state using loaded async features\n * - Calls useBaseCollectionComponentReadyFeatures for final feature preparation\n * - Extracts grid-specific features (renderItem, preset, imagePlacement) from base features\n * - Extracts async features like dragAndDrop if enabled\n * - Renders the final Grid component with all features combined\n */\nconst AutoPatternsGridLoaded = (\n props: NonNullable<ReturnType<typeof useGridFeaturesAsync>> &\n AutoPatternsGridContentProps & {\n baseStateParams: ReturnType<typeof useBasePatternsStateParams>;\n dataHook?: string;\n },\n) => {\n const { config, asyncFeaturesState, baseStateParams, dataHook } = props;\n\n // Extract grid-specific display features (how items are rendered and displayed)\n const { renderItem, imagePlacement, preset } = useBaseGridFeatures(config);\n\n // Extract loaded async features from the successful feature loading state\n const { dragAndDrop } = useSelector(() => ({\n ...asyncFeaturesState.status.data,\n }));\n\n // Create grid collection state with the loaded async dependencies\n const state = useGridCollection<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 grid-specific drag and drop props if feature is loaded\n const dragAndDropProps = dragAndDrop?.useGridDragAndDrop?.(config);\n\n // FINAL STEP: Render the fully-featured Grid component\n // Combines grid display features with loaded async features\n return (\n <Grid\n dataHook={dataHook}\n preset={preset}\n imagePlacement={imagePlacement}\n renderItem={renderItem}\n state={state}\n {...baseCollectionComponentReadyFeatures}\n {...dragAndDropProps}\n />\n );\n};\n\n/**\n * AutoPatternsGrid - Step 2 in Grid Flow\n *\n * FLOW 2: AutoPatternsCollectionComponent → [AutoPatternsGrid] → useGridFeaturesAsync → AutoPatternsGridLoaded → useBaseCollectionComponentReadyFeatures → Grid\n *\n * This is the main grid component that orchestrates the grid rendering flow.\n * It handles the loading states and coordinates between async feature loading and final rendering.\n *\n * Key Responsibilities:\n * - Extracts grid display features (renderItem, preset, imagePlacement) and visible field IDs\n * - Calls useGridFeaturesAsync (Step 3) to load grid-specific async features\n * - Creates initial grid state with basic collection\n * - Monitors loading status and switches between loading/loaded states\n * - Renders skeleton grid during loading or AutoPatternsGridLoaded when ready\n */\nexport const AutoPatternsGrid = (props: AutoPatternsGridContentProps) => {\n const { config } = props;\n\n // Extract grid display features and visible field IDs from configuration\n const { renderItem, imagePlacement, preset, visibleFieldIds } =\n useBaseGridFeatures(config);\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 grid-specific async features (currently only drag&drop)\n const { asyncFeaturesState } = useGridFeaturesAsync({ config });\n\n // Create patterns container and collection factory\n const container = useWixPatternsContainer();\n const createCollection = useCreateCollection();\n\n // Initialize grid state with basic collection (used during loading)\n const [state] = useState(\n () =>\n new GridState<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-grid';\n\n if (isReady) {\n // STEP 4: All features loaded - render the fully-featured grid\n return (\n <AutoPatternsGridLoaded\n dataHook={dataHook}\n config={config}\n baseStateParams={baseStateParams}\n asyncFeaturesState={asyncFeaturesState}\n />\n );\n }\n\n // LOADING STATE: Render basic grid skeleton while features are loading\n return (\n <Grid\n dataHook={dataHook}\n preset={preset}\n imagePlacement={imagePlacement}\n renderItem={renderItem}\n state={state}\n />\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AASA,IAAAE,2BAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,wCAAA,GAAAL,OAAA;AAA8G,IAAAM,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,SAAAT,wBAAAS,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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oBACErE,MAAA,CAAAe,OAAA,CAAAoC,aAAA,CAACtB,sBAAsB;MACrBK,QAAQ,EAAEA,QAAS;MACnBH,MAAM,EAAEA,MAAO;MACfE,eAAe,EAAEA,eAAgB;MACjCD,kBAAkB,EAAEA,kBAAmB;MAAAsB,MAAA;MAAAC,QAAA;QAAAC,QAAA,EAAAhD,YAAA;QAAAiD,UAAA;QAAAC,YAAA;MAAA;IAAA,CACxC,CAAC;EAEN;;EAEA;EACA,oBACE1D,MAAA,CAAAe,OAAA,CAAAoC,aAAA,CAAChD,SAAA,CAAAiD,IAAI;IACHlB,QAAQ,EAAEA,QAAS;IACnBG,MAAM,EAAEA,MAAO;IACfD,cAAc,EAAEA,cAAe;IAC/BD,UAAU,EAAEA,UAAW;IACvBQ,KAAK,EAAEA,KAAM;IAAAW,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAhD,YAAA;MAAAiD,UAAA;MAAAC,YAAA;IAAA;EAAA,CACd,CAAC;AAEN,CAAC;AAACc,OAAA,CAAAb,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -5,12 +5,10 @@ exports.AutoPatternsPage = void 0;
5
5
  var _react = _interopRequireWildcard(require("react"));
6
6
  var _SchemaContext = require("../../providers/SchemaContext");
7
7
  var _SkeletonEntity = require("../AutoPatternsEntityPage/SkeletonEntity");
8
+ var _AutoPatternsCollectionPage = require("../AutoPatternsCollectionPage");
8
9
  var _jsxFileName = "/home/builduser/work/8f3ab5a55e62623a/packages/auto-patterns/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.tsx";
9
10
  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
11
  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 AutoPatternsCollectionPage = /*#__PURE__*/(0, _react.lazy)(() => Promise.resolve().then(() => _interopRequireWildcard(require('../AutoPatternsCollectionPage'))).then(module => ({
12
- default: module.AutoPatternsCollectionPage
13
- })));
14
12
  const AutoPatternsEntityPage = /*#__PURE__*/(0, _react.lazy)(() => Promise.resolve().then(() => _interopRequireWildcard(require('../AutoPatternsEntityPage'))).then(module => ({
15
13
  default: module.AutoPatternsEntityPage
16
14
  })));
@@ -25,30 +23,15 @@ const AutoPatternsPage = ({
25
23
  switch (type) {
26
24
  case 'collectionPage':
27
25
  if (collectionPage) {
28
- return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
29
- fallback: /*#__PURE__*/_react.default.createElement("div", {
30
- __self: void 0,
31
- __source: {
32
- fileName: _jsxFileName,
33
- lineNumber: 28,
34
- columnNumber: 31
35
- }
36
- }),
37
- __self: void 0,
38
- __source: {
39
- fileName: _jsxFileName,
40
- lineNumber: 28,
41
- columnNumber: 11
42
- }
43
- }, /*#__PURE__*/_react.default.createElement(AutoPatternsCollectionPage, {
26
+ return /*#__PURE__*/_react.default.createElement(_AutoPatternsCollectionPage.AutoPatternsCollectionPage, {
44
27
  configuration: collectionPage,
45
28
  __self: void 0,
46
29
  __source: {
47
30
  fileName: _jsxFileName,
48
- lineNumber: 29,
49
- columnNumber: 13
31
+ lineNumber: 23,
32
+ columnNumber: 16
50
33
  }
51
- }));
34
+ });
52
35
  }
53
36
  break;
54
37
  case 'entityPage':
@@ -60,14 +43,14 @@ const AutoPatternsPage = ({
60
43
  __self: void 0,
61
44
  __source: {
62
45
  fileName: _jsxFileName,
63
- lineNumber: 39,
46
+ lineNumber: 31,
64
47
  columnNumber: 23
65
48
  }
66
49
  }),
67
50
  __self: void 0,
68
51
  __source: {
69
52
  fileName: _jsxFileName,
70
- lineNumber: 37,
53
+ lineNumber: 29,
71
54
  columnNumber: 11
72
55
  }
73
56
  }, /*#__PURE__*/_react.default.createElement(_react.Suspense, {
@@ -76,14 +59,14 @@ const AutoPatternsPage = ({
76
59
  __self: void 0,
77
60
  __source: {
78
61
  fileName: _jsxFileName,
79
- lineNumber: 41,
62
+ lineNumber: 33,
80
63
  columnNumber: 33
81
64
  }
82
65
  }),
83
66
  __self: void 0,
84
67
  __source: {
85
68
  fileName: _jsxFileName,
86
- lineNumber: 41,
69
+ lineNumber: 33,
87
70
  columnNumber: 13
88
71
  }
89
72
  }, /*#__PURE__*/_react.default.createElement(AutoPatternsEntityPage, {
@@ -91,7 +74,7 @@ const AutoPatternsPage = ({
91
74
  __self: void 0,
92
75
  __source: {
93
76
  fileName: _jsxFileName,
94
- lineNumber: 42,
77
+ lineNumber: 34,
95
78
  columnNumber: 15
96
79
  }
97
80
  })));