@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.
- package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +19 -58
- package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +1 -1
- package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
- package/dist/cjs/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js +48 -0
- package/dist/cjs/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +1 -1
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js +11 -7
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
- package/dist/cjs/components/ModalRenderer.js +1 -1
- package/dist/cjs/components/ModalRenderer.js.map +1 -1
- package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js +5 -0
- package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
- package/dist/cjs/hooks/index.js +0 -7
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/useAppContextSync.js +24 -0
- package/dist/cjs/hooks/useAppContextSync.js.map +1 -0
- package/dist/cjs/hooks/useAutoPatternsOptimisticActions.js +2 -2
- package/dist/cjs/hooks/useAutoPatternsOptimisticActions.js.map +1 -1
- package/dist/cjs/hooks/useBaseSDK.js +1 -1
- package/dist/cjs/hooks/useBaseSDK.js.map +1 -1
- package/dist/cjs/hooks/useColumns.js +1 -1
- package/dist/cjs/hooks/useColumns.js.map +1 -1
- package/dist/cjs/hooks/useEmptyStates.js +1 -1
- package/dist/cjs/hooks/useEmptyStates.js.map +1 -1
- package/dist/cjs/hooks/useEntityPageHeaderTexts.js +2 -2
- package/dist/cjs/hooks/useEntityPageHeaderTexts.js.map +1 -1
- package/dist/cjs/hooks/useFilters.js +2 -2
- package/dist/cjs/hooks/useFilters.js.map +1 -1
- package/dist/cjs/hooks/useGridFeatures.js +10 -2
- package/dist/cjs/hooks/useGridFeatures.js.map +1 -1
- package/dist/cjs/hooks/useTableFeatures.js +12 -4
- package/dist/cjs/hooks/useTableFeatures.js.map +1 -1
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js +10 -2
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js.map +1 -1
- package/dist/cjs/providers/AppContext.js +10 -8
- package/dist/cjs/providers/AppContext.js.map +1 -1
- package/dist/cjs/providers/AppContextData.js +40 -0
- package/dist/cjs/providers/AppContextData.js.map +1 -0
- package/dist/cjs/providers/{PatternsWizardOverridesContext.js → AutoPatternsOverridesContext.js} +14 -11
- package/dist/cjs/providers/AutoPatternsOverridesContext.js.map +1 -0
- package/dist/cjs/providers/ItemsContext.js +14 -11
- package/dist/cjs/providers/ItemsContext.js.map +1 -1
- package/dist/cjs/providers/SchemaContext.js +24 -7
- package/dist/cjs/providers/SchemaContext.js.map +1 -1
- package/dist/cjs/providers/index.js +11 -4
- package/dist/cjs/providers/index.js.map +1 -1
- package/dist/cjs/types/BaseSDK.js.map +1 -1
- package/dist/cjs/types/CollectionPageConfig.js.map +1 -1
- package/dist/cjs/types/EntityPageConfig.js.map +1 -1
- package/dist/cjs/types/actions/actionCell.js.map +1 -1
- package/dist/cjs/types/actions/base.js.map +1 -1
- package/dist/cjs/types/actions/bulkActions.js.map +1 -1
- package/dist/cjs/types/actions/collectionPageActions.js.map +1 -1
- package/dist/cjs/types/actions/entityPageActions.js.map +1 -1
- package/dist/cjs/types/fetchData.js.map +1 -1
- package/dist/cjs/types/types.js.map +1 -1
- package/dist/cjs/utils/actions/resolveAction.js +2 -1
- package/dist/cjs/utils/actions/resolveAction.js.map +1 -1
- package/dist/cjs/utils/actions/types.js.map +1 -1
- package/dist/cjs/utils/vibe.js +11 -0
- package/dist/cjs/utils/vibe.js.map +1 -0
- package/dist/docs/action_cell.md +18 -8
- package/dist/docs/app_config_structure.md +36 -1
- package/dist/docs/app_context.md +109 -0
- package/dist/docs/auto-patterns-guide.md +244 -64
- package/dist/docs/bulk_actions.md +10 -5
- package/dist/docs/collection_page.md +1 -1
- package/dist/docs/collection_page_actions.md +16 -9
- package/dist/docs/custom_overrides.md +21 -21
- package/dist/docs/entity_page.md +10 -10
- package/dist/docs/entity_page_actions.md +11 -4
- package/dist/docs/index.md +4 -0
- package/dist/docs/installation.md +3 -3
- package/dist/docs/resolved_action.md +6 -2
- package/dist/docs/wix_fqdn_custom_data_source.md +2 -2
- package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +2 -25
- package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +2 -2
- package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
- package/dist/esm/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js +29 -0
- package/dist/esm/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +2 -2
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +2 -2
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +1 -1
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js +5 -1
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
- package/dist/esm/components/ModalRenderer.js +2 -2
- package/dist/esm/components/ModalRenderer.js.map +1 -1
- package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js +4 -0
- package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
- package/dist/esm/hooks/index.js +0 -1
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/useAppContextSync.js +19 -0
- package/dist/esm/hooks/useAppContextSync.js.map +1 -0
- package/dist/esm/hooks/useAutoPatternsOptimisticActions.js +2 -2
- package/dist/esm/hooks/useAutoPatternsOptimisticActions.js.map +1 -1
- package/dist/esm/hooks/useBaseSDK.js +2 -2
- package/dist/esm/hooks/useBaseSDK.js.map +1 -1
- package/dist/esm/hooks/useColumns.js +2 -2
- package/dist/esm/hooks/useColumns.js.map +1 -1
- package/dist/esm/hooks/useEmptyStates.js +2 -2
- package/dist/esm/hooks/useEmptyStates.js.map +1 -1
- package/dist/esm/hooks/useEntityPageHeaderTexts.js +2 -2
- package/dist/esm/hooks/useEntityPageHeaderTexts.js.map +1 -1
- package/dist/esm/hooks/useFilters.js +2 -2
- package/dist/esm/hooks/useFilters.js.map +1 -1
- package/dist/esm/hooks/useGridFeatures.js +10 -2
- package/dist/esm/hooks/useGridFeatures.js.map +1 -1
- package/dist/esm/hooks/useTableFeatures.js +12 -4
- package/dist/esm/hooks/useTableFeatures.js.map +1 -1
- package/dist/esm/hooks/useTableGridSwitchFeatures.js +10 -2
- package/dist/esm/hooks/useTableGridSwitchFeatures.js.map +1 -1
- package/dist/esm/providers/AppContext.js +7 -5
- package/dist/esm/providers/AppContext.js.map +1 -1
- package/dist/esm/providers/AppContextData.js +26 -0
- package/dist/esm/providers/AppContextData.js.map +1 -0
- package/dist/esm/providers/AutoPatternsOverridesContext.js +19 -0
- package/dist/esm/providers/AutoPatternsOverridesContext.js.map +1 -0
- package/dist/esm/providers/ItemsContext.js +10 -7
- package/dist/esm/providers/ItemsContext.js.map +1 -1
- package/dist/esm/providers/SchemaContext.js +23 -6
- package/dist/esm/providers/SchemaContext.js.map +1 -1
- package/dist/esm/providers/index.js +2 -1
- package/dist/esm/providers/index.js.map +1 -1
- package/dist/esm/types/BaseSDK.js.map +1 -1
- package/dist/esm/types/CollectionPageConfig.js.map +1 -1
- package/dist/esm/types/EntityPageConfig.js.map +1 -1
- package/dist/esm/types/actions/actionCell.js.map +1 -1
- package/dist/esm/types/actions/base.js.map +1 -1
- package/dist/esm/types/actions/bulkActions.js.map +1 -1
- package/dist/esm/types/actions/collectionPageActions.js.map +1 -1
- package/dist/esm/types/actions/entityPageActions.js.map +1 -1
- package/dist/esm/types/fetchData.js.map +1 -1
- package/dist/esm/types/types.js.map +1 -1
- package/dist/esm/utils/actions/resolveAction.js +2 -1
- package/dist/esm/utils/actions/resolveAction.js.map +1 -1
- package/dist/esm/utils/actions/types.js.map +1 -1
- package/dist/esm/utils/vibe.js +6 -0
- package/dist/esm/utils/vibe.js.map +1 -0
- package/dist/types/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.d.ts +3 -0
- package/dist/types/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsRoute/AutoPatternsRoutes.d.ts.map +1 -1
- package/dist/types/dataSourceAdapters/cms/cmsAdapter.d.ts +2 -1
- package/dist/types/dataSourceAdapters/cms/cmsAdapter.d.ts.map +1 -1
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/useAppContextSync.d.ts +2 -0
- package/dist/types/hooks/useAppContextSync.d.ts.map +1 -0
- package/dist/types/hooks/useEntityPageHeaderTexts.d.ts.map +1 -1
- package/dist/types/hooks/useGridFeatures.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/providers/AppContext.d.ts +2 -2
- package/dist/types/providers/AppContext.d.ts.map +1 -1
- package/dist/types/providers/AppContextData.d.ts +13 -0
- package/dist/types/providers/AppContextData.d.ts.map +1 -0
- package/dist/types/providers/{PatternsWizardOverridesContext.d.ts → AutoPatternsOverridesContext.d.ts} +12 -4
- package/dist/types/providers/AutoPatternsOverridesContext.d.ts.map +1 -0
- package/dist/types/providers/ItemsContext.d.ts +6 -4
- package/dist/types/providers/ItemsContext.d.ts.map +1 -1
- package/dist/types/providers/SchemaContext.d.ts.map +1 -1
- package/dist/types/providers/index.d.ts +2 -1
- package/dist/types/providers/index.d.ts.map +1 -1
- package/dist/types/types/BaseSDK.d.ts +2 -2
- package/dist/types/types/BaseSDK.d.ts.map +1 -1
- package/dist/types/types/CollectionPageConfig.d.ts +315 -0
- package/dist/types/types/CollectionPageConfig.d.ts.map +1 -1
- package/dist/types/types/EntityPageConfig.d.ts +111 -0
- package/dist/types/types/EntityPageConfig.d.ts.map +1 -1
- package/dist/types/types/actions/actionCell.d.ts +41 -0
- package/dist/types/types/actions/actionCell.d.ts.map +1 -1
- package/dist/types/types/actions/base.d.ts +85 -0
- package/dist/types/types/actions/base.d.ts.map +1 -1
- package/dist/types/types/actions/bulkActions.d.ts +40 -0
- package/dist/types/types/actions/bulkActions.d.ts.map +1 -1
- package/dist/types/types/actions/collectionPageActions.d.ts +30 -0
- package/dist/types/types/actions/collectionPageActions.d.ts.map +1 -1
- package/dist/types/types/actions/entityPageActions.d.ts +25 -0
- package/dist/types/types/actions/entityPageActions.d.ts.map +1 -1
- package/dist/types/types/fetchData.d.ts +35 -0
- package/dist/types/types/fetchData.d.ts.map +1 -1
- package/dist/types/types/types.d.ts +114 -2
- package/dist/types/types/types.d.ts.map +1 -1
- package/dist/types/utils/actions/resolveAction.d.ts +1 -0
- package/dist/types/utils/actions/resolveAction.d.ts.map +1 -1
- package/dist/types/utils/actions/types.d.ts +1 -0
- package/dist/types/utils/actions/types.d.ts.map +1 -1
- package/dist/types/utils/vibe.d.ts +2 -0
- package/dist/types/utils/vibe.d.ts.map +1 -0
- package/package.json +10 -10
- package/dist/cjs/dataSourceAdapters/factory.js +0 -14
- package/dist/cjs/dataSourceAdapters/factory.js.map +0 -1
- package/dist/cjs/hooks/useUpdateAppContextItems.js +0 -18
- package/dist/cjs/hooks/useUpdateAppContextItems.js.map +0 -1
- package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +0 -1
- package/dist/esm/dataSourceAdapters/factory.js +0 -10
- package/dist/esm/dataSourceAdapters/factory.js.map +0 -1
- package/dist/esm/hooks/useUpdateAppContextItems.js +0 -13
- package/dist/esm/hooks/useUpdateAppContextItems.js.map +0 -1
- package/dist/esm/providers/PatternsWizardOverridesContext.js +0 -15
- package/dist/esm/providers/PatternsWizardOverridesContext.js.map +0 -1
- package/dist/types/dataSourceAdapters/factory.d.ts +0 -3
- package/dist/types/dataSourceAdapters/factory.d.ts.map +0 -1
- package/dist/types/hooks/useUpdateAppContextItems.d.ts +0 -2
- package/dist/types/hooks/useUpdateAppContextItems.d.ts.map +0 -1
- package/dist/types/providers/PatternsWizardOverridesContext.d.ts.map +0 -1
|
@@ -7,8 +7,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
7
7
|
var _page = require("@wix/patterns/page");
|
|
8
8
|
var _AutoPatternsCollectionPageContent = require("../AutoPatternsCollectionPageContent");
|
|
9
9
|
var _useCollectionPageActions = require("../../hooks/useCollectionPageActions");
|
|
10
|
-
var
|
|
11
|
-
var _providers = require("../../providers");
|
|
10
|
+
var _AutoPatternsCollectionPageFooter = require("../AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter");
|
|
12
11
|
var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.tsx";
|
|
13
12
|
const AutoPatternsCollectionPage = ({
|
|
14
13
|
configuration
|
|
@@ -17,68 +16,16 @@ const AutoPatternsCollectionPage = ({
|
|
|
17
16
|
title,
|
|
18
17
|
subtitle
|
|
19
18
|
} = configuration;
|
|
20
|
-
const {
|
|
21
|
-
layout
|
|
22
|
-
} = (0, _providers.useAppConfigContext)();
|
|
23
19
|
const actions = (0, _useCollectionPageActions.useCollectionPageActions)({
|
|
24
20
|
collectionPageActions: configuration.actions
|
|
25
21
|
});
|
|
26
|
-
|
|
27
|
-
// This is temporary until we have support on it on CollectionPage component of WixPatterns
|
|
28
|
-
if (layout === 'panel') {
|
|
29
|
-
return /*#__PURE__*/_react.default.createElement(_designSystem.SidePanel, {
|
|
30
|
-
skin: "floating",
|
|
31
|
-
width: "360px",
|
|
32
|
-
__self: void 0,
|
|
33
|
-
__source: {
|
|
34
|
-
fileName: _jsxFileName,
|
|
35
|
-
lineNumber: 26,
|
|
36
|
-
columnNumber: 7
|
|
37
|
-
}
|
|
38
|
-
}, /*#__PURE__*/_react.default.createElement(_designSystem.SidePanel.Header, {
|
|
39
|
-
title: "Manage Content",
|
|
40
|
-
__self: void 0,
|
|
41
|
-
__source: {
|
|
42
|
-
fileName: _jsxFileName,
|
|
43
|
-
lineNumber: 27,
|
|
44
|
-
columnNumber: 9
|
|
45
|
-
}
|
|
46
|
-
}), /*#__PURE__*/_react.default.createElement(_designSystem.SidePanel.Content, {
|
|
47
|
-
noPadding: true,
|
|
48
|
-
stretchVertically: true,
|
|
49
|
-
__self: void 0,
|
|
50
|
-
__source: {
|
|
51
|
-
fileName: _jsxFileName,
|
|
52
|
-
lineNumber: 28,
|
|
53
|
-
columnNumber: 9
|
|
54
|
-
}
|
|
55
|
-
}, /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
|
|
56
|
-
direction: "vertical",
|
|
57
|
-
width: "100%",
|
|
58
|
-
height: "490px",
|
|
59
|
-
__self: void 0,
|
|
60
|
-
__source: {
|
|
61
|
-
fileName: _jsxFileName,
|
|
62
|
-
lineNumber: 29,
|
|
63
|
-
columnNumber: 11
|
|
64
|
-
}
|
|
65
|
-
}, /*#__PURE__*/_react.default.createElement(_AutoPatternsCollectionPageContent.AutoPatternsCollectionPageContent, {
|
|
66
|
-
configuration: configuration,
|
|
67
|
-
__self: void 0,
|
|
68
|
-
__source: {
|
|
69
|
-
fileName: _jsxFileName,
|
|
70
|
-
lineNumber: 30,
|
|
71
|
-
columnNumber: 13
|
|
72
|
-
}
|
|
73
|
-
}))));
|
|
74
|
-
}
|
|
75
22
|
return /*#__PURE__*/_react.default.createElement(_page.CollectionPage, {
|
|
76
23
|
height: "100vh",
|
|
77
24
|
dataHook: "auto-patterns-page",
|
|
78
25
|
__self: void 0,
|
|
79
26
|
__source: {
|
|
80
27
|
fileName: _jsxFileName,
|
|
81
|
-
lineNumber:
|
|
28
|
+
lineNumber: 22,
|
|
82
29
|
columnNumber: 5
|
|
83
30
|
}
|
|
84
31
|
}, /*#__PURE__*/_react.default.createElement(_page.CollectionPage.Header, {
|
|
@@ -89,14 +36,14 @@ const AutoPatternsCollectionPage = ({
|
|
|
89
36
|
__self: void 0,
|
|
90
37
|
__source: {
|
|
91
38
|
fileName: _jsxFileName,
|
|
92
|
-
lineNumber:
|
|
39
|
+
lineNumber: 23,
|
|
93
40
|
columnNumber: 7
|
|
94
41
|
}
|
|
95
42
|
}), /*#__PURE__*/_react.default.createElement(_page.CollectionPage.Content, {
|
|
96
43
|
__self: void 0,
|
|
97
44
|
__source: {
|
|
98
45
|
fileName: _jsxFileName,
|
|
99
|
-
lineNumber:
|
|
46
|
+
lineNumber: 29,
|
|
100
47
|
columnNumber: 7
|
|
101
48
|
}
|
|
102
49
|
}, /*#__PURE__*/_react.default.createElement(_AutoPatternsCollectionPageContent.AutoPatternsCollectionPageContent, {
|
|
@@ -104,7 +51,21 @@ const AutoPatternsCollectionPage = ({
|
|
|
104
51
|
__self: void 0,
|
|
105
52
|
__source: {
|
|
106
53
|
fileName: _jsxFileName,
|
|
107
|
-
lineNumber:
|
|
54
|
+
lineNumber: 30,
|
|
55
|
+
columnNumber: 9
|
|
56
|
+
}
|
|
57
|
+
})), /*#__PURE__*/_react.default.createElement(_page.CollectionPage.Footer, {
|
|
58
|
+
__self: void 0,
|
|
59
|
+
__source: {
|
|
60
|
+
fileName: _jsxFileName,
|
|
61
|
+
lineNumber: 32,
|
|
62
|
+
columnNumber: 7
|
|
63
|
+
}
|
|
64
|
+
}, /*#__PURE__*/_react.default.createElement(_AutoPatternsCollectionPageFooter.AutoPatternsCollectionPageFooter, {
|
|
65
|
+
__self: void 0,
|
|
66
|
+
__source: {
|
|
67
|
+
fileName: _jsxFileName,
|
|
68
|
+
lineNumber: 33,
|
|
108
69
|
columnNumber: 9
|
|
109
70
|
}
|
|
110
71
|
})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_page","_AutoPatternsCollectionPageContent","_useCollectionPageActions","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_page","_AutoPatternsCollectionPageContent","_useCollectionPageActions","_AutoPatternsCollectionPageFooter","_jsxFileName","AutoPatternsCollectionPage","configuration","title","subtitle","actions","useCollectionPageActions","collectionPageActions","default","createElement","CollectionPage","height","dataHook","__self","__source","fileName","lineNumber","columnNumber","Header","primaryAction","primaryActions","secondaryActions","Content","AutoPatternsCollectionPageContent","Footer","AutoPatternsCollectionPageFooter","exports"],"sources":["../../../../src/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.tsx"],"sourcesContent":["import React from 'react';\nimport { CollectionPage } from '@wix/patterns/page';\nimport { AutoPatternsCollectionPageContent } from '../AutoPatternsCollectionPageContent';\nimport { CollectionPageConfig } from '../../types/CollectionPageConfig';\nimport { useCollectionPageActions } from '../../hooks/useCollectionPageActions';\nimport { AutoPatternsCollectionPageFooter } from '../AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter';\n\nexport interface AutoPatternsCollectionPageProps {\n configuration: CollectionPageConfig;\n}\n\nexport const AutoPatternsCollectionPage: React.FC<\n AutoPatternsCollectionPageProps\n> = ({ configuration }) => {\n const { title, subtitle } = configuration;\n\n const actions = useCollectionPageActions({\n collectionPageActions: configuration.actions,\n });\n\n return (\n <CollectionPage height=\"100vh\" dataHook=\"auto-patterns-page\">\n <CollectionPage.Header\n title={title}\n subtitle={subtitle}\n primaryAction={actions.primaryActions}\n secondaryActions={actions.secondaryActions}\n />\n <CollectionPage.Content>\n <AutoPatternsCollectionPageContent configuration={configuration} />\n </CollectionPage.Content>\n <CollectionPage.Footer>\n <AutoPatternsCollectionPageFooter />\n </CollectionPage.Footer>\n </CollectionPage>\n );\n};\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,kCAAA,GAAAF,OAAA;AAEA,IAAAG,yBAAA,GAAAH,OAAA;AACA,IAAAI,iCAAA,GAAAJ,OAAA;AAAwH,IAAAK,YAAA;AAMjH,MAAMC,0BAEZ,GAAGA,CAAC;EAAEC;AAAc,CAAC,KAAK;EACzB,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGF,aAAa;EAEzC,MAAMG,OAAO,GAAG,IAAAC,kDAAwB,EAAC;IACvCC,qBAAqB,EAAEL,aAAa,CAACG;EACvC,CAAC,CAAC;EAEF,oBACEZ,MAAA,CAAAe,OAAA,CAAAC,aAAA,CAACb,KAAA,CAAAc,cAAc;IAACC,MAAM,EAAC,OAAO;IAACC,QAAQ,EAAC,oBAAoB;IAAAC,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAf,YAAA;MAAAgB,UAAA;MAAAC,YAAA;IAAA;EAAA,gBAC1DxB,MAAA,CAAAe,OAAA,CAAAC,aAAA,CAACb,KAAA,CAAAc,cAAc,CAACQ,MAAM;IACpBf,KAAK,EAAEA,KAAM;IACbC,QAAQ,EAAEA,QAAS;IACnBe,aAAa,EAAEd,OAAO,CAACe,cAAe;IACtCC,gBAAgB,EAAEhB,OAAO,CAACgB,gBAAiB;IAAAR,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAf,YAAA;MAAAgB,UAAA;MAAAC,YAAA;IAAA;EAAA,CAC5C,CAAC,eACFxB,MAAA,CAAAe,OAAA,CAAAC,aAAA,CAACb,KAAA,CAAAc,cAAc,CAACY,OAAO;IAAAT,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAf,YAAA;MAAAgB,UAAA;MAAAC,YAAA;IAAA;EAAA,gBACrBxB,MAAA,CAAAe,OAAA,CAAAC,aAAA,CAACZ,kCAAA,CAAA0B,iCAAiC;IAACrB,aAAa,EAAEA,aAAc;IAAAW,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAf,YAAA;MAAAgB,UAAA;MAAAC,YAAA;IAAA;EAAA,CAAE,CAC5C,CAAC,eACzBxB,MAAA,CAAAe,OAAA,CAAAC,aAAA,CAACb,KAAA,CAAAc,cAAc,CAACc,MAAM;IAAAX,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAf,YAAA;MAAAgB,UAAA;MAAAC,YAAA;IAAA;EAAA,gBACpBxB,MAAA,CAAAe,OAAA,CAAAC,aAAA,CAACV,iCAAA,CAAA0B,gCAAgC;IAAAZ,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAf,YAAA;MAAAgB,UAAA;MAAAC,YAAA;IAAA;EAAA,CAAE,CACd,CACT,CAAC;AAErB,CAAC;AAACS,OAAA,CAAAzB,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js
CHANGED
|
@@ -13,7 +13,7 @@ const AutoPatternsCollectionPageContent = ({
|
|
|
13
13
|
const {
|
|
14
14
|
components
|
|
15
15
|
} = configuration;
|
|
16
|
-
const overrides = (0, _providers.
|
|
16
|
+
const overrides = (0, _providers.useAutoPatternsOverridesContext)();
|
|
17
17
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, components.map((component, index) => {
|
|
18
18
|
if (component.type === 'collection') {
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement(_AutoPatternsCollectionComponent.AutoPatternsCollectionComponent, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_providers","_AutoPatternsCollectionComponent","_jsxFileName","AutoPatternsCollectionPageContent","configuration","components","overrides","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_providers","_AutoPatternsCollectionComponent","_jsxFileName","AutoPatternsCollectionPageContent","configuration","components","overrides","useAutoPatternsOverridesContext","default","createElement","Fragment","map","component","index","type","AutoPatternsCollectionComponent","key","collection","collectionId","__self","__source","fileName","lineNumber","columnNumber","_overrides$slots","CustomComponent","slots","id","filter","Boolean","exports"],"sources":["../../../../src/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.tsx"],"sourcesContent":["import React from 'react';\nimport { CollectionPageConfig } from '../../types';\nimport { useAutoPatternsOverridesContext } from '../../providers';\nimport { AutoPatternsCollectionComponent } from '../AutoPatternsCollectionComponent/AutoPatternsCollectionComponent';\n\nexport interface AutoPatternsCollectionPageContentProps {\n configuration: CollectionPageConfig;\n}\n\nexport const AutoPatternsCollectionPageContent = ({\n configuration,\n}: AutoPatternsCollectionPageContentProps) => {\n const { components } = configuration;\n const overrides = useAutoPatternsOverridesContext();\n\n return (\n <>\n {components\n .map((component, index) => {\n if (component.type === 'collection') {\n return (\n <AutoPatternsCollectionComponent\n key={`collection-${component.collection.collectionId}-${index}`}\n component={component}\n index={index}\n />\n );\n } else if (component.type === 'custom') {\n const CustomComponent = overrides?.slots?.[component.id];\n\n if (!CustomComponent) {\n return null;\n }\n\n return <CustomComponent key={`custom-${component.id}-${index}`} />;\n }\n\n return null;\n })\n .filter(Boolean)}\n </>\n );\n};\n"],"mappings":";;;;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nB,YAAA;UAAAoB,UAAA;UAAAC,YAAA;QAAA;MAAA,CAAE,CAAC;IACpE;IAEA,OAAO,IAAI;EACb,CAAC,CAAC,CACDK,MAAM,CAACC,OAAO,CACjB,CAAC;AAEP,CAAC;AAACC,OAAA,CAAA3B,iCAAA,GAAAA,iCAAA","ignoreList":[]}
|
package/dist/cjs/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.AutoPatternsCollectionPageFooter = void 0;
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
var _patterns = require("@wix/patterns");
|
|
8
|
+
var _vibe = require("../../utils/vibe");
|
|
9
|
+
var _designSystem = require("@wix/design-system");
|
|
10
|
+
var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.tsx";
|
|
11
|
+
const WIX_DASHBOARD_BASE_URL = 'https://manage.wix.com/dashboard/';
|
|
12
|
+
const AutoPatternsCollectionPageFooter = () => {
|
|
13
|
+
const {
|
|
14
|
+
layoutType
|
|
15
|
+
} = (0, _patterns.useWixPatternsContainer)();
|
|
16
|
+
const isPanel = layoutType === 'panel';
|
|
17
|
+
const metasiteId = (0, _vibe.getMetasiteId)();
|
|
18
|
+
|
|
19
|
+
// Temporary solution - need to improve:
|
|
20
|
+
// 1. Not only CMS
|
|
21
|
+
// 2. Not only Panel
|
|
22
|
+
// 3. Translations
|
|
23
|
+
|
|
24
|
+
if (!isPanel) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
|
|
28
|
+
align: "center",
|
|
29
|
+
__self: void 0,
|
|
30
|
+
__source: {
|
|
31
|
+
fileName: _jsxFileName,
|
|
32
|
+
lineNumber: 23,
|
|
33
|
+
columnNumber: 5
|
|
34
|
+
}
|
|
35
|
+
}, /*#__PURE__*/_react.default.createElement(_designSystem.TextButton, {
|
|
36
|
+
onClick: () => {
|
|
37
|
+
window.open(`${WIX_DASHBOARD_BASE_URL}${metasiteId}/database`, '_blank');
|
|
38
|
+
},
|
|
39
|
+
__self: void 0,
|
|
40
|
+
__source: {
|
|
41
|
+
fileName: _jsxFileName,
|
|
42
|
+
lineNumber: 24,
|
|
43
|
+
columnNumber: 7
|
|
44
|
+
}
|
|
45
|
+
}, "Manage Items"));
|
|
46
|
+
};
|
|
47
|
+
exports.AutoPatternsCollectionPageFooter = AutoPatternsCollectionPageFooter;
|
|
48
|
+
//# sourceMappingURL=AutoPatternsCollectionPageFooter.js.map
|
package/dist/cjs/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_patterns","_vibe","_designSystem","_jsxFileName","WIX_DASHBOARD_BASE_URL","AutoPatternsCollectionPageFooter","layoutType","useWixPatternsContainer","isPanel","metasiteId","getMetasiteId","default","createElement","Box","align","__self","__source","fileName","lineNumber","columnNumber","TextButton","onClick","window","open","exports"],"sources":["../../../../src/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.tsx"],"sourcesContent":["import React from 'react';\nimport { useWixPatternsContainer } from '@wix/patterns';\nimport { getMetasiteId } from '../../utils/vibe';\nimport { Box, TextButton } from '@wix/design-system';\n\nconst WIX_DASHBOARD_BASE_URL = 'https://manage.wix.com/dashboard/';\n\nexport const AutoPatternsCollectionPageFooter = () => {\n const { layoutType } = useWixPatternsContainer();\n const isPanel = layoutType === 'panel';\n const metasiteId = getMetasiteId();\n\n // Temporary solution - need to improve:\n // 1. Not only CMS\n // 2. Not only Panel\n // 3. Translations\n\n if (!isPanel) {\n return null;\n }\n\n return (\n <Box align=\"center\">\n <TextButton\n onClick={() => {\n window.open(\n `${WIX_DASHBOARD_BASE_URL}${metasiteId}/database`,\n '_blank',\n );\n }}\n >\n Manage Items\n </TextButton>\n </Box>\n );\n};\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAAqD,IAAAI,YAAA;AAErD,MAAMC,sBAAsB,GAAG,mCAAmC;AAE3D,MAAMC,gCAAgC,GAAGA,CAAA,KAAM;EACpD,MAAM;IAAEC;EAAW,CAAC,GAAG,IAAAC,iCAAuB,EAAC,CAAC;EAChD,MAAMC,OAAO,GAAGF,UAAU,KAAK,OAAO;EACtC,MAAMG,UAAU,GAAG,IAAAC,mBAAa,EAAC,CAAC;;EAElC;EACA;EACA;EACA;;EAEA,IAAI,CAACF,OAAO,EAAE;IACZ,OAAO,IAAI;EACb;EAEA,oBACEX,MAAA,CAAAc,OAAA,CAAAC,aAAA,CAACV,aAAA,CAAAW,GAAG;IAACC,KAAK,EAAC,QAAQ;IAAAC,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAd,YAAA;MAAAe,UAAA;MAAAC,YAAA;IAAA;EAAA,gBACjBtB,MAAA,CAAAc,OAAA,CAAAC,aAAA,CAACV,aAAA,CAAAkB,UAAU;IACTC,OAAO,EAAEA,CAAA,KAAM;MACbC,MAAM,CAACC,IAAI,CACT,GAAGnB,sBAAsB,GAAGK,UAAU,WAAW,EACjD,QACF,CAAC;IACH,CAAE;IAAAM,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAd,YAAA;MAAAe,UAAA;MAAAC,YAAA;IAAA;EAAA,GACH,cAEW,CACT,CAAC;AAEV,CAAC;AAACK,OAAA,CAAAnB,gCAAA,GAAAA,gCAAA","ignoreList":[]}
|
|
@@ -20,7 +20,7 @@ const RenderLayoutContent = ({
|
|
|
20
20
|
}) => {
|
|
21
21
|
var _content$container$ch, _overrides$components;
|
|
22
22
|
const schema = (0, _SchemaContext.useSchema)();
|
|
23
|
-
const overrides = (0, _providers.
|
|
23
|
+
const overrides = (0, _providers.useAutoPatternsOverridesContext)();
|
|
24
24
|
const pageState = (0, _patterns.useEntityPageContext)();
|
|
25
25
|
const entity = pageState.entity;
|
|
26
26
|
switch (content.type) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_designSystem","_SchemaContext","_providers","_patterns","_FormFieldInput","_jsxFileName","RenderLayoutContent","content","level","sectionId","cardIndex","contentIndex","setInputRef","_content$container$ch","_overrides$components","schema","useSchema","overrides","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_designSystem","_SchemaContext","_providers","_patterns","_FormFieldInput","_jsxFileName","RenderLayoutContent","content","level","sectionId","cardIndex","contentIndex","setInputRef","_content$container$ch","_overrides$components","schema","useSchema","overrides","useAutoPatternsOverridesContext","pageState","useEntityPageContext","entity","type","field","fieldId","fields","default","createElement","Cell","span","__self","__source","fileName","lineNumber","columnNumber","FormFieldInput","key","inputRef","ref","container","children","length","Layout","map","child","index","component","componentId","Component","components","form","exports"],"sources":["../../../../../src/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.tsx"],"sourcesContent":["import React from 'react';\nimport { Cell, Layout } from '@wix/design-system';\nimport { useSchema } from '../../../providers/SchemaContext';\nimport { useAutoPatternsOverridesContext } from '../../../providers';\nimport { useEntityPageContext } from '@wix/patterns';\nimport { FormFieldInput } from '../Fields/FormFieldInput';\nimport { LayoutContent } from '../../../types';\nimport { BaseInputRef } from '../Fields/types';\n\nexport interface RenderLayoutContentProps {\n content: LayoutContent;\n level: number;\n sectionId: string;\n cardIndex: number;\n contentIndex: number;\n setInputRef: (id: string, input: BaseInputRef) => void;\n}\n\nexport const RenderLayoutContent: React.FC<RenderLayoutContentProps> = ({\n content,\n level,\n sectionId,\n cardIndex,\n contentIndex,\n setInputRef,\n}) => {\n const schema = useSchema();\n const overrides = useAutoPatternsOverridesContext();\n const pageState = useEntityPageContext();\n\n const entity = pageState.entity;\n\n switch (content.type) {\n case 'field':\n if (!content.field.fieldId) {\n return null;\n }\n\n const field = schema.fields[content.field.fieldId];\n if (!field) {\n return null;\n }\n\n return (\n <Cell span={content.field.span}>\n <FormFieldInput\n key={content.field.fieldId}\n field={field}\n inputRef={(ref) => setInputRef(content.field.fieldId, ref)}\n />\n </Cell>\n );\n\n case 'container':\n if (!content.container.children?.length) {\n return null;\n }\n\n return (\n <Cell span={content.container.span}>\n <Layout>\n {content.container.children.map((child, index) => (\n <RenderLayoutContent\n key={`${sectionId}-card-${cardIndex}-content-${contentIndex}-level-${level}-child-${index}`}\n content={child}\n level={level + 1}\n sectionId={sectionId}\n cardIndex={cardIndex}\n contentIndex={index}\n setInputRef={setInputRef}\n />\n ))}\n </Layout>\n </Cell>\n );\n\n case 'component':\n if (!content.component.componentId) {\n return null;\n }\n\n const Component = overrides?.components?.[content.component.componentId];\n if (!Component) {\n return null;\n }\n\n return (\n <Cell span={content.component.span}>\n <Component\n form={pageState?.form as any}\n entity={entity as Record<string, any>}\n />\n </Cell>\n );\n\n default:\n return null;\n }\n};\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AAA0D,IAAAM,YAAA;AAanD,MAAMC,mBAAuD,GAAGA,CAAC;EACtEC,OAAO;EACPC,KAAK;EACLC,SAAS;EACTC,SAAS;EACTC,YAAY;EACZC;AACF,CAAC,KAAK;EAAA,IAAAC,qBAAA,EAAAC,qBAAA;EACJ,MAAMC,MAAM,GAAG,IAAAC,wBAAS,EAAC,CAAC;EA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,CAACuC,SAAS,CAACjB,IAAK;QAAAC,MAAA;QAAAC,QAAA;UAAAC,QAAA,EAAA3B,YAAA;UAAA4B,UAAA;UAAAC,YAAA;QAAA;MAAA,gBACjCrC,MAAA,CAAA6B,OAAA,CAAAC,aAAA,CAACqB,SAAS;QACRE,IAAI,EAAE/B,SAAS,oBAATA,SAAS,CAAE+B,IAAY;QAC7B7B,MAAM,EAAEA,MAA8B;QAAAS,MAAA;QAAAC,QAAA;UAAAC,QAAA,EAAA3B,YAAA;UAAA4B,UAAA;UAAAC,YAAA;QAAA;MAAA,CACvC,CACG,CAAC;IAGX;MACE,OAAO,IAAI;EACf;AACF,CAAC;AAACiB,OAAA,CAAA7C,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js
CHANGED
|
@@ -20,7 +20,7 @@ const RenderViewLayoutContent = ({
|
|
|
20
20
|
}) => {
|
|
21
21
|
var _content$container$ch, _overrides$components;
|
|
22
22
|
const schema = (0, _SchemaContext.useSchema)();
|
|
23
|
-
const overrides = (0, _providers.
|
|
23
|
+
const overrides = (0, _providers.useAutoPatternsOverridesContext)();
|
|
24
24
|
switch (content.type) {
|
|
25
25
|
case 'field':
|
|
26
26
|
if (!content.field.fieldId) {
|
package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_designSystem","_SchemaContext","_providers","_RenderViewField","_jsxFileName","RenderViewLayoutContent","entity","content","level","sectionId","cardIndex","contentIndex","_content$container$ch","_overrides$components","schema","useSchema","overrides","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_designSystem","_SchemaContext","_providers","_RenderViewField","_jsxFileName","RenderViewLayoutContent","entity","content","level","sectionId","cardIndex","contentIndex","_content$container$ch","_overrides$components","schema","useSchema","overrides","useAutoPatternsOverridesContext","type","field","fieldId","fields","default","createElement","RenderViewField","span","__self","__source","fileName","lineNumber","columnNumber","container","children","length","Cell","Layout","map","child","index","key","component","componentId","Component","components","exports"],"sources":["../../../../../src/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.tsx"],"sourcesContent":["import React from 'react';\nimport { Cell, Layout } from '@wix/design-system';\nimport { useSchema } from '../../../providers/SchemaContext';\nimport { useAutoPatternsOverridesContext } from '../../../providers';\nimport { RenderViewField } from '../RenderLayout/RenderViewField';\nimport { RenderLayoutContentProps } from '../RenderLayout';\n\ninterface RenderViewLayoutContentProps\n extends Omit<RenderLayoutContentProps, 'setInputRef'> {\n entity: Record<string, any>;\n}\n\n// TODO: remove this component and use RenderLayoutContent instead\nexport const RenderViewLayoutContent: React.FC<\n RenderViewLayoutContentProps\n> = ({ entity, content, level, sectionId, cardIndex, contentIndex }) => {\n const schema = useSchema();\n const overrides = useAutoPatternsOverridesContext();\n\n switch (content.type) {\n case 'field':\n if (!content.field.fieldId) {\n return null;\n }\n\n const field = schema.fields[content.field.fieldId];\n if (!field) {\n return null;\n }\n\n return (\n <RenderViewField\n field={field}\n fieldId={content.field.fieldId}\n entity={entity}\n span={content.field.span}\n />\n );\n\n case 'container':\n if (!content.container.children?.length) {\n return null;\n }\n\n return (\n <Cell span={content.container.span}>\n <Layout>\n {content.container.children.map((child, index) => (\n <RenderViewLayoutContent\n key={`${sectionId}-card-${cardIndex}-content-${contentIndex}-level-${level}-child-${index}`}\n entity={entity}\n content={child}\n level={level + 1}\n sectionId={sectionId}\n cardIndex={cardIndex}\n contentIndex={index}\n />\n ))}\n </Layout>\n </Cell>\n );\n\n case 'component':\n if (!content.component.componentId) {\n return null;\n }\n\n const Component = overrides?.components?.[content.component.componentId];\n if (!Component) {\n return null;\n }\n\n return (\n <Cell span={content.component.span}>\n <Component entity={entity} />\n </Cell>\n );\n\n default:\n return null;\n }\n};\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CA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ACT,IAAI,EAAElB,OAAO,CAACiC,SAAS,CAACf,IAAK;QAAAC,MAAA;QAAAC,QAAA;UAAAC,QAAA,EAAAxB,YAAA;UAAAyB,UAAA;UAAAC,YAAA;QAAA;MAAA,gBACjCjC,MAAA,CAAAyB,OAAA,CAAAC,aAAA,CAACmB,SAAS;QAACpC,MAAM,EAAEA,MAAO;QAAAoB,MAAA;QAAAC,QAAA;UAAAC,QAAA,EAAAxB,YAAA;UAAAyB,UAAA;UAAAC,YAAA;QAAA;MAAA,CAAE,CACxB,CAAC;IAGX;MACE,OAAO,IAAI;EACf;AACF,CAAC;AAACc,OAAA,CAAAvC,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
@@ -8,6 +8,7 @@ var _hooks = require("../../hooks");
|
|
|
8
8
|
var _router = require("@wix/patterns/router");
|
|
9
9
|
var _AutoPatternsPage = require("./AutoPatternsPage");
|
|
10
10
|
var _reactRouterDom = require("react-router-dom");
|
|
11
|
+
var _patterns = require("@wix/patterns");
|
|
11
12
|
var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.tsx";
|
|
12
13
|
const pageTypeToRouteType = {
|
|
13
14
|
collectionPage: 'collection',
|
|
@@ -19,7 +20,10 @@ const AutoPatternsRoutes = ({
|
|
|
19
20
|
const {
|
|
20
21
|
getPagePath
|
|
21
22
|
} = (0, _hooks.usePagePath)(config);
|
|
22
|
-
|
|
23
|
+
const {
|
|
24
|
+
layoutType
|
|
25
|
+
} = (0, _patterns.useWixPatternsContainer)();
|
|
26
|
+
if (layoutType === 'panel') {
|
|
23
27
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, config.pages.map(page => {
|
|
24
28
|
return /*#__PURE__*/_react.default.createElement(_AutoPatternsPage.AutoPatternsPage, {
|
|
25
29
|
key: page.id,
|
|
@@ -27,7 +31,7 @@ const AutoPatternsRoutes = ({
|
|
|
27
31
|
__self: void 0,
|
|
28
32
|
__source: {
|
|
29
33
|
fileName: _jsxFileName,
|
|
30
|
-
lineNumber:
|
|
34
|
+
lineNumber: 23,
|
|
31
35
|
columnNumber: 18
|
|
32
36
|
}
|
|
33
37
|
});
|
|
@@ -48,14 +52,14 @@ const AutoPatternsRoutes = ({
|
|
|
48
52
|
__self: void 0,
|
|
49
53
|
__source: {
|
|
50
54
|
fileName: _jsxFileName,
|
|
51
|
-
lineNumber:
|
|
55
|
+
lineNumber: 44,
|
|
52
56
|
columnNumber: 20
|
|
53
57
|
}
|
|
54
58
|
}),
|
|
55
59
|
__self: void 0,
|
|
56
60
|
__source: {
|
|
57
61
|
fileName: _jsxFileName,
|
|
58
|
-
lineNumber:
|
|
62
|
+
lineNumber: 40,
|
|
59
63
|
columnNumber: 9
|
|
60
64
|
}
|
|
61
65
|
});
|
|
@@ -72,14 +76,14 @@ const AutoPatternsRoutes = ({
|
|
|
72
76
|
__self: void 0,
|
|
73
77
|
__source: {
|
|
74
78
|
fileName: _jsxFileName,
|
|
75
|
-
lineNumber:
|
|
79
|
+
lineNumber: 59,
|
|
76
80
|
columnNumber: 20
|
|
77
81
|
}
|
|
78
82
|
}),
|
|
79
83
|
__self: void 0,
|
|
80
84
|
__source: {
|
|
81
85
|
fileName: _jsxFileName,
|
|
82
|
-
lineNumber:
|
|
86
|
+
lineNumber: 55,
|
|
83
87
|
columnNumber: 9
|
|
84
88
|
}
|
|
85
89
|
}));
|
|
@@ -89,7 +93,7 @@ const AutoPatternsRoutes = ({
|
|
|
89
93
|
__self: void 0,
|
|
90
94
|
__source: {
|
|
91
95
|
fileName: _jsxFileName,
|
|
92
|
-
lineNumber:
|
|
96
|
+
lineNumber: 65,
|
|
93
97
|
columnNumber: 10
|
|
94
98
|
}
|
|
95
99
|
}, routes);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_hooks","_router","_AutoPatternsPage","_reactRouterDom","_jsxFileName","pageTypeToRouteType","collectionPage","entityPage","AutoPatternsRoutes","config","getPagePath","usePagePath","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_hooks","_router","_AutoPatternsPage","_reactRouterDom","_patterns","_jsxFileName","pageTypeToRouteType","collectionPage","entityPage","AutoPatternsRoutes","config","getPagePath","usePagePath","layoutType","useWixPatternsContainer","default","createElement","Fragment","pages","map","page","AutoPatternsPage","key","id","pageConfig","__self","__source","fileName","lineNumber","columnNumber","mainPage","find","appMainPage","routes","routePath","PatternsReactRoute","type","path","element","filter","Boolean","mainPagePath","push","Navigate","to","PatternsReactRouter","exports"],"sources":["../../../../src/components/AutoPatternsRoute/AutoPatternsRoutes.tsx"],"sourcesContent":["import React from 'react';\nimport { usePagePath } from '../../hooks';\nimport { PatternsReactRoute, PatternsReactRouter } from '@wix/patterns/router';\nimport { AutoPatternsPage } from './AutoPatternsPage';\nimport type { RouteType } from '@wix/patterns/dist/types/components/Router/types';\nimport { Navigate } from 'react-router-dom';\nimport { AppConfig } from '../../types';\nimport { useWixPatternsContainer } from '@wix/patterns';\n\nconst pageTypeToRouteType: Record<string, RouteType> = {\n collectionPage: 'collection',\n entityPage: 'editEntity',\n};\n\nexport const AutoPatternsRoutes = ({ config }: { config: AppConfig }) => {\n const { getPagePath } = usePagePath(config);\n const { layoutType } = useWixPatternsContainer();\n\n if (layoutType === 'panel') {\n return (\n <>\n {config.pages.map((page) => {\n return <AutoPatternsPage key={page.id} pageConfig={page} />;\n })}\n </>\n );\n }\n\n const mainPage = config.pages.find((page) => page.appMainPage);\n\n const routes = config.pages\n .map((page) => {\n const routePath = getPagePath(page.id);\n\n if (!routePath) {\n return null;\n }\n\n return (\n <PatternsReactRoute\n key={page.id}\n type={pageTypeToRouteType[page.type] ?? 'other'}\n path={routePath}\n element={<AutoPatternsPage pageConfig={page} />}\n />\n );\n })\n .filter(Boolean);\n\n if (mainPage) {\n const mainPagePath = getPagePath(mainPage.id);\n\n if (mainPagePath) {\n routes.push(\n <PatternsReactRoute\n key=\"main-redirect\"\n type=\"other\"\n path=\"/\"\n element={<Navigate to={mainPagePath} />}\n />,\n );\n }\n }\n\n return <PatternsReactRouter>{routes}</PatternsReactRouter>;\n};\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AAEA,IAAAK,SAAA,GAAAL,OAAA;AAAwD,IAAAM,YAAA;AAExD,MAAMC,mBAA8C,GAAG;EACrDC,cAAc,EAAE,YAAY;EAC5BC,UAAU,EAAE;AACd,CAAC;AAEM,MAAMC,kBAAkB,GAAGA,CAAC;EAAEC;AAA8B,CAAC,KAAK;EACvE,MAAM;IAAEC;EAAY,CAAC,GAAG,IAAAC,kBAAW,EAACF,MAAM,CAAC;EAC3C,MAAM;IAAEG;EAAW,CAAC,GAAG,IAAAC,iCAAuB,EAAC,CAAC;EAEhD,IAAID,UAAU,KAAK,OAAO,EAAE;IAC1B,oBACEhB,MAAA,CAAAkB,OAAA,CAAAC,aAAA,CAAAnB,MAAA,CAAAkB,OAAA,CAAAE,QAAA,QACGP,MAAM,CAACQ,KAAK,CAACC,GAAG,CAAEC,IAAI,IAAK;MAC1B,oBAAOvB,MAAA,CAAAkB,OAAA,CAAAC,aAAA,CAACd,iBAAA,CAAAmB,gBAAgB;QAACC,GAAG,EAAEF,IAAI,CAACG,EAAG;QAACC,UAAU,EAAEJ,IAAK;QAAAK,MAAA;QAAAC,QAAA;UAAAC,QAAA,EAAAtB,YAAA;UAAAuB,UAAA;UAAAC,YAAA;QAAA;MAAA,CAAE,CAAC;IAC7D,CAAC,CACD,CAAC;EAEP;EAEA,MAAMC,QAAQ,GAAGpB,MAAM,CAACQ,KAAK,CAACa,IAAI,CAAEX,IAAI,IAAKA,IAAI,CAACY,WAAW,CAAC;EAE9D,MAAMC,MAAM,GAA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YAAA;UAAA;QAAA,CAAE,CAAE;QAAAJ,MAAA;QAAAC,QAAA;UAAAC,QAAA,EAAAtB,YAAA;UAAAuB,UAAA;UAAAC,YAAA;QAAA;MAAA,CACzC,CACH,CAAC;IACH;EACF;EAEA,oBAAOhC,MAAA,CAAAkB,OAAA,CAAAC,aAAA,CAACf,OAAA,CAAA4C,mBAAmB;IAAApB,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAtB,YAAA;MAAAuB,UAAA;MAAAC,YAAA;IAAA;EAAA,GAAEI,MAA4B,CAAC;AAC5D,CAAC;AAACa,OAAA,CAAArC,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -17,7 +17,7 @@ const ModalRenderer = () => {
|
|
|
17
17
|
modal,
|
|
18
18
|
closeModal
|
|
19
19
|
} = (0, _ModalContext.useModalContext)();
|
|
20
|
-
const overrides = (0, _providers.
|
|
20
|
+
const overrides = (0, _providers.useAutoPatternsOverridesContext)();
|
|
21
21
|
if (!modal.id) {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","modals","_interopRequireWildcard","_ModalContext","_providers","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ModalRenderer","_overrides$modals","modal","closeModal","useModalContext","overrides","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","modals","_interopRequireWildcard","_ModalContext","_providers","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ModalRenderer","_overrides$modals","modal","closeModal","useModalContext","overrides","useAutoPatternsOverridesContext","id","ModalComponent","console","warn","createElement","_extends2","props","onClose","__self","__source","fileName","lineNumber","columnNumber","exports"],"sources":["../../../src/components/ModalRenderer.tsx"],"sourcesContent":["import React from 'react';\nimport * as modals from './modals';\nimport { useModalContext } from '../providers/ModalContext';\nimport { useAutoPatternsOverridesContext } from '../providers';\n\nexport const ModalRenderer = () => {\n const { modal, closeModal } = useModalContext();\n const overrides = useAutoPatternsOverridesContext();\n\n if (!modal.id) {\n return null;\n }\n\n const ModalComponent =\n overrides?.modals?.[modal.id] ||\n (modals as Record<string, React.ComponentType<any>>)[modal.id];\n\n if (!ModalComponent) {\n console.warn(`No modal registered for id: ${modal.id}`);\n return null;\n }\n\n return <ModalComponent {...modal.props} onClose={closeModal} />;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAA+D,IAAAK,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,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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AAA,CAAApB,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.CmsFieldTypeToPatternsFieldType = void 0;
|
|
5
5
|
exports.fetchCmsSchema = fetchCmsSchema;
|
|
6
|
+
exports.transformCmsSchema = transformCmsSchema;
|
|
6
7
|
var _data = require("@wix/data");
|
|
7
8
|
var _fetchCmsData = require("./fetchCmsData");
|
|
8
9
|
var _essentials = require("@wix/essentials");
|
|
@@ -24,6 +25,10 @@ const CmsFieldTypeToPatternsFieldType = exports.CmsFieldTypeToPatternsFieldType
|
|
|
24
25
|
};
|
|
25
26
|
async function fetchCmsSchema(collectionId) {
|
|
26
27
|
const schema = await _essentials.errorHandler.withErrorHandler(async () => _data.collections.getDataCollection(collectionId), {});
|
|
28
|
+
return schema;
|
|
29
|
+
}
|
|
30
|
+
function transformCmsSchema(schema) {
|
|
31
|
+
const collectionId = schema._id;
|
|
27
32
|
const transformedFields = (schema.fields || []).reduce((acc, field) => {
|
|
28
33
|
var _field$capabilities, _field$capabilities2, _field$typeMetadata;
|
|
29
34
|
if (!field.key) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_fetchCmsData","_essentials","CmsFieldTypeToPatternsFieldType","exports","collections","Type","TEXT","DATE","DATETIME","NUMBER","BOOLEAN","URL","ADDRESS","OBJECT","RICH_TEXT","RICH_CONTENT","ARRAY","ARRAY_STRING","REFERENCE","IMAGE","fetchCmsSchema","collectionId","schema","errorHandler","withErrorHandler","getDataCollection","transformedFields","fields","reduce","acc","field","_field$capabilities","_field$capabilities2","_field$typeMetadata","key","fieldType","type","baseField","id","displayName","validation","numberRange","min","undefined","max","stringLengthRange","minLength","maxLength","required","capabilities","supportedQueryOperators","queryOperators","sortable","typeMetadata","reference","referencedCollectionId","referenceField","referenceMetadata","nonReferenceType","nonReferenceField","schemaConfig","displayField","idField","actions","get","entityId","items","create","entity","insert","update","delete","remove","bulkDelete","entityIds","bulkRemove","find","query","options","fetchCmsData"],"sources":["../../../../src/dataSourceAdapters/cms/cmsAdapter.ts"],"sourcesContent":["import { Field, SchemaConfig, PatternsFieldType } from '../../types';\nimport { collections, items } from '@wix/data';\nimport { fetchCmsData } from './fetchCmsData';\nimport { errorHandler } from '@wix/essentials';\n\nexport const CmsFieldTypeToPatternsFieldType: Partial<\n Record<collections.Type, PatternsFieldType>\n> = {\n [collections.Type.TEXT]: 'SHORT_TEXT',\n [collections.Type.DATE]: 'DATE',\n [collections.Type.DATETIME]: 'DATETIME',\n [collections.Type.NUMBER]: 'NUMBER',\n [collections.Type.BOOLEAN]: 'BOOLEAN',\n [collections.Type.URL]: 'URL',\n [collections.Type.ADDRESS]: 'SHORT_TEXT',\n [collections.Type.OBJECT]: 'LONG_TEXT',\n [collections.Type.RICH_TEXT]: 'LONG_TEXT',\n [collections.Type.RICH_CONTENT]: 'SHORT_TEXT',\n [collections.Type.ARRAY]: 'ARRAY',\n [collections.Type.ARRAY_STRING]: 'ARRAY',\n [collections.Type.REFERENCE]: 'REFERENCE',\n [collections.Type.IMAGE]: 'IMAGE',\n};\n\nexport async function fetchCmsSchema(\n collectionId: string,\n): Promise<
|
|
1
|
+
{"version":3,"names":["_data","require","_fetchCmsData","_essentials","CmsFieldTypeToPatternsFieldType","exports","collections","Type","TEXT","DATE","DATETIME","NUMBER","BOOLEAN","URL","ADDRESS","OBJECT","RICH_TEXT","RICH_CONTENT","ARRAY","ARRAY_STRING","REFERENCE","IMAGE","fetchCmsSchema","collectionId","schema","errorHandler","withErrorHandler","getDataCollection","transformCmsSchema","_id","transformedFields","fields","reduce","acc","field","_field$capabilities","_field$capabilities2","_field$typeMetadata","key","fieldType","type","baseField","id","displayName","validation","numberRange","min","undefined","max","stringLengthRange","minLength","maxLength","required","capabilities","supportedQueryOperators","queryOperators","sortable","typeMetadata","reference","referencedCollectionId","referenceField","referenceMetadata","nonReferenceType","nonReferenceField","schemaConfig","displayField","idField","actions","get","entityId","items","create","entity","insert","update","delete","remove","bulkDelete","entityIds","bulkRemove","find","query","options","fetchCmsData"],"sources":["../../../../src/dataSourceAdapters/cms/cmsAdapter.ts"],"sourcesContent":["import { Field, SchemaConfig, PatternsFieldType } from '../../types';\nimport { collections, items } from '@wix/data';\nimport { fetchCmsData } from './fetchCmsData';\nimport { errorHandler } from '@wix/essentials';\n\nexport const CmsFieldTypeToPatternsFieldType: Partial<\n Record<collections.Type, PatternsFieldType>\n> = {\n [collections.Type.TEXT]: 'SHORT_TEXT',\n [collections.Type.DATE]: 'DATE',\n [collections.Type.DATETIME]: 'DATETIME',\n [collections.Type.NUMBER]: 'NUMBER',\n [collections.Type.BOOLEAN]: 'BOOLEAN',\n [collections.Type.URL]: 'URL',\n [collections.Type.ADDRESS]: 'SHORT_TEXT',\n [collections.Type.OBJECT]: 'LONG_TEXT',\n [collections.Type.RICH_TEXT]: 'LONG_TEXT',\n [collections.Type.RICH_CONTENT]: 'SHORT_TEXT',\n [collections.Type.ARRAY]: 'ARRAY',\n [collections.Type.ARRAY_STRING]: 'ARRAY',\n [collections.Type.REFERENCE]: 'REFERENCE',\n [collections.Type.IMAGE]: 'IMAGE',\n};\n\nexport async function fetchCmsSchema(\n collectionId: string,\n): Promise<collections.DataCollection> {\n const schema = await errorHandler.withErrorHandler(\n async () => collections.getDataCollection(collectionId),\n {},\n );\n return schema;\n}\n\nexport function transformCmsSchema(\n schema: collections.DataCollection,\n): SchemaConfig {\n const collectionId = schema._id as string;\n\n const transformedFields = (schema.fields || []).reduce<Record<string, Field>>(\n (acc, field) => {\n if (!field.key) {\n return acc;\n }\n\n const fieldType = field.type\n ? CmsFieldTypeToPatternsFieldType[field.type] || 'SHORT_TEXT'\n : 'SHORT_TEXT';\n const baseField = {\n id: field.key,\n displayName: field.displayName || '',\n validation: {\n numberRange: field.numberRange\n ? {\n min: field.numberRange.min ?? undefined,\n max: field.numberRange.max ?? undefined,\n }\n : undefined,\n stringLengthRange: field.stringLengthRange\n ? {\n minLength: field.stringLengthRange.minLength ?? undefined,\n maxLength: field.stringLengthRange.maxLength ?? undefined,\n }\n : undefined,\n required: field.required ?? false,\n },\n capabilities: {\n supportedQueryOperators: field.capabilities?.queryOperators || [],\n sortable: field.capabilities?.sortable || false,\n },\n };\n\n if (\n fieldType === 'REFERENCE' &&\n field.typeMetadata?.reference?.referencedCollectionId\n ) {\n const referenceField: Field = {\n ...baseField,\n type: 'REFERENCE',\n referenceMetadata: {\n referencedCollectionId:\n field.typeMetadata.reference.referencedCollectionId,\n },\n };\n acc[field.key] = referenceField;\n } else {\n const nonReferenceType =\n fieldType === 'REFERENCE' ? 'SHORT_TEXT' : fieldType;\n const nonReferenceField: Field = {\n ...baseField,\n type: nonReferenceType,\n };\n acc[field.key] = nonReferenceField;\n }\n\n return acc;\n },\n {},\n );\n\n const schemaConfig: SchemaConfig = {\n id: collectionId,\n displayField: schema.displayField ?? '_id',\n idField: '_id',\n fields: transformedFields,\n actions: {\n get: (entityId: string) => {\n return items.get(collectionId, entityId);\n },\n create: (entity) => {\n return items.insert(collectionId, entity);\n },\n update: (entity) => {\n return items.update(collectionId, entity);\n },\n delete: (entityId) => {\n return items.remove(collectionId, entityId);\n },\n bulkDelete: (entityIds) => {\n return items.bulkRemove(collectionId, entityIds);\n },\n find: async (\n query,\n options: {\n searchableFieldIds?: string[];\n filterFieldMapping?: Record<string, { fieldId: string }>;\n } = {},\n ) => {\n return fetchCmsData(collectionId, query, transformedFields, options);\n },\n },\n };\n\n return schemaConfig;\n}\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEO,MAAMG,+BAEZ,GAAAC,OAAA,CAAAD,+BAAA,GAAG;EACF,CAACE,iBAAW,CAACC,IAAI,CAACC,IAAI,GAAG,YAAY;EACrC,CAACF,iBAAW,CAACC,IAAI,CAACE,IAAI,GAAG,MAAM;EAC/B,CAACH,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AAO,CAAC;MACtE;IACF;EACF,CAAC;EAED,OAAOlB,YAAY;AACrB","ignoreList":[]}
|
package/dist/cjs/hooks/index.js
CHANGED
|
@@ -47,13 +47,6 @@ Object.keys(_useEntityPageHeaderTexts).forEach(function (key) {
|
|
|
47
47
|
if (key in exports && exports[key] === _useEntityPageHeaderTexts[key]) return;
|
|
48
48
|
exports[key] = _useEntityPageHeaderTexts[key];
|
|
49
49
|
});
|
|
50
|
-
var _useUpdateAppContextItems = require("./useUpdateAppContextItems");
|
|
51
|
-
Object.keys(_useUpdateAppContextItems).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] === _useUpdateAppContextItems[key]) return;
|
|
55
|
-
exports[key] = _useUpdateAppContextItems[key];
|
|
56
|
-
});
|
|
57
50
|
var _AppContext = require("../providers/AppContext");
|
|
58
51
|
exports.useAppContext = _AppContext.useAppContext;
|
|
59
52
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_useTableFeatures","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","_useFilters","_useGridFeatures","_useNavigationUtils","_usePagePath","_useEntityPageHeaderTexts","
|
|
1
|
+
{"version":3,"names":["_useTableFeatures","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","_useFilters","_useGridFeatures","_useNavigationUtils","_usePagePath","_useEntityPageHeaderTexts","_AppContext","useAppContext"],"sources":["../../../src/hooks/index.ts"],"sourcesContent":["export * from './useTableFeatures';\nexport * from './useFilters';\nexport * from './useGridFeatures';\nexport * from './useNavigationUtils';\nexport * from './usePagePath';\nexport * from './useEntityPageHeaderTexts';\nexport { useAppContext } from '../providers/AppContext';\n"],"mappings":";;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,iBAA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A,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAQ,mBAAA,CAAAR,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAQ,mBAAA,CAAAR,GAAA;AAAA;AACA,IAAAS,YAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,YAAA,EAAAV,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,MAAAS,YAAA,CAAAT,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAS,YAAA,CAAAT,GAAA;AAAA;AACA,IAAAU,yBAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,yBAAA,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,yBAAA,CAAAV,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAU,yBAAA,CAAAV,GAAA;AAAA;AACA,IAAAW,WAAA,GAAAf,OAAA;AAAwDS,OAAA,CAAAO,aAAA,GAAAD,WAAA,CAAAC,aAAA","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useAppContextSync = void 0;
|
|
5
|
+
var _react = require("react");
|
|
6
|
+
var _AppContextData = require("../providers/AppContextData");
|
|
7
|
+
const useAppContextSync = (items, refreshCollection) => {
|
|
8
|
+
const {
|
|
9
|
+
setItems,
|
|
10
|
+
setRefreshCollection
|
|
11
|
+
} = (0, _AppContextData.useAppContextData)();
|
|
12
|
+
(0, _react.useEffect)(() => {
|
|
13
|
+
if (items) {
|
|
14
|
+
setItems(items);
|
|
15
|
+
}
|
|
16
|
+
}, [items, setItems]);
|
|
17
|
+
(0, _react.useEffect)(() => {
|
|
18
|
+
if (refreshCollection) {
|
|
19
|
+
setRefreshCollection(refreshCollection);
|
|
20
|
+
}
|
|
21
|
+
}, [refreshCollection, setRefreshCollection]);
|
|
22
|
+
};
|
|
23
|
+
exports.useAppContextSync = useAppContextSync;
|
|
24
|
+
//# sourceMappingURL=useAppContextSync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_AppContextData","useAppContextSync","items","refreshCollection","setItems","setRefreshCollection","useAppContextData","useEffect","exports"],"sources":["../../../src/hooks/useAppContextSync.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport { useAppContextData } from '../providers/AppContextData';\n\nexport const useAppContextSync = (\n items: any[],\n refreshCollection: () => void,\n) => {\n const { setItems, setRefreshCollection } = useAppContextData();\n\n useEffect(() => {\n if (items) {\n setItems(items);\n }\n }, [items, setItems]);\n\n useEffect(() => {\n if (refreshCollection) {\n setRefreshCollection(refreshCollection);\n }\n }, [refreshCollection, setRefreshCollection]);\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEO,MAAME,iBAAiB,GAAGA,CAC/BC,KAAY,EACZC,iBAA6B,KAC1B;EACH,MAAM;IAAEC,QAAQ;IAAEC;EAAqB,CAAC,GAAG,IAAAC,iCAAiB,EAAC,CAAC;EAE9D,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAIL,KAAK,EAAE;MACTE,QAAQ,CAACF,KAAK,CAAC;IACjB;EACF,CAAC,EAAE,CAACA,KAAK,EAAEE,QAAQ,CAAC,CAAC;EAErB,IAAAG,gBAAS,EAAC,MAAM;IACd,IAAIJ,iBAAiB,EAAE;MACrBE,oBAAoB,CAACF,iBAAiB,CAAC;IACzC;EACF,CAAC,EAAE,CAACA,iBAAiB,EAAEE,oBAAoB,CAAC,CAAC;AAC/C,CAAC;AAACG,OAAA,CAAAP,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -5,7 +5,7 @@ exports.useAutoPatternsOptimisticActions = void 0;
|
|
|
5
5
|
var _patterns = require("@wix/patterns");
|
|
6
6
|
var _react = require("react");
|
|
7
7
|
var _OptimisticActionsContext = require("../providers/OptimisticActionsContext");
|
|
8
|
-
var
|
|
8
|
+
var _AutoPatternsOverridesContext = require("../providers/AutoPatternsOverridesContext");
|
|
9
9
|
const useAutoPatternsOptimisticActions = ({
|
|
10
10
|
collectionConfig,
|
|
11
11
|
collectionState
|
|
@@ -14,7 +14,7 @@ const useAutoPatternsOptimisticActions = ({
|
|
|
14
14
|
const {
|
|
15
15
|
registerOptimisticActions
|
|
16
16
|
} = (0, _OptimisticActionsContext.useOptimisticActionsContext)();
|
|
17
|
-
const overrides = (0,
|
|
17
|
+
const overrides = (0, _AutoPatternsOverridesContext.useAutoPatternsOverridesContext)();
|
|
18
18
|
const {
|
|
19
19
|
collectionId,
|
|
20
20
|
optimisticActions: optimisticActionsConfig
|