@webiny/app 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.eb81deee7e
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 +5 -6
- package/App.js +75 -88
- package/App.js.map +1 -1
- package/AppContainer.js +3 -6
- package/AppContainer.js.map +1 -1
- package/README.md +7 -15
- package/components/Image.d.ts +1 -2
- package/components/Image.js +12 -18
- package/components/Image.js.map +1 -1
- package/components/index.d.ts +1 -2
- package/components/index.js +1 -4
- package/config/RouterConfig/Route.d.ts +9 -10
- package/config/RouterConfig/Route.js +23 -37
- package/config/RouterConfig/Route.js.map +1 -1
- package/config/RouterConfig.d.ts +11 -14
- package/config/RouterConfig.js +12 -11
- package/config/RouterConfig.js.map +1 -1
- package/config.js +19 -20
- package/config.js.map +1 -1
- package/contexts/Ui/index.js +26 -28
- package/contexts/Ui/index.js.map +1 -1
- package/core/Plugin.d.ts +1 -1
- package/core/Plugin.js +9 -11
- package/core/Plugin.js.map +1 -1
- package/core/Plugins.d.ts +4 -3
- package/core/Plugins.js +18 -36
- package/core/Plugins.js.map +1 -1
- package/core/Provider.d.ts +1 -1
- package/core/Provider.js +6 -14
- package/core/Provider.js.map +1 -1
- package/core/createProvider.js +3 -6
- package/core/createProvider.js.map +1 -1
- package/core/createProviderPlugin.js +9 -14
- package/core/createProviderPlugin.js.map +1 -1
- package/errors/AuthenticationErrorEvent.d.ts +9 -0
- package/errors/AuthenticationErrorEvent.js +13 -0
- package/errors/AuthenticationErrorEvent.js.map +1 -0
- package/errors/NetworkErrorEvent.d.ts +15 -0
- package/errors/NetworkErrorEvent.js +13 -0
- package/errors/NetworkErrorEvent.js.map +1 -0
- package/errors/abstractions.d.ts +12 -0
- package/errors/abstractions.js +6 -0
- package/errors/abstractions.js.map +1 -0
- package/errors/index.d.ts +6 -0
- package/errors/index.js +3 -0
- package/errors/overlay/ErrorOverlay.d.ts +9 -0
- package/errors/overlay/ErrorOverlay.js +43 -0
- package/errors/overlay/ErrorOverlay.js.map +1 -0
- package/{plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts → errors/overlay/GqlErrorOverlay.d.ts} +2 -2
- package/errors/overlay/GqlErrorOverlay.js +27 -0
- package/errors/overlay/GqlErrorOverlay.js.map +1 -0
- package/errors/overlay/LocalAwsLambdaTimeoutMessage.d.ts +2 -0
- package/errors/overlay/LocalAwsLambdaTimeoutMessage.js +20 -0
- package/errors/overlay/LocalAwsLambdaTimeoutMessage.js.map +1 -0
- package/errors/overlay/StyledComponents.d.ts +7 -0
- package/errors/overlay/StyledComponents.js +10 -0
- package/errors/overlay/StyledComponents.js.map +1 -0
- package/errors/overlay/Typography.d.ts +8 -0
- package/errors/overlay/Typography.js +13 -0
- package/errors/overlay/Typography.js.map +1 -0
- package/errors/overlay/assets/close_24px.js +19 -0
- package/errors/overlay/assets/close_24px.js.map +1 -0
- package/errors/overlay/createErrorOverlay.d.ts +7 -0
- package/errors/overlay/createErrorOverlay.js +15 -0
- package/errors/overlay/createErrorOverlay.js.map +1 -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 +8 -0
- package/exports/admin.js +8 -0
- package/features/apiStreamClient/FetchApiStreamClient.d.ts +9 -0
- package/features/apiStreamClient/FetchApiStreamClient.js +63 -0
- package/features/apiStreamClient/FetchApiStreamClient.js.map +1 -0
- package/features/apiStreamClient/__tests__/FetchApiStreamClient.test.d.ts +1 -0
- package/features/apiStreamClient/__tests__/FetchApiStreamClient.test.js +170 -0
- package/features/apiStreamClient/__tests__/FetchApiStreamClient.test.js.map +1 -0
- package/features/apiStreamClient/__tests__/readServerSentEvents.test.d.ts +1 -0
- package/features/apiStreamClient/__tests__/readServerSentEvents.test.js +160 -0
- package/features/apiStreamClient/__tests__/readServerSentEvents.test.js.map +1 -0
- package/features/apiStreamClient/abstractions.d.ts +44 -0
- package/features/apiStreamClient/abstractions.js +10 -0
- package/features/apiStreamClient/abstractions.js.map +1 -0
- package/features/apiStreamClient/feature.d.ts +3 -0
- package/features/apiStreamClient/feature.js +17 -0
- package/features/apiStreamClient/feature.js.map +1 -0
- package/features/apiStreamClient/index.d.ts +5 -0
- package/features/apiStreamClient/index.js +5 -0
- package/features/apiStreamClient/readServerSentEvents.d.ts +10 -0
- package/features/apiStreamClient/readServerSentEvents.js +29 -0
- package/features/apiStreamClient/readServerSentEvents.js.map +1 -0
- package/features/apiStreamClient/toPayloadHash.d.ts +14 -0
- package/features/apiStreamClient/toPayloadHash.js +7 -0
- package/features/apiStreamClient/toPayloadHash.js.map +1 -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 +471 -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 +25 -0
- package/features/router/HistoryRouterGateway.js +100 -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 +23 -0
- package/features/router/RouterPresenter.js +62 -0
- package/features/router/RouterPresenter.js.map +1 -0
- package/features/router/RouterRepository.d.ts +32 -0
- package/features/router/RouterRepository.js +123 -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 +90 -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/useHandler.js +12 -16
- package/hooks/useHandler.js.map +1 -1
- package/hooks/useHandlers.js +18 -20
- package/hooks/useHandlers.js.map +1 -1
- package/hooks/useRegisterLegacyPlugin.d.ts +1 -1
- package/hooks/useRegisterLegacyPlugin.js +7 -6
- package/hooks/useRegisterLegacyPlugin.js.map +1 -1
- package/hooks/useUi.d.ts +1 -1
- package/hooks/useUi.js +3 -4
- package/hooks/useUi.js.map +1 -1
- package/i18n/i18n.js +8 -4
- package/i18n/i18n.js.map +1 -1
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +1 -3
- package/index.d.ts +20 -15
- package/index.js +19 -19
- package/package.json +34 -42
- 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 +2 -2
- package/plugins/image.js +95 -134
- package/plugins/image.js.map +1 -1
- package/plugins/index.d.ts +3 -3
- package/plugins/index.js +35 -59
- 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/RouteParamsSync.d.ts +22 -0
- package/presentation/router/components/RouteParamsSync.js +53 -0
- package/presentation/router/components/RouteParamsSync.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 +7 -0
- package/presentation/router/hooks/useRoute.js +23 -0
- package/presentation/router/hooks/useRoute.js.map +1 -0
- package/presentation/router/hooks/useRouter.d.ts +12 -0
- package/presentation/router/hooks/useRouter.js +30 -0
- package/presentation/router/hooks/useRouter.js.map +1 -0
- package/presentation/router/index.d.ts +6 -0
- package/presentation/router/index.js +4 -0
- package/presentation/router/types.d.ts +5 -0
- package/presentation/router/types.js +0 -0
- package/renderApp.d.ts +1 -1
- package/renderApp.js +7 -6
- package/renderApp.js.map +1 -1
- 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 +6 -24
- package/types.js +0 -14
- package/utils/createGenericContext.js +17 -21
- package/utils/createGenericContext.js.map +1 -1
- package/utils/createHashing.js +13 -16
- package/utils/createHashing.js.map +1 -1
- package/utils/index.d.ts +2 -10
- package/utils/index.js +2 -12
- package/utils/legacyPluginToReactComponent.js +12 -11
- package/utils/legacyPluginToReactComponent.js.map +1 -1
- package/apollo-client/InMemoryCache.d.ts +0 -8
- package/apollo-client/InMemoryCache.js +0 -20
- package/apollo-client/InMemoryCache.js.map +0 -1
- package/apollo-client/IntrospectionFragmentMatcher.d.ts +0 -11
- package/apollo-client/IntrospectionFragmentMatcher.js +0 -45
- package/apollo-client/IntrospectionFragmentMatcher.js.map +0 -1
- package/components/Routes.d.ts +0 -2
- package/components/Routes.js +0 -36
- package/components/Routes.js.map +0 -1
- package/components/View.d.ts +0 -8
- package/components/View.js +0 -19
- package/components/View.js.map +0 -1
- package/components/index.js.map +0 -1
- package/core/DebounceRender.d.ts +0 -12
- package/core/DebounceRender.js +0 -31
- package/core/DebounceRender.js.map +0 -1
- package/core/Routes.d.ts +0 -6
- package/core/Routes.js +0 -34
- package/core/Routes.js.map +0 -1
- package/hooks/useAutocomplete/index.d.ts +0 -1
- package/hooks/useAutocomplete/index.js +0 -3
- package/hooks/useAutocomplete/index.js.map +0 -1
- package/hooks/useAutocomplete/useAutocomplete.d.ts +0 -11
- package/hooks/useAutocomplete/useAutocomplete.js +0 -23
- package/hooks/useAutocomplete/useAutocomplete.js.map +0 -1
- package/hooks/useDataList/functions/getData.d.ts +0 -2
- package/hooks/useDataList/functions/getData.js +0 -4
- package/hooks/useDataList/functions/getData.js.map +0 -1
- package/hooks/useDataList/functions/getError.d.ts +0 -2
- package/hooks/useDataList/functions/getError.js +0 -4
- package/hooks/useDataList/functions/getError.js.map +0 -1
- package/hooks/useDataList/functions/getMeta.d.ts +0 -2
- package/hooks/useDataList/functions/getMeta.js +0 -4
- package/hooks/useDataList/functions/getMeta.js.map +0 -1
- package/hooks/useDataList/functions/index.d.ts +0 -3
- package/hooks/useDataList/functions/index.js +0 -5
- package/hooks/useDataList/functions/index.js.map +0 -1
- package/hooks/useDataList/functions/searchDataByKey.d.ts +0 -2
- package/hooks/useDataList/functions/searchDataByKey.js +0 -18
- package/hooks/useDataList/functions/searchDataByKey.js.map +0 -1
- package/hooks/useDataList/index.d.ts +0 -1
- package/hooks/useDataList/index.js +0 -3
- package/hooks/useDataList/index.js.map +0 -1
- package/hooks/useDataList/useDataList.d.ts +0 -36
- package/hooks/useDataList/useDataList.js +0 -183
- package/hooks/useDataList/useDataList.js.map +0 -1
- package/hooks/useDataList/utils/index.d.ts +0 -2
- package/hooks/useDataList/utils/index.js +0 -4
- package/hooks/useDataList/utils/index.js.map +0 -1
- package/hooks/useDataList/utils/prepareLoadListParams.d.ts +0 -10
- package/hooks/useDataList/utils/prepareLoadListParams.js +0 -38
- package/hooks/useDataList/utils/prepareLoadListParams.js.map +0 -1
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +0 -14
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +0 -26
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +0 -1
- package/hooks/useDataList/utils/types.d.ts +0 -40
- package/hooks/useDataList/utils/types.js +0 -3
- package/hooks/useDataList/utils/types.js.map +0 -1
- package/i18n/index.js.map +0 -1
- package/index.js.map +0 -1
- package/plugins/AddQuerySelectionPlugin.d.ts +0 -22
- package/plugins/AddQuerySelectionPlugin.js +0 -72
- package/plugins/AddQuerySelectionPlugin.js.map +0 -1
- package/plugins/ApolloCacheObjectIdPlugin.d.ts +0 -15
- package/plugins/ApolloCacheObjectIdPlugin.js +0 -16
- package/plugins/ApolloCacheObjectIdPlugin.js.map +0 -1
- package/plugins/ApolloDynamicLink.d.ts +0 -7
- package/plugins/ApolloDynamicLink.js +0 -31
- package/plugins/ApolloDynamicLink.js.map +0 -1
- package/plugins/ApolloLinkPlugin.d.ts +0 -13
- package/plugins/ApolloLinkPlugin.js +0 -22
- package/plugins/ApolloLinkPlugin.js.map +0 -1
- package/plugins/ConsoleLinkPlugin.d.ts +0 -8
- package/plugins/ConsoleLinkPlugin.js +0 -26
- package/plugins/ConsoleLinkPlugin.js.map +0 -1
- package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -10
- package/plugins/LocaleHeaderLinkPlugin.js +0 -32
- package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +0 -66
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +0 -1
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +0 -9
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +0 -78
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +0 -1
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +0 -7
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +0 -31
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +0 -1
- package/plugins/NetworkErrorLinkPlugin.d.ts +0 -7
- package/plugins/NetworkErrorLinkPlugin.js +0 -30
- package/plugins/NetworkErrorLinkPlugin.js.map +0 -1
- package/plugins/OmitTypenameLinkPlugin.d.ts +0 -8
- package/plugins/OmitTypenameLinkPlugin.js +0 -21
- package/plugins/OmitTypenameLinkPlugin.js.map +0 -1
- package/plugins/RoutePlugin.d.ts +0 -12
- package/plugins/RoutePlugin.js +0 -16
- package/plugins/RoutePlugin.js.map +0 -1
- package/plugins/TenantHeaderLinkPlugin.d.ts +0 -10
- package/plugins/TenantHeaderLinkPlugin.js +0 -39
- package/plugins/TenantHeaderLinkPlugin.js.map +0 -1
- package/plugins/ViewPlugin.d.ts +0 -14
- package/plugins/ViewPlugin.js +0 -19
- package/plugins/ViewPlugin.js.map +0 -1
- package/react-butterfiles/Files.d.ts +0 -69
- package/react-butterfiles/Files.js +0 -227
- package/react-butterfiles/Files.js.map +0 -1
- package/react-butterfiles/index.d.ts +0 -2
- package/react-butterfiles/index.js +0 -4
- package/react-butterfiles/index.js.map +0 -1
- package/react-butterfiles/utils/generateId.d.ts +0 -1
- package/react-butterfiles/utils/generateId.js +0 -5
- package/react-butterfiles/utils/generateId.js.map +0 -1
- package/react-butterfiles/utils/readFileContent.d.ts +0 -1
- package/react-butterfiles/utils/readFileContent.js +0 -15
- package/react-butterfiles/utils/readFileContent.js.map +0 -1
- package/types.js.map +0 -1
- package/utils/getApiUrl.d.ts +0 -1
- package/utils/getApiUrl.js +0 -5
- package/utils/getApiUrl.js.map +0 -1
- package/utils/getGqlApiUrl.d.ts +0 -1
- package/utils/getGqlApiUrl.js +0 -6
- package/utils/getGqlApiUrl.js.map +0 -1
- package/utils/getHeadlessCmsGqlApiUrl.d.ts +0 -5
- package/utils/getHeadlessCmsGqlApiUrl.js +0 -12
- package/utils/getHeadlessCmsGqlApiUrl.js.map +0 -1
- package/utils/getLocaleCode.d.ts +0 -6
- package/utils/getLocaleCode.js +0 -33
- package/utils/getLocaleCode.js.map +0 -1
- package/utils/getPrerenderId.d.ts +0 -6
- package/utils/getPrerenderId.js +0 -5
- package/utils/getPrerenderId.js.map +0 -1
- package/utils/getTenantId.d.ts +0 -6
- package/utils/getTenantId.js +0 -45
- package/utils/getTenantId.js.map +0 -1
- package/utils/index.js.map +0 -1
- package/utils/isLocalhost.d.ts +0 -1
- package/utils/isLocalhost.js +0 -7
- package/utils/isLocalhost.js.map +0 -1
- package/utils/isPrerendering.d.ts +0 -1
- package/utils/isPrerendering.js +0 -5
- package/utils/isPrerendering.js.map +0 -1
- /package/{plugins/NetworkErrorLinkPlugin → errors/overlay}/assets/close_24px.svg +0 -0
package/config.js
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
const deepFreeze = obj
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
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);
|
|
8
6
|
};
|
|
9
7
|
function createConfig() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
+
};
|
|
22
20
|
}
|
|
23
|
-
|
|
21
|
+
const config_config = createConfig();
|
|
22
|
+
export { config_config as config };
|
|
24
23
|
|
|
25
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.js
CHANGED
|
@@ -1,32 +1,30 @@
|
|
|
1
|
-
import
|
|
1
|
+
import react from "react";
|
|
2
2
|
import { plugins } from "@webiny/plugins";
|
|
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
|
-
key: pl.name
|
|
28
|
-
})), this.props.children);
|
|
29
|
-
}
|
|
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
|
|
9
|
+
};
|
|
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);
|
|
16
|
+
}
|
|
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
|
+
}
|
|
30
27
|
}
|
|
28
|
+
export { UiContext, UiProvider };
|
|
31
29
|
|
|
32
30
|
//# sourceMappingURL=index.js.map
|
package/contexts/Ui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"contexts/Ui/index.js","sources":["../../../src/contexts/Ui/index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { UiStatePlugin } from \"~/types.js\";\nimport { plugins } from \"@webiny/plugins\";\n\nexport const UiContext = React.createContext<Record<string, any>>({});\n\ntype Props = Record<string, any>;\n\ntype State = {\n ui: { [key: string]: any };\n};\n\ninterface UiData {\n [key: string]: any;\n}\n\ninterface UiDataSetter {\n (ui: UiData): UiData;\n}\n\nexport interface UiContextValue {\n setState: (setter: UiDataSetter) => void;\n [key: string]: any;\n}\n\nexport class UiProvider extends React.Component<Props, State> {\n public override state: State = {\n ui: {}\n };\n\n private readonly setData = (setter: UiDataSetter): void => {\n return this.setState((state: State) => {\n return { ui: { ...state.ui, ...setter(state.ui) } };\n });\n };\n\n public override render() {\n const value: UiContextValue = { ...this.state.ui, setState: this.setData };\n const uiStatePlugins = plugins.byType<UiStatePlugin>(\"ui-state\");\n return (\n <UiContext.Provider value={value}>\n {uiStatePlugins.map(pl => React.cloneElement(pl.render(), { key: pl.name }))}\n {this.props.children}\n </UiContext.Provider>\n );\n }\n}\n"],"names":["UiContext","React","UiProvider","value","uiStatePlugins","plugins","pl","setter","state"],"mappings":";;AAIO,MAAMA,YAAY,WAAHA,GAAGC,MAAAA,aAAmB,CAAsB,CAAC;AAqB5D,MAAMC,mBAAmBD,MAAAA,SAAe;IAW3B,SAAS;QACrB,MAAME,QAAwB;YAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE;YAAE,UAAU,IAAI,CAAC,OAAO;QAAC;QACzE,MAAMC,iBAAiBC,QAAQ,MAAM,CAAgB;QACrD,OAAO,WAAP,GACI,oBAACL,UAAU,QAAQ;YAAC,OAAOG;WACtBC,eAAe,GAAG,CAACE,CAAAA,KAAAA,WAAAA,GAAML,MAAAA,YAAkB,CAACK,GAAG,MAAM,IAAI;gBAAE,KAAKA,GAAG,IAAI;YAAC,KACxE,IAAI,CAAC,KAAK,CAAC,QAAQ;IAGhC;;QApBG,qBACa,KAAK,GAAU;YAC3B,IAAI,CAAC;QACT,QAEiB,OAAO,GAAG,CAACC,SACjB,IAAI,CAAC,QAAQ,CAAC,CAACC,QACX;oBAAE,IAAI;wBAAE,GAAGA,MAAM,EAAE;wBAAE,GAAGD,OAAOC,MAAM,EAAE,CAAC;oBAAC;gBAAE;;AAc9D"}
|
package/core/Plugin.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ interface PluginProps {
|
|
|
4
4
|
providers?: Decorator<GenericComponent>[];
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
}
|
|
7
|
-
export declare const Plugin: React.
|
|
7
|
+
export declare const Plugin: React.MemoExoticComponent<({ providers, children }: PluginProps) => React.JSX.Element>;
|
|
8
8
|
export {};
|
package/core/Plugin.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Provider } from "./Provider";
|
|
3
|
-
import { Plugins } from "./Plugins";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
key: index,
|
|
10
|
-
hoc: provider
|
|
11
|
-
})), children ? /*#__PURE__*/React.createElement(Plugins, null, children) : null);
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { Provider } from "./Provider.js";
|
|
3
|
+
import { Plugins } from "./Plugins.js";
|
|
4
|
+
const Plugin_Plugin = /*#__PURE__*/ react.memo(function({ providers, children }) {
|
|
5
|
+
return /*#__PURE__*/ react.createElement(react.Fragment, null, (providers || []).map((provider, index)=>/*#__PURE__*/ react.createElement(Provider, {
|
|
6
|
+
key: index,
|
|
7
|
+
hoc: provider
|
|
8
|
+
})), children ? /*#__PURE__*/ react.createElement(Plugins, null, children) : null);
|
|
12
9
|
});
|
|
10
|
+
export { Plugin_Plugin as Plugin };
|
|
13
11
|
|
|
14
12
|
//# sourceMappingURL=Plugin.js.map
|
package/core/Plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"core/Plugin.js","sources":["../../src/core/Plugin.tsx"],"sourcesContent":["import React from \"react\";\nimport { Provider } from \"./Provider.js\";\nimport { Plugins } from \"./Plugins.js\";\nimport type { GenericComponent, Decorator } from \"@webiny/react-composition\";\n\ninterface PluginProps {\n providers?: Decorator<GenericComponent>[];\n children?: React.ReactNode;\n}\n\nexport const Plugin = React.memo(function Plugin({ providers, children }: PluginProps) {\n return (\n <>\n {(providers || []).map((provider, index) => (\n <Provider key={index} hoc={provider} />\n ))}\n {children ? <Plugins>{children}</Plugins> : null}\n </>\n );\n});\n"],"names":["Plugin","React","providers","children","provider","index","Provider","Plugins"],"mappings":";;;AAUO,MAAMA,gBAAS,WAAHA,GAAGC,MAAAA,IAAU,CAAC,SAAgB,EAAEC,SAAS,EAAEC,QAAQ,EAAe;IACjF,OAAO,WAAP,GACI,0CACMD,AAAAA,CAAAA,aAAa,EAAC,EAAG,GAAG,CAAC,CAACE,UAAUC,QAAAA,WAAAA,GAC9B,oBAACC,UAAQA;YAAC,KAAKD;YAAO,KAAKD;aAE9BD,WAAW,WAAXA,GAAW,oBAACI,SAAOA,MAAEJ,YAAsB;AAGxD"}
|
package/core/Plugins.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export declare const PluginsContext: React.Context<boolean>;
|
|
3
3
|
interface PluginsProviderComponentProps {
|
|
4
|
-
children: JSX.Element[];
|
|
4
|
+
children: React.JSX.Element[];
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
declare const PluginsProviderComponent: ({ children }: PluginsProviderComponentProps) => React.JSX.Element;
|
|
7
|
+
export declare const PluginsProvider: React.MemoExoticComponent<typeof PluginsProviderComponent>;
|
|
7
8
|
/**
|
|
8
9
|
* @param children
|
|
9
10
|
* @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.
|
|
@@ -11,5 +12,5 @@ export declare const PluginsProvider: React.MemoExoticComponent<({ children }: P
|
|
|
11
12
|
interface PluginsComponentsProps {
|
|
12
13
|
children: React.ReactNode;
|
|
13
14
|
}
|
|
14
|
-
export declare const Plugins: ({ children }: PluginsComponentsProps) => React.JSX.Element | null
|
|
15
|
+
export declare const Plugins: React.MemoExoticComponent<({ children }: PluginsComponentsProps) => React.JSX.Element | null>;
|
|
15
16
|
export {};
|
package/core/Plugins.js
CHANGED
|
@@ -1,39 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useApp } from "../App";
|
|
3
|
-
|
|
1
|
+
import react, { Children, Fragment, createContext, memo, useContext, useEffect } from "react";
|
|
2
|
+
import { useApp } from "../App.js";
|
|
3
|
+
const PluginsContext = /*#__PURE__*/ createContext(false);
|
|
4
4
|
PluginsContext.displayName = "PluginsContext";
|
|
5
|
-
const PluginsProviderComponent = ({
|
|
6
|
-
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
export const Plugins = ({
|
|
24
|
-
children
|
|
25
|
-
}) => {
|
|
26
|
-
const {
|
|
27
|
-
addPlugin
|
|
28
|
-
} = useApp();
|
|
29
|
-
const hasParentPlugin = useContext(PluginsContext);
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (hasParentPlugin) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
Children.forEach(children, child => addPlugin(child));
|
|
35
|
-
}, []);
|
|
36
|
-
return hasParentPlugin ? /*#__PURE__*/React.createElement(Fragment, null, children) : null;
|
|
37
|
-
};
|
|
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 };
|
|
38
20
|
|
|
39
21
|
//# sourceMappingURL=Plugins.js.map
|
package/core/Plugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"core/Plugins.js","sources":["../../src/core/Plugins.tsx"],"sourcesContent":["import React, { Children, createContext, Fragment, memo, useContext, useEffect } from \"react\";\nimport { useApp } from \"~/App.js\";\n\nexport const PluginsContext = createContext<boolean>(false);\nPluginsContext.displayName = \"PluginsContext\";\n\ninterface PluginsProviderComponentProps {\n children: React.JSX.Element[];\n}\nconst PluginsProviderComponent = ({ children }: PluginsProviderComponentProps) => {\n /**\n * This context only serves as a safeguard. We need to warn users when they mount a plugin without using\n * the <Plugins> component. In that case, the context will not be available, and we can log warnings.\n */\n return <PluginsContext.Provider value={true}>{children}</PluginsContext.Provider>;\n};\n\nexport const PluginsProvider = memo(PluginsProviderComponent);\n\n/**\n * @param children\n * @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.\n */\ninterface PluginsComponentsProps {\n children: React.ReactNode;\n}\nexport const Plugins = React.memo(({ children }: PluginsComponentsProps) => {\n const { addPlugin } = useApp();\n const hasParentPlugin = useContext(PluginsContext);\n\n useEffect(() => {\n if (hasParentPlugin) {\n return;\n }\n\n Children.forEach(children, child => addPlugin(child));\n }, []);\n\n return hasParentPlugin ? <Fragment>{children}</Fragment> : null;\n});\n\nPlugins.displayName = \"Plugins\";\n"],"names":["PluginsContext","createContext","PluginsProviderComponent","children","PluginsProvider","memo","Plugins","React","addPlugin","useApp","hasParentPlugin","useContext","useEffect","Children","child","Fragment"],"mappings":";;AAGO,MAAMA,iBAAiB,WAAHA,GAAGC,cAAuB;AACrDD,eAAe,WAAW,GAAG;AAK7B,MAAME,2BAA2B,CAAC,EAAEC,QAAQ,EAAiC,GAKlE,WAAP,GAAO,oBAACH,eAAe,QAAQ;QAAC,OAAO;OAAOG;AAG3C,MAAMC,kBAAkB,WAAHA,GAAGC,KAAKH;AAS7B,MAAMI,UAAU,WAAHA,GAAGC,MAAAA,IAAU,CAAC,CAAC,EAAEJ,QAAQ,EAA0B;IACnE,MAAM,EAAEK,SAAS,EAAE,GAAGC;IACtB,MAAMC,kBAAkBC,WAAWX;IAEnCY,UAAU;QACN,IAAIF,iBACA;QAGJG,SAAS,OAAO,CAACV,UAAUW,CAAAA,QAASN,UAAUM;IAClD,GAAG,EAAE;IAEL,OAAOJ,kBAAkB,WAAlBA,GAAkB,oBAACK,UAAQA,MAAEZ,YAAuB;AAC/D;AAEAG,QAAQ,WAAW,GAAG"}
|
package/core/Provider.d.ts
CHANGED
package/core/Provider.js
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
|
-
import { useApp } from "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
hoc
|
|
8
|
-
}) => {
|
|
9
|
-
const {
|
|
10
|
-
addProvider
|
|
11
|
-
} = useApp();
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
return addProvider(hoc);
|
|
14
|
-
}, []);
|
|
15
|
-
return null;
|
|
2
|
+
import { useApp } from "../index.js";
|
|
3
|
+
const Provider = ({ hoc })=>{
|
|
4
|
+
const { addProvider } = useApp();
|
|
5
|
+
useEffect(()=>addProvider(hoc), []);
|
|
6
|
+
return null;
|
|
16
7
|
};
|
|
8
|
+
export { Provider };
|
|
17
9
|
|
|
18
10
|
//# sourceMappingURL=Provider.js.map
|
package/core/Provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"core/Provider.js","sources":["../../src/core/Provider.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport type { GenericComponent, Decorator } from \"~/index.js\";\nimport { useApp } from \"~/index.js\";\n\nexport interface ProviderProps {\n hoc: Decorator<GenericComponent>;\n}\n\n/**\n * Register a new React context provider.\n */\nexport const Provider = ({ hoc }: ProviderProps) => {\n const { addProvider } = useApp();\n\n useEffect(() => {\n return addProvider(hoc);\n }, []);\n\n return null;\n};\n"],"names":["Provider","hoc","addProvider","useApp","useEffect"],"mappings":";;AAWO,MAAMA,WAAW,CAAC,EAAEC,GAAG,EAAiB;IAC3C,MAAM,EAAEC,WAAW,EAAE,GAAGC;IAExBC,UAAU,IACCF,YAAYD,MACpB,EAAE;IAEL,OAAO;AACX"}
|
package/core/createProvider.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* This is mostly useful for adding React Context providers.
|
|
4
|
-
*/
|
|
5
|
-
export function createProvider(decorator) {
|
|
6
|
-
return decorator;
|
|
1
|
+
function createProvider(decorator) {
|
|
2
|
+
return decorator;
|
|
7
3
|
}
|
|
4
|
+
export { createProvider };
|
|
8
5
|
|
|
9
6
|
//# sourceMappingURL=createProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"core/createProvider.js","sources":["../../src/core/createProvider.tsx"],"sourcesContent":["import type React from \"react\";\nimport type { Decorator, GenericComponent } from \"@webiny/react-composition\";\n\nexport interface ChildrenProps {\n children: React.ReactNode;\n}\n\n/**\n * Creates a Higher Order Component which wraps the entire app content.\n * This is mostly useful for adding React Context providers.\n */\nexport function createProvider(\n decorator: Decorator<GenericComponent<ChildrenProps>>\n): Decorator<GenericComponent<ChildrenProps>> {\n return decorator;\n}\n"],"names":["createProvider","decorator"],"mappings":"AAWO,SAASA,eACZC,SAAqD;IAErD,OAAOA;AACX"}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Provider } from "./Provider";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export function createProviderPlugin(decorator) {
|
|
10
|
-
return function ProviderPlugin() {
|
|
11
|
-
return /*#__PURE__*/React.createElement(Provider, {
|
|
12
|
-
hoc: decorator
|
|
13
|
-
});
|
|
14
|
-
};
|
|
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
|
+
};
|
|
15
9
|
}
|
|
10
|
+
export { createProviderPlugin };
|
|
16
11
|
|
|
17
12
|
//# sourceMappingURL=createProviderPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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,9 @@
|
|
|
1
|
+
import React from "react";
|
|
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 {};
|
|
@@ -0,0 +1,43 @@
|
|
|
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: "box-border flex flex-col w-full h-full overflow-auto bg-white p-4"
|
|
14
|
+
}, /*#__PURE__*/ react.createElement("div", {
|
|
15
|
+
className: "flex justify-between items-center mb-4"
|
|
16
|
+
}, /*#__PURE__*/ react.createElement("div", {
|
|
17
|
+
className: "text-[color:var(--mdc-theme-error)]"
|
|
18
|
+
}, /*#__PURE__*/ react.createElement(Typography, {
|
|
19
|
+
use: "headline"
|
|
20
|
+
}, title)), false !== closeable && /*#__PURE__*/ react.createElement("div", null, /*#__PURE__*/ react.createElement("span", {
|
|
21
|
+
onClick: ()=>setOpen(false)
|
|
22
|
+
}, /*#__PURE__*/ react.createElement(ReactComponent, null)))), /*#__PURE__*/ react.createElement("div", null, /*#__PURE__*/ react.createElement("div", {
|
|
23
|
+
className: "mb-4"
|
|
24
|
+
}, message), description && /*#__PURE__*/ react.createElement("div", null, description)), /*#__PURE__*/ react.createElement("div", {
|
|
25
|
+
className: "text-[color:var(--mdc-theme-text-secondary-on-background)]"
|
|
26
|
+
}, /*#__PURE__*/ react.createElement(Typography, {
|
|
27
|
+
use: "body"
|
|
28
|
+
}, t`
|
|
29
|
+
This screen is only visible if {message} environment variable is set.
|
|
30
|
+
Read more about it in the {link}. `({
|
|
31
|
+
message: /*#__PURE__*/ react.createElement("span", {
|
|
32
|
+
className: "bg-[rgba(251,245,180,0.5)] px-1 rounded-[6px] font-mono"
|
|
33
|
+
}, "`REACT_APP_DEBUG=true`"),
|
|
34
|
+
link: /*#__PURE__*/ react.createElement("a", {
|
|
35
|
+
href: ENVIRONMENT_VARIABLES_ARTICLE_LINK,
|
|
36
|
+
target: "_blank",
|
|
37
|
+
rel: "noreferrer noopener"
|
|
38
|
+
}, "environment variables article")
|
|
39
|
+
}), /*#__PURE__*/ react.createElement("br", null), t`Open your browser's developer console to further inspect this error.`))));
|
|
40
|
+
};
|
|
41
|
+
export { ErrorOverlay };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=ErrorOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors/overlay/ErrorOverlay.js","sources":["../../../src/errors/overlay/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={\"box-border flex flex-col w-full h-full overflow-auto bg-white p-4\"}>\n <div className={\"flex justify-between items-center mb-4\"}>\n <div className={\"text-[color:var(--mdc-theme-error)]\"}>\n <Typography use={\"headline\"}>{title}</Typography>\n </div>\n {closeable !== false && (\n <div>\n <span onClick={() => setOpen(false)}>\n <CloseIcon />\n </span>\n </div>\n )}\n </div>\n <div>\n <div className={\"mb-4\"}>{message}</div>\n {description && <div>{description}</div>}\n </div>\n <div className={\"text-[color:var(--mdc-theme-text-secondary-on-background)]\"}>\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: (\n <span\n className={\n \"bg-[rgba(251,245,180,0.5)] px-1 rounded-[6px] font-mono\"\n }\n >\n `REACT_APP_DEBUG=true`\n </span>\n ),\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,WAAW;qBACZ,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAI,WAAW;qBACZ,oBAACC,YAAUA;QAAC,KAAK;OAAaR,SAEjCG,AAAc,UAAdA,aAAuB,WAAT,GACX,oBAAC,2BACG,oBAAC;QAAK,SAAS,IAAME,QAAQ;qBACzB,oBAACI,gBAASA,UAAAA,WAAAA,GAK1B,oBAAC,2BACG,oBAAC;QAAI,WAAW;OAASR,UACxBC,eAAe,WAAfA,GAAe,oBAAC,aAAKA,eAAAA,WAAAA,GAE1B,oBAAC;QAAI,WAAW;qBACZ,oBAACM,YAAUA;QAAC,KAAK;OACZb,CAAC,CAAC;;0DAE+B,CAAC,CAAC;QAChC,SAAS,WAAT,GACI,oBAAC;YACG,WACI;WAEP;QAIL,MAAM,WAAN,GACI,oBAAC;YACG,MAAME;YACN,QAAQ;YACR,KAAK;WACR;IAIT,kBACA,oBAAC,aACAF,CAAC,CAAC,oEAAoE,CAAC;AAMhG"}
|
package/{plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts → errors/overlay/GqlErrorOverlay.d.ts}
RENAMED
|
@@ -10,5 +10,5 @@ interface ErrorOverlayProps {
|
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
declare const
|
|
14
|
-
export
|
|
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":"errors/overlay/GqlErrorOverlay.js","sources":["../../../src/errors/overlay/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"}
|