@redneckz/wildless-cms-uni-blocks 0.6.24 → 0.6.25

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 (283) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +97 -58
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/BenefitsBlock/BenefitsBlock.d.ts +2 -1
  5. package/bundle/components/Catalog/CatalogContent.d.ts +2 -0
  6. package/bundle/components/ContentPage/normalizePage.d.ts +1 -1
  7. package/bundle/components/Header/HeaderContent.d.ts +1 -2
  8. package/bundle/components/InvestmentGallery/InvestmentGallery.d.ts +5 -0
  9. package/bundle/components/InvestmentGallery/InvestmentGalleryCard.d.ts +7 -0
  10. package/bundle/components/InvestmentGallery/InvestmentGalleryContent.d.ts +50 -0
  11. package/bundle/content-page-repository/ContentPageRepository.d.ts +12 -9
  12. package/bundle/model/BorderVersion.d.ts +6 -0
  13. package/bundle/services/sitemap/useSitemap.d.ts +2 -2
  14. package/bundle/ui-kit/CurrencyInput/{adjustValue .d.ts → adjustValue.d.ts} +0 -0
  15. package/dist/components/BenefitsBlock/BenefitsBlock.d.ts +2 -1
  16. package/dist/components/BenefitsBlock/BenefitsBlock.js +5 -9
  17. package/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  18. package/dist/components/Blocks.js +2 -0
  19. package/dist/components/Blocks.js.map +1 -1
  20. package/dist/components/Catalog/CatalogContent.d.ts +2 -0
  21. package/dist/components/ContentPage/normalizeBlock.js +4 -8
  22. package/dist/components/ContentPage/normalizeBlock.js.map +1 -1
  23. package/dist/components/ContentPage/normalizeBlock.mobile.js +4 -8
  24. package/dist/components/ContentPage/normalizeBlock.mobile.js.map +1 -1
  25. package/dist/components/ContentPage/normalizePage.d.ts +1 -1
  26. package/dist/components/ContentPage/normalizePage.js +1 -6
  27. package/dist/components/ContentPage/normalizePage.js.map +1 -1
  28. package/dist/components/Header/Header.js +9 -9
  29. package/dist/components/Header/Header.js.map +1 -1
  30. package/dist/components/Header/Header.mobile.js +6 -6
  31. package/dist/components/Header/Header.mobile.js.map +1 -1
  32. package/dist/components/Header/HeaderContent.d.ts +1 -2
  33. package/dist/components/InvestmentGallery/InvestmentGallery.d.ts +5 -0
  34. package/dist/components/InvestmentGallery/InvestmentGallery.js +40 -0
  35. package/dist/components/InvestmentGallery/InvestmentGallery.js.map +1 -0
  36. package/dist/components/InvestmentGallery/InvestmentGalleryCard.d.ts +7 -0
  37. package/dist/components/InvestmentGallery/InvestmentGalleryCard.js +24 -0
  38. package/dist/components/InvestmentGallery/InvestmentGalleryCard.js.map +1 -0
  39. package/dist/components/InvestmentGallery/InvestmentGalleryContent.d.ts +50 -0
  40. package/dist/components/InvestmentGallery/InvestmentGalleryContent.js +2 -0
  41. package/dist/components/InvestmentGallery/InvestmentGalleryContent.js.map +1 -0
  42. package/dist/components/PictureText/PictureText.js +2 -2
  43. package/dist/components/PictureText/PictureText.js.map +1 -1
  44. package/dist/components/ProductGallery/ProductGallery.js +2 -2
  45. package/dist/components/ProductGallery/ProductGallery.js.map +1 -1
  46. package/dist/components/Recommendation/Recommendation.js +7 -5
  47. package/dist/components/Recommendation/Recommendation.js.map +1 -1
  48. package/dist/components/StepsBlock/StepsBlock.mobile.js +1 -5
  49. package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  50. package/dist/content-page-repository/ContentPageRepository.d.ts +12 -9
  51. package/dist/content-page-repository/ContentPageRepository.js +24 -35
  52. package/dist/content-page-repository/ContentPageRepository.js.map +1 -1
  53. package/dist/model/BorderVersion.d.ts +6 -0
  54. package/dist/model/BorderVersion.js +7 -0
  55. package/dist/model/BorderVersion.js.map +1 -0
  56. package/dist/services/sitemap/useSitemap.d.ts +2 -2
  57. package/dist/services/sitemap/useSitemap.js.map +1 -1
  58. package/dist/ui-kit/BenefitItem/BenefitItem.js +3 -3
  59. package/dist/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
  60. package/dist/ui-kit/Breadcrumb.js +1 -8
  61. package/dist/ui-kit/Breadcrumb.js.map +1 -1
  62. package/dist/ui-kit/CurrencyInput/CurrencyInput.js +1 -1
  63. package/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  64. package/dist/ui-kit/CurrencyInput/{adjustValue .d.ts → adjustValue.d.ts} +0 -0
  65. package/{mobile/dist/ui-kit/CurrencyInput/adjustValue .js → dist/ui-kit/CurrencyInput/adjustValue.js} +1 -1
  66. package/dist/ui-kit/CurrencyInput/adjustValue.js.map +1 -0
  67. package/dist/ui-kit/Tags/Tags.js +2 -2
  68. package/dist/ui-kit/Tags/Tags.js.map +1 -1
  69. package/lib/common.css +1 -1
  70. package/lib/components/BenefitsBlock/BenefitsBlock.d.ts +2 -1
  71. package/lib/components/BenefitsBlock/BenefitsBlock.js +5 -9
  72. package/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  73. package/lib/components/Blocks.js +2 -0
  74. package/lib/components/Blocks.js.map +1 -1
  75. package/lib/components/Catalog/CatalogContent.d.ts +2 -0
  76. package/lib/components/ContentPage/normalizeBlock.js +4 -8
  77. package/lib/components/ContentPage/normalizeBlock.js.map +1 -1
  78. package/lib/components/ContentPage/normalizeBlock.mobile.js +4 -8
  79. package/lib/components/ContentPage/normalizeBlock.mobile.js.map +1 -1
  80. package/lib/components/ContentPage/normalizePage.d.ts +1 -1
  81. package/lib/components/ContentPage/normalizePage.js +1 -6
  82. package/lib/components/ContentPage/normalizePage.js.map +1 -1
  83. package/lib/components/Header/Header.js +9 -9
  84. package/lib/components/Header/Header.js.map +1 -1
  85. package/lib/components/Header/Header.mobile.js +6 -6
  86. package/lib/components/Header/Header.mobile.js.map +1 -1
  87. package/lib/components/Header/HeaderContent.d.ts +1 -2
  88. package/lib/components/InvestmentGallery/InvestmentGallery.d.ts +5 -0
  89. package/lib/components/InvestmentGallery/InvestmentGallery.fixture.d.ts +7 -0
  90. package/lib/components/InvestmentGallery/InvestmentGallery.js +38 -0
  91. package/lib/components/InvestmentGallery/InvestmentGallery.js.map +1 -0
  92. package/lib/components/InvestmentGallery/InvestmentGalleryCard.d.ts +7 -0
  93. package/lib/components/InvestmentGallery/InvestmentGalleryCard.js +22 -0
  94. package/lib/components/InvestmentGallery/InvestmentGalleryCard.js.map +1 -0
  95. package/lib/components/InvestmentGallery/InvestmentGalleryContent.d.ts +50 -0
  96. package/lib/components/InvestmentGallery/InvestmentGalleryContent.js +2 -0
  97. package/lib/components/InvestmentGallery/InvestmentGalleryContent.js.map +1 -0
  98. package/lib/components/PictureText/PictureText.js +2 -2
  99. package/lib/components/PictureText/PictureText.js.map +1 -1
  100. package/lib/components/ProductGallery/ProductGallery.js +2 -2
  101. package/lib/components/ProductGallery/ProductGallery.js.map +1 -1
  102. package/lib/components/Recommendation/Recommendation.js +7 -5
  103. package/lib/components/Recommendation/Recommendation.js.map +1 -1
  104. package/lib/components/StepsBlock/StepsBlock.mobile.js +1 -5
  105. package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  106. package/lib/content-page-repository/ContentPageRepository.d.ts +12 -9
  107. package/lib/content-page-repository/ContentPageRepository.js +24 -35
  108. package/lib/content-page-repository/ContentPageRepository.js.map +1 -1
  109. package/lib/model/BorderVersion.d.ts +6 -0
  110. package/lib/model/BorderVersion.js +5 -0
  111. package/lib/model/BorderVersion.js.map +1 -0
  112. package/lib/services/sitemap/useSitemap.d.ts +2 -2
  113. package/lib/services/sitemap/useSitemap.js.map +1 -1
  114. package/lib/ui-kit/BenefitItem/BenefitItem.js +3 -3
  115. package/lib/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
  116. package/lib/ui-kit/Breadcrumb.js +1 -8
  117. package/lib/ui-kit/Breadcrumb.js.map +1 -1
  118. package/lib/ui-kit/CurrencyInput/CurrencyInput.js +1 -1
  119. package/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  120. package/lib/ui-kit/CurrencyInput/{adjustValue .d.ts → adjustValue.d.ts} +0 -0
  121. package/lib/ui-kit/CurrencyInput/{adjustValue .js → adjustValue.js} +1 -1
  122. package/lib/ui-kit/CurrencyInput/adjustValue.js.map +1 -0
  123. package/lib/ui-kit/Tags/Tags.js +2 -2
  124. package/lib/ui-kit/Tags/Tags.js.map +1 -1
  125. package/mobile/bundle/bundle.umd.js +9 -13
  126. package/mobile/bundle/bundle.umd.min.js +1 -1
  127. package/mobile/bundle/components/BenefitsBlock/BenefitsBlock.d.ts +2 -1
  128. package/mobile/bundle/components/Catalog/CatalogContent.d.ts +2 -0
  129. package/mobile/bundle/components/ContentPage/normalizePage.d.ts +1 -1
  130. package/mobile/bundle/components/Header/HeaderContent.d.ts +1 -2
  131. package/mobile/bundle/components/InvestmentGallery/InvestmentGallery.d.ts +5 -0
  132. package/mobile/bundle/components/InvestmentGallery/InvestmentGalleryCard.d.ts +7 -0
  133. package/mobile/bundle/components/InvestmentGallery/InvestmentGalleryContent.d.ts +50 -0
  134. package/mobile/bundle/content-page-repository/ContentPageRepository.d.ts +12 -9
  135. package/mobile/bundle/model/BorderVersion.d.ts +6 -0
  136. package/mobile/bundle/services/sitemap/useSitemap.d.ts +2 -2
  137. package/mobile/bundle/ui-kit/CurrencyInput/{adjustValue .d.ts → adjustValue.d.ts} +0 -0
  138. package/mobile/dist/components/BenefitsBlock/BenefitsBlock.d.ts +2 -1
  139. package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js +5 -9
  140. package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  141. package/mobile/dist/components/Catalog/CatalogContent.d.ts +2 -0
  142. package/mobile/dist/components/ContentPage/normalizeBlock.js +4 -8
  143. package/mobile/dist/components/ContentPage/normalizeBlock.js.map +1 -1
  144. package/mobile/dist/components/ContentPage/normalizePage.d.ts +1 -1
  145. package/mobile/dist/components/ContentPage/normalizePage.js +1 -6
  146. package/mobile/dist/components/ContentPage/normalizePage.js.map +1 -1
  147. package/mobile/dist/components/Header/Header.js +6 -6
  148. package/mobile/dist/components/Header/Header.js.map +1 -1
  149. package/mobile/dist/components/Header/HeaderContent.d.ts +1 -2
  150. package/mobile/dist/components/InvestmentGallery/InvestmentGallery.d.ts +5 -0
  151. package/mobile/dist/components/InvestmentGallery/InvestmentGallery.js +40 -0
  152. package/mobile/dist/components/InvestmentGallery/InvestmentGallery.js.map +1 -0
  153. package/mobile/dist/components/InvestmentGallery/InvestmentGalleryCard.d.ts +7 -0
  154. package/mobile/dist/components/InvestmentGallery/InvestmentGalleryCard.js +24 -0
  155. package/mobile/dist/components/InvestmentGallery/InvestmentGalleryCard.js.map +1 -0
  156. package/mobile/dist/components/InvestmentGallery/InvestmentGalleryContent.d.ts +50 -0
  157. package/mobile/dist/components/InvestmentGallery/InvestmentGalleryContent.js +2 -0
  158. package/mobile/dist/components/InvestmentGallery/InvestmentGalleryContent.js.map +1 -0
  159. package/mobile/dist/components/PictureText/PictureText.js +2 -2
  160. package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
  161. package/mobile/dist/components/Recommendation/Recommendation.js +7 -5
  162. package/mobile/dist/components/Recommendation/Recommendation.js.map +1 -1
  163. package/mobile/dist/components/StepsBlock/StepsBlock.js +1 -5
  164. package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  165. package/mobile/dist/content-page-repository/ContentPageRepository.d.ts +12 -9
  166. package/mobile/dist/content-page-repository/ContentPageRepository.js +24 -35
  167. package/mobile/dist/content-page-repository/ContentPageRepository.js.map +1 -1
  168. package/mobile/dist/model/BorderVersion.d.ts +6 -0
  169. package/mobile/dist/model/BorderVersion.js +7 -0
  170. package/mobile/dist/model/BorderVersion.js.map +1 -0
  171. package/mobile/dist/services/sitemap/useSitemap.d.ts +2 -2
  172. package/mobile/dist/services/sitemap/useSitemap.js.map +1 -1
  173. package/mobile/dist/ui-kit/BenefitItem/BenefitItem.js +3 -3
  174. package/mobile/dist/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
  175. package/mobile/dist/ui-kit/Breadcrumb.js +1 -8
  176. package/mobile/dist/ui-kit/Breadcrumb.js.map +1 -1
  177. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js +1 -1
  178. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  179. package/mobile/dist/ui-kit/CurrencyInput/{adjustValue .d.ts → adjustValue.d.ts} +0 -0
  180. package/{dist/ui-kit/CurrencyInput/adjustValue .js → mobile/dist/ui-kit/CurrencyInput/adjustValue.js} +1 -1
  181. package/mobile/dist/ui-kit/CurrencyInput/adjustValue.js.map +1 -0
  182. package/mobile/dist/ui-kit/Tags/Tags.js +2 -2
  183. package/mobile/dist/ui-kit/Tags/Tags.js.map +1 -1
  184. package/mobile/lib/components/BenefitsBlock/BenefitsBlock.d.ts +2 -1
  185. package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js +5 -9
  186. package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  187. package/mobile/lib/components/Catalog/CatalogContent.d.ts +2 -0
  188. package/mobile/lib/components/ContentPage/normalizeBlock.js +4 -8
  189. package/mobile/lib/components/ContentPage/normalizeBlock.js.map +1 -1
  190. package/mobile/lib/components/ContentPage/normalizePage.d.ts +1 -1
  191. package/mobile/lib/components/ContentPage/normalizePage.js +1 -6
  192. package/mobile/lib/components/ContentPage/normalizePage.js.map +1 -1
  193. package/mobile/lib/components/Header/Header.js +6 -6
  194. package/mobile/lib/components/Header/Header.js.map +1 -1
  195. package/mobile/lib/components/Header/HeaderContent.d.ts +1 -2
  196. package/mobile/lib/components/InvestmentGallery/InvestmentGallery.d.ts +5 -0
  197. package/mobile/lib/components/InvestmentGallery/InvestmentGallery.js +38 -0
  198. package/mobile/lib/components/InvestmentGallery/InvestmentGallery.js.map +1 -0
  199. package/mobile/lib/components/InvestmentGallery/InvestmentGalleryCard.d.ts +7 -0
  200. package/mobile/lib/components/InvestmentGallery/InvestmentGalleryCard.js +22 -0
  201. package/mobile/lib/components/InvestmentGallery/InvestmentGalleryCard.js.map +1 -0
  202. package/mobile/lib/components/InvestmentGallery/InvestmentGalleryContent.d.ts +50 -0
  203. package/mobile/lib/components/InvestmentGallery/InvestmentGalleryContent.js +2 -0
  204. package/mobile/lib/components/InvestmentGallery/InvestmentGalleryContent.js.map +1 -0
  205. package/mobile/lib/components/PictureText/PictureText.js +2 -2
  206. package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
  207. package/mobile/lib/components/Recommendation/Recommendation.js +7 -5
  208. package/mobile/lib/components/Recommendation/Recommendation.js.map +1 -1
  209. package/mobile/lib/components/StepsBlock/StepsBlock.js +1 -5
  210. package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  211. package/mobile/lib/content-page-repository/ContentPageRepository.d.ts +12 -9
  212. package/mobile/lib/content-page-repository/ContentPageRepository.js +24 -35
  213. package/mobile/lib/content-page-repository/ContentPageRepository.js.map +1 -1
  214. package/mobile/lib/model/BorderVersion.d.ts +6 -0
  215. package/mobile/lib/model/BorderVersion.js +5 -0
  216. package/mobile/lib/model/BorderVersion.js.map +1 -0
  217. package/mobile/lib/services/sitemap/useSitemap.d.ts +2 -2
  218. package/mobile/lib/services/sitemap/useSitemap.js.map +1 -1
  219. package/mobile/lib/ui-kit/BenefitItem/BenefitItem.js +3 -3
  220. package/mobile/lib/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
  221. package/mobile/lib/ui-kit/Breadcrumb.js +1 -8
  222. package/mobile/lib/ui-kit/Breadcrumb.js.map +1 -1
  223. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js +1 -1
  224. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  225. package/mobile/lib/ui-kit/CurrencyInput/{adjustValue .d.ts → adjustValue.d.ts} +0 -0
  226. package/mobile/lib/ui-kit/CurrencyInput/{adjustValue .js → adjustValue.js} +1 -1
  227. package/mobile/lib/ui-kit/CurrencyInput/adjustValue.js.map +1 -0
  228. package/mobile/lib/ui-kit/Tags/Tags.js +2 -2
  229. package/mobile/lib/ui-kit/Tags/Tags.js.map +1 -1
  230. package/mobile/src/components/BenefitsBlock/BenefitsBlock.tsx +14 -21
  231. package/mobile/src/components/Catalog/CatalogContent.ts +2 -0
  232. package/mobile/src/components/ContentPage/normalizeBlock.ts +15 -18
  233. package/mobile/src/components/ContentPage/normalizePage.ts +2 -7
  234. package/mobile/src/components/Header/Header.tsx +11 -11
  235. package/mobile/src/components/Header/HeaderContent.ts +1 -2
  236. package/mobile/src/components/InvestmentGallery/InvestmentGallery.example.json +64 -0
  237. package/mobile/src/components/InvestmentGallery/InvestmentGallery.tsx +103 -0
  238. package/mobile/src/components/InvestmentGallery/InvestmentGallery.ui.json +11 -0
  239. package/mobile/src/components/InvestmentGallery/InvestmentGalleryCard.tsx +91 -0
  240. package/mobile/src/components/InvestmentGallery/InvestmentGalleryContent.ts +54 -0
  241. package/mobile/src/components/PictureText/PictureText.tsx +3 -3
  242. package/mobile/src/components/Recommendation/Recommendation.tsx +9 -7
  243. package/mobile/src/components/StepsBlock/StepsBlock.tsx +1 -7
  244. package/mobile/src/content-page-repository/ContentPageRepository.ts +27 -45
  245. package/mobile/src/model/BorderVersion.ts +10 -0
  246. package/mobile/src/services/sitemap/useSitemap.ts +4 -4
  247. package/mobile/src/ui-kit/BenefitItem/BenefitItem.tsx +6 -5
  248. package/mobile/src/ui-kit/Breadcrumb.tsx +8 -11
  249. package/mobile/src/ui-kit/CurrencyInput/CurrencyInput.tsx +1 -1
  250. package/mobile/src/ui-kit/CurrencyInput/{adjustValue .ts → adjustValue.ts} +0 -0
  251. package/mobile/src/ui-kit/Tags/Tags.tsx +3 -5
  252. package/package.json +1 -1
  253. package/src/components/BenefitsBlock/BenefitsBlock.tsx +14 -21
  254. package/src/components/Blocks.ts +2 -0
  255. package/src/components/Catalog/CatalogContent.ts +2 -0
  256. package/src/components/ContentPage/normalizeBlock.mobile.ts +15 -18
  257. package/src/components/ContentPage/normalizeBlock.ts +10 -12
  258. package/src/components/ContentPage/normalizePage.ts +2 -7
  259. package/src/components/Header/Header.mobile.tsx +11 -11
  260. package/src/components/Header/Header.tsx +17 -12
  261. package/src/components/Header/HeaderContent.ts +1 -2
  262. package/src/components/InvestmentGallery/InvestmentGallery.example.json +64 -0
  263. package/src/components/InvestmentGallery/InvestmentGallery.fixture.tsx +79 -0
  264. package/src/components/InvestmentGallery/InvestmentGallery.tsx +103 -0
  265. package/src/components/InvestmentGallery/InvestmentGallery.ui.json +11 -0
  266. package/src/components/InvestmentGallery/InvestmentGalleryCard.tsx +91 -0
  267. package/src/components/InvestmentGallery/InvestmentGalleryContent.ts +54 -0
  268. package/src/components/PictureText/PictureText.tsx +3 -3
  269. package/src/components/ProductGallery/ProductGallery.tsx +3 -4
  270. package/src/components/Recommendation/Recommendation.tsx +9 -7
  271. package/src/components/StepsBlock/StepsBlock.mobile.tsx +1 -7
  272. package/src/content-page-repository/ContentPageRepository.ts +27 -45
  273. package/src/model/BorderVersion.ts +10 -0
  274. package/src/services/sitemap/useSitemap.ts +4 -4
  275. package/src/ui-kit/BenefitItem/BenefitItem.tsx +6 -5
  276. package/src/ui-kit/Breadcrumb.tsx +8 -11
  277. package/src/ui-kit/CurrencyInput/CurrencyInput.tsx +1 -1
  278. package/src/ui-kit/CurrencyInput/{adjustValue .ts → adjustValue.ts} +0 -0
  279. package/src/ui-kit/Tags/Tags.tsx +3 -5
  280. package/dist/ui-kit/CurrencyInput/adjustValue .js.map +0 -1
  281. package/lib/ui-kit/CurrencyInput/adjustValue .js.map +0 -1
  282. package/mobile/dist/ui-kit/CurrencyInput/adjustValue .js.map +0 -1
  283. package/mobile/lib/ui-kit/CurrencyInput/adjustValue .js.map +0 -1
@@ -0,0 +1,91 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import type { BlockVersion } from '../../model/BlockVersion';
3
+ import { BorderVersionStyleMap } from '../../model/BorderVersion';
4
+ import type { UniBlockProps } from '../../model/JSXBlock';
5
+ import { Description } from '../../ui-kit/Description/Description';
6
+ import { Heading } from '../../ui-kit/Heading/Heading';
7
+ import { Img } from '../../ui-kit/Img/Img';
8
+ import { BaseTile } from '../BaseTile/BaseTile';
9
+ import type {
10
+ CardColumnsMode,
11
+ CardListItem,
12
+ InvestmentGalleryCardTypes,
13
+ } from './InvestmentGalleryContent';
14
+
15
+ export interface RecommendationCardProps extends InvestmentGalleryCardTypes, UniBlockProps {
16
+ version?: BlockVersion;
17
+ }
18
+ const getItemListFontSize = (colValue?: string) => (colValue === 'single' ? 'text-h6' : 'text-l');
19
+
20
+ const cardColumnsModeStyleMap: Record<CardColumnsMode, string> = {
21
+ double: 'flex gap-y-2 gap-x-10 flex-wrap',
22
+ single: 'flex gap-y-2 flex-col',
23
+ };
24
+
25
+ export const InvestmentGalleryCard = JSX<RecommendationCardProps>(
26
+ ({
27
+ className = '',
28
+ columnsMode = 'double',
29
+ context,
30
+ description,
31
+ additionalDescription,
32
+ image,
33
+ cardList,
34
+ title,
35
+ version = 'primary',
36
+ }) => {
37
+ const tileTitle = title ? (
38
+ <Heading headingType="h4" as="h3" className="mb-3.5 z-10" title={title} />
39
+ ) : null;
40
+ const tileImage = image?.src ? (
41
+ <Img className="absolute bottom-0 right-0 m-0" image={image} />
42
+ ) : null;
43
+
44
+ return (
45
+ <section
46
+ className={`relative overflow-hidden text-left border border-solid box-border
47
+ p-9 min-w-[697px] min-h-[319px]
48
+ ${BorderVersionStyleMap[version]}
49
+ ${className}`}
50
+ role="listitem"
51
+ >
52
+ <BaseTile
53
+ context={context}
54
+ className="flex justify-between"
55
+ title={tileTitle}
56
+ image={tileImage}
57
+ >
58
+ <div className="flex flex-col justify-between">
59
+ <div className="flex itens-center justify-between mb-4">
60
+ {description ? <Description className="text-h6" description={description} /> : null}
61
+ {additionalDescription ? (
62
+ <div className="text-m-light text-secondary-text"> {additionalDescription} </div>
63
+ ) : null}
64
+ </div>
65
+ {cardList?.length ? (
66
+ <div className={`${cardColumnsModeStyleMap[columnsMode]}`} role="list">
67
+ {renderCardList(cardList, columnsMode)}
68
+ </div>
69
+ ) : null}
70
+ </div>
71
+ </BaseTile>
72
+ </section>
73
+ );
74
+ },
75
+ );
76
+
77
+ const renderCardList = (cardList: CardListItem[], columnsMode: string) =>
78
+ cardList.map((item, i) => (
79
+ <div
80
+ key={String(i)}
81
+ className={columnsMode === 'double' ? 'basis-[calc(50%-20px)]' : ''}
82
+ role="listitem"
83
+ >
84
+ {item?.parameter ? (
85
+ <span className={`pr-2.5 ${getItemListFontSize(columnsMode)}`}>{item.parameter}</span>
86
+ ) : null}
87
+ {item?.parameterDesccription ? (
88
+ <span className="text-m-light text-secondary-text">{item.parameterDesccription}</span>
89
+ ) : null}
90
+ </div>
91
+ ));
@@ -0,0 +1,54 @@
1
+ import type { BlockVersion } from '../../model/BlockVersion';
2
+ import type { Picture } from '../../model/Picture';
3
+ import type { HeadlineCommonProps, TitleProps } from '../../model/HeadlineType';
4
+
5
+ /**
6
+ * @title Количество колонок в списке
7
+ * @enumNames [
8
+ * "1 колонка",
9
+ * "2 колонки",
10
+ * ]
11
+ */
12
+ export type CardColumnsMode = 'single' | 'double';
13
+
14
+ /**
15
+ * @title Карточка
16
+ */
17
+ export interface InvestmentGalleryCardTypes extends HeadlineCommonProps {
18
+ /** @title Доп. описание карточки */
19
+ additionalDescription?: string;
20
+ /**
21
+ * @default {
22
+ * "format": "webp",
23
+ * "size": {
24
+ * "width": 290
25
+ * },
26
+ * "sources": [{
27
+ * "media": 1279,
28
+ * "width": 174,
29
+ * "format": "webp",
30
+ * "alignment": "southeast"
31
+ * }]
32
+ * }
33
+ */
34
+ image?: Picture;
35
+ columnsMode?: CardColumnsMode;
36
+ /** @title Описание пункта */
37
+ cardList?: CardListItem[];
38
+ }
39
+
40
+ export interface CardListItem {
41
+ /** @title Параметр */
42
+ parameter?: string;
43
+ /** @title Описание */
44
+ parameterDesccription?: string;
45
+ }
46
+
47
+ /**
48
+ * @title Карточка
49
+ */
50
+ export interface InvestmentGalleryContent extends TitleProps {
51
+ /** @title Карточки */
52
+ cards?: InvestmentGalleryCardTypes[];
53
+ version?: BlockVersion;
54
+ }
@@ -69,8 +69,8 @@ const renderBenefit = (version: BlockVersion) => (benefit: BenefitItemProps, i:
69
69
  function renderInsuranceSumMonth(sum?: number, monthLimit?: number) {
70
70
  return sum || monthLimit ? (
71
71
  <div className="bg-main-divider rounded-md flex mt-7 gap-6 px-5 py-4">
72
- {Number.isFinite(sum) ? renderValueBlock('Страховая сумма:', sum, Boolean(monthLimit)) : null}
73
- {Number.isFinite(monthLimit)
72
+ {Number(sum) > 0 ? renderValueBlock('Страховая сумма:', sum, Boolean(monthLimit)) : null}
73
+ {Number(monthLimit) > 0
74
74
  ? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(sum))
75
75
  : null}
76
76
  </div>
@@ -81,7 +81,7 @@ function renderValueBlock(title: string, sum = 0, isAnotherBlock = false) {
81
81
  const widthStyle = isAnotherBlock ? 'w-fit' : 'w-full';
82
82
 
83
83
  return (
84
- <div className={`flex justify-between items-center gap-2 w-full ${widthStyle}`}>
84
+ <div className={`flex justify-between items-center gap-2 w-full whitespace-pre ${widthStyle}`}>
85
85
  <span className="text-secondary-text text-l-light">{title}</span>
86
86
  <span className="text-primary-main text-h6">{addSpacesBetweenNumbers(sum)} ₽</span>
87
87
  </div>
@@ -1,7 +1,9 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import type { BlockVersion } from '../../model/BlockVersion';
4
+ import { BorderVersionStyleMap } from '../../model/BorderVersion';
4
5
  import type { UniBlockProps } from '../../model/JSXBlock';
6
+ import { VersionStyleMap } from '../../model/BlockVersion';
5
7
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
6
8
  import { renderArrows } from '../../ui-kit/Button/renderArrows';
7
9
  import { Heading } from '../../ui-kit/Heading/Heading';
@@ -16,17 +18,15 @@ const CARD_SHIFT = 525;
16
18
  export interface RecommendationProps extends RecommendationContent, UniBlockProps {}
17
19
 
18
20
  export const Recommendation = JSX<RecommendationProps>(
19
- ({ context, recommendations = [], className = '', title, version, ...rest }) => {
21
+ ({ context, recommendations = [], className = '', title, version = 'primary', ...rest }) => {
20
22
  const [activeCardIndex, setActiveCardIndex] = useState(0);
21
23
 
22
- const blockClassName =
23
- version === 'secondary' ? 'bg-primary-main text-white' : 'bg-white text-primary-text';
24
- const cardClassName = version === 'secondary' ? 'border-white/50' : 'border-main-stroke';
25
-
26
24
  return (
27
25
  <BlockWrapper
28
26
  context={context}
29
- className={`relative font-sans p-9 overflow-hidden text-center ${blockClassName} ${className}`}
27
+ className={`relative font-sans p-9 overflow-hidden text-center
28
+ ${VersionStyleMap[version]}
29
+ ${className}`}
30
30
  {...rest}
31
31
  >
32
32
  {title ? <Heading headingType="h3" className="mb-6" title={title} /> : null}
@@ -37,7 +37,9 @@ export const Recommendation = JSX<RecommendationProps>(
37
37
  role="list"
38
38
  >
39
39
  {recommendations?.length
40
- ? recommendations.map(renderRecommendationCard(context, cardClassName, version))
40
+ ? recommendations.map(
41
+ renderRecommendationCard(context, BorderVersionStyleMap[version], version),
42
+ )
41
43
  : null}
42
44
  </div>
43
45
  {renderNavButtons({
@@ -1,14 +1,13 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { BlockVersion } from '../../model/BlockVersion';
3
- import { IconVersion } from '../../model/IconVersion';
4
3
  import type { UniBlockProps } from '../../model/JSXBlock';
5
4
  import type { SizeVersion } from '../../model/SizeVersion';
6
5
  import { Heading } from '../../ui-kit/Heading/Heading';
7
6
  import { Img } from '../../ui-kit/Img/Img';
8
7
  import { checkIsIconRenderable } from '../../utils/checkIsIconRenderable';
8
+ import { getIconWithVersion } from '../../utils/getIconWithVersion';
9
9
  import type { Step, StepsBlockContent } from './StepsBlockContent';
10
10
  import { STEPS_BLOCK_STYLE_MAPS } from './StepsBlockStyleMaps';
11
- import { getIconWithVersion } from '../../utils/getIconWithVersion';
12
11
 
13
12
  export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
14
13
 
@@ -22,11 +21,6 @@ const STEPS_TILE_DESCRIPTION_HEIGHT_MAP: Record<SizeVersion, string> = {
22
21
  small: 'min-h-[50px]',
23
22
  };
24
23
 
25
- const STEPS_SVG_VERSION_MAP: Record<BlockVersion, IconVersion> = {
26
- primary: 'normal',
27
- secondary: 'white',
28
- };
29
-
30
24
  export const StepsBlock = JSX<StepsBlockProps>(
31
25
  ({
32
26
  className,
@@ -16,67 +16,49 @@ const not =
16
16
  (_: Arg) =>
17
17
  !predicate(_);
18
18
 
19
- export function ContentPageRepository({
20
- contentDir = 'content',
21
- publicDir = 'public',
22
- }: Partial<TransformationOptions> = {}) {
23
- function listAllContentPages(): Promise<string[]> {
24
- return find(`${contentDir}/**/*.page.json`);
25
- }
19
+ export class ContentPageRepository {
20
+ public static readonly inst = new ContentPageRepository();
21
+
22
+ private cache: Record<string, ContentPageDef> = {};
23
+
24
+ constructor(
25
+ private readonly options: TransformationOptions = {
26
+ contentDir: 'content',
27
+ publicDir: 'public',
28
+ },
29
+ ) {}
26
30
 
27
- async function getAllContentPagesMap(): Promise<Record<string, ContentPageDef>> {
28
- const pagePaths = await listAllContentPages();
29
- const pages = await Promise.all(pagePaths.map(readPage));
30
-
31
- return pagePaths.reduce(
32
- (result, path, i) => ({
33
- ...result,
34
- [path]: pages[i],
35
- }),
36
- {},
37
- );
31
+ async listAllContentPages(): Promise<string[]> {
32
+ return find(`${this.options.contentDir}/**/*.page.json`);
38
33
  }
39
34
 
40
- async function getAllContentPages(): Promise<ContentPageDef[]> {
41
- return Object.values(await getAllContentPagesMap());
35
+ async getAllContentPages(): Promise<ContentPageDef[]> {
36
+ const pagePaths = await this.listAllContentPages();
37
+
38
+ return Promise.all(pagePaths.map((_) => this.readPage(_)));
42
39
  }
43
40
 
44
- async function getSecondaryContentPages(customPageType?: string) {
45
- const pages = await getAllContentPages();
41
+ async getSecondaryContentPages(customPageType?: string): Promise<ContentPageDef[]> {
42
+ const pages = await this.getAllContentPages();
46
43
 
47
44
  return pages.filter(not(bySlug(INDEX_PAGE_SLUG))).filter(byCustomPageType(customPageType));
48
45
  }
49
46
 
50
- async function getContentPageBySlug(slug: string): Promise<ContentPageDef | undefined> {
51
- const pages = await getAllContentPages();
47
+ async getContentPageBySlug(slug: string): Promise<ContentPageDef | undefined> {
48
+ const pages = await this.getAllContentPages();
52
49
 
53
50
  return pages.find(bySlug(slug));
54
51
  }
55
52
 
56
- async function getIndexPage() {
57
- return await getContentPageBySlug(INDEX_PAGE_SLUG);
53
+ async getIndexPage(): Promise<ContentPageDef | undefined> {
54
+ return this.getContentPageBySlug(INDEX_PAGE_SLUG);
58
55
  }
59
56
 
60
- const cache: Record<string, ContentPageDef> = {};
61
-
62
- async function readPage(filePath: string): Promise<ContentPageDef> {
63
- if (!(filePath in cache)) {
64
- cache[filePath] = await transformContentPage(filePath, {
65
- contentDir,
66
- publicDir,
67
- });
57
+ async readPage(filePath: string): Promise<ContentPageDef> {
58
+ if (!(filePath in this.cache)) {
59
+ this.cache[filePath] = await transformContentPage(filePath, this.options);
68
60
  }
69
61
 
70
- return cache[filePath];
62
+ return this.cache[filePath];
71
63
  }
72
-
73
- return {
74
- listAllContentPages,
75
- getAllContentPagesMap,
76
- getAllContentPages,
77
- getContentPageBySlug,
78
- getSecondaryContentPages,
79
- getIndexPage,
80
- readPage,
81
- };
82
64
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @title Цвет бордера
3
+ * @enumNames ["Основной", "Второстепенный"]
4
+ */
5
+ export type BorderVersion = 'primary' | 'secondary';
6
+
7
+ export const BorderVersionStyleMap: Record<BorderVersion, string> = {
8
+ primary: 'border-main-stroke',
9
+ secondary: 'border-white/50',
10
+ };
@@ -1,11 +1,11 @@
1
1
  import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
2
- import type { HeaderContent } from '../../components/Header/HeaderContent';
3
- import { projectSettings } from '../../ProjectSettings';
4
2
  import type { Fallback } from '../../model/Fallback';
3
+ import { projectSettings } from '../../ProjectSettings';
5
4
  import { fetchJSONUnsafe } from '../../utils/fetchJSON';
5
+ import type { SitemapProps } from './SitemapProps';
6
6
 
7
- export function useSitemap(fallback: Fallback = {}): HeaderContent {
8
- const { data } = useAsyncData<HeaderContent>(
7
+ export function useSitemap(fallback: Fallback = {}): SitemapProps {
8
+ const { data } = useAsyncData<SitemapProps>(
9
9
  `/wcms-resources/${projectSettings.SITEMAP || 'sitemap'}.json`,
10
10
  fetchJSONUnsafe,
11
11
  { fallback },
@@ -1,21 +1,22 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { BlockVersion } from '../../model/BlockVersion';
3
3
  import type { IconVersion } from '../../model/IconVersion';
4
+ import { getIconWithVersion } from '../../utils/getIconWithVersion';
4
5
  import { Img } from '../Img/Img';
5
6
  import type { BenefitItemCommonProps, BenefitItemProps } from './BenefitItemProps';
6
- import { getIconWithVersion } from '../../utils/getIconWithVersion';
7
-
8
- export interface BenefitGeneralProps extends BenefitItemProps, BenefitItemCommonProps {}
9
7
 
10
8
  const titleStyleMap: Record<BlockVersion, string> = {
11
9
  primary: 'text-primary-text',
12
10
  secondary: 'text-white',
13
11
  };
12
+
14
13
  const descStyleMap: Record<BlockVersion, string> = {
15
14
  primary: 'text-secondary-text',
16
15
  secondary: 'text-white',
17
16
  };
18
17
 
18
+ export interface BenefitGeneralProps extends BenefitItemProps, BenefitItemCommonProps {}
19
+
19
20
  export const BenefitItem = JSX<BenefitGeneralProps>((props) => {
20
21
  const {
21
22
  className = '',
@@ -31,7 +32,7 @@ export const BenefitItem = JSX<BenefitGeneralProps>((props) => {
31
32
  return (
32
33
  <div className={`flex gap-5 ${listItemAlign} ${className}`}>
33
34
  {icon ? (
34
- <div className={renderBenefitIconBgStyle(version, benefitsVersion)}>
35
+ <div className={getBenefitIconBgStyle(version, benefitsVersion)}>
35
36
  <Img className="w-6 h-6" image={getIconWithVersion(icon, calcVersion)} asSVG />
36
37
  </div>
37
38
  ) : null}
@@ -45,7 +46,7 @@ export const BenefitItem = JSX<BenefitGeneralProps>((props) => {
45
46
  );
46
47
  });
47
48
 
48
- function renderBenefitIconBgStyle(version: BlockVersion, benefitsVersion: IconVersion) {
49
+ function getBenefitIconBgStyle(version: BlockVersion, benefitsVersion: IconVersion) {
49
50
  let bgColorStyle = 'bg-primary-main text-black';
50
51
 
51
52
  if (version === 'secondary') {
@@ -7,15 +7,12 @@ export interface BreadcrumbProps extends LinkProps {
7
7
  }
8
8
 
9
9
  export const Breadcrumb = JSX<BreadcrumbProps>(
10
- ({ text, href, target, onClick, className = '', children }) => {
11
- if (href) {
12
- return (
13
- <a className={`no-underline ${className}`} href={href} target={target} onClick={onClick}>
14
- <span className={className}>{text || children}</span>
15
- </a>
16
- );
17
- } else {
18
- return <span className={className}>{text || children}</span>;
19
- }
20
- },
10
+ ({ text, href, target, onClick, className = '', children }) =>
11
+ href ? (
12
+ <a className={`no-underline ${className}`} href={href} target={target} onClick={onClick}>
13
+ <span className={className}>{text || children}</span>
14
+ </a>
15
+ ) : (
16
+ <span className={className}>{text || children}</span>
17
+ ),
21
18
  );
@@ -1,6 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { clamp } from '../../utils/clamp';
3
- import { adjustValue, localNumberFormat } from './adjustValue ';
3
+ import { adjustValue, localNumberFormat } from './adjustValue';
4
4
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
5
5
  import { Input } from '../Input/Input';
6
6
  import type { CurrencyInputProps } from './CurrencyInputProps';
@@ -10,15 +10,13 @@ export const Tags = JSX<TagsProps>((props) => {
10
10
  const { tags, className = '' } = props;
11
11
 
12
12
  return tags?.length ? (
13
- <div className={`flex flex-wrap gap-2 ${className}`}>
14
- {tags.map((_, i) => renderTag(_, String(i)))}
15
- </div>
13
+ <div className={`flex flex-wrap gap-2 ${className}`}>{tags.map(renderTag)}</div>
16
14
  ) : null;
17
15
  });
18
16
 
19
- const renderTag = (tag: string, key: string) => (
17
+ const renderTag = (tag: string, key: number) => (
20
18
  <span
21
- key={key}
19
+ key={String(key)}
22
20
  className="text-m-light py-2 px-2.5 border-solid border rounded-md border-color-stroke"
23
21
  >
24
22
  {tag}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.6.24",
3
+ "version": "0.6.25",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -1,19 +1,12 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import type { BlockVersion } from '../../model/BlockVersion';
2
+ import { BlockVersion, VersionStyleMap } from '../../model/BlockVersion';
3
3
  import type { UniBlockProps } from '../../model/JSXBlock';
4
4
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
5
5
  import { Heading } from '../../ui-kit/Heading/Heading';
6
6
  import { Img } from '../../ui-kit/Img/Img';
7
+ import { getIconWithVersion } from '../../utils/getIconWithVersion';
7
8
  import type { BenefitsBlockContent, ListBenefitDef, TextBenefitDef } from './BenefitsBlockContent';
8
9
  import { BenefitBlockItemProps, DescriptionDef } from './BenefitsBlockContent';
9
- import { getIconWithVersion } from '../../utils/getIconWithVersion';
10
-
11
- export interface BenefitsBlockProps extends BenefitsBlockContent, UniBlockProps {}
12
-
13
- const benefitsBlockStyleMap = {
14
- primary: 'bg-white',
15
- secondary: 'bg-primary-main',
16
- };
17
10
 
18
11
  const benefitsTextStyleMap = {
19
12
  primary: '',
@@ -30,10 +23,12 @@ const benefitsIconStyleMap = {
30
23
  secondary: 'bg-white/30 text-black',
31
24
  };
32
25
 
26
+ interface BenefitsBlockProps extends BenefitsBlockContent, UniBlockProps {}
27
+
33
28
  export const BenefitsBlock = JSX<BenefitsBlockProps>(
34
29
  ({ className = '', title, benefitList, version = 'primary', ...rest }) => (
35
30
  <BlockWrapper
36
- className={`font-sans text-primary-text p-12 flex flex-col items-center ${className} ${benefitsBlockStyleMap[version]}`}
31
+ className={`font-sans text-primary-text p-12 flex flex-col items-center ${className} ${VersionStyleMap[version]}`}
37
32
  {...rest}
38
33
  >
39
34
  {title ? (
@@ -44,19 +39,17 @@ export const BenefitsBlock = JSX<BenefitsBlockProps>(
44
39
  title={title}
45
40
  />
46
41
  ) : null}
47
- {benefitList?.length ? renderBenefits(benefitList, version) : null}
42
+ {benefitList?.length ? (
43
+ <div className="flex flex-wrap w-full justify-center gap-x-20 mt-8">
44
+ {benefitList.map(renderStep(version))}
45
+ </div>
46
+ ) : null}
48
47
  </BlockWrapper>
49
48
  ),
50
49
  );
51
50
 
52
- const renderBenefits = (benefitList: BenefitBlockItemProps[], version: BlockVersion) => (
53
- <div className="flex flex-wrap w-full justify-center gap-x-20 mt-8">
54
- {benefitList.map(renderStep(version))}
55
- </div>
56
- );
57
-
58
51
  const renderStep = (version: BlockVersion) => (benefit: BenefitBlockItemProps, i: number) => {
59
- const description = (benefit?.description || undefined) as DescriptionDef;
52
+ const description = benefit.description;
60
53
 
61
54
  return (
62
55
  <div key={String(i)} className="flex items-center basis-1/2 max-w-[500px] mb-14">
@@ -78,8 +71,8 @@ const renderStep = (version: BlockVersion) => (benefit: BenefitBlockItemProps, i
78
71
  );
79
72
  };
80
73
 
81
- const renderDescription = (description: DescriptionDef, version: BlockVersion) => {
82
- const benefitType = description ? description?.benefitType : null;
74
+ const renderDescription = (description: DescriptionDef | undefined, version: BlockVersion) => {
75
+ const benefitType = description?.benefitType || null;
83
76
 
84
77
  return description && benefitType ? (
85
78
  <div className={`text-l-light mt-2 ${benefitsDescriptionStyleMap[version]}`}>
@@ -90,7 +83,7 @@ const renderDescription = (description: DescriptionDef, version: BlockVersion) =
90
83
  ) : null;
91
84
  };
92
85
 
93
- const renderTextBenefit = (description?: TextBenefitDef) => (description ? description.name : null);
86
+ const renderTextBenefit = (description?: TextBenefitDef) => description?.name || null;
94
87
 
95
88
  const renderListBenefit = (description?: ListBenefitDef) => {
96
89
  const listStyleType = description?.bullets ? 'list-disc pl-6' : '';
@@ -38,6 +38,7 @@ import { Tabs } from './Tabs/Tabs';
38
38
  import { TariffsTable } from './TariffsTable/TariffsTable';
39
39
  import { TextBlock } from './TextBlock/TextBlock';
40
40
  import { Tile } from './Tile/Tile';
41
+ import { InvestmentGallery } from './InvestmentGallery/InvestmentGallery';
41
42
 
42
43
  export const Blocks: BlocksRegistry = {
43
44
  Accordion,
@@ -79,4 +80,5 @@ export const Blocks: BlocksRegistry = {
79
80
  SafeDepositRental,
80
81
  Tabs,
81
82
  ErrorBlock,
83
+ InvestmentGallery,
82
84
  };
@@ -2,6 +2,7 @@ import type { HeadlineCommonProps } from '../../model/HeadlineType';
2
2
  import type { ProductColorVersion } from '../../model/ProductColorVersion';
3
3
  import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
4
4
  import type { ImageContent } from '../../ui-kit/Img/ImgProps';
5
+ import type { BlockVersion } from '../../model/BlockVersion';
5
6
 
6
7
  export interface CatalogCardType extends HeadlineCommonProps, ImageContent {
7
8
  /** @title Цена в рублях */
@@ -24,4 +25,5 @@ export interface CatalogCardType extends HeadlineCommonProps, ImageContent {
24
25
  export type CatalogContent = HeadlineCommonProps & {
25
26
  /** @title Список карточек */
26
27
  cards?: CatalogCardType[];
28
+ version?: BlockVersion;
27
29
  };
@@ -4,26 +4,23 @@ import { mapSlot } from './mapSlot';
4
4
 
5
5
  export function normalizeBlock<S extends Slot>(block?: S, blocksRegistry?: BlocksRegistry): S {
6
6
  const { mobile, ...rest } = (block || {}) as BlockDef;
7
-
8
- const normalizedBlock = mobile
7
+ const result = mobile
9
8
  ? { ...rest, ...mobile, content: { ...rest.content, ...mobile.content } }
10
9
  : block;
11
10
 
12
- return {
13
- ...mapSlot((blocks) => filterBlocks(blocks, blocksRegistry))(normalizedBlock || {}),
14
- } as S;
11
+ return mapSlot(filterBlocks(blocksRegistry))(result || {}) as S;
15
12
  }
16
13
 
17
- const filterBlocks = (blocks?: BlockDef[], blocksRegistry?: BlocksRegistry) =>
18
- blocks
19
- ? blocks
20
- ?.filter(
21
- (block) =>
22
- blocksRegistry &&
23
- (block?.type || block?.mobile?.type || '') in blocksRegistry &&
24
- !block.mobile?.hidden,
25
- )
26
- .map((block) => ({
27
- ...normalizeBlock(block, blocksRegistry),
28
- }))
29
- : [];
14
+ const filterBlocks =
15
+ (blocksRegistry?: BlocksRegistry) =>
16
+ (blocks?: BlockDef[]): BlockDef[] =>
17
+ blocks
18
+ ? blocks
19
+ ?.filter(
20
+ (block) =>
21
+ blocksRegistry &&
22
+ (block?.type || block?.mobile?.type || '') in blocksRegistry &&
23
+ !block.mobile?.hidden,
24
+ )
25
+ .map((block) => normalizeBlock(block, blocksRegistry))
26
+ : [];
@@ -4,18 +4,16 @@ import { mapSlot } from './mapSlot';
4
4
 
5
5
  export function normalizeBlock<S extends Slot>(block?: S, blocksRegistry?: BlocksRegistry): S {
6
6
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
7
- const { mobile, ...rest } = (block || {}) as BlockDef;
7
+ const { mobile, ...result } = (block || {}) as BlockDef;
8
8
 
9
- return {
10
- ...mapSlot((blocks) => filterBlocks(blocks, blocksRegistry))({ ...rest }),
11
- } as S;
9
+ return mapSlot(filterBlocks(blocksRegistry))({ ...result }) as S;
12
10
  }
13
11
 
14
- const filterBlocks = (blocks?: BlockDef[], blocksRegistry?: BlocksRegistry) =>
15
- blocks
16
- ? blocks
17
- .filter((block) => blocksRegistry && (block?.type || '') in blocksRegistry)
18
- .map((block) => ({
19
- ...normalizeBlock(block, blocksRegistry),
20
- }))
21
- : [];
12
+ const filterBlocks =
13
+ (blocksRegistry?: BlocksRegistry) =>
14
+ (blocks?: BlockDef[]): BlockDef[] =>
15
+ blocks
16
+ ? blocks
17
+ .filter((block) => blocksRegistry && (block?.type || '') in blocksRegistry)
18
+ .map((block) => normalizeBlock(block, blocksRegistry))
19
+ : [];