@webiny/app 0.0.0-unstable.78f581c1d2 → 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 +25 -0
- package/App.js +82 -0
- package/App.js.map +1 -0
- 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 +16 -77
- 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 +15 -41
- package/components/Image.js.map +1 -1
- package/components/index.d.ts +1 -2
- package/components/index.js +1 -21
- 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 +20 -29
- package/config.js.map +1 -1
- package/contexts/Ui/index.d.ts +4 -8
- package/contexts/Ui/index.js +27 -89
- package/contexts/Ui/index.js.map +1 -1
- package/core/Plugin.d.ts +8 -0
- package/core/Plugin.js +12 -0
- package/core/Plugin.js.map +1 -0
- package/core/Plugins.d.ts +15 -0
- package/core/Plugins.js +21 -0
- package/core/Plugins.js.map +1 -0
- package/core/Provider.d.ts +8 -0
- package/core/Provider.js +10 -0
- package/core/Provider.js.map +1 -0
- package/core/createProvider.d.ts +10 -0
- package/core/createProvider.js +6 -0
- package/core/createProvider.js.map +1 -0
- package/core/createProviderPlugin.d.ts +8 -0
- package/core/createProviderPlugin.js +12 -0
- package/core/createProviderPlugin.js.map +1 -0
- 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 -13
- package/hooks/useAutocomplete/useAutocomplete.d.ts +1 -1
- package/hooks/useAutocomplete/useAutocomplete.js +15 -36
- package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
- package/hooks/useDataList/functions/getData.js +4 -15
- package/hooks/useDataList/functions/getData.js.map +1 -1
- package/hooks/useDataList/functions/getError.js +4 -15
- package/hooks/useDataList/functions/getError.js.map +1 -1
- package/hooks/useDataList/functions/getMeta.js +4 -15
- 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 -31
- package/hooks/useDataList/functions/searchDataByKey.js +10 -26
- package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
- package/hooks/useDataList/index.d.ts +1 -1
- package/hooks/useDataList/index.js +1 -13
- package/hooks/useDataList/useDataList.d.ts +2 -3
- package/hooks/useDataList/useDataList.js +139 -205
- package/hooks/useDataList/useDataList.js.map +1 -1
- package/hooks/useDataList/utils/index.d.ts +1 -2
- package/hooks/useDataList/utils/index.js +1 -23
- package/hooks/useDataList/utils/prepareLoadListParams.d.ts +1 -2
- package/hooks/useDataList/utils/prepareLoadListParams.js +26 -45
- package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
- package/hooks/useHandler.js +14 -19
- package/hooks/useHandler.js.map +1 -1
- package/hooks/useHandlers.d.ts +3 -3
- package/hooks/useHandlers.js +19 -28
- 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 -15
- package/hooks/useUi.js.map +1 -1
- package/i18n/i18n.js +11 -21
- package/i18n/i18n.js.map +1 -1
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +1 -15
- package/index.d.ts +25 -4
- package/index.js +23 -37
- package/package.json +38 -38
- package/plugins/AddQuerySelectionPlugin.d.ts +10 -3
- package/plugins/AddQuerySelectionPlugin.js +43 -128
- package/plugins/AddQuerySelectionPlugin.js.map +1 -1
- package/plugins/ApolloCacheObjectIdPlugin.js +15 -51
- package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
- package/plugins/ApolloDynamicLink.d.ts +3 -2
- package/plugins/ApolloDynamicLink.js +24 -78
- package/plugins/ApolloDynamicLink.js.map +1 -1
- package/plugins/ApolloLinkPlugin.d.ts +1 -1
- package/plugins/ApolloLinkPlugin.js +21 -61
- package/plugins/ApolloLinkPlugin.js.map +1 -1
- package/plugins/ConsoleLinkPlugin.d.ts +1 -1
- package/plugins/ConsoleLinkPlugin.js +20 -59
- package/plugins/ConsoleLinkPlugin.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +8 -13
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +47 -95
- 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 +8 -5
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +68 -20
- 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 +13 -36
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin.d.ts +4 -1
- package/plugins/NetworkErrorLinkPlugin.js +51 -63
- package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
- package/plugins/OmitTypenameLinkPlugin.d.ts +1 -1
- package/plugins/OmitTypenameLinkPlugin.js +12 -51
- package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
- package/plugins/TenantHeaderLinkPlugin.d.ts +3 -8
- package/plugins/TenantHeaderLinkPlugin.js +25 -82
- 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 -175
- package/plugins/image.js.map +1 -1
- package/plugins/index.d.ts +5 -5
- package/plugins/index.js +38 -106
- 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 +30 -30
- package/types.js +0 -13
- 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 -0
- package/utils/index.js +2 -0
- 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 -49
- package/components/Routes.js.map +0 -1
- package/components/View.d.ts +0 -8
- package/components/View.js +0 -41
- package/components/View.js.map +0 -1
- package/components/index.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 -31
- 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 -15
- package/plugins/LocaleHeaderLinkPlugin.js +0 -77
- package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
- package/plugins/RoutePlugin.d.ts +0 -12
- package/plugins/RoutePlugin.js +0 -53
- package/plugins/RoutePlugin.js.map +0 -1
- package/plugins/ViewPlugin.d.ts +0 -14
- package/plugins/ViewPlugin.js +0 -58
- package/plugins/ViewPlugin.js.map +0 -1
- package/types.js.map +0 -1
package/config.js
CHANGED
|
@@ -1,33 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.config = void 0;
|
|
7
|
-
|
|
8
|
-
var deepFreeze = function deepFreeze(obj) {
|
|
9
|
-
Object.keys(obj).forEach(function (prop) {
|
|
10
|
-
if (typeof obj[prop] === "object" && !Object.isFrozen(obj[prop])) {
|
|
11
|
-
deepFreeze(obj[prop]);
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
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);
|
|
15
6
|
};
|
|
16
|
-
|
|
17
7
|
function createConfig() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
+
};
|
|
30
20
|
}
|
|
21
|
+
const config_config = createConfig();
|
|
22
|
+
export { config_config as config };
|
|
31
23
|
|
|
32
|
-
|
|
33
|
-
exports.config = config;
|
|
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,10 +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
|
-
export interface UiConsumerProps {
|
|
25
|
-
children: React.ReactElement;
|
|
26
|
-
}
|
|
27
|
-
export declare const UiConsumer: React.FC<UiConsumerProps>;
|
|
28
24
|
export {};
|
package/contexts/Ui/index.js
CHANGED
|
@@ -1,92 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
21
|
-
|
|
22
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
|
-
var _react = _interopRequireDefault(require("react"));
|
|
25
|
-
|
|
26
|
-
var _plugins = require("@webiny/plugins");
|
|
27
|
-
|
|
28
|
-
var UiContext = /*#__PURE__*/_react.default.createContext({});
|
|
29
|
-
|
|
30
|
-
exports.UiContext = UiContext;
|
|
31
|
-
|
|
32
|
-
var UiProvider = /*#__PURE__*/function (_React$Component) {
|
|
33
|
-
(0, _inherits2.default)(UiProvider, _React$Component);
|
|
34
|
-
|
|
35
|
-
var _super = (0, _createSuper2.default)(UiProvider);
|
|
36
|
-
|
|
37
|
-
function UiProvider() {
|
|
38
|
-
var _this;
|
|
39
|
-
|
|
40
|
-
(0, _classCallCheck2.default)(this, UiProvider);
|
|
41
|
-
|
|
42
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
43
|
-
args[_key] = arguments[_key];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
47
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
48
|
-
ui: {}
|
|
49
|
-
});
|
|
50
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setData", function (setter) {
|
|
51
|
-
return _this.setState(function (state) {
|
|
52
|
-
return {
|
|
53
|
-
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
|
|
54
9
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
key: "render",
|
|
62
|
-
value: function render() {
|
|
63
|
-
var value = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.state.ui), {}, {
|
|
64
|
-
setState: this.setData
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
var uiStatePlugins = _plugins.plugins.byType("ui-state");
|
|
68
|
-
|
|
69
|
-
return /*#__PURE__*/_react.default.createElement(UiContext.Provider, {
|
|
70
|
-
value: value
|
|
71
|
-
}, uiStatePlugins.map(function (pl) {
|
|
72
|
-
return /*#__PURE__*/_react.default.cloneElement(pl.render(), {
|
|
73
|
-
key: pl.name
|
|
74
|
-
});
|
|
75
|
-
}), 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);
|
|
76
16
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
});
|
|
90
|
-
};
|
|
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 };
|
|
91
29
|
|
|
92
|
-
|
|
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
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { GenericComponent, Decorator } from "@webiny/react-composition";
|
|
3
|
+
interface PluginProps {
|
|
4
|
+
providers?: Decorator<GenericComponent>[];
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const Plugin: React.MemoExoticComponent<({ providers, children }: PluginProps) => React.JSX.Element>;
|
|
8
|
+
export {};
|
package/core/Plugin.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
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);
|
|
9
|
+
});
|
|
10
|
+
export { Plugin_Plugin as Plugin };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=Plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const PluginsContext: React.Context<boolean>;
|
|
3
|
+
interface PluginsProviderComponentProps {
|
|
4
|
+
children: React.JSX.Element[];
|
|
5
|
+
}
|
|
6
|
+
export declare const PluginsProvider: React.MemoExoticComponent<({ children }: PluginsProviderComponentProps) => React.JSX.Element>;
|
|
7
|
+
/**
|
|
8
|
+
* @param children
|
|
9
|
+
* @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.
|
|
10
|
+
*/
|
|
11
|
+
interface PluginsComponentsProps {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare const Plugins: React.MemoExoticComponent<({ children }: PluginsComponentsProps) => React.JSX.Element | null>;
|
|
15
|
+
export {};
|
package/core/Plugins.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import react, { Children, Fragment, createContext, memo, useContext, useEffect } from "react";
|
|
2
|
+
import { useApp } from "../App.js";
|
|
3
|
+
const PluginsContext = /*#__PURE__*/ createContext(false);
|
|
4
|
+
PluginsContext.displayName = "PluginsContext";
|
|
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 };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=Plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
7
|
+
};
|
|
8
|
+
export { Provider };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=Provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { Decorator, GenericComponent } from "@webiny/react-composition";
|
|
3
|
+
export interface ChildrenProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Creates a Higher Order Component which wraps the entire app content.
|
|
8
|
+
* This is mostly useful for adding React Context providers.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createProvider(decorator: Decorator<GenericComponent<ChildrenProps>>): Decorator<GenericComponent<ChildrenProps>>;
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { GenericComponent, Decorator } from "@webiny/react-composition";
|
|
3
|
+
/**
|
|
4
|
+
* Creates a component, which, when mounted, will register an app provider.
|
|
5
|
+
* This is particularly useful for wrapping the entire app with custom React Context providers.
|
|
6
|
+
* For more information, visit https://www.webiny.com/docs/admin-area/basics/framework.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createProviderPlugin(decorator: Decorator<GenericComponent>): () => React.JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { Provider } from "./Provider.js";
|
|
3
|
+
function createProviderPlugin(decorator) {
|
|
4
|
+
return function() {
|
|
5
|
+
return /*#__PURE__*/ react.createElement(Provider, {
|
|
6
|
+
hoc: decorator
|
|
7
|
+
});
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export { createProviderPlugin };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=createProviderPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core/createProviderPlugin.js","sources":["../../src/core/createProviderPlugin.tsx"],"sourcesContent":["import React from \"react\";\nimport type { GenericComponent, Decorator } from \"@webiny/react-composition\";\nimport { Provider } from \"./Provider.js\";\n\n/**\n * Creates a component, which, when mounted, will register an app provider.\n * This is particularly useful for wrapping the entire app with custom React Context providers.\n * For more information, visit https://www.webiny.com/docs/admin-area/basics/framework.\n */\nexport function createProviderPlugin(decorator: Decorator<GenericComponent>) {\n return function ProviderPlugin() {\n return <Provider hoc={decorator} />;\n };\n}\n"],"names":["createProviderPlugin","decorator","Provider"],"mappings":";;AASO,SAASA,qBAAqBC,SAAsC;IACvE,OAAO;QACH,OAAO,WAAP,GAAO,oBAACC,UAAQA;YAAC,KAAKD;;IAC1B;AACJ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseEvent } from "../features/eventPublisher/index.js";
|
|
2
|
+
export interface AuthenticationErrorPayload {
|
|
3
|
+
message: string;
|
|
4
|
+
code: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class AuthenticationErrorEvent extends BaseEvent<AuthenticationErrorPayload> {
|
|
7
|
+
eventType: "Authentication/Error";
|
|
8
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<import("~/features/eventPublisher/index.js").IEventHandler<AuthenticationErrorEvent>>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AuthenticationErrorEventHandler } from "./abstractions.js";
|
|
2
|
+
import { BaseEvent } from "../features/eventPublisher/index.js";
|
|
3
|
+
class AuthenticationErrorEvent extends BaseEvent {
|
|
4
|
+
getHandlerAbstraction() {
|
|
5
|
+
return AuthenticationErrorEventHandler;
|
|
6
|
+
}
|
|
7
|
+
constructor(...args){
|
|
8
|
+
super(...args), this.eventType = "Authentication/Error";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export { AuthenticationErrorEvent };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=AuthenticationErrorEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors/AuthenticationErrorEvent.js","sources":["../../src/errors/AuthenticationErrorEvent.ts"],"sourcesContent":["import { AuthenticationErrorEventHandler } from \"./abstractions.js\";\nimport { BaseEvent } from \"~/features/eventPublisher/index.js\";\n\nexport interface AuthenticationErrorPayload {\n message: string;\n code: string;\n}\n\nexport class AuthenticationErrorEvent extends BaseEvent<AuthenticationErrorPayload> {\n eventType = \"Authentication/Error\" as const;\n\n getHandlerAbstraction() {\n return AuthenticationErrorEventHandler;\n }\n}\n"],"names":["AuthenticationErrorEvent","BaseEvent","AuthenticationErrorEventHandler"],"mappings":";;AAQO,MAAMA,iCAAiCC;IAG1C,wBAAwB;QACpB,OAAOC;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseEvent } from "../features/eventPublisher/index.js";
|
|
2
|
+
export interface NetworkErrorPayload {
|
|
3
|
+
message: string;
|
|
4
|
+
code?: string;
|
|
5
|
+
operationName?: string;
|
|
6
|
+
query?: string;
|
|
7
|
+
variables?: Record<string, any>;
|
|
8
|
+
errorType: "network" | "timeout" | "fetch" | "unknown";
|
|
9
|
+
statusCode?: number;
|
|
10
|
+
result?: any;
|
|
11
|
+
}
|
|
12
|
+
export declare class NetworkErrorEvent extends BaseEvent<NetworkErrorPayload> {
|
|
13
|
+
eventType: "network.error";
|
|
14
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<import("~/features/eventPublisher/index.js").IEventHandler<NetworkErrorEvent>>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NetworkErrorEventHandler } from "./abstractions.js";
|
|
2
|
+
import { BaseEvent } from "../features/eventPublisher/index.js";
|
|
3
|
+
class NetworkErrorEvent extends BaseEvent {
|
|
4
|
+
getHandlerAbstraction() {
|
|
5
|
+
return NetworkErrorEventHandler;
|
|
6
|
+
}
|
|
7
|
+
constructor(...args){
|
|
8
|
+
super(...args), this.eventType = "network.error";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export { NetworkErrorEvent };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=NetworkErrorEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors/NetworkErrorEvent.js","sources":["../../src/errors/NetworkErrorEvent.ts"],"sourcesContent":["import { NetworkErrorEventHandler } from \"./abstractions.js\";\nimport { BaseEvent } from \"~/features/eventPublisher/index.js\";\n\nexport interface NetworkErrorPayload {\n message: string;\n code?: string;\n operationName?: string;\n query?: string;\n variables?: Record<string, any>;\n errorType: \"network\" | \"timeout\" | \"fetch\" | \"unknown\";\n statusCode?: number;\n result?: any;\n}\n\nexport class NetworkErrorEvent extends BaseEvent<NetworkErrorPayload> {\n eventType = \"network.error\" as const;\n\n getHandlerAbstraction() {\n return NetworkErrorEventHandler;\n }\n}\n"],"names":["NetworkErrorEvent","BaseEvent","NetworkErrorEventHandler"],"mappings":";;AAcO,MAAMA,0BAA0BC;IAGnC,wBAAwB;QACpB,OAAOC;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NetworkErrorEvent } from "./NetworkErrorEvent.js";
|
|
2
|
+
import type { AuthenticationErrorEvent } from "./AuthenticationErrorEvent.js";
|
|
3
|
+
import type { IEventHandler } from "../features/eventPublisher/index.js";
|
|
4
|
+
export declare const NetworkErrorEventHandler: import("@webiny/di").Abstraction<IEventHandler<NetworkErrorEvent>>;
|
|
5
|
+
export declare namespace NetworkErrorEventHandler {
|
|
6
|
+
type Interface = IEventHandler<NetworkErrorEvent>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuthenticationErrorEventHandler: import("@webiny/di").Abstraction<IEventHandler<AuthenticationErrorEvent>>;
|
|
9
|
+
export declare namespace AuthenticationErrorEventHandler {
|
|
10
|
+
type Interface = IEventHandler<AuthenticationErrorEvent>;
|
|
11
|
+
type Event = AuthenticationErrorEvent;
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/admin";
|
|
2
|
+
const NetworkErrorEventHandler = createAbstraction("NetworkErrorEventHandler");
|
|
3
|
+
const AuthenticationErrorEventHandler = createAbstraction("AuthenticationErrorEventHandler");
|
|
4
|
+
export { AuthenticationErrorEventHandler, NetworkErrorEventHandler };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors/abstractions.js","sources":["../../src/errors/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { NetworkErrorEvent } from \"./NetworkErrorEvent.js\";\nimport type { AuthenticationErrorEvent } from \"./AuthenticationErrorEvent.js\";\nimport type { IEventHandler } from \"~/features/eventPublisher/index.js\";\n\nexport const NetworkErrorEventHandler = createAbstraction<IEventHandler<NetworkErrorEvent>>(\n \"NetworkErrorEventHandler\"\n);\n\nexport namespace NetworkErrorEventHandler {\n export type Interface = IEventHandler<NetworkErrorEvent>;\n}\n\nexport const AuthenticationErrorEventHandler = createAbstraction<\n IEventHandler<AuthenticationErrorEvent>\n>(\"AuthenticationErrorEventHandler\");\n\nexport namespace AuthenticationErrorEventHandler {\n export type Interface = IEventHandler<AuthenticationErrorEvent>;\n export type Event = AuthenticationErrorEvent;\n}\n"],"names":["NetworkErrorEventHandler","createAbstraction","AuthenticationErrorEventHandler"],"mappings":";AAKO,MAAMA,2BAA2BC,kBACpC;AAOG,MAAMC,kCAAkCD,kBAE7C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { NetworkErrorEvent } from "./NetworkErrorEvent.js";
|
|
2
|
+
export type { NetworkErrorPayload } from "./NetworkErrorEvent.js";
|
|
3
|
+
export { NetworkErrorEventHandler } from "./abstractions.js";
|
|
4
|
+
export { AuthenticationErrorEvent } from "./AuthenticationErrorEvent.js";
|
|
5
|
+
export type { AuthenticationErrorPayload } from "./AuthenticationErrorEvent.js";
|
|
6
|
+
export { AuthenticationErrorEventHandler } from "./abstractions.js";
|
package/errors/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GraphQLClient } from "../../features/graphqlClient/abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GraphQLClient } from "../../features/graphqlClient/abstractions.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Route } from "../../features/router/Route.js";
|
|
2
|
+
export { RouteLinkComponent } from "../../presentation/router/components/RouteLink.js";
|
|
3
|
+
export { LinkComponent } from "../../presentation/router/components/SimpleLink.js";
|
|
4
|
+
export { RedirectComponent } from "../../presentation/router/components/Redirect.js";
|
|
5
|
+
export { useRoute, useRouter } from "../../presentation/router/index.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Route } from "../../features/router/Route.js";
|
|
2
|
+
export { RouteLinkComponent } from "../../presentation/router/components/RouteLink.js";
|
|
3
|
+
export { LinkComponent } from "../../presentation/router/components/SimpleLink.js";
|
|
4
|
+
export { RedirectComponent } from "../../presentation/router/components/Redirect.js";
|
|
5
|
+
export { useRoute, useRouter } from "../../presentation/router/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AuthenticationErrorEventHandler } from "../../errors/abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AuthenticationErrorEventHandler } from "../../errors/abstractions.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { MainGraphQLClient } from "../features/mainGraphQLClient/index.js";
|
|
2
|
+
export { useFeature } from "../shared/di/useFeature.js";
|
|
3
|
+
export { NetworkErrorEventHandler } from "../errors/index.js";
|
|
4
|
+
export { createProviderPlugin } from "../core/createProviderPlugin.js";
|
|
5
|
+
export { createProvider } from "../core/createProvider.js";
|
|
6
|
+
export { Provider } from "../core/Provider.js";
|
|
7
|
+
export { Plugin } from "../core/Plugin.js";
|
package/exports/admin.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { MainGraphQLClient } from "../features/mainGraphQLClient/index.js";
|
|
2
|
+
export { useFeature } from "../shared/di/useFeature.js";
|
|
3
|
+
export { NetworkErrorEventHandler } from "../errors/index.js";
|
|
4
|
+
export { createProviderPlugin } from "../core/createProviderPlugin.js";
|
|
5
|
+
export { createProvider } from "../core/createProvider.js";
|
|
6
|
+
export { Provider } from "../core/Provider.js";
|
|
7
|
+
export { Plugin } from "../core/Plugin.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EnvConfig as Abstraction } from "./abstractions.js";
|
|
2
|
+
export declare class DefaultEnvConfig implements Abstraction.Interface {
|
|
3
|
+
private readonly env;
|
|
4
|
+
constructor(env: Abstraction.Config);
|
|
5
|
+
get<K extends keyof Abstraction.Config>(key: K, defaultValue?: Abstraction.Config[K]): Abstraction.Config[K];
|
|
6
|
+
getAll(): Abstraction.Config;
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
class DefaultEnvConfig {
|
|
2
|
+
constructor(env){
|
|
3
|
+
this.env = env;
|
|
4
|
+
}
|
|
5
|
+
get(key, defaultValue) {
|
|
6
|
+
const rawValue = this.env[key];
|
|
7
|
+
if (null == rawValue && void 0 !== defaultValue) return defaultValue;
|
|
8
|
+
return rawValue;
|
|
9
|
+
}
|
|
10
|
+
getAll() {
|
|
11
|
+
return this.env;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export { DefaultEnvConfig };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=EnvConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/envConfig/EnvConfig.js","sources":["../../../src/features/envConfig/EnvConfig.ts"],"sourcesContent":["import { EnvConfig as Abstraction } from \"./abstractions.js\";\n\nexport class DefaultEnvConfig implements Abstraction.Interface {\n private readonly env: Abstraction.Config;\n\n constructor(env: Abstraction.Config) {\n this.env = env;\n }\n\n public get<K extends keyof Abstraction.Config>(\n key: K,\n defaultValue?: Abstraction.Config[K]\n ): Abstraction.Config[K] {\n const rawValue = this.env[key];\n\n if ((rawValue === undefined || rawValue === null) && defaultValue !== undefined) {\n return defaultValue;\n }\n\n return rawValue;\n }\n\n getAll(): Abstraction.Config {\n return this.env;\n }\n}\n"],"names":["DefaultEnvConfig","env","key","defaultValue","rawValue","undefined"],"mappings":"AAEO,MAAMA;IAGT,YAAYC,GAAuB,CAAE;QACjC,IAAI,CAAC,GAAG,GAAGA;IACf;IAEO,IACHC,GAAM,EACNC,YAAoC,EACf;QACrB,MAAMC,WAAW,IAAI,CAAC,GAAG,CAACF,IAAI;QAE9B,IAAKE,QAAAA,YAAgDD,AAAiBE,WAAjBF,cACjD,OAAOA;QAGX,OAAOC;IACX;IAEA,SAA6B;QACzB,OAAO,IAAI,CAAC,GAAG;IACnB;AACJ"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Abstraction } from "@webiny/di";
|
|
2
|
+
type Env = {
|
|
3
|
+
apiUrl: string;
|
|
4
|
+
debug: boolean;
|
|
5
|
+
deploymentId: string;
|
|
6
|
+
graphqlApiUrl: string;
|
|
7
|
+
telemetryEnabled: boolean;
|
|
8
|
+
telemetryUserId: string | undefined;
|
|
9
|
+
trashBinRetentionPeriodDays: number;
|
|
10
|
+
wcpProjectId: string | undefined;
|
|
11
|
+
websocketUrl: string;
|
|
12
|
+
graphqlClient?: {
|
|
13
|
+
retries: {
|
|
14
|
+
maxRetries: number;
|
|
15
|
+
delayInMillis: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export interface IEnvConfig {
|
|
20
|
+
get<K extends keyof Env>(key: K, defaultValue?: Env[K]): Env[K];
|
|
21
|
+
getAll(): Env;
|
|
22
|
+
}
|
|
23
|
+
export declare const EnvConfig: Abstraction<IEnvConfig>;
|
|
24
|
+
export declare namespace EnvConfig {
|
|
25
|
+
type Interface = IEnvConfig;
|
|
26
|
+
type Config = Env;
|
|
27
|
+
}
|
|
28
|
+
export {};
|