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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (463) hide show
  1. package/App.d.ts +5 -6
  2. package/App.js +75 -88
  3. package/App.js.map +1 -1
  4. package/AppContainer.js +3 -6
  5. package/AppContainer.js.map +1 -1
  6. package/README.md +7 -15
  7. package/components/Image.d.ts +1 -2
  8. package/components/Image.js +12 -18
  9. package/components/Image.js.map +1 -1
  10. package/components/index.d.ts +1 -2
  11. package/components/index.js +1 -4
  12. package/config/RouterConfig/Route.d.ts +9 -10
  13. package/config/RouterConfig/Route.js +23 -37
  14. package/config/RouterConfig/Route.js.map +1 -1
  15. package/config/RouterConfig.d.ts +11 -14
  16. package/config/RouterConfig.js +12 -11
  17. package/config/RouterConfig.js.map +1 -1
  18. package/config.js +19 -20
  19. package/config.js.map +1 -1
  20. package/contexts/Ui/index.js +26 -28
  21. package/contexts/Ui/index.js.map +1 -1
  22. package/core/Plugin.d.ts +1 -1
  23. package/core/Plugin.js +9 -11
  24. package/core/Plugin.js.map +1 -1
  25. package/core/Plugins.d.ts +4 -3
  26. package/core/Plugins.js +18 -36
  27. package/core/Plugins.js.map +1 -1
  28. package/core/Provider.d.ts +1 -1
  29. package/core/Provider.js +6 -14
  30. package/core/Provider.js.map +1 -1
  31. package/core/createProvider.js +3 -6
  32. package/core/createProvider.js.map +1 -1
  33. package/core/createProviderPlugin.js +9 -14
  34. package/core/createProviderPlugin.js.map +1 -1
  35. package/errors/AuthenticationErrorEvent.d.ts +9 -0
  36. package/errors/AuthenticationErrorEvent.js +13 -0
  37. package/errors/AuthenticationErrorEvent.js.map +1 -0
  38. package/errors/NetworkErrorEvent.d.ts +15 -0
  39. package/errors/NetworkErrorEvent.js +13 -0
  40. package/errors/NetworkErrorEvent.js.map +1 -0
  41. package/errors/abstractions.d.ts +12 -0
  42. package/errors/abstractions.js +6 -0
  43. package/errors/abstractions.js.map +1 -0
  44. package/errors/index.d.ts +6 -0
  45. package/errors/index.js +3 -0
  46. package/errors/overlay/ErrorOverlay.d.ts +9 -0
  47. package/errors/overlay/ErrorOverlay.js +43 -0
  48. package/errors/overlay/ErrorOverlay.js.map +1 -0
  49. package/{plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts → errors/overlay/GqlErrorOverlay.d.ts} +2 -2
  50. package/errors/overlay/GqlErrorOverlay.js +27 -0
  51. package/errors/overlay/GqlErrorOverlay.js.map +1 -0
  52. package/errors/overlay/LocalAwsLambdaTimeoutMessage.d.ts +2 -0
  53. package/errors/overlay/LocalAwsLambdaTimeoutMessage.js +20 -0
  54. package/errors/overlay/LocalAwsLambdaTimeoutMessage.js.map +1 -0
  55. package/errors/overlay/StyledComponents.d.ts +7 -0
  56. package/errors/overlay/StyledComponents.js +10 -0
  57. package/errors/overlay/StyledComponents.js.map +1 -0
  58. package/errors/overlay/Typography.d.ts +8 -0
  59. package/errors/overlay/Typography.js +13 -0
  60. package/errors/overlay/Typography.js.map +1 -0
  61. package/errors/overlay/assets/close_24px.js +19 -0
  62. package/errors/overlay/assets/close_24px.js.map +1 -0
  63. package/errors/overlay/createErrorOverlay.d.ts +7 -0
  64. package/errors/overlay/createErrorOverlay.js +15 -0
  65. package/errors/overlay/createErrorOverlay.js.map +1 -0
  66. package/exports/admin/env-config.d.ts +2 -0
  67. package/exports/admin/env-config.js +2 -0
  68. package/exports/admin/graphql-client.d.ts +1 -0
  69. package/exports/admin/graphql-client.js +1 -0
  70. package/exports/admin/local-storage.d.ts +2 -0
  71. package/exports/admin/local-storage.js +2 -0
  72. package/exports/admin/router.d.ts +5 -0
  73. package/exports/admin/router.js +5 -0
  74. package/exports/admin/security.d.ts +1 -0
  75. package/exports/admin/security.js +1 -0
  76. package/exports/admin.d.ts +8 -0
  77. package/exports/admin.js +8 -0
  78. package/features/apiStreamClient/FetchApiStreamClient.d.ts +9 -0
  79. package/features/apiStreamClient/FetchApiStreamClient.js +63 -0
  80. package/features/apiStreamClient/FetchApiStreamClient.js.map +1 -0
  81. package/features/apiStreamClient/__tests__/FetchApiStreamClient.test.d.ts +1 -0
  82. package/features/apiStreamClient/__tests__/FetchApiStreamClient.test.js +170 -0
  83. package/features/apiStreamClient/__tests__/FetchApiStreamClient.test.js.map +1 -0
  84. package/features/apiStreamClient/__tests__/readServerSentEvents.test.d.ts +1 -0
  85. package/features/apiStreamClient/__tests__/readServerSentEvents.test.js +160 -0
  86. package/features/apiStreamClient/__tests__/readServerSentEvents.test.js.map +1 -0
  87. package/features/apiStreamClient/abstractions.d.ts +44 -0
  88. package/features/apiStreamClient/abstractions.js +10 -0
  89. package/features/apiStreamClient/abstractions.js.map +1 -0
  90. package/features/apiStreamClient/feature.d.ts +3 -0
  91. package/features/apiStreamClient/feature.js +17 -0
  92. package/features/apiStreamClient/feature.js.map +1 -0
  93. package/features/apiStreamClient/index.d.ts +5 -0
  94. package/features/apiStreamClient/index.js +5 -0
  95. package/features/apiStreamClient/readServerSentEvents.d.ts +10 -0
  96. package/features/apiStreamClient/readServerSentEvents.js +29 -0
  97. package/features/apiStreamClient/readServerSentEvents.js.map +1 -0
  98. package/features/apiStreamClient/toPayloadHash.d.ts +14 -0
  99. package/features/apiStreamClient/toPayloadHash.js +7 -0
  100. package/features/apiStreamClient/toPayloadHash.js.map +1 -0
  101. package/features/envConfig/EnvConfig.d.ts +7 -0
  102. package/features/envConfig/EnvConfig.js +16 -0
  103. package/features/envConfig/EnvConfig.js.map +1 -0
  104. package/features/envConfig/abstractions.d.ts +28 -0
  105. package/features/envConfig/abstractions.js +5 -0
  106. package/features/envConfig/abstractions.js.map +1 -0
  107. package/features/envConfig/feature.d.ts +17 -0
  108. package/features/envConfig/feature.js +15 -0
  109. package/features/envConfig/feature.js.map +1 -0
  110. package/features/envConfig/index.d.ts +1 -0
  111. package/features/envConfig/index.js +1 -0
  112. package/features/eventPublisher/EventPublisher.d.ts +8 -0
  113. package/features/eventPublisher/EventPublisher.js +19 -0
  114. package/features/eventPublisher/EventPublisher.js.map +1 -0
  115. package/features/eventPublisher/abstractions.d.ts +18 -0
  116. package/features/eventPublisher/abstractions.js +12 -0
  117. package/features/eventPublisher/abstractions.js.map +1 -0
  118. package/features/eventPublisher/feature.d.ts +3 -0
  119. package/features/eventPublisher/feature.js +17 -0
  120. package/features/eventPublisher/feature.js.map +1 -0
  121. package/features/eventPublisher/index.d.ts +3 -0
  122. package/features/eventPublisher/index.js +2 -0
  123. package/features/graphqlClient/AuthenticationErrorPublishing.d.ts +13 -0
  124. package/features/graphqlClient/AuthenticationErrorPublishing.js +35 -0
  125. package/features/graphqlClient/AuthenticationErrorPublishing.js.map +1 -0
  126. package/features/graphqlClient/BatchingGraphQLClient.d.ts +16 -0
  127. package/features/graphqlClient/BatchingGraphQLClient.js +118 -0
  128. package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -0
  129. package/features/graphqlClient/FetchGraphQLClient.d.ts +7 -0
  130. package/features/graphqlClient/FetchGraphQLClient.js +51 -0
  131. package/features/graphqlClient/FetchGraphQLClient.js.map +1 -0
  132. package/features/graphqlClient/NetworkErrorPublishing.d.ts +14 -0
  133. package/features/graphqlClient/NetworkErrorPublishing.js +48 -0
  134. package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -0
  135. package/features/graphqlClient/RequestValue.d.ts +21 -0
  136. package/features/graphqlClient/RequestValue.js +46 -0
  137. package/features/graphqlClient/RequestValue.js.map +1 -0
  138. package/features/graphqlClient/RetryGraphQLClient.d.ts +18 -0
  139. package/features/graphqlClient/RetryGraphQLClient.js +45 -0
  140. package/features/graphqlClient/RetryGraphQLClient.js.map +1 -0
  141. package/features/graphqlClient/__tests__/GraphQLClient.test.d.ts +1 -0
  142. package/features/graphqlClient/__tests__/GraphQLClient.test.js +471 -0
  143. package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -0
  144. package/features/graphqlClient/abstractions.d.ts +18 -0
  145. package/features/graphqlClient/abstractions.js +5 -0
  146. package/features/graphqlClient/abstractions.js.map +1 -0
  147. package/features/graphqlClient/feature.d.ts +6 -0
  148. package/features/graphqlClient/feature.js +25 -0
  149. package/features/graphqlClient/feature.js.map +1 -0
  150. package/features/graphqlClient/index.d.ts +1 -0
  151. package/features/graphqlClient/index.js +1 -0
  152. package/features/graphqlClient/types.d.ts +5 -0
  153. package/features/graphqlClient/types.js +0 -0
  154. package/features/localStorage/BrowserLocalStorageGateway.d.ts +9 -0
  155. package/features/localStorage/BrowserLocalStorageGateway.js +61 -0
  156. package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -0
  157. package/features/localStorage/LocalStorage.d.ts +12 -0
  158. package/features/localStorage/LocalStorage.js +34 -0
  159. package/features/localStorage/LocalStorage.js.map +1 -0
  160. package/features/localStorage/LocalStorageRepository.d.ts +20 -0
  161. package/features/localStorage/LocalStorageRepository.js +82 -0
  162. package/features/localStorage/LocalStorageRepository.js.map +1 -0
  163. package/features/localStorage/abstractions.d.ts +48 -0
  164. package/features/localStorage/abstractions.js +8 -0
  165. package/features/localStorage/abstractions.js.map +1 -0
  166. package/features/localStorage/feature.d.ts +12 -0
  167. package/features/localStorage/feature.js +23 -0
  168. package/features/localStorage/feature.js.map +1 -0
  169. package/features/localStorage/index.d.ts +1 -0
  170. package/features/localStorage/index.js +1 -0
  171. package/features/mainGraphQLClient/MainGraphQLClient.d.ts +11 -0
  172. package/features/mainGraphQLClient/MainGraphQLClient.js +27 -0
  173. package/features/mainGraphQLClient/MainGraphQLClient.js.map +1 -0
  174. package/features/mainGraphQLClient/abstractions.d.ts +17 -0
  175. package/features/mainGraphQLClient/abstractions.js +5 -0
  176. package/features/mainGraphQLClient/abstractions.js.map +1 -0
  177. package/features/mainGraphQLClient/feature.d.ts +3 -0
  178. package/features/mainGraphQLClient/feature.js +17 -0
  179. package/features/mainGraphQLClient/feature.js.map +1 -0
  180. package/features/mainGraphQLClient/index.d.ts +1 -0
  181. package/features/mainGraphQLClient/index.js +1 -0
  182. package/features/router/HistoryRouterGateway.d.ts +25 -0
  183. package/features/router/HistoryRouterGateway.js +100 -0
  184. package/features/router/HistoryRouterGateway.js.map +1 -0
  185. package/features/router/HistoryRouterGateway.test.d.ts +1 -0
  186. package/features/router/HistoryRouterGateway.test.js +195 -0
  187. package/features/router/HistoryRouterGateway.test.js.map +1 -0
  188. package/features/router/Route.d.ts +19 -0
  189. package/features/router/Route.js +43 -0
  190. package/features/router/Route.js.map +1 -0
  191. package/features/router/RouteUrl.d.ts +85 -0
  192. package/features/router/RouteUrl.js +99 -0
  193. package/features/router/RouteUrl.js.map +1 -0
  194. package/features/router/Router.d.ts +45 -0
  195. package/features/router/Router.js +72 -0
  196. package/features/router/Router.js.map +1 -0
  197. package/features/router/RouterPresenter.d.ts +23 -0
  198. package/features/router/RouterPresenter.js +62 -0
  199. package/features/router/RouterPresenter.js.map +1 -0
  200. package/features/router/RouterRepository.d.ts +32 -0
  201. package/features/router/RouterRepository.js +123 -0
  202. package/features/router/RouterRepository.js.map +1 -0
  203. package/features/router/RouterRepository.test.d.ts +1 -0
  204. package/features/router/RouterRepository.test.js +138 -0
  205. package/features/router/RouterRepository.test.js.map +1 -0
  206. package/features/router/abstractions.d.ts +90 -0
  207. package/features/router/abstractions.js +7 -0
  208. package/features/router/abstractions.js.map +1 -0
  209. package/features/router/feature.d.ts +4 -0
  210. package/features/router/feature.js +19 -0
  211. package/features/router/feature.js.map +1 -0
  212. package/features/router/index.d.ts +2 -0
  213. package/features/router/index.js +1 -0
  214. package/helpers/InterfaceGenerator/date.d.ts +15 -0
  215. package/helpers/InterfaceGenerator/date.js +0 -0
  216. package/helpers/InterfaceGenerator/id.d.ts +23 -0
  217. package/helpers/InterfaceGenerator/id.js +0 -0
  218. package/helpers/InterfaceGenerator/identity.d.ts +10 -0
  219. package/helpers/InterfaceGenerator/identity.js +0 -0
  220. package/helpers/InterfaceGenerator/index.d.ts +5 -0
  221. package/helpers/InterfaceGenerator/index.js +0 -0
  222. package/helpers/InterfaceGenerator/numeric.d.ts +12 -0
  223. package/helpers/InterfaceGenerator/numeric.js +0 -0
  224. package/helpers/InterfaceGenerator/truthful.d.ts +7 -0
  225. package/helpers/InterfaceGenerator/truthful.js +0 -0
  226. package/hooks/useHandler.js +12 -16
  227. package/hooks/useHandler.js.map +1 -1
  228. package/hooks/useHandlers.js +18 -20
  229. package/hooks/useHandlers.js.map +1 -1
  230. package/hooks/useRegisterLegacyPlugin.d.ts +1 -1
  231. package/hooks/useRegisterLegacyPlugin.js +7 -6
  232. package/hooks/useRegisterLegacyPlugin.js.map +1 -1
  233. package/hooks/useUi.d.ts +1 -1
  234. package/hooks/useUi.js +3 -4
  235. package/hooks/useUi.js.map +1 -1
  236. package/i18n/i18n.js +8 -4
  237. package/i18n/i18n.js.map +1 -1
  238. package/i18n/index.d.ts +1 -1
  239. package/i18n/index.js +1 -3
  240. package/index.d.ts +20 -15
  241. package/index.js +19 -19
  242. package/package.json +34 -42
  243. package/plugins/components/Image.d.ts +6 -0
  244. package/plugins/components/Image.js +12 -0
  245. package/plugins/components/Image.js.map +1 -0
  246. package/plugins/image.d.ts +2 -2
  247. package/plugins/image.js +95 -134
  248. package/plugins/image.js.map +1 -1
  249. package/plugins/index.d.ts +3 -3
  250. package/plugins/index.js +35 -59
  251. package/plugins/index.js.map +1 -1
  252. package/presentation/envConfig/useEnvConfig.d.ts +6 -0
  253. package/presentation/envConfig/useEnvConfig.js +9 -0
  254. package/presentation/envConfig/useEnvConfig.js.map +1 -0
  255. package/presentation/localStorage/index.d.ts +3 -0
  256. package/presentation/localStorage/index.js +3 -0
  257. package/presentation/localStorage/useLocalStorage.d.ts +6 -0
  258. package/presentation/localStorage/useLocalStorage.js +15 -0
  259. package/presentation/localStorage/useLocalStorage.js.map +1 -0
  260. package/presentation/localStorage/useLocalStorageValue.d.ts +1 -0
  261. package/presentation/localStorage/useLocalStorageValue.js +22 -0
  262. package/presentation/localStorage/useLocalStorageValue.js.map +1 -0
  263. package/presentation/localStorage/useLocalStorageValues.d.ts +5 -0
  264. package/presentation/localStorage/useLocalStorageValues.js +32 -0
  265. package/presentation/localStorage/useLocalStorageValues.js.map +1 -0
  266. package/presentation/router/RouteElementRegistry.d.ts +14 -0
  267. package/presentation/router/RouteElementRegistry.js +29 -0
  268. package/presentation/router/RouteElementRegistry.js.map +1 -0
  269. package/presentation/router/abstractions.d.ts +13 -0
  270. package/presentation/router/abstractions.js +5 -0
  271. package/presentation/router/abstractions.js.map +1 -0
  272. package/presentation/router/components/Redirect.d.ts +14 -0
  273. package/presentation/router/components/Redirect.js +13 -0
  274. package/presentation/router/components/Redirect.js.map +1 -0
  275. package/presentation/router/components/RouteContent.d.ts +2 -0
  276. package/presentation/router/components/RouteContent.js +20 -0
  277. package/presentation/router/components/RouteContent.js.map +1 -0
  278. package/presentation/router/components/RouteLink.d.ts +50 -0
  279. package/presentation/router/components/RouteLink.js +17 -0
  280. package/presentation/router/components/RouteLink.js.map +1 -0
  281. package/presentation/router/components/RouteParamsSync.d.ts +22 -0
  282. package/presentation/router/components/RouteParamsSync.js +53 -0
  283. package/presentation/router/components/RouteParamsSync.js.map +1 -0
  284. package/presentation/router/components/SimpleLink.d.ts +44 -0
  285. package/presentation/router/components/SimpleLink.js +24 -0
  286. package/presentation/router/components/SimpleLink.js.map +1 -0
  287. package/presentation/router/hooks/useRoute.d.ts +7 -0
  288. package/presentation/router/hooks/useRoute.js +23 -0
  289. package/presentation/router/hooks/useRoute.js.map +1 -0
  290. package/presentation/router/hooks/useRouter.d.ts +12 -0
  291. package/presentation/router/hooks/useRouter.js +30 -0
  292. package/presentation/router/hooks/useRouter.js.map +1 -0
  293. package/presentation/router/index.d.ts +6 -0
  294. package/presentation/router/index.js +4 -0
  295. package/presentation/router/types.d.ts +5 -0
  296. package/presentation/router/types.js +0 -0
  297. package/renderApp.d.ts +1 -1
  298. package/renderApp.js +7 -6
  299. package/renderApp.js.map +1 -1
  300. package/router.d.ts +5 -0
  301. package/router.js +5 -0
  302. package/rslib-runtime.js +14 -0
  303. package/rslib-runtime.js.map +1 -0
  304. package/shared/di/DiContainerProvider.d.ts +8 -0
  305. package/shared/di/DiContainerProvider.js +13 -0
  306. package/shared/di/DiContainerProvider.js.map +1 -0
  307. package/shared/di/createFeature.d.ts +11 -0
  308. package/shared/di/createFeature.js +10 -0
  309. package/shared/di/createFeature.js.map +1 -0
  310. package/shared/di/useFeature.d.ts +2 -0
  311. package/shared/di/useFeature.js +12 -0
  312. package/shared/di/useFeature.js.map +1 -0
  313. package/static/svg/close_24px.33adaadc.svg +1 -0
  314. package/types.d.ts +6 -24
  315. package/types.js +0 -14
  316. package/utils/createGenericContext.js +17 -21
  317. package/utils/createGenericContext.js.map +1 -1
  318. package/utils/createHashing.js +13 -16
  319. package/utils/createHashing.js.map +1 -1
  320. package/utils/index.d.ts +2 -10
  321. package/utils/index.js +2 -12
  322. package/utils/legacyPluginToReactComponent.js +12 -11
  323. package/utils/legacyPluginToReactComponent.js.map +1 -1
  324. package/apollo-client/InMemoryCache.d.ts +0 -8
  325. package/apollo-client/InMemoryCache.js +0 -20
  326. package/apollo-client/InMemoryCache.js.map +0 -1
  327. package/apollo-client/IntrospectionFragmentMatcher.d.ts +0 -11
  328. package/apollo-client/IntrospectionFragmentMatcher.js +0 -45
  329. package/apollo-client/IntrospectionFragmentMatcher.js.map +0 -1
  330. package/components/Routes.d.ts +0 -2
  331. package/components/Routes.js +0 -36
  332. package/components/Routes.js.map +0 -1
  333. package/components/View.d.ts +0 -8
  334. package/components/View.js +0 -19
  335. package/components/View.js.map +0 -1
  336. package/components/index.js.map +0 -1
  337. package/core/DebounceRender.d.ts +0 -12
  338. package/core/DebounceRender.js +0 -31
  339. package/core/DebounceRender.js.map +0 -1
  340. package/core/Routes.d.ts +0 -6
  341. package/core/Routes.js +0 -34
  342. package/core/Routes.js.map +0 -1
  343. package/hooks/useAutocomplete/index.d.ts +0 -1
  344. package/hooks/useAutocomplete/index.js +0 -3
  345. package/hooks/useAutocomplete/index.js.map +0 -1
  346. package/hooks/useAutocomplete/useAutocomplete.d.ts +0 -11
  347. package/hooks/useAutocomplete/useAutocomplete.js +0 -23
  348. package/hooks/useAutocomplete/useAutocomplete.js.map +0 -1
  349. package/hooks/useDataList/functions/getData.d.ts +0 -2
  350. package/hooks/useDataList/functions/getData.js +0 -4
  351. package/hooks/useDataList/functions/getData.js.map +0 -1
  352. package/hooks/useDataList/functions/getError.d.ts +0 -2
  353. package/hooks/useDataList/functions/getError.js +0 -4
  354. package/hooks/useDataList/functions/getError.js.map +0 -1
  355. package/hooks/useDataList/functions/getMeta.d.ts +0 -2
  356. package/hooks/useDataList/functions/getMeta.js +0 -4
  357. package/hooks/useDataList/functions/getMeta.js.map +0 -1
  358. package/hooks/useDataList/functions/index.d.ts +0 -3
  359. package/hooks/useDataList/functions/index.js +0 -5
  360. package/hooks/useDataList/functions/index.js.map +0 -1
  361. package/hooks/useDataList/functions/searchDataByKey.d.ts +0 -2
  362. package/hooks/useDataList/functions/searchDataByKey.js +0 -18
  363. package/hooks/useDataList/functions/searchDataByKey.js.map +0 -1
  364. package/hooks/useDataList/index.d.ts +0 -1
  365. package/hooks/useDataList/index.js +0 -3
  366. package/hooks/useDataList/index.js.map +0 -1
  367. package/hooks/useDataList/useDataList.d.ts +0 -36
  368. package/hooks/useDataList/useDataList.js +0 -183
  369. package/hooks/useDataList/useDataList.js.map +0 -1
  370. package/hooks/useDataList/utils/index.d.ts +0 -2
  371. package/hooks/useDataList/utils/index.js +0 -4
  372. package/hooks/useDataList/utils/index.js.map +0 -1
  373. package/hooks/useDataList/utils/prepareLoadListParams.d.ts +0 -10
  374. package/hooks/useDataList/utils/prepareLoadListParams.js +0 -38
  375. package/hooks/useDataList/utils/prepareLoadListParams.js.map +0 -1
  376. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +0 -14
  377. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +0 -26
  378. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +0 -1
  379. package/hooks/useDataList/utils/types.d.ts +0 -40
  380. package/hooks/useDataList/utils/types.js +0 -3
  381. package/hooks/useDataList/utils/types.js.map +0 -1
  382. package/i18n/index.js.map +0 -1
  383. package/index.js.map +0 -1
  384. package/plugins/AddQuerySelectionPlugin.d.ts +0 -22
  385. package/plugins/AddQuerySelectionPlugin.js +0 -72
  386. package/plugins/AddQuerySelectionPlugin.js.map +0 -1
  387. package/plugins/ApolloCacheObjectIdPlugin.d.ts +0 -15
  388. package/plugins/ApolloCacheObjectIdPlugin.js +0 -16
  389. package/plugins/ApolloCacheObjectIdPlugin.js.map +0 -1
  390. package/plugins/ApolloDynamicLink.d.ts +0 -7
  391. package/plugins/ApolloDynamicLink.js +0 -31
  392. package/plugins/ApolloDynamicLink.js.map +0 -1
  393. package/plugins/ApolloLinkPlugin.d.ts +0 -13
  394. package/plugins/ApolloLinkPlugin.js +0 -22
  395. package/plugins/ApolloLinkPlugin.js.map +0 -1
  396. package/plugins/ConsoleLinkPlugin.d.ts +0 -8
  397. package/plugins/ConsoleLinkPlugin.js +0 -26
  398. package/plugins/ConsoleLinkPlugin.js.map +0 -1
  399. package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -10
  400. package/plugins/LocaleHeaderLinkPlugin.js +0 -32
  401. package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
  402. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +0 -66
  403. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +0 -1
  404. package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +0 -9
  405. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +0 -78
  406. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +0 -1
  407. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +0 -7
  408. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +0 -31
  409. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +0 -1
  410. package/plugins/NetworkErrorLinkPlugin.d.ts +0 -7
  411. package/plugins/NetworkErrorLinkPlugin.js +0 -30
  412. package/plugins/NetworkErrorLinkPlugin.js.map +0 -1
  413. package/plugins/OmitTypenameLinkPlugin.d.ts +0 -8
  414. package/plugins/OmitTypenameLinkPlugin.js +0 -21
  415. package/plugins/OmitTypenameLinkPlugin.js.map +0 -1
  416. package/plugins/RoutePlugin.d.ts +0 -12
  417. package/plugins/RoutePlugin.js +0 -16
  418. package/plugins/RoutePlugin.js.map +0 -1
  419. package/plugins/TenantHeaderLinkPlugin.d.ts +0 -10
  420. package/plugins/TenantHeaderLinkPlugin.js +0 -39
  421. package/plugins/TenantHeaderLinkPlugin.js.map +0 -1
  422. package/plugins/ViewPlugin.d.ts +0 -14
  423. package/plugins/ViewPlugin.js +0 -19
  424. package/plugins/ViewPlugin.js.map +0 -1
  425. package/react-butterfiles/Files.d.ts +0 -69
  426. package/react-butterfiles/Files.js +0 -227
  427. package/react-butterfiles/Files.js.map +0 -1
  428. package/react-butterfiles/index.d.ts +0 -2
  429. package/react-butterfiles/index.js +0 -4
  430. package/react-butterfiles/index.js.map +0 -1
  431. package/react-butterfiles/utils/generateId.d.ts +0 -1
  432. package/react-butterfiles/utils/generateId.js +0 -5
  433. package/react-butterfiles/utils/generateId.js.map +0 -1
  434. package/react-butterfiles/utils/readFileContent.d.ts +0 -1
  435. package/react-butterfiles/utils/readFileContent.js +0 -15
  436. package/react-butterfiles/utils/readFileContent.js.map +0 -1
  437. package/types.js.map +0 -1
  438. package/utils/getApiUrl.d.ts +0 -1
  439. package/utils/getApiUrl.js +0 -5
  440. package/utils/getApiUrl.js.map +0 -1
  441. package/utils/getGqlApiUrl.d.ts +0 -1
  442. package/utils/getGqlApiUrl.js +0 -6
  443. package/utils/getGqlApiUrl.js.map +0 -1
  444. package/utils/getHeadlessCmsGqlApiUrl.d.ts +0 -5
  445. package/utils/getHeadlessCmsGqlApiUrl.js +0 -12
  446. package/utils/getHeadlessCmsGqlApiUrl.js.map +0 -1
  447. package/utils/getLocaleCode.d.ts +0 -6
  448. package/utils/getLocaleCode.js +0 -33
  449. package/utils/getLocaleCode.js.map +0 -1
  450. package/utils/getPrerenderId.d.ts +0 -6
  451. package/utils/getPrerenderId.js +0 -5
  452. package/utils/getPrerenderId.js.map +0 -1
  453. package/utils/getTenantId.d.ts +0 -6
  454. package/utils/getTenantId.js +0 -45
  455. package/utils/getTenantId.js.map +0 -1
  456. package/utils/index.js.map +0 -1
  457. package/utils/isLocalhost.d.ts +0 -1
  458. package/utils/isLocalhost.js +0 -7
  459. package/utils/isLocalhost.js.map +0 -1
  460. package/utils/isPrerendering.d.ts +0 -1
  461. package/utils/isPrerendering.js +0 -5
  462. package/utils/isPrerendering.js.map +0 -1
  463. /package/{plugins/NetworkErrorLinkPlugin → errors/overlay}/assets/close_24px.svg +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared/di/createFeature.js","sources":["../../../src/shared/di/createFeature.ts"],"sourcesContent":["import { Container } from \"@webiny/di\";\n\nexport interface FeatureDefinition<TExports = any, TParams extends any[] = []> {\n name: string;\n register: (container: Container, ...args: TParams) => void;\n resolve: (container: Container) => TExports;\n}\n\nexport function createFeature<\n TExports = any,\n TParams extends any[] = [] // tuple for extra args\n>(def: {\n name: string;\n register: (container: Container, ...args: TParams) => void;\n resolve: (container: Container) => TExports;\n}): FeatureDefinition<TExports, TParams> {\n return {\n name: def.name,\n register: def.register,\n resolve: (container: Container): TExports => {\n return def.resolve(container);\n }\n };\n}\n"],"names":["createFeature","def","container"],"mappings":"AAQO,SAASA,cAGdC,GAID;IACG,OAAO;QACH,MAAMA,IAAI,IAAI;QACd,UAAUA,IAAI,QAAQ;QACtB,SAAS,CAACC,YACCD,IAAI,OAAO,CAACC;IAE3B;AACJ"}
@@ -0,0 +1,2 @@
1
+ import { FeatureDefinition } from "./createFeature.js";
2
+ export declare function useFeature<TExports>(feature: FeatureDefinition<TExports, any[]>): TExports;
@@ -0,0 +1,12 @@
1
+ import { useMemo } from "react";
2
+ import { useContainer } from "./DiContainerProvider.js";
3
+ function useFeature(feature) {
4
+ const container = useContainer();
5
+ return useMemo(()=>feature.resolve(container), [
6
+ container,
7
+ feature
8
+ ]);
9
+ }
10
+ export { useFeature };
11
+
12
+ //# sourceMappingURL=useFeature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared/di/useFeature.js","sources":["../../../src/shared/di/useFeature.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useContainer } from \"./DiContainerProvider.js\";\nimport { FeatureDefinition } from \"./createFeature.js\";\n\nexport function useFeature<TExports>(feature: FeatureDefinition<TExports, any[]>): TExports {\n const container = useContainer();\n\n return useMemo(() => feature.resolve(container), [container, feature]);\n}\n"],"names":["useFeature","feature","container","useContainer","useMemo"],"mappings":";;AAIO,SAASA,WAAqBC,OAA2C;IAC5E,MAAMC,YAAYC;IAElB,OAAOC,QAAQ,IAAMH,QAAQ,OAAO,CAACC,YAAY;QAACA;QAAWD;KAAQ;AACzE"}
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"/></svg>
package/types.d.ts CHANGED
@@ -1,34 +1,14 @@
1
1
  import type * as React from "react";
2
- import { Plugin } from "@webiny/plugins/types";
3
- import type { ApolloClient } from "apollo-client";
4
2
  import type { CSSProperties } from "react";
3
+ import { Plugin } from "@webiny/plugins/types.js";
5
4
  export type GenericRecordKey = string | number | symbol;
6
5
  export type GenericRecord<K extends GenericRecordKey = GenericRecordKey, V = any> = Record<K, V>;
7
- export type UploadOptions = {
8
- apolloClient: ApolloClient<object>;
9
- onProgress?: (params: {
10
- sent: number;
11
- total: number;
12
- percentage: number;
13
- }) => void;
14
- };
6
+ export type NonEmptyArray<T> = [T, ...T[]];
15
7
  export type UiStatePlugin = Plugin & {
16
8
  type: "ui-state";
17
9
  render(): React.ReactElement;
18
10
  };
19
- export interface UploadedFile {
20
- id: string;
21
- name: string;
22
- type: string;
23
- size: number;
24
- key: string;
25
- }
26
- export type FileUploaderPlugin = Plugin & {
27
- type: "file-uploader";
28
- name: "file-uploader";
29
- upload(file: File, options: UploadOptions): Promise<UploadedFile>;
30
- };
31
- export { Plugin };
11
+ export type { Plugin };
32
12
  export interface ImageProps {
33
13
  src: string;
34
14
  preset?: string;
@@ -63,5 +43,7 @@ export type ImageComponentPlugin = Plugin & {
63
43
  */
64
44
  export type RoutePlugin = Plugin & {
65
45
  type: "route";
66
- route: React.ReactElement;
46
+ route: React.ReactElement<{
47
+ path: string;
48
+ }>;
67
49
  };
package/types.js CHANGED
@@ -1,14 +0,0 @@
1
- import { Plugin } from "@webiny/plugins/types";
2
- export { Plugin };
3
-
4
- /**
5
- * "getImageSrc" has to be defined as a separate property, so its functionality can be reused outside of
6
- * the Image component. This is ideal in cases where manual creation of image src is needed.
7
- */
8
-
9
- /**
10
- * Enables registering new routes.
11
- * @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#route
12
- */
13
-
14
- //# sourceMappingURL=types.js.map
@@ -1,25 +1,21 @@
1
- import React, { createContext } from "react";
2
- export function createGenericContext(name) {
3
- const GenericContext = /*#__PURE__*/createContext(undefined);
4
- function Provider({
5
- children,
6
- ...props
7
- }) {
8
- return /*#__PURE__*/React.createElement(GenericContext.Provider, {
9
- value: props
10
- }, children);
11
- }
12
- Provider.displayName = `${name}Provider`;
13
- return {
14
- Provider,
15
- useHook: () => {
16
- const context = React.useContext(GenericContext);
17
- if (!context) {
18
- throw Error(`Context provider for "${name}" is missing in the component tree!`);
19
- }
20
- return context;
1
+ import react, { createContext } from "react";
2
+ function createGenericContext(name) {
3
+ const GenericContext = /*#__PURE__*/ createContext(void 0);
4
+ function Provider({ children, ...props }) {
5
+ return /*#__PURE__*/ react.createElement(GenericContext.Provider, {
6
+ value: props
7
+ }, children);
21
8
  }
22
- };
9
+ Provider.displayName = `${name}Provider`;
10
+ return {
11
+ Provider,
12
+ useHook: ()=>{
13
+ const context = react.useContext(GenericContext);
14
+ if (!context) throw Error(`Context provider for "${name}" is missing in the component tree!`);
15
+ return context;
16
+ }
17
+ };
23
18
  }
19
+ export { createGenericContext };
24
20
 
25
21
  //# sourceMappingURL=createGenericContext.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","createContext","createGenericContext","name","GenericContext","undefined","Provider","children","props","createElement","value","displayName","useHook","context","useContext","Error"],"sources":["createGenericContext.tsx"],"sourcesContent":["import React, { createContext } from \"react\";\n\nexport type CreateGenericContext<T = any> = T;\n\ntype GenericContextProviderProps<T> = T & {\n children: React.ReactNode;\n};\n\nexport function createGenericContext<T>(name: string) {\n const GenericContext = createContext<CreateGenericContext | undefined>(undefined);\n\n function Provider({ children, ...props }: GenericContextProviderProps<T>) {\n return <GenericContext.Provider value={props}>{children}</GenericContext.Provider>;\n }\n\n Provider.displayName = `${name}Provider`;\n\n return {\n Provider,\n useHook: () => {\n const context = React.useContext<CreateGenericContext<T>>(\n GenericContext as unknown as React.Context<CreateGenericContext<T>>\n );\n\n if (!context) {\n throw Error(`Context provider for \"${name}\" is missing in the component tree!`);\n }\n\n return context;\n }\n };\n}\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAQ5C,OAAO,SAASC,oBAAoBA,CAAIC,IAAY,EAAE;EAClD,MAAMC,cAAc,gBAAGH,aAAa,CAAmCI,SAAS,CAAC;EAEjF,SAASC,QAAQA,CAAC;IAAEC,QAAQ;IAAE,GAAGC;EAAsC,CAAC,EAAE;IACtE,oBAAOR,KAAA,CAAAS,aAAA,CAACL,cAAc,CAACE,QAAQ;MAACI,KAAK,EAAEF;IAAM,GAAED,QAAkC,CAAC;EACtF;EAEAD,QAAQ,CAACK,WAAW,GAAG,GAAGR,IAAI,UAAU;EAExC,OAAO;IACHG,QAAQ;IACRM,OAAO,EAAEA,CAAA,KAAM;MACX,MAAMC,OAAO,GAAGb,KAAK,CAACc,UAAU,CAC5BV,cACJ,CAAC;MAED,IAAI,CAACS,OAAO,EAAE;QACV,MAAME,KAAK,CAAC,yBAAyBZ,IAAI,qCAAqC,CAAC;MACnF;MAEA,OAAOU,OAAO;IAClB;EACJ,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"utils/createGenericContext.js","sources":["../../src/utils/createGenericContext.tsx"],"sourcesContent":["import React, { createContext } from \"react\";\n\nexport type CreateGenericContext<T = any> = T;\n\ntype GenericContextProviderProps<T> = T & {\n children: React.ReactNode;\n};\n\nexport function createGenericContext<T>(name: string) {\n const GenericContext = createContext<CreateGenericContext | undefined>(undefined);\n\n function Provider({ children, ...props }: GenericContextProviderProps<T>) {\n return <GenericContext.Provider value={props}>{children}</GenericContext.Provider>;\n }\n\n Provider.displayName = `${name}Provider`;\n\n return {\n Provider,\n useHook: () => {\n const context = React.useContext<CreateGenericContext<T>>(\n GenericContext as unknown as React.Context<CreateGenericContext<T>>\n );\n\n if (!context) {\n throw Error(`Context provider for \"${name}\" is missing in the component tree!`);\n }\n\n return context;\n }\n };\n}\n"],"names":["createGenericContext","name","GenericContext","createContext","undefined","Provider","children","props","context","React","Error"],"mappings":";AAQO,SAASA,qBAAwBC,IAAY;IAChD,MAAMC,iBAAiB,WAAjBA,GAAiBC,cAAgDC;IAEvE,SAASC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,OAAuC;QACpE,OAAO,WAAP,GAAO,oBAACL,eAAe,QAAQ;YAAC,OAAOK;WAAQD;IACnD;IAEAD,SAAS,WAAW,GAAG,GAAGJ,KAAK,QAAQ,CAAC;IAExC,OAAO;QACHI;QACA,SAAS;YACL,MAAMG,UAAUC,MAAAA,UAAgB,CAC5BP;YAGJ,IAAI,CAACM,SACD,MAAME,MAAM,CAAC,sBAAsB,EAAET,KAAK,mCAAmC,CAAC;YAGlF,OAAOO;QACX;IACJ;AACJ"}
@@ -1,18 +1,15 @@
1
- export const createHashing = algorithm => {
2
- return async value => {
3
- const data = JSON.stringify(value);
4
- return new Promise(resolve => {
5
- window.crypto.subtle.digest(algorithm, new TextEncoder().encode(data)).then(encoded => {
6
- const hexes = [];
7
- const view = new DataView(encoded);
8
- for (let i = 0; i < view.byteLength; i += 4) {
9
- hexes.push(("00000000" + view.getUint32(i).toString(16)).slice(-8));
10
- }
11
- const hash = hexes.join("");
12
- resolve(hash);
13
- });
14
- });
15
- };
16
- };
1
+ const createHashing = (algorithm)=>async (value)=>{
2
+ const data = JSON.stringify(value);
3
+ return new Promise((resolve)=>{
4
+ window.crypto.subtle.digest(algorithm, new TextEncoder().encode(data)).then((encoded)=>{
5
+ const hexes = [];
6
+ const view = new DataView(encoded);
7
+ for(let i = 0; i < view.byteLength; i += 4)hexes.push(("00000000" + view.getUint32(i).toString(16)).slice(-8));
8
+ const hash = hexes.join("");
9
+ resolve(hash);
10
+ });
11
+ });
12
+ };
13
+ export { createHashing };
17
14
 
18
15
  //# sourceMappingURL=createHashing.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createHashing","algorithm","value","data","JSON","stringify","Promise","resolve","window","crypto","subtle","digest","TextEncoder","encode","then","encoded","hexes","view","DataView","i","byteLength","push","getUint32","toString","slice","hash","join"],"sources":["createHashing.ts"],"sourcesContent":["export type IHashingAlgorithm = \"SHA-1\" | \"SHA-256\" | \"SHA-512\";\n\nexport const createHashing = (algorithm: IHashingAlgorithm) => {\n return async (value: unknown) => {\n const data = JSON.stringify(value);\n return new Promise<string>(resolve => {\n window.crypto.subtle.digest(algorithm, new TextEncoder().encode(data)).then(encoded => {\n const hexes: string[] = [];\n const view = new DataView(encoded);\n for (let i = 0; i < view.byteLength; i += 4) {\n hexes.push((\"00000000\" + view.getUint32(i).toString(16)).slice(-8));\n }\n const hash = hexes.join(\"\");\n resolve(hash);\n });\n });\n };\n};\n"],"mappings":"AAEA,OAAO,MAAMA,aAAa,GAAIC,SAA4B,IAAK;EAC3D,OAAO,MAAOC,KAAc,IAAK;IAC7B,MAAMC,IAAI,GAAGC,IAAI,CAACC,SAAS,CAACH,KAAK,CAAC;IAClC,OAAO,IAAII,OAAO,CAASC,OAAO,IAAI;MAClCC,MAAM,CAACC,MAAM,CAACC,MAAM,CAACC,MAAM,CAACV,SAAS,EAAE,IAAIW,WAAW,CAAC,CAAC,CAACC,MAAM,CAACV,IAAI,CAAC,CAAC,CAACW,IAAI,CAACC,OAAO,IAAI;QACnF,MAAMC,KAAe,GAAG,EAAE;QAC1B,MAAMC,IAAI,GAAG,IAAIC,QAAQ,CAACH,OAAO,CAAC;QAClC,KAAK,IAAII,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,IAAI,CAACG,UAAU,EAAED,CAAC,IAAI,CAAC,EAAE;UACzCH,KAAK,CAACK,IAAI,CAAC,CAAC,UAAU,GAAGJ,IAAI,CAACK,SAAS,CAACH,CAAC,CAAC,CAACI,QAAQ,CAAC,EAAE,CAAC,EAAEC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACvE;QACA,MAAMC,IAAI,GAAGT,KAAK,CAACU,IAAI,CAAC,EAAE,CAAC;QAC3BnB,OAAO,CAACkB,IAAI,CAAC;MACjB,CAAC,CAAC;IACN,CAAC,CAAC;EACN,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"utils/createHashing.js","sources":["../../src/utils/createHashing.ts"],"sourcesContent":["export type IHashingAlgorithm = \"SHA-1\" | \"SHA-256\" | \"SHA-512\";\n\nexport const createHashing = (algorithm: IHashingAlgorithm) => {\n return async (value: unknown) => {\n const data = JSON.stringify(value);\n return new Promise<string>(resolve => {\n window.crypto.subtle.digest(algorithm, new TextEncoder().encode(data)).then(encoded => {\n const hexes: string[] = [];\n const view = new DataView(encoded);\n for (let i = 0; i < view.byteLength; i += 4) {\n hexes.push((\"00000000\" + view.getUint32(i).toString(16)).slice(-8));\n }\n const hash = hexes.join(\"\");\n resolve(hash);\n });\n });\n };\n};\n"],"names":["createHashing","algorithm","value","data","JSON","Promise","resolve","window","TextEncoder","encoded","hexes","view","DataView","i","hash"],"mappings":"AAEO,MAAMA,gBAAgB,CAACC,YACnB,OAAOC;QACV,MAAMC,OAAOC,KAAK,SAAS,CAACF;QAC5B,OAAO,IAAIG,QAAgBC,CAAAA;YACvBC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAACN,WAAW,IAAIO,cAAc,MAAM,CAACL,OAAO,IAAI,CAACM,CAAAA;gBACxE,MAAMC,QAAkB,EAAE;gBAC1B,MAAMC,OAAO,IAAIC,SAASH;gBAC1B,IAAK,IAAII,IAAI,GAAGA,IAAIF,KAAK,UAAU,EAAEE,KAAK,EACtCH,MAAM,IAAI,CAAE,cAAaC,KAAK,SAAS,CAACE,GAAG,QAAQ,CAAC,GAAE,EAAG,KAAK,CAAC;gBAEnE,MAAMC,OAAOJ,MAAM,IAAI,CAAC;gBACxBJ,QAAQQ;YACZ;QACJ;IACJ"}
package/utils/index.d.ts CHANGED
@@ -1,10 +1,2 @@
1
- export * from "./createHashing";
2
- export * from "./getApiUrl";
3
- export * from "./getGqlApiUrl";
4
- export * from "./getHeadlessCmsGqlApiUrl";
5
- export * from "./getLocaleCode";
6
- export * from "./getPrerenderId";
7
- export * from "./getTenantId";
8
- export * from "./isLocalhost";
9
- export * from "./isPrerendering";
10
- export * from "./legacyPluginToReactComponent";
1
+ export * from "./createHashing.js";
2
+ export * from "./legacyPluginToReactComponent.js";
package/utils/index.js CHANGED
@@ -1,12 +1,2 @@
1
- export * from "./createHashing";
2
- export * from "./getApiUrl";
3
- export * from "./getGqlApiUrl";
4
- export * from "./getHeadlessCmsGqlApiUrl";
5
- export * from "./getLocaleCode";
6
- export * from "./getPrerenderId";
7
- export * from "./getTenantId";
8
- export * from "./isLocalhost";
9
- export * from "./isPrerendering";
10
- export * from "./legacyPluginToReactComponent";
11
-
12
- //# sourceMappingURL=index.js.map
1
+ export * from "./createHashing.js";
2
+ export * from "./legacyPluginToReactComponent.js";
@@ -1,14 +1,15 @@
1
- import { useRegisterLegacyPlugin } from "../hooks/useRegisterLegacyPlugin";
2
- export const legacyPluginToReactComponent = function (params) {
3
- const Component = props => {
4
- const plugin = Object.assign({
5
- type: params.pluginType
6
- }, params.mapProps ? params.mapProps(props) : props);
7
- useRegisterLegacyPlugin(plugin);
8
- return null;
9
- };
10
- Component.displayName = params.componentDisplayName;
11
- return Component;
1
+ import { useRegisterLegacyPlugin } from "../hooks/useRegisterLegacyPlugin.js";
2
+ const legacyPluginToReactComponent = function(params) {
3
+ const Component = (props)=>{
4
+ const plugin = Object.assign({
5
+ type: params.pluginType
6
+ }, params.mapProps ? params.mapProps(props) : props);
7
+ useRegisterLegacyPlugin(plugin);
8
+ return null;
9
+ };
10
+ Component.displayName = params.componentDisplayName;
11
+ return Component;
12
12
  };
13
+ export { legacyPluginToReactComponent };
13
14
 
14
15
  //# sourceMappingURL=legacyPluginToReactComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useRegisterLegacyPlugin","legacyPluginToReactComponent","params","Component","props","plugin","Object","assign","type","pluginType","mapProps","displayName","componentDisplayName"],"sources":["legacyPluginToReactComponent.ts"],"sourcesContent":["import type React from \"react\";\nimport { useRegisterLegacyPlugin } from \"~/hooks/useRegisterLegacyPlugin\";\n\nexport interface LegacyPluginToReactComponentParams<TProps extends Record<string, any>> {\n pluginType: string;\n componentDisplayName: string;\n mapProps?: (props: TProps) => TProps;\n}\n\nexport const legacyPluginToReactComponent = function <TProps extends Record<string, any>>(\n params: LegacyPluginToReactComponentParams<TProps>\n) {\n const Component: React.ComponentType<TProps> = props => {\n const plugin = Object.assign(\n { type: params.pluginType },\n params.mapProps ? params.mapProps(props) : props\n );\n useRegisterLegacyPlugin(plugin);\n return null;\n };\n\n Component.displayName = params.componentDisplayName;\n\n return Component;\n};\n"],"mappings":"AACA,SAASA,uBAAuB;AAQhC,OAAO,MAAMC,4BAA4B,GAAG,SAAAA,CACxCC,MAAkD,EACpD;EACE,MAAMC,SAAsC,GAAGC,KAAK,IAAI;IACpD,MAAMC,MAAM,GAAGC,MAAM,CAACC,MAAM,CACxB;MAAEC,IAAI,EAAEN,MAAM,CAACO;IAAW,CAAC,EAC3BP,MAAM,CAACQ,QAAQ,GAAGR,MAAM,CAACQ,QAAQ,CAACN,KAAK,CAAC,GAAGA,KAC/C,CAAC;IACDJ,uBAAuB,CAACK,MAAM,CAAC;IAC/B,OAAO,IAAI;EACf,CAAC;EAEDF,SAAS,CAACQ,WAAW,GAAGT,MAAM,CAACU,oBAAoB;EAEnD,OAAOT,SAAS;AACpB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"utils/legacyPluginToReactComponent.js","sources":["../../src/utils/legacyPluginToReactComponent.ts"],"sourcesContent":["import type React from \"react\";\nimport { useRegisterLegacyPlugin } from \"~/hooks/useRegisterLegacyPlugin.js\";\n\nexport interface LegacyPluginToReactComponentParams<TProps extends Record<string, any>> {\n pluginType: string;\n componentDisplayName: string;\n mapProps?: (props: TProps) => TProps;\n}\n\nexport const legacyPluginToReactComponent = function <TProps extends Record<string, any>>(\n params: LegacyPluginToReactComponentParams<TProps>\n) {\n const Component: React.ComponentType<TProps> = props => {\n const plugin = Object.assign(\n { type: params.pluginType },\n params.mapProps ? params.mapProps(props) : props\n );\n useRegisterLegacyPlugin(plugin);\n return null;\n };\n\n Component.displayName = params.componentDisplayName;\n\n return Component;\n};\n"],"names":["legacyPluginToReactComponent","params","Component","props","plugin","Object","useRegisterLegacyPlugin"],"mappings":";AASO,MAAMA,+BAA+B,SACxCC,MAAkD;IAElD,MAAMC,YAAyCC,CAAAA;QAC3C,MAAMC,SAASC,OAAO,MAAM,CACxB;YAAE,MAAMJ,OAAO,UAAU;QAAC,GAC1BA,OAAO,QAAQ,GAAGA,OAAO,QAAQ,CAACE,SAASA;QAE/CG,wBAAwBF;QACxB,OAAO;IACX;IAEAF,UAAU,WAAW,GAAGD,OAAO,oBAAoB;IAEnD,OAAOC;AACX"}
@@ -1,8 +0,0 @@
1
- import type { InMemoryCacheConfig } from "apollo-cache-inmemory";
2
- import { InMemoryCache as BaseInMemoryCache } from "apollo-cache-inmemory";
3
- import type { DocumentNode } from "graphql";
4
- export declare class InMemoryCache extends BaseInMemoryCache {
5
- private readonly transformPlugins;
6
- constructor(config?: InMemoryCacheConfig);
7
- transformDocument(document: DocumentNode): DocumentNode;
8
- }
@@ -1,20 +0,0 @@
1
- import { InMemoryCache as BaseInMemoryCache } from "apollo-cache-inmemory";
2
- import { plugins } from "@webiny/plugins";
3
- import { AddQuerySelectionPlugin } from "../plugins/AddQuerySelectionPlugin";
4
- import { ApolloLinkPlugin } from "../plugins/ApolloLinkPlugin";
5
- export class InMemoryCache extends BaseInMemoryCache {
6
- constructor(config) {
7
- super(config);
8
- this.transformPlugins = plugins.byType(ApolloLinkPlugin.type).filter(pl => pl instanceof AddQuerySelectionPlugin);
9
- }
10
- transformDocument(document) {
11
- // @ts-expect-error
12
- const operationName = document.definitions[0].name.value;
13
- for (const pl of this.transformPlugins) {
14
- pl.addSelectionToQuery(operationName, document);
15
- }
16
- return super.transformDocument(document);
17
- }
18
- }
19
-
20
- //# sourceMappingURL=InMemoryCache.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["InMemoryCache","BaseInMemoryCache","plugins","AddQuerySelectionPlugin","ApolloLinkPlugin","constructor","config","transformPlugins","byType","type","filter","pl","transformDocument","document","operationName","definitions","name","value","addSelectionToQuery"],"sources":["InMemoryCache.ts"],"sourcesContent":["import type { InMemoryCacheConfig } from \"apollo-cache-inmemory\";\nimport { InMemoryCache as BaseInMemoryCache } from \"apollo-cache-inmemory\";\nimport type { DocumentNode } from \"graphql\";\nimport { plugins } from \"@webiny/plugins\";\nimport { AddQuerySelectionPlugin } from \"../plugins/AddQuerySelectionPlugin\";\nimport { ApolloLinkPlugin } from \"../plugins/ApolloLinkPlugin\";\n\nexport class InMemoryCache extends BaseInMemoryCache {\n private readonly transformPlugins: AddQuerySelectionPlugin[];\n\n constructor(config?: InMemoryCacheConfig) {\n super(config);\n\n this.transformPlugins = plugins\n .byType<AddQuerySelectionPlugin>(ApolloLinkPlugin.type)\n .filter(pl => pl instanceof AddQuerySelectionPlugin);\n }\n\n public override transformDocument(document: DocumentNode): DocumentNode {\n // @ts-expect-error\n const operationName = document.definitions[0].name.value;\n\n for (const pl of this.transformPlugins) {\n pl.addSelectionToQuery(operationName, document);\n }\n\n return super.transformDocument(document);\n }\n}\n"],"mappings":"AACA,SAASA,aAAa,IAAIC,iBAAiB,QAAQ,uBAAuB;AAE1E,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,uBAAuB;AAChC,SAASC,gBAAgB;AAEzB,OAAO,MAAMJ,aAAa,SAASC,iBAAiB,CAAC;EAGjDI,WAAWA,CAACC,MAA4B,EAAE;IACtC,KAAK,CAACA,MAAM,CAAC;IAEb,IAAI,CAACC,gBAAgB,GAAGL,OAAO,CAC1BM,MAAM,CAA0BJ,gBAAgB,CAACK,IAAI,CAAC,CACtDC,MAAM,CAACC,EAAE,IAAIA,EAAE,YAAYR,uBAAuB,CAAC;EAC5D;EAEgBS,iBAAiBA,CAACC,QAAsB,EAAgB;IACpE;IACA,MAAMC,aAAa,GAAGD,QAAQ,CAACE,WAAW,CAAC,CAAC,CAAC,CAACC,IAAI,CAACC,KAAK;IAExD,KAAK,MAAMN,EAAE,IAAI,IAAI,CAACJ,gBAAgB,EAAE;MACpCI,EAAE,CAACO,mBAAmB,CAACJ,aAAa,EAAED,QAAQ,CAAC;IACnD;IAEA,OAAO,KAAK,CAACD,iBAAiB,CAACC,QAAQ,CAAC;EAC5C;AACJ","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- import type { IdValue } from "apollo-utilities";
2
- import type { ReadStoreContext, FragmentMatcherInterface, IntrospectionResultData } from "apollo-cache-inmemory";
3
- export declare class IntrospectionFragmentMatcher implements FragmentMatcherInterface {
4
- private readonly isReady;
5
- private readonly possibleTypesMap;
6
- constructor(options?: {
7
- introspectionQueryResultData?: IntrospectionResultData;
8
- });
9
- match(idValue: IdValue, typeCondition: string, context: ReadStoreContext): boolean;
10
- private parseIntrospectionResult;
11
- }
@@ -1,45 +0,0 @@
1
- import { invariant } from "ts-invariant";
2
- export class IntrospectionFragmentMatcher {
3
- possibleTypesMap = {};
4
- constructor(options) {
5
- if (options && options.introspectionQueryResultData) {
6
- this.possibleTypesMap = this.parseIntrospectionResult(options.introspectionQueryResultData);
7
- this.isReady = true;
8
- } else {
9
- this.isReady = false;
10
- }
11
- this.match = this.match.bind(this);
12
- }
13
- match(idValue, typeCondition, context) {
14
- invariant(this.isReady, "FragmentMatcher.match() was called before FragmentMatcher.init()");
15
- const obj = context.store.get(idValue.id);
16
- const isRootQuery = idValue.id === "ROOT_QUERY";
17
- if (!obj) {
18
- // https://github.com/apollographql/apollo-client/pull/4620
19
- return isRootQuery;
20
- }
21
- const {
22
- __typename = isRootQuery && "Query"
23
- } = obj;
24
- invariant(__typename, `Cannot match fragment because __typename property is missing: ${JSON.stringify(obj)}`);
25
- if (__typename === typeCondition) {
26
- return true;
27
- }
28
- const implementingTypes = this.possibleTypesMap[typeCondition];
29
- if (__typename && implementingTypes && implementingTypes.indexOf(__typename) > -1) {
30
- return true;
31
- }
32
- return false;
33
- }
34
- parseIntrospectionResult(introspectionResultData) {
35
- const typeMap = {};
36
- introspectionResultData.__schema.types.forEach(type => {
37
- if (type.kind === "UNION" || type.kind === "INTERFACE") {
38
- typeMap[type.name] = type.possibleTypes.map(implementingType => implementingType.name);
39
- }
40
- });
41
- return typeMap;
42
- }
43
- }
44
-
45
- //# sourceMappingURL=IntrospectionFragmentMatcher.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["invariant","IntrospectionFragmentMatcher","possibleTypesMap","constructor","options","introspectionQueryResultData","parseIntrospectionResult","isReady","match","bind","idValue","typeCondition","context","obj","store","get","id","isRootQuery","__typename","JSON","stringify","implementingTypes","indexOf","introspectionResultData","typeMap","__schema","types","forEach","type","kind","name","possibleTypes","map","implementingType"],"sources":["IntrospectionFragmentMatcher.ts"],"sourcesContent":["import type { IdValue } from \"apollo-utilities\";\nimport { invariant } from \"ts-invariant\";\n\nimport type {\n ReadStoreContext,\n FragmentMatcherInterface,\n PossibleTypesMap,\n IntrospectionResultData\n} from \"apollo-cache-inmemory\";\n\nexport class IntrospectionFragmentMatcher implements FragmentMatcherInterface {\n private readonly isReady: boolean;\n private readonly possibleTypesMap: PossibleTypesMap = {};\n\n constructor(options?: { introspectionQueryResultData?: IntrospectionResultData }) {\n if (options && options.introspectionQueryResultData) {\n this.possibleTypesMap = this.parseIntrospectionResult(\n options.introspectionQueryResultData\n );\n this.isReady = true;\n } else {\n this.isReady = false;\n }\n\n this.match = this.match.bind(this);\n }\n\n public match(idValue: IdValue, typeCondition: string, context: ReadStoreContext) {\n invariant(this.isReady, \"FragmentMatcher.match() was called before FragmentMatcher.init()\");\n\n const obj = context.store.get(idValue.id);\n const isRootQuery = idValue.id === \"ROOT_QUERY\";\n\n if (!obj) {\n // https://github.com/apollographql/apollo-client/pull/4620\n return isRootQuery;\n }\n\n const { __typename = isRootQuery && \"Query\" } = obj;\n\n invariant(\n __typename,\n `Cannot match fragment because __typename property is missing: ${JSON.stringify(obj)}`\n );\n\n if (__typename === typeCondition) {\n return true;\n }\n\n const implementingTypes = this.possibleTypesMap[typeCondition];\n if (__typename && implementingTypes && implementingTypes.indexOf(__typename) > -1) {\n return true;\n }\n\n return false;\n }\n\n private parseIntrospectionResult(\n introspectionResultData: IntrospectionResultData\n ): PossibleTypesMap {\n const typeMap: PossibleTypesMap = {};\n introspectionResultData.__schema.types.forEach(type => {\n if (type.kind === \"UNION\" || type.kind === \"INTERFACE\") {\n typeMap[type.name] = type.possibleTypes.map(\n implementingType => implementingType.name\n );\n }\n });\n return typeMap;\n }\n}\n"],"mappings":"AACA,SAASA,SAAS,QAAQ,cAAc;AASxC,OAAO,MAAMC,4BAA4B,CAAqC;EAEzDC,gBAAgB,GAAqB,CAAC,CAAC;EAExDC,WAAWA,CAACC,OAAoE,EAAE;IAC9E,IAAIA,OAAO,IAAIA,OAAO,CAACC,4BAA4B,EAAE;MACjD,IAAI,CAACH,gBAAgB,GAAG,IAAI,CAACI,wBAAwB,CACjDF,OAAO,CAACC,4BACZ,CAAC;MACD,IAAI,CAACE,OAAO,GAAG,IAAI;IACvB,CAAC,MAAM;MACH,IAAI,CAACA,OAAO,GAAG,KAAK;IACxB;IAEA,IAAI,CAACC,KAAK,GAAG,IAAI,CAACA,KAAK,CAACC,IAAI,CAAC,IAAI,CAAC;EACtC;EAEOD,KAAKA,CAACE,OAAgB,EAAEC,aAAqB,EAAEC,OAAyB,EAAE;IAC7EZ,SAAS,CAAC,IAAI,CAACO,OAAO,EAAE,kEAAkE,CAAC;IAE3F,MAAMM,GAAG,GAAGD,OAAO,CAACE,KAAK,CAACC,GAAG,CAACL,OAAO,CAACM,EAAE,CAAC;IACzC,MAAMC,WAAW,GAAGP,OAAO,CAACM,EAAE,KAAK,YAAY;IAE/C,IAAI,CAACH,GAAG,EAAE;MACN;MACA,OAAOI,WAAW;IACtB;IAEA,MAAM;MAAEC,UAAU,GAAGD,WAAW,IAAI;IAAQ,CAAC,GAAGJ,GAAG;IAEnDb,SAAS,CACLkB,UAAU,EACV,iEAAiEC,IAAI,CAACC,SAAS,CAACP,GAAG,CAAC,EACxF,CAAC;IAED,IAAIK,UAAU,KAAKP,aAAa,EAAE;MAC9B,OAAO,IAAI;IACf;IAEA,MAAMU,iBAAiB,GAAG,IAAI,CAACnB,gBAAgB,CAACS,aAAa,CAAC;IAC9D,IAAIO,UAAU,IAAIG,iBAAiB,IAAIA,iBAAiB,CAACC,OAAO,CAACJ,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE;MAC/E,OAAO,IAAI;IACf;IAEA,OAAO,KAAK;EAChB;EAEQZ,wBAAwBA,CAC5BiB,uBAAgD,EAChC;IAChB,MAAMC,OAAyB,GAAG,CAAC,CAAC;IACpCD,uBAAuB,CAACE,QAAQ,CAACC,KAAK,CAACC,OAAO,CAACC,IAAI,IAAI;MACnD,IAAIA,IAAI,CAACC,IAAI,KAAK,OAAO,IAAID,IAAI,CAACC,IAAI,KAAK,WAAW,EAAE;QACpDL,OAAO,CAACI,IAAI,CAACE,IAAI,CAAC,GAAGF,IAAI,CAACG,aAAa,CAACC,GAAG,CACvCC,gBAAgB,IAAIA,gBAAgB,CAACH,IACzC,CAAC;MACL;IACJ,CAAC,CAAC;IACF,OAAON,OAAO;EAClB;AACJ","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import React from "react";
2
- export declare const Routes: () => React.JSX.Element;
@@ -1,36 +0,0 @@
1
- // This file is necessary only for backwards compatibility.
2
- // We'll remove this once the legacy rendering engine is removed.
3
- import React from "react";
4
- import { plugins } from "@webiny/plugins";
5
- import { Routes as ReactRouterRoutes } from "@webiny/react-router";
6
- export const Routes = () => {
7
- // We cannot call `sort` on the array returned by the `plugins.byType` call - it is read-only.
8
- const routes = [...plugins.byType("route")].sort((a, b) => {
9
- const pathA = a.route.props.path || "*";
10
- const pathB = b.route.props.path || "*";
11
-
12
- // This will sort paths at the very bottom of the list
13
- if (pathA === "/" && pathB === "*") {
14
- return -1;
15
- }
16
-
17
- // This will push * and / to the bottom of the list
18
- if (pathA === "*" || pathA === "/") {
19
- return 1;
20
- }
21
-
22
- // This will push * and / to the bottom of the list
23
- if (["*", "/"].includes(pathB)) {
24
- return -1;
25
- }
26
- return 0;
27
- });
28
- return /*#__PURE__*/React.createElement(ReactRouterRoutes, null, routes.map(({
29
- route,
30
- name
31
- }) => /*#__PURE__*/React.cloneElement(route, {
32
- key: name
33
- })));
34
- };
35
-
36
- //# sourceMappingURL=Routes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","plugins","Routes","ReactRouterRoutes","routes","byType","sort","a","b","pathA","route","props","path","pathB","includes","createElement","map","name","cloneElement","key"],"sources":["Routes.tsx"],"sourcesContent":["// This file is necessary only for backwards compatibility.\n// We'll remove this once the legacy rendering engine is removed.\nimport React from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Routes as ReactRouterRoutes } from \"@webiny/react-router\";\nimport type { RoutePlugin } from \"../types\";\n\nexport const Routes = () => {\n // We cannot call `sort` on the array returned by the `plugins.byType` call - it is read-only.\n const routes = [...plugins.byType<RoutePlugin>(\"route\")].sort((a, b) => {\n const pathA = a.route.props.path || \"*\";\n const pathB = b.route.props.path || \"*\";\n\n // This will sort paths at the very bottom of the list\n if (pathA === \"/\" && pathB === \"*\") {\n return -1;\n }\n\n // This will push * and / to the bottom of the list\n if (pathA === \"*\" || pathA === \"/\") {\n return 1;\n }\n\n // This will push * and / to the bottom of the list\n if ([\"*\", \"/\"].includes(pathB)) {\n return -1;\n }\n\n return 0;\n });\n\n return (\n <ReactRouterRoutes>\n {routes.map(({ route, name }) => React.cloneElement(route, { key: name }))}\n </ReactRouterRoutes>\n );\n};\n"],"mappings":"AAAA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,MAAM,IAAIC,iBAAiB,QAAQ,sBAAsB;AAGlE,OAAO,MAAMD,MAAM,GAAGA,CAAA,KAAM;EACxB;EACA,MAAME,MAAM,GAAG,CAAC,GAAGH,OAAO,CAACI,MAAM,CAAc,OAAO,CAAC,CAAC,CAACC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAK;IACpE,MAAMC,KAAK,GAAGF,CAAC,CAACG,KAAK,CAACC,KAAK,CAACC,IAAI,IAAI,GAAG;IACvC,MAAMC,KAAK,GAAGL,CAAC,CAACE,KAAK,CAACC,KAAK,CAACC,IAAI,IAAI,GAAG;;IAEvC;IACA,IAAIH,KAAK,KAAK,GAAG,IAAII,KAAK,KAAK,GAAG,EAAE;MAChC,OAAO,CAAC,CAAC;IACb;;IAEA;IACA,IAAIJ,KAAK,KAAK,GAAG,IAAIA,KAAK,KAAK,GAAG,EAAE;MAChC,OAAO,CAAC;IACZ;;IAEA;IACA,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAACK,QAAQ,CAACD,KAAK,CAAC,EAAE;MAC5B,OAAO,CAAC,CAAC;IACb;IAEA,OAAO,CAAC;EACZ,CAAC,CAAC;EAEF,oBACIb,KAAA,CAAAe,aAAA,CAACZ,iBAAiB,QACbC,MAAM,CAACY,GAAG,CAAC,CAAC;IAAEN,KAAK;IAAEO;EAAK,CAAC,kBAAKjB,KAAK,CAACkB,YAAY,CAACR,KAAK,EAAE;IAAES,GAAG,EAAEF;EAAK,CAAC,CAAC,CAC1D,CAAC;AAE5B,CAAC","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- interface Props {
3
- name: string;
4
- props?: Record<string, any>;
5
- children?: React.ReactNode;
6
- }
7
- export declare const View: ({ name, children, props }: Props) => React.JSX.Element;
8
- export {};
@@ -1,19 +0,0 @@
1
- import React, { Fragment } from "react";
2
- import { plugins } from "@webiny/plugins";
3
- import { ViewPlugin } from "../plugins/ViewPlugin";
4
- export const View = ({
5
- name,
6
- children,
7
- props = {}
8
- }) => {
9
- const viewPlugins = plugins.byType(ViewPlugin.type).filter(pl => pl.key === name);
10
- if (viewPlugins.length) {
11
- children = viewPlugins.reduce((el, pl) => pl.render({
12
- children: el,
13
- ...props
14
- }), children);
15
- }
16
- return /*#__PURE__*/React.createElement(Fragment, null, children || null);
17
- };
18
-
19
- //# sourceMappingURL=View.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","Fragment","plugins","ViewPlugin","View","name","children","props","viewPlugins","byType","type","filter","pl","key","length","reduce","el","render","createElement"],"sources":["View.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { ViewPlugin } from \"../plugins/ViewPlugin\";\n\ninterface Props {\n name: string;\n props?: Record<string, any>;\n children?: React.ReactNode;\n}\n\nexport const View = ({ name, children, props = {} }: Props) => {\n const viewPlugins = plugins.byType<ViewPlugin>(ViewPlugin.type).filter(pl => pl.key === name);\n\n if (viewPlugins.length) {\n children = viewPlugins.reduce((el, pl) => pl.render({ children: el, ...props }), children);\n }\n\n return <Fragment>{children || null}</Fragment>;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,UAAU;AAQnB,OAAO,MAAMC,IAAI,GAAGA,CAAC;EAAEC,IAAI;EAAEC,QAAQ;EAAEC,KAAK,GAAG,CAAC;AAAS,CAAC,KAAK;EAC3D,MAAMC,WAAW,GAAGN,OAAO,CAACO,MAAM,CAAaN,UAAU,CAACO,IAAI,CAAC,CAACC,MAAM,CAACC,EAAE,IAAIA,EAAE,CAACC,GAAG,KAAKR,IAAI,CAAC;EAE7F,IAAIG,WAAW,CAACM,MAAM,EAAE;IACpBR,QAAQ,GAAGE,WAAW,CAACO,MAAM,CAAC,CAACC,EAAE,EAAEJ,EAAE,KAAKA,EAAE,CAACK,MAAM,CAAC;MAAEX,QAAQ,EAAEU,EAAE;MAAE,GAAGT;IAAM,CAAC,CAAC,EAAED,QAAQ,CAAC;EAC9F;EAEA,oBAAON,KAAA,CAAAkB,aAAA,CAACjB,QAAQ,QAAEK,QAAQ,IAAI,IAAe,CAAC;AAClD,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["Image","Routes"],"sources":["index.ts"],"sourcesContent":["export { Image } from \"./Image\";\nexport { Routes } from \"./Routes\";\n"],"mappings":"AAAA,SAASA,KAAK;AACd,SAASC,MAAM","ignoreList":[]}
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- interface Props {
3
- wait?: number;
4
- children?: React.ReactNode;
5
- }
6
- /**
7
- * We need to debounce the rendering of children during app bootstrap, since many plugins
8
- * can add more and more Providers which will recompose the entire hierarchy of React Context providers.
9
- * During this stage, we don't want to render anything.
10
- */
11
- export declare const DebounceRender: ({ wait, children }: Props) => React.JSX.Element;
12
- export {};
@@ -1,31 +0,0 @@
1
- import React from "react";
2
- import { useEffect, useMemo, useState } from "react";
3
- import debounce from "lodash/debounce";
4
- /**
5
- * We need to debounce the rendering of children during app bootstrap, since many plugins
6
- * can add more and more Providers which will recompose the entire hierarchy of React Context providers.
7
- * During this stage, we don't want to render anything.
8
- */
9
- export const DebounceRender = ({
10
- wait = 50,
11
- children
12
- }) => {
13
- const [render, setRender] = useState(wait === 0);
14
- const debouncedRender = useMemo(() => {
15
- return debounce(() => {
16
- setRender(true);
17
- }, wait);
18
- }, [setRender]);
19
- useEffect(() => {
20
- if (render) {
21
- return;
22
- }
23
- debouncedRender();
24
- return () => {
25
- debouncedRender.cancel();
26
- };
27
- }, []);
28
- return /*#__PURE__*/React.createElement(React.Fragment, null, render ? children : null);
29
- };
30
-
31
- //# sourceMappingURL=DebounceRender.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","useEffect","useMemo","useState","debounce","DebounceRender","wait","children","render","setRender","debouncedRender","cancel","createElement","Fragment"],"sources":["DebounceRender.tsx"],"sourcesContent":["import React from \"react\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport debounce from \"lodash/debounce\";\n\ninterface Props {\n wait?: number;\n children?: React.ReactNode;\n}\n/**\n * We need to debounce the rendering of children during app bootstrap, since many plugins\n * can add more and more Providers which will recompose the entire hierarchy of React Context providers.\n * During this stage, we don't want to render anything.\n */\nexport const DebounceRender = ({ wait = 50, children }: Props) => {\n const [render, setRender] = useState(wait === 0);\n\n const debouncedRender = useMemo(() => {\n return debounce(() => {\n setRender(true);\n }, wait);\n }, [setRender]);\n\n useEffect(() => {\n if (render) {\n return;\n }\n\n debouncedRender();\n\n return () => {\n debouncedRender.cancel();\n };\n }, []);\n\n return <>{render ? children : null}</>;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACpD,OAAOC,QAAQ,MAAM,iBAAiB;AAMtC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAGA,CAAC;EAAEC,IAAI,GAAG,EAAE;EAAEC;AAAgB,CAAC,KAAK;EAC9D,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGN,QAAQ,CAACG,IAAI,KAAK,CAAC,CAAC;EAEhD,MAAMI,eAAe,GAAGR,OAAO,CAAC,MAAM;IAClC,OAAOE,QAAQ,CAAC,MAAM;MAClBK,SAAS,CAAC,IAAI,CAAC;IACnB,CAAC,EAAEH,IAAI,CAAC;EACZ,CAAC,EAAE,CAACG,SAAS,CAAC,CAAC;EAEfR,SAAS,CAAC,MAAM;IACZ,IAAIO,MAAM,EAAE;MACR;IACJ;IAEAE,eAAe,CAAC,CAAC;IAEjB,OAAO,MAAM;MACTA,eAAe,CAACC,MAAM,CAAC,CAAC;IAC5B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,oBAAOX,KAAA,CAAAY,aAAA,CAAAZ,KAAA,CAAAa,QAAA,QAAGL,MAAM,GAAGD,QAAQ,GAAG,IAAO,CAAC;AAC1C,CAAC","ignoreList":[]}
package/core/Routes.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- interface RoutesProps {
3
- routes: JSX.Element[];
4
- }
5
- export declare const Routes: (props: RoutesProps) => React.JSX.Element;
6
- export {};
package/core/Routes.js DELETED
@@ -1,34 +0,0 @@
1
- import React from "react";
2
- import { plugins } from "@webiny/plugins";
3
- import { Routes as ReactRouterRoutes } from "@webiny/react-router";
4
- export const Routes = props => {
5
- const routes = [...props.routes,
6
- // For backwards compatibility, we need to support the RoutePlugin routes as well.
7
- ...plugins.byType("route").map(({
8
- route
9
- }) => route)].sort((a, b) => {
10
- const pathA = a.props.path || "*";
11
- const pathB = b.props.path || "*";
12
-
13
- // This will sort paths at the very bottom of the list
14
- if (pathA === "/" && pathB === "*") {
15
- return -1;
16
- }
17
-
18
- // This will push * and / to the bottom of the list
19
- if (pathA === "*" || pathA === "/") {
20
- return 1;
21
- }
22
-
23
- // This will push * and / to the bottom of the list
24
- if (["*", "/"].includes(pathB)) {
25
- return -1;
26
- }
27
- return 0;
28
- });
29
- return /*#__PURE__*/React.createElement(ReactRouterRoutes, null, routes.map((route, index) => /*#__PURE__*/React.cloneElement(route, {
30
- key: `${route.props.path}:${index}`
31
- })));
32
- };
33
-
34
- //# sourceMappingURL=Routes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","plugins","Routes","ReactRouterRoutes","props","routes","byType","map","route","sort","a","b","pathA","path","pathB","includes","createElement","index","cloneElement","key"],"sources":["Routes.tsx"],"sourcesContent":["import React from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Routes as ReactRouterRoutes } from \"@webiny/react-router\";\nimport type { RoutePlugin } from \"~/types\";\n\ninterface RoutesProps {\n routes: JSX.Element[];\n}\n\nexport const Routes = (props: RoutesProps) => {\n const routes = [\n ...props.routes,\n // For backwards compatibility, we need to support the RoutePlugin routes as well.\n ...plugins.byType<RoutePlugin>(\"route\").map(({ route }) => route)\n ].sort((a, b) => {\n const pathA = a.props.path || \"*\";\n const pathB = b.props.path || \"*\";\n\n // This will sort paths at the very bottom of the list\n if (pathA === \"/\" && pathB === \"*\") {\n return -1;\n }\n\n // This will push * and / to the bottom of the list\n if (pathA === \"*\" || pathA === \"/\") {\n return 1;\n }\n\n // This will push * and / to the bottom of the list\n if ([\"*\", \"/\"].includes(pathB)) {\n return -1;\n }\n\n return 0;\n });\n\n return (\n <ReactRouterRoutes>\n {routes.map((route, index) =>\n React.cloneElement(route, { key: `${route.props.path}:${index}` })\n )}\n </ReactRouterRoutes>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,MAAM,IAAIC,iBAAiB,QAAQ,sBAAsB;AAOlE,OAAO,MAAMD,MAAM,GAAIE,KAAkB,IAAK;EAC1C,MAAMC,MAAM,GAAG,CACX,GAAGD,KAAK,CAACC,MAAM;EACf;EACA,GAAGJ,OAAO,CAACK,MAAM,CAAc,OAAO,CAAC,CAACC,GAAG,CAAC,CAAC;IAAEC;EAAM,CAAC,KAAKA,KAAK,CAAC,CACpE,CAACC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAK;IACb,MAAMC,KAAK,GAAGF,CAAC,CAACN,KAAK,CAACS,IAAI,IAAI,GAAG;IACjC,MAAMC,KAAK,GAAGH,CAAC,CAACP,KAAK,CAACS,IAAI,IAAI,GAAG;;IAEjC;IACA,IAAID,KAAK,KAAK,GAAG,IAAIE,KAAK,KAAK,GAAG,EAAE;MAChC,OAAO,CAAC,CAAC;IACb;;IAEA;IACA,IAAIF,KAAK,KAAK,GAAG,IAAIA,KAAK,KAAK,GAAG,EAAE;MAChC,OAAO,CAAC;IACZ;;IAEA;IACA,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAACG,QAAQ,CAACD,KAAK,CAAC,EAAE;MAC5B,OAAO,CAAC,CAAC;IACb;IAEA,OAAO,CAAC;EACZ,CAAC,CAAC;EAEF,oBACId,KAAA,CAAAgB,aAAA,CAACb,iBAAiB,QACbE,MAAM,CAACE,GAAG,CAAC,CAACC,KAAK,EAAES,KAAK,kBACrBjB,KAAK,CAACkB,YAAY,CAACV,KAAK,EAAE;IAAEW,GAAG,EAAE,GAAGX,KAAK,CAACJ,KAAK,CAACS,IAAI,IAAII,KAAK;EAAG,CAAC,CACrE,CACe,CAAC;AAE5B,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- export { useAutocomplete } from "./useAutocomplete";
@@ -1,3 +0,0 @@
1
- export { useAutocomplete } from "./useAutocomplete";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useAutocomplete"],"sources":["index.ts"],"sourcesContent":["export { useAutocomplete } from \"./useAutocomplete\";\n"],"mappings":"AAAA,SAASA,eAAe","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- import type { DocumentNode } from "graphql";
2
- interface UseAutocompleteHook {
3
- options: any[];
4
- onInput(value: string): void;
5
- }
6
- interface Props {
7
- query: DocumentNode;
8
- search?: string | ((value: string) => string);
9
- }
10
- export declare const useAutocomplete: (props: Props) => UseAutocompleteHook;
11
- export {};
@@ -1,23 +0,0 @@
1
- import { useDataList } from "../useDataList";
2
- import debounce from "lodash/debounce";
3
- export const useAutocomplete = props => {
4
- const dataList = useDataList({
5
- useRouter: false,
6
- ...props
7
- });
8
- return {
9
- options: dataList.data || [],
10
- onInput: debounce(query => {
11
- if (!query) {
12
- return;
13
- }
14
- let search = props.search || query;
15
- if (typeof search === "function") {
16
- search = search(query);
17
- }
18
- dataList.setSearch(search);
19
- }, 250)
20
- };
21
- };
22
-
23
- //# sourceMappingURL=useAutocomplete.js.map