@webiny/app 6.0.0-beta.0 → 6.0.0-rc.0

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 (435) hide show
  1. package/App.d.ts +6 -13
  2. package/App.js +70 -83
  3. package/App.js.map +1 -1
  4. package/AppContainer.d.ts +23 -0
  5. package/AppContainer.js +9 -0
  6. package/AppContainer.js.map +1 -0
  7. package/README.md +7 -15
  8. package/apollo-client/InMemoryCache.d.ts +3 -2
  9. package/apollo-client/InMemoryCache.js +16 -48
  10. package/apollo-client/InMemoryCache.js.map +1 -1
  11. package/apollo-client/IntrospectionFragmentMatcher.d.ts +2 -2
  12. package/apollo-client/IntrospectionFragmentMatcher.js +33 -50
  13. package/apollo-client/IntrospectionFragmentMatcher.js.map +1 -1
  14. package/components/Image.d.ts +1 -2
  15. package/components/Image.js +11 -19
  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/components/index.js.map +1 -1
  20. package/config/RouterConfig/Route.d.ts +29 -0
  21. package/config/RouterConfig/Route.js +33 -0
  22. package/config/RouterConfig/Route.js.map +1 -0
  23. package/config/RouterConfig.d.ts +31 -0
  24. package/config/RouterConfig.js +18 -0
  25. package/config/RouterConfig.js.map +1 -0
  26. package/config.d.ts +1 -1
  27. package/config.js +7 -13
  28. package/config.js.map +1 -1
  29. package/contexts/Ui/index.d.ts +2 -2
  30. package/contexts/Ui/index.js +28 -52
  31. package/contexts/Ui/index.js.map +1 -1
  32. package/core/DebounceRender.js +13 -24
  33. package/core/DebounceRender.js.map +1 -1
  34. package/core/Plugin.d.ts +1 -1
  35. package/core/Plugin.js +11 -19
  36. package/core/Plugin.js.map +1 -1
  37. package/core/Plugins.d.ts +1 -1
  38. package/core/Plugins.js +20 -25
  39. package/core/Plugins.js.map +1 -1
  40. package/core/Provider.d.ts +1 -1
  41. package/core/Provider.js +9 -13
  42. package/core/Provider.js.map +1 -1
  43. package/core/Routes.d.ts +2 -1
  44. package/core/Routes.js +13 -23
  45. package/core/Routes.js.map +1 -1
  46. package/core/createProvider.d.ts +7 -3
  47. package/core/createProvider.js +3 -9
  48. package/core/createProvider.js.map +1 -1
  49. package/core/createProviderPlugin.d.ts +1 -1
  50. package/core/createProviderPlugin.js +4 -10
  51. package/core/createProviderPlugin.js.map +1 -1
  52. package/errors/AuthenticationErrorEvent.d.ts +9 -0
  53. package/errors/AuthenticationErrorEvent.js +10 -0
  54. package/errors/AuthenticationErrorEvent.js.map +1 -0
  55. package/errors/NetworkErrorEvent.d.ts +15 -0
  56. package/errors/NetworkErrorEvent.js +10 -0
  57. package/errors/NetworkErrorEvent.js.map +1 -0
  58. package/errors/abstractions.d.ts +12 -0
  59. package/errors/abstractions.js +5 -0
  60. package/errors/abstractions.js.map +1 -0
  61. package/errors/index.d.ts +6 -0
  62. package/errors/index.js +6 -0
  63. package/errors/index.js.map +1 -0
  64. package/exports/admin/envConfig.d.ts +1 -0
  65. package/exports/admin/envConfig.js +3 -0
  66. package/exports/admin/envConfig.js.map +1 -0
  67. package/exports/admin/graphqlClient.d.ts +1 -0
  68. package/exports/admin/graphqlClient.js +3 -0
  69. package/exports/admin/graphqlClient.js.map +1 -0
  70. package/exports/admin/localStorage.d.ts +2 -0
  71. package/exports/admin/localStorage.js +4 -0
  72. package/exports/admin/localStorage.js.map +1 -0
  73. package/exports/admin/router.d.ts +4 -0
  74. package/exports/admin/router.js +6 -0
  75. package/exports/admin/router.js.map +1 -0
  76. package/exports/admin/security.d.ts +1 -0
  77. package/exports/admin/security.js +3 -0
  78. package/exports/admin/security.js.map +1 -0
  79. package/exports/admin.d.ts +6 -0
  80. package/exports/admin.js +8 -0
  81. package/exports/admin.js.map +1 -0
  82. package/features/envConfig/EnvConfig.d.ts +6 -0
  83. package/features/envConfig/EnvConfig.js +14 -0
  84. package/features/envConfig/EnvConfig.js.map +1 -0
  85. package/features/envConfig/abstractions.d.ts +27 -0
  86. package/features/envConfig/abstractions.js +4 -0
  87. package/features/envConfig/abstractions.js.map +1 -0
  88. package/features/envConfig/feature.d.ts +17 -0
  89. package/features/envConfig/feature.js +14 -0
  90. package/features/envConfig/feature.js.map +1 -0
  91. package/features/envConfig/index.d.ts +1 -0
  92. package/features/envConfig/index.js +3 -0
  93. package/features/envConfig/index.js.map +1 -0
  94. package/features/eventPublisher/EventPublisher.d.ts +8 -0
  95. package/features/eventPublisher/EventPublisher.js +27 -0
  96. package/features/eventPublisher/EventPublisher.js.map +1 -0
  97. package/features/eventPublisher/abstractions.d.ts +18 -0
  98. package/features/eventPublisher/abstractions.js +14 -0
  99. package/features/eventPublisher/abstractions.js.map +1 -0
  100. package/features/eventPublisher/feature.d.ts +1 -0
  101. package/features/eventPublisher/feature.js +11 -0
  102. package/features/eventPublisher/feature.js.map +1 -0
  103. package/features/eventPublisher/index.d.ts +3 -0
  104. package/features/eventPublisher/index.js +4 -0
  105. package/features/eventPublisher/index.js.map +1 -0
  106. package/features/graphqlClient/AuthenticationErrorPublishing.d.ts +13 -0
  107. package/features/graphqlClient/AuthenticationErrorPublishing.js +35 -0
  108. package/features/graphqlClient/AuthenticationErrorPublishing.js.map +1 -0
  109. package/features/graphqlClient/BatchingGraphQLClient.d.ts +18 -0
  110. package/features/graphqlClient/BatchingGraphQLClient.js +164 -0
  111. package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -0
  112. package/features/graphqlClient/FetchGraphQLClient.d.ts +10 -0
  113. package/features/graphqlClient/FetchGraphQLClient.js +62 -0
  114. package/features/graphqlClient/FetchGraphQLClient.js.map +1 -0
  115. package/features/graphqlClient/NetworkErrorPublishing.d.ts +14 -0
  116. package/features/graphqlClient/NetworkErrorPublishing.js +55 -0
  117. package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -0
  118. package/features/graphqlClient/RequestValue.d.ts +20 -0
  119. package/features/graphqlClient/RequestValue.js +42 -0
  120. package/features/graphqlClient/RequestValue.js.map +1 -0
  121. package/features/graphqlClient/RetryGraphQLClient.d.ts +18 -0
  122. package/features/graphqlClient/RetryGraphQLClient.js +54 -0
  123. package/features/graphqlClient/RetryGraphQLClient.js.map +1 -0
  124. package/features/graphqlClient/__tests__/GraphQLClient.test.d.ts +1 -0
  125. package/features/graphqlClient/__tests__/GraphQLClient.test.js +350 -0
  126. package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -0
  127. package/features/graphqlClient/abstractions.d.ts +17 -0
  128. package/features/graphqlClient/abstractions.js +4 -0
  129. package/features/graphqlClient/abstractions.js.map +1 -0
  130. package/features/graphqlClient/feature.d.ts +6 -0
  131. package/features/graphqlClient/feature.js +31 -0
  132. package/features/graphqlClient/feature.js.map +1 -0
  133. package/features/graphqlClient/index.d.ts +1 -0
  134. package/features/graphqlClient/index.js +3 -0
  135. package/features/graphqlClient/index.js.map +1 -0
  136. package/features/graphqlClient/types.d.ts +5 -0
  137. package/features/graphqlClient/types.js +3 -0
  138. package/features/graphqlClient/types.js.map +1 -0
  139. package/features/localStorage/BrowserLocalStorageGateway.d.ts +9 -0
  140. package/features/localStorage/BrowserLocalStorageGateway.js +68 -0
  141. package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -0
  142. package/features/localStorage/LocalStorage.d.ts +12 -0
  143. package/features/localStorage/LocalStorage.js +31 -0
  144. package/features/localStorage/LocalStorage.js.map +1 -0
  145. package/features/localStorage/LocalStorageRepository.d.ts +20 -0
  146. package/features/localStorage/LocalStorageRepository.js +95 -0
  147. package/features/localStorage/LocalStorageRepository.js.map +1 -0
  148. package/features/localStorage/abstractions.d.ts +48 -0
  149. package/features/localStorage/abstractions.js +19 -0
  150. package/features/localStorage/abstractions.js.map +1 -0
  151. package/features/localStorage/feature.d.ts +12 -0
  152. package/features/localStorage/feature.js +34 -0
  153. package/features/localStorage/feature.js.map +1 -0
  154. package/features/localStorage/index.d.ts +1 -0
  155. package/features/localStorage/index.js +3 -0
  156. package/features/localStorage/index.js.map +1 -0
  157. package/features/router/HistoryRouterGateway.d.ts +18 -0
  158. package/features/router/HistoryRouterGateway.js +82 -0
  159. package/features/router/HistoryRouterGateway.js.map +1 -0
  160. package/features/router/HistoryRouterGateway.test.d.ts +1 -0
  161. package/features/router/HistoryRouterGateway.test.js +204 -0
  162. package/features/router/HistoryRouterGateway.test.js.map +1 -0
  163. package/features/router/Route.d.ts +19 -0
  164. package/features/router/Route.js +59 -0
  165. package/features/router/Route.js.map +1 -0
  166. package/features/router/RouteUrl.d.ts +85 -0
  167. package/features/router/RouteUrl.js +232 -0
  168. package/features/router/RouteUrl.js.map +1 -0
  169. package/features/router/Router.d.ts +45 -0
  170. package/features/router/Router.js +129 -0
  171. package/features/router/Router.js.map +1 -0
  172. package/features/router/RouterPresenter.d.ts +17 -0
  173. package/features/router/RouterPresenter.js +45 -0
  174. package/features/router/RouterPresenter.js.map +1 -0
  175. package/features/router/RouterRepository.d.ts +21 -0
  176. package/features/router/RouterRepository.js +71 -0
  177. package/features/router/RouterRepository.js.map +1 -0
  178. package/features/router/RouterRepository.test.d.ts +1 -0
  179. package/features/router/RouterRepository.test.js +154 -0
  180. package/features/router/RouterRepository.test.js.map +1 -0
  181. package/features/router/abstractions.d.ts +68 -0
  182. package/features/router/abstractions.js +15 -0
  183. package/features/router/abstractions.js.map +1 -0
  184. package/features/router/feature.d.ts +4 -0
  185. package/features/router/feature.js +18 -0
  186. package/features/router/feature.js.map +1 -0
  187. package/features/router/index.d.ts +1 -0
  188. package/features/router/index.js +3 -0
  189. package/features/router/index.js.map +1 -0
  190. package/helpers/InterfaceGenerator/date.d.ts +15 -0
  191. package/helpers/InterfaceGenerator/date.js +3 -0
  192. package/helpers/InterfaceGenerator/date.js.map +1 -0
  193. package/helpers/InterfaceGenerator/id.d.ts +23 -0
  194. package/helpers/InterfaceGenerator/id.js +3 -0
  195. package/helpers/InterfaceGenerator/id.js.map +1 -0
  196. package/helpers/InterfaceGenerator/identity.d.ts +10 -0
  197. package/helpers/InterfaceGenerator/identity.js +3 -0
  198. package/helpers/InterfaceGenerator/identity.js.map +1 -0
  199. package/helpers/InterfaceGenerator/index.d.ts +5 -0
  200. package/helpers/InterfaceGenerator/index.js +3 -0
  201. package/helpers/InterfaceGenerator/index.js.map +1 -0
  202. package/helpers/InterfaceGenerator/numeric.d.ts +12 -0
  203. package/helpers/InterfaceGenerator/numeric.js +3 -0
  204. package/helpers/InterfaceGenerator/numeric.js.map +1 -0
  205. package/helpers/InterfaceGenerator/truthful.d.ts +7 -0
  206. package/helpers/InterfaceGenerator/truthful.js +3 -0
  207. package/helpers/InterfaceGenerator/truthful.js.map +1 -0
  208. package/hooks/useAutocomplete/index.d.ts +1 -1
  209. package/hooks/useAutocomplete/index.js +1 -12
  210. package/hooks/useAutocomplete/index.js.map +1 -1
  211. package/hooks/useAutocomplete/useAutocomplete.d.ts +1 -1
  212. package/hooks/useAutocomplete/useAutocomplete.js +6 -16
  213. package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
  214. package/hooks/useDataList/functions/getData.js +2 -11
  215. package/hooks/useDataList/functions/getData.js.map +1 -1
  216. package/hooks/useDataList/functions/getError.js +2 -11
  217. package/hooks/useDataList/functions/getError.js.map +1 -1
  218. package/hooks/useDataList/functions/getMeta.js +2 -11
  219. package/hooks/useDataList/functions/getMeta.js.map +1 -1
  220. package/hooks/useDataList/functions/index.d.ts +3 -3
  221. package/hooks/useDataList/functions/index.js +3 -27
  222. package/hooks/useDataList/functions/index.js.map +1 -1
  223. package/hooks/useDataList/functions/searchDataByKey.js +4 -10
  224. package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
  225. package/hooks/useDataList/index.d.ts +1 -1
  226. package/hooks/useDataList/index.js +1 -12
  227. package/hooks/useDataList/index.js.map +1 -1
  228. package/hooks/useDataList/useDataList.d.ts +2 -3
  229. package/hooks/useDataList/useDataList.js +74 -94
  230. package/hooks/useDataList/useDataList.js.map +1 -1
  231. package/hooks/useDataList/utils/index.d.ts +1 -2
  232. package/hooks/useDataList/utils/index.js +1 -20
  233. package/hooks/useDataList/utils/index.js.map +1 -1
  234. package/hooks/useDataList/utils/prepareLoadListParams.js +10 -16
  235. package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
  236. package/hooks/useHandler.js +7 -12
  237. package/hooks/useHandler.js.map +1 -1
  238. package/hooks/useHandlers.d.ts +3 -3
  239. package/hooks/useHandlers.js +11 -17
  240. package/hooks/useHandlers.js.map +1 -1
  241. package/hooks/useRegisterLegacyPlugin.d.ts +2 -0
  242. package/hooks/useRegisterLegacyPlugin.js +11 -0
  243. package/hooks/useRegisterLegacyPlugin.js.map +1 -0
  244. package/hooks/useUi.d.ts +1 -1
  245. package/hooks/useUi.js +4 -10
  246. package/hooks/useUi.js.map +1 -1
  247. package/i18n/i18n.js +5 -13
  248. package/i18n/i18n.js.map +1 -1
  249. package/i18n/index.d.ts +1 -1
  250. package/i18n/index.js +1 -13
  251. package/i18n/index.js.map +1 -1
  252. package/index.d.ts +23 -14
  253. package/index.js +25 -165
  254. package/index.js.map +1 -1
  255. package/package.json +26 -29
  256. package/plugins/AddQuerySelectionPlugin.d.ts +2 -2
  257. package/plugins/AddQuerySelectionPlugin.js +61 -107
  258. package/plugins/AddQuerySelectionPlugin.js.map +1 -1
  259. package/plugins/ApolloCacheObjectIdPlugin.js +12 -31
  260. package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
  261. package/plugins/ApolloDynamicLink.d.ts +3 -2
  262. package/plugins/ApolloDynamicLink.js +19 -46
  263. package/plugins/ApolloDynamicLink.js.map +1 -1
  264. package/plugins/ApolloLinkPlugin.d.ts +1 -1
  265. package/plugins/ApolloLinkPlugin.js +18 -37
  266. package/plugins/ApolloLinkPlugin.js.map +1 -1
  267. package/plugins/ConsoleLinkPlugin.d.ts +1 -1
  268. package/plugins/ConsoleLinkPlugin.js +20 -41
  269. package/plugins/ConsoleLinkPlugin.js.map +1 -1
  270. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +8 -13
  271. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +35 -58
  272. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
  273. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.d.ts +14 -0
  274. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js +31 -0
  275. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js.map +1 -0
  276. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.d.ts +2 -0
  277. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js +31 -0
  278. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js.map +1 -0
  279. package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +4 -5
  280. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +68 -12
  281. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
  282. package/plugins/NetworkErrorLinkPlugin/Typography.d.ts +8 -0
  283. package/plugins/NetworkErrorLinkPlugin/Typography.js +18 -0
  284. package/plugins/NetworkErrorLinkPlugin/Typography.js.map +1 -0
  285. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +3 -3
  286. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +10 -20
  287. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
  288. package/plugins/NetworkErrorLinkPlugin.d.ts +4 -1
  289. package/plugins/NetworkErrorLinkPlugin.js +60 -37
  290. package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
  291. package/plugins/OmitTypenameLinkPlugin.d.ts +1 -1
  292. package/plugins/OmitTypenameLinkPlugin.js +11 -30
  293. package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
  294. package/plugins/TenantHeaderLinkPlugin.d.ts +3 -3
  295. package/plugins/TenantHeaderLinkPlugin.js +29 -48
  296. package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
  297. package/plugins/components/Image.d.ts +6 -0
  298. package/plugins/components/Image.js +19 -0
  299. package/plugins/components/Image.js.map +1 -0
  300. package/plugins/image.d.ts +1 -1
  301. package/plugins/image.js +46 -53
  302. package/plugins/image.js.map +1 -1
  303. package/plugins/index.d.ts +5 -5
  304. package/plugins/index.js +31 -53
  305. package/plugins/index.js.map +1 -1
  306. package/presentation/localStorage/index.d.ts +3 -0
  307. package/presentation/localStorage/index.js +5 -0
  308. package/presentation/localStorage/index.js.map +1 -0
  309. package/presentation/localStorage/useLocalStorage.d.ts +6 -0
  310. package/presentation/localStorage/useLocalStorage.js +21 -0
  311. package/presentation/localStorage/useLocalStorage.js.map +1 -0
  312. package/presentation/localStorage/useLocalStorageValue.d.ts +1 -0
  313. package/presentation/localStorage/useLocalStorageValue.js +20 -0
  314. package/presentation/localStorage/useLocalStorageValue.js.map +1 -0
  315. package/presentation/localStorage/useLocalStorageValues.d.ts +5 -0
  316. package/presentation/localStorage/useLocalStorageValues.js +39 -0
  317. package/presentation/localStorage/useLocalStorageValues.js.map +1 -0
  318. package/presentation/router/RouteElementRegistry.d.ts +14 -0
  319. package/presentation/router/RouteElementRegistry.js +32 -0
  320. package/presentation/router/RouteElementRegistry.js.map +1 -0
  321. package/presentation/router/abstractions.d.ts +13 -0
  322. package/presentation/router/abstractions.js +4 -0
  323. package/presentation/router/abstractions.js.map +1 -0
  324. package/presentation/router/components/RouteContent.d.ts +2 -0
  325. package/presentation/router/components/RouteContent.js +17 -0
  326. package/presentation/router/components/RouteContent.js.map +1 -0
  327. package/presentation/router/components/RouteLink.d.ts +50 -0
  328. package/presentation/router/components/RouteLink.js +22 -0
  329. package/presentation/router/components/RouteLink.js.map +1 -0
  330. package/presentation/router/components/SimpleLink.d.ts +44 -0
  331. package/presentation/router/components/SimpleLink.js +30 -0
  332. package/presentation/router/components/SimpleLink.js.map +1 -0
  333. package/presentation/router/hooks/useRoute.d.ts +6 -0
  334. package/presentation/router/hooks/useRoute.js +30 -0
  335. package/presentation/router/hooks/useRoute.js.map +1 -0
  336. package/presentation/router/hooks/useRouter.d.ts +7 -0
  337. package/presentation/router/hooks/useRouter.js +26 -0
  338. package/presentation/router/hooks/useRouter.js.map +1 -0
  339. package/presentation/router/index.d.ts +4 -0
  340. package/presentation/router/index.js +5 -0
  341. package/presentation/router/index.js.map +1 -0
  342. package/presentation/router/types.d.ts +5 -0
  343. package/presentation/router/types.js +3 -0
  344. package/presentation/router/types.js.map +1 -0
  345. package/react-butterfiles/Files.d.ts +69 -0
  346. package/react-butterfiles/Files.js +227 -0
  347. package/react-butterfiles/Files.js.map +1 -0
  348. package/react-butterfiles/file.todo +1 -0
  349. package/react-butterfiles/index.d.ts +2 -0
  350. package/react-butterfiles/index.js +4 -0
  351. package/react-butterfiles/index.js.map +1 -0
  352. package/react-butterfiles/utils/generateId.d.ts +1 -0
  353. package/react-butterfiles/utils/generateId.js +5 -0
  354. package/react-butterfiles/utils/generateId.js.map +1 -0
  355. package/react-butterfiles/utils/readFileContent.d.ts +1 -0
  356. package/react-butterfiles/utils/readFileContent.js +15 -0
  357. package/react-butterfiles/utils/readFileContent.js.map +1 -0
  358. package/renderApp.d.ts +1 -1
  359. package/renderApp.js +4 -11
  360. package/renderApp.js.map +1 -1
  361. package/router.d.ts +5 -0
  362. package/router.js +8 -0
  363. package/router.js.map +1 -0
  364. package/shared/di/DiContainerProvider.d.ts +8 -0
  365. package/shared/di/DiContainerProvider.js +17 -0
  366. package/shared/di/DiContainerProvider.js.map +1 -0
  367. package/shared/di/createFeature.d.ts +11 -0
  368. package/shared/di/createFeature.js +11 -0
  369. package/shared/di/createFeature.js.map +1 -0
  370. package/shared/di/useFeature.d.ts +2 -0
  371. package/shared/di/useFeature.js +18 -0
  372. package/shared/di/useFeature.js.map +1 -0
  373. package/types.d.ts +16 -13
  374. package/types.js +1 -12
  375. package/types.js.map +1 -1
  376. package/utils/createGenericContext.d.ts +13 -0
  377. package/utils/createGenericContext.js +25 -0
  378. package/utils/createGenericContext.js.map +1 -0
  379. package/utils/createHashing.d.ts +2 -0
  380. package/utils/createHashing.js +18 -0
  381. package/utils/createHashing.js.map +1 -0
  382. package/utils/index.d.ts +2 -8
  383. package/utils/index.js +2 -93
  384. package/utils/index.js.map +1 -1
  385. package/utils/legacyPluginToReactComponent.d.ts +7 -0
  386. package/utils/legacyPluginToReactComponent.js +14 -0
  387. package/utils/legacyPluginToReactComponent.js.map +1 -0
  388. package/components/Routes.d.ts +0 -2
  389. package/components/Routes.js +0 -46
  390. package/components/Routes.js.map +0 -1
  391. package/components/View.d.ts +0 -8
  392. package/components/View.js +0 -31
  393. package/components/View.js.map +0 -1
  394. package/core/AddRoute.d.ts +0 -17
  395. package/core/AddRoute.js +0 -21
  396. package/core/AddRoute.js.map +0 -1
  397. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +0 -14
  398. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +0 -30
  399. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +0 -1
  400. package/hooks/useDataList/utils/types.d.ts +0 -40
  401. package/hooks/useDataList/utils/types.js +0 -7
  402. package/hooks/useDataList/utils/types.js.map +0 -1
  403. package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -10
  404. package/plugins/LocaleHeaderLinkPlugin.js +0 -49
  405. package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
  406. package/plugins/RoutePlugin.d.ts +0 -12
  407. package/plugins/RoutePlugin.js +0 -35
  408. package/plugins/RoutePlugin.js.map +0 -1
  409. package/plugins/ViewPlugin.d.ts +0 -14
  410. package/plugins/ViewPlugin.js +0 -40
  411. package/plugins/ViewPlugin.js.map +0 -1
  412. package/utils/getApiUrl.d.ts +0 -1
  413. package/utils/getApiUrl.js +0 -12
  414. package/utils/getApiUrl.js.map +0 -1
  415. package/utils/getGqlApiUrl.d.ts +0 -1
  416. package/utils/getGqlApiUrl.js +0 -12
  417. package/utils/getGqlApiUrl.js.map +0 -1
  418. package/utils/getHeadlessCmsGqlApiUrl.d.ts +0 -5
  419. package/utils/getHeadlessCmsGqlApiUrl.js +0 -18
  420. package/utils/getHeadlessCmsGqlApiUrl.js.map +0 -1
  421. package/utils/getLocaleCode.d.ts +0 -6
  422. package/utils/getLocaleCode.js +0 -43
  423. package/utils/getLocaleCode.js.map +0 -1
  424. package/utils/getPrerenderId.d.ts +0 -6
  425. package/utils/getPrerenderId.js +0 -11
  426. package/utils/getPrerenderId.js.map +0 -1
  427. package/utils/getTenantId.d.ts +0 -6
  428. package/utils/getTenantId.js +0 -35
  429. package/utils/getTenantId.js.map +0 -1
  430. package/utils/isLocalhost.d.ts +0 -1
  431. package/utils/isLocalhost.js +0 -15
  432. package/utils/isLocalhost.js.map +0 -1
  433. package/utils/isPrerendering.d.ts +0 -1
  434. package/utils/isPrerendering.js +0 -11
  435. package/utils/isPrerendering.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BrowserLocalStorageGateway","get","key","value","window","localStorage","getItem","JSON","parse","set","serialized","stringify","setItem","dispatchEvent","CustomEvent","detail","action","remove","removeItem","clear","getAll","result","i","length","val","subscribe","listener","handler","ev","StorageEvent","addEventListener","removeEventListener"],"sources":["BrowserLocalStorageGateway.ts"],"sourcesContent":["import { ILocalStorageGateway } from \"./abstractions.js\";\n\nexport class BrowserLocalStorageGateway implements ILocalStorageGateway {\n get<T = string>(key: string): T | null {\n const value = window.localStorage.getItem(key);\n try {\n return value ? (JSON.parse(value) as T) : null;\n } catch {\n return value as unknown as T;\n }\n }\n\n set<T = string>(key: string, value: T): void {\n const serialized = typeof value === \"string\" ? value : JSON.stringify(value);\n window.localStorage.setItem(key, serialized);\n\n // Dispatch local event so same-tab listeners are notified.\n window.dispatchEvent(\n new CustomEvent(\"localstorage:changed\", {\n detail: { key, value, action: \"set\" }\n })\n );\n }\n\n remove(key: string): void {\n window.localStorage.removeItem(key);\n window.dispatchEvent(\n new CustomEvent(\"localstorage:changed\", {\n detail: { key, action: \"remove\" }\n })\n );\n }\n\n clear(): void {\n window.localStorage.clear();\n window.dispatchEvent(\n new CustomEvent(\"localstorage:changed\", {\n detail: { action: \"clear\" }\n })\n );\n }\n\n getAll(): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (let i = 0; i < window.localStorage.length; i++) {\n const key = window.localStorage.key(i)!;\n const val = this.get(key);\n if (val !== null) {\n result[key] = val;\n }\n }\n return result;\n }\n\n // Subscribe to changes (cross-tab + same-tab)\n subscribe(listener: (event: StorageEvent | CustomEvent) => void): () => void {\n const handler = (ev: Event) => {\n if (ev instanceof StorageEvent || ev instanceof CustomEvent) {\n listener(ev);\n }\n };\n window.addEventListener(\"storage\", handler);\n window.addEventListener(\"localstorage:changed\", handler as any);\n\n return () => {\n window.removeEventListener(\"storage\", handler);\n window.removeEventListener(\"localstorage:changed\", handler as any);\n };\n }\n}\n"],"mappings":"AAEA,OAAO,MAAMA,0BAA0B,CAAiC;EACpEC,GAAGA,CAAaC,GAAW,EAAY;IACnC,MAAMC,KAAK,GAAGC,MAAM,CAACC,YAAY,CAACC,OAAO,CAACJ,GAAG,CAAC;IAC9C,IAAI;MACA,OAAOC,KAAK,GAAII,IAAI,CAACC,KAAK,CAACL,KAAK,CAAC,GAAS,IAAI;IAClD,CAAC,CAAC,MAAM;MACJ,OAAOA,KAAK;IAChB;EACJ;EAEAM,GAAGA,CAAaP,GAAW,EAAEC,KAAQ,EAAQ;IACzC,MAAMO,UAAU,GAAG,OAAOP,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAGI,IAAI,CAACI,SAAS,CAACR,KAAK,CAAC;IAC5EC,MAAM,CAACC,YAAY,CAACO,OAAO,CAACV,GAAG,EAAEQ,UAAU,CAAC;;IAE5C;IACAN,MAAM,CAACS,aAAa,CAChB,IAAIC,WAAW,CAAC,sBAAsB,EAAE;MACpCC,MAAM,EAAE;QAAEb,GAAG;QAAEC,KAAK;QAAEa,MAAM,EAAE;MAAM;IACxC,CAAC,CACL,CAAC;EACL;EAEAC,MAAMA,CAACf,GAAW,EAAQ;IACtBE,MAAM,CAACC,YAAY,CAACa,UA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;MAC9CvB,MAAM,CAAC2B,mBAAmB,CAAC,sBAAsB,EAAEJ,OAAc,CAAC;IACtE,CAAC;EACL;AACJ","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ import { LocalStorage as LocalStorageAbstraction, LocalStorageRepository } from "./abstractions.js";
2
+ declare class LocalStorageImpl implements LocalStorageAbstraction.Interface {
3
+ private readonly repo;
4
+ constructor(repo: LocalStorageRepository.Interface);
5
+ get<T = string>(key: string): T | undefined;
6
+ set<T = string>(key: string, value: T): void;
7
+ remove(key: string): void;
8
+ clear(): void;
9
+ keys(): string[];
10
+ }
11
+ export declare const LocalStorage: import("@webiny/di").Implementation<typeof LocalStorageImpl>;
12
+ export {};
@@ -0,0 +1,31 @@
1
+ import { makeAutoObservable } from "mobx";
2
+ import { LocalStorage as LocalStorageAbstraction, LocalStorageRepository } from "./abstractions.js";
3
+ import { createImplementation } from "@webiny/di";
4
+ class LocalStorageImpl {
5
+ constructor(repo) {
6
+ this.repo = repo;
7
+ makeAutoObservable(this);
8
+ }
9
+ get(key) {
10
+ return this.repo.get(key);
11
+ }
12
+ set(key, value) {
13
+ this.repo.set(key, value);
14
+ }
15
+ remove(key) {
16
+ this.repo.remove(key);
17
+ }
18
+ clear() {
19
+ this.repo.clear();
20
+ }
21
+ keys() {
22
+ return this.repo.keys();
23
+ }
24
+ }
25
+ export const LocalStorage = createImplementation({
26
+ abstraction: LocalStorageAbstraction,
27
+ implementation: LocalStorageImpl,
28
+ dependencies: [LocalStorageRepository]
29
+ });
30
+
31
+ //# sourceMappingURL=LocalStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["makeAutoObservable","LocalStorage","LocalStorageAbstraction","LocalStorageRepository","createImplementation","LocalStorageImpl","constructor","repo","get","key","set","value","remove","clear","keys","abstraction","implementation","dependencies"],"sources":["LocalStorage.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\nimport { LocalStorage as LocalStorageAbstraction, LocalStorageRepository } from \"./abstractions.js\";\nimport { createImplementation } from \"@webiny/di\";\n\nclass LocalStorageImpl implements LocalStorageAbstraction.Interface {\n constructor(private readonly repo: LocalStorageRepository.Interface) {\n makeAutoObservable(this);\n }\n\n get<T = string>(key: string) {\n return this.repo.get<T>(key);\n }\n set<T = string>(key: string, value: T) {\n this.repo.set(key, value);\n }\n remove(key: string) {\n this.repo.remove(key);\n }\n clear() {\n this.repo.clear();\n }\n keys() {\n return this.repo.keys();\n }\n}\n\nexport const LocalStorage = createImplementation({\n abstraction: LocalStorageAbstraction,\n implementation: LocalStorageImpl,\n dependencies: [LocalStorageRepository]\n});\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,MAAM;AACzC,SAASC,YAAY,IAAIC,uBAAuB,EAAEC,sBAAsB;AACxE,SAASC,oBAAoB,QAAQ,YAAY;AAEjD,MAAMC,gBAAgB,CAA8C;EAChEC,WAAWA,CAAkBC,IAAsC,EAAE;IAAA,KAAxCA,IAAsC,GAAtCA,IAAsC;IAC/DP,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEAQ,GAAGA,CAAaC,GAAW,EAAE;IACzB,OAAO,IAAI,CAACF,IAAI,CAACC,GAAG,CAAIC,GAAG,CAAC;EAChC;EACAC,GAAGA,CAAaD,GAAW,EAAEE,KAAQ,EAAE;IACnC,IAAI,CAACJ,IAAI,CAACG,GAAG,CAACD,GAAG,EAAEE,KAAK,CAAC;EAC7B;EACAC,MAAMA,CAACH,GAAW,EAAE;IAChB,IAAI,CAACF,IAAI,CAACK,MAAM,CAACH,GAAG,CAAC;EACzB;EACAI,KAAKA,CAAA,EAAG;IACJ,IAAI,CAACN,IAAI,CAACM,KAAK,CAAC,CAAC;EACrB;EACAC,IAAIA,CAAA,EAAG;IACH,OAAO,IAAI,CAACP,IAAI,CAACO,IAAI,CAAC,CAAC;EAC3B;AACJ;AAEA,OAAO,MAAMb,YAAY,GAAGG,oBAAoB,CAAC;EAC7CW,WAAW,EAAEb,uBAAuB;EACpCc,cAAc,EAAEX,gBAAgB;EAChCY,YAAY,EAAE,CAACd,sBAAsB;AACzC,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ import { LocalStorageRepository as LocalStorageRepositoryAbstraction, LocalStorageConfig, LocalStorageGateway } from "./abstractions.js";
2
+ export declare class LocalStorageRepositoryImpl implements LocalStorageRepositoryAbstraction.Interface {
3
+ private gateway;
4
+ private readonly prefix;
5
+ private store;
6
+ private unsubscribe?;
7
+ constructor(gateway: LocalStorageGateway.Interface, config: LocalStorageConfig.Interface);
8
+ private withPrefix;
9
+ private stripPrefix;
10
+ private bootstrap;
11
+ private subscribeToChanges;
12
+ destroy(): void;
13
+ has(key: string): boolean;
14
+ get<T = string>(key: string): T | undefined;
15
+ set<T = string>(key: string, value: T): void;
16
+ remove(key: string): void;
17
+ clear(): void;
18
+ keys(): string[];
19
+ }
20
+ export declare const LocalStorageRepository: import("@webiny/di").Implementation<typeof LocalStorageRepositoryImpl>;
@@ -0,0 +1,95 @@
1
+ import { makeAutoObservable, runInAction } from "mobx";
2
+ import { LocalStorageRepository as LocalStorageRepositoryAbstraction, LocalStorageConfig, LocalStorageGateway } from "./abstractions.js";
3
+ import { createImplementation } from "@webiny/di";
4
+ export class LocalStorageRepositoryImpl {
5
+ store = new Map();
6
+ constructor(gateway, config) {
7
+ this.gateway = gateway;
8
+ this.prefix = config.prefix || "";
9
+ makeAutoObservable(this);
10
+ this.bootstrap();
11
+ this.subscribeToChanges();
12
+ }
13
+ withPrefix(key) {
14
+ return this.prefix ? `${this.prefix}:${key}` : key;
15
+ }
16
+ stripPrefix(key) {
17
+ return this.prefix ? key.replace(new RegExp(`^${this.prefix}:`), "") : key;
18
+ }
19
+ bootstrap() {
20
+ const all = this.gateway.getAll();
21
+ for (const [key, value] of Object.entries(all)) {
22
+ if (!this.prefix || key.startsWith(this.prefix + ":")) {
23
+ this.store.set(this.stripPrefix(key), value);
24
+ }
25
+ }
26
+ }
27
+ subscribeToChanges() {
28
+ this.unsubscribe = this.gateway.subscribe(ev => {
29
+ runInAction(() => {
30
+ if (ev instanceof StorageEvent && ev.key) {
31
+ if (!this.prefix || ev.key.startsWith(this.prefix + ":")) {
32
+ const cleanKey = this.stripPrefix(ev.key);
33
+ if (ev.newValue !== null) {
34
+ try {
35
+ this.store.set(cleanKey, JSON.parse(ev.newValue));
36
+ } catch {
37
+ this.store.set(cleanKey, ev.newValue);
38
+ }
39
+ } else {
40
+ this.store.delete(cleanKey);
41
+ }
42
+ }
43
+ }
44
+ if (ev instanceof CustomEvent) {
45
+ const {
46
+ key,
47
+ value,
48
+ action
49
+ } = ev.detail;
50
+ if (!this.prefix || key.startsWith(this.prefix + ":")) {
51
+ const cleanKey = this.stripPrefix(key);
52
+ if (action === "set") {
53
+ this.store.set(cleanKey, value);
54
+ }
55
+ if (action === "remove") {
56
+ this.store.delete(cleanKey);
57
+ }
58
+ if (action === "clear") {
59
+ this.store.clear();
60
+ }
61
+ }
62
+ }
63
+ });
64
+ });
65
+ }
66
+ destroy() {
67
+ this.unsubscribe?.();
68
+ }
69
+ has(key) {
70
+ return this.store.has(key);
71
+ }
72
+ get(key) {
73
+ return this.store.get(key);
74
+ }
75
+ set(key, value) {
76
+ this.gateway.set(this.withPrefix(key), value);
77
+ }
78
+ remove(key) {
79
+ this.gateway.remove(this.withPrefix(key));
80
+ }
81
+ clear() {
82
+ this.gateway.clear();
83
+ this.store.clear();
84
+ }
85
+ keys() {
86
+ return Array.from(this.store.keys());
87
+ }
88
+ }
89
+ export const LocalStorageRepository = createImplementation({
90
+ abstraction: LocalStorageRepositoryAbstraction,
91
+ implementation: LocalStorageRepositoryImpl,
92
+ dependencies: [LocalStorageGateway, LocalStorageConfig]
93
+ });
94
+
95
+ //# sourceMappingURL=LocalStorageRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["makeAutoObservable","runInAction","LocalStorageRepository","LocalStorageRepositoryAbstraction","LocalStorageConfig","LocalStorageGateway","createImplementation","LocalStorageRepositoryImpl","store","Map","constructor","gateway","config","prefix","bootstrap","subscribeToChanges","withPrefix","key","stripPrefix","replace","RegExp","all","getAll","value","Object","entries","startsWith","set","unsubscribe","subscribe","ev","StorageEvent","cleanKey","newValue","JSON","parse","delete","CustomEvent","action","detail","clear","destroy","has","get","remove","keys","Array","from","abstraction","implementation","dependencies"],"sources":["LocalStorageRepository.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport {\n LocalStorageRepository as LocalStorageRepositoryAbstraction,\n LocalStorageConfig,\n LocalStorageGateway\n} from \"./abstractions.js\";\nimport { createImplementation } from \"@webiny/di\";\n\nexport class LocalStorageRepositoryImpl implements LocalStorageRepositoryAbstraction.Interface {\n private readonly prefix: string;\n private store = new Map<string, unknown>();\n private unsubscribe?: () => void;\n\n constructor(\n private gateway: LocalStorageGateway.Interface,\n config: LocalStorageConfig.Interface\n ) {\n this.prefix = config.prefix || \"\";\n makeAutoObservable(this);\n\n this.bootstrap();\n this.subscribeToChanges();\n }\n\n private withPrefix(key: string): string {\n return this.prefix ? `${this.prefix}:${key}` : key;\n }\n\n private stripPrefix(key: string): string {\n return this.prefix ? key.replace(new RegExp(`^${this.prefix}:`), \"\") : key;\n }\n\n private bootstrap() {\n const all = this.gateway.getAll();\n for (const [key, value] of Object.entries(all)) {\n if (!this.prefix || key.startsWith(this.prefix + \":\")) {\n this.store.set(this.stripPrefix(key), value);\n }\n }\n }\n\n private subscribeToChanges() {\n this.unsubscribe = this.gateway.subscribe(ev => {\n runInAction(() => {\n if (ev instanceof StorageEvent && ev.key) {\n if (!this.prefix || ev.key.startsWith(this.prefix + \":\")) {\n const cleanKey = this.stripPrefix(ev.key);\n if (ev.newValue !== null) {\n try {\n this.store.set(cleanKey, JSON.parse(ev.newValue));\n } catch {\n this.store.set(cleanKey, ev.newValue);\n }\n } else {\n this.store.delete(cleanKey);\n }\n }\n }\n if (ev instanceof CustomEvent) {\n const { key, value, action } = ev.detail;\n if (!this.prefix || key.startsWith(this.prefix + \":\")) {\n const cleanKey = this.stripPrefix(key);\n if (action === \"set\") {\n this.store.set(cleanKey, value);\n }\n if (action === \"remove\") {\n this.store.delete(cleanKey);\n }\n if (action === \"clear\") {\n this.store.clear();\n }\n }\n }\n });\n });\n }\n\n destroy() {\n this.unsubscribe?.();\n }\n\n has(key: string) {\n return this.store.has(key);\n }\n get<T = string>(key: string) {\n return this.store.get(key) as T | undefined;\n }\n set<T = string>(key: string, value: T) {\n this.gateway.set(this.withPrefix(key), value);\n }\n remove(key: string) {\n this.gateway.remove(this.withPrefix(key));\n }\n clear() {\n this.gateway.clear();\n this.store.clear();\n }\n keys(): string[] {\n return Array.from(this.store.keys());\n }\n}\n\nexport const LocalStorageRepository = createImplementation({\n abstraction: LocalStorageRepositoryAbstraction,\n implementation: LocalStorageRepositoryImpl,\n dependencies: [LocalStorageGateway, LocalStorageConfig]\n});\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,WAAW,QAAQ,MAAM;AACtD,SACIC,sBAAsB,IAAIC,iCAAiC,EAC3DC,kBAAkB,EAClBC,mBAAmB;AAEvB,SAASC,oBAAoB,QAAQ,YAAY;AAEjD,OAAO,MAAMC,0BAA0B,CAAwD;EAEnFC,KAAK,GAAG,IAAIC,GAAG,CAAkB,CAAC;EAG1CC,WAAWA,CACCC,OAAsC,EAC9CC,MAAoC,EACtC;IAAA,KAFUD,OAAsC,GAAtCA,OAAsC;IAG9C,IAAI,CAACE,MAAM,GAAGD,MAAM,CAACC,MAAM,IAAI,EAAE;IACjCb,kBAAkB,CAAC,IAAI,CAAC;IAExB,IAAI,CAACc,SAAS,CAAC,CAAC;IAChB,IAAI,CAACC,kBAAkB,CAAC,CAAC;EAC7B;EAEQC,UAAUA,CAACC,GAAW,EAAU;IACpC,OAAO,IAAI,CAACJ,MAAM,GAAG,GAAG,IAAI,CAACA,MAAM,IAAII,GAAG,EAAE,GAAGA,GAAG;EACtD;EAEQC,WAAWA,CAACD,GAAW,EAAU;IACrC,OAAO,IAAI,CAACJ,MAAM,GAA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AI,CAACN,OAAO,CAACiC,MAAM,CAAC,IAAI,CAAC5B,UAAU,CAACC,GAAG,CAAC,CAAC;EAC7C;EACAuB,KAAKA,CAAA,EAAG;IACJ,IAAI,CAAC7B,OAAO,CAAC6B,KAAK,CAAC,CAAC;IACpB,IAAI,CAAChC,KAAK,CAACgC,KAAK,CAAC,CAAC;EACtB;EACAK,IAAIA,CAAA,EAAa;IACb,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACvC,KAAK,CAACqC,IAAI,CAAC,CAAC,CAAC;EACxC;AACJ;AAEA,OAAO,MAAM3C,sBAAsB,GAAGI,oBAAoB,CAAC;EACvD0C,WAAW,EAAE7C,iCAAiC;EAC9C8C,cAAc,EAAE1C,0BAA0B;EAC1C2C,YAAY,EAAE,CAAC7C,mBAAmB,EAAED,kBAAkB;AAC1D,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,48 @@
1
+ import { Abstraction } from "@webiny/di";
2
+ /** Gateway: raw IO into localStorage (or other storage). */
3
+ export interface ILocalStorageGateway {
4
+ get<T = string>(key: string): T | null;
5
+ set<T = string>(key: string, value: T): void;
6
+ remove(key: string): void;
7
+ clear(): void;
8
+ getAll(): Record<string, unknown>;
9
+ subscribe(listener: (event: StorageEvent | CustomEvent) => void): () => void;
10
+ }
11
+ export declare const LocalStorageGateway: Abstraction<ILocalStorageGateway>;
12
+ export declare namespace LocalStorageGateway {
13
+ type Interface = ILocalStorageGateway;
14
+ }
15
+ /** Repository: reactive state (MobX), synchronized with gateway. */
16
+ export interface ILocalStorageRepository {
17
+ has(key: string): boolean;
18
+ get<T = string>(key: string): T | undefined;
19
+ set<T = string>(key: string, value: T): void;
20
+ remove(key: string): void;
21
+ clear(): void;
22
+ keys(): string[];
23
+ destroy(): void;
24
+ }
25
+ export declare const LocalStorageRepository: Abstraction<ILocalStorageRepository>;
26
+ export declare namespace LocalStorageRepository {
27
+ type Interface = ILocalStorageRepository;
28
+ }
29
+ /** Config: configure key prefixes, etc. */
30
+ export interface ILocalStorageConfig {
31
+ prefix?: string;
32
+ }
33
+ export declare const LocalStorageConfig: Abstraction<ILocalStorageConfig>;
34
+ export declare namespace LocalStorageConfig {
35
+ type Interface = ILocalStorageConfig;
36
+ }
37
+ /** Service: thin façade, delegates to repository for consumers. */
38
+ export interface ILocalStorage {
39
+ get<T = string>(key: string): T | undefined;
40
+ set<T = string>(key: string, value: T): void;
41
+ remove(key: string): void;
42
+ clear(): void;
43
+ keys(): string[];
44
+ }
45
+ export declare const LocalStorage: Abstraction<ILocalStorage>;
46
+ export declare namespace LocalStorage {
47
+ type Interface = ILocalStorage;
48
+ }
@@ -0,0 +1,19 @@
1
+ import { Abstraction } from "@webiny/di";
2
+
3
+ /** Gateway: raw IO into localStorage (or other storage). */
4
+
5
+ export const LocalStorageGateway = new Abstraction("LocalStorageGateway");
6
+
7
+ /** Repository: reactive state (MobX), synchronized with gateway. */
8
+
9
+ export const LocalStorageRepository = new Abstraction("LocalStorageRepository");
10
+
11
+ /** Config: configure key prefixes, etc. */
12
+
13
+ export const LocalStorageConfig = new Abstraction("LocalStorageConfig");
14
+
15
+ /** Service: thin façade, delegates to repository for consumers. */
16
+
17
+ export const LocalStorage = new Abstraction("LocalStorage");
18
+
19
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Abstraction","LocalStorageGateway","LocalStorageRepository","LocalStorageConfig","LocalStorage"],"sources":["abstractions.ts"],"sourcesContent":["import { Abstraction } from \"@webiny/di\";\n\n/** Gateway: raw IO into localStorage (or other storage). */\nexport interface ILocalStorageGateway {\n get<T = string>(key: string): T | null;\n set<T = string>(key: string, value: T): void;\n remove(key: string): void;\n clear(): void;\n getAll(): Record<string, unknown>;\n subscribe(listener: (event: StorageEvent | CustomEvent) => void): () => void;\n}\n\nexport const LocalStorageGateway = new Abstraction<ILocalStorageGateway>(\"LocalStorageGateway\");\n\nexport namespace LocalStorageGateway {\n export type Interface = ILocalStorageGateway;\n}\n\n/** Repository: reactive state (MobX), synchronized with gateway. */\nexport interface ILocalStorageRepository {\n has(key: string): boolean;\n get<T = string>(key: string): T | undefined;\n set<T = string>(key: string, value: T): void;\n remove(key: string): void;\n clear(): void;\n keys(): string[];\n destroy(): void;\n}\n\nexport const LocalStorageRepository = new Abstraction<ILocalStorageRepository>(\n \"LocalStorageRepository\"\n);\n\nexport namespace LocalStorageRepository {\n export type Interface = ILocalStorageRepository;\n}\n\n/** Config: configure key prefixes, etc. */\nexport interface ILocalStorageConfig {\n prefix?: string;\n}\n\nexport const LocalStorageConfig = new Abstraction<ILocalStorageConfig>(\"LocalStorageConfig\");\n\nexport namespace LocalStorageConfig {\n export type Interface = ILocalStorageConfig;\n}\n\n/** Service: thin façade, delegates to repository for consumers. */\nexport interface ILocalStorage {\n get<T = string>(key: string): T | undefined;\n set<T = string>(key: string, value: T): void;\n remove(key: string): void;\n clear(): void;\n keys(): string[];\n}\n\nexport const LocalStorage = new Abstraction<ILocalStorage>(\"LocalStorage\");\n\nexport namespace LocalStorage {\n export type Interface = ILocalStorage;\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,YAAY;;AAExC;;AAUA,OAAO,MAAMC,mBAAmB,GAAG,IAAID,WAAW,CAAuB,qBAAqB,CAAC;;AAM/F;;AAWA,OAAO,MAAME,sBAAsB,GAAG,IAAIF,WAAW,CACjD,wBACJ,CAAC;;AAMD;;AAKA,OAAO,MAAMG,kBAAkB,GAAG,IAAIH,WAAW,CAAsB,oBAAoB,CAAC;;AAM5F;;AASA,OAAO,MAAMI,YAAY,GAAG,IAAIJ,WAAW,CAAgB,cAAc,CAAC","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * LocalStorageFeature wires together:
3
+ * - BrowserLocalStorageGateway (default gateway)
4
+ * - LocalStorageRepository (reactive MobX mirror)
5
+ * - LocalStorage (thin consumer-facing facade)
6
+ */
7
+ export declare const LocalStorageFeature: import("~/shared/di/createFeature.js").FeatureDefinition<{
8
+ localStorageService: import("./abstractions.js").ILocalStorage;
9
+ localStorageConfig: import("./abstractions.js").ILocalStorageConfig;
10
+ }, [config?: {
11
+ prefix?: string;
12
+ } | undefined]>;
@@ -0,0 +1,34 @@
1
+ import { LocalStorageConfig, LocalStorageGateway, LocalStorage as Abstraction } from "./abstractions.js";
2
+ import { BrowserLocalStorageGateway } from "./BrowserLocalStorageGateway.js";
3
+ import { LocalStorageRepository } from "./LocalStorageRepository.js";
4
+ import { LocalStorage } from "./LocalStorage.js";
5
+ import { createFeature } from "../../shared/di/createFeature.js";
6
+
7
+ /**
8
+ * LocalStorageFeature wires together:
9
+ * - BrowserLocalStorageGateway (default gateway)
10
+ * - LocalStorageRepository (reactive MobX mirror)
11
+ * - LocalStorage (thin consumer-facing facade)
12
+ */
13
+ export const LocalStorageFeature = createFeature({
14
+ name: "LocalStorage",
15
+ register(container, config = {}) {
16
+ // Register config (tenant prefix, etc.)
17
+ container.registerInstance(LocalStorageConfig, config);
18
+
19
+ // Gateway: browser localStorage
20
+ container.registerInstance(LocalStorageGateway, new BrowserLocalStorageGateway());
21
+
22
+ // Repository & Service
23
+ container.register(LocalStorageRepository).inSingletonScope();
24
+ container.register(LocalStorage).inSingletonScope();
25
+ },
26
+ resolve(container) {
27
+ return {
28
+ localStorageService: container.resolve(Abstraction),
29
+ localStorageConfig: container.resolve(LocalStorageConfig)
30
+ };
31
+ }
32
+ });
33
+
34
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["LocalStorageConfig","LocalStorageGateway","LocalStorage","Abstraction","BrowserLocalStorageGateway","LocalStorageRepository","createFeature","LocalStorageFeature","name","register","container","config","registerInstance","inSingletonScope","resolve","localStorageService","localStorageConfig"],"sources":["feature.ts"],"sourcesContent":["import {\n LocalStorageConfig,\n LocalStorageGateway,\n LocalStorage as Abstraction\n} from \"./abstractions.js\";\nimport { BrowserLocalStorageGateway } from \"./BrowserLocalStorageGateway.js\";\nimport { LocalStorageRepository } from \"./LocalStorageRepository.js\";\nimport { LocalStorage } from \"./LocalStorage.js\";\nimport { createFeature } from \"~/shared/di/createFeature.js\";\n\n/**\n * LocalStorageFeature wires together:\n * - BrowserLocalStorageGateway (default gateway)\n * - LocalStorageRepository (reactive MobX mirror)\n * - LocalStorage (thin consumer-facing facade)\n */\nexport const LocalStorageFeature = createFeature({\n name: \"LocalStorage\",\n register(container, config: { prefix?: string } = {}) {\n // Register config (tenant prefix, etc.)\n container.registerInstance(LocalStorageConfig, config);\n\n // Gateway: browser localStorage\n container.registerInstance(LocalStorageGateway, new BrowserLocalStorageGateway());\n\n // Repository & Service\n container.register(LocalStorageRepository).inSingletonScope();\n container.register(LocalStorage).inSingletonScope();\n },\n resolve(container) {\n return {\n localStorageService: container.resolve(Abstraction),\n localStorageConfig: container.resolve(LocalStorageConfig)\n };\n }\n});\n"],"mappings":"AAAA,SACIA,kBAAkB,EAClBC,mBAAmB,EACnBC,YAAY,IAAIC,WAAW;AAE/B,SAASC,0BAA0B;AACnC,SAASC,sBAAsB;AAC/B,SAASH,YAAY;AACrB,SAASI,aAAa;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAGD,aAAa,CAAC;EAC7CE,IAAI,EAAE,cAAc;EACpBC,QAAQA,CAACC,SAAS,EAAEC,MAA2B,GAAG,CAAC,CAAC,EAAE;IAClD;IACAD,SAAS,CAACE,gBAAgB,CAACZ,kBAAkB,EAAEW,MAAM,CAAC;;IAEtD;IACAD,SAAS,CAACE,gBAAgB,CAACX,mBAAmB,EAAE,IAAIG,0BAA0B,CAAC,CAAC,CAAC;;IAEjF;IACAM,SAAS,CAACD,QAAQ,CAACJ,sBAAsB,CAAC,CAACQ,gBAAgB,CAAC,CAAC;IAC7DH,SAAS,CAACD,QAAQ,CAACP,YAAY,CAAC,CAACW,gBAAgB,CAAC,CAAC;EACvD,CAAC;EACDC,OAAOA,CAACJ,SAAS,EAAE;IACf,OAAO;MACHK,mBAAmB,EAAEL,SAAS,CAACI,OAAO,CAACX,WAAW,CAAC;MACnDa,kBAAkB,EAAEN,SAAS,CAACI,OAAO,CAACd,kBAAkB;IAC5D,CAAC;EACL;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export { LocalStorage, LocalStorageGateway, LocalStorageRepository, LocalStorageConfig } from "./abstractions.js";
@@ -0,0 +1,3 @@
1
+ export { LocalStorage, LocalStorageGateway, LocalStorageRepository, LocalStorageConfig } from "./abstractions.js";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["LocalStorage","LocalStorageGateway","LocalStorageRepository","LocalStorageConfig"],"sources":["index.ts"],"sourcesContent":["export {\n LocalStorage,\n LocalStorageGateway,\n LocalStorageRepository,\n LocalStorageConfig\n} from \"./abstractions.js\";\n"],"mappings":"AAAA,SACIA,YAAY,EACZC,mBAAmB,EACnBC,sBAAsB,EACtBC,kBAAkB","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ import type { z } from "zod";
2
+ import type { History } from "history";
3
+ import type { RouteDefinition, OnRouteExit } from "./abstractions.js";
4
+ import { RouterGateway } from "./abstractions.js";
5
+ export declare class HistoryRouterGateway implements RouterGateway.Interface {
6
+ private readonly history;
7
+ private readonly router;
8
+ private stopListening;
9
+ private unblock;
10
+ constructor(history: History, baseUrl: string);
11
+ onRouteExit(cb: OnRouteExit): void;
12
+ goToRoute(name: string, params: z.ZodTypeAny): void;
13
+ setRoutes(routes: RouteDefinition[]): void;
14
+ destroy(): void;
15
+ pushState(url: string): void;
16
+ private resolvePathname;
17
+ private guardRouteExit;
18
+ }
@@ -0,0 +1,82 @@
1
+ import { RouteUrl } from "./RouteUrl.js";
2
+ import { Router } from "./Router.js";
3
+ export class HistoryRouterGateway {
4
+ constructor(history, baseUrl) {
5
+ this.history = history;
6
+ this.router = new Router(baseUrl);
7
+ this.stopListening = history.listen(async ({
8
+ location
9
+ }) => {
10
+ const queryParams = Object.fromEntries(new URLSearchParams(location.search).entries());
11
+ this.resolvePathname(location.pathname, queryParams);
12
+ });
13
+ }
14
+ onRouteExit(cb) {
15
+ this.guardRouteExit(cb);
16
+ }
17
+ goToRoute(name, params) {
18
+ const route = this.router.findRoute(name);
19
+ if (!route) {
20
+ console.warn(`Route "${name}" not found.`);
21
+ return;
22
+ }
23
+ const baseUrl = this.router.getBaseUrl();
24
+ this.history.push(RouteUrl.fromPattern(route.path, params, baseUrl));
25
+ }
26
+ setRoutes(routes) {
27
+ this.router.setRoutes(routes);
28
+ const queryParams = Object.fromEntries(new URLSearchParams(this.history.location.search).entries());
29
+ const currentPathname = this.history.location.pathname;
30
+ this.resolvePathname(currentPathname, queryParams);
31
+ }
32
+ destroy() {
33
+ this.stopListening();
34
+ this.unblock && this.unblock();
35
+ }
36
+ pushState(url) {
37
+ this.history.push(url);
38
+ }
39
+ async resolvePathname(pathname, queryParams) {
40
+ const result = this.router.resolve(pathname, queryParams);
41
+ if (!result) {
42
+ return;
43
+ }
44
+ const {
45
+ matchedRoute,
46
+ onMatch
47
+ } = result;
48
+ onMatch(matchedRoute);
49
+ }
50
+ guardRouteExit(onRouteExit) {
51
+ if (this.unblock) {
52
+ // Remove existing blocker before installing a new one.
53
+ this.unblock();
54
+ }
55
+ this.unblock = this.history.block(tx => {
56
+ let resolved = false;
57
+ onRouteExit({
58
+ continue: () => {
59
+ if (!resolved) {
60
+ resolved = true;
61
+ // We need to unblock the transition before retying.
62
+ if (this.unblock) {
63
+ this.unblock();
64
+ this.unblock = undefined;
65
+ }
66
+ // Perform transition.
67
+ tx.retry();
68
+ }
69
+ },
70
+ cancel: () => {
71
+ resolved = true;
72
+ // Do nothing.
73
+ }
74
+ });
75
+
76
+ // Block the transition until `continue` is called.
77
+ return false;
78
+ });
79
+ }
80
+ }
81
+
82
+ //# sourceMappingURL=HistoryRouterGateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["RouteUrl","Router","HistoryRouterGateway","constructor","history","baseUrl","router","stopListening","listen","location","queryParams","Object","fromEntries","URLSearchParams","search","entries","resolvePathname","pathname","onRouteExit","cb","guardRouteExit","goToRoute","name","params","route","findRoute","console","warn","getBaseUrl","push","fromPattern","path","setRoutes","routes","currentPathname","destroy","unblock","pushState","url","result","resolve","matchedRoute","onMatch","block","tx","resolved","continue","undefined","retry","cancel"],"sources":["HistoryRouterGateway.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { History } from \"history\";\nimport type { RouteDefinition, OnRouteExit } from \"./abstractions.js\";\nimport { RouterGateway } from \"./abstractions.js\";\nimport { RouteUrl } from \"./RouteUrl.js\";\nimport { Router } from \"./Router.js\";\n\nexport class HistoryRouterGateway implements RouterGateway.Interface {\n private readonly history: History;\n private readonly router: Router;\n private stopListening: () => void;\n private unblock: (() => void) | undefined;\n\n constructor(history: History, baseUrl: string) {\n this.history = history;\n this.router = new Router(baseUrl);\n\n this.stopListening = history.listen(async ({ location }) => {\n const queryParams = Object.fromEntries(new URLSearchParams(location.search).entries());\n this.resolvePathname(location.pathname, queryParams);\n });\n }\n\n onRouteExit(cb: OnRouteExit): void {\n this.guardRouteExit(cb);\n }\n\n goToRoute(name: string, params: z.ZodTypeAny): void {\n const route = this.router.findRoute(name);\n if (!route) {\n console.warn(`Route \"${name}\" not found.`);\n return;\n }\n\n const baseUrl = this.router.getBaseUrl();\n this.history.push(RouteUrl.fromPattern(route.path, params, baseUrl));\n }\n\n setRoutes(routes: RouteDefinition[]) {\n this.router.setRoutes(routes);\n\n const queryParams = Object.fromEntries(\n new URLSearchParams(this.history.location.search).entries()\n );\n const currentPathname = this.history.location.pathname;\n this.resolvePathname(currentPathname, queryParams);\n }\n\n destroy(): void {\n this.stopListening();\n this.unblock && this.unblock();\n }\n\n pushState(url: string): void {\n this.history.push(url);\n }\n\n private async resolvePathname(pathname: string, queryParams?: Record<string, unknown>) {\n const result = this.router.resolve(pathname, queryParams);\n if (!result) {\n return;\n }\n\n const { matchedRoute, onMatch } = result;\n\n onMatch(matchedRoute);\n }\n\n private guardRouteExit(onRouteExit: OnRouteExit): void {\n if (this.unblock) {\n // Remove existing blocker before installing a new one.\n this.unblock();\n }\n\n this.unblock = this.history.block(tx => {\n let resolved = false;\n\n onRouteExit({\n continue: () => {\n if (!resolved) {\n resolved = true;\n // We need to unblock the transition before retying.\n if (this.unblock) {\n this.unblock();\n this.unblock = undefined;\n }\n // Perform transition.\n tx.retry();\n }\n },\n cancel: () => {\n resolved = true;\n // Do nothing.\n }\n });\n\n // Block the transition until `continue` is called.\n return false;\n });\n }\n}\n"],"mappings":"AAIA,SAASA,QAAQ;AACjB,SAASC,MAAM;AAEf,OAAO,MAAMC,oBAAoB,CAAoC;EAMjEC,WAAWA,CAACC,OAAgB,EAAEC,OAAe,EAAE;IAC3C,IAAI,CAACD,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACE,MAAM,GAAG,IAAIL,MAAM,CAACI,OAAO,CAAC;IAEjC,IAAI,CAACE,aAAa,GAAGH,OAAO,CAACI,MAAM,CAAC,OAAO;MAAEC;IAAS,CAAC,KAAK;MACxD,MAAMC,WAAW,GAAGC,MAAM,CAACC,WAAW,CAAC,IAAIC,eAAe,CAACJ,QAAQ,CAACK,MAAM,CAAC,CAACC,OAAO,CAAC,CAAC,CAAC;MACtF,IAAI,CAACC,eAAe,CAACP,QAAQ,CAACQ,QAAQ,EAAEP,WAAW,CAAC;IACxD,CAAC,CAAC;EACN;EAEAQ,WAAWA,CAACC,EAAe,EAAQ;IAC/B,IAAI,CAACC,cAAc,CAACD,EAAE,CAAC;EAC3B;EAEAE,SAASA,CAACC,IAAY,EAAEC,MAAoB,EAAQ;IAChD,MAAMC,KAAK,GAAG,IAAI,CAAClB,MAAM,CAACmB,SAAS,CAACH,IAAI,CAAC;IACzC,IAAI,CAACE,KAAK,EAAE;MACRE,OAAO,CAACC,IAAI,CAAC,UAAUL,IAAI,cAAc,CAAC;MAC1C;IACJ;IAEA,MAAMjB,OAAO,GAAG,IAAI,CAACC,MAAM,CAACsB,UAAU,CAA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