@micromag/viewer 0.4.21 → 0.4.22
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 -4
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -2897,6 +2897,34 @@ function Viewer(_ref) {
|
|
|
2897
2897
|
progressSpring = _useDragProgress.progress,
|
|
2898
2898
|
dragContentBind = _useDragProgress.bind,
|
|
2899
2899
|
transitionDirection = _useDragProgress.direction;
|
|
2900
|
+
|
|
2901
|
+
// Wrap gesture bindings to skip events from clickable elements (buttons, links, inputs).
|
|
2902
|
+
// Without this, @use-gesture captures pointer events at the document level, preventing
|
|
2903
|
+
// native click events from firing on interactive elements inside screens on mobile Safari.
|
|
2904
|
+
var clickableAwareBindings = useMemo(function () {
|
|
2905
|
+
var bindings = dragContentBind({
|
|
2906
|
+
playing: playing,
|
|
2907
|
+
longPressPaused: longPressPaused
|
|
2908
|
+
});
|
|
2909
|
+
var wrapped = {};
|
|
2910
|
+
var _loop = function _loop() {
|
|
2911
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
2912
|
+
key = _Object$entries$_i[0],
|
|
2913
|
+
value = _Object$entries$_i[1];
|
|
2914
|
+
if (typeof value === 'function') {
|
|
2915
|
+
wrapped[key] = function (e) {
|
|
2916
|
+
if (checkClickable(e.target)) return;
|
|
2917
|
+
return value(e);
|
|
2918
|
+
};
|
|
2919
|
+
} else {
|
|
2920
|
+
wrapped[key] = value;
|
|
2921
|
+
}
|
|
2922
|
+
};
|
|
2923
|
+
for (var _i = 0, _Object$entries = Object.entries(bindings); _i < _Object$entries.length; _i++) {
|
|
2924
|
+
_loop();
|
|
2925
|
+
}
|
|
2926
|
+
return wrapped;
|
|
2927
|
+
}, [dragContentBind, playing, longPressPaused]);
|
|
2900
2928
|
var getScreenStylesByIndex = function getScreenStylesByIndex(index, spring) {
|
|
2901
2929
|
if (transitionType === 'stack') {
|
|
2902
2930
|
return {
|
|
@@ -3220,10 +3248,7 @@ function Viewer(_ref) {
|
|
|
3220
3248
|
refDots: menuDotsContainerRef
|
|
3221
3249
|
}) : null, ready || withoutScreensTransforms ? /*#__PURE__*/React.createElement("div", Object.assign({
|
|
3222
3250
|
className: styles$7.content
|
|
3223
|
-
},
|
|
3224
|
-
playing: playing,
|
|
3225
|
-
longPressPaused: longPressPaused
|
|
3226
|
-
})), !withoutNavigationArrow && !withNeighborScreens && !navigationDisabled && screenIndex > 0 && screens.length > 1 ? /*#__PURE__*/React.createElement(NavigationButton, {
|
|
3251
|
+
}, clickableAwareBindings), !withoutNavigationArrow && !withNeighborScreens && !navigationDisabled && screenIndex > 0 && screens.length > 1 ? /*#__PURE__*/React.createElement(NavigationButton, {
|
|
3227
3252
|
direction: "previous",
|
|
3228
3253
|
className: classNames([styles$7.navButton, styles$7.previous]),
|
|
3229
3254
|
onClick: gotoPreviousScreen,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/viewer",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.22",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -88,6 +88,6 @@
|
|
|
88
88
|
"access": "public",
|
|
89
89
|
"registry": "https://registry.npmjs.org/"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "d8ffcc5d8e966d44d658f6c281f6a14c84ee9d34",
|
|
92
92
|
"types": "es/index.d.ts"
|
|
93
93
|
}
|