@gravity-ui/page-constructor 2.12.0-alpha → 2.13.0-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 (104) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/cjs/blocks/index.d.ts +0 -1
  3. package/build/cjs/blocks/index.js +1 -3
  4. package/build/cjs/blocks/validators.d.ts +0 -1
  5. package/build/cjs/blocks/validators.js +0 -1
  6. package/build/cjs/components/Button/Button.js +2 -2
  7. package/build/cjs/components/Button/i18n/en.json +3 -0
  8. package/build/cjs/components/Button/i18n/index.d.ts +2 -0
  9. package/build/cjs/components/Button/i18n/index.js +8 -0
  10. package/build/cjs/components/Button/i18n/ru.json +3 -0
  11. package/build/cjs/components/Control/Control.js +2 -1
  12. package/build/cjs/components/Control/i18n/en.json +3 -0
  13. package/build/cjs/components/Control/i18n/index.d.ts +2 -0
  14. package/build/cjs/components/Control/i18n/index.js +8 -0
  15. package/build/cjs/components/Control/i18n/ru.json +3 -0
  16. package/build/cjs/components/FullscreenImage/FullscreenImage.js +3 -2
  17. package/build/cjs/components/FullscreenImage/i18n/en.json +3 -0
  18. package/build/cjs/components/FullscreenImage/i18n/index.d.ts +2 -0
  19. package/build/cjs/components/FullscreenImage/i18n/index.js +8 -0
  20. package/build/cjs/components/FullscreenImage/i18n/ru.json +3 -0
  21. package/build/cjs/components/Image/Image.js +2 -1
  22. package/build/cjs/components/Image/i18n/en.json +3 -0
  23. package/build/cjs/components/Image/i18n/index.d.ts +2 -0
  24. package/build/cjs/components/Image/i18n/index.js +8 -0
  25. package/build/cjs/components/Image/i18n/ru.json +3 -0
  26. package/build/cjs/components/Map/GoogleMap.js +1 -1
  27. package/build/cjs/components/Media/DataLens/DataLens.js +2 -1
  28. package/build/cjs/components/Media/DataLens/i18n/en.json +3 -0
  29. package/build/cjs/components/Media/DataLens/i18n/index.d.ts +2 -0
  30. package/build/cjs/components/Media/DataLens/i18n/index.js +8 -0
  31. package/build/cjs/components/Media/DataLens/i18n/ru.json +3 -0
  32. package/build/cjs/components/OverflowScroller/OverflowScroller.d.ts +0 -2
  33. package/build/cjs/components/OverflowScroller/OverflowScroller.js +3 -4
  34. package/build/cjs/components/VideoBlock/VideoBlock.js +3 -0
  35. package/build/cjs/components/VideoBlock/i18n/en.json +3 -0
  36. package/build/cjs/components/VideoBlock/i18n/index.d.ts +2 -0
  37. package/build/cjs/components/VideoBlock/i18n/index.js +8 -0
  38. package/build/cjs/components/VideoBlock/i18n/ru.json +3 -0
  39. package/build/cjs/components/YandexForm/YandexForm.js +1 -0
  40. package/build/cjs/constructor-items.d.ts +0 -1
  41. package/build/cjs/constructor-items.js +0 -1
  42. package/build/cjs/models/constructor-items/blocks.d.ts +1 -20
  43. package/build/cjs/models/constructor-items/blocks.js +0 -1
  44. package/build/cjs/schema/index.js +1 -1
  45. package/build/cjs/schema/validators/blocks.d.ts +0 -1
  46. package/build/cjs/schema/validators/blocks.js +0 -1
  47. package/build/esm/blocks/index.d.ts +0 -1
  48. package/build/esm/blocks/index.js +0 -1
  49. package/build/esm/blocks/validators.d.ts +0 -1
  50. package/build/esm/blocks/validators.js +0 -1
  51. package/build/esm/components/Button/Button.js +2 -2
  52. package/build/esm/components/Button/i18n/en.json +3 -0
  53. package/build/esm/components/Button/i18n/index.d.ts +2 -0
  54. package/build/esm/components/Button/i18n/index.js +5 -0
  55. package/build/esm/components/Button/i18n/ru.json +3 -0
  56. package/build/esm/components/Control/Control.js +2 -1
  57. package/build/esm/components/Control/i18n/en.json +3 -0
  58. package/build/esm/components/Control/i18n/index.d.ts +2 -0
  59. package/build/esm/components/Control/i18n/index.js +5 -0
  60. package/build/esm/components/Control/i18n/ru.json +3 -0
  61. package/build/esm/components/FullscreenImage/FullscreenImage.js +3 -2
  62. package/build/esm/components/FullscreenImage/i18n/en.json +3 -0
  63. package/build/esm/components/FullscreenImage/i18n/index.d.ts +2 -0
  64. package/build/esm/components/FullscreenImage/i18n/index.js +5 -0
  65. package/build/esm/components/FullscreenImage/i18n/ru.json +3 -0
  66. package/build/esm/components/Image/Image.js +2 -1
  67. package/build/esm/components/Image/i18n/en.json +3 -0
  68. package/build/esm/components/Image/i18n/index.d.ts +2 -0
  69. package/build/esm/components/Image/i18n/index.js +5 -0
  70. package/build/esm/components/Image/i18n/ru.json +3 -0
  71. package/build/esm/components/Map/GoogleMap.js +1 -1
  72. package/build/esm/components/Media/DataLens/DataLens.js +2 -1
  73. package/build/esm/components/Media/DataLens/i18n/en.json +3 -0
  74. package/build/esm/components/Media/DataLens/i18n/index.d.ts +2 -0
  75. package/build/esm/components/Media/DataLens/i18n/index.js +5 -0
  76. package/build/esm/components/Media/DataLens/i18n/ru.json +3 -0
  77. package/build/esm/components/OverflowScroller/OverflowScroller.d.ts +0 -2
  78. package/build/esm/components/OverflowScroller/OverflowScroller.js +3 -4
  79. package/build/esm/components/VideoBlock/VideoBlock.js +3 -0
  80. package/build/esm/components/VideoBlock/i18n/en.json +3 -0
  81. package/build/esm/components/VideoBlock/i18n/index.d.ts +2 -0
  82. package/build/esm/components/VideoBlock/i18n/index.js +5 -0
  83. package/build/esm/components/VideoBlock/i18n/ru.json +3 -0
  84. package/build/esm/components/YandexForm/YandexForm.js +1 -0
  85. package/build/esm/constructor-items.d.ts +0 -1
  86. package/build/esm/constructor-items.js +1 -2
  87. package/build/esm/models/constructor-items/blocks.d.ts +1 -20
  88. package/build/esm/models/constructor-items/blocks.js +0 -1
  89. package/build/esm/schema/index.js +2 -2
  90. package/build/esm/schema/validators/blocks.d.ts +0 -1
  91. package/build/esm/schema/validators/blocks.js +0 -1
  92. package/package.json +4 -1
  93. package/server/models/constructor-items/blocks.d.ts +1 -20
  94. package/server/models/constructor-items/blocks.js +0 -1
  95. package/build/cjs/blocks/Security/Security.css +0 -142
  96. package/build/cjs/blocks/Security/Security.d.ts +0 -3
  97. package/build/cjs/blocks/Security/Security.js +0 -28
  98. package/build/cjs/blocks/Security/schema.d.ts +0 -170
  99. package/build/cjs/blocks/Security/schema.js +0 -32
  100. package/build/esm/blocks/Security/Security.css +0 -142
  101. package/build/esm/blocks/Security/Security.d.ts +0 -4
  102. package/build/esm/blocks/Security/Security.js +0 -24
  103. package/build/esm/blocks/Security/schema.d.ts +0 -170
  104. package/build/esm/blocks/Security/schema.js +0 -28
@@ -3,12 +3,13 @@ import { Icon, Modal } from '@gravity-ui/uikit';
3
3
  import { FullScreen, PreviewClose } from '../../icons';
4
4
  import { block } from '../../utils';
5
5
  import Image from '../Image/Image';
6
+ import i18n from './i18n';
6
7
  import './FullScreenImage.css';
7
8
  const b = block('FullScreenImage');
8
9
  const FULL_SCREEN_ICON_SIZE = 18;
9
10
  const CLOSE_ICON_SIZE = 30;
10
11
  const FullScreenImage = (props) => {
11
- const { imageClassName, modalImageClass, imageStyle } = props;
12
+ const { imageClassName, modalImageClass, imageStyle, alt = i18n('img-alt') } = props;
12
13
  const [isOpened, setIsOpened] = useState(false);
13
14
  const [isMouseEnter, setIsMouseEnter] = useState(false);
14
15
  const openModal = () => setIsOpened(true);
@@ -17,7 +18,7 @@ const FullScreenImage = (props) => {
17
18
  const hideFullScreenIcon = () => setIsMouseEnter(false);
18
19
  return (React.createElement("div", { className: b() },
19
20
  React.createElement("div", { className: b('image-wrapper'), onMouseEnter: showFullScreenIcon, onMouseLeave: hideFullScreenIcon },
20
- React.createElement(Image, Object.assign({}, props, { className: b('image', imageClassName), onClick: openModal, style: imageStyle })),
21
+ React.createElement(Image, Object.assign({}, props, { alt: alt, className: b('image', imageClassName), onClick: openModal, style: imageStyle })),
21
22
  React.createElement("div", { className: b('icon-wrapper', { visible: isMouseEnter }), onClick: openModal },
22
23
  React.createElement(Icon, { data: FullScreen, width: FULL_SCREEN_ICON_SIZE, height: FULL_SCREEN_ICON_SIZE, className: b('icon') }))),
23
24
  isOpened && (React.createElement(Modal, { open: isOpened, onClose: closeModal, className: b('modal') },
@@ -0,0 +1,3 @@
1
+ {
2
+ "img-alt": "Full screen image"
3
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
2
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { registerKeyset } from '../../../utils/registerKeyset';
2
+ import en from './en.json';
3
+ import ru from './ru.json';
4
+ const COMPONENT = 'FullScreenImage';
5
+ export default registerKeyset({ en, ru }, COMPONENT);
@@ -0,0 +1,3 @@
1
+ {
2
+ "img-alt": "Полноэкранное изображение"
3
+ }
@@ -3,12 +3,13 @@ import { BREAKPOINTS } from '../../constants';
3
3
  import { ProjectSettingsContext } from '../../context/projectSettingsContext';
4
4
  import { isCompressible } from '../../utils/imageCompress';
5
5
  import ImageBase from '../ImageBase/ImageBase';
6
+ import i18n from './i18n';
6
7
  const checkWebP = (src) => {
7
8
  return src.endsWith('.webp') ? src : src + '.webp';
8
9
  };
9
10
  const Image = (props) => {
10
11
  const projectSettings = useContext(ProjectSettingsContext);
11
- const { src: imageSrc, alt, disableCompress, tablet, desktop, mobile, style, className, onClick, containerClassName, } = props;
12
+ const { src: imageSrc, alt = i18n('img-alt'), disableCompress, tablet, desktop, mobile, style, className, onClick, containerClassName, } = props;
12
13
  const [imgLoadingError, setImgLoadingError] = useState(false);
13
14
  const src = imageSrc || desktop;
14
15
  if (!src) {
@@ -0,0 +1,3 @@
1
+ {
2
+ "img-alt": "Image alt"
3
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
2
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { registerKeyset } from '../../../utils/registerKeyset';
2
+ import en from './en.json';
3
+ import ru from './ru.json';
4
+ const COMPONENT = 'Image';
5
+ export default registerKeyset({ en, ru }, COMPONENT);
@@ -0,0 +1,3 @@
1
+ {
2
+ "img-alt": "Альтернатива изображению"
3
+ }
@@ -36,6 +36,6 @@ const GoogleMap = (props) => {
36
36
  }
37
37
  return (React.createElement("iframe", { className: b(), ref: ref, style: {
38
38
  height,
39
- }, loading: "lazy", allowFullScreen: true, referrerPolicy: "no-referrer-when-downgrade", src: src }));
39
+ }, title: "Google Map", loading: "lazy", allowFullScreen: true, referrerPolicy: "no-referrer-when-downgrade", src: src }));
40
40
  };
41
41
  export default GoogleMap;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { block } from '../../../utils';
3
+ import i18n from './i18n';
3
4
  import { unifyDataLensToObject } from './utils';
4
5
  import './DataLens.css';
5
6
  const b = block('media-component-data-lens');
@@ -7,6 +8,6 @@ const DataLens = (props) => {
7
8
  const { dataLens } = props;
8
9
  const dataLensData = unifyDataLensToObject(dataLens);
9
10
  return dataLens ? (React.createElement("div", { className: b('wrap') },
10
- React.createElement("iframe", { src: `https://datalens.yandex/${dataLensData.id}?_embedded=1&_theme=${dataLensData.theme}`, className: b('iframe'), frameBorder: 0 }))) : null;
11
+ React.createElement("iframe", { src: `https://datalens.yandex/${dataLensData.id}?_embedded=1&_theme=${dataLensData.theme}`, className: b('iframe'), loading: "lazy", title: i18n('iframe-title'), frameBorder: 0 }))) : null;
11
12
  };
12
13
  export default DataLens;
@@ -0,0 +1,3 @@
1
+ {
2
+ "iframe-title": "Datalens frame"
3
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
2
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { registerKeyset } from '../../../../utils/registerKeyset';
2
+ import en from './en.json';
3
+ import ru from './ru.json';
4
+ const COMPONENT = 'DataLens';
5
+ export default registerKeyset({ en, ru }, COMPONENT);
@@ -0,0 +1,3 @@
1
+ {
2
+ "iframe-title": "Фрейм данных"
3
+ }
@@ -5,8 +5,6 @@ export interface OverflowScrollerProps {
5
5
  className?: string;
6
6
  onScrollStart?: () => void;
7
7
  onScrollEnd?: () => void;
8
- arrowSize?: number;
9
- arrowClassName?: string;
10
8
  }
11
9
  export interface OverflowScrollerState {
12
10
  arrows: Arrow[];
@@ -6,7 +6,6 @@ import './OverflowScroller.css';
6
6
  const b = block('overflow-scroller');
7
7
  const TRANSITION_TIME = 300;
8
8
  const PADDING_SIZE = 24;
9
- const DEFAULT_ARROW_SIZE = 18;
10
9
  export default class OverflowScroller extends React.Component {
11
10
  constructor() {
12
11
  super(...arguments);
@@ -71,7 +70,7 @@ export default class OverflowScroller extends React.Component {
71
70
  window.removeEventListener('resize', this.checkOverflow);
72
71
  }
73
72
  render() {
74
- const { className, arrowClassName, children, arrowSize = DEFAULT_ARROW_SIZE } = this.props;
73
+ const { className, children } = this.props;
75
74
  const { arrows, scrollValue } = this.state;
76
75
  const wrapperStyle = arrows.length ? { left: -scrollValue } : { left: 0 };
77
76
  const paddingLeft = arrows.includes('left');
@@ -82,7 +81,7 @@ export default class OverflowScroller extends React.Component {
82
81
  }) },
83
82
  React.createElement("div", { className: b(null, className), ref: this.containerRef },
84
83
  React.createElement("div", { className: b('wrapper'), style: wrapperStyle, ref: this.wrapperRef }, children)),
85
- arrows.map((direction) => (React.createElement("div", { key: direction, className: b('arrow', { type: direction }, arrowClassName), onClick: (e) => this.handleScrollClick(e, direction) },
86
- React.createElement(ToggleArrow, { size: arrowSize, type: 'horizontal', iconType: "navigation" }))))));
84
+ arrows.map((direction) => (React.createElement("div", { key: direction, className: b('arrow', { type: direction }), onClick: (e) => this.handleScrollClick(e, direction) },
85
+ React.createElement(ToggleArrow, { size: 18, type: 'horizontal', iconType: "navigation" }))))));
87
86
  }
88
87
  }
@@ -5,6 +5,7 @@ import { Icon } from '@gravity-ui/uikit';
5
5
  import { PlayVideo } from '../../icons';
6
6
  import { block, getPageSearchParams } from '../../utils';
7
7
  import Image from '../Image/Image';
8
+ import i18n from './i18n';
8
9
  import './VideoBlock.css';
9
10
  const RECORD_URL = 'https://www.youtube.com/embed/';
10
11
  const STREAM_URL = 'https://www.youtube.com/embed/live_stream?channel=';
@@ -69,9 +70,11 @@ const VideoBlock = (props) => {
69
70
  iframe.src = fullSrc;
70
71
  iframe.width = '100%';
71
72
  iframe.height = '100%';
73
+ iframe.title = i18n('iframe-title');
72
74
  iframe.frameBorder = '0';
73
75
  iframe.setAttribute('allowfullscreen', 'true');
74
76
  iframe.setAttribute('allow', 'autoplay');
77
+ iframe.setAttribute('loading', 'lazy');
75
78
  ref.current.appendChild(iframe);
76
79
  iframeRef.current = iframe;
77
80
  }
@@ -0,0 +1,3 @@
1
+ {
2
+ "iframe-title": "Video frame"
3
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
2
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { registerKeyset } from '../../../utils/registerKeyset';
2
+ import en from './en.json';
3
+ import ru from './ru.json';
4
+ const COMPONENT = 'VideoBlock';
5
+ export default registerKeyset({ en, ru }, COMPONENT);
@@ -0,0 +1,3 @@
1
+ {
2
+ "iframe-title": "Фрейм видеоблока"
3
+ }
@@ -44,6 +44,7 @@ const YandexForm = (props) => {
44
44
  iframeRef.current.src = src;
45
45
  iframeRef.current.id = containerId;
46
46
  iframeRef.current.name = `form${id}`;
47
+ iframeRef.current.setAttribute('loading', 'lazy');
47
48
  iframeRef.current.frameBorder = '0';
48
49
  iframeRef.current.scrolling = 'no';
49
50
  iframeRef.current.width = '100%';
@@ -9,7 +9,6 @@ export declare const blockMap: {
9
9
  "media-block": (props: import("./models").MediaBlockProps) => JSX.Element;
10
10
  "preview-block": (props: import("./models").PreviewBlockProps) => JSX.Element;
11
11
  "info-block": (props: import("./models").InfoBlockProps) => JSX.Element;
12
- "security-block": (props: import("./models").SecurityBlockProps) => JSX.Element;
13
12
  "table-block": (props: import("./models").TableBlockProps) => JSX.Element;
14
13
  "tabs-block": ({ items, title, description, animated, tabsColSizes, centered, direction, }: import("./models").TabsBlockProps) => JSX.Element;
15
14
  "link-table-block": ({ items, title, description, linkTheme }: import("./models").LinkTableBlockProps) => JSX.Element;
@@ -1,4 +1,4 @@
1
- import { BannerBlock, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, HeaderBlock, HeaderSliderBlock, IconsBlock, InfoBlock, LinkTableBlock, MapBlock, MediaBlock, PreviewBlock, PromoFeaturesBlock, QuestionsBlock, SecurityBlock, ShareBlock, SimpleBlock, SliderBlock, TableBlock, TabsBlock, } from './blocks';
1
+ import { BannerBlock, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, HeaderBlock, HeaderSliderBlock, IconsBlock, InfoBlock, LinkTableBlock, MapBlock, MediaBlock, PreviewBlock, PromoFeaturesBlock, QuestionsBlock, ShareBlock, SimpleBlock, SliderBlock, TableBlock, TabsBlock, } from './blocks';
2
2
  import { BlockType, SubBlockType } from './models';
3
3
  import { BackgroundCard, BannerCard, BasicCard, CardWithImage, Content, Divider, LayoutItem, MediaCard, NewsCard, Partner, PriceDetailed, Quote, TutorialCard, } from './sub-blocks';
4
4
  export const blockMap = {
@@ -12,7 +12,6 @@ export const blockMap = {
12
12
  [BlockType.MediaBlock]: MediaBlock,
13
13
  [BlockType.PreviewBlock]: PreviewBlock,
14
14
  [BlockType.InfoBlock]: InfoBlock,
15
- [BlockType.SecurityBlock]: SecurityBlock,
16
15
  [BlockType.TableBlock]: TableBlock,
17
16
  [BlockType.TabsBlock]: TabsBlock,
18
17
  [BlockType.LinkTableBlock]: LinkTableBlock,
@@ -16,7 +16,6 @@ export declare enum BlockType {
16
16
  MediaBlock = "media-block",
17
17
  PreviewBlock = "preview-block",
18
18
  InfoBlock = "info-block",
19
- SecurityBlock = "security-block",
20
19
  TableBlock = "table-block",
21
20
  TabsBlock = "tabs-block",
22
21
  SimpleBlock = "simple-block",
@@ -204,21 +203,6 @@ export interface InfoBlockProps {
204
203
  leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;
205
204
  rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;
206
205
  }
207
- export interface SecurityBlockPoint {
208
- img: string;
209
- text: string;
210
- link: {
211
- text: string;
212
- url: string;
213
- };
214
- }
215
- export interface SecurityBlockProps extends Animatable {
216
- theme?: TextTheme;
217
- backgroundColor?: string;
218
- title: string;
219
- points?: SecurityBlockPoint[];
220
- media: MediaProps;
221
- }
222
206
  export interface TableProps {
223
207
  content: string[][];
224
208
  legend?: string[];
@@ -353,9 +337,6 @@ export type PreviewBlockModel = {
353
337
  export type InfoBlockModel = {
354
338
  type: BlockType.InfoBlock;
355
339
  } & InfoBlockProps;
356
- export type SecurityBlockModel = {
357
- type: BlockType.SecurityBlock;
358
- } & SecurityBlockProps;
359
340
  export type TableBlockModel = {
360
341
  type: BlockType.TableBlock;
361
342
  } & TableBlockProps;
@@ -386,6 +367,6 @@ export type ContentLayoutBlockModel = {
386
367
  export type ShareBLockModel = {
387
368
  type: BlockType.ShareBlock;
388
369
  } & ShareBlockProps;
389
- type BlockModels = SliderBlockModel | ServiceDemoBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | CalculatorBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | SecurityBlockModel | TableBlockModel | TabsBlockModel | SimpleBlockModel | LinkTableBlockModel | HeaderBlockModel | PreviewBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel;
370
+ type BlockModels = SliderBlockModel | ServiceDemoBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | CalculatorBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | SimpleBlockModel | LinkTableBlockModel | HeaderBlockModel | PreviewBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel;
390
371
  export type Block = BlockModels & BlockBaseProps;
391
372
  export {};
@@ -11,7 +11,6 @@ export var BlockType;
11
11
  BlockType["MediaBlock"] = "media-block";
12
12
  BlockType["PreviewBlock"] = "preview-block";
13
13
  BlockType["InfoBlock"] = "info-block";
14
- BlockType["SecurityBlock"] = "security-block";
15
14
  BlockType["TableBlock"] = "table-block";
16
15
  BlockType["TabsBlock"] = "tabs-block";
17
16
  BlockType["SimpleBlock"] = "simple-block";
@@ -1,5 +1,5 @@
1
1
  export { validators } from './validators';
2
- import { BannerBlock, BannerCard, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, HeaderBlock, HeaderSliderBlock, IconsBlock, InfoBlock, LinkTableBlock, MapBlock, MediaBlock, PreviewBlock, PromoFeaturesBlock, QuestionsBlock, SecurityBlock, ShareBlock, SimpleBlock, SliderBlock, TableBlock, TabsBlock, } from './validators/blocks';
2
+ import { BannerBlock, BannerCard, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, HeaderBlock, HeaderSliderBlock, IconsBlock, InfoBlock, LinkTableBlock, MapBlock, MediaBlock, PreviewBlock, PromoFeaturesBlock, QuestionsBlock, ShareBlock, SimpleBlock, SliderBlock, TableBlock, TabsBlock, } from './validators/blocks';
3
3
  import { AnimatableProps, BackgroundProps, MenuProps, withTheme } from './validators/common';
4
4
  import { LogoProps, NavigationHeaderProps } from './validators/navigation';
5
5
  import { BackgroundCard, BasicCard, CardWithImage, Divider, MediaCardBlock, NewsCard, PartnerBlock, PriceDetailedBlock, Quote, TutorialCard, } from './validators/sub-blocks';
@@ -9,7 +9,7 @@ export const getBlocksCases = (blocks) => {
9
9
  };
10
10
  export function generateDefaultSchema(config) {
11
11
  const { cards = {}, blocks = {}, extensions = {} } = config !== null && config !== void 0 ? config : {};
12
- const blockValidators = 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(Object.assign(Object.assign(Object.assign({}, Divider), ExtendedFeaturesBlock), PromoFeaturesBlock), SliderBlock), QuestionsBlock), HeaderBlock), BannerBlock), CompaniesBlock), MediaBlock), MapBlock), InfoBlock), SecurityBlock), TableBlock), TabsBlock), SimpleBlock), LinkTableBlock), PreviewBlock), HeaderSliderBlock), IconsBlock), CardLayoutBlock), ContentLayoutBlock), ShareBlock), FilterBlock);
12
+ const blockValidators = 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(Object.assign(Object.assign({}, Divider), ExtendedFeaturesBlock), PromoFeaturesBlock), SliderBlock), QuestionsBlock), HeaderBlock), BannerBlock), CompaniesBlock), MediaBlock), MapBlock), InfoBlock), TableBlock), TabsBlock), SimpleBlock), LinkTableBlock), PreviewBlock), HeaderSliderBlock), IconsBlock), CardLayoutBlock), ContentLayoutBlock), ShareBlock), FilterBlock);
13
13
  const cardValidators = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, PartnerBlock), MediaCardBlock), BannerCard), PriceDetailedBlock), TutorialCard), BackgroundCard), NewsCard), CardWithImage), Quote), BasicCard);
14
14
  const constructorBlockSchemaNames = [
15
15
  'divider',
@@ -8,7 +8,6 @@ export * from '../../blocks/Info/schema';
8
8
  export * from '../../blocks/Media/schema';
9
9
  export * from '../../blocks/Map/schema';
10
10
  export * from '../../blocks/Questions/schema';
11
- export * from '../../blocks/Security/schema';
12
11
  export * from '../../blocks/Slider/schema';
13
12
  export * from '../../blocks/Table/schema';
14
13
  export * from '../../blocks/LinkTable/schema';
@@ -8,7 +8,6 @@ export * from '../../blocks/Info/schema';
8
8
  export * from '../../blocks/Media/schema';
9
9
  export * from '../../blocks/Map/schema';
10
10
  export * from '../../blocks/Questions/schema';
11
- export * from '../../blocks/Security/schema';
12
11
  export * from '../../blocks/Slider/schema';
13
12
  export * from '../../blocks/Table/schema';
14
13
  export * from '../../blocks/LinkTable/schema';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "2.12.0-alpha",
3
+ "version": "2.13.0-alpha.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -138,5 +138,8 @@
138
138
  "*.{json,yaml,yml,md}": [
139
139
  "prettier --write"
140
140
  ]
141
+ },
142
+ "publishConfig": {
143
+ "tag": "alpha"
141
144
  }
142
145
  }
@@ -16,7 +16,6 @@ export declare enum BlockType {
16
16
  MediaBlock = "media-block",
17
17
  PreviewBlock = "preview-block",
18
18
  InfoBlock = "info-block",
19
- SecurityBlock = "security-block",
20
19
  TableBlock = "table-block",
21
20
  TabsBlock = "tabs-block",
22
21
  SimpleBlock = "simple-block",
@@ -204,21 +203,6 @@ export interface InfoBlockProps {
204
203
  leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;
205
204
  rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;
206
205
  }
207
- export interface SecurityBlockPoint {
208
- img: string;
209
- text: string;
210
- link: {
211
- text: string;
212
- url: string;
213
- };
214
- }
215
- export interface SecurityBlockProps extends Animatable {
216
- theme?: TextTheme;
217
- backgroundColor?: string;
218
- title: string;
219
- points?: SecurityBlockPoint[];
220
- media: MediaProps;
221
- }
222
206
  export interface TableProps {
223
207
  content: string[][];
224
208
  legend?: string[];
@@ -353,9 +337,6 @@ export type PreviewBlockModel = {
353
337
  export type InfoBlockModel = {
354
338
  type: BlockType.InfoBlock;
355
339
  } & InfoBlockProps;
356
- export type SecurityBlockModel = {
357
- type: BlockType.SecurityBlock;
358
- } & SecurityBlockProps;
359
340
  export type TableBlockModel = {
360
341
  type: BlockType.TableBlock;
361
342
  } & TableBlockProps;
@@ -386,6 +367,6 @@ export type ContentLayoutBlockModel = {
386
367
  export type ShareBLockModel = {
387
368
  type: BlockType.ShareBlock;
388
369
  } & ShareBlockProps;
389
- type BlockModels = SliderBlockModel | ServiceDemoBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | CalculatorBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | SecurityBlockModel | TableBlockModel | TabsBlockModel | SimpleBlockModel | LinkTableBlockModel | HeaderBlockModel | PreviewBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel;
370
+ type BlockModels = SliderBlockModel | ServiceDemoBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | CalculatorBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | SimpleBlockModel | LinkTableBlockModel | HeaderBlockModel | PreviewBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel;
390
371
  export type Block = BlockModels & BlockBaseProps;
391
372
  export {};
@@ -14,7 +14,6 @@ var BlockType;
14
14
  BlockType["MediaBlock"] = "media-block";
15
15
  BlockType["PreviewBlock"] = "preview-block";
16
16
  BlockType["InfoBlock"] = "info-block";
17
- BlockType["SecurityBlock"] = "security-block";
18
17
  BlockType["TableBlock"] = "table-block";
19
18
  BlockType["TabsBlock"] = "tabs-block";
20
19
  BlockType["SimpleBlock"] = "simple-block";
@@ -1,142 +0,0 @@
1
- .pc-SecurityBlock__title {
2
- margin: 0;
3
- }
4
-
5
- /* use this for style redefinitions to awoid problems with
6
- unpredictable css rules order in build */
7
- .pc-SecurityBlock_theme_dark {
8
- color: var(--yc-color-text-light-primary);
9
- }
10
- .pc-SecurityBlock_theme_dark h1,
11
- .pc-SecurityBlock_theme_dark h2,
12
- .pc-SecurityBlock_theme_dark h3,
13
- .pc-SecurityBlock_theme_dark h4,
14
- .pc-SecurityBlock_theme_dark h5,
15
- .pc-SecurityBlock_theme_dark h6,
16
- .pc-SecurityBlock_theme_dark .yfm {
17
- color: var(--yc-color-text-light-primary);
18
- }
19
- .pc-SecurityBlock_theme_light .pc-SecurityBlock__background {
20
- background-color: var(--yc-color-base-background);
21
- }
22
- .pc-SecurityBlock_theme_light .pc-SecurityBlock__content {
23
- padding: 0;
24
- }
25
- .pc-SecurityBlock_theme_light .pc-SecurityBlock__point-icon,
26
- .pc-SecurityBlock_theme_light .pc-SecurityBlock__point-text {
27
- color: var(--yc-color-text-primary);
28
- }
29
- .pc-SecurityBlock__title {
30
- font-size: var(--yc-text-display-2-font-size);
31
- line-height: var(--yc-text-display-2-line-height);
32
- color: var(--pc-text-header-color);
33
- font-weight: var(--yc-text-accent-font-weight);
34
- }
35
- @media (max-width: 576px) {
36
- .pc-SecurityBlock__title {
37
- font-size: var(--yc-text-display-1-font-size);
38
- line-height: var(--yc-text-display-1-line-height);
39
- }
40
- }
41
- .pc-SecurityBlock__background {
42
- background-color: var(--yc-color-promo-base-asphalt);
43
- }
44
- .pc-SecurityBlock__content {
45
- padding: 96px 0 128px;
46
- }
47
- .pc-SecurityBlock__points {
48
- padding-top: 20px;
49
- }
50
- .pc-SecurityBlock__point-icon {
51
- width: 48px;
52
- height: 48px;
53
- }
54
- .pc-SecurityBlock__point-text {
55
- color: var(--yc-color-text-light-primary);
56
- }
57
- .pc-SecurityBlock__point-text a {
58
- outline: none;
59
- color: var(--yc-color-text-link);
60
- text-decoration: none;
61
- cursor: pointer;
62
- }
63
- .utilityfocus .pc-SecurityBlock__point-text a:focus {
64
- outline: 2px solid #ffdb4d;
65
- }
66
- .pc-SecurityBlock__point-text a:hover, .pc-SecurityBlock__point-text a:active {
67
- --pc-text-header-color: var(--yc-color-text-link-hover);
68
- color: var(--yc-color-text-link-hover);
69
- }
70
- .pc-SecurityBlock__point-text, .pc-SecurityBlock__point-link {
71
- font-size: var(--yc-text-body-2-font-size);
72
- line-height: var(--yc-text-body-2-line-height);
73
- margin-top: 8px;
74
- }
75
- .pc-SecurityBlock__media {
76
- margin-top: 48px;
77
- border-radius: var(--pc-border-radius);
78
- overflow: hidden;
79
- }
80
- @media (max-width: 577px) {
81
- .pc-SecurityBlock__content {
82
- padding: 64px 0;
83
- }
84
- .pc-SecurityBlock__point + .pc-SecurityBlock__point {
85
- margin-top: 20px;
86
- }
87
- }
88
- @media (min-width: 769px) {
89
- .pc-SecurityBlock.pc-AnimateBlock .pc-SecurityBlock__point, .pc-AnimateBlock .pc-SecurityBlock .pc-SecurityBlock__point {
90
- position: relative;
91
- top: 100px;
92
- opacity: 0;
93
- }
94
- .pc-SecurityBlock.pc-AnimateBlock.animate .pc-SecurityBlock__point, .pc-AnimateBlock .pc-SecurityBlock.animate .pc-SecurityBlock__point {
95
- top: 0;
96
- opacity: 1;
97
- transition: top 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
98
- }
99
- .pc-SecurityBlock.pc-AnimateBlock.animate .pc-SecurityBlock__point:nth-child(0), .pc-AnimateBlock .pc-SecurityBlock.animate .pc-SecurityBlock__point:nth-child(0) {
100
- transition-delay: 0s;
101
- }
102
- .pc-SecurityBlock.pc-AnimateBlock.animate .pc-SecurityBlock__point:nth-child(1), .pc-AnimateBlock .pc-SecurityBlock.animate .pc-SecurityBlock__point:nth-child(1) {
103
- transition-delay: 0.1s;
104
- }
105
- .pc-SecurityBlock.pc-AnimateBlock.animate .pc-SecurityBlock__point:nth-child(2), .pc-AnimateBlock .pc-SecurityBlock.animate .pc-SecurityBlock__point:nth-child(2) {
106
- transition-delay: 0.2s;
107
- }
108
- .pc-SecurityBlock.pc-AnimateBlock.animate .pc-SecurityBlock__point:nth-child(3), .pc-AnimateBlock .pc-SecurityBlock.animate .pc-SecurityBlock__point:nth-child(3) {
109
- transition-delay: 0.3s;
110
- }
111
- .pc-SecurityBlock.pc-AnimateBlock.animate .pc-SecurityBlock__point:nth-child(4), .pc-AnimateBlock .pc-SecurityBlock.animate .pc-SecurityBlock__point:nth-child(4) {
112
- transition-delay: 0.4s;
113
- }
114
- .pc-SecurityBlock.pc-AnimateBlock.animate .pc-SecurityBlock__point:nth-child(5), .pc-AnimateBlock .pc-SecurityBlock.animate .pc-SecurityBlock__point:nth-child(5) {
115
- transition-delay: 0.5s;
116
- }
117
- .pc-SecurityBlock.pc-AnimateBlock.animate .pc-SecurityBlock__point:nth-child(6), .pc-AnimateBlock .pc-SecurityBlock.animate .pc-SecurityBlock__point:nth-child(6) {
118
- transition-delay: 0.6s;
119
- }
120
- .pc-SecurityBlock.pc-AnimateBlock.animate .pc-SecurityBlock__point:nth-child(7), .pc-AnimateBlock .pc-SecurityBlock.animate .pc-SecurityBlock__point:nth-child(7) {
121
- transition-delay: 0.7s;
122
- }
123
- .pc-SecurityBlock.pc-AnimateBlock.animate .pc-SecurityBlock__point:nth-child(8), .pc-AnimateBlock .pc-SecurityBlock.animate .pc-SecurityBlock__point:nth-child(8) {
124
- transition-delay: 0.8s;
125
- }
126
- .pc-SecurityBlock.pc-AnimateBlock.animate .pc-SecurityBlock__point:nth-child(9), .pc-AnimateBlock .pc-SecurityBlock.animate .pc-SecurityBlock__point:nth-child(9) {
127
- transition-delay: 0.9s;
128
- }
129
- }
130
- @media (min-width: 769px) {
131
- .pc-SecurityBlock.pc-AnimateBlock .pc-SecurityBlock__media, .pc-AnimateBlock .pc-SecurityBlock .pc-SecurityBlock__media {
132
- position: relative;
133
- top: 100px;
134
- opacity: 0;
135
- }
136
- .pc-SecurityBlock.pc-AnimateBlock.animate .pc-SecurityBlock__media, .pc-AnimateBlock .pc-SecurityBlock.animate .pc-SecurityBlock__media {
137
- top: 0;
138
- opacity: 1;
139
- transition: top 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
140
- transition-delay: 0.5s;
141
- }
142
- }
@@ -1,3 +0,0 @@
1
- import { SecurityBlockProps } from '../../models';
2
- export declare const SecurityBlock: (props: SecurityBlockProps) => JSX.Element;
3
- export default SecurityBlock;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SecurityBlock = void 0;
4
- const tslib_1 = require("tslib");
5
- const react_1 = tslib_1.__importDefault(require("react"));
6
- const components_1 = require("../../components");
7
- const grid_1 = require("../../grid");
8
- const utils_1 = require("../../utils");
9
- const b = (0, utils_1.block)('SecurityBlock');
10
- const SecurityBlock = (props) => {
11
- const { backgroundColor, theme = 'dark', title, points, media, animated } = props;
12
- return (react_1.default.createElement(components_1.AnimateBlock, { className: b({ theme }), offset: 200, animate: animated },
13
- react_1.default.createElement("div", { className: b('content') },
14
- react_1.default.createElement(components_1.FullWidthBackground, { className: b('background'), style: { backgroundColor } }),
15
- react_1.default.createElement(grid_1.Grid, null,
16
- react_1.default.createElement(grid_1.Row, null,
17
- react_1.default.createElement(grid_1.Col, null,
18
- react_1.default.createElement("h2", { className: b('title') }, title))),
19
- points && (react_1.default.createElement(grid_1.Row, { className: b('points') }, points.map(({ text, link, img }, index) => (react_1.default.createElement(grid_1.Col, { key: index, className: b('point'), sizes: { sm: 4, all: 12 } },
20
- react_1.default.createElement(components_1.ImageBase, { className: b('point-icon'), src: img }),
21
- react_1.default.createElement(components_1.HTML, { className: b('point-text'), block: true }, text),
22
- link && (react_1.default.createElement(components_1.Link, { className: b('point-link'), text: link.text, url: link.url, theme: 'normal', arrow: true }))))))),
23
- media && (react_1.default.createElement(grid_1.Row, { className: b('media') },
24
- react_1.default.createElement(grid_1.Col, null,
25
- react_1.default.createElement(components_1.Media, Object.assign({ className: b('media') }, media)))))))));
26
- };
27
- exports.SecurityBlock = SecurityBlock;
28
- exports.default = exports.SecurityBlock;