@webiny/app 0.0.0-unstable.78f581c1d2 → 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 (389) hide show
  1. package/App.d.ts +25 -0
  2. package/App.js +82 -0
  3. package/App.js.map +1 -0
  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 +16 -77
  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 +15 -41
  16. package/components/Image.js.map +1 -1
  17. package/components/index.d.ts +1 -2
  18. package/components/index.js +1 -21
  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 +20 -29
  27. package/config.js.map +1 -1
  28. package/contexts/Ui/index.d.ts +4 -8
  29. package/contexts/Ui/index.js +27 -89
  30. package/contexts/Ui/index.js.map +1 -1
  31. package/core/Plugin.d.ts +8 -0
  32. package/core/Plugin.js +12 -0
  33. package/core/Plugin.js.map +1 -0
  34. package/core/Plugins.d.ts +15 -0
  35. package/core/Plugins.js +21 -0
  36. package/core/Plugins.js.map +1 -0
  37. package/core/Provider.d.ts +8 -0
  38. package/core/Provider.js +10 -0
  39. package/core/Provider.js.map +1 -0
  40. package/core/createProvider.d.ts +10 -0
  41. package/core/createProvider.js +6 -0
  42. package/core/createProvider.js.map +1 -0
  43. package/core/createProviderPlugin.d.ts +8 -0
  44. package/core/createProviderPlugin.js +12 -0
  45. package/core/createProviderPlugin.js.map +1 -0
  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 -13
  196. package/hooks/useAutocomplete/useAutocomplete.d.ts +1 -1
  197. package/hooks/useAutocomplete/useAutocomplete.js +15 -36
  198. package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
  199. package/hooks/useDataList/functions/getData.js +4 -15
  200. package/hooks/useDataList/functions/getData.js.map +1 -1
  201. package/hooks/useDataList/functions/getError.js +4 -15
  202. package/hooks/useDataList/functions/getError.js.map +1 -1
  203. package/hooks/useDataList/functions/getMeta.js +4 -15
  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 -31
  207. package/hooks/useDataList/functions/searchDataByKey.js +10 -26
  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 -13
  211. package/hooks/useDataList/useDataList.d.ts +2 -3
  212. package/hooks/useDataList/useDataList.js +139 -205
  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 -23
  216. package/hooks/useDataList/utils/prepareLoadListParams.d.ts +1 -2
  217. package/hooks/useDataList/utils/prepareLoadListParams.js +26 -45
  218. package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
  219. package/hooks/useHandler.js +14 -19
  220. package/hooks/useHandler.js.map +1 -1
  221. package/hooks/useHandlers.d.ts +3 -3
  222. package/hooks/useHandlers.js +19 -28
  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 -15
  229. package/hooks/useUi.js.map +1 -1
  230. package/i18n/i18n.js +11 -21
  231. package/i18n/i18n.js.map +1 -1
  232. package/i18n/index.d.ts +1 -1
  233. package/i18n/index.js +1 -15
  234. package/index.d.ts +25 -4
  235. package/index.js +23 -37
  236. package/package.json +38 -38
  237. package/plugins/AddQuerySelectionPlugin.d.ts +10 -3
  238. package/plugins/AddQuerySelectionPlugin.js +43 -128
  239. package/plugins/AddQuerySelectionPlugin.js.map +1 -1
  240. package/plugins/ApolloCacheObjectIdPlugin.js +15 -51
  241. package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
  242. package/plugins/ApolloDynamicLink.d.ts +3 -2
  243. package/plugins/ApolloDynamicLink.js +24 -78
  244. package/plugins/ApolloDynamicLink.js.map +1 -1
  245. package/plugins/ApolloLinkPlugin.d.ts +1 -1
  246. package/plugins/ApolloLinkPlugin.js +21 -61
  247. package/plugins/ApolloLinkPlugin.js.map +1 -1
  248. package/plugins/ConsoleLinkPlugin.d.ts +1 -1
  249. package/plugins/ConsoleLinkPlugin.js +20 -59
  250. package/plugins/ConsoleLinkPlugin.js.map +1 -1
  251. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +8 -13
  252. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +47 -95
  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 +8 -5
  261. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +68 -20
  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 +13 -36
  270. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
  271. package/plugins/NetworkErrorLinkPlugin.d.ts +4 -1
  272. package/plugins/NetworkErrorLinkPlugin.js +51 -63
  273. package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
  274. package/plugins/OmitTypenameLinkPlugin.d.ts +1 -1
  275. package/plugins/OmitTypenameLinkPlugin.js +12 -51
  276. package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
  277. package/plugins/TenantHeaderLinkPlugin.d.ts +3 -8
  278. package/plugins/TenantHeaderLinkPlugin.js +25 -82
  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 -175
  285. package/plugins/image.js.map +1 -1
  286. package/plugins/index.d.ts +5 -5
  287. package/plugins/index.js +38 -106
  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 +30 -30
  349. package/types.js +0 -13
  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 -0
  357. package/utils/index.js +2 -0
  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 -49
  363. package/components/Routes.js.map +0 -1
  364. package/components/View.d.ts +0 -8
  365. package/components/View.js +0 -41
  366. package/components/View.js.map +0 -1
  367. package/components/index.js.map +0 -1
  368. package/hooks/useAutocomplete/index.js.map +0 -1
  369. package/hooks/useDataList/functions/index.js.map +0 -1
  370. package/hooks/useDataList/index.js.map +0 -1
  371. package/hooks/useDataList/utils/index.js.map +0 -1
  372. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +0 -14
  373. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +0 -31
  374. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +0 -1
  375. package/hooks/useDataList/utils/types.d.ts +0 -34
  376. package/hooks/useDataList/utils/types.js +0 -5
  377. package/hooks/useDataList/utils/types.js.map +0 -1
  378. package/i18n/index.js.map +0 -1
  379. package/index.js.map +0 -1
  380. package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -15
  381. package/plugins/LocaleHeaderLinkPlugin.js +0 -77
  382. package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
  383. package/plugins/RoutePlugin.d.ts +0 -12
  384. package/plugins/RoutePlugin.js +0 -53
  385. package/plugins/RoutePlugin.js.map +0 -1
  386. package/plugins/ViewPlugin.d.ts +0 -14
  387. package/plugins/ViewPlugin.js +0 -58
  388. package/plugins/ViewPlugin.js.map +0 -1
  389. package/types.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["useDataList","params","useState","multiSelectedItems","multiSelect","history","location","routerHook","useRouter","getQueryOptions","useCallback","variables","client","prepareLoadListParams","queryData","useQuery","query","prevLoadParamsRef","useRef","dataListProps","data","getData","meta","getMeta","error","getError","loading","init","refresh","refetch","__loadParams","setPerPage","perPage","preparedParams","limit","parseInt","after","undefined","before","setNextPage","cursor","setPreviousPage","setSearch","search","setWhere","where","setSorters","sort","items","value","Array","isArray","returnItems","forEach","item","includes","splice","indexOf","push","isSelected","URLSearchParams","get","id","select","set","toString","isMultiSelected","isNoneMultiSelected","length","getMultiSelected","multiSelectAll","isAllMultiSelected","useEffect","prev","current"],"sources":["useDataList.ts"],"sourcesContent":["import { useState, useEffect, useRef, useCallback } from \"react\";\nimport { useQuery } from \"@apollo/react-hooks\";\nimport { useRouter } from \"@webiny/react-router\";\nimport { get, isEqual } from \"lodash\";\nimport { prepareLoadListParams } from \"./utils\";\nimport { getData, getError, getMeta } from \"./functions\";\n\nimport { DocumentNode } from \"graphql\";\nimport { ApolloClient } from \"apollo-client\";\n\nexport interface UseDataListParams {\n useRouter?: boolean;\n variables?: ((params: UseDataListParams) => any) | object;\n client?: ApolloClient<any>;\n query: DocumentNode;\n getData?: (data: any) => any;\n getMeta?: (data: any) => any;\n getError?: (data: any) => any;\n}\n\nexport interface DataListProps {\n __loadParams: any;\n refresh: (params?: any) => void;\n data: any[];\n meta: any;\n error: any;\n loading: boolean;\n isSelected: (item: any) => boolean;\n select: (item: any) => void;\n isMultiSelected: (item: any) => boolean;\n isNoneMultiSelected: () => boolean;\n isAllMultiSelected: () => boolean;\n multiSelectAll: (value: boolean) => void;\n getMultiSelected: () => any[];\n setSearch: (search: any) => void;\n setWhere: (where: any) => void;\n setSorters: (sort: any) => void;\n setPerPage: (perPage: number) => void;\n setPreviousPage: (cursor: string) => void;\n setNextPage: (cursor: string) => void;\n multiSelect: (items: string | string[], value?: boolean) => void;\n init: () => void;\n}\n\nconst useDataList = (params: UseDataListParams) => {\n const [multiSelectedItems, multiSelect] = useState<string[]>([]);\n\n let history = null;\n /**\n * TODO: figure out the location type.\n */\n let location: any = null;\n const routerHook = useRouter();\n\n if (params.useRouter !== false) {\n history = routerHook.history;\n location = routerHook.location;\n }\n\n const getQueryOptions = useCallback(() => {\n let variables = params.variables;\n if (typeof variables === \"function\") {\n variables = variables(params);\n }\n\n return {\n client: params.client,\n variables: {\n ...variables,\n ...prepareLoadListParams(location)\n }\n };\n }, []);\n\n const queryData = useQuery(params.query, getQueryOptions());\n const prevLoadParamsRef = useRef({});\n\n const dataListProps: DataListProps = {\n data: get(params, \"getData\", getData)(queryData.data),\n meta: get(params, \"getMeta\", getMeta)(queryData.data),\n error: get(params, \"getError\", getError)(queryData.data),\n\n loading: queryData.loading,\n init() {\n this.refresh();\n },\n refresh(params = null): void {\n // Refresh multi select first.\n multiSelect([]);\n\n if (!params) {\n queryData.refetch(dataListProps.__loadParams);\n return;\n }\n\n // if (history) {\n // redirectToRouteWithQueryParams(params, { history, location });\n // return;\n // }\n\n queryData.refetch(params);\n },\n setPerPage(perPage: number): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n limit: parseInt(\"\" + perPage),\n after: undefined,\n before: undefined\n };\n this.refresh(preparedParams);\n },\n setNextPage(cursor: string): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n after: cursor,\n before: undefined\n };\n this.refresh(preparedParams);\n },\n setPreviousPage(cursor: string): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n after: undefined,\n before: cursor\n };\n this.refresh(preparedParams);\n },\n setSearch(search): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n search,\n after: undefined,\n before: undefined\n };\n this.refresh(preparedParams);\n },\n setWhere(where): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n where,\n after: undefined,\n before: undefined\n };\n this.refresh(preparedParams);\n },\n setSorters(sort): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n sort,\n after: undefined,\n before: undefined\n };\n this.refresh(preparedParams);\n },\n multiSelect(items, value): void {\n if (!Array.isArray(items)) {\n items = [items];\n }\n\n const returnItems = [...multiSelectedItems];\n\n items.forEach(item => {\n if (value === undefined) {\n returnItems.includes(item)\n ? returnItems.splice(returnItems.indexOf(item), 1)\n : returnItems.push(item);\n } else {\n if (value === true) {\n !returnItems.includes(item) && returnItems.push(item);\n } else {\n returnItems.includes(item) &&\n returnItems.splice(returnItems.indexOf(item), 1);\n }\n }\n });\n\n multiSelect(returnItems);\n },\n isSelected(item) {\n const query = new URLSearchParams(location.search);\n return query.get(\"id\") === item.id;\n },\n select(item) {\n const query = new URLSearchParams(location.search);\n query.set(\"id\", item.id);\n history.push({ search: query.toString() });\n },\n isMultiSelected(item) {\n if (!Array.isArray(multiSelectedItems)) {\n return false;\n }\n\n return multiSelectedItems.includes(item);\n },\n isNoneMultiSelected() {\n return multiSelectedItems.length === 0;\n },\n getMultiSelected() {\n return multiSelectedItems;\n },\n multiSelectAll(value: boolean): void {\n const { data } = dataListProps;\n if (Array.isArray(data)) {\n dataListProps.multiSelect(data, value);\n } else {\n dataListProps.multiSelect([], value);\n }\n },\n isAllMultiSelected(): boolean {\n const { data } = dataListProps;\n\n return Array.isArray(data) && multiSelectedItems.length === data.length;\n },\n\n __loadParams: prepareLoadListParams(location)\n };\n\n useEffect(() => {\n const params = {\n prev: prevLoadParamsRef.current,\n current: dataListProps.__loadParams\n };\n\n if (!isEqual(params.prev, params.current)) {\n dataListProps.init();\n }\n\n prevLoadParamsRef.current = params.current;\n });\n\n return dataListProps;\n};\n\nexport { useDataList };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AAuCA,IAAMA,WAAW,GAAG,SAAdA,WAAc,CAACC,MAAD,EAA+B;EAC/C,gBAA0C,IAAAC,eAAA,EAAmB,EAAnB,CAA1C;EAAA;EAAA,IAAOC,kBAAP;EAAA,IAA2BC,YAA3B;;EAEA,IAAIC,OAAO,GAAG,IAAd;EACA;AACJ;AACA;;EACI,IAAIC,QAAa,GAAG,IAApB;EACA,IAAMC,UAAU,GAAG,IAAAC,sBAAA,GAAnB;;EAEA,IAAIP,MAAM,CAACO,SAAP,KAAqB,KAAzB,EAAgC;IAC5BH,OAAO,GAAGE,UAAU,CAACF,OAArB;IACAC,QAAQ,GAAGC,UAAU,CAACD,QAAtB;EACH;;EAED,IAAMG,eAAe,GAAG,IAAAC,kBAAA,EAAY,YAAM;IACtC,IAAIC,SAAS,GAAGV,MAAM,CAACU,SAAvB;;IACA,IAAI,OAAOA,SAAP,KAAqB,UAAzB,EAAqC;MACjCA,SAAS,GAAGA,SAAS,CAACV,MAAD,CAArB;IACH;;IAED,OAAO;MACHW,MAAM,EAAEX,MAAM,CAACW,MADZ;MAEHD,SAAS,8DACFA,SADE,GAEF,IAAAE,4BAAA,EAAsBP,QAAtB,CAFE;IAFN,CAAP;EAOH,CAbuB,EAarB,EAbqB,CAAxB;EAeA,IAAMQ,SAAS,GAAG,IAAAC,oBAAA,EAASd,MAAM,CAACe,KAAhB,EAAuBP,eAAe,EAAtC,CAAlB;EACA,IAAMQ,iBAAiB,GAAG,IAAAC,aAAA,EAAO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wHjCC,gBAxHiC,8BAwHd;MACf,OAAOlE,kBAAP;IACH,CA1HgC;IA2HjCmE,cA3HiC,0BA2HlBrB,KA3HkB,EA2HI;MACjC,IAAQ7B,IAAR,GAAiBD,aAAjB,CAAQC,IAAR;;MACA,IAAI8B,KAAK,CAACC,OAAN,CAAc/B,IAAd,CAAJ,EAAyB;QACrBD,aAAa,CAACf,WAAd,CAA0BgB,IAA1B,EAAgC6B,KAAhC;MACH,CAFD,MAEO;QACH9B,aAAa,CAACf,WAAd,CAA0B,EAA1B,EAA8B6C,KAA9B;MACH;IACJ,CAlIgC;IAmIjCsB,kBAnIiC,gCAmIH;MAC1B,IAAQnD,IAAR,GAAiBD,aAAjB,CAAQC,IAAR;MAEA,OAAO8B,KAAK,CAACC,OAAN,CAAc/B,IAAd,KAAuBjB,kBAAkB,CAACiE,MAAnB,KAA8BhD,IAAI,CAACgD,MAAjE;IACH,CAvIgC;IAyIjCtC,YAAY,EAAE,IAAAjB,4BAAA,EAAsBP,QAAtB;EAzImB,CAArC;EA4IA,IAAAkE,gBAAA,EAAU,YAAM;IACZ,IAAMvE,MAAM,GAAG;MACXwE,IAAI,EAAExD,iBAAiB,CAACyD,OADb;MAEXA,OAAO,EAAEvD,aAAa,CAACW;IAFZ,CAAf;;IAKA,IAAI,CAAC,uBAAQ7B,MAAM,CAACwE,IAAf,EAAqBxE,MAAM,CAACyE,OAA5B,CAAL,EAA2C;MACvCvD,aAAa,CAACQ,IAAd;IACH;;IAEDV,iBAAiB,CAACyD,OAAlB,GAA4BzE,MAAM,CAACyE,OAAnC;EACH,CAXD;EAaA,OAAOvD,aAAP;AACH,CA3LD"}
1
+ {"version":3,"file":"hooks/useDataList/useDataList.js","sources":["../../../src/hooks/useDataList/useDataList.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useQuery } from \"@apollo/react-hooks\";\nimport get from \"lodash/get.js\";\nimport isEqual from \"lodash/isEqual.js\";\nimport { prepareLoadListParams } from \"./utils/index.js\";\nimport { getData, getError, getMeta } from \"./functions/index.js\";\n\nimport type { DocumentNode } from \"graphql\";\nimport type { ApolloClient } from \"apollo-client\";\n\nexport interface UseDataListParams {\n variables?: ((params: UseDataListParams) => any) | object;\n client?: ApolloClient<any>;\n query: DocumentNode;\n getData?: (data: any) => any;\n getMeta?: (data: any) => any;\n getError?: (data: any) => any;\n}\n\nexport interface DataListProps {\n __loadParams: any;\n refresh: (params?: any) => void;\n data: any[];\n meta: any;\n error: any;\n loading: boolean;\n isSelected: (item: any) => boolean;\n select: (item: any) => void;\n isMultiSelected: (item: any) => boolean;\n isNoneMultiSelected: () => boolean;\n isAllMultiSelected: () => boolean;\n multiSelectAll: (value: boolean) => void;\n getMultiSelected: () => any[];\n setSearch: (search: any) => void;\n setWhere: (where: any) => void;\n setSorters: (sort: any) => void;\n setPerPage: (perPage: number) => void;\n setPreviousPage: (cursor: string) => void;\n setNextPage: (cursor: string) => void;\n multiSelect: (items: string | string[], value?: boolean) => void;\n init: () => void;\n}\n\nconst useDataList = (params: UseDataListParams) => {\n const [multiSelectedItems, multiSelect] = useState<string[]>([]);\n\n const getQueryOptions = useCallback(() => {\n let variables = params.variables;\n if (typeof variables === \"function\") {\n variables = variables(params);\n }\n\n return {\n client: params.client,\n variables: {\n ...variables,\n ...prepareLoadListParams()\n }\n };\n }, []);\n\n const queryData = useQuery(params.query, getQueryOptions());\n const prevLoadParamsRef = useRef({});\n\n const dataListProps: DataListProps = {\n data: get(params, \"getData\", getData)(queryData.data),\n meta: get(params, \"getMeta\", getMeta)(queryData.data),\n error: get(params, \"getError\", getError)(queryData.data),\n\n loading: queryData.loading,\n init() {\n this.refresh();\n },\n refresh(params = null): void {\n // Refresh multi select first.\n multiSelect([]);\n\n if (!params) {\n queryData.refetch(dataListProps.__loadParams);\n return;\n }\n\n queryData.refetch(params);\n },\n setPerPage(perPage: number): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n limit: parseInt(\"\" + perPage),\n after: undefined,\n before: undefined\n };\n this.refresh(preparedParams);\n },\n setNextPage(cursor: string): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n after: cursor,\n before: undefined\n };\n this.refresh(preparedParams);\n },\n setPreviousPage(cursor: string): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n after: undefined,\n before: cursor\n };\n this.refresh(preparedParams);\n },\n setSearch(search): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n search,\n after: undefined,\n before: undefined\n };\n this.refresh(preparedParams);\n },\n setWhere(where): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n where,\n after: undefined,\n before: undefined\n };\n this.refresh(preparedParams);\n },\n setSorters(sort): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n sort,\n after: undefined,\n before: undefined\n };\n this.refresh(preparedParams);\n },\n multiSelect(items, value): void {\n if (!Array.isArray(items)) {\n items = [items];\n }\n\n const returnItems = [...multiSelectedItems];\n\n items.forEach(item => {\n if (value === undefined) {\n returnItems.includes(item)\n ? returnItems.splice(returnItems.indexOf(item), 1)\n : returnItems.push(item);\n } else {\n if (value === true) {\n !returnItems.includes(item) && returnItems.push(item);\n } else {\n returnItems.includes(item) &&\n returnItems.splice(returnItems.indexOf(item), 1);\n }\n }\n });\n\n multiSelect(returnItems);\n },\n isSelected(item) {\n const query = new URLSearchParams(location.search);\n return query.get(\"id\") === item.id;\n },\n select(item) {\n const query = new URLSearchParams(location.search);\n query.set(\"id\", item.id);\n },\n isMultiSelected(item) {\n if (!Array.isArray(multiSelectedItems)) {\n return false;\n }\n\n return multiSelectedItems.includes(item);\n },\n isNoneMultiSelected() {\n return multiSelectedItems.length === 0;\n },\n getMultiSelected() {\n return multiSelectedItems;\n },\n multiSelectAll(value: boolean): void {\n const { data } = dataListProps;\n if (Array.isArray(data)) {\n dataListProps.multiSelect(data, value);\n } else {\n dataListProps.multiSelect([], value);\n }\n },\n isAllMultiSelected(): boolean {\n const { data } = dataListProps;\n\n return Array.isArray(data) && multiSelectedItems.length === data.length;\n },\n\n __loadParams: prepareLoadListParams(location)\n };\n\n useEffect(() => {\n const params = {\n prev: prevLoadParamsRef.current,\n current: dataListProps.__loadParams\n };\n\n if (!isEqual(params.prev, params.current)) {\n dataListProps.init();\n }\n\n prevLoadParamsRef.current = params.current;\n });\n\n return dataListProps;\n};\n\nexport { useDataList };\n"],"names":["useDataList","params","multiSelectedItems","multiSelect","useState","getQueryOptions","useCallback","variables","prepareLoadListParams","queryData","useQuery","prevLoadParamsRef","useRef","dataListProps","get","getData","getMeta","getError","perPage","preparedParams","parseInt","undefined","cursor","search","where","sort","items","value","Array","returnItems","item","query","URLSearchParams","location","data","useEffect","isEqual"],"mappings":";;;;;;AA2CA,MAAMA,cAAc,CAACC;IACjB,MAAM,CAACC,oBAAoBC,YAAY,GAAGC,SAAmB,EAAE;IAE/D,MAAMC,kBAAkBC,YAAY;QAChC,IAAIC,YAAYN,OAAO,SAAS;QAChC,IAAI,AAAqB,cAArB,OAAOM,WACPA,YAAYA,UAAUN;QAG1B,OAAO;YACH,QAAQA,OAAO,MAAM;YACrB,WAAW;gBACP,GAAGM,SAAS;gBACZ,GAAGC,uBAAuB;YAC9B;QACJ;IACJ,GAAG,EAAE;IAEL,MAAMC,YAAYC,SAAST,OAAO,KAAK,EAAEI;IACzC,MAAMM,oBAAoBC,OAAO,CAAC;IAElC,MAAMC,gBAA+B;QACjC,MAAMC,IAAIb,QAAQ,WAAWc,SAASN,UAAU,IAAI;QACpD,MAAMK,IAAIb,QAAQ,WAAWe,SAASP,UAAU,IAAI;QACpD,OAAOK,IAAIb,QAAQ,YAAYgB,UAAUR,UAAU,IAAI;QAEvD,SAASA,UAAU,OAAO;QAC1B;YACI,IAAI,CAAC,OAAO;QAChB;QACA,SAAQR,SAAS,IAAI;YAEjBE,YAAY,EAAE;YAEd,IAAI,CAACF,QAAQ,YACTQ,UAAU,OAAO,CAACI,cAAc,YAAY;YAIhDJ,UAAU,OAAO,CAACR;QACtB;QACA,YAAWiB,OAAe;YACtB,MAAM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AAQ,CAACC,SACjBD,YAAY,MAAM,CAACA,YAAY,OAAO,CAACC,OAAO;YAG9D;YAEA3B,YAAY0B;QAChB;QACA,YAAWC,IAAI;YACX,MAAMC,QAAQ,IAAIC,gBAAgBC,SAAS,MAAM;YACjD,OAAOF,MAAM,GAAG,CAAC,UAAUD,KAAK,EAAE;QACtC;QACA,QAAOA,IAAI;YACP,MAAMC,QAAQ,IAAIC,gBAAgBC,SAAS,MAAM;YACjDF,MAAM,GAAG,CAAC,MAAMD,KAAK,EAAE;QAC3B;QACA,iBAAgBA,IAAI;YAChB,IAAI,CAACF,MAAM,OAAO,CAAC1B,qBACf,OAAO;YAGX,OAAOA,mBAAmB,QAAQ,CAAC4B;QACvC;QACA;YACI,OAAO5B,AAA8B,MAA9BA,mBAAmB,MAAM;QACpC;QACA;YACI,OAAOA;QACX;QACA,gBAAeyB,KAAc;YACzB,MAAM,EAAEO,IAAI,EAAE,GAAGrB;YACjB,IAAIe,MAAM,OAAO,CAACM,OACdrB,cAAc,WAAW,CAACqB,MAAMP;iBAEhCd,cAAc,WAAW,CAAC,EAAE,EAAEc;QAEtC;QACA;YACI,MAAM,EAAEO,IAAI,EAAE,GAAGrB;YAEjB,OAAOe,MAAM,OAAO,CAACM,SAAShC,mBAAmB,MAAM,KAAKgC,KAAK,MAAM;QAC3E;QAEA,cAAc1B,sBAAsByB;IACxC;IAEAE,UAAU;QACN,MAAMlC,SAAS;YACX,MAAMU,kBAAkB,OAAO;YAC/B,SAASE,cAAc,YAAY;QACvC;QAEA,IAAI,CAACuB,QAAQnC,OAAO,IAAI,EAAEA,OAAO,OAAO,GACpCY,cAAc,IAAI;QAGtBF,kBAAkB,OAAO,GAAGV,OAAO,OAAO;IAC9C;IAEA,OAAOY;AACX"}
@@ -1,2 +1 @@
1
- export { default as prepareLoadListParams } from "./prepareLoadListParams";
2
- export { default as redirectToRouteWithQueryParams } from "./redirectToRouteWithQueryParams";
1
+ export { default as prepareLoadListParams } from "./prepareLoadListParams.js";
@@ -1,23 +1 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- Object.defineProperty(exports, "prepareLoadListParams", {
9
- enumerable: true,
10
- get: function get() {
11
- return _prepareLoadListParams.default;
12
- }
13
- });
14
- Object.defineProperty(exports, "redirectToRouteWithQueryParams", {
15
- enumerable: true,
16
- get: function get() {
17
- return _redirectToRouteWithQueryParams.default;
18
- }
19
- });
20
-
21
- var _prepareLoadListParams = _interopRequireDefault(require("./prepareLoadListParams"));
22
-
23
- var _redirectToRouteWithQueryParams = _interopRequireDefault(require("./redirectToRouteWithQueryParams"));
1
+ export { default as prepareLoadListParams } from "./prepareLoadListParams.js";
@@ -1,4 +1,3 @@
1
- /// <reference types="web" />
2
1
  interface Params {
3
2
  after?: string;
4
3
  before?: string;
@@ -7,5 +6,5 @@ interface Params {
7
6
  where?: Record<string, any>;
8
7
  search?: string;
9
8
  }
10
- declare const _default: (location: Location) => Params;
9
+ declare const _default: (location?: Location) => Params;
11
10
  export default _default;
@@ -1,48 +1,29 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var keys = ["sort", "where", "search"];
8
-
9
- var _default = function _default(location) {
10
- var params = {};
11
-
12
- if (location) {
13
- var query = new URLSearchParams(location.search);
14
- var after = query.get("after");
15
- var before = query.get("before");
16
- var limit = query.get("limit");
17
-
18
- if (after) {
19
- params.after = after;
20
- }
21
-
22
- if (before) {
23
- params.before = before;
24
- }
25
-
26
- if (limit) {
27
- params.limit = parseInt(limit);
28
- }
29
-
30
- keys.forEach(function (key) {
31
- var value = query.get(key);
32
-
33
- if (typeof value !== "string") {
34
- return;
35
- }
36
-
37
- try {
38
- params[key] = JSON.parse(value);
39
- } catch (e) {
40
- params[key] = value;
41
- }
1
+ const keys = [
2
+ "sort",
3
+ "where",
4
+ "search"
5
+ ];
6
+ const prepareLoadListParams = (location)=>{
7
+ const params = {};
8
+ if (!location) return params;
9
+ const query = new URLSearchParams(location.search);
10
+ const after = query.get("after");
11
+ const before = query.get("before");
12
+ const limit = query.get("limit");
13
+ if (after) params.after = after;
14
+ if (before) params.before = before;
15
+ if (limit) params.limit = parseInt(limit);
16
+ keys.forEach((key)=>{
17
+ const value = query.get(key);
18
+ if ("string" != typeof value) return;
19
+ try {
20
+ params[key] = JSON.parse(value);
21
+ } catch {
22
+ params[key] = value;
23
+ }
42
24
  });
43
- }
44
-
45
- return params;
25
+ return params;
46
26
  };
27
+ export default prepareLoadListParams;
47
28
 
48
- exports.default = _default;
29
+ //# sourceMappingURL=prepareLoadListParams.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["keys","location","params","query","URLSearchParams","search","after","get","before","limit","parseInt","forEach","key","value","JSON","parse","e"],"sources":["prepareLoadListParams.ts"],"sourcesContent":["interface Params {\n after?: string;\n before?: string;\n limit?: number;\n sort?: string;\n where?: Record<string, any>;\n search?: string;\n}\n\nconst keys: (keyof Params)[] = [\"sort\", \"where\", \"search\"];\n\nexport default (location: Location): Params => {\n const params: Params = {};\n\n if (location) {\n const query = new URLSearchParams(location.search);\n\n const after = query.get(\"after\");\n const before = query.get(\"before\");\n const limit = query.get(\"limit\");\n\n if (after) {\n params.after = after;\n }\n\n if (before) {\n params.before = before;\n }\n\n if (limit) {\n params.limit = parseInt(limit);\n }\n\n keys.forEach(key => {\n const value = query.get(key);\n if (typeof value !== \"string\") {\n return;\n }\n try {\n params[key] = JSON.parse(value);\n } catch (e) {\n params[key] = value as any;\n }\n });\n }\n\n return params as Params;\n};\n"],"mappings":";;;;;;AASA,IAAMA,IAAsB,GAAG,CAAC,MAAD,EAAS,OAAT,EAAkB,QAAlB,CAA/B;;eAEe,kBAACC,QAAD,EAAgC;EAC3C,IAAMC,MAAc,GAAG,EAAvB;;EAEA,IAAID,QAAJ,EAAc;IACV,IAAME,KAAK,GAAG,IAAIC,eAAJ,CAAoBH,QAAQ,CAACI,MAA7B,CAAd;IAEA,IAAMC,KAAK,GAAGH,KAAK,CAACI,GAAN,CAAU,OAAV,CAAd;IACA,IAAMC,MAAM,GAAGL,KAAK,CAACI,GAAN,CAAU,QAAV,CAAf;IACA,IAAME,KAAK,GAAGN,KAAK,CAACI,GAAN,CAAU,OAAV,CAAd;;IAEA,IAAID,KAAJ,EAAW;MACPJ,MAAM,CAACI,KAAP,GAAeA,KAAf;IACH;;IAED,IAAIE,MAAJ,EAAY;MACRN,MAAM,CAACM,MAAP,GAAgBA,MAAhB;IACH;;IAED,IAAIC,KAAJ,EAAW;MACPP,MAAM,CAACO,KAAP,GAAeC,QAAQ,CAACD,KAAD,CAAvB;IACH;;IAEDT,IAAI,CAACW,OAAL,CAAa,UAAAC,GAAG,EAAI;MAChB,IAAMC,KAAK,GAAGV,KAAK,CAACI,GAAN,CAAUK,GAAV,CAAd;;MACA,IAAI,OAAOC,KAAP,KAAiB,QAArB,EAA+B;QAC3B;MACH;;MACD,IAAI;QACAX,MAAM,CAACU,GAAD,CAAN,GAAcE,IAAI,CAACC,KAAL,CAAWF,KAAX,CAAd;MACH,CAFD,CAEE,OAAOG,CAAP,EAAU;QACRd,MAAM,CAACU,GAAD,CAAN,GAAcC,KAAd;MACH;IACJ,CAVD;EAWH;;EAED,OAAOX,MAAP;AACH,C"}
1
+ {"version":3,"file":"hooks/useDataList/utils/prepareLoadListParams.js","sources":["../../../../src/hooks/useDataList/utils/prepareLoadListParams.ts"],"sourcesContent":["interface Params {\n after?: string;\n before?: string;\n limit?: number;\n sort?: string;\n where?: Record<string, any>;\n search?: string;\n}\n\nconst keys: (keyof Params)[] = [\"sort\", \"where\", \"search\"];\n\nexport default (location?: Location): Params => {\n const params: Params = {};\n if (!location) {\n return params;\n }\n\n const query = new URLSearchParams(location.search);\n\n const after = query.get(\"after\");\n const before = query.get(\"before\");\n const limit = query.get(\"limit\");\n\n if (after) {\n params.after = after;\n }\n\n if (before) {\n params.before = before;\n }\n\n if (limit) {\n params.limit = parseInt(limit);\n }\n\n keys.forEach(key => {\n const value = query.get(key);\n if (typeof value !== \"string\") {\n return;\n }\n try {\n params[key] = JSON.parse(value);\n } catch {\n /**\n * If we can't parse the value, it means it's a string.\n */\n // @ts-expect-error\n params[key] = value;\n }\n });\n return params;\n};\n"],"names":["keys","location","params","query","URLSearchParams","after","before","limit","parseInt","key","value","JSON"],"mappings":"AASA,MAAMA,OAAyB;IAAC;IAAQ;IAAS;CAAS;AAE1D,8BAAgB,CAAAC;IACZ,MAAMC,SAAiB,CAAC;IACxB,IAAI,CAACD,UACD,OAAOC;IAGX,MAAMC,QAAQ,IAAIC,gBAAgBH,SAAS,MAAM;IAEjD,MAAMI,QAAQF,MAAM,GAAG,CAAC;IACxB,MAAMG,SAASH,MAAM,GAAG,CAAC;IACzB,MAAMI,QAAQJ,MAAM,GAAG,CAAC;IAExB,IAAIE,OACAH,OAAO,KAAK,GAAGG;IAGnB,IAAIC,QACAJ,OAAO,MAAM,GAAGI;IAGpB,IAAIC,OACAL,OAAO,KAAK,GAAGM,SAASD;IAG5BP,KAAK,OAAO,CAACS,CAAAA;QACT,MAAMC,QAAQP,MAAM,GAAG,CAACM;QACxB,IAAI,AAAiB,YAAjB,OAAOC,OACP;QAEJ,IAAI;YACAR,MAAM,CAACO,IAAI,GAAGE,KAAK,KAAK,CAACD;QAC7B,EAAE,OAAM;YAKJR,MAAM,CAACO,IAAI,GAAGC;QAClB;IACJ;IACA,OAAOR;AACX"}
@@ -1,20 +1,15 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useHandler = useHandler;
7
-
8
- var _react = require("react");
9
-
1
+ import { useEffect, useRef } from "react";
10
2
  function useHandler(props, factory) {
11
- var propsRef = (0, _react.useRef)(props);
12
- var handlerRef = (0, _react.useRef)(function () {
13
- var handler = factory(propsRef.current);
14
- return handler.apply(void 0, arguments);
15
- });
16
- (0, _react.useEffect)(function () {
17
- propsRef.current = props;
18
- });
19
- return handlerRef.current;
20
- }
3
+ const propsRef = useRef(props);
4
+ const handlerRef = useRef((...args)=>{
5
+ const handler = factory(propsRef.current);
6
+ return handler(...args);
7
+ });
8
+ useEffect(()=>{
9
+ propsRef.current = props;
10
+ });
11
+ return handlerRef.current;
12
+ }
13
+ export { useHandler };
14
+
15
+ //# sourceMappingURL=useHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useHandler","props","factory","propsRef","useRef","handlerRef","handler","current","useEffect"],"sources":["useHandler.ts"],"sourcesContent":["import { useRef, useEffect } from \"react\";\n\n/**\n * TODO: figure out any types.\n */\ninterface Props {\n [key: string]: any;\n}\ninterface Factory {\n (...args: any): any;\n}\nexport function useHandler(props: Props, factory: Factory) {\n const propsRef = useRef(props);\n\n const handlerRef = useRef((...args: any) => {\n const handler = factory(propsRef.current);\n return handler(...args);\n });\n\n useEffect(() => {\n propsRef.current = props;\n });\n\n return handlerRef.current;\n}\n"],"mappings":";;;;;;;AAAA;;AAWO,SAASA,UAAT,CAAoBC,KAApB,EAAkCC,OAAlC,EAAoD;EACvD,IAAMC,QAAQ,GAAG,IAAAC,aAAA,EAAOH,KAAP,CAAjB;EAEA,IAAMI,UAAU,GAAG,IAAAD,aAAA,EAAO,YAAkB;IACxC,IAAME,OAAO,GAAGJ,OAAO,CAACC,QAAQ,CAACI,OAAV,CAAvB;IACA,OAAOD,OAAO,MAAP,mBAAP;EACH,CAHkB,CAAnB;EAKA,IAAAE,gBAAA,EAAU,YAAM;IACZL,QAAQ,CAACI,OAAT,GAAmBN,KAAnB;EACH,CAFD;EAIA,OAAOI,UAAU,CAACE,OAAlB;AACH"}
1
+ {"version":3,"file":"hooks/useHandler.js","sources":["../../src/hooks/useHandler.ts"],"sourcesContent":["import { useRef, useEffect } from \"react\";\n\n/**\n * TODO: figure out any types.\n */\ninterface Props {\n [key: string]: any;\n}\ninterface Factory {\n (...args: any): any;\n}\nexport function useHandler(props: Props, factory: Factory) {\n const propsRef = useRef(props);\n\n const handlerRef = useRef((...args: any) => {\n const handler = factory(propsRef.current);\n return handler(...args);\n });\n\n useEffect(() => {\n propsRef.current = props;\n });\n\n return handlerRef.current;\n}\n"],"names":["useHandler","props","factory","propsRef","useRef","handlerRef","args","handler","useEffect"],"mappings":";AAWO,SAASA,WAAWC,KAAY,EAAEC,OAAgB;IACrD,MAAMC,WAAWC,OAAOH;IAExB,MAAMI,aAAaD,OAAO,CAAC,GAAGE;QAC1B,MAAMC,UAAUL,QAAQC,SAAS,OAAO;QACxC,OAAOI,WAAWD;IACtB;IAEAE,UAAU;QACNL,SAAS,OAAO,GAAGF;IACvB;IAEA,OAAOI,WAAW,OAAO;AAC7B"}
@@ -1,10 +1,10 @@
1
- declare type HandlerProps = {
1
+ type HandlerProps = {
2
2
  [key: string]: any;
3
3
  };
4
- declare type HandlerFactories = {
4
+ type HandlerFactories = {
5
5
  [key: string]: (props: HandlerProps) => (...params: any[]) => any;
6
6
  };
7
- declare type Handlers = {
7
+ type Handlers = {
8
8
  [K in keyof HandlerFactories]: (...params: any[]) => any;
9
9
  };
10
10
  export declare function useHandlers<H = Handlers>(props: HandlerProps, factories: HandlerFactories): H;
@@ -1,30 +1,21 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useHandlers = useHandlers;
7
-
8
- var _react = require("react");
9
-
1
+ import { useEffect, useRef } from "react";
10
2
  function useHandlers(props, factories) {
11
- var propsRef = (0, _react.useRef)(props);
12
- var handlersRef = (0, _react.useRef)(function () {
13
- var names = Object.keys(factories);
14
- return names.reduce(function (handlers, name) {
15
- /**
16
- * TODO: figure out args types
17
- */
18
- handlers[name] = function () {
19
- var handler = factories[name](propsRef.current);
20
- return handler.apply(void 0, arguments);
21
- };
3
+ const propsRef = useRef(props);
4
+ const handlersRef = useRef((()=>{
5
+ const names = Object.keys(factories);
6
+ return names.reduce((handlers, name)=>{
7
+ handlers[name] = (...args)=>{
8
+ const handler = factories[name](propsRef.current);
9
+ return handler(...args);
10
+ };
11
+ return handlers;
12
+ }, {});
13
+ })());
14
+ useEffect(()=>{
15
+ propsRef.current = props;
16
+ });
17
+ return handlersRef.current;
18
+ }
19
+ export { useHandlers };
22
20
 
23
- return handlers;
24
- }, {});
25
- }());
26
- (0, _react.useEffect)(function () {
27
- propsRef.current = props;
28
- });
29
- return handlersRef.current;
30
- }
21
+ //# sourceMappingURL=useHandlers.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useHandlers","props","factories","propsRef","useRef","handlersRef","names","Object","keys","reduce","handlers","name","handler","current","useEffect"],"sources":["useHandlers.ts"],"sourcesContent":["import { useRef, useEffect } from \"react\";\n\ntype HandlerProps = { [key: string]: any };\ntype HandlerFactories = { [key: string]: (props: HandlerProps) => (...params: any[]) => any };\ntype Handlers = {\n [K in keyof HandlerFactories]: (...params: any[]) => any;\n};\n\nexport function useHandlers<H = Handlers>(props: HandlerProps, factories: HandlerFactories) {\n const propsRef = useRef(props);\n\n const handlersRef = useRef(\n (() => {\n const names = Object.keys(factories);\n return names.reduce((handlers, name) => {\n /**\n * TODO: figure out args types\n */\n handlers[name] = (...args: any) => {\n const handler = factories[name](propsRef.current);\n return handler(...args);\n };\n return handlers;\n }, {} as Record<string, any>);\n })()\n );\n\n useEffect(() => {\n propsRef.current = props;\n });\n\n return handlersRef.current as H;\n}\n"],"mappings":";;;;;;;AAAA;;AAQO,SAASA,WAAT,CAAmCC,KAAnC,EAAwDC,SAAxD,EAAqF;EACxF,IAAMC,QAAQ,GAAG,IAAAC,aAAA,EAAOH,KAAP,CAAjB;EAEA,IAAMI,WAAW,GAAG,IAAAD,aAAA,EACf,YAAM;IACH,IAAME,KAAK,GAAGC,MAAM,CAACC,IAAP,CAAYN,SAAZ,CAAd;IACA,OAAOI,KAAK,CAACG,MAAN,CAAa,UAACC,QAAD,EAAWC,IAAX,EAAoB;MACpC;AAChB;AACA;MACgBD,QAAQ,CAACC,IAAD,CAAR,GAAiB,YAAkB;QAC/B,IAAMC,OAAO,GAAGV,SAAS,CAACS,IAAD,CAAT,CAAgBR,QAAQ,CAACU,OAAzB,CAAhB;QACA,OAAOD,OAAO,MAAP,mBAAP;MACH,CAHD;;MAIA,OAAOF,QAAP;IACH,CATM,EASJ,EATI,CAAP;EAUH,CAZD,EADgB,CAApB;EAgBA,IAAAI,gBAAA,EAAU,YAAM;IACZX,QAAQ,CAACU,OAAT,GAAmBZ,KAAnB;EACH,CAFD;EAIA,OAAOI,WAAW,CAACQ,OAAnB;AACH"}
1
+ {"version":3,"file":"hooks/useHandlers.js","sources":["../../src/hooks/useHandlers.ts"],"sourcesContent":["import { useRef, useEffect } from \"react\";\n\ntype HandlerProps = { [key: string]: any };\ntype HandlerFactories = { [key: string]: (props: HandlerProps) => (...params: any[]) => any };\ntype Handlers = {\n [K in keyof HandlerFactories]: (...params: any[]) => any;\n};\n\nexport function useHandlers<H = Handlers>(props: HandlerProps, factories: HandlerFactories) {\n const propsRef = useRef(props);\n\n const handlersRef = useRef(\n (() => {\n const names = Object.keys(factories);\n return names.reduce(\n (handlers, name) => {\n /**\n * TODO: figure out args types\n */\n handlers[name] = (...args: any) => {\n const handler = factories[name](propsRef.current);\n return handler(...args);\n };\n return handlers;\n },\n {} as Record<string, any>\n );\n })()\n );\n\n useEffect(() => {\n propsRef.current = props;\n });\n\n return handlersRef.current as H;\n}\n"],"names":["useHandlers","props","factories","propsRef","useRef","handlersRef","names","Object","handlers","name","args","handler","useEffect"],"mappings":";AAQO,SAASA,YAA0BC,KAAmB,EAAEC,SAA2B;IACtF,MAAMC,WAAWC,OAAOH;IAExB,MAAMI,cAAcD,OACf,AAAC;QACE,MAAME,QAAQC,OAAO,IAAI,CAACL;QAC1B,OAAOI,MAAM,MAAM,CACf,CAACE,UAAUC;YAIPD,QAAQ,CAACC,KAAK,GAAG,CAAC,GAAGC;gBACjB,MAAMC,UAAUT,SAAS,CAACO,KAAK,CAACN,SAAS,OAAO;gBAChD,OAAOQ,WAAWD;YACtB;YACA,OAAOF;QACX,GACA,CAAC;IAET;IAGJI,UAAU;QACNT,SAAS,OAAO,GAAGF;IACvB;IAEA,OAAOI,YAAY,OAAO;AAC9B"}
@@ -0,0 +1,2 @@
1
+ import { type Plugin } from "@webiny/plugins/types.js";
2
+ export declare function useRegisterLegacyPlugin<TPlugin extends Plugin>(plugin: TPlugin): void;
@@ -0,0 +1,12 @@
1
+ import { useRef } from "react";
2
+ import { plugins } from "@webiny/plugins";
3
+ function useRegisterLegacyPlugin(plugin) {
4
+ const pluginRegistered = useRef(false);
5
+ if (!pluginRegistered.current) {
6
+ pluginRegistered.current = true;
7
+ plugins.register(plugin);
8
+ }
9
+ }
10
+ export { useRegisterLegacyPlugin };
11
+
12
+ //# sourceMappingURL=useRegisterLegacyPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks/useRegisterLegacyPlugin.js","sources":["../../src/hooks/useRegisterLegacyPlugin.tsx"],"sourcesContent":["import { useRef } from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { type Plugin } from \"@webiny/plugins/types.js\";\n\nexport function useRegisterLegacyPlugin<TPlugin extends Plugin>(plugin: TPlugin) {\n const pluginRegistered = useRef<boolean>(false);\n if (!pluginRegistered.current) {\n pluginRegistered.current = true;\n plugins.register(plugin);\n }\n}\n"],"names":["useRegisterLegacyPlugin","plugin","pluginRegistered","useRef","plugins"],"mappings":";;AAIO,SAASA,wBAAgDC,MAAe;IAC3E,MAAMC,mBAAmBC,OAAgB;IACzC,IAAI,CAACD,iBAAiB,OAAO,EAAE;QAC3BA,iBAAiB,OAAO,GAAG;QAC3BE,QAAQ,QAAQ,CAACH;IACrB;AACJ"}
package/hooks/useUi.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { UiContextValue } from "../contexts/Ui";
1
+ import type { UiContextValue } from "../contexts/Ui/index.js";
2
2
  export declare const useUi: () => UiContextValue;
package/hooks/useUi.js CHANGED
@@ -1,16 +1,6 @@
1
- "use strict";
1
+ import { useContext } from "react";
2
+ import { UiContext } from "../contexts/Ui/index.js";
3
+ const useUi = ()=>useContext(UiContext);
4
+ export { useUi };
2
5
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useUi = void 0;
7
-
8
- var _react = require("react");
9
-
10
- var _Ui = require("./../contexts/Ui");
11
-
12
- var useUi = function useUi() {
13
- return (0, _react.useContext)(_Ui.UiContext);
14
- };
15
-
16
- exports.useUi = useUi;
6
+ //# sourceMappingURL=useUi.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useUi","useContext","UiContext"],"sources":["useUi.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { UiContext, UiContextValue } from \"./../contexts/Ui\";\n\nexport const useUi = () => {\n return useContext(UiContext) as UiContextValue;\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEO,IAAMA,KAAK,GAAG,SAARA,KAAQ,GAAM;EACvB,OAAO,IAAAC,iBAAA,EAAWC,aAAX,CAAP;AACH,CAFM"}
1
+ {"version":3,"file":"hooks/useUi.js","sources":["../../src/hooks/useUi.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport type { UiContextValue } from \"~/contexts/Ui/index.js\";\nimport { UiContext } from \"~/contexts/Ui/index.js\";\n\nexport const useUi = () => {\n return useContext(UiContext) as UiContextValue;\n};\n"],"names":["useUi","useContext","UiContext"],"mappings":";;AAIO,MAAMA,QAAQ,IACVC,WAAWC"}
package/i18n/i18n.js CHANGED
@@ -1,21 +1,11 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports.default = void 0;
11
-
12
- var _i18n = _interopRequireWildcard(require("@webiny/i18n"));
13
-
14
- var _i18nReact = _interopRequireDefault(require("@webiny/i18n-react"));
15
-
16
- _i18n.default.registerProcessors([_i18n.defaultProcessor, _i18nReact.default]);
17
-
18
- _i18n.default.registerModifiers(_i18n.defaultModifiers);
19
-
20
- var _default = _i18n.default;
21
- exports.default = _default;
1
+ import i18n, { defaultModifiers, defaultProcessor } from "@webiny/i18n";
2
+ import i18n_react from "@webiny/i18n-react";
3
+ i18n.registerProcessors([
4
+ defaultProcessor,
5
+ i18n_react
6
+ ]);
7
+ i18n.registerModifiers(defaultModifiers);
8
+ const i18n_i18n = i18n;
9
+ export default i18n_i18n;
10
+
11
+ //# sourceMappingURL=i18n.js.map
package/i18n/i18n.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["i18n","registerProcessors","defaultProcessor","reactProcessor","registerModifiers","defaultModifiers"],"sources":["i18n.ts"],"sourcesContent":["import i18n, { defaultProcessor, defaultModifiers } from \"@webiny/i18n\";\nimport reactProcessor from \"@webiny/i18n-react\";\n\ni18n.registerProcessors([defaultProcessor, reactProcessor]);\ni18n.registerModifiers(defaultModifiers);\n\nexport default i18n;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEAA,aAAA,CAAKC,kBAAL,CAAwB,CAACC,sBAAD,EAAmBC,kBAAnB,CAAxB;;AACAH,aAAA,CAAKI,iBAAL,CAAuBC,sBAAvB;;eAEeL,a"}
1
+ {"version":3,"file":"i18n/i18n.js","sources":["../../src/i18n/i18n.ts"],"sourcesContent":["import i18n, { defaultProcessor, defaultModifiers } from \"@webiny/i18n\";\nimport reactProcessor from \"@webiny/i18n-react\";\n\ni18n.registerProcessors([defaultProcessor, reactProcessor]);\ni18n.registerModifiers(defaultModifiers);\n\nexport default i18n;\n"],"names":["i18n","defaultProcessor","reactProcessor","defaultModifiers"],"mappings":";;AAGAA,KAAK,kBAAkB,CAAC;IAACC;IAAkBC;CAAe;AAC1DF,KAAK,iBAAiB,CAACG;AAEvB,kBAAeH"}
package/i18n/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { default as i18n } from "./i18n";
1
+ export { default as i18n } from "./i18n.js";
package/i18n/index.js CHANGED
@@ -1,15 +1 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- Object.defineProperty(exports, "i18n", {
9
- enumerable: true,
10
- get: function get() {
11
- return _i18n.default;
12
- }
13
- });
14
-
15
- var _i18n = _interopRequireDefault(require("./i18n"));
1
+ export { default as i18n } from "./i18n.js";
package/index.d.ts CHANGED
@@ -1,4 +1,25 @@
1
- export { AddQuerySelectionPlugin } from "./plugins/AddQuerySelectionPlugin";
2
- export { ApolloLinkPlugin } from "./plugins/ApolloLinkPlugin";
3
- export { RoutePlugin } from "./plugins/RoutePlugin";
4
- export { ApolloCacheObjectIdPlugin } from "./plugins/ApolloCacheObjectIdPlugin";
1
+ export { AddQuerySelectionPlugin } from "./plugins/AddQuerySelectionPlugin.js";
2
+ export { ApolloLinkPlugin } from "./plugins/ApolloLinkPlugin.js";
3
+ export { ApolloCacheObjectIdPlugin, type ApolloCacheObject } from "./plugins/ApolloCacheObjectIdPlugin.js";
4
+ export * from "@webiny/react-composition";
5
+ export type { HigherOrderComponent, ComposeProps, ComposableFC } from "@webiny/react-composition";
6
+ export * from "./App.js";
7
+ export * from "./AppContainer.js";
8
+ export type { AppProps } from "./App.js";
9
+ export * from "./core/Plugins.js";
10
+ export * from "./core/Plugin.js";
11
+ export * from "./core/Provider.js";
12
+ export * from "./core/createProvider.js";
13
+ export * from "./core/createProviderPlugin.js";
14
+ export * from "./renderApp.js";
15
+ export * from "./utils/createGenericContext.js";
16
+ export { useContainer, DiContainerProvider } from "./shared/di/DiContainerProvider.js";
17
+ export { useFeature } from "./shared/di/useFeature.js";
18
+ export { createFeature } from "./shared/di/createFeature.js";
19
+ export { Route } from "./features/router/Route.js";
20
+ export { RouteLink, type RouteLinkProps } from "./presentation/router/components/RouteLink.js";
21
+ export { SimpleLink, type SimpleLinkProps } from "./presentation/router/components/SimpleLink.js";
22
+ export { useEnvConfig } from "./presentation/envConfig/useEnvConfig.js";
23
+ export { useRouter, useRoute } from "./presentation/router/index.js";
24
+ export { useLocalStorage, useLocalStorageValue, useLocalStorageValues } from "./presentation/localStorage/index.js";
25
+ export * from "./helpers/InterfaceGenerator/index.js";
package/index.js CHANGED
@@ -1,37 +1,23 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "AddQuerySelectionPlugin", {
7
- enumerable: true,
8
- get: function get() {
9
- return _AddQuerySelectionPlugin.AddQuerySelectionPlugin;
10
- }
11
- });
12
- Object.defineProperty(exports, "ApolloCacheObjectIdPlugin", {
13
- enumerable: true,
14
- get: function get() {
15
- return _ApolloCacheObjectIdPlugin.ApolloCacheObjectIdPlugin;
16
- }
17
- });
18
- Object.defineProperty(exports, "ApolloLinkPlugin", {
19
- enumerable: true,
20
- get: function get() {
21
- return _ApolloLinkPlugin.ApolloLinkPlugin;
22
- }
23
- });
24
- Object.defineProperty(exports, "RoutePlugin", {
25
- enumerable: true,
26
- get: function get() {
27
- return _RoutePlugin.RoutePlugin;
28
- }
29
- });
30
-
31
- var _AddQuerySelectionPlugin = require("./plugins/AddQuerySelectionPlugin");
32
-
33
- var _ApolloLinkPlugin = require("./plugins/ApolloLinkPlugin");
34
-
35
- var _RoutePlugin = require("./plugins/RoutePlugin");
36
-
37
- var _ApolloCacheObjectIdPlugin = require("./plugins/ApolloCacheObjectIdPlugin");
1
+ export * from "@webiny/react-composition";
2
+ export * from "./App.js";
3
+ export * from "./AppContainer.js";
4
+ export * from "./core/Plugins.js";
5
+ export * from "./core/Plugin.js";
6
+ export * from "./core/Provider.js";
7
+ export * from "./core/createProvider.js";
8
+ export * from "./core/createProviderPlugin.js";
9
+ export * from "./renderApp.js";
10
+ export * from "./utils/createGenericContext.js";
11
+ export * from "./helpers/InterfaceGenerator/index.js";
12
+ export { AddQuerySelectionPlugin } from "./plugins/AddQuerySelectionPlugin.js";
13
+ export { ApolloLinkPlugin } from "./plugins/ApolloLinkPlugin.js";
14
+ export { ApolloCacheObjectIdPlugin } from "./plugins/ApolloCacheObjectIdPlugin.js";
15
+ export { DiContainerProvider, useContainer } from "./shared/di/DiContainerProvider.js";
16
+ export { useFeature } from "./shared/di/useFeature.js";
17
+ export { createFeature } from "./shared/di/createFeature.js";
18
+ export { Route } from "./features/router/Route.js";
19
+ export { RouteLink } from "./presentation/router/components/RouteLink.js";
20
+ export { SimpleLink } from "./presentation/router/components/SimpleLink.js";
21
+ export { useEnvConfig } from "./presentation/envConfig/useEnvConfig.js";
22
+ export { useRoute, useRouter } from "./presentation/router/index.js";
23
+ export { useLocalStorage, useLocalStorageValue, useLocalStorageValues } from "./presentation/localStorage/index.js";