pptx-angular-viewer 1.1.39 → 1.1.40

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.
@@ -25518,6 +25518,13 @@ function createTouchGestureRecognizer(config) {
25518
25518
  // Swipe state.
25519
25519
  let swipeStartX = 0;
25520
25520
  let swipeStartY = 0;
25521
+ // Most recent single-finger position. Lets a swipe still be measured when
25522
+ // `touchend` arrives with an empty `changedTouches` list (some synthetic
25523
+ // dispatchers, e.g. CDP `Input.dispatchTouchEvent`, omit it). Real
25524
+ // browsers always populate `changedTouches`, so their behaviour is
25525
+ // unchanged.
25526
+ let swipeLastX = 0;
25527
+ let swipeLastY = 0;
25521
25528
  // Long-press state.
25522
25529
  let longPressTimer = null;
25523
25530
  let longPressStartX = 0;
@@ -25541,6 +25548,8 @@ function createTouchGestureRecognizer(config) {
25541
25548
  // Potential swipe or long-press.
25542
25549
  swipeStartX = e.touches[0].clientX;
25543
25550
  swipeStartY = e.touches[0].clientY;
25551
+ swipeLastX = swipeStartX;
25552
+ swipeLastY = swipeStartY;
25544
25553
  longPressStartX = e.touches[0].clientX;
25545
25554
  longPressStartY = e.touches[0].clientY;
25546
25555
  cancelLongPress();
@@ -25561,6 +25570,8 @@ function createTouchGestureRecognizer(config) {
25561
25570
  }
25562
25571
  }
25563
25572
  else if (e.touches.length === 1) {
25573
+ swipeLastX = e.touches[0].clientX;
25574
+ swipeLastY = e.touches[0].clientY;
25564
25575
  // Cancel the long-press if the finger moved too far.
25565
25576
  const dx = e.touches[0].clientX - longPressStartX;
25566
25577
  const dy = e.touches[0].clientY - longPressStartY;
@@ -25577,10 +25588,13 @@ function createTouchGestureRecognizer(config) {
25577
25588
  return;
25578
25589
  }
25579
25590
  cancelLongPress();
25580
- // Detect a swipe from the touch that just ended.
25581
- if (e.changedTouches.length === 1 && e.touches.length === 0) {
25582
- const endX = e.changedTouches[0].clientX;
25583
- const endY = e.changedTouches[0].clientY;
25591
+ // Detect a swipe from the touch that just ended, but only once every
25592
+ // finger is up. Prefer the lifted touch's coordinates; fall back to the
25593
+ // last tracked move position when `changedTouches` is empty (synthetic
25594
+ // dispatchers), so a swipe is not silently dropped.
25595
+ if (e.touches.length === 0) {
25596
+ const endX = e.changedTouches.length >= 1 ? e.changedTouches[0].clientX : swipeLastX;
25597
+ const endY = e.changedTouches.length >= 1 ? e.changedTouches[0].clientY : swipeLastY;
25584
25598
  const deltaX = endX - swipeStartX;
25585
25599
  const deltaY = endY - swipeStartY;
25586
25600
  if (Math.abs(deltaX) >= SWIPE_THRESHOLD_PX && Math.abs(deltaY) < SWIPE_MAX_VERTICAL_PX) {