@webiny/app 0.0.0-unstable.79032b23a5 → 0.0.0-unstable.7be00a75a9

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 (423) hide show
  1. package/App.d.ts +14 -18
  2. package/App.js +79 -102
  3. package/App.js.map +1 -1
  4. package/AppContainer.d.ts +23 -0
  5. package/AppContainer.js +6 -0
  6. package/AppContainer.js.map +1 -0
  7. package/README.md +7 -15
  8. package/apollo-client/InMemoryCache.d.ts +3 -2
  9. package/apollo-client/InMemoryCache.js +17 -55
  10. package/apollo-client/InMemoryCache.js.map +1 -1
  11. package/apollo-client/IntrospectionFragmentMatcher.d.ts +11 -0
  12. package/apollo-client/IntrospectionFragmentMatcher.js +33 -0
  13. package/apollo-client/IntrospectionFragmentMatcher.js.map +1 -0
  14. package/components/Image.d.ts +2 -3
  15. package/components/Image.js +16 -29
  16. package/components/Image.js.map +1 -1
  17. package/components/index.d.ts +1 -2
  18. package/components/index.js +1 -19
  19. package/config/RouterConfig/Route.d.ts +29 -0
  20. package/config/RouterConfig/Route.js +28 -0
  21. package/config/RouterConfig/Route.js.map +1 -0
  22. package/config/RouterConfig.d.ts +31 -0
  23. package/config/RouterConfig.js +19 -0
  24. package/config/RouterConfig.js.map +1 -0
  25. package/config.d.ts +1 -1
  26. package/config.js +21 -27
  27. package/config.js.map +1 -1
  28. package/contexts/Ui/index.d.ts +4 -4
  29. package/contexts/Ui/index.js +28 -57
  30. package/contexts/Ui/index.js.map +1 -1
  31. package/core/Plugin.d.ts +3 -3
  32. package/core/Plugin.js +11 -20
  33. package/core/Plugin.js.map +1 -1
  34. package/core/Plugins.d.ts +6 -3
  35. package/core/Plugins.js +19 -43
  36. package/core/Plugins.js.map +1 -1
  37. package/core/Provider.d.ts +3 -4
  38. package/core/Provider.js +9 -20
  39. package/core/Provider.js.map +1 -1
  40. package/core/createProvider.d.ts +7 -3
  41. package/core/createProvider.js +5 -12
  42. package/core/createProvider.js.map +1 -1
  43. package/core/createProviderPlugin.d.ts +2 -2
  44. package/core/createProviderPlugin.js +11 -20
  45. package/core/createProviderPlugin.js.map +1 -1
  46. package/errors/AuthenticationErrorEvent.d.ts +9 -0
  47. package/errors/AuthenticationErrorEvent.js +13 -0
  48. package/errors/AuthenticationErrorEvent.js.map +1 -0
  49. package/errors/NetworkErrorEvent.d.ts +15 -0
  50. package/errors/NetworkErrorEvent.js +13 -0
  51. package/errors/NetworkErrorEvent.js.map +1 -0
  52. package/errors/abstractions.d.ts +12 -0
  53. package/errors/abstractions.js +6 -0
  54. package/errors/abstractions.js.map +1 -0
  55. package/errors/index.d.ts +6 -0
  56. package/errors/index.js +3 -0
  57. package/exports/admin/env-config.d.ts +2 -0
  58. package/exports/admin/env-config.js +2 -0
  59. package/exports/admin/graphql-client.d.ts +1 -0
  60. package/exports/admin/graphql-client.js +1 -0
  61. package/exports/admin/local-storage.d.ts +2 -0
  62. package/exports/admin/local-storage.js +2 -0
  63. package/exports/admin/router.d.ts +5 -0
  64. package/exports/admin/router.js +5 -0
  65. package/exports/admin/security.d.ts +1 -0
  66. package/exports/admin/security.js +1 -0
  67. package/exports/admin.d.ts +7 -0
  68. package/exports/admin.js +7 -0
  69. package/features/envConfig/EnvConfig.d.ts +7 -0
  70. package/features/envConfig/EnvConfig.js +16 -0
  71. package/features/envConfig/EnvConfig.js.map +1 -0
  72. package/features/envConfig/abstractions.d.ts +28 -0
  73. package/features/envConfig/abstractions.js +5 -0
  74. package/features/envConfig/abstractions.js.map +1 -0
  75. package/features/envConfig/feature.d.ts +17 -0
  76. package/features/envConfig/feature.js +15 -0
  77. package/features/envConfig/feature.js.map +1 -0
  78. package/features/envConfig/index.d.ts +1 -0
  79. package/features/envConfig/index.js +1 -0
  80. package/features/eventPublisher/EventPublisher.d.ts +8 -0
  81. package/features/eventPublisher/EventPublisher.js +19 -0
  82. package/features/eventPublisher/EventPublisher.js.map +1 -0
  83. package/features/eventPublisher/abstractions.d.ts +18 -0
  84. package/features/eventPublisher/abstractions.js +12 -0
  85. package/features/eventPublisher/abstractions.js.map +1 -0
  86. package/features/eventPublisher/feature.d.ts +3 -0
  87. package/features/eventPublisher/feature.js +17 -0
  88. package/features/eventPublisher/feature.js.map +1 -0
  89. package/features/eventPublisher/index.d.ts +3 -0
  90. package/features/eventPublisher/index.js +2 -0
  91. package/features/graphqlClient/AuthenticationErrorPublishing.d.ts +13 -0
  92. package/features/graphqlClient/AuthenticationErrorPublishing.js +35 -0
  93. package/features/graphqlClient/AuthenticationErrorPublishing.js.map +1 -0
  94. package/features/graphqlClient/BatchingGraphQLClient.d.ts +16 -0
  95. package/features/graphqlClient/BatchingGraphQLClient.js +118 -0
  96. package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -0
  97. package/features/graphqlClient/FetchGraphQLClient.d.ts +7 -0
  98. package/features/graphqlClient/FetchGraphQLClient.js +51 -0
  99. package/features/graphqlClient/FetchGraphQLClient.js.map +1 -0
  100. package/features/graphqlClient/NetworkErrorPublishing.d.ts +14 -0
  101. package/features/graphqlClient/NetworkErrorPublishing.js +48 -0
  102. package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -0
  103. package/features/graphqlClient/RequestValue.d.ts +21 -0
  104. package/features/graphqlClient/RequestValue.js +46 -0
  105. package/features/graphqlClient/RequestValue.js.map +1 -0
  106. package/features/graphqlClient/RetryGraphQLClient.d.ts +18 -0
  107. package/features/graphqlClient/RetryGraphQLClient.js +45 -0
  108. package/features/graphqlClient/RetryGraphQLClient.js.map +1 -0
  109. package/features/graphqlClient/__tests__/GraphQLClient.test.d.ts +1 -0
  110. package/features/graphqlClient/__tests__/GraphQLClient.test.js +397 -0
  111. package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -0
  112. package/features/graphqlClient/abstractions.d.ts +18 -0
  113. package/features/graphqlClient/abstractions.js +5 -0
  114. package/features/graphqlClient/abstractions.js.map +1 -0
  115. package/features/graphqlClient/feature.d.ts +6 -0
  116. package/features/graphqlClient/feature.js +25 -0
  117. package/features/graphqlClient/feature.js.map +1 -0
  118. package/features/graphqlClient/index.d.ts +1 -0
  119. package/features/graphqlClient/index.js +1 -0
  120. package/features/graphqlClient/types.d.ts +5 -0
  121. package/features/graphqlClient/types.js +0 -0
  122. package/features/localStorage/BrowserLocalStorageGateway.d.ts +9 -0
  123. package/features/localStorage/BrowserLocalStorageGateway.js +61 -0
  124. package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -0
  125. package/features/localStorage/LocalStorage.d.ts +12 -0
  126. package/features/localStorage/LocalStorage.js +34 -0
  127. package/features/localStorage/LocalStorage.js.map +1 -0
  128. package/features/localStorage/LocalStorageRepository.d.ts +20 -0
  129. package/features/localStorage/LocalStorageRepository.js +82 -0
  130. package/features/localStorage/LocalStorageRepository.js.map +1 -0
  131. package/features/localStorage/abstractions.d.ts +48 -0
  132. package/features/localStorage/abstractions.js +8 -0
  133. package/features/localStorage/abstractions.js.map +1 -0
  134. package/features/localStorage/feature.d.ts +12 -0
  135. package/features/localStorage/feature.js +23 -0
  136. package/features/localStorage/feature.js.map +1 -0
  137. package/features/localStorage/index.d.ts +1 -0
  138. package/features/localStorage/index.js +1 -0
  139. package/features/mainGraphQLClient/MainGraphQLClient.d.ts +11 -0
  140. package/features/mainGraphQLClient/MainGraphQLClient.js +27 -0
  141. package/features/mainGraphQLClient/MainGraphQLClient.js.map +1 -0
  142. package/features/mainGraphQLClient/abstractions.d.ts +17 -0
  143. package/features/mainGraphQLClient/abstractions.js +5 -0
  144. package/features/mainGraphQLClient/abstractions.js.map +1 -0
  145. package/features/mainGraphQLClient/feature.d.ts +3 -0
  146. package/features/mainGraphQLClient/feature.js +17 -0
  147. package/features/mainGraphQLClient/feature.js.map +1 -0
  148. package/features/mainGraphQLClient/index.d.ts +1 -0
  149. package/features/mainGraphQLClient/index.js +1 -0
  150. package/features/router/HistoryRouterGateway.d.ts +22 -0
  151. package/features/router/HistoryRouterGateway.js +88 -0
  152. package/features/router/HistoryRouterGateway.js.map +1 -0
  153. package/features/router/HistoryRouterGateway.test.d.ts +1 -0
  154. package/features/router/HistoryRouterGateway.test.js +195 -0
  155. package/features/router/HistoryRouterGateway.test.js.map +1 -0
  156. package/features/router/Route.d.ts +19 -0
  157. package/features/router/Route.js +43 -0
  158. package/features/router/Route.js.map +1 -0
  159. package/features/router/RouteUrl.d.ts +85 -0
  160. package/features/router/RouteUrl.js +99 -0
  161. package/features/router/RouteUrl.js.map +1 -0
  162. package/features/router/Router.d.ts +45 -0
  163. package/features/router/Router.js +72 -0
  164. package/features/router/Router.js.map +1 -0
  165. package/features/router/RouterPresenter.d.ts +21 -0
  166. package/features/router/RouterPresenter.js +52 -0
  167. package/features/router/RouterPresenter.js.map +1 -0
  168. package/features/router/RouterRepository.d.ts +30 -0
  169. package/features/router/RouterRepository.js +117 -0
  170. package/features/router/RouterRepository.js.map +1 -0
  171. package/features/router/RouterRepository.test.d.ts +1 -0
  172. package/features/router/RouterRepository.test.js +138 -0
  173. package/features/router/RouterRepository.test.js.map +1 -0
  174. package/features/router/abstractions.d.ts +81 -0
  175. package/features/router/abstractions.js +7 -0
  176. package/features/router/abstractions.js.map +1 -0
  177. package/features/router/feature.d.ts +4 -0
  178. package/features/router/feature.js +19 -0
  179. package/features/router/feature.js.map +1 -0
  180. package/features/router/index.d.ts +2 -0
  181. package/features/router/index.js +1 -0
  182. package/helpers/InterfaceGenerator/date.d.ts +15 -0
  183. package/helpers/InterfaceGenerator/date.js +0 -0
  184. package/helpers/InterfaceGenerator/id.d.ts +23 -0
  185. package/helpers/InterfaceGenerator/id.js +0 -0
  186. package/helpers/InterfaceGenerator/identity.d.ts +10 -0
  187. package/helpers/InterfaceGenerator/identity.js +0 -0
  188. package/helpers/InterfaceGenerator/index.d.ts +5 -0
  189. package/helpers/InterfaceGenerator/index.js +0 -0
  190. package/helpers/InterfaceGenerator/numeric.d.ts +12 -0
  191. package/helpers/InterfaceGenerator/numeric.js +0 -0
  192. package/helpers/InterfaceGenerator/truthful.d.ts +7 -0
  193. package/helpers/InterfaceGenerator/truthful.js +0 -0
  194. package/hooks/useAutocomplete/index.d.ts +1 -1
  195. package/hooks/useAutocomplete/index.js +1 -12
  196. package/hooks/useAutocomplete/useAutocomplete.d.ts +1 -1
  197. package/hooks/useAutocomplete/useAutocomplete.js +16 -28
  198. package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
  199. package/hooks/useDataList/functions/getData.js +4 -11
  200. package/hooks/useDataList/functions/getData.js.map +1 -1
  201. package/hooks/useDataList/functions/getError.js +4 -11
  202. package/hooks/useDataList/functions/getError.js.map +1 -1
  203. package/hooks/useDataList/functions/getMeta.js +4 -11
  204. package/hooks/useDataList/functions/getMeta.js.map +1 -1
  205. package/hooks/useDataList/functions/index.d.ts +3 -3
  206. package/hooks/useDataList/functions/index.js +3 -27
  207. package/hooks/useDataList/functions/searchDataByKey.js +11 -21
  208. package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
  209. package/hooks/useDataList/index.d.ts +1 -1
  210. package/hooks/useDataList/index.js +1 -12
  211. package/hooks/useDataList/useDataList.d.ts +2 -3
  212. package/hooks/useDataList/useDataList.js +140 -180
  213. package/hooks/useDataList/useDataList.js.map +1 -1
  214. package/hooks/useDataList/utils/index.d.ts +1 -2
  215. package/hooks/useDataList/utils/index.js +1 -20
  216. package/hooks/useDataList/utils/prepareLoadListParams.d.ts +1 -2
  217. package/hooks/useDataList/utils/prepareLoadListParams.js +27 -36
  218. package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
  219. package/hooks/useHandler.js +14 -17
  220. package/hooks/useHandler.js.map +1 -1
  221. package/hooks/useHandlers.d.ts +3 -3
  222. package/hooks/useHandlers.js +20 -26
  223. package/hooks/useHandlers.js.map +1 -1
  224. package/hooks/useRegisterLegacyPlugin.d.ts +2 -0
  225. package/hooks/useRegisterLegacyPlugin.js +12 -0
  226. package/hooks/useRegisterLegacyPlugin.js.map +1 -0
  227. package/hooks/useUi.d.ts +1 -1
  228. package/hooks/useUi.js +5 -11
  229. package/hooks/useUi.js.map +1 -1
  230. package/i18n/i18n.js +10 -13
  231. package/i18n/i18n.js.map +1 -1
  232. package/i18n/index.d.ts +1 -1
  233. package/i18n/index.js +1 -13
  234. package/index.d.ts +23 -13
  235. package/index.js +23 -147
  236. package/package.json +38 -41
  237. package/plugins/AddQuerySelectionPlugin.d.ts +2 -2
  238. package/plugins/AddQuerySelectionPlugin.js +41 -116
  239. package/plugins/AddQuerySelectionPlugin.js.map +1 -1
  240. package/plugins/ApolloCacheObjectIdPlugin.js +16 -37
  241. package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
  242. package/plugins/ApolloDynamicLink.d.ts +3 -2
  243. package/plugins/ApolloDynamicLink.js +25 -56
  244. package/plugins/ApolloDynamicLink.js.map +1 -1
  245. package/plugins/ApolloLinkPlugin.d.ts +1 -1
  246. package/plugins/ApolloLinkPlugin.js +22 -45
  247. package/plugins/ApolloLinkPlugin.js.map +1 -1
  248. package/plugins/ConsoleLinkPlugin.d.ts +1 -1
  249. package/plugins/ConsoleLinkPlugin.js +21 -45
  250. package/plugins/ConsoleLinkPlugin.js.map +1 -1
  251. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +8 -13
  252. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +48 -76
  253. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
  254. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.d.ts +14 -0
  255. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js +27 -0
  256. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js.map +1 -0
  257. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.d.ts +2 -0
  258. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js +23 -0
  259. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js.map +1 -0
  260. package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +4 -7
  261. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +68 -17
  262. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
  263. package/plugins/NetworkErrorLinkPlugin/Typography.d.ts +8 -0
  264. package/plugins/NetworkErrorLinkPlugin/Typography.js +13 -0
  265. package/plugins/NetworkErrorLinkPlugin/Typography.js.map +1 -0
  266. package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js +19 -0
  267. package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js.map +1 -0
  268. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +3 -3
  269. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +14 -30
  270. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
  271. package/plugins/NetworkErrorLinkPlugin.d.ts +4 -1
  272. package/plugins/NetworkErrorLinkPlugin.js +52 -47
  273. package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
  274. package/plugins/OmitTypenameLinkPlugin.d.ts +1 -1
  275. package/plugins/OmitTypenameLinkPlugin.js +13 -38
  276. package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
  277. package/plugins/TenantHeaderLinkPlugin.d.ts +3 -3
  278. package/plugins/TenantHeaderLinkPlugin.js +27 -59
  279. package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
  280. package/plugins/components/Image.d.ts +6 -0
  281. package/plugins/components/Image.js +12 -0
  282. package/plugins/components/Image.js.map +1 -0
  283. package/plugins/image.d.ts +1 -1
  284. package/plugins/image.js +97 -142
  285. package/plugins/image.js.map +1 -1
  286. package/plugins/index.d.ts +5 -5
  287. package/plugins/index.js +39 -86
  288. package/plugins/index.js.map +1 -1
  289. package/presentation/envConfig/useEnvConfig.d.ts +6 -0
  290. package/presentation/envConfig/useEnvConfig.js +9 -0
  291. package/presentation/envConfig/useEnvConfig.js.map +1 -0
  292. package/presentation/localStorage/index.d.ts +3 -0
  293. package/presentation/localStorage/index.js +3 -0
  294. package/presentation/localStorage/useLocalStorage.d.ts +6 -0
  295. package/presentation/localStorage/useLocalStorage.js +15 -0
  296. package/presentation/localStorage/useLocalStorage.js.map +1 -0
  297. package/presentation/localStorage/useLocalStorageValue.d.ts +1 -0
  298. package/presentation/localStorage/useLocalStorageValue.js +22 -0
  299. package/presentation/localStorage/useLocalStorageValue.js.map +1 -0
  300. package/presentation/localStorage/useLocalStorageValues.d.ts +5 -0
  301. package/presentation/localStorage/useLocalStorageValues.js +32 -0
  302. package/presentation/localStorage/useLocalStorageValues.js.map +1 -0
  303. package/presentation/router/RouteElementRegistry.d.ts +14 -0
  304. package/presentation/router/RouteElementRegistry.js +29 -0
  305. package/presentation/router/RouteElementRegistry.js.map +1 -0
  306. package/presentation/router/abstractions.d.ts +13 -0
  307. package/presentation/router/abstractions.js +5 -0
  308. package/presentation/router/abstractions.js.map +1 -0
  309. package/presentation/router/components/Redirect.d.ts +14 -0
  310. package/presentation/router/components/Redirect.js +13 -0
  311. package/presentation/router/components/Redirect.js.map +1 -0
  312. package/presentation/router/components/RouteContent.d.ts +2 -0
  313. package/presentation/router/components/RouteContent.js +20 -0
  314. package/presentation/router/components/RouteContent.js.map +1 -0
  315. package/presentation/router/components/RouteLink.d.ts +50 -0
  316. package/presentation/router/components/RouteLink.js +17 -0
  317. package/presentation/router/components/RouteLink.js.map +1 -0
  318. package/presentation/router/components/SimpleLink.d.ts +44 -0
  319. package/presentation/router/components/SimpleLink.js +24 -0
  320. package/presentation/router/components/SimpleLink.js.map +1 -0
  321. package/presentation/router/hooks/useRoute.d.ts +6 -0
  322. package/presentation/router/hooks/useRoute.js +22 -0
  323. package/presentation/router/hooks/useRoute.js.map +1 -0
  324. package/presentation/router/hooks/useRouter.d.ts +11 -0
  325. package/presentation/router/hooks/useRouter.js +29 -0
  326. package/presentation/router/hooks/useRouter.js.map +1 -0
  327. package/presentation/router/index.d.ts +4 -0
  328. package/presentation/router/index.js +3 -0
  329. package/presentation/router/types.d.ts +5 -0
  330. package/presentation/router/types.js +0 -0
  331. package/renderApp.d.ts +2 -0
  332. package/renderApp.js +10 -0
  333. package/renderApp.js.map +1 -0
  334. package/router.d.ts +5 -0
  335. package/router.js +5 -0
  336. package/rslib-runtime.js +14 -0
  337. package/rslib-runtime.js.map +1 -0
  338. package/shared/di/DiContainerProvider.d.ts +8 -0
  339. package/shared/di/DiContainerProvider.js +13 -0
  340. package/shared/di/DiContainerProvider.js.map +1 -0
  341. package/shared/di/createFeature.d.ts +11 -0
  342. package/shared/di/createFeature.js +10 -0
  343. package/shared/di/createFeature.js.map +1 -0
  344. package/shared/di/useFeature.d.ts +2 -0
  345. package/shared/di/useFeature.js +12 -0
  346. package/shared/di/useFeature.js.map +1 -0
  347. package/static/svg/close_24px.33adaadc.svg +1 -0
  348. package/types.d.ts +16 -28
  349. package/types.js +0 -12
  350. package/utils/createGenericContext.d.ts +13 -0
  351. package/utils/createGenericContext.js +21 -0
  352. package/utils/createGenericContext.js.map +1 -0
  353. package/utils/createHashing.d.ts +2 -0
  354. package/utils/createHashing.js +15 -0
  355. package/utils/createHashing.js.map +1 -0
  356. package/utils/index.d.ts +2 -8
  357. package/utils/index.js +2 -93
  358. package/utils/legacyPluginToReactComponent.d.ts +7 -0
  359. package/utils/legacyPluginToReactComponent.js +15 -0
  360. package/utils/legacyPluginToReactComponent.js.map +1 -0
  361. package/components/Routes.d.ts +0 -2
  362. package/components/Routes.js +0 -45
  363. package/components/Routes.js.map +0 -1
  364. package/components/View.d.ts +0 -8
  365. package/components/View.js +0 -30
  366. package/components/View.js.map +0 -1
  367. package/components/index.js.map +0 -1
  368. package/core/AddRoute.d.ts +0 -3
  369. package/core/AddRoute.js +0 -19
  370. package/core/AddRoute.js.map +0 -1
  371. package/core/DebounceRender.d.ts +0 -11
  372. package/core/DebounceRender.js +0 -41
  373. package/core/DebounceRender.js.map +0 -1
  374. package/core/Routes.d.ts +0 -6
  375. package/core/Routes.js +0 -42
  376. package/core/Routes.js.map +0 -1
  377. package/hooks/useAutocomplete/index.js.map +0 -1
  378. package/hooks/useDataList/functions/index.js.map +0 -1
  379. package/hooks/useDataList/index.js.map +0 -1
  380. package/hooks/useDataList/utils/index.js.map +0 -1
  381. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +0 -14
  382. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +0 -29
  383. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +0 -1
  384. package/hooks/useDataList/utils/types.d.ts +0 -34
  385. package/hooks/useDataList/utils/types.js +0 -5
  386. package/hooks/useDataList/utils/types.js.map +0 -1
  387. package/i18n/index.js.map +0 -1
  388. package/index.js.map +0 -1
  389. package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -10
  390. package/plugins/LocaleHeaderLinkPlugin.js +0 -53
  391. package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
  392. package/plugins/RoutePlugin.d.ts +0 -12
  393. package/plugins/RoutePlugin.js +0 -38
  394. package/plugins/RoutePlugin.js.map +0 -1
  395. package/plugins/ViewPlugin.d.ts +0 -14
  396. package/plugins/ViewPlugin.js +0 -43
  397. package/plugins/ViewPlugin.js.map +0 -1
  398. package/types.js.map +0 -1
  399. package/utils/getApiUrl.d.ts +0 -1
  400. package/utils/getApiUrl.js +0 -11
  401. package/utils/getApiUrl.js.map +0 -1
  402. package/utils/getGqlApiUrl.d.ts +0 -1
  403. package/utils/getGqlApiUrl.js +0 -11
  404. package/utils/getGqlApiUrl.js.map +0 -1
  405. package/utils/getHeadlessCmsGqlApiUrl.d.ts +0 -5
  406. package/utils/getHeadlessCmsGqlApiUrl.js +0 -17
  407. package/utils/getHeadlessCmsGqlApiUrl.js.map +0 -1
  408. package/utils/getLocaleCode.d.ts +0 -6
  409. package/utils/getLocaleCode.js +0 -42
  410. package/utils/getLocaleCode.js.map +0 -1
  411. package/utils/getPrerenderId.d.ts +0 -6
  412. package/utils/getPrerenderId.js +0 -10
  413. package/utils/getPrerenderId.js.map +0 -1
  414. package/utils/getTenantId.d.ts +0 -6
  415. package/utils/getTenantId.js +0 -34
  416. package/utils/getTenantId.js.map +0 -1
  417. package/utils/index.js.map +0 -1
  418. package/utils/isLocalhost.d.ts +0 -1
  419. package/utils/isLocalhost.js +0 -14
  420. package/utils/isLocalhost.js.map +0 -1
  421. package/utils/isPrerendering.d.ts +0 -1
  422. package/utils/isPrerendering.js +0 -10
  423. package/utils/isPrerendering.js.map +0 -1
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import type { Route as BaseRoute } from "../../router.js";
3
+ export interface RouteProps {
4
+ route: BaseRoute<any>;
5
+ element: React.ReactElement;
6
+ remove?: boolean;
7
+ before?: string;
8
+ after?: string;
9
+ }
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;
13
+ originalName: string;
14
+ displayName: string;
15
+ } & {
16
+ original: (({ route, element, remove, before, after }: RouteProps) => React.JSX.Element) & {
17
+ original: ({ route, element, remove, before, after }: RouteProps) => React.JSX.Element;
18
+ originalName: string;
19
+ displayName: string;
20
+ };
21
+ originalName: string;
22
+ displayName: string;
23
+ } & {
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;
26
+ originalName: string;
27
+ displayName: string;
28
+ }>) => (props: unknown) => React.JSX.Element;
29
+ };
@@ -0,0 +1,28 @@
1
+ import react from "react";
2
+ import { makeDecoratable } from "@webiny/react-composition";
3
+ import { Property, useIdGenerator } from "@webiny/react-properties";
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
+ }));
25
+ });
26
+ export { Route };
27
+
28
+ //# sourceMappingURL=Route.js.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,31 @@
1
+ import { type RouteConfig } from "./RouterConfig/Route.js";
2
+ export declare const RouterWithConfig: (({ onProperties, children }: import("@webiny/react-properties").WithConfigProps) => React.JSX.Element) & {
3
+ displayName: string;
4
+ };
5
+ export declare const useRouterConfig: () => {
6
+ routes: RouteConfig[];
7
+ };
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;
11
+ originalName: string;
12
+ displayName: string;
13
+ } & {
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;
16
+ originalName: string;
17
+ displayName: string;
18
+ };
19
+ originalName: string;
20
+ displayName: string;
21
+ } & {
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;
24
+ originalName: string;
25
+ displayName: string;
26
+ }>) => (props: unknown) => React.JSX.Element;
27
+ };
28
+ useRouterConfig: () => {
29
+ routes: RouteConfig[];
30
+ };
31
+ };
@@ -0,0 +1,19 @@
1
+ import { createConfigurableComponent } from "@webiny/react-properties";
2
+ import { Route } from "./RouterConfig/Route.js";
3
+ const base = createConfigurableComponent("RouterConfig");
4
+ const RouterWithConfig = Object.assign(base.WithConfig, {
5
+ displayName: "RouterWithConfig"
6
+ });
7
+ const useRouterConfig = ()=>{
8
+ const baseConfig = base.useConfig();
9
+ return {
10
+ routes: baseConfig.routes ?? []
11
+ };
12
+ };
13
+ const RouterConfig = Object.assign(base.Config, {
14
+ Route: Route,
15
+ useRouterConfig: useRouterConfig
16
+ });
17
+ export { RouterConfig, RouterWithConfig, useRouterConfig };
18
+
19
+ //# sourceMappingURL=RouterConfig.js.map
@@ -0,0 +1 @@
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.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare type Config = Record<string, any>;
1
+ export type Config = Record<string, any>;
2
2
  interface AppConfig {
3
3
  set(config: Config): void;
4
4
  get(): Config;
package/config.js CHANGED
@@ -1,30 +1,24 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.config = void 0;
7
- var deepFreeze = function deepFreeze(obj) {
8
- Object.keys(obj).forEach(function (prop) {
9
- if (typeof obj[prop] === "object" && !Object.isFrozen(obj[prop])) {
10
- deepFreeze(obj[prop]);
11
- }
12
- });
13
- 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);
14
6
  };
15
7
  function createConfig() {
16
- var _config = {};
17
- return {
18
- set: function set(config) {
19
- _config = deepFreeze(config);
20
- },
21
- get: function get() {
22
- return _config;
23
- },
24
- getKey: function getKey(key, defaultValue) {
25
- return key in _config ? _config[key] : defaultValue;
26
- }
27
- };
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
+ };
28
20
  }
29
- var config = createConfig();
30
- exports.config = config;
21
+ const config_config = createConfig();
22
+ export { config_config as config };
23
+
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,IAAMA,UAAU,GAAG,SAAbA,UAAU,CAAIC,GAAwB,EAA0B;EAClEC,MAAM,CAACC,IAAI,CAACF,GAAG,CAAC,CAACG,OAAO,CAAC,UAAAC,IAAI,EAAI;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,YAAY,GAAc;EAC/B,IAAIC,OAA4B,GAAG,CAAC,CAAC;EAErC,OAAO;IACHC,GAAG,eAACC,MAAc,EAAE;MAChBF,OAAO,GAAGT,UAAU,CAACW,MAAM,CAAC;IAChC,CAAC;IACDC,GAAG,iBAAG;MACF,OAAOH,OAAO;IAClB,CAAC;IACDI,MAAM,kBAACC,GAAG,EAAEC,YAAY,EAAE;MACtB,OAAOD,GAAG,IAAIL,OAAO,GAAGA,OAAO,CAACK,GAAG,CAAC,GAAGC,YAAY;IACvD;EACJ,CAAC;AACL;AAEO,IAAMJ,MAAM,GAAGH,YAAY,EAAE;AAAC"}
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,7 +1,7 @@
1
1
  import React from "react";
2
- export declare const UiContext: React.Context<{}>;
3
- declare type Props = {};
4
- declare type State = {
2
+ export declare const UiContext: React.Context<Record<string, any>>;
3
+ type Props = Record<string, any>;
4
+ type State = {
5
5
  ui: {
6
6
  [key: string]: any;
7
7
  };
@@ -19,6 +19,6 @@ export interface UiContextValue {
19
19
  export declare class UiProvider extends React.Component<Props, State> {
20
20
  state: State;
21
21
  private readonly setData;
22
- render(): JSX.Element;
22
+ render(): React.JSX.Element;
23
23
  }
24
24
  export {};
@@ -1,59 +1,30 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.UiProvider = exports.UiContext = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
- var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
- var _react = _interopRequireDefault(require("react"));
16
- var _plugins = require("@webiny/plugins");
17
- var UiContext = /*#__PURE__*/_react.default.createContext({});
18
- exports.UiContext = UiContext;
19
- var UiProvider = /*#__PURE__*/function (_React$Component) {
20
- (0, _inherits2.default)(UiProvider, _React$Component);
21
- var _super = (0, _createSuper2.default)(UiProvider);
22
- function UiProvider() {
23
- var _this;
24
- (0, _classCallCheck2.default)(this, UiProvider);
25
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
26
- args[_key] = arguments[_key];
27
- }
28
- _this = _super.call.apply(_super, [this].concat(args));
29
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
30
- ui: {}
31
- });
32
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setData", function (setter) {
33
- return _this.setState(function (state) {
34
- return {
35
- ui: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state.ui), setter(state.ui))
1
+ import react from "react";
2
+ import { plugins } from "@webiny/plugins";
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
36
9
  };
37
- });
38
- });
39
- return _this;
40
- }
41
- (0, _createClass2.default)(UiProvider, [{
42
- key: "render",
43
- value: function render() {
44
- var value = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.state.ui), {}, {
45
- setState: this.setData
46
- });
47
- var uiStatePlugins = _plugins.plugins.byType("ui-state");
48
- return /*#__PURE__*/_react.default.createElement(UiContext.Provider, {
49
- value: value
50
- }, uiStatePlugins.map(function (pl) {
51
- return /*#__PURE__*/_react.default.cloneElement(pl.render(), {
52
- key: pl.name
53
- });
54
- }), this.props.children);
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);
55
16
  }
56
- }]);
57
- return UiProvider;
58
- }(_react.default.Component);
59
- exports.UiProvider = UiProvider;
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
+ }
27
+ }
28
+ export { UiContext, UiProvider };
29
+
30
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["UiContext","React","createContext","UiProvider","ui","setter","setState","state","value","setData","uiStatePlugins","plugins","byType","map","pl","cloneElement","render","key","name","props","children","Component"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport { UiStatePlugin } from \"~/types\";\nimport { plugins } from \"@webiny/plugins\";\n\nexport const UiContext = React.createContext({});\n\ntype Props = {};\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: Function): 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;AAEA;AAEO,IAAMA,SAAS,gBAAGC,cAAK,CAACC,aAAa,CAAC,CAAC,CAAC,CAAC;AAAC;AAAA,IAqBpCC,UAAU;EAAA;EAAA;EAAA;IAAA;IAAA;IAAA;MAAA;IAAA;IAAA;IAAA,oFACY;MAC3BC,EAAE,EAAE,CAAC;IACT,CAAC;IAAA,sFAE0B,UAACC,MAAgB,EAAW;MACnD,OAAO,MAAKC,QAAQ,CAAC,UAACC,KAAY,EAAK;QACnC,OAAO;UAAEH,EAAE,8DAAOG,KAAK,CAACH,EAAE,GAAKC,MAAM,CAACE,KAAK,CAACH,EAAE,CAAC;QAAG,CAAC;MACvD,CAAC,CAAC;IACN,CAAC;IAAA;EAAA;EAAA;IAAA;IAAA,OAED,kBAAyB;MACrB,IAAMI,KAAqB,+DAAQ,IAAI,CAACD,KAAK,CAACH,EAAE;QAAEE,QAAQ,EAAE,IAAI,CAACG;MAAO,EAAE;MAC1E,IAAMC,cAAc,GAAGC,gBAAO,CAACC,MAAM,CAAgB,UAAU,CAAC;MAChE,oBACI,6BAAC,SAAS,CAAC,QAAQ;QAAC,KAAK,EAAEJ;MAAM,GAC5BE,cAAc,CAACG,GAAG,CAAC,UAAAC,EAAE;QAAA,oBAAIb,cAAK,CAACc,YAAY,CAACD,EAAE,CAACE,MAAM,EAAE,EAAE;UAAEC,GAAG,EAAEH,EAAE,CAACI;QAAK,CAAC,CAAC;MAAA,EAAC,EAC3E,IAAI,CAACC,KAAK,CAACC,QAAQ,CACH;IAE7B;EAAC;EAAA;AAAA,EApB2BnB,cAAK,CAACoB,SAAS;AAAA"}
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
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- import { HigherOrderComponent } from "@webiny/react-composition";
2
+ import type { GenericComponent, Decorator } from "@webiny/react-composition";
3
3
  interface PluginProps {
4
- providers?: HigherOrderComponent[];
4
+ providers?: Decorator<GenericComponent>[];
5
5
  children?: React.ReactNode;
6
6
  }
7
- export declare const Plugin: React.NamedExoticComponent<PluginProps>;
7
+ export declare const Plugin: React.MemoExoticComponent<({ providers, children }: PluginProps) => React.JSX.Element>;
8
8
  export {};
package/core/Plugin.js CHANGED
@@ -1,21 +1,12 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.Plugin = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _Provider = require("./Provider");
10
- var _Plugins = require("./Plugins");
11
- var Plugin = /*#__PURE__*/_react.default.memo(function Plugin(_ref) {
12
- var providers = _ref.providers,
13
- children = _ref.children;
14
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (providers || []).map(function (provider, index) {
15
- return /*#__PURE__*/_react.default.createElement(_Provider.Provider, {
16
- key: index,
17
- hoc: provider
18
- });
19
- }), children ? /*#__PURE__*/_react.default.createElement(_Plugins.Plugins, null, children) : null);
1
+ import react from "react";
2
+ import { Provider } from "./Provider.js";
3
+ import { Plugins } from "./Plugins.js";
4
+ const Plugin_Plugin = /*#__PURE__*/ react.memo(function({ providers, children }) {
5
+ return /*#__PURE__*/ react.createElement(react.Fragment, null, (providers || []).map((provider, index)=>/*#__PURE__*/ react.createElement(Provider, {
6
+ key: index,
7
+ hoc: provider
8
+ })), children ? /*#__PURE__*/ react.createElement(Plugins, null, children) : null);
20
9
  });
21
- exports.Plugin = Plugin;
10
+ export { Plugin_Plugin as Plugin };
11
+
12
+ //# sourceMappingURL=Plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Plugin","React","memo","providers","children","map","provider","index"],"sources":["Plugin.tsx"],"sourcesContent":["import React from \"react\";\nimport { Provider } from \"./Provider\";\nimport { Plugins } from \"./Plugins\";\nimport { HigherOrderComponent } from \"@webiny/react-composition\";\n\ninterface PluginProps {\n providers?: HigherOrderComponent[];\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;AACA;AACA;AAQO,IAAMA,MAAM,gBAAGC,cAAK,CAACC,IAAI,CAAC,SAASF,MAAM,OAAuC;EAAA,IAApCG,SAAS,QAATA,SAAS;IAAEC,QAAQ,QAARA,QAAQ;EAClE,oBACI,4DACK,CAACD,SAAS,IAAI,EAAE,EAAEE,GAAG,CAAC,UAACC,QAAQ,EAAEC,KAAK;IAAA,oBACnC,6BAAC,kBAAQ;MAAC,GAAG,EAAEA,KAAM;MAAC,GAAG,EAAED;IAAS,EAAG;EAAA,CAC1C,CAAC,EACDF,QAAQ,gBAAG,6BAAC,gBAAO,QAAEA,QAAQ,CAAW,GAAG,IAAI,CACjD;AAEX,CAAC,CAAC;AAAC"}
1
+ {"version":3,"file":"core/Plugin.js","sources":["../../src/core/Plugin.tsx"],"sourcesContent":["import React from \"react\";\nimport { Provider } from \"./Provider.js\";\nimport { Plugins } from \"./Plugins.js\";\nimport type { GenericComponent, Decorator } from \"@webiny/react-composition\";\n\ninterface PluginProps {\n providers?: Decorator<GenericComponent>[];\n children?: React.ReactNode;\n}\n\nexport const Plugin = React.memo(function Plugin({ providers, children }: PluginProps) {\n return (\n <>\n {(providers || []).map((provider, index) => (\n <Provider key={index} hoc={provider} />\n ))}\n {children ? <Plugins>{children}</Plugins> : null}\n </>\n );\n});\n"],"names":["Plugin","React","providers","children","provider","index","Provider","Plugins"],"mappings":";;;AAUO,MAAMA,gBAAS,WAAHA,GAAGC,MAAAA,IAAU,CAAC,SAAgB,EAAEC,SAAS,EAAEC,QAAQ,EAAe;IACjF,OAAO,WAAP,GACI,0CACMD,AAAAA,CAAAA,aAAa,EAAC,EAAG,GAAG,CAAC,CAACE,UAAUC,QAAAA,WAAAA,GAC9B,oBAACC,UAAQA;YAAC,KAAKD;YAAO,KAAKD;aAE9BD,WAAW,WAAXA,GAAW,oBAACI,SAAOA,MAAEJ,YAAsB;AAGxD"}
package/core/Plugins.d.ts CHANGED
@@ -1,12 +1,15 @@
1
1
  import React from "react";
2
2
  export declare const PluginsContext: React.Context<boolean>;
3
3
  interface PluginsProviderComponentProps {
4
- children: JSX.Element[];
4
+ children: React.JSX.Element[];
5
5
  }
6
- export declare const PluginsProvider: React.NamedExoticComponent<PluginsProviderComponentProps>;
6
+ export declare const PluginsProvider: React.MemoExoticComponent<({ children }: PluginsProviderComponentProps) => React.JSX.Element>;
7
7
  /**
8
8
  * @param children
9
9
  * @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.
10
10
  */
11
- export declare const Plugins: React.FC;
11
+ interface PluginsComponentsProps {
12
+ children: React.ReactNode;
13
+ }
14
+ export declare const Plugins: React.MemoExoticComponent<({ children }: PluginsComponentsProps) => React.JSX.Element | null>;
12
15
  export {};
package/core/Plugins.js CHANGED
@@ -1,45 +1,21 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.PluginsProvider = exports.PluginsContext = exports.Plugins = void 0;
8
- var _react = _interopRequireWildcard(require("react"));
9
- var _App = require("../App");
10
- var PluginsContext = /*#__PURE__*/(0, _react.createContext)(false);
11
- exports.PluginsContext = PluginsContext;
1
+ import react, { Children, Fragment, createContext, memo, useContext, useEffect } from "react";
2
+ import { useApp } from "../App.js";
3
+ const PluginsContext = /*#__PURE__*/ createContext(false);
12
4
  PluginsContext.displayName = "PluginsContext";
13
- var PluginsProviderComponent = function PluginsProviderComponent(_ref) {
14
- var children = _ref.children;
15
- /**
16
- * This context only serves as a safeguard. We need to warn users when they mount a plugin without using
17
- * the <Plugins> component. In that case, the context will not be available, and we can log warnings.
18
- */
19
- return /*#__PURE__*/_react.default.createElement(PluginsContext.Provider, {
20
- value: true
21
- }, children);
22
- };
23
- var PluginsProvider = /*#__PURE__*/(0, _react.memo)(PluginsProviderComponent);
5
+ const PluginsProviderComponent = ({ children })=>/*#__PURE__*/ react.createElement(PluginsContext.Provider, {
6
+ value: true
7
+ }, children);
8
+ const PluginsProvider = /*#__PURE__*/ memo(PluginsProviderComponent);
9
+ const Plugins = /*#__PURE__*/ react.memo(({ children })=>{
10
+ const { addPlugin } = useApp();
11
+ const hasParentPlugin = useContext(PluginsContext);
12
+ useEffect(()=>{
13
+ if (hasParentPlugin) return;
14
+ Children.forEach(children, (child)=>addPlugin(child));
15
+ }, []);
16
+ return hasParentPlugin ? /*#__PURE__*/ react.createElement(Fragment, null, children) : null;
17
+ });
18
+ Plugins.displayName = "Plugins";
19
+ export { Plugins, PluginsContext, PluginsProvider };
24
20
 
25
- /**
26
- * @param children
27
- * @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.
28
- */
29
- exports.PluginsProvider = PluginsProvider;
30
- var Plugins = function Plugins(_ref2) {
31
- var children = _ref2.children;
32
- var _useApp = (0, _App.useApp)(),
33
- addPlugin = _useApp.addPlugin;
34
- var hasParentPlugin = (0, _react.useContext)(PluginsContext);
35
- (0, _react.useEffect)(function () {
36
- if (hasParentPlugin) {
37
- return;
38
- }
39
- _react.Children.forEach(children, function (child) {
40
- return addPlugin(child);
41
- });
42
- }, []);
43
- return hasParentPlugin ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, children) : null;
44
- };
45
- exports.Plugins = Plugins;
21
+ //# sourceMappingURL=Plugins.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PluginsContext","createContext","displayName","PluginsProviderComponent","children","PluginsProvider","memo","Plugins","useApp","addPlugin","hasParentPlugin","useContext","useEffect","Children","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: React.FC<PluginsProviderComponentProps> = ({ children }) => {\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 */\nexport const Plugins: React.FC = ({ children }) => {\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;AACA;AAEO,IAAMA,cAAc,gBAAG,IAAAC,oBAAa,EAAU,KAAK,CAAC;AAAC;AAC5DD,cAAc,CAACE,WAAW,GAAG,gBAAgB;AAK7C,IAAMC,wBAAiE,GAAG,SAApEA,wBAAiE,OAAqB;EAAA,IAAfC,QAAQ,QAARA,QAAQ;EACjF;AACJ;AACA;AACA;EACI,oBAAO,6BAAC,cAAc,CAAC,QAAQ;IAAC,KAAK,EAAE;EAAK,GAAEA,QAAQ,CAA2B;AACrF,CAAC;AAEM,IAAMC,eAAe,gBAAG,IAAAC,WAAI,EAACH,wBAAwB,CAAC;;AAE7D;AACA;AACA;AACA;AAHA;AAIO,IAAMI,OAAiB,GAAG,SAApBA,OAAiB,QAAqB;EAAA,IAAfH,QAAQ,SAARA,QAAQ;EACxC,cAAsB,IAAAI,WAAM,GAAE;IAAtBC,SAAS,WAATA,SAAS;EACjB,IAAMC,eAAe,GAAG,IAAAC,iBAAU,EAACX,cAAc,CAAC;EAElD,IAAAY,gBAAS,EAAC,YAAM;IACZ,IAAIF,eAAe,EAAE;MACjB;IACJ;IAEAG,eAAQ,CAACC,OAAO,CAACV,QAAQ,EAAE,UAAAW,KAAK;MAAA,OAAIN,SAAS,CAACM,KAAK,CAAC;IAAA,EAAC;EACzD,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOL,eAAe,gBAAG,6BAAC,eAAQ,QAAEN,QAAQ,CAAY,GAAG,IAAI;AACnE,CAAC;AAAC"}
1
+ {"version":3,"file":"core/Plugins.js","sources":["../../src/core/Plugins.tsx"],"sourcesContent":["import React, { Children, createContext, Fragment, memo, useContext, useEffect } from \"react\";\nimport { useApp } from \"~/App.js\";\n\nexport const PluginsContext = createContext<boolean>(false);\nPluginsContext.displayName = \"PluginsContext\";\n\ninterface PluginsProviderComponentProps {\n children: React.JSX.Element[];\n}\nconst PluginsProviderComponent = ({ children }: PluginsProviderComponentProps) => {\n /**\n * This context only serves as a safeguard. We need to warn users when they mount a plugin without using\n * the <Plugins> component. In that case, the context will not be available, and we can log warnings.\n */\n return <PluginsContext.Provider value={true}>{children}</PluginsContext.Provider>;\n};\n\nexport const PluginsProvider = memo(PluginsProviderComponent);\n\n/**\n * @param children\n * @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.\n */\ninterface PluginsComponentsProps {\n children: React.ReactNode;\n}\nexport const Plugins = React.memo(({ children }: PluginsComponentsProps) => {\n const { addPlugin } = useApp();\n const hasParentPlugin = useContext(PluginsContext);\n\n useEffect(() => {\n if (hasParentPlugin) {\n return;\n }\n\n Children.forEach(children, child => addPlugin(child));\n }, []);\n\n return hasParentPlugin ? <Fragment>{children}</Fragment> : null;\n});\n\nPlugins.displayName = \"Plugins\";\n"],"names":["PluginsContext","createContext","PluginsProviderComponent","children","PluginsProvider","memo","Plugins","React","addPlugin","useApp","hasParentPlugin","useContext","useEffect","Children","child","Fragment"],"mappings":";;AAGO,MAAMA,iBAAiB,WAAHA,GAAGC,cAAuB;AACrDD,eAAe,WAAW,GAAG;AAK7B,MAAME,2BAA2B,CAAC,EAAEC,QAAQ,EAAiC,GAKlE,WAAP,GAAO,oBAACH,eAAe,QAAQ;QAAC,OAAO;OAAOG;AAG3C,MAAMC,kBAAkB,WAAHA,GAAGC,KAAKH;AAS7B,MAAMI,UAAU,WAAHA,GAAGC,MAAAA,IAAU,CAAC,CAAC,EAAEJ,QAAQ,EAA0B;IACnE,MAAM,EAAEK,SAAS,EAAE,GAAGC;IACtB,MAAMC,kBAAkBC,WAAWX;IAEnCY,UAAU;QACN,IAAIF,iBACA;QAGJG,SAAS,OAAO,CAACV,UAAUW,CAAAA,QAASN,UAAUM;IAClD,GAAG,EAAE;IAEL,OAAOJ,kBAAkB,WAAlBA,GAAkB,oBAACK,UAAQA,MAAEZ,YAAuB;AAC/D;AAEAG,QAAQ,WAAW,GAAG"}
@@ -1,9 +1,8 @@
1
- import React from "react";
2
- import { HigherOrderComponent } from "../index";
1
+ import type { GenericComponent, Decorator } from "../index.js";
3
2
  export interface ProviderProps {
4
- hoc: HigherOrderComponent;
3
+ hoc: Decorator<GenericComponent>;
5
4
  }
6
5
  /**
7
6
  * Register a new React context provider.
8
7
  */
9
- export declare const Provider: React.FC<ProviderProps>;
8
+ export declare const Provider: ({ hoc }: ProviderProps) => null;
package/core/Provider.js CHANGED
@@ -1,21 +1,10 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Provider = void 0;
7
- var _react = require("react");
8
- var _ = require("./..");
9
- /**
10
- * Register a new React context provider.
11
- */
12
- var Provider = function Provider(_ref) {
13
- var hoc = _ref.hoc;
14
- var _useApp = (0, _.useApp)(),
15
- addProvider = _useApp.addProvider;
16
- (0, _react.useEffect)(function () {
17
- return addProvider(hoc);
18
- }, []);
19
- return null;
1
+ import { useEffect } from "react";
2
+ import { useApp } from "../index.js";
3
+ const Provider = ({ hoc })=>{
4
+ const { addProvider } = useApp();
5
+ useEffect(()=>addProvider(hoc), []);
6
+ return null;
20
7
  };
21
- exports.Provider = Provider;
8
+ export { Provider };
9
+
10
+ //# sourceMappingURL=Provider.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Provider","hoc","useApp","addProvider","useEffect"],"sources":["Provider.tsx"],"sourcesContent":["import React, { useEffect } from \"react\";\nimport { HigherOrderComponent, useApp } from \"~/index\";\n\nexport interface ProviderProps {\n hoc: HigherOrderComponent;\n}\n\n/**\n * Register a new React context provider.\n */\nexport const Provider: React.FC<ProviderProps> = ({ hoc }) => {\n const { addProvider } = useApp();\n\n useEffect(() => {\n return addProvider(hoc);\n }, []);\n\n return null;\n};\n"],"mappings":";;;;;;AAAA;AACA;AAMA;AACA;AACA;AACO,IAAMA,QAAiC,GAAG,SAApCA,QAAiC,OAAgB;EAAA,IAAVC,GAAG,QAAHA,GAAG;EACnD,cAAwB,IAAAC,QAAM,GAAE;IAAxBC,WAAW,WAAXA,WAAW;EAEnB,IAAAC,gBAAS,EAAC,YAAM;IACZ,OAAOD,WAAW,CAACF,GAAG,CAAC;EAC3B,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO,IAAI;AACf,CAAC;AAAC"}
1
+ {"version":3,"file":"core/Provider.js","sources":["../../src/core/Provider.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport type { GenericComponent, Decorator } from \"~/index.js\";\nimport { useApp } from \"~/index.js\";\n\nexport interface ProviderProps {\n hoc: Decorator<GenericComponent>;\n}\n\n/**\n * Register a new React context provider.\n */\nexport const Provider = ({ hoc }: ProviderProps) => {\n const { addProvider } = useApp();\n\n useEffect(() => {\n return addProvider(hoc);\n }, []);\n\n return null;\n};\n"],"names":["Provider","hoc","addProvider","useApp","useEffect"],"mappings":";;AAWO,MAAMA,WAAW,CAAC,EAAEC,GAAG,EAAiB;IAC3C,MAAM,EAAEC,WAAW,EAAE,GAAGC;IAExBC,UAAU,IACCF,YAAYD,MACpB,EAAE;IAEL,OAAO;AACX"}
@@ -1,6 +1,10 @@
1
- import { HigherOrderComponent } from "@webiny/react-composition";
1
+ import type React from "react";
2
+ import type { Decorator, GenericComponent } from "@webiny/react-composition";
3
+ export interface ChildrenProps {
4
+ children: React.ReactNode;
5
+ }
2
6
  /**
3
- * Creates a Higher Order Component which is meant to wrap the entire app content.
7
+ * Creates a Higher Order Component which wraps the entire app content.
4
8
  * This is mostly useful for adding React Context providers.
5
9
  */
6
- export declare function createProvider(hoc: HigherOrderComponent): HigherOrderComponent;
10
+ export declare function createProvider(decorator: Decorator<GenericComponent<ChildrenProps>>): Decorator<GenericComponent<ChildrenProps>>;
@@ -1,13 +1,6 @@
1
- "use strict";
1
+ function createProvider(decorator) {
2
+ return decorator;
3
+ }
4
+ export { createProvider };
2
5
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createProvider = createProvider;
7
- /**
8
- * Creates a Higher Order Component which is meant to wrap the entire app content.
9
- * This is mostly useful for adding React Context providers.
10
- */
11
- function createProvider(hoc) {
12
- return hoc;
13
- }
6
+ //# sourceMappingURL=createProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createProvider","hoc"],"sources":["createProvider.tsx"],"sourcesContent":["import { HigherOrderComponent } from \"@webiny/react-composition\";\n\n/**\n * Creates a Higher Order Component which is meant to wrap the entire app content.\n * This is mostly useful for adding React Context providers.\n */\nexport function createProvider(hoc: HigherOrderComponent): HigherOrderComponent {\n return hoc;\n}\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACO,SAASA,cAAc,CAACC,GAAyB,EAAwB;EAC5E,OAAOA,GAAG;AACd"}
1
+ {"version":3,"file":"core/createProvider.js","sources":["../../src/core/createProvider.tsx"],"sourcesContent":["import type React from \"react\";\nimport type { Decorator, GenericComponent } from \"@webiny/react-composition\";\n\nexport interface ChildrenProps {\n children: React.ReactNode;\n}\n\n/**\n * Creates a Higher Order Component which wraps the entire app content.\n * This is mostly useful for adding React Context providers.\n */\nexport function createProvider(\n decorator: Decorator<GenericComponent<ChildrenProps>>\n): Decorator<GenericComponent<ChildrenProps>> {\n return decorator;\n}\n"],"names":["createProvider","decorator"],"mappings":"AAWO,SAASA,eACZC,SAAqD;IAErD,OAAOA;AACX"}
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- import { HigherOrderComponent } from "@webiny/react-composition";
2
+ import type { GenericComponent, Decorator } from "@webiny/react-composition";
3
3
  /**
4
4
  * Creates a component, which, when mounted, will register an app provider.
5
5
  * This is particularly useful for wrapping the entire app with custom React Context providers.
6
6
  * For more information, visit https://www.webiny.com/docs/admin-area/basics/framework.
7
7
  */
8
- export declare function createProviderPlugin(hoc: HigherOrderComponent): React.FC;
8
+ export declare function createProviderPlugin(decorator: Decorator<GenericComponent>): () => React.JSX.Element;