@micromag/viewer 0.3.35 → 0.3.38

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
@@ -71,7 +71,7 @@ function useKeyboardShortcuts() {
71
71
  window.removeEventListener('keydown', onKey);
72
72
  }
73
73
  };
74
- }, [disabled]);
74
+ }, [disabled, shortcuts]);
75
75
  }
76
76
 
77
77
  function checkClickable(el) {
@@ -181,6 +181,7 @@ function useScreenInteraction() {
181
181
  contentX = _e$currentTarget$getB2 === void 0 ? 0 : _e$currentTarget$getB2;
182
182
 
183
183
  var tapX = e.clientX;
184
+ console.log(e.clientX, contentX, screenWidth);
184
185
  var hasTappedLeft = tappedCurrent ? tapX - contentX < screenWidth * (1 - nextScreenWidthPercent) : screenIndex > index;
185
186
 
186
187
  if (hasTappedLeft) {
@@ -743,7 +744,7 @@ var defaultProps$5 = {
743
744
  onClickItem: null,
744
745
  onClose: null,
745
746
  onShare: null,
746
- thumbsPerLine: 4,
747
+ thumbsPerLine: 3,
747
748
  toggleFullscreen: null,
748
749
  fullscreenActive: false,
749
750
  fullscreenEnabled: false,
@@ -1574,7 +1575,7 @@ var Viewer = function Viewer(_ref) {
1574
1575
  var _useScreenInteraction = useScreenInteraction({
1575
1576
  screens: screens,
1576
1577
  screenIndex: screenIndex,
1577
- screenWidth: screenWidth,
1578
+ screenWidth: screenContainerWidth,
1578
1579
  isView: isView,
1579
1580
  clickOnSiblings: landscape && withLandscapeSiblingsScreens,
1580
1581
  nextScreenWidthPercent: tapNextScreenWidthPercent,
package/lib/index.js CHANGED
@@ -89,7 +89,7 @@ function useKeyboardShortcuts() {
89
89
  window.removeEventListener('keydown', onKey);
90
90
  }
91
91
  };
92
- }, [disabled]);
92
+ }, [disabled, shortcuts]);
93
93
  }
94
94
 
95
95
  function checkClickable(el) {
@@ -199,6 +199,7 @@ function useScreenInteraction() {
199
199
  contentX = _e$currentTarget$getB2 === void 0 ? 0 : _e$currentTarget$getB2;
200
200
 
201
201
  var tapX = e.clientX;
202
+ console.log(e.clientX, contentX, screenWidth);
202
203
  var hasTappedLeft = tappedCurrent ? tapX - contentX < screenWidth * (1 - nextScreenWidthPercent) : screenIndex > index;
203
204
 
204
205
  if (hasTappedLeft) {
@@ -761,7 +762,7 @@ var defaultProps$5 = {
761
762
  onClickItem: null,
762
763
  onClose: null,
763
764
  onShare: null,
764
- thumbsPerLine: 4,
765
+ thumbsPerLine: 3,
765
766
  toggleFullscreen: null,
766
767
  fullscreenActive: false,
767
768
  fullscreenEnabled: false,
@@ -1592,7 +1593,7 @@ var Viewer = function Viewer(_ref) {
1592
1593
  var _useScreenInteraction = useScreenInteraction({
1593
1594
  screens: screens,
1594
1595
  screenIndex: screenIndex,
1595
- screenWidth: screenWidth,
1596
+ screenWidth: screenContainerWidth,
1596
1597
  isView: isView,
1597
1598
  clickOnSiblings: landscape && withLandscapeSiblingsScreens,
1598
1599
  nextScreenWidthPercent: tapNextScreenWidthPercent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/viewer",
3
- "version": "0.3.35",
3
+ "version": "0.3.38",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -59,12 +59,12 @@
59
59
  "@fortawesome/fontawesome-svg-core": "^1.2.32",
60
60
  "@fortawesome/free-solid-svg-icons": "^5.15.1",
61
61
  "@fortawesome/react-fontawesome": "^0.1.13",
62
- "@micromag/core": "^0.3.35",
63
- "@micromag/element-scroll": "^0.3.35",
64
- "@micromag/elements": "^0.3.35",
65
- "@micromag/fields": "^0.3.35",
66
- "@micromag/intl": "^0.3.35",
67
- "@micromag/screens": "^0.3.35",
62
+ "@micromag/core": "^0.3.36",
63
+ "@micromag/element-scroll": "^0.3.36",
64
+ "@micromag/elements": "^0.3.38",
65
+ "@micromag/fields": "^0.3.36",
66
+ "@micromag/intl": "^0.3.36",
67
+ "@micromag/screens": "^0.3.38",
68
68
  "@react-spring/core": "^9.1.1",
69
69
  "@react-spring/web": "^9.1.1",
70
70
  "@use-gesture/react": "^10.2.4",
@@ -81,5 +81,5 @@
81
81
  "publishConfig": {
82
82
  "access": "public"
83
83
  },
84
- "gitHead": "4fd919d4dadf04fd8265b6bae91a9c5b77981db0"
84
+ "gitHead": "baf0eaac0b23e2b24d43d3518d64be1072538962"
85
85
  }