@redneckz/wildless-cms-uni-blocks 0.6.41 → 0.6.43

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 (381) hide show
  1. package/bin/migration-scripts/0.6.34.js +2 -0
  2. package/bin/migration-scripts/0.6.43.js +29 -0
  3. package/bundle/blocks.schema.json +1 -1
  4. package/bundle/bundle.umd.js +213 -101
  5. package/bundle/bundle.umd.min.js +1 -1
  6. package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  7. package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  8. package/bundle/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  9. package/bundle/components/ProductTile/ProductTileContent.d.ts +24 -2
  10. package/bundle/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
  11. package/bundle/components/ProductTile/renderBenefit.d.ts +4 -0
  12. package/bundle/components/ProductTile/renderImage.d.ts +3 -0
  13. package/bundle/content-page-repository/transformImg.d.ts +1 -1
  14. package/bundle/hooks/useCachedAsyncData.d.ts +2 -0
  15. package/bundle/hooks/useLocation.d.ts +6 -0
  16. package/bundle/hooks/useRegions.d.ts +6 -0
  17. package/bundle/services/sitemap/SitemapProps.d.ts +8 -0
  18. package/bundle/ui-kit/Location/Location.d.ts +19 -0
  19. package/bundle/ui-kit/Location/SearchBar.d.ts +6 -0
  20. package/bundle/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
  21. package/bundle/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
  22. package/bundle/utils/groupBy.d.ts +1 -0
  23. package/dist/components/Blocks.js +4 -2
  24. package/dist/components/Blocks.js.map +1 -1
  25. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  26. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +22 -0
  27. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
  28. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  29. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
  30. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
  31. package/dist/components/Header/Header.js +2 -2
  32. package/dist/components/Header/Header.js.map +1 -1
  33. package/dist/components/Header/HeaderBurger.js +4 -3
  34. package/dist/components/Header/HeaderBurger.js.map +1 -1
  35. package/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  36. package/dist/components/Header/HeaderSecondaryMenu.js +13 -4
  37. package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  38. package/dist/components/ProductTile/ProductTile.js +9 -22
  39. package/dist/components/ProductTile/ProductTile.js.map +1 -1
  40. package/dist/components/ProductTile/ProductTileContent.d.ts +24 -2
  41. package/dist/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
  42. package/dist/components/ProductTile/renderAdditionalDescription.js +18 -0
  43. package/dist/components/ProductTile/renderAdditionalDescription.js.map +1 -0
  44. package/dist/components/ProductTile/renderBenefit.d.ts +4 -0
  45. package/dist/components/ProductTile/renderBenefit.js +32 -0
  46. package/dist/components/ProductTile/renderBenefit.js.map +1 -0
  47. package/dist/components/ProductTile/renderImage.d.ts +3 -0
  48. package/dist/components/ProductTile/renderImage.js +12 -0
  49. package/dist/components/ProductTile/renderImage.js.map +1 -0
  50. package/dist/components/Recommendation/RecommendationCard.js +1 -1
  51. package/dist/components/Recommendation/RecommendationCard.js.map +1 -1
  52. package/dist/components/TextBlock/TextBlock.js +13 -28
  53. package/dist/components/TextBlock/TextBlock.js.map +1 -1
  54. package/dist/content-page-repository/transformImg.d.ts +1 -1
  55. package/dist/content-page-repository/transformImg.js +4 -10
  56. package/dist/content-page-repository/transformImg.js.map +1 -1
  57. package/dist/content-page-repository/transformMarkdown.js +3 -3
  58. package/dist/content-page-repository/transformMarkdown.js.map +1 -1
  59. package/dist/hooks/useCachedAsyncData.d.ts +2 -0
  60. package/dist/hooks/useCachedAsyncData.js +25 -0
  61. package/dist/hooks/useCachedAsyncData.js.map +1 -0
  62. package/dist/hooks/useLocation.d.ts +6 -0
  63. package/dist/hooks/useLocation.js +26 -0
  64. package/dist/hooks/useLocation.js.map +1 -0
  65. package/dist/hooks/useRegions.d.ts +6 -0
  66. package/dist/hooks/useRegions.js +11 -0
  67. package/dist/hooks/useRegions.js.map +1 -0
  68. package/dist/services/sitemap/SitemapProps.d.ts +8 -0
  69. package/dist/ui-kit/Location/Location.d.ts +19 -0
  70. package/dist/ui-kit/Location/Location.js +44 -0
  71. package/dist/ui-kit/Location/Location.js.map +1 -0
  72. package/dist/ui-kit/Location/SearchBar.d.ts +6 -0
  73. package/dist/ui-kit/Location/SearchBar.js +9 -0
  74. package/dist/ui-kit/Location/SearchBar.js.map +1 -0
  75. package/dist/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
  76. package/dist/ui-kit/MarkdownText/MarkdownText.js +9 -0
  77. package/dist/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
  78. package/dist/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
  79. package/dist/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
  80. package/dist/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
  81. package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
  82. package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  83. package/dist/ui-kit/Text/Text.js +1 -5
  84. package/dist/ui-kit/Text/Text.js.map +1 -1
  85. package/dist/utils/groupBy.d.ts +1 -0
  86. package/dist/utils/groupBy.js +13 -0
  87. package/dist/utils/groupBy.js.map +1 -0
  88. package/lib/common.css +1 -1
  89. package/lib/components/Blocks.js +4 -2
  90. package/lib/components/Blocks.js.map +1 -1
  91. package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
  92. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  93. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.d.ts +9 -0
  94. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +20 -0
  95. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
  96. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  97. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
  98. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
  99. package/lib/components/Header/Header.js +2 -2
  100. package/lib/components/Header/Header.js.map +1 -1
  101. package/lib/components/Header/HeaderBurger.js +4 -3
  102. package/lib/components/Header/HeaderBurger.js.map +1 -1
  103. package/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  104. package/lib/components/Header/HeaderSecondaryMenu.js +13 -4
  105. package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  106. package/lib/components/ProductTile/ProductTile.js +10 -23
  107. package/lib/components/ProductTile/ProductTile.js.map +1 -1
  108. package/lib/components/ProductTile/ProductTileContent.d.ts +24 -2
  109. package/lib/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
  110. package/lib/components/ProductTile/renderAdditionalDescription.js +15 -0
  111. package/lib/components/ProductTile/renderAdditionalDescription.js.map +1 -0
  112. package/lib/components/ProductTile/renderBenefit.d.ts +4 -0
  113. package/lib/components/ProductTile/renderBenefit.js +29 -0
  114. package/lib/components/ProductTile/renderBenefit.js.map +1 -0
  115. package/lib/components/ProductTile/renderImage.d.ts +3 -0
  116. package/lib/components/ProductTile/renderImage.js +9 -0
  117. package/lib/components/ProductTile/renderImage.js.map +1 -0
  118. package/lib/components/Recommendation/Recommendation.fixture.d.ts +1 -1
  119. package/lib/components/Recommendation/RecommendationCard.js +1 -1
  120. package/lib/components/Recommendation/RecommendationCard.js.map +1 -1
  121. package/lib/components/TextBlock/TextBlock.js +13 -28
  122. package/lib/components/TextBlock/TextBlock.js.map +1 -1
  123. package/lib/content-page-repository/transformImg.d.ts +1 -1
  124. package/lib/content-page-repository/transformImg.js +4 -10
  125. package/lib/content-page-repository/transformImg.js.map +1 -1
  126. package/lib/content-page-repository/transformMarkdown.js +3 -3
  127. package/lib/content-page-repository/transformMarkdown.js.map +1 -1
  128. package/lib/hooks/useCachedAsyncData.d.ts +2 -0
  129. package/lib/hooks/useCachedAsyncData.js +22 -0
  130. package/lib/hooks/useCachedAsyncData.js.map +1 -0
  131. package/lib/hooks/useLocation.d.ts +6 -0
  132. package/lib/hooks/useLocation.js +23 -0
  133. package/lib/hooks/useLocation.js.map +1 -0
  134. package/lib/hooks/useRegions.d.ts +6 -0
  135. package/lib/hooks/useRegions.js +8 -0
  136. package/lib/hooks/useRegions.js.map +1 -0
  137. package/lib/services/sitemap/SitemapProps.d.ts +8 -0
  138. package/lib/ui-kit/Location/Location.d.ts +19 -0
  139. package/lib/ui-kit/Location/Location.fixture.d.ts +6 -0
  140. package/lib/ui-kit/Location/Location.js +42 -0
  141. package/lib/ui-kit/Location/Location.js.map +1 -0
  142. package/lib/ui-kit/Location/SearchBar.d.ts +6 -0
  143. package/lib/ui-kit/Location/SearchBar.js +7 -0
  144. package/lib/ui-kit/Location/SearchBar.js.map +1 -0
  145. package/lib/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
  146. package/lib/ui-kit/MarkdownText/MarkdownText.js +7 -0
  147. package/lib/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
  148. package/lib/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
  149. package/lib/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
  150. package/lib/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
  151. package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
  152. package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  153. package/lib/ui-kit/Text/Text.js +1 -5
  154. package/lib/ui-kit/Text/Text.js.map +1 -1
  155. package/lib/utils/groupBy.d.ts +1 -0
  156. package/lib/utils/groupBy.js +10 -0
  157. package/lib/utils/groupBy.js.map +1 -0
  158. package/mobile/bundle/bundle.umd.js +49 -25
  159. package/mobile/bundle/bundle.umd.min.js +1 -1
  160. package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  161. package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  162. package/mobile/bundle/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  163. package/mobile/bundle/components/ProductTile/ProductTileContent.d.ts +24 -2
  164. package/mobile/bundle/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
  165. package/mobile/bundle/components/ProductTile/renderBenefit.d.ts +4 -0
  166. package/mobile/bundle/components/ProductTile/renderImage.d.ts +3 -0
  167. package/mobile/bundle/content-page-repository/transformImg.d.ts +1 -1
  168. package/mobile/bundle/hooks/useCachedAsyncData.d.ts +2 -0
  169. package/mobile/bundle/hooks/useLocation.d.ts +6 -0
  170. package/mobile/bundle/hooks/useRegions.d.ts +6 -0
  171. package/mobile/bundle/services/sitemap/SitemapProps.d.ts +8 -0
  172. package/mobile/bundle/ui-kit/Location/Location.d.ts +19 -0
  173. package/mobile/bundle/ui-kit/Location/SearchBar.d.ts +6 -0
  174. package/mobile/bundle/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
  175. package/mobile/bundle/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
  176. package/mobile/bundle/utils/groupBy.d.ts +1 -0
  177. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  178. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +22 -0
  179. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
  180. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  181. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
  182. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
  183. package/mobile/dist/components/Header/HeaderBurger.js +4 -3
  184. package/mobile/dist/components/Header/HeaderBurger.js.map +1 -1
  185. package/mobile/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  186. package/mobile/dist/components/Header/HeaderSecondaryMenu.js +13 -4
  187. package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  188. package/mobile/dist/components/ProductTile/ProductTile.js +9 -22
  189. package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
  190. package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +24 -2
  191. package/mobile/dist/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
  192. package/mobile/dist/components/ProductTile/renderAdditionalDescription.js +18 -0
  193. package/mobile/dist/components/ProductTile/renderAdditionalDescription.js.map +1 -0
  194. package/mobile/dist/components/ProductTile/renderBenefit.d.ts +4 -0
  195. package/mobile/dist/components/ProductTile/renderBenefit.js +32 -0
  196. package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -0
  197. package/mobile/dist/components/ProductTile/renderImage.d.ts +3 -0
  198. package/mobile/dist/components/ProductTile/renderImage.js +12 -0
  199. package/mobile/dist/components/ProductTile/renderImage.js.map +1 -0
  200. package/mobile/dist/components/Recommendation/RecommendationCard.js +1 -1
  201. package/mobile/dist/components/Recommendation/RecommendationCard.js.map +1 -1
  202. package/mobile/dist/content-page-repository/transformImg.d.ts +1 -1
  203. package/mobile/dist/content-page-repository/transformImg.js +4 -10
  204. package/mobile/dist/content-page-repository/transformImg.js.map +1 -1
  205. package/mobile/dist/content-page-repository/transformMarkdown.js +3 -3
  206. package/mobile/dist/content-page-repository/transformMarkdown.js.map +1 -1
  207. package/mobile/dist/hooks/useCachedAsyncData.d.ts +2 -0
  208. package/mobile/dist/hooks/useCachedAsyncData.js +25 -0
  209. package/mobile/dist/hooks/useCachedAsyncData.js.map +1 -0
  210. package/mobile/dist/hooks/useLocation.d.ts +6 -0
  211. package/mobile/dist/hooks/useLocation.js +26 -0
  212. package/mobile/dist/hooks/useLocation.js.map +1 -0
  213. package/mobile/dist/hooks/useRegions.d.ts +6 -0
  214. package/mobile/dist/hooks/useRegions.js +11 -0
  215. package/mobile/dist/hooks/useRegions.js.map +1 -0
  216. package/mobile/dist/services/sitemap/SitemapProps.d.ts +8 -0
  217. package/mobile/dist/ui-kit/Location/Location.d.ts +19 -0
  218. package/mobile/dist/ui-kit/Location/Location.js +44 -0
  219. package/mobile/dist/ui-kit/Location/Location.js.map +1 -0
  220. package/mobile/dist/ui-kit/Location/SearchBar.d.ts +6 -0
  221. package/mobile/dist/ui-kit/Location/SearchBar.js +9 -0
  222. package/mobile/dist/ui-kit/Location/SearchBar.js.map +1 -0
  223. package/mobile/dist/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
  224. package/mobile/dist/ui-kit/MarkdownText/MarkdownText.js +9 -0
  225. package/mobile/dist/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
  226. package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
  227. package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
  228. package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
  229. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
  230. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  231. package/mobile/dist/ui-kit/Text/Text.js +1 -5
  232. package/mobile/dist/ui-kit/Text/Text.js.map +1 -1
  233. package/mobile/dist/utils/groupBy.d.ts +1 -0
  234. package/mobile/dist/utils/groupBy.js +13 -0
  235. package/mobile/dist/utils/groupBy.js.map +1 -0
  236. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  237. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +20 -0
  238. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
  239. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  240. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
  241. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
  242. package/mobile/lib/components/Header/HeaderBurger.js +4 -3
  243. package/mobile/lib/components/Header/HeaderBurger.js.map +1 -1
  244. package/mobile/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  245. package/mobile/lib/components/Header/HeaderSecondaryMenu.js +13 -4
  246. package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  247. package/mobile/lib/components/ProductTile/ProductTile.js +10 -23
  248. package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
  249. package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +24 -2
  250. package/mobile/lib/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
  251. package/mobile/lib/components/ProductTile/renderAdditionalDescription.js +15 -0
  252. package/mobile/lib/components/ProductTile/renderAdditionalDescription.js.map +1 -0
  253. package/mobile/lib/components/ProductTile/renderBenefit.d.ts +4 -0
  254. package/mobile/lib/components/ProductTile/renderBenefit.js +29 -0
  255. package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -0
  256. package/mobile/lib/components/ProductTile/renderImage.d.ts +3 -0
  257. package/mobile/lib/components/ProductTile/renderImage.js +9 -0
  258. package/mobile/lib/components/ProductTile/renderImage.js.map +1 -0
  259. package/mobile/lib/components/Recommendation/RecommendationCard.js +1 -1
  260. package/mobile/lib/components/Recommendation/RecommendationCard.js.map +1 -1
  261. package/mobile/lib/content-page-repository/transformImg.d.ts +1 -1
  262. package/mobile/lib/content-page-repository/transformImg.js +4 -10
  263. package/mobile/lib/content-page-repository/transformImg.js.map +1 -1
  264. package/mobile/lib/content-page-repository/transformMarkdown.js +3 -3
  265. package/mobile/lib/content-page-repository/transformMarkdown.js.map +1 -1
  266. package/mobile/lib/hooks/useCachedAsyncData.d.ts +2 -0
  267. package/mobile/lib/hooks/useCachedAsyncData.js +22 -0
  268. package/mobile/lib/hooks/useCachedAsyncData.js.map +1 -0
  269. package/mobile/lib/hooks/useLocation.d.ts +6 -0
  270. package/mobile/lib/hooks/useLocation.js +23 -0
  271. package/mobile/lib/hooks/useLocation.js.map +1 -0
  272. package/mobile/lib/hooks/useRegions.d.ts +6 -0
  273. package/mobile/lib/hooks/useRegions.js +8 -0
  274. package/mobile/lib/hooks/useRegions.js.map +1 -0
  275. package/mobile/lib/services/sitemap/SitemapProps.d.ts +8 -0
  276. package/mobile/lib/ui-kit/Location/Location.d.ts +19 -0
  277. package/mobile/lib/ui-kit/Location/Location.js +42 -0
  278. package/mobile/lib/ui-kit/Location/Location.js.map +1 -0
  279. package/mobile/lib/ui-kit/Location/SearchBar.d.ts +6 -0
  280. package/mobile/lib/ui-kit/Location/SearchBar.js +7 -0
  281. package/mobile/lib/ui-kit/Location/SearchBar.js.map +1 -0
  282. package/mobile/lib/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
  283. package/mobile/lib/ui-kit/MarkdownText/MarkdownText.js +7 -0
  284. package/mobile/lib/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
  285. package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
  286. package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
  287. package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
  288. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
  289. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  290. package/mobile/lib/ui-kit/Text/Text.js +1 -5
  291. package/mobile/lib/ui-kit/Text/Text.js.map +1 -1
  292. package/mobile/lib/utils/groupBy.d.ts +1 -0
  293. package/mobile/lib/utils/groupBy.js +10 -0
  294. package/mobile/lib/utils/groupBy.js.map +1 -0
  295. package/mobile/src/common.css +50 -0
  296. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +19 -0
  297. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +62 -0
  298. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +9 -0
  299. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +45 -0
  300. package/mobile/src/components/Header/HeaderBurger.tsx +5 -7
  301. package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +32 -5
  302. package/mobile/src/components/MiniGallery/MiniGallery.ui.json +1 -1
  303. package/mobile/src/components/ProductTile/ProductTile.example.json +3 -0
  304. package/mobile/src/components/ProductTile/ProductTile.tsx +13 -44
  305. package/mobile/src/components/ProductTile/ProductTile.ui.json +14 -1
  306. package/mobile/src/components/ProductTile/ProductTileContent.ts +26 -2
  307. package/mobile/src/components/ProductTile/renderAdditionalDescription.tsx +30 -0
  308. package/mobile/src/components/ProductTile/renderBenefit.tsx +39 -0
  309. package/mobile/src/components/ProductTile/renderImage.tsx +15 -0
  310. package/mobile/src/components/Recommendation/Recommendation.example.json +6 -5
  311. package/mobile/src/components/Recommendation/Recommendation.ui.json +8 -0
  312. package/mobile/src/components/Recommendation/RecommendationCard.tsx +1 -1
  313. package/mobile/src/content-page-repository/transformImg.ts +6 -14
  314. package/mobile/src/content-page-repository/transformMarkdown.ts +3 -3
  315. package/mobile/src/hooks/useCachedAsyncData.ts +37 -0
  316. package/mobile/src/hooks/useLocation.ts +48 -0
  317. package/mobile/src/hooks/useRegions.ts +16 -0
  318. package/mobile/src/services/sitemap/SitemapProps.ts +9 -0
  319. package/mobile/src/ui-kit/Location/Location.tsx +168 -0
  320. package/mobile/src/ui-kit/Location/SearchBar.tsx +30 -0
  321. package/mobile/src/ui-kit/MarkdownText/MarkdownText.tsx +8 -0
  322. package/mobile/src/ui-kit/MarkdownText/MarkdownTextProps.ts +6 -0
  323. package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +8 -4
  324. package/mobile/src/ui-kit/Text/Text.tsx +5 -7
  325. package/mobile/src/utils/groupBy.ts +10 -0
  326. package/package.json +2 -2
  327. package/src/common.css +50 -0
  328. package/src/components/Blocks.ts +4 -2
  329. package/src/components/Carousel/Carousel.fixture.tsx +22 -4
  330. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +19 -0
  331. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +47 -0
  332. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +62 -0
  333. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +9 -0
  334. package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +45 -0
  335. package/src/components/Header/Header.tsx +6 -4
  336. package/src/components/Header/HeaderBurger.tsx +5 -7
  337. package/src/components/Header/HeaderSecondaryMenu.tsx +32 -5
  338. package/src/components/MiniGallery/MiniGallery.ui.json +1 -1
  339. package/src/components/ProductTile/ProductTile.example.json +3 -0
  340. package/src/components/ProductTile/ProductTile.fixture.tsx +11 -4
  341. package/src/components/ProductTile/ProductTile.tsx +13 -44
  342. package/src/components/ProductTile/ProductTile.ui.json +14 -1
  343. package/src/components/ProductTile/ProductTileContent.ts +26 -2
  344. package/src/components/ProductTile/renderAdditionalDescription.tsx +30 -0
  345. package/src/components/ProductTile/renderBenefit.tsx +39 -0
  346. package/src/components/ProductTile/renderImage.tsx +15 -0
  347. package/src/components/Recommendation/Recommendation.example.json +6 -5
  348. package/src/components/Recommendation/Recommendation.fixture.tsx +11 -10
  349. package/src/components/Recommendation/Recommendation.ui.json +8 -0
  350. package/src/components/Recommendation/RecommendationCard.tsx +1 -1
  351. package/src/components/TextBlock/TextBlock.tsx +49 -41
  352. package/src/content-page-repository/transformImg.ts +6 -14
  353. package/src/content-page-repository/transformMarkdown.ts +3 -3
  354. package/src/hooks/useCachedAsyncData.ts +37 -0
  355. package/src/hooks/useLocation.ts +48 -0
  356. package/src/hooks/useRegions.ts +16 -0
  357. package/src/services/sitemap/SitemapProps.ts +9 -0
  358. package/src/ui-kit/Location/Location.fixture.tsx +81 -0
  359. package/src/ui-kit/Location/Location.tsx +168 -0
  360. package/src/ui-kit/Location/SearchBar.tsx +30 -0
  361. package/src/ui-kit/MarkdownText/MarkdownText.tsx +8 -0
  362. package/src/ui-kit/MarkdownText/MarkdownTextProps.ts +6 -0
  363. package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +8 -4
  364. package/src/ui-kit/Text/Text.tsx +5 -7
  365. package/src/utils/groupBy.ts +10 -0
  366. package/bundle/hooks/useGeolocation.d.ts +0 -1
  367. package/dist/hooks/useGeolocation.d.ts +0 -1
  368. package/dist/hooks/useGeolocation.js +0 -21
  369. package/dist/hooks/useGeolocation.js.map +0 -1
  370. package/lib/hooks/useGeolocation.d.ts +0 -1
  371. package/lib/hooks/useGeolocation.js +0 -18
  372. package/lib/hooks/useGeolocation.js.map +0 -1
  373. package/mobile/bundle/hooks/useGeolocation.d.ts +0 -1
  374. package/mobile/dist/hooks/useGeolocation.d.ts +0 -1
  375. package/mobile/dist/hooks/useGeolocation.js +0 -21
  376. package/mobile/dist/hooks/useGeolocation.js.map +0 -1
  377. package/mobile/lib/hooks/useGeolocation.d.ts +0 -1
  378. package/mobile/lib/hooks/useGeolocation.js +0 -18
  379. package/mobile/lib/hooks/useGeolocation.js.map +0 -1
  380. package/mobile/src/hooks/useGeolocation.ts +0 -22
  381. package/src/hooks/useGeolocation.ts +0 -22
@@ -0,0 +1,62 @@
1
+ import { BaseTile } from '../BaseTile/BaseTile';
2
+ import { BlockWrapper } from '../../ui-kit/BlockWrapper';
3
+ import { BorderVersionStyleMap } from '../../model/BorderVersion';
4
+ import { Heading } from '../../ui-kit/Heading/Heading';
5
+ import { Img } from '../../ui-kit/Img/Img';
6
+ import { JSX } from '@redneckz/uni-jsx';
7
+ import { List } from '../../ui-kit/List/List';
8
+ import { renderButton } from '../../ui-kit/Button/ButtonSection';
9
+ import { SocialMedia } from '../Footer/SocialMedia';
10
+ import { VersionStyleMap } from '../../model/BlockVersion';
11
+ import type { CarouselRecommendationCardContent } from './CarouselRecommendationCardContent';
12
+ import type { UniBlockProps } from '../../model/JSXBlock';
13
+
14
+ export interface RecommendationCardProps extends CarouselRecommendationCardContent, UniBlockProps {}
15
+
16
+ export const CarouselRecommendationCard = JSX<RecommendationCardProps>(
17
+ ({
18
+ button,
19
+ className = '',
20
+ description,
21
+ image,
22
+ items = [],
23
+ socialMedia = [],
24
+ title,
25
+ version = 'primary',
26
+ ...rest
27
+ }) => {
28
+ const tileTitle = title ? (
29
+ <Heading headingType="h5" as="h3" className="mb-3.5 z-10" title={title} />
30
+ ) : null;
31
+ const tileImage = image?.src ? (
32
+ <Img className="absolute bottom-0 right-0 m-0" image={image} />
33
+ ) : null;
34
+
35
+ return (
36
+ <BlockWrapper
37
+ className={`relative text-left border border-solid box-border p-7 min-w-[524px]
38
+ ${BorderVersionStyleMap[version]}
39
+ ${VersionStyleMap[version]}
40
+ ${className}`}
41
+ {...rest}
42
+ >
43
+ <BaseTile className="flex justify-between" title={tileTitle} image={tileImage}>
44
+ <div className="h-full flex flex-col justify-between">
45
+ {description ? <span className="mb-2">{description}</span> : null}
46
+ {items.length ? (
47
+ <List
48
+ className="text-xl-light flex flex-col flex-1 gap-2 max-w-[236px]"
49
+ items={items}
50
+ version={version}
51
+ />
52
+ ) : null}
53
+ {socialMedia.length ? (
54
+ <SocialMedia className="pt-10 pb-0" media={socialMedia} version={version} />
55
+ ) : null}
56
+ {button?.text ? <div className="pt-2 mt-16">{renderButton({ button })}</div> : null}
57
+ </div>
58
+ </BaseTile>
59
+ </BlockWrapper>
60
+ );
61
+ },
62
+ );
@@ -0,0 +1,9 @@
1
+ {
2
+ "content": {
3
+ "items": {
4
+ "image": {
5
+ "ui:field": "picture"
6
+ }
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,45 @@
1
+ import type { BlockVersion } from '../../model/BlockVersion';
2
+ import type { HeadlineCommonProps } from '../../model/HeadlineType';
3
+ import type { LinkCommonProps } from '../../model/LinkProps';
4
+ import type { Picture } from '../../model/Picture';
5
+ import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
6
+ import type { ListContent } from '../../ui-kit/List/ListContent';
7
+
8
+ /**
9
+ * @title Карточка рекомендаций
10
+ */
11
+ export interface CarouselRecommendationCardContent extends HeadlineCommonProps, ListContent {
12
+ /**
13
+ * @title Соц сети
14
+ * @minItems 3
15
+ * @default [
16
+ * { "href": "https://t.me" },
17
+ * { "href": "https://vk.com" },
18
+ * { "href": "https://ok.ru" },
19
+ * ]
20
+ */
21
+ socialMedia?: LinkCommonProps[];
22
+ /**
23
+ * @default {
24
+ * "format": "webp",
25
+ * "size": {
26
+ * "width": 290
27
+ * },
28
+ * "sources": [{
29
+ * "media": 1279,
30
+ * "width": 174,
31
+ * "format": "webp",
32
+ * "alignment": "southeast"
33
+ * }]
34
+ * }
35
+ */
36
+ image?: Picture;
37
+ /**
38
+ * @default {
39
+ * "text": "",
40
+ * "version": "secondary"
41
+ * }
42
+ */
43
+ button?: ButtonProps;
44
+ version?: BlockVersion;
45
+ }
@@ -1,8 +1,9 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useGeolocation } from '../../hooks/useGeolocation';
2
+ import { useLocation } from '../../hooks/useLocation';
3
3
  import type { VNode } from '../../model/VNode';
4
4
  import { Img } from '../../ui-kit/Img/Img';
5
5
  import { SearchBar } from '../../ui-kit/SearchBar/SearchBar';
6
+ import { Text } from '../../ui-kit/Text/Text';
6
7
  import type { DispositionItem } from './HeaderContent';
7
8
 
8
9
  export interface HeaderBurgerProps {
@@ -14,7 +15,7 @@ export interface HeaderBurgerProps {
14
15
 
15
16
  export const HeaderBurger = JSX<HeaderBurgerProps>(
16
17
  ({ burgerSubMenu, onClick, defaultLocation = '', children }) => {
17
- const [city, getCity] = useGeolocation(defaultLocation);
18
+ const [location] = useLocation(defaultLocation);
18
19
 
19
20
  return (
20
21
  <div className="absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20">
@@ -24,10 +25,7 @@ export const HeaderBurger = JSX<HeaderBurgerProps>(
24
25
  >
25
26
  <Img image="CloseIcon" width="24" height="24" asSVG />
26
27
  </button>
27
- <button
28
- onClick={getCity}
29
- className="flex items-center text-s text-secondary-text p-0 mb-4 bg-transparent cursor-pointer"
30
- >
28
+ <button className="flex items-center text-s p-0 mb-4 bg-transparent cursor-pointer">
31
29
  <Img
32
30
  image="GeolocationIcon"
33
31
  width="20"
@@ -35,7 +33,7 @@ export const HeaderBurger = JSX<HeaderBurgerProps>(
35
33
  className="text-primary-main box-border mr-2"
36
34
  asSVG
37
35
  />
38
- {city}
36
+ <Text color="text-secondary-text">{location.name}</Text>
39
37
  </button>
40
38
  {children}
41
39
  <div className="mb-7">{burgerSubMenu?.map(renderBurgerSubMenuItem)}</div>
@@ -1,8 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useGeolocation } from '../../hooks/useGeolocation';
2
+ import { useState } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { useLocation } from '../../hooks/useLocation';
3
4
  import type { BgColorVersion } from '../../model/BgColorVersion';
4
5
  import type { IconVersion } from '../../model/IconVersion';
6
+ import type { ForeignOffice } from '../../services/sitemap/SitemapProps';
5
7
  import { Img } from '../../ui-kit/Img/Img';
8
+ import { Location } from '../../ui-kit/Location/Location';
6
9
  import { TopItem } from '../../ui-kit/TopItem/TopItem';
7
10
  import { HeaderSecondaryMenuButton } from './HeaderSecondaryMenuButton';
8
11
 
@@ -10,6 +13,7 @@ interface HeaderSecondaryMenuContent {
10
13
  defaultLocation?: string;
11
14
  officesLink?: string;
12
15
  bgColor?: BgColorVersion;
16
+ foreignOffices?: ForeignOffice[];
13
17
  }
14
18
 
15
19
  export interface HeaderSecondaryMenuProps extends HeaderSecondaryMenuContent {
@@ -30,8 +34,23 @@ const LINKS_ICON_VERSION_MAP: Record<BgColorVersion, IconVersion> = {
30
34
  };
31
35
 
32
36
  export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
33
- ({ className, officesLink, defaultLocation = 'Москва', bgColor = 'bg-white' }) => {
34
- const [city, getCity] = useGeolocation(defaultLocation);
37
+ ({
38
+ className,
39
+ officesLink,
40
+ defaultLocation = 'Москва',
41
+ foreignOffices,
42
+ bgColor = 'bg-white',
43
+ }) => {
44
+ const [isShowLocationModal, setShowLocationModal] = useState<boolean>(false);
45
+
46
+ const [location, onChangeLocation] = useLocation(defaultLocation);
47
+
48
+ const showLocationModal = () => {
49
+ setShowLocationModal(true);
50
+ };
51
+ const hideLocationModal = () => {
52
+ setShowLocationModal(false);
53
+ };
35
54
 
36
55
  return (
37
56
  <div className={`flex items-center ${className || ''}`}>
@@ -39,9 +58,9 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
39
58
  className="mr-5"
40
59
  flat={true}
41
60
  href="#"
42
- text={city}
61
+ text={location.name}
43
62
  ariaLabel="Местоположение"
44
- onClick={getCity}
63
+ onClick={showLocationModal}
45
64
  bgColor={bgColor}
46
65
  />
47
66
  {officesLink ? (
@@ -76,6 +95,14 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
76
95
  asSVG
77
96
  />
78
97
  </HeaderSecondaryMenuButton>
98
+ {isShowLocationModal ? (
99
+ <Location
100
+ currentLocation={location}
101
+ foreignOffices={foreignOffices}
102
+ onChangeLocation={onChangeLocation}
103
+ close={hideLocationModal}
104
+ />
105
+ ) : null}
79
106
  </div>
80
107
  );
81
108
  },
@@ -8,7 +8,7 @@
8
8
  "button": {
9
9
  "icon": {
10
10
  "ui:field": "icon"
11
- },
11
+ },
12
12
  "iconRight": {
13
13
  "ui:field": "icon"
14
14
  }
@@ -12,14 +12,17 @@
12
12
  "version": "primary",
13
13
  "benefits": [
14
14
  {
15
+ "type": "default",
15
16
  "label": "Преимущество 1",
16
17
  "description": "Описание"
17
18
  },
18
19
  {
20
+ "type": "default",
19
21
  "label": "Преимущество 2",
20
22
  "description": "Описание"
21
23
  },
22
24
  {
25
+ "type": "default",
23
26
  "label": "Преимущество 3",
24
27
  "description": "Описание"
25
28
  }
@@ -1,14 +1,16 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { BlockVersion } from '../../model/BlockVersion';
3
- import { VersionAdditionalStyleMap, VersionStyleMap } from '../../model/BlockVersion';
3
+ import { VersionStyleMap } from '../../model/BlockVersion';
4
4
  import type { UniBlockProps } from '../../model/JSXBlock';
5
5
  import type { Picture } from '../../model/Picture';
6
6
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
7
7
  import { ButtonSection } from '../../ui-kit/Button/ButtonSection';
8
- import { Img } from '../../ui-kit/Img/Img';
9
8
  import { getTileRightPadding } from '../BaseTile/getTileRightPadding';
10
9
  import { Headline } from '../Headline/Headline';
11
- import type { ProductTileContent, TextBenefit } from './ProductTileContent';
10
+ import type { Benefit, ProductTileContent } from './ProductTileContent';
11
+ import { renderAdditionalDescription } from './renderAdditionalDescription';
12
+ import { renderBenefit } from './renderBenefit';
13
+ import { renderImage } from './renderImage';
12
14
 
13
15
  export interface ProductTileProps extends ProductTileContent, UniBlockProps {}
14
16
 
@@ -43,7 +45,7 @@ export const ProductTile = JSX<ProductTileProps>(
43
45
  {...rest}
44
46
  />
45
47
  {renderBenefits(benefits, version, image)}
46
- {additionalDescription ? renderAdditionalDescription(additionalDescription, image) : null}
48
+ {renderAdditionalDescription(additionalDescription, image)}
47
49
  {buttons?.length ? (
48
50
  <ButtonSection buttons={buttons} className="mt-5 gap-4 z-10 text-l" />
49
51
  ) : null}
@@ -53,53 +55,20 @@ export const ProductTile = JSX<ProductTileProps>(
53
55
  ),
54
56
  );
55
57
 
56
- function renderBenefits(benefits: TextBenefit[], version: BlockVersion, image?: Picture) {
58
+ function renderBenefits(benefits: Benefit[], version: BlockVersion, image?: Picture) {
59
+ if (!benefits.length) {
60
+ return null;
61
+ }
62
+
57
63
  // picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
58
- const BENEFITS_WIDTH = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
64
+ const benefitsWidth = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
59
65
 
60
66
  return (
61
67
  <div
62
68
  className={`z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline
63
- ${BENEFITS_WIDTH}`}
69
+ ${benefitsWidth}`}
64
70
  >
65
71
  {benefits.length ? benefits.map(renderBenefit(version)) : null}
66
72
  </div>
67
73
  );
68
74
  }
69
-
70
- const renderBenefit =
71
- (version: BlockVersion = 'primary') =>
72
- (benefit: TextBenefit, i: number) => {
73
- const { label = '', description = '' } = benefit;
74
-
75
- return [
76
- <div key={`label-${i}`} className="text-h6">
77
- {label}
78
- </div>,
79
- <div key={`desc-${i}`} className={`text-m-light ${VersionAdditionalStyleMap[version]}`}>
80
- {description}
81
- </div>,
82
- ];
83
- };
84
-
85
- function renderAdditionalDescription(additionalDescription: string, image?: Picture) {
86
- // picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
87
- const DESCRIPTION_WIDTH = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
88
-
89
- return (
90
- <div className={`text-m-light mt-2.5 z-10 ${DESCRIPTION_WIDTH}`}>{additionalDescription}</div>
91
- );
92
- }
93
-
94
- function renderImage(image?: Picture, isImageOnRightSide?: boolean) {
95
- if (!image?.src) {
96
- return null;
97
- }
98
-
99
- return (
100
- <Img
101
- className={`absolute ${isImageOnRightSide ? 'right-0' : 'left-0'} bottom-0`}
102
- image={image}
103
- />
104
- );
105
- }
@@ -1 +1,14 @@
1
- {}
1
+ {
2
+ "content": {
3
+ "benefits": {
4
+ "items": {
5
+ "md": {
6
+ "ui:widget": "html"
7
+ },
8
+ "type": {
9
+ "ui:widget": "hidden"
10
+ }
11
+ }
12
+ }
13
+ }
14
+ }
@@ -2,8 +2,32 @@ import type { BlockVersion } from '../../model/BlockVersion';
2
2
  import type { DescriptionProps, HeadlineProps, LabelProps } from '../../model/HeadlineType';
3
3
  import type { Picture } from '../../model/Picture';
4
4
  import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
5
+ import type { MarkdownTextProps } from '../../ui-kit/MarkdownText/MarkdownTextProps';
5
6
 
6
- export type TextBenefit = DescriptionProps & LabelProps;
7
+ /**
8
+ * @title Стандартный
9
+ */
10
+ type TextBenefit = DescriptionProps &
11
+ LabelProps & {
12
+ /** @default default */
13
+ type: 'default';
14
+ };
15
+
16
+ /**
17
+ * @title Форматированный текст
18
+ */
19
+ type MarkdownTextContent = MarkdownTextProps & {
20
+ /** @default md */
21
+ type: 'md';
22
+ };
23
+
24
+ /**
25
+ * @title Преимущество
26
+ * @default{
27
+ * "type": "default"
28
+ * }
29
+ */
30
+ export type Benefit = TextBenefit | MarkdownTextContent;
7
31
 
8
32
  /**
9
33
  * @title Продуктовая плитка
@@ -30,7 +54,7 @@ export type ProductTileContent = HeadlineProps &
30
54
  * @title Преимущества
31
55
  * @maxItems 7
32
56
  */
33
- benefits?: TextBenefit[];
57
+ benefits?: Benefit[];
34
58
  /** @title Дополнительное описание */
35
59
  additionalDescription?: string;
36
60
  /** @title Картинка справа/текст слева */
@@ -0,0 +1,30 @@
1
+ import type { BlockVersion } from '../../model/BlockVersion';
2
+ import type { Picture } from '../../model/Picture';
3
+ import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
4
+ import type { TextColor } from '../../ui-kit/Text/TextProps';
5
+
6
+ const DESCRIPTION_STYLE_MAP: Record<BlockVersion, TextColor> = {
7
+ primary: 'text-secondary-text',
8
+ secondary: 'text-white',
9
+ };
10
+
11
+ export function renderAdditionalDescription(
12
+ additionalDescription?: string,
13
+ image?: Picture,
14
+ version: BlockVersion = 'primary',
15
+ ) {
16
+ if (!additionalDescription) {
17
+ return null;
18
+ }
19
+
20
+ // picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
21
+ const descriptionWidth = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
22
+
23
+ return (
24
+ <div className={`mt-2.5 z-10 ${descriptionWidth}`}>
25
+ <Paragraph size="text-m" font="font-light" color={DESCRIPTION_STYLE_MAP[version]}>
26
+ {additionalDescription}
27
+ </Paragraph>
28
+ </div>
29
+ );
30
+ }
@@ -0,0 +1,39 @@
1
+ import type { BlockVersion } from '../../model/BlockVersion';
2
+ import { MarkdownText } from '../../ui-kit/MarkdownText/MarkdownText';
3
+ import { Text } from '../../ui-kit/Text/Text';
4
+ import type { TextColor } from '../../ui-kit/Text/TextProps';
5
+ import { assertUnreachable } from '../../utils/assertUnreachable';
6
+ import type { Benefit } from './ProductTileContent';
7
+
8
+ const LABEL_STYLE_MAP: Record<BlockVersion, TextColor> = {
9
+ primary: 'text-secondary-text',
10
+ secondary: 'text-white',
11
+ };
12
+
13
+ export const renderBenefit =
14
+ (version: BlockVersion = 'primary') =>
15
+ // Linter doesn't understand that switch processes all cases
16
+ // eslint-disable-next-line consistent-return
17
+ (benefit: Benefit, i: number) => {
18
+ const { type } = benefit;
19
+
20
+ if (!(type === 'default' || type === 'md')) {
21
+ return null;
22
+ }
23
+
24
+ switch (type) {
25
+ case 'default':
26
+ return [
27
+ <Text key={`label-${i}`} size="text-h6">
28
+ {benefit.label}
29
+ </Text>,
30
+ <Text key={`desc-${i}`} size="text-m-light" color={LABEL_STYLE_MAP[version]}>
31
+ {benefit.description}
32
+ </Text>,
33
+ ];
34
+ case 'md':
35
+ return <MarkdownText md={benefit.md} />;
36
+ default:
37
+ assertUnreachable(benefit);
38
+ }
39
+ };
@@ -0,0 +1,15 @@
1
+ import type { Picture } from '../../model/Picture';
2
+ import { Img } from '../../ui-kit/Img/Img';
3
+
4
+ export function renderImage(image?: Picture, isImageOnRightSide?: boolean) {
5
+ if (!image?.src) {
6
+ return null;
7
+ }
8
+
9
+ return (
10
+ <Img
11
+ className={`absolute ${isImageOnRightSide ? 'right-0' : 'left-0'} bottom-0`}
12
+ image={image}
13
+ />
14
+ );
15
+ }
@@ -28,11 +28,12 @@
28
28
  },
29
29
  "title": "Заголовок 2",
30
30
  "description": "Описание 2",
31
- "socialMedia": [
32
- { "href": "https://t.me" },
33
- { "href": "https://vk.com" },
34
- { "href": "https://ok.ru" }
35
- ]
31
+ "button": {
32
+ "href": "",
33
+ "text": "Подробнее",
34
+ "target": "_self",
35
+ "version": "primary"
36
+ }
36
37
  },
37
38
  {
38
39
  "image": {
@@ -4,6 +4,14 @@
4
4
  "items": {
5
5
  "image": {
6
6
  "ui:field": "picture"
7
+ },
8
+ "button": {
9
+ "icon": {
10
+ "ui:field": "icon"
11
+ },
12
+ "iconRight": {
13
+ "ui:field": "icon"
14
+ }
7
15
  }
8
16
  }
9
17
  }
@@ -41,7 +41,7 @@ export const RecommendationCard = JSX<RecommendationCardProps>(
41
41
  <SocialMedia className="pt-10 pb-0" media={socialMedia} version={version} />
42
42
  ) : null}
43
43
  {button?.text ? (
44
- <div className="pt-2">{renderButton({ button, buttonClassName: 'mt-16' })}</div>
44
+ <div className="pt-2">{renderButton({ button, buttonClassName: 'mt-16 px-5' })}</div>
45
45
  ) : null}
46
46
  </div>
47
47
  </BaseTile>
@@ -1,13 +1,13 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
- import util from 'util';
4
- import sharp from 'sharp';
5
3
  import type { ResizeOptions, Sharp } from 'sharp';
4
+ import sharp from 'sharp';
5
+ import util from 'util';
6
6
  import type { ImageSize } from '../model/ImageSize';
7
- import type { TransformationOptions } from './TransformationOptions';
8
7
  import type { ImgAlignment, ImgSource, Picture } from '../model/Picture';
9
- import { transformSrc } from './transformSrc';
10
8
  import { isPictureSizeEmpty } from '../utils/isPictureSizeEmpty';
9
+ import type { TransformationOptions } from './TransformationOptions';
10
+ import { transformSrc } from './transformSrc';
11
11
 
12
12
  const mkdir = util.promisify(fs.mkdir);
13
13
 
@@ -126,20 +126,12 @@ function getCompositionResizeSize(
126
126
  const { width, height } = size;
127
127
  const { width: containerWidth, height: containerHeight } = containerSize;
128
128
 
129
- let widthRatio = 0;
130
- let heightRatio = 0;
131
-
132
129
  if (!(width || height)) {
133
130
  return undefined;
134
131
  }
135
132
 
136
- if (width) {
137
- widthRatio = containerWidth / width;
138
- }
139
-
140
- if (height) {
141
- heightRatio = containerHeight / height;
142
- }
133
+ const widthRatio = width ? containerWidth / width : 0;
134
+ const heightRatio = height ? containerHeight / height : 0;
143
135
 
144
136
  return widthRatio > heightRatio
145
137
  ? { width: Math.min(Number(width), containerWidth) }
@@ -1,6 +1,6 @@
1
- import { unified } from 'unified';
2
- import remarkParse from 'remark-parse';
3
1
  import remarkHtml from 'remark-html';
2
+ import remarkParse from 'remark-parse';
3
+ import { unified } from 'unified';
4
4
 
5
5
  export async function transformMarkdown(markdown: string | null | undefined): Promise<string> {
6
6
  if (!markdown) {
@@ -9,5 +9,5 @@ export async function transformMarkdown(markdown: string | null | undefined): Pr
9
9
 
10
10
  const result = await unified().use(remarkParse).use(remarkHtml).process(markdown);
11
11
 
12
- return result.toString('utf-8');
12
+ return result.toString('utf-8').replaceAll(/<h(\d)>([^<]*)<\/h\d>/g, '<p class="h$1">$2</p>');
13
13
  }
@@ -0,0 +1,37 @@
1
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
2
+ import type { AsyncDataResponse, Fetcher } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
3
+ import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
4
+
5
+ const STORAGE_DEFAULT_TTL = 86400000; // 24 * 60 * 60 * 1000
6
+
7
+ export function useCachedAsyncData<Data = any>(
8
+ key: string,
9
+ fetcher: Fetcher<Data, string>,
10
+ storage: any = globalThis?.localStorage,
11
+ ): AsyncDataResponse<Data> {
12
+ const cachedFetcher: typeof fetcher = useCallback(
13
+ async (...args) => {
14
+ const storageKey = `async:${key}`;
15
+ const storageData: string = storage.getItem(storageKey);
16
+
17
+ const cachedData = getParsedData(storageData);
18
+ if (cachedData) {
19
+ return cachedData;
20
+ }
21
+
22
+ const data = await fetcher(...args);
23
+ storage.setItem(storageKey, JSON.stringify({ data, timestamp: Date.now() }));
24
+
25
+ return data;
26
+ },
27
+ [key, fetcher],
28
+ );
29
+
30
+ return useAsyncData(key, cachedFetcher);
31
+ }
32
+
33
+ function getParsedData(storageData: string) {
34
+ const { data = null, timestamp = null } = storageData ? JSON.parse(storageData) : {};
35
+
36
+ return data && Date.now() - timestamp < STORAGE_DEFAULT_TTL ? data : undefined;
37
+ }