@micromag/screen-urbania-trivia 0.3.107 → 0.3.110
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 +9 -13
- package/lib/index.js +9 -13
- package/package.json +12 -12
package/es/index.js
CHANGED
|
@@ -112,8 +112,7 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
|
|
|
112
112
|
|
|
113
113
|
var hasTitle = isTextFilled(title);
|
|
114
114
|
var backgroundPlaying = current && (isView || isEdit);
|
|
115
|
-
var
|
|
116
|
-
var videoShouldLoad = current || active;
|
|
115
|
+
var mediaShouldLoad = current || active;
|
|
117
116
|
var shouldGotoNextScreenOnEnd = gotoNextScreenOnEnd && isView && current;
|
|
118
117
|
|
|
119
118
|
var _ref2 = title || {};
|
|
@@ -130,10 +129,8 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
|
|
|
130
129
|
closedCaptions = _ref3$closedCaptions === void 0 ? null : _ref3$closedCaptions,
|
|
131
130
|
_ref3$withSeekBar = _ref3.withSeekBar,
|
|
132
131
|
withSeekBar = _ref3$withSeekBar === void 0 ? false : _ref3$withSeekBar,
|
|
133
|
-
_ref3$
|
|
134
|
-
|
|
135
|
-
_ref3$withTime = _ref3.withTime,
|
|
136
|
-
withTime = _ref3$withTime === void 0 ? false : _ref3$withTime;
|
|
132
|
+
_ref3$withControls = _ref3.withControls,
|
|
133
|
+
withControls = _ref3$withControls === void 0 ? false : _ref3$withControls;
|
|
137
134
|
|
|
138
135
|
var apiRef = useRef();
|
|
139
136
|
|
|
@@ -244,12 +241,12 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
|
|
|
244
241
|
var onLongPress = useCallback(function () {
|
|
245
242
|
if (!playing) {
|
|
246
243
|
play();
|
|
247
|
-
} else if (
|
|
244
|
+
} else if (withControls) {
|
|
248
245
|
onMouseMove(null, 3000);
|
|
249
246
|
} else {
|
|
250
247
|
pause();
|
|
251
248
|
}
|
|
252
|
-
}, [play, playing, pause, onMouseMove,
|
|
249
|
+
}, [play, playing, pause, onMouseMove, withControls, setShowMediaControls]);
|
|
253
250
|
var longPressBind = useLongPress({
|
|
254
251
|
onLongPress: onLongPress,
|
|
255
252
|
onClick: onMouseMove
|
|
@@ -430,7 +427,7 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
|
|
|
430
427
|
onEnded: onEnded,
|
|
431
428
|
onVolumeChanged: onVolumeChanged,
|
|
432
429
|
focusable: current && isView,
|
|
433
|
-
|
|
430
|
+
shouldLoad: mediaShouldLoad
|
|
434
431
|
})), !isPlaceholder ? /*#__PURE__*/React.createElement("div", {
|
|
435
432
|
key: "bottom-content",
|
|
436
433
|
className: styles.bottomContent
|
|
@@ -443,12 +440,11 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
|
|
|
443
440
|
media: closedCaptions,
|
|
444
441
|
currentTime: currentTime
|
|
445
442
|
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
446
|
-
className: classNames([styles.bottom, (_ref12 = {}, _defineProperty(_ref12, styles.visible, visibleControls), _defineProperty(_ref12, styles.withGradient, withSeekBar ||
|
|
443
|
+
className: classNames([styles.bottom, (_ref12 = {}, _defineProperty(_ref12, styles.visible, visibleControls), _defineProperty(_ref12, styles.withGradient, withSeekBar || withControls || muted), _ref12)])
|
|
447
444
|
}, hasVideoUrl ? /*#__PURE__*/React.createElement(MediaControls, {
|
|
448
445
|
className: classNames([styles.mediaControls, _defineProperty({}, styles.visible, visibleControls)]),
|
|
449
446
|
withSeekBar: withSeekBar,
|
|
450
|
-
|
|
451
|
-
withTime: withTime,
|
|
447
|
+
withControls: withControls,
|
|
452
448
|
playing: playing,
|
|
453
449
|
muted: muted,
|
|
454
450
|
currentTime: currentTime,
|
|
@@ -470,7 +466,7 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
|
|
|
470
466
|
height: height,
|
|
471
467
|
resolution: resolution,
|
|
472
468
|
playing: backgroundPlaying,
|
|
473
|
-
shouldLoad:
|
|
469
|
+
shouldLoad: mediaShouldLoad
|
|
474
470
|
}) : /*#__PURE__*/React.createElement(Background, {
|
|
475
471
|
background: placeholderBackground,
|
|
476
472
|
className: styles.background,
|
package/lib/index.js
CHANGED
|
@@ -133,8 +133,7 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
|
|
|
133
133
|
|
|
134
134
|
var hasTitle = utils.isTextFilled(title);
|
|
135
135
|
var backgroundPlaying = current && (isView || isEdit);
|
|
136
|
-
var
|
|
137
|
-
var videoShouldLoad = current || active;
|
|
136
|
+
var mediaShouldLoad = current || active;
|
|
138
137
|
var shouldGotoNextScreenOnEnd = gotoNextScreenOnEnd && isView && current;
|
|
139
138
|
|
|
140
139
|
var _ref2 = title || {};
|
|
@@ -151,10 +150,8 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
|
|
|
151
150
|
closedCaptions = _ref3$closedCaptions === void 0 ? null : _ref3$closedCaptions,
|
|
152
151
|
_ref3$withSeekBar = _ref3.withSeekBar,
|
|
153
152
|
withSeekBar = _ref3$withSeekBar === void 0 ? false : _ref3$withSeekBar,
|
|
154
|
-
_ref3$
|
|
155
|
-
|
|
156
|
-
_ref3$withTime = _ref3.withTime,
|
|
157
|
-
withTime = _ref3$withTime === void 0 ? false : _ref3$withTime;
|
|
153
|
+
_ref3$withControls = _ref3.withControls,
|
|
154
|
+
withControls = _ref3$withControls === void 0 ? false : _ref3$withControls;
|
|
158
155
|
|
|
159
156
|
var apiRef = React.useRef();
|
|
160
157
|
|
|
@@ -265,12 +262,12 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
|
|
|
265
262
|
var onLongPress = React.useCallback(function () {
|
|
266
263
|
if (!playing) {
|
|
267
264
|
play();
|
|
268
|
-
} else if (
|
|
265
|
+
} else if (withControls) {
|
|
269
266
|
onMouseMove(null, 3000);
|
|
270
267
|
} else {
|
|
271
268
|
pause();
|
|
272
269
|
}
|
|
273
|
-
}, [play, playing, pause, onMouseMove,
|
|
270
|
+
}, [play, playing, pause, onMouseMove, withControls, setShowMediaControls]);
|
|
274
271
|
var longPressBind = hooks.useLongPress({
|
|
275
272
|
onLongPress: onLongPress,
|
|
276
273
|
onClick: onMouseMove
|
|
@@ -451,7 +448,7 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
|
|
|
451
448
|
onEnded: onEnded,
|
|
452
449
|
onVolumeChanged: onVolumeChanged,
|
|
453
450
|
focusable: current && isView,
|
|
454
|
-
|
|
451
|
+
shouldLoad: mediaShouldLoad
|
|
455
452
|
})), !isPlaceholder ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
456
453
|
key: "bottom-content",
|
|
457
454
|
className: styles.bottomContent
|
|
@@ -464,12 +461,11 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
|
|
|
464
461
|
media: closedCaptions,
|
|
465
462
|
currentTime: currentTime
|
|
466
463
|
}) : null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
467
|
-
className: classNames__default["default"]([styles.bottom, (_ref12 = {}, _defineProperty__default["default"](_ref12, styles.visible, visibleControls), _defineProperty__default["default"](_ref12, styles.withGradient, withSeekBar ||
|
|
464
|
+
className: classNames__default["default"]([styles.bottom, (_ref12 = {}, _defineProperty__default["default"](_ref12, styles.visible, visibleControls), _defineProperty__default["default"](_ref12, styles.withGradient, withSeekBar || withControls || muted), _ref12)])
|
|
468
465
|
}, hasVideoUrl ? /*#__PURE__*/React__default["default"].createElement(MediaControls__default["default"], {
|
|
469
466
|
className: classNames__default["default"]([styles.mediaControls, _defineProperty__default["default"]({}, styles.visible, visibleControls)]),
|
|
470
467
|
withSeekBar: withSeekBar,
|
|
471
|
-
|
|
472
|
-
withTime: withTime,
|
|
468
|
+
withControls: withControls,
|
|
473
469
|
playing: playing,
|
|
474
470
|
muted: muted,
|
|
475
471
|
currentTime: currentTime,
|
|
@@ -491,7 +487,7 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
|
|
|
491
487
|
height: height,
|
|
492
488
|
resolution: resolution,
|
|
493
489
|
playing: backgroundPlaying,
|
|
494
|
-
shouldLoad:
|
|
490
|
+
shouldLoad: mediaShouldLoad
|
|
495
491
|
}) : /*#__PURE__*/React__default["default"].createElement(Background__default["default"], {
|
|
496
492
|
background: placeholderBackground,
|
|
497
493
|
className: styles.background,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-urbania-trivia",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.110",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -50,16 +50,16 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.13.10",
|
|
52
52
|
"@folklore/size": "^0.1.20",
|
|
53
|
-
"@micromag/core": "^0.3.
|
|
54
|
-
"@micromag/element-background": "^0.3.
|
|
55
|
-
"@micromag/element-call-to-action": "^0.3.
|
|
56
|
-
"@micromag/element-closed-captions": "^0.3.
|
|
57
|
-
"@micromag/element-container": "^0.3.
|
|
58
|
-
"@micromag/element-heading": "^0.3.
|
|
59
|
-
"@micromag/element-image": "^0.3.
|
|
60
|
-
"@micromag/element-media-controls": "^0.3.
|
|
61
|
-
"@micromag/element-video": "^0.3.
|
|
62
|
-
"@micromag/transforms": "^0.3.
|
|
53
|
+
"@micromag/core": "^0.3.110",
|
|
54
|
+
"@micromag/element-background": "^0.3.110",
|
|
55
|
+
"@micromag/element-call-to-action": "^0.3.110",
|
|
56
|
+
"@micromag/element-closed-captions": "^0.3.110",
|
|
57
|
+
"@micromag/element-container": "^0.3.110",
|
|
58
|
+
"@micromag/element-heading": "^0.3.110",
|
|
59
|
+
"@micromag/element-image": "^0.3.110",
|
|
60
|
+
"@micromag/element-media-controls": "^0.3.110",
|
|
61
|
+
"@micromag/element-video": "^0.3.110",
|
|
62
|
+
"@micromag/transforms": "^0.3.110",
|
|
63
63
|
"classnames": "^2.2.6",
|
|
64
64
|
"lodash": "^4.17.21",
|
|
65
65
|
"prop-types": "^15.7.2",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "a4a09bb4e14c7ee52330258a2e9a02b3cc8809a7"
|
|
73
73
|
}
|