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