@webiny/app 6.3.0 → 6.4.0-beta.1
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.js +70 -77
- package/App.js.map +1 -1
- package/AppContainer.js +3 -6
- package/AppContainer.js.map +1 -1
- package/apollo-client/InMemoryCache.js +11 -13
- package/apollo-client/InMemoryCache.js.map +1 -1
- package/apollo-client/IntrospectionFragmentMatcher.js +26 -38
- package/apollo-client/IntrospectionFragmentMatcher.js.map +1 -1
- package/components/Image.js +11 -17
- package/components/Image.js.map +1 -1
- package/components/index.js +0 -2
- package/config/RouterConfig/Route.js +23 -28
- package/config/RouterConfig/Route.js.map +1 -1
- package/config/RouterConfig.js +11 -10
- 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.js +7 -9
- package/core/Plugin.js.map +1 -1
- package/core/Plugins.js +15 -34
- package/core/Plugins.js.map +1 -1
- package/core/Provider.js +5 -13
- package/core/Provider.js.map +1 -1
- package/core/createProvider.js +3 -6
- package/core/createProvider.js.map +1 -1
- package/core/createProviderPlugin.js +8 -13
- package/core/createProviderPlugin.js.map +1 -1
- package/errors/AuthenticationErrorEvent.js +8 -5
- package/errors/AuthenticationErrorEvent.js.map +1 -1
- package/errors/NetworkErrorEvent.js +8 -5
- package/errors/NetworkErrorEvent.js.map +1 -1
- package/errors/abstractions.js +3 -2
- package/errors/abstractions.js.map +1 -1
- package/errors/index.js +1 -4
- package/exports/admin/env-config.js +0 -2
- package/exports/admin/graphql-client.js +0 -2
- package/exports/admin/local-storage.js +0 -2
- package/exports/admin/router.js +0 -2
- package/exports/admin/security.js +0 -2
- package/exports/admin.js +0 -2
- package/features/envConfig/EnvConfig.js +12 -13
- package/features/envConfig/EnvConfig.js.map +1 -1
- package/features/envConfig/abstractions.js +2 -1
- package/features/envConfig/abstractions.js.map +1 -1
- package/features/envConfig/feature.js +9 -8
- package/features/envConfig/feature.js.map +1 -1
- package/features/envConfig/index.js +0 -2
- package/features/eventPublisher/EventPublisher.js +13 -21
- package/features/eventPublisher/EventPublisher.js.map +1 -1
- package/features/eventPublisher/abstractions.js +7 -9
- package/features/eventPublisher/abstractions.js.map +1 -1
- package/features/eventPublisher/feature.js +13 -12
- package/features/eventPublisher/feature.js.map +1 -1
- package/features/eventPublisher/index.js +1 -3
- package/features/graphqlClient/AuthenticationErrorPublishing.js +26 -26
- package/features/graphqlClient/AuthenticationErrorPublishing.js.map +1 -1
- package/features/graphqlClient/BatchingGraphQLClient.js +104 -149
- package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -1
- package/features/graphqlClient/FetchGraphQLClient.js +41 -48
- package/features/graphqlClient/FetchGraphQLClient.js.map +1 -1
- package/features/graphqlClient/NetworkErrorPublishing.js +35 -42
- package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -1
- package/features/graphqlClient/RequestValue.js +42 -41
- package/features/graphqlClient/RequestValue.js.map +1 -1
- package/features/graphqlClient/RetryGraphQLClient.js +36 -45
- package/features/graphqlClient/RetryGraphQLClient.js.map +1 -1
- package/features/graphqlClient/__tests__/GraphQLClient.test.js +383 -356
- package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -1
- package/features/graphqlClient/abstractions.js +2 -1
- package/features/graphqlClient/abstractions.js.map +1 -1
- package/features/graphqlClient/feature.js +14 -20
- package/features/graphqlClient/feature.js.map +1 -1
- package/features/graphqlClient/index.js +0 -2
- package/features/graphqlClient/types.js +0 -3
- package/features/localStorage/BrowserLocalStorageGateway.js +56 -63
- package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -1
- package/features/localStorage/LocalStorage.js +27 -24
- package/features/localStorage/LocalStorage.js.map +1 -1
- package/features/localStorage/LocalStorageRepository.js +75 -88
- package/features/localStorage/LocalStorageRepository.js.map +1 -1
- package/features/localStorage/abstractions.js +5 -16
- package/features/localStorage/abstractions.js.map +1 -1
- package/features/localStorage/feature.js +17 -28
- package/features/localStorage/feature.js.map +1 -1
- package/features/localStorage/index.js +1 -3
- package/features/mainGraphQLClient/MainGraphQLClient.js +18 -14
- package/features/mainGraphQLClient/MainGraphQLClient.js.map +1 -1
- package/features/mainGraphQLClient/abstractions.js +2 -1
- package/features/mainGraphQLClient/abstractions.js.map +1 -1
- package/features/mainGraphQLClient/feature.js +11 -10
- package/features/mainGraphQLClient/feature.js.map +1 -1
- package/features/mainGraphQLClient/index.js +0 -2
- package/features/router/HistoryRouterGateway.js +75 -105
- package/features/router/HistoryRouterGateway.js.map +1 -1
- package/features/router/HistoryRouterGateway.test.js +184 -193
- package/features/router/HistoryRouterGateway.test.js.map +1 -1
- package/features/router/Route.js +38 -54
- package/features/router/Route.js.map +1 -1
- package/features/router/RouteUrl.js +84 -217
- package/features/router/RouteUrl.js.map +1 -1
- package/features/router/Router.js +67 -124
- package/features/router/Router.js.map +1 -1
- package/features/router/RouterPresenter.js +44 -49
- package/features/router/RouterPresenter.js.map +1 -1
- package/features/router/RouterRepository.js +103 -111
- package/features/router/RouterRepository.js.map +1 -1
- package/features/router/RouterRepository.test.js +119 -150
- package/features/router/RouterRepository.test.js.map +1 -1
- package/features/router/abstractions.js +4 -14
- package/features/router/abstractions.js.map +1 -1
- package/features/router/feature.js +13 -12
- package/features/router/feature.js.map +1 -1
- package/features/router/index.js +1 -3
- package/helpers/InterfaceGenerator/date.js +0 -3
- package/helpers/InterfaceGenerator/id.js +0 -3
- package/helpers/InterfaceGenerator/identity.js +0 -3
- package/helpers/InterfaceGenerator/index.js +0 -3
- package/helpers/InterfaceGenerator/numeric.js +0 -3
- package/helpers/InterfaceGenerator/truthful.js +0 -3
- package/hooks/useAutocomplete/index.js +0 -2
- package/hooks/useAutocomplete/useAutocomplete.js +12 -15
- package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
- package/hooks/useDataList/functions/getData.js +2 -1
- package/hooks/useDataList/functions/getData.js.map +1 -1
- package/hooks/useDataList/functions/getError.js +2 -1
- package/hooks/useDataList/functions/getError.js.map +1 -1
- package/hooks/useDataList/functions/getMeta.js +2 -1
- package/hooks/useDataList/functions/getMeta.js.map +1 -1
- package/hooks/useDataList/functions/index.js +0 -2
- package/hooks/useDataList/functions/searchDataByKey.js +9 -14
- package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
- package/hooks/useDataList/index.js +0 -2
- package/hooks/useDataList/useDataList.js +131 -152
- package/hooks/useDataList/useDataList.js.map +1 -1
- package/hooks/useDataList/utils/index.js +0 -2
- package/hooks/useDataList/utils/prepareLoadListParams.js +25 -34
- package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
- 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.js +7 -6
- package/hooks/useRegisterLegacyPlugin.js.map +1 -1
- package/hooks/useUi.js +2 -3
- package/hooks/useUi.js.map +1 -1
- package/i18n/i18n.js +8 -4
- package/i18n/i18n.js.map +1 -1
- package/i18n/index.js +0 -2
- package/index.js +6 -11
- package/package.json +14 -16
- package/plugins/AddQuerySelectionPlugin.js +36 -61
- package/plugins/AddQuerySelectionPlugin.js.map +1 -1
- package/plugins/ApolloCacheObjectIdPlugin.js +12 -11
- package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
- package/plugins/ApolloDynamicLink.js +20 -22
- package/plugins/ApolloDynamicLink.js.map +1 -1
- package/plugins/ApolloLinkPlugin.js +16 -15
- package/plugins/ApolloLinkPlugin.js.map +1 -1
- package/plugins/ConsoleLinkPlugin.js +19 -21
- package/plugins/ConsoleLinkPlugin.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +39 -45
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js +18 -22
- package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js +21 -29
- package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +6 -15
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/Typography.js +9 -14
- package/plugins/NetworkErrorLinkPlugin/Typography.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js +19 -0
- package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js.map +1 -0
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +11 -18
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin.js +41 -58
- package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
- package/plugins/OmitTypenameLinkPlugin.js +9 -14
- package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
- package/plugins/TenantHeaderLinkPlugin.js +23 -32
- package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
- package/plugins/components/Image.js +8 -15
- package/plugins/components/Image.js.map +1 -1
- package/plugins/image.js +94 -133
- package/plugins/image.js.map +1 -1
- package/plugins/index.js +35 -59
- package/plugins/index.js.map +1 -1
- package/presentation/envConfig/useEnvConfig.js +4 -8
- package/presentation/envConfig/useEnvConfig.js.map +1 -1
- package/presentation/localStorage/index.js +0 -2
- package/presentation/localStorage/useLocalStorage.js +10 -16
- package/presentation/localStorage/useLocalStorage.js.map +1 -1
- package/presentation/localStorage/useLocalStorageValue.js +15 -13
- package/presentation/localStorage/useLocalStorageValue.js.map +1 -1
- package/presentation/localStorage/useLocalStorageValues.js +23 -30
- package/presentation/localStorage/useLocalStorageValues.js.map +1 -1
- package/presentation/router/RouteElementRegistry.js +22 -25
- package/presentation/router/RouteElementRegistry.js.map +1 -1
- package/presentation/router/abstractions.js +2 -1
- package/presentation/router/abstractions.js.map +1 -1
- package/presentation/router/components/Redirect.js +8 -10
- package/presentation/router/components/Redirect.js.map +1 -1
- package/presentation/router/components/RouteContent.js +14 -17
- package/presentation/router/components/RouteContent.js.map +1 -1
- package/presentation/router/components/RouteLink.js +11 -16
- package/presentation/router/components/RouteLink.js.map +1 -1
- package/presentation/router/components/SimpleLink.js +18 -24
- package/presentation/router/components/SimpleLink.js.map +1 -1
- package/presentation/router/hooks/useRoute.js +15 -23
- package/presentation/router/hooks/useRoute.js.map +1 -1
- package/presentation/router/hooks/useRouter.js +22 -23
- package/presentation/router/hooks/useRouter.js.map +1 -1
- package/presentation/router/index.js +0 -2
- package/presentation/router/types.js +0 -3
- package/renderApp.js +7 -6
- package/renderApp.js.map +1 -1
- package/router.js +0 -3
- package/rslib-runtime.js +14 -0
- package/rslib-runtime.js.map +1 -0
- package/shared/di/DiContainerProvider.js +8 -12
- package/shared/di/DiContainerProvider.js.map +1 -1
- package/shared/di/createFeature.js +7 -8
- package/shared/di/createFeature.js.map +1 -1
- package/shared/di/useFeature.js +7 -3
- package/shared/di/useFeature.js.map +1 -1
- package/static/svg/close_24px.33adaadc.svg +1 -0
- package/types.js +0 -3
- 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.js +0 -2
- package/utils/legacyPluginToReactComponent.js +11 -10
- package/utils/legacyPluginToReactComponent.js.map +1 -1
- package/components/index.js.map +0 -1
- package/errors/index.js.map +0 -1
- package/exports/admin/env-config.js.map +0 -1
- package/exports/admin/graphql-client.js.map +0 -1
- package/exports/admin/local-storage.js.map +0 -1
- package/exports/admin/router.js.map +0 -1
- package/exports/admin/security.js.map +0 -1
- package/exports/admin.js.map +0 -1
- package/features/envConfig/index.js.map +0 -1
- package/features/eventPublisher/index.js.map +0 -1
- package/features/graphqlClient/index.js.map +0 -1
- package/features/graphqlClient/types.js.map +0 -1
- package/features/localStorage/index.js.map +0 -1
- package/features/mainGraphQLClient/index.js.map +0 -1
- package/features/router/index.js.map +0 -1
- package/helpers/InterfaceGenerator/date.js.map +0 -1
- package/helpers/InterfaceGenerator/id.js.map +0 -1
- package/helpers/InterfaceGenerator/identity.js.map +0 -1
- package/helpers/InterfaceGenerator/index.js.map +0 -1
- package/helpers/InterfaceGenerator/numeric.js.map +0 -1
- package/helpers/InterfaceGenerator/truthful.js.map +0 -1
- package/hooks/useAutocomplete/index.js.map +0 -1
- package/hooks/useDataList/functions/index.js.map +0 -1
- package/hooks/useDataList/index.js.map +0 -1
- package/hooks/useDataList/utils/index.js.map +0 -1
- package/i18n/index.js.map +0 -1
- package/index.js.map +0 -1
- package/presentation/localStorage/index.js.map +0 -1
- package/presentation/router/index.js.map +0 -1
- package/presentation/router/types.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/file.todo +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/router.js.map +0 -1
- package/types.js.map +0 -1
- package/utils/index.js.map +0 -1
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import react from "react";
|
|
2
2
|
import { createGenericContext } from "../../utils/createGenericContext.js";
|
|
3
3
|
const DiContainerContext = createGenericContext("DiContainer");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}, children);
|
|
11
|
-
};
|
|
12
|
-
export const useContainer = () => {
|
|
13
|
-
const context = DiContainerContext.useHook();
|
|
14
|
-
return context.container;
|
|
4
|
+
const DiContainerProvider = ({ container, children })=>/*#__PURE__*/ react.createElement(DiContainerContext.Provider, {
|
|
5
|
+
container: container
|
|
6
|
+
}, children);
|
|
7
|
+
const useContainer = ()=>{
|
|
8
|
+
const context = DiContainerContext.useHook();
|
|
9
|
+
return context.container;
|
|
15
10
|
};
|
|
11
|
+
export { DiContainerProvider, useContainer };
|
|
16
12
|
|
|
17
13
|
//# sourceMappingURL=DiContainerProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"shared/di/DiContainerProvider.js","sources":["../../../src/shared/di/DiContainerProvider.tsx"],"sourcesContent":["import React from \"react\";\nimport { Container } from \"@webiny/di\";\nimport { createGenericContext } from \"~/utils/createGenericContext.js\";\n\ntype DiContainerContext = { container: Container };\n\nconst DiContainerContext = createGenericContext<DiContainerContext>(\"DiContainer\");\n\nexport interface DiContainerProviderProps {\n container: Container;\n children: React.ReactNode;\n}\n\nexport const DiContainerProvider = ({ container, children }: DiContainerProviderProps) => {\n return (\n <DiContainerContext.Provider container={container}>{children}</DiContainerContext.Provider>\n );\n};\n\nexport const useContainer = () => {\n const context = DiContainerContext.useHook();\n\n return context.container;\n};\n"],"names":["DiContainerContext","createGenericContext","DiContainerProvider","container","children","useContainer","context"],"mappings":";;AAMA,MAAMA,qBAAqBC,qBAAyC;AAO7D,MAAMC,sBAAsB,CAAC,EAAEC,SAAS,EAAEC,QAAQ,EAA4B,GAC1E,WAAP,GACI,oBAACJ,mBAAmB,QAAQ;QAAC,WAAWG;OAAYC;AAIrD,MAAMC,eAAe;IACxB,MAAMC,UAAUN,mBAAmB,OAAO;IAE1C,OAAOM,QAAQ,SAAS;AAC5B"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
};
|
|
1
|
+
function createFeature(def) {
|
|
2
|
+
return {
|
|
3
|
+
name: def.name,
|
|
4
|
+
register: def.register,
|
|
5
|
+
resolve: (container)=>def.resolve(container)
|
|
6
|
+
};
|
|
9
7
|
}
|
|
8
|
+
export { createFeature };
|
|
10
9
|
|
|
11
10
|
//# sourceMappingURL=createFeature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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"}
|
package/shared/di/useFeature.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { useContainer } from "./DiContainerProvider.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
function useFeature(feature) {
|
|
4
|
+
const container = useContainer();
|
|
5
|
+
return useMemo(()=>feature.resolve(container), [
|
|
6
|
+
container,
|
|
7
|
+
feature
|
|
8
|
+
]);
|
|
6
9
|
}
|
|
10
|
+
export { useFeature };
|
|
7
11
|
|
|
8
12
|
//# sourceMappingURL=useFeature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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.js
CHANGED
|
@@ -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.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { useRegisterLegacyPlugin } from "../hooks/useRegisterLegacyPlugin.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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"}
|
package/components/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Image"],"sources":["index.ts"],"sourcesContent":["export { Image } from \"./Image.js\";\n"],"mappings":"AAAA,SAASA,KAAK","ignoreList":[]}
|
package/errors/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["NetworkErrorEvent","NetworkErrorEventHandler","AuthenticationErrorEvent","AuthenticationErrorEventHandler"],"sources":["index.ts"],"sourcesContent":["export { NetworkErrorEvent } from \"./NetworkErrorEvent.js\";\nexport type { NetworkErrorPayload } from \"./NetworkErrorEvent.js\";\nexport { NetworkErrorEventHandler } from \"./abstractions.js\";\nexport { AuthenticationErrorEvent } from \"./AuthenticationErrorEvent.js\";\nexport type { AuthenticationErrorPayload } from \"./AuthenticationErrorEvent.js\";\nexport { AuthenticationErrorEventHandler } from \"./abstractions.js\";\n"],"mappings":"AAAA,SAASA,iBAAiB;AAE1B,SAASC,wBAAwB;AACjC,SAASC,wBAAwB;AAEjC,SAASC,+BAA+B","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["EnvConfig","useEnvConfig"],"sources":["env-config.ts"],"sourcesContent":["export { EnvConfig } from \"~/features/envConfig/index.js\";\nexport { useEnvConfig } from \"~/presentation/envConfig/useEnvConfig.js\";\n"],"mappings":"AAAA,SAASA,SAAS;AAClB,SAASC,YAAY","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["GraphQLClient"],"sources":["graphql-client.ts"],"sourcesContent":["export { GraphQLClient } from \"~/features/graphqlClient/abstractions.js\";\n"],"mappings":"AAAA,SAASA,aAAa","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["LocalStorage","useLocalStorage","useLocalStorageValue","useLocalStorageValues"],"sources":["local-storage.ts"],"sourcesContent":["export { LocalStorage } from \"~/features/localStorage/abstractions.js\";\nexport {\n useLocalStorage,\n useLocalStorageValue,\n useLocalStorageValues\n} from \"~/presentation/localStorage/index.js\";\n"],"mappings":"AAAA,SAASA,YAAY;AACrB,SACIC,eAAe,EACfC,oBAAoB,EACpBC,qBAAqB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Route","RouteLinkComponent","LinkComponent","RedirectComponent","useRoute","useRouter"],"sources":["router.ts"],"sourcesContent":["export { Route } from \"~/features/router/Route.js\";\nexport { RouteLinkComponent } from \"~/presentation/router/components/RouteLink.js\";\nexport { LinkComponent } from \"~/presentation/router/components/SimpleLink.js\";\nexport { RedirectComponent } from \"~/presentation/router/components/Redirect.js\";\nexport { useRoute, useRouter } from \"~/presentation/router/index.js\";\n"],"mappings":"AAAA,SAASA,KAAK;AACd,SAASC,kBAAkB;AAC3B,SAASC,aAAa;AACtB,SAASC,iBAAiB;AAC1B,SAASC,QAAQ,EAAEC,SAAS","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["AuthenticationErrorEventHandler"],"sources":["security.ts"],"sourcesContent":["export { AuthenticationErrorEventHandler } from \"~/errors/abstractions.js\";\n"],"mappings":"AAAA,SAASA,+BAA+B","ignoreList":[]}
|
package/exports/admin.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["MainGraphQLClient","useFeature","NetworkErrorEventHandler","createProviderPlugin","createProvider","Provider","Plugin"],"sources":["admin.ts"],"sourcesContent":["export { MainGraphQLClient } from \"~/features/mainGraphQLClient/index.js\";\nexport { useFeature } from \"~/shared/di/useFeature.js\";\nexport { NetworkErrorEventHandler } from \"~/errors/index.js\";\nexport { createProviderPlugin } from \"~/core/createProviderPlugin.js\";\nexport { createProvider } from \"~/core/createProvider.js\";\nexport { Provider } from \"~/core/Provider.js\";\nexport { Plugin } from \"~/core/Plugin.js\";\n"],"mappings":"AAAA,SAASA,iBAAiB;AAC1B,SAASC,UAAU;AACnB,SAASC,wBAAwB;AACjC,SAASC,oBAAoB;AAC7B,SAASC,cAAc;AACvB,SAASC,QAAQ;AACjB,SAASC,MAAM","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["EnvConfig"],"sources":["index.ts"],"sourcesContent":["export { EnvConfig } from \"./abstractions.js\";\n"],"mappings":"AAAA,SAASA,SAAS","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["EventPublisher","BaseEvent","EventPublisherFeature"],"sources":["index.ts"],"sourcesContent":["export { EventPublisher, BaseEvent } from \"./abstractions.js\";\nexport type { IEventHandler, IEventPublisher } from \"./abstractions.js\";\nexport { EventPublisherFeature } from \"./feature.js\";\n"],"mappings":"AAAA,SAASA,cAAc,EAAEC,SAAS;AAElC,SAASC,qBAAqB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["GraphQLClient"],"sources":["index.ts"],"sourcesContent":["export { GraphQLClient } from \"./abstractions.js\";\n"],"mappings":"AAAA,SAASA,aAAa","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface BatchingOptions {\n enabled?: boolean;\n batchWindowMs?: number;\n maxBatchSize?: number;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["LocalStorage","LocalStorageGateway","LocalStorageRepository","LocalStorageConfig"],"sources":["index.ts"],"sourcesContent":["export {\n LocalStorage,\n LocalStorageGateway,\n LocalStorageRepository,\n LocalStorageConfig\n} from \"./abstractions.js\";\n"],"mappings":"AAAA,SACIA,YAAY,EACZC,mBAAmB,EACnBC,sBAAsB,EACtBC,kBAAkB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["MainGraphQLClient"],"sources":["index.ts"],"sourcesContent":["export { MainGraphQLClient } from \"./abstractions.js\";\n"],"mappings":"AAAA,SAASA,iBAAiB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["RouterPresenter","RouterGateway"],"sources":["index.ts"],"sourcesContent":["export { RouterPresenter, RouterGateway } from \"./abstractions.js\";\nexport type {\n RouteTransitionGuardConfig,\n GuardDisposer,\n TransitionController\n} from \"./abstractions.js\";\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,aAAa","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["date.ts"],"sourcesContent":["type DateOps<T> = {\n \"\": T;\n _gt: T;\n _gte: T;\n _lt: T;\n _lte: T;\n _between: [T, T];\n};\n\nexport type DateInterfaceGenerator<Name extends string> = {\n [K in keyof DateOps<Date> as `${Name}${K}`]?: DateOps<Date>[K];\n};\n\nexport type DateStringInterfaceGenerator<Name extends string> = {\n [K in keyof DateOps<string> as `${Name}${K}`]?: DateOps<string>[K];\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["id.ts"],"sourcesContent":["type IdOperators<TType extends string> = {\n \"\": TType;\n _not: TType;\n _in: TType[];\n _not_in: TType[];\n};\n\nexport type IdInterfaceGenerator<TName extends string, TType extends string = string> = {\n [K in keyof IdOperators<TType> as `${TName}${K}`]?: IdOperators<TType>[K];\n};\n\ntype IdMixedOperators = {\n \"\": string;\n _not: string;\n _in: string[];\n _not_in: string[];\n _gt: number | string;\n _gte: number | string;\n _lt: number | string;\n _lte: number | string;\n};\n\nexport type IdMixedInterfaceGenerator<TName extends string> = {\n [K in keyof IdMixedOperators as `${TName}${K}`]?: IdMixedOperators[K];\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["identity.ts"],"sourcesContent":["type IdentityOps<TId> = {\n \"\": TId;\n _not: TId;\n _in: TId[];\n _not_in: TId[];\n};\n\nexport type IdentityInterfaceGenerator<Name extends string, TId = string> = {\n [K in keyof IdentityOps<TId> as `${Name}${K}`]?: IdentityOps<TId>[K];\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export type { IdInterfaceGenerator, IdMixedInterfaceGenerator } from \"./id.js\";\nexport type { DateInterfaceGenerator, DateStringInterfaceGenerator } from \"./date.js\";\nexport type { IdentityInterfaceGenerator } from \"./identity.js\";\nexport type { NumericInterfaceGenerator } from \"./numeric.js\";\nexport type { TruthfulInterfaceGenerator } from \"./truthful.js\";\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["numeric.ts"],"sourcesContent":["type Numeric = {\n \"\": number;\n _gt: number;\n _gte: number;\n _lt: number;\n _lte: number;\n _between: [number, number];\n};\n\nexport type NumericInterfaceGenerator<Name extends string> = {\n [K in keyof Numeric as `${Name}${K}`]?: Numeric[K];\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["truthful.ts"],"sourcesContent":["type Truthful = {\n \"\": boolean;\n};\n\nexport type TruthfulInterfaceGenerator<Name extends string> = {\n [K in keyof Truthful as `${Name}${K}`]?: Truthful[K];\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useAutocomplete"],"sources":["index.ts"],"sourcesContent":["export { useAutocomplete } from \"./useAutocomplete.js\";\n"],"mappings":"AAAA,SAASA,eAAe","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["default","getData","getError","getMeta"],"sources":["index.ts"],"sourcesContent":["export { default as getData } from \"./getData.js\";\nexport { default as getError } from \"./getError.js\";\nexport { default as getMeta } from \"./getMeta.js\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,OAAO;AAC3B,SAASD,OAAO,IAAIE,QAAQ;AAC5B,SAASF,OAAO,IAAIG,OAAO","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useDataList"],"sources":["index.ts"],"sourcesContent":["export { useDataList } from \"./useDataList.js\";\n"],"mappings":"AAAA,SAASA,WAAW","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["default","prepareLoadListParams"],"sources":["index.ts"],"sourcesContent":["export { default as prepareLoadListParams } from \"./prepareLoadListParams.js\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,qBAAqB","ignoreList":[]}
|
package/i18n/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["default","i18n"],"sources":["index.ts"],"sourcesContent":["export { default as i18n } from \"./i18n.js\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,IAAI","ignoreList":[]}
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["AddQuerySelectionPlugin","ApolloLinkPlugin","ApolloCacheObjectIdPlugin","useContainer","DiContainerProvider","useFeature","createFeature","Route","RouteLink","SimpleLink","useEnvConfig","useRouter","useRoute","useLocalStorage","useLocalStorageValue","useLocalStorageValues"],"sources":["index.ts"],"sourcesContent":["export { AddQuerySelectionPlugin } from \"./plugins/AddQuerySelectionPlugin.js\";\nexport { ApolloLinkPlugin } from \"./plugins/ApolloLinkPlugin.js\";\nexport {\n ApolloCacheObjectIdPlugin,\n type ApolloCacheObject\n} from \"./plugins/ApolloCacheObjectIdPlugin.js\";\n\n// Composition - we re-export this for ease of use\nexport * from \"@webiny/react-composition\";\nexport type { HigherOrderComponent, ComposeProps, ComposableFC } from \"@webiny/react-composition\";\n\n// App framework\nexport * from \"./App.js\";\nexport * from \"./AppContainer.js\";\nexport type { AppProps } from \"./App.js\";\nexport * from \"./core/Plugins.js\";\nexport * from \"./core/Plugin.js\";\nexport * from \"./core/Provider.js\";\nexport * from \"./core/createProvider.js\";\nexport * from \"./core/createProviderPlugin.js\";\nexport * from \"./renderApp.js\";\nexport * from \"./utils/createGenericContext.js\";\nexport { useContainer, DiContainerProvider } from \"./shared/di/DiContainerProvider.js\";\nexport { useFeature } from \"./shared/di/useFeature.js\";\nexport { createFeature } from \"./shared/di/createFeature.js\";\n\nexport { Route } from \"./features/router/Route.js\";\nexport { RouteLink, type RouteLinkProps } from \"./presentation/router/components/RouteLink.js\";\nexport { SimpleLink, type SimpleLinkProps } from \"./presentation/router/components/SimpleLink.js\";\n\nexport { useEnvConfig } from \"./presentation/envConfig/useEnvConfig.js\";\nexport { useRouter, useRoute } from \"./presentation/router/index.js\";\nexport {\n useLocalStorage,\n useLocalStorageValue,\n useLocalStorageValues\n} from \"./presentation/localStorage/index.js\";\n\nexport * from \"./helpers/InterfaceGenerator/index.js\";\n"],"mappings":"AAAA,SAASA,uBAAuB;AAChC,SAASC,gBAAgB;AACzB,SACIC,yBAAyB;;AAI7B;AACA,cAAc,2BAA2B;AAGzC;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAY,EAAEC,mBAAmB;AAC1C,SAASC,UAAU;AACnB,SAASC,aAAa;AAEtB,SAASC,KAAK;AACd,SAASC,SAAS;AAClB,SAASC,UAAU;AAEnB,SAASC,YAAY;AACrB,SAASC,SAAS,EAAEC,QAAQ;AAC5B,SACIC,eAAe,EACfC,oBAAoB,EACpBC,qBAAqB;AAGzB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useLocalStorage","useLocalStorageValue","useLocalStorageValues"],"sources":["index.ts"],"sourcesContent":["export { useLocalStorage } from \"./useLocalStorage.js\";\nexport { useLocalStorageValue } from \"./useLocalStorageValue.js\";\nexport { useLocalStorageValues } from \"./useLocalStorageValues.js\";\n"],"mappings":"AAAA,SAASA,eAAe;AACxB,SAASC,oBAAoB;AAC7B,SAASC,qBAAqB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useRouter","useRoute","RouteElementRegistry"],"sources":["index.ts"],"sourcesContent":["export { useRouter } from \"./hooks/useRouter.js\";\nexport { useRoute } from \"./hooks/useRoute.js\";\nexport { RouteElementRegistry } from \"./abstractions.js\";\nexport type { ReactRoute } from \"./types.js\";\n"],"mappings":"AAAA,SAASA,SAAS;AAClB,SAASC,QAAQ;AACjB,SAASC,oBAAoB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { Route } from \"~/features/router/Route.js\";\n\nexport type ReactRoute = {\n route: Route<any>;\n element: React.JSX.Element;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export type SelectedFile = {
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
type: string;
|
|
6
|
-
size: number;
|
|
7
|
-
src: {
|
|
8
|
-
file: File;
|
|
9
|
-
base64: string | null;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export type FileError = {
|
|
13
|
-
id: string;
|
|
14
|
-
type: "unsupportedFileType" | "maxSizeExceeded" | "multipleMaxSizeExceeded" | "multipleMaxCountExceeded" | "multipleNotAllowed";
|
|
15
|
-
index?: number;
|
|
16
|
-
file?: SelectedFile | File;
|
|
17
|
-
multipleFileSize?: number;
|
|
18
|
-
multipleMaxSize?: number;
|
|
19
|
-
multipleMaxCount?: number;
|
|
20
|
-
multipleCount?: number;
|
|
21
|
-
};
|
|
22
|
-
export type BrowseFilesParams = {
|
|
23
|
-
onSuccess?: (files: SelectedFile[]) => void;
|
|
24
|
-
onError?: (errors: FileError[], files: SelectedFile[]) => void;
|
|
25
|
-
};
|
|
26
|
-
export type RenderPropParams = {
|
|
27
|
-
browseFiles: (params: BrowseFilesParams) => void;
|
|
28
|
-
getDropZoneProps: (additionalProps: any) => any;
|
|
29
|
-
getLabelProps: (additionalProps: any) => any;
|
|
30
|
-
validateFiles: (files: SelectedFile[] | File[]) => FileError[];
|
|
31
|
-
};
|
|
32
|
-
export type FilesRules = {
|
|
33
|
-
accept: string[];
|
|
34
|
-
multiple: boolean;
|
|
35
|
-
maxSize: string;
|
|
36
|
-
multipleMaxSize: string;
|
|
37
|
-
multipleMaxCount: number | null;
|
|
38
|
-
convertToBase64: boolean;
|
|
39
|
-
onSuccess?: (files: SelectedFile[]) => void;
|
|
40
|
-
onError?: (errors: FileError[], files: SelectedFile[]) => void;
|
|
41
|
-
};
|
|
42
|
-
export type Props = FilesRules & {
|
|
43
|
-
children: (params: RenderPropParams) => React.ReactNode;
|
|
44
|
-
id?: string;
|
|
45
|
-
};
|
|
46
|
-
export declare class Files extends React.Component<Props> {
|
|
47
|
-
static defaultProps: {
|
|
48
|
-
accept: never[];
|
|
49
|
-
multiple: boolean;
|
|
50
|
-
maxSize: string;
|
|
51
|
-
multipleMaxSize: string;
|
|
52
|
-
multipleMaxCount: null;
|
|
53
|
-
convertToBase64: boolean;
|
|
54
|
-
};
|
|
55
|
-
input: HTMLInputElement | null;
|
|
56
|
-
browseFilesPassedParams: BrowseFilesParams | null;
|
|
57
|
-
id: string;
|
|
58
|
-
validateFiles: (files: SelectedFile[] | File[]) => FileError[];
|
|
59
|
-
processSelectedFiles: (eventFiles: Array<File>) => Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* Extracted into a separate method just for testing purposes.
|
|
62
|
-
*/
|
|
63
|
-
onDropFilesHandler: ({ e, onSuccess, onError }: any) => Promise<void>;
|
|
64
|
-
/**
|
|
65
|
-
* Extracted into a separate method just for testing purposes.
|
|
66
|
-
*/
|
|
67
|
-
browseFilesHandler: ({ onSuccess, onError }: any) => void;
|
|
68
|
-
render(): React.JSX.Element;
|
|
69
|
-
}
|