@webiny/app 0.0.0-unstable.e53eceafb5 → 0.0.0-unstable.e6f0dc8ca7

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 (403) hide show
  1. package/App.d.ts +5 -6
  2. package/App.js +26 -32
  3. package/App.js.map +1 -1
  4. package/README.md +7 -15
  5. package/apollo-client/InMemoryCache.js +2 -2
  6. package/apollo-client/InMemoryCache.js.map +1 -1
  7. package/components/Image.d.ts +1 -2
  8. package/components/Image.js +1 -1
  9. package/components/Image.js.map +1 -1
  10. package/components/index.d.ts +1 -2
  11. package/components/index.js +1 -2
  12. package/components/index.js.map +1 -1
  13. package/config/RouterConfig/Route.d.ts +9 -10
  14. package/config/RouterConfig/Route.js +5 -14
  15. package/config/RouterConfig/Route.js.map +1 -1
  16. package/config/RouterConfig.d.ts +10 -11
  17. package/config/RouterConfig.js +1 -1
  18. package/config/RouterConfig.js.map +1 -1
  19. package/contexts/Ui/index.js.map +1 -1
  20. package/core/Plugin.d.ts +1 -1
  21. package/core/Plugin.js +2 -2
  22. package/core/Plugin.js.map +1 -1
  23. package/core/Plugins.d.ts +2 -2
  24. package/core/Plugins.js +5 -4
  25. package/core/Plugins.js.map +1 -1
  26. package/core/Provider.d.ts +1 -1
  27. package/core/Provider.js +1 -1
  28. package/core/Provider.js.map +1 -1
  29. package/core/createProviderPlugin.js +1 -1
  30. package/core/createProviderPlugin.js.map +1 -1
  31. package/errors/AuthenticationErrorEvent.d.ts +9 -0
  32. package/errors/AuthenticationErrorEvent.js +10 -0
  33. package/errors/AuthenticationErrorEvent.js.map +1 -0
  34. package/errors/NetworkErrorEvent.d.ts +15 -0
  35. package/errors/NetworkErrorEvent.js +10 -0
  36. package/errors/NetworkErrorEvent.js.map +1 -0
  37. package/errors/abstractions.d.ts +12 -0
  38. package/errors/abstractions.js +5 -0
  39. package/errors/abstractions.js.map +1 -0
  40. package/errors/index.d.ts +6 -0
  41. package/errors/index.js +6 -0
  42. package/errors/index.js.map +1 -0
  43. package/exports/admin/env-config.d.ts +2 -0
  44. package/exports/admin/env-config.js +4 -0
  45. package/exports/admin/env-config.js.map +1 -0
  46. package/exports/admin/graphql-client.d.ts +1 -0
  47. package/exports/admin/graphql-client.js +3 -0
  48. package/exports/admin/graphql-client.js.map +1 -0
  49. package/exports/admin/local-storage.d.ts +2 -0
  50. package/exports/admin/local-storage.js +4 -0
  51. package/exports/admin/local-storage.js.map +1 -0
  52. package/exports/admin/router.d.ts +5 -0
  53. package/exports/admin/router.js +7 -0
  54. package/exports/admin/router.js.map +1 -0
  55. package/exports/admin/security.d.ts +1 -0
  56. package/exports/admin/security.js +3 -0
  57. package/exports/admin/security.js.map +1 -0
  58. package/exports/admin.d.ts +7 -0
  59. package/exports/admin.js +9 -0
  60. package/exports/admin.js.map +1 -0
  61. package/features/envConfig/EnvConfig.d.ts +7 -0
  62. package/features/envConfig/EnvConfig.js +17 -0
  63. package/features/envConfig/EnvConfig.js.map +1 -0
  64. package/features/envConfig/abstractions.d.ts +28 -0
  65. package/features/envConfig/abstractions.js +4 -0
  66. package/features/envConfig/abstractions.js.map +1 -0
  67. package/features/envConfig/feature.d.ts +17 -0
  68. package/features/envConfig/feature.js +14 -0
  69. package/features/envConfig/feature.js.map +1 -0
  70. package/features/envConfig/index.d.ts +1 -0
  71. package/features/envConfig/index.js +3 -0
  72. package/features/envConfig/index.js.map +1 -0
  73. package/features/eventPublisher/EventPublisher.d.ts +8 -0
  74. package/features/eventPublisher/EventPublisher.js +27 -0
  75. package/features/eventPublisher/EventPublisher.js.map +1 -0
  76. package/features/eventPublisher/abstractions.d.ts +18 -0
  77. package/features/eventPublisher/abstractions.js +14 -0
  78. package/features/eventPublisher/abstractions.js.map +1 -0
  79. package/features/eventPublisher/feature.d.ts +3 -0
  80. package/features/eventPublisher/feature.js +16 -0
  81. package/features/eventPublisher/feature.js.map +1 -0
  82. package/features/eventPublisher/index.d.ts +3 -0
  83. package/features/eventPublisher/index.js +4 -0
  84. package/features/eventPublisher/index.js.map +1 -0
  85. package/features/graphqlClient/AuthenticationErrorPublishing.d.ts +13 -0
  86. package/features/graphqlClient/AuthenticationErrorPublishing.js +35 -0
  87. package/features/graphqlClient/AuthenticationErrorPublishing.js.map +1 -0
  88. package/features/graphqlClient/BatchingGraphQLClient.d.ts +16 -0
  89. package/features/graphqlClient/BatchingGraphQLClient.js +163 -0
  90. package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -0
  91. package/features/graphqlClient/FetchGraphQLClient.d.ts +7 -0
  92. package/features/graphqlClient/FetchGraphQLClient.js +58 -0
  93. package/features/graphqlClient/FetchGraphQLClient.js.map +1 -0
  94. package/features/graphqlClient/NetworkErrorPublishing.d.ts +14 -0
  95. package/features/graphqlClient/NetworkErrorPublishing.js +55 -0
  96. package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -0
  97. package/features/graphqlClient/RequestValue.d.ts +21 -0
  98. package/features/graphqlClient/RequestValue.js +45 -0
  99. package/features/graphqlClient/RequestValue.js.map +1 -0
  100. package/features/graphqlClient/RetryGraphQLClient.d.ts +18 -0
  101. package/features/graphqlClient/RetryGraphQLClient.js +54 -0
  102. package/features/graphqlClient/RetryGraphQLClient.js.map +1 -0
  103. package/features/graphqlClient/__tests__/GraphQLClient.test.d.ts +1 -0
  104. package/features/graphqlClient/__tests__/GraphQLClient.test.js +370 -0
  105. package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -0
  106. package/features/graphqlClient/abstractions.d.ts +18 -0
  107. package/features/graphqlClient/abstractions.js +4 -0
  108. package/features/graphqlClient/abstractions.js.map +1 -0
  109. package/features/graphqlClient/feature.d.ts +6 -0
  110. package/features/graphqlClient/feature.js +31 -0
  111. package/features/graphqlClient/feature.js.map +1 -0
  112. package/features/graphqlClient/index.d.ts +1 -0
  113. package/features/graphqlClient/index.js +3 -0
  114. package/features/graphqlClient/index.js.map +1 -0
  115. package/features/graphqlClient/types.d.ts +5 -0
  116. package/features/graphqlClient/types.js.map +1 -0
  117. package/features/localStorage/BrowserLocalStorageGateway.d.ts +9 -0
  118. package/features/localStorage/BrowserLocalStorageGateway.js +68 -0
  119. package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -0
  120. package/features/localStorage/LocalStorage.d.ts +12 -0
  121. package/features/localStorage/LocalStorage.js +31 -0
  122. package/features/localStorage/LocalStorage.js.map +1 -0
  123. package/features/localStorage/LocalStorageRepository.d.ts +20 -0
  124. package/features/localStorage/LocalStorageRepository.js +95 -0
  125. package/features/localStorage/LocalStorageRepository.js.map +1 -0
  126. package/features/localStorage/abstractions.d.ts +48 -0
  127. package/features/localStorage/abstractions.js +19 -0
  128. package/features/localStorage/abstractions.js.map +1 -0
  129. package/features/localStorage/feature.d.ts +12 -0
  130. package/features/localStorage/feature.js +34 -0
  131. package/features/localStorage/feature.js.map +1 -0
  132. package/features/localStorage/index.d.ts +1 -0
  133. package/features/localStorage/index.js +3 -0
  134. package/features/localStorage/index.js.map +1 -0
  135. package/features/mainGraphQLClient/MainGraphQLClient.d.ts +11 -0
  136. package/features/mainGraphQLClient/MainGraphQLClient.js +23 -0
  137. package/features/mainGraphQLClient/MainGraphQLClient.js.map +1 -0
  138. package/features/mainGraphQLClient/abstractions.d.ts +17 -0
  139. package/features/mainGraphQLClient/abstractions.js +4 -0
  140. package/features/mainGraphQLClient/abstractions.js.map +1 -0
  141. package/features/mainGraphQLClient/feature.d.ts +3 -0
  142. package/features/mainGraphQLClient/feature.js +16 -0
  143. package/features/mainGraphQLClient/feature.js.map +1 -0
  144. package/features/mainGraphQLClient/index.d.ts +1 -0
  145. package/features/mainGraphQLClient/index.js +3 -0
  146. package/features/mainGraphQLClient/index.js.map +1 -0
  147. package/features/router/HistoryRouterGateway.d.ts +22 -0
  148. package/features/router/HistoryRouterGateway.js +118 -0
  149. package/features/router/HistoryRouterGateway.js.map +1 -0
  150. package/features/router/HistoryRouterGateway.test.d.ts +1 -0
  151. package/features/router/HistoryRouterGateway.test.js +204 -0
  152. package/features/router/HistoryRouterGateway.test.js.map +1 -0
  153. package/features/router/Route.d.ts +19 -0
  154. package/features/router/Route.js +59 -0
  155. package/features/router/Route.js.map +1 -0
  156. package/features/router/RouteUrl.d.ts +85 -0
  157. package/features/router/RouteUrl.js +232 -0
  158. package/features/router/RouteUrl.js.map +1 -0
  159. package/features/router/Router.d.ts +45 -0
  160. package/features/router/Router.js +129 -0
  161. package/features/router/Router.js.map +1 -0
  162. package/features/router/RouterPresenter.d.ts +21 -0
  163. package/features/router/RouterPresenter.js +57 -0
  164. package/features/router/RouterPresenter.js.map +1 -0
  165. package/features/router/RouterRepository.d.ts +30 -0
  166. package/features/router/RouterRepository.js +125 -0
  167. package/features/router/RouterRepository.js.map +1 -0
  168. package/features/router/RouterRepository.test.d.ts +1 -0
  169. package/features/router/RouterRepository.test.js +169 -0
  170. package/features/router/RouterRepository.test.js.map +1 -0
  171. package/features/router/abstractions.d.ts +81 -0
  172. package/features/router/abstractions.js +17 -0
  173. package/features/router/abstractions.js.map +1 -0
  174. package/features/router/feature.d.ts +4 -0
  175. package/features/router/feature.js +18 -0
  176. package/features/router/feature.js.map +1 -0
  177. package/features/router/index.d.ts +2 -0
  178. package/features/router/index.js +3 -0
  179. package/features/router/index.js.map +1 -0
  180. package/helpers/InterfaceGenerator/date.d.ts +15 -0
  181. package/helpers/InterfaceGenerator/date.js +3 -0
  182. package/helpers/InterfaceGenerator/date.js.map +1 -0
  183. package/helpers/InterfaceGenerator/id.d.ts +23 -0
  184. package/helpers/InterfaceGenerator/id.js +3 -0
  185. package/helpers/InterfaceGenerator/id.js.map +1 -0
  186. package/helpers/InterfaceGenerator/identity.d.ts +10 -0
  187. package/helpers/InterfaceGenerator/identity.js +3 -0
  188. package/helpers/InterfaceGenerator/identity.js.map +1 -0
  189. package/helpers/InterfaceGenerator/index.d.ts +5 -0
  190. package/helpers/InterfaceGenerator/index.js +3 -0
  191. package/helpers/InterfaceGenerator/index.js.map +1 -0
  192. package/helpers/InterfaceGenerator/numeric.d.ts +12 -0
  193. package/helpers/InterfaceGenerator/numeric.js +3 -0
  194. package/helpers/InterfaceGenerator/numeric.js.map +1 -0
  195. package/helpers/InterfaceGenerator/truthful.d.ts +7 -0
  196. package/helpers/InterfaceGenerator/truthful.js +3 -0
  197. package/helpers/InterfaceGenerator/truthful.js.map +1 -0
  198. package/hooks/useAutocomplete/index.d.ts +1 -1
  199. package/hooks/useAutocomplete/index.js +1 -1
  200. package/hooks/useAutocomplete/index.js.map +1 -1
  201. package/hooks/useAutocomplete/useAutocomplete.js +3 -6
  202. package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
  203. package/hooks/useDataList/functions/getData.js +1 -1
  204. package/hooks/useDataList/functions/getData.js.map +1 -1
  205. package/hooks/useDataList/functions/getError.js +1 -1
  206. package/hooks/useDataList/functions/getError.js.map +1 -1
  207. package/hooks/useDataList/functions/getMeta.js +1 -1
  208. package/hooks/useDataList/functions/getMeta.js.map +1 -1
  209. package/hooks/useDataList/functions/index.d.ts +3 -3
  210. package/hooks/useDataList/functions/index.js +3 -3
  211. package/hooks/useDataList/functions/index.js.map +1 -1
  212. package/hooks/useDataList/index.d.ts +1 -1
  213. package/hooks/useDataList/index.js +1 -1
  214. package/hooks/useDataList/index.js.map +1 -1
  215. package/hooks/useDataList/useDataList.d.ts +0 -1
  216. package/hooks/useDataList/useDataList.js +6 -26
  217. package/hooks/useDataList/useDataList.js.map +1 -1
  218. package/hooks/useDataList/utils/index.d.ts +1 -2
  219. package/hooks/useDataList/utils/index.js +1 -2
  220. package/hooks/useDataList/utils/index.js.map +1 -1
  221. package/hooks/useDataList/utils/prepareLoadListParams.js +1 -1
  222. package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
  223. package/hooks/useHandlers.js.map +1 -1
  224. package/hooks/useRegisterLegacyPlugin.d.ts +1 -1
  225. package/hooks/useRegisterLegacyPlugin.js.map +1 -1
  226. package/hooks/useUi.d.ts +1 -1
  227. package/hooks/useUi.js +1 -1
  228. package/hooks/useUi.js.map +1 -1
  229. package/i18n/index.d.ts +1 -1
  230. package/i18n/index.js +1 -1
  231. package/i18n/index.js.map +1 -1
  232. package/index.d.ts +23 -15
  233. package/index.js +22 -14
  234. package/index.js.map +1 -1
  235. package/package.json +33 -28
  236. package/plugins/AddQuerySelectionPlugin.d.ts +1 -1
  237. package/plugins/AddQuerySelectionPlugin.js +1 -1
  238. package/plugins/AddQuerySelectionPlugin.js.map +1 -1
  239. package/plugins/ApolloDynamicLink.d.ts +1 -1
  240. package/plugins/ApolloDynamicLink.js.map +1 -1
  241. package/plugins/ConsoleLinkPlugin.d.ts +1 -1
  242. package/plugins/ConsoleLinkPlugin.js +1 -1
  243. package/plugins/ConsoleLinkPlugin.js.map +1 -1
  244. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +8 -13
  245. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +15 -26
  246. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
  247. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.d.ts +14 -0
  248. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js +31 -0
  249. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js.map +1 -0
  250. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.d.ts +2 -0
  251. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js +31 -0
  252. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js.map +1 -0
  253. package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +4 -5
  254. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +3 -3
  255. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
  256. package/plugins/NetworkErrorLinkPlugin/Typography.d.ts +8 -0
  257. package/plugins/NetworkErrorLinkPlugin/Typography.js +18 -0
  258. package/plugins/NetworkErrorLinkPlugin/Typography.js.map +1 -0
  259. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +3 -3
  260. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +4 -13
  261. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
  262. package/plugins/NetworkErrorLinkPlugin.d.ts +4 -1
  263. package/plugins/NetworkErrorLinkPlugin.js +47 -7
  264. package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
  265. package/plugins/OmitTypenameLinkPlugin.d.ts +1 -1
  266. package/plugins/OmitTypenameLinkPlugin.js +1 -1
  267. package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
  268. package/plugins/TenantHeaderLinkPlugin.d.ts +2 -2
  269. package/plugins/TenantHeaderLinkPlugin.js +2 -4
  270. package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
  271. package/plugins/components/Image.d.ts +6 -0
  272. package/plugins/components/Image.js +19 -0
  273. package/plugins/components/Image.js.map +1 -0
  274. package/plugins/image.d.ts +1 -1
  275. package/plugins/image.js +2 -2
  276. package/plugins/image.js.map +1 -1
  277. package/plugins/index.d.ts +3 -3
  278. package/plugins/index.js +1 -1
  279. package/plugins/index.js.map +1 -1
  280. package/presentation/envConfig/useEnvConfig.d.ts +6 -0
  281. package/presentation/envConfig/useEnvConfig.js +13 -0
  282. package/presentation/envConfig/useEnvConfig.js.map +1 -0
  283. package/presentation/localStorage/index.d.ts +3 -0
  284. package/presentation/localStorage/index.js +5 -0
  285. package/presentation/localStorage/index.js.map +1 -0
  286. package/presentation/localStorage/useLocalStorage.d.ts +6 -0
  287. package/presentation/localStorage/useLocalStorage.js +21 -0
  288. package/presentation/localStorage/useLocalStorage.js.map +1 -0
  289. package/presentation/localStorage/useLocalStorageValue.d.ts +1 -0
  290. package/presentation/localStorage/useLocalStorageValue.js +20 -0
  291. package/presentation/localStorage/useLocalStorageValue.js.map +1 -0
  292. package/presentation/localStorage/useLocalStorageValues.d.ts +5 -0
  293. package/presentation/localStorage/useLocalStorageValues.js +39 -0
  294. package/presentation/localStorage/useLocalStorageValues.js.map +1 -0
  295. package/presentation/router/RouteElementRegistry.d.ts +14 -0
  296. package/presentation/router/RouteElementRegistry.js +32 -0
  297. package/presentation/router/RouteElementRegistry.js.map +1 -0
  298. package/presentation/router/abstractions.d.ts +13 -0
  299. package/presentation/router/abstractions.js +4 -0
  300. package/presentation/router/abstractions.js.map +1 -0
  301. package/presentation/router/components/Redirect.d.ts +14 -0
  302. package/presentation/router/components/Redirect.js +15 -0
  303. package/presentation/router/components/Redirect.js.map +1 -0
  304. package/presentation/router/components/RouteContent.d.ts +2 -0
  305. package/presentation/router/components/RouteContent.js +23 -0
  306. package/presentation/router/components/RouteContent.js.map +1 -0
  307. package/presentation/router/components/RouteLink.d.ts +50 -0
  308. package/presentation/router/components/RouteLink.js +22 -0
  309. package/presentation/router/components/RouteLink.js.map +1 -0
  310. package/presentation/router/components/SimpleLink.d.ts +44 -0
  311. package/presentation/router/components/SimpleLink.js +30 -0
  312. package/presentation/router/components/SimpleLink.js.map +1 -0
  313. package/presentation/router/hooks/useRoute.d.ts +6 -0
  314. package/presentation/router/hooks/useRoute.js +30 -0
  315. package/presentation/router/hooks/useRoute.js.map +1 -0
  316. package/presentation/router/hooks/useRouter.d.ts +11 -0
  317. package/presentation/router/hooks/useRouter.js +30 -0
  318. package/presentation/router/hooks/useRouter.js.map +1 -0
  319. package/presentation/router/index.d.ts +4 -0
  320. package/presentation/router/index.js +5 -0
  321. package/presentation/router/index.js.map +1 -0
  322. package/presentation/router/types.d.ts +5 -0
  323. package/presentation/router/types.js +3 -0
  324. package/presentation/router/types.js.map +1 -0
  325. package/react-butterfiles/Files.js +3 -3
  326. package/react-butterfiles/Files.js.map +1 -1
  327. package/react-butterfiles/file.todo +1 -0
  328. package/react-butterfiles/index.d.ts +1 -1
  329. package/react-butterfiles/index.js +1 -1
  330. package/react-butterfiles/index.js.map +1 -1
  331. package/renderApp.d.ts +1 -1
  332. package/renderApp.js.map +1 -1
  333. package/router.d.ts +5 -0
  334. package/router.js +8 -0
  335. package/router.js.map +1 -0
  336. package/shared/di/DiContainerProvider.d.ts +8 -0
  337. package/shared/di/DiContainerProvider.js +17 -0
  338. package/shared/di/DiContainerProvider.js.map +1 -0
  339. package/shared/di/createFeature.d.ts +11 -0
  340. package/shared/di/createFeature.js +11 -0
  341. package/shared/di/createFeature.js.map +1 -0
  342. package/shared/di/useFeature.d.ts +2 -0
  343. package/shared/di/useFeature.js +8 -0
  344. package/shared/di/useFeature.js.map +1 -0
  345. package/types.d.ts +7 -4
  346. package/types.js +1 -12
  347. package/types.js.map +1 -1
  348. package/utils/index.d.ts +2 -10
  349. package/utils/index.js +2 -10
  350. package/utils/index.js.map +1 -1
  351. package/utils/legacyPluginToReactComponent.js +1 -1
  352. package/utils/legacyPluginToReactComponent.js.map +1 -1
  353. package/components/Routes.d.ts +0 -2
  354. package/components/Routes.js +0 -36
  355. package/components/Routes.js.map +0 -1
  356. package/components/View.d.ts +0 -8
  357. package/components/View.js +0 -19
  358. package/components/View.js.map +0 -1
  359. package/core/DebounceRender.d.ts +0 -12
  360. package/core/DebounceRender.js +0 -31
  361. package/core/DebounceRender.js.map +0 -1
  362. package/core/Routes.d.ts +0 -6
  363. package/core/Routes.js +0 -34
  364. package/core/Routes.js.map +0 -1
  365. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +0 -14
  366. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +0 -26
  367. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +0 -1
  368. package/hooks/useDataList/utils/types.d.ts +0 -40
  369. package/hooks/useDataList/utils/types.js.map +0 -1
  370. package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -10
  371. package/plugins/LocaleHeaderLinkPlugin.js +0 -32
  372. package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
  373. package/plugins/RoutePlugin.d.ts +0 -12
  374. package/plugins/RoutePlugin.js +0 -16
  375. package/plugins/RoutePlugin.js.map +0 -1
  376. package/plugins/ViewPlugin.d.ts +0 -14
  377. package/plugins/ViewPlugin.js +0 -19
  378. package/plugins/ViewPlugin.js.map +0 -1
  379. package/utils/getApiUrl.d.ts +0 -1
  380. package/utils/getApiUrl.js +0 -5
  381. package/utils/getApiUrl.js.map +0 -1
  382. package/utils/getGqlApiUrl.d.ts +0 -1
  383. package/utils/getGqlApiUrl.js +0 -6
  384. package/utils/getGqlApiUrl.js.map +0 -1
  385. package/utils/getHeadlessCmsGqlApiUrl.d.ts +0 -5
  386. package/utils/getHeadlessCmsGqlApiUrl.js +0 -12
  387. package/utils/getHeadlessCmsGqlApiUrl.js.map +0 -1
  388. package/utils/getLocaleCode.d.ts +0 -6
  389. package/utils/getLocaleCode.js +0 -33
  390. package/utils/getLocaleCode.js.map +0 -1
  391. package/utils/getPrerenderId.d.ts +0 -6
  392. package/utils/getPrerenderId.js +0 -5
  393. package/utils/getPrerenderId.js.map +0 -1
  394. package/utils/getTenantId.d.ts +0 -6
  395. package/utils/getTenantId.js +0 -45
  396. package/utils/getTenantId.js.map +0 -1
  397. package/utils/isLocalhost.d.ts +0 -1
  398. package/utils/isLocalhost.js +0 -7
  399. package/utils/isLocalhost.js.map +0 -1
  400. package/utils/isPrerendering.d.ts +0 -1
  401. package/utils/isPrerendering.js +0 -5
  402. package/utils/isPrerendering.js.map +0 -1
  403. /package/{hooks/useDataList/utils → features/graphqlClient}/types.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["keys","location","params","query","URLSearchParams","search","after","get","before","limit","parseInt","forEach","key","value","JSON","parse","e"],"sources":["prepareLoadListParams.ts"],"sourcesContent":["interface Params {\n after?: string;\n before?: string;\n limit?: number;\n sort?: string;\n where?: Record<string, any>;\n search?: string;\n}\n\nconst keys: (keyof Params)[] = [\"sort\", \"where\", \"search\"];\n\nexport default (location?: Location): Params => {\n const params: Params = {};\n if (!location) {\n return params;\n }\n\n const query = new URLSearchParams(location.search);\n\n const after = query.get(\"after\");\n const before = query.get(\"before\");\n const limit = query.get(\"limit\");\n\n if (after) {\n params.after = after;\n }\n\n if (before) {\n params.before = before;\n }\n\n if (limit) {\n params.limit = parseInt(limit);\n }\n\n keys.forEach(key => {\n const value = query.get(key);\n if (typeof value !== \"string\") {\n return;\n }\n try {\n params[key] = JSON.parse(value);\n } catch (e) {\n /**\n * If we can't parse the value, it means it's a string.\n */\n // @ts-expect-error\n params[key] = value;\n }\n });\n return params;\n};\n"],"mappings":"AASA,MAAMA,IAAsB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC;AAE1D,eAAgBC,QAAmB,IAAa;EAC5C,MAAMC,MAAc,GAAG,CAAC,CAAC;EACzB,IAAI,CAACD,QAAQ,EAAE;IACX,OAAOC,MAAM;EACjB;EAEA,MAAMC,KAAK,GAAG,IAAIC,eAAe,CAACH,QAAQ,CAACI,MAAM,CAAC;EAElD,MAAMC,KAAK,GAAGH,KAAK,CAACI,GAAG,CAAC,OAAO,CAAC;EAChC,MAAMC,MAAM,GAAGL,KAAK,CAACI,GAAG,CAAC,QAAQ,CAAC;EAClC,MAAME,KAAK,GAAGN,KAAK,CAACI,GAAG,CAAC,OAAO,CAAC;EAEhC,IAAID,KAAK,EAAE;IACPJ,MAAM,CAACI,KAAK,GAAGA,KAAK;EACxB;EAEA,IAAIE,MAAM,EAAE;IACRN,MAAM,CAACM,MAAM,GAAGA,MAAM;EAC1B;EAEA,IAAIC,KAAK,EAAE;IACPP,MAAM,CAACO,KAAK,GAAGC,QAAQ,CAACD,KAAK,CAAC;EAClC;EAEAT,IAAI,CAACW,OAAO,CAACC,GAAG,IAAI;IAChB,MAAMC,KAAK,GAAGV,KAAK,CAACI,GAAG,CAACK,GAAG,CAAC;IAC5B,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;MAC3B;IACJ;IACA,IAAI;MACAX,MAAM,CAACU,GAAG,CAAC,GAAGE,IAAI,CAACC,KAAK,CAACF,KAAK,CAAC;IACnC,CAAC,CAAC,OAAOG,CAAC,EAAE;MACR;AACZ;AACA;MACY;MACAd,MAAM,CAACU,GAAG,CAAC,GAAGC,KAAK;IACvB;EACJ,CAAC,CAAC;EACF,OAAOX,MAAM;AACjB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["keys","location","params","query","URLSearchParams","search","after","get","before","limit","parseInt","forEach","key","value","JSON","parse"],"sources":["prepareLoadListParams.ts"],"sourcesContent":["interface Params {\n after?: string;\n before?: string;\n limit?: number;\n sort?: string;\n where?: Record<string, any>;\n search?: string;\n}\n\nconst keys: (keyof Params)[] = [\"sort\", \"where\", \"search\"];\n\nexport default (location?: Location): Params => {\n const params: Params = {};\n if (!location) {\n return params;\n }\n\n const query = new URLSearchParams(location.search);\n\n const after = query.get(\"after\");\n const before = query.get(\"before\");\n const limit = query.get(\"limit\");\n\n if (after) {\n params.after = after;\n }\n\n if (before) {\n params.before = before;\n }\n\n if (limit) {\n params.limit = parseInt(limit);\n }\n\n keys.forEach(key => {\n const value = query.get(key);\n if (typeof value !== \"string\") {\n return;\n }\n try {\n params[key] = JSON.parse(value);\n } catch {\n /**\n * If we can't parse the value, it means it's a string.\n */\n // @ts-expect-error\n params[key] = value;\n }\n });\n return params;\n};\n"],"mappings":"AASA,MAAMA,IAAsB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC;AAE1D,eAAgBC,QAAmB,IAAa;EAC5C,MAAMC,MAAc,GAAG,CAAC,CAAC;EACzB,IAAI,CAACD,QAAQ,EAAE;IACX,OAAOC,MAAM;EACjB;EAEA,MAAMC,KAAK,GAAG,IAAIC,eAAe,CAACH,QAAQ,CAACI,MAAM,CAAC;EAElD,MAAMC,KAAK,GAAGH,KAAK,CAACI,GAAG,CAAC,OAAO,CAAC;EAChC,MAAMC,MAAM,GAAGL,KAAK,CAACI,GAAG,CAAC,QAAQ,CAAC;EAClC,MAAME,KAAK,GAAGN,KAAK,CAACI,GAAG,CAAC,OAAO,CAAC;EAEhC,IAAID,KAAK,EAAE;IACPJ,MAAM,CAACI,KAAK,GAAGA,KAAK;EACxB;EAEA,IAAIE,MAAM,EAAE;IACRN,MAAM,CAACM,MAAM,GAAGA,MAAM;EAC1B;EAEA,IAAIC,KAAK,EAAE;IACPP,MAAM,CAACO,KAAK,GAAGC,QAAQ,CAACD,KAAK,CAAC;EAClC;EAEAT,IAAI,CAACW,OAAO,CAACC,GAAG,IAAI;IAChB,MAAMC,KAAK,GAAGV,KAAK,CAACI,GAAG,CAACK,GAAG,CAAC;IAC5B,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;MAC3B;IACJ;IACA,IAAI;MACAX,MAAM,CAACU,GAAG,CAAC,GAAGE,IAAI,CAACC,KAAK,CAACF,KAAK,CAAC;IACnC,CAAC,CAAC,MAAM;MACJ;AACZ;AACA;MACY;MACAX,MAAM,CAACU,GAAG,CAAC,GAAGC,KAAK;IACvB;EACJ,CAAC,CAAC;EACF,OAAOX,MAAM;AACjB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useRef","useEffect","useHandlers","props","factories","propsRef","handlersRef","names","Object","keys","reduce","handlers","name","args","handler","current"],"sources":["useHandlers.ts"],"sourcesContent":["import { useRef, useEffect } from \"react\";\n\ntype HandlerProps = { [key: string]: any };\ntype HandlerFactories = { [key: string]: (props: HandlerProps) => (...params: any[]) => any };\ntype Handlers = {\n [K in keyof HandlerFactories]: (...params: any[]) => any;\n};\n\nexport function useHandlers<H = Handlers>(props: HandlerProps, factories: HandlerFactories) {\n const propsRef = useRef(props);\n\n const handlersRef = useRef(\n (() => {\n const names = Object.keys(factories);\n return names.reduce((handlers, name) => {\n /**\n * TODO: figure out args types\n */\n handlers[name] = (...args: any) => {\n const handler = factories[name](propsRef.current);\n return handler(...args);\n };\n return handlers;\n }, {} as Record<string, any>);\n })()\n );\n\n useEffect(() => {\n propsRef.current = props;\n });\n\n return handlersRef.current as H;\n}\n"],"mappings":"AAAA,SAASA,MAAM,EAAEC,SAAS,QAAQ,OAAO;AAQzC,OAAO,SAASC,WAAWA,CAAeC,KAAmB,EAAEC,SAA2B,EAAE;EACxF,MAAMC,QAAQ,GAAGL,MAAM,CAACG,KAAK,CAAC;EAE9B,MAAMG,WAAW,GAAGN,MAAM,CACtB,CAAC,MAAM;IACH,MAAMO,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACL,SAAS,CAAC;IACpC,OAAOG,KAAK,CAACG,MAAM,CAAC,CAACC,QAAQ,EAAEC,IAAI,KAAK;MACpC;AAChB;AACA;MACgBD,QAAQ,CAACC,IAAI,CAAC,GAAG,CAAC,GAAGC,IAAS,KAAK;QAC/B,MAAMC,OAAO,GAAGV,SAAS,CAACQ,IAAI,CAAC,CAACP,QAAQ,CAACU,OAAO,CAAC;QACjD,OAAOD,OAAO,CAAC,GAAGD,IAAI,CAAC;MAC3B,CAAC;MACD,OAAOF,QAAQ;IACnB,CAAC,EAAE,CAAC,CAAwB,CAAC;EACjC,CAAC,EAAE,CACP,CAAC;EAEDV,SAAS,CAAC,MAAM;IACZI,QAAQ,CAACU,OAAO,GAAGZ,KAAK;EAC5B,CAAC,CAAC;EAEF,OAAOG,WAAW,CAACS,OAAO;AAC9B","ignoreList":[]}
1
+ {"version":3,"names":["useRef","useEffect","useHandlers","props","factories","propsRef","handlersRef","names","Object","keys","reduce","handlers","name","args","handler","current"],"sources":["useHandlers.ts"],"sourcesContent":["import { useRef, useEffect } from \"react\";\n\ntype HandlerProps = { [key: string]: any };\ntype HandlerFactories = { [key: string]: (props: HandlerProps) => (...params: any[]) => any };\ntype Handlers = {\n [K in keyof HandlerFactories]: (...params: any[]) => any;\n};\n\nexport function useHandlers<H = Handlers>(props: HandlerProps, factories: HandlerFactories) {\n const propsRef = useRef(props);\n\n const handlersRef = useRef(\n (() => {\n const names = Object.keys(factories);\n return names.reduce(\n (handlers, name) => {\n /**\n * TODO: figure out args types\n */\n handlers[name] = (...args: any) => {\n const handler = factories[name](propsRef.current);\n return handler(...args);\n };\n return handlers;\n },\n {} as Record<string, any>\n );\n })()\n );\n\n useEffect(() => {\n propsRef.current = props;\n });\n\n return handlersRef.current as H;\n}\n"],"mappings":"AAAA,SAASA,MAAM,EAAEC,SAAS,QAAQ,OAAO;AAQzC,OAAO,SAASC,WAAWA,CAAeC,KAAmB,EAAEC,SAA2B,EAAE;EACxF,MAAMC,QAAQ,GAAGL,MAAM,CAACG,KAAK,CAAC;EAE9B,MAAMG,WAAW,GAAGN,MAAM,CACtB,CAAC,MAAM;IACH,MAAMO,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACL,SAAS,CAAC;IACpC,OAAOG,KAAK,CAACG,MAAM,CACf,CAACC,QAAQ,EAAEC,IAAI,KAAK;MAChB;AACpB;AACA;MACoBD,QAAQ,CAACC,IAAI,CAAC,GAAG,CAAC,GAAGC,IAAS,KAAK;QAC/B,MAAMC,OAAO,GAAGV,SAAS,CAACQ,IAAI,CAAC,CAACP,QAAQ,CAACU,OAAO,CAAC;QACjD,OAAOD,OAAO,CAAC,GAAGD,IAAI,CAAC;MAC3B,CAAC;MACD,OAAOF,QAAQ;IACnB,CAAC,EACD,CAAC,CACL,CAAC;EACL,CAAC,EAAE,CACP,CAAC;EAEDV,SAAS,CAAC,MAAM;IACZI,QAAQ,CAACU,OAAO,GAAGZ,KAAK;EAC5B,CAAC,CAAC;EAEF,OAAOG,WAAW,CAACS,OAAO;AAC9B","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { type Plugin } from "@webiny/plugins/types";
1
+ import { type Plugin } from "@webiny/plugins/types.js";
2
2
  export declare function useRegisterLegacyPlugin<TPlugin extends Plugin>(plugin: TPlugin): void;
@@ -1 +1 @@
1
- {"version":3,"names":["useRef","plugins","useRegisterLegacyPlugin","plugin","pluginRegistered","current","register"],"sources":["useRegisterLegacyPlugin.tsx"],"sourcesContent":["import { useRef } from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { type Plugin } from \"@webiny/plugins/types\";\n\nexport function useRegisterLegacyPlugin<TPlugin extends Plugin>(plugin: TPlugin) {\n const pluginRegistered = useRef<boolean>(false);\n if (!pluginRegistered.current) {\n pluginRegistered.current = true;\n plugins.register(plugin);\n }\n}\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,OAAO;AAC9B,SAASC,OAAO,QAAQ,iBAAiB;AAGzC,OAAO,SAASC,uBAAuBA,CAAyBC,MAAe,EAAE;EAC7E,MAAMC,gBAAgB,GAAGJ,MAAM,CAAU,KAAK,CAAC;EAC/C,IAAI,CAACI,gBAAgB,CAACC,OAAO,EAAE;IAC3BD,gBAAgB,CAACC,OAAO,GAAG,IAAI;IAC/BJ,OAAO,CAACK,QAAQ,CAACH,MAAM,CAAC;EAC5B;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["useRef","plugins","useRegisterLegacyPlugin","plugin","pluginRegistered","current","register"],"sources":["useRegisterLegacyPlugin.tsx"],"sourcesContent":["import { useRef } from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { type Plugin } from \"@webiny/plugins/types.js\";\n\nexport function useRegisterLegacyPlugin<TPlugin extends Plugin>(plugin: TPlugin) {\n const pluginRegistered = useRef<boolean>(false);\n if (!pluginRegistered.current) {\n pluginRegistered.current = true;\n plugins.register(plugin);\n }\n}\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,OAAO;AAC9B,SAASC,OAAO,QAAQ,iBAAiB;AAGzC,OAAO,SAASC,uBAAuBA,CAAyBC,MAAe,EAAE;EAC7E,MAAMC,gBAAgB,GAAGJ,MAAM,CAAU,KAAK,CAAC;EAC/C,IAAI,CAACI,gBAAgB,CAACC,OAAO,EAAE;IAC3BD,gBAAgB,CAACC,OAAO,GAAG,IAAI;IAC/BJ,OAAO,CAACK,QAAQ,CAACH,MAAM,CAAC;EAC5B;AACJ","ignoreList":[]}
package/hooks/useUi.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import type { UiContextValue } from "../contexts/Ui";
1
+ import type { UiContextValue } from "../contexts/Ui/index.js";
2
2
  export declare const useUi: () => UiContextValue;
package/hooks/useUi.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useContext } from "react";
2
- import { UiContext } from "../contexts/Ui";
2
+ import { UiContext } from "../contexts/Ui/index.js";
3
3
  export const useUi = () => {
4
4
  return useContext(UiContext);
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"names":["useContext","UiContext","useUi"],"sources":["useUi.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport type { UiContextValue } from \"~/contexts/Ui\";\nimport { UiContext } from \"~/contexts/Ui\";\n\nexport const useUi = () => {\n return useContext(UiContext) as UiContextValue;\n};\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAElC,SAASC,SAAS;AAElB,OAAO,MAAMC,KAAK,GAAGA,CAAA,KAAM;EACvB,OAAOF,UAAU,CAACC,SAAS,CAAC;AAChC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useContext","UiContext","useUi"],"sources":["useUi.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport type { UiContextValue } from \"~/contexts/Ui/index.js\";\nimport { UiContext } from \"~/contexts/Ui/index.js\";\n\nexport const useUi = () => {\n return useContext(UiContext) as UiContextValue;\n};\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAElC,SAASC,SAAS;AAElB,OAAO,MAAMC,KAAK,GAAGA,CAAA,KAAM;EACvB,OAAOF,UAAU,CAACC,SAAS,CAAC;AAChC,CAAC","ignoreList":[]}
package/i18n/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { default as i18n } from "./i18n";
1
+ export { default as i18n } from "./i18n.js";
package/i18n/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { default as i18n } from "./i18n";
1
+ export { default as i18n } from "./i18n.js";
2
2
 
3
3
  //# sourceMappingURL=index.js.map
package/i18n/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["default","i18n"],"sources":["index.ts"],"sourcesContent":["export { default as i18n } from \"./i18n\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,IAAI","ignoreList":[]}
1
+ {"version":3,"names":["default","i18n"],"sources":["index.ts"],"sourcesContent":["export { default as i18n } from \"./i18n.js\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,IAAI","ignoreList":[]}
package/index.d.ts CHANGED
@@ -1,17 +1,25 @@
1
- export { AddQuerySelectionPlugin } from "./plugins/AddQuerySelectionPlugin";
2
- export { ApolloLinkPlugin } from "./plugins/ApolloLinkPlugin";
3
- export { RoutePlugin } from "./plugins/RoutePlugin";
4
- export { ApolloCacheObjectIdPlugin, ApolloCacheObject } from "./plugins/ApolloCacheObjectIdPlugin";
1
+ export { AddQuerySelectionPlugin } from "./plugins/AddQuerySelectionPlugin.js";
2
+ export { ApolloLinkPlugin } from "./plugins/ApolloLinkPlugin.js";
3
+ export { ApolloCacheObjectIdPlugin, type ApolloCacheObject } from "./plugins/ApolloCacheObjectIdPlugin.js";
5
4
  export * from "@webiny/react-composition";
6
5
  export type { HigherOrderComponent, ComposeProps, ComposableFC } from "@webiny/react-composition";
7
- export * from "./App";
8
- export * from "./AppContainer";
9
- export type { AppProps } from "./App";
10
- export * from "./core/Plugins";
11
- export * from "./core/Plugin";
12
- export * from "./core/Provider";
13
- export * from "./core/DebounceRender";
14
- export * from "./core/createProvider";
15
- export * from "./core/createProviderPlugin";
16
- export * from "./renderApp";
17
- export * from "./utils/createGenericContext";
6
+ export * from "./App.js";
7
+ export * from "./AppContainer.js";
8
+ export type { AppProps } from "./App.js";
9
+ export * from "./core/Plugins.js";
10
+ export * from "./core/Plugin.js";
11
+ export * from "./core/Provider.js";
12
+ export * from "./core/createProvider.js";
13
+ export * from "./core/createProviderPlugin.js";
14
+ export * from "./renderApp.js";
15
+ export * from "./utils/createGenericContext.js";
16
+ export { useContainer, DiContainerProvider } from "./shared/di/DiContainerProvider.js";
17
+ export { useFeature } from "./shared/di/useFeature.js";
18
+ export { createFeature } from "./shared/di/createFeature.js";
19
+ export { Route } from "./features/router/Route.js";
20
+ export { RouteLink, type RouteLinkProps } from "./presentation/router/components/RouteLink.js";
21
+ export { SimpleLink, type SimpleLinkProps } from "./presentation/router/components/SimpleLink.js";
22
+ export { useEnvConfig } from "./presentation/envConfig/useEnvConfig.js";
23
+ export { useRouter, useRoute } from "./presentation/router/index.js";
24
+ export { useLocalStorage, useLocalStorageValue, useLocalStorageValues } from "./presentation/localStorage/index.js";
25
+ export * from "./helpers/InterfaceGenerator/index.js";
package/index.js CHANGED
@@ -1,20 +1,28 @@
1
- export { AddQuerySelectionPlugin } from "./plugins/AddQuerySelectionPlugin";
2
- export { ApolloLinkPlugin } from "./plugins/ApolloLinkPlugin";
3
- export { RoutePlugin } from "./plugins/RoutePlugin";
4
- export { ApolloCacheObjectIdPlugin, ApolloCacheObject } from "./plugins/ApolloCacheObjectIdPlugin";
1
+ export { AddQuerySelectionPlugin } from "./plugins/AddQuerySelectionPlugin.js";
2
+ export { ApolloLinkPlugin } from "./plugins/ApolloLinkPlugin.js";
3
+ export { ApolloCacheObjectIdPlugin } from "./plugins/ApolloCacheObjectIdPlugin.js";
5
4
 
6
5
  // Composition - we re-export this for ease of use
7
6
  export * from "@webiny/react-composition";
8
7
  // App framework
9
- export * from "./App";
10
- export * from "./AppContainer";
11
- export * from "./core/Plugins";
12
- export * from "./core/Plugin";
13
- export * from "./core/Provider";
14
- export * from "./core/DebounceRender";
15
- export * from "./core/createProvider";
16
- export * from "./core/createProviderPlugin";
17
- export * from "./renderApp";
18
- export * from "./utils/createGenericContext";
8
+ export * from "./App.js";
9
+ export * from "./AppContainer.js";
10
+ export * from "./core/Plugins.js";
11
+ export * from "./core/Plugin.js";
12
+ export * from "./core/Provider.js";
13
+ export * from "./core/createProvider.js";
14
+ export * from "./core/createProviderPlugin.js";
15
+ export * from "./renderApp.js";
16
+ export * from "./utils/createGenericContext.js";
17
+ export { useContainer, DiContainerProvider } from "./shared/di/DiContainerProvider.js";
18
+ export { useFeature } from "./shared/di/useFeature.js";
19
+ export { createFeature } from "./shared/di/createFeature.js";
20
+ export { Route } from "./features/router/Route.js";
21
+ export { RouteLink } from "./presentation/router/components/RouteLink.js";
22
+ export { SimpleLink } from "./presentation/router/components/SimpleLink.js";
23
+ export { useEnvConfig } from "./presentation/envConfig/useEnvConfig.js";
24
+ export { useRouter, useRoute } from "./presentation/router/index.js";
25
+ export { useLocalStorage, useLocalStorageValue, useLocalStorageValues } from "./presentation/localStorage/index.js";
26
+ export * from "./helpers/InterfaceGenerator/index.js";
19
27
 
20
28
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["AddQuerySelectionPlugin","ApolloLinkPlugin","RoutePlugin","ApolloCacheObjectIdPlugin","ApolloCacheObject"],"sources":["index.ts"],"sourcesContent":["export { AddQuerySelectionPlugin } from \"./plugins/AddQuerySelectionPlugin\";\nexport { ApolloLinkPlugin } from \"./plugins/ApolloLinkPlugin\";\nexport { RoutePlugin } from \"./plugins/RoutePlugin\";\nexport { ApolloCacheObjectIdPlugin, ApolloCacheObject } from \"./plugins/ApolloCacheObjectIdPlugin\";\n\n// Composition - we re-export this for ease of use\nexport * from \"@webiny/react-composition\";\nexport type { HigherOrderComponent, ComposeProps, ComposableFC } from \"@webiny/react-composition\";\n\n// App framework\nexport * from \"./App\";\nexport * from \"./AppContainer\";\nexport type { AppProps } from \"./App\";\nexport * from \"./core/Plugins\";\nexport * from \"./core/Plugin\";\nexport * from \"./core/Provider\";\nexport * from \"./core/DebounceRender\";\nexport * from \"./core/createProvider\";\nexport * from \"./core/createProviderPlugin\";\nexport * from \"./renderApp\";\nexport * from \"./utils/createGenericContext\";\n"],"mappings":"AAAA,SAASA,uBAAuB;AAChC,SAASC,gBAAgB;AACzB,SAASC,WAAW;AACpB,SAASC,yBAAyB,EAAEC,iBAAiB;;AAErD;AACA,cAAc,2BAA2B;AAGzC;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["AddQuerySelectionPlugin","ApolloLinkPlugin","ApolloCacheObjectIdPlugin","useContainer","DiContainerProvider","useFeature","createFeature","Route","RouteLink","SimpleLink","useEnvConfig","useRouter","useRoute","useLocalStorage","useLocalStorageValue","useLocalStorageValues"],"sources":["index.ts"],"sourcesContent":["export { AddQuerySelectionPlugin } from \"./plugins/AddQuerySelectionPlugin.js\";\nexport { ApolloLinkPlugin } from \"./plugins/ApolloLinkPlugin.js\";\nexport {\n ApolloCacheObjectIdPlugin,\n type ApolloCacheObject\n} from \"./plugins/ApolloCacheObjectIdPlugin.js\";\n\n// Composition - we re-export this for ease of use\nexport * from \"@webiny/react-composition\";\nexport type { HigherOrderComponent, ComposeProps, ComposableFC } from \"@webiny/react-composition\";\n\n// App framework\nexport * from \"./App.js\";\nexport * from \"./AppContainer.js\";\nexport type { AppProps } from \"./App.js\";\nexport * from \"./core/Plugins.js\";\nexport * from \"./core/Plugin.js\";\nexport * from \"./core/Provider.js\";\nexport * from \"./core/createProvider.js\";\nexport * from \"./core/createProviderPlugin.js\";\nexport * from \"./renderApp.js\";\nexport * from \"./utils/createGenericContext.js\";\nexport { useContainer, DiContainerProvider } from \"./shared/di/DiContainerProvider.js\";\nexport { useFeature } from \"./shared/di/useFeature.js\";\nexport { createFeature } from \"./shared/di/createFeature.js\";\n\nexport { Route } from \"./features/router/Route.js\";\nexport { RouteLink, type RouteLinkProps } from \"./presentation/router/components/RouteLink.js\";\nexport { SimpleLink, type SimpleLinkProps } from \"./presentation/router/components/SimpleLink.js\";\n\nexport { useEnvConfig } from \"./presentation/envConfig/useEnvConfig.js\";\nexport { useRouter, useRoute } from \"./presentation/router/index.js\";\nexport {\n useLocalStorage,\n useLocalStorageValue,\n useLocalStorageValues\n} from \"./presentation/localStorage/index.js\";\n\nexport * from \"./helpers/InterfaceGenerator/index.js\";\n"],"mappings":"AAAA,SAASA,uBAAuB;AAChC,SAASC,gBAAgB;AACzB,SACIC,yBAAyB;;AAI7B;AACA,cAAc,2BAA2B;AAGzC;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAY,EAAEC,mBAAmB;AAC1C,SAASC,UAAU;AACnB,SAASC,aAAa;AAEtB,SAASC,KAAK;AACd,SAASC,SAAS;AAClB,SAASC,UAAU;AAEnB,SAASC,YAAY;AACrB,SAASC,SAAS,EAAEC,QAAQ;AAC5B,SACIC,eAAe,EACfC,oBAAoB,EACpBC,qBAAqB;AAGzB","ignoreList":[]}
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@webiny/app",
3
- "version": "0.0.0-unstable.e53eceafb5",
4
- "main": "index.js",
3
+ "version": "0.0.0-unstable.e6f0dc8ca7",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": "./index.js",
7
+ "./*": "./*"
8
+ },
5
9
  "repository": {
6
10
  "type": "git",
7
11
  "url": "https://github.com/webiny/webiny-js.git"
@@ -15,15 +19,15 @@
15
19
  "license": "MIT",
16
20
  "dependencies": {
17
21
  "@apollo/react-hooks": "3.1.5",
18
- "@emotion/styled": "11.10.6",
19
- "@types/react": "18.2.79",
20
- "@webiny/i18n": "0.0.0-unstable.e53eceafb5",
21
- "@webiny/i18n-react": "0.0.0-unstable.e53eceafb5",
22
- "@webiny/plugins": "0.0.0-unstable.e53eceafb5",
23
- "@webiny/react-composition": "0.0.0-unstable.e53eceafb5",
24
- "@webiny/react-properties": "0.0.0-unstable.e53eceafb5",
25
- "@webiny/react-router": "0.0.0-unstable.e53eceafb5",
26
- "@webiny/ui": "0.0.0-unstable.e53eceafb5",
22
+ "@emotion/styled": "11.14.1",
23
+ "@types/react": "18.3.28",
24
+ "@webiny/di": "0.2.3",
25
+ "@webiny/feature": "0.0.0-unstable.e6f0dc8ca7",
26
+ "@webiny/i18n": "0.0.0-unstable.e6f0dc8ca7",
27
+ "@webiny/i18n-react": "0.0.0-unstable.e6f0dc8ca7",
28
+ "@webiny/plugins": "0.0.0-unstable.e6f0dc8ca7",
29
+ "@webiny/react-composition": "0.0.0-unstable.e6f0dc8ca7",
30
+ "@webiny/react-properties": "0.0.0-unstable.e6f0dc8ca7",
27
31
  "apollo-cache": "1.3.5",
28
32
  "apollo-cache-inmemory": "1.6.6",
29
33
  "apollo-client": "2.6.10",
@@ -34,31 +38,32 @@
34
38
  "apollo-utilities": "1.3.4",
35
39
  "boolean": "3.2.0",
36
40
  "bytes": "3.1.2",
37
- "graphql": "15.9.0",
41
+ "graphql": "16.14.0",
42
+ "history": "5.3.0",
38
43
  "invariant": "2.2.4",
39
- "lodash": "4.17.21",
40
- "minimatch": "5.1.6",
41
- "nanoid": "3.3.8",
42
- "react": "18.2.0",
43
- "react-dom": "18.2.0",
44
+ "lodash": "4.18.1",
45
+ "minimatch": "10.2.5",
46
+ "mobx": "6.15.3",
47
+ "nanoid": "5.1.11",
48
+ "react": "18.3.1",
49
+ "react-dom": "18.3.1",
44
50
  "ts-invariant": "0.10.3",
45
- "warning": "4.0.3"
51
+ "warning": "4.0.3",
52
+ "zod": "4.4.3"
46
53
  },
47
54
  "devDependencies": {
48
- "@types/lodash": "4.17.13",
49
- "@types/warning": "3.0.0",
50
- "@webiny/project-utils": "0.0.0-unstable.e53eceafb5",
51
- "rimraf": "6.0.1",
52
- "typescript": "5.3.3"
55
+ "@types/lodash": "4.17.24",
56
+ "@types/warning": "3.0.4",
57
+ "@webiny/build-tools": "0.0.0-unstable.e6f0dc8ca7",
58
+ "rimraf": "6.1.3",
59
+ "type-fest": "5.6.0",
60
+ "typescript": "6.0.3",
61
+ "vitest": "4.1.5"
53
62
  },
54
63
  "publishConfig": {
55
64
  "access": "public",
56
65
  "directory": "dist"
57
66
  },
58
- "scripts": {
59
- "build": "node ../cli/bin.js run build",
60
- "watch": "node ../cli/bin.js run watch"
61
- },
62
67
  "adio": {
63
68
  "ignore": {
64
69
  "dependencies": [
@@ -66,5 +71,5 @@
66
71
  ]
67
72
  }
68
73
  },
69
- "gitHead": "e53eceafb5ce1a3872c9b4548939bb2eae5b1aef"
74
+ "gitHead": "e6f0dc8ca741c1fcc3fec9a5b9e86fdd49544641"
70
75
  }
@@ -1,6 +1,6 @@
1
1
  import { ApolloLink } from "apollo-link";
2
2
  import type { DocumentNode } from "graphql";
3
- import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
3
+ import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
4
4
  declare module "graphql" {
5
5
  interface DocumentNode {
6
6
  __webiny__: Set<string>;
@@ -1,5 +1,5 @@
1
1
  import { ApolloLink } from "apollo-link";
2
- import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
2
+ import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
3
3
  export class AddQuerySelectionPlugin extends ApolloLinkPlugin {
4
4
  constructor(config) {
5
5
  super();
@@ -1 +1 @@
1
- {"version":3,"names":["ApolloLink","ApolloLinkPlugin","AddQuerySelectionPlugin","constructor","config","createLink","operation","forward","operationName","addSelectionToQuery","query","document","isProcessed","markProcessed","addSelection","selectionPath","firstQueryDefinition","definitions","selectionSet","tree","selections","fields","split","fieldLoop","field","selection","name","value","push","hasOwnProperty","__webiny__","Set","has","cacheKey","add"],"sources":["AddQuerySelectionPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport type { DocumentNode } from \"graphql\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport type { ExecutableDefinitionNode, FieldNode } from \"graphql/language/ast\";\n\ndeclare module \"graphql\" {\n interface DocumentNode {\n __webiny__: Set<string>;\n }\n}\n\ninterface Config {\n operationName: string;\n selectionPath: string;\n addSelection: DocumentNode;\n}\n\nexport class AddQuerySelectionPlugin extends ApolloLinkPlugin {\n private readonly config: Config;\n\n constructor(config: Config) {\n super();\n this.config = config;\n }\n\n public override createLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (operation.operationName !== this.config.operationName) {\n return forward(operation);\n }\n\n this.addSelectionToQuery(operation.operationName, operation.query);\n\n return forward(operation);\n });\n }\n\n public addSelectionToQuery(operationName: string, document: DocumentNode): void {\n if (operationName !== this.config.operationName) {\n return;\n }\n\n // If this plugin already processed the given document (documents are always passed by reference),\n // then we don't want to apply the selection again, to avoid adding duplicate selections.\n if (this.isProcessed(document)) {\n return;\n }\n\n this.markProcessed(document);\n\n const { addSelection, selectionPath } = this.config;\n\n const firstQueryDefinition = document.definitions[0] as ExecutableDefinitionNode;\n if (!firstQueryDefinition) {\n return;\n } else if (!firstQueryDefinition.selectionSet) {\n return;\n }\n\n let tree = firstQueryDefinition.selectionSet.selections as FieldNode[];\n const fields = selectionPath.split(\".\");\n\n fieldLoop: for (const field of fields) {\n for (const selection of tree) {\n if (!selection.selectionSet) {\n continue;\n }\n if (selection.name.value === field) {\n tree = selection.selectionSet.selections as FieldNode[];\n continue fieldLoop;\n }\n }\n // If we get here, it means we didn't find the necessary selection\n return;\n }\n /**\n * We must cast because there are a lot of types that are not intertwined and TS is complaining\n */\n tree.push(\n ...((addSelection.definitions[0] as ExecutableDefinitionNode).selectionSet\n .selections as FieldNode[])\n );\n }\n\n private isProcessed(document: DocumentNode) {\n if (!document.hasOwnProperty(\"__webiny__\")) {\n document.__webiny__ = new Set();\n }\n\n return document.__webiny__.has(this.cacheKey);\n }\n\n private markProcessed(document: DocumentNode) {\n if (!document.hasOwnProperty(\"__webiny__\")) {\n document.__webiny__ = new Set();\n }\n\n document.__webiny__.add(this.cacheKey);\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,aAAa;AAExC,SAASC,gBAAgB;AAezB,OAAO,MAAMC,uBAAuB,SAASD,gBAAgB,CAAC;EAG1DE,WAAWA,CAACC,MAAc,EAAE;IACxB,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEgBC,UAAUA,CAAA,EAAe;IACrC,OAAO,IAAIL,UAAU,CAAC,CAACM,SAAS,EAAEC,OAAO,KAAK;MAC1C,IAAID,SAAS,CAACE,aAAa,KAAK,IAAI,CAACJ,MAAM,CAACI,aAAa,EAAE;QACvD,OAAOD,OAAO,CAACD,SAAS,CAAC;MAC7B;MAEA,IAAI,CAACG,mBAAmB,CAACH,SAAS,CAACE,aAAa,EAAEF,SAAS,CAACI,KAAK,CAAC;MAElE,OAAOH,OAAO,CAACD,SAAS,CAAC;IAC7B,CAAC,CAAC;EACN;EAEOG,mBAAmBA,CAACD,aAAqB,EAAEG,QAAsB,EAAQ;IAC5E,IAAIH,aAAa,KAAK,IAAI,CAACJ,MAAM,CAACI,aAAa,EAAE;MAC7C;IACJ;;IAEA;IACA;IACA,IAAI,IAAI,CAACI,WAAW,CAACD,QAAQ,CAAC,EAAE;MAC5B;IACJ;IAEA,IAAI,CAACE,aAAa,CAACF,QAAQ,CAAC;IAE5B,MAAM;MAAEG,YAAY;MAAEC;IAAc,CAAC,GAAG,IAAI,CAACX,MAAM;IAEnD,MAAMY,oBAAoB,GAAGL,QAAQ,CAACM,WAAW,CAAC,CAAC,CAA6B;IAChF,IAAI,CAACD,oBAAoB,EAAE;MACvB;IACJ,CAAC,MAAM,IAAI,CAACA,oBAAoB,CAACE,YAAY,EAAE;MAC3C;IACJ;IAEA,IAAIC,IAAI,GAAGH,oBAAoB,CAACE,YAAY,CAACE,UAAyB;IACtE,MAAMC,MAAM,GAAGN,aAAa,CAACO,KAAK,CAAC,GAAG,CAAC;IAEvCC,SAAS,EAAE,KAAK,MAAMC,KAAK,IAAIH,MAAM,EAAE;MACnC,KAAK,MAAMI,SAAS,IAAIN,IAAI,EAAE;QAC1B,IAAI,CAACM,SAAS,CAACP,YAAY,EAAE;UACzB;QACJ;QACA,IAAIO,SAAS,CAACC,IAAI,CAACC,KAAK,KAAKH,KAAK,EAAE;UAChCL,IAAI,GAAGM,SAAS,CAACP,YAAY,CAACE,UAAyB;UACvD,SAASG,SAAS;QACtB;MACJ;MACA;MACA;IACJ;IACA;AACR;AACA;IACQJ,IAAI,CAACS,IAAI,CACL,GAAKd,YAAY,CAACG,WAAW,CAAC,CAAC,CAAC,CAA8BC,YAAY,CACrEE,UACT,CAAC;EACL;EAEQR,WAAWA,CAACD,QAAsB,EAAE;IACxC,IAAI,CAACA,QAAQ,CAACkB,cAAc,CAAC,YAAY,CAAC,EAAE;MACxClB,QAAQ,CAACmB,UAAU,GAAG,IAAIC,GAAG,CAAC,CAAC;IACnC;IAEA,OAAOpB,QAAQ,CAACmB,UAAU,CAACE,GAAG,CAAC,IAAI,CAACC,QAAQ,CAAC;EACjD;EAEQpB,aAAaA,CAACF,QAAsB,EAAE;IAC1C,IAAI,CAACA,QAAQ,CAACkB,cAAc,CAAC,YAAY,CAAC,EAAE;MACxClB,QAAQ,CAACmB,UAAU,GAAG,IAAIC,GAAG,CAAC,CAAC;IACnC;IAEApB,QAAQ,CAACmB,UAAU,CAACI,GAAG,CAAC,IAAI,CAACD,QAAQ,CAAC;EAC1C;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["ApolloLink","ApolloLinkPlugin","AddQuerySelectionPlugin","constructor","config","createLink","operation","forward","operationName","addSelectionToQuery","query","document","isProcessed","markProcessed","addSelection","selectionPath","firstQueryDefinition","definitions","selectionSet","tree","selections","fields","split","fieldLoop","field","selection","name","value","push","hasOwnProperty","__webiny__","Set","has","cacheKey","add"],"sources":["AddQuerySelectionPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport type { DocumentNode } from \"graphql\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin.js\";\nimport type { ExecutableDefinitionNode, FieldNode } from \"graphql/language/ast.js\";\n\ndeclare module \"graphql\" {\n interface DocumentNode {\n __webiny__: Set<string>;\n }\n}\n\ninterface Config {\n operationName: string;\n selectionPath: string;\n addSelection: DocumentNode;\n}\n\nexport class AddQuerySelectionPlugin extends ApolloLinkPlugin {\n private readonly config: Config;\n\n constructor(config: Config) {\n super();\n this.config = config;\n }\n\n public override createLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (operation.operationName !== this.config.operationName) {\n return forward(operation);\n }\n\n this.addSelectionToQuery(operation.operationName, operation.query);\n\n return forward(operation);\n });\n }\n\n public addSelectionToQuery(operationName: string, document: DocumentNode): void {\n if (operationName !== this.config.operationName) {\n return;\n }\n\n // If this plugin already processed the given document (documents are always passed by reference),\n // then we don't want to apply the selection again, to avoid adding duplicate selections.\n if (this.isProcessed(document)) {\n return;\n }\n\n this.markProcessed(document);\n\n const { addSelection, selectionPath } = this.config;\n\n const firstQueryDefinition = document.definitions[0] as ExecutableDefinitionNode;\n if (!firstQueryDefinition) {\n return;\n } else if (!firstQueryDefinition.selectionSet) {\n return;\n }\n\n let tree = firstQueryDefinition.selectionSet.selections as FieldNode[];\n const fields = selectionPath.split(\".\");\n\n fieldLoop: for (const field of fields) {\n for (const selection of tree) {\n if (!selection.selectionSet) {\n continue;\n }\n if (selection.name.value === field) {\n tree = selection.selectionSet.selections as FieldNode[];\n continue fieldLoop;\n }\n }\n // If we get here, it means we didn't find the necessary selection\n return;\n }\n /**\n * We must cast because there are a lot of types that are not intertwined and TS is complaining\n */\n tree.push(\n ...((addSelection.definitions[0] as ExecutableDefinitionNode).selectionSet\n .selections as FieldNode[])\n );\n }\n\n private isProcessed(document: DocumentNode) {\n if (!document.hasOwnProperty(\"__webiny__\")) {\n document.__webiny__ = new Set();\n }\n\n return document.__webiny__.has(this.cacheKey);\n }\n\n private markProcessed(document: DocumentNode) {\n if (!document.hasOwnProperty(\"__webiny__\")) {\n document.__webiny__ = new Set();\n }\n\n document.__webiny__.add(this.cacheKey);\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,aAAa;AAExC,SAASC,gBAAgB;AAezB,OAAO,MAAMC,uBAAuB,SAASD,gBAAgB,CAAC;EAG1DE,WAAWA,CAACC,MAAc,EAAE;IACxB,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEgBC,UAAUA,CAAA,EAAe;IACrC,OAAO,IAAIL,UAAU,CAAC,CAACM,SAAS,EAAEC,OAAO,KAAK;MAC1C,IAAID,SAAS,CAACE,aAAa,KAAK,IAAI,CAACJ,MAAM,CAACI,aAAa,EAAE;QACvD,OAAOD,OAAO,CAACD,SAAS,CAAC;MAC7B;MAEA,IAAI,CAACG,mBAAmB,CAACH,SAAS,CAACE,aAAa,EAAEF,SAAS,CAACI,KAAK,CAAC;MAElE,OAAOH,OAAO,CAACD,SAAS,CAAC;IAC7B,CAAC,CAAC;EACN;EAEOG,mBAAmBA,CAACD,aAAqB,EAAEG,QAAsB,EAAQ;IAC5E,IAAIH,aAAa,KAAK,IAAI,CAACJ,MAAM,CAACI,aAAa,EAAE;MAC7C;IACJ;;IAEA;IACA;IACA,IAAI,IAAI,CAACI,WAAW,CAACD,QAAQ,CAAC,EAAE;MAC5B;IACJ;IAEA,IAAI,CAACE,aAAa,CAACF,QAAQ,CAAC;IAE5B,MAAM;MAAEG,YAAY;MAAEC;IAAc,CAAC,GAAG,IAAI,CAACX,MAAM;IAEnD,MAAMY,oBAAoB,GAAGL,QAAQ,CAACM,WAAW,CAAC,CAAC,CAA6B;IAChF,IAAI,CAACD,oBAAoB,EAAE;MACvB;IACJ,CAAC,MAAM,IAAI,CAACA,oBAAoB,CAACE,YAAY,EAAE;MAC3C;IACJ;IAEA,IAAIC,IAAI,GAAGH,oBAAoB,CAACE,YAAY,CAACE,UAAyB;IACtE,MAAMC,MAAM,GAAGN,aAAa,CAACO,KAAK,CAAC,GAAG,CAAC;IAEvCC,SAAS,EAAE,KAAK,MAAMC,KAAK,IAAIH,MAAM,EAAE;MACnC,KAAK,MAAMI,SAAS,IAAIN,IAAI,EAAE;QAC1B,IAAI,CAACM,SAAS,CAACP,YAAY,EAAE;UACzB;QACJ;QACA,IAAIO,SAAS,CAACC,IAAI,CAACC,KAAK,KAAKH,KAAK,EAAE;UAChCL,IAAI,GAAGM,SAAS,CAACP,YAAY,CAACE,UAAyB;UACvD,SAASG,SAAS;QACtB;MACJ;MACA;MACA;IACJ;IACA;AACR;AACA;IACQJ,IAAI,CAACS,IAAI,CACL,GAAKd,YAAY,CAACG,WAAW,CAAC,CAAC,CAAC,CAA8BC,YAAY,CACrEE,UACT,CAAC;EACL;EAEQR,WAAWA,CAACD,QAAsB,EAAE;IACxC,IAAI,CAACA,QAAQ,CAACkB,cAAc,CAAC,YAAY,CAAC,EAAE;MACxClB,QAAQ,CAACmB,UAAU,GAAG,IAAIC,GAAG,CAAC,CAAC;IACnC;IAEA,OAAOpB,QAAQ,CAACmB,UAAU,CAACE,GAAG,CAAC,IAAI,CAACC,QAAQ,CAAC;EACjD;EAEQpB,aAAaA,CAACF,QAAsB,EAAE;IAC1C,IAAI,CAACA,QAAQ,CAACkB,cAAc,CAAC,YAAY,CAAC,EAAE;MACxClB,QAAQ,CAACmB,UAAU,GAAG,IAAIC,GAAG,CAAC,CAAC;IACnC;IAEApB,QAAQ,CAACmB,UAAU,CAACI,GAAG,CAAC,IAAI,CAACD,QAAQ,CAAC;EAC1C;AACJ","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import type { NextLink } from "apollo-link";
2
2
  import { ApolloLink } from "apollo-link";
3
- import type { Operation } from "apollo-link/lib/types";
3
+ import type { Operation } from "apollo-link/lib/types.js";
4
4
  export declare class ApolloDynamicLink extends ApolloLink {
5
5
  private cache;
6
6
  request(operation: Operation, forward: NextLink): any;
@@ -1 +1 @@
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 type { NextLink } from \"apollo-link\";\nimport { ApolloLink } from \"apollo-link\";\nimport { plugins } from \"@webiny/plugins\";\nimport type { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport type { 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":"AACA,SAASA,UAAU,QAAQ,aAAa;AACxC,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
+ {"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 type { NextLink } from \"apollo-link\";\nimport { ApolloLink } from \"apollo-link\";\nimport { plugins } from \"@webiny/plugins\";\nimport type { ApolloLinkPlugin } from \"./ApolloLinkPlugin.js\";\nimport type { Operation } from \"apollo-link/lib/types.js\";\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":"AACA,SAASA,UAAU,QAAQ,aAAa;AACxC,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,5 +1,5 @@
1
1
  import { ApolloLink } from "apollo-link";
2
- import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
2
+ import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
3
3
  /**
4
4
  * This link checks for presence of `extensions.console` in the response and logs all items to browser console.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import { ApolloLink } from "apollo-link";
2
- import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
2
+ import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
3
3
  /**
4
4
  * This link checks for presence of `extensions.console` in the response and logs all items to browser console.
5
5
  */
@@ -1 +1 @@
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 type { FetchResult as BaseFetchResult } from \"apollo-link\";\nimport { ApolloLink } from \"apollo-link\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport type { 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":"AACA,SAASA,UAAU,QAAQ,aAAa;AACxC,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
+ {"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 type { FetchResult as BaseFetchResult } from \"apollo-link\";\nimport { ApolloLink } from \"apollo-link\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin.js\";\nimport type { OperationDefinitionNode } from \"graphql/language/ast.js\";\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":"AACA,SAASA,UAAU,QAAQ,aAAa;AACxC,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,14 +1,9 @@
1
1
  import React from "react";
2
- interface ErrorOverlayProps {
3
- query: string;
4
- networkError: {
5
- message: string;
6
- result?: {
7
- error?: {
8
- stack?: string;
9
- };
10
- };
11
- };
12
- }
13
- declare const ErrorOverlay: (props: ErrorOverlayProps) => React.JSX.Element | null;
14
- export default ErrorOverlay;
2
+ type ErrorOverlayProps = Partial<{
3
+ title: React.ReactNode;
4
+ message: React.ReactNode;
5
+ description: React.ReactNode;
6
+ closeable?: boolean;
7
+ }>;
8
+ export declare const ErrorOverlay: (props: ErrorOverlayProps) => React.JSX.Element | null;
9
+ export {};
@@ -1,26 +1,21 @@
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";
2
+ import { Typography } from "./Typography.js";
3
+ import { i18n } from "../../i18n/index.js";
4
+ import { OverlayWrapper } from "./StyledComponents.js";
7
5
  import { ReactComponent as CloseIcon } from "./assets/close_24px.svg";
8
6
  const t = i18n.ns("app/graphql/error-overlay");
9
7
  const ENVIRONMENT_VARIABLES_ARTICLE_LINK = "https://www.webiny.com/docs/how-to-guides/environment-variables";
10
- const ErrorOverlay = props => {
8
+ export const ErrorOverlay = props => {
11
9
  const {
12
- query,
13
- networkError
10
+ title = "An error occurred",
11
+ message,
12
+ description,
13
+ closeable
14
14
  } = props;
15
15
  const [open, setOpen] = useState(true);
16
- // Log error in browser's developer console for further inspection.
17
- console.error({
18
- networkError
19
- });
20
16
  if (!open) {
21
17
  return null;
22
18
  }
23
- const stackTrace = get(networkError, "result.error.stack");
24
19
  return /*#__PURE__*/React.createElement(OverlayWrapper, null, /*#__PURE__*/React.createElement("div", {
25
20
  className: "inner"
26
21
  }, /*#__PURE__*/React.createElement("div", {
@@ -28,26 +23,21 @@ const ErrorOverlay = props => {
28
23
  }, /*#__PURE__*/React.createElement("div", {
29
24
  className: "header__title"
30
25
  }, /*#__PURE__*/React.createElement(Typography, {
31
- use: "headline4"
32
- }, networkError.message)), /*#__PURE__*/React.createElement("div", {
26
+ use: "headline"
27
+ }, title)), closeable !== false && /*#__PURE__*/React.createElement("div", {
33
28
  className: "header__action"
34
- }, /*#__PURE__*/React.createElement(IconButton, {
35
- icon: /*#__PURE__*/React.createElement(CloseIcon, null),
29
+ }, /*#__PURE__*/React.createElement("span", {
36
30
  onClick: () => setOpen(false)
37
- }))), /*#__PURE__*/React.createElement("div", {
31
+ }, /*#__PURE__*/React.createElement(CloseIcon, null)))), /*#__PURE__*/React.createElement("div", {
38
32
  className: "body"
39
33
  }, /*#__PURE__*/React.createElement("div", {
40
34
  className: "body__summary"
41
- }, /*#__PURE__*/React.createElement(Typography, {
42
- use: "subtitle1"
43
- }, t`Error occurred while executing operation:`), /*#__PURE__*/React.createElement(Pre, null, /*#__PURE__*/React.createElement("code", null, query))), stackTrace && /*#__PURE__*/React.createElement("div", {
35
+ }, message), description && /*#__PURE__*/React.createElement("div", {
44
36
  className: "body__description"
45
- }, /*#__PURE__*/React.createElement(Typography, {
46
- use: "subtitle1"
47
- }, t`Complete stack trace:`), /*#__PURE__*/React.createElement(Pre, null, /*#__PURE__*/React.createElement("code", null, stackTrace)))), /*#__PURE__*/React.createElement("div", {
37
+ }, description)), /*#__PURE__*/React.createElement("div", {
48
38
  className: "footer"
49
39
  }, /*#__PURE__*/React.createElement(Typography, {
50
- use: "body2"
40
+ use: "body"
51
41
  }, t`
52
42
  This screen is only visible if {message} environment variable is set.
53
43
  Read more about it in the {link}. `({
@@ -61,6 +51,5 @@ const ErrorOverlay = props => {
61
51
  }, "environment variables article")
62
52
  }), /*#__PURE__*/React.createElement("br", null), t`Open your browser's developer console to further inspect this error.`))));
63
53
  };
64
- export default ErrorOverlay;
65
54
 
66
55
  //# sourceMappingURL=ErrorOverlay.js.map
@@ -1 +1 @@
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;EACtC;EACAkB,OAAO,CAACC,KAAK,CAAC;IAAEJ;EAAa,CAAC,CAAC;EAE/B,IAAI,CAACC,IAAI,EAAE;IACP,OAAO,IAAI;EACf;EAEA,MAAMI,UAAU,GAAGnB,GAAG,CAACc,YAAY,EAAE,oBAAoB,CAAC;EAE1D,oBACIhB,KAAA,CAAAsB,aAAA,CAAChB,cAAc,qBACXN,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAO,gBAClBvB,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAQ,gBACnBvB,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAe,gBAC1BvB,KAAA,CAAAsB,aAAA,CAAClB,UAAU;IAACoB,GAAG,EAAE;EAAY,GAAER,YAAY,CAACS,OAAoB,CAC/D,CAAC,eACNzB,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAgB,gBAC3BvB,KAAA,CAAAsB,aAAA,CAACnB,UAAU;IAACuB,IAAI,eAAE1B,KAAA,CAAAsB,aAAA,CAACb,SAAS,MAAE,CAAE;IAACkB,OAAO,EAAEA,CAAA,KAAMT,OAAO,CAAC,KAAK;EAAE,CAAE,CAChE,CACJ,CAAC,eACNlB,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAM,gBACjBvB,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAe,gBAC1BvB,KAAA,CAAAsB,aAAA,CAAClB,UAAU;IACPoB,GAAG,EAAE;EAAY,GACnBd,CAAC,2CAAwD,CAAC,eAC5DV,KAAA,CAAAsB,aAAA,CAACf,GAAG,qBACAP,KAAA,CAAAsB,aAAA,eAAOP,KAAY,CAClB,CACJ,CAAC,EACLM,UAAU,iBACPrB,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAmB,gBAC9BvB,KAAA,CAAAsB,aAAA,CAAClB,UAAU;IAACoB,GAAG,EAAE;EAAY,GAAEd,CAAC,uBAAoC,CAAC,eACrEV,KAAA,CAAAsB,aAAA,CAACf,GAAG,qBACAP,KAAA,CAAAsB,aAAA,eAAOD,UAAiB,CACvB,CACJ,CAER,CAAC,eACNrB,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAQ,gBACnBvB,KAAA,CAAAsB,aAAA,CAAClB,UAAU;IAACoB,GAAG,EAAE;EAAQ,GACpBd,CAAC;AAC1B;AACA,2DAA2D,CAAC;IAChCe,OAAO,eAAEzB,KAAA,CAAAsB,aAAA;MAAMC,SAAS,EAAE;IAAY,GAAC,wBAA4B,CAAC;IACpEK,IAAI,eACA5B,KAAA,CAAAsB,aAAA;MACIO,IAAI,EAAEjB,kCAAmC;MACzCkB,MAAM,EAAE,QAAS;MACjBC,GAAG,EAAE;IAAsB,GAC9B,+BAEE;EAEX,CAAC,CAAC,eACF/B,KAAA,CAAAsB,aAAA,WAAK,CAAC,EACLZ,CAAC,sEACM,CACX,CACJ,CACO,CAAC;AAEzB,CAAC;AAED,eAAeG,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["React","useState","Typography","i18n","OverlayWrapper","ReactComponent","CloseIcon","t","ns","ENVIRONMENT_VARIABLES_ARTICLE_LINK","ErrorOverlay","props","title","message","description","closeable","open","setOpen","createElement","className","use","onClick","link","href","target","rel"],"sources":["ErrorOverlay.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { Typography } from \"./Typography.js\";\nimport { i18n } from \"../../i18n/index.js\";\nimport { OverlayWrapper } from \"./StyledComponents.js\";\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\ntype ErrorOverlayProps = Partial<{\n title: React.ReactNode;\n message: React.ReactNode;\n description: React.ReactNode;\n closeable?: boolean;\n}>;\n\nexport const ErrorOverlay = (props: ErrorOverlayProps) => {\n const { title = \"An error occurred\", message, description, closeable } = props;\n const [open, setOpen] = useState(true);\n if (!open) {\n return null;\n }\n\n return (\n <OverlayWrapper>\n <div className=\"inner\">\n <div className=\"header\">\n <div className=\"header__title\">\n <Typography use={\"headline\"}>{title}</Typography>\n </div>\n {closeable !== false && (\n <div className=\"header__action\">\n <span onClick={() => setOpen(false)}>\n <CloseIcon />\n </span>\n </div>\n )}\n </div>\n <div className=\"body\">\n <div className=\"body__summary\">{message}</div>\n {description && <div className=\"body__description\">{description}</div>}\n </div>\n <div className=\"footer\">\n <Typography use={\"body\"}>\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"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,UAAU;AACnB,SAASC,IAAI;AACb,SAASC,cAAc;AACvB,SAASC,cAAc,IAAIC,SAAS;AAEpC,MAAMC,CAAC,GAAGJ,IAAI,CAACK,EAAE,CAAC,2BAA2B,CAAC;AAE9C,MAAMC,kCAAkC,GACpC,iEAAiE;AASrE,OAAO,MAAMC,YAAY,GAAIC,KAAwB,IAAK;EACtD,MAAM;IAAEC,KAAK,GAAG,mBAAmB;IAAEC,OAAO;IAAEC,WAAW;IAAEC;EAAU,CAAC,GAAGJ,KAAK;EAC9E,MAAM,CAACK,IAAI,EAAEC,OAAO,CAAC,GAAGhB,QAAQ,CAAC,IAAI,CAAC;EACtC,IAAI,CAACe,IAAI,EAAE;IACP,OAAO,IAAI;EACf;EAEA,oBACIhB,KAAA,CAAAkB,aAAA,CAACd,cAAc,qBACXJ,KAAA,CAAAkB,aAAA;IAAKC,SAAS,EAAC;EAAO,gBAClBnB,KAAA,CAAAkB,aAAA;IAAKC,SAAS,EAAC;EAAQ,gBACnBnB,KAAA,CAAAkB,aAAA;IAAKC,SAAS,EAAC;EAAe,gBAC1BnB,KAAA,CAAAkB,aAAA,CAAChB,UAAU;IAACkB,GAAG,EAAE;EAAW,GAAER,KAAkB,CAC/C,CAAC,EACLG,SAAS,KAAK,KAAK,iBAChBf,KAAA,CAAAkB,aAAA;IAAKC,SAAS,EAAC;EAAgB,gBAC3BnB,KAAA,CAAAkB,aAAA;IAAMG,OAAO,EAAEA,CAAA,KAAMJ,OAAO,CAAC,KAAK;EAAE,gBAChCjB,KAAA,CAAAkB,aAAA,CAACZ,SAAS,MAAE,CACV,CACL,CAER,CAAC,eACNN,KAAA,CAAAkB,aAAA;IAAKC,SAAS,EAAC;EAAM,gBACjBnB,KAAA,CAAAkB,aAAA;IAAKC,SAAS,EAAC;EAAe,GAAEN,OAAa,CAAC,EAC7CC,WAAW,iBAAId,KAAA,CAAAkB,aAAA;IAAKC,SAAS,EAAC;EAAmB,GAAEL,WAAiB,CACpE,CAAC,eACNd,KAAA,CAAAkB,aAAA;IAAKC,SAAS,EAAC;EAAQ,gBACnBnB,KAAA,CAAAkB,aAAA,CAAChB,UAAU;IAACkB,GAAG,EAAE;EAAO,GACnBb,CAAC;AAC1B;AACA,2DAA2D,CAAC;IAChCM,OAAO,eAAEb,KAAA,CAAAkB,aAAA;MAAMC,SAAS,EAAE;IAAY,GAAC,wBAA4B,CAAC;IACpEG,IAAI,eACAtB,KAAA,CAAAkB,aAAA;MACIK,IAAI,EAAEd,kCAAmC;MACzCe,MAAM,EAAE,QAAS;MACjBC,GAAG,EAAE;IAAsB,GAC9B,+BAEE;EAEX,CAAC,CAAC,eACFzB,KAAA,CAAAkB,aAAA,WAAK,CAAC,EACLX,CAAC,sEACM,CACX,CACJ,CACO,CAAC;AAEzB,CAAC","ignoreList":[]}
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ interface ErrorOverlayProps {
3
+ query: string;
4
+ networkError: {
5
+ message: string;
6
+ result?: {
7
+ error?: {
8
+ stack?: string;
9
+ };
10
+ };
11
+ };
12
+ }
13
+ export declare const GqlErrorOverlay: (props: ErrorOverlayProps) => React.JSX.Element;
14
+ export {};
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ import get from "lodash/get.js";
3
+ import { Typography } from "./Typography.js";
4
+ import { i18n } from "../../i18n/index.js";
5
+ import { Pre } from "./StyledComponents.js";
6
+ import { ErrorOverlay } from "./ErrorOverlay.js";
7
+ const t = i18n.ns("app/graphql/error-overlay");
8
+ export const GqlErrorOverlay = props => {
9
+ const {
10
+ query,
11
+ networkError
12
+ } = props;
13
+ const stackTrace = get(networkError, "result.error.stack");
14
+ const title = networkError.message;
15
+ const message = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
16
+ use: "subtitle"
17
+ }, t`Error occurred while executing operation:`), /*#__PURE__*/React.createElement(Pre, null, /*#__PURE__*/React.createElement("code", null, query)));
18
+ let description = null;
19
+ if (stackTrace) {
20
+ description = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
21
+ use: "subtitle"
22
+ }, t`Complete stack trace:`), /*#__PURE__*/React.createElement(Pre, null, /*#__PURE__*/React.createElement("code", null, stackTrace)));
23
+ }
24
+ return /*#__PURE__*/React.createElement(ErrorOverlay, {
25
+ title: title,
26
+ message: message,
27
+ description: description
28
+ });
29
+ };
30
+
31
+ //# sourceMappingURL=GqlErrorOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","get","Typography","i18n","Pre","ErrorOverlay","t","ns","GqlErrorOverlay","props","query","networkError","stackTrace","title","message","createElement","Fragment","use","description"],"sources":["GqlErrorOverlay.tsx"],"sourcesContent":["import React from \"react\";\nimport get from \"lodash/get.js\";\nimport { Typography } from \"./Typography.js\";\nimport { i18n } from \"../../i18n/index.js\";\nimport { Pre } from \"./StyledComponents.js\";\nimport { ErrorOverlay } from \"./ErrorOverlay.js\";\n\nconst t = i18n.ns(\"app/graphql/error-overlay\");\n\ninterface ErrorOverlayProps {\n query: string;\n networkError: {\n message: string;\n result?: {\n error?: {\n stack?: string;\n };\n };\n };\n}\n\nexport const GqlErrorOverlay = (props: ErrorOverlayProps) => {\n const { query, networkError } = props;\n const stackTrace = get(networkError, \"result.error.stack\");\n\n const title = networkError.message;\n\n const message = (\n <>\n <Typography use={\"subtitle\"}>{t`Error occurred while executing operation:`}</Typography>\n <Pre>\n <code>{query}</code>\n </Pre>\n </>\n );\n\n let description: React.ReactNode = null;\n if (stackTrace) {\n description = (\n <>\n <Typography use={\"subtitle\"}>{t`Complete stack trace:`}</Typography>\n <Pre>\n <code>{stackTrace}</code>\n </Pre>\n </>\n );\n }\n\n return <ErrorOverlay title={title} message={message} description={description} />;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,GAAG,MAAM,eAAe;AAC/B,SAASC,UAAU;AACnB,SAASC,IAAI;AACb,SAASC,GAAG;AACZ,SAASC,YAAY;AAErB,MAAMC,CAAC,GAAGH,IAAI,CAACI,EAAE,CAAC,2BAA2B,CAAC;AAc9C,OAAO,MAAMC,eAAe,GAAIC,KAAwB,IAAK;EACzD,MAAM;IAAEC,KAAK;IAAEC;EAAa,CAAC,GAAGF,KAAK;EACrC,MAAMG,UAAU,GAAGX,GAAG,CAACU,YAAY,EAAE,oBAAoB,CAAC;EAE1D,MAAME,KAAK,GAAGF,YAAY,CAACG,OAAO;EAElC,MAAMA,OAAO,gBACTd,KAAA,CAAAe,aAAA,CAAAf,KAAA,CAAAgB,QAAA,qBACIhB,KAAA,CAAAe,aAAA,CAACb,UAAU;IAACe,GAAG,EAAE;EAAW,GAAEX,CAAC,2CAAwD,CAAC,eACxFN,KAAA,CAAAe,aAAA,CAACX,GAAG,qBACAJ,KAAA,CAAAe,aAAA,eAAOL,KAAY,CAClB,CACP,CACL;EAED,IAAIQ,WAA4B,GAAG,IAAI;EACvC,IAAIN,UAAU,EAAE;IACZM,WAAW,gBACPlB,KAAA,CAAAe,aAAA,CAAAf,KAAA,CAAAgB,QAAA,qBACIhB,KAAA,CAAAe,aAAA,CAACb,UAAU;MAACe,GAAG,EAAE;IAAW,GAAEX,CAAC,uBAAoC,CAAC,eACpEN,KAAA,CAAAe,aAAA,CAACX,GAAG,qBACAJ,KAAA,CAAAe,aAAA,eAAOH,UAAiB,CACvB,CACP,CACL;EACL;EAEA,oBAAOZ,KAAA,CAAAe,aAAA,CAACV,YAAY;IAACQ,KAAK,EAAEA,KAAM;IAACC,OAAO,EAAEA,OAAQ;IAACI,WAAW,EAAEA;EAAY,CAAE,CAAC;AACrF,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const LocalAwsLambdaTimeoutMessage: () => React.JSX.Element;