@micromag/screen-image 0.2.404 → 0.2.408
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 +6 -1
- package/lib/index.js +6 -1
- package/package.json +11 -11
package/es/index.js
CHANGED
|
@@ -38,6 +38,7 @@ var propTypes = {
|
|
|
38
38
|
background: PropTypes$1.backgroundElement,
|
|
39
39
|
callToAction: PropTypes$1.callToAction,
|
|
40
40
|
current: PropTypes.bool,
|
|
41
|
+
active: PropTypes.bool,
|
|
41
42
|
transitions: PropTypes$1.transitions,
|
|
42
43
|
className: PropTypes.string
|
|
43
44
|
};
|
|
@@ -56,6 +57,7 @@ var defaultProps = {
|
|
|
56
57
|
background: null,
|
|
57
58
|
callToAction: null,
|
|
58
59
|
current: true,
|
|
60
|
+
active: true,
|
|
59
61
|
transitions: null,
|
|
60
62
|
className: null
|
|
61
63
|
};
|
|
@@ -77,6 +79,7 @@ var ImageScreen = function ImageScreen(_ref) {
|
|
|
77
79
|
background = _ref.background,
|
|
78
80
|
callToAction = _ref.callToAction,
|
|
79
81
|
current = _ref.current,
|
|
82
|
+
active = _ref.active,
|
|
80
83
|
transitions = _ref.transitions,
|
|
81
84
|
className = _ref.className;
|
|
82
85
|
var finalImageFit = useMemo(function () {
|
|
@@ -102,6 +105,7 @@ var ImageScreen = function ImageScreen(_ref) {
|
|
|
102
105
|
isCapture = _useScreenRenderConte.isCapture;
|
|
103
106
|
|
|
104
107
|
var backgroundPlaying = current && (isView || isEdit);
|
|
108
|
+
var backgroundShouldLoad = current || active || !isView;
|
|
105
109
|
var hasImage = image !== null;
|
|
106
110
|
var hasTitle = isTextFilled(title);
|
|
107
111
|
var hasText = isTextFilled(text);
|
|
@@ -275,7 +279,8 @@ var ImageScreen = function ImageScreen(_ref) {
|
|
|
275
279
|
background: background,
|
|
276
280
|
width: width,
|
|
277
281
|
height: height,
|
|
278
|
-
playing: backgroundPlaying
|
|
282
|
+
playing: backgroundPlaying,
|
|
283
|
+
shouldLoad: backgroundShouldLoad
|
|
279
284
|
}) : null, /*#__PURE__*/React.createElement(Container, {
|
|
280
285
|
width: width,
|
|
281
286
|
height: height
|
package/lib/index.js
CHANGED
|
@@ -60,6 +60,7 @@ var propTypes = {
|
|
|
60
60
|
background: core.PropTypes.backgroundElement,
|
|
61
61
|
callToAction: core.PropTypes.callToAction,
|
|
62
62
|
current: PropTypes__default["default"].bool,
|
|
63
|
+
active: PropTypes__default["default"].bool,
|
|
63
64
|
transitions: core.PropTypes.transitions,
|
|
64
65
|
className: PropTypes__default["default"].string
|
|
65
66
|
};
|
|
@@ -78,6 +79,7 @@ var defaultProps = {
|
|
|
78
79
|
background: null,
|
|
79
80
|
callToAction: null,
|
|
80
81
|
current: true,
|
|
82
|
+
active: true,
|
|
81
83
|
transitions: null,
|
|
82
84
|
className: null
|
|
83
85
|
};
|
|
@@ -99,6 +101,7 @@ var ImageScreen = function ImageScreen(_ref) {
|
|
|
99
101
|
background = _ref.background,
|
|
100
102
|
callToAction = _ref.callToAction,
|
|
101
103
|
current = _ref.current,
|
|
104
|
+
active = _ref.active,
|
|
102
105
|
transitions = _ref.transitions,
|
|
103
106
|
className = _ref.className;
|
|
104
107
|
var finalImageFit = React.useMemo(function () {
|
|
@@ -124,6 +127,7 @@ var ImageScreen = function ImageScreen(_ref) {
|
|
|
124
127
|
isCapture = _useScreenRenderConte.isCapture;
|
|
125
128
|
|
|
126
129
|
var backgroundPlaying = current && (isView || isEdit);
|
|
130
|
+
var backgroundShouldLoad = current || active || !isView;
|
|
127
131
|
var hasImage = image !== null;
|
|
128
132
|
var hasTitle = utils.isTextFilled(title);
|
|
129
133
|
var hasText = utils.isTextFilled(text);
|
|
@@ -297,7 +301,8 @@ var ImageScreen = function ImageScreen(_ref) {
|
|
|
297
301
|
background: background,
|
|
298
302
|
width: width,
|
|
299
303
|
height: height,
|
|
300
|
-
playing: backgroundPlaying
|
|
304
|
+
playing: backgroundPlaying,
|
|
305
|
+
shouldLoad: backgroundShouldLoad
|
|
301
306
|
}) : null, /*#__PURE__*/React__default["default"].createElement(Container__default["default"], {
|
|
302
307
|
width: width,
|
|
303
308
|
height: height
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-image",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.408",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.13.10",
|
|
52
|
-
"@micromag/core": "^0.2.
|
|
53
|
-
"@micromag/element-background": "^0.2.
|
|
54
|
-
"@micromag/element-call-to-action": "^0.2.
|
|
55
|
-
"@micromag/element-container": "^0.2.
|
|
56
|
-
"@micromag/element-heading": "^0.2.
|
|
57
|
-
"@micromag/element-layout": "^0.2.
|
|
58
|
-
"@micromag/element-text": "^0.2.
|
|
59
|
-
"@micromag/element-visual": "^0.2.
|
|
60
|
-
"@micromag/transforms": "^0.2.
|
|
52
|
+
"@micromag/core": "^0.2.405",
|
|
53
|
+
"@micromag/element-background": "^0.2.407",
|
|
54
|
+
"@micromag/element-call-to-action": "^0.2.405",
|
|
55
|
+
"@micromag/element-container": "^0.2.405",
|
|
56
|
+
"@micromag/element-heading": "^0.2.405",
|
|
57
|
+
"@micromag/element-layout": "^0.2.405",
|
|
58
|
+
"@micromag/element-text": "^0.2.405",
|
|
59
|
+
"@micromag/element-visual": "^0.2.407",
|
|
60
|
+
"@micromag/transforms": "^0.2.405",
|
|
61
61
|
"classnames": "^2.2.6",
|
|
62
62
|
"lodash": "^4.17.21",
|
|
63
63
|
"prop-types": "^15.7.2",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "4bc2ba99622adef74bd0da42cb52d1a575c1a544"
|
|
71
71
|
}
|