@redneckz/wildless-cms-uni-blocks 0.6.15 → 0.6.17

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 (500) hide show
  1. package/bin/migration-scripts/0.6.16.js +90 -0
  2. package/bin/utils.js +2 -0
  3. package/bundle/blocks.schema.json +1 -1
  4. package/bundle/bundle.umd.js +318 -169
  5. package/bundle/bundle.umd.min.js +1 -1
  6. package/bundle/components/Bonus/BonusContent.d.ts +1 -0
  7. package/bundle/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
  8. package/bundle/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
  9. package/bundle/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
  10. package/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
  11. package/bundle/components/OfficeMap/nearbyOffices.d.ts +2 -0
  12. package/bundle/components/OfficeMap/renderFunctions.d.ts +1 -1
  13. package/bundle/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
  14. package/bundle/icons/IconName.d.ts +6 -2
  15. package/bundle/ui-kit/Button/ButtonProps.d.ts +5 -1
  16. package/bundle/ui-kit/Button/ButtonSection.d.ts +9 -1
  17. package/bundle/{components/OfficeMap → ui-kit/YandexMap}/YandexMap.d.ts +4 -1
  18. package/bundle/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
  19. package/bundle/ui-kit/YandexMap/mockPoints.d.ts +5 -0
  20. package/bundle/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
  21. package/bundle/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
  22. package/bundle/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
  23. package/bundle/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
  24. package/bundle/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
  25. package/cosmos-static/icons/FullScreenIcon.svg +1 -0
  26. package/cosmos-static/icons/UserGeoLocationIcon.svg +1 -0
  27. package/dist/components/Bonus/BonusContent.d.ts +1 -0
  28. package/dist/components/Catalog/CatalogCard.js +2 -2
  29. package/dist/components/Catalog/CatalogCard.js.map +1 -1
  30. package/dist/components/ContentPage/renderContentPageHead.js +7 -7
  31. package/dist/components/ContentPage/renderContentPageHead.js.map +1 -1
  32. package/dist/components/ExchangeRateTile/CurrencyTable.js +2 -2
  33. package/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
  34. package/dist/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
  35. package/dist/components/ExchangeRateTile/CurrentLocation.js +1 -1
  36. package/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -1
  37. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
  38. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -15
  39. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  40. package/dist/components/ExchangeRateTile/ExchangeRateTile.js +11 -11
  41. package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  42. package/dist/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
  43. package/dist/components/ExchangeRateTile/renderInput.js +4 -1
  44. package/dist/components/ExchangeRateTile/renderInput.js.map +1 -1
  45. package/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
  46. package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js +43 -0
  47. package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
  48. package/dist/components/Gallery/GalleryCardInner.js +2 -2
  49. package/dist/components/Gallery/GalleryCardInner.js.map +1 -1
  50. package/dist/components/Gallery/GalleryInner.js +2 -2
  51. package/dist/components/Gallery/GalleryInner.js.map +1 -1
  52. package/dist/components/Header/DropdownMenu.js +1 -1
  53. package/dist/components/Header/DropdownMenu.js.map +1 -1
  54. package/dist/components/Header/HeaderSubMenu.js +16 -11
  55. package/dist/components/Header/HeaderSubMenu.js.map +1 -1
  56. package/dist/components/OfficeMap/OfficeMap.js +6 -10
  57. package/dist/components/OfficeMap/OfficeMap.js.map +1 -1
  58. package/dist/components/OfficeMap/nearbyOffices.d.ts +2 -0
  59. package/dist/components/OfficeMap/nearbyOffices.js +9 -0
  60. package/dist/components/OfficeMap/nearbyOffices.js.map +1 -0
  61. package/dist/components/OfficeMap/renderFunctions.d.ts +1 -1
  62. package/dist/components/OfficeMap/renderFunctions.js +1 -1
  63. package/dist/components/OfficeMap/renderFunctions.js.map +1 -1
  64. package/dist/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
  65. package/{mobile/dist/hooks → dist/components/OfficeMap}/useOfficeMap.js +1 -1
  66. package/dist/components/OfficeMap/useOfficeMap.js.map +1 -0
  67. package/dist/components/PictureText/PictureText.js +1 -1
  68. package/dist/components/PictureText/PictureText.js.map +1 -1
  69. package/dist/components/SafeDepositRental/SafeDepositRental.js +2 -2
  70. package/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  71. package/dist/components/TariffsTable/EmbeddableCellData.js +5 -2
  72. package/dist/components/TariffsTable/EmbeddableCellData.js.map +1 -1
  73. package/dist/components/TariffsTable/EmbeddableCellData.mobile.js +5 -2
  74. package/dist/components/TariffsTable/EmbeddableCellData.mobile.js.map +1 -1
  75. package/dist/components/TariffsTable/dataFixture.js +2 -4
  76. package/dist/components/TariffsTable/dataFixture.js.map +1 -1
  77. package/dist/icons/IconName.d.ts +6 -2
  78. package/dist/icons/IconName.js +5 -1
  79. package/dist/icons/IconName.js.map +1 -1
  80. package/dist/ui-kit/Button/ButtonProps.d.ts +5 -1
  81. package/dist/ui-kit/Button/ButtonSection.d.ts +9 -1
  82. package/dist/ui-kit/Button/ButtonSection.js +18 -6
  83. package/dist/ui-kit/Button/ButtonSection.js.map +1 -1
  84. package/dist/ui-kit/Foldable/DefaultFoldButton.js +13 -4
  85. package/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  86. package/dist/ui-kit/IntersectionObserverTag.js +10 -10
  87. package/dist/ui-kit/IntersectionObserverTag.js.map +1 -1
  88. package/{lib/components/OfficeMap → dist/ui-kit/YandexMap}/YandexMap.d.ts +4 -1
  89. package/dist/ui-kit/YandexMap/YandexMap.js +86 -0
  90. package/dist/ui-kit/YandexMap/YandexMap.js.map +1 -0
  91. package/dist/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
  92. package/dist/ui-kit/YandexMap/ZoomButton.js +26 -0
  93. package/dist/ui-kit/YandexMap/ZoomButton.js.map +1 -0
  94. package/dist/ui-kit/YandexMap/mockPoints.d.ts +5 -0
  95. package/dist/ui-kit/YandexMap/mockPoints.js +28 -0
  96. package/dist/ui-kit/YandexMap/mockPoints.js.map +1 -0
  97. package/dist/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
  98. package/dist/ui-kit/YandexMap/renderClusterer.js +35 -0
  99. package/dist/ui-kit/YandexMap/renderClusterer.js.map +1 -0
  100. package/dist/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
  101. package/dist/ui-kit/YandexMap/renderOpenMap.js +19 -0
  102. package/dist/ui-kit/YandexMap/renderOpenMap.js.map +1 -0
  103. package/dist/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
  104. package/dist/ui-kit/YandexMap/renderSearchField.js +31 -0
  105. package/dist/ui-kit/YandexMap/renderSearchField.js.map +1 -0
  106. package/dist/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
  107. package/dist/ui-kit/YandexMap/renderUserGeolocation.js +31 -0
  108. package/dist/ui-kit/YandexMap/renderUserGeolocation.js.map +1 -0
  109. package/dist/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
  110. package/dist/ui-kit/YandexMap/useYandexMaps.js +11 -0
  111. package/dist/ui-kit/YandexMap/useYandexMaps.js.map +1 -0
  112. package/lib/common.css +1 -1
  113. package/lib/components/Bonus/BonusContent.d.ts +1 -0
  114. package/lib/components/Catalog/CatalogCard.js +2 -2
  115. package/lib/components/Catalog/CatalogCard.js.map +1 -1
  116. package/lib/components/ContentPage/renderContentPageHead.js +7 -7
  117. package/lib/components/ContentPage/renderContentPageHead.js.map +1 -1
  118. package/lib/components/ExchangeRateTile/CurrencyTable.js +2 -2
  119. package/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
  120. package/lib/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
  121. package/lib/components/ExchangeRateTile/CurrentLocation.js +1 -1
  122. package/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -1
  123. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
  124. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -15
  125. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  126. package/lib/components/ExchangeRateTile/ExchangeRateTile.js +11 -11
  127. package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  128. package/lib/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
  129. package/lib/components/ExchangeRateTile/renderInput.js +4 -1
  130. package/lib/components/ExchangeRateTile/renderInput.js.map +1 -1
  131. package/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
  132. package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js +39 -0
  133. package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
  134. package/lib/components/Gallery/GalleryCardInner.js +2 -2
  135. package/lib/components/Gallery/GalleryCardInner.js.map +1 -1
  136. package/lib/components/Gallery/GalleryInner.js +2 -2
  137. package/lib/components/Gallery/GalleryInner.js.map +1 -1
  138. package/lib/components/Header/DropdownMenu.js +1 -1
  139. package/lib/components/Header/DropdownMenu.js.map +1 -1
  140. package/lib/components/Header/HeaderSubMenu.js +17 -12
  141. package/lib/components/Header/HeaderSubMenu.js.map +1 -1
  142. package/lib/components/OfficeMap/OfficeMap.js +6 -10
  143. package/lib/components/OfficeMap/OfficeMap.js.map +1 -1
  144. package/lib/components/OfficeMap/nearbyOffices.d.ts +2 -0
  145. package/lib/components/OfficeMap/nearbyOffices.js +7 -0
  146. package/lib/components/OfficeMap/nearbyOffices.js.map +1 -0
  147. package/lib/components/OfficeMap/renderFunctions.d.ts +1 -1
  148. package/lib/components/OfficeMap/renderFunctions.js +1 -1
  149. package/lib/components/OfficeMap/renderFunctions.js.map +1 -1
  150. package/lib/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
  151. package/{mobile/lib/hooks → lib/components/OfficeMap}/useOfficeMap.js +1 -1
  152. package/lib/components/OfficeMap/useOfficeMap.js.map +1 -0
  153. package/lib/components/PictureText/PictureText.js +1 -1
  154. package/lib/components/PictureText/PictureText.js.map +1 -1
  155. package/lib/components/SafeDepositRental/SafeDepositRental.js +2 -2
  156. package/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  157. package/lib/components/TariffsTable/EmbeddableCellData.js +5 -2
  158. package/lib/components/TariffsTable/EmbeddableCellData.js.map +1 -1
  159. package/lib/components/TariffsTable/EmbeddableCellData.mobile.js +5 -2
  160. package/lib/components/TariffsTable/EmbeddableCellData.mobile.js.map +1 -1
  161. package/lib/components/TariffsTable/dataFixture.js +2 -4
  162. package/lib/components/TariffsTable/dataFixture.js.map +1 -1
  163. package/lib/icons/IconName.d.ts +6 -2
  164. package/lib/icons/IconName.js +5 -1
  165. package/lib/icons/IconName.js.map +1 -1
  166. package/lib/ui-kit/Button/ButtonProps.d.ts +5 -1
  167. package/lib/ui-kit/Button/ButtonSection.d.ts +9 -1
  168. package/lib/ui-kit/Button/ButtonSection.js +16 -5
  169. package/lib/ui-kit/Button/ButtonSection.js.map +1 -1
  170. package/lib/ui-kit/Foldable/DefaultFoldButton.js +13 -4
  171. package/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  172. package/lib/ui-kit/IntersectionObserverTag.js +11 -11
  173. package/lib/ui-kit/IntersectionObserverTag.js.map +1 -1
  174. package/{mobile/bundle/components/OfficeMap → lib/ui-kit/YandexMap}/YandexMap.d.ts +4 -1
  175. package/lib/ui-kit/YandexMap/YandexMap.js +84 -0
  176. package/lib/ui-kit/YandexMap/YandexMap.js.map +1 -0
  177. package/lib/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
  178. package/lib/ui-kit/YandexMap/ZoomButton.js +24 -0
  179. package/lib/ui-kit/YandexMap/ZoomButton.js.map +1 -0
  180. package/lib/ui-kit/YandexMap/mockPoints.d.ts +5 -0
  181. package/lib/ui-kit/YandexMap/mockPoints.js +26 -0
  182. package/lib/ui-kit/YandexMap/mockPoints.js.map +1 -0
  183. package/lib/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
  184. package/lib/ui-kit/YandexMap/renderClusterer.js +32 -0
  185. package/lib/ui-kit/YandexMap/renderClusterer.js.map +1 -0
  186. package/lib/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
  187. package/lib/ui-kit/YandexMap/renderOpenMap.js +16 -0
  188. package/lib/ui-kit/YandexMap/renderOpenMap.js.map +1 -0
  189. package/lib/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
  190. package/lib/ui-kit/YandexMap/renderSearchField.js +28 -0
  191. package/lib/ui-kit/YandexMap/renderSearchField.js.map +1 -0
  192. package/lib/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
  193. package/lib/ui-kit/YandexMap/renderUserGeolocation.js +28 -0
  194. package/lib/ui-kit/YandexMap/renderUserGeolocation.js.map +1 -0
  195. package/lib/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
  196. package/lib/ui-kit/YandexMap/useYandexMaps.js +8 -0
  197. package/lib/ui-kit/YandexMap/useYandexMaps.js.map +1 -0
  198. package/mobile/bundle/bundle.umd.js +32 -19
  199. package/mobile/bundle/bundle.umd.min.js +1 -1
  200. package/mobile/bundle/components/Bonus/BonusContent.d.ts +1 -0
  201. package/mobile/bundle/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
  202. package/mobile/bundle/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
  203. package/mobile/bundle/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
  204. package/mobile/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
  205. package/mobile/bundle/components/OfficeMap/nearbyOffices.d.ts +2 -0
  206. package/mobile/bundle/components/OfficeMap/renderFunctions.d.ts +1 -1
  207. package/mobile/bundle/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
  208. package/mobile/bundle/icons/IconName.d.ts +6 -2
  209. package/mobile/bundle/ui-kit/Button/ButtonProps.d.ts +5 -1
  210. package/mobile/bundle/ui-kit/Button/ButtonSection.d.ts +9 -1
  211. package/{dist/components/OfficeMap → mobile/bundle/ui-kit/YandexMap}/YandexMap.d.ts +4 -1
  212. package/mobile/bundle/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
  213. package/mobile/bundle/ui-kit/YandexMap/mockPoints.d.ts +5 -0
  214. package/mobile/bundle/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
  215. package/mobile/bundle/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
  216. package/mobile/bundle/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
  217. package/mobile/bundle/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
  218. package/mobile/bundle/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
  219. package/mobile/dist/components/Bonus/BonusContent.d.ts +1 -0
  220. package/mobile/dist/components/Catalog/CatalogCard.js +2 -2
  221. package/mobile/dist/components/Catalog/CatalogCard.js.map +1 -1
  222. package/mobile/dist/components/ContentPage/renderContentPageHead.js +7 -7
  223. package/mobile/dist/components/ContentPage/renderContentPageHead.js.map +1 -1
  224. package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js +2 -2
  225. package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
  226. package/mobile/dist/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
  227. package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js +1 -1
  228. package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -1
  229. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
  230. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -15
  231. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  232. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +11 -11
  233. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  234. package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
  235. package/mobile/dist/components/ExchangeRateTile/renderInput.js +4 -1
  236. package/mobile/dist/components/ExchangeRateTile/renderInput.js.map +1 -1
  237. package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
  238. package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js +43 -0
  239. package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
  240. package/mobile/dist/components/Gallery/GalleryCardInner.js +2 -2
  241. package/mobile/dist/components/Gallery/GalleryCardInner.js.map +1 -1
  242. package/mobile/dist/components/Gallery/GalleryInner.js +2 -2
  243. package/mobile/dist/components/Gallery/GalleryInner.js.map +1 -1
  244. package/mobile/dist/components/Header/DropdownMenu.js +1 -1
  245. package/mobile/dist/components/Header/DropdownMenu.js.map +1 -1
  246. package/mobile/dist/components/Header/HeaderSubMenu.js +16 -11
  247. package/mobile/dist/components/Header/HeaderSubMenu.js.map +1 -1
  248. package/mobile/dist/components/OfficeMap/OfficeMap.js +6 -10
  249. package/mobile/dist/components/OfficeMap/OfficeMap.js.map +1 -1
  250. package/mobile/dist/components/OfficeMap/nearbyOffices.d.ts +2 -0
  251. package/mobile/dist/components/OfficeMap/nearbyOffices.js +9 -0
  252. package/mobile/dist/components/OfficeMap/nearbyOffices.js.map +1 -0
  253. package/mobile/dist/components/OfficeMap/renderFunctions.d.ts +1 -1
  254. package/mobile/dist/components/OfficeMap/renderFunctions.js +1 -1
  255. package/mobile/dist/components/OfficeMap/renderFunctions.js.map +1 -1
  256. package/mobile/dist/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
  257. package/{dist/hooks → mobile/dist/components/OfficeMap}/useOfficeMap.js +1 -1
  258. package/mobile/dist/components/OfficeMap/useOfficeMap.js.map +1 -0
  259. package/mobile/dist/components/PictureText/PictureText.js +1 -1
  260. package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
  261. package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js +2 -2
  262. package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  263. package/mobile/dist/components/TariffsTable/EmbeddableCellData.js +5 -2
  264. package/mobile/dist/components/TariffsTable/EmbeddableCellData.js.map +1 -1
  265. package/mobile/dist/components/TariffsTable/dataFixture.js +2 -4
  266. package/mobile/dist/components/TariffsTable/dataFixture.js.map +1 -1
  267. package/mobile/dist/icons/IconName.d.ts +6 -2
  268. package/mobile/dist/icons/IconName.js +5 -1
  269. package/mobile/dist/icons/IconName.js.map +1 -1
  270. package/mobile/dist/ui-kit/Button/ButtonProps.d.ts +5 -1
  271. package/mobile/dist/ui-kit/Button/ButtonSection.d.ts +9 -1
  272. package/mobile/dist/ui-kit/Button/ButtonSection.js +18 -6
  273. package/mobile/dist/ui-kit/Button/ButtonSection.js.map +1 -1
  274. package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js +13 -4
  275. package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  276. package/mobile/dist/ui-kit/IntersectionObserverTag.js +10 -10
  277. package/mobile/dist/ui-kit/IntersectionObserverTag.js.map +1 -1
  278. package/mobile/dist/ui-kit/YandexMap/YandexMap.d.ts +8 -0
  279. package/mobile/dist/ui-kit/YandexMap/YandexMap.js +86 -0
  280. package/mobile/dist/ui-kit/YandexMap/YandexMap.js.map +1 -0
  281. package/mobile/dist/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
  282. package/mobile/dist/ui-kit/YandexMap/ZoomButton.js +26 -0
  283. package/mobile/dist/ui-kit/YandexMap/ZoomButton.js.map +1 -0
  284. package/mobile/dist/ui-kit/YandexMap/mockPoints.d.ts +5 -0
  285. package/mobile/dist/ui-kit/YandexMap/mockPoints.js +28 -0
  286. package/mobile/dist/ui-kit/YandexMap/mockPoints.js.map +1 -0
  287. package/mobile/dist/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
  288. package/mobile/dist/ui-kit/YandexMap/renderClusterer.js +35 -0
  289. package/mobile/dist/ui-kit/YandexMap/renderClusterer.js.map +1 -0
  290. package/mobile/dist/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
  291. package/mobile/dist/ui-kit/YandexMap/renderOpenMap.js +19 -0
  292. package/mobile/dist/ui-kit/YandexMap/renderOpenMap.js.map +1 -0
  293. package/mobile/dist/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
  294. package/mobile/dist/ui-kit/YandexMap/renderSearchField.js +31 -0
  295. package/mobile/dist/ui-kit/YandexMap/renderSearchField.js.map +1 -0
  296. package/mobile/dist/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
  297. package/mobile/dist/ui-kit/YandexMap/renderUserGeolocation.js +31 -0
  298. package/mobile/dist/ui-kit/YandexMap/renderUserGeolocation.js.map +1 -0
  299. package/mobile/dist/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
  300. package/mobile/dist/ui-kit/YandexMap/useYandexMaps.js +11 -0
  301. package/mobile/dist/ui-kit/YandexMap/useYandexMaps.js.map +1 -0
  302. package/mobile/lib/components/Bonus/BonusContent.d.ts +1 -0
  303. package/mobile/lib/components/Catalog/CatalogCard.js +2 -2
  304. package/mobile/lib/components/Catalog/CatalogCard.js.map +1 -1
  305. package/mobile/lib/components/ContentPage/renderContentPageHead.js +7 -7
  306. package/mobile/lib/components/ContentPage/renderContentPageHead.js.map +1 -1
  307. package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js +2 -2
  308. package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
  309. package/mobile/lib/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
  310. package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js +1 -1
  311. package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -1
  312. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
  313. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -15
  314. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  315. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +11 -11
  316. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  317. package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
  318. package/mobile/lib/components/ExchangeRateTile/renderInput.js +4 -1
  319. package/mobile/lib/components/ExchangeRateTile/renderInput.js.map +1 -1
  320. package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
  321. package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js +39 -0
  322. package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
  323. package/mobile/lib/components/Gallery/GalleryCardInner.js +2 -2
  324. package/mobile/lib/components/Gallery/GalleryCardInner.js.map +1 -1
  325. package/mobile/lib/components/Gallery/GalleryInner.js +2 -2
  326. package/mobile/lib/components/Gallery/GalleryInner.js.map +1 -1
  327. package/mobile/lib/components/Header/DropdownMenu.js +1 -1
  328. package/mobile/lib/components/Header/DropdownMenu.js.map +1 -1
  329. package/mobile/lib/components/Header/HeaderSubMenu.js +17 -12
  330. package/mobile/lib/components/Header/HeaderSubMenu.js.map +1 -1
  331. package/mobile/lib/components/OfficeMap/OfficeMap.js +6 -10
  332. package/mobile/lib/components/OfficeMap/OfficeMap.js.map +1 -1
  333. package/mobile/lib/components/OfficeMap/nearbyOffices.d.ts +2 -0
  334. package/mobile/lib/components/OfficeMap/nearbyOffices.js +7 -0
  335. package/mobile/lib/components/OfficeMap/nearbyOffices.js.map +1 -0
  336. package/mobile/lib/components/OfficeMap/renderFunctions.d.ts +1 -1
  337. package/mobile/lib/components/OfficeMap/renderFunctions.js +1 -1
  338. package/mobile/lib/components/OfficeMap/renderFunctions.js.map +1 -1
  339. package/mobile/lib/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
  340. package/{lib/hooks → mobile/lib/components/OfficeMap}/useOfficeMap.js +1 -1
  341. package/mobile/lib/components/OfficeMap/useOfficeMap.js.map +1 -0
  342. package/mobile/lib/components/PictureText/PictureText.js +1 -1
  343. package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
  344. package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js +2 -2
  345. package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  346. package/mobile/lib/components/TariffsTable/EmbeddableCellData.js +5 -2
  347. package/mobile/lib/components/TariffsTable/EmbeddableCellData.js.map +1 -1
  348. package/mobile/lib/components/TariffsTable/dataFixture.js +2 -4
  349. package/mobile/lib/components/TariffsTable/dataFixture.js.map +1 -1
  350. package/mobile/lib/icons/IconName.d.ts +6 -2
  351. package/mobile/lib/icons/IconName.js +5 -1
  352. package/mobile/lib/icons/IconName.js.map +1 -1
  353. package/mobile/lib/ui-kit/Button/ButtonProps.d.ts +5 -1
  354. package/mobile/lib/ui-kit/Button/ButtonSection.d.ts +9 -1
  355. package/mobile/lib/ui-kit/Button/ButtonSection.js +16 -5
  356. package/mobile/lib/ui-kit/Button/ButtonSection.js.map +1 -1
  357. package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js +13 -4
  358. package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  359. package/mobile/lib/ui-kit/IntersectionObserverTag.js +11 -11
  360. package/mobile/lib/ui-kit/IntersectionObserverTag.js.map +1 -1
  361. package/mobile/lib/ui-kit/YandexMap/YandexMap.d.ts +8 -0
  362. package/mobile/lib/ui-kit/YandexMap/YandexMap.js +84 -0
  363. package/mobile/lib/ui-kit/YandexMap/YandexMap.js.map +1 -0
  364. package/mobile/lib/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
  365. package/mobile/lib/ui-kit/YandexMap/ZoomButton.js +24 -0
  366. package/mobile/lib/ui-kit/YandexMap/ZoomButton.js.map +1 -0
  367. package/mobile/lib/ui-kit/YandexMap/mockPoints.d.ts +5 -0
  368. package/mobile/lib/ui-kit/YandexMap/mockPoints.js +26 -0
  369. package/mobile/lib/ui-kit/YandexMap/mockPoints.js.map +1 -0
  370. package/mobile/lib/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
  371. package/mobile/lib/ui-kit/YandexMap/renderClusterer.js +32 -0
  372. package/mobile/lib/ui-kit/YandexMap/renderClusterer.js.map +1 -0
  373. package/mobile/lib/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
  374. package/mobile/lib/ui-kit/YandexMap/renderOpenMap.js +16 -0
  375. package/mobile/lib/ui-kit/YandexMap/renderOpenMap.js.map +1 -0
  376. package/mobile/lib/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
  377. package/mobile/lib/ui-kit/YandexMap/renderSearchField.js +28 -0
  378. package/mobile/lib/ui-kit/YandexMap/renderSearchField.js.map +1 -0
  379. package/mobile/lib/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
  380. package/mobile/lib/ui-kit/YandexMap/renderUserGeolocation.js +28 -0
  381. package/mobile/lib/ui-kit/YandexMap/renderUserGeolocation.js.map +1 -0
  382. package/mobile/lib/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
  383. package/mobile/lib/ui-kit/YandexMap/useYandexMaps.js +8 -0
  384. package/mobile/lib/ui-kit/YandexMap/useYandexMaps.js.map +1 -0
  385. package/mobile/src/common.css +9 -0
  386. package/mobile/src/components/Bonus/Bonus.example.json +1 -6
  387. package/mobile/src/components/Bonus/BonusContent.ts +1 -0
  388. package/mobile/src/components/Catalog/CatalogCard.tsx +2 -2
  389. package/mobile/src/components/ContentPage/renderContentPageHead.tsx +11 -7
  390. package/mobile/src/components/ExchangeRateTile/CurrencyTable.tsx +8 -6
  391. package/mobile/src/components/ExchangeRateTile/CurrentLocation.tsx +8 -15
  392. package/mobile/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +31 -19
  393. package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +14 -13
  394. package/mobile/src/components/ExchangeRateTile/callbackCurrencySelect.ts +1 -1
  395. package/mobile/src/components/ExchangeRateTile/renderInput.tsx +5 -2
  396. package/mobile/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +71 -0
  397. package/mobile/src/components/Gallery/GalleryCardInner.tsx +2 -2
  398. package/mobile/src/components/Gallery/GalleryInner.tsx +2 -2
  399. package/mobile/src/components/Header/DropdownMenu.tsx +5 -5
  400. package/mobile/src/components/Header/HeaderSubMenu.tsx +36 -20
  401. package/mobile/src/components/OfficeMap/OfficeMap.tsx +10 -17
  402. package/mobile/src/components/OfficeMap/nearbyOffices.ts +8 -0
  403. package/mobile/src/components/OfficeMap/renderFunctions.tsx +5 -2
  404. package/mobile/src/{hooks → components/OfficeMap}/useOfficeMap.ts +1 -1
  405. package/mobile/src/components/PictureText/PictureText.tsx +1 -1
  406. package/mobile/src/components/SafeDepositRental/SafeDepositRental.tsx +2 -2
  407. package/mobile/src/components/TariffsTable/EmbeddableCellData.tsx +7 -11
  408. package/mobile/src/components/TariffsTable/dataFixture.tsx +2 -3
  409. package/mobile/src/icons/FullScreenIcon.svg +8 -0
  410. package/mobile/src/icons/IconName.ts +5 -5
  411. package/mobile/src/icons/UserGeoLocationIcon.svg +3 -0
  412. package/mobile/src/ui-kit/Button/ButtonProps.ts +5 -1
  413. package/mobile/src/ui-kit/Button/ButtonSection.tsx +41 -16
  414. package/mobile/src/ui-kit/Foldable/DefaultFoldButton.tsx +32 -23
  415. package/mobile/src/ui-kit/IntersectionObserverTag.tsx +13 -17
  416. package/mobile/src/ui-kit/YandexMap/YandexMap.tsx +128 -0
  417. package/mobile/src/ui-kit/YandexMap/ZoomButton.tsx +38 -0
  418. package/mobile/src/ui-kit/YandexMap/mockPoints.ts +30 -0
  419. package/mobile/src/ui-kit/YandexMap/renderClusterer.ts +51 -0
  420. package/mobile/src/ui-kit/YandexMap/renderOpenMap.tsx +26 -0
  421. package/mobile/src/ui-kit/YandexMap/renderSearchField.tsx +51 -0
  422. package/mobile/src/ui-kit/YandexMap/renderUserGeolocation.tsx +43 -0
  423. package/mobile/src/ui-kit/YandexMap/useYandexMaps.ts +11 -0
  424. package/package.json +1 -1
  425. package/src/common.css +9 -0
  426. package/src/components/Bonus/Bonus.example.json +1 -6
  427. package/src/components/Bonus/BonusContent.ts +1 -0
  428. package/src/components/Catalog/Catalog.fixture.tsx +3 -10
  429. package/src/components/Catalog/CatalogCard.tsx +2 -2
  430. package/src/components/ContentPage/renderContentPageHead.tsx +11 -7
  431. package/src/components/ExchangeRateTile/CurrencyTable.tsx +8 -6
  432. package/src/components/ExchangeRateTile/CurrentLocation.tsx +8 -15
  433. package/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +31 -19
  434. package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +14 -13
  435. package/src/components/ExchangeRateTile/callbackCurrencySelect.ts +1 -1
  436. package/src/components/ExchangeRateTile/renderInput.tsx +5 -2
  437. package/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +71 -0
  438. package/src/components/Gallery/Gallery.fixture.tsx +1 -2
  439. package/src/components/Gallery/GalleryCardInner.tsx +2 -2
  440. package/src/components/Gallery/GalleryInner.tsx +2 -2
  441. package/src/components/Header/DropdownMenu.tsx +5 -5
  442. package/src/components/Header/HeaderSubMenu.tsx +36 -20
  443. package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +3 -14
  444. package/src/components/OfficeMap/OfficeMap.tsx +10 -17
  445. package/src/components/OfficeMap/nearbyOffices.ts +8 -0
  446. package/src/components/OfficeMap/renderFunctions.tsx +5 -2
  447. package/src/{hooks → components/OfficeMap}/useOfficeMap.ts +1 -1
  448. package/src/components/PictureText/PictureText.tsx +1 -1
  449. package/src/components/SafeDepositRental/SafeDepositRental.tsx +2 -2
  450. package/src/components/StepsBlock/StepsBlock.fixture.tsx +2 -0
  451. package/src/components/TariffsTable/EmbeddableCellData.mobile.tsx +7 -11
  452. package/src/components/TariffsTable/EmbeddableCellData.tsx +7 -9
  453. package/src/components/TariffsTable/dataFixture.tsx +2 -3
  454. package/src/icons/FullScreenIcon.svg +8 -0
  455. package/src/icons/IconName.ts +9 -1
  456. package/src/icons/UserGeoLocationIcon.svg +3 -0
  457. package/src/ui-kit/Button/ButtonProps.ts +5 -1
  458. package/src/ui-kit/Button/ButtonSection.tsx +41 -16
  459. package/src/ui-kit/Foldable/DefaultFoldButton.tsx +32 -23
  460. package/src/ui-kit/IntersectionObserverTag.tsx +13 -17
  461. package/src/ui-kit/YandexMap/YandexMap.tsx +128 -0
  462. package/src/ui-kit/YandexMap/ZoomButton.tsx +38 -0
  463. package/src/ui-kit/YandexMap/mockPoints.ts +30 -0
  464. package/src/ui-kit/YandexMap/renderClusterer.ts +51 -0
  465. package/src/ui-kit/YandexMap/renderOpenMap.tsx +26 -0
  466. package/src/ui-kit/YandexMap/renderSearchField.tsx +51 -0
  467. package/src/ui-kit/YandexMap/renderUserGeolocation.tsx +43 -0
  468. package/src/ui-kit/YandexMap/useYandexMaps.ts +11 -0
  469. package/bundle/hooks/useExchangeRates.d.ts +0 -2
  470. package/dist/components/OfficeMap/YandexMap.js +0 -30
  471. package/dist/components/OfficeMap/YandexMap.js.map +0 -1
  472. package/dist/hooks/useExchangeRates.d.ts +0 -2
  473. package/dist/hooks/useExchangeRates.js +0 -57
  474. package/dist/hooks/useExchangeRates.js.map +0 -1
  475. package/dist/hooks/useOfficeMap.js.map +0 -1
  476. package/lib/components/OfficeMap/YandexMap.js +0 -28
  477. package/lib/components/OfficeMap/YandexMap.js.map +0 -1
  478. package/lib/hooks/useExchangeRates.d.ts +0 -2
  479. package/lib/hooks/useExchangeRates.js +0 -54
  480. package/lib/hooks/useExchangeRates.js.map +0 -1
  481. package/lib/hooks/useOfficeMap.js.map +0 -1
  482. package/mobile/bundle/hooks/useExchangeRates.d.ts +0 -2
  483. package/mobile/dist/components/OfficeMap/YandexMap.d.ts +0 -5
  484. package/mobile/dist/components/OfficeMap/YandexMap.js +0 -30
  485. package/mobile/dist/components/OfficeMap/YandexMap.js.map +0 -1
  486. package/mobile/dist/hooks/useExchangeRates.d.ts +0 -2
  487. package/mobile/dist/hooks/useExchangeRates.js +0 -57
  488. package/mobile/dist/hooks/useExchangeRates.js.map +0 -1
  489. package/mobile/dist/hooks/useOfficeMap.js.map +0 -1
  490. package/mobile/lib/components/OfficeMap/YandexMap.d.ts +0 -5
  491. package/mobile/lib/components/OfficeMap/YandexMap.js +0 -28
  492. package/mobile/lib/components/OfficeMap/YandexMap.js.map +0 -1
  493. package/mobile/lib/hooks/useExchangeRates.d.ts +0 -2
  494. package/mobile/lib/hooks/useExchangeRates.js +0 -54
  495. package/mobile/lib/hooks/useExchangeRates.js.map +0 -1
  496. package/mobile/lib/hooks/useOfficeMap.js.map +0 -1
  497. package/mobile/src/components/OfficeMap/YandexMap.tsx +0 -41
  498. package/mobile/src/hooks/useExchangeRates.ts +0 -76
  499. package/src/components/OfficeMap/YandexMap.tsx +0 -41
  500. package/src/hooks/useExchangeRates.ts +0 -76
@@ -0,0 +1,43 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
2
+ import { Icon } from '../Icon/Icon';
3
+ import ymaps from 'yandex-maps';
4
+
5
+ const styles = {
6
+ focus: 'focus:border-primary-focus focus:border',
7
+ hover: 'hover:bg-primary-hover',
8
+ active: 'active:bg-primary-active',
9
+ border: 'border border-transparent rounded-md',
10
+ position: 'absolute flex items-center justify-center',
11
+ font: 'text-center font-sans',
12
+ };
13
+
14
+ export const renderUserGeolocation = (
15
+ map: ymaps.Map,
16
+ yandexMaps: typeof ymaps,
17
+ className: string,
18
+ ) => {
19
+ const setUserGeoLocation = () => {
20
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
21
+ // @ts-ignore
22
+ yandexMaps.geolocation
23
+ .get({
24
+ provider: 'yandex',
25
+ autoReverseGeocode: true,
26
+ mapStateAutoApply: true,
27
+ })
28
+ .then(function (result) {
29
+ map.geoObjects.add(result.geoObjects);
30
+ });
31
+ };
32
+
33
+ return (
34
+ <div
35
+ className={`select-none cursor-pointer py-4 w-12 bg-white ${Object.values(styles).join(
36
+ ' ',
37
+ )} ${className}`}
38
+ onClick={setUserGeoLocation}
39
+ >
40
+ <Icon name="UserGeoLocationIcon" width="20" height="16" />
41
+ </div>
42
+ );
43
+ };
@@ -0,0 +1,11 @@
1
+ import ymaps from 'yandex-maps';
2
+ import { useExternalNS } from '../../hooks/useExternalNS';
3
+ import { projectSettings } from '../../ProjectSettings';
4
+
5
+ const YMAPS_NAMESPACE = 'ymaps';
6
+
7
+ export const useYandexMaps = () => {
8
+ const url = `https://api-maps.yandex.ru/2.1/?apikey=${projectSettings.YANDEX_MAP_API_KEY}&lang=ru_RU`;
9
+
10
+ return useExternalNS<typeof ymaps>(YMAPS_NAMESPACE, url);
11
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.6.15",
3
+ "version": "0.6.17",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
package/src/common.css CHANGED
@@ -157,3 +157,12 @@ html {
157
157
  -moz-appearance: textfield;
158
158
  }
159
159
  }
160
+
161
+ /*
162
+ Styling Yandex Map element
163
+ */
164
+ /* Hide yandex elements in yandex map */
165
+ [class$='-map-copyrights-promo'],
166
+ [class$='-copyrights-pane'] {
167
+ display: none;
168
+ }
@@ -4,12 +4,7 @@
4
4
  "bonusItems": [
5
5
  {
6
6
  "title": "Плитка 1",
7
- "description": "Описание плитки 1",
8
- "bonusItemContent": {
9
- "bonusType": "count",
10
- "bonusCount": "1",
11
- "bonusName": "балл"
12
- }
7
+ "description": "Описание плитки 1"
13
8
  }
14
9
  ]
15
10
  }
@@ -37,6 +37,7 @@ export type BonusItem = HeadlineCommonProps & {
37
37
  /**
38
38
  * @title Кнопка
39
39
  * @maxItems 1
40
+ * @default [{"version" : "secondary", "target": "_self"}]
40
41
  */
41
42
  buttons?: ButtonWithIconProps[];
42
43
  };
@@ -1,9 +1,7 @@
1
- import type { IconVersion } from '../../model/IconVersion';
2
1
  import type { Picture } from '../../model/Picture';
3
2
  import type { ProductColorVersion } from '../../model/ProductColorVersion';
4
3
  import { context } from '../../react/setup-fixture';
5
4
  import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
6
- import { Img } from '../../ui-kit/Img/Img';
7
5
  import { Catalog, CatalogProps } from './Catalog';
8
6
 
9
7
  const payRing: Picture = {
@@ -23,14 +21,9 @@ const buttonPrimary: ButtonWithIconProps = {
23
21
  text: 'Подробнее',
24
22
  target: '_blank',
25
23
  version: 'primary',
26
- appendLeft: (
27
- <Img
28
- image={{ icon: 'AppleIcon', iconVersion: 'primary' as IconVersion }}
29
- width="24"
30
- height="24"
31
- asSVG
32
- />
33
- ),
24
+ icon: {
25
+ icon: 'AppleIcon',
26
+ },
34
27
  };
35
28
 
36
29
  const catalogCard = {
@@ -2,7 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { BlockVersion } from '../../model/BlockVersion';
3
3
  import type { UniBlockProps } from '../../model/JSXBlock';
4
4
  import type { ProductColorVersion } from '../../model/ProductColorVersion';
5
- import { Button } from '../../ui-kit/Button/Button';
5
+ import { renderButton } from '../../ui-kit/Button/ButtonSection';
6
6
  import { Heading } from '../../ui-kit/Heading/Heading';
7
7
  import { Img } from '../../ui-kit/Img/Img';
8
8
  import type { CatalogCardType } from './CatalogContent';
@@ -35,7 +35,7 @@ export const CatalogCard = JSX<CatalogCardProps>(
35
35
  </div>
36
36
  ) : null}
37
37
  {price ? <div className="text-h3 text-left">{price}&nbsp;₽</div> : null}
38
- {button ? <Button className="mt-5 w-full" {...button} /> : null}
38
+ {button ? renderButton({ button, buttonClassName: 'mt-5 w-full' }) : null}
39
39
  </section>
40
40
  );
41
41
  },
@@ -5,15 +5,19 @@ export function renderContentPageHead(data: ContentPageMeta) {
5
5
  const { description, keywords, canonical, robots } = main || {};
6
6
 
7
7
  return [
8
- <title>{title}</title>,
9
- <meta name="viewport" content="width=device-width, initial-scale=1" />,
10
- description ? <meta name="description" content={description} /> : null,
11
- keywords ? <meta name="keywords" content={keywords.join(',')} /> : null,
12
- robots ? <meta name="robots" content={robots.join(',')} /> : null,
8
+ <title key="title">{title}</title>,
9
+ <meta key="viewport" name="viewport" content="width=device-width, initial-scale=1" />,
10
+ description ? <meta key="description" name="description" content={description} /> : null,
11
+ keywords ? <meta key="keywords" name="keywords" content={keywords.join(',')} /> : null,
12
+ robots ? <meta key="robots" name="robots" content={robots.join(',')} /> : null,
13
13
  renderOpenGraph(og),
14
14
  renderTwitter(twitter),
15
- canonical ? <link rel="canonical" href={canonical} /> : null,
16
- jsonLd ? <script type="application/ld+json">{jsonLd}</script> : null,
15
+ canonical ? <link key="canonical" rel="canonical" href={canonical} /> : null,
16
+ jsonLd ? (
17
+ <script key="jsonLd" type="application/ld+json">
18
+ {jsonLd}
19
+ </script>
20
+ ) : null,
17
21
  ].filter(Boolean);
18
22
  }
19
23
 
@@ -31,18 +31,20 @@ export const CurrencyTable = JSX<CurrencyTableProps>(({ className, exchangeCurre
31
31
  });
32
32
 
33
33
  const renderCurrencyRow = (exchangeCurrencyItem: ExchangeCurrencyItem) => {
34
- const code = exchangeCurrencyItem?.code;
34
+ const currency = exchangeCurrencyItem?.currency?.currency;
35
35
 
36
36
  return (
37
- <tr key={code} className="pb-1 text-h6">
37
+ <tr key={currency} className="pb-1 text-h6">
38
38
  <td className="pt-4">
39
39
  <div className="flex items-center">
40
- {code ? <Img image={{ icon: CURRENCY_ICONS_MAP[code] }} width="24" height="24" /> : null}
41
- <span className="ml-2">{code}</span>
40
+ {currency ? (
41
+ <Img image={{ icon: CURRENCY_ICONS_MAP[currency] }} width="24" height="24" />
42
+ ) : null}
43
+ <span className="ml-2">{currency}</span>
42
44
  </div>
43
45
  </td>
44
- <td className="pt-4 pl-11">{formatCurrency(exchangeCurrencyItem?.sell)}</td>
45
- <td className="pt-4 pl-11">{formatCurrency(exchangeCurrencyItem?.buy)}</td>
46
+ <td className="pt-4 pl-11">{formatCurrency(exchangeCurrencyItem?.saleExchangeRate)}</td>
47
+ <td className="pt-4 pl-11">{formatCurrency(exchangeCurrencyItem?.buyExchangeRate)}</td>
46
48
  </tr>
47
49
  );
48
50
  };
@@ -4,21 +4,14 @@ import { Img } from '../../ui-kit/Img/Img';
4
4
  interface CurrentLocationProps {
5
5
  className?: string;
6
6
  address?: string;
7
- distance?: string;
8
7
  }
9
8
 
10
- export const CurrentLocation = JSX<CurrentLocationProps>(
11
- ({ className = '', address, distance }) => (
12
- <div className={`flex ${className}`}>
13
- <Img image={{ icon: 'GpsIcon' }} width="24" height="24" asSVG />
14
- <div className="ml-3">
15
- {address ? <p className="text-primary-main m-0 mb-1 text-l">{address}</p> : null}
16
- {distance ? (
17
- <p className="text-secondary-text m-0 text-m-light">
18
- Курс указан для ближайшего офиса - {distance}
19
- </p>
20
- ) : null}
21
- </div>
9
+ export const CurrentLocation = JSX<CurrentLocationProps>(({ className = '', address }) => (
10
+ <div className={`flex ${className}`}>
11
+ <Img image={{ icon: 'GpsIcon' }} width="24" height="24" asSVG />
12
+ <div className="ml-3">
13
+ {address ? <p className="text-primary-main m-0 mb-1 text-l">{address}</p> : null}
14
+ <p className="text-secondary-text m-0 text-m">Курс указан для ближайшего офиса</p>
22
15
  </div>
23
- ),
24
- );
16
+ </div>
17
+ ));
@@ -10,9 +10,13 @@ import { Currency } from './CurrencyProps';
10
10
  import { renderInput } from './renderInput';
11
11
 
12
12
  export interface ExchangeCurrencyItem {
13
- code?: Currency;
14
- buy?: number;
15
- sell?: number;
13
+ currency?: {
14
+ id?: number;
15
+ code?: string;
16
+ currency?: Currency;
17
+ };
18
+ buyExchangeRate?: number;
19
+ saleExchangeRate?: number;
16
20
  }
17
21
  export interface ExchangeCurrencyCalculatorProps extends UniBlockProps {
18
22
  className?: string;
@@ -35,8 +39,8 @@ export const ExchangeCurrencyCalculator = JSX<ExchangeCurrencyCalculatorProps>(
35
39
  const [calcState, setCalcState] = useState<CalcState>({
36
40
  inputSell: '',
37
41
  inputBuy: '',
38
- selectSell: currencyRatesBuy?.[0]?.code || Currency.RUB,
39
- selectBuy: currencyRatesSell?.[0]?.code || Currency.USD,
42
+ selectSell: currencyRatesBuy?.[0]?.currency?.currency || Currency.RUB,
43
+ selectBuy: currencyRatesSell?.[0]?.currency?.currency || Currency.USD,
40
44
  });
41
45
 
42
46
  const handleSetCalcState = (newState: Partial<CalcState>) => {
@@ -96,8 +100,12 @@ const handleSelectSell =
96
100
  callbackCurrencySelect({
97
101
  value,
98
102
  oppositeValue: calcState.selectBuy,
99
- handleConvert: (codeFrom = calcState.selectSell, codeTo = calcState.selectBuy) => {
100
- handleInputSell(setCalcState, currencyRatesSell)(calcState.inputSell, codeFrom, codeTo);
103
+ handleConvert: (currencyFrom = calcState.selectSell, currencyTo = calcState.selectBuy) => {
104
+ handleInputSell(setCalcState, currencyRatesSell)(
105
+ calcState.inputSell,
106
+ currencyFrom,
107
+ currencyTo,
108
+ );
101
109
  },
102
110
  });
103
111
  };
@@ -113,35 +121,39 @@ const handleSelectBuy =
113
121
  callbackCurrencySelect({
114
122
  value,
115
123
  oppositeValue: calcState.selectSell,
116
- handleConvert: (codeTo = calcState.selectBuy, codeFrom = calcState.selectSell) =>
117
- handleInputBuy(setCalcState, currencyRatesBuy)(calcState.inputBuy, codeTo, codeFrom),
124
+ handleConvert: (currencyTo = calcState.selectBuy, currencyFrom = calcState.selectSell) =>
125
+ handleInputBuy(setCalcState, currencyRatesBuy)(
126
+ calcState.inputBuy,
127
+ currencyTo,
128
+ currencyFrom,
129
+ ),
118
130
  });
119
131
  };
120
132
 
121
133
  const handleInputSell =
122
134
  (setCalcState: (state: Partial<CalcState>) => void, currencyRatesSell: ExchangeCurrencyItem[]) =>
123
- (value: string, codeFrom: Currency, codeTo: Currency) => {
124
- setCalcState({ inputSell: formatValue(value), selectBuy: codeTo });
135
+ (value: string, currencyFrom: Currency, currencyTo: Currency) => {
136
+ setCalcState({ inputSell: formatValue(value), selectBuy: currencyTo });
125
137
  const rate =
126
- currencyRatesSell.find((_) => _.code === codeTo)?.buy ||
127
- currencyRatesSell.find((_) => _.code === codeFrom)?.sell;
138
+ currencyRatesSell.find((_) => _.currency?.currency === currencyTo)?.buyExchangeRate ||
139
+ currencyRatesSell.find((_) => _.currency?.currency === currencyFrom)?.saleExchangeRate;
128
140
  if (rate) {
129
141
  setCalcState({
130
- inputBuy: String(calculateResult(value, rate, codeFrom === Currency.RUB) || ''),
142
+ inputBuy: String(calculateResult(value, rate, currencyFrom === Currency.RUB) || ''),
131
143
  });
132
144
  }
133
145
  };
134
146
 
135
147
  const handleInputBuy =
136
148
  (setCalcState: (state: Partial<CalcState>) => void, currencyRatesBuy: ExchangeCurrencyItem[]) =>
137
- (value: string, codeTo: Currency, codeFrom: Currency) => {
138
- setCalcState({ inputBuy: formatValue(value), selectSell: codeFrom });
149
+ (value: string, currencyTo: Currency, currencyFrom: Currency) => {
150
+ setCalcState({ inputBuy: formatValue(value), selectSell: currencyFrom });
139
151
  const rate =
140
- currencyRatesBuy.find((_) => _.code === codeFrom)?.sell ||
141
- currencyRatesBuy.find((_) => _.code === codeTo)?.buy;
152
+ currencyRatesBuy.find((_) => _.currency?.currency === currencyFrom)?.saleExchangeRate ||
153
+ currencyRatesBuy.find((_) => _.currency?.currency === currencyTo)?.buyExchangeRate;
142
154
  if (rate) {
143
155
  setCalcState({
144
- inputSell: String(calculateResult(value, rate, codeTo === Currency.RUB) || ''),
156
+ inputSell: String(calculateResult(value, rate, currencyTo === Currency.RUB) || ''),
145
157
  });
146
158
  }
147
159
  };
@@ -1,5 +1,4 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useExchangeRates } from '../../hooks/useExchangeRates';
3
2
  import type { UniBlockProps } from '../../model/JSXBlock';
4
3
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
5
4
  import { Heading } from '../../ui-kit/Heading/Heading';
@@ -7,25 +6,23 @@ import { BaseTile } from '../BaseTile/BaseTile';
7
6
  import { Currency } from './CurrencyProps';
8
7
  import { CurrencyTable } from './CurrencyTable';
9
8
  import { CurrentLocation } from './CurrentLocation';
10
- import { ExchangeCurrencyCalculator } from './ExchangeCurrencyCalculator';
9
+ import { ExchangeCurrencyCalculator, ExchangeCurrencyItem } from './ExchangeCurrencyCalculator';
11
10
  import type { ExchangeRateTileContent } from './ExchangeRateTileContent';
12
-
13
- const DEFAULT_LOCATION = {
14
- address: 'Москва, ул.Ленина д.28',
15
- distance: '6км',
16
- };
11
+ import { useFetchExchangeRateData } from './useFetchExchangeRateData';
17
12
 
18
13
  export interface ExchangeRateTileProps extends ExchangeRateTileContent, UniBlockProps {}
19
14
 
20
15
  export const ExchangeRateTile = JSX<ExchangeRateTileProps>(
21
16
  ({ className = '', context, title = 'Курсы обмена валют', button, ...rest }) => {
22
- const currencyRates = useExchangeRates();
17
+ const { exchangeRates } = useFetchExchangeRateData();
18
+
19
+ const currencyRates = getCurrencyRates(exchangeRates?.exchangeRate?.currencies);
23
20
 
24
- const currencyRatesBuy = currencyRates.filter((_) => _.buy);
25
- currencyRatesBuy.unshift({ code: Currency.RUB });
21
+ const currencyRatesBuy = currencyRates.filter((_) => _.buyExchangeRate);
22
+ currencyRatesBuy.unshift({ currency: { currency: Currency.RUB } });
26
23
 
27
- const currencyRatesSell = currencyRates.filter((_) => _.sell);
28
- currencyRatesSell.push({ code: Currency.RUB });
24
+ const currencyRatesSell = currencyRates.filter((_) => _.saleExchangeRate);
25
+ currencyRatesSell.push({ currency: { currency: Currency.RUB } });
29
26
 
30
27
  return (
31
28
  <BlockWrapper
@@ -44,7 +41,7 @@ export const ExchangeRateTile = JSX<ExchangeRateTileProps>(
44
41
  {currencyRates ? (
45
42
  <CurrencyTable className="mb-[30px]" exchangeCurrencyItems={currencyRates} />
46
43
  ) : null}
47
- <CurrentLocation {...DEFAULT_LOCATION} />
44
+ <CurrentLocation address={exchangeRates?.address} />
48
45
  </div>
49
46
  {currencyRates.length && currencyRatesBuy.length && currencyRatesSell.length ? (
50
47
  <ExchangeCurrencyCalculator
@@ -61,3 +58,7 @@ export const ExchangeRateTile = JSX<ExchangeRateTileProps>(
61
58
  );
62
59
  },
63
60
  );
61
+
62
+ const getCurrencyRates = (currencies?: ExchangeCurrencyItem[]) => {
63
+ return currencies?.filter((_) => _?.currency?.id === 1 || _?.currency?.id === 2) || [];
64
+ };
@@ -4,7 +4,7 @@ import { Currency } from './CurrencyProps';
4
4
  interface TableFuncProps {
5
5
  value: Currency;
6
6
  oppositeValue: Currency;
7
- handleConvert: (codeFrom?: Currency, codeTo?: Currency) => void;
7
+ handleConvert: (currencyFrom?: Currency, currencyTo?: Currency) => void;
8
8
  }
9
9
 
10
10
  export const callbackCurrencySelect = (props: TableFuncProps) =>
@@ -1,6 +1,6 @@
1
1
  import { Input } from '../../ui-kit/Input/Input';
2
- import { Select } from '../../ui-kit/Select/Select';
3
2
  import type { OptionProps } from '../../ui-kit/Select/Select';
3
+ import { Select } from '../../ui-kit/Select/Select';
4
4
  import type { Currency } from './CurrencyProps';
5
5
  import type { ExchangeCurrencyItem } from './ExchangeCurrencyCalculator';
6
6
 
@@ -15,7 +15,10 @@ interface InputProps {
15
15
 
16
16
  export function renderInput(props: InputProps) {
17
17
  const { placeholder, rates, selected, value, setValue, setSelected } = props;
18
- const ratesOptions: OptionProps[] = rates.map((_) => ({ key: _.code ?? '', text: _.code ?? '' }));
18
+ const ratesOptions: OptionProps[] = rates.map((_) => ({
19
+ key: _?.currency?.currency ?? '',
20
+ text: _?.currency?.currency ?? '',
21
+ }));
19
22
  const selectedValue: OptionProps = { key: selected, text: selected };
20
23
 
21
24
  return (
@@ -0,0 +1,71 @@
1
+ import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
2
+ import { ExchangeCurrencyItem } from '../../components/ExchangeRateTile/ExchangeCurrencyCalculator';
3
+ import { fetchJSONUnsafe } from '../../utils/fetchJSON';
4
+
5
+ export interface ExchangeData {
6
+ exchangeRate?: {
7
+ currencies?: ExchangeCurrencyItem[];
8
+ };
9
+ address?: string;
10
+ }
11
+
12
+ export interface RegionData {
13
+ id?: number;
14
+ code?: string;
15
+ name?: string;
16
+ }
17
+
18
+ const EXCHANGE_RATES_URL = '/api/v1/exchangerates';
19
+ const REGION_URL = '/api/v1/region';
20
+
21
+ export function useFetchExchangeRateData() {
22
+ const { data } = useAsyncData<{
23
+ region?: RegionData;
24
+ exchangeRates?: ExchangeData;
25
+ }>(EXCHANGE_RATES_URL, fetchData);
26
+
27
+ return data || {};
28
+ }
29
+
30
+ export function useCurrentPosition() {
31
+ const { data } = useAsyncData<RegionData>(REGION_URL, fetchJSONUnsafe);
32
+
33
+ return data || {};
34
+ }
35
+
36
+ const fetchData = async (
37
+ urlExchangeRates: string,
38
+ ): Promise<{
39
+ region: RegionData;
40
+ exchangeRates: ExchangeData;
41
+ }> => {
42
+ const region = await fetchRegion();
43
+
44
+ const regionCode = region?.code || '000';
45
+
46
+ const exchangeRates = await fetchExchangeRates(urlExchangeRates, regionCode);
47
+
48
+ return { region, exchangeRates };
49
+ };
50
+
51
+ const fetchRegion = async (): Promise<RegionData> => {
52
+ try {
53
+ return await fetchJSONUnsafe<RegionData>(REGION_URL, { method: 'GET' });
54
+ } catch (error) {
55
+ console.log(error);
56
+
57
+ return {};
58
+ }
59
+ };
60
+
61
+ const fetchExchangeRates = async (url: string, regionCode: string): Promise<ExchangeData> => {
62
+ try {
63
+ return await fetchJSONUnsafe<ExchangeData>(url + `?regionCode=${regionCode}`, {
64
+ method: 'GET',
65
+ });
66
+ } catch (error) {
67
+ console.log(error);
68
+
69
+ return {};
70
+ }
71
+ };
@@ -1,7 +1,6 @@
1
1
  import type { Picture } from '../../model/Picture';
2
2
  import { context } from '../../react/setup-fixture';
3
3
  import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
4
- import { Img } from '../../ui-kit/Img/Img';
5
4
  import { Gallery } from './Gallery';
6
5
  import type { GalleryProps } from './GalleryProps';
7
6
  const isDotted = true;
@@ -28,7 +27,7 @@ const buttonPrimaryIcon: ButtonWithIconProps = {
28
27
  text: 'Подробнее',
29
28
  target: '_blank',
30
29
  version: 'secondary',
31
- appendLeft: <Img image={{ icon: 'BankIcon' }} width="24" height="24" asSVG />,
30
+ icon: { icon: 'BankIcon' },
32
31
  };
33
32
 
34
33
  const defaultItems = [
@@ -2,7 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
2
2
  import { AlignText } from '../../model/AlignText';
3
3
  import type { BlockVersion } from '../../model/BlockVersion';
4
4
  import type { Picture } from '../../model/Picture';
5
- import { Button } from '../../ui-kit/Button/Button';
5
+ import { renderButton } from '../../ui-kit/Button/ButtonSection';
6
6
  import { Img } from '../../ui-kit/Img/Img';
7
7
  import { List } from '../../ui-kit/List/List';
8
8
  import { HEADLINE_SMALL_VERSION } from '../Headline/constants';
@@ -30,7 +30,7 @@ export const GalleryCardInner = JSX<GalleryCardProps>(
30
30
  {items?.length ? renderItems(items, isDotted, version) : null}
31
31
  {renderAdditionalDescription(additionalDescription)}
32
32
  </div>
33
- {button?.text ? <Button className="mt-6" {...button} /> : null}
33
+ {button?.text ? renderButton({ button, buttonClassName: 'mt-6' }) : null}
34
34
  </div>
35
35
  );
36
36
  },
@@ -3,11 +3,11 @@ import { useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import type { GalleryVersion } from '../../model/GalleryVersion';
4
4
  import type { UniBlockProps } from '../../model/JSXBlock';
5
5
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
6
+ import { renderButton } from '../../ui-kit/Button/ButtonSection';
6
7
  import { renderArrows } from '../../ui-kit/Button/renderArrows';
7
8
  import { galleryLengthForScrollMap } from './constants';
8
9
  import { GalleryContainer } from './GalleryContainer';
9
10
  import type { GalleryContent } from './GalleryContent';
10
- import { Button } from '../../ui-kit/Button/Button';
11
11
 
12
12
  export interface GalleryInnerProps extends GalleryContent, UniBlockProps {
13
13
  version?: GalleryVersion;
@@ -54,7 +54,7 @@ export const GalleryInner = JSX<GalleryInnerProps>(
54
54
  </div>
55
55
  ) : null}
56
56
 
57
- {button ? <Button className="mt-8 mx-auto" {...button} /> : null}
57
+ {button ? renderButton({ button, buttonClassName: 'mt-8 mx-auto' }) : null}
58
58
  </BlockWrapper>
59
59
  );
60
60
  },
@@ -67,15 +67,15 @@ const renderDotsSubMenuItems = ({
67
67
  }: DotsSubMenuItemsProps) => {
68
68
  const isActive = (item: LinkProps) => item === activeSubItem;
69
69
 
70
- return menuItems?.map((_) => (
70
+ return menuItems?.map(({ text, ...rest }) => (
71
71
  <a
72
- key={_.href}
73
- {...useLink({ router, handlerDecorator }, _)}
72
+ key={rest.href}
73
+ {...useLink({ router, handlerDecorator }, rest)}
74
74
  className={`text-l-light pb-4 hover:text-primary-main ${
75
- isActive(_) ? 'text-primary-main' : ''
75
+ isActive(rest) ? 'text-primary-main' : ''
76
76
  }`}
77
77
  >
78
- {_.text}
78
+ {text}
79
79
  </a>
80
80
  ));
81
81
  };