@micromag/screen-urbania-trivia 0.3.74 → 0.3.76

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
@@ -76,7 +76,7 @@ var defaultProps = {
76
76
  };
77
77
 
78
78
  var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
79
- var _ref11, _ref12, _ref14, _ref15;
79
+ var _ref12, _ref13, _ref15, _ref16;
80
80
 
81
81
  var layout = _ref.layout,
82
82
  title = _ref.title,
@@ -317,11 +317,21 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
317
317
  return background;
318
318
  }
319
319
 
320
- if (background !== null) {
320
+ var _ref11 = background || {},
321
+ _ref11$image = _ref11.image,
322
+ bgImage = _ref11$image === void 0 ? null : _ref11$image,
323
+ _ref11$video = _ref11.video,
324
+ bgVideo = _ref11$video === void 0 ? null : _ref11$video,
325
+ _ref11$color = _ref11.color,
326
+ bgColor = _ref11$color === void 0 ? null : _ref11$color;
327
+
328
+ if (bgImage !== null || bgVideo !== null) {
321
329
  return _objectSpread(_objectSpread({}, defaultBackground), background);
322
330
  }
323
331
 
324
- return defaultBackground;
332
+ return _objectSpread(_objectSpread({}, defaultBackground), bgColor !== null ? {
333
+ color: bgColor
334
+ } : null);
325
335
  }, [background]);
326
336
  var placeholderProps = fullscreen ? {
327
337
  width: '100%',
@@ -359,7 +369,7 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
359
369
  }, /*#__PURE__*/React.createElement("div", {
360
370
  ref: titleRef
361
371
  }, /*#__PURE__*/React.createElement(Heading, Object.assign({
362
- className: classNames([styles.heading, (_ref11 = {}, _defineProperty(_ref11, className, className !== null), _defineProperty(_ref11, styles.hideHeading, body.length === 0), _ref11)]),
372
+ className: classNames([styles.heading, (_ref12 = {}, _defineProperty(_ref12, className, className !== null), _defineProperty(_ref12, styles.hideHeading, body.length === 0), _ref12)]),
363
373
  body: body
364
374
  }, title)))), /*#__PURE__*/React.createElement(ScreenElement, {
365
375
  key: "video",
@@ -428,7 +438,7 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
428
438
  media: closedCaptions,
429
439
  currentTime: currentTime
430
440
  }) : null, /*#__PURE__*/React.createElement("div", {
431
- className: classNames([styles.bottom, (_ref12 = {}, _defineProperty(_ref12, styles.visible, visibleControls), _defineProperty(_ref12, styles.withGradient, withSeekBar || withPlayPause || muted), _ref12)])
441
+ className: classNames([styles.bottom, (_ref13 = {}, _defineProperty(_ref13, styles.visible, visibleControls), _defineProperty(_ref13, styles.withGradient, withSeekBar || withPlayPause || muted), _ref13)])
432
442
  }, hasVideoUrl ? /*#__PURE__*/React.createElement(MediaControls, {
433
443
  className: classNames([styles.mediaControls, _defineProperty({}, styles.visible, visibleControls)]),
434
444
  withSeekBar: withSeekBar,
@@ -457,13 +467,13 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
457
467
  }
458
468
  })) : null))) : null) : null))];
459
469
  return /*#__PURE__*/React.createElement("div", Object.assign({
460
- className: classNames([styles.container, (_ref14 = {}, _defineProperty(_ref14, className, className !== null), _defineProperty(_ref14, styles.fullscreen, fullscreen), _ref14)]),
470
+ className: classNames([styles.container, (_ref15 = {}, _defineProperty(_ref15, className, className !== null), _defineProperty(_ref15, styles.fullscreen, fullscreen), _ref15)]),
461
471
  "data-screen-ready": isStatic || isCapture || ready
462
472
  }, longPressBind, {
463
473
  onMouseMove: onMouseMove
464
474
  }), !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
465
475
  background: finalBackground,
466
- className: classNames([styles.background, (_ref15 = {}, _defineProperty(_ref15, className, className !== null), _defineProperty(_ref15, styles.isCustomBackground, isCustomBackground), _defineProperty(_ref15, styles.isAnimated, !isStatic && !isPreview && isCustomBackground), _ref15)]),
476
+ className: classNames([styles.background, (_ref16 = {}, _defineProperty(_ref16, className, className !== null), _defineProperty(_ref16, styles.isCustomBackground, isCustomBackground), _defineProperty(_ref16, styles.isAnimated, !isStatic && !isPreview && isCustomBackground), _ref16)]),
467
477
  width: width,
468
478
  height: height,
469
479
  resolution: resolution,
@@ -505,10 +515,10 @@ var definition = {
505
515
  order: 10
506
516
  },
507
517
  title: defineMessage({
508
- id: "eA6lME",
518
+ id: "zDdDqI",
509
519
  defaultMessage: [{
510
520
  "type": 0,
511
- "value": "Urbania trivia screen"
521
+ "value": "Urbania trivia"
512
522
  }]
513
523
  }),
514
524
  component: UrbaniaTriviaScreen,
package/lib/index.js CHANGED
@@ -98,7 +98,7 @@ var defaultProps = {
98
98
  };
99
99
 
100
100
  var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
101
- var _ref11, _ref12, _ref14, _ref15;
101
+ var _ref12, _ref13, _ref15, _ref16;
102
102
 
103
103
  var layout = _ref.layout,
104
104
  title = _ref.title,
@@ -339,11 +339,21 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
339
339
  return background;
340
340
  }
341
341
 
342
- if (background !== null) {
342
+ var _ref11 = background || {},
343
+ _ref11$image = _ref11.image,
344
+ bgImage = _ref11$image === void 0 ? null : _ref11$image,
345
+ _ref11$video = _ref11.video,
346
+ bgVideo = _ref11$video === void 0 ? null : _ref11$video,
347
+ _ref11$color = _ref11.color,
348
+ bgColor = _ref11$color === void 0 ? null : _ref11$color;
349
+
350
+ if (bgImage !== null || bgVideo !== null) {
343
351
  return _objectSpread__default["default"](_objectSpread__default["default"]({}, defaultBackground), background);
344
352
  }
345
353
 
346
- return defaultBackground;
354
+ return _objectSpread__default["default"](_objectSpread__default["default"]({}, defaultBackground), bgColor !== null ? {
355
+ color: bgColor
356
+ } : null);
347
357
  }, [background]);
348
358
  var placeholderProps = fullscreen ? {
349
359
  width: '100%',
@@ -381,7 +391,7 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
381
391
  }, /*#__PURE__*/React__default["default"].createElement("div", {
382
392
  ref: titleRef
383
393
  }, /*#__PURE__*/React__default["default"].createElement(Heading__default["default"], Object.assign({
384
- className: classNames__default["default"]([styles.heading, (_ref11 = {}, _defineProperty__default["default"](_ref11, className, className !== null), _defineProperty__default["default"](_ref11, styles.hideHeading, body.length === 0), _ref11)]),
394
+ className: classNames__default["default"]([styles.heading, (_ref12 = {}, _defineProperty__default["default"](_ref12, className, className !== null), _defineProperty__default["default"](_ref12, styles.hideHeading, body.length === 0), _ref12)]),
385
395
  body: body
386
396
  }, title)))), /*#__PURE__*/React__default["default"].createElement(components.ScreenElement, {
387
397
  key: "video",
@@ -450,7 +460,7 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
450
460
  media: closedCaptions,
451
461
  currentTime: currentTime
452
462
  }) : null, /*#__PURE__*/React__default["default"].createElement("div", {
453
- className: classNames__default["default"]([styles.bottom, (_ref12 = {}, _defineProperty__default["default"](_ref12, styles.visible, visibleControls), _defineProperty__default["default"](_ref12, styles.withGradient, withSeekBar || withPlayPause || muted), _ref12)])
463
+ className: classNames__default["default"]([styles.bottom, (_ref13 = {}, _defineProperty__default["default"](_ref13, styles.visible, visibleControls), _defineProperty__default["default"](_ref13, styles.withGradient, withSeekBar || withPlayPause || muted), _ref13)])
454
464
  }, hasVideoUrl ? /*#__PURE__*/React__default["default"].createElement(MediaControls__default["default"], {
455
465
  className: classNames__default["default"]([styles.mediaControls, _defineProperty__default["default"]({}, styles.visible, visibleControls)]),
456
466
  withSeekBar: withSeekBar,
@@ -479,13 +489,13 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
479
489
  }
480
490
  })) : null))) : null) : null))];
481
491
  return /*#__PURE__*/React__default["default"].createElement("div", Object.assign({
482
- className: classNames__default["default"]([styles.container, (_ref14 = {}, _defineProperty__default["default"](_ref14, className, className !== null), _defineProperty__default["default"](_ref14, styles.fullscreen, fullscreen), _ref14)]),
492
+ className: classNames__default["default"]([styles.container, (_ref15 = {}, _defineProperty__default["default"](_ref15, className, className !== null), _defineProperty__default["default"](_ref15, styles.fullscreen, fullscreen), _ref15)]),
483
493
  "data-screen-ready": isStatic || isCapture || ready
484
494
  }, longPressBind, {
485
495
  onMouseMove: onMouseMove
486
496
  }), !isPlaceholder ? /*#__PURE__*/React__default["default"].createElement(Background__default["default"], {
487
497
  background: finalBackground,
488
- className: classNames__default["default"]([styles.background, (_ref15 = {}, _defineProperty__default["default"](_ref15, className, className !== null), _defineProperty__default["default"](_ref15, styles.isCustomBackground, isCustomBackground), _defineProperty__default["default"](_ref15, styles.isAnimated, !isStatic && !isPreview && isCustomBackground), _ref15)]),
498
+ className: classNames__default["default"]([styles.background, (_ref16 = {}, _defineProperty__default["default"](_ref16, className, className !== null), _defineProperty__default["default"](_ref16, styles.isCustomBackground, isCustomBackground), _defineProperty__default["default"](_ref16, styles.isAnimated, !isStatic && !isPreview && isCustomBackground), _ref16)]),
489
499
  width: width,
490
500
  height: height,
491
501
  resolution: resolution,
@@ -527,10 +537,10 @@ var definition = {
527
537
  order: 10
528
538
  },
529
539
  title: reactIntl.defineMessage({
530
- id: "eA6lME",
540
+ id: "zDdDqI",
531
541
  defaultMessage: [{
532
542
  "type": 0,
533
- "value": "Urbania trivia screen"
543
+ "value": "Urbania trivia"
534
544
  }]
535
545
  }),
536
546
  component: UrbaniaTriviaScreen,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-urbania-trivia",
3
- "version": "0.3.74",
3
+ "version": "0.3.76",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -52,7 +52,7 @@
52
52
  "@folklore/size": "^0.1.20",
53
53
  "@micromag/core": "^0.3.74",
54
54
  "@micromag/element-background": "^0.3.74",
55
- "@micromag/element-call-to-action": "^0.3.74",
55
+ "@micromag/element-call-to-action": "^0.3.76",
56
56
  "@micromag/element-closed-captions": "^0.3.74",
57
57
  "@micromag/element-container": "^0.3.74",
58
58
  "@micromag/element-heading": "^0.3.74",
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "gitHead": "c85b6b4ca7ff2162222291ca6ccaae79789c8db6"
72
+ "gitHead": "c86e3ead134f626899cfdfc34fac84eb1d02864a"
73
73
  }