@gravity-ui/page-constructor 3.0.0-alpha.6 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +16 -1
  3. package/build/cjs/blocks/CardLayout/CardLayout.js +1 -1
  4. package/build/cjs/blocks/CardLayout/schema.d.ts +2 -2
  5. package/build/cjs/blocks/CardLayout/schema.js +1 -1
  6. package/build/cjs/blocks/FilterBlock/FilterBlock.js +9 -13
  7. package/build/cjs/blocks/Header/schema.d.ts +243 -0
  8. package/build/cjs/blocks/HeaderSlider/schema.d.ts +81 -0
  9. package/build/cjs/blocks/Media/schema.d.ts +162 -0
  10. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +81 -0
  11. package/build/cjs/blocks/Slider/Slider.js +1 -1
  12. package/build/cjs/blocks/Tabs/schema.d.ts +81 -0
  13. package/build/cjs/components/FullscreenImage/{FullScreenImage.css → FullscreenImage.css} +13 -13
  14. package/build/cjs/components/FullscreenImage/FullscreenImage.d.ts +3 -3
  15. package/build/cjs/components/FullscreenImage/FullscreenImage.js +7 -7
  16. package/build/cjs/components/FullscreenImage/i18n/index.js +1 -1
  17. package/build/cjs/components/FullscreenMedia/FullscreenMedia.d.ts +9 -0
  18. package/build/cjs/components/FullscreenMedia/{FullScreenMedia.js → FullscreenMedia.js} +5 -5
  19. package/build/cjs/components/Media/FullscreenVideo/FullscreenVideo.d.ts +4 -0
  20. package/build/cjs/components/Media/FullscreenVideo/FullscreenVideo.js +10 -0
  21. package/build/cjs/components/Media/Image/Image.d.ts +1 -0
  22. package/build/cjs/components/Media/Image/Image.js +10 -3
  23. package/build/cjs/components/Media/Media.js +25 -5
  24. package/build/cjs/components/Media/Video/Video.d.ts +1 -1
  25. package/build/cjs/components/VideoBlock/VideoBlock.d.ts +3 -2
  26. package/build/cjs/components/VideoBlock/VideoBlock.js +8 -4
  27. package/build/cjs/components/index.d.ts +1 -1
  28. package/build/cjs/components/index.js +3 -3
  29. package/build/cjs/constructor-items.d.ts +1 -1
  30. package/build/cjs/grid/Col/Col.d.ts +1 -1
  31. package/build/cjs/icons/Fullscreen.d.ts +2 -0
  32. package/build/cjs/icons/{FullScreen.js → Fullscreen.js} +3 -3
  33. package/build/cjs/icons/index.d.ts +1 -1
  34. package/build/cjs/icons/index.js +1 -1
  35. package/build/cjs/models/common.d.ts +2 -1
  36. package/build/cjs/models/common.js +1 -0
  37. package/build/cjs/models/constructor-items/blocks.d.ts +1 -1
  38. package/build/cjs/models/constructor-items/common.d.ts +1 -1
  39. package/build/cjs/models/constructor-items/sub-blocks.d.ts +1 -1
  40. package/build/cjs/schema/validators/common.d.ts +81 -0
  41. package/build/cjs/schema/validators/common.js +6 -0
  42. package/build/cjs/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
  43. package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +4 -4
  44. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +82 -1
  45. package/build/cjs/sub-blocks/LayoutItem/schema.js +1 -1
  46. package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +2 -2
  47. package/build/cjs/sub-blocks/LayoutItem/utils.js +6 -6
  48. package/build/cjs/sub-blocks/MediaCard/schema.d.ts +85 -0
  49. package/build/cjs/sub-blocks/MediaCard/schema.js +1 -1
  50. package/build/esm/blocks/CardLayout/CardLayout.js +1 -1
  51. package/build/esm/blocks/CardLayout/schema.d.ts +2 -2
  52. package/build/esm/blocks/CardLayout/schema.js +1 -1
  53. package/build/esm/blocks/FilterBlock/FilterBlock.js +10 -14
  54. package/build/esm/blocks/Header/schema.d.ts +243 -0
  55. package/build/esm/blocks/HeaderSlider/schema.d.ts +81 -0
  56. package/build/esm/blocks/Media/schema.d.ts +162 -0
  57. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +81 -0
  58. package/build/esm/blocks/Slider/Slider.js +2 -2
  59. package/build/esm/blocks/Tabs/Tabs.js +2 -2
  60. package/build/esm/blocks/Tabs/schema.d.ts +81 -0
  61. package/build/esm/components/FullscreenImage/{FullScreenImage.css → FullscreenImage.css} +13 -13
  62. package/build/esm/components/FullscreenImage/FullscreenImage.d.ts +4 -4
  63. package/build/esm/components/FullscreenImage/FullscreenImage.js +9 -9
  64. package/build/esm/components/FullscreenImage/i18n/index.js +1 -1
  65. package/build/esm/components/FullscreenMedia/FullscreenMedia.d.ts +10 -0
  66. package/build/esm/components/FullscreenMedia/{FullScreenMedia.js → FullscreenMedia.js} +7 -7
  67. package/build/esm/components/Media/FullscreenVideo/FullscreenVideo.d.ts +4 -0
  68. package/build/esm/components/Media/FullscreenVideo/FullscreenVideo.js +7 -0
  69. package/build/esm/components/Media/Image/Image.d.ts +1 -0
  70. package/build/esm/components/Media/Image/Image.js +12 -5
  71. package/build/esm/components/Media/Media.js +25 -5
  72. package/build/esm/components/Media/Video/Video.d.ts +1 -1
  73. package/build/esm/components/VideoBlock/VideoBlock.d.ts +3 -2
  74. package/build/esm/components/VideoBlock/VideoBlock.js +8 -4
  75. package/build/esm/components/index.d.ts +1 -1
  76. package/build/esm/components/index.js +1 -1
  77. package/build/esm/constructor-items.d.ts +1 -1
  78. package/build/esm/grid/Col/Col.d.ts +1 -1
  79. package/build/esm/icons/Fullscreen.d.ts +2 -0
  80. package/build/esm/icons/{FullScreen.js → Fullscreen.js} +1 -1
  81. package/build/esm/icons/index.d.ts +1 -1
  82. package/build/esm/icons/index.js +1 -1
  83. package/build/esm/models/common.d.ts +2 -1
  84. package/build/esm/models/common.js +1 -0
  85. package/build/esm/models/constructor-items/blocks.d.ts +1 -1
  86. package/build/esm/models/constructor-items/common.d.ts +1 -1
  87. package/build/esm/models/constructor-items/sub-blocks.d.ts +1 -1
  88. package/build/esm/schema/validators/common.d.ts +81 -0
  89. package/build/esm/schema/validators/common.js +6 -0
  90. package/build/esm/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
  91. package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +6 -6
  92. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +82 -1
  93. package/build/esm/sub-blocks/LayoutItem/schema.js +1 -1
  94. package/build/esm/sub-blocks/LayoutItem/utils.d.ts +2 -2
  95. package/build/esm/sub-blocks/LayoutItem/utils.js +3 -3
  96. package/build/esm/sub-blocks/MediaCard/schema.d.ts +85 -0
  97. package/build/esm/sub-blocks/MediaCard/schema.js +2 -2
  98. package/package.json +1 -4
  99. package/server/models/common.d.ts +2 -1
  100. package/server/models/common.js +1 -0
  101. package/server/models/constructor-items/blocks.d.ts +1 -1
  102. package/server/models/constructor-items/common.d.ts +1 -1
  103. package/server/models/constructor-items/sub-blocks.d.ts +1 -1
  104. package/build/cjs/components/FullscreenMedia/FullScreenMedia.d.ts +0 -9
  105. package/build/cjs/icons/FullScreen.d.ts +0 -2
  106. package/build/esm/components/FullscreenMedia/FullScreenMedia.d.ts +0 -10
  107. package/build/esm/icons/FullScreen.d.ts +0 -2
  108. /package/build/cjs/components/FullscreenMedia/{FullScreenMedia.css → FullscreenMedia.css} +0 -0
  109. /package/build/esm/components/FullscreenMedia/{FullScreenMedia.css → FullscreenMedia.css} +0 -0
@@ -131,6 +131,87 @@ export declare const Media: {
131
131
  type: string;
132
132
  })[];
133
133
  };
134
+ fullscreen: {
135
+ type: string;
136
+ };
137
+ analyticsEvents: {
138
+ anyOf: ({
139
+ type: string;
140
+ additionalProperties: {
141
+ type: string;
142
+ };
143
+ required: string[];
144
+ properties: {
145
+ name: {
146
+ type: string;
147
+ };
148
+ type: {
149
+ type: string;
150
+ };
151
+ counters: {
152
+ type: string;
153
+ additionalProperties: boolean;
154
+ required: never[];
155
+ properties: {
156
+ include: {
157
+ type: string;
158
+ items: {
159
+ type: string;
160
+ };
161
+ };
162
+ exclude: {
163
+ type: string;
164
+ items: {
165
+ type: string;
166
+ };
167
+ };
168
+ };
169
+ };
170
+ context: {
171
+ type: string;
172
+ };
173
+ };
174
+ } | {
175
+ type: string;
176
+ items: {
177
+ type: string;
178
+ additionalProperties: {
179
+ type: string;
180
+ };
181
+ required: string[];
182
+ properties: {
183
+ name: {
184
+ type: string;
185
+ };
186
+ type: {
187
+ type: string;
188
+ };
189
+ counters: {
190
+ type: string;
191
+ additionalProperties: boolean;
192
+ required: never[];
193
+ properties: {
194
+ include: {
195
+ type: string;
196
+ items: {
197
+ type: string;
198
+ };
199
+ };
200
+ exclude: {
201
+ type: string;
202
+ items: {
203
+ type: string;
204
+ };
205
+ };
206
+ };
207
+ };
208
+ context: {
209
+ type: string;
210
+ };
211
+ };
212
+ };
213
+ })[];
214
+ };
134
215
  };
135
216
  };
136
217
  export declare const MediaBlockBaseProps: {
@@ -608,6 +689,87 @@ export declare const MediaBlock: {
608
689
  type: string;
609
690
  })[];
610
691
  };
692
+ fullscreen: {
693
+ type: string;
694
+ };
695
+ analyticsEvents: {
696
+ anyOf: ({
697
+ type: string;
698
+ additionalProperties: {
699
+ type: string;
700
+ };
701
+ required: string[];
702
+ properties: {
703
+ name: {
704
+ type: string;
705
+ };
706
+ type: {
707
+ type: string;
708
+ };
709
+ counters: {
710
+ type: string;
711
+ additionalProperties: boolean;
712
+ required: never[];
713
+ properties: {
714
+ include: {
715
+ type: string;
716
+ items: {
717
+ type: string;
718
+ };
719
+ };
720
+ exclude: {
721
+ type: string;
722
+ items: {
723
+ type: string;
724
+ };
725
+ };
726
+ };
727
+ };
728
+ context: {
729
+ type: string;
730
+ };
731
+ };
732
+ } | {
733
+ type: string;
734
+ items: {
735
+ type: string;
736
+ additionalProperties: {
737
+ type: string;
738
+ };
739
+ required: string[];
740
+ properties: {
741
+ name: {
742
+ type: string;
743
+ };
744
+ type: {
745
+ type: string;
746
+ };
747
+ counters: {
748
+ type: string;
749
+ additionalProperties: boolean;
750
+ required: never[];
751
+ properties: {
752
+ include: {
753
+ type: string;
754
+ items: {
755
+ type: string;
756
+ };
757
+ };
758
+ exclude: {
759
+ type: string;
760
+ items: {
761
+ type: string;
762
+ };
763
+ };
764
+ };
765
+ };
766
+ context: {
767
+ type: string;
768
+ };
769
+ };
770
+ };
771
+ })[];
772
+ };
611
773
  };
612
774
  };
613
775
  description: {
@@ -146,6 +146,87 @@ export declare const PromoFeaturesItem: {
146
146
  type: string;
147
147
  })[];
148
148
  };
149
+ fullscreen: {
150
+ type: string;
151
+ };
152
+ analyticsEvents: {
153
+ anyOf: ({
154
+ type: string;
155
+ additionalProperties: {
156
+ type: string;
157
+ };
158
+ required: string[];
159
+ properties: {
160
+ name: {
161
+ type: string;
162
+ };
163
+ type: {
164
+ type: string;
165
+ };
166
+ counters: {
167
+ type: string;
168
+ additionalProperties: boolean;
169
+ required: never[];
170
+ properties: {
171
+ include: {
172
+ type: string;
173
+ items: {
174
+ type: string;
175
+ };
176
+ };
177
+ exclude: {
178
+ type: string;
179
+ items: {
180
+ type: string;
181
+ };
182
+ };
183
+ };
184
+ };
185
+ context: {
186
+ type: string;
187
+ };
188
+ };
189
+ } | {
190
+ type: string;
191
+ items: {
192
+ type: string;
193
+ additionalProperties: {
194
+ type: string;
195
+ };
196
+ required: string[];
197
+ properties: {
198
+ name: {
199
+ type: string;
200
+ };
201
+ type: {
202
+ type: string;
203
+ };
204
+ counters: {
205
+ type: string;
206
+ additionalProperties: boolean;
207
+ required: never[];
208
+ properties: {
209
+ include: {
210
+ type: string;
211
+ items: {
212
+ type: string;
213
+ };
214
+ };
215
+ exclude: {
216
+ type: string;
217
+ items: {
218
+ type: string;
219
+ };
220
+ };
221
+ };
222
+ };
223
+ context: {
224
+ type: string;
225
+ };
226
+ };
227
+ };
228
+ })[];
229
+ };
149
230
  };
150
231
  };
151
232
  };
@@ -28,7 +28,7 @@ const SliderBlock = (props) => {
28
28
  const { isServer } = (0, react_1.useContext)(ssrContext_1.SSRContext);
29
29
  const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
30
30
  const [breakpoint, setBreakpoint] = (0, react_1.useState)(constants_1.BREAKPOINTS.xl);
31
- const [disclosedChildren] = (0, react_1.useState)(() => discloseAllNestedChildren(children));
31
+ const disclosedChildren = (0, react_1.useMemo)(() => discloseAllNestedChildren(children), [children]);
32
32
  const childrenCount = disclosedChildren.length;
33
33
  const [slidesToShow] = (0, react_1.useState)((0, utils_2.getSlidesToShowWithDefaults)({
34
34
  contentLength: childrenCount,
@@ -142,6 +142,87 @@ export declare const tabsItem: {
142
142
  type: string;
143
143
  })[];
144
144
  };
145
+ fullscreen: {
146
+ type: string;
147
+ };
148
+ analyticsEvents: {
149
+ anyOf: ({
150
+ type: string;
151
+ additionalProperties: {
152
+ type: string;
153
+ };
154
+ required: string[];
155
+ properties: {
156
+ name: {
157
+ type: string;
158
+ };
159
+ type: {
160
+ type: string;
161
+ };
162
+ counters: {
163
+ type: string;
164
+ additionalProperties: boolean;
165
+ required: never[];
166
+ properties: {
167
+ include: {
168
+ type: string;
169
+ items: {
170
+ type: string;
171
+ };
172
+ };
173
+ exclude: {
174
+ type: string;
175
+ items: {
176
+ type: string;
177
+ };
178
+ };
179
+ };
180
+ };
181
+ context: {
182
+ type: string;
183
+ };
184
+ };
185
+ } | {
186
+ type: string;
187
+ items: {
188
+ type: string;
189
+ additionalProperties: {
190
+ type: string;
191
+ };
192
+ required: string[];
193
+ properties: {
194
+ name: {
195
+ type: string;
196
+ };
197
+ type: {
198
+ type: string;
199
+ };
200
+ counters: {
201
+ type: string;
202
+ additionalProperties: boolean;
203
+ required: never[];
204
+ properties: {
205
+ include: {
206
+ type: string;
207
+ items: {
208
+ type: string;
209
+ };
210
+ };
211
+ exclude: {
212
+ type: string;
213
+ items: {
214
+ type: string;
215
+ };
216
+ };
217
+ };
218
+ };
219
+ context: {
220
+ type: string;
221
+ };
222
+ };
223
+ };
224
+ })[];
225
+ };
145
226
  };
146
227
  } | {
147
228
  type: string;
@@ -1,24 +1,24 @@
1
1
  /* use this for style redefinitions to awoid problems with
2
2
  unpredictable css rules order in build */
3
- .pc-FullScreenImage__image {
3
+ .pc-fullscreen-image__image {
4
4
  cursor: pointer;
5
5
  }
6
- .pc-FullScreenImage__image-wrapper {
6
+ .pc-fullscreen-image__image-wrapper {
7
7
  position: relative;
8
8
  }
9
- .pc-FullScreenImage__modal-content {
9
+ .pc-fullscreen-image__modal-content {
10
10
  position: relative;
11
11
  }
12
- .pc-FullScreenImage__modal-image {
12
+ .pc-fullscreen-image__modal-image {
13
13
  display: block;
14
14
  max-width: 1232px;
15
15
  max-height: 70vh;
16
16
  overflow: hidden;
17
17
  }
18
- .pc-FullScreenImage__modal .yc-modal__content, .pc-FullScreenImage__modal-image {
18
+ .pc-fullscreen-image__modal .yc-modal__content, .pc-fullscreen-image__modal-image {
19
19
  border-radius: var(--pc-border-radius);
20
20
  }
21
- .pc-FullScreenImage__icon-wrapper {
21
+ .pc-fullscreen-image__icon-wrapper {
22
22
  display: flex;
23
23
  align-items: center;
24
24
  justify-content: center;
@@ -33,28 +33,28 @@ unpredictable css rules order in build */
33
33
  opacity: 0;
34
34
  transition: 0.3s;
35
35
  }
36
- .pc-FullScreenImage__icon-wrapper_visible {
36
+ .pc-fullscreen-image__icon-wrapper_visible {
37
37
  opacity: 1;
38
38
  }
39
- .pc-FullScreenImage__icon {
39
+ .pc-fullscreen-image__icon {
40
40
  color: var(--yc-color-text-hint);
41
41
  }
42
- .pc-FullScreenImage__icon_hover:hover {
42
+ .pc-fullscreen-image__icon_hover:hover {
43
43
  color: var(--yc-color-text-secondary);
44
44
  }
45
45
  @media (max-width: 1185px) {
46
- .pc-FullScreenImage__modal-image {
46
+ .pc-fullscreen-image__modal-image {
47
47
  width: 100%;
48
48
  }
49
49
  }
50
50
  @media (max-width: 1081px) {
51
- .pc-FullScreenImage__image {
51
+ .pc-fullscreen-image__image {
52
52
  pointer-events: none;
53
53
  }
54
- .pc-FullScreenImage__icon-wrapper {
54
+ .pc-fullscreen-image__icon-wrapper {
55
55
  display: none;
56
56
  }
57
- .pc-FullScreenImage__modal {
57
+ .pc-fullscreen-image__modal {
58
58
  display: none !important; /* stylelint-disable-line declaration-no-important */
59
59
  }
60
60
  }
@@ -1,9 +1,9 @@
1
1
  import { CSSProperties } from 'react';
2
2
  import { ImageProps } from '../Image/Image';
3
- export interface FullScreenImageProps extends ImageProps {
3
+ export interface FullscreenImageProps extends ImageProps {
4
4
  imageClassName?: string;
5
5
  modalImageClass?: string;
6
6
  imageStyle?: CSSProperties;
7
7
  }
8
- declare const FullScreenImage: (props: FullScreenImageProps) => JSX.Element;
9
- export default FullScreenImage;
8
+ declare const FullscreenImage: (props: FullscreenImageProps) => JSX.Element;
9
+ export default FullscreenImage;
@@ -7,26 +7,26 @@ const icons_1 = require("../../icons");
7
7
  const utils_1 = require("../../utils");
8
8
  const Image_1 = tslib_1.__importDefault(require("../Image/Image"));
9
9
  const i18n_1 = tslib_1.__importDefault(require("./i18n"));
10
- const b = (0, utils_1.block)('FullScreenImage');
10
+ const b = (0, utils_1.block)('fullscreen-image');
11
11
  const FULL_SCREEN_ICON_SIZE = 18;
12
12
  const CLOSE_ICON_SIZE = 30;
13
- const FullScreenImage = (props) => {
13
+ const FullscreenImage = (props) => {
14
14
  const { imageClassName, modalImageClass, imageStyle, alt = (0, i18n_1.default)('img-alt') } = props;
15
15
  const [isOpened, setIsOpened] = (0, react_1.useState)(false);
16
16
  const [isMouseEnter, setIsMouseEnter] = (0, react_1.useState)(false);
17
17
  const openModal = () => setIsOpened(true);
18
18
  const closeModal = () => setIsOpened(false);
19
- const showFullScreenIcon = () => setIsMouseEnter(true);
20
- const hideFullScreenIcon = () => setIsMouseEnter(false);
19
+ const showFullscreenIcon = () => setIsMouseEnter(true);
20
+ const hideFullscreenIcon = () => setIsMouseEnter(false);
21
21
  return (react_1.default.createElement("div", { className: b() },
22
- react_1.default.createElement("div", { className: b('image-wrapper'), onMouseEnter: showFullScreenIcon, onMouseLeave: hideFullScreenIcon },
22
+ react_1.default.createElement("div", { className: b('image-wrapper'), onMouseEnter: showFullscreenIcon, onMouseLeave: hideFullscreenIcon },
23
23
  react_1.default.createElement(Image_1.default, Object.assign({}, props, { alt: alt, className: b('image', imageClassName), onClick: openModal, style: imageStyle })),
24
24
  react_1.default.createElement("div", { className: b('icon-wrapper', { visible: isMouseEnter }), onClick: openModal },
25
- react_1.default.createElement(uikit_1.Icon, { data: icons_1.FullScreen, width: FULL_SCREEN_ICON_SIZE, height: FULL_SCREEN_ICON_SIZE, className: b('icon') }))),
25
+ react_1.default.createElement(uikit_1.Icon, { data: icons_1.Fullscreen, width: FULL_SCREEN_ICON_SIZE, height: FULL_SCREEN_ICON_SIZE, className: b('icon') }))),
26
26
  isOpened && (react_1.default.createElement(uikit_1.Modal, { open: isOpened, onClose: closeModal, className: b('modal') },
27
27
  react_1.default.createElement("div", { className: b('modal-content') },
28
28
  react_1.default.createElement("div", { className: b('icon-wrapper', { visible: true }), onClick: closeModal },
29
29
  react_1.default.createElement(uikit_1.Icon, { data: icons_1.PreviewClose, width: CLOSE_ICON_SIZE, height: CLOSE_ICON_SIZE, className: b('icon', { hover: true }) })),
30
30
  react_1.default.createElement(Image_1.default, Object.assign({}, props, { className: b('modal-image', modalImageClass) })))))));
31
31
  };
32
- exports.default = FullScreenImage;
32
+ exports.default = FullscreenImage;
@@ -4,5 +4,5 @@ const tslib_1 = require("tslib");
4
4
  const registerKeyset_1 = require("../../../utils/registerKeyset");
5
5
  const en_json_1 = tslib_1.__importDefault(require("./en.json"));
6
6
  const ru_json_1 = tslib_1.__importDefault(require("./ru.json"));
7
- const COMPONENT = 'FullScreenImage';
7
+ const COMPONENT = 'FullscreenImage';
8
8
  exports.default = (0, registerKeyset_1.registerKeyset)({ en: en_json_1.default, ru: ru_json_1.default }, COMPONENT);
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { MediaAllProps } from '../Media/Media';
3
+ export type ChildMediaRenderProps = Pick<MediaAllProps, 'fullscreen' | 'imageClassName' | 'videoClassName' | 'youtubeClassName' | 'className'>;
4
+ export interface FullscreenMediaProps {
5
+ showFullscreenIcon?: boolean;
6
+ children: (props?: ChildMediaRenderProps) => JSX.Element;
7
+ }
8
+ declare const FullscreenMedia: ({ children, showFullscreenIcon }: FullscreenMediaProps) => JSX.Element;
9
+ export default FullscreenMedia;
@@ -10,7 +10,7 @@ const b = (0, utils_1.block)('full-screen-media');
10
10
  const FULL_SCREEN_ICON_SIZE = 18;
11
11
  const CLOSE_ICON_SIZE = 30;
12
12
  const getMediaClass = (type) => b('modal-media', { type });
13
- const FullScreenMedia = ({ children, showFullScreenIcon = true }) => {
13
+ const FullscreenMedia = ({ children, showFullscreenIcon = true }) => {
14
14
  const [isOpened, setIsOpened] = (0, react_1.useState)(false);
15
15
  const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
16
16
  const openModal = (e) => {
@@ -24,8 +24,8 @@ const FullScreenMedia = ({ children, showFullScreenIcon = true }) => {
24
24
  return (react_1.default.createElement("div", { className: b() },
25
25
  react_1.default.createElement("div", { className: b('media-wrapper'), onClickCapture: openModal },
26
26
  children({ className: b('inline-media') }),
27
- showFullScreenIcon && (react_1.default.createElement("div", { className: b('icon-wrapper'), onClickCapture: openModal },
28
- react_1.default.createElement(uikit_1.Icon, { data: icons_1.FullScreen, width: FULL_SCREEN_ICON_SIZE, height: FULL_SCREEN_ICON_SIZE, className: b('icon') })))),
27
+ showFullscreenIcon && (react_1.default.createElement("div", { className: b('icon-wrapper'), onClickCapture: openModal },
28
+ react_1.default.createElement(uikit_1.Icon, { data: icons_1.Fullscreen, width: FULL_SCREEN_ICON_SIZE, height: FULL_SCREEN_ICON_SIZE, className: b('icon') })))),
29
29
  isOpened && (react_1.default.createElement(uikit_1.Modal, { open: isOpened, onClose: closeModal, className: b('modal') },
30
30
  react_1.default.createElement("div", { className: b('modal-content') },
31
31
  react_1.default.createElement("div", { className: b('icon-wrapper', { visible: true }), onClick: closeModal },
@@ -34,7 +34,7 @@ const FullScreenMedia = ({ children, showFullScreenIcon = true }) => {
34
34
  imageClassName: getMediaClass('image'),
35
35
  videoClassName: getMediaClass('video'),
36
36
  youtubeClassName: getMediaClass('youtube'),
37
- fullScreen: true,
37
+ fullscreen: true,
38
38
  }))))));
39
39
  };
40
- exports.default = FullScreenMedia;
40
+ exports.default = FullscreenMedia;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { VideoAllProps } from '../Video/Video';
3
+ declare const FullscreenVideo: React.FC<VideoAllProps>;
4
+ export default FullscreenVideo;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const react_1 = tslib_1.__importDefault(require("react"));
5
+ const FullscreenMedia_1 = tslib_1.__importDefault(require("../../FullscreenMedia/FullscreenMedia"));
6
+ const Video_1 = tslib_1.__importDefault(require("../Video/Video"));
7
+ const FullscreenVideo = (props) => {
8
+ return (react_1.default.createElement(FullscreenMedia_1.default, null, (classNames) => react_1.default.createElement(Video_1.default, Object.assign({}, props, classNames))));
9
+ };
10
+ exports.default = FullscreenVideo;
@@ -2,6 +2,7 @@ import { MediaComponentImageProps } from '../../../models';
2
2
  export interface ImageAdditionProps {
3
3
  imageClassName?: string;
4
4
  isBackground?: boolean;
5
+ fullscreen?: boolean;
5
6
  }
6
7
  interface InnerImageProps {
7
8
  hasVideoFallback: boolean;
@@ -13,7 +13,7 @@ const Image_1 = tslib_1.__importDefault(require("../../Image/Image"));
13
13
  const utils_2 = require("./utils");
14
14
  const b = (0, utils_1.block)('media-component-image');
15
15
  const Image = (props) => {
16
- const { parallax, image, height, imageClassName, isBackground, hasVideoFallback, video } = props;
16
+ const { parallax, image, height, imageClassName, isBackground, hasVideoFallback, video, fullscreen, } = props;
17
17
  const [scrollY, setScrollY] = (0, react_1.useState)(0);
18
18
  const [{ springScrollY }, springSetScrollY] = (0, react_spring_1.useSpring)(() => ({
19
19
  springScrollY: 0,
@@ -34,10 +34,10 @@ const Image = (props) => {
34
34
  parallaxInterpolate = springScrollY.interpolate((value) => `translateY(-${Number(value) / parallaxLevel}px)`);
35
35
  }
36
36
  const imageClass = b('item', { withVideo: Boolean(video) && !hasVideoFallback }, imageClassName);
37
- const imageSlider = (imageArray) => (react_1.default.createElement(Slider_1.default, { slidesToShow: 1, type: models_1.SliderType.MediaCard }, imageArray.map((item) => {
37
+ const renderFullscreenImage = (item) => {
38
38
  const itemData = (0, utils_2.getMediaImage)(item);
39
39
  return (react_1.default.createElement(FullscreenImage_1.default, Object.assign({ key: itemData.alt }, itemData, { imageClassName: imageClass, imageStyle: { height } })));
40
- })));
40
+ };
41
41
  const imageBackground = (oneImage) => {
42
42
  const imageData = (0, utils_2.getMediaImage)(oneImage);
43
43
  return (react_1.default.createElement(react_spring_1.animated.div, { style: { transform: parallaxInterpolate } },
@@ -47,9 +47,16 @@ const Image = (props) => {
47
47
  const imageData = (0, utils_2.getMediaImage)(oneImage);
48
48
  return react_1.default.createElement(Image_1.default, Object.assign({}, imageData, { className: imageClass, style: { height } }));
49
49
  };
50
+ const imageSlider = (imageArray) => {
51
+ const fullscreenItem = fullscreen === undefined || fullscreen;
52
+ return (react_1.default.createElement(Slider_1.default, { slidesToShow: 1, type: models_1.SliderType.MediaCard }, imageArray.map((item) => fullscreenItem ? renderFullscreenImage(item) : imageOnly(item))));
53
+ };
50
54
  if (Array.isArray(image)) {
51
55
  return imageSlider(image);
52
56
  }
57
+ if (fullscreen) {
58
+ return renderFullscreenImage(image);
59
+ }
53
60
  return isBackground ? imageBackground(image) : imageOnly(image);
54
61
  };
55
62
  exports.default = Image;
@@ -6,23 +6,43 @@ const react_1 = tslib_1.__importStar(require("react"));
6
6
  const utils_1 = require("../../utils");
7
7
  const VideoBlock_1 = tslib_1.__importDefault(require("../VideoBlock/VideoBlock"));
8
8
  const DataLens_1 = tslib_1.__importDefault(require("./DataLens/DataLens"));
9
+ const FullscreenVideo_1 = tslib_1.__importDefault(require("./FullscreenVideo/FullscreenVideo"));
9
10
  const Image_1 = tslib_1.__importDefault(require("./Image/Image"));
10
11
  const Video_1 = tslib_1.__importDefault(require("./Video/Video"));
11
12
  const b = (0, utils_1.block)('Media');
12
13
  const Media = (props) => {
13
- const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, fullScreen, analyticsEvents, } = props;
14
+ const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, fullscreen, analyticsEvents, } = props;
14
15
  const { className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, } = props;
15
16
  const [hasVideoFallback, setHasVideoFallback] = (0, react_1.useState)(false);
16
17
  const content = (0, react_1.useMemo)(() => {
17
18
  let result = [];
18
19
  if (image) {
19
- result.push(react_1.default.createElement(Image_1.default, { key: "image", parallax: parallax, image: image, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback }));
20
+ result.push(react_1.default.createElement(Image_1.default, { key: "image", parallax: parallax, image: image, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback, fullscreen: fullscreen }));
20
21
  }
21
22
  if (video) {
22
- result.push(react_1.default.createElement(Video_1.default, { key: "video", video: video, videoClassName: videoClassName, height: height, metrika: metrika, analyticsEvents: analyticsEvents, playVideo: playVideo, previewImg: previewImg, playButton: playButton, customBarControlsClassName: customBarControlsClassName, hasVideoFallback: hasVideoFallback, setHasVideoFallback: setHasVideoFallback }));
23
+ const videoProps = {
24
+ key: 'video',
25
+ video,
26
+ videoClassName,
27
+ height,
28
+ metrika,
29
+ analyticsEvents,
30
+ playVideo,
31
+ previewImg,
32
+ playButton,
33
+ customBarControlsClassName,
34
+ hasVideoFallback,
35
+ setHasVideoFallback,
36
+ };
37
+ if (fullscreen) {
38
+ result.push(react_1.default.createElement(FullscreenVideo_1.default, Object.assign({}, videoProps)));
39
+ }
40
+ else {
41
+ result.push(react_1.default.createElement(Video_1.default, Object.assign({}, videoProps)));
42
+ }
23
43
  }
24
44
  if (youtube) {
25
- result = (react_1.default.createElement(VideoBlock_1.default, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height, fullScreen: fullScreen }));
45
+ result = (react_1.default.createElement(VideoBlock_1.default, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height, fullscreen: fullscreen, analyticsEvents: analyticsEvents }));
26
46
  }
27
47
  if (dataLens) {
28
48
  result = react_1.default.createElement(DataLens_1.default, { dataLens: dataLens });
@@ -46,7 +66,7 @@ const Media = (props) => {
46
66
  playButton,
47
67
  customBarControlsClassName,
48
68
  youtubeClassName,
49
- fullScreen,
69
+ fullscreen,
50
70
  ]);
51
71
  return (react_1.default.createElement("div", { className: b(null, className), style: { backgroundColor: color } }, content));
52
72
  };
@@ -10,6 +10,6 @@ interface InnerVideoProps {
10
10
  setHasVideoFallback: React.Dispatch<boolean>;
11
11
  hasVideoFallback: boolean;
12
12
  }
13
- type VideoAllProps = VideoAdditionProps & MediaComponentVideoProps & InnerVideoProps;
13
+ export type VideoAllProps = VideoAdditionProps & MediaComponentVideoProps & InnerVideoProps;
14
14
  declare const Video: (props: VideoAllProps) => JSX.Element | null;
15
15
  export default Video;