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