@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
@@ -1,6 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
- import { EventBus } from '../../EventBus/EventBus';
3
+ import { defaultEventBus } from '../../EventBus/defaultEventBus';
4
4
  import type { UniBlockProps } from '../../model/JSXBlock';
5
5
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
6
6
  import { renderTab } from './renderTab';
@@ -21,7 +21,7 @@ export const Tabs = JSX<TabsBlockProps>((props) => {
21
21
 
22
22
  useEffect(
23
23
  () =>
24
- EventBus.inst.subscribe('tab', (event) => {
24
+ defaultEventBus.subscribe('tab', (event) => {
25
25
  const tab = tabs?.find(checkTab(event));
26
26
  if (event.type === 'link' && tab) {
27
27
  setCurrentTab(tab);
@@ -35,14 +35,14 @@ export const Tabs = JSX<TabsBlockProps>((props) => {
35
35
  useEffect(
36
36
  () =>
37
37
  currentTab?.type === 'group'
38
- ? EventBus.inst.subject('tab', { type: currentTab.type, label: currentTab.ref })
38
+ ? defaultEventBus.subject('tab', { type: currentTab.type, label: currentTab.ref })
39
39
  : undefined,
40
40
  [currentTab],
41
41
  );
42
42
 
43
43
  const handleClick = useCallback((selectedTab: TabData) => {
44
44
  if (selectedTab?.type === 'group') {
45
- EventBus.inst.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
45
+ defaultEventBus.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
46
46
  }
47
47
  setCurrentTab(selectedTab);
48
48
  }, []);
@@ -2,7 +2,7 @@
2
2
  "content": {
3
3
  "title": "Плитка",
4
4
  "headingType": "h3",
5
- "description": "Описание",
5
+ "__html": "<p>Описание</p>",
6
6
  "image": {
7
7
  "format": "webp",
8
8
  "size": {
@@ -5,7 +5,7 @@ import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
5
5
  import { Heading } from '../../ui-kit/Heading/Heading';
6
6
  import { Img } from '../../ui-kit/Img/Img';
7
7
  import { List } from '../../ui-kit/List/List';
8
- import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
8
+ import { RichText } from '../../ui-kit/RichText/RichText';
9
9
  import { Tags } from '../../ui-kit/Tags/Tags';
10
10
  import { BaseTile } from '../BaseTile/BaseTile';
11
11
  import { getTileMinHeight } from '../BaseTile/getTileMinHeight';
@@ -18,7 +18,7 @@ export const Tile = JSX<TileProps>(
18
18
  ({
19
19
  title,
20
20
  headingType = 'h3',
21
- description,
21
+ __html,
22
22
  items,
23
23
  buttons,
24
24
  image,
@@ -52,9 +52,9 @@ export const Tile = JSX<TileProps>(
52
52
  })}
53
53
  image={image?.src ? <Img className="mt-auto ml-7" image={image} /> : null}
54
54
  >
55
- {description ? (
55
+ {__html ? (
56
56
  <div className="max-w-[600px] mt-2.5">
57
- <Paragraph size="text-xl-light">{description}</Paragraph>
57
+ <RichText __html={__html} />
58
58
  </div>
59
59
  ) : null}
60
60
  {children}
@@ -1 +1,7 @@
1
- {}
1
+ {
2
+ "content": {
3
+ "__html": {
4
+ "ui:widget": "html"
5
+ }
6
+ }
7
+ }
@@ -1,17 +1,17 @@
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
  /**
11
11
  * @title Плитка
12
12
  */
13
13
  export type TileContent = HeadingCommonProps &
14
- DescriptionProps &
14
+ RichTextProps &
15
15
  ListContent &
16
16
  ButtonContent &
17
17
  TagsContent & {
@@ -1,6 +1,6 @@
1
1
  import type { LinkProps } from '../model/LinkProps';
2
2
  import { projectSettings } from '../ProjectSettings';
3
- import { useBlockRouter } from '../services/BlockRouter/useBlockRouter';
3
+ import { gotoBlock } from '../services/BlockRouter/BlockRouter';
4
4
  import { isHash, isLocalURL, joinPath } from '../utils/url';
5
5
  import { handlerDecorator } from './handlerDecorator';
6
6
  import { useRouter } from './useRouter';
@@ -15,7 +15,6 @@ interface Clickable {
15
15
 
16
16
  export function useLink(isRemote?: boolean) {
17
17
  const router = useRouter();
18
- const blockRouter = useBlockRouter();
19
18
 
20
19
  return <L extends Partial<LinkProps & Clickable>>(props: L): L & Clickable => ({
21
20
  ...props,
@@ -44,7 +43,7 @@ export function useLink(isRemote?: boolean) {
44
43
  // Client routing
45
44
  ev?.preventDefault();
46
45
  if (isHash(href)) {
47
- blockRouter.goto(href);
46
+ gotoBlock(router, href);
48
47
  } else if (href) {
49
48
  router.push(href);
50
49
  }
@@ -1,10 +1,14 @@
1
+ interface RouterOptions {
2
+ scroll?: boolean;
3
+ }
4
+
1
5
  export interface Router {
2
6
  pathname: string;
3
7
  query: Record<string, string | string[] | undefined>;
4
8
  href?: string;
5
9
  basePath?: string;
6
- push: (url: string) => void;
7
- replace: (url: string) => void;
10
+ push: (url: string, as?: string, options?: RouterOptions) => void;
11
+ replace: (url: string, as?: string, options?: RouterOptions) => void;
8
12
  }
9
13
 
10
14
  export function useRouter(): Router {
@@ -1,53 +1,14 @@
1
- import { EventBus } from '../../EventBus/EventBus';
1
+ import type { Router } from '../../hooks/useRouter';
2
2
  import type { BlockDef } from '../../model/ContentPageDef';
3
3
 
4
- export interface GotoAnchorEvent {
5
- anchor: string;
6
- }
7
-
8
- export interface BlockIntersectionEvent {
9
- block: BlockDef;
10
- intersection: IntersectionObserverEntry;
11
- }
4
+ const normalizeAnchor = (anchor?: string) => anchor?.replace('#', '') || '';
12
5
 
13
- interface EventMap {
14
- goto: GotoAnchorEvent;
15
- intersection: BlockIntersectionEvent;
6
+ export function gotoBlock(router: Router, anchor?: string) {
7
+ router.replace(`#${normalizeAnchor(anchor)}`);
16
8
  }
17
9
 
18
- const normalizeAnchor = (rawAnchor?: string) => rawAnchor?.replace('#', '') || '';
19
- const getURLWithAnchor = (rawAnchor?: string) =>
20
- `${globalThis.location?.pathname}#${normalizeAnchor(rawAnchor)}`;
21
-
22
- export class BlockRouter {
23
- public static readonly inst = new BlockRouter();
24
-
25
- readonly eventBus = new EventBus<EventMap>();
26
-
27
- constructor() {
28
- const anchor = normalizeAnchor(globalThis.location?.hash);
29
- if (anchor) {
30
- this.eventBus.subject('goto', { anchor });
31
- }
32
- }
33
-
34
- goto(rawAnchor?: string) {
35
- const anchor = normalizeAnchor(rawAnchor);
36
- if (anchor) {
37
- this.push(anchor);
38
- this.eventBus.fire('goto', { anchor });
39
- }
40
- }
41
-
42
- push(rawAnchor: string) {
43
- globalThis.history?.pushState(null, '', getURLWithAnchor(rawAnchor));
44
- }
45
-
46
- replace(rawAnchor: string) {
47
- globalThis.history?.replaceState(null, '', getURLWithAnchor(rawAnchor));
48
- }
49
-
50
- reset() {
51
- globalThis.history?.replaceState(null, '', getURLWithAnchor());
52
- }
10
+ export function trackBlock(router: Router, block?: BlockDef) {
11
+ router.replace(`#${normalizeAnchor(block?.anchor)}`, undefined, {
12
+ scroll: false,
13
+ });
53
14
  }
@@ -0,0 +1,13 @@
1
+ import { EventBus } from '../../EventBus/EventBus';
2
+ import type { BlockDef } from '../../model/ContentPageDef';
3
+
4
+ export interface BlockIntersectionEvent {
5
+ block: BlockDef;
6
+ intersection: IntersectionObserverEntry;
7
+ }
8
+
9
+ interface EventMap {
10
+ intersection: BlockIntersectionEvent;
11
+ }
12
+
13
+ export const blockRouterEventBus = new EventBus<EventMap>();
@@ -1,12 +1,9 @@
1
- import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
1
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
2
2
  import { useIntersectionObserver } from '../../hooks/useIntersectionObserver';
3
3
  import type { BlockDef } from '../../model/ContentPageDef';
4
- import { BlockRouter } from './BlockRouter';
4
+ import { blockRouterEventBus } from './blockRouterEventBus';
5
5
 
6
- export function useBlockIntersectionObserver(
7
- block?: BlockDef,
8
- router: BlockRouter = BlockRouter.inst,
9
- ) {
6
+ export function useBlockIntersectionObserver(block?: BlockDef) {
10
7
  const observerCallback = useCallback(
11
8
  (entries: IntersectionObserverEntry[]) => {
12
9
  if (!block || !entries?.length) {
@@ -14,24 +11,10 @@ export function useBlockIntersectionObserver(
14
11
  }
15
12
 
16
13
  const intersection = entries[entries.length - 1];
17
- router.eventBus.fire('intersection', { block, intersection });
14
+ blockRouterEventBus.fire('intersection', { block, intersection });
18
15
  },
19
- [block, router],
16
+ [block],
20
17
  );
21
18
 
22
- const ref = useIntersectionObserver(observerCallback, { sensitivity: 1 });
23
-
24
- useEffect(() => {
25
- if (!ref.current) {
26
- return undefined;
27
- }
28
-
29
- return router.eventBus.subscribe('goto', ({ anchor }) => {
30
- if (ref.current && block?.anchor === anchor) {
31
- ref.current.scrollIntoView({ behavior: 'smooth', block: 'start' });
32
- }
33
- });
34
- }, [block, router]);
35
-
36
- return ref;
19
+ return useIntersectionObserver(observerCallback, { sensitivity: 1 });
37
20
  }
@@ -1,41 +1,35 @@
1
1
  import { useEffect, useRef } from '@redneckz/uni-jsx/lib/hooks';
2
+ import { useRouter } from '../../hooks/useRouter';
2
3
  import type { BlockDef } from '../../model/ContentPageDef';
3
4
  import { debounce } from '../../utils/debounce';
4
- import { BlockRouter } from './BlockRouter';
5
+ import { trackBlock } from './BlockRouter';
6
+ import { blockRouterEventBus } from './blockRouterEventBus';
5
7
  import { findActiveBlock } from './findActiveBlock';
6
8
 
7
9
  const isScrolledEnough = () => globalThis.scrollY > (globalThis.innerHeight * 3) / 4;
8
10
 
9
- export function useBlockRouterProvider(
10
- router: BlockRouter = BlockRouter.inst,
11
- scrollTarget: EventTarget = globalThis,
12
- ) {
11
+ export function useBlockRouterProvider(scrollTarget: EventTarget = globalThis) {
12
+ const router = useRouter();
13
+
13
14
  const intersectionsMapRef = useRef<Map<BlockDef, IntersectionObserverEntry>>(new Map());
14
15
 
15
16
  useEffect(
16
17
  () =>
17
- router.eventBus.subscribe('intersection', ({ block, intersection }) => {
18
+ blockRouterEventBus.subscribe('intersection', ({ block, intersection }) => {
18
19
  if (intersectionsMapRef.current) {
19
20
  intersectionsMapRef.current.set(block, intersection);
20
21
  }
21
22
  }),
22
- [router],
23
+ [],
23
24
  );
24
25
 
25
26
  useEffect(() => {
26
27
  const handleScroll = debounce(() => {
27
- if (!isScrolledEnough()) {
28
- router.reset();
29
-
30
- return;
31
- }
32
-
33
- const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
34
-
35
- if (activeBlock?.anchor) {
36
- router.replace(activeBlock.anchor);
37
- } else if (!activeBlock) {
38
- router.reset();
28
+ if (isScrolledEnough()) {
29
+ const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
30
+ trackBlock(router, activeBlock);
31
+ } else {
32
+ trackBlock(router);
39
33
  }
40
34
  }, 100);
41
35
 
@@ -1,6 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
- import { EventBus } from '../EventBus/EventBus';
3
+ import { defaultEventBus } from '../EventBus/defaultEventBus';
4
4
  import type { BlockVersion } from '../model/BlockVersion';
5
5
  import type { UniBlockProps } from '../model/JSXBlock';
6
6
  import { useBlockIntersectionObserver } from '../services/BlockRouter/useBlockIntersectionObserver';
@@ -28,7 +28,7 @@ export const BlockWrapper = JSX<BlockWrapperProps>(
28
28
  const [isVisible, setVisible] = useState(true);
29
29
  useEffect(
30
30
  () =>
31
- EventBus.inst.subscribe('tab', (event) => {
31
+ defaultEventBus.subscribe('tab', (event) => {
32
32
  if (event.type === 'group') {
33
33
  const hasSettings = block?.labels?.length || block?.anchor;
34
34
  setVisible(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.8.8",
3
+ "version": "0.8.10",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -1,10 +1,4 @@
1
- import type { EventMap } from './EventMap';
2
-
3
- export type BaseEventMap = Record<string, any>;
4
-
5
- export class EventBus<EM extends BaseEventMap> {
6
- public static readonly inst = new EventBus<EventMap>();
7
-
1
+ export class EventBus<EM extends Record<string, any>> {
8
2
  private subscribers: Partial<Record<keyof EM, Array<(ev: EM[keyof EM]) => void>>> = {};
9
3
  private subjectsStateMap: Partial<EM> = {};
10
4
 
@@ -0,0 +1,8 @@
1
+ import type { TabActivationEvent } from '../components/Tabs/Tabs';
2
+ import { EventBus } from './EventBus';
3
+
4
+ interface GlobalEventMap {
5
+ tab: TabActivationEvent;
6
+ }
7
+
8
+ export const defaultEventBus = new EventBus<GlobalEventMap>();
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "content": {
3
3
  "button": {
4
- "href": "/credit-cards",
5
- "text": "Подробнее",
4
+ "href": "#",
5
+ "text": "Кнопка",
6
6
  "target": "_blank",
7
7
  "version": "primary"
8
8
  }
@@ -2,10 +2,13 @@ import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { UniBlockProps } from '../../model/JSXBlock';
3
3
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
4
4
  import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
5
+ import { style } from '../../utils/style';
5
6
  import type { ButtonBlockContent } from './ButtonBlockContent';
6
7
 
7
8
  interface ButtonBlockProps extends ButtonBlockContent, UniBlockProps {}
8
9
 
9
- export const ButtonBlock = JSX<ButtonBlockProps>(({ button, ...rest }) => (
10
- <BlockWrapper {...rest}>{renderButtonsSection([button])}</BlockWrapper>
10
+ export const ButtonBlock = JSX<ButtonBlockProps>(({ button, className, ...rest }) => (
11
+ <BlockWrapper className={style('!bg-transparent', className)} {...rest}>
12
+ {renderButtonsSection([button])}
13
+ </BlockWrapper>
11
14
  ));
@@ -4,6 +4,10 @@ import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
4
4
  * @title Блок Кнопка
5
5
  */
6
6
  export interface ButtonBlockContent {
7
- /** @title Кнопка */
7
+ /**
8
+ * @title Кнопка
9
+ * @default {"icon": {"format": "webp", "size": { "width": 24, "height": 24 }},
10
+ * "iconRight": {"format": "webp", "size": { "width": 24, "height": 24 }}}
11
+ */
8
12
  button?: ButtonWithIconProps;
9
13
  }
@@ -25,7 +25,7 @@ export const Rate = JSX<RateProps>(
25
25
  rateBlockClassName,
26
26
  )}
27
27
  >
28
- {String(rate).replace('.', ',')}
28
+ {String(rate.toFixed(2)).replace('.', ',')}
29
29
  </span>
30
30
  {unit ? (
31
31
  <span className="gradient-color-text text-[65px] leading-[75px]">{unit}</span>
@@ -54,7 +54,7 @@ export const DEFAULT_DEPOSIT_CALCULATOR_PARAMS: DepositCalculatorSourceBookParam
54
54
  maxSum: 5000000,
55
55
  minMonths: 2,
56
56
  maxMonths: 120,
57
- rate: 5.9,
57
+ rate: 7,
58
58
  isMonthlyInterestPayment: true,
59
59
  };
60
60
 
@@ -64,7 +64,7 @@ export const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS: BusinessDepositCalculat
64
64
  maxSum: 500000,
65
65
  minDays: BUSINESS_MIN_DAYS,
66
66
  maxDays: BUSINESS_MAX_DAYS,
67
- rate: 5.9,
67
+ rate: 6.6,
68
68
  isMonthlyInterestPayment: true,
69
69
  isReplenished: false,
70
70
  isPartialWithdrawal: false,
@@ -0,0 +1,24 @@
1
+ import { maxBy } from '../../utils/maxBy';
2
+ import { minBy } from '../../utils/minBy';
3
+
4
+ export const getRangeByKeys = <
5
+ MinKey extends string,
6
+ MaxKey extends string,
7
+ T extends Record<MinKey | MaxKey, number>,
8
+ >(
9
+ [minKey, maxKey]: [MinKey, MaxKey],
10
+ rows: T[] = [],
11
+ ) => ({
12
+ [minKey]: rows.length ? minBy()(rows.map((row) => row[minKey])) : 0,
13
+ [maxKey]: rows.length ? maxBy()(rows.map((row) => row[maxKey])) : 0,
14
+ });
15
+
16
+ export const checkRangeByKeys = <
17
+ MinKey extends string,
18
+ MaxKey extends string,
19
+ T extends Record<MinKey | MaxKey, number>,
20
+ >(
21
+ value: number,
22
+ [minKey, maxKey]: [MinKey, MaxKey],
23
+ sourceBookRow: T,
24
+ ): boolean => value >= sourceBookRow[minKey] && value < sourceBookRow[maxKey];
@@ -5,6 +5,7 @@ import {
5
5
  BUSINESS_RATE_MIN_DAYS,
6
6
  DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS,
7
7
  } from './constants';
8
+ import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers';
8
9
  import { useCalculatorParams } from './useCalculatorParams';
9
10
  import type { CommonDepositParams } from './useDepositCalculatorParams';
10
11
 
@@ -72,9 +73,9 @@ export const useBusinessDepositCalculatorParams = (
72
73
  return (
73
74
  isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
74
75
  isSmallBusiness === _.isSmallBusiness &&
75
- (isOperatingDeposit
76
- ? _.isReplenished && _.isPartialWithdrawal
77
- : !_.isReplenished && !_.isPartialWithdrawal)
76
+ checkIsOperatingDeposit(isOperatingDeposit, _) &&
77
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
78
+ checkRangeByKeys(daysValue, ['minDays', 'maxDays'], _)
78
79
  );
79
80
  }) || DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS;
80
81
 
@@ -82,9 +83,12 @@ export const useBusinessDepositCalculatorParams = (
82
83
 
83
84
  const income = getDepositIncome(rate, userInputParams);
84
85
  const finalSum = moneyValue + income;
86
+ const sourceBookRows = data?.rows || [DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS];
85
87
 
86
88
  return {
87
89
  ...businessDepositCalculatorSourceBookParams,
90
+ ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
91
+ ...getRangeByKeys(['minDays', 'maxDays'], sourceBookRows),
88
92
  ...userInputParams,
89
93
  isDisabledOperatingDeposit,
90
94
  income,
@@ -92,6 +96,14 @@ export const useBusinessDepositCalculatorParams = (
92
96
  };
93
97
  };
94
98
 
99
+ const checkIsOperatingDeposit = (
100
+ isOperatingDeposit: boolean,
101
+ sourceBookRow: BusinessDepositCalculatorSourceBookParams,
102
+ ) =>
103
+ isOperatingDeposit
104
+ ? sourceBookRow.isReplenished && sourceBookRow.isPartialWithdrawal
105
+ : !sourceBookRow.isReplenished && !sourceBookRow.isPartialWithdrawal;
106
+
95
107
  const getDepositIncome = (
96
108
  rate: number,
97
109
  userInputParams: BusinessDepositCalculatorUserInputParams,
@@ -1,5 +1,6 @@
1
1
  import { CREDIT_CALC_DEFAULT_DIR, DEFAULT_CREDIT_CALCULATOR_PARAMS } from './constants';
2
2
  import { getMonthlyPayment } from './getMonthlyPayment';
3
+ import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers';
3
4
  import { useCalculatorParams } from './useCalculatorParams';
4
5
 
5
6
  export interface CommonCreditParams {
@@ -38,7 +39,7 @@ export const useCreditCalculatorParams = (
38
39
  userInputParams: CreditCalculatorUserInputParams,
39
40
  sourceBookDir?: string,
40
41
  ): CreditCalculatorParams => {
41
- const { isInsurance, isSalaryClient, isStateEmployee, moneyValue } = userInputParams;
42
+ const { isInsurance, isSalaryClient, isStateEmployee, moneyValue, monthsValue } = userInputParams;
42
43
 
43
44
  const data = useCalculatorParams<CreditCalculatorData>(sourceBookDir || CREDIT_CALC_DEFAULT_DIR);
44
45
  const creditCalculatorSourceBookParams =
@@ -46,16 +47,21 @@ export const useCreditCalculatorParams = (
46
47
  return (
47
48
  isInsurance === _.isInsurance &&
48
49
  isSalaryClient === _.isSalaryClient &&
49
- isStateEmployee === _.isStateEmployee
50
+ isStateEmployee === _.isStateEmployee &&
51
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
52
+ checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _)
50
53
  );
51
54
  }) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
52
55
 
53
56
  const { rateBottomRange, rateTopRange, sumBorder } = creditCalculatorSourceBookParams;
54
57
  const finalRate = moneyValue <= sumBorder ? rateBottomRange : rateTopRange;
55
58
  const monthlyPayment = getMonthlyPayment(finalRate, userInputParams);
59
+ const sourceBookRows = data?.rows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
56
60
 
57
61
  return {
58
62
  ...creditCalculatorSourceBookParams,
63
+ ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
64
+ ...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
59
65
  ...userInputParams,
60
66
  finalRate,
61
67
  monthlyPayment,
@@ -1,9 +1,11 @@
1
1
  import { DEFAULT_DEPOSIT_CALCULATOR_PARAMS, DEPOSIT_CALC_DEFAULT_DIR } from './constants';
2
+ import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers';
2
3
  import { useCalculatorParams } from './useCalculatorParams';
3
4
 
4
5
  export interface CommonDepositParams {
5
6
  isMonthlyInterestPayment: boolean;
6
7
  }
8
+
7
9
  export interface DepositCalculatorSourceBookParams extends CommonDepositParams {
8
10
  minSum: number;
9
11
  maxSum: number;
@@ -32,22 +34,34 @@ export const useDepositCalculatorParams = (
32
34
  userInputParams: DepositCalculatorUserInputParams,
33
35
  sourceBookDir?: string,
34
36
  ): DepositCalculatorParams => {
35
- const { isMonthlyInterestPayment, moneyValue } = userInputParams;
37
+ const { isMonthlyInterestPayment, moneyValue, monthsValue } = userInputParams;
36
38
 
37
39
  const data = useCalculatorParams<DepositCalculatorData>(
38
40
  sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR,
39
41
  );
40
42
 
41
43
  const depositCalculatorSourceBookParams =
42
- data?.rows?.find((_) => isMonthlyInterestPayment === _.isMonthlyInterestPayment) ||
43
- DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
44
+ data?.rows?.find(
45
+ (_) =>
46
+ isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
47
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
48
+ checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _),
49
+ ) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
44
50
 
45
51
  const { rate } = depositCalculatorSourceBookParams;
46
52
 
47
53
  const income = getDepositIncome(rate, userInputParams);
48
54
  const finalSum = moneyValue + income;
55
+ const sourceBookRows = data?.rows || [DEFAULT_DEPOSIT_CALCULATOR_PARAMS];
49
56
 
50
- return { ...depositCalculatorSourceBookParams, ...userInputParams, income, finalSum };
57
+ return {
58
+ ...depositCalculatorSourceBookParams,
59
+ ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
60
+ ...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
61
+ ...userInputParams,
62
+ income,
63
+ finalSum,
64
+ };
51
65
  };
52
66
 
53
67
  const getDepositIncome = (rate: number, userInputParams: DepositCalculatorUserInputParams) => {
@@ -52,10 +52,12 @@ export const Carousel: JSXBlock<CarouselProps> = JSX<CarouselProps>(
52
52
  gap={ITEMS_GAP}
53
53
  onVisibleIndicesChange={scroll.handleVisibleIndicesChange}
54
54
  >
55
- {renderChildren({
56
- ...rest,
57
- block: { ...rest.block, blocks: buildBlocks(childBlocks, activeIndex) },
58
- })}
55
+ {isBankHistoryCarousel
56
+ ? renderChildren({
57
+ ...rest,
58
+ block: { ...rest.block, blocks: buildBlocks(childBlocks, activeIndex) },
59
+ })
60
+ : renderChildren(rest)}
59
61
  </SwipeListContainer>
60
62
  <CarouselScrollButtons
61
63
  scroll={scroll}
@@ -4,6 +4,7 @@ import type { ComplexBenefitProps } from '../../ui-kit/BenefitItem/BenefitItemPr
4
4
  import { RichText } from '../../ui-kit/RichText/RichText';
5
5
  import { assertUnreachable } from '../../utils/assertUnreachable';
6
6
 
7
+ // TODO: Create universal function for this case
7
8
  export const renderBenefit =
8
9
  // Linter doesn't understand that switch processes all cases
9
10
  // eslint-disable-next-line consistent-return
@@ -3,6 +3,7 @@ import { Text } from '../../ui-kit/Text/Text';
3
3
  import { assertUnreachable } from '../../utils/assertUnreachable';
4
4
  import type { Benefit } from './ProductTileContent';
5
5
 
6
+ // TODO: Create universal function for this case
6
7
  export const renderBenefit =
7
8
  // Linter doesn't understand that switch processes all cases
8
9
  // eslint-disable-next-line consistent-return