@gravity-ui/page-constructor 4.1.2 → 4.3.12-alpha.3

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 (318) hide show
  1. package/README.md +4 -0
  2. package/build/cjs/blocks/CardLayout/CardLayout.d.ts +2 -2
  3. package/build/cjs/blocks/CardLayout/CardLayout.js +1 -1
  4. package/build/cjs/blocks/ContentLayout/schema.d.ts +38 -0
  5. package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +7 -3
  6. package/build/cjs/blocks/Header/Header.css +0 -6
  7. package/build/cjs/blocks/Icons/Icons.js +7 -1
  8. package/build/cjs/blocks/Icons/schema.d.ts +162 -0
  9. package/build/cjs/blocks/Icons/schema.js +11 -0
  10. package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +1 -1
  11. package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.css +50 -0
  12. package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.d.ts +2 -0
  13. package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +27 -0
  14. package/build/cjs/blocks/Questions/Questions.css +0 -48
  15. package/build/cjs/blocks/Questions/Questions.js +7 -27
  16. package/build/cjs/blocks/Questions/models.d.ts +10 -0
  17. package/build/cjs/blocks/Questions/models.js +13 -0
  18. package/build/cjs/blocks/Slider/Arrow/Arrow.js +2 -1
  19. package/build/cjs/blocks/Slider/Slider.css +4 -1
  20. package/build/cjs/blocks/Slider/Slider.js +32 -6
  21. package/build/cjs/blocks/Slider/i18n/en.json +4 -0
  22. package/build/cjs/blocks/Slider/i18n/index.d.ts +2 -0
  23. package/build/cjs/blocks/Slider/i18n/index.js +8 -0
  24. package/build/cjs/blocks/Slider/i18n/ru.json +4 -0
  25. package/build/cjs/components/BackLink/BackLink.d.ts +2 -1
  26. package/build/cjs/components/BackLink/BackLink.js +2 -2
  27. package/build/cjs/components/BackgroundImage/BackgroundImage.d.ts +1 -0
  28. package/build/cjs/components/BackgroundImage/BackgroundImage.js +5 -2
  29. package/build/cjs/components/BackgroundMedia/BackgroundMedia.d.ts +1 -1
  30. package/build/cjs/components/BackgroundMedia/BackgroundMedia.js +4 -3
  31. package/build/cjs/components/ButtonTabs/ButtonTabs.js +6 -1
  32. package/build/cjs/components/CardBase/CardBase.css +4 -4
  33. package/build/cjs/components/FileLink/FileLink.js +2 -2
  34. package/build/cjs/components/FullscreenImage/FullscreenImage.js +1 -1
  35. package/build/cjs/components/FullscreenImage/i18n/en.json +2 -1
  36. package/build/cjs/components/FullscreenImage/i18n/ru.json +2 -1
  37. package/build/cjs/components/HTML/HTML.d.ts +5 -1
  38. package/build/cjs/components/HTML/HTML.js +3 -1
  39. package/build/cjs/components/Image/Image.js +7 -5
  40. package/build/cjs/components/Image/i18n/en.json +1 -1
  41. package/build/cjs/components/Image/i18n/ru.json +1 -1
  42. package/build/cjs/components/Image/schema.d.ts +19 -0
  43. package/build/cjs/components/Image/schema.js +12 -1
  44. package/build/cjs/components/Link/Link.d.ts +3 -2
  45. package/build/cjs/components/Link/Link.js +8 -6
  46. package/build/cjs/components/Media/Image/Image.d.ts +3 -2
  47. package/build/cjs/components/Media/Image/Image.js +8 -5
  48. package/build/cjs/components/Media/Media.d.ts +2 -2
  49. package/build/cjs/components/Media/Media.js +9 -7
  50. package/build/cjs/components/Media/Video/Video.d.ts +2 -2
  51. package/build/cjs/components/Media/Video/Video.js +15 -6
  52. package/build/cjs/components/MetaInfo/MetaInfo.css +0 -2
  53. package/build/cjs/components/MetaInfo/MetaInfo.js +2 -1
  54. package/build/cjs/components/ReactPlayer/CustomBarControls.css +46 -14
  55. package/build/cjs/components/ReactPlayer/CustomBarControls.d.ts +4 -1
  56. package/build/cjs/components/ReactPlayer/CustomBarControls.js +33 -9
  57. package/build/cjs/components/ReactPlayer/ReactPlayer.css +12 -0
  58. package/build/cjs/components/ReactPlayer/ReactPlayer.js +52 -27
  59. package/build/cjs/components/ReactPlayer/i18n/en.json +6 -0
  60. package/build/cjs/components/ReactPlayer/i18n/index.d.ts +2 -0
  61. package/build/cjs/components/ReactPlayer/i18n/index.js +8 -0
  62. package/build/cjs/components/ReactPlayer/i18n/ru.json +6 -0
  63. package/build/cjs/components/Table/Table.js +11 -5
  64. package/build/cjs/components/VideoBlock/VideoBlock.js +7 -6
  65. package/build/cjs/components/YFMWrapper/YFMWrapper.d.ts +4 -3
  66. package/build/cjs/components/YFMWrapper/YFMWrapper.js +3 -3
  67. package/build/cjs/components/constants.d.ts +0 -4
  68. package/build/cjs/components/constants.js +1 -5
  69. package/build/cjs/constructor-items.d.ts +10 -3
  70. package/build/cjs/constructor-items.js +11 -1
  71. package/build/cjs/containers/Loadable/Loadable.js +2 -2
  72. package/build/cjs/containers/PageConstructor/PageConstructor.css +4 -0
  73. package/build/cjs/containers/PageConstructor/PageConstructor.d.ts +2 -1
  74. package/build/cjs/containers/PageConstructor/PageConstructor.js +10 -6
  75. package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.css +38 -0
  76. package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +3 -2
  77. package/build/cjs/context/innerContext/InnerContext.d.ts +3 -1
  78. package/build/cjs/context/innerContext/InnerContext.js +2 -0
  79. package/build/cjs/editor/components/AddBlock/AddBlock.css +1 -1
  80. package/build/cjs/editor/components/EditBlock/EditBlock.css +1 -0
  81. package/build/cjs/editor/components/Layout/Layout.css +2 -1
  82. package/build/cjs/editor/containers/Form/Form.css +14 -35
  83. package/build/cjs/editor/store/index.js +1 -1
  84. package/build/cjs/editor/styles/root.css +2 -1
  85. package/build/cjs/editor/utils/index.d.ts +1 -0
  86. package/build/cjs/grid/Col/Col.d.ts +3 -4
  87. package/build/cjs/grid/Col/Col.js +2 -2
  88. package/build/cjs/icons/Mute.d.ts +2 -0
  89. package/build/cjs/icons/Mute.js +12 -0
  90. package/build/cjs/icons/MuteSmall.d.ts +2 -0
  91. package/build/cjs/icons/MuteSmall.js +15 -0
  92. package/build/cjs/icons/Unmute.d.ts +2 -0
  93. package/build/cjs/icons/Unmute.js +12 -0
  94. package/build/cjs/icons/UnmuteSmall.d.ts +2 -0
  95. package/build/cjs/icons/UnmuteSmall.js +17 -0
  96. package/build/cjs/icons/VideoControlPause.d.ts +2 -0
  97. package/build/cjs/icons/VideoControlPause.js +16 -0
  98. package/build/cjs/icons/VideoControlPlay.d.ts +2 -0
  99. package/build/cjs/icons/VideoControlPlay.js +12 -0
  100. package/build/cjs/models/constructor-items/blocks.d.ts +16 -5
  101. package/build/cjs/models/constructor-items/common.d.ts +22 -36
  102. package/build/cjs/models/constructor-items/common.js +6 -1
  103. package/build/cjs/models/constructor-items/sub-blocks.d.ts +4 -4
  104. package/build/cjs/models/constructor.d.ts +7 -1
  105. package/build/cjs/models/navigation.d.ts +1 -0
  106. package/build/cjs/models/navigation.js +2 -1
  107. package/build/cjs/navigation/components/MobileMenuButton/MobileMenuButton.js +1 -0
  108. package/build/cjs/navigation/components/NavigationItem/NavigationItem.css +1 -1
  109. package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +4 -16
  110. package/build/cjs/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.js +1 -1
  111. package/build/cjs/navigation/components/NavigationItem/index.d.ts +6 -0
  112. package/build/cjs/navigation/components/NavigationItem/index.js +14 -0
  113. package/build/cjs/navigation/components/NavigationListItem/NavigationListItem.js +1 -1
  114. package/build/cjs/navigation/components/NavigationPopup/NavigationPopup.js +1 -1
  115. package/build/cjs/navigation/components/SocialIcon/SocialIcon.js +2 -1
  116. package/build/cjs/schema/constants.d.ts +181 -78
  117. package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +2 -3
  118. package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +100 -0
  119. package/build/cjs/sub-blocks/BackgroundCard/schema.js +10 -0
  120. package/build/cjs/sub-blocks/Content/Content.d.ts +3 -1
  121. package/build/cjs/sub-blocks/Content/Content.js +7 -5
  122. package/build/cjs/sub-blocks/Content/ContentList/ContentList.d.ts +2 -1
  123. package/build/cjs/sub-blocks/Content/ContentList/ContentList.js +17 -5
  124. package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +2 -2
  125. package/build/cjs/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
  126. package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +3 -3
  127. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +81 -0
  128. package/build/cjs/sub-blocks/LayoutItem/schema.js +10 -0
  129. package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +1 -0
  130. package/build/cjs/sub-blocks/MediaCard/MediaCard.d.ts +1 -1
  131. package/build/cjs/sub-blocks/MediaCard/MediaCard.js +2 -2
  132. package/build/cjs/sub-blocks/MediaCard/schema.d.ts +81 -78
  133. package/build/cjs/sub-blocks/MediaCard/schema.js +11 -1
  134. package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.d.ts +2 -2
  135. package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js +2 -2
  136. package/build/cjs/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js +7 -4
  137. package/build/cjs/sub-blocks/PriceDetailed/schema.js +11 -1
  138. package/build/cjs/sub-blocks/Quote/Quote.css +0 -3
  139. package/build/cjs/text-transform/common.d.ts +7 -2
  140. package/build/cjs/text-transform/common.js +8 -2
  141. package/build/cjs/text-transform/config.js +1 -1
  142. package/build/cjs/text-transform/transformers.d.ts +2 -0
  143. package/build/cjs/text-transform/transformers.js +11 -8
  144. package/build/cjs/utils/blocks.d.ts +4 -7
  145. package/build/cjs/utils/blocks.js +27 -18
  146. package/build/cjs/utils/cn.d.ts +3 -3
  147. package/build/cjs/utils/cn.js +4 -7
  148. package/build/esm/blocks/CardLayout/CardLayout.d.ts +2 -2
  149. package/build/esm/blocks/CardLayout/CardLayout.js +1 -1
  150. package/build/esm/blocks/ContentLayout/schema.d.ts +38 -0
  151. package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +7 -3
  152. package/build/esm/blocks/Header/Header.css +0 -6
  153. package/build/esm/blocks/Icons/Icons.js +8 -2
  154. package/build/esm/blocks/Icons/schema.d.ts +162 -0
  155. package/build/esm/blocks/Icons/schema.js +11 -0
  156. package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +1 -1
  157. package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.css +50 -0
  158. package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.d.ts +3 -0
  159. package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +23 -0
  160. package/build/esm/blocks/Questions/Questions.css +0 -48
  161. package/build/esm/blocks/Questions/Questions.js +6 -26
  162. package/build/esm/blocks/Questions/models.d.ts +10 -0
  163. package/build/esm/blocks/Questions/models.js +10 -0
  164. package/build/esm/blocks/Slider/Arrow/Arrow.js +2 -1
  165. package/build/esm/blocks/Slider/Slider.css +4 -1
  166. package/build/esm/blocks/Slider/Slider.js +33 -7
  167. package/build/esm/blocks/Slider/i18n/en.json +4 -0
  168. package/build/esm/blocks/Slider/i18n/index.d.ts +2 -0
  169. package/build/esm/blocks/Slider/i18n/index.js +5 -0
  170. package/build/esm/blocks/Slider/i18n/ru.json +4 -0
  171. package/build/esm/components/BackLink/BackLink.d.ts +2 -1
  172. package/build/esm/components/BackLink/BackLink.js +2 -2
  173. package/build/esm/components/BackgroundImage/BackgroundImage.d.ts +1 -0
  174. package/build/esm/components/BackgroundImage/BackgroundImage.js +5 -3
  175. package/build/esm/components/BackgroundMedia/BackgroundMedia.d.ts +1 -1
  176. package/build/esm/components/BackgroundMedia/BackgroundMedia.js +5 -4
  177. package/build/esm/components/ButtonTabs/ButtonTabs.js +6 -1
  178. package/build/esm/components/CardBase/CardBase.css +4 -4
  179. package/build/esm/components/FileLink/FileLink.js +2 -2
  180. package/build/esm/components/FullscreenImage/FullscreenImage.js +1 -1
  181. package/build/esm/components/FullscreenImage/i18n/en.json +2 -1
  182. package/build/esm/components/FullscreenImage/i18n/ru.json +2 -1
  183. package/build/esm/components/HTML/HTML.d.ts +5 -1
  184. package/build/esm/components/HTML/HTML.js +3 -1
  185. package/build/esm/components/Image/Image.js +7 -5
  186. package/build/esm/components/Image/i18n/en.json +1 -1
  187. package/build/esm/components/Image/i18n/ru.json +1 -1
  188. package/build/esm/components/Image/schema.d.ts +19 -0
  189. package/build/esm/components/Image/schema.js +12 -1
  190. package/build/esm/components/Link/Link.d.ts +3 -2
  191. package/build/esm/components/Link/Link.js +9 -7
  192. package/build/esm/components/Media/Image/Image.d.ts +3 -2
  193. package/build/esm/components/Media/Image/Image.js +8 -6
  194. package/build/esm/components/Media/Media.d.ts +2 -2
  195. package/build/esm/components/Media/Media.js +10 -8
  196. package/build/esm/components/Media/Video/Video.d.ts +2 -2
  197. package/build/esm/components/Media/Video/Video.js +16 -7
  198. package/build/esm/components/MetaInfo/MetaInfo.css +0 -2
  199. package/build/esm/components/MetaInfo/MetaInfo.js +2 -1
  200. package/build/esm/components/ReactPlayer/CustomBarControls.css +46 -14
  201. package/build/esm/components/ReactPlayer/CustomBarControls.d.ts +4 -1
  202. package/build/esm/components/ReactPlayer/CustomBarControls.js +34 -10
  203. package/build/esm/components/ReactPlayer/ReactPlayer.css +12 -0
  204. package/build/esm/components/ReactPlayer/ReactPlayer.js +55 -30
  205. package/build/esm/components/ReactPlayer/i18n/en.json +6 -0
  206. package/build/esm/components/ReactPlayer/i18n/index.d.ts +2 -0
  207. package/build/esm/components/ReactPlayer/i18n/index.js +5 -0
  208. package/build/esm/components/ReactPlayer/i18n/ru.json +6 -0
  209. package/build/esm/components/Table/Table.js +11 -5
  210. package/build/esm/components/VideoBlock/VideoBlock.js +7 -6
  211. package/build/esm/components/YFMWrapper/YFMWrapper.d.ts +4 -3
  212. package/build/esm/components/YFMWrapper/YFMWrapper.js +3 -3
  213. package/build/esm/components/constants.d.ts +0 -4
  214. package/build/esm/components/constants.js +0 -4
  215. package/build/esm/constructor-items.d.ts +10 -3
  216. package/build/esm/constructor-items.js +10 -1
  217. package/build/esm/containers/Loadable/Loadable.js +1 -1
  218. package/build/esm/containers/PageConstructor/PageConstructor.css +4 -0
  219. package/build/esm/containers/PageConstructor/PageConstructor.d.ts +2 -1
  220. package/build/esm/containers/PageConstructor/PageConstructor.js +12 -8
  221. package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.css +38 -0
  222. package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts +1 -0
  223. package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +4 -2
  224. package/build/esm/context/innerContext/InnerContext.d.ts +3 -1
  225. package/build/esm/context/innerContext/InnerContext.js +2 -0
  226. package/build/esm/editor/components/AddBlock/AddBlock.css +1 -1
  227. package/build/esm/editor/components/EditBlock/EditBlock.css +1 -0
  228. package/build/esm/editor/components/Layout/Layout.css +2 -1
  229. package/build/esm/editor/containers/Form/Form.css +14 -35
  230. package/build/esm/editor/store/index.js +2 -2
  231. package/build/esm/editor/styles/root.css +2 -1
  232. package/build/esm/editor/utils/index.d.ts +1 -0
  233. package/build/esm/grid/Col/Col.d.ts +3 -4
  234. package/build/esm/grid/Col/Col.js +2 -2
  235. package/build/esm/icons/Mute.d.ts +2 -0
  236. package/build/esm/icons/Mute.js +7 -0
  237. package/build/esm/icons/MuteSmall.d.ts +2 -0
  238. package/build/esm/icons/MuteSmall.js +10 -0
  239. package/build/esm/icons/Unmute.d.ts +2 -0
  240. package/build/esm/icons/Unmute.js +7 -0
  241. package/build/esm/icons/UnmuteSmall.d.ts +2 -0
  242. package/build/esm/icons/UnmuteSmall.js +12 -0
  243. package/build/esm/icons/VideoControlPause.d.ts +2 -0
  244. package/build/esm/icons/VideoControlPause.js +11 -0
  245. package/build/esm/icons/VideoControlPlay.d.ts +2 -0
  246. package/build/esm/icons/VideoControlPlay.js +7 -0
  247. package/build/esm/models/constructor-items/blocks.d.ts +16 -5
  248. package/build/esm/models/constructor-items/common.d.ts +22 -36
  249. package/build/esm/models/constructor-items/common.js +5 -0
  250. package/build/esm/models/constructor-items/sub-blocks.d.ts +4 -4
  251. package/build/esm/models/constructor.d.ts +7 -1
  252. package/build/esm/models/navigation.d.ts +1 -0
  253. package/build/esm/models/navigation.js +1 -0
  254. package/build/esm/navigation/components/MobileMenuButton/MobileMenuButton.js +1 -0
  255. package/build/esm/navigation/components/NavigationItem/NavigationItem.css +1 -1
  256. package/build/esm/navigation/components/NavigationItem/NavigationItem.js +5 -17
  257. package/build/esm/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.js +1 -1
  258. package/build/esm/navigation/components/NavigationItem/index.d.ts +6 -0
  259. package/build/esm/navigation/components/NavigationItem/index.js +6 -0
  260. package/build/esm/navigation/components/NavigationListItem/NavigationListItem.js +1 -1
  261. package/build/esm/navigation/components/NavigationPopup/NavigationPopup.js +1 -1
  262. package/build/esm/navigation/components/SocialIcon/SocialIcon.js +2 -1
  263. package/build/esm/schema/constants.d.ts +181 -78
  264. package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +2 -3
  265. package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +100 -0
  266. package/build/esm/sub-blocks/BackgroundCard/schema.js +10 -0
  267. package/build/esm/sub-blocks/Content/Content.d.ts +3 -1
  268. package/build/esm/sub-blocks/Content/Content.js +7 -5
  269. package/build/esm/sub-blocks/Content/ContentList/ContentList.d.ts +2 -1
  270. package/build/esm/sub-blocks/Content/ContentList/ContentList.js +17 -5
  271. package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +2 -2
  272. package/build/esm/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
  273. package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +3 -3
  274. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +81 -0
  275. package/build/esm/sub-blocks/LayoutItem/schema.js +10 -0
  276. package/build/esm/sub-blocks/LayoutItem/utils.d.ts +1 -0
  277. package/build/esm/sub-blocks/MediaCard/MediaCard.d.ts +1 -1
  278. package/build/esm/sub-blocks/MediaCard/MediaCard.js +2 -2
  279. package/build/esm/sub-blocks/MediaCard/schema.d.ts +81 -78
  280. package/build/esm/sub-blocks/MediaCard/schema.js +11 -1
  281. package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.d.ts +2 -2
  282. package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js +2 -2
  283. package/build/esm/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js +8 -4
  284. package/build/esm/sub-blocks/PriceDetailed/schema.js +11 -1
  285. package/build/esm/sub-blocks/Quote/Quote.css +0 -3
  286. package/build/esm/text-transform/common.d.ts +7 -2
  287. package/build/esm/text-transform/common.js +7 -2
  288. package/build/esm/text-transform/config.js +1 -1
  289. package/build/esm/text-transform/transformers.d.ts +2 -0
  290. package/build/esm/text-transform/transformers.js +11 -8
  291. package/build/esm/utils/blocks.d.ts +4 -7
  292. package/build/esm/utils/blocks.js +23 -13
  293. package/build/esm/utils/cn.d.ts +3 -3
  294. package/build/esm/utils/cn.js +3 -4
  295. package/package.json +7 -7
  296. package/server/components/constants.d.ts +0 -4
  297. package/server/components/constants.js +1 -5
  298. package/server/models/constructor-items/blocks.d.ts +16 -5
  299. package/server/models/constructor-items/common.d.ts +22 -36
  300. package/server/models/constructor-items/common.js +6 -1
  301. package/server/models/constructor-items/sub-blocks.d.ts +4 -4
  302. package/server/models/constructor.d.ts +7 -1
  303. package/server/models/navigation.d.ts +1 -0
  304. package/server/models/navigation.js +2 -1
  305. package/server/text-transform/common.d.ts +7 -2
  306. package/server/text-transform/common.js +10 -2
  307. package/server/text-transform/config.js +1 -1
  308. package/server/text-transform/transformers.d.ts +2 -0
  309. package/server/text-transform/transformers.js +11 -8
  310. package/server/utils/blocks.d.ts +4 -7
  311. package/server/utils/blocks.js +27 -18
  312. package/server/utils/cn.d.ts +3 -3
  313. package/server/utils/cn.js +4 -9
  314. package/styles/mixins.scss +4 -1
  315. package/styles/storybook/common.scss +2 -0
  316. package/styles/styles.css +4 -0
  317. package/styles/yfm.scss +7 -0
  318. package/widget/index.js +1 -1
@@ -2,17 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.contentTransformer = void 0;
4
4
  const tslib_1 = require("tslib");
5
- /* eslint-disable no-param-reassign */
6
- /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
7
5
  const lodash_1 = tslib_1.__importDefault(require("lodash"));
8
6
  const config_1 = require("./config");
9
7
  const filter_1 = require("./filter");
10
- function transformBlocks(blocks, lang, customConfig = {}) {
8
+ function transformBlocks(blocks, lang, customConfig = {}, options = {}) {
11
9
  const fullConfig = Object.assign(Object.assign({}, config_1.config), customConfig);
10
+ const { plugins = [] } = options;
12
11
  const clonedBlocks = lodash_1.default.cloneDeep(blocks);
13
- return clonedBlocks.map((block) => transformBlock(lang, fullConfig, block));
12
+ return clonedBlocks.map((block) => transformBlock(lang, fullConfig, block, plugins));
14
13
  }
15
- function transformBlock(lang, blocksConfig, block) {
14
+ function transformBlock(lang, blocksConfig, block, plugins) {
16
15
  const blockConfig = blocksConfig[block.type];
17
16
  if (block) {
18
17
  if ('randomOrder' in block && block.randomOrder && 'children' in block && block.children) {
@@ -23,7 +22,9 @@ function transformBlock(lang, blocksConfig, block) {
23
22
  const configs = Array.isArray(blockConfig) ? blockConfig : [blockConfig];
24
23
  configs.forEach((transformConfig) => {
25
24
  const { fields, transformer: transformerRaw, parser } = transformConfig;
26
- const transformer = transformerRaw.bind(null, lang);
25
+ const transformer = (content) =>
26
+ // eslint-disable-next-line no-useless-call
27
+ transformerRaw.call(null, lang, content, { plugins });
27
28
  if (fields) {
28
29
  fields.forEach((field) => {
29
30
  if (block[field]) {
@@ -47,9 +48,11 @@ function transformBlock(lang, blocksConfig, block) {
47
48
  return block;
48
49
  }
49
50
  const contentTransformer = ({ content, options }) => {
50
- const { lang, customConfig = {}, vars } = options;
51
+ const { lang, customConfig = {}, vars, plugins = [] } = options;
51
52
  const { blocks = [] } = (vars ? (0, filter_1.filterContent)(content, vars) : content);
52
- const transformedBlocks = transformBlocks(blocks, lang, customConfig);
53
+ const transformedBlocks = transformBlocks(blocks, lang, customConfig, {
54
+ plugins,
55
+ });
53
56
  return {
54
57
  blocks: transformedBlocks,
55
58
  };
@@ -1,13 +1,10 @@
1
1
  import { ConstructorBlock, CustomConfig, PCShareSocialNetwork, TextSize } from '../models';
2
- export declare function getHeaderTag(size: TextSize): "h1" | "h2" | "h4" | "h5";
2
+ export declare function getHeaderTag(size: TextSize): "h1" | "h2" | "h3" | "h4";
3
3
  export declare function hasBlockTag(content: string): boolean;
4
4
  export declare function getBlockKey(block: ConstructorBlock, index: number): string;
5
- export declare const getCustomBlockTypes: ({ blocks, headers }?: CustomConfig) => string[];
6
- export declare const getCustomItems: ({ blocks, headers, subBlocks }?: CustomConfig) => {
7
- [x: string]: any;
8
- };
9
- export declare const getCustomSubBlockTypes: (customBlocks?: CustomConfig) => string[];
10
- export declare const getCustomHeaderTypes: (customBlocks?: CustomConfig) => string[];
5
+ export declare const getCustomItems: (types: (keyof CustomConfig)[], customBlocks?: CustomConfig) => {};
6
+ export declare const getCustomTypes: (types: (keyof CustomConfig)[], customBlocks?: CustomConfig) => string[];
11
7
  export declare const getOrderedBlocks: (blocks: ConstructorBlock[], headerBlockTypes?: string[]) => ConstructorBlock[];
12
8
  export declare const getHeaderBlock: (blocks: ConstructorBlock[], headerBlockTypes?: string[]) => ConstructorBlock | undefined;
13
9
  export declare const getShareLink: (url: string, type: PCShareSocialNetwork, title?: string, text?: string) => string | undefined;
10
+ export declare const getQaAttrubutes: (qa?: string, ...customKeys: (string | Array<string>)[]) => Record<string, string>;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getShareLink = exports.getHeaderBlock = exports.getOrderedBlocks = exports.getCustomHeaderTypes = exports.getCustomSubBlockTypes = exports.getCustomItems = exports.getCustomBlockTypes = exports.getBlockKey = exports.hasBlockTag = exports.getHeaderTag = void 0;
3
+ exports.getQaAttrubutes = exports.getShareLink = exports.getHeaderBlock = exports.getOrderedBlocks = exports.getCustomTypes = exports.getCustomItems = exports.getBlockKey = exports.hasBlockTag = exports.getHeaderTag = void 0;
4
+ const lodash_1 = require("lodash");
4
5
  const models_1 = require("../models");
5
6
  const BLOCK_ELEMENTS = [
6
7
  'div',
@@ -39,14 +40,15 @@ const BLOCK_ELEMENTS = [
39
40
  'td',
40
41
  ];
41
42
  const BLOCK_ELEMENTS_REGEX = `<(${BLOCK_ELEMENTS.join('|')})[^>]*>`;
43
+ const QA_ATTRIBUTES_KEYS = ['container', 'content', 'wrapper', 'image', 'button', 'animate'];
42
44
  function getHeaderTag(size) {
43
45
  switch (size) {
44
46
  case 'l':
45
47
  return 'h1';
46
48
  case 's':
47
- return 'h4';
49
+ return 'h3';
48
50
  case 'xs':
49
- return 'h5';
51
+ return 'h4';
50
52
  case 'm':
51
53
  default:
52
54
  return 'h2';
@@ -62,23 +64,18 @@ function getBlockKey(block, index) {
62
64
  return `${block.type}-${index}`;
63
65
  }
64
66
  exports.getBlockKey = getBlockKey;
65
- const getCustomBlockTypes = ({ blocks = {}, headers = {} } = {}) => [
66
- ...Object.keys(blocks),
67
- ...Object.keys(headers),
68
- ];
69
- exports.getCustomBlockTypes = getCustomBlockTypes;
70
- const getCustomItems = ({ blocks = {}, headers = {}, subBlocks = {} } = {}) => (Object.assign(Object.assign(Object.assign({}, blocks), headers), subBlocks));
71
- exports.getCustomItems = getCustomItems;
72
- const getCustomSubBlockTypes = (customBlocks = {}) => {
73
- const { subBlocks = {} } = customBlocks;
74
- return Object.keys(subBlocks);
67
+ const getCustomItems = (types, customBlocks = {}) => {
68
+ return types.reduce((result, type) => {
69
+ return Object.assign(result, customBlocks[type] || {});
70
+ }, {});
75
71
  };
76
- exports.getCustomSubBlockTypes = getCustomSubBlockTypes;
77
- const getCustomHeaderTypes = (customBlocks = {}) => {
78
- const { headers = {} } = customBlocks;
79
- return Object.keys(headers);
72
+ exports.getCustomItems = getCustomItems;
73
+ const getCustomTypes = (types, customBlocks = {}) => {
74
+ return types.reduce((result, type) => {
75
+ return result.concat(Object.keys(customBlocks[type] || {}));
76
+ }, []);
80
77
  };
81
- exports.getCustomHeaderTypes = getCustomHeaderTypes;
78
+ exports.getCustomTypes = getCustomTypes;
82
79
  const getShareUrlWithParams = (url, params = {}) => {
83
80
  const result = new URL(url);
84
81
  Object.entries(params).forEach(([name, value]) => {
@@ -125,3 +122,15 @@ const getShareLink = (url, type, title, text) => {
125
122
  }
126
123
  };
127
124
  exports.getShareLink = getShareLink;
125
+ const getQaAttrubutes = (qa, ...customKeys) => {
126
+ const attributes = {};
127
+ if (qa) {
128
+ const keys = QA_ATTRIBUTES_KEYS.concat((0, lodash_1.flatten)(customKeys));
129
+ keys.forEach((key) => {
130
+ attributes[(0, lodash_1.camelCase)(key)] = `${qa}-${key}`;
131
+ });
132
+ attributes.default = qa;
133
+ }
134
+ return attributes;
135
+ };
136
+ exports.getQaAttrubutes = getQaAttrubutes;
@@ -1,4 +1,4 @@
1
- import blockOrigin from 'bem-cn-lite';
2
1
  export declare const NAMESPACE = "pc-";
3
- export type CnBlock = ReturnType<typeof blockOrigin>;
4
- export declare function block(name: string): CnBlock;
2
+ export declare const cn: import("@bem-react/classname").ClassNameInitilizer;
3
+ export declare const block: import("@bem-react/classname").ClassNameInitilizer;
4
+ export type CnBlock = ReturnType<typeof cn>;
@@ -1,10 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.block = exports.NAMESPACE = void 0;
4
- const tslib_1 = require("tslib");
5
- const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
3
+ exports.block = exports.cn = exports.NAMESPACE = void 0;
4
+ const classname_1 = require("@bem-react/classname");
6
5
  exports.NAMESPACE = 'pc-';
7
- function block(name) {
8
- return (0, bem_cn_lite_1.default)(`${exports.NAMESPACE}${name}`);
9
- }
10
- exports.block = block;
6
+ exports.cn = (0, classname_1.withNaming)({ e: '__', m: '_' });
7
+ exports.block = (0, classname_1.withNaming)({ n: exports.NAMESPACE, e: '__', m: '_' });
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { CardLayoutBlockProps as CardLayoutBlockParams, WithChildren } from '../../models';
2
+ import { CardLayoutBlockProps as CardLayoutBlockParams, ClassNameProps, WithChildren } from '../../models';
3
3
  import './CardLayout.css';
4
- export type CardLayoutBlockProps = WithChildren<Omit<CardLayoutBlockParams, 'children'>>;
4
+ export type CardLayoutBlockProps = WithChildren<Omit<CardLayoutBlockParams, 'children'>> & ClassNameProps;
5
5
  declare const CardLayout: React.FC<CardLayoutBlockProps>;
6
6
  export default CardLayout;
@@ -9,7 +9,7 @@ const DEFAULT_SIZES = {
9
9
  md: 4,
10
10
  };
11
11
  const b = block('card-layout-block');
12
- const CardLayout = ({ title, description, animated, colSizes = DEFAULT_SIZES, children, }) => (React.createElement(AnimateBlock, { className: b(), animate: animated },
12
+ const CardLayout = ({ title, description, animated, colSizes = DEFAULT_SIZES, children, className, }) => (React.createElement(AnimateBlock, { className: b(null, className), animate: animated },
13
13
  (title || description) && React.createElement(Title, { title: title, subtitle: description }),
14
14
  React.createElement(Row, null, React.Children.map(children, (child, index) => (React.createElement(Col, { key: index, sizes: colSizes, className: b('item') }, child))))));
15
15
  export default CardLayout;
@@ -15,6 +15,25 @@ export declare const ContentLayoutBlock: {
15
15
  type: string;
16
16
  pattern: string;
17
17
  };
18
+ style: {
19
+ type: string;
20
+ additionalProperties: boolean;
21
+ required: never[];
22
+ properties: {
23
+ backgroundColor: {
24
+ type: string;
25
+ };
26
+ height: {
27
+ type: string[];
28
+ };
29
+ width: {
30
+ type: string[];
31
+ };
32
+ color: {
33
+ type: string;
34
+ };
35
+ };
36
+ };
18
37
  alt: {
19
38
  type: string;
20
39
  contentType: string;
@@ -153,6 +172,25 @@ export declare const ContentLayoutBlock: {
153
172
  type: string;
154
173
  pattern: string;
155
174
  };
175
+ style: {
176
+ type: string;
177
+ additionalProperties: boolean;
178
+ required: never[];
179
+ properties: {
180
+ backgroundColor: {
181
+ type: string;
182
+ };
183
+ height: {
184
+ type: string[];
185
+ };
186
+ width: {
187
+ type: string[];
188
+ };
189
+ color: {
190
+ type: string;
191
+ };
192
+ };
193
+ };
156
194
  alt: {
157
195
  type: string;
158
196
  contentType: string;
@@ -15,6 +15,7 @@ const DEFAULT_SIZES = {
15
15
  };
16
16
  export const ExtendedFeaturesBlock = ({ title, description, items, colSizes = DEFAULT_SIZES, animated, }) => {
17
17
  const theme = useTheme();
18
+ const itemTitleHeadingTag = title ? 'h3' : 'h2';
18
19
  return (React.createElement(AnimateBlock, { className: b(), animate: animated },
19
20
  React.createElement(Title, { title: title, subtitle: description, className: b('header') }),
20
21
  React.createElement("div", { className: b('items') },
@@ -28,9 +29,12 @@ export const ExtendedFeaturesBlock = ({ title, description, items, colSizes = DE
28
29
  return (React.createElement(Col, { className: b('item'), key: text || itemTitle, sizes: colSizes },
29
30
  iconData && React.createElement(Image, Object.assign({}, iconData, { className: b('icon') })),
30
31
  React.createElement("div", { className: b('container') },
31
- itemTitle && (React.createElement("h5", { className: b('item-title') },
32
- React.createElement(HTML, null, itemTitle),
33
- label && (React.createElement("span", { className: b('item-label') }, label)))),
32
+ itemTitle &&
33
+ React.createElement(itemTitleHeadingTag, {
34
+ className: b('item-title'),
35
+ }, React.createElement(React.Fragment, null,
36
+ React.createElement(HTML, null, itemTitle),
37
+ label && (React.createElement("span", { className: b('item-label') }, label)))),
34
38
  React.createElement(Content, { text: text, links: itemLinks, size: "s", colSizes: { all: 12, md: 12 }, buttons: buttons, additionalInfo: additionalInfo }))));
35
39
  })))));
36
40
  };
@@ -75,10 +75,6 @@ unpredictable css rules order in build */
75
75
  }
76
76
  .pc-header-block__description {
77
77
  margin-top: 16px;
78
- font-weight: normal;
79
- font-size: var(--g-text-caption-2-font-size);
80
- line-height: var(--g-text-caption-2-line-height);
81
- margin-block-end: var(--g-text-body-1-line-height);
82
78
  }
83
79
  .pc-header-block__description .yfm,
84
80
  .pc-header-block__description .yfm * {
@@ -170,9 +166,7 @@ unpredictable css rules order in build */
170
166
  .pc-header-block__overtitle {
171
167
  font-size: var(--g-text-body-3-font-size);
172
168
  line-height: var(--g-text-body-3-line-height);
173
- margin-block-start: var(--g-text-body-3-line-height);
174
169
  margin-bottom: 8px;
175
- font-weight: 400;
176
170
  }
177
171
  .pc-header-block__overtitle a {
178
172
  outline: none;
@@ -1,6 +1,7 @@
1
- import React, { Fragment, useContext } from 'react';
1
+ import React, { Fragment, useCallback, useContext } from 'react';
2
2
  import { Image, Title } from '../../components';
3
3
  import { LocationContext } from '../../context/locationContext';
4
+ import { useAnalytics } from '../../hooks';
4
5
  import { block, getLinkProps } from '../../utils';
5
6
  import './Icons.css';
6
7
  const b = block('icons-block');
@@ -9,11 +10,16 @@ const getItemContent = (item) => (React.createElement(Fragment, null,
9
10
  React.createElement("p", { className: b('text') }, item.text)));
10
11
  const Icons = ({ title, size = 's', items }) => {
11
12
  const { hostname } = useContext(LocationContext);
13
+ const handleAnalytics = useAnalytics();
14
+ const onClick = useCallback(({ analyticsEvents, url }) => {
15
+ handleAnalytics(analyticsEvents, { url });
16
+ }, [handleAnalytics]);
12
17
  return (React.createElement("div", { className: b({ size }) },
13
18
  title && React.createElement(Title, { className: b('header'), title: title, colSizes: { all: 12 } }),
14
19
  items.map((item) => {
15
20
  const itemContent = getItemContent(item);
16
- return item.url ? (React.createElement("a", Object.assign({ className: b('item'), key: item.url, href: item.url }, getLinkProps(item.url, hostname)), itemContent)) : (React.createElement("div", { className: b('item'), key: item.url }, itemContent));
21
+ const { url, text } = item;
22
+ return url ? (React.createElement("a", Object.assign({ className: b('item'), key: url, href: url, "aria-label": text, title: text }, getLinkProps(url, hostname), { onClick: () => onClick(item) }), itemContent)) : (React.createElement("div", { className: b('item'), key: url }, itemContent));
17
23
  })));
18
24
  };
19
25
  export default Icons;
@@ -29,6 +29,87 @@ export declare const IconsProps: {
29
29
  type: string;
30
30
  };
31
31
  };
32
+ analyticsEvents: {
33
+ oneOf: ({
34
+ optionName: string;
35
+ type: string;
36
+ additionalProperties: {
37
+ type: string;
38
+ };
39
+ required: string[];
40
+ properties: {
41
+ name: {
42
+ type: string;
43
+ };
44
+ type: {
45
+ type: string;
46
+ };
47
+ counters: {
48
+ type: string;
49
+ additionalProperties: boolean;
50
+ required: never[];
51
+ properties: {
52
+ include: {
53
+ type: string;
54
+ items: {
55
+ type: string;
56
+ };
57
+ };
58
+ exclude: {
59
+ type: string;
60
+ items: {
61
+ type: string;
62
+ };
63
+ };
64
+ };
65
+ };
66
+ context: {
67
+ type: string;
68
+ };
69
+ };
70
+ items?: undefined;
71
+ } | {
72
+ type: string;
73
+ items: {
74
+ type: string;
75
+ additionalProperties: {
76
+ type: string;
77
+ };
78
+ required: string[];
79
+ properties: {
80
+ name: {
81
+ type: string;
82
+ };
83
+ type: {
84
+ type: string;
85
+ };
86
+ counters: {
87
+ type: string;
88
+ additionalProperties: boolean;
89
+ required: never[];
90
+ properties: {
91
+ include: {
92
+ type: string;
93
+ items: {
94
+ type: string;
95
+ };
96
+ };
97
+ exclude: {
98
+ type: string;
99
+ items: {
100
+ type: string;
101
+ };
102
+ };
103
+ };
104
+ };
105
+ context: {
106
+ type: string;
107
+ };
108
+ };
109
+ };
110
+ optionName: string;
111
+ })[];
112
+ };
32
113
  };
33
114
  };
34
115
  animated: {
@@ -96,6 +177,87 @@ export declare const IconsBlock: {
96
177
  type: string;
97
178
  };
98
179
  };
180
+ analyticsEvents: {
181
+ oneOf: ({
182
+ optionName: string;
183
+ type: string;
184
+ additionalProperties: {
185
+ type: string;
186
+ };
187
+ required: string[];
188
+ properties: {
189
+ name: {
190
+ type: string;
191
+ };
192
+ type: {
193
+ type: string;
194
+ };
195
+ counters: {
196
+ type: string;
197
+ additionalProperties: boolean;
198
+ required: never[];
199
+ properties: {
200
+ include: {
201
+ type: string;
202
+ items: {
203
+ type: string;
204
+ };
205
+ };
206
+ exclude: {
207
+ type: string;
208
+ items: {
209
+ type: string;
210
+ };
211
+ };
212
+ };
213
+ };
214
+ context: {
215
+ type: string;
216
+ };
217
+ };
218
+ items?: undefined;
219
+ } | {
220
+ type: string;
221
+ items: {
222
+ type: string;
223
+ additionalProperties: {
224
+ type: string;
225
+ };
226
+ required: string[];
227
+ properties: {
228
+ name: {
229
+ type: string;
230
+ };
231
+ type: {
232
+ type: string;
233
+ };
234
+ counters: {
235
+ type: string;
236
+ additionalProperties: boolean;
237
+ required: never[];
238
+ properties: {
239
+ include: {
240
+ type: string;
241
+ items: {
242
+ type: string;
243
+ };
244
+ };
245
+ exclude: {
246
+ type: string;
247
+ items: {
248
+ type: string;
249
+ };
250
+ };
251
+ };
252
+ };
253
+ context: {
254
+ type: string;
255
+ };
256
+ };
257
+ };
258
+ optionName: string;
259
+ })[];
260
+ };
99
261
  };
100
262
  };
101
263
  animated: {
@@ -1,4 +1,5 @@
1
1
  import { AnimatableProps, BlockBaseProps } from '../../schema/validators/common';
2
+ import { AnalyticsEventSchema } from '../../schema/validators/event';
2
3
  export const IconsProps = {
3
4
  additionalProperties: false,
4
5
  required: ['size', 'items'],
@@ -27,6 +28,16 @@ export const IconsProps = {
27
28
  type: 'string',
28
29
  },
29
30
  },
31
+ analyticsEvents: {
32
+ oneOf: [
33
+ Object.assign(Object.assign({}, AnalyticsEventSchema), { optionName: 'single' }),
34
+ {
35
+ type: 'array',
36
+ items: AnalyticsEventSchema,
37
+ optionName: 'list',
38
+ },
39
+ ],
40
+ },
30
41
  },
31
42
  } }),
32
43
  };
@@ -28,7 +28,7 @@ const PromoFeaturesBlock = (props) => {
28
28
  [themeMod]: Boolean(themeMod),
29
29
  }) },
30
30
  React.createElement("div", { className: b('card-info') },
31
- React.createElement("h4", { className: b('card-title') }, cardTitle),
31
+ React.createElement("h3", { className: b('card-title') }, cardTitle),
32
32
  React.createElement("div", { className: b('card-text') },
33
33
  React.createElement(YFMWrapper, { content: text, modifiers: { constructor: true } }))),
34
34
  media && React.createElement(Media, Object.assign({ className: b('card-media') }, media))));
@@ -0,0 +1,50 @@
1
+ .pc-QuestionsBlockItem__title {
2
+ margin: 0;
3
+ }
4
+
5
+ /* use this for style redefinitions to awoid problems with
6
+ unpredictable css rules order in build */
7
+ .pc-QuestionsBlockItem {
8
+ padding-bottom: 32px;
9
+ border-bottom: 1px solid var(--g-color-line-generic);
10
+ }
11
+ .pc-QuestionsBlockItem + .pc-QuestionsBlockItem {
12
+ padding-top: 32px;
13
+ }
14
+ .pc-QuestionsBlockItem__title {
15
+ font-size: var(--g-text-header-1-font-size);
16
+ line-height: var(--g-text-header-1-line-height);
17
+ color: var(--pc-text-header-color);
18
+ font-weight: var(--g-text-accent-font-weight);
19
+ position: relative;
20
+ padding-right: 24px;
21
+ cursor: pointer;
22
+ }
23
+ .pc-QuestionsBlockItem__title a {
24
+ outline: none;
25
+ color: var(--g-color-text-link);
26
+ text-decoration: none;
27
+ cursor: pointer;
28
+ }
29
+ .utilityfocus .pc-QuestionsBlockItem__title a:focus {
30
+ outline: 2px solid #ffdb4d;
31
+ }
32
+ .pc-QuestionsBlockItem__title a:hover, .pc-QuestionsBlockItem__title a:active {
33
+ --pc-text-header-color: var(--g-color-text-link-hover);
34
+ color: var(--g-color-text-link-hover);
35
+ }
36
+ .pc-QuestionsBlockItem__arrow {
37
+ position: absolute;
38
+ right: 0;
39
+ top: 0;
40
+ color: var(--g-color-text-primary);
41
+ }
42
+ .pc-QuestionsBlockItem__link {
43
+ font-size: var(--g-text-body-2-font-size);
44
+ line-height: var(--g-text-body-2-line-height);
45
+ }
46
+ .pc-QuestionsBlockItem__text {
47
+ font-size: var(--g-text-body-2-font-size);
48
+ line-height: var(--g-text-body-2-line-height);
49
+ margin-top: 12px;
50
+ }
@@ -0,0 +1,3 @@
1
+ import { QuestionBlockItemProps } from '../../../models';
2
+ import './QuestionBlockItem.css';
3
+ export declare const QuestionBlockItem: ({ title: itemTitle, text: itemText, link, listStyle, isOpened, onClick, }: QuestionBlockItemProps) => JSX.Element;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { useActionHandlers } from '@gravity-ui/uikit';
3
+ import { Foldable, HTML, ToggleArrow, YFMWrapper } from '../../../components';
4
+ import Link from '../../../components/Link/Link';
5
+ import { block } from '../../../utils';
6
+ import { FaqMicrodataValues } from '../models';
7
+ import './QuestionBlockItem.css';
8
+ const b = block('QuestionsBlockItem');
9
+ export const QuestionBlockItem = ({ title: itemTitle, text: itemText, link, listStyle = 'dash', isOpened, onClick, }) => {
10
+ const { onKeyDown } = useActionHandlers(onClick);
11
+ return (React.createElement("div", { className: b(), itemScope: true, itemProp: FaqMicrodataValues.QuestionProp, itemType: FaqMicrodataValues.QuestionType, role: 'listitem' },
12
+ React.createElement("h3", { className: b('title'), onClick: onClick, "aria-expanded": isOpened, role: 'button', tabIndex: 0, onKeyDown: onKeyDown },
13
+ React.createElement(HTML, { itemProp: FaqMicrodataValues.QuestionNameProp }, itemTitle),
14
+ React.createElement(ToggleArrow, { open: isOpened, size: 16, type: 'vertical', iconType: "navigation", className: b('arrow') })),
15
+ React.createElement(Foldable, { isOpened: isOpened },
16
+ React.createElement("div", { className: b('text'), itemScope: true, itemProp: FaqMicrodataValues.AnswerProp, itemType: FaqMicrodataValues.AnswerType, "aria-hidden": !isOpened },
17
+ React.createElement(YFMWrapper, { content: itemText, modifiers: {
18
+ constructor: true,
19
+ constructorListStyle: true,
20
+ constructorListStyleDash: listStyle === 'dash',
21
+ }, itemProp: FaqMicrodataValues.QuestionTextProp }),
22
+ link && React.createElement(Link, Object.assign({}, link, { tabIndex: isOpened ? 0 : -1, className: b('link') }))))));
23
+ };