@wix/auto-patterns 1.43.0 → 1.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.js +19 -5
- package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -1
- package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js +3 -0
- package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js.map +1 -1
- package/dist/cjs/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +29 -74
- package/dist/cjs/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +3 -3
- package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/EditModeEntityPage.js +26 -14
- package/dist/cjs/components/AutoPatternsEntityPage/EditModeEntityPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.js +38 -29
- package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/index.js +0 -6
- package/dist/cjs/components/AutoPatternsEntityPage/index.js.map +1 -1
- package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.js +147 -25
- package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -1
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js +68 -30
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js +8 -7
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
- package/dist/cjs/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.js +165 -0
- package/dist/cjs/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.js.map +1 -0
- package/dist/cjs/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.js +15 -0
- package/dist/cjs/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.js.map +1 -0
- package/dist/cjs/components/AutoPatternsSettingsPage/index.js +10 -0
- package/dist/cjs/components/AutoPatternsSettingsPage/index.js.map +1 -0
- package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js +141 -41
- package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
- package/dist/cjs/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js +169 -9
- package/dist/cjs/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js.map +1 -1
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/Checkbox.js +1 -1
- package/dist/cjs/components/fields/Checkbox.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/DateInput.js +9 -8
- package/dist/cjs/components/fields/DateInput.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/DateTime.js +13 -12
- package/dist/cjs/components/fields/DateTime.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/ImageInput.js +11 -10
- package/dist/cjs/components/fields/ImageInput.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/LongText.js +9 -8
- package/dist/cjs/components/fields/LongText.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/Number.js +9 -8
- package/dist/cjs/components/fields/Number.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/ShortText.js +9 -8
- package/dist/cjs/components/fields/ShortText.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/Url.js +11 -10
- package/dist/cjs/components/fields/Url.js.map +1 -0
- package/dist/cjs/components/fields/index.js +38 -0
- package/dist/cjs/components/fields/index.js.map +1 -0
- package/dist/cjs/components/fields/types.js.map +1 -0
- package/dist/cjs/components/fields/utils/dates.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js → layouts/ContentCard.js} +26 -15
- package/dist/cjs/components/layouts/ContentCard.js.map +1 -0
- package/dist/cjs/components/layouts/ContentCardLayout.js +157 -0
- package/dist/cjs/components/layouts/ContentCardLayout.js.map +1 -0
- package/dist/cjs/components/layouts/ContentSkeleton.js +98 -0
- package/dist/cjs/components/layouts/ContentSkeleton.js.map +1 -0
- package/dist/cjs/components/layouts/FormField.js +52 -0
- package/dist/cjs/components/layouts/FormField.js.map +1 -0
- package/dist/cjs/components/layouts/ViewField.js +68 -0
- package/dist/cjs/components/layouts/ViewField.js.map +1 -0
- package/dist/cjs/components/layouts/types.js +4 -0
- package/dist/cjs/components/layouts/types.js.map +1 -0
- package/dist/cjs/hooks/getCommonCollectionFeaturesAsync.js +11 -0
- package/dist/cjs/hooks/getCommonCollectionFeaturesAsync.js.map +1 -0
- package/dist/cjs/hooks/getFilterComponent.js +52 -0
- package/dist/cjs/hooks/getFilterComponent.js.map +1 -0
- package/dist/cjs/hooks/index.js +4 -11
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/pluginsDynamicImports.js +25 -0
- package/dist/cjs/hooks/pluginsDynamicImports.js.map +1 -0
- package/dist/cjs/hooks/useAsyncFeaturesPromiseState.js +30 -0
- package/dist/cjs/hooks/useAsyncFeaturesPromiseState.js.map +1 -0
- package/dist/cjs/hooks/useBaseCollectionComponentReadyFeatures.js +62 -0
- package/dist/cjs/hooks/useBaseCollectionComponentReadyFeatures.js.map +1 -0
- package/dist/cjs/hooks/useBasePatternsStateParams.js +36 -0
- package/dist/cjs/hooks/useBasePatternsStateParams.js.map +1 -0
- package/dist/cjs/hooks/useBaseTableFeatures.js +2 -1
- package/dist/cjs/hooks/useBaseTableFeatures.js.map +1 -1
- package/dist/cjs/hooks/useCollectionInitAsyncDeps.js +15 -0
- package/dist/cjs/hooks/useCollectionInitAsyncDeps.js.map +1 -0
- package/dist/cjs/hooks/useCommonCollectionFeatures.js +14 -4
- package/dist/cjs/hooks/useCommonCollectionFeatures.js.map +1 -1
- package/dist/cjs/hooks/useFilters.js +17 -103
- package/dist/cjs/hooks/useFilters.js.map +1 -1
- package/dist/cjs/hooks/useFiltersState.js +112 -0
- package/dist/cjs/hooks/useFiltersState.js.map +1 -0
- package/dist/cjs/hooks/useGridFeaturesAsync.js +42 -0
- package/dist/cjs/hooks/useGridFeaturesAsync.js.map +1 -0
- package/dist/cjs/hooks/useGridVisibleFieldIds.js +17 -0
- package/dist/cjs/hooks/useGridVisibleFieldIds.js.map +1 -0
- package/dist/cjs/hooks/usePagePath.js +4 -1
- package/dist/cjs/hooks/usePagePath.js.map +1 -1
- package/dist/cjs/hooks/useSettingsPageMoreActions.js +36 -0
- package/dist/cjs/hooks/useSettingsPageMoreActions.js.map +1 -0
- package/dist/cjs/hooks/useSyncCollectionStateToAppContext.js +22 -0
- package/dist/cjs/hooks/useSyncCollectionStateToAppContext.js.map +1 -0
- package/dist/cjs/hooks/useTableFeaturesAsync.js +51 -0
- package/dist/cjs/hooks/useTableFeaturesAsync.js.map +1 -0
- package/dist/cjs/hooks/useTableGridSwitchFeaturesAsync.js +52 -0
- package/dist/cjs/hooks/useTableGridSwitchFeaturesAsync.js.map +1 -0
- package/dist/cjs/hooks/useTableSections.js +18 -0
- package/dist/cjs/hooks/useTableSections.js.map +1 -0
- package/dist/cjs/providers/AutoPatternsOverridesContext.js +1 -1
- package/dist/cjs/providers/AutoPatternsOverridesContext.js.map +1 -1
- package/dist/cjs/types/SettingsPageConfig.js +4 -0
- package/dist/cjs/types/SettingsPageConfig.js.map +1 -0
- package/dist/cjs/types/actions/base.js.map +1 -1
- package/dist/cjs/types/actions/entityPageActions.js.map +1 -1
- package/dist/cjs/types/actions/formPageActions.js +4 -0
- package/dist/cjs/types/actions/formPageActions.js.map +1 -0
- package/dist/cjs/types/actions/index.js +6 -0
- package/dist/cjs/types/actions/index.js.map +1 -1
- package/dist/cjs/types/index.js +6 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/types/types.js.map +1 -1
- package/dist/cjs/utils/filterCreators.js +16 -31
- package/dist/cjs/utils/filterCreators.js.map +1 -1
- package/dist/cjs/utils/minimalRequiredPatternsRuntimeCheck.js +18 -0
- package/dist/cjs/utils/minimalRequiredPatternsRuntimeCheck.js.map +1 -0
- package/dist/cjs/utils/minimalRequiredRuntimeCheck.js +21 -0
- package/dist/cjs/utils/minimalRequiredRuntimeCheck.js.map +1 -0
- package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js +14 -1
- package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -1
- package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js +4 -1
- package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js.map +1 -1
- package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +23 -31
- package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +3 -3
- package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js +21 -8
- package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js +21 -12
- package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/index.js +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/index.js.map +1 -1
- package/dist/esm/components/AutoPatternsGrid/AutoPatternsGrid.js +134 -28
- package/dist/esm/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -1
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js +34 -13
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js +2 -1
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
- package/dist/esm/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.js +108 -0
- package/dist/esm/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.js.map +1 -0
- package/dist/esm/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.js +10 -0
- package/dist/esm/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.js.map +1 -0
- package/dist/esm/components/AutoPatternsSettingsPage/index.js +2 -0
- package/dist/esm/components/AutoPatternsSettingsPage/index.js.map +1 -0
- package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js +126 -42
- package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
- package/dist/esm/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js +155 -10
- package/dist/esm/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js.map +1 -1
- package/dist/esm/components/fields/Checkbox.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/DateInput.js +7 -6
- package/dist/esm/components/fields/DateInput.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/DateTime.js +7 -6
- package/dist/esm/components/fields/DateTime.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/ImageInput.js +9 -8
- package/dist/esm/components/fields/ImageInput.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/LongText.js +7 -6
- package/dist/esm/components/fields/LongText.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/Number.js +7 -6
- package/dist/esm/components/fields/Number.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/ShortText.js +7 -6
- package/dist/esm/components/fields/ShortText.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/Url.js +7 -6
- package/dist/esm/components/fields/Url.js.map +1 -0
- package/dist/esm/components/fields/index.js +10 -0
- package/dist/esm/components/fields/index.js.map +1 -0
- package/dist/esm/components/fields/types.js.map +1 -0
- package/dist/esm/components/fields/utils/dates.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js → layouts/ContentCard.js} +19 -8
- package/dist/esm/components/layouts/ContentCard.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js → layouts/ContentCardLayout.js} +38 -19
- package/dist/esm/components/layouts/ContentCardLayout.js.map +1 -0
- package/dist/esm/components/layouts/ContentSkeleton.js +47 -0
- package/dist/esm/components/layouts/ContentSkeleton.js.map +1 -0
- package/dist/esm/components/layouts/FormField.js +40 -0
- package/dist/esm/components/layouts/FormField.js.map +1 -0
- package/dist/esm/components/layouts/ViewField.js +43 -0
- package/dist/esm/components/layouts/ViewField.js.map +1 -0
- package/dist/esm/components/layouts/types.js +2 -0
- package/dist/esm/components/layouts/types.js.map +1 -0
- package/dist/esm/hooks/getCommonCollectionFeaturesAsync.js +7 -0
- package/dist/esm/hooks/getCommonCollectionFeaturesAsync.js.map +1 -0
- package/dist/esm/hooks/getFilterComponent.js +48 -0
- package/dist/esm/hooks/getFilterComponent.js.map +1 -0
- package/dist/esm/hooks/index.js +1 -2
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/pluginsDynamicImports.js +13 -0
- package/dist/esm/hooks/pluginsDynamicImports.js.map +1 -0
- package/dist/esm/hooks/useAsyncFeaturesPromiseState.js +28 -0
- package/dist/esm/hooks/useAsyncFeaturesPromiseState.js.map +1 -0
- package/dist/esm/hooks/useBaseCollectionComponentReadyFeatures.js +58 -0
- package/dist/esm/hooks/useBaseCollectionComponentReadyFeatures.js.map +1 -0
- package/dist/esm/hooks/useBasePatternsStateParams.js +32 -0
- package/dist/esm/hooks/useBasePatternsStateParams.js.map +1 -0
- package/dist/esm/hooks/useBaseTableFeatures.js +1 -0
- package/dist/esm/hooks/useBaseTableFeatures.js.map +1 -1
- package/dist/esm/hooks/useCollectionInitAsyncDeps.js +11 -0
- package/dist/esm/hooks/useCollectionInitAsyncDeps.js.map +1 -0
- package/dist/esm/hooks/useCommonCollectionFeatures.js +1 -0
- package/dist/esm/hooks/useCommonCollectionFeatures.js.map +1 -1
- package/dist/esm/hooks/useFilters.js +14 -100
- package/dist/esm/hooks/useFilters.js.map +1 -1
- package/dist/esm/hooks/useFiltersState.js +107 -0
- package/dist/esm/hooks/useFiltersState.js.map +1 -0
- package/dist/esm/hooks/useGridFeaturesAsync.js +37 -0
- package/dist/esm/hooks/useGridFeaturesAsync.js.map +1 -0
- package/dist/esm/hooks/useGridVisibleFieldIds.js +13 -0
- package/dist/esm/hooks/useGridVisibleFieldIds.js.map +1 -0
- package/dist/esm/hooks/usePagePath.js +4 -1
- package/dist/esm/hooks/usePagePath.js.map +1 -1
- package/dist/esm/hooks/useSettingsPageMoreActions.js +32 -0
- package/dist/esm/hooks/useSettingsPageMoreActions.js.map +1 -0
- package/dist/esm/hooks/useSyncCollectionStateToAppContext.js +18 -0
- package/dist/esm/hooks/useSyncCollectionStateToAppContext.js.map +1 -0
- package/dist/esm/hooks/useTableFeaturesAsync.js +46 -0
- package/dist/esm/hooks/useTableFeaturesAsync.js.map +1 -0
- package/dist/esm/hooks/useTableGridSwitchFeaturesAsync.js +47 -0
- package/dist/esm/hooks/useTableGridSwitchFeaturesAsync.js.map +1 -0
- package/dist/esm/hooks/useTableSections.js +14 -0
- package/dist/esm/hooks/useTableSections.js.map +1 -0
- package/dist/esm/providers/AutoPatternsOverridesContext.js.map +1 -1
- package/dist/esm/types/SettingsPageConfig.js +2 -0
- package/dist/esm/types/SettingsPageConfig.js.map +1 -0
- package/dist/esm/types/actions/base.js.map +1 -1
- package/dist/esm/types/actions/entityPageActions.js.map +1 -1
- package/dist/esm/types/actions/formPageActions.js +2 -0
- package/dist/esm/types/actions/formPageActions.js.map +1 -0
- package/dist/esm/types/actions/index.js +1 -0
- package/dist/esm/types/actions/index.js.map +1 -1
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/types/types.js.map +1 -1
- package/dist/esm/utils/filterCreators.js +17 -32
- package/dist/esm/utils/filterCreators.js.map +1 -1
- package/dist/esm/utils/minimalRequiredPatternsRuntimeCheck.js +14 -0
- package/dist/esm/utils/minimalRequiredPatternsRuntimeCheck.js.map +1 -0
- package/dist/esm/utils/minimalRequiredRuntimeCheck.js +17 -0
- package/dist/esm/utils/minimalRequiredRuntimeCheck.js.map +1 -0
- package/dist/types/components/AutoPatternsApp/AutoPatternsApp.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsApp/AutoPatternsApp.uni.driver.d.ts +4 -1
- package/dist/types/components/AutoPatternsApp/AutoPatternsApp.uni.driver.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.d.ts +6 -0
- package/dist/types/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/EditModeEntityPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/ViewModeEntityPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/index.d.ts +0 -1
- package/dist/types/components/AutoPatternsEntityPage/index.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsGrid/AutoPatternsGrid.d.ts +17 -2
- package/dist/types/components/AutoPatternsGrid/AutoPatternsGrid.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsRoute/AutoPatternsPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsRoute/AutoPatternsRoutes.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.d.ts +6 -0
- package/dist/types/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.d.ts +145 -0
- package/dist/types/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsSettingsPage/index.d.ts +2 -0
- package/dist/types/components/AutoPatternsSettingsPage/index.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts +17 -2
- package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.d.ts +18 -2
- package/dist/types/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.d.ts.map +1 -1
- package/dist/types/components/fields/Checkbox.d.ts.map +1 -0
- package/dist/types/components/fields/DateInput.d.ts.map +1 -0
- package/dist/types/components/fields/DateTime.d.ts.map +1 -0
- package/dist/types/components/fields/ImageInput.d.ts.map +1 -0
- package/dist/types/components/fields/LongText.d.ts.map +1 -0
- package/dist/types/components/fields/Number.d.ts.map +1 -0
- package/dist/types/components/fields/ShortText.d.ts.map +1 -0
- package/dist/types/components/fields/Url.d.ts.map +1 -0
- package/dist/types/components/fields/index.d.ts +10 -0
- package/dist/types/components/fields/index.d.ts.map +1 -0
- package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/types.d.ts +4 -1
- package/dist/types/components/fields/types.d.ts.map +1 -0
- package/dist/types/components/fields/utils/dates.d.ts.map +1 -0
- package/dist/types/components/layouts/ContentCard.d.ts +17 -0
- package/dist/types/components/layouts/ContentCard.d.ts.map +1 -0
- package/dist/types/components/layouts/ContentCardLayout.d.ts +18 -0
- package/dist/types/components/layouts/ContentCardLayout.d.ts.map +1 -0
- package/dist/types/components/layouts/ContentSkeleton.d.ts +9 -0
- package/dist/types/components/layouts/ContentSkeleton.d.ts.map +1 -0
- package/dist/types/components/layouts/FormField.d.ts +13 -0
- package/dist/types/components/layouts/FormField.d.ts.map +1 -0
- package/dist/types/components/layouts/ViewField.d.ts +8 -0
- package/dist/types/components/layouts/ViewField.d.ts.map +1 -0
- package/dist/types/components/layouts/types.d.ts +3 -0
- package/dist/types/components/layouts/types.d.ts.map +1 -0
- package/dist/types/hooks/getCommonCollectionFeaturesAsync.d.ts +4 -0
- package/dist/types/hooks/getCommonCollectionFeaturesAsync.d.ts.map +1 -0
- package/dist/types/hooks/getFilterComponent.d.ts +4 -0
- package/dist/types/hooks/getFilterComponent.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +1 -2
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/pluginsDynamicImports.d.ts +7 -0
- package/dist/types/hooks/pluginsDynamicImports.d.ts.map +1 -0
- package/dist/types/hooks/useAsyncFeaturesPromiseState.d.ts +6 -0
- package/dist/types/hooks/useAsyncFeaturesPromiseState.d.ts.map +1 -0
- package/dist/types/hooks/useBaseCollectionComponentReadyFeatures.d.ts +36 -0
- package/dist/types/hooks/useBaseCollectionComponentReadyFeatures.d.ts.map +1 -0
- package/dist/types/hooks/useBasePatternsStateParams.d.ts +31 -0
- package/dist/types/hooks/useBasePatternsStateParams.d.ts.map +1 -0
- package/dist/types/hooks/useBaseTableFeatures.d.ts +2 -0
- package/dist/types/hooks/useBaseTableFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useCollectionInitAsyncDeps.d.ts +4 -0
- package/dist/types/hooks/useCollectionInitAsyncDeps.d.ts.map +1 -0
- package/dist/types/hooks/useCommonCollectionFeatures.d.ts +1 -0
- package/dist/types/hooks/useCommonCollectionFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useFilters.d.ts +9 -21
- package/dist/types/hooks/useFilters.d.ts.map +1 -1
- package/dist/types/hooks/useFiltersState.d.ts +26 -0
- package/dist/types/hooks/useFiltersState.d.ts.map +1 -0
- package/dist/types/hooks/useGridDragAndDrop.d.ts +1 -1
- package/dist/types/hooks/useGridFeaturesAsync.d.ts +26 -0
- package/dist/types/hooks/useGridFeaturesAsync.d.ts.map +1 -0
- package/dist/types/hooks/useGridVisibleFieldIds.d.ts +3 -0
- package/dist/types/hooks/useGridVisibleFieldIds.d.ts.map +1 -0
- package/dist/types/hooks/usePagePath.d.ts.map +1 -1
- package/dist/types/hooks/useSettingsPageMoreActions.d.ts +5 -0
- package/dist/types/hooks/useSettingsPageMoreActions.d.ts.map +1 -0
- package/dist/types/hooks/useSyncCollectionStateToAppContext.d.ts +6 -0
- package/dist/types/hooks/useSyncCollectionStateToAppContext.d.ts.map +1 -0
- package/dist/types/hooks/useTableFeaturesAsync.d.ts +29 -0
- package/dist/types/hooks/useTableFeaturesAsync.d.ts.map +1 -0
- package/dist/types/hooks/useTableGridSwitchDragAndDrop.d.ts +1 -1
- package/dist/types/hooks/useTableGridSwitchFeaturesAsync.d.ts +29 -0
- package/dist/types/hooks/useTableGridSwitchFeaturesAsync.d.ts.map +1 -0
- package/dist/types/hooks/useTableSections.d.ts +8 -0
- package/dist/types/hooks/useTableSections.d.ts.map +1 -0
- package/dist/types/providers/AutoPatternsOverridesContext.d.ts +2 -2
- package/dist/types/providers/AutoPatternsOverridesContext.d.ts.map +1 -1
- package/dist/types/testkit/enzyme.d.ts +1 -0
- package/dist/types/testkit/enzyme.d.ts.map +1 -1
- package/dist/types/testkit/jsdom.d.ts +1 -0
- package/dist/types/testkit/jsdom.d.ts.map +1 -1
- package/dist/types/testkit/playwright.d.ts +1 -0
- package/dist/types/testkit/playwright.d.ts.map +1 -1
- package/dist/types/testkit/puppeteer.d.ts +1 -0
- package/dist/types/testkit/puppeteer.d.ts.map +1 -1
- package/dist/types/types/SettingsPageConfig.d.ts +140 -0
- package/dist/types/types/SettingsPageConfig.d.ts.map +1 -0
- package/dist/types/types/actions/base.d.ts +1 -0
- package/dist/types/types/actions/base.d.ts.map +1 -1
- package/dist/types/types/actions/entityPageActions.d.ts +2 -7
- package/dist/types/types/actions/entityPageActions.d.ts.map +1 -1
- package/dist/types/types/actions/formPageActions.d.ts +8 -0
- package/dist/types/types/actions/formPageActions.d.ts.map +1 -0
- package/dist/types/types/actions/index.d.ts +1 -0
- package/dist/types/types/actions/index.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/types.d.ts +20 -1
- package/dist/types/types/types.d.ts.map +1 -1
- package/dist/types/utils/filterCreators.d.ts +10 -19
- package/dist/types/utils/filterCreators.d.ts.map +1 -1
- package/dist/types/utils/minimalRequiredPatternsRuntimeCheck.d.ts +5 -0
- package/dist/types/utils/minimalRequiredPatternsRuntimeCheck.d.ts.map +1 -0
- package/dist/types/utils/minimalRequiredRuntimeCheck.d.ts +9 -0
- package/dist/types/utils/minimalRequiredRuntimeCheck.d.ts.map +1 -0
- package/docs/GETTING_STARTED.md +73 -18
- package/mcp-docs/app_config_structure.md +66 -3
- package/mcp-docs/auto-patterns-guide.md +86 -6
- package/mcp-docs/index.md +4 -0
- package/mcp-docs/pages_configuration.md +20 -3
- package/mcp-docs/settings_page.md +599 -0
- package/package.json +14 -13
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/Checkbox.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/DateInput.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/DateTime.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/FormFieldInput.js +0 -59
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/FormFieldInput.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/ImageInput.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/LongText.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/Number.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/ShortText.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/Url.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/types.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/utils/dates.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +0 -119
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js +0 -79
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/index.js +0 -16
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/index.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/SkeletonEntity.js +0 -198
- package/dist/cjs/components/AutoPatternsEntityPage/SkeletonEntity.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js +0 -77
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +0 -109
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +0 -1
- package/dist/cjs/hooks/useGridFeatures.js +0 -63
- package/dist/cjs/hooks/useGridFeatures.js.map +0 -1
- package/dist/cjs/hooks/useTableFeatures.js +0 -79
- package/dist/cjs/hooks/useTableFeatures.js.map +0 -1
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js +0 -83
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/Checkbox.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/DateInput.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/DateTime.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js +0 -46
- package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/ImageInput.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/LongText.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/Number.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/ShortText.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/Url.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/types.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/utils/dates.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js +0 -48
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/index.js +0 -3
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/index.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/SkeletonEntity.js +0 -91
- package/dist/esm/components/AutoPatternsEntityPage/SkeletonEntity.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js +0 -31
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +0 -66
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +0 -1
- package/dist/esm/hooks/useGridFeatures.js +0 -58
- package/dist/esm/hooks/useGridFeatures.js.map +0 -1
- package/dist/esm/hooks/useTableFeatures.js +0 -74
- package/dist/esm/hooks/useTableFeatures.js.map +0 -1
- package/dist/esm/hooks/useTableGridSwitchFeatures.js +0 -78
- package/dist/esm/hooks/useTableGridSwitchFeatures.js.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/Checkbox.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/DateInput.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/DateTime.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/FormFieldInput.d.ts +0 -10
- package/dist/types/components/AutoPatternsEntityPage/Fields/FormFieldInput.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/ImageInput.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/LongText.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/Number.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/ShortText.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/Url.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/types.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/utils/dates.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.d.ts +0 -11
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.d.ts +0 -13
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.d.ts +0 -8
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/index.d.ts +0 -3
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/index.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/SkeletonEntity.d.ts +0 -7
- package/dist/types/components/AutoPatternsEntityPage/SkeletonEntity.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.d.ts +0 -8
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts +0 -8
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts.map +0 -1
- package/dist/types/hooks/useGridFeatures.d.ts +0 -43
- package/dist/types/hooks/useGridFeatures.d.ts.map +0 -1
- package/dist/types/hooks/useTableFeatures.d.ts +0 -27
- package/dist/types/hooks/useTableFeatures.d.ts.map +0 -1
- package/dist/types/hooks/useTableGridSwitchFeatures.d.ts +0 -52
- package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +0 -1
- /package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/types.js +0 -0
- /package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/utils/dates.js +0 -0
- /package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/Checkbox.js +0 -0
- /package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/types.js +0 -0
- /package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/utils/dates.js +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/Checkbox.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/DateInput.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/DateTime.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/ImageInput.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/LongText.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/Number.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/ShortText.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/Url.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/utils/dates.d.ts +0 -0
|
@@ -6,7 +6,7 @@ import { useSchema } from '../../providers/SchemaContext';
|
|
|
6
6
|
import { useEntityPageHeaderTexts, useNavigation } from '../../hooks';
|
|
7
7
|
import { useEntityPageMoreActions } from '../../hooks/useEntityPageMoreActions';
|
|
8
8
|
import { useActionsSDK } from '../../hooks/useActionsSDK';
|
|
9
|
-
import {
|
|
9
|
+
import { ContentCard } from '../layouts/ContentCard';
|
|
10
10
|
import { errorHandler } from '@wix/essentials';
|
|
11
11
|
export const EditModeEntityPage = _ref => {
|
|
12
12
|
var _pageLayout$main, _pageLayout$sidebar;
|
|
@@ -27,6 +27,11 @@ export const EditModeEntityPage = _ref => {
|
|
|
27
27
|
const params = useParams();
|
|
28
28
|
const entityId = params[route.params.id];
|
|
29
29
|
const schema = useSchema();
|
|
30
|
+
const {
|
|
31
|
+
displayField,
|
|
32
|
+
actions: schemaActions,
|
|
33
|
+
fields
|
|
34
|
+
} = schema;
|
|
30
35
|
const isCreateMode = !entityId;
|
|
31
36
|
const inputRefs = useRef({});
|
|
32
37
|
const setInputRef = (id, input) => {
|
|
@@ -61,7 +66,7 @@ export const EditModeEntityPage = _ref => {
|
|
|
61
66
|
...baseEntity,
|
|
62
67
|
...formValues
|
|
63
68
|
};
|
|
64
|
-
const newEntity = entityId ? await
|
|
69
|
+
const newEntity = entityId ? await schemaActions.update(updatedEntity) : await schemaActions.create(updatedEntity);
|
|
65
70
|
return {
|
|
66
71
|
updatedEntity: newEntity
|
|
67
72
|
};
|
|
@@ -72,7 +77,7 @@ export const EditModeEntityPage = _ref => {
|
|
|
72
77
|
entity: undefined
|
|
73
78
|
};
|
|
74
79
|
}
|
|
75
|
-
const entity = await
|
|
80
|
+
const entity = await schemaActions.get(entityId);
|
|
76
81
|
return {
|
|
77
82
|
entity
|
|
78
83
|
};
|
|
@@ -85,7 +90,7 @@ export const EditModeEntityPage = _ref => {
|
|
|
85
90
|
} = useEntityPageHeaderTexts({
|
|
86
91
|
config: configuration,
|
|
87
92
|
isCreateMode,
|
|
88
|
-
entityDisplayName: entity == null ? void 0 : entity[
|
|
93
|
+
entityDisplayName: entity == null ? void 0 : entity[displayField],
|
|
89
94
|
entity
|
|
90
95
|
});
|
|
91
96
|
const sdk = useActionsSDK({
|
|
@@ -103,18 +108,26 @@ export const EditModeEntityPage = _ref => {
|
|
|
103
108
|
}) : undefined
|
|
104
109
|
}), /*#__PURE__*/React.createElement(EntityPage.Content, null, /*#__PURE__*/React.createElement(EntityPage.MainContent, {
|
|
105
110
|
dataHook: "entity-page-main-content"
|
|
106
|
-
}, pageLayout == null || (_pageLayout$main = pageLayout.main) == null ? void 0 : _pageLayout$main.map((layout, layoutIndex) => /*#__PURE__*/React.createElement(
|
|
111
|
+
}, pageLayout == null || (_pageLayout$main = pageLayout.main) == null ? void 0 : _pageLayout$main.map((layout, layoutIndex) => /*#__PURE__*/React.createElement(ContentCard, {
|
|
107
112
|
key: `main-section-card-${layoutIndex}`,
|
|
108
113
|
layout: layout,
|
|
109
114
|
sectionId: "main",
|
|
110
115
|
cardIndex: layoutIndex,
|
|
111
|
-
setInputRef: setInputRef
|
|
112
|
-
|
|
116
|
+
setInputRef: setInputRef,
|
|
117
|
+
fields: fields,
|
|
118
|
+
form: form,
|
|
119
|
+
data: entity
|
|
120
|
+
}))), pageLayout != null && pageLayout.sidebar ? /*#__PURE__*/React.createElement(EntityPage.AdditionalContent, {
|
|
121
|
+
dataHook: "entity-page-additional-content"
|
|
122
|
+
}, (_pageLayout$sidebar = pageLayout.sidebar) == null ? void 0 : _pageLayout$sidebar.map((layout, layoutIndex) => /*#__PURE__*/React.createElement(ContentCard, {
|
|
113
123
|
key: `sidebar-section-card-${layoutIndex}`,
|
|
114
124
|
layout: layout,
|
|
115
125
|
sectionId: "sidebar",
|
|
116
126
|
cardIndex: layoutIndex,
|
|
117
|
-
setInputRef: setInputRef
|
|
127
|
+
setInputRef: setInputRef,
|
|
128
|
+
fields: fields,
|
|
129
|
+
form: form,
|
|
130
|
+
data: entity
|
|
118
131
|
}))) : null));
|
|
119
132
|
};
|
|
120
133
|
//# sourceMappingURL=EditModeEntityPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","useRef","EntityPage","useEntity","useEntityPage","MoreActions","useForm","useParams","useSchema","useEntityPageHeaderTexts","useNavigation","useEntityPageMoreActions","useActionsSDK","RenderLayoutCard","errorHandler","EditModeEntityPage","_ref","_pageLayout$main","_pageLayout$sidebar","configuration","layout","pageLayout","parentPageId","route","actions","collectionId","moreActions","form","mode","params","entityId","id","schema","isCreateMode","inputRefs","setInputRef","input","current","validate","invalidFieldId","Object","keys","find","fieldId","_inputRefs$current$fi","invalid","_inputRefs$current$in","focus","Error","getParentPagePath","parentPath","state","saveErrorToast","err","message","getResolvedError","onSave","formValues","getValues","baseEntity","entity","updatedEntity","newEntity","update","create","fetch","undefined","get","title","subtitle","config","entityDisplayName","displayField","sdk","resolvedMoreActions","createElement","dataHook","Header","length","items","Content","MainContent","main","map","layoutIndex","key","sectionId","cardIndex","sidebar","AdditionalContent"],"sources":["../../../../src/components/AutoPatternsEntityPage/EditModeEntityPage.tsx"],"sourcesContent":["import React, { useMemo, useRef } from 'react';\nimport {\n EntityPage,\n EntityPageState,\n useEntity,\n useEntityPage,\n MoreActions,\n} from '@wix/patterns';\nimport { useForm } from '@wix/patterns/form';\nimport { useParams } from 'react-router-dom';\nimport { useSchema } from '../../providers/SchemaContext';\nimport { BaseInputRef } from './Fields/types';\nimport { useEntityPageHeaderTexts, useNavigation } from '../../hooks';\nimport { useEntityPageMoreActions } from '../../hooks/useEntityPageMoreActions';\nimport { useActionsSDK } from '../../hooks/useActionsSDK';\nimport { RenderLayoutCard } from './RenderLayout';\nimport { EditEntityPageConfig } from '../../types';\nimport { errorHandler } from '@wix/essentials';\n\nexport const EditModeEntityPage: React.FC<{\n configuration: EditEntityPageConfig;\n}> = ({ configuration }) => {\n const {\n layout: pageLayout,\n parentPageId,\n route,\n actions,\n collectionId,\n } = configuration;\n\n const moreActions = actions?.moreActions;\n\n const form = useForm<any>({\n mode: 'onChange',\n });\n const params = useParams();\n const entityId = params[route.params.id];\n const schema = useSchema();\n const isCreateMode = !entityId;\n\n const inputRefs = useRef<{ [fieldId: string]: BaseInputRef }>({});\n\n const setInputRef = (id: string, input: BaseInputRef) => {\n inputRefs.current[id] = input;\n };\n\n const validate = () => {\n const invalidFieldId = Object.keys(inputRefs.current).find((fieldId) => {\n return inputRefs.current[fieldId]?.invalid;\n });\n\n if (invalidFieldId) {\n inputRefs.current[invalidFieldId]?.focus?.();\n throw new Error('Invalid form');\n }\n };\n const { getParentPagePath } = useNavigation();\n\n const parentPath = useMemo(\n () => getParentPagePath(parentPageId),\n [parentPageId, getParentPagePath],\n );\n\n const state: EntityPageState<any> = useEntityPage<any, any>({\n parentPath,\n form,\n saveErrorToast: (err) => ({\n message: errorHandler.getResolvedError(err).message,\n }),\n onSave: async () => {\n validate();\n\n const formValues = form.getValues();\n const baseEntity = state.entity || {};\n const updatedEntity = {\n ...baseEntity,\n ...formValues,\n };\n\n const newEntity = entityId\n ? await schema.actions.update(updatedEntity)\n : await schema.actions.create(updatedEntity);\n\n return { updatedEntity: newEntity };\n },\n fetch: async () => {\n if (!entityId) {\n return { entity: undefined };\n }\n const entity = await schema.actions.get(entityId);\n return { entity };\n },\n });\n\n const entity = useEntity(state);\n\n const { title, subtitle } = useEntityPageHeaderTexts({\n config: configuration,\n isCreateMode,\n entityDisplayName: entity?.[schema.displayField],\n entity,\n });\n\n const sdk = useActionsSDK({\n collectionId,\n });\n\n const resolvedMoreActions = useEntityPageMoreActions(\n moreActions,\n entity,\n sdk,\n form,\n );\n\n return (\n <EntityPage state={state} dataHook=\"auto-patterns-entity-page\">\n <EntityPage.Header\n title={title}\n subtitle={subtitle}\n moreActions={\n resolvedMoreActions.length > 0 ? (\n <MoreActions items={resolvedMoreActions} />\n ) : undefined\n }\n />\n <EntityPage.Content>\n <EntityPage.MainContent dataHook=\"entity-page-main-content\">\n {pageLayout?.main?.map((layout, layoutIndex) => (\n <RenderLayoutCard\n key={`main-section-card-${layoutIndex}`}\n layout={layout}\n sectionId=\"main\"\n cardIndex={layoutIndex}\n setInputRef={setInputRef}\n />\n ))}\n </EntityPage.MainContent>\n {pageLayout?.sidebar ? (\n <EntityPage.AdditionalContent>\n {pageLayout.sidebar?.map((layout, layoutIndex) => (\n <RenderLayoutCard\n key={`sidebar-section-card-${layoutIndex}`}\n layout={layout}\n sectionId=\"sidebar\"\n cardIndex={layoutIndex}\n setInputRef={setInputRef}\n />\n ))}\n </EntityPage.AdditionalContent>\n ) : null}\n </EntityPage.Content>\n </EntityPage>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAC9C,SACEC,UAAU,EAEVC,SAAS,EACTC,aAAa,EACbC,WAAW,QACN,eAAe;AACtB,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,SAAS,QAAQ,+BAA+B;AAEzD,SAASC,wBAAwB,EAAEC,aAAa,QAAQ,aAAa;AACrE,SAASC,wBAAwB,QAAQ,sCAAsC;AAC/E,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,gBAAgB,QAAQ,gBAAgB;AAEjD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,OAAO,MAAMC,kBAEX,GAAGC,IAAA,IAAuB;EAAA,IAAAC,gBAAA,EAAAC,mBAAA;EAAA,IAAtB;IAAEC;EAAc,CAAC,GAAAH,IAAA;EACrB,MAAM;IACJI,MAAM,EAAEC,UAAU;IAClBC,YAAY;IACZC,KAAK;IACLC,OAAO;IACPC;EACF,CAAC,GAAGN,aAAa;EAEjB,MAAMO,WA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IACfwE,GAAG,EAAE,wBAAwBD,WAAW,EAAG;IAC3ChE,MAAM,EAAEA,MAAO;IACfkE,SAAS,EAAC,SAAS;IACnBC,SAAS,EAAEH,WAAY;IACvBjD,WAAW,EAAEA;EAAY,CAC1B,CACF,CAC2B,CAAC,GAC7B,IACc,CACV,CAAC;AAEjB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useMemo","useRef","EntityPage","useEntity","useEntityPage","MoreActions","useForm","useParams","useSchema","useEntityPageHeaderTexts","useNavigation","useEntityPageMoreActions","useActionsSDK","ContentCard","errorHandler","EditModeEntityPage","_ref","_pageLayout$main","_pageLayout$sidebar","configuration","layout","pageLayout","parentPageId","route","actions","collectionId","moreActions","form","mode","params","entityId","id","schema","displayField","schemaActions","fields","isCreateMode","inputRefs","setInputRef","input","current","validate","invalidFieldId","Object","keys","find","fieldId","_inputRefs$current$fi","invalid","_inputRefs$current$in","focus","Error","getParentPagePath","parentPath","state","saveErrorToast","err","message","getResolvedError","onSave","formValues","getValues","baseEntity","entity","updatedEntity","newEntity","update","create","fetch","undefined","get","title","subtitle","config","entityDisplayName","sdk","resolvedMoreActions","createElement","dataHook","Header","length","items","Content","MainContent","main","map","layoutIndex","key","sectionId","cardIndex","data","sidebar","AdditionalContent"],"sources":["../../../../src/components/AutoPatternsEntityPage/EditModeEntityPage.tsx"],"sourcesContent":["import React, { useMemo, useRef } from 'react';\nimport {\n EntityPage,\n EntityPageState,\n useEntity,\n useEntityPage,\n MoreActions,\n} from '@wix/patterns';\nimport { useForm } from '@wix/patterns/form';\nimport { useParams } from 'react-router-dom';\nimport { useSchema } from '../../providers/SchemaContext';\nimport { useEntityPageHeaderTexts, useNavigation } from '../../hooks';\nimport { useEntityPageMoreActions } from '../../hooks/useEntityPageMoreActions';\nimport { useActionsSDK } from '../../hooks/useActionsSDK';\nimport { ContentCard } from '../layouts/ContentCard';\nimport { BaseInputRef } from '../fields/types';\nimport { EditEntityPageConfig } from '../../types';\nimport { errorHandler } from '@wix/essentials';\n\nexport const EditModeEntityPage: React.FC<{\n configuration: EditEntityPageConfig;\n}> = ({ configuration }) => {\n const {\n layout: pageLayout,\n parentPageId,\n route,\n actions,\n collectionId,\n } = configuration;\n\n const moreActions = actions?.moreActions;\n\n const form = useForm<any>({\n mode: 'onChange',\n });\n const params = useParams();\n const entityId = params[route.params.id];\n const schema = useSchema();\n const { displayField, actions: schemaActions, fields } = schema;\n const isCreateMode = !entityId;\n\n const inputRefs = useRef<{ [fieldId: string]: BaseInputRef }>({});\n\n const setInputRef = (id: string, input: BaseInputRef) => {\n inputRefs.current[id] = input;\n };\n\n const validate = () => {\n const invalidFieldId = Object.keys(inputRefs.current).find((fieldId) => {\n return inputRefs.current[fieldId]?.invalid;\n });\n\n if (invalidFieldId) {\n inputRefs.current[invalidFieldId]?.focus?.();\n throw new Error('Invalid form');\n }\n };\n const { getParentPagePath } = useNavigation();\n\n const parentPath = useMemo(\n () => getParentPagePath(parentPageId),\n [parentPageId, getParentPagePath],\n );\n\n const state: EntityPageState<any> = useEntityPage<any, any>({\n parentPath,\n form,\n saveErrorToast: (err) => ({\n message: errorHandler.getResolvedError(err).message,\n }),\n onSave: async () => {\n validate();\n\n const formValues = form.getValues();\n const baseEntity = state.entity || {};\n const updatedEntity = {\n ...baseEntity,\n ...formValues,\n };\n\n const newEntity = entityId\n ? await schemaActions.update(updatedEntity)\n : await schemaActions.create(updatedEntity);\n\n return { updatedEntity: newEntity };\n },\n fetch: async () => {\n if (!entityId) {\n return { entity: undefined };\n }\n const entity = await schemaActions.get(entityId);\n return { entity };\n },\n });\n\n const entity = useEntity(state);\n\n const { title, subtitle } = useEntityPageHeaderTexts({\n config: configuration,\n isCreateMode,\n entityDisplayName: entity?.[displayField],\n entity,\n });\n\n const sdk = useActionsSDK({\n collectionId,\n });\n\n const resolvedMoreActions = useEntityPageMoreActions(\n moreActions,\n entity,\n sdk,\n form,\n );\n\n return (\n <EntityPage state={state} dataHook=\"auto-patterns-entity-page\">\n <EntityPage.Header\n title={title}\n subtitle={subtitle}\n moreActions={\n resolvedMoreActions.length > 0 ? (\n <MoreActions items={resolvedMoreActions} />\n ) : undefined\n }\n />\n <EntityPage.Content>\n <EntityPage.MainContent dataHook=\"entity-page-main-content\">\n {pageLayout?.main?.map((layout, layoutIndex) => (\n <ContentCard\n key={`main-section-card-${layoutIndex}`}\n layout={layout}\n sectionId=\"main\"\n cardIndex={layoutIndex}\n setInputRef={setInputRef}\n fields={fields}\n form={form}\n data={entity}\n />\n ))}\n </EntityPage.MainContent>\n {pageLayout?.sidebar ? (\n <EntityPage.AdditionalContent dataHook=\"entity-page-additional-content\">\n {pageLayout.sidebar?.map((layout, layoutIndex) => (\n <ContentCard\n key={`sidebar-section-card-${layoutIndex}`}\n layout={layout}\n sectionId=\"sidebar\"\n cardIndex={layoutIndex}\n setInputRef={setInputRef}\n fields={fields}\n form={form}\n data={entity}\n />\n ))}\n </EntityPage.AdditionalContent>\n ) : null}\n </EntityPage.Content>\n </EntityPage>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAC9C,SACEC,UAAU,EAEVC,SAAS,EACTC,aAAa,EACbC,WAAW,QACN,eAAe;AACtB,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,SAAS,QAAQ,+BAA+B;AACzD,SAASC,wBAAwB,EAAEC,aAAa,QAAQ,aAAa;AACrE,SAASC,wBAAwB,QAAQ,sCAAsC;AAC/E,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,WAAW,QAAQ,wBAAwB;AAGpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,OAAO,MAAMC,kBAEX,GAAGC,IAAA,IAAuB;EAAA,IAAAC,gBAAA,EAAAC,mBAAA;EAAA,IAAtB;IAAEC;EAAc,CAAC,GAAAH,IAAA;EACrB,MAAM;IACJI,MAAM,EAAEC,UAAU;IAClBC,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A,CAAC3E,UAAU,CAAC0F,iBAAiB;IAACd,QAAQ,EAAC;EAAgC,IAAA5D,mBAAA,GACpEG,UAAU,CAACsE,OAAO,qBAAlBzE,mBAAA,CAAoBmE,GAAG,CAAC,CAACjE,MAAM,EAAEkE,WAAW,kBAC3CvF,KAAA,CAAA8E,aAAA,CAAChE,WAAW;IACV0E,GAAG,EAAE,wBAAwBD,WAAW,EAAG;IAC3ClE,MAAM,EAAEA,MAAO;IACfoE,SAAS,EAAC,SAAS;IACnBC,SAAS,EAAEH,WAAY;IACvBhD,WAAW,EAAEA,WAAY;IACzBH,MAAM,EAAEA,MAAO;IACfR,IAAI,EAAEA,IAAK;IACX+D,IAAI,EAAE3B;EAAO,CACd,CACF,CAC2B,CAAC,GAC7B,IACc,CACV,CAAC;AAEjB,CAAC","ignoreList":[]}
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { useState, useEffect } from 'react';
|
|
3
3
|
import { Page, Heading, Box, Layout, Cell, Badge } from '@wix/design-system';
|
|
4
4
|
import { useParams } from 'react-router-dom';
|
|
5
|
-
import { RenderViewLayoutCard } from './ViewEntityPage/RenderViewLayoutCard';
|
|
6
5
|
import { useSchema } from '../../providers/SchemaContext';
|
|
7
6
|
import { useNavigation } from '../../hooks';
|
|
8
7
|
import { MoreActions } from '@wix/patterns';
|
|
@@ -11,7 +10,8 @@ import { useEntityPageMoreActions } from '../../hooks/useEntityPageMoreActions';
|
|
|
11
10
|
import { useActionsSDK } from '../../hooks/useActionsSDK';
|
|
12
11
|
import { useNavigateEditEntityAction } from '../../hooks/useNavigateEditEntityAction';
|
|
13
12
|
import { useEntityPageHeaderTexts } from '../../hooks/useEntityPageHeaderTexts';
|
|
14
|
-
import {
|
|
13
|
+
import { ContentSkeleton } from '../layouts/ContentSkeleton';
|
|
14
|
+
import { ContentCard } from '../layouts/ContentCard';
|
|
15
15
|
// TODO: temp solution until we have a proper view mode entity page
|
|
16
16
|
export const ViewModeEntityPage = _ref => {
|
|
17
17
|
var _pageLayout$main, _pageLayout$sidebar;
|
|
@@ -24,6 +24,11 @@ export const ViewModeEntityPage = _ref => {
|
|
|
24
24
|
const params = useParams();
|
|
25
25
|
const entityId = params[route.params.id];
|
|
26
26
|
const schema = useSchema();
|
|
27
|
+
const {
|
|
28
|
+
displayField,
|
|
29
|
+
actions: schemaActions,
|
|
30
|
+
fields
|
|
31
|
+
} = schema;
|
|
27
32
|
const {
|
|
28
33
|
layout: pageLayout
|
|
29
34
|
} = configuration;
|
|
@@ -38,7 +43,7 @@ export const ViewModeEntityPage = _ref => {
|
|
|
38
43
|
setEntity(undefined);
|
|
39
44
|
return;
|
|
40
45
|
}
|
|
41
|
-
const fetchedEntity = await
|
|
46
|
+
const fetchedEntity = await schemaActions.get(entityId);
|
|
42
47
|
if (isMounted) {
|
|
43
48
|
setEntity(fetchedEntity);
|
|
44
49
|
}
|
|
@@ -47,7 +52,7 @@ export const ViewModeEntityPage = _ref => {
|
|
|
47
52
|
return () => {
|
|
48
53
|
isMounted = false;
|
|
49
54
|
};
|
|
50
|
-
}, [entityId,
|
|
55
|
+
}, [entityId, schemaActions]);
|
|
51
56
|
const {
|
|
52
57
|
title,
|
|
53
58
|
subtitle
|
|
@@ -55,7 +60,7 @@ export const ViewModeEntityPage = _ref => {
|
|
|
55
60
|
config: configuration,
|
|
56
61
|
isCreateMode: false,
|
|
57
62
|
isViewMode: true,
|
|
58
|
-
entityDisplayName: entity == null ? void 0 : entity[
|
|
63
|
+
entityDisplayName: entity == null ? void 0 : entity[displayField],
|
|
59
64
|
entity
|
|
60
65
|
});
|
|
61
66
|
const sdk = useActionsSDK({
|
|
@@ -69,7 +74,7 @@ export const ViewModeEntityPage = _ref => {
|
|
|
69
74
|
|
|
70
75
|
// add OOTB navigate to edit action
|
|
71
76
|
const moreActions = useNavigateEditEntityAction({
|
|
72
|
-
displayName: entity == null ? void 0 : entity[
|
|
77
|
+
displayName: entity == null ? void 0 : entity[displayField],
|
|
73
78
|
configuration
|
|
74
79
|
});
|
|
75
80
|
const resolvedMoreActions = useEntityPageMoreActions(moreActions, entity, sdk);
|
|
@@ -93,8 +98,8 @@ export const ViewModeEntityPage = _ref => {
|
|
|
93
98
|
}), badge.text))));
|
|
94
99
|
};
|
|
95
100
|
if (!entity) {
|
|
96
|
-
return /*#__PURE__*/React.createElement(
|
|
97
|
-
|
|
101
|
+
return /*#__PURE__*/React.createElement(ContentSkeleton, {
|
|
102
|
+
pageConfig: configuration
|
|
98
103
|
});
|
|
99
104
|
}
|
|
100
105
|
return /*#__PURE__*/React.createElement(Page, {
|
|
@@ -116,9 +121,11 @@ export const ViewModeEntityPage = _ref => {
|
|
|
116
121
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
117
122
|
direction: "vertical",
|
|
118
123
|
gap: "SP4"
|
|
119
|
-
}, pageLayout == null || (_pageLayout$main = pageLayout.main) == null ? void 0 : _pageLayout$main.map((layout, layoutIndex) => /*#__PURE__*/React.createElement(
|
|
124
|
+
}, pageLayout == null || (_pageLayout$main = pageLayout.main) == null ? void 0 : _pageLayout$main.map((layout, layoutIndex) => /*#__PURE__*/React.createElement(ContentCard, {
|
|
120
125
|
key: `main-section-card-${layoutIndex}`,
|
|
121
|
-
|
|
126
|
+
mode: "view",
|
|
127
|
+
fields: fields,
|
|
128
|
+
data: entity,
|
|
122
129
|
layout: layout,
|
|
123
130
|
sectionId: "main",
|
|
124
131
|
cardIndex: layoutIndex
|
|
@@ -127,9 +134,11 @@ export const ViewModeEntityPage = _ref => {
|
|
|
127
134
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
128
135
|
direction: "vertical",
|
|
129
136
|
gap: "SP4"
|
|
130
|
-
}, (_pageLayout$sidebar = pageLayout.sidebar) == null ? void 0 : _pageLayout$sidebar.map((layout, layoutIndex) => /*#__PURE__*/React.createElement(
|
|
137
|
+
}, (_pageLayout$sidebar = pageLayout.sidebar) == null ? void 0 : _pageLayout$sidebar.map((layout, layoutIndex) => /*#__PURE__*/React.createElement(ContentCard, {
|
|
131
138
|
key: `sidebar-section-card-${layoutIndex}`,
|
|
132
|
-
|
|
139
|
+
mode: "view",
|
|
140
|
+
fields: fields,
|
|
141
|
+
data: entity,
|
|
133
142
|
layout: layout,
|
|
134
143
|
sectionId: "sidebar",
|
|
135
144
|
cardIndex: layoutIndex
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","useEffect","Page","Heading","Box","Layout","Cell","Badge","useParams","RenderViewLayoutCard","useSchema","useNavigation","MoreActions","useEntityPageActions","useEntityPageMoreActions","useActionsSDK","useNavigateEditEntityAction","useEntityPageHeaderTexts","SkeletonEntity","ViewModeEntityPage","_ref","_pageLayout$main","_pageLayout$sidebar","configuration","route","params","entityId","id","schema","layout","pageLayout","navigateToCollectionPage","entity","setEntity","undefined","isMounted","fetchEntity","fetchedEntity","actions","get","title","subtitle","config","isCreateMode","isViewMode","entityDisplayName","displayField","sdk","collectionId","entityPageActions","moreActions","displayName","resolvedMoreActions","renderTitle","text","badges","createElement","gap","verticalAlign","alignContent","size","length","map","badge","index","_extends","key","dataHook","entityPage","Header","showBackButton","onBackClicked","parentPageId","actionsBar","items","Content","span","sidebar","direction","main","layoutIndex","sectionId","cardIndex"],"sources":["../../../../src/components/AutoPatternsEntityPage/ViewModeEntityPage.tsx"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { Page, Heading, Box, Layout, Cell, Badge } from '@wix/design-system';\nimport { useParams } from 'react-router-dom';\nimport { RenderViewLayoutCard } from './ViewEntityPage/RenderViewLayoutCard';\nimport { useSchema } from '../../providers/SchemaContext';\nimport { useNavigation } from '../../hooks';\nimport { MoreActions } from '@wix/patterns';\nimport { useEntityPageActions } from '../../hooks/useEntityPageActions';\nimport { useEntityPageMoreActions } from '../../hooks/useEntityPageMoreActions';\nimport { useActionsSDK } from '../../hooks/useActionsSDK';\nimport { useNavigateEditEntityAction } from '../../hooks/useNavigateEditEntityAction';\nimport { useEntityPageHeaderTexts } from '../../hooks/useEntityPageHeaderTexts';\nimport { ViewEntityPageConfig } from '../../types';\nimport { SkeletonEntity } from './SkeletonEntity';\n\ninterface ViewModeEntityPageProps {\n configuration: ViewEntityPageConfig;\n}\n\n// TODO: temp solution until we have a proper view mode entity page\nexport const ViewModeEntityPage: React.FC<ViewModeEntityPageProps> = ({\n configuration,\n}) => {\n const { route } = configuration;\n const params = useParams();\n const entityId = params[route.params.id];\n const schema = useSchema();\n const { layout: pageLayout } = configuration;\n const { navigateToCollectionPage } = useNavigation();\n\n const [entity, setEntity] = useState<any>(undefined);\n\n useEffect(() => {\n let isMounted = true;\n const fetchEntity = async () => {\n if (!entityId) {\n setEntity(undefined);\n return;\n }\n const fetchedEntity = await schema.actions.get(entityId);\n if (isMounted) {\n setEntity(fetchedEntity);\n }\n };\n fetchEntity();\n return () => {\n isMounted = false;\n };\n }, [entityId, schema]);\n\n const { title, subtitle } = useEntityPageHeaderTexts({\n config: configuration,\n isCreateMode: false,\n isViewMode: true,\n entityDisplayName: entity?.[schema.displayField],\n entity,\n });\n\n const sdk = useActionsSDK({\n collectionId: configuration.collectionId,\n });\n\n const actions = useEntityPageActions({\n entityPageActions: configuration.actions,\n entity,\n sdk,\n });\n\n // add OOTB navigate to edit action\n const moreActions = useNavigateEditEntityAction({\n displayName: entity?.[schema.displayField],\n configuration,\n });\n\n const resolvedMoreActions = useEntityPageMoreActions(\n moreActions,\n entity,\n sdk,\n );\n\n const renderTitle = () => {\n const { text, badges } = title;\n\n return (\n <Box gap=\"SP2\" verticalAlign=\"middle\" alignContent=\"center\">\n <Heading size=\"extraLarge\">{text}</Heading>\n {badges && badges.length > 0 && (\n <Box gap=\"SP2\">\n {badges.map((badge, index) => (\n <Badge\n key={index}\n {...badge}\n dataHook={`form-page-header-badge-${index}`}\n >\n {badge.text}\n </Badge>\n ))}\n </Box>\n )}\n </Box>\n );\n };\n\n if (!entity) {\n return <SkeletonEntity entityPage={configuration} />;\n }\n return (\n <Page dataHook=\"view-mode-entity-page\">\n <Page.Header\n dataHook=\"view-mode-entity-page-header\"\n title={renderTitle()}\n subtitle={subtitle?.text}\n showBackButton\n onBackClicked={() =>\n navigateToCollectionPage(configuration.parentPageId!)\n }\n actionsBar={\n <Box gap=\"SP2\">\n {resolvedMoreActions.length > 0 ? (\n <MoreActions\n dataHook=\"view-mode-entity-page-more-actions\"\n items={resolvedMoreActions}\n />\n ) : undefined}\n {actions}\n </Box>\n }\n />\n <Page.Content>\n <Layout>\n <Cell span={pageLayout?.sidebar ? 8 : 12}>\n <Box direction=\"vertical\" gap=\"SP4\">\n {pageLayout?.main?.map((layout, layoutIndex) => (\n <RenderViewLayoutCard\n key={`main-section-card-${layoutIndex}`}\n entity={entity}\n layout={layout}\n sectionId=\"main\"\n cardIndex={layoutIndex}\n />\n ))}\n </Box>\n </Cell>\n {pageLayout?.sidebar ? (\n <Cell span={4}>\n <Box direction=\"vertical\" gap=\"SP4\">\n {pageLayout.sidebar?.map((layout, layoutIndex) => (\n <RenderViewLayoutCard\n key={`sidebar-section-card-${layoutIndex}`}\n entity={entity}\n layout={layout}\n sectionId=\"sidebar\"\n cardIndex={layoutIndex}\n />\n ))}\n </Box>\n </Cell>\n ) : null}\n </Layout>\n </Page.Content>\n </Page>\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,SAASC,IAAI,EAAEC,OAAO,EAAEC,GAAG,EAAEC,MAAM,EAAEC,IAAI,EAAEC,KAAK,QAAQ,oBAAoB;AAC5E,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,oBAAoB,QAAQ,uCAAuC;AAC5E,SAASC,SAAS,QAAQ,+BAA+B;AACzD,SAASC,aAAa,QAAQ,aAAa;AAC3C,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,oBAAoB,QAAQ,kCAAkC;AACvE,SAASC,wBAAwB,QAAQ,sCAAsC;AAC/E,SAASC,aAAa,QAAQ,2B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A,CAAAyD,aAAA,CAAC/C,oBAAoB;IACnByD,GAAG,EAAE,qBAAqBc,WAAW,EAAG;IACxChD,MAAM,EAAEA,MAAO;IACfH,MAAM,EAAEA,MAAO;IACfoD,SAAS,EAAC,MAAM;IAChBC,SAAS,EAAEF;EAAY,CACxB,CACF,CACE,CACD,CAAC,EACNlD,UAAU,YAAVA,UAAU,CAAE+C,OAAO,gBAClB9E,KAAA,CAAAyD,aAAA,CAAClD,IAAI;IAACsE,IAAI,EAAE;EAAE,gBACZ7E,KAAA,CAAAyD,aAAA,CAACpD,GAAG;IAAC0E,SAAS,EAAC,UAAU;IAACrB,GAAG,EAAC;EAAK,IAAAnC,mBAAA,GAChCQ,UAAU,CAAC+C,OAAO,qBAAlBvD,mBAAA,CAAoBwC,GAAG,CAAC,CAACjC,MAAM,EAAEmD,WAAW,kBAC3CjF,KAAA,CAAAyD,aAAA,CAAC/C,oBAAoB;IACnByD,GAAG,EAAE,wBAAwBc,WAAW,EAAG;IAC3ChD,MAAM,EAAEA,MAAO;IACfH,MAAM,EAAEA,MAAO;IACfoD,SAAS,EAAC,SAAS;IACnBC,SAAS,EAAEF;EAAY,CACxB,CACF,CACE,CACD,CAAC,GACL,IACE,CACI,CACV,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useState","useEffect","Page","Heading","Box","Layout","Cell","Badge","useParams","useSchema","useNavigation","MoreActions","useEntityPageActions","useEntityPageMoreActions","useActionsSDK","useNavigateEditEntityAction","useEntityPageHeaderTexts","ContentSkeleton","ContentCard","ViewModeEntityPage","_ref","_pageLayout$main","_pageLayout$sidebar","configuration","route","params","entityId","id","schema","displayField","actions","schemaActions","fields","layout","pageLayout","navigateToCollectionPage","entity","setEntity","undefined","isMounted","fetchEntity","fetchedEntity","get","title","subtitle","config","isCreateMode","isViewMode","entityDisplayName","sdk","collectionId","entityPageActions","moreActions","displayName","resolvedMoreActions","renderTitle","text","badges","createElement","gap","verticalAlign","alignContent","size","length","map","badge","index","_extends","key","dataHook","pageConfig","Header","showBackButton","onBackClicked","parentPageId","actionsBar","items","Content","span","sidebar","direction","main","layoutIndex","mode","data","sectionId","cardIndex"],"sources":["../../../../src/components/AutoPatternsEntityPage/ViewModeEntityPage.tsx"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { Page, Heading, Box, Layout, Cell, Badge } from '@wix/design-system';\nimport { useParams } from 'react-router-dom';\nimport { useSchema } from '../../providers/SchemaContext';\nimport { useNavigation } from '../../hooks';\nimport { MoreActions } from '@wix/patterns';\nimport { useEntityPageActions } from '../../hooks/useEntityPageActions';\nimport { useEntityPageMoreActions } from '../../hooks/useEntityPageMoreActions';\nimport { useActionsSDK } from '../../hooks/useActionsSDK';\nimport { useNavigateEditEntityAction } from '../../hooks/useNavigateEditEntityAction';\nimport { useEntityPageHeaderTexts } from '../../hooks/useEntityPageHeaderTexts';\nimport { ViewEntityPageConfig } from '../../types';\nimport { ContentSkeleton } from '../layouts/ContentSkeleton';\nimport { ContentCard } from '../layouts/ContentCard';\n\ninterface ViewModeEntityPageProps {\n configuration: ViewEntityPageConfig;\n}\n\n// TODO: temp solution until we have a proper view mode entity page\nexport const ViewModeEntityPage: React.FC<ViewModeEntityPageProps> = ({\n configuration,\n}) => {\n const { route } = configuration;\n const params = useParams();\n const entityId = params[route.params.id];\n const schema = useSchema();\n const { displayField, actions: schemaActions, fields } = schema;\n const { layout: pageLayout } = configuration;\n const { navigateToCollectionPage } = useNavigation();\n\n const [entity, setEntity] = useState<any>(undefined);\n\n useEffect(() => {\n let isMounted = true;\n const fetchEntity = async () => {\n if (!entityId) {\n setEntity(undefined);\n return;\n }\n const fetchedEntity = await schemaActions.get(entityId);\n if (isMounted) {\n setEntity(fetchedEntity);\n }\n };\n fetchEntity();\n return () => {\n isMounted = false;\n };\n }, [entityId, schemaActions]);\n\n const { title, subtitle } = useEntityPageHeaderTexts({\n config: configuration,\n isCreateMode: false,\n isViewMode: true,\n entityDisplayName: entity?.[displayField],\n entity,\n });\n\n const sdk = useActionsSDK({\n collectionId: configuration.collectionId,\n });\n\n const actions = useEntityPageActions({\n entityPageActions: configuration.actions,\n entity,\n sdk,\n });\n\n // add OOTB navigate to edit action\n const moreActions = useNavigateEditEntityAction({\n displayName: entity?.[displayField],\n configuration,\n });\n\n const resolvedMoreActions = useEntityPageMoreActions(\n moreActions,\n entity,\n sdk,\n );\n\n const renderTitle = () => {\n const { text, badges } = title;\n\n return (\n <Box gap=\"SP2\" verticalAlign=\"middle\" alignContent=\"center\">\n <Heading size=\"extraLarge\">{text}</Heading>\n {badges && badges.length > 0 && (\n <Box gap=\"SP2\">\n {badges.map((badge, index) => (\n <Badge\n key={index}\n {...badge}\n dataHook={`form-page-header-badge-${index}`}\n >\n {badge.text}\n </Badge>\n ))}\n </Box>\n )}\n </Box>\n );\n };\n\n if (!entity) {\n return <ContentSkeleton pageConfig={configuration} />;\n }\n return (\n <Page dataHook=\"view-mode-entity-page\">\n <Page.Header\n dataHook=\"view-mode-entity-page-header\"\n title={renderTitle()}\n subtitle={subtitle?.text}\n showBackButton\n onBackClicked={() =>\n navigateToCollectionPage(configuration.parentPageId!)\n }\n actionsBar={\n <Box gap=\"SP2\">\n {resolvedMoreActions.length > 0 ? (\n <MoreActions\n dataHook=\"view-mode-entity-page-more-actions\"\n items={resolvedMoreActions}\n />\n ) : undefined}\n {actions}\n </Box>\n }\n />\n <Page.Content>\n <Layout>\n <Cell span={pageLayout?.sidebar ? 8 : 12}>\n <Box direction=\"vertical\" gap=\"SP4\">\n {pageLayout?.main?.map((layout, layoutIndex) => (\n <ContentCard\n key={`main-section-card-${layoutIndex}`}\n mode=\"view\"\n fields={fields}\n data={entity}\n layout={layout}\n sectionId=\"main\"\n cardIndex={layoutIndex}\n />\n ))}\n </Box>\n </Cell>\n {pageLayout?.sidebar ? (\n <Cell span={4}>\n <Box direction=\"vertical\" gap=\"SP4\">\n {pageLayout.sidebar?.map((layout, layoutIndex) => (\n <ContentCard\n key={`sidebar-section-card-${layoutIndex}`}\n mode=\"view\"\n fields={fields}\n data={entity}\n layout={layout}\n sectionId=\"sidebar\"\n cardIndex={layoutIndex}\n />\n ))}\n </Box>\n </Cell>\n ) : null}\n </Layout>\n </Page.Content>\n </Page>\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,SAASC,IAAI,EAAEC,OAAO,EAAEC,GAAG,EAAEC,MAAM,EAAEC,IAAI,EAAEC,KAAK,QAAQ,oBAAoB;AAC5E,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,SAAS,QAAQ,+BAA+B;AACzD,SAASC,aAAa,QAAQ,aAAa;AAC3C,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,oBAAoB,QAAQ,kCAAkC;AACvE,SAASC,wBAAwB,QAAQ,sCAAsC;AAC/E,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,2BAA2B,QAAQ,yCAAyC;AACrF,SAASC,wBAAwB,QAAQ,sCAAsC;AAE/E,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,WAAW,QAAQ,wBAAwB;AAMpD;AACA,OAAO,MAAMC,kBAAqD,GAAGC,IAAA,IAE/D;EAAA,IAAAC,gBAAA,EAAAC,mBAAA;EAAA,IAFgE;IACpEC;EACF,CAAC,GAAAH,IAAA;EACC,MAAM;IAAEI;EAAM,CAAC,GAAGD,aAAa;EAC/B,MAAME,MAAM,GAAGjB,SAAS,CAAC,CAAC;EAC1B,MAAMkB,QAAQ,GAAGD,MAAM,CAACD,KAAK,CAACC,MAAM,CAACE,EAAE,CAAC;EACxC,MAAMC,MAAM,GAAGnB,SAAS,CAAC,CAAC;EAC1B,MAAM;IAAEoB,YAAY;IAAEC,OAAO,EAAEC,aAAa;IAAEC;EAAO,CAAC,GAAGJ,MAAM;EAC/D,MAAM;IAAEK,MAAM,EAAEC;EAAW,CAAC,GAAGX,aAAa;EAC5C,MAAM;IAAEY;EAAy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,KAAA,CAAA2D,aAAA,CAACxC,WAAW;IACVkD,GAAG,EAAE,wBAAwBc,WAAW,EAAG;IAC3CC,IAAI,EAAC,MAAM;IACXnD,MAAM,EAAEA,MAAO;IACfoD,IAAI,EAAEhD,MAAO;IACbH,MAAM,EAAEA,MAAO;IACfoD,SAAS,EAAC,SAAS;IACnBC,SAAS,EAAEJ;EAAY,CACxB,CACF,CACE,CACD,CAAC,GACL,IACE,CACI,CACV,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/components/AutoPatternsEntityPage/index.ts"],"sourcesContent":["export * from './AutoPatternsEntityPage';\nexport * from './ViewModeEntityPage';\
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/components/AutoPatternsEntityPage/index.ts"],"sourcesContent":["export * from './AutoPatternsEntityPage';\nexport * from './ViewModeEntityPage';\n"],"mappings":"AAAA,cAAc,0BAA0B;AACxC,cAAc,sBAAsB","ignoreList":[]}
|
|
@@ -1,37 +1,143 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Grid } from '@wix/patterns';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { Grid, GridState, useCreateCollection, useGridCollection, useSelector, useWixPatternsContainer } from '@wix/patterns';
|
|
4
|
+
import { useBasePatternsStateParams } from '../../hooks/useBasePatternsStateParams';
|
|
5
|
+
import { useGridFeaturesAsync } from '../../hooks';
|
|
6
|
+
import { useBaseGridFeatures } from '../../hooks/useBaseGridFeatures';
|
|
7
|
+
import { useBaseCollectionComponentReadyFeatures } from '../../hooks/useBaseCollectionComponentReadyFeatures';
|
|
8
|
+
/**
|
|
9
|
+
* AutoPatternsGridLoaded - Step 4 in Grid Flow
|
|
10
|
+
*
|
|
11
|
+
* FLOW 2: AutoPatternsCollectionComponent → AutoPatternsGrid → useGridFeaturesAsync → [AutoPatternsGridLoaded] → useBaseCollectionComponentReadyFeatures → Grid
|
|
12
|
+
*
|
|
13
|
+
* This component renders when all async features have been loaded and are ready.
|
|
14
|
+
* It represents the "loaded" state of the grid flow and handles:
|
|
15
|
+
*
|
|
16
|
+
* Key Responsibilities:
|
|
17
|
+
* - Creates the grid collection state using loaded async features
|
|
18
|
+
* - Calls useBaseCollectionComponentReadyFeatures for final feature preparation
|
|
19
|
+
* - Extracts grid-specific features (renderItem, preset, imagePlacement) from base features
|
|
20
|
+
* - Extracts async features like dragAndDrop if enabled
|
|
21
|
+
* - Renders the final Grid component with all features combined
|
|
22
|
+
*/
|
|
23
|
+
const AutoPatternsGridLoaded = props => {
|
|
24
|
+
const {
|
|
25
|
+
config,
|
|
26
|
+
asyncFeaturesState,
|
|
27
|
+
baseStateParams,
|
|
28
|
+
dataHook
|
|
29
|
+
} = props;
|
|
30
|
+
|
|
31
|
+
// Extract grid-specific display features (how items are rendered and displayed)
|
|
9
32
|
const {
|
|
10
|
-
state,
|
|
11
|
-
search,
|
|
12
|
-
title,
|
|
13
|
-
emptyState,
|
|
14
|
-
filters,
|
|
15
|
-
actionCell,
|
|
16
33
|
renderItem,
|
|
17
34
|
imagePlacement,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
35
|
+
preset
|
|
36
|
+
} = useBaseGridFeatures(config);
|
|
37
|
+
|
|
38
|
+
// Extract loaded async features from the successful feature loading state
|
|
39
|
+
const {
|
|
40
|
+
dragAndDrop
|
|
41
|
+
} = useSelector(() => ({
|
|
42
|
+
...asyncFeaturesState.status.data
|
|
43
|
+
}));
|
|
44
|
+
|
|
45
|
+
// Create grid collection state with the loaded async dependencies
|
|
46
|
+
const state = useGridCollection(baseStateParams.params);
|
|
47
|
+
|
|
48
|
+
// STEP 5: Call shared hook that prepares final collection features
|
|
49
|
+
// This hook is shared across all three flows (Table, Grid, TableGridSwitch)
|
|
50
|
+
const baseCollectionComponentReadyFeatures = useBaseCollectionComponentReadyFeatures({
|
|
51
|
+
config,
|
|
52
|
+
collection: state.collection,
|
|
53
|
+
asyncFeaturesState,
|
|
54
|
+
baseStateParams
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// Extract grid-specific drag and drop props if feature is loaded
|
|
58
|
+
const dragAndDropProps = dragAndDrop == null || dragAndDrop.useGridDragAndDrop == null ? void 0 : dragAndDrop.useGridDragAndDrop(config);
|
|
59
|
+
|
|
60
|
+
// FINAL STEP: Render the fully-featured Grid component
|
|
61
|
+
// Combines grid display features with loaded async features
|
|
22
62
|
return /*#__PURE__*/React.createElement(Grid, _extends({
|
|
23
|
-
dataHook:
|
|
24
|
-
search: search,
|
|
25
|
-
title: title,
|
|
26
|
-
state: state,
|
|
27
|
-
actionCell: actionCell,
|
|
28
|
-
filters: filters,
|
|
29
|
-
views: views,
|
|
30
|
-
emptyState: emptyState,
|
|
31
|
-
imagePlacement: imagePlacement
|
|
32
|
-
}, dragAndDropProps, {
|
|
63
|
+
dataHook: dataHook,
|
|
33
64
|
preset: preset,
|
|
34
|
-
|
|
65
|
+
imagePlacement: imagePlacement,
|
|
66
|
+
renderItem: renderItem,
|
|
67
|
+
state: state
|
|
68
|
+
}, baseCollectionComponentReadyFeatures, dragAndDropProps));
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* AutoPatternsGrid - Step 2 in Grid Flow
|
|
73
|
+
*
|
|
74
|
+
* FLOW 2: AutoPatternsCollectionComponent → [AutoPatternsGrid] → useGridFeaturesAsync → AutoPatternsGridLoaded → useBaseCollectionComponentReadyFeatures → Grid
|
|
75
|
+
*
|
|
76
|
+
* This is the main grid component that orchestrates the grid rendering flow.
|
|
77
|
+
* It handles the loading states and coordinates between async feature loading and final rendering.
|
|
78
|
+
*
|
|
79
|
+
* Key Responsibilities:
|
|
80
|
+
* - Extracts grid display features (renderItem, preset, imagePlacement) and visible field IDs
|
|
81
|
+
* - Calls useGridFeaturesAsync (Step 3) to load grid-specific async features
|
|
82
|
+
* - Creates initial grid state with basic collection
|
|
83
|
+
* - Monitors loading status and switches between loading/loaded states
|
|
84
|
+
* - Renders skeleton grid during loading or AutoPatternsGridLoaded when ready
|
|
85
|
+
*/
|
|
86
|
+
export const AutoPatternsGrid = props => {
|
|
87
|
+
const {
|
|
88
|
+
config
|
|
89
|
+
} = props;
|
|
90
|
+
|
|
91
|
+
// Extract grid display features and visible field IDs from configuration
|
|
92
|
+
const {
|
|
93
|
+
renderItem,
|
|
94
|
+
imagePlacement,
|
|
95
|
+
preset,
|
|
96
|
+
visibleFieldIds
|
|
97
|
+
} = useBaseGridFeatures(config);
|
|
98
|
+
|
|
99
|
+
// Initialize base state parameters with collection config and visible fields
|
|
100
|
+
const baseStateParams = useBasePatternsStateParams(config, {
|
|
101
|
+
visibleFieldIds
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// STEP 3: Load grid-specific async features (currently only drag&drop)
|
|
105
|
+
const {
|
|
106
|
+
asyncFeaturesState
|
|
107
|
+
} = useGridFeaturesAsync({
|
|
108
|
+
config
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// Create patterns container and collection factory
|
|
112
|
+
const container = useWixPatternsContainer();
|
|
113
|
+
const createCollection = useCreateCollection();
|
|
114
|
+
|
|
115
|
+
// Initialize grid state with basic collection (used during loading)
|
|
116
|
+
const [state] = useState(() => new GridState({
|
|
117
|
+
collection: createCollection(baseStateParams.params),
|
|
118
|
+
container
|
|
35
119
|
}));
|
|
120
|
+
|
|
121
|
+
// Monitor async features loading status
|
|
122
|
+
const isReady = useSelector(() => asyncFeaturesState.status.isSuccess || asyncFeaturesState.status.isError);
|
|
123
|
+
const dataHook = 'auto-patterns-grid';
|
|
124
|
+
if (isReady) {
|
|
125
|
+
// STEP 4: All features loaded - render the fully-featured grid
|
|
126
|
+
return /*#__PURE__*/React.createElement(AutoPatternsGridLoaded, {
|
|
127
|
+
dataHook: dataHook,
|
|
128
|
+
config: config,
|
|
129
|
+
baseStateParams: baseStateParams,
|
|
130
|
+
asyncFeaturesState: asyncFeaturesState
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// LOADING STATE: Render basic grid skeleton while features are loading
|
|
135
|
+
return /*#__PURE__*/React.createElement(Grid, {
|
|
136
|
+
dataHook: dataHook,
|
|
137
|
+
preset: preset,
|
|
138
|
+
imagePlacement: imagePlacement,
|
|
139
|
+
renderItem: renderItem,
|
|
140
|
+
state: state
|
|
141
|
+
});
|
|
36
142
|
};
|
|
37
143
|
//# sourceMappingURL=AutoPatternsGrid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Grid","
|
|
1
|
+
{"version":3,"names":["React","useState","Grid","GridState","useCreateCollection","useGridCollection","useSelector","useWixPatternsContainer","useBasePatternsStateParams","useGridFeaturesAsync","useBaseGridFeatures","useBaseCollectionComponentReadyFeatures","AutoPatternsGridLoaded","props","config","asyncFeaturesState","baseStateParams","dataHook","renderItem","imagePlacement","preset","dragAndDrop","status","data","state","params","baseCollectionComponentReadyFeatures","collection","dragAndDropProps","useGridDragAndDrop","createElement","_extends","AutoPatternsGrid","visibleFieldIds","container","createCollection","isReady","isSuccess","isError"],"sources":["../../../../src/components/AutoPatternsGrid/AutoPatternsGrid.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport {\n Grid,\n GridState,\n useCreateCollection,\n useGridCollection,\n useSelector,\n useWixPatternsContainer,\n} from '@wix/patterns';\nimport { GridConfig } from '../../types';\nimport { useBasePatternsStateParams } from '../../hooks/useBasePatternsStateParams';\nimport { useGridFeaturesAsync } from '../../hooks';\nimport { useBaseGridFeatures } from '../../hooks/useBaseGridFeatures';\nimport { useBaseCollectionComponentReadyFeatures } from '../../hooks/useBaseCollectionComponentReadyFeatures';\n\nexport interface AutoPatternsGridContentProps {\n config: GridConfig;\n}\n\n/**\n * AutoPatternsGridLoaded - Step 4 in Grid Flow\n *\n * FLOW 2: AutoPatternsCollectionComponent → AutoPatternsGrid → useGridFeaturesAsync → [AutoPatternsGridLoaded] → useBaseCollectionComponentReadyFeatures → Grid\n *\n * This component renders when all async features have been loaded and are ready.\n * It represents the \"loaded\" state of the grid flow and handles:\n *\n * Key Responsibilities:\n * - Creates the grid collection state using loaded async features\n * - Calls useBaseCollectionComponentReadyFeatures for final feature preparation\n * - Extracts grid-specific features (renderItem, preset, imagePlacement) from base features\n * - Extracts async features like dragAndDrop if enabled\n * - Renders the final Grid component with all features combined\n */\nconst AutoPatternsGridLoaded = (\n props: NonNullable<ReturnType<typeof useGridFeaturesAsync>> &\n AutoPatternsGridContentProps & {\n baseStateParams: ReturnType<typeof useBasePatternsStateParams>;\n dataHook?: string;\n },\n) => {\n const { config, asyncFeaturesState, baseStateParams, dataHook } = props;\n\n // Extract grid-specific display features (how items are rendered and displayed)\n const { renderItem, imagePlacement, preset } = useBaseGridFeatures(config);\n\n // Extract loaded async features from the successful feature loading state\n const { dragAndDrop } = useSelector(() => ({\n ...asyncFeaturesState.status.data,\n }));\n\n // Create grid collection state with the loaded async dependencies\n const state = useGridCollection<any>(baseStateParams.params);\n\n // STEP 5: Call shared hook that prepares final collection features\n // This hook is shared across all three flows (Table, Grid, TableGridSwitch)\n const baseCollectionComponentReadyFeatures =\n useBaseCollectionComponentReadyFeatures({\n config,\n collection: state.collection,\n asyncFeaturesState,\n baseStateParams,\n });\n\n // Extract grid-specific drag and drop props if feature is loaded\n const dragAndDropProps = dragAndDrop?.useGridDragAndDrop?.(config);\n\n // FINAL STEP: Render the fully-featured Grid component\n // Combines grid display features with loaded async features\n return (\n <Grid\n dataHook={dataHook}\n preset={preset}\n imagePlacement={imagePlacement}\n renderItem={renderItem}\n state={state}\n {...baseCollectionComponentReadyFeatures}\n {...dragAndDropProps}\n />\n );\n};\n\n/**\n * AutoPatternsGrid - Step 2 in Grid Flow\n *\n * FLOW 2: AutoPatternsCollectionComponent → [AutoPatternsGrid] → useGridFeaturesAsync → AutoPatternsGridLoaded → useBaseCollectionComponentReadyFeatures → Grid\n *\n * This is the main grid component that orchestrates the grid rendering flow.\n * It handles the loading states and coordinates between async feature loading and final rendering.\n *\n * Key Responsibilities:\n * - Extracts grid display features (renderItem, preset, imagePlacement) and visible field IDs\n * - Calls useGridFeaturesAsync (Step 3) to load grid-specific async features\n * - Creates initial grid state with basic collection\n * - Monitors loading status and switches between loading/loaded states\n * - Renders skeleton grid during loading or AutoPatternsGridLoaded when ready\n */\nexport const AutoPatternsGrid = (props: AutoPatternsGridContentProps) => {\n const { config } = props;\n\n // Extract grid display features and visible field IDs from configuration\n const { renderItem, imagePlacement, preset, visibleFieldIds } =\n useBaseGridFeatures(config);\n\n // Initialize base state parameters with collection config and visible fields\n const baseStateParams = useBasePatternsStateParams(config, {\n visibleFieldIds,\n });\n\n // STEP 3: Load grid-specific async features (currently only drag&drop)\n const { asyncFeaturesState } = useGridFeaturesAsync({ config });\n\n // Create patterns container and collection factory\n const container = useWixPatternsContainer();\n const createCollection = useCreateCollection();\n\n // Initialize grid state with basic collection (used during loading)\n const [state] = useState(\n () =>\n new GridState<any, {}>({\n collection: createCollection<any, {}>(baseStateParams.params),\n container,\n }),\n );\n\n // Monitor async features loading status\n const isReady = useSelector(\n () =>\n asyncFeaturesState.status.isSuccess || asyncFeaturesState.status.isError,\n );\n\n const dataHook = 'auto-patterns-grid';\n\n if (isReady) {\n // STEP 4: All features loaded - render the fully-featured grid\n return (\n <AutoPatternsGridLoaded\n dataHook={dataHook}\n config={config}\n baseStateParams={baseStateParams}\n asyncFeaturesState={asyncFeaturesState}\n />\n );\n }\n\n // LOADING STATE: Render basic grid skeleton while features are loading\n return (\n <Grid\n dataHook={dataHook}\n preset={preset}\n imagePlacement={imagePlacement}\n renderItem={renderItem}\n state={state}\n />\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SACEC,IAAI,EACJC,SAAS,EACTC,mBAAmB,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,cAAe;IAC/BD,UAAU,EAAEA,UAAW;IACvBM,KAAK,EAAEA;EAAM,CACd,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React, { lazy, Suspense } from 'react';
|
|
2
2
|
import { SchemaProvider } from '../../providers/SchemaContext';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
default: module.AutoPatternsCollectionPage
|
|
6
|
-
})));
|
|
3
|
+
import { AutoPatternsCollectionPage } from '../AutoPatternsCollectionPage';
|
|
4
|
+
import { ContentSkeleton } from '../layouts/ContentSkeleton';
|
|
7
5
|
const AutoPatternsEntityPage = /*#__PURE__*/lazy(() => import('../AutoPatternsEntityPage').then(module => ({
|
|
8
6
|
default: module.AutoPatternsEntityPage
|
|
9
7
|
})));
|
|
8
|
+
const AutoPatternsSettingsPage = /*#__PURE__*/lazy(() => import('../AutoPatternsSettingsPage').then(module => ({
|
|
9
|
+
default: module.AutoPatternsSettingsPage
|
|
10
|
+
})));
|
|
10
11
|
export const AutoPatternsPage = _ref => {
|
|
11
12
|
let {
|
|
12
13
|
pageConfig
|
|
@@ -14,34 +15,54 @@ export const AutoPatternsPage = _ref => {
|
|
|
14
15
|
const {
|
|
15
16
|
type,
|
|
16
17
|
collectionPage,
|
|
17
|
-
entityPage
|
|
18
|
+
entityPage,
|
|
19
|
+
settingsPage
|
|
18
20
|
} = pageConfig;
|
|
19
21
|
switch (type) {
|
|
20
22
|
case 'collectionPage':
|
|
21
23
|
if (collectionPage) {
|
|
22
|
-
return /*#__PURE__*/React.createElement(
|
|
23
|
-
fallback: /*#__PURE__*/React.createElement("div", null)
|
|
24
|
-
}, /*#__PURE__*/React.createElement(AutoPatternsCollectionPage, {
|
|
24
|
+
return /*#__PURE__*/React.createElement(AutoPatternsCollectionPage, {
|
|
25
25
|
configuration: collectionPage
|
|
26
|
-
})
|
|
26
|
+
});
|
|
27
27
|
}
|
|
28
28
|
break;
|
|
29
29
|
case 'entityPage':
|
|
30
30
|
if (entityPage) {
|
|
31
31
|
return /*#__PURE__*/React.createElement(SchemaProvider, {
|
|
32
32
|
collection: entityPage,
|
|
33
|
-
skeleton: /*#__PURE__*/React.createElement(
|
|
34
|
-
|
|
33
|
+
skeleton: /*#__PURE__*/React.createElement(ContentSkeleton, {
|
|
34
|
+
pageConfig: entityPage
|
|
35
35
|
})
|
|
36
36
|
}, /*#__PURE__*/React.createElement(Suspense, {
|
|
37
|
-
fallback: /*#__PURE__*/React.createElement(
|
|
38
|
-
|
|
37
|
+
fallback: /*#__PURE__*/React.createElement(ContentSkeleton, {
|
|
38
|
+
pageConfig: entityPage
|
|
39
39
|
})
|
|
40
40
|
}, /*#__PURE__*/React.createElement(AutoPatternsEntityPage, {
|
|
41
41
|
configuration: entityPage
|
|
42
42
|
})));
|
|
43
43
|
}
|
|
44
44
|
break;
|
|
45
|
+
case 'settingsPage':
|
|
46
|
+
if (settingsPage) {
|
|
47
|
+
return /*#__PURE__*/React.createElement(SchemaProvider, {
|
|
48
|
+
collection: {
|
|
49
|
+
...settingsPage,
|
|
50
|
+
collectionId: 'app-settings'
|
|
51
|
+
},
|
|
52
|
+
skeleton: /*#__PURE__*/React.createElement(ContentSkeleton, {
|
|
53
|
+
type: "settings",
|
|
54
|
+
pageConfig: settingsPage
|
|
55
|
+
})
|
|
56
|
+
}, /*#__PURE__*/React.createElement(Suspense, {
|
|
57
|
+
fallback: /*#__PURE__*/React.createElement(ContentSkeleton, {
|
|
58
|
+
type: "settings",
|
|
59
|
+
pageConfig: settingsPage
|
|
60
|
+
})
|
|
61
|
+
}, /*#__PURE__*/React.createElement(AutoPatternsSettingsPage, {
|
|
62
|
+
configuration: settingsPage
|
|
63
|
+
})));
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
45
66
|
default:
|
|
46
67
|
break;
|
|
47
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","lazy","Suspense","SchemaProvider","
|
|
1
|
+
{"version":3,"names":["React","lazy","Suspense","SchemaProvider","AutoPatternsCollectionPage","ContentSkeleton","AutoPatternsEntityPage","then","module","default","AutoPatternsSettingsPage","AutoPatternsPage","_ref","pageConfig","type","collectionPage","entityPage","settingsPage","createElement","configuration","collection","skeleton","fallback","collectionId"],"sources":["../../../../src/components/AutoPatternsRoute/AutoPatternsPage.tsx"],"sourcesContent":["import React, { lazy, Suspense } from 'react';\nimport { PageConfig } from '../../types';\nimport { SchemaProvider } from '../../providers/SchemaContext';\nimport { AutoPatternsCollectionPage } from '../AutoPatternsCollectionPage';\nimport { ContentSkeleton } from '../layouts/ContentSkeleton';\n\nconst AutoPatternsEntityPage = lazy(() =>\n import('../AutoPatternsEntityPage').then((module) => ({\n default: module.AutoPatternsEntityPage,\n })),\n);\n\nconst AutoPatternsSettingsPage = lazy(() =>\n import('../AutoPatternsSettingsPage').then((module) => ({\n default: module.AutoPatternsSettingsPage,\n })),\n);\n\nexport interface AutoPatternsPageProps {\n pageConfig: PageConfig;\n}\n\nexport const AutoPatternsPage = ({ pageConfig }: AutoPatternsPageProps) => {\n const { type, collectionPage, entityPage, settingsPage } = pageConfig;\n\n switch (type) {\n case 'collectionPage':\n if (collectionPage) {\n return <AutoPatternsCollectionPage configuration={collectionPage} />;\n }\n break;\n case 'entityPage':\n if (entityPage) {\n return (\n <SchemaProvider\n collection={entityPage}\n skeleton={<ContentSkeleton pageConfig={entityPage} />}\n >\n <Suspense fallback={<ContentSkeleton pageConfig={entityPage} />}>\n <AutoPatternsEntityPage configuration={entityPage} />\n </Suspense>\n </SchemaProvider>\n );\n }\n break;\n case 'settingsPage':\n if (settingsPage) {\n return (\n <SchemaProvider\n collection={{ ...settingsPage, collectionId: 'app-settings' }}\n skeleton={\n <ContentSkeleton type=\"settings\" pageConfig={settingsPage} />\n }\n >\n <Suspense\n fallback={\n <ContentSkeleton type=\"settings\" pageConfig={settingsPage} />\n }\n >\n <AutoPatternsSettingsPage configuration={settingsPage} />\n </Suspense>\n </SchemaProvider>\n );\n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E,gBAC9DhB,KAAA,CAAAkB,aAAA,CAACZ,sBAAsB;UAACa,aAAa,EAAEH;QAAW,CAAE,CAC5C,CACI,CAAC;MAErB;MACA;IACF,KAAK,cAAc;MACjB,IAAIC,YAAY,EAAE;QAChB,oBACEjB,KAAA,CAAAkB,aAAA,CAACf,cAAc;UACbiB,UAAU,EAAE;YAAE,GAAGH,YAAY;YAAEM,YAAY,EAAE;UAAe,CAAE;UAC9DF,QAAQ,eACNrB,KAAA,CAAAkB,aAAA,CAACb,eAAe;YAACS,IAAI,EAAC,UAAU;YAACD,UAAU,EAAEI;UAAa,CAAE;QAC7D,gBAEDjB,KAAA,CAAAkB,aAAA,CAAChB,QAAQ;UACPoB,QAAQ,eACNtB,KAAA,CAAAkB,aAAA,CAACb,eAAe;YAACS,IAAI,EAAC,UAAU;YAACD,UAAU,EAAEI;UAAa,CAAE;QAC7D,gBAEDjB,KAAA,CAAAkB,aAAA,CAACR,wBAAwB;UAACS,aAAa,EAAEF;QAAa,CAAE,CAChD,CACI,CAAC;MAErB;MACA;IACF;MACE;EACJ;EAEA,OAAO,IAAI;AACb,CAAC","ignoreList":[]}
|
|
@@ -6,7 +6,8 @@ import { Navigate } from 'react-router-dom';
|
|
|
6
6
|
import { useWixPatternsContainer } from '@wix/patterns';
|
|
7
7
|
const pageTypeToRouteType = {
|
|
8
8
|
collectionPage: 'collection',
|
|
9
|
-
entityPage: 'editEntity'
|
|
9
|
+
entityPage: 'editEntity',
|
|
10
|
+
settingsPage: 'other'
|
|
10
11
|
};
|
|
11
12
|
export const AutoPatternsRoutes = _ref => {
|
|
12
13
|
let {
|