@react-stately/virtualizer 3.5.3-nightly.3964 → 3.5.3-nightly.3966

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/dist/import.mjs CHANGED
@@ -1,6 +1,5 @@
1
1
  import {useState as $8D3nr$useState, useMemo as $8D3nr$useMemo, useEffect as $8D3nr$useEffect, useCallback as $8D3nr$useCallback} from "react";
2
2
  import {useLayoutEffect as $8D3nr$useLayoutEffect} from "@react-aria/utils";
3
- import $8D3nr$swchelperssrc_define_propertymjs from "@swc/helpers/src/_define_property.mjs";
4
3
 
5
4
  /*
6
5
  * Copyright 2020 Adobe. All rights reserved.
@@ -473,15 +472,14 @@ function $fc36f9a046a9ce79$export$a8d0d0c8d1c5df64(a, b) {
473
472
  * governing permissions and limitations under the License.
474
473
  */
475
474
 
476
-
477
475
  class $364191b3decf3697$var$RollingAverage {
478
476
  addSample(sample) {
479
477
  this.count++;
480
478
  this.value += (sample - this.value) / this.count;
481
479
  }
482
480
  constructor(){
483
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "count", 0);
484
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "value", 0);
481
+ this.count = 0;
482
+ this.value = 0;
485
483
  }
486
484
  }
487
485
  class $364191b3decf3697$export$4455ee6afb38dcbb {
@@ -503,8 +501,8 @@ class $364191b3decf3697$export$4455ee6afb38dcbb {
503
501
  this.overscanY.addSample(o);
504
502
  }
505
503
  if (this.visibleRect.width > 0) {
506
- let o1 = Math.abs(this.velocity.x * (this.averageTime.value + this.averagePerf.value));
507
- this.overscanX.addSample(o1);
504
+ let o = Math.abs(this.velocity.x * (this.averageTime.value + this.averagePerf.value));
505
+ this.overscanX.addSample(o);
508
506
  }
509
507
  }
510
508
  getOverscannedRect() {
@@ -528,13 +526,13 @@ class $364191b3decf3697$export$4455ee6afb38dcbb {
528
526
  return overscanned;
529
527
  }
530
528
  constructor(){
531
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "startTime", 0);
532
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "averagePerf", new $364191b3decf3697$var$RollingAverage());
533
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "averageTime", new $364191b3decf3697$var$RollingAverage());
534
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "velocity", new (0, $3041db3296945e6e$export$baf26146a414f24a)(5, 5));
535
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "overscanX", new $364191b3decf3697$var$RollingAverage());
536
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "overscanY", new $364191b3decf3697$var$RollingAverage());
537
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "visibleRect", new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)());
529
+ this.startTime = 0;
530
+ this.averagePerf = new $364191b3decf3697$var$RollingAverage();
531
+ this.averageTime = new $364191b3decf3697$var$RollingAverage();
532
+ this.velocity = new (0, $3041db3296945e6e$export$baf26146a414f24a)(5, 5);
533
+ this.overscanX = new $364191b3decf3697$var$RollingAverage();
534
+ this.overscanY = new $364191b3decf3697$var$RollingAverage();
535
+ this.visibleRect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)();
538
536
  }
539
537
  }
540
538
 
@@ -553,18 +551,17 @@ class $364191b3decf3697$export$4455ee6afb38dcbb {
553
551
  * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
554
552
  * OF ANY KIND, either express or implied. See the License for the specific language
555
553
  * governing permissions and limitations under the License.
556
- */
557
- class $8e135e531d8dcb66$export$febc5573c75cefb0 {
554
+ */ class $8e135e531d8dcb66$export$febc5573c75cefb0 {
558
555
  constructor(){
559
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "level", 0);
560
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "actions", []);
561
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "animated", true);
562
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "initialMap", new Map());
563
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "finalMap", new Map());
564
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "initialLayoutInfo", new Map());
565
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "finalLayoutInfo", new Map());
566
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "removed", new Map());
567
- (0, $8D3nr$swchelperssrc_define_propertymjs)(this, "toRemove", new Map());
556
+ this.level = 0;
557
+ this.actions = [];
558
+ this.animated = true;
559
+ this.initialMap = new Map();
560
+ this.finalMap = new Map();
561
+ this.initialLayoutInfo = new Map();
562
+ this.finalLayoutInfo = new Map();
563
+ this.removed = new Map();
564
+ this.toRemove = new Map();
568
565
  }
569
566
  }
570
567
 
@@ -888,10 +885,10 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
888
885
  let layoutInfo = this.layout.getLayoutInfo(key);
889
886
  let corner = layoutInfo.rect.getCornerInRect(visibleRect);
890
887
  if (corner) {
891
- let key1 = layoutInfo.key;
888
+ let key = layoutInfo.key;
892
889
  let offset = layoutInfo.rect[corner].y - visibleRect.y;
893
890
  return {
894
- key: key1,
891
+ key: key,
895
892
  layoutInfo: layoutInfo,
896
893
  corner: corner,
897
894
  offset: offset
@@ -903,17 +900,17 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
903
900
  if (visibleRect.y === 0 && !this.anchorScrollPositionAtTop) return null;
904
901
  // Find a view with a visible corner that has the smallest distance to the top of the collection view
905
902
  let cornerAnchor = null;
906
- for (let [key2, view] of this._visibleViews){
907
- let layoutInfo1 = view.layoutInfo;
908
- if (layoutInfo1 && layoutInfo1.rect.area > 0) {
909
- let corner1 = layoutInfo1.rect.getCornerInRect(visibleRect);
910
- if (corner1) {
911
- let offset1 = layoutInfo1.rect[corner1].y - visibleRect.y;
912
- if (!cornerAnchor || offset1 < cornerAnchor.offset) cornerAnchor = {
913
- key: key2,
914
- layoutInfo: layoutInfo1,
915
- corner: corner1,
916
- offset: offset1
903
+ for (let [key, view] of this._visibleViews){
904
+ let layoutInfo = view.layoutInfo;
905
+ if (layoutInfo && layoutInfo.rect.area > 0) {
906
+ let corner = layoutInfo.rect.getCornerInRect(visibleRect);
907
+ if (corner) {
908
+ let offset = layoutInfo.rect[corner].y - visibleRect.y;
909
+ if (!cornerAnchor || offset < cornerAnchor.offset) cornerAnchor = {
910
+ key: key,
911
+ layoutInfo: layoutInfo,
912
+ corner: corner,
913
+ offset: offset
917
914
  };
918
915
  }
919
916
  }
@@ -990,47 +987,47 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
990
987
  // the DOM immediately, since we may reuse and need to re-insert
991
988
  // them back into the DOM anyway.
992
989
  let removed = new Set();
993
- for (let key1 of toRemove.keys()){
994
- let view1 = this._visibleViews.get(key1);
995
- if (view1) {
996
- removed.add(view1);
997
- this._visibleViews.delete(key1);
990
+ for (let key of toRemove.keys()){
991
+ let view = this._visibleViews.get(key);
992
+ if (view) {
993
+ removed.add(view);
994
+ this._visibleViews.delete(key);
998
995
  // If we are in the middle of a transaction, wait until the end
999
996
  // of the animations to remove the views from the DOM. Also means
1000
997
  // we can't reuse those views immediately.
1001
- if (this._transaction) this._transaction.toRemove.set(key1, view1);
1002
- else this.reuseView(view1);
998
+ if (this._transaction) this._transaction.toRemove.set(key, view);
999
+ else this.reuseView(view);
1003
1000
  }
1004
1001
  }
1005
- for (let key2 of toAdd.keys()){
1006
- let layoutInfo = visibleLayoutInfos.get(key2);
1007
- let view2;
1002
+ for (let key of toAdd.keys()){
1003
+ let layoutInfo = visibleLayoutInfos.get(key);
1004
+ let view;
1008
1005
  // If we're in a transaction, and a layout change happens
1009
1006
  // during the animations such that a view that was going
1010
1007
  // to be removed is now not, we don't create a new view
1011
1008
  // since the old one is still in the DOM, marked as toRemove.
1012
1009
  if (this._transaction) {
1013
1010
  // if transaction, get initial layout attributes for the animation
1014
- if (this._transaction.initialLayoutInfo.has(key2)) layoutInfo = this._transaction.initialLayoutInfo.get(key2);
1015
- view2 = this._transaction.toRemove.get(key2);
1016
- if (view2) {
1017
- this._transaction.toRemove.delete(key2);
1018
- this._applyLayoutInfo(view2, layoutInfo);
1011
+ if (this._transaction.initialLayoutInfo.has(key)) layoutInfo = this._transaction.initialLayoutInfo.get(key);
1012
+ view = this._transaction.toRemove.get(key);
1013
+ if (view) {
1014
+ this._transaction.toRemove.delete(key);
1015
+ this._applyLayoutInfo(view, layoutInfo);
1019
1016
  }
1020
1017
  }
1021
- if (!view2) {
1018
+ if (!view) {
1022
1019
  // Create or reuse a view for this row
1023
- view2 = this.getReusableView(layoutInfo);
1020
+ view = this.getReusableView(layoutInfo);
1024
1021
  // Add the view to the DOM if needed
1025
- if (!removed.has(view2)) this._children.add(view2);
1022
+ if (!removed.has(view)) this._children.add(view);
1026
1023
  }
1027
- this._visibleViews.set(key2, view2);
1028
- removed.delete(view2);
1024
+ this._visibleViews.set(key, view);
1025
+ removed.delete(view);
1029
1026
  }
1030
- for (let key3 of toUpdate){
1031
- let view3 = currentlyVisible.get(key3);
1032
- this._renderedContent.delete(key3);
1033
- this._renderView(view3);
1027
+ for (let key of toUpdate){
1028
+ let view = currentlyVisible.get(key);
1029
+ this._renderedContent.delete(key);
1030
+ this._renderView(view);
1034
1031
  }
1035
1032
  // Remove the remaining rows to delete from the DOM
1036
1033
  if (!this._transaction) this.removeViews(removed);
@@ -1090,18 +1087,18 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
1090
1087
  }
1091
1088
  // Apply final layout infos for views that will be removed
1092
1089
  if (this._transaction) {
1093
- for (let view1 of this._transaction.toRemove.values()){
1094
- let cur1 = view1.layoutInfo;
1095
- if ((cur1 === null || cur1 === void 0 ? void 0 : cur1.key) != null) {
1096
- let layoutInfo1 = this.layout.getLayoutInfo(cur1.key);
1097
- if (this._applyLayoutInfo(view1, layoutInfo1)) updated = true;
1090
+ for (let view of this._transaction.toRemove.values()){
1091
+ let cur = view.layoutInfo;
1092
+ if ((cur === null || cur === void 0 ? void 0 : cur.key) != null) {
1093
+ let layoutInfo = this.layout.getLayoutInfo(cur.key);
1094
+ if (this._applyLayoutInfo(view, layoutInfo)) updated = true;
1098
1095
  }
1099
1096
  }
1100
- for (let view2 of this._transaction.removed.values()){
1101
- let cur2 = view2.layoutInfo;
1102
- let layoutInfo2 = this._transaction.finalLayoutInfo.get(cur2.key) || cur2;
1103
- layoutInfo2 = this.layout.getFinalLayoutInfo(layoutInfo2.copy());
1104
- if (this._applyLayoutInfo(view2, layoutInfo2)) updated = true;
1097
+ for (let view of this._transaction.removed.values()){
1098
+ let cur = view.layoutInfo;
1099
+ let layoutInfo = this._transaction.finalLayoutInfo.get(cur.key) || cur;
1100
+ layoutInfo = this.layout.getFinalLayoutInfo(layoutInfo.copy());
1101
+ if (this._applyLayoutInfo(view, layoutInfo)) updated = true;
1105
1102
  }
1106
1103
  }
1107
1104
  if (updated) this._flushVisibleViews();
@@ -1291,17 +1288,17 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
1291
1288
  // in Layout#getFinalLayoutInfo during animations.
1292
1289
  transaction.finalLayoutInfo.set(layoutInfo.key, layoutInfo);
1293
1290
  // Get initial layout infos for views that were added
1294
- for (let [key1, layoutInfo1] of finalMap)if (!initialMap.has(key1)) {
1295
- let initialLayoutInfo = this.layout.getInitialLayoutInfo(layoutInfo1.copy());
1296
- transaction.initialLayoutInfo.set(key1, initialLayoutInfo);
1291
+ for (let [key, layoutInfo] of finalMap)if (!initialMap.has(key)) {
1292
+ let initialLayoutInfo = this.layout.getInitialLayoutInfo(layoutInfo.copy());
1293
+ transaction.initialLayoutInfo.set(key, initialLayoutInfo);
1297
1294
  }
1298
1295
  // Figure out which views were removed.
1299
- for (let [key2, view] of this._visibleViews)// If an item has a width of 0, there is no need to remove it from the _visibleViews.
1296
+ for (let [key, view] of this._visibleViews)// If an item has a width of 0, there is no need to remove it from the _visibleViews.
1300
1297
  // Removing an item with width of 0 can cause a loop where the item gets added, removed,
1301
1298
  // added, removed... etc in a loop.
1302
- if (!finalMap.has(key2) && view.layoutInfo.rect.width > 0) {
1303
- transaction.removed.set(key2, view);
1304
- this._visibleViews.delete(key2);
1299
+ if (!finalMap.has(key) && view.layoutInfo.rect.width > 0) {
1300
+ transaction.removed.set(key, view);
1301
+ this._visibleViews.delete(key);
1305
1302
  // In case something weird happened, where we have a view but no
1306
1303
  // initial layout info, use the one attached to the view.
1307
1304
  if (view.layoutInfo) {
package/dist/main.js CHANGED
@@ -1,13 +1,9 @@
1
1
  var $aEpNF$react = require("react");
2
2
  var $aEpNF$reactariautils = require("@react-aria/utils");
3
- var $aEpNF$swchelperslib_define_propertyjs = require("@swc/helpers/lib/_define_property.js");
4
3
 
5
4
  function $parcel$export(e, n, v, s) {
6
5
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
6
  }
8
- function $parcel$interopDefault(a) {
9
- return a && a.__esModule ? a.default : a;
10
- }
11
7
 
12
8
  $parcel$export(module.exports, "Layout", () => $ac14d65a0ec196dd$export$c84671f46d6a1ca);
13
9
  $parcel$export(module.exports, "LayoutInfo", () => $8a899922c0a55745$export$7e0eeb9da702a085);
@@ -487,15 +483,14 @@ function $abed55ea619a7a17$export$a8d0d0c8d1c5df64(a, b) {
487
483
  * governing permissions and limitations under the License.
488
484
  */
489
485
 
490
-
491
486
  class $191a033606d4fda1$var$RollingAverage {
492
487
  addSample(sample) {
493
488
  this.count++;
494
489
  this.value += (sample - this.value) / this.count;
495
490
  }
496
491
  constructor(){
497
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "count", 0);
498
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "value", 0);
492
+ this.count = 0;
493
+ this.value = 0;
499
494
  }
500
495
  }
501
496
  class $191a033606d4fda1$export$4455ee6afb38dcbb {
@@ -517,8 +512,8 @@ class $191a033606d4fda1$export$4455ee6afb38dcbb {
517
512
  this.overscanY.addSample(o);
518
513
  }
519
514
  if (this.visibleRect.width > 0) {
520
- let o1 = Math.abs(this.velocity.x * (this.averageTime.value + this.averagePerf.value));
521
- this.overscanX.addSample(o1);
515
+ let o = Math.abs(this.velocity.x * (this.averageTime.value + this.averagePerf.value));
516
+ this.overscanX.addSample(o);
522
517
  }
523
518
  }
524
519
  getOverscannedRect() {
@@ -542,13 +537,13 @@ class $191a033606d4fda1$export$4455ee6afb38dcbb {
542
537
  return overscanned;
543
538
  }
544
539
  constructor(){
545
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "startTime", 0);
546
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "averagePerf", new $191a033606d4fda1$var$RollingAverage());
547
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "averageTime", new $191a033606d4fda1$var$RollingAverage());
548
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "velocity", new (0, $f89f15d7f52bce29$export$baf26146a414f24a)(5, 5));
549
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "overscanX", new $191a033606d4fda1$var$RollingAverage());
550
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "overscanY", new $191a033606d4fda1$var$RollingAverage());
551
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "visibleRect", new (0, $41b7691783731623$export$c79fc6492f3af13d)());
540
+ this.startTime = 0;
541
+ this.averagePerf = new $191a033606d4fda1$var$RollingAverage();
542
+ this.averageTime = new $191a033606d4fda1$var$RollingAverage();
543
+ this.velocity = new (0, $f89f15d7f52bce29$export$baf26146a414f24a)(5, 5);
544
+ this.overscanX = new $191a033606d4fda1$var$RollingAverage();
545
+ this.overscanY = new $191a033606d4fda1$var$RollingAverage();
546
+ this.visibleRect = new (0, $41b7691783731623$export$c79fc6492f3af13d)();
552
547
  }
553
548
  }
554
549
 
@@ -567,18 +562,17 @@ class $191a033606d4fda1$export$4455ee6afb38dcbb {
567
562
  * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
568
563
  * OF ANY KIND, either express or implied. See the License for the specific language
569
564
  * governing permissions and limitations under the License.
570
- */
571
- class $d288159e8347722a$export$febc5573c75cefb0 {
565
+ */ class $d288159e8347722a$export$febc5573c75cefb0 {
572
566
  constructor(){
573
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "level", 0);
574
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "actions", []);
575
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "animated", true);
576
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "initialMap", new Map());
577
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "finalMap", new Map());
578
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "initialLayoutInfo", new Map());
579
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "finalLayoutInfo", new Map());
580
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "removed", new Map());
581
- (0, ($parcel$interopDefault($aEpNF$swchelperslib_define_propertyjs)))(this, "toRemove", new Map());
567
+ this.level = 0;
568
+ this.actions = [];
569
+ this.animated = true;
570
+ this.initialMap = new Map();
571
+ this.finalMap = new Map();
572
+ this.initialLayoutInfo = new Map();
573
+ this.finalLayoutInfo = new Map();
574
+ this.removed = new Map();
575
+ this.toRemove = new Map();
582
576
  }
583
577
  }
584
578
 
@@ -902,10 +896,10 @@ class $e1bc15d49d21df0e$export$89be5a243e59c4b2 {
902
896
  let layoutInfo = this.layout.getLayoutInfo(key);
903
897
  let corner = layoutInfo.rect.getCornerInRect(visibleRect);
904
898
  if (corner) {
905
- let key1 = layoutInfo.key;
899
+ let key = layoutInfo.key;
906
900
  let offset = layoutInfo.rect[corner].y - visibleRect.y;
907
901
  return {
908
- key: key1,
902
+ key: key,
909
903
  layoutInfo: layoutInfo,
910
904
  corner: corner,
911
905
  offset: offset
@@ -917,17 +911,17 @@ class $e1bc15d49d21df0e$export$89be5a243e59c4b2 {
917
911
  if (visibleRect.y === 0 && !this.anchorScrollPositionAtTop) return null;
918
912
  // Find a view with a visible corner that has the smallest distance to the top of the collection view
919
913
  let cornerAnchor = null;
920
- for (let [key2, view] of this._visibleViews){
921
- let layoutInfo1 = view.layoutInfo;
922
- if (layoutInfo1 && layoutInfo1.rect.area > 0) {
923
- let corner1 = layoutInfo1.rect.getCornerInRect(visibleRect);
924
- if (corner1) {
925
- let offset1 = layoutInfo1.rect[corner1].y - visibleRect.y;
926
- if (!cornerAnchor || offset1 < cornerAnchor.offset) cornerAnchor = {
927
- key: key2,
928
- layoutInfo: layoutInfo1,
929
- corner: corner1,
930
- offset: offset1
914
+ for (let [key, view] of this._visibleViews){
915
+ let layoutInfo = view.layoutInfo;
916
+ if (layoutInfo && layoutInfo.rect.area > 0) {
917
+ let corner = layoutInfo.rect.getCornerInRect(visibleRect);
918
+ if (corner) {
919
+ let offset = layoutInfo.rect[corner].y - visibleRect.y;
920
+ if (!cornerAnchor || offset < cornerAnchor.offset) cornerAnchor = {
921
+ key: key,
922
+ layoutInfo: layoutInfo,
923
+ corner: corner,
924
+ offset: offset
931
925
  };
932
926
  }
933
927
  }
@@ -1004,47 +998,47 @@ class $e1bc15d49d21df0e$export$89be5a243e59c4b2 {
1004
998
  // the DOM immediately, since we may reuse and need to re-insert
1005
999
  // them back into the DOM anyway.
1006
1000
  let removed = new Set();
1007
- for (let key1 of toRemove.keys()){
1008
- let view1 = this._visibleViews.get(key1);
1009
- if (view1) {
1010
- removed.add(view1);
1011
- this._visibleViews.delete(key1);
1001
+ for (let key of toRemove.keys()){
1002
+ let view = this._visibleViews.get(key);
1003
+ if (view) {
1004
+ removed.add(view);
1005
+ this._visibleViews.delete(key);
1012
1006
  // If we are in the middle of a transaction, wait until the end
1013
1007
  // of the animations to remove the views from the DOM. Also means
1014
1008
  // we can't reuse those views immediately.
1015
- if (this._transaction) this._transaction.toRemove.set(key1, view1);
1016
- else this.reuseView(view1);
1009
+ if (this._transaction) this._transaction.toRemove.set(key, view);
1010
+ else this.reuseView(view);
1017
1011
  }
1018
1012
  }
1019
- for (let key2 of toAdd.keys()){
1020
- let layoutInfo = visibleLayoutInfos.get(key2);
1021
- let view2;
1013
+ for (let key of toAdd.keys()){
1014
+ let layoutInfo = visibleLayoutInfos.get(key);
1015
+ let view;
1022
1016
  // If we're in a transaction, and a layout change happens
1023
1017
  // during the animations such that a view that was going
1024
1018
  // to be removed is now not, we don't create a new view
1025
1019
  // since the old one is still in the DOM, marked as toRemove.
1026
1020
  if (this._transaction) {
1027
1021
  // if transaction, get initial layout attributes for the animation
1028
- if (this._transaction.initialLayoutInfo.has(key2)) layoutInfo = this._transaction.initialLayoutInfo.get(key2);
1029
- view2 = this._transaction.toRemove.get(key2);
1030
- if (view2) {
1031
- this._transaction.toRemove.delete(key2);
1032
- this._applyLayoutInfo(view2, layoutInfo);
1022
+ if (this._transaction.initialLayoutInfo.has(key)) layoutInfo = this._transaction.initialLayoutInfo.get(key);
1023
+ view = this._transaction.toRemove.get(key);
1024
+ if (view) {
1025
+ this._transaction.toRemove.delete(key);
1026
+ this._applyLayoutInfo(view, layoutInfo);
1033
1027
  }
1034
1028
  }
1035
- if (!view2) {
1029
+ if (!view) {
1036
1030
  // Create or reuse a view for this row
1037
- view2 = this.getReusableView(layoutInfo);
1031
+ view = this.getReusableView(layoutInfo);
1038
1032
  // Add the view to the DOM if needed
1039
- if (!removed.has(view2)) this._children.add(view2);
1033
+ if (!removed.has(view)) this._children.add(view);
1040
1034
  }
1041
- this._visibleViews.set(key2, view2);
1042
- removed.delete(view2);
1035
+ this._visibleViews.set(key, view);
1036
+ removed.delete(view);
1043
1037
  }
1044
- for (let key3 of toUpdate){
1045
- let view3 = currentlyVisible.get(key3);
1046
- this._renderedContent.delete(key3);
1047
- this._renderView(view3);
1038
+ for (let key of toUpdate){
1039
+ let view = currentlyVisible.get(key);
1040
+ this._renderedContent.delete(key);
1041
+ this._renderView(view);
1048
1042
  }
1049
1043
  // Remove the remaining rows to delete from the DOM
1050
1044
  if (!this._transaction) this.removeViews(removed);
@@ -1104,18 +1098,18 @@ class $e1bc15d49d21df0e$export$89be5a243e59c4b2 {
1104
1098
  }
1105
1099
  // Apply final layout infos for views that will be removed
1106
1100
  if (this._transaction) {
1107
- for (let view1 of this._transaction.toRemove.values()){
1108
- let cur1 = view1.layoutInfo;
1109
- if ((cur1 === null || cur1 === void 0 ? void 0 : cur1.key) != null) {
1110
- let layoutInfo1 = this.layout.getLayoutInfo(cur1.key);
1111
- if (this._applyLayoutInfo(view1, layoutInfo1)) updated = true;
1101
+ for (let view of this._transaction.toRemove.values()){
1102
+ let cur = view.layoutInfo;
1103
+ if ((cur === null || cur === void 0 ? void 0 : cur.key) != null) {
1104
+ let layoutInfo = this.layout.getLayoutInfo(cur.key);
1105
+ if (this._applyLayoutInfo(view, layoutInfo)) updated = true;
1112
1106
  }
1113
1107
  }
1114
- for (let view2 of this._transaction.removed.values()){
1115
- let cur2 = view2.layoutInfo;
1116
- let layoutInfo2 = this._transaction.finalLayoutInfo.get(cur2.key) || cur2;
1117
- layoutInfo2 = this.layout.getFinalLayoutInfo(layoutInfo2.copy());
1118
- if (this._applyLayoutInfo(view2, layoutInfo2)) updated = true;
1108
+ for (let view of this._transaction.removed.values()){
1109
+ let cur = view.layoutInfo;
1110
+ let layoutInfo = this._transaction.finalLayoutInfo.get(cur.key) || cur;
1111
+ layoutInfo = this.layout.getFinalLayoutInfo(layoutInfo.copy());
1112
+ if (this._applyLayoutInfo(view, layoutInfo)) updated = true;
1119
1113
  }
1120
1114
  }
1121
1115
  if (updated) this._flushVisibleViews();
@@ -1305,17 +1299,17 @@ class $e1bc15d49d21df0e$export$89be5a243e59c4b2 {
1305
1299
  // in Layout#getFinalLayoutInfo during animations.
1306
1300
  transaction.finalLayoutInfo.set(layoutInfo.key, layoutInfo);
1307
1301
  // Get initial layout infos for views that were added
1308
- for (let [key1, layoutInfo1] of finalMap)if (!initialMap.has(key1)) {
1309
- let initialLayoutInfo = this.layout.getInitialLayoutInfo(layoutInfo1.copy());
1310
- transaction.initialLayoutInfo.set(key1, initialLayoutInfo);
1302
+ for (let [key, layoutInfo] of finalMap)if (!initialMap.has(key)) {
1303
+ let initialLayoutInfo = this.layout.getInitialLayoutInfo(layoutInfo.copy());
1304
+ transaction.initialLayoutInfo.set(key, initialLayoutInfo);
1311
1305
  }
1312
1306
  // Figure out which views were removed.
1313
- for (let [key2, view] of this._visibleViews)// If an item has a width of 0, there is no need to remove it from the _visibleViews.
1307
+ for (let [key, view] of this._visibleViews)// If an item has a width of 0, there is no need to remove it from the _visibleViews.
1314
1308
  // Removing an item with width of 0 can cause a loop where the item gets added, removed,
1315
1309
  // added, removed... etc in a loop.
1316
- if (!finalMap.has(key2) && view.layoutInfo.rect.width > 0) {
1317
- transaction.removed.set(key2, view);
1318
- this._visibleViews.delete(key2);
1310
+ if (!finalMap.has(key) && view.layoutInfo.rect.width > 0) {
1311
+ transaction.removed.set(key, view);
1312
+ this._visibleViews.delete(key);
1319
1313
  // In case something weird happened, where we have a view but no
1320
1314
  // initial layout info, use the one attached to the view.
1321
1315
  if (view.layoutInfo) {