@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.
- package/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.css +50 -0
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.d.ts +13 -0
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.js +49 -0
- package/build/cjs/blocks/Preview/MediaContent/PreviewContent.css +106 -0
- package/build/cjs/blocks/Preview/MediaContent/PreviewContent.d.ts +11 -0
- package/build/cjs/blocks/Preview/MediaContent/PreviewContent.js +17 -0
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.css +54 -0
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.d.ts +9 -0
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.js +13 -0
- package/build/cjs/blocks/Preview/Preview.css +50 -0
- package/build/cjs/blocks/Preview/Preview.d.ts +3 -0
- package/build/cjs/blocks/Preview/Preview.js +130 -0
- package/build/cjs/blocks/Preview/schema.d.ts +40 -0
- package/build/cjs/blocks/Preview/schema.js +53 -0
- package/build/cjs/blocks/Simple/Simple.css +22 -0
- package/build/cjs/blocks/Simple/Simple.d.ts +3 -0
- package/build/cjs/blocks/Simple/Simple.js +22 -0
- package/build/cjs/blocks/Simple/schema.d.ts +68 -0
- package/build/cjs/blocks/Simple/schema.js +14 -0
- package/build/cjs/blocks/index.d.ts +2 -0
- package/build/cjs/blocks/index.js +5 -1
- package/build/cjs/blocks/validators.d.ts +2 -0
- package/build/cjs/blocks/validators.js +2 -0
- package/build/cjs/components/HTML/HTML.d.ts +1 -1
- package/build/cjs/components/Image/Image.js +2 -2
- package/build/cjs/constructor-items.d.ts +6 -0
- package/build/cjs/constructor-items.js +6 -0
- package/build/cjs/context/breakpointContext/breakpointContext.d.ts +2 -0
- package/build/cjs/context/breakpointContext/breakpointContext.js +7 -0
- package/build/cjs/context/breakpointContext/index.d.ts +1 -0
- package/build/cjs/context/breakpointContext/index.js +4 -0
- package/build/cjs/hooks/index.d.ts +1 -0
- package/build/cjs/hooks/index.js +3 -1
- package/build/cjs/hooks/useIntersection.d.ts +1 -0
- package/build/cjs/hooks/useIntersection.js +21 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +23 -2
- package/build/cjs/models/constructor-items/blocks.js +2 -0
- package/build/cjs/models/constructor-items/common.d.ts +14 -0
- package/build/cjs/models/constructor-items/common.js +6 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +25 -9
- package/build/cjs/models/constructor-items/sub-blocks.js +7 -6
- package/build/cjs/schema/index.js +4 -2
- package/build/cjs/schema/validators/blocks.d.ts +2 -0
- package/build/cjs/schema/validators/blocks.js +2 -0
- package/build/cjs/schema/validators/sub-blocks.d.ts +1 -0
- package/build/cjs/schema/validators/sub-blocks.js +1 -0
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.css +19 -0
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.d.ts +3 -0
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.js +16 -0
- package/build/cjs/sub-blocks/CardWithImage/schema.d.ts +154 -0
- package/build/cjs/sub-blocks/CardWithImage/schema.js +46 -0
- package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +1 -0
- package/build/cjs/sub-blocks/index.d.ts +1 -0
- package/build/cjs/sub-blocks/index.js +3 -1
- package/build/cjs/text-transform/blocks.js +32 -0
- package/build/cjs/utils/imageCompress.d.ts +6 -0
- package/build/cjs/utils/imageCompress.js +11 -0
- package/build/cjs/utils/index.d.ts +1 -0
- package/build/cjs/utils/index.js +1 -0
- package/build/cjs/utils/scroll.d.ts +15 -0
- package/build/cjs/utils/scroll.js +34 -0
- package/build/esm/blocks/Preview/MediaContent/MediaContent.css +50 -0
- package/build/esm/blocks/Preview/MediaContent/MediaContent.d.ts +14 -0
- package/build/esm/blocks/Preview/MediaContent/MediaContent.js +47 -0
- package/build/esm/blocks/Preview/MediaContent/PreviewContent.css +106 -0
- package/build/esm/blocks/Preview/MediaContent/PreviewContent.d.ts +12 -0
- package/build/esm/blocks/Preview/MediaContent/PreviewContent.js +15 -0
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.css +54 -0
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.d.ts +10 -0
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.js +11 -0
- package/build/esm/blocks/Preview/Preview.css +50 -0
- package/build/esm/blocks/Preview/Preview.d.ts +4 -0
- package/build/esm/blocks/Preview/Preview.js +126 -0
- package/build/esm/blocks/Preview/schema.d.ts +40 -0
- package/build/esm/blocks/Preview/schema.js +50 -0
- package/build/esm/blocks/Simple/Simple.css +22 -0
- package/build/esm/blocks/Simple/Simple.d.ts +4 -0
- package/build/esm/blocks/Simple/Simple.js +18 -0
- package/build/esm/blocks/Simple/schema.d.ts +68 -0
- package/build/esm/blocks/Simple/schema.js +11 -0
- package/build/esm/blocks/index.d.ts +2 -0
- package/build/esm/blocks/index.js +2 -0
- package/build/esm/blocks/validators.d.ts +2 -0
- package/build/esm/blocks/validators.js +2 -0
- package/build/esm/components/HTML/HTML.d.ts +1 -1
- package/build/esm/components/Image/Image.js +2 -2
- package/build/esm/constructor-items.d.ts +6 -0
- package/build/esm/constructor-items.js +8 -2
- package/build/esm/context/breakpointContext/breakpointContext.d.ts +2 -0
- package/build/esm/context/breakpointContext/breakpointContext.js +3 -0
- package/build/esm/context/breakpointContext/index.d.ts +1 -0
- package/build/esm/context/breakpointContext/index.js +1 -0
- package/build/esm/hooks/index.d.ts +1 -0
- package/build/esm/hooks/index.js +1 -0
- package/build/esm/hooks/useIntersection.d.ts +1 -0
- package/build/esm/hooks/useIntersection.js +17 -0
- package/build/esm/models/constructor-items/blocks.d.ts +23 -2
- package/build/esm/models/constructor-items/blocks.js +2 -0
- package/build/esm/models/constructor-items/common.d.ts +14 -0
- package/build/esm/models/constructor-items/common.js +5 -0
- package/build/esm/models/constructor-items/sub-blocks.d.ts +25 -9
- package/build/esm/models/constructor-items/sub-blocks.js +7 -6
- package/build/esm/schema/index.js +6 -4
- package/build/esm/schema/validators/blocks.d.ts +2 -0
- package/build/esm/schema/validators/blocks.js +2 -0
- package/build/esm/schema/validators/sub-blocks.d.ts +1 -0
- package/build/esm/schema/validators/sub-blocks.js +1 -0
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.css +19 -0
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.d.ts +4 -0
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.js +14 -0
- package/build/esm/sub-blocks/CardWithImage/schema.d.ts +154 -0
- package/build/esm/sub-blocks/CardWithImage/schema.js +43 -0
- package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +1 -0
- package/build/esm/sub-blocks/index.d.ts +1 -0
- package/build/esm/sub-blocks/index.js +1 -0
- package/build/esm/text-transform/blocks.js +32 -0
- package/build/esm/utils/imageCompress.d.ts +6 -0
- package/build/esm/utils/imageCompress.js +7 -0
- package/build/esm/utils/index.d.ts +1 -0
- package/build/esm/utils/index.js +1 -0
- package/build/esm/utils/scroll.d.ts +15 -0
- package/build/esm/utils/scroll.js +30 -0
- package/package.json +1 -4
- package/server/models/constructor-items/blocks.d.ts +23 -2
- package/server/models/constructor-items/blocks.js +2 -0
- package/server/models/constructor-items/common.d.ts +14 -0
- package/server/models/constructor-items/common.js +6 -1
- package/server/models/constructor-items/sub-blocks.d.ts +25 -9
- package/server/models/constructor-items/sub-blocks.js +7 -6
- package/server/text-transform/blocks.js +32 -0
- package/server/utils/index.d.ts +1 -0
- package/server/utils/index.js +1 -0
- package/server/utils/scroll.d.ts +15 -0
- package/server/utils/scroll.js +34 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SimpleBlock = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const utils_1 = require("../../utils");
|
|
7
|
+
const AnimateBlock_1 = tslib_1.__importDefault(require("../../components/AnimateBlock/AnimateBlock"));
|
|
8
|
+
const BlockHeader_1 = tslib_1.__importDefault(require("../../components/BlockHeader/BlockHeader"));
|
|
9
|
+
const YFMWrapper_1 = tslib_1.__importDefault(require("../../components/YFMWrapper/YFMWrapper"));
|
|
10
|
+
const b = (0, utils_1.block)('simple-block');
|
|
11
|
+
const SimpleBlock = (props) => {
|
|
12
|
+
const { title, description, animated = true, children } = props;
|
|
13
|
+
const blockHeader = title && react_1.default.createElement(BlockHeader_1.default, { title: title });
|
|
14
|
+
return (react_1.default.createElement(AnimateBlock_1.default, { className: b(), animate: animated },
|
|
15
|
+
react_1.default.createElement("div", null,
|
|
16
|
+
blockHeader,
|
|
17
|
+
react_1.default.createElement("div", { className: b('description') },
|
|
18
|
+
react_1.default.createElement(YFMWrapper_1.default, { content: description, modifiers: { constructor: true } })),
|
|
19
|
+
react_1.default.createElement("div", { className: b('animate-block') }, children))));
|
|
20
|
+
};
|
|
21
|
+
exports.SimpleBlock = SimpleBlock;
|
|
22
|
+
exports.default = exports.SimpleBlock;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export declare const SimpleBlock: {
|
|
2
|
+
'simple-block': {
|
|
3
|
+
additionalProperties: boolean;
|
|
4
|
+
required: string[];
|
|
5
|
+
properties: {
|
|
6
|
+
children: {
|
|
7
|
+
type: string;
|
|
8
|
+
items: {
|
|
9
|
+
$ref: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
animated: {
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
anchor: {
|
|
16
|
+
type: string;
|
|
17
|
+
additionalProperties: boolean;
|
|
18
|
+
required: string[];
|
|
19
|
+
properties: {
|
|
20
|
+
text: {
|
|
21
|
+
type: string;
|
|
22
|
+
contentType: string;
|
|
23
|
+
};
|
|
24
|
+
url: {
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
visible: {
|
|
30
|
+
type: string;
|
|
31
|
+
enum: string[];
|
|
32
|
+
};
|
|
33
|
+
resetPaddings: {
|
|
34
|
+
type: string;
|
|
35
|
+
};
|
|
36
|
+
context: {
|
|
37
|
+
type: string;
|
|
38
|
+
};
|
|
39
|
+
type: {};
|
|
40
|
+
when: {};
|
|
41
|
+
title: {
|
|
42
|
+
type: string;
|
|
43
|
+
additionalProperties: boolean;
|
|
44
|
+
required: string[];
|
|
45
|
+
properties: {
|
|
46
|
+
text: {
|
|
47
|
+
type: string;
|
|
48
|
+
contentType: string;
|
|
49
|
+
};
|
|
50
|
+
textSize: {
|
|
51
|
+
type: string;
|
|
52
|
+
enum: string[];
|
|
53
|
+
};
|
|
54
|
+
url: {
|
|
55
|
+
type: string;
|
|
56
|
+
};
|
|
57
|
+
resetMargin: {
|
|
58
|
+
type: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
description: {
|
|
63
|
+
type: string;
|
|
64
|
+
contentType: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SimpleBlock = void 0;
|
|
4
|
+
const common_1 = require("../../schema/validators/common");
|
|
5
|
+
exports.SimpleBlock = {
|
|
6
|
+
'simple-block': {
|
|
7
|
+
additionalProperties: false,
|
|
8
|
+
required: ['title', 'description'],
|
|
9
|
+
properties: Object.assign(Object.assign(Object.assign({ title: common_1.TitleProps, description: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
contentType: 'yfm',
|
|
12
|
+
} }, common_1.BlockBaseProps), common_1.AnimatableProps), { children: common_1.ChildrenProps }),
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { default as BannerBlock } from './Banner/Banner';
|
|
2
2
|
export { default as CompaniesBlock } from './Companies/Companies';
|
|
3
|
+
export { default as SimpleBlock } from './Simple/Simple';
|
|
3
4
|
export { default as InfoBlock } from './Info/Info';
|
|
4
5
|
export { default as MediaBlock } from './Media/Media';
|
|
5
6
|
export { default as MapBlock } from './Map/Map';
|
|
7
|
+
export { default as PreviewBlock } from './Preview/Preview';
|
|
6
8
|
export { default as SecurityBlock } from './Security/Security';
|
|
7
9
|
export { default as SliderBlock } from './Slider/Slider';
|
|
8
10
|
export { default as ExtendedFeaturesBlock } from './ExtendedFeatures/ExtendedFeatures';
|
|
@@ -3,17 +3,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FilterBlock = exports.ShareBlock = exports.ContentLayoutBlock = exports.CardLayoutBlock = exports.HeaderSliderBlock = exports.IconsBlock = exports.HeaderBlock = exports.LinkTableBlock = exports.TabsBlock = exports.TableBlock = exports.QuestionsBlock = exports.PromoFeaturesBlock = exports.ExtendedFeaturesBlock = exports.SliderBlock = exports.SecurityBlock = exports.MapBlock = exports.MediaBlock = exports.InfoBlock = exports.CompaniesBlock = exports.BannerBlock = void 0;
|
|
6
|
+
exports.FilterBlock = exports.ShareBlock = exports.ContentLayoutBlock = exports.CardLayoutBlock = exports.HeaderSliderBlock = exports.IconsBlock = exports.HeaderBlock = exports.LinkTableBlock = exports.TabsBlock = exports.TableBlock = exports.QuestionsBlock = exports.PromoFeaturesBlock = exports.ExtendedFeaturesBlock = exports.SliderBlock = exports.SecurityBlock = exports.PreviewBlock = exports.MapBlock = exports.MediaBlock = exports.InfoBlock = exports.SimpleBlock = exports.CompaniesBlock = exports.BannerBlock = void 0;
|
|
7
7
|
var Banner_1 = require("./Banner/Banner");
|
|
8
8
|
Object.defineProperty(exports, "BannerBlock", { enumerable: true, get: function () { return __importDefault(Banner_1).default; } });
|
|
9
9
|
var Companies_1 = require("./Companies/Companies");
|
|
10
10
|
Object.defineProperty(exports, "CompaniesBlock", { enumerable: true, get: function () { return __importDefault(Companies_1).default; } });
|
|
11
|
+
var Simple_1 = require("./Simple/Simple");
|
|
12
|
+
Object.defineProperty(exports, "SimpleBlock", { enumerable: true, get: function () { return __importDefault(Simple_1).default; } });
|
|
11
13
|
var Info_1 = require("./Info/Info");
|
|
12
14
|
Object.defineProperty(exports, "InfoBlock", { enumerable: true, get: function () { return __importDefault(Info_1).default; } });
|
|
13
15
|
var Media_1 = require("./Media/Media");
|
|
14
16
|
Object.defineProperty(exports, "MediaBlock", { enumerable: true, get: function () { return __importDefault(Media_1).default; } });
|
|
15
17
|
var Map_1 = require("./Map/Map");
|
|
16
18
|
Object.defineProperty(exports, "MapBlock", { enumerable: true, get: function () { return __importDefault(Map_1).default; } });
|
|
19
|
+
var Preview_1 = require("./Preview/Preview");
|
|
20
|
+
Object.defineProperty(exports, "PreviewBlock", { enumerable: true, get: function () { return __importDefault(Preview_1).default; } });
|
|
17
21
|
var Security_1 = require("./Security/Security");
|
|
18
22
|
Object.defineProperty(exports, "SecurityBlock", { enumerable: true, get: function () { return __importDefault(Security_1).default; } });
|
|
19
23
|
var Slider_1 = require("./Slider/Slider");
|
|
@@ -9,9 +9,11 @@ export * from './Icons/schema';
|
|
|
9
9
|
export * from './Info/schema';
|
|
10
10
|
export * from './LinkTable/schema';
|
|
11
11
|
export * from './Media/schema';
|
|
12
|
+
export * from './Preview/schema';
|
|
12
13
|
export * from './PromoFeaturesBlock/schema';
|
|
13
14
|
export * from './Questions/schema';
|
|
14
15
|
export * from './Security/schema';
|
|
16
|
+
export * from './Simple/schema';
|
|
15
17
|
export * from './Slider/schema';
|
|
16
18
|
export * from './Table/schema';
|
|
17
19
|
export * from './Share/schema';
|
|
@@ -12,9 +12,11 @@ tslib_1.__exportStar(require("./Icons/schema"), exports);
|
|
|
12
12
|
tslib_1.__exportStar(require("./Info/schema"), exports);
|
|
13
13
|
tslib_1.__exportStar(require("./LinkTable/schema"), exports);
|
|
14
14
|
tslib_1.__exportStar(require("./Media/schema"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./Preview/schema"), exports);
|
|
15
16
|
tslib_1.__exportStar(require("./PromoFeaturesBlock/schema"), exports);
|
|
16
17
|
tslib_1.__exportStar(require("./Questions/schema"), exports);
|
|
17
18
|
tslib_1.__exportStar(require("./Security/schema"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./Simple/schema"), exports);
|
|
18
20
|
tslib_1.__exportStar(require("./Slider/schema"), exports);
|
|
19
21
|
tslib_1.__exportStar(require("./Table/schema"), exports);
|
|
20
22
|
tslib_1.__exportStar(require("./Share/schema"), exports);
|
|
@@ -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
|
|
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;
|
|
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const projectSettingsContext_1 = require("../../context/projectSettingsContext");
|
|
6
6
|
const constants_1 = require("../../constants");
|
|
7
|
+
const imageCompress_1 = require("../../utils/imageCompress");
|
|
7
8
|
const checkWebP = (src) => {
|
|
8
9
|
return src.endsWith('.webp') ? src : src + '.webp';
|
|
9
10
|
};
|
|
@@ -15,10 +16,9 @@ const Image = (props) => {
|
|
|
15
16
|
if (!imageSrc) {
|
|
16
17
|
return null;
|
|
17
18
|
}
|
|
18
|
-
// TODO: Temporary solution for .svg images
|
|
19
19
|
const disableWebp = projectSettings.disableCompress ||
|
|
20
20
|
disableCompress ||
|
|
21
|
-
|
|
21
|
+
!(0, imageCompress_1.isCompressible)(imageSrc) ||
|
|
22
22
|
imgLoadingError;
|
|
23
23
|
return (react_1.default.createElement("picture", { className: containerClassName },
|
|
24
24
|
mobile && (react_1.default.createElement(react_1.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;
|
|
@@ -6,12 +6,14 @@ const sub_blocks_1 = require("./sub-blocks");
|
|
|
6
6
|
const blocks_1 = require("./blocks");
|
|
7
7
|
exports.blockMap = {
|
|
8
8
|
[models_1.BlockType.SliderBlock]: blocks_1.SliderBlock,
|
|
9
|
+
[models_1.BlockType.SimpleBlock]: blocks_1.SimpleBlock,
|
|
9
10
|
[models_1.BlockType.ExtendedFeaturesBlock]: blocks_1.ExtendedFeaturesBlock,
|
|
10
11
|
[models_1.BlockType.PromoFeaturesBlock]: blocks_1.PromoFeaturesBlock,
|
|
11
12
|
[models_1.BlockType.QuestionsBlock]: blocks_1.QuestionsBlock,
|
|
12
13
|
[models_1.BlockType.BannerBlock]: blocks_1.BannerBlock,
|
|
13
14
|
[models_1.BlockType.CompaniesBlock]: blocks_1.CompaniesBlock,
|
|
14
15
|
[models_1.BlockType.MediaBlock]: blocks_1.MediaBlock,
|
|
16
|
+
[models_1.BlockType.PreviewBlock]: blocks_1.PreviewBlock,
|
|
15
17
|
[models_1.BlockType.InfoBlock]: blocks_1.InfoBlock,
|
|
16
18
|
[models_1.BlockType.SecurityBlock]: blocks_1.SecurityBlock,
|
|
17
19
|
[models_1.BlockType.TableBlock]: blocks_1.TableBlock,
|
|
@@ -41,6 +43,10 @@ exports.subBlockMap = {
|
|
|
41
43
|
[models_1.SubBlockType.BannerCard]: sub_blocks_1.BannerCard,
|
|
42
44
|
[models_1.SubBlockType.NewsCard]: sub_blocks_1.NewsCard,
|
|
43
45
|
[models_1.SubBlockType.LayoutItem]: sub_blocks_1.LayoutItem,
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated Use LayoutItem
|
|
48
|
+
*/
|
|
49
|
+
[models_1.SubBlockType.CardWithImage]: sub_blocks_1.CardWithImage,
|
|
44
50
|
[models_1.SubBlockType.BackgroundCard]: sub_blocks_1.BackgroundCard,
|
|
45
51
|
[models_1.SubBlockType.BasicCard]: sub_blocks_1.BasicCard,
|
|
46
52
|
[models_1.SubBlockType.Content]: sub_blocks_1.Content,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BreakpointContext = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
exports.BreakpointContext = react_1.default.createContext(constants_1.BREAKPOINTS.sm);
|
|
@@ -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';
|
package/build/cjs/hooks/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useMount = exports.useWindowBreakpoint = exports.useFocus = void 0;
|
|
3
|
+
exports.useMount = exports.useIntersection = exports.useWindowBreakpoint = exports.useFocus = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
var useFocus_1 = require("./useFocus");
|
|
6
6
|
Object.defineProperty(exports, "useFocus", { enumerable: true, get: function () { return tslib_1.__importDefault(useFocus_1).default; } });
|
|
7
7
|
var useWindowBreakpoint_1 = require("./useWindowBreakpoint");
|
|
8
8
|
Object.defineProperty(exports, "useWindowBreakpoint", { enumerable: true, get: function () { return tslib_1.__importDefault(useWindowBreakpoint_1).default; } });
|
|
9
|
+
var useIntersection_1 = require("./useIntersection");
|
|
10
|
+
Object.defineProperty(exports, "useIntersection", { enumerable: true, get: function () { return useIntersection_1.useIntersection; } });
|
|
9
11
|
var useMount_1 = require("./useMount");
|
|
10
12
|
Object.defineProperty(exports, "useMount", { enumerable: true, get: function () { return tslib_1.__importDefault(useMount_1).default; } });
|
|
11
13
|
tslib_1.__exportStar(require("./useAnalytics"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIntersection: (element?: Element, startMargin?: string, threshold?: number) => boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useIntersection = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const useIntersection = (element, startMargin = '0px', threshold = 0.2) => {
|
|
6
|
+
const [isVisible, setState] = (0, react_1.useState)(false);
|
|
7
|
+
(0, react_1.useEffect)(() => {
|
|
8
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
9
|
+
setState(entry.isIntersecting);
|
|
10
|
+
}, {
|
|
11
|
+
rootMargin: startMargin,
|
|
12
|
+
threshold,
|
|
13
|
+
});
|
|
14
|
+
if (element) {
|
|
15
|
+
observer.observe(element);
|
|
16
|
+
}
|
|
17
|
+
return () => element && observer.unobserve(element);
|
|
18
|
+
}, [element, startMargin, threshold]);
|
|
19
|
+
return isVisible;
|
|
20
|
+
};
|
|
21
|
+
exports.useIntersection = useIntersection;
|
|
@@ -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 {};
|
|
@@ -12,10 +12,12 @@ var BlockType;
|
|
|
12
12
|
BlockType["BannerBlock"] = "banner-block";
|
|
13
13
|
BlockType["CompaniesBlock"] = "companies-block";
|
|
14
14
|
BlockType["MediaBlock"] = "media-block";
|
|
15
|
+
BlockType["PreviewBlock"] = "preview-block";
|
|
15
16
|
BlockType["InfoBlock"] = "info-block";
|
|
16
17
|
BlockType["SecurityBlock"] = "security-block";
|
|
17
18
|
BlockType["TableBlock"] = "table-block";
|
|
18
19
|
BlockType["TabsBlock"] = "tabs-block";
|
|
20
|
+
BlockType["SimpleBlock"] = "simple-block";
|
|
19
21
|
BlockType["HeaderSliderBlock"] = "header-slider-block";
|
|
20
22
|
BlockType["LinkTableBlock"] = "link-table-block";
|
|
21
23
|
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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MediaVideoControlsType = exports.MediaVideoType = exports.PlayButtonThemes = exports.PlayButtonType = exports.PriceLabelColor = exports.PriceDetailsType = exports.AuthorType = void 0;
|
|
3
|
+
exports.MediaVideoControlsType = exports.MediaVideoType = exports.PlayButtonThemes = exports.PlayButtonType = exports.PreviewItemType = exports.PriceLabelColor = exports.PriceDetailsType = exports.AuthorType = void 0;
|
|
4
4
|
// enums
|
|
5
5
|
var AuthorType;
|
|
6
6
|
(function (AuthorType) {
|
|
@@ -20,6 +20,11 @@ var PriceLabelColor;
|
|
|
20
20
|
PriceLabelColor["PURPLE"] = "purple";
|
|
21
21
|
PriceLabelColor["RED"] = "red";
|
|
22
22
|
})(PriceLabelColor = exports.PriceLabelColor || (exports.PriceLabelColor = {}));
|
|
23
|
+
var PreviewItemType;
|
|
24
|
+
(function (PreviewItemType) {
|
|
25
|
+
PreviewItemType["Video"] = "video";
|
|
26
|
+
PreviewItemType["Image"] = "image";
|
|
27
|
+
})(PreviewItemType = exports.PreviewItemType || (exports.PreviewItemType = {}));
|
|
23
28
|
var PlayButtonType;
|
|
24
29
|
(function (PlayButtonType) {
|
|
25
30
|
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
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
180
|
+
export type SubBlockModels = DividerModel | QuoteModel | NewsCardModel | PartnerModel | PriceDetailedModel | MediaCardModel | TutorialCardModel | CardWithImageModel | BackgroundCardModel | HubspotFormModel | BannerCardModel | BasicCardModel;
|
|
165
181
|
export type SubBlock = SubBlockModels;
|
|
@@ -7,26 +7,27 @@ var SubBlockType;
|
|
|
7
7
|
SubBlockType["Quote"] = "quote";
|
|
8
8
|
SubBlockType["NewsCard"] = "news-card";
|
|
9
9
|
/**
|
|
10
|
-
* @deprecated Will be
|
|
10
|
+
* @deprecated Will be moved to params use BasicCard instead
|
|
11
11
|
*/
|
|
12
12
|
SubBlockType["Partner"] = "partner";
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Will be removed
|
|
15
|
-
*/
|
|
16
13
|
SubBlockType["PriceDetailed"] = "price-detailed";
|
|
17
14
|
SubBlockType["MediaCard"] = "media-card";
|
|
18
15
|
SubBlockType["BannerCard"] = "banner-card";
|
|
19
16
|
/**
|
|
20
|
-
* @deprecated Will be
|
|
17
|
+
* @deprecated Will be moved to params use BasicCard instead
|
|
21
18
|
*/
|
|
22
19
|
SubBlockType["TutorialCard"] = "tutoral-card";
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use LayoutItem
|
|
22
|
+
*/
|
|
23
|
+
SubBlockType["CardWithImage"] = "card-with-image";
|
|
23
24
|
SubBlockType["LayoutItem"] = "layout-item";
|
|
24
25
|
SubBlockType["BackgroundCard"] = "background-card";
|
|
25
26
|
SubBlockType["BasicCard"] = "basic-card";
|
|
26
27
|
SubBlockType["Content"] = "content";
|
|
27
28
|
SubBlockType["HubspotForm"] = "hubspot-form";
|
|
28
29
|
/**
|
|
29
|
-
* @deprecated Will be
|
|
30
|
+
* @deprecated Will be moved to params use BasicCard instead
|
|
30
31
|
*/
|
|
31
32
|
SubBlockType["Card"] = "card";
|
|
32
33
|
})(SubBlockType = exports.SubBlockType || (exports.SubBlockType = {}));
|
|
@@ -14,8 +14,8 @@ const getBlocksCases = (blocks) => {
|
|
|
14
14
|
exports.getBlocksCases = getBlocksCases;
|
|
15
15
|
function generateDefaultSchema(config) {
|
|
16
16
|
const { cards = {}, blocks = {}, extensions = {} } = config !== null && config !== void 0 ? config : {};
|
|
17
|
-
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({}, sub_blocks_1.Divider), blocks_1.ExtendedFeaturesBlock), blocks_1.PromoFeaturesBlock), blocks_1.SliderBlock), blocks_1.QuestionsBlock), blocks_1.HeaderBlock), blocks_1.BannerBlock), blocks_1.CompaniesBlock), blocks_1.MediaBlock), blocks_1.MapBlock), blocks_1.InfoBlock), blocks_1.SecurityBlock), blocks_1.TableBlock), blocks_1.TabsBlock), blocks_1.LinkTableBlock), blocks_1.HeaderSliderBlock), blocks_1.IconsBlock), blocks_1.CardLayoutBlock), blocks_1.ContentLayoutBlock), blocks_1.ShareBlock);
|
|
18
|
-
const cardValidators = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.PartnerBlock), sub_blocks_1.MediaCardBlock), blocks_1.BannerCard), sub_blocks_1.PriceDetailedBlock), sub_blocks_1.TutorialCard), sub_blocks_1.BackgroundCard), sub_blocks_1.NewsCard), sub_blocks_1.Quote), sub_blocks_1.BasicCard);
|
|
17
|
+
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({}, sub_blocks_1.Divider), blocks_1.ExtendedFeaturesBlock), blocks_1.PromoFeaturesBlock), blocks_1.SliderBlock), blocks_1.QuestionsBlock), blocks_1.HeaderBlock), blocks_1.BannerBlock), blocks_1.CompaniesBlock), blocks_1.MediaBlock), blocks_1.MapBlock), blocks_1.InfoBlock), blocks_1.SecurityBlock), blocks_1.TableBlock), blocks_1.TabsBlock), blocks_1.SimpleBlock), blocks_1.LinkTableBlock), blocks_1.PreviewBlock), blocks_1.HeaderSliderBlock), blocks_1.IconsBlock), blocks_1.CardLayoutBlock), blocks_1.ContentLayoutBlock), blocks_1.ShareBlock);
|
|
18
|
+
const cardValidators = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.PartnerBlock), sub_blocks_1.MediaCardBlock), blocks_1.BannerCard), sub_blocks_1.PriceDetailedBlock), sub_blocks_1.TutorialCard), sub_blocks_1.BackgroundCard), sub_blocks_1.NewsCard), sub_blocks_1.CardWithImage), sub_blocks_1.Quote), sub_blocks_1.BasicCard);
|
|
19
19
|
const constructorBlockSchemaNames = [
|
|
20
20
|
'divider',
|
|
21
21
|
'quote',
|
|
@@ -34,6 +34,7 @@ function generateDefaultSchema(config) {
|
|
|
34
34
|
'security-block',
|
|
35
35
|
'table-block',
|
|
36
36
|
'tabs-block',
|
|
37
|
+
'simple-block',
|
|
37
38
|
'link-table-block',
|
|
38
39
|
'preview-block',
|
|
39
40
|
'price-detailed',
|
|
@@ -52,6 +53,7 @@ function generateDefaultSchema(config) {
|
|
|
52
53
|
'tutoral-card',
|
|
53
54
|
'background-card',
|
|
54
55
|
'news-card',
|
|
56
|
+
'card-with-image',
|
|
55
57
|
'quote',
|
|
56
58
|
'basic-card',
|
|
57
59
|
'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';
|