@micromag/element-background 0.4.37 → 0.4.40

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 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, _defineProperty({}, className, className !== null)]),
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, _defineProperty({}, className, className !== null)]),
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 (_ref3, index) {
205
- var _ref3$horizontalAlign = _ref3.horizontalAlign,
206
- horizontalAlign = _ref3$horizontalAlign === void 0 ? undefined : _ref3$horizontalAlign,
207
- _ref3$verticalAlign = _ref3.verticalAlign,
208
- verticalAlign = _ref3$verticalAlign === void 0 ? undefined : _ref3$verticalAlign,
209
- layer = _objectWithoutProperties(_ref3, _excluded);
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(_defineProperty({}, styles.bottom, verticalAlign === 'bottom'), styles.right, horizontalAlign === 'right'), layerClassName, layerClassName !== null)]),
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, _defineProperty({}, backgroundClassName, backgroundClassName !== null)]),
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.37",
3
+ "version": "0.4.40",
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.37",
64
- "@micromag/element-video": "^0.4.37",
63
+ "@micromag/core": "^0.4.40",
64
+ "@micromag/element-video": "^0.4.40",
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": "03c7d78fb0745377eddbb04f6c7dfaca8aa42381"
74
+ "gitHead": "6a9ff6e196a972abfd617f49353862cf445b0e83"
75
75
  }