@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
|
@@ -1,63 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
21
|
-
|
|
22
|
-
var _nanoid = require("nanoid");
|
|
23
|
-
|
|
24
|
-
var _plugins = require("@webiny/plugins");
|
|
25
|
-
|
|
26
|
-
var ApolloLinkPlugin = /*#__PURE__*/function (_Plugin) {
|
|
27
|
-
(0, _inherits2.default)(ApolloLinkPlugin, _Plugin);
|
|
28
|
-
|
|
29
|
-
var _super = (0, _createSuper2.default)(ApolloLinkPlugin);
|
|
30
|
-
|
|
31
|
-
function ApolloLinkPlugin(factory) {
|
|
32
|
-
var _this;
|
|
33
|
-
|
|
34
|
-
(0, _classCallCheck2.default)(this, ApolloLinkPlugin);
|
|
35
|
-
_this = _super.call(this);
|
|
36
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "cacheKey", void 0);
|
|
37
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "factory", void 0);
|
|
38
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "cache", void 0);
|
|
39
|
-
_this.factory = factory;
|
|
40
|
-
_this.cacheKey = (0, _nanoid.nanoid)();
|
|
41
|
-
return _this;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
(0, _createClass2.default)(ApolloLinkPlugin, [{
|
|
45
|
-
key: "createLink",
|
|
46
|
-
value: function createLink() {
|
|
47
|
-
if (this.cache) {
|
|
48
|
-
return this.cache;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (typeof this.factory === "function") {
|
|
52
|
-
this.cache = this.factory();
|
|
53
|
-
return this.cache;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
throw Error("Missing ApolloLinkFactory in plugin \"".concat(this.name, "\"! Either pass a factory to ApolloLinkPlugin constructor or extend the class and override the \"createLink\" method."));
|
|
1
|
+
import { nanoid } from "nanoid";
|
|
2
|
+
import { Plugin } from "@webiny/plugins";
|
|
3
|
+
class ApolloLinkPlugin extends Plugin {
|
|
4
|
+
static{
|
|
5
|
+
this.type = "apollo-link";
|
|
6
|
+
}
|
|
7
|
+
constructor(factory){
|
|
8
|
+
super();
|
|
9
|
+
this.factory = factory;
|
|
10
|
+
this.cacheKey = nanoid();
|
|
11
|
+
}
|
|
12
|
+
createLink() {
|
|
13
|
+
if (this.cache) return this.cache;
|
|
14
|
+
if ("function" == typeof this.factory) {
|
|
15
|
+
this.cache = this.factory();
|
|
16
|
+
return this.cache;
|
|
17
|
+
}
|
|
18
|
+
throw Error(`Missing ApolloLinkFactory in plugin "${this.name}"! Either pass a factory to ApolloLinkPlugin constructor or extend the class and override the "createLink" method.`);
|
|
57
19
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}(_plugins.Plugin);
|
|
20
|
+
}
|
|
21
|
+
export { ApolloLinkPlugin };
|
|
61
22
|
|
|
62
|
-
|
|
63
|
-
(0, _defineProperty2.default)(ApolloLinkPlugin, "type", "apollo-link");
|
|
23
|
+
//# sourceMappingURL=ApolloLinkPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"plugins/ApolloLinkPlugin.js","sources":["../../src/plugins/ApolloLinkPlugin.ts"],"sourcesContent":["import type { ApolloLink } from \"apollo-link\";\nimport { nanoid } from \"nanoid\";\nimport { Plugin } from \"@webiny/plugins\";\n\nexport interface ApolloLinkFactory {\n (): ApolloLink;\n}\n\nexport class ApolloLinkPlugin extends Plugin {\n public static override readonly type: string = \"apollo-link\";\n public readonly cacheKey;\n private readonly factory?: ApolloLinkFactory;\n private cache?: ApolloLink;\n\n constructor(factory?: ApolloLinkFactory) {\n super();\n this.factory = factory;\n this.cacheKey = nanoid();\n }\n\n public createLink(): ApolloLink {\n if (this.cache) {\n return this.cache;\n }\n\n if (typeof this.factory === \"function\") {\n this.cache = this.factory();\n\n return this.cache;\n }\n\n throw Error(\n `Missing ApolloLinkFactory in plugin \"${this.name}\"! Either pass a factory to ApolloLinkPlugin constructor or extend the class and override the \"createLink\" method.`\n );\n }\n}\n"],"names":["ApolloLinkPlugin","Plugin","factory","nanoid","Error"],"mappings":";;AAQO,MAAMA,yBAAyBC;;aACF,IAAI,GAAW;;IAK/C,YAAYC,OAA2B,CAAE;QACrC,KAAK;QACL,IAAI,CAAC,OAAO,GAAGA;QACf,IAAI,CAAC,QAAQ,GAAGC;IACpB;IAEO,aAAyB;QAC5B,IAAI,IAAI,CAAC,KAAK,EACV,OAAO,IAAI,CAAC,KAAK;QAGrB,IAAI,AAAwB,cAAxB,OAAO,IAAI,CAAC,OAAO,EAAiB;YACpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO;YAEzB,OAAO,IAAI,CAAC,KAAK;QACrB;QAEA,MAAMC,MACF,CAAC,qCAAqC,EAAE,IAAI,CAAC,IAAI,CAAC,kHAAkH,CAAC;IAE7K;AACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApolloLink } from "apollo-link";
|
|
2
|
-
import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
|
|
2
|
+
import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
|
|
3
3
|
/**
|
|
4
4
|
* This link checks for presence of `extensions.console` in the response and logs all items to browser console.
|
|
5
5
|
*/
|
|
@@ -1,63 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
|
-
|
|
20
|
-
var _apolloLink = require("apollo-link");
|
|
21
|
-
|
|
22
|
-
var _ApolloLinkPlugin2 = require("./ApolloLinkPlugin");
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* This link checks for presence of `extensions.console` in the response and logs all items to browser console.
|
|
26
|
-
*/
|
|
27
|
-
var ConsoleLinkPlugin = /*#__PURE__*/function (_ApolloLinkPlugin) {
|
|
28
|
-
(0, _inherits2.default)(ConsoleLinkPlugin, _ApolloLinkPlugin);
|
|
29
|
-
|
|
30
|
-
var _super = (0, _createSuper2.default)(ConsoleLinkPlugin);
|
|
31
|
-
|
|
32
|
-
function ConsoleLinkPlugin() {
|
|
33
|
-
(0, _classCallCheck2.default)(this, ConsoleLinkPlugin);
|
|
34
|
-
return _super.apply(this, arguments);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
(0, _createClass2.default)(ConsoleLinkPlugin, [{
|
|
38
|
-
key: "createLink",
|
|
39
|
-
value: function createLink() {
|
|
40
|
-
return new _apolloLink.ApolloLink(function (operation, forward) {
|
|
41
|
-
var firstDefinition = operation.query.definitions[0];
|
|
42
|
-
var isQuery = firstDefinition["operation"] === "query";
|
|
43
|
-
return forward(operation).map(function (data) {
|
|
44
|
-
if (data.extensions && Array.isArray(data.extensions.console) && data.extensions.console.length) {
|
|
45
|
-
var variables = isQuery ? JSON.stringify(operation.variables) : "{ see request details in the Network tab }";
|
|
46
|
-
console.groupCollapsed("Logs for graphQL ".concat(isQuery ? "query" : "mutation", ": %c").concat(operation.operationName || "anonymous operation", " %c").concat(variables, "%c"), "color: #fa5a28", "color: #6b6b6b", "color: black");
|
|
47
|
-
data.extensions.console.forEach(function (log) {
|
|
48
|
-
var _console;
|
|
49
|
-
|
|
50
|
-
(_console = console)[log.method].apply(_console, (0, _toConsumableArray2.default)(log.args));
|
|
1
|
+
import { ApolloLink } from "apollo-link";
|
|
2
|
+
import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
|
|
3
|
+
class ConsoleLinkPlugin extends ApolloLinkPlugin {
|
|
4
|
+
createLink() {
|
|
5
|
+
return new ApolloLink((operation, forward)=>{
|
|
6
|
+
const firstDefinition = operation.query.definitions[0];
|
|
7
|
+
const isQuery = "query" === firstDefinition["operation"];
|
|
8
|
+
return forward(operation).map((data)=>{
|
|
9
|
+
if (data.extensions && Array.isArray(data.extensions.console) && data.extensions.console.length) {
|
|
10
|
+
const variables = isQuery ? JSON.stringify(operation.variables) : "{ see request details in the Network tab }";
|
|
11
|
+
console.groupCollapsed(`Logs for graphQL ${isQuery ? "query" : "mutation"}: %c${operation.operationName || "anonymous operation"} %c${variables}%c`, "color: #fa5a28", "color: #6b6b6b", "color: black");
|
|
12
|
+
data.extensions.console.forEach((log)=>{
|
|
13
|
+
console[log.method](...log.args);
|
|
14
|
+
});
|
|
15
|
+
console.groupEnd();
|
|
16
|
+
}
|
|
17
|
+
return data;
|
|
51
18
|
});
|
|
52
|
-
console.groupEnd();
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return data;
|
|
56
19
|
});
|
|
57
|
-
});
|
|
58
20
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}(_ApolloLinkPlugin2.ApolloLinkPlugin);
|
|
21
|
+
}
|
|
22
|
+
export { ConsoleLinkPlugin };
|
|
62
23
|
|
|
63
|
-
|
|
24
|
+
//# sourceMappingURL=ConsoleLinkPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"plugins/ConsoleLinkPlugin.js","sources":["../../src/plugins/ConsoleLinkPlugin.ts"],"sourcesContent":["import type { FetchResult as BaseFetchResult } from \"apollo-link\";\nimport { ApolloLink } from \"apollo-link\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin.js\";\nimport type { OperationDefinitionNode } from \"graphql/language/ast.js\";\n\ninterface Log {\n args: any[];\n method: \"error\" | \"info\" | \"log\" | \"warn\";\n}\n\ninterface FetchResult extends BaseFetchResult {\n extensions?: {\n console?: Log[];\n };\n}\n\n/**\n * This link checks for presence of `extensions.console` in the response and logs all items to browser console.\n */\nexport class ConsoleLinkPlugin extends ApolloLinkPlugin {\n public override createLink() {\n return new ApolloLink((operation, forward) => {\n const firstDefinition = operation.query.definitions[0] as OperationDefinitionNode;\n const isQuery = firstDefinition[\"operation\"] === \"query\";\n\n return forward(operation).map((data: FetchResult) => {\n if (\n data.extensions &&\n Array.isArray(data.extensions.console) &&\n data.extensions.console.length\n ) {\n const variables = isQuery\n ? JSON.stringify(operation.variables)\n : \"{ see request details in the Network tab }\";\n console.groupCollapsed(\n `Logs for graphQL ${isQuery ? \"query\" : \"mutation\"}: %c${\n operation.operationName || \"anonymous operation\"\n } %c${variables}%c`,\n \"color: #fa5a28\",\n \"color: #6b6b6b\",\n \"color: black\"\n );\n data.extensions.console.forEach((log: Log) => {\n console[log.method](...log.args);\n });\n console.groupEnd();\n }\n\n return data;\n });\n });\n }\n}\n"],"names":["ConsoleLinkPlugin","ApolloLinkPlugin","ApolloLink","operation","forward","firstDefinition","isQuery","data","Array","variables","JSON","console","log"],"mappings":";;AAmBO,MAAMA,0BAA0BC;IACnB,aAAa;QACzB,OAAO,IAAIC,WAAW,CAACC,WAAWC;YAC9B,MAAMC,kBAAkBF,UAAU,KAAK,CAAC,WAAW,CAAC,EAAE;YACtD,MAAMG,UAAUD,AAAiC,YAAjCA,eAAe,CAAC,YAAY;YAE5C,OAAOD,QAAQD,WAAW,GAAG,CAAC,CAACI;gBAC3B,IACIA,KAAK,UAAU,IACfC,MAAM,OAAO,CAACD,KAAK,UAAU,CAAC,OAAO,KACrCA,KAAK,UAAU,CAAC,OAAO,CAAC,MAAM,EAChC;oBACE,MAAME,YAAYH,UACZI,KAAK,SAAS,CAACP,UAAU,SAAS,IAClC;oBACNQ,QAAQ,cAAc,CAClB,CAAC,iBAAiB,EAAEL,UAAU,UAAU,WAAW,IAAI,EACnDH,UAAU,aAAa,IAAI,sBAC9B,GAAG,EAAEM,UAAU,EAAE,CAAC,EACnB,kBACA,kBACA;oBAEJF,KAAK,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAACK;wBAC7BD,OAAO,CAACC,IAAI,MAAM,CAAC,IAAIA,IAAI,IAAI;oBACnC;oBACAD,QAAQ,QAAQ;gBACpB;gBAEA,OAAOJ;YACX;QACJ;IACJ;AACJ"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
declare const ErrorOverlay: React.FC<ErrorOverlayProps>;
|
|
14
|
-
export default ErrorOverlay;
|
|
2
|
+
type ErrorOverlayProps = Partial<{
|
|
3
|
+
title: React.ReactNode;
|
|
4
|
+
message: React.ReactNode;
|
|
5
|
+
description: React.ReactNode;
|
|
6
|
+
closeable?: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const ErrorOverlay: (props: ErrorOverlayProps) => React.JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -1,97 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
console.error({
|
|
47
|
-
networkError: networkError
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
if (!open) {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
var stackTrace = (0, _get.default)(networkError, "result.error.stack");
|
|
55
|
-
return /*#__PURE__*/_react.default.createElement(_StyledComponents.OverlayWrapper, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
56
|
-
className: "inner"
|
|
57
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
-
className: "header"
|
|
59
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
60
|
-
className: "header__title"
|
|
61
|
-
}, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
62
|
-
use: "headline4"
|
|
63
|
-
}, networkError.message)), /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
-
className: "header__action"
|
|
65
|
-
}, /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
|
|
66
|
-
icon: /*#__PURE__*/_react.default.createElement(_close_24px.ReactComponent, null),
|
|
67
|
-
onClick: function onClick() {
|
|
68
|
-
return setOpen(false);
|
|
69
|
-
}
|
|
70
|
-
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
-
className: "body"
|
|
72
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
73
|
-
className: "body__summary"
|
|
74
|
-
}, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
75
|
-
use: "subtitle1"
|
|
76
|
-
}, t(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["Error occurred while executing operation:"])))), /*#__PURE__*/_react.default.createElement(_StyledComponents.Pre, null, /*#__PURE__*/_react.default.createElement("code", null, query))), stackTrace && /*#__PURE__*/_react.default.createElement("div", {
|
|
77
|
-
className: "body__description"
|
|
78
|
-
}, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
79
|
-
use: "subtitle1"
|
|
80
|
-
}, t(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["Complete stack trace:"])))), /*#__PURE__*/_react.default.createElement(_StyledComponents.Pre, null, /*#__PURE__*/_react.default.createElement("code", null, stackTrace)))), /*#__PURE__*/_react.default.createElement("div", {
|
|
81
|
-
className: "footer"
|
|
82
|
-
}, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
83
|
-
use: "body2"
|
|
84
|
-
}, t(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n This screen is only visible if {message} environment variable is set.\n Read more about it in the {link}. "])))({
|
|
85
|
-
message: /*#__PURE__*/_react.default.createElement("span", {
|
|
86
|
-
className: "highlight"
|
|
87
|
-
}, "`REACT_APP_DEBUG=true`"),
|
|
88
|
-
link: /*#__PURE__*/_react.default.createElement("a", {
|
|
89
|
-
href: ENVIRONMENT_VARIABLES_ARTICLE_LINK,
|
|
90
|
-
target: "_blank",
|
|
91
|
-
rel: "noreferrer noopener"
|
|
92
|
-
}, "environment variables article")
|
|
93
|
-
}), /*#__PURE__*/_react.default.createElement("br", null), t(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["Open your browser's developer console to further inspect this error."])))))));
|
|
1
|
+
import react, { useState } from "react";
|
|
2
|
+
import { Typography } from "./Typography.js";
|
|
3
|
+
import { i18n } from "../../i18n/index.js";
|
|
4
|
+
import { OverlayWrapper } from "./StyledComponents.js";
|
|
5
|
+
import { ReactComponent } from "./assets/close_24px.js";
|
|
6
|
+
const t = i18n.ns("app/graphql/error-overlay");
|
|
7
|
+
const ENVIRONMENT_VARIABLES_ARTICLE_LINK = "https://www.webiny.com/docs/how-to-guides/environment-variables";
|
|
8
|
+
const ErrorOverlay = (props)=>{
|
|
9
|
+
const { title = "An error occurred", message, description, closeable } = props;
|
|
10
|
+
const [open, setOpen] = useState(true);
|
|
11
|
+
if (!open) return null;
|
|
12
|
+
return /*#__PURE__*/ react.createElement(OverlayWrapper, null, /*#__PURE__*/ react.createElement("div", {
|
|
13
|
+
className: "inner"
|
|
14
|
+
}, /*#__PURE__*/ react.createElement("div", {
|
|
15
|
+
className: "header"
|
|
16
|
+
}, /*#__PURE__*/ react.createElement("div", {
|
|
17
|
+
className: "header__title"
|
|
18
|
+
}, /*#__PURE__*/ react.createElement(Typography, {
|
|
19
|
+
use: "headline"
|
|
20
|
+
}, title)), false !== closeable && /*#__PURE__*/ react.createElement("div", {
|
|
21
|
+
className: "header__action"
|
|
22
|
+
}, /*#__PURE__*/ react.createElement("span", {
|
|
23
|
+
onClick: ()=>setOpen(false)
|
|
24
|
+
}, /*#__PURE__*/ react.createElement(ReactComponent, null)))), /*#__PURE__*/ react.createElement("div", {
|
|
25
|
+
className: "body"
|
|
26
|
+
}, /*#__PURE__*/ react.createElement("div", {
|
|
27
|
+
className: "body__summary"
|
|
28
|
+
}, message), description && /*#__PURE__*/ react.createElement("div", {
|
|
29
|
+
className: "body__description"
|
|
30
|
+
}, description)), /*#__PURE__*/ react.createElement("div", {
|
|
31
|
+
className: "footer"
|
|
32
|
+
}, /*#__PURE__*/ react.createElement(Typography, {
|
|
33
|
+
use: "body"
|
|
34
|
+
}, t`
|
|
35
|
+
This screen is only visible if {message} environment variable is set.
|
|
36
|
+
Read more about it in the {link}. `({
|
|
37
|
+
message: /*#__PURE__*/ react.createElement("span", {
|
|
38
|
+
className: "highlight"
|
|
39
|
+
}, "`REACT_APP_DEBUG=true`"),
|
|
40
|
+
link: /*#__PURE__*/ react.createElement("a", {
|
|
41
|
+
href: ENVIRONMENT_VARIABLES_ARTICLE_LINK,
|
|
42
|
+
target: "_blank",
|
|
43
|
+
rel: "noreferrer noopener"
|
|
44
|
+
}, "environment variables article")
|
|
45
|
+
}), /*#__PURE__*/ react.createElement("br", null), t`Open your browser's developer console to further inspect this error.`))));
|
|
94
46
|
};
|
|
47
|
+
export { ErrorOverlay };
|
|
95
48
|
|
|
96
|
-
|
|
97
|
-
exports.default = _default;
|
|
49
|
+
//# sourceMappingURL=ErrorOverlay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"plugins/NetworkErrorLinkPlugin/ErrorOverlay.js","sources":["../../../src/plugins/NetworkErrorLinkPlugin/ErrorOverlay.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { Typography } from \"./Typography.js\";\nimport { i18n } from \"../../i18n/index.js\";\nimport { OverlayWrapper } from \"./StyledComponents.js\";\nimport { ReactComponent as CloseIcon } from \"./assets/close_24px.svg\";\n\nconst t = i18n.ns(\"app/graphql/error-overlay\");\n\nconst ENVIRONMENT_VARIABLES_ARTICLE_LINK =\n \"https://www.webiny.com/docs/how-to-guides/environment-variables\";\n\ntype ErrorOverlayProps = Partial<{\n title: React.ReactNode;\n message: React.ReactNode;\n description: React.ReactNode;\n closeable?: boolean;\n}>;\n\nexport const ErrorOverlay = (props: ErrorOverlayProps) => {\n const { title = \"An error occurred\", message, description, closeable } = props;\n const [open, setOpen] = useState(true);\n if (!open) {\n return null;\n }\n\n return (\n <OverlayWrapper>\n <div className=\"inner\">\n <div className=\"header\">\n <div className=\"header__title\">\n <Typography use={\"headline\"}>{title}</Typography>\n </div>\n {closeable !== false && (\n <div className=\"header__action\">\n <span onClick={() => setOpen(false)}>\n <CloseIcon />\n </span>\n </div>\n )}\n </div>\n <div className=\"body\">\n <div className=\"body__summary\">{message}</div>\n {description && <div className=\"body__description\">{description}</div>}\n </div>\n <div className=\"footer\">\n <Typography use={\"body\"}>\n {t`\n This screen is only visible if {message} environment variable is set.\n Read more about it in the {link}. `({\n message: <span className={\"highlight\"}>`REACT_APP_DEBUG=true`</span>,\n link: (\n <a\n href={ENVIRONMENT_VARIABLES_ARTICLE_LINK}\n target={\"_blank\"}\n rel={\"noreferrer noopener\"}\n >\n environment variables article\n </a>\n )\n })}\n <br />\n {t`Open your browser's developer console to further inspect this error.`}\n </Typography>\n </div>\n </div>\n </OverlayWrapper>\n );\n};\n"],"names":["t","i18n","ENVIRONMENT_VARIABLES_ARTICLE_LINK","ErrorOverlay","props","title","message","description","closeable","open","setOpen","useState","OverlayWrapper","Typography","CloseIcon"],"mappings":";;;;;AAMA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAElB,MAAMC,qCACF;AASG,MAAMC,eAAe,CAACC;IACzB,MAAM,EAAEC,QAAQ,mBAAmB,EAAEC,OAAO,EAAEC,WAAW,EAAEC,SAAS,EAAE,GAAGJ;IACzE,MAAM,CAACK,MAAMC,QAAQ,GAAGC,SAAS;IACjC,IAAI,CAACF,MACD,OAAO;IAGX,OAAO,WAAP,GACI,oBAACG,gBAAcA,MAAAA,WAAAA,GACX,oBAAC;QAAI,WAAU;qBACX,oBAAC;QAAI,WAAU;qBACX,oBAAC;QAAI,WAAU;qBACX,oBAACC,YAAUA;QAAC,KAAK;OAAaR,SAEjCG,AAAc,UAAdA,aAAuB,WAAT,GACX,oBAAC;QAAI,WAAU;qBACX,oBAAC;QAAK,SAAS,IAAME,QAAQ;qBACzB,oBAACI,gBAASA,UAAAA,WAAAA,GAK1B,oBAAC;QAAI,WAAU;qBACX,oBAAC;QAAI,WAAU;OAAiBR,UAC/BC,eAAe,WAAfA,GAAe,oBAAC;QAAI,WAAU;OAAqBA,eAAAA,WAAAA,GAExD,oBAAC;QAAI,WAAU;qBACX,oBAACM,YAAUA;QAAC,KAAK;OACZb,CAAC,CAAC;;0DAE+B,CAAC,CAAC;QAChC,SAAS,WAAT,GAAS,oBAAC;YAAK,WAAW;WAAa;QACvC,MAAM,WAAN,GACI,oBAAC;YACG,MAAME;YACN,QAAQ;YACR,KAAK;WACR;IAIT,kBACA,oBAAC,aACAF,CAAC,CAAC,oEAAoE,CAAC;AAMhG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface ErrorOverlayProps {
|
|
3
|
+
query: string;
|
|
4
|
+
networkError: {
|
|
5
|
+
message: string;
|
|
6
|
+
result?: {
|
|
7
|
+
error?: {
|
|
8
|
+
stack?: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare const GqlErrorOverlay: (props: ErrorOverlayProps) => React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import get from "lodash/get.js";
|
|
3
|
+
import { Typography } from "./Typography.js";
|
|
4
|
+
import { i18n } from "../../i18n/index.js";
|
|
5
|
+
import { Pre } from "./StyledComponents.js";
|
|
6
|
+
import { ErrorOverlay } from "./ErrorOverlay.js";
|
|
7
|
+
const t = i18n.ns("app/graphql/error-overlay");
|
|
8
|
+
const GqlErrorOverlay = (props)=>{
|
|
9
|
+
const { query, networkError } = props;
|
|
10
|
+
const stackTrace = get(networkError, "result.error.stack");
|
|
11
|
+
const title = networkError.message;
|
|
12
|
+
const message = /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Typography, {
|
|
13
|
+
use: "subtitle"
|
|
14
|
+
}, t`Error occurred while executing operation:`), /*#__PURE__*/ react.createElement(Pre, null, /*#__PURE__*/ react.createElement("code", null, query)));
|
|
15
|
+
let description = null;
|
|
16
|
+
if (stackTrace) description = /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Typography, {
|
|
17
|
+
use: "subtitle"
|
|
18
|
+
}, t`Complete stack trace:`), /*#__PURE__*/ react.createElement(Pre, null, /*#__PURE__*/ react.createElement("code", null, stackTrace)));
|
|
19
|
+
return /*#__PURE__*/ react.createElement(ErrorOverlay, {
|
|
20
|
+
title: title,
|
|
21
|
+
message: message,
|
|
22
|
+
description: description
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
export { GqlErrorOverlay };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=GqlErrorOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js","sources":["../../../src/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.tsx"],"sourcesContent":["import React from \"react\";\nimport get from \"lodash/get.js\";\nimport { Typography } from \"./Typography.js\";\nimport { i18n } from \"../../i18n/index.js\";\nimport { Pre } from \"./StyledComponents.js\";\nimport { ErrorOverlay } from \"./ErrorOverlay.js\";\n\nconst t = i18n.ns(\"app/graphql/error-overlay\");\n\ninterface ErrorOverlayProps {\n query: string;\n networkError: {\n message: string;\n result?: {\n error?: {\n stack?: string;\n };\n };\n };\n}\n\nexport const GqlErrorOverlay = (props: ErrorOverlayProps) => {\n const { query, networkError } = props;\n const stackTrace = get(networkError, \"result.error.stack\");\n\n const title = networkError.message;\n\n const message = (\n <>\n <Typography use={\"subtitle\"}>{t`Error occurred while executing operation:`}</Typography>\n <Pre>\n <code>{query}</code>\n </Pre>\n </>\n );\n\n let description: React.ReactNode = null;\n if (stackTrace) {\n description = (\n <>\n <Typography use={\"subtitle\"}>{t`Complete stack trace:`}</Typography>\n <Pre>\n <code>{stackTrace}</code>\n </Pre>\n </>\n );\n }\n\n return <ErrorOverlay title={title} message={message} description={description} />;\n};\n"],"names":["t","i18n","GqlErrorOverlay","props","query","networkError","stackTrace","get","title","message","Typography","Pre","description","ErrorOverlay"],"mappings":";;;;;;AAOA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAcX,MAAMC,kBAAkB,CAACC;IAC5B,MAAM,EAAEC,KAAK,EAAEC,YAAY,EAAE,GAAGF;IAChC,MAAMG,aAAaC,IAAIF,cAAc;IAErC,MAAMG,QAAQH,aAAa,OAAO;IAElC,MAAMI,UAAU,WAAVA,GACF,wDACI,oBAACC,YAAUA;QAAC,KAAK;OAAaV,CAAC,CAAC,yCAAyC,CAAC,iBAC1E,oBAACW,KAAGA,MAAAA,WAAAA,GACA,oBAAC,cAAMP;IAKnB,IAAIQ,cAA+B;IACnC,IAAIN,YACAM,cAAc,WAAdA,GACI,wDACI,oBAACF,YAAUA;QAAC,KAAK;OAAaV,CAAC,CAAC,qBAAqB,CAAC,iBACtD,oBAACW,KAAGA,MAAAA,WAAAA,GACA,oBAAC,cAAML;IAMvB,OAAO,WAAP,GAAO,oBAACO,cAAYA;QAAC,OAAOL;QAAO,SAASC;QAAS,aAAaG;;AACtE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
const Code = styled.code`
|
|
4
|
+
font-family: monospace;
|
|
5
|
+
font-size: 0.85rem;
|
|
6
|
+
line-height: 1rem;
|
|
7
|
+
`;
|
|
8
|
+
const LocalAwsLambdaTimeoutMessage = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, "Local AWS Lambda function execution timed out.", /*#__PURE__*/ react.createElement("br", null), /*#__PURE__*/ react.createElement("br", null), "Did you stop the\xa0", /*#__PURE__*/ react.createElement("a", {
|
|
9
|
+
href: "https://www.webiny.com/docs/core-development-concepts/basics/watch-command",
|
|
10
|
+
rel: "noreferrer noopener",
|
|
11
|
+
target: "_blank"
|
|
12
|
+
}, /*#__PURE__*/ react.createElement(Code, null, "webiny watch")), "\xa0command? If so, please restart the command or deploy your changes via the\xa0", /*#__PURE__*/ react.createElement("a", {
|
|
13
|
+
href: "https://www.webiny.com/docs/core-development-concepts/basics/project-deployment",
|
|
14
|
+
rel: "noreferrer noopener",
|
|
15
|
+
target: "_blank"
|
|
16
|
+
}, /*#__PURE__*/ react.createElement(Code, null, "webiny deploy")), "\xa0command. For example: ", /*#__PURE__*/ react.createElement(Code, null, "yarn webiny deploy api --env dev"), ".", /*#__PURE__*/ react.createElement("br", null), /*#__PURE__*/ react.createElement("br", null), "Learn more:\xa0", /*#__PURE__*/ react.createElement("a", {
|
|
17
|
+
href: "https://webiny.link/local-aws-lambda-development",
|
|
18
|
+
rel: "noreferrer noopener",
|
|
19
|
+
target: "_blank"
|
|
20
|
+
}, "https://webiny.link/local-aws-lambda-development"));
|
|
21
|
+
export { LocalAwsLambdaTimeoutMessage };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=LocalAwsLambdaTimeoutMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js","sources":["../../../src/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.tsx"],"sourcesContent":["import React from \"react\";\nimport styled from \"@emotion/styled\";\n\nconst Code = styled.code`\n font-family: monospace;\n font-size: 0.85rem;\n line-height: 1rem;\n`;\n\nexport const LocalAwsLambdaTimeoutMessage = () => (\n <>\n Local AWS Lambda function execution timed out.\n <br />\n <br />\n Did you stop the \n <a\n href={\"https://www.webiny.com/docs/core-development-concepts/basics/watch-command\"}\n rel={\"noreferrer noopener\"}\n target={\"_blank\"}\n >\n <Code>webiny watch</Code>\n </a>\n command? If so, please restart the command or deploy your changes via the \n <a\n href={\"https://www.webiny.com/docs/core-development-concepts/basics/project-deployment\"}\n rel={\"noreferrer noopener\"}\n target={\"_blank\"}\n >\n <Code>webiny deploy</Code>\n </a>\n command. For example: <Code>yarn webiny deploy api --env dev</Code>.\n <br />\n <br />\n Learn more: \n <a\n href={\"https://webiny.link/local-aws-lambda-development\"}\n rel={\"noreferrer noopener\"}\n target={\"_blank\"}\n >\n https://webiny.link/local-aws-lambda-development\n </a>\n </>\n);\n"],"names":["Code","styled","LocalAwsLambdaTimeoutMessage"],"mappings":";;AAGA,MAAMA,OAAOC,OAAO,IAAI,CAAC;;;;AAIzB,CAAC;AAEM,MAAMC,+BAA+B,kBACxC,0CAAE,gEAEE,oBAAC,2BACD,oBAAC,aAAK,sCAEN,oBAAC;QACG,MAAM;QACN,KAAK;QACL,QAAQ;qBAER,oBAACF,MAAIA,MAAC,kBACN,mGAEJ,oBAAC;QACG,MAAM;QACN,KAAK;QACL,QAAQ;qBAER,oBAACA,MAAIA,MAAC,mBACN,4CACwB,oBAACA,MAAIA,MAAC,qCAAuC,mBACzE,oBAAC,2BACD,oBAAC,aAAK,iCAEN,oBAAC;QACG,MAAM;QACN,KAAK;QACL,QAAQ;OACX"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare const Pre: import("@emotion/styled
|
|
1
|
+
export declare const OverlayWrapper: import("@emotion/styled").StyledComponent<{
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
|
+
as?: React.ElementType;
|
|
4
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
5
|
+
export declare const Pre: import("@emotion/styled").StyledComponent<{
|
|
6
|
+
theme?: import("@emotion/react").Theme;
|
|
7
|
+
as?: React.ElementType;
|
|
8
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, {}>;
|
|
@@ -1,21 +1,69 @@
|
|
|
1
|
-
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
const OverlayWrapper = styled("div")(`
|
|
3
|
+
width: 100vw;
|
|
4
|
+
height: 100vh;
|
|
5
|
+
position: fixed;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
z-index: 105; // The highest z-index value is 100 for Dialogs
|
|
9
|
+
|
|
10
|
+
.inner {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
overflow: auto;
|
|
17
|
+
background-color: white;
|
|
18
|
+
padding: 1rem;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.header {
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: space-between;
|
|
24
|
+
align-items: center;
|
|
25
|
+
margin-bottom: 1rem;
|
|
26
|
+
.header__title {
|
|
27
|
+
color: var(--mdc-theme-error);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.body {
|
|
32
|
+
grow: 1;
|
|
33
|
+
.body__summary {
|
|
34
|
+
margin-bottom: 1rem;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.footer {
|
|
39
|
+
color: var(--mdc-theme-text-secondary-on-background);
|
|
40
|
+
|
|
41
|
+
.highlight {
|
|
42
|
+
background-color: rgba(251, 245, 180, 0.5);
|
|
43
|
+
padding: 0 4px;
|
|
44
|
+
border-radius: 6px;
|
|
45
|
+
font-family: monospace;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`);
|
|
49
|
+
const Pre = styled("pre")(`
|
|
50
|
+
position: relative;
|
|
51
|
+
display: block;
|
|
52
|
+
padding: 0.5em;
|
|
53
|
+
margin-top: 0.5em;
|
|
54
|
+
margin-bottom: 0.5em;
|
|
55
|
+
overflow-x: auto;
|
|
56
|
+
white-space: pre-wrap;
|
|
57
|
+
border-radius: 0.25rem;
|
|
58
|
+
background-color: rgba(251, 245, 180, 0.3);
|
|
59
|
+
color: inherit;
|
|
60
|
+
|
|
61
|
+
code {
|
|
62
|
+
font-family: monospace;
|
|
63
|
+
font-size: 0.85rem;
|
|
64
|
+
line-height: 1rem;
|
|
65
|
+
}
|
|
66
|
+
`);
|
|
67
|
+
export { OverlayWrapper, Pre };
|
|
2
68
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.Pre = exports.OverlayWrapper = void 0;
|
|
9
|
-
|
|
10
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
11
|
-
|
|
12
|
-
var OverlayWrapper = /*#__PURE__*/(0, _styled.default)("div", {
|
|
13
|
-
target: "e1rvk94r0",
|
|
14
|
-
label: "OverlayWrapper"
|
|
15
|
-
})("\n width: 100vw;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 105; // The highest z-index value is 100 for Dialogs\n \n .inner {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: white;\n padding: 1rem;\n }\n \n .header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 1rem;\n .header__title {\n color: var(--mdc-theme-error);\n }\n }\n \n .body {\n flex-grow: 1;\n .body__summary {\n margin-bottom: 1rem;\n }\n }\n \n .footer {\n color: var(--mdc-theme-text-secondary-on-background);\n \n .highlight {\n background-color: rgba(251, 245, 180, 0.5);\n padding: 0 4px;\n border-radius: 6px;\n font-family: monospace;\n }\n }\n");
|
|
16
|
-
exports.OverlayWrapper = OverlayWrapper;
|
|
17
|
-
var Pre = /*#__PURE__*/(0, _styled.default)("pre", {
|
|
18
|
-
target: "e1rvk94r1",
|
|
19
|
-
label: "Pre"
|
|
20
|
-
})("\n position: relative;\n display: block;\n padding: 0.5em;\n margin-top: 0.5em;\n margin-bottom: 0.5em;\n overflow-x: auto;\n white-space: pre-wrap;\n border-radius: 0.25rem;\n background-color: rgba(251, 245, 180, 0.3);\n color: inherit;\n \n code {\n font-family: monospace;\n font-size: 0.85rem;\n line-height: 1rem;\n }\n");
|
|
21
|
-
exports.Pre = Pre;
|
|
69
|
+
//# sourceMappingURL=StyledComponents.js.map
|