@webiny/app 6.0.0-alpha.5 → 6.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/App.d.ts +3 -4
  2. package/App.js +23 -26
  3. package/App.js.map +1 -1
  4. package/README.md +7 -15
  5. package/apollo-client/InMemoryCache.js +2 -2
  6. package/apollo-client/InMemoryCache.js.map +1 -1
  7. package/components/Image.d.ts +1 -2
  8. package/components/Image.js +1 -1
  9. package/components/Image.js.map +1 -1
  10. package/components/index.d.ts +1 -2
  11. package/components/index.js +1 -2
  12. package/components/index.js.map +1 -1
  13. package/config/RouterConfig/Route.d.ts +9 -10
  14. package/config/RouterConfig/Route.js +5 -14
  15. package/config/RouterConfig/Route.js.map +1 -1
  16. package/config/RouterConfig.d.ts +10 -11
  17. package/config/RouterConfig.js +1 -1
  18. package/config/RouterConfig.js.map +1 -1
  19. package/contexts/Ui/index.js.map +1 -1
  20. package/core/DebounceRender.js +1 -1
  21. package/core/DebounceRender.js.map +1 -1
  22. package/core/Plugin.js +2 -2
  23. package/core/Plugin.js.map +1 -1
  24. package/core/Plugins.d.ts +1 -1
  25. package/core/Plugins.js +5 -4
  26. package/core/Plugins.js.map +1 -1
  27. package/core/Provider.d.ts +1 -1
  28. package/core/Provider.js +1 -1
  29. package/core/Provider.js.map +1 -1
  30. package/core/Routes.d.ts +2 -1
  31. package/core/Routes.js +11 -12
  32. package/core/Routes.js.map +1 -1
  33. package/core/createProviderPlugin.js +1 -1
  34. package/core/createProviderPlugin.js.map +1 -1
  35. package/errors/AuthenticationErrorEvent.d.ts +9 -0
  36. package/errors/AuthenticationErrorEvent.js +10 -0
  37. package/errors/AuthenticationErrorEvent.js.map +1 -0
  38. package/errors/NetworkErrorEvent.d.ts +15 -0
  39. package/errors/NetworkErrorEvent.js +10 -0
  40. package/errors/NetworkErrorEvent.js.map +1 -0
  41. package/errors/abstractions.d.ts +12 -0
  42. package/errors/abstractions.js +5 -0
  43. package/errors/abstractions.js.map +1 -0
  44. package/errors/index.d.ts +6 -0
  45. package/errors/index.js +6 -0
  46. package/errors/index.js.map +1 -0
  47. package/exports/admin/envConfig.d.ts +1 -0
  48. package/exports/admin/envConfig.js +3 -0
  49. package/exports/admin/envConfig.js.map +1 -0
  50. package/exports/admin/graphqlClient.d.ts +1 -0
  51. package/exports/admin/graphqlClient.js +3 -0
  52. package/exports/admin/graphqlClient.js.map +1 -0
  53. package/exports/admin/localStorage.d.ts +2 -0
  54. package/exports/admin/localStorage.js +4 -0
  55. package/exports/admin/localStorage.js.map +1 -0
  56. package/exports/admin/router.d.ts +4 -0
  57. package/exports/admin/router.js +6 -0
  58. package/exports/admin/router.js.map +1 -0
  59. package/exports/admin/security.d.ts +1 -0
  60. package/exports/admin/security.js +3 -0
  61. package/exports/admin/security.js.map +1 -0
  62. package/exports/admin.d.ts +6 -0
  63. package/exports/admin.js +8 -0
  64. package/exports/admin.js.map +1 -0
  65. package/features/envConfig/EnvConfig.d.ts +6 -0
  66. package/features/envConfig/EnvConfig.js +14 -0
  67. package/features/envConfig/EnvConfig.js.map +1 -0
  68. package/features/envConfig/abstractions.d.ts +27 -0
  69. package/features/envConfig/abstractions.js +4 -0
  70. package/features/envConfig/abstractions.js.map +1 -0
  71. package/features/envConfig/feature.d.ts +17 -0
  72. package/features/envConfig/feature.js +14 -0
  73. package/features/envConfig/feature.js.map +1 -0
  74. package/features/envConfig/index.d.ts +1 -0
  75. package/features/envConfig/index.js +3 -0
  76. package/features/envConfig/index.js.map +1 -0
  77. package/features/eventPublisher/EventPublisher.d.ts +8 -0
  78. package/features/eventPublisher/EventPublisher.js +27 -0
  79. package/features/eventPublisher/EventPublisher.js.map +1 -0
  80. package/features/eventPublisher/abstractions.d.ts +18 -0
  81. package/features/eventPublisher/abstractions.js +14 -0
  82. package/features/eventPublisher/abstractions.js.map +1 -0
  83. package/features/eventPublisher/feature.d.ts +1 -0
  84. package/features/eventPublisher/feature.js +11 -0
  85. package/features/eventPublisher/feature.js.map +1 -0
  86. package/features/eventPublisher/index.d.ts +3 -0
  87. package/features/eventPublisher/index.js +4 -0
  88. package/features/eventPublisher/index.js.map +1 -0
  89. package/features/graphqlClient/AuthenticationErrorPublishing.d.ts +13 -0
  90. package/features/graphqlClient/AuthenticationErrorPublishing.js +35 -0
  91. package/features/graphqlClient/AuthenticationErrorPublishing.js.map +1 -0
  92. package/features/graphqlClient/BatchingGraphQLClient.d.ts +18 -0
  93. package/features/graphqlClient/BatchingGraphQLClient.js +164 -0
  94. package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -0
  95. package/features/graphqlClient/FetchGraphQLClient.d.ts +10 -0
  96. package/features/graphqlClient/FetchGraphQLClient.js +62 -0
  97. package/features/graphqlClient/FetchGraphQLClient.js.map +1 -0
  98. package/features/graphqlClient/NetworkErrorPublishing.d.ts +14 -0
  99. package/features/graphqlClient/NetworkErrorPublishing.js +55 -0
  100. package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -0
  101. package/features/graphqlClient/RequestValue.d.ts +20 -0
  102. package/features/graphqlClient/RequestValue.js +42 -0
  103. package/features/graphqlClient/RequestValue.js.map +1 -0
  104. package/features/graphqlClient/RetryGraphQLClient.d.ts +18 -0
  105. package/features/graphqlClient/RetryGraphQLClient.js +54 -0
  106. package/features/graphqlClient/RetryGraphQLClient.js.map +1 -0
  107. package/features/graphqlClient/__tests__/GraphQLClient.test.d.ts +1 -0
  108. package/features/graphqlClient/__tests__/GraphQLClient.test.js +350 -0
  109. package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -0
  110. package/features/graphqlClient/abstractions.d.ts +17 -0
  111. package/features/graphqlClient/abstractions.js +4 -0
  112. package/features/graphqlClient/abstractions.js.map +1 -0
  113. package/features/graphqlClient/feature.d.ts +6 -0
  114. package/features/graphqlClient/feature.js +31 -0
  115. package/features/graphqlClient/feature.js.map +1 -0
  116. package/features/graphqlClient/index.d.ts +1 -0
  117. package/features/graphqlClient/index.js +3 -0
  118. package/features/graphqlClient/index.js.map +1 -0
  119. package/features/graphqlClient/types.d.ts +5 -0
  120. package/features/graphqlClient/types.js.map +1 -0
  121. package/features/localStorage/BrowserLocalStorageGateway.d.ts +9 -0
  122. package/features/localStorage/BrowserLocalStorageGateway.js +68 -0
  123. package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -0
  124. package/features/localStorage/LocalStorage.d.ts +12 -0
  125. package/features/localStorage/LocalStorage.js +31 -0
  126. package/features/localStorage/LocalStorage.js.map +1 -0
  127. package/features/localStorage/LocalStorageRepository.d.ts +20 -0
  128. package/features/localStorage/LocalStorageRepository.js +95 -0
  129. package/features/localStorage/LocalStorageRepository.js.map +1 -0
  130. package/features/localStorage/abstractions.d.ts +48 -0
  131. package/features/localStorage/abstractions.js +19 -0
  132. package/features/localStorage/abstractions.js.map +1 -0
  133. package/features/localStorage/feature.d.ts +12 -0
  134. package/features/localStorage/feature.js +34 -0
  135. package/features/localStorage/feature.js.map +1 -0
  136. package/features/localStorage/index.d.ts +1 -0
  137. package/features/localStorage/index.js +3 -0
  138. package/features/localStorage/index.js.map +1 -0
  139. package/features/router/HistoryRouterGateway.d.ts +18 -0
  140. package/features/router/HistoryRouterGateway.js +82 -0
  141. package/features/router/HistoryRouterGateway.js.map +1 -0
  142. package/features/router/HistoryRouterGateway.test.d.ts +1 -0
  143. package/features/router/HistoryRouterGateway.test.js +204 -0
  144. package/features/router/HistoryRouterGateway.test.js.map +1 -0
  145. package/features/router/Route.d.ts +19 -0
  146. package/features/router/Route.js +59 -0
  147. package/features/router/Route.js.map +1 -0
  148. package/features/router/RouteUrl.d.ts +85 -0
  149. package/features/router/RouteUrl.js +232 -0
  150. package/features/router/RouteUrl.js.map +1 -0
  151. package/features/router/Router.d.ts +45 -0
  152. package/features/router/Router.js +129 -0
  153. package/features/router/Router.js.map +1 -0
  154. package/features/router/RouterPresenter.d.ts +17 -0
  155. package/features/router/RouterPresenter.js +45 -0
  156. package/features/router/RouterPresenter.js.map +1 -0
  157. package/features/router/RouterRepository.d.ts +21 -0
  158. package/features/router/RouterRepository.js +71 -0
  159. package/features/router/RouterRepository.js.map +1 -0
  160. package/features/router/RouterRepository.test.d.ts +1 -0
  161. package/features/router/RouterRepository.test.js +154 -0
  162. package/features/router/RouterRepository.test.js.map +1 -0
  163. package/features/router/abstractions.d.ts +68 -0
  164. package/features/router/abstractions.js +15 -0
  165. package/features/router/abstractions.js.map +1 -0
  166. package/features/router/feature.d.ts +4 -0
  167. package/features/router/feature.js +18 -0
  168. package/features/router/feature.js.map +1 -0
  169. package/features/router/index.d.ts +1 -0
  170. package/features/router/index.js +3 -0
  171. package/features/router/index.js.map +1 -0
  172. package/helpers/InterfaceGenerator/date.d.ts +15 -0
  173. package/helpers/InterfaceGenerator/date.js +3 -0
  174. package/helpers/InterfaceGenerator/date.js.map +1 -0
  175. package/helpers/InterfaceGenerator/id.d.ts +23 -0
  176. package/helpers/InterfaceGenerator/id.js +3 -0
  177. package/helpers/InterfaceGenerator/id.js.map +1 -0
  178. package/helpers/InterfaceGenerator/identity.d.ts +10 -0
  179. package/helpers/InterfaceGenerator/identity.js +3 -0
  180. package/helpers/InterfaceGenerator/identity.js.map +1 -0
  181. package/helpers/InterfaceGenerator/index.d.ts +5 -0
  182. package/helpers/InterfaceGenerator/index.js +3 -0
  183. package/helpers/InterfaceGenerator/index.js.map +1 -0
  184. package/helpers/InterfaceGenerator/numeric.d.ts +12 -0
  185. package/helpers/InterfaceGenerator/numeric.js +3 -0
  186. package/helpers/InterfaceGenerator/numeric.js.map +1 -0
  187. package/helpers/InterfaceGenerator/truthful.d.ts +7 -0
  188. package/helpers/InterfaceGenerator/truthful.js +3 -0
  189. package/helpers/InterfaceGenerator/truthful.js.map +1 -0
  190. package/hooks/useAutocomplete/index.d.ts +1 -1
  191. package/hooks/useAutocomplete/index.js +1 -1
  192. package/hooks/useAutocomplete/index.js.map +1 -1
  193. package/hooks/useAutocomplete/useAutocomplete.js +3 -6
  194. package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
  195. package/hooks/useDataList/functions/getData.js +1 -1
  196. package/hooks/useDataList/functions/getData.js.map +1 -1
  197. package/hooks/useDataList/functions/getError.js +1 -1
  198. package/hooks/useDataList/functions/getError.js.map +1 -1
  199. package/hooks/useDataList/functions/getMeta.js +1 -1
  200. package/hooks/useDataList/functions/getMeta.js.map +1 -1
  201. package/hooks/useDataList/functions/index.d.ts +3 -3
  202. package/hooks/useDataList/functions/index.js +3 -3
  203. package/hooks/useDataList/functions/index.js.map +1 -1
  204. package/hooks/useDataList/index.d.ts +1 -1
  205. package/hooks/useDataList/index.js +1 -1
  206. package/hooks/useDataList/index.js.map +1 -1
  207. package/hooks/useDataList/useDataList.d.ts +0 -1
  208. package/hooks/useDataList/useDataList.js +6 -26
  209. package/hooks/useDataList/useDataList.js.map +1 -1
  210. package/hooks/useDataList/utils/index.d.ts +1 -2
  211. package/hooks/useDataList/utils/index.js +1 -2
  212. package/hooks/useDataList/utils/index.js.map +1 -1
  213. package/hooks/useDataList/utils/prepareLoadListParams.js +1 -1
  214. package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
  215. package/hooks/useHandlers.js.map +1 -1
  216. package/hooks/useRegisterLegacyPlugin.d.ts +1 -1
  217. package/hooks/useRegisterLegacyPlugin.js.map +1 -1
  218. package/hooks/useUi.d.ts +1 -1
  219. package/hooks/useUi.js +1 -1
  220. package/hooks/useUi.js.map +1 -1
  221. package/i18n/index.d.ts +1 -1
  222. package/i18n/index.js +1 -1
  223. package/i18n/index.js.map +1 -1
  224. package/index.d.ts +23 -15
  225. package/index.js +22 -14
  226. package/index.js.map +1 -1
  227. package/package.json +25 -23
  228. package/plugins/AddQuerySelectionPlugin.d.ts +1 -1
  229. package/plugins/AddQuerySelectionPlugin.js +1 -1
  230. package/plugins/AddQuerySelectionPlugin.js.map +1 -1
  231. package/plugins/ApolloDynamicLink.d.ts +1 -1
  232. package/plugins/ApolloDynamicLink.js.map +1 -1
  233. package/plugins/ConsoleLinkPlugin.d.ts +1 -1
  234. package/plugins/ConsoleLinkPlugin.js +1 -1
  235. package/plugins/ConsoleLinkPlugin.js.map +1 -1
  236. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +8 -13
  237. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +15 -26
  238. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
  239. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.d.ts +14 -0
  240. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js +31 -0
  241. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js.map +1 -0
  242. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.d.ts +2 -0
  243. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js +31 -0
  244. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js.map +1 -0
  245. package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +4 -5
  246. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +3 -3
  247. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
  248. package/plugins/NetworkErrorLinkPlugin/Typography.d.ts +8 -0
  249. package/plugins/NetworkErrorLinkPlugin/Typography.js +18 -0
  250. package/plugins/NetworkErrorLinkPlugin/Typography.js.map +1 -0
  251. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +3 -3
  252. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +4 -13
  253. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
  254. package/plugins/NetworkErrorLinkPlugin.d.ts +4 -1
  255. package/plugins/NetworkErrorLinkPlugin.js +47 -7
  256. package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
  257. package/plugins/OmitTypenameLinkPlugin.d.ts +1 -1
  258. package/plugins/OmitTypenameLinkPlugin.js +1 -1
  259. package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
  260. package/plugins/TenantHeaderLinkPlugin.d.ts +2 -2
  261. package/plugins/TenantHeaderLinkPlugin.js +2 -4
  262. package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
  263. package/plugins/components/Image.d.ts +6 -0
  264. package/plugins/components/Image.js +19 -0
  265. package/plugins/components/Image.js.map +1 -0
  266. package/plugins/image.d.ts +1 -1
  267. package/plugins/image.js +2 -2
  268. package/plugins/image.js.map +1 -1
  269. package/plugins/index.d.ts +3 -3
  270. package/plugins/index.js +1 -1
  271. package/plugins/index.js.map +1 -1
  272. package/presentation/localStorage/index.d.ts +3 -0
  273. package/presentation/localStorage/index.js +5 -0
  274. package/presentation/localStorage/index.js.map +1 -0
  275. package/presentation/localStorage/useLocalStorage.d.ts +6 -0
  276. package/presentation/localStorage/useLocalStorage.js +21 -0
  277. package/presentation/localStorage/useLocalStorage.js.map +1 -0
  278. package/presentation/localStorage/useLocalStorageValue.d.ts +1 -0
  279. package/presentation/localStorage/useLocalStorageValue.js +20 -0
  280. package/presentation/localStorage/useLocalStorageValue.js.map +1 -0
  281. package/presentation/localStorage/useLocalStorageValues.d.ts +5 -0
  282. package/presentation/localStorage/useLocalStorageValues.js +39 -0
  283. package/presentation/localStorage/useLocalStorageValues.js.map +1 -0
  284. package/presentation/router/RouteElementRegistry.d.ts +14 -0
  285. package/presentation/router/RouteElementRegistry.js +32 -0
  286. package/presentation/router/RouteElementRegistry.js.map +1 -0
  287. package/presentation/router/abstractions.d.ts +13 -0
  288. package/presentation/router/abstractions.js +4 -0
  289. package/presentation/router/abstractions.js.map +1 -0
  290. package/presentation/router/components/RouteContent.d.ts +2 -0
  291. package/presentation/router/components/RouteContent.js +17 -0
  292. package/presentation/router/components/RouteContent.js.map +1 -0
  293. package/presentation/router/components/RouteLink.d.ts +50 -0
  294. package/presentation/router/components/RouteLink.js +22 -0
  295. package/presentation/router/components/RouteLink.js.map +1 -0
  296. package/presentation/router/components/SimpleLink.d.ts +44 -0
  297. package/presentation/router/components/SimpleLink.js +30 -0
  298. package/presentation/router/components/SimpleLink.js.map +1 -0
  299. package/presentation/router/hooks/useRoute.d.ts +6 -0
  300. package/presentation/router/hooks/useRoute.js +30 -0
  301. package/presentation/router/hooks/useRoute.js.map +1 -0
  302. package/presentation/router/hooks/useRouter.d.ts +7 -0
  303. package/presentation/router/hooks/useRouter.js +26 -0
  304. package/presentation/router/hooks/useRouter.js.map +1 -0
  305. package/presentation/router/index.d.ts +4 -0
  306. package/presentation/router/index.js +5 -0
  307. package/presentation/router/index.js.map +1 -0
  308. package/presentation/router/types.d.ts +5 -0
  309. package/presentation/router/types.js +3 -0
  310. package/presentation/router/types.js.map +1 -0
  311. package/react-butterfiles/Files.js +3 -3
  312. package/react-butterfiles/Files.js.map +1 -1
  313. package/react-butterfiles/file.todo +1 -0
  314. package/react-butterfiles/index.d.ts +1 -1
  315. package/react-butterfiles/index.js +1 -1
  316. package/react-butterfiles/index.js.map +1 -1
  317. package/router.d.ts +5 -0
  318. package/router.js +8 -0
  319. package/router.js.map +1 -0
  320. package/shared/di/DiContainerProvider.d.ts +8 -0
  321. package/shared/di/DiContainerProvider.js +17 -0
  322. package/shared/di/DiContainerProvider.js.map +1 -0
  323. package/shared/di/createFeature.d.ts +11 -0
  324. package/shared/di/createFeature.js +11 -0
  325. package/shared/di/createFeature.js.map +1 -0
  326. package/shared/di/useFeature.d.ts +2 -0
  327. package/shared/di/useFeature.js +18 -0
  328. package/shared/di/useFeature.js.map +1 -0
  329. package/types.d.ts +7 -4
  330. package/types.js +1 -12
  331. package/types.js.map +1 -1
  332. package/utils/index.d.ts +2 -10
  333. package/utils/index.js +2 -10
  334. package/utils/index.js.map +1 -1
  335. package/utils/legacyPluginToReactComponent.js +1 -1
  336. package/utils/legacyPluginToReactComponent.js.map +1 -1
  337. package/components/Routes.d.ts +0 -2
  338. package/components/Routes.js +0 -36
  339. package/components/Routes.js.map +0 -1
  340. package/components/View.d.ts +0 -8
  341. package/components/View.js +0 -19
  342. package/components/View.js.map +0 -1
  343. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +0 -14
  344. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +0 -26
  345. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +0 -1
  346. package/hooks/useDataList/utils/types.d.ts +0 -40
  347. package/hooks/useDataList/utils/types.js.map +0 -1
  348. package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -10
  349. package/plugins/LocaleHeaderLinkPlugin.js +0 -32
  350. package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
  351. package/plugins/RoutePlugin.d.ts +0 -12
  352. package/plugins/RoutePlugin.js +0 -16
  353. package/plugins/RoutePlugin.js.map +0 -1
  354. package/plugins/ViewPlugin.d.ts +0 -14
  355. package/plugins/ViewPlugin.js +0 -19
  356. package/plugins/ViewPlugin.js.map +0 -1
  357. package/utils/getApiUrl.d.ts +0 -1
  358. package/utils/getApiUrl.js +0 -5
  359. package/utils/getApiUrl.js.map +0 -1
  360. package/utils/getGqlApiUrl.d.ts +0 -1
  361. package/utils/getGqlApiUrl.js +0 -6
  362. package/utils/getGqlApiUrl.js.map +0 -1
  363. package/utils/getHeadlessCmsGqlApiUrl.d.ts +0 -5
  364. package/utils/getHeadlessCmsGqlApiUrl.js +0 -12
  365. package/utils/getHeadlessCmsGqlApiUrl.js.map +0 -1
  366. package/utils/getLocaleCode.d.ts +0 -6
  367. package/utils/getLocaleCode.js +0 -33
  368. package/utils/getLocaleCode.js.map +0 -1
  369. package/utils/getPrerenderId.d.ts +0 -6
  370. package/utils/getPrerenderId.js +0 -5
  371. package/utils/getPrerenderId.js.map +0 -1
  372. package/utils/getTenantId.d.ts +0 -6
  373. package/utils/getTenantId.js +0 -45
  374. package/utils/getTenantId.js.map +0 -1
  375. package/utils/isLocalhost.d.ts +0 -1
  376. package/utils/isLocalhost.js +0 -7
  377. package/utils/isLocalhost.js.map +0 -1
  378. package/utils/isPrerendering.d.ts +0 -1
  379. package/utils/isPrerendering.js +0 -5
  380. package/utils/isPrerendering.js.map +0 -1
  381. /package/{hooks/useDataList/utils → features/graphqlClient}/types.js +0 -0
package/App.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
- import type { RouteProps } from "@webiny/react-router";
3
- import type { GenericComponent, Decorator, DecoratorsCollection } from "@webiny/react-composition";
2
+ import { Decorator, DecoratorsCollection, GenericComponent } from "@webiny/react-composition";
4
3
  interface State {
5
4
  plugins: JSX.Element[];
6
5
  providers: Decorator<GenericComponent<ProviderProps>>[];
@@ -13,7 +12,7 @@ declare const AppContext: React.Context<AppContext | undefined>;
13
12
  export declare const useApp: () => AppContext;
14
13
  export interface AppProps {
15
14
  debounceRender?: number;
16
- routes?: Array<RouteProps>;
15
+ routes?: Array<any>;
17
16
  providers?: Array<Decorator<GenericComponent<ProviderProps>>>;
18
17
  decorators?: DecoratorsCollection;
19
18
  children?: React.ReactNode | React.ReactNode[];
@@ -21,6 +20,6 @@ export interface AppProps {
21
20
  interface ProviderProps {
22
21
  children: React.ReactNode;
23
22
  }
24
- export declare const AppBase: ({ debounceRender, routes, providers, children }: AppProps) => React.JSX.Element;
23
+ export declare const AppBase: React.MemoExoticComponent<({ debounceRender, routes, providers, children }: AppProps) => React.JSX.Element>;
25
24
  export declare const App: ({ decorators, ...props }: AppProps) => React.JSX.Element;
26
25
  export {};
package/App.js CHANGED
@@ -1,11 +1,11 @@
1
- import React, { createContext, useContext, useMemo, useState, useCallback } from "react";
2
- import { BrowserRouter, Route } from "@webiny/react-router";
3
- import { CompositionProvider, compose } from "@webiny/react-composition";
4
- import { Routes as SortRoutes } from "./core/Routes";
5
- import { DebounceRender } from "./core/DebounceRender";
6
- import { PluginsProvider } from "./core/Plugins";
7
- import { RouterWithConfig, useRouterConfig } from "./config/RouterConfig";
8
- import { AppContainer } from "./AppContainer";
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";
4
+ import { PluginsProvider } from "./core/Plugins.js";
5
+ import { RouterWithConfig, useRouterConfig } from "./config/RouterConfig.js";
6
+ import { AppContainer } from "./AppContainer.js";
7
+ import { RouteContent } from "./presentation/router/components/RouteContent.js";
8
+ import { useRouter } from "./router.js";
9
9
  const AppContext = /*#__PURE__*/createContext(undefined);
10
10
  AppContext.displayName = "AppContext";
11
11
  export const useApp = () => {
@@ -15,7 +15,7 @@ export const useApp = () => {
15
15
  }
16
16
  return appContext;
17
17
  };
18
- export const AppBase = ({
18
+ export const AppBase = /*#__PURE__*/React.memo(({
19
19
  debounceRender = 50,
20
20
  routes = [],
21
21
  providers = [],
@@ -51,36 +51,33 @@ export const AppBase = ({
51
51
  }), [state]);
52
52
  const AppRouter = useMemo(() => {
53
53
  return function AppRouter() {
54
+ const router = useRouter();
54
55
  const routerConfig = useRouterConfig();
55
- const combinedRoutes = [...routes, ...routerConfig.routes].map(r => {
56
- return /*#__PURE__*/React.createElement(Route, {
57
- path: r.path,
58
- element: r.element,
59
- key: r.path
60
- });
61
- });
62
- return /*#__PURE__*/React.createElement(SortRoutes, {
63
- key: routes.length,
64
- routes: combinedRoutes
65
- });
56
+ const routesFromConfig = routerConfig.routes;
57
+ const combinedRoutes = [...routes, ...routesFromConfig];
58
+ useEffect(() => {
59
+ router.setRoutes(combinedRoutes);
60
+ }, [combinedRoutes.length]);
61
+ return null;
66
62
  };
67
- }, [routes]);
63
+ }, []);
68
64
  const Providers = useMemo(() => {
69
- return compose(...(state.providers || []))(({
65
+ return /*#__PURE__*/React.memo(compose(...(state.providers || []))(({
70
66
  children
71
67
  }) => {
72
68
  return /*#__PURE__*/React.createElement(DebounceRender, {
73
69
  wait: debounceRender
74
70
  }, children);
75
- });
71
+ }));
76
72
  }, [state.providers.length]);
77
73
  Providers.displayName = "Providers";
78
74
  return /*#__PURE__*/React.createElement(AppContext.Provider, {
79
75
  value: appContext
80
- }, children, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(BrowserRouter, null, /*#__PURE__*/React.createElement(Providers, null, /*#__PURE__*/React.createElement(PluginsProvider, null, state.plugins), /*#__PURE__*/React.createElement(DebounceRender, {
76
+ }, children, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(Providers, null, /*#__PURE__*/React.createElement(PluginsProvider, null, state.plugins), /*#__PURE__*/React.createElement(DebounceRender, {
81
77
  wait: debounceRender
82
- }, /*#__PURE__*/React.createElement(RouterWithConfig, null, /*#__PURE__*/React.createElement(AppRouter, null)))))));
83
- };
78
+ }, /*#__PURE__*/React.createElement(RouterWithConfig, null, /*#__PURE__*/React.createElement(AppRouter, null), /*#__PURE__*/React.createElement(RouteContent, null))))));
79
+ });
80
+ AppBase.displayName = "AppBase";
84
81
  export const App = ({
85
82
  decorators,
86
83
  ...props
package/App.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["React","createContext","useContext","useMemo","useState","useCallback","BrowserRouter","Route","CompositionProvider","compose","Routes","SortRoutes","DebounceRender","PluginsProvider","RouterWithConfig","useRouterConfig","AppContainer","AppContext","undefined","displayName","useApp","appContext","Error","AppBase","debounceRender","routes","providers","children","state","setState","plugins","addProvider","component","findIndex","m","addPlugin","element","AppRouter","routerConfig","combinedRoutes","map","r","createElement","path","key","length","Providers","wait","Provider","value","App","decorators","props","Object","assign"],"sources":["App.tsx"],"sourcesContent":["import React, { createContext, useContext, useMemo, useState, useCallback } from \"react\";\nimport type { RouteProps } from \"@webiny/react-router\";\nimport { BrowserRouter, Route } from \"@webiny/react-router\";\nimport type { GenericComponent, Decorator, DecoratorsCollection } from \"@webiny/react-composition\";\nimport { CompositionProvider, compose } from \"@webiny/react-composition\";\nimport { Routes as SortRoutes } from \"./core/Routes\";\nimport { DebounceRender } from \"./core/DebounceRender\";\nimport { PluginsProvider } from \"./core/Plugins\";\nimport { RouterWithConfig, useRouterConfig } from \"./config/RouterConfig\";\nimport { AppContainer } from \"./AppContainer\";\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<RouteProps>;\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 = ({\n debounceRender = 50,\n routes = [],\n providers = [],\n children\n}: 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 routerConfig = useRouterConfig();\n const combinedRoutes = [...routes, ...routerConfig.routes].map(r => {\n return <Route path={r.path} element={r.element} key={r.path} />;\n });\n\n return <SortRoutes key={routes.length} routes={combinedRoutes} />;\n };\n }, [routes]);\n\n const Providers = useMemo(() => {\n return compose(...(state.providers || []))(({ children }: ProviderProps) => {\n return <DebounceRender wait={debounceRender}>{children}</DebounceRender>;\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 <BrowserRouter>\n <Providers>\n <PluginsProvider>{state.plugins}</PluginsProvider>\n <DebounceRender wait={debounceRender}>\n <RouterWithConfig>\n <AppRouter />\n </RouterWithConfig>\n </DebounceRender>\n </Providers>\n </BrowserRouter>\n </AppContainer>\n </AppContext.Provider>\n );\n};\n\nexport const App = ({ decorators, ...props }: AppProps) => {\n return (\n <CompositionProvider decorators={decorators}>\n <AppBase decorators={decorators} {...props} />\n </CompositionProvider>\n );\n};\n"],"mappings":"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","ignoreList":[]}
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":"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","ignoreList":[]}
package/README.md CHANGED
@@ -1,19 +1,11 @@
1
1
  # @webiny/app
2
- [![](https://img.shields.io/npm/dw/@webiny/app.svg)](https://www.npmjs.com/package/@webiny/app)
3
- [![](https://img.shields.io/npm/v/@webiny/app.svg)](https://www.npmjs.com/package/@webiny/app)
4
- [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
5
- [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
6
2
 
7
- The base package for building Webiny and React powered web apps.
3
+ > [!NOTE]
4
+ > This package is part of the [Webiny](https://www.webiny.com) monorepo.
5
+ > It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
8
6
 
9
- For more information, please visit [the official docs](https://docs.webiny.com/docs/webiny/introduction).
10
-
11
- ## Install
12
- ```
13
- npm install --save @webiny/app
14
- ```
7
+ 📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
15
8
 
16
- Or if you prefer yarn:
17
- ```
18
- yarn add @webiny/app
19
- ```
9
+ ---
10
+
11
+ _This README file is automatically generated during the publish process._
@@ -1,7 +1,7 @@
1
1
  import { InMemoryCache as BaseInMemoryCache } from "apollo-cache-inmemory";
2
2
  import { plugins } from "@webiny/plugins";
3
- import { AddQuerySelectionPlugin } from "../plugins/AddQuerySelectionPlugin";
4
- import { ApolloLinkPlugin } from "../plugins/ApolloLinkPlugin";
3
+ import { AddQuerySelectionPlugin } from "../plugins/AddQuerySelectionPlugin.js";
4
+ import { ApolloLinkPlugin } from "../plugins/ApolloLinkPlugin.js";
5
5
  export class InMemoryCache extends BaseInMemoryCache {
6
6
  constructor(config) {
7
7
  super(config);
@@ -1 +1 @@
1
- {"version":3,"names":["InMemoryCache","BaseInMemoryCache","plugins","AddQuerySelectionPlugin","ApolloLinkPlugin","constructor","config","transformPlugins","byType","type","filter","pl","transformDocument","document","operationName","definitions","name","value","addSelectionToQuery"],"sources":["InMemoryCache.ts"],"sourcesContent":["import type { InMemoryCacheConfig } from \"apollo-cache-inmemory\";\nimport { InMemoryCache as BaseInMemoryCache } from \"apollo-cache-inmemory\";\nimport type { DocumentNode } from \"graphql\";\nimport { plugins } from \"@webiny/plugins\";\nimport { AddQuerySelectionPlugin } from \"../plugins/AddQuerySelectionPlugin\";\nimport { ApolloLinkPlugin } from \"../plugins/ApolloLinkPlugin\";\n\nexport class InMemoryCache extends BaseInMemoryCache {\n private readonly transformPlugins: AddQuerySelectionPlugin[];\n\n constructor(config?: InMemoryCacheConfig) {\n super(config);\n\n this.transformPlugins = plugins\n .byType<AddQuerySelectionPlugin>(ApolloLinkPlugin.type)\n .filter(pl => pl instanceof AddQuerySelectionPlugin);\n }\n\n public override transformDocument(document: DocumentNode): DocumentNode {\n // @ts-expect-error\n const operationName = document.definitions[0].name.value;\n\n for (const pl of this.transformPlugins) {\n pl.addSelectionToQuery(operationName, document);\n }\n\n return super.transformDocument(document);\n }\n}\n"],"mappings":"AACA,SAASA,aAAa,IAAIC,iBAAiB,QAAQ,uBAAuB;AAE1E,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,uBAAuB;AAChC,SAASC,gBAAgB;AAEzB,OAAO,MAAMJ,aAAa,SAASC,iBAAiB,CAAC;EAGjDI,WAAWA,CAACC,MAA4B,EAAE;IACtC,KAAK,CAACA,MAAM,CAAC;IAEb,IAAI,CAACC,gBAAgB,GAAGL,OAAO,CAC1BM,MAAM,CAA0BJ,gBAAgB,CAACK,IAAI,CAAC,CACtDC,MAAM,CAACC,EAAE,IAAIA,EAAE,YAAYR,uBAAuB,CAAC;EAC5D;EAEgBS,iBAAiBA,CAACC,QAAsB,EAAgB;IACpE;IACA,MAAMC,aAAa,GAAGD,QAAQ,CAACE,WAAW,CAAC,CAAC,CAAC,CAACC,IAAI,CAACC,KAAK;IAExD,KAAK,MAAMN,EAAE,IAAI,IAAI,CAACJ,gBAAgB,EAAE;MACpCI,EAAE,CAACO,mBAAmB,CAACJ,aAAa,EAAED,QAAQ,CAAC;IACnD;IAEA,OAAO,KAAK,CAACD,iBAAiB,CAACC,QAAQ,CAAC;EAC5C;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["InMemoryCache","BaseInMemoryCache","plugins","AddQuerySelectionPlugin","ApolloLinkPlugin","constructor","config","transformPlugins","byType","type","filter","pl","transformDocument","document","operationName","definitions","name","value","addSelectionToQuery"],"sources":["InMemoryCache.ts"],"sourcesContent":["import type { InMemoryCacheConfig } from \"apollo-cache-inmemory\";\nimport { InMemoryCache as BaseInMemoryCache } from \"apollo-cache-inmemory\";\nimport type { DocumentNode } from \"graphql\";\nimport { plugins } from \"@webiny/plugins\";\nimport { AddQuerySelectionPlugin } from \"../plugins/AddQuerySelectionPlugin.js\";\nimport { ApolloLinkPlugin } from \"../plugins/ApolloLinkPlugin.js\";\n\nexport class InMemoryCache extends BaseInMemoryCache {\n private readonly transformPlugins: AddQuerySelectionPlugin[];\n\n constructor(config?: InMemoryCacheConfig) {\n super(config);\n\n this.transformPlugins = plugins\n .byType<AddQuerySelectionPlugin>(ApolloLinkPlugin.type)\n .filter(pl => pl instanceof AddQuerySelectionPlugin);\n }\n\n public override transformDocument(document: DocumentNode): DocumentNode {\n // @ts-expect-error\n const operationName = document.definitions[0].name.value;\n\n for (const pl of this.transformPlugins) {\n pl.addSelectionToQuery(operationName, document);\n }\n\n return super.transformDocument(document);\n }\n}\n"],"mappings":"AACA,SAASA,aAAa,IAAIC,iBAAiB,QAAQ,uBAAuB;AAE1E,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,uBAAuB;AAChC,SAASC,gBAAgB;AAEzB,OAAO,MAAMJ,aAAa,SAASC,iBAAiB,CAAC;EAGjDI,WAAWA,CAACC,MAA4B,EAAE;IACtC,KAAK,CAACA,MAAM,CAAC;IAEb,IAAI,CAACC,gBAAgB,GAAGL,OAAO,CAC1BM,MAAM,CAA0BJ,gBAAgB,CAACK,IAAI,CAAC,CACtDC,MAAM,CAACC,EAAE,IAAIA,EAAE,YAAYR,uBAAuB,CAAC;EAC5D;EAEgBS,iBAAiBA,CAACC,QAAsB,EAAgB;IACpE;IACA,MAAMC,aAAa,GAAGD,QAAQ,CAACE,WAAW,CAAC,CAAC,CAAC,CAACC,IAAI,CAACC,KAAK;IAExD,KAAK,MAAMN,EAAE,IAAI,IAAI,CAACJ,gBAAgB,EAAE;MACpCI,EAAE,CAACO,mBAAmB,CAACJ,aAAa,EAAED,QAAQ,CAAC;IACnD;IAEA,OAAO,KAAK,CAACD,iBAAiB,CAACC,QAAQ,CAAC;EAC5C;AACJ","ignoreList":[]}
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
- import type { ImageProps } from "../types";
1
+ import type { ImageProps } from "../types.js";
3
2
  export declare const Image: ({ preset: presetName, ...props }: ImageProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
@@ -1,6 +1,6 @@
1
1
  import invariant from "invariant";
2
2
  import { plugins } from "@webiny/plugins";
3
- import get from "lodash/get";
3
+ import get from "lodash/get.js";
4
4
  export const Image = ({
5
5
  preset: presetName,
6
6
  ...props
@@ -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\";\nimport type { ImageComponentPlugin, ImageProps } from \"~/types\";\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,YAAY;AAG5B,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,"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,2 +1 @@
1
- export { Image } from "./Image";
2
- export { Routes } from "./Routes";
1
+ export { Image } from "./Image.js";
@@ -1,4 +1,3 @@
1
- export { Image } from "./Image";
2
- export { Routes } from "./Routes";
1
+ export { Image } from "./Image.js";
3
2
 
4
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Image","Routes"],"sources":["index.ts"],"sourcesContent":["export { Image } from \"./Image\";\nexport { Routes } from \"./Routes\";\n"],"mappings":"AAAA,SAASA,KAAK;AACd,SAASC,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["Image"],"sources":["index.ts"],"sourcesContent":["export { Image } from \"./Image.js\";\n"],"mappings":"AAAA,SAASA,KAAK","ignoreList":[]}
@@ -1,29 +1,28 @@
1
1
  import React from "react";
2
+ import type { Route as BaseRoute } from "../../router.js";
2
3
  export interface RouteProps {
3
- name: string;
4
- path: string;
5
- exact?: boolean;
4
+ route: BaseRoute<any>;
6
5
  element: React.ReactElement;
7
6
  remove?: boolean;
8
7
  before?: string;
9
8
  after?: string;
10
9
  }
11
- export type RouteConfig = Pick<RouteProps, "name" | "path" | "element">;
12
- export declare const Route: (({ name, path, element, exact, remove, before, after }: RouteProps) => React.JSX.Element) & {
13
- original: ({ name, path, element, exact, remove, before, after }: RouteProps) => React.JSX.Element;
10
+ export type RouteConfig = Pick<RouteProps, "route" | "element">;
11
+ export declare const Route: (({ route, element, remove, before, after }: RouteProps) => React.JSX.Element) & {
12
+ original: ({ route, element, remove, before, after }: RouteProps) => React.JSX.Element;
14
13
  originalName: string;
15
14
  displayName: string;
16
15
  } & {
17
- original: (({ name, path, element, exact, remove, before, after }: RouteProps) => React.JSX.Element) & {
18
- original: ({ name, path, element, exact, remove, before, after }: RouteProps) => React.JSX.Element;
16
+ original: (({ route, element, remove, before, after }: RouteProps) => React.JSX.Element) & {
17
+ original: ({ route, element, remove, before, after }: RouteProps) => React.JSX.Element;
19
18
  originalName: string;
20
19
  displayName: string;
21
20
  };
22
21
  originalName: string;
23
22
  displayName: string;
24
23
  } & {
25
- createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<(({ name, path, element, exact, remove, before, after }: RouteProps) => React.JSX.Element) & {
26
- original: ({ name, path, element, exact, remove, before, after }: RouteProps) => React.JSX.Element;
24
+ createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<(({ route, element, remove, before, after }: RouteProps) => React.JSX.Element) & {
25
+ original: ({ route, element, remove, before, after }: RouteProps) => React.JSX.Element;
27
26
  originalName: string;
28
27
  displayName: string;
29
28
  }>) => (props: unknown) => React.JSX.Element;
@@ -2,14 +2,13 @@ import React from "react";
2
2
  import { makeDecoratable } from "@webiny/react-composition";
3
3
  import { Property, useIdGenerator } from "@webiny/react-properties";
4
4
  export const Route = makeDecoratable("Route", ({
5
- name,
6
- path,
5
+ route,
7
6
  element,
8
- exact,
9
7
  remove,
10
8
  before,
11
9
  after
12
10
  }) => {
11
+ const name = route.name;
13
12
  const getId = useIdGenerator("Route");
14
13
  const placeAfter = after !== undefined ? getId(after) : undefined;
15
14
  const placeBefore = before !== undefined ? getId(before) : undefined;
@@ -21,17 +20,9 @@ export const Route = makeDecoratable("Route", ({
21
20
  before: placeBefore,
22
21
  after: placeAfter
23
22
  }, /*#__PURE__*/React.createElement(Property, {
24
- id: getId(name, "name"),
25
- name: "name",
26
- value: name
27
- }), /*#__PURE__*/React.createElement(Property, {
28
- id: getId(name, "path"),
29
- name: "path",
30
- value: path
31
- }), /*#__PURE__*/React.createElement(Property, {
32
- id: getId(name, "exact"),
33
- name: "exact",
34
- value: exact
23
+ id: getId(name, "route"),
24
+ name: "route",
25
+ value: route
35
26
  }), /*#__PURE__*/React.createElement(Property, {
36
27
  id: getId(name, "element"),
37
28
  name: "element",
@@ -1 +1 @@
1
- {"version":3,"names":["React","makeDecoratable","Property","useIdGenerator","Route","name","path","element","exact","remove","before","after","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\";\n\nexport interface RouteProps {\n name: string;\n path: string;\n exact?: boolean;\n element: React.ReactElement;\n remove?: boolean;\n before?: string;\n after?: string;\n}\n\nexport type RouteConfig = Pick<RouteProps, \"name\" | \"path\" | \"element\">;\n\nexport const Route = makeDecoratable(\n \"Route\",\n ({ name, path, element, exact, remove, before, after }: RouteProps) => {\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, \"name\")} name={\"name\"} value={name} />\n <Property id={getId(name, \"path\")} name={\"path\"} value={path} />\n <Property id={getId(name, \"exact\")} name={\"exact\"} value={exact} />\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;AAcnE,OAAO,MAAMC,KAAK,GAAGH,eAAe,CAChC,OAAO,EACP,CAAC;EAAEI,IAAI;EAAEC,IAAI;EAAEC,OAAO;EAAEC,KAAK;EAAEC,MAAM;EAAEC,MAAM;EAAEC;AAAkB,CAAC,KAAK;EACnE,MAAMC,KAAK,GAAGT,cAAc,CAAC,OAAO,CAAC;EAErC,MAAMU,UAAU,GAAGF,KAAK,KAAKG,SAAS,GAAGF,KAAK,CAACD,KAAK,CAAC,GAAGG,SAAS;EACjE,MAAMC,WAAW,GAAGL,MAAM,KAAKI,SAAS,GAAGF,KAAK,CAACF,MAAM,CAAC,GAAGI,SAAS;EAEpE,oBACId,KAAA,CAAAgB,aAAA,CAACd,QAAQ;IACLe,EAAE,EAAEL,KAAK,CAACP,IAAI,CAAE;IAChBA,IAAI,EAAE,QAAS;IACfI,MAAM,EAAEA,MAAO;IACfS,KAAK,EAAE,IAAK;IACZR,MAAM,EAAEK,WAAY;IACpBJ,KAAK,EAAEE;EAAW,gBAElBb,KAAA,CAAAgB,aAAA,CAACd,QAAQ;IAACe,EAAE,EAAEL,KAAK,CAACP,IAAI,EAAE,MAAM,CAAE;IAACA,IAAI,EAAE,MAAO;IAACc,KAAK,EAAEd;EAAK,CAAE,CAAC,eAChEL,KAAA,CAAAgB,aAAA,CAACd,QAAQ;IAACe,EAAE,EAAEL,KAAK,CAACP,IAAI,EAAE,MAAM,CAAE;IAACA,IAAI,EAAE,MAAO;IAACc,KAAK,EAAEb;EAAK,CAAE,CAAC,eAChEN,KAAA,CAAAgB,aAAA,CAACd,QAAQ;IAACe,EAAE,EAAEL,KAAK,CAACP,IAAI,EAAE,OAAO,CAAE;IAACA,IAAI,EAAE,OAAQ;IAACc,KAAK,EAAEX;EAAM,CAAE,CAAC,eACnER,KAAA,CAAAgB,aAAA,CAACd,QAAQ;IAACe,EAAE,EAAEL,KAAK,CAACP,IAAI,EAAE,SAAS,CAAE;IAACA,IAAI,EAAE,SAAU;IAACc,KAAK,EAAEZ;EAAQ,CAAE,CAClE,CAAC;AAEnB,CACJ,CAAC","ignoreList":[]}
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,30 +1,29 @@
1
- /// <reference types="react" />
2
- import { type RouteConfig } from "./RouterConfig/Route";
3
- export declare const RouterWithConfig: (({ onProperties, children }: import("@webiny/react-properties").WithConfigProps) => import("react").JSX.Element) & {
1
+ import { type RouteConfig } from "./RouterConfig/Route.js";
2
+ export declare const RouterWithConfig: (({ onProperties, children }: import("@webiny/react-properties").WithConfigProps) => React.JSX.Element) & {
4
3
  displayName: string;
5
4
  };
6
5
  export declare const useRouterConfig: () => {
7
6
  routes: RouteConfig[];
8
7
  };
9
- export declare const RouterConfig: (({ priority, children }: import("@webiny/react-properties").ConfigProps) => import("react").JSX.Element) & {
10
- Route: (({ name, path, element, exact, remove, before, after }: import("./RouterConfig/Route").RouteProps) => import("react").JSX.Element) & {
11
- original: ({ name, path, element, exact, remove, before, after }: import("./RouterConfig/Route").RouteProps) => import("react").JSX.Element;
8
+ export declare const RouterConfig: (({ priority, children }: import("@webiny/react-properties").ConfigProps) => React.JSX.Element) & {
9
+ Route: (({ route, element, remove, before, after }: import("./RouterConfig/Route.js").RouteProps) => import("react").JSX.Element) & {
10
+ original: ({ route, element, remove, before, after }: import("./RouterConfig/Route.js").RouteProps) => import("react").JSX.Element;
12
11
  originalName: string;
13
12
  displayName: string;
14
13
  } & {
15
- original: (({ name, path, element, exact, remove, before, after }: import("./RouterConfig/Route").RouteProps) => import("react").JSX.Element) & {
16
- original: ({ name, path, element, exact, remove, before, after }: import("./RouterConfig/Route").RouteProps) => import("react").JSX.Element;
14
+ original: (({ route, element, remove, before, after }: import("./RouterConfig/Route.js").RouteProps) => import("react").JSX.Element) & {
15
+ original: ({ route, element, remove, before, after }: import("./RouterConfig/Route.js").RouteProps) => import("react").JSX.Element;
17
16
  originalName: string;
18
17
  displayName: string;
19
18
  };
20
19
  originalName: string;
21
20
  displayName: string;
22
21
  } & {
23
- createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<(({ name, path, element, exact, remove, before, after }: import("./RouterConfig/Route").RouteProps) => import("react").JSX.Element) & {
24
- original: ({ name, path, element, exact, remove, before, after }: import("./RouterConfig/Route").RouteProps) => import("react").JSX.Element;
22
+ createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ route, element, remove, before, after }: import("./RouterConfig/Route.js").RouteProps) => import("react").JSX.Element) & {
23
+ original: ({ route, element, remove, before, after }: import("./RouterConfig/Route.js").RouteProps) => import("react").JSX.Element;
25
24
  originalName: string;
26
25
  displayName: string;
27
- }>) => (props: unknown) => import("react").JSX.Element;
26
+ }>) => (props: unknown) => React.JSX.Element;
28
27
  };
29
28
  useRouterConfig: () => {
30
29
  routes: RouteConfig[];
@@ -1,5 +1,5 @@
1
1
  import { createConfigurableComponent } from "@webiny/react-properties";
2
- import { Route } from "./RouterConfig/Route";
2
+ import { Route } from "./RouterConfig/Route.js";
3
3
  const base = createConfigurableComponent("RouterConfig");
4
4
  export const RouterWithConfig = Object.assign(base.WithConfig, {
5
5
  displayName: "RouterWithConfig"
@@ -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\";\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,"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 +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,"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,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { useEffect, useMemo, useState } from "react";
3
- import debounce from "lodash/debounce";
3
+ import debounce from "lodash/debounce.js";
4
4
  /**
5
5
  * We need to debounce the rendering of children during app bootstrap, since many plugins
6
6
  * can add more and more Providers which will recompose the entire hierarchy of React Context providers.
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","useMemo","useState","debounce","DebounceRender","wait","children","render","setRender","debouncedRender","cancel","createElement","Fragment"],"sources":["DebounceRender.tsx"],"sourcesContent":["import React from \"react\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport debounce from \"lodash/debounce\";\n\ninterface Props {\n wait?: number;\n children?: React.ReactNode;\n}\n/**\n * We need to debounce the rendering of children during app bootstrap, since many plugins\n * can add more and more Providers which will recompose the entire hierarchy of React Context providers.\n * During this stage, we don't want to render anything.\n */\nexport const DebounceRender = ({ wait = 50, children }: Props) => {\n const [render, setRender] = useState(wait === 0);\n\n const debouncedRender = useMemo(() => {\n return debounce(() => {\n setRender(true);\n }, wait);\n }, [setRender]);\n\n useEffect(() => {\n if (render) {\n return;\n }\n\n debouncedRender();\n\n return () => {\n debouncedRender.cancel();\n };\n }, []);\n\n return <>{render ? children : null}</>;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACpD,OAAOC,QAAQ,MAAM,iBAAiB;AAMtC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAGA,CAAC;EAAEC,IAAI,GAAG,EAAE;EAAEC;AAAgB,CAAC,KAAK;EAC9D,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGN,QAAQ,CAACG,IAAI,KAAK,CAAC,CAAC;EAEhD,MAAMI,eAAe,GAAGR,OAAO,CAAC,MAAM;IAClC,OAAOE,QAAQ,CAAC,MAAM;MAClBK,SAAS,CAAC,IAAI,CAAC;IACnB,CAAC,EAAEH,IAAI,CAAC;EACZ,CAAC,EAAE,CAACG,SAAS,CAAC,CAAC;EAEfR,SAAS,CAAC,MAAM;IACZ,IAAIO,MAAM,EAAE;MACR;IACJ;IAEAE,eAAe,CAAC,CAAC;IAEjB,OAAO,MAAM;MACTA,eAAe,CAACC,MAAM,CAAC,CAAC;IAC5B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,oBAAOX,KAAA,CAAAY,aAAA,CAAAZ,KAAA,CAAAa,QAAA,QAAGL,MAAM,GAAGD,QAAQ,GAAG,IAAO,CAAC;AAC1C,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useEffect","useMemo","useState","debounce","DebounceRender","wait","children","render","setRender","debouncedRender","cancel","createElement","Fragment"],"sources":["DebounceRender.tsx"],"sourcesContent":["import React from \"react\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport debounce from \"lodash/debounce.js\";\n\ninterface Props {\n wait?: number;\n children?: React.ReactNode;\n}\n/**\n * We need to debounce the rendering of children during app bootstrap, since many plugins\n * can add more and more Providers which will recompose the entire hierarchy of React Context providers.\n * During this stage, we don't want to render anything.\n */\nexport const DebounceRender = ({ wait = 50, children }: Props) => {\n const [render, setRender] = useState(wait === 0);\n\n const debouncedRender = useMemo(() => {\n return debounce(() => {\n setRender(true);\n }, wait);\n }, [setRender]);\n\n useEffect(() => {\n if (render) {\n return;\n }\n\n debouncedRender();\n\n return () => {\n debouncedRender.cancel();\n };\n }, []);\n\n return <>{render ? children : null}</>;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACpD,OAAOC,QAAQ,MAAM,oBAAoB;AAMzC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAGA,CAAC;EAAEC,IAAI,GAAG,EAAE;EAAEC;AAAgB,CAAC,KAAK;EAC9D,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGN,QAAQ,CAACG,IAAI,KAAK,CAAC,CAAC;EAEhD,MAAMI,eAAe,GAAGR,OAAO,CAAC,MAAM;IAClC,OAAOE,QAAQ,CAAC,MAAM;MAClBK,SAAS,CAAC,IAAI,CAAC;IACnB,CAAC,EAAEH,IAAI,CAAC;EACZ,CAAC,EAAE,CAACG,SAAS,CAAC,CAAC;EAEfR,SAAS,CAAC,MAAM;IACZ,IAAIO,MAAM,EAAE;MACR;IACJ;IAEAE,eAAe,CAAC,CAAC;IAEjB,OAAO,MAAM;MACTA,eAAe,CAACC,MAAM,CAAC,CAAC;IAC5B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,oBAAOX,KAAA,CAAAY,aAAA,CAAAZ,KAAA,CAAAa,QAAA,QAAGL,MAAM,GAAGD,QAAQ,GAAG,IAAO,CAAC;AAC1C,CAAC","ignoreList":[]}
package/core/Plugin.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import { Provider } from "./Provider";
3
- import { Plugins } from "./Plugins";
2
+ import { Provider } from "./Provider.js";
3
+ import { Plugins } from "./Plugins.js";
4
4
  export const Plugin = /*#__PURE__*/React.memo(function Plugin({
5
5
  providers,
6
6
  children
@@ -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,"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.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"],"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":[]}
package/core/Plugins.d.ts CHANGED
@@ -11,5 +11,5 @@ export declare const PluginsProvider: React.MemoExoticComponent<({ children }: P
11
11
  interface PluginsComponentsProps {
12
12
  children: React.ReactNode;
13
13
  }
14
- export declare const Plugins: ({ children }: PluginsComponentsProps) => React.JSX.Element | null;
14
+ export declare const Plugins: React.MemoExoticComponent<({ children }: PluginsComponentsProps) => React.JSX.Element | null>;
15
15
  export {};
package/core/Plugins.js CHANGED
@@ -1,5 +1,5 @@
1
- import React, { Fragment, Children, createContext, useContext, useEffect, memo } from "react";
2
- import { useApp } from "../App";
1
+ import React, { Children, createContext, Fragment, memo, useContext, useEffect } from "react";
2
+ import { useApp } from "../App.js";
3
3
  export const PluginsContext = /*#__PURE__*/createContext(false);
4
4
  PluginsContext.displayName = "PluginsContext";
5
5
  const PluginsProviderComponent = ({
@@ -20,7 +20,7 @@ export const PluginsProvider = /*#__PURE__*/memo(PluginsProviderComponent);
20
20
  * @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.
21
21
  */
22
22
 
23
- export const Plugins = ({
23
+ export const Plugins = /*#__PURE__*/React.memo(({
24
24
  children
25
25
  }) => {
26
26
  const {
@@ -34,6 +34,7 @@ export const Plugins = ({
34
34
  Children.forEach(children, child => addPlugin(child));
35
35
  }, []);
36
36
  return hasParentPlugin ? /*#__PURE__*/React.createElement(Fragment, null, children) : null;
37
- };
37
+ });
38
+ Plugins.displayName = "Plugins";
38
39
 
39
40
  //# 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,"names":["React","Children","createContext","Fragment","memo","useContext","useEffect","useApp","PluginsContext","displayName","PluginsProviderComponent","children","createElement","Provider","value","PluginsProvider","Plugins","addPlugin","hasParentPlugin","forEach","child"],"sources":["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: 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"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,aAAa,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,UAAU,EAAEC,SAAS,QAAQ,OAAO;AAC7F,SAASC,MAAM;AAEf,OAAO,MAAMC,cAAc,gBAAGN,aAAa,CAAU,KAAK,CAAC;AAC3DM,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,gBAAGX,IAAI,CAACM,wBAAwB,CAAC;;AAE7D;AACA;AACA;AACA;;AAIA,OAAO,MAAMM,OAAO,gBAAGhB,KAAK,CAACI,IAAI,CAAC,CAAC;EAAEO;AAAiC,CAAC,KAAK;EACxE,MAAM;IAAEM;EAAU,CAAC,GAAGV,MAAM,CAAC,CAAC;EAC9B,MAAMW,eAAe,GAAGb,UAAU,CAACG,cAAc,CAAC;EAElDF,SAAS,CAAC,MAAM;IACZ,IAAIY,eAAe,EAAE;MACjB;IACJ;IAEAjB,QAAQ,CAACkB,OAAO,CAACR,QAAQ,EAAES,KAAK,IAAIH,SAAS,CAACG,KAAK,CAAC,CAAC;EACzD,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOF,eAAe,gBAAGlB,KAAA,CAAAY,aAAA,CAACT,QAAQ,QAAEQ,QAAmB,CAAC,GAAG,IAAI;AACnE,CAAC,CAAC;AAEFK,OAAO,CAACP,WAAW,GAAG,SAAS","ignoreList":[]}
@@ -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,5 +1,5 @@
1
1
  import { useEffect } from "react";
2
- import { useApp } from "./..";
2
+ import { useApp } from "../index.js";
3
3
  /**
4
4
  * Register a new React context provider.
5
5
  */
@@ -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,"names":["useEffect","useApp","Provider","hoc","addProvider"],"sources":["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"],"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":[]}
package/core/Routes.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
+ import type { ReactRoute } from "../presentation/router/index.js";
2
3
  interface RoutesProps {
3
- routes: JSX.Element[];
4
+ routes: ReactRoute[];
4
5
  }
5
6
  export declare const Routes: (props: RoutesProps) => React.JSX.Element;
6
7
  export {};