@micromag/viewer 0.3.340 → 0.3.342
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 +29 -21
- package/lib/index.js +29 -21
- package/package.json +6 -6
package/es/index.js
CHANGED
|
@@ -607,7 +607,7 @@ var ViewerMenuDot = function ViewerMenuDot(_ref) {
|
|
|
607
607
|
count = _ref.count,
|
|
608
608
|
subIndex = _ref.subIndex,
|
|
609
609
|
vertical = _ref.vertical,
|
|
610
|
-
|
|
610
|
+
_onClick = _ref.onClick,
|
|
611
611
|
className = _ref.className;
|
|
612
612
|
var _ref2 = colors || {},
|
|
613
613
|
_ref2$primary = _ref2.primary,
|
|
@@ -641,7 +641,15 @@ var ViewerMenuDot = function ViewerMenuDot(_ref) {
|
|
|
641
641
|
}, /*#__PURE__*/React.createElement("button", {
|
|
642
642
|
type: "button",
|
|
643
643
|
className: styles$c.button,
|
|
644
|
-
onClick: onClick
|
|
644
|
+
onClick: function onClick() {
|
|
645
|
+
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
646
|
+
if (e !== null) {
|
|
647
|
+
e.stopPropagation();
|
|
648
|
+
}
|
|
649
|
+
if (_onClick !== null) {
|
|
650
|
+
_onClick();
|
|
651
|
+
}
|
|
652
|
+
},
|
|
645
653
|
tabIndex: "-1"
|
|
646
654
|
}, /*#__PURE__*/React.createElement("div", {
|
|
647
655
|
className: styles$c.dot,
|
|
@@ -880,6 +888,10 @@ var ViewerMenuScreen = function ViewerMenuScreen(_ref) {
|
|
|
880
888
|
type: "button",
|
|
881
889
|
className: styles$a.button,
|
|
882
890
|
onClick: function onClick() {
|
|
891
|
+
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
892
|
+
if (e !== null) {
|
|
893
|
+
e.stopPropagation();
|
|
894
|
+
}
|
|
883
895
|
if (_onClick !== null) {
|
|
884
896
|
_onClick(item);
|
|
885
897
|
}
|
|
@@ -1250,7 +1262,7 @@ var propTypes$9 = {
|
|
|
1250
1262
|
withoutScreensMenu: PropTypes.bool,
|
|
1251
1263
|
withoutShareMenu: PropTypes.bool,
|
|
1252
1264
|
onClickScreen: PropTypes.func,
|
|
1253
|
-
onClickMenu: PropTypes.func,
|
|
1265
|
+
// onClickMenu: PropTypes.func,
|
|
1254
1266
|
onClickCloseViewer: PropTypes.func,
|
|
1255
1267
|
refDots: PropTypes.shape({
|
|
1256
1268
|
current: PropTypes.any // eslint-disable-line
|
|
@@ -1273,7 +1285,7 @@ var defaultProps$9 = {
|
|
|
1273
1285
|
withoutScreensMenu: false,
|
|
1274
1286
|
withoutShareMenu: false,
|
|
1275
1287
|
onClickScreen: null,
|
|
1276
|
-
onClickMenu: null,
|
|
1288
|
+
// onClickMenu: null,
|
|
1277
1289
|
onClickCloseViewer: null,
|
|
1278
1290
|
refDots: null
|
|
1279
1291
|
};
|
|
@@ -1294,9 +1306,8 @@ var ViewerMenu = function ViewerMenu(_ref) {
|
|
|
1294
1306
|
withDotItemClick = _ref.withDotItemClick,
|
|
1295
1307
|
withoutScreensMenu = _ref.withoutScreensMenu,
|
|
1296
1308
|
withoutShareMenu = _ref.withoutShareMenu,
|
|
1297
|
-
customOnClickScreen = _ref.onClickScreen
|
|
1298
|
-
_ref.
|
|
1299
|
-
var onClickCloseViewer = _ref.onClickCloseViewer,
|
|
1309
|
+
customOnClickScreen = _ref.onClickScreen,
|
|
1310
|
+
onClickCloseViewer = _ref.onClickCloseViewer,
|
|
1300
1311
|
refDots = _ref.refDots;
|
|
1301
1312
|
var _story$components = story.components,
|
|
1302
1313
|
screens = _story$components === void 0 ? [] : _story$components,
|
|
@@ -1729,11 +1740,14 @@ var defaultProps$7 = {
|
|
|
1729
1740
|
};
|
|
1730
1741
|
var NavigationButton = function NavigationButton(_ref) {
|
|
1731
1742
|
var direction = _ref.direction,
|
|
1732
|
-
|
|
1743
|
+
_onClick = _ref.onClick,
|
|
1733
1744
|
className = _ref.className;
|
|
1734
1745
|
return /*#__PURE__*/React.createElement(IconButton, {
|
|
1735
1746
|
className: classNames([styles$4.container, styles$4[direction], _defineProperty({}, className, className !== null)]),
|
|
1736
|
-
onClick: onClick
|
|
1747
|
+
onClick: function onClick(e) {
|
|
1748
|
+
e.stopPropagation();
|
|
1749
|
+
_onClick();
|
|
1750
|
+
},
|
|
1737
1751
|
iconPosition: direction === 'next' ? 'right' : 'left',
|
|
1738
1752
|
icon: /*#__PURE__*/React.createElement("svg", {
|
|
1739
1753
|
className: styles$4.arrow,
|
|
@@ -1992,7 +2006,7 @@ var propTypes$4 = {
|
|
|
1992
2006
|
};
|
|
1993
2007
|
var defaultProps$4 = {
|
|
1994
2008
|
defaultColor: {
|
|
1995
|
-
color: '#
|
|
2009
|
+
color: '#FFFFFF',
|
|
1996
2010
|
alpha: 1
|
|
1997
2011
|
},
|
|
1998
2012
|
className: null,
|
|
@@ -2600,16 +2614,10 @@ var Viewer = function Viewer(_ref) {
|
|
|
2600
2614
|
eventsManager.emit("navigate_".concat(direction), newIndex);
|
|
2601
2615
|
}
|
|
2602
2616
|
}, [onEnd, changeIndex]);
|
|
2603
|
-
var gotoPreviousScreen = useCallback(function (
|
|
2604
|
-
if (typeof e !== 'undefined') {
|
|
2605
|
-
e.stopPropagation();
|
|
2606
|
-
}
|
|
2617
|
+
var gotoPreviousScreen = useCallback(function () {
|
|
2607
2618
|
changeIndex(Math.max(0, screenIndex - 1));
|
|
2608
2619
|
}, [changeIndex, screenIndex]);
|
|
2609
|
-
var gotoNextScreen = useCallback(function (
|
|
2610
|
-
if (typeof e !== 'undefined') {
|
|
2611
|
-
e.stopPropagation();
|
|
2612
|
-
}
|
|
2620
|
+
var gotoNextScreen = useCallback(function () {
|
|
2613
2621
|
changeIndex(Math.min(screens.length - 1, screenIndex + 1));
|
|
2614
2622
|
}, [changeIndex, screenIndex]);
|
|
2615
2623
|
var _useState = useState(false),
|
|
@@ -2644,6 +2652,9 @@ var Viewer = function Viewer(_ref) {
|
|
|
2644
2652
|
_ref10$xy = _slicedToArray(_ref10.xy, 2),
|
|
2645
2653
|
x = _ref10$xy[0],
|
|
2646
2654
|
y = _ref10$xy[1];
|
|
2655
|
+
if (event) {
|
|
2656
|
+
event.stopPropagation();
|
|
2657
|
+
}
|
|
2647
2658
|
interactWithScreen({
|
|
2648
2659
|
event: event,
|
|
2649
2660
|
target: target,
|
|
@@ -2692,9 +2703,6 @@ var Viewer = function Viewer(_ref) {
|
|
|
2692
2703
|
var onTransitionComplete = useCallback(function () {
|
|
2693
2704
|
setTransitioned(true);
|
|
2694
2705
|
}, [setTransitioned]);
|
|
2695
|
-
|
|
2696
|
-
// console.log({ transitioned });
|
|
2697
|
-
|
|
2698
2706
|
var springParams = useMemo(function () {
|
|
2699
2707
|
return {
|
|
2700
2708
|
config: SPRING_CONFIG_TIGHT,
|
package/lib/index.js
CHANGED
|
@@ -627,7 +627,7 @@ var ViewerMenuDot = function ViewerMenuDot(_ref) {
|
|
|
627
627
|
count = _ref.count,
|
|
628
628
|
subIndex = _ref.subIndex,
|
|
629
629
|
vertical = _ref.vertical,
|
|
630
|
-
|
|
630
|
+
_onClick = _ref.onClick,
|
|
631
631
|
className = _ref.className;
|
|
632
632
|
var _ref2 = colors || {},
|
|
633
633
|
_ref2$primary = _ref2.primary,
|
|
@@ -661,7 +661,15 @@ var ViewerMenuDot = function ViewerMenuDot(_ref) {
|
|
|
661
661
|
}, /*#__PURE__*/React__default["default"].createElement("button", {
|
|
662
662
|
type: "button",
|
|
663
663
|
className: styles$c.button,
|
|
664
|
-
onClick: onClick
|
|
664
|
+
onClick: function onClick() {
|
|
665
|
+
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
666
|
+
if (e !== null) {
|
|
667
|
+
e.stopPropagation();
|
|
668
|
+
}
|
|
669
|
+
if (_onClick !== null) {
|
|
670
|
+
_onClick();
|
|
671
|
+
}
|
|
672
|
+
},
|
|
665
673
|
tabIndex: "-1"
|
|
666
674
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
667
675
|
className: styles$c.dot,
|
|
@@ -900,6 +908,10 @@ var ViewerMenuScreen = function ViewerMenuScreen(_ref) {
|
|
|
900
908
|
type: "button",
|
|
901
909
|
className: styles$a.button,
|
|
902
910
|
onClick: function onClick() {
|
|
911
|
+
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
912
|
+
if (e !== null) {
|
|
913
|
+
e.stopPropagation();
|
|
914
|
+
}
|
|
903
915
|
if (_onClick !== null) {
|
|
904
916
|
_onClick(item);
|
|
905
917
|
}
|
|
@@ -1270,7 +1282,7 @@ var propTypes$9 = {
|
|
|
1270
1282
|
withoutScreensMenu: PropTypes__default["default"].bool,
|
|
1271
1283
|
withoutShareMenu: PropTypes__default["default"].bool,
|
|
1272
1284
|
onClickScreen: PropTypes__default["default"].func,
|
|
1273
|
-
onClickMenu:
|
|
1285
|
+
// onClickMenu: PropTypes.func,
|
|
1274
1286
|
onClickCloseViewer: PropTypes__default["default"].func,
|
|
1275
1287
|
refDots: PropTypes__default["default"].shape({
|
|
1276
1288
|
current: PropTypes__default["default"].any // eslint-disable-line
|
|
@@ -1293,7 +1305,7 @@ var defaultProps$9 = {
|
|
|
1293
1305
|
withoutScreensMenu: false,
|
|
1294
1306
|
withoutShareMenu: false,
|
|
1295
1307
|
onClickScreen: null,
|
|
1296
|
-
onClickMenu: null,
|
|
1308
|
+
// onClickMenu: null,
|
|
1297
1309
|
onClickCloseViewer: null,
|
|
1298
1310
|
refDots: null
|
|
1299
1311
|
};
|
|
@@ -1314,9 +1326,8 @@ var ViewerMenu = function ViewerMenu(_ref) {
|
|
|
1314
1326
|
withDotItemClick = _ref.withDotItemClick,
|
|
1315
1327
|
withoutScreensMenu = _ref.withoutScreensMenu,
|
|
1316
1328
|
withoutShareMenu = _ref.withoutShareMenu,
|
|
1317
|
-
customOnClickScreen = _ref.onClickScreen
|
|
1318
|
-
_ref.
|
|
1319
|
-
var onClickCloseViewer = _ref.onClickCloseViewer,
|
|
1329
|
+
customOnClickScreen = _ref.onClickScreen,
|
|
1330
|
+
onClickCloseViewer = _ref.onClickCloseViewer,
|
|
1320
1331
|
refDots = _ref.refDots;
|
|
1321
1332
|
var _story$components = story.components,
|
|
1322
1333
|
screens = _story$components === void 0 ? [] : _story$components,
|
|
@@ -1749,11 +1760,14 @@ var defaultProps$7 = {
|
|
|
1749
1760
|
};
|
|
1750
1761
|
var NavigationButton = function NavigationButton(_ref) {
|
|
1751
1762
|
var direction = _ref.direction,
|
|
1752
|
-
|
|
1763
|
+
_onClick = _ref.onClick,
|
|
1753
1764
|
className = _ref.className;
|
|
1754
1765
|
return /*#__PURE__*/React__default["default"].createElement(IconButton, {
|
|
1755
1766
|
className: classNames__default["default"]([styles$4.container, styles$4[direction], _defineProperty__default["default"]({}, className, className !== null)]),
|
|
1756
|
-
onClick: onClick
|
|
1767
|
+
onClick: function onClick(e) {
|
|
1768
|
+
e.stopPropagation();
|
|
1769
|
+
_onClick();
|
|
1770
|
+
},
|
|
1757
1771
|
iconPosition: direction === 'next' ? 'right' : 'left',
|
|
1758
1772
|
icon: /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
1759
1773
|
className: styles$4.arrow,
|
|
@@ -2012,7 +2026,7 @@ var propTypes$4 = {
|
|
|
2012
2026
|
};
|
|
2013
2027
|
var defaultProps$4 = {
|
|
2014
2028
|
defaultColor: {
|
|
2015
|
-
color: '#
|
|
2029
|
+
color: '#FFFFFF',
|
|
2016
2030
|
alpha: 1
|
|
2017
2031
|
},
|
|
2018
2032
|
className: null,
|
|
@@ -2620,16 +2634,10 @@ var Viewer = function Viewer(_ref) {
|
|
|
2620
2634
|
eventsManager.emit("navigate_".concat(direction), newIndex);
|
|
2621
2635
|
}
|
|
2622
2636
|
}, [onEnd, changeIndex]);
|
|
2623
|
-
var gotoPreviousScreen = React.useCallback(function (
|
|
2624
|
-
if (typeof e !== 'undefined') {
|
|
2625
|
-
e.stopPropagation();
|
|
2626
|
-
}
|
|
2637
|
+
var gotoPreviousScreen = React.useCallback(function () {
|
|
2627
2638
|
changeIndex(Math.max(0, screenIndex - 1));
|
|
2628
2639
|
}, [changeIndex, screenIndex]);
|
|
2629
|
-
var gotoNextScreen = React.useCallback(function (
|
|
2630
|
-
if (typeof e !== 'undefined') {
|
|
2631
|
-
e.stopPropagation();
|
|
2632
|
-
}
|
|
2640
|
+
var gotoNextScreen = React.useCallback(function () {
|
|
2633
2641
|
changeIndex(Math.min(screens.length - 1, screenIndex + 1));
|
|
2634
2642
|
}, [changeIndex, screenIndex]);
|
|
2635
2643
|
var _useState = React.useState(false),
|
|
@@ -2664,6 +2672,9 @@ var Viewer = function Viewer(_ref) {
|
|
|
2664
2672
|
_ref10$xy = _slicedToArray__default["default"](_ref10.xy, 2),
|
|
2665
2673
|
x = _ref10$xy[0],
|
|
2666
2674
|
y = _ref10$xy[1];
|
|
2675
|
+
if (event) {
|
|
2676
|
+
event.stopPropagation();
|
|
2677
|
+
}
|
|
2667
2678
|
interactWithScreen({
|
|
2668
2679
|
event: event,
|
|
2669
2680
|
target: target,
|
|
@@ -2712,9 +2723,6 @@ var Viewer = function Viewer(_ref) {
|
|
|
2712
2723
|
var onTransitionComplete = React.useCallback(function () {
|
|
2713
2724
|
setTransitioned(true);
|
|
2714
2725
|
}, [setTransitioned]);
|
|
2715
|
-
|
|
2716
|
-
// console.log({ transitioned });
|
|
2717
|
-
|
|
2718
2726
|
var springParams = React.useMemo(function () {
|
|
2719
2727
|
return {
|
|
2720
2728
|
config: SPRING_CONFIG_TIGHT,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/viewer",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.342",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"@micromag/element-scroll": "^0.3.332",
|
|
64
64
|
"@micromag/element-share-options": "^0.3.332",
|
|
65
65
|
"@micromag/element-webview": "^0.3.332",
|
|
66
|
-
"@micromag/elements": "^0.3.
|
|
67
|
-
"@micromag/fields": "^0.3.
|
|
68
|
-
"@micromag/intl": "^0.3.
|
|
69
|
-
"@micromag/screens": "^0.3.
|
|
66
|
+
"@micromag/elements": "^0.3.341",
|
|
67
|
+
"@micromag/fields": "^0.3.342",
|
|
68
|
+
"@micromag/intl": "^0.3.342",
|
|
69
|
+
"@micromag/screens": "^0.3.342",
|
|
70
70
|
"@react-spring/core": "^9.6.1",
|
|
71
71
|
"@react-spring/web": "^9.6.1",
|
|
72
72
|
"@use-gesture/react": "^10.2.4",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "fe7a18d0cc006d5c4c634c9554f2a7cec5a608d0"
|
|
89
89
|
}
|