@webiny/app 0.0.0-mt-2 → 0.0.0-unstable.085ff6572f

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 (168) hide show
  1. package/App.d.ts +29 -0
  2. package/App.js +105 -0
  3. package/App.js.map +1 -0
  4. package/apollo-client/InMemoryCache.d.ts +1 -1
  5. package/apollo-client/InMemoryCache.js +33 -36
  6. package/apollo-client/InMemoryCache.js.map +1 -0
  7. package/components/Image.js +18 -16
  8. package/components/Image.js.map +1 -0
  9. package/components/Routes.js +27 -17
  10. package/components/Routes.js.map +1 -0
  11. package/components/View.js +21 -14
  12. package/components/View.js.map +1 -0
  13. package/components/index.d.ts +1 -0
  14. package/components/index.js +19 -1
  15. package/components/index.js.map +1 -0
  16. package/config.d.ts +8 -0
  17. package/config.js +30 -0
  18. package/config.js.map +1 -0
  19. package/contexts/Ui/index.d.ts +1 -4
  20. package/contexts/Ui/index.js +32 -42
  21. package/contexts/Ui/index.js.map +1 -0
  22. package/core/AddRoute.d.ts +3 -0
  23. package/core/AddRoute.js +19 -0
  24. package/core/AddRoute.js.map +1 -0
  25. package/core/DebounceRender.d.ts +11 -0
  26. package/core/DebounceRender.js +41 -0
  27. package/core/DebounceRender.js.map +1 -0
  28. package/core/Plugin.d.ts +8 -0
  29. package/core/Plugin.js +21 -0
  30. package/core/Plugin.js.map +1 -0
  31. package/core/Plugins.d.ts +12 -0
  32. package/core/Plugins.js +45 -0
  33. package/core/Plugins.js.map +1 -0
  34. package/core/Provider.d.ts +9 -0
  35. package/core/Provider.js +21 -0
  36. package/core/Provider.js.map +1 -0
  37. package/core/Routes.d.ts +6 -0
  38. package/core/Routes.js +42 -0
  39. package/core/Routes.js.map +1 -0
  40. package/core/createProvider.d.ts +6 -0
  41. package/core/createProvider.js +13 -0
  42. package/core/createProvider.js.map +1 -0
  43. package/core/createProviderPlugin.d.ts +8 -0
  44. package/core/createProviderPlugin.js +21 -0
  45. package/core/createProviderPlugin.js.map +1 -0
  46. package/hooks/useAutocomplete/index.js +12 -1
  47. package/hooks/useAutocomplete/index.js.map +1 -0
  48. package/hooks/useAutocomplete/useAutocomplete.d.ts +6 -1
  49. package/hooks/useAutocomplete/useAutocomplete.js +16 -14
  50. package/hooks/useAutocomplete/useAutocomplete.js.map +1 -0
  51. package/hooks/useDataList/functions/getData.d.ts +1 -1
  52. package/hooks/useDataList/functions/getData.js +12 -4
  53. package/hooks/useDataList/functions/getData.js.map +1 -0
  54. package/hooks/useDataList/functions/getError.d.ts +1 -1
  55. package/hooks/useDataList/functions/getError.js +12 -4
  56. package/hooks/useDataList/functions/getError.js.map +1 -0
  57. package/hooks/useDataList/functions/getMeta.d.ts +1 -1
  58. package/hooks/useDataList/functions/getMeta.js +12 -4
  59. package/hooks/useDataList/functions/getMeta.js.map +1 -0
  60. package/hooks/useDataList/functions/index.js +27 -3
  61. package/hooks/useDataList/functions/index.js.map +1 -0
  62. package/hooks/useDataList/functions/searchDataByKey.d.ts +1 -1
  63. package/hooks/useDataList/functions/searchDataByKey.js +8 -6
  64. package/hooks/useDataList/functions/searchDataByKey.js.map +1 -0
  65. package/hooks/useDataList/index.js +12 -1
  66. package/hooks/useDataList/index.js.map +1 -0
  67. package/hooks/useDataList/useDataList.d.ts +4 -4
  68. package/hooks/useDataList/useDataList.js +47 -58
  69. package/hooks/useDataList/useDataList.js.map +1 -0
  70. package/hooks/useDataList/utils/index.js +20 -2
  71. package/hooks/useDataList/utils/index.js.map +1 -0
  72. package/hooks/useDataList/utils/prepareLoadListParams.d.ts +10 -3
  73. package/hooks/useDataList/utils/prepareLoadListParams.js +19 -15
  74. package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -0
  75. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +13 -4
  76. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +11 -4
  77. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +1 -0
  78. package/hooks/useDataList/utils/types.js +5 -1
  79. package/hooks/useDataList/utils/types.js.map +1 -0
  80. package/hooks/useHandler.d.ts +11 -1
  81. package/hooks/useHandler.js +11 -5
  82. package/hooks/useHandler.js.map +1 -0
  83. package/hooks/useHandlers.d.ts +1 -1
  84. package/hooks/useHandlers.js +14 -6
  85. package/hooks/useHandlers.js.map +1 -0
  86. package/hooks/useUi.js +12 -5
  87. package/hooks/useUi.js.map +1 -0
  88. package/i18n/i18n.js +14 -5
  89. package/i18n/i18n.js.map +1 -0
  90. package/i18n/index.js +13 -1
  91. package/i18n/index.js.map +1 -0
  92. package/index.d.ts +15 -0
  93. package/index.js +147 -0
  94. package/index.js.map +1 -0
  95. package/package.json +33 -25
  96. package/plugins/AddQuerySelectionPlugin.d.ts +9 -2
  97. package/plugins/AddQuerySelectionPlugin.js +73 -52
  98. package/plugins/AddQuerySelectionPlugin.js.map +1 -0
  99. package/plugins/ApolloCacheObjectIdPlugin.d.ts +8 -8
  100. package/plugins/ApolloCacheObjectIdPlugin.js +23 -25
  101. package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -0
  102. package/plugins/ApolloDynamicLink.d.ts +3 -2
  103. package/plugins/ApolloDynamicLink.js +30 -32
  104. package/plugins/ApolloDynamicLink.js.map +1 -0
  105. package/plugins/ApolloLinkPlugin.d.ts +5 -5
  106. package/plugins/ApolloLinkPlugin.js +32 -29
  107. package/plugins/ApolloLinkPlugin.js.map +1 -0
  108. package/plugins/ConsoleLinkPlugin.js +25 -24
  109. package/plugins/ConsoleLinkPlugin.js.map +1 -0
  110. package/plugins/LocaleHeaderLinkPlugin.d.ts +3 -7
  111. package/plugins/LocaleHeaderLinkPlugin.js +28 -36
  112. package/plugins/LocaleHeaderLinkPlugin.js.map +1 -0
  113. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +13 -5
  114. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +46 -45
  115. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -0
  116. package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +10 -2
  117. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +13 -4
  118. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -0
  119. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +6 -4
  120. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +21 -17
  121. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -0
  122. package/plugins/NetworkErrorLinkPlugin.js +31 -28
  123. package/plugins/NetworkErrorLinkPlugin.js.map +1 -0
  124. package/plugins/OmitTypenameLinkPlugin.js +22 -22
  125. package/plugins/OmitTypenameLinkPlugin.js.map +1 -0
  126. package/plugins/RoutePlugin.d.ts +2 -2
  127. package/plugins/RoutePlugin.js +26 -24
  128. package/plugins/RoutePlugin.js.map +1 -0
  129. package/plugins/TenantHeaderLinkPlugin.d.ts +3 -7
  130. package/plugins/TenantHeaderLinkPlugin.js +28 -39
  131. package/plugins/TenantHeaderLinkPlugin.js.map +1 -0
  132. package/plugins/ViewPlugin.d.ts +4 -4
  133. package/plugins/ViewPlugin.js +26 -24
  134. package/plugins/ViewPlugin.js.map +1 -0
  135. package/plugins/image.js +41 -55
  136. package/plugins/image.js.map +1 -0
  137. package/plugins/index.js +49 -33
  138. package/plugins/index.js.map +1 -0
  139. package/types.d.ts +20 -16
  140. package/types.js +12 -2
  141. package/types.js.map +1 -0
  142. package/utils/getApiUrl.d.ts +1 -0
  143. package/utils/getApiUrl.js +11 -0
  144. package/utils/getApiUrl.js.map +1 -0
  145. package/utils/getGqlApiUrl.d.ts +1 -0
  146. package/utils/getGqlApiUrl.js +11 -0
  147. package/utils/getGqlApiUrl.js.map +1 -0
  148. package/utils/getHeadlessCmsGqlApiUrl.d.ts +5 -0
  149. package/utils/getHeadlessCmsGqlApiUrl.js +17 -0
  150. package/utils/getHeadlessCmsGqlApiUrl.js.map +1 -0
  151. package/utils/getLocaleCode.d.ts +6 -0
  152. package/utils/getLocaleCode.js +42 -0
  153. package/utils/getLocaleCode.js.map +1 -0
  154. package/utils/getPrerenderId.d.ts +6 -0
  155. package/utils/getPrerenderId.js +10 -0
  156. package/utils/getPrerenderId.js.map +1 -0
  157. package/utils/getTenantId.d.ts +6 -0
  158. package/utils/getTenantId.js +34 -0
  159. package/utils/getTenantId.js.map +1 -0
  160. package/utils/index.d.ts +8 -0
  161. package/utils/index.js +93 -0
  162. package/utils/index.js.map +1 -0
  163. package/utils/isLocalhost.d.ts +1 -0
  164. package/utils/isLocalhost.js +14 -0
  165. package/utils/isLocalhost.js.map +1 -0
  166. package/utils/isPrerendering.d.ts +1 -0
  167. package/utils/isPrerendering.js +10 -0
  168. 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"}