@micromag/screen-urbania-article 0.3.263 → 0.3.266
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 +12 -19
- package/lib/index.js +12 -19
- package/package.json +15 -15
package/es/index.js
CHANGED
|
@@ -232,8 +232,14 @@ var UrbaniaArticle = function UrbaniaArticle(_ref) {
|
|
|
232
232
|
url = _ref5$url === void 0 ? null : _ref5$url;
|
|
233
233
|
|
|
234
234
|
var hasImage = url !== null;
|
|
235
|
+
var hasCallToAction = callToAction !== null && callToAction.active === true;
|
|
236
|
+
|
|
237
|
+
var _ref6 = background || {},
|
|
238
|
+
_ref6$video = _ref6.video,
|
|
239
|
+
backgroundVideo = _ref6$video === void 0 ? null : _ref6$video;
|
|
240
|
+
|
|
241
|
+
var hasVideoBackground = backgroundVideo !== null;
|
|
235
242
|
var mediaShouldLoad = current || active;
|
|
236
|
-
var hasCallToAction = callToAction !== null && callToAction.active === true; // const backgroundPlaying = current && (isView || isEdit);
|
|
237
243
|
|
|
238
244
|
var _useState = useState(false),
|
|
239
245
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -241,27 +247,14 @@ var UrbaniaArticle = function UrbaniaArticle(_ref) {
|
|
|
241
247
|
setBackgroundPlaying = _useState2[1];
|
|
242
248
|
|
|
243
249
|
var playIfCurrent = useCallback(function () {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
setPlaying(false);
|
|
248
|
-
}
|
|
249
|
-
}, [current, openedWebView, playing, setPlaying]); // TODO: link playIfCurrent and backgroundPlaying
|
|
250
|
-
|
|
250
|
+
var shouldPlay = current && !openedWebView && !playing;
|
|
251
|
+
setPlaying(shouldPlay);
|
|
252
|
+
}, [current, openedWebView, playing, setPlaying]);
|
|
251
253
|
useEffect(function () {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
} else if (current && (isView || isEdit)) {
|
|
255
|
-
setBackgroundPlaying(!openedWebView);
|
|
256
|
-
}
|
|
254
|
+
var shouldBackgroundBePlaying = current && !openedWebView && (isView || isEdit);
|
|
255
|
+
setBackgroundPlaying(shouldBackgroundBePlaying);
|
|
257
256
|
}, [current, isView, isEdit, openedWebView, setBackgroundPlaying]);
|
|
258
257
|
useDebounce(playIfCurrent, current, 500);
|
|
259
|
-
|
|
260
|
-
var _ref6 = background || {},
|
|
261
|
-
_ref6$video = _ref6.video,
|
|
262
|
-
backgroundVideo = _ref6$video === void 0 ? null : _ref6$video;
|
|
263
|
-
|
|
264
|
-
var hasVideoBackground = backgroundVideo !== null;
|
|
265
258
|
var items = [/*#__PURE__*/React.createElement(ScreenElement, {
|
|
266
259
|
key: "overTitle",
|
|
267
260
|
placeholder: /*#__PURE__*/React.createElement(PlaceholderSubtitle, {
|
package/lib/index.js
CHANGED
|
@@ -253,8 +253,14 @@ var UrbaniaArticle = function UrbaniaArticle(_ref) {
|
|
|
253
253
|
url = _ref5$url === void 0 ? null : _ref5$url;
|
|
254
254
|
|
|
255
255
|
var hasImage = url !== null;
|
|
256
|
+
var hasCallToAction = callToAction !== null && callToAction.active === true;
|
|
257
|
+
|
|
258
|
+
var _ref6 = background || {},
|
|
259
|
+
_ref6$video = _ref6.video,
|
|
260
|
+
backgroundVideo = _ref6$video === void 0 ? null : _ref6$video;
|
|
261
|
+
|
|
262
|
+
var hasVideoBackground = backgroundVideo !== null;
|
|
256
263
|
var mediaShouldLoad = current || active;
|
|
257
|
-
var hasCallToAction = callToAction !== null && callToAction.active === true; // const backgroundPlaying = current && (isView || isEdit);
|
|
258
264
|
|
|
259
265
|
var _useState = React.useState(false),
|
|
260
266
|
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
@@ -262,27 +268,14 @@ var UrbaniaArticle = function UrbaniaArticle(_ref) {
|
|
|
262
268
|
setBackgroundPlaying = _useState2[1];
|
|
263
269
|
|
|
264
270
|
var playIfCurrent = React.useCallback(function () {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
setPlaying(false);
|
|
269
|
-
}
|
|
270
|
-
}, [current, openedWebView, playing, setPlaying]); // TODO: link playIfCurrent and backgroundPlaying
|
|
271
|
-
|
|
271
|
+
var shouldPlay = current && !openedWebView && !playing;
|
|
272
|
+
setPlaying(shouldPlay);
|
|
273
|
+
}, [current, openedWebView, playing, setPlaying]);
|
|
272
274
|
React.useEffect(function () {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
} else if (current && (isView || isEdit)) {
|
|
276
|
-
setBackgroundPlaying(!openedWebView);
|
|
277
|
-
}
|
|
275
|
+
var shouldBackgroundBePlaying = current && !openedWebView && (isView || isEdit);
|
|
276
|
+
setBackgroundPlaying(shouldBackgroundBePlaying);
|
|
278
277
|
}, [current, isView, isEdit, openedWebView, setBackgroundPlaying]);
|
|
279
278
|
hooks.useDebounce(playIfCurrent, current, 500);
|
|
280
|
-
|
|
281
|
-
var _ref6 = background || {},
|
|
282
|
-
_ref6$video = _ref6.video,
|
|
283
|
-
backgroundVideo = _ref6$video === void 0 ? null : _ref6$video;
|
|
284
|
-
|
|
285
|
-
var hasVideoBackground = backgroundVideo !== null;
|
|
286
279
|
var items = [/*#__PURE__*/React__default["default"].createElement(components.ScreenElement, {
|
|
287
280
|
key: "overTitle",
|
|
288
281
|
placeholder: /*#__PURE__*/React__default["default"].createElement(components.PlaceholderSubtitle, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-urbania-article",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.266",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -51,19 +51,19 @@
|
|
|
51
51
|
"@babel/runtime": "^7.13.10",
|
|
52
52
|
"@folklore/fetch": "^0.1.15",
|
|
53
53
|
"@folklore/size": "^0.1.20",
|
|
54
|
-
"@micromag/core": "^0.3.
|
|
55
|
-
"@micromag/element-background": "^0.3.
|
|
56
|
-
"@micromag/element-call-to-action": "^0.3.
|
|
57
|
-
"@micromag/element-closed-captions": "^0.3.
|
|
58
|
-
"@micromag/element-container": "^0.3.
|
|
59
|
-
"@micromag/element-heading": "^0.3.
|
|
60
|
-
"@micromag/element-image": "^0.3.
|
|
61
|
-
"@micromag/element-media-controls": "^0.3.
|
|
62
|
-
"@micromag/element-text": "^0.3.
|
|
63
|
-
"@micromag/element-urbania-author": "^0.3.
|
|
64
|
-
"@micromag/element-video": "^0.3.
|
|
65
|
-
"@micromag/element-visual": "^0.3.
|
|
66
|
-
"@micromag/transforms": "^0.3.
|
|
54
|
+
"@micromag/core": "^0.3.265",
|
|
55
|
+
"@micromag/element-background": "^0.3.266",
|
|
56
|
+
"@micromag/element-call-to-action": "^0.3.265",
|
|
57
|
+
"@micromag/element-closed-captions": "^0.3.265",
|
|
58
|
+
"@micromag/element-container": "^0.3.265",
|
|
59
|
+
"@micromag/element-heading": "^0.3.265",
|
|
60
|
+
"@micromag/element-image": "^0.3.265",
|
|
61
|
+
"@micromag/element-media-controls": "^0.3.265",
|
|
62
|
+
"@micromag/element-text": "^0.3.265",
|
|
63
|
+
"@micromag/element-urbania-author": "^0.3.265",
|
|
64
|
+
"@micromag/element-video": "^0.3.265",
|
|
65
|
+
"@micromag/element-visual": "^0.3.265",
|
|
66
|
+
"@micromag/transforms": "^0.3.265",
|
|
67
67
|
"classnames": "^2.2.6",
|
|
68
68
|
"lodash": "^4.17.21",
|
|
69
69
|
"prop-types": "^15.7.2",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "562d67e6a6146225391a02d951a98b1b5deeb06e"
|
|
77
77
|
}
|