@gravity-ui/page-constructor 2.2.1-alpha.0 → 2.3.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 (136) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +1 -1
  3. package/build/cjs/blocks/Preview/MediaContent/MediaContent.css +50 -0
  4. package/build/cjs/blocks/Preview/MediaContent/MediaContent.d.ts +13 -0
  5. package/build/cjs/blocks/Preview/MediaContent/MediaContent.js +49 -0
  6. package/build/cjs/blocks/Preview/MediaContent/PreviewContent.css +106 -0
  7. package/build/cjs/blocks/Preview/MediaContent/PreviewContent.d.ts +11 -0
  8. package/build/cjs/blocks/Preview/MediaContent/PreviewContent.js +17 -0
  9. package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.css +54 -0
  10. package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.d.ts +9 -0
  11. package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.js +13 -0
  12. package/build/cjs/blocks/Preview/Preview.css +50 -0
  13. package/build/cjs/blocks/Preview/Preview.d.ts +3 -0
  14. package/build/cjs/blocks/Preview/Preview.js +130 -0
  15. package/build/cjs/blocks/Preview/schema.d.ts +40 -0
  16. package/build/cjs/blocks/Preview/schema.js +53 -0
  17. package/build/cjs/blocks/Simple/Simple.css +22 -0
  18. package/build/cjs/blocks/Simple/Simple.d.ts +3 -0
  19. package/build/cjs/blocks/Simple/Simple.js +22 -0
  20. package/build/cjs/blocks/Simple/schema.d.ts +68 -0
  21. package/build/cjs/blocks/Simple/schema.js +14 -0
  22. package/build/cjs/blocks/index.d.ts +2 -0
  23. package/build/cjs/blocks/index.js +5 -1
  24. package/build/cjs/blocks/validators.d.ts +2 -0
  25. package/build/cjs/blocks/validators.js +2 -0
  26. package/build/cjs/components/HTML/HTML.d.ts +1 -1
  27. package/build/cjs/components/Image/Image.js +2 -2
  28. package/build/cjs/constructor-items.d.ts +6 -0
  29. package/build/cjs/constructor-items.js +6 -0
  30. package/build/cjs/context/breakpointContext/breakpointContext.d.ts +2 -0
  31. package/build/cjs/context/breakpointContext/breakpointContext.js +7 -0
  32. package/build/cjs/context/breakpointContext/index.d.ts +1 -0
  33. package/build/cjs/context/breakpointContext/index.js +4 -0
  34. package/build/cjs/hooks/index.d.ts +1 -0
  35. package/build/cjs/hooks/index.js +3 -1
  36. package/build/cjs/hooks/useIntersection.d.ts +1 -0
  37. package/build/cjs/hooks/useIntersection.js +21 -0
  38. package/build/cjs/models/constructor-items/blocks.d.ts +23 -2
  39. package/build/cjs/models/constructor-items/blocks.js +2 -0
  40. package/build/cjs/models/constructor-items/common.d.ts +14 -0
  41. package/build/cjs/models/constructor-items/common.js +6 -1
  42. package/build/cjs/models/constructor-items/sub-blocks.d.ts +25 -9
  43. package/build/cjs/models/constructor-items/sub-blocks.js +7 -6
  44. package/build/cjs/schema/index.js +4 -2
  45. package/build/cjs/schema/validators/blocks.d.ts +2 -0
  46. package/build/cjs/schema/validators/blocks.js +2 -0
  47. package/build/cjs/schema/validators/sub-blocks.d.ts +1 -0
  48. package/build/cjs/schema/validators/sub-blocks.js +1 -0
  49. package/build/cjs/sub-blocks/CardWithImage/CardWithImage.css +19 -0
  50. package/build/cjs/sub-blocks/CardWithImage/CardWithImage.d.ts +3 -0
  51. package/build/cjs/sub-blocks/CardWithImage/CardWithImage.js +16 -0
  52. package/build/cjs/sub-blocks/CardWithImage/schema.d.ts +154 -0
  53. package/build/cjs/sub-blocks/CardWithImage/schema.js +46 -0
  54. package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +1 -0
  55. package/build/cjs/sub-blocks/index.d.ts +1 -0
  56. package/build/cjs/sub-blocks/index.js +3 -1
  57. package/build/cjs/text-transform/blocks.js +32 -0
  58. package/build/cjs/utils/imageCompress.d.ts +6 -0
  59. package/build/cjs/utils/imageCompress.js +11 -0
  60. package/build/cjs/utils/index.d.ts +1 -0
  61. package/build/cjs/utils/index.js +1 -0
  62. package/build/cjs/utils/scroll.d.ts +15 -0
  63. package/build/cjs/utils/scroll.js +34 -0
  64. package/build/esm/blocks/Preview/MediaContent/MediaContent.css +50 -0
  65. package/build/esm/blocks/Preview/MediaContent/MediaContent.d.ts +14 -0
  66. package/build/esm/blocks/Preview/MediaContent/MediaContent.js +47 -0
  67. package/build/esm/blocks/Preview/MediaContent/PreviewContent.css +106 -0
  68. package/build/esm/blocks/Preview/MediaContent/PreviewContent.d.ts +12 -0
  69. package/build/esm/blocks/Preview/MediaContent/PreviewContent.js +15 -0
  70. package/build/esm/blocks/Preview/MediaContent/PreviewMedia.css +54 -0
  71. package/build/esm/blocks/Preview/MediaContent/PreviewMedia.d.ts +10 -0
  72. package/build/esm/blocks/Preview/MediaContent/PreviewMedia.js +11 -0
  73. package/build/esm/blocks/Preview/Preview.css +50 -0
  74. package/build/esm/blocks/Preview/Preview.d.ts +4 -0
  75. package/build/esm/blocks/Preview/Preview.js +126 -0
  76. package/build/esm/blocks/Preview/schema.d.ts +40 -0
  77. package/build/esm/blocks/Preview/schema.js +50 -0
  78. package/build/esm/blocks/Simple/Simple.css +22 -0
  79. package/build/esm/blocks/Simple/Simple.d.ts +4 -0
  80. package/build/esm/blocks/Simple/Simple.js +18 -0
  81. package/build/esm/blocks/Simple/schema.d.ts +68 -0
  82. package/build/esm/blocks/Simple/schema.js +11 -0
  83. package/build/esm/blocks/index.d.ts +2 -0
  84. package/build/esm/blocks/index.js +2 -0
  85. package/build/esm/blocks/validators.d.ts +2 -0
  86. package/build/esm/blocks/validators.js +2 -0
  87. package/build/esm/components/HTML/HTML.d.ts +1 -1
  88. package/build/esm/components/Image/Image.js +2 -2
  89. package/build/esm/constructor-items.d.ts +6 -0
  90. package/build/esm/constructor-items.js +8 -2
  91. package/build/esm/context/breakpointContext/breakpointContext.d.ts +2 -0
  92. package/build/esm/context/breakpointContext/breakpointContext.js +3 -0
  93. package/build/esm/context/breakpointContext/index.d.ts +1 -0
  94. package/build/esm/context/breakpointContext/index.js +1 -0
  95. package/build/esm/hooks/index.d.ts +1 -0
  96. package/build/esm/hooks/index.js +1 -0
  97. package/build/esm/hooks/useIntersection.d.ts +1 -0
  98. package/build/esm/hooks/useIntersection.js +17 -0
  99. package/build/esm/models/constructor-items/blocks.d.ts +23 -2
  100. package/build/esm/models/constructor-items/blocks.js +2 -0
  101. package/build/esm/models/constructor-items/common.d.ts +14 -0
  102. package/build/esm/models/constructor-items/common.js +5 -0
  103. package/build/esm/models/constructor-items/sub-blocks.d.ts +25 -9
  104. package/build/esm/models/constructor-items/sub-blocks.js +7 -6
  105. package/build/esm/schema/index.js +6 -4
  106. package/build/esm/schema/validators/blocks.d.ts +2 -0
  107. package/build/esm/schema/validators/blocks.js +2 -0
  108. package/build/esm/schema/validators/sub-blocks.d.ts +1 -0
  109. package/build/esm/schema/validators/sub-blocks.js +1 -0
  110. package/build/esm/sub-blocks/CardWithImage/CardWithImage.css +19 -0
  111. package/build/esm/sub-blocks/CardWithImage/CardWithImage.d.ts +4 -0
  112. package/build/esm/sub-blocks/CardWithImage/CardWithImage.js +14 -0
  113. package/build/esm/sub-blocks/CardWithImage/schema.d.ts +154 -0
  114. package/build/esm/sub-blocks/CardWithImage/schema.js +43 -0
  115. package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +1 -0
  116. package/build/esm/sub-blocks/index.d.ts +1 -0
  117. package/build/esm/sub-blocks/index.js +1 -0
  118. package/build/esm/text-transform/blocks.js +32 -0
  119. package/build/esm/utils/imageCompress.d.ts +6 -0
  120. package/build/esm/utils/imageCompress.js +7 -0
  121. package/build/esm/utils/index.d.ts +1 -0
  122. package/build/esm/utils/index.js +1 -0
  123. package/build/esm/utils/scroll.d.ts +15 -0
  124. package/build/esm/utils/scroll.js +30 -0
  125. package/package.json +1 -4
  126. package/server/models/constructor-items/blocks.d.ts +23 -2
  127. package/server/models/constructor-items/blocks.js +2 -0
  128. package/server/models/constructor-items/common.d.ts +14 -0
  129. package/server/models/constructor-items/common.js +6 -1
  130. package/server/models/constructor-items/sub-blocks.d.ts +25 -9
  131. package/server/models/constructor-items/sub-blocks.js +7 -6
  132. package/server/text-transform/blocks.js +32 -0
  133. package/server/utils/index.d.ts +1 -0
  134. package/server/utils/index.js +1 -0
  135. package/server/utils/scroll.d.ts +15 -0
  136. package/server/utils/scroll.js +34 -0
@@ -7,7 +7,7 @@ export interface HTMLProps {
7
7
  }
8
8
  declare const HTML: ({ children, block, className }: WithChildren<HTMLProps>) => React.DetailedReactHTMLElement<{
9
9
  dangerouslySetInnerHTML: {
10
- __html: string & (boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | null);
10
+ __html: string | (string & React.ReactElement<any, string | React.JSXElementConstructor<any>>) | (string & React.ReactFragment) | (string & React.ReactPortal);
11
11
  };
12
12
  className: string | undefined;
13
13
  }, HTMLElement> | null;
@@ -1,6 +1,7 @@
1
1
  import React, { useContext, useState, Fragment } from 'react';
2
2
  import { ProjectSettingsContext } from '../../context/projectSettingsContext';
3
3
  import { BREAKPOINTS } from '../../constants';
4
+ import { isCompressible } from '../../utils/imageCompress';
4
5
  const checkWebP = (src) => {
5
6
  return src.endsWith('.webp') ? src : src + '.webp';
6
7
  };
@@ -12,10 +13,9 @@ const Image = (props) => {
12
13
  if (!imageSrc) {
13
14
  return null;
14
15
  }
15
- // TODO: Temporary solution for .svg images
16
16
  const disableWebp = projectSettings.disableCompress ||
17
17
  disableCompress ||
18
- imageSrc.endsWith('.svg') ||
18
+ !isCompressible(imageSrc) ||
19
19
  imgLoadingError;
20
20
  return (React.createElement("picture", { className: containerClassName },
21
21
  mobile && (React.createElement(Fragment, null,
@@ -1,11 +1,13 @@
1
1
  export declare const blockMap: {
2
2
  "slider-block": (props: import("./models").WithChildren<import("./blocks/Slider/Slider").SliderProps>) => JSX.Element;
3
+ "simple-block": (props: import("./models").WithChildren<import("./models").SimpleBlockProps>) => JSX.Element;
3
4
  "extended-features-block": ({ title, description, items, colSizes, animated, }: import("./models").ExtendedFeaturesProps) => JSX.Element;
4
5
  "promo-features-block": (props: import("./models").PromoFeaturesProps) => JSX.Element;
5
6
  "questions-block": (props: import("./models").QuestionsProps) => JSX.Element;
6
7
  "banner-block": (props: import("./models").BannerBlockProps) => JSX.Element;
7
8
  "companies-block": ({ title, images, animated }: import("./models").CompaniesBlockProps) => JSX.Element;
8
9
  "media-block": (props: import("./models").MediaBlockProps) => JSX.Element;
10
+ "preview-block": (props: import("./models").PreviewBlockProps) => JSX.Element;
9
11
  "info-block": (props: import("./models").InfoBlockProps) => JSX.Element;
10
12
  "security-block": (props: import("./models").SecurityBlockProps) => JSX.Element;
11
13
  "table-block": (props: import("./models").TableBlockProps) => JSX.Element;
@@ -35,6 +37,10 @@ export declare const subBlockMap: {
35
37
  "banner-card": (props: import("./models").BannerCardProps) => JSX.Element;
36
38
  "news-card": (props: import("./models").NewsCardProps) => JSX.Element;
37
39
  "layout-item": ({ content: { links, ...content }, metaInfo, media, border, fullScreen, className, }: import("./models").LayoutItemProps) => JSX.Element;
40
+ /**
41
+ * @deprecated Use LayoutItem
42
+ */
43
+ "card-with-image": ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, }: import("./models").CardWithImageProps) => JSX.Element;
38
44
  "background-card": (props: import("./models").BackgroundCardProps) => JSX.Element;
39
45
  "basic-card": (props: import("./models").BasicCardProps) => JSX.Element;
40
46
  content: (props: import("./models").ContentBlockProps & import("./models").ClassNameProps) => JSX.Element;
@@ -1,14 +1,16 @@
1
1
  import { BlockType, SubBlockType } from './models';
2
- import { Partner, PriceDetailed, MediaCard, NewsCard, TutorialCard, LayoutItem, BackgroundCard, Content, Quote, Divider, BannerCard, BasicCard, } from './sub-blocks';
3
- import { BannerBlock, CompaniesBlock, MediaBlock, MapBlock, InfoBlock, SecurityBlock, SliderBlock, ExtendedFeaturesBlock, PromoFeaturesBlock, QuestionsBlock, TableBlock, TabsBlock, LinkTableBlock, HeaderBlock, IconsBlock, HeaderSliderBlock, CardLayoutBlock, ContentLayoutBlock, ShareBlock, FilterBlock, } from './blocks';
2
+ import { Partner, PriceDetailed, MediaCard, NewsCard, TutorialCard, CardWithImage, LayoutItem, BackgroundCard, Content, Quote, Divider, BannerCard, BasicCard, } from './sub-blocks';
3
+ import { BannerBlock, CompaniesBlock, SimpleBlock, MediaBlock, MapBlock, PreviewBlock, InfoBlock, SecurityBlock, SliderBlock, ExtendedFeaturesBlock, PromoFeaturesBlock, QuestionsBlock, TableBlock, TabsBlock, LinkTableBlock, HeaderBlock, IconsBlock, HeaderSliderBlock, CardLayoutBlock, ContentLayoutBlock, ShareBlock, FilterBlock, } from './blocks';
4
4
  export const blockMap = {
5
5
  [BlockType.SliderBlock]: SliderBlock,
6
+ [BlockType.SimpleBlock]: SimpleBlock,
6
7
  [BlockType.ExtendedFeaturesBlock]: ExtendedFeaturesBlock,
7
8
  [BlockType.PromoFeaturesBlock]: PromoFeaturesBlock,
8
9
  [BlockType.QuestionsBlock]: QuestionsBlock,
9
10
  [BlockType.BannerBlock]: BannerBlock,
10
11
  [BlockType.CompaniesBlock]: CompaniesBlock,
11
12
  [BlockType.MediaBlock]: MediaBlock,
13
+ [BlockType.PreviewBlock]: PreviewBlock,
12
14
  [BlockType.InfoBlock]: InfoBlock,
13
15
  [BlockType.SecurityBlock]: SecurityBlock,
14
16
  [BlockType.TableBlock]: TableBlock,
@@ -38,6 +40,10 @@ export const subBlockMap = {
38
40
  [SubBlockType.BannerCard]: BannerCard,
39
41
  [SubBlockType.NewsCard]: NewsCard,
40
42
  [SubBlockType.LayoutItem]: LayoutItem,
43
+ /**
44
+ * @deprecated Use LayoutItem
45
+ */
46
+ [SubBlockType.CardWithImage]: CardWithImage,
41
47
  [SubBlockType.BackgroundCard]: BackgroundCard,
42
48
  [SubBlockType.BasicCard]: BasicCard,
43
49
  [SubBlockType.Content]: Content,
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const BreakpointContext: React.Context<number>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { BREAKPOINTS } from '../../constants';
3
+ export const BreakpointContext = React.createContext(BREAKPOINTS.sm);
@@ -0,0 +1 @@
1
+ export * from './breakpointContext';
@@ -0,0 +1 @@
1
+ export * from './breakpointContext';
@@ -1,5 +1,6 @@
1
1
  export { default as useFocus } from './useFocus';
2
2
  export { default as useWindowBreakpoint } from './useWindowBreakpoint';
3
+ export { useIntersection } from './useIntersection';
3
4
  export { default as useMount } from './useMount';
4
5
  export * from './useAnalytics';
5
6
  export * from './hubspot';
@@ -1,5 +1,6 @@
1
1
  export { default as useFocus } from './useFocus';
2
2
  export { default as useWindowBreakpoint } from './useWindowBreakpoint';
3
+ export { useIntersection } from './useIntersection';
3
4
  export { default as useMount } from './useMount';
4
5
  export * from './useAnalytics';
5
6
  export * from './hubspot';
@@ -0,0 +1 @@
1
+ export declare const useIntersection: (element?: Element, startMargin?: string, threshold?: number) => boolean;
@@ -0,0 +1,17 @@
1
+ import { useState, useEffect } from 'react';
2
+ export const useIntersection = (element, startMargin = '0px', threshold = 0.2) => {
3
+ const [isVisible, setState] = useState(false);
4
+ useEffect(() => {
5
+ const observer = new IntersectionObserver(([entry]) => {
6
+ setState(entry.isIntersecting);
7
+ }, {
8
+ rootMargin: startMargin,
9
+ threshold,
10
+ });
11
+ if (element) {
12
+ observer.observe(element);
13
+ }
14
+ return () => element && observer.unobserve(element);
15
+ }, [element, startMargin, threshold]);
16
+ return isVisible;
17
+ };
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ButtonSize } from '@gravity-ui/uikit';
3
- import { BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, Justify, LinkProps, LinkTheme, MediaDirection, MediaProps, MapProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleProps, LegendTableMarkerType, AnchorProps, TitleBaseProps, Animatable, BlockHeaderProps, ImageDeviceProps } from './common';
3
+ import { BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, Justify, LinkProps, LinkTheme, MediaDirection, MediaProps, MapProps, PreviewItemProps, PreviewRatioMediaContent, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleProps, LegendTableMarkerType, AnchorProps, TitleBaseProps, Animatable, BlockHeaderProps, ImageDeviceProps } from './common';
4
4
  import { ThemeSupporting } from '../../utils';
5
5
  import { GridColumnSize, GridColumnSizesType } from '../../grid/types';
6
6
  import { BannerCardProps, SubBlock, SubBlockModels } from './sub-blocks';
@@ -14,10 +14,12 @@ export declare enum BlockType {
14
14
  BannerBlock = "banner-block",
15
15
  CompaniesBlock = "companies-block",
16
16
  MediaBlock = "media-block",
17
+ PreviewBlock = "preview-block",
17
18
  InfoBlock = "info-block",
18
19
  SecurityBlock = "security-block",
19
20
  TableBlock = "table-block",
20
21
  TabsBlock = "tabs-block",
22
+ SimpleBlock = "simple-block",
21
23
  HeaderSliderBlock = "header-slider-block",
22
24
  LinkTableBlock = "link-table-block",
23
25
  HeaderBlock = "header-block",
@@ -112,6 +114,10 @@ export interface HeaderBlockProps {
112
114
  status?: JSX.Element;
113
115
  }
114
116
  export type CalculatorProps = Animatable;
117
+ export interface SimpleBlockProps extends Animatable, Childable {
118
+ title: TitleBaseProps;
119
+ description: string;
120
+ }
115
121
  export interface ExtendedFeaturesItem extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {
116
122
  title: string;
117
123
  label?: string;
@@ -174,6 +180,15 @@ export interface MediaBlockProps extends MediaBaseBlockProps {
174
180
  export interface MapBlockProps extends MediaBaseBlockProps {
175
181
  map: MapProps;
176
182
  }
183
+ export interface PreviewBlockProps extends Animatable {
184
+ title: string;
185
+ items: PreviewItemProps[];
186
+ description?: string;
187
+ direction?: MediaDirection;
188
+ ratioMediaContent?: PreviewRatioMediaContent;
189
+ stopVideo?: boolean;
190
+ showImmediately?: boolean;
191
+ }
177
192
  export interface InfoBlockProps {
178
193
  theme?: TextTheme;
179
194
  backgroundColor?: ThemeSupporting<string>;
@@ -331,6 +346,9 @@ export type MediaBlockModel = {
331
346
  export type MapBlockModel = {
332
347
  type: BlockType.MapBlock;
333
348
  } & MapBlockProps;
349
+ export type PreviewBlockModel = {
350
+ type: BlockType.PreviewBlock;
351
+ } & PreviewBlockProps;
334
352
  export type InfoBlockModel = {
335
353
  type: BlockType.InfoBlock;
336
354
  } & InfoBlockProps;
@@ -343,6 +361,9 @@ export type TableBlockModel = {
343
361
  export type TabsBlockModel = {
344
362
  type: BlockType.TabsBlock;
345
363
  } & TabsBlockProps;
364
+ export type SimpleBlockModel = {
365
+ type: BlockType.SimpleBlock;
366
+ } & SimpleBlockProps;
346
367
  export type LinkTableBlockModel = {
347
368
  type: BlockType.LinkTableBlock;
348
369
  } & LinkTableBlockProps;
@@ -364,6 +385,6 @@ export type ContentLayoutBlockModel = {
364
385
  export type ShareBLockModel = {
365
386
  type: BlockType.ShareBlock;
366
387
  } & ShareBlockProps;
367
- type BlockModels = SliderBlockModel | ServiceDemoBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | CalculatorBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | SecurityBlockModel | TableBlockModel | TabsBlockModel | LinkTableBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel;
388
+ 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;
368
389
  export type Block = BlockModels & BlockBaseProps;
369
390
  export {};
@@ -9,10 +9,12 @@ export var BlockType;
9
9
  BlockType["BannerBlock"] = "banner-block";
10
10
  BlockType["CompaniesBlock"] = "companies-block";
11
11
  BlockType["MediaBlock"] = "media-block";
12
+ BlockType["PreviewBlock"] = "preview-block";
12
13
  BlockType["InfoBlock"] = "info-block";
13
14
  BlockType["SecurityBlock"] = "security-block";
14
15
  BlockType["TableBlock"] = "table-block";
15
16
  BlockType["TabsBlock"] = "tabs-block";
17
+ BlockType["SimpleBlock"] = "simple-block";
16
18
  BlockType["HeaderSliderBlock"] = "header-slider-block";
17
19
  BlockType["LinkTableBlock"] = "link-table-block";
18
20
  BlockType["HeaderBlock"] = "header-block";
@@ -17,6 +17,10 @@ export declare enum PriceLabelColor {
17
17
  PURPLE = "purple",
18
18
  RED = "red"
19
19
  }
20
+ export declare enum PreviewItemType {
21
+ Video = "video",
22
+ Image = "image"
23
+ }
20
24
  export declare enum PlayButtonType {
21
25
  Default = "default",
22
26
  Text = "text"
@@ -45,6 +49,7 @@ export type LegendTableMarkerType = 'disk';
45
49
  export type LinkTheme = 'file-link' | 'normal' | 'back' | 'underline';
46
50
  export type MediaDirection = 'media-content' | 'content-media';
47
51
  export type PriceDescriptionColor = 'cornflower' | 'black';
52
+ export type PreviewRatioMediaContent = '2-1' | '1-1';
48
53
  export type ContentSize = 's' | 'l';
49
54
  export type ContentTextSize = 's' | 'm' | 'l';
50
55
  export type ContentTheme = 'default' | 'dark' | 'light';
@@ -244,6 +249,15 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
244
249
  metrikaGoals?: MetrikaGoal;
245
250
  pixelEvents?: ButtonPixel;
246
251
  }
252
+ export interface PreviewContentItemProps {
253
+ title: string;
254
+ description?: string;
255
+ }
256
+ export interface PreviewItemProps {
257
+ type: PreviewItemType;
258
+ media: ThemedMediaProps;
259
+ content: PreviewContentItemProps;
260
+ }
247
261
  export interface TitleProps extends Justifyable, TitleBaseProps {
248
262
  navTitle?: string;
249
263
  anchor?: string;
@@ -17,6 +17,11 @@ export var PriceLabelColor;
17
17
  PriceLabelColor["PURPLE"] = "purple";
18
18
  PriceLabelColor["RED"] = "red";
19
19
  })(PriceLabelColor || (PriceLabelColor = {}));
20
+ export var PreviewItemType;
21
+ (function (PreviewItemType) {
22
+ PreviewItemType["Video"] = "video";
23
+ PreviewItemType["Image"] = "image";
24
+ })(PreviewItemType || (PreviewItemType = {}));
20
25
  export var PlayButtonType;
21
26
  (function (PlayButtonType) {
22
27
  PlayButtonType["Default"] = "default";
@@ -1,7 +1,7 @@
1
1
  import { ClassNameProps } from '../../models';
2
2
  import { ThemeSupporting } from '../../utils';
3
3
  import { HubspotEventData, HubspotEventHandlers } from '../../utils/hubspot';
4
- import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageObjectProps, ImageProps, MediaProps, PriceDetailedProps, TextTheme, Themable, ThemedImage } from './common';
4
+ import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageObjectProps, ImageProps, LinkProps, MediaProps, PriceDetailedProps, TextTheme, Themable, ThemedImage } from './common';
5
5
  import { ContentBlockProps } from './blocks';
6
6
  import { AnalyticsEventsBase, PixelEvent } from '../common';
7
7
  export declare enum SubBlockType {
@@ -9,26 +9,27 @@ export declare enum SubBlockType {
9
9
  Quote = "quote",
10
10
  NewsCard = "news-card",
11
11
  /**
12
- * @deprecated Will be removed, use BasicCard instead
12
+ * @deprecated Will be moved to params use BasicCard instead
13
13
  */
14
14
  Partner = "partner",
15
- /**
16
- * @deprecated Will be removed
17
- */
18
15
  PriceDetailed = "price-detailed",
19
16
  MediaCard = "media-card",
20
17
  BannerCard = "banner-card",
21
18
  /**
22
- * @deprecated Will be removed, use BasicCard instead
19
+ * @deprecated Will be moved to params use BasicCard instead
23
20
  */
24
21
  TutorialCard = "tutoral-card",
22
+ /**
23
+ * @deprecated Use LayoutItem
24
+ */
25
+ CardWithImage = "card-with-image",
25
26
  LayoutItem = "layout-item",
26
27
  BackgroundCard = "background-card",
27
28
  BasicCard = "basic-card",
28
29
  Content = "content",
29
30
  HubspotForm = "hubspot-form",
30
31
  /**
31
- * @deprecated Will be removed, use BasicCard instead
32
+ * @deprecated Will be moved to params use BasicCard instead
32
33
  */
33
34
  Card = "card"
34
35
  }
@@ -118,6 +119,18 @@ export interface BannerCardProps {
118
119
  }
119
120
  export interface MediaCardProps extends MediaProps, CardBaseProps {
120
121
  }
122
+ export interface CardWithImageLinkProps extends Omit<LinkProps, 'text' | 'url'> {
123
+ title: string;
124
+ link: string;
125
+ }
126
+ export interface CardWithImageProps extends ClassNameProps, Pick<ContentBlockProps, 'title' | 'additionalInfo' | 'buttons' | 'theme'> {
127
+ image: string;
128
+ description?: string;
129
+ disableCompress?: boolean;
130
+ border?: boolean;
131
+ fullScreen?: boolean;
132
+ links?: CardWithImageLinkProps[];
133
+ }
121
134
  export interface LayoutItemProps extends ClassNameProps {
122
135
  content: Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size'>;
123
136
  media: MediaProps;
@@ -134,8 +147,11 @@ export type QuoteModel = {
134
147
  export type NewsCardModel = {
135
148
  type: SubBlockType.NewsCard;
136
149
  } & NewsCardProps;
150
+ export type CardWithImageModel = {
151
+ type: SubBlockType.CardWithImage;
152
+ } & CardWithImageProps;
137
153
  export type LayoutItemModel = {
138
- type: SubBlockType.LayoutItem;
154
+ type: SubBlockType.CardWithImage;
139
155
  } & LayoutItemProps;
140
156
  export type TutorialCardModel = {
141
157
  type: SubBlockType.TutorialCard;
@@ -161,5 +177,5 @@ export type BannerCardModel = {
161
177
  export type BasicCardModel = {
162
178
  type: SubBlockType.BasicCard;
163
179
  } & BasicCardProps;
164
- export type SubBlockModels = DividerModel | QuoteModel | NewsCardModel | PartnerModel | PriceDetailedModel | MediaCardModel | TutorialCardModel | BackgroundCardModel | HubspotFormModel | BannerCardModel | BasicCardModel | LayoutItemModel;
180
+ export type SubBlockModels = DividerModel | QuoteModel | NewsCardModel | PartnerModel | PriceDetailedModel | MediaCardModel | TutorialCardModel | CardWithImageModel | BackgroundCardModel | HubspotFormModel | BannerCardModel | BasicCardModel;
165
181
  export type SubBlock = SubBlockModels;
@@ -4,26 +4,27 @@ export var SubBlockType;
4
4
  SubBlockType["Quote"] = "quote";
5
5
  SubBlockType["NewsCard"] = "news-card";
6
6
  /**
7
- * @deprecated Will be removed, use BasicCard instead
7
+ * @deprecated Will be moved to params use BasicCard instead
8
8
  */
9
9
  SubBlockType["Partner"] = "partner";
10
- /**
11
- * @deprecated Will be removed
12
- */
13
10
  SubBlockType["PriceDetailed"] = "price-detailed";
14
11
  SubBlockType["MediaCard"] = "media-card";
15
12
  SubBlockType["BannerCard"] = "banner-card";
16
13
  /**
17
- * @deprecated Will be removed, use BasicCard instead
14
+ * @deprecated Will be moved to params use BasicCard instead
18
15
  */
19
16
  SubBlockType["TutorialCard"] = "tutoral-card";
17
+ /**
18
+ * @deprecated Use LayoutItem
19
+ */
20
+ SubBlockType["CardWithImage"] = "card-with-image";
20
21
  SubBlockType["LayoutItem"] = "layout-item";
21
22
  SubBlockType["BackgroundCard"] = "background-card";
22
23
  SubBlockType["BasicCard"] = "basic-card";
23
24
  SubBlockType["Content"] = "content";
24
25
  SubBlockType["HubspotForm"] = "hubspot-form";
25
26
  /**
26
- * @deprecated Will be removed, use BasicCard instead
27
+ * @deprecated Will be moved to params use BasicCard instead
27
28
  */
28
29
  SubBlockType["Card"] = "card";
29
30
  })(SubBlockType || (SubBlockType = {}));
@@ -1,6 +1,6 @@
1
1
  export { validators } from './validators';
2
- import { TabsBlock, BannerCard, SliderBlock, ExtendedFeaturesBlock, HeaderBlock, BannerBlock, CompaniesBlock, MediaBlock, InfoBlock, QuestionsBlock, SecurityBlock, TableBlock, LinkTableBlock, PromoFeaturesBlock, ContentLayoutBlock, HeaderSliderBlock, IconsBlock, CardLayoutBlock, ShareBlock, MapBlock, } from './validators/blocks';
3
- import { PartnerBlock, MediaCardBlock, TutorialCard, BackgroundCard, NewsCard, PriceDetailedBlock, Quote, Divider, BasicCard, } from './validators/sub-blocks';
2
+ import { TabsBlock, BannerCard, SliderBlock, ExtendedFeaturesBlock, HeaderBlock, BannerBlock, CompaniesBlock, MediaBlock, InfoBlock, QuestionsBlock, SecurityBlock, TableBlock, SimpleBlock, LinkTableBlock, PromoFeaturesBlock, PreviewBlock, ContentLayoutBlock, HeaderSliderBlock, IconsBlock, CardLayoutBlock, ShareBlock, MapBlock, } from './validators/blocks';
3
+ import { PartnerBlock, MediaCardBlock, TutorialCard, BackgroundCard, NewsCard, CardWithImage, PriceDetailedBlock, Quote, Divider, BasicCard, } from './validators/sub-blocks';
4
4
  import { AnimatableProps, BackgroundProps, MenuProps, withTheme } from './validators/common';
5
5
  import { filteredItem } from './validators/utils';
6
6
  import { LogoProps, NavigationHeaderProps } from './validators/navigation';
@@ -9,8 +9,8 @@ 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({}, Divider), ExtendedFeaturesBlock), PromoFeaturesBlock), SliderBlock), QuestionsBlock), HeaderBlock), BannerBlock), CompaniesBlock), MediaBlock), MapBlock), InfoBlock), SecurityBlock), TableBlock), TabsBlock), LinkTableBlock), HeaderSliderBlock), IconsBlock), CardLayoutBlock), ContentLayoutBlock), ShareBlock);
13
- const cardValidators = 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), Quote), BasicCard);
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), SecurityBlock), TableBlock), TabsBlock), SimpleBlock), LinkTableBlock), PreviewBlock), HeaderSliderBlock), IconsBlock), CardLayoutBlock), ContentLayoutBlock), ShareBlock);
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',
16
16
  'quote',
@@ -29,6 +29,7 @@ export function generateDefaultSchema(config) {
29
29
  'security-block',
30
30
  'table-block',
31
31
  'tabs-block',
32
+ 'simple-block',
32
33
  'link-table-block',
33
34
  'preview-block',
34
35
  'price-detailed',
@@ -47,6 +48,7 @@ export function generateDefaultSchema(config) {
47
48
  'tutoral-card',
48
49
  'background-card',
49
50
  'news-card',
51
+ 'card-with-image',
50
52
  'quote',
51
53
  'basic-card',
52
54
  'layout-item',
@@ -2,6 +2,7 @@ export * from '../../blocks/Banner/schema';
2
2
  export * from '../../blocks/Companies/schema';
3
3
  export * from '../../blocks/ExtendedFeatures/schema';
4
4
  export * from '../../blocks/PromoFeaturesBlock/schema';
5
+ export * from '../../blocks/Simple/schema';
5
6
  export * from '../../blocks/Header/schema';
6
7
  export * from '../../blocks/Info/schema';
7
8
  export * from '../../blocks/Media/schema';
@@ -12,6 +13,7 @@ export * from '../../blocks/Slider/schema';
12
13
  export * from '../../blocks/Table/schema';
13
14
  export * from '../../blocks/LinkTable/schema';
14
15
  export * from '../../blocks/Tabs/schema';
16
+ export * from '../../blocks/Preview/schema';
15
17
  export * from '../../blocks/HeaderSlider/schema';
16
18
  export * from '../../blocks/Icons/schema';
17
19
  export * from '../../blocks/CardLayout/schema';
@@ -2,6 +2,7 @@ export * from '../../blocks/Banner/schema';
2
2
  export * from '../../blocks/Companies/schema';
3
3
  export * from '../../blocks/ExtendedFeatures/schema';
4
4
  export * from '../../blocks/PromoFeaturesBlock/schema';
5
+ export * from '../../blocks/Simple/schema';
5
6
  export * from '../../blocks/Header/schema';
6
7
  export * from '../../blocks/Info/schema';
7
8
  export * from '../../blocks/Media/schema';
@@ -12,6 +13,7 @@ export * from '../../blocks/Slider/schema';
12
13
  export * from '../../blocks/Table/schema';
13
14
  export * from '../../blocks/LinkTable/schema';
14
15
  export * from '../../blocks/Tabs/schema';
16
+ export * from '../../blocks/Preview/schema';
15
17
  export * from '../../blocks/HeaderSlider/schema';
16
18
  export * from '../../blocks/Icons/schema';
17
19
  export * from '../../blocks/CardLayout/schema';
@@ -5,6 +5,7 @@ export * from '../../sub-blocks/MediaCard/schema';
5
5
  export * from '../../sub-blocks/NewsCard/schema';
6
6
  export * from '../../sub-blocks/Partner/schema';
7
7
  export * from '../../sub-blocks/TutorialCard/schema';
8
+ export * from '../../sub-blocks/CardWithImage/schema';
8
9
  export * from '../../sub-blocks/LayoutItem/schema';
9
10
  export * from '../../sub-blocks/Quote/schema';
10
11
  export * from '../../sub-blocks/Divider/schema';
@@ -5,6 +5,7 @@ export * from '../../sub-blocks/MediaCard/schema';
5
5
  export * from '../../sub-blocks/NewsCard/schema';
6
6
  export * from '../../sub-blocks/Partner/schema';
7
7
  export * from '../../sub-blocks/TutorialCard/schema';
8
+ export * from '../../sub-blocks/CardWithImage/schema';
8
9
  export * from '../../sub-blocks/LayoutItem/schema';
9
10
  export * from '../../sub-blocks/Quote/schema';
10
11
  export * from '../../sub-blocks/Divider/schema';
@@ -0,0 +1,19 @@
1
+ /* use this for style redefinitions to awoid problems with
2
+ unpredictable css rules order in build */
3
+ .pc-card-with-image__content {
4
+ padding-right: 16px;
5
+ }
6
+ .pc-card-with-image__image {
7
+ width: 100%;
8
+ display: block;
9
+ margin-bottom: 16px;
10
+ border-radius: var(--pc-border-radius);
11
+ }
12
+ .pc-card-with-image__image_border {
13
+ border: 1px solid var(--yc-color-line-generic);
14
+ }
15
+ .pc-card-with-image__image-item {
16
+ width: 100%;
17
+ display: block;
18
+ border-radius: var(--pc-border-radius);
19
+ }
@@ -0,0 +1,4 @@
1
+ import { CardWithImageProps } from '../../models';
2
+ import './CardWithImage.css';
3
+ declare const CardWithImage: ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, }: CardWithImageProps) => JSX.Element;
4
+ export default CardWithImage;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { block } from '../../utils';
3
+ import { Image, FullscreenImage } from '../../components';
4
+ import { Content } from '../';
5
+ import './CardWithImage.css';
6
+ const b = block('card-with-image');
7
+ const CardWithImage = ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, }) => {
8
+ const unifiedLinks = links === null || links === void 0 ? void 0 : links.map((link) => (Object.assign(Object.assign({ theme: 'normal' }, link), { text: link.title, url: link.link })));
9
+ return (React.createElement("div", { className: b(null, className) },
10
+ React.createElement("div", { className: b('image', { border }) }, fullScreen ? (React.createElement(FullscreenImage, { src: image, imageClassName: b('image-item'), disableCompress: disableCompress })) : (React.createElement(Image, { className: b('image-item'), src: image, alt: 'card-image', disableCompress: disableCompress }))),
11
+ React.createElement("div", { className: b('content') },
12
+ React.createElement(Content, { title: title, text: description, links: unifiedLinks, additionalInfo: additionalInfo, buttons: buttons, size: "s", colSizes: { all: 12, md: 12 } }))));
13
+ };
14
+ export default CardWithImage;