@gravity-ui/page-constructor 5.14.3 → 5.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/build/cjs/blocks/CardLayout/CardLayout.js +3 -1
  2. package/build/cjs/blocks/ContentLayout/ContentLayout.js +4 -1
  3. package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +13 -0
  4. package/build/cjs/blocks/Form/schema.d.ts +13 -0
  5. package/build/cjs/blocks/Header/schema.d.ts +104 -0
  6. package/build/cjs/blocks/HeaderSlider/schema.d.ts +39 -0
  7. package/build/cjs/blocks/Icons/Icons.js +4 -1
  8. package/build/cjs/blocks/Media/schema.d.ts +52 -0
  9. package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +4 -1
  10. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +26 -0
  11. package/build/cjs/blocks/Tabs/schema.d.ts +39 -0
  12. package/build/cjs/components/Author/schema.d.ts +13 -0
  13. package/build/cjs/components/Image/schema.d.ts +13 -0
  14. package/build/cjs/components/Image/schema.js +10 -0
  15. package/build/cjs/editor/components/CodeEditor/CodeEditor.d.ts +2 -1
  16. package/build/cjs/editor/components/CodeEditor/CodeEditor.js +6 -5
  17. package/build/cjs/editor/containers/Editor/hooks/useEditorState.js +1 -1
  18. package/build/cjs/editor/types/index.d.ts +2 -1
  19. package/build/cjs/models/constructor-items/blocks.d.ts +5 -5
  20. package/build/cjs/models/constructor-items/common.d.ts +1 -1
  21. package/build/cjs/models/constructor-items/sub-blocks.d.ts +5 -5
  22. package/build/cjs/navigation/schema.d.ts +13 -0
  23. package/build/cjs/schema/constants.d.ts +91 -0
  24. package/build/cjs/schema/validators/common.d.ts +52 -0
  25. package/build/cjs/sub-blocks/BasicCard/BasicCard.js +4 -1
  26. package/build/cjs/sub-blocks/BasicCard/schema.d.ts +13 -0
  27. package/build/cjs/sub-blocks/Content/schema.d.ts +13 -0
  28. package/build/cjs/sub-blocks/ImageCard/ImageCard.js +4 -1
  29. package/build/cjs/sub-blocks/ImageCard/schema.d.ts +13 -0
  30. package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +2 -1
  31. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +26 -0
  32. package/build/cjs/sub-blocks/MediaCard/schema.d.ts +26 -0
  33. package/build/cjs/sub-blocks/Quote/Quote.js +6 -2
  34. package/build/cjs/sub-blocks/Quote/schema.d.ts +39 -0
  35. package/build/esm/blocks/CardLayout/CardLayout.js +4 -2
  36. package/build/esm/blocks/ContentLayout/ContentLayout.js +5 -2
  37. package/build/esm/blocks/ExtendedFeatures/schema.d.ts +13 -0
  38. package/build/esm/blocks/Form/schema.d.ts +13 -0
  39. package/build/esm/blocks/Header/schema.d.ts +104 -0
  40. package/build/esm/blocks/HeaderSlider/schema.d.ts +39 -0
  41. package/build/esm/blocks/Icons/Icons.js +5 -2
  42. package/build/esm/blocks/Media/schema.d.ts +52 -0
  43. package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +5 -2
  44. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +26 -0
  45. package/build/esm/blocks/Tabs/schema.d.ts +39 -0
  46. package/build/esm/components/Author/schema.d.ts +13 -0
  47. package/build/esm/components/Image/schema.d.ts +13 -0
  48. package/build/esm/components/Image/schema.js +10 -0
  49. package/build/esm/editor/components/CodeEditor/CodeEditor.d.ts +2 -1
  50. package/build/esm/editor/components/CodeEditor/CodeEditor.js +6 -4
  51. package/build/esm/editor/containers/Editor/hooks/useEditorState.js +1 -1
  52. package/build/esm/editor/types/index.d.ts +2 -1
  53. package/build/esm/models/constructor-items/blocks.d.ts +5 -5
  54. package/build/esm/models/constructor-items/common.d.ts +1 -1
  55. package/build/esm/models/constructor-items/sub-blocks.d.ts +5 -5
  56. package/build/esm/navigation/schema.d.ts +13 -0
  57. package/build/esm/schema/constants.d.ts +91 -0
  58. package/build/esm/schema/validators/common.d.ts +52 -0
  59. package/build/esm/sub-blocks/BasicCard/BasicCard.js +5 -2
  60. package/build/esm/sub-blocks/BasicCard/schema.d.ts +13 -0
  61. package/build/esm/sub-blocks/Content/schema.d.ts +13 -0
  62. package/build/esm/sub-blocks/ImageCard/ImageCard.js +5 -2
  63. package/build/esm/sub-blocks/ImageCard/schema.d.ts +13 -0
  64. package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +2 -1
  65. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +26 -0
  66. package/build/esm/sub-blocks/MediaCard/schema.d.ts +26 -0
  67. package/build/esm/sub-blocks/Quote/Quote.js +6 -2
  68. package/build/esm/sub-blocks/Quote/schema.d.ts +39 -0
  69. package/package.json +1 -1
  70. package/server/models/constructor-items/blocks.d.ts +5 -5
  71. package/server/models/constructor-items/common.d.ts +1 -1
  72. package/server/models/constructor-items/sub-blocks.d.ts +5 -5
  73. package/widget/index.js +1 -1
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importDefault(require("react"));
5
5
  const isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
6
6
  const components_1 = require("../../components");
7
+ const theme_1 = require("../../context/theme");
7
8
  const grid_1 = require("../../grid");
8
9
  const utils_1 = require("../../utils");
9
10
  const DEFAULT_SIZES = {
@@ -13,7 +14,8 @@ const DEFAULT_SIZES = {
13
14
  };
14
15
  const b = (0, utils_1.block)('card-layout-block');
15
16
  const CardLayout = ({ title, description, animated, colSizes = DEFAULT_SIZES, children, className, titleClassName, background, }) => {
16
- const _a = background || {}, { border } = _a, backgroundImageProps = tslib_1.__rest(_a, ["border"]);
17
+ const theme = (0, theme_1.useTheme)();
18
+ const _a = (0, utils_1.getThemedValue)(background || {}, theme), { border } = _a, backgroundImageProps = tslib_1.__rest(_a, ["border"]);
17
19
  return (react_1.default.createElement(components_1.AnimateBlock, { className: b(null, className), animate: animated },
18
20
  (title || description) && (react_1.default.createElement(components_1.Title, { title: title, subtitle: description, className: titleClassName })),
19
21
  react_1.default.createElement("div", { className: b('content', {
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
6
  const components_1 = require("../../components");
7
7
  const mobileContext_1 = require("../../context/mobileContext");
8
+ const theme_1 = require("../../context/theme");
8
9
  const grid_1 = require("../../grid");
9
10
  const sub_blocks_1 = require("../../sub-blocks");
10
11
  const utils_1 = require("../../utils");
@@ -33,11 +34,13 @@ const ContentLayoutBlock = (props) => {
33
34
  const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
34
35
  const { textContent, fileContent, size = 'l', background, centered, theme = 'default', textWidth = 'm', } = props;
35
36
  const colSizes = (0, react_1.useMemo)(() => getTextWidth(textWidth), [textWidth]);
37
+ const globalTheme = (0, theme_1.useTheme)();
38
+ const themedBackground = (0, utils_1.getThemedValue)(background, globalTheme);
36
39
  return (react_1.default.createElement("div", { className: b({ size, theme, background: Boolean(background) }) },
37
40
  react_1.default.createElement(sub_blocks_1.Content, Object.assign({ className: b('content') }, textContent, { size: size, centered: centered, colSizes: colSizes, theme: theme })),
38
41
  fileContent && (react_1.default.createElement(grid_1.Col, { className: b('files', { size, centered }), reset: true, sizes: colSizes }, fileContent.map((file) => (react_1.default.createElement(components_1.FileLink, Object.assign({ className: b('file') }, file, { key: file.href, type: "horizontal", textSize: getFileTextSize(size), theme: theme })))))),
39
42
  background && (react_1.default.createElement("div", { className: b('background') },
40
- react_1.default.createElement(components_1.BackgroundImage, Object.assign({ className: b('background-item') }, background, { hide: isMobile }))))));
43
+ react_1.default.createElement(components_1.BackgroundImage, Object.assign({ className: b('background-item') }, themedBackground, { hide: isMobile }))))));
41
44
  };
42
45
  exports.ContentLayoutBlock = ContentLayoutBlock;
43
46
  exports.default = exports.ContentLayoutBlock;
@@ -144,6 +144,19 @@ export declare const ExtendedFeaturesItem: {
144
144
  type: string;
145
145
  pattern: string;
146
146
  optionName: string;
147
+ items?: undefined;
148
+ } | {
149
+ type: string;
150
+ items: {
151
+ type: string;
152
+ properties: {
153
+ when: {
154
+ type: string;
155
+ };
156
+ };
157
+ };
158
+ optionName: string;
159
+ pattern?: undefined;
147
160
  })[];
148
161
  } & {
149
162
  optionName: string;
@@ -185,6 +185,19 @@ export declare const FormBlock: {
185
185
  type: string;
186
186
  pattern: string;
187
187
  optionName: string;
188
+ items?: undefined;
189
+ } | {
190
+ type: string;
191
+ items: {
192
+ type: string;
193
+ properties: {
194
+ when: {
195
+ type: string;
196
+ };
197
+ };
198
+ };
199
+ optionName: string;
200
+ pattern?: undefined;
188
201
  })[];
189
202
  };
190
203
  backgroundColor: {
@@ -26,6 +26,19 @@ export declare const HeaderBackgroundProps: {
26
26
  type: string;
27
27
  pattern: string;
28
28
  optionName: string;
29
+ items?: undefined;
30
+ } | {
31
+ type: string;
32
+ items: {
33
+ type: string;
34
+ properties: {
35
+ when: {
36
+ type: string;
37
+ };
38
+ };
39
+ };
40
+ optionName: string;
41
+ pattern?: undefined;
29
42
  })[];
30
43
  type?: undefined;
31
44
  items?: undefined;
@@ -43,6 +56,19 @@ export declare const HeaderBackgroundProps: {
43
56
  type: string;
44
57
  pattern: string;
45
58
  optionName: string;
59
+ items?: undefined;
60
+ } | {
61
+ type: string;
62
+ items: {
63
+ type: string;
64
+ properties: {
65
+ when: {
66
+ type: string;
67
+ };
68
+ };
69
+ };
70
+ optionName: string;
71
+ pattern?: undefined;
46
72
  })[];
47
73
  };
48
74
  optionName: string;
@@ -327,6 +353,19 @@ export declare const HeaderProperties: {
327
353
  type: string;
328
354
  pattern: string;
329
355
  optionName: string;
356
+ items?: undefined;
357
+ } | {
358
+ type: string;
359
+ items: {
360
+ type: string;
361
+ properties: {
362
+ when: {
363
+ type: string;
364
+ };
365
+ };
366
+ };
367
+ optionName: string;
368
+ pattern?: undefined;
330
369
  })[];
331
370
  } & {
332
371
  optionName: string;
@@ -489,6 +528,19 @@ export declare const HeaderProperties: {
489
528
  type: string;
490
529
  pattern: string;
491
530
  optionName: string;
531
+ items?: undefined;
532
+ } | {
533
+ type: string;
534
+ items: {
535
+ type: string;
536
+ properties: {
537
+ when: {
538
+ type: string;
539
+ };
540
+ };
541
+ };
542
+ optionName: string;
543
+ pattern?: undefined;
492
544
  })[];
493
545
  type?: undefined;
494
546
  items?: undefined;
@@ -506,6 +558,19 @@ export declare const HeaderProperties: {
506
558
  type: string;
507
559
  pattern: string;
508
560
  optionName: string;
561
+ items?: undefined;
562
+ } | {
563
+ type: string;
564
+ items: {
565
+ type: string;
566
+ properties: {
567
+ when: {
568
+ type: string;
569
+ };
570
+ };
571
+ };
572
+ optionName: string;
573
+ pattern?: undefined;
509
574
  })[];
510
575
  };
511
576
  optionName: string;
@@ -839,6 +904,19 @@ export declare const HeaderBlock: {
839
904
  type: string;
840
905
  pattern: string;
841
906
  optionName: string;
907
+ items?: undefined;
908
+ } | {
909
+ type: string;
910
+ items: {
911
+ type: string;
912
+ properties: {
913
+ when: {
914
+ type: string;
915
+ };
916
+ };
917
+ };
918
+ optionName: string;
919
+ pattern?: undefined;
842
920
  })[];
843
921
  } & {
844
922
  optionName: string;
@@ -1001,6 +1079,19 @@ export declare const HeaderBlock: {
1001
1079
  type: string;
1002
1080
  pattern: string;
1003
1081
  optionName: string;
1082
+ items?: undefined;
1083
+ } | {
1084
+ type: string;
1085
+ items: {
1086
+ type: string;
1087
+ properties: {
1088
+ when: {
1089
+ type: string;
1090
+ };
1091
+ };
1092
+ };
1093
+ optionName: string;
1094
+ pattern?: undefined;
1004
1095
  })[];
1005
1096
  type?: undefined;
1006
1097
  items?: undefined;
@@ -1018,6 +1109,19 @@ export declare const HeaderBlock: {
1018
1109
  type: string;
1019
1110
  pattern: string;
1020
1111
  optionName: string;
1112
+ items?: undefined;
1113
+ } | {
1114
+ type: string;
1115
+ items: {
1116
+ type: string;
1117
+ properties: {
1118
+ when: {
1119
+ type: string;
1120
+ };
1121
+ };
1122
+ };
1123
+ optionName: string;
1124
+ pattern?: undefined;
1021
1125
  })[];
1022
1126
  };
1023
1127
  optionName: string;
@@ -55,6 +55,19 @@ export declare const HeaderSliderBlock: {
55
55
  type: string;
56
56
  pattern: string;
57
57
  optionName: string;
58
+ items?: undefined;
59
+ } | {
60
+ type: string;
61
+ items: {
62
+ type: string;
63
+ properties: {
64
+ when: {
65
+ type: string;
66
+ };
67
+ };
68
+ };
69
+ optionName: string;
70
+ pattern?: undefined;
58
71
  })[];
59
72
  } & {
60
73
  optionName: string;
@@ -217,6 +230,19 @@ export declare const HeaderSliderBlock: {
217
230
  type: string;
218
231
  pattern: string;
219
232
  optionName: string;
233
+ items?: undefined;
234
+ } | {
235
+ type: string;
236
+ items: {
237
+ type: string;
238
+ properties: {
239
+ when: {
240
+ type: string;
241
+ };
242
+ };
243
+ };
244
+ optionName: string;
245
+ pattern?: undefined;
220
246
  })[];
221
247
  type?: undefined;
222
248
  items?: undefined;
@@ -234,6 +260,19 @@ export declare const HeaderSliderBlock: {
234
260
  type: string;
235
261
  pattern: string;
236
262
  optionName: string;
263
+ items?: undefined;
264
+ } | {
265
+ type: string;
266
+ items: {
267
+ type: string;
268
+ properties: {
269
+ when: {
270
+ type: string;
271
+ };
272
+ };
273
+ };
274
+ optionName: string;
275
+ pattern?: undefined;
237
276
  })[];
238
277
  };
239
278
  optionName: string;
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  const components_1 = require("../../components");
6
6
  const locationContext_1 = require("../../context/locationContext");
7
+ const theme_1 = require("../../context/theme");
7
8
  const hooks_1 = require("../../hooks");
8
9
  const utils_1 = require("../../utils");
9
10
  const b = (0, utils_1.block)('icons-block');
@@ -13,13 +14,15 @@ const getItemContent = (item) => (react_1.default.createElement(react_1.Fragment
13
14
  const Icons = ({ title, description, size = 's', colSizes = { all: 12 }, items }) => {
14
15
  const { hostname } = (0, react_1.useContext)(locationContext_1.LocationContext);
15
16
  const handleAnalytics = (0, hooks_1.useAnalytics)();
17
+ const theme = (0, theme_1.useTheme)();
16
18
  const onClick = (0, react_1.useCallback)(({ analyticsEvents, url }) => {
17
19
  handleAnalytics(analyticsEvents, { url });
18
20
  }, [handleAnalytics]);
19
21
  return (react_1.default.createElement("div", { className: b({ size }) },
20
22
  (title || description) && (react_1.default.createElement(components_1.Title, { className: b('header'), title: title, subtitle: description, colSizes: colSizes })),
21
23
  items.map((item) => {
22
- const itemContent = getItemContent(item);
24
+ const themedSrc = (0, utils_1.getThemedValue)(item.src, theme);
25
+ const itemContent = getItemContent(Object.assign(Object.assign({}, item), { src: themedSrc }));
23
26
  const { url, text } = item;
24
27
  return url ? (react_1.default.createElement("a", Object.assign({ className: b('item'), key: url, href: url, "aria-label": text, title: text }, (0, utils_1.getLinkProps)(url, hostname), { onClick: () => onClick(item) }), itemContent)) : (react_1.default.createElement("div", { className: b('item'), key: text }, itemContent));
25
28
  })));
@@ -20,6 +20,19 @@ export declare const Media: {
20
20
  type: string;
21
21
  pattern: string;
22
22
  optionName: string;
23
+ items?: undefined;
24
+ } | {
25
+ type: string;
26
+ items: {
27
+ type: string;
28
+ properties: {
29
+ when: {
30
+ type: string;
31
+ };
32
+ };
33
+ };
34
+ optionName: string;
35
+ pattern?: undefined;
23
36
  })[];
24
37
  type?: undefined;
25
38
  items?: undefined;
@@ -37,6 +50,19 @@ export declare const Media: {
37
50
  type: string;
38
51
  pattern: string;
39
52
  optionName: string;
53
+ items?: undefined;
54
+ } | {
55
+ type: string;
56
+ items: {
57
+ type: string;
58
+ properties: {
59
+ when: {
60
+ type: string;
61
+ };
62
+ };
63
+ };
64
+ optionName: string;
65
+ pattern?: undefined;
40
66
  })[];
41
67
  };
42
68
  optionName: string;
@@ -617,6 +643,19 @@ export declare const MediaBlock: {
617
643
  type: string;
618
644
  pattern: string;
619
645
  optionName: string;
646
+ items?: undefined;
647
+ } | {
648
+ type: string;
649
+ items: {
650
+ type: string;
651
+ properties: {
652
+ when: {
653
+ type: string;
654
+ };
655
+ };
656
+ };
657
+ optionName: string;
658
+ pattern?: undefined;
620
659
  })[];
621
660
  type?: undefined;
622
661
  items?: undefined;
@@ -634,6 +673,19 @@ export declare const MediaBlock: {
634
673
  type: string;
635
674
  pattern: string;
636
675
  optionName: string;
676
+ items?: undefined;
677
+ } | {
678
+ type: string;
679
+ items: {
680
+ type: string;
681
+ properties: {
682
+ when: {
683
+ type: string;
684
+ };
685
+ };
686
+ };
687
+ optionName: string;
688
+ pattern?: undefined;
637
689
  })[];
638
690
  };
639
691
  optionName: string;
@@ -9,6 +9,7 @@ const Media_1 = tslib_1.__importDefault(require("../../components/Media/Media"))
9
9
  const Title_1 = tslib_1.__importDefault(require("../../components/Title/Title"));
10
10
  const YFMWrapper_1 = tslib_1.__importDefault(require("../../components/YFMWrapper/YFMWrapper"));
11
11
  const constants_1 = require("../../constants");
12
+ const theme_1 = require("../../context/theme");
12
13
  const utils_1 = require("../../utils");
13
14
  const b = (0, utils_1.block)('PromoFeaturesBlock');
14
15
  const breakpointColumns = {
@@ -19,12 +20,14 @@ const breakpointColumns = {
19
20
  const PromoFeaturesBlock = (props) => {
20
21
  const { items, title, description, theme, animated = true } = props;
21
22
  const backgroundTheme = theme || 'default';
23
+ const globalTheme = (0, theme_1.useTheme)();
22
24
  return (react_1.default.createElement(AnimateBlock_1.default, { className: b({ [backgroundTheme]: true }), animate: animated },
23
25
  react_1.default.createElement(FullWidthBackground_1.default, { className: b('background', { [backgroundTheme]: true }) }),
24
26
  react_1.default.createElement(Title_1.default, { title: title, subtitle: description, className: b('header') }),
25
27
  react_1.default.createElement(BalancedMasonry_1.default, { breakpointCols: breakpointColumns, className: b('card-container'), columnClassName: b('card-container-column') }, items.map(({ title: cardTitle, text, media, theme: cardTheme }, index) => {
26
28
  const blockModifier = backgroundTheme === 'default' ? 'default' : 'light';
27
29
  const themeMod = cardTheme || blockModifier || '';
30
+ const themedMedia = (0, utils_1.getThemedValue)(media, globalTheme);
28
31
  return (react_1.default.createElement("div", { key: index, className: b('card', {
29
32
  'no-media': !media,
30
33
  [themeMod]: Boolean(themeMod),
@@ -33,7 +36,7 @@ const PromoFeaturesBlock = (props) => {
33
36
  react_1.default.createElement("h3", { className: b('card-title') }, cardTitle),
34
37
  react_1.default.createElement("div", { className: b('card-text') },
35
38
  react_1.default.createElement(YFMWrapper_1.default, { content: text, modifiers: { constructor: true } }))),
36
- media && react_1.default.createElement(Media_1.default, Object.assign({ className: b('card-media') }, media))));
39
+ media && react_1.default.createElement(Media_1.default, Object.assign({ className: b('card-media') }, themedMedia))));
37
40
  }))));
38
41
  };
39
42
  exports.default = PromoFeaturesBlock;
@@ -36,6 +36,19 @@ export declare const PromoFeaturesItem: {
36
36
  type: string;
37
37
  pattern: string;
38
38
  optionName: string;
39
+ items?: undefined;
40
+ } | {
41
+ type: string;
42
+ items: {
43
+ type: string;
44
+ properties: {
45
+ when: {
46
+ type: string;
47
+ };
48
+ };
49
+ };
50
+ optionName: string;
51
+ pattern?: undefined;
39
52
  })[];
40
53
  type?: undefined;
41
54
  items?: undefined;
@@ -53,6 +66,19 @@ export declare const PromoFeaturesItem: {
53
66
  type: string;
54
67
  pattern: string;
55
68
  optionName: string;
69
+ items?: undefined;
70
+ } | {
71
+ type: string;
72
+ items: {
73
+ type: string;
74
+ properties: {
75
+ when: {
76
+ type: string;
77
+ };
78
+ };
79
+ };
80
+ optionName: string;
81
+ pattern?: undefined;
56
82
  })[];
57
83
  };
58
84
  optionName: string;
@@ -31,6 +31,19 @@ export declare const tabsItem: {
31
31
  type: string;
32
32
  pattern: string;
33
33
  optionName: string;
34
+ items?: undefined;
35
+ } | {
36
+ type: string;
37
+ items: {
38
+ type: string;
39
+ properties: {
40
+ when: {
41
+ type: string;
42
+ };
43
+ };
44
+ };
45
+ optionName: string;
46
+ pattern?: undefined;
34
47
  })[];
35
48
  type?: undefined;
36
49
  items?: undefined;
@@ -48,6 +61,19 @@ export declare const tabsItem: {
48
61
  type: string;
49
62
  pattern: string;
50
63
  optionName: string;
64
+ items?: undefined;
65
+ } | {
66
+ type: string;
67
+ items: {
68
+ type: string;
69
+ properties: {
70
+ when: {
71
+ type: string;
72
+ };
73
+ };
74
+ };
75
+ optionName: string;
76
+ pattern?: undefined;
51
77
  })[];
52
78
  };
53
79
  optionName: string;
@@ -425,6 +451,19 @@ export declare const tabsItem: {
425
451
  type: string;
426
452
  pattern: string;
427
453
  optionName: string;
454
+ items?: undefined;
455
+ } | {
456
+ type: string;
457
+ items: {
458
+ type: string;
459
+ properties: {
460
+ when: {
461
+ type: string;
462
+ };
463
+ };
464
+ };
465
+ optionName: string;
466
+ pattern?: undefined;
428
467
  })[];
429
468
  } & {
430
469
  optionName: string;
@@ -28,6 +28,19 @@ export declare const author: {
28
28
  type: string;
29
29
  pattern: string;
30
30
  optionName: string;
31
+ items?: undefined;
32
+ } | {
33
+ type: string;
34
+ items: {
35
+ type: string;
36
+ properties: {
37
+ when: {
38
+ type: string;
39
+ };
40
+ };
41
+ };
42
+ optionName: string;
43
+ pattern?: undefined;
31
44
  })[];
32
45
  };
33
46
  description: {
@@ -110,6 +110,19 @@ export declare const ImageProps: {
110
110
  type: string;
111
111
  pattern: string;
112
112
  optionName: string;
113
+ items?: undefined;
114
+ } | {
115
+ type: string;
116
+ items: {
117
+ type: string;
118
+ properties: {
119
+ when: {
120
+ type: string;
121
+ };
122
+ };
123
+ };
124
+ optionName: string;
125
+ pattern?: undefined;
113
126
  })[];
114
127
  };
115
128
  export declare const BackgroundImageProps: {
@@ -53,6 +53,16 @@ exports.ImageProps = {
53
53
  },
54
54
  (0, utils_1.filteredItem)(Object.assign(Object.assign({}, exports.ImageObjectProps), { optionName: 'options' })),
55
55
  (0, utils_1.filteredItem)(Object.assign(Object.assign({}, exports.ImageDeviceProps), { optionName: 'device options' })),
56
+ {
57
+ type: 'array',
58
+ items: (0, utils_1.filteredItem)(Object.assign({}, exports.ImageObjectProps)),
59
+ optionName: 'options list',
60
+ },
61
+ {
62
+ type: 'array',
63
+ items: (0, utils_1.filteredItem)(Object.assign({}, exports.ImageDeviceProps)),
64
+ optionName: 'device options list',
65
+ },
56
66
  ],
57
67
  };
58
68
  exports.BackgroundImageProps = {
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { PageContent } from '../../../models';
2
3
  import { CodeEditorMessageProps } from '../../utils/validation';
3
4
  interface CodeEditorProps {
@@ -8,5 +9,5 @@ interface CodeEditorProps {
8
9
  onChange: (content: PageContent) => void;
9
10
  message?: CodeEditorMessageProps;
10
11
  }
11
- export declare const CodeEditor: ({ onChange, validator, fullscreenModeOn, onFullscreenModeOnUpdate, code, }: CodeEditorProps) => JSX.Element;
12
+ export declare const CodeEditor: React.MemoExoticComponent<({ onChange, validator, fullscreenModeOn, onFullscreenModeOnUpdate, code }: CodeEditorProps) => JSX.Element>;
12
13
  export {};
@@ -13,7 +13,8 @@ const context_1 = require("../../context");
13
13
  const code_1 = require("../../utils/code");
14
14
  const constants_1 = require("./constants");
15
15
  const b = (0, utils_1.block)('code-editor');
16
- const CodeEditor = ({ onChange, validator, fullscreenModeOn, onFullscreenModeOnUpdate, code, }) => {
16
+ const ON_CHANGE_DEBOUNCE_TIMEOUT = 300;
17
+ exports.CodeEditor = react_1.default.memo(({ onChange, validator, fullscreenModeOn, onFullscreenModeOnUpdate, code }) => {
17
18
  const [message, setMessage] = (0, react_1.useState)(() => validator(code));
18
19
  const { theme = models_1.Theme.Light } = (0, react_1.useContext)(context_1.EditorContext);
19
20
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -21,14 +22,14 @@ const CodeEditor = ({ onChange, validator, fullscreenModeOn, onFullscreenModeOnU
21
22
  const validationResult = validator(newCode);
22
23
  setMessage(validationResult);
23
24
  onChange((0, code_1.parseCode)(newCode));
24
- }, 200), [onChange, validator]);
25
+ }, ON_CHANGE_DEBOUNCE_TIMEOUT), [onChange, validator]);
25
26
  return (react_1.default.createElement("div", { className: b({ fullscreen: fullscreenModeOn }) },
26
27
  react_1.default.createElement("div", { className: b('header') },
27
28
  react_1.default.createElement(uikit_1.Button, { view: "flat-secondary", onClick: () => onFullscreenModeOnUpdate(!fullscreenModeOn) },
28
29
  react_1.default.createElement(uikit_1.Icon, { data: fullscreenModeOn ? icons_1.ChevronsCollapseUpRight : icons_1.ChevronsExpandUpRight, size: 16 }))),
29
30
  react_1.default.createElement("div", { className: b('code') },
30
- react_1.default.createElement(react_monaco_editor_1.default, { key: String(fullscreenModeOn), value: code, language: "yaml", options: constants_1.options, onChange: onChangeWithValidation, theme: theme === models_1.Theme.Dark ? 'vs-dark' : 'vs' })),
31
+ react_1.default.createElement(react_monaco_editor_1.default, { key: String(fullscreenModeOn), defaultValue: code, value: code, language: "yaml", options: constants_1.options, onChange: onChangeWithValidation, theme: theme === models_1.Theme.Dark ? 'vs-dark' : 'vs' })),
31
32
  react_1.default.createElement("div", { className: b('footer') }, message && (react_1.default.createElement("div", { className: b('message-container') },
32
33
  react_1.default.createElement("div", { className: b('message', { status: message.status }) }, message.text))))));
33
- };
34
- exports.CodeEditor = CodeEditor;
34
+ });
35
+ exports.CodeEditor.displayName = 'CodeEditor';
@@ -23,7 +23,7 @@ const useEditorState = (_a) => {
23
23
  const isFormEditMode = editMode === types_1.EditModeItem.Form;
24
24
  const isDesktopViewMode = viewMode === types_1.ViewModeItem.Desktop;
25
25
  const isCodeOnlyMode = codeFullscreeModeOn && isCodeEditMode;
26
- const transformedContent = (0, react_1.useMemo)(() => (transformContent ? transformContent(content, { viewMode }) : content), [content, transformContent, viewMode]);
26
+ const transformedContent = (0, react_1.useMemo)(() => (transformContent ? transformContent(content, { viewMode, editMode }) : content), [content, transformContent, viewMode, editMode]);
27
27
  const schema = (0, react_1.useMemo)(() => (0, schema_1.generateDefaultSchema)(customSchema), [customSchema]);
28
28
  const codeValidator = (0, useCodeValidator_1.useCodeValidator)(schema);
29
29
  const outgoingProps = (0, react_1.useMemo)(() => {