@egjs/flicking 4.12.1-beta.1 → 4.12.1-beta.2

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.
@@ -4,7 +4,7 @@ name: @egjs/flicking
4
4
  license: MIT
5
5
  author: NAVER Corp.
6
6
  repository: https://github.com/naver/egjs-flicking
7
- version: 4.12.1-beta.1
7
+ version: 4.12.1-beta.2
8
8
  */
9
9
  (function (global, factory) {
10
10
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -2698,7 +2698,7 @@ version: 4.12.1-beta.1
2698
2698
  license: MIT
2699
2699
  author: NAVER Corp.
2700
2700
  repository: https://github.com/naver/egjs-axes
2701
- version: 3.9.1
2701
+ version: 3.9.2
2702
2702
  */
2703
2703
 
2704
2704
  /*! *****************************************************************************
@@ -3624,6 +3624,19 @@ version: 4.12.1-beta.1
3624
3624
  var deltaTime = latestInterval ? timeStamp - latestInterval.timestamp : 0;
3625
3625
  var velocityX = prevEvent ? prevEvent.velocityX : 0;
3626
3626
  var velocityY = prevEvent ? prevEvent.velocityY : 0;
3627
+ var directionX = prevEvent ? prevEvent.directionX : 1;
3628
+ var directionY = prevEvent ? prevEvent.directionY : 1;
3629
+ // If offset is 0, it inherits the direction of the previous event.
3630
+ if (offsetX > 0) {
3631
+ directionX = 1;
3632
+ } else if (offsetX < 0) {
3633
+ directionX = -1;
3634
+ }
3635
+ if (offsetY > 0) {
3636
+ directionY = 1;
3637
+ } else if (offsetY < 0) {
3638
+ directionY = -1;
3639
+ }
3627
3640
  if (!latestInterval || deltaTime >= VELOCITY_INTERVAL) {
3628
3641
  if (latestInterval) {
3629
3642
  _a = [(deltaX - latestInterval.deltaX) / deltaTime, (deltaY - latestInterval.deltaY) / deltaTime], velocityX = _a[0], velocityY = _a[1];
@@ -3643,6 +3656,8 @@ version: 4.12.1-beta.1
3643
3656
  deltaY: deltaY,
3644
3657
  offsetX: offsetX,
3645
3658
  offsetY: offsetY,
3659
+ directionX: directionX,
3660
+ directionY: directionY,
3646
3661
  velocityX: velocityX,
3647
3662
  velocityY: velocityY,
3648
3663
  preventSystemEvent: true
@@ -5106,7 +5121,7 @@ version: 4.12.1-beta.1
5106
5121
  * eg.Axes.VERSION; // ex) 3.3.3
5107
5122
  * ```
5108
5123
  */
5109
- Axes.VERSION = "3.9.1";
5124
+ Axes.VERSION = "3.9.2";
5110
5125
  /* eslint-enable */
5111
5126
  /**
5112
5127
  * @name TRANSFORM
@@ -5457,7 +5472,7 @@ version: 4.12.1-beta.1
5457
5472
  this._detachWindowEvent(activeEvent);
5458
5473
  clearTimeout(this._rightEdgeTimer);
5459
5474
  var prevEvent = activeEvent.prevEvent;
5460
- var velocity = this._isOverThreshold ? this._getOffset([Math.abs(prevEvent.velocityX) * (prevEvent.offsetX < 0 ? -1 : 1), Math.abs(prevEvent.velocityY) * (prevEvent.offsetY < 0 ? -1 : 1)], [useDirection(DIRECTION_HORIZONTAL, this._direction), useDirection(DIRECTION_VERTICAL, this._direction)]) : [0, 0];
5475
+ var velocity = this._isOverThreshold ? this._getOffset([Math.abs(prevEvent.velocityX) * prevEvent.directionX, Math.abs(prevEvent.velocityY) * prevEvent.directionY], [useDirection(DIRECTION_HORIZONTAL, this._direction), useDirection(DIRECTION_VERTICAL, this._direction)]) : [0, 0];
5461
5476
  activeEvent.onRelease();
5462
5477
  this._observer.release(this, prevEvent, velocity);
5463
5478
  };
@@ -7128,8 +7143,9 @@ version: 4.12.1-beta.1
7128
7143
  if (snapDelta >= snapThreshold && snapDelta > 0) {
7129
7144
  // Move to anchor at position
7130
7145
  targetAnchor = this._findSnappedAnchor(position, anchorAtCamera);
7131
- } else if (absPosDelta >= flicking.threshold && absPosDelta > 0) {
7146
+ } else if (absPosDelta >= flicking.threshold && absPosDelta > 0 && anchorAtCamera === activeAnchor) {
7132
7147
  // Move to the adjacent panel
7148
+ // console.log("moveToPosition anchorAtCamera activeAnchor absPosDelta", camera.position, anchorAtCamera, activeAnchor, absPosDelta, snapThreshold)
7133
7149
  targetAnchor = this._findAdjacentAnchor(position, posDelta, anchorAtCamera);
7134
7150
  } else {
7135
7151
  // Fallback to nearest panel from current camera
@@ -7204,6 +7220,7 @@ version: 4.12.1-beta.1
7204
7220
  return anchorIncludePosition;
7205
7221
  }
7206
7222
  }
7223
+ // console.log("_findAdjacentAnchor", position, posDelta, anchorAtCamera)
7207
7224
  var adjacentAnchor = (_a = posDelta > 0 ? camera.getNextAnchor(anchorAtCamera) : camera.getPrevAnchor(anchorAtCamera)) !== null && _a !== void 0 ? _a : anchorAtCamera;
7208
7225
  return adjacentAnchor;
7209
7226
  };
@@ -13052,7 +13069,7 @@ version: 4.12.1-beta.1
13052
13069
  * Flicking.VERSION; // ex) 4.0.0
13053
13070
  * ```
13054
13071
  */
13055
- Flicking.VERSION = "4.12.1-beta.1";
13072
+ Flicking.VERSION = "4.12.1-beta.2";
13056
13073
  return Flicking;
13057
13074
  }(Component);
13058
13075