@micromag/screen-urbania-trivia 0.3.161 → 0.3.162

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
@@ -10,7 +10,7 @@ import React, { useEffect, useState, useCallback, useMemo } from 'react';
10
10
  import { PropTypes as PropTypes$1 } from '@micromag/core';
11
11
  import { ScreenElement, PlaceholderTitle, Empty, PlaceholderVideo, Transitions } from '@micromag/core/components';
12
12
  import { useScreenSize, useScreenRenderContext, useViewerContext, useViewerNavigation, usePlaybackContext, usePlaybackMediaRef } from '@micromag/core/contexts';
13
- import { useTrackScreenMedia, useActivityDetector, useDimensionObserver } from '@micromag/core/hooks';
13
+ import { useTrackScreenMedia, useViewerContainer, useActivityDetector, useDimensionObserver } from '@micromag/core/hooks';
14
14
  import { isTextFilled } from '@micromag/core/utils';
15
15
  import Background from '@micromag/element-background';
16
16
  import ClosedCaptions from '@micromag/element-closed-captions';
@@ -133,9 +133,8 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
133
133
  playing = _usePlaybackContext.playing,
134
134
  muted = _usePlaybackContext.muted,
135
135
  setControls = _usePlaybackContext.setControls,
136
- setControlsTheme = _usePlaybackContext.setControlsTheme;
137
- _usePlaybackContext.setMedia;
138
- var setPlaying = _usePlaybackContext.setPlaying,
136
+ setControlsTheme = _usePlaybackContext.setControlsTheme,
137
+ setPlaying = _usePlaybackContext.setPlaying,
139
138
  showControls = _usePlaybackContext.showControls,
140
139
  hideControls = _usePlaybackContext.hideControls;
141
140
 
@@ -210,12 +209,13 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
210
209
 
211
210
  setPlaying(false);
212
211
  }, [shouldGotoNextScreenOnEnd, gotoNextScreen, setPlaying]);
212
+ var viewerContainer = useViewerContainer();
213
213
 
214
214
  var _useActivityDetector = useActivityDetector({
215
+ element: viewerContainer,
215
216
  disabled: !current || !isView,
216
217
  timeout: 2000
217
218
  }),
218
- activityDetectorRef = _useActivityDetector.ref,
219
219
  activityDetected = _useActivityDetector.detected;
220
220
 
221
221
  useEffect(function () {
@@ -419,8 +419,7 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
419
419
  }) : null)) : null) : null))];
420
420
  return /*#__PURE__*/React.createElement("div", {
421
421
  className: classNames([styles.container, (_ref9 = {}, _defineProperty(_ref9, className, className !== null), _defineProperty(_ref9, styles.fullscreen, fullscreen), _ref9)]),
422
- "data-screen-ready": isStatic || isCapture || ready,
423
- ref: activityDetectorRef
422
+ "data-screen-ready": isStatic || isCapture || ready
424
423
  }, !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
425
424
  background: finalBackground,
426
425
  className: classNames([styles.background, (_ref10 = {}, _defineProperty(_ref10, className, className !== null), _defineProperty(_ref10, styles.isCustomBackground, isCustomBackground), _defineProperty(_ref10, styles.isAnimated, isAnimatedBackground), _ref10)]),
package/lib/index.js CHANGED
@@ -153,9 +153,8 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
153
153
  playing = _usePlaybackContext.playing,
154
154
  muted = _usePlaybackContext.muted,
155
155
  setControls = _usePlaybackContext.setControls,
156
- setControlsTheme = _usePlaybackContext.setControlsTheme;
157
- _usePlaybackContext.setMedia;
158
- var setPlaying = _usePlaybackContext.setPlaying,
156
+ setControlsTheme = _usePlaybackContext.setControlsTheme,
157
+ setPlaying = _usePlaybackContext.setPlaying,
159
158
  showControls = _usePlaybackContext.showControls,
160
159
  hideControls = _usePlaybackContext.hideControls;
161
160
 
@@ -230,12 +229,13 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
230
229
 
231
230
  setPlaying(false);
232
231
  }, [shouldGotoNextScreenOnEnd, gotoNextScreen, setPlaying]);
232
+ var viewerContainer = hooks.useViewerContainer();
233
233
 
234
234
  var _useActivityDetector = hooks.useActivityDetector({
235
+ element: viewerContainer,
235
236
  disabled: !current || !isView,
236
237
  timeout: 2000
237
238
  }),
238
- activityDetectorRef = _useActivityDetector.ref,
239
239
  activityDetected = _useActivityDetector.detected;
240
240
 
241
241
  React.useEffect(function () {
@@ -439,8 +439,7 @@ var UrbaniaTrivia = function UrbaniaTrivia(_ref) {
439
439
  }) : null)) : null) : null))];
440
440
  return /*#__PURE__*/React__default["default"].createElement("div", {
441
441
  className: classNames__default["default"]([styles.container, (_ref9 = {}, _defineProperty__default["default"](_ref9, className, className !== null), _defineProperty__default["default"](_ref9, styles.fullscreen, fullscreen), _ref9)]),
442
- "data-screen-ready": isStatic || isCapture || ready,
443
- ref: activityDetectorRef
442
+ "data-screen-ready": isStatic || isCapture || ready
444
443
  }, !isPlaceholder ? /*#__PURE__*/React__default["default"].createElement(Background__default["default"], {
445
444
  background: finalBackground,
446
445
  className: classNames__default["default"]([styles.background, (_ref10 = {}, _defineProperty__default["default"](_ref10, className, className !== null), _defineProperty__default["default"](_ref10, styles.isCustomBackground, isCustomBackground), _defineProperty__default["default"](_ref10, styles.isAnimated, isAnimatedBackground), _ref10)]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-urbania-trivia",
3
- "version": "0.3.161",
3
+ "version": "0.3.162",
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.161",
54
- "@micromag/element-background": "^0.3.161",
55
- "@micromag/element-call-to-action": "^0.3.161",
56
- "@micromag/element-closed-captions": "^0.3.161",
57
- "@micromag/element-container": "^0.3.161",
58
- "@micromag/element-heading": "^0.3.161",
59
- "@micromag/element-image": "^0.3.161",
60
- "@micromag/element-media-controls": "^0.3.161",
61
- "@micromag/element-video": "^0.3.161",
62
- "@micromag/transforms": "^0.3.161",
53
+ "@micromag/core": "^0.3.162",
54
+ "@micromag/element-background": "^0.3.162",
55
+ "@micromag/element-call-to-action": "^0.3.162",
56
+ "@micromag/element-closed-captions": "^0.3.162",
57
+ "@micromag/element-container": "^0.3.162",
58
+ "@micromag/element-heading": "^0.3.162",
59
+ "@micromag/element-image": "^0.3.162",
60
+ "@micromag/element-media-controls": "^0.3.162",
61
+ "@micromag/element-video": "^0.3.162",
62
+ "@micromag/transforms": "^0.3.162",
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": "badf4dd6125aa3169f3d01afc712be5b8181d898"
72
+ "gitHead": "ffd4deb967b364580d292f0e02af777abac02967"
73
73
  }