@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,"file":"RenderViewField.d.ts","sourceRoot":"","sources":["../../../../../src/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC;IACrC,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,GAAG,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CA6CA,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/AutoPatternsEntityPage/RenderLayout/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RenderLayoutCardProps } from '../RenderLayout';
|
|
3
|
+
interface RenderViewLayoutCardProps extends Omit<RenderLayoutCardProps, 'setInputRef'> {
|
|
4
|
+
entity: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
export declare const RenderViewLayoutCard: React.FC<RenderViewLayoutCardProps>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=RenderViewLayoutCard.d.ts.map
|
package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderViewLayoutCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,UAAU,yBACR,SAAQ,IAAI,CAAC,qBAAqB,EAAE,aAAa,CAAC;IAClD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAGD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAmCpE,CAAC"}
|
package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RenderLayoutContentProps } from '../RenderLayout';
|
|
3
|
+
interface RenderViewLayoutContentProps extends Omit<RenderLayoutContentProps, 'setInputRef'> {
|
|
4
|
+
entity: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
export declare const RenderViewLayoutContent: React.FC<RenderViewLayoutContentProps>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=RenderViewLayoutContent.d.ts.map
|
package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderViewLayoutContent.d.ts","sourceRoot":"","sources":["../../../../../src/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,UAAU,4BACR,SAAQ,IAAI,CAAC,wBAAwB,EAAE,aAAa,CAAC;IACrD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAGD,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAC5C,4BAA4B,CAmE7B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewEntityPageConfig } from '../../types';
|
|
3
|
+
interface ViewModeEntityPageProps {
|
|
4
|
+
configuration: ViewEntityPageConfig;
|
|
5
|
+
}
|
|
6
|
+
export declare const ViewModeEntityPage: React.FC<ViewModeEntityPageProps>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=ViewModeEntityPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewModeEntityPage.d.ts","sourceRoot":"","sources":["../../../../src/components/AutoPatternsEntityPage/ViewModeEntityPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAYnD,UAAU,uBAAuB;IAC/B,aAAa,EAAE,oBAAoB,CAAC;CACrC;AAGD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAkHhE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/AutoPatternsEntityPage/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/AutoPatternsEntityPage/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ActionsSDK, EntityPageConfig } from '../types';
|
|
3
|
+
export interface UseEntityPageActionsParams {
|
|
4
|
+
entityPageActions: EntityPageConfig['actions'];
|
|
5
|
+
entity: Record<string, any>;
|
|
6
|
+
sdk: ActionsSDK;
|
|
7
|
+
}
|
|
8
|
+
export declare const useEntityPageActions: ({ entityPageActions, entity, sdk, }: UseEntityPageActionsParams) => React.JSX.Element | null;
|
|
9
|
+
//# sourceMappingURL=useEntityPageActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEntityPageActions.d.ts","sourceRoot":"","sources":["../../../src/hooks/useEntityPageActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EACL,UAAU,EAEV,gBAAgB,EAIjB,MAAM,UAAU,CAAC;AAUlB,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,GAAG,EAAE,UAAU,CAAC;CACjB;AAED,eAAO,MAAM,oBAAoB,GAAI,qCAIlC,0BAA0B,6BA2G5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityPageHeaderTexts.d.ts","sourceRoot":"","sources":["../../../src/hooks/useEntityPageHeaderTexts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,wBAAwB,GAAI,8CAItC;IACD,MAAM,EAAE,gBAAgB,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useEntityPageHeaderTexts.d.ts","sourceRoot":"","sources":["../../../src/hooks/useEntityPageHeaderTexts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,wBAAwB,GAAI,8CAItC;IACD,MAAM,EAAE,gBAAgB,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;;;;;;;;iBAQoC,CAAC;;;CAQrC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ActionsSDK } from '../types';
|
|
2
|
-
import { EntityPageMoreActions } from '../types/actions';
|
|
3
2
|
import { MoreActionsItem } from '@wix/patterns';
|
|
4
3
|
import { FieldValues, UseFormReturn } from '@wix/patterns/form';
|
|
5
|
-
|
|
4
|
+
import { CustomActionConfig, DividerActionConfig, UpdateActionConfig } from '../types/actions/base';
|
|
5
|
+
export declare function useEntityPageMoreActions(moreActions: (CustomActionConfig | UpdateActionConfig | DividerActionConfig)[] | undefined, entity: Record<string, any>, sdk: ActionsSDK, form?: UseFormReturn<FieldValues, any, undefined>): MoreActionsItem[][];
|
|
6
6
|
//# sourceMappingURL=useEntityPageMoreActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityPageMoreActions.d.ts","sourceRoot":"","sources":["../../../src/hooks/useEntityPageMoreActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useEntityPageMoreActions.d.ts","sourceRoot":"","sources":["../../../src/hooks/useEntityPageMoreActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,UAAU,CAAC;AAQtD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,wBAAwB,CACtC,WAAW,EACP,CAAC,kBAAkB,GAAG,kBAAkB,GAAG,mBAAmB,CAAC,EAAE,GACjE,SAAS,EACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,GAAG,EAAE,UAAU,EACf,IAAI,CAAC,EAAE,aAAa,CAAC,WAAW,EAAE,GAAG,EAAE,SAAS,CAAC,uBAiElD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UpdateActionConfig, ViewEntityPageConfig } from '../types';
|
|
2
|
+
export declare const useNavigateEditEntityAction: ({ displayName, configuration, }: {
|
|
3
|
+
displayName: string;
|
|
4
|
+
configuration: ViewEntityPageConfig;
|
|
5
|
+
}) => (import("../types").DividerActionConfig | UpdateActionConfig | import("../types").CustomActionConfig)[];
|
|
6
|
+
//# sourceMappingURL=useNavigateEditEntityAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNavigateEditEntityAction.d.ts","sourceRoot":"","sources":["../../../src/hooks/useNavigateEditEntityAction.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGpE,eAAO,MAAM,2BAA2B,GAAI,iCAGzC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,oBAAoB,CAAC;CACrC,4GA4CA,CAAC"}
|
|
@@ -4,6 +4,7 @@ export type NavigateToEntityPageFunc = (args: {
|
|
|
4
4
|
}) => void;
|
|
5
5
|
export declare const useNavigation: () => {
|
|
6
6
|
navigateToEntityPage: ({ item, entityPageId }: any) => void;
|
|
7
|
+
navigateToCollectionPage: (parentPageId: string) => void;
|
|
7
8
|
getParentPagePath: (parentPageId?: string) => string | undefined;
|
|
8
9
|
getPagePath: (pageId?: string) => string | undefined;
|
|
9
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavigationUtils.d.ts","sourceRoot":"","sources":["../../../src/hooks/useNavigationUtils.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,wBAAwB,GAAG,CAAC,IAAI,EAAE;IAC5C,IAAI,EAAE,GAAG,CAAC;IACV,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,KAAK,IAAI,CAAC;AAEX,eAAO,MAAM,aAAa;;
|
|
1
|
+
{"version":3,"file":"useNavigationUtils.d.ts","sourceRoot":"","sources":["../../../src/hooks/useNavigationUtils.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,wBAAwB,GAAG,CAAC,IAAI,EAAE;IAC5C,IAAI,EAAE,GAAG,CAAC;IACV,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,KAAK,IAAI,CAAC;AAEX,eAAO,MAAM,aAAa;;6CAmCP,MAAM;uCAaL,MAAM,KAAG,MAAM,GAAG,SAAS;;CAY9C,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { CustomComponentProps, CustomActionCellActionResolver,
|
|
2
|
+
import { CustomComponentProps, CustomActionCellActionResolver, CustomEntityPageActionResolver, CustomBulkActionsActionResolver, CustomActionCollectionPageActionResolver, CustomActionCollectionPageActionOnRowClickResolver, IColumnValue, SchemaConfig } from '../types';
|
|
3
3
|
import { Section } from '@wix/patterns';
|
|
4
4
|
export interface PatternsWizardOverridesContextProps {
|
|
5
|
-
actions?: Record<string, CustomActionCellActionResolver | CustomBulkActionsActionResolver |
|
|
5
|
+
actions?: Record<string, CustomActionCellActionResolver | CustomBulkActionsActionResolver | CustomEntityPageActionResolver | CustomActionCollectionPageActionResolver | CustomActionCollectionPageActionOnRowClickResolver>;
|
|
6
6
|
columns?: Record<string, (props: IColumnValue<any>) => void>;
|
|
7
7
|
modals?: Record<string, React.FC<any>>;
|
|
8
8
|
emptyState?: Record<string, () => void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PatternsWizardOverridesContext.d.ts","sourceRoot":"","sources":["../../../src/providers/PatternsWizardOverridesContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,SAAS,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EACL,oBAAoB,EACpB,8BAA8B,EAC9B,
|
|
1
|
+
{"version":3,"file":"PatternsWizardOverridesContext.d.ts","sourceRoot":"","sources":["../../../src/providers/PatternsWizardOverridesContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,SAAS,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EACL,oBAAoB,EACpB,8BAA8B,EAC9B,8BAA8B,EAC9B,+BAA+B,EAC/B,wCAAwC,EACxC,kDAAkD,EAClD,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,WAAW,mCAAmC;IAClD,OAAO,CAAC,EAAE,MAAM,CACd,MAAM,EACJ,8BAA8B,GAC9B,+BAA+B,GAC/B,8BAA8B,GAC9B,wCAAwC,GACxC,kDAAkD,CACrD,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,CACxB,MAAM,EACN,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,YAAY,CAAC,CAC9D,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC;CACnD;AAMD,eAAO,MAAM,+BAA+B,EAAE,KAAK,CAAC,EAAE,CAAC;IACrD,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,mCAAmC,CAAC;CAC5C,CAMA,CAAC;AAEF,eAAO,MAAM,iCAAiC,QAC1C,mCAAmC,GACnC,SAEH,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FieldValues, UseFormReturn } from '@wix/patterns/form';
|
|
2
|
-
import { EntityPageMoreActions } from './actions/entityPageActions';
|
|
2
|
+
import { EntityPageMoreActions, EntityPagePrimaryActions, EntityPageSecondaryActions } from './actions/entityPageActions';
|
|
3
3
|
import { BaseCollectionConfig } from './types';
|
|
4
|
-
export type
|
|
4
|
+
export type EntityPageBaseConfig = {
|
|
5
5
|
route: {
|
|
6
6
|
path: string;
|
|
7
7
|
params: {
|
|
@@ -23,8 +23,24 @@ export type EntityPageConfig = {
|
|
|
23
23
|
main: CardLayout[];
|
|
24
24
|
sidebar?: CardLayout[];
|
|
25
25
|
};
|
|
26
|
-
moreActions?: EntityPageMoreActions;
|
|
27
26
|
} & BaseCollectionConfig;
|
|
27
|
+
export type EditEntityPageConfig = EntityPageBaseConfig & {
|
|
28
|
+
mode?: 'edit';
|
|
29
|
+
actions?: {
|
|
30
|
+
primaryActions?: never;
|
|
31
|
+
secondaryActions?: never;
|
|
32
|
+
moreActions?: EntityPageMoreActions;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type ViewEntityPageConfig = EntityPageBaseConfig & {
|
|
36
|
+
mode: 'view';
|
|
37
|
+
actions?: {
|
|
38
|
+
primaryActions?: EntityPagePrimaryActions;
|
|
39
|
+
secondaryActions?: EntityPageSecondaryActions;
|
|
40
|
+
moreActions?: EntityPageMoreActions;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export type EntityPageConfig = EditEntityPageConfig | ViewEntityPageConfig;
|
|
28
44
|
export interface CardLayout {
|
|
29
45
|
type: 'card';
|
|
30
46
|
card: {
|
|
@@ -61,7 +77,7 @@ interface ComponentItemContent {
|
|
|
61
77
|
}
|
|
62
78
|
export interface CustomComponentProps {
|
|
63
79
|
entity?: Record<string, any>;
|
|
64
|
-
form
|
|
80
|
+
form?: UseFormReturn<FieldValues, any, undefined>;
|
|
65
81
|
}
|
|
66
82
|
export {};
|
|
67
83
|
//# sourceMappingURL=EntityPageConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityPageConfig.d.ts","sourceRoot":"","sources":["../../../src/types/EntityPageConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"EntityPageConfig.d.ts","sourceRoot":"","sources":["../../../src/types/EntityPageConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC3B,M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AE;QACJ,KAAK,EAAE;YACL,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;QACF,QAAQ,CAAC,EAAE;YACT,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;QACF,QAAQ,EAAE,aAAa,EAAE,CAAC;KAC3B,CAAC;CACH;AAED,MAAM,MAAM,aAAa,GACrB,YAAY,GACZ,gBAAgB,GAChB,oBAAoB,CAAC;AAEzB,UAAU,YAAY;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,UAAU,gBAAgB;IACxB,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE;QACT,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,aAAa,EAAE,CAAC;KAC3B,CAAC;CACH;AAED,UAAU,oBAAoB;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE;QACT,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,aAAa,CAAC,WAAW,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;CACnD"}
|
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
import { FieldValues, UseFormReturn } from '@wix/patterns/form';
|
|
2
2
|
import { CustomActionParams, ResolvedAction } from '../..';
|
|
3
|
-
import { CustomActionConfig, DividerActionConfig } from './base';
|
|
3
|
+
import { CreateActionConfig, CustomActionConfig, DividerActionConfig } from './base';
|
|
4
4
|
export type EntityPageMoreActions = (CustomActionConfig | DividerActionConfig)[];
|
|
5
|
-
export
|
|
5
|
+
export type EntityPageActionConfig = CreateActionConfig | CustomActionConfig;
|
|
6
|
+
type EntityPageAction = {
|
|
7
|
+
type: 'action';
|
|
8
|
+
action: {
|
|
9
|
+
item: EntityPageActionConfig;
|
|
10
|
+
};
|
|
11
|
+
menu?: never;
|
|
12
|
+
};
|
|
13
|
+
type EntityPageMenu = {
|
|
14
|
+
type: 'menu';
|
|
15
|
+
menu: {
|
|
16
|
+
label: string;
|
|
17
|
+
items: (EntityPageActionConfig | DividerActionConfig)[];
|
|
18
|
+
};
|
|
19
|
+
action?: never;
|
|
20
|
+
};
|
|
21
|
+
export type EntityPagePrimaryActions = EntityPageAction | EntityPageMenu;
|
|
22
|
+
export type EntityPageSecondaryActions = EntityPageAction | EntityPageMenu;
|
|
23
|
+
export interface EntityPageActionParams {
|
|
6
24
|
entity: any;
|
|
7
|
-
form
|
|
25
|
+
form?: UseFormReturn<FieldValues, any, undefined>;
|
|
8
26
|
}
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
27
|
+
export type CustomEntityPageActionParams = CustomActionParams<EntityPageActionParams>;
|
|
28
|
+
export type CustomEntityPageActionResolver = (params: CustomEntityPageActionParams) => ResolvedAction;
|
|
29
|
+
export {};
|
|
11
30
|
//# sourceMappingURL=entityPageActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityPageActions.d.ts","sourceRoot":"","sources":["../../../../src/types/actions/entityPageActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,
|
|
1
|
+
{"version":3,"file":"entityPageActions.d.ts","sourceRoot":"","sources":["../../../../src/types/actions/entityPageActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,QAAQ,CAAC;AAEhB,MAAM,MAAM,qBAAqB,GAAG,CAChC,kBAAkB,GAClB,mBAAmB,CACtB,EAAE,CAAC;AAEJ,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAE7E,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE;QACN,IAAI,EAAE,sBAAsB,CAAC;KAC9B,CAAC;IACF,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,CAAC,sBAAsB,GAAG,mBAAmB,CAAC,EAAE,CAAC;KACzD,CAAC;IACF,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GAAG,cAAc,CAAC;AACzE,MAAM,MAAM,0BAA0B,GAAG,gBAAgB,GAAG,cAAc,CAAC;AAE3E,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,GAAG,CAAC;IACZ,IAAI,CAAC,EAAE,aAAa,CAAC,WAAW,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;CACnD;AAED,MAAM,MAAM,4BAA4B,GACtC,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;AAE7C,MAAM,MAAM,8BAA8B,GAAG,CAC3C,MAAM,EAAE,4BAA4B,KACjC,cAAc,CAAC"}
|
|
@@ -38,7 +38,7 @@ export interface BulkDeleteActionParams extends BaseActionParams {
|
|
|
38
38
|
export interface DeleteActionParams extends ActionCellBaseParams {
|
|
39
39
|
action: DeleteActionConfig;
|
|
40
40
|
}
|
|
41
|
-
export interface UpdateActionParams extends
|
|
41
|
+
export interface UpdateActionParams extends BaseActionParams {
|
|
42
42
|
action: UpdateActionConfig;
|
|
43
43
|
}
|
|
44
44
|
export interface CreateActionParams extends BaseActionParams {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/utils/actions/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,OAAO,EACR,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,WAAW,UAAW,SAAQ,OAAO;IACzC,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAC;IAC9D,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,CACpB,YAAY,EAAE,MAAM,KACjB,2BAA2B,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACvD,GAAG,EAAE,UAAU,CAAC;IAChB,YAAY,EAAE,CAAC,CAAC;CACjB;AAED,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D,YAAY,EAAE;QACZ,IAAI,EAAE,GAAG,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,aAAa,CAAC,GAAG,EA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
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Matvey Oklander",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"*.{js,ts}": "yarn lint"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@babel/runtime": "^7.
|
|
37
|
+
"@babel/runtime": "^7.28.2",
|
|
38
38
|
"@wix/data": "^1.0.222",
|
|
39
|
-
"@wix/wix-ui-icons-common": "^3.
|
|
39
|
+
"@wix/wix-ui-icons-common": "^3.83.0",
|
|
40
40
|
"ejs": "^3.1.10",
|
|
41
41
|
"lodash": "^4.17.21"
|
|
42
42
|
},
|
|
@@ -50,20 +50,20 @@
|
|
|
50
50
|
"@types/jest": "^27.5.2",
|
|
51
51
|
"@types/lodash": "^4.17.20",
|
|
52
52
|
"@types/node": "^16.18.126",
|
|
53
|
-
"@types/node-fetch": "^2.6.
|
|
53
|
+
"@types/node-fetch": "^2.6.13",
|
|
54
54
|
"@types/react": "^16.14.65",
|
|
55
55
|
"@wix/crm": "^1.0.385",
|
|
56
|
-
"@wix/design-system": "^1.
|
|
57
|
-
"@wix/eslint-config-yoshi": "^6.
|
|
58
|
-
"@wix/fe-essentials-standalone": "^1.
|
|
59
|
-
"@wix/jest-yoshi-preset": "^6.
|
|
60
|
-
"@wix/patterns": "^1.
|
|
61
|
-
"@wix/sdk": "^1.15.
|
|
56
|
+
"@wix/design-system": "^1.210.0",
|
|
57
|
+
"@wix/eslint-config-yoshi": "^6.154.0",
|
|
58
|
+
"@wix/fe-essentials-standalone": "^1.1375.0",
|
|
59
|
+
"@wix/jest-yoshi-preset": "^6.154.0",
|
|
60
|
+
"@wix/patterns": "^1.248.0",
|
|
61
|
+
"@wix/sdk": "^1.15.26",
|
|
62
62
|
"@wix/sdk-testkit": ">=0.1.6",
|
|
63
|
-
"@wix/wix-data-items-common": "^1.0.
|
|
64
|
-
"@wix/wix-data-items-sdk": "^1.0.
|
|
65
|
-
"@wix/yoshi-flow-library": "^6.
|
|
66
|
-
"@wix/yoshi-style-dependencies": "^6.
|
|
63
|
+
"@wix/wix-data-items-common": "^1.0.204",
|
|
64
|
+
"@wix/wix-data-items-sdk": "^1.0.396",
|
|
65
|
+
"@wix/yoshi-flow-library": "^6.154.0",
|
|
66
|
+
"@wix/yoshi-style-dependencies": "^6.154.0",
|
|
67
67
|
"chance": "^1.1.13",
|
|
68
68
|
"date-fns": "^2.30.0",
|
|
69
69
|
"express": "^4.21.2",
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"wallaby": {
|
|
126
126
|
"autoDetect": true
|
|
127
127
|
},
|
|
128
|
-
"falconPackageHash": "
|
|
128
|
+
"falconPackageHash": "11fa6bfa4376c285b81615d85b2223cda794a962bc5108386330e88d"
|
|
129
129
|
}
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
## SchemaConfig Usage
|
|
2
|
-
|
|
3
|
-
SchemaConfig provides complete collection metadata and server actions. Essential for dynamic operations and accessing collection structure information.
|
|
4
|
-
|
|
5
|
-
### TypeScript Interface Definition
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
export interface SchemaConfig {
|
|
9
|
-
id: string;
|
|
10
|
-
fields: Record<string, Field | undefined>;
|
|
11
|
-
displayField: string;
|
|
12
|
-
idField: string;
|
|
13
|
-
actions: {
|
|
14
|
-
get: (entityId: string) => Promise<any>;
|
|
15
|
-
create: (newEntity: Partial<any>) => Promise<any>;
|
|
16
|
-
update: (updatedEntity: any) => Promise<any>;
|
|
17
|
-
delete: (entityId: string) => Promise<any>;
|
|
18
|
-
bulkDelete: (entityIds: string[]) => Promise<any>;
|
|
19
|
-
find: (
|
|
20
|
-
query: ComputedQuery<any>,
|
|
21
|
-
options?: {
|
|
22
|
-
searchableFieldIds?: string[];
|
|
23
|
-
filterFieldMapping?: Record<string, { fieldId: string }>;
|
|
24
|
-
},
|
|
25
|
-
) => Promise<{ items: any[]; total: number }>;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### Supporting Type Definitions
|
|
31
|
-
|
|
32
|
-
```typescript
|
|
33
|
-
export type PatternsFieldType =
|
|
34
|
-
| 'SHORT_TEXT'
|
|
35
|
-
| 'LONG_TEXT'
|
|
36
|
-
| 'NUMBER'
|
|
37
|
-
| 'BOOLEAN'
|
|
38
|
-
| 'DATE'
|
|
39
|
-
| 'DATETIME'
|
|
40
|
-
| 'URL'
|
|
41
|
-
| 'ARRAY'
|
|
42
|
-
| 'REFERENCE'
|
|
43
|
-
| 'IMAGE';
|
|
44
|
-
|
|
45
|
-
interface BaseField {
|
|
46
|
-
id: string;
|
|
47
|
-
displayName: string;
|
|
48
|
-
validation?: {
|
|
49
|
-
numberRange?: NumberRange;
|
|
50
|
-
stringLengthRange?: StringLengthRange;
|
|
51
|
-
required: boolean;
|
|
52
|
-
};
|
|
53
|
-
capabilities: {
|
|
54
|
-
supportedQueryOperators: QueryOperator[];
|
|
55
|
-
sortable: boolean;
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface ReferenceField extends BaseField {
|
|
60
|
-
type: 'REFERENCE';
|
|
61
|
-
referenceMetadata: {
|
|
62
|
-
referencedCollectionId: string;
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface NonReferenceField extends BaseField {
|
|
67
|
-
type: Exclude<PatternsFieldType, 'REFERENCE'>;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export type Field = ReferenceField | NonReferenceField;
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Key Properties
|
|
74
|
-
|
|
75
|
-
• **id** - `string`
|
|
76
|
-
- Collection identifier (e.g., "WixPets")
|
|
77
|
-
- Example: `schema.id === "WixPets"`
|
|
78
|
-
|
|
79
|
-
• **idField** - `string`
|
|
80
|
-
- Primary key field name (usually "_id")
|
|
81
|
-
- Required for all update/delete operations
|
|
82
|
-
- Example: `const id = item[schema.idField]`
|
|
83
|
-
|
|
84
|
-
• **displayField** - `string`
|
|
85
|
-
- Main field for displaying items (name, title, etc.)
|
|
86
|
-
- Used in UI components for item identification
|
|
87
|
-
- Example: `const label = item[schema.displayField]`
|
|
88
|
-
|
|
89
|
-
• **fields** - `Record<string, Field | undefined>`
|
|
90
|
-
- Complete field definitions with types and metadata
|
|
91
|
-
- Useful for dynamic form generation or validation
|
|
92
|
-
- Each field contains type information, validation rules, and capabilities
|
|
93
|
-
- Example: `schema.fields.name.type === 'SHORT_TEXT'`
|
|
94
|
-
|
|
95
|
-
• **actions** - Server operation functions
|
|
96
|
-
- Pre-configured API calls for CRUD operations
|
|
97
|
-
- Use with optimistic actions for best UX
|
|
98
|
-
- All actions return Promises and handle server communication
|
|
99
|
-
- Example: `await schema.actions.update(item)`
|
|
100
|
-
|
|
101
|
-
### Available Schema Actions
|
|
102
|
-
|
|
103
|
-
#### Individual Entity Operations
|
|
104
|
-
- **schema.actions.get(entityId)** - Retrieve a single entity by ID
|
|
105
|
-
- **schema.actions.create(newEntity)** - Create a new entity
|
|
106
|
-
- **schema.actions.update(updatedEntity)** - Update an existing entity
|
|
107
|
-
- **schema.actions.delete(entityId)** - Delete a single entity by ID
|
|
108
|
-
|
|
109
|
-
#### Bulk Operations
|
|
110
|
-
- **schema.actions.bulkDelete(entityIds)** - Delete multiple entities by their IDs
|
|
111
|
-
|
|
112
|
-
#### Query Operations
|
|
113
|
-
- **schema.actions.find(query, options)** - Search and filter entities
|
|
114
|
-
- `query`: ComputedQuery object with filtering and sorting criteria
|
|
115
|
-
- `options.searchableFieldIds`: Array of field IDs that support text search
|
|
116
|
-
- `options.filterFieldMapping`: Maps filter IDs to actual field IDs for complex filtering
|
|
117
|
-
- Returns: `{ items: any[], total: number }`
|
|
118
|
-
|
|
119
|
-
### Field Type Information
|
|
120
|
-
|
|
121
|
-
Each field in the `fields` record contains:
|
|
122
|
-
|
|
123
|
-
- **id**: Unique field identifier
|
|
124
|
-
- **displayName**: Human-readable field name
|
|
125
|
-
- **type**: One of the supported `PatternsFieldType` values
|
|
126
|
-
- **validation**: Optional validation rules including:
|
|
127
|
-
- `numberRange`: Min/max values for numeric fields
|
|
128
|
-
- `stringLengthRange`: Min/max length for text fields
|
|
129
|
-
- `required`: Whether the field is mandatory
|
|
130
|
-
- **capabilities**: Field behavior configuration:
|
|
131
|
-
- `supportedQueryOperators`: Array of operators this field supports for filtering
|
|
132
|
-
- `sortable`: Whether this field can be used for sorting
|
|
133
|
-
|
|
134
|
-
### Reference Fields
|
|
135
|
-
|
|
136
|
-
Reference fields have additional metadata:
|
|
137
|
-
- **referenceMetadata.referencedCollectionId**: ID of the collection being referenced
|
|
138
|
-
- Used for establishing relationships between different collections
|
|
139
|
-
|
|
140
|
-
### Schema Validation Checklist
|
|
141
|
-
|
|
142
|
-
Before using schema in operations:
|
|
143
|
-
|
|
144
|
-
✓ Check if schema exists: `if (!schema) return;`
|
|
145
|
-
✓ Verify required fields exist on items
|
|
146
|
-
✓ Use `schema.idField` for ID operations
|
|
147
|
-
✓ Use `schema.displayField` for UI display
|
|
148
|
-
✓ Use `schema.actions` for server operations
|
|
149
|
-
✓ Check field capabilities before applying filters or sorting
|
|
150
|
-
|
|
151
|
-
### Common Usage Patterns
|
|
152
|
-
|
|
153
|
-
- **ActionCell**: Use `schema.actions.update()` or `schema.actions.delete()` for single item operations
|
|
154
|
-
- **BulkActions**: Use `schema.actions.bulkDelete()` for multiple items
|
|
155
|
-
- **Dynamic UI**: Use `schema.fields` to build forms or validate data
|
|
156
|
-
- **Error Messages**: Use `schema.displayField` to create meaningful user feedback
|
|
157
|
-
- **Field Validation**: Use `schema.fields[fieldId].validation` for form validation rules
|
|
158
|
-
- **Query Building**: Use `schema.fields[fieldId].capabilities.supportedQueryOperators` to build dynamic filters
|
|
159
|
-
|
|
160
|
-
### Example Usage
|
|
161
|
-
|
|
162
|
-
```typescript
|
|
163
|
-
// Using schema for dynamic operations
|
|
164
|
-
const handleUpdateEntity = async (updatedItem: any) => {
|
|
165
|
-
const schema = sdk.getSchema(collectionId);
|
|
166
|
-
|
|
167
|
-
if (!schema) {
|
|
168
|
-
throw new Error('Schema not available');
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// Validate required fields
|
|
172
|
-
const nameField = schema.fields.name;
|
|
173
|
-
if (nameField?.validation?.required && !updatedItem.name) {
|
|
174
|
-
throw new Error(`${nameField.displayName} is required`);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// Perform update
|
|
178
|
-
await schema.actions.update(updatedItem);
|
|
179
|
-
|
|
180
|
-
// Show success message using display field
|
|
181
|
-
const displayValue = updatedItem[schema.displayField];
|
|
182
|
-
console.log(`Updated ${displayValue} successfully`);
|
|
183
|
-
};
|
|
184
|
-
```
|