@wix/auto-patterns 1.28.0 → 1.30.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 (212) hide show
  1. package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +19 -58
  2. package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
  3. package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +1 -1
  4. package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
  5. package/dist/cjs/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js +48 -0
  6. package/dist/cjs/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js.map +1 -0
  7. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +1 -1
  8. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +1 -1
  9. package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +1 -1
  10. package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +1 -1
  11. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js +11 -7
  12. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
  13. package/dist/cjs/components/ModalRenderer.js +1 -1
  14. package/dist/cjs/components/ModalRenderer.js.map +1 -1
  15. package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js +5 -0
  16. package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
  17. package/dist/cjs/hooks/index.js +0 -7
  18. package/dist/cjs/hooks/index.js.map +1 -1
  19. package/dist/cjs/hooks/useAppContextSync.js +24 -0
  20. package/dist/cjs/hooks/useAppContextSync.js.map +1 -0
  21. package/dist/cjs/hooks/useAutoPatternsOptimisticActions.js +2 -2
  22. package/dist/cjs/hooks/useAutoPatternsOptimisticActions.js.map +1 -1
  23. package/dist/cjs/hooks/useBaseSDK.js +1 -1
  24. package/dist/cjs/hooks/useBaseSDK.js.map +1 -1
  25. package/dist/cjs/hooks/useColumns.js +1 -1
  26. package/dist/cjs/hooks/useColumns.js.map +1 -1
  27. package/dist/cjs/hooks/useEmptyStates.js +1 -1
  28. package/dist/cjs/hooks/useEmptyStates.js.map +1 -1
  29. package/dist/cjs/hooks/useEntityPageHeaderTexts.js +2 -2
  30. package/dist/cjs/hooks/useEntityPageHeaderTexts.js.map +1 -1
  31. package/dist/cjs/hooks/useFilters.js +2 -2
  32. package/dist/cjs/hooks/useFilters.js.map +1 -1
  33. package/dist/cjs/hooks/useGridFeatures.js +10 -2
  34. package/dist/cjs/hooks/useGridFeatures.js.map +1 -1
  35. package/dist/cjs/hooks/useTableFeatures.js +12 -4
  36. package/dist/cjs/hooks/useTableFeatures.js.map +1 -1
  37. package/dist/cjs/hooks/useTableGridSwitchFeatures.js +10 -2
  38. package/dist/cjs/hooks/useTableGridSwitchFeatures.js.map +1 -1
  39. package/dist/cjs/providers/AppContext.js +10 -8
  40. package/dist/cjs/providers/AppContext.js.map +1 -1
  41. package/dist/cjs/providers/AppContextData.js +40 -0
  42. package/dist/cjs/providers/AppContextData.js.map +1 -0
  43. package/dist/cjs/providers/{PatternsWizardOverridesContext.js → AutoPatternsOverridesContext.js} +14 -11
  44. package/dist/cjs/providers/AutoPatternsOverridesContext.js.map +1 -0
  45. package/dist/cjs/providers/ItemsContext.js +14 -11
  46. package/dist/cjs/providers/ItemsContext.js.map +1 -1
  47. package/dist/cjs/providers/SchemaContext.js +24 -7
  48. package/dist/cjs/providers/SchemaContext.js.map +1 -1
  49. package/dist/cjs/providers/index.js +11 -4
  50. package/dist/cjs/providers/index.js.map +1 -1
  51. package/dist/cjs/types/BaseSDK.js.map +1 -1
  52. package/dist/cjs/types/CollectionPageConfig.js.map +1 -1
  53. package/dist/cjs/types/EntityPageConfig.js.map +1 -1
  54. package/dist/cjs/types/actions/actionCell.js.map +1 -1
  55. package/dist/cjs/types/actions/base.js.map +1 -1
  56. package/dist/cjs/types/actions/bulkActions.js.map +1 -1
  57. package/dist/cjs/types/actions/collectionPageActions.js.map +1 -1
  58. package/dist/cjs/types/actions/entityPageActions.js.map +1 -1
  59. package/dist/cjs/types/fetchData.js.map +1 -1
  60. package/dist/cjs/types/types.js.map +1 -1
  61. package/dist/cjs/utils/actions/resolveAction.js +2 -1
  62. package/dist/cjs/utils/actions/resolveAction.js.map +1 -1
  63. package/dist/cjs/utils/actions/types.js.map +1 -1
  64. package/dist/cjs/utils/vibe.js +11 -0
  65. package/dist/cjs/utils/vibe.js.map +1 -0
  66. package/dist/docs/action_cell.md +18 -8
  67. package/dist/docs/app_config_structure.md +36 -1
  68. package/dist/docs/app_context.md +109 -0
  69. package/dist/docs/auto-patterns-guide.md +244 -64
  70. package/dist/docs/bulk_actions.md +10 -5
  71. package/dist/docs/collection_page.md +1 -1
  72. package/dist/docs/collection_page_actions.md +16 -9
  73. package/dist/docs/custom_overrides.md +21 -21
  74. package/dist/docs/entity_page.md +10 -10
  75. package/dist/docs/entity_page_actions.md +11 -4
  76. package/dist/docs/index.md +4 -0
  77. package/dist/docs/installation.md +3 -3
  78. package/dist/docs/resolved_action.md +6 -2
  79. package/dist/docs/wix_fqdn_custom_data_source.md +2 -2
  80. package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +2 -25
  81. package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
  82. package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +2 -2
  83. package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
  84. package/dist/esm/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js +29 -0
  85. package/dist/esm/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js.map +1 -0
  86. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +2 -2
  87. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +1 -1
  88. package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +2 -2
  89. package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +1 -1
  90. package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js +5 -1
  91. package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
  92. package/dist/esm/components/ModalRenderer.js +2 -2
  93. package/dist/esm/components/ModalRenderer.js.map +1 -1
  94. package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js +4 -0
  95. package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
  96. package/dist/esm/hooks/index.js +0 -1
  97. package/dist/esm/hooks/index.js.map +1 -1
  98. package/dist/esm/hooks/useAppContextSync.js +19 -0
  99. package/dist/esm/hooks/useAppContextSync.js.map +1 -0
  100. package/dist/esm/hooks/useAutoPatternsOptimisticActions.js +2 -2
  101. package/dist/esm/hooks/useAutoPatternsOptimisticActions.js.map +1 -1
  102. package/dist/esm/hooks/useBaseSDK.js +2 -2
  103. package/dist/esm/hooks/useBaseSDK.js.map +1 -1
  104. package/dist/esm/hooks/useColumns.js +2 -2
  105. package/dist/esm/hooks/useColumns.js.map +1 -1
  106. package/dist/esm/hooks/useEmptyStates.js +2 -2
  107. package/dist/esm/hooks/useEmptyStates.js.map +1 -1
  108. package/dist/esm/hooks/useEntityPageHeaderTexts.js +2 -2
  109. package/dist/esm/hooks/useEntityPageHeaderTexts.js.map +1 -1
  110. package/dist/esm/hooks/useFilters.js +2 -2
  111. package/dist/esm/hooks/useFilters.js.map +1 -1
  112. package/dist/esm/hooks/useGridFeatures.js +10 -2
  113. package/dist/esm/hooks/useGridFeatures.js.map +1 -1
  114. package/dist/esm/hooks/useTableFeatures.js +12 -4
  115. package/dist/esm/hooks/useTableFeatures.js.map +1 -1
  116. package/dist/esm/hooks/useTableGridSwitchFeatures.js +10 -2
  117. package/dist/esm/hooks/useTableGridSwitchFeatures.js.map +1 -1
  118. package/dist/esm/providers/AppContext.js +7 -5
  119. package/dist/esm/providers/AppContext.js.map +1 -1
  120. package/dist/esm/providers/AppContextData.js +26 -0
  121. package/dist/esm/providers/AppContextData.js.map +1 -0
  122. package/dist/esm/providers/AutoPatternsOverridesContext.js +19 -0
  123. package/dist/esm/providers/AutoPatternsOverridesContext.js.map +1 -0
  124. package/dist/esm/providers/ItemsContext.js +10 -7
  125. package/dist/esm/providers/ItemsContext.js.map +1 -1
  126. package/dist/esm/providers/SchemaContext.js +23 -6
  127. package/dist/esm/providers/SchemaContext.js.map +1 -1
  128. package/dist/esm/providers/index.js +2 -1
  129. package/dist/esm/providers/index.js.map +1 -1
  130. package/dist/esm/types/BaseSDK.js.map +1 -1
  131. package/dist/esm/types/CollectionPageConfig.js.map +1 -1
  132. package/dist/esm/types/EntityPageConfig.js.map +1 -1
  133. package/dist/esm/types/actions/actionCell.js.map +1 -1
  134. package/dist/esm/types/actions/base.js.map +1 -1
  135. package/dist/esm/types/actions/bulkActions.js.map +1 -1
  136. package/dist/esm/types/actions/collectionPageActions.js.map +1 -1
  137. package/dist/esm/types/actions/entityPageActions.js.map +1 -1
  138. package/dist/esm/types/fetchData.js.map +1 -1
  139. package/dist/esm/types/types.js.map +1 -1
  140. package/dist/esm/utils/actions/resolveAction.js +2 -1
  141. package/dist/esm/utils/actions/resolveAction.js.map +1 -1
  142. package/dist/esm/utils/actions/types.js.map +1 -1
  143. package/dist/esm/utils/vibe.js +6 -0
  144. package/dist/esm/utils/vibe.js.map +1 -0
  145. package/dist/types/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.d.ts.map +1 -1
  146. package/dist/types/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.d.ts +3 -0
  147. package/dist/types/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.d.ts.map +1 -0
  148. package/dist/types/components/AutoPatternsRoute/AutoPatternsRoutes.d.ts.map +1 -1
  149. package/dist/types/dataSourceAdapters/cms/cmsAdapter.d.ts +2 -1
  150. package/dist/types/dataSourceAdapters/cms/cmsAdapter.d.ts.map +1 -1
  151. package/dist/types/hooks/index.d.ts +0 -1
  152. package/dist/types/hooks/index.d.ts.map +1 -1
  153. package/dist/types/hooks/useAppContextSync.d.ts +2 -0
  154. package/dist/types/hooks/useAppContextSync.d.ts.map +1 -0
  155. package/dist/types/hooks/useEntityPageHeaderTexts.d.ts.map +1 -1
  156. package/dist/types/hooks/useGridFeatures.d.ts.map +1 -1
  157. package/dist/types/hooks/useTableFeatures.d.ts.map +1 -1
  158. package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +1 -1
  159. package/dist/types/providers/AppContext.d.ts +2 -2
  160. package/dist/types/providers/AppContext.d.ts.map +1 -1
  161. package/dist/types/providers/AppContextData.d.ts +13 -0
  162. package/dist/types/providers/AppContextData.d.ts.map +1 -0
  163. package/dist/types/providers/{PatternsWizardOverridesContext.d.ts → AutoPatternsOverridesContext.d.ts} +12 -4
  164. package/dist/types/providers/AutoPatternsOverridesContext.d.ts.map +1 -0
  165. package/dist/types/providers/ItemsContext.d.ts +6 -4
  166. package/dist/types/providers/ItemsContext.d.ts.map +1 -1
  167. package/dist/types/providers/SchemaContext.d.ts.map +1 -1
  168. package/dist/types/providers/index.d.ts +2 -1
  169. package/dist/types/providers/index.d.ts.map +1 -1
  170. package/dist/types/types/BaseSDK.d.ts +2 -2
  171. package/dist/types/types/BaseSDK.d.ts.map +1 -1
  172. package/dist/types/types/CollectionPageConfig.d.ts +315 -0
  173. package/dist/types/types/CollectionPageConfig.d.ts.map +1 -1
  174. package/dist/types/types/EntityPageConfig.d.ts +111 -0
  175. package/dist/types/types/EntityPageConfig.d.ts.map +1 -1
  176. package/dist/types/types/actions/actionCell.d.ts +41 -0
  177. package/dist/types/types/actions/actionCell.d.ts.map +1 -1
  178. package/dist/types/types/actions/base.d.ts +85 -0
  179. package/dist/types/types/actions/base.d.ts.map +1 -1
  180. package/dist/types/types/actions/bulkActions.d.ts +40 -0
  181. package/dist/types/types/actions/bulkActions.d.ts.map +1 -1
  182. package/dist/types/types/actions/collectionPageActions.d.ts +30 -0
  183. package/dist/types/types/actions/collectionPageActions.d.ts.map +1 -1
  184. package/dist/types/types/actions/entityPageActions.d.ts +25 -0
  185. package/dist/types/types/actions/entityPageActions.d.ts.map +1 -1
  186. package/dist/types/types/fetchData.d.ts +35 -0
  187. package/dist/types/types/fetchData.d.ts.map +1 -1
  188. package/dist/types/types/types.d.ts +114 -2
  189. package/dist/types/types/types.d.ts.map +1 -1
  190. package/dist/types/utils/actions/resolveAction.d.ts +1 -0
  191. package/dist/types/utils/actions/resolveAction.d.ts.map +1 -1
  192. package/dist/types/utils/actions/types.d.ts +1 -0
  193. package/dist/types/utils/actions/types.d.ts.map +1 -1
  194. package/dist/types/utils/vibe.d.ts +2 -0
  195. package/dist/types/utils/vibe.d.ts.map +1 -0
  196. package/package.json +10 -10
  197. package/dist/cjs/dataSourceAdapters/factory.js +0 -14
  198. package/dist/cjs/dataSourceAdapters/factory.js.map +0 -1
  199. package/dist/cjs/hooks/useUpdateAppContextItems.js +0 -18
  200. package/dist/cjs/hooks/useUpdateAppContextItems.js.map +0 -1
  201. package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +0 -1
  202. package/dist/esm/dataSourceAdapters/factory.js +0 -10
  203. package/dist/esm/dataSourceAdapters/factory.js.map +0 -1
  204. package/dist/esm/hooks/useUpdateAppContextItems.js +0 -13
  205. package/dist/esm/hooks/useUpdateAppContextItems.js.map +0 -1
  206. package/dist/esm/providers/PatternsWizardOverridesContext.js +0 -15
  207. package/dist/esm/providers/PatternsWizardOverridesContext.js.map +0 -1
  208. package/dist/types/dataSourceAdapters/factory.d.ts +0 -3
  209. package/dist/types/dataSourceAdapters/factory.d.ts.map +0 -1
  210. package/dist/types/hooks/useUpdateAppContextItems.d.ts +0 -2
  211. package/dist/types/hooks/useUpdateAppContextItems.d.ts.map +0 -1
  212. package/dist/types/providers/PatternsWizardOverridesContext.d.ts.map +0 -1
@@ -1,29 +1,32 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.usePatternsWizardOverridesContext = exports.PatternsWizardOverridesProvider = void 0;
4
+ exports.useAutoPatternsOverridesContext = exports.PatternsWizardOverridesProvider = exports.AutoPatternsOverridesProvider = void 0;
5
5
  var _react = _interopRequireWildcard(require("react"));
6
- var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/providers/PatternsWizardOverridesContext.tsx";
6
+ var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/providers/AutoPatternsOverridesContext.tsx";
7
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
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 PatternsWizardOverridesContext = /*#__PURE__*/(0, _react.createContext)(undefined);
10
- const PatternsWizardOverridesProvider = ({
9
+ const AutoPatternsOverridesContext = /*#__PURE__*/(0, _react.createContext)(undefined);
10
+ const AutoPatternsOverridesProvider = ({
11
11
  children,
12
12
  value
13
13
  }) => {
14
- return /*#__PURE__*/_react.default.createElement(PatternsWizardOverridesContext.Provider, {
14
+ return /*#__PURE__*/_react.default.createElement(AutoPatternsOverridesContext.Provider, {
15
15
  value: value,
16
16
  __self: void 0,
17
17
  __source: {
18
18
  fileName: _jsxFileName,
19
- lineNumber: 65,
19
+ lineNumber: 67,
20
20
  columnNumber: 5
21
21
  }
22
22
  }, children);
23
23
  };
24
- exports.PatternsWizardOverridesProvider = PatternsWizardOverridesProvider;
25
- const usePatternsWizardOverridesContext = () => {
26
- return (0, _react.useContext)(PatternsWizardOverridesContext);
24
+ exports.AutoPatternsOverridesProvider = AutoPatternsOverridesProvider;
25
+ const useAutoPatternsOverridesContext = () => {
26
+ return (0, _react.useContext)(AutoPatternsOverridesContext);
27
27
  };
28
- exports.usePatternsWizardOverridesContext = usePatternsWizardOverridesContext;
29
- //# sourceMappingURL=PatternsWizardOverridesContext.js.map
28
+
29
+ // For backwards compatibility
30
+ exports.useAutoPatternsOverridesContext = useAutoPatternsOverridesContext;
31
+ const PatternsWizardOverridesProvider = exports.PatternsWizardOverridesProvider = AutoPatternsOverridesProvider;
32
+ //# sourceMappingURL=AutoPatternsOverridesContext.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","AutoPatternsOverridesContext","createContext","undefined","AutoPatternsOverridesProvider","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","exports","useAutoPatternsOverridesContext","useContext","PatternsWizardOverridesProvider"],"sources":["../../../src/providers/AutoPatternsOverridesContext.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';\nimport { collections } from '@wix/data';\n\nexport interface AutoPatternsOverridesContextProps {\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 cmsSchema?: Record<string, collections.DataCollection>;\n sections?: Record<string, (item: any) => Section>;\n optimisticActions?: Record<\n string,\n Parameters<typeof useOptimisticActions>[1]\n >;\n}\n\nconst AutoPatternsOverridesContext = createContext<\n AutoPatternsOverridesContextProps | undefined\n>(undefined);\n\nexport const AutoPatternsOverridesProvider: React.FC<{\n children: ReactNode;\n value: AutoPatternsOverridesContextProps;\n}> = ({ children, value }) => {\n return (\n <AutoPatternsOverridesContext.Provider value={value}>\n {children}\n </AutoPatternsOverridesContext.Provider>\n );\n};\n\nexport const useAutoPatternsOverridesContext = ():\n | AutoPatternsOverridesContextProps\n | undefined => {\n return useContext(AutoPatternsOverridesContext);\n};\n\n// For backwards compatibility\nexport interface PatternsWizardOverridesContextProps\n extends AutoPatternsOverridesContextProps {}\nexport const PatternsWizardOverridesProvider = AutoPatternsOverridesProvider;\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,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AAM,CAAC,KAAK;EAC5B,oBACE7B,MAAA,CAAAU,OAAA,CAAAoB,aAAA,CAACN,4BAA4B,CAACO,QAAQ;IAACF,KAAK,EAAEA,KAAM;IAAAG,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA/B,YAAA;MAAAgC,UAAA;MAAAC,YAAA;IAAA;EAAA,GACjDR,QACoC,CAAC;AAE5C,CAAC;AAACS,OAAA,CAAAV,6BAAA,GAAAA,6BAAA;AAEK,MAAMW,+BAA+B,GAAGA,CAAA,KAE9B;EACf,OAAO,IAAAC,iBAAU,EAACf,4BAA4B,CAAC;AACjD,CAAC;;AAED;AAAAa,OAAA,CAAAC,+BAAA,GAAAA,+BAAA;AAGO,MAAME,+BAA+B,GAAAH,OAAA,CAAAG,+BAAA,GAAGb,6BAA6B","ignoreList":[]}
@@ -1,37 +1,40 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.useItemsContext = exports.ItemsContextProvider = void 0;
4
+ exports.useAppContextData = exports.AppContextDataProvider = void 0;
5
5
  var _react = _interopRequireWildcard(require("react"));
6
6
  var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/providers/ItemsContext.tsx";
7
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
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 = ({
9
+ const AppContextDataContext = /*#__PURE__*/(0, _react.createContext)(undefined);
10
+ const AppContextDataProvider = ({
11
11
  children
12
12
  }) => {
13
13
  const [items, setItems] = (0, _react.useState)([]);
14
+ const [refreshCollection, setRefreshCollection] = (0, _react.useState)(undefined);
14
15
  const contextValue = {
15
16
  items,
16
- setItems
17
+ setItems,
18
+ refreshCollection,
19
+ setRefreshCollection
17
20
  };
18
- return /*#__PURE__*/_react.default.createElement(ItemsContext.Provider, {
21
+ return /*#__PURE__*/_react.default.createElement(AppContextDataContext.Provider, {
19
22
  value: contextValue,
20
23
  __self: void 0,
21
24
  __source: {
22
25
  fileName: _jsxFileName,
23
- lineNumber: 25,
26
+ lineNumber: 34,
24
27
  columnNumber: 5
25
28
  }
26
29
  }, children);
27
30
  };
28
- exports.ItemsContextProvider = ItemsContextProvider;
29
- const useItemsContext = () => {
30
- const context = (0, _react.useContext)(ItemsContext);
31
+ exports.AppContextDataProvider = AppContextDataProvider;
32
+ const useAppContextData = () => {
33
+ const context = (0, _react.useContext)(AppContextDataContext);
31
34
  if (context === undefined) {
32
- throw new Error('useItemsContext must be used within an ItemsContextProvider');
35
+ throw new Error('useAppContextData must be used within an AppContextDataProvider');
33
36
  }
34
37
  return context;
35
38
  };
36
- exports.useItemsContext = useItemsContext;
39
+ exports.useAppContextData = useAppContextData;
37
40
  //# sourceMappingURL=ItemsContext.js.map
@@ -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","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,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAA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eakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AppContextDataContext","createContext","undefined","AppContextDataProvider","children","items","setItems","useState","refreshCollection","setRefreshCollection","contextValue","createElement","Provider","value","__self","__source","fileName","lineNumber","columnNumber","exports","useAppContextData","context","useContext","Error"],"sources":["../../../src/providers/ItemsContext.tsx"],"sourcesContent":["import React, { ReactNode, createContext, useContext, useState } from 'react';\n\nexport interface AppContextDataValue {\n items: any[];\n setItems: (items: any[]) => void;\n refreshCollection?: () => void;\n setRefreshCollection: (refreshFn: () => void) => void;\n}\n\nconst AppContextDataContext = createContext<AppContextDataValue | undefined>(\n undefined,\n);\n\nexport interface AppContextDataProviderProps {\n children: ReactNode;\n}\n\nexport const AppContextDataProvider: React.FC<AppContextDataProviderProps> = ({\n children,\n}) => {\n const [items, setItems] = useState<any[]>([]);\n const [refreshCollection, setRefreshCollection] = useState<\n (() => void) | undefined\n >(undefined);\n\n const contextValue: AppContextDataValue = {\n items,\n setItems,\n refreshCollection,\n setRefreshCollection,\n };\n\n return (\n <AppContextDataContext.Provider value={contextValue}>\n {children}\n </AppContextDataContext.Provider>\n );\n};\n\nexport const useAppContextData = (): AppContextDataValue => {\n const context = useContext(AppContextDataContext);\n\n if (context === undefined) {\n throw new Error(\n 'useAppContextData must be used within an AppContextDataProvider',\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,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,qBAAqB,CAACY,QAAQ;IAACC,KAAK,EAAEH,YAAa;IAAAI,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAArC,YAAA;MAAAsC,UAAA;MAAAC,YAAA;IAAA;EAAA,GACjDd,QAC6B,CAAC;AAErC,CAAC;AAACe,OAAA,CAAAhB,sBAAA,GAAAA,sBAAA;AAEK,MAAMiB,iBAAiB,GAAGA,CAAA,KAA2B;EAC1D,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACtB,qBAAqB,CAAC;EAEjD,IAAIqB,OAAO,KAAKnB,SAAS,EAAE;IACzB,MAAM,IAAIqB,KAAK,CACb,iEACF,CAAC;EACH;EAEA,OAAOF,OAAO;AAChB,CAAC;AAACF,OAAA,CAAAC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -3,11 +3,11 @@
3
3
  exports.__esModule = true;
4
4
  exports.useSchema = exports.SchemaProvider = void 0;
5
5
  var _react = _interopRequireWildcard(require("react"));
6
- var _factory = require("../dataSourceAdapters/factory");
7
6
  var _SchemaRegistryContext = require("./SchemaRegistryContext");
8
- var _PatternsWizardOverridesContext = require("./PatternsWizardOverridesContext");
7
+ var _AutoPatternsOverridesContext = require("./AutoPatternsOverridesContext");
9
8
  var _patterns = require("@wix/patterns");
10
9
  var _ErrorContext = require("./ErrorContext");
10
+ var _cmsAdapter = require("../dataSourceAdapters/cms/cmsAdapter");
11
11
  var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/providers/SchemaContext.tsx";
12
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
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; }
@@ -32,14 +32,28 @@ const SchemaProvider = ({
32
32
  } = (0, _ErrorContext.useError)();
33
33
  const [schema, setSchema] = (0, _react.useState)(null);
34
34
  const [isLoading, setIsLoading] = (0, _react.useState)(false);
35
- const overrides = (0, _PatternsWizardOverridesContext.usePatternsWizardOverridesContext)();
35
+ const overrides = (0, _AutoPatternsOverridesContext.useAutoPatternsOverridesContext)();
36
36
  const {
37
37
  httpClient
38
38
  } = (0, _patterns.useWixPatternsContainer)();
39
39
  (0, _react.useEffect)(() => {
40
+ const getSchema = async collectionConfig => {
41
+ var _collectionConfig$cms, _overrides$cmsSchema;
42
+ switch (collectionConfig.entityTypeSource) {
43
+ case 'cms':
44
+ const schemaInput = (_collectionConfig$cms = collectionConfig.cms) != null && (_collectionConfig$cms = _collectionConfig$cms.schema) != null && _collectionConfig$cms.id ? overrides == null || (_overrides$cmsSchema = overrides.cmsSchema) == null ? void 0 : _overrides$cmsSchema[collectionConfig.cms.schema.id] : null;
45
+ const currentSchema = schemaInput || (await (0, _cmsAdapter.fetchCmsSchema)(collectionConfig.collectionId));
46
+ return (0, _cmsAdapter.transformCmsSchema)(currentSchema);
47
+ default:
48
+ throw new Error(`Unsupported entityTypeSource: ${collectionConfig.entityTypeSource}`);
49
+ }
50
+ };
40
51
  const fetchSchemaForCollection = async (targetCollectionId, targetCustomDataSourceId) => {
41
- if (entityTypeSource === 'custom' && targetCustomDataSourceId && overrides != null && overrides.customDataSources) {
42
- const customSchemaProvider = overrides.customDataSources[targetCustomDataSourceId];
52
+ if (entityTypeSource === 'custom') {
53
+ if (!targetCustomDataSourceId || !(overrides != null && overrides.customDataSources)) {
54
+ throw new Error('Custom data source not found');
55
+ }
56
+ const customSchemaProvider = overrides == null ? void 0 : overrides.customDataSources[targetCustomDataSourceId];
43
57
  if (customSchemaProvider) {
44
58
  return customSchemaProvider(targetCollectionId, {
45
59
  httpClient
@@ -47,7 +61,10 @@ const SchemaProvider = ({
47
61
  }
48
62
  throw new Error(`Custom schema provider '${targetCustomDataSourceId}' not found`);
49
63
  }
50
- return (0, _factory.getSchema)(targetCollectionId, entityTypeSource);
64
+ return getSchema({
65
+ collectionId: targetCollectionId,
66
+ entityTypeSource
67
+ });
51
68
  };
52
69
  const fetchReferencedSchemas = async referencedSchema => {
53
70
  const referencedCollectionIds = new Set();
@@ -100,7 +117,7 @@ const SchemaProvider = ({
100
117
  __self: void 0,
101
118
  __source: {
102
119
  fileName: _jsxFileName,
103
- lineNumber: 139,
120
+ lineNumber: 165,
104
121
  columnNumber: 5
105
122
  }
106
123
  }, children);
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_factory","_SchemaRegistryContext","_PatternsWizardOverridesContext","_patterns","_ErrorContext","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","SchemaContext","createContext","SchemaProvider","collection","children","skeleton","_collection$custom","collectionId","entityTypeSource","customDataSourceId","custom","id","undefined","getSchema","getSchemaFromRegistry","addSchema","addSchemaToRegistry","useSchemaRegistry","showError","useError","schema","setSchema","useState","isLoading","setIsLoading","overrides","usePatternsWizardOverridesContext","httpClient","useWixPatternsContainer","useEffect","fetchSchemaForCollection","targetCollectionId","targetCustomDataSourceId","customDataSources","customSchemaProvider","Error","fetchReferencedSchemas","referencedSchema","referencedCollectionIds","Set","values","fields","forEach","field","type","referenceMetadata","referencedCollectionId","add","size","fetchPromises","Array","from","map","refCollectionId","refSchema","error","console","Promise","all","cachedSchema","then","fetchedSchema","catch","finally","createElement","Provider","value","__self","__source","fileName","lineNumber","columnNumber","exports","useSchema","context","useContext"],"sources":["../../../src/providers/SchemaContext.tsx"],"sourcesContent":["import React, {\n createContext,\n useContext,\n useEffect,\n useState,\n ReactNode,\n} from 'react';\n\nimport { SchemaConfig, BaseCollectionConfig } from '../types';\nimport { getSchema } from '../dataSourceAdapters/factory';\nimport { useSchemaRegistry } from './SchemaRegistryContext';\nimport { usePatternsWizardOverridesContext } from './PatternsWizardOverridesContext';\nimport { useWixPatternsContainer } from '@wix/patterns';\nimport { useError } from './ErrorContext';\n\nconst SchemaContext = createContext<SchemaConfig | null>(null);\n\ninterface SchemaProviderProps {\n collection: BaseCollectionConfig;\n children: ReactNode;\n skeleton: JSX.Element;\n}\n\nexport const SchemaProvider = ({\n collection,\n children,\n skeleton,\n}: SchemaProviderProps) => {\n const { collectionId, entityTypeSource } = collection;\n const customDataSourceId =\n collection.entityTypeSource === 'custom' && 'custom' in collection\n ? collection.custom?.id\n : undefined;\n const { getSchema: getSchemaFromRegistry, addSchema: addSchemaToRegistry } =\n useSchemaRegistry();\n const { showError } = useError();\n const [schema, setSchema] = useState<SchemaConfig | null>(null);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const overrides = usePatternsWizardOverridesContext();\n const { httpClient } = useWixPatternsContainer();\n\n useEffect(() => {\n const fetchSchemaForCollection = async (\n targetCollectionId: string,\n targetCustomDataSourceId?: string,\n ): Promise<SchemaConfig> => {\n if (\n entityTypeSource === 'custom' &&\n targetCustomDataSourceId &&\n overrides?.customDataSources\n ) {\n const customSchemaProvider =\n overrides.customDataSources[targetCustomDataSourceId];\n if (customSchemaProvider) {\n return customSchemaProvider(targetCollectionId, { httpClient });\n }\n throw new Error(\n `Custom schema provider '${targetCustomDataSourceId}' not found`,\n );\n }\n\n return getSchema(targetCollectionId, entityTypeSource);\n };\n\n const fetchReferencedSchemas = async (referencedSchema: SchemaConfig) => {\n const referencedCollectionIds = new Set<string>();\n\n Object.values(referencedSchema.fields).forEach((field) => {\n if (field && field.type === 'REFERENCE' && field.referenceMetadata) {\n const { referencedCollectionId } = field.referenceMetadata;\n if (\n referencedCollectionId &&\n !getSchemaFromRegistry(referencedCollectionId)\n ) {\n referencedCollectionIds.add(referencedCollectionId);\n }\n }\n });\n\n if (referencedCollectionIds.size === 0) {\n return;\n }\n\n const fetchPromises = Array.from(referencedCollectionIds).map(\n async (refCollectionId) => {\n try {\n const refSchema = await fetchSchemaForCollection(refCollectionId);\n\n addSchemaToRegistry(refCollectionId, refSchema);\n\n await fetchReferencedSchemas(refSchema);\n } catch (error) {\n console.error(\n `Error fetching referenced schema ${refCollectionId}:`,\n error,\n );\n }\n },\n );\n\n await Promise.all(fetchPromises);\n };\n\n const cachedSchema = getSchemaFromRegistry(collectionId);\n if (cachedSchema) {\n setSchema(cachedSchema);\n return;\n }\n setIsLoading(true);\n fetchSchemaForCollection(collectionId, customDataSourceId)\n .then(async (fetchedSchema) => {\n setSchema(fetchedSchema);\n addSchemaToRegistry(collectionId, fetchedSchema);\n\n await fetchReferencedSchemas(fetchedSchema);\n })\n .catch((error) => {\n console.error('Error fetching schema config:', error);\n showError(error);\n })\n .finally(() => {\n setIsLoading(false);\n });\n }, [\n collectionId,\n entityTypeSource,\n customDataSourceId,\n addSchemaToRegistry,\n getSchemaFromRegistry,\n overrides,\n httpClient,\n showError,\n ]);\n if (!schema || isLoading) {\n return skeleton;\n }\n\n return (\n <SchemaContext.Provider value={schema}>{children}</SchemaContext.Provider>\n );\n};\n\nexport const useSchema = (): SchemaConfig => {\n const context = useContext(SchemaContext);\n if (!context) {\n throw new Error('useSchema must be used within a SchemaProvider');\n }\n return context;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AASA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AACA,IAAAG,+BAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAA0C,IAAAM,YAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAA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AmB,CAACT,YAAY,EAAEsD,aAAa,CAAC;MAEhD,MAAMzB,sBAAsB,CAACyB,aAAa,CAAC;IAC7C,CAAC,CAAC,CACDC,KAAK,CAAEP,KAAK,IAAK;MAChBC,OAAO,CAACD,KAAK,CAAC,+BAA+B,EAAEA,KAAK,CAAC;MACrDrC,SAAS,CAACqC,KAAK,CAAC;IAClB,CAAC,CAAC,CACDQ,OAAO,CAAC,MAAM;MACbvC,YAAY,CAAC,KAAK,CAAC;IACrB,CAAC,CAAC;EACN,CAAC,EAAE,CACDjB,YAAY,EACZC,gBAAgB,EAChBC,kBAAkB,EAClBO,mBAAmB,EACnBF,qBAAqB,EACrBW,SAAS,EACTE,UAAU,EACVT,SAAS,CACV,CAAC;EACF,IAAI,CAACE,MAAM,IAAIG,SAAS,EAAE;IACxB,OAAOlB,QAAQ;EACjB;EAEA,oBACElC,MAAA,CAAAe,OAAA,CAAA8E,aAAA,CAAChE,aAAa,CAACiE,QAAQ;IAACC,KAAK,EAAE9C,MAAO;IAAA+C,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA1F,YAAA;MAAA2F,UAAA;MAAAC,YAAA;IAAA;EAAA,GAAEnE,QAAiC,CAAC;AAE9E,CAAC;AAACoE,OAAA,CAAAtE,cAAA,GAAAA,cAAA;AAEK,MAAMuE,SAAS,GAAGA,CAAA,KAAoB;EAC3C,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAAC3E,aAAa,CAAC;EACzC,IAAI,CAAC0E,OAAO,EAAE;IACZ,MAAM,IAAIvC,KAAK,CAAC,gDAAgD,CAAC;EACnE;EACA,OAAOuC,OAAO;AAChB,CAAC;AAACF,OAAA,CAAAC,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_SchemaRegistryContext","_AutoPatternsOverridesContext","_patterns","_ErrorContext","_cmsAdapter","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","SchemaContext","createContext","SchemaProvider","collection","children","skeleton","_collection$custom","collectionId","entityTypeSource","customDataSourceId","custom","id","undefined","getSchema","getSchemaFromRegistry","addSchema","addSchemaToRegistry","useSchemaRegistry","showError","useError","schema","setSchema","useState","isLoading","setIsLoading","overrides","useAutoPatternsOverridesContext","httpClient","useWixPatternsContainer","useEffect","collectionConfig","_collectionConfig$cms","_overrides$cmsSchema","schemaInput","cms","cmsSchema","currentSchema","fetchCmsSchema","transformCmsSchema","Error","fetchSchemaForCollection","targetCollectionId","targetCustomDataSourceId","customDataSources","customSchemaProvider","fetchReferencedSchemas","referencedSchema","referencedCollectionIds","Set","values","fields","forEach","field","type","referenceMetadata","referencedCollectionId","add","size","fetchPromises","Array","from","map","refCollectionId","refSchema","error","console","Promise","all","cachedSchema","then","fetchedSchema","catch","finally","createElement","Provider","value","__self","__source","fileName","lineNumber","columnNumber","exports","useSchema","context","useContext"],"sources":["../../../src/providers/SchemaContext.tsx"],"sourcesContent":["import React, {\n createContext,\n useContext,\n useEffect,\n useState,\n ReactNode,\n} from 'react';\n\nimport { SchemaConfig, BaseCollectionConfig } from '../types';\nimport { useSchemaRegistry } from './SchemaRegistryContext';\nimport { useAutoPatternsOverridesContext } from './AutoPatternsOverridesContext';\nimport { useWixPatternsContainer } from '@wix/patterns';\nimport { useError } from './ErrorContext';\nimport {\n fetchCmsSchema,\n transformCmsSchema,\n} from '../dataSourceAdapters/cms/cmsAdapter';\n\nconst SchemaContext = createContext<SchemaConfig | null>(null);\n\ninterface SchemaProviderProps {\n collection: BaseCollectionConfig;\n children: ReactNode;\n skeleton: JSX.Element;\n}\n\nexport const SchemaProvider = ({\n collection,\n children,\n skeleton,\n}: SchemaProviderProps) => {\n const { collectionId, entityTypeSource } = collection;\n const customDataSourceId =\n collection.entityTypeSource === 'custom' && 'custom' in collection\n ? collection.custom?.id\n : undefined;\n const { getSchema: getSchemaFromRegistry, addSchema: addSchemaToRegistry } =\n useSchemaRegistry();\n const { showError } = useError();\n const [schema, setSchema] = useState<SchemaConfig | null>(null);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const overrides = useAutoPatternsOverridesContext();\n const { httpClient } = useWixPatternsContainer();\n\n useEffect(() => {\n const getSchema = async (\n collectionConfig: BaseCollectionConfig,\n ): Promise<SchemaConfig> => {\n switch (collectionConfig.entityTypeSource) {\n case 'cms':\n const schemaInput = collectionConfig.cms?.schema?.id\n ? overrides?.cmsSchema?.[collectionConfig.cms.schema.id]\n : null;\n\n const currentSchema =\n schemaInput ||\n (await fetchCmsSchema(collectionConfig.collectionId));\n\n return transformCmsSchema(currentSchema);\n default:\n throw new Error(\n `Unsupported entityTypeSource: ${collectionConfig.entityTypeSource}`,\n );\n }\n };\n\n const fetchSchemaForCollection = async (\n targetCollectionId: string,\n targetCustomDataSourceId?: string,\n ): Promise<SchemaConfig> => {\n if (entityTypeSource === 'custom') {\n if (!targetCustomDataSourceId || !overrides?.customDataSources) {\n throw new Error('Custom data source not found');\n }\n const customSchemaProvider =\n overrides?.customDataSources[targetCustomDataSourceId];\n if (customSchemaProvider) {\n return customSchemaProvider(targetCollectionId, { httpClient });\n }\n throw new Error(\n `Custom schema provider '${targetCustomDataSourceId}' not found`,\n );\n }\n\n return getSchema({\n collectionId: targetCollectionId,\n entityTypeSource,\n });\n };\n\n const fetchReferencedSchemas = async (referencedSchema: SchemaConfig) => {\n const referencedCollectionIds = new Set<string>();\n\n Object.values(referencedSchema.fields).forEach((field) => {\n if (field && field.type === 'REFERENCE' && field.referenceMetadata) {\n const { referencedCollectionId } = field.referenceMetadata;\n if (\n referencedCollectionId &&\n !getSchemaFromRegistry(referencedCollectionId)\n ) {\n referencedCollectionIds.add(referencedCollectionId);\n }\n }\n });\n\n if (referencedCollectionIds.size === 0) {\n return;\n }\n\n const fetchPromises = Array.from(referencedCollectionIds).map(\n async (refCollectionId) => {\n try {\n const refSchema = await fetchSchemaForCollection(refCollectionId);\n\n addSchemaToRegistry(refCollectionId, refSchema);\n\n await fetchReferencedSchemas(refSchema);\n } catch (error) {\n console.error(\n `Error fetching referenced schema ${refCollectionId}:`,\n error,\n );\n }\n },\n );\n\n await Promise.all(fetchPromises);\n };\n\n const cachedSchema = getSchemaFromRegistry(collectionId);\n if (cachedSchema) {\n setSchema(cachedSchema);\n return;\n }\n setIsLoading(true);\n fetchSchemaForCollection(collectionId, customDataSourceId)\n .then(async (fetchedSchema) => {\n setSchema(fetchedSchema);\n addSchemaToRegistry(collectionId, fetchedSchema);\n\n await fetchReferencedSchemas(fetchedSchema);\n })\n .catch((error) => {\n console.error('Error fetching schema config:', error);\n showError(error);\n })\n .finally(() => {\n setIsLoading(false);\n });\n }, [\n collectionId,\n entityTypeSource,\n customDataSourceId,\n addSchemaToRegistry,\n getSchemaFromRegistry,\n overrides,\n httpClient,\n showError,\n ]);\n if (!schema || isLoading) {\n return skeleton;\n }\n\n return (\n <SchemaContext.Provider value={schema}>{children}</SchemaContext.Provider>\n );\n};\n\nexport const useSchema = (): SchemaConfig => {\n const context = useContext(SchemaContext);\n if (!context) {\n throw new Error('useSchema must be used within a SchemaProvider');\n }\n return context;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AASA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,6BAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAG8C,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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AC,QAAA,EAAAnG,YAAA;MAAAoG,UAAA;MAAAC,YAAA;IAAA;EAAA,GAAE5E,QAAiC,CAAC;AAE9E,CAAC;AAAC6E,OAAA,CAAA/E,cAAA,GAAAA,cAAA;AAEK,MAAMgF,SAAS,GAAGA,CAAA,KAAoB;EAC3C,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACpF,aAAa,CAAC;EACzC,IAAI,CAACmF,OAAO,EAAE;IACZ,MAAM,IAAI5C,KAAK,CAAC,gDAAgD,CAAC;EACnE;EACA,OAAO4C,OAAO;AAChB,CAAC;AAACF,OAAA,CAAAC,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -12,12 +12,12 @@ Object.keys(_SchemaContext).forEach(function (key) {
12
12
  if (key in exports && exports[key] === _SchemaContext[key]) return;
13
13
  exports[key] = _SchemaContext[key];
14
14
  });
15
- var _PatternsWizardOverridesContext = require("./PatternsWizardOverridesContext");
16
- Object.keys(_PatternsWizardOverridesContext).forEach(function (key) {
15
+ var _AutoPatternsOverridesContext = require("./AutoPatternsOverridesContext");
16
+ Object.keys(_AutoPatternsOverridesContext).forEach(function (key) {
17
17
  if (key === "default" || key === "__esModule") return;
18
18
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
19
- if (key in exports && exports[key] === _PatternsWizardOverridesContext[key]) return;
20
- exports[key] = _PatternsWizardOverridesContext[key];
19
+ if (key in exports && exports[key] === _AutoPatternsOverridesContext[key]) return;
20
+ exports[key] = _AutoPatternsOverridesContext[key];
21
21
  });
22
22
  var _ModalContext = require("./ModalContext");
23
23
  Object.keys(_ModalContext).forEach(function (key) {
@@ -47,6 +47,13 @@ Object.keys(_ErrorContext).forEach(function (key) {
47
47
  if (key in exports && exports[key] === _ErrorContext[key]) return;
48
48
  exports[key] = _ErrorContext[key];
49
49
  });
50
+ var _AppContextData = require("./AppContextData");
51
+ Object.keys(_AppContextData).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
54
+ if (key in exports && exports[key] === _AppContextData[key]) return;
55
+ exports[key] = _AppContextData[key];
56
+ });
50
57
  var _AppContext = require("./AppContext");
51
58
  exports.useAppContext = _AppContext.useAppContext;
52
59
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAM,+BAAA,CAAAN,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAM,+BAAA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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
+ {"version":3,"names":["_SchemaContext","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","_AutoPatternsOverridesContext","_ModalContext","_SchemaRegistryContext","_AppConfigContext","_ErrorContext","_AppContextData","_AppContext","useAppContext"],"sources":["../../../src/providers/index.ts"],"sourcesContent":["export * from './SchemaContext';\nexport * from './AutoPatternsOverridesContext';\nexport * from './ModalContext';\nexport * from './SchemaRegistryContext';\nexport * from './AppConfigContext';\nexport * from './ErrorContext';\nexport * from './AppContextData';\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,6BAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,6BAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,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A,CAAAT,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAS,iBAAA,CAAAT,GAAA;AAAA;AACA,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,eAAA,GAAAf,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAa,eAAA,EAAAZ,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,MAAAW,eAAA,CAAAX,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAW,eAAA,CAAAX,GAAA;AAAA;AACA,IAAAY,WAAA,GAAAhB,OAAA;AAA6CS,OAAA,CAAAQ,aAAA,GAAAD,WAAA,CAAAC,aAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/types/BaseSDK.ts"],"sourcesContent":["import { ModalId } from '../providers/ModalContext';\nimport { PatternsWizardOverridesContextProps } from '../providers';\nimport { AppConfig } from './types';\nimport { NavigateToEntityPageFunc } from '../hooks';\n\nexport interface BaseSDK {\n appConfig: AppConfig;\n openModal: (id: ModalId, props?: Record<string, any>) => void;\n closeModal: () => void;\n overrides?: PatternsWizardOverridesContextProps;\n navigateToEntityPage?: NavigateToEntityPageFunc;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../src/types/BaseSDK.ts"],"sourcesContent":["import { ModalId } from '../providers/ModalContext';\nimport { AutoPatternsOverridesContextProps } from '../providers';\nimport { AppConfig } from './types';\nimport { NavigateToEntityPageFunc } from '../hooks';\n\nexport interface BaseSDK {\n appConfig: AppConfig;\n openModal: (id: ModalId, props?: Record<string, any>) => void;\n closeModal: () => void;\n overrides?: AutoPatternsOverridesContextProps;\n navigateToEntityPage?: NavigateToEntityPageFunc;\n}\n"],"mappings":"","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 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":[]}
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 /**\n * The title text.\n */\n text: string;\n /**\n * Determines whether to hide the number of total entities on the title of the page.\n */\n hideTotal?: boolean;\n}\n\nexport interface CollectionPageSubtitle {\n /**\n * The subtitle text.\n */\n text: string;\n /**\n * \"Learn more\" link.\n */\n learnMore?: {\n /**\n * Where the link should navigate to.\n */\n url: string;\n /**\n * The label of the link button. defaults to \"Learn More\".\n */\n label?: string;\n };\n}\n\nexport interface CollectionPageConfig {\n /**\n * Route configuration.\n */\n route: {\n /**\n * Route path (relative path).\n */\n path: string;\n };\n /**\n * Page title configuration.\n */\n title: CollectionPageTitle;\n /**\n * Page subtitle configuration.\n */\n subtitle?: CollectionPageSubtitle;\n /**\n * Page-level actions to render in the page header.\n */\n actions?: {\n /**\n * Primary actions.\n */\n primaryActions?: CollectionPagePrimaryActions;\n /**\n * Secondary actions.\n */\n secondaryActions?: CollectionPageSecondaryActions;\n };\n /**\n * Components rendered within the page layout.\n */\n components: ComponentConfig[];\n}\n\nexport interface CollectionComponentConfig\n extends BaseCollectionComponentConfig {\n /**\n * Type discriminator.\n */\n type: 'collection';\n /**\n * Layout items to render.\n */\n layout: LayoutItemConfig[];\n}\n\nexport interface CustomComponentConfig {\n /**\n * Type discriminator.\n */\n type: 'custom';\n /**\n * Identifier that maps to a custom React component provided via overrides.\n */\n id: string;\n}\n\nexport type ComponentConfig = CollectionComponentConfig | CustomComponentConfig;\n\nexport interface LayoutItemConfig {\n /**\n * Rendering mode for the collection component.\n */\n type: 'Table' | 'Grid';\n /**\n * Table-specific configuration.\n */\n table?: TableSpecificConfig;\n /**\n * Grid-specific configuration.\n */\n grid?: GridSpecificConfig;\n}\n\nexport type ColumnsConfig = Column[];\n\nexport interface TableSpecificConfig {\n /**\n * Table columns configuration.\n */\n columns: ColumnsConfig;\n /**\n * Enables custom columns (hide/reorder columns) functionality.\n */\n customColumns?: {\n enabled: boolean;\n };\n /**\n * Number of leading columns that remain sticky on horizontal scroll.\n */\n stickyColumns?: number;\n /**\n * Row click action.\n */\n onRowClick?: CollectionPageOnRowClickActionConfig;\n /**\n * Show column headers (title bar).\n * @default true\n */\n showTitleBar?: boolean;\n /**\n * Sectioning support for table.\n *\n * The `id` must match the identifier of a custom sectioning override component.\n * This allows you to provide a custom React component for table section rendering.\n */\n sections?: {\n id: string;\n };\n}\n\nexport interface GridSpecificConfig {\n /**\n * Grid item.\n */\n item: GridItem;\n}\n\nexport interface TableConfig\n extends BaseCollectionComponentConfig,\n TableSpecificConfig {}\n\nexport interface GridConfig\n extends BaseCollectionComponentConfig,\n GridSpecificConfig {}\n\nexport interface TableGridSwitchConfig\n extends BaseCollectionComponentConfig,\n TableSpecificConfig,\n GridSpecificConfig {}\n\nexport type CollectionConfig = BaseCollectionConfig & {\n /**\n * Default fetch limit (items per page).\n */\n limit?: number;\n /**\n * Reflect search/filters/sort in the URL.\n * @default false\n */\n reflectQueryInUrl?: boolean;\n /**\n * Scope of \"Select All\":\n * - 'all': select the entire collection (server-side).\n * - 'page': select only currently visible items.\n * @default \"all\"\n */\n selectAllScope?: 'page' | 'all';\n /**\n * Selection behavior when data changes:\n * - 'preserve': keep current selections if still valid.\n * - 'clear': clear selection on data refresh.\n * @default \"clear\"\n */\n selectionUpdateMode?: 'preserve' | 'clear';\n /**\n * Enables optimistic UI actions;\n * Identifier that maps to a custom optimistic actions provided via overrides.\n */\n optimisticActions?: {\n id: string;\n };\n /**\n * Pagination strategy:\n * - 'cursor': `find()` must return { items, cursor, total? }\n * - 'offset': `find()` must return { items, hasNext, total? }\n * @default \"offset\"\n */\n paginationMode?: 'cursor' | 'offset';\n};\n\nexport interface BaseCollectionComponentConfig {\n /**\n * Collection data configuration and behavior.\n */\n collection: CollectionConfig;\n /**\n * Entity page to navigate to (by page id) when interacting with rows (e.g. onRowClick/update).\n */\n entityPageId?: string;\n /**\n * Search configuration.\n */\n search?: {\n /**\n * Whether to show the search input.\n * @default true\n */\n shown?: boolean;\n };\n /**\n * Toolbar title configuration.\n */\n toolbarTitle?: ToolbarTitle;\n /**\n * Action cell configuration per row.\n */\n actionCell?: ActionCellConfig;\n /**\n * Empty state configuration.\n */\n emptyState?: EmptyState;\n /**\n * Filters configuration.\n */\n filters?: FiltersConfig;\n /**\n * Bulk action toolbar configuration.\n */\n bulkActionToolbar?: BulkActionsConfig;\n}\n\nexport interface ToolbarTitle {\n /**\n * Title text.\n */\n title: string;\n /**\n * Subtitle configuration.\n */\n subtitle?: {\n /**\n * Subtitle text.\n */\n text: string;\n /**\n * Info tooltip content with an optional link.\n */\n info?: {\n content: {\n text: string;\n link?: {\n url: string;\n label: string;\n };\n };\n };\n /**\n * \"Learn more\" link.\n */\n learnMore?: {\n /**\n * Where the link should navigate to.\n */\n url: string;\n /**\n * The label of the link button.\n */\n label?: string;\n };\n };\n /**\n * Show total items on the toolbar.\n * @default false\n */\n showTotal?: boolean;\n /**\n * Limit displayed item count in the toolbar.\n */\n itemsLimit?: number;\n}\n\nexport interface Column {\n /**\n * FieldId to bind the column to.\n */\n id: string;\n /**\n * Column header text.\n */\n name: string;\n /**\n * CSS width value (e.g. '120px', '20%').\n */\n width: string;\n /**\n * Whether the column supports sorting.\n */\n sortable?: boolean;\n /**\n * Initial sort order when the page loads.\n */\n defaultSortOrder?: 'asc' | 'desc';\n /**\n * Current sort mode selected in UI.\n */\n sortMode?: 'asc' | 'desc';\n /**\n * Hide column by default in the custom columns panel.\n * When true, the column will not be shown initially and must be enabled by the user via the customize columns UI.\n */\n defaultHidden?: boolean;\n /**\n * Exclude from the \"customize columns\" selection UI.\n */\n hiddenFromCustomColumnsSelection?: boolean;\n /**\n * Controls whether the \"hide/show\" checkbox for this column is enabled in the custom columns panel.\n * If set to false, the checkbox will be disabled and the user cannot toggle visibility for this column.\n */\n hideable?: boolean;\n /**\n * Prevent column reordering in the customization UI.\n */\n reorderDisabled?: boolean;\n}\n\nexport interface GridItem {\n /**\n * FieldId to use as the card title.\n */\n titleFieldId: string;\n /**\n * FieldId to use as the card subtitle.\n */\n subtitleFieldId?: string;\n /**\n * FieldId to use as the card image.\n */\n imageFieldId?: string;\n /**\n * Controls which content is shown in the card (preset):\n * - 'full': shows title and subtitle.\n * - 'title': shows only the title.\n * - 'empty': hides both title and subtitle.\n */\n cardContentMode?: 'full' | 'title' | 'empty'; // Footer is not supported in auto-patterns\n /**\n * Position of the image inside the card layout.\n */\n imagePlacement?: 'top' | 'side';\n}\n\nexport interface EmptyState {\n /**\n * Empty state title.\n */\n title?: string;\n /**\n * Empty state subtitle.\n */\n subtitle?: string;\n /**\n * Image to display in the empty state.\n */\n image?: {\n id: string;\n };\n /**\n * \"Add new\" call-to-action button.\n */\n addNewCta?: {\n id?: string;\n text?: string;\n };\n /**\n * Custom CTA slot (advanced).\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';\n\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[];\n\nexport interface FiltersConfig {\n /**\n * Filter items to display.\n */\n items: FilterItems;\n /**\n * Maximum number of filters shown inline before moving to the panel.\n * @default 0 (all in panel).\n */\n maxInlineFilters?: CollectionToolbarFiltersProps['inline'];\n /**\n * Title for the filter panel drawer.\n */\n panelTitle?: string;\n}\n\nexport interface BaseOptionsFilterConfig {\n /**\n * Selection behavior: single choice or multiple choices.\n */\n selectionMode: FilterSelectionMode;\n}\n\nexport interface DateFilterConfig {\n /**\n * Controls behavior: presets only, custom only, or both.\n */\n mode?: DateRangeFilterMode;\n /**\n * Which preset ranges to display (only if mode supports presets).\n */\n presets?: DateRangeOptions;\n /**\n * Whether to include time selection.\n * @default true\n */\n includeTime?: boolean;\n}\n\nexport interface NumberFilterConfig {\n /**\n * Minimum allowed value.\n */\n min?: number;\n /**\n * Maximum allowed value.\n */\n max?: number;\n /**\n * Whether decimal values are allowed.\n */\n allowedDecimals?: boolean;\n}\n\nexport interface BooleanFilterConfig {\n /**\n * Label for the \"true\" option.\n */\n trueLabel?: string;\n /**\n * Label for the \"false\" option.\n */\n falseLabel?: string;\n}\n\nexport interface EnumFilterConfig extends BaseOptionsFilterConfig {\n /**\n * List of available options.\n */\n options: FilterOption[];\n /**\n * Rendering control for option appearance.\n */\n optionType?: FilterOptionType;\n}\n\nexport interface DynamicOptionsFilterConfig extends BaseOptionsFilterConfig {}\n\nexport interface Filter {\n /**\n * Filter unique identifier.\n */\n id: string;\n /**\n * Target field id this filter controls.\n */\n fieldId: string;\n /**\n * Optional filter display name (defaults to field name).\n */\n displayName?: string;\n /**\n * Optional grouping label. Filters with the same `sectionTitle` are grouped together.\n */\n sectionTitle?: string;\n /**\n * Whether the filter item is expanded by default in the panel.\n */\n openByDefault?: boolean;\n /**\n * Label shown in the table/grid tag when the filter is active.\n */\n tagLabel?: string;\n /**\n * Configuration for number inputs (NUMBER fields).\n */\n numberConfig?: NumberFilterConfig;\n /**\n * Configuration for date inputs (DATETIME fields).\n */\n dateConfig?: DateFilterConfig;\n /**\n * Configuration for boolean input labels (BOOLEAN fields).\n */\n booleanConfig?: BooleanFilterConfig;\n /**\n * Configuration for enum inputs (ARRAY/ARRAY_STRING fields).\n */\n enumConfig?: EnumFilterConfig;\n /**\n * Dynamic options configuration (advanced).\n */\n dynamicOptionsConfig?: DynamicOptionsFilterConfig;\n}\n"],"mappings":";;;;IAqaYA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/types/EntityPageConfig.ts"],"sourcesContent":["import { FieldValues, UseFormReturn } from '@wix/patterns/form';\nimport {\n EntityPageMoreActions,\n EntityPagePrimaryActions,\n EntityPageSecondaryActions,\n} from './actions/entityPageActions';\nimport { BaseCollectionConfig } from './types';\n\nexport type EntityPageBaseConfig = {\n route: {\n path: string;\n params: {\n id: string;\n };\n };\n title?: {\n text: string;\n badges?: {\n id: string;\n };\n };\n subtitle?: {\n text?: string;\n id?: string;\n learnMore?: {\n url: string;\n label?: string;\n };\n };\n parentPageId?: string;\n layout?: {\n main: CardLayout[];\n sidebar?: CardLayout[];\n };\n} & BaseCollectionConfig;\n\nexport type EditEntityPageConfig = EntityPageBaseConfig & {\n mode?: 'edit';\n actions?: {\n primaryActions?: never;\n secondaryActions?: never;\n moreActions?: EntityPageMoreActions;\n };\n};\n\nexport type ViewEntityPageConfig = EntityPageBaseConfig & {\n mode: 'view';\n actions?: {\n primaryActions?: EntityPagePrimaryActions;\n secondaryActions?: EntityPageSecondaryActions;\n moreActions?: EntityPageMoreActions;\n };\n};\n\nexport type EntityPageConfig = EditEntityPageConfig | ViewEntityPageConfig;\n\nexport interface CardLayout {\n type: 'card';\n card: {\n title: {\n text: string;\n };\n subtitle?: {\n text: string;\n };\n children: LayoutContent[];\n };\n}\n\nexport type LayoutContent =\n | FieldContent\n | ContainerContent\n | ComponentItemContent;\n\ninterface FieldContent {\n type: 'field';\n field: {\n span?: number;\n fieldId: string;\n };\n}\n\ninterface ContainerContent {\n type: 'container';\n container: {\n span?: number;\n children: LayoutContent[];\n };\n}\n\ninterface ComponentItemContent {\n type: 'component';\n component: {\n span?: number;\n componentId: string;\n };\n}\n\nexport interface CustomComponentProps {\n entity?: Record<string, any>;\n form?: UseFormReturn<FieldValues, any, undefined>;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../src/types/EntityPageConfig.ts"],"sourcesContent":["import { FieldValues, UseFormReturn } from '@wix/patterns/form';\nimport {\n EntityPageMoreActions,\n EntityPagePrimaryActions,\n EntityPageSecondaryActions,\n} from './actions/entityPageActions';\nimport { BaseCollectionConfig } from './types';\n\nexport type EntityPageBaseConfig = {\n /**\n * Route configuration for the entity page.\n */\n route: {\n /**\n * Route path (e.g. '/products/:id').\n */\n path: string;\n /**\n * Mapping for dynamic params used in the path.\n * `id` must match the placeholder used in `path`.\n */\n params: {\n id: string;\n };\n };\n /**\n * Title configuration.\n */\n title?: {\n /**\n * Title text.\n */\n text: string;\n /**\n * Badges slot identifier for dynamic overrides.\n */\n badges?: {\n id: string;\n };\n };\n /**\n * Subtitle configuration.\n */\n subtitle?: {\n /**\n * Subtitle text.\n */\n text?: string;\n /**\n * Subtitle slot identifier for dynamic overrides.\n */\n id?: string;\n /**\n * \"Learn more\" link near the subtitle.\n */\n learnMore?: {\n /**\n * Where the link should navigate to.\n */\n url: string;\n /**\n * The label of the link button.\n */\n label?: string;\n };\n };\n /**\n * Parent collection page id for navigation breadcrumbs/back behavior.\n */\n parentPageId?: string;\n /**\n * Page layout: main content cards and optional sidebar cards.\n */\n layout?: {\n /**\n * Main column card layout.\n */\n main: CardLayout[];\n /**\n * Sidebar column card layout.\n */\n sidebar?: CardLayout[];\n };\n} & BaseCollectionConfig;\n\nexport type EditEntityPageConfig = EntityPageBaseConfig & {\n /**\n * Page mode.\n * @default 'edit'\n */\n mode?: 'edit';\n /**\n * Page actions.\n *\n * Edit mode supports only `moreActions`.\n */\n actions?: {\n primaryActions?: never;\n secondaryActions?: never;\n /**\n * Contextual actions (e.g., custom actions).\n */\n moreActions?: EntityPageMoreActions;\n };\n};\n\nexport type ViewEntityPageConfig = EntityPageBaseConfig & {\n /**\n * Page mode.\n */\n mode: 'view';\n /**\n * Page actions.\n *\n * View mode supports `primaryActions`, `secondaryActions`, and `moreActions`.\n */\n actions?: {\n /**\n * Primary actions (e.g., Create).\n */\n primaryActions?: EntityPagePrimaryActions;\n /**\n * Secondary actions (e.g., menu with secondary items).\n */\n secondaryActions?: EntityPageSecondaryActions;\n /**\n * Additional context menu actions.\n */\n moreActions?: EntityPageMoreActions;\n };\n};\n\nexport type EntityPageConfig = EditEntityPageConfig | ViewEntityPageConfig;\n\nexport interface CardLayout {\n type: 'card';\n card: {\n /**\n * Card header title.\n */\n title: {\n text: string;\n };\n /**\n * Optional card subtitle.\n */\n subtitle?: {\n text: string;\n };\n /**\n * Card content items (fields, containers, or custom components).\n */\n children: LayoutContent[];\n };\n}\n\nexport type LayoutContent =\n | FieldContent\n | ContainerContent\n | ComponentItemContent;\n\ninterface FieldContent {\n type: 'field';\n field: {\n /**\n * Number of columns (out of 12) that this field should span in the layout grid.\n */\n span?: number;\n /**\n * FieldId from the schema to render in this position.\n */\n fieldId: string;\n };\n}\n\ninterface ContainerContent {\n type: 'container';\n container: {\n /**\n * Number of columns (out of 12) that this container should span in the layout grid.\n */\n span?: number;\n /**\n * Nested layout items inside the container.\n */\n children: LayoutContent[];\n };\n}\n\ninterface ComponentItemContent {\n type: 'component';\n component: {\n /**\n * Number of columns (out of 12) that this component should span in the layout grid.\n */\n span?: number;\n /**\n * Identifier mapping to a custom component provided via overrides.\n */\n componentId: string;\n };\n}\n\nexport interface CustomComponentProps {\n /**\n * Current entity data.\n */\n entity?: Record<string, any>;\n /**\n * Form APIs when in edit mode.\n */\n form?: UseFormReturn<FieldValues, any, undefined>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../../src/types/actions/actionCell.ts"],"sourcesContent":["import {\n CustomActionModalProps,\n CustomActionParams,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n CustomActionConfig,\n DeleteActionConfig,\n UpdateActionConfig,\n DividerActionConfig,\n} from './base';\nimport { IconElement } from '@wix/design-system';\n\nexport type ActionCellItemConfig =\n | UpdateActionConfig\n | CustomActionConfig\n | DeleteActionConfig;\n\nexport interface ActionCellPrimaryAction {\n item: ActionCellItemConfig;\n alwaysVisible?: boolean;\n}\n\nexport interface ActionCellSecondaryActions {\n items: (ActionCellItemConfig | DividerActionConfig)[];\n inlineCount?: number;\n inlineAlwaysVisible?: boolean;\n}\n\nexport interface ActionCellConfig {\n primaryAction?: ActionCellPrimaryAction;\n secondaryActions?: ActionCellSecondaryActions;\n}\n\nexport interface ResolvedActionCellPrimaryAction\n extends Omit<ResolvedAction, 'icon'> {\n prefixIcon?: IconElement;\n suffixIcon?: IconElement;\n}\n\nexport interface ActionCellActionParams {\n item: any;\n}\n\nexport type CustomActionCellActionParams =\n CustomActionParams<ActionCellActionParams>;\n\nexport type CustomActionCellPrimaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedActionCellPrimaryAction;\n\nexport type CustomActionCellSecondaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedAction;\n\nexport interface CustomActionCellActionModalProps\n extends CustomActionModalProps {\n actionParams: ActionCellActionParams;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../../src/types/actions/actionCell.ts"],"sourcesContent":["import {\n CustomActionModalProps,\n CustomActionParams,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n CustomActionConfig,\n DeleteActionConfig,\n UpdateActionConfig,\n DividerActionConfig,\n} from './base';\nimport { IconElement } from '@wix/design-system';\n\nexport type ActionCellItemConfig =\n | UpdateActionConfig\n | CustomActionConfig\n | DeleteActionConfig;\n\nexport interface ActionCellPrimaryAction {\n /**\n * The action item configuration.\n */\n item: ActionCellItemConfig;\n /**\n * Whether the primary action should always be visible.\n * If true, the action is always visible; if false, it is visible only when hovering the row.\n * @default false\n */\n alwaysVisible?: boolean;\n}\n\nexport interface ActionCellSecondaryActions {\n /**\n * Array of action items and dividers for the secondary actions menu.\n */\n items: (ActionCellItemConfig | DividerActionConfig)[];\n /**\n * Number of secondary actions to show inline before moving to overflow menu.\n * Remaining actions appear in a \"more actions\" dropdown.\n * @default 0 (all actions in dropdown)\n */\n inlineCount?: number;\n /**\n * Whether inline secondary actions should always be visible.\n * If true, the inline actions are always visible; if false, they are visible only when hovering the row.\n * @default false\n */\n inlineAlwaysVisible?: boolean;\n}\n\nexport interface ActionCellConfig {\n /**\n * Primary action configuration.\n * Shown as the main action button in each row.\n */\n primaryAction?: ActionCellPrimaryAction;\n /**\n * Secondary actions configuration.\n * Shown as additional actions in dropdown or inline.\n */\n secondaryActions?: ActionCellSecondaryActions;\n}\n\nexport interface ResolvedActionCellPrimaryAction\n extends Omit<ResolvedAction, 'icon'> {\n /**\n * Icon displayed before the action label.\n */\n prefixIcon?: IconElement;\n /**\n * Icon displayed after the action label.\n */\n suffixIcon?: IconElement;\n}\n\nexport interface ActionCellActionParams {\n /**\n * The data item (row) that the action is being performed on.\n */\n item: any;\n}\n\nexport type CustomActionCellActionParams =\n CustomActionParams<ActionCellActionParams>;\n\nexport type CustomActionCellPrimaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedActionCellPrimaryAction;\n\nexport type CustomActionCellSecondaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedAction;\n\nexport interface CustomActionCellActionModalProps\n extends CustomActionModalProps {\n /**\n * Action parameters including the row item context.\n */\n actionParams: ActionCellActionParams;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../../src/types/actions/base.ts"],"sourcesContent":["export type DividerActionConfig = { type: 'divider' };\n\nexport type BaseActionItemConfig = {\n id: string;\n label?: string;\n skin?: string;\n};\n\nexport interface Feedback {\n successToast?: { text: string };\n errorToast?: { text: string };\n}\n\nexport interface BaseActionModal {\n title?: { text: string };\n actions?: {\n submit?: { text: string };\n cancel?: { text: string };\n };\n feedback?: Feedback;\n}\n\nexport interface ActionModalField {\n id: string;\n label?: string;\n}\n\nexport interface DeleteActionModal extends BaseActionModal {\n description?: { text: string };\n}\n\nexport interface BulkDeleteActionModal extends DeleteActionModal {}\n\nexport type BulkDeleteAction =\n | {\n mode: 'modal';\n modal: BulkDeleteActionModal;\n }\n | {\n mode: 'custom';\n modal?: never;\n };\n\nexport type DeleteAction = {\n mode: 'modal';\n modal: DeleteActionModal;\n};\n\nexport interface BaseActionPage {\n id: string;\n}\n\nexport interface ActionModalWithFields extends BaseActionModal {\n fields: ActionModalField[];\n}\n\nexport interface UpdateActionModal extends ActionModalWithFields {}\n\nexport interface CreateActionModal extends ActionModalWithFields {}\n\nexport interface UpdateActionPage extends BaseActionPage {}\n\nexport interface CreateActionPage extends BaseActionPage {}\n\nexport type UpdateAction = {\n mode: 'page';\n page: UpdateActionPage;\n};\n\nexport type CreateAction = {\n mode: 'page';\n page: CreateActionPage;\n};\n\nexport type CreateActionConfig = BaseActionItemConfig & {\n type: 'create';\n create: CreateAction;\n};\n\nexport type UpdateActionConfig = BaseActionItemConfig & {\n type: 'update';\n update: UpdateAction;\n};\n\nexport type DeleteActionConfig = BaseActionItemConfig & {\n type: 'delete';\n delete: DeleteAction;\n};\n\nexport type BulkDeleteActionConfig = BaseActionItemConfig & {\n type: 'bulkDelete';\n bulkDelete: BulkDeleteAction;\n};\n\nexport type CustomActionConfig = BaseActionItemConfig & {\n type: 'custom';\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../../src/types/actions/base.ts"],"sourcesContent":["export type DividerActionConfig = { type: 'divider' };\n\nexport type BaseActionItemConfig = {\n /**\n * Unique identifier for the action.\n */\n id: string;\n /**\n * Display text for the action button/menu item.\n */\n label?: string;\n /**\n * Visual appearance of the action button (e.g., 'standard', 'destructive', 'primary').\n */\n skin?: string;\n /**\n * BI tracking name.\n */\n biName?: string;\n};\n\nexport interface Feedback {\n /**\n * Success message displayed in a toast notification.\n */\n successToast?: { text: string };\n /**\n * Error message displayed in a toast notification.\n */\n errorToast?: { text: string };\n}\n\nexport interface BaseActionModal {\n /**\n * Modal header title.\n */\n title?: { text: string };\n /**\n * Modal action buttons configuration.\n */\n actions?: {\n /**\n * Submit/confirm button text.\n */\n submit?: { text: string };\n /**\n * Cancel button text.\n */\n cancel?: { text: string };\n };\n /**\n * Toast notifications for action completion.\n */\n feedback?: Feedback;\n}\n\nexport interface ActionModalField {\n /**\n * Field identifier.\n */\n id: string;\n /**\n * Field display label.\n */\n label?: string;\n}\n\nexport interface DeleteActionModal extends BaseActionModal {\n /**\n * Optional description text explaining the delete operation.\n */\n description?: { text: string };\n}\n\nexport interface BulkDeleteActionModal extends DeleteActionModal {}\n\nexport type BulkDeleteAction =\n | {\n mode: 'modal';\n modal: BulkDeleteActionModal;\n }\n | {\n mode: 'custom';\n modal?: never;\n };\n\nexport type DeleteAction = {\n /**\n * Show a confirmation modal.\n */\n mode: 'modal';\n modal: DeleteActionModal;\n};\n\nexport interface BaseActionPage {\n /**\n * Unique identifier.\n */\n id: string;\n}\n\nexport interface ActionModalWithFields extends BaseActionModal {\n /**\n * Form fields to display in the modal.\n */\n fields: ActionModalField[];\n}\n\nexport interface UpdateActionModal extends ActionModalWithFields {}\n\nexport interface CreateActionModal extends ActionModalWithFields {}\n\nexport interface UpdateActionPage extends BaseActionPage {}\n\nexport interface CreateActionPage extends BaseActionPage {}\n\nexport type UpdateAction = {\n /**\n * Navigate to a page for the update operation.\n */\n mode: 'page';\n page: UpdateActionPage;\n};\n\nexport type CreateAction = {\n /**\n * Navigate to a page for the create operation.\n */\n mode: 'page';\n page: CreateActionPage;\n};\n\nexport type CreateActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'create';\n /**\n * Create action implementation configuration.\n */\n create: CreateAction;\n};\n\nexport type UpdateActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'update';\n /**\n * Update action implementation configuration.\n */\n update: UpdateAction;\n};\n\nexport type DeleteActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'delete';\n /**\n * Delete action implementation configuration.\n */\n delete: DeleteAction;\n};\n\nexport type BulkDeleteActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'bulkDelete';\n /**\n * Bulk delete action implementation configuration.\n */\n bulkDelete: BulkDeleteAction;\n};\n\nexport type CustomActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'custom';\n};\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../../src/types/actions/bulkActions.ts"],"sourcesContent":["import {\n BaseActionParams,\n CustomActionModalProps,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n BulkDeleteActionConfig,\n CustomActionConfig,\n DividerActionConfig,\n} from './base';\n\nexport type BulkActionItemConfig = BulkDeleteActionConfig | CustomActionConfig;\n\ntype BulkActionItem = {\n type: 'action';\n action: {\n item: BulkActionItemConfig;\n };\n menu?: never;\n};\n\ntype BulkActionMenu = {\n type: 'menu';\n menu: {\n label: string;\n items: (BulkActionItemConfig | DividerActionConfig)[];\n };\n action?: never;\n};\n\nexport interface BulkActionsConfig {\n primaryActions?: (BulkActionItem | BulkActionMenu)[];\n secondaryActions?: (BulkActionItemConfig | DividerActionConfig)[];\n}\n\nexport interface BulkActionsActionParams {\n selectedValues: any[];\n total: number;\n}\n\nexport interface CustomBulkActionsActionParams extends BaseActionParams {\n actionParams: BulkActionsActionParams;\n}\nexport type CustomBulkActionsActionResolver = (\n params: CustomBulkActionsActionParams,\n) => ResolvedAction;\n\nexport interface CustomBulkActionsActionModalProps\n extends CustomActionModalProps {\n actionParams: BulkActionsActionParams;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../../src/types/actions/bulkActions.ts"],"sourcesContent":["import {\n BaseActionParams,\n CustomActionModalProps,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n BulkDeleteActionConfig,\n CustomActionConfig,\n DividerActionConfig,\n} from './base';\n\nexport type BulkActionItemConfig = BulkDeleteActionConfig | CustomActionConfig;\n\ntype BulkActionItem = {\n /**\n * Layout type discriminator.\n */\n type: 'action';\n /**\n * Single bulk action configuration.\n */\n action: {\n item: BulkActionItemConfig;\n };\n menu?: never;\n};\n\ntype BulkActionMenu = {\n /**\n * Layout type discriminator.\n */\n type: 'menu';\n /**\n * Menu configuration with multiple bulk actions.\n */\n menu: {\n /**\n * Menu group label displayed in the bulk actions toolbar.\n */\n label: string;\n /**\n * List of bulk actions and dividers in the menu.\n */\n items: (BulkActionItemConfig | DividerActionConfig)[];\n };\n action?: never;\n};\n\nexport interface BulkActionsConfig {\n /**\n * Primary bulk actions configuration.\n * Array of actions or menus shown prominently in the bulk actions toolbar.\n * Can include both single actions and grouped menu actions.\n */\n primaryActions?: (BulkActionItem | BulkActionMenu)[];\n /**\n * Secondary bulk actions configuration.\n * Array of individual actions and dividers shown in secondary position.\n * Typically displayed as individual buttons or in an overflow menu.\n */\n secondaryActions?: (BulkActionItemConfig | DividerActionConfig)[];\n}\n\nexport interface BulkActionsActionParams {\n /**\n * Array of selected item values to perform the bulk action on.\n */\n selectedValues: any[];\n /**\n * Total number of selected items.\n */\n total: number;\n}\n\nexport interface CustomBulkActionsActionParams extends BaseActionParams {\n /**\n * Bulk action parameters.\n */\n actionParams: BulkActionsActionParams;\n}\n\nexport type CustomBulkActionsActionResolver = (\n params: CustomBulkActionsActionParams,\n) => ResolvedAction;\n\nexport interface CustomBulkActionsActionModalProps\n extends CustomActionModalProps {\n /**\n * Bulk action parameters.\n */\n actionParams: BulkActionsActionParams;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../../src/types/actions/collectionPageActions.ts"],"sourcesContent":["import {\n CustomActionModalProps,\n CustomActionParams,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n CreateActionConfig,\n CustomActionConfig,\n DividerActionConfig,\n} from './base';\n\nexport type CollectionPageActionConfig = (\n | CreateActionConfig\n | CustomActionConfig\n) & {\n collection:\n | {\n collectionId: string;\n entityTypeSource: 'cms';\n custom?: never;\n }\n | {\n collectionId: string;\n entityTypeSource: 'custom';\n custom: {\n id: string;\n };\n };\n};\n\ntype CollectionPageAction = {\n type: 'action';\n action: {\n item: CollectionPageActionConfig;\n };\n menu?: never;\n};\n\ntype CollectionPageMenu = {\n type: 'menu';\n menu: {\n label: string;\n items: (CollectionPageActionConfig | DividerActionConfig)[];\n };\n action?: never;\n};\n\nexport type CollectionPagePrimaryActions =\n | CollectionPageAction\n | CollectionPageMenu;\n\nexport type CollectionPageSecondaryActions =\n | CollectionPageAction\n | CollectionPageMenu;\n\nexport interface CollectionPageActionParams {\n collectionId: string;\n}\n\nexport type CustomActionCollectionPageActionParams =\n CustomActionParams<CollectionPageActionParams>;\n\nexport type CustomActionCollectionPageActionResolver = (\n params: CustomActionCollectionPageActionParams,\n) => ResolvedAction;\n\nexport interface CustomActionCollectionPageActionModalProps\n extends CustomActionModalProps {\n actionParams: CollectionPageActionParams;\n}\n\nexport type CollectionPageOnRowClickActionConfig = CustomActionConfig & {\n item: any;\n};\n\nexport interface CollectionPageActionOnRowClickParams {\n item: any;\n}\n\nexport type CustomActionCollectionPageActionOnRowClickParams =\n CustomActionParams<CollectionPageActionOnRowClickParams>;\n\nexport type CustomActionCollectionPageActionOnRowClickResolver = (\n params: CustomActionCollectionPageActionOnRowClickParams,\n) => ResolvedAction;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../../src/types/actions/collectionPageActions.ts"],"sourcesContent":["import {\n CustomActionModalProps,\n CustomActionParams,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n CreateActionConfig,\n CustomActionConfig,\n DividerActionConfig,\n} from './base';\n\nexport type CollectionPageActionConfig = (\n | CreateActionConfig\n | CustomActionConfig\n) & {\n collection:\n | {\n collectionId: string;\n entityTypeSource: 'cms';\n custom?: never;\n }\n | {\n collectionId: string;\n entityTypeSource: 'custom';\n custom: {\n id: string;\n };\n };\n};\n\ntype CollectionPageAction = {\n /**\n * Layout type discriminator.\n */\n type: 'action';\n /**\n * Single action configuration.\n */\n action: {\n item: CollectionPageActionConfig;\n };\n menu?: never;\n};\n\ntype CollectionPageMenu = {\n /**\n * Layout type discriminator.\n */\n type: 'menu';\n /**\n * Menu configuration with multiple actions.\n */\n menu: {\n /**\n * Menu group label displayed in the UI.\n */\n label: string;\n /**\n * List of actions and dividers in the menu.\n */\n items: (CollectionPageActionConfig | DividerActionConfig)[];\n };\n action?: never;\n};\n\nexport type CollectionPagePrimaryActions =\n | CollectionPageAction\n | CollectionPageMenu;\n\nexport type CollectionPageSecondaryActions =\n | CollectionPageAction\n | CollectionPageMenu;\n\nexport interface CollectionPageActionParams {\n /**\n * The collection ID that the action is operating on.\n */\n collectionId: string;\n}\n\nexport type CustomActionCollectionPageActionParams =\n CustomActionParams<CollectionPageActionParams>;\n\nexport type CustomActionCollectionPageActionResolver = (\n params: CustomActionCollectionPageActionParams,\n) => ResolvedAction;\n\nexport interface CustomActionCollectionPageActionModalProps\n extends CustomActionModalProps {\n /**\n * Collection-specific action parameters.\n */\n actionParams: CollectionPageActionParams;\n}\n\nexport type CollectionPageOnRowClickActionConfig = CustomActionConfig & {\n /**\n * The data item that was clicked (row/card data).\n */\n item: any;\n};\n\nexport interface CollectionPageActionOnRowClickParams {\n /**\n * The data item that was clicked (row/card data).\n */\n item: any;\n}\n\nexport type CustomActionCollectionPageActionOnRowClickParams =\n CustomActionParams<CollectionPageActionOnRowClickParams>;\n\nexport type CustomActionCollectionPageActionOnRowClickResolver = (\n params: CustomActionCollectionPageActionOnRowClickParams,\n) => ResolvedAction;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../../src/types/actions/entityPageActions.ts"],"sourcesContent":["import { FieldValues, UseFormReturn } from '@wix/patterns/form';\nimport { CustomActionParams, ResolvedAction } from '../..';\nimport {\n CreateActionConfig,\n CustomActionConfig,\n DividerActionConfig,\n} from './base';\n\nexport type EntityPageMoreActions = (\n | CustomActionConfig\n | DividerActionConfig\n)[];\n\nexport type EntityPageActionConfig = CreateActionConfig | CustomActionConfig;\n\ntype EntityPageAction = {\n type: 'action';\n action: {\n item: EntityPageActionConfig;\n };\n menu?: never;\n};\n\ntype EntityPageMenu = {\n type: 'menu';\n menu: {\n label: string;\n items: (EntityPageActionConfig | DividerActionConfig)[];\n };\n action?: never;\n};\n\nexport type EntityPagePrimaryActions = EntityPageAction | EntityPageMenu;\nexport type EntityPageSecondaryActions = EntityPageAction | EntityPageMenu;\n\nexport interface EntityPageActionParams {\n entity: any;\n form?: UseFormReturn<FieldValues, any, undefined>;\n}\n\nexport type CustomEntityPageActionParams =\n CustomActionParams<EntityPageActionParams>;\n\nexport type CustomEntityPageActionResolver = (\n params: CustomEntityPageActionParams,\n) => ResolvedAction;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../../src/types/actions/entityPageActions.ts"],"sourcesContent":["import { FieldValues, UseFormReturn } from '@wix/patterns/form';\nimport { CustomActionParams, ResolvedAction } from '../..';\nimport {\n CreateActionConfig,\n CustomActionConfig,\n DividerActionConfig,\n} from './base';\n\nexport type EntityPageMoreActions = (\n | CustomActionConfig\n | DividerActionConfig\n)[];\n\nexport type EntityPageActionConfig = CreateActionConfig | CustomActionConfig;\n\ntype EntityPageAction = {\n /**\n * Layout type discriminator.\n */\n type: 'action';\n /**\n * Single action configuration.\n */\n action: {\n item: EntityPageActionConfig;\n };\n menu?: never;\n};\n\ntype EntityPageMenu = {\n /**\n * Layout type discriminator.\n */\n type: 'menu';\n /**\n * Menu configuration with multiple actions.\n */\n menu: {\n /**\n * Menu group label displayed in the UI.\n */\n label: string;\n /**\n * List of actions and dividers in the menu.\n */\n items: (EntityPageActionConfig | DividerActionConfig)[];\n };\n action?: never;\n};\n\nexport type EntityPagePrimaryActions = EntityPageAction | EntityPageMenu;\n\nexport type EntityPageSecondaryActions = EntityPageAction | EntityPageMenu;\n\nexport interface EntityPageActionParams {\n /**\n * The current entity data being viewed/edited.\n */\n entity: any;\n /**\n * Form APIs available when in edit mode.\n * Undefined in view mode.\n */\n form?: UseFormReturn<FieldValues, any, undefined>;\n}\n\nexport type CustomEntityPageActionParams =\n CustomActionParams<EntityPageActionParams>;\n\nexport type CustomEntityPageActionResolver = (\n params: CustomEntityPageActionParams,\n) => ResolvedAction;\n"],"mappings":"","ignoreList":[]}
@@ -1 +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":[]}
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 /**\n * Array of field IDs that support search functionality.\n * These fields will be included in search operations.\n */\n searchableFieldIds?: string[];\n /**\n * Mapping between filter IDs and actual field IDs.\n * Used to translate filter configurations to actual field queries.\n */\n filterFieldMapping?: Record<string, { fieldId: string }>;\n /**\n * Pagination mode to use for data fetching.\n * Affects the query structure and result format.\n * @default 'offset'\n */\n paginationMode?: M;\n};\n\nexport interface CursorQueryResult {\n /**\n * Array of data items returned by the query.\n */\n items: any[];\n /**\n * Cursor for fetching the next page of results.\n * Undefined or null indicates no more pages available.\n */\n cursor?: string | undefined | null;\n /**\n * Total number of items available (optional).\n * Used for displaying total counts and progress indicators.\n */\n total?: number | null;\n}\n\nexport interface OffsetQueryResult {\n /**\n * Array of data items returned by the query.\n */\n items: any[];\n /**\n * Total number of items available (optional).\n * Used for displaying total counts and calculating page numbers.\n */\n total?: number | null;\n /**\n * Whether there are more pages available.\n * Used to enable/disable next page navigation.\n */\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":[]}
@@ -1 +1 @@
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":[]}
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 /**\n * Collection identifier.\n * - For CMS: the Wix Data collection ID.\n * - For custom sources: the logical collection/entity type ID your data provider recognizes.\n */\n collectionId: string;\n}\n\nexport interface CMSCollectionConfig extends BaseCollectionConfigCommon {\n /**\n * Declares this collection pulls schema/data from Wix CMS.\n */\n entityTypeSource: 'cms';\n /**\n * Optional override for CMS schema metadata.\n * Use this if you already have the schema and want to provide it directly.\n */\n cms?: {\n schema?: { id: string };\n };\n custom?: never;\n}\n\ninterface CustomCollectionConfig extends BaseCollectionConfigCommon {\n /**\n * Declares this collection is backed by a custom data source.\n */\n entityTypeSource: 'custom';\n cms?: never;\n /**\n * Required metadata for custom sources.\n * `id` must match the identifier your custom data source registers under.\n */\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 /** List of pages to render and route between. */\n pages: PageConfig[];\n}\n\nexport interface BasePageConfig {\n /**\n * Page unique identifier.\n * - Used for routing, navigation, and cross references (e.g. `entityPageId`, `parentPageId`).\n */\n id: string;\n /**\n * Marks this page as the main landing page of the app.\n * - Exactly one page should have `true`.\n * - Used to determine the default route.\n */\n appMainPage?: boolean;\n}\n\nexport interface CollectionPageConfigType extends BasePageConfig {\n /**\n * Page type discriminator.\n */\n type: 'collectionPage';\n /**\n * Collection page configuration.\n */\n collectionPage: CollectionPageConfig;\n entityPage?: never;\n}\n\nexport interface EntityPageConfigType extends BasePageConfig {\n /**\n * Page type discriminator.\n */\n type: 'entityPage';\n /**\n * Entity page configuration.\n */\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}\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 /**\n * Field unique identifier (dot-path supported, e.g. 'primaryInfo.email').\n */\n id: string;\n /**\n * Human-readable field display name.\n */\n displayName: string;\n /**\n * Optional validation rules for UI inputs/editing.\n */\n validation?: {\n numberRange?: NumberRange;\n stringLengthRange?: StringLengthRange;\n /**\n * Whether the field is required when creating/updating an entity.\n */\n required: boolean;\n };\n /**\n * Capabilities informing UI and query layer behavior.\n */\n capabilities: {\n /**\n * Operators allowed for querying/filtering this field.\n */\n supportedQueryOperators: QueryOperator[];\n /**\n * Whether the field supports sorting.\n */\n sortable: boolean;\n };\n}\n\nexport interface ReferenceField extends BaseField {\n type: 'REFERENCE';\n referenceMetadata: {\n /**\n * Target collection ID referenced by this field.\n */\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}\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 /**\n * Schema unique identifier (usually same as collectionId).\n */\n id: string;\n /**\n * Field registry by fieldId. Undefined value allows reserving keys conditionally.\n */\n fields: Record<string, Field | undefined>;\n /**\n * The fieldId that best represents the entity for titles/selections.\n */\n displayField: string;\n /**\n * The underlying identifier field used by your data source (e.g. '_id').\n */\n idField: string;\n /**\n * Data access layer for entities of this schema.\n */\n actions: {\n /**\n * Fetch a single entity by ID.\n */\n get: (entityId: string) => Promise<any>;\n /**\n * Create a new entity with the provided partial.\n */\n create: (newEntity: Partial<any>) => Promise<any>;\n /**\n * Update an existing entity.\n */\n update: (updatedEntity: any) => Promise<any>;\n /**\n * Delete an entity by ID.\n */\n delete: (entityId: string) => Promise<any>;\n /**\n * Bulk deletion by IDs.\n */\n bulkDelete: (entityIds: string[]) => Promise<any>;\n /**\n * Query for entities with pagination/sort/filter.\n * Return shape depends on pagination mode (see CollectionConfig.paginationMode):\n * - Cursor mode: { items, cursor, total? }\n * - Offset mode (default): { items, hasNext, total? }\n */\n find: (\n query: Query,\n options?: {\n /**\n * Overrides the set of fieldIds used for search term matching.\n */\n searchableFieldIds?: string[];\n /**\n * Maps UI filter ids to underlying fieldIds when they differ.\n */\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":[]}
@@ -6,7 +6,8 @@ const resolveAction = (actionConfig, action) => {
6
6
  return {
7
7
  ...action,
8
8
  label: actionConfig.label ?? action.label,
9
- skin: actionConfig.skin
9
+ skin: actionConfig.skin,
10
+ biName: actionConfig.biName
10
11
  };
11
12
  };
12
13
  exports.resolveAction = resolveAction;
@@ -1 +1 @@
1
- {"version":3,"names":["resolveAction","actionConfig","action","label","skin","exports"],"sources":["../../../../src/utils/actions/resolveAction.ts"],"sourcesContent":["import { BaseActionItemConfig, ResolvedAction } from '../../types';\n\nexport const resolveAction = (\n actionConfig: BaseActionItemConfig,\n action: Partial<ResolvedAction>,\n) => {\n return {\n ...action,\n label: actionConfig.label ?? action.label,\n skin: actionConfig.skin,\n };\n};\n"],"mappings":";;;;AAEO,MAAMA,aAAa,GAAGA,CAC3BC,YAAkC,EAClCC,MAA+B,KAC5B;EACH,OAAO;IACL,GAAGA,MAAM;IACTC,KAAK,EAAEF,YAAY,CAACE,KAAK,IAAID,MAAM,CAACC,KAAK;IACzCC,IAAI,EAAEH,YAAY,CAACG;EACrB,CAAC;AACH,CAAC;AAACC,OAAA,CAAAL,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["resolveAction","actionConfig","action","label","skin","biName","exports"],"sources":["../../../../src/utils/actions/resolveAction.ts"],"sourcesContent":["import { BaseActionItemConfig, ResolvedAction } from '../../types';\n\nexport const resolveAction = (\n actionConfig: BaseActionItemConfig,\n action: Partial<ResolvedAction>,\n) => {\n return {\n ...action,\n label: actionConfig.label ?? action.label,\n skin: actionConfig.skin,\n biName: actionConfig.biName,\n };\n};\n"],"mappings":";;;;AAEO,MAAMA,aAAa,GAAGA,CAC3BC,YAAkC,EAClCC,MAA+B,KAC5B;EACH,OAAO;IACL,GAAGA,MAAM;IACTC,KAAK,EAAEF,YAAY,CAACE,KAAK,IAAID,MAAM,CAACC,KAAK;IACzCC,IAAI,EAAEH,YAAY,CAACG,IAAI;IACvBC,MAAM,EAAEJ,YAAY,CAACI;EACvB,CAAC;AACH,CAAC;AAACC,OAAA,CAAAN,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../../src/utils/actions/types.ts"],"sourcesContent":["import { ActionCellAPI, CollectionOptimisticActions } from '@wix/patterns';\nimport {\n UpdateActionConfig,\n CustomActionConfig,\n SchemaConfig,\n BulkDeleteActionConfig,\n DeleteActionConfig,\n CreateActionConfig,\n BaseSDK,\n} from '../../types';\nimport { IconElement } from '@wix/design-system';\n\nexport interface ResolvedAction {\n label: string;\n icon: IconElement;\n onClick: () => void;\n disabled?: boolean;\n hidden?: boolean;\n tooltip?: string;\n skin?: string;\n}\n\nexport interface BaseContextParams {\n schema: SchemaConfig;\n}\n\nexport interface ActionsSDK extends BaseSDK {\n getSchema: (collectionId: string) => SchemaConfig | undefined;\n collectionId: string; // TODO: Why collectionId is needed here? getSchema with internal collectionId is enough\n getOptimisticActions: (\n collectionId: string,\n ) => CollectionOptimisticActions<any, any>;\n}\n\nexport interface BaseActionParams<T = Record<string, any>> {\n sdk: ActionsSDK;\n actionParams: T;\n}\n\nexport interface ActionCellBaseParams extends BaseActionParams {\n actionParams: {\n item: any;\n index: number;\n api: ActionCellAPI<any, any>;\n };\n}\n\nexport interface BulkDeleteActionParams extends BaseActionParams {\n action: BulkDeleteActionConfig;\n actionParams: {\n selectedValues: any[];\n total: number;\n };\n}\n\nexport interface DeleteActionParams extends ActionCellBaseParams {\n action: DeleteActionConfig;\n}\n\nexport interface UpdateActionParams extends BaseActionParams {\n action: UpdateActionConfig;\n}\n\nexport interface CreateActionParams extends BaseActionParams {\n action: CreateActionConfig;\n}\n\nexport interface CustomActionParams<T> extends BaseActionParams<T> {\n action: CustomActionConfig;\n}\n\nexport interface ActionModalProps {\n modalParams: Record<string, any>;\n actionParams: Record<string, any>;\n sdk: ActionsSDK;\n}\n\nexport interface CustomActionModalProps extends ActionModalProps {\n modalParams: { id: string };\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../../src/utils/actions/types.ts"],"sourcesContent":["import { ActionCellAPI, CollectionOptimisticActions } from '@wix/patterns';\nimport {\n UpdateActionConfig,\n CustomActionConfig,\n SchemaConfig,\n BulkDeleteActionConfig,\n DeleteActionConfig,\n CreateActionConfig,\n BaseSDK,\n} from '../../types';\nimport { IconElement } from '@wix/design-system';\n\nexport interface ResolvedAction {\n label: string;\n icon: IconElement;\n onClick: () => void;\n disabled?: boolean;\n hidden?: boolean;\n tooltip?: string;\n skin?: string;\n biName?: string;\n}\n\nexport interface BaseContextParams {\n schema: SchemaConfig;\n}\n\nexport interface ActionsSDK extends BaseSDK {\n getSchema: (collectionId: string) => SchemaConfig | undefined;\n collectionId: string; // TODO: Why collectionId is needed here? getSchema with internal collectionId is enough\n getOptimisticActions: (\n collectionId: string,\n ) => CollectionOptimisticActions<any, any>;\n}\n\nexport interface BaseActionParams<T = Record<string, any>> {\n sdk: ActionsSDK;\n actionParams: T;\n}\n\nexport interface ActionCellBaseParams extends BaseActionParams {\n actionParams: {\n item: any;\n index: number;\n api: ActionCellAPI<any, any>;\n };\n}\n\nexport interface BulkDeleteActionParams extends BaseActionParams {\n action: BulkDeleteActionConfig;\n actionParams: {\n selectedValues: any[];\n total: number;\n };\n}\n\nexport interface DeleteActionParams extends ActionCellBaseParams {\n action: DeleteActionConfig;\n}\n\nexport interface UpdateActionParams extends BaseActionParams {\n action: UpdateActionConfig;\n}\n\nexport interface CreateActionParams extends BaseActionParams {\n action: CreateActionConfig;\n}\n\nexport interface CustomActionParams<T> extends BaseActionParams<T> {\n action: CustomActionConfig;\n}\n\nexport interface ActionModalProps {\n modalParams: Record<string, any>;\n actionParams: Record<string, any>;\n sdk: ActionsSDK;\n}\n\nexport interface CustomActionModalProps extends ActionModalProps {\n modalParams: { id: string };\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.getMetasiteId = void 0;
5
+ // Copied https://github.com/wix-private/picasso-giza-host/blob/7750022685df79e499194fc7f5225f5f49d62ee0/packages/picasso-common/src/services/metaSiteIdService.ts#L2
6
+ const getMetasiteId = () => {
7
+ const match = window.location.href.match(/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i);
8
+ return match == null ? void 0 : match[0];
9
+ };
10
+ exports.getMetasiteId = getMetasiteId;
11
+ //# sourceMappingURL=vibe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getMetasiteId","match","window","location","href","exports"],"sources":["../../../src/utils/vibe.ts"],"sourcesContent":["// Copied https://github.com/wix-private/picasso-giza-host/blob/7750022685df79e499194fc7f5225f5f49d62ee0/packages/picasso-common/src/services/metaSiteIdService.ts#L2\nexport const getMetasiteId = () => {\n const match = window.location.href.match(\n /[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i,\n );\n return match?.[0];\n};\n"],"mappings":";;;;AAAA;AACO,MAAMA,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAMC,KAAK,GAAGC,MAAM,CAACC,QAAQ,CAACC,IAAI,CAACH,KAAK,CACtC,0EACF,CAAC;EACD,OAAOA,KAAK,oBAALA,KAAK,CAAG,CAAC,CAAC;AACnB,CAAC;AAACI,OAAA,CAAAL,aAAA,GAAAA,aAAA","ignoreList":[]}