@archireport/react-native-svg-draw 1.3.0 → 2.0.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.
Files changed (179) hide show
  1. package/README.md +73 -27
  2. package/lib/commonjs/components/DrawCore/CurrentAnimatedItem.js +55 -54
  3. package/lib/commonjs/components/DrawCore/CurrentAnimatedItem.js.map +1 -1
  4. package/lib/commonjs/components/DrawCore/CurrentAnimatedText.js +3 -14
  5. package/lib/commonjs/components/DrawCore/CurrentAnimatedText.js.map +1 -1
  6. package/lib/commonjs/components/DrawCore/DrawContext.js +18 -0
  7. package/lib/commonjs/components/DrawCore/DrawContext.js.map +1 -0
  8. package/lib/commonjs/components/DrawCore/DrawPad.js +1 -13
  9. package/lib/commonjs/components/DrawCore/DrawPad.js.map +1 -1
  10. package/lib/commonjs/components/DrawCore/DrawProvider.js +103 -0
  11. package/lib/commonjs/components/DrawCore/DrawProvider.js.map +1 -0
  12. package/lib/commonjs/components/DrawCore/Item.js +0 -15
  13. package/lib/commonjs/components/DrawCore/Item.js.map +1 -1
  14. package/lib/commonjs/components/DrawCore/index.js +47 -287
  15. package/lib/commonjs/components/DrawCore/index.js.map +1 -1
  16. package/lib/commonjs/components/DrawCore/useDrawHook.js +76 -0
  17. package/lib/commonjs/components/DrawCore/useDrawHook.js.map +1 -0
  18. package/lib/commonjs/components/DrawWithOptions/ArrowSvg.js +0 -6
  19. package/lib/commonjs/components/DrawWithOptions/ArrowSvg.js.map +1 -1
  20. package/lib/commonjs/components/DrawWithOptions/CancelSvg.js +0 -6
  21. package/lib/commonjs/components/DrawWithOptions/CancelSvg.js.map +1 -1
  22. package/lib/commonjs/components/DrawWithOptions/CircleSvg.js +0 -6
  23. package/lib/commonjs/components/DrawWithOptions/CircleSvg.js.map +1 -1
  24. package/lib/commonjs/components/DrawWithOptions/CloseSvg.js +0 -6
  25. package/lib/commonjs/components/DrawWithOptions/CloseSvg.js.map +1 -1
  26. package/lib/commonjs/components/DrawWithOptions/DoubleHeadSvg.js +0 -7
  27. package/lib/commonjs/components/DrawWithOptions/DoubleHeadSvg.js.map +1 -1
  28. package/lib/commonjs/components/DrawWithOptions/PenSvg.js +0 -6
  29. package/lib/commonjs/components/DrawWithOptions/PenSvg.js.map +1 -1
  30. package/lib/commonjs/components/DrawWithOptions/SendSvg.js +0 -7
  31. package/lib/commonjs/components/DrawWithOptions/SendSvg.js.map +1 -1
  32. package/lib/commonjs/components/DrawWithOptions/SliderSvg.js +31 -0
  33. package/lib/commonjs/components/DrawWithOptions/SliderSvg.js.map +1 -0
  34. package/lib/commonjs/components/DrawWithOptions/SquareSvg.js +0 -7
  35. package/lib/commonjs/components/DrawWithOptions/SquareSvg.js.map +1 -1
  36. package/lib/commonjs/components/DrawWithOptions/TextSvg.js +0 -7
  37. package/lib/commonjs/components/DrawWithOptions/TextSvg.js.map +1 -1
  38. package/lib/commonjs/components/DrawWithOptions/ThrashSvg.js +27 -10
  39. package/lib/commonjs/components/DrawWithOptions/ThrashSvg.js.map +1 -1
  40. package/lib/commonjs/components/DrawWithOptions/index.js +126 -93
  41. package/lib/commonjs/components/DrawWithOptions/index.js.map +1 -1
  42. package/lib/commonjs/components/{DrawCore → Slider}/ColorSlider.js +47 -78
  43. package/lib/commonjs/components/Slider/ColorSlider.js.map +1 -0
  44. package/lib/commonjs/components/Slider/Sliders.js +88 -0
  45. package/lib/commonjs/components/Slider/Sliders.js.map +1 -0
  46. package/lib/commonjs/components/{DrawCore → Slider}/StrokeSlider.js +38 -57
  47. package/lib/commonjs/components/Slider/StrokeSlider.js.map +1 -0
  48. package/lib/commonjs/components/Slider/sliderStyle.js +37 -0
  49. package/lib/commonjs/components/Slider/sliderStyle.js.map +1 -0
  50. package/lib/commonjs/index.js +7 -3
  51. package/lib/commonjs/index.js.map +1 -1
  52. package/lib/commonjs/types.d.js.map +1 -1
  53. package/lib/module/components/DrawCore/CurrentAnimatedItem.js +56 -43
  54. package/lib/module/components/DrawCore/CurrentAnimatedItem.js.map +1 -1
  55. package/lib/module/components/DrawCore/CurrentAnimatedText.js +3 -7
  56. package/lib/module/components/DrawCore/CurrentAnimatedText.js.map +1 -1
  57. package/lib/module/components/DrawCore/DrawContext.js +11 -0
  58. package/lib/module/components/DrawCore/DrawContext.js.map +1 -0
  59. package/lib/module/components/DrawCore/DrawPad.js +1 -5
  60. package/lib/module/components/DrawCore/DrawPad.js.map +1 -1
  61. package/lib/module/components/DrawCore/DrawProvider.js +94 -0
  62. package/lib/module/components/DrawCore/DrawProvider.js.map +1 -0
  63. package/lib/module/components/DrawCore/Item.js +0 -8
  64. package/lib/module/components/DrawCore/Item.js.map +1 -1
  65. package/lib/module/components/DrawCore/index.js +49 -271
  66. package/lib/module/components/DrawCore/index.js.map +1 -1
  67. package/lib/module/components/DrawCore/useDrawHook.js +69 -0
  68. package/lib/module/components/DrawCore/useDrawHook.js.map +1 -0
  69. package/lib/module/components/DrawWithOptions/ArrowSvg.js +0 -1
  70. package/lib/module/components/DrawWithOptions/ArrowSvg.js.map +1 -1
  71. package/lib/module/components/DrawWithOptions/CancelSvg.js +0 -1
  72. package/lib/module/components/DrawWithOptions/CancelSvg.js.map +1 -1
  73. package/lib/module/components/DrawWithOptions/CircleSvg.js +0 -1
  74. package/lib/module/components/DrawWithOptions/CircleSvg.js.map +1 -1
  75. package/lib/module/components/DrawWithOptions/CloseSvg.js +0 -1
  76. package/lib/module/components/DrawWithOptions/CloseSvg.js.map +1 -1
  77. package/lib/module/components/DrawWithOptions/DoubleHeadSvg.js +0 -1
  78. package/lib/module/components/DrawWithOptions/DoubleHeadSvg.js.map +1 -1
  79. package/lib/module/components/DrawWithOptions/PenSvg.js +0 -1
  80. package/lib/module/components/DrawWithOptions/PenSvg.js.map +1 -1
  81. package/lib/module/components/DrawWithOptions/SendSvg.js +0 -3
  82. package/lib/module/components/DrawWithOptions/SendSvg.js.map +1 -1
  83. package/lib/module/components/DrawWithOptions/SliderSvg.js +22 -0
  84. package/lib/module/components/DrawWithOptions/SliderSvg.js.map +1 -0
  85. package/lib/module/components/DrawWithOptions/SquareSvg.js +0 -1
  86. package/lib/module/components/DrawWithOptions/SquareSvg.js.map +1 -1
  87. package/lib/module/components/DrawWithOptions/TextSvg.js +0 -3
  88. package/lib/module/components/DrawWithOptions/TextSvg.js.map +1 -1
  89. package/lib/module/components/DrawWithOptions/ThrashSvg.js +27 -5
  90. package/lib/module/components/DrawWithOptions/ThrashSvg.js.map +1 -1
  91. package/lib/module/components/DrawWithOptions/index.js +126 -73
  92. package/lib/module/components/DrawWithOptions/index.js.map +1 -1
  93. package/lib/module/components/Slider/ColorSlider.js +95 -0
  94. package/lib/module/components/Slider/ColorSlider.js.map +1 -0
  95. package/lib/module/components/Slider/Sliders.js +79 -0
  96. package/lib/module/components/Slider/Sliders.js.map +1 -0
  97. package/lib/module/components/Slider/StrokeSlider.js +82 -0
  98. package/lib/module/components/Slider/StrokeSlider.js.map +1 -0
  99. package/lib/module/components/Slider/sliderStyle.js +29 -0
  100. package/lib/module/components/Slider/sliderStyle.js.map +1 -0
  101. package/lib/module/index.js +1 -0
  102. package/lib/module/index.js.map +1 -1
  103. package/lib/module/types.d.js.map +1 -1
  104. package/lib/typescript/components/DrawCore/CurrentAnimatedItem.d.ts +1 -1
  105. package/lib/typescript/components/DrawCore/CurrentAnimatedItem.d.ts.map +1 -0
  106. package/lib/typescript/components/DrawCore/CurrentAnimatedText.d.ts +1 -1
  107. package/lib/typescript/components/DrawCore/CurrentAnimatedText.d.ts.map +1 -0
  108. package/lib/typescript/components/DrawCore/DrawContext.d.ts +14 -0
  109. package/lib/typescript/components/DrawCore/DrawContext.d.ts.map +1 -0
  110. package/lib/typescript/components/DrawCore/DrawPad.d.ts +1 -1
  111. package/lib/typescript/components/DrawCore/DrawPad.d.ts.map +1 -0
  112. package/lib/typescript/components/DrawCore/DrawProvider.d.ts +6 -0
  113. package/lib/typescript/components/DrawCore/DrawProvider.d.ts.map +1 -0
  114. package/lib/typescript/components/DrawCore/Item.d.ts +1 -1
  115. package/lib/typescript/components/DrawCore/Item.d.ts.map +1 -0
  116. package/lib/typescript/components/DrawCore/index.d.ts +4 -11
  117. package/lib/typescript/components/DrawCore/index.d.ts.map +1 -0
  118. package/lib/typescript/components/DrawCore/useDrawHook.d.ts +18 -0
  119. package/lib/typescript/components/DrawCore/useDrawHook.d.ts.map +1 -0
  120. package/lib/typescript/components/DrawWithOptions/ArrowSvg.d.ts +1 -1
  121. package/lib/typescript/components/DrawWithOptions/ArrowSvg.d.ts.map +1 -0
  122. package/lib/typescript/components/DrawWithOptions/CancelSvg.d.ts +1 -1
  123. package/lib/typescript/components/DrawWithOptions/CancelSvg.d.ts.map +1 -0
  124. package/lib/typescript/components/DrawWithOptions/CircleSvg.d.ts +1 -1
  125. package/lib/typescript/components/DrawWithOptions/CircleSvg.d.ts.map +1 -0
  126. package/lib/typescript/components/DrawWithOptions/CloseSvg.d.ts +1 -1
  127. package/lib/typescript/components/DrawWithOptions/CloseSvg.d.ts.map +1 -0
  128. package/lib/typescript/components/DrawWithOptions/DoubleHeadSvg.d.ts +1 -1
  129. package/lib/typescript/components/DrawWithOptions/DoubleHeadSvg.d.ts.map +1 -0
  130. package/lib/typescript/components/DrawWithOptions/PenSvg.d.ts +1 -1
  131. package/lib/typescript/components/DrawWithOptions/PenSvg.d.ts.map +1 -0
  132. package/lib/typescript/components/DrawWithOptions/SendSvg.d.ts +1 -1
  133. package/lib/typescript/components/DrawWithOptions/SendSvg.d.ts.map +1 -0
  134. package/lib/typescript/components/DrawWithOptions/SliderSvg.d.ts +4 -0
  135. package/lib/typescript/components/DrawWithOptions/SliderSvg.d.ts.map +1 -0
  136. package/lib/typescript/components/DrawWithOptions/SquareSvg.d.ts +1 -1
  137. package/lib/typescript/components/DrawWithOptions/SquareSvg.d.ts.map +1 -0
  138. package/lib/typescript/components/DrawWithOptions/TextSvg.d.ts +1 -1
  139. package/lib/typescript/components/DrawWithOptions/TextSvg.d.ts.map +1 -0
  140. package/lib/typescript/components/DrawWithOptions/ThrashSvg.d.ts +1 -1
  141. package/lib/typescript/components/DrawWithOptions/ThrashSvg.d.ts.map +1 -0
  142. package/lib/typescript/components/DrawWithOptions/index.d.ts +4 -5
  143. package/lib/typescript/components/DrawWithOptions/index.d.ts.map +1 -0
  144. package/lib/typescript/components/Slider/ColorSlider.d.ts +8 -0
  145. package/lib/typescript/components/Slider/ColorSlider.d.ts.map +1 -0
  146. package/lib/typescript/components/Slider/Sliders.d.ts +8 -0
  147. package/lib/typescript/components/Slider/Sliders.d.ts.map +1 -0
  148. package/lib/typescript/components/Slider/StrokeSlider.d.ts +6 -0
  149. package/lib/typescript/components/Slider/StrokeSlider.d.ts.map +1 -0
  150. package/lib/typescript/components/Slider/sliderStyle.d.ts +28 -0
  151. package/lib/typescript/components/Slider/sliderStyle.d.ts.map +1 -0
  152. package/lib/typescript/index.d.ts +2 -0
  153. package/lib/typescript/index.d.ts.map +1 -0
  154. package/package.json +32 -33
  155. package/src/components/DrawCore/CurrentAnimatedItem.tsx +166 -106
  156. package/src/components/DrawCore/DrawContext.tsx +22 -0
  157. package/src/components/DrawCore/DrawPad.tsx +3 -10
  158. package/src/components/DrawCore/DrawProvider.tsx +122 -0
  159. package/src/components/DrawCore/index.tsx +938 -1132
  160. package/src/components/DrawCore/useDrawHook.tsx +70 -0
  161. package/src/components/DrawWithOptions/SliderSvg.tsx +24 -0
  162. package/src/components/DrawWithOptions/ThrashSvg.tsx +29 -2
  163. package/src/components/DrawWithOptions/index.tsx +199 -146
  164. package/src/components/Slider/ColorSlider.tsx +144 -0
  165. package/src/components/Slider/Sliders.tsx +75 -0
  166. package/src/components/Slider/StrokeSlider.tsx +104 -0
  167. package/src/components/Slider/sliderStyle.tsx +28 -0
  168. package/src/index.tsx +1 -0
  169. package/src/types.d.ts +35 -1
  170. package/lib/commonjs/components/DrawCore/ColorSlider.js.map +0 -1
  171. package/lib/commonjs/components/DrawCore/StrokeSlider.js.map +0 -1
  172. package/lib/module/components/DrawCore/ColorSlider.js +0 -119
  173. package/lib/module/components/DrawCore/ColorSlider.js.map +0 -1
  174. package/lib/module/components/DrawCore/StrokeSlider.js +0 -93
  175. package/lib/module/components/DrawCore/StrokeSlider.js.map +0 -1
  176. package/lib/typescript/components/DrawCore/ColorSlider.d.ts +0 -12
  177. package/lib/typescript/components/DrawCore/StrokeSlider.d.ts +0 -9
  178. package/src/components/DrawCore/ColorSlider.tsx +0 -169
  179. package/src/components/DrawCore/StrokeSlider.tsx +0 -117
@@ -0,0 +1,82 @@
1
+ import React from 'react';
2
+ import { PanGestureHandler } from 'react-native-gesture-handler';
3
+ import Animated, { runOnJS, useAnimatedGestureHandler, useAnimatedStyle, useDerivedValue, useSharedValue } from 'react-native-reanimated';
4
+ import { View } from 'react-native';
5
+ import { sliderStyle, TRACK_R } from './sliderStyle';
6
+ import useDrawHook from '../DrawCore/useDrawHook';
7
+ import SliderSvg from '../DrawWithOptions/SliderSvg';
8
+ import { StyleSheet } from 'react-native';
9
+ const styles = StyleSheet.create({
10
+ container: {
11
+ height: 38,
12
+ width: '100%',
13
+ justifyContent: 'center'
14
+ },
15
+ sliderBackground: {
16
+ maxHeight: 15
17
+ }
18
+ });
19
+ const StrokeSlider = _ref => {
20
+ let {
21
+ minValue,
22
+ maxValue
23
+ } = _ref;
24
+ const {
25
+ onColorStrokeChange,
26
+ strokeWidth
27
+ } = useDrawHook();
28
+ const sliderWidth = useSharedValue(0);
29
+ const position = useDerivedValue(() => {
30
+ return sliderWidth.value / (maxValue - minValue) * (strokeWidth.value - minValue);
31
+ });
32
+ const wrapperOnColorStrokeChange = () => {
33
+ onColorStrokeChange();
34
+ };
35
+ const onGestureEvent = useAnimatedGestureHandler({
36
+ onStart: (_ref2, ctx) => {
37
+ let {
38
+ x
39
+ } = _ref2;
40
+ ctx.startX = x;
41
+ },
42
+ onActive: (_ref3, _ref4) => {
43
+ let {
44
+ translationX
45
+ } = _ref3;
46
+ let {
47
+ startX
48
+ } = _ref4;
49
+ strokeWidth.value = Math.min(maxValue, Math.max(minValue, (startX + translationX) / sliderWidth.value * (maxValue - minValue) + minValue));
50
+ },
51
+ onEnd: () => {
52
+ runOnJS(wrapperOnColorStrokeChange)();
53
+ }
54
+ }, []);
55
+ const style = useAnimatedStyle(() => {
56
+ return {
57
+ transform: [{
58
+ translateX: position.value - TRACK_R
59
+ }]
60
+ };
61
+ }, [position.value]);
62
+ return /*#__PURE__*/React.createElement(View, {
63
+ style: sliderStyle.container
64
+ }, /*#__PURE__*/React.createElement(PanGestureHandler, {
65
+ onGestureEvent: onGestureEvent
66
+ }, /*#__PURE__*/React.createElement(Animated.View, {
67
+ style: sliderStyle.container
68
+ }, /*#__PURE__*/React.createElement(View, {
69
+ onLayout: event => {
70
+ sliderWidth.value = event.nativeEvent.layout.width;
71
+ },
72
+ style: styles.container
73
+ }, /*#__PURE__*/React.createElement(SliderSvg, {
74
+ color: "grey",
75
+ preserveAspectRatio: "none",
76
+ style: styles.sliderBackground
77
+ })), /*#__PURE__*/React.createElement(Animated.View, {
78
+ style: [sliderStyle.thumb, style]
79
+ }))));
80
+ };
81
+ export default StrokeSlider;
82
+ //# sourceMappingURL=StrokeSlider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","PanGestureHandler","Animated","runOnJS","useAnimatedGestureHandler","useAnimatedStyle","useDerivedValue","useSharedValue","View","sliderStyle","TRACK_R","useDrawHook","SliderSvg","StyleSheet","styles","create","container","height","width","justifyContent","sliderBackground","maxHeight","StrokeSlider","minValue","maxValue","onColorStrokeChange","strokeWidth","sliderWidth","position","value","wrapperOnColorStrokeChange","onGestureEvent","onStart","ctx","x","startX","onActive","translationX","Math","min","max","onEnd","style","transform","translateX","event","nativeEvent","layout","thumb"],"sourceRoot":"../../../../src","sources":["components/Slider/StrokeSlider.tsx"],"mappings":"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"}
@@ -0,0 +1,29 @@
1
+ import { StyleSheet } from 'react-native';
2
+ export const TRACK_R = 10;
3
+ export const sliderStyle = StyleSheet.create({
4
+ container: {
5
+ height: 40,
6
+ alignItems: 'center',
7
+ width: '100%'
8
+ },
9
+ thumb: {
10
+ position: 'absolute',
11
+ width: TRACK_R * 2,
12
+ height: TRACK_R * 2,
13
+ borderRadius: TRACK_R,
14
+ left: 0,
15
+ backgroundColor: 'white',
16
+ zIndex: 1000,
17
+ borderWidth: 1,
18
+ borderColor: '#E5E5E5',
19
+ marginTop: 9
20
+ },
21
+ track: {
22
+ width: '100%',
23
+ backgroundColor: 'grey',
24
+ height: 6,
25
+ marginTop: 15,
26
+ borderRadius: 3
27
+ }
28
+ });
29
+ //# sourceMappingURL=sliderStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["StyleSheet","TRACK_R","sliderStyle","create","container","height","alignItems","width","thumb","position","borderRadius","left","backgroundColor","zIndex","borderWidth","borderColor","marginTop","track"],"sourceRoot":"../../../../src","sources":["components/Slider/sliderStyle.tsx"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,OAAO,MAAMC,OAAO,GAAG,EAAE;AACzB,OAAO,MAAMC,WAAW,GAAGF,UAAU,CAACG,MAAM,CAAC;EAC3CC,SAAS,EAAE;IACTC,MAAM,EAAE,EAAE;IACVC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE;EACT,CAAC;EACDC,KAAK,EAAE;IACLC,QAAQ,EAAE,UAAU;IACpBF,KAAK,EAAEN,OAAO,GAAG,CAAC;IAClBI,MAAM,EAAEJ,OAAO,GAAG,CAAC;IACnBS,YAAY,EAAET,OAAO;IACrBU,IAAI,EAAE,CAAC;IACPC,eAAe,EAAE,OAAO;IACxBC,MAAM,EAAE,IAAI;IACZC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE,SAAS;IACtBC,SAAS,EAAE;EACb,CAAC;EACDC,KAAK,EAAE;IACLV,KAAK,EAAE,MAAM;IACbK,eAAe,EAAE,MAAM;IACvBP,MAAM,EAAE,CAAC;IACTW,SAAS,EAAE,EAAE;IACbN,YAAY,EAAE;EAChB;AACF,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export { default as DrawCore } from './components/DrawCore';
2
2
  export { default as DrawWithOptions } from './components/DrawWithOptions';
3
+ export { default as DrawProvider } from './components/DrawCore/DrawProvider';
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default","DrawCore","DrawWithOptions"],"sources":["index.tsx"],"sourcesContent":["export { default as DrawCore } from './components/DrawCore';\nexport { default as DrawWithOptions } from './components/DrawWithOptions';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,QAApB,QAAoC,uBAApC;AACA,SAASD,OAAO,IAAIE,eAApB,QAA2C,8BAA3C"}
1
+ {"version":3,"names":["default","DrawCore","DrawWithOptions","DrawProvider"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,OAAO,IAAIC,QAAQ,QAAQ,uBAAuB;AAC3D,SAASD,OAAO,IAAIE,eAAe,QAAQ,8BAA8B;AACzE,SAASF,OAAO,IAAIG,YAAY,QAAQ,oCAAoC"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.d.ts"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport {\n ForeignObjectProps,\n EllipseProps,\n LineProps,\n RectProps,\n} from 'react-native-svg';\n\nexport type Point = { x: number; y: number };\n\nexport type hslColor = `hsl(${number}, ${number | string}%, ${\n | number\n | string}%)`;\n\ntype Size = { width: number; height: number };\n\nexport type DrawItem = (\n | { type: 'singleHead'; data: LineProps }\n | { type: 'doubleHead'; data: LineProps }\n | { type: 'rectangle'; data: RectProps }\n | { type: 'ellipse'; data: EllipseProps }\n | { type: 'text'; data: ForeignObjectProps; text?: string }\n | { type: 'pen'; data: Point[] }\n) & { strokeWidth: number; color: hslColor };\n\nexport type DrawItemType = DrawItem['type'];\n\nexport type DrawCoreProps = {\n drawingContainer: React.Ref<View>;\n deleteSelectedItem: () => void;\n cancelLastAction: () => void;\n takeSnapshot: () => Promise<string | undefined>;\n};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.d.ts"],"mappings":""}
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
2
1
  import Animated from 'react-native-reanimated';
3
2
  import type { DrawItem, Point } from '../../types';
4
3
  export declare const pointsToPath: (points: Point[]) => string;
5
4
  export default function CurrentAnimatedItem({ currentItem, }: {
6
5
  currentItem: Animated.SharedValue<DrawItem | null>;
7
6
  }): JSX.Element;
7
+ //# sourceMappingURL=CurrentAnimatedItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CurrentAnimatedItem.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawCore/CurrentAnimatedItem.tsx"],"names":[],"mappings":"AACA,OAAO,QAIN,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,QAAQ,EAAY,KAAK,EAAE,MAAM,aAAa,CAAC;AAsE7D,eAAO,MAAM,YAAY,WAAY,KAAK,EAAE,WAW3C,CAAC;AAmEF,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,WAAW,GACZ,EAAE;IACD,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;CACpD,eA4IA"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import Animated from 'react-native-reanimated';
3
2
  import type { DrawItem } from '../../types';
4
3
  /**
@@ -9,3 +8,4 @@ export default function CurrentAnimatedText({ currentItem, onHeightChange, }: {
9
8
  currentItem: Animated.SharedValue<DrawItem | null>;
10
9
  onHeightChange: (height: number) => void;
11
10
  }): JSX.Element;
11
+ //# sourceMappingURL=CurrentAnimatedText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CurrentAnimatedText.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawCore/CurrentAnimatedText.tsx"],"names":[],"mappings":"AAEA,OAAO,QAIN,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAgC5C;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,WAAW,EACX,cAAc,GACf,EAAE;IACD,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IACnD,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C,eAsEA"}
@@ -0,0 +1,14 @@
1
+ import type { DrawItem, DrawState, Action } from '../../types';
2
+ import { RefObject } from 'react';
3
+ import type { SharedValue } from 'react-native-reanimated';
4
+ import type ViewShot from 'react-native-view-shot';
5
+ export declare const DrawContext: import("react").Context<{
6
+ drawState: DrawState;
7
+ dispatchDrawStates: React.Dispatch<Action>;
8
+ strokeWidth?: SharedValue<number> | undefined;
9
+ color?: SharedValue<`hsl(${number}, ${string}%, ${string}%)` | `hsl(${number}, ${string}%, ${number}%)` | `hsl(${number}, ${number}%, ${string}%)` | `hsl(${number}, ${number}%, ${number}%)`> | undefined;
10
+ currentItem?: SharedValue<DrawItem | null> | undefined;
11
+ itemIsSelected?: SharedValue<boolean> | undefined;
12
+ viewShot?: RefObject<ViewShot> | undefined;
13
+ }>;
14
+ //# sourceMappingURL=DrawContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrawContext.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawCore/DrawContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AAEnD,eAAO,MAAM,WAAW;eACX,SAAS;wBACA,MAAM,QAAQ,CAAC,MAAM,CAAC;;;;;;EAc1C,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type Animated from 'react-native-reanimated';
3
2
  import type { DrawItem } from '../../types';
4
3
  declare const DrawPad: ({ currentItem, doneItems, onPressItem, onTextHeightChange, }: {
@@ -8,3 +7,4 @@ declare const DrawPad: ({ currentItem, doneItems, onPressItem, onTextHeightChang
8
7
  onTextHeightChange: (height: number) => void;
9
8
  }) => JSX.Element;
10
9
  export default DrawPad;
10
+ //# sourceMappingURL=DrawPad.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrawPad.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawCore/DrawPad.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AAKpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,QAAA,MAAM,OAAO;iBAME,SAAS,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC;eACvC,MAAM,QAAQ,CAAC;wBACN,QAAQ,SAAS,MAAM,KAAK,MAAM,IAAI;iCAC7B,MAAM,KAAK,IAAI;iBAoE7C,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { ReactElement } from 'react';
2
+ declare const DrawProvider: ({ children }: {
3
+ children: ReactElement;
4
+ }) => JSX.Element;
5
+ export default DrawProvider;
6
+ //# sourceMappingURL=DrawProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrawProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawCore/DrawProvider.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,YAAY,EAA+B,MAAM,OAAO,CAAC;AAkFzE,QAAA,MAAM,YAAY;cAA8B,YAAY;iBAoC3D,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
2
1
  import type { DrawItem } from '../../types';
3
2
  export default function Item({ item, onPress, }: {
4
3
  item: DrawItem;
5
4
  onPress: () => void;
6
5
  }): JSX.Element | null;
6
+ //# sourceMappingURL=Item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawCore/Item.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAkB5C,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAC3B,IAAI,EACJ,OAAO,GACR,EAAE;IACD,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,sBA+FA"}
@@ -1,14 +1,7 @@
1
- import React from 'react';
2
- import { ImageURISource, ViewProps } from 'react-native';
3
- import type { DrawItemType, DrawCoreProps } from '../../types';
4
- declare const DrawCore: React.ForwardRefExoticComponent<{
5
- drawingMode: DrawItemType;
1
+ import { ImageRequireSource, ImageURISource } from 'react-native';
2
+ declare const DrawCore: ({ image, backgroundColor, }: {
6
3
  image?: number | ImageURISource | undefined;
7
- linearGradient: React.ComponentType<{
8
- colors: any[];
9
- } & ViewProps>;
10
- onSelectionChange?: ((selected: boolean) => void) | undefined;
11
- onCancelChange?: ((cancel: boolean) => void) | undefined;
12
4
  backgroundColor?: string | undefined;
13
- } & React.RefAttributes<DrawCoreProps>>;
5
+ }) => JSX.Element;
14
6
  export default DrawCore;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawCore/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,kBAAkB,EAClB,cAAc,EAGf,MAAM,cAAc,CAAC;AAyMtB,QAAA,MAAM,QAAQ;;;iBAygCb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ /// <reference types="react-native-reanimated" />
3
+ /// <reference types="react-native-view-shot" />
4
+ declare const useDrawHook: () => {
5
+ drawState: import("../../types").DrawState;
6
+ dispatchDrawStates: import("react").Dispatch<import("../../types").Action>;
7
+ currentItem: import("react-native-reanimated").SharedValue<import("../../types").DrawItem | null>;
8
+ strokeWidth: import("react-native-reanimated").SharedValue<number>;
9
+ color: import("react-native-reanimated").SharedValue<`hsl(${number}, ${string}%, ${string}%)` | `hsl(${number}, ${string}%, ${number}%)` | `hsl(${number}, ${number}%, ${string}%)` | `hsl(${number}, ${number}%, ${number}%)`>;
10
+ onColorStrokeChange: () => void;
11
+ itemIsSelected: import("react-native-reanimated").SharedValue<boolean>;
12
+ cancelLastAction: () => void;
13
+ takeSnapshot: () => Promise<string | undefined>;
14
+ viewShot: import("react").RefObject<import("react-native-view-shot").default>;
15
+ deleteSelectedItem: () => void;
16
+ };
17
+ export default useDrawHook;
18
+ //# sourceMappingURL=useDrawHook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDrawHook.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawCore/useDrawHook.tsx"],"names":[],"mappings":";;;AAGA,QAAA,MAAM,WAAW;;;;;;;;;;;;CAgEhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SvgProps } from 'react-native-svg';
3
2
  export default function ArrowSvg(props: SvgProps): JSX.Element;
3
+ //# sourceMappingURL=ArrowSvg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrowSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/ArrowSvg.tsx"],"names":[],"mappings":"AACA,OAAY,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,QAAQ,eAM/C"}
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SvgProps } from 'react-native-svg';
3
2
  export default function CancelSvg(props: SvgProps): JSX.Element;
3
+ //# sourceMappingURL=CancelSvg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CancelSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/CancelSvg.tsx"],"names":[],"mappings":"AACA,OAAY,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,QAAQ,eAmBhD"}
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SvgProps } from 'react-native-svg';
3
2
  export default function CircleSvg(props: SvgProps): JSX.Element;
3
+ //# sourceMappingURL=CircleSvg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CircleSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/CircleSvg.tsx"],"names":[],"mappings":"AACA,OAAY,EAA4B,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE3E,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,QAAQ,eAoBhD"}
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SvgProps } from 'react-native-svg';
3
2
  export default function CloseSvg(props: SvgProps): JSX.Element;
3
+ //# sourceMappingURL=CloseSvg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CloseSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/CloseSvg.tsx"],"names":[],"mappings":"AACA,OAAY,EAAE,QAAQ,EAAQ,MAAM,kBAAkB,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,QAAQ,eAM/C"}
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SvgProps } from 'react-native-svg';
3
2
  export default function DoubleHeadSvg(props: SvgProps): JSX.Element;
3
+ //# sourceMappingURL=DoubleHeadSvg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DoubleHeadSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/DoubleHeadSvg.tsx"],"names":[],"mappings":"AACA,OAAY,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,QAAQ,eAMpD"}
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SvgProps } from 'react-native-svg';
3
2
  export default function PenSvg(props: SvgProps): JSX.Element;
3
+ //# sourceMappingURL=PenSvg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PenSvg.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/PenSvg.tsx"],"names":[],"mappings":"AACA,OAAY,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,QAAQ,eAU7C"}
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
2
1
  import { SvgProps } from 'react-native-svg';
3
2
  declare function SendSvg(props: SvgProps): JSX.Element;
4
3
  export default SendSvg;
4
+ //# sourceMappingURL=SendSvg.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,4 @@
1
+ import { SvgProps } from 'react-native-svg';
2
+ declare function SvgSlider(props: SvgProps): JSX.Element;
3
+ export default SvgSlider;
4
+ //# sourceMappingURL=SliderSvg.d.ts.map
@@ -0,0 +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,3 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SvgProps } from 'react-native-svg';
3
2
  export default function SquareSvg(props: SvgProps): JSX.Element;
3
+ //# sourceMappingURL=SquareSvg.d.ts.map
@@ -0,0 +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,4 +1,4 @@
1
- /// <reference types="react" />
2
1
  import { SvgProps } from 'react-native-svg';
3
2
  declare function SvgComponent(props: SvgProps): JSX.Element;
4
3
  export default SvgComponent;
4
+ //# sourceMappingURL=TextSvg.d.ts.map
@@ -0,0 +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,4 +1,4 @@
1
- /// <reference types="react" />
2
1
  import { SvgProps } from 'react-native-svg';
3
2
  declare function ThrashSvg(props: SvgProps): JSX.Element;
4
3
  export default ThrashSvg;
4
+ //# sourceMappingURL=ThrashSvg.d.ts.map
@@ -0,0 +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,12 +1,11 @@
1
1
  import React from 'react';
2
2
  import { ViewProps, ImageRequireSource, ImageURISource } from 'react-native';
3
- import type { DrawItemType } from '../../types';
4
- export default function DrawWithOptions({ close, takeSnapshot, linearGradient, image, defaultDrawingMode, }: {
5
- close?: () => void;
6
- takeSnapshot?: (snap: Promise<string | undefined>) => void;
3
+ export default function DrawWithOption({ linearGradient, image, close, takeSnapshot, }: {
7
4
  linearGradient: React.ComponentType<{
8
5
  colors: any[];
9
6
  } & ViewProps>;
10
7
  image?: ImageRequireSource | ImageURISource;
11
- defaultDrawingMode?: DrawItemType;
8
+ close?: () => void;
9
+ takeSnapshot?: (snap: Promise<string | undefined>) => void;
12
10
  }): JSX.Element;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/DrawWithOptions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAChE,OAAO,EAIL,SAAS,EACT,kBAAkB,EAClB,cAAc,EAEf,MAAM,cAAc,CAAC;AAgEtB,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,cAAc,EACd,KAAK,EACL,KAAK,EACL,YAAY,GACb,EAAE;IACD,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,MAAM,EAAE,GAAG,EAAE,CAAA;KAAE,GAAG,SAAS,CAAC,CAAC;IACnE,KAAK,CAAC,EAAE,kBAAkB,GAAG,cAAc,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,KAAK,IAAI,CAAC;CAC5D,eAsNA"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { ViewProps } from 'react-native';
3
+ import type { LinearGradientType } from '../../types';
4
+ declare const ColorSlider: ({ linearGradient: LinearGradient, }: {
5
+ linearGradient: React.ComponentType<LinearGradientType & ViewProps>;
6
+ }) => JSX.Element;
7
+ export default ColorSlider;
8
+ //# sourceMappingURL=ColorSlider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorSlider.d.ts","sourceRoot":"","sources":["../../../../src/components/Slider/ColorSlider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAA2B,SAAS,EAAE,MAAM,cAAc,CAAC;AAalE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAoBtD,QAAA,MAAM,WAAW,wCAEd;IACD,cAAc,EAAE,MAAM,aAAa,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAAC;CACrE,gBAsGA,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { ViewProps } from 'react-native';
3
+ import type { LinearGradientType } from '../../types';
4
+ declare const Sliders: ({ linearGradient, }: {
5
+ linearGradient: React.ComponentType<LinearGradientType & ViewProps>;
6
+ }) => JSX.Element;
7
+ export default Sliders;
8
+ //# sourceMappingURL=Sliders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sliders.d.ts","sourceRoot":"","sources":["../../../../src/components/Slider/Sliders.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAC;AAI/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAwCtD,QAAA,MAAM,OAAO;oBAGK,MAAM,aAAa,CAAC,kBAAkB,GAAG,SAAS,CAAC;iBAwBpE,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ declare const StrokeSlider: ({ minValue, maxValue, }: {
2
+ minValue: number;
3
+ maxValue: number;
4
+ }) => JSX.Element;
5
+ export default StrokeSlider;
6
+ //# sourceMappingURL=StrokeSlider.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,28 @@
1
+ export declare const TRACK_R = 10;
2
+ export declare const sliderStyle: {
3
+ container: {
4
+ height: number;
5
+ alignItems: "center";
6
+ width: string;
7
+ };
8
+ thumb: {
9
+ position: "absolute";
10
+ width: number;
11
+ height: number;
12
+ borderRadius: number;
13
+ left: number;
14
+ backgroundColor: string;
15
+ zIndex: number;
16
+ borderWidth: number;
17
+ borderColor: string;
18
+ marginTop: number;
19
+ };
20
+ track: {
21
+ width: string;
22
+ backgroundColor: string;
23
+ height: number;
24
+ marginTop: number;
25
+ borderRadius: number;
26
+ };
27
+ };
28
+ //# sourceMappingURL=sliderStyle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sliderStyle.d.ts","sourceRoot":"","sources":["../../../../src/components/Slider/sliderStyle.tsx"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,KAAK,CAAC;AAC1B,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;CAyBtB,CAAC"}
@@ -1,2 +1,4 @@
1
1
  export { default as DrawCore } from './components/DrawCore';
2
2
  export { default as DrawWithOptions } from './components/DrawWithOptions';
3
+ export { default as DrawProvider } from './components/DrawCore/DrawProvider';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oCAAoC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archireport/react-native-svg-draw",
3
- "version": "1.3.0",
3
+ "version": "2.0.0",
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",
@@ -13,13 +13,18 @@
13
13
  "android",
14
14
  "ios",
15
15
  "cpp",
16
- "react-native-svg-draw.podspec",
16
+ "*.podspec",
17
17
  "!lib/typescript/example",
18
- "!android/build",
19
18
  "!ios/build",
19
+ "!android/build",
20
+ "!android/gradle",
21
+ "!android/gradlew",
22
+ "!android/gradlew.bat",
23
+ "!android/local.properties",
20
24
  "!**/__tests__",
21
25
  "!**/__fixtures__",
22
- "!**/__mocks__"
26
+ "!**/__mocks__",
27
+ "!**/.*"
23
28
  ],
24
29
  "scripts": {
25
30
  "test": "jest",
@@ -48,29 +53,29 @@
48
53
  "public": true
49
54
  },
50
55
  "devDependencies": {
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
- "eslint-config-prettier": "^7.0.0",
60
- "eslint-plugin-prettier": "^3.1.3",
61
- "husky": "^4.2.5",
62
- "jest": "^28.1.0",
63
- "pod-install": "^0.1.35",
64
- "prettier": "^2.0.5",
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.5.0",
69
- "react-native-reanimated": "^2.9.1",
70
- "react-native-svg": "^12.3.0",
71
- "react-native-view-shot": "^3.3.0",
72
- "release-it": "^15.0.0",
73
- "typescript": "^4.6.4"
56
+ "@arkweid/lefthook": "^0.7.7",
57
+ "@commitlint/config-conventional": "^17.4.4",
58
+ "@react-native-community/eslint-config": "^3.2.0",
59
+ "@release-it/conventional-changelog": "^5.1.1",
60
+ "@types/jest": "^29.5.0",
61
+ "@types/react": "^18.0.34",
62
+ "@types/react-native": "^0.71.5",
63
+ "commitlint": "^17.5.1",
64
+ "eslint": "^8.38.0",
65
+ "eslint-config-prettier": "^8.8.0",
66
+ "eslint-plugin-prettier": "^4.2.1",
67
+ "jest": "^29.5.0",
68
+ "pod-install": "^0.1.38",
69
+ "prettier": "^2.8.7",
70
+ "react": "18.2.0",
71
+ "react-native": "0.71.6",
72
+ "react-native-builder-bob": "^0.20.4",
73
+ "react-native-gesture-handler": "^2.9.0",
74
+ "react-native-reanimated": "^2.14.4",
75
+ "react-native-svg": "^13.5.0",
76
+ "react-native-view-shot": "^3.5.0",
77
+ "release-it": "^15.10.1",
78
+ "typescript": "^5.0.4"
74
79
  },
75
80
  "peerDependencies": {
76
81
  "react": "*",
@@ -87,12 +92,6 @@
87
92
  "<rootDir>/lib/"
88
93
  ]
89
94
  },
90
- "husky": {
91
- "hooks": {
92
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
93
- "pre-commit": "yarn lint && yarn typescript"
94
- }
95
- },
96
95
  "commitlint": {
97
96
  "extends": [
98
97
  "@commitlint/config-conventional"