@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared/di/createFeature.js","sources":["../../../src/shared/di/createFeature.ts"],"sourcesContent":["import { Container } from \"@webiny/di\";\n\nexport interface FeatureDefinition<TExports = any, TParams extends any[] = []> {\n name: string;\n register: (container: Container, ...args: TParams) => void;\n resolve: (container: Container) => TExports;\n}\n\nexport function createFeature<\n TExports = any,\n TParams extends any[] = [] // tuple for extra args\n>(def: {\n name: string;\n register: (container: Container, ...args: TParams) => void;\n resolve: (container: Container) => TExports;\n}): FeatureDefinition<TExports, TParams> {\n return {\n name: def.name,\n register: def.register,\n resolve: (container: Container): TExports => {\n return def.resolve(container);\n }\n };\n}\n"],"names":["createFeature","def","container"],"mappings":"AAQO,SAASA,cAGdC,GAID;IACG,OAAO;QACH,MAAMA,IAAI,IAAI;QACd,UAAUA,IAAI,QAAQ;QACtB,SAAS,CAACC,YACCD,IAAI,OAAO,CAACC;IAE3B;AACJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { useContainer } from "./DiContainerProvider.js";
|
|
3
|
+
function useFeature(feature) {
|
|
4
|
+
const container = useContainer();
|
|
5
|
+
return useMemo(()=>feature.resolve(container), [
|
|
6
|
+
container,
|
|
7
|
+
feature
|
|
8
|
+
]);
|
|
9
|
+
}
|
|
10
|
+
export { useFeature };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=useFeature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared/di/useFeature.js","sources":["../../../src/shared/di/useFeature.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useContainer } from \"./DiContainerProvider.js\";\nimport { FeatureDefinition } from \"./createFeature.js\";\n\nexport function useFeature<TExports>(feature: FeatureDefinition<TExports, any[]>): TExports {\n const container = useContainer();\n\n return useMemo(() => feature.resolve(container), [container, feature]);\n}\n"],"names":["useFeature","feature","container","useContainer","useMemo"],"mappings":";;AAIO,SAASA,WAAqBC,OAA2C;IAC5E,MAAMC,YAAYC;IAElB,OAAOC,QAAQ,IAAMH,QAAQ,OAAO,CAACC,YAAY;QAACA;QAAWD;KAAQ;AACzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"/></svg>
|
package/types.d.ts
CHANGED
|
@@ -1,34 +1,14 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
|
-
import { Plugin } from "@webiny/plugins/types";
|
|
3
|
-
import type { ApolloClient } from "apollo-client";
|
|
4
2
|
import type { CSSProperties } from "react";
|
|
3
|
+
import { Plugin } from "@webiny/plugins/types.js";
|
|
5
4
|
export type GenericRecordKey = string | number | symbol;
|
|
6
5
|
export type GenericRecord<K extends GenericRecordKey = GenericRecordKey, V = any> = Record<K, V>;
|
|
7
|
-
export type
|
|
8
|
-
apolloClient: ApolloClient<object>;
|
|
9
|
-
onProgress?: (params: {
|
|
10
|
-
sent: number;
|
|
11
|
-
total: number;
|
|
12
|
-
percentage: number;
|
|
13
|
-
}) => void;
|
|
14
|
-
};
|
|
6
|
+
export type NonEmptyArray<T> = [T, ...T[]];
|
|
15
7
|
export type UiStatePlugin = Plugin & {
|
|
16
8
|
type: "ui-state";
|
|
17
9
|
render(): React.ReactElement;
|
|
18
10
|
};
|
|
19
|
-
export
|
|
20
|
-
id: string;
|
|
21
|
-
name: string;
|
|
22
|
-
type: string;
|
|
23
|
-
size: number;
|
|
24
|
-
key: string;
|
|
25
|
-
}
|
|
26
|
-
export type FileUploaderPlugin = Plugin & {
|
|
27
|
-
type: "file-uploader";
|
|
28
|
-
name: "file-uploader";
|
|
29
|
-
upload(file: File, options: UploadOptions): Promise<UploadedFile>;
|
|
30
|
-
};
|
|
31
|
-
export { Plugin };
|
|
11
|
+
export type { Plugin };
|
|
32
12
|
export interface ImageProps {
|
|
33
13
|
src: string;
|
|
34
14
|
preset?: string;
|
|
@@ -63,5 +43,7 @@ export type ImageComponentPlugin = Plugin & {
|
|
|
63
43
|
*/
|
|
64
44
|
export type RoutePlugin = Plugin & {
|
|
65
45
|
type: "route";
|
|
66
|
-
route: React.ReactElement
|
|
46
|
+
route: React.ReactElement<{
|
|
47
|
+
path: string;
|
|
48
|
+
}>;
|
|
67
49
|
};
|
package/types.js
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins/types";
|
|
2
|
-
export { Plugin };
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* "getImageSrc" has to be defined as a separate property, so its functionality can be reused outside of
|
|
6
|
-
* the Image component. This is ideal in cases where manual creation of image src is needed.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Enables registering new routes.
|
|
11
|
-
* @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#route
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return /*#__PURE__*/React.createElement(GenericContext.Provider, {
|
|
9
|
-
value: props
|
|
10
|
-
}, children);
|
|
11
|
-
}
|
|
12
|
-
Provider.displayName = `${name}Provider`;
|
|
13
|
-
return {
|
|
14
|
-
Provider,
|
|
15
|
-
useHook: () => {
|
|
16
|
-
const context = React.useContext(GenericContext);
|
|
17
|
-
if (!context) {
|
|
18
|
-
throw Error(`Context provider for "${name}" is missing in the component tree!`);
|
|
19
|
-
}
|
|
20
|
-
return context;
|
|
1
|
+
import react, { createContext } from "react";
|
|
2
|
+
function createGenericContext(name) {
|
|
3
|
+
const GenericContext = /*#__PURE__*/ createContext(void 0);
|
|
4
|
+
function Provider({ children, ...props }) {
|
|
5
|
+
return /*#__PURE__*/ react.createElement(GenericContext.Provider, {
|
|
6
|
+
value: props
|
|
7
|
+
}, children);
|
|
21
8
|
}
|
|
22
|
-
|
|
9
|
+
Provider.displayName = `${name}Provider`;
|
|
10
|
+
return {
|
|
11
|
+
Provider,
|
|
12
|
+
useHook: ()=>{
|
|
13
|
+
const context = react.useContext(GenericContext);
|
|
14
|
+
if (!context) throw Error(`Context provider for "${name}" is missing in the component tree!`);
|
|
15
|
+
return context;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
23
18
|
}
|
|
19
|
+
export { createGenericContext };
|
|
24
20
|
|
|
25
21
|
//# sourceMappingURL=createGenericContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"utils/createGenericContext.js","sources":["../../src/utils/createGenericContext.tsx"],"sourcesContent":["import React, { createContext } from \"react\";\n\nexport type CreateGenericContext<T = any> = T;\n\ntype GenericContextProviderProps<T> = T & {\n children: React.ReactNode;\n};\n\nexport function createGenericContext<T>(name: string) {\n const GenericContext = createContext<CreateGenericContext | undefined>(undefined);\n\n function Provider({ children, ...props }: GenericContextProviderProps<T>) {\n return <GenericContext.Provider value={props}>{children}</GenericContext.Provider>;\n }\n\n Provider.displayName = `${name}Provider`;\n\n return {\n Provider,\n useHook: () => {\n const context = React.useContext<CreateGenericContext<T>>(\n GenericContext as unknown as React.Context<CreateGenericContext<T>>\n );\n\n if (!context) {\n throw Error(`Context provider for \"${name}\" is missing in the component tree!`);\n }\n\n return context;\n }\n };\n}\n"],"names":["createGenericContext","name","GenericContext","createContext","undefined","Provider","children","props","context","React","Error"],"mappings":";AAQO,SAASA,qBAAwBC,IAAY;IAChD,MAAMC,iBAAiB,WAAjBA,GAAiBC,cAAgDC;IAEvE,SAASC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,OAAuC;QACpE,OAAO,WAAP,GAAO,oBAACL,eAAe,QAAQ;YAAC,OAAOK;WAAQD;IACnD;IAEAD,SAAS,WAAW,GAAG,GAAGJ,KAAK,QAAQ,CAAC;IAExC,OAAO;QACHI;QACA,SAAS;YACL,MAAMG,UAAUC,MAAAA,UAAgB,CAC5BP;YAGJ,IAAI,CAACM,SACD,MAAME,MAAM,CAAC,sBAAsB,EAAET,KAAK,mCAAmC,CAAC;YAGlF,OAAOO;QACX;IACJ;AACJ"}
|
package/utils/createHashing.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
};
|
|
1
|
+
const createHashing = (algorithm)=>async (value)=>{
|
|
2
|
+
const data = JSON.stringify(value);
|
|
3
|
+
return new Promise((resolve)=>{
|
|
4
|
+
window.crypto.subtle.digest(algorithm, new TextEncoder().encode(data)).then((encoded)=>{
|
|
5
|
+
const hexes = [];
|
|
6
|
+
const view = new DataView(encoded);
|
|
7
|
+
for(let i = 0; i < view.byteLength; i += 4)hexes.push(("00000000" + view.getUint32(i).toString(16)).slice(-8));
|
|
8
|
+
const hash = hexes.join("");
|
|
9
|
+
resolve(hash);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
export { createHashing };
|
|
17
14
|
|
|
18
15
|
//# sourceMappingURL=createHashing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"utils/createHashing.js","sources":["../../src/utils/createHashing.ts"],"sourcesContent":["export type IHashingAlgorithm = \"SHA-1\" | \"SHA-256\" | \"SHA-512\";\n\nexport const createHashing = (algorithm: IHashingAlgorithm) => {\n return async (value: unknown) => {\n const data = JSON.stringify(value);\n return new Promise<string>(resolve => {\n window.crypto.subtle.digest(algorithm, new TextEncoder().encode(data)).then(encoded => {\n const hexes: string[] = [];\n const view = new DataView(encoded);\n for (let i = 0; i < view.byteLength; i += 4) {\n hexes.push((\"00000000\" + view.getUint32(i).toString(16)).slice(-8));\n }\n const hash = hexes.join(\"\");\n resolve(hash);\n });\n });\n };\n};\n"],"names":["createHashing","algorithm","value","data","JSON","Promise","resolve","window","TextEncoder","encoded","hexes","view","DataView","i","hash"],"mappings":"AAEO,MAAMA,gBAAgB,CAACC,YACnB,OAAOC;QACV,MAAMC,OAAOC,KAAK,SAAS,CAACF;QAC5B,OAAO,IAAIG,QAAgBC,CAAAA;YACvBC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAACN,WAAW,IAAIO,cAAc,MAAM,CAACL,OAAO,IAAI,CAACM,CAAAA;gBACxE,MAAMC,QAAkB,EAAE;gBAC1B,MAAMC,OAAO,IAAIC,SAASH;gBAC1B,IAAK,IAAII,IAAI,GAAGA,IAAIF,KAAK,UAAU,EAAEE,KAAK,EACtCH,MAAM,IAAI,CAAE,cAAaC,KAAK,SAAS,CAACE,GAAG,QAAQ,CAAC,GAAE,EAAG,KAAK,CAAC;gBAEnE,MAAMC,OAAOJ,MAAM,IAAI,CAAC;gBACxBJ,QAAQQ;YACZ;QACJ;IACJ"}
|
package/utils/index.d.ts
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
export * from "./createHashing";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./getGqlApiUrl";
|
|
4
|
-
export * from "./getHeadlessCmsGqlApiUrl";
|
|
5
|
-
export * from "./getLocaleCode";
|
|
6
|
-
export * from "./getPrerenderId";
|
|
7
|
-
export * from "./getTenantId";
|
|
8
|
-
export * from "./isLocalhost";
|
|
9
|
-
export * from "./isPrerendering";
|
|
10
|
-
export * from "./legacyPluginToReactComponent";
|
|
1
|
+
export * from "./createHashing.js";
|
|
2
|
+
export * from "./legacyPluginToReactComponent.js";
|
package/utils/index.js
CHANGED
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
export * from "./createHashing";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./getGqlApiUrl";
|
|
4
|
-
export * from "./getHeadlessCmsGqlApiUrl";
|
|
5
|
-
export * from "./getLocaleCode";
|
|
6
|
-
export * from "./getPrerenderId";
|
|
7
|
-
export * from "./getTenantId";
|
|
8
|
-
export * from "./isLocalhost";
|
|
9
|
-
export * from "./isPrerendering";
|
|
10
|
-
export * from "./legacyPluginToReactComponent";
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from "./createHashing.js";
|
|
2
|
+
export * from "./legacyPluginToReactComponent.js";
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { useRegisterLegacyPlugin } from "../hooks/useRegisterLegacyPlugin";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { useRegisterLegacyPlugin } from "../hooks/useRegisterLegacyPlugin.js";
|
|
2
|
+
const legacyPluginToReactComponent = function(params) {
|
|
3
|
+
const Component = (props)=>{
|
|
4
|
+
const plugin = Object.assign({
|
|
5
|
+
type: params.pluginType
|
|
6
|
+
}, params.mapProps ? params.mapProps(props) : props);
|
|
7
|
+
useRegisterLegacyPlugin(plugin);
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
Component.displayName = params.componentDisplayName;
|
|
11
|
+
return Component;
|
|
12
12
|
};
|
|
13
|
+
export { legacyPluginToReactComponent };
|
|
13
14
|
|
|
14
15
|
//# sourceMappingURL=legacyPluginToReactComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"utils/legacyPluginToReactComponent.js","sources":["../../src/utils/legacyPluginToReactComponent.ts"],"sourcesContent":["import type React from \"react\";\nimport { useRegisterLegacyPlugin } from \"~/hooks/useRegisterLegacyPlugin.js\";\n\nexport interface LegacyPluginToReactComponentParams<TProps extends Record<string, any>> {\n pluginType: string;\n componentDisplayName: string;\n mapProps?: (props: TProps) => TProps;\n}\n\nexport const legacyPluginToReactComponent = function <TProps extends Record<string, any>>(\n params: LegacyPluginToReactComponentParams<TProps>\n) {\n const Component: React.ComponentType<TProps> = props => {\n const plugin = Object.assign(\n { type: params.pluginType },\n params.mapProps ? params.mapProps(props) : props\n );\n useRegisterLegacyPlugin(plugin);\n return null;\n };\n\n Component.displayName = params.componentDisplayName;\n\n return Component;\n};\n"],"names":["legacyPluginToReactComponent","params","Component","props","plugin","Object","useRegisterLegacyPlugin"],"mappings":";AASO,MAAMA,+BAA+B,SACxCC,MAAkD;IAElD,MAAMC,YAAyCC,CAAAA;QAC3C,MAAMC,SAASC,OAAO,MAAM,CACxB;YAAE,MAAMJ,OAAO,UAAU;QAAC,GAC1BA,OAAO,QAAQ,GAAGA,OAAO,QAAQ,CAACE,SAASA;QAE/CG,wBAAwBF;QACxB,OAAO;IACX;IAEAF,UAAU,WAAW,GAAGD,OAAO,oBAAoB;IAEnD,OAAOC;AACX"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { InMemoryCacheConfig } from "apollo-cache-inmemory";
|
|
2
|
-
import { InMemoryCache as BaseInMemoryCache } from "apollo-cache-inmemory";
|
|
3
|
-
import type { DocumentNode } from "graphql";
|
|
4
|
-
export declare class InMemoryCache extends BaseInMemoryCache {
|
|
5
|
-
private readonly transformPlugins;
|
|
6
|
-
constructor(config?: InMemoryCacheConfig);
|
|
7
|
-
transformDocument(document: DocumentNode): DocumentNode;
|
|
8
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { InMemoryCache as BaseInMemoryCache } from "apollo-cache-inmemory";
|
|
2
|
-
import { plugins } from "@webiny/plugins";
|
|
3
|
-
import { AddQuerySelectionPlugin } from "../plugins/AddQuerySelectionPlugin";
|
|
4
|
-
import { ApolloLinkPlugin } from "../plugins/ApolloLinkPlugin";
|
|
5
|
-
export class InMemoryCache extends BaseInMemoryCache {
|
|
6
|
-
constructor(config) {
|
|
7
|
-
super(config);
|
|
8
|
-
this.transformPlugins = plugins.byType(ApolloLinkPlugin.type).filter(pl => pl instanceof AddQuerySelectionPlugin);
|
|
9
|
-
}
|
|
10
|
-
transformDocument(document) {
|
|
11
|
-
// @ts-expect-error
|
|
12
|
-
const operationName = document.definitions[0].name.value;
|
|
13
|
-
for (const pl of this.transformPlugins) {
|
|
14
|
-
pl.addSelectionToQuery(operationName, document);
|
|
15
|
-
}
|
|
16
|
-
return super.transformDocument(document);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=InMemoryCache.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["InMemoryCache","BaseInMemoryCache","plugins","AddQuerySelectionPlugin","ApolloLinkPlugin","constructor","config","transformPlugins","byType","type","filter","pl","transformDocument","document","operationName","definitions","name","value","addSelectionToQuery"],"sources":["InMemoryCache.ts"],"sourcesContent":["import type { InMemoryCacheConfig } from \"apollo-cache-inmemory\";\nimport { InMemoryCache as BaseInMemoryCache } from \"apollo-cache-inmemory\";\nimport type { DocumentNode } from \"graphql\";\nimport { plugins } from \"@webiny/plugins\";\nimport { AddQuerySelectionPlugin } from \"../plugins/AddQuerySelectionPlugin\";\nimport { ApolloLinkPlugin } from \"../plugins/ApolloLinkPlugin\";\n\nexport class InMemoryCache extends BaseInMemoryCache {\n private readonly transformPlugins: AddQuerySelectionPlugin[];\n\n constructor(config?: InMemoryCacheConfig) {\n super(config);\n\n this.transformPlugins = plugins\n .byType<AddQuerySelectionPlugin>(ApolloLinkPlugin.type)\n .filter(pl => pl instanceof AddQuerySelectionPlugin);\n }\n\n public override transformDocument(document: DocumentNode): DocumentNode {\n // @ts-expect-error\n const operationName = document.definitions[0].name.value;\n\n for (const pl of this.transformPlugins) {\n pl.addSelectionToQuery(operationName, document);\n }\n\n return super.transformDocument(document);\n }\n}\n"],"mappings":"AACA,SAASA,aAAa,IAAIC,iBAAiB,QAAQ,uBAAuB;AAE1E,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,uBAAuB;AAChC,SAASC,gBAAgB;AAEzB,OAAO,MAAMJ,aAAa,SAASC,iBAAiB,CAAC;EAGjDI,WAAWA,CAACC,MAA4B,EAAE;IACtC,KAAK,CAACA,MAAM,CAAC;IAEb,IAAI,CAACC,gBAAgB,GAAGL,OAAO,CAC1BM,MAAM,CAA0BJ,gBAAgB,CAACK,IAAI,CAAC,CACtDC,MAAM,CAACC,EAAE,IAAIA,EAAE,YAAYR,uBAAuB,CAAC;EAC5D;EAEgBS,iBAAiBA,CAACC,QAAsB,EAAgB;IACpE;IACA,MAAMC,aAAa,GAAGD,QAAQ,CAACE,WAAW,CAAC,CAAC,CAAC,CAACC,IAAI,CAACC,KAAK;IAExD,KAAK,MAAMN,EAAE,IAAI,IAAI,CAACJ,gBAAgB,EAAE;MACpCI,EAAE,CAACO,mBAAmB,CAACJ,aAAa,EAAED,QAAQ,CAAC;IACnD;IAEA,OAAO,KAAK,CAACD,iBAAiB,CAACC,QAAQ,CAAC;EAC5C;AACJ","ignoreList":[]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { IdValue } from "apollo-utilities";
|
|
2
|
-
import type { ReadStoreContext, FragmentMatcherInterface, IntrospectionResultData } from "apollo-cache-inmemory";
|
|
3
|
-
export declare class IntrospectionFragmentMatcher implements FragmentMatcherInterface {
|
|
4
|
-
private readonly isReady;
|
|
5
|
-
private readonly possibleTypesMap;
|
|
6
|
-
constructor(options?: {
|
|
7
|
-
introspectionQueryResultData?: IntrospectionResultData;
|
|
8
|
-
});
|
|
9
|
-
match(idValue: IdValue, typeCondition: string, context: ReadStoreContext): boolean;
|
|
10
|
-
private parseIntrospectionResult;
|
|
11
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { invariant } from "ts-invariant";
|
|
2
|
-
export class IntrospectionFragmentMatcher {
|
|
3
|
-
possibleTypesMap = {};
|
|
4
|
-
constructor(options) {
|
|
5
|
-
if (options && options.introspectionQueryResultData) {
|
|
6
|
-
this.possibleTypesMap = this.parseIntrospectionResult(options.introspectionQueryResultData);
|
|
7
|
-
this.isReady = true;
|
|
8
|
-
} else {
|
|
9
|
-
this.isReady = false;
|
|
10
|
-
}
|
|
11
|
-
this.match = this.match.bind(this);
|
|
12
|
-
}
|
|
13
|
-
match(idValue, typeCondition, context) {
|
|
14
|
-
invariant(this.isReady, "FragmentMatcher.match() was called before FragmentMatcher.init()");
|
|
15
|
-
const obj = context.store.get(idValue.id);
|
|
16
|
-
const isRootQuery = idValue.id === "ROOT_QUERY";
|
|
17
|
-
if (!obj) {
|
|
18
|
-
// https://github.com/apollographql/apollo-client/pull/4620
|
|
19
|
-
return isRootQuery;
|
|
20
|
-
}
|
|
21
|
-
const {
|
|
22
|
-
__typename = isRootQuery && "Query"
|
|
23
|
-
} = obj;
|
|
24
|
-
invariant(__typename, `Cannot match fragment because __typename property is missing: ${JSON.stringify(obj)}`);
|
|
25
|
-
if (__typename === typeCondition) {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
const implementingTypes = this.possibleTypesMap[typeCondition];
|
|
29
|
-
if (__typename && implementingTypes && implementingTypes.indexOf(__typename) > -1) {
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
parseIntrospectionResult(introspectionResultData) {
|
|
35
|
-
const typeMap = {};
|
|
36
|
-
introspectionResultData.__schema.types.forEach(type => {
|
|
37
|
-
if (type.kind === "UNION" || type.kind === "INTERFACE") {
|
|
38
|
-
typeMap[type.name] = type.possibleTypes.map(implementingType => implementingType.name);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
return typeMap;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
//# sourceMappingURL=IntrospectionFragmentMatcher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["invariant","IntrospectionFragmentMatcher","possibleTypesMap","constructor","options","introspectionQueryResultData","parseIntrospectionResult","isReady","match","bind","idValue","typeCondition","context","obj","store","get","id","isRootQuery","__typename","JSON","stringify","implementingTypes","indexOf","introspectionResultData","typeMap","__schema","types","forEach","type","kind","name","possibleTypes","map","implementingType"],"sources":["IntrospectionFragmentMatcher.ts"],"sourcesContent":["import type { IdValue } from \"apollo-utilities\";\nimport { invariant } from \"ts-invariant\";\n\nimport type {\n ReadStoreContext,\n FragmentMatcherInterface,\n PossibleTypesMap,\n IntrospectionResultData\n} from \"apollo-cache-inmemory\";\n\nexport class IntrospectionFragmentMatcher implements FragmentMatcherInterface {\n private readonly isReady: boolean;\n private readonly possibleTypesMap: PossibleTypesMap = {};\n\n constructor(options?: { introspectionQueryResultData?: IntrospectionResultData }) {\n if (options && options.introspectionQueryResultData) {\n this.possibleTypesMap = this.parseIntrospectionResult(\n options.introspectionQueryResultData\n );\n this.isReady = true;\n } else {\n this.isReady = false;\n }\n\n this.match = this.match.bind(this);\n }\n\n public match(idValue: IdValue, typeCondition: string, context: ReadStoreContext) {\n invariant(this.isReady, \"FragmentMatcher.match() was called before FragmentMatcher.init()\");\n\n const obj = context.store.get(idValue.id);\n const isRootQuery = idValue.id === \"ROOT_QUERY\";\n\n if (!obj) {\n // https://github.com/apollographql/apollo-client/pull/4620\n return isRootQuery;\n }\n\n const { __typename = isRootQuery && \"Query\" } = obj;\n\n invariant(\n __typename,\n `Cannot match fragment because __typename property is missing: ${JSON.stringify(obj)}`\n );\n\n if (__typename === typeCondition) {\n return true;\n }\n\n const implementingTypes = this.possibleTypesMap[typeCondition];\n if (__typename && implementingTypes && implementingTypes.indexOf(__typename) > -1) {\n return true;\n }\n\n return false;\n }\n\n private parseIntrospectionResult(\n introspectionResultData: IntrospectionResultData\n ): PossibleTypesMap {\n const typeMap: PossibleTypesMap = {};\n introspectionResultData.__schema.types.forEach(type => {\n if (type.kind === \"UNION\" || type.kind === \"INTERFACE\") {\n typeMap[type.name] = type.possibleTypes.map(\n implementingType => implementingType.name\n );\n }\n });\n return typeMap;\n }\n}\n"],"mappings":"AACA,SAASA,SAAS,QAAQ,cAAc;AASxC,OAAO,MAAMC,4BAA4B,CAAqC;EAEzDC,gBAAgB,GAAqB,CAAC,CAAC;EAExDC,WAAWA,CAACC,OAAoE,EAAE;IAC9E,IAAIA,OAAO,IAAIA,OAAO,CAACC,4BAA4B,EAAE;MACjD,IAAI,CAACH,gBAAgB,GAAG,IAAI,CAACI,wBAAwB,CACjDF,OAAO,CAACC,4BACZ,CAAC;MACD,IAAI,CAACE,OAAO,GAAG,IAAI;IACvB,CAAC,MAAM;MACH,IAAI,CAACA,OAAO,GAAG,KAAK;IACxB;IAEA,IAAI,CAACC,KAAK,GAAG,IAAI,CAACA,KAAK,CAACC,IAAI,CAAC,IAAI,CAAC;EACtC;EAEOD,KAAKA,CAACE,OAAgB,EAAEC,aAAqB,EAAEC,OAAyB,EAAE;IAC7EZ,SAAS,CAAC,IAAI,CAACO,OAAO,EAAE,kEAAkE,CAAC;IAE3F,MAAMM,GAAG,GAAGD,OAAO,CAACE,KAAK,CAACC,GAAG,CAACL,OAAO,CAACM,EAAE,CAAC;IACzC,MAAMC,WAAW,GAAGP,OAAO,CAACM,EAAE,KAAK,YAAY;IAE/C,IAAI,CAACH,GAAG,EAAE;MACN;MACA,OAAOI,WAAW;IACtB;IAEA,MAAM;MAAEC,UAAU,GAAGD,WAAW,IAAI;IAAQ,CAAC,GAAGJ,GAAG;IAEnDb,SAAS,CACLkB,UAAU,EACV,iEAAiEC,IAAI,CAACC,SAAS,CAACP,GAAG,CAAC,EACxF,CAAC;IAED,IAAIK,UAAU,KAAKP,aAAa,EAAE;MAC9B,OAAO,IAAI;IACf;IAEA,MAAMU,iBAAiB,GAAG,IAAI,CAACnB,gBAAgB,CAACS,aAAa,CAAC;IAC9D,IAAIO,UAAU,IAAIG,iBAAiB,IAAIA,iBAAiB,CAACC,OAAO,CAACJ,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE;MAC/E,OAAO,IAAI;IACf;IAEA,OAAO,KAAK;EAChB;EAEQZ,wBAAwBA,CAC5BiB,uBAAgD,EAChC;IAChB,MAAMC,OAAyB,GAAG,CAAC,CAAC;IACpCD,uBAAuB,CAACE,QAAQ,CAACC,KAAK,CAACC,OAAO,CAACC,IAAI,IAAI;MACnD,IAAIA,IAAI,CAACC,IAAI,KAAK,OAAO,IAAID,IAAI,CAACC,IAAI,KAAK,WAAW,EAAE;QACpDL,OAAO,CAACI,IAAI,CAACE,IAAI,CAAC,GAAGF,IAAI,CAACG,aAAa,CAACC,GAAG,CACvCC,gBAAgB,IAAIA,gBAAgB,CAACH,IACzC,CAAC;MACL;IACJ,CAAC,CAAC;IACF,OAAON,OAAO;EAClB;AACJ","ignoreList":[]}
|
package/components/Routes.d.ts
DELETED
package/components/Routes.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// This file is necessary only for backwards compatibility.
|
|
2
|
-
// We'll remove this once the legacy rendering engine is removed.
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { plugins } from "@webiny/plugins";
|
|
5
|
-
import { Routes as ReactRouterRoutes } from "@webiny/react-router";
|
|
6
|
-
export const Routes = () => {
|
|
7
|
-
// We cannot call `sort` on the array returned by the `plugins.byType` call - it is read-only.
|
|
8
|
-
const routes = [...plugins.byType("route")].sort((a, b) => {
|
|
9
|
-
const pathA = a.route.props.path || "*";
|
|
10
|
-
const pathB = b.route.props.path || "*";
|
|
11
|
-
|
|
12
|
-
// This will sort paths at the very bottom of the list
|
|
13
|
-
if (pathA === "/" && pathB === "*") {
|
|
14
|
-
return -1;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// This will push * and / to the bottom of the list
|
|
18
|
-
if (pathA === "*" || pathA === "/") {
|
|
19
|
-
return 1;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// This will push * and / to the bottom of the list
|
|
23
|
-
if (["*", "/"].includes(pathB)) {
|
|
24
|
-
return -1;
|
|
25
|
-
}
|
|
26
|
-
return 0;
|
|
27
|
-
});
|
|
28
|
-
return /*#__PURE__*/React.createElement(ReactRouterRoutes, null, routes.map(({
|
|
29
|
-
route,
|
|
30
|
-
name
|
|
31
|
-
}) => /*#__PURE__*/React.cloneElement(route, {
|
|
32
|
-
key: name
|
|
33
|
-
})));
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
//# sourceMappingURL=Routes.js.map
|
package/components/Routes.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","plugins","Routes","ReactRouterRoutes","routes","byType","sort","a","b","pathA","route","props","path","pathB","includes","createElement","map","name","cloneElement","key"],"sources":["Routes.tsx"],"sourcesContent":["// This file is necessary only for backwards compatibility.\n// We'll remove this once the legacy rendering engine is removed.\nimport React from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Routes as ReactRouterRoutes } from \"@webiny/react-router\";\nimport type { RoutePlugin } from \"../types\";\n\nexport const Routes = () => {\n // We cannot call `sort` on the array returned by the `plugins.byType` call - it is read-only.\n const routes = [...plugins.byType<RoutePlugin>(\"route\")].sort((a, b) => {\n const pathA = a.route.props.path || \"*\";\n const pathB = b.route.props.path || \"*\";\n\n // This will sort paths at the very bottom of the list\n if (pathA === \"/\" && pathB === \"*\") {\n return -1;\n }\n\n // This will push * and / to the bottom of the list\n if (pathA === \"*\" || pathA === \"/\") {\n return 1;\n }\n\n // This will push * and / to the bottom of the list\n if ([\"*\", \"/\"].includes(pathB)) {\n return -1;\n }\n\n return 0;\n });\n\n return (\n <ReactRouterRoutes>\n {routes.map(({ route, name }) => React.cloneElement(route, { key: name }))}\n </ReactRouterRoutes>\n );\n};\n"],"mappings":"AAAA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,MAAM,IAAIC,iBAAiB,QAAQ,sBAAsB;AAGlE,OAAO,MAAMD,MAAM,GAAGA,CAAA,KAAM;EACxB;EACA,MAAME,MAAM,GAAG,CAAC,GAAGH,OAAO,CAACI,MAAM,CAAc,OAAO,CAAC,CAAC,CAACC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAK;IACpE,MAAMC,KAAK,GAAGF,CAAC,CAACG,KAAK,CAACC,KAAK,CAACC,IAAI,IAAI,GAAG;IACvC,MAAMC,KAAK,GAAGL,CAAC,CAACE,KAAK,CAACC,KAAK,CAACC,IAAI,IAAI,GAAG;;IAEvC;IACA,IAAIH,KAAK,KAAK,GAAG,IAAII,KAAK,KAAK,GAAG,EAAE;MAChC,OAAO,CAAC,CAAC;IACb;;IAEA;IACA,IAAIJ,KAAK,KAAK,GAAG,IAAIA,KAAK,KAAK,GAAG,EAAE;MAChC,OAAO,CAAC;IACZ;;IAEA;IACA,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAACK,QAAQ,CAACD,KAAK,CAAC,EAAE;MAC5B,OAAO,CAAC,CAAC;IACb;IAEA,OAAO,CAAC;EACZ,CAAC,CAAC;EAEF,oBACIb,KAAA,CAAAe,aAAA,CAACZ,iBAAiB,QACbC,MAAM,CAACY,GAAG,CAAC,CAAC;IAAEN,KAAK;IAAEO;EAAK,CAAC,kBAAKjB,KAAK,CAACkB,YAAY,CAACR,KAAK,EAAE;IAAES,GAAG,EAAEF;EAAK,CAAC,CAAC,CAC1D,CAAC;AAE5B,CAAC","ignoreList":[]}
|
package/components/View.d.ts
DELETED
package/components/View.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from "react";
|
|
2
|
-
import { plugins } from "@webiny/plugins";
|
|
3
|
-
import { ViewPlugin } from "../plugins/ViewPlugin";
|
|
4
|
-
export const View = ({
|
|
5
|
-
name,
|
|
6
|
-
children,
|
|
7
|
-
props = {}
|
|
8
|
-
}) => {
|
|
9
|
-
const viewPlugins = plugins.byType(ViewPlugin.type).filter(pl => pl.key === name);
|
|
10
|
-
if (viewPlugins.length) {
|
|
11
|
-
children = viewPlugins.reduce((el, pl) => pl.render({
|
|
12
|
-
children: el,
|
|
13
|
-
...props
|
|
14
|
-
}), children);
|
|
15
|
-
}
|
|
16
|
-
return /*#__PURE__*/React.createElement(Fragment, null, children || null);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=View.js.map
|
package/components/View.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","Fragment","plugins","ViewPlugin","View","name","children","props","viewPlugins","byType","type","filter","pl","key","length","reduce","el","render","createElement"],"sources":["View.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { ViewPlugin } from \"../plugins/ViewPlugin\";\n\ninterface Props {\n name: string;\n props?: Record<string, any>;\n children?: React.ReactNode;\n}\n\nexport const View = ({ name, children, props = {} }: Props) => {\n const viewPlugins = plugins.byType<ViewPlugin>(ViewPlugin.type).filter(pl => pl.key === name);\n\n if (viewPlugins.length) {\n children = viewPlugins.reduce((el, pl) => pl.render({ children: el, ...props }), children);\n }\n\n return <Fragment>{children || null}</Fragment>;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,UAAU;AAQnB,OAAO,MAAMC,IAAI,GAAGA,CAAC;EAAEC,IAAI;EAAEC,QAAQ;EAAEC,KAAK,GAAG,CAAC;AAAS,CAAC,KAAK;EAC3D,MAAMC,WAAW,GAAGN,OAAO,CAACO,MAAM,CAAaN,UAAU,CAACO,IAAI,CAAC,CAACC,MAAM,CAACC,EAAE,IAAIA,EAAE,CAACC,GAAG,KAAKR,IAAI,CAAC;EAE7F,IAAIG,WAAW,CAACM,MAAM,EAAE;IACpBR,QAAQ,GAAGE,WAAW,CAACO,MAAM,CAAC,CAACC,EAAE,EAAEJ,EAAE,KAAKA,EAAE,CAACK,MAAM,CAAC;MAAEX,QAAQ,EAAEU,EAAE;MAAE,GAAGT;IAAM,CAAC,CAAC,EAAED,QAAQ,CAAC;EAC9F;EAEA,oBAAON,KAAA,CAAAkB,aAAA,CAACjB,QAAQ,QAAEK,QAAQ,IAAI,IAAe,CAAC;AAClD,CAAC","ignoreList":[]}
|
package/components/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Image","Routes"],"sources":["index.ts"],"sourcesContent":["export { Image } from \"./Image\";\nexport { Routes } from \"./Routes\";\n"],"mappings":"AAAA,SAASA,KAAK;AACd,SAASC,MAAM","ignoreList":[]}
|
package/core/DebounceRender.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface Props {
|
|
3
|
-
wait?: number;
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* We need to debounce the rendering of children during app bootstrap, since many plugins
|
|
8
|
-
* can add more and more Providers which will recompose the entire hierarchy of React Context providers.
|
|
9
|
-
* During this stage, we don't want to render anything.
|
|
10
|
-
*/
|
|
11
|
-
export declare const DebounceRender: ({ wait, children }: Props) => React.JSX.Element;
|
|
12
|
-
export {};
|
package/core/DebounceRender.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { useEffect, useMemo, useState } from "react";
|
|
3
|
-
import debounce from "lodash/debounce";
|
|
4
|
-
/**
|
|
5
|
-
* We need to debounce the rendering of children during app bootstrap, since many plugins
|
|
6
|
-
* can add more and more Providers which will recompose the entire hierarchy of React Context providers.
|
|
7
|
-
* During this stage, we don't want to render anything.
|
|
8
|
-
*/
|
|
9
|
-
export const DebounceRender = ({
|
|
10
|
-
wait = 50,
|
|
11
|
-
children
|
|
12
|
-
}) => {
|
|
13
|
-
const [render, setRender] = useState(wait === 0);
|
|
14
|
-
const debouncedRender = useMemo(() => {
|
|
15
|
-
return debounce(() => {
|
|
16
|
-
setRender(true);
|
|
17
|
-
}, wait);
|
|
18
|
-
}, [setRender]);
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (render) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
debouncedRender();
|
|
24
|
-
return () => {
|
|
25
|
-
debouncedRender.cancel();
|
|
26
|
-
};
|
|
27
|
-
}, []);
|
|
28
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, render ? children : null);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=DebounceRender.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useMemo","useState","debounce","DebounceRender","wait","children","render","setRender","debouncedRender","cancel","createElement","Fragment"],"sources":["DebounceRender.tsx"],"sourcesContent":["import React from \"react\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport debounce from \"lodash/debounce\";\n\ninterface Props {\n wait?: number;\n children?: React.ReactNode;\n}\n/**\n * We need to debounce the rendering of children during app bootstrap, since many plugins\n * can add more and more Providers which will recompose the entire hierarchy of React Context providers.\n * During this stage, we don't want to render anything.\n */\nexport const DebounceRender = ({ wait = 50, children }: Props) => {\n const [render, setRender] = useState(wait === 0);\n\n const debouncedRender = useMemo(() => {\n return debounce(() => {\n setRender(true);\n }, wait);\n }, [setRender]);\n\n useEffect(() => {\n if (render) {\n return;\n }\n\n debouncedRender();\n\n return () => {\n debouncedRender.cancel();\n };\n }, []);\n\n return <>{render ? children : null}</>;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACpD,OAAOC,QAAQ,MAAM,iBAAiB;AAMtC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAGA,CAAC;EAAEC,IAAI,GAAG,EAAE;EAAEC;AAAgB,CAAC,KAAK;EAC9D,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGN,QAAQ,CAACG,IAAI,KAAK,CAAC,CAAC;EAEhD,MAAMI,eAAe,GAAGR,OAAO,CAAC,MAAM;IAClC,OAAOE,QAAQ,CAAC,MAAM;MAClBK,SAAS,CAAC,IAAI,CAAC;IACnB,CAAC,EAAEH,IAAI,CAAC;EACZ,CAAC,EAAE,CAACG,SAAS,CAAC,CAAC;EAEfR,SAAS,CAAC,MAAM;IACZ,IAAIO,MAAM,EAAE;MACR;IACJ;IAEAE,eAAe,CAAC,CAAC;IAEjB,OAAO,MAAM;MACTA,eAAe,CAACC,MAAM,CAAC,CAAC;IAC5B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,oBAAOX,KAAA,CAAAY,aAAA,CAAAZ,KAAA,CAAAa,QAAA,QAAGL,MAAM,GAAGD,QAAQ,GAAG,IAAO,CAAC;AAC1C,CAAC","ignoreList":[]}
|
package/core/Routes.d.ts
DELETED
package/core/Routes.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { plugins } from "@webiny/plugins";
|
|
3
|
-
import { Routes as ReactRouterRoutes } from "@webiny/react-router";
|
|
4
|
-
export const Routes = props => {
|
|
5
|
-
const routes = [...props.routes,
|
|
6
|
-
// For backwards compatibility, we need to support the RoutePlugin routes as well.
|
|
7
|
-
...plugins.byType("route").map(({
|
|
8
|
-
route
|
|
9
|
-
}) => route)].sort((a, b) => {
|
|
10
|
-
const pathA = a.props.path || "*";
|
|
11
|
-
const pathB = b.props.path || "*";
|
|
12
|
-
|
|
13
|
-
// This will sort paths at the very bottom of the list
|
|
14
|
-
if (pathA === "/" && pathB === "*") {
|
|
15
|
-
return -1;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// This will push * and / to the bottom of the list
|
|
19
|
-
if (pathA === "*" || pathA === "/") {
|
|
20
|
-
return 1;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// This will push * and / to the bottom of the list
|
|
24
|
-
if (["*", "/"].includes(pathB)) {
|
|
25
|
-
return -1;
|
|
26
|
-
}
|
|
27
|
-
return 0;
|
|
28
|
-
});
|
|
29
|
-
return /*#__PURE__*/React.createElement(ReactRouterRoutes, null, routes.map((route, index) => /*#__PURE__*/React.cloneElement(route, {
|
|
30
|
-
key: `${route.props.path}:${index}`
|
|
31
|
-
})));
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=Routes.js.map
|
package/core/Routes.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","plugins","Routes","ReactRouterRoutes","props","routes","byType","map","route","sort","a","b","pathA","path","pathB","includes","createElement","index","cloneElement","key"],"sources":["Routes.tsx"],"sourcesContent":["import React from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Routes as ReactRouterRoutes } from \"@webiny/react-router\";\nimport type { RoutePlugin } from \"~/types\";\n\ninterface RoutesProps {\n routes: JSX.Element[];\n}\n\nexport const Routes = (props: RoutesProps) => {\n const routes = [\n ...props.routes,\n // For backwards compatibility, we need to support the RoutePlugin routes as well.\n ...plugins.byType<RoutePlugin>(\"route\").map(({ route }) => route)\n ].sort((a, b) => {\n const pathA = a.props.path || \"*\";\n const pathB = b.props.path || \"*\";\n\n // This will sort paths at the very bottom of the list\n if (pathA === \"/\" && pathB === \"*\") {\n return -1;\n }\n\n // This will push * and / to the bottom of the list\n if (pathA === \"*\" || pathA === \"/\") {\n return 1;\n }\n\n // This will push * and / to the bottom of the list\n if ([\"*\", \"/\"].includes(pathB)) {\n return -1;\n }\n\n return 0;\n });\n\n return (\n <ReactRouterRoutes>\n {routes.map((route, index) =>\n React.cloneElement(route, { key: `${route.props.path}:${index}` })\n )}\n </ReactRouterRoutes>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,MAAM,IAAIC,iBAAiB,QAAQ,sBAAsB;AAOlE,OAAO,MAAMD,MAAM,GAAIE,KAAkB,IAAK;EAC1C,MAAMC,MAAM,GAAG,CACX,GAAGD,KAAK,CAACC,MAAM;EACf;EACA,GAAGJ,OAAO,CAACK,MAAM,CAAc,OAAO,CAAC,CAACC,GAAG,CAAC,CAAC;IAAEC;EAAM,CAAC,KAAKA,KAAK,CAAC,CACpE,CAACC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAK;IACb,MAAMC,KAAK,GAAGF,CAAC,CAACN,KAAK,CAACS,IAAI,IAAI,GAAG;IACjC,MAAMC,KAAK,GAAGH,CAAC,CAACP,KAAK,CAACS,IAAI,IAAI,GAAG;;IAEjC;IACA,IAAID,KAAK,KAAK,GAAG,IAAIE,KAAK,KAAK,GAAG,EAAE;MAChC,OAAO,CAAC,CAAC;IACb;;IAEA;IACA,IAAIF,KAAK,KAAK,GAAG,IAAIA,KAAK,KAAK,GAAG,EAAE;MAChC,OAAO,CAAC;IACZ;;IAEA;IACA,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAACG,QAAQ,CAACD,KAAK,CAAC,EAAE;MAC5B,OAAO,CAAC,CAAC;IACb;IAEA,OAAO,CAAC;EACZ,CAAC,CAAC;EAEF,oBACId,KAAA,CAAAgB,aAAA,CAACb,iBAAiB,QACbE,MAAM,CAACE,GAAG,CAAC,CAACC,KAAK,EAAES,KAAK,kBACrBjB,KAAK,CAACkB,YAAY,CAACV,KAAK,EAAE;IAAEW,GAAG,EAAE,GAAGX,KAAK,CAACJ,KAAK,CAACS,IAAI,IAAII,KAAK;EAAG,CAAC,CACrE,CACe,CAAC;AAE5B,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useAutocomplete } from "./useAutocomplete";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useAutocomplete"],"sources":["index.ts"],"sourcesContent":["export { useAutocomplete } from \"./useAutocomplete\";\n"],"mappings":"AAAA,SAASA,eAAe","ignoreList":[]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { DocumentNode } from "graphql";
|
|
2
|
-
interface UseAutocompleteHook {
|
|
3
|
-
options: any[];
|
|
4
|
-
onInput(value: string): void;
|
|
5
|
-
}
|
|
6
|
-
interface Props {
|
|
7
|
-
query: DocumentNode;
|
|
8
|
-
search?: string | ((value: string) => string);
|
|
9
|
-
}
|
|
10
|
-
export declare const useAutocomplete: (props: Props) => UseAutocompleteHook;
|
|
11
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { useDataList } from "../useDataList";
|
|
2
|
-
import debounce from "lodash/debounce";
|
|
3
|
-
export const useAutocomplete = props => {
|
|
4
|
-
const dataList = useDataList({
|
|
5
|
-
useRouter: false,
|
|
6
|
-
...props
|
|
7
|
-
});
|
|
8
|
-
return {
|
|
9
|
-
options: dataList.data || [],
|
|
10
|
-
onInput: debounce(query => {
|
|
11
|
-
if (!query) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
let search = props.search || query;
|
|
15
|
-
if (typeof search === "function") {
|
|
16
|
-
search = search(query);
|
|
17
|
-
}
|
|
18
|
-
dataList.setSearch(search);
|
|
19
|
-
}, 250)
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=useAutocomplete.js.map
|