@webiny/app 0.0.0-unstable.fcdad0bc61 → 0.0.0-unstable.fdd9228b5d
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 +26 -0
- package/App.js +95 -0
- package/App.js.map +1 -0
- package/AppContainer.d.ts +23 -0
- package/AppContainer.js +9 -0
- package/AppContainer.js.map +1 -0
- package/apollo-client/InMemoryCache.d.ts +3 -2
- package/apollo-client/InMemoryCache.js +17 -76
- package/apollo-client/InMemoryCache.js.map +1 -1
- package/apollo-client/IntrospectionFragmentMatcher.d.ts +11 -0
- package/apollo-client/IntrospectionFragmentMatcher.js +45 -0
- package/apollo-client/IntrospectionFragmentMatcher.js.map +1 -0
- package/components/Image.d.ts +3 -3
- package/components/Image.js +12 -32
- package/components/Image.js.map +1 -1
- package/components/Routes.d.ts +2 -2
- package/components/Routes.js +21 -34
- package/components/Routes.js.map +1 -1
- package/components/View.d.ts +1 -1
- package/components/View.js +15 -37
- package/components/View.js.map +1 -1
- package/components/index.js +3 -20
- package/components/index.js.map +1 -1
- package/config/RouterConfig/Route.d.ts +30 -0
- package/config/RouterConfig/Route.js +42 -0
- package/config/RouterConfig/Route.js.map +1 -0
- package/config/RouterConfig.d.ts +32 -0
- package/config/RouterConfig.js +18 -0
- package/config/RouterConfig.js.map +1 -0
- package/config.d.ts +1 -1
- package/config.js +8 -16
- package/config.js.map +1 -1
- package/contexts/Ui/index.d.ts +4 -8
- package/contexts/Ui/index.js +29 -89
- package/contexts/Ui/index.js.map +1 -1
- package/core/DebounceRender.d.ts +12 -0
- package/core/DebounceRender.js +31 -0
- package/core/DebounceRender.js.map +1 -0
- package/core/Plugin.d.ts +8 -0
- package/core/Plugin.js +14 -0
- package/core/Plugin.js.map +1 -0
- package/core/Plugins.d.ts +15 -0
- package/core/Plugins.js +39 -0
- package/core/Plugins.js.map +1 -0
- package/core/Provider.d.ts +8 -0
- package/core/Provider.js +18 -0
- package/core/Provider.js.map +1 -0
- package/core/Routes.d.ts +6 -0
- package/core/Routes.js +34 -0
- package/core/Routes.js.map +1 -0
- package/core/createProvider.d.ts +10 -0
- package/core/createProvider.js +9 -0
- package/core/createProvider.js.map +1 -0
- package/core/createProviderPlugin.d.ts +8 -0
- package/core/createProviderPlugin.js +17 -0
- package/core/createProviderPlugin.js.map +1 -0
- package/hooks/useAutocomplete/index.js +2 -12
- package/hooks/useAutocomplete/index.js.map +1 -1
- package/hooks/useAutocomplete/useAutocomplete.d.ts +1 -1
- package/hooks/useAutocomplete/useAutocomplete.js +10 -25
- package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
- package/hooks/useDataList/functions/getData.js +3 -15
- package/hooks/useDataList/functions/getData.js.map +1 -1
- package/hooks/useDataList/functions/getError.js +3 -15
- package/hooks/useDataList/functions/getError.js.map +1 -1
- package/hooks/useDataList/functions/getMeta.js +3 -15
- package/hooks/useDataList/functions/getMeta.js.map +1 -1
- package/hooks/useDataList/functions/index.js +4 -30
- package/hooks/useDataList/functions/index.js.map +1 -1
- package/hooks/useDataList/functions/searchDataByKey.js +5 -16
- package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
- package/hooks/useDataList/index.js +2 -12
- package/hooks/useDataList/index.js.map +1 -1
- package/hooks/useDataList/useDataList.d.ts +2 -2
- package/hooks/useDataList/useDataList.js +82 -107
- package/hooks/useDataList/useDataList.js.map +1 -1
- package/hooks/useDataList/utils/index.js +3 -22
- package/hooks/useDataList/utils/index.js.map +1 -1
- package/hooks/useDataList/utils/prepareLoadListParams.d.ts +1 -2
- package/hooks/useDataList/utils/prepareLoadListParams.js +33 -43
- package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +11 -16
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +1 -1
- package/hooks/useDataList/utils/types.d.ts +21 -15
- package/hooks/useDataList/utils/types.js +2 -4
- package/hooks/useDataList/utils/types.js.map +1 -1
- package/hooks/useHandler.js +13 -14
- package/hooks/useHandler.js.map +1 -1
- package/hooks/useHandlers.d.ts +3 -3
- package/hooks/useHandlers.js +14 -21
- package/hooks/useHandlers.js.map +1 -1
- package/hooks/useRegisterLegacyPlugin.d.ts +2 -0
- package/hooks/useRegisterLegacyPlugin.js +11 -0
- package/hooks/useRegisterLegacyPlugin.js.map +1 -0
- package/hooks/useUi.d.ts +1 -1
- package/hooks/useUi.js +5 -14
- package/hooks/useUi.js.map +1 -1
- package/i18n/i18n.js +6 -20
- package/i18n/i18n.js.map +1 -1
- package/i18n/index.js +2 -14
- package/i18n/index.js.map +1 -1
- package/index.d.ts +14 -1
- package/index.js +18 -35
- package/index.js.map +1 -1
- package/package.json +25 -30
- package/plugins/AddQuerySelectionPlugin.d.ts +9 -2
- package/plugins/AddQuerySelectionPlugin.js +64 -124
- package/plugins/AddQuerySelectionPlugin.js.map +1 -1
- package/plugins/ApolloCacheObjectIdPlugin.js +13 -50
- package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
- package/plugins/ApolloDynamicLink.d.ts +3 -2
- package/plugins/ApolloDynamicLink.js +20 -72
- package/plugins/ApolloDynamicLink.js.map +1 -1
- package/plugins/ApolloLinkPlugin.d.ts +1 -1
- package/plugins/ApolloLinkPlugin.js +19 -60
- package/plugins/ApolloLinkPlugin.js.map +1 -1
- package/plugins/ConsoleLinkPlugin.js +21 -58
- package/plugins/ConsoleLinkPlugin.js.map +1 -1
- package/plugins/LocaleHeaderLinkPlugin.d.ts +1 -6
- package/plugins/LocaleHeaderLinkPlugin.js +24 -69
- package/plugins/LocaleHeaderLinkPlugin.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +1 -1
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +41 -72
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +8 -4
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +76 -19
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +1 -1
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +24 -31
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin.js +24 -59
- package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
- package/plugins/OmitTypenameLinkPlugin.js +13 -47
- package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
- package/plugins/RoutePlugin.d.ts +1 -1
- package/plugins/RoutePlugin.js +13 -50
- package/plugins/RoutePlugin.js.map +1 -1
- package/plugins/TenantHeaderLinkPlugin.d.ts +1 -6
- package/plugins/TenantHeaderLinkPlugin.js +31 -77
- package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
- package/plugins/ViewPlugin.d.ts +1 -1
- package/plugins/ViewPlugin.js +16 -55
- package/plugins/ViewPlugin.js.map +1 -1
- package/plugins/image.d.ts +1 -1
- package/plugins/image.js +55 -94
- package/plugins/image.js.map +1 -1
- package/plugins/index.d.ts +3 -3
- package/plugins/index.js +34 -78
- package/plugins/index.js.map +1 -1
- package/react-butterfiles/Files.d.ts +69 -0
- package/react-butterfiles/Files.js +227 -0
- package/react-butterfiles/Files.js.map +1 -0
- package/react-butterfiles/index.d.ts +2 -0
- package/react-butterfiles/index.js +4 -0
- package/react-butterfiles/index.js.map +1 -0
- package/react-butterfiles/utils/generateId.d.ts +1 -0
- package/react-butterfiles/utils/generateId.js +5 -0
- package/react-butterfiles/utils/generateId.js.map +1 -0
- package/react-butterfiles/utils/readFileContent.d.ts +1 -0
- package/react-butterfiles/utils/readFileContent.js +15 -0
- package/react-butterfiles/utils/readFileContent.js.map +1 -0
- package/renderApp.d.ts +2 -0
- package/renderApp.js +9 -0
- package/renderApp.js.map +1 -0
- package/types.d.ts +24 -27
- package/types.js +12 -11
- package/types.js.map +1 -1
- package/utils/createGenericContext.d.ts +13 -0
- package/utils/createGenericContext.js +25 -0
- package/utils/createGenericContext.js.map +1 -0
- package/utils/createHashing.d.ts +2 -0
- package/utils/createHashing.js +18 -0
- package/utils/createHashing.js.map +1 -0
- package/utils/getApiUrl.d.ts +1 -0
- package/utils/getApiUrl.js +5 -0
- package/utils/getApiUrl.js.map +1 -0
- package/utils/getGqlApiUrl.d.ts +1 -0
- package/utils/getGqlApiUrl.js +6 -0
- package/utils/getGqlApiUrl.js.map +1 -0
- package/utils/getHeadlessCmsGqlApiUrl.d.ts +5 -0
- package/utils/getHeadlessCmsGqlApiUrl.js +12 -0
- package/utils/getHeadlessCmsGqlApiUrl.js.map +1 -0
- package/utils/getLocaleCode.d.ts +6 -0
- package/utils/getLocaleCode.js +33 -0
- package/utils/getLocaleCode.js.map +1 -0
- package/utils/getPrerenderId.d.ts +6 -0
- package/utils/getPrerenderId.js +5 -0
- package/utils/getPrerenderId.js.map +1 -0
- package/utils/getTenantId.d.ts +6 -0
- package/utils/getTenantId.js +45 -0
- package/utils/getTenantId.js.map +1 -0
- package/utils/index.d.ts +10 -0
- package/utils/index.js +12 -0
- package/utils/index.js.map +1 -0
- package/utils/isLocalhost.d.ts +1 -0
- package/utils/isLocalhost.js +7 -0
- package/utils/isLocalhost.js.map +1 -0
- package/utils/isPrerendering.d.ts +1 -0
- package/utils/isPrerendering.js +5 -0
- package/utils/isPrerendering.js.map +1 -0
- package/utils/legacyPluginToReactComponent.d.ts +7 -0
- package/utils/legacyPluginToReactComponent.js +14 -0
- package/utils/legacyPluginToReactComponent.js.map +1 -0
|
@@ -1,97 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _get = _interopRequireDefault(require("lodash/get"));
|
|
19
|
-
|
|
20
|
-
var _Button = require("@webiny/ui/Button");
|
|
21
|
-
|
|
22
|
-
var _Typography = require("@webiny/ui/Typography");
|
|
23
|
-
|
|
24
|
-
var _i18n = require("../../i18n");
|
|
25
|
-
|
|
26
|
-
var _StyledComponents = require("./StyledComponents");
|
|
27
|
-
|
|
28
|
-
var _close_24px = require("./assets/close_24px.svg");
|
|
29
|
-
|
|
30
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
31
|
-
|
|
32
|
-
var t = _i18n.i18n.ns("app/graphql/error-overlay");
|
|
33
|
-
|
|
34
|
-
var ENVIRONMENT_VARIABLES_ARTICLE_LINK = "https://www.webiny.com/docs/how-to-guides/environment-variables";
|
|
35
|
-
|
|
36
|
-
var ErrorOverlay = function ErrorOverlay(props) {
|
|
37
|
-
var query = props.query,
|
|
38
|
-
networkError = props.networkError;
|
|
39
|
-
|
|
40
|
-
var _useState = (0, _react.useState)(true),
|
|
41
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
42
|
-
open = _useState2[0],
|
|
43
|
-
setOpen = _useState2[1]; // Log error in browser's developer console for further inspection.
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import get from "lodash/get";
|
|
3
|
+
import { IconButton } from "@webiny/ui/Button";
|
|
4
|
+
import { Typography } from "@webiny/ui/Typography";
|
|
5
|
+
import { i18n } from "../../i18n";
|
|
6
|
+
import { OverlayWrapper, Pre } from "./StyledComponents";
|
|
7
|
+
import { ReactComponent as CloseIcon } from "./assets/close_24px.svg";
|
|
8
|
+
const t = i18n.ns("app/graphql/error-overlay");
|
|
9
|
+
const ENVIRONMENT_VARIABLES_ARTICLE_LINK = "https://www.webiny.com/docs/how-to-guides/environment-variables";
|
|
10
|
+
const ErrorOverlay = props => {
|
|
11
|
+
const {
|
|
12
|
+
query,
|
|
13
|
+
networkError
|
|
14
|
+
} = props;
|
|
15
|
+
const [open, setOpen] = useState(true);
|
|
16
|
+
// Log error in browser's developer console for further inspection.
|
|
46
17
|
console.error({
|
|
47
|
-
networkError
|
|
18
|
+
networkError
|
|
48
19
|
});
|
|
49
|
-
|
|
50
20
|
if (!open) {
|
|
51
21
|
return null;
|
|
52
22
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return /*#__PURE__*/_react.default.createElement(_StyledComponents.OverlayWrapper, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
23
|
+
const stackTrace = get(networkError, "result.error.stack");
|
|
24
|
+
return /*#__PURE__*/React.createElement(OverlayWrapper, null, /*#__PURE__*/React.createElement("div", {
|
|
56
25
|
className: "inner"
|
|
57
|
-
}, /*#__PURE__*/
|
|
26
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
58
27
|
className: "header"
|
|
59
|
-
}, /*#__PURE__*/
|
|
28
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
60
29
|
className: "header__title"
|
|
61
|
-
}, /*#__PURE__*/
|
|
30
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
62
31
|
use: "headline4"
|
|
63
|
-
}, networkError.message)), /*#__PURE__*/
|
|
32
|
+
}, networkError.message)), /*#__PURE__*/React.createElement("div", {
|
|
64
33
|
className: "header__action"
|
|
65
|
-
}, /*#__PURE__*/
|
|
66
|
-
icon: /*#__PURE__*/
|
|
67
|
-
onClick:
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
35
|
+
icon: /*#__PURE__*/React.createElement(CloseIcon, null),
|
|
36
|
+
onClick: () => setOpen(false)
|
|
37
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
71
38
|
className: "body"
|
|
72
|
-
}, /*#__PURE__*/
|
|
39
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
73
40
|
className: "body__summary"
|
|
74
|
-
}, /*#__PURE__*/
|
|
41
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
75
42
|
use: "subtitle1"
|
|
76
|
-
}, t
|
|
43
|
+
}, t`Error occurred while executing operation:`), /*#__PURE__*/React.createElement(Pre, null, /*#__PURE__*/React.createElement("code", null, query))), stackTrace && /*#__PURE__*/React.createElement("div", {
|
|
77
44
|
className: "body__description"
|
|
78
|
-
}, /*#__PURE__*/
|
|
45
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
79
46
|
use: "subtitle1"
|
|
80
|
-
}, t
|
|
47
|
+
}, t`Complete stack trace:`), /*#__PURE__*/React.createElement(Pre, null, /*#__PURE__*/React.createElement("code", null, stackTrace)))), /*#__PURE__*/React.createElement("div", {
|
|
81
48
|
className: "footer"
|
|
82
|
-
}, /*#__PURE__*/
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
83
50
|
use: "body2"
|
|
84
|
-
}, t
|
|
85
|
-
|
|
51
|
+
}, t`
|
|
52
|
+
This screen is only visible if {message} environment variable is set.
|
|
53
|
+
Read more about it in the {link}. `({
|
|
54
|
+
message: /*#__PURE__*/React.createElement("span", {
|
|
86
55
|
className: "highlight"
|
|
87
56
|
}, "`REACT_APP_DEBUG=true`"),
|
|
88
|
-
link: /*#__PURE__*/
|
|
57
|
+
link: /*#__PURE__*/React.createElement("a", {
|
|
89
58
|
href: ENVIRONMENT_VARIABLES_ARTICLE_LINK,
|
|
90
59
|
target: "_blank",
|
|
91
60
|
rel: "noreferrer noopener"
|
|
92
61
|
}, "environment variables article")
|
|
93
|
-
}), /*#__PURE__*/
|
|
62
|
+
}), /*#__PURE__*/React.createElement("br", null), t`Open your browser's developer console to further inspect this error.`))));
|
|
94
63
|
};
|
|
64
|
+
export default ErrorOverlay;
|
|
95
65
|
|
|
96
|
-
|
|
97
|
-
exports.default = _default;
|
|
66
|
+
//# sourceMappingURL=ErrorOverlay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","useState","get","IconButton","Typography","i18n","OverlayWrapper","Pre","ReactComponent","CloseIcon","t","ns","ENVIRONMENT_VARIABLES_ARTICLE_LINK","ErrorOverlay","props","query","networkError","open","setOpen","console","error","stackTrace","createElement","className","use","message","icon","onClick","link","href","target","rel"],"sources":["ErrorOverlay.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport get from \"lodash/get\";\nimport { IconButton } from \"@webiny/ui/Button\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { i18n } from \"../../i18n\";\nimport { OverlayWrapper, Pre } from \"./StyledComponents\";\nimport { ReactComponent as CloseIcon } from \"./assets/close_24px.svg\";\n\nconst t = i18n.ns(\"app/graphql/error-overlay\");\n\nconst ENVIRONMENT_VARIABLES_ARTICLE_LINK =\n \"https://www.webiny.com/docs/how-to-guides/environment-variables\";\n\ninterface ErrorOverlayProps {\n query: string;\n networkError: {\n message: string;\n result?: {\n error?: {\n stack?: string;\n };\n };\n };\n}\nconst ErrorOverlay = (props: ErrorOverlayProps) => {\n const { query, networkError } = props;\n const [open, setOpen] = useState(true);\n // Log error in browser's developer console for further inspection.\n console.error({ networkError });\n\n if (!open) {\n return null;\n }\n\n const stackTrace = get(networkError, \"result.error.stack\");\n\n return (\n <OverlayWrapper>\n <div className=\"inner\">\n <div className=\"header\">\n <div className=\"header__title\">\n <Typography use={\"headline4\"}>{networkError.message}</Typography>\n </div>\n <div className=\"header__action\">\n <IconButton icon={<CloseIcon />} onClick={() => setOpen(false)} />\n </div>\n </div>\n <div className=\"body\">\n <div className=\"body__summary\">\n <Typography\n use={\"subtitle1\"}\n >{t`Error occurred while executing operation:`}</Typography>\n <Pre>\n <code>{query}</code>\n </Pre>\n </div>\n {stackTrace && (\n <div className=\"body__description\">\n <Typography use={\"subtitle1\"}>{t`Complete stack trace:`}</Typography>\n <Pre>\n <code>{stackTrace}</code>\n </Pre>\n </div>\n )}\n </div>\n <div className=\"footer\">\n <Typography use={\"body2\"}>\n {t`\n This screen is only visible if {message} environment variable is set.\n Read more about it in the {link}. `({\n message: <span className={\"highlight\"}>`REACT_APP_DEBUG=true`</span>,\n link: (\n <a\n href={ENVIRONMENT_VARIABLES_ARTICLE_LINK}\n target={\"_blank\"}\n rel={\"noreferrer noopener\"}\n >\n environment variables article\n </a>\n )\n })}\n <br />\n {t`Open your browser's developer console to further inspect this error.`}\n </Typography>\n </div>\n </div>\n </OverlayWrapper>\n );\n};\n\nexport default ErrorOverlay;\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
export declare const OverlayWrapper: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const Pre: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, {}>;
|
|
@@ -1,21 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.Pre = exports.OverlayWrapper = void 0;
|
|
9
|
-
|
|
10
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
11
|
-
|
|
12
|
-
var OverlayWrapper = /*#__PURE__*/(0, _styled.default)("div", {
|
|
13
|
-
target: "e1rvk94r0",
|
|
14
|
-
label: "OverlayWrapper"
|
|
15
|
-
})("\n width: 100vw;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 105; // The highest z-index value is 100 for Dialogs\n \n .inner {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: white;\n padding: 1rem;\n }\n \n .header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 1rem;\n .header__title {\n color: var(--mdc-theme-error);\n }\n }\n \n .body {\n flex-grow: 1;\n .body__summary {\n margin-bottom: 1rem;\n }\n }\n \n .footer {\n color: var(--mdc-theme-text-secondary-on-background);\n \n .highlight {\n background-color: rgba(251, 245, 180, 0.5);\n padding: 0 4px;\n border-radius: 6px;\n font-family: monospace;\n }\n }\n");
|
|
16
|
-
exports.OverlayWrapper = OverlayWrapper;
|
|
17
|
-
var Pre = /*#__PURE__*/(0, _styled.default)("pre", {
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
|
2
|
+
export const OverlayWrapper = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
3
|
+
target: "e1rvk94r1"
|
|
4
|
+
} : {
|
|
18
5
|
target: "e1rvk94r1",
|
|
6
|
+
label: "OverlayWrapper"
|
|
7
|
+
})(`
|
|
8
|
+
width: 100vw;
|
|
9
|
+
height: 100vh;
|
|
10
|
+
position: fixed;
|
|
11
|
+
top: 0;
|
|
12
|
+
left: 0;
|
|
13
|
+
z-index: 105; // The highest z-index value is 100 for Dialogs
|
|
14
|
+
|
|
15
|
+
.inner {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
overflow: auto;
|
|
22
|
+
background-color: white;
|
|
23
|
+
padding: 1rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.header {
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
align-items: center;
|
|
30
|
+
margin-bottom: 1rem;
|
|
31
|
+
.header__title {
|
|
32
|
+
color: var(--mdc-theme-error);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.body {
|
|
37
|
+
flex-grow: 1;
|
|
38
|
+
.body__summary {
|
|
39
|
+
margin-bottom: 1rem;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.footer {
|
|
44
|
+
color: var(--mdc-theme-text-secondary-on-background);
|
|
45
|
+
|
|
46
|
+
.highlight {
|
|
47
|
+
background-color: rgba(251, 245, 180, 0.5);
|
|
48
|
+
padding: 0 4px;
|
|
49
|
+
border-radius: 6px;
|
|
50
|
+
font-family: monospace;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlN0eWxlZENvbXBvbmVudHMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUU4QiIsImZpbGUiOiJTdHlsZWRDb21wb25lbnRzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuXG5leHBvcnQgY29uc3QgT3ZlcmxheVdyYXBwZXIgPSBzdHlsZWQoXCJkaXZcIikoYFxuICAgIHdpZHRoOiAxMDB2dztcbiAgICBoZWlnaHQ6IDEwMHZoO1xuICAgIHBvc2l0aW9uOiBmaXhlZDtcbiAgICB0b3A6IDA7XG4gICAgbGVmdDogMDtcbiAgICB6LWluZGV4OiAxMDU7IC8vIFRoZSBoaWdoZXN0IHotaW5kZXggdmFsdWUgaXMgMTAwIGZvciBEaWFsb2dzXG4gICAgXG4gICAgLmlubmVyIHtcbiAgICAgICAgYm94LXNpemluZzogYm9yZGVyLWJveDtcbiAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgICAgICAgd2lkdGg6IDEwMCU7XG4gICAgICAgIGhlaWdodDogMTAwJTtcbiAgICAgICAgb3ZlcmZsb3c6IGF1dG87XG4gICAgICAgIGJhY2tncm91bmQtY29sb3I6IHdoaXRlO1xuICAgICAgICBwYWRkaW5nOiAxcmVtO1xuICAgIH1cbiAgICBcbiAgICAuaGVhZGVyIHtcbiAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO1xuICAgICAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgICAgICBtYXJnaW4tYm90dG9tOiAxcmVtO1xuICAgICAgICAuaGVhZGVyX190aXRsZSB7XG4gICAgICAgICAgICBjb2xvcjogdmFyKC0tbWRjLXRoZW1lLWVycm9yKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBcbiAgICAuYm9keSB7XG4gICAgICAgIGZsZXgtZ3JvdzogMTtcbiAgICAgICAgLmJvZHlfX3N1bW1hcnkge1xuICAgICAgICAgICAgbWFyZ2luLWJvdHRvbTogMXJlbTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBcbiAgICAuZm9vdGVyIHtcbiAgICAgICAgY29sb3I6IHZhcigtLW1kYy10aGVtZS10ZXh0LXNlY29uZGFyeS1vbi1iYWNrZ3JvdW5kKTtcbiAgICAgICAgXG4gICAgICAgIC5oaWdobGlnaHQge1xuICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogcmdiYSgyNTEsIDI0NSwgMTgwLCAwLjUpO1xuICAgICAgICAgICAgcGFkZGluZzogMCA0cHg7XG4gICAgICAgICAgICBib3JkZXItcmFkaXVzOiA2cHg7XG4gICAgICAgICAgICBmb250LWZhbWlseTogbW9ub3NwYWNlO1xuICAgICAgICB9XG4gICAgfVxuYCk7XG5cbmV4cG9ydCBjb25zdCBQcmUgPSBzdHlsZWQoXCJwcmVcIikoYFxuICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgICBkaXNwbGF5OiBibG9jaztcbiAgICBwYWRkaW5nOiAwLjVlbTtcbiAgICBtYXJnaW4tdG9wOiAwLjVlbTtcbiAgICBtYXJnaW4tYm90dG9tOiAwLjVlbTtcbiAgICBvdmVyZmxvdy14OiBhdXRvO1xuICAgIHdoaXRlLXNwYWNlOiBwcmUtd3JhcDtcbiAgICBib3JkZXItcmFkaXVzOiAwLjI1cmVtO1xuICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMjUxLCAyNDUsIDE4MCwgMC4zKTtcbiAgICBjb2xvcjogaW5oZXJpdDtcbiAgICBcbiAgICBjb2RlIHtcbiAgICAgICAgZm9udC1mYW1pbHk6IG1vbm9zcGFjZTtcbiAgICAgICAgZm9udC1zaXplOiAwLjg1cmVtO1xuICAgICAgICBsaW5lLWhlaWdodDogMXJlbTtcbiAgICB9XG5gKTtcbiJdfQ== */");
|
|
54
|
+
export const Pre = /*#__PURE__*/_styled("pre", process.env.NODE_ENV === "production" ? {
|
|
55
|
+
target: "e1rvk94r0"
|
|
56
|
+
} : {
|
|
57
|
+
target: "e1rvk94r0",
|
|
19
58
|
label: "Pre"
|
|
20
|
-
})(
|
|
21
|
-
|
|
59
|
+
})(`
|
|
60
|
+
position: relative;
|
|
61
|
+
display: block;
|
|
62
|
+
padding: 0.5em;
|
|
63
|
+
margin-top: 0.5em;
|
|
64
|
+
margin-bottom: 0.5em;
|
|
65
|
+
overflow-x: auto;
|
|
66
|
+
white-space: pre-wrap;
|
|
67
|
+
border-radius: 0.25rem;
|
|
68
|
+
background-color: rgba(251, 245, 180, 0.3);
|
|
69
|
+
color: inherit;
|
|
70
|
+
|
|
71
|
+
code {
|
|
72
|
+
font-family: monospace;
|
|
73
|
+
font-size: 0.85rem;
|
|
74
|
+
line-height: 1rem;
|
|
75
|
+
}
|
|
76
|
+
`, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlN0eWxlZENvbXBvbmVudHMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtEbUIiLCJmaWxlIjoiU3R5bGVkQ29tcG9uZW50cy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcblxuZXhwb3J0IGNvbnN0IE92ZXJsYXlXcmFwcGVyID0gc3R5bGVkKFwiZGl2XCIpKGBcbiAgICB3aWR0aDogMTAwdnc7XG4gICAgaGVpZ2h0OiAxMDB2aDtcbiAgICBwb3NpdGlvbjogZml4ZWQ7XG4gICAgdG9wOiAwO1xuICAgIGxlZnQ6IDA7XG4gICAgei1pbmRleDogMTA1OyAvLyBUaGUgaGlnaGVzdCB6LWluZGV4IHZhbHVlIGlzIDEwMCBmb3IgRGlhbG9nc1xuICAgIFxuICAgIC5pbm5lciB7XG4gICAgICAgIGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG4gICAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICAgIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gICAgICAgIHdpZHRoOiAxMDAlO1xuICAgICAgICBoZWlnaHQ6IDEwMCU7XG4gICAgICAgIG92ZXJmbG93OiBhdXRvO1xuICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB3aGl0ZTtcbiAgICAgICAgcGFkZGluZzogMXJlbTtcbiAgICB9XG4gICAgXG4gICAgLmhlYWRlciB7XG4gICAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjtcbiAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICAgICAgbWFyZ2luLWJvdHRvbTogMXJlbTtcbiAgICAgICAgLmhlYWRlcl9fdGl0bGUge1xuICAgICAgICAgICAgY29sb3I6IHZhcigtLW1kYy10aGVtZS1lcnJvcik7XG4gICAgICAgIH1cbiAgICB9XG4gICAgXG4gICAgLmJvZHkge1xuICAgICAgICBmbGV4LWdyb3c6IDE7XG4gICAgICAgIC5ib2R5X19zdW1tYXJ5IHtcbiAgICAgICAgICAgIG1hcmdpbi1ib3R0b206IDFyZW07XG4gICAgICAgIH1cbiAgICB9XG4gICAgXG4gICAgLmZvb3RlciB7XG4gICAgICAgIGNvbG9yOiB2YXIoLS1tZGMtdGhlbWUtdGV4dC1zZWNvbmRhcnktb24tYmFja2dyb3VuZCk7XG4gICAgICAgIFxuICAgICAgICAuaGlnaGxpZ2h0IHtcbiAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMjUxLCAyNDUsIDE4MCwgMC41KTtcbiAgICAgICAgICAgIHBhZGRpbmc6IDAgNHB4O1xuICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogNnB4O1xuICAgICAgICAgICAgZm9udC1mYW1pbHk6IG1vbm9zcGFjZTtcbiAgICAgICAgfVxuICAgIH1cbmApO1xuXG5leHBvcnQgY29uc3QgUHJlID0gc3R5bGVkKFwicHJlXCIpKGBcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgZGlzcGxheTogYmxvY2s7XG4gICAgcGFkZGluZzogMC41ZW07XG4gICAgbWFyZ2luLXRvcDogMC41ZW07XG4gICAgbWFyZ2luLWJvdHRvbTogMC41ZW07XG4gICAgb3ZlcmZsb3cteDogYXV0bztcbiAgICB3aGl0ZS1zcGFjZTogcHJlLXdyYXA7XG4gICAgYm9yZGVyLXJhZGl1czogMC4yNXJlbTtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiByZ2JhKDI1MSwgMjQ1LCAxODAsIDAuMyk7XG4gICAgY29sb3I6IGluaGVyaXQ7XG4gICAgXG4gICAgY29kZSB7XG4gICAgICAgIGZvbnQtZmFtaWx5OiBtb25vc3BhY2U7XG4gICAgICAgIGZvbnQtc2l6ZTogMC44NXJlbTtcbiAgICAgICAgbGluZS1oZWlnaHQ6IDFyZW07XG4gICAgfVxuYCk7XG4iXX0= */");
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=StyledComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OverlayWrapper","
|
|
1
|
+
{"version":3,"names":["OverlayWrapper","_styled","process","env","NODE_ENV","target","label","Pre"],"sources":["StyledComponents.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\n\nexport const OverlayWrapper = styled(\"div\")(`\n width: 100vw;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 105; // The highest z-index value is 100 for Dialogs\n \n .inner {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: white;\n padding: 1rem;\n }\n \n .header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 1rem;\n .header__title {\n color: var(--mdc-theme-error);\n }\n }\n \n .body {\n flex-grow: 1;\n .body__summary {\n margin-bottom: 1rem;\n }\n }\n \n .footer {\n color: var(--mdc-theme-text-secondary-on-background);\n \n .highlight {\n background-color: rgba(251, 245, 180, 0.5);\n padding: 0 4px;\n border-radius: 6px;\n font-family: monospace;\n }\n }\n`);\n\nexport const Pre = styled(\"pre\")(`\n position: relative;\n display: block;\n padding: 0.5em;\n margin-top: 0.5em;\n margin-bottom: 0.5em;\n overflow-x: auto;\n white-space: pre-wrap;\n border-radius: 0.25rem;\n background-color: rgba(251, 245, 180, 0.3);\n color: inherit;\n \n code {\n font-family: monospace;\n font-size: 0.85rem;\n line-height: 1rem;\n }\n`);\n"],"mappings":";AAEA,OAAO,MAAMA,cAAc,gBAAGC,OAAA,CAAO,KAAK,EAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,CAAC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA,2zEAAC;AAEF,OAAO,MAAMG,GAAG,gBAAGN,OAAA,CAAO,KAAK,EAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA,2zEAAC","ignoreList":[]}
|
|
@@ -1,38 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _ErrorOverlay = _interopRequireDefault(require("./ErrorOverlay"));
|
|
15
|
-
|
|
16
|
-
var createErrorOverlay = function createErrorOverlay(params) {
|
|
17
|
-
var query = params.query,
|
|
18
|
-
networkError = params.networkError; // If the element already present in DOM, return immediately.
|
|
19
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* TODO fix with react 19
|
|
4
|
+
*/
|
|
5
|
+
// eslint-disable-next-line react/no-deprecated
|
|
6
|
+
import { render } from "react-dom";
|
|
7
|
+
import ErrorOverlay from "./ErrorOverlay";
|
|
8
|
+
const createErrorOverlay = params => {
|
|
9
|
+
const {
|
|
10
|
+
query,
|
|
11
|
+
networkError
|
|
12
|
+
} = params;
|
|
13
|
+
// If the element already present in DOM, return immediately.
|
|
20
14
|
if (document.getElementById("overlay-root")) {
|
|
21
15
|
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
(0, _reactDom.render)( /*#__PURE__*/_react.default.createElement(_ErrorOverlay.default, {
|
|
16
|
+
}
|
|
17
|
+
// Create root element to hold React tree.
|
|
18
|
+
const container = document.createElement("div");
|
|
19
|
+
container.id = "overlay-root";
|
|
20
|
+
// Insert root element into body.
|
|
21
|
+
const body = document.getElementsByTagName("body")[0];
|
|
22
|
+
body.appendChild(container);
|
|
23
|
+
// Mount the ErrorOverlay component into root element.
|
|
24
|
+
render(/*#__PURE__*/React.createElement(ErrorOverlay, {
|
|
32
25
|
query: query,
|
|
33
26
|
networkError: networkError
|
|
34
27
|
}), container);
|
|
35
28
|
};
|
|
29
|
+
export default createErrorOverlay;
|
|
36
30
|
|
|
37
|
-
|
|
38
|
-
exports.default = _default;
|
|
31
|
+
//# sourceMappingURL=createErrorOverlay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createErrorOverlay","params","query","networkError","document","getElementById","container","createElement","id","body","getElementsByTagName","appendChild"
|
|
1
|
+
{"version":3,"names":["React","render","ErrorOverlay","createErrorOverlay","params","query","networkError","document","getElementById","container","createElement","id","body","getElementsByTagName","appendChild"],"sources":["createErrorOverlay.tsx"],"sourcesContent":["import React from \"react\";\n/**\n * TODO fix with react 19\n */\n// eslint-disable-next-line react/no-deprecated\nimport { render } from \"react-dom\";\nimport ErrorOverlay from \"./ErrorOverlay\";\nimport type { ServerError, ServerParseError } from \"apollo-link-http-common\";\n\ninterface CreateErrorOverlayParams {\n query: string;\n networkError: Error | ServerError | ServerParseError;\n}\nconst createErrorOverlay = (params: CreateErrorOverlayParams): void => {\n const { query, networkError } = params;\n // If the element already present in DOM, return immediately.\n if (document.getElementById(\"overlay-root\")) {\n return;\n }\n // Create root element to hold React tree.\n const container: HTMLDivElement = document.createElement(\"div\");\n container.id = \"overlay-root\";\n // Insert root element into body.\n const body: HTMLBodyElement = document.getElementsByTagName(\"body\")[0];\n body.appendChild(container);\n // Mount the ErrorOverlay component into root element.\n render(<ErrorOverlay query={query} networkError={networkError} />, container);\n};\n\nexport default createErrorOverlay;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB;AACA;AACA;AACA;AACA,SAASC,MAAM,QAAQ,WAAW;AAClC,OAAOC,YAAY;AAOnB,MAAMC,kBAAkB,GAAIC,MAAgC,IAAW;EACnE,MAAM;IAAEC,KAAK;IAAEC;EAAa,CAAC,GAAGF,MAAM;EACtC;EACA,IAAIG,QAAQ,CAACC,cAAc,CAAC,cAAc,CAAC,EAAE;IACzC;EACJ;EACA;EACA,MAAMC,SAAyB,GAAGF,QAAQ,CAACG,aAAa,CAAC,KAAK,CAAC;EAC/DD,SAAS,CAACE,EAAE,GAAG,cAAc;EAC7B;EACA,MAAMC,IAAqB,GAAGL,QAAQ,CAACM,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;EACtED,IAAI,CAACE,WAAW,CAACL,SAAS,CAAC;EAC3B;EACAR,MAAM,cAACD,KAAA,CAAAU,aAAA,CAACR,YAAY;IAACG,KAAK,EAAEA,KAAM;IAACC,YAAY,EAAEA;EAAa,CAAE,CAAC,EAAEG,SAAS,CAAC;AACjF,CAAC;AAED,eAAeN,kBAAkB","ignoreList":[]}
|
|
@@ -1,65 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.NetworkErrorLinkPlugin = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
17
|
-
|
|
18
|
-
var _ApolloLinkPlugin2 = require("./ApolloLinkPlugin");
|
|
19
|
-
|
|
20
|
-
var _apolloLinkError = require("apollo-link-error");
|
|
21
|
-
|
|
22
|
-
var _language = require("graphql/language");
|
|
23
|
-
|
|
24
|
-
var _createErrorOverlay = _interopRequireDefault(require("./NetworkErrorLinkPlugin/createErrorOverlay"));
|
|
25
|
-
|
|
26
|
-
var _boolean = require("boolean");
|
|
27
|
-
|
|
28
|
-
var _config = require("../config");
|
|
1
|
+
import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
|
|
2
|
+
import { onError } from "apollo-link-error";
|
|
3
|
+
import { print } from "graphql/language";
|
|
4
|
+
import createErrorOverlay from "./NetworkErrorLinkPlugin/createErrorOverlay";
|
|
5
|
+
import { boolean } from "boolean";
|
|
6
|
+
import { config as appConfig } from "../config";
|
|
29
7
|
|
|
30
8
|
/**
|
|
31
9
|
* This plugin creates an ApolloLink that checks for `NetworkError` and shows an ErrorOverlay in the browser.
|
|
32
10
|
*/
|
|
33
|
-
|
|
34
|
-
(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
11
|
+
export class NetworkErrorLinkPlugin extends ApolloLinkPlugin {
|
|
12
|
+
createLink() {
|
|
13
|
+
return onError(({
|
|
14
|
+
networkError,
|
|
15
|
+
operation
|
|
16
|
+
}) => {
|
|
17
|
+
const debug = appConfig.getKey("DEBUG", boolean(process.env.REACT_APP_DEBUG));
|
|
18
|
+
if (networkError && debug) {
|
|
19
|
+
createErrorOverlay({
|
|
20
|
+
query: print(operation.query),
|
|
21
|
+
networkError
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// TODO: also print graphQLErrors
|
|
26
|
+
});
|
|
41
27
|
}
|
|
28
|
+
}
|
|
42
29
|
|
|
43
|
-
|
|
44
|
-
key: "createLink",
|
|
45
|
-
value: function createLink() {
|
|
46
|
-
return (0, _apolloLinkError.onError)(function (_ref) {
|
|
47
|
-
var networkError = _ref.networkError,
|
|
48
|
-
operation = _ref.operation;
|
|
49
|
-
|
|
50
|
-
var debug = _config.config.getKey("DEBUG", (0, _boolean.boolean)(process.env.REACT_APP_DEBUG));
|
|
51
|
-
|
|
52
|
-
if (networkError && debug) {
|
|
53
|
-
(0, _createErrorOverlay.default)({
|
|
54
|
-
query: (0, _language.print)(operation.query),
|
|
55
|
-
networkError: networkError
|
|
56
|
-
});
|
|
57
|
-
} // TODO: also print graphQLErrors
|
|
58
|
-
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}]);
|
|
62
|
-
return NetworkErrorLinkPlugin;
|
|
63
|
-
}(_ApolloLinkPlugin2.ApolloLinkPlugin);
|
|
64
|
-
|
|
65
|
-
exports.NetworkErrorLinkPlugin = NetworkErrorLinkPlugin;
|
|
30
|
+
//# sourceMappingURL=NetworkErrorLinkPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["ApolloLinkPlugin","onError","print","createErrorOverlay","boolean","config","appConfig","NetworkErrorLinkPlugin","createLink","networkError","operation","debug","getKey","process","env","REACT_APP_DEBUG","query"],"sources":["NetworkErrorLinkPlugin.ts"],"sourcesContent":["import { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { onError } from \"apollo-link-error\";\nimport { print } from \"graphql/language\";\nimport createErrorOverlay from \"./NetworkErrorLinkPlugin/createErrorOverlay\";\nimport { boolean } from \"boolean\";\nimport { config as appConfig } from \"~/config\";\n\n/**\n * This plugin creates an ApolloLink that checks for `NetworkError` and shows an ErrorOverlay in the browser.\n */\nexport class NetworkErrorLinkPlugin extends ApolloLinkPlugin {\n public override createLink() {\n return onError(({ networkError, operation }) => {\n const debug = appConfig.getKey(\"DEBUG\", boolean(process.env.REACT_APP_DEBUG));\n\n if (networkError && debug) {\n createErrorOverlay({ query: print(operation.query), networkError });\n }\n\n // TODO: also print graphQLErrors\n });\n }\n}\n"],"mappings":"AAAA,SAASA,gBAAgB;AACzB,SAASC,OAAO,QAAQ,mBAAmB;AAC3C,SAASC,KAAK,QAAQ,kBAAkB;AACxC,OAAOC,kBAAkB;AACzB,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,MAAM,IAAIC,SAAS;;AAE5B;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,SAASP,gBAAgB,CAAC;EACzCQ,UAAUA,CAAA,EAAG;IACzB,OAAOP,OAAO,CAAC,CAAC;MAAEQ,YAAY;MAAEC;IAAU,CAAC,KAAK;MAC5C,MAAMC,KAAK,GAAGL,SAAS,CAACM,MAAM,CAAC,OAAO,EAAER,OAAO,CAACS,OAAO,CAACC,GAAG,CAACC,eAAe,CAAC,CAAC;MAE7E,IAAIN,YAAY,IAAIE,KAAK,EAAE;QACvBR,kBAAkB,CAAC;UAAEa,KAAK,EAAEd,KAAK,CAACQ,SAAS,CAACM,KAAK,CAAC;UAAEP;QAAa,CAAC,CAAC;MACvE;;MAEA;IACJ,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -1,55 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.OmitTypenameLinkPlugin = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
17
|
-
|
|
18
|
-
var _apolloLink = require("apollo-link");
|
|
19
|
-
|
|
20
|
-
var _ApolloLinkPlugin2 = require("./ApolloLinkPlugin");
|
|
21
|
-
|
|
1
|
+
import { ApolloLink } from "apollo-link";
|
|
2
|
+
import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
|
|
22
3
|
function omitTypename(key, value) {
|
|
23
4
|
return key === "__typename" ? undefined : value;
|
|
24
5
|
}
|
|
6
|
+
|
|
25
7
|
/**
|
|
26
8
|
* This link removes `__typename` from the variables being sent to the API.
|
|
27
9
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
(0, _classCallCheck2.default)(this, OmitTypenameLinkPlugin);
|
|
37
|
-
return _super.apply(this, arguments);
|
|
10
|
+
export class OmitTypenameLinkPlugin extends ApolloLinkPlugin {
|
|
11
|
+
createLink() {
|
|
12
|
+
return new ApolloLink((operation, forward) => {
|
|
13
|
+
if (operation.variables) {
|
|
14
|
+
operation.variables = JSON.parse(JSON.stringify(operation.variables), omitTypename);
|
|
15
|
+
}
|
|
16
|
+
return forward(operation);
|
|
17
|
+
});
|
|
38
18
|
}
|
|
19
|
+
}
|
|
39
20
|
|
|
40
|
-
|
|
41
|
-
key: "createLink",
|
|
42
|
-
value: function createLink() {
|
|
43
|
-
return new _apolloLink.ApolloLink(function (operation, forward) {
|
|
44
|
-
if (operation.variables) {
|
|
45
|
-
operation.variables = JSON.parse(JSON.stringify(operation.variables), omitTypename);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return forward(operation);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}]);
|
|
52
|
-
return OmitTypenameLinkPlugin;
|
|
53
|
-
}(_ApolloLinkPlugin2.ApolloLinkPlugin);
|
|
54
|
-
|
|
55
|
-
exports.OmitTypenameLinkPlugin = OmitTypenameLinkPlugin;
|
|
21
|
+
//# sourceMappingURL=OmitTypenameLinkPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["omitTypename","key","value","undefined","OmitTypenameLinkPlugin","
|
|
1
|
+
{"version":3,"names":["ApolloLink","ApolloLinkPlugin","omitTypename","key","value","undefined","OmitTypenameLinkPlugin","createLink","operation","forward","variables","JSON","parse","stringify"],"sources":["OmitTypenameLinkPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\n\nfunction omitTypename(key: string, value: string): string | undefined {\n return key === \"__typename\" ? undefined : value;\n}\n\n/**\n * This link removes `__typename` from the variables being sent to the API.\n */\nexport class OmitTypenameLinkPlugin extends ApolloLinkPlugin {\n public override createLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (operation.variables) {\n operation.variables = JSON.parse(JSON.stringify(operation.variables), omitTypename);\n }\n return forward(operation);\n });\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,aAAa;AACxC,SAASC,gBAAgB;AAEzB,SAASC,YAAYA,CAACC,GAAW,EAAEC,KAAa,EAAsB;EAClE,OAAOD,GAAG,KAAK,YAAY,GAAGE,SAAS,GAAGD,KAAK;AACnD;;AAEA;AACA;AACA;AACA,OAAO,MAAME,sBAAsB,SAASL,gBAAgB,CAAC;EACzCM,UAAUA,CAAA,EAAe;IACrC,OAAO,IAAIP,UAAU,CAAC,CAACQ,SAAS,EAAEC,OAAO,KAAK;MAC1C,IAAID,SAAS,CAACE,SAAS,EAAE;QACrBF,SAAS,CAACE,SAAS,GAAGC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,SAAS,CAACL,SAAS,CAACE,SAAS,CAAC,EAAER,YAAY,CAAC;MACvF;MACA,OAAOO,OAAO,CAACD,SAAS,CAAC;IAC7B,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
package/plugins/RoutePlugin.d.ts
CHANGED