@megafon/ui-shared 4.9.1 → 4.10.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.10.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@4.9.1...@megafon/ui-shared@4.10.0) (2023-01-23)
7
+
8
+
9
+ ### Features
10
+
11
+ * **videoblock:** add props fixWhiteVideoBackground ([0bd622a](https://github.com/MegafonWebLab/megafon-ui/commit/0bd622af335fff8f6ee43fb53cdc9d162ef906c6))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [4.9.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@4.9.0...@megafon/ui-shared@4.9.1) (2023-01-17)
7
18
 
8
19
  **Note:** Version bump only for package @megafon/ui-shared
@@ -78,6 +78,10 @@ h5 {
78
78
  -o-object-fit: contain;
79
79
  object-fit: contain;
80
80
  }
81
+ .mfui-video-block__video_fix-background {
82
+ -webkit-filter: brightness(108.5%);
83
+ filter: brightness(108.5%);
84
+ }
81
85
  .mfui-video-block__youtube {
82
86
  position: relative;
83
87
  padding-bottom: 56.25%;
@@ -51,6 +51,8 @@ export interface IVideoBlockProps {
51
51
  contentPositionRight?: boolean;
52
52
  /** Воспроизводит видео на iOS устройствах без перехода в полноэкранный режим */
53
53
  playsinline?: boolean;
54
+ /** Фикс для белого фона */
55
+ fixWhiteVideoBackground?: boolean;
54
56
  }
55
57
  declare const VideoBlock: React.FC<IVideoBlockProps>;
56
58
  export default VideoBlock;
@@ -32,7 +32,9 @@ var VideoBlock = function VideoBlock(_ref) {
32
32
  contentPositionRight = _ref$contentPositionR === void 0 ? false : _ref$contentPositionR,
33
33
  poster = _ref.poster,
34
34
  _ref$playsinline = _ref.playsinline,
35
- playsinline = _ref$playsinline === void 0 ? false : _ref$playsinline;
35
+ playsinline = _ref$playsinline === void 0 ? false : _ref$playsinline,
36
+ _ref$fixWhiteVideoBac = _ref.fixWhiteVideoBackground,
37
+ fixWhiteVideoBackground = _ref$fixWhiteVideoBac === void 0 ? false : _ref$fixWhiteVideoBac;
36
38
  var renderVideo = React.useCallback(function () {
37
39
  switch (videoType) {
38
40
  case VideoTypes.YOUTUBE:
@@ -68,7 +70,9 @@ var VideoBlock = function VideoBlock(_ref) {
68
70
  /*#__PURE__*/
69
71
  // eslint-disable-next-line jsx-a11y/media-has-caption
70
72
  React.createElement("video", {
71
- className: cn('video'),
73
+ className: cn('video', {
74
+ 'fix-background': fixWhiteVideoBackground
75
+ }),
72
76
  autoPlay: isAutoplay,
73
77
  muted: isMuted,
74
78
  controls: !isAutoplay,
@@ -87,7 +91,7 @@ var VideoBlock = function VideoBlock(_ref) {
87
91
  return null;
88
92
  }
89
93
  }
90
- }, [videoType, videoSrc, isAutoplay, isMuted, poster, playsinline]);
94
+ }, [videoType, videoSrc, isAutoplay, isMuted, poster, playsinline, fixWhiteVideoBackground]);
91
95
  var renderContent = React.useCallback(function (_ref2) {
92
96
  var title = _ref2.title,
93
97
  description = _ref2.description,
@@ -180,6 +184,7 @@ VideoBlock.propTypes = {
180
184
  isAutoplay: PropTypes.bool,
181
185
  poster: PropTypes.string,
182
186
  playsinline: PropTypes.bool,
183
- contentPositionRight: PropTypes.bool
187
+ contentPositionRight: PropTypes.bool,
188
+ fixWhiteVideoBackground: PropTypes.bool
184
189
  };
185
190
  export default VideoBlock;
@@ -78,6 +78,10 @@ h5 {
78
78
  -o-object-fit: contain;
79
79
  object-fit: contain;
80
80
  }
81
+ .mfui-video-block__video_fix-background {
82
+ -webkit-filter: brightness(108.5%);
83
+ filter: brightness(108.5%);
84
+ }
81
85
  .mfui-video-block__youtube {
82
86
  position: relative;
83
87
  padding-bottom: 56.25%;
@@ -51,6 +51,8 @@ export interface IVideoBlockProps {
51
51
  contentPositionRight?: boolean;
52
52
  /** Воспроизводит видео на iOS устройствах без перехода в полноэкранный режим */
53
53
  playsinline?: boolean;
54
+ /** Фикс для белого фона */
55
+ fixWhiteVideoBackground?: boolean;
54
56
  }
55
57
  declare const VideoBlock: React.FC<IVideoBlockProps>;
56
58
  export default VideoBlock;
@@ -50,7 +50,9 @@ var VideoBlock = function VideoBlock(_ref) {
50
50
  contentPositionRight = _ref$contentPositionR === void 0 ? false : _ref$contentPositionR,
51
51
  poster = _ref.poster,
52
52
  _ref$playsinline = _ref.playsinline,
53
- playsinline = _ref$playsinline === void 0 ? false : _ref$playsinline;
53
+ playsinline = _ref$playsinline === void 0 ? false : _ref$playsinline,
54
+ _ref$fixWhiteVideoBac = _ref.fixWhiteVideoBackground,
55
+ fixWhiteVideoBackground = _ref$fixWhiteVideoBac === void 0 ? false : _ref$fixWhiteVideoBac;
54
56
 
55
57
  var renderVideo = _react["default"].useCallback(function () {
56
58
  switch (videoType) {
@@ -87,7 +89,9 @@ var VideoBlock = function VideoBlock(_ref) {
87
89
  /*#__PURE__*/
88
90
  // eslint-disable-next-line jsx-a11y/media-has-caption
89
91
  _react["default"].createElement("video", {
90
- className: cn('video'),
92
+ className: cn('video', {
93
+ 'fix-background': fixWhiteVideoBackground
94
+ }),
91
95
  autoPlay: isAutoplay,
92
96
  muted: isMuted,
93
97
  controls: !isAutoplay,
@@ -106,7 +110,7 @@ var VideoBlock = function VideoBlock(_ref) {
106
110
  return null;
107
111
  }
108
112
  }
109
- }, [videoType, videoSrc, isAutoplay, isMuted, poster, playsinline]);
113
+ }, [videoType, videoSrc, isAutoplay, isMuted, poster, playsinline, fixWhiteVideoBackground]);
110
114
 
111
115
  var renderContent = _react["default"].useCallback(function (_ref2) {
112
116
  var title = _ref2.title,
@@ -202,7 +206,8 @@ VideoBlock.propTypes = {
202
206
  isAutoplay: _propTypes["default"].bool,
203
207
  poster: _propTypes["default"].string,
204
208
  playsinline: _propTypes["default"].bool,
205
- contentPositionRight: _propTypes["default"].bool
209
+ contentPositionRight: _propTypes["default"].bool,
210
+ fixWhiteVideoBackground: _propTypes["default"].bool
206
211
  };
207
212
  var _default = VideoBlock;
208
213
  exports["default"] = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-shared",
3
- "version": "4.9.1",
3
+ "version": "4.10.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -85,7 +85,7 @@
85
85
  },
86
86
  "dependencies": {
87
87
  "@babel/runtime": "^7.8.4",
88
- "@megafon/ui-core": "^4.11.1",
88
+ "@megafon/ui-core": "^4.11.2",
89
89
  "@megafon/ui-helpers": "^2.4.0",
90
90
  "core-js": "^3.6.4",
91
91
  "htmr": "^0.9.2",
@@ -93,5 +93,5 @@
93
93
  "prop-types": "^15.7.2",
94
94
  "swiper": "^6.5.6"
95
95
  },
96
- "gitHead": "01078516ff26b9bfc237633d30d5a4827cda1dc2"
96
+ "gitHead": "aae2e0e7bf9776c1fa4f7083c668074a40923639"
97
97
  }