@micromag/element-background 0.3.56 → 0.3.57

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
@@ -1,9 +1,9 @@
1
1
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
2
2
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
3
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
4
- import React, { useRef, useMemo } from 'react';
5
- import PropTypes from 'prop-types';
6
4
  import classNames from 'classnames';
5
+ import PropTypes from 'prop-types';
6
+ import React, { useRef, useMemo } from 'react';
7
7
  import { PropTypes as PropTypes$1 } from '@micromag/core';
8
8
  import { getStyleFromColor, getOptimalImageUrl, getLayersFromBackground } from '@micromag/core/utils';
9
9
  import { getSizeWithinBounds } from '@folklore/size';
@@ -154,6 +154,8 @@ var propTypes = {
154
154
  playing: PropTypes.bool,
155
155
  children: PropTypes.node,
156
156
  className: PropTypes.string,
157
+ layerClassName: PropTypes.string,
158
+ backgroundClassName: PropTypes.string,
157
159
  loadingMode: PropTypes.string,
158
160
  shouldLoad: PropTypes.bool
159
161
  };
@@ -164,6 +166,8 @@ var defaultProps = {
164
166
  playing: false,
165
167
  children: null,
166
168
  className: null,
169
+ layerClassName: null,
170
+ backgroundClassName: null,
167
171
  loadingMode: 'lazy',
168
172
  shouldLoad: true
169
173
  };
@@ -175,6 +179,8 @@ var BackgroundLayers = function BackgroundLayers(_ref) {
175
179
  playing = _ref.playing,
176
180
  children = _ref.children,
177
181
  className = _ref.className,
182
+ layerClassName = _ref.layerClassName,
183
+ backgroundClassName = _ref.backgroundClassName,
178
184
  loadingMode = _ref.loadingMode,
179
185
  shouldLoad = _ref.shouldLoad;
180
186
  var hasSize = width > 0 && height > 0;
@@ -204,14 +210,14 @@ var BackgroundLayers = function BackgroundLayers(_ref) {
204
210
 
205
211
  return /*#__PURE__*/React.createElement("div", {
206
212
  key: "background-".concat(index),
207
- className: classNames([styles.layer, (_ref4 = {}, _defineProperty(_ref4, styles.bottom, verticalAlign === 'bottom'), _defineProperty(_ref4, styles.right, horizontalAlign === 'right'), _ref4)]),
213
+ className: classNames([styles.layer, (_ref4 = {}, _defineProperty(_ref4, styles.bottom, verticalAlign === 'bottom'), _defineProperty(_ref4, styles.right, horizontalAlign === 'right'), _defineProperty(_ref4, layerClassName, layerClassName !== null), _ref4)]),
208
214
  style: {
209
215
  zIndex: maxZIndex - index
210
216
  }
211
217
  }, /*#__PURE__*/React.createElement(Background, Object.assign({
212
218
  width: width,
213
219
  height: height,
214
- className: styles.background,
220
+ className: classNames([styles.background, _defineProperty({}, backgroundClassName, backgroundClassName !== null)]),
215
221
  playing: playing,
216
222
  horizontalAlign: horizontalAlign,
217
223
  verticalAlign: verticalAlign,
package/lib/index.js CHANGED
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
6
6
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
7
7
  var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
8
- var React = require('react');
9
- var PropTypes = require('prop-types');
10
8
  var classNames = require('classnames');
9
+ var PropTypes = require('prop-types');
10
+ var React = require('react');
11
11
  var core = require('@micromag/core');
12
12
  var utils = require('@micromag/core/utils');
13
13
  var size = require('@folklore/size');
@@ -18,9 +18,9 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
18
18
  var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
19
19
  var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
20
20
  var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
21
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
22
- var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
23
21
  var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
22
+ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
23
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
24
  var Video__default = /*#__PURE__*/_interopDefaultLegacy(Video);
25
25
 
26
26
  var styles = {"container":"micromag-element-background-container","layer":"micromag-element-background-layer","layers":"micromag-element-background-layers","video":"micromag-element-background-video","videoContainer":"micromag-element-background-videoContainer","right":"micromag-element-background-right","background":"micromag-element-background-background","bottom":"micromag-element-background-bottom"};
@@ -168,6 +168,8 @@ var propTypes = {
168
168
  playing: PropTypes__default["default"].bool,
169
169
  children: PropTypes__default["default"].node,
170
170
  className: PropTypes__default["default"].string,
171
+ layerClassName: PropTypes__default["default"].string,
172
+ backgroundClassName: PropTypes__default["default"].string,
171
173
  loadingMode: PropTypes__default["default"].string,
172
174
  shouldLoad: PropTypes__default["default"].bool
173
175
  };
@@ -178,6 +180,8 @@ var defaultProps = {
178
180
  playing: false,
179
181
  children: null,
180
182
  className: null,
183
+ layerClassName: null,
184
+ backgroundClassName: null,
181
185
  loadingMode: 'lazy',
182
186
  shouldLoad: true
183
187
  };
@@ -189,6 +193,8 @@ var BackgroundLayers = function BackgroundLayers(_ref) {
189
193
  playing = _ref.playing,
190
194
  children = _ref.children,
191
195
  className = _ref.className,
196
+ layerClassName = _ref.layerClassName,
197
+ backgroundClassName = _ref.backgroundClassName,
192
198
  loadingMode = _ref.loadingMode,
193
199
  shouldLoad = _ref.shouldLoad;
194
200
  var hasSize = width > 0 && height > 0;
@@ -218,14 +224,14 @@ var BackgroundLayers = function BackgroundLayers(_ref) {
218
224
 
219
225
  return /*#__PURE__*/React__default["default"].createElement("div", {
220
226
  key: "background-".concat(index),
221
- className: classNames__default["default"]([styles.layer, (_ref4 = {}, _defineProperty__default["default"](_ref4, styles.bottom, verticalAlign === 'bottom'), _defineProperty__default["default"](_ref4, styles.right, horizontalAlign === 'right'), _ref4)]),
227
+ className: classNames__default["default"]([styles.layer, (_ref4 = {}, _defineProperty__default["default"](_ref4, styles.bottom, verticalAlign === 'bottom'), _defineProperty__default["default"](_ref4, styles.right, horizontalAlign === 'right'), _defineProperty__default["default"](_ref4, layerClassName, layerClassName !== null), _ref4)]),
222
228
  style: {
223
229
  zIndex: maxZIndex - index
224
230
  }
225
231
  }, /*#__PURE__*/React__default["default"].createElement(Background, Object.assign({
226
232
  width: width,
227
233
  height: height,
228
- className: styles.background,
234
+ className: classNames__default["default"]([styles.background, _defineProperty__default["default"]({}, backgroundClassName, backgroundClassName !== null)]),
229
235
  playing: playing,
230
236
  horizontalAlign: horizontalAlign,
231
237
  verticalAlign: verticalAlign,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-background",
3
- "version": "0.3.56",
3
+ "version": "0.3.57",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -48,8 +48,8 @@
48
48
  "dependencies": {
49
49
  "@babel/runtime": "^7.13.10",
50
50
  "@folklore/size": "^0.1.15",
51
- "@micromag/core": "^0.3.56",
52
- "@micromag/element-video": "^0.3.56",
51
+ "@micromag/core": "^0.3.57",
52
+ "@micromag/element-video": "^0.3.57",
53
53
  "classnames": "^2.2.6",
54
54
  "lodash": "^4.17.21",
55
55
  "prop-types": "^15.7.2",
@@ -59,5 +59,5 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
- "gitHead": "8043af68555f4d11bbc067432123c252e38c2745"
62
+ "gitHead": "0cd1abafd1bee77d9dccbedde58f7b83f2351794"
63
63
  }