@wix/auto-patterns 1.23.0 → 1.24.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/AutoPatternsEntityPage/AutoPatternsEntityPage.js +12 -323
- package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/EditModeEntityPage.js +172 -0
- package/dist/cjs/components/AutoPatternsEntityPage/EditModeEntityPage.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js +78 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +119 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js +79 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/index.js +16 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/index.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js +77 -0
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +109 -0
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.js +196 -0
- package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/index.js +12 -0
- package/dist/cjs/components/AutoPatternsEntityPage/index.js.map +1 -1
- package/dist/cjs/hooks/useEntityPageActions.js +105 -0
- package/dist/cjs/hooks/useEntityPageActions.js.map +1 -0
- package/dist/cjs/hooks/useEntityPageMoreActions.js +10 -0
- package/dist/cjs/hooks/useEntityPageMoreActions.js.map +1 -1
- package/dist/cjs/hooks/useNavigateEditEntityAction.js +50 -0
- package/dist/cjs/hooks/useNavigateEditEntityAction.js.map +1 -0
- package/dist/cjs/hooks/useNavigationUtils.js +12 -1
- package/dist/cjs/hooks/useNavigationUtils.js.map +1 -1
- package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +1 -1
- package/dist/cjs/types/EntityPageConfig.js.map +1 -1
- package/dist/cjs/types/actions/entityPageActions.js.map +1 -1
- package/dist/cjs/utils/actions/types.js.map +1 -1
- package/dist/docs/action_cell.md +6 -2
- package/dist/docs/app_config_structure.md +49 -4
- package/dist/docs/auto-patterns-guide.md +305 -39
- package/dist/docs/bulk_actions.md +6 -2
- package/dist/docs/collection_page_actions.md +14 -4
- package/dist/docs/entity_page.md +65 -1
- package/dist/docs/entity_page_actions.md +13 -11
- package/dist/docs/entity_page_view_actions.md +137 -0
- package/dist/docs/index.md +6 -2
- package/dist/docs/pages_configuration.md +1 -11
- package/dist/docs/sdk_utilities.md +11 -4
- package/dist/docs/wix_fqdn_custom_data_source.md +25 -5
- package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +4 -3
- package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
- package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +2 -1
- package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +9 -196
- package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js +115 -0
- package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/Fields/DateInput.js +10 -6
- package/dist/esm/components/AutoPatternsEntityPage/Fields/DateInput.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/DateTime.js +23 -16
- package/dist/esm/components/AutoPatternsEntityPage/Fields/DateTime.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js +3 -2
- package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/ImageInput.js +9 -6
- package/dist/esm/components/AutoPatternsEntityPage/Fields/ImageInput.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/LongText.js +8 -6
- package/dist/esm/components/AutoPatternsEntityPage/Fields/LongText.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/Number.js +10 -8
- package/dist/esm/components/AutoPatternsEntityPage/Fields/Number.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/ShortText.js +12 -10
- package/dist/esm/components/AutoPatternsEntityPage/Fields/ShortText.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/Url.js +8 -6
- package/dist/esm/components/AutoPatternsEntityPage/Fields/Url.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js +33 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +70 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js +48 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/index.js +3 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/index.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/SkeletonEntity.js +7 -4
- package/dist/esm/components/AutoPatternsEntityPage/SkeletonEntity.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js +31 -0
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +66 -0
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js +109 -0
- package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/index.js +2 -0
- package/dist/esm/components/AutoPatternsEntityPage/index.js.map +1 -1
- package/dist/esm/components/ModalRenderer.js +2 -1
- package/dist/esm/components/ModalRenderer.js.map +1 -1
- package/dist/esm/components/modals/actions/BulkDeleteModal.js +12 -7
- package/dist/esm/components/modals/actions/BulkDeleteModal.js.map +1 -1
- package/dist/esm/components/modals/actions/CreateModal.js +11 -6
- package/dist/esm/components/modals/actions/CreateModal.js.map +1 -1
- package/dist/esm/components/modals/actions/EditModal.js +11 -6
- package/dist/esm/components/modals/actions/EditModal.js.map +1 -1
- package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js +4 -3
- package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
- package/dist/esm/dataSourceAdapters/cms/filterUtils.js +2 -1
- package/dist/esm/dataSourceAdapters/cms/filterUtils.js.map +1 -1
- package/dist/esm/dataSourceAdapters/cms/sortUtils.js +2 -2
- package/dist/esm/dataSourceAdapters/cms/sortUtils.js.map +1 -1
- package/dist/esm/hooks/useActionCell.js +12 -8
- package/dist/esm/hooks/useActionCell.js.map +1 -1
- package/dist/esm/hooks/useBaseTableFeatures.js +2 -1
- package/dist/esm/hooks/useBaseTableFeatures.js.map +1 -1
- package/dist/esm/hooks/useBulkActionToolbar.js +2 -2
- package/dist/esm/hooks/useBulkActionToolbar.js.map +1 -1
- package/dist/esm/hooks/useCollectionPageActions.js +3 -3
- package/dist/esm/hooks/useCollectionPageActions.js.map +1 -1
- package/dist/esm/hooks/useCollectionPageOnRowClickActions.js +1 -1
- package/dist/esm/hooks/useCollectionPageOnRowClickActions.js.map +1 -1
- package/dist/esm/hooks/useColumns.js +12 -7
- package/dist/esm/hooks/useColumns.js.map +1 -1
- package/dist/esm/hooks/useCommonCollectionFeatures.js +8 -7
- package/dist/esm/hooks/useCommonCollectionFeatures.js.map +1 -1
- package/dist/esm/hooks/useEmptyStates.js +6 -5
- package/dist/esm/hooks/useEmptyStates.js.map +1 -1
- package/dist/esm/hooks/useEntityPageActions.js +82 -0
- package/dist/esm/hooks/useEntityPageActions.js.map +1 -0
- package/dist/esm/hooks/useEntityPageMoreActions.js +11 -1
- package/dist/esm/hooks/useEntityPageMoreActions.js.map +1 -1
- package/dist/esm/hooks/useFilters.js +7 -7
- package/dist/esm/hooks/useFilters.js.map +1 -1
- package/dist/esm/hooks/useNavigateEditEntityAction.js +46 -0
- package/dist/esm/hooks/useNavigateEditEntityAction.js.map +1 -0
- package/dist/esm/hooks/useNavigationUtils.js +15 -3
- package/dist/esm/hooks/useNavigationUtils.js.map +1 -1
- package/dist/esm/hooks/usePagePath.js +4 -3
- package/dist/esm/hooks/usePagePath.js.map +1 -1
- package/dist/esm/hooks/useTableFeatures.js +2 -1
- package/dist/esm/hooks/useTableFeatures.js.map +1 -1
- package/dist/esm/providers/PatternsWizardOverridesContext.js.map +1 -1
- package/dist/esm/providers/SchemaContext.js +3 -2
- package/dist/esm/providers/SchemaContext.js.map +1 -1
- package/dist/esm/providers/SchemaRegistryContext.js +1 -1
- package/dist/esm/providers/SchemaRegistryContext.js.map +1 -1
- package/dist/esm/types/EntityPageConfig.js.map +1 -1
- package/dist/esm/types/actions/entityPageActions.js.map +1 -1
- package/dist/esm/utils/actions/customAction.js +2 -1
- package/dist/esm/utils/actions/customAction.js.map +1 -1
- package/dist/esm/utils/actions/deleteAction.js +10 -5
- package/dist/esm/utils/actions/deleteAction.js.map +1 -1
- package/dist/esm/utils/actions/types.js.map +1 -1
- package/dist/esm/utils/filterCreators.js +11 -11
- package/dist/esm/utils/filterCreators.js.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/AutoPatternsEntityPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/EditModeEntityPage.d.ts +6 -0
- package/dist/types/components/AutoPatternsEntityPage/EditModeEntityPage.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.d.ts +11 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.d.ts +13 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.d.ts +8 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/index.d.ts +3 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/index.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.d.ts +8 -0
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts +8 -0
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/ViewModeEntityPage.d.ts +8 -0
- package/dist/types/components/AutoPatternsEntityPage/ViewModeEntityPage.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/index.d.ts +2 -0
- package/dist/types/components/AutoPatternsEntityPage/index.d.ts.map +1 -1
- package/dist/types/hooks/useEntityPageActions.d.ts +9 -0
- package/dist/types/hooks/useEntityPageActions.d.ts.map +1 -0
- package/dist/types/hooks/useEntityPageHeaderTexts.d.ts.map +1 -1
- package/dist/types/hooks/useEntityPageMoreActions.d.ts +2 -2
- package/dist/types/hooks/useEntityPageMoreActions.d.ts.map +1 -1
- package/dist/types/hooks/useNavigateEditEntityAction.d.ts +6 -0
- package/dist/types/hooks/useNavigateEditEntityAction.d.ts.map +1 -0
- package/dist/types/hooks/useNavigationUtils.d.ts +1 -0
- package/dist/types/hooks/useNavigationUtils.d.ts.map +1 -1
- package/dist/types/providers/PatternsWizardOverridesContext.d.ts +2 -2
- package/dist/types/providers/PatternsWizardOverridesContext.d.ts.map +1 -1
- package/dist/types/types/EntityPageConfig.d.ts +20 -4
- package/dist/types/types/EntityPageConfig.d.ts.map +1 -1
- package/dist/types/types/actions/entityPageActions.d.ts +24 -5
- package/dist/types/types/actions/entityPageActions.d.ts.map +1 -1
- package/dist/types/utils/actions/types.d.ts +1 -1
- package/dist/types/utils/actions/types.d.ts.map +1 -1
- package/package.json +15 -15
- package/dist/docs/config_schema.md +0 -184
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useMemo","useAppConfigContext","useNavigateEditEntityAction","_ref","_configuration$action3","displayName","configuration","appConfig","editPageId","editPage","pages","find","page","type","entityPage","collectionId","mode","id","_configuration$action2","_configuration$action","actions","moreActions","navigateToEditAction","label","update"],"sources":["../../../src/hooks/useNavigateEditEntityAction.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { UpdateActionConfig, ViewEntityPageConfig } from '../types';\nimport { useAppConfigContext } from '../providers';\n\nexport const useNavigateEditEntityAction = ({\n displayName,\n configuration,\n}: {\n displayName: string;\n configuration: ViewEntityPageConfig;\n}) => {\n const appConfig = useAppConfigContext();\n\n const editPageId = useMemo(() => {\n // Find edit page by matching collectionId and looking for edit mode\n const editPage = appConfig.pages.find((page) => {\n if (page.type !== 'entityPage') {\n return false;\n }\n\n const entityPage = page.entityPage;\n // Check if same collection and is edit mode (either no mode specified or mode: 'edit')\n return (\n entityPage.collectionId === configuration.collectionId &&\n (!entityPage.mode || entityPage.mode === 'edit')\n );\n });\n\n return editPage?.id;\n }, [appConfig.pages, configuration.collectionId]);\n\n return useMemo(() => {\n // Don't show edit action if no edit page is found\n if (!editPageId) {\n return configuration.actions?.moreActions || [];\n }\n\n const navigateToEditAction: UpdateActionConfig = {\n id: 'navigate-to-edit',\n label: `Edit ${displayName}`,\n type: 'update',\n update: {\n mode: 'page',\n page: {\n id: editPageId,\n },\n },\n };\n\n if (!configuration.actions?.moreActions) {\n return [navigateToEditAction];\n }\n return [navigateToEditAction, ...configuration.actions.moreActions];\n }, [configuration.actions?.moreActions, displayName, editPageId]);\n};\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAE/B,SAASC,mBAAmB,QAAQ,cAAc;AAElD,OAAO,MAAMC,2BAA2B,GAAGC,IAAA,IAMrC;EAAA,IAAAC,sBAAA;EAAA,IANsC;IAC1CC,WAAW;IACXC;EAIF,CAAC,GAAAH,IAAA;EACC,MAAMI,SAAS,GAAGN,mBAAmB,CAAC,CAAC;EAEvC,MAAMO,UAAU,GAAGR,OAAO,CAAC,MAAM;IAC/B;IACA,MAAMS,QAAQ,GAAGF,SAAS,CAACG,KAAK,CAACC,IAAI,CAAEC,IAAI,IAAK;MAC9C,IAAIA,IAAI,CAACC,IAAI,KAAK,YAAY,EAAE;QAC9B,OAAO,KAAK;MACd;MAEA,MAAMC,UAAU,GAAGF,IAAI,CAACE,UAAU;MAClC;MACA,OACEA,UAAU,CAACC,YAAY,KAAKT,aAAa,CAACS,YAAY,KACrD,CAACD,UAAU,CAACE,IAAI,IAAIF,UAAU,CAACE,IAAI,KAAK,MAAM,CAAC;IAEpD,CAAC,CAAC;IAEF,OAAOP,QAAQ,oBAARA,QAAQ,CAAEQ,EAAE;EACrB,CAAC,EAAE,CAACV,SAAS,CAACG,KAAK,EAAEJ,aAAa,CAACS,YAAY,CAAC,CAAC;EAEjD,OAAOf,OAAO,CAAC,MAAM;IAAA,IAAAkB,sBAAA;IACnB;IACA,IAAI,CAACV,UAAU,EAAE;MAAA,IAAAW,qBAAA;MACf,OAAO,EAAAA,qBAAA,GAAAb,aAAa,CAACc,OAAO,qBAArBD,qBAAA,CAAuBE,WAAW,KAAI,EAAE;IACjD;IAEA,MAAMC,oBAAwC,GAAG;MAC/CL,EAAE,EAAE,kBAAkB;MACtBM,KAAK,EAAE,QAAQlB,WAAW,EAAE;MAC5BQ,IAAI,EAAE,QAAQ;MACdW,MAAM,EAAE;QACNR,IAAI,EAAE,MAAM;QACZJ,IAAI,EAAE;UACJK,EAAE,EAAET;QACN;MACF;IACF,CAAC;IAED,IAAI,GAAAU,sBAAA,GAACZ,aAAa,CAACc,OAAO,aAArBF,sBAAA,CAAuBG,WAAW,GAAE;MACvC,OAAO,CAACC,oBAAoB,CAAC;IAC/B;IACA,OAAO,CAACA,oBAAoB,EAAE,GAAGhB,aAAa,CAACc,OAAO,CAACC,WAAW,CAAC;EACrE,CAAC,EAAE,EAAAjB,sBAAA,GAACE,aAAa,CAACc,OAAO,qBAArBhB,sBAAA,CAAuBiB,WAAW,EAAEhB,WAAW,EAAEG,UAAU,CAAC,CAAC;AACnE,CAAC","ignoreList":[]}
|
|
@@ -5,7 +5,8 @@ import { generatePath } from 'react-router-dom';
|
|
|
5
5
|
import { usePagePath } from './usePagePath';
|
|
6
6
|
export const useNavigation = () => {
|
|
7
7
|
const {
|
|
8
|
-
navigateToEntityPage: navigateToEntityPagePatterns
|
|
8
|
+
navigateToEntityPage: navigateToEntityPagePatterns,
|
|
9
|
+
navigateToCollectionPage: navigateToCollectionPagePatterns
|
|
9
10
|
} = usePatternsNavigate();
|
|
10
11
|
const appConfig = useAppConfigContext();
|
|
11
12
|
const {
|
|
@@ -15,6 +16,7 @@ export const useNavigation = () => {
|
|
|
15
16
|
getPagePath
|
|
16
17
|
} = usePagePath(appConfig);
|
|
17
18
|
const navigateToEntityPage = useCallback(_ref => {
|
|
19
|
+
var _route$params;
|
|
18
20
|
let {
|
|
19
21
|
item,
|
|
20
22
|
entityPageId
|
|
@@ -28,9 +30,9 @@ export const useNavigation = () => {
|
|
|
28
30
|
collectionId
|
|
29
31
|
} = entityPage.entityPage;
|
|
30
32
|
const schema = getSchema(collectionId);
|
|
31
|
-
if (route.path && route.params
|
|
33
|
+
if (route.path && (_route$params = route.params) != null && _route$params.id && schema) {
|
|
32
34
|
const path = generatePath(route.path, {
|
|
33
|
-
[route.params.id]: item
|
|
35
|
+
[route.params.id]: (item == null ? void 0 : item[schema.idField]) ?? ''
|
|
34
36
|
});
|
|
35
37
|
navigateToEntityPagePatterns({
|
|
36
38
|
path,
|
|
@@ -38,11 +40,21 @@ export const useNavigation = () => {
|
|
|
38
40
|
});
|
|
39
41
|
}
|
|
40
42
|
}, [appConfig, navigateToEntityPagePatterns, getSchema]);
|
|
43
|
+
const navigateToCollectionPage = useCallback(parentPageId => {
|
|
44
|
+
const parentPagePath = getPagePath(parentPageId);
|
|
45
|
+
if (!parentPagePath) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
navigateToCollectionPagePatterns({
|
|
49
|
+
path: parentPagePath
|
|
50
|
+
});
|
|
51
|
+
}, [navigateToCollectionPagePatterns, getPagePath]);
|
|
41
52
|
const getParentPagePath = useCallback(parentPageId => {
|
|
42
53
|
return getPagePath(parentPageId);
|
|
43
54
|
}, [getPagePath]);
|
|
44
55
|
return {
|
|
45
56
|
navigateToEntityPage,
|
|
57
|
+
navigateToCollectionPage,
|
|
46
58
|
getParentPagePath,
|
|
47
59
|
getPagePath
|
|
48
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","usePatternsNavigate","useAppConfigContext","useSchemaRegistry","generatePath","usePagePath","useNavigation","navigateToEntityPage","navigateToEntityPagePatterns","appConfig","getSchema","getPagePath","_ref","item","entityPageId","entityPage","pages","find","page","id","route","collectionId","schema","path","params","idField","entity","
|
|
1
|
+
{"version":3,"names":["useCallback","usePatternsNavigate","useAppConfigContext","useSchemaRegistry","generatePath","usePagePath","useNavigation","navigateToEntityPage","navigateToEntityPagePatterns","navigateToCollectionPage","navigateToCollectionPagePatterns","appConfig","getSchema","getPagePath","_ref","_route$params","item","entityPageId","entityPage","pages","find","page","id","route","collectionId","schema","path","params","idField","entity","parentPageId","parentPagePath","getParentPagePath"],"sources":["../../../src/hooks/useNavigationUtils.tsx"],"sourcesContent":["import { useCallback } from 'react';\nimport { usePatternsNavigate } from '@wix/patterns/router';\nimport { useAppConfigContext, useSchemaRegistry } from '../providers';\nimport { generatePath } from 'react-router-dom';\nimport { EntityPageConfig } from '../types';\nimport { usePagePath } from './usePagePath';\n\nexport type NavigateToEntityPageFunc = (args: {\n item: any;\n entityPageId?: string;\n}) => void;\n\nexport const useNavigation = () => {\n const {\n navigateToEntityPage: navigateToEntityPagePatterns,\n navigateToCollectionPage: navigateToCollectionPagePatterns,\n } = usePatternsNavigate();\n const appConfig = useAppConfigContext();\n const { getSchema } = useSchemaRegistry();\n const { getPagePath } = usePagePath(appConfig);\n\n const navigateToEntityPage = useCallback(\n ({ item, entityPageId }) => {\n const entityPage = entityPageId\n ? appConfig.pages.find((page) => page.id === entityPageId)\n : null;\n\n if (!entityPage) {\n return;\n }\n\n const { route, collectionId } = entityPage.entityPage as EntityPageConfig;\n const schema = getSchema(collectionId);\n if (route.path && route.params?.id && schema) {\n const path = generatePath(route.path, {\n [route.params.id]: item?.[schema.idField] ?? '',\n });\n navigateToEntityPagePatterns({\n path,\n entity: item,\n });\n }\n },\n [appConfig, navigateToEntityPagePatterns, getSchema],\n );\n\n const navigateToCollectionPage = useCallback(\n (parentPageId: string) => {\n const parentPagePath = getPagePath(parentPageId);\n if (!parentPagePath) {\n return;\n }\n navigateToCollectionPagePatterns({\n path: parentPagePath,\n });\n },\n [navigateToCollectionPagePatterns, getPagePath],\n );\n\n const getParentPagePath = useCallback(\n (parentPageId?: string): string | undefined => {\n return getPagePath(parentPageId);\n },\n [getPagePath],\n );\n\n return {\n navigateToEntityPage,\n navigateToCollectionPage,\n getParentPagePath,\n getPagePath,\n };\n};\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,mBAAmB,QAAQ,sBAAsB;AAC1D,SAASC,mBAAmB,EAAEC,iBAAiB,QAAQ,cAAc;AACrE,SAASC,YAAY,QAAQ,kBAAkB;AAE/C,SAASC,WAAW,QAAQ,eAAe;AAO3C,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM;IACJC,oBAAoB,EAAEC,4BAA4B;IAClDC,wBAAwB,EAAEC;EAC5B,CAAC,GAAGT,mBAAmB,CAAC,CAAC;EACzB,MAAMU,SAAS,GAAGT,mBAAmB,CAAC,CAAC;EACvC,MAAM;IAAEU;EAAU,CAAC,GAAGT,iBAAiB,CAAC,CAAC;EACzC,MAAM;IAAEU;EAAY,CAAC,GAAGR,WAAW,CAACM,SAAS,CAAC;EAE9C,MAAMJ,oBAAoB,GAAGP,WAAW,CACtCc,IAAA,IAA4B;IAAA,IAAAC,aAAA;IAAA,IAA3B;MAAEC,IAAI;MAAEC;IAAa,CAAC,GAAAH,IAAA;IACrB,MAAMI,UAAU,GAAGD,YAAY,GAC3BN,SAAS,CAACQ,KAAK,CAACC,IAAI,CAAEC,IAAI,IAAKA,IAAI,CAACC,EAAE,KAAKL,YAAY,CAAC,GACxD,IAAI;IAER,IAAI,CAACC,UAAU,EAAE;MACf;IACF;IAEA,MAAM;MAAEK,KAAK;MAAEC;IAAa,CAAC,GAAGN,UAAU,CAACA,UAA8B;IACzE,MAAMO,MAAM,GAAGb,SAAS,CAACY,YAAY,CAAC;IACtC,IAAID,KAAK,CAACG,IAAI,KAAAX,aAAA,GAAIQ,KAAK,CAACI,MAAM,aAAZZ,aAAA,CAAcO,EAAE,IAAIG,MAAM,EAAE;MAC5C,MAAMC,IAAI,GAAGtB,YAAY,CAACmB,KAAK,CAACG,IAAI,EAAE;QACpC,CAACH,KAAK,CAACI,MAAM,CAACL,EAAE,GAAG,CAAAN,IAAI,oBAAJA,IAAI,CAAGS,MAAM,CAACG,OAAO,CAAC,KAAI;MAC/C,CAAC,CAAC;MACFpB,4BAA4B,CAAC;QAC3BkB,IAAI;QACJG,MAAM,EAAEb;MACV,CAAC,CAAC;IACJ;EACF,CAAC,EACD,CAACL,SAAS,EAAEH,4BAA4B,EAAEI,SAAS,CACrD,CAAC;EAED,MAAMH,wBAAwB,GAAGT,WAAW,CACzC8B,YAAoB,IAAK;IACxB,MAAMC,cAAc,GAAGlB,WAAW,CAACiB,YAAY,CAAC;IAChD,IAAI,CAACC,cAAc,EAAE;MACnB;IACF;IACArB,gCAAgC,CAAC;MAC/BgB,IAAI,EAAEK;IACR,CAAC,CAAC;EACJ,CAAC,EACD,CAACrB,gCAAgC,EAAEG,WAAW,CAChD,CAAC;EAED,MAAMmB,iBAAiB,GAAGhC,WAAW,CAClC8B,YAAqB,IAAyB;IAC7C,OAAOjB,WAAW,CAACiB,YAAY,CAAC;EAClC,CAAC,EACD,CAACjB,WAAW,CACd,CAAC;EAED,OAAO;IACLN,oBAAoB;IACpBE,wBAAwB;IACxBuB,iBAAiB;IACjBnB;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
export const usePagePath = configuration => {
|
|
3
3
|
const getPagePath = useCallback(pageId => {
|
|
4
|
+
var _currentPage$collecti, _currentPage$entityPa;
|
|
4
5
|
if (!pageId) {
|
|
5
6
|
return '/';
|
|
6
7
|
}
|
|
7
8
|
const currentPage = configuration.pages.find(page => page.id === pageId);
|
|
8
9
|
let path;
|
|
9
|
-
switch (currentPage
|
|
10
|
+
switch (currentPage == null ? void 0 : currentPage.type) {
|
|
10
11
|
case 'collectionPage':
|
|
11
|
-
path = currentPage.collectionPage
|
|
12
|
+
path = (_currentPage$collecti = currentPage.collectionPage) == null ? void 0 : _currentPage$collecti.route.path;
|
|
12
13
|
break;
|
|
13
14
|
case 'entityPage':
|
|
14
|
-
path = `${currentPage.entityPage
|
|
15
|
+
path = `${(_currentPage$entityPa = currentPage.entityPage) == null ? void 0 : _currentPage$entityPa.route.path}?`;
|
|
15
16
|
break;
|
|
16
17
|
default:
|
|
17
18
|
path = undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","usePagePath","configuration","getPagePath","pageId","currentPage","pages","find","page","id","path","type","collectionPage","route","entityPage","undefined","process","env","NODE_ENV"],"sources":["../../../src/hooks/usePagePath.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { AppConfig } from '../types';\n\nexport const usePagePath = (configuration: AppConfig) => {\n const getPagePath = useCallback(\n (pageId?: string) => {\n if (!pageId) {\n return '/';\n }\n\n const currentPage = configuration.pages.find(\n (page) => page.id === pageId,\n );\n\n let path;\n switch (currentPage?.type) {\n case 'collectionPage':\n path = currentPage.collectionPage?.route.path;\n break;\n case 'entityPage':\n path = `${currentPage.entityPage?.route.path}?`;\n break;\n default:\n path = undefined;\n }\n\n if (process.env.NODE_ENV === 'test') {\n // in test mode we sometime override pages so we need to return the path or '/'\n return path || '/';\n }\n\n return path;\n },\n [configuration],\n );\n\n return { getPagePath };\n};\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAO;AAGnC,OAAO,MAAMC,WAAW,GAAIC,aAAwB,IAAK;EACvD,MAAMC,WAAW,GAAGH,WAAW,CAC5BI,MAAe,IAAK;IACnB,IAAI,
|
|
1
|
+
{"version":3,"names":["useCallback","usePagePath","configuration","getPagePath","pageId","_currentPage$collecti","_currentPage$entityPa","currentPage","pages","find","page","id","path","type","collectionPage","route","entityPage","undefined","process","env","NODE_ENV"],"sources":["../../../src/hooks/usePagePath.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { AppConfig } from '../types';\n\nexport const usePagePath = (configuration: AppConfig) => {\n const getPagePath = useCallback(\n (pageId?: string) => {\n if (!pageId) {\n return '/';\n }\n\n const currentPage = configuration.pages.find(\n (page) => page.id === pageId,\n );\n\n let path;\n switch (currentPage?.type) {\n case 'collectionPage':\n path = currentPage.collectionPage?.route.path;\n break;\n case 'entityPage':\n path = `${currentPage.entityPage?.route.path}?`;\n break;\n default:\n path = undefined;\n }\n\n if (process.env.NODE_ENV === 'test') {\n // in test mode we sometime override pages so we need to return the path or '/'\n return path || '/';\n }\n\n return path;\n },\n [configuration],\n );\n\n return { getPagePath };\n};\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAO;AAGnC,OAAO,MAAMC,WAAW,GAAIC,aAAwB,IAAK;EACvD,MAAMC,WAAW,GAAGH,WAAW,CAC5BI,MAAe,IAAK;IAAA,IAAAC,qBAAA,EAAAC,qBAAA;IACnB,IAAI,CAACF,MAAM,EAAE;MACX,OAAO,GAAG;IACZ;IAEA,MAAMG,WAAW,GAAGL,aAAa,CAACM,KAAK,CAACC,IAAI,CACzCC,IAAI,IAAKA,IAAI,CAACC,EAAE,KAAKP,MACxB,CAAC;IAED,IAAIQ,IAAI;IACR,QAAQL,WAAW,oBAAXA,WAAW,CAAEM,IAAI;MACvB,KAAK,gBAAgB;QACnBD,IAAI,IAAAP,qBAAA,GAAGE,WAAW,CAACO,cAAc,qBAA1BT,qBAAA,CAA4BU,KAAK,CAACH,IAAI;QAC7C;MACF,KAAK,YAAY;QACfA,IAAI,GAAG,IAAAN,qBAAA,GAAGC,WAAW,CAACS,UAAU,qBAAtBV,qBAAA,CAAwBS,KAAK,CAACH,IAAI,GAAG;QAC/C;MACF;QACEA,IAAI,GAAGK,SAAS;IACpB;IAEA,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,MAAM,EAAE;MACnC;MACA,OAAOR,IAAI,IAAI,GAAG;IACpB;IAEA,OAAOA,IAAI;EACb,CAAC,EACD,CAACV,aAAa,CAChB,CAAC;EAED,OAAO;IAAEC;EAAY,CAAC;AACxB,CAAC","ignoreList":[]}
|
|
@@ -7,6 +7,7 @@ import { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticAct
|
|
|
7
7
|
import { useBaseTableFeatures } from './useBaseTableFeatures';
|
|
8
8
|
import { usePatternsWizardOverridesContext } from '../providers/PatternsWizardOverridesContext';
|
|
9
9
|
export const useTableFeatures = configuration => {
|
|
10
|
+
var _configuration$sectio, _overrides$sections;
|
|
10
11
|
const {
|
|
11
12
|
collectionId,
|
|
12
13
|
limit,
|
|
@@ -59,7 +60,7 @@ export const useTableFeatures = configuration => {
|
|
|
59
60
|
...configuration,
|
|
60
61
|
optimisticActions
|
|
61
62
|
});
|
|
62
|
-
const sections = configuration.sections
|
|
63
|
+
const sections = (_configuration$sectio = configuration.sections) != null && _configuration$sectio.id && overrides != null && (_overrides$sections = overrides.sections) != null && _overrides$sections[configuration.sections.id] ? {
|
|
63
64
|
renderSection: overrides.sections[configuration.sections.id],
|
|
64
65
|
TableSections
|
|
65
66
|
} : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useFetchData","TableSections","useTableCollection","useCommonCollectionFeatures","useFilters","useSchema","useAutoPatternsOptimisticActions","useBaseTableFeatures","usePatternsWizardOverridesContext","useTableFeatures","configuration","collectionId","limit","reflectQueryInUrl","selectAllScope","selectionUpdateMode","collection","filterComponent","filtersObject","filterFieldMapping","filters","customColumns","visibleFieldIds","columns","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","fetchData","searchableFieldIds","schema","overrides","state","queryName","itemKey","item","idField","itemName","displayField","toExtendedFields","extendedFields","fetchErrorMessage","_ref","err","String","persistQueryToUrl","disableAutoSelectAllCount","selectionConsistencyMode","optimisticActions","commonFeatures","sections","id","renderSection","undefined"],"sources":["../../../src/hooks/useTableFeatures.tsx"],"sourcesContent":["import { TableConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { TableSections, useTableCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useSchema } from '../providers/SchemaContext';\nimport { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticActions';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\nimport { usePatternsWizardOverridesContext } from '../providers/PatternsWizardOverridesContext';\n\nexport const useTableFeatures = (configuration: TableConfig) => {\n const {\n collectionId,\n limit,\n reflectQueryInUrl,\n selectAllScope,\n selectionUpdateMode,\n } = configuration.collection;\n\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n configuration.filters,\n );\n const {\n customColumns,\n visibleFieldIds,\n columns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n } = useBaseTableFeatures(configuration);\n\n const { fetchData } = useFetchData({\n searchableFieldIds: visibleFieldIds,\n filterFieldMapping,\n });\n\n const schema = useSchema();\n const overrides = usePatternsWizardOverridesContext();\n\n const state = useTableCollection<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,\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 ...configuration,\n optimisticActions,\n });\n\n const sections =\n configuration.sections?.id &&\n overrides?.sections?.[configuration.sections.id]\n ? {\n renderSection: overrides.sections[configuration.sections.id],\n TableSections,\n }\n : undefined;\n\n return {\n ...commonFeatures,\n state,\n columns,\n filters: filterComponent,\n optimisticActions,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n sections,\n };\n};\n"],"mappings":"AACA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,eAAe;AACjE,SAASC,2BAA2B,QAAQ,+BAA+B;AAC3E,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,4BAA4B;AACtD,SAASC,gCAAgC,QAAQ,oCAAoC;AACrF,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,iCAAiC,QAAQ,6CAA6C;AAE/F,OAAO,MAAMC,gBAAgB,GAAIC,aAA0B,IAAK;EAC9D,MAAM;IACJC,YAAY;IACZC,KAAK;IACLC,iBAAiB;IACjBC,cAAc;IACdC;EACF,CAAC,
|
|
1
|
+
{"version":3,"names":["useFetchData","TableSections","useTableCollection","useCommonCollectionFeatures","useFilters","useSchema","useAutoPatternsOptimisticActions","useBaseTableFeatures","usePatternsWizardOverridesContext","useTableFeatures","configuration","_configuration$sectio","_overrides$sections","collectionId","limit","reflectQueryInUrl","selectAllScope","selectionUpdateMode","collection","filterComponent","filtersObject","filterFieldMapping","filters","customColumns","visibleFieldIds","columns","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","fetchData","searchableFieldIds","schema","overrides","state","queryName","itemKey","item","idField","itemName","displayField","toExtendedFields","extendedFields","fetchErrorMessage","_ref","err","String","persistQueryToUrl","disableAutoSelectAllCount","selectionConsistencyMode","optimisticActions","commonFeatures","sections","id","renderSection","undefined"],"sources":["../../../src/hooks/useTableFeatures.tsx"],"sourcesContent":["import { TableConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { TableSections, useTableCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useSchema } from '../providers/SchemaContext';\nimport { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticActions';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\nimport { usePatternsWizardOverridesContext } from '../providers/PatternsWizardOverridesContext';\n\nexport const useTableFeatures = (configuration: TableConfig) => {\n const {\n collectionId,\n limit,\n reflectQueryInUrl,\n selectAllScope,\n selectionUpdateMode,\n } = configuration.collection;\n\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n configuration.filters,\n );\n const {\n customColumns,\n visibleFieldIds,\n columns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n } = useBaseTableFeatures(configuration);\n\n const { fetchData } = useFetchData({\n searchableFieldIds: visibleFieldIds,\n filterFieldMapping,\n });\n\n const schema = useSchema();\n const overrides = usePatternsWizardOverridesContext();\n\n const state = useTableCollection<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,\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 ...configuration,\n optimisticActions,\n });\n\n const sections =\n configuration.sections?.id &&\n overrides?.sections?.[configuration.sections.id]\n ? {\n renderSection: overrides.sections[configuration.sections.id],\n TableSections,\n }\n : undefined;\n\n return {\n ...commonFeatures,\n state,\n columns,\n filters: filterComponent,\n optimisticActions,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n sections,\n };\n};\n"],"mappings":"AACA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,eAAe;AACjE,SAASC,2BAA2B,QAAQ,+BAA+B;AAC3E,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,4BAA4B;AACtD,SAASC,gCAAgC,QAAQ,oCAAoC;AACrF,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D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;EAC5B,CAAC,CAAC;EAEF,MAAMiC,iBAAiB,GAAG5C,gCAAgC,CACxDO,YAAY,EACZqB,KAAK,CAAChB,UACR,CAAC;EAED,MAAMiC,cAAc,GAAGhD,2BAA2B,CAAC;IACjD,GAAGO,aAAa;IAChBwC;EACF,CAAC,CAAC;EAEF,MAAME,QAAQ,GACZ,CAAAzC,qBAAA,GAAAD,aAAa,CAAC0C,QAAQ,aAAtBzC,qBAAA,CAAwB0C,EAAE,IAC1BpB,SAAS,aAAArB,mBAAA,GAATqB,SAAS,CAAEmB,QAAQ,aAAnBxC,mBAAA,CAAsBF,aAAa,CAAC0C,QAAQ,CAACC,EAAE,CAAC,GAC5C;IACEC,aAAa,EAAErB,SAAS,CAACmB,QAAQ,CAAC1C,aAAa,CAAC0C,QAAQ,CAACC,EAAE,CAAC;IAC5DpD;EACF,CAAC,GACDsD,SAAS;EAEf,OAAO;IACL,GAAGJ,cAAc;IACjBjB,KAAK;IACLT,OAAO;IACPH,OAAO,EAAEH,eAAe;IACxB+B,iBAAiB;IACjB3B,aAAa;IACbG,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBC,YAAY;IACZuB;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","useContext","PatternsWizardOverridesContext","undefined","PatternsWizardOverridesProvider","_ref","children","value","createElement","Provider","usePatternsWizardOverridesContext"],"sources":["../../../src/providers/PatternsWizardOverridesContext.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode } from 'react';\nimport {\n CustomComponentProps,\n CustomActionCellActionResolver,\n
|
|
1
|
+
{"version":3,"names":["React","createContext","useContext","PatternsWizardOverridesContext","undefined","PatternsWizardOverridesProvider","_ref","children","value","createElement","Provider","usePatternsWizardOverridesContext"],"sources":["../../../src/providers/PatternsWizardOverridesContext.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode } from 'react';\nimport {\n CustomComponentProps,\n CustomActionCellActionResolver,\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 | CustomActionCellActionResolver\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,OAAOA,KAAK,IAAIC,aAAa,EAAEC,UAAU,QAAmB,OAAO;AAmCnE,MAAMC,8BAA8B,gBAAGF,aAAa,CAElDG,SAAS,CAAC;AAEZ,OAAO,MAAMC,+BAGX,GAAGC,IAAA,IAAyB;EAAA,IAAxB;IAAEC,QAAQ;IAAEC;EAAM,CAAC,GAAAF,IAAA;EACvB,oBACEN,KAAA,CAAAS,aAAA,CAACN,8BAA8B,CAACO,QAAQ;IAACF,KAAK,EAAEA;EAAM,GACnDD,QACsC,CAAC;AAE9C,CAAC;AAED,OAAO,MAAMI,iCAAiC,GAAGA,CAAA,KAEhC;EACf,OAAOT,UAAU,CAACC,8BAA8B,CAAC;AACnD,CAAC","ignoreList":[]}
|
|
@@ -6,6 +6,7 @@ import { useWixPatternsContainer } from '@wix/patterns';
|
|
|
6
6
|
import { useError } from './ErrorContext';
|
|
7
7
|
const SchemaContext = /*#__PURE__*/createContext(null);
|
|
8
8
|
export const SchemaProvider = _ref => {
|
|
9
|
+
var _collection$custom;
|
|
9
10
|
let {
|
|
10
11
|
collection,
|
|
11
12
|
children,
|
|
@@ -15,7 +16,7 @@ export const SchemaProvider = _ref => {
|
|
|
15
16
|
collectionId,
|
|
16
17
|
entityTypeSource
|
|
17
18
|
} = collection;
|
|
18
|
-
const customDataSourceId = collection.entityTypeSource === 'custom' && 'custom' in collection ? collection.custom
|
|
19
|
+
const customDataSourceId = collection.entityTypeSource === 'custom' && 'custom' in collection ? (_collection$custom = collection.custom) == null ? void 0 : _collection$custom.id : undefined;
|
|
19
20
|
const {
|
|
20
21
|
getSchema: getSchemaFromRegistry,
|
|
21
22
|
addSchema: addSchemaToRegistry
|
|
@@ -31,7 +32,7 @@ export const SchemaProvider = _ref => {
|
|
|
31
32
|
} = useWixPatternsContainer();
|
|
32
33
|
useEffect(() => {
|
|
33
34
|
const fetchSchemaForCollection = async (targetCollectionId, targetCustomDataSourceId) => {
|
|
34
|
-
if (entityTypeSource === 'custom' && targetCustomDataSourceId && overrides
|
|
35
|
+
if (entityTypeSource === 'custom' && targetCustomDataSourceId && overrides != null && overrides.customDataSources) {
|
|
35
36
|
const customSchemaProvider = overrides.customDataSources[targetCustomDataSourceId];
|
|
36
37
|
if (customSchemaProvider) {
|
|
37
38
|
return customSchemaProvider(targetCollectionId, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","useContext","useEffect","useState","getSchema","useSchemaRegistry","usePatternsWizardOverridesContext","useWixPatternsContainer","useError","SchemaContext","SchemaProvider","_ref","collection","children","skeleton","collectionId","entityTypeSource","customDataSourceId","custom","id","undefined","getSchemaFromRegistry","addSchema","addSchemaToRegistry","showError","schema","setSchema","isLoading","setIsLoading","overrides","httpClient","fetchSchemaForCollection","targetCollectionId","targetCustomDataSourceId","customDataSources","customSchemaProvider","Error","fetchReferencedSchemas","referencedSchema","referencedCollectionIds","Set","Object","values","fields","forEach","field","type","referenceMetadata","referencedCollectionId","add","size","fetchPromises","Array","from","map","refCollectionId","refSchema","error","console","Promise","all","cachedSchema","then","fetchedSchema","catch","finally","createElement","Provider","value","useSchema","context"],"sources":["../../../src/providers/SchemaContext.tsx"],"sourcesContent":["import React, {\n createContext,\n useContext,\n useEffect,\n useState,\n ReactNode,\n} from 'react';\n\nimport { SchemaConfig, BaseCollectionConfig } from '../types';\nimport { getSchema } from '../dataSourceAdapters/factory';\nimport { useSchemaRegistry } from './SchemaRegistryContext';\nimport { usePatternsWizardOverridesContext } from './PatternsWizardOverridesContext';\nimport { useWixPatternsContainer } from '@wix/patterns';\nimport { useError } from './ErrorContext';\n\nconst SchemaContext = createContext<SchemaConfig | null>(null);\n\ninterface SchemaProviderProps {\n collection: BaseCollectionConfig;\n children: ReactNode;\n skeleton: JSX.Element;\n}\n\nexport const SchemaProvider = ({\n collection,\n children,\n skeleton,\n}: SchemaProviderProps) => {\n const { collectionId, entityTypeSource } = collection;\n const customDataSourceId =\n collection.entityTypeSource === 'custom' && 'custom' in collection\n ? collection.custom?.id\n : undefined;\n const { getSchema: getSchemaFromRegistry, addSchema: addSchemaToRegistry } =\n useSchemaRegistry();\n const { showError } = useError();\n const [schema, setSchema] = useState<SchemaConfig | null>(null);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const overrides = usePatternsWizardOverridesContext();\n const { httpClient } = useWixPatternsContainer();\n\n useEffect(() => {\n const fetchSchemaForCollection = async (\n targetCollectionId: string,\n targetCustomDataSourceId?: string,\n ): Promise<SchemaConfig> => {\n if (\n entityTypeSource === 'custom' &&\n targetCustomDataSourceId &&\n overrides?.customDataSources\n ) {\n const customSchemaProvider =\n overrides.customDataSources[targetCustomDataSourceId];\n if (customSchemaProvider) {\n return customSchemaProvider(targetCollectionId, { httpClient });\n }\n throw new Error(\n `Custom schema provider '${targetCustomDataSourceId}' not found`,\n );\n }\n\n return getSchema(targetCollectionId, entityTypeSource);\n };\n\n const fetchReferencedSchemas = async (referencedSchema: SchemaConfig) => {\n const referencedCollectionIds = new Set<string>();\n\n Object.values(referencedSchema.fields).forEach((field) => {\n if (field && field.type === 'REFERENCE' && field.referenceMetadata) {\n const { referencedCollectionId } = field.referenceMetadata;\n if (\n referencedCollectionId &&\n !getSchemaFromRegistry(referencedCollectionId)\n ) {\n referencedCollectionIds.add(referencedCollectionId);\n }\n }\n });\n\n if (referencedCollectionIds.size === 0) {\n return;\n }\n\n const fetchPromises = Array.from(referencedCollectionIds).map(\n async (refCollectionId) => {\n try {\n const refSchema = await fetchSchemaForCollection(refCollectionId);\n\n addSchemaToRegistry(refCollectionId, refSchema);\n\n await fetchReferencedSchemas(refSchema);\n } catch (error) {\n console.error(\n `Error fetching referenced schema ${refCollectionId}:`,\n error,\n );\n }\n },\n );\n\n await Promise.all(fetchPromises);\n };\n\n const cachedSchema = getSchemaFromRegistry(collectionId);\n if (cachedSchema) {\n setSchema(cachedSchema);\n return;\n }\n setIsLoading(true);\n fetchSchemaForCollection(collectionId, customDataSourceId)\n .then(async (fetchedSchema) => {\n setSchema(fetchedSchema);\n addSchemaToRegistry(collectionId, fetchedSchema);\n\n await fetchReferencedSchemas(fetchedSchema);\n })\n .catch((error) => {\n console.error('Error fetching schema config:', error);\n showError(error);\n })\n .finally(() => {\n setIsLoading(false);\n });\n }, [\n collectionId,\n entityTypeSource,\n customDataSourceId,\n addSchemaToRegistry,\n getSchemaFromRegistry,\n overrides,\n httpClient,\n showError,\n ]);\n if (!schema || isLoading) {\n return skeleton;\n }\n\n return (\n <SchemaContext.Provider value={schema}>{children}</SchemaContext.Provider>\n );\n};\n\nexport const useSchema = (): SchemaConfig => {\n const context = useContext(SchemaContext);\n if (!context) {\n throw new Error('useSchema must be used within a SchemaProvider');\n }\n return context;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IACVC,aAAa,EACbC,UAAU,EACVC,SAAS,EACTC,QAAQ,QAEH,OAAO;AAGd,SAASC,SAAS,QAAQ,+BAA+B;AACzD,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,iCAAiC,QAAQ,kCAAkC;AACpF,SAASC,uBAAuB,QAAQ,eAAe;AACvD,SAASC,QAAQ,QAAQ,gBAAgB;AAEzC,MAAMC,aAAa,gBAAGT,aAAa,CAAsB,IAAI,CAAC;AAQ9D,OAAO,MAAMU,cAAc,GAAGC,IAAA,IAIH;EAAA,IAJI;IAC7BC,UAAU;IACVC,QAAQ;IACRC;EACmB,CAAC,
|
|
1
|
+
{"version":3,"names":["React","createContext","useContext","useEffect","useState","getSchema","useSchemaRegistry","usePatternsWizardOverridesContext","useWixPatternsContainer","useError","SchemaContext","SchemaProvider","_ref","_collection$custom","collection","children","skeleton","collectionId","entityTypeSource","customDataSourceId","custom","id","undefined","getSchemaFromRegistry","addSchema","addSchemaToRegistry","showError","schema","setSchema","isLoading","setIsLoading","overrides","httpClient","fetchSchemaForCollection","targetCollectionId","targetCustomDataSourceId","customDataSources","customSchemaProvider","Error","fetchReferencedSchemas","referencedSchema","referencedCollectionIds","Set","Object","values","fields","forEach","field","type","referenceMetadata","referencedCollectionId","add","size","fetchPromises","Array","from","map","refCollectionId","refSchema","error","console","Promise","all","cachedSchema","then","fetchedSchema","catch","finally","createElement","Provider","value","useSchema","context"],"sources":["../../../src/providers/SchemaContext.tsx"],"sourcesContent":["import React, {\n createContext,\n useContext,\n useEffect,\n useState,\n ReactNode,\n} from 'react';\n\nimport { SchemaConfig, BaseCollectionConfig } from '../types';\nimport { getSchema } from '../dataSourceAdapters/factory';\nimport { useSchemaRegistry } from './SchemaRegistryContext';\nimport { usePatternsWizardOverridesContext } from './PatternsWizardOverridesContext';\nimport { useWixPatternsContainer } from '@wix/patterns';\nimport { useError } from './ErrorContext';\n\nconst SchemaContext = createContext<SchemaConfig | null>(null);\n\ninterface SchemaProviderProps {\n collection: BaseCollectionConfig;\n children: ReactNode;\n skeleton: JSX.Element;\n}\n\nexport const SchemaProvider = ({\n collection,\n children,\n skeleton,\n}: SchemaProviderProps) => {\n const { collectionId, entityTypeSource } = collection;\n const customDataSourceId =\n collection.entityTypeSource === 'custom' && 'custom' in collection\n ? collection.custom?.id\n : undefined;\n const { getSchema: getSchemaFromRegistry, addSchema: addSchemaToRegistry } =\n useSchemaRegistry();\n const { showError } = useError();\n const [schema, setSchema] = useState<SchemaConfig | null>(null);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const overrides = usePatternsWizardOverridesContext();\n const { httpClient } = useWixPatternsContainer();\n\n useEffect(() => {\n const fetchSchemaForCollection = async (\n targetCollectionId: string,\n targetCustomDataSourceId?: string,\n ): Promise<SchemaConfig> => {\n if (\n entityTypeSource === 'custom' &&\n targetCustomDataSourceId &&\n overrides?.customDataSources\n ) {\n const customSchemaProvider =\n overrides.customDataSources[targetCustomDataSourceId];\n if (customSchemaProvider) {\n return customSchemaProvider(targetCollectionId, { httpClient });\n }\n throw new Error(\n `Custom schema provider '${targetCustomDataSourceId}' not found`,\n );\n }\n\n return getSchema(targetCollectionId, entityTypeSource);\n };\n\n const fetchReferencedSchemas = async (referencedSchema: SchemaConfig) => {\n const referencedCollectionIds = new Set<string>();\n\n Object.values(referencedSchema.fields).forEach((field) => {\n if (field && field.type === 'REFERENCE' && field.referenceMetadata) {\n const { referencedCollectionId } = field.referenceMetadata;\n if (\n referencedCollectionId &&\n !getSchemaFromRegistry(referencedCollectionId)\n ) {\n referencedCollectionIds.add(referencedCollectionId);\n }\n }\n });\n\n if (referencedCollectionIds.size === 0) {\n return;\n }\n\n const fetchPromises = Array.from(referencedCollectionIds).map(\n async (refCollectionId) => {\n try {\n const refSchema = await fetchSchemaForCollection(refCollectionId);\n\n addSchemaToRegistry(refCollectionId, refSchema);\n\n await fetchReferencedSchemas(refSchema);\n } catch (error) {\n console.error(\n `Error fetching referenced schema ${refCollectionId}:`,\n error,\n );\n }\n },\n );\n\n await Promise.all(fetchPromises);\n };\n\n const cachedSchema = getSchemaFromRegistry(collectionId);\n if (cachedSchema) {\n setSchema(cachedSchema);\n return;\n }\n setIsLoading(true);\n fetchSchemaForCollection(collectionId, customDataSourceId)\n .then(async (fetchedSchema) => {\n setSchema(fetchedSchema);\n addSchemaToRegistry(collectionId, fetchedSchema);\n\n await fetchReferencedSchemas(fetchedSchema);\n })\n .catch((error) => {\n console.error('Error fetching schema config:', error);\n showError(error);\n })\n .finally(() => {\n setIsLoading(false);\n });\n }, [\n collectionId,\n entityTypeSource,\n customDataSourceId,\n addSchemaToRegistry,\n getSchemaFromRegistry,\n overrides,\n httpClient,\n showError,\n ]);\n if (!schema || isLoading) {\n return skeleton;\n }\n\n return (\n <SchemaContext.Provider value={schema}>{children}</SchemaContext.Provider>\n );\n};\n\nexport const useSchema = (): SchemaConfig => {\n const context = useContext(SchemaContext);\n if (!context) {\n throw new Error('useSchema must be used within a SchemaProvider');\n }\n return context;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IACVC,aAAa,EACbC,UAAU,EACVC,SAAS,EACTC,QAAQ,QAEH,OAAO;AAGd,SAASC,SAAS,QAAQ,+BAA+B;AACzD,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,iCAAiC,QAAQ,kCAAkC;AACpF,SAASC,uBAAuB,QAAQ,eAAe;AACvD,SAASC,QAAQ,QAAQ,gBAAgB;AAEzC,MAAMC,aAAa,gBAAGT,aAAa,CAAsB,IAAI,CAAC;AAQ9D,OAAO,MAAMU,cAAc,GAAGC,IAAA,IAIH;EAAA,IAAAC,kBAAA;EAAA,IAJI;IAC7BC,UAAU;IACVC,QAAQ;IACRC;EACmB,CAAC,GAAAJ,IAAA;EACpB,MAAM;IAAEK,YAAY;IAAEC;EAAiB,CAAC,GAAGJ,UAAU;EACrD,MAAMK,kBAAk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,CAAC0B,aAAa,CAAC;IAC7C,CAAC,CAAC,CACDC,KAAK,CAAEP,KAAK,IAAK;MAChBC,OAAO,CAACD,KAAK,CAAC,+BAA+B,EAAEA,KAAK,CAAC;MACrDjC,SAAS,CAACiC,KAAK,CAAC;IAClB,CAAC,CAAC,CACDQ,OAAO,CAAC,MAAM;MACbrC,YAAY,CAAC,KAAK,CAAC;IACrB,CAAC,CAAC;EACN,CAAC,EAAE,CACDb,YAAY,EACZC,gBAAgB,EAChBC,kBAAkB,EAClBM,mBAAmB,EACnBF,qBAAqB,EACrBQ,SAAS,EACTC,UAAU,EACVN,SAAS,CACV,CAAC;EACF,IAAI,CAACC,MAAM,IAAIE,SAAS,EAAE;IACxB,OAAOb,QAAQ;EACjB;EAEA,oBACEhB,KAAA,CAAAoE,aAAA,CAAC1D,aAAa,CAAC2D,QAAQ;IAACC,KAAK,EAAE3C;EAAO,GAAEZ,QAAiC,CAAC;AAE9E,CAAC;AAED,OAAO,MAAMwD,SAAS,GAAGA,CAAA,KAAoB;EAC3C,MAAMC,OAAO,GAAGtE,UAAU,CAACQ,aAAa,CAAC;EACzC,IAAI,CAAC8D,OAAO,EAAE;IACZ,MAAM,IAAIlC,KAAK,CAAC,gDAAgD,CAAC;EACnE;EACA,OAAOkC,OAAO;AAChB,CAAC","ignoreList":[]}
|
|
@@ -15,7 +15,7 @@ export const SchemaRegistryProvider = _ref => {
|
|
|
15
15
|
}));
|
|
16
16
|
}, []);
|
|
17
17
|
const getSchema = useCallback(collectionId => {
|
|
18
|
-
return registry
|
|
18
|
+
return registry == null ? void 0 : registry[collectionId];
|
|
19
19
|
}, [registry]);
|
|
20
20
|
const contextValue = useMemo(() => ({
|
|
21
21
|
getSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","useContext","useState","useCallback","useMemo","SchemaRegistryContext","getSchema","undefined","addSchema","SchemaRegistryProvider","_ref","children","registry","setRegistry","collectionId","schema","prevRegistry","contextValue","createElement","Provider","value","useSchemaRegistry","context","Error"],"sources":["../../../src/providers/SchemaRegistryContext.tsx"],"sourcesContent":["import React, {\n createContext,\n useContext,\n useState,\n ReactNode,\n useCallback,\n useMemo,\n} from 'react';\n\nimport { SchemaConfig } from '../types';\n\nexport interface SchemaRegistryContextValue {\n getSchema: (collectionId: string) => SchemaConfig | undefined;\n addSchema: (collectionId: string, schema: SchemaConfig) => void;\n}\n\nexport type SchemaRegistry = Record<string, SchemaConfig>;\n\nconst SchemaRegistryContext = createContext<SchemaRegistryContextValue>({\n getSchema: () => undefined,\n addSchema: () => {},\n});\n\nexport interface SchemaRegistryProviderProps {\n children: ReactNode;\n}\n\nexport const SchemaRegistryProvider = ({\n children,\n}: SchemaRegistryProviderProps) => {\n const [registry, setRegistry] = useState<SchemaRegistry>({});\n\n const addSchema = useCallback(\n (collectionId: string, schema: SchemaConfig) => {\n setRegistry((prevRegistry) => ({\n ...prevRegistry,\n [collectionId]: schema,\n }));\n },\n [],\n );\n\n const getSchema = useCallback(\n (collectionId: string) => {\n return registry?.[collectionId];\n },\n [registry],\n );\n\n const contextValue = useMemo(\n () => ({\n getSchema,\n addSchema,\n }),\n [getSchema, addSchema],\n );\n\n return (\n <SchemaRegistryContext.Provider value={contextValue}>\n {children}\n </SchemaRegistryContext.Provider>\n );\n};\n\nexport const useSchemaRegistry = (): SchemaRegistryContextValue => {\n const context = useContext(SchemaRegistryContext);\n if (!context) {\n throw new Error(\n 'useSchemaRegistry must be used within a UseRegistryProvider',\n );\n }\n return context;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IACVC,aAAa,EACbC,UAAU,EACVC,QAAQ,EAERC,WAAW,EACXC,OAAO,QACF,OAAO;AAWd,MAAMC,qBAAqB,gBAAGL,aAAa,CAA6B;EACtEM,SAAS,EAAEA,CAAA,KAAMC,SAAS;EAC1BC,SAAS,EAAEA,CAAA,KAAM,CAAC;AACpB,CAAC,CAAC;AAMF,OAAO,MAAMC,sBAAsB,GAAGC,IAAA,IAEH;EAAA,IAFI;IACrCC;EAC2B,CAAC,GAAAD,IAAA;EAC5B,MAAM,CAACE,QAAQ,EAAEC,WAAW,CAAC,GAAGX,QAAQ,CAAiB,CAAC,CAAC,CAAC;EAE5D,MAAMM,SAAS,GAAGL,WAAW,CAC3B,CAACW,YAAoB,EAAEC,MAAoB,KAAK;IAC9CF,WAAW,CAAEG,YAAY,KAAM;MAC7B,GAAGA,YAAY;MACf,CAACF,YAAY,GAAGC;IAClB,CAAC,CAAC,CAAC;EACL,CAAC,EACD,EACF,CAAC;EAED,MAAMT,SAAS,GAAGH,WAAW,CAC1BW,YAAoB,IAAK;IACxB,OAAOF,QAAQ,
|
|
1
|
+
{"version":3,"names":["React","createContext","useContext","useState","useCallback","useMemo","SchemaRegistryContext","getSchema","undefined","addSchema","SchemaRegistryProvider","_ref","children","registry","setRegistry","collectionId","schema","prevRegistry","contextValue","createElement","Provider","value","useSchemaRegistry","context","Error"],"sources":["../../../src/providers/SchemaRegistryContext.tsx"],"sourcesContent":["import React, {\n createContext,\n useContext,\n useState,\n ReactNode,\n useCallback,\n useMemo,\n} from 'react';\n\nimport { SchemaConfig } from '../types';\n\nexport interface SchemaRegistryContextValue {\n getSchema: (collectionId: string) => SchemaConfig | undefined;\n addSchema: (collectionId: string, schema: SchemaConfig) => void;\n}\n\nexport type SchemaRegistry = Record<string, SchemaConfig>;\n\nconst SchemaRegistryContext = createContext<SchemaRegistryContextValue>({\n getSchema: () => undefined,\n addSchema: () => {},\n});\n\nexport interface SchemaRegistryProviderProps {\n children: ReactNode;\n}\n\nexport const SchemaRegistryProvider = ({\n children,\n}: SchemaRegistryProviderProps) => {\n const [registry, setRegistry] = useState<SchemaRegistry>({});\n\n const addSchema = useCallback(\n (collectionId: string, schema: SchemaConfig) => {\n setRegistry((prevRegistry) => ({\n ...prevRegistry,\n [collectionId]: schema,\n }));\n },\n [],\n );\n\n const getSchema = useCallback(\n (collectionId: string) => {\n return registry?.[collectionId];\n },\n [registry],\n );\n\n const contextValue = useMemo(\n () => ({\n getSchema,\n addSchema,\n }),\n [getSchema, addSchema],\n );\n\n return (\n <SchemaRegistryContext.Provider value={contextValue}>\n {children}\n </SchemaRegistryContext.Provider>\n );\n};\n\nexport const useSchemaRegistry = (): SchemaRegistryContextValue => {\n const context = useContext(SchemaRegistryContext);\n if (!context) {\n throw new Error(\n 'useSchemaRegistry must be used within a UseRegistryProvider',\n );\n }\n return context;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IACVC,aAAa,EACbC,UAAU,EACVC,QAAQ,EAERC,WAAW,EACXC,OAAO,QACF,OAAO;AAWd,MAAMC,qBAAqB,gBAAGL,aAAa,CAA6B;EACtEM,SAAS,EAAEA,CAAA,KAAMC,SAAS;EAC1BC,SAAS,EAAEA,CAAA,KAAM,CAAC;AACpB,CAAC,CAAC;AAMF,OAAO,MAAMC,sBAAsB,GAAGC,IAAA,IAEH;EAAA,IAFI;IACrCC;EAC2B,CAAC,GAAAD,IAAA;EAC5B,MAAM,CAACE,QAAQ,EAAEC,WAAW,CAAC,GAAGX,QAAQ,CAAiB,CAAC,CAAC,CAAC;EAE5D,MAAMM,SAAS,GAAGL,WAAW,CAC3B,CAACW,YAAoB,EAAEC,MAAoB,KAAK;IAC9CF,WAAW,CAAEG,YAAY,KAAM;MAC7B,GAAGA,YAAY;MACf,CAACF,YAAY,GAAGC;IAClB,CAAC,CAAC,CAAC;EACL,CAAC,EACD,EACF,CAAC;EAED,MAAMT,SAAS,GAAGH,WAAW,CAC1BW,YAAoB,IAAK;IACxB,OAAOF,QAAQ,oBAARA,QAAQ,CAAGE,YAAY,CAAC;EACjC,CAAC,EACD,CAACF,QAAQ,CACX,CAAC;EAED,MAAMK,YAAY,GAAGb,OAAO,CAC1B,OAAO;IACLE,SAAS;IACTE;EACF,CAAC,CAAC,EACF,CAACF,SAAS,EAAEE,SAAS,CACvB,CAAC;EAED,oBACET,KAAA,CAAAmB,aAAA,CAACb,qBAAqB,CAACc,QAAQ;IAACC,KAAK,EAAEH;EAAa,GACjDN,QAC6B,CAAC;AAErC,CAAC;AAED,OAAO,MAAMU,iBAAiB,GAAGA,CAAA,KAAkC;EACjE,MAAMC,OAAO,GAAGrB,UAAU,CAACI,qBAAqB,CAAC;EACjD,IAAI,CAACiB,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CACb,6DACF,CAAC;EACH;EACA,OAAOD,OAAO;AAChB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/types/EntityPageConfig.ts"],"sourcesContent":["import { FieldValues, UseFormReturn } from '@wix/patterns/form';\nimport {
|
|
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: 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/actions/entityPageActions.ts"],"sourcesContent":["import { FieldValues, UseFormReturn } from '@wix/patterns/form';\nimport { CustomActionParams, ResolvedAction } from '../..';\nimport {
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/types/actions/entityPageActions.ts"],"sourcesContent":["import { FieldValues, UseFormReturn } from '@wix/patterns/form';\nimport { CustomActionParams, ResolvedAction } from '../..';\nimport {\n CreateActionConfig,\n CustomActionConfig,\n DividerActionConfig,\n} from './base';\n\nexport type EntityPageMoreActions = (\n | CustomActionConfig\n | DividerActionConfig\n)[];\n\nexport type EntityPageActionConfig = CreateActionConfig | CustomActionConfig;\n\ntype EntityPageAction = {\n type: 'action';\n action: {\n item: EntityPageActionConfig;\n };\n menu?: never;\n};\n\ntype EntityPageMenu = {\n type: 'menu';\n menu: {\n label: string;\n items: (EntityPageActionConfig | DividerActionConfig)[];\n };\n action?: never;\n};\n\nexport type EntityPagePrimaryActions = EntityPageAction | EntityPageMenu;\nexport type EntityPageSecondaryActions = EntityPageAction | EntityPageMenu;\n\nexport interface EntityPageActionParams {\n entity: any;\n form?: UseFormReturn<FieldValues, any, undefined>;\n}\n\nexport type CustomEntityPageActionParams =\n CustomActionParams<EntityPageActionParams>;\n\nexport type CustomEntityPageActionResolver = (\n params: CustomEntityPageActionParams,\n) => ResolvedAction;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export const customAction = params => {
|
|
2
|
+
var _sdk$overrides;
|
|
2
3
|
const {
|
|
3
4
|
sdk,
|
|
4
5
|
action,
|
|
5
6
|
actionParams
|
|
6
7
|
} = params;
|
|
7
|
-
const actionFunc = sdk.overrides
|
|
8
|
+
const actionFunc = (_sdk$overrides = sdk.overrides) == null || (_sdk$overrides = _sdk$overrides.actions) == null ? void 0 : _sdk$overrides[action.id];
|
|
8
9
|
if (!actionFunc) {
|
|
9
10
|
return null;
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["customAction","params","sdk","action","actionParams","actionFunc","overrides","actions","id"],"sources":["../../../../src/utils/actions/customAction.tsx"],"sourcesContent":["import { CustomActionParams } from './types';\n\nexport const customAction = (params: CustomActionParams<any>) => {\n const { sdk, action, actionParams } = params;\n\n const actionFunc = sdk.overrides?.actions?.[action.id];\n if (!actionFunc) {\n return null;\n }\n\n return actionFunc({\n action,\n actionParams,\n sdk,\n });\n};\n"],"mappings":"AAEA,OAAO,MAAMA,YAAY,GAAIC,MAA+B,IAAK;EAC/D,MAAM;IAAEC,GAAG;IAAEC,MAAM;IAAEC;EAAa,CAAC,
|
|
1
|
+
{"version":3,"names":["customAction","params","_sdk$overrides","sdk","action","actionParams","actionFunc","overrides","actions","id"],"sources":["../../../../src/utils/actions/customAction.tsx"],"sourcesContent":["import { CustomActionParams } from './types';\n\nexport const customAction = (params: CustomActionParams<any>) => {\n const { sdk, action, actionParams } = params;\n\n const actionFunc = sdk.overrides?.actions?.[action.id];\n if (!actionFunc) {\n return null;\n }\n\n return actionFunc({\n action,\n actionParams,\n sdk,\n });\n};\n"],"mappings":"AAEA,OAAO,MAAMA,YAAY,GAAIC,MAA+B,IAAK;EAAA,IAAAC,cAAA;EAC/D,MAAM;IAAEC,GAAG;IAAEC,MAAM;IAAEC;EAAa,CAAC,GAAGJ,MAAM;EAE5C,MAAMK,UAAU,IAAAJ,cAAA,GAAGC,GAAG,CAACI,SAAS,cAAAL,cAAA,GAAbA,cAAA,CAAeM,OAAO,qBAAtBN,cAAA,CAAyBE,MAAM,CAACK,EAAE,CAAC;EACtD,IAAI,CAACH,UAAU,EAAE;IACf,OAAO,IAAI;EACb;EAEA,OAAOA,UAAU,CAAC;IAChBF,MAAM;IACNC,YAAY;IACZF;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -19,28 +19,33 @@ export const deleteAction = params => {
|
|
|
19
19
|
const optimisticActions = getOptimisticActions(collectionId);
|
|
20
20
|
return {
|
|
21
21
|
onClick: () => {
|
|
22
|
+
var _modalParams$actions, _modalParams$actions2;
|
|
22
23
|
api.openConfirmDeleteModal({
|
|
23
24
|
...(modalParams.title ? {
|
|
24
25
|
title: modalParams.title.text
|
|
25
26
|
} : {}),
|
|
26
27
|
primaryButtonOnClick: () => {
|
|
28
|
+
var _modalParams$feedback;
|
|
27
29
|
const schema = sdk.getSchema(sdk.collectionId);
|
|
28
30
|
if (!schema) {
|
|
29
31
|
throw new Error('Schema not found');
|
|
30
32
|
}
|
|
31
|
-
optimisticActions
|
|
32
|
-
successToast: modalParams.feedback
|
|
33
|
-
errorToast: () =>
|
|
33
|
+
optimisticActions == null || optimisticActions.deleteOne(actionParams.item, {
|
|
34
|
+
successToast: ((_modalParams$feedback = modalParams.feedback) == null || (_modalParams$feedback = _modalParams$feedback.successToast) == null ? void 0 : _modalParams$feedback.text) || 'Item deleted successfully',
|
|
35
|
+
errorToast: () => {
|
|
36
|
+
var _modalParams$feedback2;
|
|
37
|
+
return ((_modalParams$feedback2 = modalParams.feedback) == null || (_modalParams$feedback2 = _modalParams$feedback2.errorToast) == null ? void 0 : _modalParams$feedback2.text) || 'Failed to delete item';
|
|
38
|
+
},
|
|
34
39
|
submit: async () => {
|
|
35
40
|
const result = await schema.actions.delete(actionParams.item[schema.idField]);
|
|
36
41
|
return [result];
|
|
37
42
|
}
|
|
38
43
|
});
|
|
39
44
|
},
|
|
40
|
-
...(modalParams.actions
|
|
45
|
+
...((_modalParams$actions = modalParams.actions) != null && _modalParams$actions.submit ? {
|
|
41
46
|
primaryButtonText: modalParams.actions.submit.text
|
|
42
47
|
} : {}),
|
|
43
|
-
...(modalParams.actions
|
|
48
|
+
...((_modalParams$actions2 = modalParams.actions) != null && _modalParams$actions2.cancel ? {
|
|
44
49
|
secondaryButtonText: modalParams.actions.cancel.text
|
|
45
50
|
} : {}),
|
|
46
51
|
...(modalParams.description ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Delete","React","deleteAction","params","action","sdk","actionParams","modal","modalParams","delete","getOptimisticActions","collectionId","api","optimisticActions","onClick","openConfirmDeleteModal","title","text","primaryButtonOnClick","schema","getSchema","Error","deleteOne","item","successToast","feedback","errorToast","submit","result","actions","idField","primaryButtonText","cancel","secondaryButtonText","description","content","label","icon","createElement"],"sources":["../../../../src/utils/actions/deleteAction.tsx"],"sourcesContent":["import { DeleteActionParams } from './types';\nimport { Delete } from '@wix/wix-ui-icons-common';\nimport React from 'react';\n\nexport const deleteAction = (params: DeleteActionParams) => {\n const { action, sdk, actionParams } = params;\n const { modal: modalParams } = action.delete;\n const { getOptimisticActions, collectionId } = sdk;\n const { api } = actionParams;\n const optimisticActions = getOptimisticActions(collectionId);\n\n return {\n onClick: () => {\n api.openConfirmDeleteModal({\n ...(modalParams.title ? { title: modalParams.title.text } : {}),\n primaryButtonOnClick: () => {\n const schema = sdk.getSchema(sdk.collectionId);\n if (!schema) {\n throw new Error('Schema not found');\n }\n optimisticActions?.deleteOne(actionParams.item, {\n successToast:\n modalParams.feedback?.successToast?.text ||\n 'Item deleted successfully',\n errorToast: () =>\n modalParams.feedback?.errorToast?.text || 'Failed to delete item',\n submit: async () => {\n const result = await schema.actions.delete(\n actionParams.item[schema.idField],\n );\n return [result];\n },\n });\n },\n ...(modalParams.actions?.submit\n ? {\n primaryButtonText: modalParams.actions.submit.text,\n }\n : {}),\n ...(modalParams.actions?.cancel\n ? {\n secondaryButtonText: modalParams.actions.cancel.text,\n }\n : {}),\n ...(modalParams.description\n ? { content: modalParams.description.text }\n : {}),\n });\n },\n label: 'Delete',\n icon: <Delete />,\n };\n};\n"],"mappings":"AACA,SAASA,MAAM,QAAQ,0BAA0B;AACjD,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAO,MAAMC,YAAY,GAAIC,MAA0B,IAAK;EAC1D,MAAM;IAAEC,MAAM;IAAEC,GAAG;IAAEC;EAAa,CAAC,GAAGH,MAAM;EAC5C,MAAM;IAAEI,KAAK,EAAEC;EAAY,CAAC,GAAGJ,MAAM,CAACK,MAAM;EAC5C,MAAM;IAAEC,oBAAoB;IAAEC;EAAa,CAAC,GAAGN,GAAG;EAClD,MAAM;IAAEO;EAAI,CAAC,GAAGN,YAAY;EAC5B,MAAMO,iBAAiB,GAAGH,oBAAoB,CAACC,YAAY,CAAC;EAE5D,OAAO;IACLG,OAAO,EAAEA,CAAA,KAAM;
|
|
1
|
+
{"version":3,"names":["Delete","React","deleteAction","params","action","sdk","actionParams","modal","modalParams","delete","getOptimisticActions","collectionId","api","optimisticActions","onClick","_modalParams$actions","_modalParams$actions2","openConfirmDeleteModal","title","text","primaryButtonOnClick","_modalParams$feedback","schema","getSchema","Error","deleteOne","item","successToast","feedback","errorToast","_modalParams$feedback2","submit","result","actions","idField","primaryButtonText","cancel","secondaryButtonText","description","content","label","icon","createElement"],"sources":["../../../../src/utils/actions/deleteAction.tsx"],"sourcesContent":["import { DeleteActionParams } from './types';\nimport { Delete } from '@wix/wix-ui-icons-common';\nimport React from 'react';\n\nexport const deleteAction = (params: DeleteActionParams) => {\n const { action, sdk, actionParams } = params;\n const { modal: modalParams } = action.delete;\n const { getOptimisticActions, collectionId } = sdk;\n const { api } = actionParams;\n const optimisticActions = getOptimisticActions(collectionId);\n\n return {\n onClick: () => {\n api.openConfirmDeleteModal({\n ...(modalParams.title ? { title: modalParams.title.text } : {}),\n primaryButtonOnClick: () => {\n const schema = sdk.getSchema(sdk.collectionId);\n if (!schema) {\n throw new Error('Schema not found');\n }\n optimisticActions?.deleteOne(actionParams.item, {\n successToast:\n modalParams.feedback?.successToast?.text ||\n 'Item deleted successfully',\n errorToast: () =>\n modalParams.feedback?.errorToast?.text || 'Failed to delete item',\n submit: async () => {\n const result = await schema.actions.delete(\n actionParams.item[schema.idField],\n );\n return [result];\n },\n });\n },\n ...(modalParams.actions?.submit\n ? {\n primaryButtonText: modalParams.actions.submit.text,\n }\n : {}),\n ...(modalParams.actions?.cancel\n ? {\n secondaryButtonText: modalParams.actions.cancel.text,\n }\n : {}),\n ...(modalParams.description\n ? { content: modalParams.description.text }\n : {}),\n });\n },\n label: 'Delete',\n icon: <Delete />,\n };\n};\n"],"mappings":"AACA,SAASA,MAAM,QAAQ,0BAA0B;AACjD,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAO,MAAMC,YAAY,GAAIC,MAA0B,IAAK;EAC1D,MAAM;IAAEC,MAAM;IAAEC,GAAG;IAAEC;EAAa,CAAC,GAAGH,MAAM;EAC5C,MAAM;IAAEI,KAAK,EAAEC;EAAY,CAAC,GAAGJ,MAAM,CAACK,MAAM;EAC5C,MAAM;IAAEC,oBAAoB;IAAEC;EAAa,CAAC,GAAGN,GAAG;EAClD,MAAM;IAAEO;EAAI,CAAC,GAAGN,YAAY;EAC5B,MAAMO,iBAAiB,GAAGH,oBAAoB,CAACC,YAAY,CAAC;EAE5D,OAAO;IACLG,OAAO,EAAEA,CAAA,KAAM;MAAA,IAAAC,oBAAA,EAAAC,qBAAA;MACbJ,GAAG,CAACK,sBAAsB,CAAC;QACzB,IAAIT,WAAW,CAACU,KAAK,GAAG;UAAEA,KAAK,EAAEV,WAAW,CAACU,KAAK,CAACC;QAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC/DC,oBAAoB,EAAEA,CAAA,KAAM;UAAA,IAAAC,qBAAA;UAC1B,MAAMC,MAAM,GAAGjB,GAAG,CAACkB,SAAS,CAAClB,GAAG,CAACM,YAAY,CAAC;UAC9C,IAAI,CAACW,MAA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AAC;IACDqB,KAAK,EAAE,QAAQ;IACfC,IAAI,eAAExC,KAAA,CAAAyC,aAAA,CAAC1C,MAAM,MAAE;EACjB,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/utils/actions/types.ts"],"sourcesContent":["import { ActionCellAPI, CollectionOptimisticActions } from '@wix/patterns';\nimport {\n UpdateActionConfig,\n CustomActionConfig,\n SchemaConfig,\n BulkDeleteActionConfig,\n DeleteActionConfig,\n CreateActionConfig,\n BaseSDK,\n} from '../../types';\nimport { IconElement } from '@wix/design-system';\n\nexport interface ResolvedAction {\n label: string;\n icon: IconElement;\n onClick: () => void;\n disabled?: boolean;\n tooltip?: string;\n skin?: string;\n}\n\nexport interface BaseContextParams {\n schema: SchemaConfig;\n}\n\nexport interface ActionsSDK extends BaseSDK {\n getSchema: (collectionId: string) => SchemaConfig | undefined;\n collectionId: string; // TODO: Why collectionId is needed here? getSchema with internal collectionId is enough\n getOptimisticActions: (\n collectionId: string,\n ) => CollectionOptimisticActions<any, any>;\n}\n\nexport interface BaseActionParams<T = Record<string, any>> {\n sdk: ActionsSDK;\n actionParams: T;\n}\n\nexport interface ActionCellBaseParams extends BaseActionParams {\n actionParams: {\n item: any;\n index: number;\n api: ActionCellAPI<any, any>;\n };\n}\n\nexport interface BulkDeleteActionParams extends BaseActionParams {\n action: BulkDeleteActionConfig;\n actionParams: {\n selectedValues: any[];\n total: number;\n };\n}\n\nexport interface DeleteActionParams extends ActionCellBaseParams {\n action: DeleteActionConfig;\n}\n\nexport interface UpdateActionParams extends
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/utils/actions/types.ts"],"sourcesContent":["import { ActionCellAPI, CollectionOptimisticActions } from '@wix/patterns';\nimport {\n UpdateActionConfig,\n CustomActionConfig,\n SchemaConfig,\n BulkDeleteActionConfig,\n DeleteActionConfig,\n CreateActionConfig,\n BaseSDK,\n} from '../../types';\nimport { IconElement } from '@wix/design-system';\n\nexport interface ResolvedAction {\n label: string;\n icon: IconElement;\n onClick: () => void;\n disabled?: boolean;\n tooltip?: string;\n skin?: string;\n}\n\nexport interface BaseContextParams {\n schema: SchemaConfig;\n}\n\nexport interface ActionsSDK extends BaseSDK {\n getSchema: (collectionId: string) => SchemaConfig | undefined;\n collectionId: string; // TODO: Why collectionId is needed here? getSchema with internal collectionId is enough\n getOptimisticActions: (\n collectionId: string,\n ) => CollectionOptimisticActions<any, any>;\n}\n\nexport interface BaseActionParams<T = Record<string, any>> {\n sdk: ActionsSDK;\n actionParams: T;\n}\n\nexport interface ActionCellBaseParams extends BaseActionParams {\n actionParams: {\n item: any;\n index: number;\n api: ActionCellAPI<any, any>;\n };\n}\n\nexport interface BulkDeleteActionParams extends BaseActionParams {\n action: BulkDeleteActionConfig;\n actionParams: {\n selectedValues: any[];\n total: number;\n };\n}\n\nexport interface DeleteActionParams extends ActionCellBaseParams {\n action: DeleteActionConfig;\n}\n\nexport interface UpdateActionParams extends BaseActionParams {\n action: UpdateActionConfig;\n}\n\nexport interface CreateActionParams extends BaseActionParams {\n action: CreateActionConfig;\n}\n\nexport interface CustomActionParams<T> extends BaseActionParams<T> {\n action: CustomActionConfig;\n}\n\nexport interface ActionModalProps {\n modalParams: Record<string, any>;\n actionParams: Record<string, any>;\n sdk: ActionsSDK;\n}\n\nexport interface CustomActionModalProps extends ActionModalProps {\n modalParams: { id: string };\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -14,9 +14,9 @@ export const createDateTimeFilter = _ref => {
|
|
|
14
14
|
component: DateRangeFilter,
|
|
15
15
|
props: {
|
|
16
16
|
...commonFilterProps,
|
|
17
|
-
mode: config
|
|
18
|
-
dateRangeOptions: config
|
|
19
|
-
filterByTime: config
|
|
17
|
+
mode: config == null ? void 0 : config.mode,
|
|
18
|
+
dateRangeOptions: config == null ? void 0 : config.presets,
|
|
19
|
+
filterByTime: config == null ? void 0 : config.includeTime
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
};
|
|
@@ -43,10 +43,10 @@ export const createBooleanFilter = _ref2 => {
|
|
|
43
43
|
...commonFilterProps,
|
|
44
44
|
data: [{
|
|
45
45
|
id: 'checked',
|
|
46
|
-
name: config
|
|
46
|
+
name: (config == null ? void 0 : config.trueLabel) || 'Yes'
|
|
47
47
|
}, {
|
|
48
48
|
id: 'unchecked',
|
|
49
|
-
name: config
|
|
49
|
+
name: (config == null ? void 0 : config.falseLabel) || 'No'
|
|
50
50
|
}]
|
|
51
51
|
}
|
|
52
52
|
};
|
|
@@ -65,9 +65,9 @@ export const createNumberFilter = _ref3 => {
|
|
|
65
65
|
component: NumberRangeFilter,
|
|
66
66
|
props: {
|
|
67
67
|
...commonFilterProps,
|
|
68
|
-
min: config
|
|
69
|
-
max: config
|
|
70
|
-
decimal: config
|
|
68
|
+
min: config == null ? void 0 : config.min,
|
|
69
|
+
max: config == null ? void 0 : config.max,
|
|
70
|
+
decimal: config == null ? void 0 : config.allowedDecimals
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
};
|
|
@@ -83,10 +83,10 @@ export const createEnumFilter = _ref4 => {
|
|
|
83
83
|
selectionMode,
|
|
84
84
|
optionType
|
|
85
85
|
} = config;
|
|
86
|
-
const data = options
|
|
86
|
+
const data = (options == null ? void 0 : options.map(option => ({
|
|
87
87
|
id: option.value,
|
|
88
88
|
name: option.label
|
|
89
|
-
})) ?? [];
|
|
89
|
+
}))) ?? [];
|
|
90
90
|
const inlineComponentThreshold = 5;
|
|
91
91
|
let component;
|
|
92
92
|
if (selectionMode === 'single') {
|
|
@@ -126,7 +126,7 @@ export const createReferenceFilter = _ref5 => {
|
|
|
126
126
|
config,
|
|
127
127
|
additionalParams
|
|
128
128
|
} = _ref5;
|
|
129
|
-
const component = config
|
|
129
|
+
const component = (config == null ? void 0 : config.selectionMode) === 'single' ? AutoCompleteFilter : MultiSelectCollectionFilter;
|
|
130
130
|
return {
|
|
131
131
|
key: id,
|
|
132
132
|
fieldId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dateRangeFilter","idNameArrayFilter","numberRangeFilter","DateRangeFilter","RadioGroupFilter","NumberRangeFilter","AutoCompleteFilter","MultiSelectCheckboxFilter","MultiInlineCheckboxFilter","MultiSelectCollectionFilter","BooleanFilters","createDateTimeFilter","_ref","id","fieldId","commonFilterProps","config","key","filter","component","props","mode","dateRangeOptions","presets","filterByTime","includeTime","createBooleanFilter","_ref2","matches","fieldValue","filterValue","some","v","checked","unchecked","data","name","trueLabel","falseLabel","createNumberFilter","_ref3","min","max","decimal","allowedDecimals","createEnumFilter","_ref4","options","selectionMode","optionType","map","option","value","label","inlineComponentThreshold","length","collectionData","createReferenceFilter","_ref5","additionalParams","collectionId","referencedSchema"],"sources":["../../../src/utils/filterCreators.ts"],"sourcesContent":["import {\n dateRangeFilter,\n idNameArrayFilter,\n numberRangeFilter,\n DateRangeFilter,\n RadioGroupFilter,\n NumberRangeFilter,\n AutoCompleteFilter,\n MultiSelectCheckboxFilter,\n MultiInlineCheckboxFilter,\n MultiSelectCollectionFilter,\n} from '@wix/patterns';\nimport { BooleanFilters } from '../dataSourceAdapters/constants';\nimport { FilterOptions } from '../hooks/useFilters';\nimport { SchemaConfig } from '../types';\n\ninterface FilterOption {\n value: string;\n label: string;\n}\n\ninterface BaseFilterParams {\n id: string;\n fieldId: string;\n commonFilterProps: Record<string, any>;\n}\n\nexport const createDateTimeFilter = ({\n id,\n fieldId,\n commonFilterProps,\n config,\n}: BaseFilterParams & {\n config?: {\n mode?: 'ONLY_PREDEFINED' | 'ONLY_CUSTOM' | 'COMBINE';\n presets?: string[];\n includeTime?: boolean;\n };\n}): FilterOptions => ({\n key: id,\n fieldId,\n filter: dateRangeFilter(),\n component: DateRangeFilter,\n props: {\n ...commonFilterProps,\n mode: config?.mode,\n dateRangeOptions: config?.presets,\n filterByTime: config?.includeTime,\n },\n});\n\nexport const createBooleanFilter = ({\n id,\n fieldId,\n commonFilterProps,\n config,\n}: BaseFilterParams & {\n config?: {\n trueLabel?: string;\n falseLabel?: string;\n };\n}): FilterOptions => ({\n key: id,\n fieldId,\n filter: idNameArrayFilter({\n matches: (fieldValue, filterValue) => {\n if (fieldValue) {\n return filterValue.some((v) => v.id === BooleanFilters.checked);\n }\n return filterValue.some((v) => v.id === BooleanFilters.unchecked);\n },\n }),\n component: RadioGroupFilter,\n props: {\n ...commonFilterProps,\n data: [\n {\n id: 'checked',\n name: config?.trueLabel || 'Yes',\n },\n {\n id: 'unchecked',\n name: config?.falseLabel || 'No',\n },\n ],\n },\n});\n\nexport const createNumberFilter = ({\n id,\n fieldId,\n commonFilterProps,\n config,\n}: BaseFilterParams & {\n config?: {\n min?: number;\n max?: number;\n allowedDecimals?: boolean;\n };\n}): FilterOptions => ({\n key: id,\n fieldId,\n filter: numberRangeFilter(),\n component: NumberRangeFilter,\n props: {\n ...commonFilterProps,\n min: config?.min,\n max: config?.max,\n decimal: config?.allowedDecimals,\n },\n});\n\nexport const createEnumFilter = ({\n id,\n fieldId,\n commonFilterProps,\n config,\n}: BaseFilterParams & {\n config: {\n options?: FilterOption[];\n selectionMode?: 'single' | 'multiple';\n optionType?: 'select' | 'radio' | 'checkbox' | 'inlineCheckbox';\n };\n}): FilterOptions => {\n const { options, selectionMode, optionType } = config;\n const data =\n options?.map((option: FilterOption) => ({\n id: option.value,\n name: option.label,\n })) ?? [];\n\n const inlineComponentThreshold = 5;\n\n let component;\n\n if (selectionMode === 'single') {\n component =\n data.length > inlineComponentThreshold\n ? AutoCompleteFilter\n : RadioGroupFilter;\n if (optionType === 'select') {\n component = AutoCompleteFilter;\n } else if (optionType === 'radio') {\n component = RadioGroupFilter;\n }\n } else {\n component =\n data.length > inlineComponentThreshold\n ? MultiSelectCheckboxFilter\n : MultiInlineCheckboxFilter;\n if (optionType === 'select') {\n component = MultiSelectCollectionFilter;\n } else if (optionType === 'inlineCheckbox') {\n component = MultiInlineCheckboxFilter;\n } else if (optionType === 'checkbox') {\n component = MultiSelectCheckboxFilter;\n }\n }\n\n return {\n key: id,\n fieldId,\n filter: idNameArrayFilter(),\n component,\n collectionData: data,\n props: { ...commonFilterProps, data },\n };\n};\n\nexport const createReferenceFilter = ({\n id,\n fieldId,\n commonFilterProps,\n config,\n additionalParams,\n}: BaseFilterParams & {\n config?: {\n selectionMode?: 'single' | 'multiple';\n };\n additionalParams: {\n referencedSchema: SchemaConfig;\n };\n}): FilterOptions => {\n const component =\n config?.selectionMode === 'single'\n ? AutoCompleteFilter\n : MultiSelectCollectionFilter;\n\n return {\n key: id,\n fieldId,\n filter: idNameArrayFilter(),\n component,\n collectionId: additionalParams.referencedSchema.id,\n props: commonFilterProps,\n };\n};\n"],"mappings":"AAAA,SACEA,eAAe,EACfC,iBAAiB,EACjBC,iBAAiB,EACjBC,eAAe,EACfC,gBAAgB,EAChBC,iBAAiB,EACjBC,kBAAkB,EAClBC,yBAAyB,EACzBC,yBAAyB,EACzBC,2BAA2B,QACtB,eAAe;AACtB,SAASC,cAAc,QAAQ,iCAAiC;AAehE,OAAO,MAAMC,oBAAoB,GAAGC,IAAA;EAAA,IAAC;IACnCC,EAAE;IACFC,OAAO;IACPC,iBAAiB;IACjBC;EAOF,CAAC,GAAAJ,IAAA;EAAA,OAAqB;IACpBK,GAAG,EAAEJ,EAAE;IACPC,OAAO;IACPI,MAAM,EAAElB,eAAe,CAAC,CAAC;IACzBmB,SAAS,EAAEhB,eAAe;IAC1BiB,KAAK,EAAE;MACL,GAAGL,iBAAiB;MACpBM,IAAI,EAAEL,MAAM,
|
|
1
|
+
{"version":3,"names":["dateRangeFilter","idNameArrayFilter","numberRangeFilter","DateRangeFilter","RadioGroupFilter","NumberRangeFilter","AutoCompleteFilter","MultiSelectCheckboxFilter","MultiInlineCheckboxFilter","MultiSelectCollectionFilter","BooleanFilters","createDateTimeFilter","_ref","id","fieldId","commonFilterProps","config","key","filter","component","props","mode","dateRangeOptions","presets","filterByTime","includeTime","createBooleanFilter","_ref2","matches","fieldValue","filterValue","some","v","checked","unchecked","data","name","trueLabel","falseLabel","createNumberFilter","_ref3","min","max","decimal","allowedDecimals","createEnumFilter","_ref4","options","selectionMode","optionType","map","option","value","label","inlineComponentThreshold","length","collectionData","createReferenceFilter","_ref5","additionalParams","collectionId","referencedSchema"],"sources":["../../../src/utils/filterCreators.ts"],"sourcesContent":["import {\n dateRangeFilter,\n idNameArrayFilter,\n numberRangeFilter,\n DateRangeFilter,\n RadioGroupFilter,\n NumberRangeFilter,\n AutoCompleteFilter,\n MultiSelectCheckboxFilter,\n MultiInlineCheckboxFilter,\n MultiSelectCollectionFilter,\n} from '@wix/patterns';\nimport { BooleanFilters } from '../dataSourceAdapters/constants';\nimport { FilterOptions } from '../hooks/useFilters';\nimport { SchemaConfig } from '../types';\n\ninterface FilterOption {\n value: string;\n label: string;\n}\n\ninterface BaseFilterParams {\n id: string;\n fieldId: string;\n commonFilterProps: Record<string, any>;\n}\n\nexport const createDateTimeFilter = ({\n id,\n fieldId,\n commonFilterProps,\n config,\n}: BaseFilterParams & {\n config?: {\n mode?: 'ONLY_PREDEFINED' | 'ONLY_CUSTOM' | 'COMBINE';\n presets?: string[];\n includeTime?: boolean;\n };\n}): FilterOptions => ({\n key: id,\n fieldId,\n filter: dateRangeFilter(),\n component: DateRangeFilter,\n props: {\n ...commonFilterProps,\n mode: config?.mode,\n dateRangeOptions: config?.presets,\n filterByTime: config?.includeTime,\n },\n});\n\nexport const createBooleanFilter = ({\n id,\n fieldId,\n commonFilterProps,\n config,\n}: BaseFilterParams & {\n config?: {\n trueLabel?: string;\n falseLabel?: string;\n };\n}): FilterOptions => ({\n key: id,\n fieldId,\n filter: idNameArrayFilter({\n matches: (fieldValue, filterValue) => {\n if (fieldValue) {\n return filterValue.some((v) => v.id === BooleanFilters.checked);\n }\n return filterValue.some((v) => v.id === BooleanFilters.unchecked);\n },\n }),\n component: RadioGroupFilter,\n props: {\n ...commonFilterProps,\n data: [\n {\n id: 'checked',\n name: config?.trueLabel || 'Yes',\n },\n {\n id: 'unchecked',\n name: config?.falseLabel || 'No',\n },\n ],\n },\n});\n\nexport const createNumberFilter = ({\n id,\n fieldId,\n commonFilterProps,\n config,\n}: BaseFilterParams & {\n config?: {\n min?: number;\n max?: number;\n allowedDecimals?: boolean;\n };\n}): FilterOptions => ({\n key: id,\n fieldId,\n filter: numberRangeFilter(),\n component: NumberRangeFilter,\n props: {\n ...commonFilterProps,\n min: config?.min,\n max: config?.max,\n decimal: config?.allowedDecimals,\n },\n});\n\nexport const createEnumFilter = ({\n id,\n fieldId,\n commonFilterProps,\n config,\n}: BaseFilterParams & {\n config: {\n options?: FilterOption[];\n selectionMode?: 'single' | 'multiple';\n optionType?: 'select' | 'radio' | 'checkbox' | 'inlineCheckbox';\n };\n}): FilterOptions => {\n const { options, selectionMode, optionType } = config;\n const data =\n options?.map((option: FilterOption) => ({\n id: option.value,\n name: option.label,\n })) ?? [];\n\n const inlineComponentThreshold = 5;\n\n let component;\n\n if (selectionMode === 'single') {\n component =\n data.length > inlineComponentThreshold\n ? AutoCompleteFilter\n : RadioGroupFilter;\n if (optionType === 'select') {\n component = AutoCompleteFilter;\n } else if (optionType === 'radio') {\n component = RadioGroupFilter;\n }\n } else {\n component =\n data.length > inlineComponentThreshold\n ? MultiSelectCheckboxFilter\n : MultiInlineCheckboxFilter;\n if (optionType === 'select') {\n component = MultiSelectCollectionFilter;\n } else if (optionType === 'inlineCheckbox') {\n component = MultiInlineCheckboxFilter;\n } else if (optionType === 'checkbox') {\n component = MultiSelectCheckboxFilter;\n }\n }\n\n return {\n key: id,\n fieldId,\n filter: idNameArrayFilter(),\n component,\n collectionData: data,\n props: { ...commonFilterProps, data },\n };\n};\n\nexport const createReferenceFilter = ({\n id,\n fieldId,\n commonFilterProps,\n config,\n additionalParams,\n}: BaseFilterParams & {\n config?: {\n selectionMode?: 'single' | 'multiple';\n };\n additionalParams: {\n referencedSchema: SchemaConfig;\n };\n}): FilterOptions => {\n const component =\n config?.selectionMode === 'single'\n ? AutoCompleteFilter\n : MultiSelectCollectionFilter;\n\n return {\n key: id,\n fieldId,\n filter: idNameArrayFilter(),\n component,\n collectionId: additionalParams.referencedSchema.id,\n props: commonFilterProps,\n };\n};\n"],"mappings":"AAAA,SACEA,eAAe,EACfC,iBAAiB,EACjBC,iBAAiB,EACjBC,eAAe,EACfC,gBAAgB,EAChBC,iBAAiB,EACjBC,kBAAkB,EAClBC,yBAAyB,EACzBC,yBAAyB,EACzBC,2BAA2B,QACtB,eAAe;AACtB,SAASC,cAAc,QAAQ,iCAAiC;AAehE,OAAO,MAAMC,oBAAoB,GAAGC,IAAA;EAAA,IAAC;IACnCC,EAAE;IACFC,OAAO;IACPC,iBAAiB;IACjBC;EAOF,CAAC,GAAAJ,IAAA;EAAA,OAAqB;IACpBK,GAAG,EAAEJ,EAAE;IACPC,OAAO;IACPI,MAAM,EAAElB,eAAe,CAAC,CAAC;IACzBmB,SAAS,EAAEhB,eAAe;IAC1BiB,KAAK,EAAE;MACL,GAAGL,iBAAiB;MACpBM,IAAI,EAAEL,MAAM,oBAANA,MAAM,CAAEK,IAAI;MAClBC,gBAAgB,EAAEN,MAAM,oBAANA,MAAM,CAAEO,OAAO;MACjCC,YAAY,EAAER,MAAM,oBAANA,MAAM,CAAES;IACxB;EACF,CAAC;AAAA,CAAC;AAEF,OAAO,MAAMC,mBAAmB,GAAGC,KAAA;EAAA,IAAC;IAClCd,EAAE;IACFC,OAAO;IACPC,iBAAiB;IACjBC;EAMF,CAAC,GAAAW,KAAA;EAAA,OAAqB;IACpBV,GAAG,EAAEJ,EAAE;IACPC,OAAO;IACPI,MAAM,EAAEjB,iBAAiB,CAAC;MACxB2B,OAAO,EAAEA,CAACC,UAAU,EAAEC,WAAW,KAAK;QACpC,IAAID,UAAU,EAAE;UACd,OAAOC,WAAW,CAACC,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACnB,EAAE,KAAKH,cAAc,CAACuB,OAAO,CAAC;QACjE;QACA,OAAOH,WAAW,CAACC,I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kBAAkB,GAClBG,2BAA2B;EAEjC,OAAO;IACLQ,GAAG,EAAEJ,EAAE;IACPC,OAAO;IACPI,MAAM,EAAEjB,iBAAiB,CAAC,CAAC;IAC3BkB,SAAS;IACTyC,YAAY,EAAED,gBAAgB,CAACE,gBAAgB,CAAChD,EAAE;IAClDO,KAAK,EAAEL;EACT,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoPatternsEntityPage.d.ts","sourceRoot":"","sources":["../../../../src/components/AutoPatternsEntityPage/AutoPatternsEntityPage.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AutoPatternsEntityPage.d.ts","sourceRoot":"","sources":["../../../../src/components/AutoPatternsEntityPage/AutoPatternsEntityPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAI/C,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,gBAAgB,CAAC;CACjC;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAQxE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditModeEntityPage.d.ts","sourceRoot":"","sources":["../../../../src/components/AutoPatternsEntityPage/EditModeEntityPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAgB/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC;IACxC,aAAa,EAAE,oBAAoB,CAAC;CACrC,CAgIA,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CardLayout } from '../../../types';
|
|
3
|
+
import { BaseInputRef } from '../Fields/types';
|
|
4
|
+
export interface RenderLayoutCardProps {
|
|
5
|
+
layout: CardLayout;
|
|
6
|
+
sectionId: string;
|
|
7
|
+
cardIndex: number;
|
|
8
|
+
setInputRef: (id: string, input: BaseInputRef) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const RenderLayoutCard: React.FC<RenderLayoutCardProps>;
|
|
11
|
+
//# sourceMappingURL=RenderLayoutCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderLayoutCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CACxD;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAmC5D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LayoutContent } from '../../../types';
|
|
3
|
+
import { BaseInputRef } from '../Fields/types';
|
|
4
|
+
export interface RenderLayoutContentProps {
|
|
5
|
+
content: LayoutContent;
|
|
6
|
+
level: number;
|
|
7
|
+
sectionId: string;
|
|
8
|
+
cardIndex: number;
|
|
9
|
+
contentIndex: number;
|
|
10
|
+
setInputRef: (id: string, input: BaseInputRef) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const RenderLayoutContent: React.FC<RenderLayoutContentProps>;
|
|
13
|
+
//# sourceMappingURL=RenderLayoutContent.d.ts.map
|
package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderLayoutContent.d.ts","sourceRoot":"","sources":["../../../../../src/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,aAAa,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CACxD;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAgFlE,CAAC"}
|