@royaloperahouse/harmonic 0.1.8-m → 0.1.8-o

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.
@@ -7464,7 +7464,7 @@ var getMovedSlides = function getMovedSlides(delta, slideWidths) {
7464
7464
 
7465
7465
  var _excluded$h = ["children", "infinite", "onIndexChange", "slidesOffsetBefore", "onActiveChange"];
7466
7466
  var MAX_CLONES_NUMBER = 6;
7467
- var CLICK_DRAG_THRESHOLD = 20;
7467
+ var CLICK_DRAG_THRESHOLD = 10;
7468
7468
  var getClonesCount = function getClonesCount(infinite, childrenLength) {
7469
7469
  if (!infinite) return 0;
7470
7470
  if (childrenLength > MAX_CLONES_NUMBER) return MAX_CLONES_NUMBER;
@@ -7648,16 +7648,16 @@ var Swipe = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
7648
7648
  setDragTranslateX(visualOffset);
7649
7649
  };
7650
7650
  var _handleMouseUp = function handleMouseUp() {
7651
- if (!isDragging.current || !isMouseDown.current) return;
7652
- isDragging.current = false;
7651
+ if (!isMouseDown.current) return;
7653
7652
  isMouseDown.current = false;
7654
- window.removeEventListener('mousemove', handleMouseMove);
7655
- window.removeEventListener('mouseup', _handleMouseUp);
7656
- if (!isClickPrevented.current) {
7653
+ isDragging.current = false;
7654
+ if (isClickPrevented.current) {
7655
+ navigateOnSwipeEnd();
7656
+ } else {
7657
7657
  setDragTranslateX(null);
7658
- return;
7659
7658
  }
7660
- navigateOnSwipeEnd();
7659
+ window.removeEventListener('mousemove', handleMouseMove);
7660
+ window.removeEventListener('mouseup', _handleMouseUp);
7661
7661
  };
7662
7662
  var handleMouseDown = function handleMouseDown(e) {
7663
7663
  if (transitioning || e.button !== 0) return;
@@ -7689,12 +7689,16 @@ var Swipe = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
7689
7689
  onTouchMove: handleTouchMove,
7690
7690
  onTouchEnd: handleTouchEnd,
7691
7691
  onMouseDown: handleMouseDown,
7692
+ onDragStart: function onDragStart(e) {
7693
+ return e.preventDefault();
7694
+ },
7692
7695
  className: "swipe"
7693
7696
  }, props), /*#__PURE__*/React__default.createElement(SwipeTrack, {
7694
7697
  className: "swipe-track-wrapper",
7695
7698
  translateX: dragTranslateX !== null ? dragTranslateX : getTranslateX(),
7696
7699
  transitioning: transitioning && dragTranslateX === null,
7697
- onTransitionEnd: handleTransitionEnd
7700
+ onTransitionEnd: handleTransitionEnd,
7701
+ onClickCapture: onClickCapture
7698
7702
  }, slides.map(function (child, index) {
7699
7703
  var isVisible = visibleIndexes.includes(index);
7700
7704
  return /*#__PURE__*/React__default.cloneElement(child, {
@@ -7706,8 +7710,7 @@ var Swipe = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
7706
7710
  },
7707
7711
  onFocus: function onFocus() {
7708
7712
  return onSlideFocus(isVisible, index);
7709
- },
7710
- onClickCapture: onClickCapture
7713
+ }
7711
7714
  });
7712
7715
  })));
7713
7716
  });