@telefonica/mistica 11.6.0 → 11.7.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/dist/image.d.ts CHANGED
@@ -14,7 +14,7 @@ export declare type ImageProps = {
14
14
  /** defaults to 100% when no width and no height are given */
15
15
  width?: string | number;
16
16
  height?: string | number;
17
- /** defaults to 1:1, if both width and height are given, aspectRatio is ignored */
17
+ /** defaults to 1:1, if both width and height are given, aspectRatio is ignored. To use original image proportions, set aspectRatio to 0 */
18
18
  aspectRatio?: AspectRatio | number;
19
19
  /** defaults to empty string */
20
20
  alt?: string;
package/dist/image.js CHANGED
@@ -108,17 +108,18 @@ var useStyles = (0, _jss).createUseStyles(function() {
108
108
  objectFit: "cover",
109
109
  maxWidth: "100%",
110
110
  maxHeight: "100%",
111
+ borderRadius: function borderRadius(param) {
112
+ var noBorderRadius = param.noBorderRadius;
113
+ return noBorderRadius ? 0 : 4;
114
+ },
111
115
  "@supports (aspect-ratio: 1 / 1)": {
112
- borderRadius: function borderRadius(param) {
113
- var noBorderRadius = param.noBorderRadius;
114
- return noBorderRadius ? 0 : 4;
115
- },
116
116
  aspectRatio: function aspectRatio(param) {
117
117
  var aspectRatio1 = param.aspectRatio;
118
118
  return aspectRatio1 !== null && aspectRatio1 !== void 0 ? aspectRatio1 : "unset";
119
119
  }
120
120
  },
121
121
  "$wrapper &": {
122
+ borderRadius: 0,
122
123
  position: "absolute",
123
124
  width: "100%",
124
125
  height: "100%",
@@ -166,9 +167,10 @@ var Image = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
166
167
  var supportsAspectRatio = (0, _aspectRatioSupport).useSupportsAspectRatio();
167
168
  var noBorderRadiusContext = useDisableBorderRadius();
168
169
  var noBorderSetting = noBorderRadius !== null && noBorderRadius !== void 0 ? noBorderRadius : noBorderRadiusContext;
169
- // if width or height are numeric, we can calculate the other with the ratio without css
170
- var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number";
171
170
  var ratio = typeof aspectRatio === "number" ? aspectRatio : RATIO[aspectRatio];
171
+ // if width or height are numeric, we can calculate the other with the ratio without css.
172
+ // if aspect ratio is 0, we use the original image proportions
173
+ var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number" && ratio !== 0;
172
174
  var classes = useStyles({
173
175
  noBorderRadius: noBorderSetting,
174
176
  aspectRatio: withCssAspectRatio ? ratio : undefined,
@@ -19,7 +19,7 @@ export type ImageProps = {
19
19
  width?: string | number,
20
20
  height?: string | number,
21
21
  /**
22
- * defaults to 1:1, if both width and height are given, aspectRatio is ignored
22
+ * defaults to 1:1, if both width and height are given, aspectRatio is ignored. To use original image proportions, set aspectRatio to 0
23
23
  */
24
24
  aspectRatio?: AspectRatio | number,
25
25
  /**
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  exports.PACKAGE_VERSION = void 0;
6
- var PACKAGE_VERSION = "11.6.0";
6
+ var PACKAGE_VERSION = "11.7.0";
7
7
  exports.PACKAGE_VERSION = PACKAGE_VERSION;
package/dist/video.d.ts CHANGED
@@ -15,7 +15,7 @@ export declare type VideoProps = {
15
15
  /** defaults to 100% when no width and no height are given */
16
16
  width?: string | number;
17
17
  height?: string | number;
18
- /** defaults to 1:1, if both width and height are given, aspectRatio is ignored */
18
+ /** defaults to 1:1, if both width and height are given, aspectRatio is ignored. To use original video proportions, set aspectRatio to 0 */
19
19
  aspectRatio?: AspectRatio | number;
20
20
  /** accepts multiple sources */
21
21
  src: string | Array<string> | VideoSource | Array<VideoSource>;
package/dist/video.js CHANGED
@@ -101,17 +101,18 @@ var useStyles = (0, _jss).createUseStyles(function() {
101
101
  objectFit: "cover",
102
102
  maxWidth: "100%",
103
103
  maxHeight: "100%",
104
+ borderRadius: function borderRadius(param) {
105
+ var noBorderRadius = param.noBorderRadius;
106
+ return noBorderRadius ? 0 : 4;
107
+ },
104
108
  "@supports (aspect-ratio: 1 / 1)": {
105
- borderRadius: function borderRadius(param) {
106
- var noBorderRadius = param.noBorderRadius;
107
- return noBorderRadius ? 0 : 4;
108
- },
109
109
  aspectRatio: function aspectRatio(param) {
110
110
  var aspectRatio1 = param.aspectRatio;
111
111
  return aspectRatio1 !== null && aspectRatio1 !== void 0 ? aspectRatio1 : "unset";
112
112
  }
113
113
  },
114
114
  "$wrapper &": {
115
+ borderRadius: 0,
115
116
  position: "absolute",
116
117
  width: "100%",
117
118
  height: "100%",
@@ -155,9 +156,10 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
155
156
  ]);
156
157
  var supportsAspectRatio = (0, _aspectRatioSupport).useSupportsAspectRatio();
157
158
  var noBorderRadius = (0, _image).useDisableBorderRadius();
158
- // if width or height are numeric, we can calculate the other with the ratio without css
159
- var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number";
160
159
  var ratio = typeof aspectRatio === "number" ? aspectRatio : RATIO[aspectRatio];
160
+ // if width or height are numeric, we can calculate the other with the ratio without css
161
+ // if aspect ratio is 0, we use the original video proportions
162
+ var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number" && ratio !== 0;
161
163
  var classes = useStyles({
162
164
  noBorderRadius: noBorderRadius,
163
165
  aspectRatio: withCssAspectRatio ? ratio : undefined,
@@ -20,7 +20,7 @@ export type VideoProps = {
20
20
  width?: string | number,
21
21
  height?: string | number,
22
22
  /**
23
- * defaults to 1:1, if both width and height are given, aspectRatio is ignored
23
+ * defaults to 1:1, if both width and height are given, aspectRatio is ignored. To use original video proportions, set aspectRatio to 0
24
24
  */
25
25
  aspectRatio?: AspectRatio | number,
26
26
  /**
package/dist-es/image.js CHANGED
@@ -79,17 +79,18 @@ var useStyles = createUseStyles(function() {
79
79
  objectFit: "cover",
80
80
  maxWidth: "100%",
81
81
  maxHeight: "100%",
82
+ borderRadius: function(param) {
83
+ var noBorderRadius = param.noBorderRadius;
84
+ return noBorderRadius ? 0 : 4;
85
+ },
82
86
  "@supports (aspect-ratio: 1 / 1)": {
83
- borderRadius: function(param) {
84
- var noBorderRadius = param.noBorderRadius;
85
- return noBorderRadius ? 0 : 4;
86
- },
87
87
  aspectRatio: function(param) {
88
88
  var aspectRatio = param.aspectRatio;
89
89
  return aspectRatio !== null && aspectRatio !== void 0 ? aspectRatio : "unset";
90
90
  }
91
91
  },
92
92
  "$wrapper &": {
93
+ borderRadius: 0,
93
94
  position: "absolute",
94
95
  width: "100%",
95
96
  height: "100%",
@@ -136,9 +137,10 @@ var Image = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
136
137
  var supportsAspectRatio = useSupportsAspectRatio();
137
138
  var noBorderRadiusContext = useDisableBorderRadius();
138
139
  var noBorderSetting = noBorderRadius !== null && noBorderRadius !== void 0 ? noBorderRadius : noBorderRadiusContext;
139
- // if width or height are numeric, we can calculate the other with the ratio without css
140
- var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number";
141
140
  var ratio = typeof aspectRatio === "number" ? aspectRatio : RATIO[aspectRatio];
141
+ // if width or height are numeric, we can calculate the other with the ratio without css.
142
+ // if aspect ratio is 0, we use the original image proportions
143
+ var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number" && ratio !== 0;
142
144
  var classes = useStyles({
143
145
  noBorderRadius: noBorderSetting,
144
146
  aspectRatio: withCssAspectRatio ? ratio : undefined,
@@ -1,2 +1,2 @@
1
1
  // DO NOT EDIT THIS FILE. It's autogenerated by set-version.js
2
- export var PACKAGE_VERSION = "11.6.0";
2
+ export var PACKAGE_VERSION = "11.7.0";
package/dist-es/video.js CHANGED
@@ -73,17 +73,18 @@ var useStyles = createUseStyles(function() {
73
73
  objectFit: "cover",
74
74
  maxWidth: "100%",
75
75
  maxHeight: "100%",
76
+ borderRadius: function(param) {
77
+ var noBorderRadius = param.noBorderRadius;
78
+ return noBorderRadius ? 0 : 4;
79
+ },
76
80
  "@supports (aspect-ratio: 1 / 1)": {
77
- borderRadius: function(param) {
78
- var noBorderRadius = param.noBorderRadius;
79
- return noBorderRadius ? 0 : 4;
80
- },
81
81
  aspectRatio: function(param) {
82
82
  var aspectRatio = param.aspectRatio;
83
83
  return aspectRatio !== null && aspectRatio !== void 0 ? aspectRatio : "unset";
84
84
  }
85
85
  },
86
86
  "$wrapper &": {
87
+ borderRadius: 0,
87
88
  position: "absolute",
88
89
  width: "100%",
89
90
  height: "100%",
@@ -127,9 +128,10 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
127
128
  ]);
128
129
  var supportsAspectRatio = useSupportsAspectRatio();
129
130
  var noBorderRadius = useDisableBorderRadius();
130
- // if width or height are numeric, we can calculate the other with the ratio without css
131
- var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number";
132
131
  var ratio = typeof aspectRatio === "number" ? aspectRatio : RATIO[aspectRatio];
132
+ // if width or height are numeric, we can calculate the other with the ratio without css
133
+ // if aspect ratio is 0, we use the original video proportions
134
+ var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number" && ratio !== 0;
133
135
  var classes = useStyles({
134
136
  noBorderRadius: noBorderRadius,
135
137
  aspectRatio: withCssAspectRatio ? ratio : undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telefonica/mistica",
3
- "version": "11.6.0",
3
+ "version": "11.7.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",