@redneckz/wildless-cms-uni-blocks 0.8.8 → 0.8.10

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 (404) hide show
  1. package/bin/migration-scripts/0.8.10.js +31 -0
  2. package/bundle/EventBus/EventBus.d.ts +1 -4
  3. package/bundle/EventBus/defaultEventBus.d.ts +7 -0
  4. package/bundle/blocks.schema.json +1 -1
  5. package/bundle/bundle.umd.js +112 -113
  6. package/bundle/bundle.umd.min.js +1 -1
  7. package/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  8. package/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
  9. package/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  10. package/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  11. package/{dist/components/StepsBlock/renderStepContent.d.ts → bundle/components/StepsBlock/renderStep.d.ts} +5 -5
  12. package/bundle/components/Tile/TileContent.d.ts +2 -2
  13. package/bundle/hooks/useRouter.d.ts +6 -2
  14. package/bundle/services/BlockRouter/BlockRouter.d.ts +3 -22
  15. package/bundle/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  16. package/bundle/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  17. package/bundle/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  18. package/dist/EventBus/EventBus.d.ts +1 -4
  19. package/dist/EventBus/EventBus.js +0 -1
  20. package/dist/EventBus/EventBus.js.map +1 -1
  21. package/dist/EventBus/defaultEventBus.d.ts +7 -0
  22. package/dist/EventBus/defaultEventBus.js +5 -0
  23. package/dist/EventBus/defaultEventBus.js.map +1 -0
  24. package/dist/components/ButtonBlock/ButtonBlock.js +2 -1
  25. package/dist/components/ButtonBlock/ButtonBlock.js.map +1 -1
  26. package/dist/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  27. package/dist/components/Calculator/Rate.js +1 -1
  28. package/dist/components/Calculator/Rate.js.map +1 -1
  29. package/dist/components/Calculator/constants.js +2 -2
  30. package/dist/components/Calculator/constants.js.map +1 -1
  31. package/dist/components/Calculator/rangeHelpers.d.ts +4 -0
  32. package/dist/components/Calculator/rangeHelpers.js +12 -0
  33. package/dist/components/Calculator/rangeHelpers.js.map +1 -0
  34. package/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  35. package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  36. package/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
  37. package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  38. package/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
  39. package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  40. package/dist/components/Carousel/Carousel.js +6 -4
  41. package/dist/components/Carousel/Carousel.js.map +1 -1
  42. package/dist/components/PictureText/renderBenefit.js +1 -0
  43. package/dist/components/PictureText/renderBenefit.js.map +1 -1
  44. package/dist/components/ProductTile/renderBenefit.js +1 -0
  45. package/dist/components/ProductTile/renderBenefit.js.map +1 -1
  46. package/dist/components/StepsBlock/StepsBlock.js +7 -13
  47. package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  48. package/dist/components/StepsBlock/StepsBlock.mobile.js +24 -4
  49. package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  50. package/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  51. package/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  52. package/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
  53. package/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  54. package/{bundle/components/StepsBlock/renderStepContent.d.ts → dist/components/StepsBlock/renderStep.d.ts} +5 -5
  55. package/dist/components/StepsBlock/renderStep.js +34 -0
  56. package/dist/components/StepsBlock/renderStep.js.map +1 -0
  57. package/dist/components/Tabs/Tabs.js +4 -4
  58. package/dist/components/Tabs/Tabs.js.map +1 -1
  59. package/dist/components/Tile/Tile.js +3 -3
  60. package/dist/components/Tile/Tile.js.map +1 -1
  61. package/dist/components/Tile/TileContent.d.ts +2 -2
  62. package/dist/hooks/useLink.js +2 -3
  63. package/dist/hooks/useLink.js.map +1 -1
  64. package/dist/hooks/useRouter.d.ts +6 -2
  65. package/dist/hooks/useRouter.js.map +1 -1
  66. package/dist/services/BlockRouter/BlockRouter.d.ts +3 -22
  67. package/dist/services/BlockRouter/BlockRouter.js +11 -30
  68. package/dist/services/BlockRouter/BlockRouter.js.map +1 -1
  69. package/dist/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  70. package/dist/services/BlockRouter/blockRouterEventBus.js +5 -0
  71. package/dist/services/BlockRouter/blockRouterEventBus.js.map +1 -0
  72. package/dist/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  73. package/dist/services/BlockRouter/useBlockIntersectionObserver.js +5 -16
  74. package/dist/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
  75. package/dist/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  76. package/dist/services/BlockRouter/useBlockRouterProvider.js +11 -12
  77. package/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
  78. package/dist/ui-kit/BlockWrapper.js +2 -2
  79. package/dist/ui-kit/BlockWrapper.js.map +1 -1
  80. package/lib/EventBus/EventBus.d.ts +1 -4
  81. package/lib/EventBus/EventBus.js +0 -1
  82. package/lib/EventBus/EventBus.js.map +1 -1
  83. package/lib/EventBus/defaultEventBus.d.ts +7 -0
  84. package/lib/EventBus/defaultEventBus.js +3 -0
  85. package/lib/EventBus/defaultEventBus.js.map +1 -0
  86. package/lib/common.css +1 -1
  87. package/lib/components/ButtonBlock/ButtonBlock.js +2 -1
  88. package/lib/components/ButtonBlock/ButtonBlock.js.map +1 -1
  89. package/lib/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  90. package/lib/components/Calculator/Rate.js +1 -1
  91. package/lib/components/Calculator/Rate.js.map +1 -1
  92. package/lib/components/Calculator/constants.js +2 -2
  93. package/lib/components/Calculator/constants.js.map +1 -1
  94. package/lib/components/Calculator/rangeHelpers.d.ts +4 -0
  95. package/lib/components/Calculator/rangeHelpers.js +8 -0
  96. package/lib/components/Calculator/rangeHelpers.js.map +1 -0
  97. package/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  98. package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  99. package/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
  100. package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  101. package/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
  102. package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  103. package/lib/components/Carousel/Carousel.js +6 -4
  104. package/lib/components/Carousel/Carousel.js.map +1 -1
  105. package/lib/components/PictureText/renderBenefit.js +1 -0
  106. package/lib/components/PictureText/renderBenefit.js.map +1 -1
  107. package/lib/components/ProductTile/renderBenefit.js +1 -0
  108. package/lib/components/ProductTile/renderBenefit.js.map +1 -1
  109. package/lib/components/StepsBlock/StepsBlock.js +7 -13
  110. package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  111. package/lib/components/StepsBlock/StepsBlock.mobile.js +24 -4
  112. package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  113. package/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  114. package/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  115. package/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
  116. package/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  117. package/{mobile/bundle/components/StepsBlock/renderStepContent.d.ts → lib/components/StepsBlock/renderStep.d.ts} +5 -5
  118. package/lib/components/StepsBlock/renderStep.js +31 -0
  119. package/lib/components/StepsBlock/renderStep.js.map +1 -0
  120. package/lib/components/Tabs/Tabs.js +4 -4
  121. package/lib/components/Tabs/Tabs.js.map +1 -1
  122. package/lib/components/Tile/Tile.js +3 -3
  123. package/lib/components/Tile/Tile.js.map +1 -1
  124. package/lib/components/Tile/TileContent.d.ts +2 -2
  125. package/lib/hooks/useLink.js +2 -3
  126. package/lib/hooks/useLink.js.map +1 -1
  127. package/lib/hooks/useRouter.d.ts +6 -2
  128. package/lib/hooks/useRouter.js.map +1 -1
  129. package/lib/services/BlockRouter/BlockRouter.d.ts +3 -22
  130. package/lib/services/BlockRouter/BlockRouter.js +8 -28
  131. package/lib/services/BlockRouter/BlockRouter.js.map +1 -1
  132. package/lib/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  133. package/lib/services/BlockRouter/blockRouterEventBus.js +3 -0
  134. package/lib/services/BlockRouter/blockRouterEventBus.js.map +1 -0
  135. package/lib/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  136. package/lib/services/BlockRouter/useBlockIntersectionObserver.js +6 -17
  137. package/lib/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
  138. package/lib/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  139. package/lib/services/BlockRouter/useBlockRouterProvider.js +12 -13
  140. package/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
  141. package/lib/ui-kit/BlockWrapper.js +2 -2
  142. package/lib/ui-kit/BlockWrapper.js.map +1 -1
  143. package/mobile/bundle/EventBus/EventBus.d.ts +1 -4
  144. package/mobile/bundle/EventBus/defaultEventBus.d.ts +7 -0
  145. package/mobile/bundle/bundle.umd.js +58 -66
  146. package/mobile/bundle/bundle.umd.min.js +1 -1
  147. package/mobile/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  148. package/mobile/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
  149. package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  150. package/mobile/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  151. package/{lib/components/StepsBlock/renderStepContent.d.ts → mobile/bundle/components/StepsBlock/renderStep.d.ts} +5 -5
  152. package/mobile/bundle/components/Tile/TileContent.d.ts +2 -2
  153. package/mobile/bundle/hooks/useRouter.d.ts +6 -2
  154. package/mobile/bundle/services/BlockRouter/BlockRouter.d.ts +3 -22
  155. package/mobile/bundle/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  156. package/mobile/bundle/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  157. package/mobile/bundle/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  158. package/mobile/dist/EventBus/EventBus.d.ts +1 -4
  159. package/mobile/dist/EventBus/EventBus.js +0 -1
  160. package/mobile/dist/EventBus/EventBus.js.map +1 -1
  161. package/mobile/dist/EventBus/defaultEventBus.d.ts +7 -0
  162. package/mobile/dist/EventBus/defaultEventBus.js +5 -0
  163. package/mobile/dist/EventBus/defaultEventBus.js.map +1 -0
  164. package/mobile/dist/components/ButtonBlock/ButtonBlock.js +2 -1
  165. package/mobile/dist/components/ButtonBlock/ButtonBlock.js.map +1 -1
  166. package/mobile/dist/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  167. package/mobile/dist/components/Calculator/Rate.js +1 -1
  168. package/mobile/dist/components/Calculator/Rate.js.map +1 -1
  169. package/mobile/dist/components/Calculator/constants.js +2 -2
  170. package/mobile/dist/components/Calculator/constants.js.map +1 -1
  171. package/mobile/dist/components/Calculator/rangeHelpers.d.ts +4 -0
  172. package/mobile/dist/components/Calculator/rangeHelpers.js +12 -0
  173. package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -0
  174. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  175. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  176. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
  177. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  178. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
  179. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  180. package/mobile/dist/components/Carousel/Carousel.js +6 -4
  181. package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
  182. package/mobile/dist/components/PictureText/renderBenefit.js +1 -0
  183. package/mobile/dist/components/PictureText/renderBenefit.js.map +1 -1
  184. package/mobile/dist/components/ProductTile/renderBenefit.js +1 -0
  185. package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -1
  186. package/mobile/dist/components/StepsBlock/StepsBlock.js +24 -4
  187. package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  188. package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  189. package/mobile/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  190. package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
  191. package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  192. package/mobile/dist/components/StepsBlock/renderStep.d.ts +11 -0
  193. package/mobile/dist/components/StepsBlock/renderStep.js +34 -0
  194. package/mobile/dist/components/StepsBlock/renderStep.js.map +1 -0
  195. package/mobile/dist/components/Tabs/Tabs.js +4 -4
  196. package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
  197. package/mobile/dist/components/Tile/Tile.js +3 -3
  198. package/mobile/dist/components/Tile/Tile.js.map +1 -1
  199. package/mobile/dist/components/Tile/TileContent.d.ts +2 -2
  200. package/mobile/dist/hooks/useLink.js +2 -3
  201. package/mobile/dist/hooks/useLink.js.map +1 -1
  202. package/mobile/dist/hooks/useRouter.d.ts +6 -2
  203. package/mobile/dist/hooks/useRouter.js.map +1 -1
  204. package/mobile/dist/services/BlockRouter/BlockRouter.d.ts +3 -22
  205. package/mobile/dist/services/BlockRouter/BlockRouter.js +11 -30
  206. package/mobile/dist/services/BlockRouter/BlockRouter.js.map +1 -1
  207. package/mobile/dist/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  208. package/mobile/dist/services/BlockRouter/blockRouterEventBus.js +5 -0
  209. package/mobile/dist/services/BlockRouter/blockRouterEventBus.js.map +1 -0
  210. package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  211. package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.js +5 -16
  212. package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
  213. package/mobile/dist/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  214. package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js +11 -12
  215. package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
  216. package/mobile/dist/ui-kit/BlockWrapper.js +2 -2
  217. package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
  218. package/mobile/lib/EventBus/EventBus.d.ts +1 -4
  219. package/mobile/lib/EventBus/EventBus.js +0 -1
  220. package/mobile/lib/EventBus/EventBus.js.map +1 -1
  221. package/mobile/lib/EventBus/defaultEventBus.d.ts +7 -0
  222. package/mobile/lib/EventBus/defaultEventBus.js +3 -0
  223. package/mobile/lib/EventBus/defaultEventBus.js.map +1 -0
  224. package/mobile/lib/components/ButtonBlock/ButtonBlock.js +2 -1
  225. package/mobile/lib/components/ButtonBlock/ButtonBlock.js.map +1 -1
  226. package/mobile/lib/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  227. package/mobile/lib/components/Calculator/Rate.js +1 -1
  228. package/mobile/lib/components/Calculator/Rate.js.map +1 -1
  229. package/mobile/lib/components/Calculator/constants.js +2 -2
  230. package/mobile/lib/components/Calculator/constants.js.map +1 -1
  231. package/mobile/lib/components/Calculator/rangeHelpers.d.ts +4 -0
  232. package/mobile/lib/components/Calculator/rangeHelpers.js +8 -0
  233. package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -0
  234. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  235. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  236. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
  237. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  238. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
  239. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  240. package/mobile/lib/components/Carousel/Carousel.js +6 -4
  241. package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
  242. package/mobile/lib/components/PictureText/renderBenefit.js +1 -0
  243. package/mobile/lib/components/PictureText/renderBenefit.js.map +1 -1
  244. package/mobile/lib/components/ProductTile/renderBenefit.js +1 -0
  245. package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -1
  246. package/mobile/lib/components/StepsBlock/StepsBlock.js +24 -4
  247. package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  248. package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  249. package/mobile/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  250. package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
  251. package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  252. package/mobile/lib/components/StepsBlock/renderStep.d.ts +11 -0
  253. package/mobile/lib/components/StepsBlock/renderStep.js +31 -0
  254. package/mobile/lib/components/StepsBlock/renderStep.js.map +1 -0
  255. package/mobile/lib/components/Tabs/Tabs.js +4 -4
  256. package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
  257. package/mobile/lib/components/Tile/Tile.js +3 -3
  258. package/mobile/lib/components/Tile/Tile.js.map +1 -1
  259. package/mobile/lib/components/Tile/TileContent.d.ts +2 -2
  260. package/mobile/lib/hooks/useLink.js +2 -3
  261. package/mobile/lib/hooks/useLink.js.map +1 -1
  262. package/mobile/lib/hooks/useRouter.d.ts +6 -2
  263. package/mobile/lib/hooks/useRouter.js.map +1 -1
  264. package/mobile/lib/services/BlockRouter/BlockRouter.d.ts +3 -22
  265. package/mobile/lib/services/BlockRouter/BlockRouter.js +8 -28
  266. package/mobile/lib/services/BlockRouter/BlockRouter.js.map +1 -1
  267. package/mobile/lib/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  268. package/mobile/lib/services/BlockRouter/blockRouterEventBus.js +3 -0
  269. package/mobile/lib/services/BlockRouter/blockRouterEventBus.js.map +1 -0
  270. package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  271. package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.js +6 -17
  272. package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
  273. package/mobile/lib/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  274. package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js +12 -13
  275. package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
  276. package/mobile/lib/ui-kit/BlockWrapper.js +2 -2
  277. package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
  278. package/mobile/src/EventBus/EventBus.ts +1 -7
  279. package/mobile/src/EventBus/defaultEventBus.ts +8 -0
  280. package/mobile/src/components/ButtonBlock/ButtonBlock.example.json +2 -2
  281. package/mobile/src/components/ButtonBlock/ButtonBlock.tsx +5 -2
  282. package/mobile/src/components/ButtonBlock/ButtonBlockContent.ts +5 -1
  283. package/mobile/src/components/Calculator/Rate.tsx +1 -1
  284. package/mobile/src/components/Calculator/constants.ts +2 -2
  285. package/mobile/src/components/Calculator/rangeHelpers.ts +24 -0
  286. package/mobile/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
  287. package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
  288. package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
  289. package/mobile/src/components/Carousel/Carousel.tsx +6 -4
  290. package/mobile/src/components/PictureText/renderBenefit.tsx +1 -0
  291. package/mobile/src/components/ProductTile/renderBenefit.tsx +1 -0
  292. package/mobile/src/components/StepsBlock/StepsBlock.tsx +29 -5
  293. package/mobile/src/components/StepsBlock/StepsBlock.ui.json +6 -0
  294. package/mobile/src/components/StepsBlock/StepsBlockContent.ts +13 -1
  295. package/mobile/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
  296. package/mobile/src/components/StepsBlock/renderStep.tsx +83 -0
  297. package/mobile/src/components/Tabs/Tabs.tsx +4 -4
  298. package/mobile/src/components/Tile/Tile.example.json +1 -1
  299. package/mobile/src/components/Tile/Tile.tsx +4 -4
  300. package/mobile/src/components/Tile/Tile.ui.json +7 -1
  301. package/mobile/src/components/Tile/TileContent.ts +2 -2
  302. package/mobile/src/hooks/useLink.ts +2 -3
  303. package/mobile/src/hooks/useRouter.ts +6 -2
  304. package/mobile/src/services/BlockRouter/BlockRouter.ts +8 -47
  305. package/mobile/src/services/BlockRouter/blockRouterEventBus.ts +13 -0
  306. package/mobile/src/services/BlockRouter/useBlockIntersectionObserver.ts +6 -23
  307. package/mobile/src/services/BlockRouter/useBlockRouterProvider.ts +13 -19
  308. package/mobile/src/ui-kit/BlockWrapper.tsx +2 -2
  309. package/package.json +1 -1
  310. package/src/EventBus/EventBus.ts +1 -7
  311. package/src/EventBus/defaultEventBus.ts +8 -0
  312. package/src/components/ButtonBlock/ButtonBlock.example.json +2 -2
  313. package/src/components/ButtonBlock/ButtonBlock.tsx +5 -2
  314. package/src/components/ButtonBlock/ButtonBlockContent.ts +5 -1
  315. package/src/components/Calculator/Rate.tsx +1 -1
  316. package/src/components/Calculator/constants.ts +2 -2
  317. package/src/components/Calculator/rangeHelpers.ts +24 -0
  318. package/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
  319. package/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
  320. package/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
  321. package/src/components/Carousel/Carousel.tsx +6 -4
  322. package/src/components/PictureText/renderBenefit.tsx +1 -0
  323. package/src/components/ProductTile/renderBenefit.tsx +1 -0
  324. package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +19 -1
  325. package/src/components/StepsBlock/StepsBlock.fixture.tsx +10 -3
  326. package/src/components/StepsBlock/StepsBlock.mobile.tsx +29 -5
  327. package/src/components/StepsBlock/StepsBlock.tsx +28 -16
  328. package/src/components/StepsBlock/StepsBlock.ui.json +6 -0
  329. package/src/components/StepsBlock/StepsBlockContent.ts +13 -1
  330. package/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
  331. package/src/components/StepsBlock/renderStep.tsx +83 -0
  332. package/src/components/Tabs/Tabs.tsx +4 -4
  333. package/src/components/Tile/Tile.example.json +1 -1
  334. package/src/components/Tile/Tile.fixture.tsx +2 -2
  335. package/src/components/Tile/Tile.tsx +4 -4
  336. package/src/components/Tile/Tile.ui.json +7 -1
  337. package/src/components/Tile/TileContent.ts +2 -2
  338. package/src/hooks/useLink.ts +2 -3
  339. package/src/hooks/useRouter.ts +6 -2
  340. package/src/services/BlockRouter/BlockRouter.ts +8 -47
  341. package/src/services/BlockRouter/blockRouterEventBus.ts +13 -0
  342. package/src/services/BlockRouter/useBlockIntersectionObserver.ts +6 -23
  343. package/src/services/BlockRouter/useBlockRouterProvider.ts +13 -19
  344. package/src/ui-kit/BlockWrapper.tsx +2 -2
  345. package/bundle/EventBus/EventMap.d.ts +0 -4
  346. package/bundle/services/BlockRouter/useBlockRouter.d.ts +0 -2
  347. package/bundle/utils/checkIsIconRenderable.d.ts +0 -2
  348. package/dist/EventBus/EventMap.d.ts +0 -4
  349. package/dist/EventBus/EventMap.js +0 -2
  350. package/dist/EventBus/EventMap.js.map +0 -1
  351. package/dist/components/StepsBlock/renderStepContent.js +0 -19
  352. package/dist/components/StepsBlock/renderStepContent.js.map +0 -1
  353. package/dist/services/BlockRouter/useBlockRouter.d.ts +0 -2
  354. package/dist/services/BlockRouter/useBlockRouter.js +0 -8
  355. package/dist/services/BlockRouter/useBlockRouter.js.map +0 -1
  356. package/dist/utils/checkIsIconRenderable.d.ts +0 -2
  357. package/dist/utils/checkIsIconRenderable.js +0 -5
  358. package/dist/utils/checkIsIconRenderable.js.map +0 -1
  359. package/lib/EventBus/EventMap.d.ts +0 -4
  360. package/lib/EventBus/EventMap.js +0 -2
  361. package/lib/EventBus/EventMap.js.map +0 -1
  362. package/lib/components/StepsBlock/renderStepContent.js +0 -16
  363. package/lib/components/StepsBlock/renderStepContent.js.map +0 -1
  364. package/lib/services/BlockRouter/useBlockRouter.d.ts +0 -2
  365. package/lib/services/BlockRouter/useBlockRouter.js +0 -5
  366. package/lib/services/BlockRouter/useBlockRouter.js.map +0 -1
  367. package/lib/utils/checkIsIconRenderable.d.ts +0 -2
  368. package/lib/utils/checkIsIconRenderable.js +0 -2
  369. package/lib/utils/checkIsIconRenderable.js.map +0 -1
  370. package/mobile/bundle/EventBus/EventMap.d.ts +0 -4
  371. package/mobile/bundle/services/BlockRouter/useBlockRouter.d.ts +0 -2
  372. package/mobile/bundle/utils/checkIsIconRenderable.d.ts +0 -2
  373. package/mobile/dist/EventBus/EventMap.d.ts +0 -4
  374. package/mobile/dist/EventBus/EventMap.js +0 -2
  375. package/mobile/dist/EventBus/EventMap.js.map +0 -1
  376. package/mobile/dist/components/StepsBlock/renderStepContent.d.ts +0 -11
  377. package/mobile/dist/components/StepsBlock/renderStepContent.js +0 -19
  378. package/mobile/dist/components/StepsBlock/renderStepContent.js.map +0 -1
  379. package/mobile/dist/services/BlockRouter/useBlockRouter.d.ts +0 -2
  380. package/mobile/dist/services/BlockRouter/useBlockRouter.js +0 -8
  381. package/mobile/dist/services/BlockRouter/useBlockRouter.js.map +0 -1
  382. package/mobile/dist/utils/checkIsIconRenderable.d.ts +0 -2
  383. package/mobile/dist/utils/checkIsIconRenderable.js +0 -5
  384. package/mobile/dist/utils/checkIsIconRenderable.js.map +0 -1
  385. package/mobile/lib/EventBus/EventMap.d.ts +0 -4
  386. package/mobile/lib/EventBus/EventMap.js +0 -2
  387. package/mobile/lib/EventBus/EventMap.js.map +0 -1
  388. package/mobile/lib/components/StepsBlock/renderStepContent.d.ts +0 -11
  389. package/mobile/lib/components/StepsBlock/renderStepContent.js +0 -16
  390. package/mobile/lib/components/StepsBlock/renderStepContent.js.map +0 -1
  391. package/mobile/lib/services/BlockRouter/useBlockRouter.d.ts +0 -2
  392. package/mobile/lib/services/BlockRouter/useBlockRouter.js +0 -5
  393. package/mobile/lib/services/BlockRouter/useBlockRouter.js.map +0 -1
  394. package/mobile/lib/utils/checkIsIconRenderable.d.ts +0 -2
  395. package/mobile/lib/utils/checkIsIconRenderable.js +0 -2
  396. package/mobile/lib/utils/checkIsIconRenderable.js.map +0 -1
  397. package/mobile/src/EventBus/EventMap.ts +0 -5
  398. package/mobile/src/components/StepsBlock/renderStepContent.tsx +0 -83
  399. package/mobile/src/services/BlockRouter/useBlockRouter.ts +0 -5
  400. package/mobile/src/utils/checkIsIconRenderable.tsx +0 -3
  401. package/src/EventBus/EventMap.ts +0 -5
  402. package/src/components/StepsBlock/renderStepContent.tsx +0 -83
  403. package/src/services/BlockRouter/useBlockRouter.ts +0 -5
  404. package/src/utils/checkIsIconRenderable.tsx +0 -3
@@ -5,8 +5,10 @@ const uni_jsx_1 = require("@redneckz/uni-jsx");
5
5
  const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
6
6
  const Heading_1 = require("../../ui-kit/Heading/Heading");
7
7
  const Img_1 = require("../../ui-kit/Img/Img");
8
- const checkIsIconRenderable_1 = require("../../utils/checkIsIconRenderable");
8
+ const RichText_1 = require("../../ui-kit/RichText/RichText");
9
+ const assertUnreachable_1 = require("../../utils/assertUnreachable");
9
10
  const getIconWithVersion_1 = require("../../utils/getIconWithVersion");
11
+ const checkCanRenderIcon_1 = require("./checkCanRenderIcon");
10
12
  const StepsBlockStyleMaps_1 = require("./StepsBlockStyleMaps");
11
13
  const STEPS_SIZE_MAP = {
12
14
  normal: 'h-[70px] w-[70px] min-w-[70px] min-h-[70px]',
@@ -18,9 +20,27 @@ const STEPS_TILE_DESCRIPTION_HEIGHT_MAP = {
18
20
  };
19
21
  exports.StepsBlock = (0, uni_jsx_1.JSX)(({ className = '', title, description, showLines = true, steps, size = 'normal', version = 'primary', ...rest }) => {
20
22
  const styleMap = StepsBlockStyleMaps_1.STEPS_BLOCK_STYLE_MAPS[version];
21
- return ((0, jsx_runtime_1.jsxs)(BlockWrapper_1.BlockWrapper, { className: `box-border px-4 py-6 flex flex-col ${className}`, version: version, ...rest, children: [title ? (0, jsx_runtime_1.jsx)(Heading_1.Heading, { headingType: "h3", className: "text-center", title: title }) : null, description ? ((0, jsx_runtime_1.jsx)("p", { className: `text-m-light text-center ${styleMap.description} ${title ? 'mt-2' : ''}`, children: description })) : null, steps?.length ? ((0, jsx_runtime_1.jsx)("div", { className: `box-border py-0.5 mb-0.5 mt-5`, children: (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col justify-between gap-x-[101px]", children: steps.map(renderStepTitle(size, version, showLines)) }) })) : null] }));
23
+ return ((0, jsx_runtime_1.jsxs)(BlockWrapper_1.BlockWrapper, { className: `box-border px-4 py-6 flex flex-col ${className}`, version: version, ...rest, children: [title ? (0, jsx_runtime_1.jsx)(Heading_1.Heading, { headingType: "h3", className: "text-center", title: title }) : null, description ? ((0, jsx_runtime_1.jsx)("p", { className: `text-m-light text-center ${styleMap.description} ${title ? 'mt-2' : ''}`, children: description })) : null, steps?.length ? ((0, jsx_runtime_1.jsx)("div", { className: `box-border py-0.5 mb-0.5 mt-5`, children: (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col justify-between gap-x-[101px]", children: steps.map(renderStep(size, version, showLines)) }) })) : null] }));
22
24
  });
23
- const renderStepTitle = (size, version, showLines) => (step, i, steps) => {
25
+ // TODO: Create universal function for this case
26
+ const renderStep = (size, version, showLines) =>
27
+ // Linter doesn't understand that switch processes all cases
28
+ // eslint-disable-next-line consistent-return
29
+ (step, i, steps) => {
30
+ const { type } = step;
31
+ if (!(type === 'default' || type === 'rte')) {
32
+ return null;
33
+ }
34
+ switch (type) {
35
+ case 'default':
36
+ return renderDefaultStep(size, version, showLines)(step, i, steps);
37
+ case 'rte':
38
+ return (0, jsx_runtime_1.jsx)(RichText_1.RichText, { __html: step.__html });
39
+ default:
40
+ (0, assertUnreachable_1.assertUnreachable)(step);
41
+ }
42
+ };
43
+ const renderDefaultStep = (size, version, showLines) => (step, i, steps) => {
24
44
  const isLastStep = steps.length - 1 === i;
25
45
  const margin = size === 'normal' ? 'ml-[34px]' : 'ml-6';
26
46
  const styleMap = StepsBlockStyleMaps_1.STEPS_BLOCK_STYLE_MAPS[version];
@@ -31,6 +51,6 @@ const renderIconArea = (size, version) => (step, i) => {
31
51
  const iconAreaSize = STEPS_SIZE_MAP[size];
32
52
  const iconSize = size === 'normal' ? '38' : '27';
33
53
  const iconTextSize = size === 'normal' ? 'text-m-title' : 'text-m-title-xs';
34
- return ((0, jsx_runtime_1.jsx)("div", { className: `${iconAreaSize} ${styleMap.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`, children: (0, jsx_runtime_1.jsx)("span", { className: `font-medium flex self-center ${iconTextSize}`, children: (0, checkIsIconRenderable_1.checkIsIconRenderable)(step?.icon) ? ((0, jsx_runtime_1.jsx)(Img_1.Img, { image: (0, getIconWithVersion_1.getIconWithVersion)({ ...step.icon }, version), width: iconSize, height: iconSize, asSVG: true })) : ((0, jsx_runtime_1.jsx)("span", { children: i + 1 })) }) }));
54
+ return ((0, jsx_runtime_1.jsx)("div", { className: `${iconAreaSize} ${styleMap.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`, children: (0, jsx_runtime_1.jsx)("span", { className: `font-medium flex self-center ${iconTextSize}`, children: (0, checkCanRenderIcon_1.checkCanRenderIcon)(step?.icon) ? ((0, jsx_runtime_1.jsx)(Img_1.Img, { image: (0, getIconWithVersion_1.getIconWithVersion)({ ...step.icon }, version), width: iconSize, height: iconSize, asSVG: true })) : ((0, jsx_runtime_1.jsx)("span", { children: i + 1 })) }) }));
35
55
  };
36
56
  //# sourceMappingURL=StepsBlock.mobile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StepsBlock.mobile.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/StepsBlock.mobile.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAIxC,4DAAyD;AACzD,0DAAuD;AACvD,8CAA2C;AAC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model/BlockVersion';
2
+ import type { DefaultListItemType } from '../../model/DefaultListItemType';
2
3
  import type { DescriptionProps, HeadlineCommonProps, LabelProps } from '../../model/HeadlineType';
3
4
  import type { IconProps } from '../../model/Picture';
5
+ import type { RichTextItem } from '../../model/RichTextItem';
4
6
  import type { SizeVersion } from '../../model/SizeVersion';
5
7
  import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
6
8
  declare type StepCommonProps = IconProps & {
@@ -14,10 +16,18 @@ declare type StepCommonProps = IconProps & {
14
16
  /** @title Список */
15
17
  items?: string[];
16
18
  };
19
+ /**
20
+ * @title Стандартный
21
+ */
22
+ export declare type DefaultStep = DescriptionProps & LabelProps & StepCommonProps & DefaultListItemType;
23
+ /**
24
+ * @title Форматированный текст
25
+ */
26
+ declare type RichTextStep = RichTextItem & IconProps;
17
27
  /**
18
28
  * @title Шаг
19
29
  */
20
- export declare type Step = DescriptionProps & LabelProps & StepCommonProps;
30
+ export declare type Step = DefaultStep | RichTextStep;
21
31
  /**
22
32
  * @title Блок шаги
23
33
  */
@@ -0,0 +1,2 @@
1
+ import type { Picture } from '../../model/Picture';
2
+ export declare const checkCanRenderIcon: (icon?: Picture) => boolean;
@@ -0,0 +1,5 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.checkCanRenderIcon = void 0;
3
+ const checkCanRenderIcon = (icon) => Boolean(icon?.icon || icon?.src);
4
+ exports.checkCanRenderIcon = checkCanRenderIcon;
5
+ //# sourceMappingURL=checkCanRenderIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkCanRenderIcon.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/checkCanRenderIcon.ts"],"names":[],"mappings":";;AAEO,MAAM,kBAAkB,GAAG,CAAC,IAAc,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,GAAG,CAAC,CAAC;AAA1E,QAAA,kBAAkB,sBAAwD"}
@@ -2,10 +2,10 @@ import type { BlockVersion } from '../../model/BlockVersion';
2
2
  import type { VNode } from '../../model/VNode';
3
3
  import type { Step } from './StepsBlockContent';
4
4
  import type { StyleType } from './StepsBlockStyleMaps';
5
- export declare const renderStepContent: ({ styleMap, isMainButton, version, }: {
5
+ interface RenderStepProps {
6
6
  styleMap: StyleType;
7
7
  isMainButton: boolean;
8
- version?: BlockVersion | undefined;
9
- }) => (step: Step, i: number, { length }: {
10
- length: number;
11
- }) => VNode;
8
+ version?: BlockVersion;
9
+ }
10
+ export declare const renderStep: (props: RenderStepProps) => (step: Step, i: number, arr: Step[]) => VNode;
11
+ export {};
@@ -0,0 +1,34 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.renderStep = void 0;
3
+ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
+ const Button_1 = require("../../ui-kit/Button/Button");
5
+ const List_1 = require("../../ui-kit/List/List");
6
+ const RichText_1 = require("../../ui-kit/RichText/RichText");
7
+ const Text_1 = require("../../ui-kit/Text/Text");
8
+ const assertUnreachable_1 = require("../../utils/assertUnreachable");
9
+ const style_1 = require("../../utils/style");
10
+ // TODO: Create universal function for this case
11
+ const renderStep = (props) =>
12
+ // Linter doesn't understand that switch processes all cases
13
+ // eslint-disable-next-line consistent-return
14
+ (step, i, arr) => {
15
+ const { type } = step;
16
+ if (!(type === 'default' || type === 'rte')) {
17
+ return null;
18
+ }
19
+ switch (type) {
20
+ case 'default':
21
+ return renderDefaultStep(props)(step, i, arr);
22
+ case 'rte':
23
+ return (0, jsx_runtime_1.jsx)(RichText_1.RichText, { __html: step.__html });
24
+ default:
25
+ (0, assertUnreachable_1.assertUnreachable)(step);
26
+ }
27
+ };
28
+ exports.renderStep = renderStep;
29
+ const renderDefaultStep = ({ styleMap, isMainButton, version }) => (step, i, arr) => {
30
+ const { label, description, button, items, isDotted } = step;
31
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)('relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden', getContainerWidth(arr.length)), children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)(button?.text ? 'mb-8' : '', 'text-center'), children: [label ? ((0, jsx_runtime_1.jsx)("div", { className: "mb-2", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { size: "text-h6", children: label }) })) : null, (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center", children: [description ? (0, jsx_runtime_1.jsx)("div", { className: styleMap.description, children: description }) : null, (0, jsx_runtime_1.jsx)(List_1.List, { className: (0, style_1.style)(description ? `${styleMap.description} mt-0.5` : 'text-h6'), items: items, listItemSize: "M", isDotted: isDotted })] })] }), button?.text && !isMainButton ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { className: "box-border py-3 h-12 w-full max-w-[240px] mt-auto", version: version, ...button, children: button?.text })) : null] }, String(i)));
32
+ };
33
+ const getContainerWidth = (length) => (length < 5 ? 'w-[276px]' : 'w-[210px]');
34
+ //# sourceMappingURL=renderStep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderStep.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStep.tsx"],"names":[],"mappings":";;;AAGA,uDAAoD;AACpD,iDAA8C;AAC9C,6DAA0D;AAC1D,iDAA8C;AAC9C,qEAAkE;AAClE,6CAA0C;AAU1C,gDAAgD;AACzC,MAAM,UAAU,GACrB,CAAC,KAAsB,EAAE,EAAE;AAC3B,4DAA4D;AAC5D,6CAA6C;AAC7C,CAAC,IAAU,EAAE,CAAS,EAAE,GAAW,EAAS,EAAE;IAC5C,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAEtB,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,KAAK,CAAC,EAAE;QAC3C,OAAO,IAAI,CAAC;KACb;IAED,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CA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AM,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAC/B,uBAAC,eAAM,IACL,SAAS,EAAC,mDAAmD,EAC7D,OAAO,EAAE,OAAwB,KAC7B,MAAM,YAET,MAAM,EAAE,IAAI,GACN,CACV,CAAC,CAAC,CAAC,IAAI,KA9BH,MAAM,CAAC,CAAC,CAAC,CA+BV,CACP,CAAC;AACJ,CAAC,CAAC;AAEJ,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC"}
@@ -3,14 +3,14 @@ exports.Tabs = void 0;
3
3
  const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
4
  const uni_jsx_1 = require("@redneckz/uni-jsx");
5
5
  const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
6
- const EventBus_1 = require("../../EventBus/EventBus");
6
+ const defaultEventBus_1 = require("../../EventBus/defaultEventBus");
7
7
  const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
8
8
  const renderTab_1 = require("./renderTab");
9
9
  const ScrollableTabs_1 = require("./ScrollableTabs");
10
10
  exports.Tabs = (0, uni_jsx_1.JSX)((props) => {
11
11
  const { className = '', tabs, showCounter, isSticky, tabsMode, ...rest } = props;
12
12
  const [currentTab, setCurrentTab] = (0, hooks_1.useState)(tabs ? tabs[0] : undefined);
13
- (0, hooks_1.useEffect)(() => EventBus_1.EventBus.inst.subscribe('tab', (event) => {
13
+ (0, hooks_1.useEffect)(() => defaultEventBus_1.defaultEventBus.subscribe('tab', (event) => {
14
14
  const tab = tabs?.find(checkTab(event));
15
15
  if (event.type === 'link' && tab) {
16
16
  setCurrentTab(tab);
@@ -18,11 +18,11 @@ exports.Tabs = (0, uni_jsx_1.JSX)((props) => {
18
18
  return [];
19
19
  }), [tabs]);
20
20
  (0, hooks_1.useEffect)(() => currentTab?.type === 'group'
21
- ? EventBus_1.EventBus.inst.subject('tab', { type: currentTab.type, label: currentTab.ref })
21
+ ? defaultEventBus_1.defaultEventBus.subject('tab', { type: currentTab.type, label: currentTab.ref })
22
22
  : undefined, [currentTab]);
23
23
  const handleClick = (0, hooks_1.useCallback)((selectedTab) => {
24
24
  if (selectedTab?.type === 'group') {
25
- EventBus_1.EventBus.inst.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
25
+ defaultEventBus_1.defaultEventBus.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
26
26
  }
27
27
  setCurrentTab(selectedTab);
28
28
  }, []);
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAA+E;AAC/E,sDAAmD;AAEnD,4DAAyD;AACzD,2CAAwC;AACxC,qDAAkD;AAUrC,QAAA,IAAI,GAAG,IAAA,aAAG,EAAiB,CAAC,KAAK,EAAE,EAAE;IAChD,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAEjF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEzE,IAAA,iBAAS,EACP,GAAG,EAAE,CACH,mBAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;QACvC,MAAM,GAAG,GAAG,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QACxC,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,GAAG,EAAE;YAChC,aAAa,CAAC,GAAG,CAAC,CAAC;SACpB;QAED,OAAO,EAAE,CAAC;IAC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AE,UAAU,CAAC,GAAG,EAAE,CAAC;QAClF,CAAC,CAAC,SAAS,EACf,CAAC,UAAU,CAAC,CACb,CAAC;IAEF,MAAM,WAAW,GAAG,IAAA,mBAAW,EAAC,CAAC,WAAoB,EAAE,EAAE;QACvD,IAAI,WAAW,EAAE,IAAI,KAAK,OAAO,EAAE;YACjC,iCAAe,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC;SACjF;QACD,aAAa,CAAC,WAAW,CAAC,CAAC;IAC7B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,uBAAC,2BAAY,IACX,SAAS,EAAE,2CACT,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,EACpC,IAAI,SAAS,EAAE,EACf,IAAI,EAAC,SAAS,KACV,IAAI,YAEP,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,CAC3B,uBAAC,+BAAc,IACb,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,KACpB,IAAI,GACR,CACH,CAAC,CAAC,CAAC,CACF,IAAI,EAAE,GAAG,CACP,IAAA,qBAAS,EAAC;YACR,OAAO,EAAE,WAAW;YACpB,UAAU;YACV,WAAW;YACX,GAAG,IAAI;SACR,CAAC,CACH,CACF,GACY,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,CAAC,KAAyB,EAAE,EAAE,CAAC,CAAC,CAAU,EAAE,EAAE,CAC7D,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC"}
@@ -7,13 +7,13 @@ const renderButtonsSection_1 = require("../../ui-kit/Button/renderButtonsSection
7
7
  const Heading_1 = require("../../ui-kit/Heading/Heading");
8
8
  const Img_1 = require("../../ui-kit/Img/Img");
9
9
  const List_1 = require("../../ui-kit/List/List");
10
- const Paragraph_1 = require("../../ui-kit/Paragraph/Paragraph");
10
+ const RichText_1 = require("../../ui-kit/RichText/RichText");
11
11
  const Tags_1 = require("../../ui-kit/Tags/Tags");
12
12
  const BaseTile_1 = require("../BaseTile/BaseTile");
13
13
  const getTileMinHeight_1 = require("../BaseTile/getTileMinHeight");
14
14
  const getTileRightPadding_1 = require("../BaseTile/getTileRightPadding");
15
- exports.Tile = (0, uni_jsx_1.JSX)(({ title, headingType = 'h3', description, items, buttons, image, isDotted = true, listItemSize = 'M', className = '', tags, children, ...rest }) => ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: `overflow-hidden p-9 pr-3 box-border ${(0, getTileRightPadding_1.getTileRightPadding)(className)} ${(0, getTileMinHeight_1.getTileMinHeight)(className)} ${className}`, ...rest, children: (0, jsx_runtime_1.jsxs)(BaseTile_1.BaseTile, { title: title ? ((0, jsx_runtime_1.jsx)(Heading_1.Heading, { headingType: headingType, as: "h2", title: title, className: `whitespace-pre-wrap max-w-[600px]` })) : null, buttons: (0, renderButtonsSection_1.renderButtonsSection)(buttons, {
15
+ exports.Tile = (0, uni_jsx_1.JSX)(({ title, headingType = 'h3', __html, items, buttons, image, isDotted = true, listItemSize = 'M', className = '', tags, children, ...rest }) => ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: `overflow-hidden p-9 pr-3 box-border ${(0, getTileRightPadding_1.getTileRightPadding)(className)} ${(0, getTileMinHeight_1.getTileMinHeight)(className)} ${className}`, ...rest, children: (0, jsx_runtime_1.jsxs)(BaseTile_1.BaseTile, { title: title ? ((0, jsx_runtime_1.jsx)(Heading_1.Heading, { headingType: headingType, as: "h2", title: title, className: `whitespace-pre-wrap max-w-[600px]` })) : null, buttons: (0, renderButtonsSection_1.renderButtonsSection)(buttons, {
16
16
  className: 'mt-8',
17
17
  buttonClassName: 'min-w-[158px]',
18
- }), image: image?.src ? (0, jsx_runtime_1.jsx)(Img_1.Img, { className: "mt-auto ml-7", image: image }) : null, children: [description ? ((0, jsx_runtime_1.jsx)("div", { className: "max-w-[600px] mt-2.5", children: (0, jsx_runtime_1.jsx)(Paragraph_1.Paragraph, { size: "text-xl-light", children: description }) })) : null, children, (0, jsx_runtime_1.jsx)(List_1.List, { className: "mt-2.5", itemClassName: "mb-1.5", items: items, isDotted: isDotted, listItemSize: listItemSize }), tags?.length ? (0, jsx_runtime_1.jsx)(Tags_1.Tags, { tags: tags, className: "mt-5" }) : null] }) })));
18
+ }), image: image?.src ? (0, jsx_runtime_1.jsx)(Img_1.Img, { className: "mt-auto ml-7", image: image }) : null, children: [__html ? ((0, jsx_runtime_1.jsx)("div", { className: "max-w-[600px] mt-2.5", children: (0, jsx_runtime_1.jsx)(RichText_1.RichText, { __html: __html }) })) : null, children, (0, jsx_runtime_1.jsx)(List_1.List, { className: "mt-2.5", itemClassName: "mb-1.5", items: items, isDotted: isDotted, listItemSize: listItemSize }), tags?.length ? (0, jsx_runtime_1.jsx)(Tags_1.Tags, { tags: tags, className: "mt-5" }) : null] }) })));
19
19
  //# sourceMappingURL=Tile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tile.js","sourceRoot":"","sources":["../../../src/components/Tile/Tile.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,4DAAyD;AACzD,mFAAgF;AAChF,0DAAuD;AACvD,8CAA2C;AAC3C,iDAA8C;AAC9C,gEAA6D;AAC7D,iDAA8C;AAC9C,mDAAgD;AAChD,mEAAgE;AAChE,yEAAsE;AAKzD,QAAA,IAAI,GAAG,IAAA,aAAG,EACrB,CAAC,EACC,KAAK,EACL,WAAW,GAAG,IAAI,EAClB,WAAW,EACX,KAAK,EACL,OAAO,EACP,KAAK,EACL,QAAQ,GAAG,IAAI,EACf,YAAY,GAAG,GAAG,EAClB,SAAS,GAAG,EAAE,EACd,IAAI,EACJ,QAAQ,EACR,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a,EAAC,QAAQ,EACtB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,GAC1B,EACD,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,uBAAC,WAAI,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,IACnD,GACE,CAChB,CACF,CAAC"}
@@ -1,15 +1,15 @@
1
1
  import type { BlockVersion } from '../../model/BlockVersion';
2
- import type { DescriptionProps } from '../../model/HeadlineType';
3
2
  import type { Picture } from '../../model/Picture';
4
3
  import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
5
4
  import type { HeadingCommonProps } from '../../ui-kit/Heading/HeadingProps';
6
5
  import type { ListContent } from '../../ui-kit/List/ListContent';
7
6
  import type { ListItemSize } from '../../ui-kit/List/ListProps';
7
+ import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
8
8
  import type { TagsContent } from '../../ui-kit/Tags/TagsContent';
9
9
  /**
10
10
  * @title Плитка
11
11
  */
12
- export declare type TileContent = HeadingCommonProps & DescriptionProps & ListContent & ButtonContent & TagsContent & {
12
+ export declare type TileContent = HeadingCommonProps & RichTextProps & ListContent & ButtonContent & TagsContent & {
13
13
  /**
14
14
  * @default {
15
15
  * "format": "webp",
@@ -1,13 +1,12 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
2
  exports.useLink = void 0;
3
3
  const ProjectSettings_1 = require("../ProjectSettings");
4
- const useBlockRouter_1 = require("../services/BlockRouter/useBlockRouter");
4
+ const BlockRouter_1 = require("../services/BlockRouter/BlockRouter");
5
5
  const url_1 = require("../utils/url");
6
6
  const handlerDecorator_1 = require("./handlerDecorator");
7
7
  const useRouter_1 = require("./useRouter");
8
8
  function useLink(isRemote) {
9
9
  const router = (0, useRouter_1.useRouter)();
10
- const blockRouter = (0, useBlockRouter_1.useBlockRouter)();
11
10
  return (props) => ({
12
11
  ...props,
13
12
  href: adjustHref(props.href),
@@ -30,7 +29,7 @@ function useLink(isRemote) {
30
29
  // Client routing
31
30
  ev?.preventDefault();
32
31
  if ((0, url_1.isHash)(href)) {
33
- blockRouter.goto(href);
32
+ (0, BlockRouter_1.gotoBlock)(router, href);
34
33
  }
35
34
  else if (href) {
36
35
  router.push(href);
@@ -1 +1 @@
1
- {"version":3,"file":"useLink.js","sourceRoot":"","sources":["../../src/hooks/useLink.ts"],"names":[],"mappings":";;AACA,wDAAqD;AACrD,2EAAwE;AACxE,sCAA4D;AAC5D,yDAAsD;AACtD,2CAAwC;AAUxC,SAAgB,OAAO,CAAC,QAAkB;IACxC,MAAM,MAAM,GAAG,IAAA,qBAAS,GAAE,CAAC;IAC3B,MAAM,WAAW,GAAG,IAAA,+BAAc,GAAE,CAAC;IAErC,OAAO,CAA2C,KAAQ,EAAiB,EAAE,CAAC,CAAC;QAC7E,GAAG,KAAK;QACR,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5B,YAAY,EAAE,KAAK,CAAC,IAAI;QACxB,OAAO,EAAE,IAAA,mCAAgB,EAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;KACpD,CAAC,CAAC;IAEH,SAAS,UAAU,CAAC,IAAwB;QAC1C,MAAM,gBAAgB,GAAG,CAAC,QAAQ,IAAI,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;QAE5D,OAAO,iCAAe,CAAC,SAAS,IAAI,IAAI,IAAI,gBAAgB;YAC1D,CAAC,CAAC,IAAA,cAAQ,EAAC,iCAAe,CAAC,SAAS,EAAE,IAAI,CAAC;YAC3C,CAAC,CAAC,IAAI,CAAC;IACX,CAAC;IAED,SAAS,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAkC;QAC3E,OAAO,CAAC,EAAqB,EAAE,EAAE;YAC/B,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC;YAEvB,IAAI,QAAQ,IAAI,CAAC,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OAAO,CAAC,EAAqB,EAAE,EAAE;YAC/B,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC;YAEvB,IAAI,QAAQ,IAAI,CAAC,IAAA,gBAAU,EAAC,IAAI,EAAE,MAAM,CAAC,EAAE;gBACzC,kBAAkB;gBAClB,OAAO;aACR;YAED,iBAAiB;YACjB,EAAE,EAAE,cAAc,EAAE,CAAC;YACrB,IAAI,IAAA,YAAM,EAAC,IAAI,CAAC,EAAE;gBAChB,IAAA,uBAAS,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC;aACzB;iBAAM,IAAI,IAAI,EAAE;gBACf,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACnB;QACH,CAAC,CAAC;IACJ,CAAC;AACH,CAAC;AApCD,0BAoCC"}
@@ -1,13 +1,17 @@
1
+ interface RouterOptions {
2
+ scroll?: boolean;
3
+ }
1
4
  export interface Router {
2
5
  pathname: string;
3
6
  query: Record<string, string | string[] | undefined>;
4
7
  href?: string;
5
8
  basePath?: string;
6
- push: (url: string) => void;
7
- replace: (url: string) => void;
9
+ push: (url: string, as?: string, options?: RouterOptions) => void;
10
+ replace: (url: string, as?: string, options?: RouterOptions) => void;
8
11
  }
9
12
  export declare function useRouter(): Router;
10
13
  export declare namespace useRouter {
11
14
  var _impl: () => Router;
12
15
  var setup: (impl: () => Router) => void;
13
16
  }
17
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"useRouter.js","sourceRoot":"","sources":["../../src/hooks/useRouter.ts"],"names":[],"mappings":";;AASA,SAAgB,SAAS;IACvB,OAAO,SAAS,CAAC,KAAK,EAAE,CAAC;AAC3B,CAAC;AAFD,8BAEC;AAED,SAAS,CAAC,KAAK,GAAG,GAAW,EAAE,CAAC,CAAC;IAC/B,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE,IAAI,IAAI,GAAG;IACtC,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG;IAC9C,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,GAAG,EAAE;QACT,aAAa;IACf,CAAC;IACD,OAAO,EAAE,GAAG,EAAE;QACZ,aAAa;IACf,CAAC;CACF,CAAC,CAAC;AAEH,SAAS,CAAC,KAAK,GAAG,CAAC,IAAkB,EAAE,EAAE;IACvC,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;AACzB,CAAC,CAAC"}
1
+ {"version":3,"file":"useRouter.js","sourceRoot":"","sources":["../../src/hooks/useRouter.ts"],"names":[],"mappings":";;AAaA,SAAgB,SAAS;IACvB,OAAO,SAAS,CAAC,KAAK,EAAE,CAAC;AAC3B,CAAC;AAFD,8BAEC;AAED,SAAS,CAAC,KAAK,GAAG,GAAW,EAAE,CAAC,CAAC;IAC/B,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE,IAAI,IAAI,GAAG;IACtC,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG;IAC9C,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,GAAG,EAAE;QACT,aAAa;IACf,CAAC;IACD,OAAO,EAAE,GAAG,EAAE;QACZ,aAAa;IACf,CAAC;CACF,CAAC,CAAC;AAEH,SAAS,CAAC,KAAK,GAAG,CAAC,IAAkB,EAAE,EAAE;IACvC,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;AACzB,CAAC,CAAC"}
@@ -1,23 +1,4 @@
1
- import { EventBus } from '../../EventBus/EventBus';
1
+ import type { Router } from '../../hooks/useRouter';
2
2
  import type { BlockDef } from '../../model/ContentPageDef';
3
- export interface GotoAnchorEvent {
4
- anchor: string;
5
- }
6
- export interface BlockIntersectionEvent {
7
- block: BlockDef;
8
- intersection: IntersectionObserverEntry;
9
- }
10
- interface EventMap {
11
- goto: GotoAnchorEvent;
12
- intersection: BlockIntersectionEvent;
13
- }
14
- export declare class BlockRouter {
15
- static readonly inst: BlockRouter;
16
- readonly eventBus: EventBus<EventMap>;
17
- constructor();
18
- goto(rawAnchor?: string): void;
19
- push(rawAnchor: string): void;
20
- replace(rawAnchor: string): void;
21
- reset(): void;
22
- }
23
- export {};
3
+ export declare function gotoBlock(router: Router, anchor?: string): void;
4
+ export declare function trackBlock(router: Router, block?: BlockDef): void;
@@ -1,33 +1,14 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.BlockRouter = void 0;
3
- const EventBus_1 = require("../../EventBus/EventBus");
4
- const normalizeAnchor = (rawAnchor) => rawAnchor?.replace('#', '') || '';
5
- const getURLWithAnchor = (rawAnchor) => `${globalThis.location?.pathname}#${normalizeAnchor(rawAnchor)}`;
6
- class BlockRouter {
7
- static inst = new BlockRouter();
8
- eventBus = new EventBus_1.EventBus();
9
- constructor() {
10
- const anchor = normalizeAnchor(globalThis.location?.hash);
11
- if (anchor) {
12
- this.eventBus.subject('goto', { anchor });
13
- }
14
- }
15
- goto(rawAnchor) {
16
- const anchor = normalizeAnchor(rawAnchor);
17
- if (anchor) {
18
- this.push(anchor);
19
- this.eventBus.fire('goto', { anchor });
20
- }
21
- }
22
- push(rawAnchor) {
23
- globalThis.history?.pushState(null, '', getURLWithAnchor(rawAnchor));
24
- }
25
- replace(rawAnchor) {
26
- globalThis.history?.replaceState(null, '', getURLWithAnchor(rawAnchor));
27
- }
28
- reset() {
29
- globalThis.history?.replaceState(null, '', getURLWithAnchor());
30
- }
2
+ exports.trackBlock = exports.gotoBlock = void 0;
3
+ const normalizeAnchor = (anchor) => anchor?.replace('#', '') || '';
4
+ function gotoBlock(router, anchor) {
5
+ router.replace(`#${normalizeAnchor(anchor)}`);
31
6
  }
32
- exports.BlockRouter = BlockRouter;
7
+ exports.gotoBlock = gotoBlock;
8
+ function trackBlock(router, block) {
9
+ router.replace(`#${normalizeAnchor(block?.anchor)}`, undefined, {
10
+ scroll: false,
11
+ });
12
+ }
13
+ exports.trackBlock = trackBlock;
33
14
  //# sourceMappingURL=BlockRouter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlockRouter.js","sourceRoot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EAAE,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACjE,CAAC;;AA9BH,kCA+BC"}
1
+ {"version":3,"file":"BlockRouter.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/BlockRouter.ts"],"names":[],"mappings":";;AAGA,MAAM,eAAe,GAAG,CAAC,MAAe,EAAE,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAE5E,SAAgB,SAAS,CAAC,MAAc,EAAE,MAAe;IACvD,MAAM,CAAC,OAAO,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAChD,CAAC;AAFD,8BAEC;AAED,SAAgB,UAAU,CAAC,MAAc,EAAE,KAAgB;IACzD,MAAM,CAAC,OAAO,CAAC,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE;QAC9D,MAAM,EAAE,KAAK;KACd,CAAC,CAAC;AACL,CAAC;AAJD,gCAIC"}
@@ -0,0 +1,11 @@
1
+ import { EventBus } from '../../EventBus/EventBus';
2
+ import type { BlockDef } from '../../model/ContentPageDef';
3
+ export interface BlockIntersectionEvent {
4
+ block: BlockDef;
5
+ intersection: IntersectionObserverEntry;
6
+ }
7
+ interface EventMap {
8
+ intersection: BlockIntersectionEvent;
9
+ }
10
+ export declare const blockRouterEventBus: EventBus<EventMap>;
11
+ export {};
@@ -0,0 +1,5 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.blockRouterEventBus = void 0;
3
+ const EventBus_1 = require("../../EventBus/EventBus");
4
+ exports.blockRouterEventBus = new EventBus_1.EventBus();
5
+ //# sourceMappingURL=blockRouterEventBus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockRouterEventBus.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/blockRouterEventBus.ts"],"names":[],"mappings":";;AAAA,sDAAmD;AAYtC,QAAA,mBAAmB,GAAG,IAAI,mBAAQ,EAAY,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import type { BlockDef } from '../../model/ContentPageDef';
2
- import { BlockRouter } from './BlockRouter';
3
- export declare function useBlockIntersectionObserver(block?: BlockDef, router?: BlockRouter): {
2
+ export declare function useBlockIntersectionObserver(block?: BlockDef): {
4
3
  current: Element | null;
5
4
  };
@@ -2,27 +2,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
2
2
  exports.useBlockIntersectionObserver = void 0;
3
3
  const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
4
4
  const useIntersectionObserver_1 = require("../../hooks/useIntersectionObserver");
5
- const BlockRouter_1 = require("./BlockRouter");
6
- function useBlockIntersectionObserver(block, router = BlockRouter_1.BlockRouter.inst) {
5
+ const blockRouterEventBus_1 = require("./blockRouterEventBus");
6
+ function useBlockIntersectionObserver(block) {
7
7
  const observerCallback = (0, hooks_1.useCallback)((entries) => {
8
8
  if (!block || !entries?.length) {
9
9
  return;
10
10
  }
11
11
  const intersection = entries[entries.length - 1];
12
- router.eventBus.fire('intersection', { block, intersection });
13
- }, [block, router]);
14
- const ref = (0, useIntersectionObserver_1.useIntersectionObserver)(observerCallback, { sensitivity: 1 });
15
- (0, hooks_1.useEffect)(() => {
16
- if (!ref.current) {
17
- return undefined;
18
- }
19
- return router.eventBus.subscribe('goto', ({ anchor }) => {
20
- if (ref.current && block?.anchor === anchor) {
21
- ref.current.scrollIntoView({ behavior: 'smooth', block: 'start' });
22
- }
23
- });
24
- }, [block, router]);
25
- return ref;
12
+ blockRouterEventBus_1.blockRouterEventBus.fire('intersection', { block, intersection });
13
+ }, [block]);
14
+ return (0, useIntersectionObserver_1.useIntersectionObserver)(observerCallback, { sensitivity: 1 });
26
15
  }
27
16
  exports.useBlockIntersectionObserver = useBlockIntersectionObserver;
28
17
  //# sourceMappingURL=useBlockIntersectionObserver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useBlockIntersectionObserver.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockIntersectionObserver.ts"],"names":[],"mappings":";;AAAA,uDAAqE;AACrE,iFAA8E;AAE9E,+CAA4C;AAE5C,SAAgB,4BAA4B,CAC1C,KAAgB,EAChB,SAAsB,yBAAW,CAAC,IAAI;IAEtC,MAAM,gBAAgB,GAAG,IAAA,mBAAW,EAClC,CAAC,OAAoC,EAAE,EAAE;QACvC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE;YAC9B,OAAO;SACR;QAED,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;IAChE,CAAC,EACD,CAAC,KAAK,EAAE,MAAM,CAAC,CAChB,CAAC;IAEF,MAAM,GAAG,GAAG,IAAA,iDAAuB,EAAC,gBAAgB,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC;IAE1E,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE;YAChB,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;YACtD,IAAI,GAAG,CAAC,OAAO,IAAI,KAAK,EAAE,MAAM,KAAK,MAAM,EAAE;gBAC3C,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;aACpE;QACH,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAEpB,OAAO,GAAG,CAAC;AACb,CAAC;AA/BD,oEA+BC"}
1
+ {"version":3,"file":"useBlockIntersectionObserver.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockIntersectionObserver.ts"],"names":[],"mappings":";;AAAA,uDAA0D;AAC1D,iFAA8E;AAE9E,+DAA4D;AAE5D,SAAgB,4BAA4B,CAAC,KAAgB;IAC3D,MAAM,gBAAgB,GAAG,IAAA,mBAAW,EAClC,CAAC,OAAoC,EAAE,EAAE;QACvC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE;YAC9B,OAAO;SACR;QAED,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjD,yCAAmB,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;IACpE,CAAC,EACD,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,IAAA,iDAAuB,EAAC,gBAAgB,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC;AACvE,CAAC;AAdD,oEAcC"}
@@ -1,2 +1 @@
1
- import { BlockRouter } from './BlockRouter';
2
- export declare function useBlockRouterProvider(router?: BlockRouter, scrollTarget?: EventTarget): void;
1
+ export declare function useBlockRouterProvider(scrollTarget?: EventTarget): void;
@@ -1,29 +1,28 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
2
  exports.useBlockRouterProvider = void 0;
3
3
  const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
4
+ const useRouter_1 = require("../../hooks/useRouter");
4
5
  const debounce_1 = require("../../utils/debounce");
5
6
  const BlockRouter_1 = require("./BlockRouter");
7
+ const blockRouterEventBus_1 = require("./blockRouterEventBus");
6
8
  const findActiveBlock_1 = require("./findActiveBlock");
7
9
  const isScrolledEnough = () => globalThis.scrollY > (globalThis.innerHeight * 3) / 4;
8
- function useBlockRouterProvider(router = BlockRouter_1.BlockRouter.inst, scrollTarget = globalThis) {
10
+ function useBlockRouterProvider(scrollTarget = globalThis) {
11
+ const router = (0, useRouter_1.useRouter)();
9
12
  const intersectionsMapRef = (0, hooks_1.useRef)(new Map());
10
- (0, hooks_1.useEffect)(() => router.eventBus.subscribe('intersection', ({ block, intersection }) => {
13
+ (0, hooks_1.useEffect)(() => blockRouterEventBus_1.blockRouterEventBus.subscribe('intersection', ({ block, intersection }) => {
11
14
  if (intersectionsMapRef.current) {
12
15
  intersectionsMapRef.current.set(block, intersection);
13
16
  }
14
- }), [router]);
17
+ }), []);
15
18
  (0, hooks_1.useEffect)(() => {
16
19
  const handleScroll = (0, debounce_1.debounce)(() => {
17
- if (!isScrolledEnough()) {
18
- router.reset();
19
- return;
20
+ if (isScrolledEnough()) {
21
+ const activeBlock = (0, findActiveBlock_1.findActiveBlock)([...(intersectionsMapRef.current || [])]);
22
+ (0, BlockRouter_1.trackBlock)(router, activeBlock);
20
23
  }
21
- const activeBlock = (0, findActiveBlock_1.findActiveBlock)([...(intersectionsMapRef.current || [])]);
22
- if (activeBlock?.anchor) {
23
- router.replace(activeBlock.anchor);
24
- }
25
- else if (!activeBlock) {
26
- router.reset();
24
+ else {
25
+ (0, BlockRouter_1.trackBlock)(router);
27
26
  }
28
27
  }, 100);
29
28
  scrollTarget.addEventListener('scroll', handleScroll);
@@ -1 +1 @@
1
- {"version":3,"file":"useBlockRouterProvider.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockRouterProvider.ts"],"names":[],"mappings":";;AAAA,uDAAgE;AAEhE,mDAAgD;AAChD,+CAA4C;AAC5C,uDAAoD;AAEpD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,UAAU,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAErF,SAAgB,sBAAsB,CACpC,SAAsB,yBAAW,CAAC,IAAI,EACtC,eAA4B,UAAU;IAEtC,MAAM,mBAAmB,GAAG,IAAA,cAAM,EAA2C,IAAI,GAAG,EAAE,CAAC,CAAC;IAExF,IAAA,iBAAS,EACP,GAAG,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C,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;AAC7B,CAAC;AAhCD,wDAgCC"}
@@ -3,7 +3,7 @@ exports.BlockWrapper = exports.blockStyles = void 0;
3
3
  const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
4
  const uni_jsx_1 = require("@redneckz/uni-jsx");
5
5
  const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
6
- const EventBus_1 = require("../EventBus/EventBus");
6
+ const defaultEventBus_1 = require("../EventBus/defaultEventBus");
7
7
  const useBlockIntersectionObserver_1 = require("../services/BlockRouter/useBlockIntersectionObserver");
8
8
  const style_1 = require("../utils/style");
9
9
  exports.blockStyles = {
@@ -17,7 +17,7 @@ exports.BlockWrapper = (0, uni_jsx_1.JSX)(({ className = '', version = 'primary'
17
17
  const Tag = tag;
18
18
  const ref = (0, useBlockIntersectionObserver_1.useBlockIntersectionObserver)(block);
19
19
  const [isVisible, setVisible] = (0, hooks_1.useState)(true);
20
- (0, hooks_1.useEffect)(() => EventBus_1.EventBus.inst.subscribe('tab', (event) => {
20
+ (0, hooks_1.useEffect)(() => defaultEventBus_1.defaultEventBus.subscribe('tab', (event) => {
21
21
  if (event.type === 'group') {
22
22
  const hasSettings = block?.labels?.length || block?.anchor;
23
23
  setVisible(event.label ? !hasSettings || Boolean(block?.labels?.includes(event.label)) : true);
@@ -1 +1 @@
1
- {"version":3,"file":"BlockWrapper.js","sourceRoot":"","sources":["../../src/ui-kit/BlockWrapper.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAAkE;AAClE,mDAAgD;AAGhD,uGAAoG;AACpG,0CAAuC;AAO1B,QAAA,WAAW,GAAiC;IACvD,OAAO,EAAE,4BAA4B;IACrC,SAAS,EAAE,4BAA4B;IACvC,IAAI,EAAE,mCAAmC;IACzC,WAAW,EAAE,kCAAkC;IAC/C,EAAE,EAAE,EAAE;CACP,CAAC;AAEW,QAAA,YAAY,GAAG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CACnF,CAAC;SACH;aAAM;YACL,UAAU,CAAC,IAAI,CAAC,CAAC;SAClB;IACH,CAAC,CAAC,EACJ,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,SAAS,CAAC,CAAC,CAAC,CACjB,uBAAC,GAAG,IACF,SAAS,EAAE,IAAA,aAAK,EAAC,OAAO,EAAE,mBAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,KACtD,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KACxC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EACpD,IAAI,EAAE,IAAI,YAET,QAAQ,GACL,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CACF,CAAC"}
@@ -1,7 +1,4 @@
1
- import type { EventMap } from './EventMap';
2
- export declare type BaseEventMap = Record<string, any>;
3
- export declare class EventBus<EM extends BaseEventMap> {
4
- static readonly inst: EventBus<EventMap>;
1
+ export declare class EventBus<EM extends Record<string, any>> {
5
2
  private subscribers;
6
3
  private subjectsStateMap;
7
4
  subscribe<K extends keyof EM>(type: K, listener: (event: EM[K]) => void): () => void;
@@ -1,5 +1,4 @@
1
1
  export class EventBus {
2
- static inst = new EventBus();
3
2
  subscribers = {};
4
3
  subjectsStateMap = {};
5
4
  subscribe(type, listener) {