@archireport/react-native-svg-draw 0.3.4 → 1.0.2
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/lib/commonjs/components/DrawCore/CurrentAnimatedItem.js +5 -9
- package/lib/commonjs/components/DrawCore/CurrentAnimatedItem.js.map +1 -1
- package/lib/commonjs/components/DrawCore/DrawPad.js +2 -1
- package/lib/commonjs/components/DrawCore/DrawPad.js.map +1 -1
- package/lib/commonjs/components/DrawCore/index.js +7 -3
- package/lib/commonjs/components/DrawCore/index.js.map +1 -1
- package/lib/module/components/DrawCore/CurrentAnimatedItem.js +5 -9
- package/lib/module/components/DrawCore/CurrentAnimatedItem.js.map +1 -1
- package/lib/module/components/DrawCore/DrawPad.js +2 -1
- package/lib/module/components/DrawCore/DrawPad.js.map +1 -1
- package/lib/module/components/DrawCore/index.js +7 -3
- package/lib/module/components/DrawCore/index.js.map +1 -1
- package/package.json +19 -19
- package/src/components/DrawCore/CurrentAnimatedItem.tsx +5 -9
- package/src/components/DrawCore/DrawPad.tsx +1 -0
- package/src/components/DrawCore/index.tsx +5 -2
- package/src/types.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archireport/react-native-svg-draw",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "React Native drawing component based on SVG with editable annotations",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -48,29 +48,29 @@
|
|
|
48
48
|
"public": true
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@commitlint/config-conventional": "^
|
|
52
|
-
"@react-native-community/eslint-config": "^
|
|
53
|
-
"@release-it/conventional-changelog": "^
|
|
54
|
-
"@types/jest": "^
|
|
55
|
-
"@types/react": "^
|
|
56
|
-
"@types/react-native": "0.
|
|
57
|
-
"commitlint": "^
|
|
58
|
-
"eslint": "^7.
|
|
51
|
+
"@commitlint/config-conventional": "^16.2.4",
|
|
52
|
+
"@react-native-community/eslint-config": "^3.0.1",
|
|
53
|
+
"@release-it/conventional-changelog": "^5.0.0",
|
|
54
|
+
"@types/jest": "^27.5.0",
|
|
55
|
+
"@types/react": "^17.0.0",
|
|
56
|
+
"@types/react-native": "^0.67.6",
|
|
57
|
+
"commitlint": "^16.2.4",
|
|
58
|
+
"eslint": "^7.32.0",
|
|
59
59
|
"eslint-config-prettier": "^7.0.0",
|
|
60
60
|
"eslint-plugin-prettier": "^3.1.3",
|
|
61
61
|
"husky": "^4.2.5",
|
|
62
|
-
"jest": "^
|
|
63
|
-
"pod-install": "^0.1.
|
|
62
|
+
"jest": "^28.1.0",
|
|
63
|
+
"pod-install": "^0.1.35",
|
|
64
64
|
"prettier": "^2.0.5",
|
|
65
|
-
"react": "
|
|
66
|
-
"react-native": "0.
|
|
67
|
-
"react-native-builder-bob": "^0.18.
|
|
68
|
-
"react-native-gesture-handler": "^
|
|
69
|
-
"react-native-reanimated": "^2.
|
|
70
|
-
"react-native-svg": "^12.
|
|
65
|
+
"react": "17.0.2",
|
|
66
|
+
"react-native": "^0.68.2",
|
|
67
|
+
"react-native-builder-bob": "^0.18.2",
|
|
68
|
+
"react-native-gesture-handler": "^2.4.2",
|
|
69
|
+
"react-native-reanimated": "^2.8.0",
|
|
70
|
+
"react-native-svg": "^12.3.0",
|
|
71
71
|
"react-native-view-shot": "^3.1.2",
|
|
72
|
-
"release-it": "^
|
|
73
|
-
"typescript": "^4.
|
|
72
|
+
"release-it": "^15.0.0",
|
|
73
|
+
"typescript": "^4.4.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"react": "*",
|
|
@@ -86,7 +86,6 @@ export default function CurrentAnimatedItem({
|
|
|
86
86
|
ry: coordinates.ry,
|
|
87
87
|
stroke: hslToRgb(currentItem.value?.color || 'hsl(0, 0%, 0%)'),
|
|
88
88
|
opacity: currentItem.value?.type === 'ellipse' ? 1 : 0,
|
|
89
|
-
fill: 'none',
|
|
90
89
|
strokeWidth:
|
|
91
90
|
currentItem.value?.type === 'ellipse'
|
|
92
91
|
? currentItem.value.strokeWidth
|
|
@@ -107,12 +106,11 @@ export default function CurrentAnimatedItem({
|
|
|
107
106
|
y2: coordinates.y2,
|
|
108
107
|
stroke: hslToRgb(currentItem.value?.color || 'hsl(0, 0%, 0%)'),
|
|
109
108
|
opacity: currentItem.value?.type === 'singleHead' ? 1 : 0,
|
|
110
|
-
fill: 'none',
|
|
111
109
|
strokeWidth:
|
|
112
110
|
currentItem.value?.type === 'singleHead'
|
|
113
111
|
? currentItem.value.strokeWidth
|
|
114
112
|
: 0,
|
|
115
|
-
markerEnd: '
|
|
113
|
+
markerEnd: 'arrowhead',
|
|
116
114
|
};
|
|
117
115
|
}, [currentItem.value]);
|
|
118
116
|
|
|
@@ -129,13 +127,12 @@ export default function CurrentAnimatedItem({
|
|
|
129
127
|
y2: coordinates.y2,
|
|
130
128
|
stroke: hslToRgb(currentItem.value?.color || 'hsl(0, 0%, 0%)'),
|
|
131
129
|
opacity: currentItem.value?.type === 'doubleHead' ? 1 : 0,
|
|
132
|
-
fill: 'none',
|
|
133
130
|
strokeWidth:
|
|
134
131
|
currentItem.value?.type === 'doubleHead'
|
|
135
132
|
? currentItem.value.strokeWidth
|
|
136
133
|
: 0,
|
|
137
|
-
markerStart: '
|
|
138
|
-
markerEnd: '
|
|
134
|
+
markerStart: 'side',
|
|
135
|
+
markerEnd: 'side',
|
|
139
136
|
};
|
|
140
137
|
}, [currentItem.value]);
|
|
141
138
|
|
|
@@ -150,7 +147,6 @@ export default function CurrentAnimatedItem({
|
|
|
150
147
|
width: coordinates.width,
|
|
151
148
|
height: coordinates.height,
|
|
152
149
|
stroke: hslToRgb(currentItem.value?.color || 'hsl(0, 0%, 0%)'),
|
|
153
|
-
fill: 'none',
|
|
154
150
|
opacity: currentItem.value?.type === 'rectangle' ? 1 : 0,
|
|
155
151
|
strokeWidth:
|
|
156
152
|
currentItem.value?.type === 'rectangle'
|
|
@@ -172,8 +168,8 @@ export default function CurrentAnimatedItem({
|
|
|
172
168
|
currentItem.value?.type === 'pen' ? currentItem.value.strokeWidth : 0,
|
|
173
169
|
stroke: hslToRgb(currentItem.value?.color || 'hsl(0, 0%, 0%)'),
|
|
174
170
|
opacity: currentItem.value?.type === 'pen' ? 1 : 0,
|
|
175
|
-
markerStart: '
|
|
176
|
-
markerEnd: '
|
|
171
|
+
markerStart: 'selection',
|
|
172
|
+
markerEnd: 'selection',
|
|
177
173
|
};
|
|
178
174
|
}, [currentItem.value]);
|
|
179
175
|
|
|
@@ -293,10 +293,14 @@ const DrawCore = React.forwardRef<
|
|
|
293
293
|
onSelectionChange?.(false);
|
|
294
294
|
},
|
|
295
295
|
takeSnapshot: async (): Promise<string | undefined> => {
|
|
296
|
+
if (currentItem.value) {
|
|
297
|
+
updateDoneItems(currentItem.value);
|
|
298
|
+
currentItem.value = null;
|
|
299
|
+
}
|
|
296
300
|
return viewShot.current?.capture?.();
|
|
297
301
|
},
|
|
298
302
|
}),
|
|
299
|
-
[currentItem, onSelectionChange]
|
|
303
|
+
[currentItem, onSelectionChange, updateDoneItems]
|
|
300
304
|
);
|
|
301
305
|
|
|
302
306
|
useEffect(() => {
|
|
@@ -1220,7 +1224,6 @@ const DrawCore = React.forwardRef<
|
|
|
1220
1224
|
options={{
|
|
1221
1225
|
format: 'jpg',
|
|
1222
1226
|
quality: 1,
|
|
1223
|
-
...originalImageSize,
|
|
1224
1227
|
}}
|
|
1225
1228
|
style={imageSize}
|
|
1226
1229
|
>
|
package/src/types.d.ts
CHANGED