@royaloperahouse/harmonic 0.1.8-m → 0.1.8-n

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;
@@ -7640,6 +7640,8 @@ var Swipe = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
7640
7640
  var handleMouseMove = function handleMouseMove(e) {
7641
7641
  if (!isDragging.current || !isMouseDown.current || transitioning) return;
7642
7642
  var deltaX = e.clientX - startX.current;
7643
+ // eslint-disable-next-line no-console
7644
+ console.log('handleMouseMove', isClickPrevented.current, CLICK_DRAG_THRESHOLD, deltaX);
7643
7645
  if (Math.abs(deltaX) > CLICK_DRAG_THRESHOLD) {
7644
7646
  isClickPrevented.current = true;
7645
7647
  }
@@ -7648,16 +7650,18 @@ var Swipe = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
7648
7650
  setDragTranslateX(visualOffset);
7649
7651
  };
7650
7652
  var _handleMouseUp = function handleMouseUp() {
7651
- if (!isDragging.current || !isMouseDown.current) return;
7652
- isDragging.current = false;
7653
+ if (!isMouseDown.current) return;
7653
7654
  isMouseDown.current = false;
7654
- window.removeEventListener('mousemove', handleMouseMove);
7655
- window.removeEventListener('mouseup', _handleMouseUp);
7656
- if (!isClickPrevented.current) {
7655
+ isDragging.current = false;
7656
+ // eslint-disable-next-line no-console
7657
+ console.log('handleMouseUp', isClickPrevented.current, CLICK_DRAG_THRESHOLD);
7658
+ if (isClickPrevented.current) {
7659
+ navigateOnSwipeEnd();
7660
+ } else {
7657
7661
  setDragTranslateX(null);
7658
- return;
7659
7662
  }
7660
- navigateOnSwipeEnd();
7663
+ window.removeEventListener('mousemove', handleMouseMove);
7664
+ window.removeEventListener('mouseup', _handleMouseUp);
7661
7665
  };
7662
7666
  var handleMouseDown = function handleMouseDown(e) {
7663
7667
  if (transitioning || e.button !== 0) return;
@@ -7668,6 +7672,8 @@ var Swipe = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
7668
7672
  isMouseDown.current = true;
7669
7673
  isClickPrevented.current = false;
7670
7674
  setTransitioning(false);
7675
+ // eslint-disable-next-line no-console
7676
+ console.log('handleMouseDown', isClickPrevented, CLICK_DRAG_THRESHOLD);
7671
7677
  window.addEventListener('mousemove', handleMouseMove);
7672
7678
  window.addEventListener('mouseup', _handleMouseUp);
7673
7679
  };
@@ -7707,6 +7713,7 @@ var Swipe = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
7707
7713
  onFocus: function onFocus() {
7708
7714
  return onSlideFocus(isVisible, index);
7709
7715
  },
7716
+ onClick: onClickCapture,
7710
7717
  onClickCapture: onClickCapture
7711
7718
  });
7712
7719
  })));