react-native-reorderable-list 0.6.1 → 0.7.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.
Files changed (118) hide show
  1. package/README.md +28 -3
  2. package/lib/commonjs/components/NestedReorderableList.js +41 -0
  3. package/lib/commonjs/components/NestedReorderableList.js.map +1 -0
  4. package/lib/commonjs/components/ReorderableList.js +29 -0
  5. package/lib/commonjs/components/ReorderableList.js.map +1 -0
  6. package/lib/commonjs/components/ReorderableListCell.js +1 -3
  7. package/lib/commonjs/components/ReorderableListCell.js.map +1 -1
  8. package/lib/commonjs/components/{ReorderableList/ReorderableList.js → ReorderableListCore/ReorderableListCore.js} +35 -10
  9. package/lib/commonjs/components/ReorderableListCore/ReorderableListCore.js.map +1 -0
  10. package/lib/commonjs/components/ReorderableListCore/constants.js +31 -0
  11. package/lib/commonjs/components/ReorderableListCore/constants.js.map +1 -0
  12. package/lib/commonjs/components/ReorderableListCore/index.js +17 -0
  13. package/lib/commonjs/components/ReorderableListCore/index.js.map +1 -0
  14. package/lib/commonjs/components/{ReorderableList/useReorderableList.js → ReorderableListCore/useReorderableListCore.js} +176 -70
  15. package/lib/commonjs/components/ReorderableListCore/useReorderableListCore.js.map +1 -0
  16. package/lib/commonjs/components/ScrollViewContainer.js +53 -0
  17. package/lib/commonjs/components/ScrollViewContainer.js.map +1 -0
  18. package/lib/commonjs/components/index.js +22 -0
  19. package/lib/commonjs/components/index.js.map +1 -1
  20. package/lib/commonjs/contexts/ScrollViewContainerContext.js +10 -0
  21. package/lib/commonjs/contexts/ScrollViewContainerContext.js.map +1 -0
  22. package/lib/commonjs/contexts/index.js +11 -0
  23. package/lib/commonjs/contexts/index.js.map +1 -1
  24. package/lib/commonjs/index.js +12 -0
  25. package/lib/commonjs/index.js.map +1 -1
  26. package/lib/module/components/NestedReorderableList.js +33 -0
  27. package/lib/module/components/NestedReorderableList.js.map +1 -0
  28. package/lib/module/components/ReorderableList.js +21 -0
  29. package/lib/module/components/ReorderableList.js.map +1 -0
  30. package/lib/module/components/ReorderableListCell.js +1 -3
  31. package/lib/module/components/ReorderableListCell.js.map +1 -1
  32. package/lib/module/components/{ReorderableList/ReorderableList.js → ReorderableListCore/ReorderableListCore.js} +39 -14
  33. package/lib/module/components/ReorderableListCore/ReorderableListCore.js.map +1 -0
  34. package/lib/module/components/ReorderableListCore/constants.js +25 -0
  35. package/lib/module/components/ReorderableListCore/constants.js.map +1 -0
  36. package/lib/module/components/ReorderableListCore/index.js +2 -0
  37. package/lib/module/components/ReorderableListCore/index.js.map +1 -0
  38. package/lib/module/components/{ReorderableList/useReorderableList.js → ReorderableListCore/useReorderableListCore.js} +177 -71
  39. package/lib/module/components/ReorderableListCore/useReorderableListCore.js.map +1 -0
  40. package/lib/module/components/ScrollViewContainer.js +44 -0
  41. package/lib/module/components/ScrollViewContainer.js.map +1 -0
  42. package/lib/module/components/index.js +2 -0
  43. package/lib/module/components/index.js.map +1 -1
  44. package/lib/module/contexts/ScrollViewContainerContext.js +3 -0
  45. package/lib/module/contexts/ScrollViewContainerContext.js.map +1 -0
  46. package/lib/module/contexts/index.js +1 -0
  47. package/lib/module/contexts/index.js.map +1 -1
  48. package/lib/module/index.js +2 -2
  49. package/lib/module/index.js.map +1 -1
  50. package/lib/typescript/components/NestedReorderableList.d.ts +5 -0
  51. package/lib/typescript/components/NestedReorderableList.d.ts.map +1 -0
  52. package/lib/typescript/components/ReorderableList.d.ts +5 -0
  53. package/lib/typescript/components/ReorderableList.d.ts.map +1 -0
  54. package/lib/typescript/components/ReorderableListCell.d.ts.map +1 -1
  55. package/lib/typescript/components/ReorderableListCore/ReorderableListCore.d.ts +20 -0
  56. package/lib/typescript/components/ReorderableListCore/ReorderableListCore.d.ts.map +1 -0
  57. package/lib/typescript/components/ReorderableListCore/constants.d.ts +6 -0
  58. package/lib/typescript/components/ReorderableListCore/constants.d.ts.map +1 -0
  59. package/lib/typescript/components/ReorderableListCore/index.d.ts +2 -0
  60. package/lib/typescript/components/ReorderableListCore/index.d.ts.map +1 -0
  61. package/lib/typescript/components/ReorderableListCore/useReorderableListCore.d.ts +44 -0
  62. package/lib/typescript/components/ReorderableListCore/useReorderableListCore.d.ts.map +1 -0
  63. package/lib/typescript/components/ScrollViewContainer.d.ts +4 -0
  64. package/lib/typescript/components/ScrollViewContainer.d.ts.map +1 -0
  65. package/lib/typescript/components/index.d.ts +2 -0
  66. package/lib/typescript/components/index.d.ts.map +1 -1
  67. package/lib/typescript/contexts/ScrollViewContainerContext.d.ts +15 -0
  68. package/lib/typescript/contexts/ScrollViewContainerContext.d.ts.map +1 -0
  69. package/lib/typescript/contexts/index.d.ts +1 -0
  70. package/lib/typescript/contexts/index.d.ts.map +1 -1
  71. package/lib/typescript/index.d.ts +3 -3
  72. package/lib/typescript/index.d.ts.map +1 -1
  73. package/lib/typescript/types/props.d.ts +13 -1
  74. package/lib/typescript/types/props.d.ts.map +1 -1
  75. package/package.json +15 -7
  76. package/src/components/NestedReorderableList.tsx +43 -0
  77. package/src/components/ReorderableList.tsx +29 -0
  78. package/src/components/ReorderableListCell.tsx +1 -3
  79. package/src/components/ReorderableListCore/ReorderableListCore.tsx +162 -0
  80. package/src/components/ReorderableListCore/constants.ts +31 -0
  81. package/src/components/ReorderableListCore/index.ts +1 -0
  82. package/src/components/{ReorderableList/useReorderableList.ts → ReorderableListCore/useReorderableListCore.ts} +261 -89
  83. package/src/components/ScrollViewContainer.tsx +74 -0
  84. package/src/components/index.ts +2 -0
  85. package/src/contexts/ScrollViewContainerContext.ts +18 -0
  86. package/src/contexts/index.ts +1 -0
  87. package/src/index.ts +10 -1
  88. package/src/types/props.ts +21 -1
  89. package/lib/commonjs/components/ReorderableList/ReorderableList.js.map +0 -1
  90. package/lib/commonjs/components/ReorderableList/constants.ios.js +0 -10
  91. package/lib/commonjs/components/ReorderableList/constants.ios.js.map +0 -1
  92. package/lib/commonjs/components/ReorderableList/constants.js +0 -10
  93. package/lib/commonjs/components/ReorderableList/constants.js.map +0 -1
  94. package/lib/commonjs/components/ReorderableList/index.js +0 -17
  95. package/lib/commonjs/components/ReorderableList/index.js.map +0 -1
  96. package/lib/commonjs/components/ReorderableList/useReorderableList.js.map +0 -1
  97. package/lib/module/components/ReorderableList/ReorderableList.js.map +0 -1
  98. package/lib/module/components/ReorderableList/constants.ios.js +0 -4
  99. package/lib/module/components/ReorderableList/constants.ios.js.map +0 -1
  100. package/lib/module/components/ReorderableList/constants.js +0 -4
  101. package/lib/module/components/ReorderableList/constants.js.map +0 -1
  102. package/lib/module/components/ReorderableList/index.js +0 -2
  103. package/lib/module/components/ReorderableList/index.js.map +0 -1
  104. package/lib/module/components/ReorderableList/useReorderableList.js.map +0 -1
  105. package/lib/typescript/components/ReorderableList/ReorderableList.d.ts +0 -8
  106. package/lib/typescript/components/ReorderableList/ReorderableList.d.ts.map +0 -1
  107. package/lib/typescript/components/ReorderableList/constants.d.ts +0 -3
  108. package/lib/typescript/components/ReorderableList/constants.d.ts.map +0 -1
  109. package/lib/typescript/components/ReorderableList/constants.ios.d.ts +0 -3
  110. package/lib/typescript/components/ReorderableList/constants.ios.d.ts.map +0 -1
  111. package/lib/typescript/components/ReorderableList/index.d.ts +0 -2
  112. package/lib/typescript/components/ReorderableList/index.d.ts.map +0 -1
  113. package/lib/typescript/components/ReorderableList/useReorderableList.d.ts +0 -36
  114. package/lib/typescript/components/ReorderableList/useReorderableList.d.ts.map +0 -1
  115. package/src/components/ReorderableList/ReorderableList.tsx +0 -109
  116. package/src/components/ReorderableList/constants.ios.ts +0 -3
  117. package/src/components/ReorderableList/constants.ts +0 -3
  118. package/src/components/ReorderableList/index.ts +0 -1
package/README.md CHANGED
@@ -1,3 +1,10 @@
1
+ ![NPM Downloads](https://img.shields.io/npm/dm/react-native-reorderable-list)
2
+ ![GitHub License](https://img.shields.io/github/license/omahili/react-native-reorderable-list)
3
+ ![NPM Version](https://img.shields.io/npm/v/react-native-reorderable-list)
4
+ <br />
5
+ ![iOS](https://img.shields.io/badge/platform-iOS-000.svg?logo=apple)
6
+ ![Android](https://img.shields.io/badge/platform-Android-3ddc84.svg?logo=android)
7
+
1
8
  # React Native Reorderable List
2
9
 
3
10
  A reorderable list for React Native applications, powered by Reanimated 🚀
@@ -11,6 +18,8 @@ A reorderable list for React Native applications, powered by Reanimated 🚀
11
18
  - [Components](#components)
12
19
  - [ReorderableList](#reorderablelist)
13
20
  - [ReorderableListItem](#reorderablelistitem)
21
+ - [ScrollViewContainer](#scrollviewcontainer)
22
+ - [NestedReorderableList](#nestedreorderablelist)
14
23
  - [Hooks](#hooks)
15
24
  - [useReorderableDrag](#usereorderabledrag)
16
25
  - [useReorderableDragStart](#usereorderabledragstart)
@@ -72,6 +81,22 @@ This component allows you to animate the item when it's dragged. It currently su
72
81
  | scaleAnimationConfig | `{ enabled?: boolean, valueEnd?: number, valueStart?: number, easingEnd?: EasingFunction, easingStart?: EasingFunction, duration?: number }` | false | `{ enabled: true, valueEnd: 1, valueStart: 1.025, easingStart: Easing.in(Easing.ease), easingEnd: Easing.out(Easing.ease), duration: 200 }` | Configures the scale animation of the reorderable item. |
73
82
  | opacityAnimationConfig | `{ enabled?: boolean, valueEnd?: number, valueStart?: number, easingEnd?: EasingFunction, easingStart?: EasingFunction, duration?: number }` | false | `{ enabled: true, valueEnd: 1, valueStart: 0.75, easingStart: Easing.in(Easing.ease), easingEnd: Easing.out(Easing.ease), duration: 200, }` | Configures the opacity animation of the reorderable item. |
74
83
 
84
+ ### ScrollViewContainer
85
+
86
+ This component extends the [ScrollView](https://reactnative.dev/docs/scrollview) component and is used for nesting a [NestedReorderableList](#nestedreorderablelist) within a scrollable container:
87
+
88
+ | Props | Type | Required | Default | Description |
89
+ | -------- | ------------------------------------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
90
+ | onScroll | `(event: NativeScrollEvent) => void` | No | N/A | Event fired at most once per frame during scrolling. Needs to be a `worklet`. See [Reanimated docs](https://docs.swmansion.com/react-native-reanimated) for further info. |
91
+
92
+ ### NestedReorderableList
93
+
94
+ This component allows nesting a reorderable list within a [ScrollViewContainer](#scrollviewcontainer):
95
+
96
+ | Props | Type | Required | Default | Description |
97
+ | ---------- | --------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
98
+ | scrollable | `boolean` | No | false | Whether the nested list is scrollable or not. If the nested list has a fixed height and it's scrollable it should be set to `true`, otherwise `false`. |
99
+
75
100
  ## Hooks
76
101
 
77
102
  ### useReorderableDrag
@@ -106,7 +131,7 @@ This hook allows handling the drag end event of a list item. It receives a workl
106
131
 
107
132
  ## Example
108
133
 
109
- Here is an example of how to use this component. More examples can be found in the `example` directory of the repository.
134
+ Here is simple example of how to use this component. Examples of nested lists and much more can be found in the [example](https://github.com/omahili/react-native-reorderable-list/tree/feat/nested-lists/example) directory.
110
135
 
111
136
  ```typescript
112
137
  import React, {useState} from 'react';
@@ -149,7 +174,7 @@ const Card: React.FC<CardProps> = React.memo(({id, color, height}) => {
149
174
  );
150
175
  });
151
176
 
152
- const App = () => {
177
+ const Example = () => {
153
178
  const [data, setData] = useState(list);
154
179
 
155
180
  const renderItem = ({item}: ListRenderItemInfo<CardProps>) => (
@@ -186,7 +211,7 @@ const styles = StyleSheet.create({
186
211
  },
187
212
  });
188
213
 
189
- export default App;
214
+ export default Example;
190
215
  ```
191
216
 
192
217
  ## License
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NestedReorderableList = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _ReorderableListCore = require("./ReorderableListCore");
9
+ var _contexts = require("../contexts");
10
+ var _hooks = require("../hooks");
11
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
14
+ const NestedReorderableListWithRef = ({
15
+ scrollable,
16
+ scrollEnabled = true,
17
+ ...rest
18
+ }, ref) => {
19
+ const {
20
+ scrollViewContainerRef,
21
+ scrollViewScrollOffsetY,
22
+ scrollViewHeightY,
23
+ scrollViewScrollEnabled,
24
+ outerScrollGesture,
25
+ initialScrollViewScrollEnabled
26
+ } = (0, _hooks.useContext)(_contexts.ScrollViewContainerContext);
27
+ return /*#__PURE__*/_react.default.createElement(_ReorderableListCore.ReorderableListCore, _extends({}, rest, {
28
+ ref: ref,
29
+ scrollViewContainerRef: scrollViewContainerRef,
30
+ scrollViewScrollOffsetY: scrollViewScrollOffsetY,
31
+ scrollViewHeightY: scrollViewHeightY,
32
+ outerScrollGesture: outerScrollGesture,
33
+ scrollViewScrollEnabled: scrollViewScrollEnabled,
34
+ initialScrollViewScrollEnabled: initialScrollViewScrollEnabled,
35
+ scrollable: scrollable,
36
+ scrollEnabled: scrollEnabled,
37
+ nestedScrollEnabled: true
38
+ }));
39
+ };
40
+ const NestedReorderableList = exports.NestedReorderableList = /*#__PURE__*/(0, _react.forwardRef)(NestedReorderableListWithRef);
41
+ //# sourceMappingURL=NestedReorderableList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_ReorderableListCore","_contexts","_hooks","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","NestedReorderableListWithRef","scrollable","scrollEnabled","rest","ref","scrollViewContainerRef","scrollViewScrollOffsetY","scrollViewHeightY","scrollViewScrollEnabled","outerScrollGesture","initialScrollViewScrollEnabled","useContext","ScrollViewContainerContext","createElement","ReorderableListCore","nestedScrollEnabled","NestedReorderableList","exports","forwardRef"],"sourceRoot":"../../../src","sources":["components/NestedReorderableList.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,oBAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAoC,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,C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B,EAAEA,iBAAkB;IACrCE,kBAAkB,EAAEA,kBAAmB;IACvCD,uBAAuB,EAAEA,uBAAwB;IACjDE,8BAA8B,EAAEA,8BAA+B;IAC/DT,UAAU,EAAEA,UAAW;IACvBC,aAAa,EAAEA,aAAc;IAC7Ba,mBAAmB;EAAA,EACpB,CAAC;AAEN,CAAC;AAEM,MAAMC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,gBAAG,IAAAE,iBAAU,EAC7ClB,4BACF,CAEgB","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ReorderableList = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _ReorderableListCore = require("./ReorderableListCore");
9
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
12
+ const ReorderableListWithRef = ({
13
+ scrollEnabled = true,
14
+ ...rest
15
+ }, ref) => {
16
+ return /*#__PURE__*/_react.default.createElement(_ReorderableListCore.ReorderableListCore, _extends({}, rest, {
17
+ ref: ref,
18
+ scrollEnabled: scrollEnabled,
19
+ initialScrollViewScrollEnabled: true,
20
+ scrollable: true,
21
+ scrollViewContainerRef: undefined,
22
+ scrollViewScrollOffsetY: undefined,
23
+ scrollViewHeightY: undefined,
24
+ outerScrollGesture: undefined,
25
+ scrollViewScrollEnabled: undefined
26
+ }));
27
+ };
28
+ const ReorderableList = exports.ReorderableList = /*#__PURE__*/(0, _react.forwardRef)(ReorderableListWithRef);
29
+ //# sourceMappingURL=ReorderableList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_ReorderableListCore","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","ReorderableListWithRef","scrollEnabled","rest","ref","createElement","ReorderableListCore","initialScrollViewScrollEnabled","scrollable","scrollViewContainerRef","undefined","scrollViewScrollOffsetY","scrollViewHeightY","outerScrollGesture","scrollViewScrollEnabled","ReorderableList","exports","forwardRef"],"sourceRoot":"../../../src","sources":["components/ReorderableList.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,oBAAA,GAAAD,OAAA;AAA0D,SAAAE,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CA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ACdQ,IAAI;IACRC,GAAG,EAAEA,GAAI;IACTF,aAAa,EAAEA,aAAc;IAC7BK,8BAA8B,EAAE,IAAK;IACrCC,UAAU,EAAE,IAAK;IACjBC,sBAAsB,EAAEC,SAAU;IAClCC,uBAAuB,EAAED,SAAU;IACnCE,iBAAiB,EAAEF,SAAU;IAC7BG,kBAAkB,EAAEH,SAAU;IAC9BI,uBAAuB,EAAEJ;EAAU,EACpC,CAAC;AAEN,CAAC;AAEM,MAAMK,eAAe,GAAAC,OAAA,CAAAD,eAAA,gBAAG,IAAAE,iBAAU,EAAChB,sBAAsB,CAEhD","ignoreList":[]}
@@ -77,9 +77,7 @@ const ReorderableListCell = exports.ReorderableListCell = /*#__PURE__*/(0, _reac
77
77
  itemOffset.value[index] = y;
78
78
  itemHeight.value[index] = height;
79
79
  })(e.nativeEvent.layout.y, e.nativeEvent.layout.height);
80
- if (onLayout) {
81
- onLayout(e);
82
- }
80
+ onLayout === null || onLayout === void 0 || onLayout(e);
83
81
  };
84
82
  return /*#__PURE__*/_react.default.createElement(_contexts.ReorderableCellContext.Provider, {
85
83
  value: contextValue
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeReanimated","_contexts","_hooks","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ReorderableListCell","exports","memo","index","startDrag","children","onLayout","itemOffset","itemHeight","dragY","draggedIndex","animationDuration","dragHandler","useCallback","contextValue","useMemo","currentIndex","draggedHeight","useContext","ReorderableListContext","itemZIndex","useSharedValue","itemPositionY","itemDragY","itemIndex","useAnimatedReaction","value","moveDown","startMove","Math","min","endMove","max","newValue","withTiming","duration","easing","Easing","out","ease","animatedStyle","useAnimatedStyle","zIndex","transform","translateY","handleLayout","runOnUI","y","height","nativeEvent","layout","createElement","ReorderableCellContext","Provider","View","style"],"sourceRoot":"../../../src","sources":["components/ReorderableListCell.ts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I;IAAK,CAAC;EAErC,CAAC,CAAC,CAAC;EAEH,MAAMmB,YAAY,GAAIhE,CAAoB,IAAK;IAC7C,IAAAiE,8BAAO,EAAC,CAACC,CAAS,EAAEC,MAAc,KAAK;MACrCzC,UAAU,CAACmB,KAAK,CAACvB,KAAK,CAAC,GAAG4C,CAAC;MAC3BvC,UAAU,CAACkB,KAAK,CAACvB,KAAK,CAAC,GAAG6C,MAAM;IAClC,CAAC,CAAC,CAACnE,CAAC,CAACoE,WAAW,CAACC,MAAM,CAACH,CAAC,EAAElE,CAAC,CAACoE,WAAW,CAACC,MAAM,CAACF,MAAM,CAAC;IAEvD,IAAI1C,QAAQ,EAAE;MACZA,QAAQ,CAACzB,CAAC,CAAC;IACb;EACF,CAAC;EAED,oBACEP,MAAA,CAAAY,OAAA,CAAAiE,aAAA,CAACzE,SAAA,CAAA0E,sBAAsB,CAACC,QAAQ;IAAC3B,KAAK,EAAEZ;EAAa,gBACnDxC,MAAA,CAAAY,OAAA,CAAAiE,aAAA,CAAC1E,sBAAA,CAAAS,OAAQ,CAACoE,IAAI;IAACC,KAAK,EAAEf,aAAc;IAAClC,QAAQ,EAAEuC;EAAa,GACzDxC,QACY,CACgB,CAAC;AAEtC,CACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeReanimated","_contexts","_hooks","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ReorderableListCell","exports","memo","index","startDrag","children","onLayout","itemOffset","itemHeight","dragY","draggedIndex","animationDuration","dragHandler","useCallback","contextValue","useMemo","currentIndex","draggedHeight","useContext","ReorderableListContext","itemZIndex","useSharedValue","itemPositionY","itemDragY","itemIndex","useAnimatedReaction","value","moveDown","startMove","Math","min","endMove","max","newValue","withTiming","duration","easing","Easing","out","ease","animatedStyle","useAnimatedStyle","zIndex","transform","translateY","handleLayout","runOnUI","y","height","nativeEvent","layout","createElement","ReorderableCellContext","Provider","View","style"],"sourceRoot":"../../../src","sources":["components/ReorderableListCell.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,sBAAA,GAAAF,uBAAA,CAAAC,OAAA;AAUA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAoC,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,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UAAU,EAAErB,SAAS,CAACG;IAAK,CAAC,EAC7B;MAACkB,UAAU,EAAEtB,aAAa,CAACI;IAAK,CAAC;EAErC,CAAC,CAAC,CAAC;EAEH,MAAMmB,YAAY,GAAIhE,CAAoB,IAAK;IAC7C,IAAAiE,8BAAO,EAAC,CAACC,CAAS,EAAEC,MAAc,KAAK;MACrCzC,UAAU,CAACmB,KAAK,CAACvB,KAAK,CAAC,GAAG4C,CAAC;MAC3BvC,UAAU,CAACkB,KAAK,CAACvB,KAAK,CAAC,GAAG6C,MAAM;IAClC,CAAC,CAAC,CAACnE,CAAC,CAACoE,WAAW,CAACC,MAAM,CAACH,CAAC,EAAElE,CAAC,CAACoE,WAAW,CAACC,MAAM,CAACF,MAAM,CAAC;IAEvD1C,QAAQ,aAARA,QAAQ,eAARA,QAAQ,CAAGzB,CAAC,CAAC;EACf,CAAC;EAED,oBACEP,MAAA,CAAAY,OAAA,CAAAiE,aAAA,CAACzE,SAAA,CAAA0E,sBAAsB,CAACC,QAAQ;IAAC3B,KAAK,EAAEZ;EAAa,gBACnDxC,MAAA,CAAAY,OAAA,CAAAiE,aAAA,CAAC1E,sBAAA,CAAAS,OAAQ,CAACoE,IAAI;IAACC,KAAK,EAAEf,aAAc;IAAClC,QAAQ,EAAEuC;EAAa,GACzDxC,QACY,CACgB,CAAC;AAEtC,CACF,CAAC","ignoreList":[]}
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ReorderableList = void 0;
6
+ exports.ReorderableListCore = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _reactNativeGestureHandler = require("react-native-gesture-handler");
10
10
  var _reactNativeReanimated = _interopRequireDefault(require("react-native-reanimated"));
11
11
  var _constants = require("./constants");
12
- var _useReorderableList = require("./useReorderableList");
12
+ var _useReorderableListCore = require("./useReorderableListCore");
13
13
  var _contexts = require("../../contexts");
14
14
  var _ReorderableListCell = require("../ReorderableListCell");
15
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -17,11 +17,11 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
19
19
  const AnimatedFlatList = _reactNativeReanimated.default.createAnimatedComponent(_reactNative.FlatList);
20
- const ReorderableList = ({
20
+ const ReorderableListCore = ({
21
21
  data,
22
22
  autoscrollThreshold = 0.1,
23
23
  autoscrollSpeedScale = 1,
24
- autoscrollDelay = _constants.AUTOSCROLL_DELAY,
24
+ autoscrollDelay = _constants.AUTOSCROLL_CONFIG.delay,
25
25
  animationDuration = 200,
26
26
  dragReorderThreshold = 0.2,
27
27
  onLayout,
@@ -30,6 +30,14 @@ const ReorderableList = ({
30
30
  onDragEnd,
31
31
  keyExtractor,
32
32
  extraData,
33
+ scrollViewContainerRef,
34
+ scrollViewHeightY,
35
+ scrollViewScrollOffsetY,
36
+ scrollViewScrollEnabled,
37
+ scrollEnabled,
38
+ initialScrollViewScrollEnabled,
39
+ scrollable,
40
+ outerScrollGesture,
33
41
  ...rest
34
42
  }, ref) => {
35
43
  const {
@@ -44,7 +52,7 @@ const ReorderableList = ({
44
52
  dragY,
45
53
  draggedIndex,
46
54
  duration
47
- } = (0, _useReorderableList.useReorderableList)({
55
+ } = (0, _useReorderableListCore.useReorderableListCore)({
48
56
  ref,
49
57
  autoscrollThreshold,
50
58
  autoscrollSpeedScale,
@@ -54,8 +62,24 @@ const ReorderableList = ({
54
62
  onLayout,
55
63
  onReorder,
56
64
  onScroll,
57
- onDragEnd
65
+ onDragEnd,
66
+ scrollViewContainerRef,
67
+ scrollViewHeightY,
68
+ scrollViewScrollOffsetY,
69
+ scrollViewScrollEnabled,
70
+ // flatlist will default to true if we pass explicitly undefined,
71
+ // but internally we would treat it as false, so we force true
72
+ initialScrollEnabled: typeof scrollEnabled === 'undefined' ? true : scrollEnabled,
73
+ initialScrollViewScrollEnabled: typeof initialScrollViewScrollEnabled === 'undefined' ? true : initialScrollViewScrollEnabled,
74
+ nestedScrollable: scrollable
58
75
  });
76
+ const combinedGesture = (0, _react.useMemo)(() => {
77
+ // android is able to handle nested scroll view, but not the full height ones like iOS
78
+ if (outerScrollGesture && !(_reactNative.Platform.OS === 'android' && scrollable)) {
79
+ return _reactNativeGestureHandler.Gesture.Simultaneous(outerScrollGesture, gestureHandler);
80
+ }
81
+ return gestureHandler;
82
+ }, [scrollable, outerScrollGesture, gestureHandler]);
59
83
  const renderAnimatedCell = (0, _react.useCallback)(({
60
84
  cellKey,
61
85
  ...props
@@ -72,7 +96,7 @@ const ReorderableList = ({
72
96
  return /*#__PURE__*/_react.default.createElement(_contexts.ReorderableListContext.Provider, {
73
97
  value: listContextValue
74
98
  }, /*#__PURE__*/_react.default.createElement(_reactNativeGestureHandler.GestureDetector, {
75
- gesture: gestureHandler
99
+ gesture: combinedGesture
76
100
  }, /*#__PURE__*/_react.default.createElement(AnimatedFlatList, _extends({}, rest, {
77
101
  ref: handleRef,
78
102
  data: data,
@@ -84,8 +108,9 @@ const ReorderableList = ({
84
108
  removeClippedSubviews: false,
85
109
  keyExtractor: keyExtractor,
86
110
  extraData: extraData,
87
- numColumns: 1
111
+ numColumns: 1,
112
+ scrollEnabled: scrollEnabled
88
113
  }))));
89
114
  };
90
- const MemoizedReorderableList = exports.ReorderableList = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.default.forwardRef(ReorderableList));
91
- //# sourceMappingURL=ReorderableList.js.map
115
+ const MemoizedReorderableListCore = exports.ReorderableListCore = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.default.forwardRef(ReorderableListCore));
116
+ //# sourceMappingURL=ReorderableListCore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeGestureHandler","_reactNativeReanimated","_interopRequireDefault","_constants","_useReorderableListCore","_contexts","_ReorderableListCell","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","AnimatedFlatList","Animated","createAnimatedComponent","FlatList","ReorderableListCore","data","autoscrollThreshold","autoscrollSpeedScale","autoscrollDelay","AUTOSCROLL_CONFIG","delay","animationDuration","dragReorderThreshold","onLayout","onReorder","onScroll","onDragEnd","keyExtractor","extraData","scrollViewContainerRef","scrollViewHeightY","scrollViewScrollOffsetY","scrollViewScrollEnabled","scrollEnabled","initialScrollViewScrollEnabled","scrollable","outerScrollGesture","rest","ref","gestureHandler","handleScroll","handleFlatListLayout","handleRef","startDrag","listContextValue","itemOffset","itemHeight","dragY","draggedIndex","duration","useReorderableListCore","initialScrollEnabled","nestedScrollable","combinedGesture","useMemo","Platform","OS","Gesture","Simultaneous","renderAnimatedCell","useCallback","cellKey","props","createElement","ReorderableListCell","key","index","ReorderableListContext","Provider","value","GestureDetector","gesture","CellRendererComponent","scrollEventThrottle","horizontal","removeClippedSubviews","numColumns","MemoizedReorderableListCore","exports","React","memo","forwardRef"],"sourceRoot":"../../../../src","sources":["components/ReorderableListCore/ReorderableListCore.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAA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,CACF,EACD,CAACE,UAAU,EAAEC,UAAU,EAAEC,KAAK,EAAEC,YAAY,EAAEC,QAAQ,EAAEN,SAAS,CACnE,CAAC;EAED,oBACEtE,MAAA,CAAAa,OAAA,CAAA6E,aAAA,CAACjF,SAAA,CAAAqF,sBAAsB,CAACC,QAAQ;IAACC,KAAK,EAAEzB;EAAiB,gBACvDvE,MAAA,CAAAa,OAAA,CAAA6E,aAAA,CAACtF,0BAAA,CAAA6F,eAAe;IAACC,OAAO,EAAElB;EAAgB,gBACxChF,MAAA,CAAAa,OAAA,CAAA6E,aAAA,CAACrD,gBAAgB,EAAAN,QAAA,KACXiC,IAAI;IACRC,GAAG,EAAEI,SAAU;IACf3B,IAAI,EAAEA,IAAK;IACXyD,qBAAqB,EAAEb,kBAAmB;IAC1CpC,QAAQ,EAAEkB,oBAAqB;IAC/BhB,QAAQ,EAAEe,YAAa;IACvBiC,mBAAmB,EAAE,CAAE;IACvBC,UAAU,EAAE,KAAM;IAClBC,qBAAqB,EAAE,KAAM;IAC7BhD,YAAY,EAAEA,YAAa;IAC3BC,SAAS,EAAEA,SAAU;IACrBgD,UAAU,EAAE,CAAE;IACd3C,aAAa,EAAEA;EAAc,EAC9B,CACc,CACc,CAAC;AAEtC,CAAC;AAED,MAAM4C,2BAA2B,GAAAC,OAAA,CAAAhE,mBAAA,gBAAGiE,cAAK,CAACC,IAAI,cAC5CD,cAAK,CAACE,UAAU,CAACnE,mBAAmB,CACtC,CAIuB","ignoreList":[]}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.IS_FABRIC = exports.AUTOSCROLL_CONFIG = void 0;
7
+ var _reactNative = require("react-native");
8
+ const IOS_CONFIG = {
9
+ delay: 80,
10
+ increment: 100
11
+ };
12
+ const ANDROID_FABRIC_CONFIG = {
13
+ delay: 50,
14
+ increment: 80
15
+ };
16
+ const ANDROID_PAPER_CONFIG = {
17
+ delay: 10,
18
+ increment: 4
19
+ };
20
+ const IS_FABRIC = exports.IS_FABRIC = global && typeof global === 'object' && 'nativeFabricUIManager' in global;
21
+ const AUTOSCROLL_CONFIG = exports.AUTOSCROLL_CONFIG = _reactNative.Platform.select({
22
+ // autoscroll behaves differently with Fabric and Paper on Android
23
+ android: IS_FABRIC ? ANDROID_FABRIC_CONFIG : ANDROID_PAPER_CONFIG,
24
+ ios: IOS_CONFIG,
25
+ // unsupported platforms
26
+ web: IOS_CONFIG,
27
+ macos: IOS_CONFIG,
28
+ windows: IOS_CONFIG,
29
+ native: IOS_CONFIG
30
+ });
31
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","IOS_CONFIG","delay","increment","ANDROID_FABRIC_CONFIG","ANDROID_PAPER_CONFIG","IS_FABRIC","exports","global","AUTOSCROLL_CONFIG","Platform","select","android","ios","web","macos","windows","native"],"sourceRoot":"../../../../src","sources":["components/ReorderableListCore/constants.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,UAAU,GAAG;EACjBC,KAAK,EAAE,EAAE;EACTC,SAAS,EAAE;AACb,CAAC;AAED,MAAMC,qBAAqB,GAAG;EAC5BF,KAAK,EAAE,EAAE;EACTC,SAAS,EAAE;AACb,CAAC;AAED,MAAME,oBAAoB,GAAG;EAC3BH,KAAK,EAAE,EAAE;EACTC,SAAS,EAAE;AACb,CAAC;AAEM,MAAMG,SAAS,GAAAC,OAAA,CAAAD,SAAA,GACpBE,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAI,uBAAuB,IAAIA,MAAM;AAEpE,MAAMC,iBAAiB,GAAAF,OAAA,CAAAE,iBAAA,GAAGC,qBAAQ,CAACC,MAAM,CAAC;EAC/C;EACAC,OAAO,EAAEN,SAAS,GAAGF,qBAAqB,GAAGC,oBAAoB;EACjEQ,GAAG,EAAEZ,UAAU;EAEf;EACAa,GAAG,EAAEb,UAAU;EACfc,KAAK,EAAEd,UAAU;EACjBe,OAAO,EAAEf,UAAU;EACnBgB,MAAM,EAAEhB;AACV,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _ReorderableListCore = require("./ReorderableListCore");
7
+ Object.keys(_ReorderableListCore).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _ReorderableListCore[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _ReorderableListCore[key];
14
+ }
15
+ });
16
+ });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_ReorderableListCore","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../../../src","sources":["components/ReorderableListCore/index.ts"],"mappings":";;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,oBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,oBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,oBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}