@micromag/element-visual 0.3.816 → 0.3.820

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 (2) hide show
  1. package/es/index.js +6 -2
  2. package/package.json +5 -5
package/es/index.js CHANGED
@@ -12,7 +12,7 @@ import Video from '@micromag/element-video';
12
12
 
13
13
  var styles = {"container":"micromag-element-visual-container","videoContainer":"micromag-element-visual-videoContainer","videoTag":"micromag-element-visual-videoTag","videoTouchOverlay":"micromag-element-visual-videoTouchOverlay"};
14
14
 
15
- var _excluded = ["media", "mediaRef", "width", "height", "resolution", "objectFit", "playing", "muted", "loadingMode", "shouldLoad", "videoLoop", "videoInitialMuted", "onLoaded", "className", "imageClassName", "videoClassName", "withoutVideo", "qualityStartLevel", "onQualityLevelChange"];
15
+ var _excluded = ["media", "mediaRef", "width", "height", "ratio", "resolution", "objectFit", "playing", "muted", "loadingMode", "shouldLoad", "videoLoop", "videoInitialMuted", "onLoaded", "className", "imageClassName", "videoClassName", "withoutVideo", "qualityStartLevel", "onQualityLevelChange"];
16
16
  var propTypes = {
17
17
  media: PropTypes$1.media,
18
18
  mediaRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
@@ -21,6 +21,7 @@ var propTypes = {
21
21
  })]),
22
22
  width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
23
23
  height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
24
+ ratio: PropTypes.number,
24
25
  resolution: PropTypes.number,
25
26
  objectFit: PropTypes$1.objectFit,
26
27
  playing: PropTypes.bool,
@@ -42,6 +43,7 @@ var defaultProps = {
42
43
  mediaRef: null,
43
44
  width: null,
44
45
  height: null,
46
+ ratio: null,
45
47
  resolution: 1,
46
48
  objectFit: null,
47
49
  playing: true,
@@ -63,6 +65,7 @@ var Visual = function Visual(_ref) {
63
65
  mediaRef = _ref.mediaRef,
64
66
  width = _ref.width,
65
67
  height = _ref.height,
68
+ ratio = _ref.ratio,
66
69
  resolution = _ref.resolution,
67
70
  objectFit = _ref.objectFit,
68
71
  playing = _ref.playing,
@@ -160,7 +163,8 @@ var Visual = function Visual(_ref) {
160
163
  className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
161
164
  style: {
162
165
  width: width,
163
- height: height
166
+ height: height,
167
+ aspectRatio: ratio !== null ? "".concat(ratio) : null
164
168
  },
165
169
  ref: refVisible
166
170
  }, /*#__PURE__*/React.createElement("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-visual",
3
- "version": "0.3.816",
3
+ "version": "0.3.820",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -60,9 +60,9 @@
60
60
  "dependencies": {
61
61
  "@babel/runtime": "^7.13.10",
62
62
  "@folklore/size": "^0.1.20",
63
- "@micromag/core": "^0.3.814",
64
- "@micromag/element-image": "^0.3.814",
65
- "@micromag/element-video": "^0.3.816",
63
+ "@micromag/core": "^0.3.820",
64
+ "@micromag/element-image": "^0.3.820",
65
+ "@micromag/element-video": "^0.3.820",
66
66
  "classnames": "^2.2.6",
67
67
  "prop-types": "^15.7.2",
68
68
  "uuid": "^9.0.0"
@@ -71,5 +71,5 @@
71
71
  "access": "public",
72
72
  "registry": "https://registry.npmjs.org/"
73
73
  },
74
- "gitHead": "85a6c6c833b345a90bf74323299ec3500c0099d0"
74
+ "gitHead": "c4ef0ae4055720a367551328e824ad3b111e4c9f"
75
75
  }