@legendapp/list 1.0.0-beta.33 → 1.0.0-beta.34
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.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.js +10 -4
- package/index.mjs +11 -5
- package/package.json +1 -1
package/index.d.mts
CHANGED
|
@@ -474,9 +474,9 @@ declare const LegendList: <T>(props: Omit<react_native.ScrollViewProps, "content
|
|
|
474
474
|
keyExtractor?: ((item: T, index: number) => string) | undefined;
|
|
475
475
|
ListEmptyComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
|
|
476
476
|
ListFooterComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
|
|
477
|
-
ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
|
|
477
|
+
ListFooterComponentStyle?: react_native.StyleProp<ViewStyle> | undefined;
|
|
478
478
|
ListHeaderComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
|
|
479
|
-
ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
|
|
479
|
+
ListHeaderComponentStyle?: react_native.StyleProp<ViewStyle> | undefined;
|
|
480
480
|
maintainScrollAtEnd?: boolean;
|
|
481
481
|
maintainScrollAtEndThreshold?: number;
|
|
482
482
|
maintainVisibleContentPosition?: boolean;
|
package/index.d.ts
CHANGED
|
@@ -474,9 +474,9 @@ declare const LegendList: <T>(props: Omit<react_native.ScrollViewProps, "content
|
|
|
474
474
|
keyExtractor?: ((item: T, index: number) => string) | undefined;
|
|
475
475
|
ListEmptyComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
|
|
476
476
|
ListFooterComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
|
|
477
|
-
ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
|
|
477
|
+
ListFooterComponentStyle?: react_native.StyleProp<ViewStyle> | undefined;
|
|
478
478
|
ListHeaderComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
|
|
479
|
-
ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
|
|
479
|
+
ListHeaderComponentStyle?: react_native.StyleProp<ViewStyle> | undefined;
|
|
480
480
|
maintainScrollAtEnd?: boolean;
|
|
481
481
|
maintainScrollAtEndThreshold?: number;
|
|
482
482
|
maintainVisibleContentPosition?: boolean;
|
package/index.js
CHANGED
|
@@ -261,7 +261,7 @@ var Container = ({
|
|
|
261
261
|
const otherAxisPos = numColumns > 1 ? `${(column - 1) / numColumns * 100}%` : 0;
|
|
262
262
|
const otherAxisSize = numColumns > 1 ? `${1 / numColumns * 100}%` : void 0;
|
|
263
263
|
let verticalPaddingStyles;
|
|
264
|
-
if (columnWrapperStyle
|
|
264
|
+
if (columnWrapperStyle) {
|
|
265
265
|
const { columnGap, rowGap, gap } = columnWrapperStyle;
|
|
266
266
|
verticalPaddingStyles = {
|
|
267
267
|
paddingBottom: !lastItemKeys.includes(itemKey) ? rowGap || gap || void 0 : void 0,
|
|
@@ -781,8 +781,11 @@ function maybeUpdateViewabilityCallback(ctx, configId, viewToken) {
|
|
|
781
781
|
var DEFAULT_DRAW_DISTANCE = 250;
|
|
782
782
|
var DEFAULT_ITEM_SIZE = 100;
|
|
783
783
|
function createColumnWrapperStyle(contentContainerStyle) {
|
|
784
|
-
const { gap, columnGap, rowGap } =
|
|
784
|
+
const { gap, columnGap, rowGap } = contentContainerStyle;
|
|
785
785
|
if (gap || columnGap || rowGap) {
|
|
786
|
+
contentContainerStyle.gap = void 0;
|
|
787
|
+
contentContainerStyle.columnGap = void 0;
|
|
788
|
+
contentContainerStyle.rowGap = void 0;
|
|
786
789
|
return {
|
|
787
790
|
gap,
|
|
788
791
|
columnGap,
|
|
@@ -822,6 +825,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
822
825
|
refScrollView,
|
|
823
826
|
waitForInitialLayout = true,
|
|
824
827
|
extraData,
|
|
828
|
+
contentContainerStyle: contentContainerStyleProp,
|
|
825
829
|
onLayout: onLayoutProp,
|
|
826
830
|
onRefresh,
|
|
827
831
|
refreshing,
|
|
@@ -833,13 +837,14 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
833
837
|
onViewableItemsChanged,
|
|
834
838
|
...rest
|
|
835
839
|
} = props;
|
|
836
|
-
const { style
|
|
840
|
+
const { style } = props;
|
|
837
841
|
const callbacks = React6.useRef({
|
|
838
842
|
onStartReached: rest.onStartReached,
|
|
839
843
|
onEndReached: rest.onEndReached
|
|
840
844
|
});
|
|
841
845
|
callbacks.current.onStartReached = rest.onStartReached;
|
|
842
846
|
callbacks.current.onEndReached = rest.onEndReached;
|
|
847
|
+
const contentContainerStyle = reactNative.StyleSheet.flatten(contentContainerStyleProp);
|
|
843
848
|
const ctx = useStateContext();
|
|
844
849
|
ctx.columnWrapperStyle = columnWrapperStyle || (contentContainerStyle ? createColumnWrapperStyle(contentContainerStyle) : void 0);
|
|
845
850
|
const refScroller = React6.useRef(null);
|
|
@@ -1993,7 +1998,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1993
1998
|
progressViewOffset
|
|
1994
1999
|
}
|
|
1995
2000
|
),
|
|
1996
|
-
style
|
|
2001
|
+
style,
|
|
2002
|
+
contentContainerStyle
|
|
1997
2003
|
}
|
|
1998
2004
|
), __DEV__ && ENABLE_DEBUG_VIEW && /* @__PURE__ */ React6__namespace.createElement(DebugView, { state: refState.current }));
|
|
1999
2005
|
});
|
package/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React6 from 'react';
|
|
2
2
|
import React6__default, { createContext, memo, useReducer, useEffect, useMemo, useRef, useCallback, useImperativeHandle, useSyncExternalStore, useContext, useState, forwardRef, useLayoutEffect } from 'react';
|
|
3
|
-
import { View, Text, Platform, Animated, ScrollView,
|
|
3
|
+
import { View, Text, Platform, Animated, ScrollView, StyleSheet, Dimensions, RefreshControl } from 'react-native';
|
|
4
4
|
|
|
5
5
|
// src/LegendList.tsx
|
|
6
6
|
var ContextState = React6.createContext(null);
|
|
@@ -240,7 +240,7 @@ var Container = ({
|
|
|
240
240
|
const otherAxisPos = numColumns > 1 ? `${(column - 1) / numColumns * 100}%` : 0;
|
|
241
241
|
const otherAxisSize = numColumns > 1 ? `${1 / numColumns * 100}%` : void 0;
|
|
242
242
|
let verticalPaddingStyles;
|
|
243
|
-
if (columnWrapperStyle
|
|
243
|
+
if (columnWrapperStyle) {
|
|
244
244
|
const { columnGap, rowGap, gap } = columnWrapperStyle;
|
|
245
245
|
verticalPaddingStyles = {
|
|
246
246
|
paddingBottom: !lastItemKeys.includes(itemKey) ? rowGap || gap || void 0 : void 0,
|
|
@@ -760,8 +760,11 @@ function maybeUpdateViewabilityCallback(ctx, configId, viewToken) {
|
|
|
760
760
|
var DEFAULT_DRAW_DISTANCE = 250;
|
|
761
761
|
var DEFAULT_ITEM_SIZE = 100;
|
|
762
762
|
function createColumnWrapperStyle(contentContainerStyle) {
|
|
763
|
-
const { gap, columnGap, rowGap } =
|
|
763
|
+
const { gap, columnGap, rowGap } = contentContainerStyle;
|
|
764
764
|
if (gap || columnGap || rowGap) {
|
|
765
|
+
contentContainerStyle.gap = void 0;
|
|
766
|
+
contentContainerStyle.columnGap = void 0;
|
|
767
|
+
contentContainerStyle.rowGap = void 0;
|
|
765
768
|
return {
|
|
766
769
|
gap,
|
|
767
770
|
columnGap,
|
|
@@ -801,6 +804,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
801
804
|
refScrollView,
|
|
802
805
|
waitForInitialLayout = true,
|
|
803
806
|
extraData,
|
|
807
|
+
contentContainerStyle: contentContainerStyleProp,
|
|
804
808
|
onLayout: onLayoutProp,
|
|
805
809
|
onRefresh,
|
|
806
810
|
refreshing,
|
|
@@ -812,13 +816,14 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
812
816
|
onViewableItemsChanged,
|
|
813
817
|
...rest
|
|
814
818
|
} = props;
|
|
815
|
-
const { style
|
|
819
|
+
const { style } = props;
|
|
816
820
|
const callbacks = useRef({
|
|
817
821
|
onStartReached: rest.onStartReached,
|
|
818
822
|
onEndReached: rest.onEndReached
|
|
819
823
|
});
|
|
820
824
|
callbacks.current.onStartReached = rest.onStartReached;
|
|
821
825
|
callbacks.current.onEndReached = rest.onEndReached;
|
|
826
|
+
const contentContainerStyle = StyleSheet.flatten(contentContainerStyleProp);
|
|
822
827
|
const ctx = useStateContext();
|
|
823
828
|
ctx.columnWrapperStyle = columnWrapperStyle || (contentContainerStyle ? createColumnWrapperStyle(contentContainerStyle) : void 0);
|
|
824
829
|
const refScroller = useRef(null);
|
|
@@ -1972,7 +1977,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1972
1977
|
progressViewOffset
|
|
1973
1978
|
}
|
|
1974
1979
|
),
|
|
1975
|
-
style
|
|
1980
|
+
style,
|
|
1981
|
+
contentContainerStyle
|
|
1976
1982
|
}
|
|
1977
1983
|
), __DEV__ && ENABLE_DEBUG_VIEW && /* @__PURE__ */ React6.createElement(DebugView, { state: refState.current }));
|
|
1978
1984
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legendapp/list",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.34",
|
|
4
4
|
"description": "Legend List aims to be a drop-in replacement for FlatList with much better performance and supporting dynamically sized items.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"private": false,
|