@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.
Files changed (74) hide show
  1. package/declaration/Flicking.d.ts +240 -240
  2. package/declaration/camera/Camera.d.ts +82 -89
  3. package/declaration/camera/index.d.ts +4 -4
  4. package/declaration/camera/mode/BoundCameraMode.d.ts +13 -13
  5. package/declaration/camera/mode/CameraMode.d.ts +20 -20
  6. package/declaration/camera/mode/CircularCameraMode.d.ts +19 -19
  7. package/declaration/camera/mode/LinearCameraMode.d.ts +9 -9
  8. package/declaration/camera/mode/index.d.ts +6 -6
  9. package/declaration/cfc/getDefaultCameraTransform.d.ts +3 -3
  10. package/declaration/cfc/getRenderingPanels.d.ts +4 -4
  11. package/declaration/cfc/index.d.ts +5 -5
  12. package/declaration/cfc/sync.d.ts +4 -4
  13. package/declaration/cfc/withFlickingMethods.d.ts +2 -2
  14. package/declaration/const/axes.d.ts +8 -8
  15. package/declaration/const/error.d.ts +34 -34
  16. package/declaration/const/external.d.ts +44 -48
  17. package/declaration/control/AxesController.d.ts +44 -44
  18. package/declaration/control/Control.d.ts +44 -45
  19. package/declaration/control/FreeControl.d.ts +14 -14
  20. package/declaration/control/SnapControl.d.ts +16 -16
  21. package/declaration/control/StateMachine.d.ts +14 -14
  22. package/declaration/control/StrictControl.d.ts +20 -20
  23. package/declaration/control/index.d.ts +14 -14
  24. package/declaration/control/states/AnimatingState.d.ts +9 -9
  25. package/declaration/control/states/DisabledState.d.ts +9 -9
  26. package/declaration/control/states/DraggingState.d.ts +8 -8
  27. package/declaration/control/states/HoldingState.d.ts +10 -10
  28. package/declaration/control/states/IdleState.d.ts +9 -9
  29. package/declaration/control/states/State.d.ts +47 -47
  30. package/declaration/core/AnchorPoint.d.ts +15 -15
  31. package/declaration/core/AutoResizer.d.ts +16 -16
  32. package/declaration/core/FlickingError.d.ts +5 -5
  33. package/declaration/core/ResizeWatcher.d.ts +33 -33
  34. package/declaration/core/Viewport.d.ts +25 -25
  35. package/declaration/core/VirtualManager.d.ts +37 -37
  36. package/declaration/core/index.d.ts +6 -6
  37. package/declaration/core/panel/Panel.d.ts +89 -89
  38. package/declaration/core/panel/VirtualPanel.d.ts +19 -19
  39. package/declaration/core/panel/index.d.ts +5 -5
  40. package/declaration/core/panel/provider/ElementProvider.d.ts +8 -8
  41. package/declaration/core/panel/provider/VanillaElementProvider.d.ts +12 -12
  42. package/declaration/core/panel/provider/VirtualElementProvider.d.ts +15 -15
  43. package/declaration/core/panel/provider/index.d.ts +5 -5
  44. package/declaration/index.cjs.d.ts +3 -3
  45. package/declaration/index.d.ts +13 -13
  46. package/declaration/index.umd.d.ts +2 -2
  47. package/declaration/renderer/ExternalRenderer.d.ts +7 -7
  48. package/declaration/renderer/Renderer.d.ts +59 -59
  49. package/declaration/renderer/VanillaRenderer.d.ts +10 -10
  50. package/declaration/renderer/index.d.ts +6 -6
  51. package/declaration/renderer/strategy/NormalRenderingStrategy.d.ts +23 -23
  52. package/declaration/renderer/strategy/RenderingStrategy.d.ts +15 -15
  53. package/declaration/renderer/strategy/VirtualRenderingStrategy.d.ts +17 -17
  54. package/declaration/renderer/strategy/index.d.ts +5 -5
  55. package/declaration/type/event.d.ts +88 -88
  56. package/declaration/type/external.d.ts +31 -31
  57. package/declaration/type/internal.d.ts +13 -13
  58. package/declaration/utils.d.ts +45 -45
  59. package/dist/flicking.cjs.js +20 -77
  60. package/dist/flicking.cjs.js.map +1 -1
  61. package/dist/flicking.esm.js +21 -76
  62. package/dist/flicking.esm.js.map +1 -1
  63. package/dist/flicking.js +20 -76
  64. package/dist/flicking.js.map +1 -1
  65. package/dist/flicking.min.js +2 -2
  66. package/dist/flicking.min.js.map +1 -1
  67. package/dist/flicking.pkgd.js +20 -76
  68. package/dist/flicking.pkgd.js.map +1 -1
  69. package/dist/flicking.pkgd.min.js +2 -2
  70. package/dist/flicking.pkgd.min.js.map +1 -1
  71. package/package.json +1 -1
  72. package/src/Flicking.ts +6 -0
  73. package/src/control/Control.ts +3 -3
  74. package/src/control/SnapControl.ts +4 -4
@@ -4,13 +4,13 @@ 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.1
7
+ version: 4.11.0-snapshot
8
8
  */
9
9
  import Component, { ComponentEvent } from '@egjs/component';
10
10
  import Axes, { PanInput } from '@egjs/axes';
11
11
  import ImReady from '@egjs/imready';
12
12
 
13
- /******************************************************************************
13
+ /*! *****************************************************************************
14
14
  Copyright (c) Microsoft Corporation.
15
15
 
16
16
  Permission to use, copy, modify, and/or distribute this software for any
@@ -24,7 +24,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
24
24
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25
25
  PERFORMANCE OF THIS SOFTWARE.
26
26
  ***************************************************************************** */
27
- /* global Reflect, Promise, SuppressedError, Symbol */
27
+ /* global Reflect, Promise */
28
28
 
29
29
  var extendStatics = function (d, b) {
30
30
  extendStatics = Object.setPrototypeOf || {
@@ -109,7 +109,7 @@ function __generator(thisArg, body) {
109
109
  }
110
110
  function step(op) {
111
111
  if (f) throw new TypeError("Generator is already executing.");
112
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
112
+ while (_) try {
113
113
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
114
114
  if (y = 0, t) op = [op[0] & 2, t.value];
115
115
  switch (op[0]) {
@@ -213,10 +213,6 @@ function __spread() {
213
213
  for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
214
214
  return ar;
215
215
  }
216
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
217
- var e = new Error(message);
218
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
219
- };
220
216
 
221
217
  /*
222
218
  * Copyright (c) 2015 NAVER Corp.
@@ -400,17 +396,6 @@ var CIRCULAR_FALLBACK = {
400
396
  LINEAR: "linear",
401
397
  BOUND: "bound"
402
398
  };
403
- /**
404
- * An object for identifying {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS property applied to the camera element(`.flicking-camera`)
405
- * @ko 카메라 엘리먼트(`.flicking-camera`)에 적용된 {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS 속성을 구분하기 위한 객체
406
- * @type {object}
407
- * @property {string} LTR "ltr"
408
- * @property {string} RTL "rtl"
409
- */
410
- var ORDER = {
411
- LTR: "ltr",
412
- RTL: "rtl"
413
- };
414
399
 
415
400
  // eslint-disable-next-line @typescript-eslint/ban-types
416
401
  var merge = function (target) {
@@ -704,22 +689,20 @@ var getElementSize = function (_a) {
704
689
  useFractionalSize = _a.useFractionalSize,
705
690
  useOffset = _a.useOffset,
706
691
  style = _a.style;
707
- var size = 0;
708
692
  if (useFractionalSize) {
709
- var baseSize = parseFloat(horizontal ? style.width : style.height) || 0;
693
+ var baseSize = parseFloat(horizontal ? style.width : style.height);
710
694
  var isBorderBoxSizing = style.boxSizing === "border-box";
711
695
  var border = horizontal ? parseFloat(style.borderLeftWidth || "0") + parseFloat(style.borderRightWidth || "0") : parseFloat(style.borderTopWidth || "0") + parseFloat(style.borderBottomWidth || "0");
712
696
  if (isBorderBoxSizing) {
713
- size = useOffset ? baseSize : baseSize - border;
697
+ return useOffset ? baseSize : baseSize - border;
714
698
  } else {
715
699
  var padding = horizontal ? parseFloat(style.paddingLeft || "0") + parseFloat(style.paddingRight || "0") : parseFloat(style.paddingTop || "0") + parseFloat(style.paddingBottom || "0");
716
- size = useOffset ? baseSize + padding + border : baseSize + padding;
700
+ return useOffset ? baseSize + padding + border : baseSize + padding;
717
701
  }
718
702
  } else {
719
703
  var sizeStr = horizontal ? "Width" : "Height";
720
- size = useOffset ? el["offset" + sizeStr] : el["client" + sizeStr];
704
+ return useOffset ? el["offset" + sizeStr] : el["client" + sizeStr];
721
705
  }
722
- return Math.max(size, 0);
723
706
  };
724
707
  var setPrototypeOf = Object.setPrototypeOf || function (obj, proto) {
725
708
  obj.__proto__ = proto;
@@ -2103,7 +2086,7 @@ var AxesController = /*#__PURE__*/function () {
2103
2086
  threshold: 1,
2104
2087
  iOSEdgeSwipeThreshold: flicking.iOSEdgeSwipeThreshold,
2105
2088
  preventDefaultOnDrag: flicking.preventDefaultOnDrag,
2106
- scale: flicking.horizontal ? [flicking.camera.panelOrder === ORDER.RTL ? 1 : -1, 0] : [0, -1],
2089
+ scale: flicking.horizontal ? [-1, 0] : [0, -1],
2107
2090
  releaseOnScroll: true
2108
2091
  });
2109
2092
  var axes = this._axes;
@@ -2328,7 +2311,7 @@ var AxesController = /*#__PURE__*/function () {
2328
2311
  var panInput = this._panInput;
2329
2312
  axes.disconnect(panInput);
2330
2313
  axes.connect(flicking.horizontal ? [POSITION_KEY, ""] : ["", POSITION_KEY], panInput);
2331
- panInput.options.scale = flicking.horizontal ? [flicking.camera.panelOrder === ORDER.RTL ? 1 : -1, 0] : [0, -1];
2314
+ panInput.options.scale = flicking.horizontal ? [-1, 0] : [0, -1];
2332
2315
  };
2333
2316
  __proto._resetInternalValues = function () {
2334
2317
  this._flicking = null;
@@ -2610,7 +2593,6 @@ var Control = /*#__PURE__*/function () {
2610
2593
  var _a;
2611
2594
  var flicking = getFlickingAttached(this._flicking);
2612
2595
  this._activePanel = newActivePanel;
2613
- this._nextPanel = null;
2614
2596
  flicking.camera.updateAdaptiveHeight();
2615
2597
  if (newActivePanel !== prevActivePanel) {
2616
2598
  flicking.trigger(new ComponentEvent(EVENTS.CHANGED, {
@@ -2647,7 +2629,6 @@ var Control = /*#__PURE__*/function () {
2647
2629
  isTrusted: (axesEvent === null || axesEvent === void 0 ? void 0 : axesEvent.isTrusted) || false,
2648
2630
  direction: getDirection((_a = activePanel === null || activePanel === void 0 ? void 0 : activePanel.position) !== null && _a !== void 0 ? _a : camera.position, position)
2649
2631
  });
2650
- this._nextPanel = panel;
2651
2632
  flicking.trigger(event);
2652
2633
  if (event.isCanceled()) {
2653
2634
  throw new FlickingError(MESSAGE.STOP_CALLED_BY_USER, CODE.STOP_CALLED_BY_USER);
@@ -3235,20 +3216,19 @@ var StrictControl = /*#__PURE__*/function (_super) {
3235
3216
  * @return {Promise<void>} A Promise which will be resolved after reaching the target position<ko>해당 좌표 도달시에 resolve되는 Promise</ko>
3236
3217
  */
3237
3218
  __proto.moveToPosition = function (position, duration, axesEvent) {
3238
- var _a;
3239
3219
  var flicking = getFlickingAttached(this._flicking);
3240
3220
  var camera = flicking.camera;
3241
- var currentPanel = (_a = this._nextPanel) !== null && _a !== void 0 ? _a : this._activePanel;
3221
+ var activePanel = this._activePanel;
3242
3222
  var axesRange = this._controller.range;
3243
3223
  var indexRange = this._indexRange;
3244
3224
  var cameraRange = camera.range;
3245
3225
  var state = this._controller.state;
3246
3226
  var clampedPosition = clamp(camera.clampToReachablePosition(position), axesRange[0], axesRange[1]);
3247
3227
  var anchorAtPosition = camera.findAnchorIncludePosition(clampedPosition);
3248
- if (!anchorAtPosition || !currentPanel) {
3228
+ if (!anchorAtPosition || !activePanel) {
3249
3229
  return Promise.reject(new FlickingError(MESSAGE.POSITION_NOT_REACHABLE(position), CODE.POSITION_NOT_REACHABLE));
3250
3230
  }
3251
- var prevPos = currentPanel.position;
3231
+ var prevPos = activePanel.position;
3252
3232
  var posDelta = flicking.animating ? state.delta : position - camera.position;
3253
3233
  var isOverThreshold = Math.abs(posDelta) >= flicking.threshold;
3254
3234
  var adjacentAnchor = position > prevPos ? camera.getNextAnchor(anchorAtPosition) : camera.getPrevAnchor(anchorAtPosition);
@@ -3265,7 +3245,7 @@ var StrictControl = /*#__PURE__*/function (_super) {
3265
3245
  var targetAnchor = position < cameraRange.min ? firstAnchor : lastAnchor;
3266
3246
  targetPanel = targetAnchor.panel;
3267
3247
  targetPos = targetAnchor.position;
3268
- } else if (isOverThreshold && anchorAtPosition.position !== currentPanel.position) {
3248
+ } else if (isOverThreshold && anchorAtPosition.position !== activePanel.position) {
3269
3249
  // Move to anchor at position
3270
3250
  targetPanel = anchorAtPosition.panel;
3271
3251
  targetPos = anchorAtPosition.position;
@@ -4003,19 +3983,6 @@ var Camera = /*#__PURE__*/function () {
4003
3983
  enumerable: false,
4004
3984
  configurable: true
4005
3985
  });
4006
- Object.defineProperty(__proto, "panelOrder", {
4007
- /**
4008
- * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS property applied to the camera element(`.flicking-camera`)
4009
- * @ko 카메라 엘리먼트(`.flicking-camera`)에 적용된 {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS 속성
4010
- * @type {string}
4011
- * @readonly
4012
- */
4013
- get: function () {
4014
- return this._panelOrder;
4015
- },
4016
- enumerable: false,
4017
- configurable: true
4018
- });
4019
3986
  Object.defineProperty(__proto, "align", {
4020
3987
  // Options Getter
4021
3988
  /**
@@ -4047,7 +4014,6 @@ var Camera = /*#__PURE__*/function () {
4047
4014
  this._el = viewportEl.firstElementChild;
4048
4015
  this._checkTranslateSupport();
4049
4016
  this._updateMode();
4050
- this.updatePanelOrder();
4051
4017
  return this;
4052
4018
  };
4053
4019
  /**
@@ -4169,13 +4135,11 @@ var Camera = /*#__PURE__*/function () {
4169
4135
  * @return {AnchorPoint | null}
4170
4136
  */
4171
4137
  __proto.findActiveAnchor = function () {
4172
- var _a;
4173
4138
  var flicking = getFlickingAttached(this._flicking);
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);
4139
+ var activeIndex = flicking.control.activeIndex;
4140
+ return find(this._anchors, function (anchor) {
4141
+ return anchor.panel.index === activeIndex;
4142
+ });
4179
4143
  };
4180
4144
  /**
4181
4145
  * Clamp the given position between camera's range
@@ -4292,24 +4256,6 @@ var Camera = /*#__PURE__*/function () {
4292
4256
  this.applyTransform();
4293
4257
  return this;
4294
4258
  };
4295
- /**
4296
- * Update direction to match the {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS property applied to the camera element
4297
- * @ko 카메라 엘리먼트에 적용된 {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS 속성에 맞게 방향을 업데이트합니다
4298
- * @return {this}
4299
- */
4300
- __proto.updatePanelOrder = function () {
4301
- var flicking = getFlickingAttached(this._flicking);
4302
- if (!flicking.horizontal) return this;
4303
- var el = this._el;
4304
- var direction = getStyle(el).direction;
4305
- if (direction !== this._panelOrder) {
4306
- this._panelOrder = direction === ORDER.RTL ? ORDER.RTL : ORDER.LTR;
4307
- if (flicking.initialized) {
4308
- flicking.control.controller.updateDirection();
4309
- }
4310
- }
4311
- return this;
4312
- };
4313
4259
  /**
4314
4260
  * Reset the history of {@link Flicking#event:needPanel needPanel} events so it can be triggered again
4315
4261
  * @ko 발생한 {@link Flicking#event:needPanel needPanel} 이벤트들을 초기화하여 다시 발생할 수 있도록 합니다
@@ -4334,7 +4280,7 @@ var Camera = /*#__PURE__*/function () {
4334
4280
  var renderer = flicking.renderer;
4335
4281
  if (renderer.rendering || !flicking.initialized) return this;
4336
4282
  var actualPosition = this._position - this._alignPos - this._offset + this._circularOffset;
4337
- el.style[this._transform] = flicking.horizontal ? "translate(" + (this._panelOrder === ORDER.RTL ? actualPosition : -actualPosition) + "px)" : "translate(0, " + -actualPosition + "px)";
4283
+ el.style[this._transform] = flicking.horizontal ? "translate(" + -actualPosition + "px)" : "translate(0, " + -actualPosition + "px)";
4338
4284
  return this;
4339
4285
  };
4340
4286
  __proto._resetInternalValues = function () {
@@ -7587,7 +7533,6 @@ var Flicking = /*#__PURE__*/function (_super) {
7587
7533
  camera.updateRange();
7588
7534
  camera.updateAnchors();
7589
7535
  camera.updateAdaptiveHeight();
7590
- camera.updatePanelOrder();
7591
7536
  camera.updateOffset();
7592
7537
  return [4 /*yield*/, renderer.render()];
7593
7538
  case 2:
@@ -7828,7 +7773,7 @@ var Flicking = /*#__PURE__*/function (_super) {
7828
7773
  * Flicking.VERSION; // ex) 4.0.0
7829
7774
  * ```
7830
7775
  */
7831
- Flicking.VERSION = "4.11.3-beta.1";
7776
+ Flicking.VERSION = "4.11.0-snapshot";
7832
7777
  return Flicking;
7833
7778
  }(Component);
7834
7779
 
@@ -8046,5 +7991,5 @@ var parseAlign = function (alignVal) {
8046
7991
  * egjs projects are licensed under the MIT license
8047
7992
  */
8048
7993
 
8049
- export { ALIGN, AnchorPoint, AnimatingState, AxesController, BoundCameraMode, CIRCULAR_FALLBACK, CLASS, Camera, CircularCameraMode, Control, DIRECTION, DisabledState, DraggingState, CODE as ERROR_CODE, EVENTS, ExternalRenderer, FlickingError, FreeControl, HoldingState, IdleState, LinearCameraMode, MOVE_TYPE, NormalRenderingStrategy, ORDER, Panel, Renderer, SnapControl, State, StateMachine, StrictControl, VanillaElementProvider, VanillaRenderer, Viewport, VirtualElementProvider, VirtualManager, VirtualPanel, VirtualRenderingStrategy, checkExistence, circulateIndex, circulatePosition, clamp, Flicking as default, find, findIndex, findRight, getDefaultCameraTransform, getDirection, getElement, getElementSize, getFlickingAttached, getMinusCompensatedIndex, getProgress, getRenderingPanels, getStyle, includes, isBetween, isString, merge, parseAlign$1 as parseAlign, parseArithmeticExpression, parseArithmeticSize, parseBounce, parseCSSSizeValue, parseElement, parsePanelAlign, range, setPrototypeOf, setSize, sync, toArray, withFlickingMethods };
7994
+ export { ALIGN, AnchorPoint, AnimatingState, AxesController, BoundCameraMode, CIRCULAR_FALLBACK, CLASS, Camera, CircularCameraMode, Control, DIRECTION, DisabledState, DraggingState, CODE as ERROR_CODE, EVENTS, ExternalRenderer, FlickingError, FreeControl, HoldingState, IdleState, LinearCameraMode, MOVE_TYPE, NormalRenderingStrategy, Panel, Renderer, SnapControl, State, StateMachine, StrictControl, VanillaElementProvider, VanillaRenderer, Viewport, VirtualElementProvider, VirtualManager, VirtualPanel, VirtualRenderingStrategy, checkExistence, circulateIndex, circulatePosition, clamp, Flicking as default, find, findIndex, findRight, getDefaultCameraTransform, getDirection, getElement, getElementSize, getFlickingAttached, getMinusCompensatedIndex, getProgress, getRenderingPanels, getStyle, includes, isBetween, isString, merge, parseAlign$1 as parseAlign, parseArithmeticExpression, parseArithmeticSize, parseBounce, parseCSSSizeValue, parseElement, parsePanelAlign, range, setPrototypeOf, setSize, sync, toArray, withFlickingMethods };
8050
7995
  //# sourceMappingURL=flicking.esm.js.map