@webiny/app 5.34.8 → 5.35.0-beta.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 (140) hide show
  1. package/App.js +15 -37
  2. package/App.js.map +1 -1
  3. package/apollo-client/InMemoryCache.js +1 -24
  4. package/apollo-client/InMemoryCache.js.map +1 -1
  5. package/components/Image.js +1 -14
  6. package/components/Image.js.map +1 -1
  7. package/components/Routes.js +8 -14
  8. package/components/Routes.js.map +1 -1
  9. package/components/View.js +3 -14
  10. package/components/View.js.map +1 -1
  11. package/components/index.js +0 -2
  12. package/components/index.js.map +1 -1
  13. package/config.js +0 -3
  14. package/config.js.map +1 -1
  15. package/contexts/Ui/index.js +0 -22
  16. package/contexts/Ui/index.js.map +1 -1
  17. package/core/AddRoute.js +1 -8
  18. package/core/AddRoute.js.map +1 -1
  19. package/core/DebounceRender.js +5 -15
  20. package/core/DebounceRender.js.map +1 -1
  21. package/core/Plugin.d.ts +8 -0
  22. package/core/Plugin.js +21 -0
  23. package/core/Plugin.js.map +1 -0
  24. package/core/Plugins.d.ts +4 -0
  25. package/core/Plugins.js +6 -13
  26. package/core/Plugins.js.map +1 -1
  27. package/core/Provider.js +1 -7
  28. package/core/Provider.js.map +1 -1
  29. package/core/Routes.js +6 -13
  30. package/core/Routes.js.map +1 -1
  31. package/core/createProvider.d.ts +6 -0
  32. package/core/createProvider.js +13 -0
  33. package/core/createProvider.js.map +1 -0
  34. package/core/createProviderPlugin.d.ts +0 -1
  35. package/core/createProviderPlugin.js +1 -12
  36. package/core/createProviderPlugin.js.map +1 -1
  37. package/hooks/useAutocomplete/index.js +0 -1
  38. package/hooks/useAutocomplete/index.js.map +1 -1
  39. package/hooks/useAutocomplete/useAutocomplete.js +0 -9
  40. package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
  41. package/hooks/useDataList/functions/getData.js +0 -4
  42. package/hooks/useDataList/functions/getData.js.map +1 -1
  43. package/hooks/useDataList/functions/getError.js +0 -4
  44. package/hooks/useDataList/functions/getError.js.map +1 -1
  45. package/hooks/useDataList/functions/getMeta.js +0 -4
  46. package/hooks/useDataList/functions/getMeta.js.map +1 -1
  47. package/hooks/useDataList/functions/index.js +0 -4
  48. package/hooks/useDataList/functions/index.js.map +1 -1
  49. package/hooks/useDataList/functions/searchDataByKey.js +0 -6
  50. package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
  51. package/hooks/useDataList/index.js +0 -1
  52. package/hooks/useDataList/index.js.map +1 -1
  53. package/hooks/useDataList/useDataList.js +6 -32
  54. package/hooks/useDataList/useDataList.js.map +1 -1
  55. package/hooks/useDataList/utils/index.js +0 -3
  56. package/hooks/useDataList/utils/index.js.map +1 -1
  57. package/hooks/useDataList/utils/prepareLoadListParams.js +0 -10
  58. package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
  59. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +1 -3
  60. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +1 -1
  61. package/hooks/useHandler.js +0 -2
  62. package/hooks/useHandler.js.map +1 -1
  63. package/hooks/useHandlers.js +0 -3
  64. package/hooks/useHandlers.js.map +1 -1
  65. package/hooks/useUi.js +0 -4
  66. package/hooks/useUi.js.map +1 -1
  67. package/i18n/i18n.js +0 -7
  68. package/i18n/i18n.js.map +1 -1
  69. package/i18n/index.js +0 -2
  70. package/i18n/index.js.map +1 -1
  71. package/index.d.ts +2 -0
  72. package/index.js +24 -18
  73. package/index.js.map +1 -1
  74. package/package.json +12 -12
  75. package/plugins/AddQuerySelectionPlugin.d.ts +8 -1
  76. package/plugins/AddQuerySelectionPlugin.js +31 -41
  77. package/plugins/AddQuerySelectionPlugin.js.map +1 -1
  78. package/plugins/ApolloCacheObjectIdPlugin.js +0 -15
  79. package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
  80. package/plugins/ApolloDynamicLink.js +0 -23
  81. package/plugins/ApolloDynamicLink.js.map +1 -1
  82. package/plugins/ApolloLinkPlugin.js +0 -17
  83. package/plugins/ApolloLinkPlugin.js.map +1 -1
  84. package/plugins/ConsoleLinkPlugin.js +0 -15
  85. package/plugins/ConsoleLinkPlugin.js.map +1 -1
  86. package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -5
  87. package/plugins/LocaleHeaderLinkPlugin.js +2 -26
  88. package/plugins/LocaleHeaderLinkPlugin.js.map +1 -1
  89. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +5 -25
  90. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
  91. package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +9 -3
  92. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +0 -3
  93. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
  94. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +8 -15
  95. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
  96. package/plugins/NetworkErrorLinkPlugin.js +3 -20
  97. package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
  98. package/plugins/OmitTypenameLinkPlugin.js +1 -15
  99. package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
  100. package/plugins/RoutePlugin.js +0 -15
  101. package/plugins/RoutePlugin.js.map +1 -1
  102. package/plugins/TenantHeaderLinkPlugin.d.ts +0 -5
  103. package/plugins/TenantHeaderLinkPlugin.js +2 -27
  104. package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
  105. package/plugins/ViewPlugin.js +0 -15
  106. package/plugins/ViewPlugin.js.map +1 -1
  107. package/plugins/image.js +12 -45
  108. package/plugins/image.js.map +1 -1
  109. package/plugins/index.js +12 -33
  110. package/plugins/index.js.map +1 -1
  111. package/types.d.ts +4 -2
  112. package/types.js +0 -1
  113. package/types.js.map +1 -1
  114. package/utils/getApiUrl.d.ts +1 -0
  115. package/utils/getApiUrl.js +11 -0
  116. package/utils/getApiUrl.js.map +1 -0
  117. package/utils/getGqlApiUrl.d.ts +1 -0
  118. package/utils/getGqlApiUrl.js +11 -0
  119. package/utils/getGqlApiUrl.js.map +1 -0
  120. package/utils/getHeadlessCmsGqlApiUrl.d.ts +5 -0
  121. package/utils/getHeadlessCmsGqlApiUrl.js +17 -0
  122. package/utils/getHeadlessCmsGqlApiUrl.js.map +1 -0
  123. package/utils/getLocaleCode.d.ts +6 -0
  124. package/utils/getLocaleCode.js +42 -0
  125. package/utils/getLocaleCode.js.map +1 -0
  126. package/utils/getPrerenderId.d.ts +6 -0
  127. package/utils/getPrerenderId.js +10 -0
  128. package/utils/getPrerenderId.js.map +1 -0
  129. package/utils/getTenantId.d.ts +6 -0
  130. package/utils/getTenantId.js +34 -0
  131. package/utils/getTenantId.js.map +1 -0
  132. package/utils/index.d.ts +8 -0
  133. package/utils/index.js +93 -0
  134. package/utils/index.js.map +1 -0
  135. package/utils/isLocalhost.d.ts +1 -0
  136. package/utils/isLocalhost.js +14 -0
  137. package/utils/isLocalhost.js.map +1 -0
  138. package/utils/isPrerendering.d.ts +1 -0
  139. package/utils/isPrerendering.js +10 -0
  140. package/utils/isPrerendering.js.map +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getTenantId","tenant","URLSearchParams","location","search","get","window","__PS_RENDER_TENANT__","localStorage","webiny_tenant","isLocalhost","process","env","WEBINY_WEBSITE_TENANT_ID","WEBINY_ADMIN_TENANT_ID"],"sources":["getTenantId.ts"],"sourcesContent":["import { isLocalhost } from \"~/utils/isLocalhost\";\n\ndeclare global {\n interface Window {\n __PS_RENDER_TENANT__: string;\n }\n}\n\nexport const getTenantId = (): string | null => {\n // 1. Get tenant via the `__tenant` query param. Useful when doing page previews.\n let tenant = new URLSearchParams(location.search).get(\"__tenant\");\n if (tenant) {\n return tenant;\n }\n\n // 2. Get tenant via `window.__PS_RENDER_TENANT__`. Used with prerendered pages.\n tenant = window.__PS_RENDER_TENANT__;\n if (tenant) {\n return tenant;\n }\n\n // 3. Get tenant via `window.localStorage.webiny_tenant`. Used within the Admin app.\n tenant = window.localStorage.webiny_tenant;\n if (tenant) {\n return tenant;\n }\n\n // 4. Finally, for development purposes, we take the `WEBINY_WEBSITE_TENANT_ID`\n // and `WEBINY_ADMIN_TENANT_ID` environment variables into consideration.\n if (isLocalhost()) {\n return process.env.WEBINY_WEBSITE_TENANT_ID || process.env.WEBINY_ADMIN_TENANT_ID || null;\n }\n\n return null;\n};\n"],"mappings":";;;;;;AAAA;AAQO,IAAMA,WAAW,GAAG,SAAdA,WAAW,GAAwB;EAC5C;EACA,IAAIC,MAAM,GAAG,IAAIC,eAAe,CAACC,QAAQ,CAACC,MAAM,CAAC,CAACC,GAAG,CAAC,UAAU,CAAC;EACjE,IAAIJ,MAAM,EAAE;IACR,OAAOA,MAAM;EACjB;;EAEA;EACAA,MAAM,GAAGK,MAAM,CAACC,oBAAoB;EACpC,IAAIN,MAAM,EAAE;IACR,OAAOA,MAAM;EACjB;;EAEA;EACAA,MAAM,GAAGK,MAAM,CAACE,YAAY,CAACC,aAAa;EAC1C,IAAIR,MAAM,EAAE;IACR,OAAOA,MAAM;EACjB;;EAEA;EACA;EACA,IAAI,IAAAS,wBAAW,GAAE,EAAE;IACf,OAAOC,OAAO,CAACC,GAAG,CAACC,wBAAwB,IAAIF,OAAO,CAACC,GAAG,CAACE,sBAAsB,IAAI,IAAI;EAC7F;EAEA,OAAO,IAAI;AACf,CAAC;AAAC"}
@@ -0,0 +1,8 @@
1
+ export * from "./getApiUrl";
2
+ export * from "./getGqlApiUrl";
3
+ export * from "./getHeadlessCmsGqlApiUrl";
4
+ export * from "./getLocaleCode";
5
+ export * from "./getPrerenderId";
6
+ export * from "./getTenantId";
7
+ export * from "./isLocalhost";
8
+ export * from "./isPrerendering";
package/utils/index.js ADDED
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _getApiUrl = require("./getApiUrl");
7
+ Object.keys(_getApiUrl).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _getApiUrl[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _getApiUrl[key];
14
+ }
15
+ });
16
+ });
17
+ var _getGqlApiUrl = require("./getGqlApiUrl");
18
+ Object.keys(_getGqlApiUrl).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _getGqlApiUrl[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function get() {
24
+ return _getGqlApiUrl[key];
25
+ }
26
+ });
27
+ });
28
+ var _getHeadlessCmsGqlApiUrl = require("./getHeadlessCmsGqlApiUrl");
29
+ Object.keys(_getHeadlessCmsGqlApiUrl).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _getHeadlessCmsGqlApiUrl[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function get() {
35
+ return _getHeadlessCmsGqlApiUrl[key];
36
+ }
37
+ });
38
+ });
39
+ var _getLocaleCode = require("./getLocaleCode");
40
+ Object.keys(_getLocaleCode).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _getLocaleCode[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function get() {
46
+ return _getLocaleCode[key];
47
+ }
48
+ });
49
+ });
50
+ var _getPrerenderId = require("./getPrerenderId");
51
+ Object.keys(_getPrerenderId).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _getPrerenderId[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function get() {
57
+ return _getPrerenderId[key];
58
+ }
59
+ });
60
+ });
61
+ var _getTenantId = require("./getTenantId");
62
+ Object.keys(_getTenantId).forEach(function (key) {
63
+ if (key === "default" || key === "__esModule") return;
64
+ if (key in exports && exports[key] === _getTenantId[key]) return;
65
+ Object.defineProperty(exports, key, {
66
+ enumerable: true,
67
+ get: function get() {
68
+ return _getTenantId[key];
69
+ }
70
+ });
71
+ });
72
+ var _isLocalhost = require("./isLocalhost");
73
+ Object.keys(_isLocalhost).forEach(function (key) {
74
+ if (key === "default" || key === "__esModule") return;
75
+ if (key in exports && exports[key] === _isLocalhost[key]) return;
76
+ Object.defineProperty(exports, key, {
77
+ enumerable: true,
78
+ get: function get() {
79
+ return _isLocalhost[key];
80
+ }
81
+ });
82
+ });
83
+ var _isPrerendering = require("./isPrerendering");
84
+ Object.keys(_isPrerendering).forEach(function (key) {
85
+ if (key === "default" || key === "__esModule") return;
86
+ if (key in exports && exports[key] === _isPrerendering[key]) return;
87
+ Object.defineProperty(exports, key, {
88
+ enumerable: true,
89
+ get: function get() {
90
+ return _isPrerendering[key];
91
+ }
92
+ });
93
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./getApiUrl\";\nexport * from \"./getGqlApiUrl\";\nexport * from \"./getHeadlessCmsGqlApiUrl\";\nexport * from \"./getLocaleCode\";\nexport * from \"./getPrerenderId\";\nexport * from \"./getTenantId\";\nexport * from \"./isLocalhost\";\nexport * from \"./isPrerendering\";\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -0,0 +1 @@
1
+ export declare const isLocalhost: () => boolean;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isLocalhost = void 0;
7
+ var INCLUDES = ["localhost", "127.0.0.1"];
8
+ var isLocalhost = function isLocalhost() {
9
+ var href = window.location.href;
10
+ return INCLUDES.some(function (current) {
11
+ return href.includes(current);
12
+ });
13
+ };
14
+ exports.isLocalhost = isLocalhost;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["INCLUDES","isLocalhost","href","window","location","some","current","includes"],"sources":["isLocalhost.ts"],"sourcesContent":["const INCLUDES = [\"localhost\", \"127.0.0.1\"];\n\nexport const isLocalhost = () => {\n const href = window.location.href;\n return INCLUDES.some(current => href.includes(current));\n};\n"],"mappings":";;;;;;AAAA,IAAMA,QAAQ,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC;AAEpC,IAAMC,WAAW,GAAG,SAAdA,WAAW,GAAS;EAC7B,IAAMC,IAAI,GAAGC,MAAM,CAACC,QAAQ,CAACF,IAAI;EACjC,OAAOF,QAAQ,CAACK,IAAI,CAAC,UAAAC,OAAO;IAAA,OAAIJ,IAAI,CAACK,QAAQ,CAACD,OAAO,CAAC;EAAA,EAAC;AAC3D,CAAC;AAAC"}
@@ -0,0 +1 @@
1
+ export declare const isPrerendering: () => boolean;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isPrerendering = void 0;
7
+ var isPrerendering = function isPrerendering() {
8
+ return "__PS_RENDER__" in window;
9
+ };
10
+ exports.isPrerendering = isPrerendering;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isPrerendering","window"],"sources":["isPrerendering.ts"],"sourcesContent":["export const isPrerendering = (): boolean => {\n return \"__PS_RENDER__\" in window;\n};\n"],"mappings":";;;;;;AAAO,IAAMA,cAAc,GAAG,SAAjBA,cAAc,GAAkB;EACzC,OAAO,eAAe,IAAIC,MAAM;AACpC,CAAC;AAAC"}