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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. package/App.d.ts +14 -18
  2. package/App.js +79 -102
  3. package/App.js.map +1 -1
  4. package/AppContainer.d.ts +23 -0
  5. package/AppContainer.js +6 -0
  6. package/AppContainer.js.map +1 -0
  7. package/README.md +7 -15
  8. package/apollo-client/InMemoryCache.d.ts +3 -2
  9. package/apollo-client/InMemoryCache.js +17 -55
  10. package/apollo-client/InMemoryCache.js.map +1 -1
  11. package/apollo-client/IntrospectionFragmentMatcher.d.ts +11 -0
  12. package/apollo-client/IntrospectionFragmentMatcher.js +33 -0
  13. package/apollo-client/IntrospectionFragmentMatcher.js.map +1 -0
  14. package/components/Image.d.ts +2 -3
  15. package/components/Image.js +16 -29
  16. package/components/Image.js.map +1 -1
  17. package/components/index.d.ts +1 -2
  18. package/components/index.js +1 -19
  19. package/config/RouterConfig/Route.d.ts +29 -0
  20. package/config/RouterConfig/Route.js +28 -0
  21. package/config/RouterConfig/Route.js.map +1 -0
  22. package/config/RouterConfig.d.ts +31 -0
  23. package/config/RouterConfig.js +19 -0
  24. package/config/RouterConfig.js.map +1 -0
  25. package/config.d.ts +1 -1
  26. package/config.js +21 -27
  27. package/config.js.map +1 -1
  28. package/contexts/Ui/index.d.ts +4 -4
  29. package/contexts/Ui/index.js +28 -57
  30. package/contexts/Ui/index.js.map +1 -1
  31. package/core/Plugin.d.ts +3 -3
  32. package/core/Plugin.js +11 -20
  33. package/core/Plugin.js.map +1 -1
  34. package/core/Plugins.d.ts +6 -3
  35. package/core/Plugins.js +19 -43
  36. package/core/Plugins.js.map +1 -1
  37. package/core/Provider.d.ts +3 -4
  38. package/core/Provider.js +9 -20
  39. package/core/Provider.js.map +1 -1
  40. package/core/createProvider.d.ts +7 -3
  41. package/core/createProvider.js +5 -12
  42. package/core/createProvider.js.map +1 -1
  43. package/core/createProviderPlugin.d.ts +2 -2
  44. package/core/createProviderPlugin.js +11 -20
  45. package/core/createProviderPlugin.js.map +1 -1
  46. package/errors/AuthenticationErrorEvent.d.ts +9 -0
  47. package/errors/AuthenticationErrorEvent.js +13 -0
  48. package/errors/AuthenticationErrorEvent.js.map +1 -0
  49. package/errors/NetworkErrorEvent.d.ts +15 -0
  50. package/errors/NetworkErrorEvent.js +13 -0
  51. package/errors/NetworkErrorEvent.js.map +1 -0
  52. package/errors/abstractions.d.ts +12 -0
  53. package/errors/abstractions.js +6 -0
  54. package/errors/abstractions.js.map +1 -0
  55. package/errors/index.d.ts +6 -0
  56. package/errors/index.js +3 -0
  57. package/exports/admin/env-config.d.ts +2 -0
  58. package/exports/admin/env-config.js +2 -0
  59. package/exports/admin/graphql-client.d.ts +1 -0
  60. package/exports/admin/graphql-client.js +1 -0
  61. package/exports/admin/local-storage.d.ts +2 -0
  62. package/exports/admin/local-storage.js +2 -0
  63. package/exports/admin/router.d.ts +5 -0
  64. package/exports/admin/router.js +5 -0
  65. package/exports/admin/security.d.ts +1 -0
  66. package/exports/admin/security.js +1 -0
  67. package/exports/admin.d.ts +7 -0
  68. package/exports/admin.js +7 -0
  69. package/features/envConfig/EnvConfig.d.ts +7 -0
  70. package/features/envConfig/EnvConfig.js +16 -0
  71. package/features/envConfig/EnvConfig.js.map +1 -0
  72. package/features/envConfig/abstractions.d.ts +28 -0
  73. package/features/envConfig/abstractions.js +5 -0
  74. package/features/envConfig/abstractions.js.map +1 -0
  75. package/features/envConfig/feature.d.ts +17 -0
  76. package/features/envConfig/feature.js +15 -0
  77. package/features/envConfig/feature.js.map +1 -0
  78. package/features/envConfig/index.d.ts +1 -0
  79. package/features/envConfig/index.js +1 -0
  80. package/features/eventPublisher/EventPublisher.d.ts +8 -0
  81. package/features/eventPublisher/EventPublisher.js +19 -0
  82. package/features/eventPublisher/EventPublisher.js.map +1 -0
  83. package/features/eventPublisher/abstractions.d.ts +18 -0
  84. package/features/eventPublisher/abstractions.js +12 -0
  85. package/features/eventPublisher/abstractions.js.map +1 -0
  86. package/features/eventPublisher/feature.d.ts +3 -0
  87. package/features/eventPublisher/feature.js +17 -0
  88. package/features/eventPublisher/feature.js.map +1 -0
  89. package/features/eventPublisher/index.d.ts +3 -0
  90. package/features/eventPublisher/index.js +2 -0
  91. package/features/graphqlClient/AuthenticationErrorPublishing.d.ts +13 -0
  92. package/features/graphqlClient/AuthenticationErrorPublishing.js +35 -0
  93. package/features/graphqlClient/AuthenticationErrorPublishing.js.map +1 -0
  94. package/features/graphqlClient/BatchingGraphQLClient.d.ts +16 -0
  95. package/features/graphqlClient/BatchingGraphQLClient.js +118 -0
  96. package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -0
  97. package/features/graphqlClient/FetchGraphQLClient.d.ts +7 -0
  98. package/features/graphqlClient/FetchGraphQLClient.js +51 -0
  99. package/features/graphqlClient/FetchGraphQLClient.js.map +1 -0
  100. package/features/graphqlClient/NetworkErrorPublishing.d.ts +14 -0
  101. package/features/graphqlClient/NetworkErrorPublishing.js +48 -0
  102. package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -0
  103. package/features/graphqlClient/RequestValue.d.ts +21 -0
  104. package/features/graphqlClient/RequestValue.js +46 -0
  105. package/features/graphqlClient/RequestValue.js.map +1 -0
  106. package/features/graphqlClient/RetryGraphQLClient.d.ts +18 -0
  107. package/features/graphqlClient/RetryGraphQLClient.js +45 -0
  108. package/features/graphqlClient/RetryGraphQLClient.js.map +1 -0
  109. package/features/graphqlClient/__tests__/GraphQLClient.test.d.ts +1 -0
  110. package/features/graphqlClient/__tests__/GraphQLClient.test.js +397 -0
  111. package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -0
  112. package/features/graphqlClient/abstractions.d.ts +18 -0
  113. package/features/graphqlClient/abstractions.js +5 -0
  114. package/features/graphqlClient/abstractions.js.map +1 -0
  115. package/features/graphqlClient/feature.d.ts +6 -0
  116. package/features/graphqlClient/feature.js +25 -0
  117. package/features/graphqlClient/feature.js.map +1 -0
  118. package/features/graphqlClient/index.d.ts +1 -0
  119. package/features/graphqlClient/index.js +1 -0
  120. package/features/graphqlClient/types.d.ts +5 -0
  121. package/features/graphqlClient/types.js +0 -0
  122. package/features/localStorage/BrowserLocalStorageGateway.d.ts +9 -0
  123. package/features/localStorage/BrowserLocalStorageGateway.js +61 -0
  124. package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -0
  125. package/features/localStorage/LocalStorage.d.ts +12 -0
  126. package/features/localStorage/LocalStorage.js +34 -0
  127. package/features/localStorage/LocalStorage.js.map +1 -0
  128. package/features/localStorage/LocalStorageRepository.d.ts +20 -0
  129. package/features/localStorage/LocalStorageRepository.js +82 -0
  130. package/features/localStorage/LocalStorageRepository.js.map +1 -0
  131. package/features/localStorage/abstractions.d.ts +48 -0
  132. package/features/localStorage/abstractions.js +8 -0
  133. package/features/localStorage/abstractions.js.map +1 -0
  134. package/features/localStorage/feature.d.ts +12 -0
  135. package/features/localStorage/feature.js +23 -0
  136. package/features/localStorage/feature.js.map +1 -0
  137. package/features/localStorage/index.d.ts +1 -0
  138. package/features/localStorage/index.js +1 -0
  139. package/features/mainGraphQLClient/MainGraphQLClient.d.ts +11 -0
  140. package/features/mainGraphQLClient/MainGraphQLClient.js +27 -0
  141. package/features/mainGraphQLClient/MainGraphQLClient.js.map +1 -0
  142. package/features/mainGraphQLClient/abstractions.d.ts +17 -0
  143. package/features/mainGraphQLClient/abstractions.js +5 -0
  144. package/features/mainGraphQLClient/abstractions.js.map +1 -0
  145. package/features/mainGraphQLClient/feature.d.ts +3 -0
  146. package/features/mainGraphQLClient/feature.js +17 -0
  147. package/features/mainGraphQLClient/feature.js.map +1 -0
  148. package/features/mainGraphQLClient/index.d.ts +1 -0
  149. package/features/mainGraphQLClient/index.js +1 -0
  150. package/features/router/HistoryRouterGateway.d.ts +22 -0
  151. package/features/router/HistoryRouterGateway.js +88 -0
  152. package/features/router/HistoryRouterGateway.js.map +1 -0
  153. package/features/router/HistoryRouterGateway.test.d.ts +1 -0
  154. package/features/router/HistoryRouterGateway.test.js +195 -0
  155. package/features/router/HistoryRouterGateway.test.js.map +1 -0
  156. package/features/router/Route.d.ts +19 -0
  157. package/features/router/Route.js +43 -0
  158. package/features/router/Route.js.map +1 -0
  159. package/features/router/RouteUrl.d.ts +85 -0
  160. package/features/router/RouteUrl.js +99 -0
  161. package/features/router/RouteUrl.js.map +1 -0
  162. package/features/router/Router.d.ts +45 -0
  163. package/features/router/Router.js +72 -0
  164. package/features/router/Router.js.map +1 -0
  165. package/features/router/RouterPresenter.d.ts +21 -0
  166. package/features/router/RouterPresenter.js +52 -0
  167. package/features/router/RouterPresenter.js.map +1 -0
  168. package/features/router/RouterRepository.d.ts +30 -0
  169. package/features/router/RouterRepository.js +117 -0
  170. package/features/router/RouterRepository.js.map +1 -0
  171. package/features/router/RouterRepository.test.d.ts +1 -0
  172. package/features/router/RouterRepository.test.js +138 -0
  173. package/features/router/RouterRepository.test.js.map +1 -0
  174. package/features/router/abstractions.d.ts +81 -0
  175. package/features/router/abstractions.js +7 -0
  176. package/features/router/abstractions.js.map +1 -0
  177. package/features/router/feature.d.ts +4 -0
  178. package/features/router/feature.js +19 -0
  179. package/features/router/feature.js.map +1 -0
  180. package/features/router/index.d.ts +2 -0
  181. package/features/router/index.js +1 -0
  182. package/helpers/InterfaceGenerator/date.d.ts +15 -0
  183. package/helpers/InterfaceGenerator/date.js +0 -0
  184. package/helpers/InterfaceGenerator/id.d.ts +23 -0
  185. package/helpers/InterfaceGenerator/id.js +0 -0
  186. package/helpers/InterfaceGenerator/identity.d.ts +10 -0
  187. package/helpers/InterfaceGenerator/identity.js +0 -0
  188. package/helpers/InterfaceGenerator/index.d.ts +5 -0
  189. package/helpers/InterfaceGenerator/index.js +0 -0
  190. package/helpers/InterfaceGenerator/numeric.d.ts +12 -0
  191. package/helpers/InterfaceGenerator/numeric.js +0 -0
  192. package/helpers/InterfaceGenerator/truthful.d.ts +7 -0
  193. package/helpers/InterfaceGenerator/truthful.js +0 -0
  194. package/hooks/useAutocomplete/index.d.ts +1 -1
  195. package/hooks/useAutocomplete/index.js +1 -12
  196. package/hooks/useAutocomplete/useAutocomplete.d.ts +1 -1
  197. package/hooks/useAutocomplete/useAutocomplete.js +16 -28
  198. package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
  199. package/hooks/useDataList/functions/getData.js +4 -11
  200. package/hooks/useDataList/functions/getData.js.map +1 -1
  201. package/hooks/useDataList/functions/getError.js +4 -11
  202. package/hooks/useDataList/functions/getError.js.map +1 -1
  203. package/hooks/useDataList/functions/getMeta.js +4 -11
  204. package/hooks/useDataList/functions/getMeta.js.map +1 -1
  205. package/hooks/useDataList/functions/index.d.ts +3 -3
  206. package/hooks/useDataList/functions/index.js +3 -27
  207. package/hooks/useDataList/functions/searchDataByKey.js +11 -21
  208. package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
  209. package/hooks/useDataList/index.d.ts +1 -1
  210. package/hooks/useDataList/index.js +1 -12
  211. package/hooks/useDataList/useDataList.d.ts +2 -3
  212. package/hooks/useDataList/useDataList.js +140 -180
  213. package/hooks/useDataList/useDataList.js.map +1 -1
  214. package/hooks/useDataList/utils/index.d.ts +1 -2
  215. package/hooks/useDataList/utils/index.js +1 -20
  216. package/hooks/useDataList/utils/prepareLoadListParams.d.ts +1 -2
  217. package/hooks/useDataList/utils/prepareLoadListParams.js +27 -36
  218. package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
  219. package/hooks/useHandler.js +14 -17
  220. package/hooks/useHandler.js.map +1 -1
  221. package/hooks/useHandlers.d.ts +3 -3
  222. package/hooks/useHandlers.js +20 -26
  223. package/hooks/useHandlers.js.map +1 -1
  224. package/hooks/useRegisterLegacyPlugin.d.ts +2 -0
  225. package/hooks/useRegisterLegacyPlugin.js +12 -0
  226. package/hooks/useRegisterLegacyPlugin.js.map +1 -0
  227. package/hooks/useUi.d.ts +1 -1
  228. package/hooks/useUi.js +5 -11
  229. package/hooks/useUi.js.map +1 -1
  230. package/i18n/i18n.js +10 -13
  231. package/i18n/i18n.js.map +1 -1
  232. package/i18n/index.d.ts +1 -1
  233. package/i18n/index.js +1 -13
  234. package/index.d.ts +23 -13
  235. package/index.js +23 -147
  236. package/package.json +38 -41
  237. package/plugins/AddQuerySelectionPlugin.d.ts +2 -2
  238. package/plugins/AddQuerySelectionPlugin.js +41 -116
  239. package/plugins/AddQuerySelectionPlugin.js.map +1 -1
  240. package/plugins/ApolloCacheObjectIdPlugin.js +16 -37
  241. package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
  242. package/plugins/ApolloDynamicLink.d.ts +3 -2
  243. package/plugins/ApolloDynamicLink.js +25 -56
  244. package/plugins/ApolloDynamicLink.js.map +1 -1
  245. package/plugins/ApolloLinkPlugin.d.ts +1 -1
  246. package/plugins/ApolloLinkPlugin.js +22 -45
  247. package/plugins/ApolloLinkPlugin.js.map +1 -1
  248. package/plugins/ConsoleLinkPlugin.d.ts +1 -1
  249. package/plugins/ConsoleLinkPlugin.js +21 -45
  250. package/plugins/ConsoleLinkPlugin.js.map +1 -1
  251. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +8 -13
  252. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +48 -76
  253. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
  254. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.d.ts +14 -0
  255. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js +27 -0
  256. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js.map +1 -0
  257. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.d.ts +2 -0
  258. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js +23 -0
  259. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js.map +1 -0
  260. package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +4 -7
  261. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +68 -17
  262. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
  263. package/plugins/NetworkErrorLinkPlugin/Typography.d.ts +8 -0
  264. package/plugins/NetworkErrorLinkPlugin/Typography.js +13 -0
  265. package/plugins/NetworkErrorLinkPlugin/Typography.js.map +1 -0
  266. package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js +19 -0
  267. package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js.map +1 -0
  268. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +3 -3
  269. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +14 -30
  270. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
  271. package/plugins/NetworkErrorLinkPlugin.d.ts +4 -1
  272. package/plugins/NetworkErrorLinkPlugin.js +52 -47
  273. package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
  274. package/plugins/OmitTypenameLinkPlugin.d.ts +1 -1
  275. package/plugins/OmitTypenameLinkPlugin.js +13 -38
  276. package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
  277. package/plugins/TenantHeaderLinkPlugin.d.ts +3 -3
  278. package/plugins/TenantHeaderLinkPlugin.js +27 -59
  279. package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
  280. package/plugins/components/Image.d.ts +6 -0
  281. package/plugins/components/Image.js +12 -0
  282. package/plugins/components/Image.js.map +1 -0
  283. package/plugins/image.d.ts +1 -1
  284. package/plugins/image.js +97 -142
  285. package/plugins/image.js.map +1 -1
  286. package/plugins/index.d.ts +5 -5
  287. package/plugins/index.js +39 -86
  288. package/plugins/index.js.map +1 -1
  289. package/presentation/envConfig/useEnvConfig.d.ts +6 -0
  290. package/presentation/envConfig/useEnvConfig.js +9 -0
  291. package/presentation/envConfig/useEnvConfig.js.map +1 -0
  292. package/presentation/localStorage/index.d.ts +3 -0
  293. package/presentation/localStorage/index.js +3 -0
  294. package/presentation/localStorage/useLocalStorage.d.ts +6 -0
  295. package/presentation/localStorage/useLocalStorage.js +15 -0
  296. package/presentation/localStorage/useLocalStorage.js.map +1 -0
  297. package/presentation/localStorage/useLocalStorageValue.d.ts +1 -0
  298. package/presentation/localStorage/useLocalStorageValue.js +22 -0
  299. package/presentation/localStorage/useLocalStorageValue.js.map +1 -0
  300. package/presentation/localStorage/useLocalStorageValues.d.ts +5 -0
  301. package/presentation/localStorage/useLocalStorageValues.js +32 -0
  302. package/presentation/localStorage/useLocalStorageValues.js.map +1 -0
  303. package/presentation/router/RouteElementRegistry.d.ts +14 -0
  304. package/presentation/router/RouteElementRegistry.js +29 -0
  305. package/presentation/router/RouteElementRegistry.js.map +1 -0
  306. package/presentation/router/abstractions.d.ts +13 -0
  307. package/presentation/router/abstractions.js +5 -0
  308. package/presentation/router/abstractions.js.map +1 -0
  309. package/presentation/router/components/Redirect.d.ts +14 -0
  310. package/presentation/router/components/Redirect.js +13 -0
  311. package/presentation/router/components/Redirect.js.map +1 -0
  312. package/presentation/router/components/RouteContent.d.ts +2 -0
  313. package/presentation/router/components/RouteContent.js +20 -0
  314. package/presentation/router/components/RouteContent.js.map +1 -0
  315. package/presentation/router/components/RouteLink.d.ts +50 -0
  316. package/presentation/router/components/RouteLink.js +17 -0
  317. package/presentation/router/components/RouteLink.js.map +1 -0
  318. package/presentation/router/components/SimpleLink.d.ts +44 -0
  319. package/presentation/router/components/SimpleLink.js +24 -0
  320. package/presentation/router/components/SimpleLink.js.map +1 -0
  321. package/presentation/router/hooks/useRoute.d.ts +6 -0
  322. package/presentation/router/hooks/useRoute.js +22 -0
  323. package/presentation/router/hooks/useRoute.js.map +1 -0
  324. package/presentation/router/hooks/useRouter.d.ts +11 -0
  325. package/presentation/router/hooks/useRouter.js +29 -0
  326. package/presentation/router/hooks/useRouter.js.map +1 -0
  327. package/presentation/router/index.d.ts +4 -0
  328. package/presentation/router/index.js +3 -0
  329. package/presentation/router/types.d.ts +5 -0
  330. package/presentation/router/types.js +0 -0
  331. package/renderApp.d.ts +2 -0
  332. package/renderApp.js +10 -0
  333. package/renderApp.js.map +1 -0
  334. package/router.d.ts +5 -0
  335. package/router.js +5 -0
  336. package/rslib-runtime.js +14 -0
  337. package/rslib-runtime.js.map +1 -0
  338. package/shared/di/DiContainerProvider.d.ts +8 -0
  339. package/shared/di/DiContainerProvider.js +13 -0
  340. package/shared/di/DiContainerProvider.js.map +1 -0
  341. package/shared/di/createFeature.d.ts +11 -0
  342. package/shared/di/createFeature.js +10 -0
  343. package/shared/di/createFeature.js.map +1 -0
  344. package/shared/di/useFeature.d.ts +2 -0
  345. package/shared/di/useFeature.js +12 -0
  346. package/shared/di/useFeature.js.map +1 -0
  347. package/static/svg/close_24px.33adaadc.svg +1 -0
  348. package/types.d.ts +16 -28
  349. package/types.js +0 -12
  350. package/utils/createGenericContext.d.ts +13 -0
  351. package/utils/createGenericContext.js +21 -0
  352. package/utils/createGenericContext.js.map +1 -0
  353. package/utils/createHashing.d.ts +2 -0
  354. package/utils/createHashing.js +15 -0
  355. package/utils/createHashing.js.map +1 -0
  356. package/utils/index.d.ts +2 -8
  357. package/utils/index.js +2 -93
  358. package/utils/legacyPluginToReactComponent.d.ts +7 -0
  359. package/utils/legacyPluginToReactComponent.js +15 -0
  360. package/utils/legacyPluginToReactComponent.js.map +1 -0
  361. package/components/Routes.d.ts +0 -2
  362. package/components/Routes.js +0 -45
  363. package/components/Routes.js.map +0 -1
  364. package/components/View.d.ts +0 -8
  365. package/components/View.js +0 -30
  366. package/components/View.js.map +0 -1
  367. package/components/index.js.map +0 -1
  368. package/core/AddRoute.d.ts +0 -3
  369. package/core/AddRoute.js +0 -19
  370. package/core/AddRoute.js.map +0 -1
  371. package/core/DebounceRender.d.ts +0 -11
  372. package/core/DebounceRender.js +0 -41
  373. package/core/DebounceRender.js.map +0 -1
  374. package/core/Routes.d.ts +0 -6
  375. package/core/Routes.js +0 -42
  376. package/core/Routes.js.map +0 -1
  377. package/hooks/useAutocomplete/index.js.map +0 -1
  378. package/hooks/useDataList/functions/index.js.map +0 -1
  379. package/hooks/useDataList/index.js.map +0 -1
  380. package/hooks/useDataList/utils/index.js.map +0 -1
  381. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +0 -14
  382. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +0 -29
  383. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +0 -1
  384. package/hooks/useDataList/utils/types.d.ts +0 -34
  385. package/hooks/useDataList/utils/types.js +0 -5
  386. package/hooks/useDataList/utils/types.js.map +0 -1
  387. package/i18n/index.js.map +0 -1
  388. package/index.js.map +0 -1
  389. package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -10
  390. package/plugins/LocaleHeaderLinkPlugin.js +0 -53
  391. package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
  392. package/plugins/RoutePlugin.d.ts +0 -12
  393. package/plugins/RoutePlugin.js +0 -38
  394. package/plugins/RoutePlugin.js.map +0 -1
  395. package/plugins/ViewPlugin.d.ts +0 -14
  396. package/plugins/ViewPlugin.js +0 -43
  397. package/plugins/ViewPlugin.js.map +0 -1
  398. package/types.js.map +0 -1
  399. package/utils/getApiUrl.d.ts +0 -1
  400. package/utils/getApiUrl.js +0 -11
  401. package/utils/getApiUrl.js.map +0 -1
  402. package/utils/getGqlApiUrl.d.ts +0 -1
  403. package/utils/getGqlApiUrl.js +0 -11
  404. package/utils/getGqlApiUrl.js.map +0 -1
  405. package/utils/getHeadlessCmsGqlApiUrl.d.ts +0 -5
  406. package/utils/getHeadlessCmsGqlApiUrl.js +0 -17
  407. package/utils/getHeadlessCmsGqlApiUrl.js.map +0 -1
  408. package/utils/getLocaleCode.d.ts +0 -6
  409. package/utils/getLocaleCode.js +0 -42
  410. package/utils/getLocaleCode.js.map +0 -1
  411. package/utils/getPrerenderId.d.ts +0 -6
  412. package/utils/getPrerenderId.js +0 -10
  413. package/utils/getPrerenderId.js.map +0 -1
  414. package/utils/getTenantId.d.ts +0 -6
  415. package/utils/getTenantId.js +0 -34
  416. package/utils/getTenantId.js.map +0 -1
  417. package/utils/index.js.map +0 -1
  418. package/utils/isLocalhost.d.ts +0 -1
  419. package/utils/isLocalhost.js +0 -14
  420. package/utils/isLocalhost.js.map +0 -1
  421. package/utils/isPrerendering.d.ts +0 -1
  422. package/utils/isPrerendering.js +0 -10
  423. package/utils/isPrerendering.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["createErrorOverlay","params","query","networkError","document","getElementById","container","createElement","id","body","getElementsByTagName","appendChild","render"],"sources":["createErrorOverlay.tsx"],"sourcesContent":["import React from \"react\";\nimport { render } from \"react-dom\";\nimport ErrorOverlay from \"./ErrorOverlay\";\nimport { ServerError, ServerParseError } from \"apollo-link-http-common\";\n\ninterface CreateErrorOverlayParams {\n query: string;\n networkError: Error | ServerError | ServerParseError;\n}\nconst createErrorOverlay = (params: CreateErrorOverlayParams): void => {\n const { query, networkError } = params;\n // If the element already present in DOM, return immediately.\n if (document.getElementById(\"overlay-root\")) {\n return;\n }\n // Create root element to hold React tree.\n const container: HTMLDivElement = document.createElement(\"div\");\n container.id = \"overlay-root\";\n // Insert root element into body.\n const body: HTMLBodyElement = document.getElementsByTagName(\"body\")[0];\n body.appendChild(container);\n // Mount the ErrorOverlay component into root element.\n render(<ErrorOverlay query={query} networkError={networkError} />, container);\n};\n\nexport default createErrorOverlay;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAOA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkB,CAAIC,MAAgC,EAAW;EACnE,IAAQC,KAAK,GAAmBD,MAAM,CAA9BC,KAAK;IAAEC,YAAY,GAAKF,MAAM,CAAvBE,YAAY;EAC3B;EACA,IAAIC,QAAQ,CAACC,cAAc,CAAC,cAAc,CAAC,EAAE;IACzC;EACJ;EACA;EACA,IAAMC,SAAyB,GAAGF,QAAQ,CAACG,aAAa,CAAC,KAAK,CAAC;EAC/DD,SAAS,CAACE,EAAE,GAAG,cAAc;EAC7B;EACA,IAAMC,IAAqB,GAAGL,QAAQ,CAACM,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;EACtED,IAAI,CAACE,WAAW,CAACL,SAAS,CAAC;EAC3B;EACA,IAAAM,gBAAM,gBAAC,6BAAC,qBAAY;IAAC,KAAK,EAAEV,KAAM;IAAC,YAAY,EAAEC;EAAa,EAAG,EAAEG,SAAS,CAAC;AACjF,CAAC;AAAC,eAEaN,kBAAkB;AAAA"}
1
+ {"version":3,"file":"plugins/NetworkErrorLinkPlugin/createErrorOverlay.js","sources":["../../../src/plugins/NetworkErrorLinkPlugin/createErrorOverlay.tsx"],"sourcesContent":["import type React from \"react\";\nimport { createRoot } from \"react-dom/client\";\n\ninterface CreateErrorOverlayParams {\n element: React.ReactElement;\n closeable?: boolean;\n}\n\nconst createErrorOverlay = (params: CreateErrorOverlayParams): void => {\n const { element } = params;\n // If the element already present in DOM, return immediately.\n if (document.getElementById(\"overlay-root\")) {\n return;\n }\n // Create root element to hold React tree.\n const container: HTMLDivElement = document.createElement(\"div\");\n container.id = \"overlay-root\";\n // Insert root element into body.\n const body: HTMLBodyElement = document.getElementsByTagName(\"body\")[0];\n body.appendChild(container);\n // Mount the ErrorOverlay component into root element.\n const root = createRoot(container);\n root.render(element);\n};\n\nexport default createErrorOverlay;\n"],"names":["createErrorOverlay","params","element","document","container","body","root","createRoot"],"mappings":";AAQA,MAAMA,qBAAqB,CAACC;IACxB,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAEpB,IAAIE,SAAS,cAAc,CAAC,iBACxB;IAGJ,MAAMC,YAA4BD,SAAS,aAAa,CAAC;IACzDC,UAAU,EAAE,GAAG;IAEf,MAAMC,OAAwBF,SAAS,oBAAoB,CAAC,OAAO,CAAC,EAAE;IACtEE,KAAK,WAAW,CAACD;IAEjB,MAAME,OAAOC,WAAWH;IACxBE,KAAK,MAAM,CAACJ;AAChB;AAEA,kDAAeF"}
@@ -1,7 +1,10 @@
1
- import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
1
+ import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
2
+ import type { EventPublisher } from "../features/eventPublisher/index.js";
2
3
  /**
3
4
  * This plugin creates an ApolloLink that checks for `NetworkError` and shows an ErrorOverlay in the browser.
4
5
  */
5
6
  export declare class NetworkErrorLinkPlugin extends ApolloLinkPlugin {
7
+ private getEventPublisher;
8
+ constructor(getEventPublisher: () => EventPublisher.Interface);
6
9
  createLink(): import("apollo-link").ApolloLink;
7
10
  }
@@ -1,48 +1,53 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.NetworkErrorLinkPlugin = void 0;
8
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
11
- var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
12
- var _ApolloLinkPlugin2 = require("./ApolloLinkPlugin");
13
- var _apolloLinkError = require("apollo-link-error");
14
- var _language = require("graphql/language");
15
- var _createErrorOverlay = _interopRequireDefault(require("./NetworkErrorLinkPlugin/createErrorOverlay"));
16
- var _boolean = require("boolean");
17
- var _config = require("../config");
18
- /**
19
- * This plugin creates an ApolloLink that checks for `NetworkError` and shows an ErrorOverlay in the browser.
20
- */
21
- var NetworkErrorLinkPlugin = /*#__PURE__*/function (_ApolloLinkPlugin) {
22
- (0, _inherits2.default)(NetworkErrorLinkPlugin, _ApolloLinkPlugin);
23
- var _super = (0, _createSuper2.default)(NetworkErrorLinkPlugin);
24
- function NetworkErrorLinkPlugin() {
25
- (0, _classCallCheck2.default)(this, NetworkErrorLinkPlugin);
26
- return _super.apply(this, arguments);
27
- }
28
- (0, _createClass2.default)(NetworkErrorLinkPlugin, [{
29
- key: "createLink",
30
- value: function createLink() {
31
- return (0, _apolloLinkError.onError)(function (_ref) {
32
- var networkError = _ref.networkError,
33
- operation = _ref.operation;
34
- var debug = _config.config.getKey("DEBUG", (0, _boolean.boolean)(process.env.REACT_APP_DEBUG));
35
- if (networkError && debug) {
36
- (0, _createErrorOverlay.default)({
37
- query: (0, _language.print)(operation.query),
38
- networkError: networkError
39
- });
40
- }
41
-
42
- // TODO: also print graphQLErrors
43
- });
1
+ import react from "react";
2
+ import { onError } from "apollo-link-error";
3
+ import { print } from "graphql/language/index.js";
4
+ import { toBoolean } from "@webiny/stdlib";
5
+ import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
6
+ import createErrorOverlay from "./NetworkErrorLinkPlugin/createErrorOverlay.js";
7
+ import { LocalAwsLambdaTimeoutMessage } from "./NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js";
8
+ import { config } from "../config.js";
9
+ import { ErrorOverlay } from "./NetworkErrorLinkPlugin/ErrorOverlay.js";
10
+ import { GqlErrorOverlay } from "./NetworkErrorLinkPlugin/GqlErrorOverlay.js";
11
+ import { NetworkErrorEvent } from "../errors/index.js";
12
+ const isLocalAwsLambdaFnInvocationTimeoutError = (error)=>error.result && "LOCAL_AWS_LAMBDA_TIMEOUT" === error.result.code;
13
+ class NetworkErrorLinkPlugin extends ApolloLinkPlugin {
14
+ constructor(getEventPublisher){
15
+ super(), this.getEventPublisher = getEventPublisher;
44
16
  }
45
- }]);
46
- return NetworkErrorLinkPlugin;
47
- }(_ApolloLinkPlugin2.ApolloLinkPlugin);
48
- exports.NetworkErrorLinkPlugin = NetworkErrorLinkPlugin;
17
+ createLink() {
18
+ return onError(({ networkError, operation })=>{
19
+ const debug = config.getKey("DEBUG", toBoolean(process.env.REACT_APP_DEBUG));
20
+ if (networkError) {
21
+ const errorType = isLocalAwsLambdaFnInvocationTimeoutError(networkError) ? "timeout" : "network";
22
+ const event = new NetworkErrorEvent({
23
+ message: networkError.message,
24
+ operationName: operation.operationName,
25
+ query: print(operation.query),
26
+ variables: operation.variables,
27
+ errorType,
28
+ statusCode: networkError.statusCode,
29
+ result: networkError.result
30
+ });
31
+ this.getEventPublisher().publish(event);
32
+ if (debug) {
33
+ if (isLocalAwsLambdaFnInvocationTimeoutError(networkError)) return void createErrorOverlay({
34
+ element: /*#__PURE__*/ react.createElement(ErrorOverlay, {
35
+ message: /*#__PURE__*/ react.createElement(LocalAwsLambdaTimeoutMessage, null),
36
+ closeable: false
37
+ }),
38
+ closeable: false
39
+ });
40
+ createErrorOverlay({
41
+ element: /*#__PURE__*/ react.createElement(GqlErrorOverlay, {
42
+ query: print(operation.query),
43
+ networkError: networkError
44
+ })
45
+ });
46
+ }
47
+ }
48
+ });
49
+ }
50
+ }
51
+ export { NetworkErrorLinkPlugin };
52
+
53
+ //# sourceMappingURL=NetworkErrorLinkPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NetworkErrorLinkPlugin","onError","networkError","operation","debug","appConfig","getKey","boolean","process","env","REACT_APP_DEBUG","createErrorOverlay","query","print","ApolloLinkPlugin"],"sources":["NetworkErrorLinkPlugin.ts"],"sourcesContent":["import { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { onError } from \"apollo-link-error\";\nimport { print } from \"graphql/language\";\nimport createErrorOverlay from \"./NetworkErrorLinkPlugin/createErrorOverlay\";\nimport { boolean } from \"boolean\";\nimport { config as appConfig } from \"~/config\";\n\n/**\n * This plugin creates an ApolloLink that checks for `NetworkError` and shows an ErrorOverlay in the browser.\n */\nexport class NetworkErrorLinkPlugin extends ApolloLinkPlugin {\n public override createLink() {\n return onError(({ networkError, operation }) => {\n const debug = appConfig.getKey(\"DEBUG\", boolean(process.env.REACT_APP_DEBUG));\n\n if (networkError && debug) {\n createErrorOverlay({ query: print(operation.query), networkError });\n }\n\n // TODO: also print graphQLErrors\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAFA,IAGaA,sBAAsB;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA,OAC/B,sBAA6B;MACzB,OAAO,IAAAC,wBAAO,EAAC,gBAAiC;QAAA,IAA9BC,YAAY,QAAZA,YAAY;UAAEC,SAAS,QAATA,SAAS;QACrC,IAAMC,KAAK,GAAGC,cAAS,CAACC,MAAM,CAAC,OAAO,EAAE,IAAAC,gBAAO,EAACC,OAAO,CAACC,GAAG,CAACC,eAAe,CAAC,CAAC;QAE7E,IAAIR,YAAY,IAAIE,KAAK,EAAE;UACvB,IAAAO,2BAAkB,EAAC;YAAEC,KAAK,EAAE,IAAAC,eAAK,EAACV,SAAS,CAACS,KAAK,CAAC;YAAEV,YAAY,EAAZA;UAAa,CAAC,CAAC;QACvE;;QAEA;MACJ,CAAC,CAAC;IACN;EAAC;EAAA;AAAA,EAXuCY,mCAAgB;AAAA"}
1
+ {"version":3,"file":"plugins/NetworkErrorLinkPlugin.js","sources":["../../src/plugins/NetworkErrorLinkPlugin.tsx"],"sourcesContent":["import React from \"react\";\nimport { onError } from \"apollo-link-error\";\nimport { type ServerError } from \"apollo-link-http-common\";\nimport { print } from \"graphql/language/index.js\";\nimport { toBoolean } from \"@webiny/stdlib\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin.js\";\nimport createErrorOverlay from \"./NetworkErrorLinkPlugin/createErrorOverlay.js\";\nimport { LocalAwsLambdaTimeoutMessage } from \"./NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js\";\nimport { config as appConfig } from \"~/config.js\";\nimport { ErrorOverlay } from \"~/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js\";\nimport { GqlErrorOverlay } from \"./NetworkErrorLinkPlugin/GqlErrorOverlay.js\";\nimport type { EventPublisher } from \"~/features/eventPublisher/index.js\";\nimport { NetworkErrorEvent } from \"~/errors/index.js\";\n\nconst isLocalAwsLambdaFnInvocationTimeoutError = (error: any): error is ServerError => {\n return error.result && error.result.code === \"LOCAL_AWS_LAMBDA_TIMEOUT\";\n};\n\n/**\n * This plugin creates an ApolloLink that checks for `NetworkError` and shows an ErrorOverlay in the browser.\n */\nexport class NetworkErrorLinkPlugin extends ApolloLinkPlugin {\n constructor(private getEventPublisher: () => EventPublisher.Interface) {\n super();\n }\n\n public override createLink() {\n return onError(({ networkError, operation }) => {\n const debug = appConfig.getKey(\"DEBUG\", toBoolean(process.env.REACT_APP_DEBUG));\n\n if (networkError) {\n // Publish network error event\n const errorType = isLocalAwsLambdaFnInvocationTimeoutError(networkError)\n ? \"timeout\"\n : \"network\";\n\n const event = new NetworkErrorEvent({\n message: networkError.message,\n operationName: operation.operationName,\n query: print(operation.query),\n variables: operation.variables,\n errorType,\n statusCode: (networkError as any).statusCode,\n result: (networkError as any).result\n });\n\n this.getEventPublisher().publish(event);\n\n // Keep existing overlay logic for now\n if (debug) {\n if (isLocalAwsLambdaFnInvocationTimeoutError(networkError)) {\n createErrorOverlay({\n element: (\n <ErrorOverlay\n message={<LocalAwsLambdaTimeoutMessage />}\n closeable={false}\n />\n ),\n closeable: false\n });\n return;\n }\n\n createErrorOverlay({\n element: (\n <GqlErrorOverlay\n query={print(operation.query)}\n networkError={networkError}\n />\n )\n });\n }\n }\n\n // TODO: also print graphQLErrors\n });\n }\n}\n"],"names":["isLocalAwsLambdaFnInvocationTimeoutError","error","NetworkErrorLinkPlugin","ApolloLinkPlugin","getEventPublisher","onError","networkError","operation","debug","appConfig","toBoolean","process","errorType","event","NetworkErrorEvent","print","createErrorOverlay","ErrorOverlay","LocalAwsLambdaTimeoutMessage","GqlErrorOverlay"],"mappings":";;;;;;;;;;;AAcA,MAAMA,2CAA2C,CAACC,QACvCA,MAAM,MAAM,IAAIA,AAAsB,+BAAtBA,MAAM,MAAM,CAAC,IAAI;AAMrC,MAAMC,+BAA+BC;IACxC,YAAoBC,iBAAiD,CAAE;QACnE,KAAK,SADWA,iBAAiB,GAAjBA;IAEpB;IAEgB,aAAa;QACzB,OAAOC,QAAQ,CAAC,EAAEC,YAAY,EAAEC,SAAS,EAAE;YACvC,MAAMC,QAAQC,OAAAA,MAAgB,CAAC,SAASC,UAAUC,QAAQ,GAAG,CAAC,eAAe;YAE7E,IAAIL,cAAc;gBAEd,MAAMM,YAAYZ,yCAAyCM,gBACrD,YACA;gBAEN,MAAMO,QAAQ,IAAIC,kBAAkB;oBAChC,SAASR,aAAa,OAAO;oBAC7B,eAAeC,UAAU,aAAa;oBACtC,OAAOQ,MAAMR,UAAU,KAAK;oBAC5B,WAAWA,UAAU,SAAS;oBAC9BK;oBACA,YAAaN,aAAqB,UAAU;oBAC5C,QAASA,aAAqB,MAAM;gBACxC;gBAEA,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAACO;gBAGjC,IAAIL,OAAO;oBACP,IAAIR,yCAAyCM,eAAe,YACxDU,mBAAmB;wBACf,SAAS,WAAT,GACI,oBAACC,cAAYA;4BACT,uBAAS,oBAACC,8BAA4BA;4BACtC,WAAW;;wBAGnB,WAAW;oBACf;oBAIJF,mBAAmB;wBACf,SAAS,WAAT,GACI,oBAACG,iBAAeA;4BACZ,OAAOJ,MAAMR,UAAU,KAAK;4BAC5B,cAAcD;;oBAG1B;gBACJ;YACJ;QAGJ;IACJ;AACJ"}
@@ -1,5 +1,5 @@
1
1
  import { ApolloLink } from "apollo-link";
2
- import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
2
+ import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
3
3
  /**
4
4
  * This link removes `__typename` from the variables being sent to the API.
5
5
  */
@@ -1,41 +1,16 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.OmitTypenameLinkPlugin = void 0;
8
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
11
- var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
12
- var _apolloLink = require("apollo-link");
13
- var _ApolloLinkPlugin2 = require("./ApolloLinkPlugin");
1
+ import { ApolloLink } from "apollo-link";
2
+ import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
14
3
  function omitTypename(key, value) {
15
- return key === "__typename" ? undefined : value;
4
+ return "__typename" === key ? void 0 : value;
16
5
  }
17
-
18
- /**
19
- * This link removes `__typename` from the variables being sent to the API.
20
- */
21
- var OmitTypenameLinkPlugin = /*#__PURE__*/function (_ApolloLinkPlugin) {
22
- (0, _inherits2.default)(OmitTypenameLinkPlugin, _ApolloLinkPlugin);
23
- var _super = (0, _createSuper2.default)(OmitTypenameLinkPlugin);
24
- function OmitTypenameLinkPlugin() {
25
- (0, _classCallCheck2.default)(this, OmitTypenameLinkPlugin);
26
- return _super.apply(this, arguments);
27
- }
28
- (0, _createClass2.default)(OmitTypenameLinkPlugin, [{
29
- key: "createLink",
30
- value: function createLink() {
31
- return new _apolloLink.ApolloLink(function (operation, forward) {
32
- if (operation.variables) {
33
- operation.variables = JSON.parse(JSON.stringify(operation.variables), omitTypename);
34
- }
35
- return forward(operation);
36
- });
6
+ class OmitTypenameLinkPlugin extends ApolloLinkPlugin {
7
+ createLink() {
8
+ return new ApolloLink((operation, forward)=>{
9
+ if (operation.variables) operation.variables = JSON.parse(JSON.stringify(operation.variables), omitTypename);
10
+ return forward(operation);
11
+ });
37
12
  }
38
- }]);
39
- return OmitTypenameLinkPlugin;
40
- }(_ApolloLinkPlugin2.ApolloLinkPlugin);
41
- exports.OmitTypenameLinkPlugin = OmitTypenameLinkPlugin;
13
+ }
14
+ export { OmitTypenameLinkPlugin };
15
+
16
+ //# sourceMappingURL=OmitTypenameLinkPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["omitTypename","key","value","undefined","OmitTypenameLinkPlugin","ApolloLink","operation","forward","variables","JSON","parse","stringify","ApolloLinkPlugin"],"sources":["OmitTypenameLinkPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\n\nfunction omitTypename(key: string, value: string): string | undefined {\n return key === \"__typename\" ? undefined : value;\n}\n\n/**\n * This link removes `__typename` from the variables being sent to the API.\n */\nexport class OmitTypenameLinkPlugin extends ApolloLinkPlugin {\n public override createLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (operation.variables) {\n operation.variables = JSON.parse(JSON.stringify(operation.variables), omitTypename);\n }\n return forward(operation);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AAEA,SAASA,YAAY,CAACC,GAAW,EAAEC,KAAa,EAAsB;EAClE,OAAOD,GAAG,KAAK,YAAY,GAAGE,SAAS,GAAGD,KAAK;AACnD;;AAEA;AACA;AACA;AAFA,IAGaE,sBAAsB;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA,OAC/B,sBAAyC;MACrC,OAAO,IAAIC,sBAAU,CAAC,UAACC,SAAS,EAAEC,OAAO,EAAK;QAC1C,IAAID,SAAS,CAACE,SAAS,EAAE;UACrBF,SAAS,CAACE,SAAS,GAAGC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,SAAS,CAACL,SAAS,CAACE,SAAS,CAAC,EAAER,YAAY,CAAC;QACvF;QACA,OAAOO,OAAO,CAACD,SAAS,CAAC;MAC7B,CAAC,CAAC;IACN;EAAC;EAAA;AAAA,EARuCM,mCAAgB;AAAA"}
1
+ {"version":3,"file":"plugins/OmitTypenameLinkPlugin.js","sources":["../../src/plugins/OmitTypenameLinkPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin.js\";\n\nfunction omitTypename(key: string, value: string): string | undefined {\n return key === \"__typename\" ? undefined : value;\n}\n\n/**\n * This link removes `__typename` from the variables being sent to the API.\n */\nexport class OmitTypenameLinkPlugin extends ApolloLinkPlugin {\n public override createLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (operation.variables) {\n operation.variables = JSON.parse(JSON.stringify(operation.variables), omitTypename);\n }\n return forward(operation);\n });\n }\n}\n"],"names":["omitTypename","key","value","undefined","OmitTypenameLinkPlugin","ApolloLinkPlugin","ApolloLink","operation","forward","JSON"],"mappings":";;AAGA,SAASA,aAAaC,GAAW,EAAEC,KAAa;IAC5C,OAAOD,AAAQ,iBAARA,MAAuBE,SAAYD;AAC9C;AAKO,MAAME,+BAA+BC;IACxB,aAAyB;QACrC,OAAO,IAAIC,WAAW,CAACC,WAAWC;YAC9B,IAAID,UAAU,SAAS,EACnBA,UAAU,SAAS,GAAGE,KAAK,KAAK,CAACA,KAAK,SAAS,CAACF,UAAU,SAAS,GAAGP;YAE1E,OAAOQ,QAAQD;QACnB;IACJ;AACJ"}
@@ -1,10 +1,10 @@
1
- import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
2
- import { ApolloLink } from "apollo-link";
1
+ import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
2
+ import type { ApolloLink } from "apollo-link";
3
3
  /**
4
4
  * Append `x-tenant` header from URL query (necessary for prerendering service).
5
5
  */
6
6
  export declare class TenantHeaderLinkPlugin extends ApolloLinkPlugin {
7
7
  private readonly tenant;
8
- constructor(tenant?: string);
8
+ constructor(tenant: string);
9
9
  createLink(): ApolloLink;
10
10
  }
@@ -1,60 +1,28 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.TenantHeaderLinkPlugin = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
- var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
- var _apolloLinkContext = require("apollo-link-context");
16
- var _ApolloLinkPlugin2 = require("./ApolloLinkPlugin");
17
- var _utils = require("../utils");
18
- /**
19
- * Append `x-tenant` header from URL query (necessary for prerendering service).
20
- */
21
- var TenantHeaderLinkPlugin = /*#__PURE__*/function (_ApolloLinkPlugin) {
22
- (0, _inherits2.default)(TenantHeaderLinkPlugin, _ApolloLinkPlugin);
23
- var _super = (0, _createSuper2.default)(TenantHeaderLinkPlugin);
24
- function TenantHeaderLinkPlugin(tenant) {
25
- var _this;
26
- (0, _classCallCheck2.default)(this, TenantHeaderLinkPlugin);
27
- _this = _super.call(this);
28
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "tenant", void 0);
29
- _this.name = "tenant-header-link";
30
- _this.tenant = tenant || (0, _utils.getTenantId)();
31
- return _this;
32
- }
33
- (0, _createClass2.default)(TenantHeaderLinkPlugin, [{
34
- key: "createLink",
35
- value: function createLink() {
36
- var _this2 = this;
37
- return (0, _apolloLinkContext.setContext)(function (_, _ref) {
38
- var headers = _ref.headers;
39
- // If tenant header is already set, do not overwrite it.
40
- if (headers && "x-tenant" in headers) {
41
- return {
42
- headers: headers
43
- };
44
- }
45
- if (_this2.tenant) {
46
- return {
47
- headers: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, headers), {}, {
48
- "x-tenant": _this2.tenant
49
- })
50
- };
51
- }
52
- return {
53
- headers: headers
54
- };
55
- });
1
+ import { setContext } from "apollo-link-context";
2
+ import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
3
+ class TenantHeaderLinkPlugin extends ApolloLinkPlugin {
4
+ constructor(tenant){
5
+ super();
6
+ this.name = "tenant-header-link";
7
+ this.tenant = tenant;
8
+ }
9
+ createLink() {
10
+ return setContext((_, { headers })=>{
11
+ if (headers && "x-tenant" in headers) return {
12
+ headers
13
+ };
14
+ if (this.tenant) return {
15
+ headers: {
16
+ ...headers,
17
+ "x-tenant": this.tenant
18
+ }
19
+ };
20
+ return {
21
+ headers
22
+ };
23
+ });
56
24
  }
57
- }]);
58
- return TenantHeaderLinkPlugin;
59
- }(_ApolloLinkPlugin2.ApolloLinkPlugin);
60
- exports.TenantHeaderLinkPlugin = TenantHeaderLinkPlugin;
25
+ }
26
+ export { TenantHeaderLinkPlugin };
27
+
28
+ //# sourceMappingURL=TenantHeaderLinkPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TenantHeaderLinkPlugin","tenant","name","getTenantId","setContext","_","headers","ApolloLinkPlugin"],"sources":["TenantHeaderLinkPlugin.ts"],"sourcesContent":["import { setContext } from \"apollo-link-context\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { ApolloLink } from \"apollo-link\";\nimport { getTenantId } from \"~/utils\";\n\n/**\n * Append `x-tenant` header from URL query (necessary for prerendering service).\n */\nexport class TenantHeaderLinkPlugin extends ApolloLinkPlugin {\n private readonly tenant: string;\n\n public constructor(tenant?: string) {\n super();\n this.name = \"tenant-header-link\";\n\n this.tenant = tenant || (getTenantId() as string);\n }\n\n public override createLink(): ApolloLink {\n return setContext((_, { headers }) => {\n // If tenant header is already set, do not overwrite it.\n if (headers && \"x-tenant\" in headers) {\n return { headers };\n }\n\n if (this.tenant) {\n return {\n headers: {\n ...headers,\n \"x-tenant\": this.tenant\n }\n };\n }\n\n return { headers };\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AAEA;AAEA;AACA;AACA;AAFA,IAGaA,sBAAsB;EAAA;EAAA;EAG/B,gCAAmBC,MAAe,EAAE;IAAA;IAAA;IAChC;IAAQ;IACR,MAAKC,IAAI,GAAG,oBAAoB;IAEhC,MAAKD,MAAM,GAAGA,MAAM,IAAK,IAAAE,kBAAW,GAAa;IAAC;EACtD;EAAC;IAAA;IAAA,OAED,sBAAyC;MAAA;MACrC,OAAO,IAAAC,6BAAU,EAAC,UAACC,CAAC,QAAkB;QAAA,IAAdC,OAAO,QAAPA,OAAO;QAC3B;QACA,IAAIA,OAAO,IAAI,UAAU,IAAIA,OAAO,EAAE;UAClC,OAAO;YAAEA,OAAO,EAAPA;UAAQ,CAAC;QACtB;QAEA,IAAI,MAAI,CAACL,MAAM,EAAE;UACb,OAAO;YACHK,OAAO,8DACAA,OAAO;cACV,UAAU,EAAE,MAAI,CAACL;YAAM;UAE/B,CAAC;QACL;QAEA,OAAO;UAAEK,OAAO,EAAPA;QAAQ,CAAC;MACtB,CAAC,CAAC;IACN;EAAC;EAAA;AAAA,EA5BuCC,mCAAgB;AAAA"}
1
+ {"version":3,"file":"plugins/TenantHeaderLinkPlugin.js","sources":["../../src/plugins/TenantHeaderLinkPlugin.ts"],"sourcesContent":["import { setContext } from \"apollo-link-context\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin.js\";\nimport type { ApolloLink } from \"apollo-link\";\n\n/**\n * Append `x-tenant` header from URL query (necessary for prerendering service).\n */\nexport class TenantHeaderLinkPlugin extends ApolloLinkPlugin {\n private readonly tenant: string;\n\n public constructor(tenant: string) {\n super();\n this.name = \"tenant-header-link\";\n\n this.tenant = tenant;\n }\n\n public override createLink(): ApolloLink {\n return setContext((_, { headers }) => {\n // If tenant header is already set, do not overwrite it.\n if (headers && \"x-tenant\" in headers) {\n return { headers };\n }\n\n if (this.tenant) {\n return {\n headers: {\n ...headers,\n \"x-tenant\": this.tenant\n }\n };\n }\n\n return { headers };\n });\n }\n}\n"],"names":["TenantHeaderLinkPlugin","ApolloLinkPlugin","tenant","setContext","_","headers"],"mappings":";;AAOO,MAAMA,+BAA+BC;IAGxC,YAAmBC,MAAc,CAAE;QAC/B,KAAK;QACL,IAAI,CAAC,IAAI,GAAG;QAEZ,IAAI,CAAC,MAAM,GAAGA;IAClB;IAEgB,aAAyB;QACrC,OAAOC,WAAW,CAACC,GAAG,EAAEC,OAAO,EAAE;YAE7B,IAAIA,WAAW,cAAcA,SACzB,OAAO;gBAAEA;YAAQ;YAGrB,IAAI,IAAI,CAAC,MAAM,EACX,OAAO;gBACH,SAAS;oBACL,GAAGA,OAAO;oBACV,YAAY,IAAI,CAAC,MAAM;gBAC3B;YACJ;YAGJ,OAAO;gBAAEA;YAAQ;QACrB;IACJ;AACJ"}
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ interface ImageProps extends React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> {
3
+ [key: string]: any;
4
+ }
5
+ declare const Image: ({ ...rest }: ImageProps) => React.JSX.Element;
6
+ export { Image, type ImageProps };
@@ -0,0 +1,12 @@
1
+ import react from "react";
2
+ const Image = ({ ...rest })=>{
3
+ const finalProps = {
4
+ ...rest
5
+ };
6
+ const srcSet = finalProps.srcSet;
7
+ if (srcSet && "object" == typeof srcSet) finalProps.srcSet = Object.keys(srcSet).map((key)=>`${srcSet[key]} ${key}`).join(", ");
8
+ return /*#__PURE__*/ react.createElement("img", finalProps);
9
+ };
10
+ export { Image };
11
+
12
+ //# sourceMappingURL=Image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins/components/Image.js","sources":["../../../src/plugins/components/Image.tsx"],"sourcesContent":["import React from \"react\";\n\n// Accepts all props that a normal <img> element would accept.\ninterface ImageProps extends React.DetailedHTMLProps<\n React.ImgHTMLAttributes<HTMLImageElement>,\n HTMLImageElement\n> {\n [key: string]: any;\n}\n\nconst Image = ({ ...rest }: ImageProps) => {\n const finalProps = { ...rest };\n const srcSet = finalProps.srcSet;\n if (srcSet && typeof srcSet === \"object\") {\n finalProps.srcSet = Object.keys(srcSet)\n .map(key => `${srcSet[key]} ${key}`)\n .join(\", \");\n }\n\n return <img {...finalProps} />;\n};\n\nexport { Image, type ImageProps };\n"],"names":["Image","rest","finalProps","srcSet","Object","key"],"mappings":";AAUA,MAAMA,QAAQ,CAAC,EAAE,GAAGC,MAAkB;IAClC,MAAMC,aAAa;QAAE,GAAGD,IAAI;IAAC;IAC7B,MAAME,SAASD,WAAW,MAAM;IAChC,IAAIC,UAAU,AAAkB,YAAlB,OAAOA,QACjBD,WAAW,MAAM,GAAGE,OAAO,IAAI,CAACD,QAC3B,GAAG,CAACE,CAAAA,MAAO,GAAGF,MAAM,CAACE,IAAI,CAAC,CAAC,EAAEA,KAAK,EAClC,IAAI,CAAC;IAGd,OAAO,WAAP,GAAO,oBAAC,OAAQH;AACpB"}
@@ -1,3 +1,3 @@
1
- import { ImageComponentPlugin } from "../types";
1
+ import type { ImageComponentPlugin } from "../types.js";
2
2
  declare const _default: () => ImageComponentPlugin;
3
3
  export default _default;
package/plugins/image.js CHANGED
@@ -1,151 +1,106 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
- var _react = _interopRequireDefault(require("react"));
11
- var _Image = require("@webiny/ui/Image");
12
- var _excluded = ["transform", "srcSet"];
13
- var SUPPORTED_IMAGE_RESIZE_WIDTHS = [100, 300, 500, 750, 1000, 1500, 2500];
14
-
15
- /**
16
- * Width of the image should not be just any random number. For optimization reasons,
17
- * we only allow the ones listed in SUPPORTED_IMAGE_RESIZE_WIDTHS list (Webiny Cloud supports only these).
18
- */
19
- var getSupportedImageResizeWidth = function getSupportedImageResizeWidth(width) {
20
- var output = SUPPORTED_IMAGE_RESIZE_WIDTHS[0];
21
- var i = SUPPORTED_IMAGE_RESIZE_WIDTHS.length;
22
- while (i >= 0) {
23
- if (width === SUPPORTED_IMAGE_RESIZE_WIDTHS[i]) {
24
- output = SUPPORTED_IMAGE_RESIZE_WIDTHS[i];
25
- break;
1
+ import react from "react";
2
+ import { Image } from "./components/Image.js";
3
+ const SUPPORTED_IMAGE_RESIZE_WIDTHS = [
4
+ 128,
5
+ 384,
6
+ 640,
7
+ 750,
8
+ 828,
9
+ 1080,
10
+ 1200,
11
+ 1920,
12
+ 2048,
13
+ 3840
14
+ ];
15
+ const getSupportedImageResizeWidth = (width)=>{
16
+ let output = SUPPORTED_IMAGE_RESIZE_WIDTHS[0];
17
+ let i = SUPPORTED_IMAGE_RESIZE_WIDTHS.length;
18
+ while(i >= 0){
19
+ if (width === SUPPORTED_IMAGE_RESIZE_WIDTHS[i]) {
20
+ output = SUPPORTED_IMAGE_RESIZE_WIDTHS[i];
21
+ break;
22
+ }
23
+ if (width > SUPPORTED_IMAGE_RESIZE_WIDTHS[i]) {
24
+ output = SUPPORTED_IMAGE_RESIZE_WIDTHS[i + 1];
25
+ if (!output) output = SUPPORTED_IMAGE_RESIZE_WIDTHS[i];
26
+ break;
27
+ }
28
+ i--;
26
29
  }
27
- if (width > SUPPORTED_IMAGE_RESIZE_WIDTHS[i]) {
28
- // Use next larger width. If there isn't any, use current.
29
- output = SUPPORTED_IMAGE_RESIZE_WIDTHS[i + 1];
30
- if (!output) {
31
- output = SUPPORTED_IMAGE_RESIZE_WIDTHS[i];
32
- }
33
- break;
34
- }
35
- i--;
36
- }
37
- return output;
30
+ return output;
38
31
  };
39
- /**
40
- * Currently we only allow "width" as a transform option.
41
- * @param args
42
- */
43
- var sanitizeTransformArgs = function sanitizeTransformArgs(args) {
44
- var output = {};
45
- if (!args || args.width === undefined || args.width === null) {
32
+ const sanitizeTransformArgs = (args)=>{
33
+ const output = {};
34
+ if (!args || void 0 === args.width || null === args.width) return output;
35
+ const width = parseInt(args.width);
36
+ if (width > 0) output.width = getSupportedImageResizeWidth(width);
46
37
  return output;
47
- }
48
- var width = parseInt(args.width);
49
- if (width > 0) {
50
- output.width = getSupportedImageResizeWidth(width);
51
- }
52
- return output;
53
38
  };
54
- var getSizes = function getSizes(width) {
55
- if (typeof width !== "string") {
56
- return undefined;
57
- }
58
- // Check if width was set as percentage, with "%" in the value.
59
- if (width.endsWith("%")) {
60
- return "".concat(parseInt(width), "vw");
61
- }
62
- // Check if width was set as viewport width, with "vw" in the value.
63
- if (width.endsWith("vw")) {
64
- return "".concat(parseInt(width), "vw");
65
- }
66
-
67
- // Check if width was set as relative, with "em" in the value.
68
- if (width.endsWith("em")) {
69
- return "".concat(parseInt(width), "em");
70
- }
71
- return undefined;
39
+ const getSizes = (width)=>{
40
+ if ("string" != typeof width) return;
41
+ if (width.endsWith("%")) return `${parseInt(width)}vw`;
42
+ if (width.endsWith("vw")) return `${parseInt(width)}vw`;
43
+ if (width.endsWith("em")) return `${parseInt(width)}em`;
72
44
  };
73
- var isFixedImageWidth = function isFixedImageWidth(width) {
74
- if (Number.isFinite(width)) {
75
- return true;
76
- }
77
- if (typeof width === "string" && width.endsWith("px")) {
78
- return true;
79
- }
80
- return false;
45
+ const isFixedImageWidth = (width)=>{
46
+ if (Number.isFinite(width)) return true;
47
+ if ("string" == typeof width && width.endsWith("px")) return true;
48
+ return false;
81
49
  };
82
- var getSrcSetAutoSizes = function getSrcSetAutoSizes(max) {
83
- max = isFixedImageWidth(max) ? parseInt("" + max) : 2500;
84
- var maxWidth = getSupportedImageResizeWidth(max);
85
- return SUPPORTED_IMAGE_RESIZE_WIDTHS.filter(function (supportedWidth) {
86
- return supportedWidth <= maxWidth;
87
- });
50
+ const getSrcSetAutoSizes = (max)=>{
51
+ max = isFixedImageWidth(max) ? parseInt("" + max) : 2500;
52
+ const maxWidth = getSupportedImageResizeWidth(max);
53
+ return SUPPORTED_IMAGE_RESIZE_WIDTHS.filter((supportedWidth)=>supportedWidth <= maxWidth);
88
54
  };
89
- var convertTransformToQueryParams = function convertTransformToQueryParams(transform) {
90
- return Object.keys(transform).map(function (key) {
91
- return "".concat(key, "=").concat(transform[key]);
92
- }).join("&");
55
+ const convertTransformToQueryParams = (transform)=>Object.keys(transform).map((key)=>`${key}=${transform[key]}`).join("&");
56
+ const plugins_image = ()=>{
57
+ const imagePlugin = {
58
+ name: "image-component",
59
+ type: "image-component",
60
+ presets: {
61
+ avatar: {
62
+ width: 300
63
+ }
64
+ },
65
+ getImageSrc: (props)=>{
66
+ if (!props) return "";
67
+ const { src, transform } = props;
68
+ if (!transform) return src;
69
+ if (!src || src.startsWith("data:") || src.endsWith("svg")) return src;
70
+ const sanitizedParams = sanitizeTransformArgs(transform);
71
+ const params = convertTransformToQueryParams(sanitizedParams);
72
+ return src + "?" + params;
73
+ },
74
+ render (props) {
75
+ const { transform, srcSet: srcSetInitial, ...imageProps } = props;
76
+ let srcSet = srcSetInitial;
77
+ let sizes;
78
+ const src = imageProps.src;
79
+ if (srcSet && "auto" === srcSet) {
80
+ srcSet = {};
81
+ const forcedWidth = props.width || props.style && props.style.width;
82
+ const srcSetAutoWidths = getSrcSetAutoSizes(forcedWidth);
83
+ srcSetAutoWidths.forEach((width)=>{
84
+ srcSet[width + "w"] = imagePlugin.getImageSrc({
85
+ src,
86
+ transform: {
87
+ ...transform,
88
+ width
89
+ }
90
+ });
91
+ });
92
+ sizes = getSizes(forcedWidth);
93
+ }
94
+ return /*#__PURE__*/ react.createElement(Image, {
95
+ ...imageProps,
96
+ srcSet: srcSet,
97
+ src: src,
98
+ sizes: sizes
99
+ });
100
+ }
101
+ };
102
+ return imagePlugin;
93
103
  };
94
- var _default = function _default() {
95
- var imagePlugin = {
96
- name: "image-component",
97
- type: "image-component",
98
- presets: {
99
- avatar: {
100
- width: 300
101
- }
102
- },
103
- getImageSrc: function getImageSrc(props) {
104
- if (!props) {
105
- return "";
106
- }
107
- var src = props.src,
108
- transform = props.transform;
109
- if (!transform) {
110
- return src;
111
- }
112
- if (!src || src.startsWith("data:") || src.endsWith("svg")) {
113
- return src;
114
- }
115
- var sanitizedParams = sanitizeTransformArgs(transform);
116
- var params = convertTransformToQueryParams(sanitizedParams);
117
- return src + "?" + params;
118
- },
119
- render: function render(props) {
120
- var transform = props.transform,
121
- srcSetInitial = props.srcSet,
122
- imageProps = (0, _objectWithoutProperties2.default)(props, _excluded);
123
- var srcSet = srcSetInitial;
124
- var sizes;
125
- var src = imageProps.src;
126
- if (srcSet && srcSet === "auto") {
127
- srcSet = {};
104
+ export default plugins_image;
128
105
 
129
- // Check if image width was forced, and additionally if width was set as pixels, with "px" in the value.
130
- var forcedWidth = props.width || props.style && props.style.width;
131
- var srcSetAutoWidths = getSrcSetAutoSizes(forcedWidth);
132
- srcSetAutoWidths.forEach(function (width) {
133
- srcSet[width + "w"] = imagePlugin.getImageSrc({
134
- src: src,
135
- transform: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, transform), {}, {
136
- width: width
137
- })
138
- });
139
- });
140
- sizes = getSizes(forcedWidth);
141
- }
142
- return /*#__PURE__*/_react.default.createElement(_Image.Image, Object.assign({}, imageProps, {
143
- srcSet: srcSet,
144
- src: src,
145
- sizes: sizes
146
- }));
147
- }
148
- };
149
- return imagePlugin;
150
- };
151
- exports.default = _default;
106
+ //# sourceMappingURL=image.js.map