@micromag/element-background 0.4.38 → 0.4.41
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.d.ts +1 -1
- package/es/index.js +12 -12
- package/package.json +4 -4
package/es/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ interface BackgroundLayersProps {
|
|
|
6
6
|
width?: number | null;
|
|
7
7
|
height?: number | null;
|
|
8
8
|
resolution?: number;
|
|
9
|
-
background?: BackgroundElement | BackgroundElement[];
|
|
9
|
+
background?: BackgroundElement | BackgroundElement[] | null;
|
|
10
10
|
playing?: boolean;
|
|
11
11
|
muted?: boolean;
|
|
12
12
|
children?: React.ReactNode | null;
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
3
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import React, { useRef, useMemo } from 'react';
|
|
@@ -121,7 +121,7 @@ function Background(_ref) {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
return /*#__PURE__*/React.createElement("div", {
|
|
124
|
-
className: classNames([styles.container,
|
|
124
|
+
className: classNames([styles.container, className]),
|
|
125
125
|
style: containerStyle
|
|
126
126
|
}, isVideo && shouldLoad && !withoutVideo ? /*#__PURE__*/React.createElement("div", {
|
|
127
127
|
className: styles.videoContainer,
|
|
@@ -182,7 +182,7 @@ function BackgroundLayers(_ref) {
|
|
|
182
182
|
qualityStartLevel = _ref$qualityStartLeve === void 0 ? null : _ref$qualityStartLeve,
|
|
183
183
|
_ref$onQualityLevelCh = _ref.onQualityLevelChange,
|
|
184
184
|
onQualityLevelChange = _ref$onQualityLevelCh === void 0 ? null : _ref$onQualityLevelCh;
|
|
185
|
-
var hasSize = width > 0 && height > 0;
|
|
185
|
+
var hasSize = width !== null && height !== null && width > 0 && height > 0;
|
|
186
186
|
var layers = useMemo(function () {
|
|
187
187
|
return getLayersFromBackground(background);
|
|
188
188
|
}, [background]);
|
|
@@ -197,19 +197,19 @@ function BackgroundLayers(_ref) {
|
|
|
197
197
|
height: height
|
|
198
198
|
} : null);
|
|
199
199
|
return /*#__PURE__*/React.createElement("div", {
|
|
200
|
-
className: classNames([styles.container,
|
|
200
|
+
className: classNames([styles.container, className]),
|
|
201
201
|
style: containerStyle
|
|
202
202
|
}, /*#__PURE__*/React.createElement("div", {
|
|
203
203
|
className: styles.layers
|
|
204
|
-
}, layers.map(function (
|
|
205
|
-
var
|
|
206
|
-
horizontalAlign =
|
|
207
|
-
|
|
208
|
-
verticalAlign =
|
|
209
|
-
layer = _objectWithoutProperties(
|
|
204
|
+
}, layers.map(function (_ref2, index) {
|
|
205
|
+
var _ref2$horizontalAlign = _ref2.horizontalAlign,
|
|
206
|
+
horizontalAlign = _ref2$horizontalAlign === void 0 ? undefined : _ref2$horizontalAlign,
|
|
207
|
+
_ref2$verticalAlign = _ref2.verticalAlign,
|
|
208
|
+
verticalAlign = _ref2$verticalAlign === void 0 ? undefined : _ref2$verticalAlign,
|
|
209
|
+
layer = _objectWithoutProperties(_ref2, _excluded);
|
|
210
210
|
return /*#__PURE__*/React.createElement("div", {
|
|
211
211
|
key: "background-".concat(index),
|
|
212
|
-
className: classNames([styles.layer, _defineProperty(_defineProperty(
|
|
212
|
+
className: classNames([styles.layer, layerClassName, _defineProperty(_defineProperty({}, styles.bottom, verticalAlign === 'bottom'), styles.right, horizontalAlign === 'right')]),
|
|
213
213
|
style: {
|
|
214
214
|
zIndex: maxZIndex - index
|
|
215
215
|
}
|
|
@@ -217,7 +217,7 @@ function BackgroundLayers(_ref) {
|
|
|
217
217
|
width: width,
|
|
218
218
|
height: height,
|
|
219
219
|
resolution: resolution,
|
|
220
|
-
className: classNames([styles.background,
|
|
220
|
+
className: classNames([styles.background, backgroundClassName]),
|
|
221
221
|
playing: playing,
|
|
222
222
|
muted: muted,
|
|
223
223
|
horizontalAlign: horizontalAlign,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-background",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.41",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@babel/runtime": "^7.28.6",
|
|
62
62
|
"@folklore/size": "^0.1.20",
|
|
63
|
-
"@micromag/core": "^0.4.
|
|
64
|
-
"@micromag/element-video": "^0.4.
|
|
63
|
+
"@micromag/core": "^0.4.41",
|
|
64
|
+
"@micromag/element-video": "^0.4.41",
|
|
65
65
|
"classnames": "^2.2.6",
|
|
66
66
|
"lodash": "^4.17.23",
|
|
67
67
|
"react-intl": "^8.1.3 || ^10.0.0",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"access": "public",
|
|
72
72
|
"registry": "https://registry.npmjs.org/"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "c7856a747ba0a4466f4b63bc29e31003275ac6e0"
|
|
75
75
|
}
|