react-native-reorderable-list 0.12.0 → 0.13.1
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 +0 -1
- package/lib/commonjs/components/NestedReorderableList.js +2 -0
- package/lib/commonjs/components/NestedReorderableList.js.map +1 -1
- package/lib/commonjs/components/ReorderableList.js +4 -3
- package/lib/commonjs/components/ReorderableList.js.map +1 -1
- package/lib/commonjs/components/ReorderableListCell.js +2 -2
- package/lib/commonjs/components/ReorderableListCell.js.map +1 -1
- package/lib/commonjs/components/ReorderableListCore/ReorderableListCore.js +3 -3
- package/lib/commonjs/components/ReorderableListCore/ReorderableListCore.js.map +1 -1
- package/lib/commonjs/components/ReorderableListCore/useReorderableListCore.js +160 -99
- package/lib/commonjs/components/ReorderableListCore/useReorderableListCore.js.map +1 -1
- package/lib/commonjs/components/ScrollViewContainer.js +14 -3
- package/lib/commonjs/components/ScrollViewContainer.js.map +1 -1
- package/lib/commonjs/contexts/ScrollViewContainerContext.js.map +1 -1
- package/lib/module/components/NestedReorderableList.js +2 -0
- package/lib/module/components/NestedReorderableList.js.map +1 -1
- package/lib/module/components/ReorderableList.js +4 -3
- package/lib/module/components/ReorderableList.js.map +1 -1
- package/lib/module/components/ReorderableListCell.js +2 -2
- package/lib/module/components/ReorderableListCell.js.map +1 -1
- package/lib/module/components/ReorderableListCore/ReorderableListCore.js +3 -3
- package/lib/module/components/ReorderableListCore/ReorderableListCore.js.map +1 -1
- package/lib/module/components/ReorderableListCore/useReorderableListCore.js +161 -100
- package/lib/module/components/ReorderableListCore/useReorderableListCore.js.map +1 -1
- package/lib/module/components/ScrollViewContainer.js +16 -5
- package/lib/module/components/ScrollViewContainer.js.map +1 -1
- package/lib/module/contexts/ScrollViewContainerContext.js.map +1 -1
- package/lib/typescript/components/NestedReorderableList.d.ts.map +1 -1
- package/lib/typescript/components/ReorderableList.d.ts.map +1 -1
- package/lib/typescript/components/ReorderableListCore/ReorderableListCore.d.ts +1 -0
- package/lib/typescript/components/ReorderableListCore/ReorderableListCore.d.ts.map +1 -1
- package/lib/typescript/components/ReorderableListCore/useReorderableListCore.d.ts +4 -5
- package/lib/typescript/components/ReorderableListCore/useReorderableListCore.d.ts.map +1 -1
- package/lib/typescript/components/ScrollViewContainer.d.ts.map +1 -1
- package/lib/typescript/contexts/ScrollViewContainerContext.d.ts +1 -0
- package/lib/typescript/contexts/ScrollViewContainerContext.d.ts.map +1 -1
- package/lib/typescript/types/props.d.ts +0 -5
- package/lib/typescript/types/props.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/NestedReorderableList.tsx +2 -0
- package/src/components/ReorderableList.tsx +3 -2
- package/src/components/ReorderableListCell.tsx +3 -3
- package/src/components/ReorderableListCore/ReorderableListCore.tsx +4 -3
- package/src/components/ReorderableListCore/useReorderableListCore.ts +277 -184
- package/src/components/ScrollViewContainer.tsx +23 -5
- package/src/contexts/ScrollViewContainerContext.ts +1 -0
- package/src/types/props.ts +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","Gesture","GestureDetector","Animated","useAnimatedRef","useAnimatedScrollHandler","useComposedEventHandler","useSharedValue","ScrollViewContainerContext","ScrollViewContainer","onLayout","onScroll","scrollEnabled","rest","scrollViewScrollEnabled","scrollViewContainerRef","scrollViewScrollOffsetY","scrollViewHeightY","outerScrollGesture","Native","handleScroll","e","value","contentOffset","y","composedScrollHandler","contextValue","initialScrollViewScrollEnabled","handleLayout","nativeEvent","layout","height","createElement","Provider","gesture","ScrollView","_extends","ref"],"sourceRoot":"../../../src","sources":["components/ScrollViewContainer.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","Gesture","GestureDetector","Animated","measure","runOnUI","useAnimatedRef","useAnimatedScrollHandler","useComposedEventHandler","useSharedValue","ScrollViewContainerContext","ScrollViewContainer","onLayout","onScroll","scrollEnabled","rest","scrollViewScrollEnabled","scrollViewContainerRef","scrollViewScrollOffsetY","scrollViewPageY","scrollViewHeightY","outerScrollGesture","Native","handleScroll","e","value","contentOffset","y","composedScrollHandler","contextValue","initialScrollViewScrollEnabled","handleLayout","nativeEvent","layout","height","measurement","pageY","createElement","Provider","gesture","ScrollView","_extends","ref"],"sourceRoot":"../../../src","sources":["components/ScrollViewContainer.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,QAAO,OAAO;AAGjD,SAAQC,OAAO,EAAEC,eAAe,QAAO,8BAA8B;AACrE,OAAOC,QAAQ,IACbC,OAAO,EACPC,OAAO,EACPC,cAAc,EACdC,wBAAwB,EACxBC,uBAAuB,EACvBC,cAAc,QACT,yBAAyB;AAEhC,SAAQC,0BAA0B,QAAO,wCAAwC;AAGjF,OAAO,MAAMC,mBAAuD,GAAGA,CAAC;EACtEC,QAAQ;EACRC,QAAQ;EACRC,aAAa,GAAG,IAAI;EACpB,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,uBAAuB,GAAGP,cAAc,CAACK,aAAa,CAAC;EAC7D,MAAMG,sBAAsB,GAAGX,cAAc,CAAsB,CAAC;EACpE,MAAMY,uBAAuB,GAAGT,cAAc,CAAC,CAAC,CAAC;EACjD,MAAMU,eAAe,GAAGV,cAAc,CAAC,CAAC,CAAC;EACzC,MAAMW,iBAAiB,GAAGX,cAAc,CAAC,CAAC,CAAC;EAE3C,MAAMY,kBAAkB,GAAGrB,OAAO,CAAC,MAAMC,OAAO,CAACqB,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC;EAE9D,MAAMC,YAAY,GAAGhB,wBAAwB,CAC3CiB,CAAC,IAAI;IACHN,uBAAuB,CAACO,KAAK,GAAGD,CAAC,CAACE,aAAa,CAACC,CAAC;EACnD,CAAC,EACD,CAACT,uBAAuB,CAC1B,CAAC;EAED,MAAMU,qBAAqB,GAAGpB,uBAAuB,CAAC,CACpDe,YAAY,EACZV,QAAQ,IAAI,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|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ScrollViewContainerContext","createContext","undefined"],"sourceRoot":"../../../src","sources":["contexts/ScrollViewContainerContext.ts"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;
|
|
1
|
+
{"version":3,"names":["React","ScrollViewContainerContext","createContext","undefined"],"sourceRoot":"../../../src","sources":["contexts/ScrollViewContainerContext.ts"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAgBzB,OAAO,MAAMC,0BAA0B,gBAAGD,KAAK,CAACE,aAAa,CAE3DC,SAAS,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestedReorderableList.d.ts","sourceRoot":"","sources":["../../../src/components/NestedReorderableList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAKtC,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"NestedReorderableList.d.ts","sourceRoot":"","sources":["../../../src/components/NestedReorderableList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAKtC,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,UAAU,CAAC;AAkCzD,eAAO,MAAM,qBAAqB,kFAI7B,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReorderableList.d.ts","sourceRoot":"","sources":["../../../src/components/ReorderableList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAGtC,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ReorderableList.d.ts","sourceRoot":"","sources":["../../../src/components/ReorderableList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAGtC,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAqBnD,eAAO,MAAM,eAAe,4EAEvB,WAAW,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { SharedValue } from 'react-native-reanimated';
|
|
|
5
5
|
import type { ReorderableListProps } from '../../types';
|
|
6
6
|
interface ReorderableListCoreProps<T> extends ReorderableListProps<T> {
|
|
7
7
|
scrollViewContainerRef: React.RefObject<ScrollView> | undefined;
|
|
8
|
+
scrollViewPageY: SharedValue<number> | undefined;
|
|
8
9
|
scrollViewHeightY: SharedValue<number> | undefined;
|
|
9
10
|
scrollViewScrollOffsetY: SharedValue<number> | undefined;
|
|
10
11
|
scrollViewScrollEnabled: SharedValue<boolean> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReorderableListCore.d.ts","sourceRoot":"","sources":["../../../../src/components/ReorderableListCore/ReorderableListCore.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,EAEL,QAAQ,EAGR,UAAU,EACX,MAAM,cAAc,CAAC;AAEtB,OAAO,EAGL,aAAa,EACd,MAAM,8BAA8B,CAAC;AACtC,OAAiB,EACf,WAAW,EAEZ,MAAM,yBAAyB,CAAC;AAKjC,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AAStD,UAAU,wBAAwB,CAAC,CAAC,CAAE,SAAQ,oBAAoB,CAAC,CAAC,CAAC;IAEnE,sBAAsB,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;IAChE,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACnD,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACzD,uBAAuB,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;IAC1D,kBAAkB,EAAE,aAAa,GAAG,SAAS,CAAC;IAC9C,8BAA8B,EAAE,OAAO,GAAG,SAAS,CAAC;IACpD,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,aAAa,EAAE,OAAO,GAAG,SAAS,CAAC;CACpC;AA+HD,QAAA,MAAM,2BAA2B;;MAM5B,MAAM,YAAY,CAAC;AAExB,OAAO,EAAC,2BAA2B,IAAI,mBAAmB,EAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"ReorderableListCore.d.ts","sourceRoot":"","sources":["../../../../src/components/ReorderableListCore/ReorderableListCore.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,EAEL,QAAQ,EAGR,UAAU,EACX,MAAM,cAAc,CAAC;AAEtB,OAAO,EAGL,aAAa,EACd,MAAM,8BAA8B,CAAC;AACtC,OAAiB,EACf,WAAW,EAEZ,MAAM,yBAAyB,CAAC;AAKjC,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AAStD,UAAU,wBAAwB,CAAC,CAAC,CAAE,SAAQ,oBAAoB,CAAC,CAAC,CAAC;IAEnE,sBAAsB,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;IAChE,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACjD,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACnD,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACzD,uBAAuB,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;IAC1D,kBAAkB,EAAE,aAAa,GAAG,SAAS,CAAC;IAC9C,8BAA8B,EAAE,OAAO,GAAG,SAAS,CAAC;IACpD,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,aAAa,EAAE,OAAO,GAAG,SAAS,CAAC;CACpC;AA+HD,QAAA,MAAM,2BAA2B;;MAM5B,MAAM,YAAY,CAAC;AAExB,OAAO,EAAC,2BAA2B,IAAI,mBAAmB,EAAC,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FlatList, LayoutChangeEvent, ScrollView } from 'react-native';
|
|
3
3
|
import { SharedValue } from 'react-native-reanimated';
|
|
4
|
-
import { ReorderableListCellAnimations, ReorderableListDragEndEvent, ReorderableListDragStartEvent, ReorderableListIndexChangeEvent } from '../../types';
|
|
5
|
-
import type { ReorderableListReorderEvent } from '../../types';
|
|
4
|
+
import { ReorderableListCellAnimations, ReorderableListDragEndEvent, ReorderableListDragStartEvent, ReorderableListIndexChangeEvent, ReorderableListReorderEvent } from '../../types';
|
|
6
5
|
interface UseReorderableListCoreArgs<T> {
|
|
7
6
|
ref: React.ForwardedRef<FlatList<T>>;
|
|
8
7
|
autoscrollThreshold: number;
|
|
@@ -14,25 +13,25 @@ interface UseReorderableListCoreArgs<T> {
|
|
|
14
13
|
autoscrollDelay: number;
|
|
15
14
|
autoscrollActivationDelta: number;
|
|
16
15
|
animationDuration: number;
|
|
17
|
-
dragReorderThreshold: number;
|
|
18
16
|
onReorder: (event: ReorderableListReorderEvent) => void;
|
|
19
17
|
onDragStart?: (event: ReorderableListDragStartEvent) => void;
|
|
20
18
|
onDragEnd?: (event: ReorderableListDragEndEvent) => void;
|
|
21
19
|
onIndexChange?: (event: ReorderableListIndexChangeEvent) => void;
|
|
22
20
|
onLayout?: (event: LayoutChangeEvent) => void;
|
|
23
21
|
scrollViewContainerRef: React.RefObject<ScrollView> | undefined;
|
|
22
|
+
scrollViewPageY: SharedValue<number> | undefined;
|
|
24
23
|
scrollViewHeightY: SharedValue<number> | undefined;
|
|
25
24
|
scrollViewScrollOffsetY: SharedValue<number> | undefined;
|
|
26
25
|
scrollViewScrollEnabled: SharedValue<boolean> | undefined;
|
|
26
|
+
scrollable: boolean | undefined;
|
|
27
27
|
initialScrollEnabled: boolean | undefined;
|
|
28
28
|
initialScrollViewScrollEnabled: boolean | undefined;
|
|
29
|
-
nestedScrollable: boolean | undefined;
|
|
30
29
|
cellAnimations: ReorderableListCellAnimations | undefined;
|
|
31
30
|
shouldUpdateActiveItem: boolean | undefined;
|
|
32
31
|
panEnabled: boolean;
|
|
33
32
|
panActivateAfterLongPress: number | undefined;
|
|
34
33
|
}
|
|
35
|
-
export declare const useReorderableListCore: <T>({ ref, autoscrollThreshold, autoscrollThresholdOffset, autoscrollSpeedScale, autoscrollDelay, autoscrollActivationDelta, animationDuration,
|
|
34
|
+
export declare const useReorderableListCore: <T>({ ref, autoscrollThreshold, autoscrollThresholdOffset, autoscrollSpeedScale, autoscrollDelay, autoscrollActivationDelta, animationDuration, onReorder, onDragStart, onDragEnd, onLayout, onIndexChange, scrollViewContainerRef, scrollViewPageY, scrollViewHeightY, scrollViewScrollOffsetY, scrollViewScrollEnabled, scrollable, initialScrollEnabled, initialScrollViewScrollEnabled, cellAnimations, shouldUpdateActiveItem, panActivateAfterLongPress, panEnabled, }: UseReorderableListCoreArgs<T>) => {
|
|
36
35
|
gestureHandler: import("react-native-gesture-handler/lib/typescript/handlers/gestures/gestureComposition").SimultaneousGesture;
|
|
37
36
|
handleScroll: import("react-native-reanimated").ScrollHandlerProcessed<Record<string, unknown>>;
|
|
38
37
|
handleFlatListLayout: (e: LayoutChangeEvent) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReorderableListCore.d.ts","sourceRoot":"","sources":["../../../../src/components/ReorderableListCore/useReorderableListCore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,UAAU,EAEX,MAAM,cAAc,CAAC;AAQtB,OAAiB,EAGf,WAAW,
|
|
1
|
+
{"version":3,"file":"useReorderableListCore.d.ts","sourceRoot":"","sources":["../../../../src/components/ReorderableListCore/useReorderableListCore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,UAAU,EAEX,MAAM,cAAc,CAAC;AAQtB,OAAiB,EAGf,WAAW,EAYZ,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,6BAA6B,EAC7B,+BAA+B,EAC/B,2BAA2B,EAE5B,MAAM,aAAa,CAAC;AAOrB,UAAU,0BAA0B,CAAC,CAAC;IACpC,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,yBAAyB,EAAE;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,SAAS,CAAC;IACvE,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,yBAAyB,EAAE,MAAM,CAAC;IAClC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,IAAI,CAAC;IACxD,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,6BAA6B,KAAK,IAAI,CAAC;IAC7D,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,IAAI,CAAC;IACzD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,+BAA+B,KAAK,IAAI,CAAC;IACjE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9C,sBAAsB,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;IAChE,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACjD,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACnD,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACzD,uBAAuB,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;IAC1D,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,oBAAoB,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1C,8BAA8B,EAAE,OAAO,GAAG,SAAS,CAAC;IACpD,cAAc,EAAE,6BAA6B,GAAG,SAAS,CAAC;IAC1D,sBAAsB,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5C,UAAU,EAAE,OAAO,CAAC;IACpB,yBAAyB,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/C;AAED,eAAO,MAAM,sBAAsB;;;;;uBA8tBvB,MAAM;;;;;6CAvqBN,MAAM,MAAM,MAAM,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2wBtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollViewContainer.d.ts","sourceRoot":"","sources":["../../../src/components/ScrollViewContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ScrollViewContainer.d.ts","sourceRoot":"","sources":["../../../src/components/ScrollViewContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAclD,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,UAAU,CAAC;AAEvD,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA+ElE,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { NativeGesture } from 'react-native-gesture-handler';
|
|
|
4
4
|
import { SharedValue } from 'react-native-reanimated';
|
|
5
5
|
interface ScrollViewContainerContextData {
|
|
6
6
|
scrollViewContainerRef: React.RefObject<ScrollView>;
|
|
7
|
+
scrollViewPageY: SharedValue<number>;
|
|
7
8
|
scrollViewHeightY: SharedValue<number>;
|
|
8
9
|
scrollViewScrollOffsetY: SharedValue<number>;
|
|
9
10
|
scrollViewScrollEnabled: SharedValue<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollViewContainerContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/ScrollViewContainerContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAEpD,UAAU,8BAA8B;IACtC,sBAAsB,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACpD,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7C,uBAAuB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9C,kBAAkB,EAAE,aAAa,CAAC;IAClC,8BAA8B,EAAE,OAAO,CAAC;CACzC;AAED,eAAO,MAAM,0BAA0B,2DAE3B,CAAC"}
|
|
1
|
+
{"version":3,"file":"ScrollViewContainerContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/ScrollViewContainerContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAEpD,UAAU,8BAA8B;IACtC,sBAAsB,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACpD,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7C,uBAAuB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9C,kBAAkB,EAAE,aAAa,CAAC;IAClC,8BAA8B,EAAE,OAAO,CAAC;CACzC;AAED,eAAO,MAAM,0BAA0B,2DAE3B,CAAC"}
|
|
@@ -66,11 +66,6 @@ export interface ReorderableListProps<T> extends Omit<FlatListProps<T>, OmittedP
|
|
|
66
66
|
* Default: `5`.
|
|
67
67
|
*/
|
|
68
68
|
autoscrollActivationDelta?: number;
|
|
69
|
-
/**
|
|
70
|
-
* Specifies the fraction of an item's size at which it will shift when a dragged item crosses over it.
|
|
71
|
-
* For example, a value of 0.2 means the item shifts when the dragged item passes 20% of its height (vertical list). Default is `0.2`.
|
|
72
|
-
*/
|
|
73
|
-
dragReorderThreshold?: number;
|
|
74
69
|
/**
|
|
75
70
|
* Duration of the animations in milliseconds.
|
|
76
71
|
* Be aware that users won't be able to drag a new item until the dragged item is released and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/types/props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAC,WAAW,EAAE,wBAAwB,EAAC,MAAM,yBAAyB,CAAC;AAE9E,OAA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G,MAAM,CAAC;CACxC;AAED,MAAM,WAAW,wBACf,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;CACxD;AAED,MAAM,WAAW,0BAA0B,CAAC,CAAC,CAAE,SAAQ,oBAAoB,CAAC,CAAC,CAAC;IAC5E;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@ const NestedReorderableListWithRef = <T,>(
|
|
|
13
13
|
const {
|
|
14
14
|
scrollViewContainerRef,
|
|
15
15
|
scrollViewScrollOffsetY,
|
|
16
|
+
scrollViewPageY,
|
|
16
17
|
scrollViewHeightY,
|
|
17
18
|
scrollViewScrollEnabled,
|
|
18
19
|
outerScrollGesture,
|
|
@@ -25,6 +26,7 @@ const NestedReorderableListWithRef = <T,>(
|
|
|
25
26
|
ref={ref}
|
|
26
27
|
scrollViewContainerRef={scrollViewContainerRef}
|
|
27
28
|
scrollViewScrollOffsetY={scrollViewScrollOffsetY}
|
|
29
|
+
scrollViewPageY={scrollViewPageY}
|
|
28
30
|
scrollViewHeightY={scrollViewHeightY}
|
|
29
31
|
outerScrollGesture={outerScrollGesture}
|
|
30
32
|
scrollViewScrollEnabled={scrollViewScrollEnabled}
|
|
@@ -12,13 +12,14 @@ const ReorderableListWithRef = <T,>(
|
|
|
12
12
|
{...rest}
|
|
13
13
|
ref={ref}
|
|
14
14
|
scrollEnabled={scrollEnabled}
|
|
15
|
-
initialScrollViewScrollEnabled={true}
|
|
16
|
-
scrollable={true}
|
|
17
15
|
scrollViewContainerRef={undefined}
|
|
18
16
|
scrollViewScrollOffsetY={undefined}
|
|
17
|
+
scrollViewPageY={undefined}
|
|
19
18
|
scrollViewHeightY={undefined}
|
|
20
19
|
outerScrollGesture={undefined}
|
|
21
20
|
scrollViewScrollEnabled={undefined}
|
|
21
|
+
initialScrollViewScrollEnabled
|
|
22
|
+
scrollable
|
|
22
23
|
/>
|
|
23
24
|
);
|
|
24
25
|
|
|
@@ -83,13 +83,13 @@ export const ReorderableListCell = memo(
|
|
|
83
83
|
currentIndex.value >= 0 &&
|
|
84
84
|
draggedIndex.value >= 0
|
|
85
85
|
) {
|
|
86
|
-
const
|
|
86
|
+
const moveUp = currentIndex.value > draggedIndex.value;
|
|
87
87
|
const startMove = Math.min(draggedIndex.value, currentIndex.value);
|
|
88
88
|
const endMove = Math.max(draggedIndex.value, currentIndex.value);
|
|
89
|
-
let newValue = 0;
|
|
90
89
|
|
|
90
|
+
let newValue = 0;
|
|
91
91
|
if (index >= startMove && index <= endMove) {
|
|
92
|
-
newValue =
|
|
92
|
+
newValue = moveUp ? -draggedHeight.value : draggedHeight.value;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
if (newValue !== itemTranslateY.value) {
|
|
@@ -32,6 +32,7 @@ const AnimatedFlatList = Animated.createAnimatedComponent(
|
|
|
32
32
|
interface ReorderableListCoreProps<T> extends ReorderableListProps<T> {
|
|
33
33
|
// not optional but undefined to avoid forgetting to pass a prop
|
|
34
34
|
scrollViewContainerRef: React.RefObject<ScrollView> | undefined;
|
|
35
|
+
scrollViewPageY: SharedValue<number> | undefined;
|
|
35
36
|
scrollViewHeightY: SharedValue<number> | undefined;
|
|
36
37
|
scrollViewScrollOffsetY: SharedValue<number> | undefined;
|
|
37
38
|
scrollViewScrollEnabled: SharedValue<boolean> | undefined;
|
|
@@ -49,7 +50,6 @@ const ReorderableListCore = <T,>(
|
|
|
49
50
|
autoscrollDelay = AUTOSCROLL_CONFIG.delay,
|
|
50
51
|
autoscrollActivationDelta = 5,
|
|
51
52
|
animationDuration = 200,
|
|
52
|
-
dragReorderThreshold = 0.2,
|
|
53
53
|
onLayout,
|
|
54
54
|
onReorder,
|
|
55
55
|
onScroll,
|
|
@@ -57,6 +57,7 @@ const ReorderableListCore = <T,>(
|
|
|
57
57
|
onDragEnd,
|
|
58
58
|
onIndexChange,
|
|
59
59
|
scrollViewContainerRef,
|
|
60
|
+
scrollViewPageY,
|
|
60
61
|
scrollViewHeightY,
|
|
61
62
|
scrollViewScrollOffsetY,
|
|
62
63
|
scrollViewScrollEnabled,
|
|
@@ -91,16 +92,17 @@ const ReorderableListCore = <T,>(
|
|
|
91
92
|
autoscrollDelay,
|
|
92
93
|
autoscrollActivationDelta,
|
|
93
94
|
animationDuration,
|
|
94
|
-
dragReorderThreshold,
|
|
95
95
|
onLayout,
|
|
96
96
|
onReorder,
|
|
97
97
|
onDragStart,
|
|
98
98
|
onDragEnd,
|
|
99
99
|
onIndexChange,
|
|
100
100
|
scrollViewContainerRef,
|
|
101
|
+
scrollViewPageY,
|
|
101
102
|
scrollViewHeightY,
|
|
102
103
|
scrollViewScrollOffsetY,
|
|
103
104
|
scrollViewScrollEnabled,
|
|
105
|
+
scrollable,
|
|
104
106
|
// flatlist will default to true if we pass explicitly undefined,
|
|
105
107
|
// but internally we would treat it as false, so we force true
|
|
106
108
|
initialScrollEnabled:
|
|
@@ -109,7 +111,6 @@ const ReorderableListCore = <T,>(
|
|
|
109
111
|
typeof initialScrollViewScrollEnabled === 'undefined'
|
|
110
112
|
? true
|
|
111
113
|
: initialScrollViewScrollEnabled,
|
|
112
|
-
nestedScrollable: scrollable,
|
|
113
114
|
cellAnimations,
|
|
114
115
|
shouldUpdateActiveItem,
|
|
115
116
|
panEnabled,
|