@gravity-ui/page-constructor 6.0.0-alpha.3 → 6.0.0-alpha.5
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/README.md +4 -0
- package/build/cjs/blocks/Share/Share.js +5 -1
- package/build/cjs/blocks/Slider/schema.d.ts +20 -2
- package/build/cjs/blocks/Slider/schema.js +12 -1
- package/build/cjs/blocks/SliderOld/schema.d.ts +20 -2
- package/build/cjs/blocks/SliderOld/schema.js +12 -1
- package/build/cjs/blocks/Table/Table.css +4 -3
- package/build/cjs/blocks/Table/Table.js +3 -1
- package/build/cjs/components/Title/TitleItem.css +1 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +1 -1
- package/build/cjs/sub-blocks/BannerCard/BannerCard.css +4 -0
- package/build/cjs/sub-blocks/Content/Content.css +27 -25
- package/build/cjs/text-transform/common.d.ts +4 -3
- package/build/cjs/text-transform/common.js +41 -18
- package/build/cjs/text-transform/config.d.ts +5 -2
- package/build/cjs/text-transform/config.js +84 -43
- package/build/cjs/text-transform/transformers.js +2 -2
- package/build/esm/blocks/Share/Share.js +5 -1
- package/build/esm/blocks/Slider/schema.d.ts +20 -2
- package/build/esm/blocks/Slider/schema.js +12 -1
- package/build/esm/blocks/SliderOld/schema.d.ts +20 -2
- package/build/esm/blocks/SliderOld/schema.js +12 -1
- package/build/esm/blocks/Table/Table.css +4 -3
- package/build/esm/blocks/Table/Table.js +4 -2
- package/build/esm/components/Title/TitleItem.css +1 -0
- package/build/esm/models/constructor-items/blocks.d.ts +1 -1
- package/build/esm/sub-blocks/BannerCard/BannerCard.css +4 -0
- package/build/esm/sub-blocks/Content/Content.css +27 -25
- package/build/esm/text-transform/common.d.ts +4 -3
- package/build/esm/text-transform/common.js +41 -18
- package/build/esm/text-transform/config.d.ts +5 -2
- package/build/esm/text-transform/config.js +85 -44
- package/build/esm/text-transform/transformers.js +2 -2
- package/package.json +1 -1
- package/schema/index.js +1 -1
- package/server/models/constructor-items/blocks.d.ts +1 -1
- package/server/text-transform/common.d.ts +4 -3
- package/server/text-transform/common.js +41 -18
- package/server/text-transform/config.d.ts +5 -2
- package/server/text-transform/config.js +84 -43
- package/server/text-transform/transformers.js +2 -2
- package/widget/index.js +1 -1
|
@@ -6,10 +6,26 @@ exports.config = exports.blockHeaderTransformer = void 0;
|
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const models_1 = require("../models");
|
|
8
8
|
const common_1 = require("./common");
|
|
9
|
-
function
|
|
9
|
+
function parseTableBlockLegend(transformer, content) {
|
|
10
10
|
const legend = content === null || content === void 0 ? void 0 : content.legend;
|
|
11
11
|
return Object.assign(Object.assign({}, (content || {})), { legend: legend && legend.map((string) => transformer(string)) });
|
|
12
12
|
}
|
|
13
|
+
function parseTableBlockContent(transformer, content) {
|
|
14
|
+
const legend = content === null || content === void 0 ? void 0 : content.legend;
|
|
15
|
+
const tableContent = content === null || content === void 0 ? void 0 : content.content;
|
|
16
|
+
return Object.assign(Object.assign({}, (content || {})), { content: tableContent &&
|
|
17
|
+
tableContent.map((row, i) => row.map((cell, j) => {
|
|
18
|
+
if (legend) {
|
|
19
|
+
if (i === 0 || j === 0) {
|
|
20
|
+
return transformer(cell);
|
|
21
|
+
}
|
|
22
|
+
return cell;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return transformer(cell);
|
|
26
|
+
}
|
|
27
|
+
})) });
|
|
28
|
+
}
|
|
13
29
|
function parseFeatures(transformer, items) {
|
|
14
30
|
return items.map((_a) => {
|
|
15
31
|
var { title, text } = _a, rest = tslib_1.__rest(_a, ["title", "text"]);
|
|
@@ -84,8 +100,9 @@ function parseContentLayoutTitle(transformer, content) {
|
|
|
84
100
|
exports.blockHeaderTransformer = [
|
|
85
101
|
{
|
|
86
102
|
fields: ['title'],
|
|
87
|
-
transformer: common_1.
|
|
103
|
+
transformer: common_1.yfmTransformer,
|
|
88
104
|
parser: parseTitle,
|
|
105
|
+
renderInline: true,
|
|
89
106
|
},
|
|
90
107
|
{
|
|
91
108
|
fields: ['description'],
|
|
@@ -96,7 +113,8 @@ exports.config = {
|
|
|
96
113
|
[models_1.SubBlockType.BasicCard]: [
|
|
97
114
|
{
|
|
98
115
|
fields: ['title'],
|
|
99
|
-
transformer: common_1.
|
|
116
|
+
transformer: common_1.yfmTransformer,
|
|
117
|
+
renderInline: true,
|
|
100
118
|
},
|
|
101
119
|
{
|
|
102
120
|
fields: ['text', 'additionalInfo'],
|
|
@@ -105,22 +123,16 @@ exports.config = {
|
|
|
105
123
|
],
|
|
106
124
|
[models_1.SubBlockType.BackgroundCard]: [
|
|
107
125
|
{
|
|
108
|
-
fields: ['text', 'additionalInfo'],
|
|
126
|
+
fields: ['title', 'text', 'additionalInfo'],
|
|
109
127
|
transformer: common_1.yfmTransformer,
|
|
110
|
-
|
|
111
|
-
{
|
|
112
|
-
fields: ['title'],
|
|
113
|
-
transformer: common_1.typografTransformer,
|
|
128
|
+
renderInline: true,
|
|
114
129
|
},
|
|
115
130
|
],
|
|
116
131
|
[models_1.SubBlockType.ImageCard]: [
|
|
117
132
|
{
|
|
118
|
-
fields: ['text', 'additionalInfo'],
|
|
133
|
+
fields: ['title', 'text', 'additionalInfo'],
|
|
119
134
|
transformer: common_1.yfmTransformer,
|
|
120
|
-
|
|
121
|
-
{
|
|
122
|
-
fields: ['title'],
|
|
123
|
-
transformer: common_1.typografTransformer,
|
|
135
|
+
renderInline: true,
|
|
124
136
|
},
|
|
125
137
|
],
|
|
126
138
|
[models_1.SubBlockType.LayoutItem]: [
|
|
@@ -132,7 +144,8 @@ exports.config = {
|
|
|
132
144
|
{
|
|
133
145
|
fields: ['content'],
|
|
134
146
|
parser: parseContentLayoutTitle,
|
|
135
|
-
transformer: common_1.
|
|
147
|
+
transformer: common_1.yfmTransformer,
|
|
148
|
+
renderInline: true,
|
|
136
149
|
},
|
|
137
150
|
{
|
|
138
151
|
fields: ['metaInfo'],
|
|
@@ -142,26 +155,30 @@ exports.config = {
|
|
|
142
155
|
],
|
|
143
156
|
[models_1.SubBlockType.Quote]: [
|
|
144
157
|
{
|
|
145
|
-
fields: ['text'],
|
|
146
|
-
transformer: common_1.typografTransformer,
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
fields: ['yfmText'],
|
|
158
|
+
fields: ['text', 'yfmText'],
|
|
150
159
|
transformer: common_1.yfmTransformer,
|
|
160
|
+
renderInline: true,
|
|
151
161
|
},
|
|
152
162
|
],
|
|
153
163
|
[models_1.BlockType.ExtendedFeaturesBlock]: [
|
|
154
164
|
...exports.blockHeaderTransformer,
|
|
155
165
|
{
|
|
156
166
|
fields: ['items'],
|
|
157
|
-
transformer: common_1.
|
|
167
|
+
transformer: common_1.yfmTransformer,
|
|
158
168
|
parser: (0, common_1.createItemsParser)(['title']),
|
|
169
|
+
renderInline: true,
|
|
159
170
|
},
|
|
160
171
|
{
|
|
161
172
|
fields: ['items'],
|
|
162
173
|
transformer: common_1.yfmTransformer,
|
|
163
174
|
parser: (0, common_1.createItemsParser)(['text', 'additionalInfo']),
|
|
164
175
|
},
|
|
176
|
+
{
|
|
177
|
+
fields: ['items'],
|
|
178
|
+
transformer: common_1.yfmTransformer,
|
|
179
|
+
parser: (0, common_1.createItemsParser)(['list.text']),
|
|
180
|
+
renderInline: true,
|
|
181
|
+
},
|
|
165
182
|
],
|
|
166
183
|
[models_1.BlockType.PromoFeaturesBlock]: [
|
|
167
184
|
...exports.blockHeaderTransformer,
|
|
@@ -172,15 +189,13 @@ exports.config = {
|
|
|
172
189
|
},
|
|
173
190
|
],
|
|
174
191
|
[models_1.BlockType.SliderOldBlock]: exports.blockHeaderTransformer,
|
|
192
|
+
[models_1.BlockType.SliderBlock]: exports.blockHeaderTransformer,
|
|
175
193
|
[models_1.BlockType.CompaniesBlock]: exports.blockHeaderTransformer,
|
|
176
194
|
[models_1.BlockType.QuestionsBlock]: [
|
|
177
195
|
{
|
|
178
|
-
fields: ['title'],
|
|
179
|
-
transformer: common_1.typografTransformer,
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
fields: ['text', 'additionalInfo'],
|
|
196
|
+
fields: ['title', 'text', 'additionalInfo'],
|
|
183
197
|
transformer: common_1.yfmTransformer,
|
|
198
|
+
renderInline: true,
|
|
184
199
|
},
|
|
185
200
|
{
|
|
186
201
|
fields: ['items'],
|
|
@@ -191,7 +206,8 @@ exports.config = {
|
|
|
191
206
|
[models_1.BlockType.BannerBlock]: [
|
|
192
207
|
{
|
|
193
208
|
fields: ['title'],
|
|
194
|
-
transformer: common_1.
|
|
209
|
+
transformer: common_1.yfmTransformer,
|
|
210
|
+
renderInline: true,
|
|
195
211
|
},
|
|
196
212
|
{
|
|
197
213
|
fields: ['subtitle'],
|
|
@@ -201,7 +217,8 @@ exports.config = {
|
|
|
201
217
|
[models_1.SubBlockType.BannerCard]: [
|
|
202
218
|
{
|
|
203
219
|
fields: ['title'],
|
|
204
|
-
transformer: common_1.
|
|
220
|
+
transformer: common_1.yfmTransformer,
|
|
221
|
+
renderInline: true,
|
|
205
222
|
},
|
|
206
223
|
{
|
|
207
224
|
fields: ['subtitle'],
|
|
@@ -211,7 +228,7 @@ exports.config = {
|
|
|
211
228
|
[models_1.BlockType.MediaBlock]: [
|
|
212
229
|
...exports.blockHeaderTransformer,
|
|
213
230
|
{
|
|
214
|
-
fields: ['
|
|
231
|
+
fields: ['additionalInfo'],
|
|
215
232
|
transformer: common_1.yfmTransformer,
|
|
216
233
|
},
|
|
217
234
|
{
|
|
@@ -236,27 +253,35 @@ exports.config = {
|
|
|
236
253
|
},
|
|
237
254
|
{
|
|
238
255
|
fields: ['items'],
|
|
239
|
-
transformer: common_1.
|
|
256
|
+
transformer: common_1.yfmTransformer,
|
|
240
257
|
parser: parseItemsTitle,
|
|
258
|
+
renderInline: true,
|
|
241
259
|
},
|
|
242
260
|
],
|
|
243
261
|
[models_1.BlockType.TableBlock]: [
|
|
262
|
+
{
|
|
263
|
+
fields: ['title'],
|
|
264
|
+
transformer: common_1.yfmTransformer,
|
|
265
|
+
renderInline: true,
|
|
266
|
+
},
|
|
244
267
|
{
|
|
245
268
|
fields: ['table'],
|
|
246
269
|
transformer: common_1.yfmTransformer,
|
|
247
|
-
parser:
|
|
270
|
+
parser: parseTableBlockLegend,
|
|
248
271
|
},
|
|
249
|
-
],
|
|
250
|
-
[models_1.BlockType.HeaderSliderBlock]: [
|
|
251
272
|
{
|
|
252
|
-
fields: ['
|
|
253
|
-
transformer: common_1.
|
|
254
|
-
parser:
|
|
273
|
+
fields: ['table'],
|
|
274
|
+
transformer: common_1.yfmTransformer,
|
|
275
|
+
parser: parseTableBlockContent,
|
|
276
|
+
renderInline: true,
|
|
255
277
|
},
|
|
278
|
+
],
|
|
279
|
+
[models_1.BlockType.HeaderSliderBlock]: [
|
|
256
280
|
{
|
|
257
281
|
fields: ['items'],
|
|
258
282
|
transformer: common_1.yfmTransformer,
|
|
259
|
-
parser: (0, common_1.createItemsParser)(['description']),
|
|
283
|
+
parser: (0, common_1.createItemsParser)(['title', 'overtitle', 'description']),
|
|
284
|
+
renderInline: true,
|
|
260
285
|
},
|
|
261
286
|
],
|
|
262
287
|
[models_1.SubBlockType.PriceDetailed]: [
|
|
@@ -270,6 +295,11 @@ exports.config = {
|
|
|
270
295
|
fields: ['description'],
|
|
271
296
|
transformer: common_1.yfmTransformer,
|
|
272
297
|
},
|
|
298
|
+
{
|
|
299
|
+
fields: ['overtitle', 'title'],
|
|
300
|
+
transformer: common_1.yfmTransformer,
|
|
301
|
+
renderInline: true,
|
|
302
|
+
},
|
|
273
303
|
],
|
|
274
304
|
[models_1.BlockType.ContentLayoutBlock]: [
|
|
275
305
|
{
|
|
@@ -279,8 +309,9 @@ exports.config = {
|
|
|
279
309
|
},
|
|
280
310
|
{
|
|
281
311
|
fields: ['textContent'],
|
|
282
|
-
transformer: common_1.
|
|
312
|
+
transformer: common_1.yfmTransformer,
|
|
283
313
|
parser: parseContentLayoutTitle,
|
|
314
|
+
renderInline: true,
|
|
284
315
|
},
|
|
285
316
|
],
|
|
286
317
|
[models_1.SubBlockType.Content]: [
|
|
@@ -290,8 +321,9 @@ exports.config = {
|
|
|
290
321
|
},
|
|
291
322
|
{
|
|
292
323
|
fields: ['title'],
|
|
293
|
-
transformer: common_1.
|
|
324
|
+
transformer: common_1.yfmTransformer,
|
|
294
325
|
parser: parseTitle,
|
|
326
|
+
renderInline: true,
|
|
295
327
|
},
|
|
296
328
|
{
|
|
297
329
|
fields: ['list'],
|
|
@@ -300,6 +332,11 @@ exports.config = {
|
|
|
300
332
|
},
|
|
301
333
|
],
|
|
302
334
|
[models_1.BlockType.InfoBlock]: [
|
|
335
|
+
{
|
|
336
|
+
fields: ['title'],
|
|
337
|
+
transformer: common_1.yfmTransformer,
|
|
338
|
+
renderInline: true,
|
|
339
|
+
},
|
|
303
340
|
{
|
|
304
341
|
fields: ['rightContent', 'leftContent'],
|
|
305
342
|
transformer: common_1.yfmTransformer,
|
|
@@ -307,14 +344,16 @@ exports.config = {
|
|
|
307
344
|
},
|
|
308
345
|
{
|
|
309
346
|
fields: ['rightContent', 'leftContent'],
|
|
310
|
-
transformer: common_1.
|
|
347
|
+
transformer: common_1.yfmTransformer,
|
|
311
348
|
parser: parseContentLayoutTitle,
|
|
349
|
+
renderInline: true,
|
|
312
350
|
},
|
|
313
351
|
],
|
|
314
352
|
[models_1.BlockType.ShareBlock]: [
|
|
315
353
|
{
|
|
316
354
|
fields: ['title'],
|
|
317
|
-
transformer: common_1.
|
|
355
|
+
transformer: common_1.yfmTransformer,
|
|
356
|
+
renderInline: true,
|
|
318
357
|
},
|
|
319
358
|
],
|
|
320
359
|
[models_1.BlockType.CardLayoutBlock]: exports.blockHeaderTransformer,
|
|
@@ -323,12 +362,13 @@ exports.config = {
|
|
|
323
362
|
[models_1.SubBlockType.PriceCard]: [
|
|
324
363
|
{
|
|
325
364
|
fields: ['title'],
|
|
326
|
-
transformer: common_1.
|
|
365
|
+
transformer: common_1.yfmTransformer,
|
|
366
|
+
renderInline: true,
|
|
327
367
|
},
|
|
328
368
|
{
|
|
329
369
|
fields: ['list'],
|
|
330
370
|
transformer: common_1.yfmTransformer,
|
|
331
|
-
parser: (0, common_1.createItemsParser)(['text']),
|
|
371
|
+
parser: (0, common_1.createItemsParser)(['title', 'text']),
|
|
332
372
|
},
|
|
333
373
|
],
|
|
334
374
|
[models_1.BlockType.FormBlock]: [
|
|
@@ -339,8 +379,9 @@ exports.config = {
|
|
|
339
379
|
},
|
|
340
380
|
{
|
|
341
381
|
fields: ['textContent'],
|
|
342
|
-
transformer: common_1.
|
|
382
|
+
transformer: common_1.yfmTransformer,
|
|
343
383
|
parser: parseContentLayoutTitle,
|
|
384
|
+
renderInline: true,
|
|
344
385
|
},
|
|
345
386
|
],
|
|
346
387
|
};
|
|
@@ -22,10 +22,10 @@ function transformBlock(lang, blocksConfig, block, plugins) {
|
|
|
22
22
|
if (blockConfig) {
|
|
23
23
|
const configs = Array.isArray(blockConfig) ? blockConfig : [blockConfig];
|
|
24
24
|
configs.forEach((transformConfig) => {
|
|
25
|
-
const { fields, transformer: transformerRaw, parser } = transformConfig;
|
|
25
|
+
const { fields, transformer: transformerRaw, parser, renderInline } = transformConfig;
|
|
26
26
|
const transformer = (content) =>
|
|
27
27
|
// eslint-disable-next-line no-useless-call
|
|
28
|
-
transformerRaw.call(null, lang, content, { plugins });
|
|
28
|
+
transformerRaw.call(null, lang, content, { plugins, renderInline });
|
|
29
29
|
if (fields) {
|
|
30
30
|
fields.forEach((field) => {
|
|
31
31
|
if (block[field]) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useContext } from 'react';
|
|
2
2
|
import { Button, Icon } from '@gravity-ui/uikit';
|
|
3
|
+
import { YFMWrapper } from '../../components';
|
|
3
4
|
import { LocationContext } from '../../context/locationContext';
|
|
4
5
|
import { useAnalytics } from '../../hooks';
|
|
5
6
|
import { Facebook } from '../../icons/Facebook';
|
|
@@ -24,7 +25,10 @@ const Share = ({ items, title }) => {
|
|
|
24
25
|
const handleAnalytics = useAnalytics(DefaultEventNames.ShareButton);
|
|
25
26
|
const handleButtonClick = useCallback(() => handleAnalytics(), [handleAnalytics]);
|
|
26
27
|
return (React.createElement("div", { className: b() },
|
|
27
|
-
React.createElement("h5", { className: b('title') }, title
|
|
28
|
+
React.createElement("h5", { className: b('title') }, title ? (React.createElement(YFMWrapper, { content: title, modifiers: {
|
|
29
|
+
constructor: true,
|
|
30
|
+
// constructorTheme: textTheme,
|
|
31
|
+
} })) : (i18n('constructor-share'))),
|
|
28
32
|
React.createElement("div", { className: b('items') }, items.map((type) => {
|
|
29
33
|
const url = getAbsolutePath(hostname, pathname);
|
|
30
34
|
const socialUrl = getShareLink(url, type);
|
|
@@ -69,7 +69,16 @@ export declare const SliderProps: {
|
|
|
69
69
|
type: string;
|
|
70
70
|
patternProperties: {
|
|
71
71
|
'.*': {
|
|
72
|
-
|
|
72
|
+
oneOf: ({
|
|
73
|
+
type: string[];
|
|
74
|
+
additionalProperties?: undefined;
|
|
75
|
+
} | {
|
|
76
|
+
type: string;
|
|
77
|
+
additionalProperties: boolean;
|
|
78
|
+
} | {
|
|
79
|
+
type: string;
|
|
80
|
+
additionalProperties?: undefined;
|
|
81
|
+
})[];
|
|
73
82
|
};
|
|
74
83
|
};
|
|
75
84
|
};
|
|
@@ -193,7 +202,16 @@ export declare const SliderBlock: {
|
|
|
193
202
|
type: string;
|
|
194
203
|
patternProperties: {
|
|
195
204
|
'.*': {
|
|
196
|
-
|
|
205
|
+
oneOf: ({
|
|
206
|
+
type: string[];
|
|
207
|
+
additionalProperties?: undefined;
|
|
208
|
+
} | {
|
|
209
|
+
type: string;
|
|
210
|
+
additionalProperties: boolean;
|
|
211
|
+
} | {
|
|
212
|
+
type: string;
|
|
213
|
+
additionalProperties?: undefined;
|
|
214
|
+
})[];
|
|
197
215
|
};
|
|
198
216
|
};
|
|
199
217
|
};
|
|
@@ -18,7 +18,18 @@ const LoadableProps = {
|
|
|
18
18
|
type: 'object',
|
|
19
19
|
patternProperties: {
|
|
20
20
|
'.*': {
|
|
21
|
-
|
|
21
|
+
oneOf: [
|
|
22
|
+
{
|
|
23
|
+
type: ['string', 'number', 'boolean'],
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'object',
|
|
27
|
+
additionalProperties: true,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: 'array',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
22
33
|
},
|
|
23
34
|
},
|
|
24
35
|
},
|
|
@@ -60,7 +60,16 @@ export declare const SliderOldProps: {
|
|
|
60
60
|
type: string;
|
|
61
61
|
patternProperties: {
|
|
62
62
|
'.*': {
|
|
63
|
-
|
|
63
|
+
oneOf: ({
|
|
64
|
+
type: string[];
|
|
65
|
+
additionalProperties?: undefined;
|
|
66
|
+
} | {
|
|
67
|
+
type: string;
|
|
68
|
+
additionalProperties: boolean;
|
|
69
|
+
} | {
|
|
70
|
+
type: string;
|
|
71
|
+
additionalProperties?: undefined;
|
|
72
|
+
})[];
|
|
64
73
|
};
|
|
65
74
|
};
|
|
66
75
|
};
|
|
@@ -176,7 +185,16 @@ export declare const SliderOldBlock: {
|
|
|
176
185
|
type: string;
|
|
177
186
|
patternProperties: {
|
|
178
187
|
'.*': {
|
|
179
|
-
|
|
188
|
+
oneOf: ({
|
|
189
|
+
type: string[];
|
|
190
|
+
additionalProperties?: undefined;
|
|
191
|
+
} | {
|
|
192
|
+
type: string;
|
|
193
|
+
additionalProperties: boolean;
|
|
194
|
+
} | {
|
|
195
|
+
type: string;
|
|
196
|
+
additionalProperties?: undefined;
|
|
197
|
+
})[];
|
|
180
198
|
};
|
|
181
199
|
};
|
|
182
200
|
};
|
|
@@ -18,7 +18,18 @@ const LoadableProps = {
|
|
|
18
18
|
type: 'object',
|
|
19
19
|
patternProperties: {
|
|
20
20
|
'.*': {
|
|
21
|
-
|
|
21
|
+
oneOf: [
|
|
22
|
+
{
|
|
23
|
+
type: ['string', 'number', 'boolean'],
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'object',
|
|
27
|
+
additionalProperties: true,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: 'array',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
22
33
|
},
|
|
23
34
|
},
|
|
24
35
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
.pc-table-block__title {
|
|
1
|
+
.pc-table-block__title.pc-table-block__title {
|
|
2
2
|
margin: 0;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
/* use this for style redefinitions to awoid problems with
|
|
6
6
|
unpredictable css rules order in build */
|
|
7
|
-
.pc-table-block__title {
|
|
7
|
+
.pc-table-block__title.pc-table-block__title {
|
|
8
8
|
font-size: var(--g-text-display-2-font-size);
|
|
9
9
|
line-height: var(--g-text-display-2-line-height);
|
|
10
10
|
color: var(--pc-text-header-color);
|
|
@@ -14,11 +14,12 @@ unpredictable css rules order in build */
|
|
|
14
14
|
margin-right: 32px;
|
|
15
15
|
}
|
|
16
16
|
@media (max-width: 576px) {
|
|
17
|
-
.pc-table-block__title {
|
|
17
|
+
.pc-table-block__title.pc-table-block__title {
|
|
18
18
|
font-size: var(--g-text-display-1-font-size);
|
|
19
19
|
line-height: var(--g-text-display-1-line-height);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
|
|
22
23
|
.pc-table-block__table {
|
|
23
24
|
margin-top: 0;
|
|
24
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Table } from '../../components';
|
|
2
|
+
import { Table, YFMWrapper } from '../../components';
|
|
3
3
|
import { Col, Grid, GridColumnSize, Row } from '../../grid';
|
|
4
4
|
import { block } from '../../utils';
|
|
5
5
|
import './Table.css';
|
|
@@ -10,7 +10,9 @@ export const TableBlock = (props) => {
|
|
|
10
10
|
React.createElement(Grid, { className: b('content') },
|
|
11
11
|
React.createElement(Row, { className: b('row') },
|
|
12
12
|
React.createElement(Col, { sizes: { [GridColumnSize.Md]: 4, [GridColumnSize.All]: 12 } },
|
|
13
|
-
React.createElement("h2",
|
|
13
|
+
React.createElement(YFMWrapper, { tagName: "h2", contentClassName: b('title'), content: title, modifiers: {
|
|
14
|
+
constructor: true,
|
|
15
|
+
} })),
|
|
14
16
|
React.createElement(Col, { sizes: { [GridColumnSize.Md]: 8, [GridColumnSize.All]: 12 } },
|
|
15
17
|
React.createElement(Table, Object.assign({ className: b('table') }, table)))))));
|
|
16
18
|
};
|
|
@@ -50,7 +50,7 @@ export interface LoadableProps {
|
|
|
50
50
|
* @deprecated Will be moved to params
|
|
51
51
|
*/
|
|
52
52
|
serviceId?: number;
|
|
53
|
-
params?: Record<string, string | number | boolean>;
|
|
53
|
+
params?: Record<string, string | number | boolean | object>;
|
|
54
54
|
}
|
|
55
55
|
export interface LoadableChildren {
|
|
56
56
|
loadable?: LoadableProps;
|
|
@@ -16,6 +16,9 @@ unpredictable css rules order in build */
|
|
|
16
16
|
color: var(--g-color-text-light-primary);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
.pc-banner-card__text {
|
|
20
|
+
max-width: 100%;
|
|
21
|
+
}
|
|
19
22
|
.pc-banner-card__title.pc-banner-card__title {
|
|
20
23
|
font-size: var(--g-text-display-2-font-size);
|
|
21
24
|
line-height: var(--g-text-display-2-line-height);
|
|
@@ -57,6 +60,7 @@ unpredictable css rules order in build */
|
|
|
57
60
|
justify-content: space-between;
|
|
58
61
|
flex-direction: column;
|
|
59
62
|
align-items: baseline;
|
|
63
|
+
max-width: 100%;
|
|
60
64
|
}
|
|
61
65
|
.pc-banner-card__subtitle.pc-banner-card__subtitle {
|
|
62
66
|
display: inline-block;
|
|
@@ -81,73 +81,75 @@ unpredictable css rules order in build */
|
|
|
81
81
|
.pc-content_size_l .pc-content__buttons {
|
|
82
82
|
margin-top: 24px;
|
|
83
83
|
}
|
|
84
|
-
.pc-content_theme_dark {
|
|
84
|
+
.pc-content_theme_dark.pc-content_theme_dark {
|
|
85
85
|
--g-color-line-focus: var(--pc-color-line-focus-dark);
|
|
86
86
|
}
|
|
87
|
-
.pc-content_theme_dark .pc-content__title *,
|
|
88
|
-
.pc-content_theme_dark .pc-content__text .yfm,
|
|
89
|
-
.pc-content_theme_dark .pc-content__text .yfm *,
|
|
90
|
-
.pc-content_theme_dark .pc-content__links a {
|
|
87
|
+
.pc-content_theme_dark.pc-content_theme_dark .pc-content__title *,
|
|
88
|
+
.pc-content_theme_dark.pc-content_theme_dark .pc-content__text .yfm,
|
|
89
|
+
.pc-content_theme_dark.pc-content_theme_dark .pc-content__text .yfm *,
|
|
90
|
+
.pc-content_theme_dark.pc-content_theme_dark .pc-content__links a {
|
|
91
91
|
color: var(--g-color-text-light-primary);
|
|
92
92
|
}
|
|
93
|
-
.pc-content_theme_dark .pc-content__notice .yfm,
|
|
94
|
-
.pc-content_theme_dark .pc-content__notice .yfm * {
|
|
93
|
+
.pc-content_theme_dark.pc-content_theme_dark .pc-content__notice .yfm,
|
|
94
|
+
.pc-content_theme_dark.pc-content_theme_dark .pc-content__notice .yfm * {
|
|
95
95
|
color: var(--g-color-text-light-secondary);
|
|
96
96
|
}
|
|
97
|
-
.pc-content_theme_dark .pc-content__notice .yfm a {
|
|
97
|
+
.pc-content_theme_dark.pc-content_theme_dark .pc-content__notice .yfm a {
|
|
98
98
|
color: var(--g-color-text-light-secondary);
|
|
99
99
|
text-decoration: underline;
|
|
100
100
|
}
|
|
101
|
-
.pc-content_theme_dark .pc-content__notice .yfm a:hover {
|
|
101
|
+
.pc-content_theme_dark.pc-content_theme_dark .pc-content__notice .yfm a:hover {
|
|
102
102
|
color: var(--g-color-text-light-primary);
|
|
103
103
|
}
|
|
104
|
-
.pc-content_theme_dark .pc-content__text .yfm a {
|
|
104
|
+
.pc-content_theme_dark.pc-content_theme_dark .pc-content__text .yfm a {
|
|
105
105
|
color: var(--g-color-text-light-primary);
|
|
106
106
|
text-decoration: underline;
|
|
107
107
|
}
|
|
108
|
-
.pc-content_theme_dark .pc-content__text .yfm a:hover {
|
|
108
|
+
.pc-content_theme_dark.pc-content_theme_dark .pc-content__text .yfm a:hover {
|
|
109
109
|
color: var(--g-color-text-light-secondary);
|
|
110
110
|
}
|
|
111
|
-
.pc-content_theme_dark .pc-content__title a {
|
|
111
|
+
.pc-content_theme_dark.pc-content_theme_dark .pc-content__title a {
|
|
112
112
|
color: var(--g-color-text-light-primary);
|
|
113
113
|
text-decoration: underline;
|
|
114
114
|
text-decoration: none;
|
|
115
115
|
}
|
|
116
|
-
.pc-content_theme_dark .pc-content__title a:hover {
|
|
116
|
+
.pc-content_theme_dark.pc-content_theme_dark .pc-content__title a:hover {
|
|
117
117
|
color: var(--g-color-text-light-secondary);
|
|
118
118
|
}
|
|
119
|
-
|
|
120
|
-
.pc-content_theme_light .pc-
|
|
121
|
-
.pc-content_theme_light .pc-content__text .yfm
|
|
122
|
-
.pc-content_theme_light .pc-
|
|
119
|
+
|
|
120
|
+
.pc-content_theme_light.pc-content_theme_light .pc-content__title *,
|
|
121
|
+
.pc-content_theme_light.pc-content_theme_light .pc-content__text .yfm,
|
|
122
|
+
.pc-content_theme_light.pc-content_theme_light .pc-content__text .yfm *,
|
|
123
|
+
.pc-content_theme_light.pc-content_theme_light .pc-content__links a {
|
|
123
124
|
color: var(--g-color-text-dark-primary);
|
|
124
125
|
}
|
|
125
|
-
.pc-content_theme_light .pc-content__notice .yfm,
|
|
126
|
-
.pc-content_theme_light .pc-content__notice .yfm * {
|
|
126
|
+
.pc-content_theme_light.pc-content_theme_light .pc-content__notice .yfm,
|
|
127
|
+
.pc-content_theme_light.pc-content_theme_light .pc-content__notice .yfm * {
|
|
127
128
|
color: var(--g-color-text-dark-secondary);
|
|
128
129
|
}
|
|
129
|
-
.pc-content_theme_light .pc-content__notice .yfm a {
|
|
130
|
+
.pc-content_theme_light.pc-content_theme_light .pc-content__notice .yfm a {
|
|
130
131
|
color: var(--g-color-text-dark-secondary);
|
|
131
132
|
text-decoration: underline;
|
|
132
133
|
}
|
|
133
|
-
.pc-content_theme_light .pc-content__notice .yfm a:hover {
|
|
134
|
+
.pc-content_theme_light.pc-content_theme_light .pc-content__notice .yfm a:hover {
|
|
134
135
|
color: var(--g-color-text-dark-primary);
|
|
135
136
|
}
|
|
136
|
-
.pc-content_theme_light .pc-content__text .yfm a {
|
|
137
|
+
.pc-content_theme_light.pc-content_theme_light .pc-content__text .yfm a {
|
|
137
138
|
color: var(--g-color-text-dark-primary);
|
|
138
139
|
text-decoration: underline;
|
|
139
140
|
}
|
|
140
|
-
.pc-content_theme_light .pc-content__text .yfm a:hover {
|
|
141
|
+
.pc-content_theme_light.pc-content_theme_light .pc-content__text .yfm a:hover {
|
|
141
142
|
color: var(--g-color-text-dark-secondary);
|
|
142
143
|
}
|
|
143
|
-
.pc-content_theme_light .pc-content__title a {
|
|
144
|
+
.pc-content_theme_light.pc-content_theme_light .pc-content__title a {
|
|
144
145
|
color: var(--g-color-text-dark-primary);
|
|
145
146
|
text-decoration: underline;
|
|
146
147
|
text-decoration: none;
|
|
147
148
|
}
|
|
148
|
-
.pc-content_theme_light .pc-content__title a:hover {
|
|
149
|
+
.pc-content_theme_light.pc-content_theme_light .pc-content__title a:hover {
|
|
149
150
|
color: var(--g-color-text-dark-secondary);
|
|
150
151
|
}
|
|
152
|
+
|
|
151
153
|
.pc-content_control-position_bottom .pc-content__notice:has(+ .pc-content__buttons), .pc-content_control-position_bottom .pc-content__notice:has(+ .pc-content__links),
|
|
152
154
|
.pc-content_control-position_bottom .pc-content__list:has(+ .pc-content__buttons),
|
|
153
155
|
.pc-content_control-position_bottom .pc-content__list:has(+ .pc-content__links),
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { MarkdownItPluginCb } from '@diplodoc/transform/lib/plugins/typings';
|
|
2
2
|
import { Lang } from './types';
|
|
3
3
|
export type ComplexItem = {
|
|
4
|
-
[key: string]: string;
|
|
4
|
+
[key: string]: string | object;
|
|
5
5
|
};
|
|
6
6
|
export type Item = string | null | ComplexItem;
|
|
7
7
|
export type Transformer = (text: string) => string;
|
|
8
8
|
export type TransformerRaw = (lang: Lang, content: string, options: {
|
|
9
9
|
plugins: MarkdownItPluginCb[];
|
|
10
|
+
renderInline?: boolean;
|
|
10
11
|
}) => string;
|
|
11
12
|
export type Parser<T = any> = (transformer: Transformer, block: T) => T;
|
|
12
13
|
export declare const createItemsParser: (fields: string[]) => (transformer: Transformer, items: Item[]) => (string | {
|
|
13
|
-
[x: string]: string;
|
|
14
|
+
[x: string]: string | object;
|
|
14
15
|
} | null)[];
|
|
15
16
|
export declare function yfmTransformer(lang: Lang, content: string, options?: {
|
|
16
17
|
plugins?: MarkdownItPluginCb[];
|
|
17
|
-
}): string;
|
|
18
|
+
}, renderInline?: boolean): string;
|
|
18
19
|
export declare function typografTransformer(lang: Lang, content: string): string;
|