@egjs/flicking 4.4.1 → 4.4.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/README.md CHANGED
@@ -6,7 +6,6 @@
6
6
  <p align="center" style="line-height: 2;">
7
7
  <a href="https://www.npmjs.com/package/@egjs/flicking" target="_blank"><img src="https://img.shields.io/npm/v/@egjs/flicking.svg?style=flat-square&color=007acc&label=version&logo=NPM" alt="version" /></a>
8
8
  <a href="https://www.npmjs.com/package/@egjs/flicking" target="_blank"><img alt="npm bundle size (scoped)" src="https://img.shields.io/bundlephobia/minzip/@egjs/flicking.svg?style=flat-square&label=%F0%9F%92%BE%20gzipped&color=007acc" /></a>
9
- <a href="https://travis-ci.org/naver/egjs-flicking" target="_blank"><img alt="Travis (.org)" src="https://img.shields.io/travis/naver/egjs-flicking.svg?style=flat-square&label=build&logo=travis%20ci" /></a>
10
9
  <a href="https://coveralls.io/github/naver/egjs-flicking?branch=master&style=flat-square" target="_blank"><img alt="Coveralls github" src="https://img.shields.io/coveralls/github/naver/egjs-flicking.svg?style=flat-square&label=%E2%9C%85%20coverage" /></a>
11
10
  <a href="https://deepscan.io/dashboard#view=project&tid=3998&pid=5802&bid=46086"><img src="https://deepscan.io/api/teams/3998/projects/5802/branches/46086/badge/grade.svg" alt="DeepScan grade" /></a>
12
11
  </p>
@@ -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.4.1
7
+ version: 4.4.2
8
8
  */
9
9
  import Component, { ComponentEvent } from '@egjs/component';
10
10
  import Axes, { PanInput } from '@egjs/axes';
@@ -3697,7 +3697,7 @@ function () {
3697
3697
  * @ko Camera의 {@link Camera#position position}이 도달 가능한 범위
3698
3698
  * @type {object}
3699
3699
  * @property {number} min A minimum position<ko>최소 위치</ko>
3700
- * @property {number} min A maximum position<ko>최대 위치</ko>
3700
+ * @property {number} max A maximum position<ko>최대 위치</ko>
3701
3701
  * @readonly
3702
3702
  */
3703
3703
  get: function () {
@@ -8145,7 +8145,7 @@ function (_super) {
8145
8145
  */
8146
8146
 
8147
8147
 
8148
- Flicking.VERSION = "4.4.1";
8148
+ Flicking.VERSION = "4.4.2";
8149
8149
  return Flicking;
8150
8150
  }(Component);
8151
8151
 
@@ -8222,6 +8222,8 @@ var sync = (function (flicking, diffResult, rendered) {
8222
8222
  var renderer = flicking.renderer;
8223
8223
  var panels = renderer.panels;
8224
8224
 
8225
+ var prevList = __spreadArray([], __read(diffResult.prevList));
8226
+
8225
8227
  if (diffResult.removed.length > 0) {
8226
8228
  var endIdx_1 = -1;
8227
8229
  var prevIdx_1 = -1;
@@ -8237,6 +8239,8 @@ var sync = (function (flicking, diffResult, rendered) {
8237
8239
  } else {
8238
8240
  prevIdx_1 = removedIdx;
8239
8241
  }
8242
+
8243
+ prevList.splice(removedIdx, 1);
8240
8244
  });
8241
8245
  batchRemove(renderer, prevIdx_1, endIdx_1 + 1);
8242
8246
  }
@@ -8276,13 +8280,14 @@ var sync = (function (flicking, diffResult, rendered) {
8276
8280
  if (diffResult.added.length > 0) {
8277
8281
  var startIdx_1 = -1;
8278
8282
  var prevIdx_2 = -1;
8283
+ var addedElements_1 = rendered.slice(prevList.length);
8279
8284
  diffResult.added.forEach(function (addedIdx, idx) {
8280
8285
  if (startIdx_1 < 0) {
8281
8286
  startIdx_1 = idx;
8282
8287
  }
8283
8288
 
8284
8289
  if (prevIdx_2 >= 0 && addedIdx !== prevIdx_2 + 1) {
8285
- batchInsert(renderer, diffResult, rendered, startIdx_1, idx + 1);
8290
+ batchInsert(renderer, diffResult, addedElements_1, startIdx_1, idx + 1);
8286
8291
  startIdx_1 = -1;
8287
8292
  prevIdx_2 = -1;
8288
8293
  } else {
@@ -8291,16 +8296,16 @@ var sync = (function (flicking, diffResult, rendered) {
8291
8296
  });
8292
8297
 
8293
8298
  if (startIdx_1 >= 0) {
8294
- batchInsert(renderer, diffResult, rendered, startIdx_1);
8299
+ batchInsert(renderer, diffResult, addedElements_1, startIdx_1);
8295
8300
  }
8296
8301
  }
8297
8302
  });
8298
8303
 
8299
- var batchInsert = function (renderer, diffResult, rendered, startIdx, endIdx) {
8304
+ var batchInsert = function (renderer, diffResult, addedElements, startIdx, endIdx) {
8300
8305
  renderer.batchInsert.apply(renderer, __spreadArray([], __read(diffResult.added.slice(startIdx, endIdx).map(function (index, elIdx) {
8301
8306
  return {
8302
8307
  index: index,
8303
- elements: [rendered[elIdx + diffResult.prevList.length]],
8308
+ elements: [addedElements[elIdx]],
8304
8309
  hasDOMInElements: false
8305
8310
  };
8306
8311
  }))));