@egjs/flicking 4.15.0 → 4.16.0-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.
Files changed (185) hide show
  1. package/README.md +6 -175
  2. package/{declaration → dist}/CrossFlicking.d.ts +7 -2
  3. package/dist/Flicking.d.ts +1231 -0
  4. package/dist/camera/Camera.d.ts +324 -0
  5. package/{declaration → dist}/camera/mode/BoundCameraMode.d.ts +5 -4
  6. package/{declaration → dist}/camera/mode/CameraMode.d.ts +7 -6
  7. package/{declaration → dist}/camera/mode/CircularCameraMode.d.ts +9 -5
  8. package/{declaration → dist}/camera/mode/LinearCameraMode.d.ts +2 -4
  9. package/{declaration → dist}/cfc/getDefaultCameraTransform.d.ts +1 -1
  10. package/dist/cfc/withFlickingMethods.d.ts +15 -0
  11. package/{declaration/const/axes.d.ts → dist/constants/internal.d.ts} +8 -0
  12. package/dist/constants/values.d.ts +67 -0
  13. package/dist/control/AxesController.d.ts +186 -0
  14. package/dist/control/Control.d.ts +185 -0
  15. package/dist/control/FreeControl.d.ts +44 -0
  16. package/dist/control/SnapControl.d.ts +54 -0
  17. package/{declaration → dist}/control/StateMachine.d.ts +3 -0
  18. package/dist/control/StrictControl.d.ts +60 -0
  19. package/{declaration → dist}/control/states/AnimatingState.d.ts +12 -0
  20. package/{declaration → dist}/control/states/DisabledState.d.ts +12 -0
  21. package/{declaration → dist}/control/states/DraggingState.d.ts +12 -0
  22. package/{declaration → dist}/control/states/HoldingState.d.ts +12 -0
  23. package/{declaration → dist}/control/states/IdleState.d.ts +12 -0
  24. package/dist/control/states/State.d.ts +86 -0
  25. package/dist/core/AnchorPoint.d.ts +40 -0
  26. package/{declaration → dist}/core/AutoResizer.d.ts +6 -0
  27. package/dist/core/Viewport.d.ts +60 -0
  28. package/dist/core/VirtualManager.d.ts +84 -0
  29. package/dist/core/index.d.ts +6 -0
  30. package/dist/core/panel/Panel.d.ts +298 -0
  31. package/dist/core/panel/VirtualPanel.d.ts +41 -0
  32. package/dist/core/panel/index.d.ts +5 -0
  33. package/{declaration → dist}/core/panel/provider/VanillaElementProvider.d.ts +3 -0
  34. package/{declaration → dist}/core/panel/provider/VirtualElementProvider.d.ts +3 -0
  35. package/dist/error/FlickingError.d.ts +25 -0
  36. package/dist/error/codes.d.ts +79 -0
  37. package/dist/error/groups.d.ts +94 -0
  38. package/dist/error/index.d.ts +4 -0
  39. package/dist/error/types.d.ts +516 -0
  40. package/dist/event/groups.d.ts +40 -0
  41. package/dist/event/index.d.ts +3 -0
  42. package/dist/event/names.d.ts +47 -0
  43. package/dist/event/types.d.ts +318 -0
  44. package/dist/flicking.cjs.js +5559 -7791
  45. package/dist/flicking.cjs.js.map +1 -1
  46. package/dist/flicking.esm.js +5637 -7699
  47. package/dist/flicking.esm.js.map +1 -1
  48. package/dist/flicking.js +6722 -8893
  49. package/dist/flicking.js.map +1 -1
  50. package/dist/flicking.min.js +1 -9
  51. package/dist/flicking.min.js.map +1 -1
  52. package/dist/flicking.pkgd.js +9661 -14086
  53. package/dist/flicking.pkgd.js.map +1 -1
  54. package/dist/flicking.pkgd.min.js +1 -9
  55. package/dist/flicking.pkgd.min.js.map +1 -1
  56. package/dist/index.d.ts +16 -0
  57. package/dist/reactive/index.d.ts +126 -0
  58. package/{declaration → dist}/renderer/ExternalRenderer.d.ts +3 -0
  59. package/dist/renderer/Renderer.d.ts +215 -0
  60. package/{declaration → dist}/renderer/VanillaRenderer.d.ts +6 -0
  61. package/{declaration → dist}/renderer/strategy/NormalRenderingStrategy.d.ts +5 -2
  62. package/{declaration → dist}/renderer/strategy/RenderingStrategy.d.ts +4 -1
  63. package/dist/types/external.d.ts +58 -0
  64. package/dist/types/params.d.ts +10 -0
  65. package/{declaration → dist}/utils.d.ts +7 -7
  66. package/package.json +35 -162
  67. package/src/CrossFlicking.ts +68 -96
  68. package/src/Flicking.ts +1051 -972
  69. package/src/camera/Camera.ts +217 -206
  70. package/src/camera/index.ts +2 -6
  71. package/src/camera/mode/BoundCameraMode.ts +38 -27
  72. package/src/camera/mode/CameraMode.ts +14 -12
  73. package/src/camera/mode/CircularCameraMode.ts +24 -16
  74. package/src/camera/mode/LinearCameraMode.ts +3 -1
  75. package/src/camera/mode/index.ts +4 -10
  76. package/src/cfc/getDefaultCameraTransform.ts +9 -11
  77. package/src/cfc/getRenderingPanels.ts +2 -4
  78. package/src/cfc/index.ts +4 -9
  79. package/src/cfc/sync.ts +11 -5
  80. package/src/cfc/withFlickingMethods.ts +6 -7
  81. package/src/{const/axes.ts → constants/internal.ts} +1 -0
  82. package/src/constants/values.ts +78 -0
  83. package/src/control/AxesController.ts +119 -110
  84. package/src/control/Control.ts +147 -180
  85. package/src/control/FreeControl.ts +36 -60
  86. package/src/control/SnapControl.ts +64 -68
  87. package/src/control/StateMachine.ts +14 -11
  88. package/src/control/StrictControl.ts +58 -73
  89. package/src/control/index.ts +9 -12
  90. package/src/control/states/AnimatingState.ts +8 -11
  91. package/src/control/states/DisabledState.ts +0 -5
  92. package/src/control/states/DraggingState.ts +8 -12
  93. package/src/control/states/HoldingState.ts +10 -15
  94. package/src/control/states/IdleState.ts +1 -6
  95. package/src/control/states/State.ts +46 -85
  96. package/src/core/AnchorPoint.ts +25 -23
  97. package/src/core/AutoResizer.ts +6 -15
  98. package/src/core/ResizeWatcher.ts +17 -16
  99. package/src/core/Viewport.ts +35 -46
  100. package/src/core/VirtualManager.ts +48 -36
  101. package/src/core/index.ts +6 -9
  102. package/src/core/panel/Panel.ts +190 -185
  103. package/src/core/panel/VirtualPanel.ts +17 -21
  104. package/src/core/panel/index.ts +4 -9
  105. package/src/core/panel/provider/VanillaElementProvider.ts +6 -2
  106. package/src/core/panel/provider/VirtualElementProvider.ts +6 -2
  107. package/src/core/panel/provider/index.ts +2 -7
  108. package/src/{core → error}/FlickingError.ts +5 -7
  109. package/src/error/codes.ts +164 -0
  110. package/src/error/groups.ts +124 -0
  111. package/src/error/index.ts +9 -0
  112. package/src/error/types.ts +535 -0
  113. package/src/event/groups.ts +61 -0
  114. package/src/event/index.ts +8 -0
  115. package/src/event/names.ts +52 -0
  116. package/src/event/types.ts +355 -0
  117. package/src/index.ts +9 -11
  118. package/src/index.umd.ts +9 -3
  119. package/src/reactive/index.ts +39 -74
  120. package/src/renderer/Renderer.ts +170 -115
  121. package/src/renderer/VanillaRenderer.ts +12 -9
  122. package/src/renderer/index.ts +4 -9
  123. package/src/renderer/strategy/NormalRenderingStrategy.ts +26 -22
  124. package/src/renderer/strategy/RenderingStrategy.ts +2 -1
  125. package/src/renderer/strategy/VirtualRenderingStrategy.ts +20 -13
  126. package/src/renderer/strategy/index.ts +4 -9
  127. package/src/types/external.ts +72 -0
  128. package/src/{type → types}/internal.ts +2 -5
  129. package/src/types/params.ts +15 -0
  130. package/src/utils.ts +37 -32
  131. package/CONTRIBUTING.md +0 -59
  132. package/NOTICE +0 -31
  133. package/core-packages-link.js +0 -75
  134. package/debug/reactive/index.html +0 -240
  135. package/declaration/Flicking.d.ts +0 -264
  136. package/declaration/camera/Camera.d.ts +0 -90
  137. package/declaration/cfc/withFlickingMethods.d.ts +0 -2
  138. package/declaration/const/error.d.ts +0 -34
  139. package/declaration/const/external.d.ts +0 -54
  140. package/declaration/control/AxesController.d.ts +0 -45
  141. package/declaration/control/Control.d.ts +0 -45
  142. package/declaration/control/FreeControl.d.ts +0 -14
  143. package/declaration/control/SnapControl.d.ts +0 -16
  144. package/declaration/control/StrictControl.d.ts +0 -20
  145. package/declaration/control/states/State.d.ts +0 -47
  146. package/declaration/core/AnchorPoint.d.ts +0 -15
  147. package/declaration/core/FlickingError.d.ts +0 -5
  148. package/declaration/core/Viewport.d.ts +0 -25
  149. package/declaration/core/VirtualManager.d.ts +0 -37
  150. package/declaration/core/index.d.ts +0 -6
  151. package/declaration/core/panel/Panel.d.ts +0 -89
  152. package/declaration/core/panel/VirtualPanel.d.ts +0 -19
  153. package/declaration/core/panel/index.d.ts +0 -5
  154. package/declaration/index.d.ts +0 -16
  155. package/declaration/reactive/index.d.ts +0 -25
  156. package/declaration/renderer/Renderer.d.ts +0 -60
  157. package/declaration/type/event.d.ts +0 -88
  158. package/declaration/type/external.d.ts +0 -31
  159. package/jsconfig.json +0 -5
  160. package/jsdoc-to-mdx.json +0 -7
  161. package/rollup.config.demo.js +0 -24
  162. package/rollup.config.dev.js +0 -12
  163. package/rollup.config.js +0 -57
  164. package/src/const/error.ts +0 -64
  165. package/src/const/external.ts +0 -138
  166. package/src/type/event.ts +0 -315
  167. package/src/type/external.ts +0 -78
  168. package/tsconfig.declaration.json +0 -17
  169. package/tsconfig.eslint.json +0 -10
  170. package/tsconfig.json +0 -23
  171. package/{declaration → dist}/camera/index.d.ts +0 -0
  172. package/{declaration → dist}/camera/mode/index.d.ts +2 -2
  173. package/{declaration → dist}/cfc/getRenderingPanels.d.ts +0 -0
  174. package/{declaration → dist}/cfc/index.d.ts +3 -3
  175. package/{declaration → dist}/cfc/sync.d.ts +0 -0
  176. package/{declaration → dist}/control/index.d.ts +7 -7
  177. package/{declaration → dist}/core/ResizeWatcher.d.ts +0 -0
  178. package/{declaration → dist}/core/panel/provider/ElementProvider.d.ts +0 -0
  179. package/{declaration → dist}/core/panel/provider/index.d.ts +0 -0
  180. package/{declaration → dist}/index.cjs.d.ts +0 -0
  181. package/{declaration → dist}/index.umd.d.ts +0 -0
  182. package/{declaration → dist}/renderer/index.d.ts +1 -1
  183. package/{declaration → dist}/renderer/strategy/VirtualRenderingStrategy.d.ts +1 -1
  184. package/{declaration → dist}/renderer/strategy/index.d.ts +1 -1
  185. /package/{declaration/type → dist/types}/internal.d.ts +0 -0
@@ -2,21 +2,20 @@
2
2
  * Copyright (c) 2015 NAVER Corp.
3
3
  * egjs projects are licensed under the MIT license
4
4
  */
5
- import Axes, { PanInput, AxesEvents, OnRelease } from "@egjs/axes";
6
-
5
+ import Axes, { AxesEvents, OnRelease, PanInput } from "@egjs/axes";
6
+ import * as AXES from "../constants/internal";
7
+ import { ORDER } from "../constants/values";
8
+ import * as ERROR from "../error/codes";
9
+ import FlickingError from "../error/FlickingError";
7
10
  import Flicking from "../Flicking";
8
- import FlickingError from "../core/FlickingError";
9
- import * as AXES from "../const/axes";
10
- import * as ERROR from "../const/error";
11
- import { ORDER } from "../const/external";
11
+ import { ControlParams } from "../types/external";
12
12
  import { getFlickingAttached, parseBounce } from "../utils";
13
- import { ControlParams } from "../type/external";
14
13
 
15
14
  import StateMachine from "./StateMachine";
15
+ import State from "./states/State";
16
16
 
17
17
  /**
18
- * A controller that handles the {@link https://naver.github.io/egjs-axes/ @egjs/axes} events
19
- * @ko {@link https://naver.github.io/egjs-axes/ @egjs/axes}의 이벤트를 처리하는 컨트롤러 컴포넌트
18
+ * A controller that handles the {@link https://naver.github.io/egjs-axes/ | @egjs/axes} events
20
19
  * @internal
21
20
  */
22
21
  class AxesController {
@@ -29,45 +28,42 @@ class AxesController {
29
28
  private _dragged: boolean;
30
29
 
31
30
  /**
32
- * An {@link https://naver.github.io/egjs-axes/docs/api/Axes Axes} instance
33
- * @ko {@link https://naver.github.io/egjs-axes/docs/api/Axes Axes}의 인스턴스
34
- * @type {Axes | null}
31
+ * An {@link https://naver.github.io/egjs-axes/docs/api/Axes | Axes} instance
35
32
  * @see https://naver.github.io/egjs-axes/docs/api/Axes
36
33
  * @readonly
37
34
  */
38
- public get axes() { return this._axes; }
35
+ public get axes(): Axes | null {
36
+ return this._axes;
37
+ }
39
38
  /**
40
- * An {@link https://naver.github.io/egjs-axes/docs/api/PanInput PanInput} instance
41
- * @ko {@link https://naver.github.io/egjs-axes/docs/api/PanInput PanInput}의 인스턴스
42
- * @type {PanInput | null}
39
+ * An {@link https://naver.github.io/egjs-axes/docs/api/PanInput | PanInput} instance
43
40
  * @see https://naver.github.io/egjs-axes/docs/api/PanInput
44
41
  * @readonly
45
42
  */
46
- public get panInput() { return this._panInput; }
43
+ public get panInput(): PanInput | null {
44
+ return this._panInput;
45
+ }
47
46
  /**
48
47
  * @internal
49
48
  */
50
- public get stateMachine() { return this._stateMachine; }
49
+ public get stateMachine(): StateMachine {
50
+ return this._stateMachine;
51
+ }
51
52
  /**
52
53
  * A activated {@link State} that shows the current status of the user input or the animation
53
- * @ko 현재 활성화된 {@link State} 인스턴스로 사용자 입력 또는 애니메이션 상태를 나타냅니다
54
- * @type {State}
55
54
  */
56
- public get state() { return this._stateMachine.state; }
55
+ public get state(): State {
56
+ return this._stateMachine.state;
57
+ }
57
58
  /**
58
59
  * A context of the current animation playing
59
- * @ko 현재 재생중인 애니메이션 정보
60
- * @type {object}
61
- * @property {number} start A start position of the animation<ko>애니메이션 시작 지점</ko>
62
- * @property {number} end A end position of the animation<ko>애니메이션 끝 지점</ko>
63
- * @property {number} offset camera offset<ko>카메라 오프셋</ko>
64
60
  * @readonly
65
61
  */
66
- public get animatingContext() { return this._animatingContext; }
62
+ public get animatingContext(): { start: number; end: number; offset: number } {
63
+ return this._animatingContext;
64
+ }
67
65
  /**
68
66
  * A current control parameters of the Axes instance
69
- * @ko 활성화된 현재 Axes 패러미터들
70
- * @type {ControlParams}
71
67
  */
72
68
  public get controlParams(): ControlParams {
73
69
  const axes = this._axes;
@@ -91,34 +87,33 @@ class AxesController {
91
87
 
92
88
  /**
93
89
  * A Boolean indicating whether the user input is enabled
94
- * @ko 현재 사용자 입력이 활성화되었는지를 나타내는 값
95
- * @type {boolean}
96
90
  * @readonly
97
91
  */
98
- public get enabled() { return this._panInput?.isEnabled() ?? false; }
92
+ public get enabled(): boolean {
93
+ return this._panInput?.isEnabled() ?? false;
94
+ }
99
95
  /**
100
- * Current position value in {@link https://naver.github.io/egjs-axes/release/latest/doc/eg.Axes.html Axes} instance
101
- * @ko {@link https://naver.github.io/egjs-axes/release/latest/doc/eg.Axes.html Axes} 인스턴스 내부의 현재 좌표 값
102
- * @type {number}
96
+ * Current position value in {@link https://naver.github.io/egjs-axes/docs/api/Axes | Axes} instance
103
97
  * @readonly
104
98
  */
105
- public get position() { return this._axes?.get([AXES.POSITION_KEY])[AXES.POSITION_KEY] ?? 0; }
99
+ public get position(): number {
100
+ return this._axes?.get([AXES.POSITION_KEY])[AXES.POSITION_KEY] ?? 0;
101
+ }
106
102
  /**
107
- * Current range value in {@link https://naver.github.io/egjs-axes/release/latest/doc/eg.Axes.html Axes} instance
108
- * @ko {@link https://naver.github.io/egjs-axes/release/latest/doc/eg.Axes.html Axes} 인스턴스 내부의 현재 이동 범위 값
109
- * @type {number[]}
103
+ * Current range value in {@link https://naver.github.io/egjs-axes/docs/api/Axes | Axes} instance
110
104
  * @readonly
111
105
  */
112
- public get range() { return this._axes?.axis[AXES.POSITION_KEY].range ?? [0, 0]; }
106
+ public get range(): number[] {
107
+ return this._axes?.axis[AXES.POSITION_KEY].range ?? [0, 0];
108
+ }
113
109
  /**
114
110
  * Actual bounce size(px)
115
- * @ko 적용된 bounce 크기(px 단위)
116
- * @type {number[]}
117
111
  * @readonly
118
112
  */
119
- public get bounce() { return this._axes?.axis[AXES.POSITION_KEY].bounce as number[] | undefined; }
113
+ public get bounce(): number[] | undefined {
114
+ return this._axes?.axis[AXES.POSITION_KEY].bounce as number[] | undefined;
115
+ }
120
116
 
121
- /** */
122
117
  public constructor() {
123
118
  this._resetInternalValues();
124
119
  this._stateMachine = new StateMachine();
@@ -126,26 +121,29 @@ class AxesController {
126
121
 
127
122
  /**
128
123
  * Initialize AxesController
129
- * @ko AxesController를 초기화합니다
130
- * @param {Flicking} flicking An instance of Flicking
131
- * @chainable
132
- * @return {this}
124
+ * @remarks
125
+ * This method creates and configures the Axes and PanInput instances.
126
+ * @param flicking - An instance of {@link Flicking}
127
+ * @returns The current instance for method chaining
133
128
  */
134
129
  public init(flicking: Flicking): this {
135
130
  this._flicking = flicking;
136
131
 
137
- this._axes = new Axes({
138
- [AXES.POSITION_KEY]: {
139
- range: [0, 0],
140
- circular: false,
141
- bounce: [0, 0]
132
+ this._axes = new Axes(
133
+ {
134
+ [AXES.POSITION_KEY]: {
135
+ range: [0, 0],
136
+ circular: false,
137
+ bounce: [0, 0]
138
+ }
139
+ },
140
+ {
141
+ deceleration: flicking.deceleration,
142
+ interruptable: flicking.interruptable,
143
+ nested: flicking.nested,
144
+ easing: flicking.easing
142
145
  }
143
- }, {
144
- deceleration: flicking.deceleration,
145
- interruptable: flicking.interruptable,
146
- nested: flicking.nested,
147
- easing: flicking.easing
148
- });
146
+ );
149
147
  this._panInput = new PanInput(flicking.viewport.element, {
150
148
  inputType: flicking.inputType,
151
149
  threshold: flicking.dragThreshold,
@@ -175,8 +173,8 @@ class AxesController {
175
173
 
176
174
  /**
177
175
  * Destroy AxesController and return to initial state
178
- * @ko AxesController를 초기 상태로 되돌립니다
179
- * @return {void}
176
+ * @remarks
177
+ * This method destroys the Axes and PanInput instances and removes all event handlers.
180
178
  */
181
179
  public destroy(): void {
182
180
  if (this._axes) {
@@ -191,9 +189,9 @@ class AxesController {
191
189
 
192
190
  /**
193
191
  * Enable input from the user (mouse/touch)
194
- * @ko 사용자의 입력(마우스/터치)를 활성화합니다
195
- * @chainable
196
- * @return {this}
192
+ * @remarks
193
+ * Enables the PanInput to receive user interactions.
194
+ * @returns The current instance for method chaining
197
195
  */
198
196
  public enable(): this {
199
197
  this._panInput?.enable();
@@ -203,9 +201,9 @@ class AxesController {
203
201
 
204
202
  /**
205
203
  * Disable input from the user (mouse/touch)
206
- * @ko 사용자의 입력(마우스/터치)를 막습니다
207
- * @chainable
208
- * @return {this}
204
+ * @remarks
205
+ * Disables the PanInput to ignore user interactions.
206
+ * @returns The current instance for method chaining
209
207
  */
210
208
  public disable(): this {
211
209
  this._panInput?.disable();
@@ -215,9 +213,9 @@ class AxesController {
215
213
 
216
214
  /**
217
215
  * Releases ongoing user input (mouse/touch)
218
- * @ko 사용자의 현재 입력(마우스/터치)를 중단시킵니다
219
- * @chainable
220
- * @return {this}
216
+ * @remarks
217
+ * Immediately releases the PanInput, simulating the user lifting their finger.
218
+ * @returns The current instance for method chaining
221
219
  */
222
220
  public release(): this {
223
221
  this._panInput?.release();
@@ -227,11 +225,11 @@ class AxesController {
227
225
 
228
226
  /**
229
227
  * Change the destination and duration of the animation currently playing
230
- * @ko 재생 중인 애니메이션의 목적지와 재생 시간을 변경합니다
231
- * @param {number} position A position to move<ko>이동할 좌표</ko>
232
- * @param {number} duration Duration of the animation (unit: ms)<ko>애니메이션 진행 시간 (단위: ms)</ko>
233
- * @chainable
234
- * @return {this}
228
+ * @remarks
229
+ * This method updates the Axes animation target position and optionally the duration.
230
+ * @param position - A position to move
231
+ * @param duration - Duration of the animation (unit: ms)
232
+ * @returns The current instance for method chaining
235
233
  */
236
234
  public updateAnimation(position: number, duration?: number): this {
237
235
  this._animatingContext = {
@@ -248,9 +246,9 @@ class AxesController {
248
246
 
249
247
  /**
250
248
  * Stops the animation currently playing
251
- * @ko 재생 중인 애니메이션을 중단시킵니다
252
- * @chainable
253
- * @return {this}
249
+ * @remarks
250
+ * This method immediately stops the Axes animation at the current position.
251
+ * @returns The current instance for method chaining
254
252
  */
255
253
  public stopAnimation(): this {
256
254
  this._axes?.stopAnimation();
@@ -259,13 +257,12 @@ class AxesController {
259
257
  }
260
258
 
261
259
  /**
262
- * Update {@link https://naver.github.io/egjs-axes/ @egjs/axes}'s state
263
- * @ko {@link https://naver.github.io/egjs-axes/ @egjs/axes}의 상태를 갱신합니다
264
- * @chainable
265
- * @throws {FlickingError}
266
- * {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link AxesController#init init} is not called before
267
- * <ko>{@link AxesController#init init}이 이전에 호출되지 않은 경우</ko>
268
- * @return {this}
260
+ * Update {@link https://naver.github.io/egjs-axes/ | @egjs/axes}'s state
261
+ * @remarks
262
+ * This method synchronizes the Axes state with the given control parameters.
263
+ * @param controlParams - Control parameters
264
+ * @throws {@link InitializationErrors}
265
+ * @returns The current instance for method chaining
269
266
  */
270
267
  public update(controlParams: ControlParams): this {
271
268
  const flicking = getFlickingAttached(this._flicking);
@@ -284,8 +281,9 @@ class AxesController {
284
281
 
285
282
  /**
286
283
  * Attach a handler to the camera element to prevent click events during animation
287
- * @ko 카메라 엘리먼트에 애니메이션 도중에 클릭 이벤트를 방지하는 핸들러를 부착합니다
288
- * @return {this}
284
+ * @remarks
285
+ * This is used when {@link FlickingOptions.preventClickOnDrag | preventClickOnDrag} is enabled.
286
+ * @returns The current instance for method chaining
289
287
  */
290
288
  public addPreventClickHandler(): this {
291
289
  const flicking = getFlickingAttached(this._flicking);
@@ -301,8 +299,9 @@ class AxesController {
301
299
 
302
300
  /**
303
301
  * Detach a handler to the camera element to prevent click events during animation
304
- * @ko 카메라 엘리먼트에 애니메이션 도중에 클릭 이벤트를 방지하는 핸들러를 탈착합니다
305
- * @return {this}
302
+ * @remarks
303
+ * This is used when {@link FlickingOptions.preventClickOnDrag | preventClickOnDrag} is disabled.
304
+ * @returns The current instance for method chaining
306
305
  */
307
306
  public removePreventClickHandler(): this {
308
307
  const flicking = getFlickingAttached(this._flicking);
@@ -317,32 +316,23 @@ class AxesController {
317
316
  }
318
317
 
319
318
  /**
320
- * Run Axes's {@link https://naver.github.io/egjs-axes/release/latest/doc/eg.Axes.html#setTo setTo} using the given position
321
- * @ko Axes의 {@link https://naver.github.io/egjs-axes/release/latest/doc/eg.Axes.html#setTo setTo} 메소드를 주어진 좌표를 이용하여 수행합니다
322
- * @param {number} position A position to move<ko>이동할 좌표</ko>
323
- * @param {number} duration Duration of the animation (unit: ms)<ko>애니메이션 진행 시간 (단위: ms)</ko>
324
- * @param {number} [axesEvent] If provided, it'll use its {@link https://naver#github#io/egjs-axes/release/latest/doc/eg#Axes#html#setTo setTo} method instead<ko>이 값이 주어졌을 경우, 해당 이벤트의 {@link https://naver#github#io/egjs-axes/release/latest/doc/eg#Axes#html#setTo setTo} 메소드를 대신해서 사용합니다.</ko>
325
- * @throws {FlickingError}
326
- * |code|condition|
327
- * |---|---|
328
- * |{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING}|When {@link Control#init init} is not called before|
329
- * |{@link ERROR_CODE ANIMATION_INTERRUPTED}|When the animation is interrupted by user input|
330
- * <ko>
331
- *
332
- * |code|condition|
333
- * |---|---|
334
- * |{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING}|{@link Control#init init}이 이전에 호출되지 않은 경우|
335
- * |{@link ERROR_CODE ANIMATION_INTERRUPTED}|사용자 입력에 의해 애니메이션이 중단된 경우|
336
- *
337
- * </ko>
338
- * @return {Promise<void>} A Promise which will be resolved after reaching the target position<ko>해당 좌표 도달시에 resolve되는 Promise</ko>
319
+ * Run Axes's {@link https://naver.github.io/egjs-axes/docs/api/Axes#setTo | setTo} using the given position
320
+ * @remarks
321
+ * If the target position equals the current position, the promise resolves immediately without animation.
322
+ * @param position - A position to move
323
+ * @param duration - Duration of the animation (unit: ms)
324
+ * @param axesEvent - If provided, it'll use its {@link https://naver.github.io/egjs-axes/docs/api/Axes#setTo | setTo} method instead
325
+ * @throws {@link MovementErrors}
326
+ * @returns A Promise which will be resolved after reaching the target position
339
327
  */
340
328
  public animateTo(position: number, duration: number, axesEvent?: OnRelease): Promise<void> {
341
329
  const axes = this._axes;
342
330
  const state = this._stateMachine.state;
343
331
 
344
332
  if (!axes) {
345
- return Promise.reject(new FlickingError(ERROR.MESSAGE.NOT_ATTACHED_TO_FLICKING, ERROR.CODE.NOT_ATTACHED_TO_FLICKING));
333
+ return Promise.reject(
334
+ new FlickingError(ERROR.MESSAGE.NOT_ATTACHED_TO_FLICKING, ERROR.CODE.NOT_ATTACHED_TO_FLICKING)
335
+ );
346
336
  }
347
337
 
348
338
  const startPos = this.getCurrentPosition();
@@ -398,7 +388,6 @@ class AxesController {
398
388
 
399
389
  /**
400
390
  * Returns the current axes position
401
- * @ko 현재 axes의 position을 반환합니다.
402
391
  */
403
392
  public getCurrentPosition() {
404
393
  return this._axes?.get([AXES.POSITION_KEY])[AXES.POSITION_KEY] ?? 0;
@@ -415,6 +404,11 @@ class AxesController {
415
404
  panInput.options.scale = flicking.horizontal ? [flicking.camera.panelOrder === ORDER.RTL ? 1 : -1, 0] : [0, -1];
416
405
  }
417
406
 
407
+ /**
408
+ * @internal
409
+ * @privateRemarks
410
+ * Resets all internal values to their defaults. Called during construction and destruction.
411
+ */
418
412
  private _resetInternalValues() {
419
413
  this._flicking = null;
420
414
  this._axes = null;
@@ -423,14 +417,29 @@ class AxesController {
423
417
  this._dragged = false;
424
418
  }
425
419
 
420
+ /**
421
+ * @internal
422
+ * @privateRemarks
423
+ * Handles the Axes hold event to reset the dragged state.
424
+ */
426
425
  private _onAxesHold = () => {
427
426
  this._dragged = false;
428
427
  };
429
428
 
429
+ /**
430
+ * @internal
431
+ * @privateRemarks
432
+ * Handles the Axes change event to update the dragged state.
433
+ */
430
434
  private _onAxesChange = () => {
431
435
  this._dragged = !!this._panInput?.isEnabled();
432
436
  };
433
437
 
438
+ /**
439
+ * @internal
440
+ * @privateRemarks
441
+ * Prevents click events when the user has dragged. Used for {@link FlickingOptions.preventClickOnDrag}.
442
+ */
434
443
  private _preventClickWhenDragged = (e: MouseEvent) => {
435
444
  if (this._dragged) {
436
445
  e.preventDefault();