@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
@@ -1 +0,0 @@
1
- {"version":3,"names":["useDataList","debounce","useAutocomplete","props","dataList","useRouter","options","data","onInput","query","search","setSearch"],"sources":["useAutocomplete.ts"],"sourcesContent":["import { useDataList } from \"../useDataList\";\nimport debounce from \"lodash/debounce\";\nimport type { DocumentNode } from \"graphql\";\n\ninterface UseAutocompleteHook {\n options: any[];\n onInput(value: string): void;\n}\n\ninterface Props {\n query: DocumentNode;\n search?: string | ((value: string) => string);\n}\n\nexport const useAutocomplete = (props: Props): UseAutocompleteHook => {\n const dataList = useDataList({ useRouter: false, ...props });\n\n return {\n options: dataList.data || [],\n onInput: debounce(query => {\n if (!query) {\n return;\n }\n\n let search = props.search || query;\n if (typeof search === \"function\") {\n search = search(query);\n }\n\n dataList.setSearch(search);\n }, 250)\n };\n};\n"],"mappings":"AAAA,SAASA,WAAW;AACpB,OAAOC,QAAQ,MAAM,iBAAiB;AAatC,OAAO,MAAMC,eAAe,GAAIC,KAAY,IAA0B;EAClE,MAAMC,QAAQ,GAAGJ,WAAW,CAAC;IAAEK,SAAS,EAAE,KAAK;IAAE,GAAGF;EAAM,CAAC,CAAC;EAE5D,OAAO;IACHG,OAAO,EAAEF,QAAQ,CAACG,IAAI,IAAI,EAAE;IAC5BC,OAAO,EAAEP,QAAQ,CAACQ,KAAK,IAAI;MACvB,IAAI,CAACA,KAAK,EAAE;QACR;MACJ;MAEA,IAAIC,MAAM,GAAGP,KAAK,CAACO,MAAM,IAAID,KAAK;MAClC,IAAI,OAAOC,MAAM,KAAK,UAAU,EAAE;QAC9BA,MAAM,GAAGA,MAAM,CAACD,KAAK,CAAC;MAC1B;MAEAL,QAAQ,CAACO,SAAS,CAACD,MAAM,CAAC;IAC9B,CAAC,EAAE,GAAG;EACV,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- declare const _default: (response: Record<string, string>) => string | null;
2
- export default _default;
@@ -1,4 +0,0 @@
1
- import searchDataByKey from "./searchDataByKey";
2
- export default response => searchDataByKey("data", response);
3
-
4
- //# sourceMappingURL=getData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["searchDataByKey","response"],"sources":["getData.ts"],"sourcesContent":["import searchDataByKey from \"./searchDataByKey\";\n\nexport default (response: Record<string, string>) => searchDataByKey(\"data\", response);\n"],"mappings":"AAAA,OAAOA,eAAe;AAEtB,eAAgBC,QAAgC,IAAKD,eAAe,CAAC,MAAM,EAAEC,QAAQ,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- declare const _default: (response: Record<string, string>) => string | null;
2
- export default _default;
@@ -1,4 +0,0 @@
1
- import searchDataByKey from "./searchDataByKey";
2
- export default response => searchDataByKey("error", response);
3
-
4
- //# sourceMappingURL=getError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["searchDataByKey","response"],"sources":["getError.ts"],"sourcesContent":["import searchDataByKey from \"./searchDataByKey\";\n\nexport default (response: Record<string, string>) => searchDataByKey(\"error\", response);\n"],"mappings":"AAAA,OAAOA,eAAe;AAEtB,eAAgBC,QAAgC,IAAKD,eAAe,CAAC,OAAO,EAAEC,QAAQ,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- declare const _default: (response: Record<string, string>) => string | null;
2
- export default _default;
@@ -1,4 +0,0 @@
1
- import searchDataByKey from "./searchDataByKey";
2
- export default response => searchDataByKey("meta", response);
3
-
4
- //# sourceMappingURL=getMeta.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["searchDataByKey","response"],"sources":["getMeta.ts"],"sourcesContent":["import searchDataByKey from \"./searchDataByKey\";\n\nexport default (response: Record<string, string>) => searchDataByKey(\"meta\", response);\n"],"mappings":"AAAA,OAAOA,eAAe;AAEtB,eAAgBC,QAAgC,IAAKD,eAAe,CAAC,MAAM,EAAEC,QAAQ,CAAC","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- export { default as getData } from "./getData";
2
- export { default as getError } from "./getError";
3
- export { default as getMeta } from "./getMeta";
@@ -1,5 +0,0 @@
1
- export { default as getData } from "./getData";
2
- export { default as getError } from "./getError";
3
- export { default as getMeta } from "./getMeta";
4
-
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["default","getData","getError","getMeta"],"sources":["index.ts"],"sourcesContent":["export { default as getData } from \"./getData\";\nexport { default as getError } from \"./getError\";\nexport { default as getMeta } from \"./getMeta\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,OAAO;AAC3B,SAASD,OAAO,IAAIE,QAAQ;AAC5B,SAASF,OAAO,IAAIG,OAAO","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- declare const searchDataByKey: (searchKey: string, object: Record<string, any>) => string | null;
2
- export default searchDataByKey;
@@ -1,18 +0,0 @@
1
- const searchDataByKey = (searchKey, object) => {
2
- if (!object || typeof object !== "object") {
3
- return null;
4
- }
5
- if (object[searchKey]) {
6
- return object[searchKey];
7
- }
8
- for (const key in object) {
9
- const value = searchDataByKey(searchKey, object[key]);
10
- if (value) {
11
- return value;
12
- }
13
- }
14
- return null;
15
- };
16
- export default searchDataByKey;
17
-
18
- //# sourceMappingURL=searchDataByKey.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["searchDataByKey","searchKey","object","key","value"],"sources":["searchDataByKey.ts"],"sourcesContent":["const searchDataByKey = (searchKey: string, object: Record<string, any>): string | null => {\n if (!object || typeof object !== \"object\") {\n return null;\n }\n\n if (object[searchKey]) {\n return object[searchKey];\n }\n\n for (const key in object) {\n const value = searchDataByKey(searchKey, object[key]);\n if (value) {\n return value;\n }\n }\n\n return null;\n};\n\nexport default searchDataByKey;\n"],"mappings":"AAAA,MAAMA,eAAe,GAAGA,CAACC,SAAiB,EAAEC,MAA2B,KAAoB;EACvF,IAAI,CAACA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IACvC,OAAO,IAAI;EACf;EAEA,IAAIA,MAAM,CAACD,SAAS,CAAC,EAAE;IACnB,OAAOC,MAAM,CAACD,SAAS,CAAC;EAC5B;EAEA,KAAK,MAAME,GAAG,IAAID,MAAM,EAAE;IACtB,MAAME,KAAK,GAAGJ,eAAe,CAACC,SAAS,EAAEC,MAAM,CAACC,GAAG,CAAC,CAAC;IACrD,IAAIC,KAAK,EAAE;MACP,OAAOA,KAAK;IAChB;EACJ;EAEA,OAAO,IAAI;AACf,CAAC;AAED,eAAeJ,eAAe","ignoreList":[]}
@@ -1 +0,0 @@
1
- export { useDataList } from "./useDataList";
@@ -1,3 +0,0 @@
1
- export { useDataList } from "./useDataList";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useDataList"],"sources":["index.ts"],"sourcesContent":["export { useDataList } from \"./useDataList\";\n"],"mappings":"AAAA,SAASA,WAAW","ignoreList":[]}
@@ -1,36 +0,0 @@
1
- import type { DocumentNode } from "graphql";
2
- import type { ApolloClient } from "apollo-client";
3
- export interface UseDataListParams {
4
- useRouter?: boolean;
5
- variables?: ((params: UseDataListParams) => any) | object;
6
- client?: ApolloClient<any>;
7
- query: DocumentNode;
8
- getData?: (data: any) => any;
9
- getMeta?: (data: any) => any;
10
- getError?: (data: any) => any;
11
- }
12
- export interface DataListProps {
13
- __loadParams: any;
14
- refresh: (params?: any) => void;
15
- data: any[];
16
- meta: any;
17
- error: any;
18
- loading: boolean;
19
- isSelected: (item: any) => boolean;
20
- select: (item: any) => void;
21
- isMultiSelected: (item: any) => boolean;
22
- isNoneMultiSelected: () => boolean;
23
- isAllMultiSelected: () => boolean;
24
- multiSelectAll: (value: boolean) => void;
25
- getMultiSelected: () => any[];
26
- setSearch: (search: any) => void;
27
- setWhere: (where: any) => void;
28
- setSorters: (sort: any) => void;
29
- setPerPage: (perPage: number) => void;
30
- setPreviousPage: (cursor: string) => void;
31
- setNextPage: (cursor: string) => void;
32
- multiSelect: (items: string | string[], value?: boolean) => void;
33
- init: () => void;
34
- }
35
- declare const useDataList: (params: UseDataListParams) => DataListProps;
36
- export { useDataList };
@@ -1,183 +0,0 @@
1
- import { useState, useEffect, useRef, useCallback } from "react";
2
- import { useQuery } from "@apollo/react-hooks";
3
- import { useRouter } from "@webiny/react-router";
4
- import get from "lodash/get";
5
- import isEqual from "lodash/isEqual";
6
- import { prepareLoadListParams } from "./utils";
7
- import { getData, getError, getMeta } from "./functions";
8
- const useDataList = params => {
9
- const [multiSelectedItems, multiSelect] = useState([]);
10
- let history = null;
11
- /**
12
- * TODO: figure out the location type.
13
- */
14
- let location = null;
15
- const routerHook = useRouter();
16
- if (params.useRouter !== false) {
17
- history = routerHook.history;
18
- location = routerHook.location;
19
- }
20
- const getQueryOptions = useCallback(() => {
21
- let variables = params.variables;
22
- if (typeof variables === "function") {
23
- variables = variables(params);
24
- }
25
- return {
26
- client: params.client,
27
- variables: {
28
- ...variables,
29
- ...prepareLoadListParams(location)
30
- }
31
- };
32
- }, []);
33
- const queryData = useQuery(params.query, getQueryOptions());
34
- const prevLoadParamsRef = useRef({});
35
- const dataListProps = {
36
- data: get(params, "getData", getData)(queryData.data),
37
- meta: get(params, "getMeta", getMeta)(queryData.data),
38
- error: get(params, "getError", getError)(queryData.data),
39
- loading: queryData.loading,
40
- init() {
41
- this.refresh();
42
- },
43
- refresh(params = null) {
44
- // Refresh multi select first.
45
- multiSelect([]);
46
- if (!params) {
47
- queryData.refetch(dataListProps.__loadParams);
48
- return;
49
- }
50
-
51
- // if (history) {
52
- // redirectToRouteWithQueryParams(params, { history, location });
53
- // return;
54
- // }
55
-
56
- queryData.refetch(params);
57
- },
58
- setPerPage(perPage) {
59
- const preparedParams = {
60
- ...dataListProps.__loadParams,
61
- limit: parseInt("" + perPage),
62
- after: undefined,
63
- before: undefined
64
- };
65
- this.refresh(preparedParams);
66
- },
67
- setNextPage(cursor) {
68
- const preparedParams = {
69
- ...dataListProps.__loadParams,
70
- after: cursor,
71
- before: undefined
72
- };
73
- this.refresh(preparedParams);
74
- },
75
- setPreviousPage(cursor) {
76
- const preparedParams = {
77
- ...dataListProps.__loadParams,
78
- after: undefined,
79
- before: cursor
80
- };
81
- this.refresh(preparedParams);
82
- },
83
- setSearch(search) {
84
- const preparedParams = {
85
- ...dataListProps.__loadParams,
86
- search,
87
- after: undefined,
88
- before: undefined
89
- };
90
- this.refresh(preparedParams);
91
- },
92
- setWhere(where) {
93
- const preparedParams = {
94
- ...dataListProps.__loadParams,
95
- where,
96
- after: undefined,
97
- before: undefined
98
- };
99
- this.refresh(preparedParams);
100
- },
101
- setSorters(sort) {
102
- const preparedParams = {
103
- ...dataListProps.__loadParams,
104
- sort,
105
- after: undefined,
106
- before: undefined
107
- };
108
- this.refresh(preparedParams);
109
- },
110
- multiSelect(items, value) {
111
- if (!Array.isArray(items)) {
112
- items = [items];
113
- }
114
- const returnItems = [...multiSelectedItems];
115
- items.forEach(item => {
116
- if (value === undefined) {
117
- returnItems.includes(item) ? returnItems.splice(returnItems.indexOf(item), 1) : returnItems.push(item);
118
- } else {
119
- if (value === true) {
120
- !returnItems.includes(item) && returnItems.push(item);
121
- } else {
122
- returnItems.includes(item) && returnItems.splice(returnItems.indexOf(item), 1);
123
- }
124
- }
125
- });
126
- multiSelect(returnItems);
127
- },
128
- isSelected(item) {
129
- const query = new URLSearchParams(location.search);
130
- return query.get("id") === item.id;
131
- },
132
- select(item) {
133
- const query = new URLSearchParams(location.search);
134
- query.set("id", item.id);
135
- history.push({
136
- search: query.toString()
137
- });
138
- },
139
- isMultiSelected(item) {
140
- if (!Array.isArray(multiSelectedItems)) {
141
- return false;
142
- }
143
- return multiSelectedItems.includes(item);
144
- },
145
- isNoneMultiSelected() {
146
- return multiSelectedItems.length === 0;
147
- },
148
- getMultiSelected() {
149
- return multiSelectedItems;
150
- },
151
- multiSelectAll(value) {
152
- const {
153
- data
154
- } = dataListProps;
155
- if (Array.isArray(data)) {
156
- dataListProps.multiSelect(data, value);
157
- } else {
158
- dataListProps.multiSelect([], value);
159
- }
160
- },
161
- isAllMultiSelected() {
162
- const {
163
- data
164
- } = dataListProps;
165
- return Array.isArray(data) && multiSelectedItems.length === data.length;
166
- },
167
- __loadParams: prepareLoadListParams(location)
168
- };
169
- useEffect(() => {
170
- const params = {
171
- prev: prevLoadParamsRef.current,
172
- current: dataListProps.__loadParams
173
- };
174
- if (!isEqual(params.prev, params.current)) {
175
- dataListProps.init();
176
- }
177
- prevLoadParamsRef.current = params.current;
178
- });
179
- return dataListProps;
180
- };
181
- export { useDataList };
182
-
183
- //# sourceMappingURL=useDataList.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useState","useEffect","useRef","useCallback","useQuery","useRouter","get","isEqual","prepareLoadListParams","getData","getError","getMeta","useDataList","params","multiSelectedItems","multiSelect","history","location","routerHook","getQueryOptions","variables","client","queryData","query","prevLoadParamsRef","dataListProps","data","meta","error","loading","init","refresh","refetch","__loadParams","setPerPage","perPage","preparedParams","limit","parseInt","after","undefined","before","setNextPage","cursor","setPreviousPage","setSearch","search","setWhere","where","setSorters","sort","items","value","Array","isArray","returnItems","forEach","item","includes","splice","indexOf","push","isSelected","URLSearchParams","id","select","set","toString","isMultiSelected","isNoneMultiSelected","length","getMultiSelected","multiSelectAll","isAllMultiSelected","prev","current"],"sources":["useDataList.ts"],"sourcesContent":["import { useState, useEffect, useRef, useCallback } from \"react\";\nimport { useQuery } from \"@apollo/react-hooks\";\nimport { useRouter } from \"@webiny/react-router\";\nimport get from \"lodash/get\";\nimport isEqual from \"lodash/isEqual\";\nimport { prepareLoadListParams } from \"./utils\";\nimport { getData, getError, getMeta } from \"./functions\";\n\nimport type { DocumentNode } from \"graphql\";\nimport type { ApolloClient } from \"apollo-client\";\n\nexport interface UseDataListParams {\n useRouter?: boolean;\n variables?: ((params: UseDataListParams) => any) | object;\n client?: ApolloClient<any>;\n query: DocumentNode;\n getData?: (data: any) => any;\n getMeta?: (data: any) => any;\n getError?: (data: any) => any;\n}\n\nexport interface DataListProps {\n __loadParams: any;\n refresh: (params?: any) => void;\n data: any[];\n meta: any;\n error: any;\n loading: boolean;\n isSelected: (item: any) => boolean;\n select: (item: any) => void;\n isMultiSelected: (item: any) => boolean;\n isNoneMultiSelected: () => boolean;\n isAllMultiSelected: () => boolean;\n multiSelectAll: (value: boolean) => void;\n getMultiSelected: () => any[];\n setSearch: (search: any) => void;\n setWhere: (where: any) => void;\n setSorters: (sort: any) => void;\n setPerPage: (perPage: number) => void;\n setPreviousPage: (cursor: string) => void;\n setNextPage: (cursor: string) => void;\n multiSelect: (items: string | string[], value?: boolean) => void;\n init: () => void;\n}\n\nconst useDataList = (params: UseDataListParams) => {\n const [multiSelectedItems, multiSelect] = useState<string[]>([]);\n\n let history = null;\n /**\n * TODO: figure out the location type.\n */\n let location: any = null;\n const routerHook = useRouter();\n\n if (params.useRouter !== false) {\n history = routerHook.history;\n location = routerHook.location;\n }\n\n const getQueryOptions = useCallback(() => {\n let variables = params.variables;\n if (typeof variables === \"function\") {\n variables = variables(params);\n }\n\n return {\n client: params.client,\n variables: {\n ...variables,\n ...prepareLoadListParams(location)\n }\n };\n }, []);\n\n const queryData = useQuery(params.query, getQueryOptions());\n const prevLoadParamsRef = useRef({});\n\n const dataListProps: DataListProps = {\n data: get(params, \"getData\", getData)(queryData.data),\n meta: get(params, \"getMeta\", getMeta)(queryData.data),\n error: get(params, \"getError\", getError)(queryData.data),\n\n loading: queryData.loading,\n init() {\n this.refresh();\n },\n refresh(params = null): void {\n // Refresh multi select first.\n multiSelect([]);\n\n if (!params) {\n queryData.refetch(dataListProps.__loadParams);\n return;\n }\n\n // if (history) {\n // redirectToRouteWithQueryParams(params, { history, location });\n // return;\n // }\n\n queryData.refetch(params);\n },\n setPerPage(perPage: number): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n limit: parseInt(\"\" + perPage),\n after: undefined,\n before: undefined\n };\n this.refresh(preparedParams);\n },\n setNextPage(cursor: string): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n after: cursor,\n before: undefined\n };\n this.refresh(preparedParams);\n },\n setPreviousPage(cursor: string): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n after: undefined,\n before: cursor\n };\n this.refresh(preparedParams);\n },\n setSearch(search): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n search,\n after: undefined,\n before: undefined\n };\n this.refresh(preparedParams);\n },\n setWhere(where): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n where,\n after: undefined,\n before: undefined\n };\n this.refresh(preparedParams);\n },\n setSorters(sort): void {\n const preparedParams = {\n ...dataListProps.__loadParams,\n sort,\n after: undefined,\n before: undefined\n };\n this.refresh(preparedParams);\n },\n multiSelect(items, value): void {\n if (!Array.isArray(items)) {\n items = [items];\n }\n\n const returnItems = [...multiSelectedItems];\n\n items.forEach(item => {\n if (value === undefined) {\n returnItems.includes(item)\n ? returnItems.splice(returnItems.indexOf(item), 1)\n : returnItems.push(item);\n } else {\n if (value === true) {\n !returnItems.includes(item) && returnItems.push(item);\n } else {\n returnItems.includes(item) &&\n returnItems.splice(returnItems.indexOf(item), 1);\n }\n }\n });\n\n multiSelect(returnItems);\n },\n isSelected(item) {\n const query = new URLSearchParams(location.search);\n return query.get(\"id\") === item.id;\n },\n select(item) {\n const query = new URLSearchParams(location.search);\n query.set(\"id\", item.id);\n history.push({ search: query.toString() });\n },\n isMultiSelected(item) {\n if (!Array.isArray(multiSelectedItems)) {\n return false;\n }\n\n return multiSelectedItems.includes(item);\n },\n isNoneMultiSelected() {\n return multiSelectedItems.length === 0;\n },\n getMultiSelected() {\n return multiSelectedItems;\n },\n multiSelectAll(value: boolean): void {\n const { data } = dataListProps;\n if (Array.isArray(data)) {\n dataListProps.multiSelect(data, value);\n } else {\n dataListProps.multiSelect([], value);\n }\n },\n isAllMultiSelected(): boolean {\n const { data } = dataListProps;\n\n return Array.isArray(data) && multiSelectedItems.length === data.length;\n },\n\n __loadParams: prepareLoadListParams(location)\n };\n\n useEffect(() => {\n const params = {\n prev: prevLoadParamsRef.current,\n current: dataListProps.__loadParams\n };\n\n if (!isEqual(params.prev, params.current)) {\n dataListProps.init();\n }\n\n prevLoadParamsRef.current = params.current;\n });\n\n return dataListProps;\n};\n\nexport { useDataList };\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,SAAS,EAAEC,MAAM,EAAEC,WAAW,QAAQ,OAAO;AAChE,SAASC,QAAQ,QAAQ,qBAAqB;AAC9C,SAASC,SAAS,QAAQ,sBAAsB;AAChD,OAAOC,GAAG,MAAM,YAAY;AAC5B,OAAOC,OAAO,MAAM,gBAAgB;AACpC,SAASC,qBAAqB;AAC9B,SAASC,OAAO,EAAEC,QAAQ,EAAEC,OAAO;AAuCnC,MAAMC,WAAW,GAAIC,MAAyB,IAAK;EAC/C,MAAM,CAACC,kBAAkB,EAAEC,WAAW,CAAC,GAAGf,QAAQ,CAAW,EAAE,CAAC;EAEhE,IAAIgB,OAAO,GAAG,IAAI;EAClB;AACJ;AACA;EACI,IAAIC,QAAa,GAAG,IAAI;EACxB,MAAMC,UAAU,GAAGb,SAAS,CAAC,CAAC;EAE9B,IAAIQ,MAAM,CAACR,SAAS,KAAK,KAAK,EAAE;IAC5BW,OAAO,GAAGE,UAAU,CAACF,OAAO;IAC5BC,QAAQ,GAAGC,UAAU,CAACD,QAAQ;EAClC;EAEA,MAAME,eAAe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IAAI,EAAE7D,MAAM,CAAC8D,OAAO,CAAC,EAAE;MACvClD,aAAa,CAACK,IAAI,CAAC,CAAC;IACxB;IAEAN,iBAAiB,CAACmD,OAAO,GAAG9D,MAAM,CAAC8D,OAAO;EAC9C,CAAC,CAAC;EAEF,OAAOlD,aAAa;AACxB,CAAC;AAED,SAASb,WAAW","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export { default as prepareLoadListParams } from "./prepareLoadListParams";
2
- export { default as redirectToRouteWithQueryParams } from "./redirectToRouteWithQueryParams";
@@ -1,4 +0,0 @@
1
- export { default as prepareLoadListParams } from "./prepareLoadListParams";
2
- export { default as redirectToRouteWithQueryParams } from "./redirectToRouteWithQueryParams";
3
-
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["default","prepareLoadListParams","redirectToRouteWithQueryParams"],"sources":["index.ts"],"sourcesContent":["export { default as prepareLoadListParams } from \"./prepareLoadListParams\";\nexport { default as redirectToRouteWithQueryParams } from \"./redirectToRouteWithQueryParams\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,qBAAqB;AACzC,SAASD,OAAO,IAAIE,8BAA8B","ignoreList":[]}
@@ -1,10 +0,0 @@
1
- interface Params {
2
- after?: string;
3
- before?: string;
4
- limit?: number;
5
- sort?: string;
6
- where?: Record<string, any>;
7
- search?: string;
8
- }
9
- declare const _default: (location?: Location) => Params;
10
- export default _default;
@@ -1,38 +0,0 @@
1
- const keys = ["sort", "where", "search"];
2
- export default location => {
3
- const params = {};
4
- if (!location) {
5
- return params;
6
- }
7
- const query = new URLSearchParams(location.search);
8
- const after = query.get("after");
9
- const before = query.get("before");
10
- const limit = query.get("limit");
11
- if (after) {
12
- params.after = after;
13
- }
14
- if (before) {
15
- params.before = before;
16
- }
17
- if (limit) {
18
- params.limit = parseInt(limit);
19
- }
20
- keys.forEach(key => {
21
- const value = query.get(key);
22
- if (typeof value !== "string") {
23
- return;
24
- }
25
- try {
26
- params[key] = JSON.parse(value);
27
- } catch (e) {
28
- /**
29
- * If we can't parse the value, it means it's a string.
30
- */
31
- // @ts-expect-error
32
- params[key] = value;
33
- }
34
- });
35
- return params;
36
- };
37
-
38
- //# sourceMappingURL=prepareLoadListParams.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["keys","location","params","query","URLSearchParams","search","after","get","before","limit","parseInt","forEach","key","value","JSON","parse","e"],"sources":["prepareLoadListParams.ts"],"sourcesContent":["interface Params {\n after?: string;\n before?: string;\n limit?: number;\n sort?: string;\n where?: Record<string, any>;\n search?: string;\n}\n\nconst keys: (keyof Params)[] = [\"sort\", \"where\", \"search\"];\n\nexport default (location?: Location): Params => {\n const params: Params = {};\n if (!location) {\n return params;\n }\n\n const query = new URLSearchParams(location.search);\n\n const after = query.get(\"after\");\n const before = query.get(\"before\");\n const limit = query.get(\"limit\");\n\n if (after) {\n params.after = after;\n }\n\n if (before) {\n params.before = before;\n }\n\n if (limit) {\n params.limit = parseInt(limit);\n }\n\n keys.forEach(key => {\n const value = query.get(key);\n if (typeof value !== \"string\") {\n return;\n }\n try {\n params[key] = JSON.parse(value);\n } catch (e) {\n /**\n * If we can't parse the value, it means it's a string.\n */\n // @ts-expect-error\n params[key] = value;\n }\n });\n return params;\n};\n"],"mappings":"AASA,MAAMA,IAAsB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC;AAE1D,eAAgBC,QAAmB,IAAa;EAC5C,MAAMC,MAAc,GAAG,CAAC,CAAC;EACzB,IAAI,CAACD,QAAQ,EAAE;IACX,OAAOC,MAAM;EACjB;EAEA,MAAMC,KAAK,GAAG,IAAIC,eAAe,CAACH,QAAQ,CAACI,MAAM,CAAC;EAElD,MAAMC,KAAK,GAAGH,KAAK,CAACI,GAAG,CAAC,OAAO,CAAC;EAChC,MAAMC,MAAM,GAAGL,KAAK,CAACI,GAAG,CAAC,QAAQ,CAAC;EAClC,MAAME,KAAK,GAAGN,KAAK,CAACI,GAAG,CAAC,OAAO,CAAC;EAEhC,IAAID,KAAK,EAAE;IACPJ,MAAM,CAACI,KAAK,GAAGA,KAAK;EACxB;EAEA,IAAIE,MAAM,EAAE;IACRN,MAAM,CAACM,MAAM,GAAGA,MAAM;EAC1B;EAEA,IAAIC,KAAK,EAAE;IACPP,MAAM,CAACO,KAAK,GAAGC,QAAQ,CAACD,KAAK,CAAC;EAClC;EAEAT,IAAI,CAACW,OAAO,CAACC,GAAG,IAAI;IAChB,MAAMC,KAAK,GAAGV,KAAK,CAACI,GAAG,CAACK,GAAG,CAAC;IAC5B,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;MAC3B;IACJ;IACA,IAAI;MACAX,MAAM,CAACU,GAAG,CAAC,GAAGE,IAAI,CAACC,KAAK,CAACF,KAAK,CAAC;IACnC,CAAC,CAAC,OAAOG,CAAC,EAAE;MACR;AACZ;AACA;MACY;MACAd,MAAM,CAACU,GAAG,CAAC,GAAGC,KAAK;IACvB;EACJ,CAAC,CAAC;EACF,OAAOX,MAAM;AACjB,CAAC","ignoreList":[]}
@@ -1,14 +0,0 @@
1
- interface Params {
2
- sort: string;
3
- search: string;
4
- where: Record<string, any>;
5
- }
6
- interface Location {
7
- search: string;
8
- }
9
- interface Options {
10
- history: Location[];
11
- location: Location;
12
- }
13
- declare const _default: (params: Params, options: Options) => void;
14
- export default _default;
@@ -1,26 +0,0 @@
1
- export default (params, options) => {
2
- const {
3
- history,
4
- location
5
- } = options;
6
- const paramsClone = Object.assign({}, params);
7
- ["sort", "search", "where"].forEach(key => {
8
- if (typeof paramsClone[key] === "object") {
9
- paramsClone[key] = JSON.stringify(paramsClone[key]);
10
- }
11
- });
12
- const keys = ["limit", "after", "before", "where", "search", "sort"];
13
- const query = new URLSearchParams(location.search);
14
- keys.forEach(key => {
15
- if (typeof paramsClone[key] !== "undefined") {
16
- query.set(key, paramsClone[key]);
17
- } else {
18
- query.delete(key);
19
- }
20
- });
21
- history.push({
22
- search: query.toString()
23
- });
24
- };
25
-
26
- //# sourceMappingURL=redirectToRouteWithQueryParams.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["params","options","history","location","paramsClone","Object","assign","forEach","key","JSON","stringify","keys","query","URLSearchParams","search","set","delete","push","toString"],"sources":["redirectToRouteWithQueryParams.ts"],"sourcesContent":["interface Params {\n sort: string;\n search: string;\n where: Record<string, any>;\n}\ninterface Location {\n search: string;\n}\ninterface Options {\n history: Location[];\n location: Location;\n}\nexport default (params: Params, options: Options): void => {\n const { history, location } = options;\n const paramsClone: Record<string, any> = Object.assign({}, params);\n\n [\"sort\", \"search\", \"where\"].forEach(key => {\n if (typeof paramsClone[key] === \"object\") {\n paramsClone[key] = JSON.stringify(paramsClone[key]);\n }\n });\n\n const keys: string[] = [\"limit\", \"after\", \"before\", \"where\", \"search\", \"sort\"];\n\n const query = new URLSearchParams(location.search);\n keys.forEach(key => {\n if (typeof paramsClone[key] !== \"undefined\") {\n query.set(key, paramsClone[key]);\n } else {\n query.delete(key);\n }\n });\n\n history.push({ search: query.toString() });\n};\n"],"mappings":"AAYA,eAAe,CAACA,MAAc,EAAEC,OAAgB,KAAW;EACvD,MAAM;IAAEC,OAAO;IAAEC;EAAS,CAAC,GAAGF,OAAO;EACrC,MAAMG,WAAgC,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEN,MAAM,CAAC;EAElE,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAACO,OAAO,CAACC,GAAG,IAAI;IACvC,IAAI,OAAOJ,WAAW,CAACI,GAAG,CAAC,KAAK,QAAQ,EAAE;MACtCJ,WAAW,CAACI,GAAG,CAAC,GAAGC,IAAI,CAACC,SAAS,CAACN,WAAW,CAACI,GAAG,CAAC,CAAC;IACvD;EACJ,CAAC,CAAC;EAEF,MAAMG,IAAc,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC;EAE9E,MAAMC,KAAK,GAAG,IAAIC,eAAe,CAACV,QAAQ,CAACW,MAAM,CAAC;EAClDH,IAAI,CAACJ,OAAO,CAACC,GAAG,IAAI;IAChB,IAAI,OAAOJ,WAAW,CAACI,GAAG,CAAC,KAAK,WAAW,EAAE;MACzCI,KAAK,CAACG,GAAG,CAACP,GAAG,EAAEJ,WAAW,CAACI,GAAG,CAAC,CAAC;IACpC,CAAC,MAAM;MACHI,KAAK,CAACI,MAAM,CAACR,GAAG,CAAC;IACrB;EACJ,CAAC,CAAC;EAEFN,OAAO,CAACe,IAAI,CAAC;IAAEH,MAAM,EAAEF,KAAK,CAACM,QAAQ,CAAC;EAAE,CAAC,CAAC;AAC9C,CAAC","ignoreList":[]}
@@ -1,40 +0,0 @@
1
- export type UseDataListParams = {
2
- load?: boolean;
3
- name: string;
4
- type: string;
5
- fields: string;
6
- limit?: number;
7
- sort?: {
8
- [key: string]: string;
9
- };
10
- where?: {
11
- [key: string]: any;
12
- };
13
- search?: {
14
- [key: string]: any;
15
- };
16
- };
17
- export type SearchParams = {
18
- query: string;
19
- operator?: "and" | "or";
20
- fields?: Array<string>;
21
- };
22
- export type UseDataListProps = {
23
- data: Record<string, any>[];
24
- meta: Record<string, any>;
25
- init: () => void;
26
- refresh: (params?: Record<string, any>) => void;
27
- delete: (id: string, options: Record<string, any>) => void;
28
- setPerPage: (perPage: number) => void;
29
- setPage: (page: number) => void;
30
- setSearch: (search: SearchParams | any) => void;
31
- setWhere: (where: Record<string, any>) => void;
32
- setSorters: (sort: Record<string, any>) => void;
33
- multiSelect: (item: Record<string, any>, value: boolean) => void;
34
- multiSelectAll: (value: boolean) => void;
35
- isMultiSelected: (item: Record<string, any>) => boolean;
36
- isAllMultiSelected: () => boolean;
37
- isNoneMultiSelected: () => boolean;
38
- getMultiSelected: () => Record<string, any>[];
39
- __loadParams: UseDataListParams;
40
- };
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type UseDataListParams = {\n load?: boolean;\n name: string;\n type: string;\n fields: string;\n limit?: number;\n sort?: {\n [key: string]: string;\n };\n where?: {\n [key: string]: any;\n };\n search?: {\n [key: string]: any;\n };\n};\n\nexport type SearchParams = {\n query: string;\n operator?: \"and\" | \"or\";\n fields?: Array<string>;\n};\n\nexport type UseDataListProps = {\n data: Record<string, any>[];\n meta: Record<string, any>;\n init: () => void;\n refresh: (params?: Record<string, any>) => void;\n delete: (id: string, options: Record<string, any>) => void;\n setPerPage: (perPage: number) => void;\n setPage: (page: number) => void;\n setSearch: (search: SearchParams | any) => void;\n setWhere: (where: Record<string, any>) => void;\n setSorters: (sort: Record<string, any>) => void;\n multiSelect: (item: Record<string, any>, value: boolean) => void;\n multiSelectAll: (value: boolean) => void;\n\n isMultiSelected: (item: Record<string, any>) => boolean;\n isAllMultiSelected: () => boolean;\n isNoneMultiSelected: () => boolean;\n getMultiSelected: () => Record<string, any>[];\n __loadParams: UseDataListParams;\n};\n"],"mappings":"","ignoreList":[]}
package/i18n/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"names":["default","i18n"],"sources":["index.ts"],"sourcesContent":["export { default as i18n } from \"./i18n\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,IAAI","ignoreList":[]}
package/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"names":["AddQuerySelectionPlugin","ApolloLinkPlugin","RoutePlugin","ApolloCacheObjectIdPlugin"],"sources":["index.ts"],"sourcesContent":["export { AddQuerySelectionPlugin } from \"./plugins/AddQuerySelectionPlugin\";\nexport { ApolloLinkPlugin } from \"./plugins/ApolloLinkPlugin\";\nexport { RoutePlugin } from \"./plugins/RoutePlugin\";\nexport {\n ApolloCacheObjectIdPlugin,\n type ApolloCacheObject\n} from \"./plugins/ApolloCacheObjectIdPlugin\";\n\n// Composition - we re-export this for ease of use\nexport * from \"@webiny/react-composition\";\nexport type { HigherOrderComponent, ComposeProps, ComposableFC } from \"@webiny/react-composition\";\n\n// App framework\nexport * from \"./App\";\nexport * from \"./AppContainer\";\nexport type { AppProps } from \"./App\";\nexport * from \"./core/Plugins\";\nexport * from \"./core/Plugin\";\nexport * from \"./core/Provider\";\nexport * from \"./core/DebounceRender\";\nexport * from \"./core/createProvider\";\nexport * from \"./core/createProviderPlugin\";\nexport * from \"./renderApp\";\nexport * from \"./utils/createGenericContext\";\n"],"mappings":"AAAA,SAASA,uBAAuB;AAChC,SAASC,gBAAgB;AACzB,SAASC,WAAW;AACpB,SACIC,yBAAyB;;AAI7B;AACA,cAAc,2BAA2B;AAGzC;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -1,22 +0,0 @@
1
- import { ApolloLink } from "apollo-link";
2
- import type { DocumentNode } from "graphql";
3
- import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
4
- declare module "graphql" {
5
- interface DocumentNode {
6
- __webiny__: Set<string>;
7
- }
8
- }
9
- interface Config {
10
- operationName: string;
11
- selectionPath: string;
12
- addSelection: DocumentNode;
13
- }
14
- export declare class AddQuerySelectionPlugin extends ApolloLinkPlugin {
15
- private readonly config;
16
- constructor(config: Config);
17
- createLink(): ApolloLink;
18
- addSelectionToQuery(operationName: string, document: DocumentNode): void;
19
- private isProcessed;
20
- private markProcessed;
21
- }
22
- export {};
@@ -1,72 +0,0 @@
1
- import { ApolloLink } from "apollo-link";
2
- import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
3
- export class AddQuerySelectionPlugin extends ApolloLinkPlugin {
4
- constructor(config) {
5
- super();
6
- this.config = config;
7
- }
8
- createLink() {
9
- return new ApolloLink((operation, forward) => {
10
- if (operation.operationName !== this.config.operationName) {
11
- return forward(operation);
12
- }
13
- this.addSelectionToQuery(operation.operationName, operation.query);
14
- return forward(operation);
15
- });
16
- }
17
- addSelectionToQuery(operationName, document) {
18
- if (operationName !== this.config.operationName) {
19
- return;
20
- }
21
-
22
- // If this plugin already processed the given document (documents are always passed by reference),
23
- // then we don't want to apply the selection again, to avoid adding duplicate selections.
24
- if (this.isProcessed(document)) {
25
- return;
26
- }
27
- this.markProcessed(document);
28
- const {
29
- addSelection,
30
- selectionPath
31
- } = this.config;
32
- const firstQueryDefinition = document.definitions[0];
33
- if (!firstQueryDefinition) {
34
- return;
35
- } else if (!firstQueryDefinition.selectionSet) {
36
- return;
37
- }
38
- let tree = firstQueryDefinition.selectionSet.selections;
39
- const fields = selectionPath.split(".");
40
- fieldLoop: for (const field of fields) {
41
- for (const selection of tree) {
42
- if (!selection.selectionSet) {
43
- continue;
44
- }
45
- if (selection.name.value === field) {
46
- tree = selection.selectionSet.selections;
47
- continue fieldLoop;
48
- }
49
- }
50
- // If we get here, it means we didn't find the necessary selection
51
- return;
52
- }
53
- /**
54
- * We must cast because there are a lot of types that are not intertwined and TS is complaining
55
- */
56
- tree.push(...addSelection.definitions[0].selectionSet.selections);
57
- }
58
- isProcessed(document) {
59
- if (!document.hasOwnProperty("__webiny__")) {
60
- document.__webiny__ = new Set();
61
- }
62
- return document.__webiny__.has(this.cacheKey);
63
- }
64
- markProcessed(document) {
65
- if (!document.hasOwnProperty("__webiny__")) {
66
- document.__webiny__ = new Set();
67
- }
68
- document.__webiny__.add(this.cacheKey);
69
- }
70
- }
71
-
72
- //# sourceMappingURL=AddQuerySelectionPlugin.js.map