react-native-wagmi-charts 2.0.1 → 2.1.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/README.md +30 -1
- package/example/.DS_Store +0 -0
- package/example/package.json +11 -13
- package/example/src/App.tsx +39 -34
- package/example/src/LineChart.tsx +2 -1
- package/example/yarn.lock +1819 -8871
- package/lib/commonjs/charts/candle/HoverTrap/index.web.js +120 -0
- package/lib/commonjs/charts/candle/HoverTrap/index.web.js.map +1 -0
- package/lib/commonjs/charts/line/ChartPath.js +8 -3
- package/lib/commonjs/charts/line/ChartPath.js.map +1 -1
- package/lib/commonjs/charts/line/HoverTrap/index.js +15 -0
- package/lib/commonjs/charts/line/HoverTrap/index.js.map +1 -0
- package/lib/commonjs/charts/line/HoverTrap/index.web.js +120 -0
- package/lib/commonjs/charts/line/HoverTrap/index.web.js.map +1 -0
- package/lib/commonjs/charts/line/index.js +4 -1
- package/lib/commonjs/charts/line/index.js.map +1 -1
- package/lib/commonjs/components/AnimatedText.js +3 -5
- package/lib/commonjs/components/AnimatedText.js.map +1 -1
- package/lib/module/charts/candle/HoverTrap/index.web.js +101 -0
- package/lib/module/charts/candle/HoverTrap/index.web.js.map +1 -0
- package/lib/module/charts/line/ChartPath.js +8 -3
- package/lib/module/charts/line/ChartPath.js.map +1 -1
- package/lib/module/charts/line/HoverTrap/index.js +3 -0
- package/lib/module/charts/line/HoverTrap/index.js.map +1 -0
- package/lib/module/charts/line/HoverTrap/index.web.js +101 -0
- package/lib/module/charts/line/HoverTrap/index.web.js.map +1 -0
- package/lib/module/charts/line/index.js +3 -1
- package/lib/module/charts/line/index.js.map +1 -1
- package/lib/module/components/AnimatedText.js +2 -5
- package/lib/module/components/AnimatedText.js.map +1 -1
- package/lib/typescript/src/charts/candle/HoverTrap/index.web.d.ts +2 -0
- package/lib/typescript/src/charts/line/ChartPath.d.ts +3 -3
- package/lib/typescript/src/charts/line/HoverTrap/index.d.ts +2 -0
- package/lib/typescript/src/charts/line/HoverTrap/index.web.d.ts +2 -0
- package/lib/typescript/src/charts/line/index.d.ts +2 -0
- package/package.json +5 -5
- package/src/charts/candle/HoverTrap/index.web.tsx +110 -0
- package/src/charts/line/ChartPath.tsx +19 -14
- package/src/charts/line/HoverTrap/index.tsx +3 -0
- package/src/charts/line/HoverTrap/index.web.tsx +110 -0
- package/src/charts/line/index.ts +2 -0
- package/src/components/AnimatedText.tsx +2 -5
- package/tsconfig.json +1 -1
- package/yarn.lock +1840 -796
- package/example/patches/react-native-reanimated+2.2.2.patch +0 -28
package/src/charts/line/index.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { LineChartDatetimeText } from './DatetimeText';
|
|
|
15
15
|
import { useLineChartDatetime } from './useDatetime';
|
|
16
16
|
import { useLineChartPrice } from './usePrice';
|
|
17
17
|
import { useLineChart } from './useLineChart';
|
|
18
|
+
import { LineChartHoverTrap } from '../line/HoverTrap';
|
|
18
19
|
|
|
19
20
|
export * from './Chart';
|
|
20
21
|
export * from './ChartPath';
|
|
@@ -52,4 +53,5 @@ export const LineChart = Object.assign(_LineChart, {
|
|
|
52
53
|
useDatetime: useLineChartDatetime,
|
|
53
54
|
usePrice: useLineChartPrice,
|
|
54
55
|
useChart: useLineChart,
|
|
56
|
+
HoverTrap: LineChartHoverTrap,
|
|
55
57
|
});
|
|
@@ -18,7 +18,7 @@ interface AnimatedTextProps {
|
|
|
18
18
|
const AnimatedTextInput = Animated.createAnimatedComponent(TextInput);
|
|
19
19
|
|
|
20
20
|
export const AnimatedText = ({ text, style }: AnimatedTextProps) => {
|
|
21
|
-
const inputRef = React.useRef<
|
|
21
|
+
const inputRef = React.useRef<any>(null); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
22
22
|
|
|
23
23
|
if (Platform.OS === 'web') {
|
|
24
24
|
// For some reason, the worklet reaction evaluates upfront regardless of any
|
|
@@ -33,10 +33,7 @@ export const AnimatedText = ({ text, style }: AnimatedTextProps) => {
|
|
|
33
33
|
},
|
|
34
34
|
(data, prevData) => {
|
|
35
35
|
if (data !== prevData && inputRef.current) {
|
|
36
|
-
inputRef.current.
|
|
37
|
-
value: data,
|
|
38
|
-
style,
|
|
39
|
-
});
|
|
36
|
+
inputRef.current.value = data;
|
|
40
37
|
}
|
|
41
38
|
}
|
|
42
39
|
);
|
package/tsconfig.json
CHANGED