@webiny/app 5.43.2 → 6.0.0-alpha.0

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.
Files changed (155) hide show
  1. package/App.d.ts +3 -10
  2. package/App.js +70 -84
  3. package/App.js.map +1 -1
  4. package/AppContainer.d.ts +23 -0
  5. package/AppContainer.js +9 -0
  6. package/AppContainer.js.map +1 -0
  7. package/apollo-client/InMemoryCache.js +16 -47
  8. package/apollo-client/InMemoryCache.js.map +1 -1
  9. package/apollo-client/IntrospectionFragmentMatcher.js +33 -50
  10. package/apollo-client/IntrospectionFragmentMatcher.js.map +1 -1
  11. package/components/Image.js +11 -19
  12. package/components/Image.js.map +1 -1
  13. package/components/Routes.js +13 -23
  14. package/components/Routes.js.map +1 -1
  15. package/components/View.js +14 -26
  16. package/components/View.js.map +1 -1
  17. package/components/index.js +2 -19
  18. package/components/index.js.map +1 -1
  19. package/config/RouterConfig/Route.d.ts +30 -0
  20. package/config/RouterConfig/Route.js +42 -0
  21. package/config/RouterConfig/Route.js.map +1 -0
  22. package/config/RouterConfig.d.ts +32 -0
  23. package/config/RouterConfig.js +18 -0
  24. package/config/RouterConfig.js.map +1 -0
  25. package/config.js +9 -15
  26. package/config.js.map +1 -1
  27. package/contexts/Ui/index.js +28 -52
  28. package/contexts/Ui/index.js.map +1 -1
  29. package/core/DebounceRender.js +13 -24
  30. package/core/DebounceRender.js.map +1 -1
  31. package/core/Plugin.js +11 -19
  32. package/core/Plugin.js.map +1 -1
  33. package/core/Plugins.js +18 -24
  34. package/core/Plugins.js.map +1 -1
  35. package/core/Provider.js +9 -13
  36. package/core/Provider.js.map +1 -1
  37. package/core/Routes.js +14 -23
  38. package/core/Routes.js.map +1 -1
  39. package/core/createProvider.js +1 -7
  40. package/core/createProvider.js.map +1 -1
  41. package/core/createProviderPlugin.js +4 -10
  42. package/core/createProviderPlugin.js.map +1 -1
  43. package/hooks/useAutocomplete/index.js +1 -12
  44. package/hooks/useAutocomplete/index.js.map +1 -1
  45. package/hooks/useAutocomplete/useAutocomplete.js +9 -16
  46. package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
  47. package/hooks/useDataList/functions/getData.js +2 -11
  48. package/hooks/useDataList/functions/getData.js.map +1 -1
  49. package/hooks/useDataList/functions/getError.js +2 -11
  50. package/hooks/useDataList/functions/getError.js.map +1 -1
  51. package/hooks/useDataList/functions/getMeta.js +2 -11
  52. package/hooks/useDataList/functions/getMeta.js.map +1 -1
  53. package/hooks/useDataList/functions/index.js +3 -27
  54. package/hooks/useDataList/functions/index.js.map +1 -1
  55. package/hooks/useDataList/functions/searchDataByKey.js +4 -10
  56. package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
  57. package/hooks/useDataList/index.js +1 -12
  58. package/hooks/useDataList/index.js.map +1 -1
  59. package/hooks/useDataList/useDataList.js +78 -78
  60. package/hooks/useDataList/useDataList.js.map +1 -1
  61. package/hooks/useDataList/utils/index.js +2 -20
  62. package/hooks/useDataList/utils/index.js.map +1 -1
  63. package/hooks/useDataList/utils/prepareLoadListParams.js +9 -15
  64. package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
  65. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +10 -14
  66. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +1 -1
  67. package/hooks/useDataList/utils/types.js +1 -5
  68. package/hooks/useHandler.js +7 -12
  69. package/hooks/useHandler.js.map +1 -1
  70. package/hooks/useHandlers.js +11 -17
  71. package/hooks/useHandlers.js.map +1 -1
  72. package/hooks/useRegisterLegacyPlugin.js +5 -11
  73. package/hooks/useRegisterLegacyPlugin.js.map +1 -1
  74. package/hooks/useUi.d.ts +1 -1
  75. package/hooks/useUi.js +4 -10
  76. package/hooks/useUi.js.map +1 -1
  77. package/i18n/i18n.js +5 -13
  78. package/i18n/i18n.js.map +1 -1
  79. package/i18n/index.js +1 -13
  80. package/i18n/index.js.map +1 -1
  81. package/index.d.ts +1 -1
  82. package/index.js +17 -177
  83. package/index.js.map +1 -1
  84. package/package.json +10 -9
  85. package/plugins/AddQuerySelectionPlugin.js +62 -107
  86. package/plugins/AddQuerySelectionPlugin.js.map +1 -1
  87. package/plugins/ApolloCacheObjectIdPlugin.js +12 -31
  88. package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
  89. package/plugins/ApolloDynamicLink.js +19 -46
  90. package/plugins/ApolloDynamicLink.js.map +1 -1
  91. package/plugins/ApolloLinkPlugin.js +18 -37
  92. package/plugins/ApolloLinkPlugin.js.map +1 -1
  93. package/plugins/ConsoleLinkPlugin.js +20 -41
  94. package/plugins/ConsoleLinkPlugin.js.map +1 -1
  95. package/plugins/LocaleHeaderLinkPlugin.js +23 -40
  96. package/plugins/LocaleHeaderLinkPlugin.js.map +1 -1
  97. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +39 -51
  98. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
  99. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +68 -12
  100. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
  101. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +12 -18
  102. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
  103. package/plugins/NetworkErrorLinkPlugin.js +23 -40
  104. package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
  105. package/plugins/OmitTypenameLinkPlugin.js +11 -30
  106. package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
  107. package/plugins/RoutePlugin.js +12 -31
  108. package/plugins/RoutePlugin.js.map +1 -1
  109. package/plugins/TenantHeaderLinkPlugin.js +30 -47
  110. package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
  111. package/plugins/ViewPlugin.js +15 -36
  112. package/plugins/ViewPlugin.js.map +1 -1
  113. package/plugins/image.js +46 -53
  114. package/plugins/image.js.map +1 -1
  115. package/plugins/index.js +31 -53
  116. package/plugins/index.js.map +1 -1
  117. package/react-butterfiles/Files.js +208 -235
  118. package/react-butterfiles/Files.js.map +1 -1
  119. package/react-butterfiles/index.js +2 -8
  120. package/react-butterfiles/index.js.map +1 -1
  121. package/react-butterfiles/utils/generateId.js +1 -7
  122. package/react-butterfiles/utils/generateId.js.map +1 -1
  123. package/react-butterfiles/utils/readFileContent.js +4 -10
  124. package/react-butterfiles/utils/readFileContent.js.map +1 -1
  125. package/renderApp.js +4 -11
  126. package/renderApp.js.map +1 -1
  127. package/types.js +11 -11
  128. package/types.js.map +1 -1
  129. package/utils/createGenericContext.js +13 -22
  130. package/utils/createGenericContext.js.map +1 -1
  131. package/utils/createHashing.js +9 -15
  132. package/utils/createHashing.js.map +1 -1
  133. package/utils/getApiUrl.js +1 -8
  134. package/utils/getApiUrl.js.map +1 -1
  135. package/utils/getGqlApiUrl.js +3 -9
  136. package/utils/getGqlApiUrl.js.map +1 -1
  137. package/utils/getHeadlessCmsGqlApiUrl.js +7 -13
  138. package/utils/getHeadlessCmsGqlApiUrl.js.map +1 -1
  139. package/utils/getLocaleCode.js +6 -16
  140. package/utils/getLocaleCode.js.map +1 -1
  141. package/utils/getPrerenderId.js +1 -7
  142. package/utils/getPrerenderId.js.map +1 -1
  143. package/utils/getTenantId.js +7 -13
  144. package/utils/getTenantId.js.map +1 -1
  145. package/utils/index.js +10 -115
  146. package/utils/index.js.map +1 -1
  147. package/utils/isLocalhost.js +4 -12
  148. package/utils/isLocalhost.js.map +1 -1
  149. package/utils/isPrerendering.js +1 -7
  150. package/utils/isPrerendering.js.map +1 -1
  151. package/utils/legacyPluginToReactComponent.js +5 -11
  152. package/utils/legacyPluginToReactComponent.js.map +1 -1
  153. package/core/AddRoute.d.ts +0 -21
  154. package/core/AddRoute.js +0 -21
  155. package/core/AddRoute.js.map +0 -1
@@ -1,58 +1,31 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.ApolloDynamicLink = void 0;
8
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
11
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
- var _apolloLink = require("apollo-link");
14
- var _plugins = require("@webiny/plugins");
1
+ import { ApolloLink } from "apollo-link";
2
+ import { plugins } from "@webiny/plugins";
15
3
  function createLink(plugin) {
16
4
  try {
17
5
  return plugin.createLink();
18
6
  } catch (e) {
19
- console.error("Caught an error while executing \"createLink\" on plugin", plugin);
7
+ console.error(`Caught an error while executing "createLink" on plugin`, plugin);
20
8
  console.error(e);
21
9
  }
22
10
  return null;
23
11
  }
24
- var ApolloDynamicLink = exports.ApolloDynamicLink = /*#__PURE__*/function (_ApolloLink) {
25
- function ApolloDynamicLink() {
26
- var _this;
27
- (0, _classCallCheck2.default)(this, ApolloDynamicLink);
28
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
29
- args[_key] = arguments[_key];
12
+ export class ApolloDynamicLink extends ApolloLink {
13
+ cache = new Map();
14
+ request(operation, forward) {
15
+ const linkPlugins = plugins.byType("apollo-link");
16
+ if (!linkPlugins.length) {
17
+ return forward(operation);
30
18
  }
31
- _this = (0, _callSuper2.default)(this, ApolloDynamicLink, [].concat(args));
32
- (0, _defineProperty2.default)(_this, "cache", new Map());
33
- return _this;
34
- }
35
- (0, _inherits2.default)(ApolloDynamicLink, _ApolloLink);
36
- return (0, _createClass2.default)(ApolloDynamicLink, [{
37
- key: "request",
38
- value: function request(operation, forward) {
39
- var linkPlugins = _plugins.plugins.byType("apollo-link");
40
- if (!linkPlugins.length) {
41
- return forward(operation);
42
- }
43
- var cacheKey = linkPlugins.map(function (pl) {
44
- return pl.cacheKey;
45
- }).join(",");
46
- if (!this.cache.has(cacheKey)) {
47
- /**
48
- * We filter out falsy items from the linkPlugins because there might be some error while creating link.
49
- */
50
- var links = linkPlugins.map(createLink).filter(Boolean);
51
- this.cache.set(cacheKey, _apolloLink.ApolloLink.from(links));
52
- }
53
- return this.cache.get(cacheKey).request(operation, forward);
19
+ const cacheKey = linkPlugins.map(pl => pl.cacheKey).join(",");
20
+ if (!this.cache.has(cacheKey)) {
21
+ /**
22
+ * We filter out falsy items from the linkPlugins because there might be some error while creating link.
23
+ */
24
+ const links = linkPlugins.map(createLink).filter(Boolean);
25
+ this.cache.set(cacheKey, ApolloLink.from(links));
54
26
  }
55
- }]);
56
- }(_apolloLink.ApolloLink);
27
+ return this.cache.get(cacheKey).request(operation, forward);
28
+ }
29
+ }
57
30
 
58
31
  //# sourceMappingURL=ApolloDynamicLink.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_apolloLink","require","_plugins","createLink","plugin","e","console","error","ApolloDynamicLink","exports","_ApolloLink","_this","_classCallCheck2","default","_len","arguments","length","args","Array","_key","_callSuper2","concat","_defineProperty2","Map","_inherits2","_createClass2","key","value","request","operation","forward","linkPlugins","plugins","byType","cacheKey","map","pl","join","cache","has","links","filter","Boolean","set","ApolloLink","from","get"],"sources":["ApolloDynamicLink.ts"],"sourcesContent":["import { ApolloLink, NextLink } from \"apollo-link\";\nimport { plugins } from \"@webiny/plugins\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { Operation } from \"apollo-link/lib/types\";\n\nfunction createLink(plugin: ApolloLinkPlugin) {\n try {\n return plugin.createLink();\n } catch (e) {\n console.error(`Caught an error while executing \"createLink\" on plugin`, plugin);\n console.error(e);\n }\n return null;\n}\n\nexport class ApolloDynamicLink extends ApolloLink {\n private cache = new Map();\n\n public override request(operation: Operation, forward: NextLink) {\n const linkPlugins = plugins.byType<ApolloLinkPlugin>(\"apollo-link\");\n\n if (!linkPlugins.length) {\n return forward(operation);\n }\n\n const cacheKey = linkPlugins.map(pl => pl.cacheKey).join(\",\");\n\n if (!this.cache.has(cacheKey)) {\n /**\n * We filter out falsy items from the linkPlugins because there might be some error while creating link.\n */\n const links = linkPlugins.map(createLink).filter(Boolean) as ApolloLink[];\n this.cache.set(cacheKey, ApolloLink.from(links));\n }\n\n return this.cache.get(cacheKey).request(operation, forward);\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAIA,SAASE,UAAUA,CAACC,MAAwB,EAAE;EAC1C,IAAI;IACA,OAAOA,MAAM,CAACD,UAAU,CAAC,CAAC;EAC9B,CAAC,CAAC,OAAOE,CAAC,EAAE;IACRC,OAAO,CAACC,KAAK,6DAA2DH,MAAM,CAAC;IAC/EE,OAAO,CAACC,KAAK,CAACF,CAAC,CAAC;EACpB;EACA,OAAO,IAAI;AACf;AAAC,IAEYG,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,0BAAAE,WAAA;EAAA,SAAAF,kBAAA;IAAA,IAAAG,KAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAL,iBAAA;IAAA,SAAAM,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAR,KAAA,OAAAS,WAAA,CAAAP,OAAA,QAAAL,iBAAA,KAAAa,MAAA,CAAAJ,IAAA;IAAA,IAAAK,gBAAA,CAAAT,OAAA,EAAAF,KAAA,WACV,IAAIY,GAAG,CAAC,CAAC;IAAA,OAAAZ,KAAA;EAAA;EAAA,IAAAa,UAAA,CAAAX,OAAA,EAAAL,iBAAA,EAAAE,WAAA;EAAA,WAAAe,aAAA,CAAAZ,OAAA,EAAAL,iBAAA;IAAAkB,GAAA;IAAAC,KAAA,EAEzB,SAAgBC,OAAOA,CAACC,SAAoB,EAAEC,OAAiB,EAAE;MAC7D,IAAMC,WAAW,GAAGC,gBAAO,CAACC,MAAM,CAAmB,aAAa,CAAC;MAEnE,IAAI,CAACF,WAAW,CAACf,MAAM,EAAE;QACrB,OAAOc,OAAO,CAACD,SAAS,CAAC;MAC7B;MAEA,IAAMK,QAAQ,GAAGH,WAAW,CAACI,GAAG,CAAC,UAAAC,EAAE;QAAA,OAAIA,EAAE,CAACF,QAAQ;MAAA,EAAC,CAACG,IAAI,CAAC,GAAG,CAAC;MAE7D,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,GAAG,CAACL,QAAQ,CAAC,EAAE;QAC3B;AACZ;AACA;QACY,IAAMM,KAAK,GAAGT,WAAW,CAACI,GAAG,CAAChC,UAAU,CAAC,CAACsC,MAAM,CAACC,OAAO,CAAiB;QACzE,IAAI,CAACJ,KAAK,CAACK,GAAG,CAACT,QAAQ,EAAEU,sBAAU,CAACC,IAAI,CAACL,KAAK,CAAC,CAAC;MACpD;MAEA,OAAO,IAAI,CAACF,KAAK,CAACQ,GAAG,CAACZ,QAAQ,CAAC,CAACN,OAAO,CAACC,SAAS,EAAEC,OAAO,CAAC;IAC/D;EAAC;AAAA,EArBkCc,sBAAU","ignoreList":[]}
1
+ {"version":3,"names":["ApolloLink","plugins","createLink","plugin","e","console","error","ApolloDynamicLink","cache","Map","request","operation","forward","linkPlugins","byType","length","cacheKey","map","pl","join","has","links","filter","Boolean","set","from","get"],"sources":["ApolloDynamicLink.ts"],"sourcesContent":["import { ApolloLink, NextLink } from \"apollo-link\";\nimport { plugins } from \"@webiny/plugins\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { Operation } from \"apollo-link/lib/types\";\n\nfunction createLink(plugin: ApolloLinkPlugin) {\n try {\n return plugin.createLink();\n } catch (e) {\n console.error(`Caught an error while executing \"createLink\" on plugin`, plugin);\n console.error(e);\n }\n return null;\n}\n\nexport class ApolloDynamicLink extends ApolloLink {\n private cache = new Map();\n\n public override request(operation: Operation, forward: NextLink) {\n const linkPlugins = plugins.byType<ApolloLinkPlugin>(\"apollo-link\");\n\n if (!linkPlugins.length) {\n return forward(operation);\n }\n\n const cacheKey = linkPlugins.map(pl => pl.cacheKey).join(\",\");\n\n if (!this.cache.has(cacheKey)) {\n /**\n * We filter out falsy items from the linkPlugins because there might be some error while creating link.\n */\n const links = linkPlugins.map(createLink).filter(Boolean) as ApolloLink[];\n this.cache.set(cacheKey, ApolloLink.from(links));\n }\n\n return this.cache.get(cacheKey).request(operation, forward);\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAkB,aAAa;AAClD,SAASC,OAAO,QAAQ,iBAAiB;AAIzC,SAASC,UAAUA,CAACC,MAAwB,EAAE;EAC1C,IAAI;IACA,OAAOA,MAAM,CAACD,UAAU,CAAC,CAAC;EAC9B,CAAC,CAAC,OAAOE,CAAC,EAAE;IACRC,OAAO,CAACC,KAAK,CAAC,wDAAwD,EAAEH,MAAM,CAAC;IAC/EE,OAAO,CAACC,KAAK,CAACF,CAAC,CAAC;EACpB;EACA,OAAO,IAAI;AACf;AAEA,OAAO,MAAMG,iBAAiB,SAASP,UAAU,CAAC;EACtCQ,KAAK,GAAG,IAAIC,GAAG,CAAC,CAAC;EAETC,OAAOA,CAACC,SAAoB,EAAEC,OAAiB,EAAE;IAC7D,MAAMC,WAAW,GAAGZ,OAAO,CAACa,MAAM,CAAmB,aAAa,CAAC;IAEnE,IAAI,CAACD,WAAW,CAACE,MAAM,EAAE;MACrB,OAAOH,OAAO,CAACD,SAAS,CAAC;IAC7B;IAEA,MAAMK,QAAQ,GAAGH,WAAW,CAACI,GAAG,CAACC,EAAE,IAAIA,EAAE,CAACF,QAAQ,CAAC,CAACG,IAAI,CAAC,GAAG,CAAC;IAE7D,IAAI,CAAC,IAAI,CAACX,KAAK,CAACY,GAAG,CAACJ,QAAQ,CAAC,EAAE;MAC3B;AACZ;AACA;MACY,MAAMK,KAAK,GAAGR,WAAW,CAACI,GAAG,CAACf,UAAU,CAAC,CAACoB,MAAM,CAACC,OAAO,CAAiB;MACzE,IAAI,CAACf,KAAK,CAACgB,GAAG,CAACR,QAAQ,EAAEhB,UAAU,CAACyB,IAAI,CAACJ,KAAK,CAAC,CAAC;IACpD;IAEA,OAAO,IAAI,CAACb,KAAK,CAACkB,GAAG,CAACV,QAAQ,CAAC,CAACN,OAAO,CAACC,SAAS,EAAEC,OAAO,CAAC;EAC/D;AACJ","ignoreList":[]}
@@ -1,41 +1,22 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.ApolloLinkPlugin = void 0;
8
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
11
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
- var _nanoid = require("nanoid");
14
- var _plugins = require("@webiny/plugins");
15
- var ApolloLinkPlugin = exports.ApolloLinkPlugin = /*#__PURE__*/function (_Plugin) {
16
- function ApolloLinkPlugin(factory) {
17
- var _this;
18
- (0, _classCallCheck2.default)(this, ApolloLinkPlugin);
19
- _this = (0, _callSuper2.default)(this, ApolloLinkPlugin);
20
- _this.factory = factory;
21
- _this.cacheKey = (0, _nanoid.nanoid)();
22
- return _this;
1
+ import { nanoid } from "nanoid";
2
+ import { Plugin } from "@webiny/plugins";
3
+ export class ApolloLinkPlugin extends Plugin {
4
+ static type = "apollo-link";
5
+ constructor(factory) {
6
+ super();
7
+ this.factory = factory;
8
+ this.cacheKey = nanoid();
23
9
  }
24
- (0, _inherits2.default)(ApolloLinkPlugin, _Plugin);
25
- return (0, _createClass2.default)(ApolloLinkPlugin, [{
26
- key: "createLink",
27
- value: function createLink() {
28
- if (this.cache) {
29
- return this.cache;
30
- }
31
- if (typeof this.factory === "function") {
32
- this.cache = this.factory();
33
- return this.cache;
34
- }
35
- throw Error("Missing ApolloLinkFactory in plugin \"".concat(this.name, "\"! Either pass a factory to ApolloLinkPlugin constructor or extend the class and override the \"createLink\" method."));
10
+ createLink() {
11
+ if (this.cache) {
12
+ return this.cache;
13
+ }
14
+ if (typeof this.factory === "function") {
15
+ this.cache = this.factory();
16
+ return this.cache;
36
17
  }
37
- }]);
38
- }(_plugins.Plugin);
39
- (0, _defineProperty2.default)(ApolloLinkPlugin, "type", "apollo-link");
18
+ throw Error(`Missing ApolloLinkFactory in plugin "${this.name}"! Either pass a factory to ApolloLinkPlugin constructor or extend the class and override the "createLink" method.`);
19
+ }
20
+ }
40
21
 
41
22
  //# sourceMappingURL=ApolloLinkPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_nanoid","require","_plugins","ApolloLinkPlugin","exports","_Plugin","factory","_this","_classCallCheck2","default","_callSuper2","cacheKey","nanoid","_inherits2","_createClass2","key","value","createLink","cache","Error","concat","name","Plugin","_defineProperty2"],"sources":["ApolloLinkPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport { nanoid } from \"nanoid\";\nimport { Plugin } from \"@webiny/plugins\";\n\nexport interface ApolloLinkFactory {\n (): ApolloLink;\n}\n\nexport class ApolloLinkPlugin extends Plugin {\n public static override readonly type: string = \"apollo-link\";\n public readonly cacheKey;\n private readonly factory?: ApolloLinkFactory;\n private cache?: ApolloLink;\n\n constructor(factory?: ApolloLinkFactory) {\n super();\n this.factory = factory;\n this.cacheKey = nanoid();\n }\n\n public createLink(): ApolloLink {\n if (this.cache) {\n return this.cache;\n }\n\n if (typeof this.factory === \"function\") {\n this.cache = this.factory();\n\n return this.cache;\n }\n\n throw Error(\n `Missing ApolloLinkFactory in plugin \"${this.name}\"! Either pass a factory to ApolloLinkPlugin constructor or extend the class and override the \"createLink\" method.`\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAyC,IAM5BE,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,0BAAAE,OAAA;EAMzB,SAAAF,iBAAYG,OAA2B,EAAE;IAAA,IAAAC,KAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAN,gBAAA;IACrCI,KAAA,OAAAG,WAAA,CAAAD,OAAA,QAAAN,gBAAA;IACAI,KAAA,CAAKD,OAAO,GAAGA,OAAO;IACtBC,KAAA,CAAKI,QAAQ,GAAG,IAAAC,cAAM,EAAC,CAAC;IAAC,OAAAL,KAAA;EAC7B;EAAC,IAAAM,UAAA,CAAAJ,OAAA,EAAAN,gBAAA,EAAAE,OAAA;EAAA,WAAAS,aAAA,CAAAL,OAAA,EAAAN,gBAAA;IAAAY,GAAA;IAAAC,KAAA,EAED,SAAOC,UAAUA,CAAA,EAAe;MAC5B,IAAI,IAAI,CAACC,KAAK,EAAE;QACZ,OAAO,IAAI,CAACA,KAAK;MACrB;MAEA,IAAI,OAAO,IAAI,CAACZ,OAAO,KAAK,UAAU,EAAE;QACpC,IAAI,CAACY,KAAK,GAAG,IAAI,CAACZ,OAAO,CAAC,CAAC;QAE3B,OAAO,IAAI,CAACY,KAAK;MACrB;MAEA,MAAMC,KAAK,0CAAAC,MAAA,CACiC,IAAI,CAACC,IAAI,0HACrD,CAAC;IACL;EAAC;AAAA,EA1BiCC,eAAM;AAAA,IAAAC,gBAAA,CAAAd,OAAA,EAA/BN,gBAAgB,UACsB,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["nanoid","Plugin","ApolloLinkPlugin","type","constructor","factory","cacheKey","createLink","cache","Error","name"],"sources":["ApolloLinkPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport { nanoid } from \"nanoid\";\nimport { Plugin } from \"@webiny/plugins\";\n\nexport interface ApolloLinkFactory {\n (): ApolloLink;\n}\n\nexport class ApolloLinkPlugin extends Plugin {\n public static override readonly type: string = \"apollo-link\";\n public readonly cacheKey;\n private readonly factory?: ApolloLinkFactory;\n private cache?: ApolloLink;\n\n constructor(factory?: ApolloLinkFactory) {\n super();\n this.factory = factory;\n this.cacheKey = nanoid();\n }\n\n public createLink(): ApolloLink {\n if (this.cache) {\n return this.cache;\n }\n\n if (typeof this.factory === \"function\") {\n this.cache = this.factory();\n\n return this.cache;\n }\n\n throw Error(\n `Missing ApolloLinkFactory in plugin \"${this.name}\"! Either pass a factory to ApolloLinkPlugin constructor or extend the class and override the \"createLink\" method.`\n );\n }\n}\n"],"mappings":"AACA,SAASA,MAAM,QAAQ,QAAQ;AAC/B,SAASC,MAAM,QAAQ,iBAAiB;AAMxC,OAAO,MAAMC,gBAAgB,SAASD,MAAM,CAAC;EACzC,OAAgCE,IAAI,GAAW,aAAa;EAK5DC,WAAWA,CAACC,OAA2B,EAAE;IACrC,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,QAAQ,GAAGN,MAAM,CAAC,CAAC;EAC5B;EAEOO,UAAUA,CAAA,EAAe;IAC5B,IAAI,IAAI,CAACC,KAAK,EAAE;MACZ,OAAO,IAAI,CAACA,KAAK;IACrB;IAEA,IAAI,OAAO,IAAI,CAACH,OAAO,KAAK,UAAU,EAAE;MACpC,IAAI,CAACG,KAAK,GAAG,IAAI,CAACH,OAAO,CAAC,CAAC;MAE3B,OAAO,IAAI,CAACG,KAAK;IACrB;IAEA,MAAMC,KAAK,CACP,wCAAwC,IAAI,CAACC,IAAI,oHACrD,CAAC;EACL;AACJ","ignoreList":[]}
@@ -1,47 +1,26 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.ConsoleLinkPlugin = void 0;
8
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
- var _apolloLink = require("apollo-link");
14
- var _ApolloLinkPlugin2 = require("./ApolloLinkPlugin");
1
+ import { ApolloLink } from "apollo-link";
2
+ import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
15
3
  /**
16
4
  * This link checks for presence of `extensions.console` in the response and logs all items to browser console.
17
5
  */
18
- var ConsoleLinkPlugin = exports.ConsoleLinkPlugin = /*#__PURE__*/function (_ApolloLinkPlugin) {
19
- function ConsoleLinkPlugin() {
20
- (0, _classCallCheck2.default)(this, ConsoleLinkPlugin);
21
- return (0, _callSuper2.default)(this, ConsoleLinkPlugin, arguments);
22
- }
23
- (0, _inherits2.default)(ConsoleLinkPlugin, _ApolloLinkPlugin);
24
- return (0, _createClass2.default)(ConsoleLinkPlugin, [{
25
- key: "createLink",
26
- value: function createLink() {
27
- return new _apolloLink.ApolloLink(function (operation, forward) {
28
- var firstDefinition = operation.query.definitions[0];
29
- var isQuery = firstDefinition["operation"] === "query";
30
- return forward(operation).map(function (data) {
31
- if (data.extensions && Array.isArray(data.extensions.console) && data.extensions.console.length) {
32
- var variables = isQuery ? JSON.stringify(operation.variables) : "{ see request details in the Network tab }";
33
- console.groupCollapsed("Logs for graphQL ".concat(isQuery ? "query" : "mutation", ": %c").concat(operation.operationName || "anonymous operation", " %c").concat(variables, "%c"), "color: #fa5a28", "color: #6b6b6b", "color: black");
34
- data.extensions.console.forEach(function (log) {
35
- var _console;
36
- (_console = console)[log.method].apply(_console, (0, _toConsumableArray2.default)(log.args));
37
- });
38
- console.groupEnd();
39
- }
40
- return data;
41
- });
6
+ export class ConsoleLinkPlugin extends ApolloLinkPlugin {
7
+ createLink() {
8
+ return new ApolloLink((operation, forward) => {
9
+ const firstDefinition = operation.query.definitions[0];
10
+ const isQuery = firstDefinition["operation"] === "query";
11
+ return forward(operation).map(data => {
12
+ if (data.extensions && Array.isArray(data.extensions.console) && data.extensions.console.length) {
13
+ const variables = isQuery ? JSON.stringify(operation.variables) : "{ see request details in the Network tab }";
14
+ console.groupCollapsed(`Logs for graphQL ${isQuery ? "query" : "mutation"}: %c${operation.operationName || "anonymous operation"} %c${variables}%c`, "color: #fa5a28", "color: #6b6b6b", "color: black");
15
+ data.extensions.console.forEach(log => {
16
+ console[log.method](...log.args);
17
+ });
18
+ console.groupEnd();
19
+ }
20
+ return data;
42
21
  });
43
- }
44
- }]);
45
- }(_ApolloLinkPlugin2.ApolloLinkPlugin);
22
+ });
23
+ }
24
+ }
46
25
 
47
26
  //# sourceMappingURL=ConsoleLinkPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_apolloLink","require","_ApolloLinkPlugin2","ConsoleLinkPlugin","exports","_ApolloLinkPlugin","_classCallCheck2","default","_callSuper2","arguments","_inherits2","_createClass2","key","value","createLink","ApolloLink","operation","forward","firstDefinition","query","definitions","isQuery","map","data","extensions","Array","isArray","console","length","variables","JSON","stringify","groupCollapsed","concat","operationName","forEach","log","_console","method","apply","_toConsumableArray2","args","groupEnd","ApolloLinkPlugin"],"sources":["ConsoleLinkPlugin.ts"],"sourcesContent":["import { ApolloLink, FetchResult as BaseFetchResult } from \"apollo-link\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { OperationDefinitionNode } from \"graphql/language/ast\";\n\ninterface Log {\n args: any[];\n method: \"error\" | \"info\" | \"log\" | \"warn\";\n}\n\ninterface FetchResult extends BaseFetchResult {\n extensions?: {\n console?: Log[];\n };\n}\n\n/**\n * This link checks for presence of `extensions.console` in the response and logs all items to browser console.\n */\nexport class ConsoleLinkPlugin extends ApolloLinkPlugin {\n public override createLink() {\n return new ApolloLink((operation, forward) => {\n const firstDefinition = operation.query.definitions[0] as OperationDefinitionNode;\n const isQuery = firstDefinition[\"operation\"] === \"query\";\n\n return forward(operation).map((data: FetchResult) => {\n if (\n data.extensions &&\n Array.isArray(data.extensions.console) &&\n data.extensions.console.length\n ) {\n const variables = isQuery\n ? JSON.stringify(operation.variables)\n : \"{ see request details in the Network tab }\";\n console.groupCollapsed(\n `Logs for graphQL ${isQuery ? \"query\" : \"mutation\"}: %c${\n operation.operationName || \"anonymous operation\"\n } %c${variables}%c`,\n \"color: #fa5a28\",\n \"color: #6b6b6b\",\n \"color: black\"\n );\n data.extensions.console.forEach((log: Log) => {\n console[log.method](...log.args);\n });\n console.groupEnd();\n }\n\n return data;\n });\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAcA;AACA;AACA;AAFA,IAGaE,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,0BAAAE,iBAAA;EAAA,SAAAF,kBAAA;IAAA,IAAAG,gBAAA,CAAAC,OAAA,QAAAJ,iBAAA;IAAA,WAAAK,WAAA,CAAAD,OAAA,QAAAJ,iBAAA,EAAAM,SAAA;EAAA;EAAA,IAAAC,UAAA,CAAAH,OAAA,EAAAJ,iBAAA,EAAAE,iBAAA;EAAA,WAAAM,aAAA,CAAAJ,OAAA,EAAAJ,iBAAA;IAAAS,GAAA;IAAAC,KAAA,EAC1B,SAAgBC,UAAUA,CAAA,EAAG;MACzB,OAAO,IAAIC,sBAAU,CAAC,UAACC,SAAS,EAAEC,OAAO,EAAK;QAC1C,IAAMC,eAAe,GAAGF,SAAS,CAACG,KAAK,CAACC,WAAW,CAAC,CAAC,CAA4B;QACjF,IAAMC,OAAO,GAAGH,eAAe,CAAC,WAAW,CAAC,KAAK,OAAO;QAExD,OAAOD,OAAO,CAACD,SAAS,CAAC,CAACM,GAAG,CAAC,UAACC,IAAiB,EAAK;UACjD,IACIA,IAAI,CAACC,UAAU,IACfC,KAAK,CAACC,OAAO,CAACH,IAAI,CAACC,UAAU,CAACG,OAAO,CAAC,IACtCJ,IAAI,CAACC,UAAU,CAACG,OAAO,CAACC,MAAM,EAChC;YACE,IAAMC,SAAS,GAAGR,OAAO,GACnBS,IAAI,CAACC,SAAS,CAACf,SAAS,CAACa,SAAS,CAAC,GACnC,4CAA4C;YAClDF,OAAO,CAACK,cAAc,qBAAAC,MAAA,CACEZ,OAAO,GAAG,OAAO,GAAG,UAAU,UAAAY,MAAA,CAC9CjB,SAAS,CAACkB,aAAa,IAAI,qBAAqB,SAAAD,MAAA,CAC9CJ,SAAS,SACf,gBAAgB,EAChB,gBAAgB,EAChB,cACJ,CAAC;YACDN,IAAI,CAACC,UAAU,CAACG,OAAO,CAACQ,OAAO,CAAC,UAACC,GAAQ,EAAK;cAAA,IAAAC,QAAA;cAC1C,CAAAA,QAAA,GAAAV,OAAO,EAACS,GAAG,CAACE,MAAM,CAAC,CAAAC,KAAA,CAAAF,QAAA,MAAAG,mBAAA,CAAAjC,OAAA,EAAI6B,GAAG,CAACK,IAAI,EAAC;YACpC,CAAC,CAAC;YACFd,OAAO,CAACe,QAAQ,CAAC,CAAC;UACtB;UAEA,OAAOnB,IAAI;QACf,CAAC,CAAC;MACN,CAAC,CAAC;IACN;EAAC;AAAA,EAhCkCoB,mCAAgB","ignoreList":[]}
1
+ {"version":3,"names":["ApolloLink","ApolloLinkPlugin","ConsoleLinkPlugin","createLink","operation","forward","firstDefinition","query","definitions","isQuery","map","data","extensions","Array","isArray","console","length","variables","JSON","stringify","groupCollapsed","operationName","forEach","log","method","args","groupEnd"],"sources":["ConsoleLinkPlugin.ts"],"sourcesContent":["import { ApolloLink, FetchResult as BaseFetchResult } from \"apollo-link\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { OperationDefinitionNode } from \"graphql/language/ast\";\n\ninterface Log {\n args: any[];\n method: \"error\" | \"info\" | \"log\" | \"warn\";\n}\n\ninterface FetchResult extends BaseFetchResult {\n extensions?: {\n console?: Log[];\n };\n}\n\n/**\n * This link checks for presence of `extensions.console` in the response and logs all items to browser console.\n */\nexport class ConsoleLinkPlugin extends ApolloLinkPlugin {\n public override createLink() {\n return new ApolloLink((operation, forward) => {\n const firstDefinition = operation.query.definitions[0] as OperationDefinitionNode;\n const isQuery = firstDefinition[\"operation\"] === \"query\";\n\n return forward(operation).map((data: FetchResult) => {\n if (\n data.extensions &&\n Array.isArray(data.extensions.console) &&\n data.extensions.console.length\n ) {\n const variables = isQuery\n ? JSON.stringify(operation.variables)\n : \"{ see request details in the Network tab }\";\n console.groupCollapsed(\n `Logs for graphQL ${isQuery ? \"query\" : \"mutation\"}: %c${\n operation.operationName || \"anonymous operation\"\n } %c${variables}%c`,\n \"color: #fa5a28\",\n \"color: #6b6b6b\",\n \"color: black\"\n );\n data.extensions.console.forEach((log: Log) => {\n console[log.method](...log.args);\n });\n console.groupEnd();\n }\n\n return data;\n });\n });\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAwC,aAAa;AACxE,SAASC,gBAAgB;AAczB;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,SAASD,gBAAgB,CAAC;EACpCE,UAAUA,CAAA,EAAG;IACzB,OAAO,IAAIH,UAAU,CAAC,CAACI,SAAS,EAAEC,OAAO,KAAK;MAC1C,MAAMC,eAAe,GAAGF,SAAS,CAACG,KAAK,CAACC,WAAW,CAAC,CAAC,CAA4B;MACjF,MAAMC,OAAO,GAAGH,eAAe,CAAC,WAAW,CAAC,KAAK,OAAO;MAExD,OAAOD,OAAO,CAACD,SAAS,CAAC,CAACM,GAAG,CAAEC,IAAiB,IAAK;QACjD,IACIA,IAAI,CAACC,UAAU,IACfC,KAAK,CAACC,OAAO,CAACH,IAAI,CAACC,UAAU,CAACG,OAAO,CAAC,IACtCJ,IAAI,CAACC,UAAU,CAACG,OAAO,CAACC,MAAM,EAChC;UACE,MAAMC,SAAS,GAAGR,OAAO,GACnBS,IAAI,CAACC,SAAS,CAACf,SAAS,CAACa,SAAS,CAAC,GACnC,4CAA4C;UAClDF,OAAO,CAACK,cAAc,CAClB,oBAAoBX,OAAO,GAAG,OAAO,GAAG,UAAU,OAC9CL,SAAS,CAACiB,aAAa,IAAI,qBAAqB,MAC9CJ,SAAS,IAAI,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,cACJ,CAAC;UACDN,IAAI,CAACC,UAAU,CAACG,OAAO,CAACO,OAAO,CAAEC,GAAQ,IAAK;YAC1CR,OAAO,CAACQ,GAAG,CAACC,MAAM,CAAC,CAAC,GAAGD,GAAG,CAACE,IAAI,CAAC;UACpC,CAAC,CAAC;UACFV,OAAO,CAACW,QAAQ,CAAC,CAAC;QACtB;QAEA,OAAOf,IAAI;MACf,CAAC,CAAC;IACN,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
@@ -1,49 +1,32 @@
1
- "use strict";
1
+ import { setContext } from "apollo-link-context";
2
+ import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
3
+ import { getLocaleCode } from "../utils";
2
4
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.LocaleHeaderLinkPlugin = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
- var _apolloLinkContext = require("apollo-link-context");
14
- var _ApolloLinkPlugin2 = require("./ApolloLinkPlugin");
15
- var _utils = require("../utils");
16
5
  /**
17
6
  * Append `x-i18n-locale` header from URL query (necessary for prerendering service).
18
7
  */
19
- var LocaleHeaderLinkPlugin = exports.LocaleHeaderLinkPlugin = /*#__PURE__*/function (_ApolloLinkPlugin) {
20
- function LocaleHeaderLinkPlugin(locale) {
21
- var _this;
22
- (0, _classCallCheck2.default)(this, LocaleHeaderLinkPlugin);
23
- _this = (0, _callSuper2.default)(this, LocaleHeaderLinkPlugin);
24
- _this.locale = locale || (0, _utils.getLocaleCode)();
25
- return _this;
8
+ export class LocaleHeaderLinkPlugin extends ApolloLinkPlugin {
9
+ constructor(locale) {
10
+ super();
11
+ this.locale = locale || getLocaleCode();
26
12
  }
27
- (0, _inherits2.default)(LocaleHeaderLinkPlugin, _ApolloLinkPlugin);
28
- return (0, _createClass2.default)(LocaleHeaderLinkPlugin, [{
29
- key: "createLink",
30
- value: function createLink() {
31
- var _this2 = this;
32
- return (0, _apolloLinkContext.setContext)(function (_, _ref) {
33
- var headers = _ref.headers;
34
- if (_this2.locale) {
35
- return {
36
- headers: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, headers), {}, {
37
- "x-i18n-locale": "content:".concat(_this2.locale, ";")
38
- })
39
- };
40
- }
13
+ createLink() {
14
+ return setContext((_, {
15
+ headers
16
+ }) => {
17
+ if (this.locale) {
41
18
  return {
42
- headers: headers
19
+ headers: {
20
+ ...headers,
21
+ "x-i18n-locale": `content:${this.locale};`
22
+ }
43
23
  };
44
- });
45
- }
46
- }]);
47
- }(_ApolloLinkPlugin2.ApolloLinkPlugin);
24
+ }
25
+ return {
26
+ headers
27
+ };
28
+ });
29
+ }
30
+ }
48
31
 
49
32
  //# sourceMappingURL=LocaleHeaderLinkPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_apolloLinkContext","require","_ApolloLinkPlugin2","_utils","LocaleHeaderLinkPlugin","exports","_ApolloLinkPlugin","locale","_this","_classCallCheck2","default","_callSuper2","getLocaleCode","_inherits2","_createClass2","key","value","createLink","_this2","setContext","_","_ref","headers","_objectSpread2","concat","ApolloLinkPlugin"],"sources":["LocaleHeaderLinkPlugin.ts"],"sourcesContent":["import { setContext } from \"apollo-link-context\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { ApolloLink } from \"apollo-link\";\nimport { getLocaleCode } from \"~/utils\";\n\n/**\n * Append `x-i18n-locale` header from URL query (necessary for prerendering service).\n */\nexport class LocaleHeaderLinkPlugin extends ApolloLinkPlugin {\n private readonly locale: string;\n\n constructor(locale?: string) {\n super();\n\n this.locale = locale || (getLocaleCode() as string);\n }\n\n public override createLink(): ApolloLink {\n return setContext((_, { headers }) => {\n if (this.locale) {\n return {\n headers: {\n ...headers,\n \"x-i18n-locale\": `content:${this.locale};`\n }\n };\n }\n\n return { headers };\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAEA;AACA;AACA;AAFA,IAGaG,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,0BAAAE,iBAAA;EAG/B,SAAAF,uBAAYG,MAAe,EAAE;IAAA,IAAAC,KAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAN,sBAAA;IACzBI,KAAA,OAAAG,WAAA,CAAAD,OAAA,QAAAN,sBAAA;IAEAI,KAAA,CAAKD,MAAM,GAAGA,MAAM,IAAK,IAAAK,oBAAa,EAAC,CAAY;IAAC,OAAAJ,KAAA;EACxD;EAAC,IAAAK,UAAA,CAAAH,OAAA,EAAAN,sBAAA,EAAAE,iBAAA;EAAA,WAAAQ,aAAA,CAAAJ,OAAA,EAAAN,sBAAA;IAAAW,GAAA;IAAAC,KAAA,EAED,SAAgBC,UAAUA,CAAA,EAAe;MAAA,IAAAC,MAAA;MACrC,OAAO,IAAAC,6BAAU,EAAC,UAACC,CAAC,EAAAC,IAAA,EAAkB;QAAA,IAAdC,OAAO,GAAAD,IAAA,CAAPC,OAAO;QAC3B,IAAIJ,MAAI,CAACX,MAAM,EAAE;UACb,OAAO;YACHe,OAAO,MAAAC,cAAA,CAAAb,OAAA,MAAAa,cAAA,CAAAb,OAAA,MACAY,OAAO;cACV,eAAe,aAAAE,MAAA,CAAaN,MAAI,CAACX,MAAM;YAAG;UAElD,CAAC;QACL;QAEA,OAAO;UAAEe,OAAO,EAAPA;QAAQ,CAAC;MACtB,CAAC,CAAC;IACN;EAAC;AAAA,EAtBuCG,mCAAgB","ignoreList":[]}
1
+ {"version":3,"names":["setContext","ApolloLinkPlugin","getLocaleCode","LocaleHeaderLinkPlugin","constructor","locale","createLink","_","headers"],"sources":["LocaleHeaderLinkPlugin.ts"],"sourcesContent":["import { setContext } from \"apollo-link-context\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { ApolloLink } from \"apollo-link\";\nimport { getLocaleCode } from \"~/utils\";\n\n/**\n * Append `x-i18n-locale` header from URL query (necessary for prerendering service).\n */\nexport class LocaleHeaderLinkPlugin extends ApolloLinkPlugin {\n private readonly locale: string;\n\n constructor(locale?: string) {\n super();\n\n this.locale = locale || (getLocaleCode() as string);\n }\n\n public override createLink(): ApolloLink {\n return setContext((_, { headers }) => {\n if (this.locale) {\n return {\n headers: {\n ...headers,\n \"x-i18n-locale\": `content:${this.locale};`\n }\n };\n }\n\n return { headers };\n });\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,qBAAqB;AAChD,SAASC,gBAAgB;AAEzB,SAASC,aAAa;;AAEtB;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,SAASF,gBAAgB,CAAC;EAGzDG,WAAWA,CAACC,MAAe,EAAE;IACzB,KAAK,CAAC,CAAC;IAEP,IAAI,CAACA,MAAM,GAAGA,MAAM,IAAKH,aAAa,CAAC,CAAY;EACvD;EAEgBI,UAAUA,CAAA,EAAe;IACrC,OAAON,UAAU,CAAC,CAACO,CAAC,EAAE;MAAEC;IAAQ,CAAC,KAAK;MAClC,IAAI,IAAI,CAACH,MAAM,EAAE;QACb,OAAO;UACHG,OAAO,EAAE;YACL,GAAGA,OAAO;YACV,eAAe,EAAE,WAAW,IAAI,CAACH,MAAM;UAC3C;QACJ,CAAC;MACL;MAEA,OAAO;QAAEG;MAAQ,CAAC;IACtB,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
@@ -1,78 +1,66 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
- var _react = _interopRequireWildcard(require("react"));
12
- var _get = _interopRequireDefault(require("lodash/get"));
13
- var _Button = require("@webiny/ui/Button");
14
- var _Typography = require("@webiny/ui/Typography");
15
- var _i18n = require("../../i18n");
16
- var _StyledComponents = require("./StyledComponents");
17
- var _close_24px = require("./assets/close_24px.svg");
18
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
19
- var t = _i18n.i18n.ns("app/graphql/error-overlay");
20
- var ENVIRONMENT_VARIABLES_ARTICLE_LINK = "https://www.webiny.com/docs/how-to-guides/environment-variables";
21
- var ErrorOverlay = function ErrorOverlay(props) {
22
- var query = props.query,
23
- networkError = props.networkError;
24
- var _useState = (0, _react.useState)(true),
25
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
26
- open = _useState2[0],
27
- setOpen = _useState2[1];
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);
28
16
  // Log error in browser's developer console for further inspection.
29
17
  console.error({
30
- networkError: networkError
18
+ networkError
31
19
  });
32
20
  if (!open) {
33
21
  return null;
34
22
  }
35
- var stackTrace = (0, _get.default)(networkError, "result.error.stack");
36
- 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", {
37
25
  className: "inner"
38
- }, /*#__PURE__*/_react.default.createElement("div", {
26
+ }, /*#__PURE__*/React.createElement("div", {
39
27
  className: "header"
40
- }, /*#__PURE__*/_react.default.createElement("div", {
28
+ }, /*#__PURE__*/React.createElement("div", {
41
29
  className: "header__title"
42
- }, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
30
+ }, /*#__PURE__*/React.createElement(Typography, {
43
31
  use: "headline4"
44
- }, networkError.message)), /*#__PURE__*/_react.default.createElement("div", {
32
+ }, networkError.message)), /*#__PURE__*/React.createElement("div", {
45
33
  className: "header__action"
46
- }, /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
47
- icon: /*#__PURE__*/_react.default.createElement(_close_24px.ReactComponent, null),
48
- onClick: function onClick() {
49
- return setOpen(false);
50
- }
51
- }))), /*#__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", {
52
38
  className: "body"
53
- }, /*#__PURE__*/_react.default.createElement("div", {
39
+ }, /*#__PURE__*/React.createElement("div", {
54
40
  className: "body__summary"
55
- }, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
41
+ }, /*#__PURE__*/React.createElement(Typography, {
56
42
  use: "subtitle1"
57
- }, t(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["Error occurred while executing operation:"])))), /*#__PURE__*/_react.default.createElement(_StyledComponents.Pre, null, /*#__PURE__*/_react.default.createElement("code", null, query))), stackTrace && /*#__PURE__*/_react.default.createElement("div", {
43
+ }, t`Error occurred while executing operation:`), /*#__PURE__*/React.createElement(Pre, null, /*#__PURE__*/React.createElement("code", null, query))), stackTrace && /*#__PURE__*/React.createElement("div", {
58
44
  className: "body__description"
59
- }, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
45
+ }, /*#__PURE__*/React.createElement(Typography, {
60
46
  use: "subtitle1"
61
- }, t(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["Complete stack trace:"])))), /*#__PURE__*/_react.default.createElement(_StyledComponents.Pre, null, /*#__PURE__*/_react.default.createElement("code", null, stackTrace)))), /*#__PURE__*/_react.default.createElement("div", {
47
+ }, t`Complete stack trace:`), /*#__PURE__*/React.createElement(Pre, null, /*#__PURE__*/React.createElement("code", null, stackTrace)))), /*#__PURE__*/React.createElement("div", {
62
48
  className: "footer"
63
- }, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
49
+ }, /*#__PURE__*/React.createElement(Typography, {
64
50
  use: "body2"
65
- }, t(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n This screen is only visible if {message} environment variable is set.\n Read more about it in the {link}. "])))({
66
- message: /*#__PURE__*/_react.default.createElement("span", {
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", {
67
55
  className: "highlight"
68
56
  }, "`REACT_APP_DEBUG=true`"),
69
- link: /*#__PURE__*/_react.default.createElement("a", {
57
+ link: /*#__PURE__*/React.createElement("a", {
70
58
  href: ENVIRONMENT_VARIABLES_ARTICLE_LINK,
71
59
  target: "_blank",
72
60
  rel: "noreferrer noopener"
73
61
  }, "environment variables article")
74
- }), /*#__PURE__*/_react.default.createElement("br", null), t(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["Open your browser's developer console to further inspect this error."])))))));
62
+ }), /*#__PURE__*/React.createElement("br", null), t`Open your browser's developer console to further inspect this error.`))));
75
63
  };
76
- var _default = exports.default = ErrorOverlay;
64
+ export default ErrorOverlay;
77
65
 
78
66
  //# sourceMappingURL=ErrorOverlay.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_get","_interopRequireDefault","_Button","_Typography","_i18n","_StyledComponents","_close_24px","_templateObject","_templateObject2","_templateObject3","_templateObject4","t","i18n","ns","ENVIRONMENT_VARIABLES_ARTICLE_LINK","ErrorOverlay","props","query","networkError","_useState","useState","_useState2","_slicedToArray2","default","open","setOpen","console","error","stackTrace","get","createElement","OverlayWrapper","className","Typography","use","message","IconButton","icon","ReactComponent","onClick","_taggedTemplateLiteral2","Pre","link","href","target","rel","_default","exports"],"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":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAAsE,IAAAQ,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA;AAEtE,IAAMC,CAAC,GAAGC,UAAI,CAACC,EAAE,CAAC,2BAA2B,CAAC;AAE9C,IAAMC,kCAAkC,GACpC,iEAAiE;AAarE,IAAMC,YAAY,GAAG,SAAfA,YAAYA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4B,CAAC;IACpEU,IAAI,eACA7C,MAAA,CAAA0B,OAAA,CAAAO,aAAA;MACIa,IAAI,EAAE7B,kCAAmC;MACzC8B,MAAM,EAAE,QAAS;MACjBC,GAAG,EAAE;IAAsB,GAC9B,+BAEE;EAEX,CAAC,CAAC,eACFhD,MAAA,CAAA0B,OAAA,CAAAO,aAAA,WAAK,CAAC,EACLnB,CAAC,CAAAD,gBAAA,KAAAA,gBAAA,OAAA8B,uBAAA,CAAAjB,OAAA,6EACM,CACX,CACJ,CACO,CAAC;AAEzB,CAAC;AAAC,IAAAuB,QAAA,GAAAC,OAAA,CAAAxB,OAAA,GAEaR,YAAY","ignoreList":[]}
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":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,GAAG,MAAM,YAAY;AAC5B,SAASC,UAAU,QAAQ,mBAAmB;AAC9C,SAASC,UAAU,QAAQ,uBAAuB;AAClD,SAASC,IAAI;AACb,SAASC,cAAc,EAAEC,GAAG;AAC5B,SAASC,cAAc,IAAIC,SAAS;AAEpC,MAAMC,CAAC,GAAGL,IAAI,CAACM,EAAE,CAAC,2BAA2B,CAAC;AAE9C,MAAMC,kCAAkC,GACpC,iEAAiE;AAarE,MAAMC,YAAY,GAAIC,KAAwB,IAAK;EAC/C,MAAM;IAAEC,KAAK;IAAEC;EAAa,CAAC,GAAGF,KAAK;EACrC,MAAM,CAACG,IAAI,EAAEC,OAAO,CAAC,GAAGjB,QAAQ,CAAC,IAAI,CAAC;E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