@gravity-ui/page-constructor 4.31.1-alpha.0 → 4.33.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 (116) hide show
  1. package/build/cjs/blocks/Header/Header.js +6 -2
  2. package/build/cjs/blocks/Tabs/Tabs.js +8 -1
  3. package/build/cjs/blocks/index.d.ts +0 -1
  4. package/build/cjs/blocks/index.js +1 -3
  5. package/build/cjs/components/BackLink/BackLink.d.ts +3 -2
  6. package/build/cjs/components/BackLink/BackLink.js +2 -2
  7. package/build/cjs/components/Button/Button.d.ts +0 -1
  8. package/build/cjs/components/DefaultVideo/DefaultVideo.css +5 -0
  9. package/build/cjs/components/DefaultVideo/DefaultVideo.d.ts +11 -0
  10. package/build/cjs/components/DefaultVideo/DefaultVideo.js +60 -0
  11. package/build/cjs/components/FileLink/FileLink.js +2 -2
  12. package/build/cjs/components/FullscreenImage/FullscreenImage.d.ts +2 -1
  13. package/build/cjs/components/FullscreenImage/FullscreenImage.js +2 -2
  14. package/build/cjs/components/Image/Image.js +2 -2
  15. package/build/cjs/components/Link/Link.js +4 -4
  16. package/build/cjs/components/Media/Video/Video.css +0 -5
  17. package/build/cjs/components/Media/Video/Video.js +3 -7
  18. package/build/cjs/components/Title/Title.d.ts +2 -1
  19. package/build/cjs/components/Title/Title.js +2 -2
  20. package/build/cjs/components/Title/TitleItem.css +3 -3
  21. package/build/cjs/components/YandexForm/YandexForm.d.ts +17 -2
  22. package/build/cjs/components/YandexForm/YandexForm.js +4 -6
  23. package/build/cjs/constructor-items.d.ts +0 -1
  24. package/build/cjs/constructor-items.js +0 -1
  25. package/build/cjs/models/constructor-items/blocks.d.ts +6 -31
  26. package/build/cjs/models/constructor-items/blocks.js +1 -13
  27. package/build/cjs/models/constructor-items/common.d.ts +6 -19
  28. package/build/cjs/models/guards.d.ts +1 -3
  29. package/build/cjs/models/guards.js +1 -9
  30. package/build/cjs/models/navigation.d.ts +1 -0
  31. package/build/cjs/navigation/components/Logo/Logo.css +1 -0
  32. package/build/cjs/navigation/components/Logo/Logo.js +10 -5
  33. package/build/cjs/schema/constants.js +1 -2
  34. package/build/cjs/schema/validators/blocks.d.ts +0 -1
  35. package/build/cjs/schema/validators/blocks.js +0 -1
  36. package/build/cjs/sub-blocks/BasicCard/BasicCard.js +5 -2
  37. package/build/cjs/sub-blocks/Content/Content.js +12 -5
  38. package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +10 -10
  39. package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +1 -0
  40. package/build/cjs/sub-blocks/Quote/Quote.css +0 -2
  41. package/build/esm/blocks/Header/Header.js +6 -2
  42. package/build/esm/blocks/Tabs/Tabs.js +8 -1
  43. package/build/esm/blocks/index.d.ts +0 -1
  44. package/build/esm/blocks/index.js +0 -1
  45. package/build/esm/components/BackLink/BackLink.d.ts +3 -2
  46. package/build/esm/components/BackLink/BackLink.js +2 -2
  47. package/build/esm/components/Button/Button.d.ts +0 -1
  48. package/build/esm/components/DefaultVideo/DefaultVideo.css +5 -0
  49. package/build/esm/components/DefaultVideo/DefaultVideo.d.ts +12 -0
  50. package/build/esm/components/DefaultVideo/DefaultVideo.js +57 -0
  51. package/build/esm/components/FileLink/FileLink.js +2 -2
  52. package/build/esm/components/FullscreenImage/FullscreenImage.d.ts +2 -1
  53. package/build/esm/components/FullscreenImage/FullscreenImage.js +2 -2
  54. package/build/esm/components/Image/Image.js +3 -2
  55. package/build/esm/components/Link/Link.js +4 -4
  56. package/build/esm/components/Media/Video/Video.css +0 -5
  57. package/build/esm/components/Media/Video/Video.js +3 -7
  58. package/build/esm/components/Title/Title.d.ts +2 -1
  59. package/build/esm/components/Title/Title.js +2 -2
  60. package/build/esm/components/Title/TitleItem.css +3 -3
  61. package/build/esm/components/YandexForm/YandexForm.d.ts +17 -2
  62. package/build/esm/components/YandexForm/YandexForm.js +3 -5
  63. package/build/esm/constructor-items.d.ts +0 -1
  64. package/build/esm/constructor-items.js +1 -2
  65. package/build/esm/models/constructor-items/blocks.d.ts +6 -31
  66. package/build/esm/models/constructor-items/blocks.js +0 -12
  67. package/build/esm/models/constructor-items/common.d.ts +6 -19
  68. package/build/esm/models/guards.d.ts +1 -3
  69. package/build/esm/models/guards.js +1 -7
  70. package/build/esm/models/navigation.d.ts +1 -0
  71. package/build/esm/navigation/components/Logo/Logo.css +1 -0
  72. package/build/esm/navigation/components/Logo/Logo.js +11 -6
  73. package/build/esm/schema/constants.js +2 -3
  74. package/build/esm/schema/validators/blocks.d.ts +0 -1
  75. package/build/esm/schema/validators/blocks.js +0 -1
  76. package/build/esm/sub-blocks/BasicCard/BasicCard.js +5 -2
  77. package/build/esm/sub-blocks/Content/Content.js +12 -5
  78. package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +10 -10
  79. package/build/esm/sub-blocks/LayoutItem/utils.d.ts +1 -0
  80. package/build/esm/sub-blocks/Quote/Quote.css +0 -2
  81. package/package.json +1 -1
  82. package/server/models/constructor-items/blocks.d.ts +6 -31
  83. package/server/models/constructor-items/blocks.js +1 -13
  84. package/server/models/constructor-items/common.d.ts +6 -19
  85. package/server/models/guards.d.ts +1 -3
  86. package/server/models/guards.js +1 -9
  87. package/server/models/navigation.d.ts +1 -0
  88. package/widget/index.js +1 -1
  89. package/build/cjs/blocks/Form/Form.css +0 -136
  90. package/build/cjs/blocks/Form/Form.d.ts +0 -4
  91. package/build/cjs/blocks/Form/Form.js +0 -61
  92. package/build/cjs/blocks/Form/HubspotInlineForm.d.ts +0 -7
  93. package/build/cjs/blocks/Form/HubspotInlineForm.js +0 -14
  94. package/build/cjs/blocks/Form/InnerForm/InnerForm.d.ts +0 -9
  95. package/build/cjs/blocks/Form/InnerForm/InnerForm.js +0 -28
  96. package/build/cjs/blocks/Form/schema.d.ts +0 -202
  97. package/build/cjs/blocks/Form/schema.js +0 -44
  98. package/build/cjs/components/YandexForm/schema.d.ts +0 -16
  99. package/build/cjs/components/YandexForm/schema.js +0 -13
  100. package/build/cjs/editor/data/templates/form-block.json +0 -20
  101. package/build/cjs/sub-blocks/HubspotForm/schema.d.ts +0 -22
  102. package/build/cjs/sub-blocks/HubspotForm/schema.js +0 -17
  103. package/build/esm/blocks/Form/Form.css +0 -136
  104. package/build/esm/blocks/Form/Form.d.ts +0 -5
  105. package/build/esm/blocks/Form/Form.js +0 -59
  106. package/build/esm/blocks/Form/HubspotInlineForm.d.ts +0 -7
  107. package/build/esm/blocks/Form/HubspotInlineForm.js +0 -12
  108. package/build/esm/blocks/Form/InnerForm/InnerForm.d.ts +0 -9
  109. package/build/esm/blocks/Form/InnerForm/InnerForm.js +0 -26
  110. package/build/esm/blocks/Form/schema.d.ts +0 -202
  111. package/build/esm/blocks/Form/schema.js +0 -40
  112. package/build/esm/components/YandexForm/schema.d.ts +0 -16
  113. package/build/esm/components/YandexForm/schema.js +0 -10
  114. package/build/esm/editor/data/templates/form-block.json +0 -20
  115. package/build/esm/sub-blocks/HubspotForm/schema.d.ts +0 -22
  116. package/build/esm/sub-blocks/HubspotForm/schema.js +0 -14
@@ -1,8 +1,8 @@
1
1
  import React, { useEffect, useMemo, useRef } from 'react';
2
2
  import { MediaVideoType } from '../../../models';
3
3
  import { block, getQaAttrubutes } from '../../../utils';
4
+ import { DefaultVideo } from '../../DefaultVideo/DefaultVideo';
4
5
  import ReactPlayerBlock from '../../ReactPlayer/ReactPlayer';
5
- import { getVideoTypesWithPriority } from './utils';
6
6
  import './Video.css';
7
7
  const b = block('media-component-video');
8
8
  const Video = (props) => {
@@ -45,13 +45,9 @@ const Video = (props) => {
45
45
  ]);
46
46
  const defaultVideoBlock = useMemo(() => {
47
47
  return video.src.length && !hasVideoFallback ? (React.createElement("div", { className: b('wrap', videoClassName), style: { height }, "data-qa": qaAttributes.default },
48
- React.createElement("video", { disablePictureInPicture: true, playsInline: true,
49
- // @ts-ignore
50
- // eslint-disable-next-line react/no-unknown-property
51
- pip: "false", className: b('item'), ref: ref, preload: "metadata", muted: true, "aria-label": video.ariaLabel }, getVideoTypesWithPriority(video.src).map(({ src, type }, index) => (React.createElement("source", { key: index, src: src, type: type, "data-qa": qaAttributes.source })))))) : null;
48
+ React.createElement(DefaultVideo, { ref: ref, video: video, qa: qaAttributes.source }))) : null;
52
49
  }, [
53
- video.src,
54
- video.ariaLabel,
50
+ video,
55
51
  hasVideoFallback,
56
52
  videoClassName,
57
53
  height,
@@ -3,6 +3,7 @@ import { ClassNameProps, TitleProps as TitleParams } from '../../models';
3
3
  import './Title.css';
4
4
  export interface TitleProps extends TitleParams {
5
5
  colSizes?: GridColumnSizesType;
6
+ id?: string;
6
7
  }
7
- declare const Title: ({ title, subtitle, className, colSizes, }: TitleProps & ClassNameProps) => JSX.Element | null;
8
+ declare const Title: ({ title, subtitle, className, colSizes, id, }: TitleProps & ClassNameProps) => JSX.Element | null;
8
9
  export default Title;
@@ -6,12 +6,12 @@ import YFMWrapper from '../YFMWrapper/YFMWrapper';
6
6
  import TitleItem from './TitleItem';
7
7
  import './Title.css';
8
8
  const b = block('title');
9
- const Title = ({ title, subtitle, className, colSizes = { all: 12, sm: 8 }, }) => {
9
+ const Title = ({ title, subtitle, className, colSizes = { all: 12, sm: 8 }, id, }) => {
10
10
  if (!title && !subtitle) {
11
11
  return null;
12
12
  }
13
13
  const _a = !title || typeof title === 'string' ? { text: title } : title, { text } = _a, titleProps = __rest(_a, ["text"]);
14
- return (React.createElement("div", { className: b(null, className) },
14
+ return (React.createElement("div", { className: b(null, className), id: id },
15
15
  text && (React.createElement(Col, { reset: true, sizes: colSizes },
16
16
  React.createElement(TitleItem, Object.assign({ text: text }, titleProps)))),
17
17
  subtitle && (React.createElement(Col, { reset: true, sizes: colSizes },
@@ -50,13 +50,13 @@ unpredictable css rules order in build */
50
50
  }
51
51
  }
52
52
  .pc-title-item__arrow {
53
- margin-top: 10px;
53
+ margin-top: 9px;
54
54
  }
55
55
  .pc-title-item__arrow_size_xs {
56
- margin-top: 7px;
56
+ margin-top: 6px;
57
57
  }
58
58
  .pc-title-item__arrow_size_s {
59
- margin-top: 5px;
59
+ margin-top: 4px;
60
60
  }
61
61
  .pc-title-item__link {
62
62
  color: inherit;
@@ -1,5 +1,20 @@
1
- import { YandexFormProps } from '../../models';
1
+ import { PixelEvent } from '../../models';
2
+ import { AnalyticsEventsBase } from '../../models/common';
2
3
  export declare const YANDEX_FORM_ORIGIN = "https://forms.yandex.ru";
3
- export declare const YANDEX_FORM_SECTION = "surveys";
4
+ export interface YandexFormProps extends AnalyticsEventsBase {
5
+ id: number | string;
6
+ containerId?: string;
7
+ theme?: string;
8
+ className?: string;
9
+ headerHeight?: number;
10
+ customFormOrigin?: string;
11
+ params?: {
12
+ [key: string]: string;
13
+ };
14
+ onSubmit?: () => void;
15
+ onLoad?: () => void;
16
+ metrikaGoals?: string | string[];
17
+ pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
18
+ }
4
19
  declare const YandexForm: (props: YandexFormProps) => JSX.Element;
5
20
  export default YandexForm;
@@ -7,15 +7,13 @@ import { DefaultEventNames } from '../../models/common';
7
7
  import { block } from '../../utils';
8
8
  import { HEADER_HEIGHT } from '../constants';
9
9
  export const YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru';
10
- export const YANDEX_FORM_SECTION = 'surveys';
11
10
  const CONTAINER_ID = 'pc-yandex-form-container';
12
11
  const b = block('yandex-form');
13
12
  const YandexForm = (props) => {
14
- const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, customFormSection, } = props;
13
+ const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, } = props;
15
14
  const formContainerRef = useRef(null);
16
15
  const iframeRef = useRef();
17
16
  const yaFormOrigin = customFormOrigin || YANDEX_FORM_ORIGIN;
18
- const yaFormSection = customFormSection || YANDEX_FORM_SECTION;
19
17
  const handleMetrika = useMetrika();
20
18
  const handleAnalytics = useAnalytics(DefaultEventNames.YandexFormSubmit);
21
19
  const isMobile = useContext(MobileContext);
@@ -37,7 +35,7 @@ const YandexForm = (props) => {
37
35
  queryParams.set(param, params[param]);
38
36
  });
39
37
  }
40
- const src = `${yaFormOrigin}/${yaFormSection}/${id}/?${queryParams}`;
38
+ const src = `${yaFormOrigin}/surveys/${id}/?${queryParams}`;
41
39
  if (iframeRef.current) {
42
40
  iframeRef.current.src = src;
43
41
  }
@@ -52,7 +50,7 @@ const YandexForm = (props) => {
52
50
  iframeRef.current.width = '100%';
53
51
  container.appendChild(iframeRef.current);
54
52
  }
55
- }, [locale.lang, theme, isMobile, yaFormOrigin, yaFormSection, id, containerId, params]);
53
+ }, [locale.lang, theme, isMobile, yaFormOrigin, id, containerId, params]);
56
54
  const handleSubmit = useCallback(() => {
57
55
  if (formContainerRef && formContainerRef.current) {
58
56
  const { top } = formContainerRef.current.getBoundingClientRect();
@@ -17,7 +17,6 @@ export declare const blockMap: {
17
17
  "share-block": ({ items, title }: import("./models").ShareBlockProps) => JSX.Element;
18
18
  "map-block": ({ map, ...props }: import("./models").MapBlockProps) => JSX.Element;
19
19
  "filter-block": import("react").FC<import("./models").FilterBlockProps>;
20
- "form-block": import("react").FC<import("./models").FormBlockProps>;
21
20
  };
22
21
  export declare const subBlockMap: {
23
22
  divider: ({ size, border }: import("./models").DividerProps) => JSX.Element;
@@ -1,4 +1,4 @@
1
- import { BannerBlock, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, FormBlock, HeaderBlock, HeaderSliderBlock, IconsBlock, InfoBlock, MapBlock, MediaBlock, PromoFeaturesBlock, QuestionsBlock, ShareBlock, SliderBlock, TableBlock, TabsBlock, } from './blocks';
1
+ import { BannerBlock, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, HeaderBlock, HeaderSliderBlock, IconsBlock, InfoBlock, MapBlock, MediaBlock, PromoFeaturesBlock, QuestionsBlock, ShareBlock, SliderBlock, TableBlock, TabsBlock, } from './blocks';
2
2
  import { BlockType, NavigationItemType, SubBlockType } from './models';
3
3
  import { GithubButton, NavigationButton, NavigationDropdown, NavigationLink, } from './navigation/components/NavigationItem';
4
4
  import SocialIcon from './navigation/components/SocialIcon/SocialIcon';
@@ -22,7 +22,6 @@ export const blockMap = {
22
22
  [BlockType.ShareBlock]: ShareBlock,
23
23
  [BlockType.MapBlock]: MapBlock,
24
24
  [BlockType.FilterBlock]: FilterBlock,
25
- [BlockType.FormBlock]: FormBlock,
26
25
  };
27
26
  export const subBlockMap = {
28
27
  [SubBlockType.Divider]: Divider,
@@ -3,8 +3,8 @@ 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, YandexFormProps } from './common';
7
- import { BannerCardProps, HubspotFormProps, 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 } from './common';
7
+ import { BannerCardProps, SubBlock, SubBlockModels } from './sub-blocks';
8
8
  export declare enum BlockType {
9
9
  PromoFeaturesBlock = "promo-features-block",
10
10
  ExtendedFeaturesBlock = "extended-features-block",
@@ -23,8 +23,7 @@ export declare enum BlockType {
23
23
  ContentLayoutBlock = "content-layout-block",
24
24
  ShareBlock = "share-block",
25
25
  MapBlock = "map-block",
26
- FilterBlock = "filter-block",
27
- FormBlock = "form-block"
26
+ FilterBlock = "filter-block"
28
27
  }
29
28
  export declare const BlockTypes: BlockType[];
30
29
  export declare const HeaderBlockTypes: BlockType[];
@@ -275,7 +274,9 @@ export interface ContentItemProps {
275
274
  }
276
275
  export interface ContentBlockProps {
277
276
  title?: TitleItemBaseProps | string;
277
+ titleId?: string;
278
278
  text?: string;
279
+ textId?: string;
279
280
  additionalInfo?: string;
280
281
  links?: LinkProps[];
281
282
  buttons?: ButtonProps[];
@@ -296,29 +297,6 @@ export interface ShareBlockProps {
296
297
  items: PCShareSocialNetwork[];
297
298
  title?: string;
298
299
  }
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
- }
322
300
  export type HeaderBlockModel = {
323
301
  type: BlockType.HeaderBlock;
324
302
  } & HeaderBlockProps;
@@ -373,9 +351,6 @@ export type ContentLayoutBlockModel = {
373
351
  export type ShareBLockModel = {
374
352
  type: BlockType.ShareBlock;
375
353
  } & ShareBlockProps;
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;
354
+ type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel;
380
355
  export type Block = BlockModels & BlockBaseProps;
381
356
  export {};
@@ -18,7 +18,6 @@ export var BlockType;
18
18
  BlockType["ShareBlock"] = "share-block";
19
19
  BlockType["MapBlock"] = "map-block";
20
20
  BlockType["FilterBlock"] = "filter-block";
21
- BlockType["FormBlock"] = "form-block";
22
21
  })(BlockType || (BlockType = {}));
23
22
  export const BlockTypes = Object.values(BlockType);
24
23
  export const HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];
@@ -42,14 +41,3 @@ export var PCShareSocialNetwork;
42
41
  PCShareSocialNetwork["Facebook"] = "facebook";
43
42
  PCShareSocialNetwork["LinkedIn"] = "linkedin";
44
43
  })(PCShareSocialNetwork || (PCShareSocialNetwork = {}));
45
- export var FormBlockDataTypes;
46
- (function (FormBlockDataTypes) {
47
- FormBlockDataTypes["YANDEX"] = "yandex";
48
- FormBlockDataTypes["HUBSPOT_INLINE"] = "hubspot-inline";
49
- })(FormBlockDataTypes || (FormBlockDataTypes = {}));
50
- export var FormBlockDirection;
51
- (function (FormBlockDirection) {
52
- FormBlockDirection["FormContent"] = "form-content";
53
- FormBlockDirection["ContentForm"] = "content-form";
54
- FormBlockDirection["Center"] = "center";
55
- })(FormBlockDirection || (FormBlockDirection = {}));
@@ -1,7 +1,7 @@
1
- import React, { CSSProperties, ReactNode } from 'react';
1
+ import React, { CSSProperties, HTMLProps, ReactNode } from 'react';
2
2
  import { ButtonView, ButtonProps as UikitButtonProps } from '@gravity-ui/uikit';
3
3
  import { ThemeSupporting } from '../../utils';
4
- import { AnalyticsEventsBase, ClassNameProps, PixelEvent, PixelEventType, QAProps } from '../common';
4
+ import { AnalyticsEventsBase, ClassNameProps, PixelEventType, QAProps } from '../common';
5
5
  export declare enum AuthorType {
6
6
  Column = "column",
7
7
  Line = "line"
@@ -95,7 +95,7 @@ interface LoopProps {
95
95
  start: number;
96
96
  end?: number;
97
97
  }
98
- export interface ImageInfoProps {
98
+ export interface ImageInfoProps extends Pick<HTMLProps<HTMLImageElement>, 'aria-describedby'> {
99
99
  alt?: string;
100
100
  disableCompress?: boolean;
101
101
  }
@@ -138,6 +138,7 @@ export interface LinkProps extends AnalyticsEventsBase, Stylable, Tabbable {
138
138
  target?: string;
139
139
  metrikaGoals?: MetrikaGoal;
140
140
  pixelEvents?: ButtonPixel;
141
+ extraProps?: HTMLProps<HTMLAnchorElement>;
141
142
  }
142
143
  export interface FileLinkProps extends ClassNameProps, Tabbable {
143
144
  href: string;
@@ -147,11 +148,13 @@ export interface FileLinkProps extends ClassNameProps, Tabbable {
147
148
  theme?: ContentTheme;
148
149
  urlTitle?: string;
149
150
  onClick?: () => void;
151
+ extraProps?: HTMLProps<HTMLAnchorElement>;
150
152
  }
151
153
  export type ButtonTheme = ButtonView | 'github' | 'app-store' | 'google-play' | 'scale' | 'monochrome';
152
154
  export interface ButtonProps extends AnalyticsEventsBase, Pick<UikitButtonProps, 'size' | 'width' | 'extraProps'> {
153
155
  text: string;
154
156
  url: string;
157
+ urlTitle?: string;
155
158
  primary?: boolean;
156
159
  theme?: ButtonTheme;
157
160
  img?: ButtonImageProps | string;
@@ -337,20 +340,4 @@ export interface TitleProps {
337
340
  title?: TitleItemProps | string;
338
341
  subtitle?: string;
339
342
  }
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
- }
356
343
  export {};
@@ -1,6 +1,4 @@
1
- import { Block, ConstructorItem, FormBlockData, FormBlockHubspotData, FormBlockYandexData } from './';
1
+ import { Block, ConstructorItem } 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,13 +1,7 @@
1
- import { BlockTypes, } from './';
1
+ import { BlockTypes } from './';
2
2
  export function isBlock(block) {
3
3
  return block.type in BlockTypes;
4
4
  }
5
5
  export function isNewMetrikaFormat(metrika) {
6
6
  return Boolean(Array.isArray(metrika) && metrika.length && typeof metrika[0] === 'object');
7
7
  }
8
- export function isYandexDataForm(data) {
9
- return Boolean(data.yandex);
10
- }
11
- export function isHubspotDataForm(data) {
12
- return Boolean(data.hubspot);
13
- }
@@ -62,6 +62,7 @@ export interface NavigationLogoData {
62
62
  icon: ImageProps;
63
63
  text?: string;
64
64
  url?: string;
65
+ urlTitle?: string;
65
66
  }
66
67
  export type ThemedNavigationLogoData = NavigationLogoData & ThemeSupporting<NavigationLogoData>;
67
68
  export interface HeaderData {
@@ -7,6 +7,7 @@ unpredictable css rules order in build */
7
7
  .pc-logo {
8
8
  display: flex;
9
9
  align-items: center;
10
+ text-decoration: none;
10
11
  }
11
12
  .pc-logo__icon {
12
13
  display: flex;
@@ -1,19 +1,24 @@
1
- import React from 'react';
1
+ import React, { Fragment, useContext } from 'react';
2
2
  import { Image } from '../../../components';
3
3
  import { getMediaImage } from '../../../components/Media/Image/utils';
4
4
  import RouterLink from '../../../components/RouterLink/RouterLink';
5
+ import { LocationContext } from '../../../context/locationContext';
5
6
  import { useTheme } from '../../../context/theme';
6
- import { block, getThemedValue } from '../../../utils';
7
+ import { block, getLinkProps, getThemedValue } from '../../../utils';
7
8
  import './Logo.css';
8
9
  const b = block('logo');
9
10
  const Logo = (props) => {
11
+ const { hostname, Link } = useContext(LocationContext);
10
12
  const theme = useTheme();
11
13
  const themedLogoProps = getThemedValue(props, theme) || props;
12
14
  const imageData = getMediaImage(themedLogoProps.icon || props.icon);
13
15
  const textData = themedLogoProps.text || props.text;
14
- return (React.createElement(RouterLink, { href: themedLogoProps.url || props.url || '/', passHref: true },
15
- React.createElement("div", { className: b(null, props.className) },
16
- imageData && React.createElement(Image, Object.assign({ className: b('icon') }, imageData)),
17
- React.createElement("span", { className: b('text') }, textData))));
16
+ const url = themedLogoProps.url || props.url || '/';
17
+ const urlTitle = themedLogoProps.urlTitle || props.urlTitle || textData;
18
+ const linkExtraProps = getLinkProps(url, hostname);
19
+ const content = (React.createElement(Fragment, null,
20
+ imageData && React.createElement(Image, Object.assign({ className: b('icon') }, imageData)),
21
+ React.createElement("span", { className: b('text') }, textData)));
22
+ return (React.createElement(RouterLink, { href: url, passHref: true }, Link ? (React.createElement("span", { className: b(null, props.className) }, content)) : (React.createElement("a", Object.assign({ className: b(null, props.className), href: url, title: urlTitle }, linkExtraProps), content))));
18
23
  };
19
24
  export default Logo;
@@ -1,6 +1,6 @@
1
- import { BannerBlock, BannerCard, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, FormBlock, HeaderBlock, HeaderSliderBlock, IconsBlock, InfoBlock, MapBlock, MediaBlock, PromoFeaturesBlock, QuestionsBlock, ShareBlock, SliderBlock, TableBlock, TabsBlock, } from './validators/blocks';
1
+ import { BannerBlock, BannerCard, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, HeaderBlock, HeaderSliderBlock, IconsBlock, InfoBlock, MapBlock, MediaBlock, PromoFeaturesBlock, QuestionsBlock, ShareBlock, SliderBlock, TableBlock, TabsBlock, } from './validators/blocks';
2
2
  import { BackgroundCard, BasicCard, Divider, MediaCardBlock, PriceDetailedBlock, Quote, } from './validators/sub-blocks';
3
- export const blockSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, Divider), ExtendedFeaturesBlock), PromoFeaturesBlock), SliderBlock), QuestionsBlock), HeaderBlock), BannerBlock), CompaniesBlock), MediaBlock), MapBlock), InfoBlock), TableBlock), TabsBlock), HeaderSliderBlock), IconsBlock), CardLayoutBlock), ContentLayoutBlock), ShareBlock), FilterBlock), FormBlock);
3
+ export const blockSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, Divider), ExtendedFeaturesBlock), PromoFeaturesBlock), SliderBlock), QuestionsBlock), HeaderBlock), BannerBlock), CompaniesBlock), MediaBlock), MapBlock), InfoBlock), TableBlock), TabsBlock), HeaderSliderBlock), IconsBlock), CardLayoutBlock), ContentLayoutBlock), ShareBlock), FilterBlock);
4
4
  export const cardSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, MediaCardBlock), BannerCard), PriceDetailedBlock), BackgroundCard), Quote), BasicCard);
5
5
  export const constructorBlockSchemaNames = [
6
6
  'divider',
@@ -27,7 +27,6 @@ export const constructorBlockSchemaNames = [
27
27
  'content-layout-block',
28
28
  'share-block',
29
29
  'filter-block',
30
- 'form-block',
31
30
  ];
32
31
  export const constructorCardSchemaNames = [
33
32
  'media-card',
@@ -16,4 +16,3 @@ export * from '../../blocks/CardLayout/schema';
16
16
  export * from '../../blocks/ContentLayout/schema';
17
17
  export * from '../../blocks/Share/schema';
18
18
  export * from '../../blocks/FilterBlock/schema';
19
- export * from '../../blocks/Form/schema';
@@ -16,4 +16,3 @@ export * from '../../blocks/CardLayout/schema';
16
16
  export * from '../../blocks/ContentLayout/schema';
17
17
  export * from '../../blocks/Share/schema';
18
18
  export * from '../../blocks/FilterBlock/schema';
19
- export * from '../../blocks/Form/schema';
@@ -1,5 +1,6 @@
1
1
  import { __rest } from "tslib";
2
2
  import React from 'react';
3
+ import { useUniqId } from '@gravity-ui/uikit';
3
4
  import { Content } from '../';
4
5
  import CardBase from '../../components/CardBase/CardBase';
5
6
  import Image from '../../components/Image/Image';
@@ -11,10 +12,12 @@ const b = block('basic-card');
11
12
  const BasicCard = (props) => {
12
13
  const { title, text, icon, additionalInfo, links, buttons, iconPosition = IconPosition.Top } = props, cardParams = __rest(props, ["title", "text", "icon", "additionalInfo", "links", "buttons", "iconPosition"]);
13
14
  const iconProps = icon && getMediaImage(icon);
14
- return (React.createElement(CardBase, Object.assign({ className: b() }, cardParams),
15
+ const titleId = useUniqId();
16
+ const descriptionId = useUniqId();
17
+ return (React.createElement(CardBase, Object.assign({ className: b() }, cardParams, { extraProps: { 'aria-describedby': descriptionId, 'aria-labelledby': titleId } }),
15
18
  React.createElement(CardBase.Content, null,
16
19
  React.createElement("div", { className: b('content', { ['icon-position']: iconPosition }) },
17
20
  iconProps && (React.createElement(Image, Object.assign({}, iconProps, { className: b('icon', { ['icon-position']: iconPosition }) }))),
18
- React.createElement(Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 }, size: "s", className: b({ ['content-layout']: iconPosition }) })))));
21
+ React.createElement(Content, { title: title, titleId: titleId, text: text, textId: descriptionId, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 }, size: "s", className: b({ ['content-layout']: iconPosition }) })))));
19
22
  };
20
23
  export default BasicCard;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { useUniqId } from '@gravity-ui/uikit';
2
3
  import { Button, Title, YFMWrapper } from '../../components';
3
4
  import LinkBlock from '../../components/Link/Link';
4
5
  import { Col } from '../../grid';
@@ -35,16 +36,18 @@ function getButtonSize(size) {
35
36
  }
36
37
  }
37
38
  const Content = (props) => {
38
- const { title, text, additionalInfo, size = 'l', links, buttons, colSizes = { all: 12, sm: 8 }, centered, theme, className, list, qa, } = props;
39
+ const { title, titleId: titleIdFromProps, text, textId, additionalInfo, size = 'l', links, buttons, colSizes = { all: 12, sm: 8 }, centered, theme, className, list, qa, } = props;
39
40
  const qaAttributes = getQaAttrubutes(qa, ['links', 'link', 'buttons', 'button', 'list']);
40
41
  const titleProps = !title || typeof title === 'string'
41
42
  ? { text: title, textSize: getTextSize(size) }
42
43
  : title;
43
44
  const hasTitle = Boolean(title);
45
+ const defaultTitleId = useUniqId();
46
+ const titleId = titleIdFromProps || defaultTitleId;
44
47
  return (React.createElement(Col, { className: b({ size, centered, theme }, className), reset: true, sizes: colSizes, qa: qaAttributes.container },
45
- title && React.createElement(Title, { className: b('title'), title: titleProps, colSizes: { all: 12 } }),
48
+ title && (React.createElement(Title, { className: b('title'), title: titleProps, colSizes: { all: 12 }, id: titleId })),
46
49
  text && (React.createElement("div", { className: b('text', { ['without-title']: !hasTitle }) },
47
- React.createElement(YFMWrapper, { content: text, modifiers: { constructor: true, [`constructor-size-${size}`]: true } }))),
50
+ React.createElement(YFMWrapper, { content: text, modifiers: { constructor: true, [`constructor-size-${size}`]: true }, id: textId }))),
48
51
  (list === null || list === void 0 ? void 0 : list.length) ? React.createElement(ContentList, { list: list, size: size, qa: qaAttributes.list }) : null,
49
52
  additionalInfo && (React.createElement("div", { className: b('notice') },
50
53
  React.createElement(YFMWrapper, { content: additionalInfo, modifiers: {
@@ -52,7 +55,11 @@ const Content = (props) => {
52
55
  'constructor-notice': true,
53
56
  [`constructor-size-${size}`]: true,
54
57
  } }))),
55
- links && (React.createElement("div", { className: b('links'), "data-qa": qaAttributes.links }, links.map((link) => (React.createElement(LinkBlock, Object.assign({ className: b('link') }, link, { textSize: getLinkSize(size), key: link.url, qa: qaAttributes.link })))))),
56
- buttons && (React.createElement("div", { className: b('buttons'), "data-qa": qaAttributes.buttons }, buttons.map((item) => (React.createElement(Button, Object.assign({ className: b('button') }, item, { key: item.url, size: getButtonSize(size), qa: qaAttributes.button }))))))));
58
+ links && (React.createElement("div", { className: b('links'), "data-qa": qaAttributes.links }, links.map((link) => (React.createElement(LinkBlock, Object.assign({ className: b('link') }, link, { textSize: getLinkSize(size), key: link.url, qa: qaAttributes.link, extraProps: {
59
+ 'aria-describedby': link.urlTitle ? undefined : titleId,
60
+ } })))))),
61
+ buttons && (React.createElement("div", { className: b('buttons'), "data-qa": qaAttributes.buttons }, buttons.map((item) => (React.createElement(Button, Object.assign({ className: b('button') }, item, { key: item.url, size: getButtonSize(size), qa: qaAttributes.button, extraProps: {
62
+ 'aria-describedby': item.urlTitle ? undefined : titleId,
63
+ } }))))))));
57
64
  };
58
65
  export default Content;
@@ -239,16 +239,6 @@ unpredictable css rules order in build */
239
239
  font-weight: var(--g-text-body-font-weight);
240
240
  margin: 20px 0;
241
241
  }
242
- .pc-hubspot-form .hs-richtext a:focus {
243
- box-shadow: 0 0 0 2px var(--g-color-line-focus);
244
- }
245
- .pc-hubspot-form .hs-richtext a:focus:not(:focus-visible) {
246
- box-shadow: none;
247
- }
248
- .pc-hubspot-form .hs-richtext a:focus {
249
- outline: 0;
250
- border-radius: var(--g-focus-border-radius);
251
- }
252
242
  .pc-hubspot-form .hs_error_rollup {
253
243
  padding-left: 10px;
254
244
  font-size: var(--g-text-body-1-font-size);
@@ -390,6 +380,16 @@ unpredictable css rules order in build */
390
380
  .pc-hubspot-form_mobile .hs-button.primary {
391
381
  width: 80%;
392
382
  }
383
+ .pc-hubspot-form a:focus {
384
+ box-shadow: 0 0 0 2px var(--g-color-line-focus);
385
+ }
386
+ .pc-hubspot-form a:focus:not(:focus-visible) {
387
+ box-shadow: none;
388
+ }
389
+ .pc-hubspot-form a:focus {
390
+ outline: 0;
391
+ border-radius: var(--g-focus-border-radius);
392
+ }
393
393
  .pc-hubspot-form_theme_dark {
394
394
  --g-color-line-focus: var(--pc-color-line-focus-dark);
395
395
  }
@@ -10,6 +10,7 @@ export declare const getLayoutItemLinks: (links: LayoutItemProps['content']['lin
10
10
  target?: string | undefined;
11
11
  metrikaGoals?: import("../../models").MetrikaGoal | undefined;
12
12
  pixelEvents?: import("../../models").ButtonPixel | undefined;
13
+ extraProps?: import("react").HTMLProps<HTMLAnchorElement> | undefined;
13
14
  analyticsEvents?: {
14
15
  name: string;
15
16
  type?: string | undefined;
@@ -62,7 +62,6 @@ unpredictable css rules order in build */
62
62
  }
63
63
  .pc-quote__content_quote-type_chevron::before {
64
64
  position: absolute;
65
- top: -1px;
66
65
  left: -10px;
67
66
  content: "«";
68
67
  }
@@ -71,7 +70,6 @@ unpredictable css rules order in build */
71
70
  }
72
71
  .pc-quote__content_quote-type_english-double::before {
73
72
  position: absolute;
74
- top: -1px;
75
73
  left: -8px;
76
74
  content: "“";
77
75
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "4.31.1-alpha.0",
3
+ "version": "4.33.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -3,8 +3,8 @@ 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, YandexFormProps } from './common';
7
- import { BannerCardProps, HubspotFormProps, 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 } from './common';
7
+ import { BannerCardProps, SubBlock, SubBlockModels } from './sub-blocks';
8
8
  export declare enum BlockType {
9
9
  PromoFeaturesBlock = "promo-features-block",
10
10
  ExtendedFeaturesBlock = "extended-features-block",
@@ -23,8 +23,7 @@ export declare enum BlockType {
23
23
  ContentLayoutBlock = "content-layout-block",
24
24
  ShareBlock = "share-block",
25
25
  MapBlock = "map-block",
26
- FilterBlock = "filter-block",
27
- FormBlock = "form-block"
26
+ FilterBlock = "filter-block"
28
27
  }
29
28
  export declare const BlockTypes: BlockType[];
30
29
  export declare const HeaderBlockTypes: BlockType[];
@@ -275,7 +274,9 @@ export interface ContentItemProps {
275
274
  }
276
275
  export interface ContentBlockProps {
277
276
  title?: TitleItemBaseProps | string;
277
+ titleId?: string;
278
278
  text?: string;
279
+ textId?: string;
279
280
  additionalInfo?: string;
280
281
  links?: LinkProps[];
281
282
  buttons?: ButtonProps[];
@@ -296,29 +297,6 @@ export interface ShareBlockProps {
296
297
  items: PCShareSocialNetwork[];
297
298
  title?: string;
298
299
  }
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
- }
322
300
  export type HeaderBlockModel = {
323
301
  type: BlockType.HeaderBlock;
324
302
  } & HeaderBlockProps;
@@ -373,9 +351,6 @@ export type ContentLayoutBlockModel = {
373
351
  export type ShareBLockModel = {
374
352
  type: BlockType.ShareBlock;
375
353
  } & ShareBlockProps;
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;
354
+ type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel;
380
355
  export type Block = BlockModels & BlockBaseProps;
381
356
  export {};