react-native-reorderable-list 0.4.0 → 0.5.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 (162) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +118 -60
  3. package/lib/commonjs/components/ReorderableList/ReorderableList.js +91 -0
  4. package/lib/commonjs/components/ReorderableList/ReorderableList.js.map +1 -0
  5. package/lib/commonjs/components/ReorderableList/constants.ios.js +10 -0
  6. package/lib/commonjs/components/ReorderableList/constants.ios.js.map +1 -0
  7. package/lib/commonjs/components/ReorderableList/constants.js +10 -0
  8. package/lib/commonjs/components/ReorderableList/constants.js.map +1 -0
  9. package/lib/commonjs/components/ReorderableList/index.js +17 -0
  10. package/lib/commonjs/components/ReorderableList/index.js.map +1 -0
  11. package/lib/commonjs/components/ReorderableList/useReorderableList.js +313 -0
  12. package/lib/commonjs/components/ReorderableList/useReorderableList.js.map +1 -0
  13. package/lib/commonjs/components/ReorderableListCell.js +93 -0
  14. package/lib/commonjs/components/ReorderableListCell.js.map +1 -0
  15. package/lib/commonjs/components/ReorderableListItem.js +87 -0
  16. package/lib/commonjs/components/ReorderableListItem.js.map +1 -0
  17. package/lib/commonjs/components/index.js +39 -0
  18. package/lib/commonjs/components/index.js.map +1 -0
  19. package/lib/commonjs/contexts/ReorderableCellContext.js +10 -0
  20. package/lib/commonjs/contexts/ReorderableCellContext.js.map +1 -0
  21. package/lib/commonjs/contexts/ReorderableListContext.js +10 -0
  22. package/lib/commonjs/contexts/ReorderableListContext.js.map +1 -0
  23. package/lib/commonjs/contexts/index.js +28 -0
  24. package/lib/commonjs/contexts/index.js.map +1 -0
  25. package/lib/commonjs/hooks/index.js +50 -0
  26. package/lib/commonjs/hooks/index.js.map +1 -0
  27. package/lib/commonjs/hooks/useContext.js +16 -0
  28. package/lib/commonjs/hooks/useContext.js.map +1 -0
  29. package/lib/commonjs/hooks/useReorderableDrag.js +16 -0
  30. package/lib/commonjs/hooks/useReorderableDrag.js.map +1 -0
  31. package/lib/commonjs/hooks/useReorderableDragEnd.js +25 -0
  32. package/lib/commonjs/hooks/useReorderableDragEnd.js.map +1 -0
  33. package/lib/commonjs/hooks/useReorderableDragStart.js +22 -0
  34. package/lib/commonjs/hooks/useReorderableDragStart.js.map +1 -0
  35. package/lib/commonjs/index.js +41 -0
  36. package/lib/commonjs/index.js.map +1 -0
  37. package/lib/commonjs/types/index.js +28 -0
  38. package/lib/commonjs/types/index.js.map +1 -0
  39. package/lib/commonjs/types/misc.js +14 -0
  40. package/lib/commonjs/types/misc.js.map +1 -0
  41. package/lib/commonjs/types/props.js +6 -0
  42. package/lib/commonjs/types/props.js.map +1 -0
  43. package/lib/commonjs/utils.js +23 -0
  44. package/lib/commonjs/utils.js.map +1 -0
  45. package/lib/module/components/ReorderableList/ReorderableList.js +83 -0
  46. package/lib/module/components/ReorderableList/ReorderableList.js.map +1 -0
  47. package/lib/module/components/ReorderableList/constants.ios.js +4 -0
  48. package/lib/module/components/ReorderableList/constants.ios.js.map +1 -0
  49. package/lib/module/components/ReorderableList/constants.js +4 -0
  50. package/lib/module/components/ReorderableList/constants.js.map +1 -0
  51. package/lib/module/components/ReorderableList/index.js +2 -0
  52. package/lib/module/components/ReorderableList/index.js.map +1 -0
  53. package/lib/module/components/ReorderableList/useReorderableList.js +304 -0
  54. package/lib/module/components/ReorderableList/useReorderableList.js.map +1 -0
  55. package/lib/module/components/ReorderableListCell.js +85 -0
  56. package/lib/module/components/ReorderableListCell.js.map +1 -0
  57. package/lib/module/components/ReorderableListItem.js +78 -0
  58. package/lib/module/components/ReorderableListItem.js.map +1 -0
  59. package/lib/module/components/index.js +4 -0
  60. package/lib/module/components/index.js.map +1 -0
  61. package/lib/module/contexts/ReorderableCellContext.js +3 -0
  62. package/lib/module/contexts/ReorderableCellContext.js.map +1 -0
  63. package/lib/module/contexts/ReorderableListContext.js +3 -0
  64. package/lib/module/contexts/ReorderableListContext.js.map +1 -0
  65. package/lib/module/contexts/index.js +3 -0
  66. package/lib/module/contexts/index.js.map +1 -0
  67. package/lib/module/hooks/index.js +5 -0
  68. package/lib/module/hooks/index.js.map +1 -0
  69. package/lib/module/hooks/useContext.js +9 -0
  70. package/lib/module/hooks/useContext.js.map +1 -0
  71. package/lib/module/hooks/useReorderableDrag.js +9 -0
  72. package/lib/module/hooks/useReorderableDrag.js.map +1 -0
  73. package/lib/module/hooks/useReorderableDragEnd.js +18 -0
  74. package/lib/module/hooks/useReorderableDragEnd.js.map +1 -0
  75. package/lib/module/hooks/useReorderableDragStart.js +15 -0
  76. package/lib/module/hooks/useReorderableDragStart.js.map +1 -0
  77. package/lib/module/index.js +6 -0
  78. package/lib/module/index.js.map +1 -0
  79. package/lib/module/types/index.js +3 -0
  80. package/lib/module/types/index.js.map +1 -0
  81. package/lib/module/types/misc.js +8 -0
  82. package/lib/module/types/misc.js.map +1 -0
  83. package/lib/module/types/props.js +2 -0
  84. package/lib/module/types/props.js.map +1 -0
  85. package/lib/module/utils.js +16 -0
  86. package/lib/module/utils.js.map +1 -0
  87. package/lib/typescript/components/ReorderableList/ReorderableList.d.ts +8 -0
  88. package/lib/typescript/components/ReorderableList/ReorderableList.d.ts.map +1 -0
  89. package/lib/typescript/components/ReorderableList/constants.d.ts +3 -0
  90. package/lib/typescript/components/ReorderableList/constants.d.ts.map +1 -0
  91. package/lib/typescript/components/ReorderableList/constants.ios.d.ts +3 -0
  92. package/lib/typescript/components/ReorderableList/constants.ios.d.ts.map +1 -0
  93. package/lib/typescript/components/ReorderableList/index.d.ts +2 -0
  94. package/lib/typescript/components/ReorderableList/index.d.ts.map +1 -0
  95. package/lib/typescript/components/ReorderableList/useReorderableList.d.ts +34 -0
  96. package/lib/typescript/components/ReorderableList/useReorderableList.d.ts.map +1 -0
  97. package/lib/typescript/components/ReorderableListCell.d.ts +15 -0
  98. package/lib/typescript/components/ReorderableListCell.d.ts.map +1 -0
  99. package/lib/typescript/components/ReorderableListItem.d.ts +4 -0
  100. package/lib/typescript/components/ReorderableListItem.d.ts.map +1 -0
  101. package/lib/typescript/components/index.d.ts +4 -0
  102. package/lib/typescript/components/index.d.ts.map +1 -0
  103. package/lib/typescript/contexts/ReorderableCellContext.d.ts +11 -0
  104. package/lib/typescript/contexts/ReorderableCellContext.d.ts.map +1 -0
  105. package/lib/typescript/contexts/ReorderableListContext.d.ts +9 -0
  106. package/lib/typescript/contexts/ReorderableListContext.d.ts.map +1 -0
  107. package/lib/typescript/contexts/index.d.ts +3 -0
  108. package/lib/typescript/contexts/index.d.ts.map +1 -0
  109. package/lib/typescript/hooks/index.d.ts +5 -0
  110. package/lib/typescript/hooks/index.d.ts.map +1 -0
  111. package/lib/typescript/hooks/useContext.d.ts +3 -0
  112. package/lib/typescript/hooks/useContext.d.ts.map +1 -0
  113. package/lib/typescript/hooks/useReorderableDrag.d.ts +2 -0
  114. package/lib/typescript/hooks/useReorderableDrag.d.ts.map +1 -0
  115. package/lib/typescript/hooks/useReorderableDragEnd.d.ts +2 -0
  116. package/lib/typescript/hooks/useReorderableDragEnd.d.ts.map +1 -0
  117. package/lib/typescript/hooks/useReorderableDragStart.d.ts +2 -0
  118. package/lib/typescript/hooks/useReorderableDragStart.d.ts.map +1 -0
  119. package/lib/typescript/index.d.ts +7 -0
  120. package/lib/typescript/index.d.ts.map +1 -0
  121. package/lib/typescript/types/index.d.ts +3 -0
  122. package/lib/typescript/types/index.d.ts.map +1 -0
  123. package/lib/typescript/types/misc.d.ts +7 -0
  124. package/lib/typescript/types/misc.d.ts.map +1 -0
  125. package/lib/typescript/types/props.d.ts +90 -0
  126. package/lib/typescript/types/props.d.ts.map +1 -0
  127. package/lib/typescript/utils.d.ts +12 -0
  128. package/lib/typescript/utils.d.ts.map +1 -0
  129. package/package.json +199 -36
  130. package/src/components/ReorderableList/ReorderableList.tsx +117 -0
  131. package/src/components/ReorderableList/constants.ios.ts +3 -0
  132. package/src/components/ReorderableList/constants.ts +3 -0
  133. package/src/components/ReorderableList/index.ts +1 -0
  134. package/src/components/ReorderableList/useReorderableList.ts +489 -0
  135. package/src/components/ReorderableListCell.tsx +138 -0
  136. package/src/components/ReorderableListItem.tsx +108 -0
  137. package/src/components/index.ts +3 -0
  138. package/src/contexts/ReorderableCellContext.ts +14 -0
  139. package/src/contexts/ReorderableListContext.ts +12 -0
  140. package/src/contexts/index.ts +2 -0
  141. package/src/hooks/index.ts +4 -0
  142. package/src/hooks/useContext.ts +11 -0
  143. package/src/hooks/useReorderableDrag.ts +7 -0
  144. package/src/hooks/useReorderableDragEnd.ts +21 -0
  145. package/src/hooks/useReorderableDragStart.ts +18 -0
  146. package/src/index.ts +26 -0
  147. package/src/types/index.ts +2 -0
  148. package/src/types/misc.ts +6 -0
  149. package/src/types/props.ts +101 -0
  150. package/src/utils.ts +15 -0
  151. package/dist/components/ReorderableList.d.ts +0 -7
  152. package/dist/components/ReorderableList.js +0 -314
  153. package/dist/components/ReorderableListItem.d.ts +0 -14
  154. package/dist/components/ReorderableListItem.js +0 -57
  155. package/dist/hooks/useAnimatedSharedValues.d.ts +0 -3
  156. package/dist/hooks/useAnimatedSharedValues.js +0 -33
  157. package/dist/index.d.ts +0 -4
  158. package/dist/index.js +0 -2
  159. package/dist/types/misc.d.ts +0 -15
  160. package/dist/types/misc.js +0 -7
  161. package/dist/types/props.d.ts +0 -29
  162. package/dist/types/props.js +0 -1
@@ -0,0 +1,313 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useReorderableList = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _reactNativeGestureHandler = require("react-native-gesture-handler");
10
+ var _reactNativeReanimated = require("react-native-reanimated");
11
+ var _constants = require("./constants");
12
+ var _types = require("../../types");
13
+ 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); }
14
+ 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; }
15
+ const version = _react.default.version.split('.');
16
+ const hasAutomaticBatching = version.length ? parseInt(version[0], 10) >= 18 : false;
17
+ const useReorderableList = ({
18
+ ref,
19
+ autoscrollThreshold,
20
+ autoscrollSpeedScale,
21
+ autoscrollDelay,
22
+ animationDuration,
23
+ dragReorderThreshold,
24
+ onLayout,
25
+ onReorder,
26
+ onScroll
27
+ }) => {
28
+ const scrollEnabled = (0, _reactNativeReanimated.useSharedValue)(true);
29
+ const flatList = (0, _reactNativeReanimated.useAnimatedRef)();
30
+ const gestureState = (0, _reactNativeReanimated.useSharedValue)(_reactNativeGestureHandler.State.UNDETERMINED);
31
+ const currentY = (0, _reactNativeReanimated.useSharedValue)(0);
32
+ const currentTranslationY = (0, _reactNativeReanimated.useSharedValue)(0);
33
+ const containerPositionY = (0, _reactNativeReanimated.useSharedValue)(0);
34
+ const currentScrollOffsetY = (0, _reactNativeReanimated.useSharedValue)(0);
35
+ const dragScrollTranslationY = (0, _reactNativeReanimated.useSharedValue)(0);
36
+ const dragInitialScrollOffsetY = (0, _reactNativeReanimated.useSharedValue)(0);
37
+ const draggedHeight = (0, _reactNativeReanimated.useSharedValue)(0);
38
+ const itemOffset = (0, _reactNativeReanimated.useSharedValue)([]);
39
+ const itemHeight = (0, _reactNativeReanimated.useSharedValue)([]);
40
+ const topAutoscrollArea = (0, _reactNativeReanimated.useSharedValue)(0);
41
+ const bottomAutoscrollArea = (0, _reactNativeReanimated.useSharedValue)(0);
42
+ const autoscrollTrigger = (0, _reactNativeReanimated.useSharedValue)(-1);
43
+ const lastAutoscrollTrigger = (0, _reactNativeReanimated.useSharedValue)(-1);
44
+ const previousY = (0, _reactNativeReanimated.useSharedValue)(0);
45
+ const dragY = (0, _reactNativeReanimated.useSharedValue)(0);
46
+ const previousDirection = (0, _reactNativeReanimated.useSharedValue)(0);
47
+ const previousIndex = (0, _reactNativeReanimated.useSharedValue)(-1);
48
+ const currentIndex = (0, _reactNativeReanimated.useSharedValue)(-1);
49
+ const draggedIndex = (0, _reactNativeReanimated.useSharedValue)(-1);
50
+ const releasedIndex = (0, _reactNativeReanimated.useSharedValue)(-1);
51
+ const state = (0, _reactNativeReanimated.useSharedValue)(_types.ReorderableListState.IDLE);
52
+
53
+ // animation duration as a shared value allows to avoid re-rendering of all cells on value change
54
+ const duration = (0, _reactNativeReanimated.useSharedValue)(animationDuration);
55
+ if (duration.value !== animationDuration) {
56
+ duration.value = animationDuration;
57
+ }
58
+ const listContextValue = (0, _react.useMemo)(() => ({
59
+ draggedHeight,
60
+ currentIndex,
61
+ draggedIndex
62
+ }), [draggedHeight, currentIndex, draggedIndex]);
63
+ const startY = (0, _reactNativeReanimated.useSharedValue)(0);
64
+ const panGestureHandler = (0, _react.useMemo)(() => _reactNativeGestureHandler.Gesture.Pan().onBegin(e => {
65
+ // prevent new dragging until item is completely released
66
+ if (state.value === _types.ReorderableListState.IDLE) {
67
+ const relativeY = e.absoluteY - containerPositionY.value;
68
+ startY.value = relativeY;
69
+ currentY.value = relativeY;
70
+ currentTranslationY.value = e.translationY;
71
+ if (draggedIndex.value >= 0) {
72
+ dragY.value = e.translationY;
73
+ }
74
+ gestureState.value = e.state;
75
+ }
76
+ }).onUpdate(e => {
77
+ if (state.value !== _types.ReorderableListState.RELEASING) {
78
+ currentY.value = startY.value + e.translationY;
79
+ currentTranslationY.value = e.translationY;
80
+ if (draggedIndex.value >= 0) {
81
+ dragY.value = e.translationY + dragScrollTranslationY.value;
82
+ }
83
+ gestureState.value = e.state;
84
+ }
85
+ }).onEnd(e => gestureState.value = e.state).onFinalize(e => gestureState.value = e.state), [containerPositionY, currentTranslationY, currentY, dragScrollTranslationY, draggedIndex, gestureState, dragY, startY, state]);
86
+ const gestureHandler = (0, _react.useMemo)(() => _reactNativeGestureHandler.Gesture.Simultaneous(_reactNativeGestureHandler.Gesture.Native(), panGestureHandler), [panGestureHandler]);
87
+ const setScrollEnabled = (0, _react.useCallback)(enabled => {
88
+ var _flatList$current;
89
+ scrollEnabled.value = enabled;
90
+ (_flatList$current = flatList.current) === null || _flatList$current === void 0 || _flatList$current.setNativeProps({
91
+ scrollEnabled: enabled
92
+ });
93
+ }, [flatList, scrollEnabled]);
94
+ const resetSharedValues = (0, _react.useCallback)(() => {
95
+ 'worklet';
96
+
97
+ // must be reset before the reorder function is called
98
+ // to avoid triggering on drag end event twice
99
+ releasedIndex.value = -1;
100
+ draggedIndex.value = -1;
101
+ // current index is reset on item render for the on end event
102
+ dragY.value = 0;
103
+ // released flag is reset after release is triggered in the item
104
+ state.value = _types.ReorderableListState.IDLE;
105
+ dragScrollTranslationY.value = 0;
106
+ }, [releasedIndex, draggedIndex, dragY, state, dragScrollTranslationY]);
107
+ const reorder = (fromIndex, toIndex) => {
108
+ (0, _reactNativeReanimated.runOnUI)(resetSharedValues)();
109
+ if (fromIndex !== toIndex) {
110
+ const updateState = () => {
111
+ onReorder({
112
+ from: fromIndex,
113
+ to: toIndex
114
+ });
115
+ };
116
+ if (!hasAutomaticBatching) {
117
+ (0, _reactNative.unstable_batchedUpdates)(updateState);
118
+ } else {
119
+ updateState();
120
+ }
121
+ }
122
+ };
123
+ const getIndexFromY = (0, _react.useCallback)(y => {
124
+ 'worklet';
125
+
126
+ const relativeY = currentScrollOffsetY.value + y;
127
+ const count = itemOffset.value.length;
128
+ for (let i = 0; i < count; i++) {
129
+ if (currentIndex.value === i) {
130
+ continue;
131
+ }
132
+ const direction = i > currentIndex.value ? 1 : -1;
133
+ const threshold = Math.max(0, Math.min(1, dragReorderThreshold));
134
+ const height = itemHeight.value[i];
135
+ const offset = itemOffset.value[i] + height * threshold * direction;
136
+ if (i === 0 && relativeY <= offset || i === count - 1 && relativeY >= offset + height || relativeY >= offset && relativeY <= offset + height) {
137
+ return {
138
+ index: i,
139
+ direction
140
+ };
141
+ }
142
+ }
143
+ return {
144
+ index: currentIndex.value,
145
+ direction: previousDirection.value
146
+ };
147
+ }, [dragReorderThreshold, currentIndex, currentScrollOffsetY, previousDirection, itemOffset, itemHeight]);
148
+ const setCurrentIndex = (0, _react.useCallback)(y => {
149
+ 'worklet';
150
+
151
+ const {
152
+ index: newIndex,
153
+ direction: newDirection
154
+ } = getIndexFromY(y);
155
+ const delta = Math.abs(previousY.value - y);
156
+ if (currentIndex.value !== newIndex && (
157
+ // if the same two items re-swap index check delta and direction to avoid swap flickering
158
+ previousIndex.value !== newIndex || previousDirection.value !== newDirection && delta >= 5)) {
159
+ const itemDirection = newIndex > currentIndex.value;
160
+ const index1 = itemDirection ? currentIndex.value : newIndex;
161
+ const index2 = itemDirection ? newIndex : currentIndex.value;
162
+ const newOffset1 = itemOffset.value[index1];
163
+ const newHeight1 = itemHeight.value[index2];
164
+ const newOffset2 = itemOffset.value[index2] + (itemHeight.value[index2] - itemHeight.value[index1]);
165
+ const newHeight2 = itemHeight.value[index1];
166
+ itemOffset.value[index1] = newOffset1;
167
+ itemHeight.value[index1] = newHeight1;
168
+ itemOffset.value[index2] = newOffset2;
169
+ itemHeight.value[index2] = newHeight2;
170
+ previousY.value = y;
171
+ previousDirection.value = newDirection;
172
+ previousIndex.value = currentIndex.value;
173
+ currentIndex.value = newIndex;
174
+ }
175
+ }, [currentIndex, previousIndex, previousDirection, previousY, itemOffset, itemHeight, getIndexFromY]);
176
+ (0, _reactNativeReanimated.useAnimatedReaction)(() => gestureState.value, () => {
177
+ if (gestureState.value !== _reactNativeGestureHandler.State.ACTIVE && gestureState.value !== _reactNativeGestureHandler.State.BEGAN && (state.value === _types.ReorderableListState.DRAGGING || state.value === _types.ReorderableListState.AUTO_SCROLL)) {
178
+ state.value = _types.ReorderableListState.RELEASING;
179
+ releasedIndex.value = draggedIndex.value;
180
+
181
+ // enable back scroll on releasing
182
+ (0, _reactNativeReanimated.runOnJS)(setScrollEnabled)(true);
183
+
184
+ // they are actually swapped on drag translation
185
+ const currentItemOffset = itemOffset.value[draggedIndex.value];
186
+ const currentItemHeight = itemHeight.value[draggedIndex.value];
187
+ const draggedItemOffset = itemOffset.value[currentIndex.value];
188
+ const draggedItemHeight = itemHeight.value[currentIndex.value];
189
+ const newTopPosition = currentIndex.value > draggedIndex.value ? draggedItemOffset - currentItemOffset : draggedItemOffset - currentItemOffset + (draggedItemHeight - currentItemHeight);
190
+ if (dragY.value !== newTopPosition) {
191
+ // animate dragged item to its new position on release
192
+ dragY.value = (0, _reactNativeReanimated.withTiming)(newTopPosition, {
193
+ duration: duration.value,
194
+ easing: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.ease)
195
+ }, () => {
196
+ (0, _reactNativeReanimated.runOnJS)(reorder)(draggedIndex.value, currentIndex.value);
197
+ });
198
+ } else {
199
+ // user might drag and release the item without moving it so,
200
+ // since the animation end callback is not executed in that case
201
+ // we need to reset values as the reorder function would do
202
+ resetSharedValues();
203
+ }
204
+ }
205
+ });
206
+ (0, _reactNativeReanimated.useAnimatedReaction)(() => currentY.value, y => {
207
+ if (state.value === _types.ReorderableListState.DRAGGING || state.value === _types.ReorderableListState.AUTO_SCROLL) {
208
+ setCurrentIndex(y);
209
+ if (y <= topAutoscrollArea.value || y >= bottomAutoscrollArea.value) {
210
+ if (state.value !== _types.ReorderableListState.AUTO_SCROLL) {
211
+ // trigger autoscroll
212
+ lastAutoscrollTrigger.value = autoscrollTrigger.value;
213
+ autoscrollTrigger.value *= -1;
214
+ }
215
+ state.value = _types.ReorderableListState.AUTO_SCROLL;
216
+ } else {
217
+ state.value = _types.ReorderableListState.DRAGGING;
218
+ }
219
+ }
220
+ });
221
+ (0, _reactNativeReanimated.useAnimatedReaction)(() => autoscrollTrigger.value, () => {
222
+ if (autoscrollTrigger.value !== lastAutoscrollTrigger.value && state.value === _types.ReorderableListState.AUTO_SCROLL) {
223
+ const autoscrollIncrement = (currentY.value <= topAutoscrollArea.value ? -_constants.AUTOSCROLL_INCREMENT : _constants.AUTOSCROLL_INCREMENT) * autoscrollSpeedScale;
224
+ if (autoscrollIncrement !== 0) {
225
+ (0, _reactNativeReanimated.scrollTo)(flatList, 0, currentScrollOffsetY.value + autoscrollIncrement, true);
226
+ }
227
+
228
+ // when autoscrolling user may not be moving his finger so we need
229
+ // to update the current position of the dragged item here
230
+ setCurrentIndex(currentY.value);
231
+ }
232
+ });
233
+ const handleScroll = (0, _reactNativeReanimated.useAnimatedScrollHandler)(e => {
234
+ currentScrollOffsetY.value = e.contentOffset.y;
235
+
236
+ // checking if the list is not scrollable instead of the scrolling state
237
+ // fixes a bug on iOS where the item is shifted after autoscrolling and then
238
+ // moving await from autoscroll area
239
+ if (!scrollEnabled.value) {
240
+ dragScrollTranslationY.value = currentScrollOffsetY.value - dragInitialScrollOffsetY.value;
241
+ }
242
+ if (state.value === _types.ReorderableListState.AUTO_SCROLL) {
243
+ dragY.value = currentTranslationY.value + dragScrollTranslationY.value;
244
+ (0, _reactNativeReanimated.cancelAnimation)(autoscrollTrigger);
245
+ lastAutoscrollTrigger.value = autoscrollTrigger.value;
246
+ autoscrollTrigger.value = (0, _reactNativeReanimated.withDelay)(autoscrollDelay, (0, _reactNativeReanimated.withTiming)(autoscrollTrigger.value * -1, {
247
+ duration: 0
248
+ }));
249
+ } else {}
250
+ if (onScroll) {
251
+ onScroll(e);
252
+ }
253
+ });
254
+ const startDrag = (0, _react.useCallback)(index => {
255
+ 'worklet';
256
+
257
+ // allow new drag when item is completely released
258
+ if (state.value === _types.ReorderableListState.IDLE) {
259
+ draggedHeight.value = itemHeight.value[index];
260
+ draggedIndex.value = index;
261
+ previousIndex.value = -1;
262
+ currentIndex.value = index;
263
+ state.value = _types.ReorderableListState.DRAGGING;
264
+ dragInitialScrollOffsetY.value = currentScrollOffsetY.value;
265
+ (0, _reactNativeReanimated.runOnJS)(setScrollEnabled)(false);
266
+ }
267
+ }, [setScrollEnabled, currentIndex, previousIndex, draggedHeight, draggedIndex, state, currentScrollOffsetY, dragInitialScrollOffsetY, itemHeight]);
268
+ const measureFlatList = (0, _react.useCallback)(() => {
269
+ 'worklet';
270
+
271
+ const measurement = (0, _reactNativeReanimated.measure)(flatList);
272
+ if (measurement === null) {
273
+ return;
274
+ }
275
+ containerPositionY.value = measurement.pageY;
276
+ }, [flatList, containerPositionY]);
277
+ const handleFlatListLayout = (0, _react.useCallback)(e => {
278
+ (0, _reactNativeReanimated.runOnUI)(measureFlatList)();
279
+ const threshold = Math.max(0, Math.min(autoscrollThreshold, 0.4));
280
+ const {
281
+ height
282
+ } = e.nativeEvent.layout;
283
+ topAutoscrollArea.value = height * threshold;
284
+ bottomAutoscrollArea.value = height * (1 - threshold);
285
+ if (onLayout) {
286
+ onLayout(e);
287
+ }
288
+ }, [measureFlatList, topAutoscrollArea, bottomAutoscrollArea, autoscrollThreshold, onLayout]);
289
+ const handleRef = value => {
290
+ flatList(value);
291
+ if (typeof ref === 'function') {
292
+ ref(value);
293
+ } else if (ref) {
294
+ ref.current = value;
295
+ }
296
+ };
297
+ return {
298
+ gestureHandler,
299
+ handleScroll,
300
+ handleFlatListLayout,
301
+ handleRef,
302
+ startDrag,
303
+ listContextValue,
304
+ itemOffset,
305
+ itemHeight,
306
+ draggedIndex,
307
+ releasedIndex,
308
+ dragY,
309
+ duration
310
+ };
311
+ };
312
+ exports.useReorderableList = useReorderableList;
313
+ //# sourceMappingURL=useReorderableList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeGestureHandler","_reactNativeReanimated","_constants","_types","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","version","React","split","hasAutomaticBatching","length","parseInt","useReorderableList","ref","autoscrollThreshold","autoscrollSpeedScale","autoscrollDelay","animationDuration","dragReorderThreshold","onLayout","onReorder","onScroll","scrollEnabled","useSharedValue","flatList","useAnimatedRef","gestureState","State","UNDETERMINED","currentY","currentTranslationY","containerPositionY","currentScrollOffsetY","dragScrollTranslationY","dragInitialScrollOffsetY","draggedHeight","itemOffset","itemHeight","topAutoscrollArea","bottomAutoscrollArea","autoscrollTrigger","lastAutoscrollTrigger","previousY","dragY","previousDirection","previousIndex","currentIndex","draggedIndex","releasedIndex","state","ReorderableListState","IDLE","duration","value","listContextValue","useMemo","startY","panGestureHandler","Gesture","Pan","onBegin","relativeY","absoluteY","translationY","onUpdate","RELEASING","onEnd","onFinalize","gestureHandler","Simultaneous","Native","setScrollEnabled","useCallback","enabled","_flatList$current","current","setNativeProps","resetSharedValues","reorder","fromIndex","toIndex","runOnUI","updateState","from","to","unstable_batchedUpdates","getIndexFromY","y","count","direction","threshold","Math","max","min","height","offset","index","setCurrentIndex","newIndex","newDirection","delta","abs","itemDirection","index1","index2","newOffset1","newHeight1","newOffset2","newHeight2","useAnimatedReaction","ACTIVE","BEGAN","DRAGGING","AUTO_SCROLL","runOnJS","currentItemOffset","currentItemHeight","draggedItemOffset","draggedItemHeight","newTopPosition","withTiming","easing","Easing","out","ease","autoscrollIncrement","AUTOSCROLL_INCREMENT","scrollTo","handleScroll","useAnimatedScrollHandler","contentOffset","cancelAnimation","withDelay","startDrag","measureFlatList","measurement","measure","pageY","handleFlatListLayout","nativeEvent","layout","handleRef","exports"],"sourceRoot":"../../../../src","sources":["components/ReorderableList/useReorderableList.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,0BAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AAgBA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,MA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,CAAC;IAE1B,MAAM5C,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,GAAG,CAAC/E,mBAAmB,EAAE,GAAG,CAAC,CAAC;IACjE,MAAM;MAACgF;IAAM,CAAC,GAAG3G,CAAC,CAACwJ,WAAW,CAACC,MAAM;IAErCtG,iBAAiB,CAACe,KAAK,GAAGyC,MAAM,GAAGJ,SAAS;IAC5CnD,oBAAoB,CAACc,KAAK,GAAGyC,MAAM,IAAI,CAAC,GAAGJ,SAAS,CAAC;IAErD,IAAIvE,QAAQ,EAAE;MACZA,QAAQ,CAAChC,CAAC,CAAC;IACb;EACF,CAAC,EACD,CACEmJ,eAAe,EACfhG,iBAAiB,EACjBC,oBAAoB,EACpBzB,mBAAmB,EACnBK,QAAQ,CAEZ,CAAC;EAED,MAAM0H,SAAS,GAAIxF,KAAkB,IAAK;IACxC7B,QAAQ,CAAC6B,KAAK,CAAC;IAEf,IAAI,OAAOxC,GAAG,KAAK,UAAU,EAAE;MAC7BA,GAAG,CAACwC,KAAK,CAAC;IACZ,CAAC,MAAM,IAAIxC,GAAG,EAAE;MACdA,GAAG,CAAC8D,OAAO,GAAGtB,KAAK;IACrB;EACF,CAAC;EAED,OAAO;IACLe,cAAc;IACd4D,YAAY;IACZU,oBAAoB;IACpBG,SAAS;IACTR,SAAS;IACT/E,gBAAgB;IAChBlB,UAAU;IACVC,UAAU;IACVU,YAAY;IACZC,aAAa;IACbL,KAAK;IACLS;EACF,CAAC;AACH,CAAC;AAAC0F,OAAA,CAAAlI,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ReorderableListCell = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
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
+ const ReorderableListCell = exports.ReorderableListCell = /*#__PURE__*/(0, _react.memo)(({
14
+ index,
15
+ startDrag,
16
+ children,
17
+ onLayout,
18
+ itemOffset,
19
+ itemHeight,
20
+ dragY,
21
+ draggedIndex,
22
+ releasedIndex,
23
+ animationDuration
24
+ }) => {
25
+ const dragHandler = (0, _react.useCallback)(() => {
26
+ 'worklet';
27
+
28
+ startDrag(index);
29
+ }, [startDrag, index]);
30
+ const contextValue = (0, _react.useMemo)(() => ({
31
+ index,
32
+ dragHandler,
33
+ draggedIndex,
34
+ releasedIndex
35
+ }), [index, dragHandler, draggedIndex, releasedIndex]);
36
+ const {
37
+ currentIndex,
38
+ draggedHeight
39
+ } = (0, _hooks.useContext)(_contexts.ReorderableListContext);
40
+ const itemZIndex = (0, _reactNativeReanimated.useSharedValue)(0);
41
+ const itemPositionY = (0, _reactNativeReanimated.useSharedValue)(0);
42
+ const itemDragY = (0, _reactNativeReanimated.useSharedValue)(0);
43
+ const itemIndex = (0, _reactNativeReanimated.useSharedValue)(index);
44
+ (0, _reactNativeReanimated.useAnimatedReaction)(() => dragY.value, () => {
45
+ if (itemIndex.value === draggedIndex.value && currentIndex.value >= 0 && draggedIndex.value >= 0) {
46
+ itemDragY.value = dragY.value;
47
+ }
48
+ });
49
+ (0, _reactNativeReanimated.useAnimatedReaction)(() => currentIndex.value, () => {
50
+ if (itemIndex.value !== draggedIndex.value && currentIndex.value >= 0 && draggedIndex.value >= 0) {
51
+ const moveDown = currentIndex.value > draggedIndex.value;
52
+ const startMove = Math.min(draggedIndex.value, currentIndex.value);
53
+ const endMove = Math.max(draggedIndex.value, currentIndex.value);
54
+ let newValue = 0;
55
+ if (itemIndex.value >= startMove && itemIndex.value <= endMove) {
56
+ newValue = moveDown ? -draggedHeight.value : draggedHeight.value;
57
+ }
58
+ if (newValue !== itemPositionY.value) {
59
+ itemPositionY.value = (0, _reactNativeReanimated.withTiming)(newValue, {
60
+ duration: animationDuration.value,
61
+ easing: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.ease)
62
+ });
63
+ }
64
+ }
65
+ });
66
+ (0, _reactNativeReanimated.useAnimatedReaction)(() => draggedIndex.value === index, newValue => {
67
+ itemZIndex.value = newValue ? 999 : 0;
68
+ });
69
+ const animatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
70
+ zIndex: itemZIndex.value,
71
+ transform: [{
72
+ translateY: itemDragY.value
73
+ }, {
74
+ translateY: itemPositionY.value
75
+ }]
76
+ }));
77
+ const handleLayout = e => {
78
+ (0, _reactNativeReanimated.runOnUI)((y, height) => {
79
+ itemOffset.value[index] = y;
80
+ itemHeight.value[index] = height;
81
+ })(e.nativeEvent.layout.y, e.nativeEvent.layout.height);
82
+ if (onLayout) {
83
+ onLayout(e);
84
+ }
85
+ };
86
+ return /*#__PURE__*/_react.default.createElement(_contexts.ReorderableCellContext.Provider, {
87
+ value: contextValue
88
+ }, /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.View, {
89
+ style: animatedStyle,
90
+ onLayout: handleLayout
91
+ }, children));
92
+ });
93
+ //# sourceMappingURL=ReorderableListCell.js.map
@@ -0,0 +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","releasedIndex","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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CACgB,CAAC;AAEtC,CACF,CAAC","ignoreList":[]}
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ReorderableListItem = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
9
+ var _hooks = require("../hooks");
10
+ 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); }
11
+ 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; }
12
+ 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); }
13
+ const scaleDefaultConfig = {
14
+ enabled: true,
15
+ valueEnd: 1,
16
+ valueStart: 1.025,
17
+ easingStart: _reactNativeReanimated.Easing.in(_reactNativeReanimated.Easing.ease),
18
+ easingEnd: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.ease),
19
+ duration: 200
20
+ };
21
+ const opacityDefaultConfig = {
22
+ enabled: true,
23
+ valueEnd: 1,
24
+ valueStart: 0.75,
25
+ easingStart: _reactNativeReanimated.Easing.in(_reactNativeReanimated.Easing.ease),
26
+ easingEnd: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.ease),
27
+ duration: 200
28
+ };
29
+ const ReorderableListItem = ({
30
+ scaleAnimationConfig = scaleDefaultConfig,
31
+ opacityAnimationConfig = opacityDefaultConfig,
32
+ ...rest
33
+ }) => {
34
+ const scaleConfigWithDefaults = (0, _react.useMemo)(() => ({
35
+ ...scaleDefaultConfig,
36
+ ...scaleAnimationConfig
37
+ }), [scaleAnimationConfig]);
38
+ const opacityConfigWithDefaults = (0, _react.useMemo)(() => ({
39
+ ...opacityDefaultConfig,
40
+ ...opacityAnimationConfig
41
+ }), [opacityAnimationConfig]);
42
+ const scale = (0, _reactNativeReanimated.useSharedValue)(scaleConfigWithDefaults.enabled ? scaleConfigWithDefaults.valueEnd : 1);
43
+ const opacity = (0, _reactNativeReanimated.useSharedValue)(opacityConfigWithDefaults.enabled ? opacityConfigWithDefaults.valueEnd : 1);
44
+ (0, _hooks.useReorderableDragStart)((0, _react.useCallback)(() => {
45
+ 'worklet';
46
+
47
+ if (scaleConfigWithDefaults.enabled) {
48
+ scale.value = (0, _reactNativeReanimated.withTiming)(scaleConfigWithDefaults.valueStart, {
49
+ easing: scaleConfigWithDefaults.easingStart,
50
+ duration: scaleConfigWithDefaults.duration
51
+ });
52
+ }
53
+ if (opacityConfigWithDefaults.enabled) {
54
+ opacity.value = (0, _reactNativeReanimated.withTiming)(opacityConfigWithDefaults.valueStart, {
55
+ easing: opacityConfigWithDefaults.easingStart,
56
+ duration: opacityConfigWithDefaults.duration
57
+ });
58
+ }
59
+ }, [opacity, scale, opacityConfigWithDefaults, scaleConfigWithDefaults]));
60
+ (0, _hooks.useReorderableDragEnd)((0, _react.useCallback)(() => {
61
+ 'worklet';
62
+
63
+ if (scaleConfigWithDefaults.enabled) {
64
+ scale.value = (0, _reactNativeReanimated.withTiming)(scaleConfigWithDefaults.valueEnd, {
65
+ easing: scaleConfigWithDefaults.easingEnd,
66
+ duration: scaleConfigWithDefaults.duration
67
+ });
68
+ }
69
+ if (opacityConfigWithDefaults.enabled) {
70
+ opacity.value = (0, _reactNativeReanimated.withTiming)(opacityConfigWithDefaults.valueEnd, {
71
+ easing: opacityConfigWithDefaults.easingEnd,
72
+ duration: opacityConfigWithDefaults.duration
73
+ });
74
+ }
75
+ }, [opacity, scale, opacityConfigWithDefaults, scaleConfigWithDefaults]));
76
+ const animatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
77
+ transform: [{
78
+ scale: scale.value
79
+ }],
80
+ opacity: opacity.value
81
+ }), [scale, opacity]);
82
+ return /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.View, _extends({}, rest, {
83
+ style: [animatedStyle, rest.style]
84
+ }));
85
+ };
86
+ exports.ReorderableListItem = ReorderableListItem;
87
+ //# sourceMappingURL=ReorderableListItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeReanimated","_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","scaleDefaultConfig","enabled","valueEnd","valueStart","easingStart","Easing","in","ease","easingEnd","out","duration","opacityDefaultConfig","ReorderableListItem","scaleAnimationConfig","opacityAnimationConfig","rest","scaleConfigWithDefaults","useMemo","opacityConfigWithDefaults","scale","useSharedValue","opacity","useReorderableDragStart","useCallback","value","withTiming","easing","useReorderableDragEnd","animatedStyle","useAnimatedStyle","transform","createElement","View","style","exports"],"sourceRoot":"../../../src","sources":["components/ReorderableListItem.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,sBAAA,GAAAF,uBAAA,CAAAC,OAAA;AAOA,IAAAE,MAAA,GAAAF,OAAA;AAAwE,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAA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F,uBAAuB,CAAC,CACzE,CAAC;EAED,MAAMY,aAAa,GAAG,IAAAC,uCAAgB,EACpC,OAAO;IACLC,SAAS,EAAE,CACT;MACEX,KAAK,EAAEA,KAAK,CAACK;IACf,CAAC,CACF;IACDH,OAAO,EAAEA,OAAO,CAACG;EACnB,CAAC,CAAC,EACF,CAACL,KAAK,EAAEE,OAAO,CACjB,CAAC;EAED,oBAAOpD,MAAA,CAAAW,OAAA,CAAAmD,aAAA,CAAC3D,sBAAA,CAAAQ,OAAQ,CAACoD,IAAI,EAAAtC,QAAA,KAAKqB,IAAI;IAAEkB,KAAK,EAAE,CAACL,aAAa,EAAEb,IAAI,CAACkB,KAAK;EAAE,EAAE,CAAC;AACxE,CAAC;AAACC,OAAA,CAAAtB,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _ReorderableList = require("./ReorderableList");
7
+ Object.keys(_ReorderableList).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _ReorderableList[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _ReorderableList[key];
14
+ }
15
+ });
16
+ });
17
+ var _ReorderableListCell = require("./ReorderableListCell");
18
+ Object.keys(_ReorderableListCell).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _ReorderableListCell[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _ReorderableListCell[key];
25
+ }
26
+ });
27
+ });
28
+ var _ReorderableListItem = require("./ReorderableListItem");
29
+ Object.keys(_ReorderableListItem).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _ReorderableListItem[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _ReorderableListItem[key];
36
+ }
37
+ });
38
+ });
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_ReorderableList","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_ReorderableListCell","_ReorderableListItem"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,gBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,gBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,oBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,oBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,oBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,oBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,oBAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,oBAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,oBAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,oBAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ReorderableCellContext = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const ReorderableCellContext = exports.ReorderableCellContext = /*#__PURE__*/_react.default.createContext(undefined);
10
+ //# sourceMappingURL=ReorderableCellContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","e","__esModule","default","ReorderableCellContext","exports","React","createContext","undefined"],"sourceRoot":"../../../src","sources":["contexts/ReorderableCellContext.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAWnB,MAAMG,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,gBAAGE,cAAK,CAACC,aAAa,CAEvDC,SAAS,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ReorderableListContext = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const ReorderableListContext = exports.ReorderableListContext = /*#__PURE__*/_react.default.createContext(undefined);
10
+ //# sourceMappingURL=ReorderableListContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","e","__esModule","default","ReorderableListContext","exports","React","createContext","undefined"],"sourceRoot":"../../../src","sources":["contexts/ReorderableListContext.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AASnB,MAAMG,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,gBAAGE,cAAK,CAACC,aAAa,CAEvDC,SAAS,CAAC","ignoreList":[]}