@webiny/app 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.eb81deee7e

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 (463) hide show
  1. package/App.d.ts +5 -6
  2. package/App.js +75 -88
  3. package/App.js.map +1 -1
  4. package/AppContainer.js +3 -6
  5. package/AppContainer.js.map +1 -1
  6. package/README.md +7 -15
  7. package/components/Image.d.ts +1 -2
  8. package/components/Image.js +12 -18
  9. package/components/Image.js.map +1 -1
  10. package/components/index.d.ts +1 -2
  11. package/components/index.js +1 -4
  12. package/config/RouterConfig/Route.d.ts +9 -10
  13. package/config/RouterConfig/Route.js +23 -37
  14. package/config/RouterConfig/Route.js.map +1 -1
  15. package/config/RouterConfig.d.ts +11 -14
  16. package/config/RouterConfig.js +12 -11
  17. package/config/RouterConfig.js.map +1 -1
  18. package/config.js +19 -20
  19. package/config.js.map +1 -1
  20. package/contexts/Ui/index.js +26 -28
  21. package/contexts/Ui/index.js.map +1 -1
  22. package/core/Plugin.d.ts +1 -1
  23. package/core/Plugin.js +9 -11
  24. package/core/Plugin.js.map +1 -1
  25. package/core/Plugins.d.ts +4 -3
  26. package/core/Plugins.js +18 -36
  27. package/core/Plugins.js.map +1 -1
  28. package/core/Provider.d.ts +1 -1
  29. package/core/Provider.js +6 -14
  30. package/core/Provider.js.map +1 -1
  31. package/core/createProvider.js +3 -6
  32. package/core/createProvider.js.map +1 -1
  33. package/core/createProviderPlugin.js +9 -14
  34. package/core/createProviderPlugin.js.map +1 -1
  35. package/errors/AuthenticationErrorEvent.d.ts +9 -0
  36. package/errors/AuthenticationErrorEvent.js +13 -0
  37. package/errors/AuthenticationErrorEvent.js.map +1 -0
  38. package/errors/NetworkErrorEvent.d.ts +15 -0
  39. package/errors/NetworkErrorEvent.js +13 -0
  40. package/errors/NetworkErrorEvent.js.map +1 -0
  41. package/errors/abstractions.d.ts +12 -0
  42. package/errors/abstractions.js +6 -0
  43. package/errors/abstractions.js.map +1 -0
  44. package/errors/index.d.ts +6 -0
  45. package/errors/index.js +3 -0
  46. package/errors/overlay/ErrorOverlay.d.ts +9 -0
  47. package/errors/overlay/ErrorOverlay.js +43 -0
  48. package/errors/overlay/ErrorOverlay.js.map +1 -0
  49. package/{plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts → errors/overlay/GqlErrorOverlay.d.ts} +2 -2
  50. package/errors/overlay/GqlErrorOverlay.js +27 -0
  51. package/errors/overlay/GqlErrorOverlay.js.map +1 -0
  52. package/errors/overlay/LocalAwsLambdaTimeoutMessage.d.ts +2 -0
  53. package/errors/overlay/LocalAwsLambdaTimeoutMessage.js +20 -0
  54. package/errors/overlay/LocalAwsLambdaTimeoutMessage.js.map +1 -0
  55. package/errors/overlay/StyledComponents.d.ts +7 -0
  56. package/errors/overlay/StyledComponents.js +10 -0
  57. package/errors/overlay/StyledComponents.js.map +1 -0
  58. package/errors/overlay/Typography.d.ts +8 -0
  59. package/errors/overlay/Typography.js +13 -0
  60. package/errors/overlay/Typography.js.map +1 -0
  61. package/errors/overlay/assets/close_24px.js +19 -0
  62. package/errors/overlay/assets/close_24px.js.map +1 -0
  63. package/errors/overlay/createErrorOverlay.d.ts +7 -0
  64. package/errors/overlay/createErrorOverlay.js +15 -0
  65. package/errors/overlay/createErrorOverlay.js.map +1 -0
  66. package/exports/admin/env-config.d.ts +2 -0
  67. package/exports/admin/env-config.js +2 -0
  68. package/exports/admin/graphql-client.d.ts +1 -0
  69. package/exports/admin/graphql-client.js +1 -0
  70. package/exports/admin/local-storage.d.ts +2 -0
  71. package/exports/admin/local-storage.js +2 -0
  72. package/exports/admin/router.d.ts +5 -0
  73. package/exports/admin/router.js +5 -0
  74. package/exports/admin/security.d.ts +1 -0
  75. package/exports/admin/security.js +1 -0
  76. package/exports/admin.d.ts +8 -0
  77. package/exports/admin.js +8 -0
  78. package/features/apiStreamClient/FetchApiStreamClient.d.ts +9 -0
  79. package/features/apiStreamClient/FetchApiStreamClient.js +63 -0
  80. package/features/apiStreamClient/FetchApiStreamClient.js.map +1 -0
  81. package/features/apiStreamClient/__tests__/FetchApiStreamClient.test.d.ts +1 -0
  82. package/features/apiStreamClient/__tests__/FetchApiStreamClient.test.js +170 -0
  83. package/features/apiStreamClient/__tests__/FetchApiStreamClient.test.js.map +1 -0
  84. package/features/apiStreamClient/__tests__/readServerSentEvents.test.d.ts +1 -0
  85. package/features/apiStreamClient/__tests__/readServerSentEvents.test.js +160 -0
  86. package/features/apiStreamClient/__tests__/readServerSentEvents.test.js.map +1 -0
  87. package/features/apiStreamClient/abstractions.d.ts +44 -0
  88. package/features/apiStreamClient/abstractions.js +10 -0
  89. package/features/apiStreamClient/abstractions.js.map +1 -0
  90. package/features/apiStreamClient/feature.d.ts +3 -0
  91. package/features/apiStreamClient/feature.js +17 -0
  92. package/features/apiStreamClient/feature.js.map +1 -0
  93. package/features/apiStreamClient/index.d.ts +5 -0
  94. package/features/apiStreamClient/index.js +5 -0
  95. package/features/apiStreamClient/readServerSentEvents.d.ts +10 -0
  96. package/features/apiStreamClient/readServerSentEvents.js +29 -0
  97. package/features/apiStreamClient/readServerSentEvents.js.map +1 -0
  98. package/features/apiStreamClient/toPayloadHash.d.ts +14 -0
  99. package/features/apiStreamClient/toPayloadHash.js +7 -0
  100. package/features/apiStreamClient/toPayloadHash.js.map +1 -0
  101. package/features/envConfig/EnvConfig.d.ts +7 -0
  102. package/features/envConfig/EnvConfig.js +16 -0
  103. package/features/envConfig/EnvConfig.js.map +1 -0
  104. package/features/envConfig/abstractions.d.ts +28 -0
  105. package/features/envConfig/abstractions.js +5 -0
  106. package/features/envConfig/abstractions.js.map +1 -0
  107. package/features/envConfig/feature.d.ts +17 -0
  108. package/features/envConfig/feature.js +15 -0
  109. package/features/envConfig/feature.js.map +1 -0
  110. package/features/envConfig/index.d.ts +1 -0
  111. package/features/envConfig/index.js +1 -0
  112. package/features/eventPublisher/EventPublisher.d.ts +8 -0
  113. package/features/eventPublisher/EventPublisher.js +19 -0
  114. package/features/eventPublisher/EventPublisher.js.map +1 -0
  115. package/features/eventPublisher/abstractions.d.ts +18 -0
  116. package/features/eventPublisher/abstractions.js +12 -0
  117. package/features/eventPublisher/abstractions.js.map +1 -0
  118. package/features/eventPublisher/feature.d.ts +3 -0
  119. package/features/eventPublisher/feature.js +17 -0
  120. package/features/eventPublisher/feature.js.map +1 -0
  121. package/features/eventPublisher/index.d.ts +3 -0
  122. package/features/eventPublisher/index.js +2 -0
  123. package/features/graphqlClient/AuthenticationErrorPublishing.d.ts +13 -0
  124. package/features/graphqlClient/AuthenticationErrorPublishing.js +35 -0
  125. package/features/graphqlClient/AuthenticationErrorPublishing.js.map +1 -0
  126. package/features/graphqlClient/BatchingGraphQLClient.d.ts +16 -0
  127. package/features/graphqlClient/BatchingGraphQLClient.js +118 -0
  128. package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -0
  129. package/features/graphqlClient/FetchGraphQLClient.d.ts +7 -0
  130. package/features/graphqlClient/FetchGraphQLClient.js +51 -0
  131. package/features/graphqlClient/FetchGraphQLClient.js.map +1 -0
  132. package/features/graphqlClient/NetworkErrorPublishing.d.ts +14 -0
  133. package/features/graphqlClient/NetworkErrorPublishing.js +48 -0
  134. package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -0
  135. package/features/graphqlClient/RequestValue.d.ts +21 -0
  136. package/features/graphqlClient/RequestValue.js +46 -0
  137. package/features/graphqlClient/RequestValue.js.map +1 -0
  138. package/features/graphqlClient/RetryGraphQLClient.d.ts +18 -0
  139. package/features/graphqlClient/RetryGraphQLClient.js +45 -0
  140. package/features/graphqlClient/RetryGraphQLClient.js.map +1 -0
  141. package/features/graphqlClient/__tests__/GraphQLClient.test.d.ts +1 -0
  142. package/features/graphqlClient/__tests__/GraphQLClient.test.js +471 -0
  143. package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -0
  144. package/features/graphqlClient/abstractions.d.ts +18 -0
  145. package/features/graphqlClient/abstractions.js +5 -0
  146. package/features/graphqlClient/abstractions.js.map +1 -0
  147. package/features/graphqlClient/feature.d.ts +6 -0
  148. package/features/graphqlClient/feature.js +25 -0
  149. package/features/graphqlClient/feature.js.map +1 -0
  150. package/features/graphqlClient/index.d.ts +1 -0
  151. package/features/graphqlClient/index.js +1 -0
  152. package/features/graphqlClient/types.d.ts +5 -0
  153. package/features/graphqlClient/types.js +0 -0
  154. package/features/localStorage/BrowserLocalStorageGateway.d.ts +9 -0
  155. package/features/localStorage/BrowserLocalStorageGateway.js +61 -0
  156. package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -0
  157. package/features/localStorage/LocalStorage.d.ts +12 -0
  158. package/features/localStorage/LocalStorage.js +34 -0
  159. package/features/localStorage/LocalStorage.js.map +1 -0
  160. package/features/localStorage/LocalStorageRepository.d.ts +20 -0
  161. package/features/localStorage/LocalStorageRepository.js +82 -0
  162. package/features/localStorage/LocalStorageRepository.js.map +1 -0
  163. package/features/localStorage/abstractions.d.ts +48 -0
  164. package/features/localStorage/abstractions.js +8 -0
  165. package/features/localStorage/abstractions.js.map +1 -0
  166. package/features/localStorage/feature.d.ts +12 -0
  167. package/features/localStorage/feature.js +23 -0
  168. package/features/localStorage/feature.js.map +1 -0
  169. package/features/localStorage/index.d.ts +1 -0
  170. package/features/localStorage/index.js +1 -0
  171. package/features/mainGraphQLClient/MainGraphQLClient.d.ts +11 -0
  172. package/features/mainGraphQLClient/MainGraphQLClient.js +27 -0
  173. package/features/mainGraphQLClient/MainGraphQLClient.js.map +1 -0
  174. package/features/mainGraphQLClient/abstractions.d.ts +17 -0
  175. package/features/mainGraphQLClient/abstractions.js +5 -0
  176. package/features/mainGraphQLClient/abstractions.js.map +1 -0
  177. package/features/mainGraphQLClient/feature.d.ts +3 -0
  178. package/features/mainGraphQLClient/feature.js +17 -0
  179. package/features/mainGraphQLClient/feature.js.map +1 -0
  180. package/features/mainGraphQLClient/index.d.ts +1 -0
  181. package/features/mainGraphQLClient/index.js +1 -0
  182. package/features/router/HistoryRouterGateway.d.ts +25 -0
  183. package/features/router/HistoryRouterGateway.js +100 -0
  184. package/features/router/HistoryRouterGateway.js.map +1 -0
  185. package/features/router/HistoryRouterGateway.test.d.ts +1 -0
  186. package/features/router/HistoryRouterGateway.test.js +195 -0
  187. package/features/router/HistoryRouterGateway.test.js.map +1 -0
  188. package/features/router/Route.d.ts +19 -0
  189. package/features/router/Route.js +43 -0
  190. package/features/router/Route.js.map +1 -0
  191. package/features/router/RouteUrl.d.ts +85 -0
  192. package/features/router/RouteUrl.js +99 -0
  193. package/features/router/RouteUrl.js.map +1 -0
  194. package/features/router/Router.d.ts +45 -0
  195. package/features/router/Router.js +72 -0
  196. package/features/router/Router.js.map +1 -0
  197. package/features/router/RouterPresenter.d.ts +23 -0
  198. package/features/router/RouterPresenter.js +62 -0
  199. package/features/router/RouterPresenter.js.map +1 -0
  200. package/features/router/RouterRepository.d.ts +32 -0
  201. package/features/router/RouterRepository.js +123 -0
  202. package/features/router/RouterRepository.js.map +1 -0
  203. package/features/router/RouterRepository.test.d.ts +1 -0
  204. package/features/router/RouterRepository.test.js +138 -0
  205. package/features/router/RouterRepository.test.js.map +1 -0
  206. package/features/router/abstractions.d.ts +90 -0
  207. package/features/router/abstractions.js +7 -0
  208. package/features/router/abstractions.js.map +1 -0
  209. package/features/router/feature.d.ts +4 -0
  210. package/features/router/feature.js +19 -0
  211. package/features/router/feature.js.map +1 -0
  212. package/features/router/index.d.ts +2 -0
  213. package/features/router/index.js +1 -0
  214. package/helpers/InterfaceGenerator/date.d.ts +15 -0
  215. package/helpers/InterfaceGenerator/date.js +0 -0
  216. package/helpers/InterfaceGenerator/id.d.ts +23 -0
  217. package/helpers/InterfaceGenerator/id.js +0 -0
  218. package/helpers/InterfaceGenerator/identity.d.ts +10 -0
  219. package/helpers/InterfaceGenerator/identity.js +0 -0
  220. package/helpers/InterfaceGenerator/index.d.ts +5 -0
  221. package/helpers/InterfaceGenerator/index.js +0 -0
  222. package/helpers/InterfaceGenerator/numeric.d.ts +12 -0
  223. package/helpers/InterfaceGenerator/numeric.js +0 -0
  224. package/helpers/InterfaceGenerator/truthful.d.ts +7 -0
  225. package/helpers/InterfaceGenerator/truthful.js +0 -0
  226. package/hooks/useHandler.js +12 -16
  227. package/hooks/useHandler.js.map +1 -1
  228. package/hooks/useHandlers.js +18 -20
  229. package/hooks/useHandlers.js.map +1 -1
  230. package/hooks/useRegisterLegacyPlugin.d.ts +1 -1
  231. package/hooks/useRegisterLegacyPlugin.js +7 -6
  232. package/hooks/useRegisterLegacyPlugin.js.map +1 -1
  233. package/hooks/useUi.d.ts +1 -1
  234. package/hooks/useUi.js +3 -4
  235. package/hooks/useUi.js.map +1 -1
  236. package/i18n/i18n.js +8 -4
  237. package/i18n/i18n.js.map +1 -1
  238. package/i18n/index.d.ts +1 -1
  239. package/i18n/index.js +1 -3
  240. package/index.d.ts +20 -15
  241. package/index.js +19 -19
  242. package/package.json +34 -42
  243. package/plugins/components/Image.d.ts +6 -0
  244. package/plugins/components/Image.js +12 -0
  245. package/plugins/components/Image.js.map +1 -0
  246. package/plugins/image.d.ts +2 -2
  247. package/plugins/image.js +95 -134
  248. package/plugins/image.js.map +1 -1
  249. package/plugins/index.d.ts +3 -3
  250. package/plugins/index.js +35 -59
  251. package/plugins/index.js.map +1 -1
  252. package/presentation/envConfig/useEnvConfig.d.ts +6 -0
  253. package/presentation/envConfig/useEnvConfig.js +9 -0
  254. package/presentation/envConfig/useEnvConfig.js.map +1 -0
  255. package/presentation/localStorage/index.d.ts +3 -0
  256. package/presentation/localStorage/index.js +3 -0
  257. package/presentation/localStorage/useLocalStorage.d.ts +6 -0
  258. package/presentation/localStorage/useLocalStorage.js +15 -0
  259. package/presentation/localStorage/useLocalStorage.js.map +1 -0
  260. package/presentation/localStorage/useLocalStorageValue.d.ts +1 -0
  261. package/presentation/localStorage/useLocalStorageValue.js +22 -0
  262. package/presentation/localStorage/useLocalStorageValue.js.map +1 -0
  263. package/presentation/localStorage/useLocalStorageValues.d.ts +5 -0
  264. package/presentation/localStorage/useLocalStorageValues.js +32 -0
  265. package/presentation/localStorage/useLocalStorageValues.js.map +1 -0
  266. package/presentation/router/RouteElementRegistry.d.ts +14 -0
  267. package/presentation/router/RouteElementRegistry.js +29 -0
  268. package/presentation/router/RouteElementRegistry.js.map +1 -0
  269. package/presentation/router/abstractions.d.ts +13 -0
  270. package/presentation/router/abstractions.js +5 -0
  271. package/presentation/router/abstractions.js.map +1 -0
  272. package/presentation/router/components/Redirect.d.ts +14 -0
  273. package/presentation/router/components/Redirect.js +13 -0
  274. package/presentation/router/components/Redirect.js.map +1 -0
  275. package/presentation/router/components/RouteContent.d.ts +2 -0
  276. package/presentation/router/components/RouteContent.js +20 -0
  277. package/presentation/router/components/RouteContent.js.map +1 -0
  278. package/presentation/router/components/RouteLink.d.ts +50 -0
  279. package/presentation/router/components/RouteLink.js +17 -0
  280. package/presentation/router/components/RouteLink.js.map +1 -0
  281. package/presentation/router/components/RouteParamsSync.d.ts +22 -0
  282. package/presentation/router/components/RouteParamsSync.js +53 -0
  283. package/presentation/router/components/RouteParamsSync.js.map +1 -0
  284. package/presentation/router/components/SimpleLink.d.ts +44 -0
  285. package/presentation/router/components/SimpleLink.js +24 -0
  286. package/presentation/router/components/SimpleLink.js.map +1 -0
  287. package/presentation/router/hooks/useRoute.d.ts +7 -0
  288. package/presentation/router/hooks/useRoute.js +23 -0
  289. package/presentation/router/hooks/useRoute.js.map +1 -0
  290. package/presentation/router/hooks/useRouter.d.ts +12 -0
  291. package/presentation/router/hooks/useRouter.js +30 -0
  292. package/presentation/router/hooks/useRouter.js.map +1 -0
  293. package/presentation/router/index.d.ts +6 -0
  294. package/presentation/router/index.js +4 -0
  295. package/presentation/router/types.d.ts +5 -0
  296. package/presentation/router/types.js +0 -0
  297. package/renderApp.d.ts +1 -1
  298. package/renderApp.js +7 -6
  299. package/renderApp.js.map +1 -1
  300. package/router.d.ts +5 -0
  301. package/router.js +5 -0
  302. package/rslib-runtime.js +14 -0
  303. package/rslib-runtime.js.map +1 -0
  304. package/shared/di/DiContainerProvider.d.ts +8 -0
  305. package/shared/di/DiContainerProvider.js +13 -0
  306. package/shared/di/DiContainerProvider.js.map +1 -0
  307. package/shared/di/createFeature.d.ts +11 -0
  308. package/shared/di/createFeature.js +10 -0
  309. package/shared/di/createFeature.js.map +1 -0
  310. package/shared/di/useFeature.d.ts +2 -0
  311. package/shared/di/useFeature.js +12 -0
  312. package/shared/di/useFeature.js.map +1 -0
  313. package/static/svg/close_24px.33adaadc.svg +1 -0
  314. package/types.d.ts +6 -24
  315. package/types.js +0 -14
  316. package/utils/createGenericContext.js +17 -21
  317. package/utils/createGenericContext.js.map +1 -1
  318. package/utils/createHashing.js +13 -16
  319. package/utils/createHashing.js.map +1 -1
  320. package/utils/index.d.ts +2 -10
  321. package/utils/index.js +2 -12
  322. package/utils/legacyPluginToReactComponent.js +12 -11
  323. package/utils/legacyPluginToReactComponent.js.map +1 -1
  324. package/apollo-client/InMemoryCache.d.ts +0 -8
  325. package/apollo-client/InMemoryCache.js +0 -20
  326. package/apollo-client/InMemoryCache.js.map +0 -1
  327. package/apollo-client/IntrospectionFragmentMatcher.d.ts +0 -11
  328. package/apollo-client/IntrospectionFragmentMatcher.js +0 -45
  329. package/apollo-client/IntrospectionFragmentMatcher.js.map +0 -1
  330. package/components/Routes.d.ts +0 -2
  331. package/components/Routes.js +0 -36
  332. package/components/Routes.js.map +0 -1
  333. package/components/View.d.ts +0 -8
  334. package/components/View.js +0 -19
  335. package/components/View.js.map +0 -1
  336. package/components/index.js.map +0 -1
  337. package/core/DebounceRender.d.ts +0 -12
  338. package/core/DebounceRender.js +0 -31
  339. package/core/DebounceRender.js.map +0 -1
  340. package/core/Routes.d.ts +0 -6
  341. package/core/Routes.js +0 -34
  342. package/core/Routes.js.map +0 -1
  343. package/hooks/useAutocomplete/index.d.ts +0 -1
  344. package/hooks/useAutocomplete/index.js +0 -3
  345. package/hooks/useAutocomplete/index.js.map +0 -1
  346. package/hooks/useAutocomplete/useAutocomplete.d.ts +0 -11
  347. package/hooks/useAutocomplete/useAutocomplete.js +0 -23
  348. package/hooks/useAutocomplete/useAutocomplete.js.map +0 -1
  349. package/hooks/useDataList/functions/getData.d.ts +0 -2
  350. package/hooks/useDataList/functions/getData.js +0 -4
  351. package/hooks/useDataList/functions/getData.js.map +0 -1
  352. package/hooks/useDataList/functions/getError.d.ts +0 -2
  353. package/hooks/useDataList/functions/getError.js +0 -4
  354. package/hooks/useDataList/functions/getError.js.map +0 -1
  355. package/hooks/useDataList/functions/getMeta.d.ts +0 -2
  356. package/hooks/useDataList/functions/getMeta.js +0 -4
  357. package/hooks/useDataList/functions/getMeta.js.map +0 -1
  358. package/hooks/useDataList/functions/index.d.ts +0 -3
  359. package/hooks/useDataList/functions/index.js +0 -5
  360. package/hooks/useDataList/functions/index.js.map +0 -1
  361. package/hooks/useDataList/functions/searchDataByKey.d.ts +0 -2
  362. package/hooks/useDataList/functions/searchDataByKey.js +0 -18
  363. package/hooks/useDataList/functions/searchDataByKey.js.map +0 -1
  364. package/hooks/useDataList/index.d.ts +0 -1
  365. package/hooks/useDataList/index.js +0 -3
  366. package/hooks/useDataList/index.js.map +0 -1
  367. package/hooks/useDataList/useDataList.d.ts +0 -36
  368. package/hooks/useDataList/useDataList.js +0 -183
  369. package/hooks/useDataList/useDataList.js.map +0 -1
  370. package/hooks/useDataList/utils/index.d.ts +0 -2
  371. package/hooks/useDataList/utils/index.js +0 -4
  372. package/hooks/useDataList/utils/index.js.map +0 -1
  373. package/hooks/useDataList/utils/prepareLoadListParams.d.ts +0 -10
  374. package/hooks/useDataList/utils/prepareLoadListParams.js +0 -38
  375. package/hooks/useDataList/utils/prepareLoadListParams.js.map +0 -1
  376. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +0 -14
  377. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +0 -26
  378. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +0 -1
  379. package/hooks/useDataList/utils/types.d.ts +0 -40
  380. package/hooks/useDataList/utils/types.js +0 -3
  381. package/hooks/useDataList/utils/types.js.map +0 -1
  382. package/i18n/index.js.map +0 -1
  383. package/index.js.map +0 -1
  384. package/plugins/AddQuerySelectionPlugin.d.ts +0 -22
  385. package/plugins/AddQuerySelectionPlugin.js +0 -72
  386. package/plugins/AddQuerySelectionPlugin.js.map +0 -1
  387. package/plugins/ApolloCacheObjectIdPlugin.d.ts +0 -15
  388. package/plugins/ApolloCacheObjectIdPlugin.js +0 -16
  389. package/plugins/ApolloCacheObjectIdPlugin.js.map +0 -1
  390. package/plugins/ApolloDynamicLink.d.ts +0 -7
  391. package/plugins/ApolloDynamicLink.js +0 -31
  392. package/plugins/ApolloDynamicLink.js.map +0 -1
  393. package/plugins/ApolloLinkPlugin.d.ts +0 -13
  394. package/plugins/ApolloLinkPlugin.js +0 -22
  395. package/plugins/ApolloLinkPlugin.js.map +0 -1
  396. package/plugins/ConsoleLinkPlugin.d.ts +0 -8
  397. package/plugins/ConsoleLinkPlugin.js +0 -26
  398. package/plugins/ConsoleLinkPlugin.js.map +0 -1
  399. package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -10
  400. package/plugins/LocaleHeaderLinkPlugin.js +0 -32
  401. package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
  402. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +0 -66
  403. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +0 -1
  404. package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +0 -9
  405. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +0 -78
  406. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +0 -1
  407. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +0 -7
  408. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +0 -31
  409. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +0 -1
  410. package/plugins/NetworkErrorLinkPlugin.d.ts +0 -7
  411. package/plugins/NetworkErrorLinkPlugin.js +0 -30
  412. package/plugins/NetworkErrorLinkPlugin.js.map +0 -1
  413. package/plugins/OmitTypenameLinkPlugin.d.ts +0 -8
  414. package/plugins/OmitTypenameLinkPlugin.js +0 -21
  415. package/plugins/OmitTypenameLinkPlugin.js.map +0 -1
  416. package/plugins/RoutePlugin.d.ts +0 -12
  417. package/plugins/RoutePlugin.js +0 -16
  418. package/plugins/RoutePlugin.js.map +0 -1
  419. package/plugins/TenantHeaderLinkPlugin.d.ts +0 -10
  420. package/plugins/TenantHeaderLinkPlugin.js +0 -39
  421. package/plugins/TenantHeaderLinkPlugin.js.map +0 -1
  422. package/plugins/ViewPlugin.d.ts +0 -14
  423. package/plugins/ViewPlugin.js +0 -19
  424. package/plugins/ViewPlugin.js.map +0 -1
  425. package/react-butterfiles/Files.d.ts +0 -69
  426. package/react-butterfiles/Files.js +0 -227
  427. package/react-butterfiles/Files.js.map +0 -1
  428. package/react-butterfiles/index.d.ts +0 -2
  429. package/react-butterfiles/index.js +0 -4
  430. package/react-butterfiles/index.js.map +0 -1
  431. package/react-butterfiles/utils/generateId.d.ts +0 -1
  432. package/react-butterfiles/utils/generateId.js +0 -5
  433. package/react-butterfiles/utils/generateId.js.map +0 -1
  434. package/react-butterfiles/utils/readFileContent.d.ts +0 -1
  435. package/react-butterfiles/utils/readFileContent.js +0 -15
  436. package/react-butterfiles/utils/readFileContent.js.map +0 -1
  437. package/types.js.map +0 -1
  438. package/utils/getApiUrl.d.ts +0 -1
  439. package/utils/getApiUrl.js +0 -5
  440. package/utils/getApiUrl.js.map +0 -1
  441. package/utils/getGqlApiUrl.d.ts +0 -1
  442. package/utils/getGqlApiUrl.js +0 -6
  443. package/utils/getGqlApiUrl.js.map +0 -1
  444. package/utils/getHeadlessCmsGqlApiUrl.d.ts +0 -5
  445. package/utils/getHeadlessCmsGqlApiUrl.js +0 -12
  446. package/utils/getHeadlessCmsGqlApiUrl.js.map +0 -1
  447. package/utils/getLocaleCode.d.ts +0 -6
  448. package/utils/getLocaleCode.js +0 -33
  449. package/utils/getLocaleCode.js.map +0 -1
  450. package/utils/getPrerenderId.d.ts +0 -6
  451. package/utils/getPrerenderId.js +0 -5
  452. package/utils/getPrerenderId.js.map +0 -1
  453. package/utils/getTenantId.d.ts +0 -6
  454. package/utils/getTenantId.js +0 -45
  455. package/utils/getTenantId.js.map +0 -1
  456. package/utils/index.js.map +0 -1
  457. package/utils/isLocalhost.d.ts +0 -1
  458. package/utils/isLocalhost.js +0 -7
  459. package/utils/isLocalhost.js.map +0 -1
  460. package/utils/isPrerendering.d.ts +0 -1
  461. package/utils/isPrerendering.js +0 -5
  462. package/utils/isPrerendering.js.map +0 -1
  463. /package/{plugins/NetworkErrorLinkPlugin → errors/overlay}/assets/close_24px.svg +0 -0
package/config.js CHANGED
@@ -1,25 +1,24 @@
1
- const deepFreeze = obj => {
2
- Object.keys(obj).forEach(prop => {
3
- if (typeof obj[prop] === "object" && !Object.isFrozen(obj[prop])) {
4
- deepFreeze(obj[prop]);
5
- }
6
- });
7
- return Object.freeze(obj);
1
+ const deepFreeze = (obj)=>{
2
+ Object.keys(obj).forEach((prop)=>{
3
+ if ("object" == typeof obj[prop] && !Object.isFrozen(obj[prop])) deepFreeze(obj[prop]);
4
+ });
5
+ return Object.freeze(obj);
8
6
  };
9
7
  function createConfig() {
10
- let _config = {};
11
- return {
12
- set(config) {
13
- _config = deepFreeze(config);
14
- },
15
- get() {
16
- return _config;
17
- },
18
- getKey(key, defaultValue) {
19
- return key in _config ? _config[key] : defaultValue;
20
- }
21
- };
8
+ let _config = {};
9
+ return {
10
+ set (config) {
11
+ _config = deepFreeze(config);
12
+ },
13
+ get () {
14
+ return _config;
15
+ },
16
+ getKey (key, defaultValue) {
17
+ return key in _config ? _config[key] : defaultValue;
18
+ }
19
+ };
22
20
  }
23
- export const config = createConfig();
21
+ const config_config = createConfig();
22
+ export { config_config as config };
24
23
 
25
24
  //# sourceMappingURL=config.js.map
package/config.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["deepFreeze","obj","Object","keys","forEach","prop","isFrozen","freeze","createConfig","_config","set","config","get","getKey","key","defaultValue"],"sources":["config.ts"],"sourcesContent":["export type Config = Record<string, any>;\n\ninterface AppConfig {\n set(config: Config): void;\n get(): Config;\n getKey<T = string>(key: string, defaultValue: T): T;\n}\n\nconst deepFreeze = (obj: Record<string, any>): Record<string, any> => {\n Object.keys(obj).forEach(prop => {\n if (typeof obj[prop] === \"object\" && !Object.isFrozen(obj[prop])) {\n deepFreeze(obj[prop]);\n }\n });\n return Object.freeze(obj);\n};\n\nfunction createConfig(): AppConfig {\n let _config: Record<string, any> = {};\n\n return {\n set(config: Config) {\n _config = deepFreeze(config);\n },\n get() {\n return _config;\n },\n getKey(key, defaultValue) {\n return key in _config ? _config[key] : defaultValue;\n }\n };\n}\n\nexport const config = createConfig();\n"],"mappings":"AAQA,MAAMA,UAAU,GAAIC,GAAwB,IAA0B;EAClEC,MAAM,CAACC,IAAI,CAACF,GAAG,CAAC,CAACG,OAAO,CAACC,IAAI,IAAI;IAC7B,IAAI,OAAOJ,GAAG,CAACI,IAAI,CAAC,KAAK,QAAQ,IAAI,CAACH,MAAM,CAACI,QAAQ,CAACL,GAAG,CAACI,IAAI,CAAC,CAAC,EAAE;MAC9DL,UAAU,CAACC,GAAG,CAACI,IAAI,CAAC,CAAC;IACzB;EACJ,CAAC,CAAC;EACF,OAAOH,MAAM,CAACK,MAAM,CAACN,GAAG,CAAC;AAC7B,CAAC;AAED,SAASO,YAAYA,CAAA,EAAc;EAC/B,IAAIC,OAA4B,GAAG,CAAC,CAAC;EAErC,OAAO;IACHC,GAAGA,CAACC,MAAc,EAAE;MAChBF,OAAO,GAAGT,UAAU,CAACW,MAAM,CAAC;IAChC,CAAC;IACDC,GAAGA,CAAA,EAAG;MACF,OAAOH,OAAO;IAClB,CAAC;IACDI,MAAMA,CAACC,GAAG,EAAEC,YAAY,EAAE;MACtB,OAAOD,GAAG,IAAIL,OAAO,GAAGA,OAAO,CAACK,GAAG,CAAC,GAAGC,YAAY;IACvD;EACJ,CAAC;AACL;AAEA,OAAO,MAAMJ,MAAM,GAAGH,YAAY,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"config.js","sources":["../src/config.ts"],"sourcesContent":["export type Config = Record<string, any>;\n\ninterface AppConfig {\n set(config: Config): void;\n get(): Config;\n getKey<T = string>(key: string, defaultValue: T): T;\n}\n\nconst deepFreeze = (obj: Record<string, any>): Record<string, any> => {\n Object.keys(obj).forEach(prop => {\n if (typeof obj[prop] === \"object\" && !Object.isFrozen(obj[prop])) {\n deepFreeze(obj[prop]);\n }\n });\n return Object.freeze(obj);\n};\n\nfunction createConfig(): AppConfig {\n let _config: Record<string, any> = {};\n\n return {\n set(config: Config) {\n _config = deepFreeze(config);\n },\n get() {\n return _config;\n },\n getKey(key, defaultValue) {\n return key in _config ? _config[key] : defaultValue;\n }\n };\n}\n\nexport const config = createConfig();\n"],"names":["deepFreeze","obj","Object","prop","createConfig","_config","config","key","defaultValue"],"mappings":"AAQA,MAAMA,aAAa,CAACC;IAChBC,OAAO,IAAI,CAACD,KAAK,OAAO,CAACE,CAAAA;QACrB,IAAI,AAAqB,YAArB,OAAOF,GAAG,CAACE,KAAK,IAAiB,CAACD,OAAO,QAAQ,CAACD,GAAG,CAACE,KAAK,GAC3DH,WAAWC,GAAG,CAACE,KAAK;IAE5B;IACA,OAAOD,OAAO,MAAM,CAACD;AACzB;AAEA,SAASG;IACL,IAAIC,UAA+B,CAAC;IAEpC,OAAO;QACH,KAAIC,MAAc;YACdD,UAAUL,WAAWM;QACzB;QACA;YACI,OAAOD;QACX;QACA,QAAOE,GAAG,EAAEC,YAAY;YACpB,OAAOD,OAAOF,UAAUA,OAAO,CAACE,IAAI,GAAGC;QAC3C;IACJ;AACJ;AAEO,MAAMF,gBAASF"}
@@ -1,32 +1,30 @@
1
- import React from "react";
1
+ import react from "react";
2
2
  import { plugins } from "@webiny/plugins";
3
- export const UiContext = /*#__PURE__*/React.createContext({});
4
- export class UiProvider extends React.Component {
5
- state = {
6
- ui: {}
7
- };
8
- setData = setter => {
9
- return this.setState(state => {
10
- return {
11
- ui: {
12
- ...state.ui,
13
- ...setter(state.ui)
14
- }
15
- };
16
- });
17
- };
18
- render() {
19
- const value = {
20
- ...this.state.ui,
21
- setState: this.setData
22
- };
23
- const uiStatePlugins = plugins.byType("ui-state");
24
- return /*#__PURE__*/React.createElement(UiContext.Provider, {
25
- value: value
26
- }, uiStatePlugins.map(pl => /*#__PURE__*/React.cloneElement(pl.render(), {
27
- key: pl.name
28
- })), this.props.children);
29
- }
3
+ const UiContext = /*#__PURE__*/ react.createContext({});
4
+ class UiProvider extends react.Component {
5
+ render() {
6
+ const value = {
7
+ ...this.state.ui,
8
+ setState: this.setData
9
+ };
10
+ const uiStatePlugins = plugins.byType("ui-state");
11
+ return /*#__PURE__*/ react.createElement(UiContext.Provider, {
12
+ value: value
13
+ }, uiStatePlugins.map((pl)=>/*#__PURE__*/ react.cloneElement(pl.render(), {
14
+ key: pl.name
15
+ })), this.props.children);
16
+ }
17
+ constructor(...args){
18
+ super(...args), this.state = {
19
+ ui: {}
20
+ }, this.setData = (setter)=>this.setState((state)=>({
21
+ ui: {
22
+ ...state.ui,
23
+ ...setter(state.ui)
24
+ }
25
+ }));
26
+ }
30
27
  }
28
+ export { UiContext, UiProvider };
31
29
 
32
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","plugins","UiContext","createContext","UiProvider","Component","state","ui","setData","setter","setState","render","value","uiStatePlugins","byType","createElement","Provider","map","pl","cloneElement","key","name","props","children"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { UiStatePlugin } from \"~/types\";\nimport { plugins } from \"@webiny/plugins\";\n\nexport const UiContext = React.createContext<Record<string, any>>({});\n\ntype Props = Record<string, any>;\n\ntype State = {\n ui: { [key: string]: any };\n};\n\ninterface UiData {\n [key: string]: any;\n}\n\ninterface UiDataSetter {\n (ui: UiData): UiData;\n}\n\nexport interface UiContextValue {\n setState: (setter: UiDataSetter) => void;\n [key: string]: any;\n}\n\nexport class UiProvider extends React.Component<Props, State> {\n public override state: State = {\n ui: {}\n };\n\n private readonly setData = (setter: UiDataSetter): void => {\n return this.setState((state: State) => {\n return { ui: { ...state.ui, ...setter(state.ui) } };\n });\n };\n\n public override render() {\n const value: UiContextValue = { ...this.state.ui, setState: this.setData };\n const uiStatePlugins = plugins.byType<UiStatePlugin>(\"ui-state\");\n return (\n <UiContext.Provider value={value}>\n {uiStatePlugins.map(pl => React.cloneElement(pl.render(), { key: pl.name }))}\n {this.props.children}\n </UiContext.Provider>\n );\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,OAAO,QAAQ,iBAAiB;AAEzC,OAAO,MAAMC,SAAS,gBAAGF,KAAK,CAACG,aAAa,CAAsB,CAAC,CAAC,CAAC;AAqBrE,OAAO,MAAMC,UAAU,SAASJ,KAAK,CAACK,SAAS,CAAe;EAC1CC,KAAK,GAAU;IAC3BC,EAAE,EAAE,CAAC;EACT,CAAC;EAEgBC,OAAO,GAAIC,MAAoB,IAAW;IACvD,OAAO,IAAI,CAACC,QAAQ,CAAEJ,KAAY,IAAK;MACnC,OAAO;QAAEC,EAAE,EAAE;UAAE,GAAGD,KAAK,CAACC,EAAE;UAAE,GAAGE,MAAM,CAACH,KAAK,CAACC,EAAE;QAAE;MAAE,CAAC;IACvD,CAAC,CAAC;EACN,CAAC;EAEeI,MAAMA,CAAA,EAAG;IACrB,MAAMC,KAAqB,GAAG;MAAE,GAAG,IAAI,CAACN,KAAK,CAACC,EAAE;MAAEG,QAAQ,EAAE,IAAI,CAACF;IAAQ,CAAC;IAC1E,MAAMK,cAAc,GAAGZ,OAAO,CAACa,MAAM,CAAgB,UAAU,CAAC;IAChE,oBACId,KAAA,CAAAe,aAAA,CAACb,SAAS,CAACc,QAAQ;MAACJ,KAAK,EAAEA;IAAM,GAC5BC,cAAc,CAACI,GAAG,CAACC,EAAE,iBAAIlB,KAAK,CAACmB,YAAY,CAACD,EAAE,CAACP,MAAM,CAAC,CAAC,EAAE;MAAES,GAAG,EAAEF,EAAE,CAACG;IAAK,CAAC,CAAC,CAAC,EAC3E,IAAI,CAACC,KAAK,CAACC,QACI,CAAC;EAE7B;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"contexts/Ui/index.js","sources":["../../../src/contexts/Ui/index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { UiStatePlugin } from \"~/types.js\";\nimport { plugins } from \"@webiny/plugins\";\n\nexport const UiContext = React.createContext<Record<string, any>>({});\n\ntype Props = Record<string, any>;\n\ntype State = {\n ui: { [key: string]: any };\n};\n\ninterface UiData {\n [key: string]: any;\n}\n\ninterface UiDataSetter {\n (ui: UiData): UiData;\n}\n\nexport interface UiContextValue {\n setState: (setter: UiDataSetter) => void;\n [key: string]: any;\n}\n\nexport class UiProvider extends React.Component<Props, State> {\n public override state: State = {\n ui: {}\n };\n\n private readonly setData = (setter: UiDataSetter): void => {\n return this.setState((state: State) => {\n return { ui: { ...state.ui, ...setter(state.ui) } };\n });\n };\n\n public override render() {\n const value: UiContextValue = { ...this.state.ui, setState: this.setData };\n const uiStatePlugins = plugins.byType<UiStatePlugin>(\"ui-state\");\n return (\n <UiContext.Provider value={value}>\n {uiStatePlugins.map(pl => React.cloneElement(pl.render(), { key: pl.name }))}\n {this.props.children}\n </UiContext.Provider>\n );\n }\n}\n"],"names":["UiContext","React","UiProvider","value","uiStatePlugins","plugins","pl","setter","state"],"mappings":";;AAIO,MAAMA,YAAY,WAAHA,GAAGC,MAAAA,aAAmB,CAAsB,CAAC;AAqB5D,MAAMC,mBAAmBD,MAAAA,SAAe;IAW3B,SAAS;QACrB,MAAME,QAAwB;YAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE;YAAE,UAAU,IAAI,CAAC,OAAO;QAAC;QACzE,MAAMC,iBAAiBC,QAAQ,MAAM,CAAgB;QACrD,OAAO,WAAP,GACI,oBAACL,UAAU,QAAQ;YAAC,OAAOG;WACtBC,eAAe,GAAG,CAACE,CAAAA,KAAAA,WAAAA,GAAML,MAAAA,YAAkB,CAACK,GAAG,MAAM,IAAI;gBAAE,KAAKA,GAAG,IAAI;YAAC,KACxE,IAAI,CAAC,KAAK,CAAC,QAAQ;IAGhC;;QApBG,qBACa,KAAK,GAAU;YAC3B,IAAI,CAAC;QACT,QAEiB,OAAO,GAAG,CAACC,SACjB,IAAI,CAAC,QAAQ,CAAC,CAACC,QACX;oBAAE,IAAI;wBAAE,GAAGA,MAAM,EAAE;wBAAE,GAAGD,OAAOC,MAAM,EAAE,CAAC;oBAAC;gBAAE;;AAc9D"}
package/core/Plugin.d.ts CHANGED
@@ -4,5 +4,5 @@ interface PluginProps {
4
4
  providers?: Decorator<GenericComponent>[];
5
5
  children?: React.ReactNode;
6
6
  }
7
- export declare const Plugin: React.NamedExoticComponent<PluginProps>;
7
+ export declare const Plugin: React.MemoExoticComponent<({ providers, children }: PluginProps) => React.JSX.Element>;
8
8
  export {};
package/core/Plugin.js CHANGED
@@ -1,14 +1,12 @@
1
- import React from "react";
2
- import { Provider } from "./Provider";
3
- import { Plugins } from "./Plugins";
4
- export const Plugin = /*#__PURE__*/React.memo(function Plugin({
5
- providers,
6
- children
7
- }) {
8
- return /*#__PURE__*/React.createElement(React.Fragment, null, (providers || []).map((provider, index) => /*#__PURE__*/React.createElement(Provider, {
9
- key: index,
10
- hoc: provider
11
- })), children ? /*#__PURE__*/React.createElement(Plugins, null, children) : null);
1
+ import react from "react";
2
+ import { Provider } from "./Provider.js";
3
+ import { Plugins } from "./Plugins.js";
4
+ const Plugin_Plugin = /*#__PURE__*/ react.memo(function({ providers, children }) {
5
+ return /*#__PURE__*/ react.createElement(react.Fragment, null, (providers || []).map((provider, index)=>/*#__PURE__*/ react.createElement(Provider, {
6
+ key: index,
7
+ hoc: provider
8
+ })), children ? /*#__PURE__*/ react.createElement(Plugins, null, children) : null);
12
9
  });
10
+ export { Plugin_Plugin as Plugin };
13
11
 
14
12
  //# sourceMappingURL=Plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Provider","Plugins","Plugin","memo","providers","children","createElement","Fragment","map","provider","index","key","hoc"],"sources":["Plugin.tsx"],"sourcesContent":["import React from \"react\";\nimport { Provider } from \"./Provider\";\nimport { Plugins } from \"./Plugins\";\nimport type { GenericComponent, Decorator } from \"@webiny/react-composition\";\n\ninterface PluginProps {\n providers?: Decorator<GenericComponent>[];\n children?: React.ReactNode;\n}\n\nexport const Plugin = React.memo(function Plugin({ providers, children }: PluginProps) {\n return (\n <>\n {(providers || []).map((provider, index) => (\n <Provider key={index} hoc={provider} />\n ))}\n {children ? <Plugins>{children}</Plugins> : null}\n </>\n );\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ;AACjB,SAASC,OAAO;AAQhB,OAAO,MAAMC,MAAM,gBAAGH,KAAK,CAACI,IAAI,CAAC,SAASD,MAAMA,CAAC;EAAEE,SAAS;EAAEC;AAAsB,CAAC,EAAE;EACnF,oBACIN,KAAA,CAAAO,aAAA,CAAAP,KAAA,CAAAQ,QAAA,QACK,CAACH,SAAS,IAAI,EAAE,EAAEI,GAAG,CAAC,CAACC,QAAQ,EAAEC,KAAK,kBACnCX,KAAA,CAAAO,aAAA,CAACN,QAAQ;IAACW,GAAG,EAAED,KAAM;IAACE,GAAG,EAAEH;EAAS,CAAE,CACzC,CAAC,EACDJ,QAAQ,gBAAGN,KAAA,CAAAO,aAAA,CAACL,OAAO,QAAEI,QAAkB,CAAC,GAAG,IAC9C,CAAC;AAEX,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"core/Plugin.js","sources":["../../src/core/Plugin.tsx"],"sourcesContent":["import React from \"react\";\nimport { Provider } from \"./Provider.js\";\nimport { Plugins } from \"./Plugins.js\";\nimport type { GenericComponent, Decorator } from \"@webiny/react-composition\";\n\ninterface PluginProps {\n providers?: Decorator<GenericComponent>[];\n children?: React.ReactNode;\n}\n\nexport const Plugin = React.memo(function Plugin({ providers, children }: PluginProps) {\n return (\n <>\n {(providers || []).map((provider, index) => (\n <Provider key={index} hoc={provider} />\n ))}\n {children ? <Plugins>{children}</Plugins> : null}\n </>\n );\n});\n"],"names":["Plugin","React","providers","children","provider","index","Provider","Plugins"],"mappings":";;;AAUO,MAAMA,gBAAS,WAAHA,GAAGC,MAAAA,IAAU,CAAC,SAAgB,EAAEC,SAAS,EAAEC,QAAQ,EAAe;IACjF,OAAO,WAAP,GACI,0CACMD,AAAAA,CAAAA,aAAa,EAAC,EAAG,GAAG,CAAC,CAACE,UAAUC,QAAAA,WAAAA,GAC9B,oBAACC,UAAQA;YAAC,KAAKD;YAAO,KAAKD;aAE9BD,WAAW,WAAXA,GAAW,oBAACI,SAAOA,MAAEJ,YAAsB;AAGxD"}
package/core/Plugins.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
2
  export declare const PluginsContext: React.Context<boolean>;
3
3
  interface PluginsProviderComponentProps {
4
- children: JSX.Element[];
4
+ children: React.JSX.Element[];
5
5
  }
6
- export declare const PluginsProvider: React.MemoExoticComponent<({ children }: PluginsProviderComponentProps) => React.JSX.Element>;
6
+ declare const PluginsProviderComponent: ({ children }: PluginsProviderComponentProps) => React.JSX.Element;
7
+ export declare const PluginsProvider: React.MemoExoticComponent<typeof PluginsProviderComponent>;
7
8
  /**
8
9
  * @param children
9
10
  * @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.
@@ -11,5 +12,5 @@ export declare const PluginsProvider: React.MemoExoticComponent<({ children }: P
11
12
  interface PluginsComponentsProps {
12
13
  children: React.ReactNode;
13
14
  }
14
- export declare const Plugins: ({ children }: PluginsComponentsProps) => React.JSX.Element | null;
15
+ export declare const Plugins: React.MemoExoticComponent<({ children }: PluginsComponentsProps) => React.JSX.Element | null>;
15
16
  export {};
package/core/Plugins.js CHANGED
@@ -1,39 +1,21 @@
1
- import React, { Fragment, Children, createContext, useContext, useEffect, memo } from "react";
2
- import { useApp } from "../App";
3
- export const PluginsContext = /*#__PURE__*/createContext(false);
1
+ import react, { Children, Fragment, createContext, memo, useContext, useEffect } from "react";
2
+ import { useApp } from "../App.js";
3
+ const PluginsContext = /*#__PURE__*/ createContext(false);
4
4
  PluginsContext.displayName = "PluginsContext";
5
- const PluginsProviderComponent = ({
6
- children
7
- }) => {
8
- /**
9
- * This context only serves as a safeguard. We need to warn users when they mount a plugin without using
10
- * the <Plugins> component. In that case, the context will not be available, and we can log warnings.
11
- */
12
- return /*#__PURE__*/React.createElement(PluginsContext.Provider, {
13
- value: true
14
- }, children);
15
- };
16
- export const PluginsProvider = /*#__PURE__*/memo(PluginsProviderComponent);
17
-
18
- /**
19
- * @param children
20
- * @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.
21
- */
22
-
23
- export const Plugins = ({
24
- children
25
- }) => {
26
- const {
27
- addPlugin
28
- } = useApp();
29
- const hasParentPlugin = useContext(PluginsContext);
30
- useEffect(() => {
31
- if (hasParentPlugin) {
32
- return;
33
- }
34
- Children.forEach(children, child => addPlugin(child));
35
- }, []);
36
- return hasParentPlugin ? /*#__PURE__*/React.createElement(Fragment, null, children) : null;
37
- };
5
+ const PluginsProviderComponent = ({ children })=>/*#__PURE__*/ react.createElement(PluginsContext.Provider, {
6
+ value: true
7
+ }, children);
8
+ const PluginsProvider = /*#__PURE__*/ memo(PluginsProviderComponent);
9
+ const Plugins = /*#__PURE__*/ react.memo(({ children })=>{
10
+ const { addPlugin } = useApp();
11
+ const hasParentPlugin = useContext(PluginsContext);
12
+ useEffect(()=>{
13
+ if (hasParentPlugin) return;
14
+ Children.forEach(children, (child)=>addPlugin(child));
15
+ }, []);
16
+ return hasParentPlugin ? /*#__PURE__*/ react.createElement(Fragment, null, children) : null;
17
+ });
18
+ Plugins.displayName = "Plugins";
19
+ export { Plugins, PluginsContext, PluginsProvider };
38
20
 
39
21
  //# sourceMappingURL=Plugins.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Fragment","Children","createContext","useContext","useEffect","memo","useApp","PluginsContext","displayName","PluginsProviderComponent","children","createElement","Provider","value","PluginsProvider","Plugins","addPlugin","hasParentPlugin","forEach","child"],"sources":["Plugins.tsx"],"sourcesContent":["import React, { Fragment, Children, createContext, useContext, useEffect, memo } from \"react\";\nimport { useApp } from \"~/App\";\n\nexport const PluginsContext = createContext<boolean>(false);\nPluginsContext.displayName = \"PluginsContext\";\n\ninterface PluginsProviderComponentProps {\n children: JSX.Element[];\n}\nconst PluginsProviderComponent = ({ children }: PluginsProviderComponentProps) => {\n /**\n * This context only serves as a safeguard. We need to warn users when they mount a plugin without using\n * the <Plugins> component. In that case, the context will not be available, and we can log warnings.\n */\n return <PluginsContext.Provider value={true}>{children}</PluginsContext.Provider>;\n};\n\nexport const PluginsProvider = memo(PluginsProviderComponent);\n\n/**\n * @param children\n * @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.\n */\ninterface PluginsComponentsProps {\n children: React.ReactNode;\n}\nexport const Plugins = ({ children }: PluginsComponentsProps) => {\n const { addPlugin } = useApp();\n const hasParentPlugin = useContext(PluginsContext);\n\n useEffect(() => {\n if (hasParentPlugin) {\n return;\n }\n\n Children.forEach(children, child => addPlugin(child));\n }, []);\n\n return hasParentPlugin ? <Fragment>{children}</Fragment> : null;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,UAAU,EAAEC,SAAS,EAAEC,IAAI,QAAQ,OAAO;AAC7F,SAASC,MAAM;AAEf,OAAO,MAAMC,cAAc,gBAAGL,aAAa,CAAU,KAAK,CAAC;AAC3DK,cAAc,CAACC,WAAW,GAAG,gBAAgB;AAK7C,MAAMC,wBAAwB,GAAGA,CAAC;EAAEC;AAAwC,CAAC,KAAK;EAC9E;AACJ;AACA;AACA;EACI,oBAAOX,KAAA,CAAAY,aAAA,CAACJ,cAAc,CAACK,QAAQ;IAACC,KAAK,EAAE;EAAK,GAAEH,QAAkC,CAAC;AACrF,CAAC;AAED,OAAO,MAAMI,eAAe,gBAAGT,IAAI,CAACI,wBAAwB,CAAC;;AAE7D;AACA;AACA;AACA;;AAIA,OAAO,MAAMM,OAAO,GAAGA,CAAC;EAAEL;AAAiC,CAAC,KAAK;EAC7D,MAAM;IAAEM;EAAU,CAAC,GAAGV,MAAM,CAAC,CAAC;EAC9B,MAAMW,eAAe,GAAGd,UAAU,CAACI,cAAc,CAAC;EAElDH,SAAS,CAAC,MAAM;IACZ,IAAIa,eAAe,EAAE;MACjB;IACJ;IAEAhB,QAAQ,CAACiB,OAAO,CAACR,QAAQ,EAAES,KAAK,IAAIH,SAAS,CAACG,KAAK,CAAC,CAAC;EACzD,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOF,eAAe,gBAAGlB,KAAA,CAAAY,aAAA,CAACX,QAAQ,QAAEU,QAAmB,CAAC,GAAG,IAAI;AACnE,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"core/Plugins.js","sources":["../../src/core/Plugins.tsx"],"sourcesContent":["import React, { Children, createContext, Fragment, memo, useContext, useEffect } from \"react\";\nimport { useApp } from \"~/App.js\";\n\nexport const PluginsContext = createContext<boolean>(false);\nPluginsContext.displayName = \"PluginsContext\";\n\ninterface PluginsProviderComponentProps {\n children: React.JSX.Element[];\n}\nconst PluginsProviderComponent = ({ children }: PluginsProviderComponentProps) => {\n /**\n * This context only serves as a safeguard. We need to warn users when they mount a plugin without using\n * the <Plugins> component. In that case, the context will not be available, and we can log warnings.\n */\n return <PluginsContext.Provider value={true}>{children}</PluginsContext.Provider>;\n};\n\nexport const PluginsProvider = memo(PluginsProviderComponent);\n\n/**\n * @param children\n * @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.\n */\ninterface PluginsComponentsProps {\n children: React.ReactNode;\n}\nexport const Plugins = React.memo(({ children }: PluginsComponentsProps) => {\n const { addPlugin } = useApp();\n const hasParentPlugin = useContext(PluginsContext);\n\n useEffect(() => {\n if (hasParentPlugin) {\n return;\n }\n\n Children.forEach(children, child => addPlugin(child));\n }, []);\n\n return hasParentPlugin ? <Fragment>{children}</Fragment> : null;\n});\n\nPlugins.displayName = \"Plugins\";\n"],"names":["PluginsContext","createContext","PluginsProviderComponent","children","PluginsProvider","memo","Plugins","React","addPlugin","useApp","hasParentPlugin","useContext","useEffect","Children","child","Fragment"],"mappings":";;AAGO,MAAMA,iBAAiB,WAAHA,GAAGC,cAAuB;AACrDD,eAAe,WAAW,GAAG;AAK7B,MAAME,2BAA2B,CAAC,EAAEC,QAAQ,EAAiC,GAKlE,WAAP,GAAO,oBAACH,eAAe,QAAQ;QAAC,OAAO;OAAOG;AAG3C,MAAMC,kBAAkB,WAAHA,GAAGC,KAAKH;AAS7B,MAAMI,UAAU,WAAHA,GAAGC,MAAAA,IAAU,CAAC,CAAC,EAAEJ,QAAQ,EAA0B;IACnE,MAAM,EAAEK,SAAS,EAAE,GAAGC;IACtB,MAAMC,kBAAkBC,WAAWX;IAEnCY,UAAU;QACN,IAAIF,iBACA;QAGJG,SAAS,OAAO,CAACV,UAAUW,CAAAA,QAASN,UAAUM;IAClD,GAAG,EAAE;IAEL,OAAOJ,kBAAkB,WAAlBA,GAAkB,oBAACK,UAAQA,MAAEZ,YAAuB;AAC/D;AAEAG,QAAQ,WAAW,GAAG"}
@@ -1,4 +1,4 @@
1
- import type { GenericComponent, Decorator } from "../index";
1
+ import type { GenericComponent, Decorator } from "../index.js";
2
2
  export interface ProviderProps {
3
3
  hoc: Decorator<GenericComponent>;
4
4
  }
package/core/Provider.js CHANGED
@@ -1,18 +1,10 @@
1
1
  import { useEffect } from "react";
2
- import { useApp } from "./..";
3
- /**
4
- * Register a new React context provider.
5
- */
6
- export const Provider = ({
7
- hoc
8
- }) => {
9
- const {
10
- addProvider
11
- } = useApp();
12
- useEffect(() => {
13
- return addProvider(hoc);
14
- }, []);
15
- return null;
2
+ import { useApp } from "../index.js";
3
+ const Provider = ({ hoc })=>{
4
+ const { addProvider } = useApp();
5
+ useEffect(()=>addProvider(hoc), []);
6
+ return null;
16
7
  };
8
+ export { Provider };
17
9
 
18
10
  //# sourceMappingURL=Provider.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useApp","Provider","hoc","addProvider"],"sources":["Provider.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport type { GenericComponent, Decorator } from \"~/index\";\nimport { useApp } from \"~/index\";\n\nexport interface ProviderProps {\n hoc: Decorator<GenericComponent>;\n}\n\n/**\n * Register a new React context provider.\n */\nexport const Provider = ({ hoc }: ProviderProps) => {\n const { addProvider } = useApp();\n\n useEffect(() => {\n return addProvider(hoc);\n }, []);\n\n return null;\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AAEjC,SAASC,MAAM;AAMf;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAGA,CAAC;EAAEC;AAAmB,CAAC,KAAK;EAChD,MAAM;IAAEC;EAAY,CAAC,GAAGH,MAAM,CAAC,CAAC;EAEhCD,SAAS,CAAC,MAAM;IACZ,OAAOI,WAAW,CAACD,GAAG,CAAC;EAC3B,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO,IAAI;AACf,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"core/Provider.js","sources":["../../src/core/Provider.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport type { GenericComponent, Decorator } from \"~/index.js\";\nimport { useApp } from \"~/index.js\";\n\nexport interface ProviderProps {\n hoc: Decorator<GenericComponent>;\n}\n\n/**\n * Register a new React context provider.\n */\nexport const Provider = ({ hoc }: ProviderProps) => {\n const { addProvider } = useApp();\n\n useEffect(() => {\n return addProvider(hoc);\n }, []);\n\n return null;\n};\n"],"names":["Provider","hoc","addProvider","useApp","useEffect"],"mappings":";;AAWO,MAAMA,WAAW,CAAC,EAAEC,GAAG,EAAiB;IAC3C,MAAM,EAAEC,WAAW,EAAE,GAAGC;IAExBC,UAAU,IACCF,YAAYD,MACpB,EAAE;IAEL,OAAO;AACX"}
@@ -1,9 +1,6 @@
1
- /**
2
- * Creates a Higher Order Component which wraps the entire app content.
3
- * This is mostly useful for adding React Context providers.
4
- */
5
- export function createProvider(decorator) {
6
- return decorator;
1
+ function createProvider(decorator) {
2
+ return decorator;
7
3
  }
4
+ export { createProvider };
8
5
 
9
6
  //# sourceMappingURL=createProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createProvider","decorator"],"sources":["createProvider.tsx"],"sourcesContent":["import type React from \"react\";\nimport type { Decorator, GenericComponent } from \"@webiny/react-composition\";\n\nexport interface ChildrenProps {\n children: React.ReactNode;\n}\n\n/**\n * Creates a Higher Order Component which wraps the entire app content.\n * This is mostly useful for adding React Context providers.\n */\nexport function createProvider(\n decorator: Decorator<GenericComponent<ChildrenProps>>\n): Decorator<GenericComponent<ChildrenProps>> {\n return decorator;\n}\n"],"mappings":"AAOA;AACA;AACA;AACA;AACA,OAAO,SAASA,cAAcA,CAC1BC,SAAqD,EACX;EAC1C,OAAOA,SAAS;AACpB","ignoreList":[]}
1
+ {"version":3,"file":"core/createProvider.js","sources":["../../src/core/createProvider.tsx"],"sourcesContent":["import type React from \"react\";\nimport type { Decorator, GenericComponent } from \"@webiny/react-composition\";\n\nexport interface ChildrenProps {\n children: React.ReactNode;\n}\n\n/**\n * Creates a Higher Order Component which wraps the entire app content.\n * This is mostly useful for adding React Context providers.\n */\nexport function createProvider(\n decorator: Decorator<GenericComponent<ChildrenProps>>\n): Decorator<GenericComponent<ChildrenProps>> {\n return decorator;\n}\n"],"names":["createProvider","decorator"],"mappings":"AAWO,SAASA,eACZC,SAAqD;IAErD,OAAOA;AACX"}
@@ -1,17 +1,12 @@
1
- import React from "react";
2
- import { Provider } from "./Provider";
3
-
4
- /**
5
- * Creates a component, which, when mounted, will register an app provider.
6
- * This is particularly useful for wrapping the entire app with custom React Context providers.
7
- * For more information, visit https://www.webiny.com/docs/admin-area/basics/framework.
8
- */
9
- export function createProviderPlugin(decorator) {
10
- return function ProviderPlugin() {
11
- return /*#__PURE__*/React.createElement(Provider, {
12
- hoc: decorator
13
- });
14
- };
1
+ import react from "react";
2
+ import { Provider } from "./Provider.js";
3
+ function createProviderPlugin(decorator) {
4
+ return function() {
5
+ return /*#__PURE__*/ react.createElement(Provider, {
6
+ hoc: decorator
7
+ });
8
+ };
15
9
  }
10
+ export { createProviderPlugin };
16
11
 
17
12
  //# sourceMappingURL=createProviderPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Provider","createProviderPlugin","decorator","ProviderPlugin","createElement","hoc"],"sources":["createProviderPlugin.tsx"],"sourcesContent":["import React from \"react\";\nimport type { GenericComponent, Decorator } from \"@webiny/react-composition\";\nimport { Provider } from \"./Provider\";\n\n/**\n * Creates a component, which, when mounted, will register an app provider.\n * This is particularly useful for wrapping the entire app with custom React Context providers.\n * For more information, visit https://www.webiny.com/docs/admin-area/basics/framework.\n */\nexport function createProviderPlugin(decorator: Decorator<GenericComponent>) {\n return function ProviderPlugin() {\n return <Provider hoc={decorator} />;\n };\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,QAAQ;;AAEjB;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAACC,SAAsC,EAAE;EACzE,OAAO,SAASC,cAAcA,CAAA,EAAG;IAC7B,oBAAOJ,KAAA,CAAAK,aAAA,CAACJ,QAAQ;MAACK,GAAG,EAAEH;IAAU,CAAE,CAAC;EACvC,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"core/createProviderPlugin.js","sources":["../../src/core/createProviderPlugin.tsx"],"sourcesContent":["import React from \"react\";\nimport type { GenericComponent, Decorator } from \"@webiny/react-composition\";\nimport { Provider } from \"./Provider.js\";\n\n/**\n * Creates a component, which, when mounted, will register an app provider.\n * This is particularly useful for wrapping the entire app with custom React Context providers.\n * For more information, visit https://www.webiny.com/docs/admin-area/basics/framework.\n */\nexport function createProviderPlugin(decorator: Decorator<GenericComponent>) {\n return function ProviderPlugin() {\n return <Provider hoc={decorator} />;\n };\n}\n"],"names":["createProviderPlugin","decorator","Provider"],"mappings":";;AASO,SAASA,qBAAqBC,SAAsC;IACvE,OAAO;QACH,OAAO,WAAP,GAAO,oBAACC,UAAQA;YAAC,KAAKD;;IAC1B;AACJ"}
@@ -0,0 +1,9 @@
1
+ import { BaseEvent } from "../features/eventPublisher/index.js";
2
+ export interface AuthenticationErrorPayload {
3
+ message: string;
4
+ code: string;
5
+ }
6
+ export declare class AuthenticationErrorEvent extends BaseEvent<AuthenticationErrorPayload> {
7
+ eventType: "Authentication/Error";
8
+ getHandlerAbstraction(): import("@webiny/di").Abstraction<import("~/features/eventPublisher/index.js").IEventHandler<AuthenticationErrorEvent>>;
9
+ }
@@ -0,0 +1,13 @@
1
+ import { AuthenticationErrorEventHandler } from "./abstractions.js";
2
+ import { BaseEvent } from "../features/eventPublisher/index.js";
3
+ class AuthenticationErrorEvent extends BaseEvent {
4
+ getHandlerAbstraction() {
5
+ return AuthenticationErrorEventHandler;
6
+ }
7
+ constructor(...args){
8
+ super(...args), this.eventType = "Authentication/Error";
9
+ }
10
+ }
11
+ export { AuthenticationErrorEvent };
12
+
13
+ //# sourceMappingURL=AuthenticationErrorEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors/AuthenticationErrorEvent.js","sources":["../../src/errors/AuthenticationErrorEvent.ts"],"sourcesContent":["import { AuthenticationErrorEventHandler } from \"./abstractions.js\";\nimport { BaseEvent } from \"~/features/eventPublisher/index.js\";\n\nexport interface AuthenticationErrorPayload {\n message: string;\n code: string;\n}\n\nexport class AuthenticationErrorEvent extends BaseEvent<AuthenticationErrorPayload> {\n eventType = \"Authentication/Error\" as const;\n\n getHandlerAbstraction() {\n return AuthenticationErrorEventHandler;\n }\n}\n"],"names":["AuthenticationErrorEvent","BaseEvent","AuthenticationErrorEventHandler"],"mappings":";;AAQO,MAAMA,iCAAiCC;IAG1C,wBAAwB;QACpB,OAAOC;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB"}
@@ -0,0 +1,15 @@
1
+ import { BaseEvent } from "../features/eventPublisher/index.js";
2
+ export interface NetworkErrorPayload {
3
+ message: string;
4
+ code?: string;
5
+ operationName?: string;
6
+ query?: string;
7
+ variables?: Record<string, any>;
8
+ errorType: "network" | "timeout" | "fetch" | "unknown";
9
+ statusCode?: number;
10
+ result?: any;
11
+ }
12
+ export declare class NetworkErrorEvent extends BaseEvent<NetworkErrorPayload> {
13
+ eventType: "network.error";
14
+ getHandlerAbstraction(): import("@webiny/di").Abstraction<import("~/features/eventPublisher/index.js").IEventHandler<NetworkErrorEvent>>;
15
+ }
@@ -0,0 +1,13 @@
1
+ import { NetworkErrorEventHandler } from "./abstractions.js";
2
+ import { BaseEvent } from "../features/eventPublisher/index.js";
3
+ class NetworkErrorEvent extends BaseEvent {
4
+ getHandlerAbstraction() {
5
+ return NetworkErrorEventHandler;
6
+ }
7
+ constructor(...args){
8
+ super(...args), this.eventType = "network.error";
9
+ }
10
+ }
11
+ export { NetworkErrorEvent };
12
+
13
+ //# sourceMappingURL=NetworkErrorEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors/NetworkErrorEvent.js","sources":["../../src/errors/NetworkErrorEvent.ts"],"sourcesContent":["import { NetworkErrorEventHandler } from \"./abstractions.js\";\nimport { BaseEvent } from \"~/features/eventPublisher/index.js\";\n\nexport interface NetworkErrorPayload {\n message: string;\n code?: string;\n operationName?: string;\n query?: string;\n variables?: Record<string, any>;\n errorType: \"network\" | \"timeout\" | \"fetch\" | \"unknown\";\n statusCode?: number;\n result?: any;\n}\n\nexport class NetworkErrorEvent extends BaseEvent<NetworkErrorPayload> {\n eventType = \"network.error\" as const;\n\n getHandlerAbstraction() {\n return NetworkErrorEventHandler;\n }\n}\n"],"names":["NetworkErrorEvent","BaseEvent","NetworkErrorEventHandler"],"mappings":";;AAcO,MAAMA,0BAA0BC;IAGnC,wBAAwB;QACpB,OAAOC;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB"}
@@ -0,0 +1,12 @@
1
+ import type { NetworkErrorEvent } from "./NetworkErrorEvent.js";
2
+ import type { AuthenticationErrorEvent } from "./AuthenticationErrorEvent.js";
3
+ import type { IEventHandler } from "../features/eventPublisher/index.js";
4
+ export declare const NetworkErrorEventHandler: import("@webiny/di").Abstraction<IEventHandler<NetworkErrorEvent>>;
5
+ export declare namespace NetworkErrorEventHandler {
6
+ type Interface = IEventHandler<NetworkErrorEvent>;
7
+ }
8
+ export declare const AuthenticationErrorEventHandler: import("@webiny/di").Abstraction<IEventHandler<AuthenticationErrorEvent>>;
9
+ export declare namespace AuthenticationErrorEventHandler {
10
+ type Interface = IEventHandler<AuthenticationErrorEvent>;
11
+ type Event = AuthenticationErrorEvent;
12
+ }
@@ -0,0 +1,6 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const NetworkErrorEventHandler = createAbstraction("NetworkErrorEventHandler");
3
+ const AuthenticationErrorEventHandler = createAbstraction("AuthenticationErrorEventHandler");
4
+ export { AuthenticationErrorEventHandler, NetworkErrorEventHandler };
5
+
6
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors/abstractions.js","sources":["../../src/errors/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { NetworkErrorEvent } from \"./NetworkErrorEvent.js\";\nimport type { AuthenticationErrorEvent } from \"./AuthenticationErrorEvent.js\";\nimport type { IEventHandler } from \"~/features/eventPublisher/index.js\";\n\nexport const NetworkErrorEventHandler = createAbstraction<IEventHandler<NetworkErrorEvent>>(\n \"NetworkErrorEventHandler\"\n);\n\nexport namespace NetworkErrorEventHandler {\n export type Interface = IEventHandler<NetworkErrorEvent>;\n}\n\nexport const AuthenticationErrorEventHandler = createAbstraction<\n IEventHandler<AuthenticationErrorEvent>\n>(\"AuthenticationErrorEventHandler\");\n\nexport namespace AuthenticationErrorEventHandler {\n export type Interface = IEventHandler<AuthenticationErrorEvent>;\n export type Event = AuthenticationErrorEvent;\n}\n"],"names":["NetworkErrorEventHandler","createAbstraction","AuthenticationErrorEventHandler"],"mappings":";AAKO,MAAMA,2BAA2BC,kBACpC;AAOG,MAAMC,kCAAkCD,kBAE7C"}
@@ -0,0 +1,6 @@
1
+ export { NetworkErrorEvent } from "./NetworkErrorEvent.js";
2
+ export type { NetworkErrorPayload } from "./NetworkErrorEvent.js";
3
+ export { NetworkErrorEventHandler } from "./abstractions.js";
4
+ export { AuthenticationErrorEvent } from "./AuthenticationErrorEvent.js";
5
+ export type { AuthenticationErrorPayload } from "./AuthenticationErrorEvent.js";
6
+ export { AuthenticationErrorEventHandler } from "./abstractions.js";
@@ -0,0 +1,3 @@
1
+ export { NetworkErrorEvent } from "./NetworkErrorEvent.js";
2
+ export { AuthenticationErrorEventHandler, NetworkErrorEventHandler } from "./abstractions.js";
3
+ export { AuthenticationErrorEvent } from "./AuthenticationErrorEvent.js";
@@ -0,0 +1,9 @@
1
+ import React from "react";
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 {};
@@ -0,0 +1,43 @@
1
+ import react, { useState } from "react";
2
+ import { Typography } from "./Typography.js";
3
+ import { i18n } from "../../i18n/index.js";
4
+ import { OverlayWrapper } from "./StyledComponents.js";
5
+ import { ReactComponent } from "./assets/close_24px.js";
6
+ const t = i18n.ns("app/graphql/error-overlay");
7
+ const ENVIRONMENT_VARIABLES_ARTICLE_LINK = "https://www.webiny.com/docs/how-to-guides/environment-variables";
8
+ const ErrorOverlay = (props)=>{
9
+ const { title = "An error occurred", message, description, closeable } = props;
10
+ const [open, setOpen] = useState(true);
11
+ if (!open) return null;
12
+ return /*#__PURE__*/ react.createElement(OverlayWrapper, null, /*#__PURE__*/ react.createElement("div", {
13
+ className: "box-border flex flex-col w-full h-full overflow-auto bg-white p-4"
14
+ }, /*#__PURE__*/ react.createElement("div", {
15
+ className: "flex justify-between items-center mb-4"
16
+ }, /*#__PURE__*/ react.createElement("div", {
17
+ className: "text-[color:var(--mdc-theme-error)]"
18
+ }, /*#__PURE__*/ react.createElement(Typography, {
19
+ use: "headline"
20
+ }, title)), false !== closeable && /*#__PURE__*/ react.createElement("div", null, /*#__PURE__*/ react.createElement("span", {
21
+ onClick: ()=>setOpen(false)
22
+ }, /*#__PURE__*/ react.createElement(ReactComponent, null)))), /*#__PURE__*/ react.createElement("div", null, /*#__PURE__*/ react.createElement("div", {
23
+ className: "mb-4"
24
+ }, message), description && /*#__PURE__*/ react.createElement("div", null, description)), /*#__PURE__*/ react.createElement("div", {
25
+ className: "text-[color:var(--mdc-theme-text-secondary-on-background)]"
26
+ }, /*#__PURE__*/ react.createElement(Typography, {
27
+ use: "body"
28
+ }, t`
29
+ This screen is only visible if {message} environment variable is set.
30
+ Read more about it in the {link}. `({
31
+ message: /*#__PURE__*/ react.createElement("span", {
32
+ className: "bg-[rgba(251,245,180,0.5)] px-1 rounded-[6px] font-mono"
33
+ }, "`REACT_APP_DEBUG=true`"),
34
+ link: /*#__PURE__*/ react.createElement("a", {
35
+ href: ENVIRONMENT_VARIABLES_ARTICLE_LINK,
36
+ target: "_blank",
37
+ rel: "noreferrer noopener"
38
+ }, "environment variables article")
39
+ }), /*#__PURE__*/ react.createElement("br", null), t`Open your browser's developer console to further inspect this error.`))));
40
+ };
41
+ export { ErrorOverlay };
42
+
43
+ //# sourceMappingURL=ErrorOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors/overlay/ErrorOverlay.js","sources":["../../../src/errors/overlay/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={\"box-border flex flex-col w-full h-full overflow-auto bg-white p-4\"}>\n <div className={\"flex justify-between items-center mb-4\"}>\n <div className={\"text-[color:var(--mdc-theme-error)]\"}>\n <Typography use={\"headline\"}>{title}</Typography>\n </div>\n {closeable !== false && (\n <div>\n <span onClick={() => setOpen(false)}>\n <CloseIcon />\n </span>\n </div>\n )}\n </div>\n <div>\n <div className={\"mb-4\"}>{message}</div>\n {description && <div>{description}</div>}\n </div>\n <div className={\"text-[color:var(--mdc-theme-text-secondary-on-background)]\"}>\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: (\n <span\n className={\n \"bg-[rgba(251,245,180,0.5)] px-1 rounded-[6px] font-mono\"\n }\n >\n `REACT_APP_DEBUG=true`\n </span>\n ),\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"],"names":["t","i18n","ENVIRONMENT_VARIABLES_ARTICLE_LINK","ErrorOverlay","props","title","message","description","closeable","open","setOpen","useState","OverlayWrapper","Typography","CloseIcon"],"mappings":";;;;;AAMA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAElB,MAAMC,qCACF;AASG,MAAMC,eAAe,CAACC;IACzB,MAAM,EAAEC,QAAQ,mBAAmB,EAAEC,OAAO,EAAEC,WAAW,EAAEC,SAAS,EAAE,GAAGJ;IACzE,MAAM,CAACK,MAAMC,QAAQ,GAAGC,SAAS;IACjC,IAAI,CAACF,MACD,OAAO;IAGX,OAAO,WAAP,GACI,oBAACG,gBAAcA,MAAAA,WAAAA,GACX,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAI,WAAW;qBACZ,oBAACC,YAAUA;QAAC,KAAK;OAAaR,SAEjCG,AAAc,UAAdA,aAAuB,WAAT,GACX,oBAAC,2BACG,oBAAC;QAAK,SAAS,IAAME,QAAQ;qBACzB,oBAACI,gBAASA,UAAAA,WAAAA,GAK1B,oBAAC,2BACG,oBAAC;QAAI,WAAW;OAASR,UACxBC,eAAe,WAAfA,GAAe,oBAAC,aAAKA,eAAAA,WAAAA,GAE1B,oBAAC;QAAI,WAAW;qBACZ,oBAACM,YAAUA;QAAC,KAAK;OACZb,CAAC,CAAC;;0DAE+B,CAAC,CAAC;QAChC,SAAS,WAAT,GACI,oBAAC;YACG,WACI;WAEP;QAIL,MAAM,WAAN,GACI,oBAAC;YACG,MAAME;YACN,QAAQ;YACR,KAAK;WACR;IAIT,kBACA,oBAAC,aACAF,CAAC,CAAC,oEAAoE,CAAC;AAMhG"}
@@ -10,5 +10,5 @@ interface ErrorOverlayProps {
10
10
  };
11
11
  };
12
12
  }
13
- declare const ErrorOverlay: (props: ErrorOverlayProps) => React.JSX.Element | null;
14
- export default ErrorOverlay;
13
+ export declare const GqlErrorOverlay: (props: ErrorOverlayProps) => React.JSX.Element;
14
+ export {};
@@ -0,0 +1,27 @@
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
+ const GqlErrorOverlay = (props)=>{
9
+ const { query, networkError } = props;
10
+ const stackTrace = get(networkError, "result.error.stack");
11
+ const title = networkError.message;
12
+ const message = /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Typography, {
13
+ use: "subtitle"
14
+ }, t`Error occurred while executing operation:`), /*#__PURE__*/ react.createElement(Pre, null, /*#__PURE__*/ react.createElement("code", null, query)));
15
+ let description = null;
16
+ if (stackTrace) description = /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Typography, {
17
+ use: "subtitle"
18
+ }, t`Complete stack trace:`), /*#__PURE__*/ react.createElement(Pre, null, /*#__PURE__*/ react.createElement("code", null, stackTrace)));
19
+ return /*#__PURE__*/ react.createElement(ErrorOverlay, {
20
+ title: title,
21
+ message: message,
22
+ description: description
23
+ });
24
+ };
25
+ export { GqlErrorOverlay };
26
+
27
+ //# sourceMappingURL=GqlErrorOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors/overlay/GqlErrorOverlay.js","sources":["../../../src/errors/overlay/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"],"names":["t","i18n","GqlErrorOverlay","props","query","networkError","stackTrace","get","title","message","Typography","Pre","description","ErrorOverlay"],"mappings":";;;;;;AAOA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAcX,MAAMC,kBAAkB,CAACC;IAC5B,MAAM,EAAEC,KAAK,EAAEC,YAAY,EAAE,GAAGF;IAChC,MAAMG,aAAaC,IAAIF,cAAc;IAErC,MAAMG,QAAQH,aAAa,OAAO;IAElC,MAAMI,UAAU,WAAVA,GACF,wDACI,oBAACC,YAAUA;QAAC,KAAK;OAAaV,CAAC,CAAC,yCAAyC,CAAC,iBAC1E,oBAACW,KAAGA,MAAAA,WAAAA,GACA,oBAAC,cAAMP;IAKnB,IAAIQ,cAA+B;IACnC,IAAIN,YACAM,cAAc,WAAdA,GACI,wDACI,oBAACF,YAAUA;QAAC,KAAK;OAAaV,CAAC,CAAC,qBAAqB,CAAC,iBACtD,oBAACW,KAAGA,MAAAA,WAAAA,GACA,oBAAC,cAAML;IAMvB,OAAO,WAAP,GAAO,oBAACO,cAAYA;QAAC,OAAOL;QAAO,SAASC;QAAS,aAAaG;;AACtE"}