@gravity-ui/page-constructor 2.18.0 → 3.0.0-alpha.1
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.
- package/build/cjs/blocks/index.d.ts +0 -4
- package/build/cjs/blocks/index.js +1 -9
- package/build/cjs/blocks/validators.d.ts +0 -4
- package/build/cjs/blocks/validators.js +0 -4
- package/build/cjs/components/index.d.ts +0 -1
- package/build/cjs/components/index.js +1 -3
- package/build/cjs/constructor-items.d.ts +0 -16
- package/build/cjs/constructor-items.js +0 -16
- package/build/cjs/hooks/index.d.ts +1 -1
- package/build/cjs/hooks/index.js +3 -3
- package/build/cjs/models/constructor-items/blocks.d.ts +2 -50
- package/build/cjs/models/constructor-items/blocks.js +0 -4
- package/build/cjs/models/constructor-items/common.d.ts +0 -14
- package/build/cjs/models/constructor-items/common.js +1 -6
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +5 -46
- package/build/cjs/models/constructor-items/sub-blocks.js +2 -11
- package/build/cjs/schema/index.js +2 -8
- package/build/cjs/schema/validators/blocks.d.ts +0 -4
- package/build/cjs/schema/validators/blocks.js +0 -4
- package/build/cjs/schema/validators/sub-blocks.d.ts +0 -3
- package/build/cjs/schema/validators/sub-blocks.js +0 -3
- package/build/cjs/sub-blocks/index.d.ts +0 -3
- package/build/cjs/sub-blocks/index.js +1 -7
- package/build/cjs/text-transform/{blocks.d.ts → common.d.ts} +1 -4
- package/build/cjs/text-transform/common.js +31 -0
- package/build/cjs/text-transform/config.d.ts +28 -0
- package/build/cjs/text-transform/config.js +291 -0
- package/build/cjs/text-transform/index.d.ts +3 -1
- package/build/cjs/text-transform/index.js +3 -1
- package/build/cjs/text-transform/transformers.d.ts +16 -0
- package/build/cjs/text-transform/transformers.js +61 -0
- package/build/cjs/utils/index.d.ts +0 -1
- package/build/cjs/utils/index.js +0 -1
- package/build/esm/blocks/index.d.ts +0 -4
- package/build/esm/blocks/index.js +0 -4
- package/build/esm/blocks/validators.d.ts +0 -4
- package/build/esm/blocks/validators.js +0 -4
- package/build/esm/components/index.d.ts +0 -1
- package/build/esm/components/index.js +0 -1
- package/build/esm/constructor-items.d.ts +0 -16
- package/build/esm/constructor-items.js +2 -18
- package/build/esm/hooks/index.d.ts +1 -1
- package/build/esm/hooks/index.js +1 -1
- package/build/esm/models/constructor-items/blocks.d.ts +2 -50
- package/build/esm/models/constructor-items/blocks.js +0 -4
- package/build/esm/models/constructor-items/common.d.ts +0 -14
- package/build/esm/models/constructor-items/common.js +0 -5
- package/build/esm/models/constructor-items/sub-blocks.d.ts +5 -46
- package/build/esm/models/constructor-items/sub-blocks.js +2 -11
- package/build/esm/schema/index.js +4 -10
- package/build/esm/schema/validators/blocks.d.ts +0 -4
- package/build/esm/schema/validators/blocks.js +0 -4
- package/build/esm/schema/validators/sub-blocks.d.ts +0 -3
- package/build/esm/schema/validators/sub-blocks.js +0 -3
- package/build/esm/sub-blocks/index.d.ts +0 -3
- package/build/esm/sub-blocks/index.js +0 -3
- package/build/esm/text-transform/{blocks.d.ts → common.d.ts} +1 -4
- package/build/esm/text-transform/common.js +25 -0
- package/build/esm/text-transform/config.d.ts +28 -0
- package/build/esm/text-transform/{blocks.js → config.js} +15 -123
- package/build/esm/text-transform/index.d.ts +3 -1
- package/build/esm/text-transform/index.js +3 -1
- package/build/esm/text-transform/transformers.d.ts +16 -0
- package/build/esm/text-transform/transformers.js +56 -0
- package/build/esm/utils/index.d.ts +0 -1
- package/build/esm/utils/index.js +0 -1
- package/package.json +4 -1
- package/server/models/constructor-items/blocks.d.ts +2 -50
- package/server/models/constructor-items/blocks.js +0 -4
- package/server/models/constructor-items/common.d.ts +0 -14
- package/server/models/constructor-items/common.js +1 -6
- package/server/models/constructor-items/sub-blocks.d.ts +5 -46
- package/server/models/constructor-items/sub-blocks.js +2 -11
- package/server/text-transform/{blocks.d.ts → common.d.ts} +1 -4
- package/server/text-transform/common.js +31 -0
- package/server/text-transform/config.d.ts +28 -0
- package/server/text-transform/config.js +301 -0
- package/server/text-transform/index.d.ts +3 -1
- package/server/text-transform/index.js +3 -1
- package/server/text-transform/transformers.d.ts +16 -0
- package/server/text-transform/transformers.js +63 -0
- package/server/utils/index.d.ts +0 -1
- package/server/utils/index.js +0 -1
- package/build/cjs/blocks/LinkTable/LinkTable.css +0 -3
- package/build/cjs/blocks/LinkTable/LinkTable.d.ts +0 -3
- package/build/cjs/blocks/LinkTable/LinkTable.js +0 -22
- package/build/cjs/blocks/LinkTable/schema.d.ts +0 -77
- package/build/cjs/blocks/LinkTable/schema.js +0 -15
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.css +0 -50
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.d.ts +0 -13
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.js +0 -49
- package/build/cjs/blocks/Preview/MediaContent/PreviewContent.css +0 -106
- package/build/cjs/blocks/Preview/MediaContent/PreviewContent.d.ts +0 -11
- package/build/cjs/blocks/Preview/MediaContent/PreviewContent.js +0 -17
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.css +0 -54
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.d.ts +0 -9
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.js +0 -13
- package/build/cjs/blocks/Preview/Preview.css +0 -50
- package/build/cjs/blocks/Preview/Preview.d.ts +0 -3
- package/build/cjs/blocks/Preview/Preview.js +0 -130
- package/build/cjs/blocks/Preview/schema.d.ts +0 -40
- package/build/cjs/blocks/Preview/schema.js +0 -53
- package/build/cjs/blocks/Security/Security.css +0 -142
- package/build/cjs/blocks/Security/Security.d.ts +0 -3
- package/build/cjs/blocks/Security/Security.js +0 -29
- package/build/cjs/blocks/Security/schema.d.ts +0 -170
- package/build/cjs/blocks/Security/schema.js +0 -32
- package/build/cjs/blocks/Simple/Simple.css +0 -22
- package/build/cjs/blocks/Simple/Simple.d.ts +0 -3
- package/build/cjs/blocks/Simple/Simple.js +0 -22
- package/build/cjs/blocks/Simple/schema.d.ts +0 -68
- package/build/cjs/blocks/Simple/schema.js +0 -14
- package/build/cjs/components/HeightCalculator/HeightCalculator.css +0 -9
- package/build/cjs/components/HeightCalculator/HeightCalculator.d.ts +0 -10
- package/build/cjs/components/HeightCalculator/HeightCalculator.js +0 -44
- package/build/cjs/context/breakpointContext/breakpointContext.d.ts +0 -2
- package/build/cjs/context/breakpointContext/breakpointContext.js +0 -7
- package/build/cjs/context/breakpointContext/index.d.ts +0 -1
- package/build/cjs/context/breakpointContext/index.js +0 -4
- package/build/cjs/hooks/useIntersection.d.ts +0 -1
- package/build/cjs/hooks/useIntersection.js +0 -21
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.css +0 -19
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.d.ts +0 -3
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.js +0 -16
- package/build/cjs/sub-blocks/CardWithImage/schema.d.ts +0 -154
- package/build/cjs/sub-blocks/CardWithImage/schema.js +0 -46
- package/build/cjs/sub-blocks/Partner/Partner.css +0 -8
- package/build/cjs/sub-blocks/Partner/Partner.d.ts +0 -3
- package/build/cjs/sub-blocks/Partner/Partner.js +0 -15
- package/build/cjs/sub-blocks/Partner/schema.d.ts +0 -30
- package/build/cjs/sub-blocks/Partner/schema.js +0 -17
- package/build/cjs/sub-blocks/TutorialCard/TutorialCard.css +0 -20
- package/build/cjs/sub-blocks/TutorialCard/TutorialCard.d.ts +0 -3
- package/build/cjs/sub-blocks/TutorialCard/TutorialCard.js +0 -23
- package/build/cjs/sub-blocks/TutorialCard/schema.d.ts +0 -34
- package/build/cjs/sub-blocks/TutorialCard/schema.js +0 -20
- package/build/cjs/text-transform/blocks.js +0 -404
- package/build/cjs/utils/scroll.d.ts +0 -15
- package/build/cjs/utils/scroll.js +0 -35
- package/build/esm/blocks/LinkTable/LinkTable.css +0 -3
- package/build/esm/blocks/LinkTable/LinkTable.d.ts +0 -4
- package/build/esm/blocks/LinkTable/LinkTable.js +0 -21
- package/build/esm/blocks/LinkTable/schema.d.ts +0 -77
- package/build/esm/blocks/LinkTable/schema.js +0 -12
- package/build/esm/blocks/Preview/MediaContent/MediaContent.css +0 -50
- package/build/esm/blocks/Preview/MediaContent/MediaContent.d.ts +0 -14
- package/build/esm/blocks/Preview/MediaContent/MediaContent.js +0 -47
- package/build/esm/blocks/Preview/MediaContent/PreviewContent.css +0 -106
- package/build/esm/blocks/Preview/MediaContent/PreviewContent.d.ts +0 -12
- package/build/esm/blocks/Preview/MediaContent/PreviewContent.js +0 -15
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.css +0 -54
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.d.ts +0 -10
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.js +0 -11
- package/build/esm/blocks/Preview/Preview.css +0 -50
- package/build/esm/blocks/Preview/Preview.d.ts +0 -4
- package/build/esm/blocks/Preview/Preview.js +0 -126
- package/build/esm/blocks/Preview/schema.d.ts +0 -40
- package/build/esm/blocks/Preview/schema.js +0 -50
- package/build/esm/blocks/Security/Security.css +0 -142
- package/build/esm/blocks/Security/Security.d.ts +0 -4
- package/build/esm/blocks/Security/Security.js +0 -25
- package/build/esm/blocks/Security/schema.d.ts +0 -170
- package/build/esm/blocks/Security/schema.js +0 -28
- package/build/esm/blocks/Simple/Simple.css +0 -22
- package/build/esm/blocks/Simple/Simple.d.ts +0 -4
- package/build/esm/blocks/Simple/Simple.js +0 -18
- package/build/esm/blocks/Simple/schema.d.ts +0 -68
- package/build/esm/blocks/Simple/schema.js +0 -11
- package/build/esm/components/HeightCalculator/HeightCalculator.css +0 -9
- package/build/esm/components/HeightCalculator/HeightCalculator.d.ts +0 -11
- package/build/esm/components/HeightCalculator/HeightCalculator.js +0 -42
- package/build/esm/context/breakpointContext/breakpointContext.d.ts +0 -2
- package/build/esm/context/breakpointContext/breakpointContext.js +0 -3
- package/build/esm/context/breakpointContext/index.d.ts +0 -1
- package/build/esm/context/breakpointContext/index.js +0 -1
- package/build/esm/hooks/useIntersection.d.ts +0 -1
- package/build/esm/hooks/useIntersection.js +0 -17
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.css +0 -19
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.d.ts +0 -4
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.js +0 -14
- package/build/esm/sub-blocks/CardWithImage/schema.d.ts +0 -154
- package/build/esm/sub-blocks/CardWithImage/schema.js +0 -43
- package/build/esm/sub-blocks/Partner/Partner.css +0 -8
- package/build/esm/sub-blocks/Partner/Partner.d.ts +0 -4
- package/build/esm/sub-blocks/Partner/Partner.js +0 -13
- package/build/esm/sub-blocks/Partner/schema.d.ts +0 -30
- package/build/esm/sub-blocks/Partner/schema.js +0 -14
- package/build/esm/sub-blocks/TutorialCard/TutorialCard.css +0 -20
- package/build/esm/sub-blocks/TutorialCard/TutorialCard.d.ts +0 -4
- package/build/esm/sub-blocks/TutorialCard/TutorialCard.js +0 -21
- package/build/esm/sub-blocks/TutorialCard/schema.d.ts +0 -34
- package/build/esm/sub-blocks/TutorialCard/schema.js +0 -17
- package/build/esm/utils/scroll.d.ts +0 -15
- package/build/esm/utils/scroll.js +0 -31
- package/server/text-transform/blocks.js +0 -417
- package/server/utils/scroll.d.ts +0 -15
- package/server/utils/scroll.js +0 -35
|
@@ -1,18 +1,14 @@
|
|
|
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;
|
|
4
3
|
"extended-features-block": ({ title, description, items, colSizes, animated, }: import("./models").ExtendedFeaturesProps) => JSX.Element;
|
|
5
4
|
"promo-features-block": (props: import("./models").PromoFeaturesProps) => JSX.Element;
|
|
6
5
|
"questions-block": (props: import("./models").QuestionsProps) => JSX.Element;
|
|
7
6
|
"banner-block": (props: import("./models").BannerBlockProps) => JSX.Element;
|
|
8
7
|
"companies-block": ({ title, images, animated }: import("./models").CompaniesBlockProps) => JSX.Element;
|
|
9
8
|
"media-block": (props: import("./models").MediaBlockProps) => JSX.Element;
|
|
10
|
-
"preview-block": (props: import("./models").PreviewBlockProps) => JSX.Element;
|
|
11
9
|
"info-block": (props: import("./models").InfoBlockProps) => JSX.Element;
|
|
12
|
-
"security-block": (props: import("./models").SecurityBlockProps) => JSX.Element;
|
|
13
10
|
"table-block": (props: import("./models").TableBlockProps) => JSX.Element;
|
|
14
11
|
"tabs-block": ({ items, title, description, animated, tabsColSizes, centered, direction, }: import("./models").TabsBlockProps) => JSX.Element;
|
|
15
|
-
"link-table-block": ({ items, title, description, linkTheme }: import("./models").LinkTableBlockProps) => JSX.Element;
|
|
16
12
|
"header-block": (props: import("./models").WithChildren<import("./models").HeaderBlockProps & import("./models").ClassNameProps>) => JSX.Element;
|
|
17
13
|
"icons-block": ({ title, size, items }: import("./models").IconsBlockProps) => JSX.Element;
|
|
18
14
|
"header-slider-block": ({ items, arrows, ...props }: import("./models").HeaderSliderBlockProps) => JSX.Element;
|
|
@@ -24,23 +20,11 @@ export declare const blockMap: {
|
|
|
24
20
|
};
|
|
25
21
|
export declare const subBlockMap: {
|
|
26
22
|
divider: ({ size, border }: import("./models").DividerProps) => JSX.Element;
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated Will be removed, use basic card instead
|
|
29
|
-
*/
|
|
30
|
-
"tutoral-card": (props: import("./models").TutorialCardProps) => JSX.Element;
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated Will be removed, use basic card instead
|
|
33
|
-
*/
|
|
34
|
-
partner: ({ text, logo, url, border }: import("./models").PartnerProps) => JSX.Element;
|
|
35
23
|
"price-detailed": (props: import("./models").PriceDetailedProps) => JSX.Element;
|
|
36
24
|
"media-card": ({ border, ...mediaProps }: import("./models").MediaCardProps) => JSX.Element;
|
|
37
25
|
"banner-card": (props: import("./models").BannerCardProps) => JSX.Element;
|
|
38
26
|
"news-card": (props: import("./models").NewsCardProps) => JSX.Element;
|
|
39
27
|
"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;
|
|
44
28
|
"background-card": (props: import("./models").BackgroundCardProps) => JSX.Element;
|
|
45
29
|
"basic-card": (props: import("./models").BasicCardProps) => JSX.Element;
|
|
46
30
|
content: (props: import("./models").ContentBlockProps & import("./models").ClassNameProps) => JSX.Element;
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import { BannerBlock, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, HeaderBlock, HeaderSliderBlock, IconsBlock, InfoBlock,
|
|
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, SubBlockType } from './models';
|
|
3
|
-
import { BackgroundCard, BannerCard, BasicCard,
|
|
3
|
+
import { BackgroundCard, BannerCard, BasicCard, Content, Divider, LayoutItem, MediaCard, NewsCard, PriceDetailed, Quote, } from './sub-blocks';
|
|
4
4
|
export const blockMap = {
|
|
5
5
|
[BlockType.SliderBlock]: SliderBlock,
|
|
6
|
-
[BlockType.SimpleBlock]: SimpleBlock,
|
|
7
6
|
[BlockType.ExtendedFeaturesBlock]: ExtendedFeaturesBlock,
|
|
8
7
|
[BlockType.PromoFeaturesBlock]: PromoFeaturesBlock,
|
|
9
8
|
[BlockType.QuestionsBlock]: QuestionsBlock,
|
|
10
9
|
[BlockType.BannerBlock]: BannerBlock,
|
|
11
10
|
[BlockType.CompaniesBlock]: CompaniesBlock,
|
|
12
11
|
[BlockType.MediaBlock]: MediaBlock,
|
|
13
|
-
[BlockType.PreviewBlock]: PreviewBlock,
|
|
14
12
|
[BlockType.InfoBlock]: InfoBlock,
|
|
15
|
-
[BlockType.SecurityBlock]: SecurityBlock,
|
|
16
13
|
[BlockType.TableBlock]: TableBlock,
|
|
17
14
|
[BlockType.TabsBlock]: TabsBlock,
|
|
18
|
-
[BlockType.LinkTableBlock]: LinkTableBlock,
|
|
19
15
|
[BlockType.HeaderBlock]: HeaderBlock,
|
|
20
16
|
[BlockType.IconsBlock]: IconsBlock,
|
|
21
17
|
[BlockType.HeaderSliderBlock]: HeaderSliderBlock,
|
|
@@ -27,23 +23,11 @@ export const blockMap = {
|
|
|
27
23
|
};
|
|
28
24
|
export const subBlockMap = {
|
|
29
25
|
[SubBlockType.Divider]: Divider,
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated Will be removed, use basic card instead
|
|
32
|
-
*/
|
|
33
|
-
[SubBlockType.TutorialCard]: TutorialCard,
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated Will be removed, use basic card instead
|
|
36
|
-
*/
|
|
37
|
-
[SubBlockType.Partner]: Partner,
|
|
38
26
|
[SubBlockType.PriceDetailed]: PriceDetailed,
|
|
39
27
|
[SubBlockType.MediaCard]: MediaCard,
|
|
40
28
|
[SubBlockType.BannerCard]: BannerCard,
|
|
41
29
|
[SubBlockType.NewsCard]: NewsCard,
|
|
42
30
|
[SubBlockType.LayoutItem]: LayoutItem,
|
|
43
|
-
/**
|
|
44
|
-
* @deprecated Use LayoutItem
|
|
45
|
-
*/
|
|
46
|
-
[SubBlockType.CardWithImage]: CardWithImage,
|
|
47
31
|
[SubBlockType.BackgroundCard]: BackgroundCard,
|
|
48
32
|
[SubBlockType.BasicCard]: BasicCard,
|
|
49
33
|
[SubBlockType.Content]: Content,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as useFocus } from './useFocus';
|
|
2
2
|
export { default as useWindowBreakpoint } from './useWindowBreakpoint';
|
|
3
|
-
export { useIntersection } from './useIntersection';
|
|
4
3
|
export { default as useMount } from './useMount';
|
|
4
|
+
export { default as useHeightCalculator } from './useHeightCalculator';
|
|
5
5
|
export * from './useAnalytics';
|
|
6
6
|
export * from './hubspot';
|
package/build/esm/hooks/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as useFocus } from './useFocus';
|
|
2
2
|
export { default as useWindowBreakpoint } from './useWindowBreakpoint';
|
|
3
|
-
export { useIntersection } from './useIntersection';
|
|
4
3
|
export { default as useMount } from './useMount';
|
|
4
|
+
export { default as useHeightCalculator } from './useHeightCalculator';
|
|
5
5
|
export * from './useAnalytics';
|
|
6
6
|
export * from './hubspot';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ButtonSize } from '@gravity-ui/uikit';
|
|
3
3
|
import { GridColumnSize, GridColumnSizesType } from '../../grid/types';
|
|
4
4
|
import { ThemeSupporting } from '../../utils';
|
|
5
|
-
import { AnchorProps, Animatable, BackgroundImageProps, BlockHeaderProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, Justify, LegendTableMarkerType, LinkProps,
|
|
5
|
+
import { AnchorProps, Animatable, BackgroundImageProps, BlockHeaderProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleBaseProps, TitleProps } from './common';
|
|
6
6
|
import { BannerCardProps, SubBlock, SubBlockModels } from './sub-blocks';
|
|
7
7
|
export declare enum BlockType {
|
|
8
8
|
PromoFeaturesBlock = "promo-features-block",
|
|
@@ -14,14 +14,10 @@ export declare enum BlockType {
|
|
|
14
14
|
BannerBlock = "banner-block",
|
|
15
15
|
CompaniesBlock = "companies-block",
|
|
16
16
|
MediaBlock = "media-block",
|
|
17
|
-
PreviewBlock = "preview-block",
|
|
18
17
|
InfoBlock = "info-block",
|
|
19
|
-
SecurityBlock = "security-block",
|
|
20
18
|
TableBlock = "table-block",
|
|
21
19
|
TabsBlock = "tabs-block",
|
|
22
|
-
SimpleBlock = "simple-block",
|
|
23
20
|
HeaderSliderBlock = "header-slider-block",
|
|
24
|
-
LinkTableBlock = "link-table-block",
|
|
25
21
|
HeaderBlock = "header-block",
|
|
26
22
|
IconsBlock = "icons-block",
|
|
27
23
|
CardLayoutBlock = "card-layout-block",
|
|
@@ -115,10 +111,6 @@ export interface HeaderBlockProps {
|
|
|
115
111
|
status?: JSX.Element;
|
|
116
112
|
}
|
|
117
113
|
export type CalculatorProps = Animatable;
|
|
118
|
-
export interface SimpleBlockProps extends Animatable, Childable {
|
|
119
|
-
title: TitleBaseProps;
|
|
120
|
-
description: string;
|
|
121
|
-
}
|
|
122
114
|
export interface ExtendedFeaturesItem extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {
|
|
123
115
|
title: string;
|
|
124
116
|
label?: string;
|
|
@@ -181,15 +173,6 @@ export interface MediaBlockProps extends MediaBaseBlockProps {
|
|
|
181
173
|
export interface MapBlockProps extends MediaBaseBlockProps {
|
|
182
174
|
map: MapProps;
|
|
183
175
|
}
|
|
184
|
-
export interface PreviewBlockProps extends Animatable {
|
|
185
|
-
title: string;
|
|
186
|
-
items: PreviewItemProps[];
|
|
187
|
-
description?: string;
|
|
188
|
-
direction?: MediaDirection;
|
|
189
|
-
ratioMediaContent?: PreviewRatioMediaContent;
|
|
190
|
-
stopVideo?: boolean;
|
|
191
|
-
showImmediately?: boolean;
|
|
192
|
-
}
|
|
193
176
|
export interface InfoBlockProps {
|
|
194
177
|
theme?: TextTheme;
|
|
195
178
|
backgroundColor?: ThemeSupporting<string>;
|
|
@@ -204,21 +187,6 @@ export interface InfoBlockProps {
|
|
|
204
187
|
leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;
|
|
205
188
|
rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;
|
|
206
189
|
}
|
|
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
190
|
export interface TableProps {
|
|
223
191
|
content: string[][];
|
|
224
192
|
legend?: string[];
|
|
@@ -245,10 +213,6 @@ export interface TabsBlockProps extends BlockHeaderProps, Animatable {
|
|
|
245
213
|
direction?: MediaDirection;
|
|
246
214
|
items: TabsBlockItem[];
|
|
247
215
|
}
|
|
248
|
-
export interface LinkTableBlockProps extends BlockHeaderProps {
|
|
249
|
-
items: LinkProps[][];
|
|
250
|
-
linkTheme?: LinkTheme;
|
|
251
|
-
}
|
|
252
216
|
export interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {
|
|
253
217
|
title: TitleProps | string;
|
|
254
218
|
description?: string;
|
|
@@ -347,27 +311,15 @@ export type MediaBlockModel = {
|
|
|
347
311
|
export type MapBlockModel = {
|
|
348
312
|
type: BlockType.MapBlock;
|
|
349
313
|
} & MapBlockProps;
|
|
350
|
-
export type PreviewBlockModel = {
|
|
351
|
-
type: BlockType.PreviewBlock;
|
|
352
|
-
} & PreviewBlockProps;
|
|
353
314
|
export type InfoBlockModel = {
|
|
354
315
|
type: BlockType.InfoBlock;
|
|
355
316
|
} & InfoBlockProps;
|
|
356
|
-
export type SecurityBlockModel = {
|
|
357
|
-
type: BlockType.SecurityBlock;
|
|
358
|
-
} & SecurityBlockProps;
|
|
359
317
|
export type TableBlockModel = {
|
|
360
318
|
type: BlockType.TableBlock;
|
|
361
319
|
} & TableBlockProps;
|
|
362
320
|
export type TabsBlockModel = {
|
|
363
321
|
type: BlockType.TabsBlock;
|
|
364
322
|
} & TabsBlockProps;
|
|
365
|
-
export type SimpleBlockModel = {
|
|
366
|
-
type: BlockType.SimpleBlock;
|
|
367
|
-
} & SimpleBlockProps;
|
|
368
|
-
export type LinkTableBlockModel = {
|
|
369
|
-
type: BlockType.LinkTableBlock;
|
|
370
|
-
} & LinkTableBlockProps;
|
|
371
323
|
export type CardLayoutBlockModel = {
|
|
372
324
|
type: BlockType.CardLayoutBlock;
|
|
373
325
|
} & CardLayoutBlockProps;
|
|
@@ -386,6 +338,6 @@ export type ContentLayoutBlockModel = {
|
|
|
386
338
|
export type ShareBLockModel = {
|
|
387
339
|
type: BlockType.ShareBlock;
|
|
388
340
|
} & ShareBlockProps;
|
|
389
|
-
type BlockModels = SliderBlockModel | ServiceDemoBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | CalculatorBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel |
|
|
341
|
+
type BlockModels = SliderBlockModel | ServiceDemoBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | CalculatorBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel;
|
|
390
342
|
export type Block = BlockModels & BlockBaseProps;
|
|
391
343
|
export {};
|
|
@@ -9,14 +9,10 @@ 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";
|
|
13
12
|
BlockType["InfoBlock"] = "info-block";
|
|
14
|
-
BlockType["SecurityBlock"] = "security-block";
|
|
15
13
|
BlockType["TableBlock"] = "table-block";
|
|
16
14
|
BlockType["TabsBlock"] = "tabs-block";
|
|
17
|
-
BlockType["SimpleBlock"] = "simple-block";
|
|
18
15
|
BlockType["HeaderSliderBlock"] = "header-slider-block";
|
|
19
|
-
BlockType["LinkTableBlock"] = "link-table-block";
|
|
20
16
|
BlockType["HeaderBlock"] = "header-block";
|
|
21
17
|
BlockType["IconsBlock"] = "icons-block";
|
|
22
18
|
BlockType["CardLayoutBlock"] = "card-layout-block";
|
|
@@ -17,10 +17,6 @@ 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
|
-
}
|
|
24
20
|
export declare enum PlayButtonType {
|
|
25
21
|
Default = "default",
|
|
26
22
|
Text = "text"
|
|
@@ -49,7 +45,6 @@ export type LegendTableMarkerType = 'disk';
|
|
|
49
45
|
export type LinkTheme = 'file-link' | 'normal' | 'back' | 'underline';
|
|
50
46
|
export type MediaDirection = 'media-content' | 'content-media';
|
|
51
47
|
export type PriceDescriptionColor = 'cornflower' | 'black';
|
|
52
|
-
export type PreviewRatioMediaContent = '2-1' | '1-1';
|
|
53
48
|
export type ContentSize = 's' | 'l';
|
|
54
49
|
export type ContentTextSize = 's' | 'm' | 'l';
|
|
55
50
|
export type ContentTheme = 'default' | 'dark' | 'light';
|
|
@@ -254,15 +249,6 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
|
|
|
254
249
|
metrikaGoals?: MetrikaGoal;
|
|
255
250
|
pixelEvents?: ButtonPixel;
|
|
256
251
|
}
|
|
257
|
-
export interface PreviewContentItemProps {
|
|
258
|
-
title: string;
|
|
259
|
-
description?: string;
|
|
260
|
-
}
|
|
261
|
-
export interface PreviewItemProps {
|
|
262
|
-
type: PreviewItemType;
|
|
263
|
-
media: ThemedMediaProps;
|
|
264
|
-
content: PreviewContentItemProps;
|
|
265
|
-
}
|
|
266
252
|
export interface TitleProps extends Justifyable, TitleBaseProps {
|
|
267
253
|
navTitle?: string;
|
|
268
254
|
anchor?: string;
|
|
@@ -17,11 +17,6 @@ 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 = {}));
|
|
25
20
|
export var PlayButtonType;
|
|
26
21
|
(function (PlayButtonType) {
|
|
27
22
|
PlayButtonType["Default"] = "default";
|
|
@@ -3,33 +3,24 @@ import { ThemeSupporting } from '../../utils';
|
|
|
3
3
|
import { HubspotEventData, HubspotEventHandlers } from '../../utils/hubspot';
|
|
4
4
|
import { AnalyticsEventsBase, PixelEvent } from '../common';
|
|
5
5
|
import { ContentBlockProps } from './blocks';
|
|
6
|
-
import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageObjectProps, ImageProps,
|
|
6
|
+
import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageObjectProps, ImageProps, MediaProps, PriceDetailedProps, TextTheme, Themable, ThemedImage } from './common';
|
|
7
7
|
export declare enum SubBlockType {
|
|
8
8
|
Divider = "divider",
|
|
9
9
|
Quote = "quote",
|
|
10
10
|
NewsCard = "news-card",
|
|
11
11
|
/**
|
|
12
|
-
* @deprecated Will be
|
|
12
|
+
* @deprecated Will be removed
|
|
13
13
|
*/
|
|
14
|
-
Partner = "partner",
|
|
15
14
|
PriceDetailed = "price-detailed",
|
|
16
15
|
MediaCard = "media-card",
|
|
17
16
|
BannerCard = "banner-card",
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated Will be moved to params use BasicCard instead
|
|
20
|
-
*/
|
|
21
|
-
TutorialCard = "tutoral-card",
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated Use LayoutItem
|
|
24
|
-
*/
|
|
25
|
-
CardWithImage = "card-with-image",
|
|
26
17
|
LayoutItem = "layout-item",
|
|
27
18
|
BackgroundCard = "background-card",
|
|
28
19
|
BasicCard = "basic-card",
|
|
29
20
|
Content = "content",
|
|
30
21
|
HubspotForm = "hubspot-form",
|
|
31
22
|
/**
|
|
32
|
-
* @deprecated Will be
|
|
23
|
+
* @deprecated Will be removed, use BasicCard instead
|
|
33
24
|
*/
|
|
34
25
|
Card = "card"
|
|
35
26
|
}
|
|
@@ -67,11 +58,6 @@ export interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsB
|
|
|
67
58
|
hubspotEvents?: string[];
|
|
68
59
|
createDOMElement?: boolean;
|
|
69
60
|
}
|
|
70
|
-
export interface PartnerProps extends CardBaseProps {
|
|
71
|
-
text: string;
|
|
72
|
-
logo: ImageProps;
|
|
73
|
-
url: string;
|
|
74
|
-
}
|
|
75
61
|
export interface QuoteProps extends Themable, CardBaseProps {
|
|
76
62
|
text: string;
|
|
77
63
|
image: ThemedImage;
|
|
@@ -91,12 +77,6 @@ export interface NewsCardData {
|
|
|
91
77
|
isoDate?: string;
|
|
92
78
|
}
|
|
93
79
|
export type NewsCardProps = Pick<NewsCardData, 'title' | 'url' | 'date' | 'isoDate'> & CardBaseProps;
|
|
94
|
-
export interface TutorialCardProps extends CardBaseProps {
|
|
95
|
-
url: string;
|
|
96
|
-
title: string;
|
|
97
|
-
text: string;
|
|
98
|
-
icon?: ImageProps;
|
|
99
|
-
}
|
|
100
80
|
export interface BackgroundCardProps extends CardBaseProps, Omit<ContentBlockProps, 'colSizes' | 'centered'> {
|
|
101
81
|
url?: string;
|
|
102
82
|
background?: ThemeSupporting<ImageObjectProps>;
|
|
@@ -119,18 +99,6 @@ export interface BannerCardProps {
|
|
|
119
99
|
}
|
|
120
100
|
export interface MediaCardProps extends MediaProps, CardBaseProps {
|
|
121
101
|
}
|
|
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
|
-
}
|
|
134
102
|
export interface LayoutItemProps extends ClassNameProps {
|
|
135
103
|
content: Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size'>;
|
|
136
104
|
media: MediaProps;
|
|
@@ -147,21 +115,12 @@ export type QuoteModel = {
|
|
|
147
115
|
export type NewsCardModel = {
|
|
148
116
|
type: SubBlockType.NewsCard;
|
|
149
117
|
} & NewsCardProps;
|
|
150
|
-
export type CardWithImageModel = {
|
|
151
|
-
type: SubBlockType.CardWithImage;
|
|
152
|
-
} & CardWithImageProps;
|
|
153
118
|
export type LayoutItemModel = {
|
|
154
|
-
type: SubBlockType.
|
|
119
|
+
type: SubBlockType.LayoutItem;
|
|
155
120
|
} & LayoutItemProps;
|
|
156
|
-
export type TutorialCardModel = {
|
|
157
|
-
type: SubBlockType.TutorialCard;
|
|
158
|
-
} & TutorialCardProps;
|
|
159
121
|
export type BackgroundCardModel = {
|
|
160
122
|
type: SubBlockType.BackgroundCard;
|
|
161
123
|
} & BackgroundCardProps;
|
|
162
|
-
export type PartnerModel = {
|
|
163
|
-
type: SubBlockType.Partner;
|
|
164
|
-
} & PartnerProps;
|
|
165
124
|
export type PriceDetailedModel = {
|
|
166
125
|
type: SubBlockType.PriceDetailed;
|
|
167
126
|
} & PriceDetailedProps;
|
|
@@ -177,5 +136,5 @@ export type BannerCardModel = {
|
|
|
177
136
|
export type BasicCardModel = {
|
|
178
137
|
type: SubBlockType.BasicCard;
|
|
179
138
|
} & BasicCardProps;
|
|
180
|
-
export type SubBlockModels = DividerModel | QuoteModel | NewsCardModel |
|
|
139
|
+
export type SubBlockModels = DividerModel | QuoteModel | NewsCardModel | PriceDetailedModel | MediaCardModel | BackgroundCardModel | HubspotFormModel | BannerCardModel | BasicCardModel | LayoutItemModel;
|
|
181
140
|
export type SubBlock = SubBlockModels;
|
|
@@ -4,27 +4,18 @@ export var SubBlockType;
|
|
|
4
4
|
SubBlockType["Quote"] = "quote";
|
|
5
5
|
SubBlockType["NewsCard"] = "news-card";
|
|
6
6
|
/**
|
|
7
|
-
* @deprecated Will be
|
|
7
|
+
* @deprecated Will be removed
|
|
8
8
|
*/
|
|
9
|
-
SubBlockType["Partner"] = "partner";
|
|
10
9
|
SubBlockType["PriceDetailed"] = "price-detailed";
|
|
11
10
|
SubBlockType["MediaCard"] = "media-card";
|
|
12
11
|
SubBlockType["BannerCard"] = "banner-card";
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Will be moved to params use BasicCard instead
|
|
15
|
-
*/
|
|
16
|
-
SubBlockType["TutorialCard"] = "tutoral-card";
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Use LayoutItem
|
|
19
|
-
*/
|
|
20
|
-
SubBlockType["CardWithImage"] = "card-with-image";
|
|
21
12
|
SubBlockType["LayoutItem"] = "layout-item";
|
|
22
13
|
SubBlockType["BackgroundCard"] = "background-card";
|
|
23
14
|
SubBlockType["BasicCard"] = "basic-card";
|
|
24
15
|
SubBlockType["Content"] = "content";
|
|
25
16
|
SubBlockType["HubspotForm"] = "hubspot-form";
|
|
26
17
|
/**
|
|
27
|
-
* @deprecated Will be
|
|
18
|
+
* @deprecated Will be removed, use BasicCard instead
|
|
28
19
|
*/
|
|
29
20
|
SubBlockType["Card"] = "card";
|
|
30
21
|
})(SubBlockType || (SubBlockType = {}));
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export { validators } from './validators';
|
|
2
|
-
import { BannerBlock, BannerCard, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, HeaderBlock, HeaderSliderBlock, IconsBlock, InfoBlock,
|
|
2
|
+
import { BannerBlock, BannerCard, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, HeaderBlock, HeaderSliderBlock, IconsBlock, InfoBlock, MapBlock, MediaBlock, PromoFeaturesBlock, QuestionsBlock, ShareBlock, 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
|
-
import { BackgroundCard, BasicCard,
|
|
5
|
+
import { BackgroundCard, BasicCard, Divider, MediaCardBlock, NewsCard, PriceDetailedBlock, Quote, } from './validators/sub-blocks';
|
|
6
6
|
import { filteredItem } from './validators/utils';
|
|
7
7
|
export const getBlocksCases = (blocks) => {
|
|
8
8
|
return Object.values(blocks).reduce((acc, block) => (Object.assign(Object.assign({}, acc), block)));
|
|
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(
|
|
13
|
-
const cardValidators = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(
|
|
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({}, Divider), ExtendedFeaturesBlock), PromoFeaturesBlock), SliderBlock), QuestionsBlock), HeaderBlock), BannerBlock), CompaniesBlock), MediaBlock), MapBlock), InfoBlock), TableBlock), TabsBlock), HeaderSliderBlock), IconsBlock), CardLayoutBlock), ContentLayoutBlock), ShareBlock), FilterBlock);
|
|
13
|
+
const cardValidators = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, MediaCardBlock), BannerCard), PriceDetailedBlock), BackgroundCard), NewsCard), Quote), BasicCard);
|
|
14
14
|
const constructorBlockSchemaNames = [
|
|
15
15
|
'divider',
|
|
16
16
|
'quote',
|
|
@@ -26,11 +26,8 @@ export function generateDefaultSchema(config) {
|
|
|
26
26
|
'media-block',
|
|
27
27
|
'map-block',
|
|
28
28
|
'info-block',
|
|
29
|
-
'security-block',
|
|
30
29
|
'table-block',
|
|
31
30
|
'tabs-block',
|
|
32
|
-
'simple-block',
|
|
33
|
-
'link-table-block',
|
|
34
31
|
'preview-block',
|
|
35
32
|
'price-detailed',
|
|
36
33
|
'header-slider-block',
|
|
@@ -42,14 +39,11 @@ export function generateDefaultSchema(config) {
|
|
|
42
39
|
'filter-block',
|
|
43
40
|
];
|
|
44
41
|
const constructorCardSchemaNames = [
|
|
45
|
-
'partner',
|
|
46
42
|
'media-card',
|
|
47
43
|
'banner-card',
|
|
48
44
|
'price-detailed',
|
|
49
|
-
'tutoral-card',
|
|
50
45
|
'background-card',
|
|
51
46
|
'news-card',
|
|
52
|
-
'card-with-image',
|
|
53
47
|
'quote',
|
|
54
48
|
'basic-card',
|
|
55
49
|
'layout-item',
|
|
@@ -2,18 +2,14 @@ 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';
|
|
6
5
|
export * from '../../blocks/Header/schema';
|
|
7
6
|
export * from '../../blocks/Info/schema';
|
|
8
7
|
export * from '../../blocks/Media/schema';
|
|
9
8
|
export * from '../../blocks/Map/schema';
|
|
10
9
|
export * from '../../blocks/Questions/schema';
|
|
11
|
-
export * from '../../blocks/Security/schema';
|
|
12
10
|
export * from '../../blocks/Slider/schema';
|
|
13
11
|
export * from '../../blocks/Table/schema';
|
|
14
|
-
export * from '../../blocks/LinkTable/schema';
|
|
15
12
|
export * from '../../blocks/Tabs/schema';
|
|
16
|
-
export * from '../../blocks/Preview/schema';
|
|
17
13
|
export * from '../../blocks/HeaderSlider/schema';
|
|
18
14
|
export * from '../../blocks/Icons/schema';
|
|
19
15
|
export * from '../../blocks/CardLayout/schema';
|
|
@@ -2,18 +2,14 @@ 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';
|
|
6
5
|
export * from '../../blocks/Header/schema';
|
|
7
6
|
export * from '../../blocks/Info/schema';
|
|
8
7
|
export * from '../../blocks/Media/schema';
|
|
9
8
|
export * from '../../blocks/Map/schema';
|
|
10
9
|
export * from '../../blocks/Questions/schema';
|
|
11
|
-
export * from '../../blocks/Security/schema';
|
|
12
10
|
export * from '../../blocks/Slider/schema';
|
|
13
11
|
export * from '../../blocks/Table/schema';
|
|
14
|
-
export * from '../../blocks/LinkTable/schema';
|
|
15
12
|
export * from '../../blocks/Tabs/schema';
|
|
16
|
-
export * from '../../blocks/Preview/schema';
|
|
17
13
|
export * from '../../blocks/HeaderSlider/schema';
|
|
18
14
|
export * from '../../blocks/Icons/schema';
|
|
19
15
|
export * from '../../blocks/CardLayout/schema';
|
|
@@ -3,9 +3,6 @@ export * from '../../sub-blocks/BackgroundCard/schema';
|
|
|
3
3
|
export * from '../../sub-blocks/Content/schema';
|
|
4
4
|
export * from '../../sub-blocks/MediaCard/schema';
|
|
5
5
|
export * from '../../sub-blocks/NewsCard/schema';
|
|
6
|
-
export * from '../../sub-blocks/Partner/schema';
|
|
7
|
-
export * from '../../sub-blocks/TutorialCard/schema';
|
|
8
|
-
export * from '../../sub-blocks/CardWithImage/schema';
|
|
9
6
|
export * from '../../sub-blocks/LayoutItem/schema';
|
|
10
7
|
export * from '../../sub-blocks/Quote/schema';
|
|
11
8
|
export * from '../../sub-blocks/Divider/schema';
|
|
@@ -3,9 +3,6 @@ export * from '../../sub-blocks/BackgroundCard/schema';
|
|
|
3
3
|
export * from '../../sub-blocks/Content/schema';
|
|
4
4
|
export * from '../../sub-blocks/MediaCard/schema';
|
|
5
5
|
export * from '../../sub-blocks/NewsCard/schema';
|
|
6
|
-
export * from '../../sub-blocks/Partner/schema';
|
|
7
|
-
export * from '../../sub-blocks/TutorialCard/schema';
|
|
8
|
-
export * from '../../sub-blocks/CardWithImage/schema';
|
|
9
6
|
export * from '../../sub-blocks/LayoutItem/schema';
|
|
10
7
|
export * from '../../sub-blocks/Quote/schema';
|
|
11
8
|
export * from '../../sub-blocks/Divider/schema';
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
export { default as Divider } from './Divider/Divider';
|
|
2
2
|
export { default as Quote } from './Quote/Quote';
|
|
3
3
|
export { default as NewsCard } from './NewsCard/NewsCard';
|
|
4
|
-
export { default as Partner } from './Partner/Partner';
|
|
5
4
|
export { default as PriceDetailed } from './PriceDetailed/PriceDetailed';
|
|
6
5
|
export { default as MediaCard } from './MediaCard/MediaCard';
|
|
7
6
|
export { default as BannerCard } from './BannerCard/BannerCard';
|
|
8
|
-
export { default as TutorialCard } from './TutorialCard/TutorialCard';
|
|
9
|
-
export { default as CardWithImage } from './CardWithImage/CardWithImage';
|
|
10
7
|
export { default as LayoutItem } from './LayoutItem/LayoutItem';
|
|
11
8
|
export { default as BackgroundCard } from './BackgroundCard/BackgroundCard';
|
|
12
9
|
export { default as BasicCard } from './BasicCard/BasicCard';
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
export { default as Divider } from './Divider/Divider';
|
|
2
2
|
export { default as Quote } from './Quote/Quote';
|
|
3
3
|
export { default as NewsCard } from './NewsCard/NewsCard';
|
|
4
|
-
export { default as Partner } from './Partner/Partner';
|
|
5
4
|
export { default as PriceDetailed } from './PriceDetailed/PriceDetailed';
|
|
6
5
|
export { default as MediaCard } from './MediaCard/MediaCard';
|
|
7
6
|
export { default as BannerCard } from './BannerCard/BannerCard';
|
|
8
|
-
export { default as TutorialCard } from './TutorialCard/TutorialCard';
|
|
9
|
-
export { default as CardWithImage } from './CardWithImage/CardWithImage';
|
|
10
7
|
export { default as LayoutItem } from './LayoutItem/LayoutItem';
|
|
11
8
|
export { default as BackgroundCard } from './BackgroundCard/BackgroundCard';
|
|
12
9
|
export { default as BasicCard } from './BasicCard/BasicCard';
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { ConstructorBlock } from '../models/constructor';
|
|
2
1
|
import { Lang } from '../utils/configure';
|
|
3
2
|
export type ComplexItem = {
|
|
4
3
|
[key: string]: string;
|
|
5
4
|
};
|
|
6
5
|
export type Item = string | null | ComplexItem;
|
|
7
|
-
export type TransformerRaw = (lang: Lang, content: string) => string;
|
|
8
6
|
export type Transformer = (text: string) => string;
|
|
7
|
+
export type TransformerRaw = (lang: Lang, content: string) => string;
|
|
9
8
|
export type Parser<T = any> = (transformer: Transformer, block: T) => T;
|
|
10
9
|
export declare const createItemsParser: (fields: string[]) => (transformer: Transformer, items: Item[]) => (string | {
|
|
11
10
|
[x: string]: string;
|
|
12
11
|
} | null)[];
|
|
13
12
|
export declare function yfmTransformer(lang: Lang, content: string): string;
|
|
14
13
|
export declare function typografTransformer(lang: Lang, content: string): string;
|
|
15
|
-
export declare function transformBlocks(blocks: ConstructorBlock[], lang: Lang, customConfig?: {}): void;
|
|
16
|
-
export declare function transformFootnotes(footnotes: string[], lang: Lang): string[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { fullTransform, typografToHTML } from './utils';
|
|
2
|
+
export const createItemsParser = (fields) => (transformer, items) => items.map((item) => {
|
|
3
|
+
if (!item) {
|
|
4
|
+
return item;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof item === 'string') {
|
|
7
|
+
return transformer(item);
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
return Object.assign(Object.assign({}, item), fields.reduce((acc, fieldName) => {
|
|
11
|
+
if (item[fieldName]) {
|
|
12
|
+
// eslint-disable-next-line no-param-reassign
|
|
13
|
+
acc[fieldName] = transformer(item[fieldName]);
|
|
14
|
+
}
|
|
15
|
+
return acc;
|
|
16
|
+
}, {}));
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export function yfmTransformer(lang, content) {
|
|
20
|
+
const { html } = fullTransform(content, { lang });
|
|
21
|
+
return html;
|
|
22
|
+
}
|
|
23
|
+
export function typografTransformer(lang, content) {
|
|
24
|
+
return typografToHTML(content, lang);
|
|
25
|
+
}
|