@micromag/viewer 0.3.33 → 0.3.36

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
@@ -743,7 +743,7 @@ var defaultProps$5 = {
743
743
  onClickItem: null,
744
744
  onClose: null,
745
745
  onShare: null,
746
- thumbsPerLine: 4,
746
+ thumbsPerLine: 3,
747
747
  toggleFullscreen: null,
748
748
  fullscreenActive: false,
749
749
  fullscreenEnabled: false,
@@ -1492,7 +1492,8 @@ var Viewer = function Viewer(_ref) {
1492
1492
  screens: deviceScreens
1493
1493
  }, screenSizeOptions)),
1494
1494
  containerRef = _useScreenSizeFromEle.ref,
1495
- screenSize = _useScreenSizeFromEle.screenSize;
1495
+ screenSize = _useScreenSizeFromEle.screenSize,
1496
+ screenScale = _useScreenSizeFromEle.scale;
1496
1497
 
1497
1498
  var _ref5 = screenSize || {},
1498
1499
  _ref5$width = _ref5.width,
@@ -1504,6 +1505,8 @@ var Viewer = function Viewer(_ref) {
1504
1505
  _ref5$menuOverScreen = _ref5.menuOverScreen,
1505
1506
  menuOverScreen = _ref5$menuOverScreen === void 0 ? false : _ref5$menuOverScreen;
1506
1507
 
1508
+ var screenContainerWidth = screenScale !== null ? screenWidth * screenScale : screenWidth;
1509
+ var screenContainerHeight = screenScale !== null ? screenHeight * screenScale : screenHeight;
1507
1510
  var hasSize = screenWidth > 0 && screenHeight > 0;
1508
1511
  var ready = hasSize; // && fontsLoaded;
1509
1512
 
@@ -1719,14 +1722,14 @@ var Viewer = function Viewer(_ref) {
1719
1722
  closeable: closeable,
1720
1723
  shareBasePath: basePath,
1721
1724
  screenSize: screenSize,
1722
- menuWidth: screenWidth,
1725
+ menuWidth: screenContainerWidth,
1723
1726
  trackingEnabled: trackingEnabled,
1724
1727
  onClickItem: onClickMenuItem,
1725
1728
  onClickMenu: onClickMenu,
1726
1729
  onClickCloseViewer: onCloseViewer,
1727
1730
  onRequestOpen: onMenuRequestOpen,
1728
1731
  onRequestClose: onMenuRequestClose,
1729
- withDotItemClick: screenWidth > 400,
1732
+ withDotItemClick: screenContainerWidth > 400,
1730
1733
  withoutScreensMenu: withoutScreensMenu,
1731
1734
  refDots: menuDotsContainerRef
1732
1735
  }) : null, ready || withoutScreensTransforms ? /*#__PURE__*/React.createElement("div", {
@@ -1756,7 +1759,7 @@ var Viewer = function Viewer(_ref) {
1756
1759
  var screenTransform = null;
1757
1760
 
1758
1761
  if (landscape) {
1759
- screenTransform = withLandscapeSiblingsScreens ? "translateX(calc(".concat((screenWidth + landscapeScreenMargin) * (i - screenIndex), "px - 50%)) scale(").concat(current ? 1 : 0.9, ")") : null;
1762
+ screenTransform = withLandscapeSiblingsScreens ? "translateX(calc(".concat((screenContainerWidth + landscapeScreenMargin) * (i - screenIndex), "px - 50%)) scale(").concat(current ? 1 : 0.9, ")") : null;
1760
1763
  } else {
1761
1764
  screenTransform = "translateX(".concat(current ? 0 : '100%', ")");
1762
1765
  }
@@ -1777,8 +1780,10 @@ var Viewer = function Viewer(_ref) {
1777
1780
  })) : null, /*#__PURE__*/React.createElement("div", {
1778
1781
  ref: current ? currentScreenRef : null,
1779
1782
  style: {
1780
- width: landscape ? screenWidth : null,
1781
- height: landscape ? screenHeight : null,
1783
+ // width: landscape ? screenWidth : null,
1784
+ // height: landscape ? screenHeight : null,
1785
+ width: screenContainerWidth,
1786
+ height: screenContainerHeight,
1782
1787
  transform: !withoutScreensTransforms ? screenTransform : null
1783
1788
  },
1784
1789
  className: classNames([styles$7.screen, (_ref13 = {}, _defineProperty(_ref13, styles$7.current, current), _defineProperty(_ref13, styles$7.visible, current || withLandscapeSiblingsScreens), _ref13)]),
@@ -1806,7 +1811,15 @@ var Viewer = function Viewer(_ref) {
1806
1811
  onClick: function onClick(e) {
1807
1812
  return onScreenClick(e, i);
1808
1813
  }
1809
- }, viewerScreen), current && screenIndex < screens.length ? /*#__PURE__*/React.createElement("button", {
1814
+ }, /*#__PURE__*/React.createElement("div", {
1815
+ className: styles$7.scaler,
1816
+ style: {
1817
+ width: screenWidth,
1818
+ height: screenHeight,
1819
+ transform: screenScale !== null ? "scale(".concat(screenScale, ")") : null,
1820
+ transformOrigin: screenScale !== null ? '0 0' : null
1821
+ }
1822
+ }, viewerScreen)), current && screenIndex < screens.length ? /*#__PURE__*/React.createElement("button", {
1810
1823
  type: "button",
1811
1824
  className: "sr-only",
1812
1825
  onClick: gotoNextScreen,
package/lib/index.js CHANGED
@@ -761,7 +761,7 @@ var defaultProps$5 = {
761
761
  onClickItem: null,
762
762
  onClose: null,
763
763
  onShare: null,
764
- thumbsPerLine: 4,
764
+ thumbsPerLine: 3,
765
765
  toggleFullscreen: null,
766
766
  fullscreenActive: false,
767
767
  fullscreenEnabled: false,
@@ -1510,7 +1510,8 @@ var Viewer = function Viewer(_ref) {
1510
1510
  screens: deviceScreens
1511
1511
  }, screenSizeOptions)),
1512
1512
  containerRef = _useScreenSizeFromEle.ref,
1513
- screenSize = _useScreenSizeFromEle.screenSize;
1513
+ screenSize = _useScreenSizeFromEle.screenSize,
1514
+ screenScale = _useScreenSizeFromEle.scale;
1514
1515
 
1515
1516
  var _ref5 = screenSize || {},
1516
1517
  _ref5$width = _ref5.width,
@@ -1522,6 +1523,8 @@ var Viewer = function Viewer(_ref) {
1522
1523
  _ref5$menuOverScreen = _ref5.menuOverScreen,
1523
1524
  menuOverScreen = _ref5$menuOverScreen === void 0 ? false : _ref5$menuOverScreen;
1524
1525
 
1526
+ var screenContainerWidth = screenScale !== null ? screenWidth * screenScale : screenWidth;
1527
+ var screenContainerHeight = screenScale !== null ? screenHeight * screenScale : screenHeight;
1525
1528
  var hasSize = screenWidth > 0 && screenHeight > 0;
1526
1529
  var ready = hasSize; // && fontsLoaded;
1527
1530
 
@@ -1737,14 +1740,14 @@ var Viewer = function Viewer(_ref) {
1737
1740
  closeable: closeable,
1738
1741
  shareBasePath: basePath,
1739
1742
  screenSize: screenSize,
1740
- menuWidth: screenWidth,
1743
+ menuWidth: screenContainerWidth,
1741
1744
  trackingEnabled: trackingEnabled,
1742
1745
  onClickItem: onClickMenuItem,
1743
1746
  onClickMenu: onClickMenu,
1744
1747
  onClickCloseViewer: onCloseViewer,
1745
1748
  onRequestOpen: onMenuRequestOpen,
1746
1749
  onRequestClose: onMenuRequestClose,
1747
- withDotItemClick: screenWidth > 400,
1750
+ withDotItemClick: screenContainerWidth > 400,
1748
1751
  withoutScreensMenu: withoutScreensMenu,
1749
1752
  refDots: menuDotsContainerRef
1750
1753
  }) : null, ready || withoutScreensTransforms ? /*#__PURE__*/React__default["default"].createElement("div", {
@@ -1774,7 +1777,7 @@ var Viewer = function Viewer(_ref) {
1774
1777
  var screenTransform = null;
1775
1778
 
1776
1779
  if (landscape) {
1777
- screenTransform = withLandscapeSiblingsScreens ? "translateX(calc(".concat((screenWidth + landscapeScreenMargin) * (i - screenIndex), "px - 50%)) scale(").concat(current ? 1 : 0.9, ")") : null;
1780
+ screenTransform = withLandscapeSiblingsScreens ? "translateX(calc(".concat((screenContainerWidth + landscapeScreenMargin) * (i - screenIndex), "px - 50%)) scale(").concat(current ? 1 : 0.9, ")") : null;
1778
1781
  } else {
1779
1782
  screenTransform = "translateX(".concat(current ? 0 : '100%', ")");
1780
1783
  }
@@ -1795,8 +1798,10 @@ var Viewer = function Viewer(_ref) {
1795
1798
  })) : null, /*#__PURE__*/React__default["default"].createElement("div", {
1796
1799
  ref: current ? currentScreenRef : null,
1797
1800
  style: {
1798
- width: landscape ? screenWidth : null,
1799
- height: landscape ? screenHeight : null,
1801
+ // width: landscape ? screenWidth : null,
1802
+ // height: landscape ? screenHeight : null,
1803
+ width: screenContainerWidth,
1804
+ height: screenContainerHeight,
1800
1805
  transform: !withoutScreensTransforms ? screenTransform : null
1801
1806
  },
1802
1807
  className: classNames__default["default"]([styles$7.screen, (_ref13 = {}, _defineProperty__default["default"](_ref13, styles$7.current, current), _defineProperty__default["default"](_ref13, styles$7.visible, current || withLandscapeSiblingsScreens), _ref13)]),
@@ -1824,7 +1829,15 @@ var Viewer = function Viewer(_ref) {
1824
1829
  onClick: function onClick(e) {
1825
1830
  return onScreenClick(e, i);
1826
1831
  }
1827
- }, viewerScreen), current && screenIndex < screens.length ? /*#__PURE__*/React__default["default"].createElement("button", {
1832
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
1833
+ className: styles$7.scaler,
1834
+ style: {
1835
+ width: screenWidth,
1836
+ height: screenHeight,
1837
+ transform: screenScale !== null ? "scale(".concat(screenScale, ")") : null,
1838
+ transformOrigin: screenScale !== null ? '0 0' : null
1839
+ }
1840
+ }, viewerScreen)), current && screenIndex < screens.length ? /*#__PURE__*/React__default["default"].createElement("button", {
1828
1841
  type: "button",
1829
1842
  className: "sr-only",
1830
1843
  onClick: gotoNextScreen,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/viewer",
3
- "version": "0.3.33",
3
+ "version": "0.3.36",
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.33",
63
- "@micromag/element-scroll": "^0.3.33",
64
- "@micromag/elements": "^0.3.33",
65
- "@micromag/fields": "^0.3.33",
66
- "@micromag/intl": "^0.3.33",
67
- "@micromag/screens": "^0.3.33",
62
+ "@micromag/core": "^0.3.36",
63
+ "@micromag/element-scroll": "^0.3.36",
64
+ "@micromag/elements": "^0.3.36",
65
+ "@micromag/fields": "^0.3.36",
66
+ "@micromag/intl": "^0.3.36",
67
+ "@micromag/screens": "^0.3.36",
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": "78b145a4e40bf65a48494f3dae58b3ce42534684"
84
+ "gitHead": "3a430d587a82acb0bf94fe7f842c7f96707a98f4"
85
85
  }