@lincle/react-native-interactive 0.4.0-next.10 → 0.4.0-next.12
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.
|
@@ -3,7 +3,7 @@ import { Marker, useConnections } from '../../../shared';
|
|
|
3
3
|
import { Path } from '../../Edge';
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import { StyleSheet } from 'react-native';
|
|
6
|
-
import { Defs, Svg } from 'react-native-svg';
|
|
6
|
+
import { Defs, G, Svg } from 'react-native-svg';
|
|
7
7
|
const { svgStyle } = StyleSheet.create({
|
|
8
8
|
svgStyle: {
|
|
9
9
|
overflow: 'visible',
|
|
@@ -34,7 +34,7 @@ const Connections = ({ scale = 1, translate = {
|
|
|
34
34
|
translate.y,
|
|
35
35
|
scale
|
|
36
36
|
]);
|
|
37
|
-
return (
|
|
37
|
+
return (_jsx(Svg, { style: svgStyle, children: _jsxs(G, { transform: translateXYZ, children: [_jsx(Defs, { children: _jsx(Marker, {}) }), paths] }) }));
|
|
38
38
|
};
|
|
39
39
|
Connections.displayName = 'LincleInteractiveConnections';
|
|
40
40
|
export default Connections;
|
|
@@ -30,7 +30,7 @@ const PullNode = ({ disabled, height = 0, line = 'direct', onDrag, onEdgeDrop: g
|
|
|
30
30
|
onStart
|
|
31
31
|
]);
|
|
32
32
|
const handleDrag = useCallback((event, gestureState) => {
|
|
33
|
-
var _a, _b
|
|
33
|
+
var _a, _b;
|
|
34
34
|
if (!mouseOffset.current) {
|
|
35
35
|
mouseOffset.current = {
|
|
36
36
|
x: event.nativeEvent.locationX,
|
|
@@ -39,8 +39,8 @@ const PullNode = ({ disabled, height = 0, line = 'direct', onDrag, onEdgeDrop: g
|
|
|
39
39
|
}
|
|
40
40
|
if (!disabled) {
|
|
41
41
|
position.current = {
|
|
42
|
-
x:
|
|
43
|
-
y:
|
|
42
|
+
x: x + gestureState.dx + ((_a = mouseOffset.current) === null || _a === void 0 ? void 0 : _a.x),
|
|
43
|
+
y: y + gestureState.dy + ((_b = mouseOffset.current) === null || _b === void 0 ? void 0 : _b.y)
|
|
44
44
|
};
|
|
45
45
|
setConnection({
|
|
46
46
|
line,
|
|
@@ -8,7 +8,7 @@ const emptySnap = [
|
|
|
8
8
|
1
|
|
9
9
|
];
|
|
10
10
|
const Node = ({ children, height: givenHeight, id, line: givenLine, mode: givenMode, move: givenMove, onDrag, onEdgeDrop: givenOnEdgeDrop, onSelect: givenOnSelect, onStart, onStop, pull: givenPull, shape: givenShape, style, width: givenWidth, x, y }) => {
|
|
11
|
-
var _a
|
|
11
|
+
var _a;
|
|
12
12
|
const defaultHeight = useDefaultNodeHeight();
|
|
13
13
|
const defaultLine = useDefaultLine();
|
|
14
14
|
const defaultShape = useDefaultShape();
|
|
@@ -125,7 +125,9 @@ const Node = ({ children, height: givenHeight, id, line: givenLine, mode: givenM
|
|
|
125
125
|
x,
|
|
126
126
|
y
|
|
127
127
|
]);
|
|
128
|
-
return (_jsxs(_Fragment, { children: [_jsx(MoveNode, { disabled:
|
|
128
|
+
return (_jsxs(_Fragment, { children: [_jsx(MoveNode, { disabled: mode === 'pull' ?
|
|
129
|
+
true :
|
|
130
|
+
!move, height: height, id: id, mode: mode, onDrag: handleMoveDrag, onSelect: onSelect, onStart: handleMoveStart, onStop: handleMoveStop, shape: shape, snap: snap, style: style, width: width, x: snapper.x, y: snapper.y, children: children }), pullNode] }));
|
|
129
131
|
};
|
|
130
132
|
Node.displayName = 'LincleInteractiveNode';
|
|
131
133
|
export { Node };
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@lincle/react-native-interactive",
|
|
3
3
|
"title": "lincle react native interactive",
|
|
4
4
|
"license": "LGPL-3.0-or-later",
|
|
5
|
-
"version": "0.4.0-next.
|
|
5
|
+
"version": "0.4.0-next.12",
|
|
6
6
|
"private": false,
|
|
7
7
|
"description": "A 'reactive' React node and edge generator",
|
|
8
8
|
"author": "wallzero @wallzeroblog (http://wallzero.com)",
|
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
"clean:dist": "rimraf dist"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@digest/eslint-config-jest": "^4.
|
|
47
|
-
"@digest/eslint-config-react": "^4.
|
|
48
|
-
"@digest/eslint-config-typescript": "^4.
|
|
49
|
-
"@digest/jest-junit": "^4.
|
|
50
|
-
"@digest/jest-react": "^4.
|
|
51
|
-
"@digest/jest-typescript": "^4.
|
|
52
|
-
"@digest/typescript": "^4.
|
|
46
|
+
"@digest/eslint-config-jest": "^4.8.2",
|
|
47
|
+
"@digest/eslint-config-react": "^4.8.2",
|
|
48
|
+
"@digest/eslint-config-typescript": "^4.8.2",
|
|
49
|
+
"@digest/jest-junit": "^4.8.2",
|
|
50
|
+
"@digest/jest-react": "^4.8.2",
|
|
51
|
+
"@digest/jest-typescript": "^4.8.2",
|
|
52
|
+
"@digest/typescript": "^4.8.2",
|
|
53
53
|
"@openspacelabs/react-native-zoomable-view": "^2.1.6",
|
|
54
|
-
"@types/jest": "^29.5.
|
|
55
|
-
"@types/node": "^22.
|
|
56
|
-
"@types/react": "^18.3.
|
|
54
|
+
"@types/jest": "^29.5.13",
|
|
55
|
+
"@types/node": "^22.7.4",
|
|
56
|
+
"@types/react": "^18.3.10",
|
|
57
57
|
"@types/react-native": "^0.73.0",
|
|
58
58
|
"@types/react-test-renderer": "^18.3.0",
|
|
59
59
|
"cross-env": "^7.0.3",
|
|
@@ -64,15 +64,15 @@
|
|
|
64
64
|
"react": "^18.3.1",
|
|
65
65
|
"react-native": "^0.74.5",
|
|
66
66
|
"react-native-draggable": "^3.3.0",
|
|
67
|
-
"react-native-reanimated": "^3.
|
|
68
|
-
"react-native-svg": "^15.
|
|
67
|
+
"react-native-reanimated": "^3.15.3",
|
|
68
|
+
"react-native-svg": "^15.7.1",
|
|
69
69
|
"react-test-renderer": "^18.3.1",
|
|
70
70
|
"rimraf": "^6.0.1"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@lincle/react-interactive-shared": "^0.4.0-next.
|
|
74
|
-
"@lincle/react-native-base": "^0.4.0-next.
|
|
75
|
-
"@lincle/react-shared": "^0.4.0-next.
|
|
73
|
+
"@lincle/react-interactive-shared": "^0.4.0-next.12",
|
|
74
|
+
"@lincle/react-native-base": "^0.4.0-next.12",
|
|
75
|
+
"@lincle/react-shared": "^0.4.0-next.12"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"@openspacelabs/react-native-zoomable-view": "^2.1.0",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"dragndrop",
|
|
102
102
|
"drag"
|
|
103
103
|
],
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "0ecf2d35d39436bfdde9359aa18dae9e1b60794c"
|
|
105
105
|
}
|