@micromag/viewer 0.3.686 → 0.3.687

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 +12 -9
  2. package/package.json +2 -2
package/es/index.js CHANGED
@@ -2970,9 +2970,12 @@ var Viewer = function Viewer(_ref) {
2970
2970
  _usePlaybackContext$c = _usePlaybackContext.controls,
2971
2971
  playbackControls = _usePlaybackContext$c === void 0 ? false : _usePlaybackContext$c,
2972
2972
  _usePlaybackContext$c2 = _usePlaybackContext.controlsVisible,
2973
- playbackcontrolsVisible = _usePlaybackContext$c2 === void 0 ? false : _usePlaybackContext$c2,
2973
+ playbackControlsVisible = _usePlaybackContext$c2 === void 0 ? false : _usePlaybackContext$c2,
2974
2974
  _usePlaybackContext$m = _usePlaybackContext.media,
2975
2975
  playbackMedia = _usePlaybackContext$m === void 0 ? null : _usePlaybackContext$m;
2976
+ var playbackHelpVisible = useMemo(function () {
2977
+ return playbackControls && playbackControlsVisible;
2978
+ }, [playbackControls, playbackControlsVisible]);
2976
2979
  var _useDimensionObserver = useDimensionObserver(),
2977
2980
  playbackControlsContainerRef = _useDimensionObserver.ref,
2978
2981
  _useDimensionObserver2 = _useDimensionObserver.height,
@@ -3379,7 +3382,7 @@ var Viewer = function Viewer(_ref) {
3379
3382
  var bottomHeight = 0;
3380
3383
  if (bottomSafezoneHeight !== null) {
3381
3384
  bottomHeight = bottomSafezoneHeight / screenScale;
3382
- } else if (playbackControls && (playbackcontrolsVisible || !playing) && currentScreenInteractionEnabled) {
3385
+ } else if (playbackControls && (playbackControlsVisible || !playing) && currentScreenInteractionEnabled) {
3383
3386
  bottomHeight = playbackControlsContainerHeight / screenScale;
3384
3387
  }
3385
3388
  var NavigationHint = withNavigationHint === 'hand' ? HandTap : ArrowHint;
@@ -3403,7 +3406,7 @@ var Viewer = function Viewer(_ref) {
3403
3406
  height: viewerHeight,
3404
3407
  topHeight: topHeight,
3405
3408
  bottomHeight: bottomHeight,
3406
- bottomSidesWidth: (playbackcontrolsVisible || !playing || playbackMedia !== null) && currentScreenInteractionEnabled ? 60 / screenScale : 0,
3409
+ bottomSidesWidth: (playbackControlsVisible || !playing || playbackMedia !== null) && currentScreenInteractionEnabled ? 60 / screenScale : 0,
3407
3410
  gotoPreviousScreen: gotoPreviousScreen,
3408
3411
  gotoNextScreen: gotoNextScreen,
3409
3412
  disableInteraction: disableInteraction,
@@ -3416,7 +3419,7 @@ var Viewer = function Viewer(_ref) {
3416
3419
  }), /*#__PURE__*/React.createElement("div", {
3417
3420
  className: classNames([styles$7.container, screenSize.screens.map(function (screenName) {
3418
3421
  return "story-screen-".concat(screenName);
3419
- }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles$7.landscape, landscape), styles$7.withoutGestures, withoutGestures), styles$7.hideMenu, !menuVisible), styles$7.disableMenu, navigationDisabled), styles$7.fadeMenu, playing && playbackControls && !playbackcontrolsVisible), styles$7.ready, ready || withoutScreensTransforms), styles$7.hasInteracted, hasInteracted), styles$7.isDragging, isDragging), className, className)]),
3422
+ }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles$7.landscape, landscape), styles$7.withoutGestures, withoutGestures), styles$7.hideMenu, !menuVisible), styles$7.disableMenu, navigationDisabled), styles$7.fadeMenu, playing && playbackControls && !playbackControlsVisible), styles$7.ready, ready || withoutScreensTransforms), styles$7.hasInteracted, hasInteracted), styles$7.isDragging, isDragging), className, className)]),
3420
3423
  ref: containerRef,
3421
3424
  onContextMenu: onContextMenu
3422
3425
  }, /*#__PURE__*/React.createElement("div", {
@@ -3451,18 +3454,18 @@ var Viewer = function Viewer(_ref) {
3451
3454
  }]
3452
3455
  }),
3453
3456
  className: styles$7.accessibilityLinks
3454
- }, /*#__PURE__*/React.createElement(Button, {
3457
+ }, playbackHelpVisible ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
3455
3458
  onClick: onClickSkipToPlaybackControls,
3456
- "aria-disabled": withoutPlaybackControls || !playbackcontrolsVisible,
3459
+ "aria-disabled": withoutPlaybackControls || !playbackControlsVisible,
3457
3460
  "aria-describedby": "disabledReason",
3458
- className: classNames([styles$7.accessibilityButton, _defineProperty({}, styles$7.disabled, withoutPlaybackControls || !playbackcontrolsVisible)])
3461
+ className: classNames([styles$7.accessibilityButton, _defineProperty({}, styles$7.disabled, withoutPlaybackControls || !playbackControlsVisible)])
3459
3462
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
3460
3463
  id: "CnVj9r",
3461
3464
  defaultMessage: [{
3462
3465
  "type": 0,
3463
3466
  "value": "Skip to controls"
3464
3467
  }]
3465
- })), withoutPlaybackControls || !playbackcontrolsVisible ? /*#__PURE__*/React.createElement("div", {
3468
+ })), withoutPlaybackControls || !playbackControlsVisible ? /*#__PURE__*/React.createElement("div", {
3466
3469
  role: "tooltip",
3467
3470
  className: styles$7.tooltipBox,
3468
3471
  id: "disabledReason"
@@ -3474,7 +3477,7 @@ var Viewer = function Viewer(_ref) {
3474
3477
  "type": 0,
3475
3478
  "value": "No controls available"
3476
3479
  }]
3477
- }))) : null), !withoutMenu ? /*#__PURE__*/React.createElement(ViewerMenu$1, {
3480
+ }))) : null) : null), !withoutMenu ? /*#__PURE__*/React.createElement(ViewerMenu$1, {
3478
3481
  story: parsedStory,
3479
3482
  currentScreenIndex: screenIndex,
3480
3483
  withShadow: menuOverScreen && !withoutMenuShadow,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/viewer",
3
- "version": "0.3.686",
3
+ "version": "0.3.687",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -92,5 +92,5 @@
92
92
  "access": "public",
93
93
  "registry": "https://registry.npmjs.org/"
94
94
  },
95
- "gitHead": "5bc6e156b107a08b875192cf654a4506cfacd2ca"
95
+ "gitHead": "6948bdcb137330d244f07ec81d126ae669c5dd07"
96
96
  }