@micromag/element-visual 0.3.246 → 0.3.251

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/es/index.js CHANGED
@@ -11,7 +11,7 @@ import Video from '@micromag/element-video';
11
11
 
12
12
  var styles = {"container":"micromag-element-visual-container","videoContainer":"micromag-element-visual-videoContainer"};
13
13
 
14
- var _excluded = ["media", "mediaRef", "width", "height", "resolution", "objectFit", "playing", "muted", "shouldLoad", "videoLoop", "videoInitialMuted", "onLoaded", "className", "imageClassName", "videoClassName", "withoutVideo"];
14
+ var _excluded = ["media", "mediaRef", "width", "height", "resolution", "objectFit", "playing", "muted", "shouldLoad", "videoLoop", "videoInitialMuted", "onLoaded", "className", "imageClassName", "videoClassName"];
15
15
  var propTypes = {
16
16
  media: PropTypes.media,
17
17
  mediaRef: PropTypes$1.oneOfType([PropTypes$1.func, PropTypes$1.shape({
@@ -26,7 +26,6 @@ var propTypes = {
26
26
  muted: PropTypes$1.bool,
27
27
  shouldLoad: PropTypes$1.bool,
28
28
  videoLoop: PropTypes$1.bool,
29
- withoutVideo: PropTypes$1.bool,
30
29
  videoInitialMuted: PropTypes$1.bool,
31
30
  onLoaded: PropTypes$1.func,
32
31
  className: PropTypes$1.string,
@@ -44,7 +43,6 @@ var defaultProps = {
44
43
  muted: true,
45
44
  shouldLoad: true,
46
45
  videoLoop: true,
47
- withoutVideo: false,
48
46
  videoInitialMuted: true,
49
47
  onLoaded: null,
50
48
  className: null,
@@ -68,7 +66,6 @@ var Visual = function Visual(_ref) {
68
66
  className = _ref.className,
69
67
  imageClassName = _ref.imageClassName,
70
68
  videoClassName = _ref.videoClassName,
71
- withoutVideo = _ref.withoutVideo,
72
69
  props = _objectWithoutProperties(_ref, _excluded);
73
70
 
74
71
  var _ref2 = media || {},
@@ -86,12 +83,12 @@ var Visual = function Visual(_ref) {
86
83
  });
87
84
  }, [props, media]);
88
85
  var imageElProps = useMemo(function () {
89
- var tmpProps = (!shouldLoad || withoutVideo) && isVideo ? _objectSpread(_objectSpread({}, elProps), {}, {
86
+ var tmpProps = !shouldLoad && isVideo ? _objectSpread(_objectSpread({}, elProps), {}, {
90
87
  media: {
91
88
  url: thumbnailUrl
92
89
  }
93
90
  }) : elProps;
94
- return shouldLoad && !withoutVideo ? _objectSpread(_objectSpread({}, elProps), {}, {
91
+ return shouldLoad ? _objectSpread(_objectSpread({}, elProps), {}, {
95
92
  media: {
96
93
  url: url
97
94
  }
@@ -135,7 +132,7 @@ var Visual = function Visual(_ref) {
135
132
  onParentLoaded(e);
136
133
  }
137
134
  }, []);
138
- return type !== null ? /*#__PURE__*/React.createElement(React.Fragment, null, type === 'image' || !shouldLoad || withoutVideo ? /*#__PURE__*/React.createElement(Image, Object.assign({}, imageElProps, {
135
+ return type !== null ? /*#__PURE__*/React.createElement(React.Fragment, null, type === 'image' || !shouldLoad ? /*#__PURE__*/React.createElement(Image, Object.assign({}, imageElProps, {
139
136
  objectFit: objectFit,
140
137
  width: width,
141
138
  height: height,
@@ -144,7 +141,7 @@ var Visual = function Visual(_ref) {
144
141
  onLoaded: onLoaded,
145
142
  className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
146
143
  imageClassName: imageClassName
147
- })) : null, type === 'video' && shouldLoad && !withoutVideo ? /*#__PURE__*/React.createElement("div", {
144
+ })) : null, type === 'video' && shouldLoad ? /*#__PURE__*/React.createElement("div", {
148
145
  className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
149
146
  style: {
150
147
  width: width,
package/lib/index.js CHANGED
@@ -24,7 +24,7 @@ var Video__default = /*#__PURE__*/_interopDefaultLegacy(Video);
24
24
 
25
25
  var styles = {"container":"micromag-element-visual-container","videoContainer":"micromag-element-visual-videoContainer"};
26
26
 
27
- var _excluded = ["media", "mediaRef", "width", "height", "resolution", "objectFit", "playing", "muted", "shouldLoad", "videoLoop", "videoInitialMuted", "onLoaded", "className", "imageClassName", "videoClassName", "withoutVideo"];
27
+ var _excluded = ["media", "mediaRef", "width", "height", "resolution", "objectFit", "playing", "muted", "shouldLoad", "videoLoop", "videoInitialMuted", "onLoaded", "className", "imageClassName", "videoClassName"];
28
28
  var propTypes = {
29
29
  media: core.PropTypes.media,
30
30
  mediaRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].shape({
@@ -39,7 +39,6 @@ var propTypes = {
39
39
  muted: PropTypes__default["default"].bool,
40
40
  shouldLoad: PropTypes__default["default"].bool,
41
41
  videoLoop: PropTypes__default["default"].bool,
42
- withoutVideo: PropTypes__default["default"].bool,
43
42
  videoInitialMuted: PropTypes__default["default"].bool,
44
43
  onLoaded: PropTypes__default["default"].func,
45
44
  className: PropTypes__default["default"].string,
@@ -57,7 +56,6 @@ var defaultProps = {
57
56
  muted: true,
58
57
  shouldLoad: true,
59
58
  videoLoop: true,
60
- withoutVideo: false,
61
59
  videoInitialMuted: true,
62
60
  onLoaded: null,
63
61
  className: null,
@@ -81,7 +79,6 @@ var Visual = function Visual(_ref) {
81
79
  className = _ref.className,
82
80
  imageClassName = _ref.imageClassName,
83
81
  videoClassName = _ref.videoClassName,
84
- withoutVideo = _ref.withoutVideo,
85
82
  props = _objectWithoutProperties__default["default"](_ref, _excluded);
86
83
 
87
84
  var _ref2 = media || {},
@@ -99,12 +96,12 @@ var Visual = function Visual(_ref) {
99
96
  });
100
97
  }, [props, media]);
101
98
  var imageElProps = React.useMemo(function () {
102
- var tmpProps = (!shouldLoad || withoutVideo) && isVideo ? _objectSpread__default["default"](_objectSpread__default["default"]({}, elProps), {}, {
99
+ var tmpProps = !shouldLoad && isVideo ? _objectSpread__default["default"](_objectSpread__default["default"]({}, elProps), {}, {
103
100
  media: {
104
101
  url: thumbnailUrl
105
102
  }
106
103
  }) : elProps;
107
- return shouldLoad && !withoutVideo ? _objectSpread__default["default"](_objectSpread__default["default"]({}, elProps), {}, {
104
+ return shouldLoad ? _objectSpread__default["default"](_objectSpread__default["default"]({}, elProps), {}, {
108
105
  media: {
109
106
  url: url
110
107
  }
@@ -148,7 +145,7 @@ var Visual = function Visual(_ref) {
148
145
  onParentLoaded(e);
149
146
  }
150
147
  }, []);
151
- return type !== null ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, type === 'image' || !shouldLoad || withoutVideo ? /*#__PURE__*/React__default["default"].createElement(Image__default["default"], Object.assign({}, imageElProps, {
148
+ return type !== null ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, type === 'image' || !shouldLoad ? /*#__PURE__*/React__default["default"].createElement(Image__default["default"], Object.assign({}, imageElProps, {
152
149
  objectFit: objectFit,
153
150
  width: width,
154
151
  height: height,
@@ -157,7 +154,7 @@ var Visual = function Visual(_ref) {
157
154
  onLoaded: onLoaded,
158
155
  className: classNames__default["default"]([styles.container, _defineProperty__default["default"]({}, className, className !== null)]),
159
156
  imageClassName: imageClassName
160
- })) : null, type === 'video' && shouldLoad && !withoutVideo ? /*#__PURE__*/React__default["default"].createElement("div", {
157
+ })) : null, type === 'video' && shouldLoad ? /*#__PURE__*/React__default["default"].createElement("div", {
161
158
  className: classNames__default["default"]([styles.container, _defineProperty__default["default"]({}, className, className !== null)]),
162
159
  style: {
163
160
  width: width,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-visual",
3
- "version": "0.3.246",
3
+ "version": "0.3.251",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -50,9 +50,9 @@
50
50
  "dependencies": {
51
51
  "@babel/runtime": "^7.13.10",
52
52
  "@folklore/size": "^0.1.20",
53
- "@micromag/core": "^0.3.246",
54
- "@micromag/element-image": "^0.3.246",
55
- "@micromag/element-video": "^0.3.246",
53
+ "@micromag/core": "^0.3.251",
54
+ "@micromag/element-image": "^0.3.251",
55
+ "@micromag/element-video": "^0.3.251",
56
56
  "classnames": "^2.2.6",
57
57
  "prop-types": "^15.7.2",
58
58
  "uuid": "^8.3.2"
@@ -60,5 +60,5 @@
60
60
  "publishConfig": {
61
61
  "access": "public"
62
62
  },
63
- "gitHead": "473a4ad55684e54d3f1e62e760792ed6e003f8e7"
63
+ "gitHead": "3b6fb00baaa7f3ab90684a88cbe4c30929b6b27d"
64
64
  }