@gravity-ui/blog-constructor 3.2.0-alpha.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +7 -0
- package/build/cjs/blocks/Author/schema.d.ts +53 -0
- package/build/cjs/blocks/Author/schema.js +17 -0
- package/build/cjs/blocks/Banner/schema.d.ts +124 -0
- package/build/cjs/blocks/Banner/schema.js +22 -0
- package/build/cjs/blocks/CTA/CTA.css +27 -47
- package/build/cjs/blocks/CTA/schema.d.ts +124 -0
- package/build/cjs/blocks/CTA/schema.js +23 -0
- package/build/cjs/blocks/ColoredText/schema.d.ts +140 -0
- package/build/cjs/blocks/ColoredText/schema.js +29 -0
- package/build/cjs/blocks/Feed/schema.d.ts +66 -0
- package/build/cjs/blocks/Feed/schema.js +21 -0
- package/build/cjs/blocks/Header/schema.d.ts +376 -0
- package/build/cjs/blocks/Header/schema.js +14 -0
- package/build/cjs/blocks/Layout/schema.d.ts +60 -0
- package/build/cjs/blocks/Layout/schema.js +18 -0
- package/build/cjs/blocks/Media/schema.d.ts +181 -0
- package/build/cjs/blocks/Media/schema.js +17 -0
- package/build/cjs/blocks/Meta/schema.d.ts +49 -0
- package/build/cjs/blocks/Meta/schema.js +14 -0
- package/build/cjs/blocks/Suggest/schema.d.ts +49 -0
- package/build/cjs/blocks/Suggest/schema.js +14 -0
- package/build/cjs/blocks/YFM/schema.d.ts +54 -0
- package/build/cjs/blocks/YFM/schema.js +18 -0
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +1 -0
- package/build/cjs/schema/blocks.d.ts +10 -0
- package/build/cjs/schema/blocks.js +26 -0
- package/build/cjs/schema/common.d.ts +28 -0
- package/build/cjs/schema/common.js +25 -0
- package/build/cjs/schema/headers.d.ts +1 -0
- package/build/cjs/schema/headers.js +17 -0
- package/build/cjs/schema/index.d.ts +1288 -0
- package/build/cjs/schema/index.js +52 -0
- package/build/cjs/schema/utils.d.ts +9 -0
- package/build/cjs/schema/utils.js +9 -0
- package/build/esm/blocks/Author/schema.d.ts +53 -0
- package/build/esm/blocks/Author/schema.js +14 -0
- package/build/esm/blocks/Banner/schema.d.ts +124 -0
- package/build/esm/blocks/Banner/schema.js +19 -0
- package/build/esm/blocks/CTA/CTA.css +27 -47
- package/build/esm/blocks/CTA/schema.d.ts +124 -0
- package/build/esm/blocks/CTA/schema.js +20 -0
- package/build/esm/blocks/ColoredText/schema.d.ts +140 -0
- package/build/esm/blocks/ColoredText/schema.js +26 -0
- package/build/esm/blocks/Feed/schema.d.ts +66 -0
- package/build/esm/blocks/Feed/schema.js +18 -0
- package/build/esm/blocks/Header/schema.d.ts +376 -0
- package/build/esm/blocks/Header/schema.js +11 -0
- package/build/esm/blocks/Layout/schema.d.ts +60 -0
- package/build/esm/blocks/Layout/schema.js +15 -0
- package/build/esm/blocks/Media/schema.d.ts +181 -0
- package/build/esm/blocks/Media/schema.js +14 -0
- package/build/esm/blocks/Meta/schema.d.ts +49 -0
- package/build/esm/blocks/Meta/schema.js +11 -0
- package/build/esm/blocks/Suggest/schema.d.ts +49 -0
- package/build/esm/blocks/Suggest/schema.js +11 -0
- package/build/esm/blocks/YFM/schema.d.ts +54 -0
- package/build/esm/blocks/YFM/schema.js +15 -0
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/schema/blocks.d.ts +10 -0
- package/build/esm/schema/blocks.js +10 -0
- package/build/esm/schema/common.d.ts +28 -0
- package/build/esm/schema/common.js +21 -0
- package/build/esm/schema/headers.d.ts +1 -0
- package/build/esm/schema/headers.js +1 -0
- package/build/esm/schema/index.d.ts +1288 -0
- package/build/esm/schema/index.js +26 -0
- package/build/esm/schema/utils.d.ts +9 -0
- package/build/esm/schema/utils.js +5 -0
- package/package.json +2 -5
@@ -0,0 +1,52 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
exports.schemasForCustom = exports.validators = void 0;
|
27
|
+
const common_1 = require("../models/common");
|
28
|
+
const blocks = __importStar(require("./blocks"));
|
29
|
+
const headers = __importStar(require("./headers"));
|
30
|
+
const { Author, Banner, ColoredText, CTA, Feed, Layout, Media, Meta, Suggest, YFM } = blocks;
|
31
|
+
const { Header } = headers;
|
32
|
+
exports.validators = {
|
33
|
+
blocks,
|
34
|
+
headers,
|
35
|
+
};
|
36
|
+
exports.schemasForCustom = {
|
37
|
+
headers: {
|
38
|
+
[common_1.BlockType.Header]: Header,
|
39
|
+
},
|
40
|
+
blocks: {
|
41
|
+
[common_1.BlockType.Author]: Author,
|
42
|
+
[common_1.BlockType.Banner]: Banner,
|
43
|
+
[common_1.BlockType.ColoredText]: ColoredText,
|
44
|
+
[common_1.BlockType.CTA]: CTA,
|
45
|
+
[common_1.BlockType.Feed]: Feed,
|
46
|
+
[common_1.BlockType.Layout]: Layout,
|
47
|
+
[common_1.BlockType.Media]: Media,
|
48
|
+
[common_1.BlockType.Meta]: Meta,
|
49
|
+
[common_1.BlockType.Suggest]: Suggest,
|
50
|
+
[common_1.BlockType.YFM]: YFM,
|
51
|
+
},
|
52
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.generateConfig = void 0;
|
4
|
+
const generateConfig = (config) => {
|
5
|
+
return Object.keys(config).reduce((acc, blockKey) => (Object.assign(Object.assign({}, acc), { blockKey: {
|
6
|
+
blockKey: config[blockKey],
|
7
|
+
} })), {});
|
8
|
+
};
|
9
|
+
exports.generateConfig = generateConfig;
|
@@ -0,0 +1,53 @@
|
|
1
|
+
export declare const Author: {
|
2
|
+
"blog-author-block": {
|
3
|
+
type: string;
|
4
|
+
additionalProperties: boolean;
|
5
|
+
required: string[];
|
6
|
+
properties: {
|
7
|
+
authorId: {
|
8
|
+
type: string;
|
9
|
+
};
|
10
|
+
paddingTop: {
|
11
|
+
type: string;
|
12
|
+
enum: string[];
|
13
|
+
};
|
14
|
+
paddingBottom: {
|
15
|
+
type: string;
|
16
|
+
enum: string[];
|
17
|
+
};
|
18
|
+
fullWidth: {
|
19
|
+
type: string;
|
20
|
+
};
|
21
|
+
column: {
|
22
|
+
type: string;
|
23
|
+
enum: string[];
|
24
|
+
};
|
25
|
+
anchor: {
|
26
|
+
type: string;
|
27
|
+
additionalProperties: boolean;
|
28
|
+
required: string[];
|
29
|
+
properties: {
|
30
|
+
text: {
|
31
|
+
type: string;
|
32
|
+
contentType: string;
|
33
|
+
};
|
34
|
+
url: {
|
35
|
+
type: string;
|
36
|
+
};
|
37
|
+
};
|
38
|
+
};
|
39
|
+
visible: {
|
40
|
+
type: string;
|
41
|
+
enum: string[];
|
42
|
+
};
|
43
|
+
resetPaddings: {
|
44
|
+
type: string;
|
45
|
+
};
|
46
|
+
context: {
|
47
|
+
type: string;
|
48
|
+
};
|
49
|
+
type: {};
|
50
|
+
when: {};
|
51
|
+
};
|
52
|
+
};
|
53
|
+
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { validators } from '@gravity-ui/page-constructor';
|
2
|
+
const { common: { BlockBaseProps }, } = validators;
|
3
|
+
import { BlockType } from '../../models/common';
|
4
|
+
import { BlogBlockBase } from '../../schema/common';
|
5
|
+
export const Author = {
|
6
|
+
[BlockType.Author]: {
|
7
|
+
type: 'object',
|
8
|
+
additionalProperties: false,
|
9
|
+
required: ['authorId'],
|
10
|
+
properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), BlogBlockBase), { authorId: {
|
11
|
+
type: 'number',
|
12
|
+
} }),
|
13
|
+
},
|
14
|
+
};
|
@@ -0,0 +1,124 @@
|
|
1
|
+
export declare const Banner: {
|
2
|
+
"blog-banner-block": {
|
3
|
+
type: string;
|
4
|
+
additionalProperties: boolean;
|
5
|
+
required: string[];
|
6
|
+
properties: {
|
7
|
+
color: {
|
8
|
+
type: string;
|
9
|
+
};
|
10
|
+
image: {
|
11
|
+
type: string;
|
12
|
+
};
|
13
|
+
imageSize: {
|
14
|
+
type: string;
|
15
|
+
enum: string[];
|
16
|
+
};
|
17
|
+
title: {
|
18
|
+
oneOf: ({
|
19
|
+
type: string;
|
20
|
+
additionalProperties: boolean;
|
21
|
+
required: string[];
|
22
|
+
properties: {
|
23
|
+
text: {
|
24
|
+
type: string;
|
25
|
+
contentType: string;
|
26
|
+
};
|
27
|
+
textSize: {
|
28
|
+
type: string;
|
29
|
+
enum: string[];
|
30
|
+
};
|
31
|
+
url: {
|
32
|
+
type: string;
|
33
|
+
};
|
34
|
+
resetMargin: {
|
35
|
+
type: string;
|
36
|
+
};
|
37
|
+
};
|
38
|
+
} | {
|
39
|
+
type: string;
|
40
|
+
contentType: string;
|
41
|
+
})[];
|
42
|
+
};
|
43
|
+
text: {
|
44
|
+
type: string;
|
45
|
+
contentType: string;
|
46
|
+
};
|
47
|
+
additionalInfo: {
|
48
|
+
type: string;
|
49
|
+
contentType: string;
|
50
|
+
};
|
51
|
+
size: {
|
52
|
+
type: string;
|
53
|
+
enum: string[];
|
54
|
+
};
|
55
|
+
links: {
|
56
|
+
type: string;
|
57
|
+
items: {
|
58
|
+
type: string;
|
59
|
+
properties: {
|
60
|
+
when: {
|
61
|
+
type: string;
|
62
|
+
};
|
63
|
+
};
|
64
|
+
};
|
65
|
+
};
|
66
|
+
buttons: {
|
67
|
+
type: string;
|
68
|
+
items: {
|
69
|
+
type: string;
|
70
|
+
properties: {
|
71
|
+
when: {
|
72
|
+
type: string;
|
73
|
+
};
|
74
|
+
};
|
75
|
+
};
|
76
|
+
};
|
77
|
+
theme: {
|
78
|
+
type: string;
|
79
|
+
enum: string[];
|
80
|
+
};
|
81
|
+
paddingTop: {
|
82
|
+
type: string;
|
83
|
+
enum: string[];
|
84
|
+
};
|
85
|
+
paddingBottom: {
|
86
|
+
type: string;
|
87
|
+
enum: string[];
|
88
|
+
};
|
89
|
+
fullWidth: {
|
90
|
+
type: string;
|
91
|
+
};
|
92
|
+
column: {
|
93
|
+
type: string;
|
94
|
+
enum: string[];
|
95
|
+
};
|
96
|
+
anchor: {
|
97
|
+
type: string;
|
98
|
+
additionalProperties: boolean;
|
99
|
+
required: string[];
|
100
|
+
properties: {
|
101
|
+
text: {
|
102
|
+
type: string;
|
103
|
+
contentType: string;
|
104
|
+
};
|
105
|
+
url: {
|
106
|
+
type: string;
|
107
|
+
};
|
108
|
+
};
|
109
|
+
};
|
110
|
+
visible: {
|
111
|
+
type: string;
|
112
|
+
enum: string[];
|
113
|
+
};
|
114
|
+
resetPaddings: {
|
115
|
+
type: string;
|
116
|
+
};
|
117
|
+
context: {
|
118
|
+
type: string;
|
119
|
+
};
|
120
|
+
type: {};
|
121
|
+
when: {};
|
122
|
+
};
|
123
|
+
};
|
124
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { validators } from '@gravity-ui/page-constructor';
|
2
|
+
import { BlockType } from '../../models/common';
|
3
|
+
import { BlogBlockBase } from '../../schema/common';
|
4
|
+
const { subBlocks: { ContentBase }, common: { BlockBaseProps }, } = validators;
|
5
|
+
export const Banner = {
|
6
|
+
[BlockType.Banner]: {
|
7
|
+
type: 'object',
|
8
|
+
additionalProperties: false,
|
9
|
+
required: ['title', 'text', 'image'],
|
10
|
+
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, BlockBaseProps), BlogBlockBase), ContentBase), { color: {
|
11
|
+
type: 'string',
|
12
|
+
}, image: {
|
13
|
+
type: 'string',
|
14
|
+
}, imageSize: {
|
15
|
+
type: 'string',
|
16
|
+
enum: ['s', 'm'],
|
17
|
+
} }),
|
18
|
+
},
|
19
|
+
};
|
@@ -11,66 +11,46 @@
|
|
11
11
|
}
|
12
12
|
.bc-cta__button {
|
13
13
|
display: flex;
|
14
|
-
padding-bottom:
|
15
|
-
}
|
16
|
-
.bc-cta__button_layout {
|
17
|
-
width: 100%;
|
18
|
-
max-width: 100%;
|
19
|
-
margin-right: 0px;
|
20
|
-
}
|
21
|
-
.bc-cta__button_layout_2 {
|
22
|
-
width: calc(50% - (16px / 2));
|
23
|
-
max-width: 50%;
|
24
|
-
margin-right: 16px;
|
25
|
-
}
|
26
|
-
.bc-cta__button_layout_2:nth-child(2n) {
|
27
|
-
margin-right: 0px;
|
28
|
-
}
|
29
|
-
.bc-cta__button_layout_3 {
|
30
|
-
width: calc(33.3333333333% - (32px / 3));
|
31
|
-
margin-right: 16px;
|
32
|
-
}
|
33
|
-
.bc-cta__button_layout_3:nth-child(3n) {
|
34
|
-
margin-right: 0px;
|
35
|
-
}
|
36
|
-
.bc-cta__button_layout_4 {
|
37
|
-
width: calc(25% - (48px / 4));
|
38
|
-
max-width: 50%;
|
39
|
-
margin-right: 16px;
|
40
|
-
}
|
41
|
-
.bc-cta__button_layout_4:nth-child(4n) {
|
42
|
-
margin-right: 0px;
|
14
|
+
padding-bottom: 16px;
|
43
15
|
}
|
44
16
|
.bc-cta__content {
|
45
17
|
display: flex;
|
46
|
-
flex-direction:
|
18
|
+
flex-direction: column;
|
47
19
|
}
|
48
|
-
@media (
|
20
|
+
@media (min-width: 577px) {
|
49
21
|
.bc-cta__content {
|
50
|
-
|
22
|
+
display: flex;
|
23
|
+
flex-direction: row;
|
51
24
|
}
|
52
25
|
.bc-cta__button {
|
53
|
-
padding-bottom:
|
26
|
+
padding-bottom: 0px;
|
54
27
|
}
|
55
|
-
.bc-
|
56
|
-
width:
|
28
|
+
.bc-cta__button_layout {
|
29
|
+
width: 100%;
|
57
30
|
max-width: 100%;
|
31
|
+
margin-right: 0px;
|
32
|
+
}
|
33
|
+
.bc-cta__button_layout_2 {
|
34
|
+
width: calc(50% - (16px / 2));
|
35
|
+
max-width: 50%;
|
58
36
|
margin-right: 16px;
|
59
|
-
flex-grow: 1;
|
60
37
|
}
|
61
|
-
.bc-
|
62
|
-
margin-right:
|
38
|
+
.bc-cta__button_layout_2:nth-child(2n) {
|
39
|
+
margin-right: 0px;
|
63
40
|
}
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
flex-direction: column;
|
41
|
+
.bc-cta__button_layout_3 {
|
42
|
+
width: calc(33.3333333333% - (32px / 3));
|
43
|
+
margin-right: 16px;
|
68
44
|
}
|
69
|
-
.bc-
|
70
|
-
|
45
|
+
.bc-cta__button_layout_3:nth-child(3n) {
|
46
|
+
margin-right: 0px;
|
71
47
|
}
|
72
|
-
.bc-
|
73
|
-
width:
|
74
|
-
max-width:
|
48
|
+
.bc-cta__button_layout_4 {
|
49
|
+
width: calc(25% - (48px / 4));
|
50
|
+
max-width: 50%;
|
51
|
+
margin-right: 16px;
|
52
|
+
}
|
53
|
+
.bc-cta__button_layout_4:nth-child(4n) {
|
54
|
+
margin-right: 0px;
|
75
55
|
}
|
76
56
|
}
|
@@ -0,0 +1,124 @@
|
|
1
|
+
export declare const CTA: {
|
2
|
+
"blog-cta-block": {
|
3
|
+
type: string;
|
4
|
+
additionalProperties: boolean;
|
5
|
+
required: string[];
|
6
|
+
properties: {
|
7
|
+
items: {
|
8
|
+
type: string;
|
9
|
+
items: {
|
10
|
+
type: string;
|
11
|
+
additionalProperties: boolean;
|
12
|
+
required: string[];
|
13
|
+
properties: {
|
14
|
+
title: {
|
15
|
+
oneOf: ({
|
16
|
+
type: string;
|
17
|
+
additionalProperties: boolean;
|
18
|
+
required: string[];
|
19
|
+
properties: {
|
20
|
+
text: {
|
21
|
+
type: string;
|
22
|
+
contentType: string;
|
23
|
+
};
|
24
|
+
textSize: {
|
25
|
+
type: string;
|
26
|
+
enum: string[];
|
27
|
+
};
|
28
|
+
url: {
|
29
|
+
type: string;
|
30
|
+
};
|
31
|
+
resetMargin: {
|
32
|
+
type: string;
|
33
|
+
};
|
34
|
+
};
|
35
|
+
} | {
|
36
|
+
type: string;
|
37
|
+
contentType: string;
|
38
|
+
})[];
|
39
|
+
};
|
40
|
+
text: {
|
41
|
+
type: string;
|
42
|
+
contentType: string;
|
43
|
+
};
|
44
|
+
additionalInfo: {
|
45
|
+
type: string;
|
46
|
+
contentType: string;
|
47
|
+
};
|
48
|
+
size: {
|
49
|
+
type: string;
|
50
|
+
enum: string[];
|
51
|
+
};
|
52
|
+
links: {
|
53
|
+
type: string;
|
54
|
+
items: {
|
55
|
+
type: string;
|
56
|
+
properties: {
|
57
|
+
when: {
|
58
|
+
type: string;
|
59
|
+
};
|
60
|
+
};
|
61
|
+
};
|
62
|
+
};
|
63
|
+
buttons: {
|
64
|
+
type: string;
|
65
|
+
items: {
|
66
|
+
type: string;
|
67
|
+
properties: {
|
68
|
+
when: {
|
69
|
+
type: string;
|
70
|
+
};
|
71
|
+
};
|
72
|
+
};
|
73
|
+
};
|
74
|
+
theme: {
|
75
|
+
type: string;
|
76
|
+
enum: string[];
|
77
|
+
};
|
78
|
+
};
|
79
|
+
};
|
80
|
+
};
|
81
|
+
paddingTop: {
|
82
|
+
type: string;
|
83
|
+
enum: string[];
|
84
|
+
};
|
85
|
+
paddingBottom: {
|
86
|
+
type: string;
|
87
|
+
enum: string[];
|
88
|
+
};
|
89
|
+
fullWidth: {
|
90
|
+
type: string;
|
91
|
+
};
|
92
|
+
column: {
|
93
|
+
type: string;
|
94
|
+
enum: string[];
|
95
|
+
};
|
96
|
+
anchor: {
|
97
|
+
type: string;
|
98
|
+
additionalProperties: boolean;
|
99
|
+
required: string[];
|
100
|
+
properties: {
|
101
|
+
text: {
|
102
|
+
type: string;
|
103
|
+
contentType: string;
|
104
|
+
};
|
105
|
+
url: {
|
106
|
+
type: string;
|
107
|
+
};
|
108
|
+
};
|
109
|
+
};
|
110
|
+
visible: {
|
111
|
+
type: string;
|
112
|
+
enum: string[];
|
113
|
+
};
|
114
|
+
resetPaddings: {
|
115
|
+
type: string;
|
116
|
+
};
|
117
|
+
context: {
|
118
|
+
type: string;
|
119
|
+
};
|
120
|
+
type: {};
|
121
|
+
when: {};
|
122
|
+
};
|
123
|
+
};
|
124
|
+
};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { validators } from '@gravity-ui/page-constructor';
|
2
|
+
import { BlockType } from '../../models/common';
|
3
|
+
import { BlogBlockBase } from '../../schema/common';
|
4
|
+
const { subBlocks: { ContentBase }, common: { BlockBaseProps }, } = validators;
|
5
|
+
export const CTA = {
|
6
|
+
[BlockType.CTA]: {
|
7
|
+
type: 'object',
|
8
|
+
additionalProperties: false,
|
9
|
+
required: ['items'],
|
10
|
+
properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), BlogBlockBase), { items: {
|
11
|
+
type: 'array',
|
12
|
+
items: {
|
13
|
+
type: 'object',
|
14
|
+
additionalProperties: false,
|
15
|
+
required: ['title', 'links'],
|
16
|
+
properties: Object.assign({}, ContentBase),
|
17
|
+
},
|
18
|
+
} }),
|
19
|
+
},
|
20
|
+
};
|
@@ -0,0 +1,140 @@
|
|
1
|
+
export declare const ColoredText: {
|
2
|
+
"blog-colored-text-block": {
|
3
|
+
type: string;
|
4
|
+
additionalProperties: boolean;
|
5
|
+
required: string[];
|
6
|
+
properties: {
|
7
|
+
background: {
|
8
|
+
type: string;
|
9
|
+
additionalProperties: boolean;
|
10
|
+
properties: {
|
11
|
+
image: {
|
12
|
+
oneOf: ({
|
13
|
+
type: string;
|
14
|
+
properties: {
|
15
|
+
when: {
|
16
|
+
type: string;
|
17
|
+
};
|
18
|
+
};
|
19
|
+
} | {
|
20
|
+
type: string;
|
21
|
+
pattern: string;
|
22
|
+
})[];
|
23
|
+
};
|
24
|
+
color: {
|
25
|
+
type: string;
|
26
|
+
};
|
27
|
+
altText: {
|
28
|
+
type: string;
|
29
|
+
contentType: string;
|
30
|
+
};
|
31
|
+
};
|
32
|
+
};
|
33
|
+
title: {
|
34
|
+
oneOf: ({
|
35
|
+
type: string;
|
36
|
+
additionalProperties: boolean;
|
37
|
+
required: string[];
|
38
|
+
properties: {
|
39
|
+
text: {
|
40
|
+
type: string;
|
41
|
+
contentType: string;
|
42
|
+
};
|
43
|
+
textSize: {
|
44
|
+
type: string;
|
45
|
+
enum: string[];
|
46
|
+
};
|
47
|
+
url: {
|
48
|
+
type: string;
|
49
|
+
};
|
50
|
+
resetMargin: {
|
51
|
+
type: string;
|
52
|
+
};
|
53
|
+
};
|
54
|
+
} | {
|
55
|
+
type: string;
|
56
|
+
contentType: string;
|
57
|
+
})[];
|
58
|
+
};
|
59
|
+
text: {
|
60
|
+
type: string;
|
61
|
+
contentType: string;
|
62
|
+
};
|
63
|
+
additionalInfo: {
|
64
|
+
type: string;
|
65
|
+
contentType: string;
|
66
|
+
};
|
67
|
+
size: {
|
68
|
+
type: string;
|
69
|
+
enum: string[];
|
70
|
+
};
|
71
|
+
links: {
|
72
|
+
type: string;
|
73
|
+
items: {
|
74
|
+
type: string;
|
75
|
+
properties: {
|
76
|
+
when: {
|
77
|
+
type: string;
|
78
|
+
};
|
79
|
+
};
|
80
|
+
};
|
81
|
+
};
|
82
|
+
buttons: {
|
83
|
+
type: string;
|
84
|
+
items: {
|
85
|
+
type: string;
|
86
|
+
properties: {
|
87
|
+
when: {
|
88
|
+
type: string;
|
89
|
+
};
|
90
|
+
};
|
91
|
+
};
|
92
|
+
};
|
93
|
+
theme: {
|
94
|
+
type: string;
|
95
|
+
enum: string[];
|
96
|
+
};
|
97
|
+
paddingTop: {
|
98
|
+
type: string;
|
99
|
+
enum: string[];
|
100
|
+
};
|
101
|
+
paddingBottom: {
|
102
|
+
type: string;
|
103
|
+
enum: string[];
|
104
|
+
};
|
105
|
+
fullWidth: {
|
106
|
+
type: string;
|
107
|
+
};
|
108
|
+
column: {
|
109
|
+
type: string;
|
110
|
+
enum: string[];
|
111
|
+
};
|
112
|
+
anchor: {
|
113
|
+
type: string;
|
114
|
+
additionalProperties: boolean;
|
115
|
+
required: string[];
|
116
|
+
properties: {
|
117
|
+
text: {
|
118
|
+
type: string;
|
119
|
+
contentType: string;
|
120
|
+
};
|
121
|
+
url: {
|
122
|
+
type: string;
|
123
|
+
};
|
124
|
+
};
|
125
|
+
};
|
126
|
+
visible: {
|
127
|
+
type: string;
|
128
|
+
enum: string[];
|
129
|
+
};
|
130
|
+
resetPaddings: {
|
131
|
+
type: string;
|
132
|
+
};
|
133
|
+
context: {
|
134
|
+
type: string;
|
135
|
+
};
|
136
|
+
type: {};
|
137
|
+
when: {};
|
138
|
+
};
|
139
|
+
};
|
140
|
+
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { validators } from '@gravity-ui/page-constructor';
|
2
|
+
import { BlockType } from '../../models/common';
|
3
|
+
import { BlogBlockBase } from '../../schema/common';
|
4
|
+
const { subBlocks: { ContentBase }, components: { ImageProps }, common: { BlockBaseProps }, } = validators;
|
5
|
+
const BackgroundProps = {
|
6
|
+
type: 'object',
|
7
|
+
additionalProperties: false,
|
8
|
+
properties: {
|
9
|
+
image: ImageProps,
|
10
|
+
color: {
|
11
|
+
type: 'string',
|
12
|
+
},
|
13
|
+
altText: {
|
14
|
+
type: 'string',
|
15
|
+
contentType: 'text',
|
16
|
+
},
|
17
|
+
},
|
18
|
+
};
|
19
|
+
export const ColoredText = {
|
20
|
+
[BlockType.ColoredText]: {
|
21
|
+
type: 'object',
|
22
|
+
additionalProperties: false,
|
23
|
+
required: ['text'],
|
24
|
+
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, BlockBaseProps), BlogBlockBase), ContentBase), { background: BackgroundProps }),
|
25
|
+
},
|
26
|
+
};
|