@egjs/flicking 4.11.3-beta.0 → 4.11.3-beta.1

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.11.3-beta.0
7
+ version: 4.11.3-beta.1
8
8
  */
9
9
  import Component, { ComponentEvent } from '@egjs/component';
10
10
  import Axes, { PanInput } from '@egjs/axes';
@@ -2866,7 +2866,7 @@ var SnapControl = /*#__PURE__*/function (_super) {
2866
2866
  if (!activeAnchor || !anchorAtCamera) {
2867
2867
  return Promise.reject(new FlickingError(MESSAGE.POSITION_NOT_REACHABLE(position), CODE.POSITION_NOT_REACHABLE));
2868
2868
  }
2869
- var snapThreshold = this._calcSnapThreshold(flicking.threshold, position, activeAnchor);
2869
+ var snapThreshold = this._calcSnapThreshold(position, activeAnchor);
2870
2870
  var posDelta = flicking.animating ? state.delta : position - camera.position;
2871
2871
  var absPosDelta = Math.abs(posDelta);
2872
2872
  var snapDelta = axesEvent && axesEvent.delta[POSITION_KEY] !== 0 ? Math.abs(axesEvent.delta[POSITION_KEY]) : absPosDelta;
@@ -2953,7 +2953,7 @@ var SnapControl = /*#__PURE__*/function (_super) {
2953
2953
  var adjacentAnchor = (_a = posDelta > 0 ? camera.getNextAnchor(anchorAtCamera) : camera.getPrevAnchor(anchorAtCamera)) !== null && _a !== void 0 ? _a : anchorAtCamera;
2954
2954
  return adjacentAnchor;
2955
2955
  };
2956
- __proto._calcSnapThreshold = function (threshold, position, activeAnchor) {
2956
+ __proto._calcSnapThreshold = function (position, activeAnchor) {
2957
2957
  var isNextDirection = position > activeAnchor.position;
2958
2958
  var panel = activeAnchor.panel;
2959
2959
  var panelSize = panel.size;
@@ -2964,7 +2964,7 @@ var SnapControl = /*#__PURE__*/function (_super) {
2964
2964
  * |<------>|<------------>|
2965
2965
  * [ |<-Anchor ]
2966
2966
  */
2967
- return Math.max(threshold, isNextDirection ? panelSize - alignPos + panel.margin.next : alignPos + panel.margin.prev);
2967
+ return isNextDirection ? panelSize - alignPos + panel.margin.next : alignPos + panel.margin.prev;
2968
2968
  };
2969
2969
  return SnapControl;
2970
2970
  }(Control);
@@ -4169,11 +4169,13 @@ var Camera = /*#__PURE__*/function () {
4169
4169
  * @return {AnchorPoint | null}
4170
4170
  */
4171
4171
  __proto.findActiveAnchor = function () {
4172
+ var _a;
4172
4173
  var flicking = getFlickingAttached(this._flicking);
4173
- var activeIndex = flicking.control.activeIndex;
4174
- return find(this._anchors, function (anchor) {
4175
- return anchor.panel.index === activeIndex;
4176
- });
4174
+ var activePanel = flicking.control.activePanel;
4175
+ if (!activePanel) return null;
4176
+ return (_a = find(this._anchors, function (anchor) {
4177
+ return anchor.panel.index === activePanel.index;
4178
+ })) !== null && _a !== void 0 ? _a : this.findNearestAnchor(activePanel.position);
4177
4179
  };
4178
4180
  /**
4179
4181
  * Clamp the given position between camera's range
@@ -7826,7 +7828,7 @@ var Flicking = /*#__PURE__*/function (_super) {
7826
7828
  * Flicking.VERSION; // ex) 4.0.0
7827
7829
  * ```
7828
7830
  */
7829
- Flicking.VERSION = "4.11.3-beta.0";
7831
+ Flicking.VERSION = "4.11.3-beta.1";
7830
7832
  return Flicking;
7831
7833
  }(Component);
7832
7834