@webiny/app 0.0.0-unstable.79032b23a5 → 0.0.0-unstable.7be00a75a9
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/App.d.ts +14 -18
- package/App.js +79 -102
- package/App.js.map +1 -1
- package/AppContainer.d.ts +23 -0
- package/AppContainer.js +6 -0
- package/AppContainer.js.map +1 -0
- package/README.md +7 -15
- package/apollo-client/InMemoryCache.d.ts +3 -2
- package/apollo-client/InMemoryCache.js +17 -55
- package/apollo-client/InMemoryCache.js.map +1 -1
- package/apollo-client/IntrospectionFragmentMatcher.d.ts +11 -0
- package/apollo-client/IntrospectionFragmentMatcher.js +33 -0
- package/apollo-client/IntrospectionFragmentMatcher.js.map +1 -0
- package/components/Image.d.ts +2 -3
- package/components/Image.js +16 -29
- package/components/Image.js.map +1 -1
- package/components/index.d.ts +1 -2
- package/components/index.js +1 -19
- package/config/RouterConfig/Route.d.ts +29 -0
- package/config/RouterConfig/Route.js +28 -0
- package/config/RouterConfig/Route.js.map +1 -0
- package/config/RouterConfig.d.ts +31 -0
- package/config/RouterConfig.js +19 -0
- package/config/RouterConfig.js.map +1 -0
- package/config.d.ts +1 -1
- package/config.js +21 -27
- package/config.js.map +1 -1
- package/contexts/Ui/index.d.ts +4 -4
- package/contexts/Ui/index.js +28 -57
- package/contexts/Ui/index.js.map +1 -1
- package/core/Plugin.d.ts +3 -3
- package/core/Plugin.js +11 -20
- package/core/Plugin.js.map +1 -1
- package/core/Plugins.d.ts +6 -3
- package/core/Plugins.js +19 -43
- package/core/Plugins.js.map +1 -1
- package/core/Provider.d.ts +3 -4
- package/core/Provider.js +9 -20
- package/core/Provider.js.map +1 -1
- package/core/createProvider.d.ts +7 -3
- package/core/createProvider.js +5 -12
- package/core/createProvider.js.map +1 -1
- package/core/createProviderPlugin.d.ts +2 -2
- package/core/createProviderPlugin.js +11 -20
- package/core/createProviderPlugin.js.map +1 -1
- package/errors/AuthenticationErrorEvent.d.ts +9 -0
- package/errors/AuthenticationErrorEvent.js +13 -0
- package/errors/AuthenticationErrorEvent.js.map +1 -0
- package/errors/NetworkErrorEvent.d.ts +15 -0
- package/errors/NetworkErrorEvent.js +13 -0
- package/errors/NetworkErrorEvent.js.map +1 -0
- package/errors/abstractions.d.ts +12 -0
- package/errors/abstractions.js +6 -0
- package/errors/abstractions.js.map +1 -0
- package/errors/index.d.ts +6 -0
- package/errors/index.js +3 -0
- package/exports/admin/env-config.d.ts +2 -0
- package/exports/admin/env-config.js +2 -0
- package/exports/admin/graphql-client.d.ts +1 -0
- package/exports/admin/graphql-client.js +1 -0
- package/exports/admin/local-storage.d.ts +2 -0
- package/exports/admin/local-storage.js +2 -0
- package/exports/admin/router.d.ts +5 -0
- package/exports/admin/router.js +5 -0
- package/exports/admin/security.d.ts +1 -0
- package/exports/admin/security.js +1 -0
- package/exports/admin.d.ts +7 -0
- package/exports/admin.js +7 -0
- package/features/envConfig/EnvConfig.d.ts +7 -0
- package/features/envConfig/EnvConfig.js +16 -0
- package/features/envConfig/EnvConfig.js.map +1 -0
- package/features/envConfig/abstractions.d.ts +28 -0
- package/features/envConfig/abstractions.js +5 -0
- package/features/envConfig/abstractions.js.map +1 -0
- package/features/envConfig/feature.d.ts +17 -0
- package/features/envConfig/feature.js +15 -0
- package/features/envConfig/feature.js.map +1 -0
- package/features/envConfig/index.d.ts +1 -0
- package/features/envConfig/index.js +1 -0
- package/features/eventPublisher/EventPublisher.d.ts +8 -0
- package/features/eventPublisher/EventPublisher.js +19 -0
- package/features/eventPublisher/EventPublisher.js.map +1 -0
- package/features/eventPublisher/abstractions.d.ts +18 -0
- package/features/eventPublisher/abstractions.js +12 -0
- package/features/eventPublisher/abstractions.js.map +1 -0
- package/features/eventPublisher/feature.d.ts +3 -0
- package/features/eventPublisher/feature.js +17 -0
- package/features/eventPublisher/feature.js.map +1 -0
- package/features/eventPublisher/index.d.ts +3 -0
- package/features/eventPublisher/index.js +2 -0
- package/features/graphqlClient/AuthenticationErrorPublishing.d.ts +13 -0
- package/features/graphqlClient/AuthenticationErrorPublishing.js +35 -0
- package/features/graphqlClient/AuthenticationErrorPublishing.js.map +1 -0
- package/features/graphqlClient/BatchingGraphQLClient.d.ts +16 -0
- package/features/graphqlClient/BatchingGraphQLClient.js +118 -0
- package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -0
- package/features/graphqlClient/FetchGraphQLClient.d.ts +7 -0
- package/features/graphqlClient/FetchGraphQLClient.js +51 -0
- package/features/graphqlClient/FetchGraphQLClient.js.map +1 -0
- package/features/graphqlClient/NetworkErrorPublishing.d.ts +14 -0
- package/features/graphqlClient/NetworkErrorPublishing.js +48 -0
- package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -0
- package/features/graphqlClient/RequestValue.d.ts +21 -0
- package/features/graphqlClient/RequestValue.js +46 -0
- package/features/graphqlClient/RequestValue.js.map +1 -0
- package/features/graphqlClient/RetryGraphQLClient.d.ts +18 -0
- package/features/graphqlClient/RetryGraphQLClient.js +45 -0
- package/features/graphqlClient/RetryGraphQLClient.js.map +1 -0
- package/features/graphqlClient/__tests__/GraphQLClient.test.d.ts +1 -0
- package/features/graphqlClient/__tests__/GraphQLClient.test.js +397 -0
- package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -0
- package/features/graphqlClient/abstractions.d.ts +18 -0
- package/features/graphqlClient/abstractions.js +5 -0
- package/features/graphqlClient/abstractions.js.map +1 -0
- package/features/graphqlClient/feature.d.ts +6 -0
- package/features/graphqlClient/feature.js +25 -0
- package/features/graphqlClient/feature.js.map +1 -0
- package/features/graphqlClient/index.d.ts +1 -0
- package/features/graphqlClient/index.js +1 -0
- package/features/graphqlClient/types.d.ts +5 -0
- package/features/graphqlClient/types.js +0 -0
- package/features/localStorage/BrowserLocalStorageGateway.d.ts +9 -0
- package/features/localStorage/BrowserLocalStorageGateway.js +61 -0
- package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -0
- package/features/localStorage/LocalStorage.d.ts +12 -0
- package/features/localStorage/LocalStorage.js +34 -0
- package/features/localStorage/LocalStorage.js.map +1 -0
- package/features/localStorage/LocalStorageRepository.d.ts +20 -0
- package/features/localStorage/LocalStorageRepository.js +82 -0
- package/features/localStorage/LocalStorageRepository.js.map +1 -0
- package/features/localStorage/abstractions.d.ts +48 -0
- package/features/localStorage/abstractions.js +8 -0
- package/features/localStorage/abstractions.js.map +1 -0
- package/features/localStorage/feature.d.ts +12 -0
- package/features/localStorage/feature.js +23 -0
- package/features/localStorage/feature.js.map +1 -0
- package/features/localStorage/index.d.ts +1 -0
- package/features/localStorage/index.js +1 -0
- package/features/mainGraphQLClient/MainGraphQLClient.d.ts +11 -0
- package/features/mainGraphQLClient/MainGraphQLClient.js +27 -0
- package/features/mainGraphQLClient/MainGraphQLClient.js.map +1 -0
- package/features/mainGraphQLClient/abstractions.d.ts +17 -0
- package/features/mainGraphQLClient/abstractions.js +5 -0
- package/features/mainGraphQLClient/abstractions.js.map +1 -0
- package/features/mainGraphQLClient/feature.d.ts +3 -0
- package/features/mainGraphQLClient/feature.js +17 -0
- package/features/mainGraphQLClient/feature.js.map +1 -0
- package/features/mainGraphQLClient/index.d.ts +1 -0
- package/features/mainGraphQLClient/index.js +1 -0
- package/features/router/HistoryRouterGateway.d.ts +22 -0
- package/features/router/HistoryRouterGateway.js +88 -0
- package/features/router/HistoryRouterGateway.js.map +1 -0
- package/features/router/HistoryRouterGateway.test.d.ts +1 -0
- package/features/router/HistoryRouterGateway.test.js +195 -0
- package/features/router/HistoryRouterGateway.test.js.map +1 -0
- package/features/router/Route.d.ts +19 -0
- package/features/router/Route.js +43 -0
- package/features/router/Route.js.map +1 -0
- package/features/router/RouteUrl.d.ts +85 -0
- package/features/router/RouteUrl.js +99 -0
- package/features/router/RouteUrl.js.map +1 -0
- package/features/router/Router.d.ts +45 -0
- package/features/router/Router.js +72 -0
- package/features/router/Router.js.map +1 -0
- package/features/router/RouterPresenter.d.ts +21 -0
- package/features/router/RouterPresenter.js +52 -0
- package/features/router/RouterPresenter.js.map +1 -0
- package/features/router/RouterRepository.d.ts +30 -0
- package/features/router/RouterRepository.js +117 -0
- package/features/router/RouterRepository.js.map +1 -0
- package/features/router/RouterRepository.test.d.ts +1 -0
- package/features/router/RouterRepository.test.js +138 -0
- package/features/router/RouterRepository.test.js.map +1 -0
- package/features/router/abstractions.d.ts +81 -0
- package/features/router/abstractions.js +7 -0
- package/features/router/abstractions.js.map +1 -0
- package/features/router/feature.d.ts +4 -0
- package/features/router/feature.js +19 -0
- package/features/router/feature.js.map +1 -0
- package/features/router/index.d.ts +2 -0
- package/features/router/index.js +1 -0
- package/helpers/InterfaceGenerator/date.d.ts +15 -0
- package/helpers/InterfaceGenerator/date.js +0 -0
- package/helpers/InterfaceGenerator/id.d.ts +23 -0
- package/helpers/InterfaceGenerator/id.js +0 -0
- package/helpers/InterfaceGenerator/identity.d.ts +10 -0
- package/helpers/InterfaceGenerator/identity.js +0 -0
- package/helpers/InterfaceGenerator/index.d.ts +5 -0
- package/helpers/InterfaceGenerator/index.js +0 -0
- package/helpers/InterfaceGenerator/numeric.d.ts +12 -0
- package/helpers/InterfaceGenerator/numeric.js +0 -0
- package/helpers/InterfaceGenerator/truthful.d.ts +7 -0
- package/helpers/InterfaceGenerator/truthful.js +0 -0
- package/hooks/useAutocomplete/index.d.ts +1 -1
- package/hooks/useAutocomplete/index.js +1 -12
- package/hooks/useAutocomplete/useAutocomplete.d.ts +1 -1
- package/hooks/useAutocomplete/useAutocomplete.js +16 -28
- package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
- package/hooks/useDataList/functions/getData.js +4 -11
- package/hooks/useDataList/functions/getData.js.map +1 -1
- package/hooks/useDataList/functions/getError.js +4 -11
- package/hooks/useDataList/functions/getError.js.map +1 -1
- package/hooks/useDataList/functions/getMeta.js +4 -11
- package/hooks/useDataList/functions/getMeta.js.map +1 -1
- package/hooks/useDataList/functions/index.d.ts +3 -3
- package/hooks/useDataList/functions/index.js +3 -27
- package/hooks/useDataList/functions/searchDataByKey.js +11 -21
- package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
- package/hooks/useDataList/index.d.ts +1 -1
- package/hooks/useDataList/index.js +1 -12
- package/hooks/useDataList/useDataList.d.ts +2 -3
- package/hooks/useDataList/useDataList.js +140 -180
- package/hooks/useDataList/useDataList.js.map +1 -1
- package/hooks/useDataList/utils/index.d.ts +1 -2
- package/hooks/useDataList/utils/index.js +1 -20
- package/hooks/useDataList/utils/prepareLoadListParams.d.ts +1 -2
- package/hooks/useDataList/utils/prepareLoadListParams.js +27 -36
- package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
- package/hooks/useHandler.js +14 -17
- package/hooks/useHandler.js.map +1 -1
- package/hooks/useHandlers.d.ts +3 -3
- package/hooks/useHandlers.js +20 -26
- package/hooks/useHandlers.js.map +1 -1
- package/hooks/useRegisterLegacyPlugin.d.ts +2 -0
- package/hooks/useRegisterLegacyPlugin.js +12 -0
- package/hooks/useRegisterLegacyPlugin.js.map +1 -0
- package/hooks/useUi.d.ts +1 -1
- package/hooks/useUi.js +5 -11
- package/hooks/useUi.js.map +1 -1
- package/i18n/i18n.js +10 -13
- package/i18n/i18n.js.map +1 -1
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +1 -13
- package/index.d.ts +23 -13
- package/index.js +23 -147
- package/package.json +38 -41
- package/plugins/AddQuerySelectionPlugin.d.ts +2 -2
- package/plugins/AddQuerySelectionPlugin.js +41 -116
- package/plugins/AddQuerySelectionPlugin.js.map +1 -1
- package/plugins/ApolloCacheObjectIdPlugin.js +16 -37
- package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
- package/plugins/ApolloDynamicLink.d.ts +3 -2
- package/plugins/ApolloDynamicLink.js +25 -56
- package/plugins/ApolloDynamicLink.js.map +1 -1
- package/plugins/ApolloLinkPlugin.d.ts +1 -1
- package/plugins/ApolloLinkPlugin.js +22 -45
- package/plugins/ApolloLinkPlugin.js.map +1 -1
- package/plugins/ConsoleLinkPlugin.d.ts +1 -1
- package/plugins/ConsoleLinkPlugin.js +21 -45
- package/plugins/ConsoleLinkPlugin.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +8 -13
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +48 -76
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.d.ts +14 -0
- package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js +27 -0
- package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js.map +1 -0
- package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.d.ts +2 -0
- package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js +23 -0
- package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js.map +1 -0
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +4 -7
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +68 -17
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/Typography.d.ts +8 -0
- package/plugins/NetworkErrorLinkPlugin/Typography.js +13 -0
- package/plugins/NetworkErrorLinkPlugin/Typography.js.map +1 -0
- package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js +19 -0
- package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js.map +1 -0
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +3 -3
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +14 -30
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin.d.ts +4 -1
- package/plugins/NetworkErrorLinkPlugin.js +52 -47
- package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
- package/plugins/OmitTypenameLinkPlugin.d.ts +1 -1
- package/plugins/OmitTypenameLinkPlugin.js +13 -38
- package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
- package/plugins/TenantHeaderLinkPlugin.d.ts +3 -3
- package/plugins/TenantHeaderLinkPlugin.js +27 -59
- package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
- package/plugins/components/Image.d.ts +6 -0
- package/plugins/components/Image.js +12 -0
- package/plugins/components/Image.js.map +1 -0
- package/plugins/image.d.ts +1 -1
- package/plugins/image.js +97 -142
- package/plugins/image.js.map +1 -1
- package/plugins/index.d.ts +5 -5
- package/plugins/index.js +39 -86
- package/plugins/index.js.map +1 -1
- package/presentation/envConfig/useEnvConfig.d.ts +6 -0
- package/presentation/envConfig/useEnvConfig.js +9 -0
- package/presentation/envConfig/useEnvConfig.js.map +1 -0
- package/presentation/localStorage/index.d.ts +3 -0
- package/presentation/localStorage/index.js +3 -0
- package/presentation/localStorage/useLocalStorage.d.ts +6 -0
- package/presentation/localStorage/useLocalStorage.js +15 -0
- package/presentation/localStorage/useLocalStorage.js.map +1 -0
- package/presentation/localStorage/useLocalStorageValue.d.ts +1 -0
- package/presentation/localStorage/useLocalStorageValue.js +22 -0
- package/presentation/localStorage/useLocalStorageValue.js.map +1 -0
- package/presentation/localStorage/useLocalStorageValues.d.ts +5 -0
- package/presentation/localStorage/useLocalStorageValues.js +32 -0
- package/presentation/localStorage/useLocalStorageValues.js.map +1 -0
- package/presentation/router/RouteElementRegistry.d.ts +14 -0
- package/presentation/router/RouteElementRegistry.js +29 -0
- package/presentation/router/RouteElementRegistry.js.map +1 -0
- package/presentation/router/abstractions.d.ts +13 -0
- package/presentation/router/abstractions.js +5 -0
- package/presentation/router/abstractions.js.map +1 -0
- package/presentation/router/components/Redirect.d.ts +14 -0
- package/presentation/router/components/Redirect.js +13 -0
- package/presentation/router/components/Redirect.js.map +1 -0
- package/presentation/router/components/RouteContent.d.ts +2 -0
- package/presentation/router/components/RouteContent.js +20 -0
- package/presentation/router/components/RouteContent.js.map +1 -0
- package/presentation/router/components/RouteLink.d.ts +50 -0
- package/presentation/router/components/RouteLink.js +17 -0
- package/presentation/router/components/RouteLink.js.map +1 -0
- package/presentation/router/components/SimpleLink.d.ts +44 -0
- package/presentation/router/components/SimpleLink.js +24 -0
- package/presentation/router/components/SimpleLink.js.map +1 -0
- package/presentation/router/hooks/useRoute.d.ts +6 -0
- package/presentation/router/hooks/useRoute.js +22 -0
- package/presentation/router/hooks/useRoute.js.map +1 -0
- package/presentation/router/hooks/useRouter.d.ts +11 -0
- package/presentation/router/hooks/useRouter.js +29 -0
- package/presentation/router/hooks/useRouter.js.map +1 -0
- package/presentation/router/index.d.ts +4 -0
- package/presentation/router/index.js +3 -0
- package/presentation/router/types.d.ts +5 -0
- package/presentation/router/types.js +0 -0
- package/renderApp.d.ts +2 -0
- package/renderApp.js +10 -0
- package/renderApp.js.map +1 -0
- package/router.d.ts +5 -0
- package/router.js +5 -0
- package/rslib-runtime.js +14 -0
- package/rslib-runtime.js.map +1 -0
- package/shared/di/DiContainerProvider.d.ts +8 -0
- package/shared/di/DiContainerProvider.js +13 -0
- package/shared/di/DiContainerProvider.js.map +1 -0
- package/shared/di/createFeature.d.ts +11 -0
- package/shared/di/createFeature.js +10 -0
- package/shared/di/createFeature.js.map +1 -0
- package/shared/di/useFeature.d.ts +2 -0
- package/shared/di/useFeature.js +12 -0
- package/shared/di/useFeature.js.map +1 -0
- package/static/svg/close_24px.33adaadc.svg +1 -0
- package/types.d.ts +16 -28
- package/types.js +0 -12
- package/utils/createGenericContext.d.ts +13 -0
- package/utils/createGenericContext.js +21 -0
- package/utils/createGenericContext.js.map +1 -0
- package/utils/createHashing.d.ts +2 -0
- package/utils/createHashing.js +15 -0
- package/utils/createHashing.js.map +1 -0
- package/utils/index.d.ts +2 -8
- package/utils/index.js +2 -93
- package/utils/legacyPluginToReactComponent.d.ts +7 -0
- package/utils/legacyPluginToReactComponent.js +15 -0
- package/utils/legacyPluginToReactComponent.js.map +1 -0
- package/components/Routes.d.ts +0 -2
- package/components/Routes.js +0 -45
- package/components/Routes.js.map +0 -1
- package/components/View.d.ts +0 -8
- package/components/View.js +0 -30
- package/components/View.js.map +0 -1
- package/components/index.js.map +0 -1
- package/core/AddRoute.d.ts +0 -3
- package/core/AddRoute.js +0 -19
- package/core/AddRoute.js.map +0 -1
- package/core/DebounceRender.d.ts +0 -11
- package/core/DebounceRender.js +0 -41
- package/core/DebounceRender.js.map +0 -1
- package/core/Routes.d.ts +0 -6
- package/core/Routes.js +0 -42
- package/core/Routes.js.map +0 -1
- package/hooks/useAutocomplete/index.js.map +0 -1
- package/hooks/useDataList/functions/index.js.map +0 -1
- package/hooks/useDataList/index.js.map +0 -1
- package/hooks/useDataList/utils/index.js.map +0 -1
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +0 -14
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +0 -29
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +0 -1
- package/hooks/useDataList/utils/types.d.ts +0 -34
- package/hooks/useDataList/utils/types.js +0 -5
- package/hooks/useDataList/utils/types.js.map +0 -1
- package/i18n/index.js.map +0 -1
- package/index.js.map +0 -1
- package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -10
- package/plugins/LocaleHeaderLinkPlugin.js +0 -53
- package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
- package/plugins/RoutePlugin.d.ts +0 -12
- package/plugins/RoutePlugin.js +0 -38
- package/plugins/RoutePlugin.js.map +0 -1
- package/plugins/ViewPlugin.d.ts +0 -14
- package/plugins/ViewPlugin.js +0 -43
- package/plugins/ViewPlugin.js.map +0 -1
- package/types.js.map +0 -1
- package/utils/getApiUrl.d.ts +0 -1
- package/utils/getApiUrl.js +0 -11
- package/utils/getApiUrl.js.map +0 -1
- package/utils/getGqlApiUrl.d.ts +0 -1
- package/utils/getGqlApiUrl.js +0 -11
- package/utils/getGqlApiUrl.js.map +0 -1
- package/utils/getHeadlessCmsGqlApiUrl.d.ts +0 -5
- package/utils/getHeadlessCmsGqlApiUrl.js +0 -17
- package/utils/getHeadlessCmsGqlApiUrl.js.map +0 -1
- package/utils/getLocaleCode.d.ts +0 -6
- package/utils/getLocaleCode.js +0 -42
- package/utils/getLocaleCode.js.map +0 -1
- package/utils/getPrerenderId.d.ts +0 -6
- package/utils/getPrerenderId.js +0 -10
- package/utils/getPrerenderId.js.map +0 -1
- package/utils/getTenantId.d.ts +0 -6
- package/utils/getTenantId.js +0 -34
- package/utils/getTenantId.js.map +0 -1
- package/utils/index.js.map +0 -1
- package/utils/isLocalhost.d.ts +0 -1
- package/utils/isLocalhost.js +0 -14
- package/utils/isLocalhost.js.map +0 -1
- package/utils/isPrerendering.d.ts +0 -1
- package/utils/isPrerendering.js +0 -10
- package/utils/isPrerendering.js.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Route as BaseRoute } from "../../router.js";
|
|
3
|
+
export interface RouteProps {
|
|
4
|
+
route: BaseRoute<any>;
|
|
5
|
+
element: React.ReactElement;
|
|
6
|
+
remove?: boolean;
|
|
7
|
+
before?: string;
|
|
8
|
+
after?: string;
|
|
9
|
+
}
|
|
10
|
+
export type RouteConfig = Pick<RouteProps, "route" | "element">;
|
|
11
|
+
export declare const Route: (({ route, element, remove, before, after }: RouteProps) => React.JSX.Element) & {
|
|
12
|
+
original: ({ route, element, remove, before, after }: RouteProps) => React.JSX.Element;
|
|
13
|
+
originalName: string;
|
|
14
|
+
displayName: string;
|
|
15
|
+
} & {
|
|
16
|
+
original: (({ route, element, remove, before, after }: RouteProps) => React.JSX.Element) & {
|
|
17
|
+
original: ({ route, element, remove, before, after }: RouteProps) => React.JSX.Element;
|
|
18
|
+
originalName: string;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
originalName: string;
|
|
22
|
+
displayName: string;
|
|
23
|
+
} & {
|
|
24
|
+
createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<(({ route, element, remove, before, after }: RouteProps) => React.JSX.Element) & {
|
|
25
|
+
original: ({ route, element, remove, before, after }: RouteProps) => React.JSX.Element;
|
|
26
|
+
originalName: string;
|
|
27
|
+
displayName: string;
|
|
28
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
29
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { makeDecoratable } from "@webiny/react-composition";
|
|
3
|
+
import { Property, useIdGenerator } from "@webiny/react-properties";
|
|
4
|
+
const Route = makeDecoratable("Route", ({ route, element, remove, before, after })=>{
|
|
5
|
+
const name = route.name;
|
|
6
|
+
const getId = useIdGenerator("Route");
|
|
7
|
+
const placeAfter = void 0 !== after ? getId(after) : void 0;
|
|
8
|
+
const placeBefore = void 0 !== before ? getId(before) : void 0;
|
|
9
|
+
return /*#__PURE__*/ react.createElement(Property, {
|
|
10
|
+
id: getId(name),
|
|
11
|
+
name: "routes",
|
|
12
|
+
remove: remove,
|
|
13
|
+
array: true,
|
|
14
|
+
before: placeBefore,
|
|
15
|
+
after: placeAfter
|
|
16
|
+
}, /*#__PURE__*/ react.createElement(Property, {
|
|
17
|
+
id: getId(name, "route"),
|
|
18
|
+
name: "route",
|
|
19
|
+
value: route
|
|
20
|
+
}), /*#__PURE__*/ react.createElement(Property, {
|
|
21
|
+
id: getId(name, "element"),
|
|
22
|
+
name: "element",
|
|
23
|
+
value: element
|
|
24
|
+
}));
|
|
25
|
+
});
|
|
26
|
+
export { Route };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=Route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config/RouterConfig/Route.js","sources":["../../../src/config/RouterConfig/Route.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\nimport { Property, useIdGenerator } from \"@webiny/react-properties\";\nimport type { Route as BaseRoute } from \"~/router.js\";\n\nexport interface RouteProps {\n route: BaseRoute<any>;\n element: React.ReactElement;\n remove?: boolean;\n before?: string;\n after?: string;\n}\n\nexport type RouteConfig = Pick<RouteProps, \"route\" | \"element\">;\n\nexport const Route = makeDecoratable(\n \"Route\",\n ({ route, element, remove, before, after }: RouteProps) => {\n const name = route.name;\n\n const getId = useIdGenerator(\"Route\");\n\n const placeAfter = after !== undefined ? getId(after) : undefined;\n const placeBefore = before !== undefined ? getId(before) : undefined;\n\n return (\n <Property\n id={getId(name)}\n name={\"routes\"}\n remove={remove}\n array={true}\n before={placeBefore}\n after={placeAfter}\n >\n <Property id={getId(name, \"route\")} name={\"route\"} value={route} />\n <Property id={getId(name, \"element\")} name={\"element\"} value={element} />\n </Property>\n );\n }\n);\n"],"names":["Route","makeDecoratable","route","element","remove","before","after","name","getId","useIdGenerator","placeAfter","undefined","placeBefore","Property"],"mappings":";;;AAeO,MAAMA,QAAQC,gBACjB,SACA,CAAC,EAAEC,KAAK,EAAEC,OAAO,EAAEC,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAc;IAClD,MAAMC,OAAOL,MAAM,IAAI;IAEvB,MAAMM,QAAQC,eAAe;IAE7B,MAAMC,aAAaJ,AAAUK,WAAVL,QAAsBE,MAAMF,SAASK;IACxD,MAAMC,cAAcP,AAAWM,WAAXN,SAAuBG,MAAMH,UAAUM;IAE3D,OAAO,WAAP,GACI,oBAACE,UAAQA;QACL,IAAIL,MAAMD;QACV,MAAM;QACN,QAAQH;QACR,OAAO;QACP,QAAQQ;QACR,OAAOF;qBAEP,oBAACG,UAAQA;QAAC,IAAIL,MAAMD,MAAM;QAAU,MAAM;QAAS,OAAOL;sBAC1D,oBAACW,UAAQA;QAAC,IAAIL,MAAMD,MAAM;QAAY,MAAM;QAAW,OAAOJ;;AAG1E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type RouteConfig } from "./RouterConfig/Route.js";
|
|
2
|
+
export declare const RouterWithConfig: (({ onProperties, children }: import("@webiny/react-properties").WithConfigProps) => React.JSX.Element) & {
|
|
3
|
+
displayName: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const useRouterConfig: () => {
|
|
6
|
+
routes: RouteConfig[];
|
|
7
|
+
};
|
|
8
|
+
export declare const RouterConfig: (({ priority, children }: import("@webiny/react-properties").ConfigProps) => React.JSX.Element) & {
|
|
9
|
+
Route: (({ route, element, remove, before, after }: import("./RouterConfig/Route.js").RouteProps) => import("react").JSX.Element) & {
|
|
10
|
+
original: ({ route, element, remove, before, after }: import("./RouterConfig/Route.js").RouteProps) => import("react").JSX.Element;
|
|
11
|
+
originalName: string;
|
|
12
|
+
displayName: string;
|
|
13
|
+
} & {
|
|
14
|
+
original: (({ route, element, remove, before, after }: import("./RouterConfig/Route.js").RouteProps) => import("react").JSX.Element) & {
|
|
15
|
+
original: ({ route, element, remove, before, after }: import("./RouterConfig/Route.js").RouteProps) => import("react").JSX.Element;
|
|
16
|
+
originalName: string;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
originalName: string;
|
|
20
|
+
displayName: string;
|
|
21
|
+
} & {
|
|
22
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ route, element, remove, before, after }: import("./RouterConfig/Route.js").RouteProps) => import("react").JSX.Element) & {
|
|
23
|
+
original: ({ route, element, remove, before, after }: import("./RouterConfig/Route.js").RouteProps) => import("react").JSX.Element;
|
|
24
|
+
originalName: string;
|
|
25
|
+
displayName: string;
|
|
26
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
27
|
+
};
|
|
28
|
+
useRouterConfig: () => {
|
|
29
|
+
routes: RouteConfig[];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createConfigurableComponent } from "@webiny/react-properties";
|
|
2
|
+
import { Route } from "./RouterConfig/Route.js";
|
|
3
|
+
const base = createConfigurableComponent("RouterConfig");
|
|
4
|
+
const RouterWithConfig = Object.assign(base.WithConfig, {
|
|
5
|
+
displayName: "RouterWithConfig"
|
|
6
|
+
});
|
|
7
|
+
const useRouterConfig = ()=>{
|
|
8
|
+
const baseConfig = base.useConfig();
|
|
9
|
+
return {
|
|
10
|
+
routes: baseConfig.routes ?? []
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
const RouterConfig = Object.assign(base.Config, {
|
|
14
|
+
Route: Route,
|
|
15
|
+
useRouterConfig: useRouterConfig
|
|
16
|
+
});
|
|
17
|
+
export { RouterConfig, RouterWithConfig, useRouterConfig };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=RouterConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config/RouterConfig.js","sources":["../../src/config/RouterConfig.tsx"],"sourcesContent":["import { createConfigurableComponent } from \"@webiny/react-properties\";\nimport { Route, type RouteConfig } from \"./RouterConfig/Route.js\";\n\nconst base = createConfigurableComponent<RouterConfig>(\"RouterConfig\");\n\nexport const RouterWithConfig = Object.assign(base.WithConfig, {\n displayName: \"RouterWithConfig\"\n});\n\ninterface RouterConfig {\n routes: RouteConfig[];\n}\n\nexport const useRouterConfig = () => {\n const baseConfig = base.useConfig();\n\n return {\n routes: baseConfig.routes ?? []\n };\n};\n\nexport const RouterConfig = Object.assign(base.Config, {\n Route,\n useRouterConfig\n});\n"],"names":["base","createConfigurableComponent","RouterWithConfig","Object","useRouterConfig","baseConfig","RouterConfig","Route"],"mappings":";;AAGA,MAAMA,OAAOC,4BAA0C;AAEhD,MAAMC,mBAAmBC,OAAO,MAAM,CAACH,KAAK,UAAU,EAAE;IAC3D,aAAa;AACjB;AAMO,MAAMI,kBAAkB;IAC3B,MAAMC,aAAaL,KAAK,SAAS;IAEjC,OAAO;QACH,QAAQK,WAAW,MAAM,IAAI,EAAE;IACnC;AACJ;AAEO,MAAMC,eAAeH,OAAO,MAAM,CAACH,KAAK,MAAM,EAAE;IACnDO,OAAKA;IACLH,iBAAAA;AACJ"}
|
package/config.d.ts
CHANGED
package/config.js
CHANGED
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.config = void 0;
|
|
7
|
-
var deepFreeze = function deepFreeze(obj) {
|
|
8
|
-
Object.keys(obj).forEach(function (prop) {
|
|
9
|
-
if (typeof obj[prop] === "object" && !Object.isFrozen(obj[prop])) {
|
|
10
|
-
deepFreeze(obj[prop]);
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
return Object.freeze(obj);
|
|
1
|
+
const deepFreeze = (obj)=>{
|
|
2
|
+
Object.keys(obj).forEach((prop)=>{
|
|
3
|
+
if ("object" == typeof obj[prop] && !Object.isFrozen(obj[prop])) deepFreeze(obj[prop]);
|
|
4
|
+
});
|
|
5
|
+
return Object.freeze(obj);
|
|
14
6
|
};
|
|
15
7
|
function createConfig() {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
let _config = {};
|
|
9
|
+
return {
|
|
10
|
+
set (config) {
|
|
11
|
+
_config = deepFreeze(config);
|
|
12
|
+
},
|
|
13
|
+
get () {
|
|
14
|
+
return _config;
|
|
15
|
+
},
|
|
16
|
+
getKey (key, defaultValue) {
|
|
17
|
+
return key in _config ? _config[key] : defaultValue;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
28
20
|
}
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
const config_config = createConfig();
|
|
22
|
+
export { config_config as config };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=config.js.map
|
package/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../src/config.ts"],"sourcesContent":["export type Config = Record<string, any>;\n\ninterface AppConfig {\n set(config: Config): void;\n get(): Config;\n getKey<T = string>(key: string, defaultValue: T): T;\n}\n\nconst deepFreeze = (obj: Record<string, any>): Record<string, any> => {\n Object.keys(obj).forEach(prop => {\n if (typeof obj[prop] === \"object\" && !Object.isFrozen(obj[prop])) {\n deepFreeze(obj[prop]);\n }\n });\n return Object.freeze(obj);\n};\n\nfunction createConfig(): AppConfig {\n let _config: Record<string, any> = {};\n\n return {\n set(config: Config) {\n _config = deepFreeze(config);\n },\n get() {\n return _config;\n },\n getKey(key, defaultValue) {\n return key in _config ? _config[key] : defaultValue;\n }\n };\n}\n\nexport const config = createConfig();\n"],"names":["deepFreeze","obj","Object","prop","createConfig","_config","config","key","defaultValue"],"mappings":"AAQA,MAAMA,aAAa,CAACC;IAChBC,OAAO,IAAI,CAACD,KAAK,OAAO,CAACE,CAAAA;QACrB,IAAI,AAAqB,YAArB,OAAOF,GAAG,CAACE,KAAK,IAAiB,CAACD,OAAO,QAAQ,CAACD,GAAG,CAACE,KAAK,GAC3DH,WAAWC,GAAG,CAACE,KAAK;IAE5B;IACA,OAAOD,OAAO,MAAM,CAACD;AACzB;AAEA,SAASG;IACL,IAAIC,UAA+B,CAAC;IAEpC,OAAO;QACH,KAAIC,MAAc;YACdD,UAAUL,WAAWM;QACzB;QACA;YACI,OAAOD;QACX;QACA,QAAOE,GAAG,EAAEC,YAAY;YACpB,OAAOD,OAAOF,UAAUA,OAAO,CAACE,IAAI,GAAGC;QAC3C;IACJ;AACJ;AAEO,MAAMF,gBAASF"}
|
package/contexts/Ui/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare const UiContext: React.Context<
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export declare const UiContext: React.Context<Record<string, any>>;
|
|
3
|
+
type Props = Record<string, any>;
|
|
4
|
+
type State = {
|
|
5
5
|
ui: {
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
};
|
|
@@ -19,6 +19,6 @@ export interface UiContextValue {
|
|
|
19
19
|
export declare class UiProvider extends React.Component<Props, State> {
|
|
20
20
|
state: State;
|
|
21
21
|
private readonly setData;
|
|
22
|
-
render(): JSX.Element;
|
|
22
|
+
render(): React.JSX.Element;
|
|
23
23
|
}
|
|
24
24
|
export {};
|
package/contexts/Ui/index.js
CHANGED
|
@@ -1,59 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
var _react = _interopRequireDefault(require("react"));
|
|
16
|
-
var _plugins = require("@webiny/plugins");
|
|
17
|
-
var UiContext = /*#__PURE__*/_react.default.createContext({});
|
|
18
|
-
exports.UiContext = UiContext;
|
|
19
|
-
var UiProvider = /*#__PURE__*/function (_React$Component) {
|
|
20
|
-
(0, _inherits2.default)(UiProvider, _React$Component);
|
|
21
|
-
var _super = (0, _createSuper2.default)(UiProvider);
|
|
22
|
-
function UiProvider() {
|
|
23
|
-
var _this;
|
|
24
|
-
(0, _classCallCheck2.default)(this, UiProvider);
|
|
25
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
|
-
args[_key] = arguments[_key];
|
|
27
|
-
}
|
|
28
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
29
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
30
|
-
ui: {}
|
|
31
|
-
});
|
|
32
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setData", function (setter) {
|
|
33
|
-
return _this.setState(function (state) {
|
|
34
|
-
return {
|
|
35
|
-
ui: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state.ui), setter(state.ui))
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { plugins } from "@webiny/plugins";
|
|
3
|
+
const UiContext = /*#__PURE__*/ react.createContext({});
|
|
4
|
+
class UiProvider extends react.Component {
|
|
5
|
+
render() {
|
|
6
|
+
const value = {
|
|
7
|
+
...this.state.ui,
|
|
8
|
+
setState: this.setData
|
|
36
9
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
value: function render() {
|
|
44
|
-
var value = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.state.ui), {}, {
|
|
45
|
-
setState: this.setData
|
|
46
|
-
});
|
|
47
|
-
var uiStatePlugins = _plugins.plugins.byType("ui-state");
|
|
48
|
-
return /*#__PURE__*/_react.default.createElement(UiContext.Provider, {
|
|
49
|
-
value: value
|
|
50
|
-
}, uiStatePlugins.map(function (pl) {
|
|
51
|
-
return /*#__PURE__*/_react.default.cloneElement(pl.render(), {
|
|
52
|
-
key: pl.name
|
|
53
|
-
});
|
|
54
|
-
}), this.props.children);
|
|
10
|
+
const uiStatePlugins = plugins.byType("ui-state");
|
|
11
|
+
return /*#__PURE__*/ react.createElement(UiContext.Provider, {
|
|
12
|
+
value: value
|
|
13
|
+
}, uiStatePlugins.map((pl)=>/*#__PURE__*/ react.cloneElement(pl.render(), {
|
|
14
|
+
key: pl.name
|
|
15
|
+
})), this.props.children);
|
|
55
16
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
17
|
+
constructor(...args){
|
|
18
|
+
super(...args), this.state = {
|
|
19
|
+
ui: {}
|
|
20
|
+
}, this.setData = (setter)=>this.setState((state)=>({
|
|
21
|
+
ui: {
|
|
22
|
+
...state.ui,
|
|
23
|
+
...setter(state.ui)
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export { UiContext, UiProvider };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
package/contexts/Ui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"contexts/Ui/index.js","sources":["../../../src/contexts/Ui/index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { UiStatePlugin } from \"~/types.js\";\nimport { plugins } from \"@webiny/plugins\";\n\nexport const UiContext = React.createContext<Record<string, any>>({});\n\ntype Props = Record<string, any>;\n\ntype State = {\n ui: { [key: string]: any };\n};\n\ninterface UiData {\n [key: string]: any;\n}\n\ninterface UiDataSetter {\n (ui: UiData): UiData;\n}\n\nexport interface UiContextValue {\n setState: (setter: UiDataSetter) => void;\n [key: string]: any;\n}\n\nexport class UiProvider extends React.Component<Props, State> {\n public override state: State = {\n ui: {}\n };\n\n private readonly setData = (setter: UiDataSetter): void => {\n return this.setState((state: State) => {\n return { ui: { ...state.ui, ...setter(state.ui) } };\n });\n };\n\n public override render() {\n const value: UiContextValue = { ...this.state.ui, setState: this.setData };\n const uiStatePlugins = plugins.byType<UiStatePlugin>(\"ui-state\");\n return (\n <UiContext.Provider value={value}>\n {uiStatePlugins.map(pl => React.cloneElement(pl.render(), { key: pl.name }))}\n {this.props.children}\n </UiContext.Provider>\n );\n }\n}\n"],"names":["UiContext","React","UiProvider","value","uiStatePlugins","plugins","pl","setter","state"],"mappings":";;AAIO,MAAMA,YAAY,WAAHA,GAAGC,MAAAA,aAAmB,CAAsB,CAAC;AAqB5D,MAAMC,mBAAmBD,MAAAA,SAAe;IAW3B,SAAS;QACrB,MAAME,QAAwB;YAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE;YAAE,UAAU,IAAI,CAAC,OAAO;QAAC;QACzE,MAAMC,iBAAiBC,QAAQ,MAAM,CAAgB;QACrD,OAAO,WAAP,GACI,oBAACL,UAAU,QAAQ;YAAC,OAAOG;WACtBC,eAAe,GAAG,CAACE,CAAAA,KAAAA,WAAAA,GAAML,MAAAA,YAAkB,CAACK,GAAG,MAAM,IAAI;gBAAE,KAAKA,GAAG,IAAI;YAAC,KACxE,IAAI,CAAC,KAAK,CAAC,QAAQ;IAGhC;;QApBG,qBACa,KAAK,GAAU;YAC3B,IAAI,CAAC;QACT,QAEiB,OAAO,GAAG,CAACC,SACjB,IAAI,CAAC,QAAQ,CAAC,CAACC,QACX;oBAAE,IAAI;wBAAE,GAAGA,MAAM,EAAE;wBAAE,GAAGD,OAAOC,MAAM,EAAE,CAAC;oBAAC;gBAAE;;AAc9D"}
|
package/core/Plugin.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import type { GenericComponent, Decorator } from "@webiny/react-composition";
|
|
3
3
|
interface PluginProps {
|
|
4
|
-
providers?:
|
|
4
|
+
providers?: Decorator<GenericComponent>[];
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
}
|
|
7
|
-
export declare const Plugin: React.
|
|
7
|
+
export declare const Plugin: React.MemoExoticComponent<({ providers, children }: PluginProps) => React.JSX.Element>;
|
|
8
8
|
export {};
|
package/core/Plugin.js
CHANGED
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _Provider = require("./Provider");
|
|
10
|
-
var _Plugins = require("./Plugins");
|
|
11
|
-
var Plugin = /*#__PURE__*/_react.default.memo(function Plugin(_ref) {
|
|
12
|
-
var providers = _ref.providers,
|
|
13
|
-
children = _ref.children;
|
|
14
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (providers || []).map(function (provider, index) {
|
|
15
|
-
return /*#__PURE__*/_react.default.createElement(_Provider.Provider, {
|
|
16
|
-
key: index,
|
|
17
|
-
hoc: provider
|
|
18
|
-
});
|
|
19
|
-
}), children ? /*#__PURE__*/_react.default.createElement(_Plugins.Plugins, null, children) : null);
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { Provider } from "./Provider.js";
|
|
3
|
+
import { Plugins } from "./Plugins.js";
|
|
4
|
+
const Plugin_Plugin = /*#__PURE__*/ react.memo(function({ providers, children }) {
|
|
5
|
+
return /*#__PURE__*/ react.createElement(react.Fragment, null, (providers || []).map((provider, index)=>/*#__PURE__*/ react.createElement(Provider, {
|
|
6
|
+
key: index,
|
|
7
|
+
hoc: provider
|
|
8
|
+
})), children ? /*#__PURE__*/ react.createElement(Plugins, null, children) : null);
|
|
20
9
|
});
|
|
21
|
-
|
|
10
|
+
export { Plugin_Plugin as Plugin };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=Plugin.js.map
|
package/core/Plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"core/Plugin.js","sources":["../../src/core/Plugin.tsx"],"sourcesContent":["import React from \"react\";\nimport { Provider } from \"./Provider.js\";\nimport { Plugins } from \"./Plugins.js\";\nimport type { GenericComponent, Decorator } from \"@webiny/react-composition\";\n\ninterface PluginProps {\n providers?: Decorator<GenericComponent>[];\n children?: React.ReactNode;\n}\n\nexport const Plugin = React.memo(function Plugin({ providers, children }: PluginProps) {\n return (\n <>\n {(providers || []).map((provider, index) => (\n <Provider key={index} hoc={provider} />\n ))}\n {children ? <Plugins>{children}</Plugins> : null}\n </>\n );\n});\n"],"names":["Plugin","React","providers","children","provider","index","Provider","Plugins"],"mappings":";;;AAUO,MAAMA,gBAAS,WAAHA,GAAGC,MAAAA,IAAU,CAAC,SAAgB,EAAEC,SAAS,EAAEC,QAAQ,EAAe;IACjF,OAAO,WAAP,GACI,0CACMD,AAAAA,CAAAA,aAAa,EAAC,EAAG,GAAG,CAAC,CAACE,UAAUC,QAAAA,WAAAA,GAC9B,oBAACC,UAAQA;YAAC,KAAKD;YAAO,KAAKD;aAE9BD,WAAW,WAAXA,GAAW,oBAACI,SAAOA,MAAEJ,YAAsB;AAGxD"}
|
package/core/Plugins.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export declare const PluginsContext: React.Context<boolean>;
|
|
3
3
|
interface PluginsProviderComponentProps {
|
|
4
|
-
children: JSX.Element[];
|
|
4
|
+
children: React.JSX.Element[];
|
|
5
5
|
}
|
|
6
|
-
export declare const PluginsProvider: React.
|
|
6
|
+
export declare const PluginsProvider: React.MemoExoticComponent<({ children }: PluginsProviderComponentProps) => React.JSX.Element>;
|
|
7
7
|
/**
|
|
8
8
|
* @param children
|
|
9
9
|
* @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
interface PluginsComponentsProps {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare const Plugins: React.MemoExoticComponent<({ children }: PluginsComponentsProps) => React.JSX.Element | null>;
|
|
12
15
|
export {};
|
package/core/Plugins.js
CHANGED
|
@@ -1,45 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.PluginsProvider = exports.PluginsContext = exports.Plugins = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _App = require("../App");
|
|
10
|
-
var PluginsContext = /*#__PURE__*/(0, _react.createContext)(false);
|
|
11
|
-
exports.PluginsContext = PluginsContext;
|
|
1
|
+
import react, { Children, Fragment, createContext, memo, useContext, useEffect } from "react";
|
|
2
|
+
import { useApp } from "../App.js";
|
|
3
|
+
const PluginsContext = /*#__PURE__*/ createContext(false);
|
|
12
4
|
PluginsContext.displayName = "PluginsContext";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
const PluginsProviderComponent = ({ children })=>/*#__PURE__*/ react.createElement(PluginsContext.Provider, {
|
|
6
|
+
value: true
|
|
7
|
+
}, children);
|
|
8
|
+
const PluginsProvider = /*#__PURE__*/ memo(PluginsProviderComponent);
|
|
9
|
+
const Plugins = /*#__PURE__*/ react.memo(({ children })=>{
|
|
10
|
+
const { addPlugin } = useApp();
|
|
11
|
+
const hasParentPlugin = useContext(PluginsContext);
|
|
12
|
+
useEffect(()=>{
|
|
13
|
+
if (hasParentPlugin) return;
|
|
14
|
+
Children.forEach(children, (child)=>addPlugin(child));
|
|
15
|
+
}, []);
|
|
16
|
+
return hasParentPlugin ? /*#__PURE__*/ react.createElement(Fragment, null, children) : null;
|
|
17
|
+
});
|
|
18
|
+
Plugins.displayName = "Plugins";
|
|
19
|
+
export { Plugins, PluginsContext, PluginsProvider };
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
* @param children
|
|
27
|
-
* @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.
|
|
28
|
-
*/
|
|
29
|
-
exports.PluginsProvider = PluginsProvider;
|
|
30
|
-
var Plugins = function Plugins(_ref2) {
|
|
31
|
-
var children = _ref2.children;
|
|
32
|
-
var _useApp = (0, _App.useApp)(),
|
|
33
|
-
addPlugin = _useApp.addPlugin;
|
|
34
|
-
var hasParentPlugin = (0, _react.useContext)(PluginsContext);
|
|
35
|
-
(0, _react.useEffect)(function () {
|
|
36
|
-
if (hasParentPlugin) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
_react.Children.forEach(children, function (child) {
|
|
40
|
-
return addPlugin(child);
|
|
41
|
-
});
|
|
42
|
-
}, []);
|
|
43
|
-
return hasParentPlugin ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, children) : null;
|
|
44
|
-
};
|
|
45
|
-
exports.Plugins = Plugins;
|
|
21
|
+
//# sourceMappingURL=Plugins.js.map
|
package/core/Plugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"core/Plugins.js","sources":["../../src/core/Plugins.tsx"],"sourcesContent":["import React, { Children, createContext, Fragment, memo, useContext, useEffect } from \"react\";\nimport { useApp } from \"~/App.js\";\n\nexport const PluginsContext = createContext<boolean>(false);\nPluginsContext.displayName = \"PluginsContext\";\n\ninterface PluginsProviderComponentProps {\n children: React.JSX.Element[];\n}\nconst PluginsProviderComponent = ({ children }: PluginsProviderComponentProps) => {\n /**\n * This context only serves as a safeguard. We need to warn users when they mount a plugin without using\n * the <Plugins> component. In that case, the context will not be available, and we can log warnings.\n */\n return <PluginsContext.Provider value={true}>{children}</PluginsContext.Provider>;\n};\n\nexport const PluginsProvider = memo(PluginsProviderComponent);\n\n/**\n * @param children\n * @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.\n */\ninterface PluginsComponentsProps {\n children: React.ReactNode;\n}\nexport const Plugins = React.memo(({ children }: PluginsComponentsProps) => {\n const { addPlugin } = useApp();\n const hasParentPlugin = useContext(PluginsContext);\n\n useEffect(() => {\n if (hasParentPlugin) {\n return;\n }\n\n Children.forEach(children, child => addPlugin(child));\n }, []);\n\n return hasParentPlugin ? <Fragment>{children}</Fragment> : null;\n});\n\nPlugins.displayName = \"Plugins\";\n"],"names":["PluginsContext","createContext","PluginsProviderComponent","children","PluginsProvider","memo","Plugins","React","addPlugin","useApp","hasParentPlugin","useContext","useEffect","Children","child","Fragment"],"mappings":";;AAGO,MAAMA,iBAAiB,WAAHA,GAAGC,cAAuB;AACrDD,eAAe,WAAW,GAAG;AAK7B,MAAME,2BAA2B,CAAC,EAAEC,QAAQ,EAAiC,GAKlE,WAAP,GAAO,oBAACH,eAAe,QAAQ;QAAC,OAAO;OAAOG;AAG3C,MAAMC,kBAAkB,WAAHA,GAAGC,KAAKH;AAS7B,MAAMI,UAAU,WAAHA,GAAGC,MAAAA,IAAU,CAAC,CAAC,EAAEJ,QAAQ,EAA0B;IACnE,MAAM,EAAEK,SAAS,EAAE,GAAGC;IACtB,MAAMC,kBAAkBC,WAAWX;IAEnCY,UAAU;QACN,IAAIF,iBACA;QAGJG,SAAS,OAAO,CAACV,UAAUW,CAAAA,QAASN,UAAUM;IAClD,GAAG,EAAE;IAEL,OAAOJ,kBAAkB,WAAlBA,GAAkB,oBAACK,UAAQA,MAAEZ,YAAuB;AAC/D;AAEAG,QAAQ,WAAW,GAAG"}
|
package/core/Provider.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { HigherOrderComponent } from "../index";
|
|
1
|
+
import type { GenericComponent, Decorator } from "../index.js";
|
|
3
2
|
export interface ProviderProps {
|
|
4
|
-
hoc:
|
|
3
|
+
hoc: Decorator<GenericComponent>;
|
|
5
4
|
}
|
|
6
5
|
/**
|
|
7
6
|
* Register a new React context provider.
|
|
8
7
|
*/
|
|
9
|
-
export declare const Provider:
|
|
8
|
+
export declare const Provider: ({ hoc }: ProviderProps) => null;
|
package/core/Provider.js
CHANGED
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _ = require("./..");
|
|
9
|
-
/**
|
|
10
|
-
* Register a new React context provider.
|
|
11
|
-
*/
|
|
12
|
-
var Provider = function Provider(_ref) {
|
|
13
|
-
var hoc = _ref.hoc;
|
|
14
|
-
var _useApp = (0, _.useApp)(),
|
|
15
|
-
addProvider = _useApp.addProvider;
|
|
16
|
-
(0, _react.useEffect)(function () {
|
|
17
|
-
return addProvider(hoc);
|
|
18
|
-
}, []);
|
|
19
|
-
return null;
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { useApp } from "../index.js";
|
|
3
|
+
const Provider = ({ hoc })=>{
|
|
4
|
+
const { addProvider } = useApp();
|
|
5
|
+
useEffect(()=>addProvider(hoc), []);
|
|
6
|
+
return null;
|
|
20
7
|
};
|
|
21
|
-
|
|
8
|
+
export { Provider };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=Provider.js.map
|
package/core/Provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"core/Provider.js","sources":["../../src/core/Provider.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport type { GenericComponent, Decorator } from \"~/index.js\";\nimport { useApp } from \"~/index.js\";\n\nexport interface ProviderProps {\n hoc: Decorator<GenericComponent>;\n}\n\n/**\n * Register a new React context provider.\n */\nexport const Provider = ({ hoc }: ProviderProps) => {\n const { addProvider } = useApp();\n\n useEffect(() => {\n return addProvider(hoc);\n }, []);\n\n return null;\n};\n"],"names":["Provider","hoc","addProvider","useApp","useEffect"],"mappings":";;AAWO,MAAMA,WAAW,CAAC,EAAEC,GAAG,EAAiB;IAC3C,MAAM,EAAEC,WAAW,EAAE,GAAGC;IAExBC,UAAU,IACCF,YAAYD,MACpB,EAAE;IAEL,OAAO;AACX"}
|
package/core/createProvider.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { Decorator, GenericComponent } from "@webiny/react-composition";
|
|
3
|
+
export interface ChildrenProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
|
-
* Creates a Higher Order Component which
|
|
7
|
+
* Creates a Higher Order Component which wraps the entire app content.
|
|
4
8
|
* This is mostly useful for adding React Context providers.
|
|
5
9
|
*/
|
|
6
|
-
export declare function createProvider(
|
|
10
|
+
export declare function createProvider(decorator: Decorator<GenericComponent<ChildrenProps>>): Decorator<GenericComponent<ChildrenProps>>;
|
package/core/createProvider.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
function createProvider(decorator) {
|
|
2
|
+
return decorator;
|
|
3
|
+
}
|
|
4
|
+
export { createProvider };
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createProvider = createProvider;
|
|
7
|
-
/**
|
|
8
|
-
* Creates a Higher Order Component which is meant to wrap the entire app content.
|
|
9
|
-
* This is mostly useful for adding React Context providers.
|
|
10
|
-
*/
|
|
11
|
-
function createProvider(hoc) {
|
|
12
|
-
return hoc;
|
|
13
|
-
}
|
|
6
|
+
//# sourceMappingURL=createProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"core/createProvider.js","sources":["../../src/core/createProvider.tsx"],"sourcesContent":["import type React from \"react\";\nimport type { Decorator, GenericComponent } from \"@webiny/react-composition\";\n\nexport interface ChildrenProps {\n children: React.ReactNode;\n}\n\n/**\n * Creates a Higher Order Component which wraps the entire app content.\n * This is mostly useful for adding React Context providers.\n */\nexport function createProvider(\n decorator: Decorator<GenericComponent<ChildrenProps>>\n): Decorator<GenericComponent<ChildrenProps>> {\n return decorator;\n}\n"],"names":["createProvider","decorator"],"mappings":"AAWO,SAASA,eACZC,SAAqD;IAErD,OAAOA;AACX"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import type { GenericComponent, Decorator } from "@webiny/react-composition";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a component, which, when mounted, will register an app provider.
|
|
5
5
|
* This is particularly useful for wrapping the entire app with custom React Context providers.
|
|
6
6
|
* For more information, visit https://www.webiny.com/docs/admin-area/basics/framework.
|
|
7
7
|
*/
|
|
8
|
-
export declare function createProviderPlugin(
|
|
8
|
+
export declare function createProviderPlugin(decorator: Decorator<GenericComponent>): () => React.JSX.Element;
|