@wix/auto-patterns 1.26.0 → 1.28.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 (144) hide show
  1. package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.js +16 -7
  2. package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -1
  3. package/dist/cjs/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +2 -2
  4. package/dist/cjs/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
  5. package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +58 -4
  6. package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
  7. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js +19 -5
  8. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
  9. package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js +1 -1
  10. package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
  11. package/dist/cjs/dataSourceAdapters/cms/fetchCmsData.js +1 -1
  12. package/dist/cjs/dataSourceAdapters/cms/fetchCmsData.js.map +1 -1
  13. package/dist/cjs/hooks/index.js +19 -0
  14. package/dist/cjs/hooks/index.js.map +1 -1
  15. package/dist/cjs/hooks/useAutoPatternsOptimisticActions.js +13 -6
  16. package/dist/cjs/hooks/useAutoPatternsOptimisticActions.js.map +1 -1
  17. package/dist/cjs/hooks/useBaseCollectionParams.js +38 -0
  18. package/dist/cjs/hooks/useBaseCollectionParams.js.map +1 -0
  19. package/dist/cjs/hooks/useCommonCollectionFeatures.js +13 -6
  20. package/dist/cjs/hooks/useCommonCollectionFeatures.js.map +1 -1
  21. package/dist/cjs/hooks/useFetchData.js +4 -5
  22. package/dist/cjs/hooks/useFetchData.js.map +1 -1
  23. package/dist/cjs/hooks/useGridFeatures.js +9 -26
  24. package/dist/cjs/hooks/useGridFeatures.js.map +1 -1
  25. package/dist/cjs/hooks/useNavigationUtils.js +21 -6
  26. package/dist/cjs/hooks/useNavigationUtils.js.map +1 -1
  27. package/dist/cjs/hooks/useTableFeatures.js +9 -26
  28. package/dist/cjs/hooks/useTableFeatures.js.map +1 -1
  29. package/dist/cjs/hooks/useTableGridSwitchFeatures.js +11 -28
  30. package/dist/cjs/hooks/useTableGridSwitchFeatures.js.map +1 -1
  31. package/dist/cjs/hooks/useUpdateAppContextItems.js +18 -0
  32. package/dist/cjs/hooks/useUpdateAppContextItems.js.map +1 -0
  33. package/dist/cjs/providers/AppContext.js +58 -0
  34. package/dist/cjs/providers/AppContext.js.map +1 -0
  35. package/dist/cjs/providers/ItemsContext.js +37 -0
  36. package/dist/cjs/providers/ItemsContext.js.map +1 -0
  37. package/dist/cjs/providers/PatternsWizardOverridesContext.js +1 -1
  38. package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +1 -1
  39. package/dist/cjs/providers/index.js +12 -0
  40. package/dist/cjs/providers/index.js.map +1 -1
  41. package/dist/cjs/types/CollectionPageConfig.js.map +1 -1
  42. package/dist/cjs/types/fetchData.js +4 -0
  43. package/dist/cjs/types/fetchData.js.map +1 -0
  44. package/dist/cjs/types/index.js +6 -0
  45. package/dist/cjs/types/index.js.map +1 -1
  46. package/dist/cjs/types/types.js.map +1 -1
  47. package/dist/docs/app_config_structure.md +1 -0
  48. package/dist/docs/auto-patterns-guide.md +270 -40
  49. package/dist/docs/bulk_actions.md +2 -5
  50. package/dist/docs/collection_page_actions.md +3 -12
  51. package/dist/docs/custom_overrides.md +1 -15
  52. package/dist/docs/entity_page_actions.md +3 -3
  53. package/dist/docs/entity_page_view_actions.md +2 -2
  54. package/dist/docs/error_handling.md +135 -0
  55. package/dist/docs/index.md +8 -0
  56. package/dist/docs/resolved_action.md +106 -0
  57. package/dist/docs/schema_config.md +11 -3
  58. package/dist/docs/wix_fqdn_custom_data_source.md +49 -7
  59. package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js +5 -3
  60. package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -1
  61. package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +2 -2
  62. package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
  63. package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +24 -0
  64. package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
  65. package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js +8 -0
  66. package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
  67. package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js +1 -1
  68. package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
  69. package/dist/esm/dataSourceAdapters/cms/fetchCmsData.js +1 -1
  70. package/dist/esm/dataSourceAdapters/cms/fetchCmsData.js.map +1 -1
  71. package/dist/esm/hooks/index.js +2 -0
  72. package/dist/esm/hooks/index.js.map +1 -1
  73. package/dist/esm/hooks/useAutoPatternsOptimisticActions.js +14 -9
  74. package/dist/esm/hooks/useAutoPatternsOptimisticActions.js.map +1 -1
  75. package/dist/esm/hooks/useBaseCollectionParams.js +37 -0
  76. package/dist/esm/hooks/useBaseCollectionParams.js.map +1 -0
  77. package/dist/esm/hooks/useCommonCollectionFeatures.js +9 -2
  78. package/dist/esm/hooks/useCommonCollectionFeatures.js.map +1 -1
  79. package/dist/esm/hooks/useFetchData.js +2 -2
  80. package/dist/esm/hooks/useFetchData.js.map +1 -1
  81. package/dist/esm/hooks/useGridFeatures.js +10 -30
  82. package/dist/esm/hooks/useGridFeatures.js.map +1 -1
  83. package/dist/esm/hooks/useNavigationUtils.js +21 -6
  84. package/dist/esm/hooks/useNavigationUtils.js.map +1 -1
  85. package/dist/esm/hooks/useTableFeatures.js +10 -30
  86. package/dist/esm/hooks/useTableFeatures.js.map +1 -1
  87. package/dist/esm/hooks/useTableGridSwitchFeatures.js +12 -32
  88. package/dist/esm/hooks/useTableGridSwitchFeatures.js.map +1 -1
  89. package/dist/esm/hooks/useUpdateAppContextItems.js +13 -0
  90. package/dist/esm/hooks/useUpdateAppContextItems.js.map +1 -0
  91. package/dist/esm/providers/AppContext.js +31 -0
  92. package/dist/esm/providers/AppContext.js.map +1 -0
  93. package/dist/esm/providers/ItemsContext.js +23 -0
  94. package/dist/esm/providers/ItemsContext.js.map +1 -0
  95. package/dist/esm/providers/PatternsWizardOverridesContext.js.map +1 -1
  96. package/dist/esm/providers/index.js +1 -0
  97. package/dist/esm/providers/index.js.map +1 -1
  98. package/dist/esm/types/CollectionPageConfig.js.map +1 -1
  99. package/dist/esm/types/fetchData.js +2 -0
  100. package/dist/esm/types/fetchData.js.map +1 -0
  101. package/dist/esm/types/index.js +1 -0
  102. package/dist/esm/types/index.js.map +1 -1
  103. package/dist/esm/types/types.js.map +1 -1
  104. package/dist/types/components/AutoPatternsApp/AutoPatternsApp.d.ts +1 -0
  105. package/dist/types/components/AutoPatternsApp/AutoPatternsApp.d.ts.map +1 -1
  106. package/dist/types/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.d.ts.map +1 -1
  107. package/dist/types/components/AutoPatternsRoute/AutoPatternsRoutes.d.ts.map +1 -1
  108. package/dist/types/hooks/index.d.ts +2 -0
  109. package/dist/types/hooks/index.d.ts.map +1 -1
  110. package/dist/types/hooks/useAutoPatternsOptimisticActions.d.ts +7 -1
  111. package/dist/types/hooks/useAutoPatternsOptimisticActions.d.ts.map +1 -1
  112. package/dist/types/hooks/useBaseCollectionParams.d.ts +27 -0
  113. package/dist/types/hooks/useBaseCollectionParams.d.ts.map +1 -0
  114. package/dist/types/hooks/useCommonCollectionFeatures.d.ts +4 -3
  115. package/dist/types/hooks/useCommonCollectionFeatures.d.ts.map +1 -1
  116. package/dist/types/hooks/useFetchData.d.ts +3 -13
  117. package/dist/types/hooks/useFetchData.d.ts.map +1 -1
  118. package/dist/types/hooks/useGridFeatures.d.ts +1 -1
  119. package/dist/types/hooks/useGridFeatures.d.ts.map +1 -1
  120. package/dist/types/hooks/useNavigationUtils.d.ts +5 -1
  121. package/dist/types/hooks/useNavigationUtils.d.ts.map +1 -1
  122. package/dist/types/hooks/useTableFeatures.d.ts +1 -1
  123. package/dist/types/hooks/useTableFeatures.d.ts.map +1 -1
  124. package/dist/types/hooks/useTableGridSwitchFeatures.d.ts +1 -1
  125. package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +1 -1
  126. package/dist/types/hooks/useUpdateAppContextItems.d.ts +2 -0
  127. package/dist/types/hooks/useUpdateAppContextItems.d.ts.map +1 -0
  128. package/dist/types/providers/AppContext.d.ts +11 -0
  129. package/dist/types/providers/AppContext.d.ts.map +1 -0
  130. package/dist/types/providers/ItemsContext.d.ts +11 -0
  131. package/dist/types/providers/ItemsContext.d.ts.map +1 -0
  132. package/dist/types/providers/PatternsWizardOverridesContext.d.ts +2 -1
  133. package/dist/types/providers/PatternsWizardOverridesContext.d.ts.map +1 -1
  134. package/dist/types/providers/index.d.ts +1 -0
  135. package/dist/types/providers/index.d.ts.map +1 -1
  136. package/dist/types/types/CollectionPageConfig.d.ts +4 -0
  137. package/dist/types/types/CollectionPageConfig.d.ts.map +1 -1
  138. package/dist/types/types/fetchData.d.ts +21 -0
  139. package/dist/types/types/fetchData.d.ts.map +1 -0
  140. package/dist/types/types/index.d.ts +1 -0
  141. package/dist/types/types/index.d.ts.map +1 -1
  142. package/dist/types/types/types.d.ts +6 -5
  143. package/dist/types/types/types.d.ts.map +1 -1
  144. package/package.json +14 -14
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.useItemsContext = exports.ItemsContextProvider = void 0;
5
+ var _react = _interopRequireWildcard(require("react"));
6
+ var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/providers/ItemsContext.tsx";
7
+ 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); }
8
+ 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; }
9
+ const ItemsContext = /*#__PURE__*/(0, _react.createContext)(undefined);
10
+ const ItemsContextProvider = ({
11
+ children
12
+ }) => {
13
+ const [items, setItems] = (0, _react.useState)([]);
14
+ const contextValue = {
15
+ items,
16
+ setItems
17
+ };
18
+ return /*#__PURE__*/_react.default.createElement(ItemsContext.Provider, {
19
+ value: contextValue,
20
+ __self: void 0,
21
+ __source: {
22
+ fileName: _jsxFileName,
23
+ lineNumber: 25,
24
+ columnNumber: 5
25
+ }
26
+ }, children);
27
+ };
28
+ exports.ItemsContextProvider = ItemsContextProvider;
29
+ const useItemsContext = () => {
30
+ const context = (0, _react.useContext)(ItemsContext);
31
+ if (context === undefined) {
32
+ throw new Error('useItemsContext must be used within an ItemsContextProvider');
33
+ }
34
+ return context;
35
+ };
36
+ exports.useItemsContext = useItemsContext;
37
+ //# sourceMappingURL=ItemsContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ItemsContext","createContext","undefined","ItemsContextProvider","children","items","setItems","useState","contextValue","createElement","Provider","value","__self","__source","fileName","lineNumber","columnNumber","exports","useItemsContext","context","useContext","Error"],"sources":["../../../src/providers/ItemsContext.tsx"],"sourcesContent":["import React, { ReactNode, createContext, useContext, useState } from 'react';\n\nexport interface ItemsContextValue {\n items: any[];\n setItems: (items: any[]) => void;\n}\n\nconst ItemsContext = createContext<ItemsContextValue | undefined>(undefined);\n\nexport interface ItemsContextProviderProps {\n children: ReactNode;\n}\n\nexport const ItemsContextProvider: React.FC<ItemsContextProviderProps> = ({\n children,\n}) => {\n const [items, setItems] = useState<any[]>([]);\n\n const contextValue: ItemsContextValue = {\n items,\n setItems,\n };\n\n return (\n <ItemsContext.Provider value={contextValue}>\n {children}\n </ItemsContext.Provider>\n );\n};\n\nexport const useItemsContext = (): ItemsContextValue => {\n const context = useContext(ItemsContext);\n\n if (context === undefined) {\n throw new Error(\n 'useItemsContext must be used within an ItemsContextProvider',\n );\n }\n\n return context;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA8E,IAAAC,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,SAAAJ,wBAAAI,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,CA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ignoreList":[]}
@@ -16,7 +16,7 @@ const PatternsWizardOverridesProvider = ({
16
16
  __self: void 0,
17
17
  __source: {
18
18
  fileName: _jsxFileName,
19
- lineNumber: 61,
19
+ lineNumber: 65,
20
20
  columnNumber: 5
21
21
  }
22
22
  }, children);
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","PatternsWizardOverridesContext","createContext","undefined","PatternsWizardOverridesProvider","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","exports","usePatternsWizardOverridesContext","useContext"],"sources":["../../../src/providers/PatternsWizardOverridesContext.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode } from 'react';\nimport {\n CustomComponentProps,\n CustomActionCellPrimaryActionResolver,\n CustomActionCellSecondaryActionResolver,\n CustomEntityPageActionResolver,\n CustomBulkActionsActionResolver,\n CustomActionCollectionPageActionResolver,\n CustomActionCollectionPageActionOnRowClickResolver,\n IColumnValue,\n SchemaConfig,\n} from '../types';\n\nimport { Section } from '@wix/patterns';\nimport { BadgeSkin, IconElement } from '@wix/design-system';\n\nexport interface PatternsWizardOverridesContextProps {\n actions?: Record<\n string,\n | CustomActionCellPrimaryActionResolver\n | CustomActionCellSecondaryActionResolver\n | CustomBulkActionsActionResolver\n | CustomEntityPageActionResolver\n | CustomActionCollectionPageActionResolver\n | CustomActionCollectionPageActionOnRowClickResolver\n >;\n columns?: Record<string, (props: IColumnValue<any>) => void>;\n modals?: Record<string, React.FC<any>>;\n emptyState?: Record<string, () => void>;\n components?: Record<string, React.FC<CustomComponentProps>>;\n slots?: Record<string, React.FC>;\n entityPageHeaderSubtitle?: Record<\n string,\n (entity: Record<string, any>) => { text: string }\n >;\n entityPageHeaderBadges?: Record<\n string,\n (entity: Record<string, any>) => {\n text: string;\n skin?: BadgeSkin;\n prefixIcon?: IconElement;\n suffixIcon?: IconElement;\n }[]\n >;\n customDataSources?: Record<\n string,\n (collectionId: string, context: any) => Promise<SchemaConfig>\n >;\n sections?: Record<string, (item: any) => Section>;\n}\n\nconst PatternsWizardOverridesContext = createContext<\n PatternsWizardOverridesContextProps | undefined\n>(undefined);\n\nexport const PatternsWizardOverridesProvider: React.FC<{\n children: ReactNode;\n value: PatternsWizardOverridesContextProps;\n}> = ({ children, value }) => {\n return (\n <PatternsWizardOverridesContext.Provider value={value}>\n {children}\n </PatternsWizardOverridesContext.Provider>\n );\n};\n\nexport const usePatternsWizardOverridesContext = ():\n | PatternsWizardOverridesContextProps\n | undefined => {\n return useContext(PatternsWizardOverridesContext);\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAoE,IAAAC,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,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAmDpE,MAAMW,8BAA8B,gBAAG,IAAAC,oBAAa,EAElDC,SAAS,CAAC;AAEL,MAAMC,+BAGX,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAM,CAAC,KAAK;EAC5B,oBACE7B,MAAA,CAAAU,OAAA,CAAAoB,aAAA,CAACN,8BAA8B,CAACO,QAAQ;IAACF,KAAK,EAAEA,KAAM;IAAAG,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA/B,YAAA;MAAAgC,UAAA;MAAAC,YAAA;IAAA;EAAA,GACnDR,QACsC,CAAC;AAE9C,CAAC;AAACS,OAAA,CAAAV,+BAAA,GAAAA,+BAAA;AAEK,MAAMW,iCAAiC,GAAGA,CAAA,KAEhC;EACf,OAAO,IAAAC,iBAAU,EAACf,8BAA8B,CAAC;AACnD,CAAC;AAACa,OAAA,CAAAC,iCAAA,GAAAA,iCAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","PatternsWizardOverridesContext","createContext","undefined","PatternsWizardOverridesProvider","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","exports","usePatternsWizardOverridesContext","useContext"],"sources":["../../../src/providers/PatternsWizardOverridesContext.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode } from 'react';\nimport {\n CustomComponentProps,\n CustomActionCellPrimaryActionResolver,\n CustomActionCellSecondaryActionResolver,\n CustomEntityPageActionResolver,\n CustomBulkActionsActionResolver,\n CustomActionCollectionPageActionResolver,\n CustomActionCollectionPageActionOnRowClickResolver,\n IColumnValue,\n SchemaConfig,\n} from '../types';\n\nimport { Section, useOptimisticActions } from '@wix/patterns';\nimport { BadgeSkin, IconElement } from '@wix/design-system';\n\nexport interface PatternsWizardOverridesContextProps {\n actions?: Record<\n string,\n | CustomActionCellPrimaryActionResolver\n | CustomActionCellSecondaryActionResolver\n | CustomBulkActionsActionResolver\n | CustomEntityPageActionResolver\n | CustomActionCollectionPageActionResolver\n | CustomActionCollectionPageActionOnRowClickResolver\n >;\n columns?: Record<string, (props: IColumnValue<any>) => void>;\n modals?: Record<string, React.FC<any>>;\n emptyState?: Record<string, () => void>;\n components?: Record<string, React.FC<CustomComponentProps>>;\n slots?: Record<string, React.FC>;\n entityPageHeaderSubtitle?: Record<\n string,\n (entity: Record<string, any>) => { text: string }\n >;\n entityPageHeaderBadges?: Record<\n string,\n (entity: Record<string, any>) => {\n text: string;\n skin?: BadgeSkin;\n prefixIcon?: IconElement;\n suffixIcon?: IconElement;\n }[]\n >;\n customDataSources?: Record<\n string,\n (collectionId: string, context: any) => Promise<SchemaConfig>\n >;\n sections?: Record<string, (item: any) => Section>;\n optimisticActions?: Record<\n string,\n Parameters<typeof useOptimisticActions>[1]\n >;\n}\n\nconst PatternsWizardOverridesContext = createContext<\n PatternsWizardOverridesContextProps | undefined\n>(undefined);\n\nexport const PatternsWizardOverridesProvider: React.FC<{\n children: ReactNode;\n value: PatternsWizardOverridesContextProps;\n}> = ({ children, value }) => {\n return (\n <PatternsWizardOverridesContext.Provider value={value}>\n {children}\n </PatternsWizardOverridesContext.Provider>\n );\n};\n\nexport const usePatternsWizardOverridesContext = ():\n | PatternsWizardOverridesContextProps\n | undefined => {\n return useContext(PatternsWizardOverridesContext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L,MAAMC,+BAGX,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAM,CAAC,KAAK;EAC5B,oBACE7B,MAAA,CAAAU,OAAA,CAAAoB,aAAA,CAACN,8BAA8B,CAACO,QAAQ;IAACF,KAAK,EAAEA,KAAM;IAAAG,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA/B,YAAA;MAAAgC,UAAA;MAAAC,YAAA;IAAA;EAAA,GACnDR,QACsC,CAAC;AAE9C,CAAC;AAACS,OAAA,CAAAV,+BAAA,GAAAA,+BAAA;AAEK,MAAMW,iCAAiC,GAAGA,CAAA,KAEhC;EACf,OAAO,IAAAC,iBAAU,EAACf,8BAA8B,CAAC;AACnD,CAAC;AAACa,OAAA,CAAAC,iCAAA,GAAAA,iCAAA","ignoreList":[]}
@@ -1,40 +1,52 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
+ var _exportNames = {
5
+ useAppContext: true
6
+ };
7
+ exports.useAppContext = void 0;
4
8
  var _SchemaContext = require("./SchemaContext");
5
9
  Object.keys(_SchemaContext).forEach(function (key) {
6
10
  if (key === "default" || key === "__esModule") return;
11
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
7
12
  if (key in exports && exports[key] === _SchemaContext[key]) return;
8
13
  exports[key] = _SchemaContext[key];
9
14
  });
10
15
  var _PatternsWizardOverridesContext = require("./PatternsWizardOverridesContext");
11
16
  Object.keys(_PatternsWizardOverridesContext).forEach(function (key) {
12
17
  if (key === "default" || key === "__esModule") return;
18
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
13
19
  if (key in exports && exports[key] === _PatternsWizardOverridesContext[key]) return;
14
20
  exports[key] = _PatternsWizardOverridesContext[key];
15
21
  });
16
22
  var _ModalContext = require("./ModalContext");
17
23
  Object.keys(_ModalContext).forEach(function (key) {
18
24
  if (key === "default" || key === "__esModule") return;
25
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
19
26
  if (key in exports && exports[key] === _ModalContext[key]) return;
20
27
  exports[key] = _ModalContext[key];
21
28
  });
22
29
  var _SchemaRegistryContext = require("./SchemaRegistryContext");
23
30
  Object.keys(_SchemaRegistryContext).forEach(function (key) {
24
31
  if (key === "default" || key === "__esModule") return;
32
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
25
33
  if (key in exports && exports[key] === _SchemaRegistryContext[key]) return;
26
34
  exports[key] = _SchemaRegistryContext[key];
27
35
  });
28
36
  var _AppConfigContext = require("./AppConfigContext");
29
37
  Object.keys(_AppConfigContext).forEach(function (key) {
30
38
  if (key === "default" || key === "__esModule") return;
39
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
31
40
  if (key in exports && exports[key] === _AppConfigContext[key]) return;
32
41
  exports[key] = _AppConfigContext[key];
33
42
  });
34
43
  var _ErrorContext = require("./ErrorContext");
35
44
  Object.keys(_ErrorContext).forEach(function (key) {
36
45
  if (key === "default" || key === "__esModule") return;
46
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
37
47
  if (key in exports && exports[key] === _ErrorContext[key]) return;
38
48
  exports[key] = _ErrorContext[key];
39
49
  });
50
+ var _AppContext = require("./AppContext");
51
+ exports.useAppContext = _AppContext.useAppContext;
40
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_SchemaContext","require","Object","keys","forEach","key","exports","_PatternsWizardOverridesContext","_ModalContext","_SchemaRegistryContext","_AppConfigContext","_ErrorContext"],"sources":["../../../src/providers/index.ts"],"sourcesContent":["export * from './SchemaContext';\nexport * from './PatternsWizardOverridesContext';\nexport * from './ModalContext';\nexport * from './SchemaRegistryContext';\nexport * from './AppConfigContext';\nexport * from './ErrorContext';\n"],"mappings":";;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OA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AA;AACA,IAAAM,aAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,aAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,aAAA,CAAAN,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAM,aAAA,CAAAN,GAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_SchemaContext","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","_PatternsWizardOverridesContext","_ModalContext","_SchemaRegistryContext","_AppConfigContext","_ErrorContext","_AppContext","useAppContext"],"sources":["../../../src/providers/index.ts"],"sourcesContent":["export * from './SchemaContext';\nexport * from './PatternsWizardOverridesContext';\nexport * from './ModalContext';\nexport * from './SchemaRegistryContext';\nexport * from './AppConfigContext';\nexport * from './ErrorContext';\nexport { useAppContext } from './AppContext';\n"],"mappings":";;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAL,cAAA,CAAAK,GAAA;AAAA;AACA,IAAAM,+BAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,+BAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,I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IAAAU,aAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,aAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAU,aAAA,CAAAV,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAU,aAAA,CAAAV,GAAA;AAAA;AACA,IAAAW,WAAA,GAAAf,OAAA;AAA6CS,OAAA,CAAAO,aAAA,GAAAD,WAAA,CAAAC,aAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["ComponentTypeEnum","exports"],"sources":["../../../src/types/CollectionPageConfig.ts"],"sourcesContent":["import { CollectionToolbarFiltersProps } from '@wix/patterns';\nimport { DateRangeFilterMode, DateRangeOptions } from '@wix/patterns/core';\nimport { BaseCollectionConfig } from './types';\nimport {\n ActionCellConfig,\n BulkActionsConfig,\n CollectionPageOnRowClickActionConfig,\n CollectionPagePrimaryActions,\n CollectionPageSecondaryActions,\n} from './actions';\n\nexport interface CollectionPageTitle {\n text: string;\n hideTotal?: boolean;\n}\n\nexport interface CollectionPageSubtitle {\n text: string;\n learnMore?: {\n url: string;\n label?: string;\n };\n}\n\nexport interface CollectionPageConfig {\n route: {\n path: string;\n };\n title: CollectionPageTitle;\n subtitle?: CollectionPageSubtitle;\n actions?: {\n primaryActions?: CollectionPagePrimaryActions;\n secondaryActions?: CollectionPageSecondaryActions;\n };\n components: ComponentConfig[];\n}\n\nexport interface CollectionComponentConfig\n extends BaseCollectionComponentConfig {\n type: 'collection';\n layout: LayoutItemConfig[];\n}\n\nexport interface CustomComponentConfig {\n type: 'custom';\n id: string;\n}\n\nexport type ComponentConfig = CollectionComponentConfig | CustomComponentConfig;\n\nexport interface LayoutItemConfig {\n type: 'Table' | 'Grid';\n table?: TableSpecificConfig;\n grid?: GridSpecificConfig;\n}\n\nexport type ColumnsConfig = Column[];\n\nexport interface TableSpecificConfig {\n columns: ColumnsConfig;\n customColumns?: {\n enabled: boolean;\n };\n stickyColumns?: number;\n onRowClick?: CollectionPageOnRowClickActionConfig;\n showTitleBar?: boolean;\n sections?: {\n id: string;\n };\n}\n\nexport interface GridSpecificConfig {\n item: GridItem;\n}\n\nexport interface TableConfig\n extends BaseCollectionComponentConfig,\n TableSpecificConfig {}\nexport interface GridConfig\n extends BaseCollectionComponentConfig,\n GridSpecificConfig {}\nexport interface TableGridSwitchConfig\n extends BaseCollectionComponentConfig,\n TableSpecificConfig,\n GridSpecificConfig {}\n\nexport type CollectionConfig = BaseCollectionConfig & {\n limit?: number;\n reflectQueryInUrl?: boolean;\n selectAllScope?: 'page' | 'all';\n selectionUpdateMode?: 'preserve' | 'clear';\n};\n\nexport interface BaseCollectionComponentConfig {\n collection: CollectionConfig;\n entityPageId?: string;\n search?: { shown?: boolean };\n toolbarTitle?: ToolbarTitle;\n actionCell?: ActionCellConfig;\n emptyState?: EmptyState;\n filters?: FiltersConfig;\n bulkActionToolbar?: BulkActionsConfig;\n}\n\nexport interface ToolbarTitle {\n title: string;\n subtitle?: {\n text: string;\n info?: {\n content: {\n text: string;\n link?: {\n url: string;\n label: string;\n };\n };\n };\n learnMore?: {\n url: string;\n label?: string;\n };\n };\n showTotal?: boolean;\n itemsLimit?: number;\n}\n\nexport interface Column {\n id: string;\n name: string;\n width: string;\n sortable?: boolean;\n defaultSortOrder?: 'asc' | 'desc';\n sortMode?: 'asc' | 'desc';\n defaultHidden?: boolean;\n hiddenFromCustomColumnsSelection?: boolean;\n hideable?: boolean;\n reorderDisabled?: boolean;\n}\n\nexport interface GridItem {\n titleFieldId: string;\n subtitleFieldId?: string;\n imageFieldId?: string;\n cardContentMode?: 'full' | 'title' | 'empty'; // Footer is not supported in auto-patterns\n imagePlacement?: 'top' | 'side';\n}\n\nexport interface EmptyState {\n title?: string;\n subtitle?: string;\n image?: {\n id: string;\n };\n addNewCta?: {\n id?: string;\n text?: string;\n };\n customCta?: {\n id?: string;\n };\n}\n\nexport interface FilterOption {\n value: string;\n label: string;\n}\n\nexport type FilterSelectionMode = 'single' | 'multiple';\nexport type FilterOptionType =\n | 'checkbox'\n | 'inlineCheckbox'\n | 'radio'\n | 'select';\n\nexport enum ComponentTypeEnum {\n SINGLE = 'single',\n MULTI_SELECT = 'multi-select',\n RADIO_GROUP = 'radio-group',\n NUMBER = 'number',\n DATE_RANGE = 'date-range',\n}\n\nexport type FilterItems = Filter[];\nexport interface FiltersConfig {\n items: FilterItems;\n maxInlineFilters?: CollectionToolbarFiltersProps['inline'];\n panelTitle?: string;\n}\n\nexport interface BaseOptionsFilterConfig {\n selectionMode: FilterSelectionMode;\n}\n\nexport interface DateFilterConfig {\n mode?: DateRangeFilterMode;\n presets?: DateRangeOptions;\n includeTime?: boolean;\n}\n\nexport interface NumberFilterConfig {\n min?: number;\n max?: number;\n allowedDecimals?: boolean;\n}\n\nexport interface BooleanFilterConfig {\n trueLabel?: string;\n falseLabel?: string;\n}\n\nexport interface EnumFilterConfig extends BaseOptionsFilterConfig {\n options: FilterOption[];\n optionType?: FilterOptionType;\n}\n\nexport interface DynamicOptionsFilterConfig extends BaseOptionsFilterConfig {}\n\nexport interface Filter {\n id: string;\n fieldId: string;\n displayName?: string;\n sectionTitle?: string;\n openByDefault?: boolean;\n tagLabel?: string;\n numberConfig?: NumberFilterConfig;\n dateConfig?: DateFilterConfig;\n booleanConfig?: BooleanFilterConfig;\n enumConfig?: EnumFilterConfig;\n dynamicOptionsConfig?: DynamicOptionsFilterConfig;\n}\n"],"mappings":";;;;IA8KYA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["ComponentTypeEnum","exports"],"sources":["../../../src/types/CollectionPageConfig.ts"],"sourcesContent":["import { CollectionToolbarFiltersProps } from '@wix/patterns';\nimport { DateRangeFilterMode, DateRangeOptions } from '@wix/patterns/core';\nimport { BaseCollectionConfig } from './types';\nimport {\n ActionCellConfig,\n BulkActionsConfig,\n CollectionPageOnRowClickActionConfig,\n CollectionPagePrimaryActions,\n CollectionPageSecondaryActions,\n} from './actions';\n\nexport interface CollectionPageTitle {\n text: string;\n hideTotal?: boolean;\n}\n\nexport interface CollectionPageSubtitle {\n text: string;\n learnMore?: {\n url: string;\n label?: string;\n };\n}\n\nexport interface CollectionPageConfig {\n route: {\n path: string;\n };\n title: CollectionPageTitle;\n subtitle?: CollectionPageSubtitle;\n actions?: {\n primaryActions?: CollectionPagePrimaryActions;\n secondaryActions?: CollectionPageSecondaryActions;\n };\n components: ComponentConfig[];\n}\n\nexport interface CollectionComponentConfig\n extends BaseCollectionComponentConfig {\n type: 'collection';\n layout: LayoutItemConfig[];\n}\n\nexport interface CustomComponentConfig {\n type: 'custom';\n id: string;\n}\n\nexport type ComponentConfig = CollectionComponentConfig | CustomComponentConfig;\n\nexport interface LayoutItemConfig {\n type: 'Table' | 'Grid';\n table?: TableSpecificConfig;\n grid?: GridSpecificConfig;\n}\n\nexport type ColumnsConfig = Column[];\n\nexport interface TableSpecificConfig {\n columns: ColumnsConfig;\n customColumns?: {\n enabled: boolean;\n };\n stickyColumns?: number;\n onRowClick?: CollectionPageOnRowClickActionConfig;\n showTitleBar?: boolean;\n sections?: {\n id: string;\n };\n}\n\nexport interface GridSpecificConfig {\n item: GridItem;\n}\n\nexport interface TableConfig\n extends BaseCollectionComponentConfig,\n TableSpecificConfig {}\nexport interface GridConfig\n extends BaseCollectionComponentConfig,\n GridSpecificConfig {}\nexport interface TableGridSwitchConfig\n extends BaseCollectionComponentConfig,\n TableSpecificConfig,\n GridSpecificConfig {}\n\nexport type CollectionConfig = BaseCollectionConfig & {\n limit?: number;\n reflectQueryInUrl?: boolean;\n selectAllScope?: 'page' | 'all';\n selectionUpdateMode?: 'preserve' | 'clear';\n optimisticActions?: {\n id: string;\n };\n paginationMode?: 'cursor' | 'offset';\n};\n\nexport interface BaseCollectionComponentConfig {\n collection: CollectionConfig;\n entityPageId?: string;\n search?: { shown?: boolean };\n toolbarTitle?: ToolbarTitle;\n actionCell?: ActionCellConfig;\n emptyState?: EmptyState;\n filters?: FiltersConfig;\n bulkActionToolbar?: BulkActionsConfig;\n}\n\nexport interface ToolbarTitle {\n title: string;\n subtitle?: {\n text: string;\n info?: {\n content: {\n text: string;\n link?: {\n url: string;\n label: string;\n };\n };\n };\n learnMore?: {\n url: string;\n label?: string;\n };\n };\n showTotal?: boolean;\n itemsLimit?: number;\n}\n\nexport interface Column {\n id: string;\n name: string;\n width: string;\n sortable?: boolean;\n defaultSortOrder?: 'asc' | 'desc';\n sortMode?: 'asc' | 'desc';\n defaultHidden?: boolean;\n hiddenFromCustomColumnsSelection?: boolean;\n hideable?: boolean;\n reorderDisabled?: boolean;\n}\n\nexport interface GridItem {\n titleFieldId: string;\n subtitleFieldId?: string;\n imageFieldId?: string;\n cardContentMode?: 'full' | 'title' | 'empty'; // Footer is not supported in auto-patterns\n imagePlacement?: 'top' | 'side';\n}\n\nexport interface EmptyState {\n title?: string;\n subtitle?: string;\n image?: {\n id: string;\n };\n addNewCta?: {\n id?: string;\n text?: string;\n };\n customCta?: {\n id?: string;\n };\n}\n\nexport interface FilterOption {\n value: string;\n label: string;\n}\n\nexport type FilterSelectionMode = 'single' | 'multiple';\nexport type FilterOptionType =\n | 'checkbox'\n | 'inlineCheckbox'\n | 'radio'\n | 'select';\n\nexport enum ComponentTypeEnum {\n SINGLE = 'single',\n MULTI_SELECT = 'multi-select',\n RADIO_GROUP = 'radio-group',\n NUMBER = 'number',\n DATE_RANGE = 'date-range',\n}\n\nexport type FilterItems = Filter[];\nexport interface FiltersConfig {\n items: FilterItems;\n maxInlineFilters?: CollectionToolbarFiltersProps['inline'];\n panelTitle?: string;\n}\n\nexport interface BaseOptionsFilterConfig {\n selectionMode: FilterSelectionMode;\n}\n\nexport interface DateFilterConfig {\n mode?: DateRangeFilterMode;\n presets?: DateRangeOptions;\n includeTime?: boolean;\n}\n\nexport interface NumberFilterConfig {\n min?: number;\n max?: number;\n allowedDecimals?: boolean;\n}\n\nexport interface BooleanFilterConfig {\n trueLabel?: string;\n falseLabel?: string;\n}\n\nexport interface EnumFilterConfig extends BaseOptionsFilterConfig {\n options: FilterOption[];\n optionType?: FilterOptionType;\n}\n\nexport interface DynamicOptionsFilterConfig extends BaseOptionsFilterConfig {}\n\nexport interface Filter {\n id: string;\n fieldId: string;\n displayName?: string;\n sectionTitle?: string;\n openByDefault?: boolean;\n tagLabel?: string;\n numberConfig?: NumberFilterConfig;\n dateConfig?: DateFilterConfig;\n booleanConfig?: BooleanFilterConfig;\n enumConfig?: EnumFilterConfig;\n dynamicOptionsConfig?: DynamicOptionsFilterConfig;\n}\n"],"mappings":";;;;IAkLYA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ //# sourceMappingURL=fetchData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../../src/types/fetchData.ts"],"sourcesContent":["import { CursorQuery, OffsetQuery } from '@wix/patterns';\n\nexport type Mode = 'cursor' | 'offset';\n\nexport type UseFetchDataProps<M extends Mode> = {\n searchableFieldIds?: string[];\n filterFieldMapping?: Record<string, { fieldId: string }>;\n paginationMode?: M;\n};\n\nexport interface CursorQueryResult {\n items: any[];\n cursor?: string | undefined | null;\n total?: number | null;\n}\n\nexport interface OffsetQueryResult {\n items: any[];\n total?: number | null;\n hasNext?: boolean;\n}\n\nexport type FetchDataFn<M extends Mode> = M extends 'cursor'\n ? (q: CursorQuery<any>) => Promise<CursorQueryResult>\n : (q: OffsetQuery<any>) => Promise<OffsetQueryResult>;\n"],"mappings":"","ignoreList":[]}
@@ -43,4 +43,10 @@ Object.keys(_BaseSDK).forEach(function (key) {
43
43
  if (key in exports && exports[key] === _BaseSDK[key]) return;
44
44
  exports[key] = _BaseSDK[key];
45
45
  });
46
+ var _fetchData = require("./fetchData");
47
+ Object.keys(_fetchData).forEach(function (key) {
48
+ if (key === "default" || key === "__esModule") return;
49
+ if (key in exports && exports[key] === _fetchData[key]) return;
50
+ exports[key] = _fetchData[key];
51
+ });
46
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_types","require","Object","keys","forEach","key","exports","_CollectionPageConfig","_EntityPageConfig","_providers","_actions","_types2","_BaseSDK"],"sources":["../../../src/types/index.ts"],"sourcesContent":["export * from './types';\nexport * from './CollectionPageConfig';\nexport * from './EntityPageConfig';\nexport * from './providers';\nexport * from './actions';\nexport * from '../utils/actions/types';\nexport * from './BaseSDK';\n"],"mappings":";;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAL,MAAA,CAAAK,GAAA;AAAA;AACA,IAAAE,qBAAA,GAAAN,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAI,qBAAA,EAAAH,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAE,qBAAA,CAAAF,GAAA;EAAAC,OAA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EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,QAAA,CAAAP,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAO,QAAA,CAAAP,GAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_types","require","Object","keys","forEach","key","exports","_CollectionPageConfig","_EntityPageConfig","_providers","_actions","_types2","_BaseSDK","_fetchData"],"sources":["../../../src/types/index.ts"],"sourcesContent":["export * from './types';\nexport * from './CollectionPageConfig';\nexport * from './EntityPageConfig';\nexport * from './providers';\nexport * from './actions';\nexport * from '../utils/actions/types';\nexport * from './BaseSDK';\nexport * from './fetchData';\n"],"mappings":";;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAL,MAAA,CAAAK,GAAA;AAAA;AACA,IAAAE,qBAAA,GAAAN,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAI,qBAAA,EAAAH,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAE,qBAAA,CAAAF,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAE,qBAAA,CAAAF,GAAA;AAAA;AACA,IAAAG,iBAAA,GAAAP,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAK,iBAAA,EAAAJ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAA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AAC,MAAA,CAAAC,IAAA,CAAAU,UAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,UAAA,CAAAR,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAQ,UAAA,CAAAR,GAAA;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/types/types.ts"],"sourcesContent":["import { EntityPageConfig } from './EntityPageConfig';\nimport { CollectionPageConfig } from './CollectionPageConfig';\n\ninterface BaseCollectionConfigCommon {\n collectionId: string;\n}\n\ninterface CMSCollectionConfig extends BaseCollectionConfigCommon {\n entityTypeSource: 'cms';\n custom?: never;\n}\n\ninterface CustomCollectionConfig extends BaseCollectionConfigCommon {\n entityTypeSource: 'custom';\n custom: {\n id: string;\n };\n}\n\nexport type BaseCollectionConfig = CMSCollectionConfig | CustomCollectionConfig;\n\nexport type PatternsFieldType =\n | 'SHORT_TEXT'\n | 'LONG_TEXT'\n | 'NUMBER'\n | 'BOOLEAN'\n | 'DATE'\n | 'DATETIME'\n | 'URL'\n | 'ARRAY'\n | 'REFERENCE'\n | 'IMAGE';\n\nexport interface AppConfig {\n pages: PageConfig[];\n}\n\nexport interface BasePageConfig {\n id: string;\n appMainPage?: boolean;\n}\n\nexport interface CollectionPageConfigType extends BasePageConfig {\n type: 'collectionPage';\n collectionPage: CollectionPageConfig;\n entityPage?: never;\n}\n\nexport interface EntityPageConfigType extends BasePageConfig {\n type: 'entityPage';\n entityPage: EntityPageConfig;\n collectionPage?: never;\n}\n\nexport type PageConfig = CollectionPageConfigType | EntityPageConfigType;\n\nexport type EntityProps = { [key: string]: any };\n\nexport interface IMenuItem<T extends EntityProps = any> {\n item: T;\n}\nexport interface IColumnValue<T> {\n value: T;\n row: Record<string, any>;\n}\n\nexport type QueryOperator =\n | 'CONTAINS'\n | 'ENDS_WITH'\n | 'EQ'\n | 'EXISTS'\n | 'GT'\n | 'GTE'\n | 'HAS_ALL'\n | 'HAS_SOME'\n | 'LT'\n | 'LTE'\n | 'NE'\n | 'STARTS_WITH'\n | 'URLIZED';\n\ninterface BaseField {\n id: string;\n displayName: string;\n validation?: {\n numberRange?: NumberRange;\n stringLengthRange?: StringLengthRange;\n required: boolean;\n };\n capabilities: {\n supportedQueryOperators: QueryOperator[];\n sortable: boolean;\n };\n}\n\nexport interface ReferenceField extends BaseField {\n type: 'REFERENCE';\n referenceMetadata: {\n referencedCollectionId: string;\n };\n}\n\nexport interface NonReferenceField extends BaseField {\n type: Exclude<PatternsFieldType, 'REFERENCE'>;\n}\n\nexport type Field = ReferenceField | NonReferenceField;\n\nexport interface NumberRange {\n min?: number;\n max?: number;\n}\nexport interface StringLengthRange {\n minLength?: number;\n maxLength?: number;\n}\n\nexport interface Query {\n limit: number;\n offset: number;\n page: number;\n search?: string;\n cursor?: string | null;\n filters: Record<string, any>;\n sort?: {\n fieldName: string;\n order: 'asc' | 'desc';\n }[];\n}\n\nexport interface SchemaConfig {\n id: string;\n fields: Record<string, Field | undefined>;\n displayField: string;\n idField: string;\n actions: {\n get: (entityId: string) => Promise<any>;\n create: (newEntity: Partial<any>) => Promise<any>;\n update: (updatedEntity: any) => Promise<any>;\n delete: (entityId: string) => Promise<any>;\n bulkDelete: (entityIds: string[]) => Promise<any>;\n find: (\n query: Query,\n options?: {\n searchableFieldIds?: string[];\n filterFieldMapping?: Record<string, { fieldId: string }>;\n },\n ) => Promise<{ items: any[]; total: number }>;\n };\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../src/types/types.ts"],"sourcesContent":["import { EntityPageConfig } from './EntityPageConfig';\nimport { CollectionPageConfig } from './CollectionPageConfig';\nimport { useOptimisticActions } from '@wix/patterns';\nimport { CursorQueryResult, OffsetQueryResult } from './fetchData';\n\ninterface BaseCollectionConfigCommon {\n collectionId: string;\n}\n\ninterface CMSCollectionConfig extends BaseCollectionConfigCommon {\n entityTypeSource: 'cms';\n custom?: never;\n}\n\ninterface CustomCollectionConfig extends BaseCollectionConfigCommon {\n entityTypeSource: 'custom';\n custom: {\n id: string;\n };\n}\n\nexport type BaseCollectionConfig = CMSCollectionConfig | CustomCollectionConfig;\n\nexport type PatternsFieldType =\n | 'SHORT_TEXT'\n | 'LONG_TEXT'\n | 'NUMBER'\n | 'BOOLEAN'\n | 'DATE'\n | 'DATETIME'\n | 'URL'\n | 'ARRAY'\n | 'REFERENCE'\n | 'IMAGE';\n\nexport interface AppConfig {\n pages: PageConfig[];\n layout?: 'panel';\n}\n\nexport interface BasePageConfig {\n id: string;\n appMainPage?: boolean;\n}\n\nexport interface CollectionPageConfigType extends BasePageConfig {\n type: 'collectionPage';\n collectionPage: CollectionPageConfig;\n entityPage?: never;\n}\n\nexport interface EntityPageConfigType extends BasePageConfig {\n type: 'entityPage';\n entityPage: EntityPageConfig;\n collectionPage?: never;\n}\n\nexport type PageConfig = CollectionPageConfigType | EntityPageConfigType;\n\nexport type EntityProps = { [key: string]: any };\n\nexport interface IMenuItem<T extends EntityProps = any> {\n item: T;\n}\nexport interface IColumnValue<T> {\n value: T;\n row: Record<string, any>;\n}\n\nexport type QueryOperator =\n | 'CONTAINS'\n | 'ENDS_WITH'\n | 'EQ'\n | 'EXISTS'\n | 'GT'\n | 'GTE'\n | 'HAS_ALL'\n | 'HAS_SOME'\n | 'LT'\n | 'LTE'\n | 'NE'\n | 'STARTS_WITH'\n | 'URLIZED';\n\ninterface BaseField {\n id: string;\n displayName: string;\n validation?: {\n numberRange?: NumberRange;\n stringLengthRange?: StringLengthRange;\n required: boolean;\n };\n capabilities: {\n supportedQueryOperators: QueryOperator[];\n sortable: boolean;\n };\n}\n\nexport interface ReferenceField extends BaseField {\n type: 'REFERENCE';\n referenceMetadata: {\n referencedCollectionId: string;\n };\n}\n\nexport interface NonReferenceField extends BaseField {\n type: Exclude<PatternsFieldType, 'REFERENCE'>;\n}\n\nexport type Field = ReferenceField | NonReferenceField;\n\nexport interface NumberRange {\n min?: number;\n max?: number;\n}\nexport interface StringLengthRange {\n minLength?: number;\n maxLength?: number;\n}\n\nexport interface Query {\n limit: number;\n offset?: number;\n page: number;\n search?: string;\n cursor?: string | null;\n filters: Record<string, any>;\n sort?: {\n fieldName: string;\n order: 'asc' | 'desc';\n }[];\n}\nexport interface SchemaConfig {\n id: string;\n fields: Record<string, Field | undefined>;\n displayField: string;\n idField: string;\n actions: {\n get: (entityId: string) => Promise<any>;\n create: (newEntity: Partial<any>) => Promise<any>;\n update: (updatedEntity: any) => Promise<any>;\n delete: (entityId: string) => Promise<any>;\n bulkDelete: (entityIds: string[]) => Promise<any>;\n find: (\n query: Query,\n options?: {\n searchableFieldIds?: string[];\n filterFieldMapping?: Record<string, { fieldId: string }>;\n },\n ) => Promise<CursorQueryResult | OffsetQueryResult>;\n };\n}\n\nexport type OptimisticActionsParams = Parameters<\n typeof useOptimisticActions\n>[1];\n"],"mappings":"","ignoreList":[]}
@@ -89,6 +89,7 @@ export interface AppConfig {
89
89
  reflectQueryInUrl?: boolean; // Reflects query state (search, filters, sorting) in the browser URL. Default: false
90
90
  selectAllScope?: 'page' | 'all'; // Controls "Select All" scope. 'all' selects entire collection, 'page' selects only visible items. Default: 'all'
91
91
  selectionUpdateMode?: 'preserve' | 'clear'; // Controls selection behavior when data changes. 'preserve' maintains selections, 'clear' clears them. Default: 'clear'
92
+ paginationMode?: 'cursor' | 'offset'; // Controls pagination strategy and expected find() return shape. 'cursor' => { items, cursor, total? }, 'offset' (default) => { items, hasNext, total? }
92
93
  };
93
94
  filters?: {
94
95
  panelTitle?: string; // Title of the filters panel