@legendapp/list 1.1.4 → 2.0.0-beta.0
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/.DS_Store +0 -0
- package/animated.d.mts +3 -64
- package/animated.d.ts +3 -64
- package/animated.js +2 -2
- package/animated.mjs +2 -2
- package/index.d.mts +172 -322
- package/index.d.ts +172 -322
- package/index.js +2276 -1779
- package/index.mjs +2252 -1755
- package/keyboard-controller.d.mts +7 -256
- package/keyboard-controller.d.ts +7 -256
- package/keyboard-controller.js +4 -4
- package/keyboard-controller.mjs +4 -4
- package/package.json +1 -1
- package/reanimated.d.mts +2 -2
- package/reanimated.d.ts +2 -2
- package/reanimated.js +24 -22
- package/reanimated.mjs +25 -23
package/reanimated.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var list = require('@legendapp/list');
|
|
4
3
|
var React = require('react');
|
|
5
4
|
var Animated = require('react-native-reanimated');
|
|
5
|
+
var list = require('@legendapp/list');
|
|
6
6
|
|
|
7
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
8
|
|
|
9
9
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
10
10
|
var Animated__default = /*#__PURE__*/_interopDefault(Animated);
|
|
11
11
|
|
|
12
|
-
// src/reanimated.tsx
|
|
12
|
+
// src/integrations/reanimated.tsx
|
|
13
13
|
|
|
14
|
-
// src/helpers.ts
|
|
14
|
+
// src/utils/helpers.ts
|
|
15
15
|
function isFunction(obj) {
|
|
16
16
|
return typeof obj === "function";
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
// src/useCombinedRef.ts
|
|
19
|
+
// src/hooks/useCombinedRef.ts
|
|
20
20
|
var useCombinedRef = (...refs) => {
|
|
21
21
|
const callback = React.useCallback((element) => {
|
|
22
22
|
for (const ref of refs) {
|
|
@@ -33,26 +33,28 @@ var useCombinedRef = (...refs) => {
|
|
|
33
33
|
return callback;
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
// src/reanimated.tsx
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
ref: (r) => {
|
|
36
|
+
// src/integrations/reanimated.tsx
|
|
37
|
+
var typedMemo = React.memo;
|
|
38
|
+
var LegendListForwardedRef = typedMemo(
|
|
39
|
+
React__default.default.forwardRef(function LegendListForwardedRef2(props, ref) {
|
|
40
|
+
const { refLegendList, ...rest } = props;
|
|
41
|
+
const refFn = React.useCallback(
|
|
42
|
+
(r) => {
|
|
44
43
|
refLegendList(r);
|
|
45
44
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
})
|
|
45
|
+
[refLegendList]
|
|
46
|
+
);
|
|
47
|
+
return /* @__PURE__ */ React__default.default.createElement(list.LegendList, { ref: refFn, refScrollView: ref, ...rest });
|
|
48
|
+
})
|
|
49
|
+
);
|
|
50
50
|
var AnimatedLegendListComponent = Animated__default.default.createAnimatedComponent(LegendListForwardedRef);
|
|
51
|
-
var AnimatedLegendList =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
});
|
|
51
|
+
var AnimatedLegendList = typedMemo(
|
|
52
|
+
React__default.default.forwardRef(function AnimatedLegendList2(props, ref) {
|
|
53
|
+
const { refScrollView, ...rest } = props;
|
|
54
|
+
const refLegendList = React__default.default.useRef(null);
|
|
55
|
+
const combinedRef = useCombinedRef(refLegendList, ref);
|
|
56
|
+
return /* @__PURE__ */ React__default.default.createElement(AnimatedLegendListComponent, { ref: refScrollView, refLegendList: combinedRef, ...rest });
|
|
57
|
+
})
|
|
58
|
+
);
|
|
57
59
|
|
|
58
60
|
exports.AnimatedLegendList = AnimatedLegendList;
|
package/reanimated.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, { useCallback } from 'react';
|
|
1
|
+
import React, { useCallback, memo } from 'react';
|
|
3
2
|
import Animated from 'react-native-reanimated';
|
|
3
|
+
import { LegendList } from '@legendapp/list';
|
|
4
4
|
|
|
5
|
-
// src/reanimated.tsx
|
|
5
|
+
// src/integrations/reanimated.tsx
|
|
6
6
|
|
|
7
|
-
// src/helpers.ts
|
|
7
|
+
// src/utils/helpers.ts
|
|
8
8
|
function isFunction(obj) {
|
|
9
9
|
return typeof obj === "function";
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
// src/useCombinedRef.ts
|
|
12
|
+
// src/hooks/useCombinedRef.ts
|
|
13
13
|
var useCombinedRef = (...refs) => {
|
|
14
14
|
const callback = useCallback((element) => {
|
|
15
15
|
for (const ref of refs) {
|
|
@@ -26,26 +26,28 @@ var useCombinedRef = (...refs) => {
|
|
|
26
26
|
return callback;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
// src/reanimated.tsx
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
ref: (r) => {
|
|
29
|
+
// src/integrations/reanimated.tsx
|
|
30
|
+
var typedMemo = memo;
|
|
31
|
+
var LegendListForwardedRef = typedMemo(
|
|
32
|
+
React.forwardRef(function LegendListForwardedRef2(props, ref) {
|
|
33
|
+
const { refLegendList, ...rest } = props;
|
|
34
|
+
const refFn = useCallback(
|
|
35
|
+
(r) => {
|
|
37
36
|
refLegendList(r);
|
|
38
37
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})
|
|
38
|
+
[refLegendList]
|
|
39
|
+
);
|
|
40
|
+
return /* @__PURE__ */ React.createElement(LegendList, { ref: refFn, refScrollView: ref, ...rest });
|
|
41
|
+
})
|
|
42
|
+
);
|
|
43
43
|
var AnimatedLegendListComponent = Animated.createAnimatedComponent(LegendListForwardedRef);
|
|
44
|
-
var AnimatedLegendList =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
});
|
|
44
|
+
var AnimatedLegendList = typedMemo(
|
|
45
|
+
React.forwardRef(function AnimatedLegendList2(props, ref) {
|
|
46
|
+
const { refScrollView, ...rest } = props;
|
|
47
|
+
const refLegendList = React.useRef(null);
|
|
48
|
+
const combinedRef = useCombinedRef(refLegendList, ref);
|
|
49
|
+
return /* @__PURE__ */ React.createElement(AnimatedLegendListComponent, { ref: refScrollView, refLegendList: combinedRef, ...rest });
|
|
50
|
+
})
|
|
51
|
+
);
|
|
50
52
|
|
|
51
53
|
export { AnimatedLegendList };
|