@legendapp/list 2.0.0-next.19 → 2.0.0-next.20
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/index.js +1 -5
- package/index.mjs +1 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -995,7 +995,7 @@ function requestAdjust(ctx, state, positionDiff) {
|
|
|
995
995
|
}
|
|
996
996
|
}
|
|
997
997
|
|
|
998
|
-
// src/core/
|
|
998
|
+
// src/core/mvcp.ts
|
|
999
999
|
function getItemsInView(ctx, state) {
|
|
1000
1000
|
const { startNoBuffer, endNoBuffer, positions, scrollLength } = state;
|
|
1001
1001
|
const idsInViewWithPositions = [];
|
|
@@ -1029,13 +1029,11 @@ function prepareMVCP(ctx, state, dataChanged) {
|
|
|
1029
1029
|
if (maintainVisibleContentPosition) {
|
|
1030
1030
|
const indexByKey = state.indexByKey;
|
|
1031
1031
|
if (scrollTarget !== void 0) {
|
|
1032
|
-
console.log("scrollTarget", scrollTarget);
|
|
1033
1032
|
targetId = getId(state, scrollTarget);
|
|
1034
1033
|
} else if (peek$(ctx, "containersDidLayout")) {
|
|
1035
1034
|
idsInViewWithPositions = getItemsInView(ctx, state);
|
|
1036
1035
|
if (!dataChanged) {
|
|
1037
1036
|
targetId = (_a = idsInViewWithPositions.find(({ id }) => indexByKey.get(id) !== void 0)) == null ? void 0 : _a.id;
|
|
1038
|
-
console.log("targetId in view", targetId);
|
|
1039
1037
|
}
|
|
1040
1038
|
}
|
|
1041
1039
|
if (targetId !== void 0) {
|
|
@@ -1050,7 +1048,6 @@ function prepareMVCP(ctx, state, dataChanged) {
|
|
|
1050
1048
|
const newPosition = positions.get(id);
|
|
1051
1049
|
if (newPosition !== void 0) {
|
|
1052
1050
|
positionDiff = newPosition - position;
|
|
1053
|
-
console.log("positionDiff", positionDiff, id);
|
|
1054
1051
|
break;
|
|
1055
1052
|
}
|
|
1056
1053
|
}
|
|
@@ -1059,7 +1056,6 @@ function prepareMVCP(ctx, state, dataChanged) {
|
|
|
1059
1056
|
const newPosition = positions.get(targetId);
|
|
1060
1057
|
if (newPosition !== void 0) {
|
|
1061
1058
|
positionDiff = newPosition - prevPosition;
|
|
1062
|
-
console.log("positionDiff targetId", positionDiff, targetId);
|
|
1063
1059
|
}
|
|
1064
1060
|
}
|
|
1065
1061
|
if (positionDiff !== void 0 && Math.abs(positionDiff) > 0.1) {
|
package/index.mjs
CHANGED
|
@@ -974,7 +974,7 @@ function requestAdjust(ctx, state, positionDiff) {
|
|
|
974
974
|
}
|
|
975
975
|
}
|
|
976
976
|
|
|
977
|
-
// src/core/
|
|
977
|
+
// src/core/mvcp.ts
|
|
978
978
|
function getItemsInView(ctx, state) {
|
|
979
979
|
const { startNoBuffer, endNoBuffer, positions, scrollLength } = state;
|
|
980
980
|
const idsInViewWithPositions = [];
|
|
@@ -1008,13 +1008,11 @@ function prepareMVCP(ctx, state, dataChanged) {
|
|
|
1008
1008
|
if (maintainVisibleContentPosition) {
|
|
1009
1009
|
const indexByKey = state.indexByKey;
|
|
1010
1010
|
if (scrollTarget !== void 0) {
|
|
1011
|
-
console.log("scrollTarget", scrollTarget);
|
|
1012
1011
|
targetId = getId(state, scrollTarget);
|
|
1013
1012
|
} else if (peek$(ctx, "containersDidLayout")) {
|
|
1014
1013
|
idsInViewWithPositions = getItemsInView(ctx, state);
|
|
1015
1014
|
if (!dataChanged) {
|
|
1016
1015
|
targetId = (_a = idsInViewWithPositions.find(({ id }) => indexByKey.get(id) !== void 0)) == null ? void 0 : _a.id;
|
|
1017
|
-
console.log("targetId in view", targetId);
|
|
1018
1016
|
}
|
|
1019
1017
|
}
|
|
1020
1018
|
if (targetId !== void 0) {
|
|
@@ -1029,7 +1027,6 @@ function prepareMVCP(ctx, state, dataChanged) {
|
|
|
1029
1027
|
const newPosition = positions.get(id);
|
|
1030
1028
|
if (newPosition !== void 0) {
|
|
1031
1029
|
positionDiff = newPosition - position;
|
|
1032
|
-
console.log("positionDiff", positionDiff, id);
|
|
1033
1030
|
break;
|
|
1034
1031
|
}
|
|
1035
1032
|
}
|
|
@@ -1038,7 +1035,6 @@ function prepareMVCP(ctx, state, dataChanged) {
|
|
|
1038
1035
|
const newPosition = positions.get(targetId);
|
|
1039
1036
|
if (newPosition !== void 0) {
|
|
1040
1037
|
positionDiff = newPosition - prevPosition;
|
|
1041
|
-
console.log("positionDiff targetId", positionDiff, targetId);
|
|
1042
1038
|
}
|
|
1043
1039
|
}
|
|
1044
1040
|
if (positionDiff !== void 0 && Math.abs(positionDiff) > 0.1) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legendapp/list",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.20",
|
|
4
4
|
"description": "Legend List is a drop-in replacement for FlatList with much better performance and supporting dynamically sized items.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"private": false,
|