@egjs/flicking 4.11.3-beta.1 → 4.11.3-beta.3
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 +240 -240
- package/declaration/camera/Camera.d.ts +82 -89
- 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 -48
- package/declaration/control/AxesController.d.ts +44 -44
- package/declaration/control/Control.d.ts +44 -45
- 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.cjs.d.ts +3 -3
- 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 +59 -59
- 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.cjs.js +20 -77
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +21 -76
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +20 -76
- 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 +20 -76
- 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/Flicking.ts +6 -0
- package/src/control/Control.ts +3 -3
- package/src/control/SnapControl.ts +4 -4
package/package.json
CHANGED
package/src/Flicking.ts
CHANGED
|
@@ -1503,6 +1503,9 @@ class Flicking extends Component<FlickingEvents> {
|
|
|
1503
1503
|
|
|
1504
1504
|
viewport.resize();
|
|
1505
1505
|
await renderer.forceRenderAllPanels(); // Render all panel elements, to update sizes
|
|
1506
|
+
if (!this._initialized) {
|
|
1507
|
+
return;
|
|
1508
|
+
}
|
|
1506
1509
|
renderer.updatePanelSize();
|
|
1507
1510
|
camera.updateAlignPos();
|
|
1508
1511
|
camera.updateRange();
|
|
@@ -1511,6 +1514,9 @@ class Flicking extends Component<FlickingEvents> {
|
|
|
1511
1514
|
camera.updatePanelOrder();
|
|
1512
1515
|
camera.updateOffset();
|
|
1513
1516
|
await renderer.render();
|
|
1517
|
+
if (!this._initialized) {
|
|
1518
|
+
return;
|
|
1519
|
+
}
|
|
1514
1520
|
|
|
1515
1521
|
if (control.animating) {
|
|
1516
1522
|
// TODO:
|
package/src/control/Control.ts
CHANGED
|
@@ -306,7 +306,7 @@ abstract class Control {
|
|
|
306
306
|
axesEvent?: OnRelease;
|
|
307
307
|
}) {
|
|
308
308
|
const position = this._getPosition(panel, direction);
|
|
309
|
-
this._triggerIndexChangeEvent(panel, panel.position, axesEvent);
|
|
309
|
+
this._triggerIndexChangeEvent(panel, panel.position, axesEvent, direction);
|
|
310
310
|
|
|
311
311
|
return this._animateToPosition({ position, duration, newActivePanel: panel, axesEvent });
|
|
312
312
|
}
|
|
@@ -347,7 +347,7 @@ abstract class Control {
|
|
|
347
347
|
this._controller = control._controller;
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
protected _triggerIndexChangeEvent(panel: Panel, position: number, axesEvent?: OnRelease) {
|
|
350
|
+
protected _triggerIndexChangeEvent(panel: Panel, position: number, axesEvent?: OnRelease, direction?: ValueOf<typeof DIRECTION>) {
|
|
351
351
|
const flicking = getFlickingAttached(this._flicking);
|
|
352
352
|
const triggeringEvent = panel !== this._activePanel ? EVENTS.WILL_CHANGE : EVENTS.WILL_RESTORE;
|
|
353
353
|
const camera = flicking.camera;
|
|
@@ -357,7 +357,7 @@ abstract class Control {
|
|
|
357
357
|
index: panel.index,
|
|
358
358
|
panel,
|
|
359
359
|
isTrusted: axesEvent?.isTrusted || false,
|
|
360
|
-
direction: getDirection(activePanel?.position ?? camera.position, position)
|
|
360
|
+
direction: direction ?? getDirection(activePanel?.position ?? camera.position, position)
|
|
361
361
|
});
|
|
362
362
|
|
|
363
363
|
this._nextPanel = panel;
|
|
@@ -95,7 +95,7 @@ class SnapControl extends Control {
|
|
|
95
95
|
return Promise.reject(new FlickingError(ERROR.MESSAGE.POSITION_NOT_REACHABLE(position), ERROR.CODE.POSITION_NOT_REACHABLE));
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
const snapThreshold = this._calcSnapThreshold(position, activeAnchor);
|
|
98
|
+
const snapThreshold = this._calcSnapThreshold(flicking.threshold, position, activeAnchor);
|
|
99
99
|
|
|
100
100
|
const posDelta = flicking.animating
|
|
101
101
|
? state.delta
|
|
@@ -210,7 +210,7 @@ class SnapControl extends Control {
|
|
|
210
210
|
return adjacentAnchor;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
private _calcSnapThreshold(position: number, activeAnchor: AnchorPoint): number {
|
|
213
|
+
private _calcSnapThreshold(threshold: number, position: number, activeAnchor: AnchorPoint): number {
|
|
214
214
|
const isNextDirection = position > activeAnchor.position;
|
|
215
215
|
const panel = activeAnchor.panel;
|
|
216
216
|
const panelSize = panel.size;
|
|
@@ -222,9 +222,9 @@ class SnapControl extends Control {
|
|
|
222
222
|
* |<------>|<------------>|
|
|
223
223
|
* [ |<-Anchor ]
|
|
224
224
|
*/
|
|
225
|
-
return isNextDirection
|
|
225
|
+
return Math.max(threshold, isNextDirection
|
|
226
226
|
? panelSize - alignPos + panel.margin.next
|
|
227
|
-
: alignPos + panel.margin.prev;
|
|
227
|
+
: alignPos + panel.margin.prev);
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
|