@micromag/screen-urbania-recommendation 0.3.637 → 0.3.641

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.
Files changed (2) hide show
  1. package/es/index.js +3 -36
  2. package/package.json +2 -2
package/es/index.js CHANGED
@@ -7,8 +7,8 @@ import PropTypes from 'prop-types';
7
7
  import React, { useState, useMemo, useEffect, useCallback } from 'react';
8
8
  import { PropTypes as PropTypes$1 } from '@micromag/core';
9
9
  import { Close, ScreenElement, PlaceholderImage, MuteIcon, FullscreenIcon, PlaceholderText, PlaceholderTitle } from '@micromag/core/components';
10
- import { useScreenSize, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef, useViewerInteraction, useScreenRenderContext, useViewerContainer } from '@micromag/core/contexts';
11
- import { useTrackScreenEvent, useResizeObserver, useActivityDetector, useDebounce } from '@micromag/core/hooks';
10
+ import { useScreenSize, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef, useViewerInteraction, useScreenRenderContext } from '@micromag/core/contexts';
11
+ import { useTrackScreenEvent, useResizeObserver } from '@micromag/core/hooks';
12
12
  import { isTextFilled, isHeaderFilled, isFooterFilled, getFooterProps, getStyleFromBox, getStyleFromText } from '@micromag/core/utils';
13
13
  import Background from '@micromag/element-background';
14
14
  import Button from '@micromag/element-button';
@@ -100,10 +100,7 @@ var UrbaniaRecommendation = function UrbaniaRecommendation(_ref) {
100
100
  playing = _usePlaybackContext.playing,
101
101
  setPlaying = _usePlaybackContext.setPlaying,
102
102
  muted = _usePlaybackContext.muted,
103
- setMuted = _usePlaybackContext.setMuted,
104
- setControls = _usePlaybackContext.setControls,
105
- showControls = _usePlaybackContext.showControls,
106
- hideControls = _usePlaybackContext.hideControls;
103
+ setMuted = _usePlaybackContext.setMuted;
107
104
  var mediaRef = usePlaybackMediaRef(current);
108
105
  var _useViewerInteraction = useViewerInteraction(),
109
106
  enableInteraction = _useViewerInteraction.enableInteraction,
@@ -299,36 +296,6 @@ var UrbaniaRecommendation = function UrbaniaRecommendation(_ref) {
299
296
  setPlaying(true);
300
297
  }
301
298
  }, [current, backgroundAnimationStarted]);
302
- useEffect(function () {
303
- if (!current) {
304
- return function () {};
305
- }
306
- if (visualModalOpened && isVideo) {
307
- setControls(true);
308
- } else {
309
- setControls(false);
310
- }
311
- return function () {
312
- if (visualModalOpened) {
313
- setControls(false);
314
- }
315
- };
316
- }, [current, setControls, visualModalOpened, isVideo]);
317
- var viewerContainer = useViewerContainer();
318
- var _useActivityDetector = useActivityDetector({
319
- element: viewerContainer,
320
- disabled: !isView,
321
- timeout: 2000
322
- }),
323
- activityDetected = _useActivityDetector.detected;
324
- var toggleControlsVisibility = useCallback(function () {
325
- if (activityDetected && isVideo && visualModalOpened) {
326
- showControls();
327
- } else {
328
- hideControls();
329
- }
330
- }, [activityDetected, showControls, isVideo, hideControls]);
331
- useDebounce(toggleControlsVisibility, activityDetected, 1000);
332
299
 
333
300
  // Default font weights ++ for urbania styles
334
301
  var _useMemo = useMemo(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-urbania-recommendation",
3
- "version": "0.3.637",
3
+ "version": "0.3.641",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -82,5 +82,5 @@
82
82
  "access": "public",
83
83
  "registry": "https://registry.npmjs.org/"
84
84
  },
85
- "gitHead": "8f06c2a525d71dc47183af7786284632a04332e1"
85
+ "gitHead": "e104f7c5ad33c8a3a32721b42cf5efa204e1d307"
86
86
  }