@egjs/flicking 4.10.5-beta.0 → 4.10.5
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.
- package/declaration/Flicking.d.ts +236 -236
- package/declaration/camera/Camera.d.ts +82 -82
- package/declaration/camera/index.d.ts +4 -4
- package/declaration/camera/mode/BoundCameraMode.d.ts +13 -13
- package/declaration/camera/mode/CameraMode.d.ts +20 -20
- package/declaration/camera/mode/CircularCameraMode.d.ts +19 -19
- package/declaration/camera/mode/LinearCameraMode.d.ts +9 -9
- package/declaration/camera/mode/index.d.ts +6 -6
- package/declaration/cfc/getDefaultCameraTransform.d.ts +3 -3
- package/declaration/cfc/getRenderingPanels.d.ts +4 -4
- package/declaration/cfc/index.d.ts +5 -5
- package/declaration/cfc/sync.d.ts +4 -4
- package/declaration/cfc/withFlickingMethods.d.ts +2 -2
- package/declaration/const/axes.d.ts +8 -8
- package/declaration/const/error.d.ts +34 -34
- package/declaration/const/external.d.ts +44 -44
- package/declaration/control/AxesController.d.ts +44 -44
- package/declaration/control/Control.d.ts +44 -44
- package/declaration/control/FreeControl.d.ts +14 -14
- package/declaration/control/SnapControl.d.ts +16 -16
- package/declaration/control/StateMachine.d.ts +14 -14
- package/declaration/control/StrictControl.d.ts +20 -20
- package/declaration/control/index.d.ts +14 -14
- package/declaration/control/states/AnimatingState.d.ts +9 -9
- package/declaration/control/states/DisabledState.d.ts +9 -9
- package/declaration/control/states/DraggingState.d.ts +8 -8
- package/declaration/control/states/HoldingState.d.ts +10 -10
- package/declaration/control/states/IdleState.d.ts +9 -9
- package/declaration/control/states/State.d.ts +47 -47
- package/declaration/core/AnchorPoint.d.ts +15 -15
- package/declaration/core/AutoResizer.d.ts +16 -16
- package/declaration/core/FlickingError.d.ts +5 -5
- package/declaration/core/ResizeWatcher.d.ts +33 -33
- package/declaration/core/Viewport.d.ts +25 -25
- package/declaration/core/VirtualManager.d.ts +37 -37
- package/declaration/core/index.d.ts +6 -6
- package/declaration/core/panel/Panel.d.ts +89 -89
- package/declaration/core/panel/VirtualPanel.d.ts +19 -19
- package/declaration/core/panel/index.d.ts +5 -5
- package/declaration/core/panel/provider/ElementProvider.d.ts +8 -8
- package/declaration/core/panel/provider/VanillaElementProvider.d.ts +12 -12
- package/declaration/core/panel/provider/VirtualElementProvider.d.ts +15 -15
- package/declaration/core/panel/provider/index.d.ts +5 -5
- package/declaration/index.d.ts +13 -13
- package/declaration/index.umd.d.ts +2 -2
- package/declaration/renderer/ExternalRenderer.d.ts +7 -7
- package/declaration/renderer/Renderer.d.ts +58 -58
- package/declaration/renderer/VanillaRenderer.d.ts +10 -10
- package/declaration/renderer/index.d.ts +6 -6
- package/declaration/renderer/strategy/NormalRenderingStrategy.d.ts +23 -23
- package/declaration/renderer/strategy/RenderingStrategy.d.ts +15 -15
- package/declaration/renderer/strategy/VirtualRenderingStrategy.d.ts +17 -17
- package/declaration/renderer/strategy/index.d.ts +5 -5
- package/declaration/type/event.d.ts +88 -88
- package/declaration/type/external.d.ts +31 -31
- package/declaration/type/internal.d.ts +13 -13
- package/declaration/utils.d.ts +45 -45
- package/dist/flicking.esm.js +16 -8
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +16 -8
- package/dist/flicking.js.map +1 -1
- package/dist/flicking.min.js +2 -2
- package/dist/flicking.min.js.map +1 -1
- package/dist/flicking.pkgd.js +858 -842
- package/dist/flicking.pkgd.js.map +1 -1
- package/dist/flicking.pkgd.min.js +2 -2
- package/dist/flicking.pkgd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/control/SnapControl.ts +2 -2
- package/src/control/StrictControl.ts +9 -3
- package/src/core/ResizeWatcher.ts +1 -1
- package/src/utils.ts +1 -1
package/package.json
CHANGED
|
@@ -113,8 +113,8 @@ class SnapControl extends Control {
|
|
|
113
113
|
// Move to the adjacent panel
|
|
114
114
|
targetAnchor = this._findAdjacentAnchor(position, posDelta, anchorAtCamera);
|
|
115
115
|
} else {
|
|
116
|
-
//
|
|
117
|
-
return this.moveToPanel(
|
|
116
|
+
// Fallback to nearest panel from current camera
|
|
117
|
+
return this.moveToPanel(anchorAtCamera.panel, {
|
|
118
118
|
duration,
|
|
119
119
|
axesEvent
|
|
120
120
|
});
|
|
@@ -242,9 +242,15 @@ class StrictControl extends Control {
|
|
|
242
242
|
targetPanel = adjacentAnchor!.panel;
|
|
243
243
|
targetPos = adjacentAnchor!.position;
|
|
244
244
|
} else {
|
|
245
|
-
//
|
|
246
|
-
|
|
247
|
-
|
|
245
|
+
// Fallback to nearest panel from current camera
|
|
246
|
+
const anchorAtCamera = camera.findNearestAnchor(camera.position);
|
|
247
|
+
if (!anchorAtCamera) {
|
|
248
|
+
return Promise.reject(new FlickingError(ERROR.MESSAGE.POSITION_NOT_REACHABLE(position), ERROR.CODE.POSITION_NOT_REACHABLE));
|
|
249
|
+
}
|
|
250
|
+
return this.moveToPanel(anchorAtCamera.panel, {
|
|
251
|
+
duration,
|
|
252
|
+
axesEvent
|
|
253
|
+
});
|
|
248
254
|
}
|
|
249
255
|
|
|
250
256
|
this._triggerIndexChangeEvent(targetPanel, position, axesEvent);
|
package/src/utils.ts
CHANGED
|
@@ -214,7 +214,7 @@ export const circulatePosition = (pos: number, min: number, max: number) => {
|
|
|
214
214
|
if (pos < min) {
|
|
215
215
|
const offset = (min - pos) % size;
|
|
216
216
|
pos = max - offset;
|
|
217
|
-
} else if (pos
|
|
217
|
+
} else if (pos > max) {
|
|
218
218
|
const offset = (pos - max) % size;
|
|
219
219
|
pos = min + offset;
|
|
220
220
|
}
|