@gravity-ui/page-constructor 4.3.0 → 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 (270) 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/Header/Header.css +0 -6
  6. package/build/cjs/blocks/Icons/Icons.js +7 -1
  7. package/build/cjs/blocks/Icons/schema.d.ts +162 -0
  8. package/build/cjs/blocks/Icons/schema.js +11 -0
  9. package/build/cjs/blocks/Slider/Arrow/Arrow.js +2 -1
  10. package/build/cjs/blocks/Slider/Slider.css +4 -1
  11. package/build/cjs/blocks/Slider/Slider.js +32 -6
  12. package/build/cjs/blocks/Slider/i18n/en.json +4 -0
  13. package/build/cjs/blocks/Slider/i18n/index.d.ts +2 -0
  14. package/build/cjs/blocks/Slider/i18n/index.js +8 -0
  15. package/build/cjs/blocks/Slider/i18n/ru.json +4 -0
  16. package/build/cjs/components/BackgroundImage/BackgroundImage.d.ts +1 -0
  17. package/build/cjs/components/BackgroundImage/BackgroundImage.js +5 -2
  18. package/build/cjs/components/BackgroundMedia/BackgroundMedia.d.ts +1 -1
  19. package/build/cjs/components/BackgroundMedia/BackgroundMedia.js +4 -3
  20. package/build/cjs/components/ButtonTabs/ButtonTabs.js +6 -1
  21. package/build/cjs/components/CardBase/CardBase.css +4 -4
  22. package/build/cjs/components/HTML/HTML.d.ts +5 -1
  23. package/build/cjs/components/HTML/HTML.js +3 -1
  24. package/build/cjs/components/Image/Image.js +7 -5
  25. package/build/cjs/components/Image/schema.d.ts +19 -0
  26. package/build/cjs/components/Image/schema.js +12 -1
  27. package/build/cjs/components/Link/Link.d.ts +2 -1
  28. package/build/cjs/components/Link/Link.js +4 -2
  29. package/build/cjs/components/Media/Image/Image.d.ts +3 -2
  30. package/build/cjs/components/Media/Image/Image.js +8 -5
  31. package/build/cjs/components/Media/Media.d.ts +2 -2
  32. package/build/cjs/components/Media/Media.js +9 -6
  33. package/build/cjs/components/Media/Video/Video.d.ts +2 -2
  34. package/build/cjs/components/Media/Video/Video.js +15 -6
  35. package/build/cjs/components/MetaInfo/MetaInfo.css +0 -2
  36. package/build/cjs/components/MetaInfo/MetaInfo.js +2 -1
  37. package/build/cjs/components/ReactPlayer/CustomBarControls.css +46 -14
  38. package/build/cjs/components/ReactPlayer/CustomBarControls.d.ts +4 -1
  39. package/build/cjs/components/ReactPlayer/CustomBarControls.js +33 -9
  40. package/build/cjs/components/ReactPlayer/ReactPlayer.css +12 -0
  41. package/build/cjs/components/ReactPlayer/ReactPlayer.js +49 -25
  42. package/build/cjs/components/ReactPlayer/i18n/en.json +4 -1
  43. package/build/cjs/components/ReactPlayer/i18n/ru.json +4 -1
  44. package/build/cjs/components/Table/Table.js +11 -5
  45. package/build/cjs/components/VideoBlock/VideoBlock.js +7 -6
  46. package/build/cjs/components/YFMWrapper/YFMWrapper.d.ts +4 -3
  47. package/build/cjs/components/YFMWrapper/YFMWrapper.js +3 -3
  48. package/build/cjs/constructor-items.d.ts +10 -3
  49. package/build/cjs/constructor-items.js +11 -1
  50. package/build/cjs/containers/Loadable/Loadable.js +2 -2
  51. package/build/cjs/containers/PageConstructor/PageConstructor.css +4 -0
  52. package/build/cjs/containers/PageConstructor/PageConstructor.d.ts +2 -1
  53. package/build/cjs/containers/PageConstructor/PageConstructor.js +10 -6
  54. package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.css +38 -0
  55. package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +3 -2
  56. package/build/cjs/context/innerContext/InnerContext.d.ts +3 -1
  57. package/build/cjs/context/innerContext/InnerContext.js +2 -0
  58. package/build/cjs/editor/components/AddBlock/AddBlock.css +1 -1
  59. package/build/cjs/editor/components/EditBlock/EditBlock.css +1 -0
  60. package/build/cjs/editor/components/Layout/Layout.css +2 -1
  61. package/build/cjs/editor/containers/Form/Form.css +14 -35
  62. package/build/cjs/editor/store/index.js +1 -1
  63. package/build/cjs/editor/styles/root.css +2 -1
  64. package/build/cjs/editor/utils/index.d.ts +1 -0
  65. package/build/cjs/grid/Col/Col.d.ts +2 -4
  66. package/build/cjs/icons/Mute.d.ts +2 -0
  67. package/build/cjs/icons/Mute.js +12 -0
  68. package/build/cjs/icons/MuteSmall.d.ts +2 -0
  69. package/build/cjs/icons/MuteSmall.js +15 -0
  70. package/build/cjs/icons/Unmute.d.ts +2 -0
  71. package/build/cjs/icons/Unmute.js +12 -0
  72. package/build/cjs/icons/UnmuteSmall.d.ts +2 -0
  73. package/build/cjs/icons/UnmuteSmall.js +17 -0
  74. package/build/cjs/icons/VideoControlPause.d.ts +2 -0
  75. package/build/cjs/icons/VideoControlPause.js +16 -0
  76. package/build/cjs/icons/VideoControlPlay.d.ts +2 -0
  77. package/build/cjs/icons/VideoControlPlay.js +12 -0
  78. package/build/cjs/models/constructor-items/blocks.d.ts +12 -5
  79. package/build/cjs/models/constructor-items/common.d.ts +16 -34
  80. package/build/cjs/models/constructor-items/common.js +6 -1
  81. package/build/cjs/models/constructor-items/sub-blocks.d.ts +4 -4
  82. package/build/cjs/models/constructor.d.ts +7 -1
  83. package/build/cjs/models/navigation.d.ts +1 -0
  84. package/build/cjs/models/navigation.js +2 -1
  85. package/build/cjs/navigation/components/MobileMenuButton/MobileMenuButton.js +1 -0
  86. package/build/cjs/navigation/components/NavigationItem/NavigationItem.css +1 -1
  87. package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +4 -16
  88. package/build/cjs/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.js +1 -1
  89. package/build/cjs/navigation/components/NavigationItem/index.d.ts +6 -0
  90. package/build/cjs/navigation/components/NavigationItem/index.js +14 -0
  91. package/build/cjs/navigation/components/NavigationListItem/NavigationListItem.js +1 -1
  92. package/build/cjs/navigation/components/NavigationPopup/NavigationPopup.js +1 -1
  93. package/build/cjs/navigation/components/SocialIcon/SocialIcon.js +2 -1
  94. package/build/cjs/schema/constants.d.ts +181 -78
  95. package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +2 -3
  96. package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +100 -0
  97. package/build/cjs/sub-blocks/BackgroundCard/schema.js +10 -0
  98. package/build/cjs/sub-blocks/Content/Content.d.ts +3 -1
  99. package/build/cjs/sub-blocks/Content/Content.js +7 -5
  100. package/build/cjs/sub-blocks/Content/ContentList/ContentList.d.ts +2 -1
  101. package/build/cjs/sub-blocks/Content/ContentList/ContentList.js +7 -5
  102. package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +2 -2
  103. package/build/cjs/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
  104. package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +3 -3
  105. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +81 -0
  106. package/build/cjs/sub-blocks/LayoutItem/schema.js +10 -0
  107. package/build/cjs/sub-blocks/MediaCard/MediaCard.d.ts +1 -1
  108. package/build/cjs/sub-blocks/MediaCard/MediaCard.js +2 -2
  109. package/build/cjs/sub-blocks/MediaCard/schema.d.ts +81 -78
  110. package/build/cjs/sub-blocks/MediaCard/schema.js +11 -1
  111. package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.d.ts +2 -2
  112. package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js +2 -2
  113. package/build/cjs/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js +7 -4
  114. package/build/cjs/sub-blocks/PriceDetailed/schema.js +11 -1
  115. package/build/cjs/sub-blocks/Quote/Quote.css +0 -3
  116. package/build/cjs/text-transform/common.d.ts +7 -2
  117. package/build/cjs/text-transform/common.js +8 -2
  118. package/build/cjs/text-transform/config.js +1 -1
  119. package/build/cjs/text-transform/transformers.d.ts +2 -0
  120. package/build/cjs/text-transform/transformers.js +11 -8
  121. package/build/cjs/utils/blocks.d.ts +3 -6
  122. package/build/cjs/utils/blocks.js +25 -16
  123. package/build/cjs/utils/cn.d.ts +3 -3
  124. package/build/cjs/utils/cn.js +4 -7
  125. package/build/esm/blocks/CardLayout/CardLayout.d.ts +2 -2
  126. package/build/esm/blocks/CardLayout/CardLayout.js +1 -1
  127. package/build/esm/blocks/ContentLayout/schema.d.ts +38 -0
  128. package/build/esm/blocks/Header/Header.css +0 -6
  129. package/build/esm/blocks/Icons/Icons.js +8 -2
  130. package/build/esm/blocks/Icons/schema.d.ts +162 -0
  131. package/build/esm/blocks/Icons/schema.js +11 -0
  132. package/build/esm/blocks/Slider/Arrow/Arrow.js +2 -1
  133. package/build/esm/blocks/Slider/Slider.css +4 -1
  134. package/build/esm/blocks/Slider/Slider.js +33 -7
  135. package/build/esm/blocks/Slider/i18n/en.json +4 -0
  136. package/build/esm/blocks/Slider/i18n/index.d.ts +2 -0
  137. package/build/esm/blocks/Slider/i18n/index.js +5 -0
  138. package/build/esm/blocks/Slider/i18n/ru.json +4 -0
  139. package/build/esm/components/BackgroundImage/BackgroundImage.d.ts +1 -0
  140. package/build/esm/components/BackgroundImage/BackgroundImage.js +5 -3
  141. package/build/esm/components/BackgroundMedia/BackgroundMedia.d.ts +1 -1
  142. package/build/esm/components/BackgroundMedia/BackgroundMedia.js +5 -4
  143. package/build/esm/components/ButtonTabs/ButtonTabs.js +6 -1
  144. package/build/esm/components/CardBase/CardBase.css +4 -4
  145. package/build/esm/components/HTML/HTML.d.ts +5 -1
  146. package/build/esm/components/HTML/HTML.js +3 -1
  147. package/build/esm/components/Image/Image.js +7 -5
  148. package/build/esm/components/Image/schema.d.ts +19 -0
  149. package/build/esm/components/Image/schema.js +12 -1
  150. package/build/esm/components/Link/Link.d.ts +2 -1
  151. package/build/esm/components/Link/Link.js +4 -2
  152. package/build/esm/components/Media/Image/Image.d.ts +3 -2
  153. package/build/esm/components/Media/Image/Image.js +8 -6
  154. package/build/esm/components/Media/Media.d.ts +2 -2
  155. package/build/esm/components/Media/Media.js +10 -7
  156. package/build/esm/components/Media/Video/Video.d.ts +2 -2
  157. package/build/esm/components/Media/Video/Video.js +16 -7
  158. package/build/esm/components/MetaInfo/MetaInfo.css +0 -2
  159. package/build/esm/components/MetaInfo/MetaInfo.js +2 -1
  160. package/build/esm/components/ReactPlayer/CustomBarControls.css +46 -14
  161. package/build/esm/components/ReactPlayer/CustomBarControls.d.ts +4 -1
  162. package/build/esm/components/ReactPlayer/CustomBarControls.js +34 -10
  163. package/build/esm/components/ReactPlayer/ReactPlayer.css +12 -0
  164. package/build/esm/components/ReactPlayer/ReactPlayer.js +52 -28
  165. package/build/esm/components/ReactPlayer/i18n/en.json +4 -1
  166. package/build/esm/components/ReactPlayer/i18n/ru.json +4 -1
  167. package/build/esm/components/Table/Table.js +11 -5
  168. package/build/esm/components/VideoBlock/VideoBlock.js +7 -6
  169. package/build/esm/components/YFMWrapper/YFMWrapper.d.ts +4 -3
  170. package/build/esm/components/YFMWrapper/YFMWrapper.js +3 -3
  171. package/build/esm/constructor-items.d.ts +10 -3
  172. package/build/esm/constructor-items.js +10 -1
  173. package/build/esm/containers/Loadable/Loadable.js +1 -1
  174. package/build/esm/containers/PageConstructor/PageConstructor.css +4 -0
  175. package/build/esm/containers/PageConstructor/PageConstructor.d.ts +2 -1
  176. package/build/esm/containers/PageConstructor/PageConstructor.js +12 -8
  177. package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.css +38 -0
  178. package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts +1 -0
  179. package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +4 -2
  180. package/build/esm/context/innerContext/InnerContext.d.ts +3 -1
  181. package/build/esm/context/innerContext/InnerContext.js +2 -0
  182. package/build/esm/editor/components/AddBlock/AddBlock.css +1 -1
  183. package/build/esm/editor/components/EditBlock/EditBlock.css +1 -0
  184. package/build/esm/editor/components/Layout/Layout.css +2 -1
  185. package/build/esm/editor/containers/Form/Form.css +14 -35
  186. package/build/esm/editor/store/index.js +2 -2
  187. package/build/esm/editor/styles/root.css +2 -1
  188. package/build/esm/editor/utils/index.d.ts +1 -0
  189. package/build/esm/grid/Col/Col.d.ts +2 -4
  190. package/build/esm/icons/Mute.d.ts +2 -0
  191. package/build/esm/icons/Mute.js +7 -0
  192. package/build/esm/icons/MuteSmall.d.ts +2 -0
  193. package/build/esm/icons/MuteSmall.js +10 -0
  194. package/build/esm/icons/Unmute.d.ts +2 -0
  195. package/build/esm/icons/Unmute.js +7 -0
  196. package/build/esm/icons/UnmuteSmall.d.ts +2 -0
  197. package/build/esm/icons/UnmuteSmall.js +12 -0
  198. package/build/esm/icons/VideoControlPause.d.ts +2 -0
  199. package/build/esm/icons/VideoControlPause.js +11 -0
  200. package/build/esm/icons/VideoControlPlay.d.ts +2 -0
  201. package/build/esm/icons/VideoControlPlay.js +7 -0
  202. package/build/esm/models/constructor-items/blocks.d.ts +12 -5
  203. package/build/esm/models/constructor-items/common.d.ts +16 -34
  204. package/build/esm/models/constructor-items/common.js +5 -0
  205. package/build/esm/models/constructor-items/sub-blocks.d.ts +4 -4
  206. package/build/esm/models/constructor.d.ts +7 -1
  207. package/build/esm/models/navigation.d.ts +1 -0
  208. package/build/esm/models/navigation.js +1 -0
  209. package/build/esm/navigation/components/MobileMenuButton/MobileMenuButton.js +1 -0
  210. package/build/esm/navigation/components/NavigationItem/NavigationItem.css +1 -1
  211. package/build/esm/navigation/components/NavigationItem/NavigationItem.js +5 -17
  212. package/build/esm/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.js +1 -1
  213. package/build/esm/navigation/components/NavigationItem/index.d.ts +6 -0
  214. package/build/esm/navigation/components/NavigationItem/index.js +6 -0
  215. package/build/esm/navigation/components/NavigationListItem/NavigationListItem.js +1 -1
  216. package/build/esm/navigation/components/NavigationPopup/NavigationPopup.js +1 -1
  217. package/build/esm/navigation/components/SocialIcon/SocialIcon.js +2 -1
  218. package/build/esm/schema/constants.d.ts +181 -78
  219. package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +2 -3
  220. package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +100 -0
  221. package/build/esm/sub-blocks/BackgroundCard/schema.js +10 -0
  222. package/build/esm/sub-blocks/Content/Content.d.ts +3 -1
  223. package/build/esm/sub-blocks/Content/Content.js +7 -5
  224. package/build/esm/sub-blocks/Content/ContentList/ContentList.d.ts +2 -1
  225. package/build/esm/sub-blocks/Content/ContentList/ContentList.js +7 -5
  226. package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +2 -2
  227. package/build/esm/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
  228. package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +3 -3
  229. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +81 -0
  230. package/build/esm/sub-blocks/LayoutItem/schema.js +10 -0
  231. package/build/esm/sub-blocks/MediaCard/MediaCard.d.ts +1 -1
  232. package/build/esm/sub-blocks/MediaCard/MediaCard.js +2 -2
  233. package/build/esm/sub-blocks/MediaCard/schema.d.ts +81 -78
  234. package/build/esm/sub-blocks/MediaCard/schema.js +11 -1
  235. package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.d.ts +2 -2
  236. package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js +2 -2
  237. package/build/esm/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js +8 -4
  238. package/build/esm/sub-blocks/PriceDetailed/schema.js +11 -1
  239. package/build/esm/sub-blocks/Quote/Quote.css +0 -3
  240. package/build/esm/text-transform/common.d.ts +7 -2
  241. package/build/esm/text-transform/common.js +7 -2
  242. package/build/esm/text-transform/config.js +1 -1
  243. package/build/esm/text-transform/transformers.d.ts +2 -0
  244. package/build/esm/text-transform/transformers.js +11 -8
  245. package/build/esm/utils/blocks.d.ts +3 -6
  246. package/build/esm/utils/blocks.js +21 -11
  247. package/build/esm/utils/cn.d.ts +3 -3
  248. package/build/esm/utils/cn.js +3 -4
  249. package/package.json +6 -6
  250. package/server/models/constructor-items/blocks.d.ts +12 -5
  251. package/server/models/constructor-items/common.d.ts +16 -34
  252. package/server/models/constructor-items/common.js +6 -1
  253. package/server/models/constructor-items/sub-blocks.d.ts +4 -4
  254. package/server/models/constructor.d.ts +7 -1
  255. package/server/models/navigation.d.ts +1 -0
  256. package/server/models/navigation.js +2 -1
  257. package/server/text-transform/common.d.ts +7 -2
  258. package/server/text-transform/common.js +10 -2
  259. package/server/text-transform/config.js +1 -1
  260. package/server/text-transform/transformers.d.ts +2 -0
  261. package/server/text-transform/transformers.js +11 -8
  262. package/server/utils/blocks.d.ts +3 -6
  263. package/server/utils/blocks.js +25 -16
  264. package/server/utils/cn.d.ts +3 -3
  265. package/server/utils/cn.js +4 -9
  266. package/styles/mixins.scss +4 -1
  267. package/styles/storybook/common.scss +2 -0
  268. package/styles/styles.css +4 -0
  269. package/styles/yfm.scss +7 -0
  270. package/widget/index.js +1 -1
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PriceDetailedBlock = void 0;
4
4
  const common_1 = require("../../schema/validators/common");
5
+ const event_1 = require("../../schema/validators/event");
5
6
  const utils_1 = require("../../schema/validators/utils");
6
7
  const PriceDetailedDetailsType = ['marked-list', 'settings'];
7
8
  const PriceDetailedDescriptionColor = ['cornflower', 'black'];
@@ -137,7 +138,16 @@ const PriceItem = {
137
138
  type: 'object',
138
139
  additionalProperties: false,
139
140
  required: ['title', 'description'],
140
- properties: Object.assign(Object.assign({}, PriceDetailsProps), PriceDescriptionProps),
141
+ properties: Object.assign(Object.assign(Object.assign({}, PriceDetailsProps), PriceDescriptionProps), { analyticsEvents: {
142
+ oneOf: [
143
+ Object.assign(Object.assign({}, event_1.AnalyticsEventSchema), { optionName: 'single' }),
144
+ {
145
+ type: 'array',
146
+ items: event_1.AnalyticsEventSchema,
147
+ optionName: 'list',
148
+ },
149
+ ],
150
+ } }),
141
151
  };
142
152
  exports.PriceDetailedBlock = {
143
153
  'price-detailed': {
@@ -31,9 +31,6 @@ unpredictable css rules order in build */
31
31
  .pc-quote_border_line {
32
32
  border: 1px solid var(--g-color-line-generic);
33
33
  }
34
- .pc-quote_border_line, .pc-quote_border_none {
35
- cursor: default;
36
- }
37
34
  @media (min-width: 577px) {
38
35
  .slick-slide:not(.slick-active) .pc-quote {
39
36
  box-shadow: none;
@@ -1,13 +1,18 @@
1
+ import { MarkdownItPluginCb } from '@doc-tools/transform/lib/plugins/typings';
1
2
  import { Lang } from '../utils/configure';
2
3
  export type ComplexItem = {
3
4
  [key: string]: string;
4
5
  };
5
6
  export type Item = string | null | ComplexItem;
6
7
  export type Transformer = (text: string) => string;
7
- export type TransformerRaw = (lang: Lang, content: string) => string;
8
+ export type TransformerRaw = (lang: Lang, content: string, options: {
9
+ plugins: MarkdownItPluginCb[];
10
+ }) => string;
8
11
  export type Parser<T = any> = (transformer: Transformer, block: T) => T;
9
12
  export declare const createItemsParser: (fields: string[]) => (transformer: Transformer, items: Item[]) => (string | {
10
13
  [x: string]: string;
11
14
  } | null)[];
12
- export declare function yfmTransformer(lang: Lang, content: string): string;
15
+ export declare function yfmTransformer(lang: Lang, content: string, options?: {
16
+ plugins?: MarkdownItPluginCb[];
17
+ }): string;
13
18
  export declare function typografTransformer(lang: Lang, content: string): string;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.typografTransformer = exports.yfmTransformer = exports.createItemsParser = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const plugins_1 = tslib_1.__importDefault(require("@doc-tools/transform/lib/plugins"));
4
6
  const utils_1 = require("./utils");
5
7
  const createItemsParser = (fields) => (transformer, items) => items.map((item) => {
6
8
  if (!item) {
@@ -20,8 +22,12 @@ const createItemsParser = (fields) => (transformer, items) => items.map((item) =
20
22
  }
21
23
  });
22
24
  exports.createItemsParser = createItemsParser;
23
- function yfmTransformer(lang, content) {
24
- const { html } = (0, utils_1.fullTransform)(content, { lang });
25
+ function yfmTransformer(lang, content, options = {}) {
26
+ const { plugins = [] } = options;
27
+ const { html } = (0, utils_1.fullTransform)(content, {
28
+ lang,
29
+ plugins: [...plugins_1.default, ...plugins],
30
+ });
25
31
  return html;
26
32
  }
27
33
  exports.yfmTransformer = yfmTransformer;
@@ -125,7 +125,7 @@ exports.config = {
125
125
  {
126
126
  fields: ['metaInfo'],
127
127
  parser: (0, common_1.createItemsParser)([]),
128
- transformer: common_1.typografTransformer,
128
+ transformer: common_1.yfmTransformer,
129
129
  },
130
130
  ],
131
131
  [models_1.SubBlockType.Quote]: {
@@ -1,3 +1,4 @@
1
+ import { MarkdownItPluginCb } from '@doc-tools/transform/lib/plugins/typings';
1
2
  import { ConstructorBlock } from '../models/constructor';
2
3
  import { Lang } from '../utils/configure';
3
4
  export type ContentVariables = Record<string, string>;
@@ -9,6 +10,7 @@ export type ContentTransformerProps = {
9
10
  lang: Lang;
10
11
  customConfig?: {};
11
12
  vars?: ContentVariables;
13
+ plugins?: MarkdownItPluginCb[];
12
14
  };
13
15
  };
14
16
  export declare const contentTransformer: ({ content, options }: ContentTransformerProps) => {
@@ -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
  };
@@ -2,12 +2,9 @@ import { ConstructorBlock, CustomConfig, PCShareSocialNetwork, TextSize } from '
2
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,6 +40,7 @@ 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':
@@ -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;
@@ -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
  };
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  import ToggleArrow from '../../../components/ToggleArrow/ToggleArrow';
3
3
  import { block } from '../../../utils';
4
+ import i18n from '../i18n';
4
5
  import './Arrow.css';
5
6
  const b = block('slider-block-arrow');
6
7
  const Arrow = ({ type, handleClick, className, size = 16 }) => (React.createElement("div", { className: b({ type }, className) },
7
- React.createElement("button", { className: b('button'), onClick: () => handleClick && handleClick(type) },
8
+ React.createElement("button", { className: b('button'), onClick: () => handleClick && handleClick(type), "aria-label": i18n(`arrow-${type}`) },
8
9
  React.createElement("span", { className: b('icon-wrapper') },
9
10
  React.createElement(ToggleArrow, { size: size, type: 'horizontal', iconType: "navigation", className: b('icon') })))));
10
11
  export default Arrow;
@@ -134,6 +134,7 @@ unpredictable css rules order in build */
134
134
  justify-content: center;
135
135
  }
136
136
  .pc-SliderBlock__dots-list li.pc-SliderBlock__bar,
137
+ .pc-SliderBlock__dots-list li.pc-SliderBlock__accessible-bar,
137
138
  .pc-SliderBlock__dots-list li.pc-SliderBlock__dot {
138
139
  margin: calc(12px / 2) 8px;
139
140
  top: 0;
@@ -155,13 +156,15 @@ unpredictable css rules order in build */
155
156
  .pc-SliderBlock__dot_active {
156
157
  background-color: var(--g-color-line-generic-active);
157
158
  }
158
- .pc-SliderBlock__bar {
159
+ .pc-SliderBlock__bar, .pc-SliderBlock__accessible-bar {
159
160
  position: absolute;
160
161
  top: 12px;
161
162
  left: 0;
162
163
  width: 24px;
163
164
  height: 8px;
164
165
  border-radius: var(--pc-border-radius);
166
+ }
167
+ .pc-SliderBlock__bar {
165
168
  transition: left 0.3s;
166
169
  background-color: var(--pc-color-line-generic-active-solid);
167
170
  }