@gravity-ui/page-constructor 4.26.0-alpha.0 → 4.27.0-alpha.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.
@@ -16,7 +16,7 @@ const sub_blocks_1 = require("../../sub-blocks");
16
16
  const utils_2 = require("../../utils");
17
17
  const b = (0, utils_2.block)('tabs-block');
18
18
  const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content', contentSize = 's', }) => {
19
- var _a, _b;
19
+ var _a;
20
20
  const [activeTab, setActiveTab] = (0, react_1.useState)(items[0].tabName);
21
21
  const [play, setPlay] = (0, react_1.useState)(false);
22
22
  const theme = (0, theme_1.useTheme)();
@@ -45,7 +45,7 @@ const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered
45
45
  all: grid_1.GridColumnOrderClasses.Last,
46
46
  md: grid_1.GridColumnOrderClasses.First,
47
47
  }, className: b('col', { centered: centered }) },
48
- react_1.default.createElement("div", { ref: ref }, (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (react_1.default.createElement(Media_1.default, Object.assign({}, (0, utils_2.getThemedValue)(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: ((_b = activeTabData.media) === null || _b === void 0 ? void 0 : _b.video) && mediaHeight, imageClassName: b('image') })))),
48
+ react_1.default.createElement("div", { ref: ref }, (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (react_1.default.createElement(Media_1.default, Object.assign({}, (0, utils_2.getThemedValue)(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: mediaHeight })))),
49
49
  imageProps && (react_1.default.createElement(react_1.Fragment, null,
50
50
  react_1.default.createElement(FullscreenImage_1.default, Object.assign({}, imageProps, { imageClassName: b('image') })))),
51
51
  (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && react_1.default.createElement("p", { className: b('caption') }, activeTabData.caption)));
@@ -213,21 +213,19 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
213
213
  }, [changeMute, customControlsType, muted, onPlayClick]);
214
214
  const onFocusIn = (0, react_1.useCallback)(() => setHovered(true), []);
215
215
  const onFocusOut = (0, react_1.useCallback)(() => setHovered(false), []);
216
- const pictureInPictureEnabled = !isMobile || !autoPlay;
216
+ const isPipEnabled = !isMobile || !props.autoplay;
217
217
  return (react_1.default.createElement("div", { className: b({
218
218
  wrapper: !currentHeight,
219
219
  controls,
220
220
  }, className), ref: ref, onClick: handleClick, onMouseEnter: onFocusIn, onMouseLeave: onFocusOut, onFocus: onFocusIn, onBlur: onFocusOut }, isMounted ? (react_1.default.createElement(react_1.Fragment, null,
221
221
  react_1.default.createElement(react_player_1.default, { className: b('player'), url: videoSrc, muted: muted, controls: controls === models_1.MediaVideoControlsType.Default, height: currentHeight || '100%', width: width || '100%', light: previewImgUrl, playing: isPlaying, playIcon: playIcon, progressInterval: FPS, onClickPreview: handleClickPreview, onStart: onStart, onReady: setPlayerRef, onPlay: onPlay, onPause: autoPlay && customControlsType !== models_1.CustomControlsType.WithMuteButton
222
222
  ? undefined
223
- : onPause, onProgress: onProgress, onEnded: onEnded, "aria-label": ariaLabel, pip: pictureInPictureEnabled, playsinline: autoPlay, config: {
223
+ : onPause, onProgress: onProgress, onEnded: onEnded, "aria-label": ariaLabel, config: {
224
224
  file: {
225
225
  attributes: {
226
- pip: pictureInPictureEnabled ? undefined : 'false',
227
- playsinline: autoPlay ? '' : undefined,
228
- disablepictureinpicture: pictureInPictureEnabled
229
- ? undefined
230
- : '',
226
+ pip: isPipEnabled ? undefined : 'false',
227
+ playsinline: isPipEnabled ? undefined : '',
228
+ disablepictureinpicture: isPipEnabled ? undefined : '',
231
229
  },
232
230
  },
233
231
  } }),
@@ -13,7 +13,7 @@ import { block, getThemedValue } from '../../utils';
13
13
  import './Tabs.css';
14
14
  const b = block('tabs-block');
15
15
  export const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content', contentSize = 's', }) => {
16
- var _a, _b;
16
+ var _a;
17
17
  const [activeTab, setActiveTab] = useState(items[0].tabName);
18
18
  const [play, setPlay] = useState(false);
19
19
  const theme = useTheme();
@@ -42,7 +42,7 @@ export const TabsBlock = ({ items, title, description, animated, tabsColSizes, c
42
42
  all: GridColumnOrderClasses.Last,
43
43
  md: GridColumnOrderClasses.First,
44
44
  }, className: b('col', { centered: centered }) },
45
- React.createElement("div", { ref: ref }, (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (React.createElement(Media, Object.assign({}, getThemedValue(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: ((_b = activeTabData.media) === null || _b === void 0 ? void 0 : _b.video) && mediaHeight, imageClassName: b('image') })))),
45
+ React.createElement("div", { ref: ref }, (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (React.createElement(Media, Object.assign({}, getThemedValue(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: mediaHeight })))),
46
46
  imageProps && (React.createElement(Fragment, null,
47
47
  React.createElement(FullscreenImage, Object.assign({}, imageProps, { imageClassName: b('image') })))),
48
48
  (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && React.createElement("p", { className: b('caption') }, activeTabData.caption)));
@@ -210,21 +210,19 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
210
210
  }, [changeMute, customControlsType, muted, onPlayClick]);
211
211
  const onFocusIn = useCallback(() => setHovered(true), []);
212
212
  const onFocusOut = useCallback(() => setHovered(false), []);
213
- const pictureInPictureEnabled = !isMobile || !autoPlay;
213
+ const isPipEnabled = !isMobile || !props.autoplay;
214
214
  return (React.createElement("div", { className: b({
215
215
  wrapper: !currentHeight,
216
216
  controls,
217
217
  }, className), ref: ref, onClick: handleClick, onMouseEnter: onFocusIn, onMouseLeave: onFocusOut, onFocus: onFocusIn, onBlur: onFocusOut }, isMounted ? (React.createElement(Fragment, null,
218
218
  React.createElement(ReactPlayer, { className: b('player'), url: videoSrc, muted: muted, controls: controls === MediaVideoControlsType.Default, height: currentHeight || '100%', width: width || '100%', light: previewImgUrl, playing: isPlaying, playIcon: playIcon, progressInterval: FPS, onClickPreview: handleClickPreview, onStart: onStart, onReady: setPlayerRef, onPlay: onPlay, onPause: autoPlay && customControlsType !== CustomControlsType.WithMuteButton
219
219
  ? undefined
220
- : onPause, onProgress: onProgress, onEnded: onEnded, "aria-label": ariaLabel, pip: pictureInPictureEnabled, playsinline: autoPlay, config: {
220
+ : onPause, onProgress: onProgress, onEnded: onEnded, "aria-label": ariaLabel, config: {
221
221
  file: {
222
222
  attributes: {
223
- pip: pictureInPictureEnabled ? undefined : 'false',
224
- playsinline: autoPlay ? '' : undefined,
225
- disablepictureinpicture: pictureInPictureEnabled
226
- ? undefined
227
- : '',
223
+ pip: isPipEnabled ? undefined : 'false',
224
+ playsinline: isPipEnabled ? undefined : '',
225
+ disablepictureinpicture: isPipEnabled ? undefined : '',
228
226
  },
229
227
  },
230
228
  } }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "4.26.0-alpha.0",
3
+ "version": "4.27.0-alpha.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {