@gravity-ui/page-constructor 4.28.1 → 4.29.1-alpha.0

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 (167) hide show
  1. package/build/cjs/blocks/Banner/schema.d.ts +9 -0
  2. package/build/cjs/blocks/CardLayout/schema.d.ts +12 -0
  3. package/build/cjs/blocks/ContentLayout/schema.d.ts +6 -0
  4. package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +9 -0
  5. package/build/cjs/blocks/FilterBlock/schema.d.ts +12 -0
  6. package/build/cjs/blocks/Form/Form.css +136 -0
  7. package/build/cjs/blocks/Form/Form.d.ts +4 -0
  8. package/build/cjs/blocks/Form/Form.js +61 -0
  9. package/build/cjs/blocks/Form/HubspotInlineForm.d.ts +7 -0
  10. package/build/cjs/blocks/Form/HubspotInlineForm.js +14 -0
  11. package/build/cjs/blocks/Form/InnerForm/InnerForm.d.ts +9 -0
  12. package/build/cjs/blocks/Form/InnerForm/InnerForm.js +28 -0
  13. package/build/cjs/blocks/Form/schema.d.ts +202 -0
  14. package/build/cjs/blocks/Form/schema.js +44 -0
  15. package/build/cjs/blocks/Header/Header.js +2 -2
  16. package/build/cjs/blocks/Header/schema.d.ts +3 -0
  17. package/build/cjs/blocks/HeaderSlider/schema.d.ts +3 -0
  18. package/build/cjs/blocks/Icons/schema.d.ts +6 -0
  19. package/build/cjs/blocks/Info/schema.d.ts +6 -0
  20. package/build/cjs/blocks/Map/schema.d.ts +9 -0
  21. package/build/cjs/blocks/Media/schema.d.ts +18 -0
  22. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +6 -0
  23. package/build/cjs/blocks/Questions/schema.d.ts +6 -0
  24. package/build/cjs/blocks/Share/Share.js +5 -1
  25. package/build/cjs/blocks/Share/i18n/en.json +11 -1
  26. package/build/cjs/blocks/Share/i18n/ru.json +11 -1
  27. package/build/cjs/blocks/Slider/schema.d.ts +6 -0
  28. package/build/cjs/blocks/Table/schema.d.ts +3 -0
  29. package/build/cjs/blocks/Tabs/schema.d.ts +12 -0
  30. package/build/cjs/blocks/index.d.ts +1 -0
  31. package/build/cjs/blocks/index.js +3 -1
  32. package/build/cjs/components/Author/Author.js +7 -1
  33. package/build/cjs/components/Author/schema.d.ts +12 -2
  34. package/build/cjs/components/Button/Button.d.ts +1 -0
  35. package/build/cjs/components/Button/Button.js +2 -2
  36. package/build/cjs/components/CardBase/CardBase.d.ts +1 -0
  37. package/build/cjs/components/CardBase/CardBase.js +2 -5
  38. package/build/cjs/components/Image/Image.js +1 -2
  39. package/build/cjs/components/Media/Image/Image.js +4 -4
  40. package/build/cjs/components/ReactPlayer/ReactPlayer.d.ts +1 -2
  41. package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -17
  42. package/build/cjs/components/YandexForm/YandexForm.js +6 -4
  43. package/build/cjs/components/YandexForm/schema.d.ts +16 -0
  44. package/build/cjs/components/YandexForm/schema.js +13 -0
  45. package/build/cjs/constructor-items.d.ts +1 -0
  46. package/build/cjs/constructor-items.js +1 -0
  47. package/build/cjs/editor/data/templates/form-block.json +20 -0
  48. package/build/cjs/models/components.d.ts +1 -2
  49. package/build/cjs/models/constructor-items/blocks.d.ts +33 -5
  50. package/build/cjs/models/constructor-items/blocks.js +13 -1
  51. package/build/cjs/models/constructor-items/common.d.ts +22 -2
  52. package/build/cjs/models/constructor-items/common.js +6 -1
  53. package/build/cjs/models/constructor-items/sub-blocks.d.ts +5 -2
  54. package/build/cjs/models/guards.d.ts +3 -1
  55. package/build/cjs/models/guards.js +9 -1
  56. package/build/cjs/schema/constants.d.ts +46 -4
  57. package/build/cjs/schema/constants.js +2 -1
  58. package/build/cjs/schema/validators/blocks.d.ts +1 -0
  59. package/build/cjs/schema/validators/blocks.js +1 -0
  60. package/build/cjs/schema/validators/common.d.ts +35 -3
  61. package/build/cjs/schema/validators/common.js +14 -5
  62. package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +6 -0
  63. package/build/cjs/sub-blocks/BackgroundCard/schema.js +2 -0
  64. package/build/cjs/sub-blocks/BasicCard/schema.d.ts +6 -0
  65. package/build/cjs/sub-blocks/BasicCard/schema.js +2 -0
  66. package/build/cjs/sub-blocks/Content/schema.d.ts +6 -0
  67. package/build/cjs/sub-blocks/HubspotForm/schema.d.ts +22 -0
  68. package/build/cjs/sub-blocks/HubspotForm/schema.js +17 -0
  69. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +3 -0
  70. package/build/cjs/sub-blocks/Quote/Quote.css +12 -3
  71. package/build/cjs/sub-blocks/Quote/Quote.js +5 -4
  72. package/build/cjs/sub-blocks/Quote/schema.d.ts +31 -4
  73. package/build/cjs/sub-blocks/Quote/schema.js +7 -5
  74. package/build/cjs/text-transform/transformers.js +3 -1
  75. package/build/esm/blocks/Banner/schema.d.ts +9 -0
  76. package/build/esm/blocks/CardLayout/schema.d.ts +12 -0
  77. package/build/esm/blocks/ContentLayout/schema.d.ts +6 -0
  78. package/build/esm/blocks/ExtendedFeatures/schema.d.ts +9 -0
  79. package/build/esm/blocks/FilterBlock/schema.d.ts +12 -0
  80. package/build/esm/blocks/Form/Form.css +136 -0
  81. package/build/esm/blocks/Form/Form.d.ts +5 -0
  82. package/build/esm/blocks/Form/Form.js +59 -0
  83. package/build/esm/blocks/Form/HubspotInlineForm.d.ts +7 -0
  84. package/build/esm/blocks/Form/HubspotInlineForm.js +12 -0
  85. package/build/esm/blocks/Form/InnerForm/InnerForm.d.ts +9 -0
  86. package/build/esm/blocks/Form/InnerForm/InnerForm.js +26 -0
  87. package/build/esm/blocks/Form/schema.d.ts +202 -0
  88. package/build/esm/blocks/Form/schema.js +40 -0
  89. package/build/esm/blocks/Header/Header.js +2 -2
  90. package/build/esm/blocks/Header/schema.d.ts +3 -0
  91. package/build/esm/blocks/HeaderSlider/schema.d.ts +3 -0
  92. package/build/esm/blocks/Icons/schema.d.ts +6 -0
  93. package/build/esm/blocks/Info/schema.d.ts +6 -0
  94. package/build/esm/blocks/Map/schema.d.ts +9 -0
  95. package/build/esm/blocks/Media/schema.d.ts +18 -0
  96. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +6 -0
  97. package/build/esm/blocks/Questions/schema.d.ts +6 -0
  98. package/build/esm/blocks/Share/Share.js +5 -1
  99. package/build/esm/blocks/Share/i18n/en.json +11 -1
  100. package/build/esm/blocks/Share/i18n/ru.json +11 -1
  101. package/build/esm/blocks/Slider/schema.d.ts +6 -0
  102. package/build/esm/blocks/Table/schema.d.ts +3 -0
  103. package/build/esm/blocks/Tabs/schema.d.ts +12 -0
  104. package/build/esm/blocks/index.d.ts +1 -0
  105. package/build/esm/blocks/index.js +1 -0
  106. package/build/esm/components/Author/Author.js +7 -1
  107. package/build/esm/components/Author/schema.d.ts +12 -2
  108. package/build/esm/components/Button/Button.d.ts +1 -0
  109. package/build/esm/components/Button/Button.js +2 -2
  110. package/build/esm/components/CardBase/CardBase.d.ts +1 -0
  111. package/build/esm/components/CardBase/CardBase.js +2 -5
  112. package/build/esm/components/Image/Image.js +1 -2
  113. package/build/esm/components/Media/Image/Image.js +1 -1
  114. package/build/esm/components/ReactPlayer/ReactPlayer.d.ts +1 -2
  115. package/build/esm/components/YandexForm/YandexForm.d.ts +2 -17
  116. package/build/esm/components/YandexForm/YandexForm.js +5 -3
  117. package/build/esm/components/YandexForm/schema.d.ts +16 -0
  118. package/build/esm/components/YandexForm/schema.js +10 -0
  119. package/build/esm/constructor-items.d.ts +1 -0
  120. package/build/esm/constructor-items.js +2 -1
  121. package/build/esm/editor/data/templates/form-block.json +20 -0
  122. package/build/esm/models/components.d.ts +1 -2
  123. package/build/esm/models/constructor-items/blocks.d.ts +33 -5
  124. package/build/esm/models/constructor-items/blocks.js +12 -0
  125. package/build/esm/models/constructor-items/common.d.ts +22 -2
  126. package/build/esm/models/constructor-items/common.js +5 -0
  127. package/build/esm/models/constructor-items/sub-blocks.d.ts +5 -2
  128. package/build/esm/models/guards.d.ts +3 -1
  129. package/build/esm/models/guards.js +7 -1
  130. package/build/esm/schema/constants.d.ts +46 -4
  131. package/build/esm/schema/constants.js +3 -2
  132. package/build/esm/schema/validators/blocks.d.ts +1 -0
  133. package/build/esm/schema/validators/blocks.js +1 -0
  134. package/build/esm/schema/validators/common.d.ts +35 -3
  135. package/build/esm/schema/validators/common.js +15 -6
  136. package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +6 -0
  137. package/build/esm/sub-blocks/BackgroundCard/schema.js +2 -0
  138. package/build/esm/sub-blocks/BasicCard/schema.d.ts +6 -0
  139. package/build/esm/sub-blocks/BasicCard/schema.js +2 -0
  140. package/build/esm/sub-blocks/Content/schema.d.ts +6 -0
  141. package/build/esm/sub-blocks/HubspotForm/schema.d.ts +22 -0
  142. package/build/esm/sub-blocks/HubspotForm/schema.js +14 -0
  143. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +3 -0
  144. package/build/esm/sub-blocks/Quote/Quote.css +12 -3
  145. package/build/esm/sub-blocks/Quote/Quote.js +6 -5
  146. package/build/esm/sub-blocks/Quote/schema.d.ts +31 -4
  147. package/build/esm/sub-blocks/Quote/schema.js +9 -7
  148. package/build/esm/text-transform/transformers.js +3 -1
  149. package/package.json +2 -2
  150. package/server/models/components.d.ts +1 -2
  151. package/server/models/constructor-items/blocks.d.ts +33 -5
  152. package/server/models/constructor-items/blocks.js +13 -1
  153. package/server/models/constructor-items/common.d.ts +22 -2
  154. package/server/models/constructor-items/common.js +6 -1
  155. package/server/models/constructor-items/sub-blocks.d.ts +5 -2
  156. package/server/models/guards.d.ts +3 -1
  157. package/server/models/guards.js +9 -1
  158. package/server/text-transform/transformers.js +3 -1
  159. package/widget/index.js +1 -1
  160. package/build/cjs/components/Image/i18n/en.json +0 -3
  161. package/build/cjs/components/Image/i18n/index.d.ts +0 -2
  162. package/build/cjs/components/Image/i18n/index.js +0 -8
  163. package/build/cjs/components/Image/i18n/ru.json +0 -3
  164. package/build/esm/components/Image/i18n/en.json +0 -3
  165. package/build/esm/components/Image/i18n/index.d.ts +0 -2
  166. package/build/esm/components/Image/i18n/index.js +0 -5
  167. package/build/esm/components/Image/i18n/ru.json +0 -3
@@ -1,5 +1,5 @@
1
- import { ImageProps, imageUrlPattern } from '../../components/Image/schema';
2
- import { CustomControlsButtonPositioning, CustomControlsType, MediaVideoControlsType, Theme, } from '../../models';
1
+ import { ImageProps } from '../../components/Image/schema';
2
+ import { CustomControlsButtonPositioning, CustomControlsType, MediaVideoControlsType, QuoteType, Theme, } from '../../models';
3
3
  import { AnalyticsEventSchema } from './event';
4
4
  import { pixelEvents } from './pixel';
5
5
  export const mediaDirection = ['media-content', 'content-media'];
@@ -16,6 +16,7 @@ export const fileLinkTypes = ['vertical', 'horizontal'];
16
16
  export const dividerEnum = { enum: [0, 'xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', 'xxxl'] };
17
17
  export const sizeNumber = { type: 'number', maximum: 12, minimum: 1 };
18
18
  export const contentThemes = ['default', 'dark', 'light'];
19
+ export const quoteTypes = Object.values(QuoteType);
19
20
  export const customControlsType = [
20
21
  CustomControlsType.WithMuteButton,
21
22
  CustomControlsType.WithPlayPauseButton,
@@ -207,6 +208,8 @@ export const LinkProps = {
207
208
  contentType: 'text',
208
209
  }, url: {
209
210
  type: 'string',
211
+ }, urlTitle: {
212
+ type: 'string',
210
213
  }, arrow: {
211
214
  type: 'boolean',
212
215
  }, theme: {
@@ -267,10 +270,7 @@ export const authorItem = {
267
270
  type: 'string',
268
271
  contentType: 'text',
269
272
  },
270
- avatar: {
271
- type: 'string',
272
- pattern: imageUrlPattern,
273
- },
273
+ avatar: ImageProps,
274
274
  description: {
275
275
  type: 'string',
276
276
  contentType: 'yfm',
@@ -285,6 +285,9 @@ export const ButtonProps = {
285
285
  url: {
286
286
  type: 'string',
287
287
  },
288
+ urlTitle: {
289
+ type: 'string',
290
+ },
288
291
  primary: {
289
292
  type: 'boolean',
290
293
  },
@@ -438,6 +441,9 @@ export const AnchorProps = {
438
441
  url: {
439
442
  type: 'string',
440
443
  },
444
+ urlTitle: {
445
+ type: 'string',
446
+ },
441
447
  },
442
448
  };
443
449
  export const BlockBaseProps = Object.assign(Object.assign({}, BaseProps), { anchor: AnchorProps, visible: {
@@ -464,6 +470,9 @@ export const TitleProps = {
464
470
  url: {
465
471
  type: 'string',
466
472
  },
473
+ urlTitle: {
474
+ type: 'string',
475
+ },
467
476
  resetMargin: {
468
477
  type: 'boolean',
469
478
  },
@@ -6,6 +6,9 @@ export declare const BackgroundCard: {
6
6
  url: {
7
7
  type: string;
8
8
  };
9
+ urlTitle: {
10
+ type: string;
11
+ };
9
12
  background: {
10
13
  oneOf: (({
11
14
  type: string;
@@ -163,6 +166,9 @@ export declare const BackgroundCard: {
163
166
  url: {
164
167
  type: string;
165
168
  };
169
+ urlTitle: {
170
+ type: string;
171
+ };
166
172
  resetMargin: {
167
173
  type: string;
168
174
  };
@@ -10,6 +10,8 @@ export const BackgroundCard = {
10
10
  required: ['title', 'text'],
11
11
  properties: Object.assign(Object.assign(Object.assign(Object.assign({}, BaseProps), CardBase), BackgroundCardContentProps), { url: {
12
12
  type: 'string',
13
+ }, urlTitle: {
14
+ type: 'string',
13
15
  }, background: withTheme(ImageObjectProps), backgroundColor: {
14
16
  type: 'string',
15
17
  }, paddingBottom: {
@@ -6,6 +6,9 @@ export declare const BasicCard: {
6
6
  url: {
7
7
  type: string;
8
8
  };
9
+ urlTitle: {
10
+ type: string;
11
+ };
9
12
  icon: {
10
13
  oneOf: ({
11
14
  type: string;
@@ -50,6 +53,9 @@ export declare const BasicCard: {
50
53
  url: {
51
54
  type: string;
52
55
  };
56
+ urlTitle: {
57
+ type: string;
58
+ };
53
59
  resetMargin: {
54
60
  type: string;
55
61
  };
@@ -9,6 +9,8 @@ export const BasicCard = {
9
9
  required: [],
10
10
  properties: Object.assign(Object.assign(Object.assign(Object.assign({}, BaseProps), CardBase), BasicCardContentProps), { url: {
11
11
  type: 'string',
12
+ }, urlTitle: {
13
+ type: 'string',
12
14
  }, icon: ImageProps, target: {
13
15
  type: 'string',
14
16
  enum: ['_blank', '_parent', '_top', '_self'],
@@ -59,6 +59,9 @@ export declare const ContentBase: {
59
59
  url: {
60
60
  type: string;
61
61
  };
62
+ urlTitle: {
63
+ type: string;
64
+ };
62
65
  resetMargin: {
63
66
  type: string;
64
67
  };
@@ -147,6 +150,9 @@ export declare const ContentBlock: {
147
150
  url: {
148
151
  type: string;
149
152
  };
153
+ urlTitle: {
154
+ type: string;
155
+ };
150
156
  resetMargin: {
151
157
  type: string;
152
158
  };
@@ -0,0 +1,22 @@
1
+ export declare const HubspotFormProps: {
2
+ type: string;
3
+ required: string[];
4
+ properties: {
5
+ region: {
6
+ type: string;
7
+ };
8
+ portalId: {
9
+ type: string;
10
+ };
11
+ formId: {
12
+ type: string;
13
+ };
14
+ formInstanceId: {
15
+ type: string;
16
+ };
17
+ type: {};
18
+ when: {
19
+ type: string;
20
+ };
21
+ };
22
+ };
@@ -0,0 +1,14 @@
1
+ import { BaseProps } from '../../schema/validators/common';
2
+ export const HubspotFormProps = {
3
+ type: 'object',
4
+ required: ['portalId', 'formId'],
5
+ properties: Object.assign(Object.assign({}, BaseProps), { region: {
6
+ type: 'string',
7
+ }, portalId: {
8
+ type: 'string',
9
+ }, formId: {
10
+ type: 'string',
11
+ }, formInstanceId: {
12
+ type: 'string',
13
+ } }),
14
+ };
@@ -270,6 +270,9 @@ export declare const LayoutItem: {
270
270
  url: {
271
271
  type: string;
272
272
  };
273
+ urlTitle: {
274
+ type: string;
275
+ };
273
276
  resetMargin: {
274
277
  type: string;
275
278
  };
@@ -60,14 +60,23 @@ unpredictable css rules order in build */
60
60
  font-size: var(--g-text-body-3-font-size);
61
61
  line-height: var(--g-text-body-3-line-height);
62
62
  }
63
- .pc-quote__content::before {
63
+ .pc-quote__content_quote-type_chevron::before {
64
64
  position: absolute;
65
65
  top: -1px;
66
66
  left: -10px;
67
67
  content: "«";
68
68
  }
69
- .pc-quote__text::after {
70
- content: "».";
69
+ .pc-quote__content_quote-type_chevron .pc-quote__text::after {
70
+ content: "»";
71
+ }
72
+ .pc-quote__content_quote-type_english-double::before {
73
+ position: absolute;
74
+ top: -1px;
75
+ left: -8px;
76
+ content: "“";
77
+ }
78
+ .pc-quote__content_quote-type_english-double .pc-quote__text::after {
79
+ content: "”";
71
80
  }
72
81
  .pc-quote__image {
73
82
  width: 100%;
@@ -4,12 +4,12 @@ import { Author, HTML, Image } from '../../components';
4
4
  import { getMediaImage } from '../../components/Media/Image/utils';
5
5
  import { useTheme } from '../../context/theme';
6
6
  import { useAnalytics } from '../../hooks';
7
- import { AuthorType, DefaultEventNames } from '../../models';
7
+ import { AuthorType, DefaultEventNames, QuoteType } from '../../models';
8
8
  import { block, getThemedValue } from '../../utils';
9
9
  import './Quote.css';
10
10
  const b = block('quote');
11
11
  const Quote = (props) => {
12
- const { theme: textTheme = 'light', color, image, border = 'shadow', text, logo, author, url, buttonText, } = props;
12
+ const { theme: textTheme = 'light', color, image, border = 'shadow', text, logo, author, url, urlTitle, buttonText, quoteType = QuoteType.Chevron, } = props;
13
13
  const theme = useTheme();
14
14
  const imageThemed = getThemedValue(image, theme);
15
15
  const imageData = getMediaImage(imageThemed);
@@ -17,12 +17,13 @@ const Quote = (props) => {
17
17
  const handleButtonClick = useCallback(() => handleAnalytics(), [handleAnalytics]);
18
18
  const renderFooter = Boolean(author || url) && (React.createElement("div", { className: b('author-wrapper') },
19
19
  author && (React.createElement(Author, { className: b('author', { theme: textTheme }), author: author, type: AuthorType.Line })),
20
- url && buttonText && (React.createElement(Button, { view: "outlined", size: "xl", href: url, className: b('link-button', { theme: textTheme }), onClick: handleButtonClick }, buttonText))));
20
+ url && buttonText && (React.createElement(Button, { view: "outlined", size: "xl", href: url, className: b('link-button', { theme: textTheme }), onClick: handleButtonClick, title: urlTitle }, buttonText))));
21
+ const logoProps = getMediaImage(logo);
21
22
  return (React.createElement("div", { className: b({ theme: textTheme, border }), style: color ? { backgroundColor: color } : {} },
22
23
  React.createElement("div", { key: text, className: b('content-wrapper') },
23
24
  React.createElement("div", null,
24
- React.createElement(Image, { className: b('logo'), src: logo }),
25
- React.createElement("div", { className: b('content') },
25
+ React.createElement(Image, Object.assign({ className: b('logo') }, logoProps)),
26
+ React.createElement("div", { className: b('content', { 'quote-type': quoteType }) },
26
27
  React.createElement("span", { className: b('text') },
27
28
  React.createElement(HTML, null, text)))),
28
29
  renderFooter),
@@ -32,8 +32,18 @@ export declare const Quote: {
32
32
  })[];
33
33
  };
34
34
  logo: {
35
- type: string;
36
- pattern: string;
35
+ oneOf: ({
36
+ type: string;
37
+ properties: {
38
+ when: {
39
+ type: string;
40
+ };
41
+ };
42
+ } | {
43
+ type: string;
44
+ pattern: string;
45
+ optionName: string;
46
+ })[];
37
47
  };
38
48
  color: {
39
49
  type: string;
@@ -41,6 +51,9 @@ export declare const Quote: {
41
51
  url: {
42
52
  type: string;
43
53
  };
54
+ urlTitle: {
55
+ type: string;
56
+ };
44
57
  buttonText: {
45
58
  type: string;
46
59
  };
@@ -61,8 +74,18 @@ export declare const Quote: {
61
74
  contentType: string;
62
75
  };
63
76
  avatar: {
64
- type: string;
65
- pattern: string;
77
+ oneOf: ({
78
+ type: string;
79
+ properties: {
80
+ when: {
81
+ type: string;
82
+ };
83
+ };
84
+ } | {
85
+ type: string;
86
+ pattern: string;
87
+ optionName: string;
88
+ })[];
66
89
  };
67
90
  description: {
68
91
  type: string;
@@ -70,6 +93,10 @@ export declare const Quote: {
70
93
  };
71
94
  };
72
95
  };
96
+ quoteType: {
97
+ type: string;
98
+ enum: import("../..").QuoteType[];
99
+ };
73
100
  type: {};
74
101
  when: {
75
102
  type: string;
@@ -1,5 +1,5 @@
1
- import { ImageProps, imageUrlPattern } from '../../components/Image/schema';
2
- import { BaseProps, ThemeProps, authorItem, withTheme } from '../../schema/validators/common';
1
+ import { ImageProps } from '../../components/Image/schema';
2
+ import { BaseProps, ThemeProps, authorItem, quoteTypes, withTheme, } from '../../schema/validators/common';
3
3
  export const Quote = {
4
4
  quote: {
5
5
  additionalProperties: false,
@@ -7,15 +7,17 @@ export const Quote = {
7
7
  properties: Object.assign(Object.assign({}, BaseProps), { text: {
8
8
  type: 'string',
9
9
  contentType: 'text',
10
- }, image: withTheme(ImageProps), logo: {
11
- type: 'string',
12
- pattern: imageUrlPattern,
13
- }, color: {
10
+ }, image: withTheme(ImageProps), logo: ImageProps, color: {
14
11
  type: 'string',
15
12
  }, url: {
16
13
  type: 'string',
14
+ }, urlTitle: {
15
+ type: 'string',
17
16
  }, buttonText: {
18
17
  type: 'string',
19
- }, theme: ThemeProps, author: authorItem }),
18
+ }, theme: ThemeProps, author: authorItem, quoteType: {
19
+ type: 'string',
20
+ enum: quoteTypes,
21
+ } }),
20
22
  },
21
23
  };
@@ -40,7 +40,9 @@ function transformBlock(lang, blocksConfig, block, plugins) {
40
40
  });
41
41
  }
42
42
  if ('children' in block && block.children) {
43
- block.children = transformBlocks(block.children, lang, blocksConfig);
43
+ block.children = transformBlocks(block.children, lang, blocksConfig, {
44
+ plugins,
45
+ });
44
46
  }
45
47
  return block;
46
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "4.28.1",
3
+ "version": "4.29.1-alpha.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -84,6 +84,7 @@
84
84
  "@gravity-ui/components": "^2.4.0",
85
85
  "@gravity-ui/dynamic-forms": "^2.3.0",
86
86
  "@gravity-ui/i18n": "^1.0.0",
87
+ "@react-spring/web": "^9.7.3",
87
88
  "ajv": "^8.12.0",
88
89
  "final-form": "^4.20.9",
89
90
  "github-buttons": "2.23.0",
@@ -93,7 +94,6 @@
93
94
  "react-monaco-editor": "^0.53.0",
94
95
  "react-player": "^2.9.0",
95
96
  "react-slick": "^0.29.0",
96
- "react-spring": "^9.7.2",
97
97
  "react-transition-group": "^4.4.2",
98
98
  "react-waypoint": "^10.1.0",
99
99
  "sanitize-html": "2.6.1",
@@ -1,3 +1,2 @@
1
1
  export type ArrowDirection = 'left' | 'right';
2
- export interface ReactPlayerBlockHandler extends Pick<HTMLVideoElement, 'play' | 'pause' | 'addEventListener'> {
3
- }
2
+ export type ReactPlayerBlockHandler = Pick<HTMLVideoElement, 'play' | 'pause' | 'addEventListener'> | undefined;
@@ -1,10 +1,10 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { ButtonSize } from '@gravity-ui/uikit';
3
3
  import { GridColumnSize, GridColumnSizesType } from '../../grid/types';
4
4
  import { ThemeSupporting } from '../../utils';
5
5
  import { AnalyticsEventsBase } from '../common';
6
- import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps } from './common';
7
- import { BannerCardProps, SubBlock, SubBlockModels } from './sub-blocks';
6
+ import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps, YandexFormProps } from './common';
7
+ import { BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels } from './sub-blocks';
8
8
  export declare enum BlockType {
9
9
  PromoFeaturesBlock = "promo-features-block",
10
10
  ExtendedFeaturesBlock = "extended-features-block",
@@ -23,7 +23,8 @@ export declare enum BlockType {
23
23
  ContentLayoutBlock = "content-layout-block",
24
24
  ShareBlock = "share-block",
25
25
  MapBlock = "map-block",
26
- FilterBlock = "filter-block"
26
+ FilterBlock = "filter-block",
27
+ FormBlock = "form-block"
27
28
  }
28
29
  export declare const BlockTypes: BlockType[];
29
30
  export declare const HeaderBlockTypes: BlockType[];
@@ -109,6 +110,7 @@ export interface HeaderBlockProps {
109
110
  verticalOffset?: 's' | 'm' | 'l' | 'xl';
110
111
  breadcrumbs?: HeaderBreadCrumbsProps;
111
112
  status?: JSX.Element;
113
+ renderTitle?: (title: string) => React.ReactNode;
112
114
  }
113
115
  export interface ExtendedFeaturesItem extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {
114
116
  title: string;
@@ -294,6 +296,29 @@ export interface ShareBlockProps {
294
296
  items: PCShareSocialNetwork[];
295
297
  title?: string;
296
298
  }
299
+ export declare enum FormBlockDataTypes {
300
+ YANDEX = "yandex",
301
+ HUBSPOT_INLINE = "hubspot-inline"
302
+ }
303
+ export declare enum FormBlockDirection {
304
+ FormContent = "form-content",
305
+ ContentForm = "content-form",
306
+ Center = "center"
307
+ }
308
+ export interface FormBlockYandexData {
309
+ yandex: YandexFormProps;
310
+ }
311
+ export interface FormBlockHubspotData {
312
+ hubspot: HubspotFormProps;
313
+ }
314
+ export type FormBlockData = FormBlockYandexData | FormBlockHubspotData;
315
+ export interface FormBlockProps {
316
+ formData: FormBlockData;
317
+ title?: string;
318
+ textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;
319
+ direction?: FormBlockDirection;
320
+ background?: BackgroundImageProps;
321
+ }
297
322
  export type HeaderBlockModel = {
298
323
  type: BlockType.HeaderBlock;
299
324
  } & HeaderBlockProps;
@@ -348,6 +373,9 @@ export type ContentLayoutBlockModel = {
348
373
  export type ShareBLockModel = {
349
374
  type: BlockType.ShareBlock;
350
375
  } & ShareBlockProps;
351
- type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel;
376
+ export type FormBlockModel = {
377
+ type: BlockType.FormBlock;
378
+ } & FormBlockProps;
379
+ type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel | FormBlockModel;
352
380
  export type Block = BlockModels & BlockBaseProps;
353
381
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PCShareSocialNetwork = exports.SliderType = exports.SliderBreakpointNames = exports.HeaderBlockTypes = exports.BlockTypes = exports.BlockType = void 0;
3
+ exports.FormBlockDirection = exports.FormBlockDataTypes = exports.PCShareSocialNetwork = exports.SliderType = exports.SliderBreakpointNames = exports.HeaderBlockTypes = exports.BlockTypes = exports.BlockType = void 0;
4
4
  var BlockType;
5
5
  (function (BlockType) {
6
6
  BlockType["PromoFeaturesBlock"] = "promo-features-block";
@@ -21,6 +21,7 @@ var BlockType;
21
21
  BlockType["ShareBlock"] = "share-block";
22
22
  BlockType["MapBlock"] = "map-block";
23
23
  BlockType["FilterBlock"] = "filter-block";
24
+ BlockType["FormBlock"] = "form-block";
24
25
  })(BlockType = exports.BlockType || (exports.BlockType = {}));
25
26
  exports.BlockTypes = Object.values(BlockType);
26
27
  exports.HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];
@@ -44,3 +45,14 @@ var PCShareSocialNetwork;
44
45
  PCShareSocialNetwork["Facebook"] = "facebook";
45
46
  PCShareSocialNetwork["LinkedIn"] = "linkedin";
46
47
  })(PCShareSocialNetwork = exports.PCShareSocialNetwork || (exports.PCShareSocialNetwork = {}));
48
+ var FormBlockDataTypes;
49
+ (function (FormBlockDataTypes) {
50
+ FormBlockDataTypes["YANDEX"] = "yandex";
51
+ FormBlockDataTypes["HUBSPOT_INLINE"] = "hubspot-inline";
52
+ })(FormBlockDataTypes = exports.FormBlockDataTypes || (exports.FormBlockDataTypes = {}));
53
+ var FormBlockDirection;
54
+ (function (FormBlockDirection) {
55
+ FormBlockDirection["FormContent"] = "form-content";
56
+ FormBlockDirection["ContentForm"] = "content-form";
57
+ FormBlockDirection["Center"] = "center";
58
+ })(FormBlockDirection = exports.FormBlockDirection || (exports.FormBlockDirection = {}));
@@ -1,7 +1,7 @@
1
1
  import React, { CSSProperties, ReactNode } from 'react';
2
2
  import { ButtonView, ButtonProps as UikitButtonProps } from '@gravity-ui/uikit';
3
3
  import { ThemeSupporting } from '../../utils';
4
- import { AnalyticsEventsBase, ClassNameProps, PixelEventType, QAProps } from '../common';
4
+ import { AnalyticsEventsBase, ClassNameProps, PixelEvent, PixelEventType, QAProps } from '../common';
5
5
  export declare enum AuthorType {
6
6
  Column = "column",
7
7
  Line = "line"
@@ -42,6 +42,10 @@ export declare enum MediaVideoControlsType {
42
42
  Default = "default",
43
43
  Custom = "custom"
44
44
  }
45
+ export declare enum QuoteType {
46
+ Chevron = "chevron",
47
+ EnglishDouble = "english-double"
48
+ }
45
49
  export type TextTheme = 'light' | 'dark';
46
50
  export type TextSize = 'xs' | 's' | 'm' | 'l';
47
51
  export type DividerSize = '0' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl';
@@ -251,7 +255,7 @@ export interface AuthorItem {
251
255
  firstName: string;
252
256
  secondName: string;
253
257
  description?: string;
254
- avatar?: string | JSX.Element;
258
+ avatar?: ImageProps | JSX.Element;
255
259
  }
256
260
  export interface HeaderBreadCrumbsProps extends ClassNameProps {
257
261
  items: {
@@ -333,4 +337,20 @@ export interface TitleProps {
333
337
  title?: TitleItemProps | string;
334
338
  subtitle?: string;
335
339
  }
340
+ export interface YandexFormProps extends AnalyticsEventsBase {
341
+ id: number | string;
342
+ containerId?: string;
343
+ theme?: string;
344
+ className?: string;
345
+ headerHeight?: number;
346
+ customFormOrigin?: string;
347
+ customFormSection?: string;
348
+ params?: {
349
+ [key: string]: string;
350
+ };
351
+ onSubmit?: () => void;
352
+ onLoad?: () => void;
353
+ metrikaGoals?: string | string[];
354
+ pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
355
+ }
336
356
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MediaVideoControlsType = exports.MediaVideoType = exports.CustomControlsButtonPositioning = exports.CustomControlsType = exports.PlayButtonThemes = exports.PlayButtonType = exports.PriceLabelColor = exports.PriceDetailsType = exports.AuthorType = void 0;
3
+ exports.QuoteType = exports.MediaVideoControlsType = exports.MediaVideoType = exports.CustomControlsButtonPositioning = exports.CustomControlsType = exports.PlayButtonThemes = exports.PlayButtonType = exports.PriceLabelColor = exports.PriceDetailsType = exports.AuthorType = void 0;
4
4
  // enums
5
5
  var AuthorType;
6
6
  (function (AuthorType) {
@@ -51,3 +51,8 @@ var MediaVideoControlsType;
51
51
  MediaVideoControlsType["Default"] = "default";
52
52
  MediaVideoControlsType["Custom"] = "custom";
53
53
  })(MediaVideoControlsType = exports.MediaVideoControlsType || (exports.MediaVideoControlsType = {}));
54
+ var QuoteType;
55
+ (function (QuoteType) {
56
+ QuoteType["Chevron"] = "chevron";
57
+ QuoteType["EnglishDouble"] = "english-double";
58
+ })(QuoteType = exports.QuoteType || (exports.QuoteType = {}));
@@ -1,4 +1,4 @@
1
- import { ClassNameProps } from '../../models';
1
+ import { ClassNameProps, QuoteType } from '../../models';
2
2
  import { ThemeSupporting } from '../../utils';
3
3
  import { HubspotEventData, HubspotEventHandlers } from '../../utils/hubspot';
4
4
  import { AnalyticsEventsBase, PixelEvent } from '../common';
@@ -64,12 +64,14 @@ export interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsB
64
64
  export interface QuoteProps extends Themable, CardBaseProps {
65
65
  text: string;
66
66
  image: ThemedImage;
67
- logo: string;
67
+ logo: ImageProps;
68
68
  color?: string;
69
69
  url?: string;
70
+ urlTitle?: string;
70
71
  author?: AuthorItem;
71
72
  buttonText?: string;
72
73
  theme?: TextTheme;
74
+ quoteType?: QuoteType;
73
75
  }
74
76
  export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered'> {
75
77
  url?: string;
@@ -80,6 +82,7 @@ export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase,
80
82
  }
81
83
  export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {
82
84
  url: string;
85
+ urlTitle?: string;
83
86
  icon?: ImageProps;
84
87
  target?: string;
85
88
  iconPosition?: IconPosition;
@@ -1,4 +1,6 @@
1
- import { Block, ConstructorItem } from './';
1
+ import { Block, ConstructorItem, FormBlockData, FormBlockHubspotData, FormBlockYandexData } from './';
2
2
  import { MetrikaGoal, NewMetrikaGoal } from './index';
3
3
  export declare function isBlock(block: ConstructorItem): block is Block;
4
4
  export declare function isNewMetrikaFormat(metrika: MetrikaGoal): metrika is NewMetrikaGoal[];
5
+ export declare function isYandexDataForm(data: FormBlockData): data is FormBlockYandexData;
6
+ export declare function isHubspotDataForm(data: FormBlockData): data is FormBlockHubspotData;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isNewMetrikaFormat = exports.isBlock = void 0;
3
+ exports.isHubspotDataForm = exports.isYandexDataForm = exports.isNewMetrikaFormat = exports.isBlock = void 0;
4
4
  const _1 = require("./");
5
5
  function isBlock(block) {
6
6
  return block.type in _1.BlockTypes;
@@ -10,3 +10,11 @@ function isNewMetrikaFormat(metrika) {
10
10
  return Boolean(Array.isArray(metrika) && metrika.length && typeof metrika[0] === 'object');
11
11
  }
12
12
  exports.isNewMetrikaFormat = isNewMetrikaFormat;
13
+ function isYandexDataForm(data) {
14
+ return Boolean(data.yandex);
15
+ }
16
+ exports.isYandexDataForm = isYandexDataForm;
17
+ function isHubspotDataForm(data) {
18
+ return Boolean(data.hubspot);
19
+ }
20
+ exports.isHubspotDataForm = isHubspotDataForm;
@@ -46,7 +46,9 @@ function transformBlock(lang, blocksConfig, block, plugins) {
46
46
  });
47
47
  }
48
48
  if ('children' in block && block.children) {
49
- block.children = transformBlocks(block.children, lang, blocksConfig);
49
+ block.children = transformBlocks(block.children, lang, blocksConfig, {
50
+ plugins,
51
+ });
50
52
  }
51
53
  return block;
52
54
  }