@webiny/app 0.0.0-unstable.e622468070 → 0.0.0-unstable.e9333b3f0b

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 (391) hide show
  1. package/App.d.ts +3 -3
  2. package/App.js +70 -80
  3. package/App.js.map +1 -1
  4. package/AppContainer.js +3 -6
  5. package/AppContainer.js.map +1 -1
  6. package/components/Image.js +11 -17
  7. package/components/Image.js.map +1 -1
  8. package/components/index.js +0 -2
  9. package/config/RouterConfig/Route.js +23 -28
  10. package/config/RouterConfig/Route.js.map +1 -1
  11. package/config/RouterConfig.d.ts +1 -3
  12. package/config/RouterConfig.js +11 -10
  13. package/config/RouterConfig.js.map +1 -1
  14. package/config.js +19 -20
  15. package/config.js.map +1 -1
  16. package/contexts/Ui/index.js +26 -28
  17. package/contexts/Ui/index.js.map +1 -1
  18. package/core/Plugin.d.ts +1 -1
  19. package/core/Plugin.js +7 -9
  20. package/core/Plugin.js.map +1 -1
  21. package/core/Plugins.d.ts +3 -2
  22. package/core/Plugins.js +15 -34
  23. package/core/Plugins.js.map +1 -1
  24. package/core/Provider.js +5 -13
  25. package/core/Provider.js.map +1 -1
  26. package/core/createProvider.js +3 -6
  27. package/core/createProvider.js.map +1 -1
  28. package/core/createProviderPlugin.js +8 -13
  29. package/core/createProviderPlugin.js.map +1 -1
  30. package/errors/AuthenticationErrorEvent.js +8 -5
  31. package/errors/AuthenticationErrorEvent.js.map +1 -1
  32. package/errors/NetworkErrorEvent.js +8 -5
  33. package/errors/NetworkErrorEvent.js.map +1 -1
  34. package/errors/abstractions.js +3 -2
  35. package/errors/abstractions.js.map +1 -1
  36. package/errors/index.js +1 -4
  37. package/errors/overlay/ErrorOverlay.js +43 -0
  38. package/errors/overlay/ErrorOverlay.js.map +1 -0
  39. package/errors/overlay/GqlErrorOverlay.js +27 -0
  40. package/errors/overlay/GqlErrorOverlay.js.map +1 -0
  41. package/errors/overlay/LocalAwsLambdaTimeoutMessage.js +20 -0
  42. package/errors/overlay/LocalAwsLambdaTimeoutMessage.js.map +1 -0
  43. package/errors/overlay/StyledComponents.d.ts +7 -0
  44. package/errors/overlay/StyledComponents.js +10 -0
  45. package/errors/overlay/StyledComponents.js.map +1 -0
  46. package/errors/overlay/Typography.js +13 -0
  47. package/errors/overlay/Typography.js.map +1 -0
  48. package/errors/overlay/assets/close_24px.js +19 -0
  49. package/errors/overlay/assets/close_24px.js.map +1 -0
  50. package/errors/overlay/createErrorOverlay.js +15 -0
  51. package/errors/overlay/createErrorOverlay.js.map +1 -0
  52. package/exports/admin/env-config.d.ts +2 -0
  53. package/exports/admin/env-config.js +2 -0
  54. package/exports/admin/{graphqlClient.js → graphql-client.js} +0 -2
  55. package/exports/admin/{localStorage.js → local-storage.js} +0 -2
  56. package/exports/admin/router.d.ts +1 -0
  57. package/exports/admin/router.js +1 -2
  58. package/exports/admin/security.js +0 -2
  59. package/exports/admin.d.ts +2 -0
  60. package/exports/admin.js +2 -2
  61. package/features/apiStreamClient/FetchApiStreamClient.d.ts +9 -0
  62. package/features/apiStreamClient/FetchApiStreamClient.js +63 -0
  63. package/features/apiStreamClient/FetchApiStreamClient.js.map +1 -0
  64. package/features/apiStreamClient/__tests__/FetchApiStreamClient.test.d.ts +1 -0
  65. package/features/apiStreamClient/__tests__/FetchApiStreamClient.test.js +170 -0
  66. package/features/apiStreamClient/__tests__/FetchApiStreamClient.test.js.map +1 -0
  67. package/features/apiStreamClient/__tests__/readServerSentEvents.test.d.ts +1 -0
  68. package/features/apiStreamClient/__tests__/readServerSentEvents.test.js +160 -0
  69. package/features/apiStreamClient/__tests__/readServerSentEvents.test.js.map +1 -0
  70. package/features/apiStreamClient/abstractions.d.ts +44 -0
  71. package/features/apiStreamClient/abstractions.js +10 -0
  72. package/features/apiStreamClient/abstractions.js.map +1 -0
  73. package/features/apiStreamClient/feature.d.ts +3 -0
  74. package/features/apiStreamClient/feature.js +17 -0
  75. package/features/apiStreamClient/feature.js.map +1 -0
  76. package/features/apiStreamClient/index.d.ts +5 -0
  77. package/features/apiStreamClient/index.js +5 -0
  78. package/features/apiStreamClient/readServerSentEvents.d.ts +10 -0
  79. package/features/apiStreamClient/readServerSentEvents.js +29 -0
  80. package/features/apiStreamClient/readServerSentEvents.js.map +1 -0
  81. package/features/apiStreamClient/toPayloadHash.d.ts +14 -0
  82. package/features/apiStreamClient/toPayloadHash.js +7 -0
  83. package/features/apiStreamClient/toPayloadHash.js.map +1 -0
  84. package/features/envConfig/EnvConfig.d.ts +1 -0
  85. package/features/envConfig/EnvConfig.js +12 -10
  86. package/features/envConfig/EnvConfig.js.map +1 -1
  87. package/features/envConfig/abstractions.d.ts +1 -0
  88. package/features/envConfig/abstractions.js +2 -1
  89. package/features/envConfig/abstractions.js.map +1 -1
  90. package/features/envConfig/feature.js +9 -8
  91. package/features/envConfig/feature.js.map +1 -1
  92. package/features/envConfig/index.js +0 -2
  93. package/features/eventPublisher/EventPublisher.js +13 -21
  94. package/features/eventPublisher/EventPublisher.js.map +1 -1
  95. package/features/eventPublisher/abstractions.js +7 -9
  96. package/features/eventPublisher/abstractions.js.map +1 -1
  97. package/features/eventPublisher/feature.d.ts +3 -1
  98. package/features/eventPublisher/feature.js +13 -7
  99. package/features/eventPublisher/feature.js.map +1 -1
  100. package/features/eventPublisher/index.js +1 -3
  101. package/features/graphqlClient/AuthenticationErrorPublishing.js +26 -26
  102. package/features/graphqlClient/AuthenticationErrorPublishing.js.map +1 -1
  103. package/features/graphqlClient/BatchingGraphQLClient.d.ts +1 -3
  104. package/features/graphqlClient/BatchingGraphQLClient.js +104 -150
  105. package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -1
  106. package/features/graphqlClient/FetchGraphQLClient.d.ts +0 -3
  107. package/features/graphqlClient/FetchGraphQLClient.js +41 -52
  108. package/features/graphqlClient/FetchGraphQLClient.js.map +1 -1
  109. package/features/graphqlClient/NetworkErrorPublishing.js +35 -42
  110. package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -1
  111. package/features/graphqlClient/RequestValue.d.ts +1 -0
  112. package/features/graphqlClient/RequestValue.js +42 -38
  113. package/features/graphqlClient/RequestValue.js.map +1 -1
  114. package/features/graphqlClient/RetryGraphQLClient.js +36 -45
  115. package/features/graphqlClient/RetryGraphQLClient.js.map +1 -1
  116. package/features/graphqlClient/__tests__/GraphQLClient.test.js +457 -336
  117. package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -1
  118. package/features/graphqlClient/abstractions.d.ts +1 -0
  119. package/features/graphqlClient/abstractions.js +2 -1
  120. package/features/graphqlClient/abstractions.js.map +1 -1
  121. package/features/graphqlClient/feature.js +14 -20
  122. package/features/graphqlClient/feature.js.map +1 -1
  123. package/features/graphqlClient/index.js +0 -2
  124. package/features/graphqlClient/types.js +0 -3
  125. package/features/localStorage/BrowserLocalStorageGateway.js +56 -63
  126. package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -1
  127. package/features/localStorage/LocalStorage.js +27 -24
  128. package/features/localStorage/LocalStorage.js.map +1 -1
  129. package/features/localStorage/LocalStorageRepository.js +75 -88
  130. package/features/localStorage/LocalStorageRepository.js.map +1 -1
  131. package/features/localStorage/abstractions.js +5 -16
  132. package/features/localStorage/abstractions.js.map +1 -1
  133. package/features/localStorage/feature.js +17 -28
  134. package/features/localStorage/feature.js.map +1 -1
  135. package/features/localStorage/index.js +1 -3
  136. package/features/mainGraphQLClient/MainGraphQLClient.d.ts +11 -0
  137. package/features/mainGraphQLClient/MainGraphQLClient.js +27 -0
  138. package/features/mainGraphQLClient/MainGraphQLClient.js.map +1 -0
  139. package/features/mainGraphQLClient/abstractions.d.ts +17 -0
  140. package/features/mainGraphQLClient/abstractions.js +5 -0
  141. package/features/mainGraphQLClient/abstractions.js.map +1 -0
  142. package/features/mainGraphQLClient/feature.d.ts +3 -0
  143. package/features/mainGraphQLClient/feature.js +17 -0
  144. package/features/mainGraphQLClient/feature.js.map +1 -0
  145. package/features/mainGraphQLClient/index.d.ts +1 -0
  146. package/features/mainGraphQLClient/index.js +1 -0
  147. package/features/router/HistoryRouterGateway.d.ts +10 -3
  148. package/features/router/HistoryRouterGateway.js +91 -73
  149. package/features/router/HistoryRouterGateway.js.map +1 -1
  150. package/features/router/HistoryRouterGateway.test.js +184 -193
  151. package/features/router/HistoryRouterGateway.test.js.map +1 -1
  152. package/features/router/Route.d.ts +1 -1
  153. package/features/router/Route.js +38 -54
  154. package/features/router/Route.js.map +1 -1
  155. package/features/router/RouteUrl.js +84 -217
  156. package/features/router/RouteUrl.js.map +1 -1
  157. package/features/router/Router.js +67 -124
  158. package/features/router/Router.js.map +1 -1
  159. package/features/router/RouterPresenter.d.ts +8 -2
  160. package/features/router/RouterPresenter.js +54 -37
  161. package/features/router/RouterPresenter.js.map +1 -1
  162. package/features/router/RouterRepository.d.ts +14 -3
  163. package/features/router/RouterRepository.js +113 -61
  164. package/features/router/RouterRepository.js.map +1 -1
  165. package/features/router/RouterRepository.test.js +120 -136
  166. package/features/router/RouterRepository.test.js.map +1 -1
  167. package/features/router/abstractions.d.ts +29 -7
  168. package/features/router/abstractions.js +4 -12
  169. package/features/router/abstractions.js.map +1 -1
  170. package/features/router/feature.js +13 -12
  171. package/features/router/feature.js.map +1 -1
  172. package/features/router/index.d.ts +1 -0
  173. package/features/router/index.js +1 -3
  174. package/helpers/InterfaceGenerator/date.js +0 -3
  175. package/helpers/InterfaceGenerator/id.js +0 -3
  176. package/helpers/InterfaceGenerator/identity.js +0 -3
  177. package/helpers/InterfaceGenerator/index.js +0 -3
  178. package/helpers/InterfaceGenerator/numeric.js +0 -3
  179. package/helpers/InterfaceGenerator/truthful.js +0 -3
  180. package/hooks/useHandler.js +12 -16
  181. package/hooks/useHandler.js.map +1 -1
  182. package/hooks/useHandlers.js +18 -20
  183. package/hooks/useHandlers.js.map +1 -1
  184. package/hooks/useRegisterLegacyPlugin.js +7 -6
  185. package/hooks/useRegisterLegacyPlugin.js.map +1 -1
  186. package/hooks/useUi.js +2 -3
  187. package/hooks/useUi.js.map +1 -1
  188. package/i18n/i18n.js +8 -4
  189. package/i18n/i18n.js.map +1 -1
  190. package/i18n/index.js +0 -2
  191. package/index.d.ts +1 -4
  192. package/index.js +4 -12
  193. package/package.json +31 -41
  194. package/plugins/components/Image.js +8 -15
  195. package/plugins/components/Image.js.map +1 -1
  196. package/plugins/image.d.ts +1 -1
  197. package/plugins/image.js +94 -133
  198. package/plugins/image.js.map +1 -1
  199. package/plugins/index.js +35 -59
  200. package/plugins/index.js.map +1 -1
  201. package/presentation/envConfig/useEnvConfig.d.ts +6 -0
  202. package/presentation/envConfig/useEnvConfig.js +9 -0
  203. package/presentation/envConfig/useEnvConfig.js.map +1 -0
  204. package/presentation/localStorage/index.js +0 -2
  205. package/presentation/localStorage/useLocalStorage.js +10 -16
  206. package/presentation/localStorage/useLocalStorage.js.map +1 -1
  207. package/presentation/localStorage/useLocalStorageValue.js +15 -13
  208. package/presentation/localStorage/useLocalStorageValue.js.map +1 -1
  209. package/presentation/localStorage/useLocalStorageValues.js +23 -30
  210. package/presentation/localStorage/useLocalStorageValues.js.map +1 -1
  211. package/presentation/router/RouteElementRegistry.js +22 -25
  212. package/presentation/router/RouteElementRegistry.js.map +1 -1
  213. package/presentation/router/abstractions.js +2 -1
  214. package/presentation/router/abstractions.js.map +1 -1
  215. package/presentation/router/components/Redirect.d.ts +14 -0
  216. package/presentation/router/components/Redirect.js +13 -0
  217. package/presentation/router/components/Redirect.js.map +1 -0
  218. package/presentation/router/components/RouteContent.js +15 -12
  219. package/presentation/router/components/RouteContent.js.map +1 -1
  220. package/presentation/router/components/RouteLink.js +11 -16
  221. package/presentation/router/components/RouteLink.js.map +1 -1
  222. package/presentation/router/components/RouteParamsSync.d.ts +22 -0
  223. package/presentation/router/components/RouteParamsSync.js +53 -0
  224. package/presentation/router/components/RouteParamsSync.js.map +1 -0
  225. package/presentation/router/components/SimpleLink.js +18 -24
  226. package/presentation/router/components/SimpleLink.js.map +1 -1
  227. package/presentation/router/hooks/useRoute.d.ts +1 -0
  228. package/presentation/router/hooks/useRoute.js +16 -23
  229. package/presentation/router/hooks/useRoute.js.map +1 -1
  230. package/presentation/router/hooks/useRouter.d.ts +6 -1
  231. package/presentation/router/hooks/useRouter.js +23 -19
  232. package/presentation/router/hooks/useRouter.js.map +1 -1
  233. package/presentation/router/index.d.ts +2 -0
  234. package/presentation/router/index.js +1 -2
  235. package/presentation/router/types.d.ts +1 -1
  236. package/presentation/router/types.js +0 -3
  237. package/renderApp.d.ts +1 -1
  238. package/renderApp.js +7 -6
  239. package/renderApp.js.map +1 -1
  240. package/router.js +0 -3
  241. package/rslib-runtime.js +14 -0
  242. package/rslib-runtime.js.map +1 -0
  243. package/shared/di/DiContainerProvider.js +8 -12
  244. package/shared/di/DiContainerProvider.js.map +1 -1
  245. package/shared/di/createFeature.js +7 -8
  246. package/shared/di/createFeature.js.map +1 -1
  247. package/shared/di/useFeature.js +8 -14
  248. package/shared/di/useFeature.js.map +1 -1
  249. package/static/svg/close_24px.33adaadc.svg +1 -0
  250. package/types.d.ts +0 -21
  251. package/types.js +0 -3
  252. package/utils/createGenericContext.js +17 -21
  253. package/utils/createGenericContext.js.map +1 -1
  254. package/utils/createHashing.js +13 -16
  255. package/utils/createHashing.js.map +1 -1
  256. package/utils/index.js +0 -2
  257. package/utils/legacyPluginToReactComponent.js +11 -10
  258. package/utils/legacyPluginToReactComponent.js.map +1 -1
  259. package/apollo-client/InMemoryCache.d.ts +0 -8
  260. package/apollo-client/InMemoryCache.js +0 -20
  261. package/apollo-client/InMemoryCache.js.map +0 -1
  262. package/apollo-client/IntrospectionFragmentMatcher.d.ts +0 -11
  263. package/apollo-client/IntrospectionFragmentMatcher.js +0 -45
  264. package/apollo-client/IntrospectionFragmentMatcher.js.map +0 -1
  265. package/components/index.js.map +0 -1
  266. package/core/DebounceRender.d.ts +0 -12
  267. package/core/DebounceRender.js +0 -31
  268. package/core/DebounceRender.js.map +0 -1
  269. package/core/Routes.d.ts +0 -7
  270. package/core/Routes.js +0 -33
  271. package/core/Routes.js.map +0 -1
  272. package/errors/index.js.map +0 -1
  273. package/exports/admin/envConfig.d.ts +0 -1
  274. package/exports/admin/envConfig.js +0 -3
  275. package/exports/admin/envConfig.js.map +0 -1
  276. package/exports/admin/graphqlClient.js.map +0 -1
  277. package/exports/admin/localStorage.js.map +0 -1
  278. package/exports/admin/router.js.map +0 -1
  279. package/exports/admin/security.js.map +0 -1
  280. package/exports/admin.js.map +0 -1
  281. package/features/envConfig/index.js.map +0 -1
  282. package/features/eventPublisher/index.js.map +0 -1
  283. package/features/graphqlClient/index.js.map +0 -1
  284. package/features/graphqlClient/types.js.map +0 -1
  285. package/features/localStorage/index.js.map +0 -1
  286. package/features/router/index.js.map +0 -1
  287. package/helpers/InterfaceGenerator/date.js.map +0 -1
  288. package/helpers/InterfaceGenerator/id.js.map +0 -1
  289. package/helpers/InterfaceGenerator/identity.js.map +0 -1
  290. package/helpers/InterfaceGenerator/index.js.map +0 -1
  291. package/helpers/InterfaceGenerator/numeric.js.map +0 -1
  292. package/helpers/InterfaceGenerator/truthful.js.map +0 -1
  293. package/hooks/useAutocomplete/index.d.ts +0 -1
  294. package/hooks/useAutocomplete/index.js +0 -3
  295. package/hooks/useAutocomplete/index.js.map +0 -1
  296. package/hooks/useAutocomplete/useAutocomplete.d.ts +0 -11
  297. package/hooks/useAutocomplete/useAutocomplete.js +0 -20
  298. package/hooks/useAutocomplete/useAutocomplete.js.map +0 -1
  299. package/hooks/useDataList/functions/getData.d.ts +0 -2
  300. package/hooks/useDataList/functions/getData.js +0 -4
  301. package/hooks/useDataList/functions/getData.js.map +0 -1
  302. package/hooks/useDataList/functions/getError.d.ts +0 -2
  303. package/hooks/useDataList/functions/getError.js +0 -4
  304. package/hooks/useDataList/functions/getError.js.map +0 -1
  305. package/hooks/useDataList/functions/getMeta.d.ts +0 -2
  306. package/hooks/useDataList/functions/getMeta.js +0 -4
  307. package/hooks/useDataList/functions/getMeta.js.map +0 -1
  308. package/hooks/useDataList/functions/index.d.ts +0 -3
  309. package/hooks/useDataList/functions/index.js +0 -5
  310. package/hooks/useDataList/functions/index.js.map +0 -1
  311. package/hooks/useDataList/functions/searchDataByKey.d.ts +0 -2
  312. package/hooks/useDataList/functions/searchDataByKey.js +0 -18
  313. package/hooks/useDataList/functions/searchDataByKey.js.map +0 -1
  314. package/hooks/useDataList/index.d.ts +0 -1
  315. package/hooks/useDataList/index.js +0 -3
  316. package/hooks/useDataList/index.js.map +0 -1
  317. package/hooks/useDataList/useDataList.d.ts +0 -35
  318. package/hooks/useDataList/useDataList.js +0 -163
  319. package/hooks/useDataList/useDataList.js.map +0 -1
  320. package/hooks/useDataList/utils/index.d.ts +0 -1
  321. package/hooks/useDataList/utils/index.js +0 -3
  322. package/hooks/useDataList/utils/index.js.map +0 -1
  323. package/hooks/useDataList/utils/prepareLoadListParams.d.ts +0 -10
  324. package/hooks/useDataList/utils/prepareLoadListParams.js +0 -38
  325. package/hooks/useDataList/utils/prepareLoadListParams.js.map +0 -1
  326. package/i18n/index.js.map +0 -1
  327. package/index.js.map +0 -1
  328. package/plugins/AddQuerySelectionPlugin.d.ts +0 -22
  329. package/plugins/AddQuerySelectionPlugin.js +0 -72
  330. package/plugins/AddQuerySelectionPlugin.js.map +0 -1
  331. package/plugins/ApolloCacheObjectIdPlugin.d.ts +0 -15
  332. package/plugins/ApolloCacheObjectIdPlugin.js +0 -16
  333. package/plugins/ApolloCacheObjectIdPlugin.js.map +0 -1
  334. package/plugins/ApolloDynamicLink.d.ts +0 -7
  335. package/plugins/ApolloDynamicLink.js +0 -31
  336. package/plugins/ApolloDynamicLink.js.map +0 -1
  337. package/plugins/ApolloLinkPlugin.d.ts +0 -13
  338. package/plugins/ApolloLinkPlugin.js +0 -22
  339. package/plugins/ApolloLinkPlugin.js.map +0 -1
  340. package/plugins/ConsoleLinkPlugin.d.ts +0 -8
  341. package/plugins/ConsoleLinkPlugin.js +0 -26
  342. package/plugins/ConsoleLinkPlugin.js.map +0 -1
  343. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +0 -55
  344. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +0 -1
  345. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js +0 -31
  346. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js.map +0 -1
  347. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js +0 -31
  348. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js.map +0 -1
  349. package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +0 -8
  350. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +0 -78
  351. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +0 -1
  352. package/plugins/NetworkErrorLinkPlugin/Typography.js +0 -18
  353. package/plugins/NetworkErrorLinkPlugin/Typography.js.map +0 -1
  354. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +0 -22
  355. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +0 -1
  356. package/plugins/NetworkErrorLinkPlugin.d.ts +0 -10
  357. package/plugins/NetworkErrorLinkPlugin.js +0 -70
  358. package/plugins/NetworkErrorLinkPlugin.js.map +0 -1
  359. package/plugins/OmitTypenameLinkPlugin.d.ts +0 -8
  360. package/plugins/OmitTypenameLinkPlugin.js +0 -21
  361. package/plugins/OmitTypenameLinkPlugin.js.map +0 -1
  362. package/plugins/TenantHeaderLinkPlugin.d.ts +0 -10
  363. package/plugins/TenantHeaderLinkPlugin.js +0 -37
  364. package/plugins/TenantHeaderLinkPlugin.js.map +0 -1
  365. package/presentation/localStorage/index.js.map +0 -1
  366. package/presentation/router/index.js.map +0 -1
  367. package/presentation/router/types.js.map +0 -1
  368. package/react-butterfiles/Files.d.ts +0 -69
  369. package/react-butterfiles/Files.js +0 -227
  370. package/react-butterfiles/Files.js.map +0 -1
  371. package/react-butterfiles/file.todo +0 -1
  372. package/react-butterfiles/index.d.ts +0 -2
  373. package/react-butterfiles/index.js +0 -4
  374. package/react-butterfiles/index.js.map +0 -1
  375. package/react-butterfiles/utils/generateId.d.ts +0 -1
  376. package/react-butterfiles/utils/generateId.js +0 -5
  377. package/react-butterfiles/utils/generateId.js.map +0 -1
  378. package/react-butterfiles/utils/readFileContent.d.ts +0 -1
  379. package/react-butterfiles/utils/readFileContent.js +0 -15
  380. package/react-butterfiles/utils/readFileContent.js.map +0 -1
  381. package/router.js.map +0 -1
  382. package/types.js.map +0 -1
  383. package/utils/index.js.map +0 -1
  384. /package/{plugins/NetworkErrorLinkPlugin → errors/overlay}/ErrorOverlay.d.ts +0 -0
  385. /package/{plugins/NetworkErrorLinkPlugin → errors/overlay}/GqlErrorOverlay.d.ts +0 -0
  386. /package/{plugins/NetworkErrorLinkPlugin → errors/overlay}/LocalAwsLambdaTimeoutMessage.d.ts +0 -0
  387. /package/{plugins/NetworkErrorLinkPlugin → errors/overlay}/Typography.d.ts +0 -0
  388. /package/{plugins/NetworkErrorLinkPlugin → errors/overlay}/assets/close_24px.svg +0 -0
  389. /package/{plugins/NetworkErrorLinkPlugin → errors/overlay}/createErrorOverlay.d.ts +0 -0
  390. /package/exports/admin/{graphqlClient.d.ts → graphql-client.d.ts} +0 -0
  391. /package/exports/admin/{localStorage.d.ts → local-storage.d.ts} +0 -0
package/App.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { Decorator, DecoratorsCollection, GenericComponent } from "@webiny/react-composition";
3
3
  interface State {
4
- plugins: JSX.Element[];
4
+ plugins: React.JSX.Element[];
5
5
  providers: Decorator<GenericComponent<ProviderProps>>[];
6
6
  }
7
7
  interface AppContext extends State {
@@ -11,8 +11,8 @@ interface AppContext extends State {
11
11
  declare const AppContext: React.Context<AppContext | undefined>;
12
12
  export declare const useApp: () => AppContext;
13
13
  export interface AppProps {
14
- debounceRender?: number;
15
14
  routes?: Array<any>;
15
+ plugins?: any[];
16
16
  providers?: Array<Decorator<GenericComponent<ProviderProps>>>;
17
17
  decorators?: DecoratorsCollection;
18
18
  children?: React.ReactNode | React.ReactNode[];
@@ -20,6 +20,6 @@ export interface AppProps {
20
20
  interface ProviderProps {
21
21
  children: React.ReactNode;
22
22
  }
23
- export declare const AppBase: React.MemoExoticComponent<({ debounceRender, routes, providers, children }: AppProps) => React.JSX.Element>;
23
+ export declare const AppBase: React.MemoExoticComponent<({ routes, plugins, providers, children }: AppProps) => React.JSX.Element>;
24
24
  export declare const App: ({ decorators, ...props }: AppProps) => React.JSX.Element;
25
25
  export {};
package/App.js CHANGED
@@ -1,92 +1,82 @@
1
- import React, { createContext, useCallback, useContext, useEffect, useMemo, useState } from "react";
2
- import { compose, CompositionProvider } from "@webiny/react-composition";
3
- import { DebounceRender } from "./core/DebounceRender.js";
1
+ import react, { Fragment, createContext, useCallback, useContext, useEffect, useMemo, useState } from "react";
2
+ import { CompositionProvider, compose } from "@webiny/react-composition";
4
3
  import { PluginsProvider } from "./core/Plugins.js";
5
4
  import { RouterWithConfig, useRouterConfig } from "./config/RouterConfig.js";
6
5
  import { AppContainer } from "./AppContainer.js";
7
6
  import { RouteContent } from "./presentation/router/components/RouteContent.js";
8
7
  import { useRouter } from "./router.js";
9
- const AppContext = /*#__PURE__*/createContext(undefined);
8
+ const AppContext = /*#__PURE__*/ createContext(void 0);
10
9
  AppContext.displayName = "AppContext";
11
- export const useApp = () => {
12
- const appContext = useContext(AppContext);
13
- if (!appContext) {
14
- throw Error(`AppContext provider was not found. Are you using the "useApp()" hook in the right place?`);
15
- }
16
- return appContext;
10
+ const useApp = ()=>{
11
+ const appContext = useContext(AppContext);
12
+ if (!appContext) throw Error('AppContext provider was not found. Are you using the "useApp()" hook in the right place?');
13
+ return appContext;
17
14
  };
18
- export const AppBase = /*#__PURE__*/React.memo(({
19
- debounceRender = 50,
20
- routes = [],
21
- providers = [],
22
- children
23
- }) => {
24
- const [state, setState] = useState({
25
- plugins: [],
26
- providers
27
- });
28
- const addProvider = useCallback(component => {
29
- setState(state => {
30
- if (state.providers.findIndex(m => m === component) > -1) {
31
- return state;
32
- }
33
- return {
34
- ...state,
35
- providers: [...state.providers, component]
36
- };
15
+ const AppBase = /*#__PURE__*/ react.memo(({ routes = [], plugins = [], providers = [], children })=>{
16
+ const [state, setState] = useState({
17
+ plugins,
18
+ providers
37
19
  });
38
- }, []);
39
- const addPlugin = useCallback(element => {
40
- setState(state => {
41
- return {
42
- ...state,
43
- plugins: [...state.plugins, element]
44
- };
45
- });
46
- }, []);
47
- const appContext = useMemo(() => ({
48
- ...state,
49
- addProvider,
50
- addPlugin
51
- }), [state]);
52
- const AppRouter = useMemo(() => {
53
- return function AppRouter() {
54
- const router = useRouter();
55
- const routerConfig = useRouterConfig();
56
- const routesFromConfig = routerConfig.routes;
57
- const combinedRoutes = [...routes, ...routesFromConfig];
58
- useEffect(() => {
59
- router.setRoutes(combinedRoutes);
60
- }, [combinedRoutes.length]);
61
- return null;
62
- };
63
- }, []);
64
- const Providers = useMemo(() => {
65
- return /*#__PURE__*/React.memo(compose(...(state.providers || []))(({
66
- children
67
- }) => {
68
- return /*#__PURE__*/React.createElement(DebounceRender, {
69
- wait: debounceRender
70
- }, children);
71
- }));
72
- }, [state.providers.length]);
73
- Providers.displayName = "Providers";
74
- return /*#__PURE__*/React.createElement(AppContext.Provider, {
75
- value: appContext
76
- }, children, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(Providers, null, /*#__PURE__*/React.createElement(PluginsProvider, null, state.plugins), /*#__PURE__*/React.createElement(DebounceRender, {
77
- wait: debounceRender
78
- }, /*#__PURE__*/React.createElement(RouterWithConfig, null, /*#__PURE__*/React.createElement(AppRouter, null), /*#__PURE__*/React.createElement(RouteContent, null))))));
20
+ const addProvider = useCallback((component)=>{
21
+ setState((state)=>{
22
+ if (state.providers.findIndex((m)=>m === component) > -1) return state;
23
+ return {
24
+ ...state,
25
+ providers: [
26
+ ...state.providers,
27
+ component
28
+ ]
29
+ };
30
+ });
31
+ }, []);
32
+ const addPlugin = useCallback((element)=>{
33
+ setState((state)=>({
34
+ ...state,
35
+ plugins: [
36
+ ...state.plugins,
37
+ element
38
+ ]
39
+ }));
40
+ }, []);
41
+ const appContext = useMemo(()=>({
42
+ ...state,
43
+ addProvider,
44
+ addPlugin
45
+ }), [
46
+ state
47
+ ]);
48
+ const AppRouter = useMemo(()=>function() {
49
+ const router = useRouter();
50
+ const routerConfig = useRouterConfig();
51
+ const routesFromConfig = routerConfig.routes;
52
+ const combinedRoutes = [
53
+ ...routes,
54
+ ...routesFromConfig
55
+ ];
56
+ useEffect(()=>{
57
+ router.setRoutes(combinedRoutes);
58
+ }, [
59
+ combinedRoutes.length
60
+ ]);
61
+ return null;
62
+ }, []);
63
+ const Providers = useMemo(()=>/*#__PURE__*/ react.memo(compose(...state.providers || [])(({ children })=>/*#__PURE__*/ react.createElement(react.Fragment, null, children))), [
64
+ state.providers.length
65
+ ]);
66
+ Providers.displayName = "Providers";
67
+ return /*#__PURE__*/ react.createElement(AppContext.Provider, {
68
+ value: appContext
69
+ }, children, /*#__PURE__*/ react.createElement(AppContainer, null, /*#__PURE__*/ react.createElement(Providers, null, /*#__PURE__*/ react.createElement(PluginsProvider, null, state.plugins.map((plugin, index)=>/*#__PURE__*/ react.createElement(Fragment, {
70
+ key: index
71
+ }, plugin))), /*#__PURE__*/ react.createElement(RouterWithConfig, null, /*#__PURE__*/ react.createElement(AppRouter, null), /*#__PURE__*/ react.createElement(RouteContent, null)))));
79
72
  });
80
73
  AppBase.displayName = "AppBase";
81
- export const App = ({
82
- decorators,
83
- ...props
84
- }) => {
85
- return /*#__PURE__*/React.createElement(CompositionProvider, {
86
- decorators: decorators
87
- }, /*#__PURE__*/React.createElement(AppBase, Object.assign({
88
- decorators: decorators
89
- }, props)));
90
- };
74
+ const App = ({ decorators, ...props })=>/*#__PURE__*/ react.createElement(CompositionProvider, {
75
+ decorators: decorators
76
+ }, /*#__PURE__*/ react.createElement(AppBase, {
77
+ decorators: decorators,
78
+ ...props
79
+ }));
80
+ export { App, AppBase, useApp };
91
81
 
92
82
  //# sourceMappingURL=App.js.map
package/App.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["React","createContext","useCallback","useContext","useEffect","useMemo","useState","compose","CompositionProvider","DebounceRender","PluginsProvider","RouterWithConfig","useRouterConfig","AppContainer","RouteContent","useRouter","AppContext","undefined","displayName","useApp","appContext","Error","AppBase","memo","debounceRender","routes","providers","children","state","setState","plugins","addProvider","component","findIndex","m","addPlugin","element","AppRouter","router","routerConfig","routesFromConfig","combinedRoutes","setRoutes","length","Providers","createElement","wait","Provider","value","App","decorators","props","Object","assign"],"sources":["App.tsx"],"sourcesContent":["import React, { createContext, useCallback, useContext, useEffect, useMemo, useState } from \"react\";\nimport {\n compose,\n CompositionProvider,\n Decorator,\n DecoratorsCollection,\n GenericComponent\n} from \"@webiny/react-composition\";\nimport { DebounceRender } from \"./core/DebounceRender.js\";\nimport { PluginsProvider } from \"./core/Plugins.js\";\nimport { RouterWithConfig, useRouterConfig } from \"./config/RouterConfig.js\";\nimport { AppContainer } from \"./AppContainer.js\";\nimport { RouteContent } from \"~/presentation/router/components/RouteContent.js\";\nimport { useRouter } from \"~/router.js\";\n\ninterface State {\n plugins: JSX.Element[];\n providers: Decorator<GenericComponent<ProviderProps>>[];\n}\n\ninterface AppContext extends State {\n addProvider(hoc: Decorator<GenericComponent<ProviderProps>>): void;\n\n addPlugin(plugin: React.ReactNode): void;\n}\n\nconst AppContext = createContext<AppContext | undefined>(undefined);\n\nAppContext.displayName = \"AppContext\";\n\nexport const useApp = () => {\n const appContext = useContext(AppContext);\n if (!appContext) {\n throw Error(\n `AppContext provider was not found. Are you using the \"useApp()\" hook in the right place?`\n );\n }\n return appContext;\n};\n\nexport interface AppProps {\n debounceRender?: number;\n routes?: Array<any>;\n providers?: Array<Decorator<GenericComponent<ProviderProps>>>;\n decorators?: DecoratorsCollection;\n children?: React.ReactNode | React.ReactNode[];\n}\n\ninterface ProviderProps {\n children: React.ReactNode;\n}\n\ntype ComponentWithChildren = React.ComponentType<{ children?: React.ReactNode }>;\n\nexport const AppBase = React.memo(\n ({ debounceRender = 50, routes = [], providers = [], children }: AppProps) => {\n const [state, setState] = useState<State>({\n plugins: [],\n providers\n });\n\n const addProvider = useCallback((component: Decorator<any>) => {\n setState(state => {\n if (state.providers.findIndex(m => m === component) > -1) {\n return state;\n }\n\n return {\n ...state,\n providers: [...state.providers, component]\n };\n });\n }, []);\n\n const addPlugin = useCallback((element: JSX.Element) => {\n setState(state => {\n return {\n ...state,\n plugins: [...state.plugins, element]\n };\n });\n }, []);\n\n const appContext = useMemo(\n () => ({\n ...state,\n addProvider,\n addPlugin\n }),\n [state]\n );\n\n const AppRouter = useMemo(() => {\n return function AppRouter() {\n const router = useRouter();\n const routerConfig = useRouterConfig();\n const routesFromConfig = routerConfig.routes;\n const combinedRoutes = [...routes, ...routesFromConfig];\n\n useEffect(() => {\n router.setRoutes(combinedRoutes);\n }, [combinedRoutes.length]);\n\n return null;\n };\n }, []);\n\n const Providers = useMemo(() => {\n return React.memo(\n compose(...(state.providers || []))(({ children }: ProviderProps) => {\n return <DebounceRender wait={debounceRender}>{children}</DebounceRender>;\n })\n );\n }, [state.providers.length]) as ComponentWithChildren;\n\n Providers.displayName = \"Providers\";\n\n return (\n <AppContext.Provider value={appContext}>\n {children}\n <AppContainer>\n <Providers>\n <PluginsProvider>{state.plugins}</PluginsProvider>\n <DebounceRender wait={debounceRender}>\n <RouterWithConfig>\n <AppRouter />\n <RouteContent />\n </RouterWithConfig>\n </DebounceRender>\n </Providers>\n </AppContainer>\n </AppContext.Provider>\n );\n }\n);\n\nAppBase.displayName = \"AppBase\";\n\nexport const App = ({ decorators, ...props }: AppProps) => {\n return (\n <CompositionProvider decorators={decorators}>\n <AppBase decorators={decorators} {...props} />\n </CompositionProvider>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,WAAW,EAAEC,UAAU,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACnG,SACIC,OAAO,EACPC,mBAAmB,QAIhB,2BAA2B;AAClC,SAASC,cAAc;AACvB,SAASC,eAAe;AACxB,SAASC,gBAAgB,EAAEC,eAAe;AAC1C,SAASC,YAAY;AACrB,SAASC,YAAY;AACrB,SAASC,SAAS;AAalB,MAAMC,UAAU,gBAAGf,aAAa,CAAyBgB,SAAS,CAAC;AAEnED,UAAU,CAACE,WAAW,GAAG,YAAY;AAErC,OAAO,MAAMC,MAAM,GAAGA,CAAA,KAAM;EACxB,MAAMC,UAAU,GAAGjB,UAAU,CAACa,UAAU,CAAC;EACzC,IAAI,CAACI,UAAU,EAAE;IACb,MAAMC,KAAK,CACP,0FACJ,CAAC;EACL;EACA,OAAOD,UAAU;AACrB,CAAC;AAgBD,OAAO,MAAME,OAAO,gBAAGtB,KAAK,CAACuB,IAAI,CAC7B,CAAC;EAAEC,cAAc,GAAG,EAAE;EAAEC,MAAM,GAAG,EAAE;EAAEC,SAAS,GAAG,EAAE;EAAEC;AAAmB,CAAC,KAAK;EAC1E,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGvB,QAAQ,CAAQ;IACtCwB,OAAO,EAAE,EAAE;IACXJ;EACJ,CAAC,CAAC;EAEF,MAAMK,WAAW,GAAG7B,WAAW,CAAE8B,SAAyB,IAAK;IAC3DH,QAAQ,CAACD,KAAK,IAAI;MACd,IAAIA,KAAK,CAACF,SAAS,CAACO,SAAS,CAACC,CAAC,IAAIA,CAAC,KAAKF,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE;QACtD,OAAOJ,KAAK;MAChB;MAEA,OAAO;QACH,GAAGA,KAAK;QACRF,SAAS,EAAE,CAAC,GAAGE,KAAK,CAACF,SAAS,EAAEM,SAAS;MAC7C,CAAC;IACL,CAAC,CAAC;EACN,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMG,SAAS,GAAGjC,WAAW,CAAEkC,OAAoB,IAAK;IACpDP,QAAQ,CAACD,KAAK,IAAI;MACd,OAAO;QACH,GAAGA,KAAK;QACRE,OAAO,EAAE,CAAC,GAAGF,KAAK,CAACE,OAAO,EAAEM,OAAO;MACvC,CAAC;IACL,CAAC,CAAC;EACN,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMhB,UAAU,GAAGf,OAAO,CACtB,OAAO;IACH,GAAGuB,KAAK;IACRG,WAAW;IACXI;EACJ,CAAC,CAAC,EACF,CAACP,KAAK,CACV,CAAC;EAED,MAAMS,SAAS,GAAGhC,OAAO,CAAC,MAAM;IAC5B,OAAO,SAASgC,SAASA,CAAA,EAAG;MACxB,MAAMC,MAAM,GAAGvB,SAAS,CAAC,CAAC;MAC1B,MAAMwB,YAAY,GAAG3B,eAAe,CAAC,CAAC;MACtC,MAAM4B,gBAAgB,GAAGD,YAAY,CAACd,MAAM;MAC5C,MAAMgB,cAAc,GAAG,CAAC,GAAGhB,MAAM,EAAE,GAAGe,gBAAgB,CAAC;MAEvDpC,SAAS,CAAC,MAAM;QACZkC,MAAM,CAACI,SAAS,CAACD,cAAc,CAAC;MACpC,CAAC,EAAE,CAACA,cAAc,CAACE,MAAM,CAAC,CAAC;MAE3B,OAAO,IAAI;IACf,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,SAAS,GAAGvC,OAAO,CAAC,MAAM;IAC5B,oBAAOL,KAAK,CAACuB,IAAI,CACbhB,OAAO,CAAC,IAAIqB,KAAK,CAACF,SAAS,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;MAAEC;IAAwB,CAAC,KAAK;MACjE,oBAAO3B,KAAA,CAAA6C,aAAA,CAACpC,cAAc;QAACqC,IAAI,EAAEtB;MAAe,GAAEG,QAAyB,CAAC;IAC5E,CAAC,CACL,CAAC;EACL,CAAC,EAAE,CAACC,KAAK,CAACF,SAAS,CAACiB,MAAM,CAAC,CAA0B;EAErDC,SAAS,CAAC1B,WAAW,GAAG,WAAW;EAEnC,oBACIlB,KAAA,CAAA6C,aAAA,CAAC7B,UAAU,CAAC+B,QAAQ;IAACC,KAAK,EAAE5B;EAAW,GAClCO,QAAQ,eACT3B,KAAA,CAAA6C,aAAA,CAAChC,YAAY,qBACTb,KAAA,CAAA6C,aAAA,CAACD,SAAS,qBACN5C,KAAA,CAAA6C,aAAA,CAACnC,eAAe,QAAEkB,KAAK,CAACE,OAAyB,CAAC,eAClD9B,KAAA,CAAA6C,aAAA,CAACpC,cAAc;IAACqC,IAAI,EAAEtB;EAAe,gBACjCxB,KAAA,CAAA6C,aAAA,CAAClC,gBAAgB,qBACbX,KAAA,CAAA6C,aAAA,CAACR,SAAS,MAAE,CAAC,eACbrC,KAAA,CAAA6C,aAAA,CAAC/B,YAAY,MAAE,CACD,CACN,CACT,CACD,CACG,CAAC;AAE9B,CACJ,CAAC;AAEDQ,OAAO,CAACJ,WAAW,GAAG,SAAS;AAE/B,OAAO,MAAM+B,GAAG,GAAGA,CAAC;EAAEC,UAAU;EAAE,GAAGC;AAAgB,CAAC,KAAK;EACvD,oBACInD,KAAA,CAAA6C,aAAA,CAACrC,mBAAmB;IAAC0C,UAAU,EAAEA;EAAW,gBACxClD,KAAA,CAAA6C,aAAA,CAACvB,OAAO,EAAA8B,MAAA,CAAAC,MAAA;IAACH,UAAU,EAAEA;EAAW,GAAKC,KAAK,CAAG,CAC5B,CAAC;AAE9B,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"App.js","sources":["../src/App.tsx"],"sourcesContent":["import React, {\n createContext,\n Fragment,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState\n} from \"react\";\nimport {\n compose,\n CompositionProvider,\n Decorator,\n DecoratorsCollection,\n GenericComponent\n} from \"@webiny/react-composition\";\nimport { PluginsProvider } from \"./core/Plugins.js\";\nimport { RouterWithConfig, useRouterConfig } from \"./config/RouterConfig.js\";\nimport { AppContainer } from \"./AppContainer.js\";\nimport { RouteContent } from \"~/presentation/router/components/RouteContent.js\";\nimport { useRouter } from \"~/router.js\";\n\ninterface State {\n plugins: React.JSX.Element[];\n providers: Decorator<GenericComponent<ProviderProps>>[];\n}\n\ninterface AppContext extends State {\n addProvider(hoc: Decorator<GenericComponent<ProviderProps>>): void;\n addPlugin(plugin: React.ReactNode): void;\n}\n\nconst AppContext = createContext<AppContext | undefined>(undefined);\n\nAppContext.displayName = \"AppContext\";\n\nexport const useApp = () => {\n const appContext = useContext(AppContext);\n if (!appContext) {\n throw Error(\n `AppContext provider was not found. Are you using the \"useApp()\" hook in the right place?`\n );\n }\n return appContext;\n};\n\nexport interface AppProps {\n routes?: Array<any>;\n plugins?: any[];\n providers?: Array<Decorator<GenericComponent<ProviderProps>>>;\n decorators?: DecoratorsCollection;\n children?: React.ReactNode | React.ReactNode[];\n}\n\ninterface ProviderProps {\n children: React.ReactNode;\n}\n\ntype ComponentWithChildren = React.ComponentType<{ children?: React.ReactNode }>;\n\nexport const AppBase = React.memo(\n ({ routes = [], plugins = [], providers = [], children }: AppProps) => {\n const [state, setState] = useState<State>({\n plugins,\n providers\n });\n\n const addProvider = useCallback((component: Decorator<any>) => {\n setState(state => {\n if (state.providers.findIndex(m => m === component) > -1) {\n return state;\n }\n\n return {\n ...state,\n providers: [...state.providers, component]\n };\n });\n }, []);\n\n const addPlugin = useCallback((element: React.JSX.Element) => {\n setState(state => {\n return {\n ...state,\n plugins: [...state.plugins, element]\n };\n });\n }, []);\n\n const appContext = useMemo(\n () => ({\n ...state,\n addProvider,\n addPlugin\n }),\n [state]\n );\n\n const AppRouter = useMemo(() => {\n return function AppRouter() {\n const router = useRouter();\n const routerConfig = useRouterConfig();\n const routesFromConfig = routerConfig.routes;\n const combinedRoutes = [...routes, ...routesFromConfig];\n\n useEffect(() => {\n router.setRoutes(combinedRoutes);\n }, [combinedRoutes.length]);\n\n return null;\n };\n }, []);\n\n const Providers = useMemo(() => {\n return React.memo(\n compose(...(state.providers || []))(({ children }: ProviderProps) => {\n return <>{children}</>;\n })\n );\n }, [state.providers.length]) as ComponentWithChildren;\n\n Providers.displayName = \"Providers\";\n\n return (\n <AppContext.Provider value={appContext}>\n {children}\n <AppContainer>\n <Providers>\n <PluginsProvider>\n {state.plugins.map((plugin, index) => (\n <Fragment key={index}>{plugin}</Fragment>\n ))}\n </PluginsProvider>\n <RouterWithConfig>\n <AppRouter />\n <RouteContent />\n </RouterWithConfig>\n </Providers>\n </AppContainer>\n </AppContext.Provider>\n );\n }\n);\n\nAppBase.displayName = \"AppBase\";\n\nexport const App = ({ decorators, ...props }: AppProps) => {\n return (\n <CompositionProvider decorators={decorators}>\n <AppBase decorators={decorators} {...props} />\n </CompositionProvider>\n );\n};\n"],"names":["AppContext","createContext","undefined","useApp","appContext","useContext","Error","AppBase","React","routes","plugins","providers","children","state","setState","useState","addProvider","useCallback","component","m","addPlugin","element","useMemo","AppRouter","router","useRouter","routerConfig","useRouterConfig","routesFromConfig","combinedRoutes","useEffect","Providers","compose","AppContainer","PluginsProvider","plugin","index","Fragment","RouterWithConfig","RouteContent","App","decorators","props","CompositionProvider"],"mappings":";;;;;;;AAgCA,MAAMA,aAAa,WAAHA,GAAGC,cAAsCC;AAEzDF,WAAW,WAAW,GAAG;AAElB,MAAMG,SAAS;IAClB,MAAMC,aAAaC,WAAWL;IAC9B,IAAI,CAACI,YACD,MAAME,MACF;IAGR,OAAOF;AACX;AAgBO,MAAMG,UAAU,WAAHA,GAAGC,MAAAA,IAAU,CAC7B,CAAC,EAAEC,SAAS,EAAE,EAAEC,UAAU,EAAE,EAAEC,YAAY,EAAE,EAAEC,QAAQ,EAAY;IAC9D,MAAM,CAACC,OAAOC,SAAS,GAAGC,SAAgB;QACtCL;QACAC;IACJ;IAEA,MAAMK,cAAcC,YAAY,CAACC;QAC7BJ,SAASD,CAAAA;YACL,IAAIA,MAAM,SAAS,CAAC,SAAS,CAACM,CAAAA,IAAKA,MAAMD,aAAa,IAClD,OAAOL;YAGX,OAAO;gBACH,GAAGA,KAAK;gBACR,WAAW;uBAAIA,MAAM,SAAS;oBAAEK;iBAAU;YAC9C;QACJ;IACJ,GAAG,EAAE;IAEL,MAAME,YAAYH,YAAY,CAACI;QAC3BP,SAASD,CAAAA,QACE;gBACH,GAAGA,KAAK;gBACR,SAAS;uBAAIA,MAAM,OAAO;oBAAEQ;iBAAQ;YACxC;IAER,GAAG,EAAE;IAEL,MAAMjB,aAAakB,QACf,IAAO;YACH,GAAGT,KAAK;YACRG;YACAI;QACJ,IACA;QAACP;KAAM;IAGX,MAAMU,YAAYD,QAAQ,IACf;YACH,MAAME,SAASC;YACf,MAAMC,eAAeC;YACrB,MAAMC,mBAAmBF,aAAa,MAAM;YAC5C,MAAMG,iBAAiB;mBAAIpB;mBAAWmB;aAAiB;YAEvDE,UAAU;gBACNN,OAAO,SAAS,CAACK;YACrB,GAAG;gBAACA,eAAe,MAAM;aAAC;YAE1B,OAAO;QACX,GACD,EAAE;IAEL,MAAME,YAAYT,QAAQ,IACf,WAAP,GAAOd,MAAAA,IAAU,CACbwB,WAAYnB,MAAM,SAAS,IAAI,EAAE,EAAG,CAAC,EAAED,QAAQ,EAAiB,GACrD,WAAP,GAAO,0CAAGA,aAGnB;QAACC,MAAM,SAAS,CAAC,MAAM;KAAC;IAE3BkB,UAAU,WAAW,GAAG;IAExB,OAAO,WAAP,GACI,oBAAC/B,WAAW,QAAQ;QAAC,OAAOI;OACvBQ,UAAAA,WAAAA,GACD,oBAACqB,cAAYA,MAAAA,WAAAA,GACT,oBAACF,WAAAA,MAAAA,WAAAA,GACG,oBAACG,iBAAeA,MACXrB,MAAM,OAAO,CAAC,GAAG,CAAC,CAACsB,QAAQC,QAAAA,WAAAA,GACxB,oBAACC,UAAQA;YAAC,KAAKD;WAAQD,WAAAA,WAAAA,GAG/B,oBAACG,kBAAgBA,MAAAA,WAAAA,GACb,oBAACf,WAAAA,OAAAA,WAAAA,GACD,oBAACgB,cAAYA;AAMrC;AAGJhC,QAAQ,WAAW,GAAG;AAEf,MAAMiC,MAAM,CAAC,EAAEC,UAAU,EAAE,GAAGC,OAAiB,GAC3C,WAAP,GACI,oBAACC,qBAAmBA;QAAC,YAAYF;qBAC7B,oBAAClC,SAAOA;QAAC,YAAYkC;QAAa,GAAGC,KAAK"}
package/AppContainer.js CHANGED
@@ -1,9 +1,6 @@
1
- import React from "react";
1
+ import react from "react";
2
2
  import { makeDecoratable } from "@webiny/react-composition";
3
- export const AppContainer = makeDecoratable("AppContainer", ({
4
- children
5
- }) => {
6
- return /*#__PURE__*/React.createElement(React.Fragment, null, children);
7
- });
3
+ const AppContainer = makeDecoratable("AppContainer", ({ children })=>/*#__PURE__*/ react.createElement(react.Fragment, null, children));
4
+ export { AppContainer };
8
5
 
9
6
  //# sourceMappingURL=AppContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","makeDecoratable","AppContainer","children","createElement","Fragment"],"sources":["AppContainer.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\n\nexport interface AppContentProps {\n children: React.ReactNode;\n}\n\nexport const AppContainer = makeDecoratable(\"AppContainer\", ({ children }: AppContentProps) => {\n return <>{children}</>;\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,QAAQ,2BAA2B;AAM3D,OAAO,MAAMC,YAAY,GAAGD,eAAe,CAAC,cAAc,EAAE,CAAC;EAAEE;AAA0B,CAAC,KAAK;EAC3F,oBAAOH,KAAA,CAAAI,aAAA,CAAAJ,KAAA,CAAAK,QAAA,QAAGF,QAAW,CAAC;AAC1B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"AppContainer.js","sources":["../src/AppContainer.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\n\nexport interface AppContentProps {\n children: React.ReactNode;\n}\n\nexport const AppContainer = makeDecoratable(\"AppContainer\", ({ children }: AppContentProps) => {\n return <>{children}</>;\n});\n"],"names":["AppContainer","makeDecoratable","children"],"mappings":";;AAOO,MAAMA,eAAeC,gBAAgB,gBAAgB,CAAC,EAAEC,QAAQ,EAAmB,GAC/E,WAAP,GAAO,0CAAGA"}
@@ -1,23 +1,17 @@
1
1
  import invariant from "invariant";
2
2
  import { plugins } from "@webiny/plugins";
3
3
  import get from "lodash/get.js";
4
- export const Image = ({
5
- preset: presetName,
6
- ...props
7
- }) => {
8
- const plugin = plugins.byName("image-component");
9
- if (!plugin) {
10
- throw new Error(`Image component plugin (type "image-component") not defined.`);
11
- }
12
- if (presetName) {
13
- const preset = get(plugin, `presets.${presetName}`);
14
- invariant(preset, `Transform preset "${presetName}" not found.`);
15
- props.transform = preset;
16
- }
17
- if (props.transform) {
18
- props.src = plugin.getImageSrc(props);
19
- }
20
- return plugin.render(props);
4
+ const Image = ({ preset: presetName, ...props })=>{
5
+ const plugin = plugins.byName("image-component");
6
+ if (!plugin) throw new Error('Image component plugin (type "image-component") not defined.');
7
+ if (presetName) {
8
+ const preset = get(plugin, `presets.${presetName}`);
9
+ invariant(preset, `Transform preset "${presetName}" not found.`);
10
+ props.transform = preset;
11
+ }
12
+ if (props.transform) props.src = plugin.getImageSrc(props);
13
+ return plugin.render(props);
21
14
  };
15
+ export { Image };
22
16
 
23
17
  //# sourceMappingURL=Image.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["invariant","plugins","get","Image","preset","presetName","props","plugin","byName","Error","transform","src","getImageSrc","render"],"sources":["Image.tsx"],"sourcesContent":["import invariant from \"invariant\";\nimport { plugins } from \"@webiny/plugins\";\nimport get from \"lodash/get.js\";\nimport type { ImageComponentPlugin, ImageProps } from \"~/types.js\";\n\nexport const Image = ({ preset: presetName, ...props }: ImageProps) => {\n const plugin = plugins.byName<ImageComponentPlugin>(\"image-component\");\n if (!plugin) {\n throw new Error(`Image component plugin (type \"image-component\") not defined.`);\n }\n\n if (presetName) {\n const preset = get(plugin, `presets.${presetName}`);\n invariant(preset, `Transform preset \"${presetName}\" not found.`);\n props.transform = preset;\n }\n\n if (props.transform) {\n props.src = plugin.getImageSrc(props);\n }\n\n return plugin.render(props);\n};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,WAAW;AACjC,SAASC,OAAO,QAAQ,iBAAiB;AACzC,OAAOC,GAAG,MAAM,eAAe;AAG/B,OAAO,MAAMC,KAAK,GAAGA,CAAC;EAAEC,MAAM,EAAEC,UAAU;EAAE,GAAGC;AAAkB,CAAC,KAAK;EACnE,MAAMC,MAAM,GAAGN,OAAO,CAACO,MAAM,CAAuB,iBAAiB,CAAC;EACtE,IAAI,CAACD,MAAM,EAAE;IACT,MAAM,IAAIE,KAAK,CAAC,8DAA8D,CAAC;EACnF;EAEA,IAAIJ,UAAU,EAAE;IACZ,MAAMD,MAAM,GAAGF,GAAG,CAACK,MAAM,EAAE,WAAWF,UAAU,EAAE,CAAC;IACnDL,SAAS,CAACI,MAAM,EAAE,qBAAqBC,UAAU,cAAc,CAAC;IAChEC,KAAK,CAACI,SAAS,GAAGN,MAAM;EAC5B;EAEA,IAAIE,KAAK,CAACI,SAAS,EAAE;IACjBJ,KAAK,CAACK,GAAG,GAAGJ,MAAM,CAACK,WAAW,CAACN,KAAK,CAAC;EACzC;EAEA,OAAOC,MAAM,CAACM,MAAM,CAACP,KAAK,CAAC;AAC/B,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"components/Image.js","sources":["../../src/components/Image.tsx"],"sourcesContent":["import invariant from \"invariant\";\nimport { plugins } from \"@webiny/plugins\";\nimport get from \"lodash/get.js\";\nimport type { ImageComponentPlugin, ImageProps } from \"~/types.js\";\n\nexport const Image = ({ preset: presetName, ...props }: ImageProps) => {\n const plugin = plugins.byName<ImageComponentPlugin>(\"image-component\");\n if (!plugin) {\n throw new Error(`Image component plugin (type \"image-component\") not defined.`);\n }\n\n if (presetName) {\n const preset = get(plugin, `presets.${presetName}`);\n invariant(preset, `Transform preset \"${presetName}\" not found.`);\n props.transform = preset;\n }\n\n if (props.transform) {\n props.src = plugin.getImageSrc(props);\n }\n\n return plugin.render(props);\n};\n"],"names":["Image","presetName","props","plugin","plugins","Error","preset","get","invariant"],"mappings":";;;AAKO,MAAMA,QAAQ,CAAC,EAAE,QAAQC,UAAU,EAAE,GAAGC,OAAmB;IAC9D,MAAMC,SAASC,QAAQ,MAAM,CAAuB;IACpD,IAAI,CAACD,QACD,MAAM,IAAIE,MAAM;IAGpB,IAAIJ,YAAY;QACZ,MAAMK,SAASC,IAAIJ,QAAQ,CAAC,QAAQ,EAAEF,YAAY;QAClDO,UAAUF,QAAQ,CAAC,kBAAkB,EAAEL,WAAW,YAAY,CAAC;QAC/DC,MAAM,SAAS,GAAGI;IACtB;IAEA,IAAIJ,MAAM,SAAS,EACfA,MAAM,GAAG,GAAGC,OAAO,WAAW,CAACD;IAGnC,OAAOC,OAAO,MAAM,CAACD;AACzB"}
@@ -1,3 +1 @@
1
1
  export { Image } from "./Image.js";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1,33 +1,28 @@
1
- import React from "react";
1
+ import react from "react";
2
2
  import { makeDecoratable } from "@webiny/react-composition";
3
3
  import { Property, useIdGenerator } from "@webiny/react-properties";
4
- export const Route = makeDecoratable("Route", ({
5
- route,
6
- element,
7
- remove,
8
- before,
9
- after
10
- }) => {
11
- const name = route.name;
12
- const getId = useIdGenerator("Route");
13
- const placeAfter = after !== undefined ? getId(after) : undefined;
14
- const placeBefore = before !== undefined ? getId(before) : undefined;
15
- return /*#__PURE__*/React.createElement(Property, {
16
- id: getId(name),
17
- name: "routes",
18
- remove: remove,
19
- array: true,
20
- before: placeBefore,
21
- after: placeAfter
22
- }, /*#__PURE__*/React.createElement(Property, {
23
- id: getId(name, "route"),
24
- name: "route",
25
- value: route
26
- }), /*#__PURE__*/React.createElement(Property, {
27
- id: getId(name, "element"),
28
- name: "element",
29
- value: element
30
- }));
4
+ const Route = makeDecoratable("Route", ({ route, element, remove, before, after })=>{
5
+ const name = route.name;
6
+ const getId = useIdGenerator("Route");
7
+ const placeAfter = void 0 !== after ? getId(after) : void 0;
8
+ const placeBefore = void 0 !== before ? getId(before) : void 0;
9
+ return /*#__PURE__*/ react.createElement(Property, {
10
+ id: getId(name),
11
+ name: "routes",
12
+ remove: remove,
13
+ array: true,
14
+ before: placeBefore,
15
+ after: placeAfter
16
+ }, /*#__PURE__*/ react.createElement(Property, {
17
+ id: getId(name, "route"),
18
+ name: "route",
19
+ value: route
20
+ }), /*#__PURE__*/ react.createElement(Property, {
21
+ id: getId(name, "element"),
22
+ name: "element",
23
+ value: element
24
+ }));
31
25
  });
26
+ export { Route };
32
27
 
33
28
  //# sourceMappingURL=Route.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","makeDecoratable","Property","useIdGenerator","Route","route","element","remove","before","after","name","getId","placeAfter","undefined","placeBefore","createElement","id","array","value"],"sources":["Route.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\nimport { Property, useIdGenerator } from \"@webiny/react-properties\";\nimport type { Route as BaseRoute } from \"~/router.js\";\n\nexport interface RouteProps {\n route: BaseRoute<any>;\n element: React.ReactElement;\n remove?: boolean;\n before?: string;\n after?: string;\n}\n\nexport type RouteConfig = Pick<RouteProps, \"route\" | \"element\">;\n\nexport const Route = makeDecoratable(\n \"Route\",\n ({ route, element, remove, before, after }: RouteProps) => {\n const name = route.name;\n\n const getId = useIdGenerator(\"Route\");\n\n const placeAfter = after !== undefined ? getId(after) : undefined;\n const placeBefore = before !== undefined ? getId(before) : undefined;\n\n return (\n <Property\n id={getId(name)}\n name={\"routes\"}\n remove={remove}\n array={true}\n before={placeBefore}\n after={placeAfter}\n >\n <Property id={getId(name, \"route\")} name={\"route\"} value={route} />\n <Property id={getId(name, \"element\")} name={\"element\"} value={element} />\n </Property>\n );\n }\n);\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,QAAQ,EAAEC,cAAc,QAAQ,0BAA0B;AAanE,OAAO,MAAMC,KAAK,GAAGH,eAAe,CAChC,OAAO,EACP,CAAC;EAAEI,KAAK;EAAEC,OAAO;EAAEC,MAAM;EAAEC,MAAM;EAAEC;AAAkB,CAAC,KAAK;EACvD,MAAMC,IAAI,GAAGL,KAAK,CAACK,IAAI;EAEvB,MAAMC,KAAK,GAAGR,cAAc,CAAC,OAAO,CAAC;EAErC,MAAMS,UAAU,GAAGH,KAAK,KAAKI,SAAS,GAAGF,KAAK,CAACF,KAAK,CAAC,GAAGI,SAAS;EACjE,MAAMC,WAAW,GAAGN,MAAM,KAAKK,SAAS,GAAGF,KAAK,CAACH,MAAM,CAAC,GAAGK,SAAS;EAEpE,oBACIb,KAAA,CAAAe,aAAA,CAACb,QAAQ;IACLc,EAAE,EAAEL,KAAK,CAACD,IAAI,CAAE;IAChBA,IAAI,EAAE,QAAS;IACfH,MAAM,EAAEA,MAAO;IACfU,KAAK,EAAE,IAAK;IACZT,MAAM,EAAEM,WAAY;IACpBL,KAAK,EAAEG;EAAW,gBAElBZ,KAAA,CAAAe,aAAA,CAACb,QAAQ;IAACc,EAAE,EAAEL,KAAK,CAACD,IAAI,EAAE,OAAO,CAAE;IAACA,IAAI,EAAE,OAAQ;IAACQ,KAAK,EAAEb;EAAM,CAAE,CAAC,eACnEL,KAAA,CAAAe,aAAA,CAACb,QAAQ;IAACc,EAAE,EAAEL,KAAK,CAACD,IAAI,EAAE,SAAS,CAAE;IAACA,IAAI,EAAE,SAAU;IAACQ,KAAK,EAAEZ;EAAQ,CAAE,CAClE,CAAC;AAEnB,CACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"config/RouterConfig/Route.js","sources":["../../../src/config/RouterConfig/Route.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\nimport { Property, useIdGenerator } from \"@webiny/react-properties\";\nimport type { Route as BaseRoute } from \"~/router.js\";\n\nexport interface RouteProps {\n route: BaseRoute<any>;\n element: React.ReactElement;\n remove?: boolean;\n before?: string;\n after?: string;\n}\n\nexport type RouteConfig = Pick<RouteProps, \"route\" | \"element\">;\n\nexport const Route = makeDecoratable(\n \"Route\",\n ({ route, element, remove, before, after }: RouteProps) => {\n const name = route.name;\n\n const getId = useIdGenerator(\"Route\");\n\n const placeAfter = after !== undefined ? getId(after) : undefined;\n const placeBefore = before !== undefined ? getId(before) : undefined;\n\n return (\n <Property\n id={getId(name)}\n name={\"routes\"}\n remove={remove}\n array={true}\n before={placeBefore}\n after={placeAfter}\n >\n <Property id={getId(name, \"route\")} name={\"route\"} value={route} />\n <Property id={getId(name, \"element\")} name={\"element\"} value={element} />\n </Property>\n );\n }\n);\n"],"names":["Route","makeDecoratable","route","element","remove","before","after","name","getId","useIdGenerator","placeAfter","undefined","placeBefore","Property"],"mappings":";;;AAeO,MAAMA,QAAQC,gBACjB,SACA,CAAC,EAAEC,KAAK,EAAEC,OAAO,EAAEC,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAc;IAClD,MAAMC,OAAOL,MAAM,IAAI;IAEvB,MAAMM,QAAQC,eAAe;IAE7B,MAAMC,aAAaJ,AAAUK,WAAVL,QAAsBE,MAAMF,SAASK;IACxD,MAAMC,cAAcP,AAAWM,WAAXN,SAAuBG,MAAMH,UAAUM;IAE3D,OAAO,WAAP,GACI,oBAACE,UAAQA;QACL,IAAIL,MAAMD;QACV,MAAM;QACN,QAAQH;QACR,OAAO;QACP,QAAQQ;QACR,OAAOF;qBAEP,oBAACG,UAAQA;QAAC,IAAIL,MAAMD,MAAM;QAAU,MAAM;QAAS,OAAOL;sBAC1D,oBAACW,UAAQA;QAAC,IAAIL,MAAMD,MAAM;QAAY,MAAM;QAAW,OAAOJ;;AAG1E"}
@@ -25,7 +25,5 @@ export declare const RouterConfig: (({ priority, children }: import("@webiny/rea
25
25
  displayName: string;
26
26
  }>) => (props: unknown) => React.JSX.Element;
27
27
  };
28
- useRouterConfig: () => {
29
- routes: RouteConfig[];
30
- };
28
+ useRouterConfig: typeof useRouterConfig;
31
29
  };
@@ -1,18 +1,19 @@
1
1
  import { createConfigurableComponent } from "@webiny/react-properties";
2
2
  import { Route } from "./RouterConfig/Route.js";
3
3
  const base = createConfigurableComponent("RouterConfig");
4
- export const RouterWithConfig = Object.assign(base.WithConfig, {
5
- displayName: "RouterWithConfig"
4
+ const RouterWithConfig = Object.assign(base.WithConfig, {
5
+ displayName: "RouterWithConfig"
6
6
  });
7
- export const useRouterConfig = () => {
8
- const baseConfig = base.useConfig();
9
- return {
10
- routes: baseConfig.routes ?? []
11
- };
7
+ const useRouterConfig = ()=>{
8
+ const baseConfig = base.useConfig();
9
+ return {
10
+ routes: baseConfig.routes ?? []
11
+ };
12
12
  };
13
- export const RouterConfig = Object.assign(base.Config, {
14
- Route,
15
- useRouterConfig
13
+ const RouterConfig = Object.assign(base.Config, {
14
+ Route: Route,
15
+ useRouterConfig: useRouterConfig
16
16
  });
17
+ export { RouterConfig, RouterWithConfig, useRouterConfig };
17
18
 
18
19
  //# sourceMappingURL=RouterConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createConfigurableComponent","Route","base","RouterWithConfig","Object","assign","WithConfig","displayName","useRouterConfig","baseConfig","useConfig","routes","RouterConfig","Config"],"sources":["RouterConfig.tsx"],"sourcesContent":["import { createConfigurableComponent } from \"@webiny/react-properties\";\nimport { Route, type RouteConfig } from \"./RouterConfig/Route.js\";\n\nconst base = createConfigurableComponent<RouterConfig>(\"RouterConfig\");\n\nexport const RouterWithConfig = Object.assign(base.WithConfig, {\n displayName: \"RouterWithConfig\"\n});\n\ninterface RouterConfig {\n routes: RouteConfig[];\n}\n\nexport const useRouterConfig = () => {\n const baseConfig = base.useConfig();\n\n return {\n routes: baseConfig.routes ?? []\n };\n};\n\nexport const RouterConfig = Object.assign(base.Config, {\n Route,\n useRouterConfig\n});\n"],"mappings":"AAAA,SAASA,2BAA2B,QAAQ,0BAA0B;AACtE,SAASC,KAAK;AAEd,MAAMC,IAAI,GAAGF,2BAA2B,CAAe,cAAc,CAAC;AAEtE,OAAO,MAAMG,gBAAgB,GAAGC,MAAM,CAACC,MAAM,CAACH,IAAI,CAACI,UAAU,EAAE;EAC3DC,WAAW,EAAE;AACjB,CAAC,CAAC;AAMF,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM;EACjC,MAAMC,UAAU,GAAGP,IAAI,CAACQ,SAAS,CAAC,CAAC;EAEnC,OAAO;IACHC,MAAM,EAAEF,UAAU,CAACE,MAAM,IAAI;EACjC,CAAC;AACL,CAAC;AAED,OAAO,MAAMC,YAAY,GAAGR,MAAM,CAACC,MAAM,CAACH,IAAI,CAACW,MAAM,EAAE;EACnDZ,KAAK;EACLO;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"config/RouterConfig.js","sources":["../../src/config/RouterConfig.tsx"],"sourcesContent":["import { createConfigurableComponent } from \"@webiny/react-properties\";\nimport { Route, type RouteConfig } from \"./RouterConfig/Route.js\";\n\nconst base = createConfigurableComponent<RouterConfig>(\"RouterConfig\");\n\nexport const RouterWithConfig = Object.assign(base.WithConfig, {\n displayName: \"RouterWithConfig\"\n});\n\ninterface RouterConfig {\n routes: RouteConfig[];\n}\n\nexport const useRouterConfig = () => {\n const baseConfig = base.useConfig();\n\n return {\n routes: baseConfig.routes ?? []\n };\n};\n\nexport const RouterConfig = Object.assign(base.Config, {\n Route,\n useRouterConfig\n});\n"],"names":["base","createConfigurableComponent","RouterWithConfig","Object","useRouterConfig","baseConfig","RouterConfig","Route"],"mappings":";;AAGA,MAAMA,OAAOC,4BAA0C;AAEhD,MAAMC,mBAAmBC,OAAO,MAAM,CAACH,KAAK,UAAU,EAAE;IAC3D,aAAa;AACjB;AAMO,MAAMI,kBAAkB;IAC3B,MAAMC,aAAaL,KAAK,SAAS;IAEjC,OAAO;QACH,QAAQK,WAAW,MAAM,IAAI,EAAE;IACnC;AACJ;AAEO,MAAMC,eAAeH,OAAO,MAAM,CAACH,KAAK,MAAM,EAAE;IACnDO,OAAKA;IACLH,iBAAAA;AACJ"}
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.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"],"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 {};