@micromag/screen-gallery 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 CHANGED
@@ -207,6 +207,7 @@ var propTypes = {
207
207
  background: PropTypes$1.backgroundElement,
208
208
  callToAction: PropTypes$1.callToAction,
209
209
  current: PropTypes.bool,
210
+ active: PropTypes.bool,
210
211
  transitions: PropTypes$1.transitions,
211
212
  transitionStagger: PropTypes.number,
212
213
  className: PropTypes.string
@@ -220,12 +221,13 @@ var defaultProps = {
220
221
  background: null,
221
222
  callToAction: null,
222
223
  current: true,
224
+ active: true,
223
225
  transitions: null,
224
226
  transitionStagger: 50,
225
227
  className: null
226
228
  };
227
229
 
228
- function GalleryScreen(_ref) {
230
+ var GalleryScreen = function GalleryScreen(_ref) {
229
231
  var _ref6;
230
232
 
231
233
  var layout = _ref.layout,
@@ -234,6 +236,7 @@ function GalleryScreen(_ref) {
234
236
  background = _ref.background,
235
237
  callToAction = _ref.callToAction,
236
238
  current = _ref.current,
239
+ active = _ref.active,
237
240
  spacing = _ref.spacing,
238
241
  captionMaxLines = _ref.captionMaxLines,
239
242
  transitions = _ref.transitions,
@@ -257,6 +260,7 @@ function GalleryScreen(_ref) {
257
260
  isCapture = _useScreenRenderConte.isCapture;
258
261
 
259
262
  var backgroundPlaying = current && (isView || isEdit);
263
+ var backgroundShouldLoad = current || active || !isView;
260
264
  var finalSpacing = isPlaceholder ? 5 : spacing;
261
265
  var grid = isPlainObject(layoutProps[layout]) ? layoutProps[layout] : {};
262
266
  var _grid$layout = grid.layout,
@@ -400,7 +404,8 @@ function GalleryScreen(_ref) {
400
404
  background: background,
401
405
  width: width,
402
406
  height: height,
403
- playing: backgroundPlaying
407
+ playing: backgroundPlaying,
408
+ shouldLoad: backgroundShouldLoad
404
409
  }) : null, /*#__PURE__*/React.createElement(Container, {
405
410
  width: width,
406
411
  height: height
@@ -426,7 +431,7 @@ function GalleryScreen(_ref) {
426
431
  animationDisabled: isPreview,
427
432
  focusable: current && isView
428
433
  })) : null)));
429
- }
434
+ };
430
435
 
431
436
  GalleryScreen.propTypes = propTypes;
432
437
  GalleryScreen.defaultProps = defaultProps;
package/lib/index.js CHANGED
@@ -229,6 +229,7 @@ var propTypes = {
229
229
  background: core.PropTypes.backgroundElement,
230
230
  callToAction: core.PropTypes.callToAction,
231
231
  current: PropTypes__default["default"].bool,
232
+ active: PropTypes__default["default"].bool,
232
233
  transitions: core.PropTypes.transitions,
233
234
  transitionStagger: PropTypes__default["default"].number,
234
235
  className: PropTypes__default["default"].string
@@ -242,12 +243,13 @@ var defaultProps = {
242
243
  background: null,
243
244
  callToAction: null,
244
245
  current: true,
246
+ active: true,
245
247
  transitions: null,
246
248
  transitionStagger: 50,
247
249
  className: null
248
250
  };
249
251
 
250
- function GalleryScreen(_ref) {
252
+ var GalleryScreen = function GalleryScreen(_ref) {
251
253
  var _ref6;
252
254
 
253
255
  var layout = _ref.layout,
@@ -256,6 +258,7 @@ function GalleryScreen(_ref) {
256
258
  background = _ref.background,
257
259
  callToAction = _ref.callToAction,
258
260
  current = _ref.current,
261
+ active = _ref.active,
259
262
  spacing = _ref.spacing,
260
263
  captionMaxLines = _ref.captionMaxLines,
261
264
  transitions = _ref.transitions,
@@ -279,6 +282,7 @@ function GalleryScreen(_ref) {
279
282
  isCapture = _useScreenRenderConte.isCapture;
280
283
 
281
284
  var backgroundPlaying = current && (isView || isEdit);
285
+ var backgroundShouldLoad = current || active || !isView;
282
286
  var finalSpacing = isPlaceholder ? 5 : spacing;
283
287
  var grid = isPlainObject__default["default"](layoutProps[layout]) ? layoutProps[layout] : {};
284
288
  var _grid$layout = grid.layout,
@@ -422,7 +426,8 @@ function GalleryScreen(_ref) {
422
426
  background: background,
423
427
  width: width,
424
428
  height: height,
425
- playing: backgroundPlaying
429
+ playing: backgroundPlaying,
430
+ shouldLoad: backgroundShouldLoad
426
431
  }) : null, /*#__PURE__*/React__default["default"].createElement(Container__default["default"], {
427
432
  width: width,
428
433
  height: height
@@ -448,7 +453,7 @@ function GalleryScreen(_ref) {
448
453
  animationDisabled: isPreview,
449
454
  focusable: current && isView
450
455
  })) : null)));
451
- }
456
+ };
452
457
 
453
458
  GalleryScreen.propTypes = propTypes;
454
459
  GalleryScreen.defaultProps = defaultProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-gallery",
3
- "version": "0.2.404",
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.404",
53
- "@micromag/element-background": "^0.2.404",
54
- "@micromag/element-call-to-action": "^0.2.404",
55
- "@micromag/element-container": "^0.2.404",
56
- "@micromag/element-grid": "^0.2.404",
57
- "@micromag/element-layout": "^0.2.404",
58
- "@micromag/element-text": "^0.2.404",
59
- "@micromag/element-visual": "^0.2.404",
60
- "@micromag/transforms": "^0.2.404",
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-grid": "^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": "34d5345cb0dad79206bb6b7a25f02742663023ee"
70
+ "gitHead": "4bc2ba99622adef74bd0da42cb52d1a575c1a544"
71
71
  }