@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,181 @@
|
|
1
|
+
export declare const Media: {
|
2
|
+
"blog-media-block": {
|
3
|
+
type: string;
|
4
|
+
additionalProperties: boolean;
|
5
|
+
properties: {
|
6
|
+
text: {
|
7
|
+
type: string;
|
8
|
+
contentType: string;
|
9
|
+
};
|
10
|
+
color: {
|
11
|
+
type: string;
|
12
|
+
};
|
13
|
+
image: {
|
14
|
+
anyOf: ({
|
15
|
+
oneOf: ({
|
16
|
+
type: string;
|
17
|
+
properties: {
|
18
|
+
when: {
|
19
|
+
type: string;
|
20
|
+
};
|
21
|
+
};
|
22
|
+
} | {
|
23
|
+
type: string;
|
24
|
+
pattern: string;
|
25
|
+
})[];
|
26
|
+
} | {
|
27
|
+
type: string;
|
28
|
+
items: {
|
29
|
+
oneOf: ({
|
30
|
+
type: string;
|
31
|
+
properties: {
|
32
|
+
when: {
|
33
|
+
type: string;
|
34
|
+
};
|
35
|
+
};
|
36
|
+
} | {
|
37
|
+
type: string;
|
38
|
+
pattern: string;
|
39
|
+
})[];
|
40
|
+
};
|
41
|
+
})[];
|
42
|
+
};
|
43
|
+
video: {
|
44
|
+
type: string;
|
45
|
+
additionalProperties: boolean;
|
46
|
+
required: string[];
|
47
|
+
properties: {
|
48
|
+
src: {
|
49
|
+
type: string;
|
50
|
+
items: {
|
51
|
+
type: string;
|
52
|
+
};
|
53
|
+
};
|
54
|
+
loop: {
|
55
|
+
anyOf: ({
|
56
|
+
type: string;
|
57
|
+
additionalProperties: boolean;
|
58
|
+
required: string[];
|
59
|
+
properties: {
|
60
|
+
start: {
|
61
|
+
type: string;
|
62
|
+
};
|
63
|
+
end: {
|
64
|
+
type: string;
|
65
|
+
};
|
66
|
+
};
|
67
|
+
} | {
|
68
|
+
type: string;
|
69
|
+
})[];
|
70
|
+
};
|
71
|
+
type: {
|
72
|
+
type: string;
|
73
|
+
enum: string[];
|
74
|
+
};
|
75
|
+
muted: {
|
76
|
+
type: string;
|
77
|
+
};
|
78
|
+
playing: {
|
79
|
+
type: string;
|
80
|
+
};
|
81
|
+
elapsedTime: {
|
82
|
+
type: string;
|
83
|
+
};
|
84
|
+
playIcon: {
|
85
|
+
type: string;
|
86
|
+
additionalProperties: boolean;
|
87
|
+
properties: {
|
88
|
+
type: {
|
89
|
+
type: string;
|
90
|
+
enum: string[];
|
91
|
+
};
|
92
|
+
theme: {
|
93
|
+
type: string;
|
94
|
+
enum: string[];
|
95
|
+
};
|
96
|
+
text: {
|
97
|
+
type: string;
|
98
|
+
contentType: string;
|
99
|
+
};
|
100
|
+
};
|
101
|
+
};
|
102
|
+
controls: {
|
103
|
+
type: string;
|
104
|
+
enum: string[];
|
105
|
+
};
|
106
|
+
};
|
107
|
+
};
|
108
|
+
youtube: {
|
109
|
+
type: string;
|
110
|
+
};
|
111
|
+
parallax: {
|
112
|
+
type: string;
|
113
|
+
};
|
114
|
+
height: {
|
115
|
+
type: string;
|
116
|
+
};
|
117
|
+
previewImg: {
|
118
|
+
type: string;
|
119
|
+
};
|
120
|
+
dataLens: {
|
121
|
+
oneOf: ({
|
122
|
+
type: string;
|
123
|
+
additionalProperties: boolean;
|
124
|
+
required: string[];
|
125
|
+
properties: {
|
126
|
+
id: {
|
127
|
+
type: string;
|
128
|
+
};
|
129
|
+
theme: {
|
130
|
+
type: string;
|
131
|
+
enum: string[];
|
132
|
+
};
|
133
|
+
};
|
134
|
+
} | {
|
135
|
+
type: string;
|
136
|
+
})[];
|
137
|
+
};
|
138
|
+
paddingTop: {
|
139
|
+
type: string;
|
140
|
+
enum: string[];
|
141
|
+
};
|
142
|
+
paddingBottom: {
|
143
|
+
type: string;
|
144
|
+
enum: string[];
|
145
|
+
};
|
146
|
+
fullWidth: {
|
147
|
+
type: string;
|
148
|
+
};
|
149
|
+
column: {
|
150
|
+
type: string;
|
151
|
+
enum: string[];
|
152
|
+
};
|
153
|
+
anchor: {
|
154
|
+
type: string;
|
155
|
+
additionalProperties: boolean;
|
156
|
+
required: string[];
|
157
|
+
properties: {
|
158
|
+
text: {
|
159
|
+
type: string;
|
160
|
+
contentType: string;
|
161
|
+
};
|
162
|
+
url: {
|
163
|
+
type: string;
|
164
|
+
};
|
165
|
+
};
|
166
|
+
};
|
167
|
+
visible: {
|
168
|
+
type: string;
|
169
|
+
enum: string[];
|
170
|
+
};
|
171
|
+
resetPaddings: {
|
172
|
+
type: string;
|
173
|
+
};
|
174
|
+
context: {
|
175
|
+
type: string;
|
176
|
+
};
|
177
|
+
type: {};
|
178
|
+
when: {};
|
179
|
+
};
|
180
|
+
};
|
181
|
+
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { validators } from '@gravity-ui/page-constructor';
|
2
|
+
import { BlockType } from '../../models/common';
|
3
|
+
import { BlogBlockBase } from '../../schema/common';
|
4
|
+
const { common: { BlockBaseProps, MediaProps }, } = validators;
|
5
|
+
export const Media = {
|
6
|
+
[BlockType.Media]: {
|
7
|
+
type: 'object',
|
8
|
+
additionalProperties: false,
|
9
|
+
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, BlockBaseProps), BlogBlockBase), MediaProps), { text: {
|
10
|
+
type: 'string',
|
11
|
+
contentType: 'text',
|
12
|
+
} }),
|
13
|
+
},
|
14
|
+
};
|
@@ -0,0 +1,49 @@
|
|
1
|
+
export declare const Meta: {
|
2
|
+
"blog-meta-block": {
|
3
|
+
type: string;
|
4
|
+
additionalProperties: boolean;
|
5
|
+
properties: {
|
6
|
+
paddingTop: {
|
7
|
+
type: string;
|
8
|
+
enum: string[];
|
9
|
+
};
|
10
|
+
paddingBottom: {
|
11
|
+
type: string;
|
12
|
+
enum: string[];
|
13
|
+
};
|
14
|
+
fullWidth: {
|
15
|
+
type: string;
|
16
|
+
};
|
17
|
+
column: {
|
18
|
+
type: string;
|
19
|
+
enum: string[];
|
20
|
+
};
|
21
|
+
anchor: {
|
22
|
+
type: string;
|
23
|
+
additionalProperties: boolean;
|
24
|
+
required: string[];
|
25
|
+
properties: {
|
26
|
+
text: {
|
27
|
+
type: string;
|
28
|
+
contentType: string;
|
29
|
+
};
|
30
|
+
url: {
|
31
|
+
type: string;
|
32
|
+
};
|
33
|
+
};
|
34
|
+
};
|
35
|
+
visible: {
|
36
|
+
type: string;
|
37
|
+
enum: string[];
|
38
|
+
};
|
39
|
+
resetPaddings: {
|
40
|
+
type: string;
|
41
|
+
};
|
42
|
+
context: {
|
43
|
+
type: string;
|
44
|
+
};
|
45
|
+
type: {};
|
46
|
+
when: {};
|
47
|
+
};
|
48
|
+
};
|
49
|
+
};
|
@@ -0,0 +1,11 @@
|
|
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 Meta = {
|
6
|
+
[BlockType.Meta]: {
|
7
|
+
type: 'object',
|
8
|
+
additionalProperties: false,
|
9
|
+
properties: Object.assign(Object.assign({}, BlockBaseProps), BlogBlockBase),
|
10
|
+
},
|
11
|
+
};
|
@@ -0,0 +1,49 @@
|
|
1
|
+
export declare const Suggest: {
|
2
|
+
"blog-suggest-block": {
|
3
|
+
type: string;
|
4
|
+
additionalProperties: boolean;
|
5
|
+
properties: {
|
6
|
+
paddingTop: {
|
7
|
+
type: string;
|
8
|
+
enum: string[];
|
9
|
+
};
|
10
|
+
paddingBottom: {
|
11
|
+
type: string;
|
12
|
+
enum: string[];
|
13
|
+
};
|
14
|
+
fullWidth: {
|
15
|
+
type: string;
|
16
|
+
};
|
17
|
+
column: {
|
18
|
+
type: string;
|
19
|
+
enum: string[];
|
20
|
+
};
|
21
|
+
anchor: {
|
22
|
+
type: string;
|
23
|
+
additionalProperties: boolean;
|
24
|
+
required: string[];
|
25
|
+
properties: {
|
26
|
+
text: {
|
27
|
+
type: string;
|
28
|
+
contentType: string;
|
29
|
+
};
|
30
|
+
url: {
|
31
|
+
type: string;
|
32
|
+
};
|
33
|
+
};
|
34
|
+
};
|
35
|
+
visible: {
|
36
|
+
type: string;
|
37
|
+
enum: string[];
|
38
|
+
};
|
39
|
+
resetPaddings: {
|
40
|
+
type: string;
|
41
|
+
};
|
42
|
+
context: {
|
43
|
+
type: string;
|
44
|
+
};
|
45
|
+
type: {};
|
46
|
+
when: {};
|
47
|
+
};
|
48
|
+
};
|
49
|
+
};
|
@@ -0,0 +1,11 @@
|
|
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 Suggest = {
|
6
|
+
[BlockType.Suggest]: {
|
7
|
+
type: 'object',
|
8
|
+
additionalProperties: false,
|
9
|
+
properties: Object.assign(Object.assign({}, BlockBaseProps), BlogBlockBase),
|
10
|
+
},
|
11
|
+
};
|
@@ -0,0 +1,54 @@
|
|
1
|
+
export declare const YFM: {
|
2
|
+
"blog-yfm-block": {
|
3
|
+
type: string;
|
4
|
+
additionalProperties: boolean;
|
5
|
+
required: string[];
|
6
|
+
properties: {
|
7
|
+
text: {
|
8
|
+
type: string;
|
9
|
+
contentType: string;
|
10
|
+
};
|
11
|
+
paddingTop: {
|
12
|
+
type: string;
|
13
|
+
enum: string[];
|
14
|
+
};
|
15
|
+
paddingBottom: {
|
16
|
+
type: string;
|
17
|
+
enum: string[];
|
18
|
+
};
|
19
|
+
fullWidth: {
|
20
|
+
type: string;
|
21
|
+
};
|
22
|
+
column: {
|
23
|
+
type: string;
|
24
|
+
enum: string[];
|
25
|
+
};
|
26
|
+
anchor: {
|
27
|
+
type: string;
|
28
|
+
additionalProperties: boolean;
|
29
|
+
required: string[];
|
30
|
+
properties: {
|
31
|
+
text: {
|
32
|
+
type: string;
|
33
|
+
contentType: string;
|
34
|
+
};
|
35
|
+
url: {
|
36
|
+
type: string;
|
37
|
+
};
|
38
|
+
};
|
39
|
+
};
|
40
|
+
visible: {
|
41
|
+
type: string;
|
42
|
+
enum: string[];
|
43
|
+
};
|
44
|
+
resetPaddings: {
|
45
|
+
type: string;
|
46
|
+
};
|
47
|
+
context: {
|
48
|
+
type: string;
|
49
|
+
};
|
50
|
+
type: {};
|
51
|
+
when: {};
|
52
|
+
};
|
53
|
+
};
|
54
|
+
};
|
@@ -0,0 +1,15 @@
|
|
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 YFM = {
|
6
|
+
[BlockType.YFM]: {
|
7
|
+
type: 'object',
|
8
|
+
additionalProperties: false,
|
9
|
+
required: ['text'],
|
10
|
+
properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), BlogBlockBase), { text: {
|
11
|
+
type: 'string',
|
12
|
+
contentType: 'yfm',
|
13
|
+
} }),
|
14
|
+
},
|
15
|
+
};
|
package/build/esm/index.d.ts
CHANGED
@@ -4,4 +4,5 @@ export { BlogPostPage } from './containers/BlogPostPage/BlogPostPage';
|
|
4
4
|
export { BlogPage } from './containers/BlogPage/BlogPage';
|
5
5
|
export * from './models/common';
|
6
6
|
export * from './models/locale';
|
7
|
+
export * from './schema';
|
7
8
|
export { BREAKPOINTS } from './constants';
|
package/build/esm/index.js
CHANGED
@@ -4,4 +4,5 @@ export { BlogPostPage } from './containers/BlogPostPage/BlogPostPage';
|
|
4
4
|
export { BlogPage } from './containers/BlogPage/BlogPage';
|
5
5
|
export * from './models/common';
|
6
6
|
export * from './models/locale';
|
7
|
+
export * from './schema';
|
7
8
|
export { BREAKPOINTS } from './constants';
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export * from '../blocks/Author/schema';
|
2
|
+
export * from '../blocks/Banner/schema';
|
3
|
+
export * from '../blocks/ColoredText/schema';
|
4
|
+
export * from '../blocks/CTA/schema';
|
5
|
+
export * from '../blocks/Feed/schema';
|
6
|
+
export * from '../blocks/Layout/schema';
|
7
|
+
export * from '../blocks/Media/schema';
|
8
|
+
export * from '../blocks/Meta/schema';
|
9
|
+
export * from '../blocks/Suggest/schema';
|
10
|
+
export * from '../blocks/YFM/schema';
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export * from '../blocks/Author/schema';
|
2
|
+
export * from '../blocks/Banner/schema';
|
3
|
+
export * from '../blocks/ColoredText/schema';
|
4
|
+
export * from '../blocks/CTA/schema';
|
5
|
+
export * from '../blocks/Feed/schema';
|
6
|
+
export * from '../blocks/Layout/schema';
|
7
|
+
export * from '../blocks/Media/schema';
|
8
|
+
export * from '../blocks/Meta/schema';
|
9
|
+
export * from '../blocks/Suggest/schema';
|
10
|
+
export * from '../blocks/YFM/schema';
|
@@ -0,0 +1,28 @@
|
|
1
|
+
export interface ObjectSchema extends Record<string, unknown> {
|
2
|
+
properties: object;
|
3
|
+
}
|
4
|
+
export declare const filteredItem: (itemsSchema: ObjectSchema) => {
|
5
|
+
type: string;
|
6
|
+
properties: {
|
7
|
+
when: {
|
8
|
+
type: string;
|
9
|
+
};
|
10
|
+
};
|
11
|
+
};
|
12
|
+
export declare const BlogBlockBase: {
|
13
|
+
paddingTop: {
|
14
|
+
type: string;
|
15
|
+
enum: string[];
|
16
|
+
};
|
17
|
+
paddingBottom: {
|
18
|
+
type: string;
|
19
|
+
enum: string[];
|
20
|
+
};
|
21
|
+
fullWidth: {
|
22
|
+
type: string;
|
23
|
+
};
|
24
|
+
column: {
|
25
|
+
type: string;
|
26
|
+
enum: string[];
|
27
|
+
};
|
28
|
+
};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
const sizeTypes = ['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl'];
|
2
|
+
export const filteredItem = (itemsSchema) => (Object.assign(Object.assign({}, itemsSchema), { type: 'object', properties: Object.assign({ when: {
|
3
|
+
type: 'string',
|
4
|
+
} }, itemsSchema.properties) }));
|
5
|
+
export const BlogBlockBase = {
|
6
|
+
paddingTop: {
|
7
|
+
type: 'string',
|
8
|
+
enum: sizeTypes,
|
9
|
+
},
|
10
|
+
paddingBottom: {
|
11
|
+
type: 'string',
|
12
|
+
enum: sizeTypes,
|
13
|
+
},
|
14
|
+
fullWidth: {
|
15
|
+
type: 'boolean',
|
16
|
+
},
|
17
|
+
column: {
|
18
|
+
type: 'string',
|
19
|
+
enum: ['left', 'right'],
|
20
|
+
},
|
21
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from '../blocks/Header/schema';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from '../blocks/Header/schema';
|