@egjs/flicking 4.11.5-beta.1 → 4.11.5-beta.2
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 +0 -2
- package/declaration/camera/Camera.d.ts +1 -0
- package/declaration/core/AutoResizer.d.ts +0 -1
- package/dist/flicking.cjs.js +17 -49
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +17 -49
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +17 -49
- 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 +27 -66
- 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 +1 -12
- package/src/camera/Camera.ts +9 -1
- package/src/core/AutoResizer.ts +1 -16
- package/src/renderer/Renderer.ts +0 -6
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Component from "@egjs/component";
|
|
2
2
|
import Viewport from "./core/Viewport";
|
|
3
|
-
import AutoResizer from "./core/AutoResizer";
|
|
4
3
|
import { Panel } from "./core/panel";
|
|
5
4
|
import VirtualManager, { VirtualOptions } from "./core/VirtualManager";
|
|
6
5
|
import { Control } from "./control";
|
|
@@ -123,7 +122,6 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
123
122
|
get camera(): Camera;
|
|
124
123
|
get renderer(): Renderer;
|
|
125
124
|
get viewport(): Viewport;
|
|
126
|
-
get autoResizer(): AutoResizer;
|
|
127
125
|
get initialized(): boolean;
|
|
128
126
|
get circularEnabled(): boolean;
|
|
129
127
|
get virtualEnabled(): boolean;
|
package/dist/flicking.cjs.js
CHANGED
|
@@ -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.5-beta.
|
|
7
|
+
version: 4.11.5-beta.2
|
|
8
8
|
*/
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ var Component = require('@egjs/component');
|
|
|
12
12
|
var Axes = require('@egjs/axes');
|
|
13
13
|
var ImReady = require('@egjs/imready');
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
/*! *****************************************************************************
|
|
16
16
|
Copyright (c) Microsoft Corporation.
|
|
17
17
|
|
|
18
18
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -26,7 +26,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
26
26
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
27
27
|
PERFORMANCE OF THIS SOFTWARE.
|
|
28
28
|
***************************************************************************** */
|
|
29
|
-
/* global Reflect, Promise
|
|
29
|
+
/* global Reflect, Promise */
|
|
30
30
|
|
|
31
31
|
var extendStatics = function (d, b) {
|
|
32
32
|
extendStatics = Object.setPrototypeOf || {
|
|
@@ -111,7 +111,7 @@ function __generator(thisArg, body) {
|
|
|
111
111
|
}
|
|
112
112
|
function step(op) {
|
|
113
113
|
if (f) throw new TypeError("Generator is already executing.");
|
|
114
|
-
while (
|
|
114
|
+
while (_) try {
|
|
115
115
|
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;
|
|
116
116
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
117
117
|
switch (op[0]) {
|
|
@@ -215,10 +215,6 @@ function __spread() {
|
|
|
215
215
|
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
|
216
216
|
return ar;
|
|
217
217
|
}
|
|
218
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
219
|
-
var e = new Error(message);
|
|
220
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
221
|
-
};
|
|
222
218
|
|
|
223
219
|
/*
|
|
224
220
|
* Copyright (c) 2015 NAVER Corp.
|
|
@@ -910,10 +906,6 @@ var Viewport = /*#__PURE__*/function () {
|
|
|
910
906
|
return Viewport;
|
|
911
907
|
}();
|
|
912
908
|
|
|
913
|
-
/**
|
|
914
|
-
* A component that detects size change and trigger resize method when the autoResize option is used
|
|
915
|
-
* @ko autoResize 옵션을 사용할 때 크기 변화를 감지하고 Flicking의 resize를 호출하는 컴포넌트
|
|
916
|
-
*/
|
|
917
909
|
var AutoResizer = /*#__PURE__*/function () {
|
|
918
910
|
function AutoResizer(flicking) {
|
|
919
911
|
var _this = this;
|
|
@@ -976,13 +968,9 @@ var AutoResizer = /*#__PURE__*/function () {
|
|
|
976
968
|
}
|
|
977
969
|
if (flicking.useResizeObserver && !!window.ResizeObserver) {
|
|
978
970
|
var viewportSizeNot0 = viewport.width !== 0 || viewport.height !== 0;
|
|
979
|
-
var
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
})).forEach(function (element) {
|
|
983
|
-
resizeObserver_1.observe(element);
|
|
984
|
-
});
|
|
985
|
-
this._resizeObserver = resizeObserver_1;
|
|
971
|
+
var resizeObserver = viewportSizeNot0 ? new ResizeObserver(this._skipFirstResize) : new ResizeObserver(this._onResize);
|
|
972
|
+
resizeObserver.observe(flicking.viewport.element);
|
|
973
|
+
this._resizeObserver = resizeObserver;
|
|
986
974
|
} else {
|
|
987
975
|
window.addEventListener("resize", this._onResize);
|
|
988
976
|
}
|
|
@@ -1001,12 +989,6 @@ var AutoResizer = /*#__PURE__*/function () {
|
|
|
1001
989
|
this._enabled = false;
|
|
1002
990
|
return this;
|
|
1003
991
|
};
|
|
1004
|
-
__proto.observe = function (element) {
|
|
1005
|
-
if (this._resizeObserver) {
|
|
1006
|
-
this._resizeObserver.observe(element);
|
|
1007
|
-
}
|
|
1008
|
-
return this;
|
|
1009
|
-
};
|
|
1010
992
|
return AutoResizer;
|
|
1011
993
|
}();
|
|
1012
994
|
|
|
@@ -4086,6 +4068,8 @@ var Camera = /*#__PURE__*/function () {
|
|
|
4086
4068
|
*/
|
|
4087
4069
|
__proto.lookAt = function (pos) {
|
|
4088
4070
|
var _this = this;
|
|
4071
|
+
var prevOffset = this._offset;
|
|
4072
|
+
var isChangedOffset = this._lookedOffset !== prevOffset;
|
|
4089
4073
|
var flicking = getFlickingAttached(this._flicking);
|
|
4090
4074
|
var prevPos = this._position;
|
|
4091
4075
|
this._position = pos;
|
|
@@ -4093,10 +4077,15 @@ var Camera = /*#__PURE__*/function () {
|
|
|
4093
4077
|
this._refreshVisiblePanels();
|
|
4094
4078
|
this._checkNeedPanel();
|
|
4095
4079
|
this._checkReachEnd(prevPos, pos);
|
|
4096
|
-
if (toggled) {
|
|
4080
|
+
if (isChangedOffset || toggled) {
|
|
4097
4081
|
void flicking.renderer.render().then(function () {
|
|
4098
4082
|
_this.updateOffset();
|
|
4083
|
+
_this._lookedOffset = _this._offset;
|
|
4099
4084
|
});
|
|
4085
|
+
} else if (isChangedOffset) {
|
|
4086
|
+
// sync offset for renderOnlyVisible on resize
|
|
4087
|
+
this.updateOffset();
|
|
4088
|
+
this._lookedOffset = this._offset;
|
|
4100
4089
|
} else {
|
|
4101
4090
|
this.applyTransform();
|
|
4102
4091
|
}
|
|
@@ -4780,11 +4769,6 @@ var Renderer = /*#__PURE__*/function () {
|
|
|
4780
4769
|
var activePanel = control.activePanel;
|
|
4781
4770
|
// Update camera & control
|
|
4782
4771
|
this._updateCameraAndControl();
|
|
4783
|
-
if (flicking.autoResize && flicking.useResizeObserver) {
|
|
4784
|
-
panelsAdded.forEach(function (panel) {
|
|
4785
|
-
flicking.autoResizer.observe(panel.element);
|
|
4786
|
-
});
|
|
4787
|
-
}
|
|
4788
4772
|
void this.render();
|
|
4789
4773
|
if (!flicking.animating) {
|
|
4790
4774
|
if (!activePanel || activePanel.removed) {
|
|
@@ -6186,19 +6170,6 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
6186
6170
|
enumerable: false,
|
|
6187
6171
|
configurable: true
|
|
6188
6172
|
});
|
|
6189
|
-
Object.defineProperty(__proto, "autoResizer", {
|
|
6190
|
-
/**
|
|
6191
|
-
* {@link AutoResizer} instance of the Flicking
|
|
6192
|
-
* @ko 현재 Flicking에 활성화된 {@link AutoResizer} 인스턴스
|
|
6193
|
-
* @internal
|
|
6194
|
-
* @readonly
|
|
6195
|
-
*/
|
|
6196
|
-
get: function () {
|
|
6197
|
-
return this._autoResizer;
|
|
6198
|
-
},
|
|
6199
|
-
enumerable: false,
|
|
6200
|
-
configurable: true
|
|
6201
|
-
});
|
|
6202
6173
|
Object.defineProperty(__proto, "initialized", {
|
|
6203
6174
|
// Internal States
|
|
6204
6175
|
/**
|
|
@@ -7051,9 +7022,6 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7051
7022
|
// OTHERS
|
|
7052
7023
|
set: function (val) {
|
|
7053
7024
|
this._autoResize = val;
|
|
7054
|
-
if (!this._initialized) {
|
|
7055
|
-
return;
|
|
7056
|
-
}
|
|
7057
7025
|
if (val) {
|
|
7058
7026
|
this._autoResizer.enable();
|
|
7059
7027
|
} else {
|
|
@@ -7076,7 +7044,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7076
7044
|
},
|
|
7077
7045
|
set: function (val) {
|
|
7078
7046
|
this._useResizeObserver = val;
|
|
7079
|
-
if (this.
|
|
7047
|
+
if (this._autoResize) {
|
|
7080
7048
|
this._autoResizer.enable();
|
|
7081
7049
|
}
|
|
7082
7050
|
},
|
|
@@ -7873,7 +7841,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7873
7841
|
* Flicking.VERSION; // ex) 4.0.0
|
|
7874
7842
|
* ```
|
|
7875
7843
|
*/
|
|
7876
|
-
Flicking.VERSION = "4.11.5-beta.
|
|
7844
|
+
Flicking.VERSION = "4.11.5-beta.2";
|
|
7877
7845
|
return Flicking;
|
|
7878
7846
|
}(Component);
|
|
7879
7847
|
|