@wix/auto-patterns 1.25.0 → 1.27.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.
- package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.js +16 -7
- package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -1
- package/dist/cjs/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +2 -2
- package/dist/cjs/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
- package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +58 -4
- package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/EditModeEntityPage.js +10 -9
- package/dist/cjs/components/AutoPatternsEntityPage/EditModeEntityPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.js +88 -36
- package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js +19 -5
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
- package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js +1 -1
- package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
- package/dist/cjs/hooks/index.js +19 -0
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/useEntityPageHeaderTexts.js +48 -9
- package/dist/cjs/hooks/useEntityPageHeaderTexts.js.map +1 -1
- package/dist/cjs/hooks/useGridFeatures.js +3 -0
- package/dist/cjs/hooks/useGridFeatures.js.map +1 -1
- package/dist/cjs/hooks/useNavigationUtils.js +21 -6
- package/dist/cjs/hooks/useNavigationUtils.js.map +1 -1
- package/dist/cjs/hooks/useTableFeatures.js +3 -0
- package/dist/cjs/hooks/useTableFeatures.js.map +1 -1
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js +3 -0
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js.map +1 -1
- package/dist/cjs/hooks/useUpdateAppContextItems.js +18 -0
- package/dist/cjs/hooks/useUpdateAppContextItems.js.map +1 -0
- package/dist/cjs/providers/AppContext.js +58 -0
- package/dist/cjs/providers/AppContext.js.map +1 -0
- package/dist/cjs/providers/ItemsContext.js +37 -0
- package/dist/cjs/providers/ItemsContext.js.map +1 -0
- package/dist/cjs/providers/PatternsWizardOverridesContext.js +1 -1
- package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +1 -1
- package/dist/cjs/providers/index.js +12 -0
- package/dist/cjs/providers/index.js.map +1 -1
- package/dist/cjs/types/EntityPageConfig.js.map +1 -1
- package/dist/cjs/types/types.js.map +1 -1
- package/dist/docs/app_config_structure.md +6 -2
- package/dist/docs/auto-patterns-guide.md +466 -38
- package/dist/docs/bulk_actions.md +2 -5
- package/dist/docs/collection_page.md +1 -1
- package/dist/docs/collection_page_actions.md +4 -13
- package/dist/docs/custom_overrides.md +18 -6
- package/dist/docs/entity_page.md +294 -2
- package/dist/docs/entity_page_actions.md +3 -3
- package/dist/docs/entity_page_view_actions.md +2 -2
- package/dist/docs/index.md +12 -0
- package/dist/docs/installation.md +25 -2
- package/dist/docs/pages_configuration.md +2 -2
- package/dist/docs/resolved_action.md +106 -0
- package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js +5 -3
- package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -1
- package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +2 -2
- package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
- package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +24 -0
- package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js +2 -1
- package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js +45 -18
- package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js +8 -0
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
- package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js +1 -1
- package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
- package/dist/esm/hooks/index.js +2 -0
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/useEntityPageHeaderTexts.js +48 -9
- package/dist/esm/hooks/useEntityPageHeaderTexts.js.map +1 -1
- package/dist/esm/hooks/useGridFeatures.js +4 -1
- package/dist/esm/hooks/useGridFeatures.js.map +1 -1
- package/dist/esm/hooks/useNavigationUtils.js +21 -6
- package/dist/esm/hooks/useNavigationUtils.js.map +1 -1
- package/dist/esm/hooks/useTableFeatures.js +4 -1
- package/dist/esm/hooks/useTableFeatures.js.map +1 -1
- package/dist/esm/hooks/useTableGridSwitchFeatures.js +4 -1
- package/dist/esm/hooks/useTableGridSwitchFeatures.js.map +1 -1
- package/dist/esm/hooks/useUpdateAppContextItems.js +13 -0
- package/dist/esm/hooks/useUpdateAppContextItems.js.map +1 -0
- package/dist/esm/providers/AppContext.js +31 -0
- package/dist/esm/providers/AppContext.js.map +1 -0
- package/dist/esm/providers/ItemsContext.js +23 -0
- package/dist/esm/providers/ItemsContext.js.map +1 -0
- package/dist/esm/providers/PatternsWizardOverridesContext.js.map +1 -1
- package/dist/esm/providers/index.js +1 -0
- package/dist/esm/providers/index.js.map +1 -1
- package/dist/esm/types/EntityPageConfig.js.map +1 -1
- package/dist/esm/types/types.js.map +1 -1
- package/dist/types/components/AutoPatternsApp/AutoPatternsApp.d.ts +1 -0
- package/dist/types/components/AutoPatternsApp/AutoPatternsApp.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/EditModeEntityPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/ViewModeEntityPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsRoute/AutoPatternsRoutes.d.ts.map +1 -1
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/useEntityPageHeaderTexts.d.ts +10 -1
- package/dist/types/hooks/useEntityPageHeaderTexts.d.ts.map +1 -1
- package/dist/types/hooks/useGridFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useNavigationUtils.d.ts +5 -1
- package/dist/types/hooks/useNavigationUtils.d.ts.map +1 -1
- package/dist/types/hooks/useTableFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useUpdateAppContextItems.d.ts +2 -0
- package/dist/types/hooks/useUpdateAppContextItems.d.ts.map +1 -0
- package/dist/types/providers/AppContext.d.ts +11 -0
- package/dist/types/providers/AppContext.d.ts.map +1 -0
- package/dist/types/providers/ItemsContext.d.ts +11 -0
- package/dist/types/providers/ItemsContext.d.ts.map +1 -0
- package/dist/types/providers/PatternsWizardOverridesContext.d.ts +10 -0
- package/dist/types/providers/PatternsWizardOverridesContext.d.ts.map +1 -1
- package/dist/types/providers/index.d.ts +1 -0
- package/dist/types/providers/index.d.ts.map +1 -1
- package/dist/types/types/EntityPageConfig.d.ts +5 -1
- package/dist/types/types/EntityPageConfig.d.ts.map +1 -1
- package/dist/types/types/types.d.ts +1 -0
- package/dist/types/types/types.d.ts.map +1 -1
- package/package.json +18 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_useFetchData","require","_patterns","_useCommonCollectionFeatures","_useFilters","_SchemaContext","_useAutoPatternsOptimisticActions","_useBaseGridFeatures","_useBaseTableFeatures","useTableGridSwitchFeatures","config","schema","useSchema","collectionId","limit","reflectQueryInUrl","selectAllScope","selectionUpdateMode","collection","filterComponent","filtersObject","filterFieldMapping","useFilters","filters","preset","imagePlacement","visibleFieldIds","gridVisibleFieldIds","renderItem","useBaseGridFeatures","customColumns","tableVisibleFieldIds","columns","tableColumns","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","useBaseTableFeatures","fetchData","tableFetchData","useFetchData","searchableFieldIds","Array","from","Set","state","useTableGridSwitchCollection","queryName","itemKey","item","idField","itemName","displayField","toExtendedFields","extendedFields","fetchErrorMessage","err","String","persistQueryToUrl","disableAutoSelectAllCount","selectionConsistencyMode","optimisticActions","useAutoPatternsOptimisticActions","commonFeatures","useCommonCollectionFeatures","horizontalScroll","exports"],"sources":["../../../src/hooks/useTableGridSwitchFeatures.tsx"],"sourcesContent":["import { TableGridSwitchConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { useTableGridSwitchCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useSchema } from '../providers/SchemaContext';\nimport { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticActions';\nimport { useBaseGridFeatures } from './useBaseGridFeatures';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\n\nexport const useTableGridSwitchFeatures = (config: TableGridSwitchConfig) => {\n const schema = useSchema();\n\n const {\n collectionId,\n limit,\n reflectQueryInUrl,\n selectAllScope,\n selectionUpdateMode,\n } = config.collection;\n\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n config.filters,\n );\n\n const {\n preset,\n imagePlacement,\n visibleFieldIds: gridVisibleFieldIds,\n renderItem,\n } = useBaseGridFeatures(config);\n\n const {\n customColumns,\n visibleFieldIds: tableVisibleFieldIds,\n columns: tableColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n } = useBaseTableFeatures(config);\n\n const { fetchData: tableFetchData } = useFetchData({\n searchableFieldIds: Array.from(\n new Set([...tableVisibleFieldIds, ...gridVisibleFieldIds]),\n ),\n filterFieldMapping,\n });\n\n const state = useTableGridSwitchCollection<any>({\n queryName: `${collectionId}`,\n itemKey: (item) => item[schema.idField],\n itemName: (item) => item[schema.displayField],\n filters: filtersObject,\n toExtendedFields: (item) => item.extendedFields,\n fetchErrorMessage: ({ err }) => String(err),\n fetchData: tableFetchData,\n limit,\n persistQueryToUrl: reflectQueryInUrl,\n disableAutoSelectAllCount: selectAllScope === 'page',\n selectionConsistencyMode: selectionUpdateMode,\n });\n\n const optimisticActions = useAutoPatternsOptimisticActions(\n collectionId,\n state.collection,\n );\n\n const commonFeatures = useCommonCollectionFeatures({\n ...config,\n optimisticActions,\n });\n\n return {\n ...commonFeatures,\n state,\n columns: tableColumns,\n filters: filterComponent,\n optimisticActions,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n horizontalScroll: true,\n // Grid specific features\n imagePlacement,\n preset,\n renderItem,\n showTitleBar,\n };\n};\n"],"mappings":";;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,4BAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,iCAAA,GAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AACA,IAAAO,qBAAA,GAAAP,OAAA;AAEO,
|
|
1
|
+
{"version":3,"names":["_useFetchData","require","_patterns","_useCommonCollectionFeatures","_useFilters","_SchemaContext","_useAutoPatternsOptimisticActions","_useBaseGridFeatures","_useBaseTableFeatures","_useUpdateAppContextItems","useTableGridSwitchFeatures","config","schema","useSchema","collectionId","limit","reflectQueryInUrl","selectAllScope","selectionUpdateMode","collection","filterComponent","filtersObject","filterFieldMapping","useFilters","filters","preset","imagePlacement","visibleFieldIds","gridVisibleFieldIds","renderItem","useBaseGridFeatures","customColumns","tableVisibleFieldIds","columns","tableColumns","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","useBaseTableFeatures","fetchData","tableFetchData","useFetchData","searchableFieldIds","Array","from","Set","state","useTableGridSwitchCollection","queryName","itemKey","item","idField","itemName","displayField","toExtendedFields","extendedFields","fetchErrorMessage","err","String","persistQueryToUrl","disableAutoSelectAllCount","selectionConsistencyMode","items","useSelector","result","useUpdateAppContextItems","optimisticActions","useAutoPatternsOptimisticActions","commonFeatures","useCommonCollectionFeatures","horizontalScroll","exports"],"sources":["../../../src/hooks/useTableGridSwitchFeatures.tsx"],"sourcesContent":["import { TableGridSwitchConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { useSelector, useTableGridSwitchCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useSchema } from '../providers/SchemaContext';\nimport { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticActions';\nimport { useBaseGridFeatures } from './useBaseGridFeatures';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\nimport { useUpdateAppContextItems } from './useUpdateAppContextItems';\n\nexport const useTableGridSwitchFeatures = (config: TableGridSwitchConfig) => {\n const schema = useSchema();\n\n const {\n collectionId,\n limit,\n reflectQueryInUrl,\n selectAllScope,\n selectionUpdateMode,\n } = config.collection;\n\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n config.filters,\n );\n\n const {\n preset,\n imagePlacement,\n visibleFieldIds: gridVisibleFieldIds,\n renderItem,\n } = useBaseGridFeatures(config);\n\n const {\n customColumns,\n visibleFieldIds: tableVisibleFieldIds,\n columns: tableColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n } = useBaseTableFeatures(config);\n\n const { fetchData: tableFetchData } = useFetchData({\n searchableFieldIds: Array.from(\n new Set([...tableVisibleFieldIds, ...gridVisibleFieldIds]),\n ),\n filterFieldMapping,\n });\n\n const state = useTableGridSwitchCollection<any>({\n queryName: `${collectionId}`,\n itemKey: (item) => item[schema.idField],\n itemName: (item) => item[schema.displayField],\n filters: filtersObject,\n toExtendedFields: (item) => item.extendedFields,\n fetchErrorMessage: ({ err }) => String(err),\n fetchData: tableFetchData,\n limit,\n persistQueryToUrl: reflectQueryInUrl,\n disableAutoSelectAllCount: selectAllScope === 'page',\n selectionConsistencyMode: selectionUpdateMode,\n });\n\n const items = useSelector(() => state.collection.result.items);\n useUpdateAppContextItems(items);\n\n const optimisticActions = useAutoPatternsOptimisticActions(\n collectionId,\n state.collection,\n );\n\n const commonFeatures = useCommonCollectionFeatures({\n ...config,\n optimisticActions,\n });\n\n return {\n ...commonFeatures,\n state,\n columns: tableColumns,\n filters: filterComponent,\n optimisticActions,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n horizontalScroll: true,\n // Grid specific features\n imagePlacement,\n preset,\n renderItem,\n showTitleBar,\n };\n};\n"],"mappings":";;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,4BAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,iCAAA,GAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AACA,IAAAO,qBAAA,GAAAP,OAAA;AACA,IAAAQ,yBAAA,GAAAR,OAAA;AAEO,MAAMS,0BAA0B,GAAIC,MAA6B,IAAK;EAC3E,MAAMC,MAAM,GAAG,IAAAC,wBAAS,EAAC,CAAC;EAE1B,MAAM;IACJC,YAAY;IACZC,KAAK;IACLC,iBAAiB;IACjBC,cAAc;IACdC;EACF,CAAC,GAAGP,MAAM,CAACQ,UAAU;EAErB,MAAM;IAAEC,eAAe;IAAEC,aAAa;IAAEC;EAAmB,CAAC,GAAG,IAAAC,sBAAU,EACvEZ,MAAM,CAACa,OACT,CAAC;EAED,MAAM;IACJC,MAAM;IACNC,cAAc;IACdC,eAAe,EAAEC,mBAAmB;IACpCC;EAC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Y,EACZiC,KAAK,CAAC5B,UACR,CAAC;EAED,MAAMkD,cAAc,GAAG,IAAAC,wDAA2B,EAAC;IACjD,GAAG3D,MAAM;IACTwD;EACF,CAAC,CAAC;EAEF,OAAO;IACL,GAAGE,cAAc;IACjBtB,KAAK;IACLd,OAAO,EAAEC,YAAY;IACrBV,OAAO,EAAEJ,eAAe;IACxB+C,iBAAiB;IACjBpC,aAAa;IACbI,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBkC,gBAAgB,EAAE,IAAI;IACtB;IACA7C,cAAc;IACdD,MAAM;IACNI,UAAU;IACVS;EACF,CAAC;AACH,CAAC;AAACkC,OAAA,CAAA9D,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useUpdateAppContextItems = void 0;
|
|
5
|
+
var _react = require("react");
|
|
6
|
+
var _ItemsContext = require("../providers/ItemsContext");
|
|
7
|
+
const useUpdateAppContextItems = items => {
|
|
8
|
+
const {
|
|
9
|
+
setItems
|
|
10
|
+
} = (0, _ItemsContext.useItemsContext)();
|
|
11
|
+
(0, _react.useEffect)(() => {
|
|
12
|
+
if (items) {
|
|
13
|
+
setItems(items);
|
|
14
|
+
}
|
|
15
|
+
}, [items, setItems]);
|
|
16
|
+
};
|
|
17
|
+
exports.useUpdateAppContextItems = useUpdateAppContextItems;
|
|
18
|
+
//# sourceMappingURL=useUpdateAppContextItems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_ItemsContext","useUpdateAppContextItems","items","setItems","useItemsContext","useEffect","exports"],"sources":["../../../src/hooks/useUpdateAppContextItems.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport { useItemsContext } from '../providers/ItemsContext';\n\nexport const useUpdateAppContextItems = (items: any[]) => {\n const { setItems } = useItemsContext();\n\n useEffect(() => {\n if (items) {\n setItems(items);\n }\n }, [items, setItems]);\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEO,MAAME,wBAAwB,GAAIC,KAAY,IAAK;EACxD,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,6BAAe,EAAC,CAAC;EAEtC,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAIH,KAAK,EAAE;MACTC,QAAQ,CAACD,KAAK,CAAC;IACjB;EACF,CAAC,EAAE,CAACA,KAAK,EAAEC,QAAQ,CAAC,CAAC;AACvB,CAAC;AAACG,OAAA,CAAAL,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useAppContext = exports.AppContextProvider = void 0;
|
|
5
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
6
|
+
var _ItemsContext = require("./ItemsContext");
|
|
7
|
+
var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/providers/AppContext.tsx";
|
|
8
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
|
+
const AppContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
11
|
+
const AppContextInner = ({
|
|
12
|
+
children
|
|
13
|
+
}) => {
|
|
14
|
+
const {
|
|
15
|
+
items
|
|
16
|
+
} = (0, _ItemsContext.useItemsContext)();
|
|
17
|
+
const contextValue = {
|
|
18
|
+
items
|
|
19
|
+
};
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement(AppContext.Provider, {
|
|
21
|
+
value: contextValue,
|
|
22
|
+
__self: void 0,
|
|
23
|
+
__source: {
|
|
24
|
+
fileName: _jsxFileName,
|
|
25
|
+
lineNumber: 24,
|
|
26
|
+
columnNumber: 5
|
|
27
|
+
}
|
|
28
|
+
}, children);
|
|
29
|
+
};
|
|
30
|
+
const AppContextProvider = ({
|
|
31
|
+
children
|
|
32
|
+
}) => {
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement(_ItemsContext.ItemsContextProvider, {
|
|
34
|
+
__self: void 0,
|
|
35
|
+
__source: {
|
|
36
|
+
fileName: _jsxFileName,
|
|
37
|
+
lineNumber: 32,
|
|
38
|
+
columnNumber: 5
|
|
39
|
+
}
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement(AppContextInner, {
|
|
41
|
+
__self: void 0,
|
|
42
|
+
__source: {
|
|
43
|
+
fileName: _jsxFileName,
|
|
44
|
+
lineNumber: 33,
|
|
45
|
+
columnNumber: 7
|
|
46
|
+
}
|
|
47
|
+
}, children));
|
|
48
|
+
};
|
|
49
|
+
exports.AppContextProvider = AppContextProvider;
|
|
50
|
+
const useAppContext = () => {
|
|
51
|
+
const context = (0, _react.useContext)(AppContext);
|
|
52
|
+
if (context === undefined) {
|
|
53
|
+
throw new Error('useAppContext must be used within an AppContextProvider');
|
|
54
|
+
}
|
|
55
|
+
return context;
|
|
56
|
+
};
|
|
57
|
+
exports.useAppContext = useAppContext;
|
|
58
|
+
//# sourceMappingURL=AppContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_ItemsContext","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AppContext","createContext","undefined","AppContextInner","children","items","useItemsContext","contextValue","createElement","Provider","value","__self","__source","fileName","lineNumber","columnNumber","AppContextProvider","ItemsContextProvider","exports","useAppContext","context","useContext","Error"],"sources":["../../../src/providers/AppContext.tsx"],"sourcesContent":["import React, { ReactNode, createContext, useContext } from 'react';\nimport {\n ItemsContextProvider,\n ItemsContextValue,\n useItemsContext,\n} from './ItemsContext';\n\ninterface AppContextValue extends Pick<ItemsContextValue, 'items'> {}\n\nconst AppContext = createContext<AppContextValue | undefined>(undefined);\n\nexport interface AppContextProviderProps {\n children: ReactNode;\n}\n\nconst AppContextInner: React.FC<AppContextProviderProps> = ({ children }) => {\n const { items } = useItemsContext();\n\n const contextValue: AppContextValue = {\n items,\n };\n\n return (\n <AppContext.Provider value={contextValue}>{children}</AppContext.Provider>\n );\n};\n\nexport const AppContextProvider: React.FC<AppContextProviderProps> = ({\n children,\n}) => {\n return (\n <ItemsContextProvider>\n <AppContextInner>{children}</AppContextInner>\n </ItemsContextProvider>\n );\n};\n\nexport const useAppContext = (): AppContextValue => {\n const context = useContext(AppContext);\n\n if (context === undefined) {\n throw new Error('useAppContext must be used within an AppContextProvider');\n }\n\n return context;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAIwB,IAAAE,YAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,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,MAAMY,kBAAqD,GAAGA,CAAC;EACpEZ;AACF,CAAC,KAAK;EACJ,oBACE7B,MAAA,CAAAW,OAAA,CAAAsB,aAAA,CAAC9B,aAAA,CAAAuC,oBAAoB;IAAAN,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAlC,YAAA;MAAAmC,UAAA;MAAAC,YAAA;IAAA;EAAA,gBACnBxC,MAAA,CAAAW,OAAA,CAAAsB,aAAA,CAACL,eAAe;IAAAQ,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAlC,YAAA;MAAAmC,UAAA;MAAAC,YAAA;IAAA;EAAA,GAAEX,QAA0B,CACxB,CAAC;AAE3B,CAAC;AAACc,OAAA,CAAAF,kBAAA,GAAAA,kBAAA;AAEK,MAAMG,aAAa,GAAGA,CAAA,KAAuB;EAClD,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACrB,UAAU,CAAC;EAEtC,IAAIoB,OAAO,KAAKlB,SAAS,EAAE;IACzB,MAAM,IAAIoB,KAAK,CAAC,yDAAyD,CAAC;EAC5E;EAEA,OAAOF,OAAO;AAChB,CAAC;AAACF,OAAA,CAAAC,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useItemsContext = exports.ItemsContextProvider = void 0;
|
|
5
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
6
|
+
var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/providers/ItemsContext.tsx";
|
|
7
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
8
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
9
|
+
const ItemsContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
10
|
+
const ItemsContextProvider = ({
|
|
11
|
+
children
|
|
12
|
+
}) => {
|
|
13
|
+
const [items, setItems] = (0, _react.useState)([]);
|
|
14
|
+
const contextValue = {
|
|
15
|
+
items,
|
|
16
|
+
setItems
|
|
17
|
+
};
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(ItemsContext.Provider, {
|
|
19
|
+
value: contextValue,
|
|
20
|
+
__self: void 0,
|
|
21
|
+
__source: {
|
|
22
|
+
fileName: _jsxFileName,
|
|
23
|
+
lineNumber: 25,
|
|
24
|
+
columnNumber: 5
|
|
25
|
+
}
|
|
26
|
+
}, children);
|
|
27
|
+
};
|
|
28
|
+
exports.ItemsContextProvider = ItemsContextProvider;
|
|
29
|
+
const useItemsContext = () => {
|
|
30
|
+
const context = (0, _react.useContext)(ItemsContext);
|
|
31
|
+
if (context === undefined) {
|
|
32
|
+
throw new Error('useItemsContext must be used within an ItemsContextProvider');
|
|
33
|
+
}
|
|
34
|
+
return context;
|
|
35
|
+
};
|
|
36
|
+
exports.useItemsContext = useItemsContext;
|
|
37
|
+
//# sourceMappingURL=ItemsContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ItemsContext","createContext","undefined","ItemsContextProvider","children","items","setItems","useState","contextValue","createElement","Provider","value","__self","__source","fileName","lineNumber","columnNumber","exports","useItemsContext","context","useContext","Error"],"sources":["../../../src/providers/ItemsContext.tsx"],"sourcesContent":["import React, { ReactNode, createContext, useContext, useState } from 'react';\n\nexport interface ItemsContextValue {\n items: any[];\n setItems: (items: any[]) => void;\n}\n\nconst ItemsContext = createContext<ItemsContextValue | undefined>(undefined);\n\nexport interface ItemsContextProviderProps {\n children: ReactNode;\n}\n\nexport const ItemsContextProvider: React.FC<ItemsContextProviderProps> = ({\n children,\n}) => {\n const [items, setItems] = useState<any[]>([]);\n\n const contextValue: ItemsContextValue = {\n items,\n setItems,\n };\n\n return (\n <ItemsContext.Provider value={contextValue}>\n {children}\n </ItemsContext.Provider>\n );\n};\n\nexport const useItemsContext = (): ItemsContextValue => {\n const context = useContext(ItemsContext);\n\n if (context === undefined) {\n throw new Error(\n 'useItemsContext must be used within an ItemsContextProvider',\n );\n }\n\n return context;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA8E,IAAAC,YAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAA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GAAAA,eAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","PatternsWizardOverridesContext","createContext","undefined","PatternsWizardOverridesProvider","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","exports","usePatternsWizardOverridesContext","useContext"],"sources":["../../../src/providers/PatternsWizardOverridesContext.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode } from 'react';\nimport {\n CustomComponentProps,\n CustomActionCellPrimaryActionResolver,\n CustomActionCellSecondaryActionResolver,\n CustomEntityPageActionResolver,\n CustomBulkActionsActionResolver,\n CustomActionCollectionPageActionResolver,\n CustomActionCollectionPageActionOnRowClickResolver,\n IColumnValue,\n SchemaConfig,\n} from '../types';\n\nimport { Section } from '@wix/patterns';\n\nexport interface PatternsWizardOverridesContextProps {\n actions?: Record<\n string,\n | CustomActionCellPrimaryActionResolver\n | CustomActionCellSecondaryActionResolver\n | CustomBulkActionsActionResolver\n | CustomEntityPageActionResolver\n | CustomActionCollectionPageActionResolver\n | CustomActionCollectionPageActionOnRowClickResolver\n >;\n columns?: Record<string, (props: IColumnValue<any>) => void>;\n modals?: Record<string, React.FC<any>>;\n emptyState?: Record<string, () => void>;\n components?: Record<string, React.FC<CustomComponentProps>>;\n slots?: Record<string, React.FC>;\n customDataSources?: Record<\n string,\n (collectionId: string, context: any) => Promise<SchemaConfig>\n >;\n sections?: Record<string, (item: any) => Section>;\n}\n\nconst PatternsWizardOverridesContext = createContext<\n PatternsWizardOverridesContextProps | undefined\n>(undefined);\n\nexport const PatternsWizardOverridesProvider: React.FC<{\n children: ReactNode;\n value: PatternsWizardOverridesContextProps;\n}> = ({ children, value }) => {\n return (\n <PatternsWizardOverridesContext.Provider value={value}>\n {children}\n </PatternsWizardOverridesContext.Provider>\n );\n};\n\nexport const usePatternsWizardOverridesContext = ():\n | PatternsWizardOverridesContextProps\n | undefined => {\n return useContext(PatternsWizardOverridesContext);\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAoE,IAAAC,YAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","PatternsWizardOverridesContext","createContext","undefined","PatternsWizardOverridesProvider","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","exports","usePatternsWizardOverridesContext","useContext"],"sources":["../../../src/providers/PatternsWizardOverridesContext.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode } from 'react';\nimport {\n CustomComponentProps,\n CustomActionCellPrimaryActionResolver,\n CustomActionCellSecondaryActionResolver,\n CustomEntityPageActionResolver,\n CustomBulkActionsActionResolver,\n CustomActionCollectionPageActionResolver,\n CustomActionCollectionPageActionOnRowClickResolver,\n IColumnValue,\n SchemaConfig,\n} from '../types';\n\nimport { Section } from '@wix/patterns';\nimport { BadgeSkin, IconElement } from '@wix/design-system';\n\nexport interface PatternsWizardOverridesContextProps {\n actions?: Record<\n string,\n | CustomActionCellPrimaryActionResolver\n | CustomActionCellSecondaryActionResolver\n | CustomBulkActionsActionResolver\n | CustomEntityPageActionResolver\n | CustomActionCollectionPageActionResolver\n | CustomActionCollectionPageActionOnRowClickResolver\n >;\n columns?: Record<string, (props: IColumnValue<any>) => void>;\n modals?: Record<string, React.FC<any>>;\n emptyState?: Record<string, () => void>;\n components?: Record<string, React.FC<CustomComponentProps>>;\n slots?: Record<string, React.FC>;\n entityPageHeaderSubtitle?: Record<\n string,\n (entity: Record<string, any>) => { text: string }\n >;\n entityPageHeaderBadges?: Record<\n string,\n (entity: Record<string, any>) => {\n text: string;\n skin?: BadgeSkin;\n prefixIcon?: IconElement;\n suffixIcon?: IconElement;\n }[]\n >;\n customDataSources?: Record<\n string,\n (collectionId: string, context: any) => Promise<SchemaConfig>\n >;\n sections?: Record<string, (item: any) => Section>;\n}\n\nconst PatternsWizardOverridesContext = createContext<\n PatternsWizardOverridesContextProps | undefined\n>(undefined);\n\nexport const PatternsWizardOverridesProvider: React.FC<{\n children: ReactNode;\n value: PatternsWizardOverridesContextProps;\n}> = ({ children, value }) => {\n return (\n <PatternsWizardOverridesContext.Provider value={value}>\n {children}\n </PatternsWizardOverridesContext.Provider>\n );\n};\n\nexport const usePatternsWizardOverridesContext = ():\n | PatternsWizardOverridesContextProps\n | undefined => {\n return useContext(PatternsWizardOverridesContext);\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAoE,IAAAC,YAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAmDpE,MAAMW,8BAA8B,gBAAG,IAAAC,oBAAa,EAElDC,SAAS,CAAC;AAEL,MAAMC,+BAGX,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAM,CAAC,KAAK;EAC5B,oBACE7B,MAAA,CAAAU,OAAA,CAAAoB,aAAA,CAACN,8BAA8B,CAACO,QAAQ;IAACF,KAAK,EAAEA,KAAM;IAAAG,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA/B,YAAA;MAAAgC,UAAA;MAAAC,YAAA;IAAA;EAAA,GACnDR,QACsC,CAAC;AAE9C,CAAC;AAACS,OAAA,CAAAV,+BAAA,GAAAA,+BAAA;AAEK,MAAMW,iCAAiC,GAAGA,CAAA,KAEhC;EACf,OAAO,IAAAC,iBAAU,EAACf,8BAA8B,CAAC;AACnD,CAAC;AAACa,OAAA,CAAAC,iCAAA,GAAAA,iCAAA","ignoreList":[]}
|
|
@@ -1,40 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
+
var _exportNames = {
|
|
5
|
+
useAppContext: true
|
|
6
|
+
};
|
|
7
|
+
exports.useAppContext = void 0;
|
|
4
8
|
var _SchemaContext = require("./SchemaContext");
|
|
5
9
|
Object.keys(_SchemaContext).forEach(function (key) {
|
|
6
10
|
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
7
12
|
if (key in exports && exports[key] === _SchemaContext[key]) return;
|
|
8
13
|
exports[key] = _SchemaContext[key];
|
|
9
14
|
});
|
|
10
15
|
var _PatternsWizardOverridesContext = require("./PatternsWizardOverridesContext");
|
|
11
16
|
Object.keys(_PatternsWizardOverridesContext).forEach(function (key) {
|
|
12
17
|
if (key === "default" || key === "__esModule") return;
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
13
19
|
if (key in exports && exports[key] === _PatternsWizardOverridesContext[key]) return;
|
|
14
20
|
exports[key] = _PatternsWizardOverridesContext[key];
|
|
15
21
|
});
|
|
16
22
|
var _ModalContext = require("./ModalContext");
|
|
17
23
|
Object.keys(_ModalContext).forEach(function (key) {
|
|
18
24
|
if (key === "default" || key === "__esModule") return;
|
|
25
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
19
26
|
if (key in exports && exports[key] === _ModalContext[key]) return;
|
|
20
27
|
exports[key] = _ModalContext[key];
|
|
21
28
|
});
|
|
22
29
|
var _SchemaRegistryContext = require("./SchemaRegistryContext");
|
|
23
30
|
Object.keys(_SchemaRegistryContext).forEach(function (key) {
|
|
24
31
|
if (key === "default" || key === "__esModule") return;
|
|
32
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
25
33
|
if (key in exports && exports[key] === _SchemaRegistryContext[key]) return;
|
|
26
34
|
exports[key] = _SchemaRegistryContext[key];
|
|
27
35
|
});
|
|
28
36
|
var _AppConfigContext = require("./AppConfigContext");
|
|
29
37
|
Object.keys(_AppConfigContext).forEach(function (key) {
|
|
30
38
|
if (key === "default" || key === "__esModule") return;
|
|
39
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
31
40
|
if (key in exports && exports[key] === _AppConfigContext[key]) return;
|
|
32
41
|
exports[key] = _AppConfigContext[key];
|
|
33
42
|
});
|
|
34
43
|
var _ErrorContext = require("./ErrorContext");
|
|
35
44
|
Object.keys(_ErrorContext).forEach(function (key) {
|
|
36
45
|
if (key === "default" || key === "__esModule") return;
|
|
46
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
37
47
|
if (key in exports && exports[key] === _ErrorContext[key]) return;
|
|
38
48
|
exports[key] = _ErrorContext[key];
|
|
39
49
|
});
|
|
50
|
+
var _AppContext = require("./AppContext");
|
|
51
|
+
exports.useAppContext = _AppContext.useAppContext;
|
|
40
52
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_SchemaContext","require","Object","keys","forEach","key","exports","_PatternsWizardOverridesContext","_ModalContext","_SchemaRegistryContext","_AppConfigContext","_ErrorContext"],"sources":["../../../src/providers/index.ts"],"sourcesContent":["export * from './SchemaContext';\nexport * from './PatternsWizardOverridesContext';\nexport * from './ModalContext';\nexport * from './SchemaRegistryContext';\nexport * from './AppConfigContext';\nexport * from './ErrorContext';\n"],"mappings":"
|
|
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,CAAA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AAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,iBAAA,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,WAAA,GAAAf,OAAA;AAA6CS,OAAA,CAAAO,aAAA,GAAAD,WAAA,CAAAC,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 };\n subtitle?: {\n text
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/types/types.ts"],"sourcesContent":["import { EntityPageConfig } from './EntityPageConfig';\nimport { CollectionPageConfig } from './CollectionPageConfig';\n\ninterface BaseCollectionConfigCommon {\n collectionId: string;\n}\n\ninterface CMSCollectionConfig extends BaseCollectionConfigCommon {\n entityTypeSource: 'cms';\n custom?: never;\n}\n\ninterface CustomCollectionConfig extends BaseCollectionConfigCommon {\n entityTypeSource: 'custom';\n custom: {\n id: string;\n };\n}\n\nexport type BaseCollectionConfig = CMSCollectionConfig | CustomCollectionConfig;\n\nexport type PatternsFieldType =\n | 'SHORT_TEXT'\n | 'LONG_TEXT'\n | 'NUMBER'\n | 'BOOLEAN'\n | 'DATE'\n | 'DATETIME'\n | 'URL'\n | 'ARRAY'\n | 'REFERENCE'\n | 'IMAGE';\n\nexport interface AppConfig {\n pages: PageConfig[];\n}\n\nexport interface BasePageConfig {\n id: string;\n appMainPage?: boolean;\n}\n\nexport interface CollectionPageConfigType extends BasePageConfig {\n type: 'collectionPage';\n collectionPage: CollectionPageConfig;\n entityPage?: never;\n}\n\nexport interface EntityPageConfigType extends BasePageConfig {\n type: 'entityPage';\n entityPage: EntityPageConfig;\n collectionPage?: never;\n}\n\nexport type PageConfig = CollectionPageConfigType | EntityPageConfigType;\n\nexport type EntityProps = { [key: string]: any };\n\nexport interface IMenuItem<T extends EntityProps = any> {\n item: T;\n}\nexport interface IColumnValue<T> {\n value: T;\n row: Record<string, any>;\n}\n\nexport type QueryOperator =\n | 'CONTAINS'\n | 'ENDS_WITH'\n | 'EQ'\n | 'EXISTS'\n | 'GT'\n | 'GTE'\n | 'HAS_ALL'\n | 'HAS_SOME'\n | 'LT'\n | 'LTE'\n | 'NE'\n | 'STARTS_WITH'\n | 'URLIZED';\n\ninterface BaseField {\n id: string;\n displayName: string;\n validation?: {\n numberRange?: NumberRange;\n stringLengthRange?: StringLengthRange;\n required: boolean;\n };\n capabilities: {\n supportedQueryOperators: QueryOperator[];\n sortable: boolean;\n };\n}\n\nexport interface ReferenceField extends BaseField {\n type: 'REFERENCE';\n referenceMetadata: {\n referencedCollectionId: string;\n };\n}\n\nexport interface NonReferenceField extends BaseField {\n type: Exclude<PatternsFieldType, 'REFERENCE'>;\n}\n\nexport type Field = ReferenceField | NonReferenceField;\n\nexport interface NumberRange {\n min?: number;\n max?: number;\n}\nexport interface StringLengthRange {\n minLength?: number;\n maxLength?: number;\n}\n\nexport interface Query {\n limit: number;\n offset: number;\n page: number;\n search?: string;\n cursor?: string | null;\n filters: Record<string, any>;\n sort?: {\n fieldName: string;\n order: 'asc' | 'desc';\n }[];\n}\n\nexport interface SchemaConfig {\n id: string;\n fields: Record<string, Field | undefined>;\n displayField: string;\n idField: string;\n actions: {\n get: (entityId: string) => Promise<any>;\n create: (newEntity: Partial<any>) => Promise<any>;\n update: (updatedEntity: any) => Promise<any>;\n delete: (entityId: string) => Promise<any>;\n bulkDelete: (entityIds: string[]) => Promise<any>;\n find: (\n query: Query,\n options?: {\n searchableFieldIds?: string[];\n filterFieldMapping?: Record<string, { fieldId: string }>;\n },\n ) => Promise<{ items: any[]; total: number }>;\n };\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/types/types.ts"],"sourcesContent":["import { EntityPageConfig } from './EntityPageConfig';\nimport { CollectionPageConfig } from './CollectionPageConfig';\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}\n\nexport interface SchemaConfig {\n id: string;\n fields: Record<string, Field | undefined>;\n displayField: string;\n idField: string;\n actions: {\n get: (entityId: string) => Promise<any>;\n create: (newEntity: Partial<any>) => Promise<any>;\n update: (updatedEntity: any) => Promise<any>;\n delete: (entityId: string) => Promise<any>;\n bulkDelete: (entityIds: string[]) => Promise<any>;\n find: (\n query: Query,\n options?: {\n searchableFieldIds?: string[];\n filterFieldMapping?: Record<string, { fieldId: string }>;\n },\n ) => Promise<{ items: any[]; total: number }>;\n };\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AppConfig Structure
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Configuration Rules
|
|
4
4
|
|
|
5
5
|
- **Configuration must come only from a TypeScript file** - never inline or from other sources
|
|
6
6
|
- **Always use proper TypeScript typing**: `export const config: AppConfig = { ... }`
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
- **After each configuration change, verify that the configuration strictly aligns with the structure described below** - any configuration entries not defined in this structure must be removed
|
|
9
9
|
- **When generating config for the first time, select up to 3 columns from the schema that best represent the entity**
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Common Configuration Mistakes to Avoid
|
|
12
12
|
|
|
13
13
|
- Adding more than two pages
|
|
14
14
|
- Mixing page types in a single configuration
|
|
@@ -314,9 +314,13 @@ export interface AppConfig {
|
|
|
314
314
|
};
|
|
315
315
|
title?: {
|
|
316
316
|
text: string; // Entity page title
|
|
317
|
+
badges?: {
|
|
318
|
+
id?: string; // Optional ID that maps to a dynamic badges override function
|
|
319
|
+
};
|
|
317
320
|
};
|
|
318
321
|
subtitle?: {
|
|
319
322
|
text: string; // Entity page subtitle
|
|
323
|
+
id?: string; // Optional ID that maps to a dynamic subtitle override function
|
|
320
324
|
};
|
|
321
325
|
actions?: { // Action configuration varies by mode
|
|
322
326
|
// Edit mode: only moreActions supported
|