@archireport/react-native-svg-draw 2.2.0 → 2.2.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.
- package/lib/commonjs/components/DrawCore/CurrentAnimatedItem.js.map +1 -1
- package/lib/commonjs/components/DrawCore/CurrentAnimatedText.js.map +1 -1
- package/lib/commonjs/components/DrawCore/DrawContext.js.map +1 -1
- package/lib/commonjs/components/DrawCore/DrawPad.js +7 -2
- package/lib/commonjs/components/DrawCore/DrawPad.js.map +1 -1
- package/lib/commonjs/components/DrawCore/DrawProvider.js.map +1 -1
- package/lib/commonjs/components/DrawCore/Item.js.map +1 -1
- package/lib/commonjs/components/DrawCore/index.js +28 -23
- package/lib/commonjs/components/DrawCore/index.js.map +1 -1
- package/lib/commonjs/components/DrawCore/useDrawHook.js.map +1 -1
- package/lib/commonjs/components/DrawWithOptions/ArrowSvg.js.map +1 -1
- package/lib/commonjs/components/DrawWithOptions/CancelSvg.js.map +1 -1
- package/lib/commonjs/components/DrawWithOptions/CircleSvg.js.map +1 -1
- package/lib/commonjs/components/DrawWithOptions/CloseSvg.js.map +1 -1
- package/lib/commonjs/components/DrawWithOptions/DoubleHeadSvg.js.map +1 -1
- package/lib/commonjs/components/DrawWithOptions/PenSvg.js.map +1 -1
- package/lib/commonjs/components/DrawWithOptions/SendSvg.js.map +1 -1
- package/lib/commonjs/components/DrawWithOptions/SliderSvg.js.map +1 -1
- package/lib/commonjs/components/DrawWithOptions/SquareSvg.js.map +1 -1
- package/lib/commonjs/components/DrawWithOptions/TextSvg.js.map +1 -1
- package/lib/commonjs/components/DrawWithOptions/ThrashSvg.js.map +1 -1
- package/lib/commonjs/components/DrawWithOptions/index.js.map +1 -1
- package/lib/commonjs/components/Slider/ColorSlider.js.map +1 -1
- package/lib/commonjs/components/Slider/Sliders.js.map +1 -1
- package/lib/commonjs/components/Slider/StrokeSlider.js.map +1 -1
- package/lib/commonjs/components/Slider/sliderStyle.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/DrawCore/CurrentAnimatedItem.js.map +1 -1
- package/lib/module/components/DrawCore/CurrentAnimatedText.js.map +1 -1
- package/lib/module/components/DrawCore/DrawContext.js.map +1 -1
- package/lib/module/components/DrawCore/DrawPad.js +7 -2
- package/lib/module/components/DrawCore/DrawPad.js.map +1 -1
- package/lib/module/components/DrawCore/DrawProvider.js.map +1 -1
- package/lib/module/components/DrawCore/Item.js.map +1 -1
- package/lib/module/components/DrawCore/index.js +28 -23
- package/lib/module/components/DrawCore/index.js.map +1 -1
- package/lib/module/components/DrawCore/useDrawHook.js.map +1 -1
- package/lib/module/components/DrawWithOptions/ArrowSvg.js.map +1 -1
- package/lib/module/components/DrawWithOptions/CancelSvg.js.map +1 -1
- package/lib/module/components/DrawWithOptions/CircleSvg.js.map +1 -1
- package/lib/module/components/DrawWithOptions/CloseSvg.js.map +1 -1
- package/lib/module/components/DrawWithOptions/DoubleHeadSvg.js.map +1 -1
- package/lib/module/components/DrawWithOptions/PenSvg.js.map +1 -1
- package/lib/module/components/DrawWithOptions/SendSvg.js.map +1 -1
- package/lib/module/components/DrawWithOptions/SliderSvg.js.map +1 -1
- package/lib/module/components/DrawWithOptions/SquareSvg.js.map +1 -1
- package/lib/module/components/DrawWithOptions/TextSvg.js.map +1 -1
- package/lib/module/components/DrawWithOptions/ThrashSvg.js.map +1 -1
- package/lib/module/components/DrawWithOptions/index.js.map +1 -1
- package/lib/module/components/Slider/ColorSlider.js.map +1 -1
- package/lib/module/components/Slider/Sliders.js.map +1 -1
- package/lib/module/components/Slider/StrokeSlider.js.map +1 -1
- package/lib/typescript/components/DrawCore/CurrentAnimatedItem.d.ts +1 -0
- package/lib/typescript/components/DrawCore/CurrentAnimatedItem.d.ts.map +1 -1
- package/lib/typescript/components/DrawCore/CurrentAnimatedText.d.ts +1 -0
- package/lib/typescript/components/DrawCore/CurrentAnimatedText.d.ts.map +1 -1
- package/lib/typescript/components/DrawCore/DrawPad.d.ts +3 -1
- package/lib/typescript/components/DrawCore/DrawPad.d.ts.map +1 -1
- package/lib/typescript/components/DrawCore/Item.d.ts +1 -0
- package/lib/typescript/components/DrawCore/Item.d.ts.map +1 -1
- package/lib/typescript/components/DrawCore/index.d.ts +1 -0
- package/lib/typescript/components/DrawCore/index.d.ts.map +1 -1
- package/lib/typescript/components/DrawWithOptions/ArrowSvg.d.ts +1 -0
- package/lib/typescript/components/DrawWithOptions/ArrowSvg.d.ts.map +1 -1
- package/lib/typescript/components/DrawWithOptions/CancelSvg.d.ts +1 -0
- package/lib/typescript/components/DrawWithOptions/CancelSvg.d.ts.map +1 -1
- package/lib/typescript/components/DrawWithOptions/CircleSvg.d.ts +1 -0
- package/lib/typescript/components/DrawWithOptions/CircleSvg.d.ts.map +1 -1
- package/lib/typescript/components/DrawWithOptions/CloseSvg.d.ts +1 -0
- package/lib/typescript/components/DrawWithOptions/CloseSvg.d.ts.map +1 -1
- package/lib/typescript/components/DrawWithOptions/DoubleHeadSvg.d.ts +1 -0
- package/lib/typescript/components/DrawWithOptions/DoubleHeadSvg.d.ts.map +1 -1
- package/lib/typescript/components/DrawWithOptions/PenSvg.d.ts +1 -0
- package/lib/typescript/components/DrawWithOptions/PenSvg.d.ts.map +1 -1
- package/lib/typescript/components/DrawWithOptions/SendSvg.d.ts +1 -0
- package/lib/typescript/components/DrawWithOptions/SendSvg.d.ts.map +1 -1
- package/lib/typescript/components/DrawWithOptions/SliderSvg.d.ts +1 -0
- package/lib/typescript/components/DrawWithOptions/SliderSvg.d.ts.map +1 -1
- package/lib/typescript/components/DrawWithOptions/SquareSvg.d.ts +1 -0
- package/lib/typescript/components/DrawWithOptions/SquareSvg.d.ts.map +1 -1
- package/lib/typescript/components/DrawWithOptions/TextSvg.d.ts +1 -0
- package/lib/typescript/components/DrawWithOptions/TextSvg.d.ts.map +1 -1
- package/lib/typescript/components/DrawWithOptions/ThrashSvg.d.ts +1 -0
- package/lib/typescript/components/DrawWithOptions/ThrashSvg.d.ts.map +1 -1
- package/lib/typescript/components/Slider/StrokeSlider.d.ts +1 -0
- package/lib/typescript/components/Slider/StrokeSlider.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/DrawCore/DrawPad.tsx +3 -1
- package/src/components/DrawCore/index.tsx +34 -30
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SendSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/SendSvg.tsx"],"names":[],"mappings":"AACA,OAAY,EAAE,QAAQ,EAAW,MAAM,kBAAkB,CAAC;AAE1D,iBAAS,OAAO,CAAC,KAAK,EAAE,QAAQ,eAQ/B;AAED,eAAe,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"SendSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/SendSvg.tsx"],"names":[],"mappings":";AACA,OAAY,EAAE,QAAQ,EAAW,MAAM,kBAAkB,CAAC;AAE1D,iBAAS,OAAO,CAAC,KAAK,EAAE,QAAQ,eAQ/B;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliderSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/SliderSvg.tsx"],"names":[],"mappings":"AAEA,OAAY,EAAE,QAAQ,EAAQ,MAAM,kBAAkB,CAAC;AAEvD,iBAAS,SAAS,CAAC,KAAK,EAAE,QAAQ,eAiBjC;AAED,eAAe,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"SliderSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/SliderSvg.tsx"],"names":[],"mappings":";AAEA,OAAY,EAAE,QAAQ,EAAQ,MAAM,kBAAkB,CAAC;AAEvD,iBAAS,SAAS,CAAC,KAAK,EAAE,QAAQ,eAiBjC;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SquareSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/SquareSvg.tsx"],"names":[],"mappings":"AACA,OAAY,EAA4B,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE3E,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,QAAQ,eAoBhD"}
|
|
1
|
+
{"version":3,"file":"SquareSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/SquareSvg.tsx"],"names":[],"mappings":";AACA,OAAY,EAA4B,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE3E,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,QAAQ,eAoBhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/TextSvg.tsx"],"names":[],"mappings":"AACA,OAAY,EAAE,QAAQ,EAA4B,MAAM,kBAAkB,CAAC;AAE3E,iBAAS,YAAY,CAAC,KAAK,EAAE,QAAQ,eAoBpC;AAED,eAAe,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"TextSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/TextSvg.tsx"],"names":[],"mappings":";AACA,OAAY,EAAE,QAAQ,EAA4B,MAAM,kBAAkB,CAAC;AAE3E,iBAAS,YAAY,CAAC,KAAK,EAAE,QAAQ,eAoBpC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThrashSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/ThrashSvg.tsx"],"names":[],"mappings":"AACA,OAAY,EAAE,QAAQ,EAAQ,MAAM,kBAAkB,CAAC;AAEvD,iBAAS,SAAS,CAAC,KAAK,EAAE,QAAQ,eAiCjC;AAED,eAAe,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"ThrashSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/ThrashSvg.tsx"],"names":[],"mappings":";AACA,OAAY,EAAE,QAAQ,EAAQ,MAAM,kBAAkB,CAAC;AAEvD,iBAAS,SAAS,CAAC,KAAK,EAAE,QAAQ,eAiCjC;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StrokeSlider.d.ts","sourceRoot":"","sources":["../../../../src/components/Slider/StrokeSlider.tsx"],"names":[],"mappings":"AA6BA,QAAA,MAAM,YAAY;cAIN,MAAM;cACN,MAAM;iBAoEjB,CAAC;AACF,eAAe,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"StrokeSlider.d.ts","sourceRoot":"","sources":["../../../../src/components/Slider/StrokeSlider.tsx"],"names":[],"mappings":";AA6BA,QAAA,MAAM,YAAY;cAIN,MAAM;cACN,MAAM;iBAoEjB,CAAC;AACF,eAAe,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -12,15 +12,17 @@ const DrawPad = ({
|
|
|
12
12
|
doneItems,
|
|
13
13
|
onPressItem,
|
|
14
14
|
onTextHeightChange,
|
|
15
|
+
addBackground = false,
|
|
15
16
|
}: {
|
|
16
17
|
currentItem: Animated.SharedValue<DrawItem | null>;
|
|
17
18
|
doneItems: Array<DrawItem>;
|
|
18
19
|
onPressItem: (item: DrawItem, index: number) => () => void;
|
|
19
20
|
onTextHeightChange: (height: number) => void;
|
|
21
|
+
addBackground?: boolean;
|
|
20
22
|
}) => {
|
|
21
23
|
return (
|
|
22
24
|
<>
|
|
23
|
-
<Svg>
|
|
25
|
+
<Svg style={addBackground ? { backgroundColor: 'white' } : null}>
|
|
24
26
|
<Defs>
|
|
25
27
|
<Circle
|
|
26
28
|
id="selectionIndicator"
|
|
@@ -35,11 +35,11 @@ const styles = StyleSheet.create({
|
|
|
35
35
|
flex: 1,
|
|
36
36
|
},
|
|
37
37
|
drawZone: {
|
|
38
|
-
flex: 1,
|
|
39
38
|
alignContent: 'center',
|
|
40
39
|
alignItems: 'center',
|
|
40
|
+
width: '100%',
|
|
41
|
+
height: '100%',
|
|
41
42
|
},
|
|
42
|
-
|
|
43
43
|
bgImage: { width: '100%', height: '100%' },
|
|
44
44
|
textInput: {
|
|
45
45
|
backgroundColor: '#262626',
|
|
@@ -1151,8 +1151,10 @@ const DrawCore = ({
|
|
|
1151
1151
|
|
|
1152
1152
|
const textInputContainerStyle = useAnimatedStyle(() => {
|
|
1153
1153
|
return {
|
|
1154
|
-
|
|
1155
|
-
|
|
1154
|
+
position: 'absolute',
|
|
1155
|
+
top: 0,
|
|
1156
|
+
height: 50,
|
|
1157
|
+
width: '100%',
|
|
1156
1158
|
display: 'flex',
|
|
1157
1159
|
opacity: showTextInput.value ? withTiming(1) : withTiming(0),
|
|
1158
1160
|
};
|
|
@@ -1160,7 +1162,8 @@ const DrawCore = ({
|
|
|
1160
1162
|
|
|
1161
1163
|
const textInputStyle = useAnimatedStyle(() => {
|
|
1162
1164
|
return {
|
|
1163
|
-
|
|
1165
|
+
color: 'white',
|
|
1166
|
+
height: 20,
|
|
1164
1167
|
display: showTextInput.value ? 'flex' : 'none',
|
|
1165
1168
|
opacity: showTextInput.value ? withTiming(1) : withTiming(0),
|
|
1166
1169
|
};
|
|
@@ -1168,31 +1171,6 @@ const DrawCore = ({
|
|
|
1168
1171
|
|
|
1169
1172
|
return (
|
|
1170
1173
|
<View style={styles.container}>
|
|
1171
|
-
{Platform.OS === 'ios' ? (
|
|
1172
|
-
<InputAccessoryView>
|
|
1173
|
-
<AnimatedTextInput
|
|
1174
|
-
ref={textInputRef}
|
|
1175
|
-
style={[styles.textInput, textInputStyle]}
|
|
1176
|
-
onEndEditing={textInputRef.current?.clear}
|
|
1177
|
-
onChangeText={setTextVal}
|
|
1178
|
-
value={textVal}
|
|
1179
|
-
autoCorrect={false}
|
|
1180
|
-
/>
|
|
1181
|
-
</InputAccessoryView>
|
|
1182
|
-
) : (
|
|
1183
|
-
<Animated.View style={textInputContainerStyle}>
|
|
1184
|
-
{currentItem.value?.type === 'text' && (
|
|
1185
|
-
<TextInput
|
|
1186
|
-
ref={textInputRef}
|
|
1187
|
-
style={styles.textInput}
|
|
1188
|
-
onEndEditing={textInputRef.current?.clear}
|
|
1189
|
-
onChangeText={setTextVal}
|
|
1190
|
-
value={textVal}
|
|
1191
|
-
autoCorrect={false}
|
|
1192
|
-
/>
|
|
1193
|
-
)}
|
|
1194
|
-
</Animated.View>
|
|
1195
|
-
)}
|
|
1196
1174
|
<View
|
|
1197
1175
|
style={[
|
|
1198
1176
|
styles.drawZone,
|
|
@@ -1239,6 +1217,7 @@ const DrawCore = ({
|
|
|
1239
1217
|
style={drawRegion}
|
|
1240
1218
|
>
|
|
1241
1219
|
<DrawPad
|
|
1220
|
+
addBackground
|
|
1242
1221
|
currentItem={currentItem}
|
|
1243
1222
|
doneItems={drawState.doneItems}
|
|
1244
1223
|
onPressItem={onPressItem}
|
|
@@ -1249,6 +1228,31 @@ const DrawCore = ({
|
|
|
1249
1228
|
</View>
|
|
1250
1229
|
</Animated.View>
|
|
1251
1230
|
</PanGestureHandler>
|
|
1231
|
+
{Platform.OS === 'ios' ? (
|
|
1232
|
+
<InputAccessoryView>
|
|
1233
|
+
<AnimatedTextInput
|
|
1234
|
+
ref={textInputRef}
|
|
1235
|
+
style={[styles.textInput, textInputStyle]}
|
|
1236
|
+
onEndEditing={textInputRef.current?.clear}
|
|
1237
|
+
onChangeText={setTextVal}
|
|
1238
|
+
value={textVal}
|
|
1239
|
+
autoCorrect={false}
|
|
1240
|
+
/>
|
|
1241
|
+
</InputAccessoryView>
|
|
1242
|
+
) : (
|
|
1243
|
+
<Animated.View style={textInputContainerStyle}>
|
|
1244
|
+
{currentItem.value?.type === 'text' && (
|
|
1245
|
+
<TextInput
|
|
1246
|
+
ref={textInputRef}
|
|
1247
|
+
style={styles.textInput}
|
|
1248
|
+
onEndEditing={textInputRef.current?.clear}
|
|
1249
|
+
onChangeText={setTextVal}
|
|
1250
|
+
value={textVal}
|
|
1251
|
+
autoCorrect={false}
|
|
1252
|
+
/>
|
|
1253
|
+
)}
|
|
1254
|
+
</Animated.View>
|
|
1255
|
+
)}
|
|
1252
1256
|
</View>
|
|
1253
1257
|
</View>
|
|
1254
1258
|
);
|