@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
@@ -290,7 +290,6 @@
290
290
  };
291
291
 
292
292
  class EventBus {
293
- static inst = new EventBus();
294
293
  subscribers = {};
295
294
  subjectsStateMap = {};
296
295
  subscribe(type, listener) {
@@ -318,6 +317,8 @@
318
317
  }
319
318
  }
320
319
 
320
+ const defaultEventBus = new EventBus();
321
+
321
322
  const SENSITIVITY_SCALE = 10;
322
323
  function useIntersectionObserver(observerCallback, { sensitivity, rootRef } = {}) {
323
324
  const ref = useRef(null);
@@ -342,55 +343,17 @@
342
343
  .concat(1);
343
344
  }
344
345
 
345
- const normalizeAnchor = (rawAnchor) => rawAnchor?.replace('#', '') || '';
346
- const getURLWithAnchor = (rawAnchor) => `${globalThis.location?.pathname}#${normalizeAnchor(rawAnchor)}`;
347
- class BlockRouter {
348
- static inst = new BlockRouter();
349
- eventBus = new EventBus();
350
- constructor() {
351
- const anchor = normalizeAnchor(globalThis.location?.hash);
352
- if (anchor) {
353
- this.eventBus.subject('goto', { anchor });
354
- }
355
- }
356
- goto(rawAnchor) {
357
- const anchor = normalizeAnchor(rawAnchor);
358
- if (anchor) {
359
- this.push(anchor);
360
- this.eventBus.fire('goto', { anchor });
361
- }
362
- }
363
- push(rawAnchor) {
364
- globalThis.history?.pushState(null, '', getURLWithAnchor(rawAnchor));
365
- }
366
- replace(rawAnchor) {
367
- globalThis.history?.replaceState(null, '', getURLWithAnchor(rawAnchor));
368
- }
369
- reset() {
370
- globalThis.history?.replaceState(null, '', getURLWithAnchor());
371
- }
372
- }
346
+ const blockRouterEventBus = new EventBus();
373
347
 
374
- function useBlockIntersectionObserver(block, router = BlockRouter.inst) {
348
+ function useBlockIntersectionObserver(block) {
375
349
  const observerCallback = useCallback((entries) => {
376
350
  if (!block || !entries?.length) {
377
351
  return;
378
352
  }
379
353
  const intersection = entries[entries.length - 1];
380
- router.eventBus.fire('intersection', { block, intersection });
381
- }, [block, router]);
382
- const ref = useIntersectionObserver(observerCallback, { sensitivity: 1 });
383
- useEffect(() => {
384
- if (!ref.current) {
385
- return undefined;
386
- }
387
- return router.eventBus.subscribe('goto', ({ anchor }) => {
388
- if (ref.current && block?.anchor === anchor) {
389
- ref.current.scrollIntoView({ behavior: 'smooth', block: 'start' });
390
- }
391
- });
392
- }, [block, router]);
393
- return ref;
354
+ blockRouterEventBus.fire('intersection', { block, intersection });
355
+ }, [block]);
356
+ return useIntersectionObserver(observerCallback, { sensitivity: 1 });
394
357
  }
395
358
 
396
359
  const blockStyles = {
@@ -404,7 +367,7 @@
404
367
  const Tag = tag;
405
368
  const ref = useBlockIntersectionObserver(block);
406
369
  const [isVisible, setVisible] = useState(true);
407
- useEffect(() => EventBus.inst.subscribe('tab', (event) => {
370
+ useEffect(() => defaultEventBus.subscribe('tab', (event) => {
408
371
  if (event.type === 'group') {
409
372
  const hasSettings = block?.labels?.length || block?.anchor;
410
373
  setVisible(event.label ? !hasSettings || Boolean(block?.labels?.includes(event.label)) : true);
@@ -651,8 +614,14 @@
651
614
  },
652
615
  ];
653
616
 
654
- function useBlockRouter() {
655
- return BlockRouter.inst;
617
+ const normalizeAnchor = (anchor) => anchor?.replace('#', '') || '';
618
+ function gotoBlock(router, anchor) {
619
+ router.replace(`#${normalizeAnchor(anchor)}`);
620
+ }
621
+ function trackBlock(router, block) {
622
+ router.replace(`#${normalizeAnchor(block?.anchor)}`, undefined, {
623
+ scroll: false,
624
+ });
656
625
  }
657
626
 
658
627
  const isURL = (href) => Boolean(href?.includes('//'));
@@ -699,7 +668,6 @@
699
668
 
700
669
  function useLink(isRemote) {
701
670
  const router = useRouter();
702
- const blockRouter = useBlockRouter();
703
671
  return (props) => ({
704
672
  ...props,
705
673
  href: adjustHref(props.href),
@@ -722,7 +690,7 @@
722
690
  // Client routing
723
691
  ev?.preventDefault();
724
692
  if (isHash(href)) {
725
- blockRouter.goto(href);
693
+ gotoBlock(router, href);
726
694
  }
727
695
  else if (href) {
728
696
  router.push(href);
@@ -1143,8 +1111,8 @@
1143
1111
  return (jsx(BlockWrapper, { className: `font-sans bg-white p-[50px] pb-9 ${className}`, ...rest, children: jsxs("div", { className: "container max-w-[978px]", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "text-center mb-8" }) : null, COMPONENTS_MAP[typeForm]({ button, link, handleSubmit }), responceType ? jsx(ResponseNotification, { responceType: responceType }) : null] }) }));
1144
1112
  });
1145
1113
 
1146
- const BenefitsBlock = JSX(({ className = '', title, benefitList, ...rest }) => (jsxs(BlockWrapper, { className: `p-12 flex flex-col items-center ${className}`, ...rest, children: [title ? (jsx(Heading, { headingType: "h3", as: "h2", className: "max-w-[47rem] text-center", title: title })) : null, benefitList?.length ? (jsx("div", { className: "flex flex-wrap w-full justify-center gap-x-20 mt-8", children: benefitList.map(renderStep) })) : null] })));
1147
- const renderStep = (benefit, i) => {
1114
+ const BenefitsBlock = JSX(({ className = '', title, benefitList, ...rest }) => (jsxs(BlockWrapper, { className: `p-12 flex flex-col items-center ${className}`, ...rest, children: [title ? (jsx(Heading, { headingType: "h3", as: "h2", className: "max-w-[47rem] text-center", title: title })) : null, benefitList?.length ? (jsx("div", { className: "flex flex-wrap w-full justify-center gap-x-20 mt-8", children: benefitList.map(renderStep$1) })) : null] })));
1115
+ const renderStep$1 = (benefit, i) => {
1148
1116
  const description = benefit.description;
1149
1117
  return (jsxs("div", { className: "flex items-center basis-1/2 max-w-[500px] mb-14", children: [benefit?.icon?.icon ? (jsx(ImgInner, { className: "w-12 h-12 min-w-12 p-3 rounded-full bg-main-divider text-primary-main group-data-secondary:bg-white/30 group-data-secondary:text-black", image: benefit.icon, asSVG: true })) : null, benefit?.icon?.src ? jsx(ImgInner, { image: benefit.icon }) : null, jsxs("div", { className: "ml-5", children: [benefit?.label ? jsx(Heading, { headingType: "h6", children: benefit.label }) : null, renderDescription$5(description)] })] }, String(i)));
1150
1118
  };
@@ -1260,7 +1228,7 @@
1260
1228
 
1261
1229
  const BusinessBlock = JSX(({ className = '', title, cards, ...rest }) => (jsxs(BlockWrapper, { className: `p-12 pb-9 ${className}`, ...rest, children: [jsx(Heading, { headingType: "h3", title: title, className: "text-center mb-8" }), jsx("div", { className: "flex gap-5", children: cards?.length ? cards.map((_, i) => jsx(BusinessCard, { ..._ }, String(i))) : null })] })));
1262
1230
 
1263
- const ButtonBlock = JSX(({ button, ...rest }) => (jsx(BlockWrapper, { ...rest, children: renderButtonsSection([button]) })));
1231
+ const ButtonBlock = JSX(({ button, className, ...rest }) => (jsx(BlockWrapper, { className: style('!bg-transparent', className), ...rest, children: renderButtonsSection([button]) })));
1264
1232
 
1265
1233
  const useCarouselControls = (props) => {
1266
1234
  const { itemCount, visibleItemCount, isCyclic } = props;
@@ -1352,7 +1320,7 @@
1352
1320
  maxSum: 5000000,
1353
1321
  minMonths: 2,
1354
1322
  maxMonths: 120,
1355
- rate: 5.9,
1323
+ rate: 7,
1356
1324
  isMonthlyInterestPayment: true,
1357
1325
  };
1358
1326
  const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS = {
@@ -1360,7 +1328,7 @@
1360
1328
  maxSum: 500000,
1361
1329
  minDays: BUSINESS_MIN_DAYS,
1362
1330
  maxDays: BUSINESS_MAX_DAYS,
1363
- rate: 5.9,
1331
+ rate: 6.6,
1364
1332
  isMonthlyInterestPayment: true,
1365
1333
  isReplenished: false,
1366
1334
  isPartialWithdrawal: false,
@@ -1372,7 +1340,7 @@
1372
1340
  const DEPOSIT_CALC_DEFAULT_DIR = 'deposit-calculator-data';
1373
1341
  const BUSINESS_DEPOSIT_CALC_DEFAULT_DIR = 'business-calculator-data';
1374
1342
 
1375
- const Rate = JSX(({ rate, title = 'Ставка', unit, depositeName, isShowDepositeName, rateBlockClassName }) => (jsxs("div", { children: [jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), jsxs("div", { className: "relative", children: [jsxs("div", { className: "flex justify-start", children: [jsx("span", { className: style('block gradient-color-text font-mohave text-title-huge pr-6 -mt-4', rateBlockClassName), children: String(rate).replace('.', ',') }), unit ? (jsx("span", { className: "gradient-color-text text-[65px] leading-[75px]", children: unit })) : ('')] }), depositeName && isShowDepositeName ? (jsx("div", { className: "absolute bottom-7 w-full text-center whitespace-nowrap", children: depositeName })) : null] })] })));
1343
+ const Rate = JSX(({ rate, title = 'Ставка', unit, depositeName, isShowDepositeName, rateBlockClassName }) => (jsxs("div", { children: [jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), jsxs("div", { className: "relative", children: [jsxs("div", { className: "flex justify-start", children: [jsx("span", { className: style('block gradient-color-text font-mohave text-title-huge pr-6 -mt-4', rateBlockClassName), children: String(rate.toFixed(2)).replace('.', ',') }), unit ? (jsx("span", { className: "gradient-color-text text-[65px] leading-[75px]", children: unit })) : ('')] }), depositeName && isShowDepositeName ? (jsx("div", { className: "absolute bottom-7 w-full text-center whitespace-nowrap", children: depositeName })) : null] })] })));
1376
1344
 
1377
1345
  const renderFootnote = (text) => text ? (jsx(Paragraph, { size: "text-s-light", color: "text-secondary-text", children: text })) : null;
1378
1346
 
@@ -1472,6 +1440,17 @@
1472
1440
 
1473
1441
  const UnknownRate = JSX(({ title = 'Ставка' }) => (jsxs("div", { children: [jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), jsx("div", { className: "mt-1 pt-1 pl-5 pb-1.5", children: jsx(ImgInner, { image: { icon: 'PercentIcon' }, width: "90", height: "85", asSVG: true }) }), jsx("div", { className: "w-[250px] mt-3.5", children: jsxs(Paragraph, { size: "text-xl-light", color: "text-primary-text", children: ["\u041F\u0440\u043E\u0446\u0435\u043D\u0442\u043D\u0430\u044F \u0441\u0442\u0430\u0432\u043A\u0430 \u0434\u043B\u044F \u0441\u0440\u043E\u043A\u0430 ", jsx("strong", { children: "1-30 \u0434\u043D\u0435\u0439" }), " \u0443\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043F\u0440\u0438 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0438 \u0432 \u0411\u0430\u043D\u043A"] }) })] })));
1474
1442
 
1443
+ const defaultDiscriminator = (_) => _;
1444
+ const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
1445
+
1446
+ const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
1447
+
1448
+ const getRangeByKeys = ([minKey, maxKey], rows = []) => ({
1449
+ [minKey]: rows.length ? minBy()(rows.map((row) => row[minKey])) : 0,
1450
+ [maxKey]: rows.length ? maxBy()(rows.map((row) => row[maxKey])) : 0,
1451
+ });
1452
+ const checkRangeByKeys = (value, [minKey, maxKey], sourceBookRow) => value >= sourceBookRow[minKey] && value < sourceBookRow[maxKey];
1453
+
1475
1454
  const useBusinessDepositCalculatorParams = (userInputParams, sourceBookDir) => {
1476
1455
  const { daysValue, moneyValue, isPartialWithdrawal, isReplenished, isSmallBusiness, isMonthlyInterestPayment, } = userInputParams;
1477
1456
  const data = useCalculatorParams(sourceBookDir || BUSINESS_DEPOSIT_CALC_DEFAULT_DIR);
@@ -1488,21 +1467,27 @@
1488
1467
  const businessDepositCalculatorSourceBookParams = data?.rows?.find((_) => {
1489
1468
  return (isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
1490
1469
  isSmallBusiness === _.isSmallBusiness &&
1491
- (isOperatingDeposit
1492
- ? _.isReplenished && _.isPartialWithdrawal
1493
- : !_.isReplenished && !_.isPartialWithdrawal));
1470
+ checkIsOperatingDeposit(isOperatingDeposit, _) &&
1471
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
1472
+ checkRangeByKeys(daysValue, ['minDays', 'maxDays'], _));
1494
1473
  }) || DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS;
1495
1474
  const { rate } = businessDepositCalculatorSourceBookParams;
1496
1475
  const income = getDepositIncome$1(rate, userInputParams);
1497
1476
  const finalSum = moneyValue + income;
1477
+ const sourceBookRows = data?.rows || [DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS];
1498
1478
  return {
1499
1479
  ...businessDepositCalculatorSourceBookParams,
1480
+ ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
1481
+ ...getRangeByKeys(['minDays', 'maxDays'], sourceBookRows),
1500
1482
  ...userInputParams,
1501
1483
  isDisabledOperatingDeposit,
1502
1484
  income,
1503
1485
  finalSum,
1504
1486
  };
1505
1487
  };
1488
+ const checkIsOperatingDeposit = (isOperatingDeposit, sourceBookRow) => isOperatingDeposit
1489
+ ? sourceBookRow.isReplenished && sourceBookRow.isPartialWithdrawal
1490
+ : !sourceBookRow.isReplenished && !sourceBookRow.isPartialWithdrawal;
1506
1491
  const getDepositIncome$1 = (rate, userInputParams) => {
1507
1492
  const { isMonthlyInterestPayment, moneyValue, daysValue } = userInputParams;
1508
1493
  /*
@@ -1574,18 +1559,23 @@
1574
1559
  };
1575
1560
 
1576
1561
  const useCreditCalculatorParams = (userInputParams, sourceBookDir) => {
1577
- const { isInsurance, isSalaryClient, isStateEmployee, moneyValue } = userInputParams;
1562
+ const { isInsurance, isSalaryClient, isStateEmployee, moneyValue, monthsValue } = userInputParams;
1578
1563
  const data = useCalculatorParams(sourceBookDir || CREDIT_CALC_DEFAULT_DIR);
1579
1564
  const creditCalculatorSourceBookParams = data?.rows?.find((_) => {
1580
1565
  return (isInsurance === _.isInsurance &&
1581
1566
  isSalaryClient === _.isSalaryClient &&
1582
- isStateEmployee === _.isStateEmployee);
1567
+ isStateEmployee === _.isStateEmployee &&
1568
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
1569
+ checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _));
1583
1570
  }) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
1584
1571
  const { rateBottomRange, rateTopRange, sumBorder } = creditCalculatorSourceBookParams;
1585
1572
  const finalRate = moneyValue <= sumBorder ? rateBottomRange : rateTopRange;
1586
1573
  const monthlyPayment = getMonthlyPayment(finalRate, userInputParams);
1574
+ const sourceBookRows = data?.rows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
1587
1575
  return {
1588
1576
  ...creditCalculatorSourceBookParams,
1577
+ ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
1578
+ ...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
1589
1579
  ...userInputParams,
1590
1580
  finalRate,
1591
1581
  monthlyPayment,
@@ -1626,14 +1616,23 @@
1626
1616
  });
1627
1617
 
1628
1618
  const useDepositCalculatorParams = (userInputParams, sourceBookDir) => {
1629
- const { isMonthlyInterestPayment, moneyValue } = userInputParams;
1619
+ const { isMonthlyInterestPayment, moneyValue, monthsValue } = userInputParams;
1630
1620
  const data = useCalculatorParams(sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR);
1631
- const depositCalculatorSourceBookParams = data?.rows?.find((_) => isMonthlyInterestPayment === _.isMonthlyInterestPayment) ||
1632
- DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
1621
+ const depositCalculatorSourceBookParams = data?.rows?.find((_) => isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
1622
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
1623
+ checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _)) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
1633
1624
  const { rate } = depositCalculatorSourceBookParams;
1634
1625
  const income = getDepositIncome(rate, userInputParams);
1635
1626
  const finalSum = moneyValue + income;
1636
- return { ...depositCalculatorSourceBookParams, ...userInputParams, income, finalSum };
1627
+ const sourceBookRows = data?.rows || [DEFAULT_DEPOSIT_CALCULATOR_PARAMS];
1628
+ return {
1629
+ ...depositCalculatorSourceBookParams,
1630
+ ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
1631
+ ...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
1632
+ ...userInputParams,
1633
+ income,
1634
+ finalSum,
1635
+ };
1637
1636
  };
1638
1637
  const getDepositIncome = (rate, userInputParams) => {
1639
1638
  const { isMonthlyInterestPayment, moneyValue, monthsValue } = userInputParams;
@@ -1843,11 +1842,6 @@
1843
1842
 
1844
1843
  const areArraysEqual = (as, bs) => as === bs || Boolean(as && bs && as?.length === bs?.length && as.every((_, i) => _ === bs[i]));
1845
1844
 
1846
- const defaultDiscriminator = (_) => _;
1847
- const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
1848
-
1849
- const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
1850
-
1851
1845
  const getItemWidth = (container) => (itemCount) => container.scrollWidth / itemCount;
1852
1846
  const scrollBy = (container) => (itemCount, delta) => {
1853
1847
  container.scrollBy({ left: delta * getItemWidth(container)(itemCount), behavior: 'smooth' });
@@ -1948,10 +1942,12 @@
1948
1942
  isCyclic,
1949
1943
  });
1950
1944
  const isBankHistoryCarousel = childBlocks && childBlocks[0]?.type === 'CarouselBankHistoryCard';
1951
- return (jsx(BlockWrapper, { className: style(getPaddingStyle(isPadding), className), ...rest, children: jsxs("div", { className: "relative max-w-full", children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: ITEMS_GAP, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: renderChildren({
1952
- ...rest,
1953
- block: { ...rest.block, blocks: buildBlocks(childBlocks, activeIndex) },
1954
- }) }), jsx(CarouselScrollButtons, { scroll: scroll, isBlur: isBlur, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count })] }) }));
1945
+ return (jsx(BlockWrapper, { className: style(getPaddingStyle(isPadding), className), ...rest, children: jsxs("div", { className: "relative max-w-full", children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: ITEMS_GAP, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: isBankHistoryCarousel
1946
+ ? renderChildren({
1947
+ ...rest,
1948
+ block: { ...rest.block, blocks: buildBlocks(childBlocks, activeIndex) },
1949
+ })
1950
+ : renderChildren(rest) }), jsx(CarouselScrollButtons, { scroll: scroll, isBlur: isBlur, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count })] }) }));
1955
1951
  });
1956
1952
  Carousel.childrenTypes = [
1957
1953
  'CarouselCard',
@@ -3536,6 +3532,7 @@
3536
3532
  throw new Error(x);
3537
3533
  }
3538
3534
 
3535
+ // TODO: Create universal function for this case
3539
3536
  const renderBenefit$2 =
3540
3537
  // Linter doesn't understand that switch processes all cases
3541
3538
  // eslint-disable-next-line consistent-return
@@ -3672,6 +3669,7 @@
3672
3669
  return (jsx("div", { className: `mt-2.5 z-10 ${descriptionWidth}`, children: jsx(Paragraph, { size: "text-m", font: "font-light", color: "group-data-primary:text-secondary-text", children: additionalDescription }) }));
3673
3670
  }
3674
3671
 
3672
+ // TODO: Create universal function for this case
3675
3673
  const renderBenefit =
3676
3674
  // Linter doesn't understand that switch processes all cases
3677
3675
  // eslint-disable-next-line consistent-return
@@ -3874,19 +3872,30 @@
3874
3872
  });
3875
3873
  const normalizeSelectedRegion = (selectedRegion, regions) => !selectedRegion && regions?.length && regions[0]?.code ? regions[0].code : selectedRegion;
3876
3874
 
3877
- const checkIsIconRenderable = (icon) => Boolean(icon?.icon || icon?.src);
3875
+ const checkCanRenderIcon = (icon) => Boolean(icon?.icon || icon?.src);
3878
3876
 
3879
- const renderStepContent = ({ styleMap, isMainButton, version, }) => (step, i, { length }) => {
3877
+ // TODO: Create universal function for this case
3878
+ const renderStep = (props) =>
3879
+ // Linter doesn't understand that switch processes all cases
3880
+ // eslint-disable-next-line consistent-return
3881
+ (step, i, arr) => {
3882
+ const { type } = step;
3883
+ if (!(type === 'default' || type === 'rte')) {
3884
+ return null;
3885
+ }
3886
+ switch (type) {
3887
+ case 'default':
3888
+ return renderDefaultStep(props)(step, i, arr);
3889
+ case 'rte':
3890
+ return jsx(RichText, { __html: step.__html });
3891
+ default:
3892
+ assertUnreachable(step);
3893
+ }
3894
+ };
3895
+ const renderDefaultStep = ({ styleMap, isMainButton, version }) => (step, i, arr) => {
3880
3896
  const { label, description, button, items, isDotted } = step;
3881
- const contentMarginClass = label && (description || items) ? 'mt-2' : '';
3882
- return (jsxs("div", { className: `relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden ${getContainerWidth(length)}`, children: [jsxs("div", { className: `${button?.text ? 'mb-8' : ''} text-center`, children: [renderStepLabel(label), jsxs("div", { className: `${contentMarginClass} flex flex-col items-center`, children: [renderStepDescription({
3883
- description,
3884
- className: styleMap.description,
3885
- }), jsx(List, { className: getItemsClasses({ className: 'text-left', description, styleMap }), items: items, listItemSize: "M", isDotted: isDotted })] })] }), button?.text && !isMainButton ? (jsx(Button, { className: "box-border py-3 h-12 w-full max-w-[240px] mt-auto", version: version, ...button, children: button?.text })) : null] }, String(i)));
3886
- };
3887
- const renderStepLabel = (label) => label ? jsx("div", { className: "text-h6", children: label }) : null;
3888
- const renderStepDescription = ({ description, className = '', }) => (description ? jsx("div", { className: className, children: description }) : null);
3889
- const getItemsClasses = ({ className, description, styleMap, }) => [description ? styleMap.description : 'text-h6', description ? 'mt-0.5' : '', className].join(' ');
3897
+ return (jsxs("div", { className: style('relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden', getContainerWidth(arr.length)), children: [jsxs("div", { className: style(button?.text ? 'mb-8' : '', 'text-center'), children: [label ? (jsx("div", { className: "mb-2", children: jsx(Text, { size: "text-h6", children: label }) })) : null, jsxs("div", { className: "flex flex-col items-center", children: [description ? jsx("div", { className: styleMap.description, children: description }) : null, jsx(List, { className: style(description ? `${styleMap.description} mt-0.5` : 'text-h6'), items: items, listItemSize: "M", isDotted: isDotted })] })] }), button?.text && !isMainButton ? (jsx(Button, { className: "box-border py-3 h-12 w-full max-w-[240px] mt-auto", version: version, ...button, children: button?.text })) : null] }, String(i)));
3898
+ };
3890
3899
  const getContainerWidth = (length) => (length < 5 ? 'w-[276px]' : 'w-[210px]');
3891
3900
 
3892
3901
  const STEPS_BLOCK_STYLE_MAPS = {
@@ -3931,21 +3940,14 @@
3931
3940
 
3932
3941
  const getLineOpacity = (showLines) => (showLines ? '' : 'opacity-0');
3933
3942
  const getPaddingX = (steps) => (steps < 5 ? 'px-[88px]' : 'px-[55px]');
3934
- const StepsBlock = JSX(({ className = '', showLines = true, steps = [], button, version = 'primary', ...rest }) => {
3935
- const { title } = rest;
3936
- const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
3943
+ const StepsBlock = JSX(({ className = '', showLines = true, steps = [], button, version = 'primary', title, ...rest }) => {
3937
3944
  const shortGaps = steps.length > 3;
3945
+ const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
3938
3946
  const lineOpacity = getLineOpacity(showLines);
3939
- const titleMargin = title ? 'mt-9' : '';
3940
3947
  const paddingX = getPaddingX(steps.length);
3941
- return (jsxs(BlockWrapper, { className: [
3942
- 'box-border py-12',
3943
- shortGaps ? 'px-20' : 'px-[70px]',
3944
- 'flex flex-col items-center overflow-hidden',
3945
- className,
3946
- ].join(' '), version: version, ...rest, children: [title ? (jsx(Heading, { headingType: "h3", className: "max-w-[752px] text-center", title: title })) : null, steps?.length ? (jsxs("div", { className: `box-border ${titleMargin}`, children: [jsx("div", { className: `flex items-center ${paddingX}`, children: joinList(jsx("div", { className: `h-0.5 w-full bg-secondary-light ${lineOpacity}` }))(steps.map(renderStepIcon(styleMap, version))) }), jsx("div", { className: `flex justify-between mt-4 ${shortGaps ? 'gap-x-3' : 'gap-x-[101px]'}`, children: steps.map(renderStepContent({ styleMap, isMainButton: Boolean(button?.text), version })) })] })) : null, button?.text ? jsx(Button, { className: "mt-8 min-w-60", version: "primary", ...button }) : null] }));
3948
+ return (jsxs(BlockWrapper, { className: style('box-border py-12', shortGaps ? 'px-20' : 'px-[70px]', 'flex flex-col items-center overflow-hidden', className), version: version, ...rest, children: [title ? (jsx(Heading, { headingType: "h3", className: "max-w-[752px] text-center mb-9", title: title })) : null, steps?.length ? (jsxs("div", { className: "box-border", children: [jsx("div", { className: style('flex items-center', paddingX), children: joinList(jsx("div", { className: style('h-0.5 w-full bg-secondary-light', lineOpacity) }))(steps.map(renderStepIcon(styleMap, version))) }), jsx("div", { className: style('flex justify-between mt-4', shortGaps ? 'gap-x-3' : 'gap-x-[101px]'), children: steps.map(renderStep({ styleMap, isMainButton: Boolean(button?.text), version })) })] })) : null, button?.text ? jsx(Button, { className: "mt-8 min-w-60", version: "primary", ...button }) : null] }));
3947
3949
  });
3948
- const renderStepIcon = (styleMap, version) => ({ icon }, i) => (jsx("div", { className: "flex flex-col items-center text-center", children: jsx("div", { className: `h-[100px] w-[100px] min-w-[100px] min-h-[100px] rounded-full p-[26px] box-border z-10 flex justify-center items-center ${styleMap.iconBackground}`, children: checkIsIconRenderable(icon) ? (jsx(ImgInner, { image: getIconWithVersion(icon || {}, version), width: "48", height: "48", asSVG: true })) : (jsx("span", { className: `text-h4 ${styleMap.iconText}`, children: i + 1 })) }) }, String(i)));
3950
+ const renderStepIcon = (styleMap, version) => ({ icon }, i) => (jsx("div", { className: "flex flex-col items-center text-center", children: jsx("div", { className: `h-[100px] w-[100px] min-w-[100px] min-h-[100px] rounded-full p-[26px] box-border z-10 flex justify-center items-center ${styleMap.iconBackground}`, children: checkCanRenderIcon(icon) ? (jsx(ImgInner, { image: getIconWithVersion(icon || {}, version), width: "48", height: "48", asSVG: true })) : (jsx("span", { className: `text-h4 ${styleMap.iconText}`, children: i + 1 })) }) }, String(i)));
3949
3951
 
3950
3952
  const containerStyles = {
3951
3953
  'horizontal-list': 'mx-auto mt-5 w-fit',
@@ -4121,7 +4123,7 @@
4121
4123
  const Tabs = JSX((props) => {
4122
4124
  const { className = '', tabs, showCounter, isSticky, tabsMode, ...rest } = props;
4123
4125
  const [currentTab, setCurrentTab] = useState(tabs ? tabs[0] : undefined);
4124
- useEffect(() => EventBus.inst.subscribe('tab', (event) => {
4126
+ useEffect(() => defaultEventBus.subscribe('tab', (event) => {
4125
4127
  const tab = tabs?.find(checkTab(event));
4126
4128
  if (event.type === 'link' && tab) {
4127
4129
  setCurrentTab(tab);
@@ -4129,11 +4131,11 @@
4129
4131
  return [];
4130
4132
  }), [tabs]);
4131
4133
  useEffect(() => currentTab?.type === 'group'
4132
- ? EventBus.inst.subject('tab', { type: currentTab.type, label: currentTab.ref })
4134
+ ? defaultEventBus.subject('tab', { type: currentTab.type, label: currentTab.ref })
4133
4135
  : undefined, [currentTab]);
4134
4136
  const handleClick = useCallback((selectedTab) => {
4135
4137
  if (selectedTab?.type === 'group') {
4136
- EventBus.inst.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
4138
+ defaultEventBus.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
4137
4139
  }
4138
4140
  setCurrentTab(selectedTab);
4139
4141
  }, []);
@@ -4347,10 +4349,10 @@
4347
4349
  });
4348
4350
  const renderTag = (tag, key) => (jsx("span", { className: "text-m-light py-2 px-2.5 border-solid border rounded-md border-gray", children: tag }, String(key)));
4349
4351
 
4350
- const Tile = JSX(({ title, headingType = 'h3', description, items, buttons, image, isDotted = true, listItemSize = 'M', className = '', tags, children, ...rest }) => (jsx(BlockWrapper, { className: `overflow-hidden p-9 pr-3 box-border ${getTileRightPadding(className)} ${getTileMinHeight(className)} ${className}`, ...rest, children: jsxs(BaseTile, { title: title ? (jsx(Heading, { headingType: headingType, as: "h2", title: title, className: `whitespace-pre-wrap max-w-[600px]` })) : null, buttons: renderButtonsSection(buttons, {
4352
+ const Tile = JSX(({ title, headingType = 'h3', __html, items, buttons, image, isDotted = true, listItemSize = 'M', className = '', tags, children, ...rest }) => (jsx(BlockWrapper, { className: `overflow-hidden p-9 pr-3 box-border ${getTileRightPadding(className)} ${getTileMinHeight(className)} ${className}`, ...rest, children: jsxs(BaseTile, { title: title ? (jsx(Heading, { headingType: headingType, as: "h2", title: title, className: `whitespace-pre-wrap max-w-[600px]` })) : null, buttons: renderButtonsSection(buttons, {
4351
4353
  className: 'mt-8',
4352
4354
  buttonClassName: 'min-w-[158px]',
4353
- }), image: image?.src ? jsx(ImgInner, { className: "mt-auto ml-7", image: image }) : null, children: [description ? (jsx("div", { className: "max-w-[600px] mt-2.5", children: jsx(Paragraph, { size: "text-xl-light", children: description }) })) : null, children, jsx(List, { className: "mt-2.5", itemClassName: "mb-1.5", items: items, isDotted: isDotted, listItemSize: listItemSize }), tags?.length ? jsx(Tags, { tags: tags, className: "mt-5" }) : null] }) })));
4355
+ }), image: image?.src ? jsx(ImgInner, { className: "mt-auto ml-7", image: image }) : null, children: [__html ? (jsx("div", { className: "max-w-[600px] mt-2.5", children: jsx(RichText, { __html: __html }) })) : null, children, jsx(List, { className: "mt-2.5", itemClassName: "mb-1.5", items: items, isDotted: isDotted, listItemSize: listItemSize }), tags?.length ? jsx(Tags, { tags: tags, className: "mt-5" }) : null] }) })));
4354
4356
 
4355
4357
  const alignStyle = {
4356
4358
  left: 'items-start',
@@ -4459,25 +4461,22 @@
4459
4461
  }
4460
4462
 
4461
4463
  const isScrolledEnough = () => globalThis.scrollY > (globalThis.innerHeight * 3) / 4;
4462
- function useBlockRouterProvider(router = BlockRouter.inst, scrollTarget = globalThis) {
4464
+ function useBlockRouterProvider(scrollTarget = globalThis) {
4465
+ const router = useRouter();
4463
4466
  const intersectionsMapRef = useRef(new Map());
4464
- useEffect(() => router.eventBus.subscribe('intersection', ({ block, intersection }) => {
4467
+ useEffect(() => blockRouterEventBus.subscribe('intersection', ({ block, intersection }) => {
4465
4468
  if (intersectionsMapRef.current) {
4466
4469
  intersectionsMapRef.current.set(block, intersection);
4467
4470
  }
4468
- }), [router]);
4471
+ }), []);
4469
4472
  useEffect(() => {
4470
4473
  const handleScroll = debounce(() => {
4471
- if (!isScrolledEnough()) {
4472
- router.reset();
4473
- return;
4474
- }
4475
- const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
4476
- if (activeBlock?.anchor) {
4477
- router.replace(activeBlock.anchor);
4474
+ if (isScrolledEnough()) {
4475
+ const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
4476
+ trackBlock(router, activeBlock);
4478
4477
  }
4479
- else if (!activeBlock) {
4480
- router.reset();
4478
+ else {
4479
+ trackBlock(router);
4481
4480
  }
4482
4481
  }, 100);
4483
4482
  scrollTarget.addEventListener('scroll', handleScroll);
@@ -4556,7 +4555,7 @@
4556
4555
  return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
4557
4556
  }
4558
4557
 
4559
- const packageVersion = "0.8.8";
4558
+ const packageVersion = "0.8.10";
4560
4559
 
4561
4560
  exports.Blocks = Blocks;
4562
4561
  exports.ContentPage = ContentPage;